ember-primitives 0.40.0 → 0.42.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (298) hide show
  1. package/README.md +91 -0
  2. package/declarations/-private.d.ts +1 -0
  3. package/declarations/-private.d.ts.map +1 -0
  4. package/declarations/color-scheme.d.ts +1 -0
  5. package/declarations/color-scheme.d.ts.map +1 -0
  6. package/declarations/components/-private/typed-elements.d.ts +1 -0
  7. package/declarations/components/-private/typed-elements.d.ts.map +1 -0
  8. package/declarations/components/-private/utils.d.ts +1 -0
  9. package/declarations/components/-private/utils.d.ts.map +1 -0
  10. package/declarations/components/accordion/content.d.ts +1 -0
  11. package/declarations/components/accordion/content.d.ts.map +1 -0
  12. package/declarations/components/accordion/header.d.ts +1 -0
  13. package/declarations/components/accordion/header.d.ts.map +1 -0
  14. package/declarations/components/accordion/item.d.ts +1 -0
  15. package/declarations/components/accordion/item.d.ts.map +1 -0
  16. package/declarations/components/accordion/public.d.ts +1 -0
  17. package/declarations/components/accordion/public.d.ts.map +1 -0
  18. package/declarations/components/accordion/trigger.d.ts +1 -0
  19. package/declarations/components/accordion/trigger.d.ts.map +1 -0
  20. package/declarations/components/accordion.d.ts +1 -0
  21. package/declarations/components/accordion.d.ts.map +1 -0
  22. package/declarations/components/avatar.d.ts +1 -0
  23. package/declarations/components/avatar.d.ts.map +1 -0
  24. package/declarations/components/dialog.d.ts +1 -0
  25. package/declarations/components/dialog.d.ts.map +1 -0
  26. package/declarations/components/external-link.d.ts +1 -0
  27. package/declarations/components/external-link.d.ts.map +1 -0
  28. package/declarations/components/form.d.ts +1 -0
  29. package/declarations/components/form.d.ts.map +1 -0
  30. package/declarations/components/keys.d.ts +1 -0
  31. package/declarations/components/keys.d.ts.map +1 -0
  32. package/declarations/components/layout/hero.d.ts +1 -0
  33. package/declarations/components/layout/hero.d.ts.map +1 -0
  34. package/declarations/components/layout/sticky-footer.d.ts +1 -0
  35. package/declarations/components/layout/sticky-footer.d.ts.map +1 -0
  36. package/declarations/components/link.d.ts +1 -0
  37. package/declarations/components/link.d.ts.map +1 -0
  38. package/declarations/components/menu.d.ts +1 -0
  39. package/declarations/components/menu.d.ts.map +1 -0
  40. package/declarations/components/one-time-password/buttons.d.ts +1 -0
  41. package/declarations/components/one-time-password/buttons.d.ts.map +1 -0
  42. package/declarations/components/one-time-password/index.d.ts +1 -0
  43. package/declarations/components/one-time-password/index.d.ts.map +1 -0
  44. package/declarations/components/one-time-password/input.d.ts +1 -0
  45. package/declarations/components/one-time-password/input.d.ts.map +1 -0
  46. package/declarations/components/one-time-password/otp.d.ts +1 -0
  47. package/declarations/components/one-time-password/otp.d.ts.map +1 -0
  48. package/declarations/components/one-time-password/utils.d.ts +1 -0
  49. package/declarations/components/one-time-password/utils.d.ts.map +1 -0
  50. package/declarations/components/popover.d.ts +1 -0
  51. package/declarations/components/popover.d.ts.map +1 -0
  52. package/declarations/components/portal-targets.d.ts +1 -0
  53. package/declarations/components/portal-targets.d.ts.map +1 -0
  54. package/declarations/components/portal.d.ts +1 -0
  55. package/declarations/components/portal.d.ts.map +1 -0
  56. package/declarations/components/progress.d.ts +1 -0
  57. package/declarations/components/progress.d.ts.map +1 -0
  58. package/declarations/components/rating/index.d.ts +1 -0
  59. package/declarations/components/rating/index.d.ts.map +1 -0
  60. package/declarations/components/rating/public-types.d.ts +1 -0
  61. package/declarations/components/rating/public-types.d.ts.map +1 -0
  62. package/declarations/components/rating/range.d.ts +1 -0
  63. package/declarations/components/rating/range.d.ts.map +1 -0
  64. package/declarations/components/rating/stars.d.ts +1 -0
  65. package/declarations/components/rating/stars.d.ts.map +1 -0
  66. package/declarations/components/rating/state.d.ts +1 -0
  67. package/declarations/components/rating/state.d.ts.map +1 -0
  68. package/declarations/components/rating/utils.d.ts +1 -0
  69. package/declarations/components/rating/utils.d.ts.map +1 -0
  70. package/declarations/components/rating.d.ts +1 -0
  71. package/declarations/components/rating.d.ts.map +1 -0
  72. package/declarations/components/scroller.d.ts +1 -0
  73. package/declarations/components/scroller.d.ts.map +1 -0
  74. package/declarations/components/shadowed.d.ts +1 -0
  75. package/declarations/components/shadowed.d.ts.map +1 -0
  76. package/declarations/components/switch.d.ts +1 -0
  77. package/declarations/components/switch.d.ts.map +1 -0
  78. package/declarations/components/tabs.d.ts +233 -0
  79. package/declarations/components/tabs.d.ts.map +1 -0
  80. package/declarations/components/toggle-group.d.ts +1 -0
  81. package/declarations/components/toggle-group.d.ts.map +1 -0
  82. package/declarations/components/toggle.d.ts +1 -0
  83. package/declarations/components/toggle.d.ts.map +1 -0
  84. package/declarations/components/violations.css.d.ts +2 -0
  85. package/declarations/components/violations.css.d.ts.map +1 -0
  86. package/declarations/components/visually-hidden.d.ts +1 -0
  87. package/declarations/components/visually-hidden.d.ts.map +1 -0
  88. package/declarations/components/zoetrope/index.d.ts +1 -0
  89. package/declarations/components/zoetrope/index.d.ts.map +1 -0
  90. package/declarations/components/zoetrope/types.d.ts +1 -0
  91. package/declarations/components/zoetrope/types.d.ts.map +1 -0
  92. package/declarations/components/zoetrope.d.ts +1 -0
  93. package/declarations/components/zoetrope.d.ts.map +1 -0
  94. package/declarations/dom-context.d.ts +1 -0
  95. package/declarations/dom-context.d.ts.map +1 -0
  96. package/declarations/floating-ui/component.d.ts +1 -0
  97. package/declarations/floating-ui/component.d.ts.map +1 -0
  98. package/declarations/floating-ui/middleware.d.ts +1 -0
  99. package/declarations/floating-ui/middleware.d.ts.map +1 -0
  100. package/declarations/floating-ui/modifier.d.ts +1 -0
  101. package/declarations/floating-ui/modifier.d.ts.map +1 -0
  102. package/declarations/floating-ui.d.ts +1 -0
  103. package/declarations/floating-ui.d.ts.map +1 -0
  104. package/declarations/head.d.ts +1 -0
  105. package/declarations/head.d.ts.map +1 -0
  106. package/declarations/helpers/body-class.d.ts +1 -0
  107. package/declarations/helpers/body-class.d.ts.map +1 -0
  108. package/declarations/helpers/link.d.ts +1 -0
  109. package/declarations/helpers/link.d.ts.map +1 -0
  110. package/declarations/helpers/service.d.ts +1 -0
  111. package/declarations/helpers/service.d.ts.map +1 -0
  112. package/declarations/helpers.d.ts +1 -0
  113. package/declarations/helpers.d.ts.map +1 -0
  114. package/declarations/iframe.d.ts +1 -0
  115. package/declarations/iframe.d.ts.map +1 -0
  116. package/declarations/index.d.ts +1 -0
  117. package/declarations/index.d.ts.map +1 -0
  118. package/declarations/load.d.ts +1 -0
  119. package/declarations/load.d.ts.map +1 -0
  120. package/declarations/narrowing.d.ts +1 -0
  121. package/declarations/narrowing.d.ts.map +1 -0
  122. package/declarations/on-resize.d.ts +2 -12
  123. package/declarations/on-resize.d.ts.map +1 -0
  124. package/declarations/proper-links.d.ts +1 -0
  125. package/declarations/proper-links.d.ts.map +1 -0
  126. package/declarations/qp.d.ts +1 -0
  127. package/declarations/qp.d.ts.map +1 -0
  128. package/declarations/resize-observer.d.ts +52 -0
  129. package/declarations/resize-observer.d.ts.map +1 -0
  130. package/declarations/store.d.ts +1 -0
  131. package/declarations/store.d.ts.map +1 -0
  132. package/declarations/styles.css.d.ts +1 -0
  133. package/declarations/styles.css.d.ts.map +1 -0
  134. package/declarations/tabster.d.ts +1 -0
  135. package/declarations/tabster.d.ts.map +1 -0
  136. package/declarations/template-registry.d.ts +1 -0
  137. package/declarations/template-registry.d.ts.map +1 -0
  138. package/declarations/test-support/a11y.d.ts +1 -0
  139. package/declarations/test-support/a11y.d.ts.map +1 -0
  140. package/declarations/test-support/index.d.ts +1 -0
  141. package/declarations/test-support/index.d.ts.map +1 -0
  142. package/declarations/test-support/otp.d.ts +1 -0
  143. package/declarations/test-support/otp.d.ts.map +1 -0
  144. package/declarations/test-support/rating.d.ts +1 -0
  145. package/declarations/test-support/rating.d.ts.map +1 -0
  146. package/declarations/test-support/routing.d.ts +1 -0
  147. package/declarations/test-support/routing.d.ts.map +1 -0
  148. package/declarations/test-support/zoetrope.d.ts +1 -0
  149. package/declarations/test-support/zoetrope.d.ts.map +1 -0
  150. package/declarations/type-utils.d.ts +1 -0
  151. package/declarations/type-utils.d.ts.map +1 -0
  152. package/declarations/utils.d.ts +25 -0
  153. package/declarations/utils.d.ts.map +1 -0
  154. package/dist/-private.js +1 -0
  155. package/dist/-private.js.map +1 -1
  156. package/dist/color-scheme.js +1 -0
  157. package/dist/color-scheme.js.map +1 -1
  158. package/dist/components/-private/typed-elements.js +1 -0
  159. package/dist/components/-private/typed-elements.js.map +1 -1
  160. package/dist/components/-private/utils.js +1 -0
  161. package/dist/components/-private/utils.js.map +1 -1
  162. package/dist/components/accordion/content.js +2 -1
  163. package/dist/components/accordion/content.js.map +1 -1
  164. package/dist/components/accordion/header.js +2 -1
  165. package/dist/components/accordion/header.js.map +1 -1
  166. package/dist/components/accordion/item.js +2 -1
  167. package/dist/components/accordion/item.js.map +1 -1
  168. package/dist/components/accordion/trigger.js +2 -1
  169. package/dist/components/accordion/trigger.js.map +1 -1
  170. package/dist/components/accordion.js +2 -1
  171. package/dist/components/accordion.js.map +1 -1
  172. package/dist/components/avatar.js +1 -0
  173. package/dist/components/avatar.js.map +1 -1
  174. package/dist/components/dialog.js +1 -0
  175. package/dist/components/dialog.js.map +1 -1
  176. package/dist/components/external-link.js +1 -0
  177. package/dist/components/external-link.js.map +1 -1
  178. package/dist/components/form.js +1 -0
  179. package/dist/components/form.js.map +1 -1
  180. package/dist/components/keys.js +1 -0
  181. package/dist/components/keys.js.map +1 -1
  182. package/dist/components/layout/hero.js +3 -1
  183. package/dist/components/layout/hero.js.map +1 -1
  184. package/dist/components/layout/sticky-footer.js +3 -1
  185. package/dist/components/layout/sticky-footer.js.map +1 -1
  186. package/dist/components/link.js +1 -0
  187. package/dist/components/link.js.map +1 -1
  188. package/dist/components/menu.js +1 -0
  189. package/dist/components/menu.js.map +1 -1
  190. package/dist/components/one-time-password/buttons.js +1 -0
  191. package/dist/components/one-time-password/buttons.js.map +1 -1
  192. package/dist/components/one-time-password/index.js +1 -0
  193. package/dist/components/one-time-password/index.js.map +1 -1
  194. package/dist/components/one-time-password/input.js +1 -0
  195. package/dist/components/one-time-password/input.js.map +1 -1
  196. package/dist/components/one-time-password/otp.js +1 -0
  197. package/dist/components/one-time-password/otp.js.map +1 -1
  198. package/dist/components/one-time-password/utils.js +1 -0
  199. package/dist/components/one-time-password/utils.js.map +1 -1
  200. package/dist/components/popover.js +1 -0
  201. package/dist/components/popover.js.map +1 -1
  202. package/dist/components/portal-targets.js +1 -0
  203. package/dist/components/portal-targets.js.map +1 -1
  204. package/dist/components/portal.js +1 -0
  205. package/dist/components/portal.js.map +1 -1
  206. package/dist/components/progress.js +1 -0
  207. package/dist/components/progress.js.map +1 -1
  208. package/dist/components/rating/index.js +1 -0
  209. package/dist/components/rating/index.js.map +1 -1
  210. package/dist/components/rating/range.js +1 -0
  211. package/dist/components/rating/range.js.map +1 -1
  212. package/dist/components/rating/stars.js +1 -0
  213. package/dist/components/rating/stars.js.map +1 -1
  214. package/dist/components/rating/state.js +1 -0
  215. package/dist/components/rating/state.js.map +1 -1
  216. package/dist/components/rating/utils.js +1 -0
  217. package/dist/components/rating/utils.js.map +1 -1
  218. package/dist/components/rating.js +1 -0
  219. package/dist/components/scroller.js +1 -0
  220. package/dist/components/scroller.js.map +1 -1
  221. package/dist/components/shadowed.js +1 -0
  222. package/dist/components/shadowed.js.map +1 -1
  223. package/dist/components/switch.js +1 -0
  224. package/dist/components/switch.js.map +1 -1
  225. package/dist/components/tabs.js +218 -0
  226. package/dist/components/tabs.js.map +1 -0
  227. package/dist/components/toggle-group.js +1 -0
  228. package/dist/components/toggle-group.js.map +1 -1
  229. package/dist/components/toggle.js +1 -0
  230. package/dist/components/toggle.js.map +1 -1
  231. package/dist/components/violations.css.js +3 -0
  232. package/dist/components/violations.css.js.map +1 -0
  233. package/dist/components/visually-hidden.js +2 -1
  234. package/dist/components/visually-hidden.js.map +1 -1
  235. package/dist/components/zoetrope/index.js +3 -1
  236. package/dist/components/zoetrope/index.js.map +1 -1
  237. package/dist/components/zoetrope.js +1 -0
  238. package/dist/dom-context.js +2 -1
  239. package/dist/dom-context.js.map +1 -1
  240. package/dist/floating-ui/component.js +1 -0
  241. package/dist/floating-ui/component.js.map +1 -1
  242. package/dist/floating-ui/middleware.js +1 -0
  243. package/dist/floating-ui/middleware.js.map +1 -1
  244. package/dist/floating-ui/modifier.js +1 -0
  245. package/dist/floating-ui/modifier.js.map +1 -1
  246. package/dist/floating-ui.js +1 -0
  247. package/dist/floating-ui.js.map +1 -1
  248. package/dist/head.js +1 -0
  249. package/dist/head.js.map +1 -1
  250. package/dist/helpers/body-class.js +1 -0
  251. package/dist/helpers/body-class.js.map +1 -1
  252. package/dist/helpers/link.js +1 -0
  253. package/dist/helpers/link.js.map +1 -1
  254. package/dist/helpers/service.js +1 -0
  255. package/dist/helpers/service.js.map +1 -1
  256. package/dist/helpers.js +1 -0
  257. package/dist/helpers.js.map +1 -1
  258. package/dist/iframe.js +1 -0
  259. package/dist/iframe.js.map +1 -1
  260. package/dist/index.js +1 -0
  261. package/dist/index.js.map +1 -1
  262. package/dist/{item-D6pwWzMs.js → item-CwIzoqlC.js} +2 -1
  263. package/dist/item-CwIzoqlC.js.map +1 -0
  264. package/dist/load.js +1 -0
  265. package/dist/load.js.map +1 -1
  266. package/dist/narrowing.js +1 -0
  267. package/dist/narrowing.js.map +1 -1
  268. package/dist/on-resize.js +5 -88
  269. package/dist/on-resize.js.map +1 -1
  270. package/dist/proper-links.js +1 -0
  271. package/dist/proper-links.js.map +1 -1
  272. package/dist/qp.js +1 -0
  273. package/dist/qp.js.map +1 -1
  274. package/dist/resize-observer.js +113 -0
  275. package/dist/resize-observer.js.map +1 -0
  276. package/dist/store.js +1 -0
  277. package/dist/store.js.map +1 -1
  278. package/dist/styles.css.js +2 -1
  279. package/dist/tabster.js +1 -0
  280. package/dist/tabster.js.map +1 -1
  281. package/dist/test-support/a11y.js +1 -0
  282. package/dist/test-support/a11y.js.map +1 -1
  283. package/dist/test-support/index.js +1 -0
  284. package/dist/test-support/index.js.map +1 -1
  285. package/dist/test-support/otp.js +1 -0
  286. package/dist/test-support/otp.js.map +1 -1
  287. package/dist/test-support/rating.js +1 -0
  288. package/dist/test-support/rating.js.map +1 -1
  289. package/dist/test-support/routing.js +1 -0
  290. package/dist/test-support/routing.js.map +1 -1
  291. package/dist/test-support/zoetrope.js +1 -0
  292. package/dist/test-support/zoetrope.js.map +1 -1
  293. package/dist/utils.js +47 -1
  294. package/dist/utils.js.map +1 -1
  295. package/dist/visually-hidden-CGP1FSjt.js +3 -0
  296. package/dist/visually-hidden-CGP1FSjt.js.map +1 -0
  297. package/package.json +23 -25
  298. package/dist/item-D6pwWzMs.js.map +0 -1
