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
@@ -31,7 +31,7 @@ export class ActionContainer extends LitElement {
31
31
 
32
32
  protected override render(): TemplateResult {
33
33
  return html`<typo3-backend-live-search-result-action-list>
34
- ${this.resultItem.actions.map((action: ResultItemActionInterface) => this.renderActionItem(this.resultItem, action))}
34
+ ${this.resultItem.actions.map((action) => this.renderActionItem(this.resultItem, action))}
35
35
  </typo3-backend-live-search-result-action-list>`;
36
36
  }
37
37
 
@@ -45,13 +45,13 @@ export class ItemContainer extends LitElement {
45
45
 
46
46
  protected override render(): TemplateResult {
47
47
  const groupedResults: GroupedResultItems = {};
48
- const filteredResults = this.results.filter((result: ResultItemInterface): boolean => result !== null);
48
+ const filteredResults = this.results.filter((result): boolean => result !== null);
49
49
  if (filteredResults.length !== this.results.length) {
50
50
  console.warn(
51
51
  'The result set contained "null" values, indicating something went wrong while building the search results. Affected values were removed to no break the user interface.'
52
52
  );
53
53
  }
54
- filteredResults.forEach((result: ResultItemInterface): void => {
54
+ filteredResults.forEach((result): void => {
55
55
  if (!(result.typeLabel in groupedResults)) {
56
56
  groupedResults[result.typeLabel] = [result];
57
57
  } else {
@@ -69,7 +69,7 @@ export class ItemContainer extends LitElement {
69
69
  for (const [type, results] of Object.entries(groupedResults)) {
70
70
  const countElements = results.length;
71
71
  items.push(html`<h6 class="livesearch-result-item-group-label">${type} (${countElements})</h6>`);
72
- items.push(...results.map((result: ResultItemInterface) => html`${until(
72
+ items.push(...results.map((result) => html`${until(
73
73
  this.renderResultItem(result),
74
74
  html`<typo3-backend-spinner></typo3-backend-spinner>`
75
75
  )}`));
@@ -122,7 +122,7 @@ export class ItemContainer extends LitElement {
122
122
  }
123
123
 
124
124
  private onScroll(e: Event): void {
125
- this.querySelectorAll('.livesearch-result-item-group-label').forEach((groupLabel: HTMLElement): void => {
125
+ this.querySelectorAll<HTMLElement>('.livesearch-result-item-group-label').forEach((groupLabel): void => {
126
126
  groupLabel.classList.toggle('sticky', groupLabel.offsetTop <= (e.target as HTMLElement).scrollTop);
127
127
  });
128
128
  }
@@ -112,4 +112,9 @@ declare global {
112
112
  interface HTMLElementTagNameMap {
113
113
  'typo3-backend-live-search-result-container': ResultContainer;
114
114
  }
115
+
116
+ interface HTMLElementEventMap {
117
+ 'livesearch:request-actions': CustomEvent<RequestActionsEventData>;
118
+ 'livesearch:invoke-action': CustomEvent<InvokeActionEventData>;
119
+ }
115
120
  }
@@ -57,7 +57,7 @@ export class ResultPagination extends LitElement {
57
57
  </typo3-backend-live-search-result-page>
58
58
  </li>` : nothing}
59
59
  ${this.pagination.hasLessPages ? html`<li class="page-item disabled"><span class="page-link disabled">&hellip;</span></li>` : nothing}
60
- ${this.pagination.allPageNumbers.map((page: number) => html`
60
+ ${this.pagination.allPageNumbers.map((page) => html`
61
61
  <li class="page-item">
62
62
  <typo3-backend-live-search-result-page page="${page}" perPage="${this.pagination.itemsPerPage}" class="page-link ${this.pagination.currentPage === page ? 'active' : ''}">${page}</typo3-backend-live-search-result-page>
63
63
  </li>
@@ -187,7 +187,7 @@ class LiveSearch {
187
187
  * // do stuff here
188
188
  * });
189
189
  */
190
- ['modal-loaded', 'typo3-modal-shown'].forEach((eventToListenOn: string) => {
190
+ ['modal-loaded', 'typo3-modal-shown'].forEach((eventToListenOn) => {
191
191
  modal.addEventListener(eventToListenOn, () => {
192
192
  const searchField = modal.querySelector('input[type="search"]') as HTMLInputElement|null;
193
193
  if (searchField !== null) {
@@ -200,7 +200,7 @@ class LiveSearch {
200
200
 
201
201
  private composeSearchOptions(searchOptions: SearchOption[]): { [key: string]: string[] } {
202
202
  const composedSearchOptions: { [key: string]: string[] } = {};
203
- searchOptions.forEach((searchOption: SearchOption): void => {
203
+ searchOptions.forEach((searchOption): void => {
204
204
  if (composedSearchOptions[searchOption.key] === undefined) {
205
205
  composedSearchOptions[searchOption.key] = [];
206
206
  }
@@ -129,8 +129,8 @@ function createFormatter(label: string): IntlMessageFormat {
129
129
  }
130
130
 
131
131
  const formatters: Formatters = {
132
- getNumberFormat: memoize('number', (locale, opts) => new Intl.NumberFormat(locale, opts)),
133
- getDateTimeFormat: memoize('datetime', (locale, opts) => {
132
+ getNumberFormat: memoize('number', (locale?: string | string[], opts?: Intl.NumberFormatOptions) => new Intl.NumberFormat(locale, opts)),
133
+ getDateTimeFormat: memoize('datetime', (locale?: Intl.LocalesArgument, opts?: Intl.DateTimeFormatOptions) => {
134
134
  const { dateStyle, timeStyle, timeZone } = opts;
135
135
 
136
136
  // Apply configured TYPO3 date format to the "medium" preset
@@ -152,10 +152,10 @@ const formatters: Formatters = {
152
152
 
153
153
  return new Intl.DateTimeFormat(locale, { dateStyle, timeStyle, timeZone });
154
154
  }),
155
- getPluralRules: memoize('date', (locale, opts) => new Intl.PluralRules(locale, opts)),
155
+ getPluralRules: memoize('date', (locale?: Intl.LocalesArgument, opts?: Intl.PluralRulesOptions) => new Intl.PluralRules(locale, opts)),
156
156
  };
157
157
 
158
- type Factory = (...args: unknown[]) => object;
158
+ type Factory = (...args: never[]) => object;
159
159
  const cache: Record<string, object> = {};
160
160
  /**
161
161
  * Cache the (object) result of a factory function,
@@ -48,7 +48,7 @@ export interface LocalizationDataStore extends DataStore {
48
48
  type LocalizationDataStoreKey = keyof LocalizationDataStore;
49
49
 
50
50
  export interface LocalizationContext {
51
- wizard: Wizard;
51
+ wizard: Wizard<LocalizationDataStore>;
52
52
  targetLanguage: number;
53
53
  recordType: string;
54
54
  recordUid: number;
@@ -72,13 +72,13 @@ export class LocalizationWizard extends LitElement {
72
72
  @property({ type: Number, attribute: 'record-uid' }) recordUid: number;
73
73
  @property({ type: Number, attribute: 'target-language' }) targetLanguage?: number;
74
74
 
75
- @query('typo3-backend-wizard') wizard!: Wizard;
75
+ @query('typo3-backend-wizard') wizard!: Wizard<LocalizationDataStore>;
76
76
 
77
77
  @state() steps: WizardStepInterface[] = [];
78
78
  @state() submissionService: SubmissionServiceInterface;
79
79
 
80
80
  protected readonly recordInfoTask = new Task(this, {
81
- task: async ([recordType, recordUid]: [string, number]): Promise<RecordInfo> => {
81
+ task: async ([recordType, recordUid]): Promise<RecordInfo> => {
82
82
  try {
83
83
  const response = await new AjaxRequest(TYPO3.settings.ajaxUrls.wizard_localization_get_record).withQueryArguments({
84
84
  recordType: recordType,
@@ -97,7 +97,7 @@ export class LocalizationWizard extends LitElement {
97
97
  throw error;
98
98
  }
99
99
  },
100
- args: () => [this.recordType, this.recordUid],
100
+ args: () => [this.recordType, this.recordUid] as const,
101
101
  });
102
102
 
103
103
  override connectedCallback() {
@@ -72,7 +72,7 @@ export class ContentRecordSelectionStep implements WizardStepInterface, WizardSt
72
72
 
73
73
  constructor(private readonly context: LocalizationContext) {
74
74
  this.task = new Task(this.context.wizard, {
75
- task: async ([pageUid, targetLanguage, sourceLanguage]: [number, number, number]): Promise<PageRecordSelection> => {
75
+ task: async ([pageUid, targetLanguage, sourceLanguage]): Promise<PageRecordSelection> => {
76
76
  const response = await new AjaxRequest(TYPO3.settings.ajaxUrls.wizard_localization_get_content).withQueryArguments({
77
77
  pageUid: pageUid,
78
78
  targetLanguage: targetLanguage,
@@ -82,7 +82,7 @@ export class ContentRecordSelectionStep implements WizardStepInterface, WizardSt
82
82
 
83
83
  return result;
84
84
  },
85
- args: () => [this.context.recordUid, this.context.getStoreData('targetLanguage'), this.context.getStoreData('sourceLanguage')],
85
+ args: () => [this.context.recordUid, this.context.getStoreData('targetLanguage'), this.context.getStoreData('sourceLanguage')] as const,
86
86
  autoRun: false
87
87
  });
88
88
  }
@@ -194,9 +194,9 @@ export class ContentRecordSelectionStep implements WizardStepInterface, WizardSt
194
194
  const records: ContentRecord[] = [];
195
195
 
196
196
  if (this.task.value) {
197
- this.task.value.layout.rows.forEach((row: LayoutRow) => {
198
- row.columns.forEach((column: LayoutColumn) => {
199
- column.records.forEach((record: ContentRecord) => {
197
+ this.task.value.layout.rows.forEach((row) => {
198
+ row.columns.forEach((column) => {
199
+ column.records.forEach((record) => {
200
200
  if (selectedUids.includes(record.uid)) {
201
201
  records.push(record);
202
202
  }
@@ -355,9 +355,9 @@ export class ContentRecordSelectionStep implements WizardStepInterface, WizardSt
355
355
 
356
356
  private getAllRecordUids(layout: BackendLayoutStructure): number[] {
357
357
  const allUids: number[] = [];
358
- layout.rows.forEach((row: LayoutRow) => {
359
- row.columns.forEach((column: LayoutColumn) => {
360
- column.records.forEach((record: ContentRecord) => {
358
+ layout.rows.forEach((row) => {
359
+ row.columns.forEach((column) => {
360
+ column.records.forEach((record) => {
361
361
  allUids.push(record.uid);
362
362
  });
363
363
  });
@@ -40,7 +40,7 @@ export class HandlerSelectionStep implements WizardStepInterface, WizardStepValu
40
40
 
41
41
  constructor(private readonly context: LocalizationContext) {
42
42
  this.task = new Task(this.context.wizard, {
43
- task: async ([recordType, recordUid, sourceLanguage, targetLanguage, mode]: [string, number, number | null, number | null, string | null]): Promise<LocalizationHandler[]> => {
43
+ task: async ([recordType, recordUid, sourceLanguage, targetLanguage, mode]): Promise<LocalizationHandler[]> => {
44
44
  if (sourceLanguage == null || targetLanguage == null || mode == null) {
45
45
  return [];
46
46
  }
@@ -58,7 +58,7 @@ export class HandlerSelectionStep implements WizardStepInterface, WizardStepValu
58
58
 
59
59
  return handlers;
60
60
  },
61
- args: () => [this.context.recordType, this.context.recordUid, this.context.getStoreData('sourceLanguage'), this.context.getStoreData('targetLanguage'), this.context.getStoreData('localizationMode')],
61
+ args: () => [this.context.recordType, this.context.recordUid, this.context.getStoreData('sourceLanguage'), this.context.getStoreData('targetLanguage'), this.context.getStoreData('localizationMode')] as const,
62
62
  autoRun: false
63
63
  });
64
64
  }
@@ -114,7 +114,7 @@ export class HandlerSelectionStep implements WizardStepInterface, WizardStepValu
114
114
  <h2 class="h4">${localizationWizardLabels.get('step.handler_selection.headline')}</h2>
115
115
  <p>${localizationWizardLabels.get('step.handler_selection.description')}</p>
116
116
  <div class="form-check-card-container">
117
- ${handlers.map((handler: LocalizationHandler) => this.renderHandlerOption(handler))}
117
+ ${handlers.map((handler) => this.renderHandlerOption(handler))}
118
118
  </div>
119
119
  </div>
120
120
  `;
@@ -147,7 +147,7 @@ export class HandlerSelectionStep implements WizardStepInterface, WizardStepValu
147
147
  return [];
148
148
  }
149
149
 
150
- const handler = this.task.value.find((h: LocalizationHandler) => h.identifier === selectedHandler);
150
+ const handler = this.task.value.find((h) => h.identifier === selectedHandler);
151
151
  if (!handler) {
152
152
  return [];
153
153
  }
@@ -41,7 +41,7 @@ export class ModeStep implements WizardStepInterface, WizardStepValueInterface,
41
41
 
42
42
  constructor(private readonly context: LocalizationContext) {
43
43
  this.task = new Task(this.context.wizard, {
44
- task: async ([recordType, recordUid, targetLanguage, sourceLanguage]: [string, number, number | null, number | null]): Promise<LocalizationMode[]> => {
44
+ task: async ([recordType, recordUid, targetLanguage, sourceLanguage]): Promise<LocalizationMode[]> => {
45
45
  if (targetLanguage == null || sourceLanguage == null) {
46
46
  return [];
47
47
  }
@@ -56,7 +56,7 @@ export class ModeStep implements WizardStepInterface, WizardStepValueInterface,
56
56
 
57
57
  return modes;
58
58
  },
59
- args: () => [this.context.recordType, this.context.recordUid, this.context.getStoreData('targetLanguage'), this.context.getStoreData('sourceLanguage')],
59
+ args: () => [this.context.recordType, this.context.recordUid, this.context.getStoreData('targetLanguage'), this.context.getStoreData('sourceLanguage')] as const,
60
60
  autoRun: false
61
61
  });
62
62
  }
@@ -110,7 +110,7 @@ export class ModeStep implements WizardStepInterface, WizardStepValueInterface,
110
110
  content = html`
111
111
  <p>${localizationWizardLabels.get('step.modes.description')}</p>
112
112
  <div class="form-check-card-container">
113
- ${modes.map((mode: LocalizationMode) => html`
113
+ ${modes.map((mode) => html`
114
114
  <div class="form-check form-check-type-card">
115
115
  <input
116
116
  class="form-check-input"
@@ -171,7 +171,7 @@ export class ModeStep implements WizardStepInterface, WizardStepValueInterface,
171
171
  return [];
172
172
  }
173
173
 
174
- const mode = this.task.value.find((m: LocalizationMode) => m.key === selectedMode);
174
+ const mode = this.task.value.find((m) => m.key === selectedMode);
175
175
  if (!mode) {
176
176
  return [];
177
177
  }
@@ -33,7 +33,7 @@ export class SourceLanguageStep implements WizardStepInterface, WizardStepValueI
33
33
 
34
34
  constructor(private readonly context: LocalizationContext) {
35
35
  this.task = new Task(this.context.wizard, {
36
- task: async ([recordType, recordUid, targetLanguageId]: [string, number, number | null]): Promise<LocalizationLanguageRecord[]> => {
36
+ task: async ([recordType, recordUid, targetLanguageId]): Promise<LocalizationLanguageRecord[]> => {
37
37
  if (targetLanguageId == null) {
38
38
  return [];
39
39
  }
@@ -47,7 +47,7 @@ export class SourceLanguageStep implements WizardStepInterface, WizardStepValueI
47
47
 
48
48
  return sourceLanguages;
49
49
  },
50
- args: () => [this.context.recordType, this.context.recordUid, this.context.getStoreData('targetLanguage')],
50
+ args: () => [this.context.recordType, this.context.recordUid, this.context.getStoreData('targetLanguage')] as const,
51
51
  autoRun: false
52
52
  });
53
53
  }
@@ -108,7 +108,7 @@ export class SourceLanguageStep implements WizardStepInterface, WizardStepValueI
108
108
  <h2 class="h4">${localizationWizardLabels.get('step.source_language.headline')}</h2>
109
109
  <p>${localizationWizardLabels.get('step.source_language.description')}</p>
110
110
  <div class="form-check-card-container">
111
- ${languages.map((language: LocalizationLanguageRecord) => html`
111
+ ${languages.map((language) => html`
112
112
  <div class="form-check form-check-type-card">
113
113
  <input
114
114
  class="form-check-input"
@@ -159,7 +159,7 @@ export class SourceLanguageStep implements WizardStepInterface, WizardStepValueI
159
159
  return [];
160
160
  }
161
161
 
162
- const selectedLanguage = this.task.value.find((lang: LocalizationLanguageRecord) => lang.uid === selectedSourceLanguage);
162
+ const selectedLanguage = this.task.value.find((lang) => lang.uid === selectedSourceLanguage);
163
163
  if (!selectedLanguage) {
164
164
  return [];
165
165
  }
@@ -36,7 +36,7 @@ export class TargetLanguageStep implements WizardStepInterface, WizardStepValueI
36
36
 
37
37
  constructor(private readonly context: LocalizationContext) {
38
38
  this.task = new Task(this.context.wizard, {
39
- task: async ([recordType, recordUid]: [string, number]): Promise<LocalizationLanguageRecord[]> => {
39
+ task: async ([recordType, recordUid]): Promise<LocalizationLanguageRecord[]> => {
40
40
  const response = await new AjaxRequest(TYPO3.settings.ajaxUrls.wizard_localization_get_targets).withQueryArguments({
41
41
  recordType: recordType,
42
42
  recordUid: recordUid,
@@ -51,7 +51,7 @@ export class TargetLanguageStep implements WizardStepInterface, WizardStepValueI
51
51
 
52
52
  return targetLanguages;
53
53
  },
54
- args: () => [this.context.recordType, this.context.recordUid],
54
+ args: () => [this.context.recordType, this.context.recordUid] as const,
55
55
  autoRun: false
56
56
  });
57
57
  }
@@ -120,7 +120,7 @@ export class TargetLanguageStep implements WizardStepInterface, WizardStepValueI
120
120
  <h2 class="h4">${localizationWizardLabels.get('step.target_language.headline')}</h2>
121
121
  <p>${localizationWizardLabels.get('step.target_language.description')}</p>
122
122
  <div class="form-check-card-container">
123
- ${languages.map((language: LocalizationLanguageRecord) => html`
123
+ ${languages.map((language) => html`
124
124
  <div class="form-check form-check-type-card">
125
125
  <input
126
126
  class="form-check-input"
@@ -171,7 +171,7 @@ export class TargetLanguageStep implements WizardStepInterface, WizardStepValueI
171
171
  return [];
172
172
  }
173
173
 
174
- const selectedLanguage = this.task.value.find((lang: LocalizationLanguageRecord) => lang.uid === selectedTargetLanguage);
174
+ const selectedLanguage = this.task.value.find((lang) => lang.uid === selectedTargetLanguage);
175
175
  if (!selectedLanguage) {
176
176
  return [];
177
177
  }
@@ -284,15 +284,7 @@ class LoginRefresh {
284
284
  active: false,
285
285
  btnClass: 'btn-primary',
286
286
  name: 'refreshSession',
287
- trigger: async (e: Event, modal: ModalElement) => {
288
- modal.querySelector('form').requestSubmit();
289
- const response = await new AjaxRequest(TYPO3.settings.ajaxUrls.login_refresh).get();
290
- const data = await response.resolve();
291
- modal.hideModal();
292
- if (!data.refresh.success) {
293
- modal.dispatchEvent(new Event('show-login-form'));
294
- }
295
- }
287
+ form: 'beLoginRefresh',
296
288
  }
297
289
  ],
298
290
  content: html`
package/backend/login.ts CHANGED
@@ -117,7 +117,7 @@ class BackendLogin {
117
117
  const result = await response.resolve('application/json') as PreflightResponse;
118
118
  if (result.capabilities.referrer !== true) {
119
119
  document.querySelectorAll(this.options.errorNoReferrer)
120
- .forEach((element: HTMLElement): void => element.classList.remove('hidden'));
120
+ .forEach((element): void => element.classList.remove('hidden'));
121
121
  }
122
122
  });
123
123
  }
@@ -186,7 +186,7 @@ class BackendLogin {
186
186
  }
187
187
 
188
188
  (document.querySelectorAll('.t3js-clearable') as NodeListOf<HTMLInputElement>).forEach(
189
- (clearableField: HTMLInputElement) => clearableField.clearable(),
189
+ (clearableField) => clearableField.clearable(),
190
190
  );
191
191
 
192
192
  const passwordField: HTMLInputElement = document.querySelector(this.options.passwordField);
package/backend/modal.ts CHANGED
@@ -318,6 +318,7 @@ export class ModalElement extends LitElement {
318
318
  ${this.buttons.map(button => this.renderModalButton(button))}
319
319
  </div>
320
320
  `}
321
+ <div class="alert-container"></div>
321
322
  </dialog>
322
323
  `;
323
324
  }
@@ -389,6 +390,8 @@ export class ModalElement extends LitElement {
389
390
  if (this.ajaxCallback) {
390
391
  this.ajaxCallback(this);
391
392
  }
393
+ // Native autofocus only covers content present when the dialog opens
394
+ this.querySelector<HTMLElement>(`${Identifiers.body} [autofocus]`)?.focus();
392
395
  this.dispatchEvent(new CustomEvent('modal-loaded'));
393
396
  });
394
397
  })
@@ -944,11 +947,10 @@ class Modal {
944
947
  }
945
948
 
946
949
  currentModal.addEventListener('typo3-modal-shown', (): void => {
947
- // focus the button which was configured as active button
948
- const activeButton = currentModal.querySelector(`${Identifiers.footer} .t3js-active`) as HTMLInputElement | null;
949
- if (activeButton !== null) {
950
- activeButton.focus();
951
- }
950
+ // Prefer an autofocus field over the active button
951
+ const focusTarget = currentModal.querySelector<HTMLElement>(`${Identifiers.body} [autofocus]`)
952
+ ?? currentModal.querySelector<HTMLElement>(`${Identifiers.footer} .t3js-active`);
953
+ focusTarget?.focus();
952
954
  });
953
955
 
954
956
  // Remove modal from Modal.instances when hidden
@@ -957,10 +959,15 @@ class Modal {
957
959
  const lastIndex = this.instances.length - 1;
958
960
  this.instances.splice(lastIndex, 1);
959
961
  this.currentModal = this.instances[lastIndex - 1];
962
+ remountAlertContainer(this.currentModal);
960
963
  }
961
964
  });
962
965
 
963
966
  currentModal.addEventListener('typo3-modal-hidden', (): void => {
967
+ // A notification shown while the modal closes is placed in it, and must not be removed along with it
968
+ if (currentModal.querySelector('#alert-container') !== null) {
969
+ remountAlertContainer(this.currentModal);
970
+ }
964
971
  currentModal.remove();
965
972
  });
966
973
 
@@ -970,12 +977,38 @@ class Modal {
970
977
  this.instances.push(currentModal);
971
978
  });
972
979
 
980
+ currentModal.addEventListener('typo3-modal-shown', (): void => {
981
+ remountAlertContainer(currentModal);
982
+ });
983
+
973
984
  document.body.appendChild(currentModal);
974
985
 
975
986
  return currentModal;
976
987
  }
977
988
  }
978
989
 
990
+ const remountAlertContainer = (modal: ModalElement | undefined) => {
991
+ const alertContainer = document.querySelector<HTMLDivElement>('#alert-container');
992
+ if (alertContainer) {
993
+ const isOpen = alertContainer.matches(':popover-open');
994
+ let target: HTMLElement = document.body;
995
+ if (modal) {
996
+ target = modal.querySelector('.alert-container') ?? target;
997
+ }
998
+
999
+ if ('moveBefore' in target) {
1000
+ target.moveBefore(alertContainer, null);
1001
+ } else {
1002
+ (target as HTMLElement).appendChild(alertContainer);
1003
+ }
1004
+
1005
+ if (isOpen) {
1006
+ alertContainer.hidePopover();
1007
+ alertContainer.showPopover();
1008
+ }
1009
+ }
1010
+ };
1011
+
979
1012
  let modalObject: Modal = null;
980
1013
  try {
981
1014
  if (parent && parent.window.TYPO3 && parent.window.TYPO3.Modal) {
@@ -122,4 +122,14 @@ declare global {
122
122
  interface HTMLElementTagNameMap {
123
123
  'typo3-iframe-module': IframeModuleElement;
124
124
  }
125
+
126
+ interface HTMLElementEventMap {
127
+ 'typo3-iframe-load': CustomEvent<ModuleState>;
128
+ 'typo3-iframe-loaded': CustomEvent<ModuleState>;
129
+ }
130
+
131
+ interface DocumentEventMap {
132
+ 'typo3-iframe-load': CustomEvent<ModuleState>;
133
+ 'typo3-iframe-loaded': CustomEvent<ModuleState>;
134
+ }
125
135
  }
@@ -266,4 +266,14 @@ declare global {
266
266
  interface HTMLElementTagNameMap {
267
267
  'typo3-backend-module-router': ModuleRouter;
268
268
  }
269
+
270
+ interface HTMLElementEventMap {
271
+ 'typo3-module-load': CustomEvent<ModuleState>;
272
+ 'typo3-module-loaded': CustomEvent<ModuleState>;
273
+ }
274
+
275
+ interface DocumentEventMap {
276
+ 'typo3-module-load': CustomEvent<ModuleState>;
277
+ 'typo3-module-loaded': CustomEvent<ModuleState>;
278
+ }
269
279
  }
@@ -160,7 +160,7 @@ class ModuleMenu {
160
160
 
161
161
  private static highlightModule(identifier: string): void {
162
162
  const menu = document.querySelector(ModuleMenuSelector.menu);
163
- menu.querySelectorAll(ModuleMenuSelector.item).forEach((element: Element) => {
163
+ menu.querySelectorAll(ModuleMenuSelector.item).forEach((element) => {
164
164
  element.classList.remove('modulemenu-action-active');
165
165
  element.removeAttribute('aria-current');
166
166
  });
@@ -171,8 +171,8 @@ class ModuleMenu {
171
171
 
172
172
  private static highlightModuleMenuItem(module: Module, current: boolean = true): void {
173
173
  const menu = document.querySelector(ModuleMenuSelector.menu);
174
- const menuElements = menu.querySelectorAll(ModuleMenuSelector.item + selector`[data-modulemenu-identifier="${module.name}"]`);
175
- menuElements.forEach((element: HTMLElement) => {
174
+ const menuElements = menu.querySelectorAll<HTMLElement>(ModuleMenuSelector.item + selector`[data-modulemenu-identifier="${module.name}"]`);
175
+ menuElements.forEach((element) => {
176
176
  element.classList.add('modulemenu-action-active');
177
177
  if (current) {
178
178
  element.setAttribute('aria-current', 'location');
@@ -33,7 +33,7 @@ export class MultiRecordSelectionAction {
33
33
  {
34
34
  // Evaluate all checked records and if valid, add their uid to the list
35
35
  const entityIdentifiers: Array<string> = [];
36
- eventDetails.checkboxes.forEach((checkbox: HTMLInputElement): void => {
36
+ eventDetails.checkboxes.forEach((checkbox): void => {
37
37
  const checkboxContainer: HTMLElement = checkbox.closest(MultiRecordSelectionSelectors.elementSelector);
38
38
  if (checkboxContainer !== null && checkboxContainer.dataset[eventDetails.configuration.idField]) {
39
39
  entityIdentifiers.push(checkboxContainer.dataset[eventDetails.configuration.idField]);
@@ -85,7 +85,7 @@ class MultiRecordSelectionDeleteAction {
85
85
  try {
86
86
  const result = await AjaxDataHandler.process({
87
87
  cmd: {
88
- [tableName]: Object.fromEntries(entityIdentifiers.map((identifier: string): [string, DatahandlerCommand] => [
88
+ [tableName]: Object.fromEntries(entityIdentifiers.map((identifier): [string, DatahandlerCommand] => [
89
89
  identifier, { delete: 1 }
90
90
  ]))
91
91
  }
@@ -101,7 +101,7 @@ class MultiRecordSelection {
101
101
  // which were already evaluated and do not call the evaluation for them again.
102
102
  let actionsToggled: boolean = false;
103
103
  const identifiers: Array<string> = [];
104
- checked.forEach((checkbox: HTMLInputElement) => {
104
+ checked.forEach((checkbox) => {
105
105
  (checkbox.closest(MultiRecordSelectionSelectors.elementSelector) as HTMLElement)?.classList.add(MultiRecordSelection.activeClass);
106
106
  const identifier: string = MultiRecordSelection.getIdentifier(checkbox);
107
107
  if (identifier !== '' && !identifiers.includes(identifier)) {
@@ -132,12 +132,12 @@ class MultiRecordSelection {
132
132
 
133
133
  if (!MultiRecordSelection.getCheckboxes(CheckboxState.checked, identifier).length) {
134
134
  // In case no checkbox is checked, hide all action containers and return
135
- actionContainers.forEach((container: HTMLElement): void => MultiRecordSelection.changeActionContainerVisibility(container, false));
135
+ actionContainers.forEach((container): void => MultiRecordSelection.changeActionContainerVisibility(container, false));
136
136
  return;
137
137
  }
138
138
 
139
139
  // Remove hidden state of all action containers, since checked checkboxes exist
140
- actionContainers.forEach((container: HTMLElement): void => MultiRecordSelection.changeActionContainerVisibility(container));
140
+ actionContainers.forEach((container): void => MultiRecordSelection.changeActionContainerVisibility(container));
141
141
 
142
142
  const actions: NodeListOf<HTMLButtonElement> = document.querySelectorAll(
143
143
  [MultiRecordSelection.getCombinedSelector(MultiRecordSelectionSelectors.actionsSelector, identifier), Buttons.actionButton].join(' ')
@@ -148,7 +148,7 @@ class MultiRecordSelection {
148
148
  return;
149
149
  }
150
150
 
151
- actions.forEach((action: HTMLButtonElement): void => {
151
+ actions.forEach((action): void => {
152
152
  if (!action.dataset.multiRecordSelectionActionConfig) {
153
153
  // In case the action does not define any configuration, no toggling is possible
154
154
  return;
@@ -208,7 +208,7 @@ class MultiRecordSelection {
208
208
  * state would may led to misbehaviour.
209
209
  */
210
210
  private static unsetManuallyChangedAttribute(identifier: string): void {
211
- MultiRecordSelection.getCheckboxes(CheckboxState.any, identifier).forEach((checkbox: HTMLInputElement): void => {
211
+ MultiRecordSelection.getCheckboxes(CheckboxState.any, identifier).forEach((checkbox): void => {
212
212
  checkbox.removeAttribute('data-manually-changed');
213
213
  });
214
214
  }
@@ -251,20 +251,20 @@ class MultiRecordSelection {
251
251
  new RegularEvent('multiRecordSelection:actions:show', (e: CustomEvent): void => {
252
252
  const identifier: string = e.detail?.identifier || '';
253
253
  const actionContainers: NodeListOf<HTMLElement> = document.querySelectorAll(MultiRecordSelection.getCombinedSelector(MultiRecordSelectionSelectors.actionsSelector, identifier));
254
- actionContainers.forEach((container: HTMLElement): void => MultiRecordSelection.changeActionContainerVisibility(container));
254
+ actionContainers.forEach((container): void => MultiRecordSelection.changeActionContainerVisibility(container));
255
255
  }).bindTo(document);
256
256
  new RegularEvent('multiRecordSelection:actions:hide', (e: CustomEvent): void => {
257
257
  const identifier: string = e.detail?.identifier || '';
258
258
  const actionContainers: NodeListOf<HTMLElement> = document.querySelectorAll(MultiRecordSelection.getCombinedSelector(MultiRecordSelectionSelectors.actionsSelector, identifier));
259
- actionContainers.forEach((container: HTMLElement): void => MultiRecordSelection.changeActionContainerVisibility(container, false));
259
+ actionContainers.forEach((container): void => MultiRecordSelection.changeActionContainerVisibility(container, false));
260
260
  }).bindTo(document);
261
261
  new RegularEvent('multiRecordSelection:checkboxes:check', (e: CustomEvent): void => {
262
262
  const identifier: string = e.detail?.identifier || '';
263
- MultiRecordSelection.getCheckboxes(CheckboxState.any, identifier).forEach((checkbox: HTMLInputElement): void => MultiRecordSelection.changeCheckboxState(checkbox, true));
263
+ MultiRecordSelection.getCheckboxes(CheckboxState.any, identifier).forEach((checkbox): void => MultiRecordSelection.changeCheckboxState(checkbox, true));
264
264
  }).bindTo(document);
265
265
  new RegularEvent('multiRecordSelection:checkboxes:uncheck', (e: CustomEvent): void => {
266
266
  const identifier: string = e.detail?.identifier || '';
267
- MultiRecordSelection.getCheckboxes(CheckboxState.any, identifier).forEach((checkbox: HTMLInputElement): void => MultiRecordSelection.changeCheckboxState(checkbox, false));
267
+ MultiRecordSelection.getCheckboxes(CheckboxState.any, identifier).forEach((checkbox): void => MultiRecordSelection.changeCheckboxState(checkbox, false));
268
268
  }).bindTo(document);
269
269
  }
270
270
 
@@ -293,17 +293,17 @@ class MultiRecordSelection {
293
293
  // Perform requested action
294
294
  switch (target.dataset.multiRecordSelectionCheckAction) {
295
295
  case CheckboxActions.checkAll:
296
- checkboxes.forEach((checkbox: HTMLInputElement) => {
296
+ checkboxes.forEach((checkbox) => {
297
297
  MultiRecordSelection.changeCheckboxState(checkbox, true);
298
298
  });
299
299
  break;
300
300
  case CheckboxActions.checkNone:
301
- checkboxes.forEach((checkbox: HTMLInputElement) => {
301
+ checkboxes.forEach((checkbox) => {
302
302
  MultiRecordSelection.changeCheckboxState(checkbox, false);
303
303
  });
304
304
  break;
305
305
  case CheckboxActions.toggle:
306
- checkboxes.forEach((checkbox: HTMLInputElement) => {
306
+ checkboxes.forEach((checkbox) => {
307
307
  MultiRecordSelection.changeCheckboxState(checkbox, !checkbox.checked);
308
308
  });
309
309
  break;
@@ -438,7 +438,7 @@ class MultiRecordSelection {
438
438
  const end = checkboxes.indexOf(this.lastChecked);
439
439
  // Get the checkboxes which should be changed (we use min() and max() to allow ranges in both directions)
440
440
  const checkboxesToChange = checkboxes.slice(Math.min(start, end), Math.max(start, end) + 1);
441
- checkboxesToChange.forEach((checkbox: HTMLInputElement): void => {
441
+ checkboxesToChange.forEach((checkbox): void => {
442
442
  // Change the state of each checkbox in question. Do not change the current target since we
443
443
  // use it's current checked state, making both "check all" and "uncheck all" possible.
444
444
  if (checkbox !== target) {
@@ -452,7 +452,7 @@ class MultiRecordSelection {
452
452
 
453
453
  // With the alt or ctrl key, it's possible to toggle the current selection
454
454
  if (e.altKey || e.ctrlKey) {
455
- MultiRecordSelection.getCheckboxes(CheckboxState.any, identifier).forEach((checkbox: HTMLInputElement): void => {
455
+ MultiRecordSelection.getCheckboxes(CheckboxState.any, identifier).forEach((checkbox): void => {
456
456
  // Toggle all checkboxes except the current target as this was already done by clicking on it
457
457
  if (checkbox !== target) {
458
458
  MultiRecordSelection.changeCheckboxState(checkbox, !checkbox.checked);