releasebird-javascript-sdk 1.0.39 → 1.0.41
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/.claude/settings.local.json +9 -0
- package/build/index.js +1 -1
- package/package.json +1 -1
- package/published/1.0.39/index.js +1 -1
- package/published/1.0.40/index.js +1 -0
- package/published/1.0.41/index.js +1 -0
- package/published/latest/index.js +1 -1
- package/src/RbirdBannerManager.js +4 -2
- package/src/RbirdScreenshotManager.js +12 -5
|
@@ -1,5 +1,7 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
1
|
+
import RbirdUtils from './RbirdUtils';
|
|
2
|
+
import RbirdSessionManager from './RbirdSessionManager';
|
|
3
|
+
|
|
4
|
+
const API = RbirdUtils.API;
|
|
3
5
|
|
|
4
6
|
export class RbirdBannerManager {
|
|
5
7
|
static instance;
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import RbirdWebsiteWidget from "./RbirdWebsiteWidget";
|
|
2
1
|
import SVGEditor from "./SVGEditor";
|
|
3
2
|
import html2canvas from "html2canvas";
|
|
4
3
|
|
|
@@ -15,9 +14,16 @@ export default class RbirdScreenshotManager {
|
|
|
15
14
|
return this.instance;
|
|
16
15
|
}
|
|
17
16
|
|
|
17
|
+
// Lazy load RbirdWebsiteWidget to avoid circular dependency
|
|
18
|
+
getRbirdWebsiteWidget() {
|
|
19
|
+
// Import at runtime to break circular dependency
|
|
20
|
+
const RbirdWebsiteWidget = require("./RbirdWebsiteWidget").default;
|
|
21
|
+
return RbirdWebsiteWidget;
|
|
22
|
+
}
|
|
23
|
+
|
|
18
24
|
activateMarker(allowPointerEvents) {
|
|
19
25
|
document.body.style.overflow = 'hidden';
|
|
20
|
-
|
|
26
|
+
this.getRbirdWebsiteWidget().getInstance().closeWebsiteWidget();
|
|
21
27
|
this.boundary = document.createElement('div');
|
|
22
28
|
this.boundary.id = "markerBoundary";
|
|
23
29
|
this.boundary.className = "markerBoundary";
|
|
@@ -51,7 +57,7 @@ export default class RbirdScreenshotManager {
|
|
|
51
57
|
deactivateMarker() {
|
|
52
58
|
document.body.style.overflow = 'auto';
|
|
53
59
|
document.body.removeChild(this.boundary);
|
|
54
|
-
|
|
60
|
+
this.getRbirdWebsiteWidget().getInstance().openWebsiteWidget();
|
|
55
61
|
}
|
|
56
62
|
|
|
57
63
|
showLoader() {
|
|
@@ -99,8 +105,9 @@ export default class RbirdScreenshotManager {
|
|
|
99
105
|
}).then(function (canvas) {
|
|
100
106
|
that.hideLoader();
|
|
101
107
|
|
|
102
|
-
|
|
103
|
-
|
|
108
|
+
const widgetInstance = that.getRbirdWebsiteWidget().getInstance();
|
|
109
|
+
if (widgetInstance.iframe) {
|
|
110
|
+
widgetInstance.iframe.contentWindow?.postMessage({
|
|
104
111
|
type: 'screenshot',
|
|
105
112
|
screenshot: canvas.toDataURL("image/jpeg")
|
|
106
113
|
}, '*');
|