@peersyst/react-utils
Advanced tools
Comparing version 2.4.0 to 2.4.1
@@ -1,4 +0,4 @@ | ||
export declare type ColorFormat = "rgb" | "rgba" | "hsl" | "hsla" | "color"; | ||
export declare type ColorValues = [number, number, number] | [number, number, number, number | string]; | ||
export declare type ColorSpace = "srgb" | "display-p3" | "a98-rgb" | "prophoto-rgb" | "rec-2020"; | ||
export type ColorFormat = "rgb" | "rgba" | "hsl" | "hsla" | "color"; | ||
export type ColorValues = [number, number, number] | [number, number, number, number | string]; | ||
export type ColorSpace = "srgb" | "display-p3" | "a98-rgb" | "prophoto-rgb" | "rec-2020"; | ||
export interface ColorObject { | ||
@@ -5,0 +5,0 @@ type: ColorFormat; |
@@ -1,2 +0,2 @@ | ||
export declare type HashEllipsis = "middle" | "end"; | ||
export type HashEllipsis = "middle" | "end"; | ||
export default function formatHash(hash: string, ellipsis?: HashEllipsis, length?: number): string; |
@@ -1,2 +0,2 @@ | ||
export declare type Polling<R> = Promise<R> & { | ||
export type Polling<R> = Promise<R> & { | ||
abort(): void; | ||
@@ -3,0 +3,0 @@ }; |
import { ForwardRefExoticComponent, ForwardedRef, JSXElementConstructor, PropsWithoutRef, ReactNode, RefAttributes } from "react"; | ||
export declare type Slots<S extends string[], E extends object> = { | ||
export type Slots<S extends string[], E extends object> = { | ||
[K in Exclude<S[number], keyof E>]: JSXElementConstructor<{ | ||
@@ -9,3 +9,3 @@ children: ReactNode; | ||
}; | ||
export declare type SlotElements<S extends string[]> = { | ||
export type SlotElements<S extends string[]> = { | ||
[K in S[number]]: JSX.Element; | ||
@@ -12,0 +12,0 @@ }; |
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty"; | ||
import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck"; | ||
import _createClass from "@babel/runtime/helpers/esm/createClass"; | ||
import _inherits from "@babel/runtime/helpers/esm/inherits"; | ||
import _possibleConstructorReturn from "@babel/runtime/helpers/esm/possibleConstructorReturn"; | ||
import _getPrototypeOf from "@babel/runtime/helpers/esm/getPrototypeOf"; | ||
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; } | ||
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; } | ||
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; } | ||
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } } | ||
import _inherits from "@babel/runtime/helpers/esm/inherits"; | ||
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; } | ||
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; } | ||
function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); } | ||
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } | ||
import { Component as ReactComponent } from "react"; | ||
@@ -16,6 +16,5 @@ import { jsx as _jsx } from "react/jsx-runtime"; | ||
_inherits(ClassComponent, _ReactComponent); | ||
var _super = _createSuper(ClassComponent); | ||
function ClassComponent() { | ||
_classCallCheck(this, ClassComponent); | ||
return _super.apply(this, arguments); | ||
return _callSuper(this, ClassComponent, arguments); | ||
} | ||
@@ -22,0 +21,0 @@ _createClass(ClassComponent, [{ |
@@ -178,3 +178,2 @@ //MUI Color utils | ||
} | ||
return val <= 0.03928 ? val / 12.92 : Math.pow((val + 0.055) / 1.055, 2.4); | ||
@@ -181,0 +180,0 @@ }); |
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty"; | ||
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; } | ||
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; } | ||
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; } | ||
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; } | ||
import { Fragment } from "react"; | ||
@@ -5,0 +5,0 @@ import { jsx as _jsx } from "react/jsx-runtime"; |
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty"; | ||
import _typeof from "@babel/runtime/helpers/esm/typeof"; | ||
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; } | ||
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; } | ||
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; } | ||
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; } | ||
export function isPlainObject(item) { | ||
@@ -6,0 +6,0 @@ return item !== null && _typeof(item) === "object" && (item == null ? void 0 : item.constructor) === Object; |
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty"; | ||
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray"; | ||
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; } | ||
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; } | ||
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; } | ||
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; } | ||
export default function extract(obj) { | ||
@@ -6,0 +6,0 @@ for (var _len = arguments.length, keys = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { |
import _toConsumableArray from "@babel/runtime/helpers/esm/toConsumableArray"; | ||
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty"; | ||
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray"; | ||
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; } | ||
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; } | ||
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; } | ||
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; } | ||
import { Children, isValidElement } from "react"; | ||
@@ -7,0 +7,0 @@ |
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty"; | ||
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; } | ||
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; } | ||
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; } | ||
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; } | ||
export default function (obj) { | ||
@@ -5,0 +5,0 @@ for (var _len = arguments.length, keys = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { |
@@ -11,3 +11,3 @@ import _toArray from "@babel/runtime/helpers/esm/toArray"; | ||
// @ts-ignore | ||
// @ts-ignore+ | ||
return restKeys.reduce(function (prev, curr) { | ||
@@ -14,0 +14,0 @@ return prev[curr]; |
@@ -12,89 +12,83 @@ import _asyncToGenerator from "@babel/runtime/helpers/esm/asyncToGenerator"; | ||
return _regeneratorRuntime.wrap(function _callee3$(_context3) { | ||
while (1) { | ||
switch (_context3.prev = _context3.next) { | ||
case 0: | ||
_resolveFn = function _resolveFn3() { | ||
_resolveFn = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2() { | ||
return _regeneratorRuntime.wrap(function _callee2$(_context2) { | ||
while (1) { | ||
switch (_context2.prev = _context2.next) { | ||
case 0: | ||
promiseDidTimeout = false; | ||
_context2.prev = 1; | ||
_context2.next = 4; | ||
return timeoutMs !== undefined ? timeoutPromise(fn(), timeoutMs) : fn(); | ||
case 4: | ||
return _context2.abrupt("return", _context2.sent); | ||
case 7: | ||
_context2.prev = 7; | ||
_context2.t0 = _context2["catch"](1); | ||
if (!(_context2.t0 instanceof TimeoutPromiseError)) { | ||
_context2.next = 13; | ||
break; | ||
} | ||
promiseDidTimeout = true; | ||
_context2.next = 14; | ||
break; | ||
case 13: | ||
throw _context2.t0; | ||
case 14: | ||
case "end": | ||
return _context2.stop(); | ||
while (1) switch (_context3.prev = _context3.next) { | ||
case 0: | ||
_resolveFn = function _resolveFn3() { | ||
_resolveFn = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2() { | ||
return _regeneratorRuntime.wrap(function _callee2$(_context2) { | ||
while (1) switch (_context2.prev = _context2.next) { | ||
case 0: | ||
promiseDidTimeout = false; | ||
_context2.prev = 1; | ||
_context2.next = 4; | ||
return timeoutMs !== undefined ? timeoutPromise(fn(), timeoutMs) : fn(); | ||
case 4: | ||
return _context2.abrupt("return", _context2.sent); | ||
case 7: | ||
_context2.prev = 7; | ||
_context2.t0 = _context2["catch"](1); | ||
if (!(_context2.t0 instanceof TimeoutPromiseError)) { | ||
_context2.next = 13; | ||
break; | ||
} | ||
} | ||
}, _callee2, null, [[1, 7]]); | ||
})); | ||
return _resolveFn.apply(this, arguments); | ||
}; | ||
resolveFn = function _resolveFn2() { | ||
return _resolveFn.apply(this, arguments); | ||
}; | ||
_options$delay = options.delay, delay = _options$delay === void 0 ? 1000 : _options$delay, maxIterations = options.maxIterations, timeoutMs = options.timeout; | ||
i = 0; | ||
promiseDidTimeout = false; | ||
_context3.next = 7; | ||
return resolveFn(); | ||
case 7: | ||
res = _context3.sent; | ||
case 8: | ||
if (!(!abort && (promiseDidTimeout || condition(res)))) { | ||
_context3.next = 15; | ||
break; | ||
} | ||
if (!(i === maxIterations)) { | ||
_context3.next = 11; | ||
break; | ||
} | ||
throw new Error("Polling executed the maximum number iterations"); | ||
case 11: | ||
_context3.next = 13; | ||
return new Promise(function (resolve) { | ||
timeout = setTimeout( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee() { | ||
return _regeneratorRuntime.wrap(function _callee$(_context) { | ||
while (1) { | ||
switch (_context.prev = _context.next) { | ||
case 0: | ||
i++; | ||
_context.next = 3; | ||
return resolveFn(); | ||
case 3: | ||
res = _context.sent; | ||
resolve(); | ||
case 5: | ||
case "end": | ||
return _context.stop(); | ||
} | ||
} | ||
}, _callee); | ||
})), delay); | ||
}); | ||
case 13: | ||
_context3.next = 8; | ||
promiseDidTimeout = true; | ||
_context2.next = 14; | ||
break; | ||
case 13: | ||
throw _context2.t0; | ||
case 14: | ||
case "end": | ||
return _context2.stop(); | ||
} | ||
}, _callee2, null, [[1, 7]]); | ||
})); | ||
return _resolveFn.apply(this, arguments); | ||
}; | ||
resolveFn = function _resolveFn2() { | ||
return _resolveFn.apply(this, arguments); | ||
}; | ||
_options$delay = options.delay, delay = _options$delay === void 0 ? 1000 : _options$delay, maxIterations = options.maxIterations, timeoutMs = options.timeout; | ||
i = 0; | ||
promiseDidTimeout = false; | ||
_context3.next = 7; | ||
return resolveFn(); | ||
case 7: | ||
res = _context3.sent; | ||
case 8: | ||
if (!(!abort && (promiseDidTimeout || condition(res)))) { | ||
_context3.next = 15; | ||
break; | ||
case 15: | ||
return _context3.abrupt("return", res); | ||
case 16: | ||
case "end": | ||
return _context3.stop(); | ||
} | ||
} | ||
if (!(i === maxIterations)) { | ||
_context3.next = 11; | ||
break; | ||
} | ||
throw new Error("Polling executed the maximum number iterations"); | ||
case 11: | ||
_context3.next = 13; | ||
return new Promise(function (resolve) { | ||
timeout = setTimeout( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee() { | ||
return _regeneratorRuntime.wrap(function _callee$(_context) { | ||
while (1) switch (_context.prev = _context.next) { | ||
case 0: | ||
i++; | ||
_context.next = 3; | ||
return resolveFn(); | ||
case 3: | ||
res = _context.sent; | ||
resolve(); | ||
case 5: | ||
case "end": | ||
return _context.stop(); | ||
} | ||
}, _callee); | ||
})), delay); | ||
}); | ||
case 13: | ||
_context3.next = 8; | ||
break; | ||
case 15: | ||
return _context3.abrupt("return", res); | ||
case 16: | ||
case "end": | ||
return _context3.stop(); | ||
} | ||
@@ -101,0 +95,0 @@ }, _callee3); |
@@ -7,5 +7,5 @@ import _defineProperty from "@babel/runtime/helpers/esm/defineProperty"; | ||
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); } | ||
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; } | ||
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; } | ||
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; } | ||
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; } | ||
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; } | ||
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; } | ||
import { forwardRef } from "react"; | ||
@@ -17,2 +17,4 @@ import extractSlots from "./extractSlots"; | ||
//eslint-disable-next-line @typescript-eslint/ban-types | ||
/** | ||
@@ -19,0 +21,0 @@ * Utility that creates racks and its slots. |
import _asyncToGenerator from "@babel/runtime/helpers/esm/asyncToGenerator"; | ||
import _createClass from "@babel/runtime/helpers/esm/createClass"; | ||
import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck"; | ||
import _inherits from "@babel/runtime/helpers/esm/inherits"; | ||
import _possibleConstructorReturn from "@babel/runtime/helpers/esm/possibleConstructorReturn"; | ||
import _getPrototypeOf from "@babel/runtime/helpers/esm/getPrototypeOf"; | ||
import _inherits from "@babel/runtime/helpers/esm/inherits"; | ||
import _wrapNativeSuper from "@babel/runtime/helpers/esm/wrapNativeSuper"; | ||
import _regeneratorRuntime from "@babel/runtime/regenerator"; | ||
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; } | ||
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } } | ||
function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); } | ||
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } | ||
export var TimeoutPromiseError = /*#__PURE__*/function (_Error) { | ||
_inherits(TimeoutPromiseError, _Error); | ||
var _super = _createSuper(TimeoutPromiseError); | ||
function TimeoutPromiseError() { | ||
_classCallCheck(this, TimeoutPromiseError); | ||
return _super.call(this, "Promise timeout"); | ||
return _callSuper(this, TimeoutPromiseError, ["Promise timeout"]); | ||
} | ||
@@ -27,20 +26,18 @@ return _createClass(TimeoutPromiseError); | ||
return _regeneratorRuntime.wrap(function _callee$(_context) { | ||
while (1) { | ||
switch (_context.prev = _context.next) { | ||
case 0: | ||
rejectedPromise = new Promise(function (_, reject) { | ||
timeout = setTimeout(function () { | ||
reject(new TimeoutPromiseError()); | ||
}, ms); | ||
}); | ||
_context.next = 3; | ||
return Promise.race([promise, rejectedPromise]); | ||
case 3: | ||
res = _context.sent; | ||
clearTimeout(timeout); | ||
return _context.abrupt("return", res); | ||
case 6: | ||
case "end": | ||
return _context.stop(); | ||
} | ||
while (1) switch (_context.prev = _context.next) { | ||
case 0: | ||
rejectedPromise = new Promise(function (_, reject) { | ||
timeout = setTimeout(function () { | ||
reject(new TimeoutPromiseError()); | ||
}, ms); | ||
}); | ||
_context.next = 3; | ||
return Promise.race([promise, rejectedPromise]); | ||
case 3: | ||
res = _context.sent; | ||
clearTimeout(timeout); | ||
return _context.abrupt("return", res); | ||
case 6: | ||
case "end": | ||
return _context.stop(); | ||
} | ||
@@ -47,0 +44,0 @@ }, _callee); |
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty"; | ||
import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck"; | ||
import _createClass from "@babel/runtime/helpers/esm/createClass"; | ||
import _inherits from "@babel/runtime/helpers/esm/inherits"; | ||
import _possibleConstructorReturn from "@babel/runtime/helpers/esm/possibleConstructorReturn"; | ||
import _getPrototypeOf from "@babel/runtime/helpers/esm/getPrototypeOf"; | ||
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; } | ||
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; } | ||
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; } | ||
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } } | ||
import _inherits from "@babel/runtime/helpers/esm/inherits"; | ||
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; } | ||
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; } | ||
function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); } | ||
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } | ||
import { Component as ReactComponent } from "react"; | ||
@@ -16,6 +16,5 @@ import { jsx as _jsx } from "react/jsx-runtime"; | ||
_inherits(ClassComponent, _ReactComponent); | ||
var _super = _createSuper(ClassComponent); | ||
function ClassComponent() { | ||
_classCallCheck(this, ClassComponent); | ||
return _super.apply(this, arguments); | ||
return _callSuper(this, ClassComponent, arguments); | ||
} | ||
@@ -22,0 +21,0 @@ _createClass(ClassComponent, [{ |
@@ -178,3 +178,2 @@ //MUI Color utils | ||
} | ||
return val <= 0.03928 ? val / 12.92 : Math.pow((val + 0.055) / 1.055, 2.4); | ||
@@ -181,0 +180,0 @@ }); |
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty"; | ||
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; } | ||
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; } | ||
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; } | ||
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; } | ||
import { Fragment } from "react"; | ||
@@ -5,0 +5,0 @@ import { jsx as _jsx } from "react/jsx-runtime"; |
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty"; | ||
import _typeof from "@babel/runtime/helpers/esm/typeof"; | ||
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; } | ||
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; } | ||
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; } | ||
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; } | ||
export function isPlainObject(item) { | ||
@@ -6,0 +6,0 @@ return item !== null && _typeof(item) === "object" && (item == null ? void 0 : item.constructor) === Object; |
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty"; | ||
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray"; | ||
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; } | ||
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; } | ||
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; } | ||
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; } | ||
export default function extract(obj) { | ||
@@ -6,0 +6,0 @@ for (var _len = arguments.length, keys = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { |
import _toConsumableArray from "@babel/runtime/helpers/esm/toConsumableArray"; | ||
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty"; | ||
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray"; | ||
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; } | ||
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; } | ||
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; } | ||
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; } | ||
import { Children, isValidElement } from "react"; | ||
@@ -7,0 +7,0 @@ |
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty"; | ||
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; } | ||
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; } | ||
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; } | ||
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; } | ||
export default function (obj) { | ||
@@ -5,0 +5,0 @@ for (var _len = arguments.length, keys = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { |
@@ -11,3 +11,3 @@ import _toArray from "@babel/runtime/helpers/esm/toArray"; | ||
// @ts-ignore | ||
// @ts-ignore+ | ||
return restKeys.reduce(function (prev, curr) { | ||
@@ -14,0 +14,0 @@ return prev[curr]; |
@@ -12,89 +12,83 @@ import _asyncToGenerator from "@babel/runtime/helpers/esm/asyncToGenerator"; | ||
return _regeneratorRuntime.wrap(function _callee3$(_context3) { | ||
while (1) { | ||
switch (_context3.prev = _context3.next) { | ||
case 0: | ||
_resolveFn = function _resolveFn3() { | ||
_resolveFn = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2() { | ||
return _regeneratorRuntime.wrap(function _callee2$(_context2) { | ||
while (1) { | ||
switch (_context2.prev = _context2.next) { | ||
case 0: | ||
promiseDidTimeout = false; | ||
_context2.prev = 1; | ||
_context2.next = 4; | ||
return timeoutMs !== undefined ? timeoutPromise(fn(), timeoutMs) : fn(); | ||
case 4: | ||
return _context2.abrupt("return", _context2.sent); | ||
case 7: | ||
_context2.prev = 7; | ||
_context2.t0 = _context2["catch"](1); | ||
if (!(_context2.t0 instanceof TimeoutPromiseError)) { | ||
_context2.next = 13; | ||
break; | ||
} | ||
promiseDidTimeout = true; | ||
_context2.next = 14; | ||
break; | ||
case 13: | ||
throw _context2.t0; | ||
case 14: | ||
case "end": | ||
return _context2.stop(); | ||
while (1) switch (_context3.prev = _context3.next) { | ||
case 0: | ||
_resolveFn = function _resolveFn3() { | ||
_resolveFn = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2() { | ||
return _regeneratorRuntime.wrap(function _callee2$(_context2) { | ||
while (1) switch (_context2.prev = _context2.next) { | ||
case 0: | ||
promiseDidTimeout = false; | ||
_context2.prev = 1; | ||
_context2.next = 4; | ||
return timeoutMs !== undefined ? timeoutPromise(fn(), timeoutMs) : fn(); | ||
case 4: | ||
return _context2.abrupt("return", _context2.sent); | ||
case 7: | ||
_context2.prev = 7; | ||
_context2.t0 = _context2["catch"](1); | ||
if (!(_context2.t0 instanceof TimeoutPromiseError)) { | ||
_context2.next = 13; | ||
break; | ||
} | ||
} | ||
}, _callee2, null, [[1, 7]]); | ||
})); | ||
return _resolveFn.apply(this, arguments); | ||
}; | ||
resolveFn = function _resolveFn2() { | ||
return _resolveFn.apply(this, arguments); | ||
}; | ||
_options$delay = options.delay, delay = _options$delay === void 0 ? 1000 : _options$delay, maxIterations = options.maxIterations, timeoutMs = options.timeout; | ||
i = 0; | ||
promiseDidTimeout = false; | ||
_context3.next = 7; | ||
return resolveFn(); | ||
case 7: | ||
res = _context3.sent; | ||
case 8: | ||
if (!(!abort && (promiseDidTimeout || condition(res)))) { | ||
_context3.next = 15; | ||
break; | ||
} | ||
if (!(i === maxIterations)) { | ||
_context3.next = 11; | ||
break; | ||
} | ||
throw new Error("Polling executed the maximum number iterations"); | ||
case 11: | ||
_context3.next = 13; | ||
return new Promise(function (resolve) { | ||
timeout = setTimeout( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee() { | ||
return _regeneratorRuntime.wrap(function _callee$(_context) { | ||
while (1) { | ||
switch (_context.prev = _context.next) { | ||
case 0: | ||
i++; | ||
_context.next = 3; | ||
return resolveFn(); | ||
case 3: | ||
res = _context.sent; | ||
resolve(); | ||
case 5: | ||
case "end": | ||
return _context.stop(); | ||
} | ||
} | ||
}, _callee); | ||
})), delay); | ||
}); | ||
case 13: | ||
_context3.next = 8; | ||
promiseDidTimeout = true; | ||
_context2.next = 14; | ||
break; | ||
case 13: | ||
throw _context2.t0; | ||
case 14: | ||
case "end": | ||
return _context2.stop(); | ||
} | ||
}, _callee2, null, [[1, 7]]); | ||
})); | ||
return _resolveFn.apply(this, arguments); | ||
}; | ||
resolveFn = function _resolveFn2() { | ||
return _resolveFn.apply(this, arguments); | ||
}; | ||
_options$delay = options.delay, delay = _options$delay === void 0 ? 1000 : _options$delay, maxIterations = options.maxIterations, timeoutMs = options.timeout; | ||
i = 0; | ||
promiseDidTimeout = false; | ||
_context3.next = 7; | ||
return resolveFn(); | ||
case 7: | ||
res = _context3.sent; | ||
case 8: | ||
if (!(!abort && (promiseDidTimeout || condition(res)))) { | ||
_context3.next = 15; | ||
break; | ||
case 15: | ||
return _context3.abrupt("return", res); | ||
case 16: | ||
case "end": | ||
return _context3.stop(); | ||
} | ||
} | ||
if (!(i === maxIterations)) { | ||
_context3.next = 11; | ||
break; | ||
} | ||
throw new Error("Polling executed the maximum number iterations"); | ||
case 11: | ||
_context3.next = 13; | ||
return new Promise(function (resolve) { | ||
timeout = setTimeout( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee() { | ||
return _regeneratorRuntime.wrap(function _callee$(_context) { | ||
while (1) switch (_context.prev = _context.next) { | ||
case 0: | ||
i++; | ||
_context.next = 3; | ||
return resolveFn(); | ||
case 3: | ||
res = _context.sent; | ||
resolve(); | ||
case 5: | ||
case "end": | ||
return _context.stop(); | ||
} | ||
}, _callee); | ||
})), delay); | ||
}); | ||
case 13: | ||
_context3.next = 8; | ||
break; | ||
case 15: | ||
return _context3.abrupt("return", res); | ||
case 16: | ||
case "end": | ||
return _context3.stop(); | ||
} | ||
@@ -101,0 +95,0 @@ }, _callee3); |
@@ -7,5 +7,5 @@ import _defineProperty from "@babel/runtime/helpers/esm/defineProperty"; | ||
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); } | ||
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; } | ||
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; } | ||
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; } | ||
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; } | ||
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; } | ||
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; } | ||
import { forwardRef } from "react"; | ||
@@ -17,2 +17,4 @@ import extractSlots from "./extractSlots"; | ||
//eslint-disable-next-line @typescript-eslint/ban-types | ||
/** | ||
@@ -19,0 +21,0 @@ * Utility that creates racks and its slots. |
import _asyncToGenerator from "@babel/runtime/helpers/esm/asyncToGenerator"; | ||
import _createClass from "@babel/runtime/helpers/esm/createClass"; | ||
import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck"; | ||
import _inherits from "@babel/runtime/helpers/esm/inherits"; | ||
import _possibleConstructorReturn from "@babel/runtime/helpers/esm/possibleConstructorReturn"; | ||
import _getPrototypeOf from "@babel/runtime/helpers/esm/getPrototypeOf"; | ||
import _inherits from "@babel/runtime/helpers/esm/inherits"; | ||
import _wrapNativeSuper from "@babel/runtime/helpers/esm/wrapNativeSuper"; | ||
import _regeneratorRuntime from "@babel/runtime/regenerator"; | ||
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; } | ||
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } } | ||
function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); } | ||
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } | ||
export var TimeoutPromiseError = /*#__PURE__*/function (_Error) { | ||
_inherits(TimeoutPromiseError, _Error); | ||
var _super = _createSuper(TimeoutPromiseError); | ||
function TimeoutPromiseError() { | ||
_classCallCheck(this, TimeoutPromiseError); | ||
return _super.call(this, "Promise timeout"); | ||
return _callSuper(this, TimeoutPromiseError, ["Promise timeout"]); | ||
} | ||
@@ -27,20 +26,18 @@ return _createClass(TimeoutPromiseError); | ||
return _regeneratorRuntime.wrap(function _callee$(_context) { | ||
while (1) { | ||
switch (_context.prev = _context.next) { | ||
case 0: | ||
rejectedPromise = new Promise(function (_, reject) { | ||
timeout = setTimeout(function () { | ||
reject(new TimeoutPromiseError()); | ||
}, ms); | ||
}); | ||
_context.next = 3; | ||
return Promise.race([promise, rejectedPromise]); | ||
case 3: | ||
res = _context.sent; | ||
clearTimeout(timeout); | ||
return _context.abrupt("return", res); | ||
case 6: | ||
case "end": | ||
return _context.stop(); | ||
} | ||
while (1) switch (_context.prev = _context.next) { | ||
case 0: | ||
rejectedPromise = new Promise(function (_, reject) { | ||
timeout = setTimeout(function () { | ||
reject(new TimeoutPromiseError()); | ||
}, ms); | ||
}); | ||
_context.next = 3; | ||
return Promise.race([promise, rejectedPromise]); | ||
case 3: | ||
res = _context.sent; | ||
clearTimeout(timeout); | ||
return _context.abrupt("return", res); | ||
case 6: | ||
case "end": | ||
return _context.stop(); | ||
} | ||
@@ -47,0 +44,0 @@ }, _callee); |
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty"; | ||
import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck"; | ||
import _createClass from "@babel/runtime/helpers/esm/createClass"; | ||
import _inherits from "@babel/runtime/helpers/esm/inherits"; | ||
import _possibleConstructorReturn from "@babel/runtime/helpers/esm/possibleConstructorReturn"; | ||
import _getPrototypeOf from "@babel/runtime/helpers/esm/getPrototypeOf"; | ||
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; } | ||
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; } | ||
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; } | ||
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } } | ||
import _inherits from "@babel/runtime/helpers/esm/inherits"; | ||
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; } | ||
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; } | ||
function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); } | ||
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } | ||
import { Component as ReactComponent } from "react"; | ||
@@ -16,6 +16,5 @@ import { jsx as _jsx } from "react/jsx-runtime"; | ||
_inherits(ClassComponent, _ReactComponent); | ||
var _super = _createSuper(ClassComponent); | ||
function ClassComponent() { | ||
_classCallCheck(this, ClassComponent); | ||
return _super.apply(this, arguments); | ||
return _callSuper(this, ClassComponent, arguments); | ||
} | ||
@@ -22,0 +21,0 @@ _createClass(ClassComponent, [{ |
@@ -178,3 +178,2 @@ //MUI Color utils | ||
} | ||
return val <= 0.03928 ? val / 12.92 : Math.pow((val + 0.055) / 1.055, 2.4); | ||
@@ -181,0 +180,0 @@ }); |
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty"; | ||
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; } | ||
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; } | ||
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; } | ||
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; } | ||
import { Fragment } from "react"; | ||
@@ -5,0 +5,0 @@ import { jsx as _jsx } from "react/jsx-runtime"; |
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty"; | ||
import _typeof from "@babel/runtime/helpers/esm/typeof"; | ||
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; } | ||
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; } | ||
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; } | ||
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; } | ||
export function isPlainObject(item) { | ||
@@ -6,0 +6,0 @@ return item !== null && _typeof(item) === "object" && (item == null ? void 0 : item.constructor) === Object; |
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty"; | ||
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray"; | ||
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; } | ||
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; } | ||
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; } | ||
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; } | ||
export default function extract(obj) { | ||
@@ -6,0 +6,0 @@ for (var _len = arguments.length, keys = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { |
import _toConsumableArray from "@babel/runtime/helpers/esm/toConsumableArray"; | ||
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty"; | ||
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray"; | ||
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; } | ||
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; } | ||
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; } | ||
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; } | ||
import { Children, isValidElement } from "react"; | ||
@@ -7,0 +7,0 @@ |
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty"; | ||
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; } | ||
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; } | ||
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; } | ||
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; } | ||
export default function (obj) { | ||
@@ -5,0 +5,0 @@ for (var _len = arguments.length, keys = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { |
@@ -11,3 +11,3 @@ import _toArray from "@babel/runtime/helpers/esm/toArray"; | ||
// @ts-ignore | ||
// @ts-ignore+ | ||
return restKeys.reduce(function (prev, curr) { | ||
@@ -14,0 +14,0 @@ return prev[curr]; |
@@ -12,89 +12,83 @@ import _asyncToGenerator from "@babel/runtime/helpers/esm/asyncToGenerator"; | ||
return _regeneratorRuntime.wrap(function _callee3$(_context3) { | ||
while (1) { | ||
switch (_context3.prev = _context3.next) { | ||
case 0: | ||
_resolveFn = function _resolveFn3() { | ||
_resolveFn = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2() { | ||
return _regeneratorRuntime.wrap(function _callee2$(_context2) { | ||
while (1) { | ||
switch (_context2.prev = _context2.next) { | ||
case 0: | ||
promiseDidTimeout = false; | ||
_context2.prev = 1; | ||
_context2.next = 4; | ||
return timeoutMs !== undefined ? timeoutPromise(fn(), timeoutMs) : fn(); | ||
case 4: | ||
return _context2.abrupt("return", _context2.sent); | ||
case 7: | ||
_context2.prev = 7; | ||
_context2.t0 = _context2["catch"](1); | ||
if (!(_context2.t0 instanceof TimeoutPromiseError)) { | ||
_context2.next = 13; | ||
break; | ||
} | ||
promiseDidTimeout = true; | ||
_context2.next = 14; | ||
break; | ||
case 13: | ||
throw _context2.t0; | ||
case 14: | ||
case "end": | ||
return _context2.stop(); | ||
while (1) switch (_context3.prev = _context3.next) { | ||
case 0: | ||
_resolveFn = function _resolveFn3() { | ||
_resolveFn = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2() { | ||
return _regeneratorRuntime.wrap(function _callee2$(_context2) { | ||
while (1) switch (_context2.prev = _context2.next) { | ||
case 0: | ||
promiseDidTimeout = false; | ||
_context2.prev = 1; | ||
_context2.next = 4; | ||
return timeoutMs !== undefined ? timeoutPromise(fn(), timeoutMs) : fn(); | ||
case 4: | ||
return _context2.abrupt("return", _context2.sent); | ||
case 7: | ||
_context2.prev = 7; | ||
_context2.t0 = _context2["catch"](1); | ||
if (!(_context2.t0 instanceof TimeoutPromiseError)) { | ||
_context2.next = 13; | ||
break; | ||
} | ||
} | ||
}, _callee2, null, [[1, 7]]); | ||
})); | ||
return _resolveFn.apply(this, arguments); | ||
}; | ||
resolveFn = function _resolveFn2() { | ||
return _resolveFn.apply(this, arguments); | ||
}; | ||
_options$delay = options.delay, delay = _options$delay === void 0 ? 1000 : _options$delay, maxIterations = options.maxIterations, timeoutMs = options.timeout; | ||
i = 0; | ||
promiseDidTimeout = false; | ||
_context3.next = 7; | ||
return resolveFn(); | ||
case 7: | ||
res = _context3.sent; | ||
case 8: | ||
if (!(!abort && (promiseDidTimeout || condition(res)))) { | ||
_context3.next = 15; | ||
break; | ||
} | ||
if (!(i === maxIterations)) { | ||
_context3.next = 11; | ||
break; | ||
} | ||
throw new Error("Polling executed the maximum number iterations"); | ||
case 11: | ||
_context3.next = 13; | ||
return new Promise(function (resolve) { | ||
timeout = setTimeout( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee() { | ||
return _regeneratorRuntime.wrap(function _callee$(_context) { | ||
while (1) { | ||
switch (_context.prev = _context.next) { | ||
case 0: | ||
i++; | ||
_context.next = 3; | ||
return resolveFn(); | ||
case 3: | ||
res = _context.sent; | ||
resolve(); | ||
case 5: | ||
case "end": | ||
return _context.stop(); | ||
} | ||
} | ||
}, _callee); | ||
})), delay); | ||
}); | ||
case 13: | ||
_context3.next = 8; | ||
promiseDidTimeout = true; | ||
_context2.next = 14; | ||
break; | ||
case 13: | ||
throw _context2.t0; | ||
case 14: | ||
case "end": | ||
return _context2.stop(); | ||
} | ||
}, _callee2, null, [[1, 7]]); | ||
})); | ||
return _resolveFn.apply(this, arguments); | ||
}; | ||
resolveFn = function _resolveFn2() { | ||
return _resolveFn.apply(this, arguments); | ||
}; | ||
_options$delay = options.delay, delay = _options$delay === void 0 ? 1000 : _options$delay, maxIterations = options.maxIterations, timeoutMs = options.timeout; | ||
i = 0; | ||
promiseDidTimeout = false; | ||
_context3.next = 7; | ||
return resolveFn(); | ||
case 7: | ||
res = _context3.sent; | ||
case 8: | ||
if (!(!abort && (promiseDidTimeout || condition(res)))) { | ||
_context3.next = 15; | ||
break; | ||
case 15: | ||
return _context3.abrupt("return", res); | ||
case 16: | ||
case "end": | ||
return _context3.stop(); | ||
} | ||
} | ||
if (!(i === maxIterations)) { | ||
_context3.next = 11; | ||
break; | ||
} | ||
throw new Error("Polling executed the maximum number iterations"); | ||
case 11: | ||
_context3.next = 13; | ||
return new Promise(function (resolve) { | ||
timeout = setTimeout( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee() { | ||
return _regeneratorRuntime.wrap(function _callee$(_context) { | ||
while (1) switch (_context.prev = _context.next) { | ||
case 0: | ||
i++; | ||
_context.next = 3; | ||
return resolveFn(); | ||
case 3: | ||
res = _context.sent; | ||
resolve(); | ||
case 5: | ||
case "end": | ||
return _context.stop(); | ||
} | ||
}, _callee); | ||
})), delay); | ||
}); | ||
case 13: | ||
_context3.next = 8; | ||
break; | ||
case 15: | ||
return _context3.abrupt("return", res); | ||
case 16: | ||
case "end": | ||
return _context3.stop(); | ||
} | ||
@@ -101,0 +95,0 @@ }, _callee3); |
@@ -7,5 +7,5 @@ import _defineProperty from "@babel/runtime/helpers/esm/defineProperty"; | ||
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); } | ||
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; } | ||
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; } | ||
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; } | ||
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; } | ||
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; } | ||
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; } | ||
import { forwardRef } from "react"; | ||
@@ -17,2 +17,4 @@ import extractSlots from "./extractSlots"; | ||
//eslint-disable-next-line @typescript-eslint/ban-types | ||
/** | ||
@@ -19,0 +21,0 @@ * Utility that creates racks and its slots. |
import _asyncToGenerator from "@babel/runtime/helpers/esm/asyncToGenerator"; | ||
import _createClass from "@babel/runtime/helpers/esm/createClass"; | ||
import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck"; | ||
import _inherits from "@babel/runtime/helpers/esm/inherits"; | ||
import _possibleConstructorReturn from "@babel/runtime/helpers/esm/possibleConstructorReturn"; | ||
import _getPrototypeOf from "@babel/runtime/helpers/esm/getPrototypeOf"; | ||
import _inherits from "@babel/runtime/helpers/esm/inherits"; | ||
import _wrapNativeSuper from "@babel/runtime/helpers/esm/wrapNativeSuper"; | ||
import _regeneratorRuntime from "@babel/runtime/regenerator"; | ||
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; } | ||
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } } | ||
function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); } | ||
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } | ||
export var TimeoutPromiseError = /*#__PURE__*/function (_Error) { | ||
_inherits(TimeoutPromiseError, _Error); | ||
var _super = _createSuper(TimeoutPromiseError); | ||
function TimeoutPromiseError() { | ||
_classCallCheck(this, TimeoutPromiseError); | ||
return _super.call(this, "Promise timeout"); | ||
return _callSuper(this, TimeoutPromiseError, ["Promise timeout"]); | ||
} | ||
@@ -27,20 +26,18 @@ return _createClass(TimeoutPromiseError); | ||
return _regeneratorRuntime.wrap(function _callee$(_context) { | ||
while (1) { | ||
switch (_context.prev = _context.next) { | ||
case 0: | ||
rejectedPromise = new Promise(function (_, reject) { | ||
timeout = setTimeout(function () { | ||
reject(new TimeoutPromiseError()); | ||
}, ms); | ||
}); | ||
_context.next = 3; | ||
return Promise.race([promise, rejectedPromise]); | ||
case 3: | ||
res = _context.sent; | ||
clearTimeout(timeout); | ||
return _context.abrupt("return", res); | ||
case 6: | ||
case "end": | ||
return _context.stop(); | ||
} | ||
while (1) switch (_context.prev = _context.next) { | ||
case 0: | ||
rejectedPromise = new Promise(function (_, reject) { | ||
timeout = setTimeout(function () { | ||
reject(new TimeoutPromiseError()); | ||
}, ms); | ||
}); | ||
_context.next = 3; | ||
return Promise.race([promise, rejectedPromise]); | ||
case 3: | ||
res = _context.sent; | ||
clearTimeout(timeout); | ||
return _context.abrupt("return", res); | ||
case 6: | ||
case "end": | ||
return _context.stop(); | ||
} | ||
@@ -47,0 +44,0 @@ }, _callee); |
@@ -11,18 +11,17 @@ "use strict"; | ||
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass")); | ||
var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits")); | ||
var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn")); | ||
var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf")); | ||
var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits")); | ||
var _react = require("react"); | ||
var _jsxRuntime = require("react/jsx-runtime"); | ||
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; } | ||
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { (0, _defineProperty2["default"])(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; } | ||
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2["default"])(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2["default"])(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2["default"])(this, result); }; } | ||
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } } | ||
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; } | ||
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2["default"])(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; } | ||
function _callSuper(t, o, e) { return o = (0, _getPrototypeOf2["default"])(o), (0, _possibleConstructorReturn2["default"])(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], (0, _getPrototypeOf2["default"])(t).constructor) : o.apply(t, e)); } | ||
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } | ||
function classify(Component) { | ||
return /*#__PURE__*/function (_ReactComponent) { | ||
(0, _inherits2["default"])(ClassComponent, _ReactComponent); | ||
var _super = _createSuper(ClassComponent); | ||
function ClassComponent() { | ||
(0, _classCallCheck2["default"])(this, ClassComponent); | ||
return _super.apply(this, arguments); | ||
return _callSuper(this, ClassComponent, arguments); | ||
} | ||
@@ -29,0 +28,0 @@ (0, _createClass2["default"])(ClassComponent, [{ |
@@ -193,3 +193,2 @@ "use strict"; | ||
} | ||
return val <= 0.03928 ? val / 12.92 : Math.pow((val + 0.055) / 1.055, 2.4); | ||
@@ -196,0 +195,0 @@ }); |
@@ -11,4 +11,4 @@ "use strict"; | ||
var _jsxRuntime = require("react/jsx-runtime"); | ||
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; } | ||
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { (0, _defineProperty2["default"])(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; } | ||
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; } | ||
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2["default"])(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; } | ||
function _default(slot) { | ||
@@ -15,0 +15,0 @@ var Component = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : function (p) { |
@@ -11,4 +11,4 @@ "use strict"; | ||
var _typeof2 = _interopRequireDefault(require("@babel/runtime/helpers/typeof")); | ||
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; } | ||
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { (0, _defineProperty2["default"])(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; } | ||
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; } | ||
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2["default"])(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; } | ||
function isPlainObject(item) { | ||
@@ -15,0 +15,0 @@ return item !== null && (0, _typeof2["default"])(item) === "object" && (item == null ? void 0 : item.constructor) === Object; |
@@ -10,4 +10,4 @@ "use strict"; | ||
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray")); | ||
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; } | ||
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { (0, _defineProperty2["default"])(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; } | ||
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; } | ||
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2["default"])(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; } | ||
function extract(obj) { | ||
@@ -14,0 +14,0 @@ for (var _len = arguments.length, keys = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { |
@@ -12,4 +12,4 @@ "use strict"; | ||
var _react = require("react"); | ||
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; } | ||
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { (0, _defineProperty2["default"])(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; } | ||
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; } | ||
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2["default"])(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; } | ||
/** | ||
@@ -16,0 +16,0 @@ * Extracts all slots from children and other remaining children |
@@ -9,4 +9,4 @@ "use strict"; | ||
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty")); | ||
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; } | ||
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { (0, _defineProperty2["default"])(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; } | ||
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; } | ||
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2["default"])(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; } | ||
function _default(obj) { | ||
@@ -13,0 +13,0 @@ for (var _len = arguments.length, keys = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { |
@@ -18,3 +18,3 @@ "use strict"; | ||
// @ts-ignore | ||
// @ts-ignore+ | ||
return restKeys.reduce(function (prev, curr) { | ||
@@ -21,0 +21,0 @@ return prev[curr]; |
@@ -227,3 +227,3 @@ "use strict"; | ||
}); | ||
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); } | ||
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; } | ||
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); } | ||
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { "default": e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n["default"] = e, t && t.set(e, n), n; } |
@@ -12,4 +12,4 @@ "use strict"; | ||
var _timeoutPromise = _interopRequireWildcard(require("./timeoutPromise")); | ||
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); } | ||
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; } | ||
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); } | ||
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { "default": e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n["default"] = e, t && t.set(e, n), n; } | ||
function _default(fn, condition) { | ||
@@ -23,89 +23,83 @@ var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {}; | ||
return _regenerator["default"].wrap(function _callee3$(_context3) { | ||
while (1) { | ||
switch (_context3.prev = _context3.next) { | ||
case 0: | ||
_resolveFn = function _resolveFn3() { | ||
_resolveFn = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee2() { | ||
return _regenerator["default"].wrap(function _callee2$(_context2) { | ||
while (1) { | ||
switch (_context2.prev = _context2.next) { | ||
case 0: | ||
promiseDidTimeout = false; | ||
_context2.prev = 1; | ||
_context2.next = 4; | ||
return timeoutMs !== undefined ? (0, _timeoutPromise["default"])(fn(), timeoutMs) : fn(); | ||
case 4: | ||
return _context2.abrupt("return", _context2.sent); | ||
case 7: | ||
_context2.prev = 7; | ||
_context2.t0 = _context2["catch"](1); | ||
if (!(_context2.t0 instanceof _timeoutPromise.TimeoutPromiseError)) { | ||
_context2.next = 13; | ||
break; | ||
} | ||
promiseDidTimeout = true; | ||
_context2.next = 14; | ||
break; | ||
case 13: | ||
throw _context2.t0; | ||
case 14: | ||
case "end": | ||
return _context2.stop(); | ||
while (1) switch (_context3.prev = _context3.next) { | ||
case 0: | ||
_resolveFn = function _resolveFn3() { | ||
_resolveFn = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee2() { | ||
return _regenerator["default"].wrap(function _callee2$(_context2) { | ||
while (1) switch (_context2.prev = _context2.next) { | ||
case 0: | ||
promiseDidTimeout = false; | ||
_context2.prev = 1; | ||
_context2.next = 4; | ||
return timeoutMs !== undefined ? (0, _timeoutPromise["default"])(fn(), timeoutMs) : fn(); | ||
case 4: | ||
return _context2.abrupt("return", _context2.sent); | ||
case 7: | ||
_context2.prev = 7; | ||
_context2.t0 = _context2["catch"](1); | ||
if (!(_context2.t0 instanceof _timeoutPromise.TimeoutPromiseError)) { | ||
_context2.next = 13; | ||
break; | ||
} | ||
} | ||
}, _callee2, null, [[1, 7]]); | ||
})); | ||
return _resolveFn.apply(this, arguments); | ||
}; | ||
resolveFn = function _resolveFn2() { | ||
return _resolveFn.apply(this, arguments); | ||
}; | ||
_options$delay = options.delay, delay = _options$delay === void 0 ? 1000 : _options$delay, maxIterations = options.maxIterations, timeoutMs = options.timeout; | ||
i = 0; | ||
promiseDidTimeout = false; | ||
_context3.next = 7; | ||
return resolveFn(); | ||
case 7: | ||
res = _context3.sent; | ||
case 8: | ||
if (!(!abort && (promiseDidTimeout || condition(res)))) { | ||
_context3.next = 15; | ||
break; | ||
} | ||
if (!(i === maxIterations)) { | ||
_context3.next = 11; | ||
break; | ||
} | ||
throw new Error("Polling executed the maximum number iterations"); | ||
case 11: | ||
_context3.next = 13; | ||
return new Promise(function (resolve) { | ||
timeout = setTimeout( /*#__PURE__*/(0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee() { | ||
return _regenerator["default"].wrap(function _callee$(_context) { | ||
while (1) { | ||
switch (_context.prev = _context.next) { | ||
case 0: | ||
i++; | ||
_context.next = 3; | ||
return resolveFn(); | ||
case 3: | ||
res = _context.sent; | ||
resolve(); | ||
case 5: | ||
case "end": | ||
return _context.stop(); | ||
} | ||
} | ||
}, _callee); | ||
})), delay); | ||
}); | ||
case 13: | ||
_context3.next = 8; | ||
promiseDidTimeout = true; | ||
_context2.next = 14; | ||
break; | ||
case 13: | ||
throw _context2.t0; | ||
case 14: | ||
case "end": | ||
return _context2.stop(); | ||
} | ||
}, _callee2, null, [[1, 7]]); | ||
})); | ||
return _resolveFn.apply(this, arguments); | ||
}; | ||
resolveFn = function _resolveFn2() { | ||
return _resolveFn.apply(this, arguments); | ||
}; | ||
_options$delay = options.delay, delay = _options$delay === void 0 ? 1000 : _options$delay, maxIterations = options.maxIterations, timeoutMs = options.timeout; | ||
i = 0; | ||
promiseDidTimeout = false; | ||
_context3.next = 7; | ||
return resolveFn(); | ||
case 7: | ||
res = _context3.sent; | ||
case 8: | ||
if (!(!abort && (promiseDidTimeout || condition(res)))) { | ||
_context3.next = 15; | ||
break; | ||
case 15: | ||
return _context3.abrupt("return", res); | ||
case 16: | ||
case "end": | ||
return _context3.stop(); | ||
} | ||
} | ||
if (!(i === maxIterations)) { | ||
_context3.next = 11; | ||
break; | ||
} | ||
throw new Error("Polling executed the maximum number iterations"); | ||
case 11: | ||
_context3.next = 13; | ||
return new Promise(function (resolve) { | ||
timeout = setTimeout( /*#__PURE__*/(0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee() { | ||
return _regenerator["default"].wrap(function _callee$(_context) { | ||
while (1) switch (_context.prev = _context.next) { | ||
case 0: | ||
i++; | ||
_context.next = 3; | ||
return resolveFn(); | ||
case 3: | ||
res = _context.sent; | ||
resolve(); | ||
case 5: | ||
case "end": | ||
return _context.stop(); | ||
} | ||
}, _callee); | ||
})), delay); | ||
}); | ||
case 13: | ||
_context3.next = 8; | ||
break; | ||
case 15: | ||
return _context3.abrupt("return", res); | ||
case 16: | ||
case "end": | ||
return _context3.stop(); | ||
} | ||
@@ -112,0 +106,0 @@ }, _callee3); |
@@ -17,5 +17,9 @@ "use strict"; | ||
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); } | ||
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; } | ||
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; } | ||
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { (0, _defineProperty2["default"])(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; } | ||
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; } | ||
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; } | ||
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2["default"])(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; } | ||
//eslint-disable-next-line @typescript-eslint/ban-types | ||
//eslint-disable-next-line @typescript-eslint/ban-types | ||
/** | ||
@@ -22,0 +26,0 @@ * Utility that creates racks and its slots. |
@@ -13,18 +13,16 @@ "use strict"; | ||
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck")); | ||
var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits")); | ||
var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn")); | ||
var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf")); | ||
var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits")); | ||
var _wrapNativeSuper2 = _interopRequireDefault(require("@babel/runtime/helpers/wrapNativeSuper")); | ||
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2["default"])(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2["default"])(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2["default"])(this, result); }; } | ||
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } } | ||
var TimeoutPromiseError = /*#__PURE__*/function (_Error) { | ||
function _callSuper(t, o, e) { return o = (0, _getPrototypeOf2["default"])(o), (0, _possibleConstructorReturn2["default"])(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], (0, _getPrototypeOf2["default"])(t).constructor) : o.apply(t, e)); } | ||
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } | ||
var TimeoutPromiseError = exports.TimeoutPromiseError = /*#__PURE__*/function (_Error) { | ||
(0, _inherits2["default"])(TimeoutPromiseError, _Error); | ||
var _super = _createSuper(TimeoutPromiseError); | ||
function TimeoutPromiseError() { | ||
(0, _classCallCheck2["default"])(this, TimeoutPromiseError); | ||
return _super.call(this, "Promise timeout"); | ||
return _callSuper(this, TimeoutPromiseError, ["Promise timeout"]); | ||
} | ||
return (0, _createClass2["default"])(TimeoutPromiseError); | ||
}( /*#__PURE__*/(0, _wrapNativeSuper2["default"])(Error)); | ||
exports.TimeoutPromiseError = TimeoutPromiseError; | ||
function timeoutPromise(_x, _x2) { | ||
@@ -37,20 +35,18 @@ return _timeoutPromise.apply(this, arguments); | ||
return _regenerator["default"].wrap(function _callee$(_context) { | ||
while (1) { | ||
switch (_context.prev = _context.next) { | ||
case 0: | ||
rejectedPromise = new Promise(function (_, reject) { | ||
timeout = setTimeout(function () { | ||
reject(new TimeoutPromiseError()); | ||
}, ms); | ||
}); | ||
_context.next = 3; | ||
return Promise.race([promise, rejectedPromise]); | ||
case 3: | ||
res = _context.sent; | ||
clearTimeout(timeout); | ||
return _context.abrupt("return", res); | ||
case 6: | ||
case "end": | ||
return _context.stop(); | ||
} | ||
while (1) switch (_context.prev = _context.next) { | ||
case 0: | ||
rejectedPromise = new Promise(function (_, reject) { | ||
timeout = setTimeout(function () { | ||
reject(new TimeoutPromiseError()); | ||
}, ms); | ||
}); | ||
_context.next = 3; | ||
return Promise.race([promise, rejectedPromise]); | ||
case 3: | ||
res = _context.sent; | ||
clearTimeout(timeout); | ||
return _context.abrupt("return", res); | ||
case 6: | ||
case "end": | ||
return _context.stop(); | ||
} | ||
@@ -57,0 +53,0 @@ }, _callee); |
{ | ||
"name": "@peersyst/react-utils", | ||
"author": "Peersyst", | ||
"version": "2.4.0", | ||
"version": "2.4.1", | ||
"license": "MIT", | ||
@@ -11,3 +11,3 @@ "main": "./node/index.js", | ||
"peerDependencies": { | ||
"@types/react": "^18.0.27", | ||
"@types/react": "^18.0.0", | ||
"react": "^18.2.0" | ||
@@ -22,3 +22,3 @@ }, | ||
"@babel/runtime": "^7.16.7", | ||
"@peersyst/react-types": "^1.6.1", | ||
"@peersyst/react-types": "^1.6.2", | ||
"validate-color": "^2.2.1" | ||
@@ -25,0 +25,0 @@ }, |
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
173957
3686
Updated@peersyst/react-types@^1.6.2