@startlibs/components 1.0.0-alpha-7r → 1.0.0-alpha-7w

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/lib/index.js +863 -355
  2. package/package.json +1 -1
package/lib/index.js CHANGED
@@ -19,24 +19,25 @@ var _possibleConstructorReturn = _interopDefault(require('@babel/runtime/helpers
19
19
  var _getPrototypeOf = _interopDefault(require('@babel/runtime/helpers/getPrototypeOf'));
20
20
  var _inherits = _interopDefault(require('@babel/runtime/helpers/inherits'));
21
21
  var router = require('@reach/router');
22
- var _slicedToArray = _interopDefault(require('@babel/runtime/helpers/slicedToArray'));
23
22
  var _assign = _interopDefault(require('lodash/fp/assign'));
24
23
  var core = require('@startlibs/core');
24
+ var _slicedToArray = _interopDefault(require('@babel/runtime/helpers/slicedToArray'));
25
25
  var _get = _interopDefault(require('lodash/fp/get'));
26
26
  var _objectSpread = _interopDefault(require('@babel/runtime/helpers/objectSpread'));
27
27
  var _uniqueId = _interopDefault(require('lodash/fp/uniqueId'));
28
+ var _max = _interopDefault(require('lodash/fp/max'));
28
29
  var _identity = _interopDefault(require('lodash/fp/identity'));
29
- var ReactDOM = _interopDefault(require('react-dom'));
30
- var _toConsumableArray = _interopDefault(require('@babel/runtime/helpers/toConsumableArray'));
31
30
  var _ = _interopDefault(require('lodash/fp'));
31
+ var _toConsumableArray = _interopDefault(require('@babel/runtime/helpers/toConsumableArray'));
32
32
  var _typeof = _interopDefault(require('@babel/runtime/helpers/typeof'));
33
33
  var emotion = require('emotion');
34
+ var _isString = _interopDefault(require('lodash/fp/isString'));
34
35
  var _defineProperty = _interopDefault(require('@babel/runtime/helpers/defineProperty'));
35
- var _debounce = _interopDefault(require('lodash/fp/debounce'));
36
36
  var _assertThisInitialized = _interopDefault(require('@babel/runtime/helpers/assertThisInitialized'));
37
37
  var _set = _interopDefault(require('lodash/fp/set'));
38
38
  var _pullAt = _interopDefault(require('lodash/fp/pullAt'));
39
39
  var _map = _interopDefault(require('lodash/fp/map'));
40
+ var ReactDOM = _interopDefault(require('react-dom'));
40
41
  var reactHotLoader = require('react-hot-loader');
41
42
  var _isFunction = _interopDefault(require('lodash/fp/isFunction'));
42
43
  var reactIs = require('react-is');
@@ -155,7 +156,7 @@ function _templateObject2() {
155
156
  }
156
157
 
157
158
  function _templateObject() {
158
- var data = _taggedTemplateLiteral(["\n position: absolute;\n top: 51%;\n transform: translateY(-50%);\n right: 1rem;\n"]);
159
+ var data = _taggedTemplateLiteral(["\n position: absolute;\n top: 51%;\n transform: translateY(-50%);\n right: 1rem;\n font-size: 12px;\n"]);
159
160
 
160
161
  _templateObject = function _templateObject() {
161
162
  return data;
@@ -180,6 +181,7 @@ var Button = styled__default(React__default.forwardRef(function (_ref, ref) {
180
181
  success = _ref.success,
181
182
  alert = _ref.alert,
182
183
  highlight = _ref.highlight,
184
+ light = _ref.light,
183
185
  hover = _ref.hover,
184
186
  white = _ref.white,
185
187
  icon = _ref.icon,
@@ -205,7 +207,7 @@ var Button = styled__default(React__default.forwardRef(function (_ref, ref) {
205
207
  concealed = _ref.concealed,
206
208
  concealedModule = _ref.concealedModule,
207
209
  buttonRef = _ref.buttonRef,
208
- props = _objectWithoutProperties(_ref, ["type", "locked", "color", "alpha", "success", "alert", "highlight", "hover", "white", "icon", "onlyIcon", "small", "withDropdown", "onlyDropdown", "outline", "dashed", "textOnly", "isLoading", "dark", "innerAs", "className", "children", "rounded", "tabIndex", "focused", "noFocus", "colorSet", "concealed", "concealedModule", "buttonRef"]);
210
+ props = _objectWithoutProperties(_ref, ["type", "locked", "color", "alpha", "success", "alert", "highlight", "light", "hover", "white", "icon", "onlyIcon", "small", "withDropdown", "onlyDropdown", "outline", "dashed", "textOnly", "isLoading", "dark", "innerAs", "className", "children", "rounded", "tabIndex", "focused", "noFocus", "colorSet", "concealed", "concealedModule", "buttonRef"]);
209
211
 
210
212
  return React__default.createElement(Wrapper, _extends({
211
213
  ref: ref || buttonRef,
@@ -219,20 +221,22 @@ var Button = styled__default(React__default.forwardRef(function (_ref, ref) {
219
221
  }), locked && React__default.createElement(LockIcon, {
220
222
  icon: "lock"
221
223
  }), children, isLoading && React__default.createElement(Loading, {
222
- white: true,
223
- absolute: true
224
+ white: !outline || !dashed || !white,
225
+ absolute: true,
226
+ size: small && '16',
227
+ borderWidth: small && '3'
224
228
  }));
225
229
  })).withConfig({
226
230
  displayName: "Button",
227
231
  componentId: "qe54pl-1"
228
- })(["vertical-align:top;border:0;font-size:12px;border-radius:", ";background:", ";color:white;min-width:8rem;font-weight:500;display:inline-block;line-height:16px;text-align:center;padding:10px 1.25rem;outline:none;cursor:pointer;position:relative;text-decoration:none;user-select:none;:hover{background:", ";}:active{background:", ";}", " + .styled-button{margin-left:1rem;}", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", ""], function (props) {
232
+ })(["vertical-align:top;border:0;font-size:12px;border-radius:", ";background:", ";color:white;min-width:8rem;font-weight:500;display:inline-block;line-height:16px;text-align:center;padding:10px 1.25rem;outline:none;cursor:pointer;position:relative;text-decoration:none;user-select:none;:hover{background:", ";}:active{background:", ";}", " + .styled-button{margin-left:1rem;}", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", ""], function (props) {
229
233
  return props.rounded ? '100px' : '6px';
230
234
  }, utils.getColor, function (props) {
231
235
  return polished.darken(0.05, utils.getColor(props, true));
232
236
  }, function (props) {
233
237
  return polished.darken(0.08, utils.getColor(props, true));
234
238
  }, function (props) {
235
- return !props.noFocus && styled.css([":focus{", "}", ""], focus, function (props) {
239
+ return !props.noFocus && !props.isLoading && styled.css([":focus{", "}", ""], focus, function (props) {
236
240
  return props.focused && focus;
237
241
  });
238
242
  }, function (props) {
@@ -245,6 +249,12 @@ var Button = styled__default(React__default.forwardRef(function (_ref, ref) {
245
249
  return props.withDropdown && styled.css(["padding-right:2.25rem;text-align:left;"]);
246
250
  }, function (props) {
247
251
  return props.onlyDropdown && styled.css(["", "{right:50%;transform:translate(50%,-50%);}"], DropdownIcon);
252
+ }, function (props) {
253
+ return props.light && styled.css(["background:", ";color:", ";:hover{background:", ";}:active{background:", ";}"], utils.getColor('bluishGray'), utils.getColor('gray120'), function (props) {
254
+ return polished.darken(0.05, utils.getColor('bluishGray')(props));
255
+ }, function (props) {
256
+ return polished.darken(0.08, utils.getColor('bluishGray')(props));
257
+ });
248
258
  }, function (props) {
249
259
  return (props.outline || props.dashed || props.textOnly) && styled.css(["color:", ";background:none;", ",", "{color:", ";}:before{content:'';border:1px ", " ", ";position:absolute;top:0;right:0;bottom:0;left:0;border-radius:", ";pointer-events:none;}:hover{background-color:rgba(0,0,0,0.05);}:active{background-color:rgba(0,0,0,0.08);}:focus{:before{box-shadow:0 0 0 2px rgba(0,0,0,0.1);", "}:after{content:none;}}"], props.white ? 'white' : props.highlight ? utils.getColor('main') : 'rgba(0,0,0,0.6)', Icon, DropdownIcon, props.white ? 'white' : props.highlight ? utils.getColor('main') : 'rgba(0,0,0,0.5)', props.outline ? 'solid' : props.dashed ? 'dashed' : '', props.white ? 'white' : props.highlight ? utils.getColor('main') : 'rgba(0,0,0,0.35)', props.rounded ? '100px' : '6px', props.textOnly && 'content: none;');
250
260
  }, function (props) {
@@ -256,8 +266,10 @@ var Button = styled__default(React__default.forwardRef(function (_ref, ref) {
256
266
  }, utils.media.mobile(_templateObject2(), function (props) {
257
267
  return !props.small && styled.css(["padding:13px 1.5rem;font-size:13px;"]);
258
268
  }), utils.media.max(359)(_templateObject3(), function (props) {
259
- return !props.small && !props.onlyIcon && !props.onlyDropdown && styled.css(["padding-left:1rem;padding-right:1rem;min-width:0;"]);
260
- }), utils.customTheme("Button"));
269
+ return !props.small && !props.onlyIcon && !props.onlyDropdown && styled.css(["min-width:0;"]);
270
+ }), function (props) {
271
+ return props.fullwidth && "\n width: 100%;\n ";
272
+ }, utils.customTheme("Button"));
261
273
 
262
274
  Button.a = function (props) {
263
275
  return React__default.createElement(Button, _extends({}, props, {
@@ -298,6 +310,12 @@ function (_React$Component) {
298
310
  hasError: false
299
311
  });
300
312
  }
313
+
314
+ if (this.props.resetOn !== prevProps.resetOn) {
315
+ this.setState({
316
+ hasError: false
317
+ });
318
+ }
301
319
  }
302
320
  }, {
303
321
  key: "componentDidCatch",
@@ -384,6 +402,48 @@ var ifUndefined = function ifUndefined(v) {
384
402
 
385
403
  return v !== undefined ? v : or.length === 1 ? or[0] : ifUndefined.apply(void 0, [or[0]].concat(_toConsumableArray(or.slice(1))));
386
404
  };
405
+ function isMobile() {
406
+ var check = false;
407
+
408
+ if (typeof navigator === 'undefined') {
409
+ return false;
410
+ }
411
+
412
+ (function (a) {
413
+ if (/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series([46])0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino/i.test(a) || /1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br([ev])w|bumb|bw-([nu])|c55\/|capi|ccwa|cdm-|cell|chtm|cldc|cmd-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc-s|devi|dica|dmob|do([cp])o|ds(12|-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly([-_])|g1 u|g560|gene|gf-5|g-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd-([mpt])|hei-|hi(pt|ta)|hp( i|ip)|hs-c|ht(c([- _agpst])|tp)|hu(aw|tc)|i-(20|go|ma)|i230|iac([ -/])|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja([tv])a|jbro|jemu|jigs|kddi|keji|kgt([ /])|klon|kpt |kwc-|kyo([ck])|le(no|xi)|lg( g|\/([klu])|50|54|-[a-w])|libw|lynx|m1-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t([- ov])|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30([02])|n50([025])|n7(0([01])|10)|ne(([cm])-|on|tf|wf|wg|wt)|nok([6i])|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan([adt])|pdxg|pg(13|-([1-8]|c))|phil|pire|pl(ay|uc)|pn-2|po(ck|rt|se)|prox|psio|pt-g|qa-a|qc(07|12|21|32|60|-[2-7]|i-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h-|oo|p-)|sdk\/|se(c([-01])|47|mc|nd|ri)|sgh-|shar|sie([-m])|sk-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h-|v-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl-|tdg-|tel(i|m)|tim-|t-mo|to(pl|sh)|ts(70|m-|m3|m5)|tx-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c([- ])|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas-|your|zeto|zte-/i.test(a.substr(0, 4))) check = true;
414
+ })(navigator.userAgent || navigator.vendor || window['opera']);
415
+
416
+ return check;
417
+ }
418
+ var normalizeTouch = function normalizeTouch(fn, endFn) {
419
+ return function (e) {
420
+ var touch = e.touches[0];
421
+
422
+ if (e.touches.length > 1 && e.type !== 'touchend') {
423
+ callIfFunction(endFn, e, touch);
424
+ } else {
425
+ callIfFunction(fn, e, touch);
426
+ }
427
+ };
428
+ };
429
+ var normalizeMouse = function normalizeMouse(fn, endFn) {
430
+ return function (e) {
431
+ if (e.buttons > 1 && e.type !== 'mouseup') {
432
+ callIfFunction(endFn, e, e);
433
+ } else {
434
+ callIfFunction(fn, e, e);
435
+ }
436
+ };
437
+ };
438
+ var normalizePress = function normalizePress(fn, endFn) {
439
+ return function (e) {
440
+ if (e.touches) {
441
+ normalizeTouch(fn, endFn)(e);
442
+ } else {
443
+ normalizeMouse(fn, endFn)(e);
444
+ }
445
+ };
446
+ };
387
447
 
388
448
  function _templateObject$1() {
389
449
  var data = _taggedTemplateLiteral(["\n ", ""]);
@@ -400,7 +460,7 @@ var media = function media() {
400
460
  }
401
461
 
402
462
  return function () {
403
- return styled.css(["@media screen and ", "{", "}"], sizePairs.map(function (_ref4) {
463
+ return styled.css(["@media ", "{", "}"], sizePairs.map(function (_ref4) {
404
464
  var _ref5 = _slicedToArray(_ref4, 2),
405
465
  size = _ref5[0],
406
466
  type = _ref5[1];
@@ -450,6 +510,54 @@ var twoWayAnimation = function twoWayAnimation() {
450
510
  var identityTranslateFrames = oneWayAnimation('transform: translateY(0);', 'transform: translateY(0);');
451
511
  var identityOpacityFrames = oneWayAnimation('opacity: 1;', 'opacity:1;');
452
512
 
513
+ var disableSelect = function disableSelect(e) {
514
+ e.preventDefault();
515
+ };
516
+
517
+ var createPressEvent = function createPressEvent(onStart) {
518
+ return normalizePress(function (startEvent, info) {
519
+ var onEnd = onStart(startEvent, info);
520
+ var finish = normalizePress(function (e, info) {
521
+ callIfFunction(onEnd, e, info);
522
+ window.removeEventListener('selectstart', disableSelect);
523
+ window.removeEventListener('touchend', finish);
524
+ window.removeEventListener('mouseup', finish);
525
+ });
526
+ window.addEventListener('selectstart', disableSelect);
527
+
528
+ if (startEvent.touches) {
529
+ window.addEventListener('touchend', finish);
530
+ } else {
531
+ window.addEventListener("mouseup", finish);
532
+ }
533
+ });
534
+ };
535
+ var createPressAndMoveEvent = function createPressAndMoveEvent(onStart) {
536
+ return createPressEvent(function (startEvent, info) {
537
+ var _concat3 = [].concat(onStart(startEvent, info)),
538
+ _concat4 = _slicedToArray(_concat3, 2),
539
+ onMove = _concat4[0],
540
+ onEnd = _concat4[1];
541
+
542
+ var finish = normalizePress(function (e, info) {
543
+ callIfFunction(onEnd, e, info);
544
+ window.removeEventListener('touchmove', move);
545
+ window.removeEventListener('mousemove', move);
546
+ });
547
+ var move = normalizePress(onMove, finish);
548
+
549
+ if (startEvent.touches) {
550
+ window.addEventListener('touchmove', move, {
551
+ passive: false
552
+ });
553
+ } else {
554
+ window.addEventListener("mousemove", move);
555
+ }
556
+
557
+ return finish;
558
+ });
559
+ };
560
+
453
561
  function _templateObject$2() {
454
562
  var data = _taggedTemplateLiteral(["test"]);
455
563
 
@@ -465,13 +573,39 @@ var getMargins = function getMargins(domNode) {
465
573
  marginTop = _window$getComputedSt.marginTop,
466
574
  marginLeft = _window$getComputedSt.marginLeft,
467
575
  marginBottom = _window$getComputedSt.marginBottom,
468
- marginRight = _window$getComputedSt.marginRight;
576
+ marginRight = _window$getComputedSt.marginRight,
577
+ paddingTop = _window$getComputedSt.paddingTop;
469
578
 
470
579
  return {
471
580
  marginTop: marginTop,
472
581
  marginLeft: marginLeft,
473
582
  marginBottom: marginBottom,
474
- marginRight: marginRight
583
+ marginRight: marginRight,
584
+ paddingTop: paddingTop
585
+ };
586
+ };
587
+
588
+ var getParentProperties = function getParentProperties(parentNode) {
589
+ if (!parentNode) return {};
590
+
591
+ var _window$getComputedSt2 = window.getComputedStyle(parentNode),
592
+ marginTop = _window$getComputedSt2.marginTop,
593
+ marginLeft = _window$getComputedSt2.marginLeft,
594
+ marginBottom = _window$getComputedSt2.marginBottom,
595
+ marginRight = _window$getComputedSt2.marginRight,
596
+ paddingBottom = _window$getComputedSt2.paddingBottom,
597
+ paddingTop = _window$getComputedSt2.paddingTop;
598
+
599
+ return {
600
+ parentStyle: {
601
+ marginTop: marginTop,
602
+ marginLeft: marginLeft,
603
+ marginBottom: marginBottom,
604
+ marginRight: marginRight,
605
+ paddingBottom: paddingBottom,
606
+ paddingTop: paddingTop
607
+ },
608
+ parentNode: parentNode
475
609
  };
476
610
  };
477
611
 
@@ -499,12 +633,11 @@ var toPosition = function toPosition(domNode) {
499
633
  return _objectSpread({
500
634
  domNode: domNode,
501
635
  nextSibling: domNode.nextSibling,
502
- parentNode: domNode.parentNode,
503
636
  top: finalPosition ? domNode.offsetTop : top - parentRect.top,
504
637
  left: finalPosition ? domNode.offsetLeft : left - parentRect.left,
505
638
  height: height,
506
639
  width: width
507
- }, margins);
640
+ }, getParentProperties(domNode.parentNode), margins);
508
641
  };
509
642
 
510
643
  var sumWithPx = function sumWithPx() {
@@ -582,15 +715,15 @@ var cloneWrapper = function cloneWrapper(element) {
582
715
  return tempWrapper.append(c);
583
716
  });
584
717
 
585
- var _window$getComputedSt2 = window.getComputedStyle(element),
586
- display = _window$getComputedSt2.display,
587
- width = _window$getComputedSt2.width,
588
- height = _window$getComputedSt2.height,
589
- padding = _window$getComputedSt2.padding,
590
- borderLeftWidth = _window$getComputedSt2.borderLeftWidth,
591
- borderRightWidth = _window$getComputedSt2.borderRightWidth,
592
- borderBottomWidth = _window$getComputedSt2.borderBottomWidth,
593
- borderTopWidth = _window$getComputedSt2.borderTopWidth;
718
+ var _window$getComputedSt3 = window.getComputedStyle(element),
719
+ display = _window$getComputedSt3.display,
720
+ width = _window$getComputedSt3.width,
721
+ height = _window$getComputedSt3.height,
722
+ padding = _window$getComputedSt3.padding,
723
+ borderLeftWidth = _window$getComputedSt3.borderLeftWidth,
724
+ borderRightWidth = _window$getComputedSt3.borderRightWidth,
725
+ borderBottomWidth = _window$getComputedSt3.borderBottomWidth,
726
+ borderTopWidth = _window$getComputedSt3.borderTopWidth;
594
727
 
595
728
  Object.assign(tempWrapper.style, {
596
729
  display: display,
@@ -691,6 +824,8 @@ var getClientRectAnimation = function getClientRectAnimation(oldSnap, newSnap) {
691
824
  skipTransform = _ref5.skipTransform;
692
825
 
693
826
  if (hasClientRectChanged(oldSnap, newSnap)) {
827
+ var _oldSnap$parentStyle, _newSnap$parentStyle, _oldSnap$parentStyle2, _newSnap$parentStyle2;
828
+
694
829
  var node = newSnap.domNode;
695
830
  var offsetLeft = node.offsetLeft,
696
831
  offsetTop = node.offsetTop,
@@ -707,8 +842,8 @@ var getClientRectAnimation = function getClientRectAnimation(oldSnap, newSnap) {
707
842
  var finalPadding = '';
708
843
 
709
844
  if (deltaHeight > 0) {
710
- var _window$getComputedSt3 = window.getComputedStyle(node),
711
- paddingBottom = _window$getComputedSt3.paddingBottom;
845
+ var _window$getComputedSt4 = window.getComputedStyle(node),
846
+ paddingBottom = _window$getComputedSt4.paddingBottom;
712
847
 
713
848
  finalPadding = 'padding-bottom:' + paddingBottom + ';';
714
849
  heightFix = "padding-bottom: ".concat(sumWithPx(deltaHeight, paddingBottom));
@@ -716,20 +851,81 @@ var getClientRectAnimation = function getClientRectAnimation(oldSnap, newSnap) {
716
851
 
717
852
  var overflowFix = scrollHeight > clientHeight || scrollWidth > clientWidth ? "overflow: hidden" : "";
718
853
  var transform = (left !== 0 || top !== 0) && !skipTransform ? "transform: translate(".concat(left, "px,").concat(top, "px);") : '';
854
+ var parentPaddingTopDelta = (parseInt((_oldSnap$parentStyle = oldSnap.parentStyle) === null || _oldSnap$parentStyle === void 0 ? void 0 : _oldSnap$parentStyle.paddingTop) || 0) - (parseInt((_newSnap$parentStyle = newSnap.parentStyle) === null || _newSnap$parentStyle === void 0 ? void 0 : _newSnap$parentStyle.paddingTop) || 0);
855
+ var parentPaddingBottomDelta = (parseInt((_oldSnap$parentStyle2 = oldSnap.parentStyle) === null || _oldSnap$parentStyle2 === void 0 ? void 0 : _oldSnap$parentStyle2.paddingBottom) || 0) - (parseInt((_newSnap$parentStyle2 = newSnap.parentStyle) === null || _newSnap$parentStyle2 === void 0 ? void 0 : _newSnap$parentStyle2.paddingBottom) || 0);
856
+ var oldMarginTop = (parseInt(oldSnap.marginTop) || 0) + parentPaddingTopDelta;
857
+ var oldMarginBottom = (parseInt(oldSnap.marginBottom) || 0) + parentPaddingBottomDelta;
719
858
  var oldTransform = node.style.transform;
720
- return [utils.oneWayAnimation("\n ".concat(transform, "\n ").concat(heightFix, "\n ").concat(overflowFix, "\n margin-top:").concat(oldSnap.marginTop || 0, ";\n width: ").concat(oldSnap.width, "px;\n height: ").concat(oldSnap.height, "px;\n "), "\n ".concat(finalPadding, "\n ").concat(oldTransform ? "transform:".concat(oldTransform) : '', "\n ").concat(overflowFix, "\n margin-top:").concat(newSnap.marginTop || 0, ";\n width: ").concat(newSnap.width, "px;\n height: ").concat(newSnap.height, "px;\n "))];
859
+ return [utils.oneWayAnimation("\n ".concat(transform, "\n ").concat(heightFix, "\n ").concat(overflowFix, "\n margin-top: ").concat(oldMarginTop, "px;\n margin-bottom: ").concat(oldMarginBottom, "px;\n width: ").concat(oldSnap.width, "px;\n height: ").concat(oldSnap.height, "px;\n "), "\n ".concat(finalPadding, "\n ").concat(oldTransform ? "transform:".concat(oldTransform) : '', "\n ").concat(overflowFix, "\n margin-top:").concat(newSnap.marginTop || 0, "px;\n margin-bottom:").concat(newSnap.marginBottom || 0, "px;\n width: ").concat(newSnap.width, "px;\n height: ").concat(newSnap.height, "px;\n "))];
721
860
  } else {
722
861
  return [];
723
862
  }
724
863
  };
725
864
 
726
- var playSwitch = function playSwitch(oldSnap, newSnap, _ref6) {
727
- var switchIn = _ref6.switchIn,
728
- switchOut = _ref6.switchOut,
729
- switchAnimation = _ref6.switchAnimation,
730
- timing = _ref6.timing,
731
- _ref6$transformHeight = _ref6.transformHeight,
732
- transformHeight = _ref6$transformHeight === void 0 ? _identity : _ref6$transformHeight;
865
+ var getClientRectAnimationForSwitch = function getClientRectAnimationForSwitch(oldSnap, newSnap) {
866
+ var _ref6 = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {},
867
+ skipTransform = _ref6.skipTransform;
868
+
869
+ if (hasClientRectChanged(oldSnap, newSnap)) {
870
+ var _node$parentNode, _node$parentNode2;
871
+
872
+ var node = newSnap.domNode;
873
+ var offsetLeft = node.offsetLeft,
874
+ offsetTop = node.offsetTop,
875
+ scrollHeight = node.scrollHeight,
876
+ clientHeight = node.clientHeight,
877
+ scrollWidth = node.scrollWidth,
878
+ clientWidth = node.clientWidth;
879
+ var scrollTop = ((_node$parentNode = node.parentNode) === null || _node$parentNode === void 0 ? void 0 : _node$parentNode.scrollTop) || 0;
880
+ var scrollLeft = ((_node$parentNode2 = node.parentNode) === null || _node$parentNode2 === void 0 ? void 0 : _node$parentNode2.scrollLeft) || 0; // get margin-bottom
881
+
882
+ var prevBorder = node.style.border;
883
+ node.style.border = '1px solid transparent';
884
+ var borderHeight = node.clientHeight;
885
+ node.style.border = prevBorder; // get negative margin top
886
+
887
+ var prevPadding = newSnap.paddingTop;
888
+ var nonPaddingFixTop = newSnap.clonedNode.getBoundingClientRect().top;
889
+ var topWithPaddingFix = nonPaddingFixTop;
890
+
891
+ if (!parseInt(prevPadding)) {
892
+ node.style.paddingTop = '1px';
893
+ topWithPaddingFix = newSnap.clonedNode.getBoundingClientRect().top;
894
+ node.style.paddingTop = '';
895
+ }
896
+
897
+ var newSnapNegativeTopMarginDelta = topWithPaddingFix - nonPaddingFixTop;
898
+ var newSnapBottomMarginDelta = clientHeight - borderHeight;
899
+ var left = oldSnap.left - offsetLeft + scrollLeft;
900
+ var top = oldSnap.top - offsetTop + scrollTop - newSnapNegativeTopMarginDelta;
901
+ var deltaHeight = oldSnap.height - newSnap.height;
902
+ var heightFix = '';
903
+ var finalPadding = '';
904
+
905
+ if (deltaHeight > 0) {
906
+ var _window$getComputedSt5 = window.getComputedStyle(node),
907
+ paddingBottom = _window$getComputedSt5.paddingBottom;
908
+
909
+ finalPadding = 'padding-bottom:' + paddingBottom + ';';
910
+ heightFix = "padding-bottom: ".concat(sumWithPx(deltaHeight, paddingBottom), ";");
911
+ }
912
+
913
+ var overflowFix = scrollHeight > clientHeight || scrollWidth > clientWidth ? "overflow: hidden;" : "";
914
+ var transform = (left !== 0 || top !== 0) && !skipTransform ? "transform: translate(".concat(left, "px,").concat(top, "px);") : '';
915
+ var oldTransform = node.style.transform;
916
+ return [utils.oneWayAnimation("\n ".concat(transform, "\n ").concat(heightFix, "\n ").concat(overflowFix, "\n width: ").concat(oldSnap.width, "px;\n height: ").concat(oldSnap.height, "px;\n "), "\n ".concat(finalPadding, "\n ").concat(oldTransform ? "transform:".concat(oldTransform, ";") : '', "\n ").concat(overflowFix, "\n width: ").concat(newSnap.width, "px;\n height: ").concat(newSnap.height - newSnapBottomMarginDelta, "px;\n "))];
917
+ } else {
918
+ return [];
919
+ }
920
+ };
921
+
922
+ var willPlaySwitch = function willPlaySwitch(oldSnap, newSnap, _ref7) {
923
+ var switchIn = _ref7.switchIn,
924
+ switchOut = _ref7.switchOut,
925
+ switchAnimation = _ref7.switchAnimation,
926
+ timing = _ref7.timing,
927
+ _ref7$transformHeight = _ref7.transformHeight,
928
+ transformHeight = _ref7$transformHeight === void 0 ? _identity : _ref7$transformHeight;
733
929
  var realWrapper = newSnap.domNode;
734
930
  var newChildren = [].slice.call(realWrapper.children); // realWrapper.style.willChange = 'width,height,margin-top;'
735
931
 
@@ -746,7 +942,7 @@ var playSwitch = function playSwitch(oldSnap, newSnap, _ref6) {
746
942
  // oldSnap.clonedNode.style.willChange = 'width,height,opacity'
747
943
 
748
944
  var realWrapperRect = realWrapper.getBoundingClientRect();
749
- var resizeToNew = utils.oneWayAnimation("\n overflow: hidden;\n width: ".concat(realWrapperRect.width, "px;\n height: ").concat(realWrapperRect.height, "px;\n "), "\n overflow: hidden;\n width: ".concat(newSnap.clonedNode.style.width, ";\n height: ").concat(utils.callIfFunction(transformHeight, newSnap.clonedNode.style.height, realWrapperRect), ";\n "));
945
+ var resizeToNew = utils.oneWayAnimation("\n overflow: hidden;\n width: ".concat(oldSnap.width, "px;\n height: ").concat(oldSnap.height, "px;\n "), "\n overflow: hidden;\n width: ".concat(newSnap.clonedNode.style.width, ";\n height: ").concat(utils.callIfFunction(transformHeight, newSnap.clonedNode.style.height, realWrapperRect), ";\n "));
750
946
  childMAp(newChildren, function (c) {
751
947
  if (c.dataset && !c.dataset.noFlip) {
752
948
  if (c.style.opacity) {
@@ -763,12 +959,14 @@ var playSwitch = function playSwitch(oldSnap, newSnap, _ref6) {
763
959
  });
764
960
  var resizeOld = oldSnap.width > newSnap.width || oldSnap.height > newSnap.height ? [resizeToNew] : [resizeToNew];
765
961
  var resizeNew = oldSnap.width < newSnap.width || oldSnap.height < newSnap.height ? [resizeToNew] : [resizeToNew];
766
- morph(oldSnap.clonedNode, formatAnimation([].concat(switchOut || switchAnimation, resizeOld), timing), function () {
767
- return oldSnap.clonedNode.remove();
768
- });
769
- newSnap.clonedNode.style.opacity = '0';
770
- continueSwitchCallbacks.set(realWrapper, continueSwitchOnClone(realWrapper));
771
- morph(newSnap.clonedNode, formatAnimation([formatAnimation(switchIn || switchAnimation, timing, !switchIn)].concat(resizeNew), timing), finishSwitchNew(newSnap.clonedNode, realWrapper));
962
+ return function () {
963
+ morph(oldSnap.clonedNode, formatAnimation([].concat(switchOut || switchAnimation, resizeOld), timing), function () {
964
+ return oldSnap.clonedNode.remove();
965
+ });
966
+ newSnap.clonedNode.style.opacity = '0';
967
+ continueSwitchCallbacks.set(realWrapper, continueSwitchOnClone(realWrapper));
968
+ morph(newSnap.clonedNode, formatAnimation([formatAnimation(switchIn || switchAnimation, timing, !switchIn)].concat(resizeNew), timing), finishSwitchNew(newSnap.clonedNode, realWrapper));
969
+ };
772
970
  };
773
971
 
774
972
  var getDelays = function getDelays(el, animation) {
@@ -810,9 +1008,9 @@ function (_React$Component) {
810
1008
  return Snapshoter;
811
1009
  }(React__default.Component);
812
1010
 
813
- var useFlip = function useFlip(_ref7) {
814
- var on = _ref7.on,
815
- moveOn = _ref7.moveOn;
1011
+ var useFlip = function useFlip(_ref8) {
1012
+ var on = _ref8.on,
1013
+ moveOn = _ref8.moveOn;
816
1014
  core.useHiddenFill(React__default.createElement(Snapshoter, {
817
1015
  on: on,
818
1016
  moveOn: moveOn,
@@ -854,16 +1052,21 @@ var willUseFlip = function willUseFlip() {
854
1052
  var useEnterAnimation = function useEnterAnimation(ref) {
855
1053
  var onEnter = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : defaultEnterAnimation;
856
1054
 
857
- var _ref8 = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {},
858
- onEnterEnd = _ref8.onEnterEnd,
859
- _ref8$timing = _ref8.timing,
860
- timing = _ref8$timing === void 0 ? defaultAnimationMaker : _ref8$timing;
1055
+ var _ref9 = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {},
1056
+ onEnterEnd = _ref9.onEnterEnd,
1057
+ _ref9$timing = _ref9.timing,
1058
+ timing = _ref9$timing === void 0 ? defaultAnimationMaker : _ref9$timing,
1059
+ enterEffect = _ref9.enterEffect;
861
1060
 
862
1061
  React.useLayoutEffect(function () {
863
1062
  if (!morphEnabled && onEnter && ref.current) {
864
1063
  var el = ref.current;
865
1064
  var animation = formatAnimation(onEnter, timing);
866
- morph(el, animation, onEnterEnd);
1065
+ var endEffect = utils.callIfFunction(enterEffect, el);
1066
+ morph(el, animation, function () {
1067
+ utils.callIfFunction(onEnterEnd);
1068
+ utils.callIfFunction(endEffect, el);
1069
+ });
867
1070
  enterChildrenCallback(timing);
868
1071
  }
869
1072
  }, [onEnter]);
@@ -872,16 +1075,17 @@ var willUseFlip = function willUseFlip() {
872
1075
  var useLeaveAnimation = function useLeaveAnimation(ref) {
873
1076
  var onLeave = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : defaultEnterAnimation;
874
1077
 
875
- var _ref9 = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {},
876
- removeRef = _ref9.ref,
877
- _ref9$timing = _ref9.timing,
878
- timing = _ref9$timing === void 0 ? defaultAnimationMaker : _ref9$timing,
879
- _ref9$nestedFlip = _ref9.nestedFlip,
880
- nestedFlip = _ref9$nestedFlip === void 0 ? false : _ref9$nestedFlip,
881
- _ref9$events = _ref9.events,
882
- events = _ref9$events === void 0 ? {} : _ref9$events,
883
- _ref9$reverse = _ref9.reverse,
884
- reverse = _ref9$reverse === void 0 ? true : _ref9$reverse;
1078
+ var _ref10 = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {},
1079
+ removeRef = _ref10.ref,
1080
+ leaveEffect = _ref10.leaveEffect,
1081
+ _ref10$timing = _ref10.timing,
1082
+ timing = _ref10$timing === void 0 ? defaultAnimationMaker : _ref10$timing,
1083
+ _ref10$nestedFlip = _ref10.nestedFlip,
1084
+ nestedFlip = _ref10$nestedFlip === void 0 ? false : _ref10$nestedFlip,
1085
+ _ref10$events = _ref10.events,
1086
+ events = _ref10$events === void 0 ? {} : _ref10$events,
1087
+ _ref10$reverse = _ref10.reverse,
1088
+ reverse = _ref10$reverse === void 0 ? true : _ref10$reverse;
885
1089
 
886
1090
  React.useLayoutEffect(function () {
887
1091
  return function () {
@@ -893,6 +1097,12 @@ var willUseFlip = function willUseFlip() {
893
1097
  var isNested = utils.callIfFunction(nestedFlip);
894
1098
  var clone = isNested ? el : el.cloneNode(true);
895
1099
 
1100
+ utils._s.each(function (callback, type) {
1101
+ return clone.addEventListener(type, callback);
1102
+ }, events);
1103
+
1104
+ var endEffect = utils.callIfFunction(leaveEffect, clone, el);
1105
+
896
1106
  if (removeRef) {
897
1107
  removeRef.current = clone;
898
1108
  }
@@ -900,11 +1110,7 @@ var willUseFlip = function willUseFlip() {
900
1110
  if (!isNested) {
901
1111
  el.parentNode.insertBefore(clone, el);
902
1112
  } // sometimes the clone may need to trigger events (usual case: onmouseover to reopen the element)
903
-
904
-
905
- utils._s.each(function (callback, type) {
906
- return clone.addEventListener(type, callback);
907
- }, events); // allow clone to be continued by another animation
1113
+ // allow clone to be continued by another animation
908
1114
 
909
1115
 
910
1116
  controlElement = clone; // the animation
@@ -913,18 +1119,27 @@ var willUseFlip = function willUseFlip() {
913
1119
  morph(clone, animation, function () {
914
1120
  clone.remove();
915
1121
  disableMorph();
1122
+ utils.callIfFunction(endEffect, clone, el);
916
1123
  });
917
1124
  }; // wait for current animation to end and then animate
918
1125
 
919
1126
 
920
1127
  if (clone.style.animation) {
1128
+ var maxAnimationTime = _max((clone.style.animationDuration.split(",") || ["0.25s"]).map(function (s) {
1129
+ return parseFloat(s.trim() || "0.25") * (s.indexOf("m") > 0 ? 1 : 1000);
1130
+ }));
1131
+
1132
+ var timeoutRef = {};
1133
+
921
1134
  var animationEnd = function animationEnd(e) {
922
- clone.animationDelay = '';
923
- e.stopImmediatePropagation();
1135
+ clearTimeout(timeoutRef.current || -1);
924
1136
  clone.removeEventListener('animationend', animationEnd);
1137
+ clone.animationDelay = '';
1138
+ e === null || e === void 0 ? void 0 : e.stopImmediatePropagation();
925
1139
  setTimeout(animate, 1);
926
1140
  };
927
1141
 
1142
+ timeoutRef.current = setTimeout(animationEnd, maxAnimationTime);
928
1143
  clone.addEventListener('animationend', animationEnd);
929
1144
  clone.style.animationDelay = getDelays(el, clone.style.animation);
930
1145
  } else {
@@ -938,9 +1153,9 @@ var willUseFlip = function willUseFlip() {
938
1153
  var useMorphAnimation = function useMorphAnimation(ref) {
939
1154
  var ready = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
940
1155
 
941
- var _ref10 = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {},
942
- _ref10$timing = _ref10.timing,
943
- timing = _ref10$timing === void 0 ? defaultAnimationMaker : _ref10$timing;
1156
+ var _ref11 = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {},
1157
+ _ref11$timing = _ref11.timing,
1158
+ timing = _ref11$timing === void 0 ? defaultAnimationMaker : _ref11$timing;
944
1159
 
945
1160
  React.useLayoutEffect(function () {
946
1161
  if (ready && controlElement && ref.current) {
@@ -967,10 +1182,10 @@ var willUseFlip = function willUseFlip() {
967
1182
  });
968
1183
 
969
1184
  if (rectAnimation.length) {
970
- playSwitch(oldSnap, newSnap, {
1185
+ willPlaySwitch(oldSnap, newSnap, {
971
1186
  switchAnimation: defaultSwitchAnimation,
972
1187
  timing: timing
973
- });
1188
+ })();
974
1189
  }
975
1190
 
976
1191
  controlElement.remove();
@@ -988,8 +1203,8 @@ var willUseFlip = function willUseFlip() {
988
1203
  };
989
1204
 
990
1205
  var useNestedEnterAnimation = function useNestedEnterAnimation(ref, onEnter) {
991
- var _ref11 = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {},
992
- timing = _ref11.timing;
1206
+ var _ref12 = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {},
1207
+ timing = _ref12.timing;
993
1208
 
994
1209
  useRegisterEnter(function (parentTiming) {
995
1210
  var el = ref.current;
@@ -1000,9 +1215,9 @@ var willUseFlip = function willUseFlip() {
1000
1215
  };
1001
1216
 
1002
1217
  var useNestLeaveAnimation = function useNestLeaveAnimation(ref, onLeave) {
1003
- var _ref12 = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {},
1004
- timing = _ref12.timing,
1005
- events = _ref12.events;
1218
+ var _ref13 = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {},
1219
+ timing = _ref13.timing,
1220
+ events = _ref13.events;
1006
1221
 
1007
1222
  useRegisterLeave(function (parentTiming) {
1008
1223
  var el = ref.current;
@@ -1017,7 +1232,9 @@ var willUseFlip = function willUseFlip() {
1017
1232
 
1018
1233
  return function (ref) {
1019
1234
  React.useLayoutEffect(function () {
1020
- if (ref.current.dataset) {
1235
+ var _ref$current;
1236
+
1237
+ if ((_ref$current = ref.current) === null || _ref$current === void 0 ? void 0 : _ref$current.dataset) {
1021
1238
  ref.current.dataset.morphId = morphId;
1022
1239
  }
1023
1240
  });
@@ -1057,21 +1274,22 @@ var willUseFlipSwitch = function willUseFlipSwitch() {
1057
1274
  };
1058
1275
 
1059
1276
  return function (ref, onEnter, onLeave) {
1060
- var _ref13 = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {},
1061
- _ref13$timing = _ref13.timing,
1062
- timing = _ref13$timing === void 0 ? defaultAnimationMaker : _ref13$timing,
1063
- _ref13$switchAnimatio = _ref13.switchAnimation,
1064
- switchAnimation = _ref13$switchAnimatio === void 0 ? defaultSwitchAnimation : _ref13$switchAnimatio,
1065
- effect = _ref13.effect;
1277
+ var _ref14 = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {},
1278
+ _ref14$timing = _ref14.timing,
1279
+ timing = _ref14$timing === void 0 ? defaultAnimationMaker : _ref14$timing,
1280
+ _ref14$switchAnimatio = _ref14.switchAnimation,
1281
+ switchAnimation = _ref14$switchAnimatio === void 0 ? defaultSwitchAnimation : _ref14$switchAnimatio,
1282
+ effect = _ref14.effect;
1066
1283
 
1067
1284
  React.useLayoutEffect(function () {
1068
1285
  if (oldSnap && ref.current) {
1069
1286
  var newSnap = getTempWrapper(ref.current, {
1070
1287
  withMargins: true
1071
1288
  });
1289
+ var switchToPlay = _identity;
1072
1290
 
1073
1291
  if (oldSnap.clonedNode) {
1074
- playSwitch(oldSnap, newSnap, {
1292
+ switchToPlay = willPlaySwitch(oldSnap, newSnap, {
1075
1293
  switchIn: utils.callIfFunction(onEnter),
1076
1294
  switchOut: utils.callIfFunction(onLeave),
1077
1295
  switchAnimation: utils.callIfFunction(switchAnimation),
@@ -1079,8 +1297,9 @@ var willUseFlipSwitch = function willUseFlipSwitch() {
1079
1297
  });
1080
1298
  }
1081
1299
 
1082
- var animation = getClientRectAnimation(oldSnap, newSnap);
1083
- var endEffect = utils.callIfFunction(effect, oldSnap.clonedNode, newSnap.clonedNode);
1300
+ var animation = getClientRectAnimationForSwitch(oldSnap, newSnap);
1301
+ var endEffect = utils.callIfFunction(effect, oldSnap.clonedNode, newSnap.clonedNode, ref.current);
1302
+ switchToPlay();
1084
1303
  morph(newSnap.domNode, formatAnimation(animation, timing), function () {
1085
1304
  return utils.callIfFunction(endEffect, oldSnap.clonedNode, newSnap.clonedNode);
1086
1305
  });
@@ -1122,7 +1341,7 @@ function _templateObject2$1() {
1122
1341
  }
1123
1342
 
1124
1343
  function _templateObject$3() {
1125
- var data = _taggedTemplateLiteral(["\n padding: 3rem 0.5rem;\n "]);
1344
+ var data = _taggedTemplateLiteral(["\n padding: ", ";\n "]);
1126
1345
 
1127
1346
  _templateObject$3 = function _templateObject() {
1128
1347
  return data;
@@ -1147,9 +1366,11 @@ var ModalContainer = styled__default.div.withConfig({
1147
1366
  var DialogCenter = styled__default.div.withConfig({
1148
1367
  displayName: "DialogContainer__DialogCenter",
1149
1368
  componentId: "wendlg-2"
1150
- })(["@supports (position:sticky){will-change:transform,opacity;}display:-webkit-box;display:-ms-flexbox;display:flex;overflow-y:", ";overflow-x:hidden;position:fixed;top:0;bottom:0;left:0;right:0;align-items:center;", " ", ""], function (props) {
1369
+ })(["@supports (position:sticky){will-change:transform,opacity;&.JS-wc-off{will-change:auto;}}display:-webkit-box;display:-ms-flexbox;display:flex;overflow-y:", ";overflow-x:hidden;position:fixed;top:0;bottom:0;left:0;right:0;align-items:center;", " ", ""], function (props) {
1151
1370
  return props.withScroll ? "scroll" : "hidden";
1152
- }, utils.media.desktop(_templateObject$3()), utils.media.mobile(_templateObject2$1(), function (props) {
1371
+ }, utils.media.desktop(_templateObject$3(), function (props) {
1372
+ return props.fullscreen ? '1rem' : '3rem 0.5rem;';
1373
+ }), utils.media.mobile(_templateObject2$1(), function (props) {
1153
1374
  return props.fullscreenOnMobile ? '0' : '0.5rem';
1154
1375
  }));
1155
1376
  var PopupSlot = styled__default(core.Slot).withConfig({
@@ -1211,10 +1432,9 @@ var removeWindowScroll = function removeWindowScroll(opening) {
1211
1432
  }
1212
1433
  }
1213
1434
 
1214
- var finishReset = function finishReset(bodyWidth) {
1215
- var marginRight = body.offsetWidth - bodyWidth;
1216
- body.style.paddingRight = marginRight + 'px';
1217
- window.scroll(window.scrollLeft, scrollTop);
1435
+ var finishReset = function finishReset(marginRight, scrollTop) {
1436
+ // body.style.paddingRight = marginRight + 'px'
1437
+ window.scroll(window.scrollLeft || window.scrollX || 0, scrollTop);
1218
1438
  fixPosition('.navbar,.JS-fix-dialog-scroll', function (n) {
1219
1439
  if (opening) {
1220
1440
  var _window$getComputedSt = window.getComputedStyle(n),
@@ -1232,25 +1452,37 @@ var removeWindowScroll = function removeWindowScroll(opening) {
1232
1452
  n.style.transform = null;
1233
1453
  }
1234
1454
  });
1235
- window.dispatchEvent(new CustomEvent('resize', {
1236
- detail: {
1237
- dialog: true
1238
- }
1239
- }));
1455
+ window.requestAnimationFrame(function () {
1456
+ return window.dispatchEvent(new CustomEvent('resize', {
1457
+ detail: {
1458
+ dialog: true
1459
+ }
1460
+ }));
1461
+ });
1240
1462
  };
1241
1463
 
1242
1464
  var body = document.body;
1243
1465
  var bodyWidth = body.offsetWidth;
1244
- var scrollTop = window.pageYOffset;
1245
1466
 
1246
1467
  if (opening) {
1468
+ var scrollTop = window.pageYOffset;
1247
1469
  body.style.overflow = 'hidden';
1248
- finishReset(bodyWidth);
1470
+ var marginRight = body.offsetWidth - bodyWidth;
1471
+ body.style.position = 'fixed';
1472
+ body.style.top = -scrollTop + "px";
1473
+ body.style.left = '0';
1474
+ body.style.right = marginRight + 'px';
1475
+ finishReset(marginRight, scrollTop);
1249
1476
  } else {
1250
1477
  // setTimeout(() => {
1478
+ var _scrollTop = parseInt(body.style.top);
1479
+
1251
1480
  body.style.overflow = '';
1252
- bodyWidth = body.offsetWidth;
1253
- finishReset(bodyWidth); // },250)
1481
+ body.style.position = '';
1482
+ body.style.top = '';
1483
+ body.style.left = '';
1484
+ body.style.right = '';
1485
+ finishReset(0, -_scrollTop); // },250)
1254
1486
  }
1255
1487
  };
1256
1488
 
@@ -1277,13 +1509,16 @@ var DialogContainer = React.forwardRef(function (_ref, forwardedRef) {
1277
1509
  _ref$animation = _ref.animation,
1278
1510
  animation = _ref$animation === void 0 ? dialogFadeInDown : _ref$animation,
1279
1511
  animationTiming = _ref.animationTiming,
1512
+ animationLeaveEffect = _ref.animationLeaveEffect,
1513
+ animationEnterEffect = _ref.animationEnterEffect,
1280
1514
  skipKeys = _ref.skipKeys,
1281
1515
  fullscreenOnMobile = _ref.fullscreenOnMobile,
1282
1516
  _ref$confirmChanges = _ref.confirmChanges,
1283
1517
  confirmChanges = _ref$confirmChanges === void 0 ? true : _ref$confirmChanges,
1284
1518
  skipDom = _ref.skipDom,
1285
1519
  modalRef = _ref.modalRef,
1286
- skipCheckFocus = _ref.skipCheckFocus;
1520
+ skipCheckFocus = _ref.skipCheckFocus,
1521
+ autoComplete = _ref.autoComplete;
1287
1522
  var dialogRef = core.useEnsureRef(forwardedRef);
1288
1523
  var prevActiveElement = core.useRefState(document.activeElement);
1289
1524
  var modal = core.useEnsureRef(modalRef);
@@ -1306,7 +1541,7 @@ var DialogContainer = React.forwardRef(function (_ref, forwardedRef) {
1306
1541
  }
1307
1542
  }); // clearPreventDialogPop()
1308
1543
 
1309
- if (document.body.scrollHeight <= document.body.clientHeight) {
1544
+ if (document.body.scrollHeight === document.body.clientHeight) {
1310
1545
  modal.current.style.overflowY = "scroll";
1311
1546
 
1312
1547
  if (modalScroll.current) {
@@ -1361,9 +1596,15 @@ var DialogContainer = React.forwardRef(function (_ref, forwardedRef) {
1361
1596
  if (customHref && window.location.hash !== customHref) {
1362
1597
  // if (pastFirstTime.current) {
1363
1598
  waitForPop().then(function () {
1364
- window.history.replaceState({
1365
- dialog: true
1366
- }, '', customHref);
1599
+ if (window.location.hash) {
1600
+ window.history.replaceState({
1601
+ dialog: true
1602
+ }, '', customHref);
1603
+ } else {
1604
+ window.history.pushState({
1605
+ dialog: true
1606
+ }, '', customHref);
1607
+ }
1367
1608
  }); // } else {
1368
1609
  // window.history.pushState({dialog: true}, '', customHref)
1369
1610
  // pastFirstTime.current = true
@@ -1413,7 +1654,9 @@ var DialogContainer = React.forwardRef(function (_ref, forwardedRef) {
1413
1654
  };
1414
1655
 
1415
1656
  var checkKey = function checkKey(e) {
1416
- if (!isTop() || skipKeys) return;
1657
+ var _e$target, _e$target$className;
1658
+
1659
+ if (!isTop() || skipKeys || ((_e$target = e.target) === null || _e$target === void 0 ? void 0 : (_e$target$className = _e$target.className) === null || _e$target$className === void 0 ? void 0 : _e$target$className.indexOf("JS-dialog-skip-evts")) >= 0) return;
1417
1660
 
1418
1661
  if (modal.current && e.shiftKey && e.keyCode === 9 && modal.current.querySelector('[tabindex]') === document.activeElement) {
1419
1662
  e.preventDefault();
@@ -1471,7 +1714,7 @@ var DialogContainer = React.forwardRef(function (_ref, forwardedRef) {
1471
1714
  removeWindowScroll(true);
1472
1715
  }
1473
1716
 
1474
- if (document.body.scrollHeight <= document.body.clientHeight) {
1717
+ if (document.body.scrollHeight === document.body.clientHeight) {
1475
1718
  modal.current.style.overflowY = "none";
1476
1719
  }
1477
1720
 
@@ -1479,6 +1722,8 @@ var DialogContainer = React.forwardRef(function (_ref, forwardedRef) {
1479
1722
  modalScroll.current.style.overflowY = "scroll";
1480
1723
  }
1481
1724
  },
1725
+ leaveEffect: animationLeaveEffect,
1726
+ enterEffect: animationEnterEffect,
1482
1727
  timing: animationTiming
1483
1728
  });
1484
1729
  useFlipAnimation(modal, !skipDom && utils.identityOpacityFrames, true, {
@@ -1500,6 +1745,8 @@ var DialogContainer = React.forwardRef(function (_ref, forwardedRef) {
1500
1745
  }), React__default.createElement(ModalContainer, {
1501
1746
  ref: modal
1502
1747
  }, React__default.createElement(DialogCenter, {
1748
+ autoComplete: autoComplete,
1749
+ className: "JS-has-wc",
1503
1750
  withScroll: getSize() > 1,
1504
1751
  fullscreenOnMobile: fullscreenOnMobile,
1505
1752
  ref: modalScroll,
@@ -1512,16 +1759,20 @@ var DialogContainer = React.forwardRef(function (_ref, forwardedRef) {
1512
1759
  var AnimatedModal = React__default.forwardRef(function (_ref2, ref) {
1513
1760
  var timing = _ref2.timing,
1514
1761
  nestedFlip = _ref2.nestedFlip,
1762
+ enterEffect = _ref2.enterEffect,
1763
+ leaveEffect = _ref2.leaveEffect,
1515
1764
  _ref2$modalIn = _ref2.modalIn,
1516
1765
  modalIn = _ref2$modalIn === void 0 ? dialogModalIn : _ref2$modalIn,
1517
1766
  _ref2$modalOut = _ref2.modalOut,
1518
1767
  modalOut = _ref2$modalOut === void 0 ? dialogModalOut : _ref2$modalOut,
1519
- props = _objectWithoutProperties(_ref2, ["timing", "nestedFlip", "modalIn", "modalOut"]);
1768
+ props = _objectWithoutProperties(_ref2, ["timing", "nestedFlip", "enterEffect", "leaveEffect", "modalIn", "modalOut"]);
1520
1769
 
1521
1770
  var modal = core.useEnsureRef(ref);
1522
1771
  useFlipAnimation(modal, modalIn, modalOut, {
1523
1772
  timing: timing,
1524
- nestedFlip: nestedFlip
1773
+ nestedFlip: nestedFlip,
1774
+ leaveEffect: leaveEffect,
1775
+ enterEffect: enterEffect
1525
1776
  });
1526
1777
  return React__default.createElement(Modal, _extends({}, props, {
1527
1778
  ref: modal
@@ -1539,7 +1790,7 @@ function _templateObject2$2() {
1539
1790
  }
1540
1791
 
1541
1792
  function _templateObject$4() {
1542
- var data = _taggedTemplateLiteral(["\n display: flex;\n flex-wrap: nowrap;\n margin-left: -", "rem;\n margin-right: -", "rem;\n margin-top: -", "rem;\n > * {\n flex-basis: 0;\n flex-grow: 1;\n margin-left: ", "rem;\n margin-right: ", "rem;\n margin-top: ", "rem;\n }\n "]);
1793
+ var data = _taggedTemplateLiteral(["\n display: flex;\n flex-wrap: nowrap;\n margin-left: -", "rem;\n margin-right: -", "rem;\n margin-top: -", "rem;\n > * {\n flex-basis: 0;\n flex-grow: 1;\n margin-left: ", "rem;\n margin-right: ", "rem;\n margin-top: ", "rem;\n }\n "]);
1543
1794
 
1544
1795
  _templateObject$4 = function _templateObject() {
1545
1796
  return data;
@@ -1607,9 +1858,114 @@ var fixDoubledLastMarginBottom = function fixDoubledLastMarginBottom(children) {
1607
1858
  return React__default.Children.map(children, processChild);
1608
1859
  };
1609
1860
 
1610
- function _templateObject6() {
1861
+ var _twoWayAnimation$1 = utils.twoWayAnimation('opacity:0;', 'opacity:1;'),
1862
+ _twoWayAnimation2$1 = _slicedToArray(_twoWayAnimation$1, 2),
1863
+ loadingEnter = _twoWayAnimation2$1[0],
1864
+ loadingLeave = _twoWayAnimation2$1[1];
1865
+
1866
+ var _twoWayAnimation3 = utils.twoWayAnimation('opacity:0; transform:translateY(50%)', 'opacity:1;transform:translateY(0)'),
1867
+ _twoWayAnimation4 = _slicedToArray(_twoWayAnimation3, 2),
1868
+ onEnter = _twoWayAnimation4[0],
1869
+ onLeave = _twoWayAnimation4[1];
1870
+
1871
+ var BlockContainer = styled__default.div.withConfig({
1872
+ displayName: "LoadingDiv__BlockContainer",
1873
+ componentId: "sc-1g7ljba-0"
1874
+ })(["position:relative;"]);
1875
+
1876
+ var FlipDiv = function FlipDiv(_ref) {
1877
+ var useAnimation = _ref.useAnimation,
1878
+ outerRef = _ref.outerRef,
1879
+ _ref$onEnter = _ref.onEnter,
1880
+ onEnter = _ref$onEnter === void 0 ? onEnter : _ref$onEnter,
1881
+ _ref$onLeave = _ref.onLeave,
1882
+ onLeave = _ref$onLeave === void 0 ? onLeave : _ref$onLeave,
1883
+ props = _objectWithoutProperties(_ref, ["useAnimation", "outerRef", "onEnter", "onLeave"]);
1884
+
1885
+ var ensuredRef = core.useEnsureRef(outerRef);
1886
+ useAnimation(ensuredRef, onEnter, onLeave);
1887
+ return React__default.createElement(BlockContainer, _extends({}, props, {
1888
+ ref: ensuredRef
1889
+ }));
1890
+ };
1891
+
1892
+ var PaddingDiv = styled__default.div.withConfig({
1893
+ displayName: "LoadingDiv__PaddingDiv",
1894
+ componentId: "sc-1g7ljba-1"
1895
+ })(["padding:", " 0;"], function (props) {
1896
+ return props.height;
1897
+ });
1898
+ var LoadingDiv = function LoadingDiv(_ref2) {
1899
+ var _ref2$defaultToSuspen = _ref2.defaultToSuspense,
1900
+ defaultToSuspense = _ref2$defaultToSuspen === void 0 ? true : _ref2$defaultToSuspen,
1901
+ fallback = _ref2.fallback,
1902
+ isLoading = _ref2.isLoading,
1903
+ className = _ref2.className,
1904
+ _ref2$height = _ref2.height,
1905
+ height = _ref2$height === void 0 ? 12 : _ref2$height,
1906
+ _ref2$size = _ref2.size,
1907
+ size = _ref2$size === void 0 ? 32 : _ref2$size,
1908
+ _ref2$borderWidth = _ref2.borderWidth,
1909
+ borderWidth = _ref2$borderWidth === void 0 ? 5 : _ref2$borderWidth,
1910
+ children = _ref2.children;
1911
+ var flipAnimation = core.useLazyConstant(willUseFlipSwitch);
1912
+ var loadingBlock = React__default.createElement(PaddingDiv, {
1913
+ height: _isString(height) ? borderWidth : height + 'rem'
1914
+ }, React__default.createElement(Loading, {
1915
+ autoFocus: true,
1916
+ absolute: true,
1917
+ size: size,
1918
+ borderWidth: borderWidth
1919
+ }));
1920
+ return React__default.createElement(React__default.Suspense, {
1921
+ fallback: React__default.createElement(FlipDiv, {
1922
+ key: "loading",
1923
+ padded: true,
1924
+ onEnter: loadingEnter,
1925
+ onLeave: loadingLeave,
1926
+ useAnimation: flipAnimation,
1927
+ className: className
1928
+ }, fallback, loadingBlock)
1929
+ }, typeof isLoading === 'boolean' || defaultToSuspense ? isLoading ? React__default.createElement(FlipDiv, {
1930
+ key: "loading",
1931
+ padded: true,
1932
+ onEnter: loadingEnter,
1933
+ onLeave: loadingLeave,
1934
+ useAnimation: flipAnimation,
1935
+ className: className
1936
+ }, fallback, loadingBlock) : React__default.createElement(FlipDiv, {
1937
+ key: "loaded",
1938
+ loaded: true,
1939
+ onEnter: loadingEnter,
1940
+ onLeave: loadingLeave,
1941
+ useAnimation: flipAnimation,
1942
+ className: className
1943
+ }, children) : children);
1944
+ };
1945
+
1946
+ function _templateObject8() {
1611
1947
  var data = _taggedTemplateLiteral(["\n padding: 1.5rem 1.5rem 1.5rem;\n max-width: 100%;\n ", ";\n "]);
1612
1948
 
1949
+ _templateObject8 = function _templateObject8() {
1950
+ return data;
1951
+ };
1952
+
1953
+ return data;
1954
+ }
1955
+
1956
+ function _templateObject7() {
1957
+ var data = _taggedTemplateLiteral(["\n padding: 1.5rem 1.5rem 0;\n margin: -1.5rem;\n "]);
1958
+
1959
+ _templateObject7 = function _templateObject7() {
1960
+ return data;
1961
+ };
1962
+
1963
+ return data;
1964
+ }
1965
+
1966
+ function _templateObject6() {
1967
+ var data = _taggedTemplateLiteral(["\n padding: 1.5rem;\n margin: -1.5rem;\n "]);
1968
+
1613
1969
  _templateObject6 = function _templateObject6() {
1614
1970
  return data;
1615
1971
  };
@@ -1705,118 +2061,71 @@ var DialogFooter = styled__default.div.withConfig({
1705
2061
  var FooterAuxiliaryContainer = styled__default.div.withConfig({
1706
2062
  displayName: "Dialog__FooterAuxiliaryContainer",
1707
2063
  componentId: "gai4ey-6"
1708
- })(["flex-grow:1;align-self:center;display:inline-block;padding-right:1rem;float:left;"]);
1709
-
1710
- var _twoWayAnimation$1 = utils.twoWayAnimation('opacity:0;', 'opacity:1;'),
1711
- _twoWayAnimation2$1 = _slicedToArray(_twoWayAnimation$1, 2),
1712
- loadingEnter = _twoWayAnimation2$1[0],
1713
- loadingLeave = _twoWayAnimation2$1[1];
1714
-
1715
- var _twoWayAnimation3 = utils.twoWayAnimation('opacity:0; transform:translateY(50%)', 'opacity:1;transform:translateY(0)'),
1716
- _twoWayAnimation4 = _slicedToArray(_twoWayAnimation3, 2),
1717
- onEnter = _twoWayAnimation4[0],
1718
- onLeave = _twoWayAnimation4[1];
2064
+ })(["flex-grow:1;align-self:center;display:inline-block;padding-right:1rem;float:left;"]); // THIS IS NEEDED FOR LOADING ANIMATION ON DialogWithImageHeader
1719
2065
 
1720
- var BlockContainer = styled__default.div.withConfig({
1721
- displayName: "Dialog__BlockContainer",
2066
+ var DialogContentWrapper = styled__default(LoadingDiv).withConfig({
2067
+ displayName: "Dialog__DialogContentWrapper",
1722
2068
  componentId: "gai4ey-7"
1723
- })(["position:relative;overflow:hidden;", ""], function (props) {
1724
- return props.padded ? 'padding:12rem 0;' : '';
1725
- });
2069
+ })(["padding:2rem;margin:-2rem;", ""], utils.media.mobile(_templateObject6()));
2070
+ var DialogAlwaysVisibleDiv = styled__default.div.withConfig({
2071
+ displayName: "Dialog__DialogAlwaysVisibleDiv",
2072
+ componentId: "gai4ey-8"
2073
+ })(["padding:2rem 2rem 0;margin:-2rem;", ""], utils.media.mobile(_templateObject7())); // END
1726
2074
 
1727
- var FlipDiv = function FlipDiv(_ref) {
1728
- var useAnimation = _ref.useAnimation,
1729
- outerRef = _ref.outerRef,
1730
- _ref$onEnter = _ref.onEnter,
1731
- onEnter = _ref$onEnter === void 0 ? onEnter : _ref$onEnter,
1732
- _ref$onLeave = _ref.onLeave,
1733
- onLeave = _ref$onLeave === void 0 ? onLeave : _ref$onLeave,
1734
- props = _objectWithoutProperties(_ref, ["useAnimation", "outerRef", "onEnter", "onLeave"]);
2075
+ var Dialog = styled__default(React__default.forwardRef(function (_ref, outerRef) {
2076
+ var className = _ref.className,
2077
+ skipWrap = _ref.skipWrap,
2078
+ isLoading = _ref.isLoading,
2079
+ footer = _ref.footer,
2080
+ Content = _ref.Content,
2081
+ children = _ref.children,
2082
+ title = _ref.title,
2083
+ illustration = _ref.illustration,
2084
+ icon = _ref.icon,
2085
+ auxiliarActions = _ref.auxiliarActions,
2086
+ _ref$container = _ref.container,
2087
+ container = _ref$container === void 0 ? true : _ref$container,
2088
+ props = _objectWithoutProperties(_ref, ["className", "skipWrap", "isLoading", "footer", "Content", "children", "title", "illustration", "icon", "auxiliarActions", "container"]);
1735
2089
 
1736
- var ensuredRef = core.useEnsureRef(outerRef);
1737
- useAnimation(ensuredRef, onEnter, onLeave);
1738
- return React__default.createElement(BlockContainer, _extends({}, props, {
1739
- ref: ensuredRef
1740
- }));
1741
- };
2090
+ var ref = core.useEnsureRef(outerRef);
1742
2091
 
1743
- var Dialog = styled__default(React__default.forwardRef(function (_ref2, outerRef) {
1744
- var className = _ref2.className,
1745
- isLoading = _ref2.isLoading,
1746
- footer = _ref2.footer,
1747
- Content = _ref2.Content,
1748
- children = _ref2.children,
1749
- title = _ref2.title,
1750
- illustration = _ref2.illustration,
1751
- icon = _ref2.icon,
1752
- auxiliarActions = _ref2.auxiliarActions,
1753
- _ref2$container = _ref2.container,
1754
- container = _ref2$container === void 0 ? true : _ref2$container,
1755
- props = _objectWithoutProperties(_ref2, ["className", "isLoading", "footer", "Content", "children", "title", "illustration", "icon", "auxiliarActions", "container"]);
2092
+ var alwaysVisible = function alwaysVisible(confirmCloseDialog) {
2093
+ return React__default.createElement(React__default.Fragment, null, props.closeDialog && React__default.createElement(CloseIcon, {
2094
+ className: "JS-dialog-close",
2095
+ onClick: confirmCloseDialog
2096
+ }), title && React__default.createElement(DialogTitle, null, utils.callIfFunction(title)));
2097
+ };
1756
2098
 
1757
- var ref = core.useEnsureRef(outerRef);
1758
- var flipAnimation = core.useLazyConstant(willUseFlipSwitch);
1759
- var content = React__default.createElement(React__default.Fragment, null, !Content && children && React__default.createElement(DialogContent, {
2099
+ var content = React__default.createElement(React__default.Fragment, null, Content && React__default.createElement(DialogContent, {
1760
2100
  icon: icon,
1761
2101
  illustration: illustration
1762
- }, utils.callIfFunction(children)), Content && children && utils.callIfFunction(children));
2102
+ }, utils.callIfFunction(Content)), !Content && children && React__default.createElement(DialogContent, {
2103
+ icon: icon,
2104
+ illustration: illustration
2105
+ }, utils.callIfFunction(children)), Content && children && utils.callIfFunction(children), footer && React__default.createElement(DialogFooter, null, auxiliarActions && React__default.createElement(FooterAuxiliaryContainer, null, utils.callIfFunction(auxiliarActions)), utils.callIfFunction(footer)));
1763
2106
 
1764
2107
  var dialog = function dialog(confirmCloseDialog) {
1765
2108
  return React__default.createElement("div", {
1766
- className: className,
2109
+ className: className + " JS-has-wc JS-dialog",
1767
2110
  ref: ref
1768
- }, props.closeDialog && React__default.createElement(CloseIcon, {
1769
- onClick: confirmCloseDialog
1770
- }), title && React__default.createElement(DialogTitle, null, utils.callIfFunction(title)), Content && React__default.createElement(DialogContent, {
1771
- icon: icon,
1772
- illustration: illustration
1773
- }, utils.callIfFunction(Content)), React__default.createElement(React__default.Suspense, {
1774
- fallback: React__default.createElement(FlipDiv, {
1775
- key: "loading",
1776
- padded: true,
1777
- onEnter: loadingEnter,
1778
- onLeave: loadingLeave,
1779
- useAnimation: flipAnimation,
1780
- className: className
1781
- }, React__default.createElement(Loading, {
1782
- autoFocus: true,
1783
- absolute: true,
1784
- size: 40,
1785
- borderWidth: 6
1786
- }))
1787
- }, typeof isLoading === 'boolean' ? isLoading ? React__default.createElement(FlipDiv, {
1788
- key: "loading",
1789
- padded: true,
1790
- onEnter: loadingEnter,
1791
- onLeave: loadingLeave,
1792
- useAnimation: flipAnimation,
1793
- className: className
1794
- }, React__default.createElement(Loading, {
1795
- autoFocus: true,
1796
- absolute: true,
1797
- size: 40,
1798
- borderWidth: 6
1799
- })) : React__default.createElement(FlipDiv, {
1800
- key: "loaded",
1801
- onEnter: loadingEnter,
1802
- onLeave: loadingLeave,
1803
- useAnimation: flipAnimation
1804
- }, content) : content), footer && React__default.createElement(DialogFooter, null, auxiliarActions && React__default.createElement(FooterAuxiliaryContainer, null, utils.callIfFunction(auxiliarActions)), utils.callIfFunction(footer)));
2111
+ }, skipWrap ? React__default.createElement(React__default.Fragment, null, alwaysVisible(confirmCloseDialog), content) : React__default.createElement(React__default.Fragment, null, React__default.createElement(DialogAlwaysVisibleDiv, null, alwaysVisible(confirmCloseDialog)), React__default.createElement(DialogContentWrapper, {
2112
+ isLoading: isLoading
2113
+ }, content)));
1805
2114
  };
1806
2115
 
1807
2116
  return container ? React__default.createElement(DialogContainer, _extends({}, props, {
1808
2117
  DialogErrorContent: DialogErrorContent,
1809
2118
  ref: ref,
1810
2119
  title: title
1811
- }), function (_ref3) {
1812
- var confirmCloseDialog = _ref3.confirmCloseDialog;
2120
+ }), function (_ref2) {
2121
+ var confirmCloseDialog = _ref2.confirmCloseDialog;
1813
2122
  return dialog(confirmCloseDialog);
1814
2123
  }) : dialog(props.closeDialog);
1815
2124
  })).withConfig({
1816
2125
  displayName: "Dialog",
1817
- componentId: "gai4ey-8"
1818
- })(["@supports (position:sticky){will-change:transform,opacity;}border-radius:12px;padding:2rem;background-color:white;width:100%;max-width:45rem;margin:auto;position:relative;align-self:baseline;display:block;> h3:first-child{margin-top:0.5rem;}p{line-height:140%;}", " ", " ", ""], utils.media.mobile(_templateObject6(), function (props) {
1819
- return props.fullscreenOnMobile && "\n border-radius: 0;\n ";
2126
+ componentId: "gai4ey-9"
2127
+ })(["@supports (position:sticky){will-change:transform,opacity;&.JS-wc-off{will-change:auto;}}border-radius:12px;padding:2rem;background-color:white;width:100%;max-width:45rem;margin:auto;position:relative;align-self:baseline;display:block;> h3:first-child{margin-top:0.5rem;}p{line-height:140%;}", " ", " ", ""], utils.media.mobile(_templateObject8(), function (props) {
2128
+ return props.fullscreenOnMobile && "\n border-radius: 0;\n min-height: 100%;\n ";
1820
2129
  }), function (props) {
1821
2130
  return props.closeDialog && styled.css(["", "{padding-right:2rem;}"], DialogTitle);
1822
2131
  }, utils.customTheme('Dialog'));
@@ -1826,8 +2135,8 @@ var ConfirmDialog = function ConfirmDialog(props) {
1826
2135
  }), props.children);
1827
2136
  };
1828
2137
  var DefaultConfirmDialog = function DefaultConfirmDialog(props) {
1829
- return React__default.createElement(core.StartlibsConsumer, null, function (_ref4) {
1830
- var confirmDialogLabels = _ref4.confirmDialogLabels;
2138
+ return React__default.createElement(core.StartlibsConsumer, null, function (_ref3) {
2139
+ var confirmDialogLabels = _ref3.confirmDialogLabels;
1831
2140
  return React__default.createElement(ConfirmDialog, {
1832
2141
  title: confirmDialogLabels.title,
1833
2142
  closeDialog: props.onCancel,
@@ -1846,14 +2155,14 @@ var DefaultConfirmDialog = function DefaultConfirmDialog(props) {
1846
2155
  }, React__default.createElement("p", null, confirmDialogLabels.content));
1847
2156
  });
1848
2157
  };
1849
- var DialogErrorContent = function DialogErrorContent(_ref5) {
1850
- var closeDialog = _ref5.closeDialog,
1851
- title = _ref5.title;
1852
- return React__default.createElement(core.StartlibsConsumer, null, function (_ref6) {
1853
- var _ref6$ErrorDialog = _ref6.ErrorDialog,
1854
- title = _ref6$ErrorDialog.title,
1855
- content = _ref6$ErrorDialog.content,
1856
- close = _ref6$ErrorDialog.close;
2158
+ var DialogErrorContent = function DialogErrorContent(_ref4) {
2159
+ var closeDialog = _ref4.closeDialog,
2160
+ title = _ref4.title;
2161
+ return React__default.createElement(core.StartlibsConsumer, null, function (_ref5) {
2162
+ var _ref5$ErrorDialog = _ref5.ErrorDialog,
2163
+ title = _ref5$ErrorDialog.title,
2164
+ content = _ref5$ErrorDialog.content,
2165
+ close = _ref5$ErrorDialog.close;
1857
2166
  return React__default.createElement(Dialog, {
1858
2167
  as: "div"
1859
2168
  }, closeDialog && React__default.createElement(CloseIcon, {
@@ -1865,13 +2174,13 @@ var DialogErrorContent = function DialogErrorContent(_ref5) {
1865
2174
  }, close)));
1866
2175
  });
1867
2176
  };
1868
- var DialogError = function DialogError(_ref7) {
1869
- var closeDialog = _ref7.closeDialog;
1870
- return React__default.createElement(core.StartlibsConsumer, null, function (_ref8) {
1871
- var _ref8$ErrorDialog = _ref8.ErrorDialog,
1872
- title = _ref8$ErrorDialog.title,
1873
- content = _ref8$ErrorDialog.content,
1874
- close = _ref8$ErrorDialog.close;
2177
+ var DialogError = function DialogError(_ref6) {
2178
+ var closeDialog = _ref6.closeDialog;
2179
+ return React__default.createElement(core.StartlibsConsumer, null, function (_ref7) {
2180
+ var _ref7$ErrorDialog = _ref7.ErrorDialog,
2181
+ title = _ref7$ErrorDialog.title,
2182
+ content = _ref7$ErrorDialog.content,
2183
+ close = _ref7$ErrorDialog.close;
1875
2184
  return React__default.createElement(Dialog, {
1876
2185
  closeDialog: closeDialog,
1877
2186
  title: title
@@ -1961,27 +2270,42 @@ var ARROW_KEY_POSITIONS = {
1961
2270
  top: '0',
1962
2271
  bottom: '-0'
1963
2272
  };
2273
+ var POSITIONING_BOUNDS = {
2274
+ left: 0,
2275
+ top: 0,
2276
+ right: 0,
2277
+ bottom: 0
2278
+ };
2279
+ var addPositioningBound = function addPositioningBound(key, value) {
2280
+ POSITIONING_BOUNDS[key] += value;
2281
+ return function () {
2282
+ return POSITIONING_BOUNDS[key] -= value;
2283
+ };
2284
+ };
1964
2285
 
1965
- function getPosition(origin, offset, max, originSize, selfSize, originalAlignment, selfAlignment, onCollision, mapping) {
2286
+ function getPosition(origin, offset, max, originSize, selfSize, originalAlignment, selfAlignment, onCollision, mapping, boundMargin) {
1966
2287
  // 0 pra left ou top, 1/2 pra center, 1 pra right ou bottom
1967
2288
  var originDiff = originSize * (mapping.indexOf(originalAlignment) / 2); // 0 pra left ou top, -1/2 pra center, -1 pra right ou bottom
1968
2289
 
1969
2290
  var selfDiff = -(selfSize * (mapping.indexOf(selfAlignment) / 2));
1970
- var newPosition = origin + selfDiff + originDiff + offset;
1971
- var collision = Math.max(-newPosition, newPosition + selfSize - max);
2291
+ var respectingBounds = boundMargin !== false;
2292
+ var upperBound = respectingBounds ? POSITIONING_BOUNDS[mapping[0]] + boundMargin : Number.MIN_SAFE_INTEGER;
2293
+ var lowerBound = respectingBounds ? POSITIONING_BOUNDS[mapping[2]] + boundMargin : 0;
2294
+ var newPosition = Math.max(upperBound, origin + selfDiff + originDiff + offset);
2295
+ var collision = Math.max(-newPosition, newPosition + selfSize - max + lowerBound);
1972
2296
 
1973
2297
  if (collision > 0 && onCollision !== 'none') {
1974
2298
  if (onCollision.indexOf('flip') >= 0) {
1975
- var flippedPosition = getPosition(origin, -offset, max, originSize, selfSize, originalAlignment, selfAlignment, onCollision.indexOf('fit') >= 0 ? 'fit' : 'none', mapping.slice().reverse());
2299
+ var flippedPosition = getPosition(origin, -offset, max, originSize, selfSize, originalAlignment, selfAlignment, onCollision.indexOf('fit') >= 0 ? 'fit' : 'none', mapping.slice().reverse(), boundMargin);
1976
2300
  var flippedCollision = Math.max(-flippedPosition[0], flippedPosition[0] + selfSize - max);
1977
2301
 
1978
- if (collision > 0 && flippedCollision > 0) {
1979
- return getPosition(origin, offset, max, originSize, selfSize, originalAlignment, selfAlignment, 'fit', mapping);
2302
+ if (collision > 0 && flippedCollision > 0 || flippedPosition[0] < upperBound) {
2303
+ return getPosition(origin, offset, max, originSize, selfSize, originalAlignment, selfAlignment, 'fit', mapping, boundMargin);
1980
2304
  }
1981
2305
 
1982
2306
  return collision < flippedCollision ? [newPosition, 'none'] : [flippedPosition[0], flippedPosition[1] === 'fit' ? 'flipfit' : 'flip'];
1983
2307
  } else {
1984
- return newPosition < 0 ? [0, 'fitted'] : [newPosition - collision, collision !== 0 ? 'fit' : 'none'];
2308
+ return newPosition < upperBound ? [upperBound, 'fitted'] : [Math.max(upperBound, newPosition - collision), collision !== 0 ? 'fit' : 'none'];
1985
2309
  }
1986
2310
  } else {
1987
2311
  return [newPosition, 'none'];
@@ -2025,7 +2349,10 @@ var usePositioning = function usePositioning(element, _ref, arrowRefOpt) {
2025
2349
  onRight = _ref.right,
2026
2350
  onTop = _ref.top,
2027
2351
  _ref$keepWidth = _ref.keepWidth,
2028
- keepWidth = _ref$keepWidth === void 0 ? true : _ref$keepWidth;
2352
+ keepWidth = _ref$keepWidth === void 0 ? true : _ref$keepWidth,
2353
+ _ref$boundMargin = _ref.boundMargin,
2354
+ boundMargin = _ref$boundMargin === void 0 ? 6 : _ref$boundMargin,
2355
+ respectBounds = _ref.respectBounds;
2029
2356
  var placeholder = React.useRef();
2030
2357
  var arrowRef = core.useEnsureRef(arrowRefOpt);
2031
2358
 
@@ -2069,9 +2396,9 @@ var usePositioning = function usePositioning(element, _ref, arrowRefOpt) {
2069
2396
 
2070
2397
  var left = leftPlusBorder - parseInt(borderLeftWidth, 10);
2071
2398
  var top = topPlusBorder - parseInt(borderTopWidth, 10);
2072
- var _ref2 = placeholder.current.offsetParent,
2073
- parentOffsetWidth = _ref2.offsetWidth,
2074
- parentOffsetHeight = _ref2.offsetHeight;
2399
+ var _placeholder$current$2 = placeholder.current.offsetParent,
2400
+ parentOffsetWidth = _placeholder$current$2.offsetWidth,
2401
+ parentOffsetHeight = _placeholder$current$2.offsetHeight;
2075
2402
  var _element$current = element.current,
2076
2403
  popupOffsetWidth = _element$current.offsetWidth,
2077
2404
  popupOffsetHeight = _element$current.offsetHeight;
@@ -2110,12 +2437,12 @@ var usePositioning = function usePositioning(element, _ref, arrowRefOpt) {
2110
2437
  verticalAt = _replace$split4[0],
2111
2438
  horizontalAt = _replace$split4[1];
2112
2439
 
2113
- var _getPosition = getPosition(left, offsetX, bodyWidth, parentOffsetWidth, fill ? parentOffsetWidth : popupOffsetWidth, horizontalAt, horizontalMy, horizontalCollision, HORIZONTAL_MAPPING),
2440
+ var _getPosition = getPosition(left, offsetX, bodyWidth, parentOffsetWidth, fill ? parentOffsetWidth : popupOffsetWidth, horizontalAt, horizontalMy, horizontalCollision, HORIZONTAL_MAPPING, !!respectBounds && boundMargin),
2114
2441
  _getPosition2 = _slicedToArray(_getPosition, 2),
2115
2442
  processedLeft = _getPosition2[0],
2116
2443
  collisionH = _getPosition2[1];
2117
2444
 
2118
- var _getPosition3 = getPosition(top, offsetY, windowHeight, parentOffsetHeight, popupOffsetHeight, verticalAt, verticalMy, verticalCollision, VERTICAL_MAPPING),
2445
+ var _getPosition3 = getPosition(top, offsetY, windowHeight, parentOffsetHeight, popupOffsetHeight, verticalAt, verticalMy, verticalCollision, VERTICAL_MAPPING, !!respectBounds && boundMargin),
2119
2446
  _getPosition4 = _slicedToArray(_getPosition3, 2),
2120
2447
  processedTop = _getPosition4[0],
2121
2448
  collisionV = _getPosition4[1];
@@ -2128,13 +2455,23 @@ var usePositioning = function usePositioning(element, _ref, arrowRefOpt) {
2128
2455
  var arrowOnVerticalSide = arrowSide === 'left' || arrowSide === 'right';
2129
2456
  var arrowSize = arrowElement ? arrowElement.getBoundingClientRect()[arrowOnVerticalSide ? 'height' : 'width'] : ARROW_DEFAULT_SIZE * Math.sqrt(2);
2130
2457
 
2131
- var _ref3 = arrowOnVerticalSide ? processArrow(ARROW_KEY_POSITIONS[arrow] || arrow, arrowSize, arrowOnVerticalSide, parentOffsetHeight, popupOffsetHeight, processedTop - top, flippedV) : processArrow(ARROW_KEY_POSITIONS[arrow] || arrow, arrowSize, arrowOnVerticalSide, parentOffsetWidth, popupOffsetWidth, processedLeft - left, flippedV),
2132
- _ref4 = _slicedToArray(_ref3, 2),
2133
- arrowOffset = _ref4[0],
2134
- popupArrowOffset = _ref4[1];
2458
+ var _ref2 = arrowOnVerticalSide ? processArrow(ARROW_KEY_POSITIONS[arrow] || arrow, arrowSize, arrowOnVerticalSide, parentOffsetHeight, popupOffsetHeight, processedTop - top, flippedV) : processArrow(ARROW_KEY_POSITIONS[arrow] || arrow, arrowSize, arrowOnVerticalSide, parentOffsetWidth, popupOffsetWidth, processedLeft - left, flippedV),
2459
+ _ref3 = _slicedToArray(_ref2, 2),
2460
+ arrowOffset = _ref3[0],
2461
+ popupArrowOffset = _ref3[1];
2462
+
2463
+ var maxHeight = window.innerHeight - (POSITIONING_BOUNDS.top + POSITIONING_BOUNDS.bottom) - (respectBounds ? boundMargin * 2 : 0);
2464
+ var maxWidth = window.innerWidth - (POSITIONING_BOUNDS.left + POSITIONING_BOUNDS.right) - (respectBounds ? boundMargin * 2 : 0);
2465
+ element.current.style.maxHeight = '';
2466
+
2467
+ if (parseInt(window.getComputedStyle(element.current).maxHeight) > maxHeight) {
2468
+ element.current.style.maxHeight = maxHeight + 'px';
2469
+ }
2135
2470
 
2136
2471
  if (keepWidth) {
2137
2472
  element.current.style.width = Math.ceil(popupCurrentWidth) + "px";
2473
+ } else {
2474
+ element.current.style.maxWidth = maxWidth + 'px';
2138
2475
  } // console.log({processedTop,top,offsetY,scrollY})
2139
2476
 
2140
2477
 
@@ -2155,6 +2492,8 @@ var usePositioning = function usePositioning(element, _ref, arrowRefOpt) {
2155
2492
  atBottom: verticalAt === 'bottom' && !flippedV || verticalAt === 'top' && flippedV,
2156
2493
  atLeft: horizontalAt === 'left' && !flippedH || verticalAt === 'right' && flippedH,
2157
2494
  atRight: horizontalAt === 'right' && !flippedH || verticalAt === 'left' && flippedH,
2495
+ fullHeight: popupOffsetHeight > maxHeight,
2496
+ fullWidth: popupOffsetWidth > maxWidth,
2158
2497
  arrowSide: arrowSide,
2159
2498
  arrowOffset: arrowOffset,
2160
2499
  arrowStyle: arrowStyle
@@ -2171,8 +2510,6 @@ var usePositioning = function usePositioning(element, _ref, arrowRefOpt) {
2171
2510
 
2172
2511
  React.useLayoutEffect(setPosition, []);
2173
2512
  React.useEffect(function () {
2174
- var debouncedSetPosition = _debounce(100, setPosition);
2175
-
2176
2513
  window.addEventListener('portalReposition', setPosition);
2177
2514
  window.addEventListener('stepResize', setPosition);
2178
2515
  window.addEventListener('scroll', setPosition);
@@ -2292,6 +2629,7 @@ function (_React$Component) {
2292
2629
  removeAnimation = _this$props.removeAnimation,
2293
2630
  onEndAnimation = _this$props.onEndAnimation,
2294
2631
  onStartAnimation = _this$props.onStartAnimation,
2632
+ effect = _this$props.effect,
2295
2633
  skipChromeFix = _this$props.skipChromeFix,
2296
2634
  timing = _this$props.timing;
2297
2635
  newSnap.children.forEach(function (newItemSnap) {
@@ -2328,8 +2666,12 @@ function (_React$Component) {
2328
2666
  var rectAnimation = getClientRectAnimation(oldSnap.parent, newSnap.parent, {
2329
2667
  skipTransform: true
2330
2668
  });
2669
+ var endEffect = callIfFunction(effect, newSnap.parent.domNode, {
2670
+ newSnap: newSnap,
2671
+ oldSnap: oldSnap
2672
+ });
2331
2673
  callIfFunction(onStartAnimation);
2332
- morph(newSnap.parent.domNode, formatAnimation(rectAnimation, timing), onEndAnimation);
2674
+ morph(newSnap.parent.domNode, formatAnimation(rectAnimation, timing), endEffect || onEndAnimation);
2333
2675
  };
2334
2676
 
2335
2677
  _this.reinsertSnap = function (item, scrollDelta, allChildren) {
@@ -2344,7 +2686,7 @@ function (_React$Component) {
2344
2686
  if (next) {
2345
2687
  return _this.reinsertSnap(_objectSpread({}, item, {
2346
2688
  nextSibling: next.nextSibling
2347
- }));
2689
+ }), scrollDelta, allChildren);
2348
2690
  }
2349
2691
 
2350
2692
  return false;
@@ -2420,6 +2762,7 @@ function (_React$Component) {
2420
2762
  var newSnap = this.calculatePositionForAnimation();
2421
2763
 
2422
2764
  if (newSnap) {
2765
+ // se não tiver parentNode, verficar se há uma div sendo offsetParent, body não serve
2423
2766
  this.play(snap, newSnap);
2424
2767
  }
2425
2768
  }
@@ -2474,7 +2817,9 @@ var _React$createContext = React__default.createContext({}),
2474
2817
  var DropPosition = styled__default.div.withConfig({
2475
2818
  displayName: "Draggable__DropPosition",
2476
2819
  componentId: "sc-1g7nmwq-0"
2477
- })(["border:2px dashed rgba(0,0,0,0.1);background-color:rgba(0,0,0,0.025);border-radius:8px;position:absolute;top:0;bottom:0;right:0;left:0;visibility:visible;display:block;"]);
2820
+ })(["border:2px dashed rgba(0,0,0,0.1);background-color:rgba(0,0,0,0.025);border-radius:8px;position:absolute;top:0;bottom:0;right:0;left:0;visibility:visible;display:block;", ""], function (props) {
2821
+ return props.rounded && "\n border-radius: 1000rem;\n ";
2822
+ });
2478
2823
  var EmptyPlaceholder = styled__default.div.withConfig({
2479
2824
  displayName: "Draggable__EmptyPlaceholder",
2480
2825
  componentId: "sc-1g7nmwq-1"
@@ -2499,6 +2844,24 @@ function easeInCubic(t) {
2499
2844
  return Math.ceil(t * t * t / (AUTO_SCROLL_MAX_VELOCITY * AUTO_SCROLL_MAX_VELOCITY));
2500
2845
  }
2501
2846
 
2847
+ var disableWillChange = function disableWillChange(el) {
2848
+ var willChange = el === null || el === void 0 ? void 0 : el.closest(".JS-has-wc");
2849
+
2850
+ if (willChange) {
2851
+ willChange.classList.add('JS-wc-off');
2852
+ disableWillChange(willChange.parentNode);
2853
+ }
2854
+ };
2855
+
2856
+ var reenableWillChange = function reenableWillChange(el) {
2857
+ var willChange = el === null || el === void 0 ? void 0 : el.closest(".JS-has-wc");
2858
+
2859
+ if (willChange) {
2860
+ willChange.classList.remove('JS-wc-off');
2861
+ reenableWillChange(willChange.parentNode);
2862
+ }
2863
+ };
2864
+
2502
2865
  var shouldPreventDrag = function shouldPreventDrag(e) {
2503
2866
  return !e.target.closest('body,.drag-drop-item,[data-drag="false"],input,textarea,button').matches('body,.drag-drop-item,[data-drag="true"]');
2504
2867
  };
@@ -2536,19 +2899,24 @@ function (_React$Component) {
2536
2899
  isDragging = _this$props.isDragging,
2537
2900
  droppable = _this$props.droppable,
2538
2901
  dragIndex = _this$props.dragIndex,
2902
+ roundedPlaceholder = _this$props.roundedPlaceholder,
2539
2903
  children = _this$props.children,
2540
- props = _objectWithoutProperties(_this$props, ["DragTag", "as", "eventHandlers", "className", "isDragging", "droppable", "dragIndex", "children"]);
2904
+ props = _objectWithoutProperties(_this$props, ["DragTag", "as", "eventHandlers", "className", "isDragging", "droppable", "dragIndex", "roundedPlaceholder", "children"]);
2541
2905
 
2542
2906
  var Wrapper = DragTag || as;
2543
2907
  var extraClassName = (isDragging ? ' drag-drop-placeholder' : '') + ' drag-drop-item';
2544
2908
  return typeof children === 'function' ? children(_objectSpread({
2545
2909
  className: extraClassName
2546
2910
  }, this.events, {
2547
- children: isDragging && React__default.createElement(DropPosition, null)
2911
+ children: isDragging && React__default.createElement(DropPosition, {
2912
+ rounded: roundedPlaceholder
2913
+ })
2548
2914
  })) : React__default.createElement(Wrapper, _extends({
2549
2915
  className: className + extraClassName,
2550
2916
  isDragging: isDragging
2551
- }, props, this.events), children, isDragging && React__default.createElement(DropPosition, null));
2917
+ }, props, this.events), children, isDragging && React__default.createElement(DropPosition, {
2918
+ rounded: roundedPlaceholder
2919
+ }));
2552
2920
  }
2553
2921
  }]);
2554
2922
 
@@ -2642,6 +3010,11 @@ function (_React$Component2) {
2642
3010
  }
2643
3011
 
2644
3012
  var parent = ReactDOM.findDOMNode(_assertThisInitialized(_assertThisInitialized(_this2))).offsetParent;
3013
+
3014
+ if (!parent) {
3015
+ return [];
3016
+ }
3017
+
2645
3018
  var parentRect = parent.getBoundingClientRect();
2646
3019
 
2647
3020
  var toPosition = _this2.toPosition(parentRect, scrollXY);
@@ -2826,7 +3199,14 @@ function (_React$Component3) {
2826
3199
  };
2827
3200
 
2828
3201
  _this3.dragStart = function (draggable) {
2829
- return function (currentTarget, pageX, pageY, clientX, clientY, e) {
3202
+ return function (e, _ref4) {
3203
+ var pageX = _ref4.pageX,
3204
+ pageY = _ref4.pageY,
3205
+ clientX = _ref4.clientX,
3206
+ clientY = _ref4.clientY;
3207
+ _this3.dragHasEnded = false;
3208
+ var currentTarget = e.currentTarget;
3209
+
2830
3210
  if (shouldPreventDrag(e) || _this3.props.disabled) {
2831
3211
  return;
2832
3212
  }
@@ -2847,7 +3227,12 @@ function (_React$Component3) {
2847
3227
  if (window.navigator.vibrate) window.navigator.vibrate([65]);
2848
3228
 
2849
3229
  if (!_this3.state.dragInfo.active) {
2850
- _this3.dragMove(currentTarget, pageX, pageY, clientX, clientY, e);
3230
+ _this3.dragMove(e, {
3231
+ pageX: pageX,
3232
+ pageY: pageY,
3233
+ clientX: clientX,
3234
+ clientY: clientY
3235
+ });
2851
3236
  }
2852
3237
  }, holdTouchTimer);
2853
3238
  }
@@ -2926,6 +3311,7 @@ function (_React$Component3) {
2926
3311
 
2927
3312
  _this3.ghost = el;
2928
3313
  parent.appendChild(_this3.ghost);
3314
+ disableWillChange(_this3.ghost);
2929
3315
 
2930
3316
  _this3.setState({
2931
3317
  dragInfo: {
@@ -3034,15 +3420,20 @@ function (_React$Component3) {
3034
3420
  area: intersectionArea / area,
3035
3421
  distance: distance
3036
3422
  };
3037
- }).reduce(function (iMax, _ref4, i, arr) {
3038
- var area = _ref4.area,
3039
- distance = _ref4.distance;
3423
+ }).reduce(function (iMax, _ref5, i, arr) {
3424
+ var area = _ref5.area,
3425
+ distance = _ref5.distance;
3040
3426
  return area > arr[iMax].area || area === arr[iMax].area && distance < arr[iMax].distance ? i : iMax;
3041
3427
  }, 0);
3042
3428
  return centerInsideGhost[closestIndex];
3043
3429
  };
3044
3430
 
3045
3431
  _this3.stopMoving = function () {
3432
+ if (_this3.dragHasEnded) {
3433
+ return;
3434
+ }
3435
+
3436
+ _this3.dragHasEnded = true;
3046
3437
  var dragInfo = _this3.state.dragInfo;
3047
3438
  var activeIndex = dragInfo.activeIndex,
3048
3439
  startIndex = dragInfo.startIndex,
@@ -3050,6 +3441,11 @@ function (_React$Component3) {
3050
3441
  activeDroppable = dragInfo.activeDroppable,
3051
3442
  startDroppable = dragInfo.startDroppable;
3052
3443
 
3444
+ if (_this3.endTimeout) {
3445
+ clearTimeout(_this3.endTimeout);
3446
+ _this3.endTimeout = null;
3447
+ }
3448
+
3053
3449
  _this3.setState({
3054
3450
  saving: {
3055
3451
  list: _this3.props.list,
@@ -3057,13 +3453,17 @@ function (_React$Component3) {
3057
3453
  dragInfo: _set('active', false, dragInfo)
3058
3454
  }
3059
3455
  }, function () {
3456
+ var _this3$ghost;
3457
+
3060
3458
  _this3.preventScroll = false;
3061
3459
 
3062
3460
  _this3.props.setDragRef(null);
3063
3461
 
3064
3462
  _this3.settedDragRef = false;
3065
3463
 
3066
- if (_this3.ghost.parentNode) {
3464
+ if ((_this3$ghost = _this3.ghost) === null || _this3$ghost === void 0 ? void 0 : _this3$ghost.parentNode) {
3465
+ reenableWillChange(_this3.ghost);
3466
+
3067
3467
  _this3.ghost.parentNode.removeChild(_this3.ghost);
3068
3468
  }
3069
3469
 
@@ -3088,7 +3488,11 @@ function (_React$Component3) {
3088
3488
  });
3089
3489
  };
3090
3490
 
3091
- _this3.dragMove = function (currentTarget, pageX, pageY, clientX, clientY, e) {
3491
+ _this3.dragMove = function (e, _ref6) {
3492
+ var pageX = _ref6.pageX,
3493
+ pageY = _ref6.pageY,
3494
+ clientX = _ref6.clientX,
3495
+ clientY = _ref6.clientY;
3092
3496
  var distance = Math.sqrt(Math.pow(_this3.positions.originalX - pageX, 2) + Math.pow(_this3.positions.originalY - pageY, 2));
3093
3497
 
3094
3498
  if (e.type === 'mousemove') {
@@ -3294,6 +3698,8 @@ function (_React$Component3) {
3294
3698
  _this3.ghost.style.transform = newTransform;
3295
3699
 
3296
3700
  _this3.ghost.addEventListener('transitionend', _this3.stopMoving);
3701
+
3702
+ _this3.endTimeout = setTimeout(_this3.stopMoving, 300);
3297
3703
  }
3298
3704
  } else {
3299
3705
  _this3.stopMoving();
@@ -3311,10 +3717,10 @@ function (_React$Component3) {
3311
3717
  };
3312
3718
 
3313
3719
  _this3.mouseDown = function (draggable) {
3314
- return utils.normalizeMouse(_this3.dragStart(draggable));
3720
+ return utils.normalizeMouse(_this3.dragStart(draggable), _this3.dragEnd);
3315
3721
  };
3316
3722
 
3317
- _this3.mouseMove = utils.normalizeMouse(_this3.dragMove);
3723
+ _this3.mouseMove = utils.normalizeMouse(_this3.dragMove, _this3.dragEnd);
3318
3724
 
3319
3725
  _this3.touchStart = function (draggable) {
3320
3726
  return utils.normalizeTouch(_this3.dragStart(draggable), _this3.dragEnd);
@@ -3555,9 +3961,19 @@ var Tooltip = function Tooltip(_ref) {
3555
3961
  }, rest), content), children);
3556
3962
  };
3557
3963
 
3558
- function _templateObject3$2() {
3964
+ function _templateObject4$1() {
3559
3965
  var data = _taggedTemplateLiteral(["\n font-size: 13px;\n position: absolute;\n right: 0;\n top: 50%;\n transform: translateY(-50%);\n width: 3rem;\n text-align: center;\n"]);
3560
3966
 
3967
+ _templateObject4$1 = function _templateObject4() {
3968
+ return data;
3969
+ };
3970
+
3971
+ return data;
3972
+ }
3973
+
3974
+ function _templateObject3$2() {
3975
+ var data = _taggedTemplateLiteral(["\n font-size: 12px;\n "]);
3976
+
3561
3977
  _templateObject3$2 = function _templateObject3() {
3562
3978
  return data;
3563
3979
  };
@@ -3576,7 +3992,7 @@ function _templateObject2$4() {
3576
3992
  }
3577
3993
 
3578
3994
  function _templateObject$6() {
3579
- var data = _taggedTemplateLiteral(["\n font-size: 13px;\n & > * {\n padding: 14px 3.25rem;\n }\n "]);
3995
+ var data = _taggedTemplateLiteral(["\n font-size: 14px;\n & > * {\n padding-top: 15px;\n padding-bottom: 15px;\n }\n ", ", .icon {\n font-size: 25px;\n }\n "]);
3580
3996
 
3581
3997
  _templateObject$6 = function _templateObject() {
3582
3998
  return data;
@@ -3593,24 +4009,34 @@ var popupAnimation = utils.animationTiming('0.2s ease-out');
3593
4009
  var ListItem = styled__default.li.withConfig({
3594
4010
  displayName: "ContextMenu__ListItem",
3595
4011
  componentId: "sc-13y1vvt-0"
3596
- })(["position:relative;& > *{padding:11px 3.25rem;display:block;}", " & > a{color:inherit;font-weight:inherit;text-decoration:inherit;}& > a,& > label{cursor:pointer;}", " ", " ", ",.icon{font-size:23px;position:absolute;left:0.25rem;top:50%;transform:translateY(-50%);width:3rem;text-align:center;}input[type=\"radio\"]{display:none;}", " ", " ", " ", ""], utils.media.mobile(_templateObject$6()), utils.ifProp('hover', styled.css(["& > a,& > label{background:", ";color:", ";color:", ";}"], function (props) {
4012
+ })(["position:relative;font-size:12px;& > *{padding:11px 1.5rem 11px 3.5rem;display:block;}", ",.icon{font-size:23px;position:absolute;padding-left:0.25rem;left:0;top:50%;transform:translateY(-50%);width:3.5rem;text-align:center;}", " & > a{color:inherit;font-weight:inherit;text-decoration:inherit;}& > a,& > label{cursor:pointer;}", " ", " input[type=\"radio\"]{display:none;}", " ", " ", " ", ""], Icon, utils.media.mobile(_templateObject$6(), Icon), utils.ifProp('hover', styled.css(["& > a,& > label{background:", ";color:", ";color:", ";}"], function (props) {
3597
4013
  return polished.lighten(0.53, utils.getColor("main")(props));
3598
4014
  }, utils.getColor('main'), function (props) {
3599
4015
  return polished.darken(0.03, utils.getColor("main")(props));
3600
- })), utils.ifProp('highlight', styled.css(["color:", ";"], utils.getColor('main'))), Icon, utils.ifProp('noActions', "\n max-width: 17rem;\n color: rgba(0,0,0,0.4);\n pointer-events: none;\n text-align: center;\n white-space: normal;\n "), utils.ifProp('withButton', styled.css(["padding:0.25rem 1rem;", "{width:100%;color:white;font-weight:500;padding:10px 1.25rem;", "}"], Button, utils.media.mobile(_templateObject2$4()))), utils.ifProp('smallPaddingRight', styled.css(["& > *{padding-right:1.5rem;}"])), utils.customTheme('ListItem'));
4016
+ })), utils.ifProp('highlight', styled.css(["color:", ";"], utils.getColor('main'))), utils.ifProp('noActions', "\n max-width: 17rem;\n color: rgba(0,0,0,0.4);\n pointer-events: none;\n text-align: center;\n white-space: normal;\n "), utils.ifProp('withButton', styled.css(["padding:0.25rem 1rem;", "{width:100%;color:white;font-weight:500;padding:10px 1.25rem;", "}"], Button, utils.media.mobile(_templateObject2$4()))), utils.ifProp('smallPaddingRight', styled.css(["& > *{padding-right:1.5rem;}"])), utils.customTheme('ListItem'));
4017
+ var ListItemDescText = styled__default.div.withConfig({
4018
+ displayName: "ContextMenu__ListItemDescText",
4019
+ componentId: "sc-13y1vvt-1"
4020
+ })(["font-size:11px;margin-top:0.25rem;opacity:0.6;", ""], utils.media.mobile(_templateObject3$2()));
4021
+ var ListItemHelpText = styled__default.span.withConfig({
4022
+ displayName: "ContextMenu__ListItemHelpText",
4023
+ componentId: "sc-13y1vvt-2"
4024
+ })(["opacity:0.5;"]);
3601
4025
  var ListMenu = styled__default.ul.withConfig({
3602
4026
  displayName: "ContextMenu__ListMenu",
3603
- componentId: "sc-13y1vvt-1"
4027
+ componentId: "sc-13y1vvt-3"
3604
4028
  })(["padding:0.5rem 0;cursor:default;overflowY:auto;text-align:left;color:inherit;user-select:none;"]);
3605
4029
  var ContextListMenu = styled__default(ListMenu).withConfig({
3606
4030
  displayName: "ContextMenu__ContextListMenu",
3607
- componentId: "sc-13y1vvt-2"
3608
- })(["position:absolute;z-index:999;background-color:white;box-shadow:0 2px 2px 0 rgba(0,0,0,0.14),0 3px 10px -2px rgba(0,0,0,0.15),0 0px 2px 0px rgba(0,0,0,0.2);border-radius:8px;margin-bottom:0.5rem;overflow:auto;max-height:100vh;", " ", " ", ""], function (props) {
3609
- return props.withoutIcons && "\n ".concat(ListItem, " > * {\n padding-left: 1.5rem;\n padding-right: 1.5rem;\n }\n ");
3610
- }, utils.ifProp('sub', styled.css(["", " ", ""], utils.ifProp('atTop', 'margin-top: -0.5rem;', 'margin-top: 0.5rem;'), utils.ifProp('atRight', "\n margin-left: -2px;\n ", "\n margin-left: 2px;\n "))), utils.customTheme('ContextMenu'));
4031
+ componentId: "sc-13y1vvt-4"
4032
+ })(["position:absolute;z-index:999;background-color:white;box-shadow:0 2px 2px 0 rgba(0,0,0,0.14),0 3px 10px -2px rgba(0,0,0,0.15),0 0px 2px 0px rgba(0,0,0,0.2);border-radius:10px;margin-bottom:0.5rem;overflow:auto;max-height:100vh;", " ", " ", ""], function (props) {
4033
+ return props.withoutIcons && "\n ".concat(ListItem, " > * {\n padding-left: 1.5rem;\n }\n ");
4034
+ }, utils.ifProp('sub', styled.css(["", " ", ""], function (props) {
4035
+ return props.fullHeight ? '' : props.atTop ? 'margin-top: -0.5rem;' : 'margin-top: 0.5rem;';
4036
+ }, utils.ifProp('atRight', "\n margin-left: -4px;\n ", "\n margin-left: 4px;\n "))), utils.customTheme('ContextMenu'));
3611
4037
  var StickyContainer = styled__default.div.withConfig({
3612
4038
  displayName: "ContextMenu__StickyContainer",
3613
- componentId: "sc-13y1vvt-3"
4039
+ componentId: "sc-13y1vvt-5"
3614
4040
  })(["position:sticky;background:white;", " ", ""], function (props) {
3615
4041
  return props.atBottom && "\n bottom: -0.5rem;\n padding-bottom: 0.5rem;\n margin-bottom: -0.5rem;\n ";
3616
4042
  }, function (props) {
@@ -3618,13 +4044,13 @@ var StickyContainer = styled__default.div.withConfig({
3618
4044
  });
3619
4045
  var ListSeparator = styled__default.li.withConfig({
3620
4046
  displayName: "ContextMenu__ListSeparator",
3621
- componentId: "sc-13y1vvt-4"
4047
+ componentId: "sc-13y1vvt-6"
3622
4048
  })(["border-bottom:1px solid rgba(0,0,0,0.1);margin-top:0.5rem;margin-bottom:0.5rem;cursor:default;height:0;", ""], utils.ifProp('lighten', styled.css(["border-color:rgba(255,255,255,0.15);"])));
3623
4049
  var ListHeading = styled__default.li.withConfig({
3624
4050
  displayName: "ContextMenu__ListHeading",
3625
- componentId: "sc-13y1vvt-5"
4051
+ componentId: "sc-13y1vvt-7"
3626
4052
  })(["display:flex;align-items:center;padding:.5rem 1.25rem .25rem;span{flex-shrink:0;margin-right:.5rem;color:", ";font-size:10px;text-transform:uppercase;font-weight:600;}:after{content:'';flex-grow:1;height:1px;background:", ";}"], utils.getColor('gray180'), utils.getColor('gray240'));
3627
- var SubmenuArrowIcon = utils.styledExtend(Icon)(_templateObject3$2());
4053
+ var SubmenuArrowIcon = utils.styledExtend(Icon)(_templateObject4$1());
3628
4054
  var SimpleLi =
3629
4055
  /*#__PURE__*/
3630
4056
  function (_React$Component) {
@@ -3746,6 +4172,7 @@ var Li = function Li(_ref) {
3746
4172
  var _ref$emitter = _ref.emitter,
3747
4173
  emitter = _ref$emitter === void 0 ? mitt() : _ref$emitter,
3748
4174
  index = _ref.index,
4175
+ keepOpen = _ref.keepOpen,
3749
4176
  hover = _ref.hover,
3750
4177
  layerIndex = _ref.layerIndex,
3751
4178
  hoverCursor = _ref.hoverCursor,
@@ -3757,9 +4184,11 @@ var Li = function Li(_ref) {
3757
4184
  linkTo = _ref.linkTo,
3758
4185
  icon = _ref.icon,
3759
4186
  label = _ref.label,
4187
+ descText = _ref.descText,
4188
+ helpText = _ref.helpText,
3760
4189
  target = _ref.target,
3761
4190
  href = _ref.href,
3762
- rest = _objectWithoutProperties(_ref, ["emitter", "index", "hover", "layerIndex", "hoverCursor", "passTouchThrough", "children", "setCursorOnHover", "onClick", "prefixWith", "linkTo", "icon", "label", "target", "href"]);
4191
+ rest = _objectWithoutProperties(_ref, ["emitter", "index", "keepOpen", "hover", "layerIndex", "hoverCursor", "passTouchThrough", "children", "setCursorOnHover", "onClick", "prefixWith", "linkTo", "icon", "label", "descText", "helpText", "target", "href"]);
3763
4192
 
3764
4193
  var nodeRef = React.useRef();
3765
4194
  var tagRef = React.useRef();
@@ -3816,7 +4245,7 @@ var Li = function Li(_ref) {
3816
4245
  };
3817
4246
  }, []);
3818
4247
  React.useEffect(function () {
3819
- if (children) {
4248
+ if (children && !isMobile()) {
3820
4249
  if (hover) {
3821
4250
  if (!subMenu.isOpen || subMenu.closing || !subPrevented.get()) {
3822
4251
  subMenu.open();
@@ -3830,38 +4259,35 @@ var Li = function Li(_ref) {
3830
4259
  }
3831
4260
  }, [hoverCursor]);
3832
4261
 
3833
- var onMouseEnter = function onMouseEnter() {
3834
- return utils.callIfFunction(setCursorOnHover, index);
4262
+ var onMouseMove = function onMouseMove(e) {
4263
+ if (!hover) {
4264
+ utils.callIfFunction(setCursorOnHover, index);
4265
+ }
4266
+
4267
+ e === null || e === void 0 ? void 0 : e.stopPropagation();
3835
4268
  };
3836
4269
 
3837
4270
  var onMouseOut = function onMouseOut(e) {
3838
- return utils.callIfFunction(setCursorOnHover, -1);
4271
+ utils.callIfFunction(setCursorOnHover, -1);
4272
+ e === null || e === void 0 ? void 0 : e.stopPropagation();
3839
4273
  };
3840
4274
 
3841
- var touchEnd = function touchEnd(e) {
3842
- if (!passTouchThrough) {
3843
- e.preventDefault();
4275
+ var onClickHandler = function onClickHandler(e) {
4276
+ if (children || keepOpen) {
4277
+ e.stopPropagation();
3844
4278
  }
3845
4279
 
3846
4280
  if (children) {
3847
- if (hover) subMenu.toggle();else onMouseEnter();
3848
- } else {
3849
- if (tagRef.current) {
3850
- tagRef.current.click();
4281
+ if (hover) {
4282
+ subMenu.toggle();
3851
4283
  } else {
3852
- nodeRef.current.click();
4284
+ onMouseMove();
3853
4285
  }
4286
+ } else {
4287
+ utils.callIfFunction(onClick, e);
3854
4288
  }
3855
4289
  };
3856
4290
 
3857
- var onClickHandler = function onClickHandler(e) {
3858
- if (children) {
3859
- e.stopPropagation();
3860
- }
3861
-
3862
- utils.callIfFunction(onClick, e);
3863
- };
3864
-
3865
4291
  var onCloseSub = function onCloseSub() {
3866
4292
  return emitter.emit('openSub');
3867
4293
  };
@@ -3879,7 +4305,7 @@ var Li = function Li(_ref) {
3879
4305
 
3880
4306
  var content = React__default.createElement(React__default.Fragment, null, prefixWith, icon && React__default.createElement(Icon, {
3881
4307
  icon: icon
3882
- }), label, children && React__default.createElement(SubmenuArrowIcon, {
4308
+ }), label, " ", helpText && React__default.createElement(ListItemHelpText, null, "(", helpText, ")"), descText && React__default.createElement(ListItemDescText, null, descText), children && React__default.createElement(SubmenuArrowIcon, {
3883
4309
  icon: "arrow-right"
3884
4310
  }));
3885
4311
  var Tag = linkTo ? Link : 'a';
@@ -3889,14 +4315,13 @@ var Li = function Li(_ref) {
3889
4315
  hover: hover,
3890
4316
  onClick: onClickHandler,
3891
4317
  onMouseLeave: onMouseOut,
3892
- onMouseEnter: onMouseEnter,
3893
- onTouchEnd: touchEnd
4318
+ onMouseMove: onMouseMove
3894
4319
  }), rest.withButton || rest.noActions ? content : React__default.createElement(Tag, {
3895
4320
  href: href,
3896
4321
  target: target,
3897
4322
  to: linkTo,
3898
4323
  ref: tagRef,
3899
- onMouseEnter: onMouseEnter
4324
+ onMouseEnter: onMouseMove
3900
4325
  }, content), subMenu.isOpen && addProps(children));
3901
4326
  };
3902
4327
  Li.Simple = SimpleLi;
@@ -3912,7 +4337,7 @@ var _willUseSharedState$1 = core.willUseSharedState(),
3912
4337
  _willUseSharedState2$1 = _slicedToArray(_willUseSharedState$1, 1),
3913
4338
  useContextMenuSharedState = _willUseSharedState2$1[0];
3914
4339
 
3915
- var ContextMenuComponent = React.forwardRef(function (_ref2, ref) {
4340
+ var ContextMenuComponent = React.forwardRef(function (_ref2, unesuredRef) {
3916
4341
  var children = _ref2.children,
3917
4342
  sub = _ref2.sub,
3918
4343
  hoverIndex = _ref2.hoverIndex,
@@ -3924,7 +4349,10 @@ var ContextMenuComponent = React.forwardRef(function (_ref2, ref) {
3924
4349
  return 0;
3925
4350
  } : _ref2$onHover,
3926
4351
  fill = _ref2.fill,
3927
- props = _objectWithoutProperties(_ref2, ["children", "sub", "hoverIndex", "autoHover", "withoutIcons", "onClose", "onHover", "fill"]);
4352
+ onClick = _ref2.onClick,
4353
+ props = _objectWithoutProperties(_ref2, ["children", "sub", "hoverIndex", "autoHover", "withoutIcons", "onClose", "onHover", "fill", "onClick"]);
4354
+
4355
+ var ref = core.useEnsureRef(unesuredRef);
3928
4356
 
3929
4357
  var _useState = React.useState(autoHover || sub ? 0 : -1),
3930
4358
  _useState2 = _slicedToArray(_useState, 2),
@@ -4024,10 +4452,34 @@ var ContextMenuComponent = React.forwardRef(function (_ref2, ref) {
4024
4452
  });
4025
4453
  };
4026
4454
 
4455
+ var touchStart = createPressAndMoveEvent(function (e, prevPos) {
4456
+ // e.preventDefault()
4457
+ e.stopPropagation();
4458
+ e.target.dispatchEvent(new MouseEvent('mousemove', {
4459
+ bubbles: true
4460
+ }));
4461
+ var passedResistance = false;
4462
+ return [function (e, nextPos) {
4463
+ var delta = prevPos.clientY - nextPos.clientY;
4464
+
4465
+ if (Math.abs(delta) > 10) {
4466
+ passedResistance = true;
4467
+ setCursorOnHover(-1);
4468
+ }
4469
+ }, function (e, finalPos) {
4470
+ if (!passedResistance) {
4471
+ e.target.click();
4472
+ }
4473
+ }];
4474
+ });
4027
4475
  return React__default.createElement(ContextListMenu, _extends({
4028
4476
  "data-drag": false,
4029
4477
  ref: ref,
4030
4478
  sub: sub,
4479
+ onWheel: function onWheel(e) {
4480
+ return e.stopPropagation();
4481
+ },
4482
+ onTouchStart: touchStart,
4031
4483
  withoutIcons: withoutIcons,
4032
4484
  onMouseDown: utils.stopPropagation()
4033
4485
  }, props), formatChildren(children));
@@ -4405,19 +4857,38 @@ var TransitionDiv = function TransitionDiv(_ref) {
4405
4857
  var children = _ref.children,
4406
4858
  animation = _ref.animation,
4407
4859
  skipChromeFix = _ref.skipChromeFix,
4860
+ className = _ref.className,
4408
4861
  block = _ref.block,
4409
- rest = _objectWithoutProperties(_ref, ["children", "animation", "skipChromeFix", "block"]);
4862
+ rest = _objectWithoutProperties(_ref, ["children", "animation", "skipChromeFix", "className", "block"]);
4863
+
4864
+ var blockRef = React.useRef();
4865
+
4866
+ var overflowEffect = function overflowEffect() {
4867
+ if (blockRef.current) {
4868
+ var prevOverflow = blockRef.current.style.overflow;
4869
+ blockRef.current.style.overflow = 'hidden';
4870
+ return function () {
4871
+ blockRef.current.style.overflow = prevOverflow;
4872
+ };
4873
+ }
4874
+ };
4410
4875
 
4411
4876
  var content = children ? React__default.createElement(FlipList, _extends({
4877
+ effect: overflowEffect,
4412
4878
  skipChromeFix: skipChromeFix,
4413
4879
  animation: animation || DEFAULT_ANIMATION
4414
4880
  }, rest), [React__default.createElement("div", {
4881
+ className: block ? "" : className,
4415
4882
  key: "first"
4416
4883
  }, children)]) : React__default.createElement(FlipList, _extends({
4884
+ effect: overflowEffect,
4417
4885
  skipChromeFix: skipChromeFix,
4418
4886
  animation: animation || DEFAULT_ANIMATION
4419
4887
  }, rest), []);
4420
- return block ? React__default.createElement(BlockContainer$1, null, content) : content;
4888
+ return block ? React__default.createElement(BlockContainer$1, {
4889
+ ref: blockRef,
4890
+ className: className
4891
+ }, content) : content;
4421
4892
  };
4422
4893
 
4423
4894
  var BlockContainer$2 = styled__default.div.withConfig({
@@ -4513,44 +4984,66 @@ var willUseIsSticky = function willUseIsSticky() {
4513
4984
  useSharedIsSticky = _willUseSharedState2[0],
4514
4985
  setSharedIsSticky = _willUseSharedState2[2];
4515
4986
 
4516
- var observer = window.IntersectionObserver ? new window.IntersectionObserver(function (records, observer) {
4517
- var _iteratorNormalCompletion = true;
4518
- var _didIteratorError = false;
4519
- var _iteratorError = undefined;
4987
+ var createObserver = function createObserver(root) {
4988
+ return window.IntersectionObserver ? new window.IntersectionObserver(function (records, observer) {
4989
+ var _iteratorNormalCompletion = true;
4990
+ var _didIteratorError = false;
4991
+ var _iteratorError = undefined;
4520
4992
 
4521
- try {
4522
- for (var _iterator = records[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
4523
- var record = _step.value;
4524
- var targetInfo = record.boundingClientRect;
4525
- var rootBoundsInfo = record.rootBounds;
4993
+ try {
4994
+ for (var _iterator = records[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
4995
+ var record = _step.value;
4996
+ var targetInfo = record.boundingClientRect;
4997
+ var rootBoundsInfo = record.rootBounds;
4526
4998
 
4527
- if (!rootBoundsInfo) {
4528
- return;
4529
- }
4999
+ if (!rootBoundsInfo) {
5000
+ return;
5001
+ }
4530
5002
 
4531
- onChange(targetInfo, rootBoundsInfo, record.target);
4532
- }
4533
- } catch (err) {
4534
- _didIteratorError = true;
4535
- _iteratorError = err;
4536
- } finally {
4537
- try {
4538
- if (!_iteratorNormalCompletion && _iterator.return != null) {
4539
- _iterator.return();
5003
+ onChange(targetInfo, rootBoundsInfo, record.target, record.isIntersecting);
4540
5004
  }
5005
+ } catch (err) {
5006
+ _didIteratorError = true;
5007
+ _iteratorError = err;
4541
5008
  } finally {
4542
- if (_didIteratorError) {
4543
- throw _iteratorError;
5009
+ try {
5010
+ if (!_iteratorNormalCompletion && _iterator.return != null) {
5011
+ _iterator.return();
5012
+ }
5013
+ } finally {
5014
+ if (_didIteratorError) {
5015
+ throw _iteratorError;
5016
+ }
4544
5017
  }
4545
5018
  }
5019
+ }, {
5020
+ root: root
5021
+ }) : {
5022
+ observe: _identity,
5023
+ unobserve: _identity
5024
+ };
5025
+ };
5026
+
5027
+ var observerMap = new Map();
5028
+
5029
+ var getObserver = function getObserver() {
5030
+ var root = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;
5031
+ var result = observerMap.get(root);
5032
+
5033
+ if (result) {
5034
+ return result;
4546
5035
  }
4547
- }) : {
4548
- observe: _identity,
4549
- unobserve: _identity
5036
+
5037
+ var observer = createObserver(root);
5038
+ observerMap.set(root, observer);
5039
+ return observer;
4550
5040
  };
5041
+
4551
5042
  var activeObserved = [];
4552
5043
 
4553
5044
  var resetObservers = function resetObservers() {
5045
+ var root = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;
5046
+ var observer = getObserver(root);
4554
5047
  activeObserved.forEach(function (observed) {
4555
5048
  observer.unobserve(observed);
4556
5049
  observer.observe(observed);
@@ -4560,7 +5053,10 @@ var willUseIsSticky = function willUseIsSticky() {
4560
5053
  var WithIsSticky = React__default.forwardRef(function (_ref, ref) {
4561
5054
  var className = _ref.className,
4562
5055
  children = _ref.children,
4563
- bottom = _ref.bottom;
5056
+ bottom = _ref.bottom,
5057
+ root = _ref.root,
5058
+ intersection = _ref.intersection,
5059
+ onChange = _ref.onChange;
4564
5060
  var ensuredRef = core.useEnsureRef(ref);
4565
5061
 
4566
5062
  var _useState = React.useState(false),
@@ -4568,19 +5064,20 @@ var willUseIsSticky = function willUseIsSticky() {
4568
5064
  isSticky = _useState2[0],
4569
5065
  setIsSticky = _useState2[1];
4570
5066
 
4571
- useRegister(function (posInfo, refInfo, target) {
5067
+ useRegister(function (posInfo, refInfo, target, isIntersecting) {
4572
5068
  if (ensuredRef.current === target) {
4573
- var value = bottom ? BOTTOM_TRIGGER(posInfo, refInfo) : TOP_TRIGGER(posInfo, refInfo);
5069
+ var value = intersection ? isIntersecting : bottom ? BOTTOM_TRIGGER(posInfo, refInfo) : TOP_TRIGGER(posInfo, refInfo);
4574
5070
 
4575
5071
  if (value !== undefined) {
4576
5072
  setIsSticky(value);
5073
+ callIfFunction(onChange, value);
4577
5074
  setSharedIsSticky(value);
4578
5075
  }
4579
5076
  }
4580
5077
  });
4581
5078
  React.useEffect(function () {
4582
5079
  setIsSticky(false);
4583
- observer.observe(ensuredRef.current);
5080
+ getObserver(callIfFunction(root)).observe(ensuredRef.current);
4584
5081
  activeObserved = activeObserved.concat(ensuredRef.current);
4585
5082
  return function () {
4586
5083
  // observer.unobserve(ref.current)
@@ -4619,26 +5116,17 @@ var FormatDate = function FormatDate(_ref) {
4619
5116
  });
4620
5117
  };
4621
5118
 
4622
- var BackgroundImageStyle = styled__default.div.withConfig({
4623
- displayName: "Image__BackgroundImageStyle",
4624
- componentId: "sjju78-0"
4625
- })(["background-image:url('", "');"], function (props) {
4626
- return props.image;
4627
- });
4628
5119
  var Image = React.forwardRef(function (_ref, ref) {
4629
- var src = _ref.src,
4630
- rest = _objectWithoutProperties(_ref, ["src"]);
5120
+ var dom = _ref.dom,
5121
+ src = _ref.src,
5122
+ style = _ref.style,
5123
+ rest = _objectWithoutProperties(_ref, ["dom", "src", "style"]);
4631
5124
 
4632
- var _useState = React.useState(src),
5125
+ var _useState = React.useState(typeof src === 'string' ? src : src && URL.createObjectURL(src)),
4633
5126
  _useState2 = _slicedToArray(_useState, 2),
4634
5127
  image = _useState2[0],
4635
5128
  setImage = _useState2[1];
4636
5129
 
4637
- var _useState3 = React.useState(),
4638
- _useState4 = _slicedToArray(_useState3, 2),
4639
- tempImage = _useState4[0],
4640
- setTempImage = _useState4[1];
4641
-
4642
5130
  React.useEffect(function () {
4643
5131
  if (src) {
4644
5132
  var imageStr = typeof src === 'string' ? src : URL.createObjectURL(src);
@@ -4653,8 +5141,13 @@ var Image = React.forwardRef(function (_ref, ref) {
4653
5141
  setImage("");
4654
5142
  }
4655
5143
  }, [src]);
4656
- return React__default.createElement(BackgroundImageStyle, _extends({}, rest, {
4657
- image: tempImage || image,
5144
+ return dom ? React__default.createElement("img", _extends({}, rest, {
5145
+ src: image,
5146
+ ref: ref
5147
+ })) : React__default.createElement("div", _extends({}, rest, {
5148
+ style: _objectSpread({}, style, {
5149
+ backgroundImage: "url(\"".concat(image, "\")")
5150
+ }),
4658
5151
  ref: ref
4659
5152
  }));
4660
5153
  });
@@ -4684,7 +5177,7 @@ function _templateObject2$5() {
4684
5177
  }
4685
5178
 
4686
5179
  function _templateObject$8() {
4687
- var data = _taggedTemplateLiteral(["\n display:block;\n position:fixed;\n top:0;\n left:0;\n bottom:0;\n z-index:1000;\n transition: 0.25s transform ease-out;\n background-color: ", ";\n box-shadow: -5px 0 20px 5px rgba(0,0,0,0.4);\n padding: 0.5rem 0;\n border-radius: 0;\n ", "\n "]);
5180
+ var data = _taggedTemplateLiteral(["\n display:block;\n position:fixed;\n top:0;\n left:0;\n bottom:0;\n z-index:1000;\n transition: 0.25s transform ease-out;\n background-color: ", ";\n box-shadow: -5px 0 20px 5px rgba(0,0,0,0.4);\n border-radius: 0;\n ", "\n "]);
4688
5181
 
4689
5182
  _templateObject$8 = function _templateObject() {
4690
5183
  return data;
@@ -4695,11 +5188,17 @@ function _templateObject$8() {
4695
5188
  var SideMenu = styled__default.div.withConfig({
4696
5189
  displayName: "DialogWithSidebar__SideMenu",
4697
5190
  componentId: "suvg9r-0"
4698
- })(["background-color:", ";border-top-left-radius:10px;border-bottom-left-radius:10px;width:19rem;flex-shrink:0;.list-menu{li{white-space:inherit;}}", " ", ""], utils.getColor('gray240'), function (props) {
5191
+ })(["background-color:", ";border-top-left-radius:10px;border-bottom-left-radius:10px;width:19rem;flex-shrink:0;padding:1.25rem 0;", " ", ""], utils.getColor('gray240'), function (props) {
4699
5192
  return !props.visibleOnDesktop && 'display:none;';
4700
5193
  }, utils.media.mobile(_templateObject$8(), utils.getColor('gray240'), function (props) {
4701
5194
  return !props.isOpen && "\n transform: translateX(-100%);\n box-shadow: none;\n ";
4702
5195
  }));
5196
+ var DialogTabMenu = styled__default.ul.withConfig({
5197
+ displayName: "DialogWithSidebar__DialogTabMenu",
5198
+ componentId: "suvg9r-1"
5199
+ })(["cursor:default;overflow:auto;text-align:left;color:inherit;user-select:none;li{position:relative;padding:1rem 2rem 1rem 4.1rem;font-size:14px;:hover{background-color:rgba(0,0,0,0.1);cursor:pointer;}&.selected{color:", ";background:rgba(0,132,214,0.125);pointer-events:none;}}.icon{position:absolute;left:1rem;top:50%;transform:translateY(-50%);width:3rem;text-align:center;line-height:0;font-size:26px;}", ""], utils.getColor('main'), function (props) {
5200
+ return props.menuTabIsOpen && "\n li {\n padding: 1.25rem 2rem 1.25rem 3.25rem;\n border-radius: 6px\n }\n .icon{\n left: 0;\n }\n ";
5201
+ });
4703
5202
 
4704
5203
  var _twoWayAnimation$5 = utils.twoWayAnimation('opacity: 0;', 'opacity: 0;', 'opacity: 1;'),
4705
5204
  _twoWayAnimation2$5 = _slicedToArray(_twoWayAnimation$5, 2),
@@ -4708,9 +5207,11 @@ var _twoWayAnimation$5 = utils.twoWayAnimation('opacity: 0;', 'opacity: 0;', 'op
4708
5207
 
4709
5208
  var absoluteOnLeave$1 = utils.oneWayAnimation('position: absolute;', 'position: absolute;');
4710
5209
  var fadeOut$3 = [absoluteOnLeave$1, relativeFadeout$1];
5210
+ var MENU_TAB = '$menu$';
4711
5211
  var DialogWithSidebarPresentation = function DialogWithSidebarPresentation(_ref) {
4712
5212
  var className = _ref.className,
4713
5213
  tabIsOpen = _ref.tabIsOpen,
5214
+ menuIsOpen = _ref.menuIsOpen,
4714
5215
  sidebar = _ref.sidebar,
4715
5216
  Content = _ref.Content,
4716
5217
  openTab = _ref.openTab,
@@ -4718,31 +5219,31 @@ var DialogWithSidebarPresentation = function DialogWithSidebarPresentation(_ref)
4718
5219
  children = _ref.children,
4719
5220
  title = _ref.title,
4720
5221
  auxiliarActions = _ref.auxiliarActions,
4721
- props = _objectWithoutProperties(_ref, ["className", "tabIsOpen", "sidebar", "Content", "openTab", "footer", "children", "title", "auxiliarActions"]);
5222
+ props = _objectWithoutProperties(_ref, ["className", "tabIsOpen", "menuIsOpen", "sidebar", "Content", "openTab", "footer", "children", "title", "auxiliarActions"]);
4722
5223
 
4723
5224
  var tab = core.useToggle(tabIsOpen);
4724
- var sideMenu = core.usePopupToggle();
5225
+ var sideMenu = core.usePopupToggle(menuIsOpen);
4725
5226
  var ref = React.useRef();
4726
5227
  var switchAnimation = core.useLazyConstant(willUseFlipSwitch);
5228
+ var menuTabIsOpen = tab.isOpen === MENU_TAB;
4727
5229
  return React__default.createElement(DialogContainer, _extends({}, props, {
4728
5230
  ref: ref
4729
5231
  }), function (_ref2) {
4730
5232
  var confirmCloseDialog = _ref2.confirmCloseDialog;
4731
5233
  return React__default.createElement("div", {
4732
- className: className,
5234
+ className: className + " JS-has-wc",
4733
5235
  ref: ref
4734
5236
  }, props.closeDialog && React__default.createElement(CloseIcon, {
4735
5237
  onClick: confirmCloseDialog
4736
5238
  }), React__default.createElement(SideMenu, {
4737
- className: "sidemenu",
4738
5239
  isOpen: sideMenu.isOpen,
4739
5240
  visibleOnDesktop: true
4740
5241
  }, sidebar(tab)), React__default.createElement("div", {
4741
- className: "main-container"
4742
- }, React__default.createElement("h2", null, React__default.createElement("span", {
5242
+ className: (menuTabIsOpen ? "menuTabIsOpen " : "") + "main-container"
5243
+ }, React__default.createElement("h2", null, menuTabIsOpen ? "Configurações da página" : React__default.createElement(React__default.Fragment, null, React__default.createElement("span", {
4743
5244
  className: "icon icon-menu mobile-only",
4744
5245
  onClick: sideMenu.open
4745
- }), title(tab)), React__default.createElement(React__default.Suspense, {
5246
+ }), title(tab))), React__default.createElement(React__default.Suspense, {
4746
5247
  fallback: React__default.createElement(TabContent, {
4747
5248
  key: "loading",
4748
5249
  switchAnimation: switchAnimation,
@@ -4757,7 +5258,7 @@ var DialogWithSidebarPresentation = function DialogWithSidebarPresentation(_ref)
4757
5258
  tab: tab,
4758
5259
  Content: Content,
4759
5260
  children: children
4760
- })), footer && React__default.createElement(DialogFooter, null, auxiliarActions && React__default.createElement(FooterAuxiliaryContainer, null, utils.callIfFunction(auxiliarActions)), utils.callIfFunction(footer))));
5261
+ })), footer && React__default.createElement(DialogFooter, null, auxiliarActions && React__default.createElement(FooterAuxiliaryContainer, null, utils.callIfFunction(auxiliarActions)), utils.callIfFunction(footer, tab))));
4761
5262
  });
4762
5263
  };
4763
5264
 
@@ -4781,7 +5282,7 @@ var DialogWithSidebar = styled__default(function (props) {
4781
5282
  }, props));
4782
5283
  }).withConfig({
4783
5284
  displayName: "DialogWithSidebar",
4784
- componentId: "suvg9r-1"
5285
+ componentId: "suvg9r-2"
4785
5286
  })(["max-width:59rem;display:flex;padding:0;flex-direction:row;", ""], utils.media.mobile(_templateObject2$5()));
4786
5287
 
4787
5288
  var MobileBubbleDialogFooter = styled__default.div.withConfig({
@@ -4823,6 +5324,7 @@ exports.AnimatedModal = AnimatedModal;
4823
5324
  exports.Button = Button;
4824
5325
  exports.CloseIcon = CloseIcon;
4825
5326
  exports.ConfirmDialog = ConfirmDialog;
5327
+ exports.ContextListMenu = ContextListMenu;
4826
5328
  exports.ContextMenu = ContextMenu;
4827
5329
  exports.ContextMenuComponent = ContextMenuComponent;
4828
5330
  exports.DefaultArrow = DefaultArrow;
@@ -4830,10 +5332,12 @@ exports.DefaultConfirmDialog = DefaultConfirmDialog;
4830
5332
  exports.Dialog = Dialog;
4831
5333
  exports.DialogContainer = DialogContainer;
4832
5334
  exports.DialogContent = DialogContent;
5335
+ exports.DialogContentWrapper = DialogContentWrapper;
4833
5336
  exports.DialogError = DialogError;
4834
5337
  exports.DialogErrorContent = DialogErrorContent;
4835
5338
  exports.DialogFooter = DialogFooter;
4836
5339
  exports.DialogIcon = DialogIcon;
5340
+ exports.DialogTabMenu = DialogTabMenu;
4837
5341
  exports.DialogTitle = DialogTitle;
4838
5342
  exports.DialogWithImageHeader = DialogWithImageHeader;
4839
5343
  exports.DialogWithSidebar = DialogWithSidebar;
@@ -4852,9 +5356,12 @@ exports.Image = Image;
4852
5356
  exports.Li = Li;
4853
5357
  exports.Link = Link;
4854
5358
  exports.ListHeading = ListHeading;
5359
+ exports.ListItem = ListItem;
4855
5360
  exports.ListMenu = ListMenu;
4856
5361
  exports.ListSeparator = ListSeparator;
4857
5362
  exports.Loading = Loading;
5363
+ exports.LoadingDiv = LoadingDiv;
5364
+ exports.MENU_TAB = MENU_TAB;
4858
5365
  exports.MobileBubbleDialog = MobileBubbleDialog;
4859
5366
  exports.Modal = Modal;
4860
5367
  exports.ModalContainer = ModalContainer;
@@ -4869,6 +5376,7 @@ exports.StickyContainer = StickyContainer;
4869
5376
  exports.SwitchDiv = SwitchDiv;
4870
5377
  exports.Tooltip = Tooltip;
4871
5378
  exports.TransitionDiv = TransitionDiv;
5379
+ exports.addPositioningBound = addPositioningBound;
4872
5380
  exports.contextMenuLayersQuantity = contextMenuLayersQuantity;
4873
5381
  exports.defaultAnimationMaker = defaultAnimationMaker;
4874
5382
  exports.dialogFadeInDown = dialogFadeInDown;