atom.io 0.33.4 → 0.33.6

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 (71) hide show
  1. package/dist/data/index.d.ts +2 -7
  2. package/dist/data/index.d.ts.map +1 -1
  3. package/dist/eslint-plugin/index.d.ts +0 -6
  4. package/dist/eslint-plugin/index.d.ts.map +1 -1
  5. package/dist/internal/index.d.ts +12 -100
  6. package/dist/internal/index.d.ts.map +1 -1
  7. package/dist/internal/index.js +35 -35
  8. package/dist/internal/index.js.map +1 -1
  9. package/dist/introspection/index.d.ts +0 -8
  10. package/dist/introspection/index.d.ts.map +1 -1
  11. package/dist/introspection/index.js +9 -9
  12. package/dist/introspection/index.js.map +1 -1
  13. package/dist/json/index.d.ts +1 -6
  14. package/dist/json/index.d.ts.map +1 -1
  15. package/dist/main/index.d.ts +3 -28
  16. package/dist/main/index.d.ts.map +1 -1
  17. package/dist/main/index.js +4 -6
  18. package/dist/main/index.js.map +1 -1
  19. package/dist/react/index.d.ts +0 -5
  20. package/dist/react/index.d.ts.map +1 -1
  21. package/dist/react/index.js +7 -11
  22. package/dist/react/index.js.map +1 -1
  23. package/dist/react-devtools/index.css +9 -7
  24. package/dist/react-devtools/index.css.map +1 -1
  25. package/dist/react-devtools/index.d.ts +1 -12
  26. package/dist/react-devtools/index.d.ts.map +1 -1
  27. package/dist/react-devtools/index.js +7 -4
  28. package/dist/react-devtools/index.js.map +1 -1
  29. package/dist/realtime/index.d.ts +0 -2
  30. package/dist/realtime/index.d.ts.map +1 -1
  31. package/dist/realtime/index.js.map +1 -1
  32. package/dist/realtime-client/index.d.ts +13 -38
  33. package/dist/realtime-client/index.d.ts.map +1 -1
  34. package/dist/realtime-client/index.js +4 -6
  35. package/dist/realtime-client/index.js.map +1 -1
  36. package/dist/realtime-react/index.d.ts +7 -25
  37. package/dist/realtime-react/index.d.ts.map +1 -1
  38. package/dist/realtime-react/index.js +23 -42
  39. package/dist/realtime-react/index.js.map +1 -1
  40. package/dist/realtime-server/index.d.ts +11 -31
  41. package/dist/realtime-server/index.d.ts.map +1 -1
  42. package/dist/realtime-server/index.js +6 -6
  43. package/dist/realtime-server/index.js.map +1 -1
  44. package/dist/realtime-testing/index.d.ts +0 -1
  45. package/dist/realtime-testing/index.js +1 -1
  46. package/dist/realtime-testing/index.js.map +1 -1
  47. package/dist/transceivers/set-rtx/index.d.ts +0 -1
  48. package/dist/web/index.d.ts +0 -1
  49. package/package.json +37 -28
  50. package/src/internal/families/dispose-from-store.ts +1 -1
  51. package/src/internal/mutable/create-mutable-atom.ts +2 -6
  52. package/src/internal/set-state/set-into-store.ts +1 -1
  53. package/src/internal/store/withdraw.ts +13 -13
  54. package/src/internal/timeline/time-travel.ts +0 -2
  55. package/src/introspection/attach-type-selectors.ts +1 -1
  56. package/src/main/index.ts +2 -8
  57. package/src/main/logger.ts +2 -2
  58. package/src/react-devtools/AtomIODevtools.tsx +2 -2
  59. package/src/react-devtools/StateEditor.tsx +1 -5
  60. package/src/react-devtools/Updates.tsx +3 -5
  61. package/src/react-devtools/devtools.css +9 -7
  62. package/src/react-devtools/elastic-input/NumberInput.tsx +1 -1
  63. package/src/react-devtools/error-boundary/ReactErrorBoundary.tsx +1 -1
  64. package/src/react-devtools/json-editor/developer-interface.tsx +1 -1
  65. package/src/react-devtools/json-editor/editors-by-type/utilities/cast-json.ts +1 -1
  66. package/src/realtime/shared-room-store.ts +0 -3
  67. package/src/realtime-react/use-pull-selector.ts +0 -1
  68. package/src/realtime-react/use-single-effect.ts +2 -0
  69. package/src/realtime-server/continuity/prepare-to-sync-realtime-continuity.ts +1 -1
  70. package/src/realtime-server/continuity/subscribe-to-continuity-actions.ts +0 -2
  71. package/src/realtime-server/ipc-sockets/parent-socket.ts +1 -1
@@ -137,52 +137,52 @@ export function withdraw<
137
137
  ): MutableAtomFamily<T, J, K>
