tiny-essentials 1.23.1 → 1.24.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.
@@ -69,6 +69,30 @@ const newDiv = $$$('<div class="box">Hello!</div>');
69
69
 
70
70
  ---
71
71
 
72
+ ## ⚙️ Controlling Whitespace in Class Names
73
+
74
+ TinyHtml includes a static flag called `classCanWhitespace`.
75
+ This allows you to decide whether **class names with whitespace** should be considered valid or not.
76
+
77
+ ```js
78
+ // Enable or disable whitespace in class names
79
+ TinyHtml.classCanWhitespace = true; // ✅ allows whitespace
80
+ console.log(TinyHtml.classCanWhitespace); // true
81
+
82
+ TinyHtml.classCanWhitespace = false; // 🚫 disallows whitespace
83
+ console.log(TinyHtml.classCanWhitespace); // false
84
+ ```
85
+
86
+ ⚠️ If you try to assign a non-boolean value, TinyHtml will throw an error:
87
+
88
+ ```js
89
+ // ❌ Throws TypeError
90
+ TinyHtml.classCanWhitespace = "yes";
91
+ // -> Uncaught TypeError: classCanWhitespace must be a boolean
92
+ ```
93
+
94
+ ---
95
+
72
96
  ## 🚀 Why Aliases?
73
97
 
74
98
  Aliases are especially handy when:
@@ -96,6 +120,9 @@ This makes your setup **cleaner, reusable, and consistent** across the whole pro
96
120
  // Enable debugging mode
97
121
  TinyHtml.elemDebug = true;
98
122
 
123
+ // Allow whitespace in class names
124
+ TinyHtml.classCanWhitespace = true;
125
+
99
126
  // jQuery-style single element selector
100
127
  export const $ = (queryString) => new TinyHtml(queryString);
101
128
 
@@ -133,6 +160,10 @@ newBox.mainDisplay = 'block';
133
160
  // Create an element
134
161
  const newBox2 = $$$('<div class="box">Hello!</div>');
135
162
  $('body').append(newBox);
163
+
164
+ // Control class whitespace support
165
+ console.log(TinyHtml.classCanWhitespace); // true
166
+ TinyHtml.classCanWhitespace = false; // disable whitespace
136
167
  ```
137
168
 
138
169
  ---
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tiny-essentials",
3
- "version": "1.23.1",
3
+ "version": "1.24.0",
4
4
  "description": "Collection of small, essential scripts designed to be used across various projects. These simple utilities are crafted for speed, ease of use, and versatility.",
5
5
  "scripts": {
6
6
  "test": "npm run test:mjs && npm run test:cjs && npm run test:js",
@@ -164,6 +164,10 @@
164
164
  "require": "./dist/v1/libs/TinyLoadingScreen.cjs",
165
165
  "import": "./dist/v1/libs/TinyLoadingScreen.mjs"
166
166
  },
167
+ "./libs/TinyColorValidator": {
168
+ "require": "./dist/v1/libs/TinyColorValidator.cjs",
169
+ "import": "./dist/v1/libs/TinyColorValidator.mjs"
170
+ },
167
171
  "./libs/TinyInventoryTrader": {
168
172
  "require": "./dist/v1/libs/TinyInventoryTrader.cjs",
169
173
  "import": "./dist/v1/libs/TinyInventoryTrader.mjs"