typo3-typescript-sources 13.4.33 → 13.4.34

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/.last-synced-tag CHANGED
@@ -1 +1 @@
1
- v13.4.33
1
+ v13.4.34
package/README.md CHANGED
@@ -16,7 +16,7 @@ npm install typo3-typescript-sources
16
16
 
17
17
  - **Original Repository:** [TYPO3/typo3](https://github.com/TYPO3/typo3)
18
18
  - **Source Path:** `Build/Sources/TypeScript/`
19
- - **Current TYPO3 Version:** `v13.4.33`
19
+ - **Current TYPO3 Version:** `v13.4.34`
20
20
 
21
21
  ## 🌿 Branches
22
22
 
@@ -88,7 +88,7 @@ class SlugElement {
88
88
  }
89
89
 
90
90
  private registerEvents(): void {
91
- const fieldsToListenOnList = Object.values(this.getAvailableFieldsForProposalGeneration()).map((field: HTMLElement) => `[id="${field.id}"]`);
91
+ const fieldsToListenOnList = Object.values(this.getAvailableFieldsForProposalGeneration()).map((field: HTMLElement) => field.dataset.slugSelector);
92
92
  const recreateButton: HTMLButtonElement = this.fullElement.querySelector(Selectors.recreateButton);
93
93
 
94
94
  // Listen on 'listenerFieldNames' for new pages. This is typically the 'title' field
@@ -217,12 +217,20 @@ class SlugElement {
217
217
  private getAvailableFieldsForProposalGeneration(): { [key: string]: HTMLElement } {
218
218
  const availableFields: { [key: string]: HTMLElement } = {};
219
219
  for (const [fieldName, selector] of Object.entries(this.fieldsToListenOn)) {
220
- let field = document.querySelector('[data-formengine-input-name="' + selector + '"]') as HTMLElement;
221
- if (field === null) {
220
+ const selectorCandidates = [
221
+ '[data-formengine-input-name="' + selector + '"]',
222
222
  // Also check for fields, which do not point to a hidden input field (e.g. "input type=hidden", readOnly, or select fields)
223
- field = document.querySelector('[name="' + selector + '"]') as HTMLElement;
224
- }
223
+ '[name="' + selector + '"]'
224
+ ];
225
+ let field: HTMLElement;
226
+ let usedSelector = '';
227
+ selectorCandidates.some((testSelector: string) => {
228
+ field = document.querySelector(testSelector) as HTMLElement;
229
+ usedSelector = testSelector;
230
+ return field !== null;
231
+ });
225
232
  if (field !== null) {
233
+ field.dataset.slugSelector = usedSelector;
226
234
  availableFields[fieldName] = field;
227
235
  }
228
236
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "typo3-typescript-sources",
3
- "version": "13.4.33",
3
+ "version": "13.4.34",
4
4
  "description": "TYPO3 Core TypeScript Sources - Extracted from TYPO3/typo3 repository",
5
5
  "main": "index.js",
6
6
  "types": "index.d.ts",
@@ -28,7 +28,7 @@
28
28
  },
29
29
  "typo3": {
30
30
  "sourceRepository": "https://github.com/TYPO3/typo3",
31
- "sourceTag": "v13.4.33",
31
+ "sourceTag": "v13.4.34",
32
32
  "sourcePath": "Build/Sources/TypeScript"
33
33
  }
34
34
  }