@jqhtml/core 2.3.11 → 2.3.35
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 +113 -10
- package/dist/component.d.ts.map +1 -1
- package/dist/index.cjs +3645 -2636
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +9 -5
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3644 -2637
- package/dist/index.js.map +1 -1
- package/dist/instruction-processor.d.ts.map +1 -1
- package/dist/jqhtml-core.esm.js +3645 -2638
- package/dist/jqhtml-core.esm.js.map +1 -1
- package/dist/jquery-plugin.d.ts.map +1 -1
- package/dist/lifecycle-manager.d.ts +15 -4
- package/dist/lifecycle-manager.d.ts.map +1 -1
- package/dist/load-coordinator.d.ts +16 -3
- package/dist/load-coordinator.d.ts.map +1 -1
- package/dist/local-storage.d.ts +80 -16
- package/dist/local-storage.d.ts.map +1 -1
- package/dist/template-renderer.d.ts +5 -0
- package/dist/template-renderer.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/component.d.ts
CHANGED
|
@@ -34,7 +34,6 @@ export declare class Jqhtml_Component {
|
|
|
34
34
|
private _data_before_render;
|
|
35
35
|
private _lifecycle_callbacks;
|
|
36
36
|
private _lifecycle_states;
|
|
37
|
-
private __loading;
|
|
38
37
|
private _did_first_render;
|
|
39
38
|
private _render_count;
|
|
40
39
|
private _args_on_last_render;
|
|
@@ -44,6 +43,18 @@ export declare class Jqhtml_Component {
|
|
|
44
43
|
private _reload_debounced?;
|
|
45
44
|
private next_reload_force_refresh;
|
|
46
45
|
private __lifecycle_authorized;
|
|
46
|
+
private _cache_key;
|
|
47
|
+
private _cached_html;
|
|
48
|
+
private _used_cached_html;
|
|
49
|
+
private _should_cache_html_after_ready;
|
|
50
|
+
private _is_dynamic;
|
|
51
|
+
private _on_render_complete;
|
|
52
|
+
private _use_cached_data_hit;
|
|
53
|
+
private _skip_render_and_ready;
|
|
54
|
+
private _skip_ready;
|
|
55
|
+
private _has_rendered;
|
|
56
|
+
private _load_queue;
|
|
57
|
+
private __has_custom_on_load;
|
|
47
58
|
constructor(element?: any, args?: Record<string, any>);
|
|
48
59
|
/**
|
|
49
60
|
* Protect lifecycle methods from manual invocation
|
|
@@ -64,6 +75,13 @@ export declare class Jqhtml_Component {
|
|
|
64
75
|
* @private
|
|
65
76
|
*/
|
|
66
77
|
private _call_lifecycle_sync;
|
|
78
|
+
/**
|
|
79
|
+
* Check if on_load() is overridden in a subclass
|
|
80
|
+
* Used to skip the load phase entirely for components that don't fetch data
|
|
81
|
+
* Returns cached value set in _boot() for O(1) performance
|
|
82
|
+
* @private
|
|
83
|
+
*/
|
|
84
|
+
private _has_on_load;
|
|
67
85
|
/**
|
|
68
86
|
* Boot - Start the full component lifecycle
|
|
69
87
|
* Called immediately after construction by instruction processor
|
|
@@ -104,16 +122,47 @@ export declare class Jqhtml_Component {
|
|
|
104
122
|
redraw(id?: string | null): void;
|
|
105
123
|
/**
|
|
106
124
|
* Create phase - Quick setup, prepare UI
|
|
107
|
-
*
|
|
125
|
+
* SYNCHRONOUS - no awaits, no yields
|
|
108
126
|
*/
|
|
109
|
-
create():
|
|
127
|
+
create(): void;
|
|
110
128
|
/**
|
|
111
|
-
* Load phase - Fetch data
|
|
129
|
+
* Load phase - Fetch asynchronous data
|
|
112
130
|
* Called bottom-up, fully parallel
|
|
113
131
|
* NO DOM MODIFICATIONS ALLOWED IN THIS PHASE
|
|
132
|
+
*
|
|
133
|
+
* Key design: on_load() runs on a DETACHED proxy with a clone of this.data.
|
|
134
|
+
* The real component's this.data is not touched during on_load execution.
|
|
135
|
+
* After on_load completes, the result is applied via a sequential queue.
|
|
136
|
+
*
|
|
114
137
|
* @private - Internal lifecycle method, not for external use
|
|
115
138
|
*/
|
|
116
139
|
_load(): Promise<void>;
|
|
140
|
+
/**
|
|
141
|
+
* Execute on_load() on a fully detached proxy.
|
|
142
|
+
*
|
|
143
|
+
* The proxy has:
|
|
144
|
+
* - A CLONE of this.data (from __initial_data_snapshot)
|
|
145
|
+
* - Read-only access to this.args
|
|
146
|
+
* - No access to anything else (this.$, this.sid, etc.)
|
|
147
|
+
*
|
|
148
|
+
* This ensures on_load runs completely isolated from the component instance.
|
|
149
|
+
*
|
|
150
|
+
* @param use_load_coordinator - If true, register with Load_Coordinator for deduplication
|
|
151
|
+
* @returns The resulting data from the proxy after on_load completes
|
|
152
|
+
* @private
|
|
153
|
+
*/
|
|
154
|
+
private _execute_on_load_detached;
|
|
155
|
+
/**
|
|
156
|
+
* Apply the result of on_load() to this.data via the sequential queue.
|
|
157
|
+
*
|
|
158
|
+
* Multiple _load calls can execute on_load in parallel, but this method
|
|
159
|
+
* ensures that setting this.data happens in FIFO order.
|
|
160
|
+
*
|
|
161
|
+
* @param result_data - The data returned from _execute_on_load_detached
|
|
162
|
+
* @param data_before_load - JSON string of this.data before on_load (for change detection), or null
|
|
163
|
+
* @private
|
|
164
|
+
*/
|
|
165
|
+
private _apply_load_result;
|
|
117
166
|
/**
|
|
118
167
|
* Ready phase - Component fully initialized
|
|
119
168
|
* Called bottom-up (children before parent)
|
|
@@ -142,12 +191,42 @@ export declare class Jqhtml_Component {
|
|
|
142
191
|
* @param callback Optional callback to execute when ready
|
|
143
192
|
*/
|
|
144
193
|
ready(callback?: () => void): Promise<void>;
|
|
194
|
+
/**
|
|
195
|
+
* Returns a promise that resolves when the component has completed its
|
|
196
|
+
* synchronous render chain (after on_load's re-render if applicable,
|
|
197
|
+
* or after first render if no on_load override).
|
|
198
|
+
*
|
|
199
|
+
* This fires BEFORE on_ready() and before children are waited on.
|
|
200
|
+
* Use this when you need to know the component's DOM is stable but
|
|
201
|
+
* don't need to wait for the full async ready phase.
|
|
202
|
+
*
|
|
203
|
+
* The 'rendered' event fires exactly once per component lifecycle.
|
|
204
|
+
*
|
|
205
|
+
* @example
|
|
206
|
+
* await component.rendered();
|
|
207
|
+
* // DOM is now stable, on_render has completed
|
|
208
|
+
*
|
|
209
|
+
* @param callback Optional callback to execute when rendered
|
|
210
|
+
*/
|
|
211
|
+
rendered(callback?: () => void): Promise<void>;
|
|
145
212
|
/**
|
|
146
213
|
* Wait for all child components to reach ready state
|
|
147
214
|
* Ensures bottom-up ordering (children ready before parent)
|
|
148
215
|
* @private
|
|
149
216
|
*/
|
|
150
217
|
private _wait_for_children_ready;
|
|
218
|
+
/**
|
|
219
|
+
* Wait for all child components to complete on_render (post-on_load)
|
|
220
|
+
* Used by HTML cache mode to ensure DOM is fully rendered before taking snapshot
|
|
221
|
+
*
|
|
222
|
+
* HTML CACHE ARCHITECTURE:
|
|
223
|
+
* - Parent waits for all children to complete their on_render after on_load
|
|
224
|
+
* - This ensures the HTML snapshot captures fully rendered DOM
|
|
225
|
+
* - Static parents (is_dynamic=false) don't block - they immediately let children proceed
|
|
226
|
+
*
|
|
227
|
+
* @private
|
|
228
|
+
*/
|
|
229
|
+
private _wait_for_children_on_render;
|
|
151
230
|
/**
|
|
152
231
|
* Reload component - re-fetch data and re-render (debounced)
|
|
153
232
|
*
|
|
@@ -219,11 +298,11 @@ export declare class Jqhtml_Component {
|
|
|
219
298
|
* Leaves DOM intact, just stops lifecycle engine and fires cleanup hooks
|
|
220
299
|
*/
|
|
221
300
|
stop(): void;
|
|
222
|
-
on_render(): void
|
|
223
|
-
on_create(): void
|
|
224
|
-
on_load(): Promise<void>;
|
|
301
|
+
on_render(): void;
|
|
302
|
+
on_create(): void;
|
|
303
|
+
on_load(): void | Promise<void>;
|
|
225
304
|
on_ready(): Promise<void>;
|
|
226
|
-
on_stop(): void
|
|
305
|
+
on_stop(): void;
|
|
227
306
|
/**
|
|
228
307
|
* Optional: Override cache key generation
|
|
229
308
|
*
|
|
@@ -255,18 +334,42 @@ export declare class Jqhtml_Component {
|
|
|
255
334
|
* Lifecycle event callbacks fire after the lifecycle method completes
|
|
256
335
|
* If a lifecycle event has already occurred, the callback fires immediately AND registers for future occurrences
|
|
257
336
|
* Custom events only fire when explicitly triggered via .trigger()
|
|
337
|
+
*
|
|
338
|
+
* Callback signature: (component, data?) => void
|
|
339
|
+
* - component: The component instance that triggered the event
|
|
340
|
+
* - data: Optional data passed as second parameter to trigger()
|
|
258
341
|
*/
|
|
259
|
-
on(event_name: string, callback: (component: Jqhtml_Component) => void): this;
|
|
342
|
+
on(event_name: string, callback: (component: Jqhtml_Component, data?: any) => void): this;
|
|
260
343
|
/**
|
|
261
344
|
* Trigger a lifecycle event - fires all registered callbacks
|
|
262
345
|
* Marks event as occurred so future .on() calls fire immediately
|
|
346
|
+
*
|
|
347
|
+
* @param event_name - Name of the event to trigger
|
|
348
|
+
* @param data - Optional data to pass to callbacks as second parameter
|
|
263
349
|
*/
|
|
264
|
-
trigger(event_name: string): void;
|
|
350
|
+
trigger(event_name: string, data?: any): void;
|
|
265
351
|
/**
|
|
266
352
|
* Check if any callbacks are registered for a given event
|
|
267
353
|
* Used to determine if cleanup logic needs to run
|
|
268
354
|
*/
|
|
269
355
|
_on_registered(event_name: string): boolean;
|
|
356
|
+
/**
|
|
357
|
+
* Invalidate a lifecycle event - removes the "already occurred" marker
|
|
358
|
+
*
|
|
359
|
+
* This is the opposite of trigger(). After invalidate() is called:
|
|
360
|
+
* - New .on() handlers will NOT fire immediately
|
|
361
|
+
* - The ready() promise will NOT resolve immediately
|
|
362
|
+
* - Handlers wait for the next trigger() call
|
|
363
|
+
*
|
|
364
|
+
* Existing registered callbacks are NOT removed - they'll fire on next trigger().
|
|
365
|
+
*
|
|
366
|
+
* Use case: Call invalidate('ready') at the start of reload() or render()
|
|
367
|
+
* so that any new .on('ready') handlers wait for the reload/render to complete
|
|
368
|
+
* rather than firing immediately based on the previous lifecycle's state.
|
|
369
|
+
*
|
|
370
|
+
* @param event_name - Name of the event to invalidate
|
|
371
|
+
*/
|
|
372
|
+
invalidate(event_name: string): void;
|
|
270
373
|
/**
|
|
271
374
|
* Find element by scoped ID
|
|
272
375
|
*
|
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;AAgBH,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,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,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IAC3B,IAAI,EAAE,MAAM,CAAC;IACb,YAAY,EAAE,MAAM,CAAK;IAGzB,OAAO,CAAC,kBAAkB,CAAmB;IAC7C,OAAO,CAAC,aAAa,CAAiC;IACtD,OAAO,CAAC,WAAW,CAAiC;IACpD,OAAO,CAAC,aAAa,CAAoC;IACzD,OAAO,CAAC,iBAAiB,CAAkB;IAC3C,OAAO,CAAC,QAAQ,CAAkB;IAClC,OAAO,CAAC,OAAO,CAAkB;IACjC,OAAO,CAAC,mBAAmB,CAAuB;IAClD,OAAO,CAAC,oBAAoB,CAAwE;IACpG,OAAO,CAAC,iBAAiB,CAA+B;IACxD,OAAO,CAAC,iBAAiB,CAAkB;IAC3C,OAAO,CAAC,aAAa,CAAa;IAClC,OAAO,CAA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