@ea-lab/reactive-json 1.1.0 → 1.1.2
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/component/action/CustomEventListener.js +2 -3
- package/dist/component/action/ReactOnEvent.js +2 -3
- package/dist/component/attributeTransformer/setAttributeValue.js +6 -7
- package/dist/component/attributeTransformer/toggleAttributeValue.js +14 -15
- package/dist/component/attributeTransformer/unsetAttributeValue.js +7 -8
- package/dist/component/element/debug/VariablesDebug/VariablesDebug.js +15 -16
- package/dist/component/index.js +1 -1
- package/dist/component/reaction/fetchData.js +1 -1
- package/dist/component/reaction/index.js +1 -1
- package/dist/component/reaction/submitData.js +1 -1
- package/dist/component/reaction/utility/httpRequestCommon.js +1 -1
- package/dist/component/reaction/utility/index.js +1 -1
- package/dist/engine/ReactiveJsonRoot.js +1 -1
- package/dist/httpRequestCommon-COBq6B-n.js +1857 -0
- package/dist/main.js +1 -1
- package/package.json +1 -1
- package/dist/assets/reset.css +0 -4
- package/dist/httpRequestCommon-vfSMynsl.js +0 -1805
|
@@ -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
|
|
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
|
-
|
|
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
|
|
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
|
-
|
|
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
|
|
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:
|
|
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
|
|
27
|
-
if (!s || !
|
|
28
|
-
const V = [...
|
|
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
|
-
|
|
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
|
|
18
|
-
const { name: p, value:
|
|
19
|
-
if (!p ||
|
|
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:
|
|
21
|
+
valueToEvaluate: u,
|
|
23
22
|
globalDataContext: V,
|
|
24
23
|
templateContext: g
|
|
25
|
-
}),
|
|
26
|
-
let l = [...f ? f.split(
|
|
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],
|
|
33
|
-
|
|
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,
|
|
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,
|
|
38
|
+
t = d, n = r;
|
|
40
39
|
break;
|
|
41
40
|
}
|
|
42
41
|
}
|
|
43
42
|
if (t > -1) {
|
|
44
|
-
const 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(
|
|
56
|
-
return c.trim() === "" ? h ? 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
|
-
|
|
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
|
|
18
|
-
const { name: s, value: m, separator:
|
|
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 =
|
|
28
|
-
valueToEvaluate:
|
|
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(
|
|
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(
|
|
55
|
+
const v = e.join(c);
|
|
57
56
|
return v.trim() === "" ? delete t[i] : t[i] = v, t;
|
|
58
57
|
};
|
|
59
58
|
export {
|
|
60
|
-
|
|
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
|
|
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
|
-
},
|
|
35
|
-
const [
|
|
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 ===
|
|
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} ${
|
|
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
|
-
|
|
70
|
+
r && /* @__PURE__ */ a(x, { children: [
|
|
72
71
|
/* @__PURE__ */ e(
|
|
73
72
|
"button",
|
|
74
73
|
{
|
|
75
|
-
className: `${n.btn} ${i ===
|
|
76
|
-
onClick: () => _(
|
|
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 ===
|
|
84
|
-
onClick: () => _(
|
|
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:
|
|
93
|
+
children: r ? "Collapse" : "Expand"
|
|
95
94
|
}
|
|
96
95
|
),
|
|
97
|
-
|
|
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
|
-
|
|
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
|
-
|
|
114
|
+
dt as VariablesDebug
|
|
116
115
|
};
|
package/dist/component/index.js
CHANGED
|
@@ -49,7 +49,7 @@ import { ReactiveJsonSubroot as Oe } from "./element/special/ReactiveJsonSubroot
|
|
|
49
49
|
import { Switch as ze } from "./element/special/Switch.js";
|
|
50
50
|
import { addData as Ke } from "./reaction/addData.js";
|
|
51
51
|
import { fetchData as Xe } from "./reaction/fetchData.js";
|
|
52
|
-
import { e as Ze } from "../httpRequestCommon-
|
|
52
|
+
import { e as Ze } from "../httpRequestCommon-COBq6B-n.js";
|
|
53
53
|
import { moveData as $e } from "./reaction/moveData.js";
|
|
54
54
|
import { postMessage as oo } from "./reaction/postMessage.js";
|
|
55
55
|
import { redirectNow as to } from "./reaction/redirectNow.js";
|
|
@@ -8,7 +8,7 @@ import { setClipboardData as p } from "./setClipboardData.js";
|
|
|
8
8
|
import { setData as i } from "./setData.js";
|
|
9
9
|
import { submitData as f } from "./submitData.js";
|
|
10
10
|
import { triggerEvent as s } from "./triggerEvent.js";
|
|
11
|
-
import { e as q } from "../../httpRequestCommon-
|
|
11
|
+
import { e as q } from "../../httpRequestCommon-COBq6B-n.js";
|
|
12
12
|
const R = {
|
|
13
13
|
addData: t,
|
|
14
14
|
fetchData: o,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { e as i } from "../../../httpRequestCommon-
|
|
1
|
+
import { e as i } from "../../../httpRequestCommon-COBq6B-n.js";
|
|
2
2
|
import "../../../engine/TemplateSystem.js";
|
|
3
3
|
import "../../../engine/utility/alterData.js";
|
|
4
4
|
import "../../../engine/utility/dataMappingSystem.js";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx as C, jsxs as L, Fragment as pt } from "react/jsx-runtime";
|
|
2
|
-
import { a as _ } from "../httpRequestCommon-
|
|
2
|
+
import { a as _ } from "../httpRequestCommon-COBq6B-n.js";
|
|
3
3
|
import { l as ut } from "../lodash-CYNxjS-I.js";
|
|
4
4
|
import { useReducer as dt, useState as w, useRef as ft, useEffect as q } from "react";
|
|
5
5
|
import { r as mt } from "../dnd-kit-sortable-tree.esm-Cz1RJyIg.js";
|