surveysparrow-ionic-plugin 2.0.3-beta.1 → 2.0.4-beta.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 (125) hide show
  1. package/dist/angular-ui/fesm2022/angular-ui.mjs +1203 -998
  2. package/dist/angular-ui/fesm2022/angular-ui.mjs.map +1 -1
  3. package/dist/angular-ui/index.d.ts +119 -5
  4. package/dist/docs.json +13 -5
  5. package/dist/esm/angular-ui/lib/public-api.js.map +1 -1
  6. package/dist/esm/angular-ui/lib/spotcheck.component.d.ts +30 -1
  7. package/dist/esm/angular-ui/lib/spotcheck.component.js +194 -4
  8. package/dist/esm/angular-ui/lib/spotcheck.component.js.map +1 -1
  9. package/dist/esm/angular-ui/lib/spotchecks/components/builder.component.d.ts +57 -0
  10. package/dist/esm/angular-ui/lib/spotchecks/components/builder.component.js +284 -0
  11. package/dist/esm/angular-ui/lib/spotchecks/components/builder.component.js.map +1 -0
  12. package/dist/esm/angular-ui/lib/spotchecks/helpers/binding.d.ts +25 -0
  13. package/dist/esm/angular-ui/lib/spotchecks/helpers/binding.js +107 -0
  14. package/dist/esm/angular-ui/lib/spotchecks/helpers/binding.js.map +1 -0
  15. package/dist/esm/angular-ui/lib/spotchecks/helpers/device.d.ts +11 -0
  16. package/dist/esm/angular-ui/lib/spotchecks/helpers/device.js +48 -0
  17. package/dist/esm/angular-ui/lib/spotchecks/helpers/device.js.map +1 -0
  18. package/dist/esm/angular-ui/lib/spotchecks/helpers/executables.d.ts +4 -0
  19. package/dist/esm/angular-ui/lib/spotchecks/helpers/executables.js +113 -0
  20. package/dist/esm/angular-ui/lib/spotchecks/helpers/executables.js.map +1 -0
  21. package/dist/esm/angular-ui/lib/spotchecks/helpers/listener.d.ts +9 -0
  22. package/dist/esm/angular-ui/lib/spotchecks/helpers/listener.js +55 -0
  23. package/dist/esm/angular-ui/lib/spotchecks/helpers/listener.js.map +1 -0
  24. package/dist/esm/angular-ui/lib/spotchecks/helpers/render.d.ts +5 -0
  25. package/dist/esm/angular-ui/lib/spotchecks/helpers/render.js +43 -0
  26. package/dist/esm/angular-ui/lib/spotchecks/helpers/render.js.map +1 -0
  27. package/dist/esm/angular-ui/lib/spotchecks/helpers/sentry.d.ts +7 -0
  28. package/dist/esm/angular-ui/lib/spotchecks/helpers/sentry.js +115 -0
  29. package/dist/esm/angular-ui/lib/spotchecks/helpers/sentry.js.map +1 -0
  30. package/dist/esm/angular-ui/lib/spotchecks/helpers/storage.d.ts +3 -0
  31. package/dist/esm/angular-ui/lib/spotchecks/helpers/storage.js +40 -0
  32. package/dist/esm/angular-ui/lib/spotchecks/helpers/storage.js.map +1 -0
  33. package/dist/esm/angular-ui/lib/spotchecks/helpers/survey-page.d.ts +22 -0
  34. package/dist/esm/angular-ui/lib/spotchecks/helpers/survey-page.js +128 -0
  35. package/dist/esm/angular-ui/lib/spotchecks/helpers/survey-page.js.map +1 -0
  36. package/dist/esm/angular-ui/lib/spotchecks/helpers/version.d.ts +2 -0
  37. package/dist/esm/angular-ui/lib/spotchecks/helpers/version.js +4 -0
  38. package/dist/esm/angular-ui/lib/spotchecks/helpers/version.js.map +1 -0
  39. package/dist/esm/angular-ui/lib/spotchecks/index.d.ts +4 -3
  40. package/dist/esm/angular-ui/lib/spotchecks/index.js +2 -2
  41. package/dist/esm/angular-ui/lib/spotchecks/index.js.map +1 -1
  42. package/dist/esm/angular-ui/lib/spotchecks/spotcheck.d.ts +8 -0
  43. package/dist/esm/angular-ui/lib/spotchecks/spotcheck.js +147 -0
  44. package/dist/esm/angular-ui/lib/spotchecks/spotcheck.js.map +1 -0
  45. package/dist/esm/angular-ui/lib/spotchecks/state/store.d.ts +14 -0
  46. package/dist/esm/angular-ui/lib/spotchecks/state/store.js +109 -0
  47. package/dist/esm/angular-ui/lib/spotchecks/state/store.js.map +1 -0
  48. package/dist/esm/angular-ui/lib/spotchecks/types.d.ts +22 -58
  49. package/dist/esm/angular-ui/lib/spotchecks/types.js.map +1 -1
  50. package/dist/plugin.cjs.js +1211 -51762
  51. package/dist/plugin.cjs.js.map +1 -1
  52. package/dist/plugin.js +1209 -51761
  53. package/dist/plugin.js.map +1 -1
  54. package/package.json +4 -8
  55. package/src/angular-ui/lib/public-api.ts +1 -1
  56. package/src/angular-ui/lib/spotcheck.component.ts +202 -5
  57. package/src/angular-ui/lib/spotchecks/components/builder.component.ts +254 -0
  58. package/src/angular-ui/lib/spotchecks/helpers/binding.ts +126 -0
  59. package/src/angular-ui/lib/spotchecks/helpers/device.ts +51 -0
  60. package/src/angular-ui/lib/spotchecks/helpers/executables.ts +124 -0
  61. package/src/angular-ui/lib/spotchecks/helpers/listener.ts +61 -0
  62. package/src/angular-ui/lib/spotchecks/helpers/render.ts +44 -0
  63. package/src/angular-ui/lib/spotchecks/helpers/sentry.ts +127 -0
  64. package/src/angular-ui/lib/spotchecks/helpers/storage.ts +37 -0
  65. package/src/angular-ui/lib/spotchecks/helpers/survey-page.ts +120 -0
  66. package/src/angular-ui/lib/spotchecks/helpers/version.ts +3 -0
  67. package/src/angular-ui/lib/spotchecks/index.ts +11 -3
  68. package/src/angular-ui/lib/spotchecks/spotcheck.ts +150 -0
  69. package/src/angular-ui/lib/spotchecks/state/store.ts +126 -0
  70. package/src/angular-ui/lib/spotchecks/types.ts +26 -59
  71. package/src/angular-ui/ng-package.json +9 -12
  72. package/src/angular-ui/package.json +9 -8
  73. package/dist/angular-ui/esm2022/angular-ui.mjs +0 -5
  74. package/dist/angular-ui/esm2022/public-api.mjs +0 -3
  75. package/dist/angular-ui/esm2022/spotcheck.component.mjs +0 -17
  76. package/dist/angular-ui/esm2022/spotchecks/SpotCheck.mjs +0 -51
  77. package/dist/angular-ui/esm2022/spotchecks/SpotCheckComponent.mjs +0 -410
  78. package/dist/angular-ui/esm2022/spotchecks/SpotCheckEventListener.mjs +0 -26
  79. package/dist/angular-ui/esm2022/spotchecks/SpotcheckStateService.mjs +0 -67
  80. package/dist/angular-ui/esm2022/spotchecks/api.mjs +0 -230
  81. package/dist/angular-ui/esm2022/spotchecks/helpers.mjs +0 -338
  82. package/dist/angular-ui/esm2022/spotchecks/index.mjs +0 -3
  83. package/dist/angular-ui/esm2022/spotchecks/storage.mjs +0 -7
  84. package/dist/angular-ui/esm2022/spotchecks/types.mjs +0 -2
  85. package/dist/angular-ui/public-api.d.ts +0 -2
  86. package/dist/angular-ui/spotcheck.component.d.ts +0 -5
  87. package/dist/angular-ui/spotchecks/SpotCheck.d.ts +0 -4
  88. package/dist/angular-ui/spotchecks/SpotCheckComponent.d.ts +0 -65
  89. package/dist/angular-ui/spotchecks/SpotCheckEventListener.d.ts +0 -16
  90. package/dist/angular-ui/spotchecks/SpotcheckStateService.d.ts +0 -12
  91. package/dist/angular-ui/spotchecks/api.d.ts +0 -15
  92. package/dist/angular-ui/spotchecks/helpers.d.ts +0 -30
  93. package/dist/angular-ui/spotchecks/index.d.ts +0 -3
  94. package/dist/angular-ui/spotchecks/storage.d.ts +0 -2
  95. package/dist/angular-ui/spotchecks/types.d.ts +0 -80
  96. package/dist/esm/angular-ui/lib/spotchecks/SpotCheck.d.ts +0 -4
  97. package/dist/esm/angular-ui/lib/spotchecks/SpotCheck.js +0 -51
  98. package/dist/esm/angular-ui/lib/spotchecks/SpotCheck.js.map +0 -1
  99. package/dist/esm/angular-ui/lib/spotchecks/SpotCheckComponent.d.ts +0 -56
  100. package/dist/esm/angular-ui/lib/spotchecks/SpotCheckComponent.js +0 -397
  101. package/dist/esm/angular-ui/lib/spotchecks/SpotCheckComponent.js.map +0 -1
  102. package/dist/esm/angular-ui/lib/spotchecks/SpotCheckEventListener.d.ts +0 -16
  103. package/dist/esm/angular-ui/lib/spotchecks/SpotCheckEventListener.js +0 -28
  104. package/dist/esm/angular-ui/lib/spotchecks/SpotCheckEventListener.js.map +0 -1
  105. package/dist/esm/angular-ui/lib/spotchecks/SpotcheckStateService.d.ts +0 -9
  106. package/dist/esm/angular-ui/lib/spotchecks/SpotcheckStateService.js +0 -72
  107. package/dist/esm/angular-ui/lib/spotchecks/SpotcheckStateService.js.map +0 -1
  108. package/dist/esm/angular-ui/lib/spotchecks/api.d.ts +0 -15
  109. package/dist/esm/angular-ui/lib/spotchecks/api.js +0 -232
  110. package/dist/esm/angular-ui/lib/spotchecks/api.js.map +0 -1
  111. package/dist/esm/angular-ui/lib/spotchecks/helpers.d.ts +0 -30
  112. package/dist/esm/angular-ui/lib/spotchecks/helpers.js +0 -304
  113. package/dist/esm/angular-ui/lib/spotchecks/helpers.js.map +0 -1
  114. package/dist/esm/angular-ui/lib/spotchecks/storage.d.ts +0 -2
  115. package/dist/esm/angular-ui/lib/spotchecks/storage.js +0 -7
  116. package/dist/esm/angular-ui/lib/spotchecks/storage.js.map +0 -1
  117. package/src/angular-ui/lib/spotchecks/SpotCheck.ts +0 -54
  118. package/src/angular-ui/lib/spotchecks/SpotCheckComponent.css +0 -7
  119. package/src/angular-ui/lib/spotchecks/SpotCheckComponent.html +0 -27
  120. package/src/angular-ui/lib/spotchecks/SpotCheckComponent.ts +0 -389
  121. package/src/angular-ui/lib/spotchecks/SpotCheckEventListener.ts +0 -50
  122. package/src/angular-ui/lib/spotchecks/SpotcheckStateService.ts +0 -66
  123. package/src/angular-ui/lib/spotchecks/api.ts +0 -286
  124. package/src/angular-ui/lib/spotchecks/helpers.ts +0 -414
  125. package/src/angular-ui/lib/spotchecks/storage.ts +0 -7
