argous 1.2.217 → 1.2.218
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/index.d.ts +1 -10
- package/dist/components/index.js +1 -11
- package/lib/components/index.d.ts +1 -10
- package/lib/components/index.js +1 -11
- package/package.json +1 -2
- package/lib/components/Carousel/Carousel.d.ts +0 -71
- package/lib/components/Carousel/Carousel.js +0 -218
- package/lib/components/Carousel/index.d.ts +0 -2
- package/lib/components/Carousel/index.js +0 -1
- package/lib/components/TextToHtml/Cursor.js +0 -24
- package/lib/components/TextToHtml/TextStyles.js +0 -111
- package/lib/components/TextToHtml/TextToHtml.d.ts +0 -38
- package/lib/components/TextToHtml/TextToHtml.js +0 -463
- package/lib/components/TextToHtml/icons/resize_area.svg +0 -2
- package/lib/components/TextToHtml/index.d.ts +0 -2
- package/lib/components/TextToHtml/index.js +0 -1
- package/lib/components/TextToHtml/style.css +0 -40
- package/lib/components/TextToHtml/utils.js +0 -848
- package/lib/components/Zoom/Zoom.d.ts +0 -11
- package/lib/components/Zoom/Zoom.js +0 -56
- package/lib/components/Zoom/index.d.ts +0 -2
- package/lib/components/Zoom/index.js +0 -1
- package/lib/components/Zoom/style.css +0 -25
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
import clsx from 'clsx';
|
|
2
|
-
import React, { useCallback, useEffect, useState } from 'react';
|
|
3
|
-
import './style.css';
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
const Zoom = ({ id, children }) => {
|
|
7
|
-
|
|
8
|
-
const figureId = (id) ? `${id}-zoom-figure` : 'zoom-figure';
|
|
9
|
-
const [active, setActive] = useState(false);
|
|
10
|
-
|
|
11
|
-
const copyMediaUrl = useCallback(() => {
|
|
12
|
-
const figureElement = document.getElementById(figureId);
|
|
13
|
-
const mediaElement = figureElement.children?.[0];
|
|
14
|
-
if (mediaElement) figureElement.style.backgroundImage = "url('" + mediaElement.src + "')";
|
|
15
|
-
}, [figureId]);
|
|
16
|
-
useEffect(() => setTimeout(() => copyMediaUrl(), 500), [copyMediaUrl]);
|
|
17
|
-
|
|
18
|
-
function zoom(e, activeParameter) {
|
|
19
|
-
if (active || activeParameter) {
|
|
20
|
-
let offsetX, offsetY, x, y;
|
|
21
|
-
const figureElement = document.getElementById(figureId);
|
|
22
|
-
|
|
23
|
-
if (figureElement) {
|
|
24
|
-
if (e?.nativeEvent?.offsetX) offsetX = e.nativeEvent.offsetX;
|
|
25
|
-
else offsetX = e?.touches?.[0].pageX;
|
|
26
|
-
if (e?.nativeEvent?.offsetY) offsetY = e.nativeEvent.offsetY;
|
|
27
|
-
else offsetX = e?.touches?.[0].pageX;
|
|
28
|
-
|
|
29
|
-
x = ((offsetX / figureElement.offsetWidth) * 100);
|
|
30
|
-
y = ((offsetY / figureElement.offsetHeight) * 100);
|
|
31
|
-
|
|
32
|
-
figureElement.style.backgroundPosition = `${x}% ${y}%`;
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
const handleActive = e => {
|
|
38
|
-
const state = !active;
|
|
39
|
-
setActive(state);
|
|
40
|
-
(state) && zoom(e, state);
|
|
41
|
-
};
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
return <figure
|
|
45
|
-
id={figureId}
|
|
46
|
-
onMouseMove={zoom}
|
|
47
|
-
onTouchMove={zoom}
|
|
48
|
-
onClick={handleActive}
|
|
49
|
-
className={clsx('zoom-figure', { 'zoom-figure-active': active })}
|
|
50
|
-
>
|
|
51
|
-
{children}
|
|
52
|
-
</figure>;
|
|
53
|
-
};
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
export default Zoom;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { default } from './Zoom';
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
figure.zoom-figure {
|
|
2
|
-
position: relative;
|
|
3
|
-
overflow: hidden;
|
|
4
|
-
cursor: zoom-in;
|
|
5
|
-
cursor: -moz-zoom-in;
|
|
6
|
-
cursor: -webkit-zoom-in;
|
|
7
|
-
background-repeat: no-repeat;
|
|
8
|
-
background-position: 50% 50%;
|
|
9
|
-
|
|
10
|
-
img {
|
|
11
|
-
transition: opacity 250ms;
|
|
12
|
-
display: block;
|
|
13
|
-
width: 100%;
|
|
14
|
-
}
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
figure.zoom-figure-active {
|
|
18
|
-
cursor: zoom-out;
|
|
19
|
-
cursor: -moz-zoom-out;
|
|
20
|
-
cursor: -webkit-zoom-out;
|
|
21
|
-
|
|
22
|
-
& img:hover {
|
|
23
|
-
opacity: 0;
|
|
24
|
-
}
|
|
25
|
-
}
|