@jqhtml/core 2.3.50 → 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/dist/cache-key-serializer.d.ts +47 -0
- package/dist/cache-key-serializer.d.ts.map +1 -0
- package/dist/component-cache.d.ts +1 -0
- package/dist/component-cache.d.ts.map +1 -1
- package/dist/component-events.d.ts.map +1 -1
- package/dist/component.d.ts +18 -0
- package/dist/component.d.ts.map +1 -1
- package/dist/config.d.ts +57 -0
- package/dist/config.d.ts.map +1 -0
- package/dist/index.cjs +486 -40
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +7 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +485 -41
- package/dist/index.js.map +1 -1
- package/dist/instruction-processor.d.ts.map +1 -1
- package/dist/jqhtml-core.esm.js +486 -42
- package/dist/jqhtml-core.esm.js.map +1 -1
- package/dist/jquery-plugin.d.ts.map +1 -1
- package/dist/load-coordinator.d.ts +18 -1
- package/dist/load-coordinator.d.ts.map +1 -1
- package/dist/local-storage.d.ts +2 -0
- package/dist/local-storage.d.ts.map +1 -1
- package/dist/viewport.d.ts +36 -0
- package/dist/viewport.d.ts.map +1 -0
- package/package.json +7 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"jquery-plugin.d.ts","sourceRoot":"","sources":["../src/jquery-plugin.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAIH,OAAO,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAClD,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,yBAAyB,CAAC;
|
|
1
|
+
{"version":3,"file":"jquery-plugin.d.ts","sourceRoot":"","sources":["../src/jquery-plugin.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAIH,OAAO,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAClD,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,yBAAyB,CAAC;AASpE,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,MAAM;QACd;;WAEG;QACH,SAAS,IAAI,gBAAgB,GAAG,IAAI,CAAC;QACrC,SAAS,CAAC,cAAc,EAAE,oBAAoB,EAAE,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,gBAAgB,CAAC;QAC9F,SAAS,CAAC,aAAa,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,gBAAgB,CAAC;QAE/E;;;;;;;WAOG;QACH,WAAW,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,CAAC;KACvC;CACF;AAGD,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,GAAG,GAAG,IAAI,CAwgBpD"}
|
|
@@ -23,6 +23,23 @@ import type { Jqhtml_Component } from './component.js';
|
|
|
23
23
|
export interface InvocationKeyResult {
|
|
24
24
|
key: string | null;
|
|
25
25
|
uncacheable_property?: string;
|
|
26
|
+
/** Why the property could not be keyed - 'function', 'circular', 'too-large', ... */
|
|
27
|
+
uncacheable_reason?: string;
|
|
28
|
+
}
|
|
29
|
+
export interface InvocationKeyOptions {
|
|
30
|
+
/**
|
|
31
|
+
* Allow a plain-data object/array arg with no author-supplied cache id to be
|
|
32
|
+
* keyed by DETERMINISTIC CONTENT.
|
|
33
|
+
*
|
|
34
|
+
* The CACHE passes true: two structurally equal args should hit the same
|
|
35
|
+
* cache entry, and a wrong key there is corrected by stale-while-revalidate.
|
|
36
|
+
*
|
|
37
|
+
* DEDUPLICATION passes false (the default), deliberately. A deduplicated
|
|
38
|
+
* follower never runs on_load() at all and adopts the leader's data with no
|
|
39
|
+
* revalidation, so a key that is wrong there is permanently wrong data.
|
|
40
|
+
* Redundant concurrent requests are cheaper than that risk.
|
|
41
|
+
*/
|
|
42
|
+
allow_content_serialization?: boolean;
|
|
26
43
|
}
|
|
27
44
|
export declare class Load_Coordinator {
|
|
28
45
|
private static _registry;
|
|
@@ -40,7 +57,7 @@ export declare class Load_Coordinator {
|
|
|
40
57
|
* - key: Cache key string, or null if uncacheable
|
|
41
58
|
* - uncacheable_property: Name of first property that prevented caching (for debugging)
|
|
42
59
|
*/
|
|
43
|
-
static generate_invocation_key(component_name: string, args: any): InvocationKeyResult;
|
|
60
|
+
static generate_invocation_key(component_name: string, args: any, options?: InvocationKeyOptions): InvocationKeyResult;
|
|
44
61
|
/**
|
|
45
62
|
* Check if a component should execute on_load() or wait for existing request
|
|
46
63
|
* Returns true if component should execute (is leader), false if should wait (is follower)
|
|
@@ -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;AAavD,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;IA6FtB;;;OAGG;IACH,MAAM,CAAC,sBAAsB,CAAC,SAAS,EAAE,gBAAgB,GAAG,OAAO;IA4BnE;;;;;OAKG;IACH,MAAM,CAAC,eAAe,CAClB,SAAS,EAAE,gBAAgB,EAC3B,eAAe,EAAE,OAAO,CAAC,IAAI,CAAC,GAC/B,CAAC,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,KAAK,IAAI;IA8B5C;;;OAGG;IACH,MAAM,CAAC,wBAAwB,CAAC,SAAS,EAAE,gBAAgB,GAAG,OAAO,CAAC,IAAI,CAAC,GAAG,IAAI;IAWlF;;;;;;;;;OASG;IACH,OAAO,CAAC,MAAM,CAAC,sBAAsB;IAgCrC;;;;OAIG;IACH,MAAM,CAAC,eAAe,CAAC,SAAS,EAAE,gBAAgB,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,IAAI;IAyC/E;;;OAGG;IACH,MAAM,CAAC,mBAAmB,CAAC,SAAS,EAAE,gBAAgB,EAAE,KAAK,EAAE,KAAK,GAAG,IAAI;IAuC3E;;OAEG;IACH,MAAM,CAAC,kBAAkB,IAAI,GAAG;IAahC;;OAEG;IACH,MAAM,CAAC,SAAS,IAAI,IAAI;CAG3B"}
|
package/dist/local-storage.d.ts
CHANGED
|
@@ -94,6 +94,8 @@ export declare function is_cache_class_registered(class_name: string): boolean;
|
|
|
94
94
|
export type CacheMode = 'data' | 'html';
|
|
95
95
|
export declare class Jqhtml_Local_Storage {
|
|
96
96
|
private static _cache_key;
|
|
97
|
+
/** Versioned scope identity - compared in _validate_scope() to clear on a core upgrade. */
|
|
98
|
+
private static _scope_marker;
|
|
97
99
|
private static _cache_mode;
|
|
98
100
|
private static _storage_available;
|
|
99
101
|
private static _initialized;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"local-storage.d.ts","sourceRoot":"","sources":["../src/local-storage.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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AM,CAAC,UAAU;IAIzB;;;;OAIG;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;;;;;;;;;;;;OAYG;IACH,MAAM,CAAC,mBAAmB,CAAC,KAAK,EAAE,GAAG,GAAG,GAAG;IAiC3C;;;;;OAKG;IACH,OAAO,CAAC,MAAM,CAAC,SAAS;IA4BxB;;;;OAIG;IACH,OAAO,CAAC,MAAM,CAAC,YAAY;CAS9B"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* JQHTML Viewport Resize Dispatch
|
|
3
|
+
*
|
|
4
|
+
* One framework-owned, debounced window 'resize' listener fans out to every live
|
|
5
|
+
* component in the document by calling on_viewport_resize(viewport_width).
|
|
6
|
+
*
|
|
7
|
+
* Components never bind their own window listener, so there is nothing to unbind
|
|
8
|
+
* in on_stop() - a component that is stopped or removed from the document simply
|
|
9
|
+
* stops being found by the dispatcher.
|
|
10
|
+
*/
|
|
11
|
+
/** Trailing-edge debounce applied to the window resize listener. */
|
|
12
|
+
export declare const VIEWPORT_RESIZE_DEBOUNCE_MS = 30;
|
|
13
|
+
/**
|
|
14
|
+
* Current viewport width in CSS pixels.
|
|
15
|
+
*
|
|
16
|
+
* window.innerWidth is used (not $(window).width()) because it matches the width
|
|
17
|
+
* CSS media queries resolve against. It includes the scrollbar gutter.
|
|
18
|
+
*
|
|
19
|
+
* Returns 0 outside a browser (SSR).
|
|
20
|
+
*/
|
|
21
|
+
export declare function get_viewport_width(): number;
|
|
22
|
+
/**
|
|
23
|
+
* Call on_viewport_resize(width) on every component currently in the document.
|
|
24
|
+
*
|
|
25
|
+
* Walks $('.Component') in document order (parents before children). Elements
|
|
26
|
+
* with no component instance and stopped components are skipped. A component
|
|
27
|
+
* that throws is logged and the walk continues - one bad handler must not stop
|
|
28
|
+
* the rest of the page from resizing.
|
|
29
|
+
*/
|
|
30
|
+
export declare function dispatch_viewport_resize(jQuery: any): void;
|
|
31
|
+
/**
|
|
32
|
+
* Install the single window resize listener. Idempotent - repeated init() calls
|
|
33
|
+
* and non-browser environments are no-ops.
|
|
34
|
+
*/
|
|
35
|
+
export declare function init_viewport_resize(jQuery: any): void;
|
|
36
|
+
//# sourceMappingURL=viewport.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"viewport.d.ts","sourceRoot":"","sources":["../src/viewport.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,oEAAoE;AACpE,eAAO,MAAM,2BAA2B,KAAK,CAAC;AAK9C;;;;;;;GAOG;AACH,wBAAgB,kBAAkB,IAAI,MAAM,CAE3C;AAED;;;;;;;GAOG;AACH,wBAAgB,wBAAwB,CAAC,MAAM,EAAE,GAAG,GAAG,IAAI,CAiB1D;AAED;;;GAGG;AACH,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,GAAG,GAAG,IAAI,CAYtD"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jqhtml/core",
|
|
3
|
-
"version": "2.3.
|
|
3
|
+
"version": "2.3.54",
|
|
4
4
|
"description": "Core runtime library for JQHTML",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -23,9 +23,14 @@
|
|
|
23
23
|
"build": "rollup -c",
|
|
24
24
|
"build:tsc": "tsc",
|
|
25
25
|
"watch": "rollup -c -w",
|
|
26
|
-
"test": "jest",
|
|
26
|
+
"test": "NODE_OPTIONS=--experimental-vm-modules jest",
|
|
27
27
|
"clean": "rm -rf dist"
|
|
28
28
|
},
|
|
29
|
+
"jest": {
|
|
30
|
+
"setupFiles": [
|
|
31
|
+
"<rootDir>/test/jest.setup.js"
|
|
32
|
+
]
|
|
33
|
+
},
|
|
29
34
|
"peerDependencies": {
|
|
30
35
|
"jquery": "^3.7.0"
|
|
31
36
|
},
|