atom.io 0.18.3 → 0.19.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.
Files changed (56) hide show
  1. package/data/dist/index.cjs +173 -1
  2. package/data/dist/index.d.ts +52 -21
  3. package/data/dist/index.js +12 -331
  4. package/data/src/join.ts +321 -53
  5. package/dist/{chunk-CVBEVTM5.js → chunk-7VCCW45K.js} +1 -39
  6. package/dist/chunk-7ZR244C2.js +489 -0
  7. package/dist/index.cjs +1 -0
  8. package/dist/index.d.ts +1 -0
  9. package/dist/index.js +1 -0
  10. package/internal/dist/index.cjs +1 -1
  11. package/internal/dist/index.d.ts +1 -1
  12. package/internal/dist/index.js +1 -1
  13. package/internal/src/mutable/tracker.ts +1 -1
  14. package/internal/src/set-state/become.ts +1 -1
  15. package/internal/src/subscribe/subscribe-to-state.ts +2 -2
  16. package/internal/src/timeline/add-atom-to-timeline.ts +3 -3
  17. package/internal/src/transaction/build-transaction.ts +1 -1
  18. package/introspection/dist/index.cjs +3 -2
  19. package/introspection/dist/index.d.ts +4 -4
  20. package/introspection/dist/index.js +3 -2
  21. package/introspection/src/attach-atom-index.ts +5 -4
  22. package/introspection/src/index.ts +3 -3
  23. package/json/dist/index.d.ts +1 -1
  24. package/json/dist/index.js +2 -2
  25. package/package.json +18 -19
  26. package/react-devtools/dist/index.cjs +218 -927
  27. package/react-devtools/dist/index.css +0 -18
  28. package/react-devtools/dist/index.d.ts +4 -4
  29. package/react-devtools/dist/index.js +181 -833
  30. package/react-devtools/src/AtomIODevtools.tsx +2 -1
  31. package/react-devtools/src/Button.tsx +3 -1
  32. package/react-devtools/src/StateEditor.tsx +13 -16
  33. package/react-devtools/src/StateIndex.tsx +22 -19
  34. package/react-devtools/src/TimelineIndex.tsx +11 -4
  35. package/react-devtools/src/TransactionIndex.tsx +10 -3
  36. package/react-devtools/src/Updates.tsx +10 -3
  37. package/realtime/dist/index.cjs +4 -2
  38. package/realtime/dist/index.d.ts +1 -96
  39. package/realtime/dist/index.js +5 -3
  40. package/realtime/src/shared-room-store.ts +5 -3
  41. package/realtime-react/dist/index.cjs +1 -1
  42. package/realtime-react/dist/index.js +1 -1
  43. package/realtime-react/src/use-single-effect.ts +1 -1
  44. package/realtime-server/dist/index.cjs +162 -18
  45. package/realtime-server/dist/index.d.ts +2 -92
  46. package/realtime-server/dist/index.js +31 -17
  47. package/realtime-server/src/ipc-sockets/child-socket.ts +1 -1
  48. package/realtime-server/src/realtime-continuity-synchronizer.ts +8 -6
  49. package/realtime-server/src/realtime-server-stores/server-room-external-actions.ts +22 -10
  50. package/realtime-server/src/realtime-server-stores/server-room-external-store.ts +2 -2
  51. package/realtime-testing/dist/index.cjs +48 -6
  52. package/realtime-testing/dist/index.js +10 -3
  53. package/realtime-testing/src/setup-realtime-test.tsx +9 -3
  54. package/src/silo.ts +4 -0
  55. package/src/validators.ts +2 -2
  56. /package/dist/{chunk-VAE5OCKN.js → chunk-BF4MVQF6.js} +0 -0
@@ -1,4 +1,4 @@
1
- import * as http from "http"
1
+ import * as http from "node:http"
2
2
 
3
3
  import { prettyDOM, render } from "@testing-library/react"
4
4
  import type { RenderResult } from "@testing-library/react"
@@ -21,6 +21,7 @@ import type { Socket as ClientSocket } from "socket.io-client"
21
21
  import { io } from "socket.io-client"
22
22
 
23
23
  import { recordToEntries } from "~/packages/anvl/src/object"
24
+ import { editRelationsInStore } from "../../data/src/join"
24
25
  import { myUsernameState } from "../../realtime-client/src/realtime-client-stores"
25
26
 
26
27
  let testNumber = 0
@@ -87,8 +88,13 @@ export const setupRealtimeTestServer = (
87
88
  if (token === `test` && socket.id) {
88
89
  const socketState = findInStore(RTS.socketAtoms, socket.id, silo.store)
89
90
  setIntoStore(socketState, socket, silo.store)
90
- const usersOfSockets = RTS.usersOfSockets.in(silo.store)
91
- usersOfSockets.relations.set(socket.id, username)
91
+ editRelationsInStore(
92
+ RTS.usersOfSockets,
93
+ (relations) => {
94
+ relations.set(socket.id, username)
95
+ },
96
+ silo.store,
97
+ )
92
98
  setIntoStore(RTS.userIndex, (index) => index.add(username), silo.store)
93
99
  setIntoStore(RTS.socketIndex, (index) => index.add(socket.id), silo.store)
94
100
  console.log(`${username} connected on ${socket.id}`)
package/src/silo.ts CHANGED
@@ -7,6 +7,7 @@ import {
7
7
  createStandaloneSelector,
8
8
  createTimeline,
9
9
  createTransaction,
10
+ findInStore,
10
11
  getFromStore,
11
12
  setIntoStore,
12
13
  timeTravel,
@@ -23,6 +24,7 @@ import type {
23
24
  RegularAtomFamilyOptions,
24
25
  RegularAtomOptions,
25
26
  RegularAtomToken,
27
+ findState,
26
28
  getState,
27
29
  redo,
28
30
  setState,
@@ -42,6 +44,7 @@ export class Silo {
42
44
  public selectorFamily: typeof selectorFamily
43
45
  public transaction: typeof transaction
44
46
  public timeline: typeof timeline
47
+ public findState: typeof findState
45
48
  public getState: typeof getState
46
49
  public setState: typeof setState
47
50
  public subscribe: typeof subscribe
@@ -80,6 +83,7 @@ export class Silo {
80
83
  this.selectorFamily = (options) => createSelectorFamily(options, s) as any
81
84
  this.transaction = (options) => createTransaction(options, s)
82
85
  this.timeline = (options) => createTimeline(options, s)
86
+ this.findState = (token, key) => findInStore(token, key, s) as any
83
87
  this.getState = (token) => getFromStore(token, s)
84
88
  this.setState = (token, newValue) => setIntoStore(token, newValue, s)
85
89
  this.subscribe = (token, handler, key) => subscribe(token, handler, key, s)
package/src/validators.ts CHANGED
@@ -24,8 +24,8 @@ export type TokenType<
24
24
  > = Comparison extends ReadableToken<infer RepresentedValue>
25
25
  ? RepresentedValue
26
26
  : Comparison extends ReadableFamilyToken<infer RepresentedValue, any>
27
- ? RepresentedValue
28
- : never
27
+ ? RepresentedValue
28
+ : never
29
29
 
30
30
  export function isToken<KnownToken extends RegularAtomToken<any>>(
31
31
  knownToken: KnownToken,
File without changes