typo3-typescript-sources 14.1.0 → 14.2.0

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 (267) hide show
  1. package/.last-synced-tag +1 -1
  2. package/README.md +1 -1
  3. package/backend/Contrib/bootstrap.ts +39 -0
  4. package/backend/action-button/deferred-action.ts +0 -2
  5. package/backend/action-button/immediate-action.ts +0 -2
  6. package/backend/action-dispatcher.ts +0 -2
  7. package/backend/bookmark/bookmark-manager.ts +1234 -0
  8. package/backend/bookmark/bookmark-store.ts +701 -0
  9. package/backend/bookmark/element/bookmark-button-element.ts +144 -0
  10. package/backend/bookmark/toolbar/bookmark-menu-element.ts +139 -0
  11. package/backend/clear-cache.ts +12 -4
  12. package/backend/clipboard-panel.ts +4 -4
  13. package/backend/code-editor/element/code-mirror-element.ts +6 -1
  14. package/backend/color-picker.ts +7 -5
  15. package/backend/color-scheme-switch.ts +1 -1
  16. package/backend/column-selector-button.ts +4 -4
  17. package/backend/context-menu-actions.ts +63 -9
  18. package/backend/context-menu.ts +3 -3
  19. package/backend/contextual-record-edit.ts +212 -0
  20. package/backend/copy-to-clipboard.ts +32 -13
  21. package/backend/date-time-picker.ts +7 -5
  22. package/backend/drag-tooltip.ts +1 -1
  23. package/backend/drag-uploader.ts +58 -43
  24. package/backend/dropdown.ts +317 -0
  25. package/backend/element/alert-element.ts +5 -5
  26. package/backend/element/breadcrumb.ts +162 -38
  27. package/backend/element/combobox-element.ts +3 -2
  28. package/backend/element/contextual-record-edit-trigger.ts +117 -0
  29. package/backend/element/datetime-element.ts +282 -0
  30. package/backend/element/dispatch-modal-button.ts +1 -1
  31. package/backend/element/draggable-resizable-element.ts +1 -1
  32. package/backend/element/editable-page-title.ts +8 -6
  33. package/backend/element/icon-element.ts +2 -2
  34. package/backend/element/link-browser-download-element.ts +86 -0
  35. package/backend/element/pagination.ts +4 -4
  36. package/backend/element/progress-bar-element.ts +6 -2
  37. package/backend/element/progress-tracker-element.ts +4 -4
  38. package/backend/element/pseudo-button.ts +1 -1
  39. package/backend/element/qrcode-element.ts +54 -7
  40. package/{redirects → backend}/element/qrcode-modal-button.ts +20 -14
  41. package/backend/element/sidebar-toggle-element.ts +1 -1
  42. package/backend/element/spinner-element.ts +1 -1
  43. package/backend/element-browser.ts +62 -6
  44. package/backend/event/form-engine-link-browser-set-link-event.ts +34 -0
  45. package/backend/form/submit-interceptor.ts +7 -5
  46. package/backend/form-engine/container/flex-form-container-container.ts +42 -32
  47. package/backend/form-engine/container/flex-form-section-container.ts +8 -28
  48. package/backend/form-engine/container/inline-control-container.ts +304 -293
  49. package/backend/form-engine/element/extra/char-counter.ts +3 -3
  50. package/backend/form-engine/element/online-media-form-element.ts +2 -2
  51. package/backend/form-engine/element/select-tree-toolbar.ts +6 -6
  52. package/backend/form-engine/element/select-tree.ts +1 -1
  53. package/backend/form-engine/element/suggest/result-container.ts +3 -3
  54. package/backend/form-engine/element/suggest/result-item.ts +1 -1
  55. package/backend/form-engine/element/table-wizard-element.ts +23 -22
  56. package/backend/form-engine/field-control/link-popup.ts +22 -3
  57. package/backend/form-engine/field-control/password-generator.ts +9 -3
  58. package/backend/form-engine-link-browser-adapter.ts +15 -86
  59. package/backend/form-engine-review.ts +9 -4
  60. package/backend/form-engine-validation.ts +13 -6
  61. package/backend/form-engine.ts +170 -113
  62. package/backend/grid-editor.ts +32 -29
  63. package/backend/hotkeys/events.ts +47 -0
  64. package/backend/hotkeys/hotkey-storage.ts +3 -18
  65. package/backend/hotkeys/hotkey-struct.ts +58 -0
  66. package/backend/hotkeys/negotiator.ts +53 -0
  67. package/backend/hotkeys.ts +27 -46
  68. package/backend/image-manipulation.ts +82 -2
  69. package/backend/input/clearable.ts +4 -3
  70. package/backend/layout-module/paste.ts +7 -6
  71. package/backend/link-browser.ts +1 -0
  72. package/backend/live-search/element/backend-search.ts +1 -1
  73. package/backend/live-search/element/hint.ts +1 -1
  74. package/backend/live-search/element/provider/default-result-item.ts +3 -3
  75. package/backend/live-search/element/provider/page-provider-result-item.ts +3 -3
  76. package/backend/live-search/element/result/item/action/action-container.ts +1 -1
  77. package/backend/live-search/element/result/item/action/action.ts +2 -2
  78. package/backend/live-search/element/result/item/item-container.ts +3 -3
  79. package/backend/live-search/element/result/item/item.ts +2 -1
  80. package/backend/live-search/element/result/result-container.ts +5 -5
  81. package/backend/live-search/element/result/result-detail-container.ts +1 -1
  82. package/backend/live-search/element/result/result-pagination.ts +2 -2
  83. package/backend/live-search/element/search-option-item.ts +2 -2
  84. package/backend/live-search/live-search-shortcut.ts +1 -14
  85. package/backend/{toolbar → live-search}/live-search.ts +10 -22
  86. package/backend/live-search/result-types/default-result-type.ts +6 -1
  87. package/backend/live-search/result-types/page-result-type.ts +2 -2
  88. package/backend/live-search/toolbar/live-search-toolbar-item.ts +24 -0
  89. package/backend/localization/finisher/localization-submission-service.ts +33 -0
  90. package/backend/localization/label-provider.ts +187 -0
  91. package/backend/localization/localization-button.ts +3 -3
  92. package/backend/localization/localization-wizard.ts +70 -351
  93. package/backend/localization/steps/content-record-selection-step.ts +35 -42
  94. package/backend/localization/steps/handler-selection-step.ts +27 -31
  95. package/backend/localization/steps/mode-step.ts +26 -30
  96. package/backend/localization/steps/source-language-step.ts +28 -30
  97. package/backend/localization/steps/target-language-step.ts +34 -35
  98. package/backend/login-refresh.ts +15 -14
  99. package/backend/modal.ts +81 -18
  100. package/backend/module/iframe.ts +5 -5
  101. package/backend/module/router.ts +1 -1
  102. package/backend/multi-record-selection-delete-action.ts +4 -2
  103. package/backend/multi-step-wizard.ts +7 -6
  104. package/backend/new-content-element-wizard-button.ts +1 -1
  105. package/backend/new-record-wizard.ts +14 -17
  106. package/backend/notification.ts +5 -5
  107. package/backend/online-media.ts +2 -1
  108. package/backend/page-wizard/finisher/page-wizard-submission-service.ts +42 -0
  109. package/backend/page-wizard/helper/wizard-helper.ts +34 -0
  110. package/backend/page-wizard/new-page-wizard-button.ts +32 -0
  111. package/backend/page-wizard/page-wizard-configuration.ts +20 -0
  112. package/backend/page-wizard/page-wizard.ts +114 -0
  113. package/backend/page-wizard/steps/doktype-step.ts +239 -0
  114. package/backend/page-wizard/steps/form-engine-step.ts +165 -0
  115. package/backend/page-wizard/steps/position-step.ts +158 -0
  116. package/backend/pagetsconfig/pagetsconfig-includes.ts +1 -1
  117. package/backend/record-download-button.ts +4 -4
  118. package/backend/security/element/csp-reports.ts +30 -30
  119. package/backend/security/element/sudo-mode.ts +1 -1
  120. package/backend/settings/editor/editable-setting.ts +7 -6
  121. package/backend/settings/editor.ts +9 -8
  122. package/backend/settings/type/base.ts +1 -1
  123. package/backend/settings/type/bool.ts +1 -1
  124. package/backend/settings/type/color.ts +1 -1
  125. package/backend/settings/type/int.ts +2 -2
  126. package/backend/settings/type/number.ts +2 -2
  127. package/backend/settings/type/page.ts +9 -5
  128. package/backend/settings/type/string.ts +2 -2
  129. package/backend/settings/type/stringlist.ts +1 -1
  130. package/backend/settings/type/url.ts +1 -1
  131. package/backend/sortable-table.ts +3 -2
  132. package/backend/switch-user.ts +1 -1
  133. package/backend/tab.ts +424 -0
  134. package/backend/tabs.ts +2 -59
  135. package/backend/tests/localization/label-provider-test.ts +72 -0
  136. package/backend/toolbar/clear-cache-menu.ts +12 -9
  137. package/backend/toolbar/system-information-menu.ts +6 -16
  138. package/backend/tree/file-storage-browser.ts +1 -1
  139. package/backend/tree/file-storage-tree-container.ts +14 -11
  140. package/backend/tree/page-browser.ts +13 -12
  141. package/backend/tree/page-position-select.ts +293 -0
  142. package/backend/tree/page-tree-element.ts +233 -83
  143. package/backend/tree/page-tree.ts +20 -0
  144. package/backend/tree/tree-module-state.ts +1 -1
  145. package/backend/tree/tree-node-toggle.ts +1 -1
  146. package/backend/tree/tree-toolbar.ts +43 -38
  147. package/backend/tree/tree.ts +69 -23
  148. package/backend/type/date-configuration.ts +31 -0
  149. package/backend/user-settings-manager.ts +34 -18
  150. package/backend/utility/collapse-state-search.ts +2 -1
  151. package/backend/viewport/content-container.ts +1 -1
  152. package/backend/viewport/content-navigation-toggle.ts +14 -4
  153. package/backend/viewport/content-navigation.ts +6 -6
  154. package/backend/viewport/loader.ts +6 -4
  155. package/backend/wizard/events/auto-advance-event.ts +21 -0
  156. package/backend/wizard/events/before-next-step-event.ts +24 -0
  157. package/backend/wizard/events/step-summary-event.ts +26 -0
  158. package/backend/wizard/finisher/finisher-config.ts +19 -0
  159. package/backend/{localization/localization-finisher.ts → wizard/finisher/finisher-interface.ts} +2 -11
  160. package/backend/wizard/finisher/finisher-result.ts +26 -0
  161. package/backend/{localization → wizard}/finisher/noop-finisher.ts +3 -2
  162. package/backend/{localization → wizard}/finisher/redirect-finisher.ts +3 -2
  163. package/backend/{localization → wizard}/finisher/reload-finisher.ts +4 -3
  164. package/backend/wizard/finisher/submission-service-interface.ts +17 -0
  165. package/backend/wizard/helper/dynamic-steps-loader.ts +60 -0
  166. package/backend/wizard/move-content-element.ts +14 -8
  167. package/backend/wizard/move-page.ts +7 -5
  168. package/backend/wizard/steps/confirm-step.ts +63 -0
  169. package/backend/{localization → wizard}/steps/finisher-step.ts +37 -61
  170. package/backend/wizard/steps/summary-item-interface.ts +19 -0
  171. package/backend/wizard/steps/wizard-step-after-render-interface.ts +16 -0
  172. package/backend/wizard/steps/wizard-step-interface.ts +26 -0
  173. package/backend/wizard/steps/wizard-step-summary-interface.ts +18 -0
  174. package/backend/wizard/steps/wizard-step-value-interface.ts +20 -0
  175. package/backend/wizard/wizard.ts +399 -0
  176. package/belog/backend-log.ts +8 -2
  177. package/core/authentication/mfa-provider/totp.ts +1 -1
  178. package/core/directive/markdown.ts +2 -2
  179. package/core/lit-helper.ts +2 -2
  180. package/core/utility/debug-exception-handler-service.ts +188 -0
  181. package/dashboard/dashboard.ts +51 -49
  182. package/dashboard/widget/bookmarks-widget-element.ts +140 -0
  183. package/extensionmanager/dependency-check.ts +179 -0
  184. package/extensionmanager/distribution-image.ts +1 -1
  185. package/extensionmanager/extension-toggle-button.ts +201 -0
  186. package/extensionmanager/main.ts +55 -69
  187. package/extensionmanager/repository.ts +22 -16
  188. package/extensionmanager/update.ts +4 -3
  189. package/filelist/context-menu-actions.ts +14 -13
  190. package/filelist/file-delete.ts +3 -2
  191. package/filelist/file-list-rename-handler.ts +6 -5
  192. package/filelist/file-list-replace-handler.ts +17 -14
  193. package/filelist/file-list-transfer-handler.ts +8 -11
  194. package/filelist/file-list.ts +38 -12
  195. package/filelist/rename-file.ts +9 -6
  196. package/form/backend/form-editor/component/date-editor.ts +265 -0
  197. package/form/backend/form-editor/component/form-element-selector.ts +74 -0
  198. package/form/backend/form-editor/component/form-element-stage-item-toolbar.ts +112 -0
  199. package/form/backend/form-editor/component/form-element-stage-item.ts +188 -0
  200. package/form/backend/form-editor/component/page-stage-item.ts +53 -0
  201. package/form/backend/form-editor/component/property-grid-editor.ts +54 -23
  202. package/form/backend/form-editor/core.ts +119 -105
  203. package/form/backend/form-editor/helper.ts +17 -10
  204. package/form/backend/form-editor/inspector-component.ts +689 -703
  205. package/form/backend/form-editor/mediator.ts +54 -43
  206. package/form/backend/form-editor/modals-component.ts +59 -61
  207. package/form/backend/form-editor/stage-component.ts +635 -328
  208. package/form/backend/form-editor/tree-component-adapter.ts +651 -0
  209. package/form/backend/form-editor/utility/string-utility.ts +33 -0
  210. package/form/backend/form-editor/view-model.ts +240 -229
  211. package/form/backend/form-editor-tree-container.ts +105 -0
  212. package/form/backend/form-editor-tree-events.ts +138 -0
  213. package/form/backend/form-editor-tree.ts +784 -0
  214. package/form/backend/form-editor.ts +26 -42
  215. package/form/backend/form-manager/view-model.ts +155 -674
  216. package/form/backend/form-manager.ts +26 -9
  217. package/form/backend/form-wizard/finisher/create-form-submission-service.ts +59 -0
  218. package/form/backend/form-wizard/finisher/duplicate-form-submission-service.ts +58 -0
  219. package/form/backend/form-wizard/form-wizard.ts +135 -0
  220. package/form/backend/form-wizard/steps/mode-step.ts +140 -0
  221. package/form/backend/form-wizard/steps/settings-step.ts +248 -0
  222. package/form/backend/form-wizard/steps/storage-step.ts +128 -0
  223. package/form/frontend/date-picker.ts +2 -0
  224. package/install/module/settings/extension-configuration.ts +0 -8
  225. package/install/module/settings/local-configuration.ts +0 -8
  226. package/install/renderable/flash-message.ts +1 -1
  227. package/install/renderable/info-box.ts +1 -1
  228. package/install/renderable/language-packs.ts +3 -3
  229. package/install/renderable/offset-group.ts +1 -1
  230. package/install/renderable/wrap-group.ts +1 -1
  231. package/install/router.ts +1 -1
  232. package/lowlevel/query-generator.ts +1 -1
  233. package/opendocs/open-document-store.ts +195 -0
  234. package/opendocs/toolbar/open-document-menu-element.ts +127 -0
  235. package/opendocs/widget/recent-documents-widget-element.ts +130 -0
  236. package/package.json +2 -2
  237. package/recycler/recycler.ts +55 -56
  238. package/redirects/event-handler.ts +15 -7
  239. package/redirects/short-url-generator.ts +145 -0
  240. package/rte-ckeditor/ckeditor5.ts +3 -3
  241. package/rte-ckeditor/plugin/typo3-link.ts +24 -4
  242. package/scheduler/new-scheduler-task-wizard-button.ts +1 -1
  243. package/scheduler/scheduler-add-group.ts +6 -6
  244. package/scheduler/setup-check-button.ts +1 -1
  245. package/styleguide/element/theme-switcher-element.ts +10 -9
  246. package/sys-note/element/delete-button.ts +1 -1
  247. package/tstemplate/template-analyzer.ts +1 -1
  248. package/workspaces/backend.ts +27 -25
  249. package/workspaces/element/workspace-selector-element.ts +186 -0
  250. package/workspaces/element/workspace-top-indicator-element.ts +159 -0
  251. package/workspaces/preview.ts +5 -4
  252. package/workspaces/renderable/comment-view.ts +3 -3
  253. package/workspaces/renderable/diff-view.ts +3 -3
  254. package/workspaces/renderable/history-view.ts +3 -3
  255. package/workspaces/renderable/record-information.ts +8 -12
  256. package/workspaces/renderable/record-table.ts +56 -32
  257. package/workspaces/renderable/send-to-stage-form.ts +14 -8
  258. package/workspaces/workspace-state.ts +251 -0
  259. package/workspaces/workspaces.ts +4 -5
  260. package/backend/form-engine/container/files-control-container.ts +0 -716
  261. package/backend/form-engine/container/site-language-container.ts +0 -616
  262. package/backend/key-bindings.ts +0 -42
  263. package/backend/localization/steps/confirm-step.ts +0 -61
  264. package/backend/toolbar/shortcut-menu.ts +0 -254
  265. package/form/backend/form-editor/tree-component.ts +0 -550
  266. package/opendocs/toolbar/opendocs-menu.ts +0 -117
  267. package/workspaces/toolbar/workspaces-menu.ts +0 -192
