@jqhtml/core 2.3.13 → 2.3.50

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/LICENSE CHANGED
@@ -1,6 +1,6 @@
1
1
  MIT License
2
2
 
3
- Copyright (c) 2024 JQHTML Team
3
+ Copyright (c) 2026 HansonXyz
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
@@ -0,0 +1,56 @@
1
+ /**
2
+ * JQHTML Component Cache Integration
3
+ *
4
+ * Extracted from component.ts - handles cache key generation,
5
+ * cache reads during create(), cache checks during reload(),
6
+ * and HTML cache snapshots during ready().
7
+ *
8
+ * Uses Jqhtml_Local_Storage as the underlying storage layer.
9
+ */
10
+ /**
11
+ * Result of generating a cache key for a component.
12
+ */
13
+ interface Cache_Key_Result {
14
+ cache_key: string | null;
15
+ uncacheable_property?: string;
16
+ }
17
+ /**
18
+ * Generate a cache key for a component using its name + args.
19
+ * Supports custom cache_id() override.
20
+ *
21
+ * @param component - The component instance
22
+ * @returns Cache key string or null if caching is disabled
23
+ */
24
+ export declare function generate_cache_key(component: any): Cache_Key_Result;
25
+ /**
26
+ * Read cache during create() phase.
27
+ * Sets component._cache_key, _cached_html, _use_cached_data_hit as side effects.
28
+ *
29
+ * @param component - The component instance
30
+ */
31
+ export declare function read_cache_in_create(component: any): void;
32
+ /**
33
+ * Check cache during reload() when args have changed.
34
+ * If cache hit, hydrates data/html and triggers an immediate render.
35
+ *
36
+ * @param component - The component instance
37
+ * @returns true if rendered from cache, false otherwise
38
+ */
39
+ export declare function check_cache_on_reload(component: any): boolean;
40
+ /**
41
+ * Write HTML cache snapshot during ready() phase.
42
+ * Only caches if the component is dynamic (data changed during on_load).
43
+ *
44
+ * @param component - The component instance
45
+ */
46
+ export declare function write_html_cache_snapshot(component: any): void;
47
+ /**
48
+ * Write data/HTML to cache after on_load() completes.
49
+ * Called from _apply_load_result().
50
+ *
51
+ * @param component - The component instance
52
+ * @param data_changed - Whether this.data changed during on_load
53
+ */
54
+ export declare function write_cache_on_loaded(component: any, data_changed: boolean): void;
55
+ export {};
56
+ //# sourceMappingURL=component-cache.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"component-cache.d.ts","sourceRoot":"","sources":["../src/component-cache.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAKH;;GAEG;AACH,UAAU,gBAAgB;IACxB,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,oBAAoB,CAAC,EAAE,MAAM,CAAC;CAC/B;AAED;;;;;;GAMG;AACH,wBAAgB,kBAAkB,CAAC,SAAS,EAAE,GAAG,GAAG,gBAAgB,CAanE;AAED;;;;;GAKG;AACH,wBAAgB,oBAAoB,CAAC,SAAS,EAAE,GAAG,GAAG,IAAI,CA+FzD;AAED;;;;;;GAMG;AACH,wBAAgB,qBAAqB,CAAC,SAAS,EAAE,GAAG,GAAG,OAAO,CAqD7D;AAED;;;;;GAKG;AACH,wBAAgB,yBAAyB,CAAC,SAAS,EAAE,GAAG,GAAG,IAAI,CA2B9D;AAED;;;;;;GAMG;AACH,wBAAgB,qBAAqB,CAAC,SAAS,EAAE,GAAG,EAAE,YAAY,EAAE,OAAO,GAAG,IAAI,CA4BjF"}
@@ -0,0 +1,68 @@
1
+ /**
2
+ * JQHTML Component Event System
3
+ *
4
+ * Extracted from component.ts - handles lifecycle event registration,
5
+ * triggering, and state tracking.
6
+ *
7
+ * Events have "sticky" semantics for lifecycle events: if an event has already
8
+ * occurred, new .on() handlers fire immediately with the stored data.
9
+ */
10
+ /**
11
+ * Register a callback for an event.
12
+ *
13
+ * Lifecycle events (create, render, load, loaded, ready) are "sticky":
14
+ * If a lifecycle event has already occurred, the callback fires immediately
15
+ * AND registers for future occurrences.
16
+ *
17
+ * Custom events only fire when explicitly triggered via trigger().
18
+ *
19
+ * @param component - The component instance
20
+ * @param event_name - Name of the event
21
+ * @param callback - Callback: (component, data?) => void
22
+ */
23
+ export declare function event_on(component: any, event_name: string, callback: (comp: any, data?: any) => void): any;
24
+ /**
25
+ * Register a callback that fires exactly once.
26
+ *
27
+ * - If the event already occurred (sticky), fires immediately and does NOT register.
28
+ * - If the event has not occurred, registers and auto-deregisters after first fire.
29
+ *
30
+ * @param component - The component instance
31
+ * @param event_name - Name of the event
32
+ * @param callback - Callback: (component, data?) => void
33
+ */
34
+ export declare function event_once(component: any, event_name: string, callback: (comp: any, data?: any) => void): any;
35
+ /**
36
+ * Trigger an event - fires all registered callbacks.
37
+ * Marks event as occurred so future .on() calls fire immediately.
38
+ *
39
+ * @param component - The component instance
40
+ * @param event_name - Name of the event to trigger
41
+ * @param data - Optional data to pass to callbacks as second parameter
42
+ */
43
+ export declare function event_trigger(component: any, event_name: string, data?: any): void;
44
+ /**
45
+ * Check if any callbacks are registered for a given event.
46
+ *
47
+ * @param component - The component instance
48
+ * @param event_name - Name of the event to check
49
+ */
50
+ export declare function event_on_registered(component: any, event_name: string): boolean;
51
+ /**
52
+ * Invalidate a lifecycle event - removes the "already occurred" marker.
53
+ *
54
+ * After invalidate() is called:
55
+ * - New .on() handlers will NOT fire immediately
56
+ * - The ready() promise will NOT resolve immediately
57
+ * - Handlers wait for the next trigger() call
58
+ *
59
+ * Existing registered callbacks are NOT removed - they'll fire on next trigger().
60
+ *
61
+ * Use case: Call invalidate('ready') at the start of reload() or render()
62
+ * so that any new .on('ready') handlers wait for the reload/render to complete.
63
+ *
64
+ * @param component - The component instance
65
+ * @param event_name - Name of the event to invalidate
66
+ */
67
+ export declare function event_invalidate(component: any, event_name: string): void;
68
+ //# sourceMappingURL=component-events.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"component-events.d.ts","sourceRoot":"","sources":["../src/component-events.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH;;;;;;;;;;;;GAYG;AACH,wBAAgB,QAAQ,CAAC,SAAS,EAAE,GAAG,EAAE,UAAU,EAAE,MAAM,EAAE,QAAQ,EAAE,CAAC,IAAI,EAAE,GAAG,EAAE,IAAI,CAAC,EAAE,GAAG,KAAK,IAAI,GAAG,GAAG,CAqB3G;AAED;;;;;;;;;GASG;AACH,wBAAgB,UAAU,CAAC,SAAS,EAAE,GAAG,EAAE,UAAU,EAAE,MAAM,EAAE,QAAQ,EAAE,CAAC,IAAI,EAAE,GAAG,EAAE,IAAI,CAAC,EAAE,GAAG,KAAK,IAAI,GAAG,GAAG,CA+B7G;AAED;;;;;;;GAOG;AACH,wBAAgB,aAAa,CAAC,SAAS,EAAE,GAAG,EAAE,UAAU,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,GAAG,GAAG,IAAI,CAelF;AAED;;;;;GAKG;AACH,wBAAgB,mBAAmB,CAAC,SAAS,EAAE,GAAG,EAAE,UAAU,EAAE,MAAM,GAAG,OAAO,CAG/E;AAED;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,gBAAgB,CAAC,SAAS,EAAE,GAAG,EAAE,UAAU,EAAE,MAAM,GAAG,IAAI,CAEzE"}
@@ -0,0 +1,47 @@
1
+ /**
2
+ * JQHTML Component Lifecycle Queue
3
+ *
4
+ * Serializes lifecycle operations (render, reload, refresh) per component.
5
+ * Replaces _create_debounced_function with a proper queue that:
6
+ *
7
+ * - At most one operation runs at a time per component
8
+ * - At most one operation is pending (waiting for the current to finish)
9
+ * - Same-type pending operations collapse (fan-in: all callers share one execution)
10
+ * - Different-type pending operations: new replaces old (old callers get the new result)
11
+ *
12
+ * Boot bypasses this queue entirely - it runs the lifecycle directly.
13
+ */
14
+ export declare class Component_Queue {
15
+ /** Currently executing operation */
16
+ private _current;
17
+ /** Next operation waiting to execute after current completes */
18
+ private _pending;
19
+ /**
20
+ * Enqueue a lifecycle operation.
21
+ *
22
+ * Behavior:
23
+ * - Nothing running → execute immediately
24
+ * - Something running, no pending → create pending entry
25
+ * - Something running, same type pending → collapse (share pending promise)
26
+ * - Something running, different type pending → replace pending (all callers get new result)
27
+ *
28
+ * @param type - Operation type ('render', 'reload', 'refresh', 'load')
29
+ * @param executor - The async function to execute
30
+ * @returns Promise that resolves when the operation completes
31
+ */
32
+ enqueue(type: string, executor: () => Promise<void>): Promise<void>;
33
+ /**
34
+ * Execute an operation and handle pending queue after completion.
35
+ * @private
36
+ */
37
+ private _execute;
38
+ /**
39
+ * Check if any operation is currently running.
40
+ */
41
+ get is_busy(): boolean;
42
+ /**
43
+ * Check if there's a pending operation waiting.
44
+ */
45
+ get has_pending(): boolean;
46
+ }
47
+ //# sourceMappingURL=component-queue.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"component-queue.d.ts","sourceRoot":"","sources":["../src/component-queue.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AASH,qBAAa,eAAe;IAC1B,oCAAoC;IACpC,OAAO,CAAC,QAAQ,CAAyD;IAEzE,gEAAgE;IAChE,OAAO,CAAC,QAAQ,CAA4B;IAE5C;;;;;;;;;;;;OAYG;IACH,OAAO,CAAC,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC;IA4CnE;;;OAGG;IACH,OAAO,CAAC,QAAQ;IA0BhB;;OAEG;IACH,IAAI,OAAO,IAAI,OAAO,CAErB;IAED;;OAEG;IACH,IAAI,WAAW,IAAI,OAAO,CAEzB;CACF"}
@@ -34,14 +34,13 @@ 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;
41
40
  private _data_on_last_render;
