dockview-core 7.0.4 → 8.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENCE.md +21 -0
- package/README.md +17 -86
- package/dist/cjs/api/component.api.d.ts +100 -9
- package/dist/cjs/api/dockviewGroupPanelApi.d.ts +45 -1
- package/dist/cjs/api/dockviewPanelApi.d.ts +21 -0
- package/dist/cjs/dismissableLayer.d.ts +57 -0
- package/dist/cjs/dnd/backend.d.ts +2 -2
- package/dist/cjs/dnd/dropTargetAnchorContainer.d.ts +12 -0
- package/dist/cjs/dnd/droptarget.d.ts +94 -0
- package/dist/cjs/dnd/ghost.d.ts +1 -0
- package/dist/cjs/dnd/pointer/longPress.d.ts +2 -2
- package/dist/cjs/dnd/pointer/pointerDragController.d.ts +5 -2
- package/dist/cjs/dnd/pointer/pointerDragSource.d.ts +1 -1
- package/dist/cjs/dnd/pointer/pointerDropTarget.d.ts +30 -1
- package/dist/cjs/dnd/pointer/pointerGhost.d.ts +1 -1
- package/dist/cjs/dockview/accessibilityMessages.d.ts +6 -0
- package/dist/cjs/dockview/advancedDnDService.d.ts +46 -0
- package/dist/cjs/dockview/components/panel/content.d.ts +1 -1
- package/dist/cjs/dockview/components/tab/defaultTab.d.ts +2 -0
- package/dist/cjs/dockview/components/tab/tab.d.ts +2 -0
- package/dist/cjs/dockview/components/titlebar/floatingTitleBar.d.ts +2 -2
- package/dist/cjs/dockview/components/titlebar/groupDragSource.d.ts +1 -1
- package/dist/cjs/dockview/components/titlebar/tabGroupChip.d.ts +1 -1
- package/dist/cjs/dockview/components/titlebar/tabGroupIndicator.d.ts +73 -2
- package/dist/cjs/dockview/components/titlebar/tabGroups.d.ts +1 -1
- package/dist/cjs/dockview/components/titlebar/tabReorderController.d.ts +295 -0
- package/dist/cjs/dockview/components/titlebar/tabs.d.ts +120 -50
- package/dist/cjs/dockview/components/titlebar/tabsContainer.d.ts +48 -0
- package/dist/cjs/dockview/dndCapabilities.d.ts +1 -1
- package/dist/cjs/dockview/dockviewComponent.d.ts +303 -19
- package/dist/cjs/dockview/dockviewGroupPanel.d.ts +5 -0
- package/dist/cjs/dockview/dockviewGroupPanelModel.d.ts +52 -2
- package/dist/cjs/dockview/dockviewPanel.d.ts +12 -0
- package/dist/cjs/dockview/dockviewShell.d.ts +48 -24
- package/dist/cjs/dockview/edgeGroupService.d.ts +20 -0
- package/dist/cjs/dockview/events.d.ts +6 -0
- package/dist/cjs/dockview/liveRegionService.d.ts +18 -5
- package/dist/cjs/dockview/moduleContracts.d.ts +480 -14
- package/dist/cjs/dockview/modules.d.ts +101 -22
- package/dist/cjs/dockview/options.d.ts +337 -30
- package/dist/cjs/dockview/optionsModules.d.ts +73 -0
- package/dist/cjs/dockview/popoutWindowService.d.ts +15 -10
- package/dist/cjs/dockview/rootDropTargetService.d.ts +11 -0
- package/dist/cjs/dockview/tabGroupAccent.d.ts +1 -1
- package/dist/cjs/dockview/tabGroupChipsService.d.ts +10 -0
- package/dist/cjs/dockview/theme.d.ts +2 -2
- package/dist/cjs/dockview/types.d.ts +3 -0
- package/dist/cjs/dom.d.ts +9 -1
- package/dist/cjs/gridview/baseComponentGridview.d.ts +2 -2
- package/dist/cjs/gridview/gridview.d.ts +2 -0
- package/dist/cjs/index.d.ts +35 -29
- package/dist/cjs/lifecycle.d.ts +1 -0
- package/dist/cjs/overlay/overlay.d.ts +4 -2
- package/dist/cjs/overlay/overlayRenderContainer.d.ts +8 -0
- package/dist/cjs/paneview/paneview.d.ts +2 -1
- package/dist/cjs/paneview/paneviewComponent.d.ts +3 -0
- package/dist/cjs/paneview/paneviewPanel.d.ts +5 -0
- package/dist/cjs/svg.d.ts +1 -0
- package/dist/cjs/types.d.ts +8 -0
- package/dist/dockview-core.js +18391 -19679
- package/dist/dockview-core.min.js +4138 -6
- package/dist/dockview-core.min.noStyle.js +6 -7
- package/dist/dockview-core.noStyle.js +18390 -19656
- package/dist/package/main.cjs.js +18002 -19268
- package/dist/package/main.cjs.min.js +6 -6
- package/dist/package/main.esm.min.mjs +6 -6
- package/dist/package/main.esm.mjs +17959 -19260
- package/package.json +81 -77
- package/dist/cjs/api/component.api.js +0 -1242
- package/dist/cjs/api/dockviewGroupPanelApi.js +0 -200
- package/dist/cjs/api/dockviewPanelApi.js +0 -172
- package/dist/cjs/api/entryPoints.js +0 -27
- package/dist/cjs/api/gridviewPanelApi.js +0 -45
- package/dist/cjs/api/panelApi.js +0 -133
- package/dist/cjs/api/paneviewPanelApi.js +0 -57
- package/dist/cjs/api/splitviewPanelApi.js +0 -47
- package/dist/cjs/array.js +0 -66
- package/dist/cjs/constants.js +0 -11
- package/dist/cjs/dnd/backend.js +0 -171
- package/dist/cjs/dnd/dataTransfer.js +0 -100
- package/dist/cjs/dnd/dnd.js +0 -74
- package/dist/cjs/dnd/dropOverlay.js +0 -197
- package/dist/cjs/dnd/dropTargetAnchorContainer.js +0 -104
- package/dist/cjs/dnd/droptarget.js +0 -362
- package/dist/cjs/dnd/ghost.js +0 -17
- package/dist/cjs/dnd/pointer/index.js +0 -13
- package/dist/cjs/dnd/pointer/longPress.js +0 -151
- package/dist/cjs/dnd/pointer/pointerDragController.js +0 -243
- package/dist/cjs/dnd/pointer/pointerDragSource.js +0 -197
- package/dist/cjs/dnd/pointer/pointerDropTarget.js +0 -198
- package/dist/cjs/dnd/pointer/pointerGhost.js +0 -44
- package/dist/cjs/dnd/pointer/types.js +0 -2
- package/dist/cjs/dockview/accessibilityMessages.js +0 -51
- package/dist/cjs/dockview/allModules.js +0 -25
- package/dist/cjs/dockview/components/panel/content.js +0 -213
- package/dist/cjs/dockview/components/popupService.js +0 -132
- package/dist/cjs/dockview/components/tab/defaultTab.js +0 -70
- package/dist/cjs/dockview/components/tab/tab.js +0 -281
- package/dist/cjs/dockview/components/titlebar/floatingTitleBar.js +0 -95
- package/dist/cjs/dockview/components/titlebar/groupDragSource.js +0 -218
- package/dist/cjs/dockview/components/titlebar/tabGroupChip.js +0 -104
- package/dist/cjs/dockview/components/titlebar/tabGroupIndicator.js +0 -477
- package/dist/cjs/dockview/components/titlebar/tabGroups.js +0 -854
- package/dist/cjs/dockview/components/titlebar/tabOverflowControl.js +0 -19
- package/dist/cjs/dockview/components/titlebar/tabs.js +0 -2016
- package/dist/cjs/dockview/components/titlebar/tabsContainer.js +0 -458
- package/dist/cjs/dockview/components/titlebar/voidContainer.js +0 -120
- package/dist/cjs/dockview/components/watermark/watermark.js +0 -40
- package/dist/cjs/dockview/deserializer.js +0 -39
- package/dist/cjs/dockview/dndCapabilities.js +0 -39
- package/dist/cjs/dockview/dockviewComponent.js +0 -3896
- package/dist/cjs/dockview/dockviewFloatingGroupPanel.js +0 -70
- package/dist/cjs/dockview/dockviewGroupPanel.js +0 -204
- package/dist/cjs/dockview/dockviewGroupPanelModel.js +0 -1514
- package/dist/cjs/dockview/dockviewPanel.js +0 -265
- package/dist/cjs/dockview/dockviewPanelModel.js +0 -105
- package/dist/cjs/dockview/dockviewShell.js +0 -744
- package/dist/cjs/dockview/edgeGroupService.js +0 -128
- package/dist/cjs/dockview/events.js +0 -67
- package/dist/cjs/dockview/floatingGroupService.js +0 -231
- package/dist/cjs/dockview/framework.js +0 -2
- package/dist/cjs/dockview/headerActionsService.js +0 -149
- package/dist/cjs/dockview/liveRegionService.js +0 -185
- package/dist/cjs/dockview/moduleContracts.js +0 -2
- package/dist/cjs/dockview/modules.js +0 -304
- package/dist/cjs/dockview/options.js +0 -103
- package/dist/cjs/dockview/popoutWindowService.js +0 -261
- package/dist/cjs/dockview/rootDropTargetService.js +0 -87
- package/dist/cjs/dockview/strictEventsSequencing.js +0 -63
- package/dist/cjs/dockview/tabGroup.js +0 -219
- package/dist/cjs/dockview/tabGroupAccent.js +0 -126
- package/dist/cjs/dockview/theme.js +0 -139
- package/dist/cjs/dockview/types.js +0 -2
- package/dist/cjs/dockview/validate.js +0 -76
- package/dist/cjs/dockview/watermarkService.js +0 -61
- package/dist/cjs/dom.js +0 -543
- package/dist/cjs/events.js +0 -296
- package/dist/cjs/framwork.js +0 -2
- package/dist/cjs/gridview/baseComponentGridview.js +0 -330
- package/dist/cjs/gridview/basePanelView.js +0 -162
- package/dist/cjs/gridview/branchNode.js +0 -372
- package/dist/cjs/gridview/gridview.js +0 -776
- package/dist/cjs/gridview/gridviewComponent.js +0 -363
- package/dist/cjs/gridview/gridviewPanel.js +0 -249
- package/dist/cjs/gridview/leafNode.js +0 -169
- package/dist/cjs/gridview/options.js +0 -17
- package/dist/cjs/gridview/types.js +0 -2
- package/dist/cjs/index.js +0 -105
- package/dist/cjs/lifecycle.js +0 -80
- package/dist/cjs/math.js +0 -38
- package/dist/cjs/overlay/overlay.js +0 -602
- package/dist/cjs/overlay/overlayRenderContainer.js +0 -309
- package/dist/cjs/panel/types.js +0 -2
- package/dist/cjs/paneview/defaultPaneviewHeader.js +0 -92
- package/dist/cjs/paneview/draggablePaneviewPanel.js +0 -141
- package/dist/cjs/paneview/options.js +0 -44
- package/dist/cjs/paneview/paneview.js +0 -203
- package/dist/cjs/paneview/paneviewComponent.js +0 -430
- package/dist/cjs/paneview/paneviewPanel.js +0 -275
- package/dist/cjs/popoutWindow.js +0 -244
- package/dist/cjs/resizable.js +0 -97
- package/dist/cjs/scrollbar.js +0 -169
- package/dist/cjs/splitview/options.js +0 -19
- package/dist/cjs/splitview/splitview.js +0 -999
- package/dist/cjs/splitview/splitviewComponent.js +0 -401
- package/dist/cjs/splitview/splitviewPanel.js +0 -179
- package/dist/cjs/splitview/viewItem.js +0 -119
- package/dist/cjs/svg.js +0 -43
- package/dist/cjs/types.js +0 -2
- package/dist/dockview-core.min.js.map +0 -1
- package/dist/dockview-core.min.noStyle.js.map +0 -1
- package/dist/esm/api/component.api.d.ts +0 -640
- package/dist/esm/api/component.api.js +0 -887
- package/dist/esm/api/dockviewGroupPanelApi.d.ts +0 -109
- package/dist/esm/api/dockviewGroupPanelApi.js +0 -155
- package/dist/esm/api/dockviewPanelApi.d.ts +0 -84
- package/dist/esm/api/dockviewPanelApi.js +0 -124
- package/dist/esm/api/entryPoints.d.ts +0 -9
- package/dist/esm/api/entryPoints.js +0 -21
- package/dist/esm/api/gridviewPanelApi.d.ts +0 -37
- package/dist/esm/api/gridviewPanelApi.js +0 -23
- package/dist/esm/api/panelApi.d.ts +0 -100
- package/dist/esm/api/panelApi.js +0 -87
- package/dist/esm/api/paneviewPanelApi.d.ts +0 -26
- package/dist/esm/api/paneviewPanelApi.js +0 -27
- package/dist/esm/api/splitviewPanelApi.d.ts +0 -32
- package/dist/esm/api/splitviewPanelApi.js +0 -25
- package/dist/esm/array.d.ts +0 -13
- package/dist/esm/array.js +0 -57
- package/dist/esm/constants.d.ts +0 -8
- package/dist/esm/constants.js +0 -8
- package/dist/esm/dnd/backend.d.ts +0 -70
- package/dist/esm/dnd/backend.js +0 -148
- package/dist/esm/dnd/dataTransfer.d.ts +0 -31
- package/dist/esm/dnd/dataTransfer.js +0 -67
- package/dist/esm/dnd/dnd.d.ts +0 -32
- package/dist/esm/dnd/dnd.js +0 -51
- package/dist/esm/dnd/dropOverlay.d.ts +0 -20
- package/dist/esm/dnd/dropOverlay.js +0 -192
- package/dist/esm/dnd/dropTargetAnchorContainer.d.ts +0 -16
- package/dist/esm/dnd/dropTargetAnchorContainer.js +0 -73
- package/dist/esm/dnd/droptarget.d.ts +0 -116
- package/dist/esm/dnd/droptarget.js +0 -316
- package/dist/esm/dnd/ghost.d.ts +0 -4
- package/dist/esm/dnd/ghost.js +0 -14
- package/dist/esm/dnd/pointer/index.d.ts +0 -11
- package/dist/esm/dnd/pointer/index.js +0 -5
- package/dist/esm/dnd/pointer/longPress.d.ts +0 -32
- package/dist/esm/dnd/pointer/longPress.js +0 -127
- package/dist/esm/dnd/pointer/pointerDragController.d.ts +0 -60
- package/dist/esm/dnd/pointer/pointerDragController.js +0 -193
- package/dist/esm/dnd/pointer/pointerDragSource.d.ts +0 -61
- package/dist/esm/dnd/pointer/pointerDragSource.js +0 -173
- package/dist/esm/dnd/pointer/pointerDropTarget.d.ts +0 -39
- package/dist/esm/dnd/pointer/pointerDropTarget.js +0 -168
- package/dist/esm/dnd/pointer/pointerGhost.d.ts +0 -30
- package/dist/esm/dnd/pointer/pointerGhost.js +0 -39
- package/dist/esm/dnd/pointer/types.d.ts +0 -16
- package/dist/esm/dnd/pointer/types.js +0 -1
- package/dist/esm/dockview/accessibilityMessages.d.ts +0 -32
- package/dist/esm/dockview/accessibilityMessages.js +0 -30
- package/dist/esm/dockview/allModules.d.ts +0 -8
- package/dist/esm/dockview/allModules.js +0 -22
- package/dist/esm/dockview/components/panel/content.d.ts +0 -54
- package/dist/esm/dockview/components/panel/content.js +0 -185
- package/dist/esm/dockview/components/popupService.d.ts +0 -21
- package/dist/esm/dockview/components/popupService.js +0 -108
- package/dist/esm/dockview/components/tab/defaultTab.d.ts +0 -12
- package/dist/esm/dockview/components/tab/defaultTab.js +0 -43
- package/dist/esm/dockview/components/tab/tab.d.ts +0 -44
- package/dist/esm/dockview/components/tab/tab.js +0 -242
- package/dist/esm/dockview/components/titlebar/floatingTitleBar.d.ts +0 -34
- package/dist/esm/dockview/components/titlebar/floatingTitleBar.js +0 -65
- package/dist/esm/dockview/components/titlebar/groupDragSource.d.ts +0 -51
- package/dist/esm/dockview/components/titlebar/groupDragSource.js +0 -178
- package/dist/esm/dockview/components/titlebar/tabGroupChip.d.ts +0 -37
- package/dist/esm/dockview/components/titlebar/tabGroupChip.js +0 -77
- package/dist/esm/dockview/components/titlebar/tabGroupIndicator.d.ts +0 -72
- package/dist/esm/dockview/components/titlebar/tabGroupIndicator.js +0 -360
- package/dist/esm/dockview/components/titlebar/tabGroups.d.ts +0 -107
- package/dist/esm/dockview/components/titlebar/tabGroups.js +0 -621
- package/dist/esm/dockview/components/titlebar/tabOverflowControl.d.ts +0 -8
- package/dist/esm/dockview/components/titlebar/tabOverflowControl.js +0 -16
- package/dist/esm/dockview/components/titlebar/tabs.d.ts +0 -167
- package/dist/esm/dockview/components/titlebar/tabs.js +0 -1653
- package/dist/esm/dockview/components/titlebar/tabsContainer.d.ts +0 -104
- package/dist/esm/dockview/components/titlebar/tabsContainer.js +0 -359
- package/dist/esm/dockview/components/titlebar/voidContainer.d.ts +0 -21
- package/dist/esm/dockview/components/titlebar/voidContainer.js +0 -92
- package/dist/esm/dockview/components/watermark/watermark.d.ts +0 -8
- package/dist/esm/dockview/components/watermark/watermark.js +0 -14
- package/dist/esm/dockview/deserializer.d.ts +0 -12
- package/dist/esm/dockview/deserializer.js +0 -34
- package/dist/esm/dockview/dndCapabilities.d.ts +0 -19
- package/dist/esm/dockview/dndCapabilities.js +0 -36
- package/dist/esm/dockview/dockviewComponent.d.ts +0 -626
- package/dist/esm/dockview/dockviewComponent.js +0 -3214
- package/dist/esm/dockview/dockviewFloatingGroupPanel.d.ts +0 -45
- package/dist/esm/dockview/dockviewFloatingGroupPanel.js +0 -44
- package/dist/esm/dockview/dockviewGroupPanel.d.ts +0 -35
- package/dist/esm/dockview/dockviewGroupPanel.js +0 -142
- package/dist/esm/dockview/dockviewGroupPanelModel.d.ts +0 -358
- package/dist/esm/dockview/dockviewGroupPanelModel.js +0 -1180
- package/dist/esm/dockview/dockviewPanel.d.ts +0 -69
- package/dist/esm/dockview/dockviewPanel.js +0 -178
- package/dist/esm/dockview/dockviewPanelModel.d.ts +0 -37
- package/dist/esm/dockview/dockviewPanelModel.js +0 -81
- package/dist/esm/dockview/dockviewShell.d.ts +0 -150
- package/dist/esm/dockview/dockviewShell.js +0 -678
- package/dist/esm/dockview/edgeGroupService.d.ts +0 -38
- package/dist/esm/dockview/edgeGroupService.js +0 -63
- package/dist/esm/dockview/events.d.ts +0 -38
- package/dist/esm/dockview/events.js +0 -34
- package/dist/esm/dockview/floatingGroupService.d.ts +0 -37
- package/dist/esm/dockview/floatingGroupService.js +0 -150
- package/dist/esm/dockview/framework.d.ts +0 -65
- package/dist/esm/dockview/framework.js +0 -1
- package/dist/esm/dockview/headerActionsService.d.ts +0 -32
- package/dist/esm/dockview/headerActionsService.js +0 -86
- package/dist/esm/dockview/liveRegionService.d.ts +0 -53
- package/dist/esm/dockview/liveRegionService.js +0 -159
- package/dist/esm/dockview/moduleContracts.d.ts +0 -119
- package/dist/esm/dockview/moduleContracts.js +0 -1
- package/dist/esm/dockview/modules.d.ts +0 -110
- package/dist/esm/dockview/modules.js +0 -170
- package/dist/esm/dockview/options.d.ts +0 -474
- package/dist/esm/dockview/options.js +0 -77
- package/dist/esm/dockview/popoutWindowService.d.ts +0 -95
- package/dist/esm/dockview/popoutWindowService.js +0 -175
- package/dist/esm/dockview/rootDropTargetService.d.ts +0 -35
- package/dist/esm/dockview/rootDropTargetService.js +0 -82
- package/dist/esm/dockview/strictEventsSequencing.d.ts +0 -7
- package/dist/esm/dockview/strictEventsSequencing.js +0 -41
- package/dist/esm/dockview/tabGroup.d.ts +0 -99
- package/dist/esm/dockview/tabGroup.js +0 -144
- package/dist/esm/dockview/tabGroupAccent.d.ts +0 -65
- package/dist/esm/dockview/tabGroupAccent.js +0 -114
- package/dist/esm/dockview/theme.d.ts +0 -86
- package/dist/esm/dockview/theme.js +0 -136
- package/dist/esm/dockview/types.d.ts +0 -53
- package/dist/esm/dockview/types.js +0 -1
- package/dist/esm/dockview/validate.d.ts +0 -0
- package/dist/esm/dockview/validate.js +0 -76
- package/dist/esm/dockview/watermarkService.d.ts +0 -30
- package/dist/esm/dockview/watermarkService.js +0 -56
- package/dist/esm/dom.d.ts +0 -60
- package/dist/esm/dom.js +0 -375
- package/dist/esm/events.d.ts +0 -79
- package/dist/esm/events.js +0 -219
- package/dist/esm/framwork.d.ts +0 -4
- package/dist/esm/framwork.js +0 -1
- package/dist/esm/gridview/baseComponentGridview.d.ts +0 -111
- package/dist/esm/gridview/baseComponentGridview.js +0 -237
- package/dist/esm/gridview/basePanelView.d.ts +0 -40
- package/dist/esm/gridview/basePanelView.js +0 -91
- package/dist/esm/gridview/branchNode.d.ts +0 -57
- package/dist/esm/gridview/branchNode.js +0 -257
- package/dist/esm/gridview/gridview.d.ts +0 -158
- package/dist/esm/gridview/gridview.js +0 -681
- package/dist/esm/gridview/gridviewComponent.d.ts +0 -88
- package/dist/esm/gridview/gridviewComponent.js +0 -265
- package/dist/esm/gridview/gridviewPanel.d.ts +0 -77
- package/dist/esm/gridview/gridviewPanel.js +0 -182
- package/dist/esm/gridview/leafNode.d.ts +0 -34
- package/dist/esm/gridview/leafNode.js +0 -102
- package/dist/esm/gridview/options.d.ts +0 -15
- package/dist/esm/gridview/options.js +0 -14
- package/dist/esm/gridview/types.d.ts +0 -3
- package/dist/esm/gridview/types.js +0 -1
- package/dist/esm/index.d.ts +0 -58
- package/dist/esm/index.js +0 -44
- package/dist/esm/lifecycle.d.ts +0 -25
- package/dist/esm/lifecycle.js +0 -56
- package/dist/esm/math.d.ts +0 -5
- package/dist/esm/math.js +0 -32
- package/dist/esm/overlay/overlay.d.ts +0 -91
- package/dist/esm/overlay/overlay.js +0 -520
- package/dist/esm/overlay/overlayRenderContainer.d.ts +0 -24
- package/dist/esm/overlay/overlayRenderContainer.js +0 -249
- package/dist/esm/panel/types.d.ts +0 -33
- package/dist/esm/panel/types.js +0 -1
- package/dist/esm/paneview/defaultPaneviewHeader.d.ts +0 -21
- package/dist/esm/paneview/defaultPaneviewHeader.js +0 -65
- package/dist/esm/paneview/draggablePaneviewPanel.d.ts +0 -38
- package/dist/esm/paneview/draggablePaneviewPanel.js +0 -107
- package/dist/esm/paneview/options.d.ts +0 -30
- package/dist/esm/paneview/options.js +0 -22
- package/dist/esm/paneview/paneview.d.ts +0 -41
- package/dist/esm/paneview/paneview.js +0 -148
- package/dist/esm/paneview/paneviewComponent.d.ts +0 -133
- package/dist/esm/paneview/paneviewComponent.js +0 -306
- package/dist/esm/paneview/paneviewPanel.d.ts +0 -98
- package/dist/esm/paneview/paneviewPanel.js +0 -192
- package/dist/esm/popoutWindow.d.ts +0 -38
- package/dist/esm/popoutWindow.js +0 -170
- package/dist/esm/resizable.d.ts +0 -12
- package/dist/esm/resizable.js +0 -66
- package/dist/esm/scrollbar.d.ts +0 -15
- package/dist/esm/scrollbar.js +0 -139
- package/dist/esm/splitview/options.d.ts +0 -21
- package/dist/esm/splitview/options.js +0 -16
- package/dist/esm/splitview/splitview.d.ts +0 -145
- package/dist/esm/splitview/splitview.js +0 -770
- package/dist/esm/splitview/splitviewComponent.d.ts +0 -101
- package/dist/esm/splitview/splitviewComponent.js +0 -267
- package/dist/esm/splitview/splitviewPanel.d.ts +0 -45
- package/dist/esm/splitview/splitviewPanel.js +0 -108
- package/dist/esm/splitview/viewItem.d.ts +0 -25
- package/dist/esm/splitview/viewItem.js +0 -74
- package/dist/esm/svg.d.ts +0 -3
- package/dist/esm/svg.js +0 -31
- package/dist/esm/types.d.ts +0 -31
- package/dist/esm/types.js +0 -1
- package/dist/styles/dockview.css +0 -3436
|
@@ -1,621 +0,0 @@
|
|
|
1
|
-
import { toggleClass } from '../../../dom';
|
|
2
|
-
import { addDisposableListener } from '../../../events';
|
|
3
|
-
import { getPanelData, LocalSelectionTransfer, PanelTransfer, } from '../../../dnd/dataTransfer';
|
|
4
|
-
import { html5Backend, pointerBackend, } from '../../../dnd/backend';
|
|
5
|
-
import { LongPressDetector } from '../../../dnd/pointer/longPress';
|
|
6
|
-
import { CompositeDisposable, } from '../../../lifecycle';
|
|
7
|
-
import { resolveDndCapabilities } from '../../dndCapabilities';
|
|
8
|
-
import { applyTabGroupAccent } from '../../tabGroupAccent';
|
|
9
|
-
import { TabGroupChip } from './tabGroupChip';
|
|
10
|
-
import { Droptarget } from '../../../dnd/droptarget';
|
|
11
|
-
import { NoneTabGroupIndicator, WrapTabGroupIndicator, } from './tabGroupIndicator';
|
|
12
|
-
const EMPTY_MAP = new Map();
|
|
13
|
-
export class TabGroupManager {
|
|
14
|
-
get chipRenderers() {
|
|
15
|
-
return this._chipRenderers;
|
|
16
|
-
}
|
|
17
|
-
get groupUnderlines() {
|
|
18
|
-
var _a, _b;
|
|
19
|
-
return (_b = (_a = this._indicator) === null || _a === void 0 ? void 0 : _a.underlines) !== null && _b !== void 0 ? _b : EMPTY_MAP;
|
|
20
|
-
}
|
|
21
|
-
get skipNextCollapseAnimation() {
|
|
22
|
-
return this._skipNextCollapseAnimation;
|
|
23
|
-
}
|
|
24
|
-
set skipNextCollapseAnimation(value) {
|
|
25
|
-
this._skipNextCollapseAnimation = value;
|
|
26
|
-
}
|
|
27
|
-
constructor(_ctx, _callbacks) {
|
|
28
|
-
this._ctx = _ctx;
|
|
29
|
-
this._callbacks = _callbacks;
|
|
30
|
-
this._chipRenderers = new Map();
|
|
31
|
-
this._indicator = null;
|
|
32
|
-
this._skipNextCollapseAnimation = false;
|
|
33
|
-
this._pendingTransitionCleanups = new Map();
|
|
34
|
-
}
|
|
35
|
-
/**
|
|
36
|
-
* Synchronize chip elements and CSS classes for all tab groups
|
|
37
|
-
* in the parent group model. Call after any tab group mutation.
|
|
38
|
-
*/
|
|
39
|
-
update() {
|
|
40
|
-
var _a;
|
|
41
|
-
const model = this._ctx.group.model;
|
|
42
|
-
const tabGroups = model.getTabGroups();
|
|
43
|
-
// Track which group IDs are still active
|
|
44
|
-
const activeGroupIds = new Set();
|
|
45
|
-
for (const tabGroup of tabGroups) {
|
|
46
|
-
activeGroupIds.add(tabGroup.id);
|
|
47
|
-
this._ensureChipForGroup(tabGroup);
|
|
48
|
-
this._positionChipForGroup(tabGroup);
|
|
49
|
-
}
|
|
50
|
-
// Remove chips for dissolved/destroyed groups
|
|
51
|
-
for (const [groupId, entry] of this._chipRenderers) {
|
|
52
|
-
if (!activeGroupIds.has(groupId)) {
|
|
53
|
-
entry.chip.element.remove();
|
|
54
|
-
entry.chip.dispose();
|
|
55
|
-
(_a = entry.dragSourcesDisposable) === null || _a === void 0 ? void 0 : _a.dispose();
|
|
56
|
-
entry.disposable.dispose();
|
|
57
|
-
this._chipRenderers.delete(groupId);
|
|
58
|
-
}
|
|
59
|
-
}
|
|
60
|
-
// Update CSS classes on all tabs
|
|
61
|
-
this._updateTabGroupClasses();
|
|
62
|
-
}
|
|
63
|
-
/**
|
|
64
|
-
* Re-read the active palette and re-apply colors to chips, tabs and
|
|
65
|
-
* the indicator. Called when `tabGroupColors` / `tabGroupAccent`
|
|
66
|
-
* options change at runtime.
|
|
67
|
-
*/
|
|
68
|
-
refreshAccents() {
|
|
69
|
-
var _a, _b;
|
|
70
|
-
for (const tabGroup of this._ctx.group.model.getTabGroups()) {
|
|
71
|
-
const entry = this._chipRenderers.get(tabGroup.id);
|
|
72
|
-
(_b = entry === null || entry === void 0 ? void 0 : (_a = entry.chip).update) === null || _b === void 0 ? void 0 : _b.call(_a, { tabGroup });
|
|
73
|
-
}
|
|
74
|
-
this._updateTabGroupClasses();
|
|
75
|
-
}
|
|
76
|
-
positionAllChips() {
|
|
77
|
-
if (this._chipRenderers.size === 0) {
|
|
78
|
-
return;
|
|
79
|
-
}
|
|
80
|
-
for (const tabGroup of this._ctx.group.model.getTabGroups()) {
|
|
81
|
-
this._positionChipForGroup(tabGroup);
|
|
82
|
-
}
|
|
83
|
-
}
|
|
84
|
-
updateDirection() {
|
|
85
|
-
const isVertical = this._ctx.getDirection() === 'vertical';
|
|
86
|
-
for (const [, entry] of this._chipRenderers) {
|
|
87
|
-
entry.dropTarget.setTargetZones(isVertical ? ['top'] : ['left']);
|
|
88
|
-
}
|
|
89
|
-
}
|
|
90
|
-
snapshotChipWidths() {
|
|
91
|
-
const widths = new Map();
|
|
92
|
-
for (const [groupId, entry] of this._chipRenderers) {
|
|
93
|
-
widths.set(groupId, entry.chip.element.getBoundingClientRect().width);
|
|
94
|
-
}
|
|
95
|
-
return widths;
|
|
96
|
-
}
|
|
97
|
-
positionUnderlines() {
|
|
98
|
-
var _a;
|
|
99
|
-
(_a = this._indicator) === null || _a === void 0 ? void 0 : _a.positionUnderlines();
|
|
100
|
-
}
|
|
101
|
-
trackUnderlines() {
|
|
102
|
-
var _a;
|
|
103
|
-
(_a = this._indicator) === null || _a === void 0 ? void 0 : _a.trackUnderlines();
|
|
104
|
-
}
|
|
105
|
-
setGroupDragImage(event, tabGroup, chipEl) {
|
|
106
|
-
if (!event.dataTransfer) {
|
|
107
|
-
return;
|
|
108
|
-
}
|
|
109
|
-
const isVertical = this._ctx.getDirection() === 'vertical';
|
|
110
|
-
// Clone the entire tabs list so cloned nodes inherit all
|
|
111
|
-
// theme styles, CSS variables and class-based rules.
|
|
112
|
-
const clone = this._ctx.tabsList.cloneNode(true);
|
|
113
|
-
if (isVertical) {
|
|
114
|
-
// Force horizontal orientation for the drag ghost by
|
|
115
|
-
// removing vertical CSS classes and overriding writing-mode.
|
|
116
|
-
clone.classList.remove('dv-tabs-container-vertical', 'dv-vertical');
|
|
117
|
-
clone.classList.add('dv-horizontal');
|
|
118
|
-
clone.style.writingMode = 'horizontal-tb';
|
|
119
|
-
clone.style.height = `${this._ctx.tabsList.offsetWidth}px`;
|
|
120
|
-
}
|
|
121
|
-
else {
|
|
122
|
-
clone.style.height = `${this._ctx.tabsList.offsetHeight}px`;
|
|
123
|
-
}
|
|
124
|
-
clone.style.width = 'auto';
|
|
125
|
-
clone.style.overflow = 'visible';
|
|
126
|
-
clone.style.pointerEvents = 'none';
|
|
127
|
-
// Remove all elements except the chip so the drag ghost
|
|
128
|
-
// shows only the chip regardless of the group's expanded state.
|
|
129
|
-
const children = Array.from(clone.children);
|
|
130
|
-
const realChildren = Array.from(this._ctx.tabsList.children);
|
|
131
|
-
for (let i = children.length - 1; i >= 0; i--) {
|
|
132
|
-
const real = realChildren[i];
|
|
133
|
-
if (real === chipEl) {
|
|
134
|
-
continue; // keep the chip only
|
|
135
|
-
}
|
|
136
|
-
children[i].remove();
|
|
137
|
-
}
|
|
138
|
-
// Wrap the clone in a minimal ancestor chain so that CSS
|
|
139
|
-
// selectors like `.dv-groupview.dv-active-group > .dv-tabs-and-actions-container .dv-tabs-container > .dv-tab`
|
|
140
|
-
// match the cloned tabs and apply correct color/background.
|
|
141
|
-
const wrapper = document.createElement('div');
|
|
142
|
-
wrapper.className = 'dv-groupview dv-active-group';
|
|
143
|
-
wrapper.style.position = 'fixed';
|
|
144
|
-
wrapper.style.top = '-10000px';
|
|
145
|
-
wrapper.style.left = '0px';
|
|
146
|
-
wrapper.style.height = 'auto';
|
|
147
|
-
wrapper.style.width = 'auto';
|
|
148
|
-
wrapper.style.pointerEvents = 'none';
|
|
149
|
-
const actionsWrapper = document.createElement('div');
|
|
150
|
-
actionsWrapper.className = 'dv-tabs-and-actions-container';
|
|
151
|
-
actionsWrapper.style.height = 'auto';
|
|
152
|
-
actionsWrapper.style.width = 'auto';
|
|
153
|
-
wrapper.appendChild(actionsWrapper);
|
|
154
|
-
actionsWrapper.appendChild(clone);
|
|
155
|
-
// Append inside the dockview root so CSS variables are inherited
|
|
156
|
-
this._ctx.accessor.element.appendChild(wrapper);
|
|
157
|
-
// Compute cursor offset relative to the wrapper element.
|
|
158
|
-
// The cloned chip is the first .dv-tab-group-chip in the clone.
|
|
159
|
-
const clonedChip = clone.querySelector('.dv-tab-group-chip');
|
|
160
|
-
const chipRect = chipEl.getBoundingClientRect();
|
|
161
|
-
const cursorInChipX = event.clientX - chipRect.left;
|
|
162
|
-
const cursorInChipY = event.clientY - chipRect.top;
|
|
163
|
-
if (clonedChip) {
|
|
164
|
-
const clonedChipRect = clonedChip.getBoundingClientRect();
|
|
165
|
-
const wrapperRect = wrapper.getBoundingClientRect();
|
|
166
|
-
const offsetX = clonedChipRect.left - wrapperRect.left + cursorInChipX;
|
|
167
|
-
const offsetY = clonedChipRect.top - wrapperRect.top + cursorInChipY;
|
|
168
|
-
event.dataTransfer.setDragImage(wrapper, offsetX, offsetY);
|
|
169
|
-
}
|
|
170
|
-
else {
|
|
171
|
-
event.dataTransfer.setDragImage(wrapper, cursorInChipX, cursorInChipY);
|
|
172
|
-
}
|
|
173
|
-
// Clean up after the browser captures the image
|
|
174
|
-
requestAnimationFrame(() => {
|
|
175
|
-
wrapper.remove();
|
|
176
|
-
});
|
|
177
|
-
}
|
|
178
|
-
cleanupTransition(panelId) {
|
|
179
|
-
var _a;
|
|
180
|
-
(_a = this._pendingTransitionCleanups.get(panelId)) === null || _a === void 0 ? void 0 : _a();
|
|
181
|
-
this._pendingTransitionCleanups.delete(panelId);
|
|
182
|
-
}
|
|
183
|
-
updateDragAndDropState() {
|
|
184
|
-
var _a, _b, _c;
|
|
185
|
-
const caps = resolveDndCapabilities(this._ctx.accessor.options);
|
|
186
|
-
for (const entry of this._chipRenderers.values()) {
|
|
187
|
-
entry.chip.element.draggable = caps.html5;
|
|
188
|
-
(_a = entry.html5DragSource) === null || _a === void 0 ? void 0 : _a.setDisabled(!caps.html5);
|
|
189
|
-
(_b = entry.pointerDragSource) === null || _b === void 0 ? void 0 : _b.setDisabled(!caps.pointer);
|
|
190
|
-
(_c = entry.pointerDragSource) === null || _c === void 0 ? void 0 : _c.setTouchOnly(!caps.pointerHandlesMouse);
|
|
191
|
-
}
|
|
192
|
-
}
|
|
193
|
-
/**
|
|
194
|
-
* Synchronously dispose the chip drag sources for an in-flight chip
|
|
195
|
-
* drag. Called from `_commitGroupMove` so the transfer payload +
|
|
196
|
-
* iframe shield are released BEFORE the cross-group move detaches
|
|
197
|
-
* the chip (chip dispose is scheduled on a microtask via
|
|
198
|
-
* `_scheduleTabGroupUpdate`, which is too late for callers that read
|
|
199
|
-
* `getPanelData()` synchronously after the move).
|
|
200
|
-
*
|
|
201
|
-
* A cross-group move dissolves the source chip entirely, but a
|
|
202
|
-
* within-group reorder keeps the same chip element — so the sources are
|
|
203
|
-
* cleared to `undefined` here and the subsequent `update()` re-arms them
|
|
204
|
-
* via `_ensureChipForGroup`. Without that re-arm the chip would fire a
|
|
205
|
-
* native `dragstart` (the element keeps `draggable=true`) but never set
|
|
206
|
-
* a transfer payload, leaving the group permanently undraggable after
|
|
207
|
-
* its first move. (#1410)
|
|
208
|
-
*/
|
|
209
|
-
disposeChipDrag(tabGroupId) {
|
|
210
|
-
var _a;
|
|
211
|
-
const entry = this._chipRenderers.get(tabGroupId);
|
|
212
|
-
if (!entry) {
|
|
213
|
-
return;
|
|
214
|
-
}
|
|
215
|
-
// Optional-chained because tests may inject minimal entries
|
|
216
|
-
// that skip the manager's normal `_ensureChipForGroup` flow.
|
|
217
|
-
(_a = entry.dragSourcesDisposable) === null || _a === void 0 ? void 0 : _a.dispose();
|
|
218
|
-
entry.html5DragSource = undefined;
|
|
219
|
-
entry.pointerDragSource = undefined;
|
|
220
|
-
entry.dragSourcesDisposable = undefined;
|
|
221
|
-
}
|
|
222
|
-
/** Cloned chip rect used as the pointer follow-finger ghost. */
|
|
223
|
-
_buildChipGhostElement(chipEl) {
|
|
224
|
-
const style = getComputedStyle(chipEl);
|
|
225
|
-
const clone = chipEl.cloneNode(true);
|
|
226
|
-
Array.from(style).forEach((key) => {
|
|
227
|
-
clone.style.setProperty(key, style.getPropertyValue(key), style.getPropertyPriority(key));
|
|
228
|
-
});
|
|
229
|
-
clone.style.position = 'absolute';
|
|
230
|
-
return clone;
|
|
231
|
-
}
|
|
232
|
-
disposeAll() {
|
|
233
|
-
var _a, _b;
|
|
234
|
-
(_a = this._indicator) === null || _a === void 0 ? void 0 : _a.dispose();
|
|
235
|
-
this._indicator = null;
|
|
236
|
-
for (const [, cleanup] of this._pendingTransitionCleanups) {
|
|
237
|
-
cleanup();
|
|
238
|
-
}
|
|
239
|
-
this._pendingTransitionCleanups.clear();
|
|
240
|
-
for (const [, entry] of this._chipRenderers) {
|
|
241
|
-
entry.chip.element.remove();
|
|
242
|
-
entry.chip.dispose();
|
|
243
|
-
(_b = entry.dragSourcesDisposable) === null || _b === void 0 ? void 0 : _b.dispose();
|
|
244
|
-
entry.disposable.dispose();
|
|
245
|
-
}
|
|
246
|
-
this._chipRenderers.clear();
|
|
247
|
-
}
|
|
248
|
-
_ensureIndicator() {
|
|
249
|
-
var _a, _b, _c;
|
|
250
|
-
const mode = (_b = (_a = this._ctx.accessor.options.theme) === null || _a === void 0 ? void 0 : _a.tabGroupIndicator) !== null && _b !== void 0 ? _b : 'wrap';
|
|
251
|
-
const Ctor = mode === 'none' ? NoneTabGroupIndicator : WrapTabGroupIndicator;
|
|
252
|
-
// Re-create if the indicator type changed (e.g. theme switch)
|
|
253
|
-
if (this._indicator && !(this._indicator instanceof Ctor)) {
|
|
254
|
-
this._indicator.dispose();
|
|
255
|
-
this._indicator = null;
|
|
256
|
-
}
|
|
257
|
-
(_c = this._indicator) !== null && _c !== void 0 ? _c : (this._indicator = new Ctor({
|
|
258
|
-
tabsList: this._ctx.tabsList,
|
|
259
|
-
getTabGroups: () => this._ctx.group.model.getTabGroups(),
|
|
260
|
-
getActivePanelId: () => { var _a; return (_a = this._ctx.group.activePanel) === null || _a === void 0 ? void 0 : _a.id; },
|
|
261
|
-
getTabMap: () => this._ctx.getTabMap(),
|
|
262
|
-
getChipElement: (id) => { var _a; return (_a = this._chipRenderers.get(id)) === null || _a === void 0 ? void 0 : _a.chip.element; },
|
|
263
|
-
getDirection: () => this._ctx.getDirection(),
|
|
264
|
-
getHeaderPosition: () => this._ctx.group.model.headerPosition,
|
|
265
|
-
getColorPalette: () => this._ctx.accessor.tabGroupColorPalette,
|
|
266
|
-
}));
|
|
267
|
-
}
|
|
268
|
-
/**
|
|
269
|
-
* Create the HTML5 + pointer drag sources for a chip (and the direct
|
|
270
|
-
* dragend listener that clears the transfer synchronously). Extracted so
|
|
271
|
-
* both the initial chip build and the post-move re-arm in
|
|
272
|
-
* `_ensureChipForGroup` share one wiring path. (#1410)
|
|
273
|
-
*/
|
|
274
|
-
_createChipDragSources(chip, tabGroup) {
|
|
275
|
-
const caps = resolveDndCapabilities(this._ctx.accessor.options);
|
|
276
|
-
chip.element.draggable = caps.html5;
|
|
277
|
-
const panelTransfer = LocalSelectionTransfer.getInstance();
|
|
278
|
-
// Shared `getData` for both backends. Sets a group-level
|
|
279
|
-
// PanelTransfer (panelId=null, tabGroupId identifies the group).
|
|
280
|
-
// The returned disposer clears it on drag end.
|
|
281
|
-
const getData = () => {
|
|
282
|
-
panelTransfer.setData([
|
|
283
|
-
new PanelTransfer(this._ctx.accessor.id, this._ctx.group.id, null, tabGroup.id),
|
|
284
|
-
], PanelTransfer.prototype);
|
|
285
|
-
return {
|
|
286
|
-
dispose: () => {
|
|
287
|
-
panelTransfer.clearData(PanelTransfer.prototype);
|
|
288
|
-
},
|
|
289
|
-
};
|
|
290
|
-
};
|
|
291
|
-
// The chip's HTML5 drag image is the cloned tabs list (chip only),
|
|
292
|
-
// mounted inside the dockview root for CSS-variable inheritance and
|
|
293
|
-
// positioned against the chip's in-place rect. Layout-dependent
|
|
294
|
-
// offset means we set the drag image directly in `onDragStart`
|
|
295
|
-
// (inside the dragstart handler) rather than via the generic
|
|
296
|
-
// `createGhost` factory, which only knows about ghost specs that
|
|
297
|
-
// can be appended to `document.body`.
|
|
298
|
-
const html5DragSource = html5Backend.createDragSource(chip.element, {
|
|
299
|
-
getData,
|
|
300
|
-
disabled: !caps.html5,
|
|
301
|
-
isCancelled: () => !resolveDndCapabilities(this._ctx.accessor.options).html5,
|
|
302
|
-
onDragStart: (event) => {
|
|
303
|
-
// Type guard via `dataTransfer` — `instanceof DragEvent`
|
|
304
|
-
// would throw in jsdom which doesn't ship a DragEvent
|
|
305
|
-
// constructor.
|
|
306
|
-
if ('dataTransfer' in event && event.dataTransfer) {
|
|
307
|
-
this.setGroupDragImage(event, tabGroup, chip.element);
|
|
308
|
-
}
|
|
309
|
-
this._callbacks.onChipDragStart(tabGroup, chip, event);
|
|
310
|
-
},
|
|
311
|
-
onDragEnd: (event) => {
|
|
312
|
-
var _a, _b;
|
|
313
|
-
(_b = (_a = this._callbacks).onChipDragEnd) === null || _b === void 0 ? void 0 : _b.call(_a, tabGroup, chip, event);
|
|
314
|
-
},
|
|
315
|
-
});
|
|
316
|
-
// Synchronous panelTransfer cleanup directly on the chip element.
|
|
317
|
-
// `Html5DragSource`'s dragend defers data disposal via `setTimeout(0)`
|
|
318
|
-
// so drop handlers can read the payload — but a chip drag that
|
|
319
|
-
// ends via `moveGroupOrPanel` (no actual drop event) needs the
|
|
320
|
-
// singleton cleared immediately, otherwise a synchronous
|
|
321
|
-
// `getPanelData()` after the move still sees the stale chip
|
|
322
|
-
// payload. Attached directly (not via `addDisposableListener`) so
|
|
323
|
-
// the listener survives chip disposal in the detach-then-dragend
|
|
324
|
-
// cross-group path; `once: true` auto-removes after the single
|
|
325
|
-
// dragend that we care about. (#1254)
|
|
326
|
-
const onDragEndClear = () => {
|
|
327
|
-
panelTransfer.clearData(PanelTransfer.prototype);
|
|
328
|
-
};
|
|
329
|
-
chip.element.addEventListener('dragend', onDragEndClear, {
|
|
330
|
-
once: true,
|
|
331
|
-
});
|
|
332
|
-
const pointerDragSource = pointerBackend.createDragSource(chip.element, {
|
|
333
|
-
getData,
|
|
334
|
-
disabled: !caps.pointer,
|
|
335
|
-
touchOnly: !caps.pointerHandlesMouse,
|
|
336
|
-
isCancelled: () => !resolveDndCapabilities(this._ctx.accessor.options).pointer,
|
|
337
|
-
createGhost: () => ({
|
|
338
|
-
element: this._buildChipGhostElement(chip.element),
|
|
339
|
-
offsetX: 8,
|
|
340
|
-
offsetY: 8,
|
|
341
|
-
}),
|
|
342
|
-
onDragStart: (event) => {
|
|
343
|
-
this._callbacks.onChipDragStart(tabGroup, chip, event);
|
|
344
|
-
},
|
|
345
|
-
});
|
|
346
|
-
return {
|
|
347
|
-
html5DragSource,
|
|
348
|
-
pointerDragSource,
|
|
349
|
-
disposable: {
|
|
350
|
-
dispose: () => {
|
|
351
|
-
html5DragSource.dispose();
|
|
352
|
-
pointerDragSource.dispose();
|
|
353
|
-
chip.element.removeEventListener('dragend', onDragEndClear);
|
|
354
|
-
},
|
|
355
|
-
},
|
|
356
|
-
};
|
|
357
|
-
}
|
|
358
|
-
_ensureChipForGroup(tabGroup) {
|
|
359
|
-
const existing = this._chipRenderers.get(tabGroup.id);
|
|
360
|
-
if (existing) {
|
|
361
|
-
// A committed group move tears down the chip's drag sources via
|
|
362
|
-
// `disposeChipDrag`, but a within-group reorder keeps the same
|
|
363
|
-
// chip element alive. Re-arm the sources so the group stays
|
|
364
|
-
// draggable; without this the chip is stuck after its first
|
|
365
|
-
// move — `dragstart` still fires (the element keeps
|
|
366
|
-
// `draggable=true`) but no transfer payload is set. (#1410)
|
|
367
|
-
if (!existing.html5DragSource) {
|
|
368
|
-
const sources = this._createChipDragSources(existing.chip, tabGroup);
|
|
369
|
-
existing.html5DragSource = sources.html5DragSource;
|
|
370
|
-
existing.pointerDragSource = sources.pointerDragSource;
|
|
371
|
-
existing.dragSourcesDisposable = sources.disposable;
|
|
372
|
-
}
|
|
373
|
-
return;
|
|
374
|
-
}
|
|
375
|
-
const createChip = this._ctx.accessor.options.createTabGroupChipComponent;
|
|
376
|
-
const chip = createChip
|
|
377
|
-
? createChip(tabGroup)
|
|
378
|
-
: new TabGroupChip(this._ctx.accessor.tabGroupColorPalette);
|
|
379
|
-
chip.init({ tabGroup, api: this._ctx.accessor.api });
|
|
380
|
-
const dragSources = this._createChipDragSources(chip, tabGroup);
|
|
381
|
-
const disposables = [
|
|
382
|
-
tabGroup.onDidChange(() => {
|
|
383
|
-
var _a;
|
|
384
|
-
(_a = chip.update) === null || _a === void 0 ? void 0 : _a.call(chip, { tabGroup });
|
|
385
|
-
this._updateTabGroupClasses();
|
|
386
|
-
}),
|
|
387
|
-
tabGroup.onDidPanelChange(() => {
|
|
388
|
-
this._positionChipForGroup(tabGroup);
|
|
389
|
-
this._updateTabGroupClasses();
|
|
390
|
-
}),
|
|
391
|
-
tabGroup.onDidCollapseChange(() => {
|
|
392
|
-
this._updateTabGroupClasses();
|
|
393
|
-
}),
|
|
394
|
-
];
|
|
395
|
-
// Context menu: built-in TabGroupChip already aggregates right-click
|
|
396
|
-
// + touch long-press into `onContextMenu`. Custom chip renderers
|
|
397
|
-
// don't, so attach a long-press detector and contextmenu listener
|
|
398
|
-
// directly on their element.
|
|
399
|
-
const onContextMenu = (event) => {
|
|
400
|
-
var _a, _b;
|
|
401
|
-
// A long-press on a chip should preempt the in-flight pointer
|
|
402
|
-
// drag and open the menu instead. Resolve the source from the
|
|
403
|
-
// entry so a post-move re-armed source is cancelled, not the
|
|
404
|
-
// stale one captured at build time. (#1410)
|
|
405
|
-
(_b = (_a = this._chipRenderers
|
|
406
|
-
.get(tabGroup.id)) === null || _a === void 0 ? void 0 : _a.pointerDragSource) === null || _b === void 0 ? void 0 : _b.cancelPending();
|
|
407
|
-
this._callbacks.onChipContextMenu(tabGroup, event);
|
|
408
|
-
};
|
|
409
|
-
if (chip instanceof TabGroupChip) {
|
|
410
|
-
disposables.push(chip.onContextMenu(onContextMenu));
|
|
411
|
-
}
|
|
412
|
-
else {
|
|
413
|
-
disposables.push(new LongPressDetector(chip.element, {
|
|
414
|
-
onLongPress: onContextMenu,
|
|
415
|
-
}), addDisposableListener(chip.element, 'contextmenu', onContextMenu));
|
|
416
|
-
}
|
|
417
|
-
// The chip sits before its group's first tab in the DOM, so it
|
|
418
|
-
// covers the "drop before the group" position. Without a drop
|
|
419
|
-
// target here, dropping a tab over the chip is a dead zone —
|
|
420
|
-
// particularly visible when the group is first in the tabs list
|
|
421
|
-
// and there's no preceding tab whose right zone covers position 0.
|
|
422
|
-
// The smooth animation path already shifts the chip's margin to
|
|
423
|
-
// open a gap, so suppress the overlay in that mode.
|
|
424
|
-
const isVertical = this._ctx.getDirection() === 'vertical';
|
|
425
|
-
const dropTarget = new Droptarget(chip.element, {
|
|
426
|
-
acceptedTargetZones: isVertical ? ['top'] : ['left'],
|
|
427
|
-
overlayModel: {
|
|
428
|
-
activationSize: { value: 100, type: 'percentage' },
|
|
429
|
-
},
|
|
430
|
-
canDisplayOverlay: (event, position) => {
|
|
431
|
-
var _a;
|
|
432
|
-
if (this._ctx.group.locked) {
|
|
433
|
-
return false;
|
|
434
|
-
}
|
|
435
|
-
if (this._ctx.accessor.options.disableDnd) {
|
|
436
|
-
return false;
|
|
437
|
-
}
|
|
438
|
-
const data = getPanelData();
|
|
439
|
-
if (this._ctx.accessor.id === (data === null || data === void 0 ? void 0 : data.viewId)) {
|
|
440
|
-
if (((_a = this._ctx.accessor.options.theme) === null || _a === void 0 ? void 0 : _a.tabAnimation) ===
|
|
441
|
-
'smooth') {
|
|
442
|
-
return false;
|
|
443
|
-
}
|
|
444
|
-
return true;
|
|
445
|
-
}
|
|
446
|
-
return this._ctx.group.model.canDisplayOverlay(event, position, 'tab');
|
|
447
|
-
},
|
|
448
|
-
});
|
|
449
|
-
disposables.push(dropTarget, dropTarget.onDrop((event) => {
|
|
450
|
-
this._callbacks.onChipDrop(tabGroup, event);
|
|
451
|
-
}));
|
|
452
|
-
const disposable = new CompositeDisposable(...disposables);
|
|
453
|
-
this._chipRenderers.set(tabGroup.id, {
|
|
454
|
-
chip,
|
|
455
|
-
html5DragSource: dragSources.html5DragSource,
|
|
456
|
-
pointerDragSource: dragSources.pointerDragSource,
|
|
457
|
-
dragSourcesDisposable: dragSources.disposable,
|
|
458
|
-
disposable,
|
|
459
|
-
dropTarget,
|
|
460
|
-
});
|
|
461
|
-
// Group is born collapsed (cross-group drop, layout restore, etc.):
|
|
462
|
-
// its tabs are about to be added without the collapsed class. Skip
|
|
463
|
-
// the animation in the upcoming _updateTabGroupClasses call so they
|
|
464
|
-
// apply the class instantly instead of transitioning from expanded.
|
|
465
|
-
if (tabGroup.collapsed) {
|
|
466
|
-
this._skipNextCollapseAnimation = true;
|
|
467
|
-
}
|
|
468
|
-
}
|
|
469
|
-
_positionChipForGroup(tabGroup) {
|
|
470
|
-
const entry = this._chipRenderers.get(tabGroup.id);
|
|
471
|
-
if (!entry) {
|
|
472
|
-
return;
|
|
473
|
-
}
|
|
474
|
-
const chipEl = entry.chip.element;
|
|
475
|
-
const panelIds = tabGroup.panelIds;
|
|
476
|
-
if (panelIds.length === 0) {
|
|
477
|
-
chipEl.remove();
|
|
478
|
-
return;
|
|
479
|
-
}
|
|
480
|
-
// Find the first tab element of this group
|
|
481
|
-
const firstPanelId = panelIds[0];
|
|
482
|
-
const firstTabEntry = this._ctx.getTabMap().get(firstPanelId);
|
|
483
|
-
if (!firstTabEntry) {
|
|
484
|
-
chipEl.remove();
|
|
485
|
-
return;
|
|
486
|
-
}
|
|
487
|
-
// Insert chip before the first tab of the group
|
|
488
|
-
const firstTabEl = firstTabEntry.value.element;
|
|
489
|
-
if (chipEl.nextSibling !== firstTabEl) {
|
|
490
|
-
this._ctx.tabsList.insertBefore(chipEl, firstTabEl);
|
|
491
|
-
}
|
|
492
|
-
}
|
|
493
|
-
_updateTabGroupClasses() {
|
|
494
|
-
var _a;
|
|
495
|
-
const model = this._ctx.group.model;
|
|
496
|
-
const tabGroups = model.getTabGroups();
|
|
497
|
-
const tabs = this._ctx.getTabs();
|
|
498
|
-
const tabMap = this._ctx.getTabMap();
|
|
499
|
-
let hasAnimation = false;
|
|
500
|
-
// Build a lookup: panelId → tabGroup
|
|
501
|
-
const panelGroupMap = new Map();
|
|
502
|
-
for (const tg of tabGroups) {
|
|
503
|
-
for (const pid of tg.panelIds) {
|
|
504
|
-
panelGroupMap.set(pid, tg);
|
|
505
|
-
}
|
|
506
|
-
}
|
|
507
|
-
for (const tabEntry of tabs) {
|
|
508
|
-
const tab = tabEntry.value;
|
|
509
|
-
const panelId = tab.panel.id;
|
|
510
|
-
const tg = panelGroupMap.get(panelId);
|
|
511
|
-
const isGrouped = !!tg;
|
|
512
|
-
toggleClass(tab.element, 'dv-tab--grouped', isGrouped);
|
|
513
|
-
if (tg) {
|
|
514
|
-
const ids = tg.panelIds;
|
|
515
|
-
const isFirst = ids[0] === panelId;
|
|
516
|
-
const isLast = ids[ids.length - 1] === panelId;
|
|
517
|
-
toggleClass(tab.element, 'dv-tab--group-first', isFirst);
|
|
518
|
-
toggleClass(tab.element, 'dv-tab--group-last', isLast);
|
|
519
|
-
// Expose the resolved group color as a CSS custom property
|
|
520
|
-
// so pure-CSS themes can use it for borders, backgrounds, etc.
|
|
521
|
-
applyTabGroupAccent(tab.element, tg.color, this._ctx.accessor.tabGroupColorPalette);
|
|
522
|
-
// Collapse / expand with animation
|
|
523
|
-
const isCollapsed = tab.element.classList.contains('dv-tab--group-collapsed');
|
|
524
|
-
if (!tg.collapsed && isCollapsed) {
|
|
525
|
-
// Collapsed → expanding: animate back
|
|
526
|
-
hasAnimation = true;
|
|
527
|
-
tab.element.classList.remove('dv-tab--group-collapsed');
|
|
528
|
-
tab.element.classList.add('dv-tab--group-expanding');
|
|
529
|
-
// Clean up any previous transitionend listener
|
|
530
|
-
// from a rapid collapse/expand cycle
|
|
531
|
-
(_a = this._pendingTransitionCleanups.get(panelId)) === null || _a === void 0 ? void 0 : _a();
|
|
532
|
-
const onEnd = () => {
|
|
533
|
-
tab.element.classList.remove('dv-tab--group-expanding');
|
|
534
|
-
tab.element.style.removeProperty('width');
|
|
535
|
-
tab.element.removeEventListener('transitionend', onEnd);
|
|
536
|
-
clearTimeout(fallbackTimer);
|
|
537
|
-
this._pendingTransitionCleanups.delete(panelId);
|
|
538
|
-
};
|
|
539
|
-
// Fallback in case transitionend never fires
|
|
540
|
-
// (e.g. element removed from DOM mid-transition)
|
|
541
|
-
const fallbackTimer = setTimeout(onEnd, 300);
|
|
542
|
-
this._pendingTransitionCleanups.set(panelId, onEnd);
|
|
543
|
-
tab.element.addEventListener('transitionend', onEnd);
|
|
544
|
-
}
|
|
545
|
-
}
|
|
546
|
-
else {
|
|
547
|
-
toggleClass(tab.element, 'dv-tab--group-first', false);
|
|
548
|
-
toggleClass(tab.element, 'dv-tab--group-last', false);
|
|
549
|
-
tab.element.classList.remove('dv-tab--group-collapsed', 'dv-tab--group-expanding');
|
|
550
|
-
tab.element.style.removeProperty('width');
|
|
551
|
-
tab.element.style.removeProperty('--dv-tab-group-color');
|
|
552
|
-
}
|
|
553
|
-
}
|
|
554
|
-
// Track active group IDs for underline/collapse handling
|
|
555
|
-
const activeGroupIds = new Set();
|
|
556
|
-
// Handle collapse animation per group
|
|
557
|
-
for (const tg of tabGroups) {
|
|
558
|
-
activeGroupIds.add(tg.id);
|
|
559
|
-
// Collapse animation
|
|
560
|
-
const hasNewCollapse = tg.collapsed &&
|
|
561
|
-
tg.panelIds.some((pid) => {
|
|
562
|
-
const te = tabMap.get(pid);
|
|
563
|
-
return (te &&
|
|
564
|
-
!te.value.element.classList.contains('dv-tab--group-collapsed'));
|
|
565
|
-
});
|
|
566
|
-
if (hasNewCollapse) {
|
|
567
|
-
if (this._skipNextCollapseAnimation) {
|
|
568
|
-
// Apply collapsed state instantly (no animation).
|
|
569
|
-
// Disable transitions so the CSS transition on
|
|
570
|
-
// dv-tab--group-collapsed doesn't fire.
|
|
571
|
-
const affected = [];
|
|
572
|
-
for (const pid of tg.panelIds) {
|
|
573
|
-
const te = tabMap.get(pid);
|
|
574
|
-
if (te) {
|
|
575
|
-
te.value.element.style.transition = 'none';
|
|
576
|
-
te.value.element.classList.add('dv-tab--group-collapsed');
|
|
577
|
-
affected.push(te.value.element);
|
|
578
|
-
}
|
|
579
|
-
}
|
|
580
|
-
if (affected.length > 0) {
|
|
581
|
-
void affected[0].offsetHeight; // single reflow
|
|
582
|
-
for (const el of affected) {
|
|
583
|
-
el.style.removeProperty('transition');
|
|
584
|
-
}
|
|
585
|
-
}
|
|
586
|
-
}
|
|
587
|
-
else {
|
|
588
|
-
hasAnimation = true;
|
|
589
|
-
const isVert = this._ctx.getDirection() === 'vertical';
|
|
590
|
-
for (const pid of tg.panelIds) {
|
|
591
|
-
const te = tabMap.get(pid);
|
|
592
|
-
if (te &&
|
|
593
|
-
!te.value.element.classList.contains('dv-tab--group-collapsed')) {
|
|
594
|
-
const rect = te.value.element.getBoundingClientRect();
|
|
595
|
-
if (isVert) {
|
|
596
|
-
te.value.element.style.height = `${rect.height}px`;
|
|
597
|
-
}
|
|
598
|
-
else {
|
|
599
|
-
te.value.element.style.width = `${rect.width}px`;
|
|
600
|
-
}
|
|
601
|
-
void te.value.element.offsetHeight; // force reflow
|
|
602
|
-
te.value.element.classList.add('dv-tab--group-collapsed');
|
|
603
|
-
}
|
|
604
|
-
}
|
|
605
|
-
}
|
|
606
|
-
}
|
|
607
|
-
}
|
|
608
|
-
this._skipNextCollapseAnimation = false;
|
|
609
|
-
// Sync indicator underlines and position them
|
|
610
|
-
this._ensureIndicator();
|
|
611
|
-
if (this._indicator) {
|
|
612
|
-
this._indicator.syncUnderlineElements(activeGroupIds);
|
|
613
|
-
if (hasAnimation) {
|
|
614
|
-
this._indicator.trackUnderlines();
|
|
615
|
-
}
|
|
616
|
-
else {
|
|
617
|
-
this._indicator.positionUnderlines();
|
|
618
|
-
}
|
|
619
|
-
}
|
|
620
|
-
}
|
|
621
|
-
}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { createChevronRightButton } from '../../../svg';
|
|
2
|
-
export function createDropdownElementHandle() {
|
|
3
|
-
const el = document.createElement('div');
|
|
4
|
-
el.className = 'dv-tabs-overflow-dropdown-default';
|
|
5
|
-
const text = document.createElement('span');
|
|
6
|
-
text.textContent = ``;
|
|
7
|
-
const icon = createChevronRightButton();
|
|
8
|
-
el.appendChild(icon);
|
|
9
|
-
el.appendChild(text);
|
|
10
|
-
return {
|
|
11
|
-
element: el,
|
|
12
|
-
update: (params) => {
|
|
13
|
-
text.textContent = `${params.tabs}`;
|
|
14
|
-
},
|
|
15
|
-
};
|
|
16
|
-
}
|