@luminati-io/uikit 3.7.6 → 3.7.7

Sign up to get free protection for your applications and to get access to all the features.
@@ -43916,7 +43916,7 @@ var enterAnimation = function enterAnimation(factor) {
43916
43916
  var exitAnimation = function exitAnimation(factor) {
43917
43917
  return (0,styled_components__WEBPACK_IMPORTED_MODULE_4__.keyframes)(["0%{transform:translate3d(0,0,-1px) scale(1);opacity:1;}100%{transform:translate3d(0,", "%,-1px) scale(.6);opacity:0;}"], factor * -150);
43918
43918
  };
43919
- var ToastAnimatedComp = styled_components__WEBPACK_IMPORTED_MODULE_4___default().div.withConfig({
43919
+ var ToastAnimatedComp = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().memo(styled_components__WEBPACK_IMPORTED_MODULE_4___default().div.withConfig({
43920
43920
  displayName: "ToastAnimatedComp",
43921
43921
  componentId: "sc-1whlqk5-0"
43922
43922
  })(["display:flex;align-items:center;will-change:transform;max-width:350px;", ";"], function (props) {
@@ -43925,7 +43925,7 @@ var ToastAnimatedComp = styled_components__WEBPACK_IMPORTED_MODULE_4___default()
43925
43925
  var top = $position.includes('top');
43926
43926
  var factor = top ? 1 : -1;
43927
43927
  return $visible ? (0,styled_components__WEBPACK_IMPORTED_MODULE_4__.css)(["animation:", " 0.35s cubic-bezier(.21,1.02,.73,1) forwards;"], enterAnimation(factor)) : (0,styled_components__WEBPACK_IMPORTED_MODULE_4__.css)(["animation:", " 0.4s forwards cubic-bezier(.06,.71,.55,1)"], exitAnimation(factor));
43928
- });
43928
+ }));
43929
43929
  ToastAnimatedComp.defaultProps = {
43930
43930
  $position: 'bottom-left'
43931
43931
  };
@@ -44094,7 +44094,7 @@ var dismissToast = function dismissToast(id) {
44094
44094
  if (!id) queue.length = 0;
44095
44095
  return react_hot_toast__WEBPACK_IMPORTED_MODULE_1__["default"].dismiss(id);
44096
44096
  };
44097
- var _useToaster = function _useToaster() {
44097
+ var useToaster = function useToaster() {
44098
44098
  var _useHotToaster = (0,react_hot_toast__WEBPACK_IMPORTED_MODULE_1__.useToaster)(),
44099
44099
  toasts = _useHotToaster.toasts;
44100
44100
  var context = (0,react__WEBPACK_IMPORTED_MODULE_0__.useContext)(_context__WEBPACK_IMPORTED_MODULE_2__.ToastContext);
@@ -44126,6 +44126,23 @@ var _useToaster = function _useToaster() {
44126
44126
  processQueueRef.current();
44127
44127
  return opt.id || id;
44128
44128
  }, []);
44129
+ var getToast = (0,react__WEBPACK_IMPORTED_MODULE_0__.useCallback)(function (id) {
44130
+ var foundToast = toasts.find(function (t) {
44131
+ return t.id == id;
44132
+ });
44133
+ if (foundToast) return {
44134
+ id: id,
44135
+ active: true
44136
+ };
44137
+ foundToast = queue.find(function (t) {
44138
+ return t[1].id == id;
44139
+ });
44140
+ if (foundToast) return {
44141
+ id: id,
44142
+ active: false
44143
+ };
44144
+ return null;
44145
+ }, [toasts]);
44129
44146
  (0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(function () {
44130
44147
  processQueue();
44131
44148
  }, [processQueue]);
@@ -44162,16 +44179,9 @@ var _useToaster = function _useToaster() {
44162
44179
  enqueueToast: enqueueToast,
44163
44180
  dismissToast: dismissToast,
44164
44181
  toast: _toast,
44165
- toasts: toasts
44182
+ getToast: getToast
44166
44183
  };
44167
44184
  };
44168
- var useToaster = function useToaster() {
44169
- var toasterHook = _useToaster();
44170
- var memoizedHook = (0,react__WEBPACK_IMPORTED_MODULE_0__.useMemo)(function () {
44171
- return toasterHook;
44172
- }, []);
44173
- return memoizedHook;
44174
- };
44175
44185
 
44176
44186
  /***/ }),
44177
44187