v-float 0.7.1 → 0.8.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 (52) hide show
  1. package/LICENSE +20 -20
  2. package/README.md +223 -204
  3. package/dist/composables/index.d.ts +1 -3
  4. package/dist/composables/index.d.ts.map +1 -1
  5. package/dist/composables/interactions/index.d.ts +0 -2
  6. package/dist/composables/interactions/index.d.ts.map +1 -1
  7. package/dist/composables/interactions/polygon.d.ts +2 -2
  8. package/dist/composables/interactions/polygon.d.ts.map +1 -1
  9. package/dist/composables/interactions/use-click.d.ts +2 -2
  10. package/dist/composables/interactions/use-click.d.ts.map +1 -1
  11. package/dist/composables/interactions/use-escape-key.d.ts +2 -2
  12. package/dist/composables/interactions/use-escape-key.d.ts.map +1 -1
  13. package/dist/composables/interactions/use-focus.d.ts +30 -25
  14. package/dist/composables/interactions/use-focus.d.ts.map +1 -1
  15. package/dist/composables/interactions/use-hover.d.ts +2 -2
  16. package/dist/composables/interactions/use-hover.d.ts.map +1 -1
  17. package/dist/composables/middlewares/arrow.d.ts +1 -2
  18. package/dist/composables/middlewares/arrow.d.ts.map +1 -1
  19. package/dist/composables/middlewares/index.d.ts +3 -1
  20. package/dist/composables/middlewares/index.d.ts.map +1 -1
  21. package/dist/composables/positioning/index.d.ts +5 -0
  22. package/dist/composables/positioning/index.d.ts.map +1 -0
  23. package/dist/composables/positioning/use-arrow.d.ts.map +1 -0
  24. package/dist/composables/{interactions → positioning}/use-client-point.d.ts +2 -2
  25. package/dist/composables/positioning/use-client-point.d.ts.map +1 -0
  26. package/dist/composables/positioning/use-floating-tree.d.ts +240 -0
  27. package/dist/composables/positioning/use-floating-tree.d.ts.map +1 -0
  28. package/dist/composables/{use-floating.d.ts → positioning/use-floating.d.ts} +19 -10
  29. package/dist/composables/positioning/use-floating.d.ts.map +1 -0
  30. package/dist/types.d.ts +15 -0
  31. package/dist/types.d.ts.map +1 -1
  32. package/dist/utils.d.ts +84 -7
  33. package/dist/utils.d.ts.map +1 -1
  34. package/dist/v-float.es.js +1732 -1620
  35. package/dist/v-float.umd.js +1 -1
  36. package/package.json +73 -76
  37. package/dist/composables/interactions/use-client-point.d.ts.map +0 -1
  38. package/dist/composables/interactions/utils/browser-detection.d.ts +0 -23
  39. package/dist/composables/interactions/utils/browser-detection.d.ts.map +0 -1
  40. package/dist/composables/interactions/utils/element-detection.d.ts +0 -53
  41. package/dist/composables/interactions/utils/element-detection.d.ts.map +0 -1
  42. package/dist/composables/interactions/utils/event-utils.d.ts +0 -30
  43. package/dist/composables/interactions/utils/event-utils.d.ts.map +0 -1
  44. package/dist/composables/interactions/utils/index.d.ts +0 -11
  45. package/dist/composables/interactions/utils/index.d.ts.map +0 -1
  46. package/dist/composables/interactions/utils/tree-context.d.ts +0 -32
  47. package/dist/composables/interactions/utils/tree-context.d.ts.map +0 -1
  48. package/dist/composables/use-arrow.d.ts.map +0 -1
  49. package/dist/composables/use-floating-tree.d.ts +0 -110
  50. package/dist/composables/use-floating-tree.d.ts.map +0 -1
  51. package/dist/composables/use-floating.d.ts.map +0 -1
  52. /package/dist/composables/{use-arrow.d.ts → positioning/use-arrow.d.ts} +0 -0
package/LICENSE CHANGED
@@ -1,21 +1,21 @@
1
- MIT License
2
-
3
- Copyright (c) 2025 V-Float
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
1
+ MIT License
2
+
3
+ Copyright (c) 2025 V-Float
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
21
  SOFTWARE.
