@kapaai/support-form-deflector 0.9.7 → 0.9.9
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/kapa-support-form-deflector.bundle.js +1 -1
- package/dist/src/state.d.ts.map +1 -1
- package/dist/src/utils/cached-deflector-state.d.ts +31 -36
- package/dist/src/utils/cached-deflector-state.d.ts.map +1 -1
- package/dist/src/utils/toggle-button-disabled.d.ts.map +1 -1
- package/package.json +3 -3
package/dist/src/state.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"state.d.ts","sourceRoot":"","sources":["../../src/state.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"state.d.ts","sourceRoot":"","sources":["../../src/state.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAkB/B,MAAM,MAAM,cAAc,GACtB,SAAS,GACT,gBAAgB,GAChB,OAAO,GACP,eAAe,GACf,WAAW,GACX,SAAS,GACT,SAAS,CAAC;AACd,KAAK,WAAW,GAAG;IACjB,KAAK,EAAE,cAAc,CAAC;IACtB,eAAe,CAAC,EAAE,eAAe,CAAC;IAClC,MAAM,CAAC,EAAE;QACP,MAAM,EAAE,MAAM,CAAC;QACf,SAAS,EAAE,MAAM,CAAC;KACnB,CAAC;CACH,CAAC;AAQF,KAAK,YAAY,GAAG;IAClB,IAAI,EACA,SAAS,GACT,gBAAgB,GAChB,SAAS,GACT,OAAO,GACP,WAAW,GACX,SAAS,CAAC;IACd,IAAI,EAAE,GAAG,CAAC;CACX,CAAC;AAkEF,eAAO,MAAM,iBAAiB,EAAE,KAAK,CAAC,EAAE,CAAC;IACvC,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;CAC3B,CA2mBA,CAAC;AAEF,eAAO,MAAM,YAAY;WAxnBZ,WAAW;cACR,MAAM,QAAQ,CAAC,YAAY,CAAC;CA6nB3C,CAAC"}
|
|
@@ -1,38 +1,33 @@
|
|
|
1
1
|
import { Logger } from "./logger";
|
|
2
|
-
export declare
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
*
|
|
34
|
-
* @returns {boolean} - Whether the cached deflector state was used.
|
|
35
|
-
*/
|
|
36
|
-
export declare function shouldUseCachedDeflectorState({ query, logger, toggleDeflectionStatus, }: CachedDeflectorStateProps): boolean;
|
|
37
|
-
export {};
|
|
2
|
+
export declare class QueryCache {
|
|
3
|
+
private key;
|
|
4
|
+
private logger;
|
|
5
|
+
private toggleDeflectionStatus;
|
|
6
|
+
private readonly TIME_WINDOW;
|
|
7
|
+
/**
|
|
8
|
+
* Creates an instance of QueryCache.
|
|
9
|
+
* @param {Object} params - The parameters for the cache.
|
|
10
|
+
* @param {string} params.key - The local storage key.
|
|
11
|
+
* @param {Logger} params.logger - The logger instance.
|
|
12
|
+
* @param {Function} params.toggleDeflectionStatus - Function to toggle the deflection status.
|
|
13
|
+
*/
|
|
14
|
+
constructor({ key, logger, toggleDeflectionStatus, }: {
|
|
15
|
+
key: string;
|
|
16
|
+
logger: Logger;
|
|
17
|
+
toggleDeflectionStatus: (threadId: string, isDeflected: boolean) => void;
|
|
18
|
+
});
|
|
19
|
+
/**
|
|
20
|
+
* Stores the deflector state in local storage.
|
|
21
|
+
* @param {Object} params - The parameters for storing state.
|
|
22
|
+
* @param {string} params.threadId - The thread ID to be stored.
|
|
23
|
+
*/
|
|
24
|
+
storeDeflectorState({ threadId }: {
|
|
25
|
+
threadId: string;
|
|
26
|
+
}): void;
|
|
27
|
+
/**
|
|
28
|
+
* Checks if the cached deflector state should be used.
|
|
29
|
+
* @returns {boolean} - Whether the cached state is valid and should be used.
|
|
30
|
+
*/
|
|
31
|
+
shouldUseCachedDeflectorState(): boolean;
|
|
32
|
+
}
|
|
38
33
|
//# sourceMappingURL=cached-deflector-state.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cached-deflector-state.d.ts","sourceRoot":"","sources":["../../../src/utils/cached-deflector-state.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAElC,
|
|
1
|
+
{"version":3,"file":"cached-deflector-state.d.ts","sourceRoot":"","sources":["../../../src/utils/cached-deflector-state.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAElC,qBAAa,UAAU;IACrB,OAAO,CAAC,GAAG,CAAS;IACpB,OAAO,CAAC,MAAM,CAAS;IACvB,OAAO,CAAC,sBAAsB,CAGpB;IACV,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAyB;IAErD;;;;;;OAMG;gBACS,EACV,GAAG,EACH,MAAM,EACN,sBAAsB,GACvB,EAAE;QACD,GAAG,EAAE,MAAM,CAAC;QACZ,MAAM,EAAE,MAAM,CAAC;QACf,sBAAsB,EAAE,CAAC,QAAQ,EAAE,MAAM,EAAE,WAAW,EAAE,OAAO,KAAK,IAAI,CAAC;KAC1E;IAMD;;;;OAIG;IACH,mBAAmB,CAAC,EAAE,QAAQ,EAAE,EAAE;QAAE,QAAQ,EAAE,MAAM,CAAA;KAAE,GAAG,IAAI;IAW7D;;;OAGG;IACH,6BAA6B,IAAI,OAAO;CAgCzC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"toggle-button-disabled.d.ts","sourceRoot":"","sources":["../../../src/utils/toggle-button-disabled.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,oBAAoB,aACrB,MAAM,GAAG,SAAS,YAClB,OAAO,
|
|
1
|
+
{"version":3,"file":"toggle-button-disabled.d.ts","sourceRoot":"","sources":["../../../src/utils/toggle-button-disabled.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,oBAAoB,aACrB,MAAM,GAAG,SAAS,YAClB,OAAO,SAgClB,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kapaai/support-form-deflector",
|
|
3
|
-
"version": "0.9.
|
|
3
|
+
"version": "0.9.9",
|
|
4
4
|
"main": "./dist/index.js",
|
|
5
5
|
"module": "./dist/esm/index.js",
|
|
6
6
|
"types": "./dist/esm/index.d.ts",
|
|
@@ -76,8 +76,8 @@
|
|
|
76
76
|
"@types/react-syntax-highlighter": "^15.5.6",
|
|
77
77
|
"@types/turndown": "^5.0.5",
|
|
78
78
|
"html-webpack-plugin": "^5.5.0",
|
|
79
|
-
"
|
|
80
|
-
"vitest": "^
|
|
79
|
+
"jsdom": "^26.0.0",
|
|
80
|
+
"vitest": "^3.0.5",
|
|
81
81
|
"web-vitals": "^2.1.4",
|
|
82
82
|
"webpack": "^5.79.0",
|
|
83
83
|
"webpack-cli": "^5.0.1",
|