tiny-essentials 1.20.3 → 1.21.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.
Files changed (126) hide show
  1. package/README.md +13 -11
  2. package/dist/_/numbers.cjs +136 -0
  3. package/dist/_/numbers.d.mts +24 -0
  4. package/dist/_/numbers.mjs +102 -0
  5. package/dist/v1/TinyAdvancedRaffle.min.js +1 -0
  6. package/dist/v1/TinyArrayPaginator.min.js +1 -0
  7. package/dist/v1/TinyBasicsEs.min.js +1 -1
  8. package/dist/v1/TinyCookieConsent.min.js +1 -0
  9. package/dist/v1/TinyDayNightCycle.min.js +1 -0
  10. package/dist/v1/TinyEssentials.min.js +1 -1
  11. package/dist/v1/TinyGamepad.min.js +1 -0
  12. package/dist/v1/TinyI18.min.js +1 -0
  13. package/dist/v1/TinyInventory.min.js +1 -0
  14. package/dist/v1/TinyInventoryTrader.min.js +1 -0
  15. package/dist/v1/TinyLocalStorage.min.js +1 -1
  16. package/dist/v1/TinyNeedBar.min.js +1 -0
  17. package/dist/v1/TinyRateLimiter.min.js +1 -1
  18. package/dist/v1/TinySmartScroller.min.js +1 -1
  19. package/dist/v1/TinyToastNotify.min.js +1 -1
  20. package/dist/v1/TinyUploadClicker.min.js +1 -1
  21. package/dist/v1/basics/array.cjs +21 -0
  22. package/dist/v1/basics/array.d.mts +8 -0
  23. package/dist/v1/basics/array.mjs +18 -0
  24. package/dist/v1/basics/clock.cjs +127 -11
  25. package/dist/v1/basics/clock.d.mts +26 -0
  26. package/dist/v1/basics/clock.mjs +96 -1
  27. package/dist/v1/basics/index.cjs +2 -8
  28. package/dist/v1/basics/index.d.mts +3 -8
  29. package/dist/v1/basics/index.mjs +2 -3
  30. package/dist/v1/basics/simpleMath.cjs +46 -0
  31. package/dist/v1/basics/simpleMath.d.mts +27 -0
  32. package/dist/v1/basics/simpleMath.mjs +42 -0
  33. package/dist/v1/build/TinyAdvancedRaffle.cjs +7 -0
  34. package/dist/v1/build/TinyAdvancedRaffle.d.mts +3 -0
  35. package/dist/v1/build/TinyAdvancedRaffle.mjs +2 -0
  36. package/dist/v1/build/TinyArrayPaginator.cjs +7 -0
  37. package/dist/v1/build/TinyArrayPaginator.d.mts +3 -0
  38. package/dist/v1/build/TinyArrayPaginator.mjs +2 -0
  39. package/dist/v1/build/TinyCookieConsent.cjs +7 -0
  40. package/dist/v1/build/TinyCookieConsent.d.mts +3 -0
  41. package/dist/v1/build/TinyCookieConsent.mjs +2 -0
  42. package/dist/v1/build/TinyDayNightCycle.cjs +7 -0
  43. package/dist/v1/build/TinyDayNightCycle.d.mts +3 -0
  44. package/dist/v1/build/TinyDayNightCycle.mjs +2 -0
  45. package/dist/v1/build/TinyGamepad.cjs +7 -0
  46. package/dist/v1/build/TinyGamepad.d.mts +3 -0
  47. package/dist/v1/build/TinyGamepad.mjs +2 -0
  48. package/dist/v1/build/TinyI18.cjs +7 -0
  49. package/dist/v1/build/TinyI18.d.mts +3 -0
  50. package/dist/v1/build/TinyI18.mjs +2 -0
  51. package/dist/v1/build/TinyInventory.cjs +7 -0
  52. package/dist/v1/build/TinyInventory.d.mts +3 -0
  53. package/dist/v1/build/TinyInventory.mjs +2 -0
  54. package/dist/v1/build/TinyInventoryTrader.cjs +7 -0
  55. package/dist/v1/build/TinyInventoryTrader.d.mts +3 -0
  56. package/dist/v1/build/TinyInventoryTrader.mjs +2 -0
  57. package/dist/v1/build/TinyNeedBar.cjs +7 -0
  58. package/dist/v1/build/TinyNeedBar.d.mts +3 -0
  59. package/dist/v1/build/TinyNeedBar.mjs +2 -0
  60. package/dist/v1/css/TinyCookieConsent.min.css +1 -0
  61. package/dist/v1/index.cjs +20 -8
  62. package/dist/v1/index.d.mts +12 -8
  63. package/dist/v1/index.mjs +11 -3
  64. package/dist/v1/libs/TinyAdvancedRaffle.cjs +1654 -0
  65. package/dist/v1/libs/TinyAdvancedRaffle.d.mts +851 -0
  66. package/dist/v1/libs/TinyAdvancedRaffle.mjs +1477 -0
  67. package/dist/v1/libs/TinyArrayPaginator.cjs +132 -0
  68. package/dist/v1/libs/TinyArrayPaginator.d.mts +78 -0
  69. package/dist/v1/libs/TinyArrayPaginator.mjs +119 -0
  70. package/dist/v1/libs/TinyCookieConsent.cjs +278 -0
  71. package/dist/v1/libs/TinyCookieConsent.d.mts +142 -0
  72. package/dist/v1/libs/TinyCookieConsent.mjs +248 -0
  73. package/dist/v1/libs/TinyDayNightCycle.cjs +1389 -0
  74. package/dist/v1/libs/TinyDayNightCycle.d.mts +673 -0
  75. package/dist/v1/libs/TinyDayNightCycle.mjs +1232 -0
  76. package/dist/v1/libs/TinyGamepad.cjs +2690 -0
  77. package/dist/v1/libs/TinyGamepad.d.mts +1286 -0
  78. package/dist/v1/libs/TinyGamepad.mjs +2386 -0
  79. package/dist/v1/libs/TinyHtml.d.mts +2 -2
  80. package/dist/v1/libs/TinyI18.cjs +946 -0
  81. package/dist/v1/libs/TinyI18.d.mts +418 -0
  82. package/dist/v1/libs/TinyI18.mjs +873 -0
  83. package/dist/v1/libs/TinyInventory.cjs +1788 -0
  84. package/dist/v1/libs/TinyInventory.d.mts +871 -0
  85. package/dist/v1/libs/TinyInventory.mjs +1650 -0
  86. package/dist/v1/libs/TinyInventoryTrader.cjs +242 -0
  87. package/dist/v1/libs/TinyInventoryTrader.d.mts +95 -0
  88. package/dist/v1/libs/TinyInventoryTrader.mjs +212 -0
  89. package/dist/v1/libs/TinyLocalStorage.cjs +14 -1
  90. package/dist/v1/libs/TinyLocalStorage.mjs +8 -1
  91. package/dist/v1/libs/TinyNeedBar.cjs +272 -0
  92. package/dist/v1/libs/TinyNeedBar.d.mts +223 -0
  93. package/dist/v1/libs/TinyNeedBar.mjs +241 -0
  94. package/dist/v1/libs/TinyRateLimiter.cjs +0 -13
  95. package/dist/v1/libs/TinyRateLimiter.d.mts +0 -8
  96. package/dist/v1/libs/TinyRateLimiter.mjs +0 -12
  97. package/dist/v1/libs/TinySmartScroller.cjs +0 -51
  98. package/dist/v1/libs/TinySmartScroller.d.mts +0 -36
  99. package/dist/v1/libs/TinySmartScroller.mjs +0 -46
  100. package/dist/v1/libs/TinyToastNotify.cjs +2 -2
  101. package/dist/v1/libs/TinyToastNotify.mjs +2 -2
  102. package/dist/v1/libs/TinyUploadClicker.cjs +1 -1
  103. package/docs/v1/Ai-Tips.md +51 -0
  104. package/docs/v1/Personal-Ai-Prompts(portuguese).md +134 -0
  105. package/docs/v1/Personal-Ai-Prompts.md +113 -0
  106. package/docs/v1/README.md +24 -0
  107. package/docs/v1/basics/array.md +17 -0
  108. package/docs/v1/basics/clock.md +51 -11
  109. package/docs/v1/basics/simpleMath.md +73 -0
  110. package/docs/v1/libs/TinyAdvancedRaffle.md +674 -0
  111. package/docs/v1/libs/TinyArrayPaginator.md +150 -0
  112. package/docs/v1/libs/TinyCookieConsent.md +152 -0
  113. package/docs/v1/libs/TinyDayNightCycle.md +711 -0
  114. package/docs/v1/libs/TinyGamepad.md +980 -0
  115. package/docs/v1/libs/TinyI18.md +515 -0
  116. package/docs/v1/libs/TinyInventory.md +777 -0
  117. package/docs/v1/libs/TinyInventoryTrader.md +114 -0
  118. package/docs/v1/libs/TinyNeedBar.md +226 -0
  119. package/package.json +7 -5
  120. package/dist/v1/basics/html_deprecated.cjs +0 -124
  121. package/dist/v1/basics/html_deprecated.d.mts +0 -40
  122. package/dist/v1/basics/html_deprecated.mjs +0 -97
  123. package/dist/v1/css/TinyDraggerExample.css +0 -21
  124. package/dist/v1/css/TinyNotify.css +0 -350
  125. package/dist/v1/css/aiMarker.css +0 -4
  126. package/docs/v1/basics/html_deprecated.md +0 -127
