atom.io 0.33.5 → 0.33.7

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.
Files changed (59) hide show
  1. package/dist/data/index.d.ts +2 -4
  2. package/dist/data/index.d.ts.map +1 -1
  3. package/dist/eslint-plugin/index.d.ts +0 -1
  4. package/dist/eslint-plugin/index.d.ts.map +1 -1
  5. package/dist/internal/index.d.ts.map +1 -1
  6. package/dist/internal/index.js +2 -2
  7. package/dist/internal/index.js.map +1 -1
  8. package/dist/introspection/index.js +1 -1
  9. package/dist/introspection/index.js.map +1 -1
  10. package/dist/json/index.d.ts +1 -2
  11. package/dist/json/index.d.ts.map +1 -1
  12. package/dist/main/index.d.ts.map +1 -1
  13. package/dist/main/index.js +4 -6
  14. package/dist/main/index.js.map +1 -1
  15. package/dist/react/index.js +7 -11
  16. package/dist/react/index.js.map +1 -1
  17. package/dist/react-devtools/index.css +10 -7
  18. package/dist/react-devtools/index.css.map +1 -1
  19. package/dist/react-devtools/index.d.ts +1 -1
  20. package/dist/react-devtools/index.d.ts.map +1 -1
  21. package/dist/react-devtools/index.js +4 -3
  22. package/dist/react-devtools/index.js.map +1 -1
  23. package/dist/realtime/index.d.ts.map +1 -1
  24. package/dist/realtime/index.js.map +1 -1
  25. package/dist/realtime-client/index.d.ts +13 -24
  26. package/dist/realtime-client/index.d.ts.map +1 -1
  27. package/dist/realtime-client/index.js +4 -6
  28. package/dist/realtime-client/index.js.map +1 -1
  29. package/dist/realtime-react/index.d.ts +7 -14
  30. package/dist/realtime-react/index.d.ts.map +1 -1
  31. package/dist/realtime-react/index.js +23 -42
  32. package/dist/realtime-react/index.js.map +1 -1
  33. package/dist/realtime-server/index.d.ts +11 -16
  34. package/dist/realtime-server/index.d.ts.map +1 -1
  35. package/dist/realtime-server/index.js +1 -1
  36. package/dist/realtime-server/index.js.map +1 -1
  37. package/dist/realtime-testing/index.js +1 -1
  38. package/dist/realtime-testing/index.js.map +1 -1
  39. package/package.json +25 -16
  40. package/src/internal/families/dispose-from-store.ts +1 -1
  41. package/src/internal/mutable/create-mutable-atom.ts +2 -6
  42. package/src/internal/set-state/set-into-store.ts +1 -1
  43. package/src/internal/timeline/time-travel.ts +0 -2
  44. package/src/introspection/attach-type-selectors.ts +1 -1
  45. package/src/main/index.ts +2 -8
  46. package/src/react-devtools/AtomIODevtools.tsx +1 -0
  47. package/src/react-devtools/StateEditor.tsx +1 -5
  48. package/src/react-devtools/Updates.tsx +3 -5
  49. package/src/react-devtools/devtools.css +10 -7
  50. package/src/react-devtools/elastic-input/NumberInput.tsx +1 -1
  51. package/src/react-devtools/error-boundary/ReactErrorBoundary.tsx +1 -1
  52. package/src/react-devtools/json-editor/developer-interface.tsx +1 -1
  53. package/src/react-devtools/json-editor/editors-by-type/utilities/cast-json.ts +1 -1
  54. package/src/realtime/shared-room-store.ts +0 -3
  55. package/src/realtime-react/use-pull-selector.ts +0 -1
  56. package/src/realtime-react/use-single-effect.ts +2 -0
  57. package/src/realtime-server/continuity/prepare-to-sync-realtime-continuity.ts +1 -1
  58. package/src/realtime-server/continuity/subscribe-to-continuity-actions.ts +0 -2
  59. package/src/realtime-server/ipc-sockets/parent-socket.ts +1 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "atom.io",
3
- "version": "0.33.5",
3
+ "version": "0.33.7",
4
4
  "description": "Composable and testable reactive data library.",
5
5
  "homepage": "https://atom.io.fyi",
6
6
  "sideEffects": false,
@@ -60,27 +60,30 @@
60
60
  }
61
61
  },
