@jqhtml/core 2.3.35 → 2.3.54

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,47 @@
1
+ /**
2
+ * JQHTML Cache Key Serializer
3
+ *
4
+ * Produces a deterministic string for a plain-data argument value, so that two
5
+ * structurally equal objects built on separate renders yield the SAME cache key.
6
+ * Templates rebuild `{contact_id: 12}` on every render, so identity-based keying
7
+ * can never match and permanently opts the receiving component out of caching.
8
+ *
9
+ * ---------------------------------------------------------------------------
10
+ * THIS IS NOT `process_for_serialization()` IN local-storage.ts. DO NOT MERGE THEM.
11
+ *
12
+ * That serializer stores cache VALUES and deliberately degrades: a function, a
13
+ * symbol or a circular reference is dropped and serialization continues, because
14
+ * losing a method while keeping the data is the right trade for a payload.
15
+ *
16
+ * For a cache KEY that policy manufactures false hits. Two argument objects that
17
+ * differ ONLY by a callback would serialize identically, and a component would
18
+ * render with another component's cached content - strictly worse than not
19
+ * caching at all. So this serializer DECLINES on the first value it cannot
20
+ * express exactly. It never drops anything.
21
+ * ---------------------------------------------------------------------------
22
+ *
23
+ * Allow-list, and nothing else: null, undefined, boolean, number, string, Date,
24
+ * arrays, and plain objects (prototype Object.prototype or null), in any nesting.
25
+ * Everything else declines with a reason that reaches `data-nocache`.
26
+ */
27
+ export type Serialize_Result = {
28
+ ok: true;
29
+ text: string;
30
+ } | {
31
+ ok: false;
32
+ reason: string;
33
+ };
34
+ /**
35
+ * Values larger than this are declined rather than keyed. The supported case is a
36
+ * handful of key/value pairs or a list of ids - not a payload. Declining loudly
37
+ * beats spending the budget on a key nobody benefits from.
38
+ */
39
+ export declare const MAX_KEY_BYTES = 500;
40
+ /**
41
+ * Serialize a value for use in a cache key.
42
+ *
43
+ * @returns `{ok: true, text}` when the value is exactly expressible, or
44
+ * `{ok: false, reason}` naming why it is not. Never throws.
45
+ */
46
+ export declare function serialize_for_cache_key(value: any): Serialize_Result;
47
+ //# sourceMappingURL=cache-key-serializer.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cache-key-serializer.d.ts","sourceRoot":"","sources":["../src/cache-key-serializer.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AAEH,MAAM,MAAM,gBAAgB,GACxB;IAAE,EAAE,EAAE,IAAI,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,GAC1B;IAAE,EAAE,EAAE,KAAK,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,CAAC;AAElC;;;;GAIG;AACH,eAAO,MAAM,aAAa,MAAM,CAAC;AA8FjC;;;;;GAKG;AACH,wBAAgB,uBAAuB,CAAC,KAAK,EAAE,GAAG,GAAG,gBAAgB,CAWpE"}
@@ -0,0 +1,57 @@
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
+ uncacheable_reason?: string;
17
+ }
18
+ /**
19
+ * Generate a cache key for a component using its name + args.
20
+ * Supports custom cache_id() override.
21
+ *
22
+ * @param component - The component instance
23
+ * @returns Cache key string or null if caching is disabled
24
+ */
25
+ export declare function generate_cache_key(component: any): Cache_Key_Result;
26
+ /**
27
+ * Read cache during create() phase.
28
+ * Sets component._cache_key, _cached_html, _use_cached_data_hit as side effects.
29
+ *
30
+ * @param component - The component instance
31
+ */
32
+ export declare function read_cache_in_create(component: any): void;
33
+ /**
34
+ * Check cache during reload() when args have changed.
35
+ * If cache hit, hydrates data/html and triggers an immediate render.
36
+ *
37
+ * @param component - The component instance
38
+ * @returns true if rendered from cache, false otherwise
39
+ */
40
+ export declare function check_cache_on_reload(component: any): boolean;
41
+ /**
42
+ * Write HTML cache snapshot during ready() phase.
43
+ * Only caches if the component is dynamic (data changed during on_load).
44
+ *
45
+ * @param component - The component instance
46
+ */
47
+ export declare function write_html_cache_snapshot(component: any): void;
48
+ /**
49
+ * Write data/HTML to cache after on_load() completes.
50
+ * Called from _apply_load_result().
51
+ *
52
+ * @param component - The component instance
53
+ * @param data_changed - Whether this.data changed during on_load
54
+ */
55
+ export declare function write_cache_on_loaded(component: any, data_changed: boolean): void;
56
+ export {};
57
+ //# 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;AAMH;;GAEG;AACH,UAAU,gBAAgB;IACxB,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,oBAAoB,CAAC,EAAE,MAAM,CAAC;IAC9B,kBAAkB,CAAC,EAAE,MAAM,CAAC;CAC7B;AAED;;;;;;GAMG;AACH,wBAAgB,kBAAkB,CAAC,SAAS,EAAE,GAAG,GAAG,gBAAgB,CAsBnE;AAsED;;;;;GAKG;AACH,wBAAgB,oBAAoB,CAAC,SAAS,EAAE,GAAG,GAAG,IAAI,CAqGzD;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,CAoBlF;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"}
@@ -40,7 +40,7 @@ export declare class Jqhtml_Component {
40
40
  private _data_on_last_render;
41
41
  private __initial_data_snapshot;
42
42
  private __data_frozen;
43
- private _reload_debounced?;
43
+ private _queue;
44
44
  private next_reload_force_refresh;
45
45
  private __lifecycle_authorized;
46
46
  private _cache_key;
@@ -50,11 +50,16 @@ export declare class Jqhtml_Component {
50
50
  private _is_dynamic;
51
51
  private _on_render_complete;
52
52
  private _use_cached_data_hit;
53
- private _skip_render_and_ready;
54
- private _skip_ready;
53
+ private _load_only;
54
+ private _load_render_only;
55
+ _is_detached: boolean;
56
+ private _force_initial_render;
55
57
  private _has_rendered;
56
58
  private _load_queue;
57
59
  private __has_custom_on_load;
60
+ private __load_gates;
61
+ private __first_load_started;
62
+ private __gate_resume;
58
63
  constructor(element?: any, args?: Record<string, any>);
59
64
  /**
60
65
  * Protect lifecycle methods from manual invocation
@@ -75,6 +80,14 @@ export declare class Jqhtml_Component {
75
80
  * @private
76
81
  */
77
82
  private _call_lifecycle_sync;
83
+ /**
84
+ * Fire on_viewport_resize() with the current viewport width.
85
+ * Called after every on_render() and on_ready(); the debounced window
86
+ * listener in viewport.ts drives it from then on. Errors are isolated so a
87
+ * bad handler cannot break the lifecycle.
88
+ * @private
89
+ */
90
+ private _fire_viewport_resize;
78
91
  /**
79
92
  * Check if on_load() is overridden in a subclass
80
93
  * Used to skip the load phase entirely for components that don't fetch data
@@ -100,31 +113,100 @@ export declare class Jqhtml_Component {
100
113
  * @returns The current _render_count after incrementing (used to detect stale renders)
101
114
  * @private
102
115
  */
103
- _render(id?: string | null): number;
116
+ _render(id?: string | null, options?: {
117
+ skip_on_render?: boolean;
118
+ }): number;
104
119
  /**
105
120
  * Public render method - re-renders component and completes lifecycle
106
121
  * This is what users should call when they want to update a component.
107
122
  *
108
- * Lifecycle sequence:
123
+ * Lifecycle sequence (serialized via component queue):
109
124
  * 1. _render() - Updates DOM synchronously, calls on_render(), fires 'render' event
110
- * 2. Async continuation (fire and forget):
111
- * - _wait_for_children_ready() - Waits for all children to reach ready state
112
- * - on_ready() - Calls user's ready hook
113
- * - trigger('ready') - Fires ready event
125
+ * 2. _wait_for_children_ready() - Waits for all children to reach ready state
126
+ * 3. on_ready() - Calls user's ready hook
127
+ * 4. trigger('ready') - Fires ready event
114
128
  *
115
- * Returns immediately after _render() completes - does NOT wait for children
129
+ * Goes through the component queue to prevent concurrent lifecycle operations.
130
+ * Returns a Promise that resolves when the full render lifecycle completes.
116
131
  */
117
- render(id?: string | null): void;
132
+ render(id?: string | null): Promise<void>;
118
133
  /**
119
134
  * Alias for render() - re-renders component with current data
120
135
  * Provided for API consistency and clarity
121
136
  */
122
- redraw(id?: string | null): void;
137
+ redraw(id?: string | null): Promise<void>;
138
+ /**
139
+ * Re-fetch data by executing on_load() without triggering re-render or lifecycle.
140
+ *
141
+ * Runs on_load() on a detached proxy (same restrictions as during boot):
142
+ * - this.data is restored to on_create() snapshot, then unfrozen for writing
143
+ * - this.args is read-only
144
+ * - All other properties (this.$, this.$sid, etc.) are blocked
145
+ *
146
+ * After on_load() completes, this.data is atomically updated and re-frozen.
147
+ * The developer decides what to do next (e.g., call this.render()).
148
+ *
149
+ * Pattern: load() invokes on_load(), just as render() invokes on_render().
150
+ *
151
+ * @returns true if this.data changed, false if unchanged
152
+ */
153
+ load(): Promise<boolean>;
123
154
  /**
124
155
  * Create phase - Quick setup, prepare UI
125
156
  * SYNCHRONOUS - no awaits, no yields
126
157
  */
127
158
  create(): void;
159
+ /**
160
+ * Register a "load gate" — a promise that must settle before this component's
161
+ * FIRST on_load() runs.
162
+ *
163
+ * Register gates during on_create(). Multiple calls accumulate; all gates are
164
+ * awaited together (via Promise.allSettled) at the seam between create and the
165
+ * first load. A REJECTED gate does NOT block or abort the load — it is an
166
+ * ordering hint, not a data dependency, so loading proceeds after settlement
167
+ * (rejections are logged through the debug channel).
168
+ *
169
+ * Gates are ONE-SHOT: they delay the first on_load() only. Once that load
170
+ * begins the gate list is cleared, and reload()/refresh() never re-await gates.
171
+ * Calling reload()/refresh() while a gate is still holding the first load
172
+ * releases the wait immediately and resumes the lifecycle (a later gate
173
+ * settlement then does nothing).
174
+ *
175
+ * Gates delay ONLY the on_load phase — never create(), the initial render,
176
+ * on_render(), or the cached-content first paint (stale-while-revalidate is
177
+ * preserved). Components with no custom on_load() ignore gates entirely.
178
+ *
179
+ * No-op during SSR (the server cannot await arbitrary client promises).
180
+ *
181
+ * jqhtml has no knowledge of WHAT is being awaited — the caller supplies the
182
+ * promise, and policy such as timeouts is the caller's responsibility (bake it
183
+ * into the promise you pass).
184
+ *
185
+ * @param promise The promise to await before the first on_load().
186
+ * @throws If called after the component's first load has already started.
187
+ */
188
+ gate_load(promise: Promise<any>): void;
189
+ /**
190
+ * Await all registered load gates before the first on_load().
191
+ *
192
+ * Called exactly once, at the boot seam immediately before the load phase
193
+ * (only for components with a custom on_load()). Latches "first load started"
194
+ * so any later gate_load() throws and reload()/refresh() never re-await.
195
+ *
196
+ * Returns a promise to await when there are gates to wait on, or `null` when
197
+ * there is nothing to wait for (no gates, or SSR). Returning `null` keeps the
198
+ * common no-gate path free of an extra microtask hop, so it does not shift the
199
+ * timing of ungated components.
200
+ *
201
+ * The returned promise resolves as soon as any of the following happens
202
+ * (whichever is first — the rest become no-ops):
203
+ * - all gates settle (Promise.allSettled),
204
+ * - reload()/refresh() is called while gated (they resolve __gate_resume),
205
+ * - the component is stopped (stop() resolves __gate_resume).
206
+ *
207
+ * @private
208
+ */
209
+ private _await_load_gates;
128
210
  /**
129
211
  * Load phase - Fetch asynchronous data
130
212
  * Called bottom-up, fully parallel
@@ -139,16 +221,7 @@ export declare class Jqhtml_Component {
139
221
  _load(): Promise<void>;
140
222
  /**
141
223
  * 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
224
+ * @see data-proxy.ts for full implementation
152
225
  * @private
153
226
  */
154
227
  private _execute_on_load_detached;
@@ -301,8 +374,19 @@ export declare class Jqhtml_Component {
301
374
  on_render(): void;
302
375
  on_create(): void;
303
376
  on_load(): void | Promise<void>;
377
+ on_loaded(): void | Promise<void>;
304
378
  on_ready(): Promise<void>;
305
379
  on_stop(): void;
380
+ /**
381
+ * Called with the viewport width in CSS pixels:
382
+ * - after every on_render()
383
+ * - after every on_ready()
384
+ * - on window resize, debounced 30ms, for every component in the document
385
+ *
386
+ * MUST be synchronous. Prefer CSS media/container queries for pure styling -
387
+ * override this only when layout requires imperative measurement.
388
+ */
389
+ on_viewport_resize(viewport_width: number): void;
306
390
  /**
307
391
  * Optional: Override cache key generation
308
392
  *
@@ -329,45 +413,28 @@ export declare class Jqhtml_Component {
329
413
  */
330
414
  component_name(): string;
331
415
  /**
332
- * Register event callback
333
- * Supports lifecycle events ('render', 'create', 'load', 'ready', 'stop') and custom events
334
- * Lifecycle event callbacks fire after the lifecycle method completes
335
- * If a lifecycle event has already occurred, the callback fires immediately AND registers for future occurrences
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()
416
+ * Register event callback - delegates to component-events.ts
417
+ * @see component-events.ts for full documentation
341
418
  */
342
419
  on(event_name: string, callback: (component: Jqhtml_Component, data?: any) => void): this;
343
420
  /**
344
- * Trigger a lifecycle event - fires all registered callbacks
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
421
+ * Register a callback that fires exactly once - delegates to component-events.ts
422
+ * If the event already occurred, fires immediately and does not register.
423
+ * @see component-events.ts for full documentation
424
+ */
425
+ once(event_name: string, callback: (component: Jqhtml_Component, data?: any) => void): this;
426
+ /**
427
+ * Trigger a lifecycle event - delegates to component-events.ts
428
+ * @see component-events.ts for full documentation
349
429
  */
350
430
  trigger(event_name: string, data?: any): void;
351
431
  /**
352
432
  * Check if any callbacks are registered for a given event
353
- * Used to determine if cleanup logic needs to run
354
433
  */
355
434
  _on_registered(event_name: string): boolean;
356
435
  /**
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
436
+ * Invalidate a lifecycle event - delegates to component-events.ts
437
+ * @see component-events.ts for full documentation
371
438
  */
372
439
  invalidate(event_name: string): void;
373
440
  /**
@@ -440,21 +507,5 @@ export declare class Jqhtml_Component {
440
507
  private _get_dom_children;
441
508
  private _log_lifecycle;
442
509
  private _log_debug;
443
- /**
444
- * Creates a debounced function with exclusivity and promise fan-in
445
- *
446
- * When invoked, immediately runs the callback exclusively.
447
- * For subsequent invocations, applies a delay before running the callback exclusively again.
448
- * The delay starts after the current asynchronous operation resolves.
449
- *
450
- * If delay is 0, the function only prevents enqueueing multiple executions,
451
- * but will still run them immediately in an exclusive sequential manner.
452
- *
453
- * The most recent invocation's parameters are used when the function executes.
454
- * Returns a promise that resolves when the next exclusive execution completes.
455
- *
456
- * @private
457
- */
458
- private _create_debounced_function;
459
510
  }
460
511
  //# sourceMappingURL=component.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"component.d.ts","sourceRoot":"","sources":["../src/component.ts"],"names":[],"mappings":"AAAA;;;;;;;;GA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C,kBAAkB;IA4B1B,OAAO,CAAC,yBAAyB;IAuHjC,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,57 @@
1
+ /**
2
+ * JQHTML Runtime Configuration
3
+ *
4
+ * Integration-level settings supplied by the host application (RSpade, Laravel,
5
+ * a bundler entry point) when jqhtml is loaded. Distinct from `jqhtml.debug`,
6
+ * which is a developer's interactive tracing switch: config here describes the
7
+ * ENVIRONMENT the app is running in, and jqhtml derives behaviour from it.
8
+ *
9
+ * jqhtml.init($, { mode: 'production' });
10
+ * jqhtml.configure({ mode: 'development' });
11
+ *
12
+ * Default mode is 'development', so an integration that passes nothing keeps
13
+ * every diagnostic. Production is always opt-in.
14
+ */
15
+ export type Jqhtml_Mode = 'development' | 'production';
16
+ export interface Jqhtml_Config {
17
+ /** Environment the host app is running in. Sets defaults for every flag below. */
18
+ mode?: Jqhtml_Mode;
19
+ /**
20
+ * Warn when a component that fetches data is invoked with args that cannot be
21
+ * serialized into a cache key, and defines no cache_id() to compensate.
22
+ * Default: on in development, off in production.
23
+ */
24
+ warn_uncacheable_args?: boolean;
25
+ /**
26
+ * Emit debug-only DOM attributes. Both of the ones jqhtml renders exist purely
27
+ * for DevTools legibility; the runtime reads neither.
28
+ *
29
+ * data-sid mirrors the scoped `id="<sid>:<cid>"` that $sid() resolves against
30
+ * data-cid mirrors the component's `_cid`, marking component boundaries
31
+ *
32
+ * Default: on in development, off in production.
33
+ *
34
+ * NOTE: the instruction processor also writes a TRANSIENT `data-cid` into the
35
+ * generated HTML string to correlate each node with its JS-side component data.
36
+ * That one is functional and is never suppressed - it is matched and removed
37
+ * during rendering, before the debug attribute above is ever written.
38
+ */
39
+ debug_attributes?: boolean;
40
+ }
41
+ /**
42
+ * Apply integration configuration.
43
+ *
44
+ * `mode` resets every flag to that mode's defaults; any explicit flag in the
45
+ * same call then overrides it. Calling with only flags leaves the mode alone.
46
+ * Repeated calls merge.
47
+ */
48
+ export declare function configure(config: Jqhtml_Config | undefined | null): void;
49
+ /** Current mode plus every resolved flag. */
50
+ export declare function get_config(): Jqhtml_Config & {
51
+ mode: Jqhtml_Mode;
52
+ };
53
+ /** True when debug-only DOM attributes (data-sid) should be emitted. */
54
+ export declare function debug_attributes_enabled(): boolean;
55
+ /** True when uncacheable-args warnings should be printed. */
56
+ export declare function warn_uncacheable_args_enabled(): boolean;
57
+ //# sourceMappingURL=config.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,MAAM,MAAM,WAAW,GAAG,aAAa,GAAG,YAAY,CAAC;AAEvD,MAAM,WAAW,aAAa;IAC5B,kFAAkF;IAClF,IAAI,CAAC,EAAE,WAAW,CAAC;IAEnB;;;;OAIG;IACH,qBAAqB,CAAC,EAAE,OAAO,CAAC;IAEhC;;;;;;;;;;;;;OAaG;IACH,gBAAgB,CAAC,EAAE,OAAO,CAAC;CAC5B;AAiBD;;;;;;GAMG;AACH,wBAAgB,SAAS,CAAC,MAAM,EAAE,aAAa,GAAG,SAAS,GAAG,IAAI,GAAG,IAAI,CAmBxE;AAED,6CAA6C;AAC7C,wBAAgB,UAAU,IAAI,aAAa,GAAG;IAAE,IAAI,EAAE,WAAW,CAAA;CAAE,CAElE;AAED,wEAAwE;AACxE,wBAAgB,wBAAwB,IAAI,OAAO,CAElD;AAED,6DAA6D;AAC7D,wBAAgB,6BAA6B,IAAI,OAAO,CAEvD"}
@@ -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"}