@weldsuite/helpdesk-widget-sdk 1.0.2 → 1.0.4
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.esm.js +82 -16
- package/dist/angular.esm.js.map +1 -1
- package/dist/angular.js +82 -16
- package/dist/angular.js.map +1 -1
- package/dist/index.d.ts +4 -0
- package/dist/index.esm.js +82 -16
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +82 -16
- package/dist/index.js.map +1 -1
- package/dist/index.umd.js +82 -16
- package/dist/index.umd.js.map +1 -1
- package/dist/react.esm.js +82 -16
- package/dist/react.esm.js.map +1 -1
- package/dist/react.js +82 -16
- package/dist/react.js.map +1 -1
- package/dist/vue-composables.esm.js +82 -16
- package/dist/vue-composables.esm.js.map +1 -1
- package/dist/vue-composables.js +82 -16
- package/dist/vue-composables.js.map +1 -1
- package/package.json +102 -102
package/dist/angular.js
CHANGED
|
@@ -620,20 +620,47 @@ class IframeManager {
|
|
|
620
620
|
const container = document.createElement('div');
|
|
621
621
|
container.className = 'weld-widget-frame';
|
|
622
622
|
container.setAttribute('data-state', 'closed');
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
623
|
+
// Apply different styles for mobile vs desktop
|
|
624
|
+
if (this.deviceInfo.isMobile) {
|
|
625
|
+
// Mobile: full-screen with dynamic viewport height to handle URL bar
|
|
626
|
+
container.style.cssText = `
|
|
627
|
+
position: fixed;
|
|
628
|
+
top: 0;
|
|
629
|
+
left: 0;
|
|
630
|
+
right: 0;
|
|
631
|
+
bottom: 0;
|
|
632
|
+
width: 100vw;
|
|
633
|
+
height: 100dvh;
|
|
634
|
+
height: 100vh;
|
|
635
|
+
z-index: 2147483001;
|
|
636
|
+
pointer-events: none;
|
|
637
|
+
display: none;
|
|
638
|
+
border-radius: 0;
|
|
639
|
+
overflow: hidden;
|
|
640
|
+
background: transparent;
|
|
641
|
+
`;
|
|
642
|
+
// Use visualViewport API for accurate height on mobile browsers
|
|
643
|
+
if (window.visualViewport) {
|
|
644
|
+
container.style.height = `${window.visualViewport.height}px`;
|
|
645
|
+
}
|
|
646
|
+
}
|
|
647
|
+
else {
|
|
648
|
+
// Desktop: positioned widget
|
|
649
|
+
container.style.cssText = `
|
|
650
|
+
position: fixed;
|
|
651
|
+
bottom: ${widget.position.bottom};
|
|
652
|
+
right: ${widget.position.right};
|
|
653
|
+
width: ${widget.width};
|
|
654
|
+
height: ${widget.height};
|
|
655
|
+
max-width: 100vw;
|
|
656
|
+
z-index: 2147483001;
|
|
657
|
+
pointer-events: none;
|
|
658
|
+
display: none;
|
|
659
|
+
border-radius: 16px;
|
|
660
|
+
overflow: hidden;
|
|
661
|
+
background: transparent;
|
|
662
|
+
`;
|
|
663
|
+
}
|
|
637
664
|
// Create iframe
|
|
638
665
|
const iframe = document.createElement('iframe');
|
|
639
666
|
iframe.name = widget.name;
|
|
@@ -645,7 +672,7 @@ class IframeManager {
|
|
|
645
672
|
border: none;
|
|
646
673
|
background: transparent;
|
|
647
674
|
display: block;
|
|
648
|
-
border-radius: 16px;
|
|
675
|
+
border-radius: ${this.deviceInfo.isMobile ? '0' : '16px'};
|
|
649
676
|
`;
|
|
650
677
|
iframe.setAttribute('allow', 'clipboard-write; camera; microphone');
|
|
651
678
|
iframe.setAttribute('sandbox', 'allow-scripts allow-same-origin allow-forms allow-popups allow-downloads');
|
|
@@ -731,6 +758,11 @@ class IframeManager {
|
|
|
731
758
|
window.addEventListener('resize', this.handleResize.bind(this));
|
|
732
759
|
// Orientation change
|
|
733
760
|
window.addEventListener('orientationchange', this.handleOrientationChange.bind(this));
|
|
761
|
+
// Visual viewport resize (handles mobile URL bar and keyboard)
|
|
762
|
+
if (window.visualViewport) {
|
|
763
|
+
window.visualViewport.addEventListener('resize', this.handleVisualViewportResize.bind(this));
|
|
764
|
+
window.visualViewport.addEventListener('scroll', this.handleVisualViewportResize.bind(this));
|
|
765
|
+
}
|
|
734
766
|
this.logger.debug('Event listeners setup');
|
|
735
767
|
}
|
|
736
768
|
/**
|
|
@@ -747,6 +779,21 @@ class IframeManager {
|
|
|
747
779
|
this.deviceInfo = detectDevice();
|
|
748
780
|
this.logger.debug('Orientation changed', { orientation: this.deviceInfo.orientation });
|
|
749
781
|
}
|
|
782
|
+
/**
|
|
783
|
+
* Handle visual viewport resize (mobile URL bar, keyboard)
|
|
784
|
+
*/
|
|
785
|
+
handleVisualViewportResize() {
|
|
786
|
+
if (!this.deviceInfo.isMobile || !window.visualViewport)
|
|
787
|
+
return;
|
|
788
|
+
const widget = this.iframes.get(IframeType.WIDGET);
|
|
789
|
+
if (widget && widget.visible) {
|
|
790
|
+
const vh = window.visualViewport.height;
|
|
791
|
+
const offsetTop = window.visualViewport.offsetTop;
|
|
792
|
+
widget.container.style.height = `${vh}px`;
|
|
793
|
+
widget.container.style.top = `${offsetTop}px`;
|
|
794
|
+
this.logger.debug('Visual viewport resized', { height: vh, offsetTop });
|
|
795
|
+
}
|
|
796
|
+
}
|
|
750
797
|
/**
|
|
751
798
|
* Get iframe by type
|
|
752
799
|
*/
|
|
@@ -804,6 +851,18 @@ class IframeManager {
|
|
|
804
851
|
if (this.deviceInfo.isMobile && type === IframeType.WIDGET && this.config.mobile.scrollLock) {
|
|
805
852
|
document.body.classList.add('weld-mobile-open');
|
|
806
853
|
}
|
|
854
|
+
// Hide launcher on mobile when widget is open (full-screen mode)
|
|
855
|
+
if (this.deviceInfo.isMobile && type === IframeType.WIDGET) {
|
|
856
|
+
const launcher = this.iframes.get(IframeType.LAUNCHER);
|
|
857
|
+
if (launcher) {
|
|
858
|
+
launcher.container.style.display = 'none';
|
|
859
|
+
}
|
|
860
|
+
// Apply accurate viewport height using visualViewport API
|
|
861
|
+
if (window.visualViewport) {
|
|
862
|
+
iframe.container.style.height = `${window.visualViewport.height}px`;
|
|
863
|
+
iframe.container.style.top = `${window.visualViewport.offsetTop}px`;
|
|
864
|
+
}
|
|
865
|
+
}
|
|
807
866
|
console.log(`[Weld SDK] Iframe ${type} shown`, { newDisplay: iframe.container.style.display });
|
|
808
867
|
}
|
|
809
868
|
/**
|
|
@@ -824,6 +883,13 @@ class IframeManager {
|
|
|
824
883
|
if (this.deviceInfo.isMobile && type === IframeType.WIDGET) {
|
|
825
884
|
document.body.classList.remove('weld-mobile-open');
|
|
826
885
|
}
|
|
886
|
+
// Show launcher again on mobile when widget is closed
|
|
887
|
+
if (this.deviceInfo.isMobile && type === IframeType.WIDGET) {
|
|
888
|
+
const launcher = this.iframes.get(IframeType.LAUNCHER);
|
|
889
|
+
if (launcher) {
|
|
890
|
+
launcher.container.style.display = 'block';
|
|
891
|
+
}
|
|
892
|
+
}
|
|
827
893
|
console.log(`[Weld SDK] Iframe ${type} hidden`, { newDisplay: iframe.container.style.display });
|
|
828
894
|
}
|
|
829
895
|
/**
|
|
@@ -2011,7 +2077,7 @@ class StateCoordinator {
|
|
|
2011
2077
|
}
|
|
2012
2078
|
}
|
|
2013
2079
|
|
|
2014
|
-
var version = "1.0.
|
|
2080
|
+
var version = "1.0.4";
|
|
2015
2081
|
var packageJson = {
|
|
2016
2082
|
version: version};
|
|
2017
2083
|
|