42
41
  private __initial_data_snapshot;
43
42
  private __data_frozen;
44
- private _reload_debounced?;
43
+ private _queue;
45
44
  private next_reload_force_refresh;
46
45
  private __lifecycle_authorized;
47
46
  private _cache_key;
@@ -50,6 +49,17 @@ export declare class Jqhtml_Component {
50
49
  private _should_cache_html_after_ready;
51
50
  private _is_dynamic;
52
51
  private _on_render_complete;
52
+ private _use_cached_data_hit;
53
+ private _load_only;
54
+ private _load_render_only;
55
+ _is_detached: boolean;
56
+ private _force_initial_render;
57
+ private _has_rendered;
58
+ private _load_queue;
59
+ private __has_custom_on_load;
60
+ private __load_gates;
61
+ private __first_load_started;
62
+ private __gate_resume;
53
63
  constructor(element?: any, args?: Record<string, any>);
54
64
  /**
55
65
  * Protect lifecycle methods from manual invocation
@@ -70,6 +80,13 @@ export declare class Jqhtml_Component {
70
80
  * @private
71
81
  */
72
82
  private _call_lifecycle_sync;
83
+ /**
84
+ * Check if on_load() is overridden in a subclass
85
+ * Used to skip the load phase entirely for components that don't fetch data
86
+ * Returns cached value set in _boot() for O(1) performance
87
+ * @private
88
+ */
89
+ private _has_on_load;
73
90
  /**
74
91
  * Boot - Start the full component lifecycle
75
92
  * Called immediately after construction by instruction processor
@@ -88,38 +105,129 @@ export declare class Jqhtml_Component {
88
105
  * @returns The current _render_count after incrementing (used to detect stale renders)
89
106
  * @private
90
107
  */
91
- _render(id?: string | null): number;
108
+ _render(id?: string | null, options?: {
109
+ skip_on_render?: boolean;
110
+ }): number;
92
111
  /**
93
112
  * Public render method - re-renders component and completes lifecycle
94
113
  * This is what users should call when they want to update a component.
95
114
  *
96
- * Lifecycle sequence:
115
+ * Lifecycle sequence (serialized via component queue):
97
116
  * 1. _render() - Updates DOM synchronously, calls on_render(), fires 'render' event
98
- * 2. Async continuation (fire and forget):
99
- * - _wait_for_children_ready() - Waits for all children to reach ready state
100
- * - on_ready() - Calls user's ready hook
101
- * - trigger('ready') - Fires ready event
117
+ * 2. _wait_for_children_ready() - Waits for all children to reach ready state
118
+ * 3. on_ready() - Calls user's ready hook
119
+ * 4. trigger('ready') - Fires ready event
102
120
  *
103
- * Returns immediately after _render() completes - does NOT wait for children
121
+ * Goes through the component queue to prevent concurrent lifecycle operations.
122
+ * Returns a Promise that resolves when the full render lifecycle completes.
104
123
  */
105
- render(id?: string | null): void;
124
+ render(id?: string | null): Promise<void>;
106
125
  /**
107
126
  * Alias for render() - re-renders component with current data
108
127
  * Provided for API consistency and clarity
109
128
  */
110
- redraw(id?: string | null): void;
129
+ redraw(id?: string | null): Promise<void>;
130
+ /**
131
+ * Re-fetch data by executing on_load() without triggering re-render or lifecycle.
132
+ *
133
+ * Runs on_load() on a detached proxy (same restrictions as during boot):
134
+ * - this.data is restored to on_create() snapshot, then unfrozen for writing
135
+ * - this.args is read-only
136
+ * - All other properties (this.$, this.$sid, etc.) are blocked
137
+ *
138
+ * After on_load() completes, this.data is atomically updated and re-frozen.
139
+ * The developer decides what to do next (e.g., call this.render()).
140
+ *
141
+ * Pattern: load() invokes on_load(), just as render() invokes on_render().
142
+ *
143
+ * @returns true if this.data changed, false if unchanged
144
+ */
145
+ load(): Promise<boolean>;
111
146
  /**
112
147
  * Create phase - Quick setup, prepare UI
113
- * Called bottom-up (children before parent)
148
+ * SYNCHRONOUS - no awaits, no yields
114
149
  */
115
- create(): Promise<void>;
150
+ create(): void;
116
151
  /**
117
- * Load phase - Fetch data from APIs
152
+ * Register a "load gate" — a promise that must settle before this component's
153
+ * FIRST on_load() runs.
154
+ *
155
+ * Register gates during on_create(). Multiple calls accumulate; all gates are
156
+ * awaited together (via Promise.allSettled) at the seam between create and the
157
+ * first load. A REJECTED gate does NOT block or abort the load — it is an
158
+ * ordering hint, not a data dependency, so loading proceeds after settlement
159
+ * (rejections are logged through the debug channel).
160
+ *
161
+ * Gates are ONE-SHOT: they delay the first on_load() only. Once that load
162
+ * begins the gate list is cleared, and reload()/refresh() never re-await gates.
163
+ * Calling reload()/refresh() while a gate is still holding the first load
164
+ * releases the wait immediately and resumes the lifecycle (a later gate
165
+ * settlement then does nothing).
166
+ *
167
+ * Gates delay ONLY the on_load phase — never create(), the initial render,
168
+ * on_render(), or the cached-content first paint (stale-while-revalidate is
169
+ * preserved). Components with no custom on_load() ignore gates entirely.
170
+ *
171
+ * No-op during SSR (the server cannot await arbitrary client promises).
172
+ *
173
+ * jqhtml has no knowledge of WHAT is being awaited — the caller supplies the
174
+ * promise, and policy such as timeouts is the caller's responsibility (bake it
175
+ * into the promise you pass).
176
+ *
177
+ * @param promise The promise to await before the first on_load().
178
+ * @throws If called after the component's first load has already started.
179
+ */
180
+ gate_load(promise: Promise<any>): void;
181
+ /**
182
+ * Await all registered load gates before the first on_load().
183
+ *
184
+ * Called exactly once, at the boot seam immediately before the load phase
185
+ * (only for components with a custom on_load()). Latches "first load started"
186
+ * so any later gate_load() throws and reload()/refresh() never re-await.
187
+ *
188
+ * Returns a promise to await when there are gates to wait on, or `null` when
189
+ * there is nothing to wait for (no gates, or SSR). Returning `null` keeps the
190
+ * common no-gate path free of an extra microtask hop, so it does not shift the
191
+ * timing of ungated components.
192
+ *
193
+ * The returned promise resolves as soon as any of the following happens
194
+ * (whichever is first — the rest become no-ops):
195
+ * - all gates settle (Promise.allSettled),
196
+ * - reload()/refresh() is called while gated (they resolve __gate_resume),
197
+ * - the component is stopped (stop() resolves __gate_resume).
198
+ *
199
+ * @private
200
+ */
201
+ private _await_load_gates;
202
+ /**
203
+ * Load phase - Fetch asynchronous data
118
204
  * Called bottom-up, fully parallel
119
205
  * NO DOM MODIFICATIONS ALLOWED IN THIS PHASE
206
+ *
207
+ * Key design: on_load() runs on a DETACHED proxy with a clone of this.data.
208
+ * The real component's this.data is not touched during on_load execution.
209
+ * After on_load completes, the result is applied via a sequential queue.
210
+ *
120
211
  * @private - Internal lifecycle method, not for external use
121
212
  */
122
213
  _load(): Promise<void>;
214
+ /**
215
+ * Execute on_load() on a fully detached proxy.
216
+ * @see data-proxy.ts for full implementation
217
+ * @private
218
+ */
219
+ private _execute_on_load_detached;
220
+ /**
221
+ * Apply the result of on_load() to this.data via the sequential queue.
222
+ *
223
+ * Multiple _load calls can execute on_load in parallel, but this method
224
+ * ensures that setting this.data happens in FIFO order.
225
+ *
226
+ * @param result_data - The data returned from _execute_on_load_detached
227
+ * @param data_before_load - JSON string of this.data before on_load (for change detection), or null
228
+ * @private
229
+ */
230
+ private _apply_load_result;
123
231
  /**
124
232
  * Ready phase - Component fully initialized
125
233
  * Called bottom-up (children before parent)
@@ -148,6 +256,24 @@ export declare class Jqhtml_Component {
148
256
  * @param callback Optional callback to execute when ready
149
257
  */
150
258
  ready(callback?: () => void): Promise<void>;
259
+ /**
260
+ * Returns a promise that resolves when the component has completed its
261
+ * synchronous render chain (after on_load's re-render if applicable,
262
+ * or after first render if no on_load override).
263
+ *
264
+ * This fires BEFORE on_ready() and before children are waited on.
265
+ * Use this when you need to know the component's DOM is stable but
266
+ * don't need to wait for the full async ready phase.
267
+ *
268
+ * The 'rendered' event fires exactly once per component lifecycle.
269
+ *
270
+ * @example
271
+ * await component.rendered();
272
+ * // DOM is now stable, on_render has completed
273
+ *
274
+ * @param callback Optional callback to execute when rendered
275
+ */
276
+ rendered(callback?: () => void): Promise<void>;
151
277
  /**
152
278
  * Wait for all child components to reach ready state
153
279
  * Ensures bottom-up ordering (children ready before parent)
@@ -237,11 +363,12 @@ export declare class Jqhtml_Component {
237
363
  * Leaves DOM intact, just stops lifecycle engine and fires cleanup hooks
238
364
  */
239
365
  stop(): void;
240
- on_render(): void | Promise<void>;
241
- on_create(): void | Promise<void>;
242
- on_load(): Promise<void>;
366
+ on_render(): void;
367
+ on_create(): void;
368
+ on_load(): void | Promise<void>;
369
+ on_loaded(): void | Promise<void>;
243
370
  on_ready(): Promise<void>;
244
- on_stop(): void | Promise<void>;
371
+ on_stop(): void;
245
372
  /**
246
373
  * Optional: Override cache key generation
247
374
  *
@@ -268,23 +395,30 @@ export declare class Jqhtml_Component {
268
395
  */
269
396
  component_name(): string;
270
397
  /**
271
- * Register event callback
272
- * Supports lifecycle events ('render', 'create', 'load', 'ready', 'stop') and custom events
273
- * Lifecycle event callbacks fire after the lifecycle method completes
274
- * If a lifecycle event has already occurred, the callback fires immediately AND registers for future occurrences
275
- * Custom events only fire when explicitly triggered via .trigger()
398
+ * Register event callback - delegates to component-events.ts
399
+ * @see component-events.ts for full documentation
400
+ */
401
+ on(event_name: string, callback: (component: Jqhtml_Component, data?: any) => void): this;
402
+ /**
403
+ * Register a callback that fires exactly once - delegates to component-events.ts
404
+ * If the event already occurred, fires immediately and does not register.
405
+ * @see component-events.ts for full documentation
276
406
  */
277
- on(event_name: string, callback: (component: Jqhtml_Component) => void): this;
407
+ once(event_name: string, callback: (component: Jqhtml_Component, data?: any) => void): this;
278
408
  /**
279
- * Trigger a lifecycle event - fires all registered callbacks
280
- * Marks event as occurred so future .on() calls fire immediately
409
+ * Trigger a lifecycle event - delegates to component-events.ts
410
+ * @see component-events.ts for full documentation
281
411
  */
282
- trigger(event_name: string): void;
412
+ trigger(event_name: string, data?: any): void;
283
413
  /**
284
414
  * Check if any callbacks are registered for a given event
285
- * Used to determine if cleanup logic needs to run
286
415
  */
287
416
  _on_registered(event_name: string): boolean;
417
+ /**
418
+ * Invalidate a lifecycle event - delegates to component-events.ts
419
+ * @see component-events.ts for full documentation
420
+ */
421
+ invalidate(event_name: string): void;
288
422
  /**
289
423
  * Find element by scoped ID
290
424
  *
@@ -355,21 +489,5 @@ export declare class Jqhtml_Component {
355
489
  private _get_dom_children;
356
490
  private _log_lifecycle;
357
491
  private _log_debug;
358
- /**
359
- * Creates a debounced function with exclusivity and promise fan-in
360
- *
361
- * When invoked, immediately runs the callback exclusively.
362
- * For subsequent invocations, applies a delay before running the callback exclusively again.
363
- * The delay starts after the current asynchronous operation resolves.
364
- *
365
- * If delay is 0, the function only prevents enqueueing multiple executions,
366
- * but will still run them immediately in an exclusive sequential manner.
367
- *
368
- * The most recent invocation's parameters are used when the function executes.
369
- * Returns a promise that resolves when the next exclusive execution completes.
370
- *
371
- * @private
372
- */
373
- private _create_debounced_function;
374
492
  }
