@codingame/monaco-vscode-api 2.1.4 → 2.2.0-next.1

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 (190) hide show
  1. package/README.md +2 -0
  2. package/contributions.js +1 -0
  3. package/extensions.d.ts +6 -3
  4. package/extensions.js +18 -7
  5. package/lifecycle.js +11 -3
  6. package/missing-services.js +55 -10
  7. package/monaco.js +7 -3
  8. package/package.json +8 -8
  9. package/service-override/tools/views.d.ts +98 -0
  10. package/service-override/tools/views.js +249 -0
  11. package/services.d.ts +4 -2
  12. package/services.js +11 -9
  13. package/vscode/src/vs/base/browser/deviceAccess.js +60 -0
  14. package/vscode/src/vs/base/browser/dom.js +18 -1
  15. package/vscode/src/vs/base/browser/ui/centered/centeredViewLayout.js +178 -0
  16. package/vscode/src/vs/base/browser/ui/grid/grid.js +492 -0
  17. package/vscode/src/vs/base/browser/ui/grid/gridview.css.js +4 -0
  18. package/vscode/src/vs/base/browser/ui/grid/gridview.d.ts +1 -0
  19. package/vscode/src/vs/base/browser/ui/grid/gridview.js +1109 -0
  20. package/vscode/src/vs/base/browser/ui/sash/sash.js +9 -1
  21. package/vscode/src/vs/base/browser/ui/splitview/splitview.d.ts +348 -1
  22. package/vscode/src/vs/base/common/async.js +46 -2
  23. package/vscode/src/vs/base/common/codicons.d.ts +579 -0
  24. package/vscode/src/vs/base/common/event.js +11 -2
  25. package/vscode/src/vs/base/common/keybindingParser.js +87 -0
  26. package/vscode/src/vs/base/common/network.js +1 -2
  27. package/vscode/src/vs/base/common/observableInternal/utils.js +1 -1
  28. package/vscode/src/vs/base/common/platform.js +2 -1
  29. package/vscode/src/vs/base/common/scrollable.d.ts +28 -0
  30. package/vscode/src/vs/editor/browser/widget/multiDiffEditorWidget/colors.js +17 -0
  31. package/vscode/src/vs/editor/browser/widget/multiDiffEditorWidget/diffEditorItemTemplate.js +214 -0
  32. package/vscode/src/vs/editor/browser/widget/multiDiffEditorWidget/multiDiffEditorViewModel.js +84 -0
  33. package/vscode/src/vs/editor/browser/widget/multiDiffEditorWidget/multiDiffEditorWidget.js +54 -0
  34. package/vscode/src/vs/editor/browser/widget/multiDiffEditorWidget/multiDiffEditorWidgetImpl.js +324 -0
  35. package/vscode/src/vs/editor/browser/widget/multiDiffEditorWidget/objectPool.js +46 -0
  36. package/vscode/src/vs/editor/browser/widget/multiDiffEditorWidget/style.css.js +4 -0
  37. package/vscode/src/vs/editor/browser/widget/multiDiffEditorWidget/utils.js +11 -0
  38. package/vscode/src/vs/platform/keyboardLayout/common/keyboardLayout.js +61 -1
  39. package/vscode/src/vs/platform/languagePacks/common/localizedStrings.js +10 -0
  40. package/vscode/src/vs/platform/log/browser/log.js +24 -0
  41. package/vscode/src/vs/platform/product/common/product.js +1 -2
  42. package/vscode/src/vs/platform/userDataSync/common/abstractSynchronizer.js +772 -0
  43. package/vscode/src/vs/platform/userDataSync/common/userDataSyncStoreService.js +551 -0
  44. package/vscode/src/vs/platform/webview/common/mimeTypes.js +22 -0
  45. package/vscode/src/vs/platform/webview/common/webviewPortMapping.js +62 -0
  46. package/vscode/src/vs/workbench/api/browser/viewsExtensionPoint.js +788 -0
  47. package/vscode/src/vs/workbench/browser/actions/listCommands.js +763 -0
  48. package/vscode/src/vs/workbench/browser/layout.d.ts +26 -0
  49. package/vscode/src/vs/workbench/browser/media/style.css.js +1 -1
  50. package/vscode/src/vs/workbench/browser/parts/activitybar/activitybarPart.js +610 -0
  51. package/vscode/src/vs/workbench/browser/parts/activitybar/media/activityaction.css.js +4 -0
  52. package/vscode/src/vs/workbench/browser/parts/activitybar/media/activitybarpart.css.js +4 -0
  53. package/vscode/src/vs/workbench/browser/parts/auxiliarybar/auxiliaryBarPart.js +148 -0
  54. package/vscode/src/vs/workbench/browser/parts/auxiliarybar/media/auxiliaryBarPart.css.js +4 -0
  55. package/vscode/src/vs/workbench/browser/parts/compositeBar.js +603 -0
  56. package/vscode/src/vs/workbench/browser/parts/compositePart.js +333 -0
  57. package/vscode/src/vs/workbench/browser/parts/editor/auxiliaryEditorPart.js +221 -0
  58. package/vscode/src/vs/workbench/browser/parts/editor/editor.contribution.js +1406 -0
  59. package/vscode/src/vs/workbench/browser/parts/editor/editorConfiguration.js +184 -0
  60. package/vscode/src/vs/workbench/browser/parts/editor/editorDropTarget.js +509 -0
  61. package/vscode/src/vs/workbench/browser/parts/editor/editorPane.d.ts +112 -0
  62. package/vscode/src/vs/workbench/browser/parts/editor/editorPart.js +1018 -0
  63. package/vscode/src/vs/workbench/browser/parts/editor/editorParts.js +389 -0
  64. package/vscode/src/vs/workbench/browser/parts/editor/media/editordroptarget.css.js +4 -0
  65. package/vscode/src/vs/workbench/browser/parts/media/compositepart.css.js +4 -0
  66. package/vscode/src/vs/workbench/browser/parts/media/paneCompositePart.css.js +4 -0
  67. package/vscode/src/vs/workbench/browser/parts/notifications/media/notificationsActions.css.js +4 -0
  68. package/vscode/src/vs/workbench/browser/parts/notifications/media/notificationsCenter.css.js +4 -0
  69. package/vscode/src/vs/workbench/browser/parts/notifications/media/notificationsList.css.js +4 -0
  70. package/vscode/src/vs/workbench/browser/parts/notifications/media/notificationsToasts.css.js +4 -0
  71. package/vscode/src/vs/workbench/browser/parts/notifications/notificationsActions.js +213 -0
  72. package/vscode/src/vs/workbench/browser/parts/notifications/notificationsAlerts.js +73 -0
  73. package/vscode/src/vs/workbench/browser/parts/notifications/notificationsCenter.js +307 -0
  74. package/vscode/src/vs/workbench/browser/parts/notifications/notificationsList.js +226 -0
  75. package/vscode/src/vs/workbench/browser/parts/notifications/notificationsStatus.js +218 -0
  76. package/vscode/src/vs/workbench/browser/parts/notifications/notificationsToasts.js +433 -0
  77. package/vscode/src/vs/workbench/browser/parts/notifications/notificationsViewer.js +436 -0
  78. package/vscode/src/vs/workbench/browser/parts/paneCompositeBar.js +643 -0
  79. package/vscode/src/vs/workbench/browser/parts/paneCompositePart.js +377 -0
  80. package/vscode/src/vs/workbench/browser/parts/paneCompositePartService.js +66 -0
  81. package/vscode/src/vs/workbench/browser/parts/panel/panelPart.js +144 -0
  82. package/vscode/src/vs/workbench/browser/parts/sidebar/media/sidebarpart.css.js +4 -0
  83. package/vscode/src/vs/workbench/browser/parts/sidebar/sidebarPart.js +220 -0
  84. package/vscode/src/vs/workbench/browser/window.js +239 -5
  85. package/vscode/src/vs/workbench/common/configuration.js +11 -1
  86. package/vscode/src/vs/workbench/common/theme.js +3 -3
  87. package/vscode/src/vs/workbench/contrib/callHierarchy/browser/callHierarchy.contribution.js +298 -0
  88. package/vscode/src/vs/workbench/contrib/callHierarchy/browser/callHierarchyPeek.js +363 -0
  89. package/vscode/src/vs/workbench/contrib/callHierarchy/browser/callHierarchyTree.js +133 -0
  90. package/vscode/src/vs/workbench/contrib/callHierarchy/browser/media/callHierarchy.css.js +4 -0
  91. package/vscode/src/vs/workbench/contrib/comments/browser/commentGlyphWidget.js +90 -0
  92. package/vscode/src/vs/workbench/contrib/comments/browser/commentMenus.js +43 -0
  93. package/vscode/src/vs/workbench/contrib/comments/browser/commentService.js +317 -2
  94. package/vscode/src/vs/workbench/contrib/comments/browser/commentThreadRangeDecorator.js +107 -0
  95. package/vscode/src/vs/workbench/contrib/comments/browser/commentThreadZoneWidget.js +395 -0
  96. package/vscode/src/vs/workbench/contrib/comments/browser/comments.js +3 -0
  97. package/vscode/src/vs/workbench/contrib/comments/browser/commentsController.js +1277 -0
  98. package/vscode/src/vs/workbench/contrib/comments/browser/commentsFilterOptions.js +17 -0
  99. package/vscode/src/vs/workbench/contrib/comments/browser/commentsModel.js +123 -0
  100. package/vscode/src/vs/workbench/contrib/comments/browser/commentsTreeViewer.js +342 -0
  101. package/vscode/src/vs/workbench/contrib/comments/browser/commentsView.js +451 -0
  102. package/vscode/src/vs/workbench/contrib/comments/browser/commentsViewActions.js +176 -0
  103. package/vscode/src/vs/workbench/contrib/comments/browser/media/panel.css.js +4 -0
  104. package/vscode/src/vs/workbench/contrib/comments/common/commentModel.js +35 -0
  105. package/vscode/src/vs/workbench/contrib/customEditor/browser/customEditor.contribution.js +16 -0
  106. package/vscode/src/vs/workbench/contrib/customEditor/browser/customEditorInputFactory.js +143 -0
  107. package/vscode/src/vs/workbench/contrib/customEditor/browser/customEditors.js +212 -0
  108. package/vscode/src/vs/workbench/contrib/customEditor/browser/media/customEditor.css.js +4 -0
  109. package/vscode/src/vs/workbench/contrib/customEditor/common/contributedCustomEditors.js +76 -0
  110. package/vscode/src/vs/workbench/contrib/customEditor/common/customEditorModelManager.js +61 -0
  111. package/vscode/src/vs/workbench/contrib/customEditor/common/extensionPoint.js +117 -0
  112. package/vscode/src/vs/workbench/contrib/editSessions/common/editSessions.js +62 -0
  113. package/vscode/src/vs/workbench/contrib/externalUriOpener/common/externalUriOpener.contribution.js +5 -0
  114. package/vscode/src/vs/workbench/contrib/files/browser/editors/binaryFileEditor.js +77 -0
  115. package/vscode/src/vs/workbench/contrib/files/browser/editors/fileEditorHandler.js +72 -0
  116. package/vscode/src/vs/workbench/contrib/files/browser/editors/textFileEditor.js +254 -0
  117. package/vscode/src/vs/workbench/contrib/files/browser/editors/textFileEditorTracker.js +97 -0
  118. package/vscode/src/vs/workbench/contrib/files/browser/editors/textFileSaveErrorHandler.js +442 -0
  119. package/vscode/src/vs/workbench/contrib/files/browser/explorerService.js +430 -0
  120. package/vscode/src/vs/workbench/contrib/files/browser/fileActions.contribution.js +784 -0
  121. package/vscode/src/vs/workbench/contrib/files/browser/fileCommands.js +487 -0
  122. package/vscode/src/vs/workbench/contrib/files/browser/files.contribution.js +521 -0
  123. package/vscode/src/vs/workbench/contrib/files/browser/workspaceWatcher.js +150 -0
  124. package/vscode/src/vs/workbench/contrib/files/common/dirtyFilesIndicator.js +61 -0
  125. package/vscode/src/vs/workbench/contrib/interactive/browser/interactiveDocumentService.js +25 -1
  126. package/vscode/src/vs/workbench/contrib/interactive/browser/interactiveEditorInput.js +178 -0
  127. package/vscode/src/vs/workbench/contrib/interactive/browser/interactiveHistoryService.js +49 -0
  128. package/vscode/src/vs/workbench/contrib/languageStatus/browser/languageStatus.contribution.js +408 -0
  129. package/vscode/src/vs/workbench/contrib/languageStatus/browser/media/languageStatus.css.js +4 -0
  130. package/vscode/src/vs/workbench/contrib/limitIndicator/browser/limitIndicator.contribution.js +145 -0
  131. package/vscode/src/vs/workbench/contrib/mappedEdits/common/mappedEdits.contribution.js +22 -0
  132. package/vscode/src/vs/workbench/contrib/mergeEditor/browser/commands/commands.js +691 -0
  133. package/vscode/src/vs/workbench/contrib/mergeEditor/browser/commands/devCommands.js +238 -0
  134. package/vscode/src/vs/workbench/contrib/mergeEditor/browser/mergeEditor.contribution.js +76 -0
  135. package/vscode/src/vs/workbench/contrib/mergeEditor/browser/mergeEditorSerializer.js +40 -0
  136. package/vscode/src/vs/workbench/contrib/mergeEditor/browser/view/colors.js +69 -0
  137. package/vscode/src/vs/workbench/contrib/mergeEditor/browser/view/conflictActions.js +346 -0
  138. package/vscode/src/vs/workbench/contrib/mergeEditor/browser/view/editorGutter.js +96 -0
  139. package/vscode/src/vs/workbench/contrib/mergeEditor/browser/view/editors/baseCodeEditorView.js +144 -0
  140. package/vscode/src/vs/workbench/contrib/mergeEditor/browser/view/editors/codeEditorView.js +103 -0
  141. package/vscode/src/vs/workbench/contrib/mergeEditor/browser/view/editors/inputCodeEditorView.js +399 -0
  142. package/vscode/src/vs/workbench/contrib/mergeEditor/browser/view/editors/resultCodeEditorView.js +195 -0
  143. package/vscode/src/vs/workbench/contrib/mergeEditor/browser/view/fixedZoneWidget.js +39 -0
  144. package/vscode/src/vs/workbench/contrib/mergeEditor/browser/view/lineAlignment.js +126 -0
  145. package/vscode/src/vs/workbench/contrib/mergeEditor/browser/view/media/mergeEditor.css.js +4 -0
  146. package/vscode/src/vs/workbench/contrib/mergeEditor/browser/view/mergeEditor.js +611 -0
  147. package/vscode/src/vs/workbench/contrib/mergeEditor/browser/view/scrollSynchronizer.js +156 -0
  148. package/vscode/src/vs/workbench/contrib/mergeEditor/browser/view/viewModel.js +262 -0
  149. package/vscode/src/vs/workbench/contrib/mergeEditor/browser/view/viewZones.js +171 -0
  150. package/vscode/src/vs/workbench/contrib/multiDiffEditor/browser/multiDiffSourceResolverService.js +41 -0
  151. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/cellStatusBar/executionStatusBarItemController.js +317 -0
  152. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/cellStatusBar/notebookVisibleCellObserver.js +56 -0
  153. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/find/notebookFindWidget.js +315 -0
  154. package/vscode/src/vs/workbench/contrib/preferences/browser/keyboardLayoutPicker.js +193 -0
  155. package/vscode/src/vs/workbench/contrib/preferences/common/preferences.js +2 -1
  156. package/vscode/src/vs/workbench/contrib/sash/browser/sash.contribution.js +37 -0
  157. package/vscode/src/vs/workbench/contrib/sash/browser/sash.js +39 -0
  158. package/vscode/src/vs/workbench/contrib/speech/common/speechService.js +138 -2
  159. package/vscode/src/vs/workbench/contrib/tags/browser/workspaceTagsService.js +12 -0
  160. package/vscode/src/vs/workbench/contrib/tags/common/workspaceTags.js +3 -0
  161. package/vscode/src/vs/workbench/contrib/typeHierarchy/browser/media/typeHierarchy.css.js +4 -0
  162. package/vscode/src/vs/workbench/contrib/typeHierarchy/browser/typeHierarchy.contribution.js +281 -0
  163. package/vscode/src/vs/workbench/contrib/typeHierarchy/browser/typeHierarchyPeek.js +358 -0
  164. package/vscode/src/vs/workbench/contrib/typeHierarchy/browser/typeHierarchyTree.js +131 -0
  165. package/vscode/src/vs/workbench/contrib/update/common/update.js +2 -0
  166. package/vscode/src/vs/workbench/contrib/webview/browser/overlayWebview.js +288 -0
  167. package/vscode/src/vs/workbench/contrib/webview/browser/resourceLoading.js +94 -0
  168. package/vscode/src/vs/workbench/contrib/webview/browser/themeing.js +86 -0
  169. package/vscode/src/vs/workbench/contrib/webview/browser/webview.contribution.js +77 -0
  170. package/vscode/src/vs/workbench/contrib/webview/browser/webviewElement.js +646 -0
  171. package/vscode/src/vs/workbench/contrib/webview/browser/webviewFindWidget.js +63 -0
  172. package/vscode/src/vs/workbench/contrib/webview/browser/webviewService.js +57 -0
  173. package/vscode/src/vs/workbench/contrib/webviewPanel/browser/webviewCommands.js +140 -0
  174. package/vscode/src/vs/workbench/contrib/webviewPanel/browser/webviewEditorInputSerializer.js +119 -0
  175. package/vscode/src/vs/workbench/contrib/webviewPanel/browser/webviewPanel.contribution.js +67 -0
  176. package/vscode/src/vs/workbench/contrib/webviewView/browser/webviewViewPane.js +233 -0
  177. package/vscode/src/vs/workbench/services/activity/browser/activityService.js +143 -0
  178. package/vscode/src/vs/workbench/services/auxiliaryWindow/browser/auxiliaryWindowService.js +0 -3
  179. package/vscode/src/vs/workbench/services/driver/browser/driver.js +184 -0
  180. package/vscode/src/vs/workbench/services/editor/browser/editorResolverService.js +668 -0
  181. package/vscode/src/vs/workbench/services/history/browser/historyService.js +1482 -0
  182. package/vscode/src/vs/workbench/services/layout/browser/layoutService.js +17 -1
  183. package/vscode/src/vs/workbench/services/lifecycle/common/lifecycle.js +8 -1
  184. package/vscode/src/vs/workbench/services/progress/browser/media/progressService.css.js +4 -0
  185. package/vscode/src/vs/workbench/services/progress/browser/progressService.js +521 -0
  186. package/vscode/src/vs/workbench/services/textMate/common/TMGrammars.js +102 -0
  187. package/vscode/src/vs/workbench/services/themes/common/tokenClassificationExtensionPoint.js +296 -0
  188. package/vscode/src/vs/workbench/services/untitled/common/untitledTextEditorHandler.js +99 -0
  189. package/vscode/src/vs/workbench/services/views/browser/viewDescriptorService.js +711 -0
  190. package/vscode/src/vs/workbench/services/views/common/viewContainerModel.js +596 -0
@@ -18,8 +18,16 @@ var OrthogonalEdge;
18
18
  })(OrthogonalEdge || (OrthogonalEdge = {})));
19
19
  let globalSize = 4;
20
20
  const onDidChangeGlobalSize = ( new Emitter());
21
+ function setGlobalSashSize(size) {
22
+ globalSize = size;
23
+ onDidChangeGlobalSize.fire(size);
24
+ }
21
25
  let globalHoverDelay = 300;
22
26
  const onDidChangeHoverDelay = ( new Emitter());
27
+ function setGlobalHoverDelay(size) {
28
+ globalHoverDelay = size;
29
+ onDidChangeHoverDelay.fire(size);
30
+ }
23
31
  class MouseEventFactory {
24
32
  constructor(el) {
25
33
  this.el = el;
@@ -370,4 +378,4 @@ class Sash extends Disposable {
370
378
  this.el.remove();
371
379
  }
372
380
  }
373
- export { OrthogonalEdge, Sash };
381
+ export { OrthogonalEdge, Sash, setGlobalHoverDelay, setGlobalSashSize };
@@ -1,5 +1,12 @@
1
+ import { Orientation, Sash } from '../sash/sash.js';
2
+ import { Color } from '../../../common/color.js';
1
3
  import { Event } from '../../../common/event.js';
4
+ import { Disposable, IDisposable } from '../../../common/lifecycle.js';
5
+ import { ScrollEvent, ScrollbarVisibility } from '../../../common/scrollable.js';
2
6
 
7
+ interface ISplitViewStyles {
8
+ readonly separatorBorder: Color;
9
+ }
3
10
  declare const enum LayoutPriority {
4
11
  Normal = 0,
5
12
  Low = 1,
@@ -80,5 +87,345 @@ interface IView<TLayoutContext = undefined> {
80
87
  */
81
88
  setVisible?(visible: boolean): void;
82
89
  }
90
+ /**
91
+ * A descriptor for a {@link SplitView} instance.
92
+ */
93
+ interface ISplitViewDescriptor<TLayoutContext = undefined, TView extends IView<TLayoutContext> = IView<TLayoutContext>> {
94
+ /**
95
+ * The layout size of the {@link SplitView}.
96
+ */
97
+ readonly size: number;
98
+ /**
99
+ * Descriptors for each {@link IView view}.
100
+ */
101
+ readonly views: {
102
+ /**
103
+ * Whether the {@link IView view} is visible.
104
+ *
105
+ * @defaultValue `true`
106
+ */
107
+ readonly visible?: boolean;
108
+ /**
109
+ * The size of the {@link IView view}.
110
+ *
111
+ * @defaultValue `true`
112
+ */
113
+ readonly size: number;
114
+ /**
115
+ * The size of the {@link IView view}.
116
+ *
117
+ * @defaultValue `true`
118
+ */
119
+ readonly view: TView;
120
+ }[];
121
+ }
122
+ interface ISplitViewOptions<TLayoutContext = undefined, TView extends IView<TLayoutContext> = IView<TLayoutContext>> {
123
+ /**
124
+ * Which axis the views align on.
125
+ *
126
+ * @defaultValue `Orientation.VERTICAL`
127
+ */
128
+ readonly orientation?: Orientation;
129
+ /**
130
+ * Styles overriding the {@link defaultStyles default ones}.
131
+ */
132
+ readonly styles?: ISplitViewStyles;
133
+ /**
134
+ * Make Alt-drag the default drag operation.
135
+ */
136
+ readonly inverseAltBehavior?: boolean;
137
+ /**
138
+ * Resize each view proportionally when resizing the SplitView.
139
+ *
140
+ * @defaultValue `true`
141
+ */
142
+ readonly proportionalLayout?: boolean;
143
+ /**
144
+ * An initial description of this {@link SplitView} instance, allowing
145
+ * to initialze all views within the ctor.
146
+ */
147
+ readonly descriptor?: ISplitViewDescriptor<TLayoutContext, TView>;
148
+ /**
149
+ * The scrollbar visibility setting for whenever the views within
150
+ * the {@link SplitView} overflow.
151
+ */
152
+ readonly scrollbarVisibility?: ScrollbarVisibility;
153
+ /**
154
+ * Override the orthogonal size of sashes.
155
+ */
156
+ readonly getSashOrthogonalSize?: () => number;
157
+ }
158
+ interface ISashItem {
159
+ sash: Sash;
160
+ disposable: IDisposable;
161
+ }
162
+ /**
163
+ * When adding or removing views, uniformly distribute the entire split view space among
164
+ * all views.
165
+ */
166
+ type DistributeSizing = {
167
+ type: 'distribute';
168
+ };
169
+ /**
170
+ * When adding a view, make space for it by reducing the size of another view,
171
+ * indexed by the provided `index`.
172
+ */
173
+ type SplitSizing = {
174
+ type: 'split';
175
+ index: number;
176
+ };
177
+ /**
178
+ * When adding a view, use DistributeSizing when all pre-existing views are
179
+ * distributed evenly, otherwise use SplitSizing.
180
+ */
181
+ type AutoSizing = {
182
+ type: 'auto';
183
+ index: number;
184
+ };
185
+ /**
186
+ * When adding or removing views, assume the view is invisible.
187
+ */
188
+ type InvisibleSizing = {
189
+ type: 'invisible';
190
+ cachedVisibleSize: number;
191
+ };
192
+ /**
193
+ * When adding or removing views, the sizing provides fine grained
194
+ * control over how other views get resized.
195
+ */
196
+ type Sizing = DistributeSizing | SplitSizing | AutoSizing | InvisibleSizing;
197
+ declare namespace Sizing {
198
+ /**
199
+ * When adding or removing views, distribute the delta space among
200
+ * all other views.
201
+ */
202
+ const Distribute: DistributeSizing;
203
+ /**
204
+ * When adding or removing views, split the delta space with another
205
+ * specific view, indexed by the provided `index`.
206
+ */
207
+ function Split(index: number): SplitSizing;
208
+ /**
209
+ * When adding a view, use DistributeSizing when all pre-existing views are
210
+ * distributed evenly, otherwise use SplitSizing.
211
+ */
212
+ function Auto(index: number): AutoSizing;
213
+ /**
214
+ * When adding or removing views, assume the view is invisible.
215
+ */
216
+ function Invisible(cachedVisibleSize: number): InvisibleSizing;
217
+ }
218
+ /**
219
+ * The {@link SplitView} is the UI component which implements a one dimensional
220
+ * flex-like layout algorithm for a collection of {@link IView} instances, which
221
+ * are essentially HTMLElement instances with the following size constraints:
222
+ *
223
+ * - {@link IView.minimumSize}
224
+ * - {@link IView.maximumSize}
225
+ * - {@link IView.priority}
226
+ * - {@link IView.snap}
227
+ *
228
+ * In case the SplitView doesn't have enough size to fit all views, it will overflow
229
+ * its content with a scrollbar.
230
+ *
231
+ * In between each pair of views there will be a {@link Sash} allowing the user
232
+ * to resize the views, making sure the constraints are respected.
233
+ *
234
+ * An optional {@link TLayoutContext layout context type} may be used in order to
235
+ * pass along layout contextual data from the {@link SplitView.layout} method down
236
+ * to each view's {@link IView.layout} calls.
237
+ *
238
+ * Features:
239
+ * - Flex-like layout algorithm
240
+ * - Snap support
241
+ * - Orthogonal sash support, for corner sashes
242
+ * - View hide/show support
243
+ * - View swap/move support
244
+ * - Alt key modifier behavior, macOS style
245
+ */
246
+ declare class SplitView<TLayoutContext = undefined, TView extends IView<TLayoutContext> = IView<TLayoutContext>> extends Disposable {
247
+ /**
248
+ * This {@link SplitView}'s orientation.
249
+ */
250
+ readonly orientation: Orientation;
251
+ /**
252
+ * The DOM element representing this {@link SplitView}.
253
+ */
254
+ readonly el: HTMLElement;
255
+ private sashContainer;
256
+ private viewContainer;
257
+ private scrollable;
258
+ private scrollableElement;
259
+ private size;
260
+ private layoutContext;
261
+ private _contentSize;
262
+ private proportions;
263
+ private viewItems;
264
+ sashItems: ISashItem[];
265
+ private sashDragState;
266
+ private state;
267
+ private inverseAltBehavior;
268
+ private proportionalLayout;
269
+ private readonly getSashOrthogonalSize;
270
+ private _onDidSashChange;
271
+ private _onDidSashReset;
272
+ private _orthogonalStartSash;
273
+ private _orthogonalEndSash;
274
+ private _startSnappingEnabled;
275
+ private _endSnappingEnabled;
276
+ /**
277
+ * The sum of all views' sizes.
278
+ */
279
+ get contentSize(): number;
280
+ /**
281
+ * Fires whenever the user resizes a {@link Sash sash}.
282
+ */
283
+ readonly onDidSashChange: Event<number>;
284
+ /**
285
+ * Fires whenever the user double clicks a {@link Sash sash}.
286
+ */
287
+ readonly onDidSashReset: Event<number>;
288
+ /**
289
+ * Fires whenever the split view is scrolled.
290
+ */
291
+ readonly onDidScroll: Event<ScrollEvent>;
292
+ /**
293
+ * The amount of views in this {@link SplitView}.
294
+ */
295
+ get length(): number;
296
+ /**
297
+ * The minimum size of this {@link SplitView}.
298
+ */
299
+ get minimumSize(): number;
300
+ /**
301
+ * The maximum size of this {@link SplitView}.
302
+ */
303
+ get maximumSize(): number;
304
+ get orthogonalStartSash(): Sash | undefined;
305
+ get orthogonalEndSash(): Sash | undefined;
306
+ get startSnappingEnabled(): boolean;
307
+ get endSnappingEnabled(): boolean;
308
+ /**
309
+ * A reference to a sash, perpendicular to all sashes in this {@link SplitView},
310
+ * located at the left- or top-most side of the SplitView.
311
+ * Corner sashes will be created automatically at the intersections.
312
+ */
313
+ set orthogonalStartSash(sash: Sash | undefined);
314
+ /**
315
+ * A reference to a sash, perpendicular to all sashes in this {@link SplitView},
316
+ * located at the right- or bottom-most side of the SplitView.
317
+ * Corner sashes will be created automatically at the intersections.
318
+ */
319
+ set orthogonalEndSash(sash: Sash | undefined);
320
+ /**
321
+ * The internal sashes within this {@link SplitView}.
322
+ */
323
+ get sashes(): readonly Sash[];
324
+ /**
325
+ * Enable/disable snapping at the beginning of this {@link SplitView}.
326
+ */
327
+ set startSnappingEnabled(startSnappingEnabled: boolean);
328
+ /**
329
+ * Enable/disable snapping at the end of this {@link SplitView}.
330
+ */
331
+ set endSnappingEnabled(endSnappingEnabled: boolean);
332
+ /**
333
+ * Create a new {@link SplitView} instance.
334
+ */
335
+ constructor(container: HTMLElement, options?: ISplitViewOptions<TLayoutContext, TView>);
336
+ style(styles: ISplitViewStyles): void;
337
+ /**
338
+ * Add a {@link IView view} to this {@link SplitView}.
339
+ *
340
+ * @param view The view to add.
341
+ * @param size Either a fixed size, or a dynamic {@link Sizing} strategy.
342
+ * @param index The index to insert the view on.
343
+ * @param skipLayout Whether layout should be skipped.
344
+ */
345
+ addView(view: TView, size: number | Sizing, index?: number, skipLayout?: boolean): void;
346
+ /**
347
+ * Remove a {@link IView view} from this {@link SplitView}.
348
+ *
349
+ * @param index The index where the {@link IView view} is located.
350
+ * @param sizing Whether to distribute other {@link IView view}'s sizes.
351
+ */
352
+ removeView(index: number, sizing?: Sizing): TView;
353
+ removeAllViews(): TView[];
354
+ /**
355
+ * Move a {@link IView view} to a different index.
356
+ *
357
+ * @param from The source index.
358
+ * @param to The target index.
359
+ */
360
+ moveView(from: number, to: number): void;
361
+ /**
362
+ * Swap two {@link IView views}.
363
+ *
364
+ * @param from The source index.
365
+ * @param to The target index.
366
+ */
367
+ swapViews(from: number, to: number): void;
368
+ /**
369
+ * Returns whether the {@link IView view} is visible.
370
+ *
371
+ * @param index The {@link IView view} index.
372
+ */
373
+ isViewVisible(index: number): boolean;
374
+ /**
375
+ * Set a {@link IView view}'s visibility.
376
+ *
377
+ * @param index The {@link IView view} index.
378
+ * @param visible Whether the {@link IView view} should be visible.
379
+ */
380
+ setViewVisible(index: number, visible: boolean): void;
381
+ /**
382
+ * Returns the {@link IView view}'s size previously to being hidden.
383
+ *
384
+ * @param index The {@link IView view} index.
385
+ */
386
+ getViewCachedVisibleSize(index: number): number | undefined;
387
+ /**
388
+ * Layout the {@link SplitView}.
389
+ *
390
+ * @param size The entire size of the {@link SplitView}.
391
+ * @param layoutContext An optional layout context to pass along to {@link IView views}.
392
+ */
393
+ layout(size: number, layoutContext?: TLayoutContext): void;
394
+ private saveProportions;
395
+ private onSashStart;
396
+ private onSashChange;
397
+ private onSashEnd;
398
+ private onViewChange;
399
+ /**
400
+ * Resize a {@link IView view} within the {@link SplitView}.
401
+ *
402
+ * @param index The {@link IView view} index.
403
+ * @param size The {@link IView view} size.
404
+ */
405
+ resizeView(index: number, size: number): void;
406
+ /**
407
+ * Returns whether all other {@link IView views} are at their minimum size.
408
+ */
409
+ isViewExpanded(index: number): boolean;
410
+ /**
411
+ * Distribute the entire {@link SplitView} size among all {@link IView views}.
412
+ */
413
+ distributeViewSizes(): void;
414
+ /**
415
+ * Returns the size of a {@link IView view}.
416
+ */
417
+ getViewSize(index: number): number;
418
+ private doAddView;
419
+ private relayout;
420
+ private resize;
421
+ private distributeEmptySpace;
422
+ private layoutViews;
423
+ private updateScrollableElement;
424
+ private updateSashEnablement;
425
+ private getSashPosition;
426
+ private findFirstSnapIndex;
427
+ private areViewsDistributed;
428
+ dispose(): void;
429
+ }
83
430
 
84
- export { type IView, LayoutPriority };
431
+ export { type AutoSizing, type DistributeSizing, type ISplitViewDescriptor, type ISplitViewOptions, type ISplitViewStyles, type IView, type InvisibleSizing, LayoutPriority, Orientation, Sizing, type SplitSizing, SplitView };
@@ -1,10 +1,11 @@
1
1
  import { CancellationTokenSource } from './cancellation.js';
2
- import { CancellationError } from './errors.js';
2
+ import { CancellationError, BugIndicatingError } from './errors.js';
3
3
  import { Emitter, Event } from './event.js';
4
4
  import { toDisposable, DisposableMap } from './lifecycle.js';
5
5
  import { extUri } from './resources.js';
6
6
  import { setTimeout0 } from './platform.js';
7
7
  import { MicrotaskDelay } from './symbols.js';
8
+ import { Lazy } from './lazy.js';
8
9
  function isThenable(obj) {
9
10
  return !!obj && typeof obj.then === 'function';
10
11
  }
@@ -865,6 +866,49 @@ var Promises;
865
866
  }
866
867
  Promises.withAsyncBody = withAsyncBody;
867
868
  })(Promises || (Promises = {})));
869
+ class StatefulPromise {
870
+ get value() { return this._value; }
871
+ get error() { return this._error; }
872
+ get isResolved() { return this._isResolved; }
873
+ constructor(promise) {
874
+ this._value = undefined;
875
+ this._error = undefined;
876
+ this._isResolved = false;
877
+ this.promise = promise.then(value => {
878
+ this._value = value;
879
+ this._isResolved = true;
880
+ return value;
881
+ }, error => {
882
+ this._error = error;
883
+ this._isResolved = true;
884
+ throw error;
885
+ });
886
+ }
887
+ requireValue() {
888
+ if (!this._isResolved) {
889
+ throw new BugIndicatingError('Promise is not resolved yet');
890
+ }
891
+ if (this._error) {
892
+ throw this._error;
893
+ }
894
+ return this._value;
895
+ }
896
+ }
897
+ class LazyStatefulPromise {
898
+ constructor(_compute) {
899
+ this._compute = _compute;
900
+ this._promise = ( new Lazy(() => ( new StatefulPromise(this._compute()))));
901
+ }
902
+ requireValue() {
903
+ return this._promise.value.requireValue();
904
+ }
905
+ getPromise() {
906
+ return this._promise.value.promise;
907
+ }
908
+ get currentValue() {
909
+ return this._promise.rawValue?.value;
910
+ }
911
+ }
868
912
  class AsyncIterableObject {
869
913
  static fromArray(items) {
870
914
  return ( new AsyncIterableObject((writer) => {
@@ -1081,4 +1125,4 @@ class AsyncIterableSource {
1081
1125
  this._emitFn(item);
1082
1126
  }
1083
1127
  }
1084
- export { AbstractIdleValue, AsyncIterableObject, AsyncIterableSource, AutoOpenBarrier, Barrier, CancelableAsyncIterableObject, DeferredPromise, Delayer, GlobalIdleValue, IntervalCounter, IntervalTimer, Limiter, Promises, Queue, ResourceQueue, RunOnceScheduler, RunOnceWorker, Sequencer, SequencerByKey, TaskSequentializer, ThrottledDelayer, Throttler, TimeoutTimer, _runWhenIdle, asPromise, createCancelableAsyncIterable, createCancelablePromise, disposableTimeout, first, isThenable, raceCancellablePromises, raceCancellation, raceCancellationError, raceTimeout, retry, runWhenGlobalIdle, sequence, timeout };
1128
+ export { AbstractIdleValue, AsyncIterableObject, AsyncIterableSource, AutoOpenBarrier, Barrier, CancelableAsyncIterableObject, DeferredPromise, Delayer, GlobalIdleValue, IntervalCounter, IntervalTimer, LazyStatefulPromise, Limiter, Promises, Queue, ResourceQueue, RunOnceScheduler, RunOnceWorker, Sequencer, SequencerByKey, StatefulPromise, TaskSequentializer, ThrottledDelayer, Throttler, TimeoutTimer, _runWhenIdle, asPromise, createCancelableAsyncIterable, createCancelablePromise, disposableTimeout, first, isThenable, raceCancellablePromises, raceCancellation, raceCancellationError, raceTimeout, retry, runWhenGlobalIdle, sequence, timeout };