@mappedin/viewer 0.32.2-a6589fc.0 → 0.32.2
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/CHANGELOG.md +7 -0
- package/dist/index.js +110 -57
- package/dist/types/src/components/carousel/index.d.ts +5 -1
- package/dist/types/src/components/carousel/nav-chevrons.d.ts +5 -2
- package/dist/types/src/components/logo-box/index.d.ts +1 -0
- package/dist/types/src/components/metadata-card/index.d.ts +3 -0
- package/dist/types/src/components/metadata-card/metadata-card.stories.d.ts +3 -0
- package/dist/types/src/components/metadata-card/utils.d.ts +75 -0
- package/dist/types/src/lib/canvas/hi-res-canvas.d.ts +6 -0
- package/dist/types/src/lib/types/theme.d.ts +1 -0
- package/package.json +1 -1
- /package/dist/types/src/components/legacy-metadata-card/{metadata-card.stories.d.ts → legacy-metadata-card.stories.d.ts} +0 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,12 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [0.32.2](https://github.com/MappedIn/viewer/compare/viewer-v0.32.1...viewer-v0.32.2) (2025-01-16)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Bug Fixes
|
|
7
|
+
|
|
8
|
+
* **SRV-1964:** correct scale hover effect canvas with browser zoom ([#403](https://github.com/MappedIn/viewer/issues/403)) ([df422e5](https://github.com/MappedIn/viewer/commit/df422e5ad658a63fe8863d632adbaee7cec689c6))
|
|
9
|
+
|
|
3
10
|
## [0.32.1](https://github.com/MappedIn/viewer/compare/viewer-v0.32.0...viewer-v0.32.1) (2025-01-14)
|
|
4
11
|
|
|
5
12
|
|
package/dist/index.js
CHANGED
|
@@ -9452,7 +9452,8 @@ const g0 = new BV2("[Mappedin Viewer]"), x5 = "embedded", Zs = "you-are-here", y
|
|
|
9452
9452
|
xlarge: 20
|
|
9453
9453
|
},
|
|
9454
9454
|
borderRadius: {
|
|
9455
|
-
primary: 4
|
|
9455
|
+
primary: 4,
|
|
9456
|
+
large: 8
|
|
9456
9457
|
},
|
|
9457
9458
|
fontWeight: {
|
|
9458
9459
|
light: 300,
|
|
@@ -17063,7 +17064,7 @@ const Cr2 = function() {
|
|
|
17063
17064
|
const e = lg(), [t, r] = i;
|
|
17064
17065
|
e.capture(t, r);
|
|
17065
17066
|
}, vr2 = (i = {}) => {
|
|
17066
|
-
const e = "
|
|
17067
|
+
const e = "phc_sRrjUwz9zicl4GeXtSnwcuKMr50SB76ma6NVi6zlPou", t = "https://ph-api.mappedin.com";
|
|
17067
17068
|
B$2(i.captureEnabled ?? !0);
|
|
17068
17069
|
const r = lg();
|
|
17069
17070
|
if (!r.__loaded && e != null && t != null) {
|
|
@@ -74141,6 +74142,18 @@ class H6e {
|
|
|
74141
74142
|
g2(this, "cursorPosition", { x: 0, y: 0 });
|
|
74142
74143
|
g2(this, "enabled");
|
|
74143
74144
|
g2(this, "frameCallback");
|
|
74145
|
+
g2(this, "handleResize", () => {
|
|
74146
|
+
this.updateCanvasResolution(this.containerRect.width, this.containerRect.height);
|
|
74147
|
+
});
|
|
74148
|
+
/**
|
|
74149
|
+
* Update the canvas resolution to account for high DPR devices. DPR lower than 1 should work
|
|
74150
|
+
* fine, but higher DPR's could cause blurriness without scaling.
|
|
74151
|
+
*/
|
|
74152
|
+
g2(this, "updateCanvasResolution", (e, t) => {
|
|
74153
|
+
var n;
|
|
74154
|
+
const r = Math.max(devicePixelRatio, 1);
|
|
74155
|
+
this.canvas.width = e * r, this.canvas.height = t * r, this.canvas.style.width = `${e}px`, this.canvas.style.height = `${t}px`, (n = this.context) == null || n.scale(r, r);
|
|
74156
|
+
});
|
|
74144
74157
|
/**
|
|
74145
74158
|
* Scale the canvas whenever the container is resized.
|
|
74146
74159
|
*/
|
|
@@ -74150,7 +74163,7 @@ class H6e {
|
|
|
74150
74163
|
if (r == null || (this.containerRect = r.target.getBoundingClientRect(), this.context == null))
|
|
74151
74164
|
return;
|
|
74152
74165
|
const { height: n, width: a } = r.contentRect;
|
|
74153
|
-
this.
|
|
74166
|
+
this.updateCanvasResolution(a, n);
|
|
74154
74167
|
}).observe(this.container);
|
|
74155
74168
|
});
|
|
74156
74169
|
g2(this, "handleMouseMove", (e) => {
|
|
@@ -74163,7 +74176,7 @@ class H6e {
|
|
|
74163
74176
|
* If enabled, draw a frame then request another frame draw.
|
|
74164
74177
|
*/
|
|
74165
74178
|
g2(this, "startDrawing", () => {
|
|
74166
|
-
this.enabled && this.context != null && (this.hasMouseMoved && this.frameCallback(this.context, this.canvas, this.cursorPosition), requestAnimationFrame(this.startDrawing));
|
|
74179
|
+
this.enabled && this.context != null && (this.hasMouseMoved && (this.clearCanvas(), this.frameCallback(this.context, this.canvas, this.cursorPosition)), requestAnimationFrame(this.startDrawing));
|
|
74167
74180
|
});
|
|
74168
74181
|
g2(this, "enable", () => {
|
|
74169
74182
|
this.enabled || (this.enabled = !0, this.startDrawing());
|
|
@@ -74178,11 +74191,13 @@ class H6e {
|
|
|
74178
74191
|
passive: !0
|
|
74179
74192
|
}), document.addEventListener("mousedown", this.handleMouseMove, {
|
|
74180
74193
|
passive: !0
|
|
74194
|
+
}), window.addEventListener("resize", this.handleResize, {
|
|
74195
|
+
passive: !0
|
|
74181
74196
|
}), this.makeCanvasResponsive(), a.enabled && this.enable();
|
|
74182
74197
|
}
|
|
74183
74198
|
destroy() {
|
|
74184
74199
|
var e;
|
|
74185
|
-
this.disable(), this.canvas.remove(), document.removeEventListener("mousemove", this.handleMouseMove), document.removeEventListener("mousedown", this.handleMouseMove), (e = this.resizeObserver) == null || e.disconnect();
|
|
74200
|
+
this.disable(), this.canvas.remove(), document.removeEventListener("mousemove", this.handleMouseMove), document.removeEventListener("mousedown", this.handleMouseMove), window.removeEventListener("resize", this.handleResize), (e = this.resizeObserver) == null || e.disconnect();
|
|
74186
74201
|
}
|
|
74187
74202
|
}
|
|
74188
74203
|
const O6e = 4;
|
|
@@ -74251,7 +74266,7 @@ const B6e = ({
|
|
|
74251
74266
|
const p = w2.useCallback(
|
|
74252
74267
|
(f, m, y) => {
|
|
74253
74268
|
var E, A;
|
|
74254
|
-
|
|
74269
|
+
(E = h.current) == null || E.setPosition({ ...y }), f.save();
|
|
74255
74270
|
const g = ((A = h.current) == null ? void 0 : A.angle) ?? 0;
|
|
74256
74271
|
f.transform(1, 0, 0, 1, y.x, y.y);
|
|
74257
74272
|
const C = {
|
|
@@ -75035,7 +75050,7 @@ const f5e = (i, e) => (F4 != null || (cp == null && globalThis.OffscreenCanvas !
|
|
|
75035
75050
|
const r = {
|
|
75036
75051
|
fit: "fit",
|
|
75037
75052
|
...t
|
|
75038
|
-
}, n = "https://image-proxy
|
|
75053
|
+
}, n = "https://image-proxy.mappedin.com", a = g5e[e], s = encodeURIComponent(i);
|
|
75039
75054
|
return `${n}/resize:${r.fit}:${a}:${a}:0/plain/${s}`.replaceAll(/\/+/g, "/").replace("/", "//");
|
|
75040
75055
|
}, GQ = le.div`
|
|
75041
75056
|
display: flex;
|
|
@@ -76510,7 +76525,7 @@ class N5e {
|
|
|
76510
76525
|
}
|
|
76511
76526
|
async init(e) {
|
|
76512
76527
|
this.container = e;
|
|
76513
|
-
const t = this.rootStore.startupOptions.outdoorMapsKey ?? "
|
|
76528
|
+
const t = this.rootStore.startupOptions.outdoorMapsKey ?? "zixaliyV5cGjHU", r = {
|
|
76514
76529
|
auto: !1,
|
|
76515
76530
|
initialFloor: this.rootStore.currentFloor,
|
|
76516
76531
|
watermark: this.getWatermarkOptions(),
|
|
@@ -93884,7 +93899,9 @@ const tA2 = le.div`
|
|
|
93884
93899
|
|
|
93885
93900
|
&&.left {
|
|
93886
93901
|
left: 10px;
|
|
93887
|
-
|
|
93902
|
+
// Center the chevron vertically
|
|
93903
|
+
top: calc(50% - ${(i) => i.$offsetY ?? 0}px);
|
|
93904
|
+
transform: translateY(-50%);
|
|
93888
93905
|
&& svg {
|
|
93889
93906
|
transform: rotate(90deg);
|
|
93890
93907
|
}
|
|
@@ -93892,19 +93909,29 @@ const tA2 = le.div`
|
|
|
93892
93909
|
|
|
93893
93910
|
&&.right {
|
|
93894
93911
|
right: 10px;
|
|
93895
|
-
|
|
93912
|
+
// Center the chevron vertically
|
|
93913
|
+
top: calc(50% - ${(i) => i.$offsetY ?? 0}px);
|
|
93914
|
+
transform: translateY(-50%);
|
|
93896
93915
|
&& svg {
|
|
93897
93916
|
transform: rotate(-90deg);
|
|
93898
93917
|
}
|
|
93899
93918
|
}
|
|
93900
|
-
`, ae2 = ({
|
|
93901
|
-
|
|
93919
|
+
`, ae2 = ({
|
|
93920
|
+
size: i,
|
|
93921
|
+
onNext: e,
|
|
93922
|
+
onPrevious: t,
|
|
93923
|
+
backgroundStyle: r = {},
|
|
93924
|
+
tabIndex: n,
|
|
93925
|
+
offsetY: a
|
|
93926
|
+
}) => {
|
|
93927
|
+
const s = nt();
|
|
93902
93928
|
return /* @__PURE__ */ Z.jsxs(Z.Fragment, { children: [
|
|
93903
93929
|
/* @__PURE__ */ Z.jsx(
|
|
93904
93930
|
s7,
|
|
93905
93931
|
{
|
|
93932
|
+
$offsetY: a,
|
|
93906
93933
|
style: {
|
|
93907
|
-
backgroundColor: `${
|
|
93934
|
+
backgroundColor: `${s.colors.background.inverted}${Zh(0.25)}`,
|
|
93908
93935
|
...r
|
|
93909
93936
|
},
|
|
93910
93937
|
className: "left",
|
|
@@ -93916,8 +93943,9 @@ const tA2 = le.div`
|
|
|
93916
93943
|
/* @__PURE__ */ Z.jsx(
|
|
93917
93944
|
s7,
|
|
93918
93945
|
{
|
|
93946
|
+
$offsetY: a,
|
|
93919
93947
|
style: {
|
|
93920
|
-
backgroundColor: `${
|
|
93948
|
+
backgroundColor: `${s.colors.background.inverted}${Zh(0.25)}`,
|
|
93921
93949
|
...r
|
|
93922
93950
|
},
|
|
93923
93951
|
className: "right",
|
|
@@ -94824,63 +94852,72 @@ const bme = (i) => {
|
|
|
94824
94852
|
img {
|
|
94825
94853
|
object-fit: contain;
|
|
94826
94854
|
}
|
|
94827
|
-
`, Dme = ({
|
|
94828
|
-
|
|
94829
|
-
|
|
94830
|
-
|
|
94831
|
-
|
|
94832
|
-
|
|
94833
|
-
|
|
94834
|
-
|
|
94835
|
-
|
|
94836
|
-
|
|
94837
|
-
|
|
94838
|
-
|
|
94839
|
-
|
|
94840
|
-
|
|
94855
|
+
`, Dme = ({
|
|
94856
|
+
children: i,
|
|
94857
|
+
imageURLs: e,
|
|
94858
|
+
onFullScreenGalleryOpen: t,
|
|
94859
|
+
proxy: r,
|
|
94860
|
+
width: n,
|
|
94861
|
+
height: a,
|
|
94862
|
+
navChevronOffsetY: s
|
|
94863
|
+
}) => {
|
|
94864
|
+
const { fullscreenRootRef: o, isMobile: l } = Yt(), {
|
|
94865
|
+
imgIndex: u,
|
|
94866
|
+
previousImage: c,
|
|
94867
|
+
nextImage: h,
|
|
94868
|
+
setImgIndex: p,
|
|
94869
|
+
currentImageSources: f,
|
|
94870
|
+
showNavigationControls: m,
|
|
94871
|
+
handleKeyDown: y,
|
|
94872
|
+
allowFullscreenImages: g,
|
|
94873
|
+
handleCarouselClick: C,
|
|
94874
|
+
fullscreen: x,
|
|
94875
|
+
handleCloseFullscreen: _,
|
|
94876
|
+
wrapperRef: w
|
|
94841
94877
|
} = Mme({
|
|
94842
|
-
imageURLs:
|
|
94843
|
-
onFullScreenGalleryOpen:
|
|
94844
|
-
proxy:
|
|
94878
|
+
imageURLs: e,
|
|
94879
|
+
onFullScreenGalleryOpen: t,
|
|
94880
|
+
proxy: r
|
|
94845
94881
|
});
|
|
94846
94882
|
return (
|
|
94847
94883
|
// Need a wrapper around the tabIndex 0 element so we can trap focus
|
|
94848
|
-
/* @__PURE__ */ Z.jsx(Eme, { id: Qt("image-carousel"), role: "tablist", ref:
|
|
94884
|
+
/* @__PURE__ */ Z.jsx(Eme, { id: Qt("image-carousel"), role: "tablist", ref: w, $mobile: l, style: { width: n, height: a }, children: /* @__PURE__ */ Z.jsxs("div", { className: "focus-wrapper", tabIndex: 0, onKeyDown: y, style: { borderRadius: "inherit" }, children: [
|
|
94849
94885
|
/* @__PURE__ */ Z.jsx(
|
|
94850
94886
|
"div",
|
|
94851
94887
|
{
|
|
94852
|
-
onClick:
|
|
94888
|
+
onClick: C,
|
|
94853
94889
|
style: {
|
|
94854
94890
|
display: "block",
|
|
94855
94891
|
borderRadius: "8px 8px 0 0",
|
|
94856
|
-
cursor:
|
|
94892
|
+
cursor: g ? "pointer" : "auto"
|
|
94857
94893
|
},
|
|
94858
|
-
children:
|
|
94894
|
+
children: f ? /* @__PURE__ */ Z.jsx(
|
|
94859
94895
|
se2,
|
|
94860
94896
|
{
|
|
94861
|
-
style: { width: "100%", height: 180 },
|
|
94897
|
+
style: { width: n ?? "100%", height: a ?? 180 },
|
|
94862
94898
|
role: "option",
|
|
94863
|
-
src: [
|
|
94899
|
+
src: [f.medium ?? "", f.original]
|
|
94864
94900
|
}
|
|
94865
94901
|
) : null
|
|
94866
94902
|
}
|
|
94867
94903
|
),
|
|
94868
|
-
|
|
94869
|
-
|
|
94904
|
+
i,
|
|
94905
|
+
(o == null ? void 0 : o.current) != null ? DC.createPortal(
|
|
94906
|
+
/* @__PURE__ */ Z.jsxs(Ame, { $visible: x, children: [
|
|
94870
94907
|
/* @__PURE__ */ Z.jsx(
|
|
94871
94908
|
se2,
|
|
94872
94909
|
{
|
|
94873
94910
|
role: "option",
|
|
94874
|
-
src:
|
|
94911
|
+
src: f == null ? void 0 : f.original,
|
|
94875
94912
|
style: {
|
|
94876
94913
|
background: "transparent",
|
|
94877
|
-
maxWidth:
|
|
94914
|
+
maxWidth: l ? "100%" : "80%",
|
|
94878
94915
|
maxHeight: "80%"
|
|
94879
94916
|
// Always leave room for the close button
|
|
94880
94917
|
}
|
|
94881
94918
|
}
|
|
94882
94919
|
),
|
|
94883
|
-
|
|
94920
|
+
m ? (
|
|
94884
94921
|
// These controls should not be directly focusable. Instead, the container should be focusable.
|
|
94885
94922
|
/* @__PURE__ */ Z.jsxs(Z.Fragment, { children: [
|
|
94886
94923
|
/* @__PURE__ */ Z.jsx("div", { className: "nav-wrapper", children: /* @__PURE__ */ Z.jsx(
|
|
@@ -94888,37 +94925,46 @@ const bme = (i) => {
|
|
|
94888
94925
|
{
|
|
94889
94926
|
tabIndex: -1,
|
|
94890
94927
|
size: 18,
|
|
94891
|
-
count:
|
|
94892
|
-
activeIndex:
|
|
94893
|
-
onClick:
|
|
94928
|
+
count: e.length,
|
|
94929
|
+
activeIndex: u,
|
|
94930
|
+
onClick: p
|
|
94894
94931
|
}
|
|
94895
94932
|
) }),
|
|
94896
94933
|
/* @__PURE__ */ Z.jsx(
|
|
94897
94934
|
ae2,
|
|
94898
94935
|
{
|
|
94899
94936
|
tabIndex: -1,
|
|
94900
|
-
size:
|
|
94901
|
-
onNext:
|
|
94902
|
-
onPrevious:
|
|
94937
|
+
size: l ? 24 : 36,
|
|
94938
|
+
onNext: h,
|
|
94939
|
+
onPrevious: c,
|
|
94903
94940
|
backgroundStyle: { background: "transparent", opacity: 0.4 }
|
|
94904
94941
|
}
|
|
94905
94942
|
)
|
|
94906
94943
|
] })
|
|
94907
94944
|
) : null,
|
|
94908
|
-
/* @__PURE__ */ Z.jsx(dS, { onClickOrPress:
|
|
94945
|
+
/* @__PURE__ */ Z.jsx(dS, { onClickOrPress: _, children: /* @__PURE__ */ Z.jsx(ti, { icon: "close-16x16", width: 24, height: 24, color: "#ffffff" }) })
|
|
94909
94946
|
] }),
|
|
94910
94947
|
// This is definitely defined because of the check for allowFullscreenImages
|
|
94911
|
-
|
|
94948
|
+
o.current
|
|
94912
94949
|
) : null,
|
|
94913
|
-
|
|
94914
|
-
/* @__PURE__ */ Z.jsx(
|
|
94950
|
+
m ? /* @__PURE__ */ Z.jsxs(Z.Fragment, { children: [
|
|
94951
|
+
/* @__PURE__ */ Z.jsx(
|
|
94952
|
+
ae2,
|
|
94953
|
+
{
|
|
94954
|
+
size: 24,
|
|
94955
|
+
onNext: h,
|
|
94956
|
+
onPrevious: c,
|
|
94957
|
+
tabIndex: -1,
|
|
94958
|
+
offsetY: s
|
|
94959
|
+
}
|
|
94960
|
+
),
|
|
94915
94961
|
/* @__PURE__ */ Z.jsx(Sme, { children: /* @__PURE__ */ Z.jsx(
|
|
94916
94962
|
ne2,
|
|
94917
94963
|
{
|
|
94918
94964
|
size: 16,
|
|
94919
|
-
count:
|
|
94920
|
-
activeIndex:
|
|
94921
|
-
onClick:
|
|
94965
|
+
count: e.length,
|
|
94966
|
+
activeIndex: u,
|
|
94967
|
+
onClick: p,
|
|
94922
94968
|
tabIndex: -1
|
|
94923
94969
|
}
|
|
94924
94970
|
) })
|
|
@@ -95226,7 +95272,14 @@ const bme = (i) => {
|
|
|
95226
95272
|
backgroundColor: u.colors.background.primary
|
|
95227
95273
|
},
|
|
95228
95274
|
children: [
|
|
95229
|
-
m ? /* @__PURE__ */ Z.jsx(
|
|
95275
|
+
m ? /* @__PURE__ */ Z.jsx(
|
|
95276
|
+
Dme,
|
|
95277
|
+
{
|
|
95278
|
+
navChevronOffsetY: -20,
|
|
95279
|
+
imageURLs: r,
|
|
95280
|
+
onFullScreenGalleryOpen: s
|
|
95281
|
+
}
|
|
95282
|
+
) : null,
|
|
95230
95283
|
y ? /* @__PURE__ */ Z.jsx(
|
|
95231
95284
|
Vme,
|
|
95232
95285
|
{
|
|
@@ -96576,7 +96629,7 @@ const Sge = ({ color: i = bl.color, changeFrequency: e = bl.changeFrequency, rad
|
|
|
96576
96629
|
] });
|
|
96577
96630
|
}), MA2 = () => {
|
|
96578
96631
|
let i = document.querySelector("meta[name=app-version]");
|
|
96579
|
-
i == null && (i = document.createElement("meta"), i.name = "app-version", document.head.appendChild(i)), i.content = "0.32.
|
|
96632
|
+
i == null && (i = document.createElement("meta"), i.name = "app-version", document.head.appendChild(i)), i.content = "0.32.2";
|
|
96580
96633
|
let e = document.querySelector("meta[name=viewport]");
|
|
96581
96634
|
e == null && (e = document.createElement("meta"), e.name = "viewport", document.head.appendChild(e)), e.content = "width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no";
|
|
96582
96635
|
}, SA2 = (i) => {
|
|
@@ -1,7 +1,11 @@
|
|
|
1
|
+
import { PropsWithChildren } from 'react';
|
|
1
2
|
type TCarouselProps = {
|
|
2
3
|
imageURLs: string[];
|
|
3
4
|
onFullScreenGalleryOpen?: () => void;
|
|
4
5
|
proxy?: boolean;
|
|
6
|
+
width?: number | string;
|
|
7
|
+
height?: number | string;
|
|
8
|
+
navChevronOffsetY?: number;
|
|
5
9
|
};
|
|
6
|
-
declare const Carousel: React.FC<TCarouselProps
|
|
10
|
+
declare const Carousel: React.FC<PropsWithChildren<TCarouselProps>>;
|
|
7
11
|
export default Carousel;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { TTheme } from '../../lib/types/theme';
|
|
2
|
-
export declare const SideNavButton: import("styled-components").IStyledComponent<"web", {
|
|
2
|
+
export declare const SideNavButton: import("styled-components").IStyledComponent<"web", import("styled-components/dist/types").Substitute<{
|
|
3
3
|
hidden?: boolean | undefined | undefined;
|
|
4
4
|
color?: string | undefined | undefined;
|
|
5
5
|
security?: string | undefined | undefined;
|
|
@@ -275,13 +275,16 @@ export declare const SideNavButton: import("styled-components").IStyledComponent
|
|
|
275
275
|
outlineOffset?: number | undefined;
|
|
276
276
|
outlineColor?: string | undefined;
|
|
277
277
|
outlineWidth?: number | undefined;
|
|
278
|
-
}
|
|
278
|
+
}, {
|
|
279
|
+
$offsetY?: number;
|
|
280
|
+
}>>;
|
|
279
281
|
type TNavChevronProps = {
|
|
280
282
|
size: number;
|
|
281
283
|
onNext: () => void;
|
|
282
284
|
onPrevious: () => void;
|
|
283
285
|
backgroundStyle?: React.CSSProperties;
|
|
284
286
|
tabIndex?: number;
|
|
287
|
+
offsetY?: number;
|
|
285
288
|
};
|
|
286
289
|
declare const NavChevrons: React.FC<TNavChevronProps>;
|
|
287
290
|
export default NavChevrons;
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import { TOnClickOrPressPayload } from '../button';
|
|
2
|
+
export declare const METADATA_CARD_WIDTH = 320;
|
|
3
|
+
export declare const METADATA_CARD_PADDING = 20;
|
|
4
|
+
export declare const HERO_IMAGE_HEIGHT = 200;
|
|
5
|
+
export type TMetadataCardProps = {
|
|
6
|
+
/**
|
|
7
|
+
* The name of the place.
|
|
8
|
+
*/
|
|
9
|
+
name?: string;
|
|
10
|
+
/**
|
|
11
|
+
* Logo image URL.
|
|
12
|
+
*/
|
|
13
|
+
logoImage?: string;
|
|
14
|
+
/**
|
|
15
|
+
* A description of the place.
|
|
16
|
+
*/
|
|
17
|
+
description?: string;
|
|
18
|
+
/**
|
|
19
|
+
* Links to show. Links can optionally be named. Unnamed links will show up as the link URL.
|
|
20
|
+
*/
|
|
21
|
+
links?: {
|
|
22
|
+
url: string;
|
|
23
|
+
name?: string;
|
|
24
|
+
}[];
|
|
25
|
+
/**
|
|
26
|
+
* Image URLs to show in the hero gallery at the top of the card.
|
|
27
|
+
*/
|
|
28
|
+
heroImages?: string[];
|
|
29
|
+
/**
|
|
30
|
+
* Categories to show in the card.
|
|
31
|
+
*/
|
|
32
|
+
categories?: {
|
|
33
|
+
id: string;
|
|
34
|
+
name: string;
|
|
35
|
+
}[];
|
|
36
|
+
/**
|
|
37
|
+
* Callback when the close button is clicked.
|
|
38
|
+
*/
|
|
39
|
+
onClose?: () => void;
|
|
40
|
+
/**
|
|
41
|
+
* Callback when the directions button is clicked.
|
|
42
|
+
*/
|
|
43
|
+
onDirectionsClick?: (e: TOnClickOrPressPayload) => void;
|
|
44
|
+
/**
|
|
45
|
+
* Callback when the full screen gallery is opened.
|
|
46
|
+
*/
|
|
47
|
+
onFullScreenGalleryOpen?: () => void;
|
|
48
|
+
/**
|
|
49
|
+
* Callback when a link is clicked. The link itself will open by default in a new tab. This
|
|
50
|
+
* callback can be used to handle an extra functionality, e.g. analytics.
|
|
51
|
+
*/
|
|
52
|
+
onLinkClick?: (url: string) => void;
|
|
53
|
+
/**
|
|
54
|
+
* Callback when the location link is clicked to copy a deep link to the location.
|
|
55
|
+
*/
|
|
56
|
+
onCopyLocationLink?: () => void;
|
|
57
|
+
/**
|
|
58
|
+
* Optionally disable the directions button.
|
|
59
|
+
*/
|
|
60
|
+
directionsButtonDisabled?: boolean;
|
|
61
|
+
/**
|
|
62
|
+
* Whether to use the image proxy to resize the images, defaults to true.
|
|
63
|
+
*/
|
|
64
|
+
proxyImages?: boolean;
|
|
65
|
+
};
|
|
66
|
+
export declare const useMetadataCard: (options: TMetadataCardProps) => {
|
|
67
|
+
heroImageURLs: (Pick<string[], 0> & string[]) | null;
|
|
68
|
+
categoriesList: (Pick<{
|
|
69
|
+
id: string;
|
|
70
|
+
name: string;
|
|
71
|
+
}[], 0> & {
|
|
72
|
+
id: string;
|
|
73
|
+
name: string;
|
|
74
|
+
}[]) | null;
|
|
75
|
+
};
|
|
@@ -16,6 +16,12 @@ declare class HighResCanvas {
|
|
|
16
16
|
private enabled;
|
|
17
17
|
private frameCallback;
|
|
18
18
|
constructor(container: HTMLElement, frameCallback?: TCanvasFrameCallback, options?: THighResCanvasOptions);
|
|
19
|
+
private handleResize;
|
|
20
|
+
/**
|
|
21
|
+
* Update the canvas resolution to account for high DPR devices. DPR lower than 1 should work
|
|
22
|
+
* fine, but higher DPR's could cause blurriness without scaling.
|
|
23
|
+
*/
|
|
24
|
+
private updateCanvasResolution;
|
|
19
25
|
/**
|
|
20
26
|
* Scale the canvas whenever the container is resized.
|
|
21
27
|
*/
|
package/package.json
CHANGED