@@ -0,0 +1,241 @@
1
+ /**
2
+ * @typedef {Object} TickResult
3
+ * @property {number} prevValue - Infinite value before applying decay.
4
+ * @property {number} removedTotal - Total amount removed this tick.
5
+ * @property {number} removedPercent - Percentage of max removed this tick.
6
+ * @property {number} currentPercent - Current percentage relative to max.
7
+ * @property {number} remainingValue - Current clamped value (≥ 0).
8
+ * @property {number} infiniteRemaining - Current infinite value (can be negative).
9
+ */
10
+ /**
11
+ * Represents a decay factor applied to the need bar.
12
+ *
13
+ * - `amount`: base value reduced per tick.
14
+ * - `multiplier`: multiplier applied to the amount.
15
+ *
16
+ * @typedef {Object} BarFactor
17
+ * @property {number} amount - Base reduction value per tick.
18
+ * @property {number} multiplier - Multiplier applied to the amount.
19
+ */
20
+ /**
21
+ * Represents the serialized state of a TinyNeedBar instance.
22
+ *
23
+ * This object is typically produced by {@link TinyNeedBar#toJSON} and
24
+ * can be used to recreate an instance via {@link TinyNeedBar.fromJSON}.
25
+ *
26
+ * @typedef {Object} SerializedData
27
+ * @property {number} maxValue - Maximum value of the bar at the moment of serialization.
28
+ * @property {number} currentValue - Current clamped value (never below 0).
29
+ * @property {number} infiniteValue - Infinite value (can go negative).
30
+ * @property {Record<string, BarFactor>} factors - Active decay factors indexed by their keys.
31
+ */
32
+ /**
33
+ * A utility class to simulate a "need bar" system.
34
+ *
35
+ * The bar decreases over time according to defined factors (each with an amount and multiplier).
36
+ * - The **main factor** controls the base decay per tick.
37
+ * - Additional factors can be added dynamically.
38
+ *
39
+ * The system tracks two values:
40
+ * - `currentValue` → cannot go below zero.
41
+ * - `infiniteValue` → can decrease infinitely into negative numbers.
42
+ */
43
+ class TinyNeedBar {
44
+ /**
45
+ * Stores all factors that influence decay.
46
+ * Each entry contains an amount and a multiplier.
47
+ * @type {Map<string, BarFactor>}
48
+ */
49
+ #factors = new Map();
50
+ /** Maximum value of the bar. @type {number} */
51
+ #maxValue;
52
+ /** Current clamped value of the bar (never below 0). @type {number} */
53
+ #currentValue;
54
+ /** Current "infinite" value of the bar (can go negative). @type {number} */
55
+ #infiniteValue;
56
+ /**
57
+ * Returns a snapshot of all currently active factors.
58
+ * Each factor is returned as a plain object to prevent direct mutation of the internal map.
59
+ *
60
+ * @returns {Record<string, BarFactor>} A record of all factors indexed by their key.
61
+ */
62
+ get factors() {
63
+ /** @type {Record<string, BarFactor>} */
64
+ const factors = {};
65
+ for (let [name, factor] of this.#factors.entries()) {
66
+ factors[name] = { ...factor };
67
+ }
68
+ return factors;
69
+ }
70
+ /**
71
+ * Returns the current percentage of the bar relative to the maximum value.
72
+ *
73
+ * @returns {number} Percentage from `0` to `100`.
74
+ */
75
+ get currentPercent() {
76
+ return (this.#currentValue / this.#maxValue) * 100;
77
+ }
78
+ /**
79
+ * Updates the maximum possible value of the bar.
80
+ * Ensures `currentValue` never exceeds the new maximum.
81
+ *
82
+ * @param {number} value - New maximum value.
83
+ */
84
+ set maxValue(value) {
85
+ this.#maxValue = value;
86
+ this.#currentValue = Math.min(this.#currentValue, value);
87
+ }
88
+ /**
89
+ * Returns the maximum possible value of the bar.
90
+ *
91
+ * @returns {number} The maximum value.
92
+ */
93
+ get maxValue() {
94
+ return this.#maxValue;
95
+ }
96
+ /**
97
+ * Returns the current clamped value of the bar.
98
+ * This value will never be below `0`.
99
+ *
100
+ * @returns {number} Current value (≥ 0).
101
+ */
102
+ get currentValue() {
103
+ return this.#currentValue;
104
+ }
105
+ /**
106
+ * Updates the infinite value of the bar.
107
+ * Automatically recalculates the `currentValue` (never below 0).
108
+ *
109
+ * @param {number} value - New infinite value.
110
+ */
111
+ set infiniteValue(value) {
112
+ this.#infiniteValue = value;
113
+ this.#currentValue = Math.max(0, value);
114
+ this.#currentValue = Math.min(this.#currentValue, this.#maxValue);
115
+ }
116
+ /**
117
+ * Returns the current infinite value of the bar.
118
+ * Unlike `currentValue`, this one can go below zero.
119
+ *
120
+ * @returns {number} Current infinite value.
121
+ */
122
+ get infiniteValue() {
123
+ return this.#infiniteValue;
124
+ }
125
+ /**
126
+ * Creates a new need bar instance.
127
+ *
128
+ * @param {number} [maxValue=100] - Maximum value of the bar.
129
+ * @param {number} [baseDecay=1] - Base amount reduced each tick.
130
+ * @param {number} [baseDecayMulti=1] - Multiplier applied to the base decay.
131
+ */
132
+ constructor(maxValue = 100, baseDecay = 1, baseDecayMulti = 1) {
133
+ this.#maxValue = maxValue;
134
+ this.setFactor('main', baseDecay, baseDecayMulti);
135
+ this.#currentValue = maxValue;
136
+ this.#infiniteValue = maxValue;
137
+ }
138
+ /**
139
+ * Retrieves a specific factor by its key.
140
+ *
141
+ * @param {string} key - The unique key of the factor.
142
+ * @returns {BarFactor} The requested factor object.
143
+ * @throws {Error} If the factor does not exist.
144
+ */
145
+ getFactor(key) {
146
+ const result = this.#factors.get(key);
147
+ if (!result)
148
+ throw new Error(`Factor with key "${key}" not found.`);
149
+ return { ...result };
150
+ }
151
+ /**
152
+ * Checks if a specific factor exists by key.
153
+ *
154
+ * @param {string} key - The factor key to check.
155
+ * @returns {boolean} `true` if the factor exists, otherwise `false`.
156
+ */
157
+ hasFactor(key) {
158
+ return this.#factors.has(key);
159
+ }
160
+ /**
161
+ * Defines or updates a decay factor.
162
+ *
163
+ * @param {string} key - Unique identifier for the factor.
164
+ * @param {number} amount - Amount reduced per tick.
165
+ * @param {number} [multiplier=1] - Multiplier applied to the amount.
166
+ */
167
+ setFactor(key, amount, multiplier = 1) {
168
+ this.#factors.set(key, { amount, multiplier });
169
+ }
170
+ /**
171
+ * Removes a decay factor by its key.
172
+ *
173
+ * @param {string} key - The factor key to remove.
174
+ */
175
+ removeFactor(key) {
176
+ this.#factors.delete(key);
177
+ }
178
+ /**
179
+ * Executes one tick of decay, applying all active factors.
180
+ *
181
+ * @returns {TickResult}
182
+ */
183
+ tick() {
184
+ let removedTotal = 0;
185
+ for (let [_, factor] of this.#factors.entries()) {
186
+ removedTotal += factor.amount * factor.multiplier;
187
+ }
188
+ const prevValue = this.#infiniteValue;
189
+ this.#infiniteValue -= removedTotal;
190
+ this.#currentValue = Math.max(0, this.#currentValue - removedTotal);
191
+ const removedPercent = (removedTotal / this.#maxValue) * 100;
192
+ return {
193
+ prevValue,
194
+ removedTotal,
195
+ removedPercent,
196
+ currentPercent: this.currentPercent,
197
+ remainingValue: this.#currentValue,
198
+ infiniteRemaining: this.#infiniteValue,
199
+ };
200
+ }
201
+ /**
202
+ * Serializes the current state of the need bar.
203
+ * @returns {SerializedData}
204
+ */
205
+ toJSON() {
206
+ return {
207
+ maxValue: this.#maxValue,
208
+ currentValue: this.#currentValue,
209
+ infiniteValue: this.#infiniteValue,
210
+ factors: this.factors,
211
+ };
212
+ }
213
+ /**
214
+ * Restores a need bar from a serialized object.
215
+ * @param {SerializedData} data
216
+ * @returns {TinyNeedBar}
217
+ */
218
+ static fromJSON(data) {
219
+ const bar = new TinyNeedBar(data.maxValue, 0, 0);
220
+ bar.infiniteValue = data.infiniteValue;
221
+ bar.#factors.clear();
222
+ for (const [key, factor] of Object.entries(data.factors)) {
223
+ bar.setFactor(key, factor.amount, factor.multiplier);
224
+ }
225
+ return bar;
226
+ }
227
+ /**
228
+ * Creates a deep clone of this need bar.
229
+ * @returns {TinyNeedBar}
230
+ */
231
+ clone() {
232
+ return TinyNeedBar.fromJSON(this.toJSON());
233
+ }
234
+ /**
235
+ * Clear the factors map, clearing all factor data.
236
+ */
237
+ clearFactors() {
238
+ this.#factors.clear();
239
+ }
240
+ }
241
+ export default TinyNeedBar;
@@ -327,19 +327,6 @@ class TinyRateLimiter {
327
327
  this.groupTTL.delete(groupId);
328
328
  }
329
329
 
330
- /**
331
- * Manually reset user data.
332
- *
333
- * @deprecated Use `resetUserGroup(userId)` instead. This method will be removed in future versions.
334
- * @param {string} userId
335
- * @returns {void}
336
- */
337
- reset(userId) {
338
- if (process?.env?.NODE_ENV !== 'production')
339
- console.warn(`[TinyRateLimiter] 'reset()' is deprecated. Use 'resetUserGroup()' instead.`);
340
- return this.resetUserGroup(userId);
341
- }
342
-
343
330
  /**
344
331
  * Manually reset a user mapping
345
332
  * @param {string} userId
@@ -119,14 +119,6 @@ declare class TinyRateLimiter {
119
119
  * @param {string} groupId
120
120
  */
121
121
  resetGroup(groupId: string): void;
122
- /**
123
- * Manually reset user data.
124
- *
125
- * @deprecated Use `resetUserGroup(userId)` instead. This method will be removed in future versions.
126
- * @param {string} userId
127
- * @returns {void}
128
- */
129
- reset(userId: string): void;
130
122
  /**
131
123
  * Manually reset a user mapping
132
124
  * @param {string} userId
@@ -293,18 +293,6 @@ class TinyRateLimiter {
293
293
  this.lastSeen.delete(groupId);
294
294
  this.groupTTL.delete(groupId);
295
295
  }
296
- /**
297
- * Manually reset user data.
298
- *
299
- * @deprecated Use `resetUserGroup(userId)` instead. This method will be removed in future versions.
300
- * @param {string} userId
301
- * @returns {void}
302
- */
303
- reset(userId) {
304
- if (process?.env?.NODE_ENV !== 'production')
305
- console.warn(`[TinyRateLimiter] 'reset()' is deprecated. Use 'resetUserGroup()' instead.`);
306
- return this.resetUserGroup(userId);
307
- }
308
296
  /**
309
297
  * Manually reset a user mapping
310
298
  * @param {string} userId
@@ -601,17 +601,6 @@ class TinySmartScroller {
601
601
  return results;
602
602
  }
603
603
 
604
- /**
605
- * Emits a scroll-related event to all registered listeners.
606
- *
607
- * @param {string} event - Event name.
608
- * @param {*} [payload] - Optional event data payload.
609
- * @deprecated - Use emit() instead.
610
- */
611
- _emit(event, payload) {
612
- this.emit(event, payload);
613
- }
614
-
615
604
  /**
616
605
  * Handles scroll events, calculates position-related statuses, and emits appropriate events.
617
606
  */
@@ -1046,46 +1035,6 @@ class TinySmartScroller {
1046
1035
  return this.#isPastAtCustomBottom;
1047
1036
  }
1048
1037
 
1049
- /**
1050
- * Checks if the user is within the defined extra scroll boundary from the bottom.
1051
- *
1052
- * @returns {boolean}
1053
- * @deprecated - Use isAtCustomBottom instead.
1054
- */
1055
- isUserAtCustomBottom() {
1056
- return this.#isAtCustomBottom;
1057
- }
1058
-
1059
- /**
1060
- * Checks if the user is within the defined extra scroll boundary from the top.
1061
- *
1062
- * @returns {boolean}
1063
- * @deprecated - Use isAtCustomTop instead.
1064
- */
1065
- isUserAtCustomTop() {
1066
- return this.#isAtCustomTop;
1067
- }
1068
-
1069
- /**
1070
- * Returns true if the user is currently scrolled to the bottom of the element.
1071
- *
1072
- * @returns {boolean}
1073
- * @deprecated - Use isAtBottom instead.
1074
- */
1075
- isUserAtBottom() {
1076
- return this.#isAtBottom;
1077
- }
1078
-
1079
- /**
1080
- * Returns true if the user is currently scrolled to the top of the element.
1081
- *
1082
- * @returns {boolean}
1083
- * @deprecated - Use isAtTop instead.
1084
- */
1085
- isUserAtTop() {
1086
- return this.#isAtTop;
1087
- }
1088
-
1089
1038
  /**
1090
1039
  * Returns true if automatic scrolling is currently paused.
1091
1040
  *
@@ -402,14 +402,6 @@ declare class TinySmartScroller {
402
402
  oldIsVisible: boolean;
403
403
  isVisible: boolean;
404
404
  }>;
405
- /**
406
- * Emits a scroll-related event to all registered listeners.
407
- *
408
- * @param {string} event - Event name.
409
- * @param {*} [payload] - Optional event data payload.
410
- * @deprecated - Use emit() instead.
411
- */
412
- _emit(event: string, payload?: any): void;
413
405
  /**
414
406
  * Handles scroll events, calculates position-related statuses, and emits appropriate events.
415
407
  */
@@ -558,34 +550,6 @@ declare class TinySmartScroller {
558
550
  * @returns {boolean}
559
551
  */
560
552
  isPastAtCustomBottom(): boolean;
561
- /**
562
- * Checks if the user is within the defined extra scroll boundary from the bottom.
563
- *
564
- * @returns {boolean}
565
- * @deprecated - Use isAtCustomBottom instead.
566
- */
567
- isUserAtCustomBottom(): boolean;
568
- /**
569
- * Checks if the user is within the defined extra scroll boundary from the top.
570
- *
571
- * @returns {boolean}
572
- * @deprecated - Use isAtCustomTop instead.
573
- */
574
- isUserAtCustomTop(): boolean;
575
- /**
576
- * Returns true if the user is currently scrolled to the bottom of the element.
577
- *
578
- * @returns {boolean}
579
- * @deprecated - Use isAtBottom instead.
580
- */
581
- isUserAtBottom(): boolean;
582
- /**
583
- * Returns true if the user is currently scrolled to the top of the element.
584
- *
585
- * @returns {boolean}
586
- * @deprecated - Use isAtTop instead.
587
- */
588
- isUserAtTop(): boolean;
589
553
  /**
590
554
  * Returns true if automatic scrolling is currently paused.
591
555
  *
@@ -511,16 +511,6 @@ class TinySmartScroller {
511
511
  });
512
512
  return results;
513
513
  }
514
- /**
515
- * Emits a scroll-related event to all registered listeners.
516
- *
517
- * @param {string} event - Event name.
518
- * @param {*} [payload] - Optional event data payload.
519
- * @deprecated - Use emit() instead.
520
- */
521
- _emit(event, payload) {
522
- this.emit(event, payload);
523
- }
524
514
  /**
525
515
  * Handles scroll events, calculates position-related statuses, and emits appropriate events.
526
516
  */
@@ -907,42 +897,6 @@ class TinySmartScroller {
907
897
  isPastAtCustomBottom() {
908
898
  return this.#isPastAtCustomBottom;
909
899
  }
910
- /**
911
- * Checks if the user is within the defined extra scroll boundary from the bottom.
912
- *
913
- * @returns {boolean}
914
- * @deprecated - Use isAtCustomBottom instead.
915
- */
916
- isUserAtCustomBottom() {
917
- return this.#isAtCustomBottom;
918
- }
919
- /**
920
- * Checks if the user is within the defined extra scroll boundary from the top.
921
- *
922
- * @returns {boolean}
923
- * @deprecated - Use isAtCustomTop instead.
924
- */
925
- isUserAtCustomTop() {
926
- return this.#isAtCustomTop;
927
- }
928
- /**
929
- * Returns true if the user is currently scrolled to the bottom of the element.
930
- *
931
- * @returns {boolean}
932
- * @deprecated - Use isAtBottom instead.
933
- */
934
- isUserAtBottom() {
935
- return this.#isAtBottom;
936
- }
937
- /**
938
- * Returns true if the user is currently scrolled to the top of the element.
939
- *
940
- * @returns {boolean}
941
- * @deprecated - Use isAtTop instead.
942
- */
943
- isUserAtTop() {
944
- return this.#isAtTop;
945
- }
946
900
  /**
947
901
  * Returns true if automatic scrolling is currently paused.
948
902
  *
@@ -305,10 +305,10 @@ class TinyToastNotify {
305
305
 
306
306
  // Optional hover effect
307
307
  closeBtn.addEventListener('mouseenter', () => {
308
- closeBtn.style.color = 'var(--notif-close-color-hover)';
308
+ closeBtn.style.color = 'var(--notify-close-color-hover)';
309
309
  });
310
310
  closeBtn.addEventListener('mouseleave', () => {
311
- closeBtn.style.color = 'var(--notif-close-color)';
311
+ closeBtn.style.color = 'var(--notify-close-color)';
312
312
  });
313
313
 
314
314
  // Avatar
@@ -266,10 +266,10 @@ class TinyToastNotify {
266
266
  closeBtn.setAttribute('aria-label', 'Close');
267
267
  // Optional hover effect
268
268
  closeBtn.addEventListener('mouseenter', () => {
269
- closeBtn.style.color = 'var(--notif-close-color-hover)';
269
+ closeBtn.style.color = 'var(--notify-close-color-hover)';
270
270
  });
271
271
  closeBtn.addEventListener('mouseleave', () => {
272
- closeBtn.style.color = 'var(--notif-close-color)';
272
+ closeBtn.style.color = 'var(--notify-close-color)';
273
273
  });
274
274
  // Avatar
275
275
  if (avatarUrl) {
@@ -2,10 +2,10 @@
2
2
 
3
3
  require('../basics/objFilter.cjs');
4
4
  var objChecker = require('../basics/objChecker.cjs');
5
- require('./TinyHtml.cjs');
6
5
  require('fs');
7
6
  require('path');
8
7
  require('fs/promises');
8
+ require('./TinyHtml.cjs');
9
9
  require('./TinyLocalStorage.cjs');
10
10
 
11
11
  /**
@@ -0,0 +1,51 @@
1
+ ## 🧭 How I Work with AI (Tips & Workflow)
2
+
3
+ Over time, I've built a personal workflow to make sure AI helps me *efficiently* — without ruining my focus, logic, or the structure of my code and documentation. Here are some habits and tricks I always follow:
4
+
5
+ * 📝 **Persistent Prompt Instructions**
6
+ I noticed that AI often starts forgetting layout and formatting instructions after just a few messages. To prevent this, I keep a notepad with my core prompts and manually repeat key instructions every time I ask something, especially when working on documentation.
7
+
8
+ * ⚙️ **System Prompt Setup**
9
+ One of my most effective strategies is maintaining a *System Instruction prompt* that defines the main behaviors I expect in **all my projects**. It includes things like:
10
+
11
+ * Avoid adding humor or randomness
12
+ * Always be 100% sincere and logical
13
+ * Don’t include jsDoc descriptions unless I explicitly allow it (especially when I'm still working on a WIP feature)
14
+
15
+ * 🧠 **How I Talk to AI**
16
+ I don’t try to talk to AI like it’s a person. I speak in a very natural, clear, and structured way — as if I were talking to a computer, because that’s what it is. This keeps things predictable and productive.
17
+
18
+ * 🔧 **Using the Chat History Interface Carefully**
19
+ I frequently use history editing tools (when available) to fix incorrect messages and keep the whole conversation aligned and accurate. The cleaner the context, the better the answers — especially over long sessions.
20
+
21
+ * 🧹 **Avoiding Context Drift**
22
+ The more you keep talking without resetting or correcting the prompt, the more likely it is that AI starts misunderstanding the conversation. So I always try to keep things clean and well-structured to preserve context.
23
+
24
+ * 📏 **Limit Code Size per Message**
25
+ I avoid dumping extremely long blocks of code into the chat. Instead, I share only the relevant part or break the code into smaller, medium-sized chunks. This prevents confusion and makes it easier for AI to focus on what I actually need.
26
+
27
+ * 💬 **Managing Large Output Responses**
28
+ If a reply needs to be very long, AI might break or compress the message too much to fit it into a single reply — and this often ruins the meaning or structure of the output. I always consider this when asking questions and sometimes break complex requests into smaller steps.
29
+
30
+ ---
31
+
32
+ ## 🤖 About AI Usage in the Projects
33
+
34
+ Some parts of this project were assisted by AI, but all the core decisions and logic come directly from me. Here's how I usually balance things:
35
+
36
+ * 🧠 **Ideas and Logic**:
37
+ All the concepts, how the system works, and the reasoning behind each part of the code are my own. I use AI mostly as a helper to speed things up or explore alternatives, but I’m always the one guiding and correcting everything.
38
+
39
+ * 📄 **jsDocs and Type Structures**:
40
+ I take care of the structure and typing in the documentation myself. When it comes to writing the descriptions, I might use AI to help word things better, but the meaning and context are always mine.
41
+
42
+ * 🧪 **HTML Test Files**:
43
+ For testing interfaces, I usually let AI generate the base since it's faster to describe what I need than build it all from scratch. It helps me quickly test the behavior of what I’ve programmed.
44
+
45
+ * ✍️ **Text (Messages, Descriptions, etc.)**:
46
+ I often ask AI to help me write or polish messages, explanations, or descriptions. It's great for keeping things clear and readable, but I always review and adjust it to match the logic and personality I want.
47
+
48
+ * 🌸 **Style and Personality**:
49
+ I love using emojis and I’ve set up my system to guide how AI writes with my personal style. That includes tone, formatting, and the little details that make the project feel like mine.
50
+
51
+ This approach is consistent across all my projects. It lets me stay focused on what really matters to me — logic, structure, and creativity — while still using AI as a practical tool when it makes sense.