@studiometa/js-toolkit 4.0.0-alpha.2 → 4.0.0-alpha.3

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 (331) hide show
  1. package/dist/Base.d.ts +0 -2
  2. package/dist/Base.js +1 -2
  3. package/dist/Base.js.map +1 -1
  4. package/dist/attribute-namespaces.d.ts +0 -2
  5. package/dist/attribute-namespaces.js +1 -2
  6. package/dist/attributes.d.ts +0 -2
  7. package/dist/attributes.js +1 -2
  8. package/dist/children-watchers.d.ts +0 -2
  9. package/dist/children-watchers.js +1 -2
  10. package/dist/component-brand.d.ts +0 -2
  11. package/dist/component-brand.js +1 -2
  12. package/dist/component-declarations.d.ts +0 -2
  13. package/dist/component-declarations.js +1 -2
  14. package/dist/context-subscription.d.ts +0 -2
  15. package/dist/context-subscription.js +1 -2
  16. package/dist/context.d.ts +0 -2
  17. package/dist/context.js +1 -2
  18. package/dist/decorators.d.ts +0 -2
  19. package/dist/decorators.js +1 -2
  20. package/dist/diagnostic-contract.d.ts +0 -2
  21. package/dist/diagnostic-contract.js +1 -2
  22. package/dist/diagnostics.d.ts +0 -2
  23. package/dist/diagnostics.js +1 -2
  24. package/dist/document-order.d.ts +0 -2
  25. package/dist/document-order.js +1 -2
  26. package/dist/dom-mutations.d.ts +0 -2
  27. package/dist/dom-mutations.js +1 -2
  28. package/dist/events.d.ts +0 -2
  29. package/dist/events.js +1 -2
  30. package/dist/group.d.ts +0 -2
  31. package/dist/group.js +1 -2
  32. package/dist/instances.d.ts +0 -2
  33. package/dist/instances.js +1 -2
  34. package/dist/manifest.d.ts +0 -2
  35. package/dist/manifest.js +1 -2
  36. package/dist/mount-strategies.d.ts +0 -2
  37. package/dist/mount-strategies.js +1 -2
  38. package/dist/negotiated-events.d.ts +0 -2
  39. package/dist/negotiated-events.js +1 -2
  40. package/dist/protocol-symbols.d.ts +0 -2
  41. package/dist/protocol-symbols.js +1 -2
  42. package/dist/registry.d.ts +0 -2
  43. package/dist/registry.js +1 -2
  44. package/dist/responsive-options.d.ts +0 -2
  45. package/dist/responsive-options.js +1 -2
  46. package/dist/scheduler.d.ts +0 -2
  47. package/dist/scheduler.js +1 -2
  48. package/dist/scheduler.js.map +1 -1
  49. package/dist/services/breakpoint.d.ts +0 -2
  50. package/dist/services/breakpoint.js +1 -2
  51. package/dist/services/drag.d.ts +0 -2
  52. package/dist/services/drag.js +1 -2
  53. package/dist/services/in-view.d.ts +0 -2
  54. package/dist/services/in-view.js +1 -2
  55. package/dist/services/key.d.ts +0 -2
  56. package/dist/services/key.js +1 -2
  57. package/dist/services/media.d.ts +0 -2
  58. package/dist/services/media.js +1 -2
  59. package/dist/services/mixin.d.ts +0 -2
  60. package/dist/services/mixin.js +1 -2
  61. package/dist/services/mutation.d.ts +0 -2
  62. package/dist/services/mutation.js +1 -2
  63. package/dist/services/pointer.d.ts +0 -2
  64. package/dist/services/pointer.js +1 -2
  65. package/dist/services/raf.d.ts +0 -2
  66. package/dist/services/raf.js +1 -2
  67. package/dist/services/resize.d.ts +0 -2
  68. package/dist/services/resize.js +1 -2
  69. package/dist/services/scroll-progress-offset.d.ts +0 -2
  70. package/dist/services/scroll-progress-offset.js +1 -2
  71. package/dist/services/scroll-progress.d.ts +0 -2
  72. package/dist/services/scroll-progress.js +1 -2
  73. package/dist/services/scroll.d.ts +0 -2
  74. package/dist/services/scroll.js +1 -2
  75. package/dist/services/service.d.ts +0 -2
  76. package/dist/services/service.js +1 -2
  77. package/dist/services/toggle.d.ts +0 -2
  78. package/dist/services/toggle.js +1 -2
  79. package/dist/services/until.d.ts +0 -2
  80. package/dist/services/until.js +1 -2
  81. package/dist/shared-runtime.d.ts +0 -2
  82. package/dist/shared-runtime.js +1 -2
  83. package/dist/storage/createStorage.d.ts +0 -2
  84. package/dist/storage/createStorage.js +1 -2
  85. package/dist/storage/index.d.ts +0 -2
  86. package/dist/storage/index.js +1 -2
  87. package/dist/storage/providers.d.ts +0 -2
  88. package/dist/storage/providers.js +1 -2
  89. package/dist/storage/serializers.d.ts +0 -2
  90. package/dist/storage/serializers.js +1 -2
  91. package/dist/storage/sync.d.ts +0 -2
  92. package/dist/storage/sync.js +1 -2
  93. package/dist/storage/types.d.ts +0 -2
  94. package/dist/subpaths/BREAKPOINTS.js +1 -2
  95. package/dist/subpaths/Base.js +1 -2
  96. package/dist/subpaths/DIAGNOSTICS.js +1 -2
  97. package/dist/subpaths/DRAG_MODES.js +1 -2
  98. package/dist/subpaths/EVENTS.js +1 -2
  99. package/dist/subpaths/MOUNT_ATTRIBUTE.js +1 -2
  100. package/dist/subpaths/SWAP_MODES.js +1 -2
  101. package/dist/subpaths/children.js +1 -2
  102. package/dist/subpaths/component.js +1 -2
  103. package/dist/subpaths/createContext.js +1 -2
  104. package/dist/subpaths/createFallbackProvider.js +1 -2
  105. package/dist/subpaths/createGroup.js +1 -2
  106. package/dist/subpaths/createLocalStorage.js +1 -2
  107. package/dist/subpaths/createMemoryStorageProvider.js +1 -2
  108. package/dist/subpaths/createService.js +1 -2
  109. package/dist/subpaths/createServiceMixin.js +1 -2
  110. package/dist/subpaths/createSessionStorage.js +1 -2
  111. package/dist/subpaths/createStorage.js +1 -2
  112. package/dist/subpaths/createUrlSearchParamsInHashProvider.js +1 -2
  113. package/dist/subpaths/createUrlSearchParamsInHashStorage.js +1 -2
  114. package/dist/subpaths/createUrlSearchParamsProvider.js +1 -2
  115. package/dist/subpaths/createUrlSearchParamsStorage.js +1 -2
  116. package/dist/subpaths/defaultScheduler.js +1 -2
  117. package/dist/subpaths/defineManifest.js +1 -2
  118. package/dist/subpaths/domUpdate.js +1 -2
  119. package/dist/subpaths/emitExtendable.js +1 -2
  120. package/dist/subpaths/fromMetaGlob.js +1 -2
  121. package/dist/subpaths/fromWebpackContext.js +1 -2
  122. package/dist/subpaths/getBreakpoints.js +1 -2
  123. package/dist/subpaths/getInstance.js +1 -2
  124. package/dist/subpaths/getInstances.js +1 -2
  125. package/dist/subpaths/getMountedInstances.js +1 -2
  126. package/dist/subpaths/getUnmountedInstances.js +1 -2
  127. package/dist/subpaths/inject.js +1 -2
  128. package/dist/subpaths/injectContext.js +1 -2
  129. package/dist/subpaths/injectContextSync.js +1 -2
  130. package/dist/subpaths/jsonSerializer.js +1 -2
  131. package/dist/subpaths/localStorageProvider.js +1 -2
  132. package/dist/subpaths/memoryStorageProvider.js +1 -2
  133. package/dist/subpaths/namespaceQualifier.js +1 -2
  134. package/dist/subpaths/nextFrame.js +1 -2
  135. package/dist/subpaths/on.js +1 -2
  136. package/dist/subpaths/perTarget.js +1 -2
  137. package/dist/subpaths/provide.js +1 -2
  138. package/dist/subpaths/provideContext.js +1 -2
  139. package/dist/subpaths/provideRootContext.js +1 -2
  140. package/dist/subpaths/read.js +1 -2
  141. package/dist/subpaths/registerComponent.js +1 -2
  142. package/dist/subpaths/registerComponents.js +1 -2
  143. package/dist/subpaths/registerManifest.js +1 -2
  144. package/dist/subpaths/reportDiagnostic.js +1 -2
  145. package/dist/subpaths/sessionStorageProvider.js +1 -2
  146. package/dist/subpaths/setBreakpoints.js +1 -2
  147. package/dist/subpaths/signal.js +1 -2
  148. package/dist/subpaths/subscribeContext.js +1 -2
  149. package/dist/subpaths/swap.js +1 -2
  150. package/dist/subpaths/toggle.js +1 -2
  151. package/dist/subpaths/until.js +1 -2
  152. package/dist/subpaths/urlSearchParamsInHashProvider.js +1 -2
  153. package/dist/subpaths/urlSearchParamsProvider.js +1 -2
  154. package/dist/subpaths/useBreakpoint.js +1 -2
  155. package/dist/subpaths/useDrag.js +1 -2
  156. package/dist/subpaths/useInView.js +1 -2
  157. package/dist/subpaths/useKey.js +1 -2
  158. package/dist/subpaths/useMediaQuery.js +1 -2
  159. package/dist/subpaths/useMutation.js +1 -2
  160. package/dist/subpaths/usePointer.js +1 -2
  161. package/dist/subpaths/usePrefersReducedMotion.js +1 -2
  162. package/dist/subpaths/useRaf.js +1 -2
  163. package/dist/subpaths/useResize.js +1 -2
  164. package/dist/subpaths/useScroll.js +1 -2
  165. package/dist/subpaths/useScrollProgress.js +1 -2
  166. package/dist/subpaths/useWindowScroll.js +1 -2
  167. package/dist/subpaths/useWindowSize.js +1 -2
  168. package/dist/subpaths/utils/DEFAULT_DAMP_FACTOR.js +1 -2
  169. package/dist/subpaths/utils/INERTIA_FRAME.js +1 -2
  170. package/dist/subpaths/utils/MAX_SPRING_RATIO.js +1 -2
  171. package/dist/subpaths/utils/SCROLL_ALIGNMENTS.js +1 -2
  172. package/dist/subpaths/utils/SCROLL_AXES.js +1 -2
  173. package/dist/subpaths/utils/TRANSFORM_PROPS.js +1 -2
  174. package/dist/subpaths/utils/TRANSITION_OPTIONS.js +1 -2
  175. package/dist/subpaths/utils/camelCase.js +1 -2
  176. package/dist/subpaths/utils/capitalize.js +1 -2
  177. package/dist/subpaths/utils/clamp.js +1 -2
  178. package/dist/subpaths/utils/clamp01.js +1 -2
  179. package/dist/subpaths/utils/clampDampFactor.js +1 -2
  180. package/dist/subpaths/utils/createEaseInOut.js +1 -2
  181. package/dist/subpaths/utils/createEaseOut.js +1 -2
  182. package/dist/subpaths/utils/createElement.js +1 -2
  183. package/dist/subpaths/utils/createRange.js +1 -2
  184. package/dist/subpaths/utils/damp.js +1 -2
  185. package/dist/subpaths/utils/debounce.js +1 -2
  186. package/dist/subpaths/utils/decayOver.js +1 -2
  187. package/dist/subpaths/utils/deepmerge.js +1 -2
  188. package/dist/subpaths/utils/easeInCirc.js +1 -2
  189. package/dist/subpaths/utils/easeInCubic.js +1 -2
  190. package/dist/subpaths/utils/easeInExpo.js +1 -2
  191. package/dist/subpaths/utils/easeInOutCirc.js +1 -2
  192. package/dist/subpaths/utils/easeInOutCubic.js +1 -2
  193. package/dist/subpaths/utils/easeInOutExpo.js +1 -2
  194. package/dist/subpaths/utils/easeInOutQuad.js +1 -2
  195. package/dist/subpaths/utils/easeInOutQuart.js +1 -2
  196. package/dist/subpaths/utils/easeInOutQuint.js +1 -2
  197. package/dist/subpaths/utils/easeInOutSine.js +1 -2
  198. package/dist/subpaths/utils/easeInQuad.js +1 -2
  199. package/dist/subpaths/utils/easeInQuart.js +1 -2
  200. package/dist/subpaths/utils/easeInQuint.js +1 -2
  201. package/dist/subpaths/utils/easeInSine.js +1 -2
  202. package/dist/subpaths/utils/easeLinear.js +1 -2
  203. package/dist/subpaths/utils/easeOutCirc.js +1 -2
  204. package/dist/subpaths/utils/easeOutCubic.js +1 -2
  205. package/dist/subpaths/utils/easeOutExpo.js +1 -2
  206. package/dist/subpaths/utils/easeOutQuad.js +1 -2
  207. package/dist/subpaths/utils/easeOutQuart.js +1 -2
  208. package/dist/subpaths/utils/easeOutQuint.js +1 -2
  209. package/dist/subpaths/utils/easeOutSine.js +1 -2
  210. package/dist/subpaths/utils/enterTransition.js +1 -2
  211. package/dist/subpaths/utils/fold.js +1 -2
  212. package/dist/subpaths/utils/getOffsetSizes.js +1 -2
  213. package/dist/subpaths/utils/historyPush.js +1 -2
  214. package/dist/subpaths/utils/historyReplace.js +1 -2
  215. package/dist/subpaths/utils/inertiaDecay.js +1 -2
  216. package/dist/subpaths/utils/inertiaFinalValue.js +1 -2
  217. package/dist/subpaths/utils/inertiaStep.js +1 -2
  218. package/dist/subpaths/utils/inertiaTimeConstant.js +1 -2
  219. package/dist/subpaths/utils/isBoolean.js +1 -2
  220. package/dist/subpaths/utils/isDefined.js +1 -2
  221. package/dist/subpaths/utils/isFunction.js +1 -2
  222. package/dist/subpaths/utils/isNull.js +1 -2
  223. package/dist/subpaths/utils/isNumber.js +1 -2
  224. package/dist/subpaths/utils/isObject.js +1 -2
  225. package/dist/subpaths/utils/isString.js +1 -2
  226. package/dist/subpaths/utils/kebabCase.js +1 -2
  227. package/dist/subpaths/utils/leaveTransition.js +1 -2
  228. package/dist/subpaths/utils/lerp.js +1 -2
  229. package/dist/subpaths/utils/loadImage.js +1 -2
  230. package/dist/subpaths/utils/loadLink.js +1 -2
  231. package/dist/subpaths/utils/loadScript.js +1 -2
  232. package/dist/subpaths/utils/lockScroll.js +1 -2
  233. package/dist/subpaths/utils/lowerCase.js +1 -2
  234. package/dist/subpaths/utils/map.js +1 -2
  235. package/dist/subpaths/utils/matrix.js +1 -2
  236. package/dist/subpaths/utils/mean.js +1 -2
  237. package/dist/subpaths/utils/memo.js +1 -2
  238. package/dist/subpaths/utils/noop.js +1 -2
  239. package/dist/subpaths/utils/noopValue.js +1 -2
  240. package/dist/subpaths/utils/objectToURLSearchParams.js +1 -2
  241. package/dist/subpaths/utils/pascalCase.js +1 -2
  242. package/dist/subpaths/utils/random.js +1 -2
  243. package/dist/subpaths/utils/randomInt.js +1 -2
  244. package/dist/subpaths/utils/randomItem.js +1 -2
  245. package/dist/subpaths/utils/round.js +1 -2
  246. package/dist/subpaths/utils/saveActiveElement.js +1 -2
  247. package/dist/subpaths/utils/scrollPosition.js +1 -2
  248. package/dist/subpaths/utils/scrollTo.js +1 -2
  249. package/dist/subpaths/utils/selectorFor.js +1 -2
  250. package/dist/subpaths/utils/setClassesOrStyles.js +1 -2
  251. package/dist/subpaths/utils/smoothTo.js +1 -2
  252. package/dist/subpaths/utils/snakeCase.js +1 -2
  253. package/dist/subpaths/utils/spring.js +1 -2
  254. package/dist/subpaths/utils/throttle.js +1 -2
  255. package/dist/subpaths/utils/transform.js +1 -2
  256. package/dist/subpaths/utils/transition.js +1 -2
  257. package/dist/subpaths/utils/trapFocus.js +1 -2
  258. package/dist/subpaths/utils/untrapFocus.js +1 -2
  259. package/dist/subpaths/utils/upperCase.js +1 -2
  260. package/dist/subpaths/utils/wait.js +1 -2
  261. package/dist/subpaths/utils/withLeadingCharacters.js +1 -2
  262. package/dist/subpaths/utils/withLeadingSlash.js +1 -2
  263. package/dist/subpaths/utils/withTrailingCharacters.js +1 -2
  264. package/dist/subpaths/utils/withTrailingSlash.js +1 -2
  265. package/dist/subpaths/utils/withoutLeadingCharacters.js +1 -2
  266. package/dist/subpaths/utils/withoutLeadingCharactersRecursive.js +1 -2
  267. package/dist/subpaths/utils/withoutLeadingSlash.js +1 -2
  268. package/dist/subpaths/utils/withoutTrailingCharacters.js +1 -2
  269. package/dist/subpaths/utils/withoutTrailingCharactersRecursive.js +1 -2
  270. package/dist/subpaths/utils/withoutTrailingSlash.js +1 -2
  271. package/dist/subpaths/utils/wrap.js +1 -2
  272. package/dist/subpaths/viewTransition.js +1 -2
  273. package/dist/subpaths/warn.js +1 -2
  274. package/dist/subpaths/watchAttributeNamespace.js +1 -2
  275. package/dist/subpaths/watchAttributes.js +1 -2
  276. package/dist/subpaths/whenDOMSettled.js +1 -2
  277. package/dist/subpaths/withDrag.js +1 -2
  278. package/dist/subpaths/withInView.js +1 -2
  279. package/dist/subpaths/withKey.js +1 -2
  280. package/dist/subpaths/withMutation.js +1 -2
  281. package/dist/subpaths/withPointer.js +1 -2
  282. package/dist/subpaths/withRaf.js +1 -2
  283. package/dist/subpaths/withResize.js +1 -2
  284. package/dist/subpaths/withScroll.js +1 -2
  285. package/dist/subpaths/withScrollProgress.js +1 -2
  286. package/dist/subpaths/write.js +1 -2
  287. package/dist/swap.d.ts +0 -2
  288. package/dist/swap.js +1 -2
  289. package/dist/test/index.d.ts +0 -2
  290. package/dist/test/index.js +1 -2
  291. package/dist/utils/deepmerge.d.ts +0 -2
  292. package/dist/utils/deepmerge.js +1 -2
  293. package/dist/utils/dom.d.ts +0 -2
  294. package/dist/utils/dom.js +1 -2
  295. package/dist/utils/easings.d.ts +0 -2
  296. package/dist/utils/easings.js +1 -2
  297. package/dist/utils/focus.d.ts +0 -2
  298. package/dist/utils/focus.js +1 -2
  299. package/dist/utils/history.d.ts +0 -2
  300. package/dist/utils/history.js +1 -2
  301. package/dist/utils/is.d.ts +0 -2
  302. package/dist/utils/is.js +1 -2
  303. package/dist/utils/load.d.ts +0 -2
  304. package/dist/utils/load.js +1 -2
  305. package/dist/utils/maths.d.ts +0 -2
  306. package/dist/utils/maths.js +1 -2
  307. package/dist/utils/memo.d.ts +0 -2
  308. package/dist/utils/memo.js +1 -2
  309. package/dist/utils/noop.d.ts +0 -2
  310. package/dist/utils/noop.js +1 -2
  311. package/dist/utils/random.d.ts +0 -2
  312. package/dist/utils/random.js +1 -2
  313. package/dist/utils/scroll-lock.d.ts +0 -2
  314. package/dist/utils/scroll-lock.js +1 -2
  315. package/dist/utils/scrollTo.d.ts +0 -2
  316. package/dist/utils/scrollTo.js +1 -2
  317. package/dist/utils/selectors.d.ts +0 -2
  318. package/dist/utils/selectors.js +1 -2
  319. package/dist/utils/smoothTo.d.ts +0 -2
  320. package/dist/utils/smoothTo.js +1 -2
  321. package/dist/utils/strings.d.ts +0 -2
  322. package/dist/utils/strings.js +1 -2
  323. package/dist/utils/timing.d.ts +0 -2
  324. package/dist/utils/timing.js +1 -2
  325. package/dist/utils/transform.d.ts +0 -2
  326. package/dist/utils/transform.js +1 -2
  327. package/dist/utils/transition.d.ts +0 -2
  328. package/dist/utils/transition.js +1 -2
  329. package/dist/viewTransition.d.ts +0 -2
  330. package/dist/viewTransition.js +1 -2
  331. package/package.json +2 -2
