@valbuild/react 0.16.0 → 0.18.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/ValUI-3e00aae3.cjs.prod.js +104 -0
- package/dist/ValUI-64e3e5f2.browser.esm.js +102 -0
- package/dist/ValUI-9ac161d2.cjs.dev.js +104 -0
- package/dist/ValUI-d33998d0.esm.js +102 -0
- package/dist/declarations/src/ValProvider.d.ts +1 -1
- package/dist/declarations/src/ValStore.d.ts +8 -9
- package/dist/declarations/src/index.d.ts +1 -2
- package/dist/declarations/src/stega/index.d.ts +1 -3
- package/dist/declarations/src/stega/{stegaEncode.d.ts → transform.d.ts} +8 -5
- package/dist/{defineProperty-12b5bd29.esm.js → defineProperty-034d0378.browser.esm.js} +1 -1
- package/dist/{defineProperty-a4bf59bc.worker.esm.js → defineProperty-18559492.worker.esm.js} +1 -1
- package/dist/{defineProperty-f319cb47.browser.esm.js → defineProperty-b209a901.esm.js} +1 -1
- package/dist/{slicedToArray-d846e1d2.esm.js → slicedToArray-0cbb3d34.browser.esm.js} +13 -10
- package/dist/{slicedToArray-9e7d1407.worker.esm.js → slicedToArray-5a51fd33.worker.esm.js} +13 -10
- package/dist/{slicedToArray-b7cf26e0.cjs.dev.js → slicedToArray-5bddfa58.cjs.prod.js} +14 -11
- package/dist/slicedToArray-7b1713a7.cjs.dev.js +59 -0
- package/dist/{slicedToArray-1a246338.browser.esm.js → slicedToArray-b4fb91fa.esm.js} +13 -10
- package/dist/typeof-16c77f45.cjs.prod.js +13 -0
- package/dist/typeof-1de657a3.cjs.dev.js +13 -0
- package/dist/typeof-52fabea9.browser.esm.js +11 -0
- package/dist/typeof-5c86a240.esm.js +11 -0
- package/dist/typeof-8854ace1.worker.esm.js +11 -0
- package/dist/valbuild-react.browser.esm.js +618 -24
- package/dist/valbuild-react.cjs.dev.js +621 -28
- package/dist/valbuild-react.cjs.prod.js +621 -28
- package/dist/valbuild-react.esm.js +618 -24
- package/dist/valbuild-react.worker.esm.js +616 -24
- package/jsx-dev-runtime/dist/valbuild-react-jsx-dev-runtime.browser.esm.js +2 -2
- package/jsx-dev-runtime/dist/valbuild-react-jsx-dev-runtime.cjs.dev.js +3 -3
- package/jsx-dev-runtime/dist/valbuild-react-jsx-dev-runtime.cjs.prod.js +3 -3
- package/jsx-dev-runtime/dist/valbuild-react-jsx-dev-runtime.esm.js +2 -2
- package/jsx-dev-runtime/dist/valbuild-react-jsx-dev-runtime.worker.esm.js +2 -2
- package/jsx-runtime/dist/valbuild-react-jsx-runtime.browser.esm.js +2 -2
- package/jsx-runtime/dist/valbuild-react-jsx-runtime.cjs.dev.js +3 -3
- package/jsx-runtime/dist/valbuild-react-jsx-runtime.cjs.prod.js +3 -3
- package/jsx-runtime/dist/valbuild-react-jsx-runtime.esm.js +2 -2
- package/jsx-runtime/dist/valbuild-react-jsx-runtime.worker.esm.js +2 -2
- package/package.json +3 -3
- package/src/ValProvider.tsx +2 -3
- package/src/ValStore.ts +90 -40
- package/src/ValUI.tsx +49 -339
- package/src/index.ts +1 -2
- package/src/stega/autoTagJSX.ts +1 -1
- package/src/stega/index.ts +6 -3
- package/src/stega/transform.test.ts +145 -0
- package/src/stega/transform.ts +220 -0
- package/stega/dist/valbuild-react-stega.browser.esm.js +131 -46
- package/stega/dist/valbuild-react-stega.cjs.dev.js +134 -49
- package/stega/dist/valbuild-react-stega.cjs.prod.js +134 -49
- package/stega/dist/valbuild-react-stega.esm.js +131 -46
- package/stega/dist/valbuild-react-stega.worker.esm.js +109 -45
- package/dist/ValProvider-061ff397.cjs.dev.js +0 -715
- package/dist/ValProvider-b46efd66.browser.esm.js +0 -701
- package/dist/ValProvider-cb5a2161.worker.esm.js +0 -696
- package/dist/ValProvider-d7afb84b.cjs.js +0 -7
- package/dist/ValProvider-d7afb84b.cjs.prod.js +0 -715
- package/dist/ValProvider-fa35f7bd.esm.js +0 -701
- package/dist/ValUI-0bb9cc3d.cjs.prod.js +0 -383
- package/dist/ValUI-11cf8753.cjs.dev.js +0 -383
- package/dist/ValUI-13a58fa9.browser.esm.js +0 -381
- package/dist/ValUI-3d3b0d68.esm.js +0 -381
- package/dist/declarations/src/ValApi.d.ts +0 -12
- package/dist/declarations/src/hooks/useVal.d.ts +0 -3
- package/dist/declarations/src/stega/fetchVal.d.ts +0 -3
- package/dist/declarations/src/stega/hooks/useVal.d.ts +0 -3
- package/dist/objectSpread2-30cc2856.browser.esm.js +0 -25
- package/dist/objectSpread2-61fbd9a9.cjs.dev.js +0 -27
- package/dist/objectSpread2-7b752a35.cjs.prod.js +0 -27
- package/dist/objectSpread2-d5a1fe1c.esm.js +0 -25
- package/dist/slicedToArray-0eb0bcdb.cjs.prod.js +0 -56
- package/dist/unsupportedIterableToArray-51bb61c2.esm.js +0 -16
- package/dist/unsupportedIterableToArray-738344ef.worker.esm.js +0 -16
- package/dist/unsupportedIterableToArray-9e97e24a.cjs.dev.js +0 -18
- package/dist/unsupportedIterableToArray-afbea1dd.cjs.prod.js +0 -18
- package/dist/unsupportedIterableToArray-d3087ed5.browser.esm.js +0 -16
- package/src/AuthStatus.tsx +0 -13
- package/src/ValApi.ts +0 -65
- package/src/hooks/useVal.test.tsx +0 -57
- package/src/hooks/useVal.ts +0 -35
- package/src/stega/fetchVal.ts +0 -16
- package/src/stega/hooks/useVal.ts +0 -14
- package/src/stega/stegaEncode.ts +0 -84
@@ -1,383 +0,0 @@
|
|
1
|
-
'use strict';
|
2
|
-
|
3
|
-
var defineProperty = require('./defineProperty-36ed93cd.cjs.prod.js');
|
4
|
-
var objectSpread2 = require('./objectSpread2-7b752a35.cjs.prod.js');
|
5
|
-
var slicedToArray = require('./slicedToArray-0eb0bcdb.cjs.prod.js');
|
6
|
-
var ValProvider = require('./ValProvider-d7afb84b.cjs.prod.js');
|
7
|
-
var React = require('react');
|
8
|
-
var ui = require('@valbuild/ui');
|
9
|
-
var core = require('@valbuild/core');
|
10
|
-
var reactDom = require('react-dom');
|
11
|
-
var ReactJSXRuntime = require('react/jsx-runtime');
|
12
|
-
require('./unsupportedIterableToArray-afbea1dd.cjs.prod.js');
|
13
|
-
|
14
|
-
function ShadowContent(_ref) {
|
15
|
-
var root = _ref.root,
|
16
|
-
children = _ref.children;
|
17
|
-
return /*#__PURE__*/reactDom.createPortal(children, root);
|
18
|
-
}
|
19
|
-
var ShadowRoot = function ShadowRoot(_ref2) {
|
20
|
-
var children = _ref2.children;
|
21
|
-
var node = React.useRef(null);
|
22
|
-
var _useState = React.useState(null),
|
23
|
-
_useState2 = slicedToArray._slicedToArray(_useState, 2),
|
24
|
-
root = _useState2[0],
|
25
|
-
setRoot = _useState2[1];
|
26
|
-
React.useLayoutEffect(function () {
|
27
|
-
if (node.current) {
|
28
|
-
if (node.current.shadowRoot) {
|
29
|
-
setRoot(node.current.shadowRoot);
|
30
|
-
} else {
|
31
|
-
var _root = node.current.attachShadow({
|
32
|
-
mode: "open"
|
33
|
-
});
|
34
|
-
setRoot(_root);
|
35
|
-
}
|
36
|
-
}
|
37
|
-
}, []);
|
38
|
-
return /*#__PURE__*/ReactJSXRuntime.jsx("div", {
|
39
|
-
ref: node,
|
40
|
-
children: root && /*#__PURE__*/ReactJSXRuntime.jsx(ShadowContent, {
|
41
|
-
root: root,
|
42
|
-
children: children
|
43
|
-
})
|
44
|
-
});
|
45
|
-
};
|
46
|
-
|
47
|
-
function ValUI(_ref) {
|
48
|
-
var _ref3;
|
49
|
-
var valApi = _ref.valApi,
|
50
|
-
valStore = _ref.valStore;
|
51
|
-
var _useState = React.useState([]),
|
52
|
-
_useState2 = slicedToArray._slicedToArray(_useState, 2),
|
53
|
-
selectedSources = _useState2[0],
|
54
|
-
setSelectedSources = _useState2[1];
|
55
|
-
var _useState3 = React.useState(false),
|
56
|
-
_useState4 = slicedToArray._slicedToArray(_useState3, 2),
|
57
|
-
editMode = _useState4[0],
|
58
|
-
setEditMode = _useState4[1];
|
59
|
-
var _useState5 = React.useState(null),
|
60
|
-
_useState6 = slicedToArray._slicedToArray(_useState5, 2),
|
61
|
-
editFormPosition = _useState6[0],
|
62
|
-
setEditFormPosition = _useState6[1];
|
63
|
-
var _useState7 = React.useState({
|
64
|
-
status: "not-asked"
|
65
|
-
}),
|
66
|
-
_useState8 = slicedToArray._slicedToArray(_useState7, 2),
|
67
|
-
authentication = _useState8[0],
|
68
|
-
setAuthentication = _useState8[1];
|
69
|
-
React.useEffect(function () {
|
70
|
-
if (editMode) {
|
71
|
-
valStore.updateAll();
|
72
|
-
}
|
73
|
-
}, [editMode]);
|
74
|
-
React.useEffect(function () {
|
75
|
-
var openValFormListener = undefined;
|
76
|
-
var styleElement = undefined;
|
77
|
-
var editButtonClickOptions = {
|
78
|
-
capture: true,
|
79
|
-
passive: true
|
80
|
-
};
|
81
|
-
if (editMode) {
|
82
|
-
// highlight val element by appending a new style
|
83
|
-
styleElement = document.createElement("style");
|
84
|
-
styleElement.id = "val-edit-highlight";
|
85
|
-
styleElement.innerHTML = "\n .val-edit-mode >* [data-val-path] {\n outline: #ffff00 solid 1px;\n cursor: pointer;\n }\n ";
|
86
|
-
document.body.appendChild(styleElement);
|
87
|
-
|
88
|
-
// capture event clicks on data-val-path elements
|
89
|
-
openValFormListener = function openValFormListener(e) {
|
90
|
-
if (e.target instanceof Element) {
|
91
|
-
var _parent;
|
92
|
-
var parent = e.target;
|
93
|
-
while (parent && parent !== document.body) {
|
94
|
-
if (parent.getAttribute("data-val-path")) {
|
95
|
-
break;
|
96
|
-
}
|
97
|
-
if (parent.parentElement) {
|
98
|
-
parent = parent.parentElement;
|
99
|
-
} else {
|
100
|
-
break;
|
101
|
-
}
|
102
|
-
}
|
103
|
-
var valSources = (_parent = parent) === null || _parent === void 0 ? void 0 : _parent.getAttribute("data-val-path");
|
104
|
-
if (valSources) {
|
105
|
-
e.stopPropagation();
|
106
|
-
setSelectedSources(valSources.split(",") /* TODO: just split on commas will not work if path contains , */);
|
107
|
-
|
108
|
-
setEditFormPosition({
|
109
|
-
left: e.pageX,
|
110
|
-
top: e.pageY
|
111
|
-
});
|
112
|
-
// } else if (!isValElement(e.target)) {
|
113
|
-
// console.log("click outside", e.target);
|
114
|
-
// setEditFormPosition(null);
|
115
|
-
// setSelectedSources([]);
|
116
|
-
}
|
117
|
-
}
|
118
|
-
};
|
119
|
-
|
120
|
-
document.addEventListener("click", openValFormListener, editButtonClickOptions);
|
121
|
-
}
|
122
|
-
return function () {
|
123
|
-
var _styleElement;
|
124
|
-
if (openValFormListener) {
|
125
|
-
document.removeEventListener("click", openValFormListener, editButtonClickOptions);
|
126
|
-
}
|
127
|
-
(_styleElement = styleElement) === null || _styleElement === void 0 ? void 0 : _styleElement.remove();
|
128
|
-
};
|
129
|
-
}, [editMode]);
|
130
|
-
React.useEffect(function () {
|
131
|
-
if (editMode) {
|
132
|
-
document.body.classList.add("val-edit-mode");
|
133
|
-
} else {
|
134
|
-
document.body.classList.remove("val-edit-mode");
|
135
|
-
}
|
136
|
-
if (editMode) {
|
137
|
-
if (authentication.status !== "authenticated") {
|
138
|
-
valApi.getSession().then( /*#__PURE__*/function () {
|
139
|
-
var _ref2 = ValProvider._asyncToGenerator( /*#__PURE__*/ValProvider._regeneratorRuntime().mark(function _callee(res) {
|
140
|
-
var data, message;
|
141
|
-
return ValProvider._regeneratorRuntime().wrap(function _callee$(_context) {
|
142
|
-
while (1) switch (_context.prev = _context.next) {
|
143
|
-
case 0:
|
144
|
-
if (!(res.status === 401)) {
|
145
|
-
_context.next = 4;
|
146
|
-
break;
|
147
|
-
}
|
148
|
-
setAuthentication({
|
149
|
-
status: "unauthenticated"
|
150
|
-
});
|
151
|
-
_context.next = 21;
|
152
|
-
break;
|
153
|
-
case 4:
|
154
|
-
if (!res.ok) {
|
155
|
-
_context.next = 11;
|
156
|
-
break;
|
157
|
-
}
|
158
|
-
_context.next = 7;
|
159
|
-
return res.json();
|
160
|
-
case 7:
|
161
|
-
data = _context.sent;
|
162
|
-
if (data.mode === "local") {
|
163
|
-
setAuthentication({
|
164
|
-
status: "local"
|
165
|
-
});
|
166
|
-
} else if (data.mode === "proxy") {
|
167
|
-
setAuthentication({
|
168
|
-
status: "authenticated"
|
169
|
-
});
|
170
|
-
} else {
|
171
|
-
setAuthentication({
|
172
|
-
status: "error",
|
173
|
-
message: "Unknown authentication mode"
|
174
|
-
});
|
175
|
-
}
|
176
|
-
_context.next = 21;
|
177
|
-
break;
|
178
|
-
case 11:
|
179
|
-
message = "Unknown error";
|
180
|
-
_context.prev = 12;
|
181
|
-
_context.next = 15;
|
182
|
-
return res.text();
|
183
|
-
case 15:
|
184
|
-
message = _context.sent;
|
185
|
-
_context.next = 20;
|
186
|
-
break;
|
187
|
-
case 18:
|
188
|
-
_context.prev = 18;
|
189
|
-
_context.t0 = _context["catch"](12);
|
190
|
-
case 20:
|
191
|
-
setAuthentication({
|
192
|
-
status: "error",
|
193
|
-
message: message
|
194
|
-
});
|
195
|
-
case 21:
|
196
|
-
case "end":
|
197
|
-
return _context.stop();
|
198
|
-
}
|
199
|
-
}, _callee, null, [[12, 18]]);
|
200
|
-
}));
|
201
|
-
return function (_x) {
|
202
|
-
return _ref2.apply(this, arguments);
|
203
|
-
};
|
204
|
-
}())["catch"](function (err) {
|
205
|
-
console.error("Failed to fetch session", err);
|
206
|
-
setAuthentication({
|
207
|
-
status: "error",
|
208
|
-
message: "Unknown authentication mode"
|
209
|
-
});
|
210
|
-
});
|
211
|
-
}
|
212
|
-
} else {
|
213
|
-
if (authentication.status === "error") {
|
214
|
-
setAuthentication({
|
215
|
-
status: "not-asked"
|
216
|
-
});
|
217
|
-
}
|
218
|
-
}
|
219
|
-
}, [editMode, authentication.status]);
|
220
|
-
var _useState9 = React.useState(false),
|
221
|
-
_useState10 = slicedToArray._slicedToArray(_useState9, 2),
|
222
|
-
showEditButton = _useState10[0],
|
223
|
-
setShowEditButton = _useState10[1];
|
224
|
-
React.useEffect(function () {
|
225
|
-
setShowEditButton(true);
|
226
|
-
}, []);
|
227
|
-
var _useState11 = React.useState({}),
|
228
|
-
_useState12 = slicedToArray._slicedToArray(_useState11, 2),
|
229
|
-
inputs = _useState12[0],
|
230
|
-
setInputs = _useState12[1];
|
231
|
-
React.useEffect(function () {
|
232
|
-
setInputs({});
|
233
|
-
var _iterator = ValProvider._createForOfIteratorHelper(selectedSources),
|
234
|
-
_step;
|
235
|
-
try {
|
236
|
-
var _loop = function _loop() {
|
237
|
-
var path = _step.value;
|
238
|
-
valApi.getModule(path).then(function (serializedModule) {
|
239
|
-
var input;
|
240
|
-
if (serializedModule.schema.type === "string" && typeof serializedModule.source === "string") {
|
241
|
-
input = {
|
242
|
-
status: "completed",
|
243
|
-
type: "text",
|
244
|
-
data: serializedModule.source
|
245
|
-
};
|
246
|
-
} else if (serializedModule.schema.type === "richtext" && slicedToArray._typeof(serializedModule.source) === "object") {
|
247
|
-
input = {
|
248
|
-
status: "completed",
|
249
|
-
type: "richtext",
|
250
|
-
data: serializedModule.source // TODO: validate
|
251
|
-
};
|
252
|
-
} else if (serializedModule.schema.type === "image" && serializedModule.source && slicedToArray._typeof(serializedModule.source) === "object" && core.FILE_REF_PROP in serializedModule.source && typeof serializedModule.source[core.FILE_REF_PROP] === "string" && core.VAL_EXTENSION in serializedModule.source && typeof serializedModule.source[core.VAL_EXTENSION] === "string") {
|
253
|
-
input = {
|
254
|
-
status: "completed",
|
255
|
-
type: "image",
|
256
|
-
data: core.Internal.convertImageSource(serializedModule.source)
|
257
|
-
};
|
258
|
-
}
|
259
|
-
console.log("input path", path);
|
260
|
-
console.log("serialized path", serializedModule.path);
|
261
|
-
if (!input) {
|
262
|
-
throw new Error("Unsupported module type: ".concat(serializedModule.schema.type));
|
263
|
-
}
|
264
|
-
setInputs(function (inputs) {
|
265
|
-
return objectSpread2._objectSpread2(objectSpread2._objectSpread2({}, inputs), {}, defineProperty._defineProperty({}, serializedModule.path, input));
|
266
|
-
});
|
267
|
-
});
|
268
|
-
};
|
269
|
-
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
270
|
-
_loop();
|
271
|
-
}
|
272
|
-
} catch (err) {
|
273
|
-
_iterator.e(err);
|
274
|
-
} finally {
|
275
|
-
_iterator.f();
|
276
|
-
}
|
277
|
-
}, [selectedSources.join(",")]);
|
278
|
-
if (!showEditButton) {
|
279
|
-
return null;
|
280
|
-
}
|
281
|
-
return /*#__PURE__*/ReactJSXRuntime.jsxs(ShadowRoot, {
|
282
|
-
children: [/*#__PURE__*/ReactJSXRuntime.jsx("link", {
|
283
|
-
rel: "preconnect",
|
284
|
-
href: "https://fonts.googleapis.com"
|
285
|
-
}), /*#__PURE__*/ReactJSXRuntime.jsx("link", {
|
286
|
-
rel: "preconnect",
|
287
|
-
href: "https://fonts.gstatic.com",
|
288
|
-
crossOrigin: "anonymous"
|
289
|
-
}), /*#__PURE__*/ReactJSXRuntime.jsx("link", {
|
290
|
-
href: "https://fonts.googleapis.com/css2?family=JetBrains+Mono:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;1,400&family=Roboto:ital,wght@0,100;0,300;0,400;0,500;0,700;0,900;1,400;1,700&display=swap",
|
291
|
-
rel: "stylesheet"
|
292
|
-
}), /*#__PURE__*/ReactJSXRuntime.jsx(ui.Style, {}), /*#__PURE__*/ReactJSXRuntime.jsx("div", {
|
293
|
-
"data-mode": "dark",
|
294
|
-
children: /*#__PURE__*/ReactJSXRuntime.jsx(ui.ValOverlay, {
|
295
|
-
editMode: editMode,
|
296
|
-
setEditMode: setEditMode,
|
297
|
-
closeValWindow: function closeValWindow() {
|
298
|
-
setEditFormPosition(null);
|
299
|
-
setSelectedSources([]);
|
300
|
-
setInputs({});
|
301
|
-
},
|
302
|
-
valWindow: (_ref3 = editFormPosition && {
|
303
|
-
position: editFormPosition,
|
304
|
-
inputs: inputs,
|
305
|
-
onSubmit: function onSubmit(inputs) {
|
306
|
-
Promise.all(Object.entries(inputs).map(function (_ref4) {
|
307
|
-
var _ref5 = slicedToArray._slicedToArray(_ref4, 2),
|
308
|
-
path = _ref5[0],
|
309
|
-
input = _ref5[1];
|
310
|
-
if (input.status === "completed") {
|
311
|
-
var _Internal$splitModule = core.Internal.splitModuleIdAndModulePath(path),
|
312
|
-
_Internal$splitModule2 = slicedToArray._slicedToArray(_Internal$splitModule, 2),
|
313
|
-
moduleId = _Internal$splitModule2[0],
|
314
|
-
modulePath = _Internal$splitModule2[1];
|
315
|
-
if (input.type === "text") {
|
316
|
-
var patch = [{
|
317
|
-
value: input.data,
|
318
|
-
op: "replace",
|
319
|
-
path: "/".concat(modulePath.split(".").map(function (p) {
|
320
|
-
return JSON.parse(p);
|
321
|
-
}).join("/"))
|
322
|
-
}];
|
323
|
-
return valApi.patchModuleContent(moduleId, patch);
|
324
|
-
} else if (input.type === "image") {
|
325
|
-
var pathParts = modulePath.split(".").map(function (p) {
|
326
|
-
return JSON.parse(p);
|
327
|
-
});
|
328
|
-
if (!(input !== null && input !== void 0 && input.data) || !("src" in input.data)) {
|
329
|
-
// TODO: We probably need to have an Output type that is different from the Input: we have a union of both cases in Input right now, and we believe we do not want that
|
330
|
-
console.warn("No .src on input provided - this might mean no changes was made");
|
331
|
-
return;
|
332
|
-
}
|
333
|
-
var _patch = [{
|
334
|
-
value: input.data.src,
|
335
|
-
op: "replace",
|
336
|
-
path: "/".concat(pathParts.slice(0, -1).join("/"), "/$").concat(pathParts[pathParts.length - 1])
|
337
|
-
}];
|
338
|
-
if (input.data.metadata) {
|
339
|
-
if (input.data.addMetadata) {
|
340
|
-
_patch.push({
|
341
|
-
value: input.data.metadata,
|
342
|
-
op: "add",
|
343
|
-
path: "/".concat(pathParts.join("/"), "/metadata")
|
344
|
-
});
|
345
|
-
} else {
|
346
|
-
_patch.push({
|
347
|
-
value: input.data.metadata,
|
348
|
-
op: "replace",
|
349
|
-
path: "/".concat(pathParts.join("/"), "/metadata")
|
350
|
-
});
|
351
|
-
}
|
352
|
-
}
|
353
|
-
console.log("patch", _patch);
|
354
|
-
return valApi.patchModuleContent(moduleId, _patch);
|
355
|
-
} else if (input.type === "richtext") {
|
356
|
-
var _patch2 = [{
|
357
|
-
value: input.data,
|
358
|
-
op: "replace",
|
359
|
-
path: "/".concat(modulePath.split(".").map(function (p) {
|
360
|
-
return JSON.parse(p);
|
361
|
-
}).join("/"))
|
362
|
-
}];
|
363
|
-
return valApi.patchModuleContent(moduleId, _patch2);
|
364
|
-
}
|
365
|
-
console.log("->", input);
|
366
|
-
throw new Error("Unsupported input type: ".concat(input.type));
|
367
|
-
} else {
|
368
|
-
console.error("Submitted incomplete input, ignoring...");
|
369
|
-
return Promise.resolve();
|
370
|
-
}
|
371
|
-
})).then(function () {
|
372
|
-
setEditFormPosition(null);
|
373
|
-
setSelectedSources([]);
|
374
|
-
setInputs({});
|
375
|
-
});
|
376
|
-
}
|
377
|
-
}) !== null && _ref3 !== void 0 ? _ref3 : undefined
|
378
|
-
})
|
379
|
-
})]
|
380
|
-
});
|
381
|
-
}
|
382
|
-
|
383
|
-
exports["default"] = ValUI;
|