@@ -0,0 +1,144 @@
1
+ /*
2
+ * This file is part of the TYPO3 CMS project.
3
+ *
4
+ * It is free software; you can redistribute it and/or modify it under
5
+ * the terms of the GNU General Public License, either version 2
6
+ * of the License, or any later version.
7
+ *
8
+ * For the full copyright and license information, please read the
9
+ * LICENSE.txt file that was distributed with this source code.
10
+ *
11
+ * The TYPO3 project - inspiring people to share!
12
+ */
13
+
14
+ import { html, type TemplateResult } from 'lit';
15
+ import { customElement, property, state } from 'lit/decorators.js';
16
+ import labels from '~labels/core.bookmarks';
17
+ import { PseudoButtonLitElement } from '@typo3/backend/element/pseudo-button';
18
+ import BookmarkStore, { BookmarkStoreChangedEvent } from '../bookmark-store';
19
+ import Notification from '../../notification';
20
+ import '@typo3/backend/element/icon-element';
21
+ import '@typo3/backend/element/spinner-element';
22
+
23
+ /**
24
+ * Toggle button that creates or removes a bookmark. Syncs state with BookmarkStore.
25
+ */
26
+ @customElement('typo3-backend-bookmark-button')
27
+ export class BookmarkButtonElement extends PseudoButtonLitElement {
28
+ @property({ type: String }) route: string = '';
29
+ @property({ type: String }) arguments: string = '';
30
+ @property({ type: String, attribute: 'display-name' }) displayName: string = '';
31
+ @property({ type: Boolean, attribute: 'hide-label-text' }) hideLabelText: boolean = false;
32
+
33
+ @state() private isBookmarked: boolean = false;
34
+ @state() private isProcessing: boolean = false;
35
+
36
+ private get bookmarkKey(): string {
37
+ return BookmarkStore.getBookmarkKey(this.route, this.arguments);
38
+ }
39
+
40
+ public override connectedCallback(): void {
41
+ super.connectedCallback();
42
+ document.addEventListener(BookmarkStoreChangedEvent, this.handleStoreUpdate);
43
+ this.setup();
44
+ }
45
+
46
+ public override disconnectedCallback(): void {
47
+ super.disconnectedCallback();
48
+ document.removeEventListener(BookmarkStoreChangedEvent, this.handleStoreUpdate);
49
+ }
50
+
51
+ protected override createRenderRoot(): HTMLElement | ShadowRoot {
52
+ return this;
53
+ }
54
+
55
+ protected override render(): TemplateResult {
56
+ const label = this.isBookmarked
57
+ ? labels.get('action.remove')
58
+ : labels.get('action.create');
59
+
60
+ const labelHtml = this.hideLabelText
61
+ ? html`<span class="visually-hidden">${label}</span>`
62
+ : html` ${label}`;
63
+
64
+ if (this.isProcessing) {
65
+ return html`<typo3-backend-spinner size="small"></typo3-backend-spinner>${labelHtml}`;
66
+ }
67
+
68
+ const iconIdentifier = this.isBookmarked ? 'actions-bookmark-remove' : 'actions-bookmark-add';
69
+ return html`<typo3-backend-icon identifier="${iconIdentifier}" size="small"></typo3-backend-icon>${labelHtml}`;
70
+ }
71
+
72
+ protected override async buttonActivated(): Promise<void> {
73
+ if (this.isProcessing) {
74
+ return;
75
+ }
76
+
77
+ this.isProcessing = true;
78
+ this.updateState();
79
+
80
+ try {
81
+ if (this.isBookmarked) {
82
+ const bookmark = await BookmarkStore.getBookmark(this.bookmarkKey);
83
+ if (bookmark) {
84
+ BookmarkStore.requestDelete(bookmark.id);
85
+ }
86
+ } else {
87
+ const result = await BookmarkStore.create(this.route, this.arguments, this.displayName);
88
+ if (result.success) {
89
+ Notification.success(
90
+ labels.get('success.created.title'),
91
+ labels.get('success.created.message')
92
+ );
93
+ } else {
94
+ Notification.error(
95
+ labels.get('error.createFailed.title'),
96
+ result.error || labels.get('error.createFailed.message')
97
+ );
98
+ }
99
+ }
100
+ } finally {
101
+ this.isProcessing = false;
102
+ await this.checkIfBookmarked();
103
+ this.updateState();
104
+ }
105
+ }
106
+
107
+ private async setup(): Promise<void> {
108
+ await this.checkIfBookmarked();
109
+ this.updateState();
110
+ }
111
+
112
+ private readonly handleStoreUpdate = async (): Promise<void> => {
113
+ await this.checkIfBookmarked();
114
+ this.updateState();
115
+ };
116
+
117
+ private async checkIfBookmarked(): Promise<void> {
118
+ this.isBookmarked = await BookmarkStore.isBookmarked(this.bookmarkKey);
119
+ }
120
+
121
+ /**
122
+ * Synchronizes aria attributes and title with current bookmark/processing state.
123
+ */
124
+ private updateState(): void {
125
+ if (this.isProcessing) {
126
+ this.setAttribute('aria-disabled', 'true');
127
+ this.tabIndex = -1;
128
+ } else {
129
+ this.removeAttribute('aria-disabled');
130
+ this.tabIndex = 0;
131
+ }
132
+
133
+ this.setAttribute('aria-pressed', this.isBookmarked ? 'true' : 'false');
134
+ this.title = this.isBookmarked
135
+ ? labels.get('action.remove')
136
+ : labels.get('action.create');
137
+ }
138
+ }
139
+
140
+ declare global {
141
+ interface HTMLElementTagNameMap {
142
+ 'typo3-backend-bookmark-button': BookmarkButtonElement;
143
+ }
144
+ }
@@ -0,0 +1,139 @@
1
+ /*
2
+ * This file is part of the TYPO3 CMS project.
3
+ *
4
+ * It is free software; you can redistribute it and/or modify it under
5
+ * the terms of the GNU General Public License, either version 2
6
+ * of the License, or any later version.
7
+ *
8
+ * For the full copyright and license information, please read the
9
+ * LICENSE.txt file that was distributed with this source code.
10
+ *
11
+ * The TYPO3 project - inspiring people to share!
12
+ */
13
+
14
+ import { html, LitElement, type TemplateResult, nothing } from 'lit';
15
+ import { customElement, state } from 'lit/decorators.js';
16
+ import { repeat } from 'lit/directives/repeat.js';
17
+ import BookmarkStore, { BookmarkStoreChangedEvent } from '../bookmark-store';
18
+ import type { Bookmark, BookmarkGroup, BookmarkGroupId } from '../bookmark-store';
19
+ import '@typo3/backend/element/icon-element';
20
+ import '@typo3/backend/bookmark/bookmark-manager';
21
+ import labels from '~labels/core.bookmarks';
22
+
23
+ /**
24
+ * Toolbar dropdown menu listing bookmarks grouped by category.
25
+ */
26
+ @customElement('typo3-backend-bookmark-menu')
27
+ export class BookmarkMenuElement extends LitElement {
28
+ @state() private groupedBookmarks: Map<BookmarkGroupId, Bookmark[]> = new Map();
29
+ @state() private groups: BookmarkGroup[] = [];
30
+
31
+ public override connectedCallback(): void {
32
+ super.connectedCallback();
33
+ document.addEventListener(BookmarkStoreChangedEvent, this.handleStoreUpdate);
34
+ this.syncFromStore();
35
+ }
36
+
37
+ public override disconnectedCallback(): void {
38
+ super.disconnectedCallback();
39
+ document.removeEventListener(BookmarkStoreChangedEvent, this.handleStoreUpdate);
40
+ }
41
+
42
+ protected override createRenderRoot(): HTMLElement | ShadowRoot {
43
+ return this;
44
+ }
45
+
46
+ protected override render(): TemplateResult {
47
+ return html`
48
+ <p class="dropdown-headline">${labels.get('title')}</p>
49
+ ${this.renderContent()}
50
+ <hr class="dropdown-divider" aria-hidden="true">
51
+ <typo3-backend-bookmark-manager-button class="dropdown-item">
52
+ <span class="dropdown-item-columns">
53
+ <span class="dropdown-item-column dropdown-item-column-icon" aria-hidden="true">
54
+ <typo3-backend-icon identifier="actions-cog" size="small"></typo3-backend-icon>
55
+ </span>
56
+ <span class="dropdown-item-column dropdown-item-column-title">
57
+ ${labels.get('manage')}
58
+ </span>
59
+ </span>
60
+ </typo3-backend-bookmark-manager-button>
61
+ `;
62
+ }
63
+
64
+ private readonly handleStoreUpdate = (): void => {
65
+ this.syncFromStore();
66
+ };
67
+
68
+ private async syncFromStore(): Promise<void> {
69
+ this.groupedBookmarks = await BookmarkStore.getGroupedBookmarks({ accessibleOnly: true });
70
+ this.groups = await BookmarkStore.getGroups();
71
+ }
72
+
73
+ private renderContent(): TemplateResult | typeof nothing {
74
+ if (this.groupedBookmarks.size === 0) {
75
+ return html`
76
+ <p class="dropdown-item-text">
77
+ ${labels.get('description')}
78
+ </p>
79
+ `;
80
+ }
81
+
82
+ let isFirst = true;
83
+
84
+ /* eslint-disable @stylistic/indent */
85
+ return html`
86
+ ${repeat(Array.from(this.groupedBookmarks.entries()), ([groupId]) => groupId, ([groupId, bookmarks]) => {
87
+ const result = this.renderGroup(groupId, bookmarks, isFirst);
88
+ isFirst = false;
89
+ return result;
90
+ })}
91
+ `;
92
+ }
93
+
94
+ private renderGroup(groupId: BookmarkGroupId, bookmarks: Bookmark[], isFirst: boolean): TemplateResult {
95
+ const group = this.groups.find(g => g.id === groupId);
96
+ const groupLabel = group?.label;
97
+ const showHeader = groupLabel || this.groups.length > 1;
98
+
99
+ return html`
100
+ ${!isFirst ? html`<hr class="dropdown-divider" aria-hidden="true">` : nothing}
101
+ ${showHeader ? html`<p class="dropdown-header" id="bookmark-group-${groupId}">${groupLabel || labels.get('notGrouped')}</p>` : nothing}
102
+ <ul class="dropdown-list" data-bookmarkgroup="${groupId}">
103
+ ${repeat(bookmarks, (bookmark) => bookmark.id, (bookmark) => this.renderBookmarkItem(bookmark, groupId))}
104
+ </ul>
105
+ `;
106
+ }
107
+
108
+ private renderBookmarkItem(bookmark: Bookmark, groupId: BookmarkGroupId): TemplateResult {
109
+ return html`
110
+ <li class="t3js-topbar-bookmark" data-bookmarkid="${bookmark.id}" data-bookmarkgroup="${groupId}">
111
+ <button
112
+ type="button"
113
+ class="dropdown-item"
114
+ title="${bookmark.title}"
115
+ @click=${() => this.handleNavigate(bookmark)}
116
+ >
117
+ <span class="dropdown-item-columns">
118
+ <span class="dropdown-item-column dropdown-item-column-icon" aria-hidden="true">
119
+ <typo3-backend-icon identifier=${bookmark.iconIdentifier} overlay=${bookmark.iconOverlayIdentifier} size="small"></typo3-backend-icon>
120
+ </span>
121
+ <span class="dropdown-item-column dropdown-item-column-title">
122
+ ${bookmark.title}
123
+ </span>
124
+ </span>
125
+ </button>
126
+ </li>
127
+ `;
128
+ }
129
+
130
+ private handleNavigate(bookmark: Bookmark): void {
131
+ BookmarkStore.navigate(bookmark);
132
+ }
133
+ }
134
+
135
+ declare global {
136
+ interface HTMLElementTagNameMap {
137
+ 'typo3-backend-bookmark-menu': BookmarkMenuElement;
138
+ }
139
+ }
@@ -16,6 +16,7 @@ import Notification from '@typo3/backend/notification';
16
16
  import Icons from '@typo3/backend/icons';