@@ -1,4 +1,3 @@
1
- //#region src/utils/is.d.ts
2
1
  /** Type guards for the values a component reads from the DOM or its options. */
3
2
  /**
4
3
  * Whether a value is `null`.
@@ -39,5 +38,4 @@ declare function isFunction(value: unknown): value is (...args: unknown[]) => un
39
38
  * @link https://js-toolkit-v4.studiometa.dev/utils/is.html#isobject
40
39
  */
41
40
  declare function isObject(value: unknown): value is Record<string, unknown>;
42
- //#endregion
43
41
  export { isBoolean, isDefined, isFunction, isNull, isNumber, isObject, isString };
package/dist/utils/is.js CHANGED
@@ -1,4 +1,4 @@
1
- //#region src/utils/is.ts
1
+ // src/utils/is.ts
2
2
  /** Type guards for the values a component reads from the DOM or its options. */
3
3
  /**
4
4
  * Whether a value is `null`.
@@ -53,7 +53,6 @@ function isFunction(value) {
53
53
  function isObject(value) {
54
54
  return Object.prototype.toString.call(value) === "[object Object]";
55
55
  }
56
- //#endregion
57
56
  export { isBoolean, isDefined, isFunction, isNull, isNumber, isObject, isString };
58
57
 
59
58
  //# sourceMappingURL=is.js.map
@@ -1,4 +1,3 @@
1
- //#region src/utils/load.d.ts
2
1
  /** Loading a resource, as a promise that settles when the browser is done with it. */
