@cronocode/react-box 1.8.4 → 1.8.6

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cronocode/react-box",
3
- "version": "1.8.4",
3
+ "version": "1.8.6",
4
4
  "type": "module",
5
5
  "main": "./box.cjs",
6
6
  "module": "./box.mjs",
package/ssg.cjs CHANGED
@@ -1,4 +1,4 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const rs=require("./core.cjs"),ll=require("react");var xo={},So={};/**
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const rs=require("./core.cjs"),ll=require("react");require("./utils.cjs");var xo={},So={};/**
2
2
  * @license React
3
3
  * react-dom-server-legacy.browser.development.js
4
4
  *
package/ssg.mjs CHANGED
@@ -1,5 +1,6 @@
1
1
  import { S as rs } from "./core.mjs";
2
2
  import ll from "react";
3
+ import "./utils.mjs";
3
4
  var xo = {}, So = {};
4
5
  /**
5
6
  * @license React
@@ -9852,7 +9853,7 @@ const ns = {
9852
9853
  }
9853
9854
  };
9854
9855
  global.document = hs;
9855
- function ms(mt, U = !0) {
9856
+ function ys(mt, U = !0) {
9856
9857
  rs.clear();
9857
9858
  let G = xo.renderToStaticMarkup(mt);
9858
9859
  if (rs.flush(), U) {
@@ -9868,5 +9869,5 @@ function ms(mt, U = !0) {
9868
9869
  };
9869
9870
  }
9870
9871
  export {
9871
- ms as renderToStaticMarkup
9872
+ ys as renderToStaticMarkup
9872
9873
  };
package/theme.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";const e=require("./core.cjs");require("react");module.exports=e.Theme;
1
+ "use strict";const e=require("./core.cjs");require("react");require("./utils.cjs");module.exports=e.Theme;
package/theme.mjs CHANGED
@@ -1,5 +1,6 @@
1
- import { T as m } from "./core.mjs";
1
+ import { T as o } from "./core.mjs";
2
2
  import "react";
3
+ import "./utils.mjs";
3
4
  export {
4
- m as default
5
+ o as default
5
6
  };
@@ -2,5 +2,6 @@ declare namespace ObjectUtils {
2
2
  function buildProps<T extends {
3
3
  props?: Object;
4
4
  }, TKey extends keyof T>(props: T, keys: Readonly<TKey[]>, extraTagProps?: Object): T;
5
+ function isObject(value: unknown): value is object;
5
6
  }
6
7
  export default ObjectUtils;
package/utils.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";var h;(l=>{function p(f,o,c){const r={...f},s=r.props||{};return o.forEach(e=>{e in r&&(s[e]=r[e],delete r[e])}),c&&Object.entries(c).forEach(([e,t])=>{s[e]=t}),r.props=s,r}l.buildProps=p})(h||(h={}));const m=h;var a;(l=>{function p(o){const c=Array.from(o.elements).reduce((r,s)=>{const e=s.name;return e&&(r[e]||(r[e]=[]),r[e].push(s)),r},{});return Object.entries(c).reduce((r,[s,e])=>{if(e.length===1){const t=e[0];f(r,s,t.type==="checkbox"||t.type==="radio"?t.checked:t.value)}else{const t=e.reduce((n,i)=>(i.type==="checkbox"||i.type==="radio"?i.checked&&n.push(i.value):n.push(i.value),n),[]);f(r,s,t)}return r},{})}l.getFormEntries=p;function f(o,c,r){if(c.includes(".")){const s=c.split(".");let e=o;s.forEach((t,n)=>{if(s.length>n+1){const i=t.match(/^(.+)\[(\d)\]$/);if(i){const[,u,d]=i;e[u]=e[u]||[],e[u][d]=e[u][d]||{},e=e[u][d]}else e[t]=e[t]||{},e=e[t]}else e[t]=r})}else o[c]=r}})(a||(a={}));const b=a;exports.FormUtils=b;exports.ObjectUtils=m;
1
+ "use strict";var h;(f=>{function p(s,i,r){const c={...s},e=c.props||{};return i.forEach(t=>{t in c&&(e[t]=c[t],delete c[t])}),r&&Object.entries(r).forEach(([t,n])=>{e[t]=n}),c.props=e,c}f.buildProps=p;function l(s){return typeof s=="object"&&s!==null}f.isObject=l})(h||(h={}));const b=h;var a;(f=>{function p(s){const i=Array.from(s.elements).reduce((r,c)=>{const e=c.name;return e&&(r[e]||(r[e]=[]),r[e].push(c)),r},{});return Object.entries(i).reduce((r,[c,e])=>{if(e.length===1){const t=e[0];l(r,c,t.type==="checkbox"||t.type==="radio"?t.checked:t.value)}else{const t=e.reduce((n,o)=>(o.type==="checkbox"||o.type==="radio"?o.checked&&n.push(o.value):n.push(o.value),n),[]);l(r,c,t)}return r},{})}f.getFormEntries=p;function l(s,i,r){if(i.includes(".")){const c=i.split(".");let e=s;c.forEach((t,n)=>{if(c.length>n+1){const o=t.match(/^(.+)\[(\d)\]$/);if(o){const[,u,d]=o;e[u]=e[u]||[],e[u][d]=e[u][d]||{},e=e[u][d]}else e[t]=e[t]||{},e=e[t]}else e[t]=r})}else s[i]=r}})(a||(a={}));const m=a;exports.FormUtils=m;exports.ObjectUtils=b;
package/utils.mjs CHANGED
@@ -1,59 +1,63 @@
1
1
  var h;
2
- ((p) => {
3
- function l(f, i, c) {
4
- const r = { ...f }, s = r.props || {};
5
- return i.forEach((e) => {
6
- e in r && (s[e] = r[e], delete r[e]);
7
- }), c && Object.entries(c).forEach(([e, t]) => {
8
- s[e] = t;
9
- }), r.props = s, r;
2
+ ((f) => {
3
+ function l(o, n, t) {
4
+ const c = { ...o }, e = c.props || {};
5
+ return n.forEach((r) => {
6
+ r in c && (e[r] = c[r], delete c[r]);
7
+ }), t && Object.entries(t).forEach(([r, i]) => {
8
+ e[r] = i;
9
+ }), c.props = e, c;
10
10
  }
11
- p.buildProps = l;
11
+ f.buildProps = l;
12
+ function p(o) {
13
+ return typeof o == "object" && o !== null;
14
+ }
15
+ f.isObject = p;
12
16
  })(h || (h = {}));
13
- const m = h;
17
+ const b = h;
14
18
  var a;
15
- ((p) => {
16
- function l(i) {
17
- const c = Array.from(i.elements).reduce(
18
- (r, s) => {
19
- const e = s.name;
20
- return e && (r[e] || (r[e] = []), r[e].push(s)), r;
19
+ ((f) => {
20
+ function l(o) {
21
+ const n = Array.from(o.elements).reduce(
22
+ (t, c) => {
23
+ const e = c.name;
24
+ return e && (t[e] || (t[e] = []), t[e].push(c)), t;
21
25
  },
22
26
  {}
23
27
  );
24
- return Object.entries(c).reduce((r, [s, e]) => {
28
+ return Object.entries(n).reduce((t, [c, e]) => {
25
29
  if (e.length === 1) {
26
- const t = e[0];
27
- f(r, s, t.type === "checkbox" || t.type === "radio" ? t.checked : t.value);
30
+ const r = e[0];
31
+ p(t, c, r.type === "checkbox" || r.type === "radio" ? r.checked : r.value);
28
32
  } else {
29
- const t = e.reduce((n, o) => (o.type === "checkbox" || o.type === "radio" ? o.checked && n.push(o.value) : n.push(o.value), n), []);
30
- f(r, s, t);
33
+ const r = e.reduce((i, s) => (s.type === "checkbox" || s.type === "radio" ? s.checked && i.push(s.value) : i.push(s.value), i), []);
34
+ p(t, c, r);
31
35
  }
32
- return r;
36
+ return t;
33
37
  }, {});
34
38
  }
35
- p.getFormEntries = l;
36
- function f(i, c, r) {
37
- if (c.includes(".")) {
38
- const s = c.split(".");
39
- let e = i;
40
- s.forEach((t, n) => {
41
- if (s.length > n + 1) {
42
- const o = t.match(/^(.+)\[(\d)\]$/);
43
- if (o) {
44
- const [, u, d] = o;
39
+ f.getFormEntries = l;
40
+ function p(o, n, t) {
41
+ if (n.includes(".")) {
42
+ const c = n.split(".");
43
+ let e = o;
44
+ c.forEach((r, i) => {
45
+ if (c.length > i + 1) {
46
+ const s = r.match(/^(.+)\[(\d)\]$/);
47
+ if (s) {
48
+ const [, u, d] = s;
45
49
  e[u] = e[u] || [], e[u][d] = e[u][d] || {}, e = e[u][d];
46
50
  } else
47
- e[t] = e[t] || {}, e = e[t];
51
+ e[r] = e[r] || {}, e = e[r];
48
52
  } else
49
- e[t] = r;
53
+ e[r] = t;
50
54
  });
51
55
  } else
52
- i[c] = r;
56
+ o[n] = t;
53
57
  }
54
58
  })(a || (a = {}));
55
- const b = a;
59
+ const m = a;
56
60
  export {
57
- b as F,
58
- m as O
61
+ m as F,
62
+ b as O
59
63
  };