argous 1.2.228 → 1.2.229
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.
|
@@ -1,4 +1,15 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __assign = (this && this.__assign) || function () {
|
|
3
|
+
__assign = Object.assign || function(t) {
|
|
4
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
5
|
+
s = arguments[i];
|
|
6
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
7
|
+
t[p] = s[p];
|
|
8
|
+
}
|
|
9
|
+
return t;
|
|
10
|
+
};
|
|
11
|
+
return __assign.apply(this, arguments);
|
|
12
|
+
};
|
|
2
13
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
14
|
if (k2 === undefined) k2 = k;
|
|
4
15
|
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
@@ -26,7 +37,7 @@ var clsx_1 = __importDefault(require("clsx"));
|
|
|
26
37
|
var react_1 = __importStar(require("react"));
|
|
27
38
|
require("./style.css");
|
|
28
39
|
var Zoom = function (_a) {
|
|
29
|
-
var id = _a.id, children = _a.children;
|
|
40
|
+
var id = _a.id, style = _a.style, children = _a.children;
|
|
30
41
|
var figureId = (id) ? id + "-zoom-figure" : 'zoom-figure';
|
|
31
42
|
var _b = react_1.useState(false), active = _b[0], setActive = _b[1];
|
|
32
43
|
var copyMediaUrl = react_1.useCallback(function () {
|
|
@@ -62,6 +73,6 @@ var Zoom = function (_a) {
|
|
|
62
73
|
setActive(state);
|
|
63
74
|
(state) && zoom(e, state);
|
|
64
75
|
};
|
|
65
|
-
return react_1.default.createElement("figure", { id: figureId, onMouseMove: zoom, onTouchMove: zoom, onClick: handleActive, className: clsx_1.default('zoom-figure', { 'zoom-figure-active': active }) }, children);
|
|
76
|
+
return react_1.default.createElement("figure", __assign({}, { style: style }, { id: figureId, onMouseMove: zoom, onTouchMove: zoom, onClick: handleActive, className: clsx_1.default('zoom-figure', { 'zoom-figure-active': active }) }), children);
|
|
66
77
|
};
|
|
67
78
|
exports.default = Zoom;
|
|
@@ -3,7 +3,7 @@ import React, { useCallback, useEffect, useState } from 'react';
|
|
|
3
3
|
import './style.css';
|
|
4
4
|
|
|
5
5
|
|
|
6
|
-
const Zoom = ({ id, children }) => {
|
|
6
|
+
const Zoom = ({ id, style, children }) => {
|
|
7
7
|
|
|
8
8
|
const figureId = (id) ? `${id}-zoom-figure` : 'zoom-figure';
|
|
9
9
|
const [active, setActive] = useState(false);
|
|
@@ -42,6 +42,7 @@ const Zoom = ({ id, children }) => {
|
|
|
42
42
|
|
|
43
43
|
|
|
44
44
|
return <figure
|
|
45
|
+
{...{ style }}
|
|
45
46
|
id={figureId}
|
|
46
47
|
onMouseMove={zoom}
|
|
47
48
|
onTouchMove={zoom}
|