tiny-essentials 1.26.4 → 1.27.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.
Files changed (120) hide show
  1. package/.github/workflows/node.js.yml +1 -1
  2. package/README.md +0 -1
  3. package/changelog/1/27/0.md +24 -0
  4. package/dist/v1/ColorSafeStringify.min.js +1 -1
  5. package/dist/v1/TinyAdvancedRaffle.min.js +1 -1
  6. package/dist/v1/TinyAfterScrollWatcher.min.js +1 -1
  7. package/dist/v1/TinyAnalogClock.min.js +1 -1
  8. package/dist/v1/TinyArrayComparator.min.js +1 -1
  9. package/dist/v1/TinyArrayPaginator.min.js +1 -1
  10. package/dist/v1/TinyBasicsEs.min.js +1 -1
  11. package/dist/v1/TinyClassManager.min.js +1 -1
  12. package/dist/v1/TinyClipboard.min.js +1 -1
  13. package/dist/v1/TinyColorConverter.min.js +1 -1
  14. package/dist/v1/TinyColorValidator.min.js +1 -1
  15. package/dist/v1/TinyCookieConsent.min.js +1 -1
  16. package/dist/v1/TinyDayNightCycle.min.js +1 -1
  17. package/dist/v1/TinyDomReadyManager.min.js +1 -1
  18. package/dist/v1/TinyDragDropDetector.min.js +1 -1
  19. package/dist/v1/TinyDragger.min.js +1 -1
  20. package/dist/v1/TinyElementObserver.min.js +1 -1
  21. package/dist/v1/TinyEssentials.min.js +1 -1
  22. package/dist/v1/TinyEvents.min.js +1 -1
  23. package/dist/v1/TinyGamepad.min.js +1 -1
  24. package/dist/v1/TinyHtml.min.js +1 -1
  25. package/dist/v1/TinyI18.min.js +1 -1
  26. package/dist/v1/TinyIframeEvents.min.js +1 -1
  27. package/dist/v1/TinyInventory.min.js +1 -1
  28. package/dist/v1/TinyInventoryTrader.min.js +1 -1
  29. package/dist/v1/TinyLevelUp.min.js +1 -1
  30. package/dist/v1/TinyLoadingScreen.min.js +1 -1
  31. package/dist/v1/TinyLocalStorage.min.js +1 -1
  32. package/dist/v1/TinyMaInSys.min.js +1 -1
  33. package/dist/v1/TinyMediaPlayer.min.js +1 -0
  34. package/dist/v1/TinyNeedBar.min.js +1 -1
  35. package/dist/v1/TinyNewWinEvents.min.js +1 -1
  36. package/dist/v1/TinyNotifications.min.js +1 -1
  37. package/dist/v1/TinyNotifyCenter.min.js +1 -1
  38. package/dist/v1/TinyPromiseQueue.min.js +1 -1
  39. package/dist/v1/TinyRadioFm.min.js +1 -0
  40. package/dist/v1/TinyRateLimiter.min.js +1 -1
  41. package/dist/v1/TinySimpleDice.min.js +1 -1
  42. package/dist/v1/TinySmartScroller.min.js +1 -1
  43. package/dist/v1/TinyTextDiffer.min.js +1 -1
  44. package/dist/v1/TinyTextRangeEditor.min.js +1 -1
  45. package/dist/v1/TinyTextarea.min.js +1 -1
  46. package/dist/v1/TinyTimeout.min.js +1 -1
  47. package/dist/v1/TinyToastNotify.min.js +1 -1
  48. package/dist/v1/TinyUploadClicker.min.js +1 -1
  49. package/dist/v1/UltraRandomMsgGen.min.js +1 -1
  50. package/dist/v1/basics/index.cjs +5 -0
  51. package/dist/v1/basics/index.d.mts +5 -1
  52. package/dist/v1/basics/index.mjs +2 -1
  53. package/dist/v1/basics/mediaContent.cjs +644 -0
  54. package/dist/v1/basics/mediaContent.d.mts +296 -0
  55. package/dist/v1/basics/mediaContent.mjs +557 -0
  56. package/dist/v1/build/TinyMediaPlayer.cjs +7 -0
  57. package/dist/v1/build/TinyMediaPlayer.d.mts +3 -0
  58. package/dist/v1/build/TinyMediaPlayer.mjs +2 -0
  59. package/dist/v1/build/TinyRadioFm.cjs +7 -0
  60. package/dist/v1/build/TinyRadioFm.d.mts +3 -0
  61. package/dist/v1/build/TinyRadioFm.mjs +2 -0
  62. package/dist/v1/index.cjs +9 -0
  63. package/dist/v1/index.d.mts +7 -1
  64. package/dist/v1/index.mjs +5 -2
  65. package/dist/v1/libs/ColorSafeStringify.d.mts +1 -1
  66. package/dist/v1/libs/TinyAfterScrollWatcher.cjs +16 -3
  67. package/dist/v1/libs/TinyAfterScrollWatcher.d.mts +7 -3
  68. package/dist/v1/libs/TinyAfterScrollWatcher.mjs +13 -3
  69. package/dist/v1/libs/TinyArrayComparator.cjs +14 -11
  70. package/dist/v1/libs/TinyArrayComparator.d.mts +22 -19
  71. package/dist/v1/libs/TinyArrayComparator.mjs +14 -11
  72. package/dist/v1/libs/TinyArrayPaginator.cjs +23 -16
  73. package/dist/v1/libs/TinyArrayPaginator.d.mts +57 -30
  74. package/dist/v1/libs/TinyArrayPaginator.mjs +22 -16
  75. package/dist/v1/libs/TinyClassManager/TinyPluginInliner.cjs +265 -0
  76. package/dist/v1/libs/TinyClassManager/TinyPluginInliner.d.mts +92 -0
  77. package/dist/v1/libs/TinyClassManager/TinyPluginInliner.mjs +223 -0
  78. package/dist/v1/libs/TinyClassManager.cjs +52 -22
  79. package/dist/v1/libs/TinyClassManager.d.mts +26 -16
  80. package/dist/v1/libs/TinyClassManager.mjs +50 -21
  81. package/dist/v1/libs/TinyColorValidator.d.mts +16 -16
  82. package/dist/v1/libs/TinyDragDropDetector.cjs +9 -34
  83. package/dist/v1/libs/TinyDragDropDetector.d.mts +7 -21
  84. package/dist/v1/libs/TinyDragDropDetector.mjs +9 -24
  85. package/dist/v1/libs/TinyDragger.cjs +5 -5
  86. package/dist/v1/libs/TinyDragger.d.mts +4 -3
  87. package/dist/v1/libs/TinyDragger.mjs +5 -5
  88. package/dist/v1/libs/TinyElementObserver.cjs +6 -21
  89. package/dist/v1/libs/TinyElementObserver.d.mts +6 -15
  90. package/dist/v1/libs/TinyElementObserver.mjs +6 -20
  91. package/dist/v1/libs/TinyGamepad.cjs +4 -6
  92. package/dist/v1/libs/TinyGamepad.d.mts +1 -1
  93. package/dist/v1/libs/TinyHtml/TinyHtmlIcon.d.mts +1 -1
  94. package/dist/v1/libs/TinyHtml/TinyHtmlTemplate.d.mts +1 -1
  95. package/dist/v1/libs/TinyHtml/TinyHtmlTextarea.d.mts +1 -1
  96. package/dist/v1/libs/TinyHtml/index.d.mts +1 -1
  97. package/dist/v1/libs/TinyHtml.cjs +72 -98
  98. package/dist/v1/libs/TinyHtml.d.mts +15 -32
  99. package/dist/v1/libs/TinyHtml.mjs +53 -77
  100. package/dist/v1/libs/TinyInventory.d.mts +1 -1
  101. package/dist/v1/libs/TinyMediaPlayer.cjs +844 -0
  102. package/dist/v1/libs/TinyMediaPlayer.d.mts +306 -0
  103. package/dist/v1/libs/TinyMediaPlayer.mjs +755 -0
  104. package/dist/v1/libs/TinyRadioFm.cjs +1378 -0
  105. package/dist/v1/libs/TinyRadioFm.d.mts +554 -0
  106. package/dist/v1/libs/TinyRadioFm.mjs +1137 -0
  107. package/dist/v1/libs/TinySmartScroller.cjs +39 -26
  108. package/dist/v1/libs/TinySmartScroller.d.mts +16 -62
  109. package/dist/v1/libs/TinySmartScroller.mjs +35 -26
  110. package/dist/v1/libs/UltraRandomMsgGen.d.mts +7 -7
  111. package/docs/v1/README.md +6 -0
  112. package/docs/v1/basics/mediaContent.md +131 -0
  113. package/docs/v1/libs/TinyClassManager/TinyPluginInliner.md +107 -0
  114. package/docs/v1/libs/TinyDragDropDetector.md +5 -9
  115. package/docs/v1/libs/TinyElementObserver.md +3 -6
  116. package/docs/v1/libs/TinyHtml.md +0 -29
  117. package/docs/v1/libs/TinyMediaPlayer.md +100 -0
  118. package/docs/v1/libs/TinyRadioFm.md +141 -0
  119. package/docs/v1/libs/TinySmartScroller.md +3 -3
  120. package/package.json +40 -22