17
17
  import RegularEvent from '@typo3/core/event/regular-event';
18
18
  import AjaxRequest from '@typo3/core/ajax/ajax-request';
19
+ import cacheLabels from '~labels/core.cache';
19
20
 
20
21
  enum Identifiers {
21
22
  clearCache = '.t3js-clear-page-cache',
@@ -42,17 +43,24 @@ class ClearCache {
42
43
  * @return Promise<AjaxResponse>
43
44
  */
44
45
  private static sendClearCacheRequest(pageId: number): Promise<AjaxResponse> {
45
- const request = new AjaxRequest(TYPO3.settings.ajaxUrls.records_clearpagecache).withQueryArguments({ id: pageId }).get({ cache: 'no-cache' });
46
+ const request = new AjaxRequest(TYPO3.settings.ajaxUrls.clearcache_page).post({ id: pageId });
46
47
  request.then(async (response: AjaxResponse): Promise<void> => {
47
48
  const data = await response.resolve();
48
49
  if (data.success === true) {
49
- Notification.success(data.title, data.message, 1);
50
+ Notification.success(
51
+ data.title,
52
+ data.message
53
+ );
50
54
  } else {
51
- Notification.error(data.title, data.message, 1);
55
+ Notification.error(
56
+ data.title,
57
+ data.message
58
+ );
52
59
  }
53
60
  }, (): void => {
54
61
  Notification.error(
55
- 'Clearing page caches went wrong on the server side.',
62
+ cacheLabels.get('notification.error.title'),
63
+ cacheLabels.get('notification.error.message'),
56
64
  );
57
65
  });
58
66
 
@@ -12,10 +12,10 @@
12
12
  */
13
13
 
14
14
  import { html, LitElement, nothing, type TemplateResult } from 'lit';
15
- import { customElement, property } from 'lit/decorators';
16
- import { until } from 'lit/directives/until';
17
- import { unsafeHTML } from 'lit/directives/unsafe-html';
18
- import { classMap } from 'lit/directives/class-map';
15
+ import { customElement, property } from 'lit/decorators.js';
16
+ import { until } from 'lit/directives/until.js';
17
+ import { unsafeHTML } from 'lit/directives/unsafe-html.js';
18
+ import { classMap } from 'lit/directives/class-map.js';
19
19
  import AjaxRequest from '@typo3/core/ajax/ajax-request';
20
20
  import type { AjaxResponse } from '@typo3/core/ajax/ajax-response';
21
21
  import Notification from '@typo3/backend/notification';
@@ -12,7 +12,7 @@
12
12
  */
13
13
 
14
14
  import { LitElement, html, css, type TemplateResult } from 'lit';
15
- import { customElement, property, state } from 'lit/decorators';
15
+ import { customElement, property, state } from 'lit/decorators.js';
16
16
  import {
17
17
  EditorView,
18
18
  lineNumbers,
@@ -113,6 +113,7 @@ export class CodeMirrorElement extends LitElement {
113
113
  @property({ type: Boolean, reflect: true }) autoheight: boolean = false;
114
114
  @property({ type: Boolean }) nolazyload: boolean = false;
115
115
  @property({ type: Boolean }) readonly: boolean = false;
116
+ @property({ type: Boolean, attribute: 'linewrapping' }) lineWrapping: boolean = false;
116
117
  @property({ type: Boolean, reflect: true }) fullscreen: boolean = false;
117
118
 
118
119
  @property({ type: String }) label: string;
@@ -211,6 +212,10 @@ export class CodeMirrorElement extends LitElement {
211
212
  syntaxHighlighting(defaultHighlightStyle, { fallback: true }),
212
213
  ];
213
214
 
215
+ if (this.lineWrapping) {
216
+ extensions.push(EditorView.lineWrapping);
217
+ }
218
+
214
219
  if (this.readonly) {
215
220
  extensions.push(EditorState.readOnly.of(true));
216
221
  }
@@ -11,7 +11,7 @@
11
11
  * The TYPO3 project - inspiring people to share!
12
12
  */
13
13
 
14
- import { customElement, property, query } from 'lit/decorators';
14
+ import { customElement, property, query } from 'lit/decorators.js';
15
15
  import { css, html, LitElement, type TemplateResult } from 'lit';
16
16
  import Alwan from 'alwan';
17
17
  import RegularEvent from '@typo3/core/event/regular-event';
@@ -38,7 +38,6 @@ export class Typo3BackendColorPicker extends LitElement {
38
38
  height: var(--typo3-colorpicker-preview-height);
39
39
  top: 50%;
40
40
  inset-inline-start: var(--typo3-input-sm-padding-x);
41
- z-index: 1;
42
41
  transform: translate(0, -50%);
43
42
  background: var(--typo3-bg-checkerboard-background-color);
44
43
  background-image: linear-gradient(45deg, var(--typo3-bg-checkerboard-background-image-color) 25%, transparent 25%), linear-gradient(135deg, var(--typo3-bg-checkerboard-background-image-color) 25%, transparent 25%), linear-gradient(45deg, transparent 75%, var(--typo3-bg-checkerboard-background-image-color) 75%), linear-gradient(135deg, transparent 75%, var(--typo3-bg-checkerboard-background-image-color) 75%);
@@ -59,7 +58,7 @@ export class Typo3BackendColorPicker extends LitElement {
59
58
 
60
59
  @property({ type: String }) color: string = '';
61
60
  @property({ type: Boolean }) opacity: boolean = false;
62
- @property({ type: String }) swatches: string = '';
61
+ @property({ type: Array }) swatches: {label: string, color: string}[] = [];
63
62
 
64
63
  // Use a reference to the input slot element
65
64
  @query('slot') slotEl!: HTMLSlotElement;
@@ -83,9 +82,12 @@ export class Typo3BackendColorPicker extends LitElement {
83
82
  position: 'bottom-start',
84
83
  format: 'hex',
85
84
  opacity: this.opacity,
86
- swatches: this.swatches ? this.swatches.split(';') : [],
85
+ swatches: this.swatches,
87
86
  preset: false,
88
87
  color: this.color,
88
+ // Casting to `unknown` to prevent TypeScript Error
89
+ // > TS2589: Type instantiation is excessively deep and possibly infinite.
90
+ parent: (this.closest('dialog') ?? '') as unknown,
89
91
  });
90
92
 
91
93
  alwan.on('color', (e): void => {
@@ -141,7 +143,7 @@ class LegacyColorPicker {
141
143
  }
142
144
 
143
145
  const colorPicker = document.createElement('typo3-backend-color-picker');
144
- colorPicker.swatches = options.swatches?.join(';') ?? '';
146
+ colorPicker.swatches = options.swatches.map((swatch: string) => ({ color: swatch, label: swatch }));
145
147
  colorPicker.opacity = options.opacity ?? false;
146
148
  element.parentNode.insertBefore(colorPicker, element);
147
149
  colorPicker.appendChild(element);
@@ -12,7 +12,7 @@
12
12
  */
13
13
 
14
14
  import { html, LitElement, nothing, type TemplateResult } from 'lit';
15
- import { customElement, property, state } from 'lit/decorators';
15
+ import { customElement, property, state } from 'lit/decorators.js';
16
16
  import AjaxRequest from '@typo3/core/ajax/ajax-request';
17
17
  import '@typo3/backend/element/icon-element';
18
18
  import type { ColorSchemeUpdateEventData, ColorScheme } from '@typo3/backend/user-settings-manager';
@@ -11,14 +11,14 @@
11
11
  * The TYPO3 project - inspiring people to share!
12
12
  */
13
13
 
14
- import { customElement, property } from 'lit/decorators';
14
+ import { customElement, property } from 'lit/decorators.js';
15
15
  import { PseudoButtonLitElement } from '@typo3/backend/element/pseudo-button';
16
16
  import { SeverityEnum } from '@typo3/backend/enum/severity';
17
17
  import { default as Modal, type ModalElement } from '@typo3/backend/modal';
18
- import { lll } from '@typo3/core/lit-helper';
19
18
  import AjaxRequest from '@typo3/core/ajax/ajax-request';
20
19
  import type { AjaxResponse } from '@typo3/core/ajax/ajax-response';
21
20
  import Notification from '@typo3/backend/notification';
21
+ import listLabels from '~labels/core.mod_web_list';
22
22
 
23
23
  enum Selectors {
24
24
  columnsSelector = '.t3js-column-selector',
@@ -54,8 +54,8 @@ export class ColumnSelectorButton extends PseudoButtonLitElement {
54
54
  @property({ type: String, attribute: 'data-url' }) modalUrl: string;
55
55
  @property({ type: String, attribute: 'data-target' }) modalTarget: string;
56
56
  @property({ type: String, attribute: 'data-title' }) modalTitle: string = 'Show columns';
57
- @property({ type: String, attribute: 'data-button-ok' }) buttonOk: string = lll('button.ok') || 'Update';
58
- @property({ type: String, attribute: 'data-button-close' }) buttonClose: string = lll('button.close') || 'Close';
57
+ @property({ type: String, attribute: 'data-button-ok' }) buttonOk: string = listLabels.get('button.ok');
58
+ @property({ type: String, attribute: 'data-button-close' }) buttonClose: string = listLabels.get('button.close');
59
59
  @property({ type: String, attribute: 'data-error-message' }) errorMessage: string = 'Could not update columns';
60
60
 
61
61
  /**
@@ -16,12 +16,19 @@ import { SeverityEnum } from './enum/severity';
16
16
  import AjaxDataHandler from './ajax-data-handler';
17
17
  import AjaxRequest from '@typo3/core/ajax/ajax-request';
18
18
  import InfoWindow from './info-window';
19
- import Modal from './modal';
19
+ import Modal, { type ModalElement } from './modal';
20
20
  import ModuleMenu from './module-menu';
21
21
  import Notification from '@typo3/backend/notification';
22
22
  import Viewport from './viewport';
23
23
  import '@typo3/backend/new-record-wizard';
24
24
  import Utility from '@typo3/backend/utility';
25
+ import { topLevelModuleImport } from '@typo3/backend/utility/top-level-module-import';
26
+ import { html } from 'lit';
27
+ import coreCommonLabels from '~labels/core.common';
28
+ import cacheLabels from '~labels/core.cache';
29
+ import listLabels from '~labels/core.mod_web_list';
30
+ import layoutLabels from '~labels/backend.layout';
31
+ import { openPageWizardModal } from '@typo3/backend/page-wizard/helper/wizard-helper';
25
32
 
26
33
  /**
27
34
  * @exports @typo3/backend/context-menu-actions
@@ -64,6 +71,36 @@ class ContextMenuActions {
64
71
  }
65
72
  }
66
73
 
74
+ public static async showQrCode(table: string, uid: number, dataset: DOMStringMap): Promise<void> {
75
+ const previewUrl = dataset.previewUrl;
76
+ if (!previewUrl) {
77
+ return;
78
+ }
79
+ await topLevelModuleImport('@typo3/backend/element/qrcode-element.js');
80
+ Modal.advanced({
81
+ title: layoutLabels.get('showPageQrCode.modalTitle'),
82
+ size: Modal.sizes.small,
83
+ content: html`
84
+ <div class="text-center">
85
+ <typo3-qrcode
86
+ class="text-start"
87
+ content="${previewUrl}"
88
+ size="large"
89
+ show-url
90
+ ></typo3-qrcode>
91
+ </div>
92
+ `,
93
+ buttons: [
94
+ {
95
+ text: listLabels.get('button.close'),
96
+ btnClass: 'btn-default',
97
+ name: 'close',
98
+ trigger: (event: Event, modal: ModalElement) => modal.hideModal(),
99
+ },
100
+ ],
101
+ });
102
+ }
103
+
67
104
  public static openInfoPopUp(table: string, uid: number): void {
68
105
  InfoWindow.showItem(table, uid);
69
106
  }
@@ -104,6 +141,16 @@ class ContextMenuActions {
104
141
  * Create new records on the same level. Pages are being inserted "inside".
105
142
  */
106
143
  public static newRecord(table: string, uid: number): void {
144
+ if (table === 'pages') {
145
+ openPageWizardModal({
146
+ positionData: {
147
+ pageUid: parseInt(String(uid), 10),
148
+ insertPosition: 'inside'
149
+ }
150
+ });
151
+ return;
152
+ }
153
+
107
154
  Viewport.ContentContainer.setUrl(
108
155
  top.TYPO3.settings.FormEngine.moduleUrl + '&edit[' + table + '][' + (table !== 'pages' ? '-' : '') + uid + ']=new&returnUrl=' + ContextMenuActions.getReturnUrl(),
109
156
  );
@@ -188,13 +235,13 @@ class ContextMenuActions {
188
235
  dataset.message,
189
236
  SeverityEnum.warning, [
190
237
  {
191
- text: dataset.buttonCloseText || TYPO3.lang['button.cancel'] || 'Cancel',
238
+ text: dataset.buttonCloseText || coreCommonLabels.get('cancel'),
192
239
  active: true,
193
240
  btnClass: 'btn-default',
194
241
  name: 'cancel',
195
242
  },
196
243
  {
197
- text: dataset.buttonOkText || TYPO3.lang['button.delete'] || 'Delete',
244
+ text: dataset.buttonOkText || listLabels.get('button.delete'),
198
245
  btnClass: 'btn-warning',
199
246
  name: 'delete',
200
247
  },
@@ -254,18 +301,25 @@ class ContextMenuActions {
254
301
  * Clear cache for given page uid
255
302
  */
256
303
  public static clearCache(table: string, uid: number): void {
257
- (new AjaxRequest(TYPO3.settings.ajaxUrls.records_clearpagecache)).withQueryArguments({ id: uid }).get({ cache: 'no-cache' }).then(
304
+ (new AjaxRequest(TYPO3.settings.ajaxUrls.clearcache_page)).post({ id: uid }).then(
258
305
  async (response: AjaxResponse): Promise<void> => {
259
306
  const data = await response.resolve();
260
307
  if (data.success === true) {
261
- Notification.success(data.title, data.message, 1);
308
+ Notification.success(
309
+ data.title,
310
+ data.message
311
+ );
262
312
  } else {
263
- Notification.error(data.title, data.message, 1);
313
+ Notification.error(
314
+ data.title,
315
+ data.message
316
+ );
264
317
  }
265
318
  },
266
319
  (): void => {
267
320
  Notification.error(
268
- 'Clearing page caches went wrong on the server side.',
321
+ cacheLabels.get('notification.error.title'),
322
+ cacheLabels.get('notification.error.message')
269
323
  );
270
324
  }
271
325
  );
@@ -308,13 +362,13 @@ class ContextMenuActions {
308
362
  dataset.message,
309
363
  SeverityEnum.warning, [
310
364
  {
311
- text: dataset.buttonCloseText || TYPO3.lang['button.cancel'] || 'Cancel',
365
+ text: dataset.buttonCloseText || coreCommonLabels.get('cancel'),
312
366
  active: true,
313
367
  btnClass: 'btn-default',
314
368
  name: 'cancel',
315
369
  },
316
370
  {
317
- text: dataset.buttonOkText || TYPO3.lang['button.ok'] || 'OK',
371
+ text: dataset.buttonOkText || coreCommonLabels.get('ok'),
318
372
  btnClass: 'btn-warning',
319
373
  name: 'ok',
320
374
  },
@@ -15,11 +15,11 @@ import { AjaxResponse } from '@typo3/core/ajax/ajax-response';
15
15
  import AjaxRequest from '@typo3/core/ajax/ajax-request';
16
16
  import ContextMenuActions from './context-menu-actions';
17
17
  import '@typo3/backend/element/spinner-element';
18
- import { customElement, queryAll, state } from 'lit/decorators';
18
+ import { customElement, queryAll, state } from 'lit/decorators.js';
19
19
  import { html, LitElement, nothing, type TemplateResult } from 'lit';
20
20
  import { delay } from '@typo3/core/lit-helper';
21
- import { styleMap } from 'lit/directives/style-map';
22
- import { unsafeHTML } from 'lit/directives/unsafe-html';
21
+ import { styleMap } from 'lit/directives/style-map.js';
22
+ import { unsafeHTML } from 'lit/directives/unsafe-html.js';
23
23
  import { Task, initialState } from '@lit/task';
24
24
  import Notification from '@typo3/backend/notification';
25
25