foldkit 0.111.1 → 0.112.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.
Files changed (222) hide show
  1. package/README.md +2 -2
  2. package/dist/devTools/host.d.ts +6 -0
  3. package/dist/devTools/host.d.ts.map +1 -0
  4. package/dist/devTools/host.js +4 -0
  5. package/dist/dom/dom.d.ts +6 -1
  6. package/dist/dom/dom.d.ts.map +1 -1
  7. package/dist/dom/dom.js +24 -1
  8. package/dist/html/index.d.ts +4 -3
  9. package/dist/html/index.d.ts.map +1 -1
  10. package/dist/html/index.js +4 -3
  11. package/dist/html/submodel.d.ts +2 -2
  12. package/dist/html/submodel.d.ts.map +1 -1
  13. package/dist/index.d.ts +0 -1
  14. package/dist/index.d.ts.map +1 -1
  15. package/dist/index.js +0 -1
  16. package/dist/runtime/public.d.ts +1 -1
  17. package/dist/runtime/public.d.ts.map +1 -1
  18. package/dist/runtime/runtime.d.ts +14 -1
  19. package/dist/runtime/runtime.d.ts.map +1 -1
  20. package/dist/runtime/runtime.js +7 -4
  21. package/dist/runtime/subscription.d.ts +1 -1
  22. package/dist/subscription/public.d.ts +1 -1
  23. package/dist/subscription/public.d.ts.map +1 -1
  24. package/package.json +12 -93
  25. package/dist/devTools/overlay-styles.d.ts +0 -3
  26. package/dist/devTools/overlay-styles.d.ts.map +0 -1
  27. package/dist/devTools/overlay-styles.js +0 -706
  28. package/dist/devTools/overlay.d.ts +0 -63
  29. package/dist/devTools/overlay.d.ts.map +0 -1
  30. package/dist/devTools/overlay.js +0 -1244
  31. package/dist/test/apps/disabledButton.d.ts +0 -38
  32. package/dist/test/apps/disabledButton.d.ts.map +0 -1
  33. package/dist/test/apps/disabledButton.js +0 -71
  34. package/dist/ui/anchor.d.ts +0 -38
  35. package/dist/ui/anchor.d.ts.map +0 -1
  36. package/dist/ui/anchor.js +0 -142
  37. package/dist/ui/animation/index.d.ts +0 -49
  38. package/dist/ui/animation/index.d.ts.map +0 -1
  39. package/dist/ui/animation/index.js +0 -74
  40. package/dist/ui/animation/public.d.ts +0 -3
  41. package/dist/ui/animation/public.d.ts.map +0 -1
  42. package/dist/ui/animation/public.js +0 -1
  43. package/dist/ui/animation/schema.d.ts +0 -43
  44. package/dist/ui/animation/schema.d.ts.map +0 -1
  45. package/dist/ui/animation/schema.js +0 -41
  46. package/dist/ui/animation/update.d.ts +0 -24
  47. package/dist/ui/animation/update.d.ts.map +0 -1
  48. package/dist/ui/animation/update.js +0 -67
  49. package/dist/ui/button/index.d.ts +0 -17
  50. package/dist/ui/button/index.d.ts.map +0 -1
  51. package/dist/ui/button/index.js +0 -22
  52. package/dist/ui/button/public.d.ts +0 -3
  53. package/dist/ui/button/public.d.ts.map +0 -1
  54. package/dist/ui/button/public.js +0 -1
  55. package/dist/ui/calendar/index.d.ts +0 -462
  56. package/dist/ui/calendar/index.d.ts.map +0 -1
  57. package/dist/ui/calendar/index.js +0 -824
  58. package/dist/ui/calendar/public.d.ts +0 -3
  59. package/dist/ui/calendar/public.d.ts.map +0 -1
  60. package/dist/ui/calendar/public.js +0 -1
  61. package/dist/ui/checkbox/index.d.ts +0 -119
  62. package/dist/ui/checkbox/index.d.ts.map +0 -1
  63. package/dist/ui/checkbox/index.js +0 -110
  64. package/dist/ui/checkbox/public.d.ts +0 -3
  65. package/dist/ui/checkbox/public.d.ts.map +0 -1
  66. package/dist/ui/checkbox/public.js +0 -1
  67. package/dist/ui/combobox/multi.d.ts +0 -184
  68. package/dist/ui/combobox/multi.d.ts.map +0 -1
  69. package/dist/ui/combobox/multi.js +0 -81
  70. package/dist/ui/combobox/multiPublic.d.ts +0 -3
  71. package/dist/ui/combobox/multiPublic.d.ts.map +0 -1
  72. package/dist/ui/combobox/multiPublic.js +0 -1
  73. package/dist/ui/combobox/public.d.ts +0 -7
  74. package/dist/ui/combobox/public.d.ts.map +0 -1
  75. package/dist/ui/combobox/public.js +0 -3
  76. package/dist/ui/combobox/shared.d.ts +0 -422
  77. package/dist/ui/combobox/shared.d.ts.map +0 -1
  78. package/dist/ui/combobox/shared.js +0 -707
  79. package/dist/ui/combobox/single.d.ts +0 -199
  80. package/dist/ui/combobox/single.d.ts.map +0 -1
  81. package/dist/ui/combobox/single.js +0 -106
  82. package/dist/ui/datePicker/index.d.ts +0 -457
  83. package/dist/ui/datePicker/index.d.ts.map +0 -1
  84. package/dist/ui/datePicker/index.js +0 -317
  85. package/dist/ui/datePicker/public.d.ts +0 -3
  86. package/dist/ui/datePicker/public.d.ts.map +0 -1
  87. package/dist/ui/datePicker/public.js +0 -1
  88. package/dist/ui/dialog/index.d.ts +0 -155
  89. package/dist/ui/dialog/index.d.ts.map +0 -1
  90. package/dist/ui/dialog/index.js +0 -208
  91. package/dist/ui/dialog/public.d.ts +0 -3
  92. package/dist/ui/dialog/public.d.ts.map +0 -1
  93. package/dist/ui/dialog/public.js +0 -1
  94. package/dist/ui/disclosure/index.d.ts +0 -110
  95. package/dist/ui/disclosure/index.d.ts.map +0 -1
  96. package/dist/ui/disclosure/index.js +0 -110
  97. package/dist/ui/disclosure/public.d.ts +0 -3
  98. package/dist/ui/disclosure/public.d.ts.map +0 -1
  99. package/dist/ui/disclosure/public.js +0 -1
  100. package/dist/ui/dragAndDrop/index.d.ts +0 -540
  101. package/dist/ui/dragAndDrop/index.d.ts.map +0 -1
  102. package/dist/ui/dragAndDrop/index.js +0 -535
  103. package/dist/ui/dragAndDrop/public.d.ts +0 -3
  104. package/dist/ui/dragAndDrop/public.d.ts.map +0 -1
  105. package/dist/ui/dragAndDrop/public.js +0 -1
  106. package/dist/ui/fieldset/index.d.ts +0 -21
  107. package/dist/ui/fieldset/index.d.ts.map +0 -1
  108. package/dist/ui/fieldset/index.js +0 -25
  109. package/dist/ui/fieldset/public.d.ts +0 -3
  110. package/dist/ui/fieldset/public.d.ts.map +0 -1
  111. package/dist/ui/fieldset/public.js +0 -1
  112. package/dist/ui/fileDrop/index.d.ts +0 -109
  113. package/dist/ui/fileDrop/index.d.ts.map +0 -1
  114. package/dist/ui/fileDrop/index.js +0 -126
  115. package/dist/ui/fileDrop/public.d.ts +0 -3
  116. package/dist/ui/fileDrop/public.d.ts.map +0 -1
  117. package/dist/ui/fileDrop/public.js +0 -1
  118. package/dist/ui/group.d.ts +0 -8
  119. package/dist/ui/group.d.ts.map +0 -1
  120. package/dist/ui/group.js +0 -13
  121. package/dist/ui/index.d.ts +0 -25
  122. package/dist/ui/index.d.ts.map +0 -1
  123. package/dist/ui/index.js +0 -24
  124. package/dist/ui/input/index.d.ts +0 -26
  125. package/dist/ui/input/index.d.ts.map +0 -1
  126. package/dist/ui/input/index.js +0 -43
  127. package/dist/ui/input/public.d.ts +0 -3
  128. package/dist/ui/input/public.d.ts.map +0 -1
  129. package/dist/ui/input/public.js +0 -1
  130. package/dist/ui/keyboard.d.ts +0 -6
  131. package/dist/ui/keyboard.d.ts.map +0 -1
  132. package/dist/ui/keyboard.js +0 -9
  133. package/dist/ui/listbox/multi.d.ts +0 -190
  134. package/dist/ui/listbox/multi.d.ts.map +0 -1
  135. package/dist/ui/listbox/multi.js +0 -65
  136. package/dist/ui/listbox/multiPublic.d.ts +0 -3
  137. package/dist/ui/listbox/multiPublic.d.ts.map +0 -1
  138. package/dist/ui/listbox/multiPublic.js +0 -1
  139. package/dist/ui/listbox/public.d.ts +0 -7
  140. package/dist/ui/listbox/public.d.ts.map +0 -1
  141. package/dist/ui/listbox/public.js +0 -3
  142. package/dist/ui/listbox/shared.d.ts +0 -431
  143. package/dist/ui/listbox/shared.d.ts.map +0 -1
  144. package/dist/ui/listbox/shared.js +0 -669
  145. package/dist/ui/listbox/single.d.ts +0 -208
  146. package/dist/ui/listbox/single.d.ts.map +0 -1
  147. package/dist/ui/listbox/single.js +0 -73
  148. package/dist/ui/menu/index.d.ts +0 -367
  149. package/dist/ui/menu/index.d.ts.map +0 -1
  150. package/dist/ui/menu/index.js +0 -681
  151. package/dist/ui/menu/public.d.ts +0 -4
  152. package/dist/ui/menu/public.d.ts.map +0 -1
  153. package/dist/ui/menu/public.js +0 -1
  154. package/dist/ui/popover/index.d.ts +0 -267
  155. package/dist/ui/popover/index.d.ts.map +0 -1
  156. package/dist/ui/popover/index.js +0 -345
  157. package/dist/ui/popover/public.d.ts +0 -4
  158. package/dist/ui/popover/public.d.ts.map +0 -1
  159. package/dist/ui/popover/public.js +0 -1
  160. package/dist/ui/radioGroup/index.d.ts +0 -169
  161. package/dist/ui/radioGroup/index.d.ts.map +0 -1
  162. package/dist/ui/radioGroup/index.js +0 -196
  163. package/dist/ui/radioGroup/public.d.ts +0 -3
  164. package/dist/ui/radioGroup/public.d.ts.map +0 -1
  165. package/dist/ui/radioGroup/public.js +0 -1
  166. package/dist/ui/select/index.d.ts +0 -24
  167. package/dist/ui/select/index.d.ts.map +0 -1
  168. package/dist/ui/select/index.js +0 -40
  169. package/dist/ui/select/public.d.ts +0 -3
  170. package/dist/ui/select/public.d.ts.map +0 -1
  171. package/dist/ui/select/public.js +0 -1
  172. package/dist/ui/slider/index.d.ts +0 -318
  173. package/dist/ui/slider/index.d.ts.map +0 -1
  174. package/dist/ui/slider/index.js +0 -336
  175. package/dist/ui/slider/public.d.ts +0 -3
  176. package/dist/ui/slider/public.d.ts.map +0 -1
  177. package/dist/ui/slider/public.js +0 -1
  178. package/dist/ui/switch/index.d.ts +0 -99
  179. package/dist/ui/switch/index.d.ts.map +0 -1
  180. package/dist/ui/switch/index.js +0 -106
  181. package/dist/ui/switch/public.d.ts +0 -3
  182. package/dist/ui/switch/public.d.ts.map +0 -1
  183. package/dist/ui/switch/public.js +0 -1
  184. package/dist/ui/tabs/index.d.ts +0 -155
  185. package/dist/ui/tabs/index.d.ts.map +0 -1
  186. package/dist/ui/tabs/index.js +0 -184
  187. package/dist/ui/tabs/public.d.ts +0 -3
  188. package/dist/ui/tabs/public.d.ts.map +0 -1
  189. package/dist/ui/tabs/public.js +0 -1
  190. package/dist/ui/textarea/index.d.ts +0 -26
  191. package/dist/ui/textarea/index.d.ts.map +0 -1
  192. package/dist/ui/textarea/index.js +0 -44
  193. package/dist/ui/textarea/public.d.ts +0 -3
  194. package/dist/ui/textarea/public.d.ts.map +0 -1
  195. package/dist/ui/textarea/public.js +0 -1
  196. package/dist/ui/toast/index.d.ts +0 -608
  197. package/dist/ui/toast/index.d.ts.map +0 -1
  198. package/dist/ui/toast/index.js +0 -145
  199. package/dist/ui/toast/public.d.ts +0 -4
  200. package/dist/ui/toast/public.d.ts.map +0 -1
  201. package/dist/ui/toast/public.js +0 -1
  202. package/dist/ui/toast/schema.d.ts +0 -154
  203. package/dist/ui/toast/schema.d.ts.map +0 -1
  204. package/dist/ui/toast/schema.js +0 -93
  205. package/dist/ui/toast/update.d.ts +0 -510
  206. package/dist/ui/toast/update.d.ts.map +0 -1
  207. package/dist/ui/toast/update.js +0 -225
  208. package/dist/ui/tooltip/index.d.ts +0 -170
  209. package/dist/ui/tooltip/index.d.ts.map +0 -1
  210. package/dist/ui/tooltip/index.js +0 -252
  211. package/dist/ui/tooltip/public.d.ts +0 -4
  212. package/dist/ui/tooltip/public.d.ts.map +0 -1
  213. package/dist/ui/tooltip/public.js +0 -1
  214. package/dist/ui/typeahead.d.ts +0 -4
  215. package/dist/ui/typeahead.d.ts.map +0 -1
  216. package/dist/ui/typeahead.js +0 -14
  217. package/dist/ui/virtualList/index.d.ts +0 -202
  218. package/dist/ui/virtualList/index.d.ts.map +0 -1
  219. package/dist/ui/virtualList/index.js +0 -391
  220. package/dist/ui/virtualList/public.d.ts +0 -3
  221. package/dist/ui/virtualList/public.d.ts.map +0 -1
  222. package/dist/ui/virtualList/public.js +0 -1
