@bbl-digital/snorre 4.2.94 → 4.2.96

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 (112) hide show
  1. package/dist/snorre.es1019.js +14 -17
  2. package/dist/snorre.es1020.js +10 -254
  3. package/dist/snorre.es1021.js +41 -2
  4. package/dist/snorre.es1022.js +16 -79
  5. package/dist/snorre.es1023.js +11 -13
  6. package/dist/snorre.es1024.js +24 -18
  7. package/dist/snorre.es1025.js +26 -13
  8. package/dist/snorre.es1026.js +61 -15
  9. package/dist/snorre.es1027.js +6 -10
  10. package/dist/snorre.es1028.js +10 -41
  11. package/dist/snorre.es1029.js +23 -10
  12. package/dist/snorre.es1030.js +26 -25
  13. package/dist/snorre.es1031.js +2 -27
  14. package/dist/snorre.es1032.js +11 -60
  15. package/dist/snorre.es1033.js +8 -5
  16. package/dist/snorre.es1034.js +12 -9
  17. package/dist/snorre.es1035.js +28 -24
  18. package/dist/snorre.es1036.js +254 -26
  19. package/dist/snorre.es1037.js +2 -2
  20. package/dist/snorre.es1038.js +80 -11
  21. package/dist/snorre.es1039.js +13 -9
  22. package/dist/snorre.es1040.js +18 -12
  23. package/dist/snorre.es1041.js +14 -28
  24. package/dist/snorre.es1042.js +5 -4
  25. package/dist/snorre.es1043.js +4 -5
  26. package/dist/snorre.es1124.js +24 -8
  27. package/dist/snorre.es1125.js +19 -22
  28. package/dist/snorre.es1126.js +7 -65
  29. package/dist/snorre.es1127.js +6 -25
  30. package/dist/snorre.es1128.js +22 -19
  31. package/dist/snorre.es1129.js +6 -7
  32. package/dist/snorre.es1130.js +16 -6
  33. package/dist/snorre.es1131.js +8 -5
  34. package/dist/snorre.es1132.js +8 -15
  35. package/dist/snorre.es1133.js +63 -7
  36. package/dist/snorre.es1155.js +1 -1
  37. package/dist/snorre.es1157.js +1 -1
  38. package/dist/snorre.es1334.js +5 -5
  39. package/dist/snorre.es1335.js +1 -1
  40. package/dist/snorre.es1343.js +3 -3
  41. package/dist/snorre.es1344.js +4 -4
  42. package/dist/snorre.es1345.js +4 -10
  43. package/dist/snorre.es1346.js +10 -6
  44. package/dist/snorre.es1347.js +6 -6
  45. package/dist/snorre.es1348.js +6 -4
  46. package/dist/snorre.es333.js +3 -3
  47. package/dist/snorre.es334.js +1 -1
  48. package/dist/snorre.es335.js +2 -2
  49. package/dist/snorre.es466.js +1 -1
  50. package/dist/snorre.es487.js +1 -1
  51. package/dist/snorre.es488.js +1 -1
  52. package/dist/snorre.es489.js +1 -1
  53. package/dist/snorre.es500.js +54 -2
  54. package/dist/snorre.es501.js +64 -24
  55. package/dist/snorre.es502.js +2 -602
  56. package/dist/snorre.es503.js +26 -5
  57. package/dist/snorre.es504.js +602 -54
  58. package/dist/snorre.es505.js +5 -66
  59. package/dist/snorre.es550.js +1 -1
  60. package/dist/snorre.es551.js +1 -1
  61. package/dist/snorre.es573.js +22 -2
  62. package/dist/snorre.es574.js +40 -2
  63. package/dist/snorre.es575.js +2 -22
  64. package/dist/snorre.es576.js +2 -40
  65. package/dist/snorre.es612.js +1 -1
  66. package/dist/snorre.es613.js +1 -1
  67. package/dist/snorre.es617.js +5 -5
  68. package/dist/snorre.es618.js +1 -1
  69. package/dist/snorre.es623.js +1 -1
  70. package/dist/snorre.es626.js +1 -1
  71. package/dist/snorre.es636.js +2 -2
  72. package/dist/snorre.es709.js +1 -1
  73. package/dist/snorre.es730.js +1 -1
  74. package/dist/snorre.es731.js +1 -1
  75. package/dist/snorre.es732.js +2 -2
  76. package/dist/snorre.es734.js +1 -1
  77. package/dist/snorre.es836.js +3 -3
  78. package/dist/snorre.es841.js +1 -1
  79. package/dist/snorre.es842.js +6 -6
  80. package/dist/snorre.es843.js +7 -7
  81. package/dist/snorre.es844.js +1 -1
  82. package/dist/snorre.es845.js +1 -1
  83. package/dist/snorre.es846.js +2 -2
  84. package/dist/snorre.es847.js +3 -3
  85. package/dist/snorre.es850.js +28 -15
  86. package/dist/snorre.es851.js +21 -2
  87. package/dist/snorre.es852.js +2 -10
  88. package/dist/snorre.es853.js +9 -4
  89. package/dist/snorre.es854.js +5 -11
  90. package/dist/snorre.es855.js +11 -14
  91. package/dist/snorre.es856.js +12 -27
  92. package/dist/snorre.es857.js +28 -28
  93. package/dist/snorre.es859.js +5 -20
  94. package/dist/snorre.es860.js +15 -5
  95. package/dist/snorre.es868.js +1 -1
  96. package/dist/snorre.es883.js +1 -1
  97. package/dist/snorre.es931.js +3 -3
  98. package/dist/snorre.es938.js +1 -1
  99. package/dist/snorre.es941.js +2 -2
  100. package/dist/snorre.es943.js +5 -13
  101. package/dist/snorre.es944.js +21 -4
  102. package/dist/snorre.es945.js +9 -5
  103. package/dist/snorre.es946.js +7 -29
  104. package/dist/snorre.es947.js +12 -11
  105. package/dist/snorre.es948.js +4 -24
  106. package/dist/snorre.es949.js +5 -5
  107. package/dist/snorre.es950.js +29 -5
  108. package/dist/snorre.es951.js +11 -21
  109. package/dist/snorre.es952.js +25 -9
  110. package/dist/snorre.es953.js +5 -7
  111. package/package.json +25 -1
  112. package/vite.config.js +1 -2
