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
File diff suppressed because one or more lines are too long
@@ -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{html as r}from"lit";import{live as c}from"lit/directives/live.js";import{Task as d,TaskStatus as h}from"@lit/task";import u from"@typo3/core/ajax/ajax-request.js";import i from"~labels/backend.wizards.localization";class p{constructor(e){this.context=e,this.key="handler",this.title=i.get("step.handler_selection.title"),this.autoAdvance=!0,this.hasDispatchedAutoAdvance=!1,this.selectedHandler=null,this.task=new d(this.context.wizard,{task:async([t,a,n,s,l])=>{if(n==null||s==null||l==null)return[];try{return await(await new u(TYPO3.settings.ajaxUrls.wizard_localization_get_handlers).withQueryArguments({recordType:t,recordUid:a,sourceLanguage:n,targetLanguage:s,mode:l}).get()).resolve()}catch(o){return console.warn("Failed to fetch handlers:",o),[]}},args:()=>[this.context.recordType,this.context.recordUid,this.context.getStoreData("sourceLanguage"),this.context.getStoreData("targetLanguage"),this.context.getStoreData("localizationMode")],autoRun:!1})}isComplete(){return this.getValue()!==null}render(){return this.task.status===h.INITIAL&&this.task.run(),this.task.render({complete:e=>{if(this.getValue()==null){const a=this.context.getStoreData("localizationHandler");a!=null&&this.setValue(a)}let t=!1;return this.getValue()==null&&e.length>0&&(this.setValue(e[0].identifier),e.length===1&&(t=!0)),t&&!this.hasDispatchedAutoAdvance?(this.hasDispatchedAutoAdvance=!0,this.context.dispatchAutoAdvance(),this.context.wizard.renderLoader()):e.length===0?r`<div class="alert alert-warning"><p>${i.get("step.handler_selection.no_handlers")}</p></div>`:r`<div class=localization-handler-selection><h2 class=h4>${i.get("step.handler_selection.headline")}</h2><p>${i.get("step.handler_selection.description")}</p><div class=form-check-card-container>${e.map(a=>this.renderHandlerOption(a))}</div></div>`},error:e=>this.context.wizard.renderError(i.get("step.handler_selection.error"),e),pending:()=>this.context.wizard.renderLoader()})}reset(){this.setValue(null),this.context.clearStoreData("localizationHandler")}getValue(){return this.selectedHandler}setValue(e){this.selectedHandler=e}beforeAdvance(){this.context.setStoreData("localizationHandler",this.getValue())}getSummaryData(){const e=this.context.getStoreData("localizationHandler");if(e==null||!this.task.value)return[];const t=this.task.value.find(a=>a.identifier===e);return t?[{label:i.get("step.handler_selection.summary_label"),value:r`<typo3-backend-icon identifier=${t.iconIdentifier} size=small class=me-1></typo3-backend-icon>${t.label}`}]:[]}renderHandlerOption(e){const t=this.getValue()===e.identifier;return r`<div class="form-check form-check-type-card"><input class=form-check-input type=radio name=localization-handler id=handler-${e.identifier} value=${e.identifier} .checked=${c(t)} @change=${()=>this.setValue(e.identifier)}> <label class=form-check-label for=handler-${e.identifier}><span class=form-check-label-header> <typo3-backend-icon identifier=${e.iconIdentifier} size=small></typo3-backend-icon> ${e.label} </span> <span class=form-check-label-body>${e.description} </span></label></div>`}}export{p as HandlerSelectionStep};
@@ -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{nothing as c,html as o}from"lit";import{live as d}from"lit/directives/live.js";import{unsafeHTML as h}from"lit/directives/unsafe-html.js";import{Task as u,TaskStatus as p}from"@lit/task";import m from"@typo3/core/ajax/ajax-request.js";import i from"~labels/backend.wizards.localization";class l{constructor(e){this.context=e,this.key="mode",this.title=i.get("step.modes.title"),this.autoAdvance=!0,this.hasDispatchedAutoAdvance=!1,this.selectedMode=null,this.task=new u(this.context.wizard,{task:async([a,s,t,r])=>{if(t==null||r==null)return[];try{return await(await new m(TYPO3.settings.ajaxUrls.wizard_localization_get_modes).withQueryArguments({recordType:a,recordUid:s,targetLanguage:t,sourceLanguage:r}).get()).resolve()}catch(n){return console.warn("Failed to fetch localization modes:",n),[]}},args:()=>[this.context.recordType,this.context.recordUid,this.context.getStoreData("targetLanguage"),this.context.getStoreData("sourceLanguage")],autoRun:!1})}isComplete(){return this.getValue()!==null}render(){return this.task.status===p.INITIAL&&this.task.run(),this.task.render({complete:e=>{if(this.getValue()==null){const t=this.context.getStoreData("localizationMode");t!=null&&this.setValue(t)}let a=!1;if(this.getValue()==null&&e.length>0&&(this.setValue(e[0].key),e.length===1&&(a=!0)),a&&!this.hasDispatchedAutoAdvance)return this.hasDispatchedAutoAdvance=!0,this.context.dispatchAutoAdvance(),this.context.wizard.renderLoader();let s=c;return e.length===0?s=o`<div class=text-center><p>${i.get("step.modes.none_available")}</p></div>`:s=o`<p>${i.get("step.modes.description")}</p><div class=form-check-card-container>${e.map(t=>o`<div class="form-check form-check-type-card"><input class=form-check-input type=radio name=localizationMode id=mode-${t.key} value=${t.key} .checked=${d(this.getValue()===t.key)} @change=${()=>this.setValue(t.key)}> <label class=form-check-label for=mode-${t.key}><span class=form-check-label-header> <typo3-backend-icon identifier=${t.iconIdentifier} size=medium></typo3-backend-icon> ${t.label} </span> <span class=form-check-label-body>${h(t.description)} </span></label></div>`)}</div>`,o`<div class=localization-mode-selection><h2 class=h4>${i.get("step.modes.headline")}</h2>${s}</div>`},error:e=>this.context.wizard.renderError(i.get("step.modes.error.message"),e),pending:()=>this.context.wizard.renderLoader()})}reset(){this.setValue(null),this.context.clearStoreData("localizationMode")}getValue(){return this.selectedMode}setValue(e){this.selectedMode=e}beforeAdvance(){this.context.setStoreData("localizationMode",this.getValue())}getSummaryData(){const e=this.context.getStoreData("localizationMode");if(!e||!this.task.value)return[];const a=this.task.value.find(s=>s.key===e);return a?[{label:i.get("step.modes.summary.title"),value:o`<typo3-backend-icon identifier=${a.iconIdentifier} size=small class=me-1></typo3-backend-icon>${a.label}`}]:[]}}export{l as ModeStep,l 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{html as i}from"lit";import{live as o}from"lit/directives/live.js";import{Task as l,TaskStatus as u}from"@lit/task";import d from"@typo3/core/ajax/ajax-request.js";import s from"~labels/backend.wizards.localization";class c{constructor(t){this.context=t,this.key="sourceLanguage",this.title=s.get("step.source_language.title"),this.autoAdvance=!0,this.hasDispatchedAutoAdvance=!1,this.selectedLanguage=null,this.task=new l(this.context.wizard,{task:async([a,e,r])=>{if(r==null)return[];try{return await(await new d(TYPO3.settings.ajaxUrls.wizard_localization_get_sources).withQueryArguments({recordType:a,recordUid:e,targetLanguage:r}).get()).resolve()}catch(n){return console.warn("Failed to fetch source languages:",n),[]}},args:()=>[this.context.recordType,this.context.recordUid,this.context.getStoreData("targetLanguage")],autoRun:!1})}isComplete(){return this.getValue()!=null}render(){return this.task.status===u.INITIAL&&this.task.run(),this.task.render({complete:t=>{if(this.getValue()==null){const e=this.context.getStoreData("sourceLanguage");e!=null&&this.setValue(e)}let a=!1;if(this.getValue()==null&&t.length>0){const e=t.find(r=>r.uid===0)||t[0];this.setValue(e.uid),t.length===1&&(a=!0)}return a&&!this.hasDispatchedAutoAdvance?(this.hasDispatchedAutoAdvance=!0,this.context.dispatchAutoAdvance(),this.context.wizard.renderLoader()):t.length===0?i`<div class=localization-language-selection><h2 class=h4>${s.get("step.source_language.headline")}</h2><div class=text-center><p>${s.get("step.source_language.none_available")}</p></div></div>`:i`<div class=localization-language-selection><h2 class=h4>${s.get("step.source_language.headline")}</h2><p>${s.get("step.source_language.description")}</p><div class=form-check-card-container>${t.map(e=>i`<div class="form-check form-check-type-card"><input class=form-check-input type=radio name=sourceLanguage id=source-lang-${e.uid} value=${e.uid} .checked=${o(this.getValue()===e.uid)} @change=${()=>this.setValue(e.uid)}> <label class=form-check-label for=source-lang-${e.uid}><span class="form-check-label-header form-check-label-header-inherit"> <typo3-backend-icon identifier=${e.flagIcon} size=small></typo3-backend-icon> ${e.title} </span></label></div>`)}</div></div>`},error:t=>this.context.wizard.renderError(s.get("step.source_language.error.message"),t),pending:()=>this.context.wizard.renderLoader()})}reset(){this.setValue(null),this.context.clearStoreData("sourceLanguage")}getValue(){return this.selectedLanguage}setValue(t){this.selectedLanguage=t}beforeAdvance(){this.context.setStoreData("sourceLanguage",this.getValue())}getSummaryData(){const t=this.context.getStoreData("sourceLanguage");if(t==null||!this.task.value)return[];const a=this.task.value.find(e=>e.uid===t);return a?[{label:s.get("step.source_language.summary.title"),value:i`<typo3-backend-icon identifier=${a.flagIcon} size=small class=me-1></typo3-backend-icon>${a.title}`}]:[]}}export{c as SourceLanguageStep,c 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{html as s}from"lit";import{live as g}from"lit/directives/live.js";import{Task as u,TaskStatus as d}from"@lit/task";import h from"@typo3/core/ajax/ajax-request.js";import"@typo3/backend/localization/localization-wizard.js";import r from"~labels/backend.wizards.localization";class c{constructor(t){this.context=t,this.key="targetLanguage",this.title=r.get("step.target_language.title"),this.autoAdvance=!0,this.hasDispatchedAutoAdvance=!1,this.selectedLanguage=null,this.task=new u(this.context.wizard,{task:async([a,e])=>{try{let i=await(await new h(TYPO3.settings.ajaxUrls.wizard_localization_get_targets).withQueryArguments({recordType:a,recordUid:e}).get()).resolve();const l=this.context.targetLanguage;return l!=null&&(i=i.filter(o=>o.uid===l)),i}catch(n){return console.warn("Failed to fetch target languages:",n),[]}},args:()=>[this.context.recordType,this.context.recordUid],autoRun:!1})}isComplete(){return this.getValue()!=null}render(){return this.task.status===d.INITIAL&&this.task.run(),this.task.render({complete:t=>{if(this.getValue()==null){const e=this.context.getStoreData("targetLanguage");e!=null&&this.setValue(e)}let a=!1;if(this.getValue()==null){const e=this.context.targetLanguage;if(e!=null?(this.setValue(e),a=!0):t.length>0&&(this.setValue(t[0].uid),t.length===1&&(a=!0)),a&&!this.hasDispatchedAutoAdvance)return this.hasDispatchedAutoAdvance=!0,this.context.dispatchAutoAdvance(),this.context.wizard.renderLoader()}return t.length===0?s`<div class=localization-language-selection><h2 class=h4>${r.get("step.target_language.headline")}</h2><div class=text-center><p>${r.get("step.target_language.none_available")}</p></div></div>`:s`<div class=localization-language-selection><h2 class=h4>${r.get("step.target_language.headline")}</h2><p>${r.get("step.target_language.description")}</p><div class=form-check-card-container>${t.map(e=>s`<div class="form-check form-check-type-card"><input class=form-check-input type=radio name=targetLanguage id=target-lang-${e.uid} value=${e.uid} .checked=${g(this.getValue()===e.uid)} @change=${()=>this.setValue(e.uid)}> <label class=form-check-label for=target-lang-${e.uid}><span class="form-check-label-header form-check-label-header-inherit"> <typo3-backend-icon identifier=${e.flagIcon} size=small></typo3-backend-icon> ${e.title} </span></label></div>`)}</div></div>`},error:t=>this.context.wizard.renderError(r.get("step.target_language.error.message"),t),pending:()=>this.context.wizard.renderLoader()})}reset(){this.setValue(null),this.context.clearStoreData("targetLanguage")}getValue(){return this.selectedLanguage}setValue(t){this.selectedLanguage=t}beforeAdvance(){this.context.setStoreData("targetLanguage",this.getValue())}getSummaryData(){const t=this.context.getStoreData("targetLanguage");if(t==null||!this.task.value)return[];const a=this.task.value.find(e=>e.uid===t);return a?[{label:r.get("step.target_language.summary.title"),value:s`<typo3-backend-icon identifier=${a.flagIcon} size=small class=me-1></typo3-backend-icon>${a.title}`}]:[]}}export{c as TargetLanguageStep,c as default};