62
62
  "devDependencies": {
63
- "@eslint/core": "0.15.0",
63
+ "@eslint/core": "0.15.1",
64
+ "@storybook/addon-docs": "9.0.13",
65
+ "@storybook/addon-onboarding": "9.0.13",
66
+ "@storybook/react-vite": "9.0.13",
64
67
  "@testing-library/react": "16.3.0",
65
- "@types/bun": "npm:bun-types@1.2.16",
68
+ "@types/bun": "npm:bun-types@1.2.17",
66
69
  "@types/eslint": "9.6.1",
67
70
  "@types/estree": "1.0.8",
68
71
  "@types/http-proxy": "1.17.16",
69
72
  "@types/npmlog": "7.0.0",
70
73
  "@types/react": "19.1.8",
71
74
  "@types/tmp": "0.2.6",
72
- "@typescript-eslint/parser": "8.34.0",
73
- "@typescript-eslint/rule-tester": "8.34.0",
74
- "@typescript-eslint/utils": "8.34.0",
75
- "@vitest/coverage-v8": "3.2.3",
76
- "@vitest/ui": "3.2.3",
77
- "concurrently": "9.1.2",
78
- "drizzle-kit": "0.31.1",
75
+ "@typescript-eslint/parser": "8.35.0",
76
+ "@typescript-eslint/rule-tester": "8.35.0",
77
+ "@typescript-eslint/utils": "8.35.0",
78
+ "@vitest/coverage-v8": "3.2.4",
79
+ "@vitest/ui": "3.2.4",
80
+ "concurrently": "9.2.0",
81
+ "drizzle-kit": "0.31.2",
79
82
  "drizzle-orm": "0.44.2",
80
83
  "eslint": "9.29.0",
81
84
  "happy-dom": "18.0.1",
82
85
  "http-proxy": "1.18.1",
83
- "motion": "12.18.1",
86
+ "motion": "12.19.1",
84
87
  "npmlog": "7.0.1",
85
88
  "nyc": "17.1.0",
86
89
  "postgres": "3.4.7",
@@ -91,14 +94,15 @@
91
94
  "recoverage": "0.1.11",
92
95
  "socket.io": "4.8.1",
93
96
  "socket.io-client": "4.8.1",
97
+ "storybook": "9.0.13",
94
98
  "tmp": "0.2.3",
95
- "tsdown": "0.12.7",
99
+ "tsdown": "0.12.9",
96
100
  "tsx": "4.20.3",
97
101
  "typescript": "5.8.3",
98
- "vite": "6.3.5",
102
+ "vite": "7.0.0",
99
103
  "vite-tsconfig-paths": "5.1.4",
100
- "vitest": "3.2.3",
101
- "zod": "3.25.64",
104
+ "vitest": "3.2.4",
105
+ "zod": "3.25.67",
102
106
  "break-check": "0.6.14"
103
107
  },
104
108
  "main": "./dist/main/index.js",
@@ -154,6 +158,9 @@
154
158
  "import": "./dist/react-devtools/index.js",
155
159
  "types": "./dist/react-devtools/index.d.ts"
156
160
  },
161
+ "./react-devtools/css": {
162
+ "import": "./dist/react-devtools/index.css"
163
+ },
157
164
  "./realtime": {
158
165
  "import": "./dist/realtime/index.js",
159
166
  "types": "./dist/realtime/index.d.ts"
@@ -200,6 +207,8 @@
200
207
  "test:once:public": "cross-env IMPORT=dist vitest run public",
201
208
  "test:manifest": "tsx __scripts__/manifest-test.node.ts",
202
209
  "test:semver": "break-check --verbose",
203
- "postversion": "biome format --write package.json"
210
+ "postversion": "biome format --write package.json",
211
+ "storybook": "storybook dev -p 6006",
212
+ "build-storybook": "storybook build"
204
213
  }
205
214
  }
@@ -31,7 +31,7 @@ export function disposeFromStore(
31
31
  }