@@ -329,7 +329,7 @@ declare class TinyHtml<TinyHtmlT extends TinyHtmlConstructor> {
329
329
  };
330
330
  };
331
331
  /** @type {number} */
332
- static "__#private@#version": number;
332
+ static #version: number;
333
333
  /** @returns {number} */
334
334
  static get version(): number;
335
335
  /**
@@ -337,7 +337,7 @@ declare class TinyHtml<TinyHtmlT extends TinyHtmlConstructor> {
337
337
  * When enabled, helper methods print structured diagnostics for easier troubleshooting.
338
338
  * @type {boolean}
339
339
  */
340
- static "__#private@#elemDebug": boolean;
340
+ static #elemDebug: boolean;
341
341
  /**
342
342
  * Enables or disables debug output.
343
343
  * @param {boolean} value True to enable debug output; false to disable.
@@ -374,25 +374,8 @@ declare class TinyHtml<TinyHtmlT extends TinyHtmlConstructor> {
374
374
  * @returns {Record<string,string>}
375
375
  */
376
376
  static parseStyle(styleText: string): Record<string, string>;
377
- /**
378
- * Flag to determine if element observer should start automatically.
379
- * @type {boolean}
380
- */
381
- static "__#private@#autoStartElemObserver": boolean;
382
- /**
383
- * Set the auto-start flag for the observer.
384
- * @param {boolean} value
385
- */
386
- static set autoStartElemObserver(value: boolean);
387
- /**
388
- * Get the auto-start flag for the observer.
389
- * @returns {boolean}
390
- */
391
- static get autoStartElemObserver(): boolean;
392
- /** @type {TinyElementObserver} */
393
- static "__#private@#tinyObserver": TinyElementObserver;
394
- /** @returns {TinyElementObserver} */
395
- static get tinyObserver(): TinyElementObserver;
377
+ static #tinyObserver: TinyElementObserver<HTMLElement> | undefined;
378
+ static get tinyObserver(): TinyElementObserver<HTMLElement> | undefined;
396
379
  /**
397
380
  * Fetches an HTML file from the given URL, parses it to JSON.
398
381
  *
@@ -1186,7 +1169,7 @@ declare class TinyHtml<TinyHtmlT extends TinyHtmlConstructor> {
1186
1169
  *
1187
1170
  * @type {Record<string | symbol, string>}
1188
1171
  */
