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,159 +0,0 @@
|
|
|
1
|
-
import { CompositeDisposable } from '../lifecycle';
|
|
2
|
-
import { resolveMessages } from './accessibilityMessages';
|
|
3
|
-
import { defineModule } from './modules';
|
|
4
|
-
/** Bulk transactions whose per-panel events should not each be announced. */
|
|
5
|
-
const isBulk = (kind) => kind === 'load' || kind === 'clear';
|
|
6
|
-
function createLiveRegion(politeness) {
|
|
7
|
-
const el = document.createElement('div');
|
|
8
|
-
el.className =
|
|
9
|
-
politeness === 'assertive'
|
|
10
|
-
? 'dv-live-region-assertive'
|
|
11
|
-
: 'dv-live-region';
|
|
12
|
-
// assertive interrupts the SR (errors / cancellations); polite waits for a
|
|
13
|
-
// pause (routine status). `alert` implies assertive, `status` implies polite.
|
|
14
|
-
el.setAttribute('role', politeness === 'assertive' ? 'alert' : 'status');
|
|
15
|
-
el.setAttribute('aria-live', politeness);
|
|
16
|
-
el.setAttribute('aria-atomic', 'true');
|
|
17
|
-
// Visually hidden but kept in the accessibility tree (never display:none /
|
|
18
|
-
// visibility:hidden, which would drop it from AT). Standard clip pattern.
|
|
19
|
-
Object.assign(el.style, {
|
|
20
|
-
position: 'absolute',
|
|
21
|
-
width: '1px',
|
|
22
|
-
height: '1px',
|
|
23
|
-
margin: '-1px',
|
|
24
|
-
padding: '0',
|
|
25
|
-
overflow: 'hidden',
|
|
26
|
-
clip: 'rect(0 0 0 0)',
|
|
27
|
-
clipPath: 'inset(50%)',
|
|
28
|
-
whiteSpace: 'nowrap',
|
|
29
|
-
border: '0',
|
|
30
|
-
});
|
|
31
|
-
return el;
|
|
32
|
-
}
|
|
33
|
-
/**
|
|
34
|
-
* Narrates layout state changes to screen readers via visually-hidden
|
|
35
|
-
* `aria-live` regions. Free / core (WCAG 4.1.3). Announces panel open/close +
|
|
36
|
-
* the shared `announce()` sink (the accessibility module narrates docking here too).
|
|
37
|
-
* Two regions: a **polite** one for routine status and an **assertive** one
|
|
38
|
-
* for errors/cancellations. The bulk load/clear burst is suppressed via the
|
|
39
|
-
* mutation-transaction events, and an app can take over delivery entirely with
|
|
40
|
-
* the `announcer` option.
|
|
41
|
-
*/
|
|
42
|
-
export class LiveRegionService extends CompositeDisposable {
|
|
43
|
-
constructor(host) {
|
|
44
|
-
super();
|
|
45
|
-
this._suppressDepth = 0;
|
|
46
|
-
this._locationSubs = new Map();
|
|
47
|
-
this._host = host;
|
|
48
|
-
this._polite = createLiveRegion('polite');
|
|
49
|
-
this._assertive = createLiveRegion('assertive');
|
|
50
|
-
host.element.appendChild(this._polite);
|
|
51
|
-
host.element.appendChild(this._assertive);
|
|
52
|
-
this.addDisposables({ dispose: () => this._polite.remove() }, { dispose: () => this._assertive.remove() }, host.onDidAddPanel((panel) => this._announce(panel, 'open')), host.onDidRemovePanel((panel) => this._announce(panel, 'close')),
|
|
53
|
-
// Bracket bulk transactions so a fromJSON / clear doesn't announce
|
|
54
|
-
// every nested add/remove.
|
|
55
|
-
host.onWillMutateLayout((e) => {
|
|
56
|
-
if (isBulk(e.kind)) {
|
|
57
|
-
this._suppressDepth++;
|
|
58
|
-
}
|
|
59
|
-
}), host.onDidMutateLayout((e) => {
|
|
60
|
-
if (isBulk(e.kind)) {
|
|
61
|
-
this._suppressDepth = Math.max(0, this._suppressDepth - 1);
|
|
62
|
-
}
|
|
63
|
-
}), host.onDidMaximizedGroupChange((e) => {
|
|
64
|
-
const panel = e.group.activePanel;
|
|
65
|
-
if (panel) {
|
|
66
|
-
this._announce(panel, e.isMaximized ? 'maximize' : 'restore');
|
|
67
|
-
}
|
|
68
|
-
}),
|
|
69
|
-
// Narrate a group floating / docking back / popping out. A group is
|
|
70
|
-
// born in the grid then transitions, so track each group's previous
|
|
71
|
-
// location and ignore the no-op initial `-> grid`.
|
|
72
|
-
host.onDidAddGroup((group) => this._trackLocation(group)), host.onDidRemoveGroup((group) => {
|
|
73
|
-
var _a;
|
|
74
|
-
(_a = this._locationSubs.get(group.id)) === null || _a === void 0 ? void 0 : _a.dispose();
|
|
75
|
-
this._locationSubs.delete(group.id);
|
|
76
|
-
}), {
|
|
77
|
-
dispose: () => {
|
|
78
|
-
this._locationSubs.forEach((sub) => sub.dispose());
|
|
79
|
-
this._locationSubs.clear();
|
|
80
|
-
},
|
|
81
|
-
});
|
|
82
|
-
}
|
|
83
|
-
_trackLocation(group) {
|
|
84
|
-
let prev = group.api.location.type;
|
|
85
|
-
const sub = group.api.onDidLocationChange((e) => {
|
|
86
|
-
const next = e.location.type;
|
|
87
|
-
if (next === prev) {
|
|
88
|
-
return;
|
|
89
|
-
}
|
|
90
|
-
prev = next;
|
|
91
|
-
const panel = group.activePanel;
|
|
92
|
-
if (!panel) {
|
|
93
|
-
return;
|
|
94
|
-
}
|
|
95
|
-
const kind = next === 'floating'
|
|
96
|
-
? 'float'
|
|
97
|
-
: next === 'popout'
|
|
98
|
-
? 'popout'
|
|
99
|
-
: 'dock';
|
|
100
|
-
this._announce(panel, kind);
|
|
101
|
-
});
|
|
102
|
-
this._locationSubs.set(group.id, sub);
|
|
103
|
-
}
|
|
104
|
-
announce(message, politeness = 'polite') {
|
|
105
|
-
// Opt-out (read live so `updateOptions({ announcements })` applies).
|
|
106
|
-
if (this._host.options.announcements === false ||
|
|
107
|
-
this._suppressDepth > 0 ||
|
|
108
|
-
!message) {
|
|
109
|
-
return;
|
|
110
|
-
}
|
|
111
|
-
// Apps can route announcements into their own SR system instead of the
|
|
112
|
-
// built-in regions (e.g. a shared app-wide live region).
|
|
113
|
-
const announcer = this._host.options.announcer;
|
|
114
|
-
if (announcer) {
|
|
115
|
-
announcer({ message, politeness });
|
|
116
|
-
return;
|
|
117
|
-
}
|
|
118
|
-
// Clearing first forces SRs to re-announce an identical message.
|
|
119
|
-
const region = politeness === 'assertive' ? this._assertive : this._polite;
|
|
120
|
-
region.textContent = '';
|
|
121
|
-
region.textContent = message;
|
|
122
|
-
}
|
|
123
|
-
_announce(panel, kind) {
|
|
124
|
-
var _a, _b;
|
|
125
|
-
// The app may localise/override the message, suppress it (null / ''),
|
|
126
|
-
// or fall through to the default (undefined).
|
|
127
|
-
const custom = (_b = (_a = this._host.options).getAnnouncement) === null || _b === void 0 ? void 0 : _b.call(_a, { kind, panel });
|
|
128
|
-
if (custom === null || custom === '') {
|
|
129
|
-
return;
|
|
130
|
-
}
|
|
131
|
-
this.announce(custom !== null && custom !== void 0 ? custom : this._defaultMessage(panel, kind));
|
|
132
|
-
}
|
|
133
|
-
_defaultMessage(panel, kind) {
|
|
134
|
-
var _a;
|
|
135
|
-
const m = resolveMessages(this._host.options.messages);
|
|
136
|
-
const name = (_a = panel.title) !== null && _a !== void 0 ? _a : panel.id;
|
|
137
|
-
switch (kind) {
|
|
138
|
-
case 'open':
|
|
139
|
-
return m.panelOpened(name);
|
|
140
|
-
case 'close':
|
|
141
|
-
return m.panelClosed(name);
|
|
142
|
-
case 'maximize':
|
|
143
|
-
return m.groupMaximized(name);
|
|
144
|
-
case 'restore':
|
|
145
|
-
return m.groupRestored(name);
|
|
146
|
-
case 'float':
|
|
147
|
-
return m.groupFloated(name);
|
|
148
|
-
case 'dock':
|
|
149
|
-
return m.groupDocked(name);
|
|
150
|
-
case 'popout':
|
|
151
|
-
return m.groupPoppedOut(name);
|
|
152
|
-
}
|
|
153
|
-
}
|
|
154
|
-
}
|
|
155
|
-
export const LiveRegionModule = defineModule({
|
|
156
|
-
name: 'LiveRegion',
|
|
157
|
-
serviceKey: 'liveRegionService',
|
|
158
|
-
create: (host) => new LiveRegionService(host),
|
|
159
|
-
});
|
|
@@ -1,119 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Service + host interfaces for the pluggable feature modules. Core references
|
|
3
|
-
* only these interfaces — never a module's implementation — so each module is
|
|
4
|
-
* decoupled from core and independently testable / removable. Keep this file
|
|
5
|
-
* implementation-free.
|
|
6
|
-
*/
|
|
7
|
-
import { IDisposable } from '../lifecycle';
|
|
8
|
-
import { Event } from '../events';
|
|
9
|
-
import { DroptargetOverlayModel, Position } from '../dnd/droptarget';
|
|
10
|
-
import { IDragGhostSpec } from '../dnd/backend';
|
|
11
|
-
import { DockviewApi } from '../api/component.api';
|
|
12
|
-
import { DockviewGroupPanel } from './dockviewGroupPanel';
|
|
13
|
-
import { IDockviewPanel } from './dockviewPanel';
|
|
14
|
-
import { ITabGroup } from './tabGroup';
|
|
15
|
-
import { TabGroupColorPalette } from './tabGroupAccent';
|
|
16
|
-
import { PopupService } from './components/popupService';
|
|
17
|
-
import { DockviewComponentOptions } from './options';
|
|
18
|
-
import { DockviewLayoutMutationEvent, GroupNavigationDirection } from './dockviewComponent';
|
|
19
|
-
import { DockviewWillDropEvent } from './dockviewGroupPanelModel';
|
|
20
|
-
import { GroupDragEvent, TabDragEvent } from './components/titlebar/tabsContainer';
|
|
21
|
-
import { DockviewGroupDropLocation, DockviewTabGroupChangeEvent, DockviewTabGroupPanelChangeEvent, DockviewTabGroupCollapsedChangeEvent, DockviewWillShowOverlayLocationEvent } from './events';
|
|
22
|
-
export interface IContextMenuHost {
|
|
23
|
-
readonly options: DockviewComponentOptions;
|
|
24
|
-
readonly api: DockviewApi;
|
|
25
|
-
readonly tabGroupColorPalette: TabGroupColorPalette;
|
|
26
|
-
getPopupServiceForGroup(group: DockviewGroupPanel): PopupService;
|
|
27
|
-
}
|
|
28
|
-
export interface IContextMenuService {
|
|
29
|
-
show(panel: IDockviewPanel, group: DockviewGroupPanel, event: MouseEvent): void;
|
|
30
|
-
showForChip(tabGroup: ITabGroup, group: DockviewGroupPanel, event: MouseEvent): void;
|
|
31
|
-
}
|
|
32
|
-
export interface ITabGroupChipsHost {
|
|
33
|
-
readonly onDidAddGroup: Event<DockviewGroupPanel>;
|
|
34
|
-
readonly onDidRemoveGroup: Event<DockviewGroupPanel>;
|
|
35
|
-
fireDidCreateTabGroup(event: DockviewTabGroupChangeEvent): void;
|
|
36
|
-
fireDidDestroyTabGroup(event: DockviewTabGroupChangeEvent): void;
|
|
37
|
-
fireDidAddPanelToTabGroup(event: DockviewTabGroupPanelChangeEvent): void;
|
|
38
|
-
fireDidRemovePanelFromTabGroup(event: DockviewTabGroupPanelChangeEvent): void;
|
|
39
|
-
fireDidTabGroupChange(event: DockviewTabGroupChangeEvent): void;
|
|
40
|
-
fireDidTabGroupCollapsedChange(event: DockviewTabGroupCollapsedChangeEvent): void;
|
|
41
|
-
}
|
|
42
|
-
export interface ITabGroupChipsService extends IDisposable {
|
|
43
|
-
/**
|
|
44
|
-
* Subscribe to the per-group tab-group events on the given group and
|
|
45
|
-
* re-fire them on the host's component-level emitters. Returns a
|
|
46
|
-
* disposable that detaches the subscriptions; intended to be bundled
|
|
47
|
-
* into the per-group CompositeDisposable so cleanup happens when the
|
|
48
|
-
* group is removed.
|
|
49
|
-
*/
|
|
50
|
-
attachToGroup(group: DockviewGroupPanel): IDisposable;
|
|
51
|
-
}
|
|
52
|
-
export interface IAccessibilityHost {
|
|
53
|
-
/**
|
|
54
|
-
* The outermost dockview element (the shell, which also contains edge
|
|
55
|
-
* groups). A getter — it must resolve to the shell once that exists, not
|
|
56
|
-
* the inner gridview, or keydowns from edge groups are missed.
|
|
57
|
-
*/
|
|
58
|
-
readonly rootElement: HTMLElement;
|
|
59
|
-
readonly options: DockviewComponentOptions;
|
|
60
|
-
readonly groups: DockviewGroupPanel[];
|
|
61
|
-
readonly activeGroup: DockviewGroupPanel | undefined;
|
|
62
|
-
readonly activePanel: IDockviewPanel | undefined;
|
|
63
|
-
/**
|
|
64
|
-
* The next / previous group in gridview (spatial) order, wrapping round —
|
|
65
|
-
* the one piece of navigation that needs the grid internals. All other
|
|
66
|
-
* focus logic lives in the service, using the public group API.
|
|
67
|
-
*/
|
|
68
|
-
adjacentGroup(group: DockviewGroupPanel, reverse: boolean): DockviewGroupPanel | undefined;
|
|
69
|
-
/** The nearest grid group in a spatial direction — drives Alt+Arrow nav. */
|
|
70
|
-
adjacentGroupInDirection(group: DockviewGroupPanel, direction: GroupNavigationDirection): DockviewGroupPanel | undefined;
|
|
71
|
-
/** Fires before / after a structural layout change — used to restore focus on close. */
|
|
72
|
-
readonly onWillMutateLayout: Event<DockviewLayoutMutationEvent>;
|
|
73
|
-
readonly onDidMutateLayout: Event<DockviewLayoutMutationEvent>;
|
|
74
|
-
showDropPreview(group: DockviewGroupPanel, position: Position): IDisposable;
|
|
75
|
-
announce(message: string): void;
|
|
76
|
-
dockPanel(panel: IDockviewPanel, group: DockviewGroupPanel, position: Position): void;
|
|
77
|
-
}
|
|
78
|
-
export interface IAccessibilityService extends IDisposable {
|
|
79
|
-
}
|
|
80
|
-
/**
|
|
81
|
-
* Marker for the advanced keyboard docking service (spatial group focus +
|
|
82
|
-
* keyboard move mode). Self-driven; the component never calls into it.
|
|
83
|
-
*/
|
|
84
|
-
export interface IKeyboardDockingService extends IDisposable {
|
|
85
|
-
}
|
|
86
|
-
export interface IAdvancedDnDHost {
|
|
87
|
-
readonly options: DockviewComponentOptions;
|
|
88
|
-
readonly api: DockviewApi;
|
|
89
|
-
fireWillDragPanel(event: TabDragEvent): void;
|
|
90
|
-
fireWillDragGroup(event: GroupDragEvent): void;
|
|
91
|
-
fireWillDrop(event: DockviewWillDropEvent): void;
|
|
92
|
-
fireWillShowOverlay(event: DockviewWillShowOverlayLocationEvent): void;
|
|
93
|
-
}
|
|
94
|
-
export interface IAdvancedDnDService extends IDisposable {
|
|
95
|
-
dispatchWillDragPanel(event: TabDragEvent): void;
|
|
96
|
-
dispatchWillDragGroup(event: GroupDragEvent): void;
|
|
97
|
-
dispatchWillDrop(event: DockviewWillDropEvent): void;
|
|
98
|
-
dispatchWillShowOverlay(event: DockviewWillShowOverlayLocationEvent): void;
|
|
99
|
-
/**
|
|
100
|
-
* Resolve the custom group drag ghost from
|
|
101
|
-
* `createGroupDragGhostComponent`, or `undefined` when no factory is
|
|
102
|
-
* configured (the caller then renders the default chip). Returning
|
|
103
|
-
* `undefined` is also what happens when this module is absent.
|
|
104
|
-
*/
|
|
105
|
-
buildGroupDragGhost(group: DockviewGroupPanel): IDragGhostSpec | undefined;
|
|
106
|
-
/**
|
|
107
|
-
* Resolve the app-supplied overlay model for a group drop target via the
|
|
108
|
-
* `dropOverlayModel` option, or `undefined` to keep the target's default.
|
|
109
|
-
*/
|
|
110
|
-
resolveOverlayModel(location: DockviewGroupDropLocation, group?: DockviewGroupPanel): DroptargetOverlayModel | undefined;
|
|
111
|
-
/**
|
|
112
|
-
* Render the drop-preview overlay on a group at `position` — the same
|
|
113
|
-
* overlay a mouse drag shows — without a live drag. Returns a disposable
|
|
114
|
-
* that clears it. Used by keyboard docking so keyboard and mouse previews
|
|
115
|
-
* are identical (single source of truth). Commit the move via the public
|
|
116
|
-
* `api.moveGroupOrPanel({ to: { group, position } })`.
|
|
117
|
-
*/
|
|
118
|
-
showPreviewOverlay(group: DockviewGroupPanel, position: Position): IDisposable;
|
|
119
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,110 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Internal module system for dockview.
|
|
3
|
-
*
|
|
4
|
-
* Modules are feature bundles that register services into the dockview
|
|
5
|
-
* component. `registerModules(...)` is the one public entry point — it lets a
|
|
6
|
-
* sibling package contribute modules that `DockviewComponent` picks up at
|
|
7
|
-
* construction. The richer opt-in surface (a per-component `modules` option,
|
|
8
|
-
* framework wrappers) is still reserved for a future version; the module
|
|
9
|
-
* authoring API (`defineModule`, the service contracts) remains internal.
|
|
10
|
-
*/
|
|
11
|
-
import { IDisposable } from '../lifecycle';
|
|
12
|
-
import { IFloatingGroupService } from './floatingGroupService';
|
|
13
|
-
import { IPopoutWindowService } from './popoutWindowService';
|
|
14
|
-
import { IWatermarkService } from './watermarkService';
|
|
15
|
-
import { IEdgeGroupService } from './edgeGroupService';
|
|
16
|
-
import { IRootDropTargetService } from './rootDropTargetService';
|
|
17
|
-
import { IHeaderActionsService } from './headerActionsService';
|
|
18
|
-
import { ILiveRegionService } from './liveRegionService';
|
|
19
|
-
import { IAccessibilityService, IAdvancedDnDService, IContextMenuService, IKeyboardDockingService, ITabGroupChipsService } from './moduleContracts';
|
|
20
|
-
export interface ServiceCollection {
|
|
21
|
-
floatingGroupService?: IFloatingGroupService;
|
|
22
|
-
popoutWindowService?: IPopoutWindowService;
|
|
23
|
-
watermarkService?: IWatermarkService;
|
|
24
|
-
edgeGroupService?: IEdgeGroupService;
|
|
25
|
-
tabGroupChipsService?: ITabGroupChipsService;
|
|
26
|
-
contextMenuService?: IContextMenuService;
|
|
27
|
-
rootDropTargetService?: IRootDropTargetService;
|
|
28
|
-
headerActionsService?: IHeaderActionsService;
|
|
29
|
-
advancedDnDService?: IAdvancedDnDService;
|
|
30
|
-
liveRegionService?: ILiveRegionService;
|
|
31
|
-
accessibilityService?: IAccessibilityService;
|
|
32
|
-
keyboardDockingService?: IKeyboardDockingService;
|
|
33
|
-
}
|
|
34
|
-
export interface DockviewModule<THost = unknown> {
|
|
35
|
-
moduleName: string;
|
|
36
|
-
services?: Record<string, (host: THost) => unknown>;
|
|
37
|
-
/**
|
|
38
|
-
* Optional post-construct hook called once after the host is fully
|
|
39
|
-
* constructed and all module services are instantiated. Use this to
|
|
40
|
-
* subscribe to host events — the returned disposable runs at host
|
|
41
|
-
* teardown. Components don't need to call into the service from event
|
|
42
|
-
* handlers; the module owns its own reactivity.
|
|
43
|
-
*/
|
|
44
|
-
init?: (host: THost, services: ServiceCollection) => IDisposable;
|
|
45
|
-
dependsOn?: DockviewModule<any>[];
|
|
46
|
-
}
|
|
47
|
-
/**
|
|
48
|
-
* Typed helper for defining a module. Enforces that the factory's return
|
|
49
|
-
* type matches the slot in ServiceCollection at compile time, replacing
|
|
50
|
-
* the manual cast each module file would otherwise need.
|
|
51
|
-
*/
|
|
52
|
-
export declare function defineModule<K extends keyof ServiceCollection, THost>(config: {
|
|
53
|
-
name: string;
|
|
54
|
-
serviceKey: K;
|
|
55
|
-
create: (host: THost) => NonNullable<ServiceCollection[K]>;
|
|
56
|
-
init?: (host: THost, service: NonNullable<ServiceCollection[K]>) => IDisposable;
|
|
57
|
-
dependsOn?: DockviewModule<any>[];
|
|
58
|
-
}): DockviewModule<THost>;
|
|
59
|
-
/**
|
|
60
|
-
* For tests — clears the once-per-key dedup cache used by `assertModule`.
|
|
61
|
-
*/
|
|
62
|
-
export declare function _resetMissingModuleWarnings(): void;
|
|
63
|
-
/**
|
|
64
|
-
* Returns the service if its module is registered, otherwise logs a
|
|
65
|
-
* deduplicated console error and returns `undefined`. Modelled on AG Grid's
|
|
66
|
-
* `assertModuleRegistered`: missing modules never throw — they degrade the
|
|
67
|
-
* affected feature to a no-op so consuming applications don't crash in
|
|
68
|
-
* production.
|
|
69
|
-
*
|
|
70
|
-
* Use at public-API entry points where the caller wants to surface which
|
|
71
|
-
* module is missing. For internal/lifecycle paths, plain `?.` chaining on
|
|
72
|
-
* the service slot is preferred — no log, just a silent no-op.
|
|
73
|
-
*/
|
|
74
|
-
export declare function assertModule<T>(service: T | undefined, moduleName: string, context?: string): T | undefined;
|
|
75
|
-
export declare class ModuleRegistry<THost> implements IDisposable {
|
|
76
|
-
private readonly _modules;
|
|
77
|
-
private readonly _services;
|
|
78
|
-
private readonly _initDisposables;
|
|
79
|
-
get services(): ServiceCollection;
|
|
80
|
-
register<H>(module: DockviewModule<H>): void;
|
|
81
|
-
initialize(host: THost): void;
|
|
82
|
-
postConstruct(host: THost): void;
|
|
83
|
-
has(moduleName: string): boolean;
|
|
84
|
-
dispose(): void;
|
|
85
|
-
}
|
|
86
|
-
/**
|
|
87
|
-
* Register modules globally. Idempotent per `moduleName` — registering the
|
|
88
|
-
* same module twice is a no-op. Intended to be called once at import time by
|
|
89
|
-
* the package that bundles a given set of modules.
|
|
90
|
-
*/
|
|
91
|
-
export declare function registerModules(modules: DockviewModule<any>[]): void;
|
|
92
|
-
/**
|
|
93
|
-
* Returns the globally-registered modules (a copy). `DockviewComponent` reads
|
|
94
|
-
* this to extend its built-in module set.
|
|
95
|
-
*/
|
|
96
|
-
export declare function getRegisteredModules(): DockviewModule<any>[];
|
|
97
|
-
/**
|
|
98
|
-
* For tests — clears the global module registry.
|
|
99
|
-
*/
|
|
100
|
-
export declare function clearRegisteredModules(): void;
|
|
101
|
-
/**
|
|
102
|
-
* Called once by the `dockview` package on import, solely so `dockview-core`
|
|
103
|
-
* can warn when it is used directly (see above). Not used for anything else.
|
|
104
|
-
*/
|
|
105
|
-
export declare function markDockviewPackageLoaded(): void;
|
|
106
|
-
/**
|
|
107
|
-
* Whether the `dockview` package has been loaded in this process. Used only to
|
|
108
|
-
* gate the "don't use dockview-core directly" developer warning.
|
|
109
|
-
*/
|
|
110
|
-
export declare function isDockviewPackageLoaded(): boolean;
|
|
@@ -1,170 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Internal module system for dockview.
|
|
3
|
-
*
|
|
4
|
-
* Modules are feature bundles that register services into the dockview
|
|
5
|
-
* component. `registerModules(...)` is the one public entry point — it lets a
|
|
6
|
-
* sibling package contribute modules that `DockviewComponent` picks up at
|
|
7
|
-
* construction. The richer opt-in surface (a per-component `modules` option,
|
|
8
|
-
* framework wrappers) is still reserved for a future version; the module
|
|
9
|
-
* authoring API (`defineModule`, the service contracts) remains internal.
|
|
10
|
-
*/
|
|
11
|
-
/**
|
|
12
|
-
* Typed helper for defining a module. Enforces that the factory's return
|
|
13
|
-
* type matches the slot in ServiceCollection at compile time, replacing
|
|
14
|
-
* the manual cast each module file would otherwise need.
|
|
15
|
-
*/
|
|
16
|
-
export function defineModule(config) {
|
|
17
|
-
return {
|
|
18
|
-
moduleName: config.name,
|
|
19
|
-
services: {
|
|
20
|
-
[config.serviceKey]: config.create,
|
|
21
|
-
},
|
|
22
|
-
init: config.init
|
|
23
|
-
? (host, services) => config.init(host, services[config.serviceKey])
|
|
24
|
-
: undefined,
|
|
25
|
-
dependsOn: config.dependsOn,
|
|
26
|
-
};
|
|
27
|
-
}
|
|
28
|
-
const _warnedMissingModule = new Set();
|
|
29
|
-
/**
|
|
30
|
-
* For tests — clears the once-per-key dedup cache used by `assertModule`.
|
|
31
|
-
*/
|
|
32
|
-
export function _resetMissingModuleWarnings() {
|
|
33
|
-
_warnedMissingModule.clear();
|
|
34
|
-
}
|
|
35
|
-
/**
|
|
36
|
-
* Returns the service if its module is registered, otherwise logs a
|
|
37
|
-
* deduplicated console error and returns `undefined`. Modelled on AG Grid's
|
|
38
|
-
* `assertModuleRegistered`: missing modules never throw — they degrade the
|
|
39
|
-
* affected feature to a no-op so consuming applications don't crash in
|
|
40
|
-
* production.
|
|
41
|
-
*
|
|
42
|
-
* Use at public-API entry points where the caller wants to surface which
|
|
43
|
-
* module is missing. For internal/lifecycle paths, plain `?.` chaining on
|
|
44
|
-
* the service slot is preferred — no log, just a silent no-op.
|
|
45
|
-
*/
|
|
46
|
-
export function assertModule(service, moduleName, context) {
|
|
47
|
-
if (service !== undefined) {
|
|
48
|
-
return service;
|
|
49
|
-
}
|
|
50
|
-
const key = `${moduleName}|${context !== null && context !== void 0 ? context : ''}`;
|
|
51
|
-
if (_warnedMissingModule.has(key)) {
|
|
52
|
-
return undefined;
|
|
53
|
-
}
|
|
54
|
-
_warnedMissingModule.add(key);
|
|
55
|
-
const where = context ? ` for ${context}` : '';
|
|
56
|
-
// eslint-disable-next-line no-console
|
|
57
|
-
console.error(`dockview: module "${moduleName}" is not registered${where}.`);
|
|
58
|
-
return undefined;
|
|
59
|
-
}
|
|
60
|
-
export class ModuleRegistry {
|
|
61
|
-
constructor() {
|
|
62
|
-
this._modules = new Map();
|
|
63
|
-
this._services = {};
|
|
64
|
-
this._initDisposables = [];
|
|
65
|
-
}
|
|
66
|
-
get services() {
|
|
67
|
-
return this._services;
|
|
68
|
-
}
|
|
69
|
-
register(module) {
|
|
70
|
-
if (this._modules.has(module.moduleName)) {
|
|
71
|
-
return;
|
|
72
|
-
}
|
|
73
|
-
if (module.dependsOn) {
|
|
74
|
-
for (const dep of module.dependsOn) {
|
|
75
|
-
this.register(dep);
|
|
76
|
-
}
|
|
77
|
-
}
|
|
78
|
-
this._modules.set(module.moduleName, module);
|
|
79
|
-
}
|
|
80
|
-
initialize(host) {
|
|
81
|
-
for (const module of this._modules.values()) {
|
|
82
|
-
if (!module.services) {
|
|
83
|
-
continue;
|
|
84
|
-
}
|
|
85
|
-
for (const [name, factory] of Object.entries(module.services)) {
|
|
86
|
-
this._services[name] = factory(host);
|
|
87
|
-
}
|
|
88
|
-
}
|
|
89
|
-
}
|
|
90
|
-
postConstruct(host) {
|
|
91
|
-
for (const module of this._modules.values()) {
|
|
92
|
-
if (module.init) {
|
|
93
|
-
this._initDisposables.push(module.init(host, this._services));
|
|
94
|
-
}
|
|
95
|
-
}
|
|
96
|
-
}
|
|
97
|
-
has(moduleName) {
|
|
98
|
-
return this._modules.has(moduleName);
|
|
99
|
-
}
|
|
100
|
-
dispose() {
|
|
101
|
-
// Tear down init() subscriptions first so they stop firing into
|
|
102
|
-
// services that are about to be disposed.
|
|
103
|
-
for (const disposable of this._initDisposables) {
|
|
104
|
-
disposable.dispose();
|
|
105
|
-
}
|
|
106
|
-
this._initDisposables.length = 0;
|
|
107
|
-
for (const service of Object.values(this._services)) {
|
|
108
|
-
if (service !== undefined &&
|
|
109
|
-
typeof service.dispose === 'function') {
|
|
110
|
-
service.dispose();
|
|
111
|
-
}
|
|
112
|
-
}
|
|
113
|
-
}
|
|
114
|
-
}
|
|
115
|
-
/**
|
|
116
|
-
* Process-global list of modules registered via {@link registerModules}.
|
|
117
|
-
* `DockviewComponent` appends these to its built-in set at construction, so
|
|
118
|
-
* importing a package that calls `registerModules(...)` (e.g. `dockview`)
|
|
119
|
-
* makes those modules available to every component in the process —
|
|
120
|
-
* modelled on AG Grid's `ModuleRegistry.registerModules`.
|
|
121
|
-
*/
|
|
122
|
-
const _globalModules = [];
|
|
123
|
-
/**
|
|
124
|
-
* Register modules globally. Idempotent per `moduleName` — registering the
|
|
125
|
-
* same module twice is a no-op. Intended to be called once at import time by
|
|
126
|
-
* the package that bundles a given set of modules.
|
|
127
|
-
*/
|
|
128
|
-
export function registerModules(modules) {
|
|
129
|
-
for (const module of modules) {
|
|
130
|
-
if (_globalModules.some((m) => m.moduleName === module.moduleName)) {
|
|
131
|
-
continue;
|
|
132
|
-
}
|
|
133
|
-
_globalModules.push(module);
|
|
134
|
-
}
|
|
135
|
-
}
|
|
136
|
-
/**
|
|
137
|
-
* Returns the globally-registered modules (a copy). `DockviewComponent` reads
|
|
138
|
-
* this to extend its built-in module set.
|
|
139
|
-
*/
|
|
140
|
-
export function getRegisteredModules() {
|
|
141
|
-
return [..._globalModules];
|
|
142
|
-
}
|
|
143
|
-
/**
|
|
144
|
-
* For tests — clears the global module registry.
|
|
145
|
-
*/
|
|
146
|
-
export function clearRegisteredModules() {
|
|
147
|
-
_globalModules.length = 0;
|
|
148
|
-
}
|
|
149
|
-
/**
|
|
150
|
-
* This marker exists for ONE purpose: a developer warning about the v7 package
|
|
151
|
-
* renames. It has no functional effect on dockview's behaviour. Following the
|
|
152
|
-
* renames, `dockview-core` is internal and `dockview` is the public JavaScript
|
|
153
|
-
* package; `dockview` calls {@link markDockviewPackageLoaded} on import so that
|
|
154
|
-
* `dockview-core` can detect — and warn about — being used directly.
|
|
155
|
-
*/
|
|
156
|
-
let _dockviewPackageLoaded = false;
|
|
157
|
-
/**
|
|
158
|
-
* Called once by the `dockview` package on import, solely so `dockview-core`
|
|
159
|
-
* can warn when it is used directly (see above). Not used for anything else.
|
|
160
|
-
*/
|
|
161
|
-
export function markDockviewPackageLoaded() {
|
|
162
|
-
_dockviewPackageLoaded = true;
|
|
163
|
-
}
|
|
164
|
-
/**
|
|
165
|
-
* Whether the `dockview` package has been loaded in this process. Used only to
|
|
166
|
-
* gate the "don't use dockview-core directly" developer warning.
|
|
167
|
-
*/
|
|
168
|
-
export function isDockviewPackageLoaded() {
|
|
169
|
-
return _dockviewPackageLoaded;
|
|
170
|
-
}
|