tiny-essentials 1.11.0 → 1.12.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 (72) hide show
  1. package/README.md +12 -3
  2. package/dist/node_modules/firebase-functions/lib/common/trace.cjs +82 -0
  3. package/dist/node_modules/firebase-functions/lib/logger/common.cjs +57 -0
  4. package/dist/node_modules/firebase-functions/lib/logger/index.cjs +158 -0
  5. package/dist/v1/TinyBasicsEs.js +1653 -1
  6. package/dist/v1/TinyBasicsEs.min.js +1 -1
  7. package/dist/v1/TinyDragDropDetector.js +307 -0
  8. package/dist/v1/TinyDragDropDetector.min.js +1 -0
  9. package/dist/v1/TinyDragger.js +3563 -0
  10. package/dist/v1/TinyDragger.min.js +2 -0
  11. package/dist/v1/TinyDragger.min.js.LICENSE.txt +8 -0
  12. package/dist/v1/TinyEssentials.js +2783 -2
  13. package/dist/v1/TinyEssentials.min.js +1 -1
  14. package/dist/v1/TinyNotifyCenter.js +32 -0
  15. package/dist/v1/TinyNotifyCenter.min.js +1 -1
  16. package/dist/v1/TinyToastNotify.js +24 -0
  17. package/dist/v1/TinyToastNotify.min.js +1 -1
  18. package/dist/v1/TinyUploadClicker.js +5235 -0
  19. package/dist/v1/TinyUploadClicker.min.js +2 -0
  20. package/dist/v1/TinyUploadClicker.min.js.LICENSE.txt +8 -0
  21. package/dist/v1/basics/fileManager.cjs +524 -0
  22. package/dist/v1/basics/fileManager.d.mts +209 -0
  23. package/dist/v1/basics/fileManager.mjs +443 -0
  24. package/dist/v1/basics/fullScreen.cjs +134 -0
  25. package/dist/v1/basics/fullScreen.d.mts +8 -0
  26. package/dist/v1/basics/fullScreen.mjs +121 -0
  27. package/dist/v1/basics/html.cjs +262 -0
  28. package/dist/v1/basics/html.d.mts +63 -0
  29. package/dist/v1/basics/html.mjs +208 -0
  30. package/dist/v1/basics/index.cjs +40 -0
  31. package/dist/v1/basics/index.d.mts +38 -1
  32. package/dist/v1/basics/index.mjs +4 -1
  33. package/dist/v1/build/TinyDragDropDetector.cjs +7 -0
  34. package/dist/v1/build/TinyDragDropDetector.d.mts +3 -0
  35. package/dist/v1/build/TinyDragDropDetector.mjs +2 -0
  36. package/dist/v1/build/TinyDragger.cjs +7 -0
  37. package/dist/v1/build/TinyDragger.d.mts +3 -0
  38. package/dist/v1/build/TinyDragger.mjs +2 -0
  39. package/dist/v1/build/TinyUploadClicker.cjs +7 -0
  40. package/dist/v1/build/TinyUploadClicker.d.mts +3 -0
  41. package/dist/v1/build/TinyUploadClicker.mjs +2 -0
  42. package/dist/v1/css/TinyDraggerExample.css +21 -0
  43. package/dist/v1/css/TinyDraggerExample.min.css +1 -0
  44. package/dist/v1/index.cjs +44 -0
  45. package/dist/v1/index.d.mts +40 -1
  46. package/dist/v1/index.mjs +6 -1
  47. package/dist/v1/libs/TinyDragDropDetector.cjs +268 -0
  48. package/dist/v1/libs/TinyDragDropDetector.d.mts +123 -0
  49. package/dist/v1/libs/TinyDragDropDetector.mjs +228 -0
  50. package/dist/v1/libs/TinyDragger.cjs +801 -0
  51. package/dist/v1/libs/TinyDragger.d.mts +300 -0
  52. package/dist/v1/libs/TinyDragger.mjs +689 -0
  53. package/dist/v1/libs/TinyNotifyCenter.cjs +32 -0
  54. package/dist/v1/libs/TinyNotifyCenter.d.mts +9 -0
  55. package/dist/v1/libs/TinyNotifyCenter.mjs +28 -0
  56. package/dist/v1/libs/TinyToastNotify.cjs +24 -0
  57. package/dist/v1/libs/TinyToastNotify.d.mts +8 -0
  58. package/dist/v1/libs/TinyToastNotify.mjs +20 -0
  59. package/dist/v1/libs/TinyUploadClicker.cjs +223 -0
  60. package/dist/v1/libs/TinyUploadClicker.d.mts +80 -0
  61. package/dist/v1/libs/TinyUploadClicker.mjs +182 -0
  62. package/docs/v1/README.md +8 -2
  63. package/docs/v1/basics/fileManager.md +222 -0
  64. package/docs/v1/basics/fullScreen.md +183 -0
  65. package/docs/v1/basics/html.md +243 -0
  66. package/docs/v1/libs/TinyDragDropDetector.md +143 -0
  67. package/docs/v1/libs/TinyDragger.md +415 -0
  68. package/docs/v1/libs/TinyLevelUp.md +1 -1
  69. package/docs/v1/libs/TinyNotifyCenter.md +20 -0
  70. package/docs/v1/libs/TinyToastNotify.md +19 -0
  71. package/docs/v1/libs/TinyUploadClicker.md +108 -0
  72. package/package.json +12 -2
