react-dockable-desktop 7.8.0 → 7.9.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/CHANGELOG.md +65 -1
- package/README.md +2 -1
- package/dist/index.cjs +6 -6
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +68 -3
- package/dist/index.d.ts +68 -3
- package/dist/index.js +6 -6
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -135,6 +135,31 @@ interface DropTarget {
|
|
|
135
135
|
leafId: string;
|
|
136
136
|
position: DropPosition;
|
|
137
137
|
}
|
|
138
|
+
/**
|
|
139
|
+
* Where a user is about to move a panel, as `canDrop` sees it (7.9.0). Positions are the ones the
|
|
140
|
+
* move applies: under RTL, a drop on the zone drawn on the screen's right is `'left'`.
|
|
141
|
+
* - `group`: into a group, on one side (a new split) or `'center'` (as a tab, also between tabs);
|
|
142
|
+
* - `edge`: along a workspace edge, as a full-width or full-height strip;
|
|
143
|
+
* - `float`: into a floating window, pinned to a corner, or free (`anchor: null`, a tab dropped
|
|
144
|
+
* on nothing).
|
|
145
|
+
*/
|
|
146
|
+
type PanelDropTarget = {
|
|
147
|
+
kind: 'group';
|
|
148
|
+
leafId: string;
|
|
149
|
+
position: DropPosition;
|
|
150
|
+
} | {
|
|
151
|
+
kind: 'edge';
|
|
152
|
+
side: SplitDirection;
|
|
153
|
+
} | {
|
|
154
|
+
kind: 'float';
|
|
155
|
+
anchor: FloatAnchor | null;
|
|
156
|
+
};
|
|
157
|
+
/** The argument `canDrop` receives: which panel, of which registered kind, is going where. (7.9.0) */
|
|
158
|
+
interface PanelDrop {
|
|
159
|
+
panelId: string;
|
|
160
|
+
component: string;
|
|
161
|
+
to: PanelDropTarget;
|
|
162
|
+
}
|
|
138
163
|
/**
|
|
139
164
|
* Grid layout branch node containing nested splits and relative flex sizes.
|
|
140
165
|
*/
|
|
@@ -634,6 +659,8 @@ interface InternalWindowActions extends WorkspaceActions {
|
|
|
634
659
|
getPanelContextMenuItems: (panelId: string) => ContextMenuItem[];
|
|
635
660
|
/** @internal */
|
|
636
661
|
registerContextMenuFn: (fn: (options: ShowContextMenuOptions) => void) => () => void;
|
|
662
|
+
/** @internal Whether the user may move `panelId` to `to`: its type's rules, then `canDrop`. (7.9.0) */
|
|
663
|
+
isDropAllowed: (panelId: string, to: PanelDropTarget) => boolean;
|
|
637
664
|
}
|
|
638
665
|
/** Represents custom CSS classes injected into layout parts. */
|
|
639
666
|
interface HostClasses {
|
|
@@ -708,6 +735,19 @@ interface PanelRegistryEntry {
|
|
|
708
735
|
};
|
|
709
736
|
/** Enables/disables window drag interactions. */
|
|
710
737
|
canDrag?: boolean;
|
|
738
|
+
/**
|
|
739
|
+
* `false`: the user can't make this panel floating. A tab drag can't end in a floating window
|
|
740
|
+
* (dropped on nothing or on a corner, it stays where it was), and the "Float" and taskbar
|
|
741
|
+
* "Maximize" menu items are hidden. A window the app floated itself can still be moved. The
|
|
742
|
+
* app's own `floatPanel` always works. @default true (7.9.0)
|
|
743
|
+
*/
|
|
744
|
+
canFloat?: boolean;
|
|
745
|
+
/**
|
|
746
|
+
* `false`: the user can't dock this panel. Dragging it offers no group, tab or edge targets
|
|
747
|
+
* (corners still anchor a floating window), so it stays floating. The app's own docking calls
|
|
748
|
+
* always work; give the type `initialTarget: 'floating'` so it opens floating. @default true (7.9.0)
|
|
749
|
+
*/
|
|
750
|
+
canDock?: boolean;
|
|
711
751
|
/** Enables/disables minimizing of the panel instance. */
|
|
712
752
|
canMinimize?: boolean;
|
|
713
753
|
/** Enables/disables closing actions for the tab/window. */
|
|
@@ -729,7 +769,8 @@ interface PanelRegistryEntry {
|
|
|
729
769
|
* `false` unmounts the panel's component while it is hidden (an unselected tab, or minimized)
|
|
730
770
|
* and mounts it afresh when it is shown, to free what a heavy, rarely shown panel holds. Its
|
|
731
771
|
* own state is lost each time; its tab, title and lifecycle continue (`onClose` is not called),
|
|
732
|
-
* and the taskbar shows a placeholder instead of a live preview. While it is unmounted,
|
|
772
|
+
* and the taskbar shows a placeholder instead of a live preview. While it is unmounted, a
|
|
773
|
+
* guard it registered with `useBeforeClose` is not active (its dirty flag still is), and
|
|
733
774
|
* `saveLayout()` saves its open-time props. @default true: panels stay mounted and keep their
|
|
734
775
|
* state, as they always have. (7.8.0)
|
|
735
776
|
*/
|
|
@@ -1090,6 +1131,24 @@ interface WorkspaceClientConfig {
|
|
|
1090
1131
|
* app's own modal z-index range to control stacking against it. Default: 1000.
|
|
1091
1132
|
*/
|
|
1092
1133
|
zIndexBase?: number;
|
|
1134
|
+
/**
|
|
1135
|
+
* Veto where users can move panels (7.9.0). Called for each place a dragged panel could go, and
|
|
1136
|
+
* for the built-in "Float" and "Maximize" menu items: return `false` and that target isn't
|
|
1137
|
+
* offered (its drop zone doesn't appear) and the move doesn't happen. It runs after the panel
|
|
1138
|
+
* type's own `canFloat` / `canDock`, and only for what the user does: the app's own calls
|
|
1139
|
+
* (`floatPanel`, `dockPanelToGroup`, `openPanel`) always work. Keep it fast and pure; it runs
|
|
1140
|
+
* while the pointer moves.
|
|
1141
|
+
*
|
|
1142
|
+
* @example
|
|
1143
|
+
* ```ts
|
|
1144
|
+
* createWorkspace({
|
|
1145
|
+
* panels,
|
|
1146
|
+
* // Nothing but tool panels in the left group.
|
|
1147
|
+
* canDrop: ({ component, to }) => !(to.kind === 'group' && to.leafId === 'tools' && component !== 'tool'),
|
|
1148
|
+
* });
|
|
1149
|
+
* ```
|
|
1150
|
+
*/
|
|
1151
|
+
canDrop?: (drop: PanelDrop) => boolean;
|
|
1093
1152
|
}
|
|
1094
1153
|
/**
|
|
1095
1154
|
* A workspace: the layout, every action on it, the panel registry and the event bus. Create one
|
|
@@ -2718,6 +2777,11 @@ interface PointerDragConfig<TStart> {
|
|
|
2718
2777
|
onMove: (dx: number, dy: number, start: TStart) => void;
|
|
2719
2778
|
/** Called once when the drag ends (pointerup or pointercancel). */
|
|
2720
2779
|
onEnd?: (start: TStart) => void;
|
|
2780
|
+
/**
|
|
2781
|
+
* Called instead of `onEnd` when the drag is cut short: the window loses focus, or the pointer
|
|
2782
|
+
* capture is lost (the element was removed mid-drag). Without it, `onEnd` is called. (7.9.0)
|
|
2783
|
+
*/
|
|
2784
|
+
onCancel?: (start: TStart) => void;
|
|
2721
2785
|
/** Classes toggled on the given elements for the duration of the drag. */
|
|
2722
2786
|
activeClasses?: Array<{
|
|
2723
2787
|
el: HTMLElement;
|
|
@@ -2727,7 +2791,8 @@ interface PointerDragConfig<TStart> {
|
|
|
2727
2791
|
/**
|
|
2728
2792
|
* Starts a pointer-capture-based drag: captures the pointer on `element`, tracks
|
|
2729
2793
|
* movement via listeners scoped to that element's own lifetime (not `window`), and
|
|
2730
|
-
* cleans up automatically on release or cancel.
|
|
2794
|
+
* cleans up automatically on release or cancel, and (7.9.0) when the window loses focus
|
|
2795
|
+
* or the capture is lost, so a drag can never outlive its element or leave its classes behind.
|
|
2731
2796
|
*/
|
|
2732
2797
|
declare function startPointerDrag<TStart>(config: PointerDragConfig<TStart>): void;
|
|
2733
2798
|
type ResizeDir = 'n' | 'ne' | 'e' | 'se' | 's' | 'sw' | 'w' | 'nw';
|
|
@@ -2788,4 +2853,4 @@ declare function isElementRtl(el: HTMLElement | null): boolean;
|
|
|
2788
2853
|
*/
|
|
2789
2854
|
declare function isComputedRtl(el: Element | null | undefined): boolean;
|
|
2790
2855
|
|
|
2791
|
-
export { type AlertOptions, type BuiltInEvents, type ButtonVariant, type CloseOptions, type ConfirmOptions, type ContainerType, type ContextMenuAdapter, type ContextMenuCheckbox, type ContextMenuHandle, type ContextMenuItem, type ContextMenuLabel, type ContextMenuSeparator, type ContextMenuSimpleItem, type ContextMenuSubMenu, type DirtyStateOptions, DockableDesktopProvider, type DockableDesktopProviderProps, type DropPosition, type DropTarget, type FloatAnchor, type FloatingWidgetsApi, type FloatingWindow, type HostClasses, type LayoutGridNode, type LayoutLeafNode, type LayoutNode, type ManagedWidget, type MenuItemAction, type MessageDescriptor, type MessageFormatter, type MessageKey, type ModalOptions, type ModalsApi, type OpenPanelOptions, type OverlayId, type OverlayInstance, type OverlayState, type PanelContribution, type PanelDefinition, type PanelEvents, type PanelFloatPlacement, type PanelHandle, type PanelInfo, PanelRegistry, type PanelRegistryEntry, type PanelSidebarSection, type PanelState, type PanelTitle, type PanelTitleDescriptor, type PointerDragConfig, AlertForm as RddAlert, type RddAlertProps, ConfirmationForm as RddConfirm, type RddConfirmProps, RddContextMenu, type RddContextMenuProps, WindowManager as RddDesktop, type RddDesktopProps, PanelFloatingWindow as RddFloatingWidget, type RddFloatingWidgetProps, ModalStackRenderer as RddModals, PanelOverlayRoot as RddPanelOverlay, type RddPanelOverlayProps, PanelToolbar as RddPanelToolbar, type RddPanelToolbarProps, SecondarySidebar as RddSecondarySidebar, type RddSecondarySidebarProps, RddSidePanels, type RddSidePanelsProps, Sidebar as RddSidebar, type RddSidebarProps, ToastContainer as RddToasts, type RddToastsProps, Toolbar as RddToolbar, ToolbarButton as RddToolbarButton, type RddToolbarButtonProps, ToolbarCenter as RddToolbarCenter, ToolbarItem as RddToolbarItem, type RddToolbarProps, ToolbarSearchInput as RddToolbarSearch, type RddToolbarSearchProps, ToolbarSeparator as RddToolbarSeparator, ToolbarSpacer as RddToolbarSpacer, ToolbarToggle as RddToolbarToggle, type RddToolbarToggleProps, type ResizeConstraints, type ResizeDir, type ResizeRect, type ResolvedToastOptions, type SearchResult, type SerializedLayout, type ShowContextMenuOptions, type SidePanelOptions, type SidePanelsApi, type SidebarActionButton, type SidebarContextValue as SidebarContext, type SidebarCustomEntry, type SidebarHandle, type SidebarHeaderAction, type SidebarRailEntry, type SidebarTab, type SidebarTabContextValue as SidebarTabContext, type SplitDirection, type SplitOrientation, type Stretch, type TaskbarVisibility, type ToastAdapter, type ToastFunction, type ToastOptions, type ToastPosition, type ToastPromiseMessages, type ToastType, type ToolbarActionItem, type ToolbarContextValue, type ToolbarGroupEntry, type ToolbarGroupItem, type ToolbarGroupSubItem, type ToolbarHandle, type ToolbarItem$1 as ToolbarItem, type ToolbarPosition, type ToolbarRadioItem, type ToolbarSeparator$1 as ToolbarSeparator, type ToolbarToggleItem, type ToolbarVariant, type Workspace, type WorkspaceActions, type WorkspaceConfig, type WorkspaceState, computeResizedRect, createWorkspace, defaultPredefinedMessages as defaultMessages, formatLabel, isComputedRtl, isElementRtl, isSerializable, sidebarSectionToTab as sectionToTab, startPointerDrag, toast, useActivePanelContribution as useActiveContribution, useBeforeClose, useColorScheme, useShowContextMenu as useContextMenu, usePanelFloatingWindowManager as useFloatingWidgets, useFormatMessage, useStyleClasses as useHostClasses, useMergedSidebarTabs, useMergedToolbarItems, usePredefinedMessages as useMessages, useModals, usePanel, usePanelContextMenu, usePanelContribution, usePanelEvents, usePanelSize, useSaveState, useSidePanels, useSidebar, useSidebarTab, useToolbar, useWorkspace, useWindowManagerState as useWorkspaceState };
|
|
2856
|
+
export { type AlertOptions, type BuiltInEvents, type ButtonVariant, type CloseOptions, type ConfirmOptions, type ContainerType, type ContextMenuAdapter, type ContextMenuCheckbox, type ContextMenuHandle, type ContextMenuItem, type ContextMenuLabel, type ContextMenuSeparator, type ContextMenuSimpleItem, type ContextMenuSubMenu, type DirtyStateOptions, DockableDesktopProvider, type DockableDesktopProviderProps, type DropPosition, type DropTarget, type FloatAnchor, type FloatingWidgetsApi, type FloatingWindow, type HostClasses, type LayoutGridNode, type LayoutLeafNode, type LayoutNode, type ManagedWidget, type MenuItemAction, type MessageDescriptor, type MessageFormatter, type MessageKey, type ModalOptions, type ModalsApi, type OpenPanelOptions, type OverlayId, type OverlayInstance, type OverlayState, type PanelContribution, type PanelDefinition, type PanelDrop, type PanelDropTarget, type PanelEvents, type PanelFloatPlacement, type PanelHandle, type PanelInfo, PanelRegistry, type PanelRegistryEntry, type PanelSidebarSection, type PanelState, type PanelTitle, type PanelTitleDescriptor, type PointerDragConfig, AlertForm as RddAlert, type RddAlertProps, ConfirmationForm as RddConfirm, type RddConfirmProps, RddContextMenu, type RddContextMenuProps, WindowManager as RddDesktop, type RddDesktopProps, PanelFloatingWindow as RddFloatingWidget, type RddFloatingWidgetProps, ModalStackRenderer as RddModals, PanelOverlayRoot as RddPanelOverlay, type RddPanelOverlayProps, PanelToolbar as RddPanelToolbar, type RddPanelToolbarProps, SecondarySidebar as RddSecondarySidebar, type RddSecondarySidebarProps, RddSidePanels, type RddSidePanelsProps, Sidebar as RddSidebar, type RddSidebarProps, ToastContainer as RddToasts, type RddToastsProps, Toolbar as RddToolbar, ToolbarButton as RddToolbarButton, type RddToolbarButtonProps, ToolbarCenter as RddToolbarCenter, ToolbarItem as RddToolbarItem, type RddToolbarProps, ToolbarSearchInput as RddToolbarSearch, type RddToolbarSearchProps, ToolbarSeparator as RddToolbarSeparator, ToolbarSpacer as RddToolbarSpacer, ToolbarToggle as RddToolbarToggle, type RddToolbarToggleProps, type ResizeConstraints, type ResizeDir, type ResizeRect, type ResolvedToastOptions, type SearchResult, type SerializedLayout, type ShowContextMenuOptions, type SidePanelOptions, type SidePanelsApi, type SidebarActionButton, type SidebarContextValue as SidebarContext, type SidebarCustomEntry, type SidebarHandle, type SidebarHeaderAction, type SidebarRailEntry, type SidebarTab, type SidebarTabContextValue as SidebarTabContext, type SplitDirection, type SplitOrientation, type Stretch, type TaskbarVisibility, type ToastAdapter, type ToastFunction, type ToastOptions, type ToastPosition, type ToastPromiseMessages, type ToastType, type ToolbarActionItem, type ToolbarContextValue, type ToolbarGroupEntry, type ToolbarGroupItem, type ToolbarGroupSubItem, type ToolbarHandle, type ToolbarItem$1 as ToolbarItem, type ToolbarPosition, type ToolbarRadioItem, type ToolbarSeparator$1 as ToolbarSeparator, type ToolbarToggleItem, type ToolbarVariant, type Workspace, type WorkspaceActions, type WorkspaceConfig, type WorkspaceState, computeResizedRect, createWorkspace, defaultPredefinedMessages as defaultMessages, formatLabel, isComputedRtl, isElementRtl, isSerializable, sidebarSectionToTab as sectionToTab, startPointerDrag, toast, useActivePanelContribution as useActiveContribution, useBeforeClose, useColorScheme, useShowContextMenu as useContextMenu, usePanelFloatingWindowManager as useFloatingWidgets, useFormatMessage, useStyleClasses as useHostClasses, useMergedSidebarTabs, useMergedToolbarItems, usePredefinedMessages as useMessages, useModals, usePanel, usePanelContextMenu, usePanelContribution, usePanelEvents, usePanelSize, useSaveState, useSidePanels, useSidebar, useSidebarTab, useToolbar, useWorkspace, useWindowManagerState as useWorkspaceState };
|
package/dist/index.d.ts
CHANGED
|
@@ -135,6 +135,31 @@ interface DropTarget {
|
|
|
135
135
|
leafId: string;
|
|
136
136
|
position: DropPosition;
|
|
137
137
|
}
|
|
138
|
+
/**
|
|
139
|
+
* Where a user is about to move a panel, as `canDrop` sees it (7.9.0). Positions are the ones the
|
|
140
|
+
* move applies: under RTL, a drop on the zone drawn on the screen's right is `'left'`.
|
|
141
|
+
* - `group`: into a group, on one side (a new split) or `'center'` (as a tab, also between tabs);
|
|
142
|
+
* - `edge`: along a workspace edge, as a full-width or full-height strip;
|
|
143
|
+
* - `float`: into a floating window, pinned to a corner, or free (`anchor: null`, a tab dropped
|
|
144
|
+
* on nothing).
|
|
145
|
+
*/
|
|
146
|
+
type PanelDropTarget = {
|
|
147
|
+
kind: 'group';
|
|
148
|
+
leafId: string;
|
|
149
|
+
position: DropPosition;
|
|
150
|
+
} | {
|
|
151
|
+
kind: 'edge';
|
|
152
|
+
side: SplitDirection;
|
|
153
|
+
} | {
|
|
154
|
+
kind: 'float';
|
|
155
|
+
anchor: FloatAnchor | null;
|
|
156
|
+
};
|
|
157
|
+
/** The argument `canDrop` receives: which panel, of which registered kind, is going where. (7.9.0) */
|
|
158
|
+
interface PanelDrop {
|
|
159
|
+
panelId: string;
|
|
160
|
+
component: string;
|
|
161
|
+
to: PanelDropTarget;
|
|
162
|
+
}
|
|
138
163
|
/**
|
|
139
164
|
* Grid layout branch node containing nested splits and relative flex sizes.
|
|
140
165
|
*/
|
|
@@ -634,6 +659,8 @@ interface InternalWindowActions extends WorkspaceActions {
|
|
|
634
659
|
getPanelContextMenuItems: (panelId: string) => ContextMenuItem[];
|
|
635
660
|
/** @internal */
|
|
636
661
|
registerContextMenuFn: (fn: (options: ShowContextMenuOptions) => void) => () => void;
|
|
662
|
+
/** @internal Whether the user may move `panelId` to `to`: its type's rules, then `canDrop`. (7.9.0) */
|
|
663
|
+
isDropAllowed: (panelId: string, to: PanelDropTarget) => boolean;
|
|
637
664
|
}
|
|
638
665
|
/** Represents custom CSS classes injected into layout parts. */
|
|
639
666
|
interface HostClasses {
|
|
@@ -708,6 +735,19 @@ interface PanelRegistryEntry {
|
|
|
708
735
|
};
|
|
709
736
|
/** Enables/disables window drag interactions. */
|
|
710
737
|
canDrag?: boolean;
|
|
738
|
+
/**
|
|
739
|
+
* `false`: the user can't make this panel floating. A tab drag can't end in a floating window
|
|
740
|
+
* (dropped on nothing or on a corner, it stays where it was), and the "Float" and taskbar
|
|
741
|
+
* "Maximize" menu items are hidden. A window the app floated itself can still be moved. The
|
|
742
|
+
* app's own `floatPanel` always works. @default true (7.9.0)
|
|
743
|
+
*/
|
|
744
|
+
canFloat?: boolean;
|
|
745
|
+
/**
|
|
746
|
+
* `false`: the user can't dock this panel. Dragging it offers no group, tab or edge targets
|
|
747
|
+
* (corners still anchor a floating window), so it stays floating. The app's own docking calls
|
|
748
|
+
* always work; give the type `initialTarget: 'floating'` so it opens floating. @default true (7.9.0)
|
|
749
|
+
*/
|
|
750
|
+
canDock?: boolean;
|
|
711
751
|
/** Enables/disables minimizing of the panel instance. */
|
|
712
752
|
canMinimize?: boolean;
|
|
713
753
|
/** Enables/disables closing actions for the tab/window. */
|
|
@@ -729,7 +769,8 @@ interface PanelRegistryEntry {
|
|
|
729
769
|
* `false` unmounts the panel's component while it is hidden (an unselected tab, or minimized)
|
|
730
770
|
* and mounts it afresh when it is shown, to free what a heavy, rarely shown panel holds. Its
|
|
731
771
|
* own state is lost each time; its tab, title and lifecycle continue (`onClose` is not called),
|
|
732
|
-
* and the taskbar shows a placeholder instead of a live preview. While it is unmounted,
|
|
772
|
+
* and the taskbar shows a placeholder instead of a live preview. While it is unmounted, a
|
|
773
|
+
* guard it registered with `useBeforeClose` is not active (its dirty flag still is), and
|
|
733
774
|
* `saveLayout()` saves its open-time props. @default true: panels stay mounted and keep their
|
|
734
775
|
* state, as they always have. (7.8.0)
|
|
735
776
|
*/
|
|
@@ -1090,6 +1131,24 @@ interface WorkspaceClientConfig {
|
|
|
1090
1131
|
* app's own modal z-index range to control stacking against it. Default: 1000.
|
|
1091
1132
|
*/
|
|
1092
1133
|
zIndexBase?: number;
|
|
1134
|
+
/**
|
|
1135
|
+
* Veto where users can move panels (7.9.0). Called for each place a dragged panel could go, and
|
|
1136
|
+
* for the built-in "Float" and "Maximize" menu items: return `false` and that target isn't
|
|
1137
|
+
* offered (its drop zone doesn't appear) and the move doesn't happen. It runs after the panel
|
|
1138
|
+
* type's own `canFloat` / `canDock`, and only for what the user does: the app's own calls
|
|
1139
|
+
* (`floatPanel`, `dockPanelToGroup`, `openPanel`) always work. Keep it fast and pure; it runs
|
|
1140
|
+
* while the pointer moves.
|
|
1141
|
+
*
|
|
1142
|
+
* @example
|
|
1143
|
+
* ```ts
|
|
1144
|
+
* createWorkspace({
|
|
1145
|
+
* panels,
|
|
1146
|
+
* // Nothing but tool panels in the left group.
|
|
1147
|
+
* canDrop: ({ component, to }) => !(to.kind === 'group' && to.leafId === 'tools' && component !== 'tool'),
|
|
1148
|
+
* });
|
|
1149
|
+
* ```
|
|
1150
|
+
*/
|
|
1151
|
+
canDrop?: (drop: PanelDrop) => boolean;
|
|
1093
1152
|
}
|
|
1094
1153
|
/**
|
|
1095
1154
|
* A workspace: the layout, every action on it, the panel registry and the event bus. Create one
|
|
@@ -2718,6 +2777,11 @@ interface PointerDragConfig<TStart> {
|
|
|
2718
2777
|
onMove: (dx: number, dy: number, start: TStart) => void;
|
|
2719
2778
|
/** Called once when the drag ends (pointerup or pointercancel). */
|
|
2720
2779
|
onEnd?: (start: TStart) => void;
|
|
2780
|
+
/**
|
|
2781
|
+
* Called instead of `onEnd` when the drag is cut short: the window loses focus, or the pointer
|
|
2782
|
+
* capture is lost (the element was removed mid-drag). Without it, `onEnd` is called. (7.9.0)
|
|
2783
|
+
*/
|
|
2784
|
+
onCancel?: (start: TStart) => void;
|
|
2721
2785
|
/** Classes toggled on the given elements for the duration of the drag. */
|
|
2722
2786
|
activeClasses?: Array<{
|
|
2723
2787
|
el: HTMLElement;
|
|
@@ -2727,7 +2791,8 @@ interface PointerDragConfig<TStart> {
|
|
|
2727
2791
|
/**
|
|
2728
2792
|
* Starts a pointer-capture-based drag: captures the pointer on `element`, tracks
|
|
2729
2793
|
* movement via listeners scoped to that element's own lifetime (not `window`), and
|
|
2730
|
-
* cleans up automatically on release or cancel.
|
|
2794
|
+
* cleans up automatically on release or cancel, and (7.9.0) when the window loses focus
|
|
2795
|
+
* or the capture is lost, so a drag can never outlive its element or leave its classes behind.
|
|
2731
2796
|
*/
|
|
2732
2797
|
declare function startPointerDrag<TStart>(config: PointerDragConfig<TStart>): void;
|
|
2733
2798
|
type ResizeDir = 'n' | 'ne' | 'e' | 'se' | 's' | 'sw' | 'w' | 'nw';
|
|
@@ -2788,4 +2853,4 @@ declare function isElementRtl(el: HTMLElement | null): boolean;
|
|
|
2788
2853
|
*/
|
|
2789
2854
|
declare function isComputedRtl(el: Element | null | undefined): boolean;
|
|
2790
2855
|
|
|
2791
|
-
export { type AlertOptions, type BuiltInEvents, type ButtonVariant, type CloseOptions, type ConfirmOptions, type ContainerType, type ContextMenuAdapter, type ContextMenuCheckbox, type ContextMenuHandle, type ContextMenuItem, type ContextMenuLabel, type ContextMenuSeparator, type ContextMenuSimpleItem, type ContextMenuSubMenu, type DirtyStateOptions, DockableDesktopProvider, type DockableDesktopProviderProps, type DropPosition, type DropTarget, type FloatAnchor, type FloatingWidgetsApi, type FloatingWindow, type HostClasses, type LayoutGridNode, type LayoutLeafNode, type LayoutNode, type ManagedWidget, type MenuItemAction, type MessageDescriptor, type MessageFormatter, type MessageKey, type ModalOptions, type ModalsApi, type OpenPanelOptions, type OverlayId, type OverlayInstance, type OverlayState, type PanelContribution, type PanelDefinition, type PanelEvents, type PanelFloatPlacement, type PanelHandle, type PanelInfo, PanelRegistry, type PanelRegistryEntry, type PanelSidebarSection, type PanelState, type PanelTitle, type PanelTitleDescriptor, type PointerDragConfig, AlertForm as RddAlert, type RddAlertProps, ConfirmationForm as RddConfirm, type RddConfirmProps, RddContextMenu, type RddContextMenuProps, WindowManager as RddDesktop, type RddDesktopProps, PanelFloatingWindow as RddFloatingWidget, type RddFloatingWidgetProps, ModalStackRenderer as RddModals, PanelOverlayRoot as RddPanelOverlay, type RddPanelOverlayProps, PanelToolbar as RddPanelToolbar, type RddPanelToolbarProps, SecondarySidebar as RddSecondarySidebar, type RddSecondarySidebarProps, RddSidePanels, type RddSidePanelsProps, Sidebar as RddSidebar, type RddSidebarProps, ToastContainer as RddToasts, type RddToastsProps, Toolbar as RddToolbar, ToolbarButton as RddToolbarButton, type RddToolbarButtonProps, ToolbarCenter as RddToolbarCenter, ToolbarItem as RddToolbarItem, type RddToolbarProps, ToolbarSearchInput as RddToolbarSearch, type RddToolbarSearchProps, ToolbarSeparator as RddToolbarSeparator, ToolbarSpacer as RddToolbarSpacer, ToolbarToggle as RddToolbarToggle, type RddToolbarToggleProps, type ResizeConstraints, type ResizeDir, type ResizeRect, type ResolvedToastOptions, type SearchResult, type SerializedLayout, type ShowContextMenuOptions, type SidePanelOptions, type SidePanelsApi, type SidebarActionButton, type SidebarContextValue as SidebarContext, type SidebarCustomEntry, type SidebarHandle, type SidebarHeaderAction, type SidebarRailEntry, type SidebarTab, type SidebarTabContextValue as SidebarTabContext, type SplitDirection, type SplitOrientation, type Stretch, type TaskbarVisibility, type ToastAdapter, type ToastFunction, type ToastOptions, type ToastPosition, type ToastPromiseMessages, type ToastType, type ToolbarActionItem, type ToolbarContextValue, type ToolbarGroupEntry, type ToolbarGroupItem, type ToolbarGroupSubItem, type ToolbarHandle, type ToolbarItem$1 as ToolbarItem, type ToolbarPosition, type ToolbarRadioItem, type ToolbarSeparator$1 as ToolbarSeparator, type ToolbarToggleItem, type ToolbarVariant, type Workspace, type WorkspaceActions, type WorkspaceConfig, type WorkspaceState, computeResizedRect, createWorkspace, defaultPredefinedMessages as defaultMessages, formatLabel, isComputedRtl, isElementRtl, isSerializable, sidebarSectionToTab as sectionToTab, startPointerDrag, toast, useActivePanelContribution as useActiveContribution, useBeforeClose, useColorScheme, useShowContextMenu as useContextMenu, usePanelFloatingWindowManager as useFloatingWidgets, useFormatMessage, useStyleClasses as useHostClasses, useMergedSidebarTabs, useMergedToolbarItems, usePredefinedMessages as useMessages, useModals, usePanel, usePanelContextMenu, usePanelContribution, usePanelEvents, usePanelSize, useSaveState, useSidePanels, useSidebar, useSidebarTab, useToolbar, useWorkspace, useWindowManagerState as useWorkspaceState };
|
|
2856
|
+
export { type AlertOptions, type BuiltInEvents, type ButtonVariant, type CloseOptions, type ConfirmOptions, type ContainerType, type ContextMenuAdapter, type ContextMenuCheckbox, type ContextMenuHandle, type ContextMenuItem, type ContextMenuLabel, type ContextMenuSeparator, type ContextMenuSimpleItem, type ContextMenuSubMenu, type DirtyStateOptions, DockableDesktopProvider, type DockableDesktopProviderProps, type DropPosition, type DropTarget, type FloatAnchor, type FloatingWidgetsApi, type FloatingWindow, type HostClasses, type LayoutGridNode, type LayoutLeafNode, type LayoutNode, type ManagedWidget, type MenuItemAction, type MessageDescriptor, type MessageFormatter, type MessageKey, type ModalOptions, type ModalsApi, type OpenPanelOptions, type OverlayId, type OverlayInstance, type OverlayState, type PanelContribution, type PanelDefinition, type PanelDrop, type PanelDropTarget, type PanelEvents, type PanelFloatPlacement, type PanelHandle, type PanelInfo, PanelRegistry, type PanelRegistryEntry, type PanelSidebarSection, type PanelState, type PanelTitle, type PanelTitleDescriptor, type PointerDragConfig, AlertForm as RddAlert, type RddAlertProps, ConfirmationForm as RddConfirm, type RddConfirmProps, RddContextMenu, type RddContextMenuProps, WindowManager as RddDesktop, type RddDesktopProps, PanelFloatingWindow as RddFloatingWidget, type RddFloatingWidgetProps, ModalStackRenderer as RddModals, PanelOverlayRoot as RddPanelOverlay, type RddPanelOverlayProps, PanelToolbar as RddPanelToolbar, type RddPanelToolbarProps, SecondarySidebar as RddSecondarySidebar, type RddSecondarySidebarProps, RddSidePanels, type RddSidePanelsProps, Sidebar as RddSidebar, type RddSidebarProps, ToastContainer as RddToasts, type RddToastsProps, Toolbar as RddToolbar, ToolbarButton as RddToolbarButton, type RddToolbarButtonProps, ToolbarCenter as RddToolbarCenter, ToolbarItem as RddToolbarItem, type RddToolbarProps, ToolbarSearchInput as RddToolbarSearch, type RddToolbarSearchProps, ToolbarSeparator as RddToolbarSeparator, ToolbarSpacer as RddToolbarSpacer, ToolbarToggle as RddToolbarToggle, type RddToolbarToggleProps, type ResizeConstraints, type ResizeDir, type ResizeRect, type ResolvedToastOptions, type SearchResult, type SerializedLayout, type ShowContextMenuOptions, type SidePanelOptions, type SidePanelsApi, type SidebarActionButton, type SidebarContextValue as SidebarContext, type SidebarCustomEntry, type SidebarHandle, type SidebarHeaderAction, type SidebarRailEntry, type SidebarTab, type SidebarTabContextValue as SidebarTabContext, type SplitDirection, type SplitOrientation, type Stretch, type TaskbarVisibility, type ToastAdapter, type ToastFunction, type ToastOptions, type ToastPosition, type ToastPromiseMessages, type ToastType, type ToolbarActionItem, type ToolbarContextValue, type ToolbarGroupEntry, type ToolbarGroupItem, type ToolbarGroupSubItem, type ToolbarHandle, type ToolbarItem$1 as ToolbarItem, type ToolbarPosition, type ToolbarRadioItem, type ToolbarSeparator$1 as ToolbarSeparator, type ToolbarToggleItem, type ToolbarVariant, type Workspace, type WorkspaceActions, type WorkspaceConfig, type WorkspaceState, computeResizedRect, createWorkspace, defaultPredefinedMessages as defaultMessages, formatLabel, isComputedRtl, isElementRtl, isSerializable, sidebarSectionToTab as sectionToTab, startPointerDrag, toast, useActivePanelContribution as useActiveContribution, useBeforeClose, useColorScheme, useShowContextMenu as useContextMenu, usePanelFloatingWindowManager as useFloatingWidgets, useFormatMessage, useStyleClasses as useHostClasses, useMergedSidebarTabs, useMergedToolbarItems, usePredefinedMessages as useMessages, useModals, usePanel, usePanelContextMenu, usePanelContribution, usePanelEvents, usePanelSize, useSaveState, useSidePanels, useSidebar, useSidebarTab, useToolbar, useWorkspace, useWindowManagerState as useWorkspaceState };
|