@canvas-components/react-drag-any 1.0.3 → 2.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/dist/index.d.cts CHANGED
@@ -1,180 +1,56 @@
1
- import { ReactNode, CSSProperties, Ref, RefAttributes, ReactElement } from 'react';
2
- import { DragPoint, DragTheme, DragContentInput, DragRegionContentAction, DragRegionRenderContext, DragId, DragRenderTarget, dragAnyProjection, DragRenderContext, DragScrollbarOptions, DragDocument, DragStore, DragAny, DragMoveProposal, DragContentError, DragContentErrorCode, DragContentAction, DragDocumentCard, DragDocumentSlot, DragDocumentLane } from '@canvas-components/drag-any';
3
- import { CompiledUILayout } from '@canvas-components/react-canvas-ui';
4
-
5
- /** 热点或省略文本由宿主提供的提示内容。 */
6
- interface TooltipProps {
7
- readonly request: {
8
- readonly text: string;
9
- readonly clientAnchor: DragPoint;
1
+ import * as react from 'react';
2
+ import { SetStateAction, ReactNode, CSSProperties } from 'react';
3
+ import { SourceOptions, TargetOptions, SurfaceOptions, mountDragSurface, DragContextMenuOptions } from '@canvas-components/drag-any';
4
+ export { AutoScrollEdge } from '@canvas-components/drag-any';
5
+
6
+ /** 同一次撤销或重做共享过渡标识,关联画布据此播放位移动画。 */
7
+ interface DragHistoryControls {
8
+ canUndo: boolean;
9
+ canRedo: boolean;
10
+ undo(): void;
11
+ redo(): void;
12
+ transition?: {
13
+ itemId: string;
10
14
  };
11
- readonly owner?: HTMLElement | null;
12
- readonly theme?: Partial<DragTheme>;
13
- }
14
-
15
- /** 宿主提供的编辑视图和锚点。 */
16
- interface EditorHostProps {
17
- readonly request: {
18
- readonly view: ReactNode;
19
- readonly clientAnchor: DragPoint;
20
- };
21
- readonly onClose: () => void;
22
- readonly owner?: HTMLElement | null;
23
- readonly theme?: Partial<DragTheme>;
24
- }
25
-
26
- type DragOptions<T> = Parameters<typeof dragAnyProjection.create<T>>[0];
27
- /** React 画布支持的原生内容文档或声明式 JSX。 */
28
- type ReactDragContentInput = DragContentInput | ReactNode;
29
- /** 通用 Canvas UI JSX 可投影的拖拽布局。 */
30
- type DragJSXMode = "queue" | "lanes";
31
- /** 依据结构 JSX 的原始 key 绑定拖拽业务数据。 */
32
- type DragJSXRole<T> = {
33
- kind: "region";
34
- id: string;
35
- dropDisabled?: boolean;
36
- } | {
37
- kind: "header";
38
- } | {
39
- kind: "items";
40
- } | {
41
- kind: "card";
42
- id: string;
43
- data?: T;
44
- disabled?: boolean;
45
- };
46
- /** 通用 JSX 入口的布局和角色查找方式。 */
47
- interface DragJSXOptions<T> {
48
- readonly dragLayout: DragJSXMode;
49
- readonly getDragRole: (key: string) => DragJSXRole<T> | undefined;
50
15
  }
51
- type WithoutDragJSX = {
52
- [Key in keyof DragJSXOptions<unknown>]?: never;
16
+ /** 保存受控排布的不可变版本;只记录业务侧确认的提交。 */
17
+ declare function useDragHistory<T>(initial: T | (() => T), limit?: number): {
18
+ value: T;
19
+ commit: (action: SetStateAction<T>, itemId: string) => void;
20
+ reset: (action: SetStateAction<T>) => void;
21
+ undo: () => void;
22
+ redo: () => void;
23
+ canUndo: boolean;
24
+ canRedo: boolean;
25
+ transition: {
26
+ itemId: string;
27
+ } | undefined;
53
28
  };
54
- interface ReactDragAnyBoardProps<T> extends Omit<DragOptions<T>, "model" | "contentRuntime" | "renderCard" | "render" | "onMoveRequest"> {
55
- readonly height?: number | string;
56
- readonly active?: boolean;
57
- readonly className?: string;
58
- readonly style?: CSSProperties;
59
- readonly rootRef?: Ref<HTMLDivElement>;
60
- readonly render?: (context: DragRegionRenderContext<T>) => ReactDragContentInput | undefined;
61
- readonly renderCard?: (context: DragRenderContext<T>) => ReactDragContentInput;
62
- readonly storageKey?: string;
63
- readonly onScrollbarChange?: (options: DragScrollbarOptions | undefined) => void;
64
- readonly tooltip?: TooltipProps["request"];
65
- readonly editor?: Pick<EditorHostProps, "request" | "onClose">;
66
- }
67
- type ControlledBoard<T> = Pick<DragOptions<T>, "model" | "onMoveRequest"> & {
68
- readonly acknowledgedTransactionId?: string;
69
- };
70
- /** 声明式独立画布,可传原生文档或 JSX 布局根。 */
71
- type ReactDragAnyDeclarativeProps<T> = Omit<ReactDragAnyBoardProps<T | undefined>, "layout" | "render" | "renderCard" | "renderVersion"> & Pick<ControlledBoard<T | undefined>, "onMoveRequest" | "acknowledgedTransactionId"> & {
72
- readonly layout?: never;
73
- readonly model?: never;
74
- readonly render?: never;
75
- readonly renderCard?: never;
76
- readonly renderVersion?: never;
77
- } & ((WithoutDragJSX & {
78
- readonly document: DragDocument<T, ReactDragContentInput>;
79
- readonly children?: never;
80
- readonly store?: never;
81
- }) | ((WithoutDragJSX | DragJSXOptions<T>) & {
82
- readonly children: ReactNode;
83
- readonly document?: never;
84
- readonly store?: never;
85
- }) | (WithoutDragJSX & {
86
- readonly store: DragStore<T>;
87
- readonly children?: never;
88
- readonly document?: never;
89
- }));
90
- /** 声明式组由成员提交文档,组接收一个确认事务。 */
91
- interface ReactDragAnyGroupProps<T> {
92
- readonly onMoveRequest?: (proposal: DragMoveProposal<T | undefined>) => void;
93
- readonly onError?: (error: unknown) => void;
94
- readonly children?: ReactNode;
95
- readonly state?: never;
96
- readonly acknowledgedTransactionId?: string;
97
- }
98
- /** 画布组的命令接口。 */
99
- interface ReactDragAnyGroupHandle {
100
- cancelDrag(reason?: string): void;
101
- rejectMove(transactionId: string, reason?: string): boolean;
102
- }
103
- /** 画布实例的命令接口;卸载或未挂载时没有快照。 */
104
- interface ReactDragAnyHandle<T> extends ReactDragAnyGroupHandle {
105
- scrollTo: DragAny<T>["scrollTo"];
106
- focusCard: DragAny<T>["focusCard"];
107
- getSnapshot(): ReturnType<DragAny<T>["getSnapshot"]> | undefined;
108
- }
109
- /** 动作标识的画布、展示实例和内容版本。 */
110
- interface ContentCompileContext {
111
- readonly boardId: DragId;
112
- readonly cardId?: DragId;
113
- readonly ownerKey?: string;
114
- readonly target?: DragRenderTarget;
115
- readonly renderContext?: DragRegionRenderContext<unknown>;
116
- readonly contentVersion?: string | number;
117
- readonly onDiagnostic?: (message: string, path: string) => void;
118
- }
119
- /** 可交给原生引擎的文档及其独立动作回调。 */
120
- interface CompiledContent {
121
- readonly document: CompiledUILayout["document"];
122
- readonly handlers: ReadonlyMap<string, (action: DragRegionContentAction, context: DragRegionRenderContext<unknown>) => void>;
123
- dispose(): void;
124
- }
125
-
126
- /** 以文档、结构 JSX 或 store 挂载声明式画布。 */
127
- declare const ReactDragAny: <T>(props: ReactDragAnyDeclarativeProps<T> & RefAttributes<ReactDragAnyHandle<T | undefined>>) => ReactElement | null;
128
29
 
129
- /** 声明式画布组在同一次发布中更新所有成员。 */
130
- declare const ReactDragAnyGroup: <T>(props: ReactDragAnyGroupProps<T> & RefAttributes<ReactDragAnyGroupHandle>) => ReactElement | null;
131
-
132
- /** 带展示实例 ID 的 JSX 或原生内容诊断。 */
133
- declare class ContentCompileError extends DragContentError {
134
- readonly cardId: string;
135
- constructor(cardId: string, code: DragContentErrorCode, nodePath: string);
136
- }
137
- /** 将 UI 声明或兼容的内置标签转换为 Canvas UI 文档和动作绑定。 */
138
- declare function compileJSX(input: unknown, context: ContentCompileContext): CompiledContent;
139
-
140
- type PreparedContent = CompiledContent & {
141
- readonly layoutKey?: object;
30
+ declare function Source<T>(_props: SourceOptions<T> & {
31
+ children: ReactNode;
32
+ }): null;
33
+ declare function Target<T>(_props: TargetOptions<T> & {
34
+ children: ReactNode;
35
+ }): null;
36
+
37
+ interface DragSurfaceProps<T> extends SurfaceOptions<T> {
38
+ children: ReactNode;
39
+ history?: DragHistoryControls;
40
+ onViewportChange?: NonNullable<Parameters<typeof mountDragSurface>[2]>["onViewportChange"];
41
+ contextMenu?: DragContextMenuOptions | false;
42
+ storageKey?: string;
43
+ onNodeAction?: NonNullable<Parameters<typeof mountDragSurface>[2]>["onAction"];
44
+ height?: number | string;
45
+ style?: CSSProperties;
46
+ className?: string;
47
+ }
48
+ /** 将声明树挂载到单张画布,更新受控数据时保留宿主滚动状态。 */
49
+ declare function Surface<T>({ id, group, hasItem, autoScrollEdge, history, contextMenu, storageKey, onNodeAction, onMoveRequest, onViewportChange, children, height, className, style, }: DragSurfaceProps<T>): react.JSX.Element;
50
+ declare const Drag: {
51
+ Surface: typeof Surface;
52
+ Source: typeof Source;
53
+ Target: typeof Target;
142
54
  };
143
- /** 单个 React 画布的内容回调生命周期。 */
144
- interface ContentBindings {
145
- prepare(input: ReactDragContentInput, context: ContentCompileContext): PreparedContent;
146
- commit(prepared: CompiledContent): void;
147
- dispatch(action: DragRegionContentAction | Pick<DragContentAction, "cardId" | "actionId">): boolean;
148
- release(prepared: CompiledContent): void;
149
- destroy(): void;
150
- }
151
- /** 创建实例级侧表,prepare 计算内容,commit 发布该次准备的回调。 */
152
- declare function createContentBindings(): ContentBindings;
153
-
154
- type Content = ReactDragContentInput;
155
- type ChildrenOr<K extends string, Value> = ({
156
- children?: ReactNode;
157
- } & {
158
- [P in K]?: never;
159
- }) | ({
160
- children?: never;
161
- } & {
162
- [P in K]?: Value;
163
- });
164
- type Cards<T> = ChildrenOr<"cards", readonly DragDocumentCard<T, Content>[]>;
165
- type Root<T, K extends DragDocument["type"]> = Extract<DragDocument<T, Content>, {
166
- type: K;
167
- }>;
168
- type LanesProps<T> = Omit<Root<T, "lanes">, "type" | "lanes"> & ChildrenOr<"lanes", readonly DragDocumentLane<T, Content>[]>;
169
- type GridProps<T> = Omit<Root<T, "sparse-grid">, "type" | "slots"> & ChildrenOr<"slots", readonly DragDocumentSlot<T, Content>[]>;
170
- type SequenceProps<T, K extends "queue" | "flow"> = Omit<Root<T, K>, "type" | "cards"> & Cards<T>;
171
- /** 声明一组自上向下排列的横向泳道。 */
172
- declare function Lanes<T>(_props: LanesProps<T>): never;
173
- declare function Lane<T>(_props: Omit<DragDocumentLane<T, Content>, "cards"> & Cards<T>): never;
174
- declare function SparseGrid<T>(_props: GridProps<T>): never;
175
- declare function GridSlot<T>(_props: Omit<DragDocumentSlot<T, Content>, "cards"> & Cards<T>): never;
176
- declare function Queue<T>(_props: SequenceProps<T, "queue">): never;
177
- declare function Flow<T>(_props: SequenceProps<T, "flow">): never;
178
- declare function Card<T>(_props: Omit<DragDocumentCard<T, Content>, "content"> & ChildrenOr<"content", Content>): never;
179
55
 
180
- export { Card, type CompiledContent, type ContentBindings, type ContentCompileContext, ContentCompileError, type DragJSXMode, type DragJSXOptions, type DragJSXRole, Flow, GridSlot, Lane, Lanes, Queue, ReactDragAny, type ReactDragAnyDeclarativeProps, ReactDragAnyGroup, type ReactDragAnyGroupHandle, type ReactDragAnyGroupProps, type ReactDragAnyHandle, type ReactDragAnyDeclarativeProps as ReactDragAnyProps, type ReactDragContentInput, SparseGrid, compileJSX, createContentBindings };
56
+ export { Drag, type DragHistoryControls, type DragSurfaceProps, useDragHistory };
package/dist/index.d.ts CHANGED
@@ -1,180 +1,56 @@
1
- import { ReactNode, CSSProperties, Ref, RefAttributes, ReactElement } from 'react';
2
- import { DragPoint, DragTheme, DragContentInput, DragRegionContentAction, DragRegionRenderContext, DragId, DragRenderTarget, dragAnyProjection, DragRenderContext, DragScrollbarOptions, DragDocument, DragStore, DragAny, DragMoveProposal, DragContentError, DragContentErrorCode, DragContentAction, DragDocumentCard, DragDocumentSlot, DragDocumentLane } from '@canvas-components/drag-any';
3
- import { CompiledUILayout } from '@canvas-components/react-canvas-ui';
4
-
5
- /** 热点或省略文本由宿主提供的提示内容。 */
6
- interface TooltipProps {
7
- readonly request: {
8
- readonly text: string;
9
- readonly clientAnchor: DragPoint;
1
+ import * as react from 'react';
2
+ import { SetStateAction, ReactNode, CSSProperties } from 'react';
3
+ import { SourceOptions, TargetOptions, SurfaceOptions, mountDragSurface, DragContextMenuOptions } from '@canvas-components/drag-any';
4
+ export { AutoScrollEdge } from '@canvas-components/drag-any';
5
+
6
+ /** 同一次撤销或重做共享过渡标识,关联画布据此播放位移动画。 */
7
+ interface DragHistoryControls {
8
+ canUndo: boolean;
9
+ canRedo: boolean;
10
+ undo(): void;
11
+ redo(): void;
12
+ transition?: {
13
+ itemId: string;
10
14
  };
11
- readonly owner?: HTMLElement | null;
12
- readonly theme?: Partial<DragTheme>;
13
- }
14
-
15
- /** 宿主提供的编辑视图和锚点。 */
16
- interface EditorHostProps {
17
- readonly request: {
18
- readonly view: ReactNode;
19
- readonly clientAnchor: DragPoint;
20
- };
21
- readonly onClose: () => void;
22
- readonly owner?: HTMLElement | null;
23
- readonly theme?: Partial<DragTheme>;
24
- }
25
-
26
- type DragOptions<T> = Parameters<typeof dragAnyProjection.create<T>>[0];
27
- /** React 画布支持的原生内容文档或声明式 JSX。 */
28
- type ReactDragContentInput = DragContentInput | ReactNode;
29
- /** 通用 Canvas UI JSX 可投影的拖拽布局。 */
30
- type DragJSXMode = "queue" | "lanes";
31
- /** 依据结构 JSX 的原始 key 绑定拖拽业务数据。 */
32
- type DragJSXRole<T> = {
33
- kind: "region";
34
- id: string;
35
- dropDisabled?: boolean;
36
- } | {
37
- kind: "header";
38
- } | {
39
- kind: "items";
40
- } | {
41
- kind: "card";
42
- id: string;
43
- data?: T;
44
- disabled?: boolean;
45
- };
46
- /** 通用 JSX 入口的布局和角色查找方式。 */
47
- interface DragJSXOptions<T> {
48
- readonly dragLayout: DragJSXMode;
49
- readonly getDragRole: (key: string) => DragJSXRole<T> | undefined;
50
15
  }
51
- type WithoutDragJSX = {
52
- [Key in keyof DragJSXOptions<unknown>]?: never;
16
+ /** 保存受控排布的不可变版本;只记录业务侧确认的提交。 */
17
+ declare function useDragHistory<T>(initial: T | (() => T), limit?: number): {
18
+ value: T;
19
+ commit: (action: SetStateAction<T>, itemId: string) => void;
20
+ reset: (action: SetStateAction<T>) => void;
21
+ undo: () => void;
22
+ redo: () => void;
23
+ canUndo: boolean;
24
+ canRedo: boolean;
25
+ transition: {
26
+ itemId: string;
27
+ } | undefined;
53
28
  };
54
- interface ReactDragAnyBoardProps<T> extends Omit<DragOptions<T>, "model" | "contentRuntime" | "renderCard" | "render" | "onMoveRequest"> {
55
- readonly height?: number | string;
56
- readonly active?: boolean;
57
- readonly className?: string;
58
- readonly style?: CSSProperties;
59
- readonly rootRef?: Ref<HTMLDivElement>;
60
- readonly render?: (context: DragRegionRenderContext<T>) => ReactDragContentInput | undefined;
61
- readonly renderCard?: (context: DragRenderContext<T>) => ReactDragContentInput;
62
- readonly storageKey?: string;
63
- readonly onScrollbarChange?: (options: DragScrollbarOptions | undefined) => void;
64
- readonly tooltip?: TooltipProps["request"];
65
- readonly editor?: Pick<EditorHostProps, "request" | "onClose">;
66
- }
67
- type ControlledBoard<T> = Pick<DragOptions<T>, "model" | "onMoveRequest"> & {
68
- readonly acknowledgedTransactionId?: string;
69
- };
70
- /** 声明式独立画布,可传原生文档或 JSX 布局根。 */
71
- type ReactDragAnyDeclarativeProps<T> = Omit<ReactDragAnyBoardProps<T | undefined>, "layout" | "render" | "renderCard" | "renderVersion"> & Pick<ControlledBoard<T | undefined>, "onMoveRequest" | "acknowledgedTransactionId"> & {
72
- readonly layout?: never;
73
- readonly model?: never;
74
- readonly render?: never;
75
- readonly renderCard?: never;
76
- readonly renderVersion?: never;
77
- } & ((WithoutDragJSX & {
78
- readonly document: DragDocument<T, ReactDragContentInput>;
79
- readonly children?: never;
80
- readonly store?: never;
81
- }) | ((WithoutDragJSX | DragJSXOptions<T>) & {
82
- readonly children: ReactNode;
83
- readonly document?: never;
84
- readonly store?: never;
85
- }) | (WithoutDragJSX & {
86
- readonly store: DragStore<T>;
87
- readonly children?: never;
88
- readonly document?: never;
89
- }));
90
- /** 声明式组由成员提交文档,组接收一个确认事务。 */
91
- interface ReactDragAnyGroupProps<T> {
92
- readonly onMoveRequest?: (proposal: DragMoveProposal<T | undefined>) => void;
93
- readonly onError?: (error: unknown) => void;
94
- readonly children?: ReactNode;
95
- readonly state?: never;
96
- readonly acknowledgedTransactionId?: string;
97
- }
98
- /** 画布组的命令接口。 */
99
- interface ReactDragAnyGroupHandle {
100
- cancelDrag(reason?: string): void;
101
- rejectMove(transactionId: string, reason?: string): boolean;
102
- }
103
- /** 画布实例的命令接口;卸载或未挂载时没有快照。 */
104
- interface ReactDragAnyHandle<T> extends ReactDragAnyGroupHandle {
105
- scrollTo: DragAny<T>["scrollTo"];
106
- focusCard: DragAny<T>["focusCard"];
107
- getSnapshot(): ReturnType<DragAny<T>["getSnapshot"]> | undefined;
108
- }
109
- /** 动作标识的画布、展示实例和内容版本。 */
110
- interface ContentCompileContext {
111
- readonly boardId: DragId;
112
- readonly cardId?: DragId;
113
- readonly ownerKey?: string;
114
- readonly target?: DragRenderTarget;
115
- readonly renderContext?: DragRegionRenderContext<unknown>;
116
- readonly contentVersion?: string | number;
117
- readonly onDiagnostic?: (message: string, path: string) => void;
118
- }
119
- /** 可交给原生引擎的文档及其独立动作回调。 */
120
- interface CompiledContent {
121
- readonly document: CompiledUILayout["document"];
122
- readonly handlers: ReadonlyMap<string, (action: DragRegionContentAction, context: DragRegionRenderContext<unknown>) => void>;
123
- dispose(): void;
124
- }
125
-
126
- /** 以文档、结构 JSX 或 store 挂载声明式画布。 */
127
- declare const ReactDragAny: <T>(props: ReactDragAnyDeclarativeProps<T> & RefAttributes<ReactDragAnyHandle<T | undefined>>) => ReactElement | null;
128
29
 
129
- /** 声明式画布组在同一次发布中更新所有成员。 */
130
- declare const ReactDragAnyGroup: <T>(props: ReactDragAnyGroupProps<T> & RefAttributes<ReactDragAnyGroupHandle>) => ReactElement | null;
131
-
132
- /** 带展示实例 ID 的 JSX 或原生内容诊断。 */
133
- declare class ContentCompileError extends DragContentError {
134
- readonly cardId: string;
135
- constructor(cardId: string, code: DragContentErrorCode, nodePath: string);
136
- }
137
- /** 将 UI 声明或兼容的内置标签转换为 Canvas UI 文档和动作绑定。 */
138
- declare function compileJSX(input: unknown, context: ContentCompileContext): CompiledContent;
139
-
140
- type PreparedContent = CompiledContent & {
141
- readonly layoutKey?: object;
30
+ declare function Source<T>(_props: SourceOptions<T> & {
31
+ children: ReactNode;
32
+ }): null;
33
+ declare function Target<T>(_props: TargetOptions<T> & {
34
+ children: ReactNode;
35
+ }): null;
36
+
37
+ interface DragSurfaceProps<T> extends SurfaceOptions<T> {
38
+ children: ReactNode;
39
+ history?: DragHistoryControls;
40
+ onViewportChange?: NonNullable<Parameters<typeof mountDragSurface>[2]>["onViewportChange"];
41
+ contextMenu?: DragContextMenuOptions | false;
42
+ storageKey?: string;
43
+ onNodeAction?: NonNullable<Parameters<typeof mountDragSurface>[2]>["onAction"];
44
+ height?: number | string;
45
+ style?: CSSProperties;
46
+ className?: string;
47
+ }
48
+ /** 将声明树挂载到单张画布,更新受控数据时保留宿主滚动状态。 */
49
+ declare function Surface<T>({ id, group, hasItem, autoScrollEdge, history, contextMenu, storageKey, onNodeAction, onMoveRequest, onViewportChange, children, height, className, style, }: DragSurfaceProps<T>): react.JSX.Element;
50
+ declare const Drag: {
51
+ Surface: typeof Surface;
52
+ Source: typeof Source;
53
+ Target: typeof Target;
142
54
  };
143
- /** 单个 React 画布的内容回调生命周期。 */
144
- interface ContentBindings {
145
- prepare(input: ReactDragContentInput, context: ContentCompileContext): PreparedContent;
146
- commit(prepared: CompiledContent): void;
147
- dispatch(action: DragRegionContentAction | Pick<DragContentAction, "cardId" | "actionId">): boolean;
148
- release(prepared: CompiledContent): void;
149
- destroy(): void;
150
- }
151
- /** 创建实例级侧表,prepare 计算内容,commit 发布该次准备的回调。 */
152
- declare function createContentBindings(): ContentBindings;
153
-
154
- type Content = ReactDragContentInput;
155
- type ChildrenOr<K extends string, Value> = ({
156
- children?: ReactNode;
157
- } & {
158
- [P in K]?: never;
159
- }) | ({
160
- children?: never;
161
- } & {
162
- [P in K]?: Value;
163
- });
164
- type Cards<T> = ChildrenOr<"cards", readonly DragDocumentCard<T, Content>[]>;
165
- type Root<T, K extends DragDocument["type"]> = Extract<DragDocument<T, Content>, {
166
- type: K;
167
- }>;
168
- type LanesProps<T> = Omit<Root<T, "lanes">, "type" | "lanes"> & ChildrenOr<"lanes", readonly DragDocumentLane<T, Content>[]>;
169
- type GridProps<T> = Omit<Root<T, "sparse-grid">, "type" | "slots"> & ChildrenOr<"slots", readonly DragDocumentSlot<T, Content>[]>;
170
- type SequenceProps<T, K extends "queue" | "flow"> = Omit<Root<T, K>, "type" | "cards"> & Cards<T>;
171
- /** 声明一组自上向下排列的横向泳道。 */
172
- declare function Lanes<T>(_props: LanesProps<T>): never;
173
- declare function Lane<T>(_props: Omit<DragDocumentLane<T, Content>, "cards"> & Cards<T>): never;
174
- declare function SparseGrid<T>(_props: GridProps<T>): never;
175
- declare function GridSlot<T>(_props: Omit<DragDocumentSlot<T, Content>, "cards"> & Cards<T>): never;
176
- declare function Queue<T>(_props: SequenceProps<T, "queue">): never;
177
- declare function Flow<T>(_props: SequenceProps<T, "flow">): never;
178
- declare function Card<T>(_props: Omit<DragDocumentCard<T, Content>, "content"> & ChildrenOr<"content", Content>): never;
179
55
 
180
- export { Card, type CompiledContent, type ContentBindings, type ContentCompileContext, ContentCompileError, type DragJSXMode, type DragJSXOptions, type DragJSXRole, Flow, GridSlot, Lane, Lanes, Queue, ReactDragAny, type ReactDragAnyDeclarativeProps, ReactDragAnyGroup, type ReactDragAnyGroupHandle, type ReactDragAnyGroupProps, type ReactDragAnyHandle, type ReactDragAnyDeclarativeProps as ReactDragAnyProps, type ReactDragContentInput, SparseGrid, compileJSX, createContentBindings };
56
+ export { Drag, type DragHistoryControls, type DragSurfaceProps, useDragHistory };