1189
- static "__#private@#cssPropAliases": Record<string | symbol, string>;
1172
+ static #cssPropAliases: Record<string | symbol, string>;
1190
1173
  /**
1191
1174
  * Public proxy to manage camelCase ➝ kebab-case CSS property aliasing.
1192
1175
  *
@@ -1433,7 +1416,7 @@ declare class TinyHtml<TinyHtmlT extends TinyHtmlConstructor> {
1433
1416
  */
1434
1417
  static outerWidth(el: TinyElementAndWinAndDoc, includeMargin?: boolean): number;
1435
1418
  /** @type {string} */
1436
- static "__#private@#defaultDisplay": string;
1419
+ static #defaultDisplay: string;
1437
1420
  /**
1438
1421
  * Sets the default display value.
1439
1422
  * @param {string} value
@@ -1469,7 +1452,7 @@ declare class TinyHtml<TinyHtmlT extends TinyHtmlConstructor> {
1469
1452
  *
1470
1453
  * @type {boolean}
1471
1454
  */
1472
- static "__#private@#cancelOldStyleFx": boolean;
1455
+ static #cancelOldStyleFx: boolean;
1473
1456
  /**
1474
1457
  * Updates the global setting that determines whether old style-based animations
1475
1458
  * are cancelled before new ones start.
@@ -1494,7 +1477,7 @@ declare class TinyHtml<TinyHtmlT extends TinyHtmlConstructor> {
1494
1477
  *
1495
1478
  * @type {Record<string, number | KeyframeAnimationOptions>}
1496
1479
  */
