tiny-essentials 1.10.2 → 1.12.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (106) hide show
  1. package/README.md +13 -4
  2. package/dist/node_modules/firebase-functions/lib/common/trace.cjs +82 -0
  3. package/dist/node_modules/firebase-functions/lib/logger/common.cjs +57 -0
  4. package/dist/node_modules/firebase-functions/lib/logger/index.cjs +158 -0
  5. package/dist/{TinyEssentials.js → v1/TinyBasicsEs.js} +1726 -1362
  6. package/dist/v1/TinyBasicsEs.min.js +2 -0
  7. package/dist/v1/TinyDragDropDetector.js +307 -0
  8. package/dist/v1/TinyDragDropDetector.min.js +1 -0
  9. package/dist/{TinyBasicsEs.js → v1/TinyDragger.js} +1004 -506
  10. package/dist/v1/TinyDragger.min.js +2 -0
  11. package/dist/v1/TinyEssentials.js +7938 -0
  12. package/dist/v1/TinyEssentials.min.js +2 -0
  13. package/dist/v1/TinyEssentials.min.js.LICENSE.txt +8 -0
  14. package/dist/v1/TinyNotifyCenter.js +493 -0
  15. package/dist/v1/TinyNotifyCenter.min.js +1 -0
  16. package/dist/v1/TinyToastNotify.js +441 -0
  17. package/dist/v1/TinyToastNotify.min.js +1 -0
  18. package/dist/v1/TinyUploadClicker.js +5235 -0
  19. package/dist/v1/TinyUploadClicker.min.js +2 -0
  20. package/dist/v1/TinyUploadClicker.min.js.LICENSE.txt +8 -0
  21. package/dist/v1/basics/fileManager.cjs +524 -0
  22. package/dist/v1/basics/fileManager.d.mts +209 -0
  23. package/dist/v1/basics/fileManager.mjs +443 -0
  24. package/dist/v1/basics/fullScreen.cjs +134 -0
  25. package/dist/v1/basics/fullScreen.d.mts +8 -0
  26. package/dist/v1/basics/fullScreen.mjs +121 -0
  27. package/dist/v1/basics/html.cjs +262 -0
  28. package/dist/v1/basics/html.d.mts +63 -0
  29. package/dist/v1/basics/html.mjs +208 -0
  30. package/dist/v1/basics/index.cjs +40 -0
  31. package/dist/v1/basics/index.d.mts +38 -1
  32. package/dist/v1/basics/index.mjs +4 -1
  33. package/dist/v1/build/TinyDragDropDetector.cjs +7 -0
  34. package/dist/v1/build/TinyDragDropDetector.d.mts +3 -0
  35. package/dist/v1/build/TinyDragDropDetector.mjs +2 -0
  36. package/dist/v1/build/TinyDragger.cjs +7 -0
  37. package/dist/v1/build/TinyDragger.d.mts +3 -0
  38. package/dist/v1/build/TinyDragger.mjs +2 -0
  39. package/dist/v1/build/TinyNotifyCenter.cjs +7 -0
  40. package/dist/v1/build/TinyNotifyCenter.d.mts +3 -0
  41. package/dist/v1/build/TinyNotifyCenter.mjs +2 -0
  42. package/dist/v1/build/TinyToastNotify.cjs +7 -0
  43. package/dist/v1/build/TinyToastNotify.d.mts +3 -0
  44. package/dist/v1/build/TinyToastNotify.mjs +2 -0
  45. package/dist/v1/build/TinyUploadClicker.cjs +7 -0
  46. package/dist/v1/build/TinyUploadClicker.d.mts +3 -0
  47. package/dist/v1/build/TinyUploadClicker.mjs +2 -0
  48. package/dist/v1/css/TinyDraggerExample.css +21 -0
  49. package/dist/v1/css/TinyDraggerExample.min.css +1 -0
  50. package/dist/v1/css/TinyNotify.css +350 -0
  51. package/dist/v1/css/TinyNotify.min.css +1 -0
  52. package/dist/v1/index.cjs +48 -0
  53. package/dist/v1/index.d.mts +42 -1
  54. package/dist/v1/index.mjs +8 -1
  55. package/dist/v1/libs/TinyDragDropDetector.cjs +268 -0
  56. package/dist/v1/libs/TinyDragDropDetector.d.mts +123 -0
  57. package/dist/v1/libs/TinyDragDropDetector.mjs +228 -0
  58. package/dist/v1/libs/TinyDragger.cjs +801 -0
  59. package/dist/v1/libs/TinyDragger.d.mts +300 -0
  60. package/dist/v1/libs/TinyDragger.mjs +689 -0
  61. package/dist/v1/libs/TinyNotifyCenter.cjs +454 -0
  62. package/dist/v1/libs/TinyNotifyCenter.d.mts +175 -0
  63. package/dist/v1/libs/TinyNotifyCenter.mjs +413 -0
  64. package/dist/v1/libs/TinyToastNotify.cjs +402 -0
  65. package/dist/v1/libs/TinyToastNotify.d.mts +165 -0
  66. package/dist/v1/libs/TinyToastNotify.mjs +352 -0
  67. package/dist/v1/libs/TinyUploadClicker.cjs +223 -0
  68. package/dist/v1/libs/TinyUploadClicker.d.mts +80 -0
  69. package/dist/v1/libs/TinyUploadClicker.mjs +182 -0
  70. package/docs/{README.md → v1/README.md} +8 -0
  71. package/docs/v1/basics/fileManager.md +222 -0
  72. package/docs/v1/basics/fullScreen.md +183 -0
  73. package/docs/v1/basics/html.md +243 -0
  74. package/docs/{basics → v1/basics}/text.md +2 -2
  75. package/docs/v1/libs/TinyDragDropDetector.md +143 -0
  76. package/docs/v1/libs/TinyDragger.md +415 -0
  77. package/docs/{libs → v1/libs}/TinyLevelUp.md +1 -1
  78. package/docs/v1/libs/TinyNotifyCenter.md +311 -0
  79. package/docs/v1/libs/TinyToastNotify.md +309 -0
  80. package/docs/v1/libs/TinyUploadClicker.md +108 -0
  81. package/package.json +14 -2
  82. package/dist/TinyBasicsEs.min.js +0 -2
  83. package/dist/TinyEssentials.min.js +0 -2
  84. package/dist/v1/libs/TinyRateLimit.cjs +0 -196
  85. package/dist/v1/libs/TinyRateLimit.d.mts +0 -86
  86. package/dist/v1/libs/TinyRateLimit.mjs +0 -171
  87. /package/dist/{ColorSafeStringify.js → v1/ColorSafeStringify.js} +0 -0
  88. /package/dist/{ColorSafeStringify.min.js → v1/ColorSafeStringify.min.js} +0 -0
  89. /package/dist/{TinyBasicsEs.min.js.LICENSE.txt → v1/TinyBasicsEs.min.js.LICENSE.txt} +0 -0
  90. /package/dist/{TinyEssentials.min.js.LICENSE.txt → v1/TinyDragger.min.js.LICENSE.txt} +0 -0
  91. /package/dist/{TinyLevelUp.js → v1/TinyLevelUp.js} +0 -0
  92. /package/dist/{TinyLevelUp.min.js → v1/TinyLevelUp.min.js} +0 -0
  93. /package/dist/{TinyPromiseQueue.js → v1/TinyPromiseQueue.js} +0 -0
  94. /package/dist/{TinyPromiseQueue.min.js → v1/TinyPromiseQueue.min.js} +0 -0
  95. /package/dist/{TinyRateLimiter.js → v1/TinyRateLimiter.js} +0 -0
  96. /package/dist/{TinyRateLimiter.min.js → v1/TinyRateLimiter.min.js} +0 -0
  97. /package/dist/{aiMarker.css → v1/css/aiMarker.css} +0 -0
  98. /package/dist/{aiMarker.min.css → v1/css/aiMarker.min.css} +0 -0
  99. /package/docs/{basics → v1/basics}/array.md +0 -0
  100. /package/docs/{basics → v1/basics}/asyncReplace.md +0 -0
  101. /package/docs/{basics → v1/basics}/clock.md +0 -0
  102. /package/docs/{basics → v1/basics}/objFilter.md +0 -0
  103. /package/docs/{basics → v1/basics}/simpleMath.md +0 -0
  104. /package/docs/{libs → v1/libs}/ColorSafeStringify.md +0 -0
  105. /package/docs/{libs → v1/libs}/TinyPromiseQueue.md +0 -0
  106. /package/docs/{libs → v1/libs}/TinyRateLimiter.md +0 -0
