tiny-essentials 1.25.0 → 1.25.2
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 +1 -1
- package/changelog/1/25/1.md +18 -0
- package/changelog/1/25/2.md +9 -0
- package/dist/v1/TinyAnalogClock.min.js +1 -0
- package/dist/v1/TinyEssentials.min.js +1 -1
- package/dist/v1/TinyTextDiffer.min.js +1 -0
- package/dist/v1/basics/array.cjs +5 -4
- package/dist/v1/basics/array.d.mts +7 -6
- package/dist/v1/basics/array.mjs +5 -4
- package/dist/v1/build/TinyAnalogClock.cjs +7 -0
- package/dist/v1/build/TinyAnalogClock.d.mts +3 -0
- package/dist/v1/build/TinyAnalogClock.mjs +2 -0
- package/dist/v1/build/TinyTextDiffer.cjs +7 -0
- package/dist/v1/build/TinyTextDiffer.d.mts +3 -0
- package/dist/v1/build/TinyTextDiffer.mjs +2 -0
- package/dist/v1/index.cjs +4 -0
- package/dist/v1/index.d.mts +3 -1
- package/dist/v1/index.mjs +3 -1
- package/dist/v1/libs/TinyAnalogClock.cjs +738 -0
- package/dist/v1/libs/TinyAnalogClock.d.mts +342 -0
- package/dist/v1/libs/TinyAnalogClock.mjs +653 -0
- package/dist/v1/libs/TinyTextDiffer.cjs +288 -0
- package/dist/v1/libs/TinyTextDiffer.d.mts +109 -0
- package/dist/v1/libs/TinyTextDiffer.mjs +255 -0
- package/docs/v1/README.md +2 -0
- package/docs/v1/basics/array.md +2 -2
- package/docs/v1/libs/TinyAnalogClock.md +295 -0
- package/docs/v1/libs/TinyTextDiffer.md +114 -0
- package/package.json +9 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(()=>{"use strict";var e={d:(t,r)=>{for(var s in r)e.o(r,s)&&!e.o(t,s)&&Object.defineProperty(t,s,{enumerable:!0,get:r[s]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t)},t={};e.d(t,{TinyTextDiffer:()=>r});const r=class{#e=[];#t=!1;get history(){return[...this.#e]}set history(e){if(!Array.isArray(e))throw new TypeError("History data must be provided as an array.");if(!e.every(e=>"string"==typeof e))throw new TypeError("All items in the history array must be strings.");this.#e=[...e]}get size(){return this.#e.length}constructor(e=[]){this.history=e}#r(){if(this.#t)throw new Error("Cannot perform operations on a destroyed TinyTextDiffer instance.")}#s(e){if("number"!=typeof e)throw new TypeError("The provided index must be a valid number.")}#i(e){if("string"!=typeof e)throw new TypeError("The provided text must be a valid string.")}get(e){if(this.#r(),this.#s(e),void 0===this.#e[e])throw new Error(`No text version found at index ${e}.`);return this.#e[e]}has(e){return this.#r(),this.#s(e),void 0!==this.#e[e]}add(e){this.#r(),this.#i(e),this.#e.push(e)}remove(){return this.#r(),this.#e.pop()}addAt(e,t){this.#r(),this.#s(e),this.#i(t),this.#e.splice(e,0,t)}removeAt(e){this.#r(),this.#s(e);const t=this.#e.length;return this.#e.splice(e,1),t!==this.#e.length}clear(){this.#r(),this.#e=[]}compare(...e){this.#r();const t=e.length;if(0===t||t%2!=0)throw new Error("The compare method requires an even number of indices to form comparison pairs.");const r=[];for(let s=0;s<t;s+=2){const i=s+1;if(i>t-1)continue;this.#s(e[s]),this.#s(e[i]);const h=this.#e[e[s]],o=this.#e[e[i]];r.push(this._computeDiff(h,o))}return r}_computeDiff(e,t){const r=e.length,s=t.length,i=Array(r+1).fill(null).map(()=>Array(s+1).fill(0));let h=1,o=1;for(h=1;h<=r;h++)for(o=1;o<=s;o++)e[h-1]===t[o-1]?i[h][o]=i[h-1][o-1]+1:i[h][o]=Math.max(i[h-1][o],i[h][o-1]);h=r,o=s;const n=[];for(;h>0||o>0;)h>0&&o>0&&e[h-1]===t[o-1]?(n.unshift({value:e[h-1],type:"normal"}),h--,o--):o>0&&(0===h||i[h][o-1]>=i[h-1][o])?(n.unshift({value:t[o-1],type:"added"}),o--):h>0&&(0===o||i[h][o-1]<i[h-1][o])&&(n.unshift({value:e[h-1],type:"deleted"}),h--);return n.reduce((e,t)=>{const r=e.length-1;return e.length>0&&e[r].type===t.type?e[r].value+=t.value:e.push(t),e},[])}destroy(){this.#t||(this.#e=[],this.#t=!0)}};window.TinyTextDiffer=t.TinyTextDiffer})();
|
package/dist/v1/basics/array.cjs
CHANGED
|
@@ -8,8 +8,9 @@
|
|
|
8
8
|
* This implementation ensures a uniform distribution of permutations.
|
|
9
9
|
* Original algorithm source: StackOverflow (link above).
|
|
10
10
|
*
|
|
11
|
-
* @
|
|
12
|
-
* @
|
|
11
|
+
* @template {any[]} T
|
|
12
|
+
* @param {T} items - The array to shuffle.
|
|
13
|
+
* @returns {T} The same array instance, now shuffled in place.
|
|
13
14
|
*/
|
|
14
15
|
function shuffleArray(items) {
|
|
15
16
|
let currentIndex = items.length,
|
|
@@ -31,9 +32,9 @@ function shuffleArray(items) {
|
|
|
31
32
|
/**
|
|
32
33
|
* Generates an array with repeated phases according to counts.
|
|
33
34
|
*
|
|
34
|
-
* @param {
|
|
35
|
+
* @param {any[]} phases - Array of phase names, e.g., ['Full', 'Half1', 'Half2', 'New'].
|
|
35
36
|
* @param {number[]} counts - Array of integers specifying how many times to repeat each phase, e.g., [4,5,5,4].
|
|
36
|
-
* @returns {
|
|
37
|
+
* @returns {any[]} - Flattened array containing phases repeated according to counts, concatenated in order.
|
|
37
38
|
*/
|
|
38
39
|
function multiplyArrayBlocks(phases, counts) {
|
|
39
40
|
// phases: array de strings, cada fase (ex: ['Full', 'Half1', 'Half2', 'New'])
|
|
@@ -4,18 +4,19 @@
|
|
|
4
4
|
* This implementation ensures a uniform distribution of permutations.
|
|
5
5
|
* Original algorithm source: StackOverflow (link above).
|
|
6
6
|
*
|
|
7
|
-
* @
|
|
8
|
-
* @
|
|
7
|
+
* @template {any[]} T
|
|
8
|
+
* @param {T} items - The array to shuffle.
|
|
9
|
+
* @returns {T} The same array instance, now shuffled in place.
|
|
9
10
|
*/
|
|
10
|
-
export function shuffleArray(items:
|
|
11
|
+
export function shuffleArray<T extends any[]>(items: T): T;
|
|
11
12
|
/**
|
|
12
13
|
* Generates an array with repeated phases according to counts.
|
|
13
14
|
*
|
|
14
|
-
* @param {
|
|
15
|
+
* @param {any[]} phases - Array of phase names, e.g., ['Full', 'Half1', 'Half2', 'New'].
|
|
15
16
|
* @param {number[]} counts - Array of integers specifying how many times to repeat each phase, e.g., [4,5,5,4].
|
|
16
|
-
* @returns {
|
|
17
|
+
* @returns {any[]} - Flattened array containing phases repeated according to counts, concatenated in order.
|
|
17
18
|
*/
|
|
18
|
-
export function multiplyArrayBlocks(phases:
|
|
19
|
+
export function multiplyArrayBlocks(phases: any[], counts: number[]): any[];
|
|
19
20
|
/**
|
|
20
21
|
* Diff two class lists.
|
|
21
22
|
* @param {any[]} oldItems
|
package/dist/v1/basics/array.mjs
CHANGED
|
@@ -5,8 +5,9 @@
|
|
|
5
5
|
* This implementation ensures a uniform distribution of permutations.
|
|
6
6
|
* Original algorithm source: StackOverflow (link above).
|
|
7
7
|
*
|
|
8
|
-
* @
|
|
9
|
-
* @
|
|
8
|
+
* @template {any[]} T
|
|
9
|
+
* @param {T} items - The array to shuffle.
|
|
10
|
+
* @returns {T} The same array instance, now shuffled in place.
|
|
10
11
|
*/
|
|
11
12
|
export function shuffleArray(items) {
|
|
12
13
|
let currentIndex = items.length, randomIndex;
|
|
@@ -23,9 +24,9 @@ export function shuffleArray(items) {
|
|
|
23
24
|
/**
|
|
24
25
|
* Generates an array with repeated phases according to counts.
|
|
25
26
|
*
|
|
26
|
-
* @param {
|
|
27
|
+
* @param {any[]} phases - Array of phase names, e.g., ['Full', 'Half1', 'Half2', 'New'].
|
|
27
28
|
* @param {number[]} counts - Array of integers specifying how many times to repeat each phase, e.g., [4,5,5,4].
|
|
28
|
-
* @returns {
|
|
29
|
+
* @returns {any[]} - Flattened array containing phases repeated according to counts, concatenated in order.
|
|
29
30
|
*/
|
|
30
31
|
export function multiplyArrayBlocks(phases, counts) {
|
|
31
32
|
// phases: array de strings, cada fase (ex: ['Full', 'Half1', 'Half2', 'New'])
|
package/dist/v1/index.cjs
CHANGED
|
@@ -47,6 +47,8 @@ var TinySimpleDice = require('./libs/TinySimpleDice.cjs');
|
|
|
47
47
|
var TinyElementObserver = require('./libs/TinyElementObserver.cjs');
|
|
48
48
|
var TinyLoadingScreen = require('./libs/TinyLoadingScreen.cjs');
|
|
49
49
|
var TinyColorValidator = require('./libs/TinyColorValidator.cjs');
|
|
50
|
+
var TinyAnalogClock = require('./libs/TinyAnalogClock.cjs');
|
|
51
|
+
var TinyTextDiffer = require('./libs/TinyTextDiffer.cjs');
|
|
50
52
|
|
|
51
53
|
|
|
52
54
|
|
|
@@ -175,3 +177,5 @@ exports.TinySimpleDice = TinySimpleDice;
|
|
|
175
177
|
exports.TinyElementObserver = TinyElementObserver;
|
|
176
178
|
exports.TinyLoadingScreen = TinyLoadingScreen;
|
|
177
179
|
exports.TinyColorValidator = TinyColorValidator;
|
|
180
|
+
exports.TinyAnalogClock = TinyAnalogClock;
|
|
181
|
+
exports.TinyTextDiffer = TinyTextDiffer;
|
package/dist/v1/index.d.mts
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import TinyTextDiffer from './libs/TinyTextDiffer.mjs';
|
|
2
|
+
import TinyAnalogClock from './libs/TinyAnalogClock.mjs';
|
|
1
3
|
import TinyColorValidator from './libs/TinyColorValidator.mjs';
|
|
2
4
|
import TinyLoadingScreen from './libs/TinyLoadingScreen.mjs';
|
|
3
5
|
import TinyElementObserver from './libs/TinyElementObserver.mjs';
|
|
@@ -123,5 +125,5 @@ import { getTimeDuration } from './basics/clock.mjs';
|
|
|
123
125
|
import { shuffleArray } from './basics/array.mjs';
|
|
124
126
|
import { toTitleCase } from './basics/text.mjs';
|
|
125
127
|
import { toTitleCaseLowerFirst } from './basics/text.mjs';
|
|
126
|
-
export { TinyColorValidator, TinyLoadingScreen, TinyElementObserver, TinySimpleDice, TinyNeedBar, TinyI18, TinyCookieConsent, TinyInventory, TinyInventoryTrader, TinyArrayPaginator, TinyAdvancedRaffle, TinyDayNightCycle, TinyGamepad, TinyTextarea, TinyNewWinEvents, TinyIframeEvents, TinyLocalStorage, TinyEvents, TinyTimeout, TinyColorConverter, TinyClipboard, TinyTextRangeEditor, TinySmartScroller, UltraRandomMsgGen, TinyAfterScrollWatcher, TinyHtml, TinyNotifications, TinyDomReadyManager, TinyDragger, TinyDragDropDetector, TinyToastNotify, TinyNotifyCenter, TinyRateLimiter, ColorSafeStringify, TinyPromiseQueue, TinyLevelUp, diffArrayList, diffStrings, breakdownDuration, calculateMarketcap, compareMarketcap, getPercentage, areElsCollTop, areElsCollBottom, areElsCollLeft, areElsCollRight, areElsCollPerfTop, areElsCollPerfBottom, areElsCollPerfLeft, areElsCollPerfRight, areElsColliding, areElsPerfColliding, getElsColliding, getElsPerfColliding, getElsCollOverlap, getElsCollOverlapPos, getRectCenter, getElsRelativeCenterOffset, getElsCollDirDepth, getElsCollDetails, safeTextTrim, installWindowHiddenScript, genFibonacciSeq, isDirEmptyAsync, fileSizeAsync, dirSizeAsync, listFilesAsync, listDirsAsync, getLatestBackupPath, fetchJson, fetchText, readJsonBlob, readFileBlob, readBase64Blob, saveJsonFile, readJsonFile, writeJsonFile, ensureDirectory, clearDirectoryAsync, clearDirectory, fileExists, dirExists, isDirEmpty, ensureCopyFile, tryDeleteFile, writeTextFile, listFiles, listDirs, fileSize, dirSize, backupFile, restoreLatestBackup, renameFileBatch, renameFileRegex, renameFileAddPrefixSuffix, renameFileNormalizeCase, renameFilePadNumbers, documentIsFullScreen, isScreenFilled, requestFullScreen, exitFullScreen, isFullScreenMode, onFullScreenChange, offFullScreenChange, isJsonObject, arraySortPositions, formatBytes, addAiMarkerShortcut, extendObjType, reorderObjTypeOrder, cloneObjTypeOrder, countObj, checkObj, objType, ruleOfThree, getSimplePerc, asyncReplace, getAge, formatCustomTimer, formatDayTimer, formatTimer, getTimeDuration, shuffleArray, toTitleCase, toTitleCaseLowerFirst };
|
|
128
|
+
export { TinyTextDiffer, TinyAnalogClock, TinyColorValidator, TinyLoadingScreen, TinyElementObserver, TinySimpleDice, TinyNeedBar, TinyI18, TinyCookieConsent, TinyInventory, TinyInventoryTrader, TinyArrayPaginator, TinyAdvancedRaffle, TinyDayNightCycle, TinyGamepad, TinyTextarea, TinyNewWinEvents, TinyIframeEvents, TinyLocalStorage, TinyEvents, TinyTimeout, TinyColorConverter, TinyClipboard, TinyTextRangeEditor, TinySmartScroller, UltraRandomMsgGen, TinyAfterScrollWatcher, TinyHtml, TinyNotifications, TinyDomReadyManager, TinyDragger, TinyDragDropDetector, TinyToastNotify, TinyNotifyCenter, TinyRateLimiter, ColorSafeStringify, TinyPromiseQueue, TinyLevelUp, diffArrayList, diffStrings, breakdownDuration, calculateMarketcap, compareMarketcap, getPercentage, areElsCollTop, areElsCollBottom, areElsCollLeft, areElsCollRight, areElsCollPerfTop, areElsCollPerfBottom, areElsCollPerfLeft, areElsCollPerfRight, areElsColliding, areElsPerfColliding, getElsColliding, getElsPerfColliding, getElsCollOverlap, getElsCollOverlapPos, getRectCenter, getElsRelativeCenterOffset, getElsCollDirDepth, getElsCollDetails, safeTextTrim, installWindowHiddenScript, genFibonacciSeq, isDirEmptyAsync, fileSizeAsync, dirSizeAsync, listFilesAsync, listDirsAsync, getLatestBackupPath, fetchJson, fetchText, readJsonBlob, readFileBlob, readBase64Blob, saveJsonFile, readJsonFile, writeJsonFile, ensureDirectory, clearDirectoryAsync, clearDirectory, fileExists, dirExists, isDirEmpty, ensureCopyFile, tryDeleteFile, writeTextFile, listFiles, listDirs, fileSize, dirSize, backupFile, restoreLatestBackup, renameFileBatch, renameFileRegex, renameFileAddPrefixSuffix, renameFileNormalizeCase, renameFilePadNumbers, documentIsFullScreen, isScreenFilled, requestFullScreen, exitFullScreen, isFullScreenMode, onFullScreenChange, offFullScreenChange, isJsonObject, arraySortPositions, formatBytes, addAiMarkerShortcut, extendObjType, reorderObjTypeOrder, cloneObjTypeOrder, countObj, checkObj, objType, ruleOfThree, getSimplePerc, asyncReplace, getAge, formatCustomTimer, formatDayTimer, formatTimer, getTimeDuration, shuffleArray, toTitleCase, toTitleCaseLowerFirst };
|
|
127
129
|
//# sourceMappingURL=index.d.mts.map
|
package/dist/v1/index.mjs
CHANGED
|
@@ -45,7 +45,9 @@ import TinySimpleDice from './libs/TinySimpleDice.mjs';
|
|
|
45
45
|
import TinyElementObserver from './libs/TinyElementObserver.mjs';
|
|
46
46
|
import TinyLoadingScreen from './libs/TinyLoadingScreen.mjs';
|
|
47
47
|
import TinyColorValidator from './libs/TinyColorValidator.mjs';
|
|
48
|
+
import TinyAnalogClock from './libs/TinyAnalogClock.mjs';
|
|
49
|
+
import TinyTextDiffer from './libs/TinyTextDiffer.mjs';
|
|
48
50
|
// import TinyHtmlElems from './libs/TinyHtml/index.mjs';
|
|
49
|
-
export {
|
|
51
|
+
export { TinyTextDiffer, TinyAnalogClock,
|
|
50
52
|
// TinyHtmlElems,
|
|
51
53
|
TinyColorValidator, TinyLoadingScreen, TinyElementObserver, TinySimpleDice, TinyNeedBar, TinyI18, TinyCookieConsent, TinyInventory, TinyInventoryTrader, TinyArrayPaginator, TinyAdvancedRaffle, TinyDayNightCycle, TinyGamepad, TinyTextarea, TinyNewWinEvents, TinyIframeEvents, TinyLocalStorage, TinyEvents, TinyTimeout, TinyColorConverter, TinyClipboard, TinyTextRangeEditor, TinySmartScroller, UltraRandomMsgGen, TinyAfterScrollWatcher, TinyHtml, TinyNotifications, TinyDomReadyManager, TinyDragger, TinyDragDropDetector, TinyToastNotify, TinyNotifyCenter, TinyRateLimiter, ColorSafeStringify, TinyPromiseQueue, TinyLevelUp, diffArrayList, diffStrings, breakdownDuration, calculateMarketcap, compareMarketcap, getPercentage, areElsCollTop, areElsCollBottom, areElsCollLeft, areElsCollRight, areElsCollPerfTop, areElsCollPerfBottom, areElsCollPerfLeft, areElsCollPerfRight, areElsColliding, areElsPerfColliding, getElsColliding, getElsPerfColliding, getElsCollOverlap, getElsCollOverlapPos, getRectCenter, getElsRelativeCenterOffset, getElsCollDirDepth, getElsCollDetails, safeTextTrim, installWindowHiddenScript, genFibonacciSeq, isDirEmptyAsync, fileSizeAsync, dirSizeAsync, listFilesAsync, listDirsAsync, getLatestBackupPath, fetchJson, fetchText, readJsonBlob, readFileBlob, readBase64Blob, saveJsonFile, readJsonFile, writeJsonFile, ensureDirectory, clearDirectoryAsync, clearDirectory, fileExists, dirExists, isDirEmpty, ensureCopyFile, tryDeleteFile, writeTextFile, listFiles, listDirs, fileSize, dirSize, backupFile, restoreLatestBackup, renameFileBatch, renameFileRegex, renameFileAddPrefixSuffix, renameFileNormalizeCase, renameFilePadNumbers, documentIsFullScreen, isScreenFilled, requestFullScreen, exitFullScreen, isFullScreenMode, onFullScreenChange, offFullScreenChange, isJsonObject, arraySortPositions, formatBytes, addAiMarkerShortcut, extendObjType, reorderObjTypeOrder, cloneObjTypeOrder, countObj, checkObj, objType, ruleOfThree, getSimplePerc, asyncReplace, getAge, formatCustomTimer, formatDayTimer, formatTimer, getTimeDuration, shuffleArray, toTitleCase, toTitleCaseLowerFirst, };
|