actual-css 0.19.1 → 0.19.2

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 (47) hide show
  1. package/CHANGELOG.md +10 -1
  2. package/dist/actual.full.css +20 -0
  3. package/dist/actual.full.js +1 -1
  4. package/dist/actual.full.min.css +1 -1
  5. package/dist/types/ajax.d.ts +1 -0
  6. package/dist/types/command.d.ts +41 -0
  7. package/dist/types/context-menu.d.ts +1 -0
  8. package/dist/types/dialog.d.ts +3 -0
  9. package/dist/types/dirty.d.ts +15 -0
  10. package/dist/types/dismiss.d.ts +1 -0
  11. package/dist/types/enhance.d.ts +36 -0
  12. package/dist/types/enhancement-loader.d.ts +27 -0
  13. package/dist/types/escape.d.ts +1 -0
  14. package/dist/types/events.d.ts +14 -0
  15. package/dist/types/filter.d.ts +1 -0
  16. package/dist/types/floating-space.d.ts +16 -0
  17. package/dist/types/flyout.d.ts +1 -0
  18. package/dist/types/focus-group.d.ts +4 -0
  19. package/dist/types/focus.d.ts +4 -0
  20. package/dist/types/form-submission.d.ts +12 -0
  21. package/dist/types/full.d.ts +22 -0
  22. package/dist/types/in-view.d.ts +1 -0
  23. package/dist/types/index.d.ts +1 -0
  24. package/dist/types/inline-visible.d.ts +1 -0
  25. package/dist/types/input.d.ts +4 -0
  26. package/dist/types/keys.d.ts +5 -0
  27. package/dist/types/mask.d.ts +1 -0
  28. package/dist/types/menu.d.ts +12 -0
  29. package/dist/types/parse-config.d.ts +2 -0
  30. package/dist/types/parsed.d.ts +1 -0
  31. package/dist/types/password.d.ts +1 -0
  32. package/dist/types/range.d.ts +1 -0
  33. package/dist/types/scrollspy.d.ts +1 -0
  34. package/dist/types/selectors.d.ts +14 -0
  35. package/dist/types/status.d.ts +5 -0
  36. package/dist/types/surface.d.ts +6 -0
  37. package/dist/types/tab.d.ts +1 -0
  38. package/dist/types/tooltip.d.ts +68 -0
  39. package/dist/types/transition.d.ts +1 -0
  40. package/dist/types/validation.d.ts +17 -0
  41. package/docs/pages/enhancements/flyout.md +3 -1
  42. package/docs/pages/guides/progressive-enhancement.md +5 -1
  43. package/package.json +36 -34
  44. package/src/css/components/flyout.css +20 -0
  45. package/src/js/context-menu.js +10 -2
  46. package/src/js/enhance.js +18 -4
  47. package/src/js/full.js +3 -0
package/src/js/enhance.js CHANGED
@@ -28,6 +28,14 @@
28
28
  * See docs/design-notes/enhancement-contract.md.
29
29
  */
30
30
 
31
+ /** @typedef {(el: Element) => (() => void) | void} Enhancer */
32
+
33
+ /**
34
+ * @typedef {object} EnhancementHandle
35
+ * @property {(node: Node) => void} refresh Scan a node and its descendants.
36
+ * @property {() => void} disconnect Stop observing and run active cleanups.
37
+ */
38
+
31
39
  const registries = new WeakMap();
32
40
  const ownedNames = new WeakMap();
33
41
 
@@ -197,7 +205,7 @@ function enhancementSelector(name) {
197
205
  * Apply a named opt-in once; presentation selectors remain application-owned.
198
206
  * @param {string} name
199
207
  * @param {string} selector
200
- * @param {Document | Element | DocumentFragment} [root] Query scope, excluding itself.
208
+ * @param {Document | Element | DocumentFragment | null} [root] Query scope, excluding itself.
201
209
  * @returns {Element[]} Matched descendants.
202
210
  */
203
211
  export function applyEnhancement(name, selector, root) {
@@ -224,6 +232,12 @@ export function applyEnhancement(name, selector, root) {
224
232
  return elements;
225
233
  }
226
234
 
235
+ /**
236
+ * @param {string} name
237
+ * @param {Enhancer} init
238
+ * @param {Document | Element | DocumentFragment | null} [root]
239
+ * @returns {EnhancementHandle}
240
+ */
227
241
  export function registerEnhancement(name, init, root) {
228
242
  if (typeof document === "undefined") return noopRuntime();
229
243
 
@@ -260,11 +274,11 @@ export function registerEnhancement(name, init, root) {
260
274
  }
261
275
 
262
276
  /**
263
- * @param {Record<string, (el: Element) => (() => void) | void>} enhancers
264
- * @param {Document | Element | DocumentFragment} [root]
277
+ * @param {Record<string, Enhancer>} enhancers
278
+ * @param {Document | Element | DocumentFragment | null} [root]
265
279
  * @param {object} [options]
266
280
  * @param {(el: Element) => boolean} [options.accept] Lifecycle eligibility, rechecked on moves.
267
- * @returns {{ refresh: (node: Node) => void, disconnect: () => void }}
281
+ * @returns {EnhancementHandle}
268
282
  */
269
283
  export default function enhance(enhancers, root, { accept } = {}) {
270
284
  if (accept !== undefined && typeof accept !== "function") {
package/src/js/full.js CHANGED
@@ -32,3 +32,6 @@ import "./status.js";
32
32
  import "./index.js";
33
33
 
34
34
  export { applyEnhancement, default as enhance, registerEnhancement } from "./enhance.js";
35
+
36
+ /** @typedef {import("./enhance.js").Enhancer} Enhancer */
37
+ /** @typedef {import("./enhance.js").EnhancementHandle} EnhancementHandle */