@theia/core 1.77.0-next.88 → 1.77.0-next.94

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 (147) hide show
  1. package/lib/browser/catalog.json +12 -0
  2. package/lib/browser/color-application-contribution.d.ts +2 -2
  3. package/lib/browser/color-application-contribution.d.ts.map +1 -1
  4. package/lib/browser/color-application-contribution.js +7 -8
  5. package/lib/browser/color-application-contribution.js.map +1 -1
  6. package/lib/browser/common-frontend-contribution.d.ts.map +1 -1
  7. package/lib/browser/common-frontend-contribution.js +7 -0
  8. package/lib/browser/common-frontend-contribution.js.map +1 -1
  9. package/lib/browser/encoding-registry.js +1 -1
  10. package/lib/browser/encoding-registry.js.map +1 -1
  11. package/lib/browser/frontend-application-module.d.ts.map +1 -1
  12. package/lib/browser/frontend-application-module.js +6 -0
  13. package/lib/browser/frontend-application-module.js.map +1 -1
  14. package/lib/browser/quick-input/quick-command-service.d.ts +2 -0
  15. package/lib/browser/quick-input/quick-command-service.d.ts.map +1 -1
  16. package/lib/browser/quick-input/quick-command-service.js +10 -2
  17. package/lib/browser/quick-input/quick-command-service.js.map +1 -1
  18. package/lib/browser/saveable-service.d.ts +4 -0
  19. package/lib/browser/saveable-service.d.ts.map +1 -1
  20. package/lib/browser/saveable-service.js +7 -0
  21. package/lib/browser/saveable-service.js.map +1 -1
  22. package/lib/browser/secondary-window-handler.d.ts +126 -3
  23. package/lib/browser/secondary-window-handler.d.ts.map +1 -1
  24. package/lib/browser/secondary-window-handler.js +354 -30
  25. package/lib/browser/secondary-window-handler.js.map +1 -1
  26. package/lib/browser/shell/application-shell-mouse-tracker.d.ts +2 -0
  27. package/lib/browser/shell/application-shell-mouse-tracker.d.ts.map +1 -1
  28. package/lib/browser/shell/application-shell-mouse-tracker.js +10 -0
  29. package/lib/browser/shell/application-shell-mouse-tracker.js.map +1 -1
  30. package/lib/browser/shell/application-shell.d.ts +11 -0
  31. package/lib/browser/shell/application-shell.d.ts.map +1 -1
  32. package/lib/browser/shell/application-shell.js +33 -4
  33. package/lib/browser/shell/application-shell.js.map +1 -1
  34. package/lib/browser/shell/index.d.ts +1 -0
  35. package/lib/browser/shell/index.d.ts.map +1 -1
  36. package/lib/browser/shell/index.js +1 -0
  37. package/lib/browser/shell/index.js.map +1 -1
  38. package/lib/browser/shell/native-tab-drag-service.d.ts +141 -0
  39. package/lib/browser/shell/native-tab-drag-service.d.ts.map +1 -0
  40. package/lib/browser/shell/native-tab-drag-service.js +349 -0
  41. package/lib/browser/shell/native-tab-drag-service.js.map +1 -0
  42. package/lib/browser/shell/native-tab-drag-service.spec.d.ts +2 -0
  43. package/lib/browser/shell/native-tab-drag-service.spec.d.ts.map +1 -0
  44. package/lib/browser/shell/native-tab-drag-service.spec.js +71 -0
  45. package/lib/browser/shell/native-tab-drag-service.spec.js.map +1 -0
  46. package/lib/browser/shell/shell-layout-restorer.d.ts +3 -0
  47. package/lib/browser/shell/shell-layout-restorer.d.ts.map +1 -1
  48. package/lib/browser/shell/shell-layout-restorer.js +20 -0
  49. package/lib/browser/shell/shell-layout-restorer.js.map +1 -1
  50. package/lib/browser/shell/shell-layout-restorer.spec.js +31 -0
  51. package/lib/browser/shell/shell-layout-restorer.spec.js.map +1 -1
  52. package/lib/browser/shell/side-panel-handler.d.ts +8 -0
  53. package/lib/browser/shell/side-panel-handler.d.ts.map +1 -1
  54. package/lib/browser/shell/side-panel-handler.js +14 -0
  55. package/lib/browser/shell/side-panel-handler.js.map +1 -1
  56. package/lib/browser/shell/tab-bars.d.ts +39 -0
  57. package/lib/browser/shell/tab-bars.d.ts.map +1 -1
  58. package/lib/browser/shell/tab-bars.js +127 -2
  59. package/lib/browser/shell/tab-bars.js.map +1 -1
  60. package/lib/browser/shell/tab-bars.spec.js +48 -0
  61. package/lib/browser/shell/tab-bars.spec.js.map +1 -1
  62. package/lib/browser/shell/tab-drop-helper.d.ts +32 -0
  63. package/lib/browser/shell/tab-drop-helper.d.ts.map +1 -0
  64. package/lib/browser/shell/tab-drop-helper.js +75 -0
  65. package/lib/browser/shell/tab-drop-helper.js.map +1 -0
  66. package/lib/browser/shell/theia-dock-panel.d.ts +25 -0
  67. package/lib/browser/shell/theia-dock-panel.d.ts.map +1 -1
  68. package/lib/browser/shell/theia-dock-panel.js +107 -11
  69. package/lib/browser/shell/theia-dock-panel.js.map +1 -1
  70. package/lib/browser/styling-service.d.ts +2 -2
  71. package/lib/browser/styling-service.d.ts.map +1 -1
  72. package/lib/browser/styling-service.js +7 -8
  73. package/lib/browser/styling-service.js.map +1 -1
  74. package/lib/browser/widget-open-handler.d.ts +10 -0
  75. package/lib/browser/widget-open-handler.d.ts.map +1 -1
  76. package/lib/browser/widget-open-handler.js +24 -1
  77. package/lib/browser/widget-open-handler.js.map +1 -1
  78. package/lib/browser/window/default-secondary-window-service.d.ts +17 -3
  79. package/lib/browser/window/default-secondary-window-service.d.ts.map +1 -1
  80. package/lib/browser/window/default-secondary-window-service.js +76 -23
  81. package/lib/browser/window/default-secondary-window-service.js.map +1 -1
  82. package/lib/browser/window/default-secondary-window-service.spec.d.ts +2 -0
  83. package/lib/browser/window/default-secondary-window-service.spec.d.ts.map +1 -0
  84. package/lib/browser/window/default-secondary-window-service.spec.js +49 -0
  85. package/lib/browser/window/default-secondary-window-service.spec.js.map +1 -0
  86. package/lib/browser/window/secondary-window-close-contribution.d.ts +23 -0
  87. package/lib/browser/window/secondary-window-close-contribution.d.ts.map +1 -0
  88. package/lib/browser/window/secondary-window-close-contribution.js +39 -0
  89. package/lib/browser/window/secondary-window-close-contribution.js.map +1 -0
  90. package/lib/browser/window/secondary-window-service.d.ts +24 -1
  91. package/lib/browser/window/secondary-window-service.d.ts.map +1 -1
  92. package/lib/browser/window/secondary-window-service.js.map +1 -1
  93. package/lib/browser/window/window-focus-service.d.ts +4 -0
  94. package/lib/browser/window/window-focus-service.d.ts.map +1 -1
  95. package/lib/browser/window/window-focus-service.js +8 -2
  96. package/lib/browser/window/window-focus-service.js.map +1 -1
  97. package/lib/common/core-preferences.d.ts +2 -0
  98. package/lib/common/core-preferences.d.ts.map +1 -1
  99. package/lib/common/core-preferences.js +15 -0
  100. package/lib/common/core-preferences.js.map +1 -1
  101. package/lib/common/encoding-service.d.ts +5 -0
  102. package/lib/common/encoding-service.d.ts.map +1 -1
  103. package/lib/common/encoding-service.js +20 -3
  104. package/lib/common/encoding-service.js.map +1 -1
  105. package/lib/common/encoding-service.spec.d.ts +2 -0
  106. package/lib/common/encoding-service.spec.d.ts.map +1 -0
  107. package/lib/common/encoding-service.spec.js +40 -0
  108. package/lib/common/encoding-service.spec.js.map +1 -0
  109. package/lib/electron-browser/menu/electron-context-menu-renderer.d.ts.map +1 -1
  110. package/lib/electron-browser/menu/electron-context-menu-renderer.js +2 -1
  111. package/lib/electron-browser/menu/electron-context-menu-renderer.js.map +1 -1
  112. package/lib/electron-browser/window/electron-secondary-window-service.d.ts.map +1 -1
  113. package/lib/electron-browser/window/electron-secondary-window-service.js +1 -0
  114. package/lib/electron-browser/window/electron-secondary-window-service.js.map +1 -1
  115. package/package.json +4 -4
  116. package/src/browser/color-application-contribution.ts +6 -7
  117. package/src/browser/common-frontend-contribution.ts +8 -0
  118. package/src/browser/encoding-registry.ts +1 -1
  119. package/src/browser/frontend-application-module.ts +6 -0
  120. package/src/browser/quick-input/quick-command-service.ts +8 -2
  121. package/src/browser/saveable-service.ts +8 -0
  122. package/src/browser/secondary-window-handler.ts +397 -34
  123. package/src/browser/shell/application-shell-mouse-tracker.ts +10 -0
  124. package/src/browser/shell/application-shell.ts +38 -5
  125. package/src/browser/shell/index.ts +1 -0
  126. package/src/browser/shell/native-tab-drag-service.spec.ts +86 -0
  127. package/src/browser/shell/native-tab-drag-service.ts +402 -0
  128. package/src/browser/shell/shell-layout-restorer.spec.ts +42 -0
  129. package/src/browser/shell/shell-layout-restorer.ts +20 -0
  130. package/src/browser/shell/side-panel-handler.ts +15 -0
  131. package/src/browser/shell/tab-bars.spec.ts +56 -2
  132. package/src/browser/shell/tab-bars.ts +146 -3
  133. package/src/browser/shell/tab-drop-helper.ts +79 -0
  134. package/src/browser/shell/theia-dock-panel.ts +122 -11
  135. package/src/browser/style/dockpanel.css +9 -0
  136. package/src/browser/styling-service.ts +6 -7
  137. package/src/browser/widget-open-handler.ts +24 -3
  138. package/src/browser/window/default-secondary-window-service.spec.ts +54 -0
  139. package/src/browser/window/default-secondary-window-service.ts +78 -26
  140. package/src/browser/window/secondary-window-close-contribution.ts +47 -0
  141. package/src/browser/window/secondary-window-service.ts +20 -1
  142. package/src/browser/window/window-focus-service.ts +9 -2
  143. package/src/common/core-preferences.ts +19 -0
  144. package/src/common/encoding-service.spec.ts +40 -0
  145. package/src/common/encoding-service.ts +24 -3
  146. package/src/electron-browser/menu/electron-context-menu-renderer.ts +2 -1
  147. package/src/electron-browser/window/electron-secondary-window-service.ts +1 -0