@@ -0,0 +1,300 @@
1
+ export default TinyDragger;
2
+ export type VibrationPatterns = {
3
+ /**
4
+ * - Pattern to vibrate on start
5
+ */
6
+ start: number[] | false;
7
+ /**
8
+ * - Pattern to vibrate on end
9
+ */
10
+ end: number[] | false;
11
+ /**
12
+ * - Pattern to vibrate on collision
13
+ */
14
+ collide: number[] | false;
15
+ /**
16
+ * - Pattern to vibrate while moving
17
+ */
18
+ move: number[] | false;
19
+ };
20
+ /**
21
+ * @typedef {Object} VibrationPatterns
22
+ * @property {number[]|false} start - Pattern to vibrate on start
23
+ * @property {number[]|false} end - Pattern to vibrate on end
24
+ * @property {number[]|false} collide - Pattern to vibrate on collision
25
+ * @property {number[]|false} move - Pattern to vibrate while moving
26
+ */
27
+ /**
28
+ * TinyDragger enables drag-and-drop functionality for a DOM element.
29
+ * It supports jail boundaries, optional collision detection, vibration feedback,
30
+ * automatic reverting, proxy dragging, and event dispatching.
31
+ */
32
+ declare class TinyDragger {
33
+ /** @typedef {(event: TouchEvent) => void} TouchDragEvent */
34
+ /**
35
+ * @param {HTMLElement} targetElement - The element to make draggable.
36
+ * @param {Object} [options={}] - Configuration options.
37
+ * @param {HTMLElement} [options.jail] - Optional container to restrict dragging within.
38
+ * @param {boolean} [options.collisionByMouse=false] - Use mouse position for collision instead of element rect.
39
+ * @param {string} [options.classDragging='dragging'] - CSS class applied to the clone during dragging.
40
+ * @param {string} [options.classBodyDragging='drag-active'] - CSS class applied to <body> during dragging.
41
+ * @param {string} [options.classJailDragging='jail-drag-active'] - CSS class applied to jail element during drag.
42
+ * @param {string} [options.classJailDragDisabled='jail-drag-disabled'] - CSS class applied to jail element disabled.
43
+ * @param {string} [options.classDragCollision='dragging-collision'] - CSS class applied to collision element.
44
+ * @param {boolean} [options.lockInsideJail=false] - Restrict movement within the jail container.
45
+ * @param {boolean} [options.dropInJailOnly=false] - Restrict drop within the jail container.
46
+ * @param {VibrationPatterns|false} [options.vibration=false] - Vibration feedback configuration.
47
+ * @param {boolean} [options.revertOnDrop=false] - Whether to return to original position on drop.
48
+ * @param {string} [options.classHidden='drag-hidden'] - CSS class to hide original element during dragging.
49
+ * @throws {Error} If any option has an invalid type.
50
+ */
51
+ constructor(targetElement: HTMLElement, options?: {
52
+ jail?: HTMLElement | undefined;
53
+ collisionByMouse?: boolean | undefined;
54
+ classDragging?: string | undefined;
55
+ classBodyDragging?: string | undefined;
56
+ classJailDragging?: string | undefined;
57
+ classJailDragDisabled?: string | undefined;
58
+ classDragCollision?: string | undefined;
59
+ lockInsideJail?: boolean | undefined;
60
+ dropInJailOnly?: boolean | undefined;
61
+ vibration?: false | VibrationPatterns | undefined;
62
+ revertOnDrop?: boolean | undefined;
63
+ classHidden?: string | undefined;
64
+ });
65
+ /** @private */
66
+ private _onMouseDown;
67
+ /** @private */
68
+ private _onMouseMove;
69
+ /** @private */
70
+ private _onMouseUp;
71
+ /**
72
+ * @type {TouchDragEvent}
73
+ * @private
74
+ */
75
+ private _onTouchStart;
76
+ /**
77
+ * @type {TouchDragEvent}
78
+ * @private
79
+ */
80
+ private _onTouchMove;
81
+ /**
82
+ * @type {TouchDragEvent}
83
+ * @private
84
+ */
85
+ private _onTouchEnd;
86
+ /**
87
+ * Enables the drag functionality.
88
+ */
89
+ enable(): void;
90
+ /**
91
+ * Disables the drag functionality.
92
+ */
93
+ disable(): void;
94
+ /**
95
+ * Adds an element to be considered for collision detection.
96
+ * @param {HTMLElement} element - The element to track collisions with.
97
+ * @throws {Error} If the element is not a valid HTMLElement.
98
+ */
99
+ addCollidable(element: HTMLElement): void;
100
+ /**
101
+ * Removes a collidable element from the tracking list.
102
+ * @param {HTMLElement} element - The element to remove.
103
+ * @throws {Error} If the element is not a valid HTMLElement.
104
+ */
105
+ removeCollidable(element: HTMLElement): void;
106
+ /**
107
+ * Sets vibration patterns for drag events.
108
+ * @param {Object} [param0={}] - Vibration pattern configuration.
109
+ * @param {number[]|false} [param0.startPattern=false] - Vibration on drag start.
110
+ * @param {number[]|false} [param0.endPattern=false] - Vibration on drag end.
111
+ * @param {number[]|false} [param0.collidePattern=false] - Vibration on collision.
112
+ * @param {number[]|false} [param0.movePattern=false] - Vibration during movement.
113
+ * @throws {Error} If any pattern is not false or an array of numbers.
114
+ */
115
+ setVibrationPattern({ startPattern, endPattern, collidePattern, movePattern, }?: {
116
+ startPattern?: false | number[] | undefined;
117
+ endPattern?: false | number[] | undefined;
118
+ collidePattern?: false | number[] | undefined;
119
+ movePattern?: false | number[] | undefined;
120
+ }): void;
121
+ /**
122
+ * Disables all vibration feedback.
123
+ */
124
+ disableVibration(): void;
125
+ /**
126
+ * Calculates the cursor offset relative to the top-left of the target element.
127
+ * @param {MouseEvent|Touch} event - The mouse or touch event.
128
+ * @returns {{x: number, y: number}} The offset in pixels.
129
+ * @throws {Error} If event is not a MouseEvent or Touch with clientX/clientY.
130
+ */
131
+ getOffset(event: MouseEvent | Touch): {
132
+ x: number;
133
+ y: number;
134
+ };
135
+ /**
136
+ * Handles dragging collision.
137
+ * @param {MouseEvent|Touch} event - The drag event.
138
+ */
139
+ checkDragCollision(event: MouseEvent | Touch): void;
140
+ /**
141
+ * Handles the collision of a drag.
142
+ * @param {MouseEvent|Touch} event - The release event.
143
+ * @returns {{ inJail: boolean; collidedElement: HTMLElement|null }}
144
+ */
145
+ execCollision(event: MouseEvent | Touch): {
146
+ inJail: boolean;
147
+ collidedElement: HTMLElement | null;
148
+ };
149
+ /**
150
+ * Detects collision based on rectangle intersection.
151
+ * @param {DOMRect} rect - Bounding rectangle of the dragged proxy.
152
+ * @returns {HTMLElement|null} The collided element or null.
153
+ * @throws {Error} If rect is not a DOMRect with valid numeric properties.
154
+ */
155
+ getCollidedElementByRect(rect: DOMRect): HTMLElement | null;
156
+ /**
157
+ * Detects collision with a point using element bounding rectangles.
158
+ * @param {number} x - Horizontal screen coordinate.
159
+ * @param {number} y - Vertical screen coordinate.
160
+ * @returns {HTMLElement|null} The collided element or null.
161
+ */
162
+ getCollidedElement(x: number, y: number): HTMLElement | null;
163
+ /**
164
+ * Gets whether dragging is currently active.
165
+ * @returns {boolean}
166
+ */
167
+ getDragging(): boolean;
168
+ /**
169
+ * Gets whether movement is restricted inside the jail container.
170
+ * @returns {boolean}
171
+ */
172
+ getLockInsideJail(): boolean;
173
+ /**
174
+ * Sets whether movement is restricted inside the jail container.
175
+ * @param {boolean} value
176
+ */
177
+ setLockInsideJail(value: boolean): void;
178
+ /**
179
+ * Gets whether the element should revert to original position on drop.
180
+ * @returns {boolean}
181
+ */
182
+ getRevertOnDrop(): boolean;
183
+ /**
184
+ * Sets whether the element should revert to original position on drop.
185
+ * @param {boolean} value
186
+ */
187
+ setRevertOnDrop(value: boolean): void;
188
+ /**
189
+ * Gets whether collision detection uses mouse position.
190
+ * @returns {boolean}
191
+ */
192
+ getCollisionByMouse(): boolean;
193
+ /**
194
+ * Sets whether collision detection uses mouse position.
195
+ * @param {boolean} value
196
+ */
197
+ setCollisionByMouse(value: boolean): void;
198
+ /**
199
+ * Gets whether dropping is restricted inside the jail container.
200
+ * @returns {boolean}
201
+ */
202
+ getDropInJailOnly(): boolean;
203
+ /**
204
+ * Sets whether dropping is restricted inside the jail container.
205
+ * @param {boolean} value
206
+ */
207
+ setDropInJailOnly(value: boolean): void;
208
+ /**
209
+ * Returns the original target element being dragged.
210
+ * @returns {HTMLElement}
211
+ */
212
+ getTarget(): HTMLElement;
213
+ /**
214
+ * Returns the current jail container (if any).
215
+ * @returns {HTMLElement|null}
216
+ */
217
+ getJail(): HTMLElement | null;
218
+ /**
219
+ * Returns the current proxy element being dragged (if any).
220
+ * @returns {HTMLElement|null}
221
+ */
222
+ getDragProxy(): HTMLElement | null;
223
+ /**
224
+ * Returns the last collided element (if any).
225
+ * @returns {HTMLElement|null}
226
+ */
227
+ getLastCollision(): HTMLElement | null;
228
+ /**
229
+ * Returns all registered collidable elements.
230
+ * @returns {HTMLElement[]}
231
+ */
232
+ getCollidables(): HTMLElement[];
233
+ /**
234
+ * Returns the CSS class used to hide the target during drag.
235
+ * @returns {string}
236
+ */
237
+ getDragHiddenClass(): string;
238
+ /**
239
+ * Returns the CSS class applied to the clone during dragging.
240
+ * @returns {string}
241
+ */
242
+ getClassDragging(): string;
243
+ /**
244
+ * Returns the CSS class applied to <body> during dragging.
245
+ * @returns {string}
246
+ */
247
+ getClassBodyDragging(): string;
248
+ /**
249
+ * Returns the CSS class applied to the jail during dragging.
250
+ * @returns {string}
251
+ */
252
+ getClassJailDragging(): string;
253
+ /**
254
+ * Returns the CSS class applied to the jail when dragging is disabled.
255
+ * @returns {string}
256
+ */
257
+ getClassJailDragDisabled(): string;
258
+ /**
259
+ * Returns the CSS class applied to a collided element.
260
+ * @returns {string}
261
+ */
262
+ getClassDragCollision(): string;
263
+ /**
264
+ * Returns the full vibration configuration.
265
+ * @returns {VibrationPatterns}
266
+ */
267
+ getVibrations(): VibrationPatterns;
268
+ /**
269
+ * Returns the vibration pattern for drag start.
270
+ * @returns {number[]|boolean}
271
+ */
272
+ getStartVibration(): number[] | boolean;
273
+ /**
274
+ * Returns the vibration pattern for drag end.
275
+ * @returns {number[]|boolean}
276
+ */
277
+ getEndVibration(): number[] | boolean;
278
+ /**
279
+ * Returns the vibration pattern for collisions.
280
+ * @returns {number[]|boolean}
281
+ */
282
+ getCollideVibration(): number[] | boolean;
283
+ /**
284
+ * Returns the vibration pattern during movement.
285
+ * @returns {number[]|boolean}
286
+ */
287
+ getMoveVibration(): number[] | boolean;
288
+ /**
289
+ * Returns whether the dragger is currently enabled.
290
+ * @returns {boolean}
291
+ */
292
+ isEnabled(): boolean;
293
+ /**
294
+ * Completely disables drag-and-drop and cleans up all event listeners.
295
+ * Does NOT remove the original HTML element.
296
+ */
297
+ destroy(): void;
298
+ #private;
299
+ }
300
+ //# sourceMappingURL=TinyDragger.d.mts.map