@ea-lab/reactive-json 2.1.0 → 2.3.0
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/engine/ReactiveJsonRoot.js +196 -185
- package/dist/engine/index.js +12 -10
- package/dist/engine/utility/index.js +6 -4
- package/dist/engine/utility/interpolateSegments.js +63 -0
- package/dist/main.js +103 -101
- package/package.json +1 -1
|
@@ -1,317 +1,328 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { a as
|
|
3
|
-
import { useRef as
|
|
4
|
-
import { r as
|
|
5
|
-
import { coreComponentsPlugin as
|
|
6
|
-
import { mergeComponentCollections as
|
|
7
|
-
import { DataStore as
|
|
8
|
-
import { EventDispatcherProvider as
|
|
9
|
-
import { GlobalDataContext as
|
|
10
|
-
import
|
|
11
|
-
import { StoreContext as
|
|
12
|
-
import { TemplateContext as
|
|
13
|
-
import { dataLocationToPath as
|
|
14
|
-
import { useReactiveData as
|
|
15
|
-
import { alterData as
|
|
16
|
-
import { applyDataMapping as
|
|
17
|
-
import { parseRjBuild as
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
1
|
+
import { jsx as u, jsxs as Y, Fragment as lt } from "react/jsx-runtime";
|
|
2
|
+
import { a as L } from "../index-BUPRVmV-.js";
|
|
3
|
+
import { useRef as Z, useState as U, useEffect as N, useMemo as pt } from "react";
|
|
4
|
+
import { r as dt } from "../dnd-kit-sortable-tree.esm-Cz1RJyIg.js";
|
|
5
|
+
import { coreComponentsPlugin as F } from "../coreComponentsPlugin.js";
|
|
6
|
+
import { mergeComponentCollections as ut } from "./ComponentCollector.js";
|
|
7
|
+
import { DataStore as mt } from "./DataStore.js";
|
|
8
|
+
import { EventDispatcherProvider as ft } from "./EventDispatcherProvider.js";
|
|
9
|
+
import { GlobalDataContext as gt } from "./GlobalDataContext.js";
|
|
10
|
+
import ht from "./ParsingDebugDisplay/ParsingDebugDisplay.js";
|
|
11
|
+
import { StoreContext as yt } from "./StoreContext.js";
|
|
12
|
+
import { TemplateContext as Pt } from "./TemplateContext.js";
|
|
13
|
+
import { dataLocationToPath as Dt } from "./TemplateSystem.js";
|
|
14
|
+
import { useReactiveData as wt } from "./hook/useReactiveData.js";
|
|
15
|
+
import { alterData as bt } from "./utility/alterData.js";
|
|
16
|
+
import { applyDataMapping as St } from "./utility/dataMappingSystem.js";
|
|
17
|
+
import { parseRjBuild as Ct } from "./utility/parseRjBuild.js";
|
|
18
|
+
import { interpolateSegments as vt } from "./utility/interpolateSegments.js";
|
|
19
|
+
import { stringToBoolean as Et } from "./utility/stringToBoolean.js";
|
|
20
|
+
import { View as xt } from "./View.js";
|
|
21
|
+
const kt = ({ Wrapper: g }) => {
|
|
22
|
+
const T = wt("");
|
|
23
|
+
return /* @__PURE__ */ u(g, { children: JSON.stringify(T, null, " ") });
|
|
24
|
+
}, At = ({
|
|
25
|
+
dataOverride: g,
|
|
26
|
+
dataFetchMethod: T,
|
|
27
|
+
dataUrl: O,
|
|
28
|
+
debugMode: tt,
|
|
29
|
+
DebugModeContentWrapper: q,
|
|
30
|
+
DebugModeDataWrapper: z,
|
|
31
|
+
DebugModeRootWrapper: et,
|
|
32
|
+
headersForData: I,
|
|
32
33
|
headersForRjBuild: s,
|
|
33
|
-
maybeRawAppData:
|
|
34
|
-
maybeRawAppRjBuild:
|
|
35
|
-
plugins:
|
|
36
|
-
rjBuildFetchMethod:
|
|
37
|
-
rjBuildUrl:
|
|
38
|
-
upstreamUpdateCallbacks:
|
|
34
|
+
maybeRawAppData: M,
|
|
35
|
+
maybeRawAppRjBuild: S,
|
|
36
|
+
plugins: R,
|
|
37
|
+
rjBuildFetchMethod: C,
|
|
38
|
+
rjBuildUrl: h,
|
|
39
|
+
upstreamUpdateCallbacks: $
|
|
39
40
|
}) => {
|
|
40
|
-
const
|
|
41
|
-
|
|
41
|
+
const y = [];
|
|
42
|
+
T && (y.push({
|
|
42
43
|
deprecatedProperty: "dataFetchMethod",
|
|
43
44
|
newProperty: "rjBuildFetchMethod"
|
|
44
|
-
}),
|
|
45
|
+
}), C = T), O && (y.push({
|
|
45
46
|
deprecatedProperty: "dataUrl",
|
|
46
47
|
newProperty: "rjBuildUrl"
|
|
47
|
-
}),
|
|
48
|
+
}), h = O), I && (y.push({
|
|
48
49
|
deprecatedProperty: "headersForData",
|
|
49
50
|
newProperty: "headersForRjBuild"
|
|
50
|
-
}), s =
|
|
51
|
+
}), s = I), M && (y.push({
|
|
51
52
|
deprecatedProperty: "maybeRawAppData",
|
|
52
53
|
newProperty: "maybeRawAppRjBuild"
|
|
53
|
-
}),
|
|
54
|
-
"A ReactiveJsonRoot component got the following deprecated properties that must be replaced: " +
|
|
54
|
+
}), S = M), y.length > 0 && console.warn(
|
|
55
|
+
"A ReactiveJsonRoot component got the following deprecated properties that must be replaced: " + y.map((t) => t.deprecatedProperty + " -> " + t.newProperty).join(", ")
|
|
55
56
|
);
|
|
56
|
-
const
|
|
57
|
+
const o = Z(new mt({})).current, [m, v] = U({
|
|
57
58
|
templates: {},
|
|
58
59
|
renderView: {},
|
|
59
60
|
items: [],
|
|
60
61
|
rawAppRjBuild: null
|
|
61
|
-
}), [
|
|
62
|
-
|
|
63
|
-
typeof document < "u" &&
|
|
62
|
+
}), [j, W] = U(null), a = Z(null);
|
|
63
|
+
N(() => () => {
|
|
64
|
+
typeof document < "u" && a.current && a.current.parentNode && (a.current.parentNode.removeChild(a.current), a.current = null);
|
|
64
65
|
}, []);
|
|
65
|
-
const
|
|
66
|
-
() =>
|
|
67
|
-
[
|
|
66
|
+
const E = pt(
|
|
67
|
+
() => R ? ut([F, R]) : F,
|
|
68
|
+
[R]
|
|
68
69
|
);
|
|
69
|
-
|
|
70
|
-
let t =
|
|
71
|
-
typeof t == "string" || t && (t = JSON.stringify(t)), t &&
|
|
72
|
-
}, [
|
|
73
|
-
if (!
|
|
70
|
+
N(() => {
|
|
71
|
+
let t = S;
|
|
72
|
+
typeof t == "string" || t && (t = JSON.stringify(t)), t && v((r) => ({ ...r, rawAppRjBuild: t }));
|
|
73
|
+
}, [S]), N(() => {
|
|
74
|
+
if (!h) return;
|
|
74
75
|
const t = {
|
|
75
|
-
method:
|
|
76
|
-
url:
|
|
76
|
+
method: C || "GET",
|
|
77
|
+
url: h,
|
|
77
78
|
headers: s
|
|
78
79
|
};
|
|
79
|
-
t.method.toLowerCase() === "post" ?
|
|
80
|
-
|
|
81
|
-
}) :
|
|
82
|
-
|
|
80
|
+
t.method.toLowerCase() === "post" ? L.post(t.url, {}, { headers: t.headers }).then((r) => {
|
|
81
|
+
v((c) => ({ ...c, rawAppRjBuild: r.data }));
|
|
82
|
+
}) : L.get(t.url, { headers: t.headers }).then((r) => {
|
|
83
|
+
v((c) => ({ ...c, rawAppRjBuild: r.data }));
|
|
83
84
|
});
|
|
84
|
-
}, [
|
|
85
|
-
if (!
|
|
86
|
-
const t =
|
|
85
|
+
}, [h, s, C]), N(() => {
|
|
86
|
+
if (!m.rawAppRjBuild) return;
|
|
87
|
+
const t = Ct(m.rawAppRjBuild);
|
|
87
88
|
if (!t.success) {
|
|
88
89
|
if (console.group(
|
|
89
90
|
`Tried to load the app's RjBuild but the ${t.format} content could not be parsed.`
|
|
90
91
|
), console.error(t.error.message), console.debug("Context:", {
|
|
91
|
-
rjBuildUrl:
|
|
92
|
-
rjBuildFetchMethod:
|
|
92
|
+
rjBuildUrl: h,
|
|
93
|
+
rjBuildFetchMethod: C,
|
|
93
94
|
headersForRjBuild: s,
|
|
94
|
-
maybeRawAppRjBuild:
|
|
95
|
-
dataOverride:
|
|
95
|
+
maybeRawAppRjBuild: S,
|
|
96
|
+
dataOverride: g
|
|
96
97
|
}), console.debug("Error details:", t.error), console.groupEnd(), typeof document < "u") {
|
|
97
98
|
let e = document.getElementById("rj-parsing-error-root");
|
|
98
|
-
if (e || (e = document.createElement("div"), e.id = "rj-parsing-error-root", document.body.appendChild(e)), !
|
|
99
|
-
const
|
|
100
|
-
e.appendChild(
|
|
99
|
+
if (e || (e = document.createElement("div"), e.id = "rj-parsing-error-root", document.body.appendChild(e)), !a.current) {
|
|
100
|
+
const i = document.createElement("div");
|
|
101
|
+
e.appendChild(i), a.current = i;
|
|
101
102
|
}
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
/* @__PURE__ */
|
|
105
|
-
|
|
103
|
+
W(
|
|
104
|
+
dt.createPortal(
|
|
105
|
+
/* @__PURE__ */ u(
|
|
106
|
+
ht,
|
|
106
107
|
{
|
|
107
108
|
processedRjBuild: t,
|
|
108
109
|
errorContext: {
|
|
109
|
-
rjBuildUrl:
|
|
110
|
-
rjBuildFetchMethod:
|
|
110
|
+
rjBuildUrl: h,
|
|
111
|
+
rjBuildFetchMethod: C,
|
|
111
112
|
headersForRjBuild: s,
|
|
112
|
-
maybeRawAppRjBuild:
|
|
113
|
+
maybeRawAppRjBuild: S
|
|
113
114
|
}
|
|
114
115
|
}
|
|
115
116
|
),
|
|
116
|
-
|
|
117
|
+
a.current,
|
|
117
118
|
() => {
|
|
118
|
-
|
|
119
|
+
a.current && (a.current.parentNode.removeChild(a.current), a.current = null);
|
|
119
120
|
}
|
|
120
121
|
)
|
|
121
122
|
);
|
|
122
123
|
}
|
|
123
124
|
return;
|
|
124
125
|
}
|
|
125
|
-
|
|
126
|
-
const r = t.data,
|
|
127
|
-
|
|
126
|
+
j && (W(null), typeof document < "u" && a.current && a.current.parentNode && (a.current.parentNode.removeChild(a.current), a.current = null));
|
|
127
|
+
const r = t.data, c = g !== void 0 ? g : r.data;
|
|
128
|
+
o.set("", c);
|
|
128
129
|
const n = {
|
|
129
130
|
templates: r.templates ?? r.listForms ?? {},
|
|
130
131
|
renderView: r.renderView ?? {},
|
|
131
132
|
items: Object.keys(r.renderView ?? {}),
|
|
132
|
-
rawAppRjBuild:
|
|
133
|
-
},
|
|
134
|
-
if (!Array.isArray(
|
|
135
|
-
|
|
133
|
+
rawAppRjBuild: m.rawAppRjBuild
|
|
134
|
+
}, P = r.additionalDataSource;
|
|
135
|
+
if (!Array.isArray(P) || P.length === 0) {
|
|
136
|
+
v((e) => ({ ...e, ...n }));
|
|
136
137
|
return;
|
|
137
138
|
}
|
|
138
|
-
const x =
|
|
139
|
-
var
|
|
139
|
+
const x = P.filter((e) => e.blocking === !0), V = P.filter((e) => e.blocking !== !0), _ = (e) => !e || e === "data" ? "" : e.startsWith("data.") ? e.substring(5) : e, J = async (e, i) => {
|
|
140
|
+
var X;
|
|
141
|
+
const { fallbackDataSource: D, ...l } = e, K = async (p) => {
|
|
142
|
+
D ? (console.warn(`additionalDataSource item ${i}: ${p} — trying fallbackDataSource.`), await J(D, i)) : console.warn(`additionalDataSource item ${i}: ${p}.`, l);
|
|
143
|
+
}, Q = vt(l.src, (p) => o.get(p));
|
|
144
|
+
if (!Q) {
|
|
145
|
+
await K("could not resolve 'src'");
|
|
146
|
+
return;
|
|
147
|
+
}
|
|
148
|
+
const w = {
|
|
149
|
+
method: ((X = l.method) == null ? void 0 : X.toUpperCase()) || "GET",
|
|
150
|
+
url: Q
|
|
151
|
+
};
|
|
152
|
+
s && Object.keys(s).length > 0 && (w.headers = s);
|
|
153
|
+
let k;
|
|
140
154
|
try {
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
headers: y.headers || {},
|
|
154
|
-
body: y.data
|
|
155
|
-
}, ot = {
|
|
155
|
+
k = await L(w);
|
|
156
|
+
} catch (p) {
|
|
157
|
+
await K(`HTTP request failed (${p.message})`);
|
|
158
|
+
return;
|
|
159
|
+
}
|
|
160
|
+
try {
|
|
161
|
+
const p = {
|
|
162
|
+
url: w.url,
|
|
163
|
+
method: w.method,
|
|
164
|
+
headers: w.headers || {},
|
|
165
|
+
body: w.data
|
|
166
|
+
}, st = {
|
|
156
167
|
headers: k.headers || {},
|
|
157
168
|
status: k.status,
|
|
158
169
|
data: k.data
|
|
159
|
-
},
|
|
160
|
-
requestContext:
|
|
161
|
-
responseContext:
|
|
170
|
+
}, b = bt({
|
|
171
|
+
requestContext: p,
|
|
172
|
+
responseContext: st,
|
|
162
173
|
responseBody: k.data,
|
|
163
174
|
// additionalDataSource always processes raw data, not RjBuild.
|
|
164
175
|
isRjBuild: !1,
|
|
165
|
-
dataProcessors: (
|
|
176
|
+
dataProcessors: (E == null ? void 0 : E.dataProcessor) || {}
|
|
166
177
|
});
|
|
167
|
-
if (
|
|
168
|
-
const
|
|
178
|
+
if (l.dataMapping) {
|
|
179
|
+
const f = {
|
|
169
180
|
headersForRjBuild: s,
|
|
170
|
-
plugins:
|
|
181
|
+
plugins: E,
|
|
171
182
|
get templateData() {
|
|
172
|
-
return
|
|
183
|
+
return o.get("");
|
|
173
184
|
},
|
|
174
185
|
templatePath: "data",
|
|
175
|
-
setData: (
|
|
176
|
-
updateData: (
|
|
177
|
-
const
|
|
178
|
-
|
|
186
|
+
setData: (d) => o.set("", d),
|
|
187
|
+
updateData: (d, G, ct) => {
|
|
188
|
+
const it = _(G);
|
|
189
|
+
o.set(it, d, ct);
|
|
179
190
|
}
|
|
180
|
-
},
|
|
191
|
+
}, A = {
|
|
181
192
|
get templateData() {
|
|
182
|
-
return
|
|
193
|
+
return o.get("");
|
|
183
194
|
},
|
|
184
195
|
templatePath: "data"
|
|
185
196
|
};
|
|
186
197
|
try {
|
|
187
|
-
|
|
188
|
-
dataMapping:
|
|
189
|
-
responseData:
|
|
190
|
-
globalDataContext:
|
|
191
|
-
templateContext:
|
|
198
|
+
St({
|
|
199
|
+
dataMapping: l.dataMapping,
|
|
200
|
+
responseData: b,
|
|
201
|
+
globalDataContext: f,
|
|
202
|
+
templateContext: A
|
|
192
203
|
});
|
|
193
204
|
return;
|
|
194
|
-
} catch (
|
|
195
|
-
console.error("Error applying dataMapping for additionalDataSource:",
|
|
205
|
+
} catch (d) {
|
|
206
|
+
console.error("Error applying dataMapping for additionalDataSource:", d);
|
|
196
207
|
}
|
|
197
208
|
}
|
|
198
|
-
if (!
|
|
199
|
-
if (typeof
|
|
209
|
+
if (!l.path) {
|
|
210
|
+
if (typeof b != "object" || Array.isArray(b)) {
|
|
200
211
|
console.warn(
|
|
201
212
|
"additionalDataSource data cannot be merged at root - must be an object:",
|
|
202
|
-
|
|
213
|
+
b
|
|
203
214
|
);
|
|
204
215
|
return;
|
|
205
216
|
}
|
|
206
|
-
Object.entries(
|
|
207
|
-
|
|
217
|
+
Object.entries(b).forEach(([f, A]) => {
|
|
218
|
+
o.set(f, A);
|
|
208
219
|
});
|
|
209
220
|
return;
|
|
210
221
|
}
|
|
211
222
|
try {
|
|
212
|
-
const
|
|
213
|
-
templateData:
|
|
223
|
+
const f = {
|
|
224
|
+
templateData: o.get(""),
|
|
214
225
|
// use current snapshot
|
|
215
226
|
templatePath: "data"
|
|
216
|
-
},
|
|
217
|
-
templateData:
|
|
227
|
+
}, A = {
|
|
228
|
+
templateData: o.get(""),
|
|
218
229
|
// use current snapshot
|
|
219
230
|
templatePath: "data"
|
|
220
|
-
},
|
|
221
|
-
dataLocation:
|
|
231
|
+
}, d = Dt({
|
|
232
|
+
dataLocation: l.path,
|
|
222
233
|
currentPath: "data",
|
|
223
|
-
globalDataContext:
|
|
224
|
-
templateContext:
|
|
234
|
+
globalDataContext: f,
|
|
235
|
+
templateContext: A
|
|
225
236
|
});
|
|
226
|
-
if (typeof
|
|
237
|
+
if (typeof d != "string") {
|
|
227
238
|
console.warn(
|
|
228
239
|
"additionalDataSource path evaluation did not result in a string:",
|
|
229
|
-
|
|
240
|
+
l.path,
|
|
230
241
|
"->",
|
|
231
|
-
|
|
242
|
+
d
|
|
232
243
|
);
|
|
233
244
|
return;
|
|
234
245
|
}
|
|
235
|
-
const
|
|
236
|
-
|
|
237
|
-
} catch (
|
|
238
|
-
console.error("Error evaluating additionalDataSource path:",
|
|
246
|
+
const G = _(d);
|
|
247
|
+
o.set(G, b);
|
|
248
|
+
} catch (f) {
|
|
249
|
+
console.error("Error evaluating additionalDataSource path:", l.path, f);
|
|
239
250
|
}
|
|
240
|
-
} catch (
|
|
241
|
-
console.error("Error
|
|
251
|
+
} catch (p) {
|
|
252
|
+
console.error("Error processing additionalDataSource response:", l.src, p);
|
|
242
253
|
}
|
|
243
254
|
};
|
|
244
255
|
(async () => {
|
|
245
256
|
if (x.length > 0) {
|
|
246
|
-
const e = x.map((
|
|
257
|
+
const e = x.map((i, D) => J(i, D));
|
|
247
258
|
await Promise.allSettled(e);
|
|
248
259
|
}
|
|
249
|
-
if (
|
|
250
|
-
const e =
|
|
251
|
-
(
|
|
260
|
+
if (v((e) => ({ ...e, ...n })), V.length > 0) {
|
|
261
|
+
const e = V.map(
|
|
262
|
+
(i, D) => J(i, x.length + D)
|
|
252
263
|
);
|
|
253
264
|
Promise.allSettled(e);
|
|
254
265
|
}
|
|
255
266
|
})();
|
|
256
|
-
}, [
|
|
257
|
-
function
|
|
258
|
-
if (
|
|
267
|
+
}, [m.rawAppRjBuild, g, o]);
|
|
268
|
+
function B(t, r, c) {
|
|
269
|
+
if (!$ || $.size === 0)
|
|
259
270
|
return !1;
|
|
260
|
-
for (const [n,
|
|
271
|
+
for (const [n, P] of $)
|
|
261
272
|
if (t === n || t.startsWith(n + ".") || n === "") {
|
|
262
273
|
const x = n === "" ? t : t.substring(n.length + 1);
|
|
263
274
|
try {
|
|
264
|
-
return
|
|
265
|
-
} catch (
|
|
266
|
-
console.warn("Error during upstream update:",
|
|
275
|
+
return P(r, x, c), !0;
|
|
276
|
+
} catch (V) {
|
|
277
|
+
console.warn("Error during upstream update:", V);
|
|
267
278
|
break;
|
|
268
279
|
}
|
|
269
280
|
}
|
|
270
281
|
return !1;
|
|
271
282
|
}
|
|
272
|
-
const
|
|
273
|
-
|
|
274
|
-
},
|
|
283
|
+
const rt = (t) => {
|
|
284
|
+
B("", t, void 0) || o.set("", t);
|
|
285
|
+
}, ot = (t, r, c) => {
|
|
275
286
|
const n = r.startsWith("data.") ? r.substring(5) : r === "data" ? "" : r;
|
|
276
|
-
|
|
277
|
-
},
|
|
278
|
-
element:
|
|
287
|
+
B(n, t, c) || o.set(n, t, c);
|
|
288
|
+
}, at = {
|
|
289
|
+
element: m.templates,
|
|
279
290
|
headersForRjBuild: s,
|
|
280
|
-
plugins:
|
|
281
|
-
ReactiveJsonRoot:
|
|
282
|
-
setData:
|
|
283
|
-
updateData:
|
|
291
|
+
plugins: E,
|
|
292
|
+
ReactiveJsonRoot: At,
|
|
293
|
+
setData: rt,
|
|
294
|
+
updateData: ot,
|
|
284
295
|
// experimental: expose store for advanced usage
|
|
285
|
-
store:
|
|
296
|
+
store: o,
|
|
286
297
|
// fallback: get data from store directly (non-reactive access)
|
|
287
298
|
get templateData() {
|
|
288
|
-
return
|
|
299
|
+
return o.get("");
|
|
289
300
|
},
|
|
290
301
|
templatePath: "data"
|
|
291
|
-
},
|
|
292
|
-
|
|
302
|
+
}, H = m.items.map((t) => /* @__PURE__ */ u(
|
|
303
|
+
xt,
|
|
293
304
|
{
|
|
294
305
|
datafield: t,
|
|
295
306
|
path: "data." + t,
|
|
296
|
-
props:
|
|
307
|
+
props: m.renderView[t]
|
|
297
308
|
},
|
|
298
309
|
t
|
|
299
|
-
)),
|
|
300
|
-
return /* @__PURE__ */
|
|
310
|
+
)), nt = Et(tt);
|
|
311
|
+
return /* @__PURE__ */ u(yt.Provider, { value: o, children: /* @__PURE__ */ u(ft, { children: /* @__PURE__ */ u(gt.Provider, { value: at, children: /* @__PURE__ */ u(Pt.Provider, { value: {
|
|
301
312
|
// Same here, getter for compatibility, but won't trigger updates
|
|
302
313
|
get templateData() {
|
|
303
|
-
return
|
|
314
|
+
return o.get("");
|
|
304
315
|
},
|
|
305
316
|
templatePath: "data"
|
|
306
|
-
}, children:
|
|
307
|
-
/* @__PURE__ */
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
] }) : /* @__PURE__ */
|
|
311
|
-
|
|
312
|
-
|
|
317
|
+
}, children: nt && q ? /* @__PURE__ */ Y(et, { children: [
|
|
318
|
+
/* @__PURE__ */ u(q, { children: H }),
|
|
319
|
+
z && /* @__PURE__ */ u(kt, { Wrapper: z }),
|
|
320
|
+
j
|
|
321
|
+
] }) : /* @__PURE__ */ Y(lt, { children: [
|
|
322
|
+
H,
|
|
323
|
+
j
|
|
313
324
|
] }) }) }) }) });
|
|
314
325
|
};
|
|
315
326
|
export {
|
|
316
|
-
|
|
327
|
+
At as ReactiveJsonRoot
|
|
317
328
|
};
|
package/dist/engine/index.js
CHANGED
|
@@ -6,8 +6,8 @@ import { EventDispatcherProvider as f, addEventListener as s, removeEventListene
|
|
|
6
6
|
import { GlobalDataContext as c } from "./GlobalDataContext.js";
|
|
7
7
|
import { GlobalDataContextProvider as D } from "./GlobalDataContextProvider.js";
|
|
8
8
|
import { PaginationContext as b } from "./PaginationContext.js";
|
|
9
|
-
import { ReactiveJsonRoot as
|
|
10
|
-
import { StoreContext as
|
|
9
|
+
import { ReactiveJsonRoot as P } from "./ReactiveJsonRoot.js";
|
|
10
|
+
import { StoreContext as S, StoreProvider as T, useStore as A } from "./StoreContext.js";
|
|
11
11
|
import { TemplateContext as V } from "./TemplateContext.js";
|
|
12
12
|
import { dataLocationToPath as L, evaluateAttributes as y, evaluateTemplateValue as z, evaluateTemplateValueCollection as F, isTemplateValue as J, useEvaluatedAttributes as B } from "./TemplateSystem.js";
|
|
13
13
|
import { useReactiveData as j } from "./hook/useReactiveData.js";
|
|
@@ -19,8 +19,9 @@ import { formatString as Q, maybeFormatString as U } from "./utility/formatStrin
|
|
|
19
19
|
import { propsDataLocationToPathAndValue as X } from "./utility/formElementsCommon.js";
|
|
20
20
|
import { parseRjBuild as Z } from "./utility/parseRjBuild.js";
|
|
21
21
|
import { normalizeAttributeNameForReactJsx as $, normalizeAttributesForReactJsx as ee } from "./utility/reactJsxHelpers.js";
|
|
22
|
-
import {
|
|
23
|
-
import {
|
|
22
|
+
import { interpolateSegments as oe } from "./utility/interpolateSegments.js";
|
|
23
|
+
import { stringToBoolean as ae } from "./utility/stringToBoolean.js";
|
|
24
|
+
import { View as me } from "./View.js";
|
|
24
25
|
export {
|
|
25
26
|
o as ActionDependant,
|
|
26
27
|
n as DataStore,
|
|
@@ -29,11 +30,11 @@ export {
|
|
|
29
30
|
c as GlobalDataContext,
|
|
30
31
|
D as GlobalDataContextProvider,
|
|
31
32
|
b as PaginationContext,
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
33
|
+
P as ReactiveJsonRoot,
|
|
34
|
+
S as StoreContext,
|
|
35
|
+
T as StoreProvider,
|
|
35
36
|
V as TemplateContext,
|
|
36
|
-
|
|
37
|
+
me as View,
|
|
37
38
|
s as addEventListener,
|
|
38
39
|
M as alterData,
|
|
39
40
|
O as analyzeDataOverrideReferences,
|
|
@@ -43,6 +44,7 @@ export {
|
|
|
43
44
|
z as evaluateTemplateValue,
|
|
44
45
|
F as evaluateTemplateValueCollection,
|
|
45
46
|
Q as formatString,
|
|
47
|
+
oe as interpolateSegments,
|
|
46
48
|
J as isTemplateValue,
|
|
47
49
|
r as isValid,
|
|
48
50
|
U as maybeFormatString,
|
|
@@ -53,8 +55,8 @@ export {
|
|
|
53
55
|
X as propsDataLocationToPathAndValue,
|
|
54
56
|
u as removeEventListener,
|
|
55
57
|
I as replaceEventPlaceholders,
|
|
56
|
-
|
|
58
|
+
ae as stringToBoolean,
|
|
57
59
|
B as useEvaluatedAttributes,
|
|
58
60
|
j as useReactiveData,
|
|
59
|
-
|
|
61
|
+
A as useStore
|
|
60
62
|
};
|
|
@@ -4,19 +4,21 @@ import { applyDataMapping as m } from "./dataMappingSystem.js";
|
|
|
4
4
|
import { replaceEventPlaceholders as f } from "./eventPlaceholderSystem.js";
|
|
5
5
|
import { formatString as l, maybeFormatString as x } from "./formatString.js";
|
|
6
6
|
import { propsDataLocationToPathAndValue as c } from "./formElementsCommon.js";
|
|
7
|
-
import { parseRjBuild as
|
|
7
|
+
import { parseRjBuild as d } from "./parseRjBuild.js";
|
|
8
8
|
import { normalizeAttributeNameForReactJsx as D, normalizeAttributesForReactJsx as R } from "./reactJsxHelpers.js";
|
|
9
|
-
import {
|
|
9
|
+
import { interpolateSegments as y } from "./interpolateSegments.js";
|
|
10
|
+
import { stringToBoolean as A } from "./stringToBoolean.js";
|
|
10
11
|
export {
|
|
11
12
|
o as alterData,
|
|
12
13
|
a as analyzeDataOverrideReferences,
|
|
13
14
|
m as applyDataMapping,
|
|
14
15
|
l as formatString,
|
|
16
|
+
y as interpolateSegments,
|
|
15
17
|
x as maybeFormatString,
|
|
16
18
|
D as normalizeAttributeNameForReactJsx,
|
|
17
19
|
R as normalizeAttributesForReactJsx,
|
|
18
|
-
|
|
20
|
+
d as parseRjBuild,
|
|
19
21
|
c as propsDataLocationToPathAndValue,
|
|
20
22
|
f as replaceEventPlaceholders,
|
|
21
|
-
|
|
23
|
+
A as stringToBoolean
|
|
22
24
|
};
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
const i = (e, l) => {
|
|
2
|
+
if (typeof e == "string") {
|
|
3
|
+
let t = null;
|
|
4
|
+
if (e.startsWith("~~.") ? t = e.substring(3) : e.startsWith("~.") && (t = e.substring(2)), t !== null) {
|
|
5
|
+
const r = l(t);
|
|
6
|
+
return r == null ? null : String(r);
|
|
7
|
+
}
|
|
8
|
+
return e;
|
|
9
|
+
}
|
|
10
|
+
return e == null ? null : String(e);
|
|
11
|
+
}, p = (e, l) => {
|
|
12
|
+
if (typeof e == "string")
|
|
13
|
+
return e || null;
|
|
14
|
+
if (!Array.isArray(e) || e.length === 0)
|
|
15
|
+
return null;
|
|
16
|
+
const t = [], r = [];
|
|
17
|
+
for (const n of e) {
|
|
18
|
+
if (n !== null && typeof n == "object") {
|
|
19
|
+
if ("param" in n) {
|
|
20
|
+
const o = i(n.param, l), s = i(n.value, l);
|
|
21
|
+
if (!o || !s) {
|
|
22
|
+
if (n.required)
|
|
23
|
+
return console.warn(
|
|
24
|
+
`interpolateSegments: required param "${n.param}" resolved to empty key or value — aborting URL.`
|
|
25
|
+
), null;
|
|
26
|
+
continue;
|
|
27
|
+
}
|
|
28
|
+
r.push(
|
|
29
|
+
`${encodeURIComponent(o)}=${encodeURIComponent(s)}`
|
|
30
|
+
);
|
|
31
|
+
continue;
|
|
32
|
+
}
|
|
33
|
+
if ("segment" in n) {
|
|
34
|
+
const o = i(n.segment, l);
|
|
35
|
+
if (!o) {
|
|
36
|
+
if (n.required)
|
|
37
|
+
return console.warn(
|
|
38
|
+
`interpolateSegments: required segment "${n.segment}" resolved to empty — aborting URL.`
|
|
39
|
+
), null;
|
|
40
|
+
t.push("");
|
|
41
|
+
continue;
|
|
42
|
+
}
|
|
43
|
+
t.push(o);
|
|
44
|
+
continue;
|
|
45
|
+
}
|
|
46
|
+
console.warn("interpolateSegments: unrecognized segment object.", n);
|
|
47
|
+
continue;
|
|
48
|
+
}
|
|
49
|
+
if (typeof n == "string") {
|
|
50
|
+
const o = i(n, l);
|
|
51
|
+
o === null ? (console.warn(
|
|
52
|
+
`interpolateSegments: reference "${n}" resolved to null.`
|
|
53
|
+
), t.push("")) : t.push(o);
|
|
54
|
+
continue;
|
|
55
|
+
}
|
|
56
|
+
t.push(String(n ?? ""));
|
|
57
|
+
}
|
|
58
|
+
const u = t.join(""), a = r.length > 0 ? "?" + r.join("&") : "";
|
|
59
|
+
return u + a || null;
|
|
60
|
+
};
|
|
61
|
+
export {
|
|
62
|
+
p as interpolateSegments
|
|
63
|
+
};
|
package/dist/main.js
CHANGED
|
@@ -35,117 +35,118 @@ import { formatString as Se, maybeFormatString as he } from "./engine/utility/fo
|
|
|
35
35
|
import { propsDataLocationToPathAndValue as Ee } from "./engine/utility/formElementsCommon.js";
|
|
36
36
|
import { parseRjBuild as Ve } from "./engine/utility/parseRjBuild.js";
|
|
37
37
|
import { normalizeAttributeNameForReactJsx as He, normalizeAttributesForReactJsx as Me } from "./engine/utility/reactJsxHelpers.js";
|
|
38
|
-
import {
|
|
39
|
-
import {
|
|
40
|
-
import {
|
|
41
|
-
import {
|
|
42
|
-
import {
|
|
43
|
-
import {
|
|
44
|
-
import {
|
|
45
|
-
import {
|
|
46
|
-
import {
|
|
47
|
-
import {
|
|
48
|
-
import {
|
|
49
|
-
import {
|
|
50
|
-
import {
|
|
51
|
-
import {
|
|
52
|
-
import {
|
|
53
|
-
import {
|
|
54
|
-
import {
|
|
55
|
-
import {
|
|
56
|
-
import {
|
|
57
|
-
import {
|
|
58
|
-
import {
|
|
59
|
-
import {
|
|
60
|
-
import {
|
|
61
|
-
import {
|
|
62
|
-
import {
|
|
63
|
-
import {
|
|
64
|
-
import {
|
|
65
|
-
import {
|
|
66
|
-
import {
|
|
67
|
-
import {
|
|
68
|
-
import {
|
|
69
|
-
import {
|
|
70
|
-
import {
|
|
71
|
-
import {
|
|
72
|
-
import {
|
|
73
|
-
import {
|
|
74
|
-
import {
|
|
75
|
-
import {
|
|
76
|
-
import {
|
|
77
|
-
import {
|
|
78
|
-
import {
|
|
79
|
-
import {
|
|
80
|
-
import {
|
|
81
|
-
import {
|
|
82
|
-
import {
|
|
83
|
-
import {
|
|
84
|
-
import {
|
|
85
|
-
import {
|
|
86
|
-
import {
|
|
87
|
-
import {
|
|
38
|
+
import { interpolateSegments as Be } from "./engine/utility/interpolateSegments.js";
|
|
39
|
+
import { stringToBoolean as ke } from "./engine/utility/stringToBoolean.js";
|
|
40
|
+
import { View as Ne } from "./engine/View.js";
|
|
41
|
+
import { simpleMapping as Ue } from "./component/dataMapping/simpleMapping.js";
|
|
42
|
+
import { VariablesDebug as Ie } from "./component/element/debug/VariablesDebug/VariablesDebug.js";
|
|
43
|
+
import { Input as We } from "./component/element/form/Input.js";
|
|
44
|
+
import { CheckBoxField as qe } from "./component/element/form/CheckBoxField.js";
|
|
45
|
+
import { ColorField as Qe } from "./component/element/form/ColorField.js";
|
|
46
|
+
import { DateField as Ye } from "./component/element/form/DateField.js";
|
|
47
|
+
import { DateTimeField as _e } from "./component/element/form/DateTimeField.js";
|
|
48
|
+
import { EmailField as eo } from "./component/element/form/EmailField.js";
|
|
49
|
+
import { FileField as ro } from "./component/element/form/FileField.js";
|
|
50
|
+
import { HiddenField as ao } from "./component/element/form/HiddenField.js";
|
|
51
|
+
import { MonthField as po } from "./component/element/form/MonthField.js";
|
|
52
|
+
import { NumberField as fo } from "./component/element/form/NumberField.js";
|
|
53
|
+
import { PasswordField as lo } from "./component/element/form/PasswordField.js";
|
|
54
|
+
import { RangeField as so } from "./component/element/form/RangeField.js";
|
|
55
|
+
import { SearchField as co } from "./component/element/form/SearchField.js";
|
|
56
|
+
import { SelectField as Do } from "./component/element/form/SelectField.js";
|
|
57
|
+
import { TelField as Co } from "./component/element/form/TelField.js";
|
|
58
|
+
import { TextAreaField as go } from "./component/element/form/TextAreaField.js";
|
|
59
|
+
import { TextField as Ro } from "./component/element/form/TextField.js";
|
|
60
|
+
import { TimeField as ho } from "./component/element/form/TimeField.js";
|
|
61
|
+
import { UrlField as Eo } from "./component/element/form/UrlField.js";
|
|
62
|
+
import { WeekField as Vo } from "./component/element/form/WeekField.js";
|
|
63
|
+
import { FolderSortableTree as Ho } from "./component/element/html/FolderSortableTree.js";
|
|
64
|
+
import { FormatNumeral as yo } from "./component/element/html/FormatNumeral.js";
|
|
65
|
+
import { Html as Jo } from "./component/element/html/Html.js";
|
|
66
|
+
import { LabelFromValue as wo } from "./component/element/html/LabelFromValue.js";
|
|
67
|
+
import { PreformattedMarkup as zo } from "./component/element/html/PreformattedMarkup.js";
|
|
68
|
+
import { SortableTreeItemCollapseButton as Go } from "./component/element/html/SortableTreeItemCollapseButton.js";
|
|
69
|
+
import { Count as Oo } from "./component/element/special/Count.js";
|
|
70
|
+
import { DataFilter as jo } from "./component/element/special/DataFilter.js";
|
|
71
|
+
import { DataSync as Ko } from "./component/element/special/DataSync.js";
|
|
72
|
+
import { DelayedActions as Xo, getReactionFunctionsToExecute as Yo } from "./component/element/special/DelayedActions.js";
|
|
73
|
+
import { PageControls as _o } from "./component/element/special/PageControls.js";
|
|
74
|
+
import { Phantom as er } from "./component/element/special/Phantom.js";
|
|
75
|
+
import { ReactiveJsonBasicComponentWrapper as rr } from "./component/element/special/ReactiveJsonBasicComponentWrapper.js";
|
|
76
|
+
import { ReactiveJsonSubroot as ar } from "./component/element/special/ReactiveJsonSubroot.js";
|
|
77
|
+
import { Switch as pr } from "./component/element/special/Switch.js";
|
|
78
|
+
import { addData as fr } from "./component/reaction/addData.js";
|
|
79
|
+
import { fetchData as lr } from "./component/reaction/fetchData.js";
|
|
80
|
+
import { executeHttpRequest as sr } from "./component/reaction/utility/httpRequestCommon.js";
|
|
81
|
+
import { moveData as ur } from "./component/reaction/moveData.js";
|
|
82
|
+
import { postMessage as Fr } from "./component/reaction/postMessage.js";
|
|
83
|
+
import { redirectNow as vr } from "./component/reaction/redirectNow.js";
|
|
84
|
+
import { removeData as br } from "./component/reaction/removeData.js";
|
|
85
|
+
import { setClipboardData as Tr } from "./component/reaction/setClipboardData.js";
|
|
86
|
+
import { setData as Sr } from "./component/reaction/setData.js";
|
|
87
|
+
import { submitData as Ar } from "./component/reaction/submitData.js";
|
|
88
|
+
import { triggerEvent as Pr } from "./component/reaction/triggerEvent.js";
|
|
88
89
|
export {
|
|
89
90
|
B as ActionDependant,
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
91
|
+
qe as CheckBoxField,
|
|
92
|
+
Qe as ColorField,
|
|
93
|
+
Oo as Count,
|
|
93
94
|
r as CustomEventListener,
|
|
94
|
-
|
|
95
|
+
jo as DataFilter,
|
|
95
96
|
z as DataStore,
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
97
|
+
Ko as DataSync,
|
|
98
|
+
Ye as DateField,
|
|
99
|
+
_e as DateTimeField,
|
|
100
|
+
Xo as DelayedActions,
|
|
101
|
+
eo as EmailField,
|
|
101
102
|
G as EventDispatcherContext,
|
|
102
103
|
O as EventDispatcherProvider,
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
104
|
+
ro as FileField,
|
|
105
|
+
Ho as FolderSortableTree,
|
|
106
|
+
yo as FormatNumeral,
|
|
106
107
|
K as GlobalDataContext,
|
|
107
108
|
X as GlobalDataContextProvider,
|
|
108
109
|
a as HashChangeListener,
|
|
109
|
-
|
|
110
|
+
ao as HiddenField,
|
|
110
111
|
p as Hide,
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
112
|
+
Jo as Html,
|
|
113
|
+
We as Input,
|
|
114
|
+
wo as LabelFromValue,
|
|
114
115
|
f as MessageListener,
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
116
|
+
po as MonthField,
|
|
117
|
+
fo as NumberField,
|
|
118
|
+
_o as PageControls,
|
|
118
119
|
Z as PaginationContext,
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
120
|
+
lo as PasswordField,
|
|
121
|
+
er as Phantom,
|
|
122
|
+
zo as PreformattedMarkup,
|
|
123
|
+
so as RangeField,
|
|
123
124
|
l as ReactOnEvent,
|
|
124
|
-
|
|
125
|
+
rr as ReactiveJsonBasicComponentWrapper,
|
|
125
126
|
$ as ReactiveJsonRoot,
|
|
126
|
-
|
|
127
|
+
ar as ReactiveJsonSubroot,
|
|
127
128
|
s as Redirect,
|
|
128
|
-
|
|
129
|
-
|
|
129
|
+
co as SearchField,
|
|
130
|
+
Do as SelectField,
|
|
130
131
|
u as SetAttributeValue,
|
|
131
|
-
|
|
132
|
+
Go as SortableTreeItemCollapseButton,
|
|
132
133
|
oe as StoreContext,
|
|
133
134
|
re as StoreProvider,
|
|
134
|
-
|
|
135
|
-
|
|
135
|
+
pr as Switch,
|
|
136
|
+
Co as TelField,
|
|
136
137
|
me as TemplateContext,
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
138
|
+
go as TextAreaField,
|
|
139
|
+
Ro as TextField,
|
|
140
|
+
ho as TimeField,
|
|
140
141
|
F as ToggleAttributeValue,
|
|
141
142
|
v as UnsetAttribute,
|
|
142
143
|
b as UnsetAttributeValue,
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
144
|
+
Eo as UrlField,
|
|
145
|
+
Ie as VariablesDebug,
|
|
146
|
+
Ne as View,
|
|
146
147
|
T as VisuallyHide,
|
|
147
|
-
|
|
148
|
-
|
|
148
|
+
Vo as WeekField,
|
|
149
|
+
fr as addData,
|
|
149
150
|
W as addEventListener,
|
|
150
151
|
Fe as alterData,
|
|
151
152
|
ve as analyzeDataOverrideReferences,
|
|
@@ -159,30 +160,31 @@ export {
|
|
|
159
160
|
fe as evaluateAttributes,
|
|
160
161
|
ie as evaluateTemplateValue,
|
|
161
162
|
le as evaluateTemplateValueCollection,
|
|
162
|
-
|
|
163
|
-
|
|
163
|
+
sr as executeHttpRequest,
|
|
164
|
+
lr as fetchData,
|
|
164
165
|
Se as formatString,
|
|
165
|
-
|
|
166
|
+
Yo as getReactionFunctionsToExecute,
|
|
167
|
+
Be as interpolateSegments,
|
|
166
168
|
ne as isTemplateValue,
|
|
167
169
|
J as isValid,
|
|
168
170
|
he as maybeFormatString,
|
|
169
171
|
w as mergeComponentCollections,
|
|
170
|
-
|
|
172
|
+
ur as moveData,
|
|
171
173
|
He as normalizeAttributeNameForReactJsx,
|
|
172
174
|
Me as normalizeAttributesForReactJsx,
|
|
173
175
|
Ve as parseRjBuild,
|
|
174
|
-
|
|
176
|
+
Fr as postMessage,
|
|
175
177
|
Ee as propsDataLocationToPathAndValue,
|
|
176
|
-
|
|
177
|
-
|
|
178
|
+
vr as redirectNow,
|
|
179
|
+
br as removeData,
|
|
178
180
|
j as removeEventListener,
|
|
179
181
|
Te as replaceEventPlaceholders,
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
182
|
+
Tr as setClipboardData,
|
|
183
|
+
Sr as setData,
|
|
184
|
+
Ue as simpleMapping,
|
|
185
|
+
ke as stringToBoolean,
|
|
186
|
+
Ar as submitData,
|
|
187
|
+
Pr as triggerEvent,
|
|
186
188
|
se as useEvaluatedAttributes,
|
|
187
189
|
ue as useReactiveData,
|
|
188
190
|
te as useStore
|