@@ -0,0 +1,141 @@
1
+ import { MimeData } from '@lumino/coreutils';
2
+ import { Drag } from '@lumino/dragdrop';
3
+ import { TabBar, Title, Widget } from '@lumino/widgets';
4
+ import { Disposable } from '../../common/disposable';
5
+ import { Emitter, Event } from '../../common/event';
6
+ /**
7
+ * The mime type that Lumino drop targets, e.g. dock panels, expect for dragged widgets.
8
+ */
9
+ export declare const WIDGET_FACTORY_MIME_TYPE = "application/vnd.lumino.widget-factory";
10
+ export interface TabDropOutsideWindowsEvent {
11
+ /** The title of the dragged tab. */
12
+ title: Title<Widget>;
13
+ /** The horizontal screen coordinate at which the tab was released. */
14
+ screenX: number;
15
+ /** The vertical screen coordinate at which the tab was released. */
16
+ screenY: number;
17
+ }
18
+ export interface TabDropEvent {
19
+ /** The title of the dropped tab. */
20
+ title: Title<Widget>;
21
+ /** The window in which the tab has been dropped. */
22
+ window: Window;
23
+ }
24
+ type LuminoDragEventType = 'lm-dragenter' | 'lm-dragover' | 'lm-dragleave' | 'lm-dragexit' | 'lm-drop';
25
+ interface NativeTabDragSession {
26
+ readonly title: Title<Widget>;
27
+ readonly source: Widget;
28
+ readonly mimeData: MimeData;
29
+ }
30
+ interface WindowDragState {
31
+ readonly window: Window;
32
+ /** The Lumino drag object used to create the Lumino drag events dispatched in this window. */
33
+ drag?: Drag;
34
+ /** The element under the pointer during the last drag event. */
35
+ currentElement?: Element;
36
+ /** The element that accepted the Lumino `lm-dragenter` event. */
37
+ currentTarget?: Element;
38
+ /** The drop action of the last `lm-dragover` event. */
39
+ dropAction: Drag.DropAction;
40
+ /** Whether the pointer is currently over this window. */
41
+ inside: boolean;
42
+ leaveTimeout?: number;
43
+ }
44
+ /**
45
+ * Drags the tabs of dock panels with native HTML drag and drop instead of Lumino's pointer based drag and drop.
46
+ * Native drags work across windows, e.g. secondary windows, and show the drag image outside of the window as well.
47
+ *
48
+ * Drop targets are not aware of this: the native drag events are translated to the Lumino drag events
49
+ * (`lm-dragenter`, `lm-dragover`, `lm-dragleave` and `lm-drop`) that Lumino drop targets handle.
50
+ */
51
+ export declare class NativeTabDragService {
52
+ static readonly MIME_TYPE = "application/vnd.theia.dock-panel-tab";
53
+ /**
54
+ * The time without native drag events in a window after which the pointer is considered to have left the window.
55
+ * Native `dragleave` events are also fired when the pointer moves between the elements of a window,
56
+ * while native `dragover` events are fired continuously as long as the pointer is over a window.
57
+ */
58
+ protected static readonly LEAVE_DELAY = 150;
59
+ protected session: NativeTabDragSession | undefined;
60
+ protected readonly windows: Map<Window, WindowDragState>;
61
+ protected readonly onDidDropTabOutsideWindowsEmitter: Emitter<TabDropOutsideWindowsEvent>;
62
+ /**
63
+ * Emitted when a tab is released outside of all windows of the application, e.g. over the desktop.
64
+ */
65
+ readonly onDidDropTabOutsideWindows: Event<TabDropOutsideWindowsEvent>;
66
+ protected readonly onDidDropTabEmitter: Emitter<TabDropEvent>;
67
+ /**
68
+ * Emitted when a tab has been dropped on a drop target in one of the windows of the application.
69
+ */
70
+ readonly onDidDropTab: Event<TabDropEvent>;
71
+ protected readonly onDidStartDragEmitter: Emitter<DragEvent>;
72
+ /**
73
+ * Emitted when a tab drag has started, with its `dragstart` event.
74
+ */
75
+ readonly onDidStartDrag: Event<DragEvent>;
76
+ protected readonly onDidEndDragEmitter: Emitter<DragEvent>;
77
+ /**
78
+ * Emitted when a tab drag has ended, with its `dragend` event, or with the `drop` event of a successful drop.
79
+ * Native drags end without a `mouseup` event.
80
+ */
81
+ readonly onDidEndDrag: Event<DragEvent>;
82
+ protected init(): void;
83
+ /**
84
+ * Translates the native drag events of tab drags in the given window to Lumino drag events.
85
+ */
86
+ installWindow(win: Window): Disposable;
87
+ /**
88
+ * Starts dragging the given tab. To be called from the `dragstart` event of the tab.
89
+ *
90
+ * @param source the widget that is reported as the source of the Lumino drag events, i.e. the dock panel containing the tab bar
91
+ */
92
+ startDrag(event: DragEvent, tabBar: TabBar<Widget>, title: Title<Widget>, source: Widget): void;
93
+ /**
94
+ * Ends the current tab drag. To be called from the `dragend` event of the tab.
95
+ */
96
+ endDrag(event: DragEvent): void;
97
+ protected handleDragEvent(state: WindowDragState, event: DragEvent): void;
98
+ protected handleDragOver(state: WindowDragState, event: DragEvent): void;
99
+ protected handleDrop(state: WindowDragState, event: DragEvent): void;
100
+ /**
101
+ * Ends the current drag session and notifies the drop targets under the pointer that the drag has left them.
102
+ *
103
+ * @param event the event that ends the drag, i.e. its `dragend` event or the `drop` event of a successful drop
104
+ */
105
+ protected endSession(event: DragEvent): void;
106
+ /**
107
+ * @returns whether the pointer is over one of the windows at the end of the given drag event
108
+ */
109
+ protected isInsideWindows(event: DragEvent): boolean;
110
+ protected containsScreenPoint(win: Window, screenX: number, screenY: number): boolean;
111
+ /**
112
+ * Updates the Lumino drop target under the pointer, following `Drag._updateCurrentTarget` in `@lumino/dragdrop`.
113
+ */
114
+ protected updateCurrentTarget(state: WindowDragState, event: DragEvent): void;
115
+ /**
116
+ * Follows `Private.dispatchDragEnter` in `@lumino/dragdrop`.
117
+ */
118
+ protected dispatchDragEnter(state: WindowDragState, currElem: Element | undefined, currTarget: Element | undefined, event: DragEvent): Element | undefined;
119
+ /**
120
+ * The ancestors of the drop targets, see {@link rememberAncestors}.
121
+ */
122
+ protected readonly targetAncestors: WeakMap<Element, Element[]>;
123
+ /**
124
+ * Drop targets are often elements that are replaced while dragging, e.g. the lines of an editor that is re-rendered
125
+ * because a side panel expands. Lumino drag events dispatched to a removed element don't reach the drop target that
126
+ * handles them, e.g. the dock panel that has to hide its drop overlay. Such events are dispatched to the nearest
127
+ * ancestor that is still attached instead.
128
+ */
129
+ protected rememberAncestors(target: Element): void;
130
+ protected dispatch(state: WindowDragState, type: LuminoDragEventType, target: Element, event: DragEvent, related: Element | undefined): Drag.Event;
131
+ protected getDrag(state: WindowDragState): Drag;
132
+ protected scheduleLeave(state: WindowDragState): void;
133
+ protected cancelLeave(state: WindowDragState): void;
134
+ /**
135
+ * Notifies the current drop target, if any, that the pointer has left the window.
136
+ */
137
+ protected leaveWindow(state: WindowDragState): void;
138
+ protected resetWindow(state: WindowDragState): void;
139
+ }
140
+ export {};
141
+ //# sourceMappingURL=native-tab-drag-service.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"native-tab-drag-service.d.ts","sourceRoot":"","sources":["../../../src/browser/shell/native-tab-drag-service.ts"],"names":[],"mappings":"AAiBA,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAC7C,OAAO,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AACxC,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AACxD,OAAO,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AACrD,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAEpD;;GAEG;AACH,eAAO,MAAM,wBAAwB,0CAA0C,CAAC;AAEhF,MAAM,WAAW,0BAA0B;IACvC,oCAAoC;IACpC,KAAK,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;IACrB,sEAAsE;IACtE,OAAO,EAAE,MAAM,CAAC;IAChB,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KAAK,EAAE,eAAe,EAAE,KAAK,EAAE,SAAS,GAAG,IAAI;IA0B7E;;OAEG;IACH,SAAS,CAAC,iBAAiB,CAAC,KAAK,EAAE,eAAe,EAAE,QAAQ,EAAE,OAAO,GAAG,SAAS,EAAE,UAAU,EAAE,OAAO,GAAG,SAAS,EAAE,KAAK,EAAE,SAAS,GAAG,OAAO,GAAG,SAAS;IAgB1J;;OAEG;IACH,SAAS,CAAC,QAAQ,CAAC,eAAe,8BAAqC;IAEvE;;;;;OAKG;IACH,SAAS,CAAC,iBAAiB,CAAC,MAAM,EAAE,OAAO,GAAG,IAAI;IAQlD,SAAS,CAAC,QAAQ,CAAC,KAAK,EAAE,eAAe,EAAE,IAAI,EAAE,mBAAmB,EAAE,MAAM,EAAE,OAAO,EAAE,KAAK,EAAE,SAAS,EAAE,OAAO,EAAE,OAAO,GAAG,SAAS,GAAG,IAAI,CAAC,KAAK;IAclJ,SAAS,CAAC,OAAO,CAAC,KAAK,EAAE,eAAe,GAAG,IAAI;IAc/C,SAAS,CAAC,aAAa,CAAC,KAAK,EAAE,eAAe,GAAG,IAAI;IAQrD,SAAS,CAAC,WAAW,CAAC,KAAK,EAAE,eAAe,GAAG,IAAI;IAOnD;;OAEG;IACH,SAAS,CAAC,WAAW,CAAC,KAAK,EAAE,eAAe,GAAG,IAAI;IAYnD,SAAS,CAAC,WAAW,CAAC,KAAK,EAAE,eAAe,GAAG,IAAI;CAKtD"}
@@ -0,0 +1,349 @@
1
+ "use strict";
2
+ // *****************************************************************************
3
+ // Copyright (C) 2026 EclipseSource and others.
4
+ //
5
+ // This program and the accompanying materials are made available under the
6
+ // terms of the Eclipse Public License v. 2.0 which is available at
7
+ // http://www.eclipse.org/legal/epl-2.0.
8
+ //
9
+ // This Source Code may also be made available under the following Secondary
10
+ // Licenses when the conditions for such availability set forth in the Eclipse
11
+ // Public License v. 2.0 are satisfied: GNU General Public License, version 2
12
+ // with the GNU Classpath Exception which is available at
13
+ // https://www.gnu.org/software/classpath/license.html.
14
+ //
15
+ // SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
16
+ // *****************************************************************************
17
+ var NativeTabDragService_1;
18
+ Object.defineProperty(exports, "__esModule", { value: true });
19
+ exports.NativeTabDragService = exports.WIDGET_FACTORY_MIME_TYPE = void 0;
20
+ const tslib_1 = require("tslib");
21
+ const inversify_1 = require("inversify");
22
+ const coreutils_1 = require("@lumino/coreutils");
23
+ const dragdrop_1 = require("@lumino/dragdrop");
24
+ const disposable_1 = require("../../common/disposable");
25
+ const event_1 = require("../../common/event");
26
+ /**
27
+ * The mime type that Lumino drop targets, e.g. dock panels, expect for dragged widgets.
28
+ */
29
+ exports.WIDGET_FACTORY_MIME_TYPE = 'application/vnd.lumino.widget-factory';
30
+ /**
31
+ * Drags the tabs of dock panels with native HTML drag and drop instead of Lumino's pointer based drag and drop.
32
+ * Native drags work across windows, e.g. secondary windows, and show the drag image outside of the window as well.
33
+ *
34
+ * Drop targets are not aware of this: the native drag events are translated to the Lumino drag events
35
+ * (`lm-dragenter`, `lm-dragover`, `lm-dragleave` and `lm-drop`) that Lumino drop targets handle.
36
+ */
37
+ let NativeTabDragService = class NativeTabDragService {
38
+ constructor() {
39
+ this.windows = new Map();
40
+ this.onDidDropTabOutsideWindowsEmitter = new event_1.Emitter();
41
+ /**
42
+ * Emitted when a tab is released outside of all windows of the application, e.g. over the desktop.
43
+ */
44
+ this.onDidDropTabOutsideWindows = this.onDidDropTabOutsideWindowsEmitter.event;
45
+ this.onDidDropTabEmitter = new event_1.Emitter();
46
+ /**
47
+ * Emitted when a tab has been dropped on a drop target in one of the windows of the application.
48
+ */
49
+ this.onDidDropTab = this.onDidDropTabEmitter.event;
50
+ this.onDidStartDragEmitter = new event_1.Emitter();
51
+ /**
52
+ * Emitted when a tab drag has started, with its `dragstart` event.
53
+ */
54
+ this.onDidStartDrag = this.onDidStartDragEmitter.event;
55
+ this.onDidEndDragEmitter = new event_1.Emitter();
56
+ /**
57
+ * Emitted when a tab drag has ended, with its `dragend` event, or with the `drop` event of a successful drop.
58
+ * Native drags end without a `mouseup` event.
59
+ */
60
+ this.onDidEndDrag = this.onDidEndDragEmitter.event;
61
+ /**
62
+ * The ancestors of the drop targets, see {@link rememberAncestors}.
63
+ */
64
+ this.targetAncestors = new WeakMap();
65
+ }
66
+ static { NativeTabDragService_1 = this; }
67
+ static { this.MIME_TYPE = 'application/vnd.theia.dock-panel-tab'; }
68
+ /**
69
+ * The time without native drag events in a window after which the pointer is considered to have left the window.
70
+ * Native `dragleave` events are also fired when the pointer moves between the elements of a window,
71
+ * while native `dragover` events are fired continuously as long as the pointer is over a window.
72
+ */
73
+ static { this.LEAVE_DELAY = 150; }
74
+ init() {
75
+ this.installWindow(window);
76
+ }
77
+ /**
78
+ * Translates the native drag events of tab drags in the given window to Lumino drag events.
79
+ */
80
+ installWindow(win) {
81
+ if (this.windows.has(win)) {
82
+ return disposable_1.Disposable.NULL;
83
+ }
84
+ const state = { window: win, dropAction: 'none', inside: false };
85
+ this.windows.set(win, state);
86
+ const listener = (event) => this.handleDragEvent(state, event);
87
+ const types = ['dragenter', 'dragover', 'dragleave', 'drop'];
88
+ // Listen on the window in the capture phase to handle tab drags before any other drop target, e.g. Monaco or file drops.
89
+ types.forEach(type => win.addEventListener(type, listener, true));
90
+ return disposable_1.Disposable.create(() => {
91
+ types.forEach(type => win.removeEventListener(type, listener, true));
92
+ this.resetWindow(state);
93
+ this.windows.delete(win);
94
+ });
95
+ }
96
+ /**
97
+ * Starts dragging the given tab. To be called from the `dragstart` event of the tab.
98
+ *
99
+ * @param source the widget that is reported as the source of the Lumino drag events, i.e. the dock panel containing the tab bar
100
+ */
101
+ startDrag(event, tabBar, title, source) {
102
+ // not using `instanceof`, the tab may be in a secondary window, i.e. in another JavaScript realm
103
+ const tab = event.target?.closest?.('.lm-TabBar-tab');
104
+ if (!event.dataTransfer || !tab) {
105
+ event.preventDefault();
106
+ return;
107
+ }
108
+ // Only set our own type, so that other applications don't accept the drop.
109
+ event.dataTransfer.setData(NativeTabDragService_1.MIME_TYPE, title.owner.id);
110
+ // like VS Code, drop targets only ever move tabs, though
111
+ event.dataTransfer.effectAllowed = 'copyMove';
112
+ const tabRect = tab.getBoundingClientRect();
113
+ event.dataTransfer.setDragImage(tab, event.clientX - tabRect.left, event.clientY - tabRect.top);
114
+ const mimeData = new coreutils_1.MimeData();
115
+ mimeData.setData(exports.WIDGET_FACTORY_MIME_TYPE, () => title.owner);
116
+ this.session = { title, source, mimeData };
117
+ // The native drag cancels the pointer events, so Lumino never sees the release of its press on the tab.
118
+ tabBar.releaseMouse();
119
+ this.onDidStartDragEmitter.fire(event);
120
+ }
121
+ /**
122
+ * Ends the current tab drag. To be called from the `dragend` event of the tab.
123
+ */
124
+ endDrag(event) {
125
+ const session = this.session;
126
+ if (!session) {
127
+ return;
128
+ }
129
+ // a successful drop has ended the session already, see `handleDrop`
130
+ const insideWindows = this.isInsideWindows(event);
131
+ this.endSession(event);
132
+ if (!insideWindows && event.dataTransfer?.dropEffect === 'none' && !session.title.owner.isDisposed) {
133
+ this.onDidDropTabOutsideWindowsEmitter.fire({ title: session.title, screenX: event.screenX, screenY: event.screenY });
134
+ }
135
+ }
136
+ handleDragEvent(state, event) {
137
+ if (!this.session || !event.dataTransfer?.types.includes(NativeTabDragService_1.MIME_TYPE)) {
138
+ return;
139
+ }
140
+ // Tab drags are only handled by Lumino drop targets.
141
+ event.stopPropagation();
142
+ switch (event.type) {
143
+ case 'dragenter':
144
+ case 'dragover':
145
+ this.handleDragOver(state, event);
146
+ break;
147
+ case 'dragleave':
148
+ this.scheduleLeave(state);
149
+ break;
150
+ case 'drop':
151
+ this.handleDrop(state, event);
152
+ break;
153
+ }
154
+ }
155
+ handleDragOver(state, event) {
156
+ state.inside = true;
157
+ this.cancelLeave(state);
158
+ this.updateCurrentTarget(state, event);
159
+ if (state.dropAction !== 'none') {
160
+ event.preventDefault();
161
+ event.dataTransfer.dropEffect = 'move';
162
+ }
163
+ else {
164
+ event.dataTransfer.dropEffect = 'none';
165
+ }
166
+ }
167
+ handleDrop(state, event) {
168
+ event.preventDefault();
169
+ this.cancelLeave(state);
170
+ this.updateCurrentTarget(state, event);
171
+ const target = state.currentTarget;
172
+ let action = 'none';
173
+ if (target) {
174
+ if (state.dropAction === 'none') {
175
+ this.dispatch(state, 'lm-dragleave', target, event, undefined);
176
+ }
177
+ else {
178
+ action = this.dispatch(state, 'lm-drop', target, event, undefined).dropAction;
179
+ }
180
+ }
181
+ // The drop target has handled the drop, so it must not get a leave event when the drag ends.
182
+ state.currentTarget = undefined;
183
+ state.currentElement = undefined;
184
+ state.dropAction = 'none';
185
+ const title = this.session?.title;
186
+ if (action !== 'none' && title) {
187
+ // The drop may close the window the drag started in, e.g. when its last tab has been moved, so `dragend` may never be fired.
188
+ this.endSession(event);
189
+ this.onDidDropTabEmitter.fire({ title, window: state.window });
190
+ }
191
+ }
192
+ /**
193
+ * Ends the current drag session and notifies the drop targets under the pointer that the drag has left them.
194
+ *
195
+ * @param event the event that ends the drag, i.e. its `dragend` event or the `drop` event of a successful drop
196
+ */
197
+ endSession(event) {
198
+ this.session = undefined;
199
+ for (const state of this.windows.values()) {
200
+ this.resetWindow(state);
201
+ }
202
+ this.onDidEndDragEmitter.fire(event);
203
+ }
204
+ /**
205
+ * @returns whether the pointer is over one of the windows at the end of the given drag event
206
+ */
207
+ isInsideWindows(event) {
208
+ for (const state of this.windows.values()) {
209
+ // A window is only considered left some time after its last `dragleave` event, see `LEAVE_DELAY`.
210
+ // If the drag ends in the meantime, the position of the pointer tells whether it has left the window.
211
+ if (state.inside && (state.leaveTimeout === undefined || this.containsScreenPoint(state.window, event.screenX, event.screenY))) {
212
+ return true;
213
+ }
214
+ }
215
+ return false;
216
+ }
217
+ containsScreenPoint(win, screenX, screenY) {
218
+ return !win.closed && screenX >= win.screenX && screenX < win.screenX + win.outerWidth
219
+ && screenY >= win.screenY && screenY < win.screenY + win.outerHeight;
220
+ }
221
+ /**
222
+ * Updates the Lumino drop target under the pointer, following `Drag._updateCurrentTarget` in `@lumino/dragdrop`.
223
+ */
224
+ updateCurrentTarget(state, event) {
225
+ const prevTarget = state.currentTarget;
226
+ let currTarget = state.currentTarget;
227
+ const prevElem = state.currentElement;
228
+ const currElem = state.window.document.elementFromPoint(event.clientX, event.clientY) ?? undefined;
229
+ state.currentElement = currElem;
230
+ if (currElem !== prevElem && currElem !== currTarget) {
231
+ if (currTarget) {
232
+ this.dispatch(state, 'lm-dragexit', currTarget, event, currElem);
233
+ }
234
+ currTarget = this.dispatchDragEnter(state, currElem, currTarget, event);
235
+ }
236
+ if (currTarget !== prevTarget) {
237
+ state.currentTarget = currTarget;
238
+ if (prevTarget) {
239
+ this.dispatch(state, 'lm-dragleave', prevTarget, event, currTarget);
240
+ }
241
+ }
242
+ if (!currTarget) {
243
+ state.dropAction = 'none';
244
+ return;
245
+ }
246
+ const dragOver = this.dispatch(state, 'lm-dragover', currTarget, event, undefined);
247
+ state.dropAction = dragOver.defaultPrevented ? dragOver.dropAction : 'none';
248
+ }
249
+ /**
250
+ * Follows `Private.dispatchDragEnter` in `@lumino/dragdrop`.
251
+ */
252
+ dispatchDragEnter(state, currElem, currTarget, event) {
253
+ if (!currElem) {
254
+ return undefined;
255
+ }
256
+ if (this.dispatch(state, 'lm-dragenter', currElem, event, currTarget).defaultPrevented) {
257
+ this.rememberAncestors(currElem);
258
+ return currElem;
259
+ }
260
+ const body = state.window.document.body;
261
+ if (currElem === body) {
262
+ return currTarget;
263
+ }
264
+ this.dispatch(state, 'lm-dragenter', body, event, currTarget);
265
+ return body;
266
+ }
267
+ /**
268
+ * Drop targets are often elements that are replaced while dragging, e.g. the lines of an editor that is re-rendered
269
+ * because a side panel expands. Lumino drag events dispatched to a removed element don't reach the drop target that
270
+ * handles them, e.g. the dock panel that has to hide its drop overlay. Such events are dispatched to the nearest
271
+ * ancestor that is still attached instead.
272
+ */
273
+ rememberAncestors(target) {
274
+ const ancestors = [];
275
+ for (let ancestor = target.parentElement; ancestor; ancestor = ancestor.parentElement) {
276
+ ancestors.push(ancestor);
277
+ }
278
+ this.targetAncestors.set(target, ancestors);
279
+ }
280
+ dispatch(state, type, target, event, related) {
281
+ // `Drag.Event` is typed to take a `PointerEvent`, but it only copies `MouseEvent` properties (coordinates, button,
282
+ // modifier keys) into the new event, and does not keep a reference to the given event, so a `DragEvent` does as well.
283
+ const dragEvent = new dragdrop_1.Drag.Event(event, {
284
+ drag: this.getDrag(state),
285
+ // eslint-disable-next-line no-null/no-null
286
+ related: related ?? null,
287
+ type
288
+ });
289
+ const attachedTarget = target.isConnected ? target : this.targetAncestors.get(target)?.find(ancestor => ancestor.isConnected);
290
+ attachedTarget?.dispatchEvent(dragEvent);
291
+ return dragEvent;
292
+ }
293
+ getDrag(state) {
294
+ if (!state.drag || state.drag.mimeData !== this.session?.mimeData) {
295
+ // The drag is never started, it only provides the data of the Lumino drag events.
296
+ state.drag = new dragdrop_1.Drag({
297
+ document: state.window.document,
298
+ mimeData: this.session?.mimeData ?? new coreutils_1.MimeData(),
299
+ proposedAction: 'move',
300
+ supportedActions: 'move',
301
+ source: this.session?.source
302
+ });
303
+ }
304
+ return state.drag;
305
+ }
306
+ scheduleLeave(state) {
307
+ this.cancelLeave(state);
308
+ state.leaveTimeout = state.window.setTimeout(() => {
309
+ state.leaveTimeout = undefined;
310
+ this.leaveWindow(state);
311
+ }, NativeTabDragService_1.LEAVE_DELAY);
312
+ }
313
+ cancelLeave(state) {
314
+ if (state.leaveTimeout !== undefined) {
315
+ state.window.clearTimeout(state.leaveTimeout);
316
+ state.leaveTimeout = undefined;
317
+ }
318
+ }
319
+ /**
320
+ * Notifies the current drop target, if any, that the pointer has left the window.
321
+ */
322
+ leaveWindow(state) {
323
+ const target = state.currentTarget;
324
+ state.currentTarget = undefined;
325
+ state.currentElement = undefined;
326
+ state.dropAction = 'none';
327
+ state.inside = false;
328
+ if (target && !state.window.closed) {
329
+ // There is no native event at the time the pointer is known to have left the window.
330
+ this.dispatch(state, 'lm-dragleave', target, new DragEvent('dragleave'), undefined);
331
+ }
332
+ }
333
+ resetWindow(state) {
334
+ this.cancelLeave(state);
335
+ this.leaveWindow(state);
336
+ state.drag = undefined;
337
+ }
338
+ };
339
+ exports.NativeTabDragService = NativeTabDragService;
340
+ tslib_1.__decorate([
341
+ (0, inversify_1.postConstruct)(),
342
+ tslib_1.__metadata("design:type", Function),
343
+ tslib_1.__metadata("design:paramtypes", []),
344
+ tslib_1.__metadata("design:returntype", void 0)
345
+ ], NativeTabDragService.prototype, "init", null);
346
+ exports.NativeTabDragService = NativeTabDragService = NativeTabDragService_1 = tslib_1.__decorate([
347
+ (0, inversify_1.injectable)()
348
+ ], NativeTabDragService);
349
+ //# sourceMappingURL=native-tab-drag-service.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"native-tab-drag-service.js","sourceRoot":"","sources":["../../../src/browser/shell/native-tab-drag-service.ts"],"names":[],"mappings":";AAAA,gFAAgF;AAChF,+CAA+C;AAC/C,EAAE;AACF,2EAA2E;AAC3E,mEAAmE;AACnE,wCAAwC;AACxC,EAAE;AACF,4EAA4E;AAC5E,8EAA8E;AAC9E,6EAA6E;AAC7E,yDAAyD;AACzD,uDAAuD;AACvD,EAAE;AACF,gFAAgF;AAChF,gFAAgF;;;;;AAEhF,yCAAsD;AACtD,iDAA6C;AAC7C,+CAAwC;AAExC,wDAAqD;AACrD,8CAAoD;AAEpD;;GAEG;AACU,QAAA,wBAAwB,GAAG,uCAAuC,CAAC;AAyChF;;;;;;GAMG;AAEI,IAAM,oBAAoB,GAA1B,MAAM,oBAAoB;IAA1B;QAYgB,YAAO,GAAG,IAAI,GAAG,EAA2B,CAAC;QAE7C,sCAAiC,GAAG,IAAI,eAAO,EAA8B,CAAC;QACjG;;WAEG;QACM,+BAA0B,GAAsC,IAAI,CAAC,iCAAiC,CAAC,KAAK,CAAC;QAEnG,wBAAmB,GAAG,IAAI,eAAO,EAAgB,CAAC;QACrE;;WAEG;QAC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+ //# sourceMappingURL=native-tab-drag-service.spec.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"native-tab-drag-service.spec.d.ts","sourceRoot":"","sources":["../../../src/browser/shell/native-tab-drag-service.spec.ts"],"names":[],"mappings":""}
@@ -0,0 +1,71 @@
1
+ "use strict";
2
+ // *****************************************************************************
3
+ // Copyright (C) 2026 EclipseSource and others.
4
+ //
5
+ // This program and the accompanying materials are made available under the
6
+ // terms of the Eclipse Public License v. 2.0 which is available at
7
+ // http://www.eclipse.org/legal/epl-2.0.
8
+ //
9
+ // This Source Code may also be made available under the following Secondary
10
+ // Licenses when the conditions for such availability set forth in the Eclipse
11
+ // Public License v. 2.0 are satisfied: GNU General Public License, version 2
12
+ // with the GNU Classpath Exception which is available at
13
+ // https://www.gnu.org/software/classpath/license.html.
14
+ //
15
+ // SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
16
+ // *****************************************************************************
17
+ Object.defineProperty(exports, "__esModule", { value: true });
18
+ const jsdom_1 = require("../test/jsdom");
19
+ let disableJSDOM = (0, jsdom_1.enableJSDOM)();
20
+ const chai_1 = require("chai");
21
+ const native_tab_drag_service_1 = require("./native-tab-drag-service");
22
+ disableJSDOM();
23
+ class TestableNativeTabDragService extends native_tab_drag_service_1.NativeTabDragService {
24
+ /** Sets the state of the main window as if the pointer had been over it, and had left it just now if `leaving` */
25
+ setPointerState(leaving) {
26
+ const state = this.windows.get(window);
27
+ state.inside = true;
28
+ if (leaving) {
29
+ this.scheduleLeave(state);
30
+ }
31
+ }
32
+ callIsInsideWindows(event) {
33
+ return this.isInsideWindows(event);
34
+ }
35
+ dispose() {
36
+ this.windows.forEach(state => this.cancelLeave(state));
37
+ }
38
+ }
39
+ describe('NativeTabDragService', () => {
40
+ let service;
41
+ before(() => {
42
+ disableJSDOM = (0, jsdom_1.enableJSDOM)();
43
+ });
44
+ after(() => {
45
+ disableJSDOM();
46
+ });
47
+ beforeEach(() => {
48
+ service = new TestableNativeTabDragService();
49
+ service['init']();
50
+ Object.assign(window, { screenX: 100, screenY: 100, outerWidth: 800, outerHeight: 600 });
51
+ });
52
+ afterEach(() => {
53
+ service.dispose();
54
+ });
55
+ function dragEnd(screenX, screenY) {
56
+ return { screenX, screenY };
57
+ }
58
+ it('should consider the pointer inside a window that it has not left', () => {
59
+ service.setPointerState(false);
60
+ (0, chai_1.expect)(service.callIsInsideWindows(dragEnd(0, 0))).to.be.true;
61
+ });
62
+ it('should consider the pointer outside a window that it has just left if released outside of it', () => {
63
+ service.setPointerState(true);
64
+ (0, chai_1.expect)(service.callIsInsideWindows(dragEnd(950, 300))).to.be.false;
65
+ });
66
+ it('should consider the pointer inside a window that it has just left if released within its bounds', () => {
67
+ service.setPointerState(true);
68
+ (0, chai_1.expect)(service.callIsInsideWindows(dragEnd(500, 300))).to.be.true;
69
+ });
70
+ });
71
+ //# sourceMappingURL=native-tab-drag-service.spec.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"native-tab-drag-service.spec.js","sourceRoot":"","sources":["../../../src/browser/shell/native-tab-drag-service.spec.ts"],"names":[],"mappings":";AAAA,gFAAgF;AAChF,+CAA+C;AAC/C,EAAE;AACF,2EAA2E;AAC3E,mEAAmE;AACnE,wCAAwC;AACxC,EAAE;AACF,4EAA4E;AAC5E,8EAA8E;AAC9E,6EAA6E;AAC7E,yDAAyD;AACzD,uDAAuD;AACvD,EAAE;AACF,gFAAgF;AAChF,gFAAgF;;AAEhF,yCAA4C;AAC5C,IAAI,YAAY,GAAG,IAAA,mBAAW,GAAE,CAAC;AACjC,+BAA8B;AAE9B,uEAAiE;AAEjE,YAAY,EAAE,CAAC;AAEf,MAAM,4BAA6B,SAAQ,8CAAoB;IAE3D,kHAAkH;IAClH,eAAe,CAAC,OAAgB;QAC5B,MAAM,KAAK,GAAG,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,MAAM,CAAE,CAAC;QACxC,KAAK,CAAC,MAAM,GAAG,IAAI,CAAC;QACpB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AAE,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,IAAI,CAAC;IAClE,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,8FAA8F,EAAE,GAAG,EAAE;QACpG,OAAO,CAAC,eAAe,CAAC,IAAI,CAAC,CAAC;QAC9B,IAAA,aAAM,EAAC,OAAO,CAAC,mBAAmB,CAAC,OAAO,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,KAAK,CAAC;IACvE,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,iGAAiG,EAAE,GAAG,EAAE;QACvG,OAAO,CAAC,eAAe,CAAC,IAAI,CAAC,CAAC;QAC9B,IAAA,aAAM,EAAC,OAAO,CAAC,mBAAmB,CAAC,OAAO,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,IAAI,CAAC;IACtE,CAAC,CAAC,CAAC;AAEP,CAAC,CAAC,CAAC"}
@@ -11,6 +11,7 @@ import { ApplicationShell, ApplicationShellLayoutVersion } from './application-s
11
11
  import { WindowService } from '../window/window-service';