@@ -0,0 +1,109 @@
1
+ // Minimal observable store; components re-render on every change.
2
+ export class Store {
3
+ constructor(state, reducer) {
4
+ this.state = state;
5
+ this.reducer = reducer;
6
+ this.listeners = new Set();
7
+ }
8
+ getState() {
9
+ return this.state;
10
+ }
11
+ dispatch(update) {
12
+ this.state = this.reducer(this.state, update);
13
+ this.listeners.forEach((listener) => {
14
+ try {
15
+ listener();
16
+ }
17
+ catch (error) {
18
+ console.error('[SpotCheck] store listener failed', error);
19
+ }
20
+ });
21
+ }
22
+ subscribe(listener) {
23
+ this.listeners.add(listener);
24
+ return () => {
25
+ this.listeners.delete(listener);
26
+ };
27
+ }
28
+ }
29
+ // Same shape and merge rules as the other SDKs (backend functions read state.SpotCheckState).
30
+ const initialSpotcheckState = {
31
+ allSpotChecksInToken: [],
32
+ customEventsSpotChecks: [],
33
+ filteredSpotChecks: [],
34
+ showSpotCheck: false,
35
+ currentSpotcheck: {
36
+ spotcheckURL: '',
37
+ spotcheckID: 0,
38
+ spotcheckContactID: 0,
39
+ triggerToken: '',
40
+ screenName: '',
41
+ afterDelay: 0,
42
+ isChat: false,
43
+ appearance: {},
44
+ },
45
+ params: {
46
+ targetToken: '',
47
+ domainName: '',
48
+ userDetails: {},
49
+ variables: {},
50
+ customProperties: {},
51
+ visitor: {},
52
+ framework: 'ionic',
53
+ userAgent: '',
54
+ traceId: '',
55
+ },
56
+ spotCheckDetails: {
57
+ keyBoardHeight: 0,
58
+ textPosition: 0,
59
+ isMounted: false,
60
+ isVisible: false,
61
+ isExiting: false,
62
+ currentQuestionHeight: 0,
63
+ miniCardHeight: 0,
64
+ sideTabButtonWidth: 0,
65
+ isFullScreenMode: false,
66
+ spotCheckType: null,
67
+ position: 'bottom',
68
+ mode: '',
69
+ closeButton: {
70
+ isEnabled: false,
71
+ color: '#000000',
72
+ isMiniCard: false,
73
+ },
74
+ isSpotCheckButton: false,
75
+ spotCheckButtonConfig: {},
76
+ showSurveyContent: true,
77
+ avatarEnabled: false,
78
+ avatarUrl: '',
79
+ isRTLLanguage: false,
80
+ },
81
+ webViewDetails: {
82
+ isChatEnabled: false,
83
+ isClassicEnabled: false,
84
+ isClassicLoading: true,
85
+ isChatLoading: true,
86
+ chatUrl: null,
87
+ classicUrl: null,
88
+ isCurrentSpotcheckChat: null,
89
+ canShowClassic: false,
90
+ canShowChat: false,
91
+ webViewInjectionData: null,
92
+ chatWebViewRef: null,
93
+ classicWebViewRef: null,
94
+ },
95
+ };
96
+ const NESTED_KEYS = ['currentSpotcheck', 'spotCheckDetails', 'webViewDetails', 'params'];
97
+ const spotcheckReducer = (state, update) => {
98
+ const payload = update || {};
99
+ const sc = state.SpotCheckState;
100
+ const next = Object.assign(Object.assign({}, sc), payload);
101
+ NESTED_KEYS.forEach((key) => {
102
+ next[key] = Object.assign(Object.assign({}, sc[key]), (payload[key] || {}));
103
+ });
104
+ return { SpotCheckState: next };
105
+ };
106
+ export const spotcheckStore = new Store({ SpotCheckState: initialSpotcheckState }, spotcheckReducer);
107
+ export const functionStore = new Store({ functionState: { isLoaded: false } }, (state, update) => ({ functionState: Object.assign(Object.assign({}, state.functionState), (update || {})) }));
108
+ export const componentStore = new Store({ componentState: { isLoaded: false, schemas: {} } }, (state, update) => ({ componentState: Object.assign(Object.assign({}, state.componentState), (update || {})) }));
109
+ //# sourceMappingURL=store.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"store.js","sourceRoot":"","sources":["../../../../../../src/angular-ui/lib/spotchecks/state/store.ts"],"names":[],"mappings":"AAEA,kEAAkE;AAClE,MAAM,OAAO,KAAK;IAGhB,YAAoB,KAAQ,EAAU,OAAqC;QAAvD,UAAK,GAAL,KAAK,CAAG;QAAU,YAAO,GAAP,OAAO,CAA8B;QAFnE,cAAS,GAAG,IAAI,GAAG,EAAY,CAAC;IAEsC,CAAC;IAE/E,QAAQ;QACN,OAAO,IAAI,CAAC,KAAK,CAAC;IACpB,CAAC;IAED,QAAQ,CAAC,MAAW;QAClB,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC;QAC9C,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC,QAAQ,EAAE,EAAE;YAClC,IAAI,CAAC;gBACH,QAAQ,EAAE,CAAC;YACb,CAAC;YAAC,OAAO,KAAK,EAAE,CAAC;gBACf,OAAO,CAAC,KAAK,CAAC,mCAAmC,EAAE,KAAK,CAAC,CAAC;YAC5D,CAAC;QACH,CAAC,CAAC,CAAC;IACL,CAAC;IAED,SAAS,CAAC,QAAkB;QAC1B,IAAI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AE,EAAE,EACtC,CAAC,KAAK,EAAE,MAAM,EAAE,EAAE,CAAC,CAAC,EAAE,aAAa,kCAAO,KAAK,CAAC,aAAa,GAAK,CAAC,MAAM,IAAI,EAAE,CAAC,CAAE,EAAE,CAAC,CACtF,CAAC;AAEF,MAAM,CAAC,MAAM,cAAc,GAAG,IAAI,KAAK,CACrC,EAAE,cAAc,EAAE,EAAE,QAAQ,EAAE,KAAK,EAAE,OAAO,EAAE,EAAE,EAAE,EAAE,EACpD,CAAC,KAAK,EAAE,MAAM,EAAE,EAAE,CAAC,CAAC,EAAE,cAAc,kCAAO,KAAK,CAAC,cAAc,GAAK,CAAC,MAAM,IAAI,EAAE,CAAC,CAAE,EAAE,CAAC,CACxF,CAAC","sourcesContent":["type Listener = () => void;\n\n// Minimal observable store; components re-render on every change.\nexport class Store<T> {\n private listeners = new Set<Listener>();\n\n constructor(private state: T, private reducer: (state: T, update: any) => T) {}\n\n getState(): T {\n return this.state;\n }\n\n dispatch(update: any): void {\n this.state = this.reducer(this.state, update);\n this.listeners.forEach((listener) => {\n try {\n listener();\n } catch (error) {\n console.error('[SpotCheck] store listener failed', error);\n }\n });\n }\n\n subscribe(listener: Listener): () => void {\n this.listeners.add(listener);\n return () => {\n this.listeners.delete(listener);\n };\n }\n}\n\n// Same shape and merge rules as the other SDKs (backend functions read state.SpotCheckState).\nconst initialSpotcheckState: any = {\n allSpotChecksInToken: [],\n customEventsSpotChecks: [],\n filteredSpotChecks: [],\n showSpotCheck: false,\n\n currentSpotcheck: {\n spotcheckURL: '',\n spotcheckID: 0,\n spotcheckContactID: 0,\n triggerToken: '',\n screenName: '',\n afterDelay: 0,\n isChat: false,\n appearance: {},\n },\n\n params: {\n targetToken: '',\n domainName: '',\n userDetails: {},\n variables: {},\n customProperties: {},\n visitor: {},\n framework: 'ionic',\n userAgent: '',\n traceId: '',\n },\n\n spotCheckDetails: {\n keyBoardHeight: 0,\n textPosition: 0,\n isMounted: false,\n isVisible: false,\n isExiting: false,\n currentQuestionHeight: 0,\n miniCardHeight: 0,\n sideTabButtonWidth: 0,\n isFullScreenMode: false,\n spotCheckType: null,\n position: 'bottom',\n mode: '',\n closeButton: {\n isEnabled: false,\n color: '#000000',\n isMiniCard: false,\n },\n isSpotCheckButton: false,\n spotCheckButtonConfig: {},\n showSurveyContent: true,\n avatarEnabled: false,\n avatarUrl: '',\n isRTLLanguage: false,\n },\n\n webViewDetails: {\n isChatEnabled: false,\n isClassicEnabled: false,\n isClassicLoading: true,\n isChatLoading: true,\n chatUrl: null,\n classicUrl: null,\n isCurrentSpotcheckChat: null,\n canShowClassic: false,\n canShowChat: false,\n webViewInjectionData: null,\n chatWebViewRef: null,\n classicWebViewRef: null,\n },\n};\n\nconst NESTED_KEYS = ['currentSpotcheck', 'spotCheckDetails', 'webViewDetails', 'params'];\n\nconst spotcheckReducer = (state: any, update: any) => {\n const payload = update || {};\n const sc = state.SpotCheckState;\n const next: any = { ...sc, ...payload };\n NESTED_KEYS.forEach((key) => {\n next[key] = { ...sc[key], ...(payload[key] || {}) };\n });\n return { SpotCheckState: next };\n};\n\nexport const spotcheckStore = new Store<any>({ SpotCheckState: initialSpotcheckState }, spotcheckReducer);\n\nexport const functionStore = new Store<any>(\n { functionState: { isLoaded: false } },\n (state, update) => ({ functionState: { ...state.functionState, ...(update || {}) } }),\n);\n\nexport const componentStore = new Store<any>(\n { componentState: { isLoaded: false, schemas: {} } },\n (state, update) => ({ componentState: { ...state.componentState, ...(update || {}) } }),\n);\n"]}
@@ -1,44 +1,8 @@
1
- export interface SpotcheckState {
2
- isVisible: boolean;
3
- spotcheckPosition: string;
4
- spotcheckURL: string;
5
- spotcheckID: number;
6
- spotcheckContactID: number;
7
- afterDelay: number;
8
- maxHeight: number;
9
- currentQuestionHeight: number;
10
- isFullScreenMode: boolean;
11
- isBannerImageOn: boolean;
12
- triggerToken: string;
13
- closeButtonStyle: Record<string, string>;
14
- isCloseButtonEnabled: boolean;
15
- isSpotPassed: boolean;
16
- isChecksPassed: boolean;
17
- customEventsSpotChecks: Record<string, any>[];
18
- targetToken: string;
19
- domainName: string;
20
- userDetails: UserDetails;
21
- variables: Variables;
22
- customProperties: CustomProperties;
23
- traceId: string;
24
- isClassicLoading: boolean;
25
- isChatLoading: boolean;
26
- isClassicLoadEventReceived: boolean;
27
- isChatLoadEventReceived: boolean;
28
- classicUrl: string;
29
- chatUrl: string;
30
- classicWebViewRef: any | null;
31
- chatWebViewRef: any | null;
32
- filteredSpotChecks: Record<string, any>[];
33
- spotCheckType: String;
34
- isMounted: boolean;
35
- textPosition: number;
36
- screenHeight: number;
37
- keyBoardHeight: number;
38
- spotChecksMode: string;
39
- avatarEnabled: boolean;
40
- avatarUrl: string;
41
- screenwiseUserDetails: Record<string, UserDetails | undefined>;
1
+ export interface SsSpotcheckListener {
2
+ onSurveyLoaded?: (response: Record<string, any>) => void | Promise<void>;
3
+ onSurveyResponse?: (response: Record<string, any>) => void | Promise<void>;
4
+ onPartialSubmission?: (response: Record<string, any>) => void | Promise<void>;
5
+ onCloseButtonTap?: () => void | Promise<void>;
42
6
  }
43
7
  export interface UserDetails {
44
8
  uuid?: string;
@@ -55,26 +19,26 @@ export interface Variables {
55
19
  export interface CustomProperties {
56
20
  [key: string]: any;
57
21
  }
58
- export interface TrackScreenProps {
59
- screen: string;
60
- options?: {
61
- variables?: Variables;
62
- customProperties?: CustomProperties;
63
- userDetails?: UserDetails;
64
- };
65
- }
66
- export interface TrackEventProps {
67
- screen: string;
68
- event: {
69
- [key: string]: {
70
- [key: string]: string;
71
- };
72
- };
73
- }
74
- export interface InitializeSpotChecksProps {
22
+ export interface SpotcheckProps {
75
23
  domainName: string;
76
24
  targetToken: string;
77
25
  userDetails?: UserDetails;
78
26
  variables?: Variables;
79
27
  customProperties?: CustomProperties;
28
+ listener?: SsSpotcheckListener;
29
+ }
30
+ export type InitializeSpotChecksProps = SpotcheckProps;
31
+ export interface TrackScreenOptions {
32
+ variables?: Variables;
33
+ customProperties?: CustomProperties;
34
+ userDetails?: UserDetails;
35
+ }
36
+ export interface TrackScreenProps {
37
+ screen: string;
38
+ options?: TrackScreenOptions;
39
+ }
40
+ export interface TrackEventProps {
41
+ screen: string;
42
+ event: Record<string, any>;
43
+ options?: TrackScreenOptions;
80
44
  }
@@ -1 +1 @@
1
- {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../../src/angular-ui/lib/spotchecks/types.ts"],"names":[],"mappings":"","sourcesContent":["export interface SpotcheckState {\n isVisible: boolean;\n spotcheckPosition: string;\n spotcheckURL: string;\n spotcheckID: number;\n spotcheckContactID: number;\n afterDelay: number;\n maxHeight: number;\n currentQuestionHeight: number;\n isFullScreenMode: boolean;\n isBannerImageOn: boolean;\n triggerToken: string;\n closeButtonStyle: Record<string, string>;\n isCloseButtonEnabled: boolean;\n isSpotPassed: boolean;\n isChecksPassed: boolean;\n customEventsSpotChecks: Record<string, any>[];\n targetToken: string;\n domainName: string;\n userDetails: UserDetails;\n variables: Variables;\n customProperties: CustomProperties;\n traceId: string;\n isClassicLoading: boolean;\n isChatLoading: boolean;\n isClassicLoadEventReceived: boolean;\n isChatLoadEventReceived: boolean;\n classicUrl: string;\n chatUrl: string;\n classicWebViewRef: any | null;\n chatWebViewRef: any | null;\n filteredSpotChecks: Record<string, any>[];\n spotCheckType: String;\n isMounted: boolean;\n textPosition: number;\n screenHeight: number;\n keyBoardHeight: number;\n spotChecksMode: string;\n avatarEnabled: boolean;\n avatarUrl: string;\n screenwiseUserDetails: Record<string, UserDetails | undefined>;\n}\n\nexport interface UserDetails {\n uuid?: string;\n email?: string;\n firstName?: string;\n lastName?: string;\n mobile?: number;\n [key: string]: any;\n}\n\nexport interface Variables {\n sparrowLang?: string;\n [key: string]: any;\n}\n\nexport interface CustomProperties {\n [key: string]: any;\n}\n\nexport interface TrackScreenProps {\n screen: string;\n options?: {\n variables?: Variables;\n customProperties?: CustomProperties;\n userDetails?: UserDetails;\n };\n}\n\nexport interface TrackEventProps {\n screen: string;\n event: {\n [key: string]: {\n [key: string]: string;\n };\n };\n}\n\nexport interface InitializeSpotChecksProps {\n domainName: string;\n targetToken: string;\n userDetails?: UserDetails;\n variables?: Variables;\n customProperties?: CustomProperties;\n}\n"]}
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../../src/angular-ui/lib/spotchecks/types.ts"],"names":[],"mappings":"","sourcesContent":["export interface SsSpotcheckListener {\n onSurveyLoaded?: (response: Record<string, any>) => void | Promise<void>;\n onSurveyResponse?: (response: Record<string, any>) => void | Promise<void>;\n onPartialSubmission?: (response: Record<string, any>) => void | Promise<void>;\n onCloseButtonTap?: () => void | Promise<void>;\n}\n\nexport interface UserDetails {\n uuid?: string;\n email?: string;\n firstName?: string;\n lastName?: string;\n mobile?: number;\n [key: string]: any;\n}\n\nexport interface Variables {\n sparrowLang?: string;\n [key: string]: any;\n}\n\nexport interface CustomProperties {\n [key: string]: any;\n}\n\nexport interface SpotcheckProps {\n domainName: string;\n targetToken: string;\n userDetails?: UserDetails;\n variables?: Variables;\n customProperties?: CustomProperties;\n listener?: SsSpotcheckListener;\n}\n\n// Legacy name for the init options.\nexport type InitializeSpotChecksProps = SpotcheckProps;\n\nexport interface TrackScreenOptions {\n variables?: Variables;\n customProperties?: CustomProperties;\n userDetails?: UserDetails;\n}\n\nexport interface TrackScreenProps {\n screen: string;\n options?: TrackScreenOptions;\n}\n\nexport interface TrackEventProps {\n screen: string;\n event: Record<string, any>;\n options?: TrackScreenOptions;\n}\n"]}