@ea-lab/reactive-json 1.1.0 → 1.1.1

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.
@@ -8,12 +8,11 @@ import "../../engine/EventDispatcherContext.js";
8
8
  import "../../engine/EventDispatcherProvider.js";
9
9
  import "../../engine/PaginationContext.js";
10
10
  import "../../dnd-kit-sortable-tree.esm-Cz1RJyIg.js";
11
- import '../../assets/reset.css';/* empty css */
12
11
  import "../../index-NNBvIV0S.js";
13
12
  import { replaceEventPlaceholders as E } from "../../engine/utility/eventPlaceholderSystem.js";
14
13
  import "../../js-yaml-Bw0KO4XO.js";
15
14
  import "../../engine/ParsingDebugDisplay/ParsingDebugDisplay.js";
16
- const k = (o) => {
15
+ const j = (o) => {
17
16
  const e = l(C), i = l(x), d = o.attributesHolderRef, n = e.plugins ?? {}, f = (n == null ? void 0 : n.reaction) ?? {}, t = (o == null ? void 0 : o.actionProps) ?? void 0;
18
17
  return v(() => {
19
18
  const p = t ?? void 0, m = (t == null ? void 0 : t.what) ?? void 0, c = (a) => {
@@ -30,5 +29,5 @@ const k = (o) => {
30
29
  }, [e, t, i]), o.children;
31
30
  };
32
31
  export {
33
- k as CustomEventListener
32
+ j as CustomEventListener
34
33
  };
@@ -8,12 +8,11 @@ import "../../engine/EventDispatcherContext.js";
8
8
  import "../../engine/EventDispatcherProvider.js";
9
9
  import "../../engine/PaginationContext.js";
10
10
  import "../../dnd-kit-sortable-tree.esm-Cz1RJyIg.js";
11
- import '../../assets/reset.css';/* empty css */
12
11
  import "../../index-NNBvIV0S.js";
13
12
  import { replaceEventPlaceholders as R } from "../../engine/utility/eventPlaceholderSystem.js";
14
13
  import "../../js-yaml-Bw0KO4XO.js";
15
14
  import "../../engine/ParsingDebugDisplay/ParsingDebugDisplay.js";
16
- const I = (p) => {
15
+ const H = (p) => {
17
16
  const s = f(E), g = f(j), e = s.plugins ?? {}, P = (e == null ? void 0 : e.reaction) ?? {}, { actionProps: F } = p, c = {};
18
17
  for (const [o, a] of Object.entries(F))
19
18
  c[o] = (t) => {
@@ -43,5 +42,5 @@ const I = (p) => {
43
42
  return /* @__PURE__ */ C(b, { children: x });
44
43
  };
45
44
  export {
46
- I as ReactOnEvent
45
+ H as ReactOnEvent
47
46
  };
@@ -10,27 +10,26 @@ import "../../engine/EventDispatcherProvider.js";
10
10
  import "../../engine/PaginationContext.js";
11
11
  import "../../dnd-kit-sortable-tree.esm-Cz1RJyIg.js";
12
12
  import { normalizeAttributeNameForReactJsx as d } from "../../engine/utility/reactJsxHelpers.js";
13
- import '../../assets/reset.css';/* empty css */
14
13
  import "../../index-NNBvIV0S.js";
15
14
  import "../../js-yaml-Bw0KO4XO.js";
16
15
  import "../../engine/ParsingDebugDisplay/ParsingDebugDisplay.js";
17
- const q = ({ attributes: e, globalDataContext: a, singleTransformProps: i, templateContext: l }) => {
16
+ const k = ({ attributes: e, globalDataContext: p, singleTransformProps: i, templateContext: l }) => {
18
17
  const { name: n, mode: u = "append", value: c, preventDuplicateValues: s = !0, separator: r = " " } = i, t = v({
19
18
  valueToEvaluate: c,
20
- globalDataContext: a,
19
+ globalDataContext: p,
21
20
  templateContext: l
22
21
  }), o = d(n);
23
22
  if (u === "replace")
24
23
  e[o] = t;
25
24
  else {
26
- const m = e[o] || "", p = m ? m.split(r) : [];
27
- if (!s || !p.includes(t)) {
28
- const V = [...p, t];
25
+ const a = e[o] || "", m = a ? a.split(r) : [];
26
+ if (!s || !m.includes(t)) {
27
+ const V = [...m, t];
29
28
  e[o] = V.join(r);
30
29
  }
31
30
  }
32
31
  return e;
33
32
  };
34
33
  export {
35
- q as setAttributeValue
34
+ k as setAttributeValue
36
35
  };
@@ -10,38 +10,37 @@ import "../../engine/EventDispatcherProvider.js";
10
10
  import "../../engine/PaginationContext.js";
11
11
  import "../../dnd-kit-sortable-tree.esm-Cz1RJyIg.js";
12
12
  import { normalizeAttributeNameForReactJsx as A } from "../../engine/utility/reactJsxHelpers.js";
13
- import '../../assets/reset.css';/* empty css */
14
13
  import "../../index-NNBvIV0S.js";
15
14
  import "../../js-yaml-Bw0KO4XO.js";
16
15
  import "../../engine/ParsingDebugDisplay/ParsingDebugDisplay.js";
17
- const B = ({ attributes: o, globalDataContext: V, singleTransformProps: x, templateContext: g }) => {
18
- const { name: p, value: m, separator: u = " ", keepAttributeWhenEmpty: h = !1 } = x || {};
19
- if (!p || m === void 0)
16
+ const q = ({ attributes: o, globalDataContext: V, singleTransformProps: x, templateContext: g }) => {
17
+ const { name: p, value: u, separator: m = " ", keepAttributeWhenEmpty: h = !1 } = x || {};
18
+ if (!p || u === void 0)
20
19
  return o;
21
20
  const s = v({
22
- valueToEvaluate: m,
21
+ valueToEvaluate: u,
23
22
  globalDataContext: V,
24
23
  templateContext: g
25
- }), n = A(p), f = o[n] || "";
26
- let l = [...f ? f.split(u).filter((e) => e.trim() !== "") : []];
24
+ }), i = A(p), f = o[i] || "";
25
+ let l = [...f ? f.split(m).filter((e) => e.trim() !== "") : []];
27
26
  if (Array.isArray(s)) {
28
27
  const e = s.map((t) => String(t));
29
28
  if (e.length === 0)
30
29
  return o;
31
30
  if (e.length === 1) {
32
- const t = e[0], i = l.indexOf(t);
33
- i > -1 ? l.splice(i, 1) : t !== "" && l.push(t);
31
+ const t = e[0], n = l.indexOf(t);
32
+ n > -1 ? l.splice(n, 1) : t !== "" && l.push(t);
34
33
  } else {
35
- let t = -1, i = -1;
34
+ let t = -1, n = -1;
36
35
  for (let r = 0; r < e.length; r++) {
37
36
  const a = e[r], d = l.indexOf(a);
38
37
  if (d > -1) {
39
- t = d, i = r;
38
+ t = d, n = r;
40
39
  break;
41
40
  }
42
41
  }
43
42
  if (t > -1) {
44
- const r = (i + 1) % e.length, a = e[r];
43
+ const r = (n + 1) % e.length, a = e[r];
45
44
  l.splice(t, 1), a !== "" && l.push(a);
46
45
  } else {
47
46
  const r = e[0];
@@ -52,9 +51,9 @@ const B = ({ attributes: o, globalDataContext: V, singleTransformProps: x, templ
52
51
  const e = String(s), t = l.indexOf(e);
53
52
  t > -1 ? l.splice(t, 1) : l.push(e);
54
53
  }
55
- const c = l.join(u);
56
- return c.trim() === "" ? h ? o[n] = "" : delete o[n] : o[n] = c, o;
54
+ const c = l.join(m);
55
+ return c.trim() === "" ? h ? o[i] = "" : delete o[i] : o[i] = c, o;
57
56
  };
58
57
  export {
59
- B as toggleAttributeValue
58
+ q as toggleAttributeValue
60
59
  };
@@ -10,12 +10,11 @@ import "../../engine/EventDispatcherProvider.js";
10
10
  import "../../engine/PaginationContext.js";
11
11
  import "../../dnd-kit-sortable-tree.esm-Cz1RJyIg.js";
12
12
  import { normalizeAttributeNameForReactJsx as w } from "../../engine/utility/reactJsxHelpers.js";
13
- import '../../assets/reset.css';/* empty css */
14
13
  import "../../index-NNBvIV0S.js";
15
14
  import "../../js-yaml-Bw0KO4XO.js";
16
15
  import "../../engine/ParsingDebugDisplay/ParsingDebugDisplay.js";
17
- const B = ({ attributes: t, globalDataContext: l, singleTransformProps: A, templateContext: a }) => {
18
- const { name: s, value: m, separator: p = " ", unsetAllOccurrences: C, unsetCount: c } = A || {};
16
+ const y = ({ attributes: t, globalDataContext: l, singleTransformProps: A, templateContext: a }) => {
17
+ const { name: s, value: m, separator: c = " ", unsetAllOccurrences: C, unsetCount: p } = A || {};
19
18
  if (!s || m === void 0)
20
19
  return t;
21
20
  const n = String(
@@ -24,14 +23,14 @@ const B = ({ attributes: t, globalDataContext: l, singleTransformProps: A, templ
24
23
  globalDataContext: l,
25
24
  templateContext: a
26
25
  })
27
- ), u = c !== void 0 ? V({
28
- valueToEvaluate: c,
26
+ ), u = p !== void 0 ? V({
27
+ valueToEvaluate: p,
29
28
  globalDataContext: l,
30
29
  templateContext: a
31
30
  }) : void 0, i = w(s), f = t[i] || "";
32
31
  if (!f)
33
32
  return t;
34
- let e = [...f.split(p)];
33
+ let e = [...f.split(c)];
35
34
  (() => {
36
35
  if (C === !0) {
37
36
  e = e.filter((r) => r !== n);
@@ -53,9 +52,9 @@ const B = ({ attributes: t, globalDataContext: l, singleTransformProps: A, templ
53
52
  let d = 0;
54
53
  e = e.reverse().filter((r) => r === n && d < N ? (d++, !1) : !0).reverse();
55
54
  })();
56
- const v = e.join(p);
55
+ const v = e.join(c);
57
56
  return v.trim() === "" ? delete t[i] : t[i] = v, t;
58
57
  };
59
58
  export {
60
- B as unsetAttributeValue
59
+ y as unsetAttributeValue
61
60
  };
@@ -12,12 +12,11 @@ import "../../../../index-NNBvIV0S.js";
12
12
  import "../../../../jsonpath-B9kE9k9e.js";
13
13
  import "../../../../js-yaml-Bw0KO4XO.js";
14
14
  import "../../../../engine/ParsingDebugDisplay/ParsingDebugDisplay.js";
15
- import { DebugMode as r } from "./DebugMode.enum.js";
15
+ import { DebugMode as c } from "./DebugMode.enum.js";
16
16
  import R from "./ModeDisplay/DebugList/DebugList.js";
17
17
  import D from "./ModeDisplay/DebugJson/DebugJson.js";
18
- import '../../../../assets/reset.css';import '../../../../assets/VariablesDebug.css';/* empty css */
19
18
  import { flattenObject as J } from "./utils.js";
20
- const O = "_debugRoot_1ny7q_1", j = "_container_1ny7q_16", k = "_expanded_1ny7q_34", T = "_header_1ny7q_39", I = "_actions_1ny7q_45", P = "_btn_1ny7q_50", M = "_active_1ny7q_58", w = "_path_1ny7q_62", A = "_value_1ny7q_66", H = "_copyBtn_1ny7q_70", V = "_copyBtnSuccess_1ny7q_74", F = "_copyBtnError_1ny7q_78", W = "_info_1ny7q_82", n = {
19
+ import '../../../../assets/VariablesDebug.css';const O = "_debugRoot_1ny7q_1", j = "_container_1ny7q_16", k = "_expanded_1ny7q_34", T = "_header_1ny7q_39", I = "_actions_1ny7q_45", P = "_btn_1ny7q_50", M = "_active_1ny7q_58", w = "_path_1ny7q_62", A = "_value_1ny7q_66", H = "_copyBtn_1ny7q_70", V = "_copyBtnSuccess_1ny7q_74", F = "_copyBtnError_1ny7q_78", W = "_info_1ny7q_82", n = {
21
20
  debugRoot: O,
22
21
  container: j,
23
22
  expanded: k,
@@ -31,8 +30,8 @@ const O = "_debugRoot_1ny7q_1", j = "_container_1ny7q_16", k = "_expanded_1ny7q_
31
30
  copyBtnSuccess: V,
32
31
  copyBtnError: F,
33
32
  info: W
34
- }, pt = ({ props: v }) => {
35
- const [c, u] = p(!1), [i, _] = p(r.LIST), o = B($), d = g(null), [y, S] = p(null), f = g(null);
33
+ }, dt = ({ props: v }) => {
34
+ const [r, u] = p(!1), [i, _] = p(c.LIST), o = B($), d = g(null), [y, S] = p(null), f = g(null);
36
35
  q(() => {
37
36
  if (typeof document > "u") return;
38
37
  let t = document.getElementById("rj-debug-root");
@@ -42,7 +41,7 @@ const O = "_debugRoot_1ny7q_1", j = "_container_1ny7q_16", k = "_expanded_1ny7q_
42
41
  const t = d.current;
43
42
  try {
44
43
  if (await navigator.clipboard.writeText(
45
- i === r.JSON ? b : h.map((s) => `${s.path}: ${JSON.stringify(s.value)}`).join(`
44
+ i === c.JSON ? b : h.map((s) => `${s.path}: ${JSON.stringify(s.value)}`).join(`
46
45
  `)
47
46
  ), !t) return;
48
47
  t.classList.add(n.copyBtnSuccess), t.textContent = "Copied!", setTimeout(() => {
@@ -57,7 +56,7 @@ const O = "_debugRoot_1ny7q_1", j = "_container_1ny7q_16", k = "_expanded_1ny7q_
57
56
  }, N = /* @__PURE__ */ e(L, { ...v, attributesHolderRef: f, children: /* @__PURE__ */ a(
58
57
  "div",
59
58
  {
60
- className: `${n.container} ${c ? n.expanded : ""}`,
59
+ className: `${n.container} ${r ? n.expanded : ""}`,
61
60
  onClick: () => u((t) => !t),
62
61
  role: "button",
63
62
  ref: f,
@@ -68,20 +67,20 @@ const O = "_debugRoot_1ny7q_1", j = "_container_1ny7q_16", k = "_expanded_1ny7q_
68
67
  /* @__PURE__ */ e("code", { children: o.templatePath })
69
68
  ] }),
70
69
  /* @__PURE__ */ a("div", { className: n.actions, onClick: (t) => t.stopPropagation(), children: [
71
- c && /* @__PURE__ */ a(x, { children: [
70
+ r && /* @__PURE__ */ a(x, { children: [
72
71
  /* @__PURE__ */ e(
73
72
  "button",
74
73
  {
75
- className: `${n.btn} ${i === r.LIST ? n.active : ""}`,
76
- onClick: () => _(r.LIST),
74
+ className: `${n.btn} ${i === c.LIST ? n.active : ""}`,
75
+ onClick: () => _(c.LIST),
77
76
  children: "List"
78
77
  }
79
78
  ),
80
79
  /* @__PURE__ */ e(
81
80
  "button",
82
81
  {
83
- className: `${n.btn} ${i === r.JSON ? n.active : ""}`,
84
- onClick: () => _(r.JSON),
82
+ className: `${n.btn} ${i === c.JSON ? n.active : ""}`,
83
+ onClick: () => _(c.JSON),
85
84
  children: "JSON"
86
85
  }
87
86
  )
@@ -91,10 +90,10 @@ const O = "_debugRoot_1ny7q_1", j = "_container_1ny7q_16", k = "_expanded_1ny7q_
91
90
  {
92
91
  className: n.btn,
93
92
  onClick: () => u((t) => !t),
94
- children: c ? "Collapse" : "Expand"
93
+ children: r ? "Collapse" : "Expand"
95
94
  }
96
95
  ),
97
- c && /* @__PURE__ */ e(
96
+ r && /* @__PURE__ */ e(
98
97
  "button",
99
98
  {
100
99
  className: `${n.btn} ${n.copyBtn}`,
@@ -105,12 +104,12 @@ const O = "_debugRoot_1ny7q_1", j = "_container_1ny7q_16", k = "_expanded_1ny7q_
105
104
  )
106
105
  ] })
107
106
  ] }),
108
- c && /* @__PURE__ */ e("div", { className: n.info, onClick: (t) => t.stopPropagation(), children: i === r.JSON ? /* @__PURE__ */ e(D, { jsonString: b }) : /* @__PURE__ */ e(R, { flatRows: h }) })
107
+ r && /* @__PURE__ */ e("div", { className: n.info, onClick: (t) => t.stopPropagation(), children: i === c.JSON ? /* @__PURE__ */ e(D, { jsonString: b }) : /* @__PURE__ */ e(R, { flatRows: h }) })
109
108
  ]
110
109
  }
111
110
  ) });
112
111
  return y ? E.createPortal(N, y) : null;
113
112
  };
114
113
  export {
115
- pt as VariablesDebug
114
+ dt as VariablesDebug
116
115
  };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@ea-lab/reactive-json",
3
3
  "private": false,
4
- "version": "1.1.0",
4
+ "version": "1.1.1",
5
5
  "type": "module",
6
6
  "repository": {
7
7
  "type": "git",
@@ -1,4 +0,0 @@
1
- /*!
2
- https://serp.co/tools/css-reset/
3
- <link rel="stylesheet" href="https://css.serp.co/css-reset/normalize.css/">
4
- */html{line-height:1.15;-webkit-text-size-adjust:100%}body{margin:0}main{display:block}h1{font-size:2em;margin:.67em 0}hr{box-sizing:content-box;height:0;overflow:visible}pre{font-family:monospace,monospace;font-size:1em}a{background-color:transparent}abbr[title]{border-bottom:none;text-decoration:underline;text-decoration:underline dotted}b,strong{font-weight:bolder}code,kbd,samp{font-family:monospace,monospace;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}img{border-style:none}button,input,optgroup,select,textarea{font-family:inherit;font-size:100%;line-height:1.15;margin:0}button,input{overflow:visible}button,select{text-transform:none}button,[type=button],[type=reset],[type=submit]{-webkit-appearance:button}button::-moz-focus-inner,[type=button]::-moz-focus-inner,[type=reset]::-moz-focus-inner,[type=submit]::-moz-focus-inner{border-style:none;padding:0}button:-moz-focusring,[type=button]:-moz-focusring,[type=reset]:-moz-focusring,[type=submit]:-moz-focusring{outline:1px dotted ButtonText}fieldset{padding:.35em .75em .625em}legend{box-sizing:border-box;color:inherit;display:table;max-width:100%;padding:0;white-space:normal}progress{vertical-align:baseline}textarea{overflow:auto}[type=checkbox],[type=radio]{box-sizing:border-box;padding:0}[type=number]::-webkit-inner-spin-button,[type=number]::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}[type=search]::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}details{display:block}summary{display:list-item}template{display:none}[hidden]{display:none}