3
2
  /**
4
3
  * Load an image, resolved once its bitmap is decoded.
@@ -42,5 +41,4 @@ declare function loadScript(src: string, attributes?: Record<string, string>): P
42
41
  declare function loadLink(href: string, attributes: {
43
42
  rel: string;
44
43
  } & Record<string, string>): Promise<HTMLLinkElement>;
45
- //#endregion
46
44
  export { loadImage, loadLink, loadScript };
@@ -1,5 +1,5 @@
1
1
  import { getSharedRuntimeSlot } from "../shared-runtime.js";
2
- //#region src/utils/load.ts
2
+ // src/utils/load.ts
3
3
  /** Loading a resource, as a promise that settles when the browser is done with it. */
4
4
  /**
5
5
  * The pending loads for the elements that go in `<head>`, keyed by the URL the
@@ -138,7 +138,6 @@ function loadLink(href, attributes) {
138
138
  state.links.set(key, promise);
139
139
  return promise;
140
140
  }
141
- //#endregion
142
141
  export { loadImage, loadLink, loadScript };
143
142
 
144
143
  //# sourceMappingURL=load.js.map
@@ -1,4 +1,3 @@
1
- //#region src/utils/maths.d.ts
2
1
  /** Time-based functions take elapsed milliseconds. */
