@mappedin/viewer 0.32.3-e35e716.0 → 0.33.1-6ec9e1e.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/CHANGELOG.md +7 -0
- package/dist/index.js +53 -29
- package/dist/types/src/components/async-image/index.d.ts +1 -0
- package/dist/types/src/components/card-item/index.d.ts +1 -0
- package/dist/types/src/components/directions/full-width-directions-button.d.ts +8 -0
- package/dist/types/src/components/link-item/index.d.ts +6 -1
- package/dist/types/src/components/link-item/utils.d.ts +1 -1
- package/dist/types/src/components/metadata-card/metadata-card.stories.d.ts +4 -1
- package/dist/types/src/components/metadata-card/utils.d.ts +18 -1
- package/dist/types/src/components/with-divider/index.d.ts +7 -0
- package/dist/types/src/lib/types/theme.d.ts +1 -0
- package/package.json +2 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,12 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [0.33.0](https://github.com/MappedIn/viewer/compare/viewer-v0.32.2...viewer-v0.33.0) (2025-01-22)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Features
|
|
7
|
+
|
|
8
|
+
* **SRV-1888:** allow fetching data with a custom token endpoint ([#389](https://github.com/MappedIn/viewer/issues/389)) ([e35e716](https://github.com/MappedIn/viewer/commit/e35e71696909826fb16ba1b831ae64df77578826))
|
|
9
|
+
|
|
3
10
|
## [0.32.2](https://github.com/MappedIn/viewer/compare/viewer-v0.32.1...viewer-v0.32.2) (2025-01-16)
|
|
4
11
|
|
|
5
12
|
|
package/dist/index.js
CHANGED
|
@@ -9477,7 +9477,8 @@ const f0 = new UV2("[Mappedin Viewer]"), sD = {}, xi2 = (i) => i.startsWith("htt
|
|
|
9477
9477
|
},
|
|
9478
9478
|
borderRadius: {
|
|
9479
9479
|
primary: 4,
|
|
9480
|
-
large: 8
|
|
9480
|
+
large: 8,
|
|
9481
|
+
small: 2
|
|
9481
9482
|
},
|
|
9482
9483
|
fontWeight: {
|
|
9483
9484
|
light: 300,
|
|
@@ -70564,12 +70565,13 @@ const p3e = (i, e) => {
|
|
|
70564
70565
|
return e;
|
|
70565
70566
|
}, Qt = (...i) => i.join("-").replaceAll(" ", "-").toLowerCase(), uA = m6`
|
|
70566
70567
|
--outline-width: ${(i) => i.$outlineWidth ?? 2}px;
|
|
70567
|
-
outline: var(--outline-width)
|
|
70568
|
-
|
|
70568
|
+
--outline-offset: ${(i) => i.$outlineOffset ?? "calc(-1 * var(--outline-width))"}px;
|
|
70569
|
+
--outline-color: ${(i) => {
|
|
70569
70570
|
var e;
|
|
70570
70571
|
return i.$outlineColor ?? I7((e = i.theme) == null ? void 0 : e.colors.accent.primary, "#FFFFFF", 0.5);
|
|
70571
70572
|
}};
|
|
70572
|
-
outline
|
|
70573
|
+
outline: var(--outline-width) solid var(--outline-color);
|
|
70574
|
+
outline-offset: var(--outline-offset);
|
|
70573
70575
|
`, ZL2 = (i) => `coordinate-${Joe(i)}`, UL2 = (i) => {
|
|
70574
70576
|
switch (i) {
|
|
70575
70577
|
case L0.START:
|
|
@@ -71148,6 +71150,26 @@ uA}
|
|
|
71148
71150
|
stroke: "none"
|
|
71149
71151
|
}
|
|
71150
71152
|
) })
|
|
71153
|
+
],
|
|
71154
|
+
[
|
|
71155
|
+
"globe-30x30",
|
|
71156
|
+
/* @__PURE__ */ Z.jsx("svg", { viewBox: "0 0 30 30", stroke: "none", children: /* @__PURE__ */ Z.jsx(
|
|
71157
|
+
"path",
|
|
71158
|
+
{
|
|
71159
|
+
d: "M15 0C12.0333 0 9.13319 0.879735 6.66645 2.52796C4.19971 4.17618 2.27713 6.51886 1.14181 9.25975C0.00649927 12.0006 -0.290551 15.0166 0.288228 17.9264C0.867006 20.8361 2.29562 23.5088 4.3934 25.6066C6.49119 27.7044 9.16394 29.133 12.0736 29.7118C14.9834 30.2906 17.9994 29.9935 20.7403 28.8582C23.4811 27.7229 25.8238 25.8003 27.472 23.3335C29.1203 20.8668 30 17.9667 30 15C29.9954 11.0232 28.4136 7.21051 25.6015 4.39846C22.7895 1.5864 18.9768 0.00458074 15 0ZM27.6923 15C27.6933 16.1705 27.5317 17.3355 27.212 18.4615H21.6577C22.0115 16.1674 22.0115 13.8326 21.6577 11.5385H27.212C27.5317 12.6645 27.6933 13.8295 27.6923 15ZM11.25 20.7692H18.75C18.0111 23.1903 16.7284 25.4103 15 27.2596C13.2722 25.4098 11.9896 23.1899 11.25 20.7692ZM10.6875 18.4615C10.2914 16.1708 10.2914 13.8292 10.6875 11.5385H19.324C19.7202 13.8292 19.7202 16.1708 19.324 18.4615H10.6875ZM2.3077 15C2.30669 13.8295 2.46834 12.6645 2.78799 11.5385H8.34231C7.98846 13.8326 7.98846 16.1674 8.34231 18.4615H2.78799C2.46834 17.3355 2.30669 16.1705 2.3077 15ZM18.75 9.23077H11.25C11.9889 6.80972 13.2716 4.58968 15 2.74038C16.7278 4.59017 18.0104 6.81005 18.75 9.23077ZM26.2976 9.23077H21.1601C20.5126 6.85515 19.4213 4.62357 17.9438 2.65385C19.7289 3.08269 21.4002 3.89247 22.8431 5.02768C24.2861 6.16289 25.4664 7.59668 26.3034 9.23077H26.2976ZM12.0563 2.65385C10.5788 4.62357 9.48743 6.85515 8.83991 9.23077H3.69664C4.53357 7.59668 5.71395 6.16289 7.15686 5.02768C8.59977 3.89247 10.2711 3.08269 12.0563 2.65385ZM3.69664 20.7692H8.83991C9.48743 23.1448 10.5788 25.3764 12.0563 27.3461C10.2711 26.9173 8.59977 26.1075 7.15686 24.9723C5.71395 23.8371 4.53357 22.4033 3.69664 20.7692ZM17.9438 27.3461C19.4213 25.3764 20.5126 23.1448 21.1601 20.7692H26.3034C25.4664 22.4033 24.2861 23.8371 22.8431 24.9723C21.4002 26.1075 19.7289 26.9173 17.9438 27.3461Z",
|
|
71160
|
+
stroke: "none"
|
|
71161
|
+
}
|
|
71162
|
+
) })
|
|
71163
|
+
],
|
|
71164
|
+
[
|
|
71165
|
+
"phone-30x30",
|
|
71166
|
+
/* @__PURE__ */ Z.jsx("svg", { viewBox: "0 0 30 30", stroke: "none", children: /* @__PURE__ */ Z.jsx(
|
|
71167
|
+
"path",
|
|
71168
|
+
{
|
|
71169
|
+
d: "M28.5557 20.1689L21.4892 17.0024L21.4697 16.9934C21.1028 16.8365 20.7026 16.7735 20.3053 16.8102C19.908 16.8468 19.5261 16.982 19.1942 17.2034C19.1551 17.2292 19.1175 17.2572 19.0817 17.2874L15.4306 20.3999C13.1176 19.2764 10.7296 16.9064 9.60608 14.6233L12.7231 10.9168C12.7531 10.8793 12.7816 10.8418 12.8086 10.8013C13.0252 10.4703 13.1567 10.0908 13.1912 9.69665C13.2258 9.30252 13.1624 8.90597 13.0066 8.54228V8.52428L9.83108 1.44571C9.62519 0.970603 9.27117 0.574825 8.82186 0.317457C8.37255 0.0600899 7.85205 -0.0450626 7.33807 0.0176966C5.30551 0.285159 3.43981 1.28336 2.08943 2.82587C0.73905 4.36837 -0.00366142 6.34969 1.35731e-05 8.39978C1.35731e-05 20.3099 9.69008 30 21.6002 30C23.6502 30.0037 25.6316 29.2609 27.1741 27.9106C28.7166 26.5602 29.7148 24.6945 29.9822 22.6619C30.0451 22.1481 29.9402 21.6277 29.6831 21.1784C29.426 20.7292 29.0305 20.375 28.5557 20.1689ZM21.6002 27.6C16.5097 27.5944 11.6293 25.5697 8.02976 21.9702C4.43024 18.3707 2.40559 13.4903 2.40003 8.39978C2.39439 6.935 2.92211 5.51824 3.88465 4.4141C4.84718 3.30995 6.17871 2.59392 7.63057 2.39972C7.62998 2.4057 7.62998 2.41173 7.63057 2.41772L10.7806 9.46779L7.68007 13.1788C7.6486 13.215 7.62001 13.2537 7.59457 13.2943C7.36884 13.6407 7.23642 14.0395 7.21014 14.4521C7.18386 14.8647 7.26461 15.2771 7.44457 15.6493C8.80358 18.4289 11.6041 21.2084 14.4136 22.5659C14.7886 22.7442 15.2033 22.8221 15.6174 22.7922C16.0315 22.7622 16.4308 22.6253 16.7761 22.3949C16.8146 22.369 16.8517 22.3409 16.8871 22.3109L20.5337 19.1999L27.5837 22.3574C27.5837 22.3574 27.5957 22.3574 27.6002 22.3574C27.4084 23.8113 26.6934 25.1455 25.5891 26.1105C24.4847 27.0754 23.0667 27.6049 21.6002 27.6Z",
|
|
71170
|
+
stroke: "none"
|
|
71171
|
+
}
|
|
71172
|
+
) })
|
|
71151
71173
|
]
|
|
71152
71174
|
]), D3e = le.div`
|
|
71153
71175
|
width: ${(i) => i.width}px;
|
|
@@ -94062,42 +94084,44 @@ const lA2 = le.div`
|
|
|
94062
94084
|
position: absolute;
|
|
94063
94085
|
z-index: 99;
|
|
94064
94086
|
}
|
|
94065
|
-
`, Qfe = (i) => {
|
|
94066
|
-
const
|
|
94087
|
+
`, Qfe = (i, { onError: e } = {}) => {
|
|
94088
|
+
const t = (Array.isArray(i) ? i : [i]).filter((m) => mr(m) && m.length > 0), [r, n] = w2.useState(0), [a, s] = w2.useState(!1), [o, l] = w2.useState(!1), [u, c] = w2.useState(!1), [h, p] = w2.useState(null), f = () => {
|
|
94089
|
+
l(!0), e == null || e();
|
|
94090
|
+
};
|
|
94067
94091
|
return w2.useEffect(() => {
|
|
94068
|
-
const
|
|
94069
|
-
if (
|
|
94070
|
-
|
|
94092
|
+
const m = t[r];
|
|
94093
|
+
if (m == null || m.length === 0) {
|
|
94094
|
+
s(!0), f();
|
|
94071
94095
|
return;
|
|
94072
94096
|
}
|
|
94073
|
-
|
|
94074
|
-
const
|
|
94075
|
-
|
|
94076
|
-
|
|
94077
|
-
},
|
|
94078
|
-
|
|
94097
|
+
s(!1);
|
|
94098
|
+
const y = new Image();
|
|
94099
|
+
y.src = m, y.onload = () => {
|
|
94100
|
+
c(!0), s(!0);
|
|
94101
|
+
}, y.onerror = () => {
|
|
94102
|
+
f();
|
|
94079
94103
|
}, (async () => {
|
|
94080
|
-
const
|
|
94081
|
-
|
|
94104
|
+
const C = await nS2(m);
|
|
94105
|
+
p(C);
|
|
94082
94106
|
})();
|
|
94083
|
-
}, [i,
|
|
94084
|
-
|
|
94085
|
-
}, [
|
|
94086
|
-
}, ue2 = ({ src: i, alt: e, style: t, role: r }) => {
|
|
94087
|
-
const { loaded:
|
|
94107
|
+
}, [i, r]), w2.useEffect(() => {
|
|
94108
|
+
o && r < t.length - 1 && (f0.warn(`Failed to load image at '${t[r]}'! Trying '${t[r + 1]}'...`), n(r + 1), l(!1));
|
|
94109
|
+
}, [o]), { loaded: a, error: o, initialized: u, averageColor: h, imgSrc: t[r] };
|
|
94110
|
+
}, ue2 = ({ src: i, alt: e, style: t, role: r, onError: n }) => {
|
|
94111
|
+
const { loaded: a, error: s, initialized: o, averageColor: l, imgSrc: u } = Qfe(i, { onError: n }), h = nt().colors.background.primary, p = WU(l ?? "black") ? tS2 : iS2, f = a ? p : h, { width: m, height: y, refFn: g } = nO();
|
|
94088
94112
|
return /* @__PURE__ */ Z.jsxs(
|
|
94089
94113
|
Jfe,
|
|
94090
94114
|
{
|
|
94091
94115
|
style: {
|
|
94092
|
-
background:
|
|
94093
|
-
width:
|
|
94094
|
-
height:
|
|
94116
|
+
background: f,
|
|
94117
|
+
width: m > 0 ? Math.floor(m) : "100%",
|
|
94118
|
+
height: y > 0 ? Math.floor(y) : "100%",
|
|
94095
94119
|
...t
|
|
94096
94120
|
},
|
|
94097
|
-
$blur:
|
|
94121
|
+
$blur: o && !a,
|
|
94098
94122
|
children: [
|
|
94099
|
-
|
|
94100
|
-
!
|
|
94123
|
+
s ? null : /* @__PURE__ */ Z.jsx("img", { loading: "lazy", src: u, alt: e, ref: g, role: r }),
|
|
94124
|
+
!a && !s && !o ? /* @__PURE__ */ Z.jsx("div", { className: "spinner-wrapper", children: /* @__PURE__ */ Z.jsx(vW, { color: "#cccccc", size: 40 }) }) : null
|
|
94101
94125
|
]
|
|
94102
94126
|
}
|
|
94103
94127
|
);
|
|
@@ -96690,7 +96714,7 @@ const Fge = ({ color: i = bl.color, changeFrequency: e = bl.changeFrequency, rad
|
|
|
96690
96714
|
] });
|
|
96691
96715
|
}), TA2 = () => {
|
|
96692
96716
|
let i = document.querySelector("meta[name=app-version]");
|
|
96693
|
-
i == null && (i = document.createElement("meta"), i.name = "app-version", document.head.appendChild(i)), i.content = "0.
|
|
96717
|
+
i == null && (i = document.createElement("meta"), i.name = "app-version", document.head.appendChild(i)), i.content = "0.33.0";
|
|
96694
96718
|
let e = document.querySelector("meta[name=viewport]");
|
|
96695
96719
|
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";
|
|
96696
96720
|
}, PA2 = (i) => {
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { TOnClickOrPressPayload } from '../button';
|
|
2
|
+
type TDirectionsButtonProps = {
|
|
3
|
+
onClick?: (e: TOnClickOrPressPayload) => void;
|
|
4
|
+
disabled?: boolean;
|
|
5
|
+
disabledHoverText?: string;
|
|
6
|
+
};
|
|
7
|
+
declare const FullWidthDirectionsButton: React.FC<TDirectionsButtonProps>;
|
|
8
|
+
export default FullWidthDirectionsButton;
|
|
@@ -1,6 +1,11 @@
|
|
|
1
|
-
type
|
|
1
|
+
type TLinkItemWithURLProps = {
|
|
2
2
|
url: string;
|
|
3
3
|
name?: string;
|
|
4
|
+
};
|
|
5
|
+
type TLinkItemWithPhoneNumberProps = {
|
|
6
|
+
phoneNumber: string;
|
|
7
|
+
};
|
|
8
|
+
type TLinkItemProps = (TLinkItemWithURLProps | TLinkItemWithPhoneNumberProps) & {
|
|
4
9
|
/**
|
|
5
10
|
* Optionally override the icon. Defaults to `link-2-16x16`.
|
|
6
11
|
*/
|
|
@@ -1,3 +1,6 @@
|
|
|
1
1
|
export declare const Default: () => import("react").JSX.Element;
|
|
2
2
|
export declare const NoHero: () => import("react").JSX.Element;
|
|
3
|
-
export declare const
|
|
3
|
+
export declare const NoLogo: () => import("react").JSX.Element;
|
|
4
|
+
export declare const NoHeroNoLogo: () => import("react").JSX.Element;
|
|
5
|
+
export declare const NoDetails: () => import("react").JSX.Element;
|
|
6
|
+
export declare const LongContent: () => import("react").JSX.Element;
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
+
import { ComponentProps } from 'react';
|
|
1
2
|
import { TOnClickOrPressPayload } from '../button';
|
|
3
|
+
import SocialsItem from '../socials-item';
|
|
2
4
|
export declare const METADATA_CARD_WIDTH = 320;
|
|
3
5
|
export declare const METADATA_CARD_PADDING = 20;
|
|
4
6
|
export declare const HERO_IMAGE_HEIGHT = 200;
|
|
@@ -16,12 +18,27 @@ export type TMetadataCardProps = {
|
|
|
16
18
|
*/
|
|
17
19
|
description?: string;
|
|
18
20
|
/**
|
|
19
|
-
*
|
|
21
|
+
* Main website URL.
|
|
22
|
+
*/
|
|
23
|
+
website?: {
|
|
24
|
+
url: string;
|
|
25
|
+
name?: string;
|
|
26
|
+
};
|
|
27
|
+
/**
|
|
28
|
+
* Other URLs to show. Links can optionally be named. Unnamed links will show up as the link URL.
|
|
20
29
|
*/
|
|
21
30
|
links?: {
|
|
22
31
|
url: string;
|
|
23
32
|
name?: string;
|
|
24
33
|
}[];
|
|
34
|
+
/**
|
|
35
|
+
* Phone number to show.
|
|
36
|
+
*/
|
|
37
|
+
phoneNumber?: string;
|
|
38
|
+
/**
|
|
39
|
+
* Social media URLs to show.
|
|
40
|
+
*/
|
|
41
|
+
socialUrls?: ComponentProps<typeof SocialsItem>['socialUrls'];
|
|
25
42
|
/**
|
|
26
43
|
* Image URLs to show in the hero gallery at the top of the card.
|
|
27
44
|
*/
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mappedin/viewer",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.33.1-6ec9e1e.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"browser": "./dist/index.js",
|
|
6
6
|
"license": "UNLICENSED",
|
|
@@ -56,6 +56,7 @@
|
|
|
56
56
|
"mockdate": "^3.0.5",
|
|
57
57
|
"node-fetch": "^3.3.2",
|
|
58
58
|
"object-hash": "^3.0.0",
|
|
59
|
+
"phone": "^3.1.57",
|
|
59
60
|
"posthog-js": "1.181.0",
|
|
60
61
|
"react": "18.3.1",
|
|
61
62
|
"react-dom": "18.3.1",
|