@telia-ace/widget-ui 1.0.16 → 1.0.17
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/components/lightbox.d.ts +3 -2
- package/dist/components/loader.d.ts +1 -0
- package/dist/index.d.ts +2 -2
- package/dist/index.js +509 -314
- package/dist/index.js.map +1 -1
- package/dist/utils/index.d.ts +1 -1
- package/dist/utils/render-instructions.d.ts +2 -1
- package/package.json +5 -4
- package/dist/components/zoom-buttons.d.ts +0 -7
package/dist/index.js
CHANGED
|
@@ -327,14 +327,15 @@ function parseHtmlString(html, instruction) {
|
|
|
327
327
|
}
|
|
328
328
|
return convert(html);
|
|
329
329
|
}
|
|
330
|
-
const imageLightboxRenderer = (attrs) => /* @__PURE__ */ React.createElement(Lightbox, {
|
|
331
|
-
attrs
|
|
330
|
+
const imageLightboxRenderer = (htmlBody) => (attrs) => /* @__PURE__ */ React.createElement(Lightbox, {
|
|
331
|
+
attrs,
|
|
332
|
+
htmlBody
|
|
332
333
|
});
|
|
333
|
-
const defaultRenderInstructions = (container) => {
|
|
334
|
+
const defaultRenderInstructions = (container, htmlBody) => {
|
|
334
335
|
return {
|
|
335
336
|
transform: {
|
|
336
337
|
a: embeddedLinkMapper(container),
|
|
337
|
-
img: imageLightboxRenderer
|
|
338
|
+
img: imageLightboxRenderer(htmlBody)
|
|
338
339
|
}
|
|
339
340
|
};
|
|
340
341
|
};
|
|
@@ -343,14 +344,14 @@ const AnchorLink = (props) => {
|
|
|
343
344
|
};
|
|
344
345
|
var Button = forwardRef((_a, ref) => {
|
|
345
346
|
var _b = _a, { className, children } = _b, other = __objRest(_b, ["className", "children"]);
|
|
346
|
-
return /* @__PURE__ */ React.createElement(StyledButton
|
|
347
|
+
return /* @__PURE__ */ React.createElement(StyledButton, __spreadProps(__spreadValues({
|
|
347
348
|
type: "button",
|
|
348
349
|
className: appendClassNames(className, "humany-button")
|
|
349
350
|
}, convertToStringAttributes(other)), {
|
|
350
351
|
ref
|
|
351
352
|
}), children);
|
|
352
353
|
});
|
|
353
|
-
const StyledButton
|
|
354
|
+
const StyledButton = styled.button`
|
|
354
355
|
-webkit-appearance: button;
|
|
355
356
|
text-transform: none;
|
|
356
357
|
overflow: visible;
|
|
@@ -983,7 +984,7 @@ const paddedBorderTabStyle = css`
|
|
|
983
984
|
return (_a = p.theme.sizes) == null ? void 0 : _a.small;
|
|
984
985
|
}};
|
|
985
986
|
`;
|
|
986
|
-
const CloseButton
|
|
987
|
+
const CloseButton = styled(Button)`
|
|
987
988
|
position: absolute;
|
|
988
989
|
top: ${(p) => {
|
|
989
990
|
var _a;
|
|
@@ -1708,6 +1709,23 @@ const SymbolBadge = (_g) => {
|
|
|
1708
1709
|
fill: "white"
|
|
1709
1710
|
}));
|
|
1710
1711
|
}
|
|
1712
|
+
case "pagination-left": {
|
|
1713
|
+
return /* @__PURE__ */ React.createElement("svg", __spreadValues({
|
|
1714
|
+
viewBox: "0 0 24 24"
|
|
1715
|
+
}, svgProps), /* @__PURE__ */ React.createElement("path", {
|
|
1716
|
+
fillRule: "evenodd",
|
|
1717
|
+
clipRule: "evenodd",
|
|
1718
|
+
d: "M15.7935 18.7087C16.0092 18.9029 16.105 19.1974 16.0447 19.4813C15.9844 19.7652 15.7772 19.9954 15.5012 20.0852C15.2251 20.1749 14.9222 20.1105 14.7065 19.9164L6.58148 12.6039C6.41027 12.4498 6.3125 12.2303 6.3125 12C6.3125 11.7697 6.41027 11.5503 6.58148 11.3962L14.7065 4.08372C15.04 3.78354 15.5536 3.81054 15.8538 4.14402C16.154 4.4775 16.127 4.99119 15.7935 5.29136L8.33939 12L15.7935 18.7087Z",
|
|
1719
|
+
fill: "#222222"
|
|
1720
|
+
}));
|
|
1721
|
+
}
|
|
1722
|
+
case "pagination-right": {
|
|
1723
|
+
return /* @__PURE__ */ React.createElement("svg", __spreadValues({
|
|
1724
|
+
viewBox: "0 0 24 24"
|
|
1725
|
+
}, svgProps), /* @__PURE__ */ React.createElement("path", {
|
|
1726
|
+
d: "M285.476 272.971L91.132 467.314c-9.373 9.373-24.569 9.373-33.941 0l-22.667-22.667c-9.357-9.357-9.375-24.522-.04-33.901L188.505 256 34.484 101.255c-9.335-9.379-9.317-24.544.04-33.901l22.667-22.667c9.373-9.373 24.569-9.373 33.941 0L285.475 239.03c9.373 9.372 9.373 24.568.001 33.941z"
|
|
1727
|
+
}));
|
|
1728
|
+
}
|
|
1711
1729
|
}
|
|
1712
1730
|
return null;
|
|
1713
1731
|
}
|
|
@@ -1824,7 +1842,7 @@ const Drawer = ({
|
|
|
1824
1842
|
clientHeight: document.body.clientHeight,
|
|
1825
1843
|
css: css2,
|
|
1826
1844
|
ref
|
|
1827
|
-
}, /* @__PURE__ */ React.createElement(CloseButton
|
|
1845
|
+
}, /* @__PURE__ */ React.createElement(CloseButton, {
|
|
1828
1846
|
onClick: () => toggleVisible(false),
|
|
1829
1847
|
tabIndex: 0,
|
|
1830
1848
|
ref: closeButtonRef,
|
|
@@ -1844,7 +1862,7 @@ const Drawer = ({
|
|
|
1844
1862
|
"aria-expanded": visible
|
|
1845
1863
|
}));
|
|
1846
1864
|
};
|
|
1847
|
-
const Wrapper$
|
|
1865
|
+
const Wrapper$6 = styled.div`
|
|
1848
1866
|
font-family: ${(p) => {
|
|
1849
1867
|
var _a;
|
|
1850
1868
|
return (_a = p.theme.fonts) == null ? void 0 : _a.type;
|
|
@@ -1886,7 +1904,7 @@ const Header$1 = styled(Typography)`
|
|
|
1886
1904
|
const AnimationBase = css`
|
|
1887
1905
|
transition: ${(p) => p.duration}ms;
|
|
1888
1906
|
`;
|
|
1889
|
-
const WrapperWithSlideInBottom = styled(Wrapper$
|
|
1907
|
+
const WrapperWithSlideInBottom = styled(Wrapper$6)`
|
|
1890
1908
|
max-height: 0;
|
|
1891
1909
|
${AnimationBase}
|
|
1892
1910
|
|
|
@@ -1904,7 +1922,7 @@ const WrapperWithSlideInBottom = styled(Wrapper$7)`
|
|
|
1904
1922
|
max-height: 0;
|
|
1905
1923
|
}
|
|
1906
1924
|
`;
|
|
1907
|
-
const WrapperWithSlideInRight = styled(Wrapper$
|
|
1925
|
+
const WrapperWithSlideInRight = styled(Wrapper$6)`
|
|
1908
1926
|
${AnimationBase}
|
|
1909
1927
|
transform: translateX(100%);
|
|
1910
1928
|
height: ${(p) => p.fullScreen ? "100%" : "auto"};
|
|
@@ -1923,7 +1941,7 @@ const WrapperWithSlideInRight = styled(Wrapper$7)`
|
|
|
1923
1941
|
transform: translateX(100%);
|
|
1924
1942
|
}
|
|
1925
1943
|
`;
|
|
1926
|
-
const WrapperWithSlideInLeft = styled(Wrapper$
|
|
1944
|
+
const WrapperWithSlideInLeft = styled(Wrapper$6)`
|
|
1927
1945
|
${AnimationBase}
|
|
1928
1946
|
transform: translateX(-100%);
|
|
1929
1947
|
height: ${(p) => p.fullScreen ? "100%" : "auto"};
|
|
@@ -1942,7 +1960,7 @@ const WrapperWithSlideInLeft = styled(Wrapper$7)`
|
|
|
1942
1960
|
transform: translateX(-100%);
|
|
1943
1961
|
}
|
|
1944
1962
|
`;
|
|
1945
|
-
const WrapperWithSlideInTop = styled(Wrapper$
|
|
1963
|
+
const WrapperWithSlideInTop = styled(Wrapper$6)`
|
|
1946
1964
|
${AnimationBase}
|
|
1947
1965
|
bottom: unset;
|
|
1948
1966
|
top: 0;
|
|
@@ -2053,7 +2071,7 @@ const Dropdown = React.forwardRef((_i, ref) => {
|
|
|
2053
2071
|
x,
|
|
2054
2072
|
y,
|
|
2055
2073
|
ref: innerRef
|
|
2056
|
-
}), /* @__PURE__ */ React.createElement(CloseButton
|
|
2074
|
+
}), /* @__PURE__ */ React.createElement(CloseButton, {
|
|
2057
2075
|
onClick: () => setVisible(false),
|
|
2058
2076
|
tabIndex: 0,
|
|
2059
2077
|
ref: closeButtonRef,
|
|
@@ -2095,9 +2113,9 @@ const StyledDropdown = styled.div`
|
|
|
2095
2113
|
`;
|
|
2096
2114
|
const Empty = (_k) => {
|
|
2097
2115
|
var other = __objRest(_k, []);
|
|
2098
|
-
return /* @__PURE__ */ React.createElement(Wrapper$
|
|
2116
|
+
return /* @__PURE__ */ React.createElement(Wrapper$5, __spreadValues({}, other));
|
|
2099
2117
|
};
|
|
2100
|
-
const Wrapper$
|
|
2118
|
+
const Wrapper$5 = styled.div`
|
|
2101
2119
|
display: none;
|
|
2102
2120
|
`;
|
|
2103
2121
|
var grid = forwardRef((_l, ref) => {
|
|
@@ -2123,7 +2141,10 @@ var Html = forwardRef((_n, ref) => {
|
|
|
2123
2141
|
const container = useContainer();
|
|
2124
2142
|
const [processedHtml, setProcessedHtml] = useState();
|
|
2125
2143
|
useEffect(() => {
|
|
2126
|
-
const
|
|
2144
|
+
const defaultInstructions = defaultRenderInstructions(container, html);
|
|
2145
|
+
const instructions = __spreadProps(__spreadValues(__spreadValues({}, defaultInstructions), htmlParseInstruction), {
|
|
2146
|
+
transform: __spreadValues(__spreadValues({}, defaultInstructions.transform), htmlParseInstruction == null ? void 0 : htmlParseInstruction.transform)
|
|
2147
|
+
});
|
|
2127
2148
|
const processed = parseHtmlString(html, instructions);
|
|
2128
2149
|
setProcessedHtml(processed);
|
|
2129
2150
|
}, [html, htmlParseInstruction]);
|
|
@@ -2327,14 +2348,151 @@ const ItemTree = ({
|
|
|
2327
2348
|
className: appendClassNames(className, "humany-item-tree")
|
|
2328
2349
|
}, rootItem && rootItem(!hasSelectedChildren(tree || [])), tree && renderTreeItems(tree, 1));
|
|
2329
2350
|
};
|
|
2330
|
-
|
|
2331
|
-
var _A = _z, {
|
|
2351
|
+
var RouteLink = forwardRef((_z, forwardedRef) => {
|
|
2352
|
+
var _A = _z, { className, onClick = () => {
|
|
2353
|
+
}, name = "", to = "", params = {}, children } = _A, other = __objRest(_A, ["className", "onClick", "name", "to", "params", "children"]);
|
|
2354
|
+
const router = useRouter();
|
|
2355
|
+
const container = useContainer();
|
|
2356
|
+
if (!router) {
|
|
2357
|
+
return null;
|
|
2358
|
+
}
|
|
2359
|
+
let path = "";
|
|
2360
|
+
const props = __spreadProps(__spreadValues({
|
|
2361
|
+
onClick,
|
|
2362
|
+
className: appendClassNames(className, "humany-route-link"),
|
|
2363
|
+
to: path,
|
|
2364
|
+
innerRef: forwardedRef
|
|
2365
|
+
}, other), {
|
|
2366
|
+
ref: null
|
|
2367
|
+
});
|
|
2368
|
+
if (name) {
|
|
2369
|
+
const routes = router.routes || [];
|
|
2370
|
+
const route = routes.find((r) => r.name === name);
|
|
2371
|
+
if (!route) {
|
|
2372
|
+
return /* @__PURE__ */ React.createElement(Link$1, __spreadProps(__spreadValues({}, props), {
|
|
2373
|
+
onClick: (e) => {
|
|
2374
|
+
onClick(e);
|
|
2375
|
+
e.preventDefault();
|
|
2376
|
+
}
|
|
2377
|
+
}), children);
|
|
2378
|
+
}
|
|
2379
|
+
const encodedParams = Object.keys(params).reduce((acc, key) => {
|
|
2380
|
+
acc[key] = typeof params[key] === "string" ? encodeURIComponent(params[key]) : params[key];
|
|
2381
|
+
return acc;
|
|
2382
|
+
}, {});
|
|
2383
|
+
try {
|
|
2384
|
+
path = router.generate(name, encodedParams || {});
|
|
2385
|
+
} catch (e) {
|
|
2386
|
+
return /* @__PURE__ */ React.createElement(Link$1, __spreadValues({}, props), children);
|
|
2387
|
+
}
|
|
2388
|
+
if (path && router.settings.mode && router.settings.mode === HistoryMode.browser && path[0] !== "/") {
|
|
2389
|
+
path = `/${path}`;
|
|
2390
|
+
}
|
|
2391
|
+
} else if (to && router.history) {
|
|
2392
|
+
path = router.history.createHref({
|
|
2393
|
+
hash: "",
|
|
2394
|
+
pathname: to,
|
|
2395
|
+
search: "",
|
|
2396
|
+
state: void 0
|
|
2397
|
+
});
|
|
2398
|
+
} else {
|
|
2399
|
+
return null;
|
|
2400
|
+
}
|
|
2401
|
+
if (router.settings && router.settings.mode === HistoryMode.scopedHash) {
|
|
2402
|
+
const widgetName = container.get("$widget").name;
|
|
2403
|
+
path = getSpecificWidgetPath(path, widgetName);
|
|
2404
|
+
}
|
|
2405
|
+
return /* @__PURE__ */ React.createElement(Link$1, __spreadProps(__spreadValues({}, props), {
|
|
2406
|
+
to: path
|
|
2407
|
+
}), children);
|
|
2408
|
+
});
|
|
2409
|
+
var Link = forwardRef((_B, ref) => {
|
|
2410
|
+
var _C = _B, {
|
|
2411
|
+
className,
|
|
2412
|
+
disabled = false,
|
|
2413
|
+
role = "link",
|
|
2414
|
+
tabIndex = 0,
|
|
2415
|
+
onClick = () => {
|
|
2416
|
+
},
|
|
2417
|
+
onKeyDown = () => {
|
|
2418
|
+
},
|
|
2419
|
+
title,
|
|
2420
|
+
href,
|
|
2421
|
+
children,
|
|
2422
|
+
target,
|
|
2423
|
+
routeName,
|
|
2424
|
+
params
|
|
2425
|
+
} = _C, other = __objRest(_C, [
|
|
2426
|
+
"className",
|
|
2427
|
+
"disabled",
|
|
2428
|
+
"role",
|
|
2429
|
+
"tabIndex",
|
|
2430
|
+
"onClick",
|
|
2431
|
+
"onKeyDown",
|
|
2432
|
+
"title",
|
|
2433
|
+
"href",
|
|
2434
|
+
"children",
|
|
2435
|
+
"target",
|
|
2436
|
+
"routeName",
|
|
2437
|
+
"params"
|
|
2438
|
+
]);
|
|
2439
|
+
const props = {
|
|
2440
|
+
title,
|
|
2441
|
+
disabled,
|
|
2442
|
+
role,
|
|
2443
|
+
tabIndex,
|
|
2444
|
+
className: appendClassNames(className, "humany-link", [!!disabled, "humany-disabled"]),
|
|
2445
|
+
onClick: (e) => {
|
|
2446
|
+
e.persist();
|
|
2447
|
+
if (disabled) {
|
|
2448
|
+
e.preventDefault();
|
|
2449
|
+
return;
|
|
2450
|
+
}
|
|
2451
|
+
onClick(e);
|
|
2452
|
+
},
|
|
2453
|
+
onKeyDown: (e) => {
|
|
2454
|
+
e.persist();
|
|
2455
|
+
if (disabled) {
|
|
2456
|
+
if (e.key !== "Tab") {
|
|
2457
|
+
e.preventDefault();
|
|
2458
|
+
}
|
|
2459
|
+
return;
|
|
2460
|
+
}
|
|
2461
|
+
onKeyDown(e);
|
|
2462
|
+
}
|
|
2463
|
+
};
|
|
2464
|
+
return routeName ? /* @__PURE__ */ React.createElement(StyledRouteLink, __spreadProps(__spreadValues(__spreadValues({
|
|
2465
|
+
name: routeName,
|
|
2466
|
+
params
|
|
2467
|
+
}, props), convertToStringAttributes(other)), {
|
|
2468
|
+
ref
|
|
2469
|
+
}), children) : /* @__PURE__ */ React.createElement(StyledLink, __spreadProps(__spreadValues(__spreadValues({
|
|
2470
|
+
href,
|
|
2471
|
+
target
|
|
2472
|
+
}, props), convertToStringAttributes(other)), {
|
|
2473
|
+
ref
|
|
2474
|
+
}), children);
|
|
2475
|
+
});
|
|
2476
|
+
const StyledRouteLink = styled(RouteLink)`
|
|
2477
|
+
${(p) => p.disabled ? `
|
|
2478
|
+
pointer-events: none;
|
|
2479
|
+
opacity: .7;
|
|
2480
|
+
` : "cursor: pointer;"}
|
|
2481
|
+
`;
|
|
2482
|
+
const StyledLink = styled.a`
|
|
2483
|
+
${(p) => p.disabled ? `
|
|
2484
|
+
pointer-events: none;
|
|
2485
|
+
opacity: .7;
|
|
2486
|
+
` : "cursor: pointer;"}
|
|
2487
|
+
`;
|
|
2488
|
+
const Overlay = (_D) => {
|
|
2489
|
+
var _E = _D, {
|
|
2332
2490
|
visible,
|
|
2333
2491
|
duration = 500,
|
|
2334
2492
|
children,
|
|
2335
2493
|
onClick = () => {
|
|
2336
2494
|
}
|
|
2337
|
-
} =
|
|
2495
|
+
} = _E, other = __objRest(_E, [
|
|
2338
2496
|
"visible",
|
|
2339
2497
|
"duration",
|
|
2340
2498
|
"children",
|
|
@@ -2352,14 +2510,14 @@ const Overlay = (_z) => {
|
|
|
2352
2510
|
classNames: "humany-overlay-transition",
|
|
2353
2511
|
unmountOnExit: true,
|
|
2354
2512
|
timeout: duration
|
|
2355
|
-
}, /* @__PURE__ */ React.createElement(Portal, null, /* @__PURE__ */ React.createElement(Wrapper$
|
|
2513
|
+
}, /* @__PURE__ */ React.createElement(Portal, null, /* @__PURE__ */ React.createElement(Wrapper$4, __spreadValues({
|
|
2356
2514
|
className: "humany-overlay",
|
|
2357
2515
|
duration,
|
|
2358
2516
|
ref,
|
|
2359
2517
|
onClick: onOverlayClick
|
|
2360
2518
|
}, other), children)));
|
|
2361
2519
|
};
|
|
2362
|
-
const Wrapper$
|
|
2520
|
+
const Wrapper$4 = styled.div`
|
|
2363
2521
|
background: rgba(0, 0, 0, 0.6);
|
|
2364
2522
|
min-width: 100%;
|
|
2365
2523
|
min-height: 100%;
|
|
@@ -2390,78 +2548,6 @@ const Wrapper$5 = styled.div`
|
|
|
2390
2548
|
opacity: 0;
|
|
2391
2549
|
}
|
|
2392
2550
|
`;
|
|
2393
|
-
const ZoomButtons = ({ zoom, zoomLevel }) => {
|
|
2394
|
-
return /* @__PURE__ */ React.createElement(Wrapper$4, null, /* @__PURE__ */ React.createElement(Buttons, null, /* @__PURE__ */ React.createElement(StyledButton$1, {
|
|
2395
|
-
"aria-label": "Zoom out",
|
|
2396
|
-
onClick: () => {
|
|
2397
|
-
zoom(false);
|
|
2398
|
-
}
|
|
2399
|
-
}, /* @__PURE__ */ React.createElement(StyledSymbolBadge$1, {
|
|
2400
|
-
size: 24,
|
|
2401
|
-
symbol: { type: "Svg", content: "zoom-out" }
|
|
2402
|
-
})), /* @__PURE__ */ React.createElement(StyledButton$1, {
|
|
2403
|
-
"aria-label": "Zoom in",
|
|
2404
|
-
onClick: () => {
|
|
2405
|
-
zoom(true);
|
|
2406
|
-
}
|
|
2407
|
-
}, /* @__PURE__ */ React.createElement(StyledSymbolBadge$1, {
|
|
2408
|
-
size: 24,
|
|
2409
|
-
symbol: { type: "Svg", content: "zoom-in" }
|
|
2410
|
-
}))), /* @__PURE__ */ React.createElement(ZoomLevel, null, /* @__PURE__ */ React.createElement(Typography, {
|
|
2411
|
-
variant: "p"
|
|
2412
|
-
}, zoomLevel, "%")));
|
|
2413
|
-
};
|
|
2414
|
-
const Wrapper$4 = styled.div`
|
|
2415
|
-
width: 100vw;
|
|
2416
|
-
display: flex;
|
|
2417
|
-
position: absolute;
|
|
2418
|
-
bottom: 0;
|
|
2419
|
-
margin-bottom: ${(p) => {
|
|
2420
|
-
var _a;
|
|
2421
|
-
return (_a = p.theme.sizes) == null ? void 0 : _a.normal;
|
|
2422
|
-
}};
|
|
2423
|
-
justify-content: center;
|
|
2424
|
-
flex-direction: row;
|
|
2425
|
-
`;
|
|
2426
|
-
const ZoomLevel = styled.div`
|
|
2427
|
-
right: 45px;
|
|
2428
|
-
position: absolute;
|
|
2429
|
-
color: #fff;
|
|
2430
|
-
font-size: ${(p) => {
|
|
2431
|
-
var _a;
|
|
2432
|
-
return (_a = p.theme.fonts) == null ? void 0 : _a.normal;
|
|
2433
|
-
}};
|
|
2434
|
-
line-height: 1.5em;
|
|
2435
|
-
${(p) => {
|
|
2436
|
-
var _a, _b;
|
|
2437
|
-
return ((_a = p.theme.fonts) == null ? void 0 : _a.type) && `
|
|
2438
|
-
font-family: ${(_b = p.theme.fonts) == null ? void 0 : _b.type};
|
|
2439
|
-
`;
|
|
2440
|
-
}}
|
|
2441
|
-
`;
|
|
2442
|
-
const Buttons = styled.div`
|
|
2443
|
-
position: relative;
|
|
2444
|
-
margin: ${(p) => {
|
|
2445
|
-
var _a;
|
|
2446
|
-
return (_a = p.theme.sizes) == null ? void 0 : _a.normal;
|
|
2447
|
-
}};
|
|
2448
|
-
`;
|
|
2449
|
-
const StyledSymbolBadge$1 = styled(SymbolBadge)`
|
|
2450
|
-
path {
|
|
2451
|
-
stroke: #ffffff;
|
|
2452
|
-
}
|
|
2453
|
-
`;
|
|
2454
|
-
const StyledButton$1 = styled(Button)`
|
|
2455
|
-
transition: opacity 300ms ease-in-out;
|
|
2456
|
-
opacity: 0.7;
|
|
2457
|
-
&:hover {
|
|
2458
|
-
opacity: 1;
|
|
2459
|
-
}
|
|
2460
|
-
margin: ${(p) => {
|
|
2461
|
-
var _a;
|
|
2462
|
-
return (_a = p.theme.sizes) == null ? void 0 : _a.small;
|
|
2463
|
-
}};
|
|
2464
|
-
`;
|
|
2465
2551
|
const spin = keyframes`
|
|
2466
2552
|
100% {
|
|
2467
2553
|
transform: rotate(360deg);
|
|
@@ -2534,9 +2620,9 @@ const SpinnerCircle = styled.circle`
|
|
|
2534
2620
|
}};
|
|
2535
2621
|
stroke-width: 2px;
|
|
2536
2622
|
`;
|
|
2537
|
-
const Loader = ({ loading = false }) => {
|
|
2623
|
+
const Loader = ({ className, loading = false }) => {
|
|
2538
2624
|
return /* @__PURE__ */ React.createElement(Wrapper$3, {
|
|
2539
|
-
className: "humany-loader",
|
|
2625
|
+
className: appendClassNames("humany-loader", className),
|
|
2540
2626
|
"data-loading": loading
|
|
2541
2627
|
}, /* @__PURE__ */ React.createElement(Spinner, {
|
|
2542
2628
|
className: "humany-spinner"
|
|
@@ -2551,8 +2637,9 @@ const Loader = ({ loading = false }) => {
|
|
|
2551
2637
|
"stroke-miterlimit": "10"
|
|
2552
2638
|
}))));
|
|
2553
2639
|
};
|
|
2554
|
-
const ZoomImg = (
|
|
2555
|
-
var
|
|
2640
|
+
const ZoomImg = (_F) => {
|
|
2641
|
+
var _G = _F, { zoomState, src } = _G, attrs = __objRest(_G, ["zoomState", "src"]);
|
|
2642
|
+
var _b;
|
|
2556
2643
|
const ref = useRef(null);
|
|
2557
2644
|
const [loaded, setLoaded] = useState(false);
|
|
2558
2645
|
const _a = attrs.style || {}, { width, height } = _a, restStyle = __objRest(_a, ["width", "height"]);
|
|
@@ -2566,8 +2653,11 @@ const ZoomImg = (_B) => {
|
|
|
2566
2653
|
}
|
|
2567
2654
|
}
|
|
2568
2655
|
return null;
|
|
2569
|
-
}, [zoomState, ref, loaded]);
|
|
2570
|
-
|
|
2656
|
+
}, [zoomState, ref, loaded, src]);
|
|
2657
|
+
useEffect(() => {
|
|
2658
|
+
setLoaded(false);
|
|
2659
|
+
}, [src]);
|
|
2660
|
+
return /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(StyledLoader, {
|
|
2571
2661
|
loading: !loaded
|
|
2572
2662
|
}), /* @__PURE__ */ React.createElement(Img, __spreadProps(__spreadValues({
|
|
2573
2663
|
onLoad: () => {
|
|
@@ -2577,19 +2667,28 @@ const ZoomImg = (_B) => {
|
|
|
2577
2667
|
imageSize,
|
|
2578
2668
|
draggable: "false"
|
|
2579
2669
|
}, attrs), {
|
|
2580
|
-
|
|
2670
|
+
alt: ((_b = attrs.alt) == null ? void 0 : _b.toString()) || "",
|
|
2671
|
+
style: restStyle,
|
|
2672
|
+
src,
|
|
2673
|
+
loaded
|
|
2581
2674
|
})), /* @__PURE__ */ React.createElement(EmptyDiv, null));
|
|
2582
2675
|
};
|
|
2676
|
+
const StyledLoader = styled(Loader)`
|
|
2677
|
+
svg circle {
|
|
2678
|
+
stroke: #ffffff;
|
|
2679
|
+
}
|
|
2680
|
+
`;
|
|
2583
2681
|
const Img = styled.img`
|
|
2584
2682
|
transform: none;
|
|
2585
2683
|
|
|
2586
|
-
${(props) => props.imageSize
|
|
2587
|
-
|
|
2588
|
-
|
|
2589
|
-
|
|
2590
|
-
|
|
2684
|
+
${(props) => props.imageSize && css`
|
|
2685
|
+
width: ${props.imageSize[0]};
|
|
2686
|
+
height: ${props.imageSize[1]};
|
|
2687
|
+
display: inline-block;
|
|
2688
|
+
`}
|
|
2591
2689
|
vertical-align: middle;
|
|
2592
2690
|
position: relative;
|
|
2691
|
+
${(props) => !props.loaded && "display:none;"}
|
|
2593
2692
|
`;
|
|
2594
2693
|
const EmptyDiv = styled.div`
|
|
2595
2694
|
height: 100%;
|
|
@@ -2616,21 +2715,63 @@ const useFadeOut = () => {
|
|
|
2616
2715
|
}, [show, timeOut]);
|
|
2617
2716
|
return [show, triggerChange];
|
|
2618
2717
|
};
|
|
2619
|
-
const Lightbox = ({ attrs }) => {
|
|
2620
|
-
|
|
2718
|
+
const Lightbox = ({ attrs, htmlBody }) => {
|
|
2719
|
+
var _a;
|
|
2621
2720
|
const esc = useKeyPress("Escape");
|
|
2622
2721
|
const [zoomState, setZoomState] = useState(80);
|
|
2623
2722
|
const [scroll, setScroll] = useState({ top: 0, left: 0, x: 0, y: 0 });
|
|
2624
2723
|
const [scrolling, setScrolling] = useState(false);
|
|
2625
2724
|
const [show, triggerFadeOut] = useFadeOut();
|
|
2626
|
-
const
|
|
2725
|
+
const [openImage, setOpenImage] = useState(null);
|
|
2726
|
+
const imageLinkRef = useRef(null);
|
|
2727
|
+
const topButtonsRef = useRef(null);
|
|
2728
|
+
const contentRef = useRef(null);
|
|
2627
2729
|
useEffect(() => {
|
|
2628
2730
|
if (esc) {
|
|
2629
|
-
|
|
2731
|
+
setOpenImage(null);
|
|
2630
2732
|
}
|
|
2631
2733
|
}, [esc]);
|
|
2734
|
+
useEffect(() => {
|
|
2735
|
+
setZoomState(80);
|
|
2736
|
+
}, [openImage]);
|
|
2737
|
+
useEffect(() => {
|
|
2738
|
+
if (openImage === null || topButtonsRef.current === null) {
|
|
2739
|
+
return;
|
|
2740
|
+
}
|
|
2741
|
+
const firstButton = topButtonsRef.current.firstElementChild;
|
|
2742
|
+
if (!firstButton) {
|
|
2743
|
+
return;
|
|
2744
|
+
}
|
|
2745
|
+
firstButton.focus();
|
|
2746
|
+
}, [openImage, topButtonsRef]);
|
|
2747
|
+
useEffect(() => {
|
|
2748
|
+
if (openImage !== null || imageLinkRef.current === null) {
|
|
2749
|
+
return;
|
|
2750
|
+
}
|
|
2751
|
+
imageLinkRef.current.focus();
|
|
2752
|
+
}, [openImage, imageLinkRef]);
|
|
2753
|
+
const imageList = useMemo(() => {
|
|
2754
|
+
const div = document.createElement("div");
|
|
2755
|
+
div.innerHTML = htmlBody || "";
|
|
2756
|
+
const images = div.getElementsByTagName("img");
|
|
2757
|
+
const list2 = Array.from(images).reduce((acc, imgElement) => {
|
|
2758
|
+
const src = imgElement.getAttribute("src");
|
|
2759
|
+
if (src) {
|
|
2760
|
+
acc.push(src);
|
|
2761
|
+
}
|
|
2762
|
+
return acc;
|
|
2763
|
+
}, []);
|
|
2764
|
+
return list2;
|
|
2765
|
+
}, [htmlBody]);
|
|
2766
|
+
const toggleVisible = useCallback(() => {
|
|
2767
|
+
const { src } = attrs;
|
|
2768
|
+
if (src) {
|
|
2769
|
+
const position = imageList.indexOf(src);
|
|
2770
|
+
setOpenImage(position);
|
|
2771
|
+
}
|
|
2772
|
+
}, [imageList, attrs]);
|
|
2632
2773
|
const overlayClick = useCallback((e) => {
|
|
2633
|
-
|
|
2774
|
+
setOpenImage(null);
|
|
2634
2775
|
}, [toggleVisible]);
|
|
2635
2776
|
const changeZoomState = useCallback((zoomIn) => {
|
|
2636
2777
|
if (zoomIn) {
|
|
@@ -2646,14 +2787,14 @@ const Lightbox = ({ attrs }) => {
|
|
|
2646
2787
|
}
|
|
2647
2788
|
}, [attrs]);
|
|
2648
2789
|
const mouseDownHandler = useCallback((e) => {
|
|
2649
|
-
const ele =
|
|
2790
|
+
const ele = contentRef.current;
|
|
2650
2791
|
if (ele) {
|
|
2651
2792
|
setScroll({ top: ele.scrollTop, left: ele.scrollLeft, x: e.clientX, y: e.clientY });
|
|
2652
2793
|
setScrolling(true);
|
|
2653
2794
|
}
|
|
2654
|
-
}, [
|
|
2795
|
+
}, [contentRef]);
|
|
2655
2796
|
const mouseDragHandler = useCallback((e) => {
|
|
2656
|
-
const ele =
|
|
2797
|
+
const ele = contentRef.current;
|
|
2657
2798
|
if (ele && scrolling) {
|
|
2658
2799
|
const dx = e.clientX - scroll.x;
|
|
2659
2800
|
const dy = e.clientY - scroll.y;
|
|
@@ -2666,74 +2807,285 @@ const Lightbox = ({ attrs }) => {
|
|
|
2666
2807
|
setScrolling(false);
|
|
2667
2808
|
};
|
|
2668
2809
|
const isDraggable = useMemo(() => {
|
|
2669
|
-
if (
|
|
2670
|
-
const
|
|
2671
|
-
if (
|
|
2672
|
-
const
|
|
2673
|
-
return
|
|
2810
|
+
if (contentRef.current) {
|
|
2811
|
+
const imageElements = contentRef.current.getElementsByTagName("img");
|
|
2812
|
+
if (imageElements && imageElements.length) {
|
|
2813
|
+
const imgElement = imageElements[0];
|
|
2814
|
+
return imgElement.width > window.innerWidth || imgElement.height > window.innerHeight;
|
|
2674
2815
|
}
|
|
2675
2816
|
}
|
|
2676
2817
|
return false;
|
|
2677
|
-
}, [
|
|
2818
|
+
}, [contentRef, zoomState]);
|
|
2819
|
+
const navLeft = () => {
|
|
2820
|
+
if (openImage !== null)
|
|
2821
|
+
setOpenImage(openImage - 1);
|
|
2822
|
+
};
|
|
2823
|
+
const navRight = () => {
|
|
2824
|
+
if (openImage !== null)
|
|
2825
|
+
setOpenImage(openImage + 1);
|
|
2826
|
+
};
|
|
2827
|
+
const canNavigateLeft = openImage !== null && openImage > 0 && imageList.length > 1;
|
|
2828
|
+
const canNavigateRight = openImage !== null && imageList.length - 1 > openImage;
|
|
2678
2829
|
return /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(Overlay, {
|
|
2679
|
-
visible,
|
|
2830
|
+
visible: openImage !== null,
|
|
2680
2831
|
onClick: overlayClick
|
|
2681
2832
|
}, /* @__PURE__ */ React.createElement(DraggableArea, {
|
|
2682
2833
|
onMouseDown: () => triggerFadeOut(),
|
|
2683
2834
|
onMouseMove: () => triggerFadeOut(),
|
|
2684
|
-
onTouchStart: () => triggerFadeOut()
|
|
2835
|
+
onTouchStart: () => triggerFadeOut(),
|
|
2836
|
+
onKeyDown: () => triggerFadeOut()
|
|
2685
2837
|
}, /* @__PURE__ */ React.createElement(TransparentBarTop, {
|
|
2686
|
-
show
|
|
2687
|
-
}, /* @__PURE__ */ React.createElement(
|
|
2688
|
-
|
|
2689
|
-
|
|
2690
|
-
|
|
2691
|
-
|
|
2692
|
-
|
|
2693
|
-
|
|
2694
|
-
|
|
2695
|
-
|
|
2696
|
-
|
|
2697
|
-
|
|
2698
|
-
|
|
2699
|
-
|
|
2700
|
-
|
|
2838
|
+
show: show.toString()
|
|
2839
|
+
}, /* @__PURE__ */ React.createElement(TopRightButtons, {
|
|
2840
|
+
ref: topButtonsRef,
|
|
2841
|
+
buttons: [
|
|
2842
|
+
{
|
|
2843
|
+
id: "download",
|
|
2844
|
+
onClick: downloadImage,
|
|
2845
|
+
icon: "download"
|
|
2846
|
+
},
|
|
2847
|
+
{
|
|
2848
|
+
id: "lightbox-close",
|
|
2849
|
+
onClick: () => setOpenImage(null),
|
|
2850
|
+
icon: "lightbox-close"
|
|
2851
|
+
}
|
|
2852
|
+
]
|
|
2853
|
+
})), /* @__PURE__ */ React.createElement(Content$1, {
|
|
2854
|
+
scrolling: scrolling.toString(),
|
|
2855
|
+
isDraggable: isDraggable.toString(),
|
|
2856
|
+
ref: contentRef,
|
|
2701
2857
|
onMouseMove: mouseDragHandler,
|
|
2702
2858
|
onMouseDown: mouseDownHandler,
|
|
2703
2859
|
onMouseUp: mouseStopDragHandler
|
|
2704
|
-
}, /* @__PURE__ */ React.createElement(ZoomImg, __spreadValues({
|
|
2860
|
+
}, openImage !== null && /* @__PURE__ */ React.createElement(ZoomImg, __spreadProps(__spreadValues({
|
|
2705
2861
|
zoomState
|
|
2706
|
-
}, attrs)
|
|
2707
|
-
|
|
2708
|
-
}, /* @__PURE__ */ React.createElement(
|
|
2709
|
-
|
|
2710
|
-
|
|
2711
|
-
|
|
2712
|
-
|
|
2713
|
-
|
|
2862
|
+
}, attrs), {
|
|
2863
|
+
src: imageList[openImage]
|
|
2864
|
+
}))), /* @__PURE__ */ React.createElement(CenterEdgeButtons, {
|
|
2865
|
+
show: show.toString(),
|
|
2866
|
+
buttons: [
|
|
2867
|
+
{
|
|
2868
|
+
id: "previous",
|
|
2869
|
+
onClick: navLeft,
|
|
2870
|
+
icon: "caret-left",
|
|
2871
|
+
circle: true,
|
|
2872
|
+
show: canNavigateLeft
|
|
2873
|
+
},
|
|
2874
|
+
{
|
|
2875
|
+
id: "next",
|
|
2876
|
+
onClick: navRight,
|
|
2877
|
+
icon: "caret-right",
|
|
2878
|
+
circle: true,
|
|
2879
|
+
show: canNavigateRight
|
|
2880
|
+
}
|
|
2881
|
+
]
|
|
2882
|
+
}), /* @__PURE__ */ React.createElement(TransparentBarBottom, {
|
|
2883
|
+
show: show.toString()
|
|
2884
|
+
}, /* @__PURE__ */ React.createElement(BottomCenterButtons, {
|
|
2885
|
+
buttons: [
|
|
2886
|
+
{
|
|
2887
|
+
id: "zoom-out",
|
|
2888
|
+
onClick: () => changeZoomState(false),
|
|
2889
|
+
icon: "zoom-out"
|
|
2890
|
+
},
|
|
2891
|
+
{
|
|
2892
|
+
id: "zoom-in",
|
|
2893
|
+
onClick: () => changeZoomState(true),
|
|
2894
|
+
icon: "zoom-in"
|
|
2895
|
+
}
|
|
2896
|
+
]
|
|
2897
|
+
}), /* @__PURE__ */ React.createElement(ZoomLevel, {
|
|
2898
|
+
variant: "span"
|
|
2899
|
+
}, zoomState, "%")))), /* @__PURE__ */ React.createElement(Link, {
|
|
2900
|
+
ref: imageLinkRef,
|
|
2901
|
+
onClick: toggleVisible,
|
|
2902
|
+
onKeyDown: (e) => {
|
|
2903
|
+
if (e.key !== "Enter") {
|
|
2904
|
+
return;
|
|
2905
|
+
}
|
|
2906
|
+
e.preventDefault();
|
|
2907
|
+
toggleVisible();
|
|
2908
|
+
},
|
|
2909
|
+
tabIndex: 0
|
|
2910
|
+
}, /* @__PURE__ */ React.createElement(Thumbnail, __spreadProps(__spreadValues({}, attrs), {
|
|
2911
|
+
alt: ((_a = attrs.alt) == null ? void 0 : _a.toString()) || ""
|
|
2912
|
+
}))));
|
|
2714
2913
|
};
|
|
2715
|
-
const
|
|
2716
|
-
|
|
2717
|
-
|
|
2718
|
-
|
|
2719
|
-
|
|
2914
|
+
const ButtonSet = forwardRef(({ show = "true", buttons, className }, ref) => {
|
|
2915
|
+
return /* @__PURE__ */ React.createElement(ButtonSetWrapper, {
|
|
2916
|
+
ref,
|
|
2917
|
+
show,
|
|
2918
|
+
className: appendClassNames("humany-button-set", className)
|
|
2919
|
+
}, buttons.map(({ id, circle = false, show: show2 = true, onClick, icon }, index) => /* @__PURE__ */ React.createElement(ButtonSetButton, {
|
|
2920
|
+
key: id + index.toString(),
|
|
2921
|
+
circle: circle.toString(),
|
|
2922
|
+
onClick,
|
|
2923
|
+
tabIndex: !show2 ? -1 : void 0,
|
|
2924
|
+
show: show2.toString(),
|
|
2925
|
+
icon
|
|
2926
|
+
}, /* @__PURE__ */ React.createElement(SymbolBadge, {
|
|
2927
|
+
size: 24,
|
|
2928
|
+
symbol: { type: "Svg", content: icon }
|
|
2929
|
+
}))));
|
|
2930
|
+
});
|
|
2931
|
+
const FadingDiv = styled.div`
|
|
2720
2932
|
transition: opacity 0.3s ease 0s;
|
|
2721
2933
|
z-index: 5;
|
|
2722
|
-
${(p) => p.show ? "opacity: 1;" : css`
|
|
2934
|
+
${(p) => p.show === "true" ? "opacity: 1;" : css`
|
|
2935
|
+
opacity: 0;
|
|
2936
|
+
pointer-events: none;
|
|
2937
|
+
`}
|
|
2938
|
+
`;
|
|
2939
|
+
const ButtonSetWrapper = styled(FadingDiv)`
|
|
2940
|
+
position: fixed;
|
|
2941
|
+
display: flex;
|
|
2942
|
+
gap: ${(p) => {
|
|
2943
|
+
var _a;
|
|
2944
|
+
return (_a = p.theme.sizes) == null ? void 0 : _a.normal;
|
|
2945
|
+
}};
|
|
2946
|
+
`;
|
|
2947
|
+
const BUTTON_SIZE = "39px";
|
|
2948
|
+
const ButtonSetButton = styled(Button)`
|
|
2949
|
+
width: ${BUTTON_SIZE};
|
|
2950
|
+
height: ${BUTTON_SIZE};
|
|
2951
|
+
display: flex;
|
|
2952
|
+
justify-content: center;
|
|
2953
|
+
align-items: center;
|
|
2954
|
+
|
|
2955
|
+
${(p) => p.icon === "caret-left" && css`
|
|
2956
|
+
svg {
|
|
2957
|
+
position: relative;
|
|
2958
|
+
left: -2px;
|
|
2959
|
+
}
|
|
2960
|
+
`}
|
|
2961
|
+
|
|
2962
|
+
${(p) => {
|
|
2963
|
+
var _a, _b, _c;
|
|
2964
|
+
return p.circle === "true" ? css`
|
|
2965
|
+
background-color: #ffffff;
|
|
2966
|
+
border-radius: 50%;
|
|
2967
|
+
|
|
2968
|
+
svg {
|
|
2969
|
+
path,
|
|
2970
|
+
line {
|
|
2971
|
+
stroke: ${(_a = p.theme.colors) == null ? void 0 : _a.text};
|
|
2972
|
+
}
|
|
2973
|
+
}
|
|
2974
|
+
|
|
2975
|
+
&:focus {
|
|
2976
|
+
${((_b = p.theme.accessibility) == null ? void 0 : _b.isTabbing) && css`
|
|
2977
|
+
${borderTabStyle}
|
|
2978
|
+
outline-color: #ffffff;
|
|
2979
|
+
background-color: transparent;
|
|
2980
|
+
|
|
2981
|
+
svg {
|
|
2982
|
+
path,
|
|
2983
|
+
line {
|
|
2984
|
+
stroke: #ffffff;
|
|
2985
|
+
}
|
|
2986
|
+
}
|
|
2987
|
+
`}
|
|
2988
|
+
}
|
|
2989
|
+
` : css`
|
|
2990
|
+
svg {
|
|
2991
|
+
path,
|
|
2992
|
+
line {
|
|
2993
|
+
stroke: #ffffff;
|
|
2994
|
+
}
|
|
2995
|
+
}
|
|
2996
|
+
&:focus {
|
|
2997
|
+
${((_c = p.theme.accessibility) == null ? void 0 : _c.isTabbing) && borderTabStyle};
|
|
2998
|
+
outline-color: #ffffff;
|
|
2999
|
+
}
|
|
3000
|
+
`;
|
|
3001
|
+
}}
|
|
3002
|
+
|
|
3003
|
+
${(p) => p.show === "true" ? css`
|
|
3004
|
+
opacity: 0.8;
|
|
3005
|
+
transition: opacity 0.3s ease 0s;
|
|
3006
|
+
&:hover {
|
|
3007
|
+
opacity: 1;
|
|
3008
|
+
}
|
|
3009
|
+
` : css`
|
|
2723
3010
|
opacity: 0;
|
|
2724
3011
|
pointer-events: none;
|
|
2725
3012
|
`}
|
|
2726
3013
|
`;
|
|
3014
|
+
const TopRightButtons = styled(ButtonSet)`
|
|
3015
|
+
top: ${(p) => {
|
|
3016
|
+
var _a;
|
|
3017
|
+
return (_a = p.theme.sizes) == null ? void 0 : _a.large;
|
|
3018
|
+
}};
|
|
3019
|
+
right: ${(p) => {
|
|
3020
|
+
var _a;
|
|
3021
|
+
return (_a = p.theme.sizes) == null ? void 0 : _a.large;
|
|
3022
|
+
}};
|
|
3023
|
+
`;
|
|
3024
|
+
const BottomCenterButtons = styled(ButtonSet)`
|
|
3025
|
+
bottom: ${(p) => {
|
|
3026
|
+
var _a;
|
|
3027
|
+
return (_a = p.theme.sizes) == null ? void 0 : _a.large;
|
|
3028
|
+
}};
|
|
3029
|
+
width: 100%;
|
|
3030
|
+
align-items: center;
|
|
3031
|
+
justify-content: center;
|
|
3032
|
+
`;
|
|
3033
|
+
const CenterEdgeButtons = styled(ButtonSet)`
|
|
3034
|
+
display: block;
|
|
3035
|
+
button {
|
|
3036
|
+
position: fixed;
|
|
3037
|
+
top: calc(50% - calc(${BUTTON_SIZE} / 2));
|
|
3038
|
+
&:first-child {
|
|
3039
|
+
left: ${(p) => {
|
|
3040
|
+
var _a;
|
|
3041
|
+
return (_a = p.theme.sizes) == null ? void 0 : _a.large;
|
|
3042
|
+
}};
|
|
3043
|
+
}
|
|
3044
|
+
&:last-child {
|
|
3045
|
+
right: ${(p) => {
|
|
3046
|
+
var _a;
|
|
3047
|
+
return (_a = p.theme.sizes) == null ? void 0 : _a.large;
|
|
3048
|
+
}};
|
|
3049
|
+
}
|
|
3050
|
+
}
|
|
3051
|
+
`;
|
|
3052
|
+
const ZoomLevel = styled(Typography)`
|
|
3053
|
+
position: fixed;
|
|
3054
|
+
bottom: ${(p) => {
|
|
3055
|
+
var _a;
|
|
3056
|
+
return (_a = p.theme.sizes) == null ? void 0 : _a.large;
|
|
3057
|
+
}};
|
|
3058
|
+
right: ${(p) => {
|
|
3059
|
+
var _a;
|
|
3060
|
+
return (_a = p.theme.sizes) == null ? void 0 : _a.large;
|
|
3061
|
+
}};
|
|
3062
|
+
color: #ffffff;
|
|
3063
|
+
font-size: ${(p) => {
|
|
3064
|
+
var _a;
|
|
3065
|
+
return (_a = p.theme.fonts) == null ? void 0 : _a.medium;
|
|
3066
|
+
}};
|
|
3067
|
+
font-family: ${(p) => {
|
|
3068
|
+
var _a;
|
|
3069
|
+
return (_a = p.theme.fonts) == null ? void 0 : _a.type;
|
|
3070
|
+
}};
|
|
3071
|
+
`;
|
|
3072
|
+
const TransparentBar = styled(FadingDiv)`
|
|
3073
|
+
position: absolute;
|
|
3074
|
+
width: 100vw;
|
|
3075
|
+
height: 88px;
|
|
3076
|
+
left: 0px;
|
|
3077
|
+
z-index: 5;
|
|
3078
|
+
`;
|
|
2727
3079
|
const DraggableArea = styled.div`
|
|
2728
3080
|
width: 100%;
|
|
2729
3081
|
`;
|
|
2730
3082
|
const TransparentBarTop = styled(TransparentBar)`
|
|
2731
3083
|
top: 0px;
|
|
2732
|
-
background-image: linear-gradient(to bottom, rgb(
|
|
3084
|
+
background-image: linear-gradient(to bottom, rgb(34, 34, 34, 0.8), rgba(34, 34, 34, 0));
|
|
2733
3085
|
`;
|
|
2734
3086
|
const TransparentBarBottom = styled(TransparentBar)`
|
|
2735
3087
|
bottom: 0px;
|
|
2736
|
-
background-image: linear-gradient(to top, rgb(
|
|
3088
|
+
background-image: linear-gradient(to top, rgb(34, 34, 34, 0.8), rgba(34, 34, 34, 0));
|
|
2737
3089
|
`;
|
|
2738
3090
|
const Content$1 = styled.div`
|
|
2739
3091
|
width: 100%;
|
|
@@ -2743,168 +3095,11 @@ const Content$1 = styled.div`
|
|
|
2743
3095
|
vertical-align: middle;
|
|
2744
3096
|
white-space: nowrap;
|
|
2745
3097
|
justify-content: center;
|
|
2746
|
-
cursor: ${(
|
|
2747
|
-
`;
|
|
2748
|
-
const StyledButton = styled(Button)`
|
|
2749
|
-
position: fixed;
|
|
2750
|
-
top: 34px;
|
|
2751
|
-
transition: opacity 300ms ease-in-out;
|
|
2752
|
-
opacity: 0.7;
|
|
2753
|
-
&:hover {
|
|
2754
|
-
opacity: 1;
|
|
2755
|
-
}
|
|
2756
|
-
`;
|
|
2757
|
-
const CloseButton = styled(StyledButton)`
|
|
2758
|
-
right: 32px;
|
|
2759
|
-
`;
|
|
2760
|
-
const DownloadButton = styled(StyledButton)`
|
|
2761
|
-
right: 80px;
|
|
2762
|
-
`;
|
|
2763
|
-
const StyledSymbolBadge = styled(SymbolBadge)`
|
|
2764
|
-
path {
|
|
2765
|
-
stroke: #ffffff;
|
|
2766
|
-
}
|
|
3098
|
+
cursor: ${(p) => p.isDraggable === "true" ? p.scrolling === "true" ? "grabbing" : "grab" : "auto"};
|
|
2767
3099
|
`;
|
|
2768
3100
|
const Thumbnail = styled.img`
|
|
2769
3101
|
cursor: pointer;
|
|
2770
3102
|
`;
|
|
2771
|
-
var RouteLink = forwardRef((_D, forwardedRef) => {
|
|
2772
|
-
var _E = _D, { className, onClick = () => {
|
|
2773
|
-
}, name = "", to = "", params = {}, children } = _E, other = __objRest(_E, ["className", "onClick", "name", "to", "params", "children"]);
|
|
2774
|
-
const router = useRouter();
|
|
2775
|
-
const container = useContainer();
|
|
2776
|
-
if (!router) {
|
|
2777
|
-
return null;
|
|
2778
|
-
}
|
|
2779
|
-
let path = "";
|
|
2780
|
-
const props = __spreadProps(__spreadValues({
|
|
2781
|
-
onClick,
|
|
2782
|
-
className: appendClassNames(className, "humany-route-link"),
|
|
2783
|
-
to: path,
|
|
2784
|
-
innerRef: forwardedRef
|
|
2785
|
-
}, other), {
|
|
2786
|
-
ref: null
|
|
2787
|
-
});
|
|
2788
|
-
if (name) {
|
|
2789
|
-
const routes = router.routes || [];
|
|
2790
|
-
const route = routes.find((r) => r.name === name);
|
|
2791
|
-
if (!route) {
|
|
2792
|
-
return /* @__PURE__ */ React.createElement(Link$1, __spreadProps(__spreadValues({}, props), {
|
|
2793
|
-
onClick: (e) => {
|
|
2794
|
-
onClick(e);
|
|
2795
|
-
e.preventDefault();
|
|
2796
|
-
}
|
|
2797
|
-
}), children);
|
|
2798
|
-
}
|
|
2799
|
-
const encodedParams = Object.keys(params).reduce((acc, key) => {
|
|
2800
|
-
acc[key] = typeof params[key] === "string" ? encodeURIComponent(params[key]) : params[key];
|
|
2801
|
-
return acc;
|
|
2802
|
-
}, {});
|
|
2803
|
-
try {
|
|
2804
|
-
path = router.generate(name, encodedParams || {});
|
|
2805
|
-
} catch (e) {
|
|
2806
|
-
return /* @__PURE__ */ React.createElement(Link$1, __spreadValues({}, props), children);
|
|
2807
|
-
}
|
|
2808
|
-
if (path && router.settings.mode && router.settings.mode === HistoryMode.browser && path[0] !== "/") {
|
|
2809
|
-
path = `/${path}`;
|
|
2810
|
-
}
|
|
2811
|
-
} else if (to && router.history) {
|
|
2812
|
-
path = router.history.createHref({
|
|
2813
|
-
hash: "",
|
|
2814
|
-
pathname: to,
|
|
2815
|
-
search: "",
|
|
2816
|
-
state: void 0
|
|
2817
|
-
});
|
|
2818
|
-
} else {
|
|
2819
|
-
return null;
|
|
2820
|
-
}
|
|
2821
|
-
if (router.settings && router.settings.mode === HistoryMode.scopedHash) {
|
|
2822
|
-
const widgetName = container.get("$widget").name;
|
|
2823
|
-
path = getSpecificWidgetPath(path, widgetName);
|
|
2824
|
-
}
|
|
2825
|
-
return /* @__PURE__ */ React.createElement(Link$1, __spreadProps(__spreadValues({}, props), {
|
|
2826
|
-
to: path
|
|
2827
|
-
}), children);
|
|
2828
|
-
});
|
|
2829
|
-
var Link = forwardRef((_F, ref) => {
|
|
2830
|
-
var _G = _F, {
|
|
2831
|
-
className,
|
|
2832
|
-
disabled = false,
|
|
2833
|
-
role = "link",
|
|
2834
|
-
tabIndex = 0,
|
|
2835
|
-
onClick = () => {
|
|
2836
|
-
},
|
|
2837
|
-
onKeyDown = () => {
|
|
2838
|
-
},
|
|
2839
|
-
title,
|
|
2840
|
-
href,
|
|
2841
|
-
children,
|
|
2842
|
-
target,
|
|
2843
|
-
routeName,
|
|
2844
|
-
params
|
|
2845
|
-
} = _G, other = __objRest(_G, [
|
|
2846
|
-
"className",
|
|
2847
|
-
"disabled",
|
|
2848
|
-
"role",
|
|
2849
|
-
"tabIndex",
|
|
2850
|
-
"onClick",
|
|
2851
|
-
"onKeyDown",
|
|
2852
|
-
"title",
|
|
2853
|
-
"href",
|
|
2854
|
-
"children",
|
|
2855
|
-
"target",
|
|
2856
|
-
"routeName",
|
|
2857
|
-
"params"
|
|
2858
|
-
]);
|
|
2859
|
-
const props = {
|
|
2860
|
-
title,
|
|
2861
|
-
disabled,
|
|
2862
|
-
role,
|
|
2863
|
-
tabIndex,
|
|
2864
|
-
className: appendClassNames(className, "humany-link", [!!disabled, "humany-disabled"]),
|
|
2865
|
-
onClick: (e) => {
|
|
2866
|
-
e.persist();
|
|
2867
|
-
if (disabled) {
|
|
2868
|
-
e.preventDefault();
|
|
2869
|
-
return;
|
|
2870
|
-
}
|
|
2871
|
-
onClick(e);
|
|
2872
|
-
},
|
|
2873
|
-
onKeyDown: (e) => {
|
|
2874
|
-
e.persist();
|
|
2875
|
-
if (disabled) {
|
|
2876
|
-
if (e.key !== "Tab") {
|
|
2877
|
-
e.preventDefault();
|
|
2878
|
-
}
|
|
2879
|
-
return;
|
|
2880
|
-
}
|
|
2881
|
-
onKeyDown(e);
|
|
2882
|
-
}
|
|
2883
|
-
};
|
|
2884
|
-
return routeName ? /* @__PURE__ */ React.createElement(StyledRouteLink, __spreadProps(__spreadValues(__spreadValues({
|
|
2885
|
-
name: routeName,
|
|
2886
|
-
params
|
|
2887
|
-
}, props), convertToStringAttributes(other)), {
|
|
2888
|
-
ref
|
|
2889
|
-
}), children) : /* @__PURE__ */ React.createElement(StyledLink, __spreadProps(__spreadValues(__spreadValues({
|
|
2890
|
-
href,
|
|
2891
|
-
target
|
|
2892
|
-
}, props), convertToStringAttributes(other)), {
|
|
2893
|
-
ref
|
|
2894
|
-
}), children);
|
|
2895
|
-
});
|
|
2896
|
-
const StyledRouteLink = styled(RouteLink)`
|
|
2897
|
-
${(p) => p.disabled ? `
|
|
2898
|
-
pointer-events: none;
|
|
2899
|
-
opacity: .7;
|
|
2900
|
-
` : "cursor: pointer;"}
|
|
2901
|
-
`;
|
|
2902
|
-
const StyledLink = styled.a`
|
|
2903
|
-
${(p) => p.disabled ? `
|
|
2904
|
-
pointer-events: none;
|
|
2905
|
-
opacity: .7;
|
|
2906
|
-
` : "cursor: pointer;"}
|
|
2907
|
-
`;
|
|
2908
3103
|
const Modal = forwardRef((_H, ref) => {
|
|
2909
3104
|
var _I = _H, { className, children, trigger, onOverlayClick = () => {
|
|
2910
3105
|
}, close = false } = _I, other = __objRest(_I, ["className", "children", "trigger", "onOverlayClick", "close"]);
|
|
@@ -2949,7 +3144,7 @@ const Modal = forwardRef((_H, ref) => {
|
|
|
2949
3144
|
tabIndex: -1
|
|
2950
3145
|
}, other), {
|
|
2951
3146
|
ref: innerRef
|
|
2952
|
-
}), /* @__PURE__ */ React.createElement(CloseButton
|
|
3147
|
+
}), /* @__PURE__ */ React.createElement(CloseButton, {
|
|
2953
3148
|
onClick: () => toggleVisible(false),
|
|
2954
3149
|
tabIndex: 0,
|
|
2955
3150
|
ref: closeButtonRef
|
|
@@ -3495,5 +3690,5 @@ const createReactComponent = (container, type, reactComponent, fn, options) => {
|
|
|
3495
3690
|
}), type, options);
|
|
3496
3691
|
});
|
|
3497
3692
|
};
|
|
3498
|
-
export { AnchorLink, Button, Checkbox, ColumnContext, ComponentNodeContext, ComponentPropertyContext, Confirm, ContainerContext, DateFormats, Drawer, AnimationType as DrawerAnimationType, Dropdown, Empty, grid as Grid, Html, Icon, input as Input, ItemList, ItemTree, Lightbox, Link, List, Modal, NotFound, Overlay, Paragraph, Portal, RouteLink, RoutingContext, StyledText, SymbolBadge, TabStop, Text, TextLink, Timestamp, Tooltip, TransitionComponent, Typography, WidgetLink, WidgetOverlayOutlet, borderTabStyle, browser, buttonCss, contentBox, convertToStringAttributes, createEmptyComponent, createReactComponent, defaultRenderInstructions, embeddedLinkMapper, filterCssProps, filterCssPropsStyle, genericHashLink, genericHtml, headingElement, invertedHoverButton, itemList, linkTabStyle, list, paddedBorderTabStyle, parseHtmlString as processHtmlString, transitionComposer, useAction, useChildren, useColumns, useComponent, useComponentDescriptor, useComponentNode, useComponentPlatform, useContainer, useContext, useDispatch, useEventListener, useEvents, useIsMounted, useKeyPress, useLayout, usePrevious, useProperties, useRenderState, useRouteData, useRouter, useScroll, useSettings, useToggle, useTransitionEnd, useUniqueMenu, useWidgetEvent };
|
|
3693
|
+
export { AnchorLink, Button, Checkbox, ColumnContext, ComponentNodeContext, ComponentPropertyContext, Confirm, ContainerContext, DateFormats, Drawer, AnimationType as DrawerAnimationType, Dropdown, Empty, grid as Grid, Html, Icon, input as Input, ItemList, ItemTree, Lightbox, Link, List, Modal, NotFound, Overlay, Paragraph, Portal, RouteLink, RoutingContext, StyledText, SymbolBadge, TabStop, Text, TextLink, Timestamp, Tooltip, TransitionComponent, Typography, WidgetLink, WidgetOverlayOutlet, borderTabStyle, browser, buttonCss, contentBox, convertToStringAttributes, createEmptyComponent, createReactComponent, defaultRenderInstructions, embeddedLinkMapper, filterCssProps, filterCssPropsStyle, genericHashLink, genericHtml, headingElement, imageLightboxRenderer, invertedHoverButton, itemList, linkTabStyle, list, paddedBorderTabStyle, parseHtmlString as processHtmlString, transitionComposer, useAction, useChildren, useColumns, useComponent, useComponentDescriptor, useComponentNode, useComponentPlatform, useContainer, useContext, useDispatch, useEventListener, useEvents, useIsMounted, useKeyPress, useLayout, usePrevious, useProperties, useRenderState, useRouteData, useRouter, useScroll, useSettings, useToggle, useTransitionEnd, useUniqueMenu, useWidgetEvent };
|
|
3499
3694
|
//# sourceMappingURL=index.js.map
|