@studiometa/js-toolkit 4.0.0-alpha.1 → 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 (455) hide show
  1. package/README.md +10 -0
  2. package/dist/Base.d.ts +0 -2
  3. package/dist/Base.js +1 -2
  4. package/dist/Base.js.map +1 -1
  5. package/dist/attribute-namespaces.d.ts +0 -2
  6. package/dist/attribute-namespaces.js +1 -2
  7. package/dist/attributes.d.ts +0 -2
  8. package/dist/attributes.js +1 -2
  9. package/dist/children-watchers.d.ts +0 -2
  10. package/dist/children-watchers.js +1 -2
  11. package/dist/component-brand.d.ts +0 -2
  12. package/dist/component-brand.js +1 -2
  13. package/dist/component-declarations.d.ts +0 -2
  14. package/dist/component-declarations.js +1 -2
  15. package/dist/context-subscription.d.ts +0 -2
  16. package/dist/context-subscription.js +1 -2
  17. package/dist/context.d.ts +0 -2
  18. package/dist/context.js +1 -2
  19. package/dist/decorators.d.ts +0 -2
  20. package/dist/decorators.js +1 -2
  21. package/dist/diagnostic-contract.d.ts +0 -2
  22. package/dist/diagnostic-contract.js +1 -2
  23. package/dist/diagnostics.d.ts +0 -2
  24. package/dist/diagnostics.js +1 -2
  25. package/dist/document-order.d.ts +0 -2
  26. package/dist/document-order.js +1 -2
  27. package/dist/dom-mutations.d.ts +0 -2
  28. package/dist/dom-mutations.js +1 -2
  29. package/dist/events.d.ts +0 -2
  30. package/dist/events.js +1 -2
  31. package/dist/group.d.ts +0 -2
  32. package/dist/group.js +1 -2
  33. package/dist/instances.d.ts +0 -2
  34. package/dist/instances.js +1 -2
  35. package/dist/manifest.d.ts +0 -2
  36. package/dist/manifest.js +1 -2
  37. package/dist/mount-strategies.d.ts +0 -2
  38. package/dist/mount-strategies.js +1 -2
  39. package/dist/negotiated-events.d.ts +0 -2
  40. package/dist/negotiated-events.js +1 -2
  41. package/dist/protocol-symbols.d.ts +0 -2
  42. package/dist/protocol-symbols.js +1 -2
  43. package/dist/registry.d.ts +0 -2
  44. package/dist/registry.js +1 -2
  45. package/dist/responsive-options.d.ts +0 -2
  46. package/dist/responsive-options.js +1 -2
  47. package/dist/scheduler.d.ts +0 -2
  48. package/dist/scheduler.js +1 -2
  49. package/dist/scheduler.js.map +1 -1
  50. package/dist/services/breakpoint.d.ts +0 -2
  51. package/dist/services/breakpoint.js +1 -2
  52. package/dist/services/drag.d.ts +0 -2
  53. package/dist/services/drag.js +1 -2
  54. package/dist/services/in-view.d.ts +0 -2
  55. package/dist/services/in-view.js +1 -2
  56. package/dist/services/key.d.ts +0 -2
  57. package/dist/services/key.js +1 -2
  58. package/dist/services/media.d.ts +0 -2
  59. package/dist/services/media.js +1 -2
  60. package/dist/services/mixin.d.ts +0 -2
  61. package/dist/services/mixin.js +1 -2
  62. package/dist/services/mutation.d.ts +0 -2
  63. package/dist/services/mutation.js +1 -2
  64. package/dist/services/pointer.d.ts +0 -2
  65. package/dist/services/pointer.js +1 -2
  66. package/dist/services/raf.d.ts +0 -2
  67. package/dist/services/raf.js +1 -2
  68. package/dist/services/resize.d.ts +0 -2
  69. package/dist/services/resize.js +1 -2
  70. package/dist/services/scroll-progress-offset.d.ts +0 -2
  71. package/dist/services/scroll-progress-offset.js +1 -2
  72. package/dist/services/scroll-progress.d.ts +0 -2
  73. package/dist/services/scroll-progress.js +1 -2
  74. package/dist/services/scroll.d.ts +0 -2
  75. package/dist/services/scroll.js +1 -2
  76. package/dist/services/service.d.ts +0 -2
  77. package/dist/services/service.js +1 -2
  78. package/dist/services/toggle.d.ts +0 -2
  79. package/dist/services/toggle.js +1 -2
  80. package/dist/services/until.d.ts +0 -2
  81. package/dist/services/until.js +1 -2
  82. package/dist/shared-runtime.d.ts +0 -2
  83. package/dist/shared-runtime.js +1 -2
  84. package/dist/storage/createStorage.d.ts +0 -2
  85. package/dist/storage/createStorage.js +1 -2
  86. package/dist/storage/index.d.ts +0 -2
  87. package/dist/storage/index.js +1 -2
  88. package/dist/storage/providers.d.ts +0 -2
  89. package/dist/storage/providers.js +1 -2
  90. package/dist/storage/serializers.d.ts +0 -2
  91. package/dist/storage/serializers.js +1 -2
  92. package/dist/storage/sync.d.ts +0 -2
  93. package/dist/storage/sync.js +1 -2
  94. package/dist/storage/types.d.ts +0 -2
  95. package/dist/subpaths/BREAKPOINTS.js +1 -2
  96. package/dist/subpaths/Base.js +1 -2
  97. package/dist/subpaths/DIAGNOSTICS.js +1 -2
  98. package/dist/subpaths/DRAG_MODES.js +1 -2
  99. package/dist/subpaths/EVENTS.js +1 -2
  100. package/dist/subpaths/MOUNT_ATTRIBUTE.js +1 -2
  101. package/dist/subpaths/SWAP_MODES.js +1 -2
  102. package/dist/subpaths/children.js +1 -2
  103. package/dist/subpaths/component.js +1 -2
  104. package/dist/subpaths/createContext.js +1 -2
  105. package/dist/subpaths/createFallbackProvider.js +1 -2
  106. package/dist/subpaths/createGroup.js +1 -2
  107. package/dist/subpaths/createLocalStorage.js +1 -2
  108. package/dist/subpaths/createMemoryStorageProvider.js +1 -2
  109. package/dist/subpaths/createService.js +1 -2
  110. package/dist/subpaths/createServiceMixin.js +1 -2
  111. package/dist/subpaths/createSessionStorage.js +1 -2
  112. package/dist/subpaths/createStorage.js +1 -2
  113. package/dist/subpaths/createUrlSearchParamsInHashProvider.js +1 -2
  114. package/dist/subpaths/createUrlSearchParamsInHashStorage.js +1 -2
  115. package/dist/subpaths/createUrlSearchParamsProvider.js +1 -2
  116. package/dist/subpaths/createUrlSearchParamsStorage.js +1 -2
  117. package/dist/subpaths/defaultScheduler.js +1 -2
  118. package/dist/subpaths/defineManifest.js +1 -2
  119. package/dist/subpaths/domUpdate.js +1 -2
  120. package/dist/subpaths/emitExtendable.js +1 -2
  121. package/dist/subpaths/fromMetaGlob.js +1 -2
  122. package/dist/subpaths/fromWebpackContext.js +1 -2
  123. package/dist/subpaths/getBreakpoints.js +1 -2
  124. package/dist/subpaths/getInstance.js +1 -2
  125. package/dist/subpaths/getInstances.js +1 -2
  126. package/dist/subpaths/getMountedInstances.js +1 -2
  127. package/dist/subpaths/getUnmountedInstances.js +1 -2
  128. package/dist/subpaths/inject.js +1 -2
  129. package/dist/subpaths/injectContext.js +1 -2
  130. package/dist/subpaths/injectContextSync.js +1 -2
  131. package/dist/subpaths/jsonSerializer.js +1 -2
  132. package/dist/subpaths/localStorageProvider.js +1 -2
  133. package/dist/subpaths/memoryStorageProvider.js +1 -2
  134. package/dist/subpaths/namespaceQualifier.js +1 -2
  135. package/dist/subpaths/nextFrame.js +1 -2
  136. package/dist/subpaths/on.js +1 -2
  137. package/dist/subpaths/perTarget.js +1 -2
  138. package/dist/subpaths/provide.js +1 -2
  139. package/dist/subpaths/provideContext.js +1 -2
  140. package/dist/subpaths/provideRootContext.js +1 -2
  141. package/dist/subpaths/read.js +1 -2
  142. package/dist/subpaths/registerComponent.js +1 -2
  143. package/dist/subpaths/registerComponents.js +1 -2
  144. package/dist/subpaths/registerManifest.js +1 -2
  145. package/dist/subpaths/reportDiagnostic.js +1 -2
  146. package/dist/subpaths/sessionStorageProvider.js +1 -2
  147. package/dist/subpaths/setBreakpoints.js +1 -2
  148. package/dist/subpaths/signal.js +1 -2
  149. package/dist/subpaths/subscribeContext.js +1 -2
  150. package/dist/subpaths/swap.js +1 -2
  151. package/dist/subpaths/toggle.js +1 -2
  152. package/dist/subpaths/until.js +1 -2
  153. package/dist/subpaths/urlSearchParamsInHashProvider.js +1 -2
  154. package/dist/subpaths/urlSearchParamsProvider.js +1 -2
  155. package/dist/subpaths/useBreakpoint.js +1 -2
  156. package/dist/subpaths/useDrag.js +1 -2
  157. package/dist/subpaths/useInView.js +1 -2
  158. package/dist/subpaths/useKey.js +1 -2
  159. package/dist/subpaths/useMediaQuery.js +1 -2
  160. package/dist/subpaths/useMutation.js +1 -2
  161. package/dist/subpaths/usePointer.js +1 -2
  162. package/dist/subpaths/usePrefersReducedMotion.js +1 -2
  163. package/dist/subpaths/useRaf.js +1 -2
  164. package/dist/subpaths/useResize.js +1 -2
  165. package/dist/subpaths/useScroll.js +1 -2
  166. package/dist/subpaths/useScrollProgress.js +1 -2
  167. package/dist/subpaths/useWindowScroll.js +1 -2
  168. package/dist/subpaths/useWindowSize.js +1 -2
  169. package/dist/subpaths/utils/DEFAULT_DAMP_FACTOR.js +1 -2
  170. package/dist/subpaths/utils/INERTIA_FRAME.js +1 -2
  171. package/dist/subpaths/utils/MAX_SPRING_RATIO.js +1 -2
  172. package/dist/subpaths/utils/SCROLL_ALIGNMENTS.js +1 -2
  173. package/dist/subpaths/utils/SCROLL_AXES.js +1 -2
  174. package/dist/subpaths/utils/TRANSFORM_PROPS.js +1 -2
  175. package/dist/subpaths/utils/TRANSITION_OPTIONS.js +1 -2
  176. package/dist/subpaths/utils/camelCase.js +1 -2
  177. package/dist/subpaths/utils/capitalize.js +1 -2
  178. package/dist/subpaths/utils/clamp.js +1 -2
  179. package/dist/subpaths/utils/clamp01.js +1 -2
  180. package/dist/subpaths/utils/clampDampFactor.js +1 -2
  181. package/dist/subpaths/utils/createEaseInOut.js +1 -2
  182. package/dist/subpaths/utils/createEaseOut.js +1 -2
  183. package/dist/subpaths/utils/createElement.js +1 -2
  184. package/dist/subpaths/utils/createRange.js +1 -2
  185. package/dist/subpaths/utils/damp.js +1 -2
  186. package/dist/subpaths/utils/debounce.js +1 -2
  187. package/dist/subpaths/utils/decayOver.js +1 -2
  188. package/dist/subpaths/utils/deepmerge.js +1 -2
  189. package/dist/subpaths/utils/easeInCirc.js +1 -2
  190. package/dist/subpaths/utils/easeInCubic.js +1 -2
  191. package/dist/subpaths/utils/easeInExpo.js +1 -2
  192. package/dist/subpaths/utils/easeInOutCirc.js +1 -2
  193. package/dist/subpaths/utils/easeInOutCubic.js +1 -2
  194. package/dist/subpaths/utils/easeInOutExpo.js +1 -2
  195. package/dist/subpaths/utils/easeInOutQuad.js +1 -2
  196. package/dist/subpaths/utils/easeInOutQuart.js +1 -2
  197. package/dist/subpaths/utils/easeInOutQuint.js +1 -2
  198. package/dist/subpaths/utils/easeInOutSine.js +1 -2
  199. package/dist/subpaths/utils/easeInQuad.js +1 -2
  200. package/dist/subpaths/utils/easeInQuart.js +1 -2
  201. package/dist/subpaths/utils/easeInQuint.js +1 -2
  202. package/dist/subpaths/utils/easeInSine.js +1 -2
  203. package/dist/subpaths/utils/easeLinear.js +1 -2
  204. package/dist/subpaths/utils/easeOutCirc.js +1 -2
  205. package/dist/subpaths/utils/easeOutCubic.js +1 -2
  206. package/dist/subpaths/utils/easeOutExpo.js +1 -2
  207. package/dist/subpaths/utils/easeOutQuad.js +1 -2
  208. package/dist/subpaths/utils/easeOutQuart.js +1 -2
  209. package/dist/subpaths/utils/easeOutQuint.js +1 -2
  210. package/dist/subpaths/utils/easeOutSine.js +1 -2
  211. package/dist/subpaths/utils/enterTransition.js +1 -2
  212. package/dist/subpaths/utils/fold.js +1 -2
  213. package/dist/subpaths/utils/getOffsetSizes.js +1 -2
  214. package/dist/subpaths/utils/historyPush.js +1 -2
  215. package/dist/subpaths/utils/historyReplace.js +1 -2
  216. package/dist/subpaths/utils/inertiaDecay.js +1 -2
  217. package/dist/subpaths/utils/inertiaFinalValue.js +1 -2
  218. package/dist/subpaths/utils/inertiaStep.js +1 -2
  219. package/dist/subpaths/utils/inertiaTimeConstant.js +1 -2
  220. package/dist/subpaths/utils/isBoolean.js +1 -2
  221. package/dist/subpaths/utils/isDefined.js +1 -2
  222. package/dist/subpaths/utils/isFunction.js +1 -2
  223. package/dist/subpaths/utils/isNull.js +1 -2
  224. package/dist/subpaths/utils/isNumber.js +1 -2
  225. package/dist/subpaths/utils/isObject.js +1 -2
  226. package/dist/subpaths/utils/isString.js +1 -2
  227. package/dist/subpaths/utils/kebabCase.js +1 -2
  228. package/dist/subpaths/utils/leaveTransition.js +1 -2
  229. package/dist/subpaths/utils/lerp.js +1 -2
  230. package/dist/subpaths/utils/loadImage.js +1 -2
  231. package/dist/subpaths/utils/loadLink.js +1 -2
  232. package/dist/subpaths/utils/loadScript.js +1 -2
  233. package/dist/subpaths/utils/lockScroll.js +1 -2
  234. package/dist/subpaths/utils/lowerCase.js +1 -2
  235. package/dist/subpaths/utils/map.js +1 -2
  236. package/dist/subpaths/utils/matrix.js +1 -2
  237. package/dist/subpaths/utils/mean.js +1 -2
  238. package/dist/subpaths/utils/memo.js +1 -2
  239. package/dist/subpaths/utils/noop.js +1 -2
  240. package/dist/subpaths/utils/noopValue.js +1 -2
  241. package/dist/subpaths/utils/objectToURLSearchParams.js +1 -2
  242. package/dist/subpaths/utils/pascalCase.js +1 -2
  243. package/dist/subpaths/utils/random.js +1 -2
  244. package/dist/subpaths/utils/randomInt.js +1 -2
  245. package/dist/subpaths/utils/randomItem.js +1 -2
  246. package/dist/subpaths/utils/round.js +1 -2
  247. package/dist/subpaths/utils/saveActiveElement.js +1 -2
  248. package/dist/subpaths/utils/scrollPosition.js +1 -2
  249. package/dist/subpaths/utils/scrollTo.js +1 -2
  250. package/dist/subpaths/utils/selectorFor.js +1 -2
  251. package/dist/subpaths/utils/setClassesOrStyles.js +1 -2
  252. package/dist/subpaths/utils/smoothTo.js +1 -2
  253. package/dist/subpaths/utils/snakeCase.js +1 -2
  254. package/dist/subpaths/utils/spring.js +1 -2
  255. package/dist/subpaths/utils/throttle.js +1 -2
  256. package/dist/subpaths/utils/transform.js +1 -2
  257. package/dist/subpaths/utils/transition.js +1 -2
  258. package/dist/subpaths/utils/trapFocus.js +1 -2
  259. package/dist/subpaths/utils/untrapFocus.js +1 -2
  260. package/dist/subpaths/utils/upperCase.js +1 -2
  261. package/dist/subpaths/utils/wait.js +1 -2
  262. package/dist/subpaths/utils/withLeadingCharacters.js +1 -2
  263. package/dist/subpaths/utils/withLeadingSlash.js +1 -2
  264. package/dist/subpaths/utils/withTrailingCharacters.js +1 -2
  265. package/dist/subpaths/utils/withTrailingSlash.js +1 -2
  266. package/dist/subpaths/utils/withoutLeadingCharacters.js +1 -2
  267. package/dist/subpaths/utils/withoutLeadingCharactersRecursive.js +1 -2
  268. package/dist/subpaths/utils/withoutLeadingSlash.js +1 -2
  269. package/dist/subpaths/utils/withoutTrailingCharacters.js +1 -2
  270. package/dist/subpaths/utils/withoutTrailingCharactersRecursive.js +1 -2
  271. package/dist/subpaths/utils/withoutTrailingSlash.js +1 -2
  272. package/dist/subpaths/utils/wrap.js +1 -2
  273. package/dist/subpaths/viewTransition.js +1 -2
  274. package/dist/subpaths/warn.js +1 -2
  275. package/dist/subpaths/watchAttributeNamespace.js +1 -2
  276. package/dist/subpaths/watchAttributes.js +1 -2
  277. package/dist/subpaths/whenDOMSettled.js +1 -2
  278. package/dist/subpaths/withDrag.js +1 -2
  279. package/dist/subpaths/withInView.js +1 -2
  280. package/dist/subpaths/withKey.js +1 -2
  281. package/dist/subpaths/withMutation.js +1 -2
  282. package/dist/subpaths/withPointer.js +1 -2
  283. package/dist/subpaths/withRaf.js +1 -2
  284. package/dist/subpaths/withResize.js +1 -2
  285. package/dist/subpaths/withScroll.js +1 -2
  286. package/dist/subpaths/withScrollProgress.js +1 -2
  287. package/dist/subpaths/write.js +1 -2
  288. package/dist/swap.d.ts +0 -2
  289. package/dist/swap.js +1 -2
  290. package/dist/test/index.d.ts +0 -2
  291. package/dist/test/index.js +1 -2
  292. package/dist/utils/deepmerge.d.ts +0 -2
  293. package/dist/utils/deepmerge.js +1 -2
  294. package/dist/utils/dom.d.ts +0 -2
  295. package/dist/utils/dom.js +1 -2
  296. package/dist/utils/easings.d.ts +0 -2
  297. package/dist/utils/easings.js +1 -2
  298. package/dist/utils/focus.d.ts +0 -2
  299. package/dist/utils/focus.js +1 -2
  300. package/dist/utils/history.d.ts +0 -2
  301. package/dist/utils/history.js +1 -2
  302. package/dist/utils/is.d.ts +0 -2
  303. package/dist/utils/is.js +1 -2
  304. package/dist/utils/load.d.ts +0 -2
  305. package/dist/utils/load.js +1 -2
  306. package/dist/utils/maths.d.ts +0 -2
  307. package/dist/utils/maths.js +1 -2
  308. package/dist/utils/memo.d.ts +0 -2
  309. package/dist/utils/memo.js +1 -2
  310. package/dist/utils/noop.d.ts +0 -2
  311. package/dist/utils/noop.js +1 -2
  312. package/dist/utils/random.d.ts +0 -2
  313. package/dist/utils/random.js +1 -2
  314. package/dist/utils/scroll-lock.d.ts +0 -2
  315. package/dist/utils/scroll-lock.js +1 -2
  316. package/dist/utils/scrollTo.d.ts +0 -2
  317. package/dist/utils/scrollTo.js +1 -2
  318. package/dist/utils/selectors.d.ts +0 -2
  319. package/dist/utils/selectors.js +1 -2
  320. package/dist/utils/smoothTo.d.ts +0 -2
  321. package/dist/utils/smoothTo.js +1 -2
  322. package/dist/utils/strings.d.ts +0 -2
  323. package/dist/utils/strings.js +1 -2
  324. package/dist/utils/timing.d.ts +0 -2
  325. package/dist/utils/timing.js +1 -2
  326. package/dist/utils/transform.d.ts +0 -2
  327. package/dist/utils/transform.js +1 -2
  328. package/dist/utils/transition.d.ts +0 -2
  329. package/dist/utils/transition.js +1 -2
  330. package/dist/viewTransition.d.ts +0 -2
  331. package/dist/viewTransition.js +1 -2
  332. package/package.json +6 -3
  333. package/skills/studiometa-js-toolkit/SKILL.md +87 -0
  334. package/skills/studiometa-js-toolkit/references/api/configuration.md +169 -0
  335. package/skills/studiometa-js-toolkit/references/api/context/createContext.md +46 -0
  336. package/skills/studiometa-js-toolkit/references/api/context/createGroup.md +67 -0
  337. package/skills/studiometa-js-toolkit/references/api/context/index.md +69 -0
  338. package/skills/studiometa-js-toolkit/references/api/context/injectContext.md +58 -0
  339. package/skills/studiometa-js-toolkit/references/api/context/injectContextSync.md +44 -0
  340. package/skills/studiometa-js-toolkit/references/api/context/provideContext.md +61 -0
  341. package/skills/studiometa-js-toolkit/references/api/context/provideRootContext.md +42 -0
  342. package/skills/studiometa-js-toolkit/references/api/context/signal.md +85 -0
  343. package/skills/studiometa-js-toolkit/references/api/context/subscribeContext.md +71 -0
  344. package/skills/studiometa-js-toolkit/references/api/decorators/children.md +92 -0
  345. package/skills/studiometa-js-toolkit/references/api/decorators/component.md +75 -0
  346. package/skills/studiometa-js-toolkit/references/api/decorators/index.md +41 -0
  347. package/skills/studiometa-js-toolkit/references/api/decorators/inject.md +73 -0
  348. package/skills/studiometa-js-toolkit/references/api/decorators/on.md +149 -0
  349. package/skills/studiometa-js-toolkit/references/api/decorators/provide.md +77 -0
  350. package/skills/studiometa-js-toolkit/references/api/decorators/read-write.md +93 -0
  351. package/skills/studiometa-js-toolkit/references/api/diagnostics/DIAGNOSTICS.md +137 -0
  352. package/skills/studiometa-js-toolkit/references/api/diagnostics/EVENTS.md +45 -0
  353. package/skills/studiometa-js-toolkit/references/api/diagnostics/index.md +58 -0
  354. package/skills/studiometa-js-toolkit/references/api/diagnostics/reportDiagnostic.md +67 -0
  355. package/skills/studiometa-js-toolkit/references/api/diagnostics/warn.md +54 -0
  356. package/skills/studiometa-js-toolkit/references/api/dom/breakpoints.md +81 -0
  357. package/skills/studiometa-js-toolkit/references/api/dom/domUpdate.md +70 -0
  358. package/skills/studiometa-js-toolkit/references/api/dom/emitExtendable.md +68 -0
  359. package/skills/studiometa-js-toolkit/references/api/dom/index.md +26 -0
  360. package/skills/studiometa-js-toolkit/references/api/dom/swap.md +105 -0
  361. package/skills/studiometa-js-toolkit/references/api/dom/watchAttributeNamespace.md +96 -0
  362. package/skills/studiometa-js-toolkit/references/api/dom/watchAttributes.md +56 -0
  363. package/skills/studiometa-js-toolkit/references/api/dom/whenDOMSettled.md +41 -0
  364. package/skills/studiometa-js-toolkit/references/api/html/data-component.md +105 -0
  365. package/skills/studiometa-js-toolkit/references/api/html/data-mount.md +69 -0
  366. package/skills/studiometa-js-toolkit/references/api/html/data-option.md +106 -0
  367. package/skills/studiometa-js-toolkit/references/api/html/data-ref.md +63 -0
  368. package/skills/studiometa-js-toolkit/references/api/html/index.md +32 -0
  369. package/skills/studiometa-js-toolkit/references/api/index.md +73 -0
  370. package/skills/studiometa-js-toolkit/references/api/instance-events.md +75 -0
  371. package/skills/studiometa-js-toolkit/references/api/instance-methods.md +267 -0
  372. package/skills/studiometa-js-toolkit/references/api/instance-properties.md +90 -0
  373. package/skills/studiometa-js-toolkit/references/api/methods-hooks-events.md +149 -0
  374. package/skills/studiometa-js-toolkit/references/api/methods-hooks-lifecycle.md +90 -0
  375. package/skills/studiometa-js-toolkit/references/api/methods-hooks-options.md +96 -0
  376. package/skills/studiometa-js-toolkit/references/api/methods-hooks-services.md +164 -0
  377. package/skills/studiometa-js-toolkit/references/api/registry/defineManifest.md +57 -0
  378. package/skills/studiometa-js-toolkit/references/api/registry/fromMetaGlob.md +33 -0
  379. package/skills/studiometa-js-toolkit/references/api/registry/fromWebpackContext.md +37 -0
  380. package/skills/studiometa-js-toolkit/references/api/registry/getInstance.md +52 -0
  381. package/skills/studiometa-js-toolkit/references/api/registry/getInstances.md +48 -0
  382. package/skills/studiometa-js-toolkit/references/api/registry/getMountedInstances.md +39 -0
  383. package/skills/studiometa-js-toolkit/references/api/registry/getUnmountedInstances.md +46 -0
  384. package/skills/studiometa-js-toolkit/references/api/registry/index.md +49 -0
  385. package/skills/studiometa-js-toolkit/references/api/registry/registerComponent.md +93 -0
  386. package/skills/studiometa-js-toolkit/references/api/registry/registerComponents.md +37 -0
  387. package/skills/studiometa-js-toolkit/references/api/registry/registerManifest.md +72 -0
  388. package/skills/studiometa-js-toolkit/references/api/scheduler/defaultScheduler.md +104 -0
  389. package/skills/studiometa-js-toolkit/references/api/scheduler/index.md +27 -0
  390. package/skills/studiometa-js-toolkit/references/api/scheduler/nextFrame.md +31 -0
  391. package/skills/studiometa-js-toolkit/references/api/scheduler/viewTransition.md +53 -0
  392. package/skills/studiometa-js-toolkit/references/api/services/createService.md +95 -0
  393. package/skills/studiometa-js-toolkit/references/api/services/createServiceMixin.md +81 -0
  394. package/skills/studiometa-js-toolkit/references/api/services/index.md +94 -0
  395. package/skills/studiometa-js-toolkit/references/api/services/mixins.md +148 -0
  396. package/skills/studiometa-js-toolkit/references/api/services/perTarget.md +65 -0
  397. package/skills/studiometa-js-toolkit/references/api/services/toggle.md +80 -0
  398. package/skills/studiometa-js-toolkit/references/api/services/until.md +44 -0
  399. package/skills/studiometa-js-toolkit/references/api/services/useBreakpoint.md +42 -0
  400. package/skills/studiometa-js-toolkit/references/api/services/useDrag.md +119 -0
  401. package/skills/studiometa-js-toolkit/references/api/services/useInView.md +64 -0
  402. package/skills/studiometa-js-toolkit/references/api/services/useKey.md +105 -0
  403. package/skills/studiometa-js-toolkit/references/api/services/useMediaQuery.md +45 -0
  404. package/skills/studiometa-js-toolkit/references/api/services/useMutation.md +69 -0
  405. package/skills/studiometa-js-toolkit/references/api/services/usePointer.md +91 -0
  406. package/skills/studiometa-js-toolkit/references/api/services/usePrefersReducedMotion.md +42 -0
  407. package/skills/studiometa-js-toolkit/references/api/services/useRaf.md +91 -0
  408. package/skills/studiometa-js-toolkit/references/api/services/useResize.md +60 -0
  409. package/skills/studiometa-js-toolkit/references/api/services/useScroll.md +88 -0
  410. package/skills/studiometa-js-toolkit/references/api/services/useScrollProgress.md +88 -0
  411. package/skills/studiometa-js-toolkit/references/api/services/useWindowScroll.md +25 -0
  412. package/skills/studiometa-js-toolkit/references/api/services/useWindowSize.md +25 -0
  413. package/skills/studiometa-js-toolkit/references/api/storage/createStorage.md +126 -0
  414. package/skills/studiometa-js-toolkit/references/api/storage/index.md +33 -0
  415. package/skills/studiometa-js-toolkit/references/api/storage/presets.md +58 -0
  416. package/skills/studiometa-js-toolkit/references/api/storage/providers.md +109 -0
  417. package/skills/studiometa-js-toolkit/references/api/test/index.md +214 -0
  418. package/skills/studiometa-js-toolkit/references/guide/concepts/attribute-grammar.md +93 -0
  419. package/skills/studiometa-js-toolkit/references/guide/concepts/mutation-engine.md +71 -0
  420. package/skills/studiometa-js-toolkit/references/guide/concepts/philosophy.md +78 -0
  421. package/skills/studiometa-js-toolkit/references/guide/concepts/the-registry.md +110 -0
  422. package/skills/studiometa-js-toolkit/references/guide/going-further/autoloading.md +104 -0
  423. package/skills/studiometa-js-toolkit/references/guide/going-further/handling-diagnostics.md +104 -0
  424. package/skills/studiometa-js-toolkit/references/guide/going-further/mount-strategies.md +95 -0
  425. package/skills/studiometa-js-toolkit/references/guide/going-further/scheduling-work.md +124 -0
  426. package/skills/studiometa-js-toolkit/references/guide/going-further/sharing-state.md +218 -0
  427. package/skills/studiometa-js-toolkit/references/guide/going-further/swapping-content.md +92 -0
  428. package/skills/studiometa-js-toolkit/references/guide/going-further/testing-components.md +137 -0
  429. package/skills/studiometa-js-toolkit/references/guide/going-further/typing-components.md +190 -0
  430. package/skills/studiometa-js-toolkit/references/guide/going-further/using-decorators.md +168 -0
  431. package/skills/studiometa-js-toolkit/references/guide/going-further/using-storage.md +125 -0
  432. package/skills/studiometa-js-toolkit/references/guide/index.md +163 -0
  433. package/skills/studiometa-js-toolkit/references/guide/introduction/installation.md +144 -0
  434. package/skills/studiometa-js-toolkit/references/guide/introduction/lifecycle-hooks.md +174 -0
  435. package/skills/studiometa-js-toolkit/references/guide/introduction/managing-components.md +229 -0
  436. package/skills/studiometa-js-toolkit/references/guide/introduction/managing-options.md +235 -0
  437. package/skills/studiometa-js-toolkit/references/guide/introduction/managing-refs.md +174 -0
  438. package/skills/studiometa-js-toolkit/references/guide/introduction/using-services.md +218 -0
  439. package/skills/studiometa-js-toolkit/references/guide/introduction/working-with-events.md +251 -0
  440. package/skills/studiometa-js-toolkit/references/guide/migration/v3-to-v4.md +373 -0
  441. package/skills/studiometa-js-toolkit/references/utils/css.md +98 -0
  442. package/skills/studiometa-js-toolkit/references/utils/dom.md +54 -0
  443. package/skills/studiometa-js-toolkit/references/utils/easings.md +217 -0
  444. package/skills/studiometa-js-toolkit/references/utils/focus.md +84 -0
  445. package/skills/studiometa-js-toolkit/references/utils/history.md +69 -0
  446. package/skills/studiometa-js-toolkit/references/utils/index.md +53 -0
  447. package/skills/studiometa-js-toolkit/references/utils/is.md +84 -0
  448. package/skills/studiometa-js-toolkit/references/utils/load.md +59 -0
  449. package/skills/studiometa-js-toolkit/references/utils/math.md +129 -0
  450. package/skills/studiometa-js-toolkit/references/utils/motion.md +218 -0
  451. package/skills/studiometa-js-toolkit/references/utils/objects.md +68 -0
  452. package/skills/studiometa-js-toolkit/references/utils/scroll.md +128 -0
  453. package/skills/studiometa-js-toolkit/references/utils/strings.md +176 -0
  454. package/skills/studiometa-js-toolkit/references/utils/timing.md +111 -0
  455. package/skills/studiometa-js-toolkit/references/utils/transitions.md +122 -0
@@ -0,0 +1,251 @@
1
+ # Events
2
+
3
+ Everything a component announces is a real DOM event, and everything it listens to is delegated from its own root element.
4
+
5
+ ## The conventions
6
+
7
+ | Method name | Listens to | Payload |
8
+ | ------------------- | --------------------------------------------- | ---------------------------- |
9
+ | `on<Event>` | the component's own element | the raw event |
10
+ | `on<Ref><Event>` | a declared ref, delegated | `{ event, target, index }` |
11
+ | `on<Child><Event>` | a component in `config.components`, delegated | `{ event, target, payload }` |
12
+ | `onWindow<Event>` | `window` | `{ event, target }` |
13
+ | `onDocument<Event>` | `document` | `{ event, target }` |
14
+
15
+ Every one of them is bound for the **mount cycle** and removed by `$unmount()`.
16
+
17
+ ## The component's own element
18
+
19
+ ```js
20
+ import { Base } from '@studiometa/js-toolkit';
21
+
22
+ class Toggle extends Base {
23
+ static config = { name: 'Toggle' };
24
+
25
+ onClick(event) {
26
+ event.preventDefault();
27
+ this.$el.classList.toggle('is-active');
28
+ }
29
+ }
30
+ ```
31
+
32
+ ## Refs
33
+
34
+ See [Refs](managing-refs.md#event-handlers). The payload's `target` is the ref element the handler matched, not `event.target`, and `index` is its position in a list ref.
35
+
36
+ ## `$emit()` — a native event
37
+
38
+ `$emit(name, payload?)` dispatches a bubbling, cancelable `CustomEvent`. `detail` **is** the payload:
39
+
40
+ ```js
41
+ import { Base } from '@studiometa/js-toolkit';
42
+
43
+ class Dialog extends Base {
44
+ static config = { name: 'Dialog' };
45
+
46
+ open() {
47
+ // No payload: `detail` is the platform value `null`.
48
+ this.$emit('open');
49
+ }
50
+
51
+ goto(index) {
52
+ // One optional object, and `detail` is that object.
53
+ this.$emit('goto', { index });
54
+ }
55
+ }
56
+ ```
57
+
58
+ - It **bubbles**, so any ancestor hears it — a component, or a plain `addEventListener`.
59
+ - It is **cancelable**, and `$emit()` returns the event, so the emitter can read `event.defaultPrevented`.
60
+ - The payload is **one object**, or nothing. A value that is not an object is refused by the type and reported at runtime as `event.invalid-emit-payload`. The event still dispatches.
61
+
62
+ Nothing in the framework is gated on cancellation. It is a channel for component code.
63
+
64
+ ```js
65
+ import { Base } from '@studiometa/js-toolkit';
66
+
67
+ class Dialog extends Base {
68
+ static config = { name: 'Dialog' };
69
+
70
+ close() {
71
+ const event = this.$emit('close');
72
+ if (event.defaultPrevented) return;
73
+ this.$el.removeAttribute('data-option-open');
74
+ }
75
+ }
76
+ ```
77
+
78
+ ### Typing the events a component emits
79
+
80
+ `$emits` in the props type maps each name to its payload object, or to `void` for an event with no payload:
81
+
82
+ ```ts
83
+ import { Base } from '@studiometa/js-toolkit';
84
+
85
+ class Slider extends Base<{
86
+ $emits: {
87
+ goto: { index: number };
88
+ stop: void;
89
+ };
90
+ }> {
91
+ static config = { name: 'Slider' };
92
+
93
+ mounted() {
94
+ this.$emit('goto', { index: 2 });
95
+ this.$emit('stop');
96
+ }
97
+ }
98
+ ```
99
+
100
+ `$emits` replaces the runtime `config.emits` of v3. Nothing of it stays in the bundle.
101
+
102
+ ## Child events {#child-events}
103
+
104
+ A parent hears a child through `on<Child><Event>`, resolved against the names in `config.components`:
105
+
106
+ ```ts
107
+ import { Base, type DelegatedEvent } from '@studiometa/js-toolkit';
108
+
109
+ class AccordionItem extends Base<{ $emits: { open: { height: number } } }> {
110
+ static config = { name: 'AccordionItem' };
111
+
112
+ onClick() {
113
+ this.$emit('open', { height: this.$el.scrollHeight });
114
+ }
115
+ }
116
+
117
+ class Accordion extends Base {
118
+ static config = {
119
+ name: 'Accordion',
120
+ components: { AccordionItem },
121
+ };
122
+
123
+ onAccordionItemOpen({ target, payload }: DelegatedEvent<AccordionItem, 'open'>) {
124
+ console.log(`${target.$id} opened to ${payload.height}px`);
125
+ }
126
+ }
127
+ ```
128
+
129
+ How it works:
130
+
131
+ - **One listener per event type** on the parent's root element.
132
+ - The handler walks from `event.target` up to `this.$el`, reads the instance map of each element, and calls `on<Name><Event>` for the **first mounted instance** that matches.
133
+ - A child inserted later needs no new binding.
134
+ - Events that do not bubble, `mouseenter` and `mouseleave` included, are delegated from the **capture** phase.
135
+
136
+ **`config.components` is what disambiguates the name**
137
+
138
+ A method name alone is ambiguous: `onSliderDragStart` is `SliderDrag` + `start`, or `Slider` + `drag-start`. The name set from `config.components` is what decides. A child that is not declared there is not resolved.
139
+
140
+ A lazy child works the same way — the string key is the name, so nothing is downloaded to resolve a handler:
141
+
142
+ ```js
143
+ static config = {
144
+ name: 'Accordion',
145
+ components: { AccordionItem: () => import('./AccordionItem.js') },
146
+ };
147
+ ```
148
+
149
+ ## Global handlers
150
+
151
+ ```js
152
+ import { Base } from '@studiometa/js-toolkit';
153
+
154
+ class ClickOutside extends Base {
155
+ static config = { name: 'ClickOutside' };
156
+
157
+ onDocumentClick({ event }) {
158
+ if (!event.composedPath().includes(this.$el)) {
159
+ this.$emit('click-outside', { event });
160
+ }
161
+ }
162
+
163
+ onWindowResize() {
164
+ this.$el.removeAttribute('data-option-open');
165
+ }
166
+ }
167
+ ```
168
+
169
+ - **Scope: the mount cycle.** `$unmount()` removes the listener and a new mount binds it again.
170
+ - **Phase: bubble, always.** `onDocumentClick` hears what `document.addEventListener('click', …)` hears. To hear a descendant's non-bubbling event, use `on<Ref><Event>`.
171
+ - **The two prefixes are reserved**, and they match before children and refs. `onWindowResize` binds to `window` even in a component whose `config.components` holds a `Window`. To reach a child with that name, use `@on('Window', 'resize')`.
172
+ - The rule is about method names only. `onClick` and `onDocumentClick` are different names and both can exist; a click on the element fires both.
173
+ - The payload is `{ event, target }`, where `target` is the global the handler names. There is no `payload` and no `index`.
174
+
175
+ ## `$on()` and `$off()`
176
+
177
+ For an event whose name is data rather than a method name, listen by hand and return the cleanup:
178
+
179
+ ```js
180
+ import { Base } from '@studiometa/js-toolkit';
181
+
182
+ class Watcher extends Base {
183
+ static config = { name: 'Watcher', options: { events: Array } };
184
+
185
+ mounted() {
186
+ // `$on()` returns its own remover.
187
+ return this.$options.events.map((type) => this.$on(type, () => console.log(type)));
188
+ }
189
+ }
190
+ ```
191
+
192
+ ## Negotiated events
193
+
194
+ Two helpers let a component announce a step **before** it happens so an ancestor can take part. They are not `Base` methods and they are absent from `$emits`:
195
+
196
+ | mode | asks for | registers with | keeps | on failure |
197
+ | ------------- | ---------- | -------------- | --------------------- | ------------------------------ |
198
+ | **take over** | the action | `wrap(runner)` | one runner, last wins | the mutation is applied anyway |
199
+ | **delay** | the moment | `waitUntil(x)` | many, all are awaited | the step happens anyway |
200
+
201
+ ```js
202
+ import { Base, EVENTS, domUpdate, emitExtendable, viewTransition } from '@studiometa/js-toolkit';
203
+
204
+ class Panel extends Base {
205
+ static config = { name: 'Panel' };
206
+
207
+ // Take over: the code that mutates announces instead of mutating.
208
+ async render(fragment) {
209
+ await domUpdate(this.$el, () => this.$el.replaceChildren(fragment));
210
+ }
211
+
212
+ // Delay: the choreography announces its step and waits.
213
+ async close() {
214
+ await emitExtendable(this.$el, 'close');
215
+ this.$el.removeAttribute('data-option-open');
216
+ }
217
+
218
+ mounted() {
219
+ return [
220
+ this.$on(EVENTS.dom.update, (event) => event.detail.wrap(viewTransition)),
221
+ this.$on('close', (event) => event.detail.waitUntil(this.leave())),
222
+ ];
223
+ }
224
+
225
+ leave() {
226
+ return Promise.resolve();
227
+ }
228
+ }
229
+ ```
230
+
231
+ - **`defaultPrevented` is ignored.** The step is announced, not proposed.
232
+ - **A registration is valid only while the event dispatches.** A listener that keeps the function and calls it later is warned (`protocol.late-registration`) and ignored.
233
+ - **The work of the emitter always completes.** A runner that throws, rejects, or never calls `apply` loses the animation, never the change.
234
+ - **An unclaimed `domUpdate()` is synchronous.** With no listener the mutation runs before the returned promise exists.
235
+
236
+ See [`domUpdate()`](../../api/dom/domUpdate.md) and [`emitExtendable()`](../../api/dom/emitExtendable.md).
237
+
238
+ ## Framework events
239
+
240
+ `EVENTS` is a deeply frozen object of the events the framework itself dispatches, all namespaced `js-toolkit:`:
241
+
242
+ ```js
243
+ import { EVENTS } from '@studiometa/js-toolkit';
244
+
245
+ EVENTS.component.mounted; // 'js-toolkit:component:mounted'
246
+ EVENTS.component.unmounted; // 'js-toolkit:component:unmounted'
247
+ EVENTS.dom.update; // 'js-toolkit:dom:update'
248
+ EVENTS.diagnostic; // 'js-toolkit:diagnostic'
249
+ ```
250
+
251
+ Component events are typed lower-kebab string literals declared through `$emits`. Private framework transports — the context request, for one — use module-local constants and are deliberately **not** in `EVENTS`.
@@ -0,0 +1,373 @@
1
+ # Migrating from v3 to v4
2
+
3
+ v4 is a full breaking major. There is no bridge release and no compatibility layer: `@studiometa/js-toolkit` 4.0 and `@studiometa/ui` 2.0 ship together.
4
+
5
+ Migration help is tooling, not runtime shims. Lint rules flag `$children`, `$parent`, `updated()` and the old handler signatures, and codemods cover mechanical renames only.
6
+
7
+ ## The component tree
8
+
9
+ ### `$parent`, `$children` and `$root` are removed
10
+
11
+ Parent and child are DOM ancestry, never ownership, so nothing holds a reference in either direction.
12
+
13
+ ```js
14
+ this.$children.SliderItem; // [!code --]
15
+ this.$query('SliderItem'); // [!code ++]
16
+
17
+ this.$parent.goTo(index); // [!code --]
18
+ this.$closest('Slider')?.goTo(index); // [!code ++]
19
+
20
+ this.$root.doSomething(); // [!code --]
21
+ this.$closest('App')?.doSomething(); // [!code ++]
22
+ ```
23
+
24
+ `$query(name)` returns a flat `Base[]` of all matching descendants, at any depth — not the keyed object `$children` was. `$closest(name)` is resolved on every access and returns `Base | null`, so guard it and never dereference it unguarded in `mounted()`.
25
+
26
+ Better than either: a parent watches its children, and a child emits.
27
+
28
+ ```js
29
+ items = this.$watchChildren('SliderItem'); // [!code ++]
30
+ ```
31
+
32
+ ### `createApp()` is removed
33
+
34
+ There is no root component and no application object.
35
+
36
+ ```js
37
+ createApp(App); // [!code --]
38
+ registerComponents(Accordion, Slider, TodoList); // [!code ++]
39
+ ```
40
+
41
+ A component is registered, not mounted by a parent, so nothing has to own the page.
42
+
43
+ ### `ChildrenManager` is gone
44
+
45
+ A nested `data-component` is discovered by the registry on its own. `config.components` still exists, but it now declares a **family** — it registers those names and supplies the name set that `on<Child><Event>` resolution needs. It does not construct anything.
46
+
47
+ Unmounting a parent no longer unmounts its children.
48
+
49
+ ## Refs
50
+
51
+ ### `$update()` is removed
52
+
53
+ Refs are live: each `$refs` property reads the DOM on access.
54
+
55
+ ```js
56
+ this.$refs.list.append(li);
57
+ this.$update(); // [!code --]
58
+ console.log(this.$refs.items.length); // already correct
59
+ ```
60
+
61
+ ### A list ref keeps the `[]` in the attribute
62
+
63
+ ```html
64
+ <li data-ref="items"></li>
65
+ <!-- [!code --] -->
66
+ <li data-ref="items[]"></li>
67
+ <!-- [!code ++] -->
68
+ ```
69
+
70
+ `config.refs: ['items[]']` matches `data-ref="items[]"` **and nothing else**. The mismatch gives a `ref.mismatch` warning naming both spellings.
71
+
72
+ The property name never carries the suffix: `$refs.items`, `onItemsClick`, `@on('items[]', 'click')`.
73
+
74
+ ## Options
75
+
76
+ ### `$options` is read-only
77
+
78
+ Every property is a getter with no setter, so an assignment throws.
79
+
80
+ ```js
81
+ this.$options.open = true; // [!code --]
82
+ this.$el.setAttribute('data-option-open', ''); // [!code ++]
83
+ ```
84
+
85
+ Or keep a private field, when the value was never an input:
86
+
87
+ ```js
88
+ #isOpen = this.$options.open; // [!code ++]
89
+ ```
90
+
91
+ ### A boolean option reads presence
92
+
93
+ The attribute's value is never read.
94
+
95
+ ```html
96
+ <div data-option-open="false"></div>
97
+ <!-- v3: false · v4: true -->
98
+ ```
99
+
100
+ Turn one off by removing the attribute, or — for an option declared `default: true` — with the negated spelling:
101
+
102
+ ```html
103
+ <div data-component="Dialog" data-option-no-trap-focus></div>
104
+ ```
105
+
106
+ Templates must write the attribute conditionally rather than interpolate a boolean into it.
107
+
108
+ ### Non-primitive defaults must be factories
109
+
110
+ ```js
111
+ options: {
112
+ tween: { type: Object, default: { ease: 'linear' } }, // [!code --]
113
+ tween: { type: Object, default: () => ({ ease: 'linear' }) }, // [!code ++]
114
+ }
115
+ ```
116
+
117
+ A literal gives an `option.literal-default` warning, and the value is then shared between instances.
118
+
119
+ ### Responsive options lose the list syntax
120
+
121
+ Every option is responsive with nothing to declare. `withResponsiveOptions` is gone, and so is the set spelling.
122
+
123
+ ```html
124
+ <div data-option-columns:xs:s="2"></div>
125
+ <!-- [!code --] -->
126
+ <div data-option-columns:xs="2"></div>
127
+ <!-- [!code ++] -->
128
+ ```
129
+
130
+ A suffix names **one** breakpoint and cascades upwards. An unknown suffix warns once per mount.
131
+
132
+ ### `config.emits` is a type now
133
+
134
+ ```js
135
+ static config = { name: 'Slider', emits: ['goto'] }; // [!code --]
136
+ ```
137
+
138
+ ```ts
139
+ class Slider extends Base<{ $emits: { goto: { index: number } } }> {} // [!code ++]
140
+ ```
141
+
142
+ Nothing of it stays in the bundle.
143
+
144
+ ## Events
145
+
146
+ ### `$emit()` takes one payload object
147
+
148
+ ```js
149
+ this.$emit('slide', 1, 'left'); // [!code --]
150
+ this.$emit('slide', { index: 1, direction: 'left' }); // [!code ++]
151
+ ```
152
+
153
+ `detail` **is** that object, and an omitted payload leaves `detail` at the platform value `null`. A value that is not an object is refused by the type and reported as `event.invalid-emit-payload`.
154
+
155
+ ### Handler payloads are one object
156
+
157
+ ```js
158
+ onSliderItemClick(event, index) {} // [!code --]
159
+ onSliderItemClick({ event, target, index }) {} // [!code ++]
160
+ ```
161
+
162
+ - a ref handler receives `{ event, target, index }`, where `target` is the **ref element**, not `event.target`;
163
+ - a child handler receives `{ event, target, payload }`, where `target` is the **instance**;
164
+ - a global handler receives `{ event, target }`, with no `payload` and no `index`.
165
+
166
+ ### `onWindow<Event>` and `onDocument<Event>` are reserved prefixes
167
+
168
+ They match before children and refs. To reach a child named `Window`, use `@on('Window', 'resize')`.
169
+
170
+ ## Lifecycle
171
+
172
+ ### `updated()` is removed
173
+
174
+ There is no third lifecycle notion. Use [`option<Name>Changed()`](../introduction/managing-options.md#live-effects) for an option that chooses a resource, and [`watchAttributes()`](../../api/dom/watchAttributes.md) for an attribute the framework does not read.
175
+
176
+ ### `mounted()` can return its cleanup
177
+
178
+ ```js
179
+ mounted() {
180
+ this.unsubscribe = useScroll().subscribe(this.onScroll); // [!code --]
181
+ return useScroll().subscribe(this.onScroll); // [!code ++]
182
+ }
183
+
184
+ unmounted() {
185
+ this.unsubscribe(); // [!code --]
186
+ }
187
+ ```
188
+
189
+ Sync or async, a function or an array of functions. An async `mounted()` that resolves after the unmount runs its cleanup immediately.
190
+
191
+ ### `terminated` and the permanent state are gone
192
+
193
+ `$unmount()` leaves the instance on its element, so "do this once per element" is a plain field:
194
+
195
+ ```js
196
+ mounted() {
197
+ if (this.hasLoaded) return;
198
+ …
199
+ this.hasLoaded = true;
200
+ }
201
+ ```
202
+
203
+ ## Loading and mounting
204
+
205
+ ### `data-load` becomes `data-mount`
206
+
207
+ Deferring the import and deferring the mount are one decision.
208
+
209
+ ```html
210
+ <div data-component="Map" data-load="visible"></div>
211
+ <!-- [!code --] -->
212
+ <div data-component="Map" data-mount="visible"></div>
213
+ <!-- [!code ++] -->
214
+ ```
215
+
216
+ ### The `withMountWhen*` decorators are deleted
217
+
218
+ | v3 | v4 |
219
+ | --------------------------------------------------- | ------------------------------------------------------------ |
220
+ | `withMountWhenInView(Base)` | `data-mount="visible"` or `config.mountStrategy` |
221
+ | `withMountOnMediaQuery(Base, '(min-width: 48rem)')` | `data-mount="media:(min-width: 48rem)"` |
222
+ | `withMountWhenPrefersMotion(Base)` | `data-mount="media:(prefers-reduced-motion: no-preference)"` |
223
+
224
+ A strategy constructs nothing; it decides when the registry calls the mount and unmount hooks. See [Mount strategies](../going-further/mount-strategies.md).
225
+
226
+ ### The lazy import helpers are replaced by the manifest
227
+
228
+ `importWhenVisible`, `importWhenIdle`, `importOnInteraction`, `importOnMediaQuery` and `importWhenPrefersMotion` are gone. One entry carries both halves:
229
+
230
+ ```js
231
+ registerManifest({
232
+ Map: { load: () => import('./Map.js'), mountStrategy: 'visible' },
233
+ });
234
+ ```
235
+
236
+ `readEagerTokens` and `<meta name="js-toolkit:eager">` are not ported — `data-mount` on the element says the same thing.
237
+
238
+ ### `<tk-name>` and arbitrary selectors are removed
239
+
240
+ Only plain and configured scoped `data-component` declarations are discovered. `data-component` still works on native elements.
241
+
242
+ ## Configuration and composition
243
+
244
+ ### `withExtraConfig()` is removed
245
+
246
+ `$config` merges along the prototype chain, so declare a class:
247
+
248
+ ```js
249
+ const Compact = withExtraConfig(Vendor, { options: { compact: Boolean } }); // [!code --]
250
+ ```
251
+
252
+ ```js
253
+ registerComponent(
254
+ // [!code ++]
255
+ class extends Vendor {
256
+ // [!code ++]
257
+ static config = { name: 'CompactVendor', options: { compact: Boolean } }; // [!code ++]
258
+ }, // [!code ++]
259
+ ); // [!code ++]
260
+ ```
261
+
262
+ `refs`, `options` and `components` merge; scalar keys stay overridable by the most derived class.
263
+
264
+ ### `withGroup` is removed
265
+
266
+ Use `provideRootContext()` for page state, and `createGroup()` with provide/inject for a scoped set of peers. See [Shared state](../going-further/sharing-state.md).
267
+
268
+ ### `defineFeatures()` is removed
269
+
270
+ Breakpoints are set with `setBreakpoints()`. The attribute names and the prefix are not configurable.
271
+
272
+ ## Services
273
+
274
+ ### `LoadService` is not ported
275
+
276
+ ### Props are flat
277
+
278
+ The grouped objects are gone, and so are the derived fields.
279
+
280
+ ```js
281
+ scrolled({ y, changed, direction, max, progress }) {} // [!code --]
282
+ scrolled({ y, deltaY, maxY, progressY, directionY, isScrolling }) {} // [!code ++]
283
+ ```
284
+
285
+ - `lastX` is `x - deltaX`; `changedX` is `deltaX !== 0`.
286
+ - `directionX` and `directionY` are `-1 | 0 | 1`, one signed value that multiplies.
287
+ - `ResizeService` keeps `width`, `height`, `ratio` and `orientation`, and drops `breakpoints` and `activeBreakpoints`.
288
+ - `DragService` drops `isGrabbing`, `hasInertia`, `target` and `props.MODES`, fixes the `dragTreshold` spelling, and gains an `idle` mode.
289
+ - `PointerService` uses pointer events only and follows one `pointerId` at a time.
290
+ - **Every prop field is `readonly`, and the props object belongs to its service.** Use `{ ...props }` to keep one.
291
+
292
+ ### Services are scoped to a target
293
+
294
+ ```js
295
+ useScroll(); // the document element
296
+ useWindowScroll(); // the same, named
297
+ useScroll(this.$refs.panel); // a region
298
+ ```
299
+
300
+ `useKey()` takes a target too, which is what removes the `hasFocus` bookkeeping a document-only service forced on a consumer. Its named key booleans are resolved from `KeyboardEvent.key` rather than the deprecated `keyCode`, and `triggered` now counts repeats of **one** key.
301
+
302
+ ### A mixin never occupies a lifecycle hook
303
+
304
+ `withRaf`, `withScroll` and friends override `$mount()`/`$unmount()`, not `mounted()`. A class that mixes a service in and writes its own `mounted()` **without** `super.mounted()` still subscribes.
305
+
306
+ `hook` options are gone: one method name per mixin, and it is the name of the service. Any other target is an explicit `subscribe()` in `mounted()`.
307
+
308
+ ## Scheduling and animation
309
+
310
+ ### One scheduler replaces three
311
+
312
+ `domScheduler`, the `RafService` loop, `SmartQueue` and the view-transition scheduler are one frame-aligned scheduler. `this.$read()` and `this.$write()` tie tasks to the instance.
313
+
314
+ **`afterWrite` is removed.** rAF callbacks run before style, layout and paint, so no phase inside the frame can read post-layout geometry. Measure in the next frame's `read` phase, or use a `ResizeObserver`.
315
+
316
+ ### `tween` and `animate` are not shipped
317
+
318
+ Time-based playback, stagger, sequencing, morphing and text splitting move to a separate `ui-animation` package, with Motion as declarative components and GSAP as a lifecycle-and-scoping decorator.
319
+
320
+ `exit`, `layout` and `layoutId` are not an engine's job — native view transitions solve them, and [`viewTransition()`](../../api/scheduler/viewTransition.md) is in core.
321
+
322
+ What was promoted into core instead: `transition` with `enterTransition` and `leaveTransition`, the easing functions, `spring()` and `smoothTo()`.
323
+
324
+ ### `damp()` takes the elapsed time
325
+
326
+ ```js
327
+ damp(current, target, 0.1); // [!code --]
328
+ damp(current, target, 0.1, delta); // [!code ++]
329
+ ```
330
+
331
+ `factor` is the fraction of the gap that closes per reference frame, which makes it stable for every value a caller can pass. Decay is expressed in time, not in frames.
332
+
333
+ ### `scrollTo()` splits in two
334
+
335
+ `scrollPosition()` measures and returns; `scrollTo()` calls it and moves. A carousel that asks which slide is nearest no longer has to scroll to find out.
336
+
337
+ ## Diagnostics
338
+
339
+ `EVENTS.error`, `ToolkitErrorDetail` and `ToolkitErrorStage` are removed with **no alias**:
340
+
341
+ ```js
342
+ document.addEventListener(EVENTS.error, …); // [!code --]
343
+ document.addEventListener(EVENTS.diagnostic, …); // [!code ++]
344
+ ```
345
+
346
+ The detail now carries `severity`, `code`, `message`, an optional `component`, and — for an error only — the original caught value as `error`. See [Diagnostics](../going-further/handling-diagnostics.md).
347
+
348
+ ## What is not promoted to core
349
+
350
+ `Action`, `SafeAction`, `Fetch`, `Transition` and the `Data*` family stay out of core. Core keeps general primitives only; those components belong to `@studiometa/ui`.
351
+
352
+ ## Removal checklist
353
+
354
+ | Removed | Replacement |
355
+ | --------------------------------- | ---------------------------------------------- |
356
+ | `$parent`, `$children`, `$root` | `$closest()`, `$query()`, `$watchChildren()` |
357
+ | `createApp()` | `registerComponent()` / `registerComponents()` |
358
+ | `$update()` | nothing — refs are live |
359
+ | `updated()` | `option<Name>Changed()`, `watchAttributes()` |
360
+ | `config.emits` | the `$emits` props type |
361
+ | `withExtraConfig()` | a subclass |
362
+ | `withGroup` | `provideRootContext()`, `createGroup()` |
363
+ | `withResponsiveOptions` | nothing — every option is responsive |
364
+ | `withMountWhenInView` and friends | mount strategies |
365
+ | `data-load`, `loadStrategy` | `data-mount` |
366
+ | the `importWhen*` helpers | `registerManifest()` entries |
367
+ | `defineFeatures()` | `setBreakpoints()` |
368
+ | `LoadService` | — |
369
+ | `domScheduler`, `SmartQueue` | `defaultScheduler` |
370
+ | `afterWrite` | the next frame's `read`, or a `ResizeObserver` |
371
+ | `tween`, `animate` | the `ui-animation` package |
372
+ | `EVENTS.error` | `EVENTS.diagnostic` |
373
+ | `<tk-name>`, arbitrary selectors | `data-component` |