@product7/feedback-sdk 1.4.5 → 1.4.7
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/package.json
CHANGED
package/src/styles/feedback.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export const feedbackStyles = `
|
|
2
2
|
.feedback-widget-button {
|
|
3
3
|
position: fixed;
|
|
4
|
-
z-index: var(--z-
|
|
4
|
+
z-index: var(--z-notification);
|
|
5
5
|
}
|
|
6
6
|
|
|
7
7
|
.feedback-widget-button.position-bottom-right {
|
|
@@ -43,6 +43,8 @@ export const feedbackStyles = `
|
|
|
43
43
|
background: var(--color-primary);
|
|
44
44
|
box-shadow: var(--shadow-md);
|
|
45
45
|
width: fit-content;
|
|
46
|
+
touch-action: manipulation;
|
|
47
|
+
-webkit-tap-highlight-color: transparent;
|
|
46
48
|
}
|
|
47
49
|
|
|
48
50
|
.feedback-trigger-btn:hover:not(:disabled) {
|
|
@@ -81,6 +83,7 @@ export const feedbackStyles = `
|
|
|
81
83
|
transition: opacity var(--transition-base);
|
|
82
84
|
box-shadow: var(--shadow-sm);
|
|
83
85
|
cursor: pointer;
|
|
86
|
+
pointer-events: none;
|
|
84
87
|
}
|
|
85
88
|
|
|
86
89
|
.feedback-minimize-icon svg,
|
|
@@ -93,6 +96,7 @@ export const feedbackStyles = `
|
|
|
93
96
|
|
|
94
97
|
.feedback-widget-button:not(.minimized) .feedback-trigger-btn:hover .feedback-minimize-icon {
|
|
95
98
|
opacity: 1;
|
|
99
|
+
pointer-events: auto;
|
|
96
100
|
}
|
|
97
101
|
|
|
98
102
|
.feedback-widget-button.minimized .feedback-trigger-btn {
|
|
@@ -112,6 +116,7 @@ export const feedbackStyles = `
|
|
|
112
116
|
|
|
113
117
|
.feedback-widget-button.minimized .feedback-trigger-btn:hover .feedback-expand-icon {
|
|
114
118
|
opacity: 1;
|
|
119
|
+
pointer-events: auto;
|
|
115
120
|
}
|
|
116
121
|
|
|
117
122
|
.feedback-panel {
|
|
@@ -41,6 +41,21 @@ export class ButtonWidget extends BaseWidget {
|
|
|
41
41
|
const button = this.element.querySelector('.feedback-trigger-btn');
|
|
42
42
|
const minimizeIcon = this.element.querySelector('.feedback-minimize-icon');
|
|
43
43
|
const expandIcon = this.element.querySelector('.feedback-expand-icon');
|
|
44
|
+
const isControlIcon = (target) => {
|
|
45
|
+
if (!(target instanceof Element)) return false;
|
|
46
|
+
return Boolean(
|
|
47
|
+
target.closest('.feedback-minimize-icon') ||
|
|
48
|
+
target.closest('.feedback-expand-icon')
|
|
49
|
+
);
|
|
50
|
+
};
|
|
51
|
+
const openIfAllowed = (target) => {
|
|
52
|
+
if (isControlIcon(target)) {
|
|
53
|
+
return;
|
|
54
|
+
}
|
|
55
|
+
if (!this.isMinimized) {
|
|
56
|
+
this.openPanel();
|
|
57
|
+
}
|
|
58
|
+
};
|
|
44
59
|
|
|
45
60
|
minimizeIcon.addEventListener('click', (e) => {
|
|
46
61
|
e.stopPropagation();
|
|
@@ -55,16 +70,13 @@ export class ButtonWidget extends BaseWidget {
|
|
|
55
70
|
});
|
|
56
71
|
|
|
57
72
|
button.addEventListener('click', (e) => {
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
e.target.closest('.feedback-expand-icon')
|
|
61
|
-
) {
|
|
62
|
-
return;
|
|
63
|
-
}
|
|
73
|
+
openIfAllowed(e.target);
|
|
74
|
+
});
|
|
64
75
|
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
76
|
+
// Pointer events improve consistency across touch and mouse devices.
|
|
77
|
+
button.addEventListener('pointerup', (e) => {
|
|
78
|
+
if (e.pointerType === 'mouse') return;
|
|
79
|
+
openIfAllowed(e.target);
|
|
68
80
|
});
|
|
69
81
|
}
|
|
70
82
|
|