tiny-essentials 1.18.1 → 1.19.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 (74) hide show
  1. package/README.md +17 -3
  2. package/dist/node_modules/firebase-functions/lib/common/trace.cjs +0 -1
  3. package/dist/node_modules/firebase-functions/lib/logger/index.cjs +1 -0
  4. package/dist/v1/ColorSafeStringify.min.js +1 -1
  5. package/dist/v1/TinyAfterScrollWatcher.min.js +1 -1
  6. package/dist/v1/TinyBasicsEs.js +13 -6
  7. package/dist/v1/TinyBasicsEs.min.js +1 -1
  8. package/dist/v1/TinyClipboard.min.js +1 -1
  9. package/dist/v1/TinyColorConverter.js +617 -0
  10. package/dist/v1/TinyColorConverter.min.js +1 -0
  11. package/dist/v1/TinyDomReadyManager.min.js +1 -1
  12. package/dist/v1/TinyDragger.min.js +1 -1
  13. package/dist/v1/TinyEssentials.js +2635 -482
  14. package/dist/v1/TinyEssentials.min.js +1 -1
  15. package/dist/v1/TinyEvents.js +402 -0
  16. package/dist/v1/TinyEvents.min.js +1 -0
  17. package/dist/v1/TinyHtml.min.js +1 -1
  18. package/dist/v1/TinyLocalStorage.js +1292 -0
  19. package/dist/v1/TinyLocalStorage.min.js +1 -0
  20. package/dist/v1/TinyNotifications.min.js +1 -1
  21. package/dist/v1/TinyNotifyCenter.min.js +1 -1
  22. package/dist/v1/TinyPromiseQueue.min.js +1 -1
  23. package/dist/v1/TinyRateLimiter.js +2 -1
  24. package/dist/v1/TinyRateLimiter.min.js +1 -1
  25. package/dist/v1/TinySmartScroller.js +570 -52
  26. package/dist/v1/TinySmartScroller.min.js +1 -1
  27. package/dist/v1/TinyTextRangeEditor.min.js +1 -1
  28. package/dist/v1/TinyTimeout.js +233 -0
  29. package/dist/v1/TinyTimeout.min.js +1 -0
  30. package/dist/v1/TinyToastNotify.min.js +1 -1
  31. package/dist/v1/TinyUploadClicker.js +1457 -106
  32. package/dist/v1/TinyUploadClicker.min.js +1 -1
  33. package/dist/v1/UltraRandomMsgGen.min.js +1 -1
  34. package/dist/v1/basics/html.cjs +13 -6
  35. package/dist/v1/basics/html.d.mts +12 -4
  36. package/dist/v1/basics/html.mjs +13 -6
  37. package/dist/v1/build/TinyColorConverter.cjs +7 -0
  38. package/dist/v1/build/TinyColorConverter.d.mts +3 -0
  39. package/dist/v1/build/TinyColorConverter.mjs +2 -0
  40. package/dist/v1/build/TinyEvents.cjs +7 -0
  41. package/dist/v1/build/TinyEvents.d.mts +3 -0
  42. package/dist/v1/build/TinyEvents.mjs +2 -0
  43. package/dist/v1/build/TinyLocalStorage.cjs +7 -0
  44. package/dist/v1/build/TinyLocalStorage.d.mts +3 -0
  45. package/dist/v1/build/TinyLocalStorage.mjs +2 -0
  46. package/dist/v1/build/TinyTimeout.cjs +7 -0
  47. package/dist/v1/build/TinyTimeout.d.mts +3 -0
  48. package/dist/v1/build/TinyTimeout.mjs +2 -0
  49. package/dist/v1/index.cjs +8 -0
  50. package/dist/v1/index.d.mts +5 -1
  51. package/dist/v1/index.mjs +5 -1
  52. package/dist/v1/libs/TinyColorConverter.cjs +578 -0
  53. package/dist/v1/libs/TinyColorConverter.d.mts +396 -0
  54. package/dist/v1/libs/TinyColorConverter.mjs +520 -0
  55. package/dist/v1/libs/TinyEvents.cjs +363 -0
  56. package/dist/v1/libs/TinyEvents.d.mts +160 -0
  57. package/dist/v1/libs/TinyEvents.mjs +328 -0
  58. package/dist/v1/libs/TinyLocalStorage.cjs +847 -0
  59. package/dist/v1/libs/TinyLocalStorage.d.mts +407 -0
  60. package/dist/v1/libs/TinyLocalStorage.mjs +740 -0
  61. package/dist/v1/libs/TinySmartScroller.cjs +207 -52
  62. package/dist/v1/libs/TinySmartScroller.d.mts +164 -16
  63. package/dist/v1/libs/TinySmartScroller.mjs +181 -52
  64. package/dist/v1/libs/TinyTimeout.cjs +194 -0
  65. package/dist/v1/libs/TinyTimeout.d.mts +89 -0
  66. package/dist/v1/libs/TinyTimeout.mjs +179 -0
  67. package/dist/v1/libs/TinyUploadClicker.cjs +1 -0
  68. package/docs/v1/README.md +4 -0
  69. package/docs/v1/libs/TinyColorConverter.md +220 -0
  70. package/docs/v1/libs/TinyEvents.md +199 -0
  71. package/docs/v1/libs/TinyLocalStorage.md +350 -0
  72. package/docs/v1/libs/TinyRateLimiter.md +0 -3
  73. package/docs/v1/libs/TinyTimeout.md +190 -0
  74. package/package.json +28 -5
