@jqhtml/core 2.3.72 → 2.3.75
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/cache-key-serializer.d.ts.map +1 -1
- package/dist/component-cache.d.ts +33 -8
- package/dist/component-cache.d.ts.map +1 -1
- package/dist/component-events.d.ts +6 -2
- package/dist/component-events.d.ts.map +1 -1
- package/dist/component-queue.d.ts +91 -36
- package/dist/component-queue.d.ts.map +1 -1
- package/dist/component-registry.d.ts +20 -1
- package/dist/component-registry.d.ts.map +1 -1
- package/dist/component.d.ts +255 -34
- package/dist/component.d.ts.map +1 -1
- package/dist/data-proxy.d.ts +32 -10
- package/dist/data-proxy.d.ts.map +1 -1
- package/dist/debug.d.ts +1 -1
- package/dist/debug.d.ts.map +1 -1
- package/dist/index.cjs +2370 -960
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2370 -960
- package/dist/index.js.map +1 -1
- package/dist/instruction-processor.d.ts +4 -4
- package/dist/instruction-processor.d.ts.map +1 -1
- package/dist/jqhtml-core.esm.js +2371 -961
- package/dist/jqhtml-core.esm.js.map +1 -1
- package/dist/jqhtml-debug.esm.js +9 -2
- package/dist/jqhtml-debug.esm.js.map +1 -1
- package/dist/jquery-plugin.d.ts.map +1 -1
- package/dist/lifecycle-manager.d.ts +9 -5
- package/dist/lifecycle-manager.d.ts.map +1 -1
- package/dist/load-coordinator.d.ts +5 -3
- package/dist/load-coordinator.d.ts.map +1 -1
- package/dist/local-storage.d.ts +70 -6
- package/dist/local-storage.d.ts.map +1 -1
- package/dist/markup.d.ts +37 -0
- package/dist/markup.d.ts.map +1 -0
- package/dist/style-merge.d.ts +44 -0
- package/dist/style-merge.d.ts.map +1 -0
- package/dist/viewport.d.ts +2 -1
- package/dist/viewport.d.ts.map +1 -1
- package/package.json +3 -4
|
@@ -1 +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;
|
|
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;AAyGjC;;;;;GAKG;AACH,wBAAgB,uBAAuB,CAAC,KAAK,EAAE,GAAG,GAAG,gBAAgB,CASpE"}
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
*
|
|
4
4
|
* Extracted from component.ts - handles cache key generation,
|
|
5
5
|
* cache reads during create(), cache checks during reload(),
|
|
6
|
-
* and HTML cache snapshots during ready().
|
|
6
|
+
* and HTML cache snapshots during ready() and reload().
|
|
7
7
|
*
|
|
8
8
|
* Uses Jqhtml_Local_Storage as the underlying storage layer.
|
|
9
9
|
*/
|
|
@@ -32,6 +32,16 @@ export declare function generate_cache_key(component: any): Cache_Key_Result;
|
|
|
32
32
|
* Controlled by the `warn_uncacheable_args` integration flag (see config.ts).
|
|
33
33
|
*/
|
|
34
34
|
export declare function warn_uncacheable_component(component: any, uncacheable_property?: string, uncacheable_reason?: string): void;
|
|
35
|
+
/**
|
|
36
|
+
* Keep the element's `data-nocache` marker in step with a cache key result. Boot,
|
|
37
|
+
* `load()` and `reload()` all call this with the key they just computed, so the marker
|
|
38
|
+
* always describes the CURRENT args:
|
|
39
|
+
*
|
|
40
|
+
* key - remove any `data-nocache` (args that were unkeyable are keyable again)
|
|
41
|
+
* no key - `data-nocache="<arg>:<reason>"`, plus the dev warning when `warn` is set
|
|
42
|
+
* (itself gated by `warn_uncacheable_args`, once per component+arg+reason)
|
|
43
|
+
*/
|
|
44
|
+
export declare function mark_cacheability(component: any, result: Cache_Key_Result, warn?: boolean): void;
|
|
35
45
|
/**
|
|
36
46
|
* An HTML-cache entry: the inner HTML of a component plus the cid it was rendered
|
|
37
47
|
* under. Scoped ids inside the markup are "<name>:<cid>", so the owner's cid is what
|
|
@@ -49,27 +59,42 @@ export interface Html_Cache_Snapshot {
|
|
|
49
59
|
*/
|
|
50
60
|
export declare function read_cache_in_create(component: any): void;
|
|
51
61
|
/**
|
|
52
|
-
*
|
|
53
|
-
*
|
|
62
|
+
* Refresh the cache key at the start of every reload(), then - if args have changed -
|
|
63
|
+
* check the cache. On a hit, hydrates data/html and triggers an immediate render.
|
|
64
|
+
*
|
|
65
|
+
* The recomputed key is ALWAYS assigned, null included: every cache write later in the
|
|
66
|
+
* reload (data after on_load(), the html snapshot after render) goes to _cache_key, so
|
|
67
|
+
* a key left over from the previous args would file the new args' content under the
|
|
68
|
+
* old args' entry.
|
|
54
69
|
*
|
|
55
70
|
* @param component - The component instance
|
|
71
|
+
* @param args_changed - Whether this.args differ from the last render's
|
|
56
72
|
* @returns true if rendered from cache, false otherwise
|
|
57
73
|
*/
|
|
58
|
-
export declare function check_cache_on_reload(component: any): boolean;
|
|
74
|
+
export declare function check_cache_on_reload(component: any, args_changed: boolean): boolean;
|
|
59
75
|
/**
|
|
60
|
-
* Write HTML cache snapshot during ready() phase
|
|
61
|
-
* Only caches if the component is dynamic (data changed during
|
|
76
|
+
* Write HTML cache snapshot during ready() phase, and at the end of a reload() that
|
|
77
|
+
* loaded changed data. Only caches if the component is dynamic (data changed during
|
|
78
|
+
* on_load).
|
|
62
79
|
*
|
|
63
80
|
* @param component - The component instance
|
|
64
81
|
*/
|
|
65
82
|
export declare function write_html_cache_snapshot(component: any): void;
|
|
66
83
|
/**
|
|
67
|
-
* Write data/HTML to cache after on_load() completes.
|
|
84
|
+
* Write data/HTML to cache after on_load() completes, and set component._is_dynamic.
|
|
68
85
|
* Called from _apply_load_result().
|
|
69
86
|
*
|
|
87
|
+
* A load is written when its data changed to something other than the empty '{}', OR
|
|
88
|
+
* when its data is unchanged but the cache key moved: a reload() with new args whose
|
|
89
|
+
* data equals the previous load's must still file that data under the new key, or a
|
|
90
|
+
* later boot with those args misses. Same key and unchanged data writes nothing.
|
|
91
|
+
* component._data_cache_key is the key the current this.data is cached under (written
|
|
92
|
+
* or hydrated from), null when it is not cached.
|
|
93
|
+
*
|
|
70
94
|
* @param component - The component instance
|
|
71
95
|
* @param data_changed - Whether this.data changed during on_load
|
|
96
|
+
* @param data_text - this.data's serialized text (what it was normalized through)
|
|
72
97
|
*/
|
|
73
|
-
export declare function write_cache_on_loaded(component: any, data_changed: boolean): void;
|
|
98
|
+
export declare function write_cache_on_loaded(component: any, data_changed: boolean, data_text: string): void;
|
|
74
99
|
export {};
|
|
75
100
|
//# sourceMappingURL=component-cache.d.ts.map
|
|
@@ -1 +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;AAKD;;;;;;;GA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GAAG,GAAG,IAAI,CAsC9D;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,qBAAqB,CAAC,SAAS,EAAE,GAAG,EAAE,YAAY,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM,GAAG,IAAI,CAiDpG"}
|
|
@@ -4,6 +4,10 @@
|
|
|
4
4
|
* Extracted from component.ts - handles lifecycle event registration,
|
|
5
5
|
* triggering, and state tracking.
|
|
6
6
|
*
|
|
7
|
+
* Every handler runs with `this` bound to the component and the component as its first
|
|
8
|
+
* argument, whether it fires from trigger(), as a once() handler, or immediately on
|
|
9
|
+
* registration (sticky replay).
|
|
10
|
+
*
|
|
7
11
|
* EVERY event is "sticky", not just the lifecycle ones: trigger() records the event
|
|
8
12
|
* name and its payload, and a handler registered afterwards fires immediately with that
|
|
9
13
|
* last payload. This is deliberate and applies to custom events too - a subscriber that
|
|
@@ -25,7 +29,7 @@
|
|
|
25
29
|
* @param event_name - Name of the event
|
|
26
30
|
* @param callback - Callback: (component, data?) => void
|
|
27
31
|
*/
|
|
28
|
-
export declare function event_on(component: any, event_name: string, callback: (comp: any, data?: any) => void): any;
|
|
32
|
+
export declare function event_on(component: any, event_name: string, callback: (this: any, comp: any, data?: any) => void): any;
|
|
29
33
|
/**
|
|
30
34
|
* Register a callback that fires exactly once.
|
|
31
35
|
*
|
|
@@ -36,7 +40,7 @@ export declare function event_on(component: any, event_name: string, callback: (
|
|
|
36
40
|
* @param event_name - Name of the event
|
|
37
41
|
* @param callback - Callback: (component, data?) => void
|
|
38
42
|
*/
|
|
39
|
-
export declare function event_once(component: any, event_name: string, callback: (comp: any, data?: any) => void): any;
|
|
43
|
+
export declare function event_once(component: any, event_name: string, callback: (this: any, comp: any, data?: any) => void): any;
|
|
40
44
|
/**
|
|
41
45
|
* Trigger an event - fires all registered callbacks.
|
|
42
46
|
* Marks event as occurred so future .on() calls fire immediately.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"component-events.d.ts","sourceRoot":"","sources":["../src/component-events.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"component-events.d.ts","sourceRoot":"","sources":["../src/component-events.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,QAAQ,CAAC,SAAS,EAAE,GAAG,EAAE,UAAU,EAAE,MAAM,EAAE,QAAQ,EAAE,CAAC,IAAI,EAAE,GAAG,EAAE,IAAI,EAAE,GAAG,EAAE,IAAI,CAAC,EAAE,GAAG,KAAK,IAAI,GAAG,GAAG,CAqBtH;AAED;;;;;;;;;GASG;AACH,wBAAgB,UAAU,CAAC,SAAS,EAAE,GAAG,EAAE,UAAU,EAAE,MAAM,EAAE,QAAQ,EAAE,CAAC,IAAI,EAAE,GAAG,EAAE,IAAI,EAAE,GAAG,EAAE,IAAI,CAAC,EAAE,GAAG,KAAK,IAAI,GAAG,GAAG,CAsCxH;AAED;;;;;;;GAOG;AACH,wBAAgB,aAAa,CAAC,SAAS,EAAE,GAAG,EAAE,UAAU,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,GAAG,GAAG,IAAI,CAsBlF;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"}
|
|
@@ -1,58 +1,113 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* JQHTML Component Lifecycle Queue
|
|
3
3
|
*
|
|
4
|
-
* Serializes
|
|
5
|
-
* Replaces _create_debounced_function with a proper queue that:
|
|
4
|
+
* One lock per component. Serializes boot with render(), load(), reload() and refresh():
|
|
6
5
|
*
|
|
7
|
-
* -
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
* - A
|
|
12
|
-
*
|
|
13
|
-
*
|
|
6
|
+
* - Boot is the first entry. Every entry - boot included - holds the lock from its start
|
|
7
|
+
* through the end of its own on_ready(). A call made meanwhile, including one made
|
|
8
|
+
* from inside on_ready(), waits and starts after it - unless it is awaited while that
|
|
9
|
+
* on_ready() is still running: then promote() runs it at once, nested.
|
|
10
|
+
* - A call made while the lock is held waits as a pending entry; pending entries run in
|
|
11
|
+
* call order, one at a time.
|
|
12
|
+
* - A new call merges only into the LAST pending entry (never the running one), and only
|
|
13
|
+
* when it has the same key (same method, same arguments). The merged caller does not
|
|
14
|
+
* run; it settles with the result of the entry it merged into. Different keys never
|
|
15
|
+
* merge: reload, refresh, reload stays three entries.
|
|
16
|
+
* - A caller is settled BEFORE the next pending entry starts.
|
|
14
17
|
*/
|
|
18
|
+
export interface Queue_Entry<T = any> {
|
|
19
|
+
/** Method plus arguments: 'render', 'load', 'reload' (reload(), reload(true)), 'refresh' (refresh(), reload(false)) */
|
|
20
|
+
key: string;
|
|
21
|
+
executor: () => Promise<T>;
|
|
22
|
+
resolvers: Array<(value: T) => void>;
|
|
23
|
+
rejecters: Array<(error: any) => void>;
|
|
24
|
+
}
|
|
15
25
|
export declare class Component_Queue {
|
|
16
|
-
|
|
17
|
-
private _current;
|
|
26
|
+
private _on_idle;
|
|
18
27
|
/**
|
|
19
|
-
*
|
|
20
|
-
*
|
|
21
|
-
* collapses into it, but a render() queued over a pending reload() is its
|
|
22
|
-
* own entry and both run. Replacing the older entry (the previous behaviour)
|
|
23
|
-
* dropped that operation entirely while still resolving its callers as if it
|
|
24
|
-
* had run.
|
|
28
|
+
* True while boot or an entry holds the lock - and through the macrotask gap between a
|
|
29
|
+
* finished entry and the next pending one, so nothing can jump ahead of the queue.
|
|
25
30
|
*/
|
|
31
|
+
private _busy;
|
|
32
|
+
/** True from begin_boot() until end_boot() */
|
|
33
|
+
private _booting;
|
|
34
|
+
/** Entries waiting for the lock, in call order */
|
|
26
35
|
private _pending;
|
|
36
|
+
/** Promoted entries still running (see promote()) */
|
|
37
|
+
private _promoted_running;
|
|
38
|
+
/** The lock holder finished while promoted entries still ran; release when they end */
|
|
39
|
+
private _release_deferred;
|
|
40
|
+
/** @param _on_idle - Called whenever the lock is released with nothing waiting */
|
|
41
|
+
constructor(_on_idle: () => void);
|
|
42
|
+
/** True while calls are waiting for the lock. */
|
|
43
|
+
get has_pending(): boolean;
|
|
44
|
+
/** True while a promoted entry is still running. */
|
|
45
|
+
get promoted_running(): boolean;
|
|
46
|
+
/** Boot start: boot is the first entry and takes the lock. */
|
|
47
|
+
begin_boot(): void;
|
|
27
48
|
/**
|
|
28
|
-
*
|
|
29
|
-
*
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
*
|
|
34
|
-
* swap in the newest executor ("only the most recent call executes")
|
|
35
|
-
*
|
|
36
|
-
* Every caller collapsed onto one entry receives the value that entry's
|
|
37
|
-
* executor returned - or its error, if it threw.
|
|
49
|
+
* Boot ended: after its on_ready(), or early (stopped, threw, truncated lifecycle).
|
|
50
|
+
* Releases the lock. Safe to call more than once.
|
|
51
|
+
*/
|
|
52
|
+
end_boot(): void;
|
|
53
|
+
/**
|
|
54
|
+
* Run `executor` now if the component is idle, otherwise queue it.
|
|
38
55
|
*
|
|
39
|
-
* @param
|
|
40
|
-
* @param executor - The async
|
|
41
|
-
*
|
|
56
|
+
* @param key - Method plus arguments. Only an identical key merges.
|
|
57
|
+
* @param executor - The async operation. It reads this.args when it STARTS, so a
|
|
58
|
+
* merged caller gets the newest args.
|
|
59
|
+
* @returns The promise that settles with the result of the entry that ran, and the
|
|
60
|
+
* pending entry the call is waiting on (null when it started at once) - the
|
|
61
|
+
* handle promote() takes.
|
|
42
62
|
*/
|
|
43
|
-
enqueue<T>(
|
|
63
|
+
enqueue<T>(key: string, executor: () => Promise<T>): {
|
|
64
|
+
promise: Promise<T>;
|
|
65
|
+
entry: Queue_Entry<T> | null;
|
|
66
|
+
};
|
|
44
67
|
/**
|
|
45
|
-
* Run
|
|
68
|
+
* Run a pending entry NOW, nested inside the cycle that holds the lock: the cycle's
|
|
69
|
+
* on_ready() is awaiting it, and would otherwise wait forever. The entry leaves the
|
|
70
|
+
* queue (so no later call merges into it); the lock stays with the running cycle. The
|
|
71
|
+
* lock is not released while a promoted entry still runs, even when the cycle that
|
|
72
|
+
* holds it ends first, so nothing queued can start alongside it.
|
|
73
|
+
* @returns false when the entry is no longer pending (already started or promoted)
|
|
74
|
+
*/
|
|
75
|
+
promote(entry: Queue_Entry<any>): boolean;
|
|
76
|
+
/**
|
|
77
|
+
* Run one entry, settle its callers, then release the lock.
|
|
46
78
|
* @private
|
|
47
79
|
*/
|
|
48
80
|
private _run;
|
|
49
81
|
/**
|
|
50
|
-
*
|
|
82
|
+
* Run an entry's executor and settle its callers. Touches no lock state.
|
|
83
|
+
* @private
|
|
51
84
|
*/
|
|
52
|
-
|
|
85
|
+
private _execute;
|
|
53
86
|
/**
|
|
54
|
-
*
|
|
87
|
+
* Release the lock, or hand it to the next pending entry.
|
|
88
|
+
* @private
|
|
55
89
|
*/
|
|
56
|
-
|
|
90
|
+
private _release;
|
|
91
|
+
}
|
|
92
|
+
/**
|
|
93
|
+
* The promise render(), load(), reload() and refresh() return when they are called while
|
|
94
|
+
* one of the component's own on_loaded() or on_ready() is running.
|
|
95
|
+
*
|
|
96
|
+
* `await` (and any chaining) calls .then() on a non-native promise, so .then() is where
|
|
97
|
+
* awaiting is seen. The first .then() runs `on_then` once: during on_ready() it pulls the
|
|
98
|
+
* queued call forward so it runs at once instead of deadlocking; during on_loaded() it
|
|
99
|
+
* warns (development).
|
|
100
|
+
*
|
|
101
|
+
* Derived promises (.then()/.catch()/.finally() results) are plain Promises.
|
|
102
|
+
*/
|
|
103
|
+
export declare class Lifecycle_Call_Promise<T> extends Promise<T> {
|
|
104
|
+
static get [Symbol.species](): PromiseConstructor;
|
|
105
|
+
private _on_then;
|
|
106
|
+
/**
|
|
107
|
+
* @param promise - The queued call's promise
|
|
108
|
+
* @param on_then - Run once, on the first .then() (await or chain)
|
|
109
|
+
*/
|
|
110
|
+
static wrap<T>(promise: Promise<T>, on_then: () => void): Lifecycle_Call_Promise<T>;
|
|
111
|
+
then<R1 = T, R2 = never>(on_fulfilled?: ((value: T) => R1 | PromiseLike<R1>) | null, on_rejected?: ((reason: any) => R2 | PromiseLike<R2>) | null): Promise<R1 | R2>;
|
|
57
112
|
}
|
|
58
113
|
//# sourceMappingURL=component-queue.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"component-queue.d.ts","sourceRoot":"","sources":["../src/component-queue.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"component-queue.d.ts","sourceRoot":"","sources":["../src/component-queue.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,MAAM,WAAW,WAAW,CAAC,CAAC,GAAG,GAAG;IAClC,uHAAuH;IACvH,GAAG,EAAE,MAAM,CAAC;IACZ,QAAQ,EAAE,MAAM,OAAO,CAAC,CAAC,CAAC,CAAC;IAC3B,SAAS,EAAE,KAAK,CAAC,CAAC,KAAK,EAAE,CAAC,KAAK,IAAI,CAAC,CAAC;IACrC,SAAS,EAAE,KAAK,CAAC,CAAC,KAAK,EAAE,GAAG,KAAK,IAAI,CAAC,CAAC;CACxC;AAED,qBAAa,eAAe;IAoBd,OAAO,CAAC,QAAQ;IAnB5B;;;OAGG;IACH,OAAO,CAAC,KAAK,CAAkB;IAE/B,8CAA8C;IAC9C,OAAO,CAAC,QAAQ,CAAkB;IAElC,kDAAkD;IAClD,OAAO,CAAC,QAAQ,CAA0B;IAE1C,qDAAqD;IACrD,OAAO,CAAC,iBAAiB,CAAa;IAEtC,uFAAuF;IACvF,OAAO,CAAC,iBAAiB,CAAkB;IAE3C,kFAAkF;gBAC9D,QAAQ,EAAE,MAAM,IAAI;IAExC,iDAAiD;IACjD,IAAI,WAAW,IAAI,OAAO,CAEzB;IAED,oDAAoD;IACpD,I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@@ -5,7 +5,10 @@
|
|
|
5
5
|
* Enables dynamic component instantiation and template association
|
|
6
6
|
*/
|
|
7
7
|
import { Jqhtml_Component } from './component.js';
|
|
8
|
-
|
|
8
|
+
import { Jqhtml_Markup } from './markup.js';
|
|
9
|
+
export type TemplateFunction = (this: Jqhtml_Component, data: Record<string, any>, args: Record<string, any>, content: any, jqhtml?: any) => Jqhtml_Markup | {
|
|
10
|
+
_slots: Record<string, (...args: any[]) => Jqhtml_Markup>;
|
|
11
|
+
};
|
|
9
12
|
export interface TemplateDefinition {
|
|
10
13
|
name: string;
|
|
11
14
|
tag: string;
|
|
@@ -33,6 +36,22 @@ export declare function register_template(template_def: TemplateDefinition): boo
|
|
|
33
36
|
* Get template for a component by name
|
|
34
37
|
*/
|
|
35
38
|
export declare function get_template(name: string): TemplateDefinition;
|
|
39
|
+
/**
|
|
40
|
+
* Check a template's `extends=""` against its component's JS class (CLAUDE.md "Template
|
|
41
|
+
* Inheritance"). Returns an error message on conflict, null otherwise.
|
|
42
|
+
*
|
|
43
|
+
* The rule: list the class's JS ancestors up to Jqhtml_Component that have a template of
|
|
44
|
+
* their own. An empty list (the class extends Jqhtml_Component directly, or only plain
|
|
45
|
+
* helper classes sit in between) cannot conflict. Otherwise `extends=` must name one of
|
|
46
|
+
* them - any ancestor, so a template may skip an intermediate layer. A template-only
|
|
47
|
+
* component (no class registered under the template's name) and an `extends=` target
|
|
48
|
+
* that has no template (resolution falls back to the prototype chain) are not conflicts.
|
|
49
|
+
*
|
|
50
|
+
* @param template_def The template being rendered
|
|
51
|
+
* @param instance_class The rendering instance's class, used when no class is registered
|
|
52
|
+
* under the template's name but the instance's class carries that name
|
|
53
|
+
*/
|
|
54
|
+
export declare function extends_conflict(template_def: TemplateDefinition, instance_class?: any): string | null;
|
|
36
55
|
/**
|
|
37
56
|
* Get template for a component class - walks up inheritance chain
|
|
38
57
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"component-registry.d.ts","sourceRoot":"","sources":["../src/component-registry.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"component-registry.d.ts","sourceRoot":"","sources":["../src/component-registry.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAElD,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAI5C,MAAM,MAAM,gBAAgB,GAAG,CAC7B,IAAI,EAAE,gBAAgB,EACtB,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EACzB,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EACzB,OAAO,EAAE,GAAG,EACZ,MAAM,CAAC,EAAE,GAAG,KACT,aAAa,GAAG;IAAE,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,aAAa,CAAC,CAAA;CAAE,CAAC;AAGnF,MAAM,WAAW,kBAAkB;IACjC,IAAI,EAAE,MAAM,CAAC;IACb,GAAG,EAAE,MAAM,CAAC;IACZ,iBAAiB,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IACxC,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,gBAAgB,CAAC;CAC1B;AAGD,MAAM,MAAM,oBAAoB,GAAG,KAAK,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EAAE,OAAO,CAAC,EAAE,GAAG,KAAK,gBAAgB,CAAC;AAyDtG;;GAEG;AACH,wBAAgB,kBAAkB,CAChC,IAAI,EAAE,MAAM,EACZ,eAAe,EAAE,oBAAoB,EACrC,QAAQ,CAAC,EAAE,kBAAkB,GAC5B,IAAI,CAAC;AACR,wBAAgB,kBAAkB,CAAC,eAAe,EAAE,oBAAoB,GAAG,IAAI,C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