3
2
  /**
4
3
  * The default inertia factor.
@@ -118,5 +117,4 @@ interface SpringOptions {
118
117
  * @link https://js-toolkit-v4.studiometa.dev/utils/motion.html#spring
119
118
  */
120
119
  declare function spring(targetValue: number, currentValue: number, currentVelocity: number, elapsed: number, options?: SpringOptions): [value: number, velocity: number];
121
- //#endregion
122
120
  export { DEFAULT_DAMP_FACTOR, INERTIA_FRAME, MAX_SPRING_RATIO, SpringOptions, clamp, clamp01, clampDampFactor, createRange, damp, decayOver, fold, inertiaDecay, inertiaFinalValue, inertiaStep, inertiaTimeConstant, lerp, map, mean, round, spring, wrap };
@@ -1,4 +1,4 @@
1
- //#region src/utils/maths.ts
1
+ // src/utils/maths.ts
2
2
  /** Time-based functions take elapsed milliseconds. */
3
3
  /**
4
4
  * The default inertia factor.
@@ -171,7 +171,6 @@ function spring(targetValue, currentValue, currentVelocity, elapsed, options = {
171
171
  if (Math.abs(targetValue - value) < precision && Math.abs(velocity) < precision) return [targetValue, 0];
172
172
  return [value, velocity];
173
173
  }
174
- //#endregion
175
174
  export { DEFAULT_DAMP_FACTOR, INERTIA_FRAME, MAX_SPRING_RATIO, clamp, clamp01, clampDampFactor, createRange, damp, decayOver, fold, inertiaDecay, inertiaFinalValue, inertiaStep, inertiaTimeConstant, lerp, map, mean, round, spring, wrap };
176
175
 
177
176
  //# sourceMappingURL=maths.js.map
@@ -1,4 +1,3 @@
1
- //#region src/utils/memo.d.ts
2
1
  /** A memoised function with explicit cache invalidation. */
