@kapaai/support-form-deflector 0.1.10 → 0.2.1

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.
Files changed (33) hide show
  1. package/dist/answer/answer-renderer.d.ts +6 -0
  2. package/dist/answer/answer-renderer.d.ts.map +1 -0
  3. package/dist/answer/error-indicator.d.ts +3 -0
  4. package/dist/answer/error-indicator.d.ts.map +1 -0
  5. package/dist/answer/index.d.ts +3 -0
  6. package/dist/answer/index.d.ts.map +1 -0
  7. package/dist/answer/info-texts.d.ts +4 -0
  8. package/dist/answer/info-texts.d.ts.map +1 -0
  9. package/dist/answer/loading-indicator.d.ts +3 -0
  10. package/dist/answer/loading-indicator.d.ts.map +1 -0
  11. package/dist/answer/use-submit-button-text-override.d.ts +8 -0
  12. package/dist/answer/use-submit-button-text-override.d.ts.map +1 -0
  13. package/dist/config-provider.d.ts +33 -0
  14. package/dist/config-provider.d.ts.map +1 -0
  15. package/dist/icons/sparkles.d.ts +3 -0
  16. package/dist/icons/sparkles.d.ts.map +1 -0
  17. package/dist/icons/types.d.ts +9 -0
  18. package/dist/icons/types.d.ts.map +1 -0
  19. package/dist/index.d.ts +6 -2
  20. package/dist/index.d.ts.map +1 -1
  21. package/dist/index.html +1 -1
  22. package/dist/kapa-support-form-deflector.bundle.js +2 -0
  23. package/dist/kapa-support-form-deflector.bundle.js.LICENSE.txt +61 -0
  24. package/dist/state.d.ts +19 -0
  25. package/dist/state.d.ts.map +1 -0
  26. package/dist/utils/errors.d.ts +7 -0
  27. package/dist/utils/errors.d.ts.map +1 -0
  28. package/dist/utils/wait-for-elements.d.ts +24 -0
  29. package/dist/utils/wait-for-elements.d.ts.map +1 -0
  30. package/package.json +2 -3
  31. package/dist/__tests__/example.test.d.ts +0 -2
  32. package/dist/__tests__/example.test.d.ts.map +0 -1
  33. package/dist/kapa-deflector.bundle.js +0 -1
