@jqhtml/core 2.3.70 → 2.3.72
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/dist/component.d.ts +49 -0
- package/dist/component.d.ts.map +1 -1
- package/dist/dom-attachment.d.ts +31 -0
- package/dist/dom-attachment.d.ts.map +1 -0
- package/dist/index.cjs +1338 -1059
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +5 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1337 -1060
- package/dist/index.js.map +1 -1
- package/dist/jqhtml-core.esm.js +1338 -1061
- package/dist/jqhtml-core.esm.js.map +1 -1
- package/dist/jquery-plugin.d.ts.map +1 -1
- package/dist/lifecycle-manager.d.ts +0 -5
- package/dist/lifecycle-manager.d.ts.map +1 -1
- package/dist/load-coordinator.d.ts +9 -0
- package/dist/load-coordinator.d.ts.map +1 -1
- package/dist/local-storage.d.ts +61 -4
- package/dist/local-storage.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/component.d.ts
CHANGED
|
@@ -77,6 +77,9 @@ export declare class Jqhtml_Component {
|
|
|
77
77
|
private __load_gates;
|
|
78
78
|
private __first_load_started;
|
|
79
79
|
private __gate_resume;
|
|
80
|
+
private _attached;
|
|
81
|
+
private _attachment_checked;
|
|
82
|
+
private _attachment_tracking;
|
|
80
83
|
constructor(element?: any, args?: Record<string, any>);
|
|
81
84
|
/**
|
|
82
85
|
* Protect lifecycle methods from manual invocation
|
|
@@ -405,6 +408,46 @@ export declare class Jqhtml_Component {
|
|
|
405
408
|
on_loaded(): void | Promise<void>;
|
|
406
409
|
on_ready(): Promise<void>;
|
|
407
410
|
on_stop(): void;
|
|
411
|
+
on_attach(): void;
|
|
412
|
+
on_detach(): void;
|
|
413
|
+
/**
|
|
414
|
+
* Whether this component currently considers itself attached to the document.
|
|
415
|
+
*
|
|
416
|
+
* This is the component's recorded state, not a live isConnected read: it is
|
|
417
|
+
* false until the first check after 'ready', and from then on flips only when a
|
|
418
|
+
* transition is observed (or on stop()). It is exactly the state 'attach' and
|
|
419
|
+
* 'detach' have reported.
|
|
420
|
+
*/
|
|
421
|
+
is_attached(): boolean;
|
|
422
|
+
/**
|
|
423
|
+
* Flip the recorded state and fire the matching hook + event. The opposite
|
|
424
|
+
* sticky event is invalidated first, so a late subscriber only ever sees the
|
|
425
|
+
* current state. Hook errors are isolated; the event still fires.
|
|
426
|
+
* @private
|
|
427
|
+
*/
|
|
428
|
+
private _transition_attachment;
|
|
429
|
+
/**
|
|
430
|
+
* Compare the root's live connectivity with the recorded state and transition
|
|
431
|
+
* on a difference. Idempotent. Called by the document observer on every
|
|
432
|
+
* mutation batch for tracked components, and directly by the framework after
|
|
433
|
+
* 'ready' and when interest is registered late.
|
|
434
|
+
* @private
|
|
435
|
+
*/
|
|
436
|
+
_attachment_check(): void;
|
|
437
|
+
/**
|
|
438
|
+
* The first check, run once the 'ready' handlers have completed. Fires 'attach'
|
|
439
|
+
* if the component was born attached, even with no listener, so a later
|
|
440
|
+
* .on('attach') gets the sticky fire. Deferred interest starts tracking here.
|
|
441
|
+
* @private
|
|
442
|
+
*/
|
|
443
|
+
private _attachment_first_check;
|
|
444
|
+
/**
|
|
445
|
+
* Register interest in attach/detach. Before the first ready check this only
|
|
446
|
+
* records the interest; after it, tracking starts immediately and a check runs
|
|
447
|
+
* at once, so a late subscriber on a natively-removed component sees 'detach'.
|
|
448
|
+
* @private
|
|
449
|
+
*/
|
|
450
|
+
private _watch_attachment;
|
|
408
451
|
/**
|
|
409
452
|
* Called with the viewport width in CSS pixels:
|
|
410
453
|
* - after every on_render()
|
|
@@ -461,6 +504,12 @@ export declare class Jqhtml_Component {
|
|
|
461
504
|
/**
|
|
462
505
|
* Trigger a lifecycle event - delegates to component-events.ts
|
|
463
506
|
* @see component-events.ts for full documentation
|
|
507
|
+
*
|
|
508
|
+
* 'ready' is special: once its handlers have run, the component runs its first
|
|
509
|
+
* attachment check (and every later one, idempotently). Doing it here rather than
|
|
510
|
+
* at each of the call sites that trigger 'ready' guarantees the order
|
|
511
|
+
* on_ready() -> 'ready' handlers -> 'attach', so everything on_ready() set up is
|
|
512
|
+
* complete before anyone learns the component is in the document.
|
|
464
513
|
*/
|
|
465
514
|
trigger(event_name: string, data?: any): void;
|
|
466
515
|
/**
|
package/dist/component.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"component.d.ts","sourceRoot":"","sources":["../src/component.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;
|
|
1
|
+
{"version":3,"file":"component.d.ts","sourceRoot":"","sources":["../src/component.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAeH,OAAO,EAA6C,sBAAsB,EAAE,MAAM,qBAAqB,CAAC;AACxG,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACnD,OAAO,EAAE,WAAW,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAE7D;;;;GAIG;AACH,eAAO,MAAM,gBAAgB;;;;;CAK5B,CAAC;AAiEF,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,MAAM;QACd,YAAY,CAAC,EAAE;YACb,GAAG,EAAE,CAAC,aAAa,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,GAAG,KAAK,IAAI,CAAC;YACjF,UAAU,EAAE,MAAM,IAAI,CAAC;SACxB,CAAC;KACH;CACF;AAED,qBAAa,gBAAgB;IAE3B,MAAM,CAAC,kBAAkB,UAAQ;IACjC,MAAM,CAAC,QAAQ,CAAC,EAAE,GAAG,CAAC;IAGtB,MAAM,CAAC,QAAQ,CAAC,sBAAsB,SAA0B;IAGhE,CAAC,EAAE,GAAG,CAAC;IACP,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IAC1B,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IAC1B,KAAK,EAA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QAAQ,EAAE,MAAM,GAAG,gBAAgB,GAAG,IAAI;IAwBlD;;OAEG;IACH,MAAM,CAAC,mBAAmB,IAAI,MAAM,EAAE;IA0CtC,OAAO,CAAC,aAAa;IAIrB;;;;;;;;;;;;;;;;;;;;;;;;OAwBG;IACH,OAAO,CAAC,oBAAoB;IAsB5B,OAAO,CAAC,kBAAkB;IA8B1B,OAAO,CAAC,yBAAyB;IA8HjC,OAAO,CAAC,eAAe;IAevB,OAAO,CAAC,mBAAmB;IAO3B,OAAO,CAAC,gBAAgB;IAcxB;;;;OAIG;IACH,OAAO,CAAC,iBAAiB;IA+BzB,OAAO,CAAC,cAAc;IActB,OAAO,CAAC,UAAU;CAUnB"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* JQHTML DOM Attachment Tracking
|
|
3
|
+
*
|
|
4
|
+
* Backs the component 'attach' / 'detach' lifecycle events.
|
|
5
|
+
*
|
|
6
|
+
* One document-level MutationObserver (childList + subtree) is installed the first
|
|
7
|
+
* time any component expresses interest in attachment, and disconnected when the
|
|
8
|
+
* last interested component is stopped or collected. The observer never inspects
|
|
9
|
+
* mutation records: it is only a "the tree changed" tick. On each batch it walks
|
|
10
|
+
* the tracked components and asks each to compare its root's isConnected against
|
|
11
|
+
* its own recorded attachment state (Jqhtml_Component._attachment_check()). Cost is
|
|
12
|
+
* O(tracked components) per mutation batch, independent of how much of the page
|
|
13
|
+
* changed, and zero when nothing has opted in.
|
|
14
|
+
*
|
|
15
|
+
* Because MutationObserver delivers per microtask, a node moved synchronously
|
|
16
|
+
* (remove + insert in one task, e.g. appendTo) never shows a transition. Only a
|
|
17
|
+
* component whose root is actually off-document when the batch flushes is detached.
|
|
18
|
+
*
|
|
19
|
+
* Tracked components are held by WeakRef. A component that is removed from the
|
|
20
|
+
* document natively (never stopped) and then dropped by everything else is therefore
|
|
21
|
+
* collectable: the tracker pins nothing. Dead refs are pruned on the next batch.
|
|
22
|
+
*/
|
|
23
|
+
/** Start watching a component's root for attach/detach transitions. Idempotent. */
|
|
24
|
+
export declare function track_attachment(component: any): void;
|
|
25
|
+
/** Stop watching a component (called from _stop()). Idempotent. */
|
|
26
|
+
export declare function untrack_attachment(component: any): void;
|
|
27
|
+
/** Number of components currently tracked (diagnostics / tests). */
|
|
28
|
+
export declare function tracked_attachment_count(): number;
|
|
29
|
+
/** Whether the document observer is currently installed (diagnostics / tests). */
|
|
30
|
+
export declare function attachment_observer_active(): boolean;
|
|
31
|
+
//# sourceMappingURL=dom-attachment.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dom-attachment.d.ts","sourceRoot":"","sources":["../src/dom-attachment.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AA+BH,mFAAmF;AACnF,wBAAgB,gBAAgB,CAAC,SAAS,EAAE,GAAG,GAAG,IAAI,CAMrD;AAED,mEAAmE;AACnE,wBAAgB,kBAAkB,CAAC,SAAS,EAAE,GAAG,GAAG,IAAI,CAMvD;AAED,oEAAoE;AACpE,wBAAgB,wBAAwB,IAAI,MAAM,CAEjD;AAED,kFAAkF;AAClF,wBAAgB,0BAA0B,IAAI,OAAO,CAEpD"}
|