@jqhtml/core 2.3.64 → 2.3.68
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/README.md +1 -1
- package/dist/component-cache.d.ts +18 -0
- package/dist/component-cache.d.ts.map +1 -1
- package/dist/component-events.d.ts +11 -6
- package/dist/component-events.d.ts.map +1 -1
- package/dist/component-name.d.ts +7 -0
- package/dist/component-name.d.ts.map +1 -1
- package/dist/component-queue.d.ts +23 -12
- package/dist/component-queue.d.ts.map +1 -1
- package/dist/component.d.ts +48 -0
- package/dist/component.d.ts.map +1 -1
- package/dist/data-proxy.d.ts +5 -2
- package/dist/data-proxy.d.ts.map +1 -1
- package/dist/debug-overlay/index.d.ts +35 -0
- package/dist/debug-overlay/index.d.ts.map +1 -0
- package/dist/escape.d.ts +13 -0
- package/dist/escape.d.ts.map +1 -0
- package/dist/index.cjs +1853 -1022
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +18 -4
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1849 -1022
- package/dist/index.js.map +1 -1
- package/dist/instruction-processor.d.ts.map +1 -1
- package/dist/jqhtml-core.esm.js +1850 -1023
- 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 -4
- package/dist/lifecycle-manager.d.ts.map +1 -1
- package/dist/load-coordinator.d.ts +18 -9
- package/dist/load-coordinator.d.ts.map +1 -1
- package/dist/local-storage.d.ts +41 -8
- package/dist/local-storage.d.ts.map +1 -1
- package/dist/preload-data.d.ts +8 -0
- package/dist/preload-data.d.ts.map +1 -1
- package/dist/value-printers.d.ts +47 -0
- package/dist/value-printers.d.ts.map +1 -0
- package/package.json +2 -1
- package/dist/template-renderer.d.ts +0 -22
- package/dist/template-renderer.d.ts.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"jquery-plugin.d.ts","sourceRoot":"","sources":["../src/jquery-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AAQ,EAAE,MAAM,GAAG,MAAM,CAAC;KACvC;CACF;AAGD,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,GAAG,GAAG,IAAI,CAqiBpD"}
|
|
@@ -35,9 +35,5 @@ export declare class LifecycleManager {
|
|
|
35
35
|
* Unregister a component (called on destroy)
|
|
36
36
|
*/
|
|
37
37
|
unregister_component(component: Jqhtml_Component): void;
|
|
38
|
-
/**
|
|
39
|
-
* Wait for all active components to reach ready state
|
|
40
|
-
*/
|
|
41
|
-
wait_for_ready(): Promise<void>;
|
|
42
38
|
}
|
|
43
39
|
//# sourceMappingURL=lifecycle-manager.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lifecycle-manager.d.ts","sourceRoot":"","sources":["../src/lifecycle-manager.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"lifecycle-manager.d.ts","sourceRoot":"","sources":["../src/lifecycle-manager.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAGvD,MAAM,MAAM,cAAc,GAAG,QAAQ,GAAG,QAAQ,GAAG,MAAM,GAAG,OAAO,CAAC;AAEpE,qBAAa,gBAAgB;IAC3B,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAmB;IAC1C,OAAO,CAAC,iBAAiB,CAAoC;IAE7D,MAAM,CAAC,YAAY,IAAI,gBAAgB;;IAevC;;;;;;;OAOG;IACG,cAAc,CAAC,SAAS,EAAE,gBAAgB,GAAG,OAAO,CAAC,IAAI,CAAC;IAiLhE;;OAEG;IACH,oBAAoB,CAAC,SAAS,EAAE,gBAAgB,GAAG,IAAI;CAGxD"}
|
|
@@ -61,26 +61,31 @@ export declare class Load_Coordinator {
|
|
|
61
61
|
/**
|
|
62
62
|
* Check if a component should execute on_load() or wait for existing request
|
|
63
63
|
* Returns true if component should execute (is leader), false if should wait (is follower)
|
|
64
|
+
*
|
|
65
|
+
* @param key - The dedup key the caller captured for this load. Every coordinator
|
|
66
|
+
* method takes it, because args may legally change during on_load()
|
|
67
|
+
* and a recomputed key would address a different (or no) entry.
|
|
64
68
|
*/
|
|
65
|
-
static should_execute_on_load(component: Jqhtml_Component): boolean;
|
|
69
|
+
static should_execute_on_load(component: Jqhtml_Component, key: string): boolean;
|
|
66
70
|
/**
|
|
67
71
|
* Register a leader component that will execute on_load()
|
|
68
72
|
* Creates coordination entry and returns a function to call when data is ready
|
|
69
73
|
*
|
|
74
|
+
* @param key - The dedup key captured by the caller (see should_execute_on_load)
|
|
70
75
|
* @returns A function that accepts the final data and completes coordination
|
|
71
76
|
*/
|
|
72
|
-
static register_leader(component: Jqhtml_Component,
|
|
77
|
+
static register_leader(component: Jqhtml_Component, key: string): (final_data: Record<string, any>) => void;
|
|
73
78
|
/**
|
|
74
79
|
* Get the coordination promise for a follower component
|
|
75
|
-
* Returns a promise that resolves when the leader completes
|
|
80
|
+
* Returns a promise that resolves when the leader completes, or rejects if it failed
|
|
76
81
|
*/
|
|
77
|
-
static get_coordination_promise(
|
|
82
|
+
static get_coordination_promise(key: string): Promise<void> | null;
|
|
78
83
|
/**
|
|
79
84
|
* Complete coordination after leader's on_load() finishes
|
|
80
85
|
* Stores leader's data, marks entry as completed, and resolves the promise.
|
|
81
86
|
* Followers retrieve the data themselves via get_leader_data().
|
|
82
87
|
*
|
|
83
|
-
* @param key - The coordination key
|
|
88
|
+
* @param key - The coordination key captured at registration
|
|
84
89
|
* @param leader - The leader component
|
|
85
90
|
* @param final_data - The final data after on_load and normalization
|
|
86
91
|
* @private
|
|
@@ -89,14 +94,18 @@ export declare class Load_Coordinator {
|
|
|
89
94
|
/**
|
|
90
95
|
* Get leader's data for a follower component
|
|
91
96
|
* Called by follower after coordination promise resolves
|
|
92
|
-
* Returns
|
|
97
|
+
* Returns a freshly parsed copy and cleans up if this is the last follower
|
|
98
|
+
*
|
|
99
|
+
* @param key - The dedup key captured by the follower before it began waiting
|
|
93
100
|
*/
|
|
94
|
-
static get_leader_data(component: Jqhtml_Component): Record<string, any> | null;
|
|
101
|
+
static get_leader_data(component: Jqhtml_Component, key: string): Record<string, any> | null;
|
|
95
102
|
/**
|
|
96
103
|
* Handle leader on_load() error
|
|
97
|
-
*
|
|
104
|
+
* Rejects every waiting follower and clears the entry so the next component retries
|
|
105
|
+
*
|
|
106
|
+
* @param key - The dedup key captured at registration
|
|
98
107
|
*/
|
|
99
|
-
static handle_leader_error(
|
|
108
|
+
static handle_leader_error(key: string, error: Error): void;
|
|
100
109
|
/**
|
|
101
110
|
* Get current registry state (for debugging)
|
|
102
111
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"load-coordinator.d.ts","sourceRoot":"","sources":["../src/load-coordinator.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAEH,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"load-coordinator.d.ts","sourceRoot":"","sources":["../src/load-coordinator.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAEH,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAcvD,MAAM,WAAW,mBAAmB;IAChC,GAAG,EAAE,MAAM,GAAG,IAAI,CAAC;IACnB,oBAAoB,CAAC,EAAE,MAAM,CAAC;IAC9B,qFAAqF;IACrF,kBAAkB,CAAC,EAAE,MAAM,CAAC;CAC/B;AAED,MAAM,WAAW,oBAAoB;IACjC;;;;;;;;;;;OAWG;IACH,2BAA2B,CAAC,EAAE,OAAO,CAAC;CACzC;AAED,qBAAa,gBAAgB;IACzB,OAAO,CAAC,MAAM,CAAC,SAAS,CAA6C;IAErE;;;;;;;;;;;;;OAaG;IACH,MAAM,CAAC,uBAAuB,CAC1B,cAAc,EAAE,MAAM,EACtB,IAAI,EAAE,GAAG,EACT,OAAO,GAAE,oBAAyB,GACnC,mBAAmB;IAkGtB;;;;;;;OAOG;IACH,MAAM,CAAC,sBAAsB,CAAC,SAAS,EAAE,gBAAgB,EAAE,GAAG,EAAE,MAAM,GAAG,OAAO;IAmBhF;;;;;;OAMG;IACH,MAAM,CAAC,eAAe,CAClB,SAAS,EAAE,gBAAgB,EAC3B,GAAG,EAAE,MAAM,GACZ,CAAC,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,KAAK,IAAI;IA6B5C;;;OAGG;IACH,MAAM,CAAC,wBAAwB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,GAAG,IAAI;IAUlE;;;;;;;;;OASG;IACH,OAAO,CAAC,MAAM,CAAC,sBAAsB;IAkCrC;;;;;;OAMG;IACH,MAAM,CAAC,eAAe,CAAC,SAAS,EAAE,gBAAgB,EAAE,GAAG,EAAE,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,IAAI;IAsC5F;;;;;OAKG;IACH,MAAM,CAAC,mBAAmB,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,KAAK,GAAG,IAAI;IA8B3D;;OAEG;IACH,MAAM,CAAC,kBAAkB,IAAI,GAAG;IAahC;;OAEG;IACH,MAAM,CAAC,SAAS,IAAI,IAAI;CAG3B"}
|
package/dist/local-storage.d.ts
CHANGED
|
@@ -66,6 +66,31 @@
|
|
|
66
66
|
* - Transient UI state (convenience, not required)
|
|
67
67
|
*
|
|
68
68
|
* @internal This class is not exposed in the public API
|
|
69
|
+
*
|
|
70
|
+
* ---------------------------------------------------------------------------
|
|
71
|
+
* REPORTING WHAT WAS DROPPED
|
|
72
|
+
*
|
|
73
|
+
* `this.data` is always the serialized copy this file produces - in EVERY cache
|
|
74
|
+
* mode, including 'none' (see component.ts `_apply_load_result`). Whatever the
|
|
75
|
+
* serializer cannot express is therefore not merely missing from the cache, it
|
|
76
|
+
* is missing from `this.data`, and an author needs to be told once rather than
|
|
77
|
+
* discover it on the next cache hit.
|
|
78
|
+
*
|
|
79
|
+
* Two small optional parameters carry that:
|
|
80
|
+
*
|
|
81
|
+
* process_for_serialization(value, verbose, seen, path, collector?)
|
|
82
|
+
* `collector(path, kind)` is invoked for every value that is dropped or
|
|
83
|
+
* degraded. `path` is a dotted/bracketed path from the root the caller
|
|
84
|
+
* named; `kind` is one of Strip_Kind. Paths are only BUILT when a
|
|
85
|
+
* collector is present, so the no-collector path costs nothing.
|
|
86
|
+
*
|
|
87
|
+
* Jqhtml_Local_Storage.normalize_for_cache(value, component_name?)
|
|
88
|
+
* With a component name, and only in development mode, each dropped path
|
|
89
|
+
* prints exactly ONE console.warn for the life of the page (keyed
|
|
90
|
+
* `${component_name}:${path}`, the same once-only shape as
|
|
91
|
+
* warn_uncacheable_args in component-cache.ts). Production converts
|
|
92
|
+
* silently. Neither ever throws.
|
|
93
|
+
* ---------------------------------------------------------------------------
|
|
69
94
|
*/
|
|
70
95
|
/**
|
|
71
96
|
* Register a class for cache serialization/deserialization.
|
|
@@ -79,6 +104,13 @@ export declare function register_cache_class(klass: new (...args: any[]) => any)
|
|
|
79
104
|
* Check if a class is registered for caching
|
|
80
105
|
*/
|
|
81
106
|
export declare function is_cache_class_registered(class_name: string): boolean;
|
|
107
|
+
/**
|
|
108
|
+
* What kind of value the serializer had to drop or degrade. Reported to a
|
|
109
|
+
* collector; each kind maps to one piece of advice in strip_advice().
|
|
110
|
+
*/
|
|
111
|
+
export type Strip_Kind = 'function' | 'promise' | 'dom-node' | 'jquery' | 'component' | 'symbol' | 'bigint' | 'circular' | 'unregistered-class';
|
|
112
|
+
/** Called once per dropped/degraded value with its path and what it was. */
|
|
113
|
+
export type Strip_Collector = (path: string, kind: Strip_Kind, detail?: string) => void;
|
|
82
114
|
/**
|
|
83
115
|
* Cache mode determines how component data is cached and restored.
|
|
84
116
|
*
|
|
@@ -185,17 +217,18 @@ export declare class Jqhtml_Local_Storage {
|
|
|
185
217
|
/**
|
|
186
218
|
* Perform a serialize/deserialize round-trip on a value.
|
|
187
219
|
*
|
|
188
|
-
*
|
|
189
|
-
*
|
|
190
|
-
*
|
|
191
|
-
*
|
|
192
|
-
*
|
|
193
|
-
* registrations immediately rather than only after a page reload.
|
|
220
|
+
* The result is ALWAYS jqhtml's own copy: nothing of the caller's object graph
|
|
221
|
+
* is aliased through, and a value the serializer cannot express is dropped
|
|
222
|
+
* rather than smuggled out. That is what makes `this.data` identical whether it
|
|
223
|
+
* came from on_load() or from a cache hit - the old "on failure return the
|
|
224
|
+
* original" branch broke exactly that promise, and only on the hard cases.
|
|
194
225
|
*
|
|
195
226
|
* @param {any} value - The value to normalize
|
|
196
|
-
* @
|
|
227
|
+
* @param {string} [component_name] - Names the component in development warnings.
|
|
228
|
+
* Omit to convert silently (the unit tests and non-component callers).
|
|
229
|
+
* @returns {any} The round-tripped value. Never the original object.
|
|
197
230
|
*/
|
|
198
|
-
static normalize_for_cache(value: any): any;
|
|
231
|
+
static normalize_for_cache(value: any, component_name?: string): any;
|
|
199
232
|
/**
|
|
200
233
|
* Internal set implementation with scope validation and quota handling
|
|
201
234
|
* @param {string} key
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"local-storage.d.ts","sourceRoot":"","sources":["../src/local-storage.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"local-storage.d.ts","sourceRoot":"","sources":["../src/local-storage.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6FG;AAkBH;;;;;;GAMG;AACH,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,KAAK,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,GAAG,GAAG,IAAI,CAK7E;AAED;;G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;IACH,OAAO,CAAC,MAAM,CAAC,SAAS;IAIxB;;;;;;;;OAQG;IACH,MAAM,CAAC,GAAG,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,GAAG,GAAG,IAAI;IAkDzC;;;;;;;OAOG;IACH,MAAM,CAAC,GAAG,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,GAAG,IAAI;IAoCnC;;;OAGG;IACH,MAAM,CAAC,MAAM,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI;IAQhC;;;;;;;;;;;;;OAaG;IACH,MAAM,CAAC,mBAAmB,CAAC,KAAK,EAAE,GAAG,EAAE,cAAc,CAAC,EAAE,MAAM,GAAG,GAAG;IA4BpE;;;;;OAKG;IACH,OAAO,CAAC,MAAM,CAAC,SAAS;IA+BxB;;;;OAIG;IACH,OAAO,CAAC,MAAM,CAAC,YAAY;CAS9B"}
|
package/dist/preload-data.d.ts
CHANGED
|
@@ -11,6 +11,14 @@ export interface PreloadEntry {
|
|
|
11
11
|
component: string;
|
|
12
12
|
args: Record<string, any>;
|
|
13
13
|
data: Record<string, any>;
|
|
14
|
+
/**
|
|
15
|
+
* The exact cache key the capturing component was keyed under (from
|
|
16
|
+
* generate_cache_key()). Emitted by get_captured_data() and honoured by
|
|
17
|
+
* set_preload_data(). Without it a cache_id() component could never match:
|
|
18
|
+
* its key is `<name>::<cache_id()>`, a shape no amount of arg serialization
|
|
19
|
+
* on the client can reproduce. Absent when the component had no key.
|
|
20
|
+
*/
|
|
21
|
+
key?: string;
|
|
14
22
|
}
|
|
15
23
|
/**
|
|
16
24
|
* Enable data capture mode. After this call, every component that completes
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"preload-data.d.ts","sourceRoot":"","sources":["../src/preload-data.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAMH,MAAM,WAAW,YAAY;IAC3B,SAAS,EAAE,MAAM,CAAC;IAClB,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,C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/**
|
|
2
|
+
* Value printers: how <%= %> renders an OBJECT.
|
|
3
|
+
*
|
|
4
|
+
* Primitives never come here - the generated template code routes only
|
|
5
|
+
* non-null, non-array objects to print_object(), so a hundred-row list of
|
|
6
|
+
* strings costs exactly what it did before. An object reaching an
|
|
7
|
+
* interpolation is walked through the printer chain in registration order;
|
|
8
|
+
* the first printer to return anything but undefined handles it. A printer
|
|
9
|
+
* returns a string (escaped or not according to the construct, exactly as a
|
|
10
|
+
* string literal at that site) or a component descriptor:
|
|
11
|
+
*
|
|
12
|
+
* { component: { name: 'Rich_Text_Display', args: { value }, attrs: { class: 'x' } } }
|
|
13
|
+
*
|
|
14
|
+
* which jqhtml mounts as if the template had written the tag - live in the
|
|
15
|
+
* browser, server-rendered under SSR - with no environment awareness on the
|
|
16
|
+
* printer's side. A descriptor carries no content.
|
|
17
|
+
*
|
|
18
|
+
* Attribute position (<div title="<%= v %>">) compiles through a different
|
|
19
|
+
* path and never consults printers.
|
|
20
|
+
*/
|
|
21
|
+
export type Print_Mode = 'escape' | 'raw' | 'nl2br';
|
|
22
|
+
export interface Component_Descriptor {
|
|
23
|
+
component: {
|
|
24
|
+
name: string;
|
|
25
|
+
args?: Record<string, any>;
|
|
26
|
+
attrs?: Record<string, any>;
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
export type Object_Printer = (value: object) => undefined | string | Component_Descriptor;
|
|
30
|
+
/** A mounted descriptor, in the instruction form the runtime already understands. */
|
|
31
|
+
export type Component_Instruction = {
|
|
32
|
+
comp: [string, Record<string, any>];
|
|
33
|
+
};
|
|
34
|
+
/**
|
|
35
|
+
* Register a printer at the end of the chain. Printers run in registration
|
|
36
|
+
* order; return undefined to decline, a string, or a component descriptor.
|
|
37
|
+
*/
|
|
38
|
+
export declare function add_object_printer(printer: Object_Printer): void;
|
|
39
|
+
/** The registered printers, in order. Read-only view for diagnostics. */
|
|
40
|
+
export declare function get_object_printers(): readonly Object_Printer[];
|
|
41
|
+
/**
|
|
42
|
+
* Render an object at an interpolation site. Called by compiled templates for
|
|
43
|
+
* every non-null, non-array object reaching <%= %>, <%!= %> or <%br= %>.
|
|
44
|
+
* Throws when nothing handles the value or a printer returns garbage.
|
|
45
|
+
*/
|
|
46
|
+
export declare function print_object(value: object, mode: Print_Mode): string | Component_Instruction;
|
|
47
|
+
//# sourceMappingURL=value-printers.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"value-printers.d.ts","sourceRoot":"","sources":["../src/value-printers.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAKH,MAAM,MAAM,UAAU,GAAG,QAAQ,GAAG,KAAK,GAAG,OAAO,CAAC;AAEpD,MAAM,WAAW,oBAAoB;IACnC,SAAS,EAAE;QACT,IAAI,EAAE,MAAM,CAAC;QACb,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;QAC3B,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;KAC7B,CAAC;CACH;AAED,MAAM,MAAM,cAAc,GAAG,CAAC,KAAK,EAAE,MAAM,KAAK,SAAS,GAAG,MAAM,GAAG,oBAAoB,CAAC;AAE1F,qFAAqF;AACrF,MAAM,MAAM,qBAAqB,GAAG;IAAE,IAAI,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC,CAAA;CAAE,CAAC;AAI5E;;;GAGG;AACH,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,cAAc,GAAG,IAAI,CAKhE;AAED,yEAAyE;AACzE,wBAAgB,mBAAmB,IAAI,SAAS,cAAc,EAAE,CAE/D;AAED;;;;GAIG;AACH,wBAAgB,YAAY,CAAC,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,UAAU,GAAG,MAAM,GAAG,qBAAqB,CAqB5F"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jqhtml/core",
|
|
3
|
-
"version": "2.3.
|
|
3
|
+
"version": "2.3.68",
|
|
4
4
|
"description": "Core runtime library for JQHTML",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -66,6 +66,7 @@
|
|
|
66
66
|
"playwright": "^1.53.2",
|
|
67
67
|
"rollup": "^4.49.0",
|
|
68
68
|
"rollup-plugin-dts": "^6.2.3",
|
|
69
|
+
"sass": "^1.104.0",
|
|
69
70
|
"ts-jest": "^29.1.0",
|
|
70
71
|
"tslib": "^2.8.1",
|
|
71
72
|
"typescript": "^5.9.2"
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* JQHTML v2 Template Renderer
|
|
3
|
-
*
|
|
4
|
-
* Connects compiled templates to components
|
|
5
|
-
* Processes instruction arrays and handles bindings
|
|
6
|
-
*/
|
|
7
|
-
import type { Jqhtml_Component } from './component.js';
|
|
8
|
-
/**
|
|
9
|
-
* Render a template for a component
|
|
10
|
-
* Templates are functions that return [instructions, context] tuples
|
|
11
|
-
*/
|
|
12
|
-
export declare function render_template(component: Jqhtml_Component, template_fn?: Function): Promise<void>;
|
|
13
|
-
/**
|
|
14
|
-
* Helper to escape HTML for safe output
|
|
15
|
-
*/
|
|
16
|
-
export declare function escape_html(str: string): string;
|
|
17
|
-
/**
|
|
18
|
-
* Helper to escape HTML and convert newlines to <br /> tags
|
|
19
|
-
* Used by <%br= %> syntax for displaying user-entered text with line breaks
|
|
20
|
-
*/
|
|
21
|
-
export declare function escape_html_nl2br(str: string): string;
|
|
22
|
-
//# sourceMappingURL=template-renderer.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"template-renderer.d.ts","sourceRoot":"","sources":["../src/template-renderer.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAIH,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AA2EvD;;;GAGG;AACH,wBAAsB,eAAe,CACnC,SAAS,EAAE,gBAAgB,EAC3B,WAAW,CAAC,EAAE,QAAQ,GACrB,OAAO,CAAC,IAAI,CAAC,CAqDf;AA6KD;;GAEG;AACH,wBAAgB,WAAW,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAI/C;AAED;;;GAGG;AACH,wBAAgB,iBAAiB,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAKrD"}
|