1497
- static "__#private@#styleFxSpeeds": Record<string, number | KeyframeAnimationOptions>;
1480
+ static #styleFxSpeeds: Record<string, number | KeyframeAnimationOptions>;
1498
1481
  /**
1499
1482
  * Replace the predefined animation speeds.
1500
1483
  * @param {Record<string, number | KeyframeAnimationOptions>} speeds
@@ -1539,12 +1522,12 @@ declare class TinyHtml<TinyHtmlT extends TinyHtmlConstructor> {
1539
1522
  * CSS expansion shorthand used by genStyleFx to include margin/padding values.
1540
1523
  * @typedef {['Top', 'Right', 'Bottom', 'Left']}
1541
1524
  */
1542
- static "__#private@#cssExpand": string[];
1525
+ static #cssExpand: string[];
1543
1526
  /**
1544
1527
  * Generate shortcuts
1545
1528
  * @type {Record<string, StyleEffects>}
1546
1529
  */
1547
- static "__#private@#styleEffects": Record<string, StyleEffects>;
1530
+ static #styleEffects: Record<string, StyleEffects>;
1548
1531
  /**
1549
1532
  * Replace the entire styleEffects map with a new one.
1550
1533
  *
@@ -1585,7 +1568,7 @@ declare class TinyHtml<TinyHtmlT extends TinyHtmlConstructor> {
1585
1568
  * Style Effect Inverse Values
1586
1569
  * @type {Record<string, string>}
1587
1570
  */
1588
- static "__#private@#styleEffectInverse": Record<string, string>;
1571
+ static #styleEffectInverse: Record<string, string>;
1589
1572
  /**
1590
1573
  * Replace the style inverse values.
1591
1574
  * @param {Record<string, string>} values
@@ -1630,7 +1613,7 @@ declare class TinyHtml<TinyHtmlT extends TinyHtmlConstructor> {
1630
1613
  * Style Effect Repeat Detector
1631
1614
  * @type {Record<string, StyleEffectsRdFn>}
1632
1615
  */
