atom.io 0.3.0 → 0.4.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/README.md +14 -8
- package/dist/index.d.ts +117 -62
- package/dist/index.js +577 -287
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +574 -285
- package/dist/index.mjs.map +1 -1
- package/package.json +16 -6
- package/react/dist/index.d.ts +12 -17
- package/react/dist/index.js +25 -34
- package/react/dist/index.js.map +1 -1
- package/react/dist/index.mjs +21 -34
- package/react/dist/index.mjs.map +1 -1
- package/react-devtools/dist/index.css +26 -0
- package/react-devtools/dist/index.css.map +1 -0
- package/react-devtools/dist/index.d.ts +15 -0
- package/react-devtools/dist/index.js +1579 -0
- package/react-devtools/dist/index.js.map +1 -0
- package/react-devtools/dist/index.mjs +1551 -0
- package/react-devtools/dist/index.mjs.map +1 -0
- package/react-devtools/package.json +15 -0
- package/src/index.ts +14 -8
- package/src/internal/atom-internal.ts +10 -5
- package/src/internal/families-internal.ts +7 -7
- package/src/internal/get.ts +9 -9
- package/src/internal/index.ts +2 -1
- package/src/internal/meta/attach-meta.ts +17 -0
- package/src/internal/meta/index.ts +4 -0
- package/src/internal/meta/meta-state.ts +135 -0
- package/src/internal/meta/meta-timelines.ts +1 -0
- package/src/internal/meta/meta-transactions.ts +1 -0
- package/src/internal/operation.ts +14 -3
- package/src/internal/selector-internal.ts +37 -15
- package/src/internal/store.ts +35 -6
- package/src/internal/time-travel-internal.ts +89 -0
- package/src/internal/timeline-internal.ts +110 -93
- package/src/internal/transaction-internal.ts +14 -5
- package/src/{internal/logger.ts → logger.ts} +2 -2
- package/src/react/index.ts +28 -46
- package/src/react-devtools/AtomIODevtools.tsx +107 -0
- package/src/react-devtools/StateEditor.tsx +73 -0
- package/src/react-devtools/TokenList.tsx +49 -0
- package/src/react-devtools/devtools.scss +130 -0
- package/src/react-devtools/index.ts +1 -0
- package/src/react-explorer/AtomIOExplorer.tsx +208 -0
- package/src/react-explorer/explorer-effects.ts +20 -0
- package/src/react-explorer/explorer-states.ts +224 -0
- package/src/react-explorer/index.ts +23 -0
- package/src/react-explorer/space-states.ts +73 -0
- package/src/react-explorer/view-states.ts +43 -0
- package/src/selector.ts +11 -11
- package/src/subscribe.ts +3 -3
- package/src/timeline.ts +3 -12
- package/src/transaction.ts +9 -4
- package/src/web-effects/index.ts +1 -0
- package/src/web-effects/storage.ts +30 -0
|
@@ -0,0 +1,1579 @@
|
|
|
1
|
+
var __create = Object.create;
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __defProps = Object.defineProperties;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
6
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
7
|
+
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
8
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
9
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
10
|
+
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
11
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
12
|
+
var __spreadValues = (a2, b2) => {
|
|
13
|
+
for (var prop in b2 || (b2 = {}))
|
|
14
|
+
if (__hasOwnProp.call(b2, prop))
|
|
15
|
+
__defNormalProp(a2, prop, b2[prop]);
|
|
16
|
+
if (__getOwnPropSymbols)
|
|
17
|
+
for (var prop of __getOwnPropSymbols(b2)) {
|
|
18
|
+
if (__propIsEnum.call(b2, prop))
|
|
19
|
+
__defNormalProp(a2, prop, b2[prop]);
|
|
20
|
+
}
|
|
21
|
+
return a2;
|
|
22
|
+
};
|
|
23
|
+
var __spreadProps = (a2, b2) => __defProps(a2, __getOwnPropDescs(b2));
|
|
24
|
+
var __restKey = (key) => typeof key === "symbol" ? key : key + "";
|
|
25
|
+
var __objRest = (source, exclude) => {
|
|
26
|
+
var target = {};
|
|
27
|
+
for (var prop in source)
|
|
28
|
+
if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
29
|
+
target[prop] = source[prop];
|
|
30
|
+
if (source != null && __getOwnPropSymbols)
|
|
31
|
+
for (var prop of __getOwnPropSymbols(source)) {
|
|
32
|
+
if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
|
|
33
|
+
target[prop] = source[prop];
|
|
34
|
+
}
|
|
35
|
+
return target;
|
|
36
|
+
};
|
|
37
|
+
var __export = (target, all) => {
|
|
38
|
+
for (var name in all)
|
|
39
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
40
|
+
};
|
|
41
|
+
var __copyProps = (to, from, except, desc) => {
|
|
42
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
43
|
+
for (let key of __getOwnPropNames(from))
|
|
44
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
45
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
46
|
+
}
|
|
47
|
+
return to;
|
|
48
|
+
};
|
|
49
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
50
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
51
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
52
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
53
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
54
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
55
|
+
mod
|
|
56
|
+
));
|
|
57
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
58
|
+
|
|
59
|
+
// ../src/react-devtools/index.ts
|
|
60
|
+
var react_devtools_exports = {};
|
|
61
|
+
__export(react_devtools_exports, {
|
|
62
|
+
AtomIODevtools: () => AtomIODevtools,
|
|
63
|
+
composeDevtools: () => composeDevtools
|
|
64
|
+
});
|
|
65
|
+
module.exports = __toCommonJS(react_devtools_exports);
|
|
66
|
+
|
|
67
|
+
// ../src/react-devtools/AtomIODevtools.tsx
|
|
68
|
+
var import_react7 = require("react");
|
|
69
|
+
var import_atom = require("atom.io");
|
|
70
|
+
var import_react8 = require("atom.io/react");
|
|
71
|
+
var import_framer_motion = require("framer-motion");
|
|
72
|
+
|
|
73
|
+
// ../src/react-devtools/TokenList.tsx
|
|
74
|
+
var import_react6 = require("react");
|
|
75
|
+
|
|
76
|
+
// ../../anvl/src/object/index.ts
|
|
77
|
+
var import_function4 = require("fp-ts/function");
|
|
78
|
+
|
|
79
|
+
// ../../anvl/src/object/refinement.ts
|
|
80
|
+
var import_function2 = require("fp-ts/function");
|
|
81
|
+
|
|
82
|
+
// ../../anvl/src/object/access.ts
|
|
83
|
+
var access = (k) => Object.assign((obj) => obj[k], {
|
|
84
|
+
in: (obj) => obj[k]
|
|
85
|
+
});
|
|
86
|
+
|
|
87
|
+
// ../../anvl/src/object/entries.ts
|
|
88
|
+
var recordToEntries = (obj) => Object.entries(obj);
|
|
89
|
+
var entriesToRecord = (entries) => Object.fromEntries(entries);
|
|
90
|
+
|
|
91
|
+
// ../../anvl/src/object/mapObject.ts
|
|
92
|
+
var import_function = require("fp-ts/lib/function");
|
|
93
|
+
|
|
94
|
+
// ../../anvl/src/array/index.ts
|
|
95
|
+
var isArray = (isType) => (input) => Array.isArray(input) && input.every((item) => isType(item));
|
|
96
|
+
var map = (f) => (a2) => a2.map(f);
|
|
97
|
+
var every = (f = Boolean) => (a2) => a2.every(f);
|
|
98
|
+
var allTrue = every((x) => x === true);
|
|
99
|
+
|
|
100
|
+
// ../../anvl/src/object/mapObject.ts
|
|
101
|
+
var mapObject = (obj, fn) => (0, import_function.pipe)(
|
|
102
|
+
obj,
|
|
103
|
+
recordToEntries,
|
|
104
|
+
map(([key, val]) => [key, fn(val, key)]),
|
|
105
|
+
entriesToRecord
|
|
106
|
+
);
|
|
107
|
+
var mob = (fn) => (obj) => mapObject(obj, fn);
|
|
108
|
+
|
|
109
|
+
// ../../anvl/src/function/index.ts
|
|
110
|
+
var doNothing = () => void 0;
|
|
111
|
+
var become = (nextVersionOfThing) => (originalThing) => nextVersionOfThing instanceof Function ? nextVersionOfThing(
|
|
112
|
+
originalThing instanceof Function ? originalThing() : originalThing
|
|
113
|
+
) : nextVersionOfThing;
|
|
114
|
+
var pass = (...params) => (fn) => fn(...params);
|
|
115
|
+
var raiseError = (message) => {
|
|
116
|
+
throw new Error(message);
|
|
117
|
+
};
|
|
118
|
+
var attempt = (fn) => {
|
|
119
|
+
try {
|
|
120
|
+
fn();
|
|
121
|
+
return true;
|
|
122
|
+
} catch (_) {
|
|
123
|
+
return false;
|
|
124
|
+
}
|
|
125
|
+
};
|
|
126
|
+
|
|
127
|
+
// ../../anvl/src/nullish/index.ts
|
|
128
|
+
var isUndefined = (input) => input === void 0;
|
|
129
|
+
var ifDefined = (validate) => (input) => isUndefined(input) || validate(input);
|
|
130
|
+
var ifNullish = (alt) => (input) => input != null ? input : alt;
|
|
131
|
+
|
|
132
|
+
// ../../anvl/src/object/refinement.ts
|
|
133
|
+
var isNonNullObject = (input) => typeof input === `object` && input !== null;
|
|
134
|
+
var isPlainObject = (input) => isNonNullObject(input) && Object.getPrototypeOf(input) === Object.prototype;
|
|
135
|
+
var isRecord = (isKey, isValue) => (input) => isPlainObject(input) && Object.entries(input).every(([k, v]) => isKey(k) && isValue(v));
|
|
136
|
+
var hasProperties = (isValue, options = { allowExtraProperties: false }) => {
|
|
137
|
+
const name = `{${recordToEntries(
|
|
138
|
+
isValue
|
|
139
|
+
).map(([k, v]) => String(k) + `:` + v.name).join(`,`)}}`;
|
|
140
|
+
const _ = {
|
|
141
|
+
[name]: (input) => isPlainObject(input) && (0, import_function2.pipe)(
|
|
142
|
+
isValue,
|
|
143
|
+
Object.entries,
|
|
144
|
+
every(([key, val]) => key in input || val(void 0))
|
|
145
|
+
) && (0, import_function2.pipe)(
|
|
146
|
+
input,
|
|
147
|
+
mob(
|
|
148
|
+
(val, key) => (0, import_function2.pipe)(
|
|
149
|
+
isValue,
|
|
150
|
+
access(key),
|
|
151
|
+
ifNullish(() => options.allowExtraProperties),
|
|
152
|
+
pass(val)
|
|
153
|
+
)
|
|
154
|
+
),
|
|
155
|
+
Object.values,
|
|
156
|
+
allTrue
|
|
157
|
+
)
|
|
158
|
+
};
|
|
159
|
+
return _[name];
|
|
160
|
+
};
|
|
161
|
+
var doesExtend = (
|
|
162
|
+
/* alias for hasExactProperties with allowExtraProperties */
|
|
163
|
+
(isValue) => hasProperties(isValue, { allowExtraProperties: true })
|
|
164
|
+
);
|
|
165
|
+
|
|
166
|
+
// ../../anvl/src/object/index.ts
|
|
167
|
+
var delve = (obj, path) => {
|
|
168
|
+
const found = path.reduce((acc, key) => acc == null ? void 0 : acc[key], obj);
|
|
169
|
+
return found === void 0 ? new Error(`Not found`) : { found };
|
|
170
|
+
};
|
|
171
|
+
|
|
172
|
+
// ../../anvl/src/json/index.ts
|
|
173
|
+
var import_function6 = require("fp-ts/function");
|
|
174
|
+
|
|
175
|
+
// ../../anvl/src/json/refine.ts
|
|
176
|
+
var import_boolean = require("fp-ts/boolean");
|
|
177
|
+
var import_number = require("fp-ts/number");
|
|
178
|
+
var import_string = require("fp-ts/string");
|
|
179
|
+
var refineJsonType = (data) => data === null ? { type: `null`, data: null } : (0, import_boolean.isBoolean)(data) ? { type: `boolean`, data } : (0, import_number.isNumber)(data) ? { type: `number`, data } : (0, import_string.isString)(data) ? { type: `string`, data } : Array.isArray(data) ? { type: `array`, data } : isPlainObject(data) ? { type: `object`, data } : raiseError(
|
|
180
|
+
data === void 0 ? `undefined passed to refineJsonType. This is not valid JSON.` : `${stringifyJson(data)} with prototype "${Object.getPrototypeOf(data).constructor.name}" passed to refineJsonType. This is not valid JSON.`
|
|
181
|
+
);
|
|
182
|
+
var isJson = (input) => {
|
|
183
|
+
try {
|
|
184
|
+
JSON.stringify(input);
|
|
185
|
+
return true;
|
|
186
|
+
} catch (e) {
|
|
187
|
+
return false;
|
|
188
|
+
}
|
|
189
|
+
};
|
|
190
|
+
var isPlainJson = (input) => attempt(() => isJson(input) && refineJsonType(input));
|
|
191
|
+
|
|
192
|
+
// ../../anvl/src/json/index.ts
|
|
193
|
+
var stringifyJson = (json) => JSON.stringify(json);
|
|
194
|
+
var JSON_TYPE_NAMES = [
|
|
195
|
+
`array`,
|
|
196
|
+
`boolean`,
|
|
197
|
+
`null`,
|
|
198
|
+
`number`,
|
|
199
|
+
`object`,
|
|
200
|
+
`string`
|
|
201
|
+
];
|
|
202
|
+
var JSON_DEFAULTS = {
|
|
203
|
+
array: [],
|
|
204
|
+
boolean: false,
|
|
205
|
+
null: null,
|
|
206
|
+
number: 0,
|
|
207
|
+
object: {},
|
|
208
|
+
string: ``
|
|
209
|
+
};
|
|
210
|
+
|
|
211
|
+
// ../../hamr/src/react-elastic-input/ElasticInput.tsx
|
|
212
|
+
var import_react = require("react");
|
|
213
|
+
var import_jsx_runtime = require("@emotion/react/jsx-runtime");
|
|
214
|
+
var ElasticInput = (0, import_react.forwardRef)(function ElasticInputFC(props, ref) {
|
|
215
|
+
var _a2, _b, _c, _d;
|
|
216
|
+
const inputRef = (0, import_react.useRef)(null);
|
|
217
|
+
const spanRef = (0, import_react.useRef)(null);
|
|
218
|
+
const [inputWidth, setInputWidth] = (0, import_react.useState)(`auto`);
|
|
219
|
+
(0, import_react.useImperativeHandle)(ref, () => ({
|
|
220
|
+
focus: () => {
|
|
221
|
+
var _a3;
|
|
222
|
+
(_a3 = inputRef.current) == null ? void 0 : _a3.focus();
|
|
223
|
+
}
|
|
224
|
+
}));
|
|
225
|
+
const extraWidth = props.type === `number` ? 15 : 0;
|
|
226
|
+
(0, import_react.useLayoutEffect)(() => {
|
|
227
|
+
if (spanRef.current) {
|
|
228
|
+
setInputWidth(`${spanRef.current.offsetWidth + extraWidth}px`);
|
|
229
|
+
const interval = setInterval(() => {
|
|
230
|
+
if (spanRef.current) {
|
|
231
|
+
setInputWidth(`${spanRef.current.offsetWidth + extraWidth}px`);
|
|
232
|
+
}
|
|
233
|
+
}, 1e3);
|
|
234
|
+
return () => clearInterval(interval);
|
|
235
|
+
}
|
|
236
|
+
}, [(_a2 = inputRef.current) == null ? void 0 : _a2.value, props.value]);
|
|
237
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { style: { display: `inline-block`, position: `relative` }, children: [
|
|
238
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
239
|
+
"input",
|
|
240
|
+
__spreadProps(__spreadValues({}, props), {
|
|
241
|
+
ref: inputRef,
|
|
242
|
+
style: __spreadValues({
|
|
243
|
+
padding: 0,
|
|
244
|
+
borderRadius: 0,
|
|
245
|
+
border: `none`,
|
|
246
|
+
fontFamily: `inherit`,
|
|
247
|
+
fontSize: `inherit`,
|
|
248
|
+
width: inputWidth
|
|
249
|
+
}, props.style)
|
|
250
|
+
})
|
|
251
|
+
),
|
|
252
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
253
|
+
"span",
|
|
254
|
+
{
|
|
255
|
+
ref: spanRef,
|
|
256
|
+
style: {
|
|
257
|
+
padding: (_b = props.style) == null ? void 0 : _b.padding,
|
|
258
|
+
position: `absolute`,
|
|
259
|
+
visibility: `hidden`,
|
|
260
|
+
// color: `red`,
|
|
261
|
+
whiteSpace: `pre`,
|
|
262
|
+
fontFamily: ((_c = props.style) == null ? void 0 : _c.fontFamily) || `inherit`,
|
|
263
|
+
fontSize: ((_d = props.style) == null ? void 0 : _d.fontSize) || `inherit`
|
|
264
|
+
},
|
|
265
|
+
children: props.value
|
|
266
|
+
}
|
|
267
|
+
)
|
|
268
|
+
] });
|
|
269
|
+
});
|
|
270
|
+
|
|
271
|
+
// ../../hamr/src/react-elastic-input/NumberInput.tsx
|
|
272
|
+
var import_react2 = require("react");
|
|
273
|
+
var import_function7 = require("fp-ts/function");
|
|
274
|
+
|
|
275
|
+
// ../../anvl/src/number/clamp.ts
|
|
276
|
+
var clampInto = ([min, max]) => (value) => value < min ? min : value > max ? max : value;
|
|
277
|
+
|
|
278
|
+
// ../../hamr/src/react-elastic-input/NumberInput.tsx
|
|
279
|
+
var import_jsx_runtime2 = require("@emotion/react/jsx-runtime");
|
|
280
|
+
function round(value, decimalPlaces) {
|
|
281
|
+
if (decimalPlaces === void 0)
|
|
282
|
+
return value;
|
|
283
|
+
const factor = Math.pow(10, decimalPlaces);
|
|
284
|
+
return Math.round(value * factor) / factor;
|
|
285
|
+
}
|
|
286
|
+
var VALID_NON_NUMBERS = [``, `-`, `.`, `-.`];
|
|
287
|
+
var isValidNonNumber = (input) => VALID_NON_NUMBERS.includes(input);
|
|
288
|
+
var VALID_NON_NUMBER_INTERPRETATIONS = {
|
|
289
|
+
"": null,
|
|
290
|
+
"-": 0,
|
|
291
|
+
".": 0,
|
|
292
|
+
"-.": 0
|
|
293
|
+
};
|
|
294
|
+
var isDecimalInProgress = (input) => input === `0` || !isNaN(Number(input)) && input.includes(`.`);
|
|
295
|
+
var textToValue = (input, allowDecimal) => {
|
|
296
|
+
if (isValidNonNumber(input))
|
|
297
|
+
return VALID_NON_NUMBER_INTERPRETATIONS[input];
|
|
298
|
+
return allowDecimal ? parseFloat(input) : Math.round(parseFloat(input));
|
|
299
|
+
};
|
|
300
|
+
var DEFAULT_NUMBER_CONSTRAINTS = {
|
|
301
|
+
max: Infinity,
|
|
302
|
+
min: -Infinity,
|
|
303
|
+
decimalPlaces: 100,
|
|
304
|
+
nullable: true
|
|
305
|
+
};
|
|
306
|
+
var initRefinery = (constraints) => (input) => {
|
|
307
|
+
if (input === null && constraints.nullable === true) {
|
|
308
|
+
return null;
|
|
309
|
+
}
|
|
310
|
+
const { max, min, decimalPlaces } = __spreadValues(__spreadValues({}, DEFAULT_NUMBER_CONSTRAINTS), constraints);
|
|
311
|
+
const constrained = (0, import_function7.pipe)(
|
|
312
|
+
input != null ? input : 0,
|
|
313
|
+
clampInto([min, max]),
|
|
314
|
+
(n) => decimalPlaces ? round(n, decimalPlaces) : n
|
|
315
|
+
);
|
|
316
|
+
return constrained;
|
|
317
|
+
};
|
|
318
|
+
var valueToText = (numericValue) => {
|
|
319
|
+
if (numericValue === null || numericValue === void 0) {
|
|
320
|
+
return ``;
|
|
321
|
+
}
|
|
322
|
+
return numericValue.toString();
|
|
323
|
+
};
|
|
324
|
+
var NumberInput = ({
|
|
325
|
+
autoSize = false,
|
|
326
|
+
customCss,
|
|
327
|
+
decimalPlaces,
|
|
328
|
+
disabled = false,
|
|
329
|
+
label,
|
|
330
|
+
max,
|
|
331
|
+
min,
|
|
332
|
+
name,
|
|
333
|
+
onChange,
|
|
334
|
+
onClick,
|
|
335
|
+
placeholder = ``,
|
|
336
|
+
set = () => null,
|
|
337
|
+
testId,
|
|
338
|
+
value = null
|
|
339
|
+
}) => {
|
|
340
|
+
const id = (0, import_react2.useId)();
|
|
341
|
+
const [temporaryEntry, setTemporaryEntry] = (0, import_react2.useState)(null);
|
|
342
|
+
const userHasMadeDeliberateChange = (0, import_react2.useRef)(false);
|
|
343
|
+
const refine = initRefinery({ max, min, decimalPlaces, nullable: true });
|
|
344
|
+
const allowDecimal = decimalPlaces === void 0 || decimalPlaces > 0;
|
|
345
|
+
const handleBlur = () => {
|
|
346
|
+
if (userHasMadeDeliberateChange.current) {
|
|
347
|
+
set(refine(value != null ? value : null));
|
|
348
|
+
setTemporaryEntry(null);
|
|
349
|
+
}
|
|
350
|
+
userHasMadeDeliberateChange.current = false;
|
|
351
|
+
};
|
|
352
|
+
const handleChange = (event) => {
|
|
353
|
+
var _a2;
|
|
354
|
+
if (onChange)
|
|
355
|
+
onChange(event);
|
|
356
|
+
if (set === void 0)
|
|
357
|
+
return;
|
|
358
|
+
userHasMadeDeliberateChange.current = true;
|
|
359
|
+
const input = event.target.value;
|
|
360
|
+
if (isValidNonNumber(input) || isDecimalInProgress(input)) {
|
|
361
|
+
setTemporaryEntry(input);
|
|
362
|
+
const textInterpretation = isDecimalInProgress(input) ? input : (_a2 = min == null ? void 0 : min.toString()) != null ? _a2 : `0`;
|
|
363
|
+
const newValue = textToValue(textInterpretation, allowDecimal);
|
|
364
|
+
set(refine(newValue));
|
|
365
|
+
return;
|
|
366
|
+
}
|
|
367
|
+
setTemporaryEntry(null);
|
|
368
|
+
const inputIsNumeric = !isNaN(Number(input)) && !input.includes(` `) || allowDecimal && input === `.` || allowDecimal && input === `-.` || input === `` || input === `-`;
|
|
369
|
+
const numericValue = textToValue(input, allowDecimal);
|
|
370
|
+
if (inputIsNumeric) {
|
|
371
|
+
set(refine(numericValue));
|
|
372
|
+
}
|
|
373
|
+
};
|
|
374
|
+
const displayValue = temporaryEntry != null ? temporaryEntry : valueToText(value ? refine(value) : value);
|
|
375
|
+
return /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("span", { css: customCss, children: [
|
|
376
|
+
label && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("label", { htmlFor: id, children: label }),
|
|
377
|
+
autoSize ? /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
378
|
+
ElasticInput,
|
|
379
|
+
{
|
|
380
|
+
type: "text",
|
|
381
|
+
value: displayValue,
|
|
382
|
+
placeholder: placeholder != null ? placeholder : `-`,
|
|
383
|
+
onChange: handleChange,
|
|
384
|
+
onBlur: handleBlur,
|
|
385
|
+
disabled,
|
|
386
|
+
name: name != null ? name : id,
|
|
387
|
+
id,
|
|
388
|
+
onClick,
|
|
389
|
+
"data-testid": `number-input-${testId != null ? testId : id}`
|
|
390
|
+
}
|
|
391
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
392
|
+
"input",
|
|
393
|
+
{
|
|
394
|
+
type: "text",
|
|
395
|
+
value: displayValue,
|
|
396
|
+
placeholder: placeholder != null ? placeholder : `-`,
|
|
397
|
+
onChange: handleChange,
|
|
398
|
+
onBlur: handleBlur,
|
|
399
|
+
disabled,
|
|
400
|
+
name: name != null ? name : id,
|
|
401
|
+
id,
|
|
402
|
+
onClick,
|
|
403
|
+
"data-testid": `number-input-${testId != null ? testId : id}`
|
|
404
|
+
}
|
|
405
|
+
)
|
|
406
|
+
] });
|
|
407
|
+
};
|
|
408
|
+
|
|
409
|
+
// ../../hamr/src/react-elastic-input/TextInput.tsx
|
|
410
|
+
var import_jsx_runtime3 = require("@emotion/react/jsx-runtime");
|
|
411
|
+
var TextInput = ({
|
|
412
|
+
value,
|
|
413
|
+
set,
|
|
414
|
+
label,
|
|
415
|
+
placeholder,
|
|
416
|
+
customCss,
|
|
417
|
+
autoSize = false
|
|
418
|
+
}) => {
|
|
419
|
+
return /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("span", { css: customCss, children: [
|
|
420
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("label", { children: label }),
|
|
421
|
+
autoSize ? /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
422
|
+
ElasticInput,
|
|
423
|
+
{
|
|
424
|
+
type: "text",
|
|
425
|
+
value,
|
|
426
|
+
onChange: (e) => set == null ? void 0 : set(e.target.value),
|
|
427
|
+
disabled: set === void 0,
|
|
428
|
+
placeholder
|
|
429
|
+
}
|
|
430
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
431
|
+
"input",
|
|
432
|
+
{
|
|
433
|
+
type: "text",
|
|
434
|
+
value,
|
|
435
|
+
onChange: (e) => set == null ? void 0 : set(e.target.value),
|
|
436
|
+
disabled: set === void 0,
|
|
437
|
+
placeholder
|
|
438
|
+
}
|
|
439
|
+
)
|
|
440
|
+
] });
|
|
441
|
+
};
|
|
442
|
+
|
|
443
|
+
// ../../hamr/src/react-json-editor/editors-by-type/utilities/array-elements.ts
|
|
444
|
+
var makeElementSetters = (data, set) => data.map(
|
|
445
|
+
(value, index) => (newValue) => set(() => {
|
|
446
|
+
const newData = [...data];
|
|
447
|
+
newData[index] = become(newValue)(value);
|
|
448
|
+
return newData;
|
|
449
|
+
})
|
|
450
|
+
);
|
|
451
|
+
|
|
452
|
+
// ../../hamr/src/react-json-editor/json-editor-internal.tsx
|
|
453
|
+
var import_jsx_runtime4 = require("@emotion/react/jsx-runtime");
|
|
454
|
+
var JsonEditor_INTERNAL = ({
|
|
455
|
+
data,
|
|
456
|
+
set,
|
|
457
|
+
schema,
|
|
458
|
+
name,
|
|
459
|
+
rename,
|
|
460
|
+
remove,
|
|
461
|
+
recast,
|
|
462
|
+
path = [],
|
|
463
|
+
isReadonly = () => false,
|
|
464
|
+
isHidden = () => false,
|
|
465
|
+
className,
|
|
466
|
+
customCss,
|
|
467
|
+
Header: HeaderDisplay,
|
|
468
|
+
Components
|
|
469
|
+
}) => {
|
|
470
|
+
const json = refineJsonType(data);
|
|
471
|
+
const SubEditor = SubEditors[json.type];
|
|
472
|
+
const disabled = isReadonly(path);
|
|
473
|
+
return isHidden(path) ? null : /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(Components.ErrorBoundary, { children: /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(Components.EditorWrapper, { className, customCss, children: [
|
|
474
|
+
remove && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
475
|
+
Components.Button,
|
|
476
|
+
{
|
|
477
|
+
onClick: disabled ? doNothing : remove,
|
|
478
|
+
disabled,
|
|
479
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(Components.DeleteIcon, {})
|
|
480
|
+
}
|
|
481
|
+
),
|
|
482
|
+
HeaderDisplay && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(HeaderDisplay, { data, schema }),
|
|
483
|
+
rename && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(Components.KeyWrapper, { children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
484
|
+
ElasticInput,
|
|
485
|
+
{
|
|
486
|
+
value: name,
|
|
487
|
+
onChange: disabled ? doNothing : (e) => rename(e.target.value),
|
|
488
|
+
disabled
|
|
489
|
+
}
|
|
490
|
+
) }),
|
|
491
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
492
|
+
SubEditor,
|
|
493
|
+
{
|
|
494
|
+
data: json.data,
|
|
495
|
+
set,
|
|
496
|
+
schema,
|
|
497
|
+
remove,
|
|
498
|
+
rename,
|
|
499
|
+
path,
|
|
500
|
+
isReadonly,
|
|
501
|
+
isHidden,
|
|
502
|
+
Components
|
|
503
|
+
}
|
|
504
|
+
),
|
|
505
|
+
recast && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
506
|
+
"select",
|
|
507
|
+
{
|
|
508
|
+
onChange: disabled ? doNothing : (e) => recast(e.target.value),
|
|
509
|
+
value: json.type,
|
|
510
|
+
disabled,
|
|
511
|
+
children: Object.keys(SubEditors).map((type) => /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("option", { value: type, children: type }, type))
|
|
512
|
+
}
|
|
513
|
+
)
|
|
514
|
+
] }) });
|
|
515
|
+
};
|
|
516
|
+
|
|
517
|
+
// ../../hamr/src/react-json-editor/editors-by-type/array-editor.tsx
|
|
518
|
+
var import_jsx_runtime5 = require("@emotion/react/jsx-runtime");
|
|
519
|
+
var ArrayEditor = ({
|
|
520
|
+
path = [],
|
|
521
|
+
isReadonly = () => false,
|
|
522
|
+
isHidden = () => false,
|
|
523
|
+
data,
|
|
524
|
+
set,
|
|
525
|
+
Components
|
|
526
|
+
}) => {
|
|
527
|
+
const setElement = makeElementSetters(data, set);
|
|
528
|
+
return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_jsx_runtime5.Fragment, { children: data.map((element, index) => {
|
|
529
|
+
const newPath = [...path, index];
|
|
530
|
+
return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
531
|
+
JsonEditor_INTERNAL,
|
|
532
|
+
{
|
|
533
|
+
path: newPath,
|
|
534
|
+
isReadonly,
|
|
535
|
+
isHidden,
|
|
536
|
+
data: element,
|
|
537
|
+
set: setElement[index],
|
|
538
|
+
Components
|
|
539
|
+
},
|
|
540
|
+
newPath.join(``)
|
|
541
|
+
);
|
|
542
|
+
}) });
|
|
543
|
+
};
|
|
544
|
+
|
|
545
|
+
// ../../hamr/src/react-json-editor/editors-by-type/object-editor.tsx
|
|
546
|
+
var import_react3 = require("react");
|
|
547
|
+
|
|
548
|
+
// ../../anvl/src/json-schema/json-schema.ts
|
|
549
|
+
var import_boolean2 = require("fp-ts/boolean");
|
|
550
|
+
var import_number3 = require("fp-ts/number");
|
|
551
|
+
var import_string4 = require("fp-ts/string");
|
|
552
|
+
|
|
553
|
+
// ../../anvl/src/json-schema/integer.ts
|
|
554
|
+
var import_function10 = require("fp-ts/function");
|
|
555
|
+
var isInteger = (input) => Number.isInteger(input);
|
|
556
|
+
var parseInt = (input) => {
|
|
557
|
+
if (isInteger(input))
|
|
558
|
+
return input;
|
|
559
|
+
throw new IntegerParseError(input);
|
|
560
|
+
};
|
|
561
|
+
var _a;
|
|
562
|
+
var Fraction = class extends Number {
|
|
563
|
+
constructor(n, d) {
|
|
564
|
+
super(n / d);
|
|
565
|
+
this[_a] = () => this.numerator / this.denominator;
|
|
566
|
+
if (d === 0) {
|
|
567
|
+
throw new Error(`Denominator cannot be zero`);
|
|
568
|
+
}
|
|
569
|
+
this.numerator = parseInt(n);
|
|
570
|
+
this.denominator = parseInt(d);
|
|
571
|
+
}
|
|
572
|
+
};
|
|
573
|
+
_a = Symbol.toPrimitive;
|
|
574
|
+
var IntegerParseError = class extends Error {
|
|
575
|
+
constructor(value) {
|
|
576
|
+
super(`Could not parse integer from ${JSON.stringify(value)}`);
|
|
577
|
+
}
|
|
578
|
+
};
|
|
579
|
+
var Int = Object.assign((input) => parseInt(input), {
|
|
580
|
+
from: (input) => (0, import_function10.pipe)(
|
|
581
|
+
input,
|
|
582
|
+
String,
|
|
583
|
+
parseFloat,
|
|
584
|
+
(num) => isInteger(num) ? {
|
|
585
|
+
value: num,
|
|
586
|
+
error: null,
|
|
587
|
+
round: null,
|
|
588
|
+
upper: null,
|
|
589
|
+
lower: null,
|
|
590
|
+
ratio: null
|
|
591
|
+
} : {
|
|
592
|
+
value: null,
|
|
593
|
+
error: new IntegerParseError(input),
|
|
594
|
+
round: Math.round(num),
|
|
595
|
+
upper: Math.ceil(num),
|
|
596
|
+
lower: Math.floor(num),
|
|
597
|
+
ratio: null
|
|
598
|
+
}
|
|
599
|
+
),
|
|
600
|
+
formula: (fm) => {
|
|
601
|
+
return (input) => {
|
|
602
|
+
return fm(
|
|
603
|
+
input
|
|
604
|
+
);
|
|
605
|
+
};
|
|
606
|
+
}
|
|
607
|
+
});
|
|
608
|
+
function asNumber(input) {
|
|
609
|
+
return input;
|
|
610
|
+
}
|
|
611
|
+
var a = asNumber(new Fraction(1, 2));
|
|
612
|
+
var b = asNumber([new Fraction(1, 2)]);
|
|
613
|
+
var c = asNumber({ a: new Fraction(1, 2) });
|
|
614
|
+
|
|
615
|
+
// ../../anvl/src/json-schema/refs.ts
|
|
616
|
+
var import_string2 = require("fp-ts/string");
|
|
617
|
+
function isJsonSchemaRef(input) {
|
|
618
|
+
return doesExtend({
|
|
619
|
+
$ref: import_string2.isString
|
|
620
|
+
})(input);
|
|
621
|
+
}
|
|
622
|
+
var colorPalette = {
|
|
623
|
+
$defs: {
|
|
624
|
+
colorChannel: {
|
|
625
|
+
type: `integer`,
|
|
626
|
+
minimum: Int(0),
|
|
627
|
+
maximum: Int(255)
|
|
628
|
+
},
|
|
629
|
+
color: {
|
|
630
|
+
type: `object`,
|
|
631
|
+
properties: {
|
|
632
|
+
red: { $ref: `#/$defs/colorChannel` },
|
|
633
|
+
green: { $ref: `#/$defs/colorChannel` },
|
|
634
|
+
blue: { $ref: `#/$defs/colorChannel` }
|
|
635
|
+
}
|
|
636
|
+
}
|
|
637
|
+
},
|
|
638
|
+
type: `array`,
|
|
639
|
+
items: {
|
|
640
|
+
$ref: `#/$defs/color`
|
|
641
|
+
}
|
|
642
|
+
};
|
|
643
|
+
var retrieveRef = ({
|
|
644
|
+
refNode: { $ref },
|
|
645
|
+
refMap = {},
|
|
646
|
+
root
|
|
647
|
+
}) => {
|
|
648
|
+
if (typeof root === `boolean`) {
|
|
649
|
+
throw new TypeError(`The root is a boolean and cannot be indexed`);
|
|
650
|
+
}
|
|
651
|
+
if ($ref in refMap)
|
|
652
|
+
return { node: refMap[$ref], refMap };
|
|
653
|
+
const [_, ...refPath] = $ref.split(`/`);
|
|
654
|
+
const discovery = delve(root, refPath);
|
|
655
|
+
if (discovery instanceof Error)
|
|
656
|
+
throw discovery;
|
|
657
|
+
let node = discovery.found;
|
|
658
|
+
while (isJsonSchemaRef(node)) {
|
|
659
|
+
const result = retrieveRef({ refNode: node, refMap, root });
|
|
660
|
+
node = result.node;
|
|
661
|
+
refMap = result.refMap;
|
|
662
|
+
}
|
|
663
|
+
if (isJsonSchema(node)) {
|
|
664
|
+
return { node, refMap: __spreadProps(__spreadValues({}, refMap), { [$ref]: node }) };
|
|
665
|
+
}
|
|
666
|
+
throw new TypeError(`The refNode is not a JsonSchema`);
|
|
667
|
+
};
|
|
668
|
+
|
|
669
|
+
// ../../anvl/src/json-schema/string-formats.ts
|
|
670
|
+
var import_string3 = require("fp-ts/string");
|
|
671
|
+
var JSON_SCHEMA_STRING_FORMATS = [
|
|
672
|
+
`date-time`,
|
|
673
|
+
`date`,
|
|
674
|
+
`email`,
|
|
675
|
+
`hostname`,
|
|
676
|
+
`ipv4`,
|
|
677
|
+
`ipv6`,
|
|
678
|
+
`regex`,
|
|
679
|
+
`time`,
|
|
680
|
+
`uri-reference`,
|
|
681
|
+
`uri-template`,
|
|
682
|
+
`uri`,
|
|
683
|
+
`uuid`
|
|
684
|
+
];
|
|
685
|
+
|
|
686
|
+
// ../../anvl/src/refinement/index.ts
|
|
687
|
+
var canExist = (_) => true;
|
|
688
|
+
var cannotExist = (_) => false;
|
|
689
|
+
var isLiteral = (value) => (input) => input === value;
|
|
690
|
+
var isWithin = (args) => (input) => args.includes(input);
|
|
691
|
+
var couldBe = (isTypeA, logging = false, refinements = [isTypeA]) => {
|
|
692
|
+
const name = `(${refinements.map((r) => r.name || `anon`).join(` | `)})`;
|
|
693
|
+
const _ = {
|
|
694
|
+
[name]: (input) => refinements.some(
|
|
695
|
+
(refinement) => {
|
|
696
|
+
var _a2;
|
|
697
|
+
return logging && console.log(
|
|
698
|
+
refinements.map((r) => r.name || `anon`).join(` | `),
|
|
699
|
+
`>`,
|
|
700
|
+
(_a2 = refinement.name) != null ? _a2 : `anon`,
|
|
701
|
+
`:`,
|
|
702
|
+
refinement(input)
|
|
703
|
+
), refinement(input);
|
|
704
|
+
}
|
|
705
|
+
)
|
|
706
|
+
};
|
|
707
|
+
const checkTypes = Object.assign(_[name], {
|
|
708
|
+
or: (isTypeB) => couldBe(isTypeB, logging, [...refinements, isTypeB])
|
|
709
|
+
});
|
|
710
|
+
return checkTypes;
|
|
711
|
+
};
|
|
712
|
+
var isUnion = couldBe(cannotExist);
|
|
713
|
+
var mustBe = (isTypeA, logging = false, refinements = [isTypeA]) => {
|
|
714
|
+
const name = `(${refinements.map((r) => r.name || `anon`).join(` & `)})`;
|
|
715
|
+
const _ = {
|
|
716
|
+
[name]: (input) => refinements.every(
|
|
717
|
+
(refinement) => (logging && console.log(
|
|
718
|
+
refinements.map((r) => r.name || `anon`).join(` & `),
|
|
719
|
+
`>`,
|
|
720
|
+
refinement.name || `anon`,
|
|
721
|
+
`:`,
|
|
722
|
+
refinement(input)
|
|
723
|
+
), refinement(input))
|
|
724
|
+
)
|
|
725
|
+
};
|
|
726
|
+
const checkTypes = Object.assign(_[name], {
|
|
727
|
+
and: (isTypeB) => mustBe(isTypeB, logging, [...refinements, isTypeB])
|
|
728
|
+
});
|
|
729
|
+
return checkTypes;
|
|
730
|
+
};
|
|
731
|
+
var isIntersection = mustBe(canExist);
|
|
732
|
+
|
|
733
|
+
// ../../anvl/src/json-schema/json-schema.ts
|
|
734
|
+
var JSON_SCHEMA_TYPE_NAMES = [...JSON_TYPE_NAMES, `integer`];
|
|
735
|
+
var JSON_SCHEMA_META_TYPE_NAMES = [
|
|
736
|
+
...JSON_SCHEMA_TYPE_NAMES,
|
|
737
|
+
`any`,
|
|
738
|
+
`never`
|
|
739
|
+
];
|
|
740
|
+
var JSON_SCHEMA_REFINERY = {
|
|
741
|
+
array: isArraySchema,
|
|
742
|
+
boolean: isBooleanSchema,
|
|
743
|
+
integer: isIntegerSchema,
|
|
744
|
+
null: isNullSchema,
|
|
745
|
+
number: isNumberSchema,
|
|
746
|
+
object: isObjectSchema,
|
|
747
|
+
string: isStringSchema,
|
|
748
|
+
any: isLiteral(true),
|
|
749
|
+
never: isLiteral(false),
|
|
750
|
+
union: isUnionSchema,
|
|
751
|
+
intersection: isIntersectionSchema,
|
|
752
|
+
negation: isNegationSchema,
|
|
753
|
+
conditional: isConditionalSchema
|
|
754
|
+
};
|
|
755
|
+
var stringSchemaStructure = {
|
|
756
|
+
type: isLiteral(`string`),
|
|
757
|
+
enum: ifDefined(isArray(import_string4.isString)),
|
|
758
|
+
minLength: ifDefined(isInteger),
|
|
759
|
+
maxLength: ifDefined(isInteger),
|
|
760
|
+
pattern: ifDefined(import_string4.isString),
|
|
761
|
+
format: ifDefined(isWithin(JSON_SCHEMA_STRING_FORMATS))
|
|
762
|
+
};
|
|
763
|
+
function isStringSchema(input) {
|
|
764
|
+
return doesExtend(stringSchemaStructure)(input);
|
|
765
|
+
}
|
|
766
|
+
var numberSchemaStructure = {
|
|
767
|
+
type: isLiteral(`number`),
|
|
768
|
+
enum: ifDefined(isArray(import_number3.isNumber)),
|
|
769
|
+
minimum: ifDefined(import_number3.isNumber),
|
|
770
|
+
maximum: ifDefined(import_number3.isNumber),
|
|
771
|
+
exclusiveMinimum: ifDefined(import_number3.isNumber),
|
|
772
|
+
exclusiveMaximum: ifDefined(import_number3.isNumber),
|
|
773
|
+
multipleOf: ifDefined(import_number3.isNumber)
|
|
774
|
+
};
|
|
775
|
+
function isNumberSchema(input) {
|
|
776
|
+
return doesExtend(numberSchemaStructure)(input);
|
|
777
|
+
}
|
|
778
|
+
var integerSchemaStructure = {
|
|
779
|
+
type: isLiteral(`integer`),
|
|
780
|
+
enum: ifDefined(isArray(isInteger)),
|
|
781
|
+
minimum: ifDefined(isInteger),
|
|
782
|
+
maximum: ifDefined(isInteger),
|
|
783
|
+
exclusiveMinimum: ifDefined(isInteger),
|
|
784
|
+
exclusiveMaximum: ifDefined(isInteger),
|
|
785
|
+
multipleOf: ifDefined(isInteger)
|
|
786
|
+
};
|
|
787
|
+
function isIntegerSchema(input) {
|
|
788
|
+
return doesExtend(integerSchemaStructure)(input);
|
|
789
|
+
}
|
|
790
|
+
var booleanSchemaStructure = {
|
|
791
|
+
type: isLiteral(`boolean`),
|
|
792
|
+
enum: ifDefined(isArray(import_boolean2.isBoolean))
|
|
793
|
+
};
|
|
794
|
+
function isBooleanSchema(input) {
|
|
795
|
+
return doesExtend(booleanSchemaStructure)(input);
|
|
796
|
+
}
|
|
797
|
+
var nullSchemaStructure = {
|
|
798
|
+
type: isLiteral(`null`)
|
|
799
|
+
};
|
|
800
|
+
function isNullSchema(input) {
|
|
801
|
+
return doesExtend(nullSchemaStructure)(input);
|
|
802
|
+
}
|
|
803
|
+
var objectSchemaStructure = {
|
|
804
|
+
type: isLiteral(`object`),
|
|
805
|
+
properties: ifDefined(isRecord(import_string4.isString, isJsonSchema)),
|
|
806
|
+
required: ifDefined(isArray(import_string4.isString)),
|
|
807
|
+
additionalProperties: ifDefined(isJsonSchema),
|
|
808
|
+
propertyNames: ifDefined(isStringSchema),
|
|
809
|
+
minProperties: ifDefined(isInteger),
|
|
810
|
+
maxProperties: ifDefined(isInteger),
|
|
811
|
+
dependentSchemas: ifDefined(isRecord(import_string4.isString, isJsonSchema))
|
|
812
|
+
};
|
|
813
|
+
function isObjectSchema(input) {
|
|
814
|
+
return doesExtend(objectSchemaStructure)(input);
|
|
815
|
+
}
|
|
816
|
+
var arraySchemaStructure = {
|
|
817
|
+
type: isLiteral(`array`),
|
|
818
|
+
items: ifDefined(couldBe(isJsonSchema).or(isArray(isJsonSchema))),
|
|
819
|
+
minItems: ifDefined(isInteger),
|
|
820
|
+
maxItems: ifDefined(isInteger),
|
|
821
|
+
uniqueItems: ifDefined(import_boolean2.isBoolean)
|
|
822
|
+
};
|
|
823
|
+
function isArraySchema(input) {
|
|
824
|
+
return doesExtend(arraySchemaStructure)(input);
|
|
825
|
+
}
|
|
826
|
+
var unionSchemaStructure = { anyOf: isArray(isJsonSchema) };
|
|
827
|
+
function isUnionSchema(input) {
|
|
828
|
+
return doesExtend(unionSchemaStructure)(input);
|
|
829
|
+
}
|
|
830
|
+
var exclusiveSchemaStructure = { oneOf: isArray(isJsonSchema) };
|
|
831
|
+
function isExclusiveSchema(input) {
|
|
832
|
+
return doesExtend(exclusiveSchemaStructure)(input);
|
|
833
|
+
}
|
|
834
|
+
var intersectionSchemaStructure = { allOf: isArray(isJsonSchema) };
|
|
835
|
+
function isIntersectionSchema(input) {
|
|
836
|
+
return doesExtend(intersectionSchemaStructure)(input);
|
|
837
|
+
}
|
|
838
|
+
var conditionalSchemaStructure = {
|
|
839
|
+
if: isJsonSchema,
|
|
840
|
+
then: ifDefined(isJsonSchema),
|
|
841
|
+
else: ifDefined(isJsonSchema)
|
|
842
|
+
};
|
|
843
|
+
function isConditionalSchema(input) {
|
|
844
|
+
return doesExtend(conditionalSchemaStructure)(input);
|
|
845
|
+
}
|
|
846
|
+
var negationSchemaStructure = { not: isJsonSchema };
|
|
847
|
+
function isNegationSchema(input) {
|
|
848
|
+
return doesExtend(negationSchemaStructure)(input);
|
|
849
|
+
}
|
|
850
|
+
var mixedSchemaStructure = __spreadProps(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues({}, arraySchemaStructure), booleanSchemaStructure), integerSchemaStructure), nullSchemaStructure), numberSchemaStructure), objectSchemaStructure), stringSchemaStructure), {
|
|
851
|
+
type: isArray(isWithin(JSON_SCHEMA_TYPE_NAMES)),
|
|
852
|
+
enum: ifDefined(
|
|
853
|
+
isArray(isUnion.or(isInteger).or(import_boolean2.isBoolean).or(import_number3.isNumber).or(import_string4.isString))
|
|
854
|
+
)
|
|
855
|
+
});
|
|
856
|
+
function isMixedSchema(input) {
|
|
857
|
+
return doesExtend(mixedSchemaStructure)(input);
|
|
858
|
+
}
|
|
859
|
+
var isJsonSchemaCore = isUnion.or(isArraySchema).or(isBooleanSchema).or(isConditionalSchema).or(isExclusiveSchema).or(isIntegerSchema).or(isIntersectionSchema).or(isMixedSchema).or(isNegationSchema).or(isNullSchema).or(isNumberSchema).or(isObjectSchema).or(isStringSchema).or(isUnionSchema);
|
|
860
|
+
var isJsonSchemaRoot = doesExtend({
|
|
861
|
+
$id: ifDefined(import_string4.isString),
|
|
862
|
+
$schema: ifDefined(import_string4.isString)
|
|
863
|
+
});
|
|
864
|
+
var isJsonSchemaObject = isIntersection.and(isJsonSchemaCore).and(isJsonSchemaRoot);
|
|
865
|
+
function isJsonSchema(input) {
|
|
866
|
+
return couldBe(isJsonSchemaObject).or(import_boolean2.isBoolean).or(isJsonSchemaRef)(input);
|
|
867
|
+
}
|
|
868
|
+
|
|
869
|
+
// ../../anvl/src/json-schema/path-into.ts
|
|
870
|
+
var expandPathForSchema = (path) => {
|
|
871
|
+
try {
|
|
872
|
+
return path.map((key) => {
|
|
873
|
+
switch (typeof key) {
|
|
874
|
+
case `string`:
|
|
875
|
+
return [`properties`, key];
|
|
876
|
+
case `number`:
|
|
877
|
+
return [`items`, key];
|
|
878
|
+
case `symbol`:
|
|
879
|
+
throw new TypeError(
|
|
880
|
+
`The key ${String(
|
|
881
|
+
key
|
|
882
|
+
)} is not a valid JSON key; expected string or number, got symbol`
|
|
883
|
+
);
|
|
884
|
+
default:
|
|
885
|
+
throw new TypeError(
|
|
886
|
+
`The key ${key} is not a valid JSON key; expected string or number, got ${typeof key}`
|
|
887
|
+
);
|
|
888
|
+
}
|
|
889
|
+
}).flat();
|
|
890
|
+
} catch (caught) {
|
|
891
|
+
if (caught instanceof TypeError)
|
|
892
|
+
return caught;
|
|
893
|
+
throw caught;
|
|
894
|
+
}
|
|
895
|
+
};
|
|
896
|
+
|
|
897
|
+
// ../../anvl/src/json-schema/find-sub-schema.ts
|
|
898
|
+
var findSubSchema = (schema) => {
|
|
899
|
+
if (typeof schema === `boolean`) {
|
|
900
|
+
throw new Error(`The schema does not contain subSchemas`);
|
|
901
|
+
}
|
|
902
|
+
return (path) => {
|
|
903
|
+
const pathIntoSchema = expandPathForSchema(path);
|
|
904
|
+
if (pathIntoSchema instanceof Error)
|
|
905
|
+
return pathIntoSchema;
|
|
906
|
+
if (typeof schema === `boolean`) {
|
|
907
|
+
return new TypeError(`The schema is not a JsonSchema`);
|
|
908
|
+
}
|
|
909
|
+
const { node, refMap } = pathIntoSchema.reduce(
|
|
910
|
+
({ node: node2, refMap: refMap2 = void 0 }, key) => (console.log({ node: node2, key }), isJsonSchemaRef(node2) ? retrieveRef({ refNode: node2, root: schema, refMap: refMap2 }) : { node: node2[key], refMap: refMap2 }),
|
|
911
|
+
{ node: schema, refMap: void 0 }
|
|
912
|
+
);
|
|
913
|
+
if (node instanceof Error)
|
|
914
|
+
throw node;
|
|
915
|
+
let subSchema = node;
|
|
916
|
+
while (isJsonSchemaRef(subSchema)) {
|
|
917
|
+
console.log({ subSchema });
|
|
918
|
+
subSchema = retrieveRef({ refNode: subSchema, root: schema, refMap }).node;
|
|
919
|
+
}
|
|
920
|
+
console.log({ subSchema });
|
|
921
|
+
if (isJsonSchema(subSchema)) {
|
|
922
|
+
return subSchema;
|
|
923
|
+
}
|
|
924
|
+
throw new TypeError(`The subSchema is not a JsonSchema`);
|
|
925
|
+
};
|
|
926
|
+
};
|
|
927
|
+
|
|
928
|
+
// ../../anvl/src/json/cast.ts
|
|
929
|
+
var stringToBoolean = (str) => str === `true`;
|
|
930
|
+
var stringToNumber = (str) => Number(str);
|
|
931
|
+
var stringToArray = (str) => str.split(`,`);
|
|
932
|
+
var stringToObject = (str) => {
|
|
933
|
+
try {
|
|
934
|
+
return JSON.parse(str);
|
|
935
|
+
} catch (e) {
|
|
936
|
+
return { [str]: str };
|
|
937
|
+
}
|
|
938
|
+
};
|
|
939
|
+
var objectToString = (obj) => JSON.stringify(obj);
|
|
940
|
+
var objectToBoolean = (obj) => obj.true === true;
|
|
941
|
+
var objectToNumber = (obj) => {
|
|
942
|
+
var _a2, _b, _c;
|
|
943
|
+
return Number((_c = (_b = (_a2 = obj.number) != null ? _a2 : obj.size) != null ? _b : obj.count) != null ? _c : 0);
|
|
944
|
+
};
|
|
945
|
+
var objectToArray = (obj) => Object.entries(obj);
|
|
946
|
+
var booleanToString = (bool) => bool.toString();
|
|
947
|
+
var booleanToNumber = (bool) => +bool;
|
|
948
|
+
var booleanToObject = (bool) => ({
|
|
949
|
+
[bool.toString()]: bool
|
|
950
|
+
});
|
|
951
|
+
var booleanToArray = (bool) => [bool];
|
|
952
|
+
var numberToString = (num) => num.toString();
|
|
953
|
+
var numberToBoolean = (num) => num === 1;
|
|
954
|
+
var numberToObject = (num) => ({
|
|
955
|
+
number: num
|
|
956
|
+
});
|
|
957
|
+
var numberToArray = (num) => Array(num).fill(null);
|
|
958
|
+
var arrayToString = (arr) => arr.join(`,`);
|
|
959
|
+
var arrayToNumber = (arr) => arr.length;
|
|
960
|
+
var arrayToBoolean = (arr) => typeof arr[0] === `boolean` ? arr[0] : arr.length > 0;
|
|
961
|
+
var arrayToObject = (arr) => arr.reduce((acc, cur, idx) => {
|
|
962
|
+
acc[`${idx}`] = cur;
|
|
963
|
+
return acc;
|
|
964
|
+
}, {});
|
|
965
|
+
var nullToString = () => ``;
|
|
966
|
+
var nullToNumber = () => 0;
|
|
967
|
+
var nullToBoolean = () => false;
|
|
968
|
+
var nullToArray = () => [];
|
|
969
|
+
var nullToObject = () => ({});
|
|
970
|
+
var cast = (input) => {
|
|
971
|
+
const json = refineJsonType(input);
|
|
972
|
+
return {
|
|
973
|
+
to: {
|
|
974
|
+
array: () => {
|
|
975
|
+
switch (json.type) {
|
|
976
|
+
case `array`:
|
|
977
|
+
return json.data;
|
|
978
|
+
case `object`:
|
|
979
|
+
return objectToArray(json.data);
|
|
980
|
+
case `string`:
|
|
981
|
+
return stringToArray(json.data);
|
|
982
|
+
case `boolean`:
|
|
983
|
+
return booleanToArray(json.data);
|
|
984
|
+
case `number`:
|
|
985
|
+
return numberToArray(json.data);
|
|
986
|
+
case `null`:
|
|
987
|
+
return nullToArray();
|
|
988
|
+
}
|
|
989
|
+
},
|
|
990
|
+
boolean: () => {
|
|
991
|
+
switch (json.type) {
|
|
992
|
+
case `array`:
|
|
993
|
+
return arrayToBoolean(json.data);
|
|
994
|
+
case `object`:
|
|
995
|
+
return objectToBoolean(json.data);
|
|
996
|
+
case `string`:
|
|
997
|
+
return stringToBoolean(json.data);
|
|
998
|
+
case `boolean`:
|
|
999
|
+
return json.data;
|
|
1000
|
+
case `number`:
|
|
1001
|
+
return numberToBoolean(json.data);
|
|
1002
|
+
case `null`:
|
|
1003
|
+
return nullToBoolean();
|
|
1004
|
+
}
|
|
1005
|
+
},
|
|
1006
|
+
number: () => {
|
|
1007
|
+
switch (json.type) {
|
|
1008
|
+
case `array`:
|
|
1009
|
+
return arrayToNumber(json.data);
|
|
1010
|
+
case `object`:
|
|
1011
|
+
return objectToNumber(json.data);
|
|
1012
|
+
case `string`:
|
|
1013
|
+
return stringToNumber(json.data);
|
|
1014
|
+
case `boolean`:
|
|
1015
|
+
return booleanToNumber(json.data);
|
|
1016
|
+
case `number`:
|
|
1017
|
+
return json.data;
|
|
1018
|
+
case `null`:
|
|
1019
|
+
return nullToNumber();
|
|
1020
|
+
}
|
|
1021
|
+
},
|
|
1022
|
+
object: () => {
|
|
1023
|
+
switch (json.type) {
|
|
1024
|
+
case `array`:
|
|
1025
|
+
return arrayToObject(json.data);
|
|
1026
|
+
case `object`:
|
|
1027
|
+
return json.data;
|
|
1028
|
+
case `string`:
|
|
1029
|
+
return stringToObject(json.data);
|
|
1030
|
+
case `boolean`:
|
|
1031
|
+
return booleanToObject(json.data);
|
|
1032
|
+
case `number`:
|
|
1033
|
+
return numberToObject(json.data);
|
|
1034
|
+
case `null`:
|
|
1035
|
+
return nullToObject();
|
|
1036
|
+
}
|
|
1037
|
+
},
|
|
1038
|
+
string: () => {
|
|
1039
|
+
switch (json.type) {
|
|
1040
|
+
case `array`:
|
|
1041
|
+
return arrayToString(json.data);
|
|
1042
|
+
case `object`:
|
|
1043
|
+
return objectToString(json.data);
|
|
1044
|
+
case `string`:
|
|
1045
|
+
return json.data;
|
|
1046
|
+
case `boolean`:
|
|
1047
|
+
return booleanToString(json.data);
|
|
1048
|
+
case `number`:
|
|
1049
|
+
return numberToString(json.data);
|
|
1050
|
+
case `null`:
|
|
1051
|
+
return nullToString();
|
|
1052
|
+
}
|
|
1053
|
+
},
|
|
1054
|
+
null: () => null
|
|
1055
|
+
}
|
|
1056
|
+
};
|
|
1057
|
+
};
|
|
1058
|
+
|
|
1059
|
+
// ../../Luum/src/utils/mapObject.ts
|
|
1060
|
+
var mapObject2 = (obj, fn) => {
|
|
1061
|
+
const newObj = {};
|
|
1062
|
+
const entries = Object.entries(obj);
|
|
1063
|
+
entries.forEach(([key, val]) => newObj[key] = fn(val, key));
|
|
1064
|
+
return newObj;
|
|
1065
|
+
};
|
|
1066
|
+
var mapObject_default = mapObject2;
|
|
1067
|
+
|
|
1068
|
+
// ../../hamr/src/react-json-editor/editors-by-type/utilities/object-properties.ts
|
|
1069
|
+
var makePropertySetters = (data, set) => mapObject_default(
|
|
1070
|
+
data,
|
|
1071
|
+
(value, key) => (newValue) => set(__spreadProps(__spreadValues({}, data), { [key]: become(newValue)(value[key]) }))
|
|
1072
|
+
);
|
|
1073
|
+
var makePropertyRenamers = (data, set, stableKeyMapRef) => mapObject_default(
|
|
1074
|
+
data,
|
|
1075
|
+
(value, key) => (newKey) => Object.hasOwn(data, newKey) ? null : set(() => {
|
|
1076
|
+
const entries = Object.entries(data);
|
|
1077
|
+
const index = entries.findIndex(([k]) => k === key);
|
|
1078
|
+
entries[index] = [newKey, value];
|
|
1079
|
+
const stableKeyMap = stableKeyMapRef.current;
|
|
1080
|
+
stableKeyMapRef.current = __spreadProps(__spreadValues({}, stableKeyMap), {
|
|
1081
|
+
[newKey]: stableKeyMap[key]
|
|
1082
|
+
});
|
|
1083
|
+
return Object.fromEntries(entries);
|
|
1084
|
+
})
|
|
1085
|
+
);
|
|
1086
|
+
var makePropertyRemovers = (data, set) => mapObject_default(
|
|
1087
|
+
data,
|
|
1088
|
+
(_, key) => () => set(() => {
|
|
1089
|
+
const _a2 = data, { [key]: _2 } = _a2, rest = __objRest(_a2, [__restKey(key)]);
|
|
1090
|
+
return rest;
|
|
1091
|
+
})
|
|
1092
|
+
);
|
|
1093
|
+
var makePropertyRecasters = (data, set) => mapObject_default(
|
|
1094
|
+
data,
|
|
1095
|
+
(value, key) => (newType) => set(() => __spreadProps(__spreadValues({}, data), {
|
|
1096
|
+
[key]: cast(value).to[newType]()
|
|
1097
|
+
}))
|
|
1098
|
+
);
|
|
1099
|
+
var makePropertyCreationInterface = (data, set) => (key, type) => (value) => set(__spreadProps(__spreadValues({}, data), { [key]: value != null ? value : JSON_DEFAULTS[type] }));
|
|
1100
|
+
var makePropertySorter = (data, set, sortFn) => () => {
|
|
1101
|
+
const sortedKeys = Object.keys(data).sort(sortFn);
|
|
1102
|
+
const sortedObj = {};
|
|
1103
|
+
sortedKeys.forEach((key) => sortedObj[key] = data[key]);
|
|
1104
|
+
set(sortedObj);
|
|
1105
|
+
};
|
|
1106
|
+
|
|
1107
|
+
// ../../hamr/src/react-json-editor/editors-by-type/object-editor.tsx
|
|
1108
|
+
var import_jsx_runtime6 = require("@emotion/react/jsx-runtime");
|
|
1109
|
+
var PropertyAdder = ({
|
|
1110
|
+
addProperty,
|
|
1111
|
+
disabled,
|
|
1112
|
+
propertyKey,
|
|
1113
|
+
Components
|
|
1114
|
+
}) => /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(Components.MissingPropertyWrapper, { children: [
|
|
1115
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(ElasticInput, { disabled: true, defaultValue: propertyKey }),
|
|
1116
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(ElasticInput, { disabled: true, defaultValue: "is missing" }),
|
|
1117
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Components.Button, { onClick: () => addProperty(), disabled, children: "+" })
|
|
1118
|
+
] });
|
|
1119
|
+
var ObjectEditor = ({
|
|
1120
|
+
schema,
|
|
1121
|
+
path = [],
|
|
1122
|
+
isReadonly = () => false,
|
|
1123
|
+
isHidden = () => false,
|
|
1124
|
+
data,
|
|
1125
|
+
set,
|
|
1126
|
+
Components
|
|
1127
|
+
}) => {
|
|
1128
|
+
var _a2;
|
|
1129
|
+
const disabled = isReadonly(path);
|
|
1130
|
+
const stableKeyMap = (0, import_react3.useRef)(
|
|
1131
|
+
Object.keys(data).reduce((acc, key) => {
|
|
1132
|
+
acc[key] = key;
|
|
1133
|
+
return acc;
|
|
1134
|
+
}, {})
|
|
1135
|
+
);
|
|
1136
|
+
const setProperty = makePropertySetters(data, set);
|
|
1137
|
+
const renameProperty = makePropertyRenamers(data, set, stableKeyMap);
|
|
1138
|
+
const removeProperty = makePropertyRemovers(data, set);
|
|
1139
|
+
const recastProperty = makePropertyRecasters(data, set);
|
|
1140
|
+
const sortProperties = makePropertySorter(data, set);
|
|
1141
|
+
const makePropertyAdder = makePropertyCreationInterface(data, set);
|
|
1142
|
+
const subSchema = isPlainObject(schema) ? findSubSchema(schema)(path) : true;
|
|
1143
|
+
const schemaKeys = isLiteral(true)(subSchema) ? true : isObjectSchema(subSchema) ? Object.keys((_a2 = subSchema.properties) != null ? _a2 : {}) : [];
|
|
1144
|
+
const dataKeys = Object.keys(data);
|
|
1145
|
+
const [unofficialKeys, officialKeys] = dataKeys.reduce(
|
|
1146
|
+
([unofficial, official], key) => {
|
|
1147
|
+
const isOfficial = schemaKeys === true || schemaKeys.includes(key);
|
|
1148
|
+
return isOfficial ? [unofficial, [...official, key]] : [[...unofficial, key], official];
|
|
1149
|
+
},
|
|
1150
|
+
[[], []]
|
|
1151
|
+
);
|
|
1152
|
+
const missingKeys = schemaKeys === true ? [] : schemaKeys.filter((key) => !dataKeys.includes(key));
|
|
1153
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(import_jsx_runtime6.Fragment, { children: [
|
|
1154
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Components.Button, { onClick: () => sortProperties(), disabled, children: "Sort" }),
|
|
1155
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(Components.ObjectWrapper, { children: [
|
|
1156
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", { className: "json_editor_properties", children: [...missingKeys, ...officialKeys, ...unofficialKeys].map((key) => {
|
|
1157
|
+
const originalKey = stableKeyMap.current[key];
|
|
1158
|
+
const newPath = [...path, key];
|
|
1159
|
+
const originalPath = [...path, originalKey];
|
|
1160
|
+
const isOfficial = schemaKeys === true || schemaKeys.includes(key);
|
|
1161
|
+
const isMissing = missingKeys.includes(key);
|
|
1162
|
+
return isMissing ? /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
1163
|
+
PropertyAdder,
|
|
1164
|
+
{
|
|
1165
|
+
propertyKey: key,
|
|
1166
|
+
addProperty: makePropertyAdder(key, `string`),
|
|
1167
|
+
disabled,
|
|
1168
|
+
Components
|
|
1169
|
+
},
|
|
1170
|
+
key + `IsMissing`
|
|
1171
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
1172
|
+
JsonEditor_INTERNAL,
|
|
1173
|
+
{
|
|
1174
|
+
schema,
|
|
1175
|
+
path: newPath,
|
|
1176
|
+
name: key,
|
|
1177
|
+
isReadonly,
|
|
1178
|
+
isHidden,
|
|
1179
|
+
data: data[key],
|
|
1180
|
+
set: setProperty[key],
|
|
1181
|
+
rename: renameProperty[key],
|
|
1182
|
+
remove: removeProperty[key],
|
|
1183
|
+
recast: recastProperty[key],
|
|
1184
|
+
className: `json_editor_property ${isOfficial ? `json_editor_official` : `json_editor_unofficial`}`,
|
|
1185
|
+
Components
|
|
1186
|
+
},
|
|
1187
|
+
originalPath.join(`.`)
|
|
1188
|
+
);
|
|
1189
|
+
}) }),
|
|
1190
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
1191
|
+
Components.Button,
|
|
1192
|
+
{
|
|
1193
|
+
onClick: disabled ? doNothing : () => makePropertyAdder(`new_property`, `string`)(),
|
|
1194
|
+
disabled,
|
|
1195
|
+
children: "+"
|
|
1196
|
+
}
|
|
1197
|
+
)
|
|
1198
|
+
] })
|
|
1199
|
+
] });
|
|
1200
|
+
};
|
|
1201
|
+
|
|
1202
|
+
// ../../hamr/src/react-json-editor/editors-by-type/primitive-editors.tsx
|
|
1203
|
+
var import_jsx_runtime7 = require("@emotion/react/jsx-runtime");
|
|
1204
|
+
var BooleanEditor = ({
|
|
1205
|
+
data,
|
|
1206
|
+
set
|
|
1207
|
+
}) => /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
1208
|
+
"input",
|
|
1209
|
+
{
|
|
1210
|
+
type: "checkbox",
|
|
1211
|
+
checked: data,
|
|
1212
|
+
onChange: (event) => set(event.target.checked)
|
|
1213
|
+
}
|
|
1214
|
+
);
|
|
1215
|
+
var NullEditor = () => /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("input", { type: "text", value: "null", readOnly: true });
|
|
1216
|
+
var NumberEditor = ({
|
|
1217
|
+
path = [],
|
|
1218
|
+
isReadonly = () => false,
|
|
1219
|
+
data,
|
|
1220
|
+
set
|
|
1221
|
+
}) => /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
1222
|
+
NumberInput,
|
|
1223
|
+
{
|
|
1224
|
+
value: data,
|
|
1225
|
+
set: isReadonly(path) ? void 0 : (newValue) => set(Number(newValue)),
|
|
1226
|
+
autoSize: true
|
|
1227
|
+
}
|
|
1228
|
+
);
|
|
1229
|
+
var StringEditor = ({
|
|
1230
|
+
path = [],
|
|
1231
|
+
isReadonly = () => false,
|
|
1232
|
+
data,
|
|
1233
|
+
set,
|
|
1234
|
+
Components
|
|
1235
|
+
}) => {
|
|
1236
|
+
return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Components.StringWrapper, { children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
1237
|
+
TextInput,
|
|
1238
|
+
{
|
|
1239
|
+
value: data,
|
|
1240
|
+
set: isReadonly(path) ? void 0 : set,
|
|
1241
|
+
autoSize: true
|
|
1242
|
+
}
|
|
1243
|
+
) });
|
|
1244
|
+
};
|
|
1245
|
+
|
|
1246
|
+
// ../../hamr/src/react-error-boundary/ErrorBoundary.tsx
|
|
1247
|
+
var import_react4 = require("react");
|
|
1248
|
+
var import_recoil = require("recoil");
|
|
1249
|
+
|
|
1250
|
+
// ../../hamr/src/react-error-boundary/DefaultFallback.tsx
|
|
1251
|
+
var import_jsx_runtime8 = require("@emotion/react/jsx-runtime");
|
|
1252
|
+
var DefaultFallback = ({ error, errorInfo }) => {
|
|
1253
|
+
var _a2, _b;
|
|
1254
|
+
const component = errorInfo == null ? void 0 : errorInfo.componentStack.split(` `).filter(Boolean)[2];
|
|
1255
|
+
const message = (_b = (_a2 = error == null ? void 0 : error.toString()) != null ? _a2 : errorInfo == null ? void 0 : errorInfo.componentStack) != null ? _b : `Unknown error`;
|
|
1256
|
+
return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
1257
|
+
"div",
|
|
1258
|
+
{
|
|
1259
|
+
"data-testid": "error-boundary",
|
|
1260
|
+
style: {
|
|
1261
|
+
flex: `1`,
|
|
1262
|
+
background: `black`,
|
|
1263
|
+
backgroundImage: `url(./src/assets/kablooey.gif)`,
|
|
1264
|
+
backgroundPosition: `center`,
|
|
1265
|
+
// backgroundRepeat: `no-repeat`,
|
|
1266
|
+
backgroundSize: `overlay`
|
|
1267
|
+
},
|
|
1268
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
1269
|
+
"div",
|
|
1270
|
+
{
|
|
1271
|
+
style: {
|
|
1272
|
+
margin: `50px`,
|
|
1273
|
+
marginTop: `0`,
|
|
1274
|
+
padding: `50px`,
|
|
1275
|
+
border: `1px solid dashed`
|
|
1276
|
+
},
|
|
1277
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(
|
|
1278
|
+
"span",
|
|
1279
|
+
{
|
|
1280
|
+
style: {
|
|
1281
|
+
background: `black`,
|
|
1282
|
+
color: `white`,
|
|
1283
|
+
padding: 10,
|
|
1284
|
+
paddingTop: 5
|
|
1285
|
+
},
|
|
1286
|
+
children: [
|
|
1287
|
+
`\u26A0\uFE0F `,
|
|
1288
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)("span", { style: { color: `#fc0`, fontWeight: 700 }, children: component }),
|
|
1289
|
+
` \u26A0\uFE0F `,
|
|
1290
|
+
message
|
|
1291
|
+
]
|
|
1292
|
+
}
|
|
1293
|
+
)
|
|
1294
|
+
}
|
|
1295
|
+
)
|
|
1296
|
+
}
|
|
1297
|
+
);
|
|
1298
|
+
};
|
|
1299
|
+
|
|
1300
|
+
// ../../hamr/src/react-error-boundary/ErrorBoundary.tsx
|
|
1301
|
+
var import_jsx_runtime9 = require("@emotion/react/jsx-runtime");
|
|
1302
|
+
var ErrorBoundary = class extends import_react4.Component {
|
|
1303
|
+
constructor(props) {
|
|
1304
|
+
super(props);
|
|
1305
|
+
this.state = { error: void 0, errorInfo: void 0 };
|
|
1306
|
+
}
|
|
1307
|
+
componentDidCatch(error, errorInfo) {
|
|
1308
|
+
var _a2, _b;
|
|
1309
|
+
(_b = (_a2 = this.props).onError) == null ? void 0 : _b.call(_a2, error, errorInfo);
|
|
1310
|
+
this.setState({
|
|
1311
|
+
error,
|
|
1312
|
+
errorInfo
|
|
1313
|
+
});
|
|
1314
|
+
}
|
|
1315
|
+
render() {
|
|
1316
|
+
const { error, errorInfo } = this.state;
|
|
1317
|
+
const { children, Fallback = DefaultFallback } = this.props;
|
|
1318
|
+
return errorInfo ? /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(Fallback, { error, errorInfo }) : children;
|
|
1319
|
+
}
|
|
1320
|
+
};
|
|
1321
|
+
var findErrorBoundaryState = (0, import_recoil.atomFamily)({
|
|
1322
|
+
key: `errorBoundary`,
|
|
1323
|
+
default: { error: void 0, errorInfo: void 0 }
|
|
1324
|
+
});
|
|
1325
|
+
|
|
1326
|
+
// ../../hamr/src/react-json-editor/default-components.tsx
|
|
1327
|
+
var import_jsx_runtime10 = require("@emotion/react/jsx-runtime");
|
|
1328
|
+
var DEFAULT_JSON_EDITOR_COMPONENTS = {
|
|
1329
|
+
ErrorBoundary: ({ children }) => /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(ErrorBoundary, { children }),
|
|
1330
|
+
Button: ({ onClick, children, disabled }) => /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("button", { className: "json_editor_button", onClick, disabled, children }),
|
|
1331
|
+
EditorWrapper: ({ children, customCss, className }) => /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: `json_editor ` + className, css: customCss, children }),
|
|
1332
|
+
EditorLayout: ({
|
|
1333
|
+
DeleteButton,
|
|
1334
|
+
Header,
|
|
1335
|
+
KeyInput,
|
|
1336
|
+
TypeSelect,
|
|
1337
|
+
ValueEditor,
|
|
1338
|
+
Wrapper
|
|
1339
|
+
}) => {
|
|
1340
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(Wrapper, { children: [
|
|
1341
|
+
DeleteButton && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(DeleteButton, {}),
|
|
1342
|
+
Header && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(Header, {}),
|
|
1343
|
+
KeyInput && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(KeyInput, {}),
|
|
1344
|
+
TypeSelect && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(TypeSelect, {}),
|
|
1345
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(ValueEditor, {})
|
|
1346
|
+
] });
|
|
1347
|
+
},
|
|
1348
|
+
ArrayWrapper: ({ children }) => /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: "json_editor_array", children }),
|
|
1349
|
+
ObjectWrapper: ({ children }) => /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: "json_editor_object", children }),
|
|
1350
|
+
StringWrapper: ({ children }) => /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { className: "json_editor_string", children }),
|
|
1351
|
+
NumberWrapper: ({ children }) => /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { className: "json_editor_number", children }),
|
|
1352
|
+
BooleanWrapper: ({ children }) => /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { className: "json_editor_boolean", children }),
|
|
1353
|
+
NullWrapper: ({ children }) => /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { className: "json_editor_null", children }),
|
|
1354
|
+
MissingPropertyWrapper: ({ children }) => /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: "json_editor_property json_editor_missing", children }),
|
|
1355
|
+
MiscastPropertyWrapper: ({ children }) => /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: "json_editor_property json_editor_miscast", children }),
|
|
1356
|
+
IllegalPropertyWrapper: ({ children }) => /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { className: "json_editor_property json_editor_illegal", children }),
|
|
1357
|
+
OfficialPropertyWrapper: ({ children }) => /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { className: "json_editor_property json_editor_official", children }),
|
|
1358
|
+
UnofficialPropertyWrapper: ({ children }) => /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { className: "json_editor_property json_editor_unofficial", children }),
|
|
1359
|
+
DeleteIcon: () => /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { className: "json_editor_icon json_editor_delete", children: "x" }),
|
|
1360
|
+
KeyWrapper: ({ children }) => /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { className: "json_editor_key", children })
|
|
1361
|
+
};
|
|
1362
|
+
|
|
1363
|
+
// ../../hamr/src/react-json-editor/developer-interface.tsx
|
|
1364
|
+
var import_react5 = require("react");
|
|
1365
|
+
var import_ajv = __toESM(require("ajv"));
|
|
1366
|
+
var import_jsx_runtime11 = require("@emotion/react/jsx-runtime");
|
|
1367
|
+
var JsonEditor = ({
|
|
1368
|
+
data,
|
|
1369
|
+
set,
|
|
1370
|
+
schema = true,
|
|
1371
|
+
name,
|
|
1372
|
+
rename,
|
|
1373
|
+
remove,
|
|
1374
|
+
isReadonly = () => false,
|
|
1375
|
+
isHidden = () => false,
|
|
1376
|
+
// isIllegal = () => false,
|
|
1377
|
+
className,
|
|
1378
|
+
customCss,
|
|
1379
|
+
Header,
|
|
1380
|
+
Components: CustomComponents = {}
|
|
1381
|
+
}) => {
|
|
1382
|
+
const Components = __spreadValues(__spreadValues({}, DEFAULT_JSON_EDITOR_COMPONENTS), CustomComponents);
|
|
1383
|
+
const ajv = new import_ajv.default({ allErrors: true, verbose: true });
|
|
1384
|
+
const validate = (0, import_react5.useMemo)(() => {
|
|
1385
|
+
return ajv.compile(schema);
|
|
1386
|
+
}, [schema]);
|
|
1387
|
+
const validationResults = validate(data);
|
|
1388
|
+
return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
1389
|
+
JsonEditor_INTERNAL,
|
|
1390
|
+
{
|
|
1391
|
+
data,
|
|
1392
|
+
set,
|
|
1393
|
+
name,
|
|
1394
|
+
schema,
|
|
1395
|
+
rename,
|
|
1396
|
+
remove,
|
|
1397
|
+
path: [],
|
|
1398
|
+
isReadonly,
|
|
1399
|
+
isHidden,
|
|
1400
|
+
className,
|
|
1401
|
+
customCss,
|
|
1402
|
+
Header,
|
|
1403
|
+
Components
|
|
1404
|
+
}
|
|
1405
|
+
);
|
|
1406
|
+
};
|
|
1407
|
+
|
|
1408
|
+
// ../../hamr/src/react-json-editor/index.ts
|
|
1409
|
+
var SubEditors = {
|
|
1410
|
+
array: ArrayEditor,
|
|
1411
|
+
boolean: BooleanEditor,
|
|
1412
|
+
null: NullEditor,
|
|
1413
|
+
number: NumberEditor,
|
|
1414
|
+
object: ObjectEditor,
|
|
1415
|
+
string: StringEditor
|
|
1416
|
+
};
|
|
1417
|
+
|
|
1418
|
+
// ../src/react-devtools/StateEditor.tsx
|
|
1419
|
+
var import_jsx_runtime12 = require("@emotion/react/jsx-runtime");
|
|
1420
|
+
var StateEditor = ({ storeHooks, token }) => {
|
|
1421
|
+
const [data, set] = storeHooks.useIO(token);
|
|
1422
|
+
return isPlainJson(data) ? /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(JsonEditor, { data, set, schema: true }) : /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("div", { className: "json_editor", children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
1423
|
+
ElasticInput,
|
|
1424
|
+
{
|
|
1425
|
+
value: data instanceof Set ? `Set { ${JSON.stringify([...data]).slice(1, -1)} }` : data instanceof Map ? `Map ` + JSON.stringify([...data]) : Object.getPrototypeOf(data).constructor.name + ` ` + JSON.stringify(data),
|
|
1426
|
+
disabled: true
|
|
1427
|
+
}
|
|
1428
|
+
) });
|
|
1429
|
+
};
|
|
1430
|
+
var ReadonlySelectorEditor = ({ storeHooks, token }) => {
|
|
1431
|
+
const data = storeHooks.useO(token);
|
|
1432
|
+
return isPlainJson(data) ? /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
1433
|
+
JsonEditor,
|
|
1434
|
+
{
|
|
1435
|
+
data,
|
|
1436
|
+
set: () => null,
|
|
1437
|
+
schema: true,
|
|
1438
|
+
isReadonly: () => true
|
|
1439
|
+
}
|
|
1440
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("div", { className: "json_editor", children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
1441
|
+
ElasticInput,
|
|
1442
|
+
{
|
|
1443
|
+
value: data instanceof Set ? `Set ` + JSON.stringify([...data]) : data instanceof Map ? `Map ` + JSON.stringify([...data]) : Object.getPrototypeOf(data).constructor.name + ` ` + JSON.stringify(data),
|
|
1444
|
+
disabled: true
|
|
1445
|
+
}
|
|
1446
|
+
) });
|
|
1447
|
+
};
|
|
1448
|
+
var StoreEditor = ({ storeHooks, token }) => {
|
|
1449
|
+
if (token.type === `readonly_selector`) {
|
|
1450
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(ReadonlySelectorEditor, { storeHooks, token });
|
|
1451
|
+
}
|
|
1452
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(StateEditor, { storeHooks, token });
|
|
1453
|
+
};
|
|
1454
|
+
|
|
1455
|
+
// ../src/react-devtools/TokenList.tsx
|
|
1456
|
+
var import_jsx_runtime13 = require("@emotion/react/jsx-runtime");
|
|
1457
|
+
var TokenList = ({ storeHooks, tokenIndex }) => {
|
|
1458
|
+
const tokenIds = storeHooks.useO(tokenIndex);
|
|
1459
|
+
return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_jsx_runtime13.Fragment, { children: Object.entries(tokenIds).map(([key, token]) => /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_react6.Fragment, { children: key.startsWith(`\u{1F441}\u200D\u{1F5E8}_`) ? null : /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { className: "node", children: [
|
|
1460
|
+
key,
|
|
1461
|
+
":",
|
|
1462
|
+
`type` in token ? /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(StoreEditor, { storeHooks, token }) : recordToEntries(token.familyMembers).map(([key2, token2]) => /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { className: "node", children: [
|
|
1463
|
+
key2,
|
|
1464
|
+
":",
|
|
1465
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(StoreEditor, { storeHooks, token: token2 })
|
|
1466
|
+
] }, key2))
|
|
1467
|
+
] }) }, key)) });
|
|
1468
|
+
};
|
|
1469
|
+
|
|
1470
|
+
// ../src/web-effects/storage.ts
|
|
1471
|
+
var persistAtom = (storage) => ({ stringify, parse }) => (key) => ({ setSelf, onSet }) => {
|
|
1472
|
+
const savedValue = storage.getItem(key);
|
|
1473
|
+
if (savedValue != null)
|
|
1474
|
+
setSelf(parse(savedValue));
|
|
1475
|
+
onSet(({ newValue }) => {
|
|
1476
|
+
if (newValue == null) {
|
|
1477
|
+
storage.removeItem(key);
|
|
1478
|
+
return;
|
|
1479
|
+
}
|
|
1480
|
+
storage.setItem(key, stringify(newValue));
|
|
1481
|
+
});
|
|
1482
|
+
};
|
|
1483
|
+
var lazyLocalStorageEffect = persistAtom(localStorage)(JSON);
|
|
1484
|
+
|
|
1485
|
+
// ../src/react-devtools/AtomIODevtools.tsx
|
|
1486
|
+
var import_jsx_runtime14 = require("@emotion/react/jsx-runtime");
|
|
1487
|
+
var { atomTokenIndexState, selectorTokenIndexState } = import_atom.__INTERNAL__.META.attachMetaState();
|
|
1488
|
+
var devtoolsAreOpenState = (0, import_atom.atom)({
|
|
1489
|
+
key: `\u{1F441}\u200D\u{1F5E8}_devtools_are_open`,
|
|
1490
|
+
default: true,
|
|
1491
|
+
effects: [lazyLocalStorageEffect(`\u{1F441}\u200D\u{1F5E8}_devtools_are_open`)]
|
|
1492
|
+
});
|
|
1493
|
+
var composeDevtools = (storeHooks) => {
|
|
1494
|
+
const Devtools = () => {
|
|
1495
|
+
const constraintsRef = (0, import_react7.useRef)(null);
|
|
1496
|
+
const [devtoolsAreOpen, setDevtoolsAreOpen] = storeHooks.useIO(devtoolsAreOpenState);
|
|
1497
|
+
const mouseHasMoved = (0, import_react7.useRef)(false);
|
|
1498
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(import_jsx_runtime14.Fragment, { children: [
|
|
1499
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
1500
|
+
import_framer_motion.motion.span,
|
|
1501
|
+
{
|
|
1502
|
+
ref: constraintsRef,
|
|
1503
|
+
className: "atom_io_devtools_zone",
|
|
1504
|
+
style: {
|
|
1505
|
+
position: `fixed`,
|
|
1506
|
+
top: 0,
|
|
1507
|
+
left: 0,
|
|
1508
|
+
right: 0,
|
|
1509
|
+
bottom: 0,
|
|
1510
|
+
pointerEvents: `none`
|
|
1511
|
+
}
|
|
1512
|
+
}
|
|
1513
|
+
),
|
|
1514
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(
|
|
1515
|
+
import_framer_motion.motion.main,
|
|
1516
|
+
{
|
|
1517
|
+
drag: true,
|
|
1518
|
+
dragConstraints: constraintsRef,
|
|
1519
|
+
className: "atom_io_devtools",
|
|
1520
|
+
transition: import_framer_motion.spring,
|
|
1521
|
+
style: devtoolsAreOpen ? {} : {
|
|
1522
|
+
backgroundColor: `#0000`,
|
|
1523
|
+
borderColor: `#0000`,
|
|
1524
|
+
maxHeight: 28,
|
|
1525
|
+
maxWidth: 33
|
|
1526
|
+
},
|
|
1527
|
+
children: [
|
|
1528
|
+
devtoolsAreOpen ? /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(import_jsx_runtime14.Fragment, { children: [
|
|
1529
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_framer_motion.motion.header, { children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("h1", { children: "atom.io" }) }),
|
|
1530
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_framer_motion.motion.main, { children: /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(import_framer_motion.LayoutGroup, { children: [
|
|
1531
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("section", { children: [
|
|
1532
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("h2", { children: "atoms" }),
|
|
1533
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
1534
|
+
TokenList,
|
|
1535
|
+
{
|
|
1536
|
+
storeHooks,
|
|
1537
|
+
tokenIndex: atomTokenIndexState
|
|
1538
|
+
}
|
|
1539
|
+
)
|
|
1540
|
+
] }),
|
|
1541
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("section", { children: [
|
|
1542
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("h2", { children: "selectors" }),
|
|
1543
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
1544
|
+
TokenList,
|
|
1545
|
+
{
|
|
1546
|
+
storeHooks,
|
|
1547
|
+
tokenIndex: selectorTokenIndexState
|
|
1548
|
+
}
|
|
1549
|
+
)
|
|
1550
|
+
] })
|
|
1551
|
+
] }) })
|
|
1552
|
+
] }) : null,
|
|
1553
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("footer", { children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
1554
|
+
"button",
|
|
1555
|
+
{
|
|
1556
|
+
onMouseDown: () => mouseHasMoved.current = false,
|
|
1557
|
+
onMouseMove: () => mouseHasMoved.current = true,
|
|
1558
|
+
onMouseUp: () => {
|
|
1559
|
+
if (!mouseHasMoved.current) {
|
|
1560
|
+
setDevtoolsAreOpen((open) => !open);
|
|
1561
|
+
}
|
|
1562
|
+
},
|
|
1563
|
+
children: "\u{1F441}\u200D\u{1F5E8}"
|
|
1564
|
+
}
|
|
1565
|
+
) })
|
|
1566
|
+
]
|
|
1567
|
+
}
|
|
1568
|
+
)
|
|
1569
|
+
] });
|
|
1570
|
+
};
|
|
1571
|
+
return Devtools;
|
|
1572
|
+
};
|
|
1573
|
+
var AtomIODevtools = composeDevtools({ useI: import_react8.useI, useO: import_react8.useO, useIO: import_react8.useIO });
|
|
1574
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
1575
|
+
0 && (module.exports = {
|
|
1576
|
+
AtomIODevtools,
|
|
1577
|
+
composeDevtools
|
|
1578
|
+
});
|
|
1579
|
+
//# sourceMappingURL=index.js.map
|