@@ -0,0 +1,396 @@
1
+ export default TinyColorConverter;
2
+ /**
3
+ * Represents a color in RGBA format.
4
+ * Each element must be a number between 0 and 255.
5
+ * The fourth value represents the alpha (transparency) channel.
6
+ */
7
+ export type RgbaColor = number[];
8
+ /**
9
+ * Represents a color in RGB format.
10
+ * Each element must be a number between 0 and 255.
11
+ */
12
+ export type RgbColor = number[];
13
+ /**
14
+ * Represents a color in HSLA format.
15
+ * The fourth value represents the alpha (transparency) channel.
16
+ */
17
+ export type HslaColor = number[];
18
+ /**
19
+ * Represents a color in HSL format.
20
+ */
21
+ export type HslColor = number[];
22
+ /**
23
+ * Represents a hex color.
24
+ */
25
+ export type HexColor = string;
26
+ /**
27
+ * A union type representing various accepted color formats.
28
+ * Can be a hex color string, a numeric value, or an array-based RGB/RGBA representation.
29
+ */
30
+ export type ColorTypes = HexColor | number | RgbColor | RgbaColor;
31
+ export type RgbaResult = {
32
+ /**
33
+ * - Red component (0–255)
34
+ */
35
+ r: number;
36
+ /**
37
+ * - Green component (0–255)
38
+ */
39
+ g: number;
40
+ /**
41
+ * - Blue component (0–255)
42
+ */
43
+ b: number;
44
+ /**
45
+ * - Alpha component (0–255)
46
+ */
47
+ a: number;
48
+ };
49
+ export type RgbResult = {
50
+ /**
51
+ * - Red component (0–255)
52
+ */
53
+ r: number;
54
+ /**
55
+ * - Green component (0–255)
56
+ */
57
+ g: number;
58
+ /**
59
+ * - Blue component (0–255)
60
+ */
61
+ b: number;
62
+ };
63
+ export type HexResult = {
64
+ /**
65
+ * - Hex color
66
+ */
67
+ hex: string;
68
+ };
69
+ export type HslResult = {
70
+ /**
71
+ * - Hue (0–360)
72
+ */
73
+ h: number;
74
+ /**
75
+ * - Saturation (0–100)
76
+ */
77
+ s: number;
78
+ /**
79
+ * - Lightness (0–100)
80
+ */
81
+ l: number;
82
+ };
83
+ /**
84
+ * Represents a color in RGBA format.
85
+ * Each element must be a number between 0 and 255.
86
+ * The fourth value represents the alpha (transparency) channel.
87
+ *
88
+ * @typedef {number[]} RgbaColor
89
+ * @property {number} 0 - Red component (0–255)
90
+ * @property {number} 1 - Green component (0–255)
91
+ * @property {number} 2 - Blue component (0–255)
92
+ * @property {number} 3 - Alpha component (0–255)
93
+ */
94
+ /**
95
+ * Represents a color in RGB format.
96
+ * Each element must be a number between 0 and 255.
97
+ *
98
+ * @typedef {number[]} RgbColor
99
+ * @property {number} 0 - Red component (0–255)
100
+ * @property {number} 1 - Green component (0–255)
101
+ * @property {number} 2 - Blue component (0–255)
102
+ */
103
+ /**
104
+ * Represents a color in HSLA format.
105
+ * The fourth value represents the alpha (transparency) channel.
106
+ *
107
+ * @typedef {number[]} HslaColor
108
+ * @property {number} 0 - Hue (0–360)
109
+ * @property {number} 1 - Saturation (0–100)
110
+ * @property {number} 2 - Lightness (0–100)
111
+ * @property {number} 3 - Alpha component (0–255)
112
+ */
113
+ /**
114
+ * Represents a color in HSL format.
115
+ *
116
+ * @typedef {number[]} HslColor
117
+ * @property {number} 0 - Hue (0–360)
118
+ * @property {number} 1 - Saturation (0–100)
119
+ * @property {number} 2 - Lightness (0–100)
120
+ */
121
+ /**
122
+ * Represents a hex color.
123
+ *
124
+ * @typedef {string} HexColor
125
+ */
126
+ /**
127
+ * A union type representing various accepted color formats.
128
+ * Can be a hex color string, a numeric value, or an array-based RGB/RGBA representation.
129
+ *
130
+ * @typedef {HexColor | number | RgbColor | RgbaColor} ColorTypes
131
+ */
132
+ /**
133
+ * @typedef {Object} RgbaResult
134
+ * @property {number} r - Red component (0–255)
135
+ * @property {number} g - Green component (0–255)
136
+ * @property {number} b - Blue component (0–255)
137
+ * @property {number} a - Alpha component (0–255)
138
+ */
139
+ /**
140
+ * @typedef {Object} RgbResult
141
+ * @property {number} r - Red component (0–255)
142
+ * @property {number} g - Green component (0–255)
143
+ * @property {number} b - Blue component (0–255)
144
+ */
145
+ /**
146
+ * @typedef {Object} HexResult
147
+ * @property {string} hex - Hex color
148
+ */
149
+ /**
150
+ * @typedef {Object} HslResult
151
+ * @property {number} h - Hue (0–360)
152
+ * @property {number} s - Saturation (0–100)
153
+ * @property {number} l - Lightness (0–100)
154
+ */
155
+ /**
156
+ * A class that allows converting colors between all common formats.
157
+ */
158
+ declare class TinyColorConverter {
159
+ /**
160
+ * Generates a smooth gradient of colors based on sine wave patterns.
161
+ *
162
+ * @see {@link https://www.npmjs.com/package/rainbow-colors-array} Code Reference
163
+ * @param {number} [len=24] - The number of colors to generate.
164
+ * @param {'rgb'|'hex'|'hsl'} [type='rgb'] - The format of the colors returned: `'rgb'`, `'hex'`, or `'hsl'`.
165
+ * @param {boolean} [pastel=false] - If true, generates pastel tones by adjusting the intensity and offset.
166
+ * @returns {Array<RgbResult|HexResult|HslResult>} An array of color values in the selected format:
167
+ */
168
+ static _rca(len?: number, type?: "rgb" | "hex" | "hsl", pastel?: boolean): Array<RgbResult | HexResult | HslResult>;
169
+ /**
170
+ * Generates a smooth gradient of colors based on sine wave patterns.
171
+ *
172
+ * @param {number} [len=24] - The number of colors to generate.
173
+ * @param {boolean} [pastel=false] - If true, generates pastel tones by adjusting the intensity and offset.
174
+ * @returns {RgbResult[]} An array of rgb color values.
175
+ */
176
+ static rcaRgb(len?: number, pastel?: boolean): RgbResult[];
177
+ /**
178
+ * Generates a smooth gradient of colors based on sine wave patterns.
179
+ *
180
+ * @param {number} [len=24] - The number of colors to generate.
181
+ * @param {boolean} [pastel=false] - If true, generates pastel tones by adjusting the intensity and offset.
182
+ * @returns {HslResult[]} An array of hsl color values.
183
+ */
184
+ static rcaHsl(len?: number, pastel?: boolean): HslResult[];
185
+ /**
186
+ * Generates a smooth gradient of colors based on sine wave patterns.
187
+ *
188
+ * @param {number} [len=24] - The number of colors to generate.
189
+ * @param {boolean} [pastel=false] - If true, generates pastel tones by adjusting the intensity and offset.
190
+ * @returns {HexResult[]} An array of hex color values.
191
+ */
192
+ static rcaHex(len?: number, pastel?: boolean): HexResult[];
193
+ /**
194
+ * Generates a random color in hexadecimal format.
195
+ *
196
+ * @returns {HexColor} A hex color string (e.g. `#a3e5f2`).
197
+ */
198
+ static randomColor(): HexColor;
199
+ /**
200
+ * Parses input into RGBA array.
201
+ * @param {ColorTypes} input
202
+ * @param {boolean} isHsl
203
+ * @returns {RgbaColor}
204
+ */
205
+ static parseInput(input: ColorTypes, isHsl: boolean): RgbaColor;
206
+ /**
207
+ * Converts hsl to integer.
208
+ * @param {number} h - Hue (0–360)
209
+ * @param {number} s - Saturation (0–100)
210
+ * @param {number} l - Lightness (0–100)
211
+ * @returns {number}
212
+ */
213
+ static hslToInt(h: number, s: number, l: number): number;
214
+ /**
215
+ * Converts hsl to hex.
216
+ * @param {number} h - Hue (0–360)
217
+ * @param {number} s - Saturation (0–100)
218
+ * @param {number} l - Lightness (0–100)
219
+ * @returns {HexColor}
220
+ */
221
+ static hslToHex(h: number, s: number, l: number): HexColor;
222
+ /**
223
+ * Converts hsl(a) string to RGBA array.
224
+ * @param {string} hsl
225
+ * @returns {RgbaColor}
226
+ */
227
+ static hslStringToRgbaArray(hsl: string): RgbaColor;
228
+ /**
229
+ * Converts HSL or HSLA to RGBA.
230
+ * @param {number} h - Hue (0–360)
231
+ * @param {number} s - Saturation (0–100)
232
+ * @param {number} l - Lightness (0–100)
233
+ * @param {number} [a=1] - Alpha (0–1)
234
+ * @returns {RgbaColor}
235
+ */
236
+ static hslToRgba(h: number, s: number, l: number, a?: number): RgbaColor;
237
+ /**
238
+ * Converts HSL or HSLA to RGB.
239
+ * @param {number} h - Hue (0–360)
240
+ * @param {number} s - Saturation (0–100)
241
+ * @param {number} l - Lightness (0–100)
242
+ * @param {number} [a=1] - Alpha (0–1)
243
+ * @returns {RgbColor}
244
+ */
245
+ static hslToRgb(h: number, s: number, l: number, a?: number): RgbColor;
246
+ /**
247
+ * Converts hex to integer.
248
+ * @param {HexColor} hex
249
+ * @returns {number}
250
+ */
251
+ static hexToInt(hex: HexColor): number;
252
+ /**
253
+ * Converts hex string to HSL array.
254
+ * @param {HexColor} hex
255
+ * @returns {HslColor}
256
+ */
257
+ static hexToHsl(hex: HexColor): HslColor;
258
+ /**
259
+ * Converts hex string to HSL array.
260
+ * @param {HexColor} hex
261
+ * @returns {HslaColor}
262
+ */
263
+ static hexToHsla(hex: HexColor): HslaColor;
264
+ /**
265
+ * Converts hex string to RGBA array.
266
+ * @param {HexColor} hex
267
+ * @returns {RgbaColor}
268
+ */
269
+ static hexToRgba(hex: HexColor): RgbaColor;
270
+ /**
271
+ * Converts HEX to RGB.
272
+ * @param {HexColor} hex
273
+ * @returns {RgbColor}
274
+ */
275
+ static hexToRgb(hex: HexColor): RgbColor;
276
+ /**
277
+ * Converts RGB to HEX.
278
+ * @param {number} r
279
+ * @param {number} g
280
+ * @param {number} b
281
+ * @returns {HexColor}
282
+ */
283
+ static rgbToHex(r: number, g: number, b: number): HexColor;
284
+ /**
285
+ * Converts RGB to integer.
286
+ * @param {number} r
287
+ * @param {number} g
288
+ * @param {number} b
289
+ * @returns {number}
290
+ */
291
+ static rgbToInt(r: number, g: number, b: number): number;
292
+ /**
293
+ * Converts RGBA to HSLA.
294
+ * @param {number} r
295
+ * @param {number} g
296
+ * @param {number} b
297
+ * @param {number} [a=1]
298
+ * @returns {HslaColor}
299
+ */
300
+ static rgbaToHsla(r: number, g: number, b: number, a?: number): HslaColor;
301
+ /**
302
+ * Converts RGBA to HSL.
303
+ * @param {number} r
304
+ * @param {number} g
305
+ * @param {number} b
306
+ * @param {number} [a=1]
307
+ * @returns {HslColor}
308
+ */
309
+ static rgbaToHsl(r: number, g: number, b: number, a?: number): HslColor;
310
+ /**
311
+ * Converts rgb(a) string to RGBA array.
312
+ * @param {string} rgb
313
+ * @returns {RgbaColor}
314
+ */
315
+ static rgbStringToRgbaArray(rgb: string): RgbaColor;
316
+ /**
317
+ * Converts integer color to HSL.
318
+ * @param {number} int
319
+ * @returns {HslColor}
320
+ */
321
+ static intToHsl(int: number): HslColor;
322
+ /**
323
+ * Converts integer color to HSL.
324
+ * @param {number} int
325
+ * @returns {HslaColor}
326
+ */
327
+ static intToHsla(int: number): HslaColor;
328
+ /**
329
+ * Converts integer color to hex.
330
+ * @param {number} int
331
+ * @returns {HexColor}
332
+ */
333
+ static intToHex(int: number): HexColor;
334
+ /**
335
+ * Converts an integer (0xRRGGBB) to RGBA.
336
+ * @param {number} value
337
+ * @returns {RgbaColor}
338
+ */
339
+ static intToRgba(value: number): RgbaColor;
340
+ /**
341
+ * @param {ColorTypes|null} [input=null] - Any valid color (hex, rgb string, rgba string, hsl(a), css name, array or int).
342
+ * @param {boolean} [checkIsHsl=false]
343
+ */
344
+ constructor(input?: ColorTypes | null, checkIsHsl?: boolean);
345
+ /**
346
+ * @param {ColorTypes} input - Any valid color (hex, rgb string, rgba string, hsl(a), css name, array or int).
347
+ */
348
+ setColor(input: ColorTypes): void;
349
+ /**
350
+ * Returns HSLA array.
351
+ * @returns {HslaColor}
352
+ */
353
+ toHslaArray(): HslaColor;
354
+ /**
355
+ * Returns RGB string.
356
+ * @returns {string}
357
+ */
358
+ toHslString(): string;
359
+ /**
360
+ * Returns RGBA string.
361
+ * @returns {string}
362
+ */
363
+ toHslaString(): string;
364
+ /**
365
+ * Returns RGBA array.
366
+ * @returns {RgbaColor}
367
+ */
368
+ toRgbaArray(): RgbaColor;
369
+ /**
370
+ * Returns RGB string.
371
+ * @returns {string}
372
+ */
373
+ toRgbString(): string;
374
+ /**
375
+ * Returns RGBA string.
376
+ * @returns {string}
377
+ */
378
+ toRgbaString(): string;
379
+ /**
380
+ * Returns hex color.
381
+ * @returns {HexColor}
382
+ */
383
+ toHex(): HexColor;
384
+ /**
385
+ * Returns color as integer.
386
+ * @returns {number}
387
+ */
388
+ toInt(): number;
389
+ /**
390
+ * Returns the original input.
391
+ * @returns {ColorTypes}
392
+ */
393
+ getOriginal(): ColorTypes;
394
+ #private;
395
+ }
396
+ //# sourceMappingURL=TinyColorConverter.d.mts.map