@onepercentio/one-ui 0.20.3 → 0.20.5
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/.prod.babelrc +0 -1
- package/dist/components/Chart/Chart.view.js +1 -0
- package/dist/components/Form/Form.js +1 -1
- package/dist/components/Header/Header.js +1 -1
- package/dist/components/LavaLamp/LavaLamp.js +8 -1
- package/dist/components/OrderableList/OrderableList.js +7 -3
- package/dist/components/PixelatedScan/PixelatedScan.js +2 -1
- package/dist/hooks/persistence/useLocalStorage.js +1 -0
- package/dist/hooks/ui/usePaginationControls.d.ts +2 -1
- package/dist/hooks/ui/usePaginationControls.js +10 -8
- package/dist/hooks/ui/useZoomable.js +29 -21
- package/dist/hooks/ui/useZoomable.module.scss +2 -2
- package/dist/hooks/useAsyncControl.js +1 -1
- package/dist/hooks/useHero.js +5 -1
- package/dist/hooks/useIntersection.js +1 -1
- package/dist/hooks/useObserve.js +4 -0
- package/dist/utility.d.js +3 -3
- package/dist/utils/blockchain.js +4 -4
- package/package.json +2 -1
- package/dist/hooks/ui/usePaginationControls.e2e.d.ts +0 -4
package/.prod.babelrc
CHANGED
|
@@ -7,6 +7,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
7
7
|
exports.default = ChartView;
|
|
8
8
|
var _react = _interopRequireWildcard(require("react"));
|
|
9
9
|
var _ChartModule = _interopRequireDefault(require("./Chart.module.scss"));
|
|
10
|
+
var _Chart = require("./Chart.e2e");
|
|
10
11
|
var _AnchoredTooltip = _interopRequireDefault(require("../AnchoredTooltip"));
|
|
11
12
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
12
13
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
@@ -73,7 +73,7 @@ function FirebaseForm(_ref4, ref) {
|
|
|
73
73
|
return typeof config[a].validator(form[a], form) === "string";
|
|
74
74
|
});
|
|
75
75
|
}, [form]);
|
|
76
|
-
function sendContact() {
|
|
76
|
+
function sendContact(_x2) {
|
|
77
77
|
return _sendContact.apply(this, arguments);
|
|
78
78
|
}
|
|
79
79
|
function _sendContact() {
|
|
@@ -92,7 +92,7 @@ function Controls(_ref) {
|
|
|
92
92
|
let options = _ref.options,
|
|
93
93
|
children = _ref.children,
|
|
94
94
|
mode = _ref.mode;
|
|
95
|
-
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, options.map(function (option) {
|
|
95
|
+
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, options.map(function (option, i) {
|
|
96
96
|
return /*#__PURE__*/_react.default.createElement(_Text.default, {
|
|
97
97
|
type: "link",
|
|
98
98
|
key: option.label,
|
|
@@ -18,7 +18,14 @@ function LavaLamp(_ref) {
|
|
|
18
18
|
let className = _ref.className,
|
|
19
19
|
children = _ref.children;
|
|
20
20
|
const circleRef = (0, _react.useRef)(null);
|
|
21
|
-
const _useLavaLampSetup = (0, _LavaLamp.default)(function (
|
|
21
|
+
const _useLavaLampSetup = (0, _LavaLamp.default)(function (cx, cy) {
|
|
22
|
+
const style = circleRef.current.style;
|
|
23
|
+
style.cx = cx;
|
|
24
|
+
style.cy = cy;
|
|
25
|
+
}, function (size) {
|
|
26
|
+
const style = circleRef.current.style;
|
|
27
|
+
style.r = size;
|
|
28
|
+
}),
|
|
22
29
|
relativeTo = _useLavaLampSetup.relativeTo,
|
|
23
30
|
d = _useLavaLampSetup.d,
|
|
24
31
|
circlesConfig = _useLavaLampSetup.circlesConfig;
|
|
@@ -352,9 +352,13 @@ function OrderableList(_ref) {
|
|
|
352
352
|
onAnchorClick({
|
|
353
353
|
target: relatedAnchor
|
|
354
354
|
});
|
|
355
|
-
const moveCb = (0, _throttle.default)(function () {
|
|
355
|
+
const moveCb = (0, _throttle.default)(function (e) {
|
|
356
|
+
const touch = e.touches[0];
|
|
357
|
+
const _ref5 = [touch.clientX, touch.clientY],
|
|
358
|
+
x = _ref5[0],
|
|
359
|
+
y = _ref5[1];
|
|
356
360
|
const els = Array.from(rootEl().children);
|
|
357
|
-
const currentElementIdx = els.findIndex(function (c) {
|
|
361
|
+
const currentElementIdx = els.findIndex(function (c, i) {
|
|
358
362
|
const rect = c === null || c === void 0 ? void 0 : c.getBoundingClientRect();
|
|
359
363
|
if (!rect) return false;
|
|
360
364
|
return rect.top < y && rect.top + rect.height > y;
|
|
@@ -438,7 +442,7 @@ function HeroWrapper(_ref6) {
|
|
|
438
442
|
return img.style.visibility = "hidden";
|
|
439
443
|
});
|
|
440
444
|
},
|
|
441
|
-
onHeroCloned: function onHeroCloned() {
|
|
445
|
+
onHeroCloned: function onHeroCloned(clone) {
|
|
442
446
|
// if (!clone.classList.contains(Styles.visible)) clone.style.opacity = "0";
|
|
443
447
|
},
|
|
444
448
|
onHeroEnd: function onHeroEnd() {
|
|
@@ -12,6 +12,7 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
|
|
|
12
12
|
function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
|
|
13
13
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
14
14
|
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
15
|
+
const DUD = _typeof("");
|
|
15
16
|
const toString = function toString(val) {
|
|
16
17
|
switch (_typeof(val)) {
|
|
17
18
|
case "boolean":
|
|
@@ -2,11 +2,12 @@ import { RefObject } from "react";
|
|
|
2
2
|
/**
|
|
3
3
|
* This hook handles the display of pagination controls for the user to move to another page
|
|
4
4
|
*/
|
|
5
|
-
export default function usePaginationControls(containerRef: RefObject<HTMLDivElement>, { snapToPage, baseWidth, snapToCutElement: _snapToCutElement, }?: {
|
|
5
|
+
export default function usePaginationControls(containerRef: RefObject<HTMLDivElement>, { snapToPage, baseWidth, snapToCutElement: _snapToCutElement, ...props }?: {
|
|
6
6
|
snapToPage?: boolean;
|
|
7
7
|
baseWidth?: number;
|
|
8
8
|
/** This will scroll only until the partially visible element is at the border, instead of scrolling all the container */
|
|
9
9
|
snapToCutElement?: boolean;
|
|
10
|
+
"data-testid"?: [left: string, right: string];
|
|
10
11
|
}): {
|
|
11
12
|
controls: JSX.Element[];
|
|
12
13
|
checkControlsRequirement: () => void;
|
|
@@ -11,19 +11,20 @@ var _FadeIn = _interopRequireDefault(require("../../components/FadeIn"));
|
|
|
11
11
|
var _OneUIProvider = require("../../context/OneUIProvider");
|
|
12
12
|
var _usePaginationControlsModule = _interopRequireDefault(require("./usePaginationControls.module.scss"));
|
|
13
13
|
var _html = require("../../utils/html.utils");
|
|
14
|
-
const _excluded = ["
|
|
15
|
-
_excluded2 = ["touches"]
|
|
14
|
+
const _excluded = ["snapToPage", "baseWidth", "snapToCutElement"],
|
|
15
|
+
_excluded2 = ["touches"],
|
|
16
|
+
_excluded3 = ["touches"];
|
|
16
17
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
17
18
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
18
19
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
19
|
-
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
20
|
-
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
21
20
|
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
22
21
|
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
23
22
|
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
24
23
|
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
25
24
|
function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
|
|
26
25
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
26
|
+
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
27
|
+
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
27
28
|
/**
|
|
28
29
|
* This hook handles the display of pagination controls for the user to move to another page
|
|
29
30
|
*/
|
|
@@ -31,7 +32,8 @@ function usePaginationControls(containerRef) {
|
|
|
31
32
|
let _ref = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},
|
|
32
33
|
snapToPage = _ref.snapToPage,
|
|
33
34
|
baseWidth = _ref.baseWidth,
|
|
34
|
-
_snapToCutElement = _ref.snapToCutElement
|
|
35
|
+
_snapToCutElement = _ref.snapToCutElement,
|
|
36
|
+
props = _objectWithoutProperties(_ref, _excluded);
|
|
35
37
|
const _useState = (0, _react.useState)([false, false]),
|
|
36
38
|
_useState2 = _slicedToArray(_useState, 2),
|
|
37
39
|
_useState2$ = _slicedToArray(_useState2[0], 2),
|
|
@@ -83,7 +85,7 @@ function usePaginationControls(containerRef) {
|
|
|
83
85
|
let lastX;
|
|
84
86
|
const onTouchStart = function onTouchStart(_ref2) {
|
|
85
87
|
let touches = _ref2.touches,
|
|
86
|
-
e = _objectWithoutProperties(_ref2,
|
|
88
|
+
e = _objectWithoutProperties(_ref2, _excluded2);
|
|
87
89
|
if (!(0, _html.isSameTarget)(e)) return;
|
|
88
90
|
const _ref3 = touches.item(0),
|
|
89
91
|
pageX = _ref3.pageX;
|
|
@@ -91,12 +93,12 @@ function usePaginationControls(containerRef) {
|
|
|
91
93
|
};
|
|
92
94
|
const onTouchMove = function onTouchMove(_ref4) {
|
|
93
95
|
let touches = _ref4.touches,
|
|
94
|
-
e = _objectWithoutProperties(_ref4,
|
|
96
|
+
e = _objectWithoutProperties(_ref4, _excluded3);
|
|
95
97
|
if (!(0, _html.isSameTarget)(e)) return;
|
|
96
98
|
const touch = touches.item(0);
|
|
97
99
|
lastX = touch.pageX;
|
|
98
100
|
};
|
|
99
|
-
const onTouchEnd = function onTouchEnd() {
|
|
101
|
+
const onTouchEnd = function onTouchEnd(e) {
|
|
100
102
|
if (!lastX) return;
|
|
101
103
|
const dir = lastX > startingX ? "l" : "r";
|
|
102
104
|
move(dir, true)();
|
|
@@ -7,6 +7,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
7
7
|
exports.default = useZoomable;
|
|
8
8
|
var _react = _interopRequireWildcard(require("react"));
|
|
9
9
|
var _useZoomableModule = _interopRequireDefault(require("./useZoomable.module.scss"));
|
|
10
|
+
var _client = require("react-dom/client");
|
|
10
11
|
var _reactDom = _interopRequireDefault(require("react-dom"));
|
|
11
12
|
var _useHero3 = _interopRequireDefault(require("../useHero"));
|
|
12
13
|
var _useMergeRefs = require("../useMergeRefs");
|
|
@@ -14,12 +15,6 @@ var _ownEvent = _interopRequireDefault(require("../../utils/ownEvent"));
|
|
|
14
15
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
15
16
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
16
17
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
17
|
-
const ON_HERO_START = {
|
|
18
|
-
onHeroStart: function onHeroStart(clone) {
|
|
19
|
-
return clone.classList.add(_useZoomableModule.default.overBackdrop);
|
|
20
|
-
}
|
|
21
|
-
};
|
|
22
|
-
|
|
23
18
|
/**
|
|
24
19
|
* Allows an element to be zoomable for fullscreen
|
|
25
20
|
*/
|
|
@@ -35,7 +30,6 @@ function useZoomable(id) {
|
|
|
35
30
|
repeatable: true
|
|
36
31
|
}, {
|
|
37
32
|
onHeroStart: function onHeroStart(clone) {
|
|
38
|
-
var _ref2;
|
|
39
33
|
const bd = getBackdrop();
|
|
40
34
|
const removeCb = function removeCb(_ref) {
|
|
41
35
|
let currentTarget = _ref.currentTarget,
|
|
@@ -46,10 +40,6 @@ function useZoomable(id) {
|
|
|
46
40
|
}
|
|
47
41
|
};
|
|
48
42
|
bd.style.opacity = "0";
|
|
49
|
-
for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
|
|
50
|
-
args[_key - 1] = arguments[_key];
|
|
51
|
-
}
|
|
52
|
-
(_ref2 = ON_HERO_START).onHeroStart.apply(_ref2, [clone].concat(args));
|
|
53
43
|
const middlewayClick = function middlewayClick() {
|
|
54
44
|
bd.removeEventListener("transitionend", removeCb);
|
|
55
45
|
clone.removeEventListener("click", middlewayClick);
|
|
@@ -75,18 +65,36 @@ function useZoomable(id) {
|
|
|
75
65
|
const elClone = el.cloneNode(true);
|
|
76
66
|
elClone.style.visibility = "hidden";
|
|
77
67
|
function HeroMount() {
|
|
68
|
+
const _useHero2 = (0, _useHero3.default)(zoomableID, {
|
|
69
|
+
"data-preffix": "zoomable",
|
|
70
|
+
repeatable: true
|
|
71
|
+
}, {
|
|
72
|
+
onHeroStart: function onHeroStart(clone) {
|
|
73
|
+
getBackdrop().style.opacity = "1";
|
|
74
|
+
const unzoomCb = function unzoomCb() {
|
|
75
|
+
_unzoom();
|
|
76
|
+
clone.removeEventListener("click", unzoomCb);
|
|
77
|
+
};
|
|
78
|
+
clone.addEventListener("click", unzoomCb);
|
|
79
|
+
},
|
|
80
|
+
onHeroEnd: function onHeroEnd() {
|
|
81
|
+
heroRef.current.classList.remove(_useZoomableModule.default.zoomableIndicator);
|
|
82
|
+
}
|
|
83
|
+
}),
|
|
84
|
+
heroRef = _useHero2.heroRef;
|
|
78
85
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
79
|
-
ref: function ref(
|
|
80
|
-
if (
|
|
81
|
-
|
|
86
|
+
ref: function ref(_ref2) {
|
|
87
|
+
if (_ref2) {
|
|
88
|
+
_ref2.appendChild(elClone);
|
|
89
|
+
heroRef.current = elClone;
|
|
82
90
|
const verticalProportion = el.clientWidth / el.clientHeight;
|
|
83
|
-
const targetWidth =
|
|
84
|
-
if (targetWidth >
|
|
91
|
+
const targetWidth = _ref2.clientHeight * verticalProportion;
|
|
92
|
+
if (targetWidth > _ref2.clientWidth) {
|
|
85
93
|
const horizontalProportion = el.clientHeight / el.clientWidth;
|
|
86
|
-
elClone.style.width =
|
|
87
|
-
elClone.style.height =
|
|
94
|
+
elClone.style.width = _ref2.clientWidth + "px";
|
|
95
|
+
elClone.style.height = _ref2.clientWidth * horizontalProportion + "px";
|
|
88
96
|
} else {
|
|
89
|
-
elClone.style.height =
|
|
97
|
+
elClone.style.height = _ref2.clientHeight + "px";
|
|
90
98
|
elClone.style.width = targetWidth + "px";
|
|
91
99
|
}
|
|
92
100
|
}
|
|
@@ -100,9 +108,9 @@ function useZoomable(id) {
|
|
|
100
108
|
backdrop.addEventListener("click", _unzoom);
|
|
101
109
|
backdrop.setAttribute("data-zoomable", zoomableID);
|
|
102
110
|
document.body.appendChild(backdrop);
|
|
103
|
-
|
|
111
|
+
(0, _client.createRoot)(backdrop).render( /*#__PURE__*/_react.default.createElement(HeroMount, null));
|
|
104
112
|
} else {
|
|
105
|
-
|
|
113
|
+
(0, _client.createRoot)(existingBackdrop).render( /*#__PURE__*/_react.default.createElement(HeroMount, null));
|
|
106
114
|
}
|
|
107
115
|
}
|
|
108
116
|
(0, _react.useEffect)(function () {
|
package/dist/hooks/useHero.js
CHANGED
|
@@ -164,7 +164,7 @@ function useHero(id) {
|
|
|
164
164
|
document.addEventListener("scroll", s, true);
|
|
165
165
|
clone.addEventListener("transitionend", transitionEndCb);
|
|
166
166
|
clone.addEventListener("transitionstart", function () {
|
|
167
|
-
const onCancelCb = (0, _ownEvent.default)(function () {
|
|
167
|
+
const onCancelCb = (0, _ownEvent.default)(function (e) {
|
|
168
168
|
clone.removeEventListener("transitionend", transitionEndCb);
|
|
169
169
|
clone.removeEventListener("transitioncancel", onCancelCb);
|
|
170
170
|
});
|
|
@@ -226,6 +226,10 @@ const TRANSITION_FACTORY = {
|
|
|
226
226
|
clone.style.setProperty("--origin-1", "".concat(originX, "% ").concat(originY, "%"));
|
|
227
227
|
clone.style.setProperty("--origin-2", "".concat(100 - originX, "% ").concat(100 - originY, "%"));
|
|
228
228
|
document.body.style.perspective = "100vw";
|
|
229
|
+
},
|
|
230
|
+
onHeroEnd: function onHeroEnd() {
|
|
231
|
+
if (events !== null && events !== void 0 && events.onHeroEnd) events.onHeroEnd();
|
|
232
|
+
document.body.style.perspective = "";
|
|
229
233
|
}
|
|
230
234
|
});
|
|
231
235
|
}
|
|
@@ -9,7 +9,7 @@ function useIntersection() {
|
|
|
9
9
|
const _useRef = (0, _react.useRef)([]),
|
|
10
10
|
targetMap = _useRef.current;
|
|
11
11
|
const _useRef2 = (0, _react.useRef)("IntersectionObserver" in window ? new IntersectionObserver(function (els) {
|
|
12
|
-
els.forEach(function (e) {
|
|
12
|
+
els.forEach(function (e, i) {
|
|
13
13
|
const result = targetMap.find(function (el) {
|
|
14
14
|
return el[0] === e.target;
|
|
15
15
|
});
|
package/dist/hooks/useObserve.js
CHANGED
|
@@ -13,6 +13,10 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
|
|
|
13
13
|
function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
|
|
14
14
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
15
15
|
function useObserve(toObserve, keysToObserve) {
|
|
16
|
+
const _useState = (0, _react.useState)(0),
|
|
17
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
18
|
+
_ = _useState2[0],
|
|
19
|
+
ss = _useState2[1];
|
|
16
20
|
(0, _react.useLayoutEffect)(function () {
|
|
17
21
|
const arr = Array.isArray(toObserve) ? toObserve : [toObserve];
|
|
18
22
|
const unwatchers = arr.map(function (object) {
|
package/dist/utility.d.js
CHANGED
|
@@ -6,12 +6,12 @@
|
|
|
6
6
|
* Redeclare this namespace with the usefull typings for your project and enjoy intelisense :)
|
|
7
7
|
*/
|
|
8
8
|
let OnepercentUtility;
|
|
9
|
-
(function () {
|
|
9
|
+
(function (_OnepercentUtility) {
|
|
10
10
|
/** The ids used by the useShortIntl hooks */
|
|
11
11
|
/** A type hint to bind the LinkToId action and the SectionContainer identifier */
|
|
12
12
|
/** A type hint to autocomplete functions related to the AsyncProcess context */
|
|
13
13
|
let AsyncQueue;
|
|
14
|
-
(function () {})(AsyncQueue || (AsyncQueue = {}));
|
|
14
|
+
(function (_AsyncQueue) {})(AsyncQueue || (AsyncQueue = {}));
|
|
15
15
|
let UIElements;
|
|
16
|
-
(function () {})(UIElements || (UIElements = {}));
|
|
16
|
+
(function (_UIElements) {})(UIElements || (UIElements = {}));
|
|
17
17
|
})(OnepercentUtility || (OnepercentUtility = {}));
|
package/dist/utils/blockchain.js
CHANGED
|
@@ -9,7 +9,7 @@ exports.sendAndWaitForConfirmation = sendAndWaitForConfirmation;
|
|
|
9
9
|
exports.waitForConfirmation = waitForConfirmation;
|
|
10
10
|
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
|
|
11
11
|
function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
|
|
12
|
-
function isTransactionMined() {
|
|
12
|
+
function isTransactionMined(_x, _x2) {
|
|
13
13
|
return _isTransactionMined.apply(this, arguments);
|
|
14
14
|
}
|
|
15
15
|
function _isTransactionMined() {
|
|
@@ -20,7 +20,7 @@ function _isTransactionMined() {
|
|
|
20
20
|
});
|
|
21
21
|
return _isTransactionMined.apply(this, arguments);
|
|
22
22
|
}
|
|
23
|
-
function waitForConfirmation() {
|
|
23
|
+
function waitForConfirmation(_x3, _x4) {
|
|
24
24
|
return _waitForConfirmation.apply(this, arguments);
|
|
25
25
|
}
|
|
26
26
|
function _waitForConfirmation() {
|
|
@@ -39,7 +39,7 @@ function _waitForConfirmation() {
|
|
|
39
39
|
}
|
|
40
40
|
}
|
|
41
41
|
});
|
|
42
|
-
return function () {
|
|
42
|
+
return function (_x7, _x8) {
|
|
43
43
|
return _ref.apply(this, arguments);
|
|
44
44
|
};
|
|
45
45
|
}());
|
|
@@ -55,7 +55,7 @@ function dispatchAndWait(func) {
|
|
|
55
55
|
_func.catch(rej);
|
|
56
56
|
});
|
|
57
57
|
}
|
|
58
|
-
function sendAndWaitForConfirmation() {
|
|
58
|
+
function sendAndWaitForConfirmation(_x5, _x6) {
|
|
59
59
|
return _sendAndWaitForConfirmation.apply(this, arguments);
|
|
60
60
|
}
|
|
61
61
|
function _sendAndWaitForConfirmation() {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@onepercentio/one-ui",
|
|
3
|
-
"version": "0.20.
|
|
3
|
+
"version": "0.20.5",
|
|
4
4
|
"description": "A set of reusable components created through the development of Onepercent projects",
|
|
5
5
|
"repository": "git@github.com:onepercentio/one-ui.git",
|
|
6
6
|
"author": "Murilo Oliveira de Araujo <murilo.araujo@onepercent.io>",
|
|
@@ -31,6 +31,7 @@
|
|
|
31
31
|
"@types/matter-js": "^0.18.2",
|
|
32
32
|
"@types/node": "^17.0.13",
|
|
33
33
|
"@types/react": "^18.0.28",
|
|
34
|
+
"@types/react-dom": "^18.2.7",
|
|
34
35
|
"@types/react-router-dom": "^5.3.3",
|
|
35
36
|
"assert": "^2.0.0",
|
|
36
37
|
"babel-loader": "^8.2.3",
|