tiny-essentials 1.12.0 → 1.12.2
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/legacy/firebase/index.mjs +5 -5
- package/dist/v1/TinyBasicsEs.js +1 -1257
- package/dist/v1/TinyBasicsEs.min.js +1 -1
- package/dist/v1/TinyDragger.js +148 -43
- package/dist/v1/TinyDragger.min.js +1 -1
- package/dist/v1/TinyEssentials.js +484 -189
- package/dist/v1/TinyEssentials.min.js +1 -1
- package/dist/v1/TinyUploadClicker.js +478 -190
- package/dist/v1/TinyUploadClicker.min.js +1 -1
- package/dist/v1/basics/index.cjs +0 -23
- package/dist/v1/basics/index.d.mts +1 -23
- package/dist/v1/basics/index.mjs +1 -2
- package/dist/v1/fileManager/asyncFuncs.cjs +272 -0
- package/dist/v1/fileManager/asyncFuncs.d.mts +93 -0
- package/dist/v1/fileManager/asyncFuncs.mjs +236 -0
- package/dist/v1/fileManager/index.cjs +35 -0
- package/dist/v1/fileManager/index.d.mts +30 -0
- package/dist/v1/fileManager/index.mjs +3 -0
- package/dist/v1/{basics/fileManager.cjs → fileManager/normalFuncs.cjs} +10 -105
- package/dist/v1/{basics/fileManager.d.mts → fileManager/normalFuncs.d.mts} +3 -56
- package/dist/v1/{basics/fileManager.mjs → fileManager/normalFuncs.mjs} +48 -131
- package/dist/v1/index.cjs +30 -23
- package/dist/v1/index.d.mts +29 -23
- package/dist/v1/index.mjs +3 -2
- package/dist/v1/libs/TinyDragger.cjs +148 -43
- package/dist/v1/libs/TinyDragger.d.mts +18 -2
- package/dist/v1/libs/TinyDragger.mjs +132 -38
- package/dist/v1/libs/TinyUploadClicker.cjs +1 -0
- package/docs/v1/README.md +3 -1
- package/docs/v1/{basics/fileManager.md → fileManager/main.md} +12 -0
- package/docs/v1/libs/TinyDragger.md +15 -0
- package/package.json +5 -1
|
@@ -32,6 +32,8 @@ A powerful and flexible utility toolkit for managing files and directories in No
|
|
|
32
32
|
|
|
33
33
|
🧹 Deletes all contents inside a directory while keeping the directory itself.
|
|
34
34
|
|
|
35
|
+
* Async version: `clearDirectoryAsync`.
|
|
36
|
+
|
|
35
37
|
---
|
|
36
38
|
|
|
37
39
|
## 🧪 File Checks
|
|
@@ -48,6 +50,8 @@ A powerful and flexible utility toolkit for managing files and directories in No
|
|
|
48
50
|
|
|
49
51
|
📭 Checks if a directory is empty.
|
|
50
52
|
|
|
53
|
+
* Async version: `isDirEmptyAsync`.
|
|
54
|
+
|
|
51
55
|
---
|
|
52
56
|
|
|
53
57
|
## 📄 File Operations
|
|
@@ -82,10 +86,14 @@ A powerful and flexible utility toolkit for managing files and directories in No
|
|
|
82
86
|
|
|
83
87
|
📃 Lists all files and dirs in a directory. Can be recursive.
|
|
84
88
|
|
|
89
|
+
* Async version: `listFilesAsync`.
|
|
90
|
+
|
|
85
91
|
### `listDirs(dirPath: string, recursive?: boolean): string[]`
|
|
86
92
|
|
|
87
93
|
📁 Lists all directories in a directory. Can be recursive.
|
|
88
94
|
|
|
95
|
+
* Async version: `listDirsAsync`.
|
|
96
|
+
|
|
89
97
|
---
|
|
90
98
|
|
|
91
99
|
## 📏 File Info
|
|
@@ -94,10 +102,14 @@ A powerful and flexible utility toolkit for managing files and directories in No
|
|
|
94
102
|
|
|
95
103
|
⚖️ Gets the size of a single file in bytes.
|
|
96
104
|
|
|
105
|
+
* Async version: `fileSizeAsync`.
|
|
106
|
+
|
|
97
107
|
### `dirSize(dirPath: string): number`
|
|
98
108
|
|
|
99
109
|
📦 Gets the total size of all files inside a directory (recursive).
|
|
100
110
|
|
|
111
|
+
* Async version: `dirSizeAsync`.
|
|
112
|
+
|
|
101
113
|
---
|
|
102
114
|
|
|
103
115
|
## 💾 Backup Utilities
|
|
@@ -54,6 +54,7 @@ new TinyDragger(targetElement, options?)
|
|
|
54
54
|
| `classHidden` | `string` | `'drag-hidden'` | Class used to hide the original element while dragging |
|
|
55
55
|
| `lockInsideJail` | `boolean` | `false` | Prevent drag from exceeding jail bounds |
|
|
56
56
|
| `dropInJailOnly` | `boolean` | `false` | Prevent drop outside the jail area |
|
|
57
|
+
| `multiCollision` | `boolean` | `false` | Enables returning multiple collided elements |
|
|
57
58
|
| `vibration` | `VibrationPatterns` or `false` | `false` | Vibration feedback configuration |
|
|
58
59
|
| `revertOnDrop` | `boolean` | `false` | Return to original position after dropping |
|
|
59
60
|
|
|
@@ -133,6 +134,13 @@ Each pattern must be either `false` or an array of numbers.
|
|
|
133
134
|
|
|
134
135
|
---
|
|
135
136
|
|
|
137
|
+
### `getAllCollidedElementsByRect(rect: DOMRect): HTMLElement[]`
|
|
138
|
+
|
|
139
|
+
📌 Returns **all elements** currently intersecting the given rectangle. Useful for detecting multiple overlaps when dragging.
|
|
140
|
+
🛑 Throws if `rect` is not a valid `DOMRect` with numeric `left`, `right`, `top`, and `bottom` properties.
|
|
141
|
+
|
|
142
|
+
---
|
|
143
|
+
|
|
136
144
|
### `getCollidedElement(x: number, y: number): HTMLElement | null`
|
|
137
145
|
|
|
138
146
|
📌 Detects if the given screen coordinates collide with any tracked element.
|
|
@@ -140,6 +148,13 @@ Each pattern must be either `false` or an array of numbers.
|
|
|
140
148
|
|
|
141
149
|
---
|
|
142
150
|
|
|
151
|
+
### `getAllCollidedElements(x: number, y: number): HTMLElement[]`
|
|
152
|
+
|
|
153
|
+
📌 Detects **all elements** currently under the given screen coordinates. Works well when `collisionByMouse` is enabled.
|
|
154
|
+
🛑 Throws if `x` or `y` is not a number.
|
|
155
|
+
|
|
156
|
+
---
|
|
157
|
+
|
|
143
158
|
### `getDragging(): boolean`
|
|
144
159
|
|
|
145
160
|
🔄 Returns whether dragging is currently active.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "tiny-essentials",
|
|
3
|
-
"version": "1.12.
|
|
3
|
+
"version": "1.12.2",
|
|
4
4
|
"description": "Collection of small, essential scripts designed to be used across various projects. These simple utilities are crafted for speed, ease of use, and versatility.",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"test": "npm run test:mjs && npm run test:cjs && npm run test:js",
|
|
@@ -46,6 +46,10 @@
|
|
|
46
46
|
"./basics": {
|
|
47
47
|
"require": "./dist/v1/basics/index.cjs",
|
|
48
48
|
"import": "./dist/v1/basics/index.mjs"
|
|
49
|
+
},
|
|
50
|
+
"./fileManager": {
|
|
51
|
+
"require": "./dist/v1/fileManager/index.cjs",
|
|
52
|
+
"import": "./dist/v1/fileManager/index.mjs"
|
|
49
53
|
}
|
|
50
54
|
},
|
|
51
55
|
"repository": {
|