@ndla/carousel
Advanced tools
Comparing version 4.0.41 to 4.0.42
@@ -14,4 +14,3 @@ import _styled from "@emotion/styled/base"; | ||
import { breakpoints, mq, spacing, stackOrder } from "@ndla/core"; | ||
import { jsx as _jsx } from "@emotion/react/jsx-runtime"; | ||
import { jsxs as _jsxs } from "@emotion/react/jsx-runtime"; | ||
import { jsx as _jsx, jsxs as _jsxs } from "@emotion/react/jsx-runtime"; | ||
const StyledSlideContent = /*#__PURE__*/_styled("div", { | ||
@@ -68,6 +67,7 @@ target: "e97tf4t3", | ||
const slidePage = direction => { | ||
const firstChild = slideshowRef.current?.firstChild; | ||
var _slideshowRef$current, _slideContainer$curre; | ||
const firstChild = (_slideshowRef$current = slideshowRef.current) === null || _slideshowRef$current === void 0 ? void 0 : _slideshowRef$current.firstChild; | ||
if (!firstChild) return; | ||
const amount = firstChild.clientWidth * 3; | ||
slideContainer.current?.scrollBy({ | ||
(_slideContainer$curre = slideContainer.current) === null || _slideContainer$curre === void 0 || _slideContainer$curre.scrollBy({ | ||
left: direction === "right" ? amount : -amount, | ||
@@ -78,4 +78,5 @@ behavior: "smooth" | ||
const onMouseDown = e => { | ||
var _slideContainer$curre2; | ||
const pos = { | ||
left: slideContainer.current?.scrollLeft || 0, | ||
left: ((_slideContainer$curre2 = slideContainer.current) === null || _slideContainer$curre2 === void 0 ? void 0 : _slideContainer$curre2.scrollLeft) || 0, | ||
x: e.clientX | ||
@@ -91,3 +92,3 @@ }; | ||
const dx = e.clientX - pos.x; | ||
if (sliderContent && !sliderContent?.style.pointerEvents) { | ||
if (sliderContent && !(sliderContent !== null && sliderContent !== void 0 && sliderContent.style.pointerEvents)) { | ||
sliderContent.style.pointerEvents = "none"; | ||
@@ -103,4 +104,4 @@ } | ||
document.removeEventListener("mouseup", mouseUpHandler); | ||
sliderContent?.style.removeProperty("pointer-events"); | ||
slider?.style.removeProperty("user-select"); | ||
sliderContent === null || sliderContent === void 0 || sliderContent.style.removeProperty("pointer-events"); | ||
slider === null || slider === void 0 || slider.style.removeProperty("user-select"); | ||
document.body.style.removeProperty("cursor"); | ||
@@ -107,0 +108,0 @@ if (slider) { |
@@ -71,6 +71,7 @@ "use strict"; | ||
const slidePage = direction => { | ||
const firstChild = slideshowRef.current?.firstChild; | ||
var _slideshowRef$current, _slideContainer$curre; | ||
const firstChild = (_slideshowRef$current = slideshowRef.current) === null || _slideshowRef$current === void 0 ? void 0 : _slideshowRef$current.firstChild; | ||
if (!firstChild) return; | ||
const amount = firstChild.clientWidth * 3; | ||
slideContainer.current?.scrollBy({ | ||
(_slideContainer$curre = slideContainer.current) === null || _slideContainer$curre === void 0 || _slideContainer$curre.scrollBy({ | ||
left: direction === "right" ? amount : -amount, | ||
@@ -81,4 +82,5 @@ behavior: "smooth" | ||
const onMouseDown = e => { | ||
var _slideContainer$curre2; | ||
const pos = { | ||
left: slideContainer.current?.scrollLeft || 0, | ||
left: ((_slideContainer$curre2 = slideContainer.current) === null || _slideContainer$curre2 === void 0 ? void 0 : _slideContainer$curre2.scrollLeft) || 0, | ||
x: e.clientX | ||
@@ -94,3 +96,3 @@ }; | ||
const dx = e.clientX - pos.x; | ||
if (sliderContent && !sliderContent?.style.pointerEvents) { | ||
if (sliderContent && !(sliderContent !== null && sliderContent !== void 0 && sliderContent.style.pointerEvents)) { | ||
sliderContent.style.pointerEvents = "none"; | ||
@@ -106,4 +108,4 @@ } | ||
document.removeEventListener("mouseup", mouseUpHandler); | ||
sliderContent?.style.removeProperty("pointer-events"); | ||
slider?.style.removeProperty("user-select"); | ||
sliderContent === null || sliderContent === void 0 || sliderContent.style.removeProperty("pointer-events"); | ||
slider === null || slider === void 0 || slider.style.removeProperty("user-select"); | ||
document.body.style.removeProperty("cursor"); | ||
@@ -110,0 +112,0 @@ if (slider) { |
{ | ||
"name": "@ndla/carousel", | ||
"version": "4.0.41", | ||
"version": "4.0.42", | ||
"description": "Carousel for NDLA", | ||
@@ -29,4 +29,4 @@ "license": "GPL-3.0", | ||
"dependencies": { | ||
"@ndla/core": "^4.5.3", | ||
"@ndla/icons": "^6.1.1" | ||
"@ndla/core": "^4.5.4", | ||
"@ndla/icons": "^6.1.2" | ||
}, | ||
@@ -41,3 +41,3 @@ "peerDependencies": { | ||
}, | ||
"gitHead": "a48e1510a77dea42f1ab421f139ac0e796efbb47" | ||
"gitHead": "f6949c46c9b1b0876c2d5e5d5ec4f1b31db1c28b" | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
146755
760
Updated@ndla/core@^4.5.4
Updated@ndla/icons@^6.1.2