package/README.md CHANGED
@@ -1,4 +1,8 @@
1
- # V-Float
1
+ # V-Float
2
+
3
+ [![status: WIP](https://img.shields.io/badge/status-WIP-orange.svg)](#project-status)
4
+
5
+ > Work in progress: This library is under active development. APIs may change without notice and breaking changes can land without deprecation windows or warnings. Not recommended for production use yet.
2
6
 
3
7
  A Vue 3 library for positioning floating UI elements like tooltips, popovers, dropdowns, and modals. Built on top
4
8
  of [VFloat](https://vfloat.pages.com/) with Vue 3 Composition API.
@@ -9,7 +13,7 @@ of [VFloat](https://vfloat.pages.com/) with Vue 3 Composition API.
9
13
  - **Vue 3 Composables**: Reactive composables designed for the Composition API
10
14
  - **Interaction Handling**: Built-in hover, focus, click, and dismiss behaviors
11
15
  - **Nested Elements**: Support for floating element trees and hierarchies
12
- - **Ready-to-use Components**: Pre-built components like `FloatingArrow`
16
+ - **Arrow Positioning**: `useArrow` composable for positioning arrow elements
13
17
  - **Lightweight**: Tree-shakable with minimal bundle impact
14
18
  - **Cross-platform**: Works on desktop, mobile, and touch devices
15
19
  - **TypeScript**: Full TypeScript support with comprehensive type definitions
@@ -123,205 +127,220 @@ const { arrowStyles } = useArrow(arrowEl, context, {
123
127
  >
124
128
  This is a tooltip with an arrow
125
129
  <div ref="arrowEl" class="arrow" :style="arrowStyles"></div>
126
- </div>
127
- </template>
128
-
129
- <style scoped>
130
- .tooltip {
131
- background: white;
132
- border: 1px solid #ddd;
133
- border-radius: 4px;
134
- padding: 8px 12px;
135
- box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
136
- }
137
-
138
- .arrow {
139
- position: absolute;
140
- width: 8px;
141
- height: 8px;
142
- background: white;
143
- border: 1px solid #ddd;
144
- transform: rotate(45deg);
145
- z-index: -1;
146
- }
147
- </style>
148
- ```
149
-
150
- ## Core Composables
151
-
152
- ### Positioning
153
-
154
- - **`useFloating`**: Core positioning logic with middleware support
155
- - **`useArrow`**: Position arrow elements pointing to the anchor
156
- - **`useFloatingTree`**: Manage nested floating element hierarchies
157
-
158
- ### Interactions
159
-
160
- - **`useHover`**: Hover interactions with configurable delays
161
- - **`useFocus`**: Focus/blur event handling for keyboard navigation
162
- - **`useClick`**: Click event handling with toggle and dismiss options
163
- - **`useEscapeKey`**: Close on ESC key press with composition handling
164
- - **`useClientPoint`**: Position floating elements at cursor/touch coordinates
165
-
166
- ### Middleware
167
-
168
- All [Floating UI middleware](https://floating-ui.com/docs/middleware) are supported:
169
-
170
- - **`offset`**: Add distance between anchor and floating element
171
- - **`flip`**: Flip placement when there's insufficient space
172
- - **`shift`**: Shift floating element to stay in view
173
- - **`hide`**: Hide floating element when anchor is not visible
174
-
175
- **Arrow positioning** is handled by the [`useArrow`](/api/use-arrow) composable, which automatically registers the necessary middleware.
176
-
177
- ## Advanced Features
178
-
179
- ### Floating Trees
180
-
181
- For nested floating elements like submenus, use `useFloatingTree` to manage hierarchical structures with a streamlined API that eliminates redundant `useFloating` calls.
182
-
183
- **Clear Separation of Concerns:**
184
-
185
- - Use `useFloating` for isolated floating elements
186
- - Use `useFloatingTree` for hierarchical structures
187
-
188
- Here's how you can set up a parent menu with a submenu using the new API:
189
-
190
- ```vue
191
- <script setup lang="ts">
192
- import { useTemplateRef, ref } from "vue"
193
- import { useFloatingTree, useHover, useClick, offset, flip, shift } from "v-float"
194
-
195
- const parentTriggerEl = useTemplateRef("parentTriggerRef")
196
- const parentMenuEl = useTemplateRef("parentMenuRef")
197
- const isParentOpen = ref(false)
198
-
199
- const submenuTriggerEl = useTemplateRef("submenuTriggerRef")
200
- const submenuEl = useTemplateRef("submenuRef")
201
- const isSubmenuOpen = ref(false)
202
-
203
- // 1. Create the floating tree with root context automatically
204
- const tree = useFloatingTree(parentTriggerEl, parentMenuEl, {
205
- placement: "bottom-start",
206
- open: isParentOpen,
207
- middlewares: [offset(4), flip(), shift({ padding: 8 })],
208
- })
209
-
210
- // 2. Add submenu node - no separate useFloating call needed!
211
- const submenuNode = tree.addNode(submenuTriggerEl, submenuEl, {
212
- placement: "right-start",
213
- open: isSubmenuOpen,
214
- middlewares: [offset(4), flip(), shift({ padding: 8 })],
215
- parentId: tree.root.id, // Link to parent using parentId in options
216
- })
217
-
218
- // 3. Add interactions
219
- useClick(tree.root, { outsideClick: true })
220
- useHover(submenuNode, { delay: { open: 100, close: 300 } })
221
-
222
- // Access floating styles from the contexts
223
- const { floatingStyles: parentStyles } = tree.rootContext
224
- const { floatingStyles: submenuStyles } = submenuNode.data
225
- </script>
226
-
227
- <template>
228
- <!-- Parent Menu Trigger -->
229
- <button ref="parentTriggerEl" @click="isParentOpen = !isParentOpen">Open Menu</button>
230
-
231
- <!-- Parent Menu -->
232
- <div v-if="isParentOpen" ref="parentMenuEl" :style="parentStyles" class="menu">
233
- <div class="menu-item">Menu Item 1</div>
234
-
235
- <!-- Submenu Trigger -->
236
- <div
237
- ref="submenuTriggerEl"
238
- class="menu-item menu-item--submenu"
239
- @click="isSubmenuOpen = !isSubmenuOpen"
240
- >
241
- Menu Item 2 (Has Submenu)
242
-
243
- <!-- Submenu -->
244
- <div v-if="isSubmenuOpen" ref="submenuEl" :style="submenuStyles" class="menu submenu">
245
- <div class="menu-item">Submenu Item A</div>
246
- <div class="menu-item">Submenu Item B</div>
247
- <div class="menu-item">Submenu Item C</div>
248
- </div>
249
- </div>
250
-
251
- <div class="menu-item">Menu Item 3</div>
252
- </div>
253
- </template>
254
-
255
- <style scoped>
256
- .menu {
257
- background: white;
258
- border: 1px solid #ddd;
259
- border-radius: 4px;
260
- padding: 4px 0;
261
- box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
262
- min-width: 160px;
263
- z-index: 1000;
264
- }
265
-
266
- .submenu {
267
- margin-left: 8px;
268
- z-index: 1010;
269
- }
270
-
271
- .menu-item {
272
- padding: 8px 12px;
273
- cursor: pointer;
274
- user-select: none;
275
- }
276
-
277
- .menu-item:hover {
278
- background-color: #f5f5f5;
279
- }
280
-
281
- .menu-item--submenu {
282
- position: relative;
283
- }
284
- </style>
285
- ```
286
-
287
- **API Benefits:**
288
-
289
- ```ts
290
- // Before: Required separate useFloating calls
291
- const parentContext = useFloating(parentEl, parentFloating, options)
292
- const tree = useFloatingTree(parentContext)
293
- const childContext = useFloating(childEl, childFloating, childOptions)
294
- const childNode = tree.addNode(childContext, parentContext.nodeId)
295
-
296
- // After: Streamlined API with internal context creation
297
- const tree = useFloatingTree(parentEl, parentFloating, options)
298
- const childNode = tree.addNode(childEl, childFloating, {
299
- ...childOptions,
300
- parentId: tree.root.id,
301
- })
302
- ```
303
-
304
- This approach eliminates redundant calls and provides a clearer separation between isolated floating elements (`useFloating`) and hierarchical structures (`useFloatingTree`).
305
-
306
- ## TypeScript Support
307
-
308
- V-Float is built with TypeScript and provides comprehensive type definitions:
309
-
310
- ## Browser Support
311
-
312
- - **Modern browsers**: Chrome, Firefox, Safari, Edge
313
- - **Mobile browsers**: iOS Safari, Chrome Mobile, Samsung Internet
314
- - **Node.js**: SSR compatible (with proper hydration)
315
-
316
- ## Documentation
317
-
318
- For complete documentation with interactive examples, visit the [V-Float Documentation](https://vfloat.pages.dev/).
319
-
320
- ## Contributing
321
-
322
- Contributions are welcome! Please read our contributing guidelines and submit pull requests to
323
- our [GitHub repository](https://github.com/sherif414/VFloat).
324
-
325
- ## License
326
-
327
- MIT License - see [LICENSE](LICENSE) file for details.
130
+ </div>
131
+ </template>
132
+
133
+ <style scoped>
134
+ .tooltip {
135
+ background: white;
136
+ border: 1px solid #ddd;
137
+ border-radius: 4px;
138
+ padding: 8px 12px;
139
+ box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
140
+ }
141
+
142
+ .arrow {
143
+ position: absolute;
144
+ width: 8px;
145
+ height: 8px;
146
+ background: white;
147
+ border: 1px solid #ddd;
148
+ transform: rotate(45deg);
149
+ z-index: -1;
150
+ }
151
+ </style>
152
+ ```
153
+
154
+ ## Core Composables
155
+
156
+ ### Positioning
157
+
158
+ - **`useFloating`**: Core positioning logic with middleware support
159
+ - **`useArrow`**: Position arrow elements pointing to the anchor
160
+ - **`useFloatingTree`**: Manage nested floating element hierarchies
161
+
162
+ ### Interactions
163
+
164
+ - **`useHover`**: Hover interactions with configurable delays
165
+ - **`useFocus`**: Focus/blur event handling for keyboard navigation
166
+ - **`useClick`**: Click event handling with toggle and dismiss options
167
+ - **`useEscapeKey`**: Close on ESC key press with composition handling
168
+ - **`useClientPoint`**: Position floating elements at cursor/touch coordinates
169
+
170
+ ### Middleware
171
+
172
+ All [Floating UI middleware](https://floating-ui.com/docs/middleware) are supported:
173
+
174
+ - **`offset`**: Add distance between anchor and floating element
175
+ - **`flip`**: Flip placement when there's insufficient space
176
+ - **`shift`**: Shift floating element to stay in view
177
+ - **`hide`**: Hide floating element when anchor is not visible
178
+ - **`autoPlacement`**: Automatically choose the best placement
179
+ - **`size`**: Resize floating element to fit within viewport
180
+
181
+ **Arrow positioning** is handled by the [`useArrow`](/api/use-arrow) composable, which automatically registers the necessary middleware.
182
+
183
+ ## Project Status
184
+
185
+ - WIP and evolving rapidly; expect breaking changes without deprecations.
186
+ - API, docs, and examples are subject to change and may be incomplete.
187
+ - Feedback and contributions are welcome while the API stabilizes.
188
+
189
+ ## Advanced Features
190
+
191
+ ### Floating Trees
192
+
193
+ For nested floating elements like submenus, use `useFloatingTree` to manage hierarchical structures with a streamlined API that eliminates redundant `useFloating` calls.
194
+
195
+ **Clear Separation of Concerns:**
196
+
197
+ - Use `useFloating` for isolated floating elements
198
+ - Use `useFloatingTree` for hierarchical structures
199
+
200
+ Here's how you can set up a parent menu with a submenu using the new API:
201
+
202
+ ```vue
203
+ <script setup lang="ts">
204
+ import { useTemplateRef, ref } from "vue"
205
+ import { useFloatingTree, useHover, useClick, offset, flip, shift } from "v-float"
206
+
207
+ const parentTriggerEl = useTemplateRef("parentTriggerRef")
208
+ const parentMenuEl = useTemplateRef("parentMenuRef")
209
+ const isParentOpen = ref(false)
210
+
211
+ const submenuTriggerEl = useTemplateRef("submenuTriggerRef")
212
+ const submenuEl = useTemplateRef("submenuRef")
213
+ const isSubmenuOpen = ref(false)
214
+
215
+ // 1. Create the floating tree with root context automatically
216
+ const tree = useFloatingTree(parentTriggerEl, parentMenuEl, {
217
+ placement: "bottom-start",
218
+ open: isParentOpen,
219
+ middlewares: [offset(4), flip(), shift({ padding: 8 })],
220
+ })
221
+
222
+ // 2. Add submenu node - no separate useFloating call needed!
223
+ const submenuNode = tree.addNode(submenuTriggerEl, submenuEl, {
224
+ placement: "right-start",
225
+ open: isSubmenuOpen,
226
+ middlewares: [offset(4), flip(), shift({ padding: 8 })],
227
+ parentId: tree.root.id, // Link to parent using parentId in options
228
+ })
229
+
230
+ // 3. Add interactions
231
+ useClick(tree.root, { outsideClick: true })
232
+ useHover(submenuNode, { delay: { open: 100, close: 300 } })
233
+
234
+ // Access floating styles from the contexts
235
+ const { floatingStyles: parentStyles } = tree.rootContext
236
+ const { floatingStyles: submenuStyles } = submenuNode.data
237
+ </script>
238
+
239
+ <template>
240
+ <!-- Parent Menu Trigger -->
241
+ <button ref="parentTriggerEl" @click="isParentOpen = !isParentOpen">Open Menu</button>
242
+
243
+ <!-- Parent Menu -->
244
+ <div v-if="isParentOpen" ref="parentMenuEl" :style="parentStyles" class="menu">
245
+ <div class="menu-item">Menu Item 1</div>
246
+
247
+ <!-- Submenu Trigger -->
248
+ <div
249
+ ref="submenuTriggerEl"
250
+ class="menu-item menu-item--submenu"
251
+ @click="isSubmenuOpen = !isSubmenuOpen"
252
+ >
253
+ Menu Item 2 (Has Submenu)
254
+
255
+ <!-- Submenu -->
256
+ <div v-if="isSubmenuOpen" ref="submenuEl" :style="submenuStyles" class="menu submenu">
257
+ <div class="menu-item">Submenu Item A</div>
258
+ <div class="menu-item">Submenu Item B</div>
259
+ <div class="menu-item">Submenu Item C</div>
260
+ </div>
261
+ </div>
262
+
263
+ <div class="menu-item">Menu Item 3</div>
264
+ </div>
265
+ </template>
266
+
267
+ <style scoped>
268
+ .menu {
269
+ background: white;
270
+ border: 1px solid #ddd;
271
+ border-radius: 4px;
272
+ padding: 4px 0;
273
+ box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
274
+ min-width: 160px;
275
+ z-index: 1000;
276
+ }
277
+
278
+ .submenu {
279
+ margin-left: 8px;
280
+ z-index: 1010;
281
+ }
282
+
283
+ .menu-item {
284
+ padding: 8px 12px;
285
+ cursor: pointer;
286
+ user-select: none;
287
+ }
288
+
289
+ .menu-item:hover {
290
+ background-color: #f5f5f5;
291
+ }
292
+
293
+ .menu-item--submenu {
294
+ position: relative;
295
+ }
296
+ </style>
297
+ ```
298
+
299
+ **API Benefits:**
300
+
301
+ ```ts
302
+ // Before: Required separate useFloating calls
303
+ const parentContext = useFloating(parentEl, parentFloating, options)
304
+ const tree = useFloatingTree(parentContext)
305
+ const childContext = useFloating(childEl, childFloating, childOptions)
306
+ const childNode = tree.addNode(childContext, parentContext.nodeId)
307
+
308
+ // After: Streamlined API with internal context creation
309
+ const tree = useFloatingTree(parentEl, parentFloating, options)
310
+ const childNode = tree.addNode(childEl, childFloating, {
311
+ ...childOptions,
312
+ parentId: tree.root.id,
313
+ })
314
+ ```
315
+
316
+ This approach eliminates redundant calls and provides a clearer separation between isolated floating elements (`useFloating`) and hierarchical structures (`useFloatingTree`).
317
+
318
+ ## TypeScript Support
319
+
320
+ V-Float is built with TypeScript and provides comprehensive type definitions:
321
+
322
+ ## Browser Support
323
+
324
+ - **Modern browsers**: Chrome, Firefox, Safari, Edge
325
+ - **Mobile browsers**: iOS Safari, Chrome Mobile, Samsung Internet
326
+ - **Node.js**: SSR compatible (with proper hydration)
327
+
328
+ ## Documentation
329
+
330
+ For complete documentation with interactive examples, visit the [V-Float Documentation](https://vfloat.pages.dev/).
331
+
332
+ ## Contributing
333
+
334
+ Contributions are welcome! Please read our contributing guidelines and submit pull requests to
335
+ our [GitHub repository](https://github.com/sherif414/VFloat).
336
+
337
+ ## Credits
338
+
339
+ V-Float is built on top of the excellent work of:
340
+
341
+ - [Floating UI](https://floating-ui.com/) - For the core positioning and collision detection algorithms
342
+ - [VueUse](https://vueuse.org/) - For Vue composition utilities and best practices
343
+
344
+ ## License
345
+
346
+ MIT License - see [LICENSE](LICENSE) file for details.
@@ -1,6 +1,4 @@
1
+ export * from './positioning';
1
2
  export * from './interactions';
2
3
  export * from './middlewares';
3
- export * from './use-arrow';
4
- export * from './use-floating';
5
- export * from './use-floating-tree';
6
4
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/composables/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAA;AAC9B,cAAc,eAAe,CAAA;AAC7B,cAAc,aAAa,CAAA;AAC3B,cAAc,gBAAgB,CAAA;AAC9B,cAAc,qBAAqB,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/composables/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAA;AAC7B,cAAc,gBAAgB,CAAA;AAC9B,cAAc,eAAe,CAAA"}
@@ -1,7 +1,5 @@
1
1
  export * from './use-click';
2
- export { type AxisConstraint, type Coordinates, type TrackingMode, type UseClientPointContext, type UseClientPointOptions, type UseClientPointReturn, useClientPoint, } from './use-client-point';
3
2
  export * from './use-escape-key';
4
3
  export * from './use-focus';
5
4
  export * from './use-hover';
6
- export * from './utils';
7
5
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/composables/interactions/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAA;AAC3B,OAAO,EACL,KAAK,cAAc,EACnB,KAAK,WAAW,EAChB,KAAK,YAAY,EACjB,KAAK,qBAAqB,EAC1B,KAAK,qBAAqB,EAC1B,KAAK,oBAAoB,EACzB,cAAc,GACf,MAAM,oBAAoB,CAAA;AAC3B,cAAc,kBAAkB,CAAA;AAChC,cAAc,aAAa,CAAA;AAC3B,cAAc,aAAa,CAAA;AAC3B,cAAc,SAAS,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/composables/interactions/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAA;AAC3B,cAAc,kBAAkB,CAAA;AAChC,cAAc,aAAa,CAAA;AAC3B,cAAc,aAAa,CAAA"}
@@ -1,5 +1,5 @@
1
- import { TreeNode } from '../use-floating-tree';
2
- import { AnchorElement, FloatingContext, FloatingElement } from '../use-floating';
1
+ import { TreeNode } from '../positioning/use-floating-tree';
2
+ import { AnchorElement, FloatingContext, FloatingElement } from '../positioning/use-floating';
3
3
  type Point = [number, number];
4
4
  type Polygon = Point[];
5
5
  export interface SafePolygonOptions {
@@ -1 +1 @@
1
- {"version":3,"file":"polygon.d.ts","sourceRoot":"","sources":["../../../src/composables/interactions/polygon.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,iCAAiC,CAAA;AAE/D,OAAO,KAAK,EAAE,aAAa,EAAE,eAAe,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAA;AAGtF,KAAK,KAAK,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;AAC7B,KAAK,OAAO,GAAG,KAAK,EAAE,CAAA;AAoDtB,MAAM,WAAW,kBAAkB;IACjC,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,kBAAkB,CAAC,EAAE,OAAO,CAAA;IAC5B,aAAa,CAAC,EAAE,OAAO,CAAA;IACvB,eAAe,CAAC,EAAE,CAAC,OAAO,EAAE,OAAO,KAAK,IAAI,CAAA;CAC7C;AAED,MAAM,WAAW,+BAA+B;IAC9C,CAAC,EAAE,MAAM,CAAA;IACT,CAAC,EAAE,MAAM,CAAA;IACT,SAAS,EAAE,eAAe,CAAC,WAAW,CAAC,CAAC,OAAO,CAAC,CAAA;IAChD,QAAQ,EAAE;QACR,YAAY,EAAE,aAAa,GAAG,IAAI,CAAA;QAClC,QAAQ,EAAE,eAAe,GAAG,IAAI,CAAA;KACjC,CAAA;IACD,MAAM,EAAE,MAAM,CAAA;IACd,OAAO,EAAE,MAAM,IAAI,CAAA;IACnB,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,IAAI,CAAC,EAAE;QAAE,KAAK,EAAE,GAAG,CAAC,MAAM,EAAE,QAAQ,CAAC,eAAe,CAAC,CAAC,CAAA;KAAE,CAAA;CACzD;AAED;;;;GAIG;AACH,wBAAgB,WAAW,CAAC,OAAO,GAAE,kBAAuB;cAsCJ,+BAA+B,WAehD,UAAU;;;;EAiVhD"}
1
+ {"version":3,"file":"polygon.d.ts","sourceRoot":"","sources":["../../../src/composables/interactions/polygon.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,6CAA6C,CAAA;AAE3E,OAAO,KAAK,EAAE,aAAa,EAAE,eAAe,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAA;AAGlG,KAAK,KAAK,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;AAC7B,KAAK,OAAO,GAAG,KAAK,EAAE,CAAA;AAoDtB,MAAM,WAAW,kBAAkB;IACjC,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,kBAAkB,CAAC,EAAE,OAAO,CAAA;IAC5B,aAAa,CAAC,EAAE,OAAO,CAAA;IACvB,eAAe,CAAC,EAAE,CAAC,OAAO,EAAE,OAAO,KAAK,IAAI,CAAA;CAC7C;AAED,MAAM,WAAW,+BAA+B;IAC9C,CAAC,EAAE,MAAM,CAAA;IACT,CAAC,EAAE,MAAM,CAAA;IACT,SAAS,EAAE,eAAe,CAAC,WAAW,CAAC,CAAC,OAAO,CAAC,CAAA;IAChD,QAAQ,EAAE;QACR,YAAY,EAAE,aAAa,GAAG,IAAI,CAAA;QAClC,QAAQ,EAAE,eAAe,GAAG,IAAI,CAAA;KACjC,CAAA;IACD,MAAM,EAAE,MAAM,CAAA;IACd,OAAO,EAAE,MAAM,IAAI,CAAA;IACnB,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,IAAI,CAAC,EAAE;QAAE,KAAK,EAAE,GAAG,CAAC,MAAM,EAAE,QAAQ,CAAC,eAAe,CAAC,CAAC,CAAA;KAAE,CAAA;CACzD;AAED;;;;GAIG;AACH,wBAAgB,WAAW,CAAC,OAAO,GAAE,kBAAuB;cAsCJ,+BAA+B,WAehD,UAAU;;;;EAiVhD"}
@@ -1,6 +1,6 @@
1
1
  import { MaybeRefOrGetter } from 'vue';
2
- import { FloatingContext } from '..';
3
- import { TreeNode } from '../use-floating-tree';
2
+ import { FloatingContext } from '../positioning/use-floating';
3
+ import { TreeNode } from '../positioning/use-floating-tree';
4
4
  /**
5
5
  * Enables showing/hiding the floating element when clicking the reference element
6
6
  * and optionally when clicking outside both the reference and floating elements.
@@ -1 +1 @@
1
- {"version":3,"file":"use-click.d.ts","sourceRoot":"","sources":["../../../src/composables/interactions/use-click.ts"],"names":[],"mappings":"AAEA,OAAO,EAAY,KAAK,gBAAgB,EAA8C,MAAM,KAAK,CAAA;AACjG,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,eAAe,CAAA;AACpD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,iCAAiC,CAAA;AAiB/D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6CG;AACH,wBAAgB,QAAQ,CACtB,OAAO,EAAE,eAAe,GAAG,QAAQ,CAAC,eAAe,CAAC,EACpD,OAAO,GAAE,eAAoB,GAC5B,IAAI,CA6PN;AA0CD;;GAEG;AACH,MAAM,WAAW,eAAe;IAG9B;;;OAGG;IACH,OAAO,CAAC,EAAE,gBAAgB,CAAC,OAAO,CAAC,CAAA;IAEnC;;;;OAIG;IACH,KAAK,CAAC,EAAE,gBAAgB,CAAC,OAAO,GAAG,WAAW,CAAC,CAAA;IAE/C;;;OAGG;IACH,MAAM,CAAC,EAAE,gBAAgB,CAAC,OAAO,CAAC,CAAA;IAElC;;;OAGG;IACH,WAAW,CAAC,EAAE,gBAAgB,CAAC,OAAO,CAAC,CAAA;IAEvC;;;OAGG;IACH,cAAc,CAAC,EAAE,gBAAgB,CAAC,OAAO,CAAC,CAAA;IAE1C;;;OAGG;IACH,WAAW,CAAC,EAAE,gBAAgB,CAAC,OAAO,CAAC,CAAA;IAIvC;;;OAGG;IACH,YAAY,CAAC,EAAE,gBAAgB,CAAC,OAAO,CAAC,CAAA;IAExC;;;OAGG;IACH,YAAY,CAAC,EAAE,gBAAgB,CAAC,aAAa,GAAG,WAAW,GAAG,OAAO,CAAC,CAAA;IAEtE;;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O,CAAC,CAAA;IAIvC;;;OAGG;IACH,YAAY,CAAC,EAAE,gBAAgB,CAAC,OAAO,CAAC,CAAA;IAExC;;;OAGG;IACH,YAAY,CAAC,EAAE,gBAAgB,CAAC,aAAa,GAAG,WAAW,GAAG,OAAO,CAAC,CAAA;IAEtE;;;OAGG;IACH,cAAc,CAAC,EAAE,gBAAgB,CAAC,OAAO,CAAC,CAAA;IAE1C;;;;;;OAMG;IACH,cAAc,CAAC,EAAE,CAAC,KAAK,EAAE,UAAU,EAAE,OAAO,EAAE,eAAe,KAAK,IAAI,CAAA;IAEtE;;;OAGG;IACH,qBAAqB,CAAC,EAAE,gBAAgB,CAAC,OAAO,CAAC,CAAA;IAEjD;;;OAGG;IACH,gBAAgB,CAAC,EAAE,gBAAgB,CAAC,OAAO,CAAC,CAAA;CAC7C"}
@@ -1,6 +1,6 @@
1
1
  import { MaybeRefOrGetter } from 'vue';
2
- import { FloatingContext } from '..';
3
- import { TreeNode } from '../use-floating-tree';
2
+ import { FloatingContext } from '../positioning/use-floating';
3
+ import { TreeNode } from '../positioning/use-floating-tree';
4
4
  export interface UseEscapeKeyOptions {
5
5
  /**
6
6
  * Condition to enable the escape key listener.
@@ -1 +1 @@
1
- {"version":3,"file":"use-escape-key.d.ts","sourceRoot":"","sources":["../../../src/composables/interactions/use-escape-key.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,gBAAgB,EAAgB,MAAM,KAAK,CAAA;AACzD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,eAAe,CAAA;AACpD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,iCAAiC,CAAA;AAO/D,MAAM,WAAW,mBAAmB;IAClC;;;OAGG;IACH,OAAO,CAAC,EAAE,gBAAgB,CAAC,OAAO,CAAC,CAAA;IAEnC;;;OAGG;IACH,OAAO,CAAC,EAAE,OAAO,CAAA;IAEjB;;;OAGG;IACH,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,aAAa,KAAK,IAAI,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