@mappedin/viewer 0.32.1 → 0.32.2-79d5869.0
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/index.js +91 -52
- 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/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/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_vZrwt3z6JmdPnErvTgZoazTAGlCRMiz6c2NqWtBt8qz", 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) {
|
|
@@ -75035,7 +75036,7 @@ const f5e = (i, e) => (F4 != null || (cp == null && globalThis.OffscreenCanvas !
|
|
|
75035
75036
|
const r = {
|
|
75036
75037
|
fit: "fit",
|
|
75037
75038
|
...t
|
|
75038
|
-
}, n = "https://image-proxy.mappedin.
|
|
75039
|
+
}, n = "https://image-proxy-staging.mappedin.net", a = g5e[e], s = encodeURIComponent(i);
|
|
75039
75040
|
return `${n}/resize:${r.fit}:${a}:${a}:0/plain/${s}`.replaceAll(/\/+/g, "/").replace("/", "//");
|
|
75040
75041
|
}, GQ = le.div`
|
|
75041
75042
|
display: flex;
|
|
@@ -76510,7 +76511,7 @@ class N5e {
|
|
|
76510
76511
|
}
|
|
76511
76512
|
async init(e) {
|
|
76512
76513
|
this.container = e;
|
|
76513
|
-
const t = this.rootStore.startupOptions.outdoorMapsKey ?? "
|
|
76514
|
+
const t = this.rootStore.startupOptions.outdoorMapsKey ?? "f8fd42d9e1c2751f", r = {
|
|
76514
76515
|
auto: !1,
|
|
76515
76516
|
initialFloor: this.rootStore.currentFloor,
|
|
76516
76517
|
watermark: this.getWatermarkOptions(),
|
|
@@ -93884,7 +93885,9 @@ const tA2 = le.div`
|
|
|
93884
93885
|
|
|
93885
93886
|
&&.left {
|
|
93886
93887
|
left: 10px;
|
|
93887
|
-
|
|
93888
|
+
// Center the chevron vertically
|
|
93889
|
+
top: calc(50% - ${(i) => i.$offsetY ?? 0}px);
|
|
93890
|
+
transform: translateY(-50%);
|
|
93888
93891
|
&& svg {
|
|
93889
93892
|
transform: rotate(90deg);
|
|
93890
93893
|
}
|
|
@@ -93892,19 +93895,29 @@ const tA2 = le.div`
|
|
|
93892
93895
|
|
|
93893
93896
|
&&.right {
|
|
93894
93897
|
right: 10px;
|
|
93895
|
-
|
|
93898
|
+
// Center the chevron vertically
|
|
93899
|
+
top: calc(50% - ${(i) => i.$offsetY ?? 0}px);
|
|
93900
|
+
transform: translateY(-50%);
|
|
93896
93901
|
&& svg {
|
|
93897
93902
|
transform: rotate(-90deg);
|
|
93898
93903
|
}
|
|
93899
93904
|
}
|
|
93900
|
-
`, ae2 = ({
|
|
93901
|
-
|
|
93905
|
+
`, ae2 = ({
|
|
93906
|
+
size: i,
|
|
93907
|
+
onNext: e,
|
|
93908
|
+
onPrevious: t,
|
|
93909
|
+
backgroundStyle: r = {},
|
|
93910
|
+
tabIndex: n,
|
|
93911
|
+
offsetY: a
|
|
93912
|
+
}) => {
|
|
93913
|
+
const s = nt();
|
|
93902
93914
|
return /* @__PURE__ */ Z.jsxs(Z.Fragment, { children: [
|
|
93903
93915
|
/* @__PURE__ */ Z.jsx(
|
|
93904
93916
|
s7,
|
|
93905
93917
|
{
|
|
93918
|
+
$offsetY: a,
|
|
93906
93919
|
style: {
|
|
93907
|
-
backgroundColor: `${
|
|
93920
|
+
backgroundColor: `${s.colors.background.inverted}${Zh(0.25)}`,
|
|
93908
93921
|
...r
|
|
93909
93922
|
},
|
|
93910
93923
|
className: "left",
|
|
@@ -93916,8 +93929,9 @@ const tA2 = le.div`
|
|
|
93916
93929
|
/* @__PURE__ */ Z.jsx(
|
|
93917
93930
|
s7,
|
|
93918
93931
|
{
|
|
93932
|
+
$offsetY: a,
|
|
93919
93933
|
style: {
|
|
93920
|
-
backgroundColor: `${
|
|
93934
|
+
backgroundColor: `${s.colors.background.inverted}${Zh(0.25)}`,
|
|
93921
93935
|
...r
|
|
93922
93936
|
},
|
|
93923
93937
|
className: "right",
|
|
@@ -94824,63 +94838,72 @@ const bme = (i) => {
|
|
|
94824
94838
|
img {
|
|
94825
94839
|
object-fit: contain;
|
|
94826
94840
|
}
|
|
94827
|
-
`, Dme = ({
|
|
94828
|
-
|
|
94829
|
-
|
|
94830
|
-
|
|
94831
|
-
|
|
94832
|
-
|
|
94833
|
-
|
|
94834
|
-
|
|
94835
|
-
|
|
94836
|
-
|
|
94837
|
-
|
|
94838
|
-
|
|
94839
|
-
|
|
94840
|
-
|
|
94841
|
+
`, Dme = ({
|
|
94842
|
+
children: i,
|
|
94843
|
+
imageURLs: e,
|
|
94844
|
+
onFullScreenGalleryOpen: t,
|
|
94845
|
+
proxy: r,
|
|
94846
|
+
width: n,
|
|
94847
|
+
height: a,
|
|
94848
|
+
navChevronOffsetY: s
|
|
94849
|
+
}) => {
|
|
94850
|
+
const { fullscreenRootRef: o, isMobile: l } = Yt(), {
|
|
94851
|
+
imgIndex: u,
|
|
94852
|
+
previousImage: c,
|
|
94853
|
+
nextImage: h,
|
|
94854
|
+
setImgIndex: p,
|
|
94855
|
+
currentImageSources: f,
|
|
94856
|
+
showNavigationControls: m,
|
|
94857
|
+
handleKeyDown: y,
|
|
94858
|
+
allowFullscreenImages: g,
|
|
94859
|
+
handleCarouselClick: C,
|
|
94860
|
+
fullscreen: x,
|
|
94861
|
+
handleCloseFullscreen: _,
|
|
94862
|
+
wrapperRef: w
|
|
94841
94863
|
} = Mme({
|
|
94842
|
-
imageURLs:
|
|
94843
|
-
onFullScreenGalleryOpen:
|
|
94844
|
-
proxy:
|
|
94864
|
+
imageURLs: e,
|
|
94865
|
+
onFullScreenGalleryOpen: t,
|
|
94866
|
+
proxy: r
|
|
94845
94867
|
});
|
|
94846
94868
|
return (
|
|
94847
94869
|
// 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:
|
|
94870
|
+
/* @__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
94871
|
/* @__PURE__ */ Z.jsx(
|
|
94850
94872
|
"div",
|
|
94851
94873
|
{
|
|
94852
|
-
onClick:
|
|
94874
|
+
onClick: C,
|
|
94853
94875
|
style: {
|
|
94854
94876
|
display: "block",
|
|
94855
94877
|
borderRadius: "8px 8px 0 0",
|
|
94856
|
-
cursor:
|
|
94878
|
+
cursor: g ? "pointer" : "auto"
|
|
94857
94879
|
},
|
|
94858
|
-
children:
|
|
94880
|
+
children: f ? /* @__PURE__ */ Z.jsx(
|
|
94859
94881
|
se2,
|
|
94860
94882
|
{
|
|
94861
|
-
style: { width: "100%", height: 180 },
|
|
94883
|
+
style: { width: n ?? "100%", height: a ?? 180 },
|
|
94862
94884
|
role: "option",
|
|
94863
|
-
src: [
|
|
94885
|
+
src: [f.medium ?? "", f.original]
|
|
94864
94886
|
}
|
|
94865
94887
|
) : null
|
|
94866
94888
|
}
|
|
94867
94889
|
),
|
|
94868
|
-
|
|
94869
|
-
|
|
94890
|
+
i,
|
|
94891
|
+
(o == null ? void 0 : o.current) != null ? DC.createPortal(
|
|
94892
|
+
/* @__PURE__ */ Z.jsxs(Ame, { $visible: x, children: [
|
|
94870
94893
|
/* @__PURE__ */ Z.jsx(
|
|
94871
94894
|
se2,
|
|
94872
94895
|
{
|
|
94873
94896
|
role: "option",
|
|
94874
|
-
src:
|
|
94897
|
+
src: f == null ? void 0 : f.original,
|
|
94875
94898
|
style: {
|
|
94876
94899
|
background: "transparent",
|
|
94877
|
-
maxWidth:
|
|
94900
|
+
maxWidth: l ? "100%" : "80%",
|
|
94878
94901
|
maxHeight: "80%"
|
|
94879
94902
|
// Always leave room for the close button
|
|
94880
94903
|
}
|
|
94881
94904
|
}
|
|
94882
94905
|
),
|
|
94883
|
-
|
|
94906
|
+
m ? (
|
|
94884
94907
|
// These controls should not be directly focusable. Instead, the container should be focusable.
|
|
94885
94908
|
/* @__PURE__ */ Z.jsxs(Z.Fragment, { children: [
|
|
94886
94909
|
/* @__PURE__ */ Z.jsx("div", { className: "nav-wrapper", children: /* @__PURE__ */ Z.jsx(
|
|
@@ -94888,37 +94911,46 @@ const bme = (i) => {
|
|
|
94888
94911
|
{
|
|
94889
94912
|
tabIndex: -1,
|
|
94890
94913
|
size: 18,
|
|
94891
|
-
count:
|
|
94892
|
-
activeIndex:
|
|
94893
|
-
onClick:
|
|
94914
|
+
count: e.length,
|
|
94915
|
+
activeIndex: u,
|
|
94916
|
+
onClick: p
|
|
94894
94917
|
}
|
|
94895
94918
|
) }),
|
|
94896
94919
|
/* @__PURE__ */ Z.jsx(
|
|
94897
94920
|
ae2,
|
|
94898
94921
|
{
|
|
94899
94922
|
tabIndex: -1,
|
|
94900
|
-
size:
|
|
94901
|
-
onNext:
|
|
94902
|
-
onPrevious:
|
|
94923
|
+
size: l ? 24 : 36,
|
|
94924
|
+
onNext: h,
|
|
94925
|
+
onPrevious: c,
|
|
94903
94926
|
backgroundStyle: { background: "transparent", opacity: 0.4 }
|
|
94904
94927
|
}
|
|
94905
94928
|
)
|
|
94906
94929
|
] })
|
|
94907
94930
|
) : null,
|
|
94908
|
-
/* @__PURE__ */ Z.jsx(dS, { onClickOrPress:
|
|
94931
|
+
/* @__PURE__ */ Z.jsx(dS, { onClickOrPress: _, children: /* @__PURE__ */ Z.jsx(ti, { icon: "close-16x16", width: 24, height: 24, color: "#ffffff" }) })
|
|
94909
94932
|
] }),
|
|
94910
94933
|
// This is definitely defined because of the check for allowFullscreenImages
|
|
94911
|
-
|
|
94934
|
+
o.current
|
|
94912
94935
|
) : null,
|
|
94913
|
-
|
|
94914
|
-
/* @__PURE__ */ Z.jsx(
|
|
94936
|
+
m ? /* @__PURE__ */ Z.jsxs(Z.Fragment, { children: [
|
|
94937
|
+
/* @__PURE__ */ Z.jsx(
|
|
94938
|
+
ae2,
|
|
94939
|
+
{
|
|
94940
|
+
size: 24,
|
|
94941
|
+
onNext: h,
|
|
94942
|
+
onPrevious: c,
|
|
94943
|
+
tabIndex: -1,
|
|
94944
|
+
offsetY: s
|
|
94945
|
+
}
|
|
94946
|
+
),
|
|
94915
94947
|
/* @__PURE__ */ Z.jsx(Sme, { children: /* @__PURE__ */ Z.jsx(
|
|
94916
94948
|
ne2,
|
|
94917
94949
|
{
|
|
94918
94950
|
size: 16,
|
|
94919
|
-
count:
|
|
94920
|
-
activeIndex:
|
|
94921
|
-
onClick:
|
|
94951
|
+
count: e.length,
|
|
94952
|
+
activeIndex: u,
|
|
94953
|
+
onClick: p,
|
|
94922
94954
|
tabIndex: -1
|
|
94923
94955
|
}
|
|
94924
94956
|
) })
|
|
@@ -95226,7 +95258,14 @@ const bme = (i) => {
|
|
|
95226
95258
|
backgroundColor: u.colors.background.primary
|
|
95227
95259
|
},
|
|
95228
95260
|
children: [
|
|
95229
|
-
m ? /* @__PURE__ */ Z.jsx(
|
|
95261
|
+
m ? /* @__PURE__ */ Z.jsx(
|
|
95262
|
+
Dme,
|
|
95263
|
+
{
|
|
95264
|
+
navChevronOffsetY: -20,
|
|
95265
|
+
imageURLs: r,
|
|
95266
|
+
onFullScreenGalleryOpen: s
|
|
95267
|
+
}
|
|
95268
|
+
) : null,
|
|
95230
95269
|
y ? /* @__PURE__ */ Z.jsx(
|
|
95231
95270
|
Vme,
|
|
95232
95271
|
{
|
|
@@ -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
|
+
};
|
package/package.json
CHANGED