32
32
  try {
33
33
  withdraw(store, token)
34
- } catch (thrown) {
34
+ } catch (_) {
35
35
  store.logger.error(
36
36
  `❌`,
37
37
  token.type,
@@ -7,12 +7,8 @@ import type {
7
7
  import type { Json } from "atom.io/json"
8
8
  import { selectJson } from "atom.io/json"
9
9
 
10
- import {
11
- cacheValue,
12
- type MutableAtom,
13
- prettyPrintTokenType,
14
- setIntoStore,
15
- } from ".."
10
+ import type { MutableAtom } from ".."
11
+ import { cacheValue, setIntoStore } from ".."
16
12
  import { markAtomAsDefault } from "../atom"
17
13
  import { newest } from "../lineage"
18
14
  import { deposit, type Store } from "../store"
@@ -1,5 +1,5 @@
1
1
  import type { WritableFamilyToken, WritableToken } from "atom.io"
2
- import { type Canonical, parseJson, stringifyJson } from "atom.io/json"
2
+ import { type Canonical, parseJson } from "atom.io/json"
3
3
 
4
4
  import { findInStore } from "../families"
5
5
  import { getFamilyOfToken } from "../families/get-family-of-token"
@@ -4,8 +4,6 @@ import {
4
4
  ingestAtomUpdate,
5
5
  ingestCreationEvent,
6
6
  ingestDisposalEvent,
7
- ingestMoleculeCreationEvent,
8
- ingestMoleculeDisposalEvent,
9
7
  ingestSelectorUpdate,
10
8
  ingestTransactionUpdate,
11
9
  } from "../ingest-updates"
@@ -22,7 +22,7 @@ export const attachTypeSelectors = (
22
22
  throw new Error(`Could not find state with key "${key}"`)
23
23
  }
24
24
  state = get(token)
25
- } catch (thrown) {
25
+ } catch (_) {
26
26
  return `error`
27
27
  }
28
28
  const typeOfState = discoverType(state)
package/src/main/index.ts CHANGED
@@ -1,19 +1,13 @@
1
1
  import type { Transceiver } from "atom.io/internal"
2
2
  import type { Canonical, Json, stringified } from "atom.io/json"
3
3
 
4
- import type { atom, AtomFamilyToken } from "./atom"
5
- import type { getState } from "./get-state"
4
+ import type { AtomFamilyToken } from "./atom"
6
5
  import type {
7
6
  SelectorFamilyToken,
8
7
  WritableSelectorFamilyToken,
9
8
  } from "./selector"
10
- import type { setState } from "./set-state"
11
9
  import type { TimelineToken } from "./timeline"
12
- import type {
13
- runTransaction,
14
- transaction,
15
- TransactionToken,
16
- } from "./transaction"
10
+ import type { TransactionToken } from "./transaction"
17
11
 
18
12
  export * from "./atom"
19
13
  export * from "./dispose-state"
@@ -45,6 +45,7 @@ const AtomIODevtoolsInternal = (): React.ReactNode => {
45
45
  left: 0,
46
46
  right: 0,
47
47
  bottom: 0,
48
+ pointerEvents: `none`,
48
49
  }}
49
50
  >
50
51
  <motion.span
@@ -1,8 +1,4 @@
1
- import type {
2
- ReadonlyPureSelectorToken,
3
- ReadonlySelectorToken,
4
- WritableToken,
5
- } from "atom.io"
1
+ import type { ReadonlySelectorToken, WritableToken } from "atom.io"
6
2
  import { useI, useO } from "atom.io/react"
7
3
  import type { FC } from "react"
8
4
 
@@ -67,11 +67,9 @@ const TransactionUpdateFC: React.FC<{
67
67
  {typeof param === `object` &&
68
68
  param !== null &&
69
69
  `type` in param &&
70
- `target` in param ? (
71
- <>{JSON.stringify(param.type)}</>
72
- ) : (
73
- <>{JSON.stringify(param)}</>
74
- )}
70
+ `target` in param
71
+ ? JSON.stringify(param.type)
72
+ : JSON.stringify(param)}
75
73
  </span>
76
74
  </article>
77
75
  )
@@ -8,6 +8,7 @@ main[data-css="atom_io_devtools"] {
8
8
  --bg-color: #ddd;
9
9
  --bg-tint1: #e3e3e3;
10
10
  }
