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.
- package/.github/workflows/sync-and-publish.yml +240 -191
- package/.last-synced-tag +1 -1
- package/README.md +13 -5
- package/adminpanel/admin-panel.ts +22 -22
- package/adminpanel/modules/cache.ts +3 -3
- package/backend/action-dispatcher.ts +8 -3
- package/backend/bookmark/bookmark-store.ts +5 -5
- package/backend/clipboard-panel.ts +2 -2
- package/backend/code-editor/element/code-mirror-element.ts +1 -1
- package/backend/code-editor/language/typoscript.ts +3 -3
- package/backend/code-editor/stream-parser/typoscript.ts +2 -2
- package/backend/color-picker.ts +2 -2
- package/backend/column-selector-button.ts +11 -8
- package/backend/context-help.ts +3 -3
- package/backend/context-menu.ts +8 -3
- package/backend/drag-tooltip.ts +9 -4
- package/backend/drag-uploader.ts +81 -89
- package/backend/element/draggable-resizable-element.ts +18 -12
- package/backend/element/icon-element.ts +2 -2
- package/backend/element/thumbnail-element.ts +2 -2
- package/backend/element-browser.ts +1 -1
- package/backend/event/consumer-scope.ts +2 -2
- package/backend/event/interaction-request-assignment.ts +1 -1
- package/backend/event/interaction-request-map.ts +3 -3
- package/backend/form-engine/container/flex-form-container-container.ts +2 -2
- package/backend/form-engine/container/flex-form-section-container.ts +1 -1
- package/backend/form-engine/container/inline-control-container.ts +14 -14
- package/backend/form-engine/element/abstract-sortable-select-items.ts +3 -3
- package/backend/form-engine/element/color-element.ts +1 -1
- package/backend/form-engine/element/datetime-element.ts +1 -1
- package/backend/form-engine/element/extra/char-counter.ts +2 -2
- package/backend/form-engine/element/extra/select-box-filter.ts +1 -1
- package/backend/form-engine/element/mfa-info-element.ts +2 -2
- package/backend/form-engine/element/online-media-form-element.ts +8 -4
- package/backend/form-engine/element/select-multiple-side-by-side-element.ts +2 -2
- package/backend/form-engine/element/select-tree.ts +3 -3
- package/backend/form-engine/element/slug-element.ts +7 -7
- package/backend/form-engine/element/suggest/result-container.ts +1 -1
- package/backend/form-engine/element/table-wizard-element.ts +4 -4
- package/backend/form-engine/inline-relation/ajax-dispatcher.ts +3 -3
- package/backend/form-engine-validation.ts +11 -5
- package/backend/form-engine.ts +19 -23
- package/backend/global-event-handler.ts +1 -1
- package/backend/hotkeys/hotkey-struct.ts +1 -1
- package/backend/hotkeys.ts +3 -3
- package/backend/image-manipulation.ts +19 -19
- package/backend/layout-module/column-restriction.ts +61 -0
- package/backend/layout-module/drag-drop.ts +16 -4
- package/backend/layout-module/paste.ts +8 -1
- package/backend/live-search/element/result/item/action/action-container.ts +1 -1
- package/backend/live-search/element/result/item/item-container.ts +4 -4
- package/backend/live-search/element/result/result-container.ts +5 -0
- package/backend/live-search/element/result/result-pagination.ts +1 -1
- package/backend/live-search/live-search.ts +2 -2
- package/backend/localization/label-provider.ts +4 -4
- package/backend/localization/localization-wizard.ts +4 -4
- package/backend/localization/steps/content-record-selection-step.ts +8 -8
- package/backend/localization/steps/handler-selection-step.ts +4 -4
- package/backend/localization/steps/mode-step.ts +4 -4
- package/backend/localization/steps/source-language-step.ts +4 -4
- package/backend/localization/steps/target-language-step.ts +4 -4
- package/backend/login-refresh.ts +1 -9
- package/backend/login.ts +2 -2
- package/backend/modal.ts +38 -5
- package/backend/module/iframe.ts +10 -0
- package/backend/module/router.ts +10 -0
- package/backend/module-menu.ts +3 -3
- package/backend/multi-record-selection-action.ts +1 -1
- package/backend/multi-record-selection-delete-action.ts +1 -1
- package/backend/multi-record-selection.ts +14 -14
- package/backend/multi-step-wizard.ts +9 -2
- package/backend/new-multiple-pages.ts +2 -2
- package/backend/new-record-wizard.ts +15 -15
- package/backend/notification.ts +90 -6
- package/backend/online-media.ts +1 -3
- package/backend/page-wizard/page-wizard.ts +2 -2
- package/backend/page-wizard/steps/doktype-step.ts +5 -5
- package/backend/pagetsconfig/pagetsconfig-includes.ts +1 -1
- package/backend/popover.ts +5 -5
- package/backend/record-download-button.ts +5 -6
- package/backend/recordlist.ts +11 -6
- package/backend/security/element/csp-reports.ts +8 -8
- package/backend/setup-module.ts +2 -2
- package/backend/sortable-table.ts +10 -4
- package/backend/storage/abstract-client-storage.ts +2 -2
- package/backend/storage/module-state-storage.ts +2 -2
- package/backend/tests/backend/utility/dom-helper-test.ts +2 -2
- package/backend/tests/fixtures/modal-autofocus.html +1 -0
- package/backend/tests/form-engine/element/extra/select-box-filter-test.ts +3 -3
- package/backend/tests/form-engine-validation-test.ts +1 -1
- package/backend/tests/modal-test.ts +91 -0
- package/backend/tests/notification-test.ts +176 -0
- package/backend/tests/tree/tree-test.ts +41 -0
- package/backend/tree/file-storage-browser.ts +1 -1
- package/backend/tree/file-storage-tree-container.ts +4 -4
- package/backend/tree/page-browser.ts +1 -1
- package/backend/tree/page-position-select.ts +1 -1
- package/backend/tree/page-tree-element.ts +9 -2
- package/backend/tree/page-tree.ts +7 -1
- package/backend/tree/tree-module-state.ts +5 -5
- package/backend/tree/tree.ts +15 -8
- package/backend/user-pass-login.ts +2 -2
- package/backend/utility/collapse-state-persister.ts +1 -1
- package/backend/utility/collapse-state-search.ts +6 -6
- package/backend/utility/dom-helper.ts +3 -3
- package/backend/utility.ts +6 -6
- package/backend/viewport/content-navigation.ts +5 -0
- package/backend/viewport/navigation-container.ts +1 -1
- package/backend/viewport/toolbar.ts +3 -3
- package/backend/window-manager.ts +2 -2
- package/backend/wizard/events/auto-advance-event.ts +6 -0
- package/backend/wizard/events/before-next-step-event.ts +6 -0
- package/backend/wizard/events/step-summary-event.ts +6 -0
- package/backend/wizard/move-content-element.ts +1 -1
- package/backend/wizard/wizard.ts +8 -10
- package/belog/backend-log.ts +2 -2
- package/beuser/permissions.ts +2 -2
- package/core/ajax/ajax-response.ts +1 -1
- package/core/ajax/input-transformer.ts +1 -1
- package/core/event/debounce-event.ts +4 -4
- package/core/event/event-interface.ts +3 -3
- package/core/event/regular-event.ts +7 -7
- package/core/event/request-animation-frame-event.ts +4 -4
- package/core/event/throttle-event.ts +4 -4
- package/core/java-script-item-processor.ts +6 -0
- package/core/referrer-refresh.ts +2 -2
- package/core/security-utility.ts +1 -1
- package/dashboard/dashboard-wizard.ts +2 -2
- package/dashboard/dashboard.ts +8 -13
- package/dashboard/wizard/steps/preset-step.ts +3 -3
- package/extensionmanager/main.ts +7 -7
- package/filelist/browse-files.ts +1 -1
- package/filelist/browse-folders.ts +2 -2
- package/filelist/file-list-dragdrop.ts +5 -5
- package/filelist/file-list-rename-handler.ts +3 -6
- package/filelist/file-list-replace-handler.ts +3 -6
- package/filelist/file-list-transfer-handler.ts +2 -2
- package/filelist/file-list.ts +8 -9
- package/form/backend/form-editor/component/date-editor.ts +4 -0
- package/form/backend/form-editor/component/form-element-selector.ts +4 -0
- package/form/backend/form-editor/inspector-component.ts +6 -6
- package/form/backend/form-editor/mediator.ts +36 -36
- package/form/backend/form-editor/modals-component.ts +115 -6
- package/form/backend/form-editor/stage-component.ts +4 -4
- package/form/backend/form-editor/view-model.ts +7 -7
- package/form/backend/form-manager/view-model.ts +5 -5
- package/form/backend/form-wizard/form-wizard.ts +2 -2
- package/form/backend/form-wizard/steps/storage-step.ts +1 -1
- package/impexp/import-export.ts +1 -1
- package/info/translation-status.ts +2 -2
- package/install/ajax/ajax-queue.ts +1 -1
- package/install/module/abstract-interactable-module.ts +2 -2
- package/install/module/environment/image-processing.ts +4 -4
- package/install/module/environment/mail-test.ts +2 -2
- package/install/module/maintenance/clear-tables.ts +3 -3
- package/install/module/maintenance/clear-typo3temp-files.ts +8 -8
- package/install/module/maintenance/create-admin.ts +3 -3
- package/install/module/maintenance/database-analyzer.ts +9 -7
- package/install/module/maintenance/language-packs.ts +4 -4
- package/install/module/maintenance/reference-index.ts +1 -1
- package/install/module/settings/change-install-tool-password.ts +1 -1
- package/install/module/settings/extension-configuration.ts +5 -5
- package/install/module/settings/features.ts +1 -1
- package/install/module/settings/local-configuration.ts +5 -5
- package/install/module/settings/presets.ts +2 -2
- package/install/module/settings/system-maintainer.ts +1 -1
- package/install/module/upgrade/extension-scanner.ts +5 -5
- package/install/module/upgrade/tca-migrations-check.ts +1 -1
- package/install/module/upgrade/upgrade-docs.ts +16 -16
- package/install/module/upgrade/upgrade-wizards.ts +7 -8
- package/install/renderable/language-packs.ts +8 -2
- package/lowlevel/query-generator.ts +2 -2
- package/package.json +2 -2
- package/redirects/event-handler.ts +6 -0
- package/rte-ckeditor/ckeditor5.ts +7 -3
- package/rte-ckeditor/legacy/ckeditor5-bundle.ts +0 -1
- package/rte-ckeditor/plugin/typo3-link.ts +7 -9
- package/rte-ckeditor/rte-link-browser.ts +1 -1
- package/rte-ckeditor/tests/ckeditor5-test.ts +68 -0
- package/scheduler/form-engine/element/timing-options-element.ts +1 -1
- package/scheduler/scheduler-add-group.ts +4 -12
- package/scheduler/scheduler.ts +2 -2
- package/styleguide/checkbox-demo.ts +1 -1
- package/tstemplate/template-analyzer.ts +1 -1
- package/viewpage/main.ts +1 -1
- package/workspaces/backend.ts +5 -5
- package/workspaces/preview.ts +41 -2
- package/workspaces/renderable/record-table.ts +95 -78
- package/workspaces/renderable/send-to-stage-form.ts +1 -1
|
@@ -20,12 +20,12 @@ export default class DomHelper {
|
|
|
20
20
|
/**
|
|
21
21
|
* Get all parent elements matching the passed `selector`
|
|
22
22
|
*/
|
|
23
|
-
public static parents(el: Element, selector: string):
|
|
24
|
-
const parents = [];
|
|
23
|
+
public static parents<T extends Element = Element>(el: Element, selector: string): T[] {
|
|
24
|
+
const parents: T[] = [];
|
|
25
25
|
let closest;
|
|
26
26
|
while ((closest = el.parentElement.closest(selector)) !== null) {
|
|
27
27
|
el = closest;
|
|
28
|
-
parents.push(closest);
|
|
28
|
+
parents.push(closest as T);
|
|
29
29
|
}
|
|
30
30
|
|
|
31
31
|
return parents;
|
package/backend/utility.ts
CHANGED
|
@@ -23,7 +23,7 @@ class Utility {
|
|
|
23
23
|
* @return Array<string>
|
|
24
24
|
*/
|
|
25
25
|
public static trimExplode(delimiter: string, string: string): Array<string> {
|
|
26
|
-
return string.split(delimiter).map((item
|
|
26
|
+
return string.split(delimiter).map((item) => item.trim()).filter((item) => item !== '');
|
|
27
27
|
}
|
|
28
28
|
|
|
29
29
|
/**
|
|
@@ -32,7 +32,7 @@ class Utility {
|
|
|
32
32
|
* @param {string[]|any[]} items
|
|
33
33
|
*/
|
|
34
34
|
public static trimItems(items: any[]): any[] {
|
|
35
|
-
return items.map((item
|
|
35
|
+
return items.map((item) => {
|
|
36
36
|
if (item instanceof String) {
|
|
37
37
|
return item.trim();
|
|
38
38
|
}
|
|
@@ -51,8 +51,8 @@ class Utility {
|
|
|
51
51
|
public static intExplode(delimiter: string, string: string, excludeZeroValues: boolean = false): Array<number> {
|
|
52
52
|
return string
|
|
53
53
|
.split(delimiter)
|
|
54
|
-
.map((item
|
|
55
|
-
.filter((item
|
|
54
|
+
.map((item) => parseInt(item, 10))
|
|
55
|
+
.filter((item) => !isNaN(item) || excludeZeroValues && item === 0);
|
|
56
56
|
}
|
|
57
57
|
|
|
58
58
|
/**
|
|
@@ -70,7 +70,7 @@ class Utility {
|
|
|
70
70
|
|
|
71
71
|
public static convertFormToObject(form: HTMLFormElement): { [key: string]: any } {
|
|
72
72
|
const obj: { [key: string]: any } = {};
|
|
73
|
-
form.querySelectorAll('input, select, textarea').forEach((element
|
|
73
|
+
form.querySelectorAll<HTMLInputElement|HTMLSelectElement|HTMLTextAreaElement>('input, select, textarea').forEach((element): void => {
|
|
74
74
|
const name = element.name;
|
|
75
75
|
const value = element.value;
|
|
76
76
|
|
|
@@ -106,7 +106,7 @@ class Utility {
|
|
|
106
106
|
};
|
|
107
107
|
|
|
108
108
|
return objects.reduce((prev: IndexedObject, obj: IndexedObject): IndexedObject => {
|
|
109
|
-
Object.keys(obj).forEach((key
|
|
109
|
+
Object.keys(obj).forEach((key): void => {
|
|
110
110
|
const pVal = prev[key];
|
|
111
111
|
const oVal = obj[key];
|
|
112
112
|
|
|
@@ -467,4 +467,9 @@ declare global {
|
|
|
467
467
|
interface HTMLElementTagNameMap {
|
|
468
468
|
'typo3-backend-content-navigation': ContentNavigation;
|
|
469
469
|
}
|
|
470
|
+
|
|
471
|
+
interface HTMLElementEventMap {
|
|
472
|
+
[NavigationToggleEvent.eventName]: NavigationToggleEvent;
|
|
473
|
+
[NavigationStateChangeEvent.eventName]: NavigationStateChangeEvent;
|
|
474
|
+
}
|
|
470
475
|
}
|
|
@@ -103,7 +103,7 @@ class NavigationContainer extends AbstractContainer {
|
|
|
103
103
|
if (!contentNavigation || !navigationContainer) {
|
|
104
104
|
return;
|
|
105
105
|
}
|
|
106
|
-
navigationContainer.querySelectorAll('[data-component]').forEach((el
|
|
106
|
+
navigationContainer.querySelectorAll<HTMLElement>('[data-component]').forEach((el) => el.style.display = 'none');
|
|
107
107
|
contentNavigation.showNavigation();
|
|
108
108
|
const selectedElement = navigationContainer.querySelector('[data-component="' + component + '"]') as HTMLElement;
|
|
109
109
|
if (selectedElement) {
|
|
@@ -68,7 +68,7 @@ class Toolbar {
|
|
|
68
68
|
}
|
|
69
69
|
|
|
70
70
|
// Clear existing highlights
|
|
71
|
-
toolbar.querySelectorAll(ModuleSelector.link + '.dropdown-item').forEach((element
|
|
71
|
+
toolbar.querySelectorAll(ModuleSelector.link + '.dropdown-item').forEach((element) => {
|
|
72
72
|
element.classList.remove('active');
|
|
73
73
|
element.removeAttribute('aria-current');
|
|
74
74
|
});
|
|
@@ -79,8 +79,8 @@ class Toolbar {
|
|
|
79
79
|
}
|
|
80
80
|
|
|
81
81
|
private highlightModuleItem(toolbar: Element, module: Module, current: boolean): boolean {
|
|
82
|
-
const toolbarElements = toolbar.querySelectorAll(ModuleSelector.link + selector`[data-moduleroute-identifier="${module.name}"].dropdown-item`);
|
|
83
|
-
toolbarElements.forEach((element
|
|
82
|
+
const toolbarElements = toolbar.querySelectorAll<HTMLElement>(ModuleSelector.link + selector`[data-moduleroute-identifier="${module.name}"].dropdown-item`);
|
|
83
|
+
toolbarElements.forEach((element) => {
|
|
84
84
|
element.classList.add('active');
|
|
85
85
|
if (current) {
|
|
86
86
|
element.setAttribute('aria-current', 'location');
|
|
@@ -20,12 +20,12 @@ class WindowManager {
|
|
|
20
20
|
private windows: {[key: string]: Window} = {};
|
|
21
21
|
|
|
22
22
|
// alias for `localOpen`
|
|
23
|
-
public open(...params:
|
|
23
|
+
public open(...params: Parameters<WindowManager['_localOpen']>): Window {
|
|
24
24
|
return this._localOpen.apply(null, params);
|
|
25
25
|
}
|
|
26
26
|
|
|
27
27
|
// @todo Not implemented, yet
|
|
28
|
-
public globalOpen(...params:
|
|
28
|
+
public globalOpen(...params: Parameters<WindowManager['_localOpen']>): Window {
|
|
29
29
|
return this._localOpen.apply(null, params);
|
|
30
30
|
}
|
|
31
31
|
|
|
@@ -48,7 +48,7 @@ export class MoveContentElement {
|
|
|
48
48
|
? miscLabels.get('copyElementToHere')
|
|
49
49
|
: miscLabels.get('moveElementToHere');
|
|
50
50
|
|
|
51
|
-
document.querySelectorAll('[data-action="paste"]').forEach((button
|
|
51
|
+
document.querySelectorAll<HTMLButtonElement>('[data-action="paste"]').forEach((button): void => {
|
|
52
52
|
button.querySelector('span.t3js-button-label').textContent = buttonLabel;
|
|
53
53
|
});
|
|
54
54
|
}).delegateTo(container, '#makeCopy');
|
package/backend/wizard/wizard.ts
CHANGED
|
@@ -37,10 +37,8 @@ import { BeforeNextStepEvent } from '@typo3/backend/wizard/events/before-next-st
|
|
|
37
37
|
|
|
38
38
|
export type DataStore = object;
|
|
39
39
|
|
|
40
|
-
type DataStoreKey = keyof DataStore;
|
|
41
|
-
|
|
42
40
|
@customElement('typo3-backend-wizard')
|
|
43
|
-
export class Wizard extends LitElement {
|
|
41
|
+
export class Wizard<TDataStore extends DataStore = DataStore> extends LitElement {
|
|
44
42
|
@property({ type: Array, attribute: false }) steps: WizardStepInterface[] = [];
|
|
45
43
|
@property({ type: String, attribute: 'confirm-button-label' }) confirmButtonLabel: string;
|
|
46
44
|
@property({ type: Boolean, attribute: 'skip-summary' }) skipSummary: boolean = false;
|
|
@@ -48,7 +46,7 @@ export class Wizard extends LitElement {
|
|
|
48
46
|
|
|
49
47
|
@state() protected currentStepIndex: number = 0;
|
|
50
48
|
@state() protected currentStep!: WizardStepInterface;
|
|
51
|
-
@state() protected dataStore:
|
|
49
|
+
@state() protected dataStore: TDataStore = {} as TDataStore;
|
|
52
50
|
@state() protected allSteps: WizardStepInterface[] = [];
|
|
53
51
|
|
|
54
52
|
private progressTracker: ProgressTrackerElement | null = null;
|
|
@@ -79,20 +77,20 @@ export class Wizard extends LitElement {
|
|
|
79
77
|
return summaries;
|
|
80
78
|
}
|
|
81
79
|
|
|
82
|
-
public getStoreData<T extends
|
|
80
|
+
public getStoreData<T extends keyof TDataStore>(key: T): NoInfer<TDataStore[T]> {
|
|
83
81
|
return this.dataStore[key] ?? null;
|
|
84
82
|
}
|
|
85
83
|
|
|
86
|
-
public setStoreData<T extends
|
|
84
|
+
public setStoreData<T extends keyof TDataStore>(key: T, value: NoInfer<TDataStore[T]>): void {
|
|
87
85
|
this.dataStore = { ...this.dataStore, [key]: value };
|
|
88
86
|
}
|
|
89
87
|
|
|
90
|
-
public getDataStore():
|
|
88
|
+
public getDataStore(): TDataStore {
|
|
91
89
|
return this.dataStore;
|
|
92
90
|
}
|
|
93
91
|
|
|
94
|
-
public clearStoreData<T extends
|
|
95
|
-
const newDataStore = { ...this.dataStore };
|
|
92
|
+
public clearStoreData<T extends keyof TDataStore>(key: T): void {
|
|
93
|
+
const newDataStore: TDataStore = { ...this.dataStore };
|
|
96
94
|
delete newDataStore[key];
|
|
97
95
|
this.dataStore = newDataStore;
|
|
98
96
|
}
|
|
@@ -490,7 +488,7 @@ export class Wizard extends LitElement {
|
|
|
490
488
|
}
|
|
491
489
|
|
|
492
490
|
private handleRestart(): void {
|
|
493
|
-
this.dataStore = {};
|
|
491
|
+
this.dataStore = {} as TDataStore;
|
|
494
492
|
this.goToStep(0).then(() => this.updateComplete);
|
|
495
493
|
}
|
|
496
494
|
}
|
package/belog/backend-log.ts
CHANGED
|
@@ -47,12 +47,12 @@ class BackendLog {
|
|
|
47
47
|
|
|
48
48
|
private initializeDateTimePickerElements(): void {
|
|
49
49
|
this.dateTimePickerElements.forEach(
|
|
50
|
-
(dateTimePickerElement
|
|
50
|
+
(dateTimePickerElement) => DateTimePicker.initialize(dateTimePickerElement)
|
|
51
51
|
);
|
|
52
52
|
}
|
|
53
53
|
|
|
54
54
|
private initializeElementBrowserElements(): void {
|
|
55
|
-
this.elementBrowserElements.forEach((element
|
|
55
|
+
this.elementBrowserElements.forEach((element): void => {
|
|
56
56
|
const triggerField = <HTMLInputElement>document.getElementById(element.dataset.triggerFor);
|
|
57
57
|
element.dataset.fieldReference = triggerField.name;
|
|
58
58
|
element.dataset.allowedTypes = 'pages';
|
package/beuser/permissions.ts
CHANGED
|
@@ -281,8 +281,8 @@ class Permissions {
|
|
|
281
281
|
if (editControllerSelector !== null) {
|
|
282
282
|
// Click events to change permissions (in template Edit.html)
|
|
283
283
|
new RegularEvent('click', (e: Event, currentTarget: Element): void => {
|
|
284
|
-
const args = (currentTarget as HTMLElement).dataset.checkChangePermissions.split(',').map((item
|
|
285
|
-
Permissions.updatePermissionValue.apply(this, args);
|
|
284
|
+
const args = (currentTarget as HTMLElement).dataset.checkChangePermissions.split(',').map((item) => item.trim());
|
|
285
|
+
Permissions.updatePermissionValue.apply(this, args as [string, string]);
|
|
286
286
|
}).delegateTo(editControllerSelector, '[data-check-change-permissions]');
|
|
287
287
|
}
|
|
288
288
|
}
|
|
@@ -47,7 +47,7 @@ export class AjaxResponse {
|
|
|
47
47
|
*/
|
|
48
48
|
public async dereference(): Promise<SimpleResponseInterface> {
|
|
49
49
|
const headers = new Map<string, string>();
|
|
50
|
-
this.response.headers.forEach((value
|
|
50
|
+
this.response.headers.forEach((value, name) => headers.set(name, value));
|
|
51
51
|
return {
|
|
52
52
|
status: this.response.status,
|
|
53
53
|
headers: headers,
|
|
@@ -82,7 +82,7 @@ export class InputTransformer {
|
|
|
82
82
|
}
|
|
83
83
|
|
|
84
84
|
private static filter(obj: GenericKeyValue): GenericKeyValue {
|
|
85
|
-
Object.keys(obj).forEach((key
|
|
85
|
+
Object.keys(obj).forEach((key): void => {
|
|
86
86
|
if (typeof obj[key] === 'undefined') {
|
|
87
87
|
delete obj[key];
|
|
88
88
|
}
|
|
@@ -18,20 +18,20 @@ import type { Listener } from './event-interface';
|
|
|
18
18
|
* Debounces an event listener that is executed after the event happened.
|
|
19
19
|
* A debounced event listener is not executed again until a certain amount of time has passed without it being called.
|
|
20
20
|
*/
|
|
21
|
-
class DebounceEvent extends RegularEvent {
|
|
22
|
-
constructor(eventName: string, callback: Listener, wait: number = 250) {
|
|
21
|
+
class DebounceEvent<E extends Event = Event, T extends Element = Element> extends RegularEvent<E, T> {
|
|
22
|
+
constructor(eventName: string, callback: Listener<E, T>, wait: number = 250) {
|
|
23
23
|
super(eventName, callback);
|
|
24
24
|
this.callback = this.debounce(this.callback, wait);
|
|
25
25
|
}
|
|
26
26
|
|
|
27
|
-
private debounce(callback: Listener, wait: number): Listener {
|
|
27
|
+
private debounce(callback: Listener<E, T>, wait: number): Listener<E, T> {
|
|
28
28
|
let timeout: number = null;
|
|
29
29
|
|
|
30
30
|
return function (this: Node, ...args: unknown[]): void {
|
|
31
31
|
clearTimeout(timeout);
|
|
32
32
|
timeout = setTimeout((): void => {
|
|
33
33
|
timeout = null;
|
|
34
|
-
callback.apply(this, args);
|
|
34
|
+
callback.apply(this, args as Parameters<Listener<E, T>>);
|
|
35
35
|
}, wait);
|
|
36
36
|
};
|
|
37
37
|
}
|
|
@@ -11,10 +11,10 @@
|
|
|
11
11
|
* The TYPO3 project - inspiring people to share!
|
|
12
12
|
*/
|
|
13
13
|
|
|
14
|
-
export type Listener = EventListenerWithTarget
|
|
14
|
+
export type Listener<E extends Event = Event, T extends Element = Element> = EventListenerWithTarget<E, T>;
|
|
15
15
|
|
|
16
|
-
export interface EventListenerWithTarget {
|
|
17
|
-
(evt:
|
|
16
|
+
export interface EventListenerWithTarget<E extends Event = Event, T extends Element = Element> {
|
|
17
|
+
(evt: E, target: T): void;
|
|
18
18
|
}
|
|
19
19
|
|
|
20
20
|
export interface EventInterface {
|
|
@@ -11,15 +11,15 @@
|
|
|
11
11
|
* The TYPO3 project - inspiring people to share!
|
|
12
12
|
*/
|
|
13
13
|
|
|
14
|
-
import type { EventInterface, Listener } from './event-interface';
|
|
14
|
+
import type { EventInterface, EventListenerWithTarget, Listener } from './event-interface';
|
|
15
15
|
|
|
16
|
-
class RegularEvent implements EventInterface {
|
|
16
|
+
class RegularEvent<E extends Event = Event, T extends Element = Element> implements EventInterface {
|
|
17
17
|
protected eventName: string;
|
|
18
|
-
protected callback: Listener
|
|
18
|
+
protected callback: Listener<E, T>;
|
|
19
19
|
protected options: AddEventListenerOptions | boolean;
|
|
20
20
|
private boundElement: EventTarget;
|
|
21
21
|
|
|
22
|
-
constructor(eventName: string, callback: Listener, options: AddEventListenerOptions | boolean = false) {
|
|
22
|
+
constructor(eventName: string, callback: Listener<E, T>, options: AddEventListenerOptions | boolean = false) {
|
|
23
23
|
this.eventName = eventName;
|
|
24
24
|
this.callback = callback;
|
|
25
25
|
this.options = options;
|
|
@@ -31,7 +31,7 @@ class RegularEvent implements EventInterface {
|
|
|
31
31
|
return;
|
|
32
32
|
}
|
|
33
33
|
this.boundElement = element;
|
|
34
|
-
element.addEventListener(this.eventName, this.callback, this.options);
|
|
34
|
+
element.addEventListener(this.eventName, this.callback as EventListener, this.options);
|
|
35
35
|
}
|
|
36
36
|
|
|
37
37
|
public delegateTo(element: EventTarget, selector: string): void {
|
|
@@ -43,7 +43,7 @@ class RegularEvent implements EventInterface {
|
|
|
43
43
|
element.addEventListener(this.eventName, (e: Event): void => {
|
|
44
44
|
for (let targetElement = <HTMLElement>e.target; targetElement && targetElement !== this.boundElement; targetElement = targetElement.parentElement) {
|
|
45
45
|
if (targetElement.matches(selector)) {
|
|
46
|
-
this.callback.call(targetElement, e, targetElement);
|
|
46
|
+
(this.callback as EventListenerWithTarget).call(targetElement, e, targetElement);
|
|
47
47
|
break;
|
|
48
48
|
}
|
|
49
49
|
}
|
|
@@ -51,7 +51,7 @@ class RegularEvent implements EventInterface {
|
|
|
51
51
|
}
|
|
52
52
|
|
|
53
53
|
public release(): void {
|
|
54
|
-
this.boundElement.removeEventListener(this.eventName, this.callback);
|
|
54
|
+
this.boundElement.removeEventListener(this.eventName, this.callback as EventListener);
|
|
55
55
|
}
|
|
56
56
|
}
|
|
57
57
|
|
|
@@ -17,13 +17,13 @@ import type { Listener } from './event-interface';
|
|
|
17
17
|
/**
|
|
18
18
|
* Creates a event aimed for high performance visual operations
|
|
19
19
|
*/
|
|
20
|
-
class RequestAnimationFrameEvent extends RegularEvent {
|
|
21
|
-
constructor(eventName: string, callback: Listener) {
|
|
20
|
+
class RequestAnimationFrameEvent<E extends Event = Event, T extends Element = Element> extends RegularEvent<E, T> {
|
|
21
|
+
constructor(eventName: string, callback: Listener<E, T>) {
|
|
22
22
|
super(eventName, callback);
|
|
23
23
|
this.callback = this.req(this.callback);
|
|
24
24
|
}
|
|
25
25
|
|
|
26
|
-
private req(callback: Listener): Listener {
|
|
26
|
+
private req(callback: Listener<E, T>): Listener<E, T> {
|
|
27
27
|
let timeout: number = null;
|
|
28
28
|
|
|
29
29
|
return (...args: unknown[]) => {
|
|
@@ -33,7 +33,7 @@ class RequestAnimationFrameEvent extends RegularEvent {
|
|
|
33
33
|
|
|
34
34
|
timeout = window.requestAnimationFrame(() => {
|
|
35
35
|
// Run our scroll functions
|
|
36
|
-
callback.apply(this, args);
|
|
36
|
+
callback.apply(this, args as Parameters<Listener<E, T>>);
|
|
37
37
|
});
|
|
38
38
|
};
|
|
39
39
|
}
|
|
@@ -17,13 +17,13 @@ import type { Listener } from './event-interface';
|
|
|
17
17
|
/**
|
|
18
18
|
* Throttles the event listener to be called only after a defined time during the event's execution over time.
|
|
19
19
|
*/
|
|
20
|
-
class ThrottleEvent extends RegularEvent {
|
|
21
|
-
constructor(eventName: string, callback: Listener, limit: number) {
|
|
20
|
+
class ThrottleEvent<E extends Event = Event, T extends Element = Element> extends RegularEvent<E, T> {
|
|
21
|
+
constructor(eventName: string, callback: Listener<E, T>, limit: number) {
|
|
22
22
|
super(eventName, callback);
|
|
23
23
|
this.callback = this.throttle(callback, limit);
|
|
24
24
|
}
|
|
25
25
|
|
|
26
|
-
private throttle(callback: Listener, limit: number): Listener {
|
|
26
|
+
private throttle(callback: Listener<E, T>, limit: number): Listener<E, T> {
|
|
27
27
|
let eventData: unknown[] | null = null;
|
|
28
28
|
let intervalId: number | null = null;
|
|
29
29
|
|
|
@@ -41,7 +41,7 @@ class ThrottleEvent extends RegularEvent {
|
|
|
41
41
|
intervalId = null;
|
|
42
42
|
return;
|
|
43
43
|
}
|
|
44
|
-
callback.apply(this, eventData);
|
|
44
|
+
callback.apply(this, eventData as Parameters<Listener<E, T>>);
|
|
45
45
|
eventData = null;
|
|
46
46
|
};
|
|
47
47
|
// immediate dispatch, no need to wait as no timer is active
|
|
@@ -169,3 +169,9 @@ export class JavaScriptItemProcessor {
|
|
|
169
169
|
executeJavaScriptModuleInstruction(payload);
|
|
170
170
|
}
|
|
171
171
|
}
|
|
172
|
+
|
|
173
|
+
declare global {
|
|
174
|
+
interface DocumentEventMap {
|
|
175
|
+
'typo3:import-javascript-module': CustomEvent<{ specifier: string, importPromise?: Promise<unknown> }>;
|
|
176
|
+
}
|
|
177
|
+
}
|
package/core/referrer-refresh.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
document.querySelectorAll('a#referrer-refresh')
|
|
2
|
-
.forEach((element
|
|
1
|
+
document.querySelectorAll<HTMLAnchorElement>('a#referrer-refresh')
|
|
2
|
+
.forEach((element) => element.click());
|
package/core/security-utility.ts
CHANGED
|
@@ -33,7 +33,7 @@ class SecurityUtility {
|
|
|
33
33
|
const values = new Uint8Array(Math.ceil(length / 2));
|
|
34
34
|
crypto.getRandomValues(values);
|
|
35
35
|
return Array.from(values)
|
|
36
|
-
.map((item
|
|
36
|
+
.map((item): string => item.toString(16).padStart(2, '0'))
|
|
37
37
|
.join('')
|
|
38
38
|
.substr(0, length);
|
|
39
39
|
}
|
|
@@ -28,7 +28,7 @@ export interface DashboardWizardDataStore extends DataStore {
|
|
|
28
28
|
type DashboardWizardDataStoreKey = keyof DashboardWizardDataStore;
|
|
29
29
|
|
|
30
30
|
export interface DashboardWizardContext {
|
|
31
|
-
wizard: Wizard
|
|
31
|
+
wizard: Wizard<DashboardWizardDataStore>;
|
|
32
32
|
getStoreData: <T extends DashboardWizardDataStoreKey>(key: T) => NoInfer<DashboardWizardDataStore[T]>;
|
|
33
33
|
setStoreData: <T extends DashboardWizardDataStoreKey>(key: T, value: NoInfer<DashboardWizardDataStore[T]>) => void;
|
|
34
34
|
clearStoreData: <T extends DashboardWizardDataStoreKey>(key: T) => void;
|
|
@@ -41,7 +41,7 @@ export class DashboardWizard extends LitElement {
|
|
|
41
41
|
@state() steps: WizardStepInterface[] = [];
|
|
42
42
|
@state() submissionService: SubmissionServiceInterface;
|
|
43
43
|
|
|
44
|
-
@query('typo3-backend-wizard') wizard!: Wizard
|
|
44
|
+
@query('typo3-backend-wizard') wizard!: Wizard<DashboardWizardDataStore>;
|
|
45
45
|
|
|
46
46
|
private context: DashboardWizardContext;
|
|
47
47
|
|
package/dashboard/dashboard.ts
CHANGED
|
@@ -351,7 +351,7 @@ export class Dashboard extends LitElement {
|
|
|
351
351
|
.then(async (response: AjaxResponse): Promise<void> => {
|
|
352
352
|
const data = await response.resolve();
|
|
353
353
|
if (data.status === 'ok') {
|
|
354
|
-
const oldDashboard: DashboardInterface = this.dashboards.filter((dashboard
|
|
354
|
+
const oldDashboard: DashboardInterface = this.dashboards.filter((dashboard): boolean => {
|
|
355
355
|
return dashboard.identifier === identifier;
|
|
356
356
|
})[0];
|
|
357
357
|
const index = this.dashboards.indexOf(oldDashboard);
|
|
@@ -385,7 +385,7 @@ export class Dashboard extends LitElement {
|
|
|
385
385
|
.then(async (response: AjaxResponse): Promise<void> => {
|
|
386
386
|
const data = await response.resolve();
|
|
387
387
|
if (data.status === 'ok') {
|
|
388
|
-
const oldDashboard: DashboardInterface = this.dashboards.filter((dashboard
|
|
388
|
+
const oldDashboard: DashboardInterface = this.dashboards.filter((dashboard): boolean => {
|
|
389
389
|
return dashboard.identifier === identifier;
|
|
390
390
|
})[0];
|
|
391
391
|
const index = this.dashboards.indexOf(oldDashboard);
|
|
@@ -412,7 +412,7 @@ export class Dashboard extends LitElement {
|
|
|
412
412
|
.then(async (response: AjaxResponse): Promise<void> => {
|
|
413
413
|
const data = await response.resolve();
|
|
414
414
|
if (data.status === 'ok') {
|
|
415
|
-
this.dashboards = this.dashboards.filter((dashboard
|
|
415
|
+
this.dashboards = this.dashboards.filter((dashboard): boolean => {
|
|
416
416
|
return dashboard.identifier !== identifier;
|
|
417
417
|
});
|
|
418
418
|
const selectedDashboard = this.getDashboardFirst();
|
|
@@ -565,10 +565,10 @@ export class Dashboard extends LitElement {
|
|
|
565
565
|
|
|
566
566
|
private editDashboard(dashboard: DashboardInterface): void {
|
|
567
567
|
const content = html`
|
|
568
|
-
<form>
|
|
568
|
+
<form id="dashboard-edit-form">
|
|
569
569
|
<div class="form-group">
|
|
570
570
|
<label class="form-label" for="dashboard-form-edit-title">${labels.get('dashboard.title')}</label>
|
|
571
|
-
<input class="form-control" id="dashboard-form-edit-title" type="text" name="title" value=${dashboard.title || ''} required="required">
|
|
571
|
+
<input class="form-control" id="dashboard-form-edit-title" type="text" name="title" value=${dashboard.title || ''} required="required" autofocus>
|
|
572
572
|
</div>
|
|
573
573
|
</form>
|
|
574
574
|
`;
|
|
@@ -580,11 +580,6 @@ export class Dashboard extends LitElement {
|
|
|
580
580
|
severity: SeverityEnum.notice,
|
|
581
581
|
content,
|
|
582
582
|
callback: (currentModal: ModalElement): void => {
|
|
583
|
-
|
|
584
|
-
currentModal.addEventListener('typo3-modal-shown', (): void => {
|
|
585
|
-
(currentModal.querySelector('#dashboard-form-edit-title') as HTMLInputElement)?.focus();
|
|
586
|
-
});
|
|
587
|
-
|
|
588
583
|
currentModal.querySelector('form').addEventListener('submit', (e: Event): void => {
|
|
589
584
|
e.preventDefault();
|
|
590
585
|
const form = e.target as HTMLFormElement;
|
|
@@ -608,7 +603,7 @@ export class Dashboard extends LitElement {
|
|
|
608
603
|
text: labels.get('dashboard.configure.button.ok'),
|
|
609
604
|
btnClass: 'btn-primary',
|
|
610
605
|
name: 'save',
|
|
611
|
-
|
|
606
|
+
form: 'dashboard-edit-form',
|
|
612
607
|
},
|
|
613
608
|
]
|
|
614
609
|
});
|
|
@@ -1195,9 +1190,9 @@ export class DashboardWidget extends LitElement {
|
|
|
1195
1190
|
onComplete: async () => {
|
|
1196
1191
|
this.triggerContentRenderedEvent = true;
|
|
1197
1192
|
},
|
|
1198
|
-
onError: (error:
|
|
1193
|
+
onError: (error: unknown) => {
|
|
1199
1194
|
console.error(`Error while retrieving widget [${this.identifier}]: ${
|
|
1200
|
-
error instanceof AjaxResponse ? `${error.response.status} ${error.response.statusText}` : error.message
|
|
1195
|
+
error instanceof AjaxResponse ? `${error.response.status} ${error.response.statusText}` : (error as Error).message
|
|
1201
1196
|
}`);
|
|
1202
1197
|
},
|
|
1203
1198
|
});
|
|
@@ -71,7 +71,7 @@ export class PresetStep implements WizardStepInterface, WizardStepValueInterface
|
|
|
71
71
|
<div class="dashboard-wizard-preset">
|
|
72
72
|
<h2 class="h4">${labels.get('dashboard.wizard.preset.headline')}</h2>
|
|
73
73
|
<div class="form-check-card-container">
|
|
74
|
-
${presets.map((preset
|
|
74
|
+
${presets.map((preset) => html`
|
|
75
75
|
<div class="form-check form-check-type-card">
|
|
76
76
|
<input
|
|
77
77
|
class="form-check-input"
|
|
@@ -125,7 +125,7 @@ export class PresetStep implements WizardStepInterface, WizardStepValueInterface
|
|
|
125
125
|
return [];
|
|
126
126
|
}
|
|
127
127
|
|
|
128
|
-
const selectedPreset = this.task.value.find((preset
|
|
128
|
+
const selectedPreset = this.task.value.find((preset) => preset.identifier === selectedIdentifier);
|
|
129
129
|
if (!selectedPreset) {
|
|
130
130
|
return [];
|
|
131
131
|
}
|
|
@@ -154,7 +154,7 @@ export class PresetStep implements WizardStepInterface, WizardStepValueInterface
|
|
|
154
154
|
task: async (): Promise<DashboardPresetInterface[]> => {
|
|
155
155
|
const response = await new AjaxRequest(TYPO3.settings.ajaxUrls.dashboard_presets_get).get({ cache: 'no-cache' });
|
|
156
156
|
const data = await response.resolve();
|
|
157
|
-
return Object.values(data as Record<string, DashboardPresetInterface>).filter((preset
|
|
157
|
+
return Object.values(data as Record<string, DashboardPresetInterface>).filter((preset) => preset.showInWizard);
|
|
158
158
|
},
|
|
159
159
|
autoRun: false
|
|
160
160
|
});
|
package/extensionmanager/main.ts
CHANGED
|
@@ -174,17 +174,17 @@ class ExtensionManager {
|
|
|
174
174
|
}
|
|
175
175
|
|
|
176
176
|
private filterExtensions(searchText: string): void {
|
|
177
|
-
const filterableColumns = document.querySelectorAll('[data-filterable]');
|
|
177
|
+
const filterableColumns = document.querySelectorAll<HTMLTableRowElement>('[data-filterable]');
|
|
178
178
|
const columnIndices: number[] = [];
|
|
179
|
-
filterableColumns.forEach((element
|
|
179
|
+
filterableColumns.forEach((element): void => {
|
|
180
180
|
const children = Array.from(element.parentElement.children);
|
|
181
181
|
columnIndices.push(children.indexOf(element));
|
|
182
182
|
});
|
|
183
|
-
const rows = document.querySelectorAll('#typo3-extension-list tbody tr');
|
|
184
|
-
rows.forEach((row
|
|
185
|
-
const columns = columnIndices.map((index
|
|
183
|
+
const rows = document.querySelectorAll<HTMLTableRowElement>('#typo3-extension-list tbody tr');
|
|
184
|
+
rows.forEach((row): void => {
|
|
185
|
+
const columns = columnIndices.map((index) => row.children.item(index));
|
|
186
186
|
const values: string[] = [];
|
|
187
|
-
columns.forEach((column
|
|
187
|
+
columns.forEach((column): void => {
|
|
188
188
|
values.push(column.textContent.trim().replace(/\s+/g, ' '));
|
|
189
189
|
});
|
|
190
190
|
row.classList.toggle('hidden', searchText !== '' && !RegExp(searchText, 'i').test(values.join(':')));
|
|
@@ -238,7 +238,7 @@ class ExtensionManager {
|
|
|
238
238
|
labelBody.classList.add('form-check-label-body');
|
|
239
239
|
labelBody.innerHTML = comment
|
|
240
240
|
.replace(/(\r\n|\n\r|\r|\n)/g, '\n')
|
|
241
|
-
.split(/\n/).map((line
|
|
241
|
+
.split(/\n/).map((line): string => {
|
|
242
242
|
return securityUtility.encodeHtml(line);
|
|
243
243
|
})
|
|
244
244
|
.join('<br>');
|
package/filelist/browse-files.ts
CHANGED
|
@@ -104,7 +104,7 @@ class BrowseFiles {
|
|
|
104
104
|
}
|
|
105
105
|
|
|
106
106
|
const selectedItems: ResourceInterface[] = [];
|
|
107
|
-
items.forEach((checkbox
|
|
107
|
+
items.forEach((checkbox) => {
|
|
108
108
|
if (checkbox.checked) {
|
|
109
109
|
const element = checkbox.closest(FileListActionSelector.elementSelector) as HTMLInputElement;
|
|
110
110
|
const resource = FileListActionUtility.getResourceForElement(element);
|
|
@@ -72,7 +72,7 @@ class BrowseFolders {
|
|
|
72
72
|
return;
|
|
73
73
|
}
|
|
74
74
|
const selectedItems: ResourceInterface[] = [];
|
|
75
|
-
items.forEach((checkbox
|
|
75
|
+
items.forEach((checkbox) => {
|
|
76
76
|
if (checkbox.checked) {
|
|
77
77
|
const element = checkbox.closest(FileListActionSelector.elementSelector) as HTMLInputElement;
|
|
78
78
|
const resource = FileListActionUtility.getResourceForElement(element);
|
|
@@ -84,7 +84,7 @@ class BrowseFolders {
|
|
|
84
84
|
if (!selectedItems.length) {
|
|
85
85
|
return;
|
|
86
86
|
}
|
|
87
|
-
selectedItems.forEach(function (resource
|
|
87
|
+
selectedItems.forEach(function (resource) {
|
|
88
88
|
BrowseFolders.insertElement(resource.identifier);
|
|
89
89
|
});
|
|
90
90
|
ElementBrowser.focusOpenerAndClose();
|