tiny-essentials 1.20.0 → 1.20.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/dist/v1/TinyBasicsEs.min.js +1 -1
- package/dist/v1/TinyDragger.min.js +1 -1
- package/dist/v1/TinyEssentials.min.js +1 -1
- package/dist/v1/TinyHtml.min.js +1 -1
- package/dist/v1/TinySmartScroller.min.js +1 -1
- package/dist/v1/TinyUploadClicker.min.js +1 -1
- package/dist/v1/libs/TinyDragger.cjs +1 -1
- package/dist/v1/libs/TinyDragger.mjs +1 -1
- package/dist/v1/libs/TinyHtml.cjs +292 -103
- package/dist/v1/libs/TinyHtml.d.mts +142 -39
- package/dist/v1/libs/TinyHtml.mjs +266 -94
- package/dist/v1/libs/TinyIframeEvents.cjs +2 -1
- package/dist/v1/libs/TinyNewWinEvents.cjs +4 -2
- package/docs/v1/libs/TinyHtml.md +128 -6
- package/package.json +1 -1
- package/dist/v1/ColorSafeStringify.js +0 -235
- package/dist/v1/TinyAfterScrollWatcher.js +0 -219
- package/dist/v1/TinyBasicsEs.js +0 -9334
- package/dist/v1/TinyClipboard.js +0 -459
- package/dist/v1/TinyColorConverter.js +0 -617
- package/dist/v1/TinyDomReadyManager.js +0 -213
- package/dist/v1/TinyDragDropDetector.js +0 -307
- package/dist/v1/TinyDragger.js +0 -6569
- package/dist/v1/TinyEssentials.js +0 -20792
- package/dist/v1/TinyEvents.js +0 -402
- package/dist/v1/TinyHtml.js +0 -5545
- package/dist/v1/TinyIframeEvents.js +0 -854
- package/dist/v1/TinyLevelUp.js +0 -291
- package/dist/v1/TinyLocalStorage.js +0 -1440
- package/dist/v1/TinyNewWinEvents.js +0 -888
- package/dist/v1/TinyNotifications.js +0 -408
- package/dist/v1/TinyNotifyCenter.js +0 -493
- package/dist/v1/TinyPromiseQueue.js +0 -299
- package/dist/v1/TinyRateLimiter.js +0 -611
- package/dist/v1/TinySmartScroller.js +0 -7039
- package/dist/v1/TinyTextRangeEditor.js +0 -497
- package/dist/v1/TinyTimeout.js +0 -233
- package/dist/v1/TinyToastNotify.js +0 -441
- package/dist/v1/TinyUploadClicker.js +0 -14353
- package/dist/v1/UltraRandomMsgGen.js +0 -995
|
@@ -1,408 +0,0 @@
|
|
|
1
|
-
/******/ (() => { // webpackBootstrap
|
|
2
|
-
/******/ "use strict";
|
|
3
|
-
/******/ // The require scope
|
|
4
|
-
/******/ var __webpack_require__ = {};
|
|
5
|
-
/******/
|
|
6
|
-
/************************************************************************/
|
|
7
|
-
/******/ /* webpack/runtime/define property getters */
|
|
8
|
-
/******/ (() => {
|
|
9
|
-
/******/ // define getter functions for harmony exports
|
|
10
|
-
/******/ __webpack_require__.d = (exports, definition) => {
|
|
11
|
-
/******/ for(var key in definition) {
|
|
12
|
-
/******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
|
|
13
|
-
/******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
|
|
14
|
-
/******/ }
|
|
15
|
-
/******/ }
|
|
16
|
-
/******/ };
|
|
17
|
-
/******/ })();
|
|
18
|
-
/******/
|
|
19
|
-
/******/ /* webpack/runtime/hasOwnProperty shorthand */
|
|
20
|
-
/******/ (() => {
|
|
21
|
-
/******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
|
|
22
|
-
/******/ })();
|
|
23
|
-
/******/
|
|
24
|
-
/************************************************************************/
|
|
25
|
-
var __webpack_exports__ = {};
|
|
26
|
-
|
|
27
|
-
// EXPORTS
|
|
28
|
-
__webpack_require__.d(__webpack_exports__, {
|
|
29
|
-
TinyNotifications: () => (/* reexport */ libs_TinyNotifications)
|
|
30
|
-
});
|
|
31
|
-
|
|
32
|
-
;// ./src/v1/basics/text.mjs
|
|
33
|
-
/**
|
|
34
|
-
* Converts a string to title case where the first letter of each word is capitalized.
|
|
35
|
-
* All other letters are converted to lowercase.
|
|
36
|
-
*
|
|
37
|
-
* Example: "hello world" -> "Hello World"
|
|
38
|
-
*
|
|
39
|
-
* @param {string} str - The string to be converted to title case.
|
|
40
|
-
* @returns {string} The string converted to title case.
|
|
41
|
-
*/
|
|
42
|
-
function toTitleCase(str) {
|
|
43
|
-
return str.replace(/\w\S*/g, (txt) => txt.charAt(0).toUpperCase() + txt.substr(1).toLowerCase());
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
/**
|
|
47
|
-
* Converts a string to title case where the first letter of each word is capitalized,
|
|
48
|
-
* but the first letter of the entire string is left lowercase.
|
|
49
|
-
*
|
|
50
|
-
* Example: "hello world" -> "hello World"
|
|
51
|
-
*
|
|
52
|
-
* @param {string} str - The string to be converted to title case with the first letter in lowercase.
|
|
53
|
-
* @returns {string} The string converted to title case with the first letter in lowercase.
|
|
54
|
-
*/
|
|
55
|
-
function toTitleCaseLowerFirst(str) {
|
|
56
|
-
const titleCased = str.replace(
|
|
57
|
-
/\w\S*/g,
|
|
58
|
-
(txt) => txt.charAt(0).toUpperCase() + txt.substr(1).toLowerCase(),
|
|
59
|
-
);
|
|
60
|
-
return titleCased.charAt(0).toLowerCase() + titleCased.slice(1);
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
/**
|
|
64
|
-
* Enables a keyboard shortcut to toggle a CSS class on the document body.
|
|
65
|
-
*
|
|
66
|
-
* This function listens for a specific key combination: `Ctrl + Alt + [key]`.
|
|
67
|
-
* When triggered, it prevents the default behavior and toggles the
|
|
68
|
-
* `detect-made-by-ai` class on the `<body>`, which can be used to apply visual
|
|
69
|
-
* indicators or filters on AI-generated content.
|
|
70
|
-
*
|
|
71
|
-
* If executed outside of a browser environment (e.g., in Node.js), the function logs an error and exits.
|
|
72
|
-
* If the `<body>` is not available at the moment the shortcut is triggered, a warning is logged.
|
|
73
|
-
*
|
|
74
|
-
* @param {string} [key='a'] - The lowercase character key to be used in combination with Ctrl and Alt.
|
|
75
|
-
*/
|
|
76
|
-
function addAiMarkerShortcut(key = 'a') {
|
|
77
|
-
if (typeof HTMLElement === 'undefined') {
|
|
78
|
-
console.error(
|
|
79
|
-
'[AiMarkerShortcut] Environment does not support the DOM. This function must be run in a browser.',
|
|
80
|
-
);
|
|
81
|
-
return;
|
|
82
|
-
}
|
|
83
|
-
document.addEventListener('keydown', function (event) {
|
|
84
|
-
if (event.ctrlKey && event.altKey && event.key.toLowerCase() === key) {
|
|
85
|
-
event.preventDefault(); // Prevent any default behavior
|
|
86
|
-
if (!document.body) {
|
|
87
|
-
console.warn(
|
|
88
|
-
'[AiMarkerShortcut] <body> element not found. Cannot toggle class. Ensure the DOM is fully loaded when using the shortcut.',
|
|
89
|
-
);
|
|
90
|
-
return;
|
|
91
|
-
}
|
|
92
|
-
document.body.classList.toggle('detect-made-by-ai');
|
|
93
|
-
}
|
|
94
|
-
});
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
/**
|
|
98
|
-
* Trims a text string to a specified character limit, attempting to avoid cutting words in half.
|
|
99
|
-
* If a space is found before the limit and it's not too far from the limit (at least 60%),
|
|
100
|
-
* the cut is made at that space; otherwise, the text is hard-cut at the limit.
|
|
101
|
-
* If the input is shorter than the limit, it is returned unchanged.
|
|
102
|
-
*
|
|
103
|
-
* @param {string} text - The input text to be trimmed.
|
|
104
|
-
* @param {number} limit - The maximum number of characters allowed.
|
|
105
|
-
* @param {number} [safeCutZone=0.6] - A decimal between 0 and 1 representing the minimal acceptable position
|
|
106
|
-
* (as a fraction of `limit`) to cut at a space. Defaults to 0.6.
|
|
107
|
-
* @returns {string} - The trimmed text, possibly ending with an ellipsis ("...").
|
|
108
|
-
* @throws {TypeError} - Throws if `text` is not a string.
|
|
109
|
-
* @throws {TypeError} - Throws if `limit` is not a positive integer.
|
|
110
|
-
* @throws {TypeError} - Throws if `safeCutZone` is not a number between 0 and 1 (inclusive).
|
|
111
|
-
*/
|
|
112
|
-
function safeTextTrim(text, limit, safeCutZone = 0.6) {
|
|
113
|
-
if (typeof text !== 'string')
|
|
114
|
-
throw new TypeError(`Expected a string for 'text', but received ${typeof text}`);
|
|
115
|
-
if (!Number.isInteger(limit) || limit <= 0)
|
|
116
|
-
throw new TypeError(`Expected 'limit' to be a positive integer, but received ${limit}`);
|
|
117
|
-
if (typeof safeCutZone !== 'number' || safeCutZone < 0 || safeCutZone > 1)
|
|
118
|
-
throw new TypeError(
|
|
119
|
-
`Expected 'safeCutZone' to be a number between 0 and 1, but received ${safeCutZone}`,
|
|
120
|
-
);
|
|
121
|
-
|
|
122
|
-
let result = text.trim();
|
|
123
|
-
if (result.length > limit) {
|
|
124
|
-
// Try to cut the string into a space before the limit
|
|
125
|
-
const safeCut = result.lastIndexOf(' ', limit);
|
|
126
|
-
|
|
127
|
-
if (safeCut > 0 && safeCut >= limit * safeCutZone) {
|
|
128
|
-
// Only cuts where there is a space, and if the cut is not too early
|
|
129
|
-
return `${result.substring(0, safeCut).trim()}...`;
|
|
130
|
-
} else {
|
|
131
|
-
// Emergency: Cuts straight to the limit and adds "...".
|
|
132
|
-
return `${result.substring(0, limit).trim()}...`;
|
|
133
|
-
}
|
|
134
|
-
}
|
|
135
|
-
|
|
136
|
-
return result;
|
|
137
|
-
}
|
|
138
|
-
|
|
139
|
-
/*
|
|
140
|
-
import { useEffect } from "react";
|
|
141
|
-
|
|
142
|
-
function KeyPressHandler() {
|
|
143
|
-
useEffect(() => {
|
|
144
|
-
const handleKeyDown = (event) => {
|
|
145
|
-
if (event.ctrlKey && event.altKey && event.key.toLowerCase() === "a") {
|
|
146
|
-
event.preventDefault();
|
|
147
|
-
document.body.classList.toggle("detect-made-by-ai");
|
|
148
|
-
}
|
|
149
|
-
};
|
|
150
|
-
|
|
151
|
-
document.addEventListener("keydown", handleKeyDown);
|
|
152
|
-
return () => {
|
|
153
|
-
document.removeEventListener("keydown", handleKeyDown);
|
|
154
|
-
};
|
|
155
|
-
}, []);
|
|
156
|
-
|
|
157
|
-
return null;
|
|
158
|
-
}
|
|
159
|
-
|
|
160
|
-
export default KeyPressHandler;
|
|
161
|
-
*/
|
|
162
|
-
|
|
163
|
-
;// ./src/v1/libs/TinyNotifications.mjs
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
/**
|
|
167
|
-
* A utility class to manage browser notifications with sound and custom behavior.
|
|
168
|
-
* Useful for triggering system notifications with optional sound, avatar icon, body truncation, and click actions.
|
|
169
|
-
*
|
|
170
|
-
* @class
|
|
171
|
-
*/
|
|
172
|
-
class TinyNotifications {
|
|
173
|
-
/** @type {boolean} Whether notifications are currently allowed by the user. */
|
|
174
|
-
#allowed = false;
|
|
175
|
-
|
|
176
|
-
/** @type {boolean} Indicates whether the user has already requested permission at least once. */
|
|
177
|
-
#permissionRequested = false;
|
|
178
|
-
|
|
179
|
-
/** @type {HTMLAudioElement|null} Audio element to play when a notification is triggered. */
|
|
180
|
-
#audio = null;
|
|
181
|
-
|
|
182
|
-
/** @type {number} Maximum number of characters in the notification body. */
|
|
183
|
-
#bodyLimit = 100;
|
|
184
|
-
|
|
185
|
-
/** @type {string|null} Default avatar icon URL for notifications. */
|
|
186
|
-
#defaultIcon = null;
|
|
187
|
-
|
|
188
|
-
/** @type {(this: Notification, evt: Event) => any} Default handler when a notification is clicked. */
|
|
189
|
-
#defaultOnClick;
|
|
190
|
-
|
|
191
|
-
/**
|
|
192
|
-
* Constructs a new instance of TinyNotifications.
|
|
193
|
-
*
|
|
194
|
-
* @param {Object} [settings={}] - Optional settings to initialize the notification manager.
|
|
195
|
-
* @param {string|HTMLAudioElement|null} [settings.audio] - Path or URL to the audio file for notification sounds.
|
|
196
|
-
* @param {string|null} [settings.defaultIcon] - Default icon URL to be used in notifications.
|
|
197
|
-
* @param {number} [settings.bodyLimit=100] - Maximum number of characters allowed in the notification body.
|
|
198
|
-
* @param {(this: Notification, evt: Event) => any} [settings.defaultOnClick] - Default function to execute when a notification is clicked.
|
|
199
|
-
* @throws {TypeError} If any of the parameters are of an invalid type.
|
|
200
|
-
*/
|
|
201
|
-
constructor({
|
|
202
|
-
audio = null,
|
|
203
|
-
defaultIcon = null,
|
|
204
|
-
bodyLimit = 100,
|
|
205
|
-
defaultOnClick = function (event) {
|
|
206
|
-
event.preventDefault();
|
|
207
|
-
if (window.focus) window.focus();
|
|
208
|
-
this.close();
|
|
209
|
-
},
|
|
210
|
-
} = {}) {
|
|
211
|
-
if (!(audio instanceof HTMLAudioElement) && typeof audio !== 'string' && audio !== null)
|
|
212
|
-
throw new TypeError('audio must be an instance of HTMLAudioElement or null.');
|
|
213
|
-
if (defaultIcon !== null && typeof defaultIcon !== 'string')
|
|
214
|
-
throw new TypeError('defaultIcon must be a string or null.');
|
|
215
|
-
if (!Number.isFinite(bodyLimit) || bodyLimit < 0)
|
|
216
|
-
throw new TypeError('bodyLimit must be a non-negative number.');
|
|
217
|
-
if (typeof defaultOnClick !== 'function')
|
|
218
|
-
throw new TypeError('defaultOnClick must be a function.');
|
|
219
|
-
|
|
220
|
-
this.#audio = typeof audio !== 'string' ? audio : new Audio(audio);
|
|
221
|
-
this.#defaultIcon = defaultIcon;
|
|
222
|
-
this.#bodyLimit = bodyLimit;
|
|
223
|
-
this.#defaultOnClick = defaultOnClick;
|
|
224
|
-
}
|
|
225
|
-
|
|
226
|
-
/**
|
|
227
|
-
* Requests permission from the user to show notifications.
|
|
228
|
-
* Updates the internal `#allowed` flag.
|
|
229
|
-
*
|
|
230
|
-
* @returns {Promise<boolean>} Resolves to `true` if permission is granted, otherwise `false`.
|
|
231
|
-
*/
|
|
232
|
-
requestPerm() {
|
|
233
|
-
const tinyThis = this;
|
|
234
|
-
return new Promise((resolve, reject) => {
|
|
235
|
-
if (tinyThis.isCompatible()) {
|
|
236
|
-
if (Notification.permission === 'default') {
|
|
237
|
-
Notification.requestPermission()
|
|
238
|
-
.then((permission) => {
|
|
239
|
-
this.#permissionRequested = true;
|
|
240
|
-
tinyThis.#allowed = permission === 'granted';
|
|
241
|
-
resolve(tinyThis.#allowed);
|
|
242
|
-
})
|
|
243
|
-
.catch(reject);
|
|
244
|
-
} else {
|
|
245
|
-
this.#permissionRequested = true;
|
|
246
|
-
tinyThis.#allowed = Notification.permission === 'granted';
|
|
247
|
-
resolve(tinyThis.#allowed);
|
|
248
|
-
}
|
|
249
|
-
} else {
|
|
250
|
-
this.#permissionRequested = true;
|
|
251
|
-
tinyThis.#allowed = false;
|
|
252
|
-
resolve(false);
|
|
253
|
-
}
|
|
254
|
-
});
|
|
255
|
-
}
|
|
256
|
-
|
|
257
|
-
/**
|
|
258
|
-
* Checks if the Notification API is supported by the current browser.
|
|
259
|
-
*
|
|
260
|
-
* @returns {boolean} Returns `true` if notifications are supported, otherwise `false`.
|
|
261
|
-
*/
|
|
262
|
-
isCompatible() {
|
|
263
|
-
return 'Notification' in window;
|
|
264
|
-
}
|
|
265
|
-
|
|
266
|
-
/**
|
|
267
|
-
* Sends a browser notification with the provided title and configuration.
|
|
268
|
-
* Truncates the body if necessary and plays a sound if configured.
|
|
269
|
-
*
|
|
270
|
-
* @param {string} title - The title of the notification.
|
|
271
|
-
* @param {NotificationOptions & { vibrate?: number[] }} [config={}] - Optional configuration for the notification.
|
|
272
|
-
* @returns {Notification|null} The created `Notification` instance, or `null` if permission is not granted.
|
|
273
|
-
* @throws {TypeError} If the title is not a string or config is not a valid object.
|
|
274
|
-
*/
|
|
275
|
-
send(title, config = {}) {
|
|
276
|
-
if (!this.#permissionRequested)
|
|
277
|
-
throw new Error('You must call requestPerm() before sending a notification.');
|
|
278
|
-
if (typeof title !== 'string') throw new TypeError('title must be a string.');
|
|
279
|
-
if (typeof config !== 'object' || config === null)
|
|
280
|
-
throw new TypeError('config must be a non-null object.');
|
|
281
|
-
|
|
282
|
-
if (!this.#allowed) return null;
|
|
283
|
-
|
|
284
|
-
const { icon = this.#defaultIcon || undefined, vibrate = [200, 100, 200] } = config;
|
|
285
|
-
const options = { ...config };
|
|
286
|
-
if (typeof icon === 'string') options.icon = icon;
|
|
287
|
-
if (Array.isArray(vibrate)) options.vibrate = vibrate;
|
|
288
|
-
|
|
289
|
-
if (typeof options.body === 'string')
|
|
290
|
-
options.body = safeTextTrim(options.body, this.#bodyLimit);
|
|
291
|
-
|
|
292
|
-
const notification = new Notification(title, options);
|
|
293
|
-
notification.addEventListener('show', () => {
|
|
294
|
-
if (!(this.#audio instanceof HTMLAudioElement)) return;
|
|
295
|
-
this.#audio.currentTime = 0;
|
|
296
|
-
this.#audio.play().catch((err) => console.error(err));
|
|
297
|
-
});
|
|
298
|
-
|
|
299
|
-
if (typeof this.#defaultOnClick === 'function')
|
|
300
|
-
notification.addEventListener('click', this.#defaultOnClick);
|
|
301
|
-
|
|
302
|
-
return notification;
|
|
303
|
-
}
|
|
304
|
-
|
|
305
|
-
// === Getters and Setters ===
|
|
306
|
-
|
|
307
|
-
/**
|
|
308
|
-
* Whether the requestPerm() method was already called.
|
|
309
|
-
* @returns {boolean}
|
|
310
|
-
*/
|
|
311
|
-
wasPermissionRequested() {
|
|
312
|
-
return this.#permissionRequested;
|
|
313
|
-
}
|
|
314
|
-
|
|
315
|
-
/**
|
|
316
|
-
* Returns the current permission status.
|
|
317
|
-
* @returns {boolean} `true` if permission was granted, otherwise `false`.
|
|
318
|
-
*/
|
|
319
|
-
isAllowed() {
|
|
320
|
-
return this.#allowed;
|
|
321
|
-
}
|
|
322
|
-
|
|
323
|
-
/**
|
|
324
|
-
* Gets the current notification audio.
|
|
325
|
-
* @returns {HTMLAudioElement|null} The sound element, or `null` if not set.
|
|
326
|
-
*/
|
|
327
|
-
getAudio() {
|
|
328
|
-
return this.#audio;
|
|
329
|
-
}
|
|
330
|
-
|
|
331
|
-
/**
|
|
332
|
-
* Sets the audio element used for notification sounds.
|
|
333
|
-
* @param {HTMLAudioElement|string|null} value - A valid `HTMLAudioElement` or `null` to disable sound.
|
|
334
|
-
* @throws {TypeError} If the value is not an `HTMLAudioElement` or `null`.
|
|
335
|
-
*/
|
|
336
|
-
setAudio(value) {
|
|
337
|
-
if (!(value instanceof HTMLAudioElement) && typeof value !== 'string' && value !== null)
|
|
338
|
-
throw new TypeError('sound must be an instance of HTMLAudioElement or null.');
|
|
339
|
-
this.#audio = typeof value !== 'string' ? value : new Audio(value);
|
|
340
|
-
}
|
|
341
|
-
|
|
342
|
-
/**
|
|
343
|
-
* Gets the maximum length of the notification body text.
|
|
344
|
-
* @returns {number} Number of characters allowed.
|
|
345
|
-
*/
|
|
346
|
-
getBodyLimit() {
|
|
347
|
-
return this.#bodyLimit;
|
|
348
|
-
}
|
|
349
|
-
|
|
350
|
-
/**
|
|
351
|
-
* Sets the maximum number of characters allowed in the notification body.
|
|
352
|
-
* @param {number} value - A non-negative integer.
|
|
353
|
-
* @throws {TypeError} If the value is not a valid non-negative number.
|
|
354
|
-
*/
|
|
355
|
-
setBodyLimit(value) {
|
|
356
|
-
if (!Number.isFinite(value) || value < 0)
|
|
357
|
-
throw new TypeError('bodyLimit must be a non-negative number.');
|
|
358
|
-
this.#bodyLimit = value;
|
|
359
|
-
}
|
|
360
|
-
|
|
361
|
-
/**
|
|
362
|
-
* Gets the default avatar icon URL.
|
|
363
|
-
* @returns {string|null} The URL string or `null`.
|
|
364
|
-
*/
|
|
365
|
-
getDefaultAvatar() {
|
|
366
|
-
return this.#defaultIcon;
|
|
367
|
-
}
|
|
368
|
-
|
|
369
|
-
/**
|
|
370
|
-
* Sets the default avatar icon URL.
|
|
371
|
-
* @param {string|null} value - A string URL or `null` to disable default icon.
|
|
372
|
-
* @throws {TypeError} If the value is not a string or `null`.
|
|
373
|
-
*/
|
|
374
|
-
setDefaultAvatar(value) {
|
|
375
|
-
if (!(typeof value === 'string' || value === null))
|
|
376
|
-
throw new TypeError('defaultIcon must be a string or null.');
|
|
377
|
-
this.#defaultIcon = value;
|
|
378
|
-
}
|
|
379
|
-
|
|
380
|
-
/**
|
|
381
|
-
* Gets the default click event handler for notifications.
|
|
382
|
-
* @returns {(this: Notification, evt: Event) => any} The current click handler function.
|
|
383
|
-
*/
|
|
384
|
-
getDefaultOnClick() {
|
|
385
|
-
return this.#defaultOnClick;
|
|
386
|
-
}
|
|
387
|
-
|
|
388
|
-
/**
|
|
389
|
-
* Sets the default click event handler for notifications.
|
|
390
|
-
* @param {(this: Notification, evt: Event) => any} value - A function to handle the notification click event.
|
|
391
|
-
* @throws {TypeError} If the value is not a function.
|
|
392
|
-
*/
|
|
393
|
-
setDefaultOnClick(value) {
|
|
394
|
-
if (typeof value !== 'function') throw new TypeError('defaultOnClick must be a function.');
|
|
395
|
-
this.#defaultOnClick = value;
|
|
396
|
-
}
|
|
397
|
-
}
|
|
398
|
-
|
|
399
|
-
/* harmony default export */ const libs_TinyNotifications = (TinyNotifications);
|
|
400
|
-
|
|
401
|
-
;// ./src/v1/build/TinyNotifications.mjs
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
window.TinyNotifications = __webpack_exports__.TinyNotifications;
|
|
407
|
-
/******/ })()
|
|
408
|
-
;
|