atom.io 0.6.1 → 0.6.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.mts +3 -3
- package/dist/index.d.ts +3 -3
- package/dist/index.js +7 -2
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +7 -2
- package/dist/index.mjs.map +1 -1
- package/json/dist/index.js.map +1 -1
- package/json/dist/index.mjs.map +1 -1
- package/package.json +13 -3
- package/react/dist/index.js.map +1 -1
- package/react/dist/index.mjs.map +1 -1
- package/react-devtools/dist/index.js +32 -18
- package/react-devtools/dist/index.js.map +1 -1
- package/react-devtools/dist/index.mjs +32 -18
- package/react-devtools/dist/index.mjs.map +1 -1
- package/realtime/dist/index.js.map +1 -1
- package/realtime/dist/index.mjs.map +1 -1
- package/realtime-react/dist/index.js.map +1 -1
- package/realtime-react/dist/index.mjs.map +1 -1
- package/realtime-testing/dist/index.d.mts +49 -0
- package/realtime-testing/dist/index.d.ts +49 -0
- package/realtime-testing/dist/index.js +153 -0
- package/realtime-testing/dist/index.js.map +1 -0
- package/realtime-testing/dist/index.mjs +117 -0
- package/realtime-testing/dist/index.mjs.map +1 -0
- package/realtime-testing/package.json +15 -0
- package/src/atom.ts +15 -15
- package/src/index.ts +59 -59
- package/src/internal/atom-internal.ts +36 -36
- package/src/internal/families-internal.ts +114 -114
- package/src/internal/get.ts +83 -83
- package/src/internal/is-default.ts +17 -17
- package/src/internal/meta/attach-meta.ts +7 -7
- package/src/internal/meta/meta-state.ts +115 -115
- package/src/internal/operation.ts +93 -93
- package/src/internal/selector/create-read-write-selector.ts +46 -46
- package/src/internal/selector/create-readonly-selector.ts +37 -37
- package/src/internal/selector/lookup-selector-sources.ts +9 -9
- package/src/internal/selector/register-selector.ts +44 -44
- package/src/internal/selector/trace-selector-atoms.ts +30 -30
- package/src/internal/selector/update-selector-atoms.ts +25 -25
- package/src/internal/selector-internal.ts +37 -37
- package/src/internal/set.ts +78 -78
- package/src/internal/store.ts +118 -118
- package/src/internal/subscribe-internal.ts +62 -62
- package/src/internal/time-travel-internal.ts +76 -76
- package/src/internal/timeline/add-atom-to-timeline.ts +158 -153
- package/src/internal/timeline-internal.ts +80 -80
- package/src/internal/transaction/abort-transaction.ts +8 -8
- package/src/internal/transaction/apply-transaction.ts +41 -41
- package/src/internal/transaction/build-transaction.ts +28 -28
- package/src/internal/transaction/index.ts +7 -7
- package/src/internal/transaction/redo-transaction.ts +13 -13
- package/src/internal/transaction/undo-transaction.ts +13 -13
- package/src/internal/transaction-internal.ts +48 -48
- package/src/json/select-json.ts +12 -12
- package/src/logger.ts +30 -30
- package/src/react/store-context.tsx +4 -4
- package/src/react/store-hooks.ts +18 -18
- package/src/react-devtools/AtomIODevtools.tsx +83 -82
- package/src/react-devtools/StateEditor.tsx +53 -53
- package/src/react-devtools/TokenList.tsx +47 -42
- package/src/react-explorer/AtomIOExplorer.tsx +197 -185
- package/src/react-explorer/explorer-effects.ts +11 -11
- package/src/react-explorer/explorer-states.ts +186 -193
- package/src/react-explorer/index.ts +11 -11
- package/src/react-explorer/space-states.ts +48 -50
- package/src/react-explorer/view-states.ts +25 -25
- package/src/realtime/hook-composition/expose-family.ts +81 -81
- package/src/realtime/hook-composition/expose-single.ts +26 -26
- package/src/realtime/hook-composition/expose-timeline.ts +60 -0
- package/src/realtime/hook-composition/index.ts +2 -2
- package/src/realtime/hook-composition/receive-state.ts +18 -18
- package/src/realtime/hook-composition/receive-transaction.ts +8 -8
- package/src/realtime-react/realtime-context.tsx +17 -17
- package/src/realtime-react/realtime-hooks.ts +17 -17
- package/src/realtime-react/realtime-state.ts +4 -4
- package/src/realtime-react/use-pull-family-member.ts +15 -15
- package/src/realtime-react/use-pull-family.ts +13 -13
- package/src/realtime-react/use-pull.ts +12 -12
- package/src/realtime-react/use-push.ts +15 -15
- package/src/realtime-react/use-server-action.ts +21 -21
- package/src/realtime-testing/index.ts +1 -0
- package/src/realtime-testing/setup-realtime-test.tsx +160 -0
- package/src/selector.ts +25 -25
- package/src/silo.ts +38 -38
- package/src/subscribe.ts +68 -68
- package/src/timeline.ts +13 -13
- package/src/transaction.ts +28 -28
- package/src/web-effects/storage.ts +17 -17
package/json/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/json/index.ts","../../src/json/select-json.ts"],"sourcesContent":["export * from \"./select-json\"\n","import * as AtomIO from \"atom.io\"\n\nimport type { Json, JsonInterface } from \"~/packages/anvl/src/json\"\n\nexport const selectJson = <T, J extends Json>(\n
|
|
1
|
+
{"version":3,"sources":["../../src/json/index.ts","../../src/json/select-json.ts"],"sourcesContent":["export * from \"./select-json\"\n","import * as AtomIO from \"atom.io\"\n\nimport type { Json, JsonInterface } from \"~/packages/anvl/src/json\"\n\nexport const selectJson = <T, J extends Json>(\n\tatom: AtomIO.AtomToken<T>,\n\ttransform: JsonInterface<T, J>,\n\tstore: AtomIO.Store = AtomIO.__INTERNAL__.IMPLICIT.STORE,\n): AtomIO.SelectorToken<J> =>\n\tAtomIO.__INTERNAL__.selector__INTERNAL(\n\t\t{\n\t\t\tkey: `${atom.key}JSON`,\n\t\t\tget: ({ get }) => transform.toJson(get(atom)),\n\t\t\tset: ({ set }, newValue) => set(atom, transform.fromJson(newValue)),\n\t\t},\n\t\tundefined,\n\t\tstore,\n\t)\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA,aAAwB;AAIjB,IAAM,aAAa,CACzB,MACA,WACA,QAA6B,oBAAa,SAAS,UAE5C,oBAAa;AAAA,EACnB;AAAA,IACC,KAAK,GAAG,KAAK,GAAG;AAAA,IAChB,KAAK,CAAC,EAAE,IAAI,MAAM,UAAU,OAAO,IAAI,IAAI,CAAC;AAAA,IAC5C,KAAK,CAAC,EAAE,IAAI,GAAG,aAAa,IAAI,MAAM,UAAU,SAAS,QAAQ,CAAC;AAAA,EACnE;AAAA,EACA;AAAA,EACA;AACD;","names":[]}
|
package/json/dist/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/json/select-json.ts"],"sourcesContent":["import * as AtomIO from \"atom.io\"\n\nimport type { Json, JsonInterface } from \"~/packages/anvl/src/json\"\n\nexport const selectJson = <T, J extends Json>(\n
|
|
1
|
+
{"version":3,"sources":["../../src/json/select-json.ts"],"sourcesContent":["import * as AtomIO from \"atom.io\"\n\nimport type { Json, JsonInterface } from \"~/packages/anvl/src/json\"\n\nexport const selectJson = <T, J extends Json>(\n\tatom: AtomIO.AtomToken<T>,\n\ttransform: JsonInterface<T, J>,\n\tstore: AtomIO.Store = AtomIO.__INTERNAL__.IMPLICIT.STORE,\n): AtomIO.SelectorToken<J> =>\n\tAtomIO.__INTERNAL__.selector__INTERNAL(\n\t\t{\n\t\t\tkey: `${atom.key}JSON`,\n\t\t\tget: ({ get }) => transform.toJson(get(atom)),\n\t\t\tset: ({ set }, newValue) => set(atom, transform.fromJson(newValue)),\n\t\t},\n\t\tundefined,\n\t\tstore,\n\t)\n"],"mappings":";AAAA,YAAY,YAAY;AAIjB,IAAM,aAAa,CACzB,MACA,WACA,QAA6B,oBAAa,SAAS,UAE5C,oBAAa;AAAA,EACnB;AAAA,IACC,KAAK,GAAG,KAAK,GAAG;AAAA,IAChB,KAAK,CAAC,EAAE,IAAI,MAAM,UAAU,OAAO,IAAI,IAAI,CAAC;AAAA,IAC5C,KAAK,CAAC,EAAE,IAAI,GAAG,aAAa,IAAI,MAAM,UAAU,SAAS,QAAQ,CAAC;AAAA,EACnE;AAAA,EACA;AAAA,EACA;AACD;","names":[]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "atom.io",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.3",
|
|
4
4
|
"description": "Reactive state graph for React, Preact, and vanilla",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -17,6 +17,8 @@
|
|
|
17
17
|
"realtime/package.json",
|
|
18
18
|
"realtime-react/dist",
|
|
19
19
|
"realtime-react/package.json",
|
|
20
|
+
"realtime-testing/dist",
|
|
21
|
+
"realtime-testing/package.json",
|
|
20
22
|
"src"
|
|
21
23
|
],
|
|
22
24
|
"exports": {
|
|
@@ -61,11 +63,18 @@
|
|
|
61
63
|
"browser": "./realtime-react/dist/index.mjs",
|
|
62
64
|
"import": "./realtime-react/dist/index.mjs",
|
|
63
65
|
"require": "./realtime-react/dist/index.js"
|
|
66
|
+
},
|
|
67
|
+
"./realtime-testing/package.json": "./realtime-testing/package.json",
|
|
68
|
+
"./realtime-testing": {
|
|
69
|
+
"types": "./realtime-testing/dist/index.d.ts",
|
|
70
|
+
"browser": "./realtime-testing/dist/index.mjs",
|
|
71
|
+
"import": "./realtime-testing/dist/index.mjs",
|
|
72
|
+
"require": "./realtime-testing/dist/index.js"
|
|
64
73
|
}
|
|
65
74
|
},
|
|
66
75
|
"scripts": {
|
|
67
|
-
"build": "tsup & (cd json && tsup) & (cd react && tsup) & (cd react-devtools && tsup) & (cd realtime && tsup) & (cd realtime-react && tsup)",
|
|
68
|
-
"lint": "
|
|
76
|
+
"build": "tsup & (cd json && tsup) & (cd react && tsup) & (cd react-devtools && tsup) & (cd realtime && tsup) & (cd realtime-react && tsup) & (cd realtime-testing && tsup)",
|
|
77
|
+
"lint": "rome check .",
|
|
69
78
|
"test": "vitest",
|
|
70
79
|
"test:once": "vitest run"
|
|
71
80
|
},
|
|
@@ -98,6 +107,7 @@
|
|
|
98
107
|
"@testing-library/react": "14.0.0",
|
|
99
108
|
"@types/mock-fs": "4.13.1",
|
|
100
109
|
"eslint": "8.44.0",
|
|
110
|
+
"happy-dom": "10.3.0",
|
|
101
111
|
"mock-fs": "5.2.0",
|
|
102
112
|
"react": "18.2.0",
|
|
103
113
|
"react-dom": "18.2.0",
|
package/react/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/react/index.ts","../../src/react/store-context.tsx","../../src/react/store-hooks.ts"],"sourcesContent":["export * from \"./store-context\"\nexport * from \"./store-hooks\"\n","import * as React from \"react\"\n\nimport * as AtomIO from \"atom.io\"\n\nexport const StoreContext = React.createContext<AtomIO.Store>(\n
|
|
1
|
+
{"version":3,"sources":["../../src/react/index.ts","../../src/react/store-context.tsx","../../src/react/store-hooks.ts"],"sourcesContent":["export * from \"./store-context\"\nexport * from \"./store-hooks\"\n","import * as React from \"react\"\n\nimport * as AtomIO from \"atom.io\"\n\nexport const StoreContext = React.createContext<AtomIO.Store>(\n\tAtomIO.__INTERNAL__.IMPLICIT.STORE,\n)\n\nexport const StoreProvider: React.FC<{\n\tchildren: React.ReactNode\n\tstore?: AtomIO.Store\n}> = ({ children, store = AtomIO.__INTERNAL__.IMPLICIT.STORE }) => (\n\t<StoreContext.Provider value={store}>{children}</StoreContext.Provider>\n)\n","import * as React from \"react\"\n\nimport * as AtomIO from \"atom.io\"\n\nimport type { Modifier } from \"~/packages/anvl/src/function\"\n\nimport { StoreContext } from \"./store-context\"\n\nexport type StoreHooks = {\n\tuseI: <T>(token: AtomIO.StateToken<T>) => (next: Modifier<T> | T) => void\n\tuseO: <T>(token: AtomIO.ReadonlySelectorToken<T> | AtomIO.StateToken<T>) => T\n\tuseIO: <T>(token: AtomIO.StateToken<T>) => [T, (next: Modifier<T> | T) => void]\n}\nexport const storeHooks: StoreHooks = { useI, useO, useIO }\n\nexport function useI<T>(\n\ttoken: AtomIO.StateToken<T>,\n): (next: Modifier<T> | T) => void {\n\tconst store = React.useContext(StoreContext)\n\tconst update = (next: Modifier<T> | T) => AtomIO.setState(token, next, store)\n\treturn update\n}\n\nexport function useO<T>(\n\ttoken: AtomIO.ReadonlySelectorToken<T> | AtomIO.StateToken<T>,\n): T {\n\tconst store = React.useContext(StoreContext)\n\treturn React.useSyncExternalStore<T>(\n\t\t(observe) => AtomIO.subscribe(token, observe, store),\n\t\t() => AtomIO.getState(token, store),\n\t)\n}\n\nexport function useIO<T>(\n\ttoken: AtomIO.StateToken<T>,\n): [T, (next: Modifier<T> | T) => void] {\n\treturn [useO(token), useI(token)]\n}\n\nexport function useStore<T>(\n\ttoken: AtomIO.StateToken<T>,\n): [T, (next: Modifier<T> | T) => void]\nexport function useStore<T>(token: AtomIO.ReadonlySelectorToken<T>): T\nexport function useStore<T>(\n\ttoken: AtomIO.ReadonlySelectorToken<T> | AtomIO.StateToken<T>,\n): T | [T, (next: Modifier<T> | T) => void] {\n\treturn token.type === `readonly_selector` ? useO(token) : useIO(token)\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA,YAAuB;AAEvB,aAAwB;AAUvB;AARM,IAAM,eAAqB;AAAA,EAC1B,oBAAa,SAAS;AAC9B;AAEO,IAAM,gBAGR,CAAC,EAAE,UAAU,QAAe,oBAAa,SAAS,MAAM,MAC5D,4CAAC,aAAa,UAAb,EAAsB,OAAO,OAAQ,UAAS;;;ACZhD,IAAAA,SAAuB;AAEvB,IAAAC,UAAwB;AAWjB,IAAM,aAAyB,EAAE,MAAM,MAAM,MAAM;AAEnD,SAAS,KACf,OACkC;AAClC,QAAM,QAAc,kBAAW,YAAY;AAC3C,QAAM,SAAS,CAAC,SAAiC,iBAAS,OAAO,MAAM,KAAK;AAC5E,SAAO;AACR;AAEO,SAAS,KACf,OACI;AACJ,QAAM,QAAc,kBAAW,YAAY;AAC3C,SAAa;AAAA,IACZ,CAAC,YAAmB,kBAAU,OAAO,SAAS,KAAK;AAAA,IACnD,MAAa,iBAAS,OAAO,KAAK;AAAA,EACnC;AACD;AAEO,SAAS,MACf,OACuC;AACvC,SAAO,CAAC,KAAK,KAAK,GAAG,KAAK,KAAK,CAAC;AACjC;AAMO,SAAS,SACf,OAC2C;AAC3C,SAAO,MAAM,SAAS,sBAAsB,KAAK,KAAK,IAAI,MAAM,KAAK;AACtE;","names":["React","AtomIO"]}
|
package/react/dist/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/react/store-context.tsx","../../src/react/store-hooks.ts"],"sourcesContent":["import * as React from \"react\"\n\nimport * as AtomIO from \"atom.io\"\n\nexport const StoreContext = React.createContext<AtomIO.Store>(\n
|
|
1
|
+
{"version":3,"sources":["../../src/react/store-context.tsx","../../src/react/store-hooks.ts"],"sourcesContent":["import * as React from \"react\"\n\nimport * as AtomIO from \"atom.io\"\n\nexport const StoreContext = React.createContext<AtomIO.Store>(\n\tAtomIO.__INTERNAL__.IMPLICIT.STORE,\n)\n\nexport const StoreProvider: React.FC<{\n\tchildren: React.ReactNode\n\tstore?: AtomIO.Store\n}> = ({ children, store = AtomIO.__INTERNAL__.IMPLICIT.STORE }) => (\n\t<StoreContext.Provider value={store}>{children}</StoreContext.Provider>\n)\n","import * as React from \"react\"\n\nimport * as AtomIO from \"atom.io\"\n\nimport type { Modifier } from \"~/packages/anvl/src/function\"\n\nimport { StoreContext } from \"./store-context\"\n\nexport type StoreHooks = {\n\tuseI: <T>(token: AtomIO.StateToken<T>) => (next: Modifier<T> | T) => void\n\tuseO: <T>(token: AtomIO.ReadonlySelectorToken<T> | AtomIO.StateToken<T>) => T\n\tuseIO: <T>(token: AtomIO.StateToken<T>) => [T, (next: Modifier<T> | T) => void]\n}\nexport const storeHooks: StoreHooks = { useI, useO, useIO }\n\nexport function useI<T>(\n\ttoken: AtomIO.StateToken<T>,\n): (next: Modifier<T> | T) => void {\n\tconst store = React.useContext(StoreContext)\n\tconst update = (next: Modifier<T> | T) => AtomIO.setState(token, next, store)\n\treturn update\n}\n\nexport function useO<T>(\n\ttoken: AtomIO.ReadonlySelectorToken<T> | AtomIO.StateToken<T>,\n): T {\n\tconst store = React.useContext(StoreContext)\n\treturn React.useSyncExternalStore<T>(\n\t\t(observe) => AtomIO.subscribe(token, observe, store),\n\t\t() => AtomIO.getState(token, store),\n\t)\n}\n\nexport function useIO<T>(\n\ttoken: AtomIO.StateToken<T>,\n): [T, (next: Modifier<T> | T) => void] {\n\treturn [useO(token), useI(token)]\n}\n\nexport function useStore<T>(\n\ttoken: AtomIO.StateToken<T>,\n): [T, (next: Modifier<T> | T) => void]\nexport function useStore<T>(token: AtomIO.ReadonlySelectorToken<T>): T\nexport function useStore<T>(\n\ttoken: AtomIO.ReadonlySelectorToken<T> | AtomIO.StateToken<T>,\n): T | [T, (next: Modifier<T> | T) => void] {\n\treturn token.type === `readonly_selector` ? useO(token) : useIO(token)\n}\n"],"mappings":";AAAA,YAAY,WAAW;AAEvB,YAAY,YAAY;AAUvB;AARM,IAAM,eAAqB;AAAA,EAC1B,oBAAa,SAAS;AAC9B;AAEO,IAAM,gBAGR,CAAC,EAAE,UAAU,QAAe,oBAAa,SAAS,MAAM,MAC5D,oBAAC,aAAa,UAAb,EAAsB,OAAO,OAAQ,UAAS;;;ACZhD,YAAYA,YAAW;AAEvB,YAAYC,aAAY;AAWjB,IAAM,aAAyB,EAAE,MAAM,MAAM,MAAM;AAEnD,SAAS,KACf,OACkC;AAClC,QAAM,QAAc,kBAAW,YAAY;AAC3C,QAAM,SAAS,CAAC,SAAiC,iBAAS,OAAO,MAAM,KAAK;AAC5E,SAAO;AACR;AAEO,SAAS,KACf,OACI;AACJ,QAAM,QAAc,kBAAW,YAAY;AAC3C,SAAa;AAAA,IACZ,CAAC,YAAmB,kBAAU,OAAO,SAAS,KAAK;AAAA,IACnD,MAAa,iBAAS,OAAO,KAAK;AAAA,EACnC;AACD;AAEO,SAAS,MACf,OACuC;AACvC,SAAO,CAAC,KAAK,KAAK,GAAG,KAAK,KAAK,CAAC;AACjC;AAMO,SAAS,SACf,OAC2C;AAC3C,SAAO,MAAM,SAAS,sBAAsB,KAAK,KAAK,IAAI,MAAM,KAAK;AACtE;","names":["React","AtomIO"]}
|
|
@@ -554,7 +554,7 @@ var import_string4 = require("fp-ts/string");
|
|
|
554
554
|
// ../../anvl/src/json-schema/integer.ts
|
|
555
555
|
var import_function10 = require("fp-ts/function");
|
|
556
556
|
var isInteger = (input) => Number.isInteger(input);
|
|
557
|
-
var
|
|
557
|
+
var parseInteger = (input) => {
|
|
558
558
|
if (isInteger(input))
|
|
559
559
|
return input;
|
|
560
560
|
throw new IntegerParseError(input);
|
|
@@ -567,8 +567,8 @@ var Fraction = class extends Number {
|
|
|
567
567
|
if (d === 0) {
|
|
568
568
|
throw new Error(`Denominator cannot be zero`);
|
|
569
569
|
}
|
|
570
|
-
this.numerator =
|
|
571
|
-
this.denominator =
|
|
570
|
+
this.numerator = parseInteger(n);
|
|
571
|
+
this.denominator = parseInteger(d);
|
|
572
572
|
}
|
|
573
573
|
};
|
|
574
574
|
_a = Symbol.toPrimitive;
|
|
@@ -577,7 +577,7 @@ var IntegerParseError = class extends Error {
|
|
|
577
577
|
super(`Could not parse integer from ${JSON.stringify(value)}`);
|
|
578
578
|
}
|
|
579
579
|
};
|
|
580
|
-
var Int = Object.assign((input) =>
|
|
580
|
+
var Int = Object.assign((input) => parseInteger(input), {
|
|
581
581
|
from: (input) => (0, import_function10.pipe)(
|
|
582
582
|
input,
|
|
583
583
|
String,
|
|
@@ -870,7 +870,7 @@ function isJsonSchema(input) {
|
|
|
870
870
|
// ../../anvl/src/json-schema/path-into.ts
|
|
871
871
|
var expandPathForSchema = (path) => {
|
|
872
872
|
try {
|
|
873
|
-
return path.
|
|
873
|
+
return path.flatMap((key) => {
|
|
874
874
|
switch (typeof key) {
|
|
875
875
|
case `string`:
|
|
876
876
|
return [`properties`, key];
|
|
@@ -887,7 +887,7 @@ var expandPathForSchema = (path) => {
|
|
|
887
887
|
`The key ${key} is not a valid JSON key; expected string or number, got ${typeof key}`
|
|
888
888
|
);
|
|
889
889
|
}
|
|
890
|
-
})
|
|
890
|
+
});
|
|
891
891
|
} catch (caught) {
|
|
892
892
|
if (caught instanceof TypeError)
|
|
893
893
|
return caught;
|
|
@@ -1114,6 +1114,7 @@ var PropertyAdder = ({
|
|
|
1114
1114
|
Components
|
|
1115
1115
|
}) => /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(Components.MissingPropertyWrapper, { children: [
|
|
1116
1116
|
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(ElasticInput, { disabled: true, defaultValue: propertyKey }),
|
|
1117
|
+
" ",
|
|
1117
1118
|
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(ElasticInput, { disabled: true, defaultValue: "is missing" }),
|
|
1118
1119
|
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Components.Button, { onClick: () => addProperty(), disabled, children: "+" })
|
|
1119
1120
|
] });
|
|
@@ -1328,7 +1329,16 @@ var findErrorBoundaryState = (0, import_recoil.atomFamily)({
|
|
|
1328
1329
|
var import_jsx_runtime10 = require("react/jsx-runtime");
|
|
1329
1330
|
var DEFAULT_JSON_EDITOR_COMPONENTS = {
|
|
1330
1331
|
ErrorBoundary: ({ children }) => /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(ErrorBoundary, { children }),
|
|
1331
|
-
Button: ({ onClick, children, disabled }) => /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
1332
|
+
Button: ({ onClick, children, disabled }) => /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
1333
|
+
"button",
|
|
1334
|
+
{
|
|
1335
|
+
type: "button",
|
|
1336
|
+
className: "json_editor_button",
|
|
1337
|
+
onClick,
|
|
1338
|
+
disabled,
|
|
1339
|
+
children
|
|
1340
|
+
}
|
|
1341
|
+
),
|
|
1332
1342
|
EditorWrapper: ({ children, customCss, className }) => /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: `json_editor ` + className, css: customCss, children }),
|
|
1333
1343
|
EditorLayout: ({
|
|
1334
1344
|
DeleteButton,
|
|
@@ -1457,17 +1467,20 @@ var StoreEditor = ({ storeHooks, token }) => {
|
|
|
1457
1467
|
var import_jsx_runtime13 = require("react/jsx-runtime");
|
|
1458
1468
|
var TokenList = ({ storeHooks, tokenIndex }) => {
|
|
1459
1469
|
const tokenIds = storeHooks.useO(tokenIndex);
|
|
1460
|
-
return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_jsx_runtime13.Fragment, { children: Object.entries(tokenIds).map(([key, token]) =>
|
|
1461
|
-
|
|
1462
|
-
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
1463
|
-
|
|
1464
|
-
|
|
1465
|
-
/* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(
|
|
1466
|
-
key2,
|
|
1467
|
-
":",
|
|
1468
|
-
|
|
1469
|
-
|
|
1470
|
-
|
|
1470
|
+
return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_jsx_runtime13.Fragment, { children: Object.entries(tokenIds).map(([key, token]) => {
|
|
1471
|
+
let logState;
|
|
1472
|
+
return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_react6.Fragment, { children: key.startsWith(`\u{1F441}\u200D\u{1F5E8}_`) ? null : /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("div", { className: "node", children: `type` in token ? (logState = () => console.log(token, (0, import_atom.getState)(token)), /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(import_jsx_runtime13.Fragment, { children: [
|
|
1473
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("label", { onClick: logState, onKeyUp: logState, children: key }),
|
|
1474
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(StoreEditor, { storeHooks, token })
|
|
1475
|
+
] })) : recordToEntries(token.familyMembers).map(([key2, token2]) => /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(import_jsx_runtime13.Fragment, { children: [
|
|
1476
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("label", { children: key2 }),
|
|
1477
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { className: "node", children: [
|
|
1478
|
+
key2,
|
|
1479
|
+
":",
|
|
1480
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(StoreEditor, { storeHooks, token: token2 })
|
|
1481
|
+
] }, key2)
|
|
1482
|
+
] })) }) }, key);
|
|
1483
|
+
}) });
|
|
1471
1484
|
};
|
|
1472
1485
|
|
|
1473
1486
|
// ../src/web-effects/storage.ts
|
|
@@ -1556,6 +1569,7 @@ var composeDevtools = (storeHooks) => {
|
|
|
1556
1569
|
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("footer", { children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
1557
1570
|
"button",
|
|
1558
1571
|
{
|
|
1572
|
+
type: "button",
|
|
1559
1573
|
onMouseDown: () => mouseHasMoved.current = false,
|
|
1560
1574
|
onMouseMove: () => mouseHasMoved.current = true,
|
|
1561
1575
|
onMouseUp: () => {
|