@product7/feedback-sdk 1.2.1 → 1.2.3

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.
@@ -1360,7 +1360,7 @@
1360
1360
  this.isMinimized = false;
1361
1361
  }
1362
1362
 
1363
- _render() {
1363
+ render() {
1364
1364
  const button = document.createElement('div');
1365
1365
  button.className = `feedback-widget feedback-widget-button theme-${this.options.theme} position-${this.options.position}`;
1366
1366
  button.innerHTML = `
@@ -1371,13 +1371,13 @@
1371
1371
  <span class="feedback-text">Feedback</span>
1372
1372
 
1373
1373
  <div class="feedback-minimize-icon">
1374
- <svg viewBox="0 0 256 256" fill="currentColor">
1374
+ <svg viewBox="0 0 256 256">
1375
1375
  <path d="M213.66,53.66,163.31,104H192a8,8,0,0,1,0,16H144a8,8,0,0,1-8-8V64a8,8,0,0,1,16,0V92.69l50.34-50.35a8,8,0,0,1,11.32,11.32ZM112,136H64a8,8,0,0,0,0,16H92.69L42.34,202.34a8,8,0,0,0,11.32,11.32L104,163.31V192a8,8,0,0,0,16,0V144A8,8,0,0,0,112,136Z"/>
1376
1376
  </svg>
1377
1377
  </div>
1378
1378
 
1379
1379
  <div class="feedback-expand-icon">
1380
- <svg viewBox="0 0 256 256" fill="currentColor">
1380
+ <svg viewBox="0 0 256 256">
1381
1381
  <path d="M112,40V64.69L61.66,14.34A8,8,0,0,0,50.34,25.66L100.69,76H72a8,8,0,0,0,0,16h48a8,8,0,0,0,8-8V36A8,8,0,0,0,112,40Zm131.06,70.61a8,8,0,0,0-8.72,1.73L184,162.69V136a8,8,0,0,0-16,0v48a8,8,0,0,0,8,8h48a8,8,0,0,0,0-16H195.31l50.35-50.34A8,8,0,0,0,243.06,110.61Z"/>
1382
1382
  </svg>
1383
1383
  </div>
@@ -1391,28 +1391,37 @@
1391
1391
  return button;
1392
1392
  }
1393
1393
 
1394
- _attachEvents() {
1394
+ attachEvents() {
1395
1395
  const button = this.element.querySelector('.feedback-trigger-btn');
1396
1396
  const minimizeIcon = this.element.querySelector('.feedback-minimize-icon');
1397
1397
  const expandIcon = this.element.querySelector('.feedback-expand-icon');
1398
1398
 
1399
- button.addEventListener('click', (e) => {
1400
- if (!e.target.closest('.feedback-minimize-icon') &&
1401
- !e.target.closest('.feedback-expand-icon')) {
1402
- this.openPanel();
1403
- }
1404
- });
1405
-
1399
+ // Add click handlers directly to the icons
1406
1400
  minimizeIcon.addEventListener('click', (e) => {
1407
1401
  e.stopPropagation();
1402
+ e.preventDefault();
1408
1403
  this.minimize();
1409
1404
  });
1410
1405
 
1411
1406
  expandIcon.addEventListener('click', (e) => {
1412
1407
  e.stopPropagation();
1408
+ e.preventDefault();
1413
1409
  this.restore();
1414
1410
  });
1415
1411
 
1412
+ // Main button click handler
1413
+ button.addEventListener('click', (e) => {
1414
+ // Check if the click originated from an icon
1415
+ if (e.target.closest('.feedback-minimize-icon') ||
1416
+ e.target.closest('.feedback-expand-icon')) {
1417
+ return; // Let the icon handlers deal with it
1418
+ }
1419
+
1420
+ if (!this.isMinimized) {
1421
+ this.openPanel();
1422
+ }
1423
+ });
1424
+
1416
1425
  button.addEventListener('mouseenter', () => {
1417
1426
  if (!this.state.isSubmitting && !this.isMinimized) {
1418
1427
  button.style.transform = 'translateY(-2px)';
@@ -1420,7 +1429,9 @@
1420
1429
  });
1421
1430
 
1422
1431
  button.addEventListener('mouseleave', () => {
1423
- button.style.transform = 'translateY(0)';
1432
+ if (!this.isMinimized) {
1433
+ button.style.transform = 'translateY(0)';
1434
+ }
1424
1435
  });
1425
1436
  }
1426
1437