375
493
  //# sourceMappingURL=component.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"component.d.ts","sourceRoot":"","sources":["../src/component.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAcH,OAAO,CAAC,MAAM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;OAEG;IACH,cAAc,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO;IAI3C;;;OAGG;IACH,UAAU,CAAC,UAAU,EAAE,MAAM,GAAG,IAAI;IAIpC;;;;;;;;;;;;;;;OAeG;IACH,IAAI,CAAC,QAAQ,EAAE,MAAM,GAAG,GAAG;IAgB3B;;;;;;;;;;;;;;;OAeG;IACH,GAAG,CAAC,QAAQ,EAAE,MAAM,GAAG,gBAAgB,GAAG,IAAI;IAgB9C;;;OAGG;IACH,YAAY,IAAI,gBAAgB,GAAG,IAAI;IAIvC;;OAEG;IACH,IAAI,CAAC,QAAQ,EAAE,MAAM,GAAG,gBAAgB,EAAE;IAa1C;;OAEG;IACH,OAAO,CAAC,QAAQ,EAAE,MAAM,GAAG,gBAAgB,GAAG,IAAI;IAoBlD;;OAEG;IACH,MAAM,CAAC,mBAAmB,IAAI,MAAM,EAAE;IA0CtC,OAAO,CAAC,aAAa;IAIrB;;;OAGG;IACH,OAAO,CAAC,qBAAqB;IAkB7B,OAAO,CAAC,kBAAkB;IA4B1B,OAAO,CAAC,yBAAyB;IAuHjC,OAAO,CAAC,eAAe;IAUvB,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,37 @@
