@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 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 = "phc_sRrjUwz9zicl4GeXtSnwcuKMr50SB76ma6NVi6zlPou", t = "https://ph-api.mappedin.com";
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.com", a = g5e[e], s = encodeURIComponent(i);
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 ?? "zixaliyV5cGjHU", r = {
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
- top: calc(50% - 10px);
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
- top: calc(50% - 10px);
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 = ({ size: i, onNext: e, onPrevious: t, backgroundStyle: r = {}, tabIndex: n }) => {
93901
- const a = nt();
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: `${a.colors.background.inverted}${Zh(0.25)}`,
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: `${a.colors.background.inverted}${Zh(0.25)}`,
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 = ({ imageURLs: i, onFullScreenGalleryOpen: e, proxy: t }) => {
94828
- const { fullscreenRootRef: r, isMobile: n } = Yt(), {
94829
- imgIndex: a,
94830
- previousImage: s,
94831
- nextImage: o,
94832
- setImgIndex: l,
94833
- currentImageSources: u,
94834
- showNavigationControls: c,
94835
- handleKeyDown: h,
94836
- allowFullscreenImages: p,
94837
- handleCarouselClick: f,
94838
- fullscreen: m,
94839
- handleCloseFullscreen: y,
94840
- wrapperRef: g
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: i,
94843
- onFullScreenGalleryOpen: e,
94844
- proxy: t
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: g, $mobile: n, children: /* @__PURE__ */ Z.jsxs("div", { className: "focus-wrapper", tabIndex: 0, onKeyDown: h, children: [
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: f,
94874
+ onClick: C,
94853
94875
  style: {
94854
94876
  display: "block",
94855
94877
  borderRadius: "8px 8px 0 0",
94856
- cursor: p ? "pointer" : "auto"
94878
+ cursor: g ? "pointer" : "auto"
94857
94879
  },
94858
- children: u ? /* @__PURE__ */ Z.jsx(
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: [u.medium ?? "", u.original]
94885
+ src: [f.medium ?? "", f.original]
94864
94886
  }
94865
94887
  ) : null
94866
94888
  }
94867
94889
  ),
94868
- (r == null ? void 0 : r.current) != null ? DC.createPortal(
94869
- /* @__PURE__ */ Z.jsxs(Ame, { $visible: m, children: [
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: u == null ? void 0 : u.original,
94897
+ src: f == null ? void 0 : f.original,
94875
94898
  style: {
94876
94899
  background: "transparent",
94877
- maxWidth: n ? "100%" : "80%",
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
- c ? (
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: i.length,
94892
- activeIndex: a,
94893
- onClick: l
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: n ? 24 : 36,
94901
- onNext: o,
94902
- onPrevious: s,
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: y, children: /* @__PURE__ */ Z.jsx(ti, { icon: "close-16x16", width: 24, height: 24, color: "#ffffff" }) })
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
- r.current
94934
+ o.current
94912
94935
  ) : null,
94913
- c ? /* @__PURE__ */ Z.jsxs(Z.Fragment, { children: [
94914
- /* @__PURE__ */ Z.jsx(ae2, { size: 24, onNext: o, onPrevious: s, tabIndex: -1 }),
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: i.length,
94920
- activeIndex: a,
94921
- onClick: l,
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(Dme, { imageURLs: r, onFullScreenGalleryOpen: s }) : null,
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;
@@ -3,6 +3,7 @@ type TLogoBoxProps = {
3
3
  height?: number;
4
4
  proxy?: boolean;
5
5
  padding?: number;
6
+ boxShadow?: boolean;
6
7
  };
7
8
  declare const LogoBox: React.FC<TLogoBoxProps>;
8
9
  export default LogoBox;
@@ -0,0 +1,3 @@
1
+ import { TMetadataCardProps } from './utils';
2
+ declare const MetadataCard: React.FC<TMetadataCardProps>;
3
+ export default MetadataCard;
@@ -0,0 +1,3 @@
1
+ export declare const Default: () => import("react").JSX.Element;
2
+ export declare const NoHero: () => import("react").JSX.Element;
3
+ export declare const LongName: () => import("react").JSX.Element;
@@ -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
+ };
@@ -72,6 +72,7 @@ export type TTheme = {
72
72
  font: string;
73
73
  borderRadius: {
74
74
  primary: number;
75
+ large: number;
75
76
  };
76
77
  fontSize: {
77
78
  xsmall: number;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mappedin/viewer",
3
- "version": "0.32.1",
3
+ "version": "0.32.2-79d5869.0",
4
4
  "type": "module",
5
5
  "browser": "./dist/index.js",
6
6
  "license": "UNLICENSED",