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.
- package/README.md +12 -3
- package/dist/node_modules/firebase-functions/lib/common/trace.cjs +82 -0
- package/dist/node_modules/firebase-functions/lib/logger/common.cjs +57 -0
- package/dist/node_modules/firebase-functions/lib/logger/index.cjs +158 -0
- package/dist/v1/TinyBasicsEs.js +1653 -1
- package/dist/v1/TinyBasicsEs.min.js +1 -1
- package/dist/v1/TinyDragDropDetector.js +307 -0
- package/dist/v1/TinyDragDropDetector.min.js +1 -0
- package/dist/v1/TinyDragger.js +3563 -0
- package/dist/v1/TinyDragger.min.js +2 -0
- package/dist/v1/TinyDragger.min.js.LICENSE.txt +8 -0
- package/dist/v1/TinyEssentials.js +2783 -2
- package/dist/v1/TinyEssentials.min.js +1 -1
- package/dist/v1/TinyNotifyCenter.js +32 -0
- package/dist/v1/TinyNotifyCenter.min.js +1 -1
- package/dist/v1/TinyToastNotify.js +24 -0
- package/dist/v1/TinyToastNotify.min.js +1 -1
- package/dist/v1/TinyUploadClicker.js +5235 -0
- package/dist/v1/TinyUploadClicker.min.js +2 -0
- package/dist/v1/TinyUploadClicker.min.js.LICENSE.txt +8 -0
- package/dist/v1/basics/fileManager.cjs +524 -0
- package/dist/v1/basics/fileManager.d.mts +209 -0
- package/dist/v1/basics/fileManager.mjs +443 -0
- package/dist/v1/basics/fullScreen.cjs +134 -0
- package/dist/v1/basics/fullScreen.d.mts +8 -0
- package/dist/v1/basics/fullScreen.mjs +121 -0
- package/dist/v1/basics/html.cjs +262 -0
- package/dist/v1/basics/html.d.mts +63 -0
- package/dist/v1/basics/html.mjs +208 -0
- package/dist/v1/basics/index.cjs +40 -0
- package/dist/v1/basics/index.d.mts +38 -1
- package/dist/v1/basics/index.mjs +4 -1
- package/dist/v1/build/TinyDragDropDetector.cjs +7 -0
- package/dist/v1/build/TinyDragDropDetector.d.mts +3 -0
- package/dist/v1/build/TinyDragDropDetector.mjs +2 -0
- package/dist/v1/build/TinyDragger.cjs +7 -0
- package/dist/v1/build/TinyDragger.d.mts +3 -0
- package/dist/v1/build/TinyDragger.mjs +2 -0
- package/dist/v1/build/TinyUploadClicker.cjs +7 -0
- package/dist/v1/build/TinyUploadClicker.d.mts +3 -0
- package/dist/v1/build/TinyUploadClicker.mjs +2 -0
- package/dist/v1/css/TinyDraggerExample.css +21 -0
- package/dist/v1/css/TinyDraggerExample.min.css +1 -0
- package/dist/v1/index.cjs +44 -0
- package/dist/v1/index.d.mts +40 -1
- package/dist/v1/index.mjs +6 -1
- package/dist/v1/libs/TinyDragDropDetector.cjs +268 -0
- package/dist/v1/libs/TinyDragDropDetector.d.mts +123 -0
- package/dist/v1/libs/TinyDragDropDetector.mjs +228 -0
- package/dist/v1/libs/TinyDragger.cjs +801 -0
- package/dist/v1/libs/TinyDragger.d.mts +300 -0
- package/dist/v1/libs/TinyDragger.mjs +689 -0
- package/dist/v1/libs/TinyNotifyCenter.cjs +32 -0
- package/dist/v1/libs/TinyNotifyCenter.d.mts +9 -0
- package/dist/v1/libs/TinyNotifyCenter.mjs +28 -0
- package/dist/v1/libs/TinyToastNotify.cjs +24 -0
- package/dist/v1/libs/TinyToastNotify.d.mts +8 -0
- package/dist/v1/libs/TinyToastNotify.mjs +20 -0
- package/dist/v1/libs/TinyUploadClicker.cjs +223 -0
- package/dist/v1/libs/TinyUploadClicker.d.mts +80 -0
- package/dist/v1/libs/TinyUploadClicker.mjs +182 -0
- package/docs/v1/README.md +8 -2
- package/docs/v1/basics/fileManager.md +222 -0
- package/docs/v1/basics/fullScreen.md +183 -0
- package/docs/v1/basics/html.md +243 -0
- package/docs/v1/libs/TinyDragDropDetector.md +143 -0
- package/docs/v1/libs/TinyDragger.md +415 -0
- package/docs/v1/libs/TinyLevelUp.md +1 -1
- package/docs/v1/libs/TinyNotifyCenter.md +20 -0
- package/docs/v1/libs/TinyToastNotify.md +19 -0
- package/docs/v1/libs/TinyUploadClicker.md +108 -0
- package/package.json +12 -2
|
@@ -0,0 +1,208 @@
|
|
|
1
|
+
import { isJsonObject } from './objFilter.mjs';
|
|
2
|
+
/**
|
|
3
|
+
* Checks if two DOM elements are colliding on the screen.
|
|
4
|
+
*
|
|
5
|
+
* @param {Element} elem1 - First DOM element.
|
|
6
|
+
* @param {Element} elem2 - Second DOM element.
|
|
7
|
+
* @returns {boolean} - Returns true if the elements are colliding.
|
|
8
|
+
*/
|
|
9
|
+
export function areHtmlElsColliding(elem1, elem2) {
|
|
10
|
+
const rect1 = elem1.getBoundingClientRect();
|
|
11
|
+
const rect2 = elem2.getBoundingClientRect();
|
|
12
|
+
return !(rect1.right < rect2.left ||
|
|
13
|
+
rect1.left > rect2.right ||
|
|
14
|
+
rect1.bottom < rect2.top ||
|
|
15
|
+
rect1.top > rect2.bottom);
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Reads and parses a JSON data using FileReader.
|
|
19
|
+
* Throws an error if the content is not valid JSON.
|
|
20
|
+
* @param {File} file
|
|
21
|
+
* @returns {Promise<any>}
|
|
22
|
+
*/
|
|
23
|
+
export function readJsonBlob(file) {
|
|
24
|
+
return new Promise((resolve, reject) => {
|
|
25
|
+
const reader = new FileReader();
|
|
26
|
+
reader.onload = () => {
|
|
27
|
+
try {
|
|
28
|
+
// @ts-ignore
|
|
29
|
+
const result = JSON.parse(reader.result);
|
|
30
|
+
resolve(result);
|
|
31
|
+
}
|
|
32
|
+
catch (error) {
|
|
33
|
+
// @ts-ignore
|
|
34
|
+
reject(new Error(`Invalid JSON in file: ${file.name}\n${error.message}`));
|
|
35
|
+
}
|
|
36
|
+
};
|
|
37
|
+
reader.onerror = () => {
|
|
38
|
+
reject(new Error(`Error reading file: ${file.name}`));
|
|
39
|
+
};
|
|
40
|
+
reader.readAsText(file);
|
|
41
|
+
});
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* Saves a JSON object as a downloadable file.
|
|
45
|
+
* @param {string} filename
|
|
46
|
+
* @param {any} data
|
|
47
|
+
* @param {number} [spaces=2]
|
|
48
|
+
*/
|
|
49
|
+
export function saveJsonFile(filename, data, spaces = 2) {
|
|
50
|
+
const json = JSON.stringify(data, null, spaces);
|
|
51
|
+
const blob = new Blob([json], { type: 'application/json' });
|
|
52
|
+
const url = URL.createObjectURL(blob);
|
|
53
|
+
const link = document.createElement('a');
|
|
54
|
+
link.href = url;
|
|
55
|
+
link.download = filename;
|
|
56
|
+
document.body.appendChild(link);
|
|
57
|
+
link.click();
|
|
58
|
+
document.body.removeChild(link);
|
|
59
|
+
URL.revokeObjectURL(url);
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* Loads and parses a JSON from a remote URL using Fetch API.
|
|
63
|
+
*
|
|
64
|
+
* @param {string} url - The full URL to fetch JSON from.
|
|
65
|
+
* @param {Object} [options] - Optional settings.
|
|
66
|
+
* @param {string} [options.method="GET"] - HTTP method to use (GET, POST, etc.).
|
|
67
|
+
* @param {any} [options.body] - Request body (only for methods like POST, PUT).
|
|
68
|
+
* @param {number} [options.timeout=0] - Timeout in milliseconds (ignored if signal is provided).
|
|
69
|
+
* @param {number} [options.retries=0] - Number of retry attempts (ignored if signal is provided).
|
|
70
|
+
* @param {Headers|Record<string, *>} [options.headers={}] - Additional headers.
|
|
71
|
+
* @param {AbortSignal|null} [options.signal] - External AbortSignal; disables timeout and retries.
|
|
72
|
+
* @returns {Promise<*>} Parsed JSON object.
|
|
73
|
+
* @throws {Error} Throws if fetch fails, times out, or returns invalid JSON.
|
|
74
|
+
*/
|
|
75
|
+
export async function fetchJson(url, { method = 'GET', body, timeout = 0, retries = 0, headers = {}, signal = null } = {}) {
|
|
76
|
+
if (typeof url !== 'string' ||
|
|
77
|
+
(!url.startsWith('../') &&
|
|
78
|
+
!url.startsWith('./') &&
|
|
79
|
+
!url.startsWith('/') &&
|
|
80
|
+
!url.startsWith('https://') &&
|
|
81
|
+
!url.startsWith('http://')))
|
|
82
|
+
throw new Error('Invalid URL: must be a valid http or https address.');
|
|
83
|
+
if (typeof method !== 'string' || !method.trim())
|
|
84
|
+
throw new Error('Invalid method: must be a non-empty string.');
|
|
85
|
+
if (!signal) {
|
|
86
|
+
if (typeof timeout !== 'number' ||
|
|
87
|
+
!Number.isFinite(timeout) ||
|
|
88
|
+
Number.isNaN(timeout) ||
|
|
89
|
+
timeout < 0)
|
|
90
|
+
throw new Error('Invalid timeout: must be a positive number.');
|
|
91
|
+
if (typeof retries !== 'number' ||
|
|
92
|
+
!Number.isFinite(retries) ||
|
|
93
|
+
Number.isNaN(retries) ||
|
|
94
|
+
retries < 0)
|
|
95
|
+
throw new Error('Invalid retries: must be a positive number.');
|
|
96
|
+
}
|
|
97
|
+
const attempts = signal ? 1 : retries + 1;
|
|
98
|
+
/** @type {Error|null} */
|
|
99
|
+
let lastError = null;
|
|
100
|
+
for (let attempt = 0; attempt < attempts; attempt++) {
|
|
101
|
+
const controller = signal ? null : new AbortController();
|
|
102
|
+
const localSignal = signal || (controller?.signal ?? null);
|
|
103
|
+
const timer = !signal && timeout && controller ? setTimeout(() => controller.abort(), timeout) : null;
|
|
104
|
+
try {
|
|
105
|
+
const response = await fetch(url, {
|
|
106
|
+
method: method.toUpperCase(),
|
|
107
|
+
headers: {
|
|
108
|
+
Accept: 'application/json',
|
|
109
|
+
...headers,
|
|
110
|
+
},
|
|
111
|
+
body: body !== undefined ? (isJsonObject(body) ? JSON.stringify(body) : body) : undefined,
|
|
112
|
+
signal: localSignal,
|
|
113
|
+
});
|
|
114
|
+
if (timer)
|
|
115
|
+
clearTimeout(timer);
|
|
116
|
+
if (!response.ok)
|
|
117
|
+
throw new Error(`HTTP error: ${response.status} ${response.statusText}`);
|
|
118
|
+
const contentType = response.headers.get('content-type') || '';
|
|
119
|
+
if (!contentType.includes('application/json'))
|
|
120
|
+
throw new Error(`Unexpected content-type: ${contentType}`);
|
|
121
|
+
const data = await response.json();
|
|
122
|
+
if (!isJsonObject(data))
|
|
123
|
+
throw new Error('Received invalid data instead of valid JSON.');
|
|
124
|
+
return data;
|
|
125
|
+
}
|
|
126
|
+
catch (err) {
|
|
127
|
+
lastError = /** @type {Error} */ (err);
|
|
128
|
+
if (signal)
|
|
129
|
+
break; // if an external signal came, it does not retry
|
|
130
|
+
if (attempt < retries)
|
|
131
|
+
await new Promise((resolve) => setTimeout(resolve, 300 * (attempt + 1)));
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
throw new Error(`Failed to fetch JSON from "${url}"${lastError ? `: ${lastError.message}` : '.'}`);
|
|
135
|
+
}
|
|
136
|
+
/**
|
|
137
|
+
* @typedef {Object} HtmlElBoxSides
|
|
138
|
+
* @property {number} x - Total horizontal size (left + right)
|
|
139
|
+
* @property {number} y - Total vertical size (top + bottom)
|
|
140
|
+
* @property {number} left
|
|
141
|
+
* @property {number} right
|
|
142
|
+
* @property {number} top
|
|
143
|
+
* @property {number} bottom
|
|
144
|
+
*/
|
|
145
|
+
/**
|
|
146
|
+
* Returns the total border width and individual sides from `border{Side}Width` CSS properties.
|
|
147
|
+
*
|
|
148
|
+
* @param {Element} el - The target DOM element.
|
|
149
|
+
* @returns {HtmlElBoxSides} - Total horizontal (x) and vertical (y) border widths, and each side individually.
|
|
150
|
+
*/
|
|
151
|
+
export const getHtmlElBordersWidth = (el) => {
|
|
152
|
+
const styles = getComputedStyle(el);
|
|
153
|
+
const left = parseFloat(styles.borderLeftWidth) || 0;
|
|
154
|
+
const right = parseFloat(styles.borderRightWidth) || 0;
|
|
155
|
+
const top = parseFloat(styles.borderTopWidth) || 0;
|
|
156
|
+
const bottom = parseFloat(styles.borderBottomWidth) || 0;
|
|
157
|
+
const x = left + right;
|
|
158
|
+
const y = top + bottom;
|
|
159
|
+
return { x, y, left, right, top, bottom };
|
|
160
|
+
};
|
|
161
|
+
/**
|
|
162
|
+
* Returns the total border size and individual sides from `border{Side}` CSS properties.
|
|
163
|
+
*
|
|
164
|
+
* @param {Element} el - The target DOM element.
|
|
165
|
+
* @returns {HtmlElBoxSides} - Total horizontal (x) and vertical (y) border sizes, and each side individually.
|
|
166
|
+
*/
|
|
167
|
+
export const getHtmlElBorders = (el) => {
|
|
168
|
+
const styles = getComputedStyle(el);
|
|
169
|
+
const left = parseFloat(styles.borderLeft) || 0;
|
|
170
|
+
const right = parseFloat(styles.borderRight) || 0;
|
|
171
|
+
const top = parseFloat(styles.borderTop) || 0;
|
|
172
|
+
const bottom = parseFloat(styles.borderBottom) || 0;
|
|
173
|
+
const x = left + right;
|
|
174
|
+
const y = top + bottom;
|
|
175
|
+
return { x, y, left, right, top, bottom };
|
|
176
|
+
};
|
|
177
|
+
/**
|
|
178
|
+
* Returns the total margin and individual sides from `margin{Side}` CSS properties.
|
|
179
|
+
*
|
|
180
|
+
* @param {Element} el - The target DOM element.
|
|
181
|
+
* @returns {HtmlElBoxSides} - Total horizontal (x) and vertical (y) margins, and each side individually.
|
|
182
|
+
*/
|
|
183
|
+
export const getHtmlElMargin = (el) => {
|
|
184
|
+
const styles = getComputedStyle(el);
|
|
185
|
+
const left = parseFloat(styles.marginLeft) || 0;
|
|
186
|
+
const right = parseFloat(styles.marginRight) || 0;
|
|
187
|
+
const top = parseFloat(styles.marginTop) || 0;
|
|
188
|
+
const bottom = parseFloat(styles.marginBottom) || 0;
|
|
189
|
+
const x = left + right;
|
|
190
|
+
const y = top + bottom;
|
|
191
|
+
return { x, y, left, right, top, bottom };
|
|
192
|
+
};
|
|
193
|
+
/**
|
|
194
|
+
* Returns the total padding and individual sides from `padding{Side}` CSS properties.
|
|
195
|
+
*
|
|
196
|
+
* @param {Element} el - The target DOM element.
|
|
197
|
+
* @returns {HtmlElBoxSides} - Total horizontal (x) and vertical (y) paddings, and each side individually.
|
|
198
|
+
*/
|
|
199
|
+
export const getHtmlElPadding = (el) => {
|
|
200
|
+
const styles = getComputedStyle(el);
|
|
201
|
+
const left = parseFloat(styles.paddingLeft) || 0;
|
|
202
|
+
const right = parseFloat(styles.paddingRight) || 0;
|
|
203
|
+
const top = parseFloat(styles.paddingTop) || 0;
|
|
204
|
+
const bottom = parseFloat(styles.paddingBottom) || 0;
|
|
205
|
+
const x = left + right;
|
|
206
|
+
const y = top + bottom;
|
|
207
|
+
return { x, y, left, right, top, bottom };
|
|
208
|
+
};
|
package/dist/v1/basics/index.cjs
CHANGED
|
@@ -4,9 +4,12 @@ var arraySortPositions = require('../../legacy/libs/arraySortPositions.cjs');
|
|
|
4
4
|
var replaceAsync = require('../../legacy/libs/replaceAsync.cjs');
|
|
5
5
|
var array = require('./array.cjs');
|
|
6
6
|
var clock = require('./clock.cjs');
|
|
7
|
+
var html = require('./html.cjs');
|
|
7
8
|
var objFilter = require('./objFilter.cjs');
|
|
9
|
+
var fullScreen = require('./fullScreen.cjs');
|
|
8
10
|
var simpleMath = require('./simpleMath.cjs');
|
|
9
11
|
var text = require('./text.cjs');
|
|
12
|
+
var fileManager = require('./fileManager.cjs');
|
|
10
13
|
|
|
11
14
|
|
|
12
15
|
|
|
@@ -17,12 +20,27 @@ exports.formatCustomTimer = clock.formatCustomTimer;
|
|
|
17
20
|
exports.formatDayTimer = clock.formatDayTimer;
|
|
18
21
|
exports.formatTimer = clock.formatTimer;
|
|
19
22
|
exports.getTimeDuration = clock.getTimeDuration;
|
|
23
|
+
exports.areHtmlElsColliding = html.areHtmlElsColliding;
|
|
24
|
+
exports.fetchJson = html.fetchJson;
|
|
25
|
+
exports.getHtmlElBorders = html.getHtmlElBorders;
|
|
26
|
+
exports.getHtmlElBordersWidth = html.getHtmlElBordersWidth;
|
|
27
|
+
exports.getHtmlElMargin = html.getHtmlElMargin;
|
|
28
|
+
exports.getHtmlElPadding = html.getHtmlElPadding;
|
|
29
|
+
exports.readJsonBlob = html.readJsonBlob;
|
|
30
|
+
exports.saveJsonFile = html.saveJsonFile;
|
|
20
31
|
exports.cloneObjTypeOrder = objFilter.cloneObjTypeOrder;
|
|
21
32
|
exports.countObj = objFilter.countObj;
|
|
22
33
|
exports.extendObjType = objFilter.extendObjType;
|
|
23
34
|
exports.isJsonObject = objFilter.isJsonObject;
|
|
24
35
|
exports.objType = objFilter.objType;
|
|
25
36
|
exports.reorderObjTypeOrder = objFilter.reorderObjTypeOrder;
|
|
37
|
+
exports.documentIsFullScreen = fullScreen.documentIsFullScreen;
|
|
38
|
+
exports.exitFullScreen = fullScreen.exitFullScreen;
|
|
39
|
+
exports.isFullScreenMode = fullScreen.isFullScreenMode;
|
|
40
|
+
exports.isScreenFilled = fullScreen.isScreenFilled;
|
|
41
|
+
exports.offFullScreenChange = fullScreen.offFullScreenChange;
|
|
42
|
+
exports.onFullScreenChange = fullScreen.onFullScreenChange;
|
|
43
|
+
exports.requestFullScreen = fullScreen.requestFullScreen;
|
|
26
44
|
exports.formatBytes = simpleMath.formatBytes;
|
|
27
45
|
exports.getAge = simpleMath.getAge;
|
|
28
46
|
exports.getSimplePerc = simpleMath.getSimplePerc;
|
|
@@ -30,3 +48,25 @@ exports.ruleOfThree = simpleMath.ruleOfThree;
|
|
|
30
48
|
exports.addAiMarkerShortcut = text.addAiMarkerShortcut;
|
|
31
49
|
exports.toTitleCase = text.toTitleCase;
|
|
32
50
|
exports.toTitleCaseLowerFirst = text.toTitleCaseLowerFirst;
|
|
51
|
+
exports.backupFile = fileManager.backupFile;
|
|
52
|
+
exports.clearDirectory = fileManager.clearDirectory;
|
|
53
|
+
exports.dirExists = fileManager.dirExists;
|
|
54
|
+
exports.dirSize = fileManager.dirSize;
|
|
55
|
+
exports.ensureCopyFile = fileManager.ensureCopyFile;
|
|
56
|
+
exports.ensureDirectory = fileManager.ensureDirectory;
|
|
57
|
+
exports.fileExists = fileManager.fileExists;
|
|
58
|
+
exports.fileSize = fileManager.fileSize;
|
|
59
|
+
exports.getLatestBackupPath = fileManager.getLatestBackupPath;
|
|
60
|
+
exports.isDirEmpty = fileManager.isDirEmpty;
|
|
61
|
+
exports.listDirs = fileManager.listDirs;
|
|
62
|
+
exports.listFiles = fileManager.listFiles;
|
|
63
|
+
exports.readJsonFile = fileManager.readJsonFile;
|
|
64
|
+
exports.renameFileAddPrefixSuffix = fileManager.renameFileAddPrefixSuffix;
|
|
65
|
+
exports.renameFileBatch = fileManager.renameFileBatch;
|
|
66
|
+
exports.renameFileNormalizeCase = fileManager.renameFileNormalizeCase;
|
|
67
|
+
exports.renameFilePadNumbers = fileManager.renameFilePadNumbers;
|
|
68
|
+
exports.renameFileRegex = fileManager.renameFileRegex;
|
|
69
|
+
exports.restoreLatestBackup = fileManager.restoreLatestBackup;
|
|
70
|
+
exports.tryDeleteFile = fileManager.tryDeleteFile;
|
|
71
|
+
exports.writeJsonFile = fileManager.writeJsonFile;
|
|
72
|
+
exports.writeTextFile = fileManager.writeTextFile;
|
|
@@ -1,3 +1,40 @@
|
|
|
1
|
+
import { getHtmlElBorders } from './html.mjs';
|
|
2
|
+
import { getHtmlElBordersWidth } from './html.mjs';
|
|
3
|
+
import { getHtmlElMargin } from './html.mjs';
|
|
4
|
+
import { getHtmlElPadding } from './html.mjs';
|
|
5
|
+
import { getLatestBackupPath } from './fileManager.mjs';
|
|
6
|
+
import { fetchJson } from './html.mjs';
|
|
7
|
+
import { readJsonBlob } from './html.mjs';
|
|
8
|
+
import { saveJsonFile } from './html.mjs';
|
|
9
|
+
import { readJsonFile } from './fileManager.mjs';
|
|
10
|
+
import { writeJsonFile } from './fileManager.mjs';
|
|
11
|
+
import { ensureDirectory } from './fileManager.mjs';
|
|
12
|
+
import { clearDirectory } from './fileManager.mjs';
|
|
13
|
+
import { fileExists } from './fileManager.mjs';
|
|
14
|
+
import { dirExists } from './fileManager.mjs';
|
|
15
|
+
import { isDirEmpty } from './fileManager.mjs';
|
|
16
|
+
import { ensureCopyFile } from './fileManager.mjs';
|
|
17
|
+
import { tryDeleteFile } from './fileManager.mjs';
|
|
18
|
+
import { writeTextFile } from './fileManager.mjs';
|
|
19
|
+
import { listFiles } from './fileManager.mjs';
|
|
20
|
+
import { listDirs } from './fileManager.mjs';
|
|
21
|
+
import { fileSize } from './fileManager.mjs';
|
|
22
|
+
import { dirSize } from './fileManager.mjs';
|
|
23
|
+
import { backupFile } from './fileManager.mjs';
|
|
24
|
+
import { restoreLatestBackup } from './fileManager.mjs';
|
|
25
|
+
import { renameFileBatch } from './fileManager.mjs';
|
|
26
|
+
import { renameFileRegex } from './fileManager.mjs';
|
|
27
|
+
import { renameFileAddPrefixSuffix } from './fileManager.mjs';
|
|
28
|
+
import { renameFileNormalizeCase } from './fileManager.mjs';
|
|
29
|
+
import { renameFilePadNumbers } from './fileManager.mjs';
|
|
30
|
+
import { documentIsFullScreen } from './fullScreen.mjs';
|
|
31
|
+
import { isScreenFilled } from './fullScreen.mjs';
|
|
32
|
+
import { requestFullScreen } from './fullScreen.mjs';
|
|
33
|
+
import { exitFullScreen } from './fullScreen.mjs';
|
|
34
|
+
import { isFullScreenMode } from './fullScreen.mjs';
|
|
35
|
+
import { onFullScreenChange } from './fullScreen.mjs';
|
|
36
|
+
import { offFullScreenChange } from './fullScreen.mjs';
|
|
37
|
+
import { areHtmlElsColliding } from './html.mjs';
|
|
1
38
|
import { isJsonObject } from './objFilter.mjs';
|
|
2
39
|
import arraySortPositions from '../../legacy/libs/arraySortPositions.mjs';
|
|
3
40
|
import { formatBytes } from './simpleMath.mjs';
|
|
@@ -18,5 +55,5 @@ import { getTimeDuration } from './clock.mjs';
|
|
|
18
55
|
import { shuffleArray } from './array.mjs';
|
|
19
56
|
import { toTitleCase } from './text.mjs';
|
|
20
57
|
import { toTitleCaseLowerFirst } from './text.mjs';
|
|
21
|
-
export { isJsonObject, arraySortPositions, formatBytes, addAiMarkerShortcut, extendObjType, reorderObjTypeOrder, cloneObjTypeOrder, countObj, objType, ruleOfThree, getSimplePerc, asyncReplace, getAge, formatCustomTimer, formatDayTimer, formatTimer, getTimeDuration, shuffleArray, toTitleCase, toTitleCaseLowerFirst };
|
|
58
|
+
export { getHtmlElBorders, getHtmlElBordersWidth, getHtmlElMargin, getHtmlElPadding, getLatestBackupPath, fetchJson, readJsonBlob, saveJsonFile, readJsonFile, writeJsonFile, ensureDirectory, clearDirectory, fileExists, dirExists, isDirEmpty, ensureCopyFile, tryDeleteFile, writeTextFile, listFiles, listDirs, fileSize, dirSize, backupFile, restoreLatestBackup, renameFileBatch, renameFileRegex, renameFileAddPrefixSuffix, renameFileNormalizeCase, renameFilePadNumbers, documentIsFullScreen, isScreenFilled, requestFullScreen, exitFullScreen, isFullScreenMode, onFullScreenChange, offFullScreenChange, areHtmlElsColliding, isJsonObject, arraySortPositions, formatBytes, addAiMarkerShortcut, extendObjType, reorderObjTypeOrder, cloneObjTypeOrder, countObj, objType, ruleOfThree, getSimplePerc, asyncReplace, getAge, formatCustomTimer, formatDayTimer, formatTimer, getTimeDuration, shuffleArray, toTitleCase, toTitleCaseLowerFirst };
|
|
22
59
|
//# sourceMappingURL=index.d.mts.map
|
package/dist/v1/basics/index.mjs
CHANGED
|
@@ -2,7 +2,10 @@ import arraySortPositions from '../../legacy/libs/arraySortPositions.mjs';
|
|
|
2
2
|
import asyncReplace from '../../legacy/libs/replaceAsync.mjs';
|
|
3
3
|
import { shuffleArray } from './array.mjs';
|
|
4
4
|
import { formatCustomTimer, formatDayTimer, formatTimer, getTimeDuration } from './clock.mjs';
|
|
5
|
+
import { areHtmlElsColliding, readJsonBlob, saveJsonFile, fetchJson, getHtmlElBorders, getHtmlElBordersWidth, getHtmlElMargin, getHtmlElPadding, } from './html.mjs';
|
|
5
6
|
import { countObj, extendObjType, reorderObjTypeOrder, cloneObjTypeOrder, objType, isJsonObject, } from './objFilter.mjs';
|
|
7
|
+
import { documentIsFullScreen, isScreenFilled, requestFullScreen, exitFullScreen, isFullScreenMode, onFullScreenChange, offFullScreenChange, } from './fullScreen.mjs';
|
|
6
8
|
import { formatBytes, getAge, getSimplePerc, ruleOfThree } from './simpleMath.mjs';
|
|
7
9
|
import { addAiMarkerShortcut, toTitleCase, toTitleCaseLowerFirst } from './text.mjs';
|
|
8
|
-
|
|
10
|
+
import { readJsonFile, writeJsonFile, ensureDirectory, clearDirectory, fileExists, dirExists, isDirEmpty, ensureCopyFile, tryDeleteFile, writeTextFile, listFiles, listDirs, fileSize, dirSize, backupFile, restoreLatestBackup, renameFileBatch, renameFileRegex, renameFileAddPrefixSuffix, renameFileNormalizeCase, renameFilePadNumbers, getLatestBackupPath, } from './fileManager.mjs';
|
|
11
|
+
export { getHtmlElBorders, getHtmlElBordersWidth, getHtmlElMargin, getHtmlElPadding, getLatestBackupPath, fetchJson, readJsonBlob, saveJsonFile, readJsonFile, writeJsonFile, ensureDirectory, clearDirectory, fileExists, dirExists, isDirEmpty, ensureCopyFile, tryDeleteFile, writeTextFile, listFiles, listDirs, fileSize, dirSize, backupFile, restoreLatestBackup, renameFileBatch, renameFileRegex, renameFileAddPrefixSuffix, renameFileNormalizeCase, renameFilePadNumbers, documentIsFullScreen, isScreenFilled, requestFullScreen, exitFullScreen, isFullScreenMode, onFullScreenChange, offFullScreenChange, areHtmlElsColliding, isJsonObject, arraySortPositions, formatBytes, addAiMarkerShortcut, extendObjType, reorderObjTypeOrder, cloneObjTypeOrder, countObj, objType, ruleOfThree, getSimplePerc, asyncReplace, getAge, formatCustomTimer, formatDayTimer, formatTimer, getTimeDuration, shuffleArray, toTitleCase, toTitleCaseLowerFirst, };
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
.dragging {
|
|
2
|
+
opacity: 0.7;
|
|
3
|
+
outline: 2px dashed #3aa;
|
|
4
|
+
z-index: 9999;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
.dragging-collision {
|
|
8
|
+
outline: 2px dashed rgb(51, 170, 67);
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
body.drag-active {
|
|
12
|
+
cursor: grabbing !important;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
.jail-drag-active {
|
|
16
|
+
outline: 2px dashed #f90;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
.drag-hidden {
|
|
20
|
+
opacity: 0 !important;
|
|
21
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.dragging{opacity:.7;outline:2px dashed #3aa;z-index:9999}.dragging-collision{outline:2px dashed #33aa43}body.drag-active{cursor:grabbing !important}.jail-drag-active{outline:2px dashed #f90}.drag-hidden{opacity:0 !important}
|
package/dist/v1/index.cjs
CHANGED
|
@@ -6,6 +6,7 @@ var arraySortPositions = require('../legacy/libs/arraySortPositions.cjs');
|
|
|
6
6
|
var array = require('./basics/array.cjs');
|
|
7
7
|
var clock = require('./basics/clock.cjs');
|
|
8
8
|
var objFilter = require('./basics/objFilter.cjs');
|
|
9
|
+
var fullScreen = require('./basics/fullScreen.cjs');
|
|
9
10
|
var simpleMath = require('./basics/simpleMath.cjs');
|
|
10
11
|
var text = require('./basics/text.cjs');
|
|
11
12
|
var ColorSafeStringify = require('./libs/ColorSafeStringify.cjs');
|
|
@@ -13,6 +14,10 @@ var TinyPromiseQueue = require('./libs/TinyPromiseQueue.cjs');
|
|
|
13
14
|
var TinyRateLimiter = require('./libs/TinyRateLimiter.cjs');
|
|
14
15
|
var TinyNotifyCenter = require('./libs/TinyNotifyCenter.cjs');
|
|
15
16
|
var TinyToastNotify = require('./libs/TinyToastNotify.cjs');
|
|
17
|
+
var html = require('./basics/html.cjs');
|
|
18
|
+
var TinyDragDropDetector = require('./libs/TinyDragDropDetector.cjs');
|
|
19
|
+
var fileManager = require('./basics/fileManager.cjs');
|
|
20
|
+
var TinyDragger = require('./libs/TinyDragger.cjs');
|
|
16
21
|
|
|
17
22
|
|
|
18
23
|
|
|
@@ -31,6 +36,13 @@ exports.extendObjType = objFilter.extendObjType;
|
|
|
31
36
|
exports.isJsonObject = objFilter.isJsonObject;
|
|
32
37
|
exports.objType = objFilter.objType;
|
|
33
38
|
exports.reorderObjTypeOrder = objFilter.reorderObjTypeOrder;
|
|
39
|
+
exports.documentIsFullScreen = fullScreen.documentIsFullScreen;
|
|
40
|
+
exports.exitFullScreen = fullScreen.exitFullScreen;
|
|
41
|
+
exports.isFullScreenMode = fullScreen.isFullScreenMode;
|
|
42
|
+
exports.isScreenFilled = fullScreen.isScreenFilled;
|
|
43
|
+
exports.offFullScreenChange = fullScreen.offFullScreenChange;
|
|
44
|
+
exports.onFullScreenChange = fullScreen.onFullScreenChange;
|
|
45
|
+
exports.requestFullScreen = fullScreen.requestFullScreen;
|
|
34
46
|
exports.formatBytes = simpleMath.formatBytes;
|
|
35
47
|
exports.getAge = simpleMath.getAge;
|
|
36
48
|
exports.getSimplePerc = simpleMath.getSimplePerc;
|
|
@@ -43,3 +55,35 @@ exports.TinyPromiseQueue = TinyPromiseQueue;
|
|
|
43
55
|
exports.TinyRateLimiter = TinyRateLimiter;
|
|
44
56
|
exports.TinyNotifyCenter = TinyNotifyCenter;
|
|
45
57
|
exports.TinyToastNotify = TinyToastNotify;
|
|
58
|
+
exports.areHtmlElsColliding = html.areHtmlElsColliding;
|
|
59
|
+
exports.fetchJson = html.fetchJson;
|
|
60
|
+
exports.getHtmlElBorders = html.getHtmlElBorders;
|
|
61
|
+
exports.getHtmlElBordersWidth = html.getHtmlElBordersWidth;
|
|
62
|
+
exports.getHtmlElMargin = html.getHtmlElMargin;
|
|
63
|
+
exports.getHtmlElPadding = html.getHtmlElPadding;
|
|
64
|
+
exports.readJsonBlob = html.readJsonBlob;
|
|
65
|
+
exports.saveJsonFile = html.saveJsonFile;
|
|
66
|
+
exports.TinyDragDropDetector = TinyDragDropDetector;
|
|
67
|
+
exports.backupFile = fileManager.backupFile;
|
|
68
|
+
exports.clearDirectory = fileManager.clearDirectory;
|
|
69
|
+
exports.dirExists = fileManager.dirExists;
|
|
70
|
+
exports.dirSize = fileManager.dirSize;
|
|
71
|
+
exports.ensureCopyFile = fileManager.ensureCopyFile;
|
|
72
|
+
exports.ensureDirectory = fileManager.ensureDirectory;
|
|
73
|
+
exports.fileExists = fileManager.fileExists;
|
|
74
|
+
exports.fileSize = fileManager.fileSize;
|
|
75
|
+
exports.getLatestBackupPath = fileManager.getLatestBackupPath;
|
|
76
|
+
exports.isDirEmpty = fileManager.isDirEmpty;
|
|
77
|
+
exports.listDirs = fileManager.listDirs;
|
|
78
|
+
exports.listFiles = fileManager.listFiles;
|
|
79
|
+
exports.readJsonFile = fileManager.readJsonFile;
|
|
80
|
+
exports.renameFileAddPrefixSuffix = fileManager.renameFileAddPrefixSuffix;
|
|
81
|
+
exports.renameFileBatch = fileManager.renameFileBatch;
|
|
82
|
+
exports.renameFileNormalizeCase = fileManager.renameFileNormalizeCase;
|
|
83
|
+
exports.renameFilePadNumbers = fileManager.renameFilePadNumbers;
|
|
84
|
+
exports.renameFileRegex = fileManager.renameFileRegex;
|
|
85
|
+
exports.restoreLatestBackup = fileManager.restoreLatestBackup;
|
|
86
|
+
exports.tryDeleteFile = fileManager.tryDeleteFile;
|
|
87
|
+
exports.writeJsonFile = fileManager.writeJsonFile;
|
|
88
|
+
exports.writeTextFile = fileManager.writeTextFile;
|
|
89
|
+
exports.TinyDragger = TinyDragger;
|
package/dist/v1/index.d.mts
CHANGED
|
@@ -1,9 +1,48 @@
|
|
|
1
|
+
import TinyDragger from './libs/TinyDragger.mjs';
|
|
2
|
+
import TinyDragDropDetector from './libs/TinyDragDropDetector.mjs';
|
|
1
3
|
import TinyToastNotify from './libs/TinyToastNotify.mjs';
|
|
2
4
|
import TinyNotifyCenter from './libs/TinyNotifyCenter.mjs';
|
|
3
5
|
import TinyRateLimiter from './libs/TinyRateLimiter.mjs';
|
|
4
6
|
import ColorSafeStringify from './libs/ColorSafeStringify.mjs';
|
|
5
7
|
import TinyPromiseQueue from './libs/TinyPromiseQueue.mjs';
|
|
6
8
|
import TinyLevelUp from '../legacy/libs/userLevel.mjs';
|
|
9
|
+
import { getHtmlElBorders } from './basics/html.mjs';
|
|
10
|
+
import { getHtmlElBordersWidth } from './basics/html.mjs';
|
|
11
|
+
import { getHtmlElMargin } from './basics/html.mjs';
|
|
12
|
+
import { getHtmlElPadding } from './basics/html.mjs';
|
|
13
|
+
import { getLatestBackupPath } from './basics/fileManager.mjs';
|
|
14
|
+
import { fetchJson } from './basics/html.mjs';
|
|
15
|
+
import { readJsonBlob } from './basics/html.mjs';
|
|
16
|
+
import { saveJsonFile } from './basics/html.mjs';
|
|
17
|
+
import { readJsonFile } from './basics/fileManager.mjs';
|
|
18
|
+
import { writeJsonFile } from './basics/fileManager.mjs';
|
|
19
|
+
import { ensureDirectory } from './basics/fileManager.mjs';
|
|
20
|
+
import { clearDirectory } from './basics/fileManager.mjs';
|
|
21
|
+
import { fileExists } from './basics/fileManager.mjs';
|
|
22
|
+
import { dirExists } from './basics/fileManager.mjs';
|
|
23
|
+
import { isDirEmpty } from './basics/fileManager.mjs';
|
|
24
|
+
import { ensureCopyFile } from './basics/fileManager.mjs';
|
|
25
|
+
import { tryDeleteFile } from './basics/fileManager.mjs';
|
|
26
|
+
import { writeTextFile } from './basics/fileManager.mjs';
|
|
27
|
+
import { listFiles } from './basics/fileManager.mjs';
|
|
28
|
+
import { listDirs } from './basics/fileManager.mjs';
|
|
29
|
+
import { fileSize } from './basics/fileManager.mjs';
|
|
30
|
+
import { dirSize } from './basics/fileManager.mjs';
|
|
31
|
+
import { backupFile } from './basics/fileManager.mjs';
|
|
32
|
+
import { restoreLatestBackup } from './basics/fileManager.mjs';
|
|
33
|
+
import { renameFileBatch } from './basics/fileManager.mjs';
|
|
34
|
+
import { renameFileRegex } from './basics/fileManager.mjs';
|
|
35
|
+
import { renameFileAddPrefixSuffix } from './basics/fileManager.mjs';
|
|
36
|
+
import { renameFileNormalizeCase } from './basics/fileManager.mjs';
|
|
37
|
+
import { renameFilePadNumbers } from './basics/fileManager.mjs';
|
|
38
|
+
import { documentIsFullScreen } from './basics/fullScreen.mjs';
|
|
39
|
+
import { isScreenFilled } from './basics/fullScreen.mjs';
|
|
40
|
+
import { requestFullScreen } from './basics/fullScreen.mjs';
|
|
41
|
+
import { exitFullScreen } from './basics/fullScreen.mjs';
|
|
42
|
+
import { isFullScreenMode } from './basics/fullScreen.mjs';
|
|
43
|
+
import { onFullScreenChange } from './basics/fullScreen.mjs';
|
|
44
|
+
import { offFullScreenChange } from './basics/fullScreen.mjs';
|
|
45
|
+
import { areHtmlElsColliding } from './basics/html.mjs';
|
|
7
46
|
import { isJsonObject } from './basics/objFilter.mjs';
|
|
8
47
|
import arraySortPositions from '../legacy/libs/arraySortPositions.mjs';
|
|
9
48
|
import { formatBytes } from './basics/simpleMath.mjs';
|
|
@@ -25,5 +64,5 @@ import { getTimeDuration } from './basics/clock.mjs';
|
|
|
25
64
|
import { shuffleArray } from './basics/array.mjs';
|
|
26
65
|
import { toTitleCase } from './basics/text.mjs';
|
|
27
66
|
import { toTitleCaseLowerFirst } from './basics/text.mjs';
|
|
28
|
-
export { TinyToastNotify, TinyNotifyCenter, TinyRateLimiter, ColorSafeStringify, TinyPromiseQueue, TinyLevelUp, isJsonObject, arraySortPositions, formatBytes, addAiMarkerShortcut, extendObjType, reorderObjTypeOrder, cloneObjTypeOrder, countObj, checkObj, objType, ruleOfThree, getSimplePerc, asyncReplace, getAge, formatCustomTimer, formatDayTimer, formatTimer, getTimeDuration, shuffleArray, toTitleCase, toTitleCaseLowerFirst };
|
|
67
|
+
export { TinyDragger, TinyDragDropDetector, TinyToastNotify, TinyNotifyCenter, TinyRateLimiter, ColorSafeStringify, TinyPromiseQueue, TinyLevelUp, getHtmlElBorders, getHtmlElBordersWidth, getHtmlElMargin, getHtmlElPadding, getLatestBackupPath, fetchJson, readJsonBlob, saveJsonFile, readJsonFile, writeJsonFile, ensureDirectory, clearDirectory, fileExists, dirExists, isDirEmpty, ensureCopyFile, tryDeleteFile, writeTextFile, listFiles, listDirs, fileSize, dirSize, backupFile, restoreLatestBackup, renameFileBatch, renameFileRegex, renameFileAddPrefixSuffix, renameFileNormalizeCase, renameFilePadNumbers, documentIsFullScreen, isScreenFilled, requestFullScreen, exitFullScreen, isFullScreenMode, onFullScreenChange, offFullScreenChange, areHtmlElsColliding, isJsonObject, arraySortPositions, formatBytes, addAiMarkerShortcut, extendObjType, reorderObjTypeOrder, cloneObjTypeOrder, countObj, checkObj, objType, ruleOfThree, getSimplePerc, asyncReplace, getAge, formatCustomTimer, formatDayTimer, formatTimer, getTimeDuration, shuffleArray, toTitleCase, toTitleCaseLowerFirst };
|
|
29
68
|
//# sourceMappingURL=index.d.mts.map
|
package/dist/v1/index.mjs
CHANGED
|
@@ -4,6 +4,7 @@ import arraySortPositions from '../legacy/libs/arraySortPositions.mjs';
|
|
|
4
4
|
import { shuffleArray } from './basics/array.mjs';
|
|
5
5
|
import { formatCustomTimer, formatDayTimer, formatTimer, getTimeDuration, } from './basics/clock.mjs';
|
|
6
6
|
import { countObj, extendObjType, reorderObjTypeOrder, cloneObjTypeOrder, objType, checkObj, isJsonObject, } from './basics/objFilter.mjs';
|
|
7
|
+
import { documentIsFullScreen, isScreenFilled, requestFullScreen, exitFullScreen, isFullScreenMode, onFullScreenChange, offFullScreenChange, } from './basics/fullScreen.mjs';
|
|
7
8
|
import { formatBytes, getAge, getSimplePerc, ruleOfThree } from './basics/simpleMath.mjs';
|
|
8
9
|
import { addAiMarkerShortcut, toTitleCase, toTitleCaseLowerFirst } from './basics/text.mjs';
|
|
9
10
|
import ColorSafeStringify from './libs/ColorSafeStringify.mjs';
|
|
@@ -11,4 +12,8 @@ import TinyPromiseQueue from './libs/TinyPromiseQueue.mjs';
|
|
|
11
12
|
import TinyRateLimiter from './libs/TinyRateLimiter.mjs';
|
|
12
13
|
import TinyNotifyCenter from './libs/TinyNotifyCenter.mjs';
|
|
13
14
|
import TinyToastNotify from './libs/TinyToastNotify.mjs';
|
|
14
|
-
|
|
15
|
+
import { areHtmlElsColliding, readJsonBlob, saveJsonFile, fetchJson, getHtmlElBorders, getHtmlElBordersWidth, getHtmlElMargin, getHtmlElPadding, } from './basics/html.mjs';
|
|
16
|
+
import TinyDragDropDetector from './libs/TinyDragDropDetector.mjs';
|
|
17
|
+
import { readJsonFile, writeJsonFile, ensureDirectory, clearDirectory, fileExists, dirExists, isDirEmpty, ensureCopyFile, tryDeleteFile, writeTextFile, listFiles, listDirs, fileSize, dirSize, backupFile, restoreLatestBackup, renameFileBatch, renameFileRegex, renameFileAddPrefixSuffix, renameFileNormalizeCase, renameFilePadNumbers, getLatestBackupPath, } from './basics/fileManager.mjs';
|
|
18
|
+
import TinyDragger from './libs/TinyDragger.mjs';
|
|
19
|
+
export { TinyDragger, TinyDragDropDetector, TinyToastNotify, TinyNotifyCenter, TinyRateLimiter, ColorSafeStringify, TinyPromiseQueue, TinyLevelUp, getHtmlElBorders, getHtmlElBordersWidth, getHtmlElMargin, getHtmlElPadding, getLatestBackupPath, fetchJson, readJsonBlob, saveJsonFile, readJsonFile, writeJsonFile, ensureDirectory, clearDirectory, fileExists, dirExists, isDirEmpty, ensureCopyFile, tryDeleteFile, writeTextFile, listFiles, listDirs, fileSize, dirSize, backupFile, restoreLatestBackup, renameFileBatch, renameFileRegex, renameFileAddPrefixSuffix, renameFileNormalizeCase, renameFilePadNumbers, documentIsFullScreen, isScreenFilled, requestFullScreen, exitFullScreen, isFullScreenMode, onFullScreenChange, offFullScreenChange, areHtmlElsColliding, isJsonObject, arraySortPositions, formatBytes, addAiMarkerShortcut, extendObjType, reorderObjTypeOrder, cloneObjTypeOrder, countObj, checkObj, objType, ruleOfThree, getSimplePerc, asyncReplace, getAge, formatCustomTimer, formatDayTimer, formatTimer, getTimeDuration, shuffleArray, toTitleCase, toTitleCaseLowerFirst, };
|