3
2
  interface Memo<Args extends unknown[], Value> {
4
3
  (...args: Args): Value;
@@ -12,5 +11,4 @@ interface Memo<Args extends unknown[], Value> {
12
11
  * @link https://js-toolkit-v4.studiometa.dev/utils/timing.html#memo
13
12
  */
14
13
  declare function memo<Args extends [] | [key: unknown], Value>(fn: (...args: Args) => Value): Memo<Args, Value>;
15
- //#endregion
16
14
  export { Memo, memo };
@@ -1,4 +1,4 @@
1
- //#region src/utils/memo.ts
1
+ // src/utils/memo.ts
2
2
  /** Whether a value can be a `WeakMap` key. */
3
3
  function isWeakKey(value) {
4
4
  return typeof value === "object" && value !== null || typeof value === "function";
@@ -29,7 +29,6 @@ function memo(fn) {
29
29
  };
30
30
  return cached;
31
31
  }
32
- //#endregion
33
32
  export { memo };
34
33
 
35
34
  //# sourceMappingURL=memo.js.map
@@ -1,4 +1,3 @@
1
- //#region src/utils/noop.d.ts
2
1
  /** Placeholders for an optional callback, so a caller never branches on one. */
3
2
  /**
4
3
  * Do nothing, whatever it is called with.
@@ -10,5 +9,4 @@ declare function noop(): void;
10
9
  * @link https://js-toolkit-v4.studiometa.dev/utils/timing.html#noopvalue
11
10
  */
12
11
  declare function noopValue<T>(value: T): T;
13
- //#endregion
14
12
  export { noop, noopValue };
@@ -1,4 +1,4 @@
1
- //#region src/utils/noop.ts
1
+ // src/utils/noop.ts
2
2
  /** Placeholders for an optional callback, so a caller never branches on one. */
3
3
  /**
4
4
  * Do nothing, whatever it is called with.
@@ -12,7 +12,6 @@ function noop() {}
12
12
  function noopValue(value) {
13
13
  return value;
14
14
  }
15
- //#endregion
16
15
  export { noop, noopValue };
17
16
 
18
17
  //# sourceMappingURL=noop.js.map
@@ -1,4 +1,3 @@
1
- //#region src/utils/random.d.ts
2
1
  /** Random values, in the ranges a component describes. */
3
2
  /**
4
3
  * A random number between the two bounds, the second defaulting to `0`.
@@ -20,5 +19,4 @@ declare function randomInt(a: number, b?: number): number;
20
19
  */
21
20
  declare function randomItem<T>(items: readonly T[]): T | undefined;
22
21
  declare function randomItem(items: string): string | undefined;
23
- //#endregion
24
22
  export { random, randomInt, randomItem };
@@ -1,4 +1,4 @@
1
- //#region src/utils/random.ts
1
+ // src/utils/random.ts
2
2
  /** Random values, in the ranges a component describes. */
3
3
  /**
4
4
  * A random number between the two bounds, the second defaulting to `0`.
@@ -22,7 +22,6 @@ function randomInt(a, b = 0) {
22
22
  function randomItem(items) {
23
23
  return items.length > 0 ? items[randomInt(0, items.length - 1)] : void 0;
24
24
  }
25
- //#endregion
26
25
  export { random, randomInt, randomItem };
27
26
 
28
27
  //# sourceMappingURL=random.js.map
@@ -1,4 +1,3 @@
1
- //#region src/utils/scroll-lock.d.ts
2
1
  /**
3
2
  * Stop an element scrolling until every holder releases it.
4
3
  *
@@ -23,5 +22,4 @@
23
22
  * @link https://js-toolkit-v4.studiometa.dev/utils/scroll.html#lockscroll
24
23
  */
25
24
  declare function lockScroll(target?: HTMLElement): () => void;
26
- //#endregion
27
25
  export { lockScroll };
@@ -1,5 +1,5 @@
1
1
  import { getSharedRuntimeSlot } from "../shared-runtime.js";
2
- //#region src/utils/scroll-lock.ts
2
+ // src/utils/scroll-lock.ts
3
3
  /**
4
4
  * One counter per locked element, shared across evaluated copies of the
5
5
  * package: there is one scroll per document, so two copies must count the same
@@ -52,7 +52,6 @@ function lockScroll(target = document.documentElement) {
52
52
  target.style.overflow = current.restore;
53
53
  };
54
54
  }
55
- //#endregion
56
55
  export { lockScroll };
57
56
 
58
57
  //# sourceMappingURL=scroll-lock.js.map
@@ -1,4 +1,3 @@
1
- //#region src/utils/scrollTo.d.ts
2
1
  /** Where a scroller stands on both axes, in pixels from the start. */
3
2
  interface ScrollPosition {
4
3
  left: number;
@@ -83,5 +82,4 @@ declare function scrollPosition(target: ScrollToTarget, options?: ScrollPosition
83
82
  * @link https://js-toolkit-v4.studiometa.dev/utils/scroll.html#scrollto
84
83
  */
85
84
  declare function scrollTo(target: ScrollToTarget, options?: ScrollToOptions): ScrollPosition;
86
- //#endregion
87
85
  export { SCROLL_ALIGNMENTS, SCROLL_AXES, ScrollAlign, ScrollAxis, ScrollPosition, ScrollPositionOptions, ScrollToOptions, ScrollToTarget, scrollPosition, scrollTo };
@@ -1,7 +1,7 @@
1
1
  import { clamp } from "./maths.js";
2
2
  import { usePrefersReducedMotion } from "../services/media.js";
3
3
  import { isNumber, isString } from "./is.js";
4
- //#region src/utils/scrollTo.ts
4
+ // src/utils/scrollTo.ts
5
5
  /**
6
6
  * The axes a scroll is allowed to move.
7
7
  * @link https://js-toolkit-v4.studiometa.dev/utils/scroll.html#scroll-axes
@@ -157,7 +157,6 @@ function scrollTo(target, options = {}) {
157
157
  });
158
158
  return destination;
159
159
  }
160
- //#endregion
161
160
  export { SCROLL_ALIGNMENTS, SCROLL_AXES, scrollPosition, scrollTo };
162
161
 
163
162
  //# sourceMappingURL=scrollTo.js.map
@@ -1,4 +1,3 @@
1
- //#region src/utils/selectors.d.ts
2
1
  /**
3
2
  * The registry selector for a component name.
4
3
  *
@@ -15,5 +14,4 @@
15
14
  * @link https://js-toolkit-v4.studiometa.dev/utils/dom.html#selectorfor
16
15
  */
17
16
  declare function selectorFor(name: string): string;
18
- //#endregion
19
17
  export { selectorFor };
@@ -1,6 +1,6 @@
1
1
  import { COMPONENT_ATTRIBUTE } from "../attributes.js";
2
2
  import { responsiveAttributeNames } from "../responsive-options.js";
3
- //#region src/utils/selectors.ts
3
+ // src/utils/selectors.ts
4
4
  /**
5
5
  * The registry selector for a component name.
6
6
  *
@@ -19,7 +19,6 @@ import { responsiveAttributeNames } from "../responsive-options.js";
19
19
  function selectorFor(name) {
20
20
  return [COMPONENT_ATTRIBUTE, ...responsiveAttributeNames(COMPONENT_ATTRIBUTE)].map((attribute) => `[${CSS.escape(attribute)}~="${name}"]`).join(",");
21
21
  }
22
- //#endregion
23
22
  export { selectorFor };
24
23
 
25
24
  //# sourceMappingURL=selectors.js.map
@@ -1,5 +1,4 @@
1
1
  import { SpringOptions } from "./maths.js";
2
- //#region src/utils/smoothTo.d.ts
3
2
  interface SmoothToOptions extends Omit<SpringOptions, 'damping'> {
4
3
  /**
5
4
  * Damping factor, or spring friction in spring mode. Defaults to `0.6`.
@@ -73,5 +72,4 @@ declare function smoothTo(start?: number, options?: SmoothToOptions): SmoothTo;
73
72
  * consumer's own — a scale, an opacity or a progress as readily as a coordinate.
74
73
  */
75
74
  declare function smoothTo<K extends string>(start: Record<K, number>, options?: SmoothToOptions): SmoothToRecord<K>;
76
- //#endregion
77
75
  export { SmoothTo, SmoothToOptions, SmoothToRecord, smoothTo };
@@ -1,7 +1,7 @@
1
1
  import { damp, spring } from "./maths.js";
2
2
  import { toggle } from "../services/toggle.js";
3
3
  import { useRaf } from "../services/raf.js";
4
- //#region src/utils/smoothTo.ts
4
+ // src/utils/smoothTo.ts
5
5
  /** The key a single value is held under, and the one its `damping` hook is asked about. */
6
6
  const SCALAR_KEY = "value";
7
7
  function smoothTo(start = 0, options = {}) {
@@ -87,7 +87,6 @@ function smoothTo(start = 0, options = {}) {
87
87
  });
88
88
  return api;
89
89
  }
90
- //#endregion
91
90
  export { smoothTo };
92
91
 
93
92
  //# sourceMappingURL=smoothTo.js.map
@@ -1,5 +1,4 @@
1
1
  import { Memo } from "./memo.js";
2
- //#region src/utils/strings.d.ts
3
2
  /**
4
3
  * String shapes the framework converts between: an option or handler name in
5
4
  * source, and the `data-` attribute or event type it corresponds to.
@@ -97,5 +96,4 @@ declare function withTrailingSlash(string: string): string;
97
96
  * @link https://js-toolkit-v4.studiometa.dev/utils/strings.html#withouttrailingslash
98
97
  */
99
98
  declare function withoutTrailingSlash(string: string): string;
100
- //#endregion
101
99
  export { camelCase, capitalize, kebabCase, lowerCase, pascalCase, snakeCase, upperCase, withLeadingCharacters, withLeadingSlash, withTrailingCharacters, withTrailingSlash, withoutLeadingCharacters, withoutLeadingCharactersRecursive, withoutLeadingSlash, withoutTrailingCharacters, withoutTrailingCharactersRecursive, withoutTrailingSlash };
@@ -1,5 +1,5 @@
1
1
  import { memo } from "./memo.js";
2
- //#region src/utils/strings.ts
2
+ // src/utils/strings.ts
3
3
  /**
4
4
  * String shapes the framework converts between: an option or handler name in
5
5
  * source, and the `data-` attribute or event type it corresponds to.
@@ -163,7 +163,6 @@ function withTrailingSlash(string) {
163
163
  function withoutTrailingSlash(string) {
164
164
  return withoutTrailingCharacters(string, "/");
165
165
  }
166
- //#endregion
167
166
  export { camelCase, capitalize, kebabCase, lowerCase, pascalCase, snakeCase, upperCase, withLeadingCharacters, withLeadingSlash, withTrailingCharacters, withTrailingSlash, withoutLeadingCharacters, withoutLeadingCharactersRecursive, withoutLeadingSlash, withoutTrailingCharacters, withoutTrailingCharactersRecursive, withoutTrailingSlash };
168
167
 
169
168
  //# sourceMappingURL=strings.js.map
@@ -1,4 +1,3 @@
1
- //#region src/utils/timing.d.ts
2
1
  /** Rate limiting and delays, for the callbacks a component hands to the DOM. */
3
2
  /**
4
3
  * Delay a function until it stops being called for the given milliseconds.
@@ -17,5 +16,4 @@ declare function throttle<Args extends unknown[]>(fn: (...args: Args) => void, d
17
16
  * @link https://js-toolkit-v4.studiometa.dev/utils/timing.html#wait
18
17
  */
19
18
  declare function wait(delay?: number): Promise<void>;
20
- //#endregion
21
19
  export { debounce, throttle, wait };
@@ -1,4 +1,4 @@
1
- //#region src/utils/timing.ts
1
+ // src/utils/timing.ts
2
2
  /** Rate limiting and delays, for the callbacks a component hands to the DOM. */
3
3
  /**
4
4
  * Delay a function until it stops being called for the given milliseconds.
@@ -35,7 +35,6 @@ function wait(delay = 0) {
35
35
  setTimeout(resolve, delay);
36
36
  });
37
37
  }
38
- //#endregion
39
38
  export { debounce, throttle, wait };
40
39
 
41
40
  //# sourceMappingURL=timing.js.map
@@ -1,4 +1,3 @@
1
- //#region src/utils/transform.d.ts
2
1
  /**
3
2
  * CSS transform strings. Both helpers are pure: they format a value and the
4
3
  * caller hands the write to the scheduler.
@@ -63,5 +62,4 @@ interface MatrixProps {
63
62
  * @link https://js-toolkit-v4.studiometa.dev/utils/css.html#matrix
64
63
  */
65
64
  declare function matrix(props?: MatrixProps): string;
66
- //#endregion
67
65
  export { MatrixProps, TRANSFORM_PROPS, TransformProps, matrix, transform };
@@ -1,4 +1,4 @@
1
- //#region src/utils/transform.ts
1
+ // src/utils/transform.ts
2
2
  /**
3
3
  * The properties {@link transform} formats, for callers splitting a style patch.
4
4
  * @link https://js-toolkit-v4.studiometa.dev/utils/css.html#transform-props
@@ -68,7 +68,6 @@ function matrix(props = {}) {
68
68
  const { scaleX = 1, skewY = 0, skewX = 0, scaleY = 1, translateX = 0, translateY = 0 } = props;
69
69
  return `matrix(${scaleX}, ${skewY}, ${skewX}, ${scaleY}, ${translateX}, ${translateY})`;
70
70
  }
71
- //#endregion
72
71
  export { TRANSFORM_PROPS, matrix, transform };
73
72
 
74
73
  //# sourceMappingURL=transform.js.map
@@ -1,5 +1,4 @@
1
1
  import { OptionDefinition } from "../Base.js";
2
- //#region src/utils/transition.d.ts
3
2
  /**
4
3
  * CSS transition helpers for class names or inline styles. Apply `from`, then
5
4
  * `active` and `to`, and resolve after `transitionend` or on the next frame when no transition runs.
@@ -57,5 +56,4 @@ declare function enterTransition(el: HTMLElement, options: TransitionOptions): P
57
56
  * @link https://js-toolkit-v4.studiometa.dev/utils/transitions.html#leavetransition
58
57
  */
59
58
  declare function leaveTransition(el: HTMLElement, options: TransitionOptions): Promise<void>;
60
- //#endregion
61
59
  export { ClassesOrStyles, TRANSITION_OPTIONS, TransitionOptions, TransitionStyles, enterTransition, leaveTransition, setClassesOrStyles, transition };
@@ -1,5 +1,5 @@
1
1
  import { nextFrame } from "../scheduler.js";
2
- //#region src/utils/transition.ts
2
+ // src/utils/transition.ts
3
3
  const runs = /* @__PURE__ */ new WeakMap();
4
4
  function toClassList(value) {
5
5
  return (Array.isArray(value) ? value : value.split(" ")).filter(Boolean);
@@ -128,7 +128,6 @@ async function leaveTransition(el, options) {
128
128
  to: leaveTo
129
129
  }, leaveKeep ? "keep" : "remove");
130
130
  }
131
- //#endregion
132
131
  export { TRANSITION_OPTIONS, enterTransition, leaveTransition, setClassesOrStyles, transition };
133
132
 
134
133
  //# sourceMappingURL=transition.js.map
@@ -1,4 +1,3 @@
1
- //#region src/viewTransition.d.ts
2
1
  type ViewTransitionUpdate = () => void | Promise<void>;
3
2
  /**
4
3
  * Run a DOM update inside a batched, native view transition.
@@ -13,5 +12,4 @@ type ViewTransitionUpdate = () => void | Promise<void>;
13
12
  * @link https://js-toolkit-v4.studiometa.dev/api/scheduler/viewTransition.html
14
13
  */
15
14
  declare function viewTransition(update: ViewTransitionUpdate): Promise<void>;
16
- //#endregion
17
15
  export { ViewTransitionUpdate, viewTransition };
@@ -1,5 +1,5 @@
1
1
  import { defaultScheduler } from "./scheduler.js";
2
- //#region src/viewTransition.ts
2
+ // src/viewTransition.ts
3
3
  let vtQueue = [];
4
4
  let vtIsScheduled = false;
5
5
  let vtTail = Promise.resolve();
@@ -46,7 +46,6 @@ async function runViewTransitionBatch(batch) {
46
46
  for (const { reject } of batch) reject(error);
47
47
  }
48
48
  }
49
- //#endregion
50
49
  export { viewTransition };
51
50
 
52
51
  //# sourceMappingURL=viewTransition.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@studiometa/js-toolkit",
3
- "version": "4.0.0-alpha.2",
3
+ "version": "4.0.0-alpha.3",
4
4
  "type": "module",
5
5
  "sideEffects": [
6
6
  "./dist/responsive-options.js"
@@ -851,7 +851,7 @@
851
851
  "playwright": "^1.50.0",
852
852
  "tailwindcss": "4.2.2",
853
853
  "tsdown": "0.22.14",
854
- "vite": "8.2.1",
854
+ "vite": "8.2.4",
855
855
  "vitepress": "2.0.0-alpha.19",
856
856
  "vitepress-plugin-llms": "1.12.0",
857
857
  "vitest": "4.1.10"