react-light-marquee
Advanced tools
Comparing version 0.1.11 to 0.1.12
@@ -0,3 +1,29 @@ | ||
"use strict"; | ||
var __defProp = Object.defineProperty; | ||
var __getOwnPropDesc = Object.getOwnPropertyDescriptor; | ||
var __getOwnPropNames = Object.getOwnPropertyNames; | ||
var __hasOwnProp = Object.prototype.hasOwnProperty; | ||
var __export = (target, all) => { | ||
for (var name in all) | ||
__defProp(target, name, { get: all[name], enumerable: true }); | ||
}; | ||
var __copyProps = (to, from, except, desc) => { | ||
if (from && typeof from === "object" || typeof from === "function") { | ||
for (let key of __getOwnPropNames(from)) | ||
if (!__hasOwnProp.call(to, key) && key !== except) | ||
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); | ||
} | ||
return to; | ||
}; | ||
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); | ||
// src/index.ts | ||
var src_exports = {}; | ||
__export(src_exports, { | ||
default: () => Marquee_default | ||
}); | ||
module.exports = __toCommonJS(src_exports); | ||
// src/Marquee/index.tsx | ||
import { useEffect, useRef, useState } from "react"; | ||
var import_react = require("react"); | ||
@@ -106,3 +132,3 @@ // src/Marquee/utils.ts | ||
// src/Marquee/index.tsx | ||
import { jsx } from "react/jsx-runtime"; | ||
var import_jsx_runtime = require("react/jsx-runtime"); | ||
var Marquee = ({ | ||
@@ -116,11 +142,11 @@ speed = 50, | ||
}) => { | ||
const wrapperRef = useRef(null); | ||
const [marqueeId, setMarqueeId] = useState(""); | ||
const [slides, setSlides] = useState( | ||
const wrapperRef = (0, import_react.useRef)(null); | ||
const [marqueeId, setMarqueeId] = (0, import_react.useState)(""); | ||
const [slides, setSlides] = (0, import_react.useState)( | ||
() => handleInitialSlide(initialSlideIndex, children) | ||
); | ||
useEffect(() => { | ||
setMarqueeId(`marquee_${crypto?.randomUUID() || (/* @__PURE__ */ new Date()).getTime()}`); | ||
(0, import_react.useEffect)(() => { | ||
setMarqueeId(`marquee_${crypto?.randomUUID() || (Math.random() + "").slice(2)}`); | ||
}, []); | ||
useEffect(() => { | ||
(0, import_react.useEffect)(() => { | ||
const wrapper = wrapperRef?.current; | ||
@@ -138,8 +164,6 @@ if (!wrapper || !marqueeId) return; | ||
[ | ||
`:root{ | ||
`:root { | ||
${playStateVariable}: ${play ? "running" : "paused"}; | ||
} | ||
`, | ||
` | ||
.${wrapperClassName} { | ||
}`, | ||
`.${wrapperClassName} { | ||
width: 100%; | ||
@@ -150,10 +174,7 @@ height: 100%; | ||
overflow: hidden; | ||
transform: ${rotateYInDeg}; | ||
} | ||
`, | ||
pauseOnHover ? ` | ||
.${wrapperClassName}:hover { | ||
${playStateVariable}: paused; | ||
} | ||
` : "" | ||
${rotateYInDeg && `transform: ${rotateYInDeg};`} | ||
}`, | ||
pauseOnHover ? `.${wrapperClassName}:hover { | ||
${playStateVariable}: paused; | ||
}` : "" | ||
].forEach(insertRule); | ||
@@ -200,3 +221,3 @@ const translateProp = getTranslateProp(direction); | ||
}, [marqueeId]); | ||
useEffect(() => { | ||
(0, import_react.useEffect)(() => { | ||
const wrapper = wrapperRef?.current; | ||
@@ -210,9 +231,6 @@ if (!wrapper || !marqueeId) return; | ||
} | ||
return /* @__PURE__ */ jsx("ul", { ref: wrapperRef, className: getWrapperClassName(marqueeId), children: slides.map((slide, slideIndex) => /* @__PURE__ */ jsx("li", { children: slide }, slideIndex)) }); | ||
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("ul", { ref: wrapperRef, className: getWrapperClassName(marqueeId), children: slides.map((slide, slideIndex) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)("li", { children: slide }, slideIndex)) }); | ||
}; | ||
Marquee.displayName = "Marquee"; | ||
var Marquee_default = Marquee; | ||
export { | ||
Marquee_default as default | ||
}; | ||
//# sourceMappingURL=index.js.map |
{ | ||
"name": "react-light-marquee", | ||
"version": "0.1.11", | ||
"version": "0.1.12", | ||
"private": false, | ||
"type": "module", | ||
"main": "./dist/index.js", | ||
"module": "./dist/index.mjs", | ||
"types": "./dist/index.d.ts", | ||
@@ -9,0 +7,0 @@ "files": [ |
Sorry, the diff of this file is not supported yet
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
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
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
47651
444
1
No