@@ -0,0 +1,6 @@
1
+ type Props = {
2
+ answer: string;
3
+ };
4
+ declare const AnswerRenderer: ({ answer }: Props) => import("react/jsx-runtime").JSX.Element;
5
+ export default AnswerRenderer;
6
+ //# sourceMappingURL=answer-renderer.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"answer-renderer.d.ts","sourceRoot":"","sources":["../../src/answer/answer-renderer.tsx"],"names":[],"mappings":"AAKA,KAAK,KAAK,GAAG;IACX,MAAM,EAAE,MAAM,CAAC;CAChB,CAAC;AAyBF,QAAA,MAAM,cAAc,eAAgB,KAAK,4CA2CxC,CAAC;AAEF,eAAe,cAAc,CAAC"}
@@ -0,0 +1,3 @@
1
+ declare const ErrorIndicator: () => import("react/jsx-runtime").JSX.Element;
2
+ export default ErrorIndicator;
3
+ //# sourceMappingURL=error-indicator.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"error-indicator.d.ts","sourceRoot":"","sources":["../../src/answer/error-indicator.tsx"],"names":[],"mappings":"AAGA,QAAA,MAAM,cAAc,+CAsBnB,CAAC;AAEF,eAAe,cAAc,CAAC"}
@@ -0,0 +1,3 @@
1
+ declare const AnswerWrapper: () => import("react/jsx-runtime").JSX.Element;
2
+ export default AnswerWrapper;
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/answer/index.tsx"],"names":[],"mappings":"AA4BA,QAAA,MAAM,aAAa,+CAiElB,CAAC;AAEF,eAAe,aAAa,CAAC"}
@@ -0,0 +1,4 @@
1
+ export declare const PreSubmitInfo: () => import("react/jsx-runtime").JSX.Element | null;
2
+ export declare const LoadingInfo: () => import("react/jsx-runtime").JSX.Element | null;
3
+ export declare const PostSubmitInfo: () => import("react/jsx-runtime").JSX.Element | null;
4
+ //# sourceMappingURL=info-texts.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"info-texts.d.ts","sourceRoot":"","sources":["../../src/answer/info-texts.tsx"],"names":[],"mappings":"AAGA,eAAO,MAAM,aAAa,sDAUzB,CAAC;AAEF,eAAO,MAAM,WAAW,sDAYvB,CAAC;AAEF,eAAO,MAAM,cAAc,sDAU1B,CAAC"}
@@ -0,0 +1,3 @@
1
+ declare const LoadingIndicator: () => import("react/jsx-runtime").JSX.Element;
2
+ export default LoadingIndicator;
3
+ //# sourceMappingURL=loading-indicator.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"loading-indicator.d.ts","sourceRoot":"","sources":["../../src/answer/loading-indicator.tsx"],"names":[],"mappings":"AA+EA,QAAA,MAAM,gBAAgB,+CAkErB,CAAC;AAEF,eAAe,gBAAgB,CAAC"}
@@ -0,0 +1,8 @@
1
+ /**
2
+ * This hook overwrites the default submit button text if the
3
+ * submitButtonTextQuerySelector and submitButtonTextOverride
4
+ * config options have been set. It resets the button text to
5
+ * the original text once the deflector has been triggered.
6
+ */
7
+ export declare const useSubmitButtonTextOverride: () => void;
8
+ //# sourceMappingURL=use-submit-button-text-override.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"use-submit-button-text-override.d.ts","sourceRoot":"","sources":["../../src/answer/use-submit-button-text-override.tsx"],"names":[],"mappings":"AAIA;;;;;GAKG;AACH,eAAO,MAAM,2BAA2B,YA2CvC,CAAC"}
@@ -0,0 +1,33 @@
1
+ import * as React from "react";
2
+ type Styles = {
3
+ backgroundColor: string;
4
+ textColor: string;
5
+ borderRadius?: number;
6
+ border?: string;
7
+ answerBoxTitle: string;
8
+ loadingTexts?: string[];
9
+ loadingInfoText: string;
10
+ postSubmitInfoText?: string;
11
+ preSubmitInfoText?: string;
12
+ };
13
+ type DeflectorConfig = {
14
+ mainInputQuerySelector: string;
15
+ extraInputQuerySelectors: string[];
16
+ integrationId: string;
17
+ submitElementQuerySelector: string;
18
+ submitElementEventType: "onSubmit" | "onClick";
19
+ runsOriginalEventAutomatically?: boolean;
20
+ submitButtonTextQuerySelector?: string;
21
+ submitButtonTextOverride?: string;
22
+ };
23
+ export declare const ConfigProvider: React.FC<{
24
+ children: React.ReactNode;
25
+ styles: Styles;
26
+ config: DeflectorConfig;
27
+ }>;
28
+ export declare const useConfig: () => {
29
+ styles: Styles;
30
+ config: DeflectorConfig;
31
+ };
32
+ export {};
33
+ //# sourceMappingURL=config-provider.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"config-provider.d.ts","sourceRoot":"","sources":["../src/config-provider.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,KAAK,MAAM,GAAG;IAEZ,eAAe,EAAE,MAAM,CAAC;IACxB,SAAS,EAAE,MAAM,CAAC;IAClB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,MAAM,CAAC,EAAE,MAAM,CAAC;IAEhB,cAAc,EAAE,MAAM,CAAC;IACvB,YAAY,CAAC,EAAE,MAAM,EAAE,CAAC;IACxB,eAAe,EAAE,MAAM,CAAC;IACxB,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,iBAAiB,CAAC,EAAE,MAAM,CAAC;CAC5B,CAAC;AAEF,KAAK,eAAe,GAAG;IACrB,sBAAsB,EAAE,MAAM,CAAC;IAC/B,wBAAwB,EAAE,MAAM,EAAE,CAAC;IACnC,aAAa,EAAE,MAAM,CAAC;IACtB,0BAA0B,EAAE,MAAM,CAAC;IACnC,sBAAsB,EAAE,UAAU,GAAG,SAAS,CAAC;IAC/C,8BAA8B,CAAC,EAAE,OAAO,CAAC;IACzC,6BAA6B,CAAC,EAAE,MAAM,CAAC;IACvC,wBAAwB,CAAC,EAAE,MAAM,CAAC;CACnC,CAAC;AAWF,eAAO,MAAM,cAAc,EAAE,KAAK,CAAC,EAAE,CAAC;IACpC,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,eAAe,CAAC;CACzB,CAIA,CAAC;AAEF,eAAO,MAAM,SAAS;YAjBR,MAAM;YACN,eAAe;CAsB5B,CAAC"}
@@ -0,0 +1,3 @@
1
+ import { IconProps } from "./types";
2
+ export declare const IconSparkles: ({ color, height, width, viewbox, fill, stroke, }: IconProps) => import("react/jsx-runtime").JSX.Element;
3
+ //# sourceMappingURL=sparkles.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sparkles.d.ts","sourceRoot":"","sources":["../../src/icons/sparkles.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAEpC,eAAO,MAAM,YAAY,qDAOtB,SAAS,4CAiBX,CAAC"}
@@ -0,0 +1,9 @@
1
+ export interface IconProps {
2
+ height?: number;
3
+ width?: number;
4
+ viewbox?: string;
5
+ color?: string;
6
+ fill?: string;
7
+ stroke?: string;
8
+ }
9
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/icons/types.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,SAAS;IACxB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB"}
package/dist/index.d.ts CHANGED
@@ -1,3 +1,7 @@
1
- export declare const dummy = 1;
2
- export declare const getFaviconUrlExample: (url: string) => string;
1
+ export declare const matchesDeflectorScript: (script: HTMLScriptElement) => boolean;
2
+ declare global {
3
+ interface Window {
4
+ _KAPA_SFD_RENDERED?: boolean;
5
+ }
6
+ }
3
7
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.tsx"],"names":[],"mappings":"AAAA,eAAO,MAAM,KAAK,IAAI,CAAC;AAIvB,eAAO,MAAM,oBAAoB,QAAS,MAAM,WAE/C,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.tsx"],"names":[],"mappings":"AAQA,eAAO,MAAM,sBAAsB,WAAY,iBAAiB,KAAG,OAIlE,CAAC;AACF,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,MAAM;QACd,kBAAkB,CAAC,EAAE,OAAO,CAAC;KAC9B;CACF"}
package/dist/index.html CHANGED
@@ -1 +1 @@
1
- <!doctype html><html lang="en"><head><meta charset="utf-8"/><link rel="icon" href="%PUBLIC_URL%/favicon.ico"/><meta name="viewport" content="width=device-width,initial-scale=1"/><meta name="theme-color" content="#000000"/><meta name="description" content="Web site created using create-react-app"/><link rel="apple-touch-icon" href="%PUBLIC_URL%/logo192.png"/><link rel="manifest" href="%PUBLIC_URL%/manifest.json"/><title>React App</title><script defer="defer" src="kapa-deflector.bundle.js"></script></head><body><noscript>You need to enable JavaScript to run this app.</noscript><div id="root"></div></body></html>
1
+ <!doctype html><html lang="en"><head><meta charset="utf-8"/><link rel="icon" href="%PUBLIC_URL%/favicon.ico"/><meta name="viewport" content="width=device-width,initial-scale=1"/><meta name="theme-color" content="#000000"/><meta name="description" content="Web site created using create-react-app"/><link rel="apple-touch-icon" href="%PUBLIC_URL%/logo192.png"/><link rel="manifest" href="%PUBLIC_URL%/manifest.json"/><title>React App</title><script defer="defer" src="kapa-support-form-deflector.bundle.js"></script></head><body><noscript>You need to enable JavaScript to run this app.</noscript><div id="root"></div></body></html>