@@ -0,0 +1,311 @@
1
+ # 🛎️ TinyNotifyCenter
2
+
3
+ ## Overview
4
+
5
+ `TinyNotifyCenter` is a notification center component designed to display interactive alerts in the UI.
6
+
7
+ This class renders a notification overlay on the page, allowing dynamic management of notification items — adding, clearing, and interacting with them in real time.
8
+
9
+ ---
10
+
11
+ ## 🔔 NotifyData Type
12
+
13
+ A notification entry (`NotifyData`) can be either a simple string or an object with extra data:
14
+
15
+ ```ts
16
+ type NotifyData = string | {
17
+ title?: string; // Optional title shown above the message
18
+ message: string; // Required message content (plain text or HTML)
19
+ avatar?: string; // Optional avatar image URL (displayed on the left)
20
+ onClick?: (e: MouseEvent) => void; // Optional click handler for the entire notification
21
+ }
22
+ ```
23
+
24
+ ---
25
+
26
+ ## ✨ Features
27
+
28
+ * Dynamic rendering of notification UI via the `insertTemplate()` method
29
+ * Supports both plain text and HTML content in notifications
30
+ * Optional avatars shown alongside notifications
31
+ * Supports callback functions on notification click events
32
+ * Each notification includes a close button for dismissal
33
+ * Displays a badge with the count of active notifications
34
+
35
+ ---
36
+
37
+ ## 🏗️ Static Methods
38
+
39
+ ### `static getTemplate() : string`
40
+
41
+ Returns the full HTML structure for the notification system as a **string**.
42
+
43
+ This template includes:
44
+
45
+ - A hidden `.notify-overlay` element containing the central notification panel (`#notifCenter`):
46
+ - Header with a **"Notifications"** label
47
+ - A **clear all** button (with checkmark icon)
48
+ - A **close** button (×)
49
+ - A `.list` container to hold dynamically added notification items
50
+ - A bell button (`.notify-bell`) to toggle the notification center, featuring:
51
+ - A bell SVG icon
52
+ - A badge (`#notifBadge`) displaying the number of active notifications
53
+
54
+ > 💡 This HTML can be injected into the DOM using methods like `insertAdjacentHTML()` or parsed into elements with JavaScript or jQuery.
55
+
56
+ ---
57
+
58
+ ### `static insertTemplate(where = 'afterbegin') : void`
59
+
60
+ Injects the full notification center HTML template into the `document.body`.
61
+
62
+ - Uses `insertAdjacentHTML()` to insert the markup.
63
+ - The `where` parameter controls the insertion point relative to the `<body>` element.
64
+
65
+ Possible values for `where`:
66
+
67
+ | Value | Description |
68
+ |---------------|------------------------------------------|
69
+ | `'afterbegin'` (default) | Insert right after the opening `<body>` tag |
70
+ | `'beforeend'` | Insert right before the closing `</body>` tag |
71
+ | `'beforebegin'` or `'afterend'` | Other valid positions supported by `insertAdjacentHTML` |
72
+
73
+ ---
74
+
75
+ ### Example Usage
76
+
77
+ ```js
78
+ // Insert notification center template at the start of <body>
79
+ TinyNotifyCenter.insertTemplate();
80
+
81
+ // Or insert at the end of <body>
82
+ TinyNotifyCenter.insertTemplate('beforeend');
83
+ ````
84
+
85
+ ---
86
+
87
+ ### Visual Structure Preview
88
+
89
+ ```html
90
+ <div class="notify-overlay hidden">
91
+ <div class="notify-center" id="notifCenter">
92
+ <div class="header">
93
+ <div>Notifications</div>
94
+ <div class="options">
95
+ <button class="clear-all" type="button">✔️</button>
96
+ <button class="close">×</button>
97
+ </div>
98
+ </div>
99
+ <div class="list"></div>
100
+ </div>
101
+ </div>
102
+
103
+ <button class="notify-bell" aria-label="Open notifications">
104
+ 🔔 <span class="badge" id="notifBadge">0</span>
105
+ </button>
106
+ ```
107
+
108
+ ---
109
+
110
+ ## 🛠️ Instance Methods & Constructor
111
+
112
+ ### `constructor(options = {})`
113
+
114
+ Creates a new instance of the Notification Center with configurable main elements.
115
+
116
+ | Option | Default Selector | Description |
117
+ |-----------------|----------------------------------------|----------------------------------------------|
118
+ | `center` | `document.getElementById('notifCenter')` | Container element holding notification list |
119
+ | `badge` | `document.getElementById('notifBadge')` | Badge element showing the notification count |
120
+ | `button` | `document.querySelector('.notify-bell')` | Button toggling the notification center |
121
+ | `overlay` | `document.querySelector('.notify-overlay')` | Overlay element shown when center is visible |
122
+
123
+ ⚠️ Throws an error if any of the elements are not valid HTMLElements.
124
+
125
+ **Event Listeners added internally:**
126
+
127
+ - `button` click → toggles notification center
128
+ - `close` button inside center → closes notification center
129
+ - `clear-all` button inside center → clears all notifications
130
+ - Clicking the overlay outside center → closes notification center
131
+
132
+ ---
133
+
134
+ ### ⚙️ Configuration Methods
135
+
136
+ #### `setMarkAllAsReadOnClose(value: boolean)`
137
+
138
+ Enable or disable automatic marking of all notifications as read when the center closes.
139
+
140
+ Throws a `TypeError` if `value` is not a boolean.
141
+
142
+ ---
143
+
144
+ #### `setRemoveDelay(ms: number)`
145
+
146
+ Set the delay (in milliseconds) for the remove animation when notifications are removed.
147
+
148
+ Throws an error if `ms` is not a number.
149
+
150
+ ---
151
+
152
+ ### 📋 Notification Item Accessors
153
+
154
+ #### `getItemMode(index: number) : 'text' | 'html' | null`
155
+
156
+ Returns the rendering mode (`'text'` or `'html'`) of the notification at the given index, or `null` if not found.
157
+
158
+ ---
159
+
160
+ #### `getItem(index: number) : HTMLElement`
161
+
162
+ Returns the notification element at the specified index.
163
+
164
+ Throws an error if the element is not an `HTMLElement`.
165
+
166
+ ---
167
+
168
+ #### `hasItem(index: number) : boolean`
169
+
170
+ Returns `true` if a notification exists at the given index, `false` otherwise.
171
+
172
+ ---
173
+
174
+ ### ✅ Notification State Management
175
+
176
+ #### `markAsRead(index: number | HTMLElement)`
177
+
178
+ Marks the specified notification (by index or element) as read if it was unread, updating the unread count.
179
+
180
+ ---
181
+
182
+ #### `remove(index: number)`
183
+
184
+ Removes the notification at the given index, triggering any removal animations or cleanup.
185
+
186
+ ---
187
+
188
+ #### `clear()`
189
+
190
+ Safely clears all notifications from the list, removing them one by one, handling animations properly.
191
+
192
+ ---
193
+
194
+ ### 🔔 Notification Center Visibility Controls
195
+
196
+ #### `open()`
197
+
198
+ Opens the notification center by showing the overlay and adding the `open` class.
199
+
200
+ ---
201
+
202
+ #### `close()`
203
+
204
+ Closes the notification center by hiding the overlay and removing the `open` class.
205
+
206
+ If `markAllAsReadOnClose` is enabled, marks all unread notifications as read on close.
207
+
208
+ ---
209
+
210
+ #### `toggle()`
211
+
212
+ Toggles the notification center open or closed based on current state.
213
+
214
+ ---
215
+
216
+ ### 🔢 Count Management
217
+
218
+ #### `recount()`
219
+
220
+ Recalculates the number of unread notifications by counting `.item.unread` elements in the DOM list, updating the badge count.
221
+
222
+ ---
223
+
224
+ #### `get count() : number`
225
+
226
+ Returns the current number of unread notifications tracked internally.
227
+
228
+ ---
229
+
230
+ ### ➕ `add(message, mode = 'text')`
231
+
232
+ Adds a new notification to the notification center. 🎉
233
+
234
+ **Parameters:**
235
+
236
+ * `message` (`NotifyData`):
237
+ Can be either a simple string or an object containing:
238
+
239
+ * `title` (optional): notification title 📝
240
+ * `message`: main notification text or HTML content
241
+ * `avatar` (optional): URL for an avatar image 🖼️
242
+ * `onClick` (optional): callback function triggered when the notification is clicked 🎯
243
+
244
+ * `mode` (`'text' | 'html'`, default `'text'`):
245
+ Determines if the message content should be treated as plain text or HTML.
246
+
247
+ ---
248
+
249
+ **How it works:**
250
+
251
+ 1. Creates a new `.item.unread` div to hold the notification.
252
+
253
+ 2. If `message` is an object, it extracts the title, message, avatar URL, and click callback.
254
+ Otherwise, treats `message` as plain text content.
255
+
256
+ 3. If an avatar URL is provided, creates a `.avatar` div with the avatar image as background.
257
+
258
+ 4. Creates a `.content` wrapper containing:
259
+
260
+ * An optional `.title` element if a title exists
261
+ * A `.message` element containing the message, rendered as text or HTML depending on `mode`
262
+
263
+ 5. If `onClick` callback is provided, marks the item `.clickable` and adds a click event listener that triggers the callback — but **prevents clicks on the close button** from triggering it.
264
+
265
+ 6. Adds a close button (`×`) `.notify-close` inside the notification:
266
+ Clicking it removes the notification, stopping event propagation to avoid triggering the main click callback.
267
+
268
+ 7. Prepends the notification to the top of the list, stores its mode, and updates the unread count.
269
+
270
+ ---
271
+
272
+ **In short:**
273
+ You create a rich notification element dynamically, with optional avatar, title, content (text or HTML), clickable actions, and a close button — all neatly wired up! 🚀
274
+
275
+ ---
276
+
277
+ ## 🔥 `destroy()`
278
+
279
+ Destroys the current **TinyNotifyCenter** instance.
280
+ It **removes all event listeners**, **clears all notifications**, and **optionally removes the entire notification center template from the DOM**.
281
+
282
+ ### Syntax
283
+
284
+ ```js
285
+ tinyNotifyCenter.destroy();
286
+ ```
287
+
288
+ ### Behavior
289
+
290
+ * Removes all event listeners (`click`, `close`, `clear all`, overlay clicks).
291
+ * Clears all notifications from the list.
292
+ * Removes the UI (`.notify-overlay`, `.notify-bell`, etc.) from the DOM.
293
+ * Cleans internal references (`center`, `list`, `button`, `overlay`, `badge`, `modes`).
294
+
295
+ ---
296
+
297
+ ## 🎨 CSS Files Location
298
+
299
+ The CSS files for the TinyNotify project build can be found in the following folder:
300
+
301
+ ```
302
+ dist/v1/css
303
+ ```
304
+
305
+ Inside this folder, you'll find the main stylesheets:
306
+
307
+ - `TinyNotify.css` — the full, unminified CSS file
308
+ - `TinyNotify.min.css` — the minified, optimized CSS file for production 🚀
309
+
310
+ Use these files to style your notifications!
311
+ Happy coding! ✨
@@ -0,0 +1,309 @@
1
+ # 🍞✨ `TinyToastNotify` Class
2
+
3
+ A lightweight notification system designed to display timed messages inside a container. It supports positioning, duration customization, HTML rendering, click handling, and optional avatar display.
4
+
5
+ ---
6
+
7
+ ## 🔧 Features
8
+
9
+ * 📍 **Positioning**:
10
+ Customize horizontal (`x`: `left`, `center`, `right`) and vertical (`y`: `top`, `bottom`) alignment.
11
+
12
+ * ⏳ **Dynamic display time**:
13
+ Automatically adjusts based on message length.
14
+
15
+ * 📝 **Flexible content**:
16
+
17
+ * Optional `title` 🏷️
18
+ * Optional `avatar` 🖼️
19
+ * Optional `onClick` handler 🖱️
20
+ * Optional raw HTML rendering 💡
21
+
22
+ * 🌙 **Fade-out animation**:
23
+ With customizable duration.
24
+
25
+ * 🛡️ **Robust validation**:
26
+ Ensures safe and predictable behavior.
27
+
28
+ ---
29
+
30
+ ## ⚙️ Customization Setters
31
+
32
+ * `setX(position: 'left' | 'center' | 'right')` — Sets horizontal alignment.
33
+ * `setY(position: 'top' | 'bottom')` — Sets vertical alignment.
34
+ * `setBaseDuration(ms: number)` — Base visible time in milliseconds.
35
+ * `setExtraPerChar(ms: number)` — Additional duration per character.
36
+ * `setFadeOutDuration(ms: number)` — Duration of fade-out animation.
37
+
38
+ ---
39
+
40
+ ## 🧩 Types
41
+
42
+ ### 🔁 `CloseToastFunc`
43
+
44
+ ```ts
45
+ type CloseToastFunc = () => void;
46
+ ```
47
+
48
+ A callback function used to manually close a notification.
49
+ It’s passed as the **second argument** to `onClick` handlers, allowing programmatic dismissal.
50
+
51
+ ---
52
+
53
+ ### 💬 `NotifyData`
54
+
55
+ ```ts
56
+ type NotifyData =
57
+ | string
58
+ | {
59
+ message: string; // The main message to display
60
+ title?: string; // Optional title above the message
61
+ onClick?: (event: MouseEvent, close: CloseToastFunc) => void; // Optional click handler
62
+ html?: boolean; // If true, message will be rendered as raw HTML
63
+ avatar?: string; // Optional avatar image URL
64
+ };
65
+ ```
66
+
67
+ Represents the input used to display a notification.
68
+ It can either be a plain string (used as the message), or a detailed object for richer customization.
69
+
70
+ ---
71
+
72
+ ## 🔧 Constructor: `new TinyToastNotify(...)`
73
+
74
+ Initializes a new `TinyToastNotify` instance with positioning and timing preferences.
75
+
76
+ ```ts
77
+ new TinyToastNotify(
78
+ y?: 'top' | 'bottom',
79
+ x?: 'left' | 'right' | 'center',
80
+ baseDuration?: number,
81
+ extraPerChar?: number,
82
+ fadeOutDuration?: number,
83
+ selector?: string
84
+ )
85
+ ```
86
+
87
+ ### 📝 Parameters
88
+
89
+ | Parameter | Type | Default | Description |
90
+ | ----------------- | ----------------------------------- | --------------------- | ----------------------------------------------------- |
91
+ | `y` | `'top'` \| `'bottom'` | `'top'` | Vertical alignment of the notification container |
92
+ | `x` | `'left'` \| `'center'` \| `'right'` | `'right'` | Horizontal alignment of the notification container |
93
+ | `baseDuration` | `number` | `3000` | Base display time in milliseconds |
94
+ | `extraPerChar` | `number` | `50` | Extra milliseconds added per character in the message |
95
+ | `fadeOutDuration` | `number` | `300` | Time (ms) for fade-out animation |
96
+ | `selector` | `string` | `'.notify-container'` | CSS selector used to find or create the container |
97
+
98
+ ### 🧠 Behavior
99
+
100
+ * Validates all input values strictly to prevent misconfigurations.
101
+ * Attempts to locate an existing container via the selector and alignment classes.
102
+ * If not found, it creates a new container and appends it to `document.body`.
103
+
104
+ ---
105
+
106
+ ## 📦 Method: `getContainer()`
107
+
108
+ Returns the `HTMLElement` used to host all notifications.
109
+
110
+ ```ts
111
+ getContainer(): HTMLElement
112
+ ```
113
+
114
+ ### 🔁 Returns
115
+
116
+ * The current notification container element.
117
+
118
+ ### ⚠️ Throws
119
+
120
+ * Throws an error if the container is not a valid `HTMLElement`.
121
+
122
+ ---
123
+
124
+ ## ⚙️ Position and Timing Getters & Setters
125
+
126
+ ### 🔝 `getY()`
127
+
128
+ Returns the current vertical position.
129
+
130
+ * **Returns:**
131
+ `'top' | 'bottom'` — The vertical alignment of the notification container.
132
+
133
+ ---
134
+
135
+ ### 🔄 `setY(value)`
136
+
137
+ Sets the vertical position of the notification container and updates its CSS classes.
138
+
139
+ * **Parameters:**
140
+
141
+ * `value: 'top' | 'bottom'` — The new vertical position to set.
142
+
143
+ * **Throws:**
144
+
145
+ * `Error` if the value is invalid.
146
+
147
+ ---
148
+
149
+ ### ↔️ `getX()`
150
+
151
+ Returns the current horizontal position.
152
+
153
+ * **Returns:**
154
+ `'left' | 'center' | 'right'` — The horizontal alignment of the notification container.
155
+
156
+ ---
157
+
158
+ ### 🔀 `setX(value)`
159
+
160
+ Sets the horizontal position of the notification container and updates its CSS classes.
161
+
162
+ * **Parameters:**
163
+
164
+ * `value: 'left' | 'center' | 'right'` — The new horizontal position to set.
165
+
166
+ * **Throws:**
167
+
168
+ * `Error` if the value is invalid.
169
+
170
+ ---
171
+
172
+ ### ⏲️ `getBaseDuration()`
173
+
174
+ Returns the base display duration for notifications.
175
+
176
+ * **Returns:**
177
+ `number` — Base time in milliseconds that a notification stays visible.
178
+
179
+ ---
180
+
181
+ ### ⏳ `setBaseDuration(value)`
182
+
183
+ Sets the base display duration for notifications.
184
+
185
+ * **Parameters:**
186
+
187
+ * `value: number` — Base display time in milliseconds.
188
+
189
+ * **Throws:**
190
+
191
+ * `Error` if `value` is not a valid non-negative finite number.
192
+
193
+ ---
194
+
195
+ ### ➕ `getExtraPerChar()`
196
+
197
+ Returns extra display time added per character.
198
+
199
+ * **Returns:**
200
+ `number` — Extra milliseconds added per character in the notification.
201
+
202
+ ---
203
+
204
+ ### ✏️ `setExtraPerChar(value)`
205
+
206
+ Sets the extra display time added per character.
207
+
208
+ * **Parameters:**
209
+
210
+ * `value: number` — Extra milliseconds per character.
211
+
212
+ * **Throws:**
213
+
214
+ * `Error` if `value` is not a valid non-negative finite number.
215
+
216
+ ---
217
+
218
+ ### 🌙 `getFadeOutDuration()`
219
+
220
+ Returns the fade-out animation duration.
221
+
222
+ * **Returns:**
223
+ `number` — Duration in milliseconds of the fade-out effect.
224
+
225
+ ---
226
+
227
+ ### 🎞️ `setFadeOutDuration(value)`
228
+
229
+ Sets the fade-out animation duration.
230
+
231
+ * **Parameters:**
232
+
233
+ * `value: number` — Fade-out time in milliseconds.
234
+
235
+ * **Throws:**
236
+
237
+ * `Error` if `value` is not a valid non-negative finite number.
238
+
239
+ ---
240
+
241
+ ## 🚀 `show(data)`
242
+
243
+ Displays a notification with customizable content and duration based on message length.
244
+
245
+ ### 📝 Parameters
246
+
247
+ * `data: NotifyData` — The notification data, which can be either:
248
+
249
+ * A **string** — Used as the message text directly.
250
+ * An **object** with the following optional properties:
251
+
252
+ * `message: string` — The main message text (required in object form).
253
+ * `title?: string` — Optional title shown above the message.
254
+ * `onClick?: function(MouseEvent, CloseToastFunc): void` — Optional click handler, receives the click event and a function to programmatically close the toast.
255
+ * `html?: boolean` — Whether the message should be interpreted as raw HTML (default is plain text).
256
+ * `avatar?: string` — Optional URL for an avatar image shown to the left of the notification.
257
+
258
+ ### 🛠️ Behavior
259
+
260
+ * Creates a notification `<div>` element with class `notify` and adds entrance animation.
261
+ * Supports optional avatar image, title, and click handler.
262
+ * Shows a close button (`×`) with hover effect.
263
+ * Calculates display duration as:
264
+ `baseDuration + (message length × extraPerChar) + fadeOutDuration` milliseconds.
265
+ * Automatically fades out and removes the notification after the calculated total time.
266
+ * Clicking the close button or calling the programmatic `close` function dismisses the notification.
267
+ * If an `onClick` handler is provided, clicking the notification (except on the close button) triggers it.
268
+
269
+ ### ⚠️ Errors
270
+
271
+ * Throws an error if `data` is neither a string nor a valid object with a string `message` property.
272
+ * Throws an error if `onClick` is defined but is not a function.
273
+
274
+ ---
275
+
276
+ ## 🔥 `destroy()`
277
+
278
+ Destroys the current **TinyToastNotify** instance.
279
+ It **removes the notification container from the DOM** and **clears all pending notifications**. This method is useful when the notification system is no longer needed or when changing views in a single-page application.
280
+
281
+ ### Syntax
282
+
283
+ ```js
284
+ tinyToastNotify.destroy();
285
+ ```
286
+
287
+ ### Behavior
288
+
289
+ * Removes the entire container (`.notify-container`) from the DOM.
290
+ * Automatically cancels any pending or visible toasts.
291
+ * Cleans up internal references.
292
+
293
+ ---
294
+
295
+ ## 🎨 CSS Files Location
296
+
297
+ The CSS files for the TinyNotify project build can be found in the following folder:
298
+
299
+ ```
300
+ dist/v1/css
301
+ ```
302
+
303
+ Inside this folder, you'll find the main stylesheets:
304
+
305
+ - `TinyNotify.css` — the full, unminified CSS file
306
+ - `TinyNotify.min.css` — the minified, optimized CSS file for production 🚀
307
+
308
+ Use these files to style your notifications!
309
+ Happy coding! ✨