atom.io 0.11.0 → 0.12.1
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/data/dist/index.cjs +614 -0
- package/data/dist/index.cjs.map +1 -0
- package/data/dist/index.d.cts +158 -0
- package/data/dist/index.d.ts +118 -1
- package/data/dist/index.js +551 -30
- package/data/dist/index.js.map +1 -1
- package/data/dist/metafile-cjs.json +1 -0
- package/data/dist/metafile-esm.json +1 -0
- package/data/package.json +4 -3
- package/data/src/index.ts +1 -0
- package/data/src/join.ts +450 -0
- package/data/src/struct-family.ts +34 -24
- package/data/src/struct.ts +6 -8
- package/dist/index.cjs +257 -0
- package/dist/index.cjs.map +1 -0
- package/dist/{index.d.mts → index.d.cts} +10 -11
- package/dist/index.d.ts +10 -11
- package/dist/index.js +63 -104
- package/dist/index.js.map +1 -1
- package/dist/metafile-cjs.json +1 -0
- package/dist/metafile-esm.json +1 -0
- package/internal/dist/{index.mjs → index.cjs} +716 -495
- package/internal/dist/index.cjs.map +1 -0
- package/internal/dist/{index.d.mts → index.d.cts} +124 -105
- package/internal/dist/index.d.ts +124 -105
- package/internal/dist/index.js +651 -555
- package/internal/dist/index.js.map +1 -1
- package/internal/dist/metafile-cjs.json +1 -0
- package/internal/dist/metafile-esm.json +1 -0
- package/internal/package.json +4 -3
- package/internal/src/atom/create-atom.ts +29 -16
- package/internal/src/atom/delete-atom.ts +25 -6
- package/internal/src/atom/is-default.ts +4 -17
- package/internal/src/caching.ts +28 -23
- package/internal/src/families/create-atom-family.ts +3 -2
- package/internal/src/families/create-readonly-selector-family.ts +1 -1
- package/internal/src/families/create-selector-family.ts +4 -4
- package/internal/src/index.ts +4 -2
- package/internal/src/lazy-map.ts +33 -0
- package/internal/src/mutable/create-mutable-atom-family.ts +2 -2
- package/internal/src/mutable/create-mutable-atom.ts +1 -2
- package/internal/src/mutable/get-json-family.ts +22 -0
- package/internal/src/mutable/get-json-token.ts +1 -0
- package/internal/src/mutable/index.ts +1 -0
- package/internal/src/mutable/tracker-family.ts +1 -2
- package/internal/src/mutable/tracker.ts +8 -6
- package/internal/src/mutable/transceiver.ts +2 -0
- package/internal/src/not-found-error.ts +27 -0
- package/internal/src/operation.ts +2 -3
- package/internal/src/{get-state-internal.ts → read-or-compute-value.ts} +13 -6
- package/internal/src/selector/create-selector.ts +6 -7
- package/internal/src/selector/delete-selector.ts +37 -0
- package/internal/src/selector/index.ts +2 -1
- package/internal/src/selector/register-selector.ts +7 -7
- package/internal/src/set-state/copy-mutable-in-transaction.ts +3 -2
- package/internal/src/set-state/emit-update.ts +1 -3
- package/internal/src/set-state/evict-downstream.ts +6 -8
- package/internal/src/set-state/index.ts +1 -1
- package/internal/src/set-state/{set-state-internal.ts → set-atom-or-selector.ts} +2 -3
- package/internal/src/set-state/set-atom.ts +5 -6
- package/internal/src/store/store.ts +1 -1
- package/internal/src/store/withdraw-new-family-member.ts +6 -6
- package/internal/src/subscribe/recall-state.ts +1 -2
- package/internal/src/subscribe/subscribe-to-root-atoms.ts +2 -2
- package/internal/src/timeline/add-atom-to-timeline.ts +5 -16
- package/internal/src/timeline/{timeline-internal.ts → create-timeline.ts} +4 -5
- package/internal/src/timeline/index.ts +2 -2
- package/internal/src/timeline/time-travel.ts +89 -0
- package/internal/src/transaction/build-transaction.ts +8 -7
- package/internal/src/transaction/{transaction-internal.ts → create-transaction.ts} +6 -5
- package/internal/src/transaction/index.ts +2 -3
- package/introspection/dist/{index.mjs → index.cjs} +54 -29
- package/introspection/dist/index.cjs.map +1 -0
- package/introspection/dist/{index.d.mts → index.d.cts} +2 -2
- package/introspection/dist/index.d.ts +2 -2
- package/introspection/dist/index.js +32 -49
- package/introspection/dist/index.js.map +1 -1
- package/introspection/dist/metafile-cjs.json +1 -0
- package/introspection/dist/metafile-esm.json +1 -0
- package/introspection/package.json +4 -3
- package/introspection/src/attach-introspection-states.ts +2 -2
- package/introspection/src/attach-selector-index.ts +8 -4
- package/json/dist/{index.mjs → index.cjs} +20 -7
- package/json/dist/{index.mjs.map → index.cjs.map} +1 -1
- package/json/dist/{index.d.mts → index.d.cts} +1 -1
- package/json/dist/index.d.ts +1 -1
- package/json/dist/index.js +6 -19
- package/json/dist/index.js.map +1 -1
- package/json/dist/metafile-cjs.json +1 -0
- package/json/dist/metafile-esm.json +1 -0
- package/json/package.json +4 -3
- package/package.json +48 -47
- package/react/dist/index.cjs +59 -0
- package/react/dist/index.cjs.map +1 -0
- package/react/dist/index.js +20 -42
- package/react/dist/index.js.map +1 -1
- package/react/dist/metafile-cjs.json +1 -0
- package/react/dist/metafile-esm.json +1 -0
- package/react/package.json +4 -3
- package/react/src/store-hooks.ts +8 -2
- package/react-devtools/dist/{index.mjs → index.cjs} +286 -240
- package/react-devtools/dist/index.cjs.map +1 -0
- package/react-devtools/dist/{index.d.mts → index.d.cts} +29 -17
- package/react-devtools/dist/index.d.ts +29 -17
- package/react-devtools/dist/index.js +251 -273
- package/react-devtools/dist/index.js.map +1 -1
- package/react-devtools/dist/metafile-cjs.json +1 -0
- package/react-devtools/dist/metafile-esm.json +1 -0
- package/react-devtools/package.json +4 -3
- package/react-devtools/src/StateEditor.tsx +8 -8
- package/realtime-client/dist/{index.mjs → index.cjs} +50 -21
- package/realtime-client/dist/index.js +20 -49
- package/realtime-client/dist/metafile-cjs.json +1 -0
- package/realtime-client/dist/metafile-esm.json +1 -0
- package/realtime-client/package.json +4 -3
- package/realtime-react/dist/index.cjs +99 -0
- package/realtime-react/dist/index.js +35 -66
- package/realtime-react/dist/metafile-cjs.json +1 -0
- package/realtime-react/dist/metafile-esm.json +1 -0
- package/realtime-react/package.json +4 -3
- package/realtime-server/dist/{index.mjs → index.cjs} +67 -40
- package/realtime-server/dist/index.js +39 -66
- package/realtime-server/dist/metafile-cjs.json +1 -0
- package/realtime-server/dist/metafile-esm.json +1 -0
- package/realtime-server/package.json +4 -3
- package/realtime-testing/dist/{index.mjs → index.cjs} +54 -23
- package/realtime-testing/dist/index.js +22 -53
- package/realtime-testing/dist/metafile-cjs.json +1 -0
- package/realtime-testing/dist/metafile-esm.json +1 -0
- package/realtime-testing/package.json +4 -3
- package/src/atom.ts +6 -8
- package/src/dispose.ts +18 -0
- package/src/get-state.ts +16 -0
- package/src/index.ts +3 -1
- package/src/logger.ts +1 -1
- package/src/selector.ts +3 -3
- package/src/set-state.ts +22 -0
- package/src/silo.ts +7 -8
- package/src/timeline.ts +6 -11
- package/src/transaction.ts +2 -2
- package/transceivers/set-rtx/dist/{index.mjs → index.cjs} +40 -36
- package/transceivers/set-rtx/dist/index.cjs.map +1 -0
- package/transceivers/set-rtx/dist/{index.d.mts → index.d.cts} +2 -1
- package/transceivers/set-rtx/dist/index.d.ts +2 -1
- package/transceivers/set-rtx/dist/index.js +37 -37
- package/transceivers/set-rtx/dist/index.js.map +1 -1
- package/transceivers/set-rtx/dist/metafile-cjs.json +1 -0
- package/transceivers/set-rtx/dist/metafile-esm.json +1 -0
- package/transceivers/set-rtx/package.json +4 -3
- package/transceivers/set-rtx/src/set-rtx.ts +29 -26
- package/data/dist/index.d.mts +0 -41
- package/data/dist/index.mjs +0 -82
- package/data/dist/index.mjs.map +0 -1
- package/dist/index.mjs +0 -215
- package/dist/index.mjs.map +0 -1
- package/internal/dist/index.mjs.map +0 -1
- package/internal/src/set-state/set-selector-state.ts +0 -8
- package/internal/src/timeline/time-travel-internal.ts +0 -109
- package/introspection/dist/index.mjs.map +0 -1
- package/react/dist/index.mjs +0 -29
- package/react/dist/index.mjs.map +0 -1
- package/react-devtools/dist/index.mjs.map +0 -1
- package/realtime-react/dist/index.mjs +0 -68
- package/src/get-set.ts +0 -48
- package/transceivers/set-rtx/dist/index.mjs.map +0 -1
- /package/react/dist/{index.d.mts → index.d.cts} +0 -0
- /package/realtime-client/dist/{index.mjs.map → index.cjs.map} +0 -0
- /package/realtime-client/dist/{index.d.mts → index.d.cts} +0 -0
- /package/realtime-react/dist/{index.mjs.map → index.cjs.map} +0 -0
- /package/realtime-react/dist/{index.d.mts → index.d.cts} +0 -0
- /package/realtime-server/dist/{index.mjs.map → index.cjs.map} +0 -0
- /package/realtime-server/dist/{index.d.mts → index.d.cts} +0 -0
- /package/realtime-testing/dist/{index.mjs.map → index.cjs.map} +0 -0
- /package/realtime-testing/dist/{index.d.mts → index.d.cts} +0 -0
|
@@ -1,32 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
var react$1 = require('@floating-ui/react');
|
|
10
|
-
|
|
11
|
-
function _interopNamespace(e) {
|
|
12
|
-
if (e && e.__esModule) return e;
|
|
13
|
-
var n = Object.create(null);
|
|
14
|
-
if (e) {
|
|
15
|
-
Object.keys(e).forEach(function (k) {
|
|
16
|
-
if (k !== 'default') {
|
|
17
|
-
var d = Object.getOwnPropertyDescriptor(e, k);
|
|
18
|
-
Object.defineProperty(n, k, d.get ? d : {
|
|
19
|
-
enumerable: true,
|
|
20
|
-
get: function () { return e[k]; }
|
|
21
|
-
});
|
|
22
|
-
}
|
|
23
|
-
});
|
|
24
|
-
}
|
|
25
|
-
n.default = e;
|
|
26
|
-
return Object.freeze(n);
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
var React__namespace = /*#__PURE__*/_interopNamespace(React);
|
|
1
|
+
import { selectorFamily, atom, atomFamily, undo, redo, getState } from 'atom.io';
|
|
2
|
+
import { attachIntrospectionStates } from 'atom.io/introspection';
|
|
3
|
+
import { useI, useO } from 'atom.io/react';
|
|
4
|
+
import { motion, spring, LayoutGroup } from 'framer-motion';
|
|
5
|
+
import * as React from 'react';
|
|
6
|
+
import { forwardRef, useRef, useState, useImperativeHandle, useLayoutEffect, Fragment as Fragment$1, Component, useId } from 'react';
|
|
7
|
+
import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
|
|
8
|
+
import { useFloating, useClick, useInteractions, FloatingPortal } from '@floating-ui/react';
|
|
30
9
|
|
|
31
10
|
var __defProp = Object.defineProperty;
|
|
32
11
|
var __defProps = Object.defineProperties;
|
|
@@ -469,7 +448,7 @@ var isJson = (input) => {
|
|
|
469
448
|
return isJson2;
|
|
470
449
|
};
|
|
471
450
|
var OpenClose = ({ isOpen, setIsOpen, disabled }) => {
|
|
472
|
-
return /* @__PURE__ */
|
|
451
|
+
return /* @__PURE__ */ jsx(
|
|
473
452
|
"button",
|
|
474
453
|
{
|
|
475
454
|
type: "button",
|
|
@@ -836,19 +815,22 @@ var Join = class _Join {
|
|
|
836
815
|
);
|
|
837
816
|
}
|
|
838
817
|
};
|
|
839
|
-
var ElasticInput =
|
|
818
|
+
var ElasticInput = forwardRef(function ElasticInputFC(props, ref) {
|
|
840
819
|
var _a2, _b, _c, _d;
|
|
841
|
-
const inputRef =
|
|
842
|
-
const spanRef =
|
|
843
|
-
const [inputWidth, setInputWidth] =
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
(
|
|
848
|
-
|
|
849
|
-
|
|
820
|
+
const inputRef = useRef(null);
|
|
821
|
+
const spanRef = useRef(null);
|
|
822
|
+
const [inputWidth, setInputWidth] = useState(`auto`);
|
|
823
|
+
useImperativeHandle(
|
|
824
|
+
ref,
|
|
825
|
+
() => ({
|
|
826
|
+
focus: () => {
|
|
827
|
+
var _a3;
|
|
828
|
+
(_a3 = inputRef.current) == null ? void 0 : _a3.focus();
|
|
829
|
+
}
|
|
830
|
+
})
|
|
831
|
+
);
|
|
850
832
|
const extraWidth = props.type === `number` ? 15 : 0;
|
|
851
|
-
|
|
833
|
+
useLayoutEffect(() => {
|
|
852
834
|
if (spanRef.current) {
|
|
853
835
|
setInputWidth(`${spanRef.current.offsetWidth + extraWidth}px`);
|
|
854
836
|
const interval = setInterval(() => {
|
|
@@ -859,8 +841,8 @@ var ElasticInput = React.forwardRef(function ElasticInputFC(props, ref) {
|
|
|
859
841
|
return () => clearInterval(interval);
|
|
860
842
|
}
|
|
861
843
|
}, [(_a2 = inputRef.current) == null ? void 0 : _a2.value, props.value]);
|
|
862
|
-
return /* @__PURE__ */
|
|
863
|
-
/* @__PURE__ */
|
|
844
|
+
return /* @__PURE__ */ jsxs("div", { style: { display: `inline-block`, position: `relative` }, children: [
|
|
845
|
+
/* @__PURE__ */ jsx(
|
|
864
846
|
"input",
|
|
865
847
|
__spreadProps(__spreadValues({}, props), {
|
|
866
848
|
ref: inputRef,
|
|
@@ -874,7 +856,7 @@ var ElasticInput = React.forwardRef(function ElasticInputFC(props, ref) {
|
|
|
874
856
|
}, props.style)
|
|
875
857
|
})
|
|
876
858
|
),
|
|
877
|
-
/* @__PURE__ */
|
|
859
|
+
/* @__PURE__ */ jsx(
|
|
878
860
|
"span",
|
|
879
861
|
{
|
|
880
862
|
ref: spanRef,
|
|
@@ -958,9 +940,9 @@ var NumberInput = ({
|
|
|
958
940
|
testId,
|
|
959
941
|
value = null
|
|
960
942
|
}) => {
|
|
961
|
-
const id =
|
|
962
|
-
const [temporaryEntry, setTemporaryEntry] =
|
|
963
|
-
const userHasMadeDeliberateChange =
|
|
943
|
+
const id = useId();
|
|
944
|
+
const [temporaryEntry, setTemporaryEntry] = useState(null);
|
|
945
|
+
const userHasMadeDeliberateChange = useRef(false);
|
|
964
946
|
const refine = initRefinery({ max, min, decimalPlaces, nullable: true });
|
|
965
947
|
const allowDecimal = decimalPlaces === void 0 || decimalPlaces > 0;
|
|
966
948
|
const handleBlur = () => {
|
|
@@ -993,9 +975,9 @@ var NumberInput = ({
|
|
|
993
975
|
}
|
|
994
976
|
};
|
|
995
977
|
const displayValue = temporaryEntry != null ? temporaryEntry : valueToText(value ? refine(value) : value);
|
|
996
|
-
return /* @__PURE__ */
|
|
997
|
-
label && /* @__PURE__ */
|
|
998
|
-
autoSize ? /* @__PURE__ */
|
|
978
|
+
return /* @__PURE__ */ jsxs("span", { css: customCss, children: [
|
|
979
|
+
label && /* @__PURE__ */ jsx("label", { htmlFor: id, children: label }),
|
|
980
|
+
autoSize ? /* @__PURE__ */ jsx(
|
|
999
981
|
ElasticInput,
|
|
1000
982
|
{
|
|
1001
983
|
type: "text",
|
|
@@ -1009,7 +991,7 @@ var NumberInput = ({
|
|
|
1009
991
|
onClick,
|
|
1010
992
|
"data-testid": `number-input-${testId != null ? testId : id}`
|
|
1011
993
|
}
|
|
1012
|
-
) : /* @__PURE__ */
|
|
994
|
+
) : /* @__PURE__ */ jsx(
|
|
1013
995
|
"input",
|
|
1014
996
|
{
|
|
1015
997
|
type: "text",
|
|
@@ -1034,9 +1016,9 @@ var TextInput = ({
|
|
|
1034
1016
|
customCss,
|
|
1035
1017
|
autoSize = false
|
|
1036
1018
|
}) => {
|
|
1037
|
-
return /* @__PURE__ */
|
|
1038
|
-
/* @__PURE__ */
|
|
1039
|
-
autoSize ? /* @__PURE__ */
|
|
1019
|
+
return /* @__PURE__ */ jsxs("span", { css: customCss, children: [
|
|
1020
|
+
/* @__PURE__ */ jsx("label", { children: label }),
|
|
1021
|
+
autoSize ? /* @__PURE__ */ jsx(
|
|
1040
1022
|
ElasticInput,
|
|
1041
1023
|
{
|
|
1042
1024
|
type: "text",
|
|
@@ -1045,7 +1027,7 @@ var TextInput = ({
|
|
|
1045
1027
|
disabled: set === void 0,
|
|
1046
1028
|
placeholder
|
|
1047
1029
|
}
|
|
1048
|
-
) : /* @__PURE__ */
|
|
1030
|
+
) : /* @__PURE__ */ jsx(
|
|
1049
1031
|
"input",
|
|
1050
1032
|
{
|
|
1051
1033
|
type: "text",
|
|
@@ -1058,7 +1040,7 @@ var TextInput = ({
|
|
|
1058
1040
|
] });
|
|
1059
1041
|
};
|
|
1060
1042
|
var NonJsonEditor = ({ data }) => {
|
|
1061
|
-
return data === void 0 ? /* @__PURE__ */
|
|
1043
|
+
return data === void 0 ? /* @__PURE__ */ jsx(ElasticInput, { disabled: true, value: "undefined" }) : /* @__PURE__ */ jsx(
|
|
1062
1044
|
ElasticInput,
|
|
1063
1045
|
{
|
|
1064
1046
|
disabled: true,
|
|
@@ -1086,17 +1068,17 @@ var JsonEditor_INTERNAL = ({
|
|
|
1086
1068
|
const refined = dataIsJson ? refineJsonType(data) : { type: `non-json`, data };
|
|
1087
1069
|
const SubEditor = dataIsJson ? SubEditors[refined.type] : NonJsonEditor;
|
|
1088
1070
|
const disabled = isReadonly(path);
|
|
1089
|
-
return isHidden(path) ? null : /* @__PURE__ */
|
|
1090
|
-
remove && /* @__PURE__ */
|
|
1071
|
+
return isHidden(path) ? null : /* @__PURE__ */ jsx(Components.ErrorBoundary, { children: /* @__PURE__ */ jsxs(Components.EditorWrapper, { className, customCss, children: [
|
|
1072
|
+
remove && /* @__PURE__ */ jsx(
|
|
1091
1073
|
Components.Button,
|
|
1092
1074
|
{
|
|
1093
1075
|
onClick: disabled ? doNothing : remove,
|
|
1094
1076
|
disabled,
|
|
1095
|
-
children: /* @__PURE__ */
|
|
1077
|
+
children: /* @__PURE__ */ jsx(Components.DeleteIcon, {})
|
|
1096
1078
|
}
|
|
1097
1079
|
),
|
|
1098
|
-
HeaderDisplay && /* @__PURE__ */
|
|
1099
|
-
rename && /* @__PURE__ */
|
|
1080
|
+
HeaderDisplay && /* @__PURE__ */ jsx(HeaderDisplay, { data, schema }),
|
|
1081
|
+
rename && /* @__PURE__ */ jsx(Components.KeyWrapper, { children: /* @__PURE__ */ jsx(
|
|
1100
1082
|
ElasticInput,
|
|
1101
1083
|
{
|
|
1102
1084
|
value: name,
|
|
@@ -1104,7 +1086,7 @@ var JsonEditor_INTERNAL = ({
|
|
|
1104
1086
|
disabled
|
|
1105
1087
|
}
|
|
1106
1088
|
) }),
|
|
1107
|
-
/* @__PURE__ */
|
|
1089
|
+
/* @__PURE__ */ jsx(
|
|
1108
1090
|
SubEditor,
|
|
1109
1091
|
{
|
|
1110
1092
|
data: refined.data,
|
|
@@ -1118,13 +1100,13 @@ var JsonEditor_INTERNAL = ({
|
|
|
1118
1100
|
Components
|
|
1119
1101
|
}
|
|
1120
1102
|
),
|
|
1121
|
-
recast && dataIsJson ? /* @__PURE__ */
|
|
1103
|
+
recast && dataIsJson ? /* @__PURE__ */ jsx(
|
|
1122
1104
|
"select",
|
|
1123
1105
|
{
|
|
1124
1106
|
onChange: disabled ? doNothing : (e) => recast(e.target.value),
|
|
1125
1107
|
value: refined.type,
|
|
1126
1108
|
disabled,
|
|
1127
|
-
children: Object.keys(SubEditors).map((type) => /* @__PURE__ */
|
|
1109
|
+
children: Object.keys(SubEditors).map((type) => /* @__PURE__ */ jsx("option", { value: type, children: type }, type))
|
|
1128
1110
|
}
|
|
1129
1111
|
) : null
|
|
1130
1112
|
] }) });
|
|
@@ -1147,9 +1129,9 @@ var ArrayEditor = ({
|
|
|
1147
1129
|
Components
|
|
1148
1130
|
}) => {
|
|
1149
1131
|
const setElement = makeElementSetters(data, set);
|
|
1150
|
-
return /* @__PURE__ */
|
|
1132
|
+
return /* @__PURE__ */ jsx(Fragment, { children: data.map((element, index) => {
|
|
1151
1133
|
const newPath = [...path, index];
|
|
1152
|
-
return /* @__PURE__ */
|
|
1134
|
+
return /* @__PURE__ */ jsx(
|
|
1153
1135
|
JsonEditor_INTERNAL,
|
|
1154
1136
|
{
|
|
1155
1137
|
path: newPath,
|
|
@@ -1509,10 +1491,13 @@ var numberToArray = (num) => Array(num).fill(null);
|
|
|
1509
1491
|
var arrayToString = (arr) => arr.join(`,`);
|
|
1510
1492
|
var arrayToNumber = (arr) => arr.length;
|
|
1511
1493
|
var arrayToBoolean = (arr) => typeof arr[0] === `boolean` ? arr[0] : arr.length > 0;
|
|
1512
|
-
var arrayToObject = (arr) => arr.reduce(
|
|
1513
|
-
acc
|
|
1514
|
-
|
|
1515
|
-
|
|
1494
|
+
var arrayToObject = (arr) => arr.reduce(
|
|
1495
|
+
(acc, cur, idx) => {
|
|
1496
|
+
acc[`${idx}`] = cur;
|
|
1497
|
+
return acc;
|
|
1498
|
+
},
|
|
1499
|
+
{}
|
|
1500
|
+
);
|
|
1516
1501
|
var nullToString = () => ``;
|
|
1517
1502
|
var nullToNumber = () => 0;
|
|
1518
1503
|
var nullToBoolean = () => false;
|
|
@@ -1654,11 +1639,11 @@ var PropertyAdder = ({
|
|
|
1654
1639
|
disabled,
|
|
1655
1640
|
propertyKey,
|
|
1656
1641
|
Components
|
|
1657
|
-
}) => /* @__PURE__ */
|
|
1658
|
-
/* @__PURE__ */
|
|
1642
|
+
}) => /* @__PURE__ */ jsxs(Components.MissingPropertyWrapper, { children: [
|
|
1643
|
+
/* @__PURE__ */ jsx(ElasticInput, { disabled: true, defaultValue: propertyKey }),
|
|
1659
1644
|
` `,
|
|
1660
|
-
/* @__PURE__ */
|
|
1661
|
-
/* @__PURE__ */
|
|
1645
|
+
/* @__PURE__ */ jsx(ElasticInput, { disabled: true, defaultValue: "is missing" }),
|
|
1646
|
+
/* @__PURE__ */ jsx(Components.Button, { onClick: () => addProperty(), disabled, children: "+" })
|
|
1662
1647
|
] });
|
|
1663
1648
|
var ObjectEditor = ({
|
|
1664
1649
|
schema,
|
|
@@ -1671,11 +1656,14 @@ var ObjectEditor = ({
|
|
|
1671
1656
|
}) => {
|
|
1672
1657
|
var _a2;
|
|
1673
1658
|
const disabled = isReadonly(path);
|
|
1674
|
-
const stableKeyMap =
|
|
1675
|
-
Object.keys(data).reduce(
|
|
1676
|
-
acc
|
|
1677
|
-
|
|
1678
|
-
|
|
1659
|
+
const stableKeyMap = useRef(
|
|
1660
|
+
Object.keys(data).reduce(
|
|
1661
|
+
(acc, key) => {
|
|
1662
|
+
acc[key] = key;
|
|
1663
|
+
return acc;
|
|
1664
|
+
},
|
|
1665
|
+
{}
|
|
1666
|
+
)
|
|
1679
1667
|
);
|
|
1680
1668
|
const setProperty = makePropertySetters(data, set);
|
|
1681
1669
|
const renameProperty = makePropertyRenamers(data, set, stableKeyMap);
|
|
@@ -1694,16 +1682,16 @@ var ObjectEditor = ({
|
|
|
1694
1682
|
[[], []]
|
|
1695
1683
|
);
|
|
1696
1684
|
const missingKeys = schemaKeys === true ? [] : schemaKeys.filter((key) => !dataKeys.includes(key));
|
|
1697
|
-
return /* @__PURE__ */
|
|
1698
|
-
/* @__PURE__ */
|
|
1699
|
-
/* @__PURE__ */
|
|
1700
|
-
/* @__PURE__ */
|
|
1685
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
1686
|
+
/* @__PURE__ */ jsx(Components.Button, { onClick: () => sortProperties(), disabled, children: "Sort" }),
|
|
1687
|
+
/* @__PURE__ */ jsxs(Components.ObjectWrapper, { children: [
|
|
1688
|
+
/* @__PURE__ */ jsx("div", { className: "json_editor_properties", children: [...missingKeys, ...officialKeys, ...unofficialKeys].map((key) => {
|
|
1701
1689
|
const originalKey = stableKeyMap.current[key];
|
|
1702
1690
|
const newPath = [...path, key];
|
|
1703
1691
|
const originalPath = [...path, originalKey];
|
|
1704
1692
|
const isOfficial = schemaKeys === true || schemaKeys.includes(key);
|
|
1705
1693
|
const isMissing = missingKeys.includes(key);
|
|
1706
|
-
return isMissing ? /* @__PURE__ */
|
|
1694
|
+
return isMissing ? /* @__PURE__ */ jsx(
|
|
1707
1695
|
PropertyAdder,
|
|
1708
1696
|
{
|
|
1709
1697
|
propertyKey: key,
|
|
@@ -1712,7 +1700,7 @@ var ObjectEditor = ({
|
|
|
1712
1700
|
Components
|
|
1713
1701
|
},
|
|
1714
1702
|
key + `IsMissing`
|
|
1715
|
-
) : /* @__PURE__ */
|
|
1703
|
+
) : /* @__PURE__ */ jsx(
|
|
1716
1704
|
JsonEditor_INTERNAL,
|
|
1717
1705
|
{
|
|
1718
1706
|
schema,
|
|
@@ -1731,7 +1719,7 @@ var ObjectEditor = ({
|
|
|
1731
1719
|
originalPath.join(`.`)
|
|
1732
1720
|
);
|
|
1733
1721
|
}) }),
|
|
1734
|
-
/* @__PURE__ */
|
|
1722
|
+
/* @__PURE__ */ jsx(
|
|
1735
1723
|
Components.Button,
|
|
1736
1724
|
{
|
|
1737
1725
|
onClick: disabled ? doNothing : () => makePropertyAdder(`new_property`, `string`)(),
|
|
@@ -1746,7 +1734,7 @@ var BooleanEditor = ({
|
|
|
1746
1734
|
data,
|
|
1747
1735
|
set,
|
|
1748
1736
|
Components
|
|
1749
|
-
}) => /* @__PURE__ */
|
|
1737
|
+
}) => /* @__PURE__ */ jsx(Components.BooleanWrapper, { children: /* @__PURE__ */ jsx(
|
|
1750
1738
|
"input",
|
|
1751
1739
|
{
|
|
1752
1740
|
type: "checkbox",
|
|
@@ -1756,14 +1744,14 @@ var BooleanEditor = ({
|
|
|
1756
1744
|
) });
|
|
1757
1745
|
var NullEditor = ({
|
|
1758
1746
|
Components
|
|
1759
|
-
}) => /* @__PURE__ */
|
|
1747
|
+
}) => /* @__PURE__ */ jsx(Components.NullWrapper, { children: '" "' });
|
|
1760
1748
|
var NumberEditor = ({
|
|
1761
1749
|
path = [],
|
|
1762
1750
|
isReadonly = () => false,
|
|
1763
1751
|
data,
|
|
1764
1752
|
set,
|
|
1765
1753
|
Components
|
|
1766
|
-
}) => /* @__PURE__ */
|
|
1754
|
+
}) => /* @__PURE__ */ jsx(Components.NumberWrapper, { children: /* @__PURE__ */ jsx(
|
|
1767
1755
|
NumberInput,
|
|
1768
1756
|
{
|
|
1769
1757
|
value: data,
|
|
@@ -1778,7 +1766,7 @@ var StringEditor = ({
|
|
|
1778
1766
|
set,
|
|
1779
1767
|
Components
|
|
1780
1768
|
}) => {
|
|
1781
|
-
return /* @__PURE__ */
|
|
1769
|
+
return /* @__PURE__ */ jsx(Components.StringWrapper, { children: /* @__PURE__ */ jsx(
|
|
1782
1770
|
TextInput,
|
|
1783
1771
|
{
|
|
1784
1772
|
value: data,
|
|
@@ -1791,7 +1779,7 @@ var DefaultFallback = ({ error, errorInfo }) => {
|
|
|
1791
1779
|
var _a2, _b, _c;
|
|
1792
1780
|
const component = (_a2 = errorInfo == null ? void 0 : errorInfo.componentStack) == null ? void 0 : _a2.split(` `).filter(Boolean)[2];
|
|
1793
1781
|
const message = (_c = (_b = error == null ? void 0 : error.toString()) != null ? _b : errorInfo == null ? void 0 : errorInfo.componentStack) != null ? _c : `Unknown error`;
|
|
1794
|
-
return /* @__PURE__ */
|
|
1782
|
+
return /* @__PURE__ */ jsx(
|
|
1795
1783
|
"div",
|
|
1796
1784
|
{
|
|
1797
1785
|
"data-testid": "error-boundary",
|
|
@@ -1803,7 +1791,7 @@ var DefaultFallback = ({ error, errorInfo }) => {
|
|
|
1803
1791
|
// backgroundRepeat: `no-repeat`,
|
|
1804
1792
|
backgroundSize: `overlay`
|
|
1805
1793
|
},
|
|
1806
|
-
children: /* @__PURE__ */
|
|
1794
|
+
children: /* @__PURE__ */ jsx(
|
|
1807
1795
|
"div",
|
|
1808
1796
|
{
|
|
1809
1797
|
style: {
|
|
@@ -1812,7 +1800,7 @@ var DefaultFallback = ({ error, errorInfo }) => {
|
|
|
1812
1800
|
padding: `50px`,
|
|
1813
1801
|
border: `1px solid dashed`
|
|
1814
1802
|
},
|
|
1815
|
-
children: /* @__PURE__ */
|
|
1803
|
+
children: /* @__PURE__ */ jsxs(
|
|
1816
1804
|
"span",
|
|
1817
1805
|
{
|
|
1818
1806
|
style: {
|
|
@@ -1823,7 +1811,7 @@ var DefaultFallback = ({ error, errorInfo }) => {
|
|
|
1823
1811
|
},
|
|
1824
1812
|
children: [
|
|
1825
1813
|
`\u26A0\uFE0F `,
|
|
1826
|
-
/* @__PURE__ */
|
|
1814
|
+
/* @__PURE__ */ jsx("span", { style: { color: `#fc0`, fontWeight: 700 }, children: component }),
|
|
1827
1815
|
` \u26A0\uFE0F `,
|
|
1828
1816
|
message
|
|
1829
1817
|
]
|
|
@@ -1834,7 +1822,7 @@ var DefaultFallback = ({ error, errorInfo }) => {
|
|
|
1834
1822
|
}
|
|
1835
1823
|
);
|
|
1836
1824
|
};
|
|
1837
|
-
var ErrorBoundary = class extends
|
|
1825
|
+
var ErrorBoundary = class extends Component {
|
|
1838
1826
|
constructor(props) {
|
|
1839
1827
|
super(props);
|
|
1840
1828
|
this.state = {};
|
|
@@ -1850,12 +1838,12 @@ var ErrorBoundary = class extends React.Component {
|
|
|
1850
1838
|
render() {
|
|
1851
1839
|
const { error, errorInfo } = this.state;
|
|
1852
1840
|
const { children, Fallback = DefaultFallback } = this.props;
|
|
1853
|
-
return errorInfo ? /* @__PURE__ */
|
|
1841
|
+
return errorInfo ? /* @__PURE__ */ jsx(Fallback, { error, errorInfo }) : children;
|
|
1854
1842
|
}
|
|
1855
1843
|
};
|
|
1856
1844
|
var DEFAULT_JSON_EDITOR_COMPONENTS = {
|
|
1857
|
-
ErrorBoundary: ({ children }) => /* @__PURE__ */
|
|
1858
|
-
Button: ({ onClick, children, disabled }) => /* @__PURE__ */
|
|
1845
|
+
ErrorBoundary: ({ children }) => /* @__PURE__ */ jsx(ErrorBoundary, { children }),
|
|
1846
|
+
Button: ({ onClick, children, disabled }) => /* @__PURE__ */ jsx(
|
|
1859
1847
|
"button",
|
|
1860
1848
|
{
|
|
1861
1849
|
type: "button",
|
|
@@ -1865,7 +1853,7 @@ var DEFAULT_JSON_EDITOR_COMPONENTS = {
|
|
|
1865
1853
|
children
|
|
1866
1854
|
}
|
|
1867
1855
|
),
|
|
1868
|
-
EditorWrapper: ({ children, customCss, className }) => /* @__PURE__ */
|
|
1856
|
+
EditorWrapper: ({ children, customCss, className }) => /* @__PURE__ */ jsx("div", { className: `json_editor ` + className, css: customCss, children }),
|
|
1869
1857
|
EditorLayout: ({
|
|
1870
1858
|
DeleteButton,
|
|
1871
1859
|
Header,
|
|
@@ -1874,27 +1862,27 @@ var DEFAULT_JSON_EDITOR_COMPONENTS = {
|
|
|
1874
1862
|
ValueEditor,
|
|
1875
1863
|
Wrapper
|
|
1876
1864
|
}) => {
|
|
1877
|
-
return /* @__PURE__ */
|
|
1878
|
-
DeleteButton && /* @__PURE__ */
|
|
1879
|
-
Header && /* @__PURE__ */
|
|
1880
|
-
KeyInput && /* @__PURE__ */
|
|
1881
|
-
TypeSelect && /* @__PURE__ */
|
|
1882
|
-
/* @__PURE__ */
|
|
1865
|
+
return /* @__PURE__ */ jsxs(Wrapper, { children: [
|
|
1866
|
+
DeleteButton && /* @__PURE__ */ jsx(DeleteButton, {}),
|
|
1867
|
+
Header && /* @__PURE__ */ jsx(Header, {}),
|
|
1868
|
+
KeyInput && /* @__PURE__ */ jsx(KeyInput, {}),
|
|
1869
|
+
TypeSelect && /* @__PURE__ */ jsx(TypeSelect, {}),
|
|
1870
|
+
/* @__PURE__ */ jsx(ValueEditor, {})
|
|
1883
1871
|
] });
|
|
1884
1872
|
},
|
|
1885
|
-
ArrayWrapper: ({ children }) => /* @__PURE__ */
|
|
1886
|
-
ObjectWrapper: ({ children }) => /* @__PURE__ */
|
|
1887
|
-
StringWrapper: ({ children }) => /* @__PURE__ */
|
|
1888
|
-
NumberWrapper: ({ children }) => /* @__PURE__ */
|
|
1889
|
-
BooleanWrapper: ({ children }) => /* @__PURE__ */
|
|
1890
|
-
NullWrapper: ({ children }) => /* @__PURE__ */
|
|
1891
|
-
MissingPropertyWrapper: ({ children }) => /* @__PURE__ */
|
|
1892
|
-
MiscastPropertyWrapper: ({ children }) => /* @__PURE__ */
|
|
1893
|
-
IllegalPropertyWrapper: ({ children }) => /* @__PURE__ */
|
|
1894
|
-
OfficialPropertyWrapper: ({ children }) => /* @__PURE__ */
|
|
1895
|
-
UnofficialPropertyWrapper: ({ children }) => /* @__PURE__ */
|
|
1896
|
-
DeleteIcon: () => /* @__PURE__ */
|
|
1897
|
-
KeyWrapper: ({ children }) => /* @__PURE__ */
|
|
1873
|
+
ArrayWrapper: ({ children }) => /* @__PURE__ */ jsx("div", { className: "json_editor_array", children }),
|
|
1874
|
+
ObjectWrapper: ({ children }) => /* @__PURE__ */ jsx("div", { className: "json_editor_object", children }),
|
|
1875
|
+
StringWrapper: ({ children }) => /* @__PURE__ */ jsx("span", { className: "json_editor_string", children }),
|
|
1876
|
+
NumberWrapper: ({ children }) => /* @__PURE__ */ jsx("span", { className: "json_editor_number", children }),
|
|
1877
|
+
BooleanWrapper: ({ children }) => /* @__PURE__ */ jsx("span", { className: "json_editor_boolean", children }),
|
|
1878
|
+
NullWrapper: ({ children }) => /* @__PURE__ */ jsx("span", { className: "json_editor_null", children }),
|
|
1879
|
+
MissingPropertyWrapper: ({ children }) => /* @__PURE__ */ jsx("div", { className: "json_editor_property json_editor_missing", children }),
|
|
1880
|
+
MiscastPropertyWrapper: ({ children }) => /* @__PURE__ */ jsx("div", { className: "json_editor_property json_editor_miscast", children }),
|
|
1881
|
+
IllegalPropertyWrapper: ({ children }) => /* @__PURE__ */ jsx("span", { className: "json_editor_property json_editor_illegal", children }),
|
|
1882
|
+
OfficialPropertyWrapper: ({ children }) => /* @__PURE__ */ jsx("span", { className: "json_editor_property json_editor_official", children }),
|
|
1883
|
+
UnofficialPropertyWrapper: ({ children }) => /* @__PURE__ */ jsx("span", { className: "json_editor_property json_editor_unofficial", children }),
|
|
1884
|
+
DeleteIcon: () => /* @__PURE__ */ jsx("span", { className: "json_editor_icon json_editor_delete", children: "x" }),
|
|
1885
|
+
KeyWrapper: ({ children }) => /* @__PURE__ */ jsx("span", { className: "json_editor_key", children })
|
|
1898
1886
|
};
|
|
1899
1887
|
var JsonEditor = ({
|
|
1900
1888
|
data,
|
|
@@ -1912,7 +1900,7 @@ var JsonEditor = ({
|
|
|
1912
1900
|
Components: CustomComponents = {}
|
|
1913
1901
|
}) => {
|
|
1914
1902
|
const Components = __spreadValues(__spreadValues({}, DEFAULT_JSON_EDITOR_COMPONENTS), CustomComponents);
|
|
1915
|
-
return /* @__PURE__ */
|
|
1903
|
+
return /* @__PURE__ */ jsx(
|
|
1916
1904
|
JsonEditor_INTERNAL,
|
|
1917
1905
|
{
|
|
1918
1906
|
data,
|
|
@@ -2261,24 +2249,27 @@ var WAYFORGE_CORE_COLOR_NAMES = [
|
|
|
2261
2249
|
`Magenta`,
|
|
2262
2250
|
`Pink`
|
|
2263
2251
|
];
|
|
2264
|
-
WAYFORGE_CORE_COLOR_NAMES.reduce(
|
|
2265
|
-
acc
|
|
2266
|
-
|
|
2267
|
-
|
|
2268
|
-
|
|
2269
|
-
|
|
2270
|
-
|
|
2271
|
-
|
|
2272
|
-
|
|
2252
|
+
WAYFORGE_CORE_COLOR_NAMES.reduce(
|
|
2253
|
+
(acc, name, idx) => {
|
|
2254
|
+
acc[name] = {
|
|
2255
|
+
hue: idx * 30,
|
|
2256
|
+
sat: 255,
|
|
2257
|
+
lum: 0.5,
|
|
2258
|
+
prefer: `sat`
|
|
2259
|
+
};
|
|
2260
|
+
return acc;
|
|
2261
|
+
},
|
|
2262
|
+
{}
|
|
2263
|
+
);
|
|
2273
2264
|
var Id = ({ id }) => {
|
|
2274
|
-
const [isOpen, setIsOpen] =
|
|
2275
|
-
const { refs, floatingStyles, context } =
|
|
2265
|
+
const [isOpen, setIsOpen] = React.useState(false);
|
|
2266
|
+
const { refs, floatingStyles, context } = useFloating({
|
|
2276
2267
|
open: isOpen,
|
|
2277
2268
|
onOpenChange: setIsOpen,
|
|
2278
2269
|
placement: `bottom-start`
|
|
2279
2270
|
});
|
|
2280
|
-
const click =
|
|
2281
|
-
const { getReferenceProps, getFloatingProps } =
|
|
2271
|
+
const click = useClick(context);
|
|
2272
|
+
const { getReferenceProps, getFloatingProps } = useInteractions([click]);
|
|
2282
2273
|
const bgColor = stringToColor(id);
|
|
2283
2274
|
const contrastColor = pipe(bgColor, hexToSpec_default, contrastMax, specToHex_default);
|
|
2284
2275
|
const offsetColor = pipe(bgColor, hexToSpec_default, offset(0.25), specToHex_default);
|
|
@@ -2288,8 +2279,8 @@ var Id = ({ id }) => {
|
|
|
2288
2279
|
contrastMax,
|
|
2289
2280
|
specToHex_default
|
|
2290
2281
|
);
|
|
2291
|
-
return /* @__PURE__ */
|
|
2292
|
-
/* @__PURE__ */
|
|
2282
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
2283
|
+
/* @__PURE__ */ jsx(
|
|
2293
2284
|
"span",
|
|
2294
2285
|
__spreadProps(__spreadValues({
|
|
2295
2286
|
role: "content",
|
|
@@ -2306,7 +2297,7 @@ var Id = ({ id }) => {
|
|
|
2306
2297
|
children: id.substring(0, 3)
|
|
2307
2298
|
})
|
|
2308
2299
|
),
|
|
2309
|
-
isOpen && /* @__PURE__ */
|
|
2300
|
+
isOpen && /* @__PURE__ */ jsx(FloatingPortal, { children: /* @__PURE__ */ jsx(
|
|
2310
2301
|
"span",
|
|
2311
2302
|
__spreadProps(__spreadValues({
|
|
2312
2303
|
role: "popup",
|
|
@@ -2337,16 +2328,16 @@ var RelationEditor = (props) => {
|
|
|
2337
2328
|
}
|
|
2338
2329
|
return true;
|
|
2339
2330
|
});
|
|
2340
|
-
return /* @__PURE__ */
|
|
2341
|
-
/* @__PURE__ */
|
|
2331
|
+
return /* @__PURE__ */ jsx("article", { className: RelationEditor_module_default.class, children: data.map(([head, tail]) => /* @__PURE__ */ jsxs("section", { children: [
|
|
2332
|
+
/* @__PURE__ */ jsx("span", { children: /* @__PURE__ */ jsx(Id, { id: head }) }),
|
|
2342
2333
|
":",
|
|
2343
|
-
/* @__PURE__ */
|
|
2334
|
+
/* @__PURE__ */ jsx("span", { children: tail.map((child) => /* @__PURE__ */ jsx(Id, { id: child })) })
|
|
2344
2335
|
] })) });
|
|
2345
2336
|
};
|
|
2346
2337
|
var StateEditor = ({ token }) => {
|
|
2347
|
-
const set =
|
|
2348
|
-
const data =
|
|
2349
|
-
return isJson(data) ? /* @__PURE__ */
|
|
2338
|
+
const set = useI(token);
|
|
2339
|
+
const data = useO(token);
|
|
2340
|
+
return isJson(data) ? /* @__PURE__ */ jsx(JsonEditor, { data, set, schema: true }) : data instanceof Join ? /* @__PURE__ */ jsx(RelationEditor, { data, set }) : /* @__PURE__ */ jsx("div", { className: "json_editor", children: /* @__PURE__ */ jsx(
|
|
2350
2341
|
ElasticInput,
|
|
2351
2342
|
{
|
|
2352
2343
|
value: data instanceof Set ? `Set { ${JSON.stringify([...data]).slice(1, -1)} }` : data instanceof Map ? `Map ` + JSON.stringify([...data]) : Object.getPrototypeOf(data).constructor.name + ` ` + fallback(() => JSON.stringify(data), `?`),
|
|
@@ -2355,8 +2346,8 @@ var StateEditor = ({ token }) => {
|
|
|
2355
2346
|
) });
|
|
2356
2347
|
};
|
|
2357
2348
|
var ReadonlySelectorViewer = ({ token }) => {
|
|
2358
|
-
const data =
|
|
2359
|
-
return isJson(data) ? /* @__PURE__ */
|
|
2349
|
+
const data = useO(token);
|
|
2350
|
+
return isJson(data) ? /* @__PURE__ */ jsx(
|
|
2360
2351
|
JsonEditor,
|
|
2361
2352
|
{
|
|
2362
2353
|
data,
|
|
@@ -2364,7 +2355,7 @@ var ReadonlySelectorViewer = ({ token }) => {
|
|
|
2364
2355
|
schema: true,
|
|
2365
2356
|
isReadonly: () => true
|
|
2366
2357
|
}
|
|
2367
|
-
) : /* @__PURE__ */
|
|
2358
|
+
) : /* @__PURE__ */ jsx("div", { className: "json_editor", children: /* @__PURE__ */ jsx(
|
|
2368
2359
|
ElasticInput,
|
|
2369
2360
|
{
|
|
2370
2361
|
value: data instanceof Set ? `Set ` + JSON.stringify([...data]) : data instanceof Map ? `Map ` + JSON.stringify([...data]) : Object.getPrototypeOf(data).constructor.name + ` ` + JSON.stringify(data),
|
|
@@ -2374,11 +2365,11 @@ var ReadonlySelectorViewer = ({ token }) => {
|
|
|
2374
2365
|
};
|
|
2375
2366
|
var StoreEditor = ({ token }) => {
|
|
2376
2367
|
if (token.type === `readonly_selector`) {
|
|
2377
|
-
return /* @__PURE__ */
|
|
2368
|
+
return /* @__PURE__ */ jsx(ReadonlySelectorViewer, { token });
|
|
2378
2369
|
}
|
|
2379
|
-
return /* @__PURE__ */
|
|
2370
|
+
return /* @__PURE__ */ jsx(StateEditor, { token });
|
|
2380
2371
|
};
|
|
2381
|
-
var findStateTypeState =
|
|
2372
|
+
var findStateTypeState = selectorFamily({
|
|
2382
2373
|
key: `\u{1F441}\u200D\u{1F5E8} State Type`,
|
|
2383
2374
|
get: (token) => ({ get }) => {
|
|
2384
2375
|
let state;
|
|
@@ -2396,14 +2387,14 @@ var findStateTypeState = atom_io.selectorFamily({
|
|
|
2396
2387
|
});
|
|
2397
2388
|
var StateIndexLeafNode = ({ node, isOpenState, typeState }) => {
|
|
2398
2389
|
var _a2, _b;
|
|
2399
|
-
const setIsOpen =
|
|
2400
|
-
const isOpen =
|
|
2401
|
-
const state =
|
|
2402
|
-
const stateType =
|
|
2390
|
+
const setIsOpen = useI(isOpenState);
|
|
2391
|
+
const isOpen = useO(isOpenState);
|
|
2392
|
+
const state = useO(node);
|
|
2393
|
+
const stateType = useO(typeState);
|
|
2403
2394
|
const isPrimitive = Boolean(primitiveRefinery.refine(state));
|
|
2404
|
-
return /* @__PURE__ */
|
|
2405
|
-
/* @__PURE__ */
|
|
2406
|
-
/* @__PURE__ */
|
|
2395
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
2396
|
+
/* @__PURE__ */ jsxs("header", { children: [
|
|
2397
|
+
/* @__PURE__ */ jsx(
|
|
2407
2398
|
button.OpenClose,
|
|
2408
2399
|
{
|
|
2409
2400
|
isOpen: isOpen && !isPrimitive,
|
|
@@ -2411,14 +2402,14 @@ var StateIndexLeafNode = ({ node, isOpenState, typeState }) => {
|
|
|
2411
2402
|
disabled: isPrimitive
|
|
2412
2403
|
}
|
|
2413
2404
|
),
|
|
2414
|
-
/* @__PURE__ */
|
|
2405
|
+
/* @__PURE__ */ jsxs(
|
|
2415
2406
|
"label",
|
|
2416
2407
|
{
|
|
2417
|
-
onClick: () => console.log(node,
|
|
2418
|
-
onKeyUp: () => console.log(node,
|
|
2408
|
+
onClick: () => console.log(node, getState(node)),
|
|
2409
|
+
onKeyUp: () => console.log(node, getState(node)),
|
|
2419
2410
|
children: [
|
|
2420
|
-
/* @__PURE__ */
|
|
2421
|
-
/* @__PURE__ */
|
|
2411
|
+
/* @__PURE__ */ jsx("h2", { children: (_b = (_a2 = node.family) == null ? void 0 : _a2.subKey) != null ? _b : node.key }),
|
|
2412
|
+
/* @__PURE__ */ jsxs("span", { className: "type detail", children: [
|
|
2422
2413
|
"(",
|
|
2423
2414
|
stateType,
|
|
2424
2415
|
")"
|
|
@@ -2426,27 +2417,27 @@ var StateIndexLeafNode = ({ node, isOpenState, typeState }) => {
|
|
|
2426
2417
|
]
|
|
2427
2418
|
}
|
|
2428
2419
|
),
|
|
2429
|
-
isPrimitive ? /* @__PURE__ */
|
|
2420
|
+
isPrimitive ? /* @__PURE__ */ jsx(StoreEditor, { token: node }) : null
|
|
2430
2421
|
] }),
|
|
2431
|
-
isOpen && !isPrimitive ? /* @__PURE__ */
|
|
2422
|
+
isOpen && !isPrimitive ? /* @__PURE__ */ jsx("main", { children: /* @__PURE__ */ jsx(StoreEditor, { token: node }) }) : null
|
|
2432
2423
|
] });
|
|
2433
2424
|
};
|
|
2434
2425
|
var StateIndexTreeNode = ({ node, isOpenState }) => {
|
|
2435
|
-
const setIsOpen =
|
|
2436
|
-
const isOpen =
|
|
2426
|
+
const setIsOpen = useI(isOpenState);
|
|
2427
|
+
const isOpen = useO(isOpenState);
|
|
2437
2428
|
for (const [key, childNode] of recordToEntries(node.familyMembers)) {
|
|
2438
2429
|
findViewIsOpenState(key);
|
|
2439
2430
|
findStateTypeState(childNode);
|
|
2440
2431
|
}
|
|
2441
|
-
return /* @__PURE__ */
|
|
2442
|
-
/* @__PURE__ */
|
|
2443
|
-
/* @__PURE__ */
|
|
2444
|
-
/* @__PURE__ */
|
|
2445
|
-
/* @__PURE__ */
|
|
2446
|
-
/* @__PURE__ */
|
|
2432
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
2433
|
+
/* @__PURE__ */ jsxs("header", { children: [
|
|
2434
|
+
/* @__PURE__ */ jsx(button.OpenClose, { isOpen, setIsOpen }),
|
|
2435
|
+
/* @__PURE__ */ jsxs("label", { children: [
|
|
2436
|
+
/* @__PURE__ */ jsx("h2", { children: node.key }),
|
|
2437
|
+
/* @__PURE__ */ jsx("span", { className: "type detail", children: " (family)" })
|
|
2447
2438
|
] })
|
|
2448
2439
|
] }),
|
|
2449
|
-
isOpen ? Object.entries(node.familyMembers).map(([key, childNode]) => /* @__PURE__ */
|
|
2440
|
+
isOpen ? Object.entries(node.familyMembers).map(([key, childNode]) => /* @__PURE__ */ jsx(
|
|
2450
2441
|
StateIndexNode,
|
|
2451
2442
|
{
|
|
2452
2443
|
node: childNode,
|
|
@@ -2461,19 +2452,19 @@ var StateIndexNode = ({ node, isOpenState, typeState }) => {
|
|
|
2461
2452
|
if (node.key.startsWith(`\u{1F441}\u200D\u{1F5E8}`)) {
|
|
2462
2453
|
return null;
|
|
2463
2454
|
}
|
|
2464
|
-
return /* @__PURE__ */
|
|
2455
|
+
return /* @__PURE__ */ jsx("section", { className: "node state", children: `type` in node ? /* @__PURE__ */ jsx(
|
|
2465
2456
|
StateIndexLeafNode,
|
|
2466
2457
|
{
|
|
2467
2458
|
node,
|
|
2468
2459
|
isOpenState,
|
|
2469
2460
|
typeState
|
|
2470
2461
|
}
|
|
2471
|
-
) : /* @__PURE__ */
|
|
2462
|
+
) : /* @__PURE__ */ jsx(StateIndexTreeNode, { node, isOpenState }) });
|
|
2472
2463
|
};
|
|
2473
2464
|
var StateIndex = ({ tokenIndex }) => {
|
|
2474
|
-
const tokenIds =
|
|
2475
|
-
return /* @__PURE__ */
|
|
2476
|
-
return /* @__PURE__ */
|
|
2465
|
+
const tokenIds = useO(tokenIndex);
|
|
2466
|
+
return /* @__PURE__ */ jsx("article", { className: "index state_index", children: Object.entries(tokenIds).filter(([key]) => !key.startsWith(`\u{1F441}\u200D\u{1F5E8}`)).sort().map(([key, node]) => {
|
|
2467
|
+
return /* @__PURE__ */ jsx(
|
|
2477
2468
|
StateIndexNode,
|
|
2478
2469
|
{
|
|
2479
2470
|
node,
|
|
@@ -2485,60 +2476,60 @@ var StateIndex = ({ tokenIndex }) => {
|
|
|
2485
2476
|
}) });
|
|
2486
2477
|
};
|
|
2487
2478
|
var AtomUpdateFC = ({ atomUpdate }) => {
|
|
2488
|
-
return /* @__PURE__ */
|
|
2479
|
+
return /* @__PURE__ */ jsxs(
|
|
2489
2480
|
"article",
|
|
2490
2481
|
{
|
|
2491
2482
|
className: "node atom_update",
|
|
2492
2483
|
onClick: () => console.log(atomUpdate),
|
|
2493
2484
|
onKeyUp: () => console.log(atomUpdate),
|
|
2494
2485
|
children: [
|
|
2495
|
-
/* @__PURE__ */
|
|
2486
|
+
/* @__PURE__ */ jsxs("span", { className: "detail", children: [
|
|
2496
2487
|
atomUpdate.key,
|
|
2497
2488
|
": "
|
|
2498
2489
|
] }),
|
|
2499
|
-
/* @__PURE__ */
|
|
2490
|
+
/* @__PURE__ */ jsx("span", { children: /* @__PURE__ */ jsx("span", { className: "summary", children: prettyJson.diff(atomUpdate.oldValue, atomUpdate.newValue).summary }) })
|
|
2500
2491
|
]
|
|
2501
2492
|
},
|
|
2502
2493
|
atomUpdate.key
|
|
2503
2494
|
);
|
|
2504
2495
|
};
|
|
2505
2496
|
var TransactionUpdateFC = ({ serialNumber, transactionUpdate }) => {
|
|
2506
|
-
return /* @__PURE__ */
|
|
2507
|
-
/* @__PURE__ */
|
|
2508
|
-
/* @__PURE__ */
|
|
2509
|
-
/* @__PURE__ */
|
|
2510
|
-
/* @__PURE__ */
|
|
2497
|
+
return /* @__PURE__ */ jsxs("article", { className: "node transaction_update", children: [
|
|
2498
|
+
/* @__PURE__ */ jsx("header", { children: /* @__PURE__ */ jsx("h4", { children: serialNumber }) }),
|
|
2499
|
+
/* @__PURE__ */ jsxs("main", { children: [
|
|
2500
|
+
/* @__PURE__ */ jsxs("section", { className: "transaction_params", children: [
|
|
2501
|
+
/* @__PURE__ */ jsx("span", { className: "detail", children: "params: " }),
|
|
2511
2502
|
transactionUpdate.params.map((param, index) => {
|
|
2512
|
-
return /* @__PURE__ */
|
|
2503
|
+
return /* @__PURE__ */ jsxs(
|
|
2513
2504
|
"article",
|
|
2514
2505
|
{
|
|
2515
2506
|
className: "node transaction_param",
|
|
2516
2507
|
onClick: () => console.log(transactionUpdate),
|
|
2517
2508
|
onKeyUp: () => console.log(transactionUpdate),
|
|
2518
2509
|
children: [
|
|
2519
|
-
/* @__PURE__ */
|
|
2510
|
+
/* @__PURE__ */ jsxs("span", { className: "detail", children: [
|
|
2520
2511
|
discoverType(param),
|
|
2521
2512
|
": "
|
|
2522
2513
|
] }),
|
|
2523
|
-
/* @__PURE__ */
|
|
2514
|
+
/* @__PURE__ */ jsx("span", { className: "summary", children: typeof param === `object` && param !== null && `type` in param && `target` in param ? /* @__PURE__ */ jsx(Fragment, { children: JSON.stringify(param.type) }) : /* @__PURE__ */ jsx(Fragment, { children: JSON.stringify(param) }) })
|
|
2524
2515
|
]
|
|
2525
2516
|
},
|
|
2526
2517
|
`param` + index
|
|
2527
2518
|
);
|
|
2528
2519
|
})
|
|
2529
2520
|
] }),
|
|
2530
|
-
/* @__PURE__ */
|
|
2531
|
-
/* @__PURE__ */
|
|
2532
|
-
/* @__PURE__ */
|
|
2533
|
-
transactionUpdate.output ? /* @__PURE__ */
|
|
2521
|
+
/* @__PURE__ */ jsxs("section", { className: "node transaction_output", children: [
|
|
2522
|
+
/* @__PURE__ */ jsx("span", { className: "detail", children: "output: " }),
|
|
2523
|
+
/* @__PURE__ */ jsx("span", { className: "detail", children: discoverType(transactionUpdate.output) }),
|
|
2524
|
+
transactionUpdate.output ? /* @__PURE__ */ jsxs("span", { className: "summary", children: [
|
|
2534
2525
|
": ",
|
|
2535
2526
|
JSON.stringify(transactionUpdate.output)
|
|
2536
2527
|
] }) : null
|
|
2537
2528
|
] }),
|
|
2538
|
-
/* @__PURE__ */
|
|
2539
|
-
/* @__PURE__ */
|
|
2529
|
+
/* @__PURE__ */ jsxs("section", { className: "transaction_impact", children: [
|
|
2530
|
+
/* @__PURE__ */ jsx("span", { className: "detail", children: "impact: " }),
|
|
2540
2531
|
transactionUpdate.atomUpdates.filter((token) => !token.key.startsWith(`\u{1F441}\u200D\u{1F5E8}`)).map((atomUpdate, index) => {
|
|
2541
|
-
return /* @__PURE__ */
|
|
2532
|
+
return /* @__PURE__ */ jsx(
|
|
2542
2533
|
article.AtomUpdate,
|
|
2543
2534
|
{
|
|
2544
2535
|
serialNumber: index,
|
|
@@ -2552,8 +2543,8 @@ var TransactionUpdateFC = ({ serialNumber, transactionUpdate }) => {
|
|
|
2552
2543
|
] });
|
|
2553
2544
|
};
|
|
2554
2545
|
var TimelineUpdateFC = ({ timelineUpdate }) => {
|
|
2555
|
-
return /* @__PURE__ */
|
|
2556
|
-
/* @__PURE__ */
|
|
2546
|
+
return /* @__PURE__ */ jsxs("article", { className: "node timeline_update", children: [
|
|
2547
|
+
/* @__PURE__ */ jsx("header", { children: /* @__PURE__ */ jsxs("h4", { children: [
|
|
2557
2548
|
timelineUpdate.timestamp,
|
|
2558
2549
|
": ",
|
|
2559
2550
|
timelineUpdate.type,
|
|
@@ -2561,8 +2552,8 @@ var TimelineUpdateFC = ({ timelineUpdate }) => {
|
|
|
2561
2552
|
timelineUpdate.key,
|
|
2562
2553
|
")"
|
|
2563
2554
|
] }) }),
|
|
2564
|
-
/* @__PURE__ */
|
|
2565
|
-
return /* @__PURE__ */
|
|
2555
|
+
/* @__PURE__ */ jsx("main", { children: timelineUpdate.type === `transaction_update` ? timelineUpdate.atomUpdates.filter((token) => !token.key.startsWith(`\u{1F441}\u200D\u{1F5E8}`)).map((atomUpdate, index) => {
|
|
2556
|
+
return /* @__PURE__ */ jsx(
|
|
2566
2557
|
article.AtomUpdate,
|
|
2567
2558
|
{
|
|
2568
2559
|
serialNumber: index,
|
|
@@ -2571,7 +2562,7 @@ var TimelineUpdateFC = ({ timelineUpdate }) => {
|
|
|
2571
2562
|
`${timelineUpdate.key}:${index}:${atomUpdate.key}`
|
|
2572
2563
|
);
|
|
2573
2564
|
}) : timelineUpdate.type === `selector_update` ? timelineUpdate.atomUpdates.filter((token) => !token.key.startsWith(`\u{1F441}\u200D\u{1F5E8}`)).map((atomUpdate, index) => {
|
|
2574
|
-
return /* @__PURE__ */
|
|
2565
|
+
return /* @__PURE__ */ jsx(
|
|
2575
2566
|
article.AtomUpdate,
|
|
2576
2567
|
{
|
|
2577
2568
|
serialNumber: index,
|
|
@@ -2579,7 +2570,7 @@ var TimelineUpdateFC = ({ timelineUpdate }) => {
|
|
|
2579
2570
|
},
|
|
2580
2571
|
`${timelineUpdate.key}:${index}:${atomUpdate.key}`
|
|
2581
2572
|
);
|
|
2582
|
-
}) : timelineUpdate.type === `atom_update` ? /* @__PURE__ */
|
|
2573
|
+
}) : timelineUpdate.type === `atom_update` ? /* @__PURE__ */ jsx(
|
|
2583
2574
|
article.AtomUpdate,
|
|
2584
2575
|
{
|
|
2585
2576
|
serialNumber: timelineUpdate.timestamp,
|
|
@@ -2594,40 +2585,40 @@ var article = {
|
|
|
2594
2585
|
TimelineUpdate: TimelineUpdateFC
|
|
2595
2586
|
};
|
|
2596
2587
|
var YouAreHere = () => {
|
|
2597
|
-
return /* @__PURE__ */
|
|
2588
|
+
return /* @__PURE__ */ jsx("span", { className: "you_are_here", children: "you are here" });
|
|
2598
2589
|
};
|
|
2599
2590
|
var TimelineLog = ({ token, isOpenState, timelineState }) => {
|
|
2600
|
-
const timeline =
|
|
2601
|
-
const isOpen =
|
|
2602
|
-
const setIsOpen =
|
|
2603
|
-
return /* @__PURE__ */
|
|
2604
|
-
/* @__PURE__ */
|
|
2605
|
-
/* @__PURE__ */
|
|
2606
|
-
/* @__PURE__ */
|
|
2607
|
-
/* @__PURE__ */
|
|
2608
|
-
/* @__PURE__ */
|
|
2591
|
+
const timeline = useO(timelineState);
|
|
2592
|
+
const isOpen = useO(isOpenState);
|
|
2593
|
+
const setIsOpen = useI(isOpenState);
|
|
2594
|
+
return /* @__PURE__ */ jsxs("section", { className: "node timeline_log", children: [
|
|
2595
|
+
/* @__PURE__ */ jsxs("header", { children: [
|
|
2596
|
+
/* @__PURE__ */ jsx(button.OpenClose, { isOpen, setIsOpen }),
|
|
2597
|
+
/* @__PURE__ */ jsxs("label", { children: [
|
|
2598
|
+
/* @__PURE__ */ jsx("h2", { children: token.key }),
|
|
2599
|
+
/* @__PURE__ */ jsxs("span", { className: "detail length", children: [
|
|
2609
2600
|
"(",
|
|
2610
2601
|
timeline.at,
|
|
2611
2602
|
"/",
|
|
2612
2603
|
timeline.history.length,
|
|
2613
2604
|
")"
|
|
2614
2605
|
] }),
|
|
2615
|
-
/* @__PURE__ */
|
|
2616
|
-
/* @__PURE__ */
|
|
2617
|
-
/* @__PURE__ */
|
|
2606
|
+
/* @__PURE__ */ jsx("span", { className: "gap" }),
|
|
2607
|
+
/* @__PURE__ */ jsxs("nav", { children: [
|
|
2608
|
+
/* @__PURE__ */ jsx(
|
|
2618
2609
|
"button",
|
|
2619
2610
|
{
|
|
2620
2611
|
type: "button",
|
|
2621
|
-
onClick: () =>
|
|
2612
|
+
onClick: () => undo(token),
|
|
2622
2613
|
disabled: timeline.at === 0,
|
|
2623
2614
|
children: "undo"
|
|
2624
2615
|
}
|
|
2625
2616
|
),
|
|
2626
|
-
/* @__PURE__ */
|
|
2617
|
+
/* @__PURE__ */ jsx(
|
|
2627
2618
|
"button",
|
|
2628
2619
|
{
|
|
2629
2620
|
type: "button",
|
|
2630
|
-
onClick: () =>
|
|
2621
|
+
onClick: () => redo(token),
|
|
2631
2622
|
disabled: timeline.at === timeline.history.length,
|
|
2632
2623
|
children: "redo"
|
|
2633
2624
|
}
|
|
@@ -2635,17 +2626,17 @@ var TimelineLog = ({ token, isOpenState, timelineState }) => {
|
|
|
2635
2626
|
] })
|
|
2636
2627
|
] })
|
|
2637
2628
|
] }),
|
|
2638
|
-
isOpen ? /* @__PURE__ */
|
|
2639
|
-
index === timeline.at ? /* @__PURE__ */
|
|
2640
|
-
/* @__PURE__ */
|
|
2641
|
-
index === timeline.history.length - 1 && timeline.at === timeline.history.length ? /* @__PURE__ */
|
|
2629
|
+
isOpen ? /* @__PURE__ */ jsx("main", { children: timeline.history.map((update, index) => /* @__PURE__ */ jsxs(Fragment$1, { children: [
|
|
2630
|
+
index === timeline.at ? /* @__PURE__ */ jsx(YouAreHere, {}) : null,
|
|
2631
|
+
/* @__PURE__ */ jsx(article.TimelineUpdate, { timelineUpdate: update }),
|
|
2632
|
+
index === timeline.history.length - 1 && timeline.at === timeline.history.length ? /* @__PURE__ */ jsx(YouAreHere, {}) : null
|
|
2642
2633
|
] }, update.key + index + timeline.at)) }) : null
|
|
2643
2634
|
] });
|
|
2644
2635
|
};
|
|
2645
2636
|
var TimelineIndex = () => {
|
|
2646
|
-
const tokenIds =
|
|
2647
|
-
return /* @__PURE__ */
|
|
2648
|
-
return /* @__PURE__ */
|
|
2637
|
+
const tokenIds = useO(timelineIndex);
|
|
2638
|
+
return /* @__PURE__ */ jsx("article", { className: "index timeline_index", children: tokenIds.filter((token) => !token.key.startsWith(`\u{1F441}\u200D\u{1F5E8}`)).map((token) => {
|
|
2639
|
+
return /* @__PURE__ */ jsx(
|
|
2649
2640
|
TimelineLog,
|
|
2650
2641
|
{
|
|
2651
2642
|
token,
|
|
@@ -2657,22 +2648,22 @@ var TimelineIndex = () => {
|
|
|
2657
2648
|
}) });
|
|
2658
2649
|
};
|
|
2659
2650
|
var TransactionLog = ({ token, isOpenState, logState }) => {
|
|
2660
|
-
const log =
|
|
2661
|
-
const isOpen =
|
|
2662
|
-
const setIsOpen =
|
|
2663
|
-
return /* @__PURE__ */
|
|
2664
|
-
/* @__PURE__ */
|
|
2665
|
-
/* @__PURE__ */
|
|
2666
|
-
/* @__PURE__ */
|
|
2667
|
-
/* @__PURE__ */
|
|
2668
|
-
/* @__PURE__ */
|
|
2651
|
+
const log = useO(logState);
|
|
2652
|
+
const isOpen = useO(isOpenState);
|
|
2653
|
+
const setIsOpen = useI(isOpenState);
|
|
2654
|
+
return /* @__PURE__ */ jsxs("section", { className: "node transaction_log", children: [
|
|
2655
|
+
/* @__PURE__ */ jsxs("header", { children: [
|
|
2656
|
+
/* @__PURE__ */ jsx(button.OpenClose, { isOpen, setIsOpen }),
|
|
2657
|
+
/* @__PURE__ */ jsxs("label", { children: [
|
|
2658
|
+
/* @__PURE__ */ jsx("h2", { children: token.key }),
|
|
2659
|
+
/* @__PURE__ */ jsxs("span", { className: "detail length", children: [
|
|
2669
2660
|
"(",
|
|
2670
2661
|
log.length,
|
|
2671
2662
|
")"
|
|
2672
2663
|
] })
|
|
2673
2664
|
] })
|
|
2674
2665
|
] }),
|
|
2675
|
-
isOpen ? /* @__PURE__ */
|
|
2666
|
+
isOpen ? /* @__PURE__ */ jsx("main", { children: log.map((update, index) => /* @__PURE__ */ jsx(
|
|
2676
2667
|
article.TransactionUpdate,
|
|
2677
2668
|
{
|
|
2678
2669
|
serialNumber: index,
|
|
@@ -2683,9 +2674,9 @@ var TransactionLog = ({ token, isOpenState, logState }) => {
|
|
|
2683
2674
|
] });
|
|
2684
2675
|
};
|
|
2685
2676
|
var TransactionIndex = () => {
|
|
2686
|
-
const tokenIds =
|
|
2687
|
-
return /* @__PURE__ */
|
|
2688
|
-
return /* @__PURE__ */
|
|
2677
|
+
const tokenIds = useO(transactionIndex);
|
|
2678
|
+
return /* @__PURE__ */ jsx("article", { className: "index transaction_index", children: tokenIds.filter((token) => !token.key.startsWith(`\u{1F441}\u200D\u{1F5E8}`)).map((token) => {
|
|
2679
|
+
return /* @__PURE__ */ jsx(
|
|
2689
2680
|
TransactionLog,
|
|
2690
2681
|
{
|
|
2691
2682
|
token,
|
|
@@ -2697,16 +2688,16 @@ var TransactionIndex = () => {
|
|
|
2697
2688
|
}) });
|
|
2698
2689
|
};
|
|
2699
2690
|
var AtomIODevtools = () => {
|
|
2700
|
-
const constraintsRef =
|
|
2701
|
-
const setDevtoolsAreOpen =
|
|
2702
|
-
const devtoolsAreOpen =
|
|
2703
|
-
const setDevtoolsView =
|
|
2704
|
-
const devtoolsView =
|
|
2705
|
-
const devtoolsViewOptions =
|
|
2706
|
-
const mouseHasMoved =
|
|
2707
|
-
return /* @__PURE__ */
|
|
2708
|
-
/* @__PURE__ */
|
|
2709
|
-
|
|
2691
|
+
const constraintsRef = useRef(null);
|
|
2692
|
+
const setDevtoolsAreOpen = useI(devtoolsAreOpenState);
|
|
2693
|
+
const devtoolsAreOpen = useO(devtoolsAreOpenState);
|
|
2694
|
+
const setDevtoolsView = useI(devtoolsViewSelectionState);
|
|
2695
|
+
const devtoolsView = useO(devtoolsViewSelectionState);
|
|
2696
|
+
const devtoolsViewOptions = useO(devtoolsViewOptionsState);
|
|
2697
|
+
const mouseHasMoved = useRef(false);
|
|
2698
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
2699
|
+
/* @__PURE__ */ jsx(
|
|
2700
|
+
motion.span,
|
|
2710
2701
|
{
|
|
2711
2702
|
ref: constraintsRef,
|
|
2712
2703
|
className: "atom_io_devtools_zone",
|
|
@@ -2720,13 +2711,13 @@ var AtomIODevtools = () => {
|
|
|
2720
2711
|
}
|
|
2721
2712
|
}
|
|
2722
2713
|
),
|
|
2723
|
-
/* @__PURE__ */
|
|
2724
|
-
|
|
2714
|
+
/* @__PURE__ */ jsxs(
|
|
2715
|
+
motion.main,
|
|
2725
2716
|
{
|
|
2726
2717
|
drag: true,
|
|
2727
2718
|
dragConstraints: constraintsRef,
|
|
2728
2719
|
className: "atom_io_devtools",
|
|
2729
|
-
transition:
|
|
2720
|
+
transition: spring,
|
|
2730
2721
|
style: devtoolsAreOpen ? {} : {
|
|
2731
2722
|
backgroundColor: `#0000`,
|
|
2732
2723
|
borderColor: `#0000`,
|
|
@@ -2734,10 +2725,10 @@ var AtomIODevtools = () => {
|
|
|
2734
2725
|
maxWidth: 33
|
|
2735
2726
|
},
|
|
2736
2727
|
children: [
|
|
2737
|
-
devtoolsAreOpen ? /* @__PURE__ */
|
|
2738
|
-
/* @__PURE__ */
|
|
2739
|
-
/* @__PURE__ */
|
|
2740
|
-
/* @__PURE__ */
|
|
2728
|
+
devtoolsAreOpen ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
2729
|
+
/* @__PURE__ */ jsxs(motion.header, { children: [
|
|
2730
|
+
/* @__PURE__ */ jsx("h1", { children: "atom.io" }),
|
|
2731
|
+
/* @__PURE__ */ jsx("nav", { children: devtoolsViewOptions.map((viewOption) => /* @__PURE__ */ jsx(
|
|
2741
2732
|
"button",
|
|
2742
2733
|
{
|
|
2743
2734
|
type: "button",
|
|
@@ -2749,9 +2740,9 @@ var AtomIODevtools = () => {
|
|
|
2749
2740
|
viewOption
|
|
2750
2741
|
)) })
|
|
2751
2742
|
] }),
|
|
2752
|
-
/* @__PURE__ */
|
|
2743
|
+
/* @__PURE__ */ jsx(motion.main, { children: /* @__PURE__ */ jsx(LayoutGroup, { children: devtoolsView === `atoms` ? /* @__PURE__ */ jsx(StateIndex, { tokenIndex: atomIndex }) : devtoolsView === `selectors` ? /* @__PURE__ */ jsx(StateIndex, { tokenIndex: selectorIndex }) : devtoolsView === `transactions` ? /* @__PURE__ */ jsx(TransactionIndex, {}) : devtoolsView === `timelines` ? /* @__PURE__ */ jsx(TimelineIndex, {}) : null }) })
|
|
2753
2744
|
] }) : null,
|
|
2754
|
-
/* @__PURE__ */
|
|
2745
|
+
/* @__PURE__ */ jsx("footer", { children: /* @__PURE__ */ jsx(
|
|
2755
2746
|
"button",
|
|
2756
2747
|
{
|
|
2757
2748
|
type: "button",
|
|
@@ -2779,23 +2770,23 @@ var {
|
|
|
2779
2770
|
findTransactionLogState,
|
|
2780
2771
|
timelineIndex,
|
|
2781
2772
|
findTimelineState
|
|
2782
|
-
} =
|
|
2783
|
-
var devtoolsAreOpenState =
|
|
2773
|
+
} = attachIntrospectionStates();
|
|
2774
|
+
var devtoolsAreOpenState = atom({
|
|
2784
2775
|
key: `\u{1F441}\u200D\u{1F5E8} Devtools Are Open`,
|
|
2785
2776
|
default: true,
|
|
2786
2777
|
effects: [lazyLocalStorageEffect(`\u{1F441}\u200D\u{1F5E8} Devtools Are Open`)]
|
|
2787
2778
|
});
|
|
2788
|
-
var devtoolsViewSelectionState =
|
|
2779
|
+
var devtoolsViewSelectionState = atom({
|
|
2789
2780
|
key: `\u{1F441}\u200D\u{1F5E8} Devtools View Selection`,
|
|
2790
2781
|
default: `atoms`,
|
|
2791
2782
|
effects: [lazyLocalStorageEffect(`\u{1F441}\u200D\u{1F5E8} Devtools View`)]
|
|
2792
2783
|
});
|
|
2793
|
-
var devtoolsViewOptionsState =
|
|
2784
|
+
var devtoolsViewOptionsState = atom({
|
|
2794
2785
|
key: `\u{1F441}\u200D\u{1F5E8} Devtools View Options`,
|
|
2795
2786
|
default: [`atoms`, `selectors`, `transactions`, `timelines`],
|
|
2796
2787
|
effects: [lazyLocalStorageEffect(`\u{1F441}\u200D\u{1F5E8} Devtools View Options`)]
|
|
2797
2788
|
});
|
|
2798
|
-
var findViewIsOpenState =
|
|
2789
|
+
var findViewIsOpenState = atomFamily({
|
|
2799
2790
|
key: `\u{1F441}\u200D\u{1F5E8} Devtools View Is Open`,
|
|
2800
2791
|
default: false,
|
|
2801
2792
|
effects: (key) => [lazyLocalStorageEffect(key + `:view-is-open`)]
|
|
@@ -2819,19 +2810,6 @@ var prettyJson = new Differ(primitiveRefinery, jsonTreeRefinery, {
|
|
|
2819
2810
|
array: diffArray
|
|
2820
2811
|
});
|
|
2821
2812
|
|
|
2822
|
-
|
|
2823
|
-
exports.atomIndex = atomIndex;
|
|
2824
|
-
exports.devtoolsAreOpenState = devtoolsAreOpenState;
|
|
2825
|
-
exports.devtoolsViewOptionsState = devtoolsViewOptionsState;
|
|
2826
|
-
exports.devtoolsViewSelectionState = devtoolsViewSelectionState;
|
|
2827
|
-
exports.findTimelineState = findTimelineState;
|
|
2828
|
-
exports.findTransactionLogState = findTransactionLogState;
|
|
2829
|
-
exports.findViewIsOpenState = findViewIsOpenState;
|
|
2830
|
-
exports.jsonTreeRefinery = jsonTreeRefinery;
|
|
2831
|
-
exports.prettyJson = prettyJson;
|
|
2832
|
-
exports.primitiveRefinery = primitiveRefinery;
|
|
2833
|
-
exports.selectorIndex = selectorIndex;
|
|
2834
|
-
exports.timelineIndex = timelineIndex;
|
|
2835
|
-
exports.transactionIndex = transactionIndex;
|
|
2813
|
+
export { AtomIODevtools, atomIndex, devtoolsAreOpenState, devtoolsViewOptionsState, devtoolsViewSelectionState, findTimelineState, findTransactionLogState, findViewIsOpenState, jsonTreeRefinery, prettyJson, primitiveRefinery, selectorIndex, timelineIndex, transactionIndex };
|
|
2836
2814
|
//# sourceMappingURL=out.js.map
|
|
2837
2815
|
//# sourceMappingURL=index.js.map
|