Skip to content

Releases: Sv443-Network/UserUtils

v9.0.4

23 Jan 11:29
Compare
Choose a tag to compare

Patch Changes

  • 858c948: Fixed broken percent transform (tr.transforms.percent)

v9.0.3

22 Jan 21:38
Compare
Choose a tag to compare

Patch Changes

  • e3f1e6a: Fixed Debouncer TS types as to not break backwards compat
  • 5861bb4: Fixed broken ambiguity of DataStore's migration function type

v9.0.2

22 Jan 21:00
Compare
Choose a tag to compare

Patch Changes

  • 69c4dd1: Fixed wrong readme being included in JSR package and added @module comments

v9.0.1

22 Jan 20:45
Compare
Choose a tag to compare

Patch Changes

  • f24f355: Fixed missing return type signatures for JSR

v9.0.0

22 Jan 20:34
Compare
Choose a tag to compare

Major Changes

  • 9abfc6b: BREAKING - Reworked translation system:
    • Removed tr(), tr.setLanguage() and tr.getLanguage()
    • Renamed function tr.addLanguage() to tr.addTranslations()
    • Removed %n-based argument insertion by default (re-enable explicitly with tr.addTransform(tr.transforms.percent)).
    • Added ability for nested translation objects and object traversal via dot notation.
    • Added functions:
      • tr.for() - translates a key for the specified language.
      • tr.use() - creates a translation function for the specified language for much easier usage.
      • tr.hasKey() - checks if a key exists in the given language.
      • tr.setFallbackLanguage() - sets the fallback language used when a key is not found in the given language.
      • tr.getFallbackLanguage() - returns the fallback language.
      • tr.addTransform() - adds a transform function to the translation system, allowing for custom argument insertion and much more.
      • tr.deleteTransform() - removes a transform function.
    • Added ability to specify transform patterns and functions for arbitrary modification of the translation string.
      • Added transform for template literal syntax (e.g. ${keyName}) with tr.addTransform(tr.transforms.templateLiteral). This transform supports positional argument injection, as well as named arguments via an object with the same keys as in the template literal pattern. See the documentation for more information and a code example.
      • Added transform for the old %n syntax with tr.addTransform(tr.transforms.percent). This transform behaves the exact same as the translation sytem before 9.0.0 (only supporting positional arguments).
    • Added TS type TrKeys<T> for extracting the keys of a translation object (both flat and nested).
    • Fixed bug with resolving translations for flat objects.
  • d0737dc: BREAKING - Reworked debounce system:
    • Renamed SelectorObserverOptions's defaultDebounceEdge to defaultDebounceType
    • Renamed SelectorListenerOptions's debounceEdge to debounceType
    • Edge types rising and falling have been replaced with new edge types immediate and idle, overhauling their behavior:
      • immediate (default & recommended) will trigger immediately, then queue all subsequent calls until the timeout has passed.
      • idle will trigger the last queued call only after there haven't been any subsequent calls for the specified timeout.
    • Added Debouncer class for more advanced control over debouncing, and with that the following changes:
      • Ability to attach and manage multiple listeners.
      • Inherits from NanoEmitter, allowing event-based debouncing.
      • Can be inherited by your own classes for built-in debouncing.
    • debounce() function can still be called as usual (after replacing the edge type names with the new ones). Internally, it will instantiate a Debouncer instance, which is available via the debouncer property on the returned function.
    • Reduced default timeout from 300ms to 200ms.

Minor Changes

  • cd241b0: Added additionalProps parameter to openInNewTab() to add or overwrite anchor element props (only if GM.openInTab() is unavailable)
  • d0737dc: Moved documentation to separate file docs.md to speed up README.md load time.

Patch Changes

  • 1a754db: Fixed newlines being collapsed in TSDoc comments.
  • d0737dc: Fixed randRange() with enhancedEntropy = true only returning the first digit.

v8.4.0

22 Dec 22:03
Compare
Choose a tag to compare

Minor Changes

  • e10d629: Added function digitCount() to calculate the amount of digits in the passed number
  • 949877a: Added support for nested objects in translations (e.g. tr("foo.bar.baz"))
  • 52d392a: Added ValueGen and StringGen types with accompanying consumeGen() and consumeStringGen() functions to allow for super flexible typing and declaration of values
  • bbce0e1: Added overload to clamp() without min parameter

v8.3.3

16 Nov 22:12
420a500
Compare
Choose a tag to compare

Patch Changes

  • ca8b62e: Made CJS bundle available on NPM too

v8.3.2

11 Nov 15:09
10d4364
Compare
Choose a tag to compare

Patch Changes

  • 99abaab: Made CJS bundle available on JSR

v8.3.1

11 Nov 14:41
4e8d58e
Compare
Choose a tag to compare

Patch Changes

  • 390110e: Throw an error when calling interceptEvent() on window or unsafeWindow on FireMonkey instead of crashing the entire page

v8.3.0

08 Nov 19:39
bc513c1
Compare
Choose a tag to compare

Minor Changes

  • 1ecd63c: Added support for the signal property in fetchAdvanced()