dockview-core 7.0.3 → 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,243 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __extends = (this && this.__extends) || (function () {
|
|
3
|
-
var extendStatics = function (d, b) {
|
|
4
|
-
extendStatics = Object.setPrototypeOf ||
|
|
5
|
-
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
6
|
-
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
7
|
-
return extendStatics(d, b);
|
|
8
|
-
};
|
|
9
|
-
return function (d, b) {
|
|
10
|
-
if (typeof b !== "function" && b !== null)
|
|
11
|
-
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
12
|
-
extendStatics(d, b);
|
|
13
|
-
function __() { this.constructor = d; }
|
|
14
|
-
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
15
|
-
};
|
|
16
|
-
})();
|
|
17
|
-
var __values = (this && this.__values) || function(o) {
|
|
18
|
-
var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
|
|
19
|
-
if (m) return m.call(o);
|
|
20
|
-
if (o && typeof o.length === "number") return {
|
|
21
|
-
next: function () {
|
|
22
|
-
if (o && i >= o.length) o = void 0;
|
|
23
|
-
return { value: o && o[i++], done: !o };
|
|
24
|
-
}
|
|
25
|
-
};
|
|
26
|
-
throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
|
|
27
|
-
};
|
|
28
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
|
-
exports.PointerDragController = void 0;
|
|
30
|
-
var dom_1 = require("../../dom");
|
|
31
|
-
var events_1 = require("../../events");
|
|
32
|
-
var lifecycle_1 = require("../../lifecycle");
|
|
33
|
-
/**
|
|
34
|
-
* Singleton — only one pointer-driven drag active at a time.
|
|
35
|
-
*
|
|
36
|
-
* State is shared across every Dockview instance on the page. Targets
|
|
37
|
-
* from instance B receive hit-tests from drags originating in instance A;
|
|
38
|
-
* that's intentional for cross-instance drops since `LocalSelectionTransfer`
|
|
39
|
-
* is also process-wide. The corollary is that every Tabs subscriber to
|
|
40
|
-
* `onDragMove` fires for every pointer drag globally — each subscriber
|
|
41
|
-
* hit-tests against its own DOM, so this is O(N) per pointermove where N
|
|
42
|
-
* is the number of registered listeners across all instances.
|
|
43
|
-
*/
|
|
44
|
-
var PointerDragController = /** @class */ (function (_super) {
|
|
45
|
-
__extends(PointerDragController, _super);
|
|
46
|
-
function PointerDragController() {
|
|
47
|
-
var _this = _super.call(this) || this;
|
|
48
|
-
_this._targets = new Set();
|
|
49
|
-
/** Kept in sync with `_targets` so hit-testing is allocation-free. */
|
|
50
|
-
_this._targetByElement = new Map();
|
|
51
|
-
_this._onDragStart = new events_1.Emitter();
|
|
52
|
-
_this.onDragStart = _this._onDragStart.event;
|
|
53
|
-
_this._onDragMove = new events_1.Emitter();
|
|
54
|
-
_this.onDragMove = _this._onDragMove.event;
|
|
55
|
-
_this._onDragEnd = new events_1.Emitter();
|
|
56
|
-
_this.onDragEnd = _this._onDragEnd.event;
|
|
57
|
-
_this.addDisposables(_this._onDragStart, _this._onDragMove, _this._onDragEnd);
|
|
58
|
-
return _this;
|
|
59
|
-
}
|
|
60
|
-
PointerDragController.getInstance = function () {
|
|
61
|
-
var _a;
|
|
62
|
-
(_a = PointerDragController._instance) !== null && _a !== void 0 ? _a : (PointerDragController._instance = new PointerDragController());
|
|
63
|
-
return PointerDragController._instance;
|
|
64
|
-
};
|
|
65
|
-
Object.defineProperty(PointerDragController.prototype, "active", {
|
|
66
|
-
get: function () {
|
|
67
|
-
return this._active;
|
|
68
|
-
},
|
|
69
|
-
enumerable: false,
|
|
70
|
-
configurable: true
|
|
71
|
-
});
|
|
72
|
-
PointerDragController.prototype.registerTarget = function (target) {
|
|
73
|
-
var _this = this;
|
|
74
|
-
this._targets.add(target);
|
|
75
|
-
this._targetByElement.set(target.element, target);
|
|
76
|
-
return {
|
|
77
|
-
dispose: function () {
|
|
78
|
-
_this._targets.delete(target);
|
|
79
|
-
if (_this._targetByElement.get(target.element) === target) {
|
|
80
|
-
_this._targetByElement.delete(target.element);
|
|
81
|
-
}
|
|
82
|
-
if (_this._currentTarget === target) {
|
|
83
|
-
_this._currentTarget = undefined;
|
|
84
|
-
}
|
|
85
|
-
},
|
|
86
|
-
};
|
|
87
|
-
};
|
|
88
|
-
PointerDragController.prototype.beginDrag = function (args) {
|
|
89
|
-
var _this = this;
|
|
90
|
-
var _a, _b, _c;
|
|
91
|
-
if (this._active) {
|
|
92
|
-
this.cancel();
|
|
93
|
-
}
|
|
94
|
-
var pointerEvent = args.pointerEvent, source = args.source;
|
|
95
|
-
// Call `getData()` before mutating controller state — a throw
|
|
96
|
-
// here would otherwise leave `_active` populated with no window
|
|
97
|
-
// listeners installed, blocking every subsequent drag.
|
|
98
|
-
var dataDisposable = args.getData();
|
|
99
|
-
this._active = {
|
|
100
|
-
pointerId: pointerEvent.pointerId,
|
|
101
|
-
startX: pointerEvent.clientX,
|
|
102
|
-
startY: pointerEvent.clientY,
|
|
103
|
-
source: source,
|
|
104
|
-
};
|
|
105
|
-
this._onDragMoveCallback = args.onDragMove;
|
|
106
|
-
this._onDragEndCallback = args.onDragEnd;
|
|
107
|
-
this._dataDisposable = dataDisposable;
|
|
108
|
-
this._ghost = args.ghost;
|
|
109
|
-
// Iframes capture pointermove once the cursor crosses into them,
|
|
110
|
-
// which would freeze the drag from the parent window's POV.
|
|
111
|
-
this._iframeShield = (0, dom_1.disableIframePointEvents)((_a = source.ownerDocument) !== null && _a !== void 0 ? _a : document);
|
|
112
|
-
var startEvent = {
|
|
113
|
-
clientX: pointerEvent.clientX,
|
|
114
|
-
clientY: pointerEvent.clientY,
|
|
115
|
-
pointerEvent: pointerEvent,
|
|
116
|
-
};
|
|
117
|
-
this._onDragStart.fire(startEvent);
|
|
118
|
-
// Source's owning window — popout drags fire on their own window,
|
|
119
|
-
// not the main one.
|
|
120
|
-
var targetWindow = (_c = (_b = source.ownerDocument) === null || _b === void 0 ? void 0 : _b.defaultView) !== null && _c !== void 0 ? _c : globalThis.window;
|
|
121
|
-
this._moveListener = (0, events_1.addDisposableListener)(targetWindow, 'pointermove', function (e) {
|
|
122
|
-
var _a;
|
|
123
|
-
if (e.pointerId !== ((_a = _this._active) === null || _a === void 0 ? void 0 : _a.pointerId)) {
|
|
124
|
-
return;
|
|
125
|
-
}
|
|
126
|
-
_this._handleMove(e);
|
|
127
|
-
});
|
|
128
|
-
this._upListener = (0, events_1.addDisposableListener)(targetWindow, 'pointerup', function (e) {
|
|
129
|
-
var _a;
|
|
130
|
-
if (e.pointerId !== ((_a = _this._active) === null || _a === void 0 ? void 0 : _a.pointerId)) {
|
|
131
|
-
return;
|
|
132
|
-
}
|
|
133
|
-
_this._handleEnd(e, true);
|
|
134
|
-
});
|
|
135
|
-
this._cancelListener = (0, events_1.addDisposableListener)(targetWindow, 'pointercancel', function (e) {
|
|
136
|
-
var _a;
|
|
137
|
-
if (e.pointerId !== ((_a = _this._active) === null || _a === void 0 ? void 0 : _a.pointerId)) {
|
|
138
|
-
return;
|
|
139
|
-
}
|
|
140
|
-
_this._handleEnd(e, false);
|
|
141
|
-
});
|
|
142
|
-
};
|
|
143
|
-
PointerDragController.prototype.cancel = function () {
|
|
144
|
-
var _a, _b;
|
|
145
|
-
if (!this._active) {
|
|
146
|
-
return;
|
|
147
|
-
}
|
|
148
|
-
(_a = this._currentTarget) === null || _a === void 0 ? void 0 : _a.handleDragLeave();
|
|
149
|
-
this._teardown();
|
|
150
|
-
(_b = this._dataDisposable) === null || _b === void 0 ? void 0 : _b.dispose();
|
|
151
|
-
this._dataDisposable = undefined;
|
|
152
|
-
};
|
|
153
|
-
PointerDragController.prototype._findTargetUnder = function (x, y) {
|
|
154
|
-
var e_1, _a;
|
|
155
|
-
var _b, _c;
|
|
156
|
-
// `elementsFromPoint` is topmost-first; walk up to find the closest
|
|
157
|
-
// registered ancestor (so a tab beats the layout-root that contains it).
|
|
158
|
-
// Use the source's owning document so popout drags hit their own targets.
|
|
159
|
-
var sourceDoc = (_c = (_b = this._active) === null || _b === void 0 ? void 0 : _b.source.ownerDocument) !== null && _c !== void 0 ? _c : document;
|
|
160
|
-
var elements = sourceDoc.elementsFromPoint(x, y);
|
|
161
|
-
try {
|
|
162
|
-
for (var elements_1 = __values(elements), elements_1_1 = elements_1.next(); !elements_1_1.done; elements_1_1 = elements_1.next()) {
|
|
163
|
-
var el = elements_1_1.value;
|
|
164
|
-
var current = el;
|
|
165
|
-
while (current) {
|
|
166
|
-
var target = this._targetByElement.get(current);
|
|
167
|
-
if (target) {
|
|
168
|
-
return target;
|
|
169
|
-
}
|
|
170
|
-
current = current.parentElement;
|
|
171
|
-
}
|
|
172
|
-
}
|
|
173
|
-
}
|
|
174
|
-
catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
|
175
|
-
finally {
|
|
176
|
-
try {
|
|
177
|
-
if (elements_1_1 && !elements_1_1.done && (_a = elements_1.return)) _a.call(elements_1);
|
|
178
|
-
}
|
|
179
|
-
finally { if (e_1) throw e_1.error; }
|
|
180
|
-
}
|
|
181
|
-
return undefined;
|
|
182
|
-
};
|
|
183
|
-
PointerDragController.prototype._handleMove = function (e) {
|
|
184
|
-
var _a, _b, _c;
|
|
185
|
-
(_a = this._ghost) === null || _a === void 0 ? void 0 : _a.update(e.clientX, e.clientY);
|
|
186
|
-
var dragEvent = {
|
|
187
|
-
clientX: e.clientX,
|
|
188
|
-
clientY: e.clientY,
|
|
189
|
-
pointerEvent: e,
|
|
190
|
-
};
|
|
191
|
-
var newTarget = this._findTargetUnder(e.clientX, e.clientY);
|
|
192
|
-
if (newTarget !== this._currentTarget) {
|
|
193
|
-
(_b = this._currentTarget) === null || _b === void 0 ? void 0 : _b.handleDragLeave();
|
|
194
|
-
this._currentTarget = newTarget;
|
|
195
|
-
}
|
|
196
|
-
if (newTarget) {
|
|
197
|
-
newTarget.handleDragOver(dragEvent);
|
|
198
|
-
}
|
|
199
|
-
(_c = this._onDragMoveCallback) === null || _c === void 0 ? void 0 : _c.call(this, dragEvent);
|
|
200
|
-
this._onDragMove.fire(dragEvent);
|
|
201
|
-
};
|
|
202
|
-
PointerDragController.prototype._handleEnd = function (e, dropped) {
|
|
203
|
-
var _a;
|
|
204
|
-
var dragEvent = {
|
|
205
|
-
clientX: e.clientX,
|
|
206
|
-
clientY: e.clientY,
|
|
207
|
-
pointerEvent: e,
|
|
208
|
-
};
|
|
209
|
-
if (dropped && this._currentTarget) {
|
|
210
|
-
this._currentTarget.handleDrop(dragEvent);
|
|
211
|
-
}
|
|
212
|
-
else {
|
|
213
|
-
(_a = this._currentTarget) === null || _a === void 0 ? void 0 : _a.handleDragLeave();
|
|
214
|
-
}
|
|
215
|
-
var onEnd = this._onDragEndCallback;
|
|
216
|
-
var dataDisposable = this._dataDisposable;
|
|
217
|
-
this._teardown();
|
|
218
|
-
this._dataDisposable = undefined;
|
|
219
|
-
// Defer disposal so drop handlers can still read the transfer data.
|
|
220
|
-
setTimeout(function () { return dataDisposable === null || dataDisposable === void 0 ? void 0 : dataDisposable.dispose(); }, 0);
|
|
221
|
-
onEnd === null || onEnd === void 0 ? void 0 : onEnd(dragEvent, dropped);
|
|
222
|
-
this._onDragEnd.fire(dragEvent);
|
|
223
|
-
};
|
|
224
|
-
PointerDragController.prototype._teardown = function () {
|
|
225
|
-
var _a, _b, _c, _d, _e;
|
|
226
|
-
this._currentTarget = undefined;
|
|
227
|
-
this._active = undefined;
|
|
228
|
-
this._onDragMoveCallback = undefined;
|
|
229
|
-
this._onDragEndCallback = undefined;
|
|
230
|
-
(_a = this._ghost) === null || _a === void 0 ? void 0 : _a.dispose();
|
|
231
|
-
this._ghost = undefined;
|
|
232
|
-
(_b = this._iframeShield) === null || _b === void 0 ? void 0 : _b.release();
|
|
233
|
-
this._iframeShield = undefined;
|
|
234
|
-
(_c = this._moveListener) === null || _c === void 0 ? void 0 : _c.dispose();
|
|
235
|
-
(_d = this._upListener) === null || _d === void 0 ? void 0 : _d.dispose();
|
|
236
|
-
(_e = this._cancelListener) === null || _e === void 0 ? void 0 : _e.dispose();
|
|
237
|
-
this._moveListener = undefined;
|
|
238
|
-
this._upListener = undefined;
|
|
239
|
-
this._cancelListener = undefined;
|
|
240
|
-
};
|
|
241
|
-
return PointerDragController;
|
|
242
|
-
}(lifecycle_1.CompositeDisposable));
|
|
243
|
-
exports.PointerDragController = PointerDragController;
|
|
@@ -1,197 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __extends = (this && this.__extends) || (function () {
|
|
3
|
-
var extendStatics = function (d, b) {
|
|
4
|
-
extendStatics = Object.setPrototypeOf ||
|
|
5
|
-
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
6
|
-
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
7
|
-
return extendStatics(d, b);
|
|
8
|
-
};
|
|
9
|
-
return function (d, b) {
|
|
10
|
-
if (typeof b !== "function" && b !== null)
|
|
11
|
-
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
12
|
-
extendStatics(d, b);
|
|
13
|
-
function __() { this.constructor = d; }
|
|
14
|
-
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
15
|
-
};
|
|
16
|
-
})();
|
|
17
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
-
exports.PointerDragSource = void 0;
|
|
19
|
-
var events_1 = require("../../events");
|
|
20
|
-
var lifecycle_1 = require("../../lifecycle");
|
|
21
|
-
var pointerDragController_1 = require("./pointerDragController");
|
|
22
|
-
var DEFAULT_THRESHOLD = 5;
|
|
23
|
-
var DEFAULT_TOUCH_INITIATION_DELAY = 250;
|
|
24
|
-
var DEFAULT_PRESS_TOLERANCE = 8;
|
|
25
|
-
/**
|
|
26
|
-
* Pointer-event drag source. Waits for movement past `threshold` (and
|
|
27
|
-
* touch-only `touchInitiationDelay`) before promoting to a drag so taps
|
|
28
|
-
* pass through unaffected.
|
|
29
|
-
*/
|
|
30
|
-
var PointerDragSource = /** @class */ (function (_super) {
|
|
31
|
-
__extends(PointerDragSource, _super);
|
|
32
|
-
function PointerDragSource(element, options) {
|
|
33
|
-
var _a;
|
|
34
|
-
var _this = _super.call(this) || this;
|
|
35
|
-
_this.element = element;
|
|
36
|
-
_this.options = options;
|
|
37
|
-
_this._disabled = false;
|
|
38
|
-
_this._armed = false;
|
|
39
|
-
_this._startX = 0;
|
|
40
|
-
_this._startY = 0;
|
|
41
|
-
_this._touchOnly = (_a = options.touchOnly) !== null && _a !== void 0 ? _a : true;
|
|
42
|
-
_this.addDisposables((0, events_1.addDisposableListener)(_this.element, 'pointerdown', function (e) {
|
|
43
|
-
_this._onPointerDown(e);
|
|
44
|
-
}));
|
|
45
|
-
return _this;
|
|
46
|
-
}
|
|
47
|
-
PointerDragSource.prototype.setDisabled = function (value) {
|
|
48
|
-
this._disabled = value;
|
|
49
|
-
if (value) {
|
|
50
|
-
this._cancelPending();
|
|
51
|
-
}
|
|
52
|
-
};
|
|
53
|
-
/**
|
|
54
|
-
* `false` lets the pointer source also handle mouse pointers; used when
|
|
55
|
-
* `dndStrategy: 'pointer'` to drive every input type through this path.
|
|
56
|
-
*/
|
|
57
|
-
PointerDragSource.prototype.setTouchOnly = function (value) {
|
|
58
|
-
if (this._touchOnly === value) {
|
|
59
|
-
return;
|
|
60
|
-
}
|
|
61
|
-
this._touchOnly = value;
|
|
62
|
-
// A pending mouse-tracked drag should be abandoned if we re-enable
|
|
63
|
-
// the touch-only filter mid-flight.
|
|
64
|
-
if (value) {
|
|
65
|
-
this._cancelPending();
|
|
66
|
-
}
|
|
67
|
-
};
|
|
68
|
-
PointerDragSource.prototype._shouldHandle = function (event) {
|
|
69
|
-
var _a, _b;
|
|
70
|
-
if (this._disabled) {
|
|
71
|
-
return false;
|
|
72
|
-
}
|
|
73
|
-
// Pointer-type filter runs before isCancelled — consumer state read
|
|
74
|
-
// by isCancelled may not be populated for events we'll never handle.
|
|
75
|
-
if (this._touchOnly &&
|
|
76
|
-
event.pointerType !== 'touch' &&
|
|
77
|
-
event.pointerType !== 'pen') {
|
|
78
|
-
return false;
|
|
79
|
-
}
|
|
80
|
-
if ((_b = (_a = this.options).isCancelled) === null || _b === void 0 ? void 0 : _b.call(_a, event)) {
|
|
81
|
-
return false;
|
|
82
|
-
}
|
|
83
|
-
return true;
|
|
84
|
-
};
|
|
85
|
-
PointerDragSource.prototype._onPointerDown = function (event) {
|
|
86
|
-
var _this = this;
|
|
87
|
-
var _a, _b, _c, _d, _e;
|
|
88
|
-
if (!this._shouldHandle(event)) {
|
|
89
|
-
return;
|
|
90
|
-
}
|
|
91
|
-
// Defensive: a fresh pointerdown supersedes any in-flight tracking.
|
|
92
|
-
this._cancelPending();
|
|
93
|
-
this._pendingPointerId = event.pointerId;
|
|
94
|
-
this._startX = event.clientX;
|
|
95
|
-
this._startY = event.clientY;
|
|
96
|
-
this._startEvent = event;
|
|
97
|
-
var isTouch = event.pointerType === 'touch' || event.pointerType === 'pen';
|
|
98
|
-
// Touch waits a short window so a still finger can press-and-hold
|
|
99
|
-
// before drifting; once the timer fires, any motion past `threshold`
|
|
100
|
-
// begins the drag.
|
|
101
|
-
var initiationDelayOpt = this.options.touchInitiationDelay;
|
|
102
|
-
var initiationDelay = (_a = (typeof initiationDelayOpt === 'function'
|
|
103
|
-
? initiationDelayOpt()
|
|
104
|
-
: initiationDelayOpt)) !== null && _a !== void 0 ? _a : DEFAULT_TOUCH_INITIATION_DELAY;
|
|
105
|
-
this._armed = !isTouch || initiationDelay <= 0;
|
|
106
|
-
if (isTouch &&
|
|
107
|
-
initiationDelay > 0 &&
|
|
108
|
-
Number.isFinite(initiationDelay)) {
|
|
109
|
-
this._armTimer = setTimeout(function () {
|
|
110
|
-
_this._armTimer = undefined;
|
|
111
|
-
_this._armed = true;
|
|
112
|
-
}, initiationDelay);
|
|
113
|
-
}
|
|
114
|
-
var threshold = (_b = this.options.threshold) !== null && _b !== void 0 ? _b : DEFAULT_THRESHOLD;
|
|
115
|
-
var pressToleranceOpt = this.options.pressTolerance;
|
|
116
|
-
var pressTolerance = (_c = (typeof pressToleranceOpt === 'function'
|
|
117
|
-
? pressToleranceOpt()
|
|
118
|
-
: pressToleranceOpt)) !== null && _c !== void 0 ? _c : DEFAULT_PRESS_TOLERANCE;
|
|
119
|
-
// Source's owning window — popout drags fire on their own window.
|
|
120
|
-
var targetWindow = (_e = (_d = this.element.ownerDocument) === null || _d === void 0 ? void 0 : _d.defaultView) !== null && _e !== void 0 ? _e : globalThis.window;
|
|
121
|
-
this._pendingMoveListener = (0, events_1.addDisposableListener)(targetWindow, 'pointermove', function (moveEvent) {
|
|
122
|
-
if (moveEvent.pointerId !== _this._pendingPointerId) {
|
|
123
|
-
return;
|
|
124
|
-
}
|
|
125
|
-
var dx = moveEvent.clientX - _this._startX;
|
|
126
|
-
var dy = moveEvent.clientY - _this._startY;
|
|
127
|
-
var distance = Math.hypot(dx, dy);
|
|
128
|
-
if (_this._armed) {
|
|
129
|
-
if (distance >= threshold) {
|
|
130
|
-
_this._beginDrag(moveEvent);
|
|
131
|
-
}
|
|
132
|
-
return;
|
|
133
|
-
}
|
|
134
|
-
// Pre-arm phase: a flick past `pressTolerance` in any
|
|
135
|
-
// direction is treated as drag intent. The element opts out
|
|
136
|
-
// of native scroll via `touch-action: none`; container-level
|
|
137
|
-
// scrolling lives on the surrounding strip's empty space.
|
|
138
|
-
if (distance > pressTolerance) {
|
|
139
|
-
_this._beginDrag(moveEvent);
|
|
140
|
-
}
|
|
141
|
-
});
|
|
142
|
-
this._pendingUpListener = (0, events_1.addDisposableListener)(targetWindow, 'pointerup', function (upEvent) {
|
|
143
|
-
if (upEvent.pointerId !== _this._pendingPointerId) {
|
|
144
|
-
return;
|
|
145
|
-
}
|
|
146
|
-
_this._cancelPending();
|
|
147
|
-
});
|
|
148
|
-
this._pendingCancelListener = (0, events_1.addDisposableListener)(targetWindow, 'pointercancel', function (cancelEvent) {
|
|
149
|
-
if (cancelEvent.pointerId !== _this._pendingPointerId) {
|
|
150
|
-
return;
|
|
151
|
-
}
|
|
152
|
-
_this._cancelPending();
|
|
153
|
-
});
|
|
154
|
-
};
|
|
155
|
-
/** For sibling gesture detectors (e.g. LongPressDetector) to dismiss a pending drag. */
|
|
156
|
-
PointerDragSource.prototype.cancelPending = function () {
|
|
157
|
-
this._cancelPending();
|
|
158
|
-
};
|
|
159
|
-
PointerDragSource.prototype._cancelPending = function () {
|
|
160
|
-
var _a, _b, _c;
|
|
161
|
-
this._pendingPointerId = undefined;
|
|
162
|
-
if (this._armTimer !== undefined) {
|
|
163
|
-
clearTimeout(this._armTimer);
|
|
164
|
-
this._armTimer = undefined;
|
|
165
|
-
}
|
|
166
|
-
this._armed = false;
|
|
167
|
-
(_a = this._pendingMoveListener) === null || _a === void 0 ? void 0 : _a.dispose();
|
|
168
|
-
(_b = this._pendingUpListener) === null || _b === void 0 ? void 0 : _b.dispose();
|
|
169
|
-
(_c = this._pendingCancelListener) === null || _c === void 0 ? void 0 : _c.dispose();
|
|
170
|
-
this._pendingMoveListener = undefined;
|
|
171
|
-
this._pendingUpListener = undefined;
|
|
172
|
-
this._pendingCancelListener = undefined;
|
|
173
|
-
this._startEvent = undefined;
|
|
174
|
-
};
|
|
175
|
-
PointerDragSource.prototype._beginDrag = function (triggerEvent) {
|
|
176
|
-
var _this = this;
|
|
177
|
-
var _a, _b, _c, _d, _e;
|
|
178
|
-
var startEvent = (_a = this._startEvent) !== null && _a !== void 0 ? _a : triggerEvent;
|
|
179
|
-
this._cancelPending();
|
|
180
|
-
(_c = (_b = this.options).onDragStart) === null || _c === void 0 ? void 0 : _c.call(_b, startEvent);
|
|
181
|
-
var ghost = (_e = (_d = this.options).createGhost) === null || _e === void 0 ? void 0 : _e.call(_d, startEvent);
|
|
182
|
-
pointerDragController_1.PointerDragController.getInstance().beginDrag({
|
|
183
|
-
pointerEvent: triggerEvent,
|
|
184
|
-
source: this.element,
|
|
185
|
-
getData: function () { return _this.options.getData(startEvent); },
|
|
186
|
-
ghost: ghost,
|
|
187
|
-
onDragMove: this.options.onDragMove,
|
|
188
|
-
onDragEnd: this.options.onDragEnd,
|
|
189
|
-
});
|
|
190
|
-
};
|
|
191
|
-
PointerDragSource.prototype.dispose = function () {
|
|
192
|
-
this._cancelPending();
|
|
193
|
-
_super.prototype.dispose.call(this);
|
|
194
|
-
};
|
|
195
|
-
return PointerDragSource;
|
|
196
|
-
}(lifecycle_1.CompositeDisposable));
|
|
197
|
-
exports.PointerDragSource = PointerDragSource;
|
|
@@ -1,198 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __extends = (this && this.__extends) || (function () {
|
|
3
|
-
var extendStatics = function (d, b) {
|
|
4
|
-
extendStatics = Object.setPrototypeOf ||
|
|
5
|
-
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
6
|
-
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
7
|
-
return extendStatics(d, b);
|
|
8
|
-
};
|
|
9
|
-
return function (d, b) {
|
|
10
|
-
if (typeof b !== "function" && b !== null)
|
|
11
|
-
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
12
|
-
extendStatics(d, b);
|
|
13
|
-
function __() { this.constructor = d; }
|
|
14
|
-
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
15
|
-
};
|
|
16
|
-
})();
|
|
17
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
-
exports.PointerDropTarget = void 0;
|
|
19
|
-
var events_1 = require("../../events");
|
|
20
|
-
var lifecycle_1 = require("../../lifecycle");
|
|
21
|
-
var dropOverlay_1 = require("../dropOverlay");
|
|
22
|
-
var droptarget_1 = require("../droptarget");
|
|
23
|
-
var pointerDragController_1 = require("./pointerDragController");
|
|
24
|
-
var DEFAULT_ACTIVATION_SIZE = {
|
|
25
|
-
value: 20,
|
|
26
|
-
type: 'percentage',
|
|
27
|
-
};
|
|
28
|
-
/** Pointer-driven counterpart to `Droptarget` with identical visual output. */
|
|
29
|
-
var PointerDropTarget = /** @class */ (function (_super) {
|
|
30
|
-
__extends(PointerDropTarget, _super);
|
|
31
|
-
function PointerDropTarget(element, options) {
|
|
32
|
-
var _this = _super.call(this) || this;
|
|
33
|
-
_this.element = element;
|
|
34
|
-
_this.options = options;
|
|
35
|
-
_this._onDrop = new events_1.Emitter();
|
|
36
|
-
_this.onDrop = _this._onDrop.event;
|
|
37
|
-
_this._onWillShowOverlay = new events_1.Emitter();
|
|
38
|
-
_this.onWillShowOverlay = _this._onWillShowOverlay.event;
|
|
39
|
-
_this._disabled = false;
|
|
40
|
-
_this._acceptedTargetZonesSet = new Set(options.acceptedTargetZones);
|
|
41
|
-
var handle = {
|
|
42
|
-
element: _this.element,
|
|
43
|
-
handleDragOver: function (e) { return _this._onDragOver(e); },
|
|
44
|
-
handleDragLeave: function () { return _this._onDragLeave(); },
|
|
45
|
-
handleDrop: function (e) { return _this._onDropEvent(e); },
|
|
46
|
-
};
|
|
47
|
-
_this.addDisposables(_this._onDrop, _this._onWillShowOverlay, pointerDragController_1.PointerDragController.getInstance().registerTarget(handle));
|
|
48
|
-
return _this;
|
|
49
|
-
}
|
|
50
|
-
Object.defineProperty(PointerDropTarget.prototype, "disabled", {
|
|
51
|
-
get: function () {
|
|
52
|
-
return this._disabled;
|
|
53
|
-
},
|
|
54
|
-
set: function (value) {
|
|
55
|
-
this._disabled = value;
|
|
56
|
-
if (value) {
|
|
57
|
-
this._removeOverlay();
|
|
58
|
-
}
|
|
59
|
-
},
|
|
60
|
-
enumerable: false,
|
|
61
|
-
configurable: true
|
|
62
|
-
});
|
|
63
|
-
Object.defineProperty(PointerDropTarget.prototype, "state", {
|
|
64
|
-
get: function () {
|
|
65
|
-
return this._state;
|
|
66
|
-
},
|
|
67
|
-
enumerable: false,
|
|
68
|
-
configurable: true
|
|
69
|
-
});
|
|
70
|
-
PointerDropTarget.prototype.setTargetZones = function (zones) {
|
|
71
|
-
this._acceptedTargetZonesSet = new Set(zones);
|
|
72
|
-
};
|
|
73
|
-
PointerDropTarget.prototype.setOverlayModel = function (model) {
|
|
74
|
-
this.options.overlayModel = model;
|
|
75
|
-
};
|
|
76
|
-
PointerDropTarget.prototype.dispose = function () {
|
|
77
|
-
this._removeOverlay();
|
|
78
|
-
_super.prototype.dispose.call(this);
|
|
79
|
-
};
|
|
80
|
-
PointerDropTarget.prototype._onDragOver = function (event) {
|
|
81
|
-
var _a, _b, _c, _d, _e;
|
|
82
|
-
if (this._disabled) {
|
|
83
|
-
this._removeOverlay();
|
|
84
|
-
return;
|
|
85
|
-
}
|
|
86
|
-
var overrideTarget = (_b = (_a = this.options).getOverrideTarget) === null || _b === void 0 ? void 0 : _b.call(_a);
|
|
87
|
-
if (this._acceptedTargetZonesSet.size === 0) {
|
|
88
|
-
if (overrideTarget) {
|
|
89
|
-
return;
|
|
90
|
-
}
|
|
91
|
-
this._removeOverlay();
|
|
92
|
-
return;
|
|
93
|
-
}
|
|
94
|
-
var outlineEl = (_e = (_d = (_c = this.options).getOverlayOutline) === null || _d === void 0 ? void 0 : _d.call(_c)) !== null && _e !== void 0 ? _e : this.element;
|
|
95
|
-
var width = outlineEl.offsetWidth;
|
|
96
|
-
var height = outlineEl.offsetHeight;
|
|
97
|
-
if (width === 0 || height === 0) {
|
|
98
|
-
return;
|
|
99
|
-
}
|
|
100
|
-
var rect = outlineEl.getBoundingClientRect();
|
|
101
|
-
var x = event.clientX - rect.left;
|
|
102
|
-
var y = event.clientY - rect.top;
|
|
103
|
-
var quadrant = this._calculateQuadrant(x, y, width, height);
|
|
104
|
-
if (quadrant === null) {
|
|
105
|
-
this._removeOverlay();
|
|
106
|
-
return;
|
|
107
|
-
}
|
|
108
|
-
if (!this.options.canDisplayOverlay(event.pointerEvent, quadrant)) {
|
|
109
|
-
if (overrideTarget) {
|
|
110
|
-
return;
|
|
111
|
-
}
|
|
112
|
-
this._removeOverlay();
|
|
113
|
-
return;
|
|
114
|
-
}
|
|
115
|
-
var willShow = new droptarget_1.WillShowOverlayEvent({
|
|
116
|
-
nativeEvent: event.pointerEvent,
|
|
117
|
-
position: quadrant,
|
|
118
|
-
});
|
|
119
|
-
this._onWillShowOverlay.fire(willShow);
|
|
120
|
-
if (willShow.defaultPrevented) {
|
|
121
|
-
this._removeOverlay();
|
|
122
|
-
return;
|
|
123
|
-
}
|
|
124
|
-
if (overrideTarget) {
|
|
125
|
-
(0, dropOverlay_1.renderAnchoredOverlay)({
|
|
126
|
-
outlineElement: outlineEl,
|
|
127
|
-
targetModel: overrideTarget,
|
|
128
|
-
quadrant: quadrant,
|
|
129
|
-
width: width,
|
|
130
|
-
height: height,
|
|
131
|
-
overlayModel: this.options.overlayModel,
|
|
132
|
-
className: this.options.className,
|
|
133
|
-
});
|
|
134
|
-
this._state = quadrant;
|
|
135
|
-
return;
|
|
136
|
-
}
|
|
137
|
-
if (!this._targetElement) {
|
|
138
|
-
var els = (0, dropOverlay_1.createOverlayElements)();
|
|
139
|
-
this._targetElement = els.dropzone;
|
|
140
|
-
this._overlayElement = els.selection;
|
|
141
|
-
this._state = 'center';
|
|
142
|
-
this.element.classList.add('dv-drop-target');
|
|
143
|
-
this.element.append(this._targetElement);
|
|
144
|
-
}
|
|
145
|
-
if (this._overlayElement) {
|
|
146
|
-
(0, dropOverlay_1.renderInPlaceOverlay)(this._overlayElement, quadrant, width, height, this.options.overlayModel);
|
|
147
|
-
}
|
|
148
|
-
this._state = quadrant;
|
|
149
|
-
};
|
|
150
|
-
PointerDropTarget.prototype._onDragLeave = function () {
|
|
151
|
-
var _a, _b;
|
|
152
|
-
var overrideTarget = (_b = (_a = this.options).getOverrideTarget) === null || _b === void 0 ? void 0 : _b.call(_a);
|
|
153
|
-
// Anchor target owns its own lifecycle; just clear our latched
|
|
154
|
-
// state so a subsequent pointerup doesn't fire a stale drop.
|
|
155
|
-
if (overrideTarget) {
|
|
156
|
-
this._state = undefined;
|
|
157
|
-
overrideTarget.clear();
|
|
158
|
-
return;
|
|
159
|
-
}
|
|
160
|
-
this._removeOverlay();
|
|
161
|
-
};
|
|
162
|
-
PointerDropTarget.prototype._onDropEvent = function (event) {
|
|
163
|
-
var _a, _b;
|
|
164
|
-
var state = this._state;
|
|
165
|
-
var overrideTarget = (_b = (_a = this.options).getOverrideTarget) === null || _b === void 0 ? void 0 : _b.call(_a);
|
|
166
|
-
this._removeOverlay();
|
|
167
|
-
overrideTarget === null || overrideTarget === void 0 ? void 0 : overrideTarget.clear();
|
|
168
|
-
if (state) {
|
|
169
|
-
this._onDrop.fire({
|
|
170
|
-
position: state,
|
|
171
|
-
nativeEvent: event.pointerEvent,
|
|
172
|
-
});
|
|
173
|
-
}
|
|
174
|
-
};
|
|
175
|
-
PointerDropTarget.prototype._calculateQuadrant = function (x, y, width, height) {
|
|
176
|
-
var _a, _b;
|
|
177
|
-
var activation = (_b = (_a = this.options.overlayModel) === null || _a === void 0 ? void 0 : _a.activationSize) !== null && _b !== void 0 ? _b : DEFAULT_ACTIVATION_SIZE;
|
|
178
|
-
if (activation.type === 'percentage') {
|
|
179
|
-
return (0, droptarget_1.calculateQuadrantAsPercentage)(this._acceptedTargetZonesSet, x, y, width, height, activation.value);
|
|
180
|
-
}
|
|
181
|
-
return (0, droptarget_1.calculateQuadrantAsPixels)(this._acceptedTargetZonesSet, x, y, width, height, activation.value);
|
|
182
|
-
};
|
|
183
|
-
PointerDropTarget.prototype._removeOverlay = function () {
|
|
184
|
-
var _a;
|
|
185
|
-
if (this._targetElement) {
|
|
186
|
-
this._state = undefined;
|
|
187
|
-
(_a = this._targetElement.parentElement) === null || _a === void 0 ? void 0 : _a.classList.remove('dv-drop-target');
|
|
188
|
-
this._targetElement.remove();
|
|
189
|
-
this._targetElement = undefined;
|
|
190
|
-
this._overlayElement = undefined;
|
|
191
|
-
}
|
|
192
|
-
else {
|
|
193
|
-
this._state = undefined;
|
|
194
|
-
}
|
|
195
|
-
};
|
|
196
|
-
return PointerDropTarget;
|
|
197
|
-
}(lifecycle_1.CompositeDisposable));
|
|
198
|
-
exports.PointerDropTarget = PointerDropTarget;
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.PointerGhost = void 0;
|
|
4
|
-
/**
|
|
5
|
-
* Floating clone that follows the pointer; appended to the owning
|
|
6
|
-
* document's body with `pointer-events: none` so it doesn't intercept
|
|
7
|
-
* hit-testing.
|
|
8
|
-
*/
|
|
9
|
-
var PointerGhost = /** @class */ (function () {
|
|
10
|
-
function PointerGhost(opts) {
|
|
11
|
-
var _a, _b, _c, _d, _e;
|
|
12
|
-
this._disposed = false;
|
|
13
|
-
this.element = opts.element;
|
|
14
|
-
this.offsetX = (_a = opts.offsetX) !== null && _a !== void 0 ? _a : 0;
|
|
15
|
-
this.offsetY = (_b = opts.offsetY) !== null && _b !== void 0 ? _b : 0;
|
|
16
|
-
// Animate via transform (see update); position:fixed for scroll-independence.
|
|
17
|
-
this.element.style.position = 'fixed';
|
|
18
|
-
this.element.style.left = '0px';
|
|
19
|
-
this.element.style.top = '0px';
|
|
20
|
-
this.element.style.pointerEvents = 'none';
|
|
21
|
-
this.element.style.zIndex = '99999';
|
|
22
|
-
this.element.style.opacity = String((_c = opts.opacity) !== null && _c !== void 0 ? _c : 0.8);
|
|
23
|
-
this.element.style.willChange = 'transform';
|
|
24
|
-
this.element.style.transform = "translate3d(".concat(opts.initialX - this.offsetX, "px, ").concat(opts.initialY - this.offsetY, "px, 0)");
|
|
25
|
-
var ownerDocument = (_e = (_d = opts.owner) === null || _d === void 0 ? void 0 : _d.ownerDocument) !== null && _e !== void 0 ? _e : document;
|
|
26
|
-
ownerDocument.body.appendChild(this.element);
|
|
27
|
-
}
|
|
28
|
-
PointerGhost.prototype.update = function (clientX, clientY) {
|
|
29
|
-
if (this._disposed) {
|
|
30
|
-
return;
|
|
31
|
-
}
|
|
32
|
-
// translate3d composites on the GPU — no layout per pointermove.
|
|
33
|
-
this.element.style.transform = "translate3d(".concat(clientX - this.offsetX, "px, ").concat(clientY - this.offsetY, "px, 0)");
|
|
34
|
-
};
|
|
35
|
-
PointerGhost.prototype.dispose = function () {
|
|
36
|
-
if (this._disposed) {
|
|
37
|
-
return;
|
|
38
|
-
}
|
|
39
|
-
this._disposed = true;
|
|
40
|
-
this.element.remove();
|
|
41
|
-
};
|
|
42
|
-
return PointerGhost;
|
|
43
|
-
}());
|
|
44
|
-
exports.PointerGhost = PointerGhost;
|