typo3-typescript-sources 14.3.7 → 14.3.9

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.
Files changed (189) hide show
  1. package/.github/workflows/sync-and-publish.yml +240 -191
  2. package/.last-synced-tag +1 -1
  3. package/README.md +13 -5
  4. package/adminpanel/admin-panel.ts +22 -22
  5. package/adminpanel/modules/cache.ts +3 -3
  6. package/backend/action-dispatcher.ts +8 -3
  7. package/backend/bookmark/bookmark-store.ts +5 -5
  8. package/backend/clipboard-panel.ts +2 -2
  9. package/backend/code-editor/element/code-mirror-element.ts +1 -1
  10. package/backend/code-editor/language/typoscript.ts +3 -3
  11. package/backend/code-editor/stream-parser/typoscript.ts +2 -2
  12. package/backend/color-picker.ts +2 -2
  13. package/backend/column-selector-button.ts +11 -8
  14. package/backend/context-help.ts +3 -3
  15. package/backend/context-menu.ts +8 -3
  16. package/backend/drag-tooltip.ts +9 -4
  17. package/backend/drag-uploader.ts +81 -89
  18. package/backend/element/draggable-resizable-element.ts +18 -12
  19. package/backend/element/icon-element.ts +2 -2
  20. package/backend/element/thumbnail-element.ts +2 -2
  21. package/backend/element-browser.ts +1 -1
  22. package/backend/event/consumer-scope.ts +2 -2
  23. package/backend/event/interaction-request-assignment.ts +1 -1
  24. package/backend/event/interaction-request-map.ts +3 -3
  25. package/backend/form-engine/container/flex-form-container-container.ts +2 -2
  26. package/backend/form-engine/container/flex-form-section-container.ts +1 -1
  27. package/backend/form-engine/container/inline-control-container.ts +14 -14
  28. package/backend/form-engine/element/abstract-sortable-select-items.ts +3 -3
  29. package/backend/form-engine/element/color-element.ts +1 -1
  30. package/backend/form-engine/element/datetime-element.ts +1 -1
  31. package/backend/form-engine/element/extra/char-counter.ts +2 -2
  32. package/backend/form-engine/element/extra/select-box-filter.ts +1 -1
  33. package/backend/form-engine/element/mfa-info-element.ts +2 -2
  34. package/backend/form-engine/element/online-media-form-element.ts +8 -4
  35. package/backend/form-engine/element/select-multiple-side-by-side-element.ts +2 -2
  36. package/backend/form-engine/element/select-tree.ts +3 -3
  37. package/backend/form-engine/element/slug-element.ts +7 -7
  38. package/backend/form-engine/element/suggest/result-container.ts +1 -1
  39. package/backend/form-engine/element/table-wizard-element.ts +4 -4
  40. package/backend/form-engine/inline-relation/ajax-dispatcher.ts +3 -3
  41. package/backend/form-engine-validation.ts +11 -5
  42. package/backend/form-engine.ts +19 -23
  43. package/backend/global-event-handler.ts +1 -1
  44. package/backend/hotkeys/hotkey-struct.ts +1 -1
  45. package/backend/hotkeys.ts +3 -3
  46. package/backend/image-manipulation.ts +19 -19
  47. package/backend/layout-module/column-restriction.ts +61 -0
  48. package/backend/layout-module/drag-drop.ts +16 -4
  49. package/backend/layout-module/paste.ts +8 -1
  50. package/backend/live-search/element/result/item/action/action-container.ts +1 -1
  51. package/backend/live-search/element/result/item/item-container.ts +4 -4
  52. package/backend/live-search/element/result/result-container.ts +5 -0
  53. package/backend/live-search/element/result/result-pagination.ts +1 -1
  54. package/backend/live-search/live-search.ts +2 -2
  55. package/backend/localization/label-provider.ts +4 -4
  56. package/backend/localization/localization-wizard.ts +4 -4
  57. package/backend/localization/steps/content-record-selection-step.ts +8 -8
  58. package/backend/localization/steps/handler-selection-step.ts +4 -4
  59. package/backend/localization/steps/mode-step.ts +4 -4
  60. package/backend/localization/steps/source-language-step.ts +4 -4
  61. package/backend/localization/steps/target-language-step.ts +4 -4
  62. package/backend/login-refresh.ts +1 -9
  63. package/backend/login.ts +2 -2
  64. package/backend/modal.ts +38 -5
  65. package/backend/module/iframe.ts +10 -0
  66. package/backend/module/router.ts +10 -0
  67. package/backend/module-menu.ts +3 -3
  68. package/backend/multi-record-selection-action.ts +1 -1
  69. package/backend/multi-record-selection-delete-action.ts +1 -1
  70. package/backend/multi-record-selection.ts +14 -14
  71. package/backend/multi-step-wizard.ts +9 -2
  72. package/backend/new-multiple-pages.ts +2 -2
  73. package/backend/new-record-wizard.ts +15 -15
  74. package/backend/notification.ts +90 -6
  75. package/backend/online-media.ts +1 -3
  76. package/backend/page-wizard/page-wizard.ts +2 -2
  77. package/backend/page-wizard/steps/doktype-step.ts +5 -5
  78. package/backend/pagetsconfig/pagetsconfig-includes.ts +1 -1
  79. package/backend/popover.ts +5 -5
  80. package/backend/record-download-button.ts +5 -6
  81. package/backend/recordlist.ts +11 -6
  82. package/backend/security/element/csp-reports.ts +8 -8
  83. package/backend/setup-module.ts +2 -2
  84. package/backend/sortable-table.ts +10 -4
  85. package/backend/storage/abstract-client-storage.ts +2 -2
  86. package/backend/storage/module-state-storage.ts +2 -2
  87. package/backend/tests/backend/utility/dom-helper-test.ts +2 -2
  88. package/backend/tests/fixtures/modal-autofocus.html +1 -0
  89. package/backend/tests/form-engine/element/extra/select-box-filter-test.ts +3 -3
  90. package/backend/tests/form-engine-validation-test.ts +1 -1
  91. package/backend/tests/modal-test.ts +91 -0
  92. package/backend/tests/notification-test.ts +176 -0
  93. package/backend/tests/tree/tree-test.ts +41 -0
  94. package/backend/tree/file-storage-browser.ts +1 -1
  95. package/backend/tree/file-storage-tree-container.ts +4 -4
  96. package/backend/tree/page-browser.ts +1 -1
  97. package/backend/tree/page-position-select.ts +1 -1
  98. package/backend/tree/page-tree-element.ts +9 -2
  99. package/backend/tree/page-tree.ts +7 -1
  100. package/backend/tree/tree-module-state.ts +5 -5
  101. package/backend/tree/tree.ts +15 -8
  102. package/backend/user-pass-login.ts +2 -2
  103. package/backend/utility/collapse-state-persister.ts +1 -1
  104. package/backend/utility/collapse-state-search.ts +6 -6
  105. package/backend/utility/dom-helper.ts +3 -3
  106. package/backend/utility.ts +6 -6
  107. package/backend/viewport/content-navigation.ts +5 -0
  108. package/backend/viewport/navigation-container.ts +1 -1
  109. package/backend/viewport/toolbar.ts +3 -3
  110. package/backend/window-manager.ts +2 -2
  111. package/backend/wizard/events/auto-advance-event.ts +6 -0
  112. package/backend/wizard/events/before-next-step-event.ts +6 -0
  113. package/backend/wizard/events/step-summary-event.ts +6 -0
  114. package/backend/wizard/move-content-element.ts +1 -1
  115. package/backend/wizard/wizard.ts +8 -10
  116. package/belog/backend-log.ts +2 -2
  117. package/beuser/permissions.ts +2 -2
  118. package/core/ajax/ajax-response.ts +1 -1
  119. package/core/ajax/input-transformer.ts +1 -1
  120. package/core/event/debounce-event.ts +4 -4
  121. package/core/event/event-interface.ts +3 -3
  122. package/core/event/regular-event.ts +7 -7
  123. package/core/event/request-animation-frame-event.ts +4 -4
  124. package/core/event/throttle-event.ts +4 -4
  125. package/core/java-script-item-processor.ts +6 -0
  126. package/core/referrer-refresh.ts +2 -2
  127. package/core/security-utility.ts +1 -1
  128. package/dashboard/dashboard-wizard.ts +2 -2
  129. package/dashboard/dashboard.ts +8 -13
  130. package/dashboard/wizard/steps/preset-step.ts +3 -3
  131. package/extensionmanager/main.ts +7 -7
  132. package/filelist/browse-files.ts +1 -1
  133. package/filelist/browse-folders.ts +2 -2
  134. package/filelist/file-list-dragdrop.ts +5 -5
  135. package/filelist/file-list-rename-handler.ts +3 -6
  136. package/filelist/file-list-replace-handler.ts +3 -6
  137. package/filelist/file-list-transfer-handler.ts +2 -2
  138. package/filelist/file-list.ts +8 -9
  139. package/form/backend/form-editor/component/date-editor.ts +4 -0
  140. package/form/backend/form-editor/component/form-element-selector.ts +4 -0
  141. package/form/backend/form-editor/inspector-component.ts +6 -6
  142. package/form/backend/form-editor/mediator.ts +36 -36
  143. package/form/backend/form-editor/modals-component.ts +115 -6
  144. package/form/backend/form-editor/stage-component.ts +4 -4
  145. package/form/backend/form-editor/view-model.ts +7 -7
  146. package/form/backend/form-manager/view-model.ts +5 -5
  147. package/form/backend/form-wizard/form-wizard.ts +2 -2
  148. package/form/backend/form-wizard/steps/storage-step.ts +1 -1
  149. package/impexp/import-export.ts +1 -1
  150. package/info/translation-status.ts +2 -2
  151. package/install/ajax/ajax-queue.ts +1 -1
  152. package/install/module/abstract-interactable-module.ts +2 -2
  153. package/install/module/environment/image-processing.ts +4 -4
  154. package/install/module/environment/mail-test.ts +2 -2
  155. package/install/module/maintenance/clear-tables.ts +3 -3
  156. package/install/module/maintenance/clear-typo3temp-files.ts +8 -8
  157. package/install/module/maintenance/create-admin.ts +3 -3
  158. package/install/module/maintenance/database-analyzer.ts +9 -7
  159. package/install/module/maintenance/language-packs.ts +4 -4
  160. package/install/module/maintenance/reference-index.ts +1 -1
  161. package/install/module/settings/change-install-tool-password.ts +1 -1
  162. package/install/module/settings/extension-configuration.ts +5 -5
  163. package/install/module/settings/features.ts +1 -1
  164. package/install/module/settings/local-configuration.ts +5 -5
  165. package/install/module/settings/presets.ts +2 -2
  166. package/install/module/settings/system-maintainer.ts +1 -1
  167. package/install/module/upgrade/extension-scanner.ts +5 -5
  168. package/install/module/upgrade/tca-migrations-check.ts +1 -1
  169. package/install/module/upgrade/upgrade-docs.ts +16 -16
  170. package/install/module/upgrade/upgrade-wizards.ts +7 -8
  171. package/install/renderable/language-packs.ts +8 -2
  172. package/lowlevel/query-generator.ts +2 -2
  173. package/package.json +2 -2
  174. package/redirects/event-handler.ts +6 -0
  175. package/rte-ckeditor/ckeditor5.ts +7 -3
  176. package/rte-ckeditor/legacy/ckeditor5-bundle.ts +0 -1
  177. package/rte-ckeditor/plugin/typo3-link.ts +7 -9
  178. package/rte-ckeditor/rte-link-browser.ts +1 -1
  179. package/rte-ckeditor/tests/ckeditor5-test.ts +68 -0
  180. package/scheduler/form-engine/element/timing-options-element.ts +1 -1
  181. package/scheduler/scheduler-add-group.ts +4 -12
  182. package/scheduler/scheduler.ts +2 -2
  183. package/styleguide/checkbox-demo.ts +1 -1
  184. package/tstemplate/template-analyzer.ts +1 -1
  185. package/viewpage/main.ts +1 -1
  186. package/workspaces/backend.ts +5 -5
  187. package/workspaces/preview.ts +41 -2
  188. package/workspaces/renderable/record-table.ts +95 -78
  189. package/workspaces/renderable/send-to-stage-form.ts +1 -1
