sanity-plugin-recurring-dates 1.0.2 → 1.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.esm.js CHANGED
@@ -21,7 +21,6 @@ const DEFAULT_COUNTS = [5,
21
21
  30
22
22
  // daily
23
23
  ];
24
-
25
24
  const validateRRuleString = recurrence => {
26
25
  try {
27
26
  rrulestr(recurrence);
@@ -1191,7 +1190,6 @@ var moment$1 = {
1191
1190
  // Sunday is the first day of the week.
1192
1191
  doy: 6 // The week that contains Jan 6th is the first week of the year.
1193
1192
  };
1194
-
1195
1193
  function localeFirstDayOfWeek() {
1196
1194
  return this._week.dow;
1197
1195
  }
@@ -1732,7 +1730,6 @@ var moment$1 = {
1732
1730
  locales[name] = null; // null means not found
1733
1731
  }
1734
1732
  }
1735
-
1736
1733
  return locales[name];
1737
1734
  }
1738
1735
 
@@ -2523,7 +2520,6 @@ var moment$1 = {
2523
2520
  if (unitHasDecimal) {
2524
2521
  return false; // only allow non-integers for smallest unit
2525
2522
  }
2526
-
2527
2523
  if (parseFloat(m[ordering[i]]) !== toInt(m[ordering[i]])) {
2528
2524
  unitHasDecimal = true;
2529
2525
  }
@@ -4559,7 +4555,6 @@ var moment$1 = {
4559
4555
  // <input type="week" />
4560
4556
  MONTH: 'YYYY-MM' // <input type="month" />
4561
4557
  };
4562
-
4563
4558
  return hooks;
4564
4559
  });
4565
4560
  })(moment$1);
