atom.io 0.5.0 → 0.6.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/dist/index.d.mts +82 -66
- package/dist/index.d.ts +82 -66
- package/dist/index.js +482 -360
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +481 -360
- 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 +12 -5
- package/react/dist/index.d.mts +18 -11
- package/react/dist/index.d.ts +18 -11
- package/react/dist/index.js +45 -21
- package/react/dist/index.js.map +1 -1
- package/react/dist/index.mjs +31 -21
- package/react/dist/index.mjs.map +1 -1
- package/react-devtools/dist/index.d.mts +4 -4
- package/react-devtools/dist/index.d.ts +4 -4
- package/react-devtools/dist/index.js +14 -14
- package/react-devtools/dist/index.js.map +1 -1
- package/react-devtools/dist/index.mjs +14 -14
- package/react-devtools/dist/index.mjs.map +1 -1
- package/realtime/dist/index.d.mts +3 -1
- package/realtime/dist/index.d.ts +3 -1
- package/realtime/dist/index.js +23 -0
- package/realtime/dist/index.js.map +1 -1
- package/realtime/dist/index.mjs +22 -0
- package/realtime/dist/index.mjs.map +1 -1
- package/realtime-react/dist/index.d.mts +45 -0
- package/realtime-react/dist/index.d.ts +45 -0
- package/realtime-react/dist/index.js +213 -0
- package/realtime-react/dist/index.js.map +1 -0
- package/realtime-react/dist/index.mjs +168 -0
- package/realtime-react/dist/index.mjs.map +1 -0
- package/realtime-react/package.json +15 -0
- package/src/index.ts +0 -6
- package/src/internal/get.ts +17 -3
- package/src/internal/index.ts +2 -0
- package/src/internal/meta/meta-state.ts +1 -1
- package/src/internal/operation.ts +3 -1
- package/src/internal/selector/create-read-write-selector.ts +62 -0
- package/src/internal/selector/create-readonly-selector.ts +52 -0
- package/src/internal/selector/index.ts +4 -0
- package/src/internal/selector/lookup-selector-sources.ts +16 -0
- package/src/internal/selector/register-selector.ts +57 -0
- package/src/internal/selector/trace-selector-atoms.ts +43 -0
- package/src/internal/selector/update-selector-atoms.ts +33 -0
- package/src/internal/selector-internal.ts +9 -207
- package/src/internal/store.ts +43 -16
- package/src/internal/subscribe-internal.ts +1 -1
- package/src/internal/time-travel-internal.ts +7 -7
- package/src/internal/timeline/add-atom-to-timeline.ts +164 -0
- package/src/internal/timeline/index.ts +1 -0
- package/src/internal/timeline-internal.ts +37 -156
- package/src/internal/transaction/abort-transaction.ts +12 -0
- package/src/internal/transaction/apply-transaction.ts +54 -0
- package/src/internal/transaction/build-transaction.ts +33 -0
- package/src/internal/transaction/index.ts +25 -0
- package/src/internal/transaction/redo-transaction.ts +23 -0
- package/src/internal/transaction/undo-transaction.ts +23 -0
- package/src/internal/transaction-internal.ts +14 -146
- package/src/react/index.ts +2 -46
- package/src/react/store-context.tsx +14 -0
- package/src/react/store-hooks.ts +48 -0
- package/src/react-devtools/AtomIODevtools.tsx +1 -1
- package/src/react-explorer/AtomIOExplorer.tsx +2 -2
- package/src/react-explorer/space-states.ts +2 -2
- package/src/realtime/README.md +33 -0
- package/src/realtime/hook-composition/index.ts +1 -0
- package/src/realtime/hook-composition/receive-state.ts +29 -0
- package/src/realtime/hook-composition/receive-transaction.ts +2 -3
- package/src/realtime-react/index.ts +3 -0
- package/src/realtime-react/realtime-context.tsx +31 -0
- package/src/realtime-react/realtime-hooks.ts +39 -0
- package/src/realtime-react/realtime-state.ts +10 -0
- package/src/realtime-react/use-pull-family-member.ts +27 -0
- package/src/realtime-react/use-pull-family.ts +25 -0
- package/src/realtime-react/use-pull.ts +23 -0
- package/src/realtime-react/use-push.ts +26 -0
- package/src/realtime-react/use-server-action.ts +34 -0
- package/src/silo.ts +12 -4
- package/src/subscribe.ts +30 -2
- package/src/timeline.ts +10 -0
- package/src/transaction.ts +15 -10
- package/src/realtime-client/hook-composition/compose-realtime-hooks.ts +0 -62
- package/src/realtime-client/hook-composition/realtime-client-family-member.ts +0 -28
- package/src/realtime-client/hook-composition/realtime-client-family.ts +0 -26
- package/src/realtime-client/hook-composition/realtime-client-single.ts +0 -24
- package/src/realtime-client/hook-composition/realtime-client-transaction.ts +0 -35
- package/src/realtime-client/index.ts +0 -1
|
@@ -184,7 +184,7 @@ import {
|
|
|
184
184
|
useRef,
|
|
185
185
|
useState
|
|
186
186
|
} from "react";
|
|
187
|
-
import { jsx, jsxs } from "
|
|
187
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
188
188
|
var ElasticInput = forwardRef(function ElasticInputFC(props, ref) {
|
|
189
189
|
var _a2, _b, _c, _d;
|
|
190
190
|
const inputRef = useRef(null);
|
|
@@ -250,7 +250,7 @@ import { pipe as pipe5 } from "fp-ts/function";
|
|
|
250
250
|
var clampInto = ([min, max]) => (value) => value < min ? min : value > max ? max : value;
|
|
251
251
|
|
|
252
252
|
// ../../hamr/src/react-elastic-input/NumberInput.tsx
|
|
253
|
-
import { jsx as jsx2, jsxs as jsxs2 } from "
|
|
253
|
+
import { jsx as jsx2, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
254
254
|
function round(value, decimalPlaces) {
|
|
255
255
|
if (decimalPlaces === void 0)
|
|
256
256
|
return value;
|
|
@@ -381,7 +381,7 @@ var NumberInput = ({
|
|
|
381
381
|
};
|
|
382
382
|
|
|
383
383
|
// ../../hamr/src/react-elastic-input/TextInput.tsx
|
|
384
|
-
import { jsx as jsx3, jsxs as jsxs3 } from "
|
|
384
|
+
import { jsx as jsx3, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
385
385
|
var TextInput = ({
|
|
386
386
|
value,
|
|
387
387
|
set,
|
|
@@ -424,7 +424,7 @@ var makeElementSetters = (data, set) => data.map(
|
|
|
424
424
|
);
|
|
425
425
|
|
|
426
426
|
// ../../hamr/src/react-json-editor/json-editor-internal.tsx
|
|
427
|
-
import { jsx as jsx4, jsxs as jsxs4 } from "
|
|
427
|
+
import { jsx as jsx4, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
428
428
|
var JsonEditor_INTERNAL = ({
|
|
429
429
|
data,
|
|
430
430
|
set,
|
|
@@ -489,7 +489,7 @@ var JsonEditor_INTERNAL = ({
|
|
|
489
489
|
};
|
|
490
490
|
|
|
491
491
|
// ../../hamr/src/react-json-editor/editors-by-type/array-editor.tsx
|
|
492
|
-
import { Fragment, jsx as jsx5 } from "
|
|
492
|
+
import { Fragment, jsx as jsx5 } from "react/jsx-runtime";
|
|
493
493
|
var ArrayEditor = ({
|
|
494
494
|
path = [],
|
|
495
495
|
isReadonly = () => false,
|
|
@@ -1079,7 +1079,7 @@ var makePropertySorter = (data, set, sortFn) => () => {
|
|
|
1079
1079
|
};
|
|
1080
1080
|
|
|
1081
1081
|
// ../../hamr/src/react-json-editor/editors-by-type/object-editor.tsx
|
|
1082
|
-
import { Fragment as Fragment2, jsx as jsx6, jsxs as jsxs5 } from "
|
|
1082
|
+
import { Fragment as Fragment2, jsx as jsx6, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
1083
1083
|
var PropertyAdder = ({
|
|
1084
1084
|
addProperty,
|
|
1085
1085
|
disabled,
|
|
@@ -1174,7 +1174,7 @@ var ObjectEditor = ({
|
|
|
1174
1174
|
};
|
|
1175
1175
|
|
|
1176
1176
|
// ../../hamr/src/react-json-editor/editors-by-type/primitive-editors.tsx
|
|
1177
|
-
import { jsx as jsx7 } from "
|
|
1177
|
+
import { jsx as jsx7 } from "react/jsx-runtime";
|
|
1178
1178
|
var BooleanEditor = ({
|
|
1179
1179
|
data,
|
|
1180
1180
|
set
|
|
@@ -1222,7 +1222,7 @@ import { useId as useId2, Component } from "react";
|
|
|
1222
1222
|
import { atomFamily, useRecoilState, useResetRecoilState } from "recoil";
|
|
1223
1223
|
|
|
1224
1224
|
// ../../hamr/src/react-error-boundary/DefaultFallback.tsx
|
|
1225
|
-
import { jsx as jsx8, jsxs as jsxs6 } from "
|
|
1225
|
+
import { jsx as jsx8, jsxs as jsxs6 } from "react/jsx-runtime";
|
|
1226
1226
|
var DefaultFallback = ({ error, errorInfo }) => {
|
|
1227
1227
|
var _a2, _b;
|
|
1228
1228
|
const component = errorInfo == null ? void 0 : errorInfo.componentStack.split(` `).filter(Boolean)[2];
|
|
@@ -1272,7 +1272,7 @@ var DefaultFallback = ({ error, errorInfo }) => {
|
|
|
1272
1272
|
};
|
|
1273
1273
|
|
|
1274
1274
|
// ../../hamr/src/react-error-boundary/ErrorBoundary.tsx
|
|
1275
|
-
import { jsx as jsx9, jsxs as jsxs7 } from "
|
|
1275
|
+
import { jsx as jsx9, jsxs as jsxs7 } from "react/jsx-runtime";
|
|
1276
1276
|
var ErrorBoundary = class extends Component {
|
|
1277
1277
|
constructor(props) {
|
|
1278
1278
|
super(props);
|
|
@@ -1298,7 +1298,7 @@ var findErrorBoundaryState = atomFamily({
|
|
|
1298
1298
|
});
|
|
1299
1299
|
|
|
1300
1300
|
// ../../hamr/src/react-json-editor/default-components.tsx
|
|
1301
|
-
import { jsx as jsx10, jsxs as jsxs8 } from "
|
|
1301
|
+
import { jsx as jsx10, jsxs as jsxs8 } from "react/jsx-runtime";
|
|
1302
1302
|
var DEFAULT_JSON_EDITOR_COMPONENTS = {
|
|
1303
1303
|
ErrorBoundary: ({ children }) => /* @__PURE__ */ jsx10(ErrorBoundary, { children }),
|
|
1304
1304
|
Button: ({ onClick, children, disabled }) => /* @__PURE__ */ jsx10("button", { className: "json_editor_button", onClick, disabled, children }),
|
|
@@ -1337,7 +1337,7 @@ var DEFAULT_JSON_EDITOR_COMPONENTS = {
|
|
|
1337
1337
|
// ../../hamr/src/react-json-editor/developer-interface.tsx
|
|
1338
1338
|
import { useMemo } from "react";
|
|
1339
1339
|
import Ajv from "ajv";
|
|
1340
|
-
import { jsx as jsx11 } from "
|
|
1340
|
+
import { jsx as jsx11 } from "react/jsx-runtime";
|
|
1341
1341
|
var JsonEditor = ({
|
|
1342
1342
|
data,
|
|
1343
1343
|
set,
|
|
@@ -1390,7 +1390,7 @@ var SubEditors = {
|
|
|
1390
1390
|
};
|
|
1391
1391
|
|
|
1392
1392
|
// ../src/react-devtools/StateEditor.tsx
|
|
1393
|
-
import { jsx as jsx12 } from "
|
|
1393
|
+
import { jsx as jsx12 } from "react/jsx-runtime";
|
|
1394
1394
|
var StateEditor = ({ storeHooks, token }) => {
|
|
1395
1395
|
const [data, set] = storeHooks.useIO(token);
|
|
1396
1396
|
return isPlainJson(data) ? /* @__PURE__ */ jsx12(JsonEditor, { data, set, schema: true }) : /* @__PURE__ */ jsx12("div", { className: "json_editor", children: /* @__PURE__ */ jsx12(
|
|
@@ -1427,7 +1427,7 @@ var StoreEditor = ({ storeHooks, token }) => {
|
|
|
1427
1427
|
};
|
|
1428
1428
|
|
|
1429
1429
|
// ../src/react-devtools/TokenList.tsx
|
|
1430
|
-
import { Fragment as Fragment4, jsx as jsx13, jsxs as jsxs9 } from "
|
|
1430
|
+
import { Fragment as Fragment4, jsx as jsx13, jsxs as jsxs9 } from "react/jsx-runtime";
|
|
1431
1431
|
var TokenList = ({ storeHooks, tokenIndex }) => {
|
|
1432
1432
|
const tokenIds = storeHooks.useO(tokenIndex);
|
|
1433
1433
|
return /* @__PURE__ */ jsx13(Fragment4, { children: Object.entries(tokenIds).map(([key, token]) => /* @__PURE__ */ jsx13(Fragment3, { children: key.startsWith(`\u{1F441}\u200D\u{1F5E8}_`) ? null : /* @__PURE__ */ jsx13("div", { className: "node", children: `type` in token ? /* @__PURE__ */ jsxs9(Fragment4, { children: [
|
|
@@ -1459,7 +1459,7 @@ var persistAtom = (storage) => ({ stringify, parse }) => (key) => ({ setSelf, on
|
|
|
1459
1459
|
var lazyLocalStorageEffect = persistAtom(localStorage)(JSON);
|
|
1460
1460
|
|
|
1461
1461
|
// ../src/react-devtools/AtomIODevtools.tsx
|
|
1462
|
-
import { Fragment as Fragment5, jsx as jsx14, jsxs as jsxs10 } from "
|
|
1462
|
+
import { Fragment as Fragment5, jsx as jsx14, jsxs as jsxs10 } from "react/jsx-runtime";
|
|
1463
1463
|
var { atomTokenIndexState, selectorTokenIndexState } = __INTERNAL__.META.attachMetaState();
|
|
1464
1464
|
var devtoolsAreOpenState = atom({
|
|
1465
1465
|
key: `\u{1F441}\u200D\u{1F5E8}_devtools_are_open`,
|