@ada-support/embed2 1.13.2 → 1.13.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.
|
@@ -11,6 +11,7 @@ interface Props {
|
|
|
11
11
|
interface State {
|
|
12
12
|
currentIndex: number;
|
|
13
13
|
imageLoaded: boolean;
|
|
14
|
+
imageError: boolean;
|
|
14
15
|
}
|
|
15
16
|
export declare class LightboxOverlay extends Component<Props, State> {
|
|
16
17
|
state: State;
|
|
@@ -20,6 +21,8 @@ export declare class LightboxOverlay extends Component<Props, State> {
|
|
|
20
21
|
goToPrev: () => void;
|
|
21
22
|
goToNext: () => void;
|
|
22
23
|
handleImageLoad: () => void;
|
|
24
|
+
handleImageError: () => void;
|
|
25
|
+
handleOpenInNewTab: () => void;
|
|
23
26
|
handleDownload: () => Promise<void>;
|
|
24
27
|
handlePrint: () => Promise<void>;
|
|
25
28
|
get currentImage(): LightboxImage | undefined;
|
package/dist/npm-entry/index.js
CHANGED
|
@@ -15919,7 +15919,7 @@ const client = new BrowserClient({
|
|
|
15919
15919
|
return event;
|
|
15920
15920
|
},
|
|
15921
15921
|
environment: "production",
|
|
15922
|
-
release: "1.13.
|
|
15922
|
+
release: "1.13.4-b255320",
|
|
15923
15923
|
sampleRate: 0.25,
|
|
15924
15924
|
autoSessionTracking: false,
|
|
15925
15925
|
// Integrations don't seem to work with Sentry: https://github.com/getsentry/sentry-javascript/issues/2541
|
|
@@ -16509,7 +16509,7 @@ function getEmbedURL(_ref) {
|
|
|
16509
16509
|
} else {
|
|
16510
16510
|
host = `http://${handle}.localhost:${ports.localhost.default}`;
|
|
16511
16511
|
}
|
|
16512
|
-
return `${host}/embed/${frameName}/${"
|
|
16512
|
+
return `${host}/embed/${frameName}/${"b255320"}/index.html`;
|
|
16513
16513
|
}
|
|
16514
16514
|
function constructQueryString(query) {
|
|
16515
16515
|
return Object.keys(query).map(key => {
|
|
@@ -17697,9 +17697,9 @@ async function log(message, extra, options) {
|
|
|
17697
17697
|
service: "embed",
|
|
17698
17698
|
env: "production",
|
|
17699
17699
|
embedVersion: 2,
|
|
17700
|
-
version: "1.13.
|
|
17700
|
+
version: "1.13.4",
|
|
17701
17701
|
isNpm: true,
|
|
17702
|
-
commitHash: "
|
|
17702
|
+
commitHash: "b255320"
|
|
17703
17703
|
}))
|
|
17704
17704
|
});
|
|
17705
17705
|
}
|
|
@@ -18880,7 +18880,8 @@ class LightboxOverlay extends preact_module_d {
|
|
|
18880
18880
|
super(...arguments);
|
|
18881
18881
|
_defineProperty(this, "state", {
|
|
18882
18882
|
currentIndex: this.props.initialIndex,
|
|
18883
|
-
imageLoaded: false
|
|
18883
|
+
imageLoaded: false,
|
|
18884
|
+
imageError: false
|
|
18884
18885
|
});
|
|
18885
18886
|
_defineProperty(this, "handleKeyDown", e => {
|
|
18886
18887
|
if (e.key === "Escape") {
|
|
@@ -18894,13 +18895,15 @@ class LightboxOverlay extends preact_module_d {
|
|
|
18894
18895
|
_defineProperty(this, "goToPrev", () => {
|
|
18895
18896
|
this.setState(s => ({
|
|
18896
18897
|
currentIndex: Math.max(0, s.currentIndex - 1),
|
|
18897
|
-
imageLoaded: false
|
|
18898
|
+
imageLoaded: false,
|
|
18899
|
+
imageError: false
|
|
18898
18900
|
}));
|
|
18899
18901
|
});
|
|
18900
18902
|
_defineProperty(this, "goToNext", () => {
|
|
18901
18903
|
this.setState(s => ({
|
|
18902
18904
|
currentIndex: Math.min(this.props.images.length - 1, s.currentIndex + 1),
|
|
18903
|
-
imageLoaded: false
|
|
18905
|
+
imageLoaded: false,
|
|
18906
|
+
imageError: false
|
|
18904
18907
|
}));
|
|
18905
18908
|
});
|
|
18906
18909
|
_defineProperty(this, "handleImageLoad", () => {
|
|
@@ -18908,6 +18911,22 @@ class LightboxOverlay extends preact_module_d {
|
|
|
18908
18911
|
imageLoaded: true
|
|
18909
18912
|
});
|
|
18910
18913
|
});
|
|
18914
|
+
_defineProperty(this, "handleImageError", () => {
|
|
18915
|
+
this.setState({
|
|
18916
|
+
imageError: true,
|
|
18917
|
+
imageLoaded: false
|
|
18918
|
+
});
|
|
18919
|
+
});
|
|
18920
|
+
_defineProperty(this, "handleOpenInNewTab", () => {
|
|
18921
|
+
const {
|
|
18922
|
+
onClose
|
|
18923
|
+
} = this.props;
|
|
18924
|
+
const image = this.currentImage;
|
|
18925
|
+
if (image) {
|
|
18926
|
+
window.open(image.url, "_blank", "noopener,noreferrer");
|
|
18927
|
+
}
|
|
18928
|
+
onClose();
|
|
18929
|
+
});
|
|
18911
18930
|
_defineProperty(this, "handleDownload", async () => {
|
|
18912
18931
|
const image = this.currentImage;
|
|
18913
18932
|
if (!image) {
|
|
@@ -18921,7 +18940,7 @@ class LightboxOverlay extends preact_module_d {
|
|
|
18921
18940
|
link.click();
|
|
18922
18941
|
URL.revokeObjectURL(objectUrl);
|
|
18923
18942
|
} catch {
|
|
18924
|
-
window.open(image.url);
|
|
18943
|
+
window.open(image.url, "_blank", "noopener,noreferrer");
|
|
18925
18944
|
}
|
|
18926
18945
|
});
|
|
18927
18946
|
_defineProperty(this, "handlePrint", async () => {
|
|
@@ -18953,7 +18972,7 @@ class LightboxOverlay extends preact_module_d {
|
|
|
18953
18972
|
URL.revokeObjectURL(objectUrl);
|
|
18954
18973
|
}
|
|
18955
18974
|
} catch {
|
|
18956
|
-
window.open(image.url);
|
|
18975
|
+
window.open(image.url, "_blank", "noopener,noreferrer");
|
|
18957
18976
|
}
|
|
18958
18977
|
});
|
|
18959
18978
|
}
|
|
@@ -18989,7 +19008,8 @@ class LightboxOverlay extends preact_module_d {
|
|
|
18989
19008
|
} = this.props;
|
|
18990
19009
|
const {
|
|
18991
19010
|
currentIndex,
|
|
18992
|
-
imageLoaded
|
|
19011
|
+
imageLoaded,
|
|
19012
|
+
imageError
|
|
18993
19013
|
} = this.state;
|
|
18994
19014
|
const {
|
|
18995
19015
|
currentImage
|
|
@@ -19054,7 +19074,8 @@ class LightboxOverlay extends preact_module_d {
|
|
|
19054
19074
|
flexDirection: "column",
|
|
19055
19075
|
alignItems: "center"
|
|
19056
19076
|
}
|
|
19057
|
-
}, !imageLoaded && v("div", {
|
|
19077
|
+
}, !imageLoaded && !imageError && v("div", {
|
|
19078
|
+
"data-testid": "lightbox-spinner",
|
|
19058
19079
|
style: {
|
|
19059
19080
|
width: "40px",
|
|
19060
19081
|
height: "40px",
|
|
@@ -19063,10 +19084,35 @@ class LightboxOverlay extends preact_module_d {
|
|
|
19063
19084
|
borderRadius: "50%",
|
|
19064
19085
|
animation: "ada-spin 0.8s linear infinite"
|
|
19065
19086
|
}
|
|
19066
|
-
}),
|
|
19087
|
+
}), imageError && v("div", {
|
|
19088
|
+
role: "alert",
|
|
19089
|
+
style: {
|
|
19090
|
+
color: "#ffffff",
|
|
19091
|
+
textAlign: "center",
|
|
19092
|
+
padding: "20px"
|
|
19093
|
+
}
|
|
19094
|
+
}, v("p", {
|
|
19095
|
+
style: {
|
|
19096
|
+
margin: "0 0 12px"
|
|
19097
|
+
}
|
|
19098
|
+
}, "Unable to load image"), v("button", {
|
|
19099
|
+
type: "button",
|
|
19100
|
+
onClick: this.handleOpenInNewTab,
|
|
19101
|
+
style: {
|
|
19102
|
+
padding: "8px 16px",
|
|
19103
|
+
background: "#ffffff",
|
|
19104
|
+
color: "#000000",
|
|
19105
|
+
border: "none",
|
|
19106
|
+
borderRadius: "6px",
|
|
19107
|
+
cursor: "pointer",
|
|
19108
|
+
fontFamily: FONT_FAMILY,
|
|
19109
|
+
fontSize: "14px"
|
|
19110
|
+
}
|
|
19111
|
+
}, "Open in new tab")), currentImage && !imageError && v("img", {
|
|
19067
19112
|
src: currentImage.url,
|
|
19068
19113
|
alt: currentImage.altText ?? "",
|
|
19069
19114
|
onLoad: this.handleImageLoad,
|
|
19115
|
+
onError: this.handleImageError,
|
|
19070
19116
|
style: {
|
|
19071
19117
|
maxWidth: "100%",
|
|
19072
19118
|
maxHeight: "80vh",
|
|
@@ -19551,7 +19597,7 @@ class ChatFrame extends preact_module_d {
|
|
|
19551
19597
|
log("Chat frame mount", {
|
|
19552
19598
|
handle,
|
|
19553
19599
|
chatUrl: this.url,
|
|
19554
|
-
embedVersion: "
|
|
19600
|
+
embedVersion: "b255320".slice(0, 7),
|
|
19555
19601
|
embedSettings: adaSettings
|
|
19556
19602
|
});
|
|
19557
19603
|
|
|
@@ -19639,7 +19685,7 @@ class ChatFrame extends preact_module_d {
|
|
|
19639
19685
|
const hostPageUrlParams = new URL(window.location.href).searchParams;
|
|
19640
19686
|
const smsToken = hostPageUrlParams.get("adaSMSToken");
|
|
19641
19687
|
const queryParams = {
|
|
19642
|
-
embedVersion: "
|
|
19688
|
+
embedVersion: "b255320".slice(0, 7),
|
|
19643
19689
|
greeting,
|
|
19644
19690
|
language,
|
|
19645
19691
|
skipGreeting,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ada-support/embed2",
|
|
3
|
-
"version": "1.13.
|
|
3
|
+
"version": "1.13.4",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "dist/npm-entry",
|
|
6
6
|
"typings": "dist/npm-entry/index-npm.d.ts",
|
|
@@ -122,4 +122,4 @@
|
|
|
122
122
|
"publishConfig": {
|
|
123
123
|
"access": "public"
|
|
124
124
|
}
|
|
125
|
-
}
|
|
125
|
+
}
|