1
+ /**
2
+ * JQHTML Data Proxy System
3
+ *
4
+ * Extracted from component.ts - handles:
5
+ * - Data freeze/unfreeze enforcement via Proxy
6
+ * - Detached on_load() execution with restricted access
7
+ */
8
+ /**
9
+ * Set up the `this.data` property on a component using Object.defineProperty
10
+ * with a Proxy that enforces freeze/unfreeze semantics.
11
+ *
12
+ * After setup:
13
+ * - `this.data` reads/writes go through a Proxy
14
+ * - When `component.__data_frozen === true`, writes throw errors
15
+ * - When frozen is false, writes pass through normally
16
+ *
17
+ * @param component - The component instance to set up data on
18
+ */
19
+ export declare function setup_data_property(component: any): void;
20
+ /**
21
+ * Execute on_load() in a detached context with restricted access.
22
+ *
23
+ * Creates a sandboxed environment where on_load() can only access:
24
+ * - this.args (read-only)
25
+ * - this.data (read/write, cloned from __initial_data_snapshot)
26
+ *
27
+ * All other property access (this.$, this.$sid, etc.) throws errors.
28
+ *
29
+ * @param component - The component instance
30
+ * @param use_load_coordinator - Whether to use Load_Coordinator for deduplication
31
+ * @returns The resulting data and optional coordination completion function
32
+ */
33
+ export declare function execute_on_load_detached(component: any, use_load_coordinator?: boolean): Promise<{
34
+ data: Record<string, any>;
35
+ complete_coordination: ((data: Record<string, any>) => void) | null;
36
+ }>;
37
+ //# sourceMappingURL=data-proxy.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"data-proxy.d.ts","sourceRoot":"","sources":["../src/data-proxy.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAIH;;;;;;;;;;GAUG;AACH,wBAAgB,mBAAmB,CAAC,SAAS,EAAE,GAAG,GAAG,IAAI,CAiFxD;AAED;;;;;;;;;;;;GAYG;AACH,wBAAsB,wBAAwB,CAAC,SAAS,EAAE,GAAG,EAAE,oBAAoB,GAAE,OAAe,GAAG,OAAO,CAAC;IAC7G,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IAC1B,qBAAqB,EAAE,CAAC,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,KAAK,IAAI,CAAC,GAAG,IAAI,CAAC;CACrE,CAAC,CA8JD"}