@jqhtml/core 2.3.71 → 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 +253 -61
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +4 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +252 -62
- package/dist/index.js.map +1 -1
- package/dist/jqhtml-core.esm.js +253 -63
- 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/package.json +1 -1
package/dist/jqhtml-core.esm.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* JQHTML Core v2.3.
|
|
2
|
+
* JQHTML Core v2.3.72
|
|
3
3
|
* (c) 2025 JQHTML Team
|
|
4
4
|
* Released under the MIT License
|
|
5
5
|
*/
|
|
@@ -219,12 +219,17 @@ class LifecycleManager {
|
|
|
219
219
|
return LifecycleManager.instance;
|
|
220
220
|
}
|
|
221
221
|
constructor() {
|
|
222
|
-
|
|
223
|
-
//
|
|
224
|
-
//
|
|
225
|
-
//
|
|
222
|
+
// Components stop explicitly via:
|
|
223
|
+
// 1. Parent component re-render (stops descendants before clearing innerHTML)
|
|
224
|
+
// 2. Any jQuery removal that reaches jQuery.cleanData (.remove(), .empty(),
|
|
225
|
+
// .html(x), .text(x), .replaceWith(), .replaceAll()) - hooked in jquery-plugin.ts
|
|
226
226
|
// 3. Explicit .stop() call
|
|
227
|
-
//
|
|
227
|
+
// Native DOM removal is NOT observed for stop; 'detach' (dom-attachment.ts) is the
|
|
228
|
+
// signal for that. Moving a component within the document never stops it.
|
|
229
|
+
//
|
|
230
|
+
// There is deliberately no registry of live components here. The DOM (via
|
|
231
|
+
// element.data('_component')) is the only owner; a registry would pin every
|
|
232
|
+
// component that left the document without being stopped.
|
|
228
233
|
}
|
|
229
234
|
/**
|
|
230
235
|
* Boot a component - run its full lifecycle
|
|
@@ -235,7 +240,6 @@ class LifecycleManager {
|
|
|
235
240
|
* - _load_render_only: on_create + render + on_load + re-render. No on_render, no on_loaded, no on_ready.
|
|
236
241
|
*/
|
|
237
242
|
async boot_component(component) {
|
|
238
|
-
this.active_components.add(component);
|
|
239
243
|
try {
|
|
240
244
|
// Create phase - SYNCHRONOUS, runs BEFORE first render
|
|
241
245
|
component.create();
|
|
@@ -396,12 +400,6 @@ class LifecycleManager {
|
|
|
396
400
|
}
|
|
397
401
|
}
|
|
398
402
|
}
|
|
399
|
-
/**
|
|
400
|
-
* Unregister a component (called on destroy)
|
|
401
|
-
*/
|
|
402
|
-
unregister_component(component) {
|
|
403
|
-
this.active_components.delete(component);
|
|
404
|
-
}
|
|
405
403
|
}
|
|
406
404
|
|
|
407
405
|
/**
|
|
@@ -1620,7 +1618,7 @@ function serialize_for_cache_key(value) {
|
|
|
1620
1618
|
const class_registry = Object.create(null);
|
|
1621
1619
|
// Markers for serialized class instances (unique to avoid collisions with user data)
|
|
1622
1620
|
// Replaced at build time by rollup (see rollup.config.js).
|
|
1623
|
-
const CORE_VERSION = '2.3.
|
|
1621
|
+
const CORE_VERSION = '2.3.72';
|
|
1624
1622
|
const CLASS_MARKER = '__jqhtml_class__';
|
|
1625
1623
|
const PROPS_MARKER = '__jqhtml_props__';
|
|
1626
1624
|
/**
|
|
@@ -3181,6 +3179,85 @@ async function execute_on_load_detached(component, dedup_key = null) {
|
|
|
3181
3179
|
};
|
|
3182
3180
|
}
|
|
3183
3181
|
|
|
3182
|
+
/**
|
|
3183
|
+
* JQHTML DOM Attachment Tracking
|
|
3184
|
+
*
|
|
3185
|
+
* Backs the component 'attach' / 'detach' lifecycle events.
|
|
3186
|
+
*
|
|
3187
|
+
* One document-level MutationObserver (childList + subtree) is installed the first
|
|
3188
|
+
* time any component expresses interest in attachment, and disconnected when the
|
|
3189
|
+
* last interested component is stopped or collected. The observer never inspects
|
|
3190
|
+
* mutation records: it is only a "the tree changed" tick. On each batch it walks
|
|
3191
|
+
* the tracked components and asks each to compare its root's isConnected against
|
|
3192
|
+
* its own recorded attachment state (Jqhtml_Component._attachment_check()). Cost is
|
|
3193
|
+
* O(tracked components) per mutation batch, independent of how much of the page
|
|
3194
|
+
* changed, and zero when nothing has opted in.
|
|
3195
|
+
*
|
|
3196
|
+
* Because MutationObserver delivers per microtask, a node moved synchronously
|
|
3197
|
+
* (remove + insert in one task, e.g. appendTo) never shows a transition. Only a
|
|
3198
|
+
* component whose root is actually off-document when the batch flushes is detached.
|
|
3199
|
+
*
|
|
3200
|
+
* Tracked components are held by WeakRef. A component that is removed from the
|
|
3201
|
+
* document natively (never stopped) and then dropped by everything else is therefore
|
|
3202
|
+
* collectable: the tracker pins nothing. Dead refs are pruned on the next batch.
|
|
3203
|
+
*/
|
|
3204
|
+
const tracked = new Set();
|
|
3205
|
+
const ref_of = new WeakMap();
|
|
3206
|
+
let observer = null;
|
|
3207
|
+
function on_mutation() {
|
|
3208
|
+
for (const ref of tracked) {
|
|
3209
|
+
const component = ref.deref();
|
|
3210
|
+
if (!component || component._stopped) {
|
|
3211
|
+
tracked.delete(ref);
|
|
3212
|
+
continue;
|
|
3213
|
+
}
|
|
3214
|
+
component._attachment_check();
|
|
3215
|
+
}
|
|
3216
|
+
if (tracked.size === 0)
|
|
3217
|
+
disconnect();
|
|
3218
|
+
}
|
|
3219
|
+
function connect() {
|
|
3220
|
+
if (observer !== null)
|
|
3221
|
+
return;
|
|
3222
|
+
if (typeof MutationObserver === 'undefined' || typeof document === 'undefined')
|
|
3223
|
+
return;
|
|
3224
|
+
observer = new MutationObserver(on_mutation);
|
|
3225
|
+
observer.observe(document.documentElement, { childList: true, subtree: true });
|
|
3226
|
+
}
|
|
3227
|
+
function disconnect() {
|
|
3228
|
+
if (observer === null)
|
|
3229
|
+
return;
|
|
3230
|
+
observer.disconnect();
|
|
3231
|
+
observer = null;
|
|
3232
|
+
}
|
|
3233
|
+
/** Start watching a component's root for attach/detach transitions. Idempotent. */
|
|
3234
|
+
function track_attachment(component) {
|
|
3235
|
+
if (ref_of.has(component))
|
|
3236
|
+
return;
|
|
3237
|
+
const ref = new WeakRef(component);
|
|
3238
|
+
ref_of.set(component, ref);
|
|
3239
|
+
tracked.add(ref);
|
|
3240
|
+
connect();
|
|
3241
|
+
}
|
|
3242
|
+
/** Stop watching a component (called from _stop()). Idempotent. */
|
|
3243
|
+
function untrack_attachment(component) {
|
|
3244
|
+
const ref = ref_of.get(component);
|
|
3245
|
+
if (!ref)
|
|
3246
|
+
return;
|
|
3247
|
+
ref_of.delete(component);
|
|
3248
|
+
tracked.delete(ref);
|
|
3249
|
+
if (tracked.size === 0)
|
|
3250
|
+
disconnect();
|
|
3251
|
+
}
|
|
3252
|
+
/** Number of components currently tracked (diagnostics / tests). */
|
|
3253
|
+
function tracked_attachment_count() {
|
|
3254
|
+
return tracked.size;
|
|
3255
|
+
}
|
|
3256
|
+
/** Whether the document observer is currently installed (diagnostics / tests). */
|
|
3257
|
+
function attachment_observer_active() {
|
|
3258
|
+
return observer !== null;
|
|
3259
|
+
}
|
|
3260
|
+
|
|
3184
3261
|
/**
|
|
3185
3262
|
* JQHTML Component Cache Integration
|
|
3186
3263
|
*
|
|
@@ -4089,6 +4166,12 @@ class Jqhtml_Component {
|
|
|
4089
4166
|
this.__load_gates = []; // Pending gates (cleared once the first load begins)
|
|
4090
4167
|
this.__first_load_started = false; // Latch: true once the first load phase begins (enforces one-shot + throw-after)
|
|
4091
4168
|
this.__gate_resume = null; // Resolver to release an in-progress gate wait early (reload/refresh/stop)
|
|
4169
|
+
// DOM attachment state machine - see _attachment_check() / dom-attachment.ts.
|
|
4170
|
+
// _attached is the component's OWN belief about whether it is in the document;
|
|
4171
|
+
// it flips at most once per direction, and 'attach' / 'detach' fire only on a flip.
|
|
4172
|
+
this._attached = false;
|
|
4173
|
+
this._attachment_checked = false; // First check has run (after the first 'ready' dispatch)
|
|
4174
|
+
this._attachment_tracking = false; // Something is interested: on_attach/on_detach overridden, or .on('attach'|'detach')
|
|
4092
4175
|
// Detect custom on_load() override immediately
|
|
4093
4176
|
// Prototype chain is set up before constructor runs, so this.on_load
|
|
4094
4177
|
// correctly resolves to child class override if one exists
|
|
@@ -4162,6 +4245,12 @@ class Jqhtml_Component {
|
|
|
4162
4245
|
// Initialize this.state as an empty object (convention for arbitrary component state)
|
|
4163
4246
|
// No special meaning to framework - mutable anywhere, not cached, not frozen
|
|
4164
4247
|
this.state = {};
|
|
4248
|
+
// Overriding on_attach()/on_detach() is interest in attachment tracking. Tracking
|
|
4249
|
+
// itself only starts after the first 'ready' dispatch (see _attachment_check()).
|
|
4250
|
+
if (this.on_attach !== Jqhtml_Component.prototype.on_attach ||
|
|
4251
|
+
this.on_detach !== Jqhtml_Component.prototype.on_detach) {
|
|
4252
|
+
this._attachment_tracking = true;
|
|
4253
|
+
}
|
|
4165
4254
|
this._log_lifecycle('construct', 'complete');
|
|
4166
4255
|
}
|
|
4167
4256
|
/**
|
|
@@ -4175,7 +4264,9 @@ class Jqhtml_Component {
|
|
|
4175
4264
|
on_render: 'Use render() to trigger a re-render.',
|
|
4176
4265
|
on_load: 'Use reload() to refresh data.',
|
|
4177
4266
|
on_ready: 'Called automatically when ready.',
|
|
4178
|
-
on_stop: 'Use stop() to stop the component.'
|
|
4267
|
+
on_stop: 'Use stop() to stop the component.',
|
|
4268
|
+
on_attach: 'Called automatically when the component enters the document.',
|
|
4269
|
+
on_detach: 'Called automatically when the component leaves the document.'
|
|
4179
4270
|
};
|
|
4180
4271
|
const impls = {};
|
|
4181
4272
|
const self = this;
|
|
@@ -5529,8 +5620,13 @@ class Jqhtml_Component {
|
|
|
5529
5620
|
// stopped children into the parent's registry.
|
|
5530
5621
|
this._log_lifecycle('destroy', 'start');
|
|
5531
5622
|
this.$.addClass('_Component_Stopped');
|
|
5532
|
-
//
|
|
5533
|
-
|
|
5623
|
+
// A component that believes it is attached is detached first, so 'detach' always
|
|
5624
|
+
// precedes 'stop' and subscribers can rely on strict attach/detach alternation.
|
|
5625
|
+
// A component that never fired 'attach' (stopped before ready, or born and kept
|
|
5626
|
+
// off-document) fires no 'detach' either. Either way it leaves the tracker.
|
|
5627
|
+
if (this._attached)
|
|
5628
|
+
this._transition_attachment(false);
|
|
5629
|
+
untrack_attachment(this);
|
|
5534
5630
|
// Call user's on_stop() hook with authorization (sync) - only when actually
|
|
5535
5631
|
// overridden, since _call_lifecycle_sync() on the base no-op costs per child
|
|
5536
5632
|
// on every re-render.
|
|
@@ -5575,6 +5671,89 @@ class Jqhtml_Component {
|
|
|
5575
5671
|
on_loaded() { } // Override to process loaded data (e.g., clone this.data to this.state)
|
|
5576
5672
|
async on_ready() { }
|
|
5577
5673
|
on_stop() { }
|
|
5674
|
+
on_attach() { } // Sync. Root entered the document (first checked after 'ready')
|
|
5675
|
+
on_detach() { } // Sync. Root left the document, or the component is being stopped while attached
|
|
5676
|
+
// -------------------------------------------------------------------------
|
|
5677
|
+
// DOM attachment state machine
|
|
5678
|
+
// -------------------------------------------------------------------------
|
|
5679
|
+
/**
|
|
5680
|
+
* Whether this component currently considers itself attached to the document.
|
|
5681
|
+
*
|
|
5682
|
+
* This is the component's recorded state, not a live isConnected read: it is
|
|
5683
|
+
* false until the first check after 'ready', and from then on flips only when a
|
|
5684
|
+
* transition is observed (or on stop()). It is exactly the state 'attach' and
|
|
5685
|
+
* 'detach' have reported.
|
|
5686
|
+
*/
|
|
5687
|
+
is_attached() {
|
|
5688
|
+
return this._attached;
|
|
5689
|
+
}
|
|
5690
|
+
/**
|
|
5691
|
+
* Flip the recorded state and fire the matching hook + event. The opposite
|
|
5692
|
+
* sticky event is invalidated first, so a late subscriber only ever sees the
|
|
5693
|
+
* current state. Hook errors are isolated; the event still fires.
|
|
5694
|
+
* @private
|
|
5695
|
+
*/
|
|
5696
|
+
_transition_attachment(attached) {
|
|
5697
|
+
this._attached = attached;
|
|
5698
|
+
const event_name = attached ? 'attach' : 'detach';
|
|
5699
|
+
const hook_name = attached ? 'on_attach' : 'on_detach';
|
|
5700
|
+
this.invalidate(attached ? 'detach' : 'attach');
|
|
5701
|
+
if (this[hook_name] !== Jqhtml_Component.prototype[hook_name]) {
|
|
5702
|
+
try {
|
|
5703
|
+
const result = this._call_lifecycle_sync(hook_name);
|
|
5704
|
+
if (result && typeof result.then === 'function') {
|
|
5705
|
+
console.warn(`[JQHTML] Component "${this.component_name()}" returned a Promise from ${hook_name}(). ` +
|
|
5706
|
+
`${hook_name}() must be synchronous code. Remove 'async' from the function declaration.`);
|
|
5707
|
+
}
|
|
5708
|
+
}
|
|
5709
|
+
catch (error) {
|
|
5710
|
+
console.error(`[JQHTML] Error in ${hook_name}() for ${this.component_name()}:`, error);
|
|
5711
|
+
}
|
|
5712
|
+
}
|
|
5713
|
+
this.trigger(event_name);
|
|
5714
|
+
}
|
|
5715
|
+
/**
|
|
5716
|
+
* Compare the root's live connectivity with the recorded state and transition
|
|
5717
|
+
* on a difference. Idempotent. Called by the document observer on every
|
|
5718
|
+
* mutation batch for tracked components, and directly by the framework after
|
|
5719
|
+
* 'ready' and when interest is registered late.
|
|
5720
|
+
* @private
|
|
5721
|
+
*/
|
|
5722
|
+
_attachment_check() {
|
|
5723
|
+
if (this._stopped)
|
|
5724
|
+
return;
|
|
5725
|
+
const connected = !!this.$[0].isConnected;
|
|
5726
|
+
if (connected !== this._attached)
|
|
5727
|
+
this._transition_attachment(connected);
|
|
5728
|
+
}
|
|
5729
|
+
/**
|
|
5730
|
+
* The first check, run once the 'ready' handlers have completed. Fires 'attach'
|
|
5731
|
+
* if the component was born attached, even with no listener, so a later
|
|
5732
|
+
* .on('attach') gets the sticky fire. Deferred interest starts tracking here.
|
|
5733
|
+
* @private
|
|
5734
|
+
*/
|
|
5735
|
+
_attachment_first_check() {
|
|
5736
|
+
const first = !this._attachment_checked;
|
|
5737
|
+
this._attachment_checked = true;
|
|
5738
|
+
this._attachment_check();
|
|
5739
|
+
if (first && this._attachment_tracking)
|
|
5740
|
+
track_attachment(this);
|
|
5741
|
+
}
|
|
5742
|
+
/**
|
|
5743
|
+
* Register interest in attach/detach. Before the first ready check this only
|
|
5744
|
+
* records the interest; after it, tracking starts immediately and a check runs
|
|
5745
|
+
* at once, so a late subscriber on a natively-removed component sees 'detach'.
|
|
5746
|
+
* @private
|
|
5747
|
+
*/
|
|
5748
|
+
_watch_attachment() {
|
|
5749
|
+
if (this._attachment_tracking)
|
|
5750
|
+
return;
|
|
5751
|
+
this._attachment_tracking = true;
|
|
5752
|
+
if (this._attachment_checked && !this._stopped) {
|
|
5753
|
+
track_attachment(this);
|
|
5754
|
+
this._attachment_check();
|
|
5755
|
+
}
|
|
5756
|
+
}
|
|
5578
5757
|
/**
|
|
5579
5758
|
* Called with the viewport width in CSS pixels:
|
|
5580
5759
|
* - after every on_render()
|
|
@@ -5639,6 +5818,8 @@ class Jqhtml_Component {
|
|
|
5639
5818
|
* @see component-events.ts for full documentation
|
|
5640
5819
|
*/
|
|
5641
5820
|
on(event_name, callback) {
|
|
5821
|
+
if (event_name === 'attach' || event_name === 'detach')
|
|
5822
|
+
this._watch_attachment();
|
|
5642
5823
|
return event_on(this, event_name, callback);
|
|
5643
5824
|
}
|
|
5644
5825
|
/**
|
|
@@ -5647,14 +5828,24 @@ class Jqhtml_Component {
|
|
|
5647
5828
|
* @see component-events.ts for full documentation
|
|
5648
5829
|
*/
|
|
5649
5830
|
once(event_name, callback) {
|
|
5831
|
+
if (event_name === 'attach' || event_name === 'detach')
|
|
5832
|
+
this._watch_attachment();
|
|
5650
5833
|
return event_once(this, event_name, callback);
|
|
5651
5834
|
}
|
|
5652
5835
|
/**
|
|
5653
5836
|
* Trigger a lifecycle event - delegates to component-events.ts
|
|
5654
5837
|
* @see component-events.ts for full documentation
|
|
5838
|
+
*
|
|
5839
|
+
* 'ready' is special: once its handlers have run, the component runs its first
|
|
5840
|
+
* attachment check (and every later one, idempotently). Doing it here rather than
|
|
5841
|
+
* at each of the call sites that trigger 'ready' guarantees the order
|
|
5842
|
+
* on_ready() -> 'ready' handlers -> 'attach', so everything on_ready() set up is
|
|
5843
|
+
* complete before anyone learns the component is in the document.
|
|
5655
5844
|
*/
|
|
5656
5845
|
trigger(event_name, data) {
|
|
5657
5846
|
event_trigger(this, event_name, data);
|
|
5847
|
+
if (event_name === 'ready' && !this._stopped)
|
|
5848
|
+
this._attachment_first_check();
|
|
5658
5849
|
}
|
|
5659
5850
|
/**
|
|
5660
5851
|
* Check if any callbacks are registered for a given event
|
|
@@ -7088,9 +7279,42 @@ function init_jquery_plugin(jQuery) {
|
|
|
7088
7279
|
return jQuery(results);
|
|
7089
7280
|
};
|
|
7090
7281
|
// Store original jQuery methods
|
|
7091
|
-
const originalEmpty = jQuery.fn.empty;
|
|
7092
7282
|
const originalHtml = jQuery.fn.html;
|
|
7093
|
-
|
|
7283
|
+
// ---------------------------------------------------------------------------
|
|
7284
|
+
// Stop components on every jQuery-driven removal by hooking jQuery.cleanData.
|
|
7285
|
+
//
|
|
7286
|
+
// jQuery routes .remove(), .empty(), .html(x), .text(x), .replaceWith() and
|
|
7287
|
+
// .replaceAll() through jQuery.cleanData(elems) to drop the data store and
|
|
7288
|
+
// handlers of every element about to leave the tree - and `elems` is already the
|
|
7289
|
+
// flattened subtree, in document order (parent before child). Stopping here is
|
|
7290
|
+
// therefore one classList check per removed element, no extra traversal, and
|
|
7291
|
+
// covers every jQuery removal path at once. It is the same hook jQuery UI's
|
|
7292
|
+
// widget factory uses for the same reason.
|
|
7293
|
+
//
|
|
7294
|
+
// It MUST be installed on the original jQuery object: jQuery's own code calls
|
|
7295
|
+
// cleanData through its closure-local reference, not through our wrapper. The
|
|
7296
|
+
// wrapper's copied static is updated below so both names agree.
|
|
7297
|
+
//
|
|
7298
|
+
// .detach() does NOT call cleanData, by jQuery's own design (it keeps data for
|
|
7299
|
+
// reinsertion), and native DOM removal (el.remove(), innerHTML = '') bypasses
|
|
7300
|
+
// jQuery entirely. Neither stops a component; the 'detach' lifecycle event is
|
|
7301
|
+
// the signal for those. Moving a component (.appendTo) is not a removal.
|
|
7302
|
+
// ---------------------------------------------------------------------------
|
|
7303
|
+
const originalCleanData = _jqhtml_original_jquery.cleanData;
|
|
7304
|
+
const cleanDataWithComponentStop = function (elems) {
|
|
7305
|
+
for (let i = 0; i < elems.length; i++) {
|
|
7306
|
+
const el = elems[i];
|
|
7307
|
+
if (el.nodeType !== 1 || !el.classList.contains('Component'))
|
|
7308
|
+
continue;
|
|
7309
|
+
const component = _jqhtml_original_jquery.data(el, '_component');
|
|
7310
|
+
if (component && !component._stopped) {
|
|
7311
|
+
component._stop(); // Not recursive: every descendant is in elems too
|
|
7312
|
+
}
|
|
7313
|
+
}
|
|
7314
|
+
return originalCleanData(elems);
|
|
7315
|
+
};
|
|
7316
|
+
_jqhtml_original_jquery.cleanData = cleanDataWithComponentStop;
|
|
7317
|
+
jQuery.cleanData = cleanDataWithComponentStop;
|
|
7094
7318
|
// ---------------------------------------------------------------------------
|
|
7095
7319
|
// Guard against hand-creating elements with data-sid via jQuery.
|
|
7096
7320
|
//
|
|
@@ -7147,53 +7371,15 @@ function init_jquery_plugin(jQuery) {
|
|
|
7147
7371
|
` • <div class="MyComponent__${sid}"> → .find('.MyComponent__${sid}')`);
|
|
7148
7372
|
};
|
|
7149
7373
|
/**
|
|
7150
|
-
* Override jQuery.fn.
|
|
7151
|
-
*
|
|
7152
|
-
*/
|
|
7153
|
-
jQuery.fn.empty = function () {
|
|
7154
|
-
return this.each(function () {
|
|
7155
|
-
// Stop all child components before clearing DOM
|
|
7156
|
-
jQuery(this).find('.Component').each(function () {
|
|
7157
|
-
const component = jQuery(this).data('_component');
|
|
7158
|
-
if (component && !component._stopped) {
|
|
7159
|
-
component._stop(); // Stop just the component, DOM will be cleared anyway
|
|
7160
|
-
}
|
|
7161
|
-
});
|
|
7162
|
-
// Call original empty
|
|
7163
|
-
originalEmpty.call(jQuery(this));
|
|
7164
|
-
});
|
|
7165
|
-
};
|
|
7166
|
-
/**
|
|
7167
|
-
* Override jQuery.fn.html() to stop child components when setting new content
|
|
7168
|
-
* When used as setter, calls .empty() first to properly cleanup components
|
|
7374
|
+
* Override jQuery.fn.html() setter to reject hand-written data-sid before the
|
|
7375
|
+
* DOM is mutated. Component stopping is handled by the cleanData hook above.
|
|
7169
7376
|
*/
|
|
7170
7377
|
jQuery.fn.html = function (value) {
|
|
7171
|
-
// Getter - just pass through
|
|
7172
7378
|
if (arguments.length === 0) {
|
|
7173
7379
|
return originalHtml.call(this);
|
|
7174
7380
|
}
|
|
7175
|
-
// Reject hand-written data-sid before mutating the DOM
|
|
7176
7381
|
assert_no_manual_sid(value, '.html()');
|
|
7177
|
-
|
|
7178
|
-
return this.each(function () {
|
|
7179
|
-
jQuery(this).empty();
|
|
7180
|
-
originalHtml.call(jQuery(this), value);
|
|
7181
|
-
});
|
|
7182
|
-
};
|
|
7183
|
-
/**
|
|
7184
|
-
* Override jQuery.fn.text() to stop child components when setting new content
|
|
7185
|
-
* When used as setter, calls .empty() first to properly cleanup components
|
|
7186
|
-
*/
|
|
7187
|
-
jQuery.fn.text = function (value) {
|
|
7188
|
-
// Getter - just pass through
|
|
7189
|
-
if (arguments.length === 0) {
|
|
7190
|
-
return originalText.call(this);
|
|
7191
|
-
}
|
|
7192
|
-
// Setter - empty first (which stops components), then set content
|
|
7193
|
-
return this.each(function () {
|
|
7194
|
-
jQuery(this).empty();
|
|
7195
|
-
originalText.call(jQuery(this), value);
|
|
7196
|
-
});
|
|
7382
|
+
return originalHtml.call(this, value);
|
|
7197
7383
|
};
|
|
7198
7384
|
// Store original jQuery.fn.on
|
|
7199
7385
|
const originalOn = jQuery.fn.on;
|
|
@@ -7335,7 +7521,7 @@ function init(jQuery, config) {
|
|
|
7335
7521
|
}
|
|
7336
7522
|
}
|
|
7337
7523
|
// Version - will be replaced during build with actual version from package.json
|
|
7338
|
-
const version = '2.3.
|
|
7524
|
+
const version = '2.3.72';
|
|
7339
7525
|
// Default export with all functionality
|
|
7340
7526
|
const jqhtml = {
|
|
7341
7527
|
// Core
|
|
@@ -7450,7 +7636,11 @@ const jqhtml = {
|
|
|
7450
7636
|
get_captured_data,
|
|
7451
7637
|
stop_data_capture,
|
|
7452
7638
|
set_preload_data,
|
|
7453
|
-
clear_preload_data
|
|
7639
|
+
clear_preload_data,
|
|
7640
|
+
// Attachment tracking diagnostics - how many components are watched for
|
|
7641
|
+
// attach/detach and whether the document observer is currently installed
|
|
7642
|
+
tracked_attachment_count,
|
|
7643
|
+
attachment_observer_active
|
|
7454
7644
|
};
|
|
7455
7645
|
// Auto-register on window for browser environments
|
|
7456
7646
|
// This is REQUIRED for compiled templates which use window.jqhtml.register_template()
|
|
@@ -7480,5 +7670,5 @@ if (typeof window !== 'undefined' && !window.jqhtml) {
|
|
|
7480
7670
|
}
|
|
7481
7671
|
}
|
|
7482
7672
|
|
|
7483
|
-
export { COMPONENT_NAME_PATTERN, COMPONENT_NAME_RULE, Jqhtml_Component, LifecycleManager as Jqhtml_LifecycleManager, Jqhtml_Local_Storage, LifecycleManager, Load_Coordinator, add_object_printer, applyDebugDelay, boot, clear_preload_data, configure, create_component, debug_overlay, jqhtml as default, devWarn, dynamic_component_name, escape_html, escape_html_nl2br, extract_slots, get_captured_data, get_component_class, get_component_names, get_config, get_object_printers, get_registered_templates, get_template, get_template_by_class, handleComponentError, has_component, init, init_jquery_plugin, isSequentialProcessing, is_component_name, list_components, logDataChange, logDispatch, logInstruction, logLifecycle, print_object, process_instructions, register, register_cache_class, register_component, register_template, set_preload_data, start_data_capture, stop_data_capture, version };
|
|
7673
|
+
export { COMPONENT_NAME_PATTERN, COMPONENT_NAME_RULE, Jqhtml_Component, LifecycleManager as Jqhtml_LifecycleManager, Jqhtml_Local_Storage, LifecycleManager, Load_Coordinator, add_object_printer, applyDebugDelay, attachment_observer_active, boot, clear_preload_data, configure, create_component, debug_overlay, jqhtml as default, devWarn, dynamic_component_name, escape_html, escape_html_nl2br, extract_slots, get_captured_data, get_component_class, get_component_names, get_config, get_object_printers, get_registered_templates, get_template, get_template_by_class, handleComponentError, has_component, init, init_jquery_plugin, isSequentialProcessing, is_component_name, list_components, logDataChange, logDispatch, logInstruction, logLifecycle, print_object, process_instructions, register, register_cache_class, register_component, register_template, set_preload_data, start_data_capture, stop_data_capture, tracked_attachment_count, version };
|
|
7484
7674
|
//# sourceMappingURL=jqhtml-core.esm.js.map
|