@@ -293,7 +293,7 @@ class MultiStepWizard {
293
293
  this.initializeSlidePrevEvent($modal);
294
294
 
295
295
  // Event fires when the slide transition is invoked
296
- this.setup.$carousel.get(0).addEventListener('slide.bs.carousel', (evt: Event & Carousel.Event): void => {
296
+ this.setup.$carousel.get(0).addEventListener('slide.bs.carousel', (evt): void => {
297
297
  if (evt.direction === 'left') {
298
298
  this.nextSlideChanges($modal);
299
299
  } else {
@@ -302,7 +302,7 @@ class MultiStepWizard {
302
302
  });
303
303
 
304
304
  // Event is fired when the carousel has completed its slide transition
305
- this.setup.$carousel.get(0).addEventListener('slid.bs.carousel', (evt: Event & Carousel.Event): void => {
305
+ this.setup.$carousel.get(0).addEventListener('slid.bs.carousel', (evt): void => {
306
306
  const currentIndex = this.setup.$carousel.data('currentIndex');
307
307
  const slide = this.setup.slides[currentIndex];
308
308
 
@@ -567,3 +567,10 @@ if (!multistepWizardObject) {
567
567
  }
568
568
 
569
569
  export default multistepWizardObject;
570
+
571
+ declare global {
572
+ interface HTMLElementEventMap {
573
+ 'slide.bs.carousel': Event & Carousel.Event;
574
+ 'slid.bs.carousel': Event & Carousel.Event;
575
+ }
576
+ }
@@ -89,10 +89,10 @@ class NewMultiplePages {
89
89
  * @private
90
90
  */
91
91
  private resetFieldAttributes(this: HTMLInputElement): void {
92
- document.querySelectorAll(Identifiers.containerSelector + ' ' + Identifiers.pageTitleSelector).forEach((inputElement: HTMLInputElement): void => {
92
+ document.querySelectorAll<HTMLInputElement>(Identifiers.containerSelector + ' ' + Identifiers.pageTitleSelector).forEach((inputElement): void => {
93
93
  inputElement.removeAttribute('value');
94
94
  });
95
- document.querySelectorAll(Identifiers.containerSelector + ' ' + Identifiers.doktypeSelector).forEach((selectElement: HTMLSelectElement): void => {
95
+ document.querySelectorAll<HTMLSelectElement>(Identifiers.containerSelector + ' ' + Identifiers.doktypeSelector).forEach((selectElement): void => {
96
96
  for (const option of selectElement) {
97
97
  option.removeAttribute('selected');
98
98
  }
@@ -92,19 +92,19 @@ export class Category {
92
92
  return new Category(
93
93
  data.identifier,
94
94
  data.label,
95
- data.items.map((item: DataItemInterface) => Item.fromData(item))
95
+ data.items.map((item) => Item.fromData(item))
96
96
  );
97
97
  }
98
98
 
99
99
  public reset(): void {
100
100
  this.disabled = false;
101
- this.items.forEach((item: Item): void => {
101
+ this.items.forEach((item): void => {
102
102
  item.reset();
103
103
  });
104
104
  }
105
105
 
106
106
  public activeItems(): Item[] {
107
- return this.items.filter((item: Item): boolean => item.visible) ?? [];
107
+ return this.items.filter((item): boolean => item.visible) ?? [];
108
108
  }
109
109
  }
110
110
 
@@ -116,18 +116,18 @@ export class Categories {
116
116
 
117
117
  public static fromData(data: DataCategoriesInterface) {
118
118
  return new Categories(
119
- Object.values(data).map((item: DataCategoryInterface) => Category.fromData(item))
119
+ Object.values(data).map((item) => Category.fromData(item))
120
120
  );
121
121
  }
122
122
 
123
123
  public reset(): void {
124
- this.items.forEach((item: Category): void => {
124
+ this.items.forEach((item): void => {
125
125
  item.reset();
126
126
  });
127
127
  }
128
128
 
129
129
  public categoriesWithItems(): Category[] {
130
- return this.items.filter((item: Category): boolean => item.activeItems().length > 0) ?? [];
130
+ return this.items.filter((item): boolean => item.activeItems().length > 0) ?? [];
131
131
  }
132
132
  }
133
133
 
@@ -488,11 +488,11 @@ export class NewRecordWizard extends LitElement {
488
488
  }
489
489
 
490
490
  const needsCategoryChange: boolean = this.categories.categoriesWithItems()
491
- .filter((item: Category): boolean => item === this.selectedCategory).length === 0;
491
+ .filter((item): boolean => item === this.selectedCategory).length === 0;
492
492
  if (needsCategoryChange) {
493
493
  if (savedCategoryIdentifier) {
494
494
  this.selectedCategory = this.categories.categoriesWithItems().find(
495
- (category: Category): boolean => category.identifier === savedCategoryIdentifier
495
+ (category): boolean => category.identifier === savedCategoryIdentifier
496
496
  ) ?? this.categories.categoriesWithItems()[0] ?? null;
497
497
  } else {
498
498
  this.selectedCategory = this.categories.categoriesWithItems()[0] ?? null;
@@ -516,16 +516,16 @@ export class NewRecordWizard extends LitElement {
516
516
  protected filter(searchTerm: string): void {
517
517
  this.searchTerm = searchTerm;
518
518
  this.categories.reset();
519
- this.categories.items.forEach((category: Category) => {
519
+ this.categories.items.forEach((category) => {
520
520
  const categoryText = category.label.trim().replace(/\s+/g, ' ');
521
521
  const categoryMatch: boolean = !(this.searchTerm !== '' && !RegExp(this.searchTerm, 'i').test(categoryText));
522
522
  if (!categoryMatch) {
523
- category.items.forEach((item: Item) => {
523
+ category.items.forEach((item) => {
524
524
  const text = item.label.trim().replace(/\s+/g, ' ') + item.description?.trim().replace(/\s+/g, ' ');
525
525
  item.visible = !(this.searchTerm !== '' && !RegExp(this.searchTerm, 'i').test(text));
526
526
  });
527
527
  }
528
- category.disabled = category.items.filter((item: Item): boolean => item.visible).length === 0;
528
+ category.disabled = category.items.filter((item): boolean => item.visible).length === 0;
529
529
  });
530
530
  this.selectAvailableCategory();
531
531
  }
@@ -601,7 +601,7 @@ export class NewRecordWizard extends LitElement {
601
601
  protected renderNavigationList(): TemplateResult {
602
602
  return html`
603
603
  <div class="navigation-list${(this.toggleMenu === true) ? ' show' : ''}" role="tablist" aria-orientation="vertical">
604
- ${this.categories.items.map((category: Category) => {
604
+ ${this.categories.items.map((category) => {
605
605
  return html`
606
606
  <button
607
607
  data-identifier="${category.identifier}"
@@ -633,7 +633,7 @@ export class NewRecordWizard extends LitElement {
633
633
 
634
634
  protected handleNavigationKeydown(event: KeyboardEvent, category: Category): void {
635
635
  const activeCategories = this.categories.categoriesWithItems();
636
- const currentIndex = activeCategories.findIndex((item: Category): boolean => item.identifier === category.identifier);
636
+ const currentIndex = activeCategories.findIndex((item): boolean => item.identifier === category.identifier);
637
637
  let selectedCategory: Category | undefined = undefined;
638
638
 
639
639
  if (event.key === KeyTypesEnum.UP) {
@@ -654,7 +654,7 @@ export class NewRecordWizard extends LitElement {
654
654
  protected renderCategories(): TemplateResult {
655
655
  return html`
656
656
  <div class="elementwizard-categories">
657
- ${this.categories.items.map((category: Category) => {
657
+ ${this.categories.items.map((category) => {
658
658
  return this.renderCategory(category);
659
659
  })}
660
660
  </div>
@@ -672,7 +672,7 @@ export class NewRecordWizard extends LitElement {
672
672
  </div>`
673
673
  : nothing}
674
674
  <div class="elementwizard-category-items">
675
- ${category.items.map((item: Item) => this.renderCategoryItem(item))}
675
+ ${category.items.map((item) => this.renderCategoryItem(item))}
676
676
  </div>
677
677
  </div>` :
678
678
  nothing
@@ -11,7 +11,7 @@
11
11
  * The TYPO3 project - inspiring people to share!
12
12
  */
13
13
 
14
- import { LitElement, html, type TemplateResult } from 'lit';
14
+ import { LitElement, html, nothing, type TemplateResult } from 'lit';
15
15
  import { customElement, property, state } from 'lit/decorators.js';
16
16
  import { classMap } from 'lit/directives/class-map.js';
17
17
  import { ifDefined } from 'lit/directives/if-defined.js';
@@ -119,16 +119,20 @@ class Notification {
119
119
  if (this.messageContainer === null || document.getElementById('alert-container') === null) {
120
120
  this.messageContainer = document.createElement('div');
121
121
  this.messageContainer.setAttribute('id', 'alert-container');
122
+ this.messageContainer.setAttribute('popover', 'manual');
122
123
  this.notificationList = document.createElement('div');
123
124
  this.notificationList.setAttribute('class', 'alert-list');
124
125
  // Enable focusing for keyboard scrolling (accessibility)
125
126
  this.notificationList.setAttribute('tabindex', '0');
127
+ this.notificationList.setAttribute('aria-live', 'polite');
126
128
  this.messageContainer.appendChild(this.notificationList);
127
129
 
128
130
  this.clearAllButton = <ClearNotificationMessages>document.createElement('typo3-notification-clear-all');
129
131
  this.containerItemVisibility();
130
132
  this.messageContainer.prepend(this.clearAllButton);
131
- document.body.appendChild(this.messageContainer);
133
+ const target = document.querySelector('typo3-backend-modal:last-of-type .alert-container') ?? document.body;
134
+ target.appendChild(this.messageContainer);
135
+ this.messageContainer.showPopover();
132
136
 
133
137
  document.addEventListener('typo3-notification-open', () => {
134
138
  this.totalNotifications++;
@@ -165,7 +169,20 @@ class Notification {
165
169
 
166
170
  protected static containerItemVisibility() {
167
171
  this.clearAllButton.hidden = this.totalNotifications < this.showClearAllButtonCount;
168
- this.messageContainer.hidden = this.totalNotifications === 0;
172
+ try {
173
+ // Always hide first to ensure we are moved into the foremost top-layer
174
+ this.messageContainer.hidePopover();
175
+ } catch (e: unknown) {
176
+ if (e instanceof DOMException && e.name === 'InvalidStateError') {
177
+ // Ignored, since popover does not signal showing state,
178
+ // but may throw when `hidePopover()` is called on a hidden element
179
+ } else {
180
+ throw e;
181
+ }
182
+ }
183
+ if (this.totalNotifications > 0) {
184
+ this.messageContainer.showPopover();
185
+ }
169
186
  }
170
187
  }
171
188
 
@@ -204,6 +221,13 @@ export class NotificationMessage extends LitElement {
204
221
 
205
222
  @state() executingAction: number = -1;
206
223
 
224
+ private dismissTimer: number | null = null;
225
+ private remainingDuration: number = 0;
226
+ private timerStartedAt: number = 0;
227
+ private dismissalArmed: boolean = false;
228
+ private pointerInside: boolean = false;
229
+ private focusInside: boolean = false;
230
+
207
231
  public override async firstUpdated(): Promise<void> {
208
232
  document.addEventListener('typo3-notification-clear-all', async () => {
209
233
  this.clear();
@@ -212,15 +236,42 @@ export class NotificationMessage extends LitElement {
212
236
  const event = new CustomEvent('typo3-notification-open', { bubbles: true, composed: true });
213
237
  this.dispatchEvent(event);
214
238
 
239
+ if (this.notificationDuration > 0) {
240
+ // Reading a message or reaching its actions takes the time it takes, so the countdown
241
+ // pauses while the notification is pointed at or focused. This is tracked from the start,
242
+ // the pointer may already rest where the notification appears.
243
+ this.remainingDuration = this.notificationDuration * 1000;
244
+ this.addEventListener('mouseenter', (): void => {
245
+ this.pointerInside = true;
246
+ this.pauseDismissal();
247
+ });
248
+ this.addEventListener('focusin', (): void => {
249
+ this.focusInside = true;
250
+ this.pauseDismissal();
251
+ });
252
+ this.addEventListener('mouseleave', (): void => {
253
+ this.pointerInside = false;
254
+ this.resumeDismissal();
255
+ });
256
+ this.addEventListener('focusout', (event: FocusEvent): void => {
257
+ this.focusInside = event.relatedTarget instanceof Node && this.contains(event.relatedTarget);
258
+ this.resumeDismissal();
259
+ });
260
+ }
261
+
215
262
  await new Promise(resolve => window.setTimeout(resolve, 200));
216
263
  await this.requestUpdate();
217
264
  if (this.notificationDuration > 0) {
218
- await new Promise(resolve => window.setTimeout(resolve, this.notificationDuration * 1000));
219
- this.clear();
265
+ this.dismissalArmed = true;
266
+ this.resumeDismissal();
220
267
  }
221
268
  }
222
269
 
223
270
  public async clear(): Promise<void> {
271
+ if (this.dismissTimer !== null) {
272
+ window.clearTimeout(this.dismissTimer);
273
+ this.dismissTimer = null;
274
+ }
224
275
  this.dispatchEvent(
225
276
  new CustomEvent('typo3-notification-clear', { bubbles: true, composed: true })
226
277
  );
@@ -307,12 +358,18 @@ export class NotificationMessage extends LitElement {
307
358
  ${this.actions.map((action, index) => html`
308
359
  <a href="#"
309
360
  title="${action.label}"
361
+ aria-disabled="${this.executingAction >= 0 ? 'true' : nothing}"
310
362
  @click="${async (event: PointerEvent) => {
311
363
  event.preventDefault();
364
+ // Pointer events are disabled while executing, keyboard activation is not
365
+ if (this.executingAction >= 0) {
366
+ return;
367
+ }
368
+ const target = event.currentTarget as HTMLAnchorElement;
312
369
  this.executingAction = index;
313
370
  await this.updateComplete;
314
371
  if ('action' in action) {
315
- await action.action.execute(event.currentTarget as HTMLAnchorElement);
372
+ await action.action.execute(target);
316
373
  }
317
374
  this.clear();
318
375
  }}"
@@ -328,6 +385,33 @@ export class NotificationMessage extends LitElement {
328
385
  `;
329
386
  /* eslint-enable @stylistic/indent */
330
387
  }
388
+
389
+ private pauseDismissal(): void {
390
+ if (this.dismissTimer === null) {
391
+ return;
392
+ }
393
+ window.clearTimeout(this.dismissTimer);
394
+ this.dismissTimer = null;
395
+ this.remainingDuration -= Date.now() - this.timerStartedAt;
396
+ }
397
+
398
+ private resumeDismissal(): void {
399
+ if (!this.dismissalArmed || this.dismissTimer !== null || !this.isConnected || this.pointerInside || this.focusInside) {
400
+ return;
401
+ }
402
+ this.startDismissal();
403
+ }
404
+
405
+ private startDismissal(): void {
406
+ this.timerStartedAt = Date.now();
407
+ this.dismissTimer = window.setTimeout((): void => {
408
+ this.dismissTimer = null;
409
+ // An action being executed clears the notification once it is done
410
+ if (this.executingAction < 0) {
411
+ this.clear();
412
+ }
413
+ }, Math.max(this.remainingDuration, 0));
414
+ }
331
415
  }
332
416
 
333
417
  declare global {
@@ -106,9 +106,7 @@ class OnlineMedia {
106
106
  text: btnSubmit,
107
107
  btnClass: 'btn btn-primary',
108
108
  name: 'ok',
109
- trigger: (): void => {
110
- onlineMediaForm.querySelector('form').requestSubmit();
111
- },
109
+ form: 'online-media-form',
112
110
  }],
113
111
  });
114
112
  }
@@ -34,7 +34,7 @@ export interface PageWizardDataStore extends DataStore {
34
34
  type PageWizardDataStoreKey = keyof PageWizardDataStore;
35
35
 
36
36
  export interface PageWizardContext {
37
- wizard: Wizard;
37
+ wizard: Wizard<PageWizardDataStore>;
38
38
  configuration?: PageWizardConfiguration,
39
39
  getStoreData: <T extends PageWizardDataStoreKey>(key: T) => NoInfer<PageWizardDataStore[T]>;
40
40
  setStoreData: <T extends PageWizardDataStoreKey>(key: T, value: NoInfer<PageWizardDataStore[T]>) => void;
@@ -50,7 +50,7 @@ export class PageWizard extends LitElement {
50
50
  @state() steps: WizardStepInterface[] = [];
51
51
  @state() submissionService: SubmissionServiceInterface;
52
52
 
53
- @query('typo3-backend-wizard') wizard!: Wizard;
53
+ @query('typo3-backend-wizard') wizard!: Wizard<PageWizardDataStore>;
54
54
 
55
55
  private fixedSteps: WizardStepInterface[] = [];
56
56
 
@@ -102,12 +102,12 @@ export class DoktypeStep implements WizardStepInterface, WizardStepValueInterfac
102
102
  }
103
103
 
104
104
  const filteredDoktypes = doktypes
105
- .filter((doktype: Doktype) => doktype.value === '--div--' || doktype.label.toLowerCase().includes(this.searchTerm.toLowerCase()));
105
+ .filter((doktype) => doktype.value === '--div--' || doktype.label.toLowerCase().includes(this.searchTerm.toLowerCase()));
106
106
 
107
107
  const groups: DoktypeGroup[] = [];
108
108
  let currentGroup: DoktypeGroup = { label: '', items: [] };
109
109
 
110
- filteredDoktypes.forEach((doktype: Doktype) => {
110
+ filteredDoktypes.forEach((doktype) => {
111
111
  if (doktype.value === '--div--') {
112
112
  if (currentGroup.items.length > 0) {
113
113
  groups.push(currentGroup);
@@ -147,9 +147,9 @@ export class DoktypeStep implements WizardStepInterface, WizardStepValueInterfac
147
147
  </div>
148
148
  ${finalGroups.length == 0 ? html`<div role="alert" class="alert alert-info">${labels.get('step.doktype.filter.noResults')}</div>` : nothing}
149
149
  <div class="form-check-card-container">
150
- ${finalGroups.map((group: DoktypeGroup) => html`
150
+ ${finalGroups.map((group) => html`
151
151
  ${group.label ? html`<h3 class="form-check-card-container-headline">${group.label}</h3>` : nothing}
152
- ${group.items.map((doktype: Doktype) => html`
152
+ ${group.items.map((doktype) => html`
153
153
  <div class="form-check form-check-type-card">
154
154
  <input
155
155
  class="form-check-input"
@@ -203,7 +203,7 @@ export class DoktypeStep implements WizardStepInterface, WizardStepValueInterfac
203
203
  return [];
204
204
  }
205
205
 
206
- const selectedDoktype = this.task.value.find((doktype: Doktype) => doktype.value === selectedDoktypeKey);
206
+ const selectedDoktype = this.task.value.find((doktype) => doktype.value === selectedDoktypeKey);
207
207
  if (!selectedDoktype) {
208
208
  return [];
209
209
  }
@@ -33,7 +33,7 @@ class PageTsConfigIncludes {
33
33
  private async registerEventListeners(): Promise<void> {
34
34
  await DocumentService.ready();
35
35
 
36
- document.querySelectorAll('.t3js-pagetsconfig-includes-modal').forEach((link: HTMLAnchorElement): void => {
36
+ document.querySelectorAll<HTMLAnchorElement>('.t3js-pagetsconfig-includes-modal').forEach((link): void => {
37
37
  link.addEventListener('click', (e: Event): void => {
38
38
  e.preventDefault();
39
39
 
@@ -36,7 +36,7 @@ class Popover {
36
36
  */
37
37
  public initialize(selector?: string): void {
38
38
  selector = selector || this.DEFAULT_SELECTOR;
39
- document.querySelectorAll(selector).forEach((element: HTMLElement): void => {
39
+ document.querySelectorAll<HTMLElement>(selector).forEach((element): void => {
40
40
  this.applyTitleIfAvailable(element);
41
41
  new BootstrapPopover(element);
42
42
  });
@@ -47,7 +47,7 @@ class Popover {
47
47
  * Popover wrapper function
48
48
  */
49
49
  public popover(element: NodeListOf<HTMLElement> | HTMLElement) {
50
- this.toIterable(element).forEach((element: HTMLElement): void => {
50
+ this.toIterable(element).forEach((element): void => {
51
51
  this.applyTitleIfAvailable(element);
52
52
  new BootstrapPopover(element);
53
53
  });
@@ -138,12 +138,12 @@ class Popover {
138
138
  popover.toggle();
139
139
  }
140
140
 
141
- private toIterable(element: NodeListOf<HTMLElement> | HTMLElement | unknown): NodeList | HTMLElement[] {
142
- let elementList;
141
+ private toIterable(element: NodeListOf<HTMLElement> | HTMLElement | unknown): NodeListOf<HTMLElement> | HTMLElement[] {
142
+ let elementList: NodeListOf<HTMLElement> | HTMLElement[];
143
143
  if (element instanceof HTMLElement) {
144
144
  elementList = [element];
145
145
  } else if (element instanceof NodeList) {
146
- elementList = element;
146
+ elementList = element as NodeListOf<HTMLElement>;
147
147
  } else {
148
148
  throw `Cannot consume element of type ${element.constructor.name}, expected NodeListOf<HTMLElement> or HTMLElement`;
149
149
  }
@@ -65,17 +65,16 @@ export class RecordDownloadButton extends PseudoButtonLitElement {
65
65
  text: this.ok || listLabels.get('button.ok'),
66
66
  btnClass: 'btn-primary',
67
67
  name: 'download',
68
- trigger: (): void => {
69
- const form: HTMLFormElement = modal.querySelector('form');
70
- form?.submit();
71
- modal.hideModal();
72
- }
68
+ form: 'downloadSettingsForm',
73
69
  }
74
70
  ],
75
71
  ajaxCallback: (): void => {
72
+ const form: HTMLFormElement = modal.querySelector('form');
76
73
  const formatSelect: HTMLSelectElement = modal.querySelector(Selectors.formatSelector);
77
74
  const formatOptions: NodeListOf<HTMLDivElement> = modal.querySelectorAll(Selectors.formatOptions);
78
75
 
76
+ form?.addEventListener('submit', (): void => modal.hideModal());
77
+
79
78
  if (formatSelect === null || !formatOptions.length) {
80
79
  // Return in case elements do not exist in the ajax loaded modal content
81
80
  return;
@@ -83,7 +82,7 @@ export class RecordDownloadButton extends PseudoButtonLitElement {
83
82
 
84
83
  formatSelect.addEventListener('change', (e: Event): void => {
85
84
  const selectetFormat: string = (<HTMLSelectElement>e.target).value;
86
- formatOptions.forEach((option: HTMLDivElement) => {
85
+ formatOptions.forEach((option) => {
87
86
  if (option.dataset.formatname !== selectetFormat) {
88
87
  option.classList.add('hide');
89
88
  } else {
@@ -151,7 +151,7 @@ class Recordlist {
151
151
  return;
152
152
  }
153
153
  // Evaluate all checked records and if valid, add their uid to the list
154
- eventDetails.checkboxes.forEach((checkbox: HTMLInputElement): void => {
154
+ eventDetails.checkboxes.forEach((checkbox): void => {
155
155
  const checkboxContainer: HTMLElement = checkbox.closest(MultiRecordSelectionSelectors.elementSelector);
156
156
  if (checkboxContainer !== null && checkboxContainer.dataset[configuration.idField]) {
157
157
  entityIdentifiers.push(checkboxContainer.dataset[configuration.idField]);
@@ -170,12 +170,12 @@ class Recordlist {
170
170
  returnUrl = target.dataset.returnUrl || '';
171
171
  columnsOnly = JSON.parse(target.dataset.columnsOnly || '{}');
172
172
  // Check if there are selected records, which would limit the records to edit
173
- const selection: NodeListOf<HTMLElement> = tableContainer.querySelectorAll(
173
+ const selection: NodeListOf<HTMLInputElement> = tableContainer.querySelectorAll(
174
174
  this.identifier.entity + '[data-uid][data-table="' + tableName + '"] td.col-checkbox input[type="checkbox"]:checked'
175
175
  );
176
176
  if (selection.length) {
177
177
  // If there are selected records, only those are added to the list
178
- selection.forEach((entity: HTMLInputElement): void => {
178
+ selection.forEach((entity): void => {
179
179
  entityIdentifiers.push((entity.closest(this.identifier.entity + selector`[data-uid][data-table="${tableName}"]`) as HTMLElement).dataset.uid);
180
180
  });
181
181
  } else {
@@ -184,7 +184,7 @@ class Recordlist {
184
184
  if (!entities.length) {
185
185
  return;
186
186
  }
187
- entities.forEach((entity: HTMLElement): void => {
187
+ entities.forEach((entity): void => {
188
188
  entityIdentifiers.push(entity.dataset.uid);
189
189
  });
190
190
  }
@@ -201,7 +201,7 @@ class Recordlist {
201
201
  + '&returnUrl=' + Recordlist.getReturnUrl(returnUrl);
202
202
 
203
203
  if (columnsOnly.length > 0) {
204
- editUrl += columnsOnly.map((column: string, i: number): string => '&columnsOnly[' + tableName + '][' + i + ']=' + column).join('');
204
+ editUrl += columnsOnly.map((column, i): string => '&columnsOnly[' + tableName + '][' + i + ']=' + column).join('');
205
205
  }
206
206
 
207
207
  window.location.href = editUrl;
@@ -273,7 +273,12 @@ class Recordlist {
273
273
  };
274
274
 
275
275
  private readonly registerPaginationEvents = (): void => {
276
- document.querySelectorAll('.t3js-recordlist-paging').forEach((trigger: HTMLInputElement) => {
276
+ document.querySelectorAll<HTMLInputElement>('.t3js-recordlist-paging').forEach((trigger) => {
277
+ trigger.addEventListener('keydown', (e: KeyboardEvent) => {
278
+ if (e.key === 'Enter') {
279
+ e.preventDefault();
280
+ }
281
+ });
277
282
  trigger.addEventListener('keyup', (e: KeyboardEvent) => {
278
283
  e.preventDefault();
279
284
  let value = Number(trigger.value);
@@ -96,7 +96,7 @@ export class CspReports extends LitElement {
96
96
  @state() selectedReport: SummarizedCspReport | null = null;
97
97
  @state() suggestions: MutationSuggestion[] = [];
98
98
 
99
- private peripheralEvent: RegularEvent;
99
+ private peripheralEvent: RegularEvent<Event, HTMLElement>;
100
100
  private previouslyFocusedRow: HTMLElement | null = null;
101
101
 
102
102
  public override connectedCallback(): void {
@@ -154,7 +154,7 @@ export class CspReports extends LitElement {
154
154
  ${this.reports.length === 0 ? html`
155
155
  <tr><td colspan="5">${labels.get('module.label.noEntriesAvailable')}</td></tr>
156
156
  ` : nothing}
157
- ${this.reports.map((report: SummarizedCspReport) => html`
157
+ ${this.reports.map((report) => html`
158
158
  <tr class=${classMap({ 'table-info': this.selectedReport === report })} data-mutation-group=${report.mutationHashes.join('-')}
159
159
  @click=${() => this.selectReport(report)}
160
160
  @keydown=${(e: KeyboardEvent) => this.handleReportKeydown(e, report)}
@@ -197,7 +197,7 @@ export class CspReports extends LitElement {
197
197
  </span>
198
198
  ${labels.get('module.label.all')}
199
199
  </button>
200
- ${this.scopes.map((scope: string) => html`
200
+ ${this.scopes.map((scope) => html`
201
201
  <li>
202
202
  <button class="dropdown-item dropdown-item-spaced" title="${scope}" @click=${() => this.selectScope(scope)}>
203
203
  <span class="${scope === this.selectedScope ? 'text-primary' : '' }">
@@ -272,10 +272,10 @@ export class CspReports extends LitElement {
272
272
  <h3>${labels.get('module.label.suggestions')}</h3>
273
273
  </div>
274
274
  ` : nothing}
275
- ${this.suggestions.map((suggestion: MutationSuggestion) => html`
275
+ ${this.suggestions.map((suggestion) => html`
276
276
  <div class="card-body">
277
277
  <h4>${suggestion.label || suggestion.identifier}</h4>
278
- ${suggestion.collection.mutations.map((mutation: Mutation) => html`
278
+ ${suggestion.collection.mutations.map((mutation) => html`
279
279
  <p>
280
280
  <i>${mutation.mode}</i>
281
281
  <code>${mutation.directive}: ${mutation.sources.join(' ')}</code>
@@ -407,7 +407,7 @@ export class CspReports extends LitElement {
407
407
  if (uuids.includes(this.selectedReport?.uuid)) {
408
408
  this.selectedReport = null;
409
409
  }
410
- this.reports = this.reports.filter((report: SummarizedCspReport) => !uuids.includes(report.uuid));
410
+ this.reports = this.reports.filter((report) => !uuids.includes(report.uuid));
411
411
  }
412
412
 
413
413
  private invokeFetchReportsAction(): Promise<SummarizedCspReport[]> {
@@ -424,8 +424,8 @@ export class CspReports extends LitElement {
424
424
 
425
425
  private invokeMutateReportAction(report: SummarizedCspReport, suggestion: MutationSuggestion) {
426
426
  const summaries = this.reports
427
- .filter((other: SummarizedCspReport) => other.mutationHashes.includes(suggestion.hash))
428
- .map((other: SummarizedCspReport) => other.summary);
427
+ .filter((other) => other.mutationHashes.includes(suggestion.hash))
428
+ .map((other) => other.summary);
429
429
  return (new AjaxRequest(this.controlUri))
430
430
  .post({ action: 'mutateReport', scope: report.scope, hmac: suggestion.hmac, suggestion, summaries })
431
431
  .then((response: AjaxResponse) => response.resolve('application/json'))
@@ -35,8 +35,8 @@ class SetupModule {
35
35
  });
36
36
  element.dispatchEvent(clickEvent);
37
37
  }).delegateTo(document, '[data-event="click"][data-event-name]');
38
- document.querySelectorAll('[data-setup-avatar-field]')
39
- .forEach((fieldElement: HTMLElement): void => {
38
+ document.querySelectorAll<HTMLElement>('[data-setup-avatar-field]')
39
+ .forEach((fieldElement): void => {
40
40
  const fieldName = fieldElement.dataset.setupAvatarField;
41
41
  const clearElement = document.getElementById('clear_button_' + fieldName);
42
42
  const addElement = document.getElementById('add_button_' + fieldName);
@@ -174,8 +174,8 @@ export default class SortableTable {
174
174
  icon.classList.remove('text-primary');
175
175
  });
176
176
 
177
- const menuIcons = table.tHead.querySelectorAll('.dropdown-toggle[data-sorting-toggle] + .dropdown-menu typo3-backend-icon');
178
- menuIcons.forEach((menuIcon: IconElement) => {
177
+ const menuIcons = table.tHead.querySelectorAll<IconElement>('.dropdown-toggle[data-sorting-toggle] + .dropdown-menu typo3-backend-icon');
178
+ menuIcons.forEach((menuIcon) => {
179
179
  menuIcon.identifier = 'empty-empty';
180
180
  });
181
181
 
@@ -192,8 +192,8 @@ export default class SortableTable {
192
192
  sortingIcon.identifier = 'actions-sort-amount-down';
193
193
  }
194
194
 
195
- const sortingButtons = sortingDropdown.querySelectorAll('.dropdown-item');
196
- sortingButtons.forEach((button: HTMLButtonElement) => {
195
+ const sortingButtons = sortingDropdown.querySelectorAll<HTMLButtonElement>('.dropdown-item');
196
+ sortingButtons.forEach((button) => {
197
197
  const sortingButtonDirection = button.dataset.sortDirection;
198
198
  const sortingButtonIcon = button.querySelector('typo3-backend-icon');
199
199
  if (sortingButtonDirection === sortingCell.ariaSort) {
@@ -207,3 +207,9 @@ export default class SortableTable {
207
207
  new TablesortWithButtons(table);
208
208
  }
209
209
  }
210
+
211
+ declare global {
212
+ interface HTMLElementEventMap {
213
+ 'afterSort': CustomEvent;
214
+ }
215
+ }
@@ -57,8 +57,8 @@ export default abstract class AbstractClientStorage {
57
57
  }
58
58
  prefix = this.keyPrefix + prefix;
59
59
  Object.keys(this.storage)
60
- .filter((key: string) => key.startsWith(prefix))
61
- .forEach((key: string) => this.storage.removeItem(key));
60
+ .filter((key) => key.startsWith(prefix))
61
+ .forEach((key) => this.storage.removeItem(key));
62
62
  }
63
63
 
64
64
  public clear(): void {
@@ -89,8 +89,8 @@ export class ModuleStateStorage {
89
89
  public static purge(): void
90
90
  {
91
91
  Object.keys(sessionStorage)
92
- .filter((key: string) => key.startsWith(ModuleStateStorage.prefix))
93
- .forEach((key: string) => sessionStorage.removeItem(key));
92
+ .filter((key) => key.startsWith(ModuleStateStorage.prefix))
93
+ .forEach((key) => sessionStorage.removeItem(key));
94
94
  }
95
95
 
96
96
  private static fetch(module: string): CurrentState|null {