tiny-essentials 1.28.0 → 1.28.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/changelog/1/28/1.md +23 -0
- package/changelog/1/28/2.md +43 -0
- package/dist/_/numbers.d.mts +91 -16
- 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 +28 -12
- package/dist/v1/basics/array.mjs +51 -9
- package/dist/v1/basics/clock.cjs +94 -42
- package/dist/v1/basics/clock.d.mts +22 -22
- package/dist/v1/basics/clock.mjs +91 -54
- package/dist/v1/basics/collision.d.mts +245 -104
- 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/extendObjType/Buffer.d.mts +1 -1
- package/dist/v1/basics/fullScreen.d.mts +47 -7
- package/dist/v1/basics/html.cjs +149 -130
- package/dist/v1/basics/html.d.mts +69 -113
- package/dist/v1/basics/html.mjs +113 -105
- package/dist/v1/basics/index.cjs +2 -0
- package/dist/v1/basics/index.d.mts +11 -65
- package/dist/v1/basics/index.mjs +3 -3
- package/dist/v1/basics/mediaContent.cjs +116 -32
- package/dist/v1/basics/mediaContent.d.mts +143 -159
- package/dist/v1/basics/mediaContent.mjs +105 -33
- package/dist/v1/basics/objChecker.cjs +7 -5
- package/dist/v1/basics/objChecker.d.mts +5 -4
- package/dist/v1/basics/objChecker.mjs +6 -6
- package/dist/v1/basics/objFilter.cjs +71 -14
- package/dist/v1/basics/objFilter.d.mts +16 -19
- package/dist/v1/basics/objFilter.mjs +63 -14
- package/dist/v1/basics/simpleMath.cjs +81 -25
- package/dist/v1/basics/simpleMath.d.mts +22 -22
- package/dist/v1/basics/simpleMath.mjs +70 -27
- package/dist/v1/basics/text.cjs +76 -31
- package/dist/v1/basics/text.d.mts +64 -14
- package/dist/v1/basics/text.mjs +62 -31
- package/dist/v1/build/ColorSafeStringify.d.mts +1 -1
- package/dist/v1/build/TinyAdvancedRaffle.d.mts +1 -1
- package/dist/v1/build/TinyAfterScrollWatcher.d.mts +1 -1
- package/dist/v1/build/TinyAnalogClock.d.mts +1 -1
- package/dist/v1/build/TinyArrayComparator.d.mts +1 -1
- package/dist/v1/build/TinyArrayPaginator.d.mts +1 -1
- package/dist/v1/build/TinyClassManager.d.mts +1 -1
- package/dist/v1/build/TinyClipboard.d.mts +1 -1
- package/dist/v1/build/TinyColorConverter.d.mts +1 -1
- package/dist/v1/build/TinyColorValidator.d.mts +1 -1
- package/dist/v1/build/TinyCookieConsent.d.mts +1 -1
- package/dist/v1/build/TinyDayNightCycle.d.mts +1 -1
- package/dist/v1/build/TinyDomReadyManager.d.mts +1 -1
- package/dist/v1/build/TinyDragDropDetector.d.mts +1 -1
- package/dist/v1/build/TinyDragger.d.mts +1 -1
- package/dist/v1/build/TinyElementObserver.d.mts +1 -1
- package/dist/v1/build/TinyGamepad.d.mts +1 -1
- package/dist/v1/build/TinyHtml.d.mts +1 -1
- package/dist/v1/build/TinyI18.d.mts +1 -1
- package/dist/v1/build/TinyIframeEvents.d.mts +1 -1
- package/dist/v1/build/TinyInventory.d.mts +1 -1
- package/dist/v1/build/TinyInventoryTrader.d.mts +1 -1
- package/dist/v1/build/TinyLevelUp.d.mts +1 -1
- package/dist/v1/build/TinyLoadingScreen.d.mts +1 -1
- package/dist/v1/build/TinyLocalStorage.d.mts +1 -1
- package/dist/v1/build/TinyMediaPlayer.d.mts +1 -1
- package/dist/v1/build/TinyNeedBar.d.mts +1 -1
- package/dist/v1/build/TinyNewWinEvents.d.mts +1 -1
- package/dist/v1/build/TinyNotifications.d.mts +1 -1
- package/dist/v1/build/TinyNotifyCenter.d.mts +1 -1
- package/dist/v1/build/TinyPromiseQueue.d.mts +1 -1
- package/dist/v1/build/TinyRadioFm.d.mts +1 -1
- package/dist/v1/build/TinyRateLimiter.d.mts +1 -1
- package/dist/v1/build/TinySimpleDice.d.mts +1 -1
- package/dist/v1/build/TinySmartScroller.d.mts +1 -1
- package/dist/v1/build/TinyTextDiffer.d.mts +1 -1
- package/dist/v1/build/TinyTextRangeEditor.d.mts +1 -1
- package/dist/v1/build/TinyTextarea.d.mts +1 -1
- package/dist/v1/build/TinyTimeout.d.mts +1 -1
- package/dist/v1/build/TinyToastNotify.d.mts +1 -1
- package/dist/v1/build/TinyUploadClicker.d.mts +1 -1
- package/dist/v1/build/UltraRandomMsgGen.d.mts +1 -1
- package/dist/v1/fileManager/asyncFuncs.d.mts +13 -13
- package/dist/v1/fileManager/index.d.mts +3 -29
- package/dist/v1/fileManager/normalFuncs.d.mts +22 -22
- package/dist/v1/index.cjs +4 -0
- package/dist/v1/index.d.mts +54 -137
- package/dist/v1/index.mjs +4 -3
- package/dist/v1/libs/ColorSafeStringify.d.mts +3 -12
- package/dist/v1/libs/TinyAdvancedRaffle.cjs +64 -50
- package/dist/v1/libs/TinyAdvancedRaffle.d.mts +64 -116
- package/dist/v1/libs/TinyAdvancedRaffle.mjs +62 -49
- package/dist/v1/libs/TinyAfterScrollWatcher.cjs +17 -1
- package/dist/v1/libs/TinyAfterScrollWatcher.d.mts +15 -19
- package/dist/v1/libs/TinyAfterScrollWatcher.mjs +15 -1
- package/dist/v1/libs/TinyAnalogClock.cjs +60 -0
- package/dist/v1/libs/TinyAnalogClock.d.mts +12 -9
- package/dist/v1/libs/TinyAnalogClock.mjs +57 -0
- package/dist/v1/libs/TinyArrayComparator.d.mts +14 -20
- package/dist/v1/libs/TinyArrayPaginator.d.mts +22 -26
- package/dist/v1/libs/TinyClassManager/TinyPluginInliner.d.mts +8 -8
- package/dist/v1/libs/TinyClassManager.cjs +5 -7
- package/dist/v1/libs/TinyClassManager.d.mts +16 -16
- package/dist/v1/libs/TinyClassManager.mjs +5 -6
- package/dist/v1/libs/TinyClipboard.cjs +2 -0
- package/dist/v1/libs/TinyClipboard.d.mts +12 -5
- package/dist/v1/libs/TinyClipboard.mjs +2 -0
- package/dist/v1/libs/TinyColorConverter.cjs +1 -0
- package/dist/v1/libs/TinyColorConverter.d.mts +10 -32
- package/dist/v1/libs/TinyColorConverter.mjs +1 -0
- package/dist/v1/libs/TinyColorValidator.d.mts +145 -184
- package/dist/v1/libs/TinyCookieConsent.d.mts +17 -17
- package/dist/v1/libs/TinyDayNightCycle.cjs +67 -42
- package/dist/v1/libs/TinyDayNightCycle.d.mts +87 -117
- package/dist/v1/libs/TinyDayNightCycle.mjs +65 -41
- package/dist/v1/libs/TinyDomReadyManager.d.mts +8 -16
- package/dist/v1/libs/TinyDragDropDetector.cjs +25 -0
- package/dist/v1/libs/TinyDragDropDetector.d.mts +32 -26
- package/dist/v1/libs/TinyDragDropDetector.mjs +22 -0
- package/dist/v1/libs/TinyDragger.cjs +46 -19
- package/dist/v1/libs/TinyDragger.d.mts +82 -81
- package/dist/v1/libs/TinyDragger.mjs +45 -18
- package/dist/v1/libs/TinyElementObserver.cjs +39 -0
- package/dist/v1/libs/TinyElementObserver.d.mts +28 -25
- package/dist/v1/libs/TinyElementObserver.mjs +36 -0
- package/dist/v1/libs/TinyGamepad.cjs +131 -2
- package/dist/v1/libs/TinyGamepad.d.mts +50 -122
- package/dist/v1/libs/TinyGamepad.mjs +129 -2
- package/dist/v1/libs/TinyHtml/TinyHtmlAnchor.cjs +2 -25
- package/dist/v1/libs/TinyHtml/TinyHtmlAnchor.d.mts +19 -25
- package/dist/v1/libs/TinyHtml/TinyHtmlAnchor.mjs +3 -27
- package/dist/v1/libs/TinyHtml/TinyHtmlButton.cjs +2 -1
- package/dist/v1/libs/TinyHtml/TinyHtmlButton.d.mts +55 -55
- package/dist/v1/libs/TinyHtml/TinyHtmlButton.mjs +2 -1
- package/dist/v1/libs/TinyHtml/TinyHtmlCanvas.d.mts +6 -6
- package/dist/v1/libs/TinyHtml/TinyHtmlDatalist.cjs +8 -4
- package/dist/v1/libs/TinyHtml/TinyHtmlDatalist.d.mts +19 -21
- package/dist/v1/libs/TinyHtml/TinyHtmlDatalist.mjs +7 -4
- package/dist/v1/libs/TinyHtml/TinyHtmlEmbed.d.mts +8 -8
- package/dist/v1/libs/TinyHtml/TinyHtmlForm.d.mts +18 -18
- package/dist/v1/libs/TinyHtml/TinyHtmlIcon.d.mts +5 -6
- package/dist/v1/libs/TinyHtml/TinyHtmlIframe.d.mts +19 -19
- package/dist/v1/libs/TinyHtml/TinyHtmlImage.cjs +0 -28
- package/dist/v1/libs/TinyHtml/TinyHtmlImage.d.mts +22 -28
- package/dist/v1/libs/TinyHtml/TinyHtmlImage.mjs +1 -27
- package/dist/v1/libs/TinyHtml/TinyHtmlInput.d.mts +11 -11
- package/dist/v1/libs/TinyHtml/TinyHtmlLink.d.mts +23 -23
- package/dist/v1/libs/TinyHtml/TinyHtmlMedia.d.mts +26 -26
- package/dist/v1/libs/TinyHtml/TinyHtmlScript.cjs +4 -30
- package/dist/v1/libs/TinyHtml/TinyHtmlScript.d.mts +20 -26
- package/dist/v1/libs/TinyHtml/TinyHtmlScript.mjs +5 -32
- package/dist/v1/libs/TinyHtml/TinyHtmlSelect.d.mts +19 -19
- package/dist/v1/libs/TinyHtml/TinyHtmlStyle.d.mts +8 -8
- package/dist/v1/libs/TinyHtml/TinyHtmlTemplate.d.mts +26 -28
- package/dist/v1/libs/TinyHtml/TinyHtmlTextarea.cjs +14 -15
- package/dist/v1/libs/TinyHtml/TinyHtmlTextarea.d.mts +32 -32
- package/dist/v1/libs/TinyHtml/TinyHtmlTextarea.mjs +15 -15
- package/dist/v1/libs/TinyHtml/index.d.mts +102 -45
- package/dist/v1/libs/TinyHtml/input/TinyHtmlColorInput.cjs +11 -9
- package/dist/v1/libs/TinyHtml/input/TinyHtmlColorInput.d.mts +21 -21
- package/dist/v1/libs/TinyHtml/input/TinyHtmlColorInput.mjs +11 -9
- package/dist/v1/libs/TinyHtml/input/TinyHtmlFileInput.d.mts +11 -11
- package/dist/v1/libs/TinyHtml/input/TinyHtmlHiddenInput.cjs +4 -4
- package/dist/v1/libs/TinyHtml/input/TinyHtmlHiddenInput.d.mts +17 -13
- package/dist/v1/libs/TinyHtml/input/TinyHtmlHiddenInput.mjs +4 -4
- package/dist/v1/libs/TinyHtml/input/TinyHtmlImageInput.d.mts +21 -21
- package/dist/v1/libs/TinyHtml/input/button/TinyHtmlButtonInput.cjs +5 -4
- package/dist/v1/libs/TinyHtml/input/button/TinyHtmlButtonInput.d.mts +14 -14
- package/dist/v1/libs/TinyHtml/input/button/TinyHtmlButtonInput.mjs +5 -4
- package/dist/v1/libs/TinyHtml/input/button/TinyHtmlResetInput.cjs +4 -3
- package/dist/v1/libs/TinyHtml/input/button/TinyHtmlResetInput.d.mts +10 -10
- package/dist/v1/libs/TinyHtml/input/button/TinyHtmlResetInput.mjs +4 -3
- package/dist/v1/libs/TinyHtml/input/button/TinyHtmlSubmitInput.cjs +4 -3
- package/dist/v1/libs/TinyHtml/input/button/TinyHtmlSubmitInput.d.mts +19 -19
- package/dist/v1/libs/TinyHtml/input/button/TinyHtmlSubmitInput.mjs +4 -3
- package/dist/v1/libs/TinyHtml/input/check/TinyHtmlCheckboxInput.cjs +5 -4
- package/dist/v1/libs/TinyHtml/input/check/TinyHtmlCheckboxInput.d.mts +11 -11
- package/dist/v1/libs/TinyHtml/input/check/TinyHtmlCheckboxInput.mjs +5 -4
- package/dist/v1/libs/TinyHtml/input/check/TinyHtmlRadioInput.cjs +4 -3
- package/dist/v1/libs/TinyHtml/input/check/TinyHtmlRadioInput.d.mts +15 -11
- package/dist/v1/libs/TinyHtml/input/check/TinyHtmlRadioInput.mjs +4 -3
- package/dist/v1/libs/TinyHtml/input/date/TinyHtmlDateInput.cjs +49 -21
- package/dist/v1/libs/TinyHtml/input/date/TinyHtmlDateInput.d.mts +34 -20
- package/dist/v1/libs/TinyHtml/input/date/TinyHtmlDateInput.mjs +45 -20
- package/dist/v1/libs/TinyHtml/input/date/TinyHtmlDateTimeInput.cjs +1 -1
- package/dist/v1/libs/TinyHtml/input/date/TinyHtmlDateTimeInput.d.mts +14 -14
- package/dist/v1/libs/TinyHtml/input/date/TinyHtmlDateTimeInput.mjs +1 -1
- package/dist/v1/libs/TinyHtml/input/date/TinyHtmlMonthInput.cjs +1 -1
- package/dist/v1/libs/TinyHtml/input/date/TinyHtmlMonthInput.d.mts +14 -14
- package/dist/v1/libs/TinyHtml/input/date/TinyHtmlMonthInput.mjs +1 -1
- package/dist/v1/libs/TinyHtml/input/date/TinyHtmlTimeInput.cjs +48 -25
- package/dist/v1/libs/TinyHtml/input/date/TinyHtmlTimeInput.d.mts +27 -21
- package/dist/v1/libs/TinyHtml/input/date/TinyHtmlTimeInput.mjs +40 -27
- package/dist/v1/libs/TinyHtml/input/date/TinyHtmlWeekInput.cjs +1 -1
- package/dist/v1/libs/TinyHtml/input/date/TinyHtmlWeekInput.d.mts +14 -14
- package/dist/v1/libs/TinyHtml/input/date/TinyHtmlWeekInput.mjs +1 -1
- package/dist/v1/libs/TinyHtml/input/number/TinyHtmlNumberInput.d.mts +14 -14
- package/dist/v1/libs/TinyHtml/input/number/TinyHtmlRangeInput.d.mts +14 -14
- package/dist/v1/libs/TinyHtml/input/text/TinyHtmlEmailInput.d.mts +25 -21
- package/dist/v1/libs/TinyHtml/input/text/TinyHtmlPasswordInput.d.mts +18 -18
- package/dist/v1/libs/TinyHtml/input/text/TinyHtmlSearchInput.d.mts +33 -29
- package/dist/v1/libs/TinyHtml/input/text/TinyHtmlTelInput.d.mts +22 -22
- package/dist/v1/libs/TinyHtml/input/text/TinyHtmlTextInput.d.mts +18 -18
- package/dist/v1/libs/TinyHtml/input/text/TinyHtmlUrlInput.d.mts +31 -27
- package/dist/v1/libs/TinyHtml/media/TinyHtmlAudio.d.mts +35 -11
- package/dist/v1/libs/TinyHtml/media/TinyHtmlObject.d.mts +10 -10
- package/dist/v1/libs/TinyHtml/media/TinyHtmlSource.d.mts +12 -12
- package/dist/v1/libs/TinyHtml/media/TinyHtmlVideo.d.mts +35 -27
- package/dist/v1/libs/TinyHtml.cjs +4 -5
- package/dist/v1/libs/TinyHtml.d.mts +1503 -1731
- package/dist/v1/libs/TinyHtml.mjs +5 -6
- package/dist/v1/libs/TinyI18.cjs +61 -0
- package/dist/v1/libs/TinyI18.d.mts +34 -58
- package/dist/v1/libs/TinyI18.mjs +55 -0
- package/dist/v1/libs/TinyIframeEvents.cjs +19 -2
- package/dist/v1/libs/TinyIframeEvents.d.mts +29 -38
- package/dist/v1/libs/TinyIframeEvents.mjs +19 -2
- package/dist/v1/libs/TinyInventory.d.mts +78 -141
- package/dist/v1/libs/TinyInventoryTrader.d.mts +19 -22
- package/dist/v1/libs/TinyLevelUp.d.mts +10 -13
- package/dist/v1/libs/TinyLoadingScreen.d.mts +21 -31
- package/dist/v1/libs/TinyLocalStorage.cjs +48 -0
- package/dist/v1/libs/TinyLocalStorage.d.mts +11 -30
- package/dist/v1/libs/TinyLocalStorage.mjs +45 -0
- package/dist/v1/libs/TinyMamdaniInferenceSystem.d.mts +37 -23
- package/dist/v1/libs/TinyMediaPlayer.cjs +77 -3
- package/dist/v1/libs/TinyMediaPlayer.d.mts +109 -106
- package/dist/v1/libs/TinyMediaPlayer.mjs +71 -3
- package/dist/v1/libs/TinyNeedBar.d.mts +25 -37
- package/dist/v1/libs/TinyNewWinEvents.cjs +29 -0
- package/dist/v1/libs/TinyNewWinEvents.d.mts +32 -29
- package/dist/v1/libs/TinyNewWinEvents.mjs +26 -0
- package/dist/v1/libs/TinyNotifications.d.mts +6 -6
- package/dist/v1/libs/TinyNotifyCenter.cjs +36 -0
- package/dist/v1/libs/TinyNotifyCenter.d.mts +15 -15
- package/dist/v1/libs/TinyNotifyCenter.mjs +32 -0
- package/dist/v1/libs/TinyPromiseQueue.d.mts +11 -11
- package/dist/v1/libs/TinyRadioFm.cjs +70 -12
- package/dist/v1/libs/TinyRadioFm.d.mts +45 -80
- package/dist/v1/libs/TinyRadioFm.mjs +64 -12
- package/dist/v1/libs/TinyRateLimiter.cjs +52 -0
- package/dist/v1/libs/TinyRateLimiter.d.mts +29 -36
- package/dist/v1/libs/TinyRateLimiter.mjs +48 -0
- package/dist/v1/libs/TinySimpleDice.d.mts +17 -36
- package/dist/v1/libs/TinySmartScroller.cjs +52 -3
- package/dist/v1/libs/TinySmartScroller.d.mts +62 -70
- package/dist/v1/libs/TinySmartScroller.mjs +51 -5
- package/dist/v1/libs/TinyTextDiffer.cjs +19 -18
- package/dist/v1/libs/TinyTextDiffer.d.mts +11 -13
- package/dist/v1/libs/TinyTextDiffer.mjs +16 -17
- package/dist/v1/libs/TinyTextRangeEditor.d.mts +8 -8
- package/dist/v1/libs/TinyTextarea.cjs +19 -0
- package/dist/v1/libs/TinyTextarea.d.mts +34 -28
- package/dist/v1/libs/TinyTextarea.mjs +17 -0
- package/dist/v1/libs/TinyTimeout.cjs +11 -1
- package/dist/v1/libs/TinyTimeout.d.mts +14 -14
- package/dist/v1/libs/TinyTimeout.mjs +9 -1
- package/dist/v1/libs/TinyToastNotify.cjs +36 -1
- package/dist/v1/libs/TinyToastNotify.d.mts +15 -17
- package/dist/v1/libs/TinyToastNotify.mjs +32 -1
- package/dist/v1/libs/TinyUploadClicker.cjs +19 -0
- package/dist/v1/libs/TinyUploadClicker.d.mts +38 -8
- package/dist/v1/libs/TinyUploadClicker.mjs +17 -0
- package/dist/v1/libs/UltraRandomMsgGen.cjs +148 -35
- package/dist/v1/libs/UltraRandomMsgGen.d.mts +52 -78
- package/dist/v1/libs/UltraRandomMsgGen.mjs +133 -34
- package/dist/v1/libs/utils.cjs +21 -0
- package/dist/v1/libs/utils.d.mts +6 -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 +11 -2
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
export default TinyTextRangeEditor;
|
|
2
1
|
/**
|
|
3
2
|
* A full-featured text range editor for `<input>` and `<textarea>` elements,
|
|
4
3
|
* including advanced utilities for BBCode or similar tag-based markup editing.
|
|
5
4
|
*/
|
|
6
5
|
declare class TinyTextRangeEditor {
|
|
6
|
+
#private;
|
|
7
7
|
/**
|
|
8
8
|
* @param {HTMLInputElement | HTMLTextAreaElement} elem - The target editable input or textarea element.
|
|
9
9
|
* @param {Object} [settings={}] - Optional tag symbol customization.
|
|
@@ -11,8 +11,8 @@ declare class TinyTextRangeEditor {
|
|
|
11
11
|
* @param {string} [settings.closeTag=']'] - The character or symbol used to end a tag (e.g., `']'`).
|
|
12
12
|
*/
|
|
13
13
|
constructor(elem: HTMLInputElement | HTMLTextAreaElement, { openTag, closeTag }?: {
|
|
14
|
-
openTag?: string
|
|
15
|
-
closeTag?: string
|
|
14
|
+
openTag?: string;
|
|
15
|
+
closeTag?: string;
|
|
16
16
|
});
|
|
17
17
|
/** @returns {string} The current open tag symbol. */
|
|
18
18
|
getOpenTag(): string;
|
|
@@ -66,10 +66,10 @@ declare class TinyTextRangeEditor {
|
|
|
66
66
|
* @returns {this}
|
|
67
67
|
*/
|
|
68
68
|
insertText(text: string, { newCursor, autoSpacing, autoSpaceLeft, autoSpaceRight, }?: {
|
|
69
|
-
newCursor?:
|
|
70
|
-
autoSpacing?: boolean
|
|
71
|
-
autoSpaceLeft?: boolean
|
|
72
|
-
autoSpaceRight?: boolean
|
|
69
|
+
newCursor?: 'start' | 'end' | 'preserve';
|
|
70
|
+
autoSpacing?: boolean;
|
|
71
|
+
autoSpaceLeft?: boolean;
|
|
72
|
+
autoSpaceRight?: boolean;
|
|
73
73
|
}): this;
|
|
74
74
|
/**
|
|
75
75
|
* Deletes the currently selected text.
|
|
@@ -195,6 +195,6 @@ declare class TinyTextRangeEditor {
|
|
|
195
195
|
* @returns {this}
|
|
196
196
|
*/
|
|
197
197
|
toggleTag(tagName: string, attributes?: Record<string, string> | string[]): this;
|
|
198
|
-
#private;
|
|
199
198
|
}
|
|
199
|
+
export default TinyTextRangeEditor;
|
|
200
200
|
//# sourceMappingURL=TinyTextRangeEditor.d.mts.map
|
|
@@ -30,6 +30,21 @@
|
|
|
30
30
|
* @beta
|
|
31
31
|
*/
|
|
32
32
|
class TinyTextarea {
|
|
33
|
+
/**
|
|
34
|
+
* Tracks whether the instance has been destroyed.
|
|
35
|
+
* @type {boolean}
|
|
36
|
+
*/
|
|
37
|
+
#destroyed = false;
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* Gets the current destruction status of the instance.
|
|
41
|
+
*
|
|
42
|
+
* @returns {boolean} True if the instance is destroyed, false otherwise.
|
|
43
|
+
*/
|
|
44
|
+
get destroyed() {
|
|
45
|
+
return this.#destroyed;
|
|
46
|
+
}
|
|
47
|
+
|
|
33
48
|
#lineHeight;
|
|
34
49
|
#maxRows;
|
|
35
50
|
#extraHeight;
|
|
@@ -223,7 +238,11 @@ class TinyTextarea {
|
|
|
223
238
|
* Cleans up internal listeners and disables dynamic behavior.
|
|
224
239
|
*/
|
|
225
240
|
destroy() {
|
|
241
|
+
if (this.destroyed) return;
|
|
226
242
|
this.#textarea.removeEventListener('input', this._handleInput);
|
|
243
|
+
|
|
244
|
+
// Lock the instance
|
|
245
|
+
this.#destroyed = true;
|
|
227
246
|
}
|
|
228
247
|
}
|
|
229
248
|
|
|
@@ -1,4 +1,13 @@
|
|
|
1
|
-
|
|
1
|
+
/**
|
|
2
|
+
* @typedef {Object} OnInputInfo
|
|
3
|
+
* @property {number} breakLines - Total number of `\n` line breaks in the textarea value.
|
|
4
|
+
* @property {number} height - Final calculated height (in pixels) applied to the textarea.
|
|
5
|
+
* @property {number} scrollHeight - Internal scrollHeight before limiting.
|
|
6
|
+
* @property {number} maxHeight - Maximum allowed height before scrolling is forced.
|
|
7
|
+
* @property {number} lineHeight - Height of one line of text, computed from CSS.
|
|
8
|
+
* @property {number} maxRows - Maximum number of visible rows allowed.
|
|
9
|
+
* @property {number} rows - Effective number of visual rows being used.
|
|
10
|
+
*/
|
|
2
11
|
export type OnInputInfo = {
|
|
3
12
|
/**
|
|
4
13
|
* - Total number of `\n` line breaks in the textarea value.
|
|
@@ -29,16 +38,6 @@ export type OnInputInfo = {
|
|
|
29
38
|
*/
|
|
30
39
|
rows: number;
|
|
31
40
|
};
|
|
32
|
-
/**
|
|
33
|
-
* @typedef {Object} OnInputInfo
|
|
34
|
-
* @property {number} breakLines - Total number of `\n` line breaks in the textarea value.
|
|
35
|
-
* @property {number} height - Final calculated height (in pixels) applied to the textarea.
|
|
36
|
-
* @property {number} scrollHeight - Internal scrollHeight before limiting.
|
|
37
|
-
* @property {number} maxHeight - Maximum allowed height before scrolling is forced.
|
|
38
|
-
* @property {number} lineHeight - Height of one line of text, computed from CSS.
|
|
39
|
-
* @property {number} maxRows - Maximum number of visible rows allowed.
|
|
40
|
-
* @property {number} rows - Effective number of visual rows being used.
|
|
41
|
-
*/
|
|
42
41
|
/**
|
|
43
42
|
* A lightweight utility class that automatically adjusts the height of a `<textarea>`
|
|
44
43
|
* element based on its content. It prevents scrollbars by expanding vertically as needed,
|
|
@@ -58,24 +57,14 @@ export type OnInputInfo = {
|
|
|
58
57
|
* @beta
|
|
59
58
|
*/
|
|
60
59
|
declare class TinyTextarea {
|
|
60
|
+
#private;
|
|
61
|
+
_handleInput: () => void;
|
|
61
62
|
/**
|
|
62
|
-
*
|
|
63
|
+
* Gets the current destruction status of the instance.
|
|
63
64
|
*
|
|
64
|
-
* @
|
|
65
|
-
* @param {Object} [options={}] - Optional configuration parameters.
|
|
66
|
-
* @param {number} [options.maxRows] - Maximum number of visible rows before scrolling.
|
|
67
|
-
* @param {number} [options.extraHeight] - Additional pixels to add to final height.
|
|
68
|
-
* @param {(info: OnInputInfo) => void} [options.onResize] - Callback when the number of rows changes.
|
|
69
|
-
* @param {(info: OnInputInfo) => void} [options.onInput] - Callback on every input event.
|
|
70
|
-
* @throws {Error} If `textarea` is not a valid `<textarea>` element.
|
|
71
|
-
* @throws {TypeError} If provided options are of invalid types.
|
|
65
|
+
* @returns {boolean} True if the instance is destroyed, false otherwise.
|
|
72
66
|
*/
|
|
73
|
-
|
|
74
|
-
maxRows?: number | undefined;
|
|
75
|
-
extraHeight?: number | undefined;
|
|
76
|
-
onResize?: ((info: OnInputInfo) => void) | undefined;
|
|
77
|
-
onInput?: ((info: OnInputInfo) => void) | undefined;
|
|
78
|
-
});
|
|
67
|
+
get destroyed(): boolean;
|
|
79
68
|
/**
|
|
80
69
|
* Returns the computed line height in pixels.
|
|
81
70
|
* @returns {number}
|
|
@@ -106,7 +95,24 @@ declare class TinyTextarea {
|
|
|
106
95
|
* @returns {HTMLTextAreaElement}
|
|
107
96
|
*/
|
|
108
97
|
get textarea(): HTMLTextAreaElement;
|
|
109
|
-
|
|
98
|
+
/**
|
|
99
|
+
* Creates a new TinyTextarea instance.
|
|
100
|
+
*
|
|
101
|
+
* @param {HTMLTextAreaElement} textarea - The `<textarea>` element to enhance.
|
|
102
|
+
* @param {Object} [options={}] - Optional configuration parameters.
|
|
103
|
+
* @param {number} [options.maxRows] - Maximum number of visible rows before scrolling.
|
|
104
|
+
* @param {number} [options.extraHeight] - Additional pixels to add to final height.
|
|
105
|
+
* @param {(info: OnInputInfo) => void} [options.onResize] - Callback when the number of rows changes.
|
|
106
|
+
* @param {(info: OnInputInfo) => void} [options.onInput] - Callback on every input event.
|
|
107
|
+
* @throws {Error} If `textarea` is not a valid `<textarea>` element.
|
|
108
|
+
* @throws {TypeError} If provided options are of invalid types.
|
|
109
|
+
*/
|
|
110
|
+
constructor(textarea: HTMLTextAreaElement, options?: {
|
|
111
|
+
maxRows?: number;
|
|
112
|
+
extraHeight?: number;
|
|
113
|
+
onResize?: (info: OnInputInfo) => void;
|
|
114
|
+
onInput?: (info: OnInputInfo) => void;
|
|
115
|
+
});
|
|
110
116
|
/**
|
|
111
117
|
* Returns the latest height and row count of the textarea.
|
|
112
118
|
* @returns {{ height: number, rows: number }} - Last known resize state.
|
|
@@ -123,6 +129,6 @@ declare class TinyTextarea {
|
|
|
123
129
|
* Cleans up internal listeners and disables dynamic behavior.
|
|
124
130
|
*/
|
|
125
131
|
destroy(): void;
|
|
126
|
-
#private;
|
|
127
132
|
}
|
|
133
|
+
export default TinyTextarea;
|
|
128
134
|
//# sourceMappingURL=TinyTextarea.d.mts.map
|
|
@@ -27,6 +27,19 @@
|
|
|
27
27
|
* @beta
|
|
28
28
|
*/
|
|
29
29
|
class TinyTextarea {
|
|
30
|
+
/**
|
|
31
|
+
* Tracks whether the instance has been destroyed.
|
|
32
|
+
* @type {boolean}
|
|
33
|
+
*/
|
|
34
|
+
#destroyed = false;
|
|
35
|
+
/**
|
|
36
|
+
* Gets the current destruction status of the instance.
|
|
37
|
+
*
|
|
38
|
+
* @returns {boolean} True if the instance is destroyed, false otherwise.
|
|
39
|
+
*/
|
|
40
|
+
get destroyed() {
|
|
41
|
+
return this.#destroyed;
|
|
42
|
+
}
|
|
30
43
|
#lineHeight;
|
|
31
44
|
#maxRows;
|
|
32
45
|
#extraHeight;
|
|
@@ -192,7 +205,11 @@ class TinyTextarea {
|
|
|
192
205
|
* Cleans up internal listeners and disables dynamic behavior.
|
|
193
206
|
*/
|
|
194
207
|
destroy() {
|
|
208
|
+
if (this.destroyed)
|
|
209
|
+
return;
|
|
195
210
|
this.#textarea.removeEventListener('input', this._handleInput);
|
|
211
|
+
// Lock the instance
|
|
212
|
+
this.#destroyed = true;
|
|
196
213
|
}
|
|
197
214
|
}
|
|
198
215
|
export default TinyTextarea;
|
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
+
var utils = require('./utils.cjs');
|
|
4
|
+
|
|
5
|
+
const checkDestroy = utils.createCheckDestroyed('TinyTimeout');
|
|
6
|
+
|
|
3
7
|
/**
|
|
4
8
|
* A utility class to manage dynamically adjusted timeouts based on how often
|
|
5
9
|
* each unique ID is triggered. Also provides polling support for asynchronous conditions.
|
|
@@ -57,6 +61,7 @@ class TinyTimeout {
|
|
|
57
61
|
* @returns {boolean}
|
|
58
62
|
*/
|
|
59
63
|
getAllowAutoConfigChange() {
|
|
64
|
+
checkDestroy(this.#isDestroyed);
|
|
60
65
|
return this.#allowAutoConfigChange;
|
|
61
66
|
}
|
|
62
67
|
|
|
@@ -66,6 +71,7 @@ class TinyTimeout {
|
|
|
66
71
|
* @returns {number}
|
|
67
72
|
*/
|
|
68
73
|
getCooldownWatcherTime() {
|
|
74
|
+
checkDestroy(this.#isDestroyed);
|
|
69
75
|
return this.#cooldownWatcherTime;
|
|
70
76
|
}
|
|
71
77
|
|
|
@@ -75,6 +81,7 @@ class TinyTimeout {
|
|
|
75
81
|
* @param {boolean} value
|
|
76
82
|
*/
|
|
77
83
|
setAllowAutoConfigChange(value) {
|
|
84
|
+
checkDestroy(this.#isDestroyed);
|
|
78
85
|
if (typeof value !== 'boolean') throw new TypeError(`Expected 'value' to be a boolean.`);
|
|
79
86
|
this.#allowAutoConfigChange = value;
|
|
80
87
|
}
|
|
@@ -86,6 +93,7 @@ class TinyTimeout {
|
|
|
86
93
|
* @param {number} value
|
|
87
94
|
*/
|
|
88
95
|
setCooldownWatcherTime(value) {
|
|
96
|
+
checkDestroy(this.#isDestroyed);
|
|
89
97
|
if (this.#isDestroyed) throw new Error('TinyTimeout has been destroyed.');
|
|
90
98
|
if (!Number.isFinite(value) || value <= 0)
|
|
91
99
|
throw new TypeError(`Expected 'value' to be a positive number.`);
|
|
@@ -113,6 +121,7 @@ class TinyTimeout {
|
|
|
113
121
|
* @throws {Error} Throws if the instance has been destroyed or arguments are invalid.
|
|
114
122
|
*/
|
|
115
123
|
set(id, callback, value, limit = null) {
|
|
124
|
+
checkDestroy(this.#isDestroyed);
|
|
116
125
|
if (this.#isDestroyed) throw new Error('TinyTimeout has been destroyed.');
|
|
117
126
|
if (typeof id !== 'string' || id.trim() === '')
|
|
118
127
|
throw new TypeError(`Expected 'id' to be a non-empty string.`);
|
|
@@ -170,6 +179,7 @@ class TinyTimeout {
|
|
|
170
179
|
* @throws {Error} If the instance is destroyed or arguments are invalid.
|
|
171
180
|
*/
|
|
172
181
|
waitForTrue(getValue, checkInterval = 100) {
|
|
182
|
+
checkDestroy(this.#isDestroyed);
|
|
173
183
|
if (this.#isDestroyed) throw new Error('TinyTimeout has been destroyed.');
|
|
174
184
|
if (typeof getValue !== 'function')
|
|
175
185
|
throw new TypeError(`Expected 'getValue' to be a function.`);
|
|
@@ -184,10 +194,10 @@ class TinyTimeout {
|
|
|
184
194
|
*/
|
|
185
195
|
destroy() {
|
|
186
196
|
if (this.#isDestroyed) return;
|
|
187
|
-
this.#isDestroyed = true;
|
|
188
197
|
if (this.#cooldownWatcher) clearInterval(this.#cooldownWatcher);
|
|
189
198
|
this.#cooldownWatcher = null;
|
|
190
199
|
this.#timeoutFixer.clear();
|
|
200
|
+
this.#isDestroyed = true;
|
|
191
201
|
}
|
|
192
202
|
}
|
|
193
203
|
|
|
@@ -1,19 +1,9 @@
|
|
|
1
|
-
export default TinyTimeout;
|
|
2
1
|
/**
|
|
3
2
|
* A utility class to manage dynamically adjusted timeouts based on how often
|
|
4
3
|
* each unique ID is triggered. Also provides polling support for asynchronous conditions.
|
|
5
4
|
*/
|
|
6
5
|
declare class TinyTimeout {
|
|
7
|
-
|
|
8
|
-
* Waits until a provided function returns `true`, checking repeatedly at the defined interval.
|
|
9
|
-
* Useful for polling asynchronous conditions.
|
|
10
|
-
*
|
|
11
|
-
* @param {() => boolean} getValue - A function that returns `true` when the condition is met.
|
|
12
|
-
* @param {number} [checkInterval=100] - How often (in ms) to check the condition.
|
|
13
|
-
* @returns {Promise<void>} Resolves when the condition is met.
|
|
14
|
-
* @throws {TypeError} If arguments are invalid.
|
|
15
|
-
*/
|
|
16
|
-
static waitForTrue(getValue: () => boolean, checkInterval?: number): Promise<void>;
|
|
6
|
+
#private;
|
|
17
7
|
/**
|
|
18
8
|
* Creates a new instance of TinyTimeout.
|
|
19
9
|
*
|
|
@@ -22,8 +12,8 @@ declare class TinyTimeout {
|
|
|
22
12
|
* @param {boolean} [options.allowAutoConfigChange=false] Whether to allow auto value changes for existing IDs.
|
|
23
13
|
*/
|
|
24
14
|
constructor({ cooldownWatcherTime, allowAutoConfigChange }?: {
|
|
25
|
-
cooldownWatcherTime?: number
|
|
26
|
-
allowAutoConfigChange?: boolean
|
|
15
|
+
cooldownWatcherTime?: number;
|
|
16
|
+
allowAutoConfigChange?: boolean;
|
|
27
17
|
});
|
|
28
18
|
/**
|
|
29
19
|
* Whether this instance has been destroyed and is no longer usable.
|
|
@@ -69,6 +59,16 @@ declare class TinyTimeout {
|
|
|
69
59
|
* @throws {Error} Throws if the instance has been destroyed or arguments are invalid.
|
|
70
60
|
*/
|
|
71
61
|
set(id: string, callback: Function, value: number, limit?: number | null): number;
|
|
62
|
+
/**
|
|
63
|
+
* Waits until a provided function returns `true`, checking repeatedly at the defined interval.
|
|
64
|
+
* Useful for polling asynchronous conditions.
|
|
65
|
+
*
|
|
66
|
+
* @param {() => boolean} getValue - A function that returns `true` when the condition is met.
|
|
67
|
+
* @param {number} [checkInterval=100] - How often (in ms) to check the condition.
|
|
68
|
+
* @returns {Promise<void>} Resolves when the condition is met.
|
|
69
|
+
* @throws {TypeError} If arguments are invalid.
|
|
70
|
+
*/
|
|
71
|
+
static waitForTrue(getValue: () => boolean, checkInterval?: number): Promise<void>;
|
|
72
72
|
/**
|
|
73
73
|
* Instance version of `waitForTrue`, which defaults to using the instance's
|
|
74
74
|
* cooldownWatcherTime if not explicitly provided.
|
|
@@ -84,6 +84,6 @@ declare class TinyTimeout {
|
|
|
84
84
|
* After calling this, the instance becomes unusable.
|
|
85
85
|
*/
|
|
86
86
|
destroy(): void;
|
|
87
|
-
#private;
|
|
88
87
|
}
|
|
88
|
+
export default TinyTimeout;
|
|
89
89
|
//# sourceMappingURL=TinyTimeout.d.mts.map
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { createCheckDestroyed } from './utils.mjs';
|
|
2
|
+
const checkDestroy = createCheckDestroyed('TinyTimeout');
|
|
1
3
|
/**
|
|
2
4
|
* A utility class to manage dynamically adjusted timeouts based on how often
|
|
3
5
|
* each unique ID is triggered. Also provides polling support for asynchronous conditions.
|
|
@@ -48,6 +50,7 @@ class TinyTimeout {
|
|
|
48
50
|
* @returns {boolean}
|
|
49
51
|
*/
|
|
50
52
|
getAllowAutoConfigChange() {
|
|
53
|
+
checkDestroy(this.#isDestroyed);
|
|
51
54
|
return this.#allowAutoConfigChange;
|
|
52
55
|
}
|
|
53
56
|
/**
|
|
@@ -56,6 +59,7 @@ class TinyTimeout {
|
|
|
56
59
|
* @returns {number}
|
|
57
60
|
*/
|
|
58
61
|
getCooldownWatcherTime() {
|
|
62
|
+
checkDestroy(this.#isDestroyed);
|
|
59
63
|
return this.#cooldownWatcherTime;
|
|
60
64
|
}
|
|
61
65
|
/**
|
|
@@ -64,6 +68,7 @@ class TinyTimeout {
|
|
|
64
68
|
* @param {boolean} value
|
|
65
69
|
*/
|
|
66
70
|
setAllowAutoConfigChange(value) {
|
|
71
|
+
checkDestroy(this.#isDestroyed);
|
|
67
72
|
if (typeof value !== 'boolean')
|
|
68
73
|
throw new TypeError(`Expected 'value' to be a boolean.`);
|
|
69
74
|
this.#allowAutoConfigChange = value;
|
|
@@ -75,6 +80,7 @@ class TinyTimeout {
|
|
|
75
80
|
* @param {number} value
|
|
76
81
|
*/
|
|
77
82
|
setCooldownWatcherTime(value) {
|
|
83
|
+
checkDestroy(this.#isDestroyed);
|
|
78
84
|
if (this.#isDestroyed)
|
|
79
85
|
throw new Error('TinyTimeout has been destroyed.');
|
|
80
86
|
if (!Number.isFinite(value) || value <= 0)
|
|
@@ -102,6 +108,7 @@ class TinyTimeout {
|
|
|
102
108
|
* @throws {Error} Throws if the instance has been destroyed or arguments are invalid.
|
|
103
109
|
*/
|
|
104
110
|
set(id, callback, value, limit = null) {
|
|
111
|
+
checkDestroy(this.#isDestroyed);
|
|
105
112
|
if (this.#isDestroyed)
|
|
106
113
|
throw new Error('TinyTimeout has been destroyed.');
|
|
107
114
|
if (typeof id !== 'string' || id.trim() === '')
|
|
@@ -154,6 +161,7 @@ class TinyTimeout {
|
|
|
154
161
|
* @throws {Error} If the instance is destroyed or arguments are invalid.
|
|
155
162
|
*/
|
|
156
163
|
waitForTrue(getValue, checkInterval = 100) {
|
|
164
|
+
checkDestroy(this.#isDestroyed);
|
|
157
165
|
if (this.#isDestroyed)
|
|
158
166
|
throw new Error('TinyTimeout has been destroyed.');
|
|
159
167
|
if (typeof getValue !== 'function')
|
|
@@ -169,11 +177,11 @@ class TinyTimeout {
|
|
|
169
177
|
destroy() {
|
|
170
178
|
if (this.#isDestroyed)
|
|
171
179
|
return;
|
|
172
|
-
this.#isDestroyed = true;
|
|
173
180
|
if (this.#cooldownWatcher)
|
|
174
181
|
clearInterval(this.#cooldownWatcher);
|
|
175
182
|
this.#cooldownWatcher = null;
|
|
176
183
|
this.#timeoutFixer.clear();
|
|
184
|
+
this.#isDestroyed = true;
|
|
177
185
|
}
|
|
178
186
|
}
|
|
179
187
|
export default TinyTimeout;
|
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
+
var utils = require('./utils.cjs');
|
|
4
|
+
|
|
5
|
+
const checkDestroy = utils.createCheckDestroyed('TinyToastNotify');
|
|
6
|
+
|
|
3
7
|
/**
|
|
4
8
|
* A callback function used to manually close a notification.
|
|
5
9
|
* Passed as a second argument to `onClick` handlers, allowing programmatic dismissal of the toast.
|
|
@@ -14,7 +18,7 @@
|
|
|
14
18
|
* @typedef {string | {
|
|
15
19
|
* message: string, // The main message to display
|
|
16
20
|
* title?: string, // Optional title to appear above the message
|
|
17
|
-
* onClick?:
|
|
21
|
+
* onClick?: (event: MouseEvent, func: CloseToastFunc) => void, // Optional click handler for the notification
|
|
18
22
|
* html?: boolean, // Whether the message should be interpreted as raw HTML
|
|
19
23
|
* avatar?: string // Optional URL to an avatar image shown on the left
|
|
20
24
|
* }} NotifyData
|
|
@@ -50,6 +54,21 @@ class TinyToastNotify {
|
|
|
50
54
|
/** @type {HTMLElement|null} */
|
|
51
55
|
#container;
|
|
52
56
|
|
|
57
|
+
/**
|
|
58
|
+
* Tracks whether the instance has been destroyed.
|
|
59
|
+
* @type {boolean}
|
|
60
|
+
*/
|
|
61
|
+
#destroyed = false;
|
|
62
|
+
|
|
63
|
+
/**
|
|
64
|
+
* Gets the current destruction status of the instance.
|
|
65
|
+
*
|
|
66
|
+
* @returns {boolean} True if the instance is destroyed, false otherwise.
|
|
67
|
+
*/
|
|
68
|
+
get destroyed() {
|
|
69
|
+
return this.#destroyed;
|
|
70
|
+
}
|
|
71
|
+
|
|
53
72
|
/**
|
|
54
73
|
* @param {'top'|'bottom'} y - 'top' or 'bottom'
|
|
55
74
|
* @param {'right'|'left'|'center'} x - 'right', 'left', or 'center'
|
|
@@ -94,6 +113,7 @@ class TinyToastNotify {
|
|
|
94
113
|
* @throws {Error} If the container is not a valid HTMLElement.
|
|
95
114
|
*/
|
|
96
115
|
getContainer() {
|
|
116
|
+
checkDestroy(this.#destroyed);
|
|
97
117
|
if (!(this.#container instanceof HTMLElement))
|
|
98
118
|
throw new Error('Container is not a valid HTMLElement.');
|
|
99
119
|
return this.#container;
|
|
@@ -149,6 +169,7 @@ class TinyToastNotify {
|
|
|
149
169
|
* @returns {'top'|'bottom'} The vertical direction of the notification container.
|
|
150
170
|
*/
|
|
151
171
|
getY() {
|
|
172
|
+
checkDestroy(this.#destroyed);
|
|
152
173
|
return this.#y;
|
|
153
174
|
}
|
|
154
175
|
|
|
@@ -160,6 +181,7 @@ class TinyToastNotify {
|
|
|
160
181
|
* @throws {Error} If the value is invalid.
|
|
161
182
|
*/
|
|
162
183
|
setY(value) {
|
|
184
|
+
checkDestroy(this.#destroyed);
|
|
163
185
|
this.#validateY(value);
|
|
164
186
|
const container = this.getContainer();
|
|
165
187
|
container.classList.remove(this.#y);
|
|
@@ -174,6 +196,7 @@ class TinyToastNotify {
|
|
|
174
196
|
* @returns {'left'|'right'|'center'} The horizontal direction of the notification container.
|
|
175
197
|
*/
|
|
176
198
|
getX() {
|
|
199
|
+
checkDestroy(this.#destroyed);
|
|
177
200
|
return this.#x;
|
|
178
201
|
}
|
|
179
202
|
|
|
@@ -185,6 +208,7 @@ class TinyToastNotify {
|
|
|
185
208
|
* @throws {Error} If the value is invalid.
|
|
186
209
|
*/
|
|
187
210
|
setX(value) {
|
|
211
|
+
checkDestroy(this.#destroyed);
|
|
188
212
|
this.#validateX(value);
|
|
189
213
|
const container = this.getContainer();
|
|
190
214
|
container.classList.remove(this.#x);
|
|
@@ -199,6 +223,7 @@ class TinyToastNotify {
|
|
|
199
223
|
* @returns {number} Base time (in milliseconds) that a notification stays on screen.
|
|
200
224
|
*/
|
|
201
225
|
getBaseDuration() {
|
|
226
|
+
checkDestroy(this.#destroyed);
|
|
202
227
|
return this.#baseDuration;
|
|
203
228
|
}
|
|
204
229
|
|
|
@@ -209,6 +234,7 @@ class TinyToastNotify {
|
|
|
209
234
|
* @throws {Error} If the value is not a valid non-negative finite number.
|
|
210
235
|
*/
|
|
211
236
|
setBaseDuration(value) {
|
|
237
|
+
checkDestroy(this.#destroyed);
|
|
212
238
|
this.#validateTiming(value, 'baseDuration');
|
|
213
239
|
this.#baseDuration = value;
|
|
214
240
|
}
|
|
@@ -219,6 +245,7 @@ class TinyToastNotify {
|
|
|
219
245
|
* @returns {number} Extra time (in milliseconds) per character in the notification.
|
|
220
246
|
*/
|
|
221
247
|
getExtraPerChar() {
|
|
248
|
+
checkDestroy(this.#destroyed);
|
|
222
249
|
return this.#extraPerChar;
|
|
223
250
|
}
|
|
224
251
|
|
|
@@ -229,6 +256,7 @@ class TinyToastNotify {
|
|
|
229
256
|
* @throws {Error} If the value is not a valid non-negative finite number.
|
|
230
257
|
*/
|
|
231
258
|
setExtraPerChar(value) {
|
|
259
|
+
checkDestroy(this.#destroyed);
|
|
232
260
|
this.#validateTiming(value, 'extraPerChar');
|
|
233
261
|
this.#extraPerChar = value;
|
|
234
262
|
}
|
|
@@ -239,6 +267,7 @@ class TinyToastNotify {
|
|
|
239
267
|
* @returns {number} Time (in milliseconds) used for fade-out transition.
|
|
240
268
|
*/
|
|
241
269
|
getFadeOutDuration() {
|
|
270
|
+
checkDestroy(this.#destroyed);
|
|
242
271
|
return this.#fadeOutDuration;
|
|
243
272
|
}
|
|
244
273
|
|
|
@@ -249,6 +278,7 @@ class TinyToastNotify {
|
|
|
249
278
|
* @throws {Error} If the value is not a valid non-negative finite number.
|
|
250
279
|
*/
|
|
251
280
|
setFadeOutDuration(value) {
|
|
281
|
+
checkDestroy(this.#destroyed);
|
|
252
282
|
this.#validateTiming(value, 'fadeOutDuration');
|
|
253
283
|
this.#fadeOutDuration = value;
|
|
254
284
|
}
|
|
@@ -267,6 +297,7 @@ class TinyToastNotify {
|
|
|
267
297
|
* @param {NotifyData} data
|
|
268
298
|
*/
|
|
269
299
|
show(data) {
|
|
300
|
+
checkDestroy(this.#destroyed);
|
|
270
301
|
let message = '';
|
|
271
302
|
let title = '';
|
|
272
303
|
let onClick = null;
|
|
@@ -384,6 +415,7 @@ class TinyToastNotify {
|
|
|
384
415
|
* @returns {void}
|
|
385
416
|
*/
|
|
386
417
|
destroy() {
|
|
418
|
+
if (this.#destroyed) return;
|
|
387
419
|
if (!(this.#container instanceof HTMLElement)) return;
|
|
388
420
|
|
|
389
421
|
// Remove all child notifications
|
|
@@ -396,6 +428,9 @@ class TinyToastNotify {
|
|
|
396
428
|
|
|
397
429
|
// Optional: Clean internal references (safe practice)
|
|
398
430
|
this.#container = null;
|
|
431
|
+
|
|
432
|
+
// Lock the instance
|
|
433
|
+
this.#destroyed = true;
|
|
399
434
|
}
|
|
400
435
|
}
|
|
401
436
|
|
|
@@ -1,17 +1,8 @@
|
|
|
1
|
-
export default TinyToastNotify;
|
|
2
|
-
/**
|
|
3
|
-
* A callback function used to manually close a notification.
|
|
4
|
-
* Passed as a second argument to `onClick` handlers, allowing programmatic dismissal of the toast.
|
|
5
|
-
*/
|
|
6
1
|
export type CloseToastFunc = () => void;
|
|
7
|
-
/**
|
|
8
|
-
* Represents the data used to display a notification.
|
|
9
|
-
* Can be a plain string (used as the message), or an object with more customization options.
|
|
10
|
-
*/
|
|
11
2
|
export type NotifyData = string | {
|
|
12
3
|
message: string;
|
|
13
4
|
title?: string;
|
|
14
|
-
onClick?: (
|
|
5
|
+
onClick?: (event: MouseEvent, func: CloseToastFunc) => void;
|
|
15
6
|
html?: boolean;
|
|
16
7
|
avatar?: string;
|
|
17
8
|
};
|
|
@@ -28,7 +19,7 @@ export type NotifyData = string | {
|
|
|
28
19
|
* @typedef {string | {
|
|
29
20
|
* message: string, // The main message to display
|
|
30
21
|
* title?: string, // Optional title to appear above the message
|
|
31
|
-
* onClick?:
|
|
22
|
+
* onClick?: (event: MouseEvent, func: CloseToastFunc) => void, // Optional click handler for the notification
|
|
32
23
|
* html?: boolean, // Whether the message should be interpreted as raw HTML
|
|
33
24
|
* avatar?: string // Optional URL to an avatar image shown on the left
|
|
34
25
|
* }} NotifyData
|
|
@@ -54,6 +45,13 @@ export type NotifyData = string | {
|
|
|
54
45
|
* @class
|
|
55
46
|
*/
|
|
56
47
|
declare class TinyToastNotify {
|
|
48
|
+
#private;
|
|
49
|
+
/**
|
|
50
|
+
* Gets the current destruction status of the instance.
|
|
51
|
+
*
|
|
52
|
+
* @returns {boolean} True if the instance is destroyed, false otherwise.
|
|
53
|
+
*/
|
|
54
|
+
get destroyed(): boolean;
|
|
57
55
|
/**
|
|
58
56
|
* @param {'top'|'bottom'} y - 'top' or 'bottom'
|
|
59
57
|
* @param {'right'|'left'|'center'} x - 'right', 'left', or 'center'
|
|
@@ -62,7 +60,7 @@ declare class TinyToastNotify {
|
|
|
62
60
|
* @param {number} fadeOutDuration - Time in ms for fade-out effect
|
|
63
61
|
* @param {string} [selector='.notify-container'] - Base selector for container
|
|
64
62
|
*/
|
|
65
|
-
constructor(y?:
|
|
63
|
+
constructor(y?: 'top' | 'bottom', x?: 'right' | 'left' | 'center', baseDuration?: number, extraPerChar?: number, fadeOutDuration?: number, selector?: string);
|
|
66
64
|
/**
|
|
67
65
|
* Returns the notification container element.
|
|
68
66
|
* Ensures that the container is a valid HTMLElement.
|
|
@@ -76,7 +74,7 @@ declare class TinyToastNotify {
|
|
|
76
74
|
*
|
|
77
75
|
* @returns {'top'|'bottom'} The vertical direction of the notification container.
|
|
78
76
|
*/
|
|
79
|
-
getY():
|
|
77
|
+
getY(): 'top' | 'bottom';
|
|
80
78
|
/**
|
|
81
79
|
* Sets the vertical position of the notification container.
|
|
82
80
|
* Updates the container's class to reflect the new position.
|
|
@@ -84,13 +82,13 @@ declare class TinyToastNotify {
|
|
|
84
82
|
* @param {'top'|'bottom'} value - The vertical direction to set.
|
|
85
83
|
* @throws {Error} If the value is invalid.
|
|
86
84
|
*/
|
|
87
|
-
setY(value:
|
|
85
|
+
setY(value: 'top' | 'bottom'): void;
|
|
88
86
|
/**
|
|
89
87
|
* Returns the current horizontal position.
|
|
90
88
|
*
|
|
91
89
|
* @returns {'left'|'right'|'center'} The horizontal direction of the notification container.
|
|
92
90
|
*/
|
|
93
|
-
getX():
|
|
91
|
+
getX(): 'left' | 'right' | 'center';
|
|
94
92
|
/**
|
|
95
93
|
* Sets the horizontal position of the notification container.
|
|
96
94
|
* Updates the container's class to reflect the new position.
|
|
@@ -98,7 +96,7 @@ declare class TinyToastNotify {
|
|
|
98
96
|
* @param {'left'|'right'|'center'} value - The horizontal direction to set.
|
|
99
97
|
* @throws {Error} If the value is invalid.
|
|
100
98
|
*/
|
|
101
|
-
setX(value:
|
|
99
|
+
setX(value: 'left' | 'right' | 'center'): void;
|
|
102
100
|
/**
|
|
103
101
|
* Returns the base duration for displaying the notification.
|
|
104
102
|
*
|
|
@@ -160,6 +158,6 @@ declare class TinyToastNotify {
|
|
|
160
158
|
* @returns {void}
|
|
161
159
|
*/
|
|
162
160
|
destroy(): void;
|
|
163
|
-
#private;
|
|
164
161
|
}
|
|
162
|
+
export default TinyToastNotify;
|
|
165
163
|
//# sourceMappingURL=TinyToastNotify.d.mts.map
|