138
138
  export function withdraw<T, K extends Canonical>(
139
139
  store: Store,
140
- token: AtomFamilyToken<T>,
141
- ): AtomFamily<T, any>
140
+ token: AtomFamilyToken<T, K>,
141
+ ): AtomFamily<T, K>
142
142
  export function withdraw<T, K extends Canonical>(
143
143
  store: Store,
144
144
  token: ReadonlyHeldSelectorFamilyToken<T, K>,
145
- ): ReadonlyHeldSelectorFamily<T, any>
145
+ ): ReadonlyHeldSelectorFamily<T, K>
146
146
  export function withdraw<T, K extends Canonical>(
147
147
  store: Store,
148
148
  token: WritableHeldSelectorFamilyToken<T, K>,
149
- ): WritableHeldSelectorFamily<T, any>
149
+ ): WritableHeldSelectorFamily<T, K>
150
150
  export function withdraw<T, K extends Canonical>(
151
151
  store: Store,
152
152
  token: ReadonlyPureSelectorFamilyToken<T, K>,
153
- ): ReadonlyPureSelectorFamily<T, any>
153
+ ): ReadonlyPureSelectorFamily<T, K>
154
154
  export function withdraw<T, K extends Canonical>(
155
155
  store: Store,
156
156
  token: WritablePureSelectorFamilyToken<T, K>,
157
- ): WritablePureSelectorFamily<T, any>
157
+ ): WritablePureSelectorFamily<T, K>
158
158
  export function withdraw<T, K extends Canonical>(
159
159
  store: Store,
160
160
  token: ReadonlySelectorFamilyToken<T, K>,
161
- ): ReadonlySelectorFamily<T, any>
161
+ ): ReadonlySelectorFamily<T, K>
162
162
  export function withdraw<T, K extends Canonical>(
163
163
  store: Store,
164
164
  token: WritableSelectorFamilyToken<T, K>,
165
- ): WritableSelectorFamily<T, any>
165
+ ): WritableSelectorFamily<T, K>
166
166
  export function withdraw<T, K extends Canonical>(
167
167
  store: Store,
168
168
  token: HeldSelectorFamilyToken<T, K>,
169
- ): HeldSelectorFamily<T, any>
169
+ ): HeldSelectorFamily<T, K>
170
170
  export function withdraw<T, K extends Canonical>(
171
171
  store: Store,
172
172
  token: PureSelectorFamilyToken<T, K>,
173
- ): PureSelectorFamily<T, any>
173
+ ): PureSelectorFamily<T, K>
174
174
  export function withdraw<T, K extends Canonical>(
175
175
  store: Store,
176
176
  token: SelectorFamilyToken<T, K>,
177
- ): SelectorFamily<T, any>
177
+ ): SelectorFamily<T, K>
178
178
  export function withdraw<T, K extends Canonical>(
179
179
  store: Store,
180
180
  token: ReadableFamilyToken<T, K>,
181
- ): ReadableFamily<T, any>
181
+ ): ReadableFamily<T, K>
182
182
  export function withdraw<T, K extends Canonical>(
183
183
  store: Store,
184
184
  token: WritableFamilyToken<T, K>,
185
- ): WritableFamily<T, any>
185
+ ): WritableFamily<T, K>
186
186
 
187
187
  export function withdraw<T extends Func>(
188
188
  store: Store,
@@ -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"
@@ -1,4 +1,4 @@
1
- const LoggerIconDictionary = {
1
+ const LOGGER_ICON_DICTIONARY = {
2
2
  "⌛": `Timeline event fully captured`,
3
3
  "⏩": `Timeline redo`,
4
4
  "⏪": `Timeline undo`,
@@ -50,7 +50,7 @@ const LoggerIconDictionary = {
50
50
  "🖌": `Redacting realtime update`,
51
51
  "👁": `Determining perspective`,
52
52
  } as const
53
- export type LoggerIcon = keyof typeof LoggerIconDictionary
53
+ export type LoggerIcon = keyof typeof LOGGER_ICON_DICTIONARY
54
54
  export type TokenDenomination =
55
55
  | `atom_family`
56
56
  | `atom`
@@ -1,7 +1,7 @@
1
1
  import "./devtools.css"
2
2
 
3
3
  import { StoreContext, useI, useO } from "atom.io/react"
4
- import { LayoutGroup, motion, spring } from "motion/react"
4
+ import { LayoutGroup, motion } from "motion/react"
5
5
  import { useContext, useRef } from "react"
6
6
 
7
7
  import { StateIndex } from "./StateIndex"
@@ -63,7 +63,7 @@ const AtomIODevtoolsInternal = (): React.ReactNode => {
63
63
  drag
64
64
  dragConstraints={constraintsRef}
65
65
  data-css="atom_io_devtools"
66
- transition={spring}
66
+ transition={{ type: `spring`, bounce: 0.25 }}
67
67
  style={
68
68
  devtoolsAreOpen
69
69
  ? {}
@@ -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
  )
@@ -27,6 +27,7 @@ main[data-css="atom_io_devtools"] {
27
27
  * {
28
28
  font-size: 16px;
29
29
  font-family: theia, monospace;
30
+ line-height: 1em;
30
31
  }
31
32
  > header {
32
33
  padding: 5px;
@@ -35,7 +36,6 @@ main[data-css="atom_io_devtools"] {
35
36
  display: flex;
36
37
  justify-content: space-between;
37
38
  h1 {
38
- font-size: inherit;
39
39
  margin: 0;
40
40
  font-size: 24px;
41
41
  font-family: charter, serif;
@@ -47,7 +47,7 @@ main[data-css="atom_io_devtools"] {
47
47
  cursor: pointer;
48
48
  background: none;
49
49
  border: none;
50
- padding: none;
50
+ padding: 0px 5px;
51
51
  margin-bottom: -2px;
52
52
  z-index: 1000;
53
53
  &:disabled {
@@ -114,10 +114,12 @@ main[data-css="atom_io_devtools"] {
114
114
  flex-flow: row;
115
115
  gap: 5px;
116
116
  cursor: help;
117
- h2 {
117
+ align-items: baseline;
118
+ /* h2,
119
+ span.type {
118
120
  display: inline-block;
119
121
  margin: 0;
120
- }
122
+ } */
121
123
  .detail {
122
124
  color: #777;
123
125
  @media (prefers-color-scheme: light) {
@@ -126,9 +128,9 @@ main[data-css="atom_io_devtools"] {
126
128
  }
127
129
  }
128
130
  }
129
- main {
130
- margin-left: 15px;
131
- }
131
+ /* main {
132
+ margin-left: 15px;
133
+ } */
132
134
  }
133
135
  section.transaction_log {
134
136
  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"