12
12
  import { MaybePromise } from '../../common';
13
13
  import { PerspectiveServiceInternal } from '../perspective-service';
14
+ import { SecondaryWindowHandler } from '../secondary-window-handler';
14
15
  /**
15
16
  * A contract for widgets that want to store and restore their inner state, between sessions.
16
17
  */
@@ -104,6 +105,7 @@ export declare class ShellLayoutRestorer implements CommandContribution {
104
105
  protected readonly themeService: ThemeService;
105
106
  protected readonly perspectiveService: PerspectiveServiceInternal;
106
107
  protected readonly sidePanelItemVisibility: SidePanelItemVisibility;
108
+ protected readonly secondaryWindowHandler: SecondaryWindowHandler;
107
109
  constructor(widgetManager: WidgetManager, logger: ILogger, storageService: StorageService);
108
110
  registerCommands(commands: CommandRegistry): void;
109
111
  protected resetLayout(): Promise<void>;
@@ -111,6 +113,7 @@ export declare class ShellLayoutRestorer implements CommandContribution {
111
113
  protected storePerspectiveLayouts(app: FrontendApplication): void;
112
114
  restoreLayout(app: FrontendApplication): Promise<boolean>;
113
115
  protected restorePerspectiveLayouts(app: FrontendApplication): Promise<boolean>;
116
+ protected restoreSecondaryWindows(layout: ApplicationShell.LayoutData): void;
114
117
  protected isWidgetProperty(propertyName: string): boolean;
115
118
  protected isWidgetsProperty(propertyName: string): boolean;
116
119
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"shell-layout-restorer.d.ts","sourceRoot":"","sources":["../../../src/browser/shell/shell-layout-restorer.ts"],"names":[],"mappings":"AAiBA,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AACzC,OAAO,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;AAC9D,OAAO,EAAE,aAAa,EAAE,yBAAyB,EAAE,MAAM,mBAAmB,CAAC;AAC7E,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AACpD,OAAO,EAAE,uBAAuB,EAAE,MAAM,8BAA8B,CAAC;AACvE,OAAO,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAC9C,OAAO,EAAE,mBAAmB,EAAE,eAAe,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AACrF,OAAO,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAC1C,OAAO,EAAE,oBAAoB,EAAE,MAAM,oCAAoC,CAAC;AAC1E,OAAO,EAAE,gBAAgB,EAAiC,6BAA6B,EAAE,MAAM,qBAAqB,CAAC;AAErH,OAAO,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AAEzD,OAAO,EAAwB,YAAY,EAAE,MAAM,cAAc,CAAC;AAClE,OAAO,EAAE,0BAA0B,EAAE,MAAM,wBAAwB,CAAC;AAEpE;;GAEG;AACH,MAAM,WAAW,cAAc;IAE3B;;OAEG;IACH,UAAU,IAAI,MAAM,GAAG,SAAS,CAAC;IAEjC;;OAEG;IACH,YAAY,CAAC,QAAQ,EAAE,MAAM,GAAG,IAAI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