@@ -0,0 +1,113 @@
1
+
2
+ import { assert } from '@ember/debug';
3
+ import { registerDestructor } from '@ember/destroyable';
4
+ import { createStore } from './store.js';
5
+ import { findOwner } from './utils.js';
6
+
7
+ /**
8
+ * Creates or returns the ResizeObserverManager.
9
+ *
10
+ * Only one of these will exist per owner.
11
+ *
12
+ * Has only two methods:
13
+ * - observe(element, callback: (resizeObserverEntry) => void)
14
+ * - unobserve(element, callback: (resizeObserverEntry) => void)
15
+ *
16
+ * Like with the underlying ResizeObserver API (and all event listeners),
17
+ * the callback passed to unobserved must be the same reference as the one
18
+ * passed to observe.
19
+ */
20
+ function resizeObserver(context) {
21
+ const owner = findOwner(context);
22
+ assert(`Could not find owner on the passed context (to resizeObserver). resizeObserver can only be used on an object whos lifetime is in someone entangled with the application (which incidentally has an "owner").`, owner);
23
+ return createStore(owner, ResizeObserverManager);
24
+ }
25
+ class ResizeObserverManager {
26
+ #callbacks = new WeakMap();
27
+ #handleResize = entries => {
28
+ for (const entry of entries) {
29
+ const callbacks = this.#callbacks.get(entry.target);
30
+ if (callbacks) {
31
+ for (const callback of callbacks) {
32
+ callback(entry);
33
+ }
34
+ }
35
+ }
36
+ };
37
+ #observer = new ResizeObserver(this.#handleResize);
38
+ constructor() {
39
+ ignoreROError();
40
+ registerDestructor(this, () => {
41
+ this.#observer?.disconnect();
42
+ });
43
+ }
44
+
45
+ /**
46
+ * Initiate the observing of the `element` or add an additional `callback`
47
+ * if the `element` is already observed.
48
+ *
49
+ * @param {object} element
50
+ * @param {function} callback The `callback` is called whenever the size of
51
+ * the `element` changes. It is called with `ResizeObserverEntry` object
52
+ * for the particular `element`.
53
+ */
54
+ observe(element, callback) {
55
+ const callbacks = this.#callbacks.get(element);
56
+ if (callbacks) {
57
+ callbacks.add(callback);
58
+ } else {
59
+ this.#callbacks.set(element, new Set([callback]));
60
+ this.#observer.observe(element);
61
+ }
62
+ }
63
+
64
+ /**
65
+ * End the observing of the `element` or just remove the provided `callback`.
66
+ *
67
+ * It will unobserve the `element` if the `callback` is not provided
68
+ * or there are no more callbacks left for this `element`.
69
+ *
70
+ * @param {object} element
71
+ * @param {function?} callback - The `callback` to remove from the listeners
72
+ * of the `element` size changes.
73
+ */
74
+ unobserve(element, callback) {
75
+ const callbacks = this.#callbacks.get(element);
76
+ if (!callbacks) {
77
+ return;
78
+ }
79
+ callbacks.delete(callback);
80
+ if (!callback || !callbacks.size) {
81
+ this.#callbacks.delete(element);
82
+ this.#observer.unobserve(element);
83
+ }
84
+ }
85
+ }
86
+ const errorMessages = ['ResizeObserver loop limit exceeded', 'ResizeObserver loop completed with undelivered notifications.'];
87
+
88
+ /**
89
+ * Ignores "ResizeObserver loop limit exceeded" error in Ember tests.
90
+ *
91
+ * This "error" is safe to ignore as it is just a warning message,
92
+ * telling that the "looping" observation will be skipped in the current frame,
93
+ * and will be delivered in the next one.
94
+ *
95
+ * For some reason, it is fired as an `error` event at `window` failing Ember
96
+ * tests and exploding Sentry with errors that must be ignored.
97
+ */
98
+ function ignoreROError() {
99
+ if (typeof window.onerror !== 'function') {
100
+ return;
101
+ }
102
+ const onError = window.onerror;
103
+ window.onerror = (...args) => {
104
+ const [message] = args;
105
+ if (typeof message === 'string') {
106
+ if (errorMessages.includes(message)) return true;
107
+ }
108
+ onError(...args);
109
+ };
110
+ }
111
+
112
+ export { ignoreROError, resizeObserver };
113
+ //# sourceMappingURL=resize-observer.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"resize-observer.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
package/dist/store.js CHANGED
@@ -1,3 +1,4 @@
1
+
1
2
  import { link } from 'reactiveweb/link';
