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.
- package/CHANGELOG.md +10 -1
- package/dist/actual.full.css +20 -0
- package/dist/actual.full.js +1 -1
- package/dist/actual.full.min.css +1 -1
- package/dist/types/ajax.d.ts +1 -0
- package/dist/types/command.d.ts +41 -0
- package/dist/types/context-menu.d.ts +1 -0
- package/dist/types/dialog.d.ts +3 -0
- package/dist/types/dirty.d.ts +15 -0
- package/dist/types/dismiss.d.ts +1 -0
- package/dist/types/enhance.d.ts +36 -0
- package/dist/types/enhancement-loader.d.ts +27 -0
- package/dist/types/escape.d.ts +1 -0
- package/dist/types/events.d.ts +14 -0
- package/dist/types/filter.d.ts +1 -0
- package/dist/types/floating-space.d.ts +16 -0
- package/dist/types/flyout.d.ts +1 -0
- package/dist/types/focus-group.d.ts +4 -0
- package/dist/types/focus.d.ts +4 -0
- package/dist/types/form-submission.d.ts +12 -0
- package/dist/types/full.d.ts +22 -0
- package/dist/types/in-view.d.ts +1 -0
- package/dist/types/index.d.ts +1 -0
- package/dist/types/inline-visible.d.ts +1 -0
- package/dist/types/input.d.ts +4 -0
- package/dist/types/keys.d.ts +5 -0
- package/dist/types/mask.d.ts +1 -0
- package/dist/types/menu.d.ts +12 -0
- package/dist/types/parse-config.d.ts +2 -0
- package/dist/types/parsed.d.ts +1 -0
- package/dist/types/password.d.ts +1 -0
- package/dist/types/range.d.ts +1 -0
- package/dist/types/scrollspy.d.ts +1 -0
- package/dist/types/selectors.d.ts +14 -0
- package/dist/types/status.d.ts +5 -0
- package/dist/types/surface.d.ts +6 -0
- package/dist/types/tab.d.ts +1 -0
- package/dist/types/tooltip.d.ts +68 -0
- package/dist/types/transition.d.ts +1 -0
- package/dist/types/validation.d.ts +17 -0
- package/docs/pages/enhancements/flyout.md +3 -1
- package/docs/pages/guides/progressive-enhancement.md +5 -1
- package/package.json +36 -34
- package/src/css/components/flyout.css +20 -0
- package/src/js/context-menu.js +10 -2
- package/src/js/enhance.js +18 -4
- 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,
|
|
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 {
|
|
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 */
|