tiny-essentials 1.28.0 → 1.28.1
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/changelog/1/28/1.md +23 -0
- package/dist/v1/TinyAdvancedRaffle.min.js +1 -1
- package/dist/v1/TinyAfterScrollWatcher.min.js +1 -1
- package/dist/v1/TinyAnalogClock.min.js +1 -1
- package/dist/v1/TinyBasicsEs.min.js +1 -1
- package/dist/v1/TinyDayNightCycle.min.js +1 -1
- package/dist/v1/TinyDragDropDetector.min.js +1 -1
- package/dist/v1/TinyDragger.min.js +1 -1
- package/dist/v1/TinyElementObserver.min.js +1 -1
- package/dist/v1/TinyEssentials.min.js +1 -1
- package/dist/v1/TinyGamepad.min.js +1 -1
- package/dist/v1/TinyHtml.min.js +1 -1
- package/dist/v1/TinyI18.min.js +1 -1
- package/dist/v1/TinyIframeEvents.min.js +1 -1
- package/dist/v1/TinyLocalStorage.min.js +1 -1
- package/dist/v1/TinyMediaPlayer.min.js +1 -1
- package/dist/v1/TinyNewWinEvents.min.js +1 -1
- package/dist/v1/TinyNotifyCenter.min.js +1 -1
- package/dist/v1/TinyRadioFm.min.js +1 -1
- package/dist/v1/TinyRateLimiter.min.js +1 -1
- package/dist/v1/TinySmartScroller.min.js +1 -1
- package/dist/v1/TinyTextDiffer.min.js +1 -1
- package/dist/v1/TinyTextarea.min.js +1 -1
- package/dist/v1/TinyTimeout.min.js +1 -1
- package/dist/v1/TinyToastNotify.min.js +1 -1
- package/dist/v1/TinyUploadClicker.min.js +1 -1
- package/dist/v1/UltraRandomMsgGen.min.js +1 -1
- package/dist/v1/basics/array.cjs +57 -9
- package/dist/v1/basics/array.d.mts +27 -11
- package/dist/v1/basics/array.mjs +51 -9
- package/dist/v1/basics/clock.cjs +94 -42
- package/dist/v1/basics/clock.d.mts +10 -10
- package/dist/v1/basics/clock.mjs +91 -54
- package/dist/v1/basics/deprecated/html.cjs +246 -0
- package/dist/v1/basics/deprecated/html.d.mts +63 -0
- package/dist/v1/basics/deprecated/html.mjs +190 -0
- package/dist/v1/basics/html.cjs +149 -130
- package/dist/v1/basics/html.d.mts +26 -61
- package/dist/v1/basics/html.mjs +113 -105
- package/dist/v1/basics/index.cjs +2 -0
- package/dist/v1/basics/index.d.mts +3 -1
- package/dist/v1/basics/index.mjs +3 -3
- package/dist/v1/basics/mediaContent.cjs +51 -9
- package/dist/v1/basics/mediaContent.d.mts +0 -87
- package/dist/v1/basics/mediaContent.mjs +40 -10
- package/dist/v1/basics/objChecker.cjs +7 -5
- package/dist/v1/basics/objChecker.d.mts +3 -2
- package/dist/v1/basics/objChecker.mjs +6 -6
- package/dist/v1/basics/objFilter.cjs +40 -7
- package/dist/v1/basics/objFilter.d.mts +6 -6
- package/dist/v1/basics/objFilter.mjs +32 -7
- package/dist/v1/basics/simpleMath.cjs +81 -25
- package/dist/v1/basics/simpleMath.d.mts +2 -2
- package/dist/v1/basics/simpleMath.mjs +70 -27
- package/dist/v1/basics/text.cjs +76 -31
- package/dist/v1/basics/text.d.mts +69 -7
- package/dist/v1/basics/text.mjs +62 -31
- package/dist/v1/index.cjs +4 -0
- package/dist/v1/index.d.mts +4 -1
- package/dist/v1/index.mjs +4 -3
- package/dist/v1/libs/TinyAdvancedRaffle.cjs +64 -50
- package/dist/v1/libs/TinyAdvancedRaffle.d.mts +4 -13
- package/dist/v1/libs/TinyAdvancedRaffle.mjs +62 -49
- package/dist/v1/libs/TinyAfterScrollWatcher.cjs +17 -1
- package/dist/v1/libs/TinyAfterScrollWatcher.d.mts +4 -1
- package/dist/v1/libs/TinyAfterScrollWatcher.mjs +15 -1
- package/dist/v1/libs/TinyAnalogClock.cjs +60 -0
- package/dist/v1/libs/TinyAnalogClock.d.mts +6 -0
- package/dist/v1/libs/TinyAnalogClock.mjs +57 -0
- package/dist/v1/libs/TinyClipboard.cjs +2 -0
- package/dist/v1/libs/TinyClipboard.d.mts +4 -2
- package/dist/v1/libs/TinyClipboard.mjs +2 -0
- package/dist/v1/libs/TinyColorConverter.cjs +1 -0
- package/dist/v1/libs/TinyColorConverter.d.mts +2 -1
- package/dist/v1/libs/TinyColorConverter.mjs +1 -0
- package/dist/v1/libs/TinyDayNightCycle.cjs +67 -42
- package/dist/v1/libs/TinyDayNightCycle.d.mts +2 -7
- package/dist/v1/libs/TinyDayNightCycle.mjs +65 -41
- package/dist/v1/libs/TinyDragDropDetector.cjs +25 -0
- package/dist/v1/libs/TinyDragDropDetector.d.mts +6 -0
- package/dist/v1/libs/TinyDragDropDetector.mjs +22 -0
- package/dist/v1/libs/TinyDragger.cjs +46 -19
- package/dist/v1/libs/TinyDragger.mjs +45 -18
- package/dist/v1/libs/TinyElementObserver.cjs +39 -0
- package/dist/v1/libs/TinyElementObserver.d.mts +6 -0
- package/dist/v1/libs/TinyElementObserver.mjs +36 -0
- package/dist/v1/libs/TinyGamepad.cjs +131 -1
- package/dist/v1/libs/TinyGamepad.mjs +129 -1
- package/dist/v1/libs/TinyHtml.cjs +1 -1
- package/dist/v1/libs/TinyHtml.mjs +2 -2
- package/dist/v1/libs/TinyI18.cjs +61 -0
- package/dist/v1/libs/TinyI18.d.mts +14 -0
- package/dist/v1/libs/TinyI18.mjs +55 -0
- package/dist/v1/libs/TinyIframeEvents.cjs +18 -1
- package/dist/v1/libs/TinyIframeEvents.mjs +18 -1
- package/dist/v1/libs/TinyLocalStorage.cjs +48 -0
- package/dist/v1/libs/TinyLocalStorage.d.mts +6 -0
- package/dist/v1/libs/TinyLocalStorage.mjs +45 -0
- package/dist/v1/libs/TinyMediaPlayer.cjs +72 -0
- package/dist/v1/libs/TinyMediaPlayer.d.mts +10 -0
- package/dist/v1/libs/TinyMediaPlayer.mjs +66 -0
- package/dist/v1/libs/TinyNewWinEvents.cjs +29 -0
- package/dist/v1/libs/TinyNewWinEvents.d.mts +6 -0
- package/dist/v1/libs/TinyNewWinEvents.mjs +26 -0
- package/dist/v1/libs/TinyNotifyCenter.cjs +36 -0
- package/dist/v1/libs/TinyNotifyCenter.d.mts +6 -0
- package/dist/v1/libs/TinyNotifyCenter.mjs +32 -0
- package/dist/v1/libs/TinyRadioFm.cjs +38 -0
- package/dist/v1/libs/TinyRadioFm.d.mts +1 -0
- package/dist/v1/libs/TinyRadioFm.mjs +35 -0
- package/dist/v1/libs/TinyRateLimiter.cjs +52 -0
- package/dist/v1/libs/TinyRateLimiter.d.mts +6 -0
- package/dist/v1/libs/TinyRateLimiter.mjs +48 -0
- package/dist/v1/libs/TinySmartScroller.cjs +52 -3
- package/dist/v1/libs/TinySmartScroller.d.mts +17 -15
- package/dist/v1/libs/TinySmartScroller.mjs +51 -5
- package/dist/v1/libs/TinyTextDiffer.cjs +19 -18
- package/dist/v1/libs/TinyTextDiffer.d.mts +1 -0
- package/dist/v1/libs/TinyTextDiffer.mjs +16 -17
- package/dist/v1/libs/TinyTextarea.cjs +19 -0
- package/dist/v1/libs/TinyTextarea.d.mts +6 -0
- package/dist/v1/libs/TinyTextarea.mjs +17 -0
- package/dist/v1/libs/TinyTimeout.cjs +11 -1
- package/dist/v1/libs/TinyTimeout.mjs +9 -1
- package/dist/v1/libs/TinyToastNotify.cjs +35 -0
- package/dist/v1/libs/TinyToastNotify.d.mts +6 -0
- package/dist/v1/libs/TinyToastNotify.mjs +31 -0
- package/dist/v1/libs/TinyUploadClicker.cjs +19 -0
- package/dist/v1/libs/TinyUploadClicker.d.mts +6 -0
- package/dist/v1/libs/TinyUploadClicker.mjs +17 -0
- package/dist/v1/libs/UltraRandomMsgGen.cjs +148 -35
- package/dist/v1/libs/UltraRandomMsgGen.d.mts +17 -3
- package/dist/v1/libs/UltraRandomMsgGen.mjs +133 -34
- package/dist/v1/libs/utils.cjs +21 -0
- package/dist/v1/libs/utils.d.mts +2 -0
- package/dist/v1/libs/utils.mjs +16 -0
- package/docs/v1/README.md +1 -0
- package/docs/v1/basics/array.md +2 -2
- package/docs/v1/basics/deprecated/html.md +17 -0
- package/docs/v1/basics/fullScreen.md +1 -1
- package/docs/v1/basics/html.md +12 -26
- package/docs/v1/basics/mediaContent.md +1 -1
- package/docs/v1/basics/objChecker.md +1 -1
- package/docs/v1/basics/text.md +2 -2
- package/docs/v1/fileManager/main.md +1 -1
- package/docs/v1/libs/ColorSafeStringify.md +1 -1
- package/docs/v1/libs/TinyAfterScrollWatcher.md +1 -1
- package/docs/v1/libs/TinyAnalogClock.md +1 -1
- package/docs/v1/libs/TinyArrayComparator.md +1 -1
- package/docs/v1/libs/TinyArrayPaginator.md +1 -1
- package/docs/v1/libs/TinyClassManager/TinyPluginInliner.md +2 -2
- package/docs/v1/libs/TinyClassManager.md +1 -1
- package/docs/v1/libs/TinyClipboard.md +1 -1
- package/docs/v1/libs/TinyCookieConsent.md +1 -1
- package/docs/v1/libs/TinyDomReadyManager.md +1 -1
- package/docs/v1/libs/TinyDragDropDetector.md +1 -1
- package/docs/v1/libs/TinyDragger.md +1 -1
- package/docs/v1/libs/TinyElementObserver.md +1 -1
- package/docs/v1/libs/TinyHtml.md +1 -1
- package/docs/v1/libs/TinyIframeEvents.md +2 -2
- package/docs/v1/libs/TinyLevelUp.md +1 -1
- package/docs/v1/libs/TinyLoadingScreen.md +1 -1
- package/docs/v1/libs/TinyNewWinEvents.md +2 -2
- package/docs/v1/libs/TinyNotifications.md +1 -1
- package/docs/v1/libs/TinyPromiseQueue.md +2 -2
- package/docs/v1/libs/TinyTextDiffer.md +1 -1
- package/docs/v1/libs/TinyTextarea.md +1 -1
- package/package.json +10 -1
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { createCheckDestroyed } from './utils.mjs';
|
|
2
|
+
const checkDestroy = createCheckDestroyed('TinyAnalogClock');
|
|
1
3
|
/**
|
|
2
4
|
* Configuration object for the Analog Clock.
|
|
3
5
|
* @typedef {Object} ClockConfig
|
|
@@ -32,6 +34,19 @@ class TinyAnalogClock {
|
|
|
32
34
|
#config;
|
|
33
35
|
/** @type {number|null} */
|
|
34
36
|
#animationFrame = null;
|
|
37
|
+
/**
|
|
38
|
+
* Tracks whether the instance has been destroyed.
|
|
39
|
+
* @type {boolean}
|
|
40
|
+
*/
|
|
41
|
+
#destroyed = false;
|
|
42
|
+
/**
|
|
43
|
+
* Gets the current destruction status of the instance.
|
|
44
|
+
*
|
|
45
|
+
* @returns {boolean} True if the instance is destroyed, false otherwise.
|
|
46
|
+
*/
|
|
47
|
+
get destroyed() {
|
|
48
|
+
return this.#destroyed;
|
|
49
|
+
}
|
|
35
50
|
/**
|
|
36
51
|
* Retrieves the current date and extracts the specific hour, minute, and second components.
|
|
37
52
|
* @returns {{ now: Date, s: number, m: number, h: number }}
|
|
@@ -297,6 +312,7 @@ class TinyAnalogClock {
|
|
|
297
312
|
* @returns {HTMLElement} The clock container.
|
|
298
313
|
*/
|
|
299
314
|
get element() {
|
|
315
|
+
checkDestroy(this.#destroyed);
|
|
300
316
|
return this.#element;
|
|
301
317
|
}
|
|
302
318
|
/**
|
|
@@ -305,6 +321,7 @@ class TinyAnalogClock {
|
|
|
305
321
|
* @throws {Error} If value is not a positive number.
|
|
306
322
|
*/
|
|
307
323
|
set size(value) {
|
|
324
|
+
checkDestroy(this.#destroyed);
|
|
308
325
|
if (typeof value !== 'number' || value <= 0 || isNaN(value)) {
|
|
309
326
|
throw new Error(`TinyAnalogClock: 'size' must be a positive number. Received: ${value}`);
|
|
310
327
|
}
|
|
@@ -316,6 +333,7 @@ class TinyAnalogClock {
|
|
|
316
333
|
* @returns {number}
|
|
317
334
|
*/
|
|
318
335
|
get size() {
|
|
336
|
+
checkDestroy(this.#destroyed);
|
|
319
337
|
return this.#config.size;
|
|
320
338
|
}
|
|
321
339
|
/**
|
|
@@ -324,6 +342,7 @@ class TinyAnalogClock {
|
|
|
324
342
|
* @throws {Error} If value is not a string or null.
|
|
325
343
|
*/
|
|
326
344
|
set skinUrl(url) {
|
|
345
|
+
checkDestroy(this.#destroyed);
|
|
327
346
|
if (url !== null && typeof url !== 'string') {
|
|
328
347
|
throw new Error(`TinyAnalogClock: 'skin' must be a URL string or null. Received type: ${typeof url}`);
|
|
329
348
|
}
|
|
@@ -335,6 +354,7 @@ class TinyAnalogClock {
|
|
|
335
354
|
* @returns {string|null}
|
|
336
355
|
*/
|
|
337
356
|
get skinUrl() {
|
|
357
|
+
checkDestroy(this.#destroyed);
|
|
338
358
|
return this.#config.skinUrl;
|
|
339
359
|
}
|
|
340
360
|
/**
|
|
@@ -343,6 +363,7 @@ class TinyAnalogClock {
|
|
|
343
363
|
* @throws {Error} If value is not a non-empty string.
|
|
344
364
|
*/
|
|
345
365
|
set borderColor(color) {
|
|
366
|
+
checkDestroy(this.#destroyed);
|
|
346
367
|
if (typeof color !== 'string' || color.trim() === '') {
|
|
347
368
|
throw new Error(`TinyAnalogClock: 'borderColor' must be a non-empty string. Received: ${color}`);
|
|
348
369
|
}
|
|
@@ -355,6 +376,7 @@ class TinyAnalogClock {
|
|
|
355
376
|
* @returns {string}
|
|
356
377
|
*/
|
|
357
378
|
get borderColor() {
|
|
379
|
+
checkDestroy(this.#destroyed);
|
|
358
380
|
return this.#config.borderColor;
|
|
359
381
|
}
|
|
360
382
|
/**
|
|
@@ -363,6 +385,7 @@ class TinyAnalogClock {
|
|
|
363
385
|
* @throws {Error} If value is not a non-empty string.
|
|
364
386
|
*/
|
|
365
387
|
set markColor(color) {
|
|
388
|
+
checkDestroy(this.#destroyed);
|
|
366
389
|
if (typeof color !== 'string' || color.trim() === '') {
|
|
367
390
|
throw new Error(`TinyAnalogClock: 'markColor' must be a non-empty string. Received: ${color}`);
|
|
368
391
|
}
|
|
@@ -375,6 +398,7 @@ class TinyAnalogClock {
|
|
|
375
398
|
* @returns {string}
|
|
376
399
|
*/
|
|
377
400
|
get markColor() {
|
|
401
|
+
checkDestroy(this.#destroyed);
|
|
378
402
|
return this.#config.markColor;
|
|
379
403
|
}
|
|
380
404
|
/**
|
|
@@ -383,6 +407,7 @@ class TinyAnalogClock {
|
|
|
383
407
|
* @throws {Error} If value is not a non-empty string.
|
|
384
408
|
*/
|
|
385
409
|
set textColor(color) {
|
|
410
|
+
checkDestroy(this.#destroyed);
|
|
386
411
|
if (typeof color !== 'string' || color.trim() === '') {
|
|
387
412
|
throw new Error(`TinyAnalogClock: 'textColor' must be a non-empty string. Received: ${color}`);
|
|
388
413
|
}
|
|
@@ -395,6 +420,7 @@ class TinyAnalogClock {
|
|
|
395
420
|
* @returns {string}
|
|
396
421
|
*/
|
|
397
422
|
get textColor() {
|
|
423
|
+
checkDestroy(this.#destroyed);
|
|
398
424
|
return this.#config.textColor;
|
|
399
425
|
}
|
|
400
426
|
/**
|
|
@@ -403,6 +429,7 @@ class TinyAnalogClock {
|
|
|
403
429
|
* @throws {Error} If value is not a boolean.
|
|
404
430
|
*/
|
|
405
431
|
set showNumbers(value) {
|
|
432
|
+
checkDestroy(this.#destroyed);
|
|
406
433
|
if (typeof value !== 'boolean') {
|
|
407
434
|
throw new Error(`TinyAnalogClock: 'showNumbers' must be a boolean. Received type: ${typeof value}`);
|
|
408
435
|
}
|
|
@@ -414,6 +441,7 @@ class TinyAnalogClock {
|
|
|
414
441
|
* @returns {boolean}
|
|
415
442
|
*/
|
|
416
443
|
get showNumbers() {
|
|
444
|
+
checkDestroy(this.#destroyed);
|
|
417
445
|
return this.#config.showNumbers;
|
|
418
446
|
}
|
|
419
447
|
/**
|
|
@@ -421,6 +449,7 @@ class TinyAnalogClock {
|
|
|
421
449
|
* @param {string} value
|
|
422
450
|
*/
|
|
423
451
|
set bgColor(value) {
|
|
452
|
+
checkDestroy(this.#destroyed);
|
|
424
453
|
if (typeof value !== 'string' || !value)
|
|
425
454
|
throw new Error("TinyAnalogClock: 'bgColor' must be a non-empty string.");
|
|
426
455
|
this.#config.bgColor = value;
|
|
@@ -431,6 +460,7 @@ class TinyAnalogClock {
|
|
|
431
460
|
* @returns {string}
|
|
432
461
|
*/
|
|
433
462
|
get bgColor() {
|
|
463
|
+
checkDestroy(this.#destroyed);
|
|
434
464
|
return this.#config.bgColor;
|
|
435
465
|
}
|
|
436
466
|
/**
|
|
@@ -438,6 +468,7 @@ class TinyAnalogClock {
|
|
|
438
468
|
* @param {number} value
|
|
439
469
|
*/
|
|
440
470
|
set borderWidth(value) {
|
|
471
|
+
checkDestroy(this.#destroyed);
|
|
441
472
|
if (typeof value !== 'number' || value < 0)
|
|
442
473
|
throw new Error("TinyAnalogClock: 'borderWidth' must be a non-negative number.");
|
|
443
474
|
this.#config.borderWidth = value;
|
|
@@ -449,6 +480,7 @@ class TinyAnalogClock {
|
|
|
449
480
|
* @returns {number}
|
|
450
481
|
*/
|
|
451
482
|
get borderWidth() {
|
|
483
|
+
checkDestroy(this.#destroyed);
|
|
452
484
|
return this.#config.borderWidth;
|
|
453
485
|
}
|
|
454
486
|
/**
|
|
@@ -456,6 +488,7 @@ class TinyAnalogClock {
|
|
|
456
488
|
* @param {string} value
|
|
457
489
|
*/
|
|
458
490
|
set hourHandColor(value) {
|
|
491
|
+
checkDestroy(this.#destroyed);
|
|
459
492
|
if (typeof value !== 'string' || !value)
|
|
460
493
|
throw new Error("TinyAnalogClock: 'hourHandColor' must be a non-empty string.");
|
|
461
494
|
this.#config.hourHandColor = value;
|
|
@@ -466,6 +499,7 @@ class TinyAnalogClock {
|
|
|
466
499
|
* @returns {string}
|
|
467
500
|
*/
|
|
468
501
|
get hourHandColor() {
|
|
502
|
+
checkDestroy(this.#destroyed);
|
|
469
503
|
return this.#config.hourHandColor;
|
|
470
504
|
}
|
|
471
505
|
/**
|
|
@@ -473,6 +507,7 @@ class TinyAnalogClock {
|
|
|
473
507
|
* @param {string} value
|
|
474
508
|
*/
|
|
475
509
|
set minuteHandColor(value) {
|
|
510
|
+
checkDestroy(this.#destroyed);
|
|
476
511
|
if (typeof value !== 'string' || !value)
|
|
477
512
|
throw new Error("TinyAnalogClock: 'minuteHandColor' must be a non-empty string.");
|
|
478
513
|
this.#config.minuteHandColor = value;
|
|
@@ -483,6 +518,7 @@ class TinyAnalogClock {
|
|
|
483
518
|
* @returns {string}
|
|
484
519
|
*/
|
|
485
520
|
get minuteHandColor() {
|
|
521
|
+
checkDestroy(this.#destroyed);
|
|
486
522
|
return this.#config.minuteHandColor;
|
|
487
523
|
}
|
|
488
524
|
/**
|
|
@@ -490,6 +526,7 @@ class TinyAnalogClock {
|
|
|
490
526
|
* @param {string} value
|
|
491
527
|
*/
|
|
492
528
|
set secondHandColor(value) {
|
|
529
|
+
checkDestroy(this.#destroyed);
|
|
493
530
|
if (typeof value !== 'string' || !value)
|
|
494
531
|
throw new Error("TinyAnalogClock: 'secondHandColor' must be a non-empty string.");
|
|
495
532
|
this.#config.secondHandColor = value;
|
|
@@ -500,6 +537,7 @@ class TinyAnalogClock {
|
|
|
500
537
|
* @returns {string}
|
|
501
538
|
*/
|
|
502
539
|
get secondHandColor() {
|
|
540
|
+
checkDestroy(this.#destroyed);
|
|
503
541
|
return this.#config.secondHandColor;
|
|
504
542
|
}
|
|
505
543
|
/**
|
|
@@ -507,6 +545,7 @@ class TinyAnalogClock {
|
|
|
507
545
|
* @param {boolean} value
|
|
508
546
|
*/
|
|
509
547
|
set showSeconds(value) {
|
|
548
|
+
checkDestroy(this.#destroyed);
|
|
510
549
|
if (typeof value !== 'boolean')
|
|
511
550
|
throw new Error("TinyAnalogClock: 'showSeconds' must be a boolean.");
|
|
512
551
|
this.#config.showSeconds = value;
|
|
@@ -517,6 +556,7 @@ class TinyAnalogClock {
|
|
|
517
556
|
* @returns {boolean}
|
|
518
557
|
*/
|
|
519
558
|
get showSeconds() {
|
|
559
|
+
checkDestroy(this.#destroyed);
|
|
520
560
|
return this.#config.showSeconds;
|
|
521
561
|
}
|
|
522
562
|
/**
|
|
@@ -524,6 +564,7 @@ class TinyAnalogClock {
|
|
|
524
564
|
* @param {number} value - Positive number.
|
|
525
565
|
*/
|
|
526
566
|
set sizeAdjust(value) {
|
|
567
|
+
checkDestroy(this.#destroyed);
|
|
527
568
|
if (typeof value !== 'number' || value <= 0)
|
|
528
569
|
throw new Error("TinyAnalogClock: 'sizeAdjust' must be a positive number.");
|
|
529
570
|
this.#config.sizeAdjust = value;
|
|
@@ -534,6 +575,7 @@ class TinyAnalogClock {
|
|
|
534
575
|
* @returns {number}
|
|
535
576
|
*/
|
|
536
577
|
get sizeAdjust() {
|
|
578
|
+
checkDestroy(this.#destroyed);
|
|
537
579
|
return this.#config.sizeAdjust;
|
|
538
580
|
}
|
|
539
581
|
/**
|
|
@@ -541,6 +583,7 @@ class TinyAnalogClock {
|
|
|
541
583
|
* @param {number} value - Non-negative number in pixels.
|
|
542
584
|
*/
|
|
543
585
|
set padding(value) {
|
|
586
|
+
checkDestroy(this.#destroyed);
|
|
544
587
|
if (typeof value !== 'number' || value < 0)
|
|
545
588
|
throw new Error("TinyAnalogClock: 'padding' must be a non-negative number.");
|
|
546
589
|
this.#config.padding = value;
|
|
@@ -551,6 +594,7 @@ class TinyAnalogClock {
|
|
|
551
594
|
* @returns {number}
|
|
552
595
|
*/
|
|
553
596
|
get padding() {
|
|
597
|
+
checkDestroy(this.#destroyed);
|
|
554
598
|
return this.#config.padding;
|
|
555
599
|
}
|
|
556
600
|
/**
|
|
@@ -558,6 +602,7 @@ class TinyAnalogClock {
|
|
|
558
602
|
* @param {number} value - Positive number.
|
|
559
603
|
*/
|
|
560
604
|
set angleDistance(value) {
|
|
605
|
+
checkDestroy(this.#destroyed);
|
|
561
606
|
if (typeof value !== 'number' || value <= 0)
|
|
562
607
|
throw new Error("TinyAnalogClock: 'angleDistance' must be a positive number.");
|
|
563
608
|
this.#config.angleDistance = value;
|
|
@@ -568,6 +613,7 @@ class TinyAnalogClock {
|
|
|
568
613
|
* @returns {number}
|
|
569
614
|
*/
|
|
570
615
|
get angleDistance() {
|
|
616
|
+
checkDestroy(this.#destroyed);
|
|
571
617
|
return this.#config.angleDistance;
|
|
572
618
|
}
|
|
573
619
|
/**
|
|
@@ -575,6 +621,7 @@ class TinyAnalogClock {
|
|
|
575
621
|
* @param {number} value - Positive number.
|
|
576
622
|
*/
|
|
577
623
|
set pwH(value) {
|
|
624
|
+
checkDestroy(this.#destroyed);
|
|
578
625
|
if (typeof value !== 'number' || value <= 0)
|
|
579
626
|
throw new Error("TinyAnalogClock: 'pwH' must be a positive number.");
|
|
580
627
|
this.#config.pwH = value;
|
|
@@ -585,6 +632,7 @@ class TinyAnalogClock {
|
|
|
585
632
|
* @returns {number}
|
|
586
633
|
*/
|
|
587
634
|
get pwH() {
|
|
635
|
+
checkDestroy(this.#destroyed);
|
|
588
636
|
return this.#config.pwH;
|
|
589
637
|
}
|
|
590
638
|
/**
|
|
@@ -592,6 +640,7 @@ class TinyAnalogClock {
|
|
|
592
640
|
* @param {number} value - Positive number.
|
|
593
641
|
*/
|
|
594
642
|
set phH(value) {
|
|
643
|
+
checkDestroy(this.#destroyed);
|
|
595
644
|
if (typeof value !== 'number' || value <= 0)
|
|
596
645
|
throw new Error("TinyAnalogClock: 'phH' must be a positive number.");
|
|
597
646
|
this.#config.phH = value;
|
|
@@ -602,6 +651,7 @@ class TinyAnalogClock {
|
|
|
602
651
|
* @returns {number}
|
|
603
652
|
*/
|
|
604
653
|
get phH() {
|
|
654
|
+
checkDestroy(this.#destroyed);
|
|
605
655
|
return this.#config.phH;
|
|
606
656
|
}
|
|
607
657
|
/**
|
|
@@ -609,6 +659,7 @@ class TinyAnalogClock {
|
|
|
609
659
|
* @param {number} value - Positive number.
|
|
610
660
|
*/
|
|
611
661
|
set pwM(value) {
|
|
662
|
+
checkDestroy(this.#destroyed);
|
|
612
663
|
if (typeof value !== 'number' || value <= 0)
|
|
613
664
|
throw new Error("TinyAnalogClock: 'pwM' must be a positive number.");
|
|
614
665
|
this.#config.pwM = value;
|
|
@@ -619,6 +670,7 @@ class TinyAnalogClock {
|
|
|
619
670
|
* @returns {number}
|
|
620
671
|
*/
|
|
621
672
|
get pwM() {
|
|
673
|
+
checkDestroy(this.#destroyed);
|
|
622
674
|
return this.#config.pwM;
|
|
623
675
|
}
|
|
624
676
|
/**
|
|
@@ -626,6 +678,7 @@ class TinyAnalogClock {
|
|
|
626
678
|
* @param {number} value - Positive number.
|
|
627
679
|
*/
|
|
628
680
|
set phM(value) {
|
|
681
|
+
checkDestroy(this.#destroyed);
|
|
629
682
|
if (typeof value !== 'number' || value <= 0)
|
|
630
683
|
throw new Error("TinyAnalogClock: 'phM' must be a positive number.");
|
|
631
684
|
this.#config.phM = value;
|
|
@@ -636,6 +689,7 @@ class TinyAnalogClock {
|
|
|
636
689
|
* @returns {number}
|
|
637
690
|
*/
|
|
638
691
|
get phM() {
|
|
692
|
+
checkDestroy(this.#destroyed);
|
|
639
693
|
return this.#config.phM;
|
|
640
694
|
}
|
|
641
695
|
/**
|
|
@@ -643,11 +697,14 @@ class TinyAnalogClock {
|
|
|
643
697
|
* @returns {void}
|
|
644
698
|
*/
|
|
645
699
|
destroy() {
|
|
700
|
+
if (this.#destroyed)
|
|
701
|
+
return;
|
|
646
702
|
if (this.#animationFrame) {
|
|
647
703
|
cancelAnimationFrame(this.#animationFrame);
|
|
648
704
|
this.#animationFrame = null;
|
|
649
705
|
}
|
|
650
706
|
this.#element.remove();
|
|
707
|
+
this.#destroyed = true;
|
|
651
708
|
}
|
|
652
709
|
}
|
|
653
710
|
export default TinyAnalogClock;
|
|
@@ -165,6 +165,7 @@ class TinyClipboard {
|
|
|
165
165
|
* @param {string|null} [mimeFormat=null] - MIME type or prefix.
|
|
166
166
|
* @param {boolean} [fixValue=false] - If true, exact match on MIME type.
|
|
167
167
|
* @returns {Promise<Blob|string|Array<Blob|string>|null>} A promise resolving with matching data.
|
|
168
|
+
* @private
|
|
168
169
|
*/
|
|
169
170
|
_readData(index = 0, type = null, mimeFormat = null, fixValue = false) {
|
|
170
171
|
return new Promise((resolve, reject) => {
|
|
@@ -326,6 +327,7 @@ class TinyClipboard {
|
|
|
326
327
|
*
|
|
327
328
|
* @param {number|null} index - Index of the item to retrieve or null to get all.
|
|
328
329
|
* @returns {Promise<ClipboardItem|ClipboardItems|null>} A promise resolving with a clipboard item or array of items.
|
|
330
|
+
* @private
|
|
329
331
|
*/
|
|
330
332
|
_read(index) {
|
|
331
333
|
return new Promise((resolve, reject) => {
|
|
@@ -62,8 +62,9 @@ declare class TinyClipboard {
|
|
|
62
62
|
* @param {string|null} [mimeFormat=null] - MIME type or prefix.
|
|
63
63
|
* @param {boolean} [fixValue=false] - If true, exact match on MIME type.
|
|
64
64
|
* @returns {Promise<Blob|string|Array<Blob|string>|null>} A promise resolving with matching data.
|
|
65
|
+
* @private
|
|
65
66
|
*/
|
|
66
|
-
_readData
|
|
67
|
+
private _readData;
|
|
67
68
|
/**
|
|
68
69
|
* Read plain text from the clipboard (single item by index).
|
|
69
70
|
*
|
|
@@ -107,8 +108,9 @@ declare class TinyClipboard {
|
|
|
107
108
|
*
|
|
108
109
|
* @param {number|null} index - Index of the item to retrieve or null to get all.
|
|
109
110
|
* @returns {Promise<ClipboardItem|ClipboardItems|null>} A promise resolving with a clipboard item or array of items.
|
|
111
|
+
* @private
|
|
110
112
|
*/
|
|
111
|
-
_read
|
|
113
|
+
private _read;
|
|
112
114
|
/**
|
|
113
115
|
* Read clipboard data at a specific index.
|
|
114
116
|
*
|
|
@@ -152,6 +152,7 @@ class TinyClipboard {
|
|
|
152
152
|
* @param {string|null} [mimeFormat=null] - MIME type or prefix.
|
|
153
153
|
* @param {boolean} [fixValue=false] - If true, exact match on MIME type.
|
|
154
154
|
* @returns {Promise<Blob|string|Array<Blob|string>|null>} A promise resolving with matching data.
|
|
155
|
+
* @private
|
|
155
156
|
*/
|
|
156
157
|
_readData(index = 0, type = null, mimeFormat = null, fixValue = false) {
|
|
157
158
|
return new Promise((resolve, reject) => {
|
|
@@ -307,6 +308,7 @@ class TinyClipboard {
|
|
|
307
308
|
*
|
|
308
309
|
* @param {number|null} index - Index of the item to retrieve or null to get all.
|
|
309
310
|
* @returns {Promise<ClipboardItem|ClipboardItems|null>} A promise resolving with a clipboard item or array of items.
|
|
311
|
+
* @private
|
|
310
312
|
*/
|
|
311
313
|
_read(index) {
|
|
312
314
|
return new Promise((resolve, reject) => {
|
|
@@ -94,6 +94,7 @@ class TinyColorConverter {
|
|
|
94
94
|
* @param {'rgb'|'hex'|'hsl'} [type='rgb'] - The format of the colors returned: `'rgb'`, `'hex'`, or `'hsl'`.
|
|
95
95
|
* @param {boolean} [pastel=false] - If true, generates pastel tones by adjusting the intensity and offset.
|
|
96
96
|
* @returns {Array<RgbResult|HexResult|HslResult>} An array of color values in the selected format:
|
|
97
|
+
* @private
|
|
97
98
|
*/
|
|
98
99
|
static _rca(len, type, pastel) {
|
|
99
100
|
let eq1 = 127;
|
|
@@ -164,8 +164,9 @@ declare class TinyColorConverter {
|
|
|
164
164
|
* @param {'rgb'|'hex'|'hsl'} [type='rgb'] - The format of the colors returned: `'rgb'`, `'hex'`, or `'hsl'`.
|
|
165
165
|
* @param {boolean} [pastel=false] - If true, generates pastel tones by adjusting the intensity and offset.
|
|
166
166
|
* @returns {Array<RgbResult|HexResult|HslResult>} An array of color values in the selected format:
|
|
167
|
+
* @private
|
|
167
168
|
*/
|
|
168
|
-
static _rca
|
|
169
|
+
private static _rca;
|
|
169
170
|
/**
|
|
170
171
|
* Generates a smooth gradient of colors based on sine wave patterns.
|
|
171
172
|
*
|
|
@@ -82,6 +82,7 @@ class TinyColorConverter {
|
|
|
82
82
|
* @param {'rgb'|'hex'|'hsl'} [type='rgb'] - The format of the colors returned: `'rgb'`, `'hex'`, or `'hsl'`.
|
|
83
83
|
* @param {boolean} [pastel=false] - If true, generates pastel tones by adjusting the intensity and offset.
|
|
84
84
|
* @returns {Array<RgbResult|HexResult|HslResult>} An array of color values in the selected format:
|
|
85
|
+
* @private
|
|
85
86
|
*/
|
|
86
87
|
static _rca(len, type, pastel) {
|
|
87
88
|
let eq1 = 127;
|