@nivaro/react 0.1.136 → 0.1.137

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/dist/index.js +17 -11
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -45604,7 +45604,7 @@ function U0() {
45604
45604
  function pS(t, n, a) {
45605
45605
  const s = t.split(".");
45606
45606
  if (s.length > 1) {
45607
- for (const l of s) {
45607
+ for (const l of [...s].reverse()) {
45608
45608
  const i = a.find(
45609
45609
  (d) => l === d.name || l === d.target_collection || `${l}s` === d.target_collection
45610
45610
  );
@@ -45617,17 +45617,23 @@ function pS(t, n, a) {
45617
45617
  function W0(t, n, a, s) {
45618
45618
  const l = t && Object.keys(t).length > 0 ? t : null;
45619
45619
  if (!l) return { tier: "unscoped", mismatches: [] };
45620
- let i = !1;
45621
- const d = [];
45622
- for (const o of n) {
45623
- if (o.id_value == null) continue;
45624
- const u = pS(o.field, s, a);
45625
- if (!u) continue;
45626
- const c = l[u.name];
45627
- if (!c || c.length === 0) continue;
45628
- c.some((p) => String(p) === String(o.id_value)) ? i = !0 : d.push(`doesn't cover ${u.label} ${String(o.value)}`);
45620
+ let i = !1, d = !1;
45621
+ const o = [];
45622
+ for (const u of n) {
45623
+ const c = pS(u.field, s, a);
45624
+ if (!c) continue;
45625
+ const m = l[c.name];
45626
+ if (!m || m.length === 0) continue;
45627
+ const p = /^\d+$/.test(String(u.value ?? ""));
45628
+ if (u.id_value == null && !p) {
45629
+ d = !0;
45630
+ continue;
45631
+ }
45632
+ (p ? m.some((f) => String(f) === String(u.value)) : m.some((f) => String(f) === String(u.id_value))) ? i = !0 : o.push(
45633
+ p ? `doesn't cover this cell's ${c.label}` : `doesn't cover ${c.label} ${String(u.value)}`
45634
+ );
45629
45635
  }
45630
- return d.length > 0 ? { tier: "out", mismatches: d } : { tier: i ? "suggested" : "unscoped", mismatches: [] };
45636
+ return o.length > 0 ? { tier: "out", mismatches: o } : { tier: i && !d ? "suggested" : "unscoped", mismatches: [] };
45631
45637
  }
45632
45638
  function bu(t) {
45633
45639
  return t === "suggested" ? 0 : t === "unscoped" ? 1 : 2;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nivaro/react",
3
- "version": "0.1.136",
3
+ "version": "0.1.137",
4
4
  "description": "React hooks and components for Nivaro CMS forms",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",