surveysparrow-ionic-plugin 1.0.7-beta.19 → 1.0.7-beta.21
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/angular-ui/esm2022/spotchecks/SpotCheckComponent.mjs +13 -8
- package/dist/angular-ui/esm2022/spotchecks/helpers.mjs +6 -5
- package/dist/angular-ui/fesm2022/angular-ui.mjs +17 -11
- package/dist/angular-ui/fesm2022/angular-ui.mjs.map +1 -1
- package/dist/angular-ui/spotchecks/SpotCheckComponent.d.ts +2 -1
- package/dist/angular-ui/spotchecks/helpers.d.ts +1 -2
- package/dist/esm/angular-ui/lib/spotchecks/SpotCheckComponent.d.ts +1 -0
- package/dist/esm/angular-ui/lib/spotchecks/SpotCheckComponent.js +9 -2
- package/dist/esm/angular-ui/lib/spotchecks/SpotCheckComponent.js.map +1 -1
- package/dist/esm/angular-ui/lib/spotchecks/helpers.d.ts +1 -2
- package/dist/esm/angular-ui/lib/spotchecks/helpers.js +6 -4
- package/dist/esm/angular-ui/lib/spotchecks/helpers.js.map +1 -1
- package/dist/plugin.cjs.js +15 -6
- package/dist/plugin.cjs.js.map +1 -1
- package/dist/plugin.js +15 -6
- package/dist/plugin.js.map +1 -1
- package/package.json +1 -1
- package/src/angular-ui/lib/spotchecks/SpotCheckComponent.css +7 -0
- package/src/angular-ui/lib/spotchecks/SpotCheckComponent.html +3 -1
- package/src/angular-ui/lib/spotchecks/SpotCheckComponent.ts +5 -2
- package/src/angular-ui/lib/spotchecks/helpers.ts +5 -4
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "surveysparrow-ionic-plugin",
|
|
3
|
-
"version": "1.0.7-beta.
|
|
3
|
+
"version": "1.0.7-beta.21",
|
|
4
4
|
"description": "SurveySparrow SDK enables you to collect feedback from your mobile app. Embed the Classic, Chat & NPS surveys in your ionic application seamlessly with few lines of code.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/plugin.cjs.js",
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
<div [ngStyle]="componentStyles.wrapperStyles">
|
|
1
|
+
<div [ngStyle]="componentStyles.wrapperStyles" class="safe-area">
|
|
2
2
|
<div [ngStyle]="componentStyles.styles">
|
|
3
3
|
<div style="position: relative; height: 100%;">
|
|
4
4
|
<spotcheck-close-button />
|
|
@@ -7,12 +7,14 @@
|
|
|
7
7
|
*ngIf="state.classicUrl && state.classicUrl.length > 0 && state.spotcheckURL.length > 0 && state.spotCheckType === 'classic'"
|
|
8
8
|
[url]="state.classicUrl"
|
|
9
9
|
[webviewType]="'classic'"
|
|
10
|
+
[isMiniCard]="state.spotChecksMode === 'miniCard'"
|
|
10
11
|
/>
|
|
11
12
|
|
|
12
13
|
<WebViewComponent
|
|
13
14
|
*ngIf="state.chatUrl && state.chatUrl.length > 0 && state.spotcheckURL.length > 0 && state.spotCheckType === 'chat'"
|
|
14
15
|
[url]="state.chatUrl"
|
|
15
16
|
[webviewType]="'chat'"
|
|
17
|
+
[isMiniCard]="state.spotChecksMode === 'miniCard'"
|
|
16
18
|
/>
|
|
17
19
|
|
|
18
20
|
<div *ngIf="state.spotChecksMode === 'miniCard' && state.avatarEnabled">
|
|
@@ -20,11 +20,12 @@ import axios from 'axios';
|
|
|
20
20
|
@Component({
|
|
21
21
|
selector: 'WebViewComponent',
|
|
22
22
|
template: `
|
|
23
|
-
<div style="overflow: hidden; height: 100%;">
|
|
23
|
+
<div style="overflow: hidden; height: 100%; border-radius: {{isMiniCard ? 12 : 0}}px; padding-left: {{isMiniCard ? 12 : 0}}px; padding-right: {{isMiniCard ? 12 : 0}}px; box-sizing: border-box;">
|
|
24
24
|
<iframe
|
|
25
|
+
allow="camera; microphone; geolocation; display-capture; autoplay; clipboard-read; clipboard-write;"
|
|
25
26
|
#iframeRef
|
|
26
27
|
[src]="safeUrl"
|
|
27
|
-
style="width: 100%; height: 100%; display: block;"
|
|
28
|
+
style="width: 100%; height: 100%; display: block; border-radius: {{isMiniCard ? 12 : 0}}px;"
|
|
28
29
|
frameborder="0"
|
|
29
30
|
>
|
|
30
31
|
</iframe>
|
|
@@ -36,6 +37,7 @@ import axios from 'axios';
|
|
|
36
37
|
export class WebViewComponent implements OnInit, AfterViewInit {
|
|
37
38
|
@Input() url: string = '';
|
|
38
39
|
@Input() webviewType: 'classic' | 'chat' = 'classic';
|
|
40
|
+
@Input() isMiniCard: boolean = false;
|
|
39
41
|
|
|
40
42
|
safeUrl: SafeResourceUrl | null = null;
|
|
41
43
|
@ViewChild('iframeRef') iframe!: ElementRef<HTMLIFrameElement>;
|
|
@@ -210,6 +212,7 @@ export class CloseButtonComponent implements OnDestroy {
|
|
|
210
212
|
@Component({
|
|
211
213
|
selector: 'SpotCheckComponent',
|
|
212
214
|
templateUrl: './SpotCheckComponent.html',
|
|
215
|
+
styleUrls: ['./SpotCheckComponent.css'],
|
|
213
216
|
standalone: true,
|
|
214
217
|
imports: [CommonModule, WebViewComponent, CloseButtonComponent],
|
|
215
218
|
})
|
|
@@ -307,7 +307,7 @@ export const handleSurveyEnd = () => {
|
|
|
307
307
|
export const getSpotcheckComponentCssStyles = (state: SpotcheckState) => {
|
|
308
308
|
let styles = {}
|
|
309
309
|
let wrapperStyles = {}
|
|
310
|
-
let
|
|
310
|
+
let extraPaddingForMiniCardCloseButtonIfTopPosition = 0;
|
|
311
311
|
if (state.isFullScreenMode && state.isVisible) {
|
|
312
312
|
wrapperStyles = {
|
|
313
313
|
display: 'flex',
|
|
@@ -323,7 +323,6 @@ export const getSpotcheckComponentCssStyles = (state: SpotcheckState) => {
|
|
|
323
323
|
|
|
324
324
|
let height = Math.min(state.currentQuestionHeight, (state.maxHeight * window.innerHeight));
|
|
325
325
|
if(state.spotChecksMode === 'miniCard') {
|
|
326
|
-
padding = 45;
|
|
327
326
|
if(state.avatarEnabled) {
|
|
328
327
|
height = height - 56;
|
|
329
328
|
}
|
|
@@ -353,6 +352,9 @@ export const getSpotcheckComponentCssStyles = (state: SpotcheckState) => {
|
|
|
353
352
|
display: 'flex',
|
|
354
353
|
justifyContent: 'flex-start',
|
|
355
354
|
};
|
|
355
|
+
if(state.spotChecksMode === 'miniCard' && state.isCloseButtonEnabled) {
|
|
356
|
+
extraPaddingForMiniCardCloseButtonIfTopPosition = 30;
|
|
357
|
+
}
|
|
356
358
|
break;
|
|
357
359
|
|
|
358
360
|
case 'center':
|
|
@@ -382,13 +384,12 @@ export const getSpotcheckComponentCssStyles = (state: SpotcheckState) => {
|
|
|
382
384
|
zIndex: '99999999',
|
|
383
385
|
display: 'none',
|
|
384
386
|
flexDirection: 'column',
|
|
385
|
-
paddingTop: padding+'px',
|
|
386
|
-
paddingBottom: padding+'px',
|
|
387
387
|
...wrapperStyles
|
|
388
388
|
},
|
|
389
389
|
styles: {
|
|
390
390
|
display: 'none',
|
|
391
391
|
flexDirection: 'column',
|
|
392
|
+
paddingTop: extraPaddingForMiniCardCloseButtonIfTopPosition+'px',
|
|
392
393
|
...styles,
|
|
393
394
|
}
|
|
394
395
|
};
|