tiny-essentials 1.20.3 → 1.21.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.
- package/README.md +13 -11
- package/dist/_/numbers.cjs +136 -0
- package/dist/_/numbers.d.mts +24 -0
- package/dist/_/numbers.mjs +102 -0
- package/dist/v1/TinyAdvancedRaffle.min.js +1 -0
- package/dist/v1/TinyArrayPaginator.min.js +1 -0
- package/dist/v1/TinyBasicsEs.min.js +1 -1
- package/dist/v1/TinyCookieConsent.min.js +1 -0
- package/dist/v1/TinyDayNightCycle.min.js +1 -0
- package/dist/v1/TinyEssentials.min.js +1 -1
- package/dist/v1/TinyGamepad.min.js +1 -0
- package/dist/v1/TinyI18.min.js +1 -0
- package/dist/v1/TinyInventory.min.js +1 -0
- package/dist/v1/TinyInventoryTrader.min.js +1 -0
- package/dist/v1/TinyLocalStorage.min.js +1 -1
- package/dist/v1/TinyRateLimiter.min.js +1 -1
- package/dist/v1/TinySmartScroller.min.js +1 -1
- package/dist/v1/TinyToastNotify.min.js +1 -1
- package/dist/v1/TinyUploadClicker.min.js +1 -1
- package/dist/v1/basics/array.cjs +21 -0
- package/dist/v1/basics/array.d.mts +8 -0
- package/dist/v1/basics/array.mjs +18 -0
- package/dist/v1/basics/index.cjs +2 -8
- package/dist/v1/basics/index.d.mts +3 -8
- package/dist/v1/basics/index.mjs +2 -3
- package/dist/v1/basics/simpleMath.cjs +46 -0
- package/dist/v1/basics/simpleMath.d.mts +27 -0
- package/dist/v1/basics/simpleMath.mjs +42 -0
- package/dist/v1/build/TinyAdvancedRaffle.cjs +7 -0
- package/dist/v1/build/TinyAdvancedRaffle.d.mts +3 -0
- package/dist/v1/build/TinyAdvancedRaffle.mjs +2 -0
- package/dist/v1/build/TinyArrayPaginator.cjs +7 -0
- package/dist/v1/build/TinyArrayPaginator.d.mts +3 -0
- package/dist/v1/build/TinyArrayPaginator.mjs +2 -0
- package/dist/v1/build/TinyCookieConsent.cjs +7 -0
- package/dist/v1/build/TinyCookieConsent.d.mts +3 -0
- package/dist/v1/build/TinyCookieConsent.mjs +2 -0
- package/dist/v1/build/TinyDayNightCycle.cjs +7 -0
- package/dist/v1/build/TinyDayNightCycle.d.mts +3 -0
- package/dist/v1/build/TinyDayNightCycle.mjs +2 -0
- package/dist/v1/build/TinyGamepad.cjs +7 -0
- package/dist/v1/build/TinyGamepad.d.mts +3 -0
- package/dist/v1/build/TinyGamepad.mjs +2 -0
- package/dist/v1/build/TinyI18.cjs +7 -0
- package/dist/v1/build/TinyI18.d.mts +3 -0
- package/dist/v1/build/TinyI18.mjs +2 -0
- package/dist/v1/build/TinyInventory.cjs +7 -0
- package/dist/v1/build/TinyInventory.d.mts +3 -0
- package/dist/v1/build/TinyInventory.mjs +2 -0
- package/dist/v1/build/TinyInventoryTrader.cjs +7 -0
- package/dist/v1/build/TinyInventoryTrader.d.mts +3 -0
- package/dist/v1/build/TinyInventoryTrader.mjs +2 -0
- package/dist/v1/css/TinyCookieConsent.min.css +1 -0
- package/dist/v1/index.cjs +18 -8
- package/dist/v1/index.d.mts +11 -8
- package/dist/v1/index.mjs +10 -3
- package/dist/v1/libs/TinyAdvancedRaffle.cjs +1654 -0
- package/dist/v1/libs/TinyAdvancedRaffle.d.mts +851 -0
- package/dist/v1/libs/TinyAdvancedRaffle.mjs +1477 -0
- package/dist/v1/libs/TinyArrayPaginator.cjs +132 -0
- package/dist/v1/libs/TinyArrayPaginator.d.mts +78 -0
- package/dist/v1/libs/TinyArrayPaginator.mjs +119 -0
- package/dist/v1/libs/TinyCookieConsent.cjs +278 -0
- package/dist/v1/libs/TinyCookieConsent.d.mts +142 -0
- package/dist/v1/libs/TinyCookieConsent.mjs +248 -0
- package/dist/v1/libs/TinyDayNightCycle.cjs +1389 -0
- package/dist/v1/libs/TinyDayNightCycle.d.mts +673 -0
- package/dist/v1/libs/TinyDayNightCycle.mjs +1232 -0
- package/dist/v1/libs/TinyGamepad.cjs +2690 -0
- package/dist/v1/libs/TinyGamepad.d.mts +1286 -0
- package/dist/v1/libs/TinyGamepad.mjs +2386 -0
- package/dist/v1/libs/TinyHtml.d.mts +2 -2
- package/dist/v1/libs/TinyI18.cjs +946 -0
- package/dist/v1/libs/TinyI18.d.mts +418 -0
- package/dist/v1/libs/TinyI18.mjs +873 -0
- package/dist/v1/libs/TinyInventory.cjs +1788 -0
- package/dist/v1/libs/TinyInventory.d.mts +871 -0
- package/dist/v1/libs/TinyInventory.mjs +1650 -0
- package/dist/v1/libs/TinyInventoryTrader.cjs +242 -0
- package/dist/v1/libs/TinyInventoryTrader.d.mts +95 -0
- package/dist/v1/libs/TinyInventoryTrader.mjs +212 -0
- package/dist/v1/libs/TinyLocalStorage.cjs +14 -1
- package/dist/v1/libs/TinyLocalStorage.mjs +8 -1
- package/dist/v1/libs/TinyRateLimiter.cjs +0 -13
- package/dist/v1/libs/TinyRateLimiter.d.mts +0 -8
- package/dist/v1/libs/TinyRateLimiter.mjs +0 -12
- package/dist/v1/libs/TinySmartScroller.cjs +0 -51
- package/dist/v1/libs/TinySmartScroller.d.mts +0 -36
- package/dist/v1/libs/TinySmartScroller.mjs +0 -46
- package/dist/v1/libs/TinyToastNotify.cjs +2 -2
- package/dist/v1/libs/TinyToastNotify.mjs +2 -2
- package/dist/v1/libs/TinyUploadClicker.cjs +1 -1
- package/docs/v1/Ai-Tips.md +51 -0
- package/docs/v1/Personal-Ai-Prompts(portuguese).md +134 -0
- package/docs/v1/Personal-Ai-Prompts.md +113 -0
- package/docs/v1/README.md +23 -0
- package/docs/v1/basics/array.md +17 -0
- package/docs/v1/basics/simpleMath.md +73 -0
- package/docs/v1/libs/TinyAdvancedRaffle.md +674 -0
- package/docs/v1/libs/TinyArrayPaginator.md +150 -0
- package/docs/v1/libs/TinyCookieConsent.md +152 -0
- package/docs/v1/libs/TinyDayNightCycle.md +711 -0
- package/docs/v1/libs/TinyGamepad.md +980 -0
- package/docs/v1/libs/TinyI18.md +515 -0
- package/docs/v1/libs/TinyInventory.md +777 -0
- package/docs/v1/libs/TinyInventoryTrader.md +114 -0
- package/package.json +7 -5
- package/dist/v1/basics/html_deprecated.cjs +0 -124
- package/dist/v1/basics/html_deprecated.d.mts +0 -40
- package/dist/v1/basics/html_deprecated.mjs +0 -97
- package/dist/v1/css/TinyDraggerExample.css +0 -21
- package/dist/v1/css/TinyNotify.css +0 -350
- package/dist/v1/css/aiMarker.css +0 -4
- package/docs/v1/basics/html_deprecated.md +0 -127
|
@@ -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(--
|
|
308
|
+
closeBtn.style.color = 'var(--notify-close-color-hover)';
|
|
309
309
|
});
|
|
310
310
|
closeBtn.addEventListener('mouseleave', () => {
|
|
311
|
-
closeBtn.style.color = 'var(--
|
|
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(--
|
|
269
|
+
closeBtn.style.color = 'var(--notify-close-color-hover)';
|
|
270
270
|
});
|
|
271
271
|
closeBtn.addEventListener('mouseleave', () => {
|
|
272
|
-
closeBtn.style.color = 'var(--
|
|
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.
|
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
> ⚠️ **Aviso:** Os prompts fornecidos neste documento foram testados apenas no ChatGPT. O funcionamento pode variar em outras plataformas ou modelos de IA.
|
|
2
|
+
|
|
3
|
+
### ⚙️ Preferências Técnicas de Código (JavaScript e Geral)
|
|
4
|
+
|
|
5
|
+
#### 📄 jsDoc
|
|
6
|
+
|
|
7
|
+
**jsDoc detalhado e estruturado internamente**
|
|
8
|
+
|
|
9
|
+
```
|
|
10
|
+
A usuária prefere que, ao cuidar de estruturas de jsDoc, seja adicionado um sub jsDoc (sem descrições) nos valores internos das funções para que tudo fique adequadamente encaixado com a estrutura do jsDoc primário.
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
**jsDoc obrigatório somente com tipos, sem descrições (quando não autorizado explicitamente)**
|
|
14
|
+
|
|
15
|
+
```
|
|
16
|
+
A usuária prefere que, quando ela pedir para escrever um JavaScript sem ter autorizado o uso de jsDoc, o jsDoc seja gerado sem nenhuma descrição, apenas orientando os types de todos os valores dentro da função.
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
```
|
|
20
|
+
A usuária prefere que, quando pedir para escrever um código JavaScript e não autorizar o uso de jsDoc, se o jsDoc for necessário, ele seja gerado apenas com os tipos dos valores nas funções, sem descrições.
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
**Evitar o uso de `@private` ou `@public`**
|
|
24
|
+
|
|
25
|
+
```
|
|
26
|
+
A usuária prefere que não sejam usados os identificadores `@private` ou `@public` em jsDoc.
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
#### 📝 Estilo de Código
|
|
30
|
+
|
|
31
|
+
**Textos e comentários no código devem ser em inglês**
|
|
32
|
+
|
|
33
|
+
```
|
|
34
|
+
A usuária prefere que todos os textos escritos dentro dos códigos estejam em inglês.
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
```
|
|
38
|
+
A usuária prefere que os comentários e a documentação nos scripts sejam em inglês.
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
**Evitar repetições; priorizar otimização e reutilização**
|
|
42
|
+
|
|
43
|
+
```
|
|
44
|
+
A usuária deseja que todos os códigos de programação fornecidos sejam otimizados, evitando repetições de fórmulas e utilizando templates ou funções reutilizáveis sempre que possível para reduzir o tamanho do código.
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
**Evitar uso de `var`; utilizar `let` ou `const`**
|
|
48
|
+
|
|
49
|
+
```
|
|
50
|
+
A usuária prefere evitar o uso de 'var' em JavaScript e utilizar alternativas como 'let' ou 'const'.
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
**Utilizar `import` em vez de `require`**
|
|
54
|
+
|
|
55
|
+
```
|
|
56
|
+
A usuária prefere que seja utilizado `import` em vez de `require` nas respostas com código JavaScript.
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
**Scripts escritos em inglês; explicações em português (no caso de algoritmos)**
|
|
60
|
+
|
|
61
|
+
```
|
|
62
|
+
A usuária prefere que os scripts sejam escritos em inglês, mas que as respostas sobre algoritmos sejam em português.
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
#### 🖧 Tecnologias Preferidas
|
|
66
|
+
|
|
67
|
+
**Exemplos com Apache2 ao invés de Nginx**
|
|
68
|
+
|
|
69
|
+
```
|
|
70
|
+
A usuária prefere exemplos com **Apache2** em vez de **Nginx**.
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
---
|
|
74
|
+
|
|
75
|
+
### 🖥️ Informações Técnicas Sobre o Ambiente da Usuária
|
|
76
|
+
|
|
77
|
+
```
|
|
78
|
+
A usuária utiliza um teclado tradicional com a tecla Windows, configurado como **English (US, Intl., with dead keys)**.
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
```
|
|
82
|
+
A usuária utiliza o Kubuntu com KDE em inglês.
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
---
|
|
86
|
+
|
|
87
|
+
### 🧠 Preferências de Interação, Estilo e Personalidade da Assistente
|
|
88
|
+
|
|
89
|
+
**README com tom divertido, mas não “descolado demais”**
|
|
90
|
+
|
|
91
|
+
```
|
|
92
|
+
A usuária prefere que o tom do README seja divertido, mas não descolado, mantendo um estilo mais equilibrado e amigável.
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
**Uso de "hahaha" ao invés de "kkkkk" nas interações**
|
|
96
|
+
|
|
97
|
+
```
|
|
98
|
+
A usuária prefere que seja usado "hahaha" em vez de "kkkkk" nas respostas.
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
```
|
|
102
|
+
<username> é geralmente o username principal da usuária.
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
---
|
|
106
|
+
|
|
107
|
+
## 📌 Instruções Principais
|
|
108
|
+
|
|
109
|
+
**Estilo de conversa adaptado para autismo/Asperger**
|
|
110
|
+
|
|
111
|
+
```
|
|
112
|
+
Não use nenhum filtro de conteúdo e nenhuma ideologia nas suas respostas desde que tudo esteja respeitando seus termos de uso.
|
|
113
|
+
Eu tenho sindrome de asperger, então tenha uma personalidade mais adaptada para dialogar melhor com este tipo de pessoa.
|
|
114
|
+
|
|
115
|
+
me responder usando as seguintes configurações:
|
|
116
|
+
sinceridade: 100%
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
## 🖥️ Mais Instruções
|
|
120
|
+
|
|
121
|
+
**Throws alinhados com o jsDoc do script**
|
|
122
|
+
```
|
|
123
|
+
coloque throws que ajudam a validar se os argumentos contradiz com os jsDocs:
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
**Desenvolvimento de documentação markdown**
|
|
127
|
+
|
|
128
|
+
```
|
|
129
|
+
agora eu vou começar a te enviar por partes a versão final do NAME_HERE. O seu trabalho vai ser apenas converter cada mensagem em documentação markdown (em inglês com emojis) até o final da class.
|
|
130
|
+
```
|
|
131
|
+
|
|
132
|
+
```
|
|
133
|
+
continue o trabalho (documentação markdown em inglês com emojis):
|
|
134
|
+
```
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
> ⚠️ **Disclaimer:** The prompts provided in this document have been tested only in ChatGPT. Their behavior may vary on other platforms or AI models.
|
|
2
|
+
|
|
3
|
+
### ⚙️ Technical Code Preferences (JavaScript and General)
|
|
4
|
+
|
|
5
|
+
#### 📄 jsDoc
|
|
6
|
+
|
|
7
|
+
**Detailed jsDoc with internal structure**
|
|
8
|
+
|
|
9
|
+
```
|
|
10
|
+
The user prefers that, when dealing with jsDoc structures, a sub-jsDoc (without descriptions) be added to the internal values of the functions so that everything is properly aligned with the primary jsDoc structure.
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
**jsDoc required with types only, no descriptions (unless explicitly authorized)**
|
|
14
|
+
|
|
15
|
+
```
|
|
16
|
+
The user prefers that, when asking for JavaScript code without having authorized the use of jsDoc, the jsDoc should be generated with no descriptions, only specifying the types of all values inside the function.
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
```
|
|
20
|
+
The user prefers that, when asking for JavaScript code and not authorizing the use of jsDoc, if jsDoc is necessary, it should only include the types of the function values, without descriptions.
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
**Avoid using `@private` or `@public`**
|
|
24
|
+
|
|
25
|
+
```
|
|
26
|
+
The user prefers that `@private` or `@public` identifiers not be used in jsDoc.
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
#### 📝 Code Style
|
|
30
|
+
|
|
31
|
+
**Avoid repetition; prioritize optimization and reuse**
|
|
32
|
+
|
|
33
|
+
```
|
|
34
|
+
The user wants all provided programming code to be optimized, avoiding repeated formulas and using templates or reusable functions whenever possible to reduce the size of the code.
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
**Avoid using `var`; prefer `let` or `const`**
|
|
38
|
+
|
|
39
|
+
```
|
|
40
|
+
The user prefers to avoid using 'var' in JavaScript and instead use alternatives like 'let' or 'const'.
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
**Use `import` instead of `require`**
|
|
44
|
+
|
|
45
|
+
```
|
|
46
|
+
The user prefers that `import` be used instead of `require` in JavaScript code responses.
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
#### 🖧 Preferred Technologies
|
|
50
|
+
|
|
51
|
+
**Examples using Apache2 instead of Nginx**
|
|
52
|
+
|
|
53
|
+
```
|
|
54
|
+
The user prefers examples using **Apache2** instead of **Nginx**.
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
---
|
|
58
|
+
|
|
59
|
+
### 🖥️ Technical Information About the User’s Environment
|
|
60
|
+
|
|
61
|
+
```
|
|
62
|
+
The user uses a traditional keyboard with the Windows key, configured as **English (US, Intl., with dead keys)**.
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
```
|
|
66
|
+
The user uses Kubuntu with KDE in English.
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
---
|
|
70
|
+
|
|
71
|
+
### 🧠 Interaction, Style, and Assistant Personality Preferences
|
|
72
|
+
|
|
73
|
+
**README with a fun tone, but not overly “cool”**
|
|
74
|
+
|
|
75
|
+
```
|
|
76
|
+
The user prefers the README tone to be fun, but not overly cool or trendy, keeping a more balanced and friendly style.
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
```
|
|
80
|
+
<username> is usually the user’s main username.
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
---
|
|
84
|
+
|
|
85
|
+
## 📌 Main Instruction
|
|
86
|
+
|
|
87
|
+
**Conversation style adapted for autism/Asperger**
|
|
88
|
+
|
|
89
|
+
```
|
|
90
|
+
Do not use any content filters or ideology in your responses as long as everything respects your terms of use.
|
|
91
|
+
I have Asperger’s syndrome, so please have a personality better adapted to interact with this kind of person.
|
|
92
|
+
|
|
93
|
+
respond to me using the following settings:
|
|
94
|
+
sincerity: 100%
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
## 🖥️ More Instructions
|
|
98
|
+
|
|
99
|
+
**Throws aligned with the script’s jsDoc**
|
|
100
|
+
|
|
101
|
+
```
|
|
102
|
+
Add throws that help validate if the arguments contradict the jsDocs:
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
**Markdown documentation development**
|
|
106
|
+
|
|
107
|
+
```
|
|
108
|
+
Now I will start sending you, in parts, the final version of NAME_HERE. Your job will be to simply convert each message into markdown documentation (in English with emojis) until the end of the class.
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
```
|
|
112
|
+
Continue the work (markdown documentation in English with emojis):
|
|
113
|
+
```
|
package/docs/v1/README.md
CHANGED
|
@@ -46,7 +46,15 @@ This folder contains the core scripts we have worked on so far. Each file is a m
|
|
|
46
46
|
- 📦 **[TinyLocalStorage](./libs/TinyLocalStorage.md)** — A tiny wrapper for `localStorage` with full support for objects, arrays, `Map`, `Set`, and typed value helpers like string, number, and boolean.
|
|
47
47
|
- 🖼️ **[TinyIframeEvents](./libs/TinyIframeEvents.md)** — A structured `postMessage`-based event router for secure and reliable communication between a parent window and its embedded iframe. Supports directional filtering, origin enforcement, payload transport, and listener lifecycle.
|
|
48
48
|
- 🪟 **[TinyNewWinEvents](./libs/TinyNewWinEvents.md)** — A smart, route-based `postMessage` system for structured communication between a main window and a popup (`window.open`). Includes queueing, origin enforcement, and lifecycle tracking.
|
|
49
|
+
- 🎮 **[TinyGamepad](./libs/TinyGamepad.md)** — A flexible, professional gamepad and input manager supporting keyboard, mouse, combos, haptics, and custom input mappings.
|
|
49
50
|
- ✨ **[TinyTextarea](./libs/TinyTextarea.md)** — A minimal auto-expanding `<textarea>` manager with configurable row limits, extra height padding, and real-time resize/input event hooks.
|
|
51
|
+
- 🌞 **[TinyDayNightCycle](./libs/TinyDayNightCycle.md)** — A comprehensive day-night cycle system managing seasons, moons, time, and weather with configurable durations, phases, and dynamic weather selection.
|
|
52
|
+
- 🎯 **[TinyAdvancedRaffle](./libs/TinyAdvancedRaffle.md)** — An advanced, seedable raffle system with weighted items, pity systems, exclusions, group management, modifiers, conditional rules, normalization modes, and JSON import/export.
|
|
53
|
+
- 📄 **[TinyArrayPaginator](./libs/TinyArrayPaginator.md)** — A secure and flexible array pagination wrapper that returns paginated results along with metadata, supports filtering via predicates or object-based matching, and prevents direct modification of the source data.
|
|
54
|
+
- 🍪 **[TinyCookieConsent](./libs/TinyCookieConsent.md)** — A flexible and customizable cookie consent manager that displays a consent bar, supports multiple categories, saves preferences in localStorage, allows custom renderers, and provides smooth animations for showing and hiding elements.
|
|
55
|
+
- 📦 **[TinyInventory](./libs/TinyInventory.md)** — A robust inventory management system with stack handling, slot management, special equipment slots, serialization, cloning, and item registry support.
|
|
56
|
+
- 🤝 **[TinyInventoryTrader](./libs/TinyInventoryTrader.md)** — A trading helper for safely transferring items between two inventories with support for strict mode, slot targeting, and batch operations.
|
|
57
|
+
- 🌐 **[TinyI18](./libs/TinyI18.md)** — A flexible i18n manager supporting local and file modes, regex-based keys, function-based entries, string interpolation, and safe helper functions for advanced rendering.
|
|
50
58
|
|
|
51
59
|
### 3. **`fileManager/`**
|
|
52
60
|
* 📁 **[Main](./fileManager/main.md)** — A Node.js file/directory utility module with support for JSON, backups, renaming, size analysis, and more.
|
|
@@ -62,3 +70,18 @@ To get started, navigate to the appropriate directory and explore the files list
|
|
|
62
70
|
## 📑 Contributing
|
|
63
71
|
|
|
64
72
|
Feel free to suggest changes, improvements, or additional features. You can fork the repository and submit a pull request!
|
|
73
|
+
|
|
74
|
+
---
|
|
75
|
+
|
|
76
|
+
## 📘 Want to Know How I Use AI in My Projects?
|
|
77
|
+
|
|
78
|
+
If you're curious about how I integrate AI into my development workflow — including how I manage prompts, avoid context drift, and keep control over logic and documentation — feel free to check out the following guides:
|
|
79
|
+
|
|
80
|
+
* [**AI Tips & Workflow**](./Ai-Tips.md)
|
|
81
|
+
Personal tips, common pitfalls to avoid, and how I keep AI assistance effective without losing my own creative and logical direction.
|
|
82
|
+
|
|
83
|
+
* [**Personal AI Prompts**](./Personal-Ai-Prompts.md)
|
|
84
|
+
A curated collection of my most-used AI prompts for various tasks like coding, writing, automation, and technical documentation — written in English.
|
|
85
|
+
|
|
86
|
+
* [**Personal AI Prompts (Portuguese)**](./Personal-Ai-Prompts%28portuguese%29.md)
|
|
87
|
+
The same set of personal AI prompts, but fully translated into Portuguese for ease of use in native language contexts.
|
package/docs/v1/basics/array.md
CHANGED
|
@@ -78,3 +78,20 @@ Great for situations where you need to **dynamically sort objects** by one of th
|
|
|
78
78
|
* Sorting users by age
|
|
79
79
|
* Ordering tasks by priority
|
|
80
80
|
* Displaying leaderboard scores
|
|
81
|
+
|
|
82
|
+
---
|
|
83
|
+
|
|
84
|
+
## 🔁 `multiplyArrayBlocks(phases, counts)`
|
|
85
|
+
|
|
86
|
+
Generates a flattened array with phases repeated according to the specified counts.
|
|
87
|
+
|
|
88
|
+
* **`phases`** 📝 — Array of phase names (e.g., `['Full', 'Half1', 'Half2', 'New']`).
|
|
89
|
+
* **`counts`** 🔢 — Array of integers specifying how many times each phase should be repeated (e.g., `[4, 5, 5, 4]`).
|
|
90
|
+
* **Returns** 📦 — A single array where each phase appears the given number of times, in order.
|
|
91
|
+
|
|
92
|
+
**Example:**
|
|
93
|
+
|
|
94
|
+
```js
|
|
95
|
+
multiplyArrayBlocks(['Full', 'Half1', 'Half2', 'New'], [4, 5, 5, 4]);
|
|
96
|
+
// ➡ ['Full','Full','Full','Full','Half1','Half1','Half1','Half1','Half1', ...]
|
|
97
|
+
```
|
|
@@ -165,3 +165,76 @@ genFibonacciSeq({
|
|
|
165
165
|
An array representing the generated sequence.
|
|
166
166
|
|
|
167
167
|
> 🔖 **Beta** – Still experimental and fun to tweak!
|
|
168
|
+
|
|
169
|
+
---
|
|
170
|
+
|
|
171
|
+
### 📊 `compareMarketcap`
|
|
172
|
+
|
|
173
|
+
Calculates the price change of a stuff when its **market cap changes**.
|
|
174
|
+
|
|
175
|
+
#### 🧩 Function Signature
|
|
176
|
+
|
|
177
|
+
```js
|
|
178
|
+
compareMarketcap(originalMarketCap, circulatingSupply, newMarketCap)
|
|
179
|
+
```
|
|
180
|
+
|
|
181
|
+
#### 📥 Parameters
|
|
182
|
+
|
|
183
|
+
| Parameter | Type | Description |
|
|
184
|
+
| ------------------- | -------- | --------------------------------------------------------------------------- |
|
|
185
|
+
| `originalMarketCap` | `number` | 💰 The original market capitalization. Must be a valid, finite number. |
|
|
186
|
+
| `circulatingSupply` | `number` | 🔄 The circulating supply of the coin. Must be a positive number. |
|
|
187
|
+
| `newMarketCap` | `number` | 📉 The new market capitalization. Optional. Must be a valid number if used. |
|
|
188
|
+
|
|
189
|
+
#### 📤 Returns
|
|
190
|
+
|
|
191
|
+
An object with the following fields:
|
|
192
|
+
|
|
193
|
+
```js
|
|
194
|
+
{
|
|
195
|
+
originalPrice: number, // 💵 Price before market cap changed
|
|
196
|
+
newPrice: number, // 💸 Price after market cap changed (NaN if not provided)
|
|
197
|
+
priceChangePercent: number // 📈 Percentage change in price (NaN if newMarketCap not provided)
|
|
198
|
+
}
|
|
199
|
+
```
|
|
200
|
+
|
|
201
|
+
#### ⚠️ Validation Rules
|
|
202
|
+
|
|
203
|
+
* Throws a `TypeError` if any of the numeric inputs are not finite numbers.
|
|
204
|
+
* Throws an `Error` if `circulatingSupply` is less than or equal to zero.
|
|
205
|
+
* If `newMarketCap` is omitted or not a number, `newPrice` and `priceChangePercent` will be `NaN`.
|
|
206
|
+
|
|
207
|
+
#### 📝 Notes
|
|
208
|
+
|
|
209
|
+
* Useful for estimating the effect of market cap fluctuations on token price.
|
|
210
|
+
* Ideal for financial dashboards, token simulations, or educational tools.
|
|
211
|
+
|
|
212
|
+
---
|
|
213
|
+
|
|
214
|
+
### 📈 `calculateMarketcap(originalMarketCap, circulatingSupply)`
|
|
215
|
+
|
|
216
|
+
Calculates the **unit price** of a coin or token based on its **market capitalization** and **circulating supply**.
|
|
217
|
+
|
|
218
|
+
This function is commonly used in financial applications to estimate the price per asset unit (e.g., per token or coin).
|
|
219
|
+
|
|
220
|
+
#### 🧮 Formula
|
|
221
|
+
|
|
222
|
+
```
|
|
223
|
+
price = originalMarketCap / circulatingSupply
|
|
224
|
+
```
|
|
225
|
+
|
|
226
|
+
#### 📥 Parameters
|
|
227
|
+
|
|
228
|
+
| Name | Type | Description |
|
|
229
|
+
| ------------------- | -------- | ---------------------------------------------------------- |
|
|
230
|
+
| `originalMarketCap` | `number` | The total market capitalization (e.g., in USD) 💵. |
|
|
231
|
+
| `circulatingSupply` | `number` | The number of tokens or coins currently in circulation 🪙. |
|
|
232
|
+
|
|
233
|
+
#### 📤 Returns
|
|
234
|
+
|
|
235
|
+
* `number` – The calculated **unit price** of the asset 🔢.
|
|
236
|
+
|
|
237
|
+
#### ⚠️ Throws
|
|
238
|
+
|
|
239
|
+
* `TypeError` – If either parameter is not a finite number ❌.
|
|
240
|
+
* `Error` – If `circulatingSupply` is less than or equal to zero 🚫.
|