@@ -1,540 +0,0 @@
1
- import { Effect, Equivalence, Option, Schema as S, Stream } from 'effect';
2
- import * as Command from '../../command/index.js';
3
- import { type Attribute } from '../../html/index.js';
4
- import * as Subscription from '../../runtime/subscription.js';
5
- declare const DropTarget: S.Struct<{
6
- readonly containerId: S.String;
7
- readonly index: S.Number;
8
- }>;
9
- /** Schema for the drag-and-drop component's state, tracking its unique ID, orientation, and current drag phase. */
10
- export declare const Model: S.Struct<{
11
- readonly id: S.String;
12
- readonly orientation: S.Literals<readonly ["Horizontal", "Vertical"]>;
13
- readonly activationThreshold: S.Number;
14
- readonly dragState: S.Union<readonly [import("../../schema/index.js").CallableTaggedStruct<"Idle", {}>, import("../../schema/index.js").CallableTaggedStruct<"Pending", {
15
- itemId: S.String;
16
- containerId: S.String;
17
- index: S.Number;
18
- origin: S.Struct<{
19
- readonly screenX: S.Number;
20
- readonly screenY: S.Number;
21
- }>;
22
- }>, import("../../schema/index.js").CallableTaggedStruct<"Dragging", {
23
- itemId: S.String;
24
- sourceContainerId: S.String;
25
- sourceIndex: S.Number;
26
- origin: S.Struct<{
27
- readonly screenX: S.Number;
28
- readonly screenY: S.Number;
29
- }>;
30
- current: S.Struct<{
31
- readonly clientX: S.Number;
32
- readonly clientY: S.Number;
33
- }>;
34
- maybeDropTarget: S.Option<S.Struct<{
35
- readonly containerId: S.String;
36
- readonly index: S.Number;
37
- }>>;
38
- }>, import("../../schema/index.js").CallableTaggedStruct<"KeyboardDragging", {
39
- itemId: S.String;
40
- sourceContainerId: S.String;
41
- sourceIndex: S.Number;
42
- targetContainerId: S.String;
43
- targetIndex: S.Number;
44
- }>]>;
45
- }>;
46
- export type Model = typeof Model.Type;
47
- /** The user pressed a pointer on a draggable item. */
48
- export declare const PressedDraggable: import("../../schema/index.js").CallableTaggedStruct<"PressedDraggable", {
49
- itemId: S.String;
50
- containerId: S.String;
51
- index: S.Number;
52
- screenX: S.Number;
53
- screenY: S.Number;
54
- }>;
55
- /** The pointer moved during a drag, with collision detection results. */
56
- export declare const MovedPointer: import("../../schema/index.js").CallableTaggedStruct<"MovedPointer", {
57
- screenX: S.Number;
58
- screenY: S.Number;
59
- clientX: S.Number;
60
- clientY: S.Number;
61
- maybeDropTarget: S.Option<S.Struct<{
62
- readonly containerId: S.String;
63
- readonly index: S.Number;
64
- }>>;
65
- }>;
66
- /** The pointer was released. */
67
- export declare const ReleasedPointer: import("../../schema/index.js").CallableTaggedStruct<"ReleasedPointer", {}>;
68
- /** Escape was pressed during a drag. */
69
- export declare const CancelledDrag: import("../../schema/index.js").CallableTaggedStruct<"CancelledDrag", {}>;
70
- /** The user activated keyboard drag with Space or Enter on a focused draggable. */
71
- export declare const ActivatedKeyboardDrag: import("../../schema/index.js").CallableTaggedStruct<"ActivatedKeyboardDrag", {
72
- itemId: S.String;
73
- containerId: S.String;
74
- index: S.Number;
75
- }>;
76
- /** The ResolveKeyboardMove Command resolved the next keyboard drag position. */
77
- export declare const ResolvedKeyboardMove: import("../../schema/index.js").CallableTaggedStruct<"ResolvedKeyboardMove", {
78
- targetContainerId: S.String;
79
- targetIndex: S.Number;
80
- }>;
81
- /** The user confirmed a keyboard drop with Space or Enter. */
82
- export declare const ConfirmedKeyboardDrop: import("../../schema/index.js").CallableTaggedStruct<"ConfirmedKeyboardDrop", {}>;
83
- /** The user pressed an arrow key during keyboard drag. */
84
- export declare const PressedArrowKey: import("../../schema/index.js").CallableTaggedStruct<"PressedArrowKey", {
85
- direction: S.Literals<readonly ["Up", "Down", "Left", "Right", "NextContainer", "PreviousContainer"]>;
86
- }>;
87
- /** An animation frame fired during auto-scroll. */
88
- export declare const AdvancedAutoScrollFrame: import("../../schema/index.js").CallableTaggedStruct<"AdvancedAutoScrollFrame", {}>;
89
- /** The FocusItem Command completed. */
90
- export declare const CompletedFocusItem: import("../../schema/index.js").CallableTaggedStruct<"CompletedFocusItem", {}>;
91
- /** Union of all messages the drag-and-drop component can produce. */
92
- export declare const Message: S.Union<[
93
- typeof PressedDraggable,
94
- typeof MovedPointer,
95
- typeof ReleasedPointer,
96
- typeof CancelledDrag,
97
- typeof ActivatedKeyboardDrag,
98
- typeof ResolvedKeyboardMove,
99
- typeof ConfirmedKeyboardDrop,
100
- typeof PressedArrowKey,
101
- typeof AdvancedAutoScrollFrame,
102
- typeof CompletedFocusItem
103
- ]>;
104
- export type Message = typeof Message.Type;
105
- /** Emitted when a drag completes with a valid drop target. The parent uses this to commit the reorder. */
106
- export declare const Reordered: import("../../schema/index.js").CallableTaggedStruct<"Reordered", {
107
- itemId: S.String;
108
- fromContainerId: S.String;
109
- fromIndex: S.Number;
110
- toContainerId: S.String;
111
- toIndex: S.Number;
112
- }>;
113
- /** Emitted when a drag is cancelled via Escape or pointer release without a drop target. */
114
- export declare const Cancelled: import("../../schema/index.js").CallableTaggedStruct<"Cancelled", {}>;
115
- /** Union of all out-messages the drag-and-drop component can emit to its parent. */
116
- export declare const OutMessage: S.Union<readonly [import("../../schema/index.js").CallableTaggedStruct<"Reordered", {
117
- itemId: S.String;
118
- fromContainerId: S.String;
119
- fromIndex: S.Number;
120
- toContainerId: S.String;
121
- toIndex: S.Number;
122
- }>, import("../../schema/index.js").CallableTaggedStruct<"Cancelled", {}>]>;
123
- export type OutMessage = typeof OutMessage.Type;
124
- export type InitConfig = Readonly<{
125
- id: string;
126
- orientation?: 'Horizontal' | 'Vertical';
127
- activationThreshold?: number;
128
- }>;
129
- /** Creates an initial drag-and-drop model. Starts in the Idle state with Vertical orientation and 5px activation threshold by default. */
130
- export declare const init: (config: InitConfig) => Model;
131
- /** Focuses a draggable item by ID after keyboard drop or cancel. */
132
- export declare const FocusItem: Command.CommandDefinitionWithArgs<"FocusItem", {
133
- itemId: S.String;
134
- }, Effect.Effect<{
135
- readonly _tag: "CompletedFocusItem";
136
- }, never, never>>;
137
- /** Resolves the next keyboard drag position by querying the DOM for adjacent sortable items and containers. */
138
- export declare const ResolveKeyboardMove: Command.CommandDefinitionWithArgs<"ResolveKeyboardMove", {
139
- itemId: S.String;
140
- currentContainerId: S.String;
141
- currentIndex: S.Number;
142
- direction: S.Literals<readonly ["Up", "Down", "Left", "Right", "NextContainer", "PreviousContainer"]>;
143
- }, Effect.Effect<{
144
- readonly _tag: "ResolvedKeyboardMove";
145
- readonly targetContainerId: string;
146
- readonly targetIndex: number;
147
- }, never, never>>;
148
- type UpdateReturn = readonly [
149
- Model,
150
- ReadonlyArray<Command.Command<Message>>,
151
- Option.Option<OutMessage>
152
- ];
153
- /** Processes a drag-and-drop message and returns the next model, commands, and an optional out-message for the parent. */
154
- export declare const update: (model: Model, message: Message) => UpdateReturn;
155
- /** Document-level subscriptions for pointer and keyboard events during drag operations. */
156
- export declare const subscriptions: {
157
- readonly documentPointer: Subscription.EntryWithoutKeepAlive<{
158
- readonly id: string;
159
- readonly orientation: "Vertical" | "Horizontal";
160
- readonly activationThreshold: number;
161
- readonly dragState: {
162
- readonly _tag: "Idle";
163
- } | {
164
- readonly _tag: "Pending";
165
- readonly itemId: string;
166
- readonly containerId: string;
167
- readonly index: number;
168
- readonly origin: {
169
- readonly screenX: number;
170
- readonly screenY: number;
171
- };
172
- } | {
173
- readonly _tag: "Dragging";
174
- readonly itemId: string;
175
- readonly sourceContainerId: string;
176
- readonly sourceIndex: number;
177
- readonly origin: {
178
- readonly screenX: number;
179
- readonly screenY: number;
180
- };
181
- readonly current: {
182
- readonly clientX: number;
183
- readonly clientY: number;
184
- };
185
- readonly maybeDropTarget: Option.Option<{
186
- readonly containerId: string;
187
- readonly index: number;
188
- }>;
189
- } | {
190
- readonly _tag: "KeyboardDragging";
191
- readonly itemId: string;
192
- readonly sourceContainerId: string;
193
- readonly sourceIndex: number;
194
- readonly targetContainerId: string;
195
- readonly targetIndex: number;
196
- };
197
- }, {
198
- readonly _tag: "CancelledDrag";
199
- } | {
200
- readonly _tag: "PressedDraggable";
201
- readonly itemId: string;
202
- readonly containerId: string;
203
- readonly index: number;
204
- readonly screenX: number;
205
- readonly screenY: number;
206
- } | {
207
- readonly _tag: "MovedPointer";
208
- readonly screenX: number;
209
- readonly screenY: number;
210
- readonly clientX: number;
211
- readonly clientY: number;
212
- readonly maybeDropTarget: Option.Option<{
213
- readonly containerId: string;
214
- readonly index: number;
215
- }>;
216
- } | {
217
- readonly _tag: "ReleasedPointer";
218
- } | {
219
- readonly _tag: "ActivatedKeyboardDrag";
220
- readonly itemId: string;
221
- readonly containerId: string;
222
- readonly index: number;
223
- } | {
224
- readonly _tag: "ResolvedKeyboardMove";
225
- readonly targetContainerId: string;
226
- readonly targetIndex: number;
227
- } | {
228
- readonly _tag: "ConfirmedKeyboardDrop";
229
- } | {
230
- readonly _tag: "PressedArrowKey";
231
- readonly direction: "Left" | "Right" | "Up" | "Down" | "NextContainer" | "PreviousContainer";
232
- } | {
233
- readonly _tag: "AdvancedAutoScrollFrame";
234
- } | {
235
- readonly _tag: "CompletedFocusItem";
236
- }, {
237
- readonly dragActivity: "Idle" | "Active";
238
- readonly orientation: "Vertical" | "Horizontal";
239
- }, never> & {
240
- readonly __subscription: never;
241
- };
242
- readonly documentEscape: Subscription.EntryWithoutKeepAlive<{
243
- readonly id: string;
244
- readonly orientation: "Vertical" | "Horizontal";
245
- readonly activationThreshold: number;
246
- readonly dragState: {
247
- readonly _tag: "Idle";
248
- } | {
249
- readonly _tag: "Pending";
250
- readonly itemId: string;
251
- readonly containerId: string;
252
- readonly index: number;
253
- readonly origin: {
254
- readonly screenX: number;
255
- readonly screenY: number;
256
- };
257
- } | {
258
- readonly _tag: "Dragging";
259
- readonly itemId: string;
260
- readonly sourceContainerId: string;
261
- readonly sourceIndex: number;
262
- readonly origin: {
263
- readonly screenX: number;
264
- readonly screenY: number;
265
- };
266
- readonly current: {
267
- readonly clientX: number;
268
- readonly clientY: number;
269
- };
270
- readonly maybeDropTarget: Option.Option<{
271
- readonly containerId: string;
272
- readonly index: number;
273
- }>;
274
- } | {
275
- readonly _tag: "KeyboardDragging";
276
- readonly itemId: string;
277
- readonly sourceContainerId: string;
278
- readonly sourceIndex: number;
279
- readonly targetContainerId: string;
280
- readonly targetIndex: number;
281
- };
282
- }, {
283
- readonly _tag: "CancelledDrag";
284
- } | {
285
- readonly _tag: "PressedDraggable";
286
- readonly itemId: string;
287
- readonly containerId: string;
288
- readonly index: number;
289
- readonly screenX: number;
290
- readonly screenY: number;
291
- } | {
292
- readonly _tag: "MovedPointer";
293
- readonly screenX: number;
294
- readonly screenY: number;
295
- readonly clientX: number;
296
- readonly clientY: number;
297
- readonly maybeDropTarget: Option.Option<{
298
- readonly containerId: string;
299
- readonly index: number;
300
- }>;
301
- } | {
302
- readonly _tag: "ReleasedPointer";
303
- } | {
304
- readonly _tag: "ActivatedKeyboardDrag";
305
- readonly itemId: string;
306
- readonly containerId: string;
307
- readonly index: number;
308
- } | {
309
- readonly _tag: "ResolvedKeyboardMove";
310
- readonly targetContainerId: string;
311
- readonly targetIndex: number;
312
- } | {
313
- readonly _tag: "ConfirmedKeyboardDrop";
314
- } | {
315
- readonly _tag: "PressedArrowKey";
316
- readonly direction: "Left" | "Right" | "Up" | "Down" | "NextContainer" | "PreviousContainer";
317
- } | {
318
- readonly _tag: "AdvancedAutoScrollFrame";
319
- } | {
320
- readonly _tag: "CompletedFocusItem";
321
- }, {
322
- readonly dragActivity: "Idle" | "Active";
323
- }, never> & {
324
- readonly __subscription: never;
325
- };
326
- readonly documentKeyboard: Subscription.EntryWithoutKeepAlive<{
327
- readonly id: string;
328
- readonly orientation: "Vertical" | "Horizontal";
329
- readonly activationThreshold: number;
330
- readonly dragState: {
331
- readonly _tag: "Idle";
332
- } | {
333
- readonly _tag: "Pending";
334
- readonly itemId: string;
335
- readonly containerId: string;
336
- readonly index: number;
337
- readonly origin: {
338
- readonly screenX: number;
339
- readonly screenY: number;
340
- };
341
- } | {
342
- readonly _tag: "Dragging";
343
- readonly itemId: string;
344
- readonly sourceContainerId: string;
345
- readonly sourceIndex: number;
346
- readonly origin: {
347
- readonly screenX: number;
348
- readonly screenY: number;
349
- };
350
- readonly current: {
351
- readonly clientX: number;
352
- readonly clientY: number;
353
- };
354
- readonly maybeDropTarget: Option.Option<{
355
- readonly containerId: string;
356
- readonly index: number;
357
- }>;
358
- } | {
359
- readonly _tag: "KeyboardDragging";
360
- readonly itemId: string;
361
- readonly sourceContainerId: string;
362
- readonly sourceIndex: number;
363
- readonly targetContainerId: string;
364
- readonly targetIndex: number;
365
- };
366
- }, {
367
- readonly _tag: "CancelledDrag";
368
- } | {
369
- readonly _tag: "PressedDraggable";
370
- readonly itemId: string;
371
- readonly containerId: string;
372
- readonly index: number;
373
- readonly screenX: number;
374
- readonly screenY: number;
375
- } | {
376
- readonly _tag: "MovedPointer";
377
- readonly screenX: number;
378
- readonly screenY: number;
379
- readonly clientX: number;
380
- readonly clientY: number;
381
- readonly maybeDropTarget: Option.Option<{
382
- readonly containerId: string;
383
- readonly index: number;
384
- }>;
385
- } | {
386
- readonly _tag: "ReleasedPointer";
387
- } | {
388
- readonly _tag: "ActivatedKeyboardDrag";
389
- readonly itemId: string;
390
- readonly containerId: string;
391
- readonly index: number;
392
- } | {
393
- readonly _tag: "ResolvedKeyboardMove";
394
- readonly targetContainerId: string;
395
- readonly targetIndex: number;
396
- } | {
397
- readonly _tag: "ConfirmedKeyboardDrop";
398
- } | {
399
- readonly _tag: "PressedArrowKey";
400
- readonly direction: "Left" | "Right" | "Up" | "Down" | "NextContainer" | "PreviousContainer";
401
- } | {
402
- readonly _tag: "AdvancedAutoScrollFrame";
403
- } | {
404
- readonly _tag: "CompletedFocusItem";
405
- }, {
406
- readonly dragActivity: "Idle" | "Active";
407
- }, never> & {
408
- readonly __subscription: never;
409
- };
410
- readonly autoScroll: {
411
- readonly dependenciesSchema: S.Schema<{
412
- readonly isDragging: boolean;
413
- readonly clientY: number;
414
- }> & {
415
- readonly fields: S.Struct.Fields;
416
- };
417
- readonly modelToDependencies: (model: {
418
- readonly id: string;
419
- readonly orientation: "Vertical" | "Horizontal";
420
- readonly activationThreshold: number;
421
- readonly dragState: {
422
- readonly _tag: "Idle";
423
- } | {
424
- readonly _tag: "Pending";
425
- readonly itemId: string;
426
- readonly containerId: string;
427
- readonly index: number;
428
- readonly origin: {
429
- readonly screenX: number;
430
- readonly screenY: number;
431
- };
432
- } | {
433
- readonly _tag: "Dragging";
434
- readonly itemId: string;
435
- readonly sourceContainerId: string;
436
- readonly sourceIndex: number;
437
- readonly origin: {
438
- readonly screenX: number;
439
- readonly screenY: number;
440
- };
441
- readonly current: {
442
- readonly clientX: number;
443
- readonly clientY: number;
444
- };
445
- readonly maybeDropTarget: Option.Option<{
446
- readonly containerId: string;
447
- readonly index: number;
448
- }>;
449
- } | {
450
- readonly _tag: "KeyboardDragging";
451
- readonly itemId: string;
452
- readonly sourceContainerId: string;
453
- readonly sourceIndex: number;
454
- readonly targetContainerId: string;
455
- readonly targetIndex: number;
456
- };
457
- }) => {
458
- readonly isDragging: boolean;
459
- readonly clientY: number;
460
- };
461
- readonly keepAliveEquivalence: Equivalence.Equivalence<{
462
- readonly isDragging: boolean;
463
- readonly clientY: number;
464
- }>;
465
- readonly dependenciesToStream: (dependencies: {
466
- readonly isDragging: boolean;
467
- readonly clientY: number;
468
- }, readDependencies: () => {
469
- readonly isDragging: boolean;
470
- readonly clientY: number;
471
- }) => Stream.Stream<{
472
- readonly _tag: "CancelledDrag";
473
- } | {
474
- readonly _tag: "PressedDraggable";
475
- readonly itemId: string;
476
- readonly containerId: string;
477
- readonly index: number;
478
- readonly screenX: number;
479
- readonly screenY: number;
480
- } | {
481
- readonly _tag: "MovedPointer";
482
- readonly screenX: number;
483
- readonly screenY: number;
484
- readonly clientX: number;
485
- readonly clientY: number;
486
- readonly maybeDropTarget: Option.Option<{
487
- readonly containerId: string;
488
- readonly index: number;
489
- }>;
490
- } | {
491
- readonly _tag: "ReleasedPointer";
492
- } | {
493
- readonly _tag: "ActivatedKeyboardDrag";
494
- readonly itemId: string;
495
- readonly containerId: string;
496
- readonly index: number;
497
- } | {
498
- readonly _tag: "ResolvedKeyboardMove";
499
- readonly targetContainerId: string;
500
- readonly targetIndex: number;
501
- } | {
502
- readonly _tag: "ConfirmedKeyboardDrop";
503
- } | {
504
- readonly _tag: "PressedArrowKey";
505
- readonly direction: "Left" | "Right" | "Up" | "Down" | "NextContainer" | "PreviousContainer";
506
- } | {
507
- readonly _tag: "AdvancedAutoScrollFrame";
508
- } | {
509
- readonly _tag: "CompletedFocusItem";
510
- }, never, never>;
511
- } & {
512
- readonly __subscription: never;
513
- };
514
- };
515
- /** Messages the draggable view helper can dispatch. */
516
- export type DraggableMessage = typeof PressedDraggable.Type | typeof ActivatedKeyboardDrag.Type;
517
- /** Configuration for creating draggable attributes with `draggable`. */
518
- export type DraggableConfig<ParentMessage> = Readonly<{
519
- model: Model;
520
- toParentMessage: (message: DraggableMessage) => ParentMessage;
521
- itemId: string;
522
- containerId: string;
523
- index: number;
524
- }>;
525
- /** Returns attributes the parent attaches to a draggable element. Handles pointer-down, keyboard activation, and ARIA. */
526
- export declare const draggable: <ParentMessage>(config: DraggableConfig<ParentMessage>) => ReadonlyArray<Attribute<ParentMessage>>;
527
- /** Returns attributes the parent attaches to a droppable container element. */
528
- export declare const droppable: <ParentMessage>(containerId: string, label?: string) => ReadonlyArray<Attribute<ParentMessage>>;
529
- /** Returns attributes the parent attaches to a sortable item element. Typically combined with `draggable`. */
530
- export declare const sortable: <ParentMessage>(itemId: string) => ReadonlyArray<Attribute<ParentMessage>>;
531
- /** Returns positioning styles for the ghost element, or None when not dragging with a pointer. */
532
- export declare const ghostStyle: (model: Model) => Option.Option<Record<string, string>>;
533
- /** Returns true when the component is actively dragging (pointer or keyboard). */
534
- export declare const isDragging: ({ dragState: { _tag } }: Model) => boolean;
535
- /** Returns the ID of the item currently being dragged or pending, if any. */
536
- export declare const maybeDraggedItemId: (model: Model) => Option.Option<string>;
537
- /** Returns the current drop target, if any. Populated during pointer drag (from collision detection) and keyboard drag (from resolved position). */
538
- export declare const maybeDropTarget: (model: Model) => Option.Option<typeof DropTarget.Type>;
539
- export {};
540
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/ui/dragAndDrop/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,MAAM,EAEN,WAAW,EAEX,MAAM,EAEN,MAAM,IAAI,CAAC,EACX,MAAM,EAEP,MAAM,QAAQ,CAAA;AAEf,OAAO,KAAK,OAA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