@@ -1,31 +1,16 @@
1
- import { invariant as l } from "./snorre.es624.js";
2
- import { isNumericalString as c } from "./snorre.es661.js";
3
- import { isCSSVariableToken as s } from "./snorre.es652.js";
4
- const m = (
5
- // eslint-disable-next-line redos-detector/no-unsafe-regex -- false positive, as it can match a lot of words
6
- /^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u
7
- );
8
- function p(r) {
9
- const t = m.exec(r);
10
- if (!t)
11
- return [,];
12
- const [, e, i, a] = t;
13
- return [`--${e ?? i}`, a];
14
- }
15
- const u = 4;
16
- function f(r, t, e = 1) {
17
- l(e <= u, `Max CSS variable fallback depth detected in property "${r}". This may indicate a circular fallback dependency.`);
18
- const [i, a] = p(r);
19
- if (!i)
20
- return;
21
- const o = window.getComputedStyle(t).getPropertyValue(i);
22
- if (o) {
23
- const n = o.trim();
24
- return c(n) ? parseFloat(n) : n;
1
+ import { analyseComplexValue as l } from "./snorre.es668.js";
2
+ import { getAnimatableNone as m } from "./snorre.es669.js";
3
+ const f = /* @__PURE__ */ new Set(["auto", "none", "0"]);
4
+ function g(e, i, o) {
5
+ let n = 0, a;
6
+ for (; n < e.length && !a; ) {
7
+ const t = e[n];
8
+ typeof t == "string" && !f.has(t) && l(t).values.length && (a = e[n]), n++;
25
9
  }
26
- return s(a) ? f(a, t, e + 1) : a;
10
+ if (a && o)
11
+ for (const t of i)
12
+ e[t] = m(o, a);
27
13
  }
28
14
  export {
29
- f as getVariableValue,
30
- p as parseCSSVariable
15
+ g as makeNoneKeyframesAnimatable
31
16
  };
@@ -1,31 +1,31 @@
1
- import { number as n } from "./snorre.es870.js";
2
- import { px as m } from "./snorre.es683.js";
3
- import { transformPropOrder as l } from "./snorre.es656.js";
4
- import { parseValueFromTransform as e } from "./snorre.es1032.js";
5
- const c = (o) => o === n || o === m, i = /* @__PURE__ */ new Set(["x", "y", "z"]), p = l.filter((o) => !i.has(o));
6
- function F(o) {
7
- const r = [];
8
- return p.forEach((a) => {
9
- const s = o.getValue(a);
10
- s !== void 0 && (r.push([a, s.get()]), s.set(a.startsWith("scale") ? 1 : 0));
11
- }), r;
1
+ import { invariant as l } from "./snorre.es624.js";
2
+ import { isNumericalString as c } from "./snorre.es661.js";
3
+ import { isCSSVariableToken as s } from "./snorre.es652.js";
4
+ const m = (
5
+ // eslint-disable-next-line redos-detector/no-unsafe-regex -- false positive, as it can match a lot of words
6
+ /^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u
7
+ );
8
+ function p(r) {
9
+ const t = m.exec(r);
10
+ if (!t)
11
+ return [,];
12
+ const [, e, i, a] = t;
13
+ return [`--${e ?? i}`, a];
14
+ }
15
+ const u = 4;
16
+ function f(r, t, e = 1) {
17
+ l(e <= u, `Max CSS variable fallback depth detected in property "${r}". This may indicate a circular fallback dependency.`);
18
+ const [i, a] = p(r);
19
+ if (!i)
20
+ return;
21
+ const o = window.getComputedStyle(t).getPropertyValue(i);
22
+ if (o) {
23
+ const n = o.trim();
24
+ return c(n) ? parseFloat(n) : n;
25
+ }
26
+ return s(a) ? f(a, t, e + 1) : a;
12
27
  }
13
- const t = {
14
- // Dimensions
15
- width: ({ x: o }, { paddingLeft: r = "0", paddingRight: a = "0" }) => o.max - o.min - parseFloat(r) - parseFloat(a),
16
- height: ({ y: o }, { paddingTop: r = "0", paddingBottom: a = "0" }) => o.max - o.min - parseFloat(r) - parseFloat(a),
17
- top: (o, { top: r }) => parseFloat(r),
18
- left: (o, { left: r }) => parseFloat(r),
19
- bottom: ({ y: o }, { top: r }) => parseFloat(r) + (o.max - o.min),
20
- right: ({ x: o }, { left: r }) => parseFloat(r) + (o.max - o.min),
21
- // Transform
22
- x: (o, { transform: r }) => e(r, "x"),
23
- y: (o, { transform: r }) => e(r, "y")
24
- };
25
- t.translateX = t.x;
26
- t.translateY = t.y;
27
28
  export {
28
- c as isNumOrPxType,
29
- t as positionalValues,
30
- F as removeNonTranslationalTransform
29
+ f as getVariableValue,
30
+ p as parseCSSVariable
31
31
  };
@@ -1,23 +1,8 @@
1
- import { warning as s } from "./snorre.es624.js";
2
- import { isGenerator as f } from "./snorre.es610.js";
3
- import { isAnimatable as l } from "./snorre.es1043.js";
4
- function g(t) {
5
- const i = t[0];
6
- if (t.length === 1)
7
- return !0;
8
- for (let n = 0; n < t.length; n++)
9
- if (t[n] !== i)
10
- return !0;
11
- }
12
- function h(t, i, n, u) {
13
- const r = t[0];
14
- if (r === null)
15
- return !1;
16
- if (i === "display" || i === "visibility")
17
- return !0;
18
- const a = t[t.length - 1], e = l(r, i), o = l(a, i);
19
- return s(e === o, `You are trying to animate ${i} from "${r}" to "${a}". ${r} is not an animatable value - to enable this animation set ${r} to a value animatable to ${a} via the \`style\` property.`), !e || !o ? !1 : g(t) || (n === "spring" || f(n)) && u;
1
+ // @__NO_SIDE_EFFECTS__
2
+ function r(n) {
3
+ let e;
4
+ return () => (e === void 0 && (e = n()), e);
20
5
  }
21
6
  export {
22
- h as canAnimate
7
+ r as memo
23
8
  };
@@ -1,8 +1,18 @@
1
- // @__NO_SIDE_EFFECTS__
2
- function r(n) {
3
- let e;
4
- return () => (e === void 0 && (e = n()), e);
1
+ import { resolveFinalValueInKeyframes as s } from "./snorre.es605.js";
2
+ import { motionValue as f } from "./snorre.es667.js";
3
+ import { resolveVariant as V } from "./snorre.es635.js";
4
+ function l(o, t, e) {
5
+ o.hasValue(t) ? o.getValue(t).set(e) : o.addValue(t, f(e));
6
+ }
7
+ function p(o, t) {
8
+ const e = V(o, t);
9
+ let { transitionEnd: a = {}, transition: c = {}, ...r } = e || {};
10
+ r = { ...r, ...a };
11
+ for (const n in r) {
12
+ const i = s(r[n]);
13
+ l(o, n, i);
14
+ }
5
15
  }
6
16
  export {
7
- r as memo
17
+ p as setTarget
8
18
  };
@@ -24,7 +24,7 @@ import { scaleCorrectors as H } from "./snorre.es651.js";
24
24
  import { buildProjectionTransform as Pt } from "./snorre.es1057.js";
25
25
  import { eachAxis as q } from "./snorre.es1058.js";
26
26
  import { hasTransform as P, hasScale as G, has2DTranslate as Bt } from "./snorre.es1059.js";
27
- import { globalProjectionState as O } from "./snorre.es1023.js";
27
+ import { globalProjectionState as O } from "./snorre.es1039.js";
28
28
  const b = ["", "X", "Y", "Z"], At = { visibility: "hidden" }, X = 1e3;
29
29
  let jt = 0;
30
30
  function I(e, l, h, c) {
@@ -1,4 +1,4 @@
1
- import { memo as o } from "./snorre.es860.js";
1
+ import { memo as o } from "./snorre.es859.js";
2
2
  const i = o(() => window.ScrollTimeline !== void 0);
3
3
  export {
4
4
  i as supportsScrollTimeline
@@ -1,6 +1,6 @@
1
- import { CalendarDay as F } from "./snorre.es943.js";
2
- import { CalendarWeek as N } from "./snorre.es945.js";
3
- import { CalendarMonth as P } from "./snorre.es944.js";
1
+ import { CalendarDay as F } from "./snorre.es947.js";
2
+ import { CalendarWeek as N } from "./snorre.es949.js";
3
+ import { CalendarMonth as P } from "./snorre.es948.js";
4
4
  function j(l, d, e, s) {
5
5
  const { addDays: y, endOfBroadcastWeek: D, endOfISOWeek: h, endOfMonth: k, endOfWeek: C, getISOWeek: I, getWeek: M, startOfBroadcastWeek: S, startOfISOWeek: g, startOfWeek: w } = s, o = l.reduce((W, t) => {
6
6
  const x = e.broadcastCalendar ? S(t, s) : e.ISOWeek ? g(t) : w(t), f = e.broadcastCalendar ? D(t, s) : e.ISOWeek ? h(k(t)) : C(k(t)), a = d.filter((r) => r >= x && r <= f), O = e.broadcastCalendar ? 35 : 42;
@@ -1,6 +1,6 @@
1
1
  import { dateMatchModifiers as u } from "./snorre.es939.js";
2
2
  import { getFocusableDate as g } from "./snorre.es1071.js";
3
- import { CalendarDay as m } from "./snorre.es943.js";
3
+ import { CalendarDay as m } from "./snorre.es947.js";
4
4
  function h(t, i, a, d, f, e, n, s = 0) {
5
5
  if (s > 365)
6
6
  return;
@@ -1,7 +1,7 @@
1
1
  import { useControlledValue as x } from "./snorre.es936.js";
2
2
  import { rangeIncludesDate as y } from "./snorre.es758.js";
3
- import { addToRange as C } from "./snorre.es946.js";
4
- import { rangeContainsModifiers as q } from "./snorre.es948.js";
3
+ import { addToRange as C } from "./snorre.es950.js";
4
+ import { rangeContainsModifiers as q } from "./snorre.es952.js";
5
5
  function h(l, d) {
6
6
  const { disabled: i, excludeDisabled: c, selected: s, required: f, onSelect: o } = l, [r, m] = x(s, o ? s : void 0), t = o ? s : r;
7
7
  return {
@@ -1,16 +1,8 @@
1
- import { defaultDateLib as a } from "./snorre.es741.js";
2
- class h {
3
- constructor(t, i, s = a) {
4
- this.date = t, this.displayMonth = i, this.outside = !!(i && !s.isSameMonth(t, i)), this.dateLib = s;
5
- }
6
- /**
7
- * Check if the day is the same as the given day: considering if it is in the
8
- * same display month.
9
- */
10
- isEqualTo(t) {
11
- return this.dateLib.isSameDay(t.date, this.date) && this.dateLib.isSameMonth(t.displayMonth, this.displayMonth);
12
- }
1
+ function e(o, r) {
2
+ return e = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function(t, n) {
3
+ return t.__proto__ = n, t;
4
+ }, e(o, r);
13
5
  }
14
6
  export {
15
- h as CalendarDay
7
+ e as default
16
8
  };
@@ -1,8 +1,25 @@
1
- class a {
2
- constructor(t, s) {
3
- this.date = t, this.weeks = s;
1
+ import p from "./snorre.es1072.js";
2
+ function o(r, n) {
3
+ var e = Object.keys(r);
4
+ if (Object.getOwnPropertySymbols) {
5
+ var t = Object.getOwnPropertySymbols(r);
6
+ n && (t = t.filter(function(c) {
7
+ return Object.getOwnPropertyDescriptor(r, c).enumerable;
8
+ })), e.push.apply(e, t);
4
9
  }
10
+ return e;
11
+ }
12
+ function i(r) {
13
+ for (var n = 1; n < arguments.length; n++) {
14
+ var e = arguments[n] != null ? arguments[n] : {};
15
+ n % 2 ? o(Object(e), !0).forEach(function(t) {
16
+ p(r, t, e[t]);
17
+ }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(r, Object.getOwnPropertyDescriptors(e)) : o(Object(e)).forEach(function(t) {
18
+ Object.defineProperty(r, t, Object.getOwnPropertyDescriptor(e, t));
19
+ });
20
+ }
21
+ return r;
5
22
  }
6
23
  export {
7
- a as CalendarMonth
24
+ i as default
8
25
  };
@@ -1,8 +1,12 @@
1
- class t {
2
- constructor(e, s) {
3
- this.days = s, this.weekNumber = e;
4
- }
1
+ function e(t) {
2
+ t();
5
3
  }
4
+ var a = e, n = function(c) {
5
+ return a = c;
6
+ }, r = function() {
7
+ return a;
8
+ };
6
9
  export {
7
- t as CalendarWeek
10
+ r as getBatch,
11
+ n as setBatch
8
12
  };
@@ -1,32 +1,10 @@
1
- import { defaultDateLib as p } from "./snorre.es741.js";
2
- function y(o, D, n = 0, l = 0, r = !1, u = p) {
3
- const { from: e, to: i } = D || {}, { isSameDay: s, isAfter: m, isBefore: c } = u;
4
- let f;
5
- if (!e && !i)
6
- f = { from: o, to: n > 0 ? void 0 : o };
7
- else if (e && !i)
8
- s(e, o) ? r ? f = { from: e, to: void 0 } : f = void 0 : c(o, e) ? f = { from: o, to: e } : f = { from: e, to: o };
9
- else if (e && i)
10
- if (s(e, o) && s(i, o))
11
- r ? f = { from: e, to: i } : f = void 0;
12
- else if (s(e, o))
13
- f = { from: e, to: n > 0 ? void 0 : o };
14
- else if (s(i, o))
15
- f = { from: o, to: n > 0 ? void 0 : o };
16
- else if (c(o, e))
17
- f = { from: o, to: i };
18
- else if (m(o, e))
19
- f = { from: e, to: o };
20
- else if (m(o, i))
21
- f = { from: e, to: o };
22
- else
23
- throw new Error("Invalid range");
24
- if (f != null && f.from && (f != null && f.to)) {
25
- const t = u.differenceInCalendarDays(f.to, f.from);
26
- l > 0 && t > l ? f = { from: o, to: void 0 } : n > 1 && t < n && (f = { from: o, to: void 0 });
27
- }
28
- return f;
1
+ var t = process.env.NODE_ENV === "production", o = "Invariant failed";
2
+ function c(a, r) {
3
+ if (t)
4
+ throw new Error(o);
5
+ var n = typeof r == "function" ? r() : r, i = n ? "".concat(o, ": ").concat(n) : o;
6
+ throw new Error(i);
29
7
  }
30
8
  export {
31
- y as addToRange
9
+ c as default
32
10
  };
@@ -1,15 +1,16 @@
1
- import { defaultDateLib as f } from "./snorre.es741.js";
2
- function y(t, r, e = f) {
3
- const n = Array.isArray(r) ? r : [r];
4
- let a = t.from;
5
- const i = e.differenceInCalendarDays(t.to, t.from), s = Math.min(i, 6);
6
- for (let o = 0; o <= s; o++) {
7
- if (n.includes(a.getDay()))
8
- return !0;
9
- a = e.addDays(a, 1);
1
+ import { defaultDateLib as a } from "./snorre.es741.js";
2
+ class h {
3
+ constructor(t, i, s = a) {
4
+ this.date = t, this.displayMonth = i, this.outside = !!(i && !s.isSameMonth(t, i)), this.dateLib = s;
5
+ }
6
+ /**
7
+ * Check if the day is the same as the given day: considering if it is in the
8
+ * same display month.
9
+ */
10
+ isEqualTo(t) {
11
+ return this.dateLib.isSameDay(t.date, this.date) && this.dateLib.isSameMonth(t.displayMonth, this.displayMonth);
10
12
  }
11
- return !1;
12
13
  }
13
14
  export {
14
- y as rangeContainsDayOfWeek
15
+ h as CalendarDay
15
16
  };
@@ -1,28 +1,8 @@
1
- import { defaultDateLib as p } from "./snorre.es741.js";
2
- import { dateMatchModifiers as s } from "./snorre.es939.js";
3
- import { rangeContainsDayOfWeek as M } from "./snorre.es947.js";
4
- import { rangeIncludesDate as l } from "./snorre.es758.js";
5
- import { rangeOverlaps as y } from "./snorre.es949.js";
6
- import { isDatesArray as a, isDateRange as A, isDayOfWeekType as C, isDateInterval as I, isDateAfterType as v, isDateBeforeType as F } from "./snorre.es759.js";
7
- function d(n, t, f = p) {
8
- const e = Array.isArray(t) ? t : [t];
9
- if (e.filter((o) => typeof o != "function").some((o) => typeof o == "boolean" ? o : f.isDate(o) ? l(n, o, !1, f) : a(o, f) ? o.some((r) => l(n, r, !1, f)) : A(o) ? o.from && o.to ? y(n, { from: o.from, to: o.to }, f) : !1 : C(o) ? M(n, o.dayOfWeek, f) : I(o) ? f.isAfter(o.before, o.after) ? y(n, {
10
- from: f.addDays(o.after, 1),
11
- to: f.addDays(o.before, -1)
12
- }, f) : s(n.from, o, f) || s(n.to, o, f) : v(o) || F(o) ? s(n.from, o, f) || s(n.to, o, f) : !1))
13
- return !0;
14
- const i = e.filter((o) => typeof o == "function");
15
- if (i.length) {
16
- let o = n.from;
17
- const r = f.differenceInCalendarDays(n.to, n.from);
18
- for (let u = 0; u <= r; u++) {
19
- if (i.some((D) => D(o)))
20
- return !0;
21
- o = f.addDays(o, 1);
22
- }
1
+ class a {
2
+ constructor(t, s) {
3
+ this.date = t, this.weeks = s;
23
4
  }
24
- return !1;
25
5
  }
26
6
  export {
27
- d as rangeContainsModifiers
7
+ a as CalendarMonth
28
8
  };
@@ -1,8 +1,8 @@
1
- import { rangeIncludesDate as m } from "./snorre.es758.js";
2
- import { defaultDateLib as r } from "./snorre.es741.js";
3
- function u(o, f, l = r) {
4
- return m(o, f.from, !1, l) || m(o, f.to, !1, l) || m(f, o.from, !1, l) || m(f, o.to, !1, l);
1
+ class t {
2
+ constructor(e, s) {
3
+ this.days = s, this.weekNumber = e;
4
+ }
5
5
  }
6
6
  export {
7
- u as rangeOverlaps
7
+ t as CalendarWeek
8
8
  };
@@ -1,8 +1,32 @@
1
- function e(o, r) {
2
- return e = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function(t, n) {
3
- return t.__proto__ = n, t;
4
- }, e(o, r);
1
+ import { defaultDateLib as p } from "./snorre.es741.js";
2
+ function y(o, D, n = 0, l = 0, r = !1, u = p) {
3
+ const { from: e, to: i } = D || {}, { isSameDay: s, isAfter: m, isBefore: c } = u;
4
+ let f;
5
+ if (!e && !i)
6
+ f = { from: o, to: n > 0 ? void 0 : o };
7
+ else if (e && !i)
8
+ s(e, o) ? r ? f = { from: e, to: void 0 } : f = void 0 : c(o, e) ? f = { from: o, to: e } : f = { from: e, to: o };
9
+ else if (e && i)
10
+ if (s(e, o) && s(i, o))
11
+ r ? f = { from: e, to: i } : f = void 0;
12
+ else if (s(e, o))
13
+ f = { from: e, to: n > 0 ? void 0 : o };
14
+ else if (s(i, o))
15
+ f = { from: o, to: n > 0 ? void 0 : o };
16
+ else if (c(o, e))
17
+ f = { from: o, to: i };
18
+ else if (m(o, e))
19
+ f = { from: e, to: o };
20
+ else if (m(o, i))
21
+ f = { from: e, to: o };
22
+ else
23
+ throw new Error("Invalid range");
24
+ if (f != null && f.from && (f != null && f.to)) {
25
+ const t = u.differenceInCalendarDays(f.to, f.from);
26
+ l > 0 && t > l ? f = { from: o, to: void 0 } : n > 1 && t < n && (f = { from: o, to: void 0 });
27
+ }
28
+ return f;
5
29
  }
6
30
  export {
7
- e as default
31
+ y as addToRange
8
32
  };
@@ -1,25 +1,15 @@
1
- import p from "./snorre.es1072.js";
2
- function o(r, n) {
3
- var e = Object.keys(r);
4
- if (Object.getOwnPropertySymbols) {
5
- var t = Object.getOwnPropertySymbols(r);
6
- n && (t = t.filter(function(c) {
7
- return Object.getOwnPropertyDescriptor(r, c).enumerable;
8
- })), e.push.apply(e, t);
1
+ import { defaultDateLib as f } from "./snorre.es741.js";
2
+ function y(t, r, e = f) {
3
+ const n = Array.isArray(r) ? r : [r];
4
+ let a = t.from;
5
+ const i = e.differenceInCalendarDays(t.to, t.from), s = Math.min(i, 6);
6
+ for (let o = 0; o <= s; o++) {
7
+ if (n.includes(a.getDay()))
8
+ return !0;
9
+ a = e.addDays(a, 1);
9
10
  }
10
- return e;
11
- }
12
- function i(r) {
13
- for (var n = 1; n < arguments.length; n++) {
14
- var e = arguments[n] != null ? arguments[n] : {};
15
- n % 2 ? o(Object(e), !0).forEach(function(t) {
16
- p(r, t, e[t]);
17
- }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(r, Object.getOwnPropertyDescriptors(e)) : o(Object(e)).forEach(function(t) {
18
- Object.defineProperty(r, t, Object.getOwnPropertyDescriptor(e, t));
19
- });
20
- }
21
- return r;
11
+ return !1;
22
12
  }
23
13
  export {
24
- i as default
14
+ y as rangeContainsDayOfWeek
25
15
  };
@@ -1,12 +1,28 @@
1
- function e(t) {
2
- t();
1
+ import { defaultDateLib as p } from "./snorre.es741.js";
2
+ import { dateMatchModifiers as s } from "./snorre.es939.js";
3
+ import { rangeContainsDayOfWeek as M } from "./snorre.es951.js";
4
+ import { rangeIncludesDate as l } from "./snorre.es758.js";
5
+ import { rangeOverlaps as y } from "./snorre.es953.js";
6
+ import { isDatesArray as a, isDateRange as A, isDayOfWeekType as C, isDateInterval as I, isDateAfterType as v, isDateBeforeType as F } from "./snorre.es759.js";
7
+ function d(n, t, f = p) {
8
+ const e = Array.isArray(t) ? t : [t];
9
+ if (e.filter((o) => typeof o != "function").some((o) => typeof o == "boolean" ? o : f.isDate(o) ? l(n, o, !1, f) : a(o, f) ? o.some((r) => l(n, r, !1, f)) : A(o) ? o.from && o.to ? y(n, { from: o.from, to: o.to }, f) : !1 : C(o) ? M(n, o.dayOfWeek, f) : I(o) ? f.isAfter(o.before, o.after) ? y(n, {
10
+ from: f.addDays(o.after, 1),
11
+ to: f.addDays(o.before, -1)
12
+ }, f) : s(n.from, o, f) || s(n.to, o, f) : v(o) || F(o) ? s(n.from, o, f) || s(n.to, o, f) : !1))
13
+ return !0;
14
+ const i = e.filter((o) => typeof o == "function");
15
+ if (i.length) {
16
+ let o = n.from;
17
+ const r = f.differenceInCalendarDays(n.to, n.from);
18
+ for (let u = 0; u <= r; u++) {
19
+ if (i.some((D) => D(o)))
20
+ return !0;
21
+ o = f.addDays(o, 1);
22
+ }
23
+ }
24
+ return !1;
3
25
  }
4
- var a = e, n = function(c) {
5
- return a = c;
6
- }, r = function() {
7
- return a;
8
- };
9
26
  export {
10
- r as getBatch,
11
- n as setBatch
27
+ d as rangeContainsModifiers
12
28
  };
@@ -1,10 +1,8 @@
1
- var t = process.env.NODE_ENV === "production", o = "Invariant failed";
2
- function c(a, r) {
3
- if (t)
4
- throw new Error(o);
5
- var n = typeof r == "function" ? r() : r, i = n ? "".concat(o, ": ").concat(n) : o;
6
- throw new Error(i);
1
+ import { rangeIncludesDate as m } from "./snorre.es758.js";
2
+ import { defaultDateLib as r } from "./snorre.es741.js";
3
+ function u(o, f, l = r) {
4
+ return m(o, f.from, !1, l) || m(o, f.to, !1, l) || m(f, o.from, !1, l) || m(f, o.to, !1, l);
7
5
  }
8
6
  export {
9
- c as default
7
+ u as rangeOverlaps
10
8
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bbl-digital/snorre",
3
- "version": "4.2.94",
3
+ "version": "4.2.96",
4
4
  "description": "Design library for BBL Digital",
5
5
  "license": "MIT",
6
6
  "main": "./dist/snorre.es.js",
@@ -11,6 +11,30 @@
11
11
  "types": "./dist/index.d.ts",
12
12
  "import": "./dist/snorre.es.js"
13
13
  },
14
+ "./v2": {
15
+ "types": "./dist/v2/index.d.ts",
16
+ "import": "./dist/v2/index.js"
17
+ },
18
+ "./utils": {
19
+ "types": "./dist/utils/index.d.ts",
20
+ "import": "./dist/utils/index.js"
21
+ },
22
+ "./layout": {
23
+ "types": "./dist/layout/index.d.ts",
24
+ "import": "./dist/layout/index.js"
25
+ },
26
+ "./illustrations": {
27
+ "types": "./dist/illustrations/index.d.ts",
28
+ "import": "./dist/illustrations/index.js"
29
+ },
30
+ "./globals": {
31
+ "types": "./dist/globals/index.d.ts",
32
+ "import": "./dist/globals/index.js"
33
+ },
34
+ "./enums": {
35
+ "types": "./dist/enums/index.d.ts",
36
+ "import": "./dist/enums/index.js"
37
+ },
14
38
  "./style.css": "./dist/style.css"
15
39
  },
16
40
  "repository": {
package/vite.config.js CHANGED
@@ -28,8 +28,7 @@ export default defineConfig({
28
28
  outDir: 'dist',
29
29
  copyPublicDir: false,
30
30
  lib: {
31
- entry: resolve(__dirname, 'src/packages/index.ts'),
32
- name: 'SNORRE',
31
+ entry: 'src/packages/index.ts',
33
32
  formats: ['es'],
34
33
  fileName: (format) => `snorre.${format}.js`,
35
34
  },