@ea-lab/reactive-json 1.0.0-alpha.1 → 1.0.0-alpha.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.
@@ -4,26 +4,26 @@ import { l as _ } from "../../../lodash-CYNxjS-I.js";
4
4
  import { useContext as A, forwardRef as R } from "react";
5
5
  import { ActionDependant as G } from "../../../engine/Actions.js";
6
6
  import { GlobalDataContext as H } from "../../../engine/GlobalDataContext.js";
7
- import { TemplateContext as V } from "../../../engine/TemplateContext.js";
7
+ import { TemplateContext as y } from "../../../engine/TemplateContext.js";
8
8
  import { evaluateTemplateValue as O } from "../../../engine/TemplateSystem.js";
9
- import { V as W } from "../../../View-D8TN1L2h.js";
9
+ import { View as W } from "../../../engine/View.js";
10
10
  import { propsDataLocationToPathAndValue as q } from "../../../engine/utility/formElementsCommon.js";
11
- function y(t) {
11
+ function V(t) {
12
12
  var r, n, a = "";
13
13
  if (typeof t == "string" || typeof t == "number") a += t;
14
14
  else if (typeof t == "object") if (Array.isArray(t)) {
15
15
  var s = t.length;
16
- for (r = 0; r < s; r++) t[r] && (n = y(t[r])) && (a && (a += " "), a += n);
16
+ for (r = 0; r < s; r++) t[r] && (n = V(t[r])) && (a && (a += " "), a += n);
17
17
  } else for (n in t) t[n] && (a && (a += " "), a += n);
18
18
  return a;
19
19
  }
20
20
  function z() {
21
- for (var t, r, n = 0, a = "", s = arguments.length; n < s; n++) (t = arguments[n]) && (r = y(t)) && (a && (a += " "), a += r);
21
+ for (var t, r, n = 0, a = "", s = arguments.length; n < s; n++) (t = arguments[n]) && (r = V(t)) && (a && (a += " "), a += r);
22
22
  return a;
23
23
  }
24
24
  const ae = ({ props: t, path: r, datafield: n }) => {
25
25
  var P, T;
26
- const a = A(H), s = A(V);
26
+ const a = A(H), s = A(y);
27
27
  let { formData: i, formDataPath: u } = q({
28
28
  currentPath: r,
29
29
  datafield: n,
@@ -100,7 +100,7 @@ const ae = ({ props: t, path: r, datafield: n }) => {
100
100
  "data-htmlbuilder-tree-item-is-last": e.isLast,
101
101
  ref: m,
102
102
  children: /* @__PURE__ */ h(
103
- V.Provider,
103
+ y.Provider,
104
104
  {
105
105
  value: {
106
106
  templateData: o,
@@ -1,11 +1,59 @@
1
- import "react/jsx-runtime";
2
- import "react";
3
- import "../../../engine/Actions.js";
4
- import "../../../engine/GlobalDataContext.js";
5
- import "../../../engine/utility/reactJsxHelpers.js";
6
- import "../../../engine/TemplateContext.js";
7
- import "../../../engine/TemplateSystem.js";
8
- import { H as f } from "../../../View-D8TN1L2h.js";
1
+ import { jsx as o, jsxs as d, Fragment as u } from "react/jsx-runtime";
2
+ import { useContext as b, useRef as A } from "react";
3
+ import { ActionDependant as C } from "../../../engine/Actions.js";
4
+ import { GlobalDataContext as T } from "../../../engine/GlobalDataContext.js";
5
+ import { normalizeAttributesForReactJsx as g } from "../../../engine/utility/reactJsxHelpers.js";
6
+ import { TemplateContext as j } from "../../../engine/TemplateContext.js";
7
+ import { evaluateAttributes as k } from "../../../engine/TemplateSystem.js";
8
+ import { View as c } from "../../../engine/View.js";
9
+ const N = ({ props: e, currentData: m, datafield: v, path: x }) => {
10
+ const h = b(T), p = b(j), i = A(null), l = `${e.tag}`, r = e.extra ?? {}, n = g(e.attributes), a = g(m.attributes);
11
+ for (const t of Object.keys(a)) {
12
+ if (t.charAt(0) === "+") {
13
+ const s = t.substring(1);
14
+ n[s] = (n[s] ?? "").length > 0 ? (
15
+ // Append using a space.
16
+ " " + a[t]
17
+ ) : (
18
+ // Set directly.
19
+ a[t]
20
+ );
21
+ continue;
22
+ }
23
+ n[t] = a[t];
24
+ }
25
+ const f = k({ attrs: n, globalDataContext: h, templateContext: p });
26
+ return /* @__PURE__ */ o(C, { ...e, attributesHolderRef: i, children: ((t) => t && [
27
+ "area",
28
+ "base",
29
+ "br",
30
+ "col",
31
+ "embed",
32
+ "hr",
33
+ "img",
34
+ "input",
35
+ "link",
36
+ "meta",
37
+ "param",
38
+ "source",
39
+ "track",
40
+ "wbr"
41
+ ].indexOf(t) !== -1)(e.tag) ? /* @__PURE__ */ d(u, { children: [
42
+ /* @__PURE__ */ o(l, { ref: i, ...f }),
43
+ Object.keys(r).length ? /* @__PURE__ */ o(c, { props: r }) : ""
44
+ ] }) : /* @__PURE__ */ d(u, { children: [
45
+ /* @__PURE__ */ o(l, { ref: i, ...f, children: e.content && /* @__PURE__ */ o(
46
+ c,
47
+ {
48
+ currentData: m.content ?? void 0,
49
+ datafield: "content",
50
+ path: x + ".content",
51
+ props: e.content
52
+ }
53
+ ) }),
54
+ Object.keys(r).length ? /* @__PURE__ */ o(c, { props: r }) : ""
55
+ ] }) });
56
+ };
9
57
  export {
10
- f as Html
58
+ N as Html
11
59
  };
@@ -2,11 +2,11 @@ import { jsx as u } from "react/jsx-runtime";
2
2
  import { useContext as f } from "react";
3
3
  import { ActionDependant as D } from "../../../engine/Actions.js";
4
4
  import { GlobalDataContext as x } from "../../../engine/GlobalDataContext.js";
5
- import { TemplateContext as V } from "../../../engine/TemplateContext.js";
5
+ import { TemplateContext as b } from "../../../engine/TemplateContext.js";
6
6
  import { evaluateTemplateValue as c } from "../../../engine/TemplateSystem.js";
7
- import { V as b } from "../../../View-D8TN1L2h.js";
7
+ import { View as V } from "../../../engine/View.js";
8
8
  const O = ({ currentData: s, datafield: o, path: v, props: e }) => {
9
- const n = f(x), t = f(V), m = e.dynamicOptions ?? void 0;
9
+ const n = f(x), t = f(b), m = e.dynamicOptions ?? void 0;
10
10
  let i;
11
11
  m ? i = c({ valueToEvaluate: m, globalDataContext: n, templateContext: t }) ?? [] : i = e.options ?? [];
12
12
  let a;
@@ -22,7 +22,7 @@ const O = ({ currentData: s, datafield: o, path: v, props: e }) => {
22
22
  return null;
23
23
  l = a;
24
24
  }
25
- return /* @__PURE__ */ u(D, { ...e, children: /* @__PURE__ */ u(b, { currentData: s, datafield: o, path: v, props: l.label }) });
25
+ return /* @__PURE__ */ u(D, { ...e, children: /* @__PURE__ */ u(V, { currentData: s, datafield: o, path: v, props: l.label }) });
26
26
  };
27
27
  export {
28
28
  O as LabelFromValue
@@ -1,6 +1,6 @@
1
1
  import { FolderSortableTree as o } from "./FolderSortableTree.js";
2
2
  import { FormatNumeral as m } from "./FormatNumeral.js";
3
- import { H as l } from "../../../View-D8TN1L2h.js";
3
+ import { Html as l } from "./Html.js";
4
4
  import { LabelFromValue as f } from "./LabelFromValue.js";
5
5
  import { PreformattedMarkup as u } from "./PreformattedMarkup.js";
6
6
  import { SortableTreeItemCollapseButton as F } from "./SortableTreeItemCollapseButton.js";
@@ -1,10 +1,10 @@
1
1
  import "../../index-CACLSxWi.js";
2
- import "../../index-B3RKTGQ2.js";
3
- import { R as m, c as a } from "../../index-BYLJtf9L.js";
2
+ import "../../index-BNvY8PkY.js";
3
+ import { R as m, c as a } from "../../index-CBEHeXej.js";
4
4
  import { VariablesDebug as f } from "./debug/VariablesDebug/VariablesDebug.js";
5
5
  import { FolderSortableTree as n } from "./html/FolderSortableTree.js";
6
- import { FormatNumeral as s } from "./html/FormatNumeral.js";
7
- import { H as c } from "../../View-D8TN1L2h.js";
6
+ import { FormatNumeral as i } from "./html/FormatNumeral.js";
7
+ import { Html as c } from "./html/Html.js";
8
8
  import { LabelFromValue as b } from "./html/LabelFromValue.js";
9
9
  import { PreformattedMarkup as F } from "./html/PreformattedMarkup.js";
10
10
  import { SortableTreeItemCollapseButton as S } from "./html/SortableTreeItemCollapseButton.js";
@@ -12,24 +12,24 @@ import { Count as g } from "./special/Count.js";
12
12
  import { DataFilter as P } from "./special/DataFilter.js";
13
13
  import { DelayedActions as h, getReactionFunctionsToExecute as v } from "./special/DelayedActions.js";
14
14
  import { PageControls as E } from "./special/PageControls.js";
15
- import { Phantom as J } from "./special/Phantom.js";
16
- import { ReactiveJsonBasicComponentWrapper as k } from "./special/ReactiveJsonBasicComponentWrapper.js";
17
- import { Switch as y } from "./special/Switch.js";
15
+ import { Phantom as V } from "./special/Phantom.js";
16
+ import { ReactiveJsonBasicComponentWrapper as w } from "./special/ReactiveJsonBasicComponentWrapper.js";
17
+ import { Switch as A } from "./special/Switch.js";
18
18
  export {
19
19
  g as Count,
20
20
  P as DataFilter,
21
21
  h as DelayedActions,
22
22
  n as FolderSortableTree,
23
- s as FormatNumeral,
23
+ i as FormatNumeral,
24
24
  c as Html,
25
25
  b as LabelFromValue,
26
26
  E as PageControls,
27
- J as Phantom,
27
+ V as Phantom,
28
28
  F as PreformattedMarkup,
29
- k as ReactiveJsonBasicComponentWrapper,
29
+ w as ReactiveJsonBasicComponentWrapper,
30
30
  m as ReactiveJsonSubroot,
31
31
  S as SortableTreeItemCollapseButton,
32
- y as Switch,
32
+ A as Switch,
33
33
  f as VariablesDebug,
34
34
  a as coreElementComponents,
35
35
  v as getReactionFunctionsToExecute
@@ -3,7 +3,7 @@ import { useContext as b } from "react";
3
3
  import { isValid as P } from "../../../engine/Actions.js";
4
4
  import { GlobalDataContext as D } from "../../../engine/GlobalDataContext.js";
5
5
  import { TemplateContext as x } from "../../../engine/TemplateContext.js";
6
- import { V as v } from "../../../View-D8TN1L2h.js";
6
+ import { View as v } from "../../../engine/View.js";
7
7
  const W = (t) => {
8
8
  var u, f;
9
9
  const o = b(D), e = b(x), n = { globalDataContext: o, templateContext: e }, { contextToFilter: l = "global", filters: y = [] } = t.props, s = (p) => {
@@ -3,8 +3,8 @@ import { useContext as m, useEffect as x } from "react";
3
3
  import { ActionDependant as v, isValid as A } from "../../../engine/Actions.js";
4
4
  import { GlobalDataContext as F } from "../../../engine/GlobalDataContext.js";
5
5
  import { TemplateContext as h } from "../../../engine/TemplateContext.js";
6
- import { V as y } from "../../../View-D8TN1L2h.js";
7
- const V = ({ props: t, currentData: e, path: i }) => {
6
+ import { View as y } from "../../../engine/View.js";
7
+ const p = ({ props: t, currentData: e, path: i }) => {
8
8
  const c = m(F), n = m(h), a = Array.isArray(t.delayedActions) ? t.delayedActions : [], o = { globalDataContext: c, templateContext: n };
9
9
  return x(() => {
10
10
  if (!t.interval)
@@ -44,6 +44,6 @@ const V = ({ props: t, currentData: e, path: i }) => {
44
44
  return i;
45
45
  };
46
46
  export {
47
- V as DelayedActions,
47
+ p as DelayedActions,
48
48
  g as getReactionFunctionsToExecute
49
49
  };
@@ -1,6 +1,6 @@
1
1
  import { jsx as n } from "react/jsx-runtime";
2
2
  import { ActionDependant as i } from "../../../engine/Actions.js";
3
- import { V as m } from "../../../View-D8TN1L2h.js";
3
+ import { View as m } from "../../../engine/View.js";
4
4
  const p = ({ props: o, currentData: t, path: e }) => /* @__PURE__ */ n(i, { ...o, children: o.content && /* @__PURE__ */ n(
5
5
  m,
6
6
  {
@@ -10,15 +10,15 @@ import "../../../dnd-kit-sortable-tree.esm-Cz1RJyIg.js";
10
10
  import "../../../engine/TemplateContext.js";
11
11
  import { useEvaluatedAttributes as p } from "../../../engine/TemplateSystem.js";
12
12
  import '../../../assets/reset.css';/* empty css */
13
- import { V as a } from "../../../View-D8TN1L2h.js";
13
+ import { View as c } from "../../../engine/View.js";
14
14
  import "../../../index-NNBvIV0S.js";
15
15
  import "../../../jsonpath-B9kE9k9e.js";
16
16
  import "../../../js-yaml-Bw0KO4XO.js";
17
17
  import "../../../engine/ParsingDebugDisplay/ParsingDebugDisplay.js";
18
- function R({ props: t, currentData: i, path: e, reactComponent: o }) {
18
+ function V({ props: t, currentData: i, path: e, reactComponent: o }) {
19
19
  const n = p(t.attributes);
20
20
  return o ? /* @__PURE__ */ r(m, { ...t, children: /* @__PURE__ */ r(o, { ...n, children: t.content && /* @__PURE__ */ r(
21
- a,
21
+ c,
22
22
  {
23
23
  currentData: i.content ?? void 0,
24
24
  datafield: "content",
@@ -28,5 +28,5 @@ function R({ props: t, currentData: i, path: e, reactComponent: o }) {
28
28
  ) }) }) : null;
29
29
  }
30
30
  export {
31
- R as ReactiveJsonBasicComponentWrapper
31
+ V as ReactiveJsonBasicComponentWrapper
32
32
  };
@@ -4,7 +4,7 @@ import "../../../engine/EventDispatcherContext.js";
4
4
  import "../../../engine/EventDispatcherProvider.js";
5
5
  import "../../../engine/GlobalDataContext.js";
6
6
  import "../../../engine/PaginationContext.js";
7
- import { R as u } from "../../../index-BYLJtf9L.js";
7
+ import { R as u } from "../../../index-CBEHeXej.js";
8
8
  import "../../../engine/TemplateContext.js";
9
9
  import "../../../engine/TemplateSystem.js";
10
10
  import "../../../lodash-CYNxjS-I.js";
@@ -1,19 +1,19 @@
1
- import { jsx as a, jsxs as y, Fragment as W } from "react/jsx-runtime";
1
+ import { jsx as i, jsxs as y, Fragment as W } from "react/jsx-runtime";
2
2
  import { useContext as T, createElement as A } from "react";
3
3
  import { ActionDependant as L } from "../../../engine/Actions.js";
4
4
  import { GlobalDataContext as k } from "../../../engine/GlobalDataContext.js";
5
5
  import { PaginationContext as z } from "../../../engine/PaginationContext.js";
6
6
  import { TemplateContext as B } from "../../../engine/TemplateContext.js";
7
7
  import { evaluateTemplateValue as F, isTemplateValue as G, dataLocationToPath as K, evaluateAttributes as R } from "../../../engine/TemplateSystem.js";
8
- import { V as x } from "../../../View-D8TN1L2h.js";
8
+ import { View as x } from "../../../engine/View.js";
9
9
  import { usePagination as q } from "../../hook/usePagination.js";
10
10
  const _ = ({ props: t, currentData: e, path: f }) => {
11
- const m = T(k), i = T(B), g = (t == null ? void 0 : t.cardinality) ?? -1, V = (t == null ? void 0 : t.options) ?? [], h = (t == null ? void 0 : t.singleOption) ?? void 0, C = !!h, l = (t == null ? void 0 : t.content) ?? null, P = l && F({
11
+ const m = T(k), a = T(B), g = (t == null ? void 0 : t.cardinality) ?? -1, w = (t == null ? void 0 : t.options) ?? [], h = (t == null ? void 0 : t.singleOption) ?? void 0, C = !!h, l = (t == null ? void 0 : t.content) ?? null, P = l && F({
12
12
  globalDataContext: m,
13
- templateContext: i,
13
+ templateContext: a,
14
14
  valueToEvaluate: l
15
- }), u = Object.entries(typeof P == "object" ? P : e).map(([I, n]) => {
16
- const o = I;
15
+ }), u = Object.entries(typeof P == "object" ? P : e).map(([V, n]) => {
16
+ const o = V;
17
17
  if (g >= 1 && o >= g || !n || typeof n != "object")
18
18
  return null;
19
19
  let c, b, d;
@@ -22,17 +22,17 @@ const _ = ({ props: t, currentData: e, path: f }) => {
22
22
  else {
23
23
  if (c = Object.keys(n)[0] ?? void 0, c === void 0)
24
24
  return null;
25
- b = Object.values(n)[0] ?? void 0, d = V[c] ?? void 0;
25
+ b = Object.values(n)[0] ?? void 0, d = w[c] ?? void 0;
26
26
  }
27
27
  if (d === void 0)
28
28
  return null;
29
29
  let S = (G(l) && K({
30
30
  dataLocation: l,
31
- currentPath: i.templatePath,
31
+ currentPath: a.templatePath,
32
32
  globalDataContext: m,
33
- templateContext: i
33
+ templateContext: a
34
34
  }) || f) + "." + o;
35
- return C || (S += "." + c), /* @__PURE__ */ a(
35
+ return C || (S += "." + c), /* @__PURE__ */ i(
36
36
  x,
37
37
  {
38
38
  currentData: b,
@@ -45,17 +45,17 @@ const _ = ({ props: t, currentData: e, path: f }) => {
45
45
  }), v = q({
46
46
  dataToPaginate: u,
47
47
  ...(t == null ? void 0 : t.paginationProps) ?? {}
48
- }), j = t != null && t.paginated ? u.slice(v.firstShownItemIndex, v.maxShownItemIndexExcluded) : u, w = t != null && t.contentWrapper ? A(
48
+ }), j = t != null && t.paginated ? u.slice(v.firstShownItemIndex, v.maxShownItemIndexExcluded) : u, I = t != null && t.contentWrapper ? A(
49
49
  t.contentWrapper.tag ?? "div",
50
50
  R({
51
51
  attrs: t.contentWrapper.attributes ?? {},
52
52
  globalDataContext: m,
53
53
  options: { normalizeBeforeEvaluation: !0 },
54
- templateContext: i
54
+ templateContext: a
55
55
  }),
56
56
  j
57
57
  ) : j, O = /* @__PURE__ */ y(W, { children: [
58
- (t == null ? void 0 : t.before) && /* @__PURE__ */ a(
58
+ (t == null ? void 0 : t.before) && /* @__PURE__ */ i(
59
59
  x,
60
60
  {
61
61
  currentData: (e == null ? void 0 : e.before) ?? void 0,
@@ -64,8 +64,8 @@ const _ = ({ props: t, currentData: e, path: f }) => {
64
64
  props: t == null ? void 0 : t.before
65
65
  }
66
66
  ),
67
- w,
68
- (t == null ? void 0 : t.after) && /* @__PURE__ */ a(
67
+ I,
68
+ (t == null ? void 0 : t.after) && /* @__PURE__ */ i(
69
69
  x,
70
70
  {
71
71
  currentData: (e == null ? void 0 : e.after) ?? void 0,
@@ -75,7 +75,7 @@ const _ = ({ props: t, currentData: e, path: f }) => {
75
75
  }
76
76
  )
77
77
  ] });
78
- return /* @__PURE__ */ a(L, { ...t, children: t != null && t.paginated ? /* @__PURE__ */ a(z.Provider, { value: { pagination: v }, children: O }) : O });
78
+ return /* @__PURE__ */ i(L, { ...t, children: t != null && t.paginated ? /* @__PURE__ */ i(z.Provider, { value: { pagination: v }, children: O }) : O });
79
79
  };
80
80
  export {
81
81
  _ as Switch
@@ -4,7 +4,7 @@ import { DelayedActions as p, getReactionFunctionsToExecute as m } from "./Delay
4
4
  import { PageControls as c } from "./PageControls.js";
5
5
  import { Phantom as i } from "./Phantom.js";
6
6
  import { ReactiveJsonBasicComponentWrapper as u } from "./ReactiveJsonBasicComponentWrapper.js";
7
- import { R as l } from "../../../index-BYLJtf9L.js";
7
+ import { R as l } from "../../../index-CBEHeXej.js";
8
8
  import { Switch as g } from "./Switch.js";
9
9
  export {
10
10
  e as Count,
@@ -2,22 +2,22 @@ import { HashChangeListener as r } from "./action/HashChangeListener.js";
2
2
  import { Hide as a } from "./action/Hide.js";
3
3
  import { MessageListener as p } from "./action/MessageListener.js";
4
4
  import { ReactOnEvent as x } from "./action/ReactOnEvent.js";
5
- import { Redirect as n } from "./action/Redirect.js";
5
+ import { Redirect as s } from "./action/Redirect.js";
6
6
  import { SetAttributeValue as l } from "./action/SetAttributeValue.js";
7
7
  import { ToggleAttributeValue as c } from "./action/ToggleAttributeValue.js";
8
8
  import { UnsetAttribute as b } from "./action/UnsetAttribute.js";
9
9
  import { UnsetAttributeValue as d } from "./action/UnsetAttributeValue.js";
10
10
  import { VisuallyHide as R } from "./action/VisuallyHide.js";
11
- import { coreDataMappingComponents as H } from "./dataMapping/index.js";
12
- import { coreDataProcessorComponents as h } from "./dataProcessor/index.js";
13
- import { R as F, c as M } from "../index-BYLJtf9L.js";
11
+ import { coreDataMappingComponents as V } from "./dataMapping/index.js";
12
+ import { coreDataProcessorComponents as A } from "./dataProcessor/index.js";
13
+ import { R as H, c as M } from "../index-CBEHeXej.js";
14
14
  import { usePagination as S } from "./hook/usePagination.js";
15
15
  import { coreReactionComponents as T } from "./reaction/index.js";
16
16
  import { simpleMapping as w } from "./dataMapping/simpleMapping.js";
17
17
  import { VariablesDebug as B } from "./element/debug/VariablesDebug/VariablesDebug.js";
18
18
  import { FolderSortableTree as N } from "./element/html/FolderSortableTree.js";
19
19
  import { FormatNumeral as k } from "./element/html/FormatNumeral.js";
20
- import { H as I } from "../View-D8TN1L2h.js";
20
+ import { Html as I } from "./element/html/Html.js";
21
21
  import { LabelFromValue as W } from "./element/html/LabelFromValue.js";
22
22
  import { PreformattedMarkup as z } from "./element/html/PreformattedMarkup.js";
23
23
  import { SortableTreeItemCollapseButton as K } from "./element/html/SortableTreeItemCollapseButton.js";
@@ -28,15 +28,15 @@ import { PageControls as re } from "./element/special/PageControls.js";
28
28
  import { Phantom as ae } from "./element/special/Phantom.js";
29
29
  import { ReactiveJsonBasicComponentWrapper as pe } from "./element/special/ReactiveJsonBasicComponentWrapper.js";
30
30
  import { Switch as xe } from "./element/special/Switch.js";
31
- import { addData as ne } from "./reaction/addData.js";
31
+ import { addData as se } from "./reaction/addData.js";
32
32
  import { fetchData as le } from "./reaction/fetchData.js";
33
33
  import { e as ce } from "../httpRequestCommon-DUo2Oxgl.js";
34
34
  import { moveData as be } from "./reaction/moveData.js";
35
35
  import { postMessage as de } from "./reaction/postMessage.js";
36
36
  import { redirectNow as Re } from "./reaction/redirectNow.js";
37
- import { removeData as He } from "./reaction/removeData.js";
38
- import { setClipboardData as he } from "./reaction/setClipboardData.js";
39
- import { setData as Fe } from "./reaction/setData.js";
37
+ import { removeData as Ve } from "./reaction/removeData.js";
38
+ import { setClipboardData as Ae } from "./reaction/setClipboardData.js";
39
+ import { setData as He } from "./reaction/setData.js";
40
40
  import { submitData as Pe } from "./reaction/submitData.js";
41
41
  import { triggerEvent as Ee } from "./reaction/triggerEvent.js";
42
42
  export {
@@ -55,8 +55,8 @@ export {
55
55
  z as PreformattedMarkup,
56
56
  x as ReactOnEvent,
57
57
  pe as ReactiveJsonBasicComponentWrapper,
58
- F as ReactiveJsonSubroot,
59
- n as Redirect,
58
+ H as ReactiveJsonSubroot,
59
+ s as Redirect,
60
60
  l as SetAttributeValue,
61
61
  K as SortableTreeItemCollapseButton,
62
62
  xe as Switch,
@@ -65,9 +65,9 @@ export {
65
65
  d as UnsetAttributeValue,
66
66
  B as VariablesDebug,
67
67
  R as VisuallyHide,
68
- ne as addData,
69
- H as coreDataMappingComponents,
70
- h as coreDataProcessorComponents,
68
+ se as addData,
69
+ V as coreDataMappingComponents,
70
+ A as coreDataProcessorComponents,
71
71
  M as coreElementComponents,
72
72
  T as coreReactionComponents,
73
73
  ce as executeHttpRequest,
@@ -76,9 +76,9 @@ export {
76
76
  be as moveData,
77
77
  de as postMessage,
78
78
  Re as redirectNow,
79
- He as removeData,
80
- he as setClipboardData,
81
- Fe as setData,
79
+ Ve as removeData,
80
+ Ae as setClipboardData,
81
+ He as setData,
82
82
  w as simpleMapping,
83
83
  Pe as submitData,
84
84
  Ee as triggerEvent,
@@ -1,7 +1,7 @@
1
1
  import "./index-BA09SSaJ.js";
2
2
  import "./component/dataMapping/index.js";
3
3
  import "./component/dataProcessor/index.js";
4
- import { b as e } from "./index-BYLJtf9L.js";
4
+ import { b as e } from "./index-CBEHeXej.js";
5
5
  import "./component/reaction/index.js";
6
6
  export {
7
7
  e as coreComponentsPlugin
@@ -3,7 +3,7 @@ import "../httpRequestCommon-DUo2Oxgl.js";
3
3
  import "../lodash-CYNxjS-I.js";
4
4
  import "react";
5
5
  import "../dnd-kit-sortable-tree.esm-Cz1RJyIg.js";
6
- import { a as g } from "../index-BYLJtf9L.js";
6
+ import { a as g } from "../index-CBEHeXej.js";
7
7
  import "./ComponentCollector.js";
8
8
  import "./EventDispatcherProvider.js";
9
9
  import "./GlobalDataContextProvider.js";
@@ -14,7 +14,7 @@ import "./utility/alterData.js";
14
14
  import "./utility/dataMappingSystem.js";
15
15
  import "./utility/parseRjBuild.js";
16
16
  import "./utility/stringToBoolean.js";
17
- import "../View-D8TN1L2h.js";
17
+ import "./View.js";
18
18
  export {
19
19
  g as ReactiveJsonRoot
20
20
  };
@@ -1,9 +1,76 @@
1
- import "react/jsx-runtime";
2
- import "react";
3
- import { V } from "../View-D8TN1L2h.js";
4
- import "./GlobalDataContext.js";
5
- import "./TemplateContext.js";
6
- import "./TemplateSystem.js";
1
+ import { jsx as l } from "react/jsx-runtime";
2
+ import { useContext as y } from "react";
3
+ import { GlobalDataContext as D } from "./GlobalDataContext.js";
4
+ import { TemplateContext as C } from "./TemplateContext.js";
5
+ import L, { evaluateTemplateValue as x, dataLocationToPath as P } from "./TemplateSystem.js";
6
+ function u({ props: t, currentData: o, datafield: c, path: n }) {
7
+ const i = y(D), v = y(C), f = i.plugins ?? {}, d = (f == null ? void 0 : f.element) ?? {};
8
+ if (!d)
9
+ return null;
10
+ const { element: T } = i;
11
+ if (o === void 0 && (o = ""), t != null && t.type) {
12
+ let e = d[t.type] ?? void 0;
13
+ const a = d.Html;
14
+ return e === void 0 && (e = a), e ? (a === e && (t.tag = t.tag ?? t.type), /* @__PURE__ */ l(e, { path: n, props: t, currentData: o, datafield: c })) : (console.warn(`No component found for type "${t.type}" and no Html fallback available.`), null);
15
+ }
16
+ if (t != null && t.load) {
17
+ let e;
18
+ const a = (t == null ? void 0 : t.customDataLocation) ?? void 0, m = a ? (
19
+ // The data is located somewhere in the current data.
20
+ x({
21
+ globalDataContext: i,
22
+ templateContext: v,
23
+ valueToEvaluate: a
24
+ })
25
+ ) : (
26
+ // The data is the current data.
27
+ o
28
+ ), r = a ? P({
29
+ dataLocation: a,
30
+ currentPath: n,
31
+ globalDataContext: i,
32
+ templateContext: v
33
+ }) : n;
34
+ typeof t.load == "function" ? e = t.load(m) : e = T[t.load];
35
+ const { load: h, customDataLocation: g, ...b } = t;
36
+ return e = { ...e, ...b }, t.keepTemplateContext ? /* @__PURE__ */ l(
37
+ u,
38
+ {
39
+ currentData: m,
40
+ datafield: c,
41
+ path: r,
42
+ props: e
43
+ }
44
+ ) : /* @__PURE__ */ l(C.Provider, { value: { templateData: m, templatePath: r }, children: /* @__PURE__ */ l(
45
+ u,
46
+ {
47
+ currentData: m,
48
+ datafield: c,
49
+ path: r,
50
+ props: e
51
+ }
52
+ ) });
53
+ }
54
+ return Array.isArray(t) ? t.map((e, a) => /* @__PURE__ */ l(
55
+ u,
56
+ {
57
+ currentData: o[a] ?? void 0,
58
+ datafield: a,
59
+ path: n + "." + a,
60
+ props: e ?? void 0
61
+ },
62
+ n + "." + a
63
+ )) : typeof t == "object" ? Object.entries(t).map(([e, a]) => /* @__PURE__ */ l(
64
+ u,
65
+ {
66
+ currentData: o[e] ?? void 0,
67
+ datafield: e ?? void 0,
68
+ path: n + "." + e,
69
+ props: a
70
+ },
71
+ n + "." + e
72
+ )) : /* @__PURE__ */ l(L, { valueToEvaluate: o || (t ?? null) });
73
+ }
7
74
  export {
8
- V as View
75
+ u as View
9
76
  };
@@ -5,9 +5,9 @@ import { EventDispatcherProvider as l, addEventListener as x, removeEventListene
5
5
  import { GlobalDataContext as v } from "./GlobalDataContext.js";
6
6
  import { GlobalDataContextProvider as d } from "./GlobalDataContextProvider.js";
7
7
  import { PaginationContext as C } from "./PaginationContext.js";
8
- import { a as b } from "../index-BYLJtf9L.js";
8
+ import { a as b } from "../index-CBEHeXej.js";
9
9
  import { TemplateContext as T } from "./TemplateContext.js";
10
- import { dataLocationToPath as E, evaluateAttributes as R, evaluateTemplateValue as A, evaluateTemplateValueCollection as P, isTemplateValue as h, useEvaluatedAttributes as y } from "./TemplateSystem.js";
10
+ import { dataLocationToPath as R, evaluateAttributes as V, evaluateTemplateValue as A, evaluateTemplateValueCollection as P, isTemplateValue as h, useEvaluatedAttributes as y } from "./TemplateSystem.js";
11
11
  import { alterData as z } from "./utility/alterData.js";
12
12
  import { analyzeDataOverrideReferences as F } from "./utility/analyzeDataOverrideReferences.js";
13
13
  import { applyDataMapping as J } from "./utility/dataMappingSystem.js";
@@ -15,7 +15,7 @@ import { formatString as j, maybeFormatString as w } from "./utility/formatStrin
15
15
  import { parseRjBuild as O } from "./utility/parseRjBuild.js";
16
16
  import { normalizeAttributesForReactJsx as q } from "./utility/reactJsxHelpers.js";
17
17
  import { stringToBoolean as I } from "./utility/stringToBoolean.js";
18
- import { V as N } from "../View-D8TN1L2h.js";
18
+ import { View as N } from "./View.js";
19
19
  export {
20
20
  o as ActionDependant,
21
21
  m as EventDispatcherContext,
@@ -30,8 +30,8 @@ export {
30
30
  z as alterData,
31
31
  F as analyzeDataOverrideReferences,
32
32
  J as applyDataMapping,
33
- E as dataLocationToPath,
34
- R as evaluateAttributes,
33
+ R as dataLocationToPath,
34
+ V as evaluateAttributes,
35
35
  A as evaluateTemplateValue,
36
36
  P as evaluateTemplateValueCollection,
37
37
  j as formatString,
@@ -1,6 +1,6 @@
1
1
  import { FolderSortableTree as o } from "./component/element/html/FolderSortableTree.js";
2
2
  import { FormatNumeral as r } from "./component/element/html/FormatNumeral.js";
3
- import { H as e } from "./View-D8TN1L2h.js";
3
+ import { Html as e } from "./component/element/html/Html.js";
4
4
  import { LabelFromValue as t } from "./component/element/html/LabelFromValue.js";
5
5
  import { PreformattedMarkup as m } from "./component/element/html/PreformattedMarkup.js";
6
6
  import { SortableTreeItemCollapseButton as l } from "./component/element/html/SortableTreeItemCollapseButton.js";
@@ -1,5 +1,5 @@
1
1
  import { d as ft } from "./index-CACLSxWi.js";
2
- import { h as ht } from "./index-B3RKTGQ2.js";
2
+ import { h as ht } from "./index-BNvY8PkY.js";
3
3
  import { Count as gt } from "./component/element/special/Count.js";
4
4
  import { DataFilter as Dt } from "./component/element/special/DataFilter.js";
5
5
  import { DelayedActions as yt, getReactionFunctionsToExecute as Ct } from "./component/element/special/DelayedActions.js";
@@ -22,21 +22,22 @@ import { coreDataProcessorComponents as Vt } from "./component/dataProcessor/ind
22
22
  import "./component/element/debug/VariablesDebug/VariablesDebug.js";
23
23
  import "./component/element/html/FolderSortableTree.js";
24
24
  import "./component/element/html/FormatNumeral.js";
25
- import { V as _t } from "./View-D8TN1L2h.js";
25
+ import "./component/element/html/Html.js";
26
26
  import "./component/element/html/LabelFromValue.js";
27
27
  import "./component/element/html/PreformattedMarkup.js";
28
28
  import "./component/element/html/SortableTreeItemCollapseButton.js";
29
- import { Switch as Jt } from "./component/element/special/Switch.js";
30
- import { coreReactionComponents as Mt } from "./component/reaction/index.js";
31
- import { mergeComponentCollections as zt } from "./engine/ComponentCollector.js";
32
- import { GlobalDataContextProvider as Gt } from "./engine/GlobalDataContextProvider.js";
33
- import Lt from "./engine/ParsingDebugDisplay/ParsingDebugDisplay.js";
29
+ import { Switch as _t } from "./component/element/special/Switch.js";
30
+ import { coreReactionComponents as Jt } from "./component/reaction/index.js";
31
+ import { mergeComponentCollections as Mt } from "./engine/ComponentCollector.js";
32
+ import { GlobalDataContextProvider as zt } from "./engine/GlobalDataContextProvider.js";
33
+ import Gt from "./engine/ParsingDebugDisplay/ParsingDebugDisplay.js";
34
34
  import { TemplateContext as nt } from "./engine/TemplateContext.js";
35
35
  import { dataLocationToPath as it, evaluateTemplateValueCollection as at } from "./engine/TemplateSystem.js";
36
- import { alterData as Rt } from "./engine/utility/alterData.js";
37
- import { applyDataMapping as $t } from "./engine/utility/dataMappingSystem.js";
38
- import { parseRjBuild as qt } from "./engine/utility/parseRjBuild.js";
39
- import { stringToBoolean as jt } from "./engine/utility/stringToBoolean.js";
36
+ import { alterData as Lt } from "./engine/utility/alterData.js";
37
+ import { applyDataMapping as Rt } from "./engine/utility/dataMappingSystem.js";
38
+ import { parseRjBuild as $t } from "./engine/utility/parseRjBuild.js";
39
+ import { stringToBoolean as qt } from "./engine/utility/stringToBoolean.js";
40
+ import { View as jt } from "./engine/View.js";
40
41
  import { analyzeDataOverrideReferences as Kt } from "./engine/utility/analyzeDataOverrideReferences.js";
41
42
  import "./js-yaml-Bw0KO4XO.js";
42
43
  const ot = {
@@ -44,7 +45,7 @@ const ot = {
44
45
  dataMapping: Nt,
45
46
  dataProcessor: Vt,
46
47
  element: Yt,
47
- reaction: Mt
48
+ reaction: Jt
48
49
  }, Xt = ({
49
50
  dataOverride: o,
50
51
  dataFetchMethod: D,
@@ -97,7 +98,7 @@ const ot = {
97
98
  H(() => () => {
98
99
  typeof document < "u" && i.current && i.current.parentNode && (i.current.parentNode.removeChild(i.current), i.current = null);
99
100
  }, []);
100
- const M = _ ? zt([ot, _]) : ot;
101
+ const M = _ ? Mt([ot, _]) : ot;
101
102
  H(() => {
102
103
  d && (typeof v == "string" && v.toLowerCase() === "post" ? X.post(d, {
103
104
  headers: l
@@ -111,7 +112,7 @@ const ot = {
111
112
  }, [d, l]), H(() => {
112
113
  if (!J)
113
114
  return;
114
- const t = qt(J);
115
+ const t = $t(J);
115
116
  if (!t.success) {
116
117
  if (console.group(
117
118
  `Tried to load the app's RjBuild but the ${t.format} content could not be parsed.`
@@ -130,7 +131,7 @@ const ot = {
130
131
  Z(
131
132
  At.createPortal(
132
133
  /* @__PURE__ */ y(
133
- Lt,
134
+ Gt,
134
135
  {
135
136
  processedRjBuild: t,
136
137
  errorContext: {
@@ -191,7 +192,7 @@ const ot = {
191
192
  headers: z.headers || {},
192
193
  status: z.status,
193
194
  data: z.data
194
- }, O = Rt({
195
+ }, O = Lt({
195
196
  requestContext: ut,
196
197
  responseContext: dt,
197
198
  responseBody: z.data,
@@ -201,7 +202,7 @@ const ot = {
201
202
  });
202
203
  if (e.dataMapping)
203
204
  try {
204
- $t({
205
+ Rt({
205
206
  dataMapping: e.dataMapping,
206
207
  responseData: O,
207
208
  globalDataContext: b,
@@ -353,7 +354,7 @@ const ot = {
353
354
  const B = mt.map((t) => {
354
355
  var a;
355
356
  return /* @__PURE__ */ y(
356
- _t,
357
+ jt,
357
358
  {
358
359
  datafield: t,
359
360
  props: lt[t],
@@ -362,8 +363,8 @@ const ot = {
362
363
  },
363
364
  t
364
365
  );
365
- }), $ = jt(m), tt = /* @__PURE__ */ y(xt, { children: /* @__PURE__ */ K(
366
- Gt,
366
+ }), $ = qt(m), tt = /* @__PURE__ */ y(xt, { children: /* @__PURE__ */ K(
367
+ zt,
367
368
  {
368
369
  value: {
369
370
  element: st,
@@ -447,7 +448,7 @@ const ot = {
447
448
  Phantom: vt,
448
449
  ReactiveJsonBasicComponentWrapper: bt,
449
450
  ReactiveJsonSubroot: Ht,
450
- Switch: Jt,
451
+ Switch: _t,
451
452
  getReactionFunctionsToExecute: Ct
452
453
  }, Symbol.toStringTag, { value: "Module" })), Yt = {
453
454
  ...ft,
package/dist/main.js CHANGED
@@ -10,9 +10,9 @@ import { UnsetAttributeValue as v } from "./component/action/UnsetAttributeValue
10
10
  import { VisuallyHide as C } from "./component/action/VisuallyHide.js";
11
11
  import { coreDataMappingComponents as V } from "./component/dataMapping/index.js";
12
12
  import { coreDataProcessorComponents as A } from "./component/dataProcessor/index.js";
13
- import { a as P, R as h, c as F } from "./index-BYLJtf9L.js";
14
- import { usePagination as H } from "./component/hook/usePagination.js";
15
- import { coreReactionComponents as M } from "./component/reaction/index.js";
13
+ import { a as P, R as h, c as F } from "./index-CBEHeXej.js";
14
+ import { usePagination as L } from "./component/hook/usePagination.js";
15
+ import { coreReactionComponents as y } from "./component/reaction/index.js";
16
16
  import { ActionDependant as B, isValid as J } from "./engine/Actions.js";
17
17
  import { mergeComponentCollections as z } from "./engine/ComponentCollector.js";
18
18
  import { EventDispatcherContext as N } from "./engine/EventDispatcherContext.js";
@@ -29,68 +29,69 @@ import { formatString as le, maybeFormatString as ue } from "./engine/utility/fo
29
29
  import { parseRjBuild as de } from "./engine/utility/parseRjBuild.js";
30
30
  import { normalizeAttributesForReactJsx as ge } from "./engine/utility/reactJsxHelpers.js";
31
31
  import { stringToBoolean as be } from "./engine/utility/stringToBoolean.js";
32
- import { H as Re, V as Ve } from "./View-D8TN1L2h.js";
33
- import { simpleMapping as Ae } from "./component/dataMapping/simpleMapping.js";
34
- import { VariablesDebug as Pe } from "./component/element/debug/VariablesDebug/VariablesDebug.js";
35
- import { FolderSortableTree as Fe } from "./component/element/html/FolderSortableTree.js";
36
- import { FormatNumeral as He } from "./component/element/html/FormatNumeral.js";
37
- import { LabelFromValue as Me } from "./component/element/html/LabelFromValue.js";
38
- import { PreformattedMarkup as Be } from "./component/element/html/PreformattedMarkup.js";
39
- import { SortableTreeItemCollapseButton as we } from "./component/element/html/SortableTreeItemCollapseButton.js";
40
- import { Count as Ge } from "./component/element/special/Count.js";
41
- import { DataFilter as Oe } from "./component/element/special/DataFilter.js";
42
- import { DelayedActions as je, getReactionFunctionsToExecute as ke } from "./component/element/special/DelayedActions.js";
43
- import { PageControls as Ie } from "./component/element/special/PageControls.js";
44
- import { Phantom as Ke } from "./component/element/special/Phantom.js";
45
- import { ReactiveJsonBasicComponentWrapper as Xe } from "./component/element/special/ReactiveJsonBasicComponentWrapper.js";
46
- import { Switch as Ze } from "./component/element/special/Switch.js";
47
- import { addData as $e } from "./component/reaction/addData.js";
48
- import { fetchData as oo } from "./component/reaction/fetchData.js";
49
- import { e as ro } from "./httpRequestCommon-DUo2Oxgl.js";
50
- import { moveData as po } from "./component/reaction/moveData.js";
51
- import { postMessage as xo } from "./component/reaction/postMessage.js";
52
- import { redirectNow as fo } from "./component/reaction/redirectNow.js";
53
- import { removeData as so } from "./component/reaction/removeData.js";
54
- import { setClipboardData as uo } from "./component/reaction/setClipboardData.js";
55
- import { setData as Do } from "./component/reaction/setData.js";
56
- import { submitData as vo } from "./component/reaction/submitData.js";
57
- import { triggerEvent as Co } from "./component/reaction/triggerEvent.js";
32
+ import { View as Re } from "./engine/View.js";
33
+ import { simpleMapping as Te } from "./component/dataMapping/simpleMapping.js";
34
+ import { VariablesDebug as Ee } from "./component/element/debug/VariablesDebug/VariablesDebug.js";
35
+ import { FolderSortableTree as he } from "./component/element/html/FolderSortableTree.js";
36
+ import { FormatNumeral as Se } from "./component/element/html/FormatNumeral.js";
37
+ import { Html as Me } from "./component/element/html/Html.js";
38
+ import { LabelFromValue as He } from "./component/element/html/LabelFromValue.js";
39
+ import { PreformattedMarkup as Je } from "./component/element/html/PreformattedMarkup.js";
40
+ import { SortableTreeItemCollapseButton as ze } from "./component/element/html/SortableTreeItemCollapseButton.js";
41
+ import { Count as Ne } from "./component/element/special/Count.js";
42
+ import { DataFilter as Ue } from "./component/element/special/DataFilter.js";
43
+ import { DelayedActions as ke, getReactionFunctionsToExecute as qe } from "./component/element/special/DelayedActions.js";
44
+ import { PageControls as We } from "./component/element/special/PageControls.js";
45
+ import { Phantom as Qe } from "./component/element/special/Phantom.js";
46
+ import { ReactiveJsonBasicComponentWrapper as Ye } from "./component/element/special/ReactiveJsonBasicComponentWrapper.js";
47
+ import { Switch as _e } from "./component/element/special/Switch.js";
48
+ import { addData as eo } from "./component/reaction/addData.js";
49
+ import { fetchData as to } from "./component/reaction/fetchData.js";
50
+ import { e as ao } from "./httpRequestCommon-DUo2Oxgl.js";
51
+ import { moveData as mo } from "./component/reaction/moveData.js";
52
+ import { postMessage as no } from "./component/reaction/postMessage.js";
53
+ import { redirectNow as io } from "./component/reaction/redirectNow.js";
54
+ import { removeData as lo } from "./component/reaction/removeData.js";
55
+ import { setClipboardData as co } from "./component/reaction/setClipboardData.js";
56
+ import { setData as go } from "./component/reaction/setData.js";
57
+ import { submitData as bo } from "./component/reaction/submitData.js";
58
+ import { triggerEvent as Ro } from "./component/reaction/triggerEvent.js";
58
59
  export {
59
60
  B as ActionDependant,
60
- Ge as Count,
61
- Oe as DataFilter,
62
- je as DelayedActions,
61
+ Ne as Count,
62
+ Ue as DataFilter,
63
+ ke as DelayedActions,
63
64
  N as EventDispatcherContext,
64
65
  U as EventDispatcherProvider,
65
- Fe as FolderSortableTree,
66
- He as FormatNumeral,
66
+ he as FolderSortableTree,
67
+ Se as FormatNumeral,
67
68
  I as GlobalDataContext,
68
69
  K as GlobalDataContextProvider,
69
70
  t as HashChangeListener,
70
71
  a as Hide,
71
- Re as Html,
72
- Me as LabelFromValue,
72
+ Me as Html,
73
+ He as LabelFromValue,
73
74
  m as MessageListener,
74
- Ie as PageControls,
75
+ We as PageControls,
75
76
  X as PaginationContext,
76
- Ke as Phantom,
77
- Be as PreformattedMarkup,
77
+ Qe as Phantom,
78
+ Je as PreformattedMarkup,
78
79
  n as ReactOnEvent,
79
- Xe as ReactiveJsonBasicComponentWrapper,
80
+ Ye as ReactiveJsonBasicComponentWrapper,
80
81
  P as ReactiveJsonRoot,
81
82
  h as ReactiveJsonSubroot,
82
83
  i as Redirect,
83
84
  l as SetAttributeValue,
84
- we as SortableTreeItemCollapseButton,
85
- Ze as Switch,
85
+ ze as SortableTreeItemCollapseButton,
86
+ _e as Switch,
86
87
  Z as TemplateContext,
87
88
  c as ToggleAttributeValue,
88
89
  D as UnsetAttribute,
89
90
  v as UnsetAttributeValue,
90
- Pe as VariablesDebug,
91
- Ve as View,
91
+ Ee as VariablesDebug,
92
+ Re as View,
92
93
  C as VisuallyHide,
93
- $e as addData,
94
+ eo as addData,
94
95
  j as addEventListener,
95
96
  me as alterData,
96
97
  ne as analyzeDataOverrideReferences,
@@ -98,32 +99,32 @@ export {
98
99
  V as coreDataMappingComponents,
99
100
  A as coreDataProcessorComponents,
100
101
  F as coreElementComponents,
101
- M as coreReactionComponents,
102
+ y as coreReactionComponents,
102
103
  $ as dataLocationToPath,
103
104
  ee as evaluateAttributes,
104
105
  oe as evaluateTemplateValue,
105
106
  te as evaluateTemplateValueCollection,
106
- ro as executeHttpRequest,
107
- oo as fetchData,
107
+ ao as executeHttpRequest,
108
+ to as fetchData,
108
109
  le as formatString,
109
- ke as getReactionFunctionsToExecute,
110
+ qe as getReactionFunctionsToExecute,
110
111
  re as isTemplateValue,
111
112
  J as isValid,
112
113
  ue as maybeFormatString,
113
114
  z as mergeComponentCollections,
114
- po as moveData,
115
+ mo as moveData,
115
116
  ge as normalizeAttributesForReactJsx,
116
117
  de as parseRjBuild,
117
- xo as postMessage,
118
- fo as redirectNow,
119
- so as removeData,
118
+ no as postMessage,
119
+ io as redirectNow,
120
+ lo as removeData,
120
121
  k as removeEventListener,
121
- uo as setClipboardData,
122
- Do as setData,
123
- Ae as simpleMapping,
122
+ co as setClipboardData,
123
+ go as setData,
124
+ Te as simpleMapping,
124
125
  be as stringToBoolean,
125
- vo as submitData,
126
- Co as triggerEvent,
126
+ bo as submitData,
127
+ Ro as triggerEvent,
127
128
  ae as useEvaluatedAttributes,
128
- H as usePagination
129
+ L as usePagination
129
130
  };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@ea-lab/reactive-json",
3
3
  "private": false,
4
- "version": "1.0.0-alpha.1",
4
+ "version": "1.0.0-alpha.2",
5
5
  "type": "module",
6
6
  "repository": {
7
7
  "type": "git",
@@ -1,126 +0,0 @@
1
- import { jsx as n, jsxs as x, Fragment as C } from "react/jsx-runtime";
2
- import { useContext as h, useRef as j } from "react";
3
- import { ActionDependant as k } from "./engine/Actions.js";
4
- import { GlobalDataContext as D } from "./engine/GlobalDataContext.js";
5
- import { normalizeAttributesForReactJsx as A } from "./engine/utility/reactJsxHelpers.js";
6
- import { TemplateContext as T } from "./engine/TemplateContext.js";
7
- import H, { evaluateAttributes as R, evaluateTemplateValue as V, dataLocationToPath as O } from "./engine/TemplateSystem.js";
8
- const y = ({ props: t, currentData: o, datafield: s, path: l }) => {
9
- const d = h(D), b = h(T), r = j(null), c = `${t.tag}`, f = t.extra ?? {}, e = A(t.attributes), a = A(o.attributes);
10
- for (const i of Object.keys(a)) {
11
- if (i.charAt(0) === "+") {
12
- const g = i.substring(1);
13
- e[g] = (e[g] ?? "").length > 0 ? (
14
- // Append using a space.
15
- " " + a[i]
16
- ) : (
17
- // Set directly.
18
- a[i]
19
- );
20
- continue;
21
- }
22
- e[i] = a[i];
23
- }
24
- const u = R({ attrs: e, globalDataContext: d, templateContext: b });
25
- return /* @__PURE__ */ n(k, { ...t, attributesHolderRef: r, children: ((i) => i && [
26
- "area",
27
- "base",
28
- "br",
29
- "col",
30
- "embed",
31
- "hr",
32
- "img",
33
- "input",
34
- "link",
35
- "meta",
36
- "param",
37
- "source",
38
- "track",
39
- "wbr"
40
- ].indexOf(i) !== -1)(t.tag) ? /* @__PURE__ */ x(C, { children: [
41
- /* @__PURE__ */ n(c, { ref: r, ...u }),
42
- Object.keys(f).length ? /* @__PURE__ */ n(m, { props: f }) : ""
43
- ] }) : /* @__PURE__ */ x(C, { children: [
44
- /* @__PURE__ */ n(c, { ref: r, ...u, children: t.content && /* @__PURE__ */ n(
45
- m,
46
- {
47
- currentData: o.content ?? void 0,
48
- datafield: "content",
49
- path: l + ".content",
50
- props: t.content
51
- }
52
- ) }),
53
- Object.keys(f).length ? /* @__PURE__ */ n(m, { props: f }) : ""
54
- ] }) });
55
- };
56
- function m({ props: t, currentData: o, datafield: s, path: l }) {
57
- const d = h(D), b = h(T), r = d.plugins ?? {}, c = (r == null ? void 0 : r.element) ?? {};
58
- if (!c)
59
- return null;
60
- const { element: f } = d;
61
- if (o === void 0 && (o = ""), t != null && t.type) {
62
- let e = c[t.type] ?? void 0;
63
- return e === void 0 && (e = c.Html ?? y), (c.Html ?? y) === e && (t.tag = t.tag ?? t.type), /* @__PURE__ */ n(e, { path: l, props: t, currentData: o, datafield: s });
64
- }
65
- if (t != null && t.load) {
66
- let e;
67
- const a = (t == null ? void 0 : t.customDataLocation) ?? void 0, u = a ? (
68
- // The data is located somewhere in the current data.
69
- V({
70
- globalDataContext: d,
71
- templateContext: b,
72
- valueToEvaluate: a
73
- })
74
- ) : (
75
- // The data is the current data.
76
- o
77
- ), v = a ? O({
78
- dataLocation: a,
79
- currentPath: l,
80
- globalDataContext: d,
81
- templateContext: b
82
- }) : l;
83
- typeof t.load == "function" ? e = t.load(u) : e = f[t.load];
84
- const { load: i, customDataLocation: g, ...L } = t;
85
- return e = { ...e, ...L }, t.keepTemplateContext ? /* @__PURE__ */ n(
86
- m,
87
- {
88
- currentData: u,
89
- datafield: s,
90
- path: v,
91
- props: e
92
- }
93
- ) : /* @__PURE__ */ n(T.Provider, { value: { templateData: u, templatePath: v }, children: /* @__PURE__ */ n(
94
- m,
95
- {
96
- currentData: u,
97
- datafield: s,
98
- path: v,
99
- props: e
100
- }
101
- ) });
102
- }
103
- return Array.isArray(t) ? t.map((e, a) => /* @__PURE__ */ n(
104
- m,
105
- {
106
- currentData: o[a] ?? void 0,
107
- datafield: a,
108
- path: l + "." + a,
109
- props: e ?? void 0
110
- },
111
- l + "." + a
112
- )) : typeof t == "object" ? Object.entries(t).map(([e, a]) => /* @__PURE__ */ n(
113
- m,
114
- {
115
- currentData: o[e] ?? void 0,
116
- datafield: e ?? void 0,
117
- path: l + "." + e,
118
- props: a
119
- },
120
- l + "." + e
121
- )) : /* @__PURE__ */ n(H, { valueToEvaluate: o || (t ?? null) });
122
- }
123
- export {
124
- y as H,
125
- m as V
126
- };