@@ -4610,132 +4605,86 @@ function _extends() {
4610
4605
  var propTypes$1 = {
4611
4606
  exports: {}
4612
4607
  };
4613
- var reactIs = {
4614
- exports: {}
4615
- };
4616
- var reactIs_production_min = {};
4617
4608
 
4618
- /** @license React v16.13.1
4619
- * react-is.production.min.js
4609
+ /**
4610
+ * Copyright (c) 2013-present, Facebook, Inc.
4620
4611
  *
4621
- * Copyright (c) Facebook, Inc. and its affiliates.
4612
+ * This source code is licensed under the MIT license found in the
4613
+ * LICENSE file in the root directory of this source tree.
4614
+ */
4615
+
4616
+ var ReactPropTypesSecret_1;
4617
+ var hasRequiredReactPropTypesSecret;
4618
+ function requireReactPropTypesSecret() {
4619
+ if (hasRequiredReactPropTypesSecret) return ReactPropTypesSecret_1;
4620
+ hasRequiredReactPropTypesSecret = 1;
4621
+ var ReactPropTypesSecret = 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED';
4622
+ ReactPropTypesSecret_1 = ReactPropTypesSecret;
4623
+ return ReactPropTypesSecret_1;
4624
+ }
4625
+
4626
+ /**
4627
+ * Copyright (c) 2013-present, Facebook, Inc.
4622
4628
  *
4623
4629
  * This source code is licensed under the MIT license found in the
4624
4630
  * LICENSE file in the root directory of this source tree.
4625
4631
  */
4626
4632
 
4627
- var hasRequiredReactIs_production_min;
4628
- function requireReactIs_production_min() {
4629
- if (hasRequiredReactIs_production_min) return reactIs_production_min;
4630
- hasRequiredReactIs_production_min = 1;
4631
- var b = "function" === typeof Symbol && Symbol.for,
4632
- c = b ? Symbol.for("react.element") : 60103,
4633
- d = b ? Symbol.for("react.portal") : 60106,
4634
- e = b ? Symbol.for("react.fragment") : 60107,
4635
- f = b ? Symbol.for("react.strict_mode") : 60108,
4636
- g = b ? Symbol.for("react.profiler") : 60114,
4637
- h = b ? Symbol.for("react.provider") : 60109,
4638
- k = b ? Symbol.for("react.context") : 60110,
4639
- l = b ? Symbol.for("react.async_mode") : 60111,
4640
- m = b ? Symbol.for("react.concurrent_mode") : 60111,
4641
- n = b ? Symbol.for("react.forward_ref") : 60112,
4642
- p = b ? Symbol.for("react.suspense") : 60113,
4643
- q = b ? Symbol.for("react.suspense_list") : 60120,
4644
- r = b ? Symbol.for("react.memo") : 60115,
4645
- t = b ? Symbol.for("react.lazy") : 60116,
4646
- v = b ? Symbol.for("react.block") : 60121,
4647
- w = b ? Symbol.for("react.fundamental") : 60117,
4648
- x = b ? Symbol.for("react.responder") : 60118,
4649
- y = b ? Symbol.for("react.scope") : 60119;
4650
- function z(a) {
4651
- if ("object" === typeof a && null !== a) {
4652
- var u = a.$$typeof;
4653
- switch (u) {
4654
- case c:
4655
- switch (a = a.type, a) {
4656
- case l:
4657
- case m:
4658
- case e:
4659
- case g:
4660
- case f:
4661
- case p:
4662
- return a;
4663
- default:
4664
- switch (a = a && a.$$typeof, a) {
4665
- case k:
4666
- case n:
4667
- case t:
4668
- case r:
4669
- case h:
4670
- return a;
4671
- default:
4672
- return u;
4673
- }
4674
- }
4675
- case d:
4676
- return u;
4633
+ var factoryWithThrowingShims;
4634
+ var hasRequiredFactoryWithThrowingShims;
4635
+ function requireFactoryWithThrowingShims() {
4636
+ if (hasRequiredFactoryWithThrowingShims) return factoryWithThrowingShims;
4637
+ hasRequiredFactoryWithThrowingShims = 1;
4638
+ var ReactPropTypesSecret = requireReactPropTypesSecret();
4639
+ function emptyFunction() {}
4640
+ function emptyFunctionWithReset() {}
4641
+ emptyFunctionWithReset.resetWarningCache = emptyFunction;
4642
+ factoryWithThrowingShims = function () {
4643
+ function shim(props, propName, componentName, location, propFullName, secret) {
4644
+ if (secret === ReactPropTypesSecret) {
4645
+ // It is still safe when called from React.
4646
+ return;
4677
4647
  }
4648
+ var err = new Error('Calling PropTypes validators directly is not supported by the `prop-types` package. ' + 'Use PropTypes.checkPropTypes() to call them. ' + 'Read more at http://fb.me/use-check-prop-types');
4649
+ err.name = 'Invariant Violation';
4650
+ throw err;
4678
4651
  }
4679
- }
4680
- function A(a) {
4681
- return z(a) === m;
4682
- }
4683
- reactIs_production_min.AsyncMode = l;
4684
- reactIs_production_min.ConcurrentMode = m;
4685
- reactIs_production_min.ContextConsumer = k;
4686
- reactIs_production_min.ContextProvider = h;
4687
- reactIs_production_min.Element = c;
4688
- reactIs_production_min.ForwardRef = n;
4689
- reactIs_production_min.Fragment = e;
4690
- reactIs_production_min.Lazy = t;
4691
- reactIs_production_min.Memo = r;
4692
- reactIs_production_min.Portal = d;
4693
- reactIs_production_min.Profiler = g;
4694
- reactIs_production_min.StrictMode = f;
4695
- reactIs_production_min.Suspense = p;
4696
- reactIs_production_min.isAsyncMode = function (a) {
4697
- return A(a) || z(a) === l;
4698
- };
4699
- reactIs_production_min.isConcurrentMode = A;
4700
- reactIs_production_min.isContextConsumer = function (a) {
4701
- return z(a) === k;
4702
- };
4703
- reactIs_production_min.isContextProvider = function (a) {
4704
- return z(a) === h;
4705
- };
4706
- reactIs_production_min.isElement = function (a) {
4707
- return "object" === typeof a && null !== a && a.$$typeof === c;
4708
- };
4709
- reactIs_production_min.isForwardRef = function (a) {
4710
- return z(a) === n;
4711
- };
4712
- reactIs_production_min.isFragment = function (a) {
4713
- return z(a) === e;
4714
- };
4715
- reactIs_production_min.isLazy = function (a) {
4716
- return z(a) === t;
4717
- };
4718
- reactIs_production_min.isMemo = function (a) {
4719
- return z(a) === r;
4720
- };
4721
- reactIs_production_min.isPortal = function (a) {
4722
- return z(a) === d;
4723
- };
4724
- reactIs_production_min.isProfiler = function (a) {
4725
- return z(a) === g;
4726
- };
4727
- reactIs_production_min.isStrictMode = function (a) {
4728
- return z(a) === f;
4729
- };
4730
- reactIs_production_min.isSuspense = function (a) {
4731
- return z(a) === p;
4732
- };
4733
- reactIs_production_min.isValidElementType = function (a) {
4734
- return "string" === typeof a || "function" === typeof a || a === e || a === m || a === g || a === f || a === p || a === q || "object" === typeof a && null !== a && (a.$$typeof === t || a.$$typeof === r || a.$$typeof === h || a.$$typeof === k || a.$$typeof === n || a.$$typeof === w || a.$$typeof === x || a.$$typeof === y || a.$$typeof === v);
4652
+ shim.isRequired = shim;
4653
+ function getShim() {
4654
+ return shim;
4655
+ } // Important!
4656
+ // Keep this list in sync with production version in `./factoryWithTypeCheckers.js`.
4657
+ var ReactPropTypes = {
4658
+ array: shim,
4659
+ bigint: shim,
4660
+ bool: shim,
4661
+ func: shim,
4662
+ number: shim,
4663
+ object: shim,
4664
+ string: shim,
4665
+ symbol: shim,
4666
+ any: shim,
4667
+ arrayOf: getShim,
4668
+ element: shim,
4669
+ elementType: shim,
4670
+ instanceOf: getShim,
4671
+ node: shim,
4672
+ objectOf: getShim,
4673
+ oneOf: getShim,
4674
+ oneOfType: getShim,
4675
+ shape: getShim,
4676
+ exact: getShim,
4677
+ checkPropTypes: emptyFunctionWithReset,
4678
+ resetWarningCache: emptyFunction
4679
+ };
4680
+ ReactPropTypes.PropTypes = ReactPropTypes;
4681
+ return ReactPropTypes;
4735
4682
  };
4736
- reactIs_production_min.typeOf = z;
4737
- return reactIs_production_min;
4683
+ return factoryWithThrowingShims;
4738
4684
  }
4685
+ var reactIs = {
4686
+ exports: {}
4687
+ };
4739
4688
  var reactIs_development = {};
4740
4689
 
4741
4690
  /** @license React v16.13.1
@@ -4908,6 +4857,129 @@ function requireReactIs_development() {
4908
4857
  }
4909
4858
  return reactIs_development;
4910
4859
  }
4860
+ var reactIs_production_min = {};
4861
+
4862
+ /** @license React v16.13.1
4863
+ * react-is.production.min.js
4864
+ *
4865
+ * Copyright (c) Facebook, Inc. and its affiliates.
4866
+ *
4867
+ * This source code is licensed under the MIT license found in the
4868
+ * LICENSE file in the root directory of this source tree.
4869
+ */
4870
+
4871
+ var hasRequiredReactIs_production_min;
4872
+ function requireReactIs_production_min() {
4873
+ if (hasRequiredReactIs_production_min) return reactIs_production_min;
4874
+ hasRequiredReactIs_production_min = 1;
4875
+ var b = "function" === typeof Symbol && Symbol.for,
4876
+ c = b ? Symbol.for("react.element") : 60103,
4877
+ d = b ? Symbol.for("react.portal") : 60106,
4878
+ e = b ? Symbol.for("react.fragment") : 60107,
4879
+ f = b ? Symbol.for("react.strict_mode") : 60108,
4880
+ g = b ? Symbol.for("react.profiler") : 60114,
4881
+ h = b ? Symbol.for("react.provider") : 60109,
4882
+ k = b ? Symbol.for("react.context") : 60110,
4883
+ l = b ? Symbol.for("react.async_mode") : 60111,
4884
+ m = b ? Symbol.for("react.concurrent_mode") : 60111,
4885
+ n = b ? Symbol.for("react.forward_ref") : 60112,
4886
+ p = b ? Symbol.for("react.suspense") : 60113,
4887
+ q = b ? Symbol.for("react.suspense_list") : 60120,
4888
+ r = b ? Symbol.for("react.memo") : 60115,
4889
+ t = b ? Symbol.for("react.lazy") : 60116,
4890
+ v = b ? Symbol.for("react.block") : 60121,
4891
+ w = b ? Symbol.for("react.fundamental") : 60117,
4892
+ x = b ? Symbol.for("react.responder") : 60118,
4893
+ y = b ? Symbol.for("react.scope") : 60119;
4894
+ function z(a) {
4895
+ if ("object" === typeof a && null !== a) {
4896
+ var u = a.$$typeof;
4897
+ switch (u) {
4898
+ case c:
4899
+ switch (a = a.type, a) {
4900
+ case l:
4901
+ case m:
4902
+ case e:
4903
+ case g:
4904
+ case f:
4905
+ case p:
4906
+ return a;
4907
+ default:
4908
+ switch (a = a && a.$$typeof, a) {
4909
+ case k:
4910
+ case n:
4911
+ case t:
4912
+ case r:
4913
+ case h:
4914
+ return a;
4915
+ default:
4916
+ return u;
4917
+ }
4918
+ }
4919
+ case d:
4920
+ return u;
4921
+ }
4922
+ }
4923
+ }
4924
+ function A(a) {
4925
+ return z(a) === m;
4926
+ }
4927
+ reactIs_production_min.AsyncMode = l;
4928
+ reactIs_production_min.ConcurrentMode = m;
4929
+ reactIs_production_min.ContextConsumer = k;
4930
+ reactIs_production_min.ContextProvider = h;
4931
+ reactIs_production_min.Element = c;
4932
+ reactIs_production_min.ForwardRef = n;
4933
+ reactIs_production_min.Fragment = e;
4934
+ reactIs_production_min.Lazy = t;
4935
+ reactIs_production_min.Memo = r;
4936
+ reactIs_production_min.Portal = d;
4937
+ reactIs_production_min.Profiler = g;
4938
+ reactIs_production_min.StrictMode = f;
4939
+ reactIs_production_min.Suspense = p;
4940
+ reactIs_production_min.isAsyncMode = function (a) {
4941
+ return A(a) || z(a) === l;
4942
+ };
4943
+ reactIs_production_min.isConcurrentMode = A;
4944
+ reactIs_production_min.isContextConsumer = function (a) {
4945
+ return z(a) === k;
4946
+ };
4947
+ reactIs_production_min.isContextProvider = function (a) {
4948
+ return z(a) === h;
4949
+ };
4950
+ reactIs_production_min.isElement = function (a) {
4951
+ return "object" === typeof a && null !== a && a.$$typeof === c;
4952
+ };
4953
+ reactIs_production_min.isForwardRef = function (a) {
4954
+ return z(a) === n;
4955
+ };
4956
+ reactIs_production_min.isFragment = function (a) {
4957
+ return z(a) === e;
4958
+ };
4959
+ reactIs_production_min.isLazy = function (a) {
4960
+ return z(a) === t;
4961
+ };
4962
+ reactIs_production_min.isMemo = function (a) {
4963
+ return z(a) === r;
4964
+ };
4965
+ reactIs_production_min.isPortal = function (a) {
4966
+ return z(a) === d;
4967
+ };
4968
+ reactIs_production_min.isProfiler = function (a) {
4969
+ return z(a) === g;
4970
+ };
4971
+ reactIs_production_min.isStrictMode = function (a) {
4972
+ return z(a) === f;
4973
+ };
4974
+ reactIs_production_min.isSuspense = function (a) {
4975
+ return z(a) === p;
4976
+ };
4977
+ reactIs_production_min.isValidElementType = function (a) {
4978
+ return "string" === typeof a || "function" === typeof a || a === e || a === m || a === g || a === f || a === p || a === q || "object" === typeof a && null !== a && (a.$$typeof === t || a.$$typeof === r || a.$$typeof === h || a.$$typeof === k || a.$$typeof === n || a.$$typeof === w || a.$$typeof === x || a.$$typeof === y || a.$$typeof === v);
4979
+ };
4980
+ reactIs_production_min.typeOf = z;
4981
+ return reactIs_production_min;
4982
+ }
4911
4983
  var hasRequiredReactIs;
4912
4984
  function requireReactIs() {
4913
4985
  if (hasRequiredReactIs) return reactIs.exports;
@@ -5006,23 +5078,6 @@ function requireObjectAssign() {
5006
5078
  };
5007
5079
  return objectAssign;
5008
5080
  }
5009
-
5010
- /**
5011
- * Copyright (c) 2013-present, Facebook, Inc.
5012
- *
5013
- * This source code is licensed under the MIT license found in the
5014
- * LICENSE file in the root directory of this source tree.
5015
- */
5016
-
5017
- var ReactPropTypesSecret_1;
5018
- var hasRequiredReactPropTypesSecret;
5019
- function requireReactPropTypesSecret() {
5020
- if (hasRequiredReactPropTypesSecret) return ReactPropTypesSecret_1;
5021
- hasRequiredReactPropTypesSecret = 1;
5022
- var ReactPropTypesSecret = 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED';
5023
- ReactPropTypesSecret_1 = ReactPropTypesSecret;
5024
- return ReactPropTypesSecret_1;
5025
- }
5026
5081
  var has;
5027
5082
  var hasRequiredHas;
5028
5083
  function requireHas() {
@@ -5677,66 +5732,6 @@ function requireFactoryWithTypeCheckers() {
5677
5732
  return factoryWithTypeCheckers;
5678
5733
  }
5679
5734
 
5680
- /**
5681
- * Copyright (c) 2013-present, Facebook, Inc.
5682
- *
5683
- * This source code is licensed under the MIT license found in the
5684
- * LICENSE file in the root directory of this source tree.
5685
- */
5686
-
5687
- var factoryWithThrowingShims;
5688
- var hasRequiredFactoryWithThrowingShims;
5689
- function requireFactoryWithThrowingShims() {
5690
- if (hasRequiredFactoryWithThrowingShims) return factoryWithThrowingShims;
5691
- hasRequiredFactoryWithThrowingShims = 1;
5692
- var ReactPropTypesSecret = requireReactPropTypesSecret();
5693
- function emptyFunction() {}
5694
- function emptyFunctionWithReset() {}
5695
- emptyFunctionWithReset.resetWarningCache = emptyFunction;
5696
- factoryWithThrowingShims = function () {
5697
- function shim(props, propName, componentName, location, propFullName, secret) {
5698
- if (secret === ReactPropTypesSecret) {
5699
- // It is still safe when called from React.
5700
- return;
5701
- }
5702
- var err = new Error('Calling PropTypes validators directly is not supported by the `prop-types` package. ' + 'Use PropTypes.checkPropTypes() to call them. ' + 'Read more at http://fb.me/use-check-prop-types');
5703
- err.name = 'Invariant Violation';
5704
- throw err;
5705
- }
5706
- shim.isRequired = shim;
5707
- function getShim() {
5708
- return shim;
5709
- } // Important!
5710
- // Keep this list in sync with production version in `./factoryWithTypeCheckers.js`.
5711
- var ReactPropTypes = {
5712
- array: shim,
5713
- bigint: shim,
5714
- bool: shim,
5715
- func: shim,
5716
- number: shim,
5717
- object: shim,
5718
- string: shim,
5719
- symbol: shim,
5720
- any: shim,
5721
- arrayOf: getShim,
5722
- element: shim,
5723
- elementType: shim,
5724
- instanceOf: getShim,
5725
- node: shim,
5726
- objectOf: getShim,
5727
- oneOf: getShim,
5728
- oneOfType: getShim,
5729
- shape: getShim,
5730
- exact: getShim,
5731
- checkPropTypes: emptyFunctionWithReset,
5732
- resetWarningCache: emptyFunction
5733
- };
5734
- ReactPropTypes.PropTypes = ReactPropTypes;
5735
- return ReactPropTypes;
5736
- };
5737
- return factoryWithThrowingShims;
5738
- }
5739
-
5740
5735
  /**
5741
5736
  * Copyright (c) 2013-present, Facebook, Inc.
5742
5737
  *
@@ -6018,7 +6013,6 @@ var mediumSidecar = createSidecarMedium({
6018
6013
  // however, it might be required for JSDOM tests
6019
6014
  // ssr: true,
6020
6015
  });
6021
-
6022
6016
  var emptyArray = [];
6023
6017
  var FocusLock$1 = /*#__PURE__*/React.forwardRef(function FocusLockUI(props, parentRef) {
6024
6018
  var _extends2;
@@ -6124,7 +6118,7 @@ var FocusLock$1 = /*#__PURE__*/React.forwardRef(function FocusLockUI(props, pare
6124
6118
  var hasLeadingGuards = noFocusGuards !== true;
6125
6119
  var hasTailingGuards = hasLeadingGuards && noFocusGuards !== 'tail';
6126
6120
  var mergedRef = useMergeRefs([parentRef, setObserveNode]);
6127
- return /*#__PURE__*/React.createElement(React.Fragment, null, hasLeadingGuards && [/*#__PURE__*/
6121
+ return /*#__PURE__*/React.createElement(React.Fragment, null, hasLeadingGuards && [
6128
6122
  // nearest focus guard
6129
6123
  React.createElement("div", {
6130
6124
  key: "guard-first",
@@ -6217,31 +6211,31 @@ function _inheritsLoose(subClass, superClass) {
6217
6211
  subClass.prototype.constructor = subClass;
6218
6212
  _setPrototypeOf(subClass, superClass);
6219
6213
  }
6220
- function _typeof(obj) {
6214
+ function _typeof(o) {
6221
6215
  "@babel/helpers - typeof";
6222
6216
 
6223
- return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) {
6224
- return typeof obj;
6225
- } : function (obj) {
6226
- return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
6227
- }, _typeof(obj);
6217
+ return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) {
6218
+ return typeof o;
6219
+ } : function (o) {
6220
+ return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o;
6221
+ }, _typeof(o);
6228
6222
  }
6229
- function _toPrimitive(input, hint) {
6230
- if (_typeof(input) !== "object" || input === null) return input;
6231
- var prim = input[Symbol.toPrimitive];
6232
- if (prim !== undefined) {
6233
- var res = prim.call(input, hint || "default");
6234
- if (_typeof(res) !== "object") return res;
6223
+ function toPrimitive(t, r) {
6224
+ if ("object" != _typeof(t) || !t) return t;
6225
+ var e = t[Symbol.toPrimitive];
6226
+ if (void 0 !== e) {
6227
+ var i = e.call(t, r || "default");
6228
+ if ("object" != _typeof(i)) return i;
6235
6229
  throw new TypeError("@@toPrimitive must return a primitive value.");
6236
6230
  }
6237
- return (hint === "string" ? String : Number)(input);
6231
+ return ("string" === r ? String : Number)(t);
6238
6232
  }
6239
- function _toPropertyKey(arg) {
6240
- var key = _toPrimitive(arg, "string");
6241
- return _typeof(key) === "symbol" ? key : String(key);
6233
+ function toPropertyKey(t) {
6234
+ var i = toPrimitive(t, "string");
6235
+ return "symbol" == _typeof(i) ? i : String(i);
6242
6236
  }
6243
6237
  function _defineProperty(obj, key, value) {
6244
- key = _toPropertyKey(key);
6238
+ key = toPropertyKey(key);
6245
6239
  if (key in obj) {
6246
6240
  Object.defineProperty(obj, key, {
6247
6241
  value: value,
@@ -6502,17 +6496,29 @@ var filterAutoFocusable = function (nodes, cache) {
6502
6496
  });
6503
6497
  };
6504
6498
  /**
6505
- * only tabbable ones
6506
- * (but with guards which would be ignored)
6499
+ * !__WARNING__! Low level API.
6500
+ * @returns all tabbable nodes
6501
+ *
6502
+ * @see {@link getFocusableNodes} to get any focusable element
6503
+ *
6504
+ * @param topNodes - array of top level HTMLElements to search inside
6505
+ * @param visibilityCache - an cache to store intermediate measurements. Expected to be a fresh `new Map` on every call
6507
6506
  */
6508
6507
  var getTabbableNodes = function (topNodes, visibilityCache, withGuards) {
6509
6508
  return orderByTabIndex(filterFocusable(getFocusables(topNodes, withGuards), visibilityCache), true, withGuards);
6510
6509
  };
6511
6510
  /**
6512
- * actually anything "focusable", not only tabbable
6513
- * (without guards, as long as they are not expected to be focused)
6511
+ * !__WARNING__! Low level API.
6512
+ *
6513
+ * @returns anything "focusable", not only tabbable. The difference is in `tabIndex=-1`
6514
+ * (without guards, as long as they are not expected to be ever focused)
6515
+ *
6516
+ * @see {@link getTabbableNodes} to get only tabble nodes element
6517
+ *
6518
+ * @param topNodes - array of top level HTMLElements to search inside
6519
+ * @param visibilityCache - an cache to store intermediate measurements. Expected to be a fresh `new Map` on every call
6514
6520
  */
6515
- var getAllTabbableNodes = function (topNodes, visibilityCache) {
6521
+ var getFocusableNodes = function (topNodes, visibilityCache) {
6516
6522
  return orderByTabIndex(filterFocusable(getFocusables(topNodes), visibilityCache), false);
6517
6523
  };
6518
6524
  /**
@@ -6570,7 +6576,6 @@ var filterNested = function (nodes) {
6570
6576
  /* eslint-enable */
6571
6577
  }
6572
6578
  }
6573
-
6574
6579
  return nodes.filter(function (_, index) {
6575
6580
  return !contained.has(index);
6576
6581
  });
@@ -6585,8 +6590,8 @@ var getTopParent = function (node) {
6585
6590
  };
6586
6591
  /**
6587
6592
  * returns all "focus containers" inside a given node
6588
- * @param node
6589
- * @returns {T}
6593
+ * @param node - node or nodes to look inside
6594
+ * @returns Element[]
6590
6595
  */
6591
6596
  var getAllAffectedNodes = function (node) {
6592
6597
  var nodes = asArray(node);
@@ -6607,6 +6612,10 @@ var safeProbe = function (cb) {
6607
6612
  /**
6608
6613
  * returns active element from document or from nested shadowdoms
6609
6614
  */
6615
+ /**
6616
+ * returns current active element. If the active element is a "container" itself(shadowRoot or iframe) returns active element inside it
6617
+ * @param [inDocument]
6618
+ */
6610
6619
  var getActiveElement = function (inDocument) {
6611
6620
  if (inDocument === void 0) {
6612
6621
  inDocument = document;
@@ -6628,7 +6637,8 @@ var focusInsideIframe = function (topNode, activeElement) {
6628
6637
  }));
6629
6638
  };
6630
6639
  /**
6631
- * @returns {Boolean} true, if the current focus is inside given node or nodes
6640
+ * @returns {Boolean} true, if the current focus is inside given node or nodes.
6641
+ * Supports nodes hidden inside shadowDom
6632
6642
  */
6633
6643
  var focusInside = function (topNode, activeElement) {
6634
6644
  // const activeElement = document && getActiveElement();
@@ -6644,8 +6654,11 @@ var focusInside = function (topNode, activeElement) {
6644
6654
  };
6645
6655
 
6646
6656
  /**
6647
- * focus is hidden FROM the focus-lock
6657
+ * checks if focus is hidden FROM the focus-lock
6648
6658
  * ie contained inside a node focus-lock shall ignore
6659
+ *
6660
+ * This is a utility function coupled with {@link FOCUS_ALLOW} constant
6661
+ *
6649
6662
  * @returns {boolean} focus is currently is in "allow" area
6650
6663
  */
6651
6664
  var focusIsHidden = function (inDocument) {
@@ -6864,16 +6877,21 @@ var reorderNodes = function (srcNodes, dstNodes) {
6864
6877
  }).filter(isDefined);
6865
6878
  };
6866
6879
  /**
6867
- * given top node(s) and the last active element return the element to be focused next
6880
+ * contains the main logic of the `focus-lock` package.
6881
+ *
6882
+ * ! you probably dont need this function !
6883
+ *
6884
+ * given top node(s) and the last active element returns the element to be focused next
6885
+ * @returns element which should be focused to move focus inside
6868
6886
  * @param topNode
6869
6887
  * @param lastNode
6870
6888
  */
6871
- var getFocusMerge = function (topNode, lastNode) {
6889
+ var focusSolver = function (topNode, lastNode) {
6872
6890
  var activeElement = getActiveElement(asArray(topNode).length > 0 ? document : getFirst(topNode).ownerDocument);
6873
6891
  var entries = getAllAffectedNodes(topNode).filter(isNotAGuard);
6874
6892
  var commonParent = getTopCommonParent(activeElement || topNode, topNode, entries);
6875
6893
  var visibilityCache = new Map();
6876
- var anyFocusable = getAllTabbableNodes(entries, visibilityCache);
6894
+ var anyFocusable = getFocusableNodes(entries, visibilityCache);
6877
6895
  var innerElements = getTabbableNodes(entries, visibilityCache).filter(function (_a) {
6878
6896
  var node = _a.node;
6879
6897
  return isNotAGuard(node);
@@ -6884,7 +6902,7 @@ var getFocusMerge = function (topNode, lastNode) {
6884
6902
  return undefined;
6885
6903
  }
6886
6904
  }
6887
- var outerNodes = getAllTabbableNodes([commonParent], visibilityCache).map(function (_a) {
6905
+ var outerNodes = getFocusableNodes([commonParent], visibilityCache).map(function (_a) {
6888
6906
  var node = _a.node;
6889
6907
  return node;
6890
6908
  });
@@ -6912,10 +6930,10 @@ var getFocusMerge = function (topNode, lastNode) {
6912
6930
  };
6913
6931
 
6914
6932
  /**
6915
- * return list of focusable elements inside a given top node
6916
- * @deprecated use {@link getFocusableIn}. Yep, there is typo in the function name
6933
+ * @returns list of focusable elements inside a given top node
6934
+ * @see {@link getFocusableNodes} for lower level access
6917
6935
  */
6918
- var getFocusabledIn = function (topNode) {
6936
+ var expandFocusableNodes = function (topNode) {
6919
6937
  var entries = getAllAffectedNodes(topNode).filter(isNotAGuard);
6920
6938
  var commonParent = getTopCommonParent(topNode, topNode, entries);
6921
6939
  var visibilityCache = new Map();
@@ -6949,23 +6967,30 @@ var focusOn = function (target, focusOptions) {
6949
6967
  var guardCount = 0;
6950
6968
  var lockDisabled = false;
6951
6969
  /**
6952
- * Sets focus at a given node. The last focused element will help to determine which element(first or last) should be focused.
6970
+ * The main functionality of the focus-lock package
6971
+ *
6972
+ * Contains focus at a given node.
6973
+ * The last focused element will help to determine which element(first or last) should be focused.
6974
+ * The found element will be focused.
6975
+ *
6976
+ * This is one time action (move), not a persistent focus-lock
6977
+ *
6953
6978
  * HTML markers (see {@link import('./constants').FOCUS_AUTO} constants) can control autofocus
6954
- * @param topNode
6955
- * @param lastNode
6956
- * @param options
6979
+ * @see {@link focusSolver} for the same functionality without autofocus
6957
6980
  */
6958
- var setFocus = function (topNode, lastNode, options) {
6981
+ var moveFocusInside = function (topNode, lastNode, options) {
6959
6982
  if (options === void 0) {
6960
6983
  options = {};
6961
6984
  }
6962
- var focusable = getFocusMerge(topNode, lastNode);
6985
+ var focusable = focusSolver(topNode, lastNode);
6986
+ // global local side effect to countain recursive lock activation and resolve focus-fighting
6963
6987
  if (lockDisabled) {
6964
6988
  return;
6965
6989
  }
6966
6990
  if (focusable) {
6991
+ /** +FOCUS-FIGHTING prevention **/
6967
6992
  if (guardCount > 2) {
6968
- // tslint:disable-next-line:no-console
6993
+ // we have recursive entered back the lock activation
6969
6994
  console.error('FocusLock: focus-fighting detected. Only one focus management system could be active. ' + 'See https://github.com/theKashey/focus-lock/#focus-fighting');
6970
6995
  lockDisabled = true;
6971
6996
  setTimeout(function () {
@@ -7082,7 +7107,7 @@ var activateTrap = function activateTrap() {
7082
7107
  }
7083
7108
  document.body.focus();
7084
7109
  } else {
7085
- result = setFocus(workingArea, lastActiveFocus, {
7110
+ result = moveFocusInside(workingArea, lastActiveFocus, {
7086
7111
  focusOptions: focusOptions
7087
7112
  });
7088
7113
  lastPortaledElement = {};
@@ -7094,7 +7119,7 @@ var activateTrap = function activateTrap() {
7094
7119
  }
7095
7120
  if (document) {
7096
7121
  var newActiveElement = document && document.activeElement;
7097
- var allNodes = getFocusabledIn(workingArea);
7122
+ var allNodes = expandFocusableNodes(workingArea);
7098
7123
  var focusedIndex = allNodes.map(function (_ref) {
7099
7124
  var node = _ref.node;
7100
7125
  return node;
@@ -7200,7 +7225,7 @@ mediumFocus.assignSyncMedium(onFocus);
7200
7225
  mediumBlur.assignMedium(onBlur);
7201
7226
  mediumEffect.assignMedium(function (cb) {
7202
7227
  return cb({
7203
- moveFocusInside: setFocus,
7228
+ moveFocusInside: moveFocusInside,
7204
7229
  focusInside: focusInside
7205
7230
  });
7206
7231
  });
@@ -8687,7 +8712,7 @@ function Monthly(props) {
8687
8712
  }), weekNo && /* @__PURE__ */jsx(Box, {
8688
8713
  children: /* @__PURE__ */jsx(Select, {
8689
8714
  name: "day",
8690
- value: dayNo ? dayNo : 1,
8715
+ value: dayNo ? dayNo : 0,
8691
8716
  onChange: handleChange,
8692
8717
  children: DAYS.map((day, i) => {
8693
8718
  const weekday = new Weekday(i);