11
+ pointer-events: all;
11
12
  & {
12
13
  box-sizing: border-box;
13
14
  color: var(--fg-color);
@@ -27,6 +28,7 @@ main[data-css="atom_io_devtools"] {
27
28
  * {
28
29
  font-size: 16px;
29
30
  font-family: theia, monospace;
31
+ line-height: 1em;
30
32
  }
31
33
  > header {
32
34
  padding: 5px;
@@ -35,7 +37,6 @@ main[data-css="atom_io_devtools"] {
35
37
  display: flex;
36
38
  justify-content: space-between;
37
39
  h1 {
38
- font-size: inherit;
39
40
  margin: 0;
40
41
  font-size: 24px;
41
42
  font-family: charter, serif;
@@ -47,7 +48,7 @@ main[data-css="atom_io_devtools"] {
47
48
  cursor: pointer;
48
49
  background: none;
49
50
  border: none;
50
- padding: none;
51
+ padding: 0px 5px;
51
52
  margin-bottom: -2px;
52
53
  z-index: 1000;
53
54
  &:disabled {
@@ -114,10 +115,12 @@ main[data-css="atom_io_devtools"] {
114
115
  flex-flow: row;
115
116
  gap: 5px;
116
117
  cursor: help;
117
- h2 {
118
+ align-items: baseline;
119
+ /* h2,
120
+ span.type {
118
121
  display: inline-block;
119
122
  margin: 0;
120
- }
123
+ } */
121
124
  .detail {
122
125
  color: #777;
123
126
  @media (prefers-color-scheme: light) {
@@ -126,9 +129,9 @@ main[data-css="atom_io_devtools"] {
126
129
  }
127
130
  }
128
131
  }
129
- main {
130
- margin-left: 15px;
131
- }
132
+ /* main {
133
+ margin-left: 15px;
134
+ } */
132
135
  }
133
136
  section.transaction_log {
134
137
  margin-top: 0;
@@ -12,7 +12,7 @@ function round(value: number, decimalPlaces?: number): number {
12
12
  const factor = 10 ** decimalPlaces
13
13
  return Math.round(value * factor) / factor
14
14
  }
15
- function roundAndPad(value: number, decimalPlaces?: number): string {
15
+ function _roundAndPad(value: number, decimalPlaces?: number): string {
16
16
  const roundedValue = round(value, decimalPlaces)
17
17
  const paddedString = roundedValue.toFixed(decimalPlaces)
18
18
  return paddedString
@@ -13,7 +13,7 @@ export type ErrorBoundaryProps = {
13
13
  children: ReactNode
14
14
  onError?: ((error: Error | string, errorInfo: ErrorInfo) => void) | undefined
15
15
  Fallback?: FC<FallbackProps> | undefined
16
- useResetErrorState?: () => () => void
16
+ resetErrorState?: () => void
17
17
  useErrorState?: () => [
18
18
  ErrorBoundaryState,
19
19
  (
@@ -1,4 +1,4 @@
1
- import type { Json, JsonTypes } from "atom.io/json"
1
+ import type { JsonTypes } from "atom.io/json"
2
2
  import type { CSSProperties, FC, ReactElement } from "react"
3
3
 
4
4
  import type { JsonEditorComponents } from "./default-components"
@@ -6,7 +6,7 @@ export const stringToArray = (str: string): string[] => str.split(`,`)
6
6
  export const stringToObject = (str: string): Json.Tree.Object => {
7
7
  try {
8
8
  return JSON.parse(str)
9
- } catch (e) {
9
+ } catch (_) {
10
10
  return { [str]: str }
11
11
  }
12
12
  }
@@ -1,12 +1,9 @@
1
1
  import type {
2
- AtomToken,
3
2
  JoinToken,
4
3
  MutableAtomToken,
5
4
  ReadonlyPureSelectorFamilyToken,
6
- ReadonlyPureSelectorToken,
7
5
  } from "atom.io"
8
6
  import { atom, getInternalRelations, join, selectorFamily } from "atom.io"
9
- import { Join } from "atom.io/internal"
10
7
  import type { SetRTXJson } from "atom.io/transceivers/set-rtx"
11
8
  import { SetRTX } from "atom.io/transceivers/set-rtx"
12
9
 
@@ -1,5 +1,4 @@
1
1
  import type * as AtomIO from "atom.io"
2
- import { findInStore } from "atom.io/internal"
3
2
  import type { Json } from "atom.io/json"
4
3
  import { StoreContext, useO } from "atom.io/react"
5
4
  import * as RTC from "atom.io/realtime-client"
@@ -1,3 +1,5 @@
1
+ /** biome-ignore-all lint/correctness/useHookAtTopLevel: intentional */
2
+
1
3
  import * as React from "react"
2
4
 
3
5
  // @ts-expect-error this is a safe way to check a property on the global object
@@ -49,7 +49,7 @@ export function prepareToExposeRealtimeContinuity({
49
49
  userKey,
50
50
  store,
51
51
  ).socketKeyOfUser
52
- const unsubscribeFromSocketTracking = subscribeToState(
52
+ const _unsubscribeFromSocketTracking = subscribeToState(
53
53
  store,
54
54
  socketKeyState,
55
55
  `sync-continuity:${continuityKey}:${userKey}`,
@@ -2,9 +2,7 @@ import type { Store } from "atom.io/internal"
2
2
  import {
3
3
  findInStore,
4
4
  getFromStore,
5
- getJsonToken,
6
5
  getUpdateToken,
7
- isRootStore,
8
6
  setIntoStore,
9
7
  subscribeToTransaction,
10
8
  } from "atom.io/internal"
@@ -1,4 +1,4 @@
1
- import { IMPLICIT, Subject } from "atom.io/internal"
1
+ import { Subject } from "atom.io/internal"
2
2
  import type { Json } from "atom.io/json"
3
3
  import { parseJson, stringifyJson } from "atom.io/json"
4
4
  import { SetRTX } from "atom.io/transceivers/set-rtx"