atom.io 0.21.1 → 0.23.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/data/dist/index.cjs +152 -63
- package/data/dist/index.d.ts +6 -0
- package/data/dist/index.js +3 -3
- package/data/src/join.ts +164 -51
- package/data/src/struct-family.ts +2 -2
- package/dist/chunk-6MLFYN32.js +18 -0
- package/dist/{chunk-HITX3MO4.js → chunk-7DT3PVS3.js} +151 -62
- package/dist/{chunk-RT43TVKP.js → chunk-GVHKIJ3G.js} +1 -1
- package/dist/chunk-OAYGID5B.js +27 -0
- package/dist/index.cjs +4 -18
- package/dist/index.d.ts +71 -28
- package/dist/index.js +6 -19
- package/ephemeral/dist/index.cjs +11 -0
- package/ephemeral/dist/index.js +9 -0
- package/ephemeral/package.json +16 -0
- package/ephemeral/src/index.ts +1 -0
- package/eslint-plugin/dist/index.cjs +155 -1
- package/eslint-plugin/dist/index.js +155 -1
- package/eslint-plugin/src/rules/index.ts +1 -0
- package/eslint-plugin/src/rules/lifespan.ts +203 -0
- package/eslint-plugin/src/rules/synchronous-selector-dependencies.ts +1 -65
- package/eslint-plugin/src/walk.ts +73 -0
- package/immortal/dist/index.cjs +260 -0
- package/immortal/dist/index.js +212 -0
- package/immortal/package.json +16 -0
- package/immortal/src/index.ts +3 -0
- package/immortal/src/make-molecule.ts +222 -0
- package/immortal/src/molecule.ts +167 -0
- package/immortal/src/seek-state.ts +73 -0
- package/internal/dist/index.cjs +1242 -837
- package/internal/dist/index.d.ts +135 -22
- package/internal/dist/index.js +1215 -838
- package/internal/src/atom/create-regular-atom.ts +0 -2
- package/internal/src/atom/create-standalone-atom.ts +6 -2
- package/internal/src/atom/dispose-atom.ts +26 -3
- package/internal/src/families/create-readonly-selector-family.ts +15 -10
- package/internal/src/families/create-regular-atom-family.ts +20 -21
- package/internal/src/families/create-writable-selector-family.ts +13 -9
- package/{src/dispose.ts → internal/src/families/dispose-from-store.ts} +7 -4
- package/internal/src/families/find-in-store.ts +11 -6
- package/internal/src/families/index.ts +3 -0
- package/internal/src/families/init-family-member.ts +112 -0
- package/internal/src/families/seek-in-store.ts +123 -0
- package/internal/src/get-state/get-from-store.ts +2 -2
- package/internal/src/ingest-updates/index.ts +1 -0
- package/internal/src/ingest-updates/ingest-creation-disposal.ts +104 -0
- package/internal/src/ingest-updates/ingest-transaction-update.ts +26 -4
- package/internal/src/mutable/create-mutable-atom-family.ts +22 -24
- package/internal/src/mutable/create-mutable-atom.ts +3 -3
- package/internal/src/mutable/get-json-family.ts +2 -2
- package/internal/src/mutable/get-json-token.ts +26 -12
- package/internal/src/mutable/tracker-family.ts +21 -19
- package/internal/src/not-found-error.ts +16 -3
- package/internal/src/selector/create-readonly-selector.ts +2 -3
- package/internal/src/selector/create-standalone-selector.ts +6 -2
- package/internal/src/selector/create-writable-selector.ts +2 -3
- package/internal/src/selector/dispose-selector.ts +68 -24
- package/internal/src/selector/register-selector.ts +10 -5
- package/internal/src/set-state/set-into-store.ts +2 -2
- package/internal/src/set-state/stow-update.ts +5 -1
- package/internal/src/store/deposit.ts +41 -7
- package/internal/src/store/index.ts +0 -1
- package/internal/src/store/store.ts +29 -5
- package/internal/src/store/withdraw.ts +28 -1
- package/internal/src/subscribe/subscribe-to-state.ts +2 -2
- package/internal/src/timeline/add-atom-to-timeline.ts +206 -182
- package/internal/src/timeline/create-timeline.ts +181 -60
- package/internal/src/timeline/time-travel.ts +20 -0
- package/internal/src/transaction/apply-transaction.ts +2 -12
- package/internal/src/transaction/build-transaction.ts +16 -2
- package/introspection/dist/index.cjs +40 -53
- package/introspection/dist/index.js +40 -53
- package/introspection/src/attach-atom-index.ts +38 -48
- package/introspection/src/attach-selector-index.ts +45 -50
- package/introspection/src/attach-timeline-family.ts +1 -0
- package/json/dist/index.cjs +40 -6
- package/json/dist/index.js +44 -9
- package/json/src/select-json-family.ts +47 -9
- package/package.json +30 -10
- package/react/dist/index.cjs +1 -1
- package/react/dist/index.js +1 -1
- package/react/src/use-json.ts +1 -1
- package/react-devtools/dist/index.cjs +69 -57
- package/react-devtools/dist/index.js +62 -49
- package/react-devtools/src/StateIndex.tsx +2 -1
- package/react-devtools/src/TimelineIndex.tsx +17 -14
- package/react-devtools/src/TransactionIndex.tsx +7 -7
- package/react-devtools/src/Updates.tsx +41 -32
- package/realtime-client/dist/index.cjs +3 -3
- package/realtime-client/dist/index.js +3 -3
- package/realtime-client/src/pull-mutable-atom-family-member.ts +1 -1
- package/realtime-client/src/pull-mutable-atom.ts +1 -1
- package/realtime-client/src/sync-continuity.ts +1 -2
- package/realtime-react/dist/index.cjs +1 -1
- package/realtime-react/dist/index.js +1 -1
- package/realtime-server/dist/index.cjs +39 -27
- package/realtime-server/dist/index.d.ts +1 -1
- package/realtime-server/dist/index.js +27 -16
- package/realtime-server/src/realtime-continuity-synchronizer.ts +5 -3
- package/realtime-server/src/realtime-mutable-family-provider.ts +2 -1
- package/realtime-server/src/realtime-mutable-provider.ts +1 -1
- package/realtime-server/src/realtime-server-stores/server-sync-store.ts +21 -11
- package/realtime-testing/dist/index.cjs +7 -2
- package/realtime-testing/dist/index.js +8 -5
- package/realtime-testing/src/setup-realtime-test.tsx +5 -2
- package/src/atom.ts +19 -7
- package/src/dispose-state.ts +10 -0
- package/src/index.ts +5 -2
- package/src/selector.ts +13 -7
- package/src/silo.ts +3 -3
- package/src/subscribe.ts +8 -4
- package/src/timeline.ts +18 -1
- package/src/transaction.ts +59 -4
- package/dist/chunk-BF4MVQF6.js +0 -44
- package/internal/src/store/withdraw-new-family-member.ts +0 -69
- /package/{src → ephemeral/src}/find-state.ts +0 -0
|
@@ -5,6 +5,7 @@ var introspection = require('atom.io/introspection');
|
|
|
5
5
|
var react$1 = require('atom.io/react');
|
|
6
6
|
var framerMotion = require('framer-motion');
|
|
7
7
|
var react = require('react');
|
|
8
|
+
var ephemeral = require('atom.io/ephemeral');
|
|
8
9
|
var jsxRuntime = require('react/jsx-runtime');
|
|
9
10
|
|
|
10
11
|
var __defProp = Object.defineProperty;
|
|
@@ -1718,8 +1719,8 @@ var StateIndexTreeNode = ({ node, isOpenState }) => {
|
|
|
1718
1719
|
const setIsOpen = react$1.useI(isOpenState);
|
|
1719
1720
|
const isOpen = react$1.useO(isOpenState);
|
|
1720
1721
|
for (const [key, childNode] of node.familyMembers) {
|
|
1721
|
-
|
|
1722
|
-
|
|
1722
|
+
ephemeral.findState(findViewIsOpenState, key);
|
|
1723
|
+
ephemeral.findState(findStateTypeState, childNode);
|
|
1723
1724
|
}
|
|
1724
1725
|
return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
1725
1726
|
/* @__PURE__ */ jsxRuntime.jsxs("header", { children: [
|
|
@@ -1740,8 +1741,8 @@ var StateIndexTreeNode = ({ node, isOpenState }) => {
|
|
|
1740
1741
|
StateIndexNode,
|
|
1741
1742
|
{
|
|
1742
1743
|
node: childNode,
|
|
1743
|
-
isOpenState:
|
|
1744
|
-
typeState:
|
|
1744
|
+
isOpenState: ephemeral.findState(findViewIsOpenState, childNode.key),
|
|
1745
|
+
typeState: ephemeral.findState(findStateTypeState, childNode)
|
|
1745
1746
|
},
|
|
1746
1747
|
key
|
|
1747
1748
|
)) : null
|
|
@@ -1764,8 +1765,8 @@ var StateIndex = ({ tokenIndex }) => {
|
|
|
1764
1765
|
StateIndexNode,
|
|
1765
1766
|
{
|
|
1766
1767
|
node,
|
|
1767
|
-
isOpenState:
|
|
1768
|
-
typeState:
|
|
1768
|
+
isOpenState: ephemeral.findState(findViewIsOpenState, node.key),
|
|
1769
|
+
typeState: ephemeral.findState(findStateTypeState, node)
|
|
1769
1770
|
},
|
|
1770
1771
|
key
|
|
1771
1772
|
);
|
|
@@ -1837,25 +1838,28 @@ var TransactionUpdateFC = ({ serialNumber, transactionUpdate }) => {
|
|
|
1837
1838
|
] }),
|
|
1838
1839
|
/* @__PURE__ */ jsxRuntime.jsxs("section", { className: "transaction_impact", children: [
|
|
1839
1840
|
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "detail", children: "impact: " }),
|
|
1840
|
-
transactionUpdate.updates.filter((token) => !token.key.startsWith(`\u{1F441}\u200D\u{1F5E8}`)).map((update, index) => {
|
|
1841
|
-
|
|
1842
|
-
|
|
1843
|
-
|
|
1844
|
-
|
|
1845
|
-
|
|
1846
|
-
|
|
1847
|
-
|
|
1848
|
-
|
|
1849
|
-
|
|
1841
|
+
transactionUpdate.updates.filter((token) => `key` in token && !token.key.startsWith(`\u{1F441}\u200D\u{1F5E8}`)).map((update, index) => {
|
|
1842
|
+
switch (update.type) {
|
|
1843
|
+
case `atom_update`:
|
|
1844
|
+
case `selector_update`:
|
|
1845
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
1846
|
+
article.AtomUpdate,
|
|
1847
|
+
{
|
|
1848
|
+
serialNumber: index,
|
|
1849
|
+
atomUpdate: update
|
|
1850
|
+
},
|
|
1851
|
+
`${transactionUpdate.key}:${index}:${update.key}`
|
|
1852
|
+
);
|
|
1853
|
+
case `transaction_update`:
|
|
1854
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
1855
|
+
TransactionUpdateFC,
|
|
1856
|
+
{
|
|
1857
|
+
serialNumber: index,
|
|
1858
|
+
transactionUpdate: update
|
|
1859
|
+
},
|
|
1860
|
+
`${transactionUpdate.key}:${index}:${update.key}`
|
|
1861
|
+
);
|
|
1850
1862
|
}
|
|
1851
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
1852
|
-
TransactionUpdateFC,
|
|
1853
|
-
{
|
|
1854
|
-
serialNumber: index,
|
|
1855
|
-
transactionUpdate: update
|
|
1856
|
-
},
|
|
1857
|
-
`${transactionUpdate.key}:${index}:${update.key}`
|
|
1858
|
-
);
|
|
1859
1863
|
})
|
|
1860
1864
|
] })
|
|
1861
1865
|
] })
|
|
@@ -1864,7 +1868,7 @@ var TransactionUpdateFC = ({ serialNumber, transactionUpdate }) => {
|
|
|
1864
1868
|
);
|
|
1865
1869
|
};
|
|
1866
1870
|
var TimelineUpdateFC = ({ timelineUpdate, serialNumber }) => {
|
|
1867
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
1871
|
+
return `key` in timelineUpdate ? /* @__PURE__ */ jsxRuntime.jsxs(
|
|
1868
1872
|
"article",
|
|
1869
1873
|
{
|
|
1870
1874
|
className: "node timeline_update",
|
|
@@ -1878,22 +1882,28 @@ var TimelineUpdateFC = ({ timelineUpdate, serialNumber }) => {
|
|
|
1878
1882
|
timelineUpdate.key,
|
|
1879
1883
|
")"
|
|
1880
1884
|
] }) }),
|
|
1881
|
-
/* @__PURE__ */ jsxRuntime.jsx("main", { children: timelineUpdate.type === `transaction_update` ? timelineUpdate.updates.filter((token) => !token.key.startsWith(`\u{1F441}\u200D\u{1F5E8}`)).map((update, index) => {
|
|
1882
|
-
|
|
1883
|
-
|
|
1884
|
-
|
|
1885
|
-
|
|
1886
|
-
|
|
1887
|
-
|
|
1888
|
-
|
|
1889
|
-
|
|
1890
|
-
|
|
1891
|
-
|
|
1892
|
-
|
|
1893
|
-
|
|
1894
|
-
|
|
1895
|
-
|
|
1896
|
-
|
|
1885
|
+
/* @__PURE__ */ jsxRuntime.jsx("main", { children: timelineUpdate.type === `transaction_update` ? timelineUpdate.updates.filter((token) => `key` in token && !token.key.startsWith(`\u{1F441}\u200D\u{1F5E8}`)).map((update, index) => {
|
|
1886
|
+
switch (update.type) {
|
|
1887
|
+
case `atom_update`:
|
|
1888
|
+
case `selector_update`:
|
|
1889
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
1890
|
+
article.AtomUpdate,
|
|
1891
|
+
{
|
|
1892
|
+
serialNumber: index,
|
|
1893
|
+
atomUpdate: update
|
|
1894
|
+
},
|
|
1895
|
+
`${timelineUpdate.key}:${index}:${update.key}`
|
|
1896
|
+
);
|
|
1897
|
+
case `transaction_update`:
|
|
1898
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
1899
|
+
TransactionUpdateFC,
|
|
1900
|
+
{
|
|
1901
|
+
serialNumber: index,
|
|
1902
|
+
transactionUpdate: update
|
|
1903
|
+
},
|
|
1904
|
+
`${timelineUpdate.key}:${index}:${update.key}`
|
|
1905
|
+
);
|
|
1906
|
+
}
|
|
1897
1907
|
}) : timelineUpdate.type === `selector_update` ? timelineUpdate.atomUpdates.filter((token) => !token.key.startsWith(`\u{1F441}\u200D\u{1F5E8}`)).map((atomUpdate, index) => {
|
|
1898
1908
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
1899
1909
|
article.AtomUpdate,
|
|
@@ -1912,7 +1922,7 @@ var TimelineUpdateFC = ({ timelineUpdate, serialNumber }) => {
|
|
|
1912
1922
|
) : null })
|
|
1913
1923
|
]
|
|
1914
1924
|
}
|
|
1915
|
-
);
|
|
1925
|
+
) : null;
|
|
1916
1926
|
};
|
|
1917
1927
|
var article = {
|
|
1918
1928
|
AtomUpdate: AtomUpdateFC,
|
|
@@ -1972,17 +1982,19 @@ var TimelineLog = ({ token, isOpenState, timelineState }) => {
|
|
|
1972
1982
|
] })
|
|
1973
1983
|
] })
|
|
1974
1984
|
] }),
|
|
1975
|
-
isOpen ? /* @__PURE__ */ jsxRuntime.jsx("main", { children: timeline.history.map(
|
|
1976
|
-
index
|
|
1977
|
-
|
|
1978
|
-
|
|
1979
|
-
|
|
1980
|
-
|
|
1981
|
-
|
|
1982
|
-
|
|
1983
|
-
|
|
1984
|
-
|
|
1985
|
-
|
|
1985
|
+
isOpen ? /* @__PURE__ */ jsxRuntime.jsx("main", { children: timeline.history.map(
|
|
1986
|
+
(update, index) => `key` in update ? /* @__PURE__ */ jsxRuntime.jsxs(react.Fragment, { children: [
|
|
1987
|
+
index === timeline.at ? /* @__PURE__ */ jsxRuntime.jsx(YouAreHere, {}) : null,
|
|
1988
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1989
|
+
article.TimelineUpdate,
|
|
1990
|
+
{
|
|
1991
|
+
timelineUpdate: update,
|
|
1992
|
+
serialNumber: index
|
|
1993
|
+
}
|
|
1994
|
+
),
|
|
1995
|
+
index === timeline.history.length - 1 && timeline.at === timeline.history.length ? /* @__PURE__ */ jsxRuntime.jsx(YouAreHere, {}) : null
|
|
1996
|
+
] }, update.key + index + timeline.at) : null
|
|
1997
|
+
) }) : null
|
|
1986
1998
|
] });
|
|
1987
1999
|
};
|
|
1988
2000
|
var TimelineIndex = () => {
|
|
@@ -1992,8 +2004,8 @@ var TimelineIndex = () => {
|
|
|
1992
2004
|
TimelineLog,
|
|
1993
2005
|
{
|
|
1994
2006
|
token,
|
|
1995
|
-
isOpenState:
|
|
1996
|
-
timelineState:
|
|
2007
|
+
isOpenState: ephemeral.findState(findViewIsOpenState, token.key),
|
|
2008
|
+
timelineState: ephemeral.findState(findTimelineState, token.key)
|
|
1997
2009
|
},
|
|
1998
2010
|
token.key
|
|
1999
2011
|
);
|
|
@@ -2046,8 +2058,8 @@ var TransactionIndex = () => {
|
|
|
2046
2058
|
TransactionLog,
|
|
2047
2059
|
{
|
|
2048
2060
|
token,
|
|
2049
|
-
isOpenState:
|
|
2050
|
-
logState:
|
|
2061
|
+
isOpenState: ephemeral.findState(findViewIsOpenState, token.key),
|
|
2062
|
+
logState: ephemeral.findState(findTransactionLogState, token.key)
|
|
2051
2063
|
},
|
|
2052
2064
|
token.key
|
|
2053
2065
|
);
|
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
import { pipe, ifDefined, isArray, isRecord, doesExtend, isPlainObject, raiseError, sprawl, fallback, doNothing, become, mapObject, delve } from '../../dist/chunk-3V3VWQ7X.js';
|
|
2
2
|
import { lazyLocalStorageEffect } from '../../dist/chunk-BWWVY5O5.js';
|
|
3
|
-
import {
|
|
3
|
+
import { isString, isNumber, isBoolean } from '../../dist/chunk-6MLFYN32.js';
|
|
4
|
+
import { JSON_TYPE_NAMES, stringifyJson, JSON_DEFAULTS } from '../../dist/chunk-OAYGID5B.js';
|
|
4
5
|
import { __spreadProps, __spreadValues, __objRest, __restKey } from '../../dist/chunk-F2X4B4VY.js';
|
|
5
|
-
import { selectorFamily, atom, atomFamily,
|
|
6
|
+
import { selectorFamily, atom, atomFamily, undo, redo, getState } from 'atom.io';
|
|
6
7
|
import { attachIntrospectionStates } from 'atom.io/introspection';
|
|
7
8
|
import { useI, useO } from 'atom.io/react';
|
|
8
9
|
import { motion, spring, LayoutGroup } from 'framer-motion';
|
|
9
10
|
import { forwardRef, useRef, useState, useImperativeHandle, useLayoutEffect, Fragment as Fragment$1, Component, useId } from 'react';
|
|
11
|
+
import { findState } from 'atom.io/ephemeral';
|
|
10
12
|
import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
|
|
11
13
|
|
|
12
14
|
// ../anvl/src/refinement/can-exist.ts
|
|
@@ -1620,25 +1622,28 @@ var TransactionUpdateFC = ({ serialNumber, transactionUpdate }) => {
|
|
|
1620
1622
|
] }),
|
|
1621
1623
|
/* @__PURE__ */ jsxs("section", { className: "transaction_impact", children: [
|
|
1622
1624
|
/* @__PURE__ */ jsx("span", { className: "detail", children: "impact: " }),
|
|
1623
|
-
transactionUpdate.updates.filter((token) => !token.key.startsWith(`\u{1F441}\u200D\u{1F5E8}`)).map((update, index) => {
|
|
1624
|
-
|
|
1625
|
-
|
|
1626
|
-
|
|
1627
|
-
|
|
1628
|
-
|
|
1629
|
-
|
|
1630
|
-
|
|
1631
|
-
|
|
1632
|
-
|
|
1625
|
+
transactionUpdate.updates.filter((token) => `key` in token && !token.key.startsWith(`\u{1F441}\u200D\u{1F5E8}`)).map((update, index) => {
|
|
1626
|
+
switch (update.type) {
|
|
1627
|
+
case `atom_update`:
|
|
1628
|
+
case `selector_update`:
|
|
1629
|
+
return /* @__PURE__ */ jsx(
|
|
1630
|
+
article.AtomUpdate,
|
|
1631
|
+
{
|
|
1632
|
+
serialNumber: index,
|
|
1633
|
+
atomUpdate: update
|
|
1634
|
+
},
|
|
1635
|
+
`${transactionUpdate.key}:${index}:${update.key}`
|
|
1636
|
+
);
|
|
1637
|
+
case `transaction_update`:
|
|
1638
|
+
return /* @__PURE__ */ jsx(
|
|
1639
|
+
TransactionUpdateFC,
|
|
1640
|
+
{
|
|
1641
|
+
serialNumber: index,
|
|
1642
|
+
transactionUpdate: update
|
|
1643
|
+
},
|
|
1644
|
+
`${transactionUpdate.key}:${index}:${update.key}`
|
|
1645
|
+
);
|
|
1633
1646
|
}
|
|
1634
|
-
return /* @__PURE__ */ jsx(
|
|
1635
|
-
TransactionUpdateFC,
|
|
1636
|
-
{
|
|
1637
|
-
serialNumber: index,
|
|
1638
|
-
transactionUpdate: update
|
|
1639
|
-
},
|
|
1640
|
-
`${transactionUpdate.key}:${index}:${update.key}`
|
|
1641
|
-
);
|
|
1642
1647
|
})
|
|
1643
1648
|
] })
|
|
1644
1649
|
] })
|
|
@@ -1647,7 +1652,7 @@ var TransactionUpdateFC = ({ serialNumber, transactionUpdate }) => {
|
|
|
1647
1652
|
);
|
|
1648
1653
|
};
|
|
1649
1654
|
var TimelineUpdateFC = ({ timelineUpdate, serialNumber }) => {
|
|
1650
|
-
return /* @__PURE__ */ jsxs(
|
|
1655
|
+
return `key` in timelineUpdate ? /* @__PURE__ */ jsxs(
|
|
1651
1656
|
"article",
|
|
1652
1657
|
{
|
|
1653
1658
|
className: "node timeline_update",
|
|
@@ -1661,22 +1666,28 @@ var TimelineUpdateFC = ({ timelineUpdate, serialNumber }) => {
|
|
|
1661
1666
|
timelineUpdate.key,
|
|
1662
1667
|
")"
|
|
1663
1668
|
] }) }),
|
|
1664
|
-
/* @__PURE__ */ jsx("main", { children: timelineUpdate.type === `transaction_update` ? timelineUpdate.updates.filter((token) => !token.key.startsWith(`\u{1F441}\u200D\u{1F5E8}`)).map((update, index) => {
|
|
1665
|
-
|
|
1666
|
-
|
|
1667
|
-
|
|
1668
|
-
|
|
1669
|
-
|
|
1670
|
-
|
|
1671
|
-
|
|
1672
|
-
|
|
1673
|
-
|
|
1674
|
-
|
|
1675
|
-
|
|
1676
|
-
|
|
1677
|
-
|
|
1678
|
-
|
|
1679
|
-
|
|
1669
|
+
/* @__PURE__ */ jsx("main", { children: timelineUpdate.type === `transaction_update` ? timelineUpdate.updates.filter((token) => `key` in token && !token.key.startsWith(`\u{1F441}\u200D\u{1F5E8}`)).map((update, index) => {
|
|
1670
|
+
switch (update.type) {
|
|
1671
|
+
case `atom_update`:
|
|
1672
|
+
case `selector_update`:
|
|
1673
|
+
return /* @__PURE__ */ jsx(
|
|
1674
|
+
article.AtomUpdate,
|
|
1675
|
+
{
|
|
1676
|
+
serialNumber: index,
|
|
1677
|
+
atomUpdate: update
|
|
1678
|
+
},
|
|
1679
|
+
`${timelineUpdate.key}:${index}:${update.key}`
|
|
1680
|
+
);
|
|
1681
|
+
case `transaction_update`:
|
|
1682
|
+
return /* @__PURE__ */ jsx(
|
|
1683
|
+
TransactionUpdateFC,
|
|
1684
|
+
{
|
|
1685
|
+
serialNumber: index,
|
|
1686
|
+
transactionUpdate: update
|
|
1687
|
+
},
|
|
1688
|
+
`${timelineUpdate.key}:${index}:${update.key}`
|
|
1689
|
+
);
|
|
1690
|
+
}
|
|
1680
1691
|
}) : timelineUpdate.type === `selector_update` ? timelineUpdate.atomUpdates.filter((token) => !token.key.startsWith(`\u{1F441}\u200D\u{1F5E8}`)).map((atomUpdate, index) => {
|
|
1681
1692
|
return /* @__PURE__ */ jsx(
|
|
1682
1693
|
article.AtomUpdate,
|
|
@@ -1695,7 +1706,7 @@ var TimelineUpdateFC = ({ timelineUpdate, serialNumber }) => {
|
|
|
1695
1706
|
) : null })
|
|
1696
1707
|
]
|
|
1697
1708
|
}
|
|
1698
|
-
);
|
|
1709
|
+
) : null;
|
|
1699
1710
|
};
|
|
1700
1711
|
var article = {
|
|
1701
1712
|
AtomUpdate: AtomUpdateFC,
|
|
@@ -1755,17 +1766,19 @@ var TimelineLog = ({ token, isOpenState, timelineState }) => {
|
|
|
1755
1766
|
] })
|
|
1756
1767
|
] })
|
|
1757
1768
|
] }),
|
|
1758
|
-
isOpen ? /* @__PURE__ */ jsx("main", { children: timeline.history.map(
|
|
1759
|
-
index
|
|
1760
|
-
|
|
1761
|
-
|
|
1762
|
-
|
|
1763
|
-
|
|
1764
|
-
|
|
1765
|
-
|
|
1766
|
-
|
|
1767
|
-
|
|
1768
|
-
|
|
1769
|
+
isOpen ? /* @__PURE__ */ jsx("main", { children: timeline.history.map(
|
|
1770
|
+
(update, index) => `key` in update ? /* @__PURE__ */ jsxs(Fragment$1, { children: [
|
|
1771
|
+
index === timeline.at ? /* @__PURE__ */ jsx(YouAreHere, {}) : null,
|
|
1772
|
+
/* @__PURE__ */ jsx(
|
|
1773
|
+
article.TimelineUpdate,
|
|
1774
|
+
{
|
|
1775
|
+
timelineUpdate: update,
|
|
1776
|
+
serialNumber: index
|
|
1777
|
+
}
|
|
1778
|
+
),
|
|
1779
|
+
index === timeline.history.length - 1 && timeline.at === timeline.history.length ? /* @__PURE__ */ jsx(YouAreHere, {}) : null
|
|
1780
|
+
] }, update.key + index + timeline.at) : null
|
|
1781
|
+
) }) : null
|
|
1769
1782
|
] });
|
|
1770
1783
|
};
|
|
1771
1784
|
var TimelineIndex = () => {
|
|
@@ -3,7 +3,8 @@ import type {
|
|
|
3
3
|
ReadonlySelectorToken,
|
|
4
4
|
RegularAtomToken,
|
|
5
5
|
} from "atom.io"
|
|
6
|
-
import {
|
|
6
|
+
import { getState, selectorFamily } from "atom.io"
|
|
7
|
+
import { findState } from "atom.io/ephemeral"
|
|
7
8
|
import type { FamilyNode, WritableTokenIndex } from "atom.io/introspection"
|
|
8
9
|
import { useI, useO } from "atom.io/react"
|
|
9
10
|
import type { FC } from "react"
|
|
@@ -3,7 +3,8 @@ import type {
|
|
|
3
3
|
RegularAtomToken,
|
|
4
4
|
TimelineToken,
|
|
5
5
|
} from "atom.io"
|
|
6
|
-
import {
|
|
6
|
+
import { redo, undo } from "atom.io"
|
|
7
|
+
import { findState } from "atom.io/ephemeral"
|
|
7
8
|
import type { Timeline } from "atom.io/internal"
|
|
8
9
|
import { useI, useO } from "atom.io/react"
|
|
9
10
|
import { type FC, Fragment } from "react"
|
|
@@ -63,19 +64,21 @@ export const TimelineLog: FC<{
|
|
|
63
64
|
</header>
|
|
64
65
|
{isOpen ? (
|
|
65
66
|
<main>
|
|
66
|
-
{timeline.history.map((update, index) =>
|
|
67
|
-
|
|
68
|
-
{index
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
67
|
+
{timeline.history.map((update, index) =>
|
|
68
|
+
`key` in update ? (
|
|
69
|
+
<Fragment key={update.key + index + timeline.at}>
|
|
70
|
+
{index === timeline.at ? <YouAreHere /> : null}
|
|
71
|
+
<article.TimelineUpdate
|
|
72
|
+
timelineUpdate={update}
|
|
73
|
+
serialNumber={index}
|
|
74
|
+
/>
|
|
75
|
+
{index === timeline.history.length - 1 &&
|
|
76
|
+
timeline.at === timeline.history.length ? (
|
|
77
|
+
<YouAreHere />
|
|
78
|
+
) : null}
|
|
79
|
+
</Fragment>
|
|
80
|
+
) : null,
|
|
81
|
+
)}
|
|
79
82
|
</main>
|
|
80
83
|
) : null}
|
|
81
84
|
</section>
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
type TransactionUpdate,
|
|
1
|
+
import type {
|
|
2
|
+
Func,
|
|
3
|
+
ReadonlySelectorToken,
|
|
4
|
+
RegularAtomToken,
|
|
5
|
+
TransactionToken,
|
|
6
|
+
TransactionUpdate,
|
|
8
7
|
} from "atom.io"
|
|
8
|
+
import { findState } from "atom.io/ephemeral"
|
|
9
9
|
import { useI, useO } from "atom.io/react"
|
|
10
10
|
import type { FC } from "react"
|
|
11
11
|
|
|
@@ -91,24 +91,27 @@ const TransactionUpdateFC: React.FC<{
|
|
|
91
91
|
<section className="transaction_impact">
|
|
92
92
|
<span className="detail">impact: </span>
|
|
93
93
|
{transactionUpdate.updates
|
|
94
|
-
.filter((token) => !token.key.startsWith(`👁🗨`))
|
|
94
|
+
.filter((token) => `key` in token && !token.key.startsWith(`👁🗨`))
|
|
95
95
|
.map((update, index) => {
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
96
|
+
switch (update.type) {
|
|
97
|
+
case `atom_update`:
|
|
98
|
+
case `selector_update`:
|
|
99
|
+
return (
|
|
100
|
+
<article.AtomUpdate
|
|
101
|
+
key={`${transactionUpdate.key}:${index}:${update.key}`}
|
|
102
|
+
serialNumber={index}
|
|
103
|
+
atomUpdate={update}
|
|
104
|
+
/>
|
|
105
|
+
)
|
|
106
|
+
case `transaction_update`:
|
|
107
|
+
return (
|
|
108
|
+
<TransactionUpdateFC
|
|
109
|
+
key={`${transactionUpdate.key}:${index}:${update.key}`}
|
|
110
|
+
serialNumber={index}
|
|
111
|
+
transactionUpdate={update}
|
|
112
|
+
/>
|
|
113
|
+
)
|
|
104
114
|
}
|
|
105
|
-
return (
|
|
106
|
-
<TransactionUpdateFC
|
|
107
|
-
key={`${transactionUpdate.key}:${index}:${update.key}`}
|
|
108
|
-
serialNumber={index}
|
|
109
|
-
transactionUpdate={update}
|
|
110
|
-
/>
|
|
111
|
-
)
|
|
112
115
|
})}
|
|
113
116
|
</section>
|
|
114
117
|
</main>
|
|
@@ -120,7 +123,7 @@ export const TimelineUpdateFC: React.FC<{
|
|
|
120
123
|
timelineUpdate: TimelineUpdate<any>
|
|
121
124
|
serialNumber: number
|
|
122
125
|
}> = ({ timelineUpdate, serialNumber }) => {
|
|
123
|
-
return (
|
|
126
|
+
return `key` in timelineUpdate ? (
|
|
124
127
|
<article
|
|
125
128
|
className="node timeline_update"
|
|
126
129
|
data-testid={`timeline-update-${timelineUpdate.key}-${serialNumber}`}
|
|
@@ -134,21 +137,27 @@ export const TimelineUpdateFC: React.FC<{
|
|
|
134
137
|
<main>
|
|
135
138
|
{timelineUpdate.type === `transaction_update` ? (
|
|
136
139
|
timelineUpdate.updates
|
|
137
|
-
.filter((token) => !token.key.startsWith(`👁🗨`))
|
|
140
|
+
.filter((token) => `key` in token && !token.key.startsWith(`👁🗨`))
|
|
138
141
|
.map((update, index) => {
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
142
|
+
switch (update.type) {
|
|
143
|
+
case `atom_update`:
|
|
144
|
+
case `selector_update`:
|
|
145
|
+
return (
|
|
146
|
+
<article.AtomUpdate
|
|
147
|
+
key={`${timelineUpdate.key}:${index}:${update.key}`}
|
|
148
|
+
serialNumber={index}
|
|
149
|
+
atomUpdate={update}
|
|
150
|
+
/>
|
|
151
|
+
)
|
|
152
|
+
case `transaction_update`:
|
|
153
|
+
return (
|
|
154
|
+
<TransactionUpdateFC
|
|
155
|
+
key={`${timelineUpdate.key}:${index}:${update.key}`}
|
|
156
|
+
serialNumber={index}
|
|
157
|
+
transactionUpdate={update}
|
|
158
|
+
/>
|
|
159
|
+
)
|
|
160
|
+
}
|
|
152
161
|
})
|
|
153
162
|
) : timelineUpdate.type === `selector_update` ? (
|
|
154
163
|
timelineUpdate.atomUpdates
|
|
@@ -170,7 +179,7 @@ export const TimelineUpdateFC: React.FC<{
|
|
|
170
179
|
) : null}
|
|
171
180
|
</main>
|
|
172
181
|
</article>
|
|
173
|
-
)
|
|
182
|
+
) : null
|
|
174
183
|
}
|
|
175
184
|
|
|
176
185
|
export const article = {
|
|
@@ -56,7 +56,7 @@ function pullAtomFamilyMember(token, socket, store) {
|
|
|
56
56
|
};
|
|
57
57
|
}
|
|
58
58
|
function pullMutableAtom(token, socket, store) {
|
|
59
|
-
const jsonToken = Internal.getJsonToken(token);
|
|
59
|
+
const jsonToken = Internal.getJsonToken(token, store);
|
|
60
60
|
const updateToken = Internal.getUpdateToken(token);
|
|
61
61
|
socket.on(`init:${token.key}`, (data) => {
|
|
62
62
|
Internal.setIntoStore(jsonToken, data, store);
|
|
@@ -83,7 +83,7 @@ function pullMutableAtomFamilyMember(token, socket, store) {
|
|
|
83
83
|
const { key: familyKey, subKey: serializedSubKey } = token.family;
|
|
84
84
|
const subKey = json.parseJson(serializedSubKey);
|
|
85
85
|
socket.on(`init:${token.key}`, (data) => {
|
|
86
|
-
const jsonToken = Internal.getJsonToken(token);
|
|
86
|
+
const jsonToken = Internal.getJsonToken(token, store);
|
|
87
87
|
Internal.setIntoStore(jsonToken, data, store);
|
|
88
88
|
});
|
|
89
89
|
socket.on(
|
|
@@ -246,7 +246,7 @@ function syncContinuity(continuity, socket, store) {
|
|
|
246
246
|
} else {
|
|
247
247
|
v = x;
|
|
248
248
|
if (`type` in k && k.type === `mutable_atom`) {
|
|
249
|
-
k = Internal.getJsonToken(k);
|
|
249
|
+
k = Internal.getJsonToken(k, store);
|
|
250
250
|
}
|
|
251
251
|
Internal.setIntoStore(k, v, store);
|
|
252
252
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { syncContinuity } from '../../dist/chunk-
|
|
1
|
+
export { syncContinuity } from '../../dist/chunk-GVHKIJ3G.js';
|
|
2
2
|
export { confirmedUpdateQueue, myIdState, myIdState__INTERNAL, myUsernameState, optimisticUpdateQueue } from '../../dist/chunk-O47EQUM6.js';
|
|
3
3
|
import '../../dist/chunk-BWWVY5O5.js';
|
|
4
4
|
import '../../dist/chunk-F2X4B4VY.js';
|
|
@@ -35,7 +35,7 @@ function pullAtomFamilyMember(token, socket, store) {
|
|
|
35
35
|
};
|
|
36
36
|
}
|
|
37
37
|
function pullMutableAtom(token, socket, store) {
|
|
38
|
-
const jsonToken = getJsonToken(token);
|
|
38
|
+
const jsonToken = getJsonToken(token, store);
|
|
39
39
|
const updateToken = getUpdateToken(token);
|
|
40
40
|
socket.on(`init:${token.key}`, (data) => {
|
|
41
41
|
setIntoStore(jsonToken, data, store);
|
|
@@ -62,7 +62,7 @@ function pullMutableAtomFamilyMember(token, socket, store) {
|
|
|
62
62
|
const { key: familyKey, subKey: serializedSubKey } = token.family;
|
|
63
63
|
const subKey = parseJson(serializedSubKey);
|
|
64
64
|
socket.on(`init:${token.key}`, (data) => {
|
|
65
|
-
const jsonToken = getJsonToken(token);
|
|
65
|
+
const jsonToken = getJsonToken(token, store);
|
|
66
66
|
setIntoStore(jsonToken, data, store);
|
|
67
67
|
});
|
|
68
68
|
socket.on(
|
|
@@ -20,7 +20,7 @@ export function pullMutableAtomFamilyMember<
|
|
|
20
20
|
const { key: familyKey, subKey: serializedSubKey } = token.family
|
|
21
21
|
const subKey = parseJson(serializedSubKey)
|
|
22
22
|
socket.on(`init:${token.key}`, (data: J) => {
|
|
23
|
-
const jsonToken = getJsonToken(token)
|
|
23
|
+
const jsonToken = getJsonToken(token, store)
|
|
24
24
|
setIntoStore(jsonToken, data, store)
|
|
25
25
|
})
|
|
26
26
|
socket.on(
|
|
@@ -12,7 +12,7 @@ export function pullMutableAtom<
|
|
|
12
12
|
socket: Socket,
|
|
13
13
|
store: Store,
|
|
14
14
|
): () => void {
|
|
15
|
-
const jsonToken = getJsonToken(token)
|
|
15
|
+
const jsonToken = getJsonToken(token, store)
|
|
16
16
|
const updateToken = getUpdateToken(token)
|
|
17
17
|
socket.on(`init:${token.key}`, (data: J) => {
|
|
18
18
|
setIntoStore(jsonToken, data, store)
|
|
@@ -40,9 +40,8 @@ export function syncContinuity<F extends AtomIO.Func>(
|
|
|
40
40
|
k = x
|
|
41
41
|
} else {
|
|
42
42
|
v = x
|
|
43
|
-
// console.log(`❗❗❗❗❗`, k, v)
|
|
44
43
|
if (`type` in k && k.type === `mutable_atom`) {
|
|
45
|
-
k = getJsonToken(k)
|
|
44
|
+
k = getJsonToken(k, store)
|
|
46
45
|
}
|
|
47
46
|
setIntoStore(k, v, store)
|
|
48
47
|
}
|
|
@@ -184,7 +184,7 @@ function syncContinuity(continuity, socket, store) {
|
|
|
184
184
|
} else {
|
|
185
185
|
v = x;
|
|
186
186
|
if (`type` in k && k.type === `mutable_atom`) {
|
|
187
|
-
k = internal.getJsonToken(k);
|
|
187
|
+
k = internal.getJsonToken(k, store);
|
|
188
188
|
}
|
|
189
189
|
internal.setIntoStore(k, v, store);
|
|
190
190
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { syncContinuity } from '../../dist/chunk-
|
|
1
|
+
import { syncContinuity } from '../../dist/chunk-GVHKIJ3G.js';
|
|
2
2
|
import '../../dist/chunk-F2X4B4VY.js';
|
|
3
3
|
import { useI, StoreContext, useO } from 'atom.io/react';
|
|
4
4
|
import * as RTC from 'atom.io/realtime-client';
|