1633
- static "__#private@#styleEffectsRd": Record<string, StyleEffectsRdFn>;
1616
+ static #styleEffectsRd: Record<string, StyleEffectsRdFn>;
1634
1617
  /**
1635
1618
  * Replace the style effects repeat detectors.
1636
1619
  * @param {Record<string, StyleEffectsRdFn>} detectors
@@ -1677,7 +1660,7 @@ declare class TinyHtml<TinyHtmlT extends TinyHtmlConstructor> {
1677
1660
  *
1678
1661
  * @type {StyleEffectsProps}
1679
1662
  */
1680
- static "__#private@#styleEffectsProps": StyleEffectsProps;
1663
+ static #styleEffectsProps: StyleEffectsProps;
1681
1664
  /**
1682
1665
  * Replace the entire styleEffectsProps map with a new one.
1683
1666
  *
@@ -1941,7 +1924,7 @@ declare class TinyHtml<TinyHtmlT extends TinyHtmlConstructor> {
1941
1924
  */
1942
1925
  static padding(el: TinyElement): HtmlElBoxSides;
1943
1926
  /** @type {boolean} */
1944
- static "__#private@#classCanWhitespace": boolean;
1927
+ static #classCanWhitespace: boolean;
1945
1928
  /**
1946
1929
  * Sets the value of classCanWhitespace.
1947
1930
  * @param {boolean} value
@@ -2429,7 +2412,7 @@ declare class TinyHtml<TinyHtmlT extends TinyHtmlConstructor> {
2429
2412
  *
2430
2413
  * @type {Record<string | symbol, string>}
2431
2414
  */
2432
- static "__#private@#propFix": Record<string | symbol, string>;
2415
+ static #propFix: Record<string | symbol, string>;
2433
2416
  /**
2434
2417
  * Public proxy for normalized DOM property names.
2435
2418
  *
@@ -417,84 +417,60 @@ class TinyHtml {
417
417
  return styles;
418
418
  }
419
419
  /////////////////////////////////////////////////////////////////////
420
- /**
421
- * Flag to determine if element observer should start automatically.
422
- * @type {boolean}
423
- */
424
- static #autoStartElemObserver = true;
425
- /**
426
- * Get the auto-start flag for the observer.
427
- * @returns {boolean}
428
- */
429
- static get autoStartElemObserver() {
430
- return TinyHtml.#autoStartElemObserver;
431
- }
432
- /**
433
- * Set the auto-start flag for the observer.
434
- * @param {boolean} value
435
- */
436
- static set autoStartElemObserver(value) {
437
- if (typeof value !== 'boolean')
438
- throw new TypeError('autoStartElemObserver must be a boolean.');
439
- TinyHtml.#autoStartElemObserver = value;
440
- }
441
- /** @type {TinyElementObserver} */
442
- static #tinyObserver = new TinyElementObserver({
443
- el: typeof window !== 'undefined' && typeof window.document !== 'undefined'
444
- ? window.document.documentElement
445
- : undefined,
446
- initDetectors: [
447
- // Style Detector
448
- [
449
- 'tinyStyleEvent',
450
- (mutation) => {
451
- if (mutation.type !== 'attributes' ||
452
- mutation.attributeName !== 'style' ||
453
- !(mutation.target instanceof HTMLElement))
454
- return;
455
- const oldVal = mutation.oldValue || '';
456
- const newVal = mutation.target.getAttribute('style') || '';
457
- const oldStyles = TinyHtml.parseStyle(oldVal);
458
- const newStyles = TinyHtml.parseStyle(newVal);
459
- const changes = diffStrings(oldStyles, newStyles);
460
- if (Object.keys(changes.added).length ||
461
- Object.keys(changes.removed).length ||
462
- Object.keys(changes.modified).length) {
463
- mutation.target.dispatchEvent(new CustomEvent('tinyhtml.stylechanged', {
464
- detail: changes,
465
- }));
466
- }
467
- },
468
- ],
469
- // Class Detector
470
- [
471
- 'tinyClassEvent',
472
- (mutation) => {
473
- if (mutation.type !== 'attributes' ||
474
- mutation.attributeName !== 'class' ||
475
- !(mutation.target instanceof HTMLElement))
476
- return;
477
- const oldVal = mutation.oldValue || '';
478
- const newVal = mutation.target.className || '';
479
- const oldClasses = oldVal.split(/\s+/).filter(Boolean);
480
- const newClasses = newVal.split(/\s+/).filter(Boolean);
481
- const changes = diffArrayList(oldClasses, newClasses);
482
- if (changes.added.length || changes.removed.length) {
483
- mutation.target.dispatchEvent(new CustomEvent('tinyhtml.classchanged', {
484
- detail: changes,
485
- }));
486
- }
487
- },
420
+ static #tinyObserver = typeof window !== 'undefined' && typeof window.document !== 'undefined'
421
+ ? new TinyElementObserver(window.document.documentElement, {
422
+ initDetectors: [
423
+ // Style Detector
424
+ [
425
+ 'tinyStyleEvent',
426
+ (mutation) => {
427
+ if (mutation.type !== 'attributes' ||
428
+ mutation.attributeName !== 'style' ||
429
+ !(mutation.target instanceof HTMLElement))
430
+ return;
431
+ const oldVal = mutation.oldValue || '';
432
+ const newVal = mutation.target.getAttribute('style') || '';
433
+ const oldStyles = TinyHtml.parseStyle(oldVal);
434
+ const newStyles = TinyHtml.parseStyle(newVal);
435
+ const changes = diffStrings(oldStyles, newStyles);
436
+ if (Object.keys(changes.added).length ||
437
+ Object.keys(changes.removed).length ||
438
+ Object.keys(changes.modified).length) {
439
+ mutation.target.dispatchEvent(new CustomEvent('tinyhtml.stylechanged', {
440
+ detail: changes,
441
+ }));
442
+ }
443
+ },
444
+ ],
445
+ // Class Detector
446
+ [
447
+ 'tinyClassEvent',
448
+ (mutation) => {
449
+ if (mutation.type !== 'attributes' ||
450
+ mutation.attributeName !== 'class' ||
451
+ !(mutation.target instanceof HTMLElement))
452
+ return;
453
+ const oldVal = mutation.oldValue || '';
454
+ const newVal = mutation.target.className || '';
455
+ const oldClasses = oldVal.split(/\s+/).filter(Boolean);
456
+ const newClasses = newVal.split(/\s+/).filter(Boolean);
457
+ const changes = diffArrayList(oldClasses, newClasses);
458
+ if (changes.added.length || changes.removed.length) {
459
+ mutation.target.dispatchEvent(new CustomEvent('tinyhtml.classchanged', {
460
+ detail: changes,
461
+ }));
462
+ }
463
+ },
464
+ ],
488
465
  ],
489
- ],
490
- initCfg: {
491
- attributeOldValue: true,
492
- attributes: true,
493
- subtree: true,
494
- attributeFilter: ['style', 'class'],
495
- },
496
- });
497
- /** @returns {TinyElementObserver} */
466
+ initCfg: {
467
+ attributeOldValue: true,
468
+ attributes: true,
469
+ subtree: true,
470
+ attributeFilter: ['style', 'class'],
471
+ },
472
+ })
473
+ : undefined;
498
474
  static get tinyObserver() {
499
475
  return TinyHtml.#tinyObserver;
500
476
  }
@@ -328,7 +328,7 @@ declare class TinyInventory {
328
328
  * Keys are item IDs, values are configuration objects created with {@link TinyInventory.defineItem}.
329
329
  * @type {Map<string, ItemDef>}
330
330
  */
331
- static "__#private@#ItemRegistry": Map<string, ItemDef>;
331
+ static #ItemRegistry: Map<string, ItemDef>;
332
332
  /**
333
333
  * Returns a deep-cloned snapshot of all registered items.
334
334
  * Ensures the caller cannot mutate the internal registry.