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
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 m}from"lit";import{property as k,state as p,customElement as f}from"lit/decorators.js";import s from"~labels/core.bookmarks";import{PseudoButtonLitElement as y}from"@typo3/backend/element/pseudo-button.js";import n,{BookmarkStoreChangedEvent as u}from"@typo3/backend/bookmark/bookmark-store.js";import b from"@typo3/backend/notification.js";import"@typo3/backend/element/icon-element.js";import"@typo3/backend/element/spinner-element.js";var r=function(c,e,o,a){var d=arguments.length,i=d<3?e:a===null?a=Object.getOwnPropertyDescriptor(e,o):a,l;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(c,e,o,a);else for(var h=c.length-1;h>=0;h--)(l=c[h])&&(i=(d<3?l(i):d>3?l(e,o,i):l(e,o))||i);return d>3&&i&&Object.defineProperty(e,o,i),i};let t=class extends y{constructor(){super(...arguments),this.route="",this.arguments="",this.displayName="",this.hideLabelText=!1,this.isBookmarked=!1,this.isProcessing=!1,this.handleStoreUpdate=async()=>{await this.checkIfBookmarked(),this.updateState()}}get bookmarkKey(){return n.getBookmarkKey(this.route,this.arguments)}connectedCallback(){super.connectedCallback(),document.addEventListener(u,this.handleStoreUpdate),this.setup()}disconnectedCallback(){super.disconnectedCallback(),document.removeEventListener(u,this.handleStoreUpdate)}createRenderRoot(){return this}render(){const e=this.isBookmarked?s.get("action.remove"):s.get("action.create"),o=this.hideLabelText?m`<span class=visually-hidden>${e}</span>`:m`${e}`;if(this.isProcessing)return m`<typo3-backend-spinner size=small></typo3-backend-spinner>${o}`;const a=this.isBookmarked?"actions-bookmark-remove":"actions-bookmark-add";return m`<typo3-backend-icon identifier=${a} size=small></typo3-backend-icon>${o}`}async buttonActivated(){if(!this.isProcessing){this.isProcessing=!0,this.updateState();try{if(this.isBookmarked){const e=await n.getBookmark(this.bookmarkKey);e&&n.requestDelete(e.id)}else{const e=await n.create(this.route,this.arguments,this.displayName);e.success?b.success(s.get("success.created.title"),s.get("success.created.message")):b.error(s.get("error.createFailed.title"),e.error||s.get("error.createFailed.message"))}}finally{this.isProcessing=!1,await this.checkIfBookmarked(),this.updateState()}}}async setup(){await this.checkIfBookmarked(),this.updateState()}async checkIfBookmarked(){this.isBookmarked=await n.isBookmarked(this.bookmarkKey)}updateState(){this.isProcessing?(this.setAttribute("aria-disabled","true"),this.tabIndex=-1):(this.removeAttribute("aria-disabled"),this.tabIndex=0),this.setAttribute("aria-pressed",this.isBookmarked?"true":"false"),this.title=this.isBookmarked?s.get("action.remove"):s.get("action.create")}};r([k({type:String})],t.prototype,"route",void 0),r([k({type:String})],t.prototype,"arguments",void 0),r([k({type:String,attribute:"display-name"})],t.prototype,"displayName",void 0),r([k({type:Boolean,attribute:"hide-label-text"})],t.prototype,"hideLabelText",void 0),r([p()],t.prototype,"isBookmarked",void 0),r([p()],t.prototype,"isProcessing",void 0),t=r([f("typo3-backend-bookmark-button")],t);export{t as BookmarkButtonElement};
@@ -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{LitElement as b,html as i,nothing as u}from"lit";import{state as h,customElement as f}from"lit/decorators.js";import{repeat as k}from"lit/directives/repeat.js";import c,{BookmarkStoreChangedEvent as g}from"@typo3/backend/bookmark/bookmark-store.js";import"@typo3/backend/element/icon-element.js";import"@typo3/backend/bookmark/bookmark-manager.js";import l from"~labels/core.bookmarks";var m=function(p,e,o,n){var a=arguments.length,t=a<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,o):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")t=Reflect.decorate(p,e,o,n);else for(var r=p.length-1;r>=0;r--)(s=p[r])&&(t=(a<3?s(t):a>3?s(e,o,t):s(e,o))||t);return a>3&&t&&Object.defineProperty(e,o,t),t};let d=class extends b{constructor(){super(...arguments),this.groupedBookmarks=new Map,this.groups=[],this.handleStoreUpdate=()=>{this.syncFromStore()}}connectedCallback(){super.connectedCallback(),document.addEventListener(g,this.handleStoreUpdate),this.syncFromStore()}disconnectedCallback(){super.disconnectedCallback(),document.removeEventListener(g,this.handleStoreUpdate)}createRenderRoot(){return this}render(){return i`<p class=dropdown-headline>${l.get("title")}</p>${this.renderContent()}<hr class=dropdown-divider aria-hidden=true><typo3-backend-bookmark-manager-button class=dropdown-item><span class=dropdown-item-columns> <span class="dropdown-item-column dropdown-item-column-icon" aria-hidden=true><typo3-backend-icon identifier=actions-cog size=small></typo3-backend-icon> </span> <span class="dropdown-item-column dropdown-item-column-title">${l.get("manage")} </span> </span></typo3-backend-bookmark-manager-button>`}async syncFromStore(){this.groupedBookmarks=await c.getGroupedBookmarks({accessibleOnly:!0}),this.groups=await c.getGroups()}renderContent(){if(this.groupedBookmarks.size===0)return i`<p class=dropdown-item-text>${l.get("description")}</p>`;let e=!0;return i`${k(Array.from(this.groupedBookmarks.entries()),([o])=>o,([o,n])=>{const a=this.renderGroup(o,n,e);return e=!1,a})}`}renderGroup(e,o,n){const t=this.groups.find(r=>r.id===e)?.label,s=t||this.groups.length>1;return i`${n?u:i`<hr class=dropdown-divider aria-hidden=true>`} ${s?i`<p class=dropdown-header id=bookmark-group-${e}>${t||l.get("notGrouped")}</p>`:u}<ul class=dropdown-list data-bookmarkgroup=${e}>${k(o,r=>r.id,r=>this.renderBookmarkItem(r,e))}</ul>`}renderBookmarkItem(e,o){return i`<li class=t3js-topbar-bookmark data-bookmarkid=${e.id} data-bookmarkgroup=${o}><button type=button class=dropdown-item title=${e.title} @click=${()=>this.handleNavigate(e)}><span class=dropdown-item-columns> <span class="dropdown-item-column dropdown-item-column-icon" aria-hidden=true><typo3-backend-icon identifier=${e.iconIdentifier} overlay=${e.iconOverlayIdentifier} size=small></typo3-backend-icon> </span> <span class="dropdown-item-column dropdown-item-column-title">${e.title} </span> </span></button></li>`}handleNavigate(e){c.navigate(e)}};m([h()],d.prototype,"groupedBookmarks",void 0),m([h()],d.prototype,"groups",void 0),d=m([f("typo3-backend-bookmark-menu")],d);export{d as BookmarkMenuElement};