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!
*/
import o from"@typo3/core/ajax/ajax-request.js";class r{constructor(e){this.context=e}async execute(){const{fields:e,...t}=this.context.getDataStore(),s=Object.assign({},t,...Object.values(e||{})),a=await(await new o(TYPO3.settings.ajaxUrls.wizard_submit).withQueryArguments({mode:"page_wizard"}).post(s)).resolve();return document.dispatchEvent(new CustomEvent("typo3:pagetree:refresh")),a}}export{r as PageWizardSubmissionService};
@@ -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{topLevelModuleImport as o}from"@typo3/backend/utility/top-level-module-import.js";import{html as a}from"lit";import i,{Size as e}from"@typo3/backend/modal.js";import{SeverityEnum as r}from"@typo3/backend/enum/severity.js";import p from"~labels/backend.layout";const d=async t=>{await o("@typo3/backend/page-wizard/page-wizard.js"),i.advanced({title:p.get("newPage"),content:a`<typo3-backend-page-wizard .configuration=${t}></typo3-backend-page-wizard>`,severity:r.notice,size:{width:e.medium,height:e.large},staticBackdrop:!0,buttons:[]})};export{d as openPageWizardModal};
@@ -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{property as a,customElement as l}from"lit/decorators.js";import{PseudoButtonLitElement as m}from"@typo3/backend/element/pseudo-button.js";import"@typo3/backend/new-record-wizard.js";import{openPageWizardModal as d}from"@typo3/backend/page-wizard/helper/wizard-helper.js";var f=function(n,e,o,r){var i=arguments.length,t=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,o):r,p;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")t=Reflect.decorate(n,e,o,r);else for(var c=n.length-1;c>=0;c--)(p=n[c])&&(t=(i<3?p(t):i>3?p(e,o,t):p(e,o))||t);return i>3&&t&&Object.defineProperty(e,o,t),t};let u=class extends m{constructor(){super(...arguments),this.configuration=null}buttonActivated(){d(this.configuration)}};f([a({type:Object})],u.prototype,"configuration",void 0),u=f([l("typo3-backend-new-page-wizard-button")],u);export{u as NewPageWizardButton};
@@ -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{property as h,state as c,query as f,customElement as m}from"lit/decorators.js";import{LitElement as u,html as l}from"lit";import w from"~labels/backend.layout";import z from"~labels/backend.wizards.general";import S from"@typo3/backend/page-wizard/steps/doktype-step.js";import{AutoAdvanceEvent as b}from"@typo3/backend/wizard/events/auto-advance-event.js";import y from"@typo3/backend/page-wizard/steps/position-step.js";import{loadDynamicSteps as g}from"@typo3/backend/wizard/helper/dynamic-steps-loader.js";import{PageWizardSubmissionService as v}from"@typo3/backend/page-wizard/finisher/page-wizard-submission-service.js";var o=function(s,t,e,a){var n=arguments.length,i=n<3?t:a===null?a=Object.getOwnPropertyDescriptor(t,e):a,p;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(s,t,e,a);else for(var d=s.length-1;d>=0;d--)(p=s[d])&&(i=(n<3?p(i):n>3?p(t,e,i):p(t,e))||i);return n>3&&i&&Object.defineProperty(t,e,i),i};let r=class extends u{constructor(){super(...arguments),this.configuration=null,this.steps=[],this.fixedSteps=[]}firstUpdated(t){super.firstUpdated(t),this.context={wizard:this.wizard,configuration:this.configuration,getStoreData:this.wizard.getStoreData.bind(this.wizard),setStoreData:this.wizard.setStoreData.bind(this.wizard),clearStoreData:this.wizard.clearStoreData.bind(this.wizard),getDataStore:this.wizard.getDataStore.bind(this.wizard),dispatchAutoAdvance:()=>this.wizard.dispatchEvent(new b)},this.steps=this.fixedSteps=[new y(this.context),new S(this.context)],this.submissionService=new v(this.context)}createRenderRoot(){return this}render(){return l`<typo3-backend-wizard .steps=${this.steps} .submissionService=${this.submissionService} confirm-button-label=${w.get("newPage")} @wizard-before-next-step=${this.loadDynamicStepsAfterDoktype}></typo3-backend-wizard>`}loadDynamicStepsAfterDoktype(t){t.detail.currentStepKey==="doktype"&&(t.detail.result=g("page_wizard",this.context).then(e=>{this.steps=[...this.fixedSteps,...e]}).catch(e=>{this.wizard.renderError(z.get("wizard.status.error.message"),e)}))}};o([h({type:Object})],r.prototype,"configuration",void 0),o([c()],r.prototype,"steps",void 0),o([c()],r.prototype,"submissionService",void 0),o([f("typo3-backend-wizard")],r.prototype,"wizard",void 0),r=o([m("typo3-backend-page-wizard")],r);export{r as PageWizard};
@@ -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 d,html as i}from"lit";import{live as k}from"lit/directives/live.js";import{TaskStatus as v,Task as g}from"@lit/task";import o from"~labels/backend.wizards.page";import y from"~labels/core.db.pages";import p from"~labels/core.core";import b from"@typo3/core/ajax/ajax-request.js";import{SeverityEnum as $}from"@typo3/backend/enum/severity.js";class m{constructor(t){this.context=t,this.key="doktype",this.title=y.get("doktype"),this.autoAdvance=!0,this.selectedDoktype=null,this.searchTerm="",this.hasDispatchedAutoAdvance=!1,this.initDoktypesTask()}isComplete(){return this.getValue()!==null}render(){return this.task.status===v.INITIAL&&this.task.run(),this.task.render({complete:t=>{let a=!1,n=d;if(this.getValue()===null){const e=this.context.getStoreData(this.key),s=this.context?.configuration?.doktype??null,c=t.filter(r=>r.value!=="--div--");if(e!=null)this.setValue(e);else if(s!==null)c.some(r=>r.value===s)?(this.setValue(s),a=!0):n=i`<typo3-backend-alert severity=${$.warning} heading=${o.get("step.doktype.not_allowed_doktype.title")} message=${o.get("step.doktype.not_allowed_doktype.message")} show-icon></typo3-backend-alert>`;else if(c.length>0){const[r]=c;this.setValue(r.value),a=c.length===1}}if(a&&!this.hasDispatchedAutoAdvance)return this.hasDispatchedAutoAdvance=!0,this.context.dispatchAutoAdvance(),this.context.wizard.renderLoader();const f=t.filter(e=>e.value==="--div--"||e.label.toLowerCase().includes(this.searchTerm.toLowerCase())),h=[];let l={label:"",items:[]};f.forEach(e=>{e.value==="--div--"?(l.items.length>0&&h.push(l),l={label:e.label,items:[]}):l.items.push(e)}),l.items.length>0&&h.push(l);const u=h.filter(e=>e.items.length>0);return i`${n}<div class=doktype-selection><h2 class=h4>${o.get("step.doktype.headline")}</h2><div class=doktype-selection__search><div class="input-group mb-4"><label for=doktype-search class=visually-hidden>${p.get("labels.label.searchString")}</label> <input type=search autocomplete=off id=doktype-search class="form-control form-control-sm search-input" value=${this.searchTerm} placeholder=${p.get("tree.searchTermInfo")} @input=${e=>this.handleSearch(e)}></div></div>${u.length==0?i`<div role=alert class="alert alert-info">${o.get("step.doktype.filter.noResults")}</div>`:d}<div class=form-check-card-container>${u.map(e=>i`${e.label?i`<h3 class=form-check-card-container-headline>${e.label}</h3>`:d} ${e.items.map(s=>i`<div class="form-check form-check-type-card"><input class=form-check-input type=radio name=doktype id=mode-${s.value} value=${s.value} .checked=${k(this.getValue()===s.value)} @change=${()=>this.setValue(s.value)}> <label class=form-check-label for=mode-${s.value}><span class="form-check-label-header form-check-label-header-inherit"> <typo3-backend-icon identifier=${s.icon} size=small></typo3-backend-icon> ${s.label} </span></label></div>`)}`)}</div></div>`},error:t=>this.context.wizard.renderError(o.get("step.doktype.load_error"),t),pending:()=>this.context.wizard.renderLoader()})}reset(){this.setValue(null),this.context.clearStoreData(this.key),this.initDoktypesTask()}getValue(){return this.selectedDoktype}setValue(t){this.selectedDoktype=t,this.context.wizard.requestUpdate()}beforeAdvance(){this.context.setStoreData(this.key,this.getValue())}getSummaryData(){const t=this.context.getStoreData(this.key);if(!t||!this.task.value)return[];const a=this.task.value.find(n=>n.value===t);return a?[{label:this.title,value:i`<typo3-backend-icon identifier=${a.icon} size=small class=me-1></typo3-backend-icon>${a.label}`}]:[]}handleSearch(t){this.searchTerm=t.target.value,this.context.wizard.requestUpdate()}initDoktypesTask(){this.task=new g(this.context.wizard,{task:async()=>await(await new b(TYPO3.settings.ajaxUrls.wizard_page_get_doktypes).withQueryArguments({data:this.context.getDataStore()}).get()).resolve(),autoRun:!1})}}export{m as DoktypeStep,m 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"@typo3/backend/tree/page-position-select.js";import{html as m}from"lit";import{unsafeHTML as c}from"lit/directives/unsafe-html.js";import{executeJavaScriptModuleInstruction as u}from"@typo3/core/java-script-item-processor.js";import d from"@typo3/core/ajax/ajax-request.js";class l{constructor(t,e){this.context=t,this.autoAdvance=!1,this.key="",this.title="",this.html="",this.modules=[],this.labels={},this.key=e.key,this.title=e.title,this.html=e.html,this.modules=e.modules,this.labels=e.labels}getValue(){const t=this.context.wizard.querySelector('form[name="editform"]');if(!t)return null;const e=this.context.getStoreData("fields")||{},s=new FormData(t);return e[this.key]=Object.fromEntries(Array.from(s.entries()).filter(([,r])=>r!=="")),e}setValue(t){const e=this.context.wizard.querySelector('form[name="editform"]'),s=t?.[this.key];if(!(!e||!s))for(const[r,a]of Object.entries(s)){const i=e.elements.namedItem(r);i&&(delete i.dataset.formengineInputInitialized,i.type==="checkbox"?i.checked=!!a:i.value=a)}}render(){return m`${c(this.html)}`}getSummaryData(){return this.summary}async afterRender(){if(this.setValue(this.context.getStoreData("fields")),this.modules.length>0&&await this.loadModules(),TYPO3.FormEngine){TYPO3.FormEngine.reinitialize();const t=this.context.wizard.querySelector('form[name="editform"]');if(t){t.addEventListener("t3-formengine-postfieldvalidation",()=>{this.context.wizard.requestUpdate()}),t.addEventListener("submit",s=>{s.preventDefault(),this.context.wizard.goToNextStep()});const e=t.querySelector(".has-error");e&&e.focus()}}}isComplete(){return TYPO3.FormEngine&&TYPO3.FormEngine.Validation?TYPO3.FormEngine.Validation.isValid():!0}async beforeAdvance(){const t=this.context.getStoreData("position")?.pageUid||0,e=this.getValue(),s=e[this.key]||{},r={};for(const[o,n]of Object.entries(s))r[this.getLabelKey(o)]=n;const i=await(await new d(TYPO3.settings.ajaxUrls.wizard_page_get_processed_value).withQueryArguments({fields:r,pageUid:t}).get()).resolve();this.summary=Object.keys(r).map(o=>{const n=r[o];return{label:this.labels[o]||o,value:i[o]??n}}),this.context.setStoreData("fields",e)}async loadModules(){const t=this.modules.map(e=>u(e));await Promise.all(t)}getLabelKey(t){const e=t.match(/\[([^\]]+)\]$/);return e?e[1]:t}}export{l as FormEngineStep,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 o}from"lit";import{TaskStatus as c,Task as l}from"@lit/task";import{insertPositionOptions as u}from"@typo3/backend/tree/page-position-select.js";import n from"~labels/core.misc";import h from"@typo3/core/ajax/ajax-request.js";class r{constructor(t){this.context=t,this.key="position",this.title=n.get("selectPosition"),this.autoAdvance=!0,this.positionData=null,this.hasDispatchedAutoAdvance=!1,this.initSummaryTask()}isComplete(){return Number.isFinite(this.positionData?.pageUid)}render(){if(this.getValue()===null){const e=this.context.getStoreData(this.key),s=this.context?.configuration?.positionData??null;if(e!=null)this.setValue(e);else if(s!==null&&(this.setValue(s),(this.context?.configuration?.preventPositionAutoAdvance??!1)==!1&&!this.hasDispatchedAutoAdvance))return this.hasDispatchedAutoAdvance=!0,this.context.dispatchAutoAdvance(),this.context.wizard.renderLoader()}const t=this.getValue();return o`<typo3-backend-component-page-position-select .activePageId=${t?.pageUid} .insertPosition=${t?.insertPosition} @typo3:page-position-select-tree:insert-position-change=${e=>this.handleInsertPositionChange(e)} @typo3:page-position-select-tree:insert-position-confirm=${()=>this.handleInsertPositionConfirm()}></typo3-backend-component-page-position-select>`}reset(){this.setValue(null),this.context.clearStoreData(this.key)}getValue(){return this.positionData}setValue(t){this.positionData=t,this.context.wizard.requestUpdate()}beforeAdvance(){this.context.setStoreData(this.key,this.getValue()),this.initSummaryTask()}getSummaryData(){const t=this.context.getStoreData(this.key),e=t.pageUid,s=u.find(i=>i.value===t.insertPosition);this.summaryTask.status===c.INITIAL&&this.summaryTask.run([e]);const a=this.summaryTask.render({complete:i=>o`<typo3-backend-icon identifier=${i.icon} size=small class=me-1></typo3-backend-icon>${i.title} <code>[pages:${i.uid}]</code>`,error:()=>this.context.wizard.renderError(n.get("pageSelectPositionError")),pending:()=>this.context.wizard.renderLoader()});return[{label:n.get("pageSelectPosition"),value:o`${a} <i>(${s?.label})</i>`}]}handleInsertPositionChange(t){this.setValue({pageUid:t.detail.pageUid,insertPosition:t.detail.position})}handleInsertPositionConfirm(){this.context.dispatchAutoAdvance()}initSummaryTask(){this.summaryTask=new l(this.context.wizard,{task:async([t])=>await(await new h(TYPO3.settings.ajaxUrls.wizard_page_get_page_detail).withQueryArguments({pageUid:t}).get()).resolve(),autoRun:!1})}}export{r as PositionStep,r as default};