2
3
  import { isNewable } from './utils.js';
3
4
 
package/dist/store.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"store.js","sources":["../src/store.ts"],"sourcesContent":["import { link } from 'reactiveweb/link';\n\nimport { isNewable } from './utils.ts';\n\nimport type { Newable } from './type-utils.ts';\n\n/**\n * context => { class => instance }\n */\nconst contextCache = new WeakMap<object, Map<object, object>>();\n\n/**\n * Creates a singleton for the given context and links the lifetime of the created class to the passed context\n *\n * Note that this function is _not_ lazy. Calling `createStore` will create an instance of the passed class.\n * When combined with a getter though, creation becomes lazy.\n *\n * In this example, `MyState` is created once per instance of the component.\n * repeat accesses to `this.foo` return a stable reference _as if_ `@cached` were used.\n * ```js\n * class MyState {}\n *\n * class Demo extends Component {\n * // this is a stable reference\n * get foo() {\n * return createStore(this, MyState);\n * }\n *\n * // or\n * bar = createStore(this, MyState);\n *\n * // or\n * three = createStore(this, () => new MyState(1, 2));\n * }\n * ```\n *\n * If arguments need to be configured during construction, the second argument may also be a function\n * ```js\n * class MyState {}\n *\n * class Demo extends Component {\n * // this is a stable reference\n * get foo() {\n * return createStore(this, MyState);\n * }\n * }\n * ```\n */\nexport function createStore<Instance extends object>(\n context: object,\n theClass: Newable<Instance> | (() => Instance)\n): Instance {\n let cache = contextCache.get(context);\n\n if (!cache) {\n cache = new Map();\n contextCache.set(context, cache);\n }\n\n let existing = cache.get(theClass);\n\n if (!existing) {\n const instance = isNewable(theClass) ? new theClass() : theClass();\n\n link(instance, context);\n\n cache.set(theClass, instance);\n existing = instance;\n }\n\n return existing as Instance;\n}\n"],"names":["contextCache","WeakMap","createStore","context","theClass","cache","get","Map","set","existing","instance","isNewable","link"],"mappings":";;;AAMA;AACA;AACA;AACA,MAAMA,YAAY,GAAG,IAAIC,OAAO,EAA+B;;AAE/D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASC,WAAWA,CACzBC,OAAe,EACfC,QAA8C,EACpC;AACV,EAAA,IAAIC,KAAK,GAAGL,YAAY,CAACM,GAAG,CAACH,OAAO,CAAC;EAErC,IAAI,CAACE,KAAK,EAAE;AACVA,IAAAA,KAAK,GAAG,IAAIE,GAAG,EAAE;AACjBP,IAAAA,YAAY,CAACQ,GAAG,CAACL,OAAO,EAAEE,KAAK,CAAC;AAClC,EAAA;AAEA,EAAA,IAAII,QAAQ,GAAGJ,KAAK,CAACC,GAAG,CAACF,QAAQ,CAAC;EAElC,IAAI,CAACK,QAAQ,EAAE;AACb,IAAA,MAAMC,QAAQ,GAAGC,SAAS,CAACP,QAAQ,CAAC,GAAG,IAAIA,QAAQ,EAAE,GAAGA,QAAQ,EAAE;AAElEQ,IAAAA,IAAI,CAACF,QAAQ,EAAEP,OAAO,CAAC;AAEvBE,IAAAA,KAAK,CAACG,GAAG,CAACJ,QAAQ,EAAEM,QAAQ,CAAC;AAC7BD,IAAAA,QAAQ,GAAGC,QAAQ;AACrB,EAAA;AAEA,EAAA,OAAOD,QAAQ;AACjB;;;;"}
1
+ {"version":3,"file":"store.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
@@ -1,2 +1,3 @@
1
- import './components/visually-hidden.css';
1
+
2
+ import './visually-hidden-CGP1FSjt.js';
2
3
  //# sourceMappingURL=styles.css.js.map
package/dist/tabster.js CHANGED
@@ -1,3 +1,4 @@
1
+
1
2
  import { registerDestructor } from '@ember/destroyable';
2
3
 
3
4
  async function setupTabster(
@@ -1 +1 @@
1
- {"version":3,"file":"tabster.js","sources":["../src/tabster.ts"],"sourcesContent":["import { registerDestructor } from '@ember/destroyable';\n\nexport async function setupTabster(\n /**\n * A destroyable object.\n * This is needed so that when the app (or tests) or unmounted or ending,\n * the tabster instance can be disposed of.\n */\n context: object,\n {\n tabster,\n setTabsterRoot,\n }: {\n /**\n * Let this setup function initalize tabster.\n * https://tabster.io/docs/core\n *\n * This should be done only once per application as we don't want\n * focus managers fighting with each other.\n *\n * Defaults to `true`,\n *\n * Will fallback to an existing tabster instance automatically if `getTabster` returns a value.\n *\n * If `false` is explicitly passed here, you'll also be in charge of teardown.\n */\n tabster?: boolean;\n setTabsterRoot?: boolean;\n } = {}\n) {\n const { createTabster, getDeloser, getMover, getTabster, disposeTabster } = await import(\n 'tabster'\n );\n\n tabster ??= true;\n setTabsterRoot ??= true;\n\n if (!tabster) {\n return;\n }\n\n const existing = getTabster(window);\n const primitivesTabster = existing ?? createTabster(window);\n\n getMover(primitivesTabster);\n getDeloser(primitivesTabster);\n\n if (setTabsterRoot) {\n document.body.setAttribute('data-tabster', '{ \"root\": {} }');\n }\n\n registerDestructor(context, () => {\n disposeTabster(primitivesTabster);\n });\n}\n"],"names":["setupTabster","context","tabster","setTabsterRoot","createTabster","getDeloser","getMover","getTabster","disposeTabster","existing","window","primitivesTabster","document","body","setAttribute","registerDestructor"],"mappings":";;AAEO,eAAeA,YAAYA;AAChC;AACF;AACA;AACA;AACA;AACEC,OAAe,EACf;EACEC,OAAO;AACPC,EAAAA;AAiBF,CAAC,GAAG,EAAE,EACN;EACA,MAAM;IAAEC,aAAa;IAAEC,UAAU;IAAEC,QAAQ;IAAEC,UAAU;AAAEC,IAAAA;AAAe,GAAC,GAAG,MAAM,OAChF,SACF,CAAC;AAEDN,EAAAA,OAAO,KAAK,IAAI;AAChBC,EAAAA,cAAc,KAAK,IAAI;EAEvB,IAAI,CAACD,OAAO,EAAE;AACZ,IAAA;AACF,EAAA;AAEA,EAAA,MAAMO,QAAQ,GAAGF,UAAU,CAACG,MAAM,CAAC;AACnC,EAAA,MAAMC,iBAAiB,GAAGF,QAAQ,IAAIL,aAAa,CAACM,MAAM,CAAC;EAE3DJ,QAAQ,CAACK,iBAAiB,CAAC;EAC3BN,UAAU,CAACM,iBAAiB,CAAC;AAE7B,EAAA,IAAIR,cAAc,EAAE;IAClBS,QAAQ,CAACC,IAAI,CAACC,YAAY,CAAC,cAAc,EAAE,gBAAgB,CAAC;AAC9D,EAAA;EAEAC,kBAAkB,CAACd,OAAO,EAAE,MAAM;IAChCO,cAAc,CAACG,iBAAiB,CAAC;AACnC,EAAA,CAAC,CAAC;AACJ;;;;"}
1
+ {"version":3,"file":"tabster.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
@@ -1,3 +1,4 @@
1
+
1
2
  import { assert } from '@ember/debug';
2
3
  import { setupTabster as setupTabster$1 } from '../tabster.js';
3
4
 
@@ -1 +1 @@
1
- {"version":3,"file":"a11y.js","sources":["../../src/test-support/a11y.ts"],"sourcesContent":["import { assert } from '@ember/debug';\n\nimport { setupTabster as _setupTabster } from '../tabster.ts';\n\nimport type Owner from '@ember/owner';\n\n/**\n * Sets up all support utilities for primitive components.\n * Including the tabster root.\n */\nasync function setup(owner: Owner) {\n await _setupTabster(owner, { setTabsterRoot: false });\n\n document.querySelector('#ember-testing')?.setAttribute('data-tabster', '{ \"root\": {} }');\n}\n\nexport function setupTabster(hooks: {\n beforeEach: (callback: () => void | Promise<void>) => unknown;\n}) {\n hooks.beforeEach(async function (this: { owner: object }) {\n const owner = this.owner;\n\n assert(\n `Test does not have an owner, be sure to use setupRenderingTest, setupTest, or setupApplicationTest (from ember-qunit (or similar))`,\n owner\n );\n\n await setup(this.owner as Owner);\n });\n}\n"],"names":["setup","owner","_setupTabster","setTabsterRoot","document","querySelector","setAttribute","setupTabster","hooks","beforeEach","assert"],"mappings":";;;AAMA;AACA;AACA;AACA;AACA,eAAeA,KAAKA,CAACC,KAAY,EAAE;EACjC,MAAMC,cAAa,CAACD,KAAK,EAAE;AAAEE,IAAAA,cAAc,EAAE;AAAM,GAAC,CAAC;EAErDC,QAAQ,CAACC,aAAa,CAAC,gBAAgB,CAAC,EAAEC,YAAY,CAAC,cAAc,EAAE,gBAAgB,CAAC;AAC1F;AAEO,SAASC,YAAYA,CAACC,KAE5B,EAAE;EACDA,KAAK,CAACC,UAAU,CAAC,kBAAyC;AACxD,IAAA,MAAMR,KAAK,GAAG,IAAI,CAACA,KAAK;AAExBS,IAAAA,MAAM,CACJ,CAAA,kIAAA,CAAoI,EACpIT,KACF,CAAC;AAED,IAAA,MAAMD,KAAK,CAAC,IAAI,CAACC,KAAc,CAAC;AAClC,EAAA,CAAC,CAAC;AACJ;;;;"}
1
+ {"version":3,"file":"a11y.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
@@ -1,3 +1,4 @@
1
+
1
2
  export { setupTabster } from './a11y.js';
2
3
  export { fillOTP } from './otp.js';
3
4
  export { rating } from './rating.js';
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;"}
1
+ {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
@@ -1,3 +1,4 @@
1
+
1
2
  import { assert } from '@ember/debug';
2
3
  import { find, fillIn, settled } from '@ember/test-helpers';
3
4
 
@@ -1 +1 @@
1
- {"version":3,"file":"otp.js","sources":["../../src/test-support/otp.ts"],"sourcesContent":["import { assert } from '@ember/debug';\nimport { fillIn, find, settled } from '@ember/test-helpers';\n\n/**\n * @param {string} code the code to fill the input(s) with.\n * @param {string} [ selector ] if there are multiple OTP components on a page, this can be used to select one of them.\n */\nexport async function fillOTP(code: string, selector?: string) {\n const ancestor = selector ? find(selector) : document;\n\n assert(\n `Could not find ancestor element, does your selector match an existing element?`,\n ancestor\n );\n\n const fieldset =\n ancestor instanceof HTMLFieldSetElement ? ancestor : ancestor.querySelector('fieldset');\n\n assert(\n `Could not find containing fieldset element (this holds the OTP Input fields). Was the OTP component rendered?`,\n fieldset\n );\n\n const inputs = fieldset.querySelectorAll('input');\n\n assert(\n `code cannot be longer than the available inputs. code is of length ${code.length} but there are ${inputs.length}`,\n code.length <= inputs.length\n );\n\n const chars = code.split('');\n\n assert(`OTP Input for index 0 is missing!`, inputs[0]);\n assert(`Character at index 0 is missing`, chars[0]);\n\n for (let i = 0; i < chars.length; i++) {\n const input = inputs[i];\n const char = chars[i];\n\n assert(`Input at index ${i} is missing`, input);\n assert(`Character at index ${i} is missing`, char);\n\n input.value = char;\n }\n\n await fillIn(inputs[0], chars[0]);\n\n // Account for out-of-settled-system delay due to RAF debounce.\n await new Promise((resolve) => requestAnimationFrame(resolve));\n await settled();\n}\n"],"names":["fillOTP","code","selector","ancestor","find","document","assert","fieldset","HTMLFieldSetElement","querySelector","inputs","querySelectorAll","length","chars","split","i","input","char","value","fillIn","Promise","resolve","requestAnimationFrame","settled"],"mappings":";;;AAGA;AACA;AACA;AACA;AACO,eAAeA,OAAOA,CAACC,IAAY,EAAEC,QAAiB,EAAE;EAC7D,MAAMC,QAAQ,GAAGD,QAAQ,GAAGE,IAAI,CAACF,QAAQ,CAAC,GAAGG,QAAQ;AAErDC,EAAAA,MAAM,CACJ,CAAA,8EAAA,CAAgF,EAChFH,QACF,CAAC;AAED,EAAA,MAAMI,QAAQ,GACZJ,QAAQ,YAAYK,mBAAmB,GAAGL,QAAQ,GAAGA,QAAQ,CAACM,aAAa,CAAC,UAAU,CAAC;AAEzFH,EAAAA,MAAM,CACJ,CAAA,6GAAA,CAA+G,EAC/GC,QACF,CAAC;AAED,EAAA,MAAMG,MAAM,GAAGH,QAAQ,CAACI,gBAAgB,CAAC,OAAO,CAAC;AAEjDL,EAAAA,MAAM,CACJ,CAAA,mEAAA,EAAsEL,IAAI,CAACW,MAAM,CAAA,eAAA,EAAkBF,MAAM,CAACE,MAAM,CAAA,CAAE,EAClHX,IAAI,CAACW,MAAM,IAAIF,MAAM,CAACE,MACxB,CAAC;AAED,EAAA,MAAMC,KAAK,GAAGZ,IAAI,CAACa,KAAK,CAAC,EAAE,CAAC;AAE5BR,EAAAA,MAAM,CAAC,CAAA,iCAAA,CAAmC,EAAEI,MAAM,CAAC,CAAC,CAAC,CAAC;AACtDJ,EAAAA,MAAM,CAAC,CAAA,+BAAA,CAAiC,EAAEO,KAAK,CAAC,CAAC,CAAC,CAAC;AAEnD,EAAA,KAAK,IAAIE,CAAC,GAAG,CAAC,EAAEA,CAAC,GAAGF,KAAK,CAACD,MAAM,EAAEG,CAAC,EAAE,EAAE;AACrC,IAAA,MAAMC,KAAK,GAAGN,MAAM,CAACK,CAAC,CAAC;AACvB,IAAA,MAAME,IAAI,GAAGJ,KAAK,CAACE,CAAC,CAAC;AAErBT,IAAAA,MAAM,CAAC,CAAA,eAAA,EAAkBS,CAAC,CAAA,WAAA,CAAa,EAAEC,KAAK,CAAC;AAC/CV,IAAAA,MAAM,CAAC,CAAA,mBAAA,EAAsBS,CAAC,CAAA,WAAA,CAAa,EAAEE,IAAI,CAAC;IAElDD,KAAK,CAACE,KAAK,GAAGD,IAAI;AACpB,EAAA;EAEA,MAAME,MAAM,CAACT,MAAM,CAAC,CAAC,CAAC,EAAEG,KAAK,CAAC,CAAC,CAAC,CAAC;;AAEjC;EACA,MAAM,IAAIO,OAAO,CAAEC,OAAO,IAAKC,qBAAqB,CAACD,OAAO,CAAC,CAAC;EAC9D,MAAME,OAAO,EAAE;AACjB;;;;"}
1
+ {"version":3,"file":"otp.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
@@ -1,3 +1,4 @@
1
+
1
2
  import { assert } from '@ember/debug';
2
3
  import { find, findAll, click, fillIn } from '@ember/test-helpers';
3
4
 
@@ -1 +1 @@
1
- {"version":3,"file":"rating.js","sources":["../../src/test-support/rating.ts"],"sourcesContent":["import { assert } from '@ember/debug';\nimport { click, fillIn, find, findAll } from '@ember/test-helpers';\n\nconst selectors = {\n root: '.ember-primitives__rating',\n item: '.ember-primitives__rating__item',\n label: '.ember-primitives__rating__label',\n\n rootData: {\n total: '[data-total]',\n value: '[data-value]',\n },\n\n itemData: {\n number: '[data-number]',\n readonly: '[data-readonly]',\n selected: '[data-selected]',\n itemPercent: '[data-percent-selected]',\n },\n};\n\nconst stars = {\n selected: '★',\n unselected: '☆',\n};\n\n/**\n * Test utility for interacting with the\n * Rating component.\n *\n * Simulates user behavior and provides high level functions so you don't need to worry about the DOM.\n *\n * Actual elements are not exposed, as the elements are private API.\n * Even as you build a design system, the DOM should not be exposed to your consumers.\n */\nexport function rating(selector?: string) {\n const root = `${selector ?? ''}${selectors.root}`;\n\n return new RatingPageObject(root);\n}\n\nclass RatingPageObject {\n #root: string;\n\n constructor(root: string) {\n this.#root = root;\n }\n\n get #rootElement() {\n const element = find(this.#root);\n\n assert(\n `Could not find the root element for the <Rating> component. Used the selector \\`${this.#root}\\`. Was it rendered?`,\n element\n );\n\n return element;\n }\n\n get #labelElement() {\n const element = find(`${this.#root} ${selectors.label}`);\n\n assert(`Could not find the label for the <Rating> component. Was it rendered?`, element);\n\n return element;\n }\n\n get label() {\n return this.#labelElement.textContent?.replaceAll(/\\s+/g, ' ').trim();\n }\n\n get #starElements() {\n const elements = findAll(`${this.#root} ${selectors.item}`);\n\n assert(\n `There are no stars/items. Is the <Rating> component misconfigured?`,\n elements.length > 0\n );\n\n return elements as HTMLElement[];\n }\n\n get stars() {\n const elements = this.#starElements;\n\n return elements\n .map((x) => (x.hasAttribute('data-selected') ? stars.selected : stars.unselected))\n .join(' ');\n }\n\n get starTexts() {\n const elements = this.#starElements;\n\n return elements.map((x) => x.querySelector('[aria-hidden]')?.textContent?.trim()).join(' ');\n }\n\n get value() {\n const value = this.#rootElement.getAttribute(`data-value`);\n\n assert(`data-value attribute is missing on element '${this.#root}'`, value);\n\n const number = parseFloat(value);\n\n return number;\n }\n\n get isReadonly() {\n return this.#starElements.every((x) => x.hasAttribute('data-readonly'));\n }\n\n async select(stars: number) {\n const root = this.#rootElement;\n\n const star = root.querySelector(`[data-number=\"${stars}\"] input`);\n\n if (star) {\n await click(star);\n\n return;\n }\n\n /**\n * When we don't have an input, we require an input --\n * which is also the only way we can choose non-integer values.\n *\n * Should be able to be a number input or range input.\n */\n const input = root.querySelector('input[type=\"number\"], input[type=\"range\"]');\n\n if (input) {\n await fillIn(input, `${stars}`);\n\n return;\n }\n\n const available = [...root.querySelectorAll('[data-number]')].map((x) =>\n x.getAttribute('data-number')\n );\n\n assert(\n `Could not find item/star in <Rating> with value '${stars}' (or a number or range input with the same \"name\" value). Is the number (${stars}) correct and in-range for this component? The found available values are ${available.join(', ')}.`\n );\n }\n}\n"],"names":["selectors","root","item","label","stars","selected","unselected","rating","selector","RatingPageObject","constructor","#rootElement","element","find","assert","#labelElement","textContent","replaceAll","trim","#starElements","elements","findAll","length","map","x","hasAttribute","join","starTexts","querySelector","value","getAttribute","number","parseFloat","isReadonly","every","select","star","click","input","fillIn","available","querySelectorAll"],"mappings":";;;AAGA,MAAMA,SAAS,GAAG;AAChBC,EAAAA,IAAI,EAAE,2BAA2B;AACjCC,EAAAA,IAAI,EAAE,iCAAiC;AACvCC,EAAAA,KAAK,EAAE,kCAaT,CAAC;AAED,MAAMC,KAAK,GAAG;AACZC,EAAAA,QAAQ,EAAE,GAAG;AACbC,EAAAA,UAAU,EAAE;AACd,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASC,MAAMA,CAACC,QAAiB,EAAE;EACxC,MAAMP,IAAI,GAAG,CAAA,EAAGO,QAAQ,IAAI,EAAE,CAAA,EAAGR,SAAS,CAACC,IAAI,CAAA,CAAE;AAEjD,EAAA,OAAO,IAAIQ,gBAAgB,CAACR,IAAI,CAAC;AACnC;AAEA,MAAMQ,gBAAgB,CAAC;AACrB,EAAA,KAAK;EAELC,WAAWA,CAACT,IAAY,EAAE;AACxB,IAAA,IAAI,CAAC,KAAK,GAAGA,IAAI;AACnB,EAAA;EAEA,IAAI,YAAYU,GAAG;IACjB,MAAMC,OAAO,GAAGC,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC;IAEhCC,MAAM,CACJ,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EAAA,EAA6EA,KAAK,CAAA,0EAAA,EAA6EoC,SAAS,CAACd,IAAI,CAAC,IAAI,CAAC,GAC9O,CAAC;AACH,EAAA;AACF;;;;"}
1
+ {"version":3,"file":"rating.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
@@ -1,3 +1,4 @@
1
+
1
2
  import { assert } from '@ember/debug';
2
3
  import Router from '@ember/routing/router';
3
4
  import { properLinks } from '../proper-links.js';
@@ -1 +1 @@
1
- {"version":3,"file":"routing.js","sources":["../../src/test-support/routing.ts"],"sourcesContent":["import { assert } from '@ember/debug';\nimport Router from '@ember/routing/router';\n\nimport { properLinks } from '../proper-links.ts';\n\nimport type Owner from '@ember/owner';\nimport type { DSLCallback } from '@ember/routing/lib/dsl';\nimport type RouterService from '@ember/routing/router-service';\n\n/**\n * Allows setting up routes in tests without the need to scaffold routes in the actual app,\n * allowing for iterating on many different routing scenario / configurations rapidly.\n *\n * Example:\n * ```js\n * import { setupRouting } from 'ember-primitives/test-support';\n *\n * ...\n *\n * test('my test', async function (assert) {\n * setupRouting(this.owner, function () {\n * this.route('foo');\n * this.route('bar', function () {\n * this.route('a');\n * this.route('b');\n * })\n * });\n *\n * await visit('/bar/b');\n * });\n * ```\n *\n */\nexport function setupRouting(owner: Owner, map: DSLCallback, options?: { rootURL: string }) {\n if (options?.rootURL) {\n assert('rootURL must begin with a forward slash (\"/\")', options?.rootURL?.startsWith('/'));\n }\n\n @properLinks\n class TestRouter extends Router {\n rootURL = options?.rootURL ?? '/';\n }\n\n TestRouter.map(map);\n\n owner.register('router:main', TestRouter);\n\n // eslint-disable-next-line ember/no-private-routing-service\n const iKnowWhatIMDoing = owner.lookup('router:main');\n\n // We need a public testing API for this sort of stuff\n\n // eslint-disable-next-line @typescript-eslint/no-unsafe-call, @typescript-eslint/no-unsafe-member-access\n (iKnowWhatIMDoing as any).setupRouter();\n}\n\nexport function getRouter(owner: Owner): RouterService {\n return owner.lookup('service:router');\n}\n"],"names":["setupRouting","owner","map","options","rootURL","assert","startsWith","TestRouter","c","Router","properLinks","register","iKnowWhatIMDoing","lookup","setupRouter","getRouter"],"mappings":";;;;;AASA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASA,YAAYA,CAACC,KAAY,EAAEC,GAAgB,EAAEC,OAA6B,EAAE;EAC1F,IAAIA,OAAO,EAAEC,OAAO,EAAE;IACpBC,MAAM,CAAC,+CAA+C,EAAEF,OAAO,EAAEC,OAAO,EAAEE,UAAU,CAAC,GAAG,CAAC,CAAC;AAC5F,EAAA;AAAC,EAAA,MAGKC,UAAU,GAAAC,CAAA,OAAVD,UAAU,SAASE,MAAM,CAAC;AAC9BL,IAAAA,OAAO,GAAGD,OAAO,EAAEC,OAAO,IAAI,GAAG;AACnC,GAAC,GAHAM,WAAW,CAAA,CAAA;AAKZH,EAAAA,UAAU,CAACL,GAAG,CAACA,GAAG,CAAC;AAEnBD,EAAAA,KAAK,CAACU,QAAQ,CAAC,aAAa,EAAEJ,UAAU,CAAC;;AAEzC;AACA,EAAA,MAAMK,gBAAgB,GAAGX,KAAK,CAACY,MAAM,CAAC,aAAa,CAAC;;AAEpD;;AAEA;EACCD,gBAAgB,CAASE,WAAW,EAAE;AACzC;AAEO,SAASC,SAASA,CAACd,KAAY,EAAiB;AACrD,EAAA,OAAOA,KAAK,CAACY,MAAM,CAAC,gBAAgB,CAAC;AACvC;;;;"}
1
+ {"version":3,"file":"routing.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
@@ -1,3 +1,4 @@
1
+
1
2
  import { click } from '@ember/test-helpers';
2
3
 
3
4
  /* eslint-disable @typescript-eslint/no-non-null-assertion */
@@ -1 +1 @@
1
- {"version":3,"file":"zoetrope.js","sources":["../../src/test-support/zoetrope.ts"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-non-null-assertion */\nimport { click } from '@ember/test-helpers';\n\nexport class ZoetropeHelper {\n parentSelector = '.ember-primitives__zoetrope';\n\n constructor(parentSelector?: string) {\n if (parentSelector) {\n this.parentSelector = parentSelector;\n }\n }\n\n async scrollLeft() {\n await click(`${this.parentSelector} .ember-primitives__zoetrope__controls button:first-child`);\n }\n\n async scrollRight() {\n await click(`${this.parentSelector} .ember-primitives__zoetrope__controls button:last-child`);\n }\n\n visibleItems() {\n const zoetropeContent = document.querySelectorAll(\n `${this.parentSelector} .ember-primitives__zoetrope__scroller > *`\n );\n\n let firstVisibleItemIndex = -1;\n let lastVisibleItemIndex = -1;\n\n for (let i = 0; i < zoetropeContent.length; i++) {\n const item = zoetropeContent[i]!;\n const rect = item.getBoundingClientRect();\n const parentRect = item.parentElement!.getBoundingClientRect();\n\n if (rect.right >= parentRect?.left && rect.left <= parentRect?.right) {\n if (firstVisibleItemIndex === -1) {\n firstVisibleItemIndex = i;\n }\n\n lastVisibleItemIndex = i;\n } else if (firstVisibleItemIndex !== -1) {\n break;\n }\n }\n\n return Array.from(zoetropeContent).slice(firstVisibleItemIndex, lastVisibleItemIndex + 1);\n }\n\n visibleItemCount() {\n return this.visibleItems().length;\n }\n}\n"],"names":["ZoetropeHelper","parentSelector","constructor","scrollLeft","click","scrollRight","visibleItems","zoetropeContent","document","querySelectorAll","firstVisibleItemIndex","lastVisibleItemIndex","i","length","item","rect","getBoundingClientRect","parentRect","parentElement","right","left","Array","from","slice","visibleItemCount"],"mappings":";;AAAA;AAGO,MAAMA,cAAc,CAAC;AAC1BC,EAAAA,cAAc,GAAG,6BAA6B;EAE9CC,WAAWA,CAACD,cAAuB,EAAE;AACnC,IAAA,IAAIA,cAAc,EAAE;MAClB,IAAI,CAACA,cAAc,GAAGA,cAAc;AACtC,IAAA;AACF,EAAA;EAEA,MAAME,UAAUA,GAAG;AACjB,IAAA,MAAMC,KAAK,CAAC,CAAA,EAAG,IAAI,CAACH,cAAc,2DAA2D,CAAC;AAChG,EAAA;EAEA,MAAMI,WAAWA,GAAG;AAClB,IAA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GED
@@ -1,3 +1,6 @@
1
+
2
+ import { getOwner } from '@ember/owner';
3
+
1
4
  // this is copy pasted from https://github.com/emberjs/ember.js/blob/60d2e0cddb353aea0d6e36a72fda971010d92355/packages/%40ember/-internals/glimmer/lib/helpers/unique-id.ts
2
5
  // Unfortunately due to https://github.com/emberjs/ember.js/issues/20165 we cannot use the built-in version in template tags
3
6
  function uniqueId() {
@@ -8,9 +11,52 @@ function uniqueId() {
8
11
  return ([3e7] + -1e3 + -4e3 + -2e3 + -1e11).replace(/[0-3]/g, a => (a * 4 ^ Math.random() * 16 >> (a & 2)).toString(16));
9
12
  }
10
13
  function isNewable(x) {
14
+ // TypeScript has really bad prototype support -- they don't really
15
+ // want folks using this sort of stuff -- but it's handy for perf and all that.
16
+ //
11
17
  // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
12
18
  return x.prototype?.constructor === x;
13
19
  }
14
20
 
15
- export { isNewable, uniqueId };
21
+ /**
22
+ * Loose check for an "ownerish" API.
23
+ * only the ".lookup" method is required.
24
+ *
25
+ * The requirements for what an "owner" is are sort of undefined,
26
+ * as the actual owner in ember applications has too much on it,
27
+ * and the long term purpose of the owner will be questioned once we
28
+ * eliminate the need to have a registry (what lookup looks in to),
29
+ * but we'll still need "Something" to represent the lifetime of the application.
30
+ *
31
+ * Technically, the owner could be any object, including `{}`
32
+ */
33
+ function isOwner(x) {
34
+ if (!isNonNullableObject(x)) return false;
35
+ return 'lookup' in x && typeof x.lookup === 'function';
36
+ }
37
+ function isNonNullableObject(x) {
38
+ if (typeof x !== 'object') return false;
39
+ if (x === null) return false;
40
+ return true;
41
+ }
42
+
43
+ /**
44
+ * Can receive the class instance or the owner itself, and will always return return the owner.
45
+ *
46
+ * undefined will be returned if the Owner does not exist on the passed object
47
+ *
48
+ * Can be useful when combined with `createStore` to then create "services",
49
+ * which don't require string lookup.
50
+ */
51
+ function findOwner(contextOrOwner) {
52
+ if (isOwner(contextOrOwner)) return contextOrOwner;
53
+
54
+ // _ENSURE_ that we have an object, else getOwner makes no sense to call
55
+ if (!isNonNullableObject(contextOrOwner)) return;
56
+ const maybeOwner = getOwner(contextOrOwner);
57
+ if (isOwner(maybeOwner)) return maybeOwner;
58
+ return;
59
+ }
60
+
61
+ export { findOwner, isNewable, isNonNullableObject, isOwner, uniqueId };
16
62
  //# sourceMappingURL=utils.js.map
package/dist/utils.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"utils.js","sources":["../src/utils.ts"],"sourcesContent":["// this is copy pasted from https://github.com/emberjs/ember.js/blob/60d2e0cddb353aea0d6e36a72fda971010d92355/packages/%40ember/-internals/glimmer/lib/helpers/unique-id.ts\n// Unfortunately due to https://github.com/emberjs/ember.js/issues/20165 we cannot use the built-in version in template tags\nexport function uniqueId(): string {\n // @ts-expect-error this one-liner abuses weird JavaScript semantics that\n // TypeScript (legitimately) doesn't like, but they're nonetheless valid and\n // specced.\n // eslint-disable-next-line @typescript-eslint/no-unsafe-return, @typescript-eslint/no-unsafe-call, @typescript-eslint/restrict-plus-operands, @typescript-eslint/no-unsafe-member-access\n return ([3e7] + -1e3 + -4e3 + -2e3 + -1e11).replace(/[0-3]/g, (a) =>\n ((a * 4) ^ ((Math.random() * 16) >> (a & 2))).toString(16)\n );\n}\n\nexport function isNewable(x: any): x is new (...args: unknown[]) => NonNullable<object> {\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n return x.prototype?.constructor === x;\n}\n"],"names":["uniqueId","replace","a","Math","random","toString","isNewable","x","prototype","constructor"],"mappings":"AAAA;AACA;AACO,SAASA,QAAQA,GAAW;AACjC;AACA;AACA;AACA;EACA,OAAO,CAAC,CAAC,GAAG,CAAC,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,KAAK,EAAEC,OAAO,CAAC,QAAQ,EAAGC,CAAC,IAC9D,CAAEA,CAAC,GAAG,CAAC,GAAMC,IAAI,CAACC,MAAM,EAAE,GAAG,EAAE,KAAMF,CAAC,GAAG,CAAC,CAAE,EAAEG,QAAQ,CAAC,EAAE,CAC3D,CAAC;AACH;AAEO,SAASC,SAASA,CAACC,CAAM,EAAwD;AACtF;AACA,EAAA,OAAOA,CAAC,CAACC,SAAS,EAAEC,WAAW,KAAKF,CAAC;AACvC;;;;"}
1
+ {"version":3,"file":"utils.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
@@ -0,0 +1,3 @@
1
+ import "./components/visually-hidden.css"
2
+ ;
3
+ //# sourceMappingURL=visually-hidden-CGP1FSjt.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"visually-hidden-CGP1FSjt.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
package/package.json CHANGED
@@ -1,10 +1,7 @@
1
1
  {
2
2
  "name": "ember-primitives",
3
- "version": "0.40.0",
3
+ "version": "0.42.0",
4
4
  "description": "Making apps easier to build",
5
- "sideEffects": [
6
- "*.css"
7
- ],
8
5
  "keywords": [
9
6
  "ember-addon"
10
7
  ],
@@ -19,10 +16,10 @@
19
16
  "dependencies": {
20
17
  "@babel/runtime": "^7.27.1",
21
18
  "@embroider/addon-shim": "^1.10.0",
22
- "@embroider/macros": "^1.18.0",
19
+ "@embroider/macros": "^1.19.2",
23
20
  "@floating-ui/dom": "^1.7.0",
24
21
  "decorator-transforms": "^2.3.0",
25
- "ember-element-helper": "^0.8.8",
22
+ "ember-element-helper": ">= 0.8.6",
26
23
  "form-data-utils": "^0.6.0",
27
24
  "reactiveweb": "^1.8.0",
28
25
  "should-handle-link": "^1.2.2",
@@ -32,40 +29,41 @@
32
29
  },
33
30
  "devDependencies": {
34
31
  "@arethetypeswrong/cli": "^0.18.0",
35
- "@babel/core": "^7.27.1",
32
+ "@babel/core": "^7.28.5",
36
33
  "@babel/plugin-proposal-class-properties": "^7.18.6",
37
34
  "@babel/plugin-proposal-decorators": "^7.27.1",
38
35
  "@babel/plugin-proposal-object-rest-spread": "^7.20.7",
39
36
  "@babel/plugin-syntax-decorators": "^7.27.1",
40
37
  "@babel/plugin-transform-class-static-block": "^7.27.1",
41
38
  "@babel/plugin-transform-private-methods": "^7.27.1",
42
- "@babel/preset-typescript": "^7.27.1",
43
- "@ember/test-helpers": "^5.2.2",
39
+ "@babel/preset-typescript": "^7.28.5",
40
+ "@ember/library-tsconfig": "^1.1.3",
41
+ "@ember/test-helpers": "^5.4.0",
44
42
  "@ember/test-waiters": "^4.1.0",
45
- "@embroider/addon-dev": "^7.0.1",
43
+ "@embroider/addon-dev": "^8.1.0",
46
44
  "@glimmer/component": "^2.0.0",
47
45
  "@glimmer/tracking": "^1.1.2",
48
- "@glint/core": "1.5.2",
49
- "@glint/environment-ember-loose": "1.5.2",
50
- "@glint/environment-ember-template-imports": "1.5.2",
51
- "@glint/template": "^1.5.2",
52
- "@nullvoxpopuli/eslint-configs": "^5.3.3",
53
- "@rollup/plugin-babel": "^6.0.4",
46
+ "@glint/ember-tsc": "^1.0.7",
47
+ "@glint/template": "^1.7.2",
48
+ "@glint/tsserver-plugin": "^2.0.7",
49
+ "@nullvoxpopuli/eslint-configs": "^5.3.4",
50
+ "@rollup/plugin-babel": "^6.1.0",
54
51
  "@tsconfig/ember": "^3.0.5",
55
52
  "babel-plugin-ember-template-compilation": "^2.4.0",
56
- "concurrently": "^9.1.0",
53
+ "concurrently": "^9.2.1",
57
54
  "ember-modifier": "^4.2.2",
58
- "ember-resources": "^7.0.4",
59
- "ember-source": "6.5.0",
60
- "ember-template-lint": "^7.7.0",
61
- "eslint": "^9.26.0",
62
- "fix-bad-declaration-output": "^1.1.4",
55
+ "ember-resources": "^7.0.7",
56
+ "ember-source": "6.8.1",
57
+ "ember-template-lint": "^7.9.3",
58
+ "eslint": "^9.39.0",
59
+ "execa": "^9.6.0",
60
+ "fix-bad-declaration-output": "^1.1.5",
63
61
  "prettier": "^3.2.5",
64
62
  "prettier-plugin-ember-template-tag": "^2.0.5",
65
63
  "publint": "^0.3.12",
66
- "rollup": "~4.44.0",
64
+ "rollup": "~4.52.5",
67
65
  "rollup-plugin-copy": "^3.5.0",
68
- "typescript": "^5.8.3"
66
+ "typescript": "^5.9.3"
69
67
  },
70
68
  "publishConfig": {
71
69
  "registry": "https://registry.npmjs.org"
@@ -146,7 +144,7 @@
146
144
  "lint:published-types": "attw *.tgz || exit 0",
147
145
  "lint:prettier:fix": "pnpm -w exec lint prettier:fix",
148
146
  "lint:prettier": "pnpm -w exec lint prettier",
149
- "lint:types": "glint",
147
+ "lint:types": "ember-tsc --noEmit --declaration false --declarationMap false --emitDeclarationOnly false",
150
148
  "pack": "pnpm pack",
151
149
  "start": "rollup --config --watch",
152
150
  "test": "echo 'A v2 addon does not have tests, run tests in test-app'"
@@ -1 +0,0 @@
1
- {"version":3,"file":"item-D6pwWzMs.js","sources":["../src/components/accordion/content.gts","../src/components/accordion/trigger.gts","../src/components/accordion/header.gts","../src/components/accordion/item.gts"],"sourcesContent":["import Component from \"@glimmer/component\";\n\nimport { getDataState } from \"./item.gts\";\n\nimport type { AccordionContentExternalSignature } from \"./public.ts\";\n\ninterface Signature extends AccordionContentExternalSignature {\n Args: {\n isExpanded: boolean;\n value: string;\n disabled?: boolean;\n };\n}\n\nexport class AccordionContent extends Component<Signature> {\n <template>\n <div\n role=\"region\"\n id={{@value}}\n data-state={{getDataState @isExpanded}}\n hidden={{this.isHidden}}\n data-disabled={{@disabled}}\n ...attributes\n >\n {{yield}}\n </div>\n </template>\n\n get isHidden() {\n return !this.args.isExpanded;\n }\n}\n\nexport default AccordionContent;\n","import { on } from \"@ember/modifier\";\n\nimport { getDataState } from \"./item.gts\";\n\nimport type { AccordionTriggerExternalSignature } from \"./public.ts\";\nimport type { TOC } from \"@ember/component/template-only\";\n\ninterface Signature extends AccordionTriggerExternalSignature {\n Args: {\n isExpanded: boolean;\n value: string;\n disabled?: boolean;\n toggleItem: () => void;\n };\n}\n\nexport const AccordionTrigger: TOC<Signature> = <template>\n <button\n type=\"button\"\n aria-controls={{@value}}\n aria-expanded={{@isExpanded}}\n data-state={{getDataState @isExpanded}}\n data-disabled={{@disabled}}\n aria-disabled={{if @disabled \"true\" \"false\"}}\n {{on \"click\" @toggleItem}}\n ...attributes\n >\n {{yield}}\n </button>\n</template>;\n\nexport default AccordionTrigger;\n","import { hash } from \"@ember/helper\";\n\nimport { getDataState } from \"./item.gts\";\nimport Trigger from \"./trigger.gts\";\n\nimport type { AccordionHeaderExternalSignature } from \"./public.ts\";\nimport type { TOC } from \"@ember/component/template-only\";\n\ninterface Signature extends AccordionHeaderExternalSignature {\n Args: {\n value: string;\n isExpanded: boolean;\n disabled?: boolean;\n toggleItem: () => void;\n };\n}\n\nexport const AccordionHeader: TOC<Signature> = <template>\n <div\n role=\"heading\"\n aria-level=\"3\"\n data-state={{getDataState @isExpanded}}\n data-disabled={{@disabled}}\n ...attributes\n >\n {{yield\n (hash\n Trigger=(component\n Trigger value=@value isExpanded=@isExpanded disabled=@disabled toggleItem=@toggleItem\n )\n )\n }}\n </div>\n</template>;\n\nexport default AccordionHeader;\n","import Component from \"@glimmer/component\";\nimport { hash } from \"@ember/helper\";\n\nimport Content from \"./content.gts\";\nimport Header from \"./header.gts\";\n\nimport type { AccordionItemExternalSignature } from \"./public.ts\";\n\nexport function getDataState(isExpanded: boolean): string {\n return isExpanded ? \"open\" : \"closed\";\n}\n\ninterface Signature extends AccordionItemExternalSignature {\n Args: AccordionItemExternalSignature[\"Args\"] & {\n selectedValue?: string | string[];\n disabled?: boolean;\n toggleItem: (value: string) => void;\n };\n}\n\nexport class AccordionItem extends Component<Signature> {\n <template>\n <div data-state={{getDataState this.isExpanded}} data-disabled={{@disabled}} ...attributes>\n {{yield\n (hash\n isExpanded=this.isExpanded\n Header=(component\n Header\n value=@value\n isExpanded=this.isExpanded\n disabled=@disabled\n toggleItem=this.toggleItem\n )\n Content=(component Content value=@value isExpanded=this.isExpanded disabled=@disabled)\n )\n }}\n </div>\n </template>\n\n get isExpanded(): boolean {\n if (Array.isArray(this.args.selectedValue)) {\n return this.args.selectedValue.includes(this.args.value);\n }\n\n return this.args.selectedValue === this.args.value;\n }\n\n toggleItem = (): void => {\n if (this.args.disabled) return;\n\n this.args.toggleItem(this.args.value);\n };\n}\n\nexport default AccordionItem;\n"],"names":["AccordionContent","Component","setComponentTemplate","precompileTemplate","strictMode","scope","getDataState","isHidden","args","isExpanded","AccordionTrigger","on","templateOnly","AccordionHeader","hash","Trigger","AccordionItem","Header","Content","Array","isArray","selectedValue","includes","value","toggleItem","disabled"],"mappings":";;;;;;;AAcO,MAAMA,yBAAyBC,SAAA,CAAU;AAC9C,EAAA;IAAAC,oBAAA,CAAAC,kBAAA,CAAA,uLAAA,EAWA;MAAAC,UAAA,EAAA,IAAA;AAAAC,MAAAA,KAAA,EAAAA,OAAA;AAAAC,QAAAA;AAAA,OAAA;KAAU,CAAA,EAAV,IAAW,CAAA;AAAD;EAEV,IAAIC,QAAAA,GAAW;AACb,IAAA,OAAO,CAAC,IAAI,CAACC,IAAI,CAACC,UAAU;AAC9B,EAAA;AACF;;MCfaC,gBAAsB,GAAAR,oBAAA,CAAaC,kBAAA,CAAA,oRAAA,EAahD;EAAAC,UAAA,EAAA,IAAA;AAAAC,EAAAA,KAAA,EAAAA,OAAA;IAAAC,YAAA;AAAAK,IAAAA;AAAA,GAAA;AAAU,CAAA,CAAA,EAAAC,YAAA,EAAA;;MCZGC,eAAqB,GAAAX,oBAAA,CAAaC,kBAAA,CAAA,2QAAA,EAgB/C;EAAAC,UAAA,EAAA,IAAA;AAAAC,EAAAA,KAAA,EAAAA,OAAA;IAAAC,YAAA;IAAAQ,IAAA;AAAAC,aAAAA;AAAA,GAAA;AAAU,CAAA,CAAA,EAAAH,YAAA,EAAA;;ACzBH,SAASN,YAAAA,CAAaG,UAAmB,EAAS;AACvD,EAAA,OAAOA,aAAa,MAAA,GAAS,QAAA;AAC/B;AAUO,MAAMO,sBAAsBf,SAAA,CAAU;AAC3C,EAAA;IAAAC,oBAAA,CAAAC,kBAAA,CAAA,6WAAA,EAgBA;MAAAC,UAAA,EAAA,IAAA;AAAAC,MAAAA,KAAA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