monaco-editor-core 0.57.0 → 0.58.0-dev-20261104
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/esm/nls.keys.json +1 -1
- package/esm/nls.messages.cs.js +2 -2
- package/esm/nls.messages.de.js +2 -2
- package/esm/nls.messages.es.js +2 -2
- package/esm/nls.messages.fr.js +2 -2
- package/esm/nls.messages.it.js +2 -2
- package/esm/nls.messages.ja.js +2 -2
- package/esm/nls.messages.js +1 -1
- package/esm/nls.messages.json +1 -1
- package/esm/nls.messages.ko.js +2 -2
- package/esm/nls.messages.pl.js +2 -2
- package/esm/nls.messages.pt-br.js +2 -2
- package/esm/nls.messages.ru.js +2 -2
- package/esm/nls.messages.tr.js +2 -2
- package/esm/nls.messages.zh-cn.js +2 -2
- package/esm/nls.messages.zh-tw.js +2 -2
- package/esm/nls.metadata.json +38 -6
- package/esm/vs/base/browser/browser.js +8 -0
- package/esm/vs/base/browser/browser.js.map +1 -1
- package/esm/vs/base/browser/contextmenu.js +8 -1
- package/esm/vs/base/browser/contextmenu.js.map +1 -1
- package/esm/vs/base/browser/dom.js +34 -5
- package/esm/vs/base/browser/dom.js.map +1 -1
- package/esm/vs/base/browser/dompurify/dompurify.js +2457 -2640
- package/esm/vs/base/browser/markdownRenderer.js +48 -21
- package/esm/vs/base/browser/markdownRenderer.js.map +1 -1
- package/esm/vs/base/browser/pixelRatio.js +3 -2
- package/esm/vs/base/browser/pixelRatio.js.map +1 -1
- package/esm/vs/base/browser/ui/actionbar/actionViewItems.js +5 -2
- package/esm/vs/base/browser/ui/actionbar/actionViewItems.js.map +1 -1
- package/esm/vs/base/browser/ui/actionbar/actionbar.js +7 -2
- package/esm/vs/base/browser/ui/actionbar/actionbar.js.map +1 -1
- package/esm/vs/base/browser/ui/animations/animations.js +68 -40
- package/esm/vs/base/browser/ui/animations/animations.js.map +1 -1
- package/esm/vs/base/browser/ui/button/button.js +7 -0
- package/esm/vs/base/browser/ui/button/button.js.map +1 -1
- package/esm/vs/base/browser/ui/codicons/codicon/codicon.ttf +0 -0
- package/esm/vs/base/browser/ui/contextview/contextview.css +15 -0
- package/esm/vs/base/browser/ui/contextview/contextview.js +266 -40
- package/esm/vs/base/browser/ui/contextview/contextview.js.map +1 -1
- package/esm/vs/base/browser/ui/contextview/windowControlsOverlay.js +72 -0
- package/esm/vs/base/browser/ui/contextview/windowControlsOverlay.js.map +1 -0
- package/esm/vs/base/browser/ui/dialog/dialog.css +5 -0
- package/esm/vs/base/browser/ui/dropdown/dropdown.js +2 -1
- package/esm/vs/base/browser/ui/dropdown/dropdown.js.map +1 -1
- package/esm/vs/base/browser/ui/dropdown/dropdownActionViewItem.js +1 -0
- package/esm/vs/base/browser/ui/dropdown/dropdownActionViewItem.js.map +1 -1
- package/esm/vs/base/browser/ui/hover/hover.js.map +1 -1
- package/esm/vs/base/browser/ui/list/listView.js +87 -15
- package/esm/vs/base/browser/ui/list/listView.js.map +1 -1
- package/esm/vs/base/browser/ui/list/listWidget.js +37 -15
- package/esm/vs/base/browser/ui/list/listWidget.js.map +1 -1
- package/esm/vs/base/browser/ui/menu/menu.js +189 -52
- package/esm/vs/base/browser/ui/menu/menu.js.map +1 -1
- package/esm/vs/base/browser/ui/radio/radio.css +11 -0
- package/esm/vs/base/browser/ui/scrollbar/scrollableElement.js +2 -1
- package/esm/vs/base/browser/ui/scrollbar/scrollableElement.js.map +1 -1
- package/esm/vs/base/browser/ui/selectBox/selectBox.js.map +1 -1
- package/esm/vs/base/browser/ui/selectBox/selectBoxCustom.js +14 -8
- package/esm/vs/base/browser/ui/selectBox/selectBoxCustom.js.map +1 -1
- package/esm/vs/base/browser/ui/splitview/splitview.js +11 -7
- package/esm/vs/base/browser/ui/splitview/splitview.js.map +1 -1
- package/esm/vs/base/browser/ui/toggle/switch.css +16 -7
- package/esm/vs/base/browser/ui/toggle/switch.js +9 -6
- package/esm/vs/base/browser/ui/toggle/switch.js.map +1 -1
- package/esm/vs/base/browser/ui/toolbar/toolbar.css +1 -2
- package/esm/vs/base/browser/ui/toolbar/toolbar.js +85 -38
- package/esm/vs/base/browser/ui/toolbar/toolbar.js.map +1 -1
- package/esm/vs/base/browser/ui/tree/abstractTree.js +48 -9
- package/esm/vs/base/browser/ui/tree/abstractTree.js.map +1 -1
- package/esm/vs/base/browser/ui/tree/asyncDataTree.js +10 -1
- package/esm/vs/base/browser/ui/tree/asyncDataTree.js.map +1 -1
- package/esm/vs/base/browser/ui/tree/objectTree.js +3 -0
- package/esm/vs/base/browser/ui/tree/objectTree.js.map +1 -1
- package/esm/vs/base/browser/ui/tree/tree.js.map +1 -1
- package/esm/vs/base/common/actions.js +8 -2
- package/esm/vs/base/common/actions.js.map +1 -1
- package/esm/vs/base/common/arrays.js +4 -4
- package/esm/vs/base/common/arrays.js.map +1 -1
- package/esm/vs/base/common/async.js +12 -8
- package/esm/vs/base/common/async.js.map +1 -1
- package/esm/vs/base/common/cancellation.js +25 -0
- package/esm/vs/base/common/cancellation.js.map +1 -1
- package/esm/vs/base/common/codicons.js +2 -0
- package/esm/vs/base/common/codicons.js.map +1 -1
- package/esm/vs/base/common/codiconsLibrary.js +2 -0
- package/esm/vs/base/common/codiconsLibrary.js.map +1 -1
- package/esm/vs/base/common/color.js +1 -1
- package/esm/vs/base/common/color.js.map +1 -1
- package/esm/vs/base/common/diff/diff.js +60 -1
- package/esm/vs/base/common/diff/diff.js.map +1 -1
- package/esm/vs/base/common/event.js +1 -1
- package/esm/vs/base/common/event.js.map +1 -1
- package/esm/vs/base/common/glob.js +1 -0
- package/esm/vs/base/common/glob.js.map +1 -1
- package/esm/vs/base/common/htmlContent.js +74 -12
- package/esm/vs/base/common/htmlContent.js.map +1 -1
- package/esm/vs/base/common/json.js +19 -0
- package/esm/vs/base/common/json.js.map +1 -0
- package/esm/vs/base/common/network.js +16 -0
- package/esm/vs/base/common/network.js.map +1 -1
- package/esm/vs/base/common/resources.js +14 -2
- package/esm/vs/base/common/resources.js.map +1 -1
- package/esm/vs/base/common/strings.js +1 -1
- package/esm/vs/base/common/strings.js.map +1 -1
- package/esm/vs/base/common/uri.js +2 -2
- package/esm/vs/base/common/uri.js.map +1 -1
- package/esm/vs/editor/browser/config/editorConfiguration.js +1 -1
- package/esm/vs/editor/browser/config/fontMeasurements.js +19 -6
- package/esm/vs/editor/browser/config/fontMeasurements.js.map +1 -1
- package/esm/vs/editor/browser/controller/dragScrolling.js +3 -3
- package/esm/vs/editor/browser/controller/editContext/clipboardUtils.js +11 -5
- package/esm/vs/editor/browser/controller/editContext/clipboardUtils.js.map +1 -1
- package/esm/vs/editor/browser/controller/editContext/native/nativeEditContext.js +8 -38
- package/esm/vs/editor/browser/controller/editContext/native/nativeEditContext.js.map +1 -1
- package/esm/vs/editor/browser/controller/editContext/native/screenReaderContentRich.js +3 -3
- package/esm/vs/editor/browser/controller/editContext/native/screenReaderSupport.js +6 -6
- package/esm/vs/editor/browser/controller/editContext/textArea/textAreaEditContext.js +12 -10
- package/esm/vs/editor/browser/controller/editContext/textArea/textAreaEditContext.js.map +1 -1
- package/esm/vs/editor/browser/controller/mouseHandler.js +7 -7
- package/esm/vs/editor/browser/controller/mouseTarget.js +3 -3
- package/esm/vs/editor/browser/coreCommands.js +2 -2
- package/esm/vs/editor/browser/editorBrowser.js.map +1 -1
- package/esm/vs/editor/browser/editorMarkdownSanitizer.js +19 -0
- package/esm/vs/editor/browser/editorMarkdownSanitizer.js.map +1 -0
- package/esm/vs/editor/browser/gpu/rectangleRenderer.js +1 -1
- package/esm/vs/editor/browser/gpu/viewGpuContext.js +1 -1
- package/esm/vs/editor/browser/observableCodeEditor.js +1 -1
- package/esm/vs/editor/browser/services/editorWorkerService.js +3 -2
- package/esm/vs/editor/browser/services/editorWorkerService.js.map +1 -1
- package/esm/vs/editor/browser/services/openerService.js +6 -2
- package/esm/vs/editor/browser/services/openerService.js.map +1 -1
- package/esm/vs/editor/browser/view/domLineBreaksComputer.js +34 -11
- package/esm/vs/editor/browser/view/domLineBreaksComputer.js.map +1 -1
- package/esm/vs/editor/browser/view/viewController.js +7 -7
- package/esm/vs/editor/browser/view/viewController.js.map +1 -1
- package/esm/vs/editor/browser/view/viewLayer.js +1 -1
- package/esm/vs/editor/browser/view/viewOverlays.js +4 -4
- package/esm/vs/editor/browser/view.js +5 -5
- package/esm/vs/editor/browser/viewParts/blockDecorations/blockDecorations.js +1 -1
- package/esm/vs/editor/browser/viewParts/contentWidgets/contentWidgets.js +11 -3
- package/esm/vs/editor/browser/viewParts/contentWidgets/contentWidgets.js.map +1 -1
- package/esm/vs/editor/browser/viewParts/currentLineHighlight/currentLineHighlight.js +6 -6
- package/esm/vs/editor/browser/viewParts/editorScrollbar/editorScrollbar.js +12 -12
- package/esm/vs/editor/browser/viewParts/glyphMargin/glyphMargin.js +9 -2
- package/esm/vs/editor/browser/viewParts/glyphMargin/glyphMargin.js.map +1 -1
- package/esm/vs/editor/browser/viewParts/indentGuides/indentGuides.js +2 -2
- package/esm/vs/editor/browser/viewParts/lineNumbers/lineNumbers.js +2 -2
- package/esm/vs/editor/browser/viewParts/linesDecorations/linesDecorations.js +2 -2
- package/esm/vs/editor/browser/viewParts/margin/margin.js +2 -2
- package/esm/vs/editor/browser/viewParts/minimap/minimap.js +6 -6
- package/esm/vs/editor/browser/viewParts/overlayWidgets/overlayWidgets.js +9 -2
- package/esm/vs/editor/browser/viewParts/overlayWidgets/overlayWidgets.js.map +1 -1
- package/esm/vs/editor/browser/viewParts/overviewRuler/decorationsOverviewRuler.js +5 -5
- package/esm/vs/editor/browser/viewParts/overviewRuler/overviewRuler.js +3 -3
- package/esm/vs/editor/browser/viewParts/rulers/rulers.js +2 -2
- package/esm/vs/editor/browser/viewParts/rulersGpu/rulersGpu.js +1 -1
- package/esm/vs/editor/browser/viewParts/scrollDecoration/scrollDecoration.js +3 -3
- package/esm/vs/editor/browser/viewParts/selections/selections.js +2 -2
- package/esm/vs/editor/browser/viewParts/viewCursors/viewCursor.js +2 -2
- package/esm/vs/editor/browser/viewParts/viewCursors/viewCursors.js +6 -6
- package/esm/vs/editor/browser/viewParts/viewLines/viewLineOptions.js +5 -5
- package/esm/vs/editor/browser/viewParts/viewLines/viewLines.js +11 -11
- package/esm/vs/editor/browser/viewParts/viewLinesGpu/viewLinesGpu.js +1 -1
- package/esm/vs/editor/browser/viewParts/viewZones/viewZones.js +2 -2
- package/esm/vs/editor/browser/viewParts/whitespace/whitespace.js +4 -4
- package/esm/vs/editor/browser/viewParts/wordWrapIndicator/wordWrapIndicator.js +2 -2
- package/esm/vs/editor/browser/widget/codeEditor/codeEditorWidget.js +22 -21
- package/esm/vs/editor/browser/widget/codeEditor/codeEditorWidget.js.map +1 -1
- package/esm/vs/editor/browser/widget/diffEditor/commands.js +12 -12
- package/esm/vs/editor/browser/widget/diffEditor/components/accessibleDiffViewer.js +18 -18
- package/esm/vs/editor/browser/widget/diffEditor/components/diffEditorEditors.js +1 -1
- package/esm/vs/editor/browser/widget/diffEditor/components/diffEditorViewZones/diffEditorViewZones.js +3 -3
- package/esm/vs/editor/browser/widget/diffEditor/components/diffEditorViewZones/inlineDiffDeletedCodeMargin.js +10 -10
- package/esm/vs/editor/browser/widget/diffEditor/components/diffEditorViewZones/inlineDiffDeletedCodeMargin.js.map +1 -1
- package/esm/vs/editor/browser/widget/diffEditor/components/diffEditorViewZones/renderLines.js +2 -2
- package/esm/vs/editor/browser/widget/diffEditor/diffEditor.contribution.js +4 -4
- package/esm/vs/editor/browser/widget/diffEditor/diffProviderFactoryService.js +21 -3
- package/esm/vs/editor/browser/widget/diffEditor/diffProviderFactoryService.js.map +1 -1
- package/esm/vs/editor/browser/widget/diffEditor/features/gutterFeature.js +1 -1
- package/esm/vs/editor/browser/widget/diffEditor/features/hideUnchangedRegionsFeature.js +10 -10
- package/esm/vs/editor/browser/widget/diffEditor/features/movedBlocksLinesFeature.js +2 -2
- package/esm/vs/editor/browser/widget/diffEditor/features/overviewRulerFeature.js +1 -1
- package/esm/vs/editor/browser/widget/diffEditor/features/revertButtonsFeature.js +2 -2
- package/esm/vs/editor/browser/widget/diffEditor/registrations.contribution.js +5 -5
- package/esm/vs/editor/browser/widget/multiDiffEditor/colors.js +3 -3
- package/esm/vs/editor/browser/widget/multiDiffEditor/compressedVirtualizedScrollLayout.js +2 -2
- package/esm/vs/editor/browser/widget/multiDiffEditor/compressedVirtualizedScrollLayout.js.map +1 -1
- package/esm/vs/editor/browser/widget/multiDiffEditor/compressedVirtualizedScrollView.js +21 -2
- package/esm/vs/editor/browser/widget/multiDiffEditor/compressedVirtualizedScrollView.js.map +1 -1
- package/esm/vs/editor/browser/widget/multiDiffEditor/diffEditorItemTemplate.js +2 -2
- package/esm/vs/editor/browser/widget/multiDiffEditor/multiDiffEditorWidgetImpl.js +11 -3
- package/esm/vs/editor/browser/widget/multiDiffEditor/multiDiffEditorWidgetImpl.js.map +1 -1
- package/esm/vs/editor/browser/widget/multiDiffEditor/virtualizedItemManager.js +1 -0
- package/esm/vs/editor/browser/widget/multiDiffEditor/virtualizedItemManager.js.map +1 -1
- package/esm/vs/editor/common/commands/columnSelectionPasteCommand.js +64 -0
- package/esm/vs/editor/common/commands/columnSelectionPasteCommand.js.map +1 -0
- package/esm/vs/editor/common/config/editorConfigurationSchema.js +68 -58
- package/esm/vs/editor/common/config/editorConfigurationSchema.js.map +1 -1
- package/esm/vs/editor/common/config/editorOptions.js +560 -500
- package/esm/vs/editor/common/config/editorOptions.js.map +1 -1
- package/esm/vs/editor/common/core/editorColorRegistry.js +71 -71
- package/esm/vs/editor/common/core/edits/textEdit.js +16 -0
- package/esm/vs/editor/common/core/edits/textEdit.js.map +1 -1
- package/esm/vs/editor/common/cursor/cursor.js +20 -10
- package/esm/vs/editor/common/cursor/cursor.js.map +1 -1
- package/esm/vs/editor/common/cursor/cursorTypeEditOperations.js +67 -14
- package/esm/vs/editor/common/cursor/cursorTypeEditOperations.js.map +1 -1
- package/esm/vs/editor/common/cursor/cursorTypeOperations.js +2 -2
- package/esm/vs/editor/common/cursor/cursorTypeOperations.js.map +1 -1
- package/esm/vs/editor/common/cursorCommon.js +22 -21
- package/esm/vs/editor/common/cursorCommon.js.map +1 -1
- package/esm/vs/editor/common/diff/defaultLinesDiffComputer/defaultLinesDiffComputer.js +21 -8
- package/esm/vs/editor/common/diff/defaultLinesDiffComputer/defaultLinesDiffComputer.js.map +1 -1
- package/esm/vs/editor/common/diff/documentDiffProvider.js.map +1 -1
- package/esm/vs/editor/common/diff/externalLinesDiffComputer.js +38 -26
- package/esm/vs/editor/common/diff/externalLinesDiffComputer.js.map +1 -1
- package/esm/vs/editor/common/diff/rangeMapping.js +11 -1
- package/esm/vs/editor/common/diff/rangeMapping.js.map +1 -1
- package/esm/vs/editor/common/diff/verifyLinesDiff.js +28 -0
- package/esm/vs/editor/common/diff/verifyLinesDiff.js.map +1 -0
- package/esm/vs/editor/common/editorContextKeys.js +53 -53
- package/esm/vs/editor/common/languages/languageConfiguration.js +8 -0
- package/esm/vs/editor/common/languages/languageConfiguration.js.map +1 -1
- package/esm/vs/editor/common/languages/modesRegistry.js +1 -1
- package/esm/vs/editor/common/languages.js +56 -56
- package/esm/vs/editor/common/model/editStack.js +1 -1
- package/esm/vs/editor/common/services/editorWebWorker.js +27 -6
- package/esm/vs/editor/common/services/editorWebWorker.js.map +1 -1
- package/esm/vs/editor/common/services/editorWorker.js.map +1 -1
- package/esm/vs/editor/common/services/languageService.js +6 -4
- package/esm/vs/editor/common/services/languageService.js.map +1 -1
- package/esm/vs/editor/common/services/markerDecorationsService.js +21 -2
- package/esm/vs/editor/common/services/markerDecorationsService.js.map +1 -1
- package/esm/vs/editor/common/standalone/standaloneEnums.js +100 -97
- package/esm/vs/editor/common/standalone/standaloneEnums.js.map +1 -1
- package/esm/vs/editor/common/standaloneStrings.js +11 -11
- package/esm/vs/editor/common/textModelEditSource.js +9 -0
- package/esm/vs/editor/common/textModelEditSource.js.map +1 -1
- package/esm/vs/editor/common/viewLayout/viewLayout.js +16 -16
- package/esm/vs/editor/common/viewLayout/viewLineRenderer.js +2 -2
- package/esm/vs/editor/common/viewModel/monospaceLineBreaksComputer.js +1 -1
- package/esm/vs/editor/common/viewModel/viewModelImpl.js +19 -19
- package/esm/vs/editor/common/viewModel/viewModelImpl.js.map +1 -1
- package/esm/vs/editor/contrib/anchorSelect/browser/anchorSelect.js +6 -6
- package/esm/vs/editor/contrib/bracketMatching/browser/bracketMatching.js +9 -9
- package/esm/vs/editor/contrib/caretOperations/browser/caretOperations.js +2 -2
- package/esm/vs/editor/contrib/caretOperations/browser/transpose.js +1 -1
- package/esm/vs/editor/contrib/clipboard/browser/clipboard.js +23 -20
- package/esm/vs/editor/contrib/clipboard/browser/clipboard.js.map +1 -1
- package/esm/vs/editor/contrib/codeAction/browser/codeAction.js +1 -1
- package/esm/vs/editor/contrib/codeAction/browser/codeActionCommands.js +29 -29
- package/esm/vs/editor/contrib/codeAction/browser/codeActionContributions.js +3 -3
- package/esm/vs/editor/contrib/codeAction/browser/codeActionController.js +3 -3
- package/esm/vs/editor/contrib/codeAction/browser/codeActionMenu.js +8 -8
- package/esm/vs/editor/contrib/codeAction/browser/codeActionModel.js +1 -1
- package/esm/vs/editor/contrib/codeAction/browser/lightBulbWidget.js +9 -9
- package/esm/vs/editor/contrib/codelens/browser/codelensController.js +2 -2
- package/esm/vs/editor/contrib/colorPicker/browser/colorDetector.js +25 -10
- package/esm/vs/editor/contrib/colorPicker/browser/colorDetector.js.map +1 -1
- package/esm/vs/editor/contrib/colorPicker/browser/colorPickerParts/colorPickerCloseButton.js +1 -1
- package/esm/vs/editor/contrib/colorPicker/browser/colorPickerParts/colorPickerHeader.js +1 -1
- package/esm/vs/editor/contrib/colorPicker/browser/hoverColorPicker/hoverColorPickerContribution.js +1 -1
- package/esm/vs/editor/contrib/colorPicker/browser/hoverColorPicker/hoverColorPickerParticipant.js +3 -3
- package/esm/vs/editor/contrib/colorPicker/browser/standaloneColorPicker/standaloneColorPickerActions.js +7 -7
- package/esm/vs/editor/contrib/colorPicker/browser/standaloneColorPicker/standaloneColorPickerParticipant.js +1 -1
- package/esm/vs/editor/contrib/comment/browser/comment.js +6 -6
- package/esm/vs/editor/contrib/contextmenu/browser/contextmenu.js +17 -17
- package/esm/vs/editor/contrib/contextmenu/browser/contextmenu.js.map +1 -1
- package/esm/vs/editor/contrib/cursorUndo/browser/cursorUndo.js +2 -2
- package/esm/vs/editor/contrib/dropOrPasteInto/browser/copyPasteContribution.js +4 -4
- package/esm/vs/editor/contrib/dropOrPasteInto/browser/copyPasteController.js +39 -39
- package/esm/vs/editor/contrib/dropOrPasteInto/browser/copyPasteController.js.map +1 -1
- package/esm/vs/editor/contrib/dropOrPasteInto/browser/defaultProviders.js +8 -8
- package/esm/vs/editor/contrib/dropOrPasteInto/browser/dropIntoEditorController.js +3 -3
- package/esm/vs/editor/contrib/dropOrPasteInto/browser/pasteEditSession.js +19 -0
- package/esm/vs/editor/contrib/dropOrPasteInto/browser/pasteEditSession.js.map +1 -0
- package/esm/vs/editor/contrib/dropOrPasteInto/browser/postEditWidget.js +26 -18
- package/esm/vs/editor/contrib/dropOrPasteInto/browser/postEditWidget.js.map +1 -1
- package/esm/vs/editor/contrib/editorState/browser/keybindingCancellation.js +1 -1
- package/esm/vs/editor/contrib/editorState/browser/keybindingCancellation.js.map +1 -1
- package/esm/vs/editor/contrib/find/browser/findController.js +18 -18
- package/esm/vs/editor/contrib/find/browser/findController.js.map +1 -1
- package/esm/vs/editor/contrib/find/browser/findModel.js +6 -6
- package/esm/vs/editor/contrib/find/browser/findWidget.js +40 -40
- package/esm/vs/editor/contrib/find/browser/findWidget.js.map +1 -1
- package/esm/vs/editor/contrib/folding/browser/folding.js +23 -23
- package/esm/vs/editor/contrib/folding/browser/foldingDecorations.js +9 -9
- package/esm/vs/editor/contrib/fontZoom/browser/fontZoom.js +3 -3
- package/esm/vs/editor/contrib/format/browser/formatActions.js +2 -2
- package/esm/vs/editor/contrib/gotoError/browser/gotoError.js +8 -8
- package/esm/vs/editor/contrib/gotoError/browser/gotoErrorWidget.js +14 -14
- package/esm/vs/editor/contrib/gotoSymbol/browser/goToCommands.js +39 -39
- package/esm/vs/editor/contrib/gotoSymbol/browser/link/clickLinkGesture.js +3 -3
- package/esm/vs/editor/contrib/gotoSymbol/browser/link/goToDefinitionAtPosition.js +2 -2
- package/esm/vs/editor/contrib/gotoSymbol/browser/peek/referencesController.js +4 -4
- package/esm/vs/editor/contrib/gotoSymbol/browser/peek/referencesController.js.map +1 -1
- package/esm/vs/editor/contrib/gotoSymbol/browser/peek/referencesTree.js +3 -3
- package/esm/vs/editor/contrib/gotoSymbol/browser/peek/referencesWidget.js +3 -3
- package/esm/vs/editor/contrib/gotoSymbol/browser/referencesModel.js +8 -8
- package/esm/vs/editor/contrib/gotoSymbol/browser/symbolNavigation.js +3 -3
- package/esm/vs/editor/contrib/gpu/browser/gpuActions.js +4 -4
- package/esm/vs/editor/contrib/hover/browser/contentHoverController.js +9 -3
- package/esm/vs/editor/contrib/hover/browser/contentHoverController.js.map +1 -1
- package/esm/vs/editor/contrib/hover/browser/glyphHoverController.js +2 -2
- package/esm/vs/editor/contrib/hover/browser/glyphHoverWidget.js +2 -1
- package/esm/vs/editor/contrib/hover/browser/glyphHoverWidget.js.map +1 -1
- package/esm/vs/editor/contrib/hover/browser/hoverActionIds.js +2 -2
- package/esm/vs/editor/contrib/hover/browser/hoverActions.js +24 -24
- package/esm/vs/editor/contrib/hover/browser/hoverCopyButton.js +2 -2
- package/esm/vs/editor/contrib/hover/browser/markdownHoverParticipant.js +10 -8
- package/esm/vs/editor/contrib/hover/browser/markdownHoverParticipant.js.map +1 -1
- package/esm/vs/editor/contrib/hover/browser/markerHoverParticipant.js +6 -6
- package/esm/vs/editor/contrib/inPlaceReplace/browser/inPlaceReplace.js +2 -2
- package/esm/vs/editor/contrib/indentation/browser/indentation.js +20 -20
- package/esm/vs/editor/contrib/inlayHints/browser/inlayHintsController.js +5 -5
- package/esm/vs/editor/contrib/inlayHints/browser/inlayHintsHover.js +9 -9
- package/esm/vs/editor/contrib/inlayHints/browser/inlayHintsLocations.js +3 -3
- package/esm/vs/editor/contrib/inlayHints/browser/inlayHintsLocations.js.map +1 -1
- package/esm/vs/editor/contrib/inlineCompletions/browser/controller/commands.js +21 -21
- package/esm/vs/editor/contrib/inlineCompletions/browser/controller/inlineCompletionContextKeys.js +13 -13
- package/esm/vs/editor/contrib/inlineCompletions/browser/controller/inlineCompletionsController.js +7 -7
- package/esm/vs/editor/contrib/inlineCompletions/browser/hintsWidget/hoverParticipant.js +2 -2
- package/esm/vs/editor/contrib/inlineCompletions/browser/hintsWidget/inlineCompletionsHintsWidget.js +6 -5
- package/esm/vs/editor/contrib/inlineCompletions/browser/hintsWidget/inlineCompletionsHintsWidget.js.map +1 -1
- package/esm/vs/editor/contrib/inlineCompletions/browser/model/inlineCompletionsModel.js +1 -1
- package/esm/vs/editor/contrib/inlineCompletions/browser/model/renameSymbolProcessor.js +2 -2
- package/esm/vs/editor/contrib/inlineCompletions/browser/view/ghostText/ghostTextView.js +7 -7
- package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/components/gutterIndicatorMenu.js +6 -6
- package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/components/gutterIndicatorView.js +1 -1
- package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsViews/inlineEditsWordReplacementView.js +3 -3
- package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/theme.js +20 -20
- package/esm/vs/editor/contrib/insertFinalNewLine/browser/insertFinalNewLine.js +1 -1
- package/esm/vs/editor/contrib/lineSelection/browser/lineSelection.js +1 -1
- package/esm/vs/editor/contrib/linesOperations/browser/linesOperations.js +32 -32
- package/esm/vs/editor/contrib/linkedEditing/browser/linkedEditing.js +5 -4
- package/esm/vs/editor/contrib/linkedEditing/browser/linkedEditing.js.map +1 -1
- package/esm/vs/editor/contrib/links/browser/links.js +16 -15
- package/esm/vs/editor/contrib/links/browser/links.js.map +1 -1
- package/esm/vs/editor/contrib/longLinesHelper/browser/longLinesHelper.js +1 -1
- package/esm/vs/editor/contrib/message/browser/messageController.js +16 -12
- package/esm/vs/editor/contrib/message/browser/messageController.js.map +1 -1
- package/esm/vs/editor/contrib/middleScroll/browser/middleScrollController.js +1 -1
- package/esm/vs/editor/contrib/multicursor/browser/multicursor.js +91 -55
- package/esm/vs/editor/contrib/multicursor/browser/multicursor.js.map +1 -1
- package/esm/vs/editor/contrib/parameterHints/browser/parameterHints.js +1 -1
- package/esm/vs/editor/contrib/parameterHints/browser/parameterHintsModel.js +3 -3
- package/esm/vs/editor/contrib/parameterHints/browser/parameterHintsModel.js.map +1 -1
- package/esm/vs/editor/contrib/parameterHints/browser/parameterHintsWidget.js +6 -4
- package/esm/vs/editor/contrib/parameterHints/browser/parameterHintsWidget.js.map +1 -1
- package/esm/vs/editor/contrib/peekView/browser/peekView.js +18 -18
- package/esm/vs/editor/contrib/placeholderText/browser/placeholderText.contribution.js +1 -1
- package/esm/vs/editor/contrib/placeholderText/browser/placeholderTextContribution.js +1 -1
- package/esm/vs/editor/contrib/quickAccess/browser/editorNavigationQuickAccess.js +1 -1
- package/esm/vs/editor/contrib/quickAccess/browser/gotoLineQuickAccess.js +12 -12
- package/esm/vs/editor/contrib/quickAccess/browser/gotoSymbolQuickAccess.js +32 -32
- package/esm/vs/editor/contrib/readOnlyMessage/browser/contribution.js +3 -3
- package/esm/vs/editor/contrib/rename/browser/rename.js +11 -11
- package/esm/vs/editor/contrib/rename/browser/renameWidget.js +7 -7
- package/esm/vs/editor/contrib/sectionHeaders/browser/sectionHeaders.js +6 -6
- package/esm/vs/editor/contrib/semanticTokens/browser/documentSemanticTokens.js +23 -13
- package/esm/vs/editor/contrib/semanticTokens/browser/documentSemanticTokens.js.map +1 -1
- package/esm/vs/editor/contrib/smartSelect/browser/smartSelect.js +5 -5
- package/esm/vs/editor/contrib/snippet/browser/snippetController2.js +5 -5
- package/esm/vs/editor/contrib/snippet/browser/snippetSession.js +2 -2
- package/esm/vs/editor/contrib/snippet/browser/snippetVariables.js +4 -4
- package/esm/vs/editor/contrib/stickyScroll/browser/stickyScrollActions.js +11 -11
- package/esm/vs/editor/contrib/stickyScroll/browser/stickyScrollController.js +10 -8
- package/esm/vs/editor/contrib/stickyScroll/browser/stickyScrollController.js.map +1 -1
- package/esm/vs/editor/contrib/stickyScroll/browser/stickyScrollModelProvider.js +1 -1
- package/esm/vs/editor/contrib/stickyScroll/browser/stickyScrollProvider.js +2 -2
- package/esm/vs/editor/contrib/stickyScroll/browser/stickyScrollWidget.js +6 -6
- package/esm/vs/editor/contrib/suggest/browser/suggest.js +9 -9
- package/esm/vs/editor/contrib/suggest/browser/suggestController.js +15 -15
- package/esm/vs/editor/contrib/suggest/browser/suggestInlineCompletions.js +2 -2
- package/esm/vs/editor/contrib/suggest/browser/suggestModel.js +11 -11
- package/esm/vs/editor/contrib/suggest/browser/suggestWidget.js +27 -27
- package/esm/vs/editor/contrib/suggest/browser/suggestWidgetDetails.js +8 -6
- package/esm/vs/editor/contrib/suggest/browser/suggestWidgetDetails.js.map +1 -1
- package/esm/vs/editor/contrib/suggest/browser/suggestWidgetRenderer.js +5 -5
- package/esm/vs/editor/contrib/suggest/browser/wordContextKey.js +3 -3
- package/esm/vs/editor/contrib/suggest/browser/wordDistance.js +1 -1
- package/esm/vs/editor/contrib/symbolIcons/browser/symbolIcons.js +33 -33
- package/esm/vs/editor/contrib/toggleTabFocusMode/browser/toggleTabFocusMode.js +4 -4
- package/esm/vs/editor/contrib/tokenization/browser/tokenization.js +1 -1
- package/esm/vs/editor/contrib/unicodeHighlighter/browser/bannerController.js +1 -1
- package/esm/vs/editor/contrib/unicodeHighlighter/browser/unicodeHighlighter.js +27 -27
- package/esm/vs/editor/contrib/unusualLineTerminators/browser/unusualLineTerminators.js +9 -9
- package/esm/vs/editor/contrib/wordHighlighter/browser/highlightDecorations.js +9 -9
- package/esm/vs/editor/contrib/wordHighlighter/browser/textualHighlightProvider.js +1 -1
- package/esm/vs/editor/contrib/wordHighlighter/browser/textualHighlightProvider.js.map +1 -1
- package/esm/vs/editor/contrib/wordHighlighter/browser/wordHighlighter.js +50 -14
- package/esm/vs/editor/contrib/wordHighlighter/browser/wordHighlighter.js.map +1 -1
- package/esm/vs/editor/contrib/wordOperations/browser/wordOperations.js +6 -6
- package/esm/vs/editor/editor.api.d.ts +133 -98
- package/esm/vs/editor/standalone/browser/iPadShowKeyboard/iPadShowKeyboard.js +1 -1
- package/esm/vs/editor/standalone/browser/quickInput/standaloneQuickInputService.js +5 -3
- package/esm/vs/editor/standalone/browser/quickInput/standaloneQuickInputService.js.map +1 -1
- package/esm/vs/editor/standalone/browser/standaloneCodeEditor.js +15 -1
- package/esm/vs/editor/standalone/browser/standaloneCodeEditor.js.map +1 -1
- package/esm/vs/nls.js.map +1 -1
- package/esm/vs/platform/accessibilitySignal/browser/accessibilitySignalService.js +72 -66
- package/esm/vs/platform/accessibilitySignal/browser/accessibilitySignalService.js.map +1 -1
- package/esm/vs/platform/action/common/actionCommonCategories.js +6 -6
- package/esm/vs/platform/actionWidget/browser/actionList.js +434 -136
- package/esm/vs/platform/actionWidget/browser/actionList.js.map +1 -1
- package/esm/vs/platform/actionWidget/browser/actionWidget.css +74 -4
- package/esm/vs/platform/actionWidget/browser/actionWidget.js +24 -26
- package/esm/vs/platform/actionWidget/browser/actionWidget.js.map +1 -1
- package/esm/vs/platform/actionWidget/browser/actionWidgetMotion.js +16 -0
- package/esm/vs/platform/actionWidget/browser/actionWidgetMotion.js.map +1 -0
- package/esm/vs/platform/actions/browser/menuEntryActionViewItem.js +15 -17
- package/esm/vs/platform/actions/browser/menuEntryActionViewItem.js.map +1 -1
- package/esm/vs/platform/actions/browser/toolbar.js +25 -12
- package/esm/vs/platform/actions/browser/toolbar.js.map +1 -1
- package/esm/vs/platform/actions/common/actions.js +4 -2
- package/esm/vs/platform/actions/common/actions.js.map +1 -1
- package/esm/vs/platform/actions/common/menuService.js +15 -8
- package/esm/vs/platform/actions/common/menuService.js.map +1 -1
- package/esm/vs/platform/configuration/common/configuration.js +3 -1
- package/esm/vs/platform/configuration/common/configuration.js.map +1 -1
- package/esm/vs/platform/configuration/common/configurationModels.js +16 -11
- package/esm/vs/platform/configuration/common/configurationModels.js.map +1 -1
- package/esm/vs/platform/configuration/common/configurationRegistry.js +29 -27
- package/esm/vs/platform/configuration/common/configurationRegistry.js.map +1 -1
- package/esm/vs/platform/configuration/common/configurations.js +13 -1
- package/esm/vs/platform/configuration/common/configurations.js.map +1 -1
- package/esm/vs/platform/contextkey/browser/contextKeyService.js +2 -2
- package/esm/vs/platform/contextkey/browser/contextKeyService.js.map +1 -1
- package/esm/vs/platform/contextkey/common/contextkey.js +28 -14
- package/esm/vs/platform/contextkey/common/contextkey.js.map +1 -1
- package/esm/vs/platform/contextkey/common/contextkeys.js +10 -10
- package/esm/vs/platform/contextkey/common/scanner.js +5 -5
- package/esm/vs/platform/contextview/browser/contextMenuHandler.js +17 -4
- package/esm/vs/platform/contextview/browser/contextMenuHandler.js.map +1 -1
- package/esm/vs/platform/contextview/browser/contextMenuService.js +1 -1
- package/esm/vs/platform/contextview/browser/contextMenuService.js.map +1 -1
- package/esm/vs/platform/contextview/browser/contextView.js.map +1 -1
- package/esm/vs/platform/contextview/browser/contextViewService.js +7 -2
- package/esm/vs/platform/contextview/browser/contextViewService.js.map +1 -1
- package/esm/vs/platform/editor/common/editor.js +17 -0
- package/esm/vs/platform/editor/common/editor.js.map +1 -1
- package/esm/vs/platform/history/browser/contextScopedHistoryWidget.js +1 -1
- package/esm/vs/platform/hover/browser/hoverService.js +6 -3
- package/esm/vs/platform/hover/browser/hoverService.js.map +1 -1
- package/esm/vs/platform/hover/browser/hoverWidget.js +38 -6
- package/esm/vs/platform/hover/browser/hoverWidget.js.map +1 -1
- package/esm/vs/platform/hover/browser/updatableHoverWidget.js +32 -5
- package/esm/vs/platform/hover/browser/updatableHoverWidget.js.map +1 -1
- package/esm/vs/platform/instantiation/common/instantiationService.js +1 -1
- package/esm/vs/platform/instantiation/common/instantiationService.js.map +1 -1
- package/esm/vs/platform/keybinding/common/abstractKeybindingService.js +5 -5
- package/esm/vs/platform/keybinding/common/keybindingResolver.js +1 -1
- package/esm/vs/platform/keybinding/common/keybindingResolver.js.map +1 -1
- package/esm/vs/platform/list/browser/listService.js +27 -27
- package/esm/vs/platform/markers/common/markerService.js +11 -8
- package/esm/vs/platform/markers/common/markerService.js.map +1 -1
- package/esm/vs/platform/markers/common/markers.js +6 -6
- package/esm/vs/platform/markers/common/markers.js.map +1 -1
- package/esm/vs/platform/notification/common/notification.js.map +1 -1
- package/esm/vs/platform/notification/common/notificationMessage.js +37 -0
- package/esm/vs/platform/notification/common/notificationMessage.js.map +1 -0
- package/esm/vs/platform/opener/common/opener.js.map +1 -1
- package/esm/vs/platform/progress/common/progress.js.map +1 -1
- package/esm/vs/platform/quickinput/browser/commandsQuickAccess.js +8 -8
- package/esm/vs/platform/quickinput/browser/helpQuickAccess.js +1 -1
- package/esm/vs/platform/quickinput/browser/media/quickInput.css +33 -2
- package/esm/vs/platform/quickinput/browser/quickAccess.js +7 -4
- package/esm/vs/platform/quickinput/browser/quickAccess.js.map +1 -1
- package/esm/vs/platform/quickinput/browser/quickInput.js +10 -10
- package/esm/vs/platform/quickinput/browser/quickInputActions.js +5 -5
- package/esm/vs/platform/quickinput/browser/quickInputController.js +65 -15
- package/esm/vs/platform/quickinput/browser/quickInputController.js.map +1 -1
- package/esm/vs/platform/quickinput/browser/quickInputList.js +96 -90
- package/esm/vs/platform/quickinput/browser/quickInputList.js.map +1 -1
- package/esm/vs/platform/quickinput/browser/quickInputService.js +5 -7
- package/esm/vs/platform/quickinput/browser/quickInputService.js.map +1 -1
- package/esm/vs/platform/quickinput/browser/quickInputUtils.js +1 -1
- package/esm/vs/platform/quickinput/browser/tree/quickInputTreeAccessibilityProvider.js +1 -1
- package/esm/vs/platform/quickinput/browser/tree/quickTree.js +1 -1
- package/esm/vs/platform/quickinput/common/quickAccess.js.map +1 -1
- package/esm/vs/platform/quickinput/common/quickInput.js.map +1 -1
- package/esm/vs/platform/storage/common/storage.js.map +1 -1
- package/esm/vs/platform/theme/common/colorRegistry.js +1 -0
- package/esm/vs/platform/theme/common/colorRegistry.js.map +1 -1
- package/esm/vs/platform/theme/common/colorUtils.js +11 -3
- package/esm/vs/platform/theme/common/colorUtils.js.map +1 -1
- package/esm/vs/platform/theme/common/colors/baseColors.js +19 -19
- package/esm/vs/platform/theme/common/colors/chartsColors.js +8 -9
- package/esm/vs/platform/theme/common/colors/chartsColors.js.map +1 -1
- package/esm/vs/platform/theme/common/colors/confettiColors.js +14 -0
- package/esm/vs/platform/theme/common/colors/confettiColors.js.map +1 -0
- package/esm/vs/platform/theme/common/colors/editorColors.js +95 -95
- package/esm/vs/platform/theme/common/colors/inputColors.js +48 -48
- package/esm/vs/platform/theme/common/colors/inputColors.js.map +1 -1
- package/esm/vs/platform/theme/common/colors/listColors.js +36 -36
- package/esm/vs/platform/theme/common/colors/menuColors.js +7 -7
- package/esm/vs/platform/theme/common/colors/minimapColors.js +13 -13
- package/esm/vs/platform/theme/common/colors/minimapColors.js.map +1 -1
- package/esm/vs/platform/theme/common/colors/miscColors.js +16 -16
- package/esm/vs/platform/theme/common/colors/quickpickColors.js +10 -10
- package/esm/vs/platform/theme/common/colors/searchColors.js +3 -3
- package/esm/vs/platform/theme/common/iconRegistry.js +6 -6
- package/esm/vs/platform/undoRedo/common/undoRedoService.js +20 -20
- package/esm/vs/platform/workspace/common/workspace.js +1 -1
- package/monaco.d.ts +133 -98
- package/package.json +3 -3
- package/version.txt +1 -1
|
@@ -5,6 +5,8 @@
|
|
|
5
5
|
|
|
6
6
|
.monaco-switch {
|
|
7
7
|
position: relative;
|
|
8
|
+
/* Lets the thumb size itself from the track's inner height with `cqh`. */
|
|
9
|
+
container-type: size;
|
|
8
10
|
flex: 0 0 auto;
|
|
9
11
|
width: var(--vscode-spacing-size280);
|
|
10
12
|
height: var(--vscode-spacing-size160);
|
|
@@ -31,19 +33,26 @@
|
|
|
31
33
|
outline-offset: var(--vscode-spacing-size20);
|
|
32
34
|
}
|
|
33
35
|
|
|
36
|
+
/* The thumb fills the track's inner height and is inset by its own transparent border,
|
|
37
|
+
* so every gap around it is made of borders. Borders snap to whole device pixels, so
|
|
38
|
+
* the gaps stay equal at any display scale or zoom, where fixed offsets round unevenly.
|
|
39
|
+
* Style the thumb with `background-color`, as `background` would reset the clip. */
|
|
34
40
|
.monaco-switch-thumb {
|
|
35
41
|
position: absolute;
|
|
36
|
-
top:
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
42
|
+
top: 0;
|
|
43
|
+
bottom: 0;
|
|
44
|
+
left: 0;
|
|
45
|
+
box-sizing: border-box;
|
|
46
|
+
width: 100cqh;
|
|
47
|
+
border: var(--vscode-strokeThickness) solid transparent;
|
|
40
48
|
border-radius: var(--vscode-cornerRadius-circle);
|
|
41
|
-
background: var(--vscode-button-foreground);
|
|
42
|
-
|
|
49
|
+
background-color: var(--vscode-button-foreground);
|
|
50
|
+
background-clip: padding-box;
|
|
51
|
+
transition: left 120ms ease;
|
|
43
52
|
}
|
|
44
53
|
|
|
45
54
|
.monaco-switch.checked .monaco-switch-thumb {
|
|
46
|
-
|
|
55
|
+
left: calc(100% - 100cqh);
|
|
47
56
|
}
|
|
48
57
|
|
|
49
58
|
/* The workbench marks high contrast with `.hc-black` / `.hc-light`; `.vscode-high-contrast`
|
|
@@ -21,16 +21,19 @@ export class Switch extends Disposable {
|
|
|
21
21
|
/** Fires with the new state when the user flips the switch, not when it is set in code. */
|
|
22
22
|
this.onChange = this._onChange.event;
|
|
23
23
|
this._checked = !!options.checked;
|
|
24
|
-
|
|
24
|
+
const title = options.title === false ? undefined : options.title;
|
|
25
|
+
this._title = title ?? options.ariaLabel;
|
|
25
26
|
this.domNode = dom.$('button.monaco-switch');
|
|
26
27
|
this.domNode.type = 'button';
|
|
27
28
|
this.domNode.setAttribute('role', 'switch');
|
|
28
29
|
dom.append(this.domNode, dom.$('.monaco-switch-thumb'));
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
30
|
+
if (options.title !== false) {
|
|
31
|
+
this._register(getBaseLayerHoverDelegate().setupDelayedHover(this.domNode, () => ({
|
|
32
|
+
content: this._title,
|
|
33
|
+
style: 1 /* HoverStyle.Pointer */,
|
|
34
|
+
})));
|
|
35
|
+
}
|
|
36
|
+
this.setAriaLabel(options.ariaLabel, title);
|
|
34
37
|
this.disabled = !!options.disabled;
|
|
35
38
|
this._applyState();
|
|
36
39
|
this._register(dom.addDisposableListener(this.domNode, dom.EventType.CLICK, e => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["file:///mnt/vss/_work/1/s/dependencies/vscode/out-editor-src/vs/base/browser/ui/toggle/switch.ts","vs/base/browser/ui/toggle/switch.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;AAEhG,OAAO,KAAK,GAAG,MAAM,cAAc,CAAC;AACpC,OAAO,EAAE,OAAO,EAAS,MAAM,0BAA0B,CAAC;AAC1D,OAAO,EAAE,UAAU,EAAE,MAAM,8BAA8B,CAAC;AAE1D,OAAO,EAAE,yBAAyB,EAAE,MAAM,4BAA4B,CAAC;AACvE,OAAO,cAAc,CAAC;
|
|
1
|
+
{"version":3,"sources":["file:///mnt/vss/_work/1/s/dependencies/vscode/out-editor-src/vs/base/browser/ui/toggle/switch.ts","vs/base/browser/ui/toggle/switch.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;AAEhG,OAAO,KAAK,GAAG,MAAM,cAAc,CAAC;AACpC,OAAO,EAAE,OAAO,EAAS,MAAM,0BAA0B,CAAC;AAC1D,OAAO,EAAE,UAAU,EAAE,MAAM,8BAA8B,CAAC;AAE1D,OAAO,EAAE,yBAAyB,EAAE,MAAM,4BAA4B,CAAC;AACvE,OAAO,cAAc,CAAC;AActB;;;;;;GAMG;AACH,MAAM,OAAO,MAAO,SAAQ,UAAU;IAWrC,YAAY,OAAuB;QAClC,KAAK,EAAE,CAAC;QAVQ,cAAS,GAAG,IAAI,CAAC,SAAS,CAAC,IAAI,OAAO,EAAW,CAAC,CAAC;QACpE,2FAA2F;QAClF,aAAQ,GAAmB,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC;QASxD,IAAI,CAAC,QAAQ,GAAG,CAAC,CAAC,OAAO,CAAC,OAAO,CAAC;QAClC,MAAM,KAAK,GAAG,OAAO,CAAC,KAAK,KAAK,KAAK,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,OAAO,CAAC,KAAK,CAAC;QAClE,IAAI,CAAC,MAAM,GAAG,KAAK,IAAI,OAAO,CAAC,SAAS,CAAC;QAEzC,IAAI,CAAC,OAAO,GAAG,GAAG,CAAC,CAAC,CAAC,sBAAsB,CAAC,CAAC;QAC7C,IAAI,CAAC,OAAO,CAAC,IAAI,GAAG,QAAQ,CAAC;QAC7B,IAAI,CAAC,OAAO,CAAC,YAAY,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC;QAC5C,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,EAAE,GAAG,CAAC,CAAC,CAAC,sBAAsB,CAAC,CAAC,CAAC;QAExD,IAAI,OAAO,CAAC,KAAK,KAAK,KAAK,EAAE,CAAC;YAC7B,IAAI,CAAC,SAAS,CAAC,yBAAyB,EAAE,CAAC,iBAAiB,CAAC,IAAI,CAAC,OAAO,EAAE,GAAG,EAAE,CAAC,CAAC;gBACjF,OAAO,EAAE,IAAI,CAAC,MAAM;gBACpB,KAAK,4BAAoB;aACzB,CAAC,CAAC,CAAC,CAAC;QACN,CAAC;QAED,IAAI,CAAC,YAAY,CAAC,OAAO,CAAC,SAAS,EAAE,KAAK,CAAC,CAAC;QAC5C,IAAI,CAAC,QAAQ,GAAG,CAAC,CAAC,OAAO,CAAC,QAAQ,CAAC;QACnC,IAAI,CAAC,WAAW,EAAE,CAAC;QAEnB,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,qBAAqB,CAAC,IAAI,CAAC,OAAO,EAAE,GAAG,CAAC,SAAS,CAAC,KAAK,EAAE,CAAC,CAAC,EAAE;YAC/E,GAAG,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC,EAAE,IAAI,CAAC,CAAC;YAC9B,IAAI,IAAI,CAAC,OAAO,CAAC,QAAQ,EAAE,CAAC;gBAC3B,OAAO;YACR,CAAC;YACD,IAAI,CAAC,QAAQ,GAAG,CAAC,IAAI,CAAC,QAAQ,CAAC;YAC/B,IAAI,CAAC,WAAW,EAAE,CAAC;YACnB,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;QACpC,CAAC,CAAC,CAAC,CAAC;IACL,CAAC;IAED,IAAI,OAAO;QACV,OAAO,IAAI,CAAC,QAAQ,CAAC;IACtB,CAAC;IAED,sDAAsD;IACtD,IAAI,OAAO,CAAC,OAAgB;QAC3B,IAAI,IAAI,CAAC,QAAQ,KAAK,OAAO,EAAE,CAAC;YAC/B,IAAI,CAAC,QAAQ,GAAG,OAAO,CAAC;YACxB,IAAI,CAAC,WAAW,EAAE,CAAC;QACpB,CAAC;IACF,CAAC;IAED,IAAI,QAAQ;QACX,OAAO,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC;IAC9B,CAAC;IAED,IAAI,QAAQ,CAAC,QAAiB;QAC7B,IAAI,CAAC,OAAO,CAAC,QAAQ,GAAG,QAAQ,CAAC;IAClC,CAAC;IAED,YAAY,CAAC,SAAiB,EAAE,KAAK,GAAG,SAAS;QAChD,IAAI,CAAC,OAAO,CAAC,YAAY,CAAC,YAAY,EAAE,SAAS,CAAC,CAAC;QACnD,IAAI,CAAC,MAAM,GAAG,KAAK,CAAC;IACrB,CAAC;IAEO,WAAW;QAClB,IAAI,CAAC,OAAO,CAAC,YAAY,CAAC,cAAc,EAAE,MAAM,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC;QACjE,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC,MAAM,CAAC,SAAS,EAAE,IAAI,CAAC,QAAQ,CAAC,CAAC;IACzD,CAAC;CACD","file":"switch.js","sourceRoot":"file:///mnt/vss/_work/1/s/dependencies/vscode/out-editor-src","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\nimport * as dom from '../../dom.js';\nimport { Emitter, Event } from '../../../common/event.js';\nimport { Disposable } from '../../../common/lifecycle.js';\nimport { HoverStyle } from '../hover/hover.js';\nimport { getBaseLayerHoverDelegate } from '../hover/hoverDelegate2.js';\nimport './switch.css';\n\nexport interface ISwitchOptions {\n\treadonly checked?: boolean;\n\t/** Accessible name. Also used as the hover title unless {@link title} is given. */\n\treadonly ariaLabel: string;\n\t/**\n\t * Hover title. Defaults to {@link ariaLabel}. Pass `false` for no hover, for example when\n\t * the surrounding element already shows one that explains the switch.\n\t */\n\treadonly title?: string | false;\n\treadonly disabled?: boolean;\n}\n\n/**\n * A pill switch for a setting that takes effect as soon as it is flipped, e.g. enabling\n * a plugin or letting a model be chosen automatically.\n *\n * Use this rather than a `Checkbox` when the control commits immediately; a checkbox\n * reads as part of a form that is submitted later.\n */\nexport class Switch extends Disposable {\n\n\tprivate readonly _onChange = this._register(new Emitter<boolean>());\n\t/** Fires with the new state when the user flips the switch, not when it is set in code. */\n\treadonly onChange: Event<boolean> = this._onChange.event;\n\n\treadonly domNode: HTMLButtonElement;\n\n\tprivate _checked: boolean;\n\tprivate _title: string;\n\n\tconstructor(options: ISwitchOptions) {\n\t\tsuper();\n\t\tthis._checked = !!options.checked;\n\t\tconst title = options.title === false ? undefined : options.title;\n\t\tthis._title = title ?? options.ariaLabel;\n\n\t\tthis.domNode = dom.$('button.monaco-switch');\n\t\tthis.domNode.type = 'button';\n\t\tthis.domNode.setAttribute('role', 'switch');\n\t\tdom.append(this.domNode, dom.$('.monaco-switch-thumb'));\n\n\t\tif (options.title !== false) {\n\t\t\tthis._register(getBaseLayerHoverDelegate().setupDelayedHover(this.domNode, () => ({\n\t\t\t\tcontent: this._title,\n\t\t\t\tstyle: HoverStyle.Pointer,\n\t\t\t})));\n\t\t}\n\n\t\tthis.setAriaLabel(options.ariaLabel, title);\n\t\tthis.disabled = !!options.disabled;\n\t\tthis._applyState();\n\n\t\tthis._register(dom.addDisposableListener(this.domNode, dom.EventType.CLICK, e => {\n\t\t\tdom.EventHelper.stop(e, true);\n\t\t\tif (this.domNode.disabled) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._checked = !this._checked;\n\t\t\tthis._applyState();\n\t\t\tthis._onChange.fire(this._checked);\n\t\t}));\n\t}\n\n\tget checked(): boolean {\n\t\treturn this._checked;\n\t}\n\n\t/** Sets the state without firing {@link onChange}. */\n\tset checked(checked: boolean) {\n\t\tif (this._checked !== checked) {\n\t\t\tthis._checked = checked;\n\t\t\tthis._applyState();\n\t\t}\n\t}\n\n\tget disabled(): boolean {\n\t\treturn this.domNode.disabled;\n\t}\n\n\tset disabled(disabled: boolean) {\n\t\tthis.domNode.disabled = disabled;\n\t}\n\n\tsetAriaLabel(ariaLabel: string, title = ariaLabel): void {\n\t\tthis.domNode.setAttribute('aria-label', ariaLabel);\n\t\tthis._title = title;\n\t}\n\n\tprivate _applyState(): void {\n\t\tthis.domNode.setAttribute('aria-checked', String(this._checked));\n\t\tthis.domNode.classList.toggle('checked', this._checked);\n\t}\n}\n","/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\nimport * as dom from '../../dom.js';\nimport { Emitter, Event } from '../../../common/event.js';\nimport { Disposable } from '../../../common/lifecycle.js';\nimport { HoverStyle } from '../hover/hover.js';\nimport { getBaseLayerHoverDelegate } from '../hover/hoverDelegate2.js';\nimport './switch.css';\n\nexport interface ISwitchOptions {\n\treadonly checked?: boolean;\n\t/** Accessible name. Also used as the hover title unless {@link title} is given. */\n\treadonly ariaLabel: string;\n\t/**\n\t * Hover title. Defaults to {@link ariaLabel}. Pass `false` for no hover, for example when\n\t * the surrounding element already shows one that explains the switch.\n\t */\n\treadonly title?: string | false;\n\treadonly disabled?: boolean;\n}\n\n/**\n * A pill switch for a setting that takes effect as soon as it is flipped, e.g. enabling\n * a plugin or letting a model be chosen automatically.\n *\n * Use this rather than a `Checkbox` when the control commits immediately; a checkbox\n * reads as part of a form that is submitted later.\n */\nexport class Switch extends Disposable {\n\n\tprivate readonly _onChange = this._register(new Emitter<boolean>());\n\t/** Fires with the new state when the user flips the switch, not when it is set in code. */\n\treadonly onChange: Event<boolean> = this._onChange.event;\n\n\treadonly domNode: HTMLButtonElement;\n\n\tprivate _checked: boolean;\n\tprivate _title: string;\n\n\tconstructor(options: ISwitchOptions) {\n\t\tsuper();\n\t\tthis._checked = !!options.checked;\n\t\tconst title = options.title === false ? undefined : options.title;\n\t\tthis._title = title ?? options.ariaLabel;\n\n\t\tthis.domNode = dom.$('button.monaco-switch');\n\t\tthis.domNode.type = 'button';\n\t\tthis.domNode.setAttribute('role', 'switch');\n\t\tdom.append(this.domNode, dom.$('.monaco-switch-thumb'));\n\n\t\tif (options.title !== false) {\n\t\t\tthis._register(getBaseLayerHoverDelegate().setupDelayedHover(this.domNode, () => ({\n\t\t\t\tcontent: this._title,\n\t\t\t\tstyle: HoverStyle.Pointer,\n\t\t\t})));\n\t\t}\n\n\t\tthis.setAriaLabel(options.ariaLabel, title);\n\t\tthis.disabled = !!options.disabled;\n\t\tthis._applyState();\n\n\t\tthis._register(dom.addDisposableListener(this.domNode, dom.EventType.CLICK, e => {\n\t\t\tdom.EventHelper.stop(e, true);\n\t\t\tif (this.domNode.disabled) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._checked = !this._checked;\n\t\t\tthis._applyState();\n\t\t\tthis._onChange.fire(this._checked);\n\t\t}));\n\t}\n\n\tget checked(): boolean {\n\t\treturn this._checked;\n\t}\n\n\t/** Sets the state without firing {@link onChange}. */\n\tset checked(checked: boolean) {\n\t\tif (this._checked !== checked) {\n\t\t\tthis._checked = checked;\n\t\t\tthis._applyState();\n\t\t}\n\t}\n\n\tget disabled(): boolean {\n\t\treturn this.domNode.disabled;\n\t}\n\n\tset disabled(disabled: boolean) {\n\t\tthis.domNode.disabled = disabled;\n\t}\n\n\tsetAriaLabel(ariaLabel: string, title = ariaLabel): void {\n\t\tthis.domNode.setAttribute('aria-label', ariaLabel);\n\t\tthis._title = title;\n\t}\n\n\tprivate _applyState(): void {\n\t\tthis.domNode.setAttribute('aria-checked', String(this._checked));\n\t\tthis.domNode.classList.toggle('checked', this._checked);\n\t}\n}\n"]}
|
|
@@ -24,8 +24,7 @@
|
|
|
24
24
|
flex-shrink: 0;
|
|
25
25
|
}
|
|
26
26
|
|
|
27
|
-
.monaco-action-bar
|
|
28
|
-
.monaco-action-bar.has-overflow > .actions-container > .action-item:nth-last-child(2) {
|
|
27
|
+
.monaco-action-bar > .actions-container > .action-item.toolbar-shrinkable-item {
|
|
29
28
|
flex-shrink: 1;
|
|
30
29
|
min-width: var(--vscode-toolbar-action-min-width, 20px);
|
|
31
30
|
}
|
|
@@ -10,7 +10,7 @@ import { Action, Separator, SubmenuAction } from '../../../common/actions.js';
|
|
|
10
10
|
import { Codicon } from '../../../common/codicons.js';
|
|
11
11
|
import { ThemeIcon } from '../../../common/themables.js';
|
|
12
12
|
import { EventMultiplexer } from '../../../common/event.js';
|
|
13
|
-
import { Disposable,
|
|
13
|
+
import { Disposable, DisposableMap, toDisposable } from '../../../common/lifecycle.js';
|
|
14
14
|
import './toolbar.css';
|
|
15
15
|
import * as nls from '../../../../nls.js';
|
|
16
16
|
import { createInstantHoverDelegate } from '../hover/hoverDelegateFactory.js';
|
|
@@ -25,13 +25,13 @@ export class ToolBar extends Disposable {
|
|
|
25
25
|
constructor(container, contextMenuProvider, options = { orientation: 0 /* ActionsOrientation.HORIZONTAL */ }) {
|
|
26
26
|
super();
|
|
27
27
|
this.container = container;
|
|
28
|
-
this.submenuActionViewItems = [];
|
|
29
28
|
this.hasSecondaryActions = false;
|
|
30
29
|
this._onDidChangeDropdownVisibility = this._register(new EventMultiplexer());
|
|
31
30
|
this.originalPrimaryActions = [];
|
|
32
31
|
this.originalSecondaryActions = [];
|
|
33
32
|
this.hiddenActions = [];
|
|
34
|
-
this.
|
|
33
|
+
this.minItemsWidth = 0;
|
|
34
|
+
this.dropdownMenuDisposables = this._register(new DisposableMap());
|
|
35
35
|
options.hoverDelegate = options.hoverDelegate ?? this._register(createInstantHoverDelegate());
|
|
36
36
|
this.options = options;
|
|
37
37
|
this.toggleMenuAction = this._register(new ToggleMenuAction(() => this.toggleMenuActionViewItem?.show(), options.toggleMenuTitle));
|
|
@@ -56,12 +56,12 @@ export class ToolBar extends Disposable {
|
|
|
56
56
|
closeAnimation: this.options.dropdownMenuCloseAnimation,
|
|
57
57
|
anchorAlignmentProvider: this.options.anchorAlignmentProvider,
|
|
58
58
|
menuAsChild: !!this.options.renderDropdownAsChildElement,
|
|
59
|
+
menuAsPopover: !!this.options.renderDropdownAsPopover,
|
|
59
60
|
skipTelemetry: this.options.skipTelemetry,
|
|
60
61
|
isMenu: true,
|
|
61
62
|
hoverDelegate: this.options.hoverDelegate
|
|
62
63
|
});
|
|
63
|
-
this.toggleMenuActionViewItem.
|
|
64
|
-
this.disposables.add(this._onDidChangeDropdownVisibility.add(this.toggleMenuActionViewItem.onDidChangeVisibility));
|
|
64
|
+
this.dropdownMenuDisposables.set(this.toggleMenuActionViewItem, this._onDidChangeDropdownVisibility.add(this.toggleMenuActionViewItem.onDidChangeVisibility));
|
|
65
65
|
return this.toggleMenuActionViewItem;
|
|
66
66
|
}
|
|
67
67
|
if (options.actionViewItemProvider) {
|
|
@@ -80,12 +80,11 @@ export class ToolBar extends Disposable {
|
|
|
80
80
|
closeAnimation: this.options.dropdownMenuCloseAnimation,
|
|
81
81
|
anchorAlignmentProvider: this.options.anchorAlignmentProvider,
|
|
82
82
|
menuAsChild: !!this.options.renderDropdownAsChildElement,
|
|
83
|
+
menuAsPopover: !!this.options.renderDropdownAsPopover,
|
|
83
84
|
skipTelemetry: this.options.skipTelemetry,
|
|
84
85
|
hoverDelegate: this.options.hoverDelegate
|
|
85
86
|
});
|
|
86
|
-
|
|
87
|
-
this.submenuActionViewItems.push(result);
|
|
88
|
-
this.disposables.add(this._onDidChangeDropdownVisibility.add(result.onDidChangeVisibility));
|
|
87
|
+
this.dropdownMenuDisposables.set(result, this._onDidChangeDropdownVisibility.add(result.onDidChangeVisibility));
|
|
89
88
|
return result;
|
|
90
89
|
}
|
|
91
90
|
return undefined;
|
|
@@ -112,10 +111,6 @@ export class ToolBar extends Disposable {
|
|
|
112
111
|
}
|
|
113
112
|
set context(context) {
|
|
114
113
|
this.actionBar.context = context;
|
|
115
|
-
this.toggleMenuActionViewItem?.setActionContext(context);
|
|
116
|
-
for (const actionViewItem of this.submenuActionViewItems) {
|
|
117
|
-
actionViewItem.setActionContext(context);
|
|
118
|
-
}
|
|
119
114
|
}
|
|
120
115
|
getElement() {
|
|
121
116
|
return this.element;
|
|
@@ -162,7 +157,7 @@ export class ToolBar extends Disposable {
|
|
|
162
157
|
this.hasSecondaryActions = !!(secondaryActions && secondaryActions.length > 0);
|
|
163
158
|
if (this.hasSecondaryActions && secondaryActions) {
|
|
164
159
|
this.toggleMenuAction.menuActions = secondaryActions.slice(0);
|
|
165
|
-
primaryActionsToSet.
|
|
160
|
+
primaryActionsToSet.splice(this.getSecondaryActionsPosition(primaryActionsToSet), 0, this.toggleMenuAction);
|
|
166
161
|
}
|
|
167
162
|
if (primaryActionsToSet.length > 0 && this.options.trailingSeparator) {
|
|
168
163
|
primaryActionsToSet.push(new Separator());
|
|
@@ -189,13 +184,13 @@ export class ToolBar extends Disposable {
|
|
|
189
184
|
overflowWidth = ACTION_MIN_WIDTH + ACTION_PADDING;
|
|
190
185
|
}
|
|
191
186
|
const separatorWidth = this.options.trailingSeparator && !this.actionBar.isEmpty() ? this.actionBar.getWidth(this.actionBar.length() - 1) + ACTION_PADDING : 0;
|
|
192
|
-
this.
|
|
193
|
-
this.
|
|
187
|
+
this.minItemsWidth = primaryActionsMinWidth + overflowWidth + separatorWidth;
|
|
188
|
+
this.reserveMinWidth(this.minItemsWidth);
|
|
194
189
|
}
|
|
195
190
|
else {
|
|
196
191
|
const minimumActionWidth = this.originalPrimaryActions.length > 0 ? this.getActionMinWidth(this.originalPrimaryActions[0]) : ACTION_MIN_WIDTH + ACTION_PADDING;
|
|
197
|
-
this.
|
|
198
|
-
this.
|
|
192
|
+
this.minItemsWidth = 0;
|
|
193
|
+
this.reserveMinWidth(minimumActionWidth);
|
|
199
194
|
}
|
|
200
195
|
// Update toolbar actions to fit with container width
|
|
201
196
|
this.updateActions(this.getAvailableWidth());
|
|
@@ -204,6 +199,29 @@ export class ToolBar extends Disposable {
|
|
|
204
199
|
get overflowFromStart() {
|
|
205
200
|
return this.options.responsiveBehavior?.kind === 'all' && this.options.responsiveBehavior.overflowFrom === 'start';
|
|
206
201
|
}
|
|
202
|
+
getSecondaryActionsPosition(primaryActions = this.originalPrimaryActions) {
|
|
203
|
+
const requestedPosition = this.options.getSecondaryActionsPosition?.(primaryActions) ?? primaryActions.length;
|
|
204
|
+
return Number.isFinite(requestedPosition)
|
|
205
|
+
? Math.max(0, Math.min(primaryActions.length, Math.trunc(requestedPosition)))
|
|
206
|
+
: primaryActions.length;
|
|
207
|
+
}
|
|
208
|
+
getRenderedPrimaryActionCountBefore(position) {
|
|
209
|
+
const renderedActions = new Set(this.actionBar.viewItems.map(item => item.action));
|
|
210
|
+
return this.originalPrimaryActions
|
|
211
|
+
.slice(0, position)
|
|
212
|
+
.reduce((count, action) => count + (renderedActions.has(action) ? 1 : 0), 0);
|
|
213
|
+
}
|
|
214
|
+
getToggleMenuActionInsertionIndex() {
|
|
215
|
+
return this.getRenderedPrimaryActionCountBefore(this.getSecondaryActionsPosition());
|
|
216
|
+
}
|
|
217
|
+
getPrimaryActionInsertionIndex(action) {
|
|
218
|
+
const actionPosition = this.originalPrimaryActions.indexOf(action);
|
|
219
|
+
if (actionPosition === -1) {
|
|
220
|
+
return this.actionBar.length();
|
|
221
|
+
}
|
|
222
|
+
const toggleOffset = this.actionBar.hasAction(this.toggleMenuAction) && this.getSecondaryActionsPosition() <= actionPosition ? 1 : 0;
|
|
223
|
+
return this.getRenderedPrimaryActionCountBefore(actionPosition) + toggleOffset;
|
|
224
|
+
}
|
|
207
225
|
getKeybindingLabel(action) {
|
|
208
226
|
const key = this.options.getKeyBinding?.(action);
|
|
209
227
|
return key?.getLabel() ?? undefined;
|
|
@@ -225,13 +243,33 @@ export class ToolBar extends Disposable {
|
|
|
225
243
|
}
|
|
226
244
|
return this.element.getBoundingClientRect().width;
|
|
227
245
|
}
|
|
246
|
+
reserveMinWidth(width) {
|
|
247
|
+
if (this.options.responsiveBehavior?.reserveMinWidth === false) {
|
|
248
|
+
return;
|
|
249
|
+
}
|
|
250
|
+
this.container.style.minWidth = `${width}px`;
|
|
251
|
+
this.element.style.minWidth = `${width}px`;
|
|
252
|
+
}
|
|
228
253
|
applyResponsiveActionMinWidths() {
|
|
229
254
|
if (!this.options.responsiveBehavior?.enabled) {
|
|
230
255
|
return;
|
|
231
256
|
}
|
|
257
|
+
const actionsContainer = this.actionBar.getContainer().firstElementChild;
|
|
258
|
+
if (!DOM.isHTMLElement(actionsContainer)) {
|
|
259
|
+
return;
|
|
260
|
+
}
|
|
232
261
|
if (this.options.responsiveBehavior.kind === 'last') {
|
|
233
|
-
|
|
234
|
-
|
|
262
|
+
let shrinkableIndex = -1;
|
|
263
|
+
for (let index = this.actionBar.length() - 1; index >= 0; index--) {
|
|
264
|
+
const action = this.actionBar.getAction(index);
|
|
265
|
+
if (action && !(action instanceof Separator) && this.originalPrimaryActions.includes(action)) {
|
|
266
|
+
shrinkableIndex = index;
|
|
267
|
+
break;
|
|
268
|
+
}
|
|
269
|
+
}
|
|
270
|
+
for (let index = 0; index < actionsContainer.children.length; index++) {
|
|
271
|
+
actionsContainer.children.item(index)?.classList.toggle('toolbar-shrinkable-item', index === shrinkableIndex);
|
|
272
|
+
}
|
|
235
273
|
const shrinkableAction = shrinkableIndex >= 0 ? this.actionBar.getAction(shrinkableIndex) : undefined;
|
|
236
274
|
const minWidth = `${this.getConfiguredActionMinWidth(shrinkableAction)}px`;
|
|
237
275
|
if (this.element.style.getPropertyValue(ACTION_MIN_WIDTH_VAR) !== minWidth) {
|
|
@@ -239,10 +277,6 @@ export class ToolBar extends Disposable {
|
|
|
239
277
|
}
|
|
240
278
|
return;
|
|
241
279
|
}
|
|
242
|
-
const actionsContainer = this.actionBar.getContainer().firstElementChild;
|
|
243
|
-
if (!DOM.isHTMLElement(actionsContainer)) {
|
|
244
|
-
return;
|
|
245
|
-
}
|
|
246
280
|
for (let i = 0; i < actionsContainer.children.length; i++) {
|
|
247
281
|
const actionItem = actionsContainer.children.item(i);
|
|
248
282
|
if (!DOM.isHTMLElement(actionItem)) {
|
|
@@ -268,6 +302,11 @@ export class ToolBar extends Disposable {
|
|
|
268
302
|
// element which is set based on the `responsiveBehavior.minItems` option
|
|
269
303
|
const parsedMinWidth = parseInt(this.element.style.minWidth);
|
|
270
304
|
containerWidth = Math.max(containerWidth, Number.isNaN(parsedMinWidth) ? 0 : parsedMinWidth);
|
|
305
|
+
// Without a reserved minimum width the toolbar can be narrower than the
|
|
306
|
+
// width of its minimum items, in which case they overflow too.
|
|
307
|
+
const minItems = this.options.responsiveBehavior?.reserveMinWidth !== false || containerWidth >= this.minItemsWidth
|
|
308
|
+
? this.options.responsiveBehavior?.minItems
|
|
309
|
+
: undefined;
|
|
271
310
|
// Each action is assumed to have a minimum width so that actions with a label
|
|
272
311
|
// can shrink to the action's minimum width. We do this so that action visibility
|
|
273
312
|
// takes precedence over the action label.
|
|
@@ -396,16 +435,16 @@ export class ToolBar extends Disposable {
|
|
|
396
435
|
return;
|
|
397
436
|
}
|
|
398
437
|
// Check for max items limit
|
|
399
|
-
if (
|
|
438
|
+
if (minItems !== undefined) {
|
|
400
439
|
const primaryActionsCount = getVisiblePrimaryActionCount();
|
|
401
|
-
if (primaryActionsCount <=
|
|
440
|
+
if (primaryActionsCount <= minItems) {
|
|
402
441
|
return;
|
|
403
442
|
}
|
|
404
443
|
}
|
|
405
444
|
// Hide actions from the configured end.
|
|
406
445
|
while (minimumWidth > containerWidth && this.actionBar.length() > 0) {
|
|
407
|
-
if (
|
|
408
|
-
&& getVisiblePrimaryActionCount() <=
|
|
446
|
+
if (minItems !== undefined
|
|
447
|
+
&& getVisiblePrimaryActionCount() <= minItems) {
|
|
409
448
|
break;
|
|
410
449
|
}
|
|
411
450
|
const actionsToHide = getActionsToHide();
|
|
@@ -416,7 +455,7 @@ export class ToolBar extends Disposable {
|
|
|
416
455
|
this.hiddenActions.push(action);
|
|
417
456
|
const index = this.actionBar.viewItems.findIndex(item => item.action === action);
|
|
418
457
|
if (index !== -1) {
|
|
419
|
-
this.
|
|
458
|
+
this.pullAction(index);
|
|
420
459
|
}
|
|
421
460
|
}
|
|
422
461
|
this.hiddenActions.sort((a, b) => this.originalPrimaryActions.indexOf(a) - this.originalPrimaryActions.indexOf(b));
|
|
@@ -428,7 +467,7 @@ export class ToolBar extends Disposable {
|
|
|
428
467
|
icon: this.options.icon ?? true,
|
|
429
468
|
label: this.options.label ?? false,
|
|
430
469
|
keybinding: this.getKeybindingLabel(this.toggleMenuAction),
|
|
431
|
-
index: this.
|
|
470
|
+
index: this.getToggleMenuActionInsertionIndex(),
|
|
432
471
|
});
|
|
433
472
|
this.updateOverflowClassName();
|
|
434
473
|
}
|
|
@@ -441,27 +480,25 @@ export class ToolBar extends Disposable {
|
|
|
441
480
|
while (this.hiddenActions.length > 0) {
|
|
442
481
|
const actionsToRestore = getActionsToRestore();
|
|
443
482
|
const keepToggleMenuAction = this.originalSecondaryActions.length > 0 || this.hiddenActions.length > actionsToRestore.length;
|
|
444
|
-
|
|
483
|
+
const isBelowMinItems = this.options.responsiveBehavior?.reserveMinWidth === false && minItems !== undefined && getVisiblePrimaryActionCount() < minItems;
|
|
484
|
+
if (!isBelowMinItems && projectedActionBarMinimumWidth(actionsToRestore, keepToggleMenuAction) > containerWidth) {
|
|
445
485
|
// Not enough space to show the action
|
|
446
486
|
break;
|
|
447
487
|
}
|
|
448
488
|
for (const action of actionsToRestore) {
|
|
449
489
|
this.hiddenActions.splice(this.hiddenActions.indexOf(action), 1);
|
|
450
|
-
const visibleActions = new Set(this.actionBar.viewItems.map(item => item.action));
|
|
451
490
|
this.actionBar.push(action, {
|
|
452
491
|
icon: this.options.icon ?? true,
|
|
453
492
|
label: this.options.label ?? false,
|
|
454
493
|
keybinding: this.getKeybindingLabel(action),
|
|
455
|
-
index: this.
|
|
456
|
-
.slice(0, this.originalPrimaryActions.indexOf(action))
|
|
457
|
-
.reduce((index, precedingAction) => index + (visibleActions.has(precedingAction) ? 1 : 0), 0)
|
|
494
|
+
index: this.getPrimaryActionInsertionIndex(action),
|
|
458
495
|
});
|
|
459
496
|
}
|
|
460
497
|
// There are no secondary actions, and there is only one hidden item left so we
|
|
461
498
|
// remove the overflow menu making space for the last hidden action to be shown.
|
|
462
499
|
if (this.originalSecondaryActions.length === 0 && this.hiddenActions.length === 0) {
|
|
463
500
|
this.toggleMenuAction.menuActions = [];
|
|
464
|
-
this.
|
|
501
|
+
this.pullAction(this.actionBar.viewItems.findIndex(item => item.action === this.toggleMenuAction));
|
|
465
502
|
this.updateOverflowClassName();
|
|
466
503
|
}
|
|
467
504
|
this.applyResponsiveActionMinWidths();
|
|
@@ -508,14 +545,24 @@ export class ToolBar extends Disposable {
|
|
|
508
545
|
updateOverflowClassName() {
|
|
509
546
|
this.actionBar.domNode.classList.toggle('has-overflow', this.actionBar.hasAction(this.toggleMenuAction));
|
|
510
547
|
}
|
|
548
|
+
pullAction(index) {
|
|
549
|
+
const viewItem = this.actionBar.viewItems[index];
|
|
550
|
+
if (viewItem) {
|
|
551
|
+
this.dropdownMenuDisposables.deleteAndDispose(viewItem);
|
|
552
|
+
if (this.toggleMenuActionViewItem === viewItem) {
|
|
553
|
+
this.toggleMenuActionViewItem = undefined;
|
|
554
|
+
}
|
|
555
|
+
}
|
|
556
|
+
this.actionBar.pull(index);
|
|
557
|
+
}
|
|
511
558
|
clear() {
|
|
512
|
-
this.
|
|
513
|
-
this.
|
|
559
|
+
this.toggleMenuActionViewItem = undefined;
|
|
560
|
+
this.toggleMenuAction.menuActions = [];
|
|
561
|
+
this.dropdownMenuDisposables.clearAndDisposeAll();
|
|
514
562
|
this.actionBar.clear();
|
|
515
563
|
}
|
|
516
564
|
dispose() {
|
|
517
565
|
this.clear();
|
|
518
|
-
this.disposables.dispose();
|
|
519
566
|
this.element.remove();
|
|
520
567
|
super.dispose();
|
|
521
568
|
}
|