atom.io 0.32.4 → 0.33.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.
Files changed (362) hide show
  1. package/dist/chunk-Cl8Af3a2.js +11 -0
  2. package/dist/data/index.d.ts +28 -0
  3. package/dist/data/index.d.ts.map +1 -0
  4. package/dist/data/index.js +66 -0
  5. package/dist/data/index.js.map +1 -0
  6. package/dist/devtools-CAg2k57t.js +0 -0
  7. package/dist/devtools-Jyn42mZm.css +311 -0
  8. package/dist/devtools-Jyn42mZm.css.map +1 -0
  9. package/dist/eslint-plugin/index.d.ts +36 -0
  10. package/dist/eslint-plugin/index.d.ts.map +1 -0
  11. package/dist/eslint-plugin/index.js +196 -0
  12. package/dist/eslint-plugin/index.js.map +1 -0
  13. package/{internal/dist → dist/internal}/index.d.ts +495 -378
  14. package/dist/internal/index.d.ts.map +1 -0
  15. package/dist/internal/index.js +3213 -0
  16. package/dist/internal/index.js.map +1 -0
  17. package/dist/introspection/index.d.ts +153 -0
  18. package/dist/introspection/index.d.ts.map +1 -0
  19. package/dist/introspection/index.js +520 -0
  20. package/dist/introspection/index.js.map +1 -0
  21. package/{json/dist → dist/json}/index.d.ts +38 -32
  22. package/dist/json/index.d.ts.map +1 -0
  23. package/dist/json/index.js +75 -0
  24. package/dist/json/index.js.map +1 -0
  25. package/dist/main/index.d.ts +691 -0
  26. package/dist/main/index.d.ts.map +1 -0
  27. package/dist/main/index.js +237 -0
  28. package/dist/main/index.js.map +1 -0
  29. package/{react/dist → dist/react}/index.d.ts +22 -11
  30. package/dist/react/index.d.ts.map +1 -0
  31. package/dist/react/index.js +91 -0
  32. package/dist/react/index.js.map +1 -0
  33. package/dist/react-devtools/index.d.ts +194 -0
  34. package/dist/react-devtools/index.d.ts.map +1 -0
  35. package/dist/react-devtools/index.js +1274 -0
  36. package/dist/react-devtools/index.js.map +1 -0
  37. package/dist/realtime/index.d.ts +55 -0
  38. package/dist/realtime/index.d.ts.map +1 -0
  39. package/dist/realtime/index.js +113 -0
  40. package/dist/realtime/index.js.map +1 -0
  41. package/dist/realtime-client/index.d.ts +81 -0
  42. package/dist/realtime-client/index.d.ts.map +1 -0
  43. package/dist/realtime-client/index.js +376 -0
  44. package/dist/realtime-client/index.js.map +1 -0
  45. package/dist/realtime-react/index.d.ts +68 -0
  46. package/dist/realtime-react/index.d.ts.map +1 -0
  47. package/dist/realtime-react/index.js +182 -0
  48. package/dist/realtime-react/index.js.map +1 -0
  49. package/dist/realtime-server/index.d.ts +190 -0
  50. package/dist/realtime-server/index.d.ts.map +1 -0
  51. package/dist/realtime-server/index.js +795 -0
  52. package/dist/realtime-server/index.js.map +1 -0
  53. package/dist/realtime-testing/index.d.ts +60 -0
  54. package/dist/realtime-testing/index.d.ts.map +1 -0
  55. package/dist/realtime-testing/index.js +181 -0
  56. package/dist/realtime-testing/index.js.map +1 -0
  57. package/dist/transceivers/set-rtx/index.d.ts +44 -0
  58. package/dist/transceivers/set-rtx/index.d.ts.map +1 -0
  59. package/dist/transceivers/set-rtx/index.js +204 -0
  60. package/dist/transceivers/set-rtx/index.js.map +1 -0
  61. package/dist/web/index.d.ts +15 -0
  62. package/dist/web/index.d.ts.map +1 -0
  63. package/dist/web/index.js +16 -0
  64. package/dist/web/index.js.map +1 -0
  65. package/package.json +65 -117
  66. package/{eslint-plugin/src → src/eslint-plugin}/index.ts +3 -1
  67. package/{eslint-plugin/src → src/eslint-plugin}/rules/explicit-state-types.ts +6 -1
  68. package/{eslint-plugin/src → src/eslint-plugin}/rules/synchronous-selector-dependencies.ts +14 -1
  69. package/{internal/src → src/internal}/families/index.ts +2 -0
  70. package/{internal/src → src/internal}/index.ts +1 -0
  71. package/{internal/src → src/internal}/junction.ts +3 -2
  72. package/{internal/src → src/internal}/lazy-map.ts +1 -1
  73. package/{internal/src → src/internal}/mutable/tracker-family.ts +2 -5
  74. package/{internal/src → src/internal}/mutable/tracker.ts +15 -9
  75. package/{internal/src → src/internal}/store/store.ts +59 -46
  76. package/{internal/src → src/internal}/subject.ts +1 -1
  77. package/{introspection/src → src/introspection}/auditor.ts +1 -1
  78. package/{introspection/src → src/introspection}/differ.ts +12 -1
  79. package/{introspection/src → src/introspection}/refinery.ts +18 -3
  80. package/{json/src → src/json}/entries.ts +1 -1
  81. package/{json/src → src/json}/select-json-family.ts +1 -1
  82. package/src/{realm.ts → main/realm.ts} +1 -1
  83. package/src/{silo.ts → main/silo.ts} +1 -1
  84. package/src/{transaction.ts → main/transaction.ts} +1 -1
  85. package/{react/src → src/react}/store-context.tsx +3 -1
  86. package/{react-devtools/src → src/react-devtools}/AtomIODevtools.tsx +1 -1
  87. package/{react-devtools/src → src/react-devtools}/Button.tsx +3 -1
  88. package/{react-devtools/src → src/react-devtools}/Updates.tsx +5 -1
  89. package/src/react-devtools/devtools.css +308 -0
  90. package/{react-devtools/src → src/react-devtools}/json-editor/index.ts +5 -2
  91. package/{react-devtools/src → src/react-devtools}/store.ts +3 -2
  92. package/{realtime/src → src/realtime}/shared-room-store.ts +28 -5
  93. package/src/realtime-client/realtime-client-stores/client-main-store.ts +23 -0
  94. package/src/realtime-client/realtime-client-stores/client-sync-store.ts +15 -0
  95. package/{realtime-react/src → src/realtime-react}/index.ts +1 -0
  96. package/{realtime-react/src → src/realtime-react}/on-mount.ts +1 -1
  97. package/{realtime-react/src → src/realtime-react}/realtime-context.tsx +5 -4
  98. package/{realtime-react/src → src/realtime-react}/use-single-effect.ts +1 -1
  99. package/{realtime-server/src → src/realtime-server}/realtime-server-stores/server-room-external-actions.ts +20 -19
  100. package/{realtime-server/src → src/realtime-server}/realtime-server-stores/server-room-external-store.ts +12 -7
  101. package/{realtime-server/src → src/realtime-server}/realtime-server-stores/server-sync-store.ts +13 -4
  102. package/{realtime-server/src → src/realtime-server}/realtime-server-stores/server-user-store.ts +26 -8
  103. package/{transceivers/set-rtx/src → src/transceivers/set-rtx}/set-rtx.ts +2 -2
  104. package/data/dist/index.d.ts +0 -31
  105. package/data/dist/index.js +0 -69
  106. package/data/package.json +0 -13
  107. package/dist/chunk-4LWKCEW3.js +0 -14
  108. package/dist/chunk-7SJVR7FZ.js +0 -4499
  109. package/dist/chunk-IR77IXS7.js +0 -526
  110. package/dist/chunk-PG57JXN4.js +0 -1035
  111. package/dist/chunk-PXB4YZDI.js +0 -153
  112. package/dist/chunk-Q6OOJWM4.js +0 -634
  113. package/dist/chunk-TJPLOX7Z.js +0 -81
  114. package/dist/chunk-U4K63VLA.js +0 -109
  115. package/dist/chunk-XWL6SNVU.js +0 -7
  116. package/dist/index.d.ts +0 -701
  117. package/dist/index.js +0 -2
  118. package/eslint-plugin/dist/index.d.ts +0 -51
  119. package/eslint-plugin/dist/index.js +0 -238
  120. package/eslint-plugin/package.json +0 -13
  121. package/internal/dist/index.js +0 -2
  122. package/internal/package.json +0 -13
  123. package/introspection/dist/index.d.ts +0 -149
  124. package/introspection/dist/index.js +0 -3
  125. package/introspection/package.json +0 -13
  126. package/json/dist/index.js +0 -2
  127. package/json/package.json +0 -13
  128. package/react/dist/index.js +0 -3
  129. package/react/package.json +0 -13
  130. package/react-devtools/dist/index.css +0 -309
  131. package/react-devtools/dist/index.d.ts +0 -169
  132. package/react-devtools/dist/index.js +0 -1481
  133. package/react-devtools/package.json +0 -13
  134. package/react-devtools/src/devtools.scss +0 -309
  135. package/realtime/dist/index.d.ts +0 -51
  136. package/realtime/dist/index.js +0 -3
  137. package/realtime/package.json +0 -13
  138. package/realtime-client/dist/index.d.ts +0 -41
  139. package/realtime-client/dist/index.js +0 -4
  140. package/realtime-client/package.json +0 -13
  141. package/realtime-client/src/realtime-client-stores/client-main-store.ts +0 -20
  142. package/realtime-client/src/realtime-client-stores/client-sync-store.ts +0 -15
  143. package/realtime-react/dist/index.d.ts +0 -39
  144. package/realtime-react/dist/index.js +0 -6
  145. package/realtime-react/package.json +0 -13
  146. package/realtime-server/dist/index.d.ts +0 -139
  147. package/realtime-server/dist/index.js +0 -4
  148. package/realtime-server/package.json +0 -13
  149. package/realtime-testing/dist/index.d.ts +0 -59
  150. package/realtime-testing/dist/index.js +0 -198
  151. package/realtime-testing/package.json +0 -13
  152. package/transceivers/set-rtx/dist/index.d.ts +0 -41
  153. package/transceivers/set-rtx/dist/index.js +0 -2
  154. package/transceivers/set-rtx/package.json +0 -13
  155. package/web/dist/index.d.ts +0 -9
  156. package/web/dist/index.js +0 -2
  157. package/web/package.json +0 -13
  158. /package/{data/src → src/data}/dict.ts +0 -0
  159. /package/{data/src → src/data}/index.ts +0 -0
  160. /package/{data/src → src/data}/struct-family.ts +0 -0
  161. /package/{data/src → src/data}/struct.ts +0 -0
  162. /package/{eslint-plugin/src → src/eslint-plugin}/rules/index.ts +0 -0
  163. /package/{eslint-plugin/src → src/eslint-plugin}/walk.ts +0 -0
  164. /package/{internal/src → src/internal}/arbitrary.ts +0 -0
  165. /package/{internal/src → src/internal}/atom/create-regular-atom.ts +0 -0
  166. /package/{internal/src → src/internal}/atom/create-standalone-atom.ts +0 -0
  167. /package/{internal/src → src/internal}/atom/dispose-atom.ts +0 -0
  168. /package/{internal/src → src/internal}/atom/index.ts +0 -0
  169. /package/{internal/src → src/internal}/atom/is-default.ts +0 -0
  170. /package/{internal/src → src/internal}/caching.ts +0 -0
  171. /package/{internal/src → src/internal}/capitalize.ts +0 -0
  172. /package/{internal/src → src/internal}/families/create-atom-family.ts +0 -0
  173. /package/{internal/src → src/internal}/families/create-readonly-selector-family.ts +0 -0
  174. /package/{internal/src → src/internal}/families/create-regular-atom-family.ts +0 -0
  175. /package/{internal/src → src/internal}/families/create-selector-family.ts +0 -0
  176. /package/{internal/src → src/internal}/families/create-writable-selector-family.ts +0 -0
  177. /package/{internal/src → src/internal}/families/dispose-from-store.ts +0 -0
  178. /package/{internal/src → src/internal}/families/find-in-store.ts +0 -0
  179. /package/{internal/src → src/internal}/families/get-family-of-token.ts +0 -0
  180. /package/{internal/src → src/internal}/families/init-family-member.ts +0 -0
  181. /package/{internal/src → src/internal}/families/seek-in-store.ts +0 -0
  182. /package/{internal/src → src/internal}/future.ts +0 -0
  183. /package/{internal/src → src/internal}/get-environment-data.ts +0 -0
  184. /package/{internal/src → src/internal}/get-state/get-from-store.ts +0 -0
  185. /package/{internal/src → src/internal}/get-state/index.ts +0 -0
  186. /package/{internal/src → src/internal}/get-state/read-or-compute-value.ts +0 -0
  187. /package/{internal/src → src/internal}/get-trace.ts +0 -0
  188. /package/{internal/src → src/internal}/ingest-updates/index.ts +0 -0
  189. /package/{internal/src → src/internal}/ingest-updates/ingest-atom-update.ts +0 -0
  190. /package/{internal/src → src/internal}/ingest-updates/ingest-creation-disposal.ts +0 -0
  191. /package/{internal/src → src/internal}/ingest-updates/ingest-selector-update.ts +0 -0
  192. /package/{internal/src → src/internal}/ingest-updates/ingest-transaction-update.ts +0 -0
  193. /package/{internal/src → src/internal}/install-into-store.ts +0 -0
  194. /package/{internal/src → src/internal}/join/edit-relations-in-store.ts +0 -0
  195. /package/{internal/src → src/internal}/join/find-relations-in-store.ts +0 -0
  196. /package/{internal/src → src/internal}/join/get-internal-relations-from-store.ts +0 -0
  197. /package/{internal/src → src/internal}/join/get-join.ts +0 -0
  198. /package/{internal/src → src/internal}/join/index.ts +0 -0
  199. /package/{internal/src → src/internal}/join/join-internal.ts +0 -0
  200. /package/{internal/src → src/internal}/keys.ts +0 -0
  201. /package/{internal/src → src/internal}/lineage.ts +0 -0
  202. /package/{internal/src → src/internal}/molecule.ts +0 -0
  203. /package/{internal/src → src/internal}/mutable/create-mutable-atom-family.ts +0 -0
  204. /package/{internal/src → src/internal}/mutable/create-mutable-atom.ts +0 -0
  205. /package/{internal/src → src/internal}/mutable/get-json-family.ts +0 -0
  206. /package/{internal/src → src/internal}/mutable/get-json-token.ts +0 -0
  207. /package/{internal/src → src/internal}/mutable/get-update-family.ts +0 -0
  208. /package/{internal/src → src/internal}/mutable/get-update-token.ts +0 -0
  209. /package/{internal/src → src/internal}/mutable/index.ts +0 -0
  210. /package/{internal/src → src/internal}/mutable/transceiver.ts +0 -0
  211. /package/{internal/src → src/internal}/not-found-error.ts +0 -0
  212. /package/{internal/src → src/internal}/operation.ts +0 -0
  213. /package/{internal/src → src/internal}/pretty-print.ts +0 -0
  214. /package/{internal/src → src/internal}/reserved-keys.ts +0 -0
  215. /package/{internal/src → src/internal}/selector/create-readonly-selector.ts +0 -0
  216. /package/{internal/src → src/internal}/selector/create-standalone-selector.ts +0 -0
  217. /package/{internal/src → src/internal}/selector/create-writable-selector.ts +0 -0
  218. /package/{internal/src → src/internal}/selector/dispose-selector.ts +0 -0
  219. /package/{internal/src → src/internal}/selector/get-selector-dependency-keys.ts +0 -0
  220. /package/{internal/src → src/internal}/selector/index.ts +0 -0
  221. /package/{internal/src → src/internal}/selector/register-selector.ts +0 -0
  222. /package/{internal/src → src/internal}/selector/trace-selector-atoms.ts +0 -0
  223. /package/{internal/src → src/internal}/selector/update-selector-atoms.ts +0 -0
  224. /package/{internal/src → src/internal}/set-state/become.ts +0 -0
  225. /package/{internal/src → src/internal}/set-state/copy-mutable-if-needed.ts +0 -0
  226. /package/{internal/src → src/internal}/set-state/emit-update.ts +0 -0
  227. /package/{internal/src → src/internal}/set-state/evict-downstream.ts +0 -0
  228. /package/{internal/src → src/internal}/set-state/index.ts +0 -0
  229. /package/{internal/src → src/internal}/set-state/set-atom-or-selector.ts +0 -0
  230. /package/{internal/src → src/internal}/set-state/set-atom.ts +0 -0
  231. /package/{internal/src → src/internal}/set-state/set-into-store.ts +0 -0
  232. /package/{internal/src → src/internal}/store/circular-buffer.ts +0 -0
  233. /package/{internal/src → src/internal}/store/counterfeit.ts +0 -0
  234. /package/{internal/src → src/internal}/store/deposit.ts +0 -0
  235. /package/{internal/src → src/internal}/store/index.ts +0 -0
  236. /package/{internal/src → src/internal}/store/withdraw.ts +0 -0
  237. /package/{internal/src → src/internal}/subscribe/index.ts +0 -0
  238. /package/{internal/src → src/internal}/subscribe/recall-state.ts +0 -0
  239. /package/{internal/src → src/internal}/subscribe/subscribe-in-store.ts +0 -0
  240. /package/{internal/src → src/internal}/subscribe/subscribe-to-root-atoms.ts +0 -0
  241. /package/{internal/src → src/internal}/subscribe/subscribe-to-state.ts +0 -0
  242. /package/{internal/src → src/internal}/subscribe/subscribe-to-timeline.ts +0 -0
  243. /package/{internal/src → src/internal}/subscribe/subscribe-to-transaction.ts +0 -0
  244. /package/{internal/src → src/internal}/timeline/create-timeline.ts +0 -0
  245. /package/{internal/src → src/internal}/timeline/index.ts +0 -0
  246. /package/{internal/src → src/internal}/timeline/time-travel.ts +0 -0
  247. /package/{internal/src → src/internal}/transaction/abort-transaction.ts +0 -0
  248. /package/{internal/src → src/internal}/transaction/act-upon-store.ts +0 -0
  249. /package/{internal/src → src/internal}/transaction/apply-transaction.ts +0 -0
  250. /package/{internal/src → src/internal}/transaction/assign-transaction-to-continuity.ts +0 -0
  251. /package/{internal/src → src/internal}/transaction/build-transaction.ts +0 -0
  252. /package/{internal/src → src/internal}/transaction/create-transaction.ts +0 -0
  253. /package/{internal/src → src/internal}/transaction/get-epoch-number.ts +0 -0
  254. /package/{internal/src → src/internal}/transaction/index.ts +0 -0
  255. /package/{internal/src → src/internal}/transaction/is-root-store.ts +0 -0
  256. /package/{internal/src → src/internal}/transaction/set-epoch-number.ts +0 -0
  257. /package/{internal/src → src/internal}/utility-types.ts +0 -0
  258. /package/{introspection/src → src/introspection}/attach-atom-index.ts +0 -0
  259. /package/{introspection/src → src/introspection}/attach-introspection-states.ts +0 -0
  260. /package/{introspection/src → src/introspection}/attach-selector-index.ts +0 -0
  261. /package/{introspection/src → src/introspection}/attach-timeline-family.ts +0 -0
  262. /package/{introspection/src → src/introspection}/attach-timeline-index.ts +0 -0
  263. /package/{introspection/src → src/introspection}/attach-transaction-index.ts +0 -0
  264. /package/{introspection/src → src/introspection}/attach-transaction-logs.ts +0 -0
  265. /package/{introspection/src → src/introspection}/attach-type-selectors.ts +0 -0
  266. /package/{introspection/src → src/introspection}/index.ts +0 -0
  267. /package/{introspection/src → src/introspection}/sprawl.ts +0 -0
  268. /package/{json/src → src/json}/index.ts +0 -0
  269. /package/{json/src → src/json}/select-json.ts +0 -0
  270. /package/src/{atom.ts → main/atom.ts} +0 -0
  271. /package/src/{dispose-state.ts → main/dispose-state.ts} +0 -0
  272. /package/src/{find-state.ts → main/find-state.ts} +0 -0
  273. /package/src/{get-state.ts → main/get-state.ts} +0 -0
  274. /package/src/{index.ts → main/index.ts} +0 -0
  275. /package/src/{join.ts → main/join.ts} +0 -0
  276. /package/src/{logger.ts → main/logger.ts} +0 -0
  277. /package/src/{selector.ts → main/selector.ts} +0 -0
  278. /package/src/{set-state.ts → main/set-state.ts} +0 -0
  279. /package/src/{subscribe.ts → main/subscribe.ts} +0 -0
  280. /package/src/{timeline.ts → main/timeline.ts} +0 -0
  281. /package/src/{validators.ts → main/validators.ts} +0 -0
  282. /package/{react/src → src/react}/index.ts +0 -0
  283. /package/{react/src → src/react}/parse-state-overloads.ts +0 -0
  284. /package/{react/src → src/react}/use-i.ts +0 -0
  285. /package/{react/src → src/react}/use-json.ts +0 -0
  286. /package/{react/src → src/react}/use-o.ts +0 -0
  287. /package/{react/src → src/react}/use-tl.ts +0 -0
  288. /package/{react-devtools/src → src/react-devtools}/StateEditor.tsx +0 -0
  289. /package/{react-devtools/src → src/react-devtools}/StateIndex.tsx +0 -0
  290. /package/{react-devtools/src → src/react-devtools}/TimelineIndex.tsx +0 -0
  291. /package/{react-devtools/src → src/react-devtools}/TransactionIndex.tsx +0 -0
  292. /package/{react-devtools/src → src/react-devtools}/elastic-input/ElasticInput.tsx +0 -0
  293. /package/{react-devtools/src → src/react-devtools}/elastic-input/NumberInput.tsx +0 -0
  294. /package/{react-devtools/src → src/react-devtools}/elastic-input/TextInput.tsx +0 -0
  295. /package/{react-devtools/src → src/react-devtools}/elastic-input/index.ts +0 -0
  296. /package/{react-devtools/src → src/react-devtools}/error-boundary/DefaultFallback.tsx +0 -0
  297. /package/{react-devtools/src → src/react-devtools}/error-boundary/ReactErrorBoundary.tsx +0 -0
  298. /package/{react-devtools/src → src/react-devtools}/error-boundary/index.ts +0 -0
  299. /package/{react-devtools/src → src/react-devtools}/index.ts +0 -0
  300. /package/{react-devtools/src → src/react-devtools}/json-editor/default-components.tsx +0 -0
  301. /package/{react-devtools/src → src/react-devtools}/json-editor/developer-interface.tsx +0 -0
  302. /package/{react-devtools/src → src/react-devtools}/json-editor/editors-by-type/array-editor.tsx +0 -0
  303. /package/{react-devtools/src → src/react-devtools}/json-editor/editors-by-type/non-json.tsx +0 -0
  304. /package/{react-devtools/src → src/react-devtools}/json-editor/editors-by-type/object-editor.tsx +0 -0
  305. /package/{react-devtools/src → src/react-devtools}/json-editor/editors-by-type/primitive-editors.tsx +0 -0
  306. /package/{react-devtools/src → src/react-devtools}/json-editor/editors-by-type/utilities/array-elements.ts +0 -0
  307. /package/{react-devtools/src → src/react-devtools}/json-editor/editors-by-type/utilities/cast-json.ts +0 -0
  308. /package/{react-devtools/src → src/react-devtools}/json-editor/editors-by-type/utilities/cast-to-json.ts +0 -0
  309. /package/{react-devtools/src → src/react-devtools}/json-editor/editors-by-type/utilities/object-properties.ts +0 -0
  310. /package/{react-devtools/src → src/react-devtools}/json-editor/json-editor-internal.tsx +0 -0
  311. /package/{react-devtools/src → src/react-devtools}/json-editor/todo.md +0 -0
  312. /package/{realtime/src → src/realtime}/index.ts +0 -0
  313. /package/{realtime/src → src/realtime}/realtime-continuity.ts +0 -0
  314. /package/{realtime-client/src → src/realtime-client}/continuity/index.ts +0 -0
  315. /package/{realtime-client/src → src/realtime-client}/continuity/register-and-attempt-confirmed-update.ts +0 -0
  316. /package/{realtime-client/src → src/realtime-client}/continuity/use-conceal-state.ts +0 -0
  317. /package/{realtime-client/src → src/realtime-client}/continuity/use-reveal-state.ts +0 -0
  318. /package/{realtime-client/src → src/realtime-client}/index.ts +0 -0
  319. /package/{realtime-client/src → src/realtime-client}/pull-atom-family-member.ts +0 -0
  320. /package/{realtime-client/src → src/realtime-client}/pull-atom.ts +0 -0
  321. /package/{realtime-client/src → src/realtime-client}/pull-mutable-atom-family-member.ts +0 -0
  322. /package/{realtime-client/src → src/realtime-client}/pull-mutable-atom.ts +0 -0
  323. /package/{realtime-client/src → src/realtime-client}/pull-selector-family-member.ts +0 -0
  324. /package/{realtime-client/src → src/realtime-client}/pull-selector.ts +0 -0
  325. /package/{realtime-client/src → src/realtime-client}/push-state.ts +0 -0
  326. /package/{realtime-client/src → src/realtime-client}/realtime-client-stores/index.ts +0 -0
  327. /package/{realtime-client/src → src/realtime-client}/server-action.ts +0 -0
  328. /package/{realtime-client/src → src/realtime-client}/sync-continuity.ts +0 -0
  329. /package/{realtime-react/src → src/realtime-react}/use-pull-atom-family-member.ts +0 -0
  330. /package/{realtime-react/src → src/realtime-react}/use-pull-atom.ts +0 -0
  331. /package/{realtime-react/src → src/realtime-react}/use-pull-mutable-atom.ts +0 -0
  332. /package/{realtime-react/src → src/realtime-react}/use-pull-mutable-family-member.ts +0 -0
  333. /package/{realtime-react/src → src/realtime-react}/use-pull-selector-family-member.ts +0 -0
  334. /package/{realtime-react/src → src/realtime-react}/use-pull-selector.ts +0 -0
  335. /package/{realtime-react/src → src/realtime-react}/use-push.ts +0 -0
  336. /package/{realtime-react/src → src/realtime-react}/use-realtime-service.ts +0 -0
  337. /package/{realtime-react/src → src/realtime-react}/use-server-action.ts +0 -0
  338. /package/{realtime-react/src → src/realtime-react}/use-sync-continuity.ts +0 -0
  339. /package/{realtime-server/src → src/realtime-server}/README.md +0 -0
  340. /package/{realtime-server/src → src/realtime-server}/continuity/prepare-to-send-initial-payload.ts +0 -0
  341. /package/{realtime-server/src → src/realtime-server}/continuity/prepare-to-serve-transaction-request.ts +0 -0
  342. /package/{realtime-server/src → src/realtime-server}/continuity/prepare-to-sync-realtime-continuity.ts +0 -0
  343. /package/{realtime-server/src → src/realtime-server}/continuity/prepare-to-track-client-acknowledgement.ts +0 -0
  344. /package/{realtime-server/src → src/realtime-server}/continuity/subscribe-to-continuity-actions.ts +0 -0
  345. /package/{realtime-server/src → src/realtime-server}/continuity/subscribe-to-continuity-perpectives.ts +0 -0
  346. /package/{realtime-server/src → src/realtime-server}/index.ts +0 -0
  347. /package/{realtime-server/src → src/realtime-server}/ipc-sockets/child-socket.ts +0 -0
  348. /package/{realtime-server/src → src/realtime-server}/ipc-sockets/custom-socket.ts +0 -0
  349. /package/{realtime-server/src → src/realtime-server}/ipc-sockets/index.ts +0 -0
  350. /package/{realtime-server/src → src/realtime-server}/ipc-sockets/parent-socket.ts +0 -0
  351. /package/{realtime-server/src → src/realtime-server}/realtime-action-receiver.ts +0 -0
  352. /package/{realtime-server/src → src/realtime-server}/realtime-family-provider.ts +0 -0
  353. /package/{realtime-server/src → src/realtime-server}/realtime-mutable-family-provider.ts +0 -0
  354. /package/{realtime-server/src → src/realtime-server}/realtime-mutable-provider.ts +0 -0
  355. /package/{realtime-server/src → src/realtime-server}/realtime-server-stores/index.ts +0 -0
  356. /package/{realtime-server/src → src/realtime-server}/realtime-state-provider.ts +0 -0
  357. /package/{realtime-server/src → src/realtime-server}/realtime-state-receiver.ts +0 -0
  358. /package/{realtime-testing/src → src/realtime-testing}/index.ts +0 -0
  359. /package/{realtime-testing/src → src/realtime-testing}/setup-realtime-test.tsx +0 -0
  360. /package/{transceivers/set-rtx/src → src/transceivers/set-rtx}/index.ts +0 -0
  361. /package/{web/src → src/web}/index.ts +0 -0
  362. /package/{web/src → src/web}/persist-sync.ts +0 -0
@@ -0,0 +1,1274 @@
1
+ import "../devtools-CAg2k57t.js";
2
+ import { IMPLICIT, become, createAtomFamily, createStandaloneAtom, findInStore } from "atom.io/internal";
3
+ import { JSON_DEFAULTS, fromEntries, isJson, stringifyJson, toEntries } from "atom.io/json";
4
+ import { getState, redo, undo } from "atom.io";
5
+ import { Component, Fragment, createContext, forwardRef, useContext, useId, useImperativeHandle, useLayoutEffect, useRef, useState } from "react";
6
+ import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
7
+ import { StoreContext, useI, useO } from "atom.io/react";
8
+ import { LayoutGroup, motion, spring } from "motion/react";
9
+ import { attachIntrospectionStates, discoverType, jsonRefinery, prettyJson, primitiveRefinery } from "atom.io/introspection";
10
+ import { persistSync } from "atom.io/web";
11
+
12
+ //#region src/react-devtools/Button.tsx
13
+ const OpenClose = ({ isOpen, setIsOpen, disabled, testid }) => {
14
+ return /* @__PURE__ */ jsx("button", {
15
+ type: "button",
16
+ "data-testid": testid,
17
+ className: `carat ${isOpen ? `open` : `closed`}`,
18
+ onClick: () => {
19
+ setIsOpen((prev) => !prev);
20
+ },
21
+ disabled,
22
+ children: "▶"
23
+ });
24
+ };
25
+ const button = { OpenClose };
26
+
27
+ //#endregion
28
+ //#region src/react-devtools/elastic-input/ElasticInput.tsx
29
+ const ElasticInput = forwardRef(function ElasticInputFC(props, ref) {
30
+ const inputRef = useRef(null);
31
+ const spanRef = useRef(null);
32
+ const [inputWidth, setInputWidth] = useState(`auto`);
33
+ useImperativeHandle(ref, () => ({ focus: () => {
34
+ inputRef.current?.focus();
35
+ } }));
36
+ const extraWidth = props.type === `number` ? 15 : 0;
37
+ useLayoutEffect(() => {
38
+ if (spanRef.current) {
39
+ setInputWidth(`${spanRef.current.offsetWidth + extraWidth}px`);
40
+ const interval = setInterval(() => {
41
+ if (spanRef.current) setInputWidth(`${spanRef.current.offsetWidth + extraWidth}px`);
42
+ }, 1e3);
43
+ return () => {
44
+ clearInterval(interval);
45
+ };
46
+ }
47
+ }, [inputRef.current?.value, props.value]);
48
+ return /* @__PURE__ */ jsxs("div", {
49
+ style: {
50
+ display: `inline-block`,
51
+ position: `relative`
52
+ },
53
+ children: [/* @__PURE__ */ jsx("input", {
54
+ ...props,
55
+ ref: inputRef,
56
+ style: {
57
+ padding: 0,
58
+ borderRadius: 0,
59
+ border: `none`,
60
+ fontFamily: `inherit`,
61
+ fontSize: `inherit`,
62
+ width: inputWidth,
63
+ ...props.style
64
+ }
65
+ }), /* @__PURE__ */ jsx("span", {
66
+ ref: spanRef,
67
+ style: {
68
+ padding: props.style?.padding,
69
+ position: `absolute`,
70
+ visibility: `hidden`,
71
+ whiteSpace: `pre`,
72
+ fontFamily: props.style?.fontFamily ?? `inherit`,
73
+ fontSize: props.style?.fontSize ?? `inherit`
74
+ },
75
+ children: props.value
76
+ })]
77
+ });
78
+ });
79
+
80
+ //#endregion
81
+ //#region src/react-devtools/elastic-input/NumberInput.tsx
82
+ function clampInto(min, max) {
83
+ return (value) => value < min ? min : value > max ? max : value;
84
+ }
85
+ function round(value, decimalPlaces) {
86
+ if (decimalPlaces === void 0) return value;
87
+ const factor = 10 ** decimalPlaces;
88
+ return Math.round(value * factor) / factor;
89
+ }
90
+ const VALID_NON_NUMBERS = [
91
+ ``,
92
+ `-`,
93
+ `.`,
94
+ `-.`
95
+ ];
96
+ const isValidNonNumber = (input) => VALID_NON_NUMBERS.includes(input);
97
+ const VALID_NON_NUMBER_INTERPRETATIONS = {
98
+ "": null,
99
+ "-": 0,
100
+ ".": 0,
101
+ "-.": 0
102
+ };
103
+ const isDecimalInProgress = (input) => input === `0` || !Number.isNaN(Number(input)) && input.includes(`.`);
104
+ const textToValue = (input, allowDecimal) => {
105
+ if (isValidNonNumber(input)) return VALID_NON_NUMBER_INTERPRETATIONS[input];
106
+ return allowDecimal ? Number.parseFloat(input) : Math.round(Number.parseFloat(input));
107
+ };
108
+ const DEFAULT_NUMBER_CONSTRAINTS = {
109
+ max: Number.POSITIVE_INFINITY,
110
+ min: Number.NEGATIVE_INFINITY,
111
+ decimalPlaces: 100,
112
+ nullable: true
113
+ };
114
+ const initRefinery = (constraints) => (input) => {
115
+ if (input === null && constraints.nullable === true) return null;
116
+ const { max, min, decimalPlaces } = {
117
+ ...DEFAULT_NUMBER_CONSTRAINTS,
118
+ ...constraints
119
+ };
120
+ let constrained = clampInto(min, max)(input ?? 0);
121
+ if (decimalPlaces) constrained = round(constrained, decimalPlaces);
122
+ return constrained;
123
+ };
124
+ const valueToText = (numericValue) => {
125
+ if (numericValue === null || numericValue === void 0) return ``;
126
+ return numericValue.toString();
127
+ };
128
+ const NumberInput = ({ autoSize = false, decimalPlaces, disabled = false, label, max, min, name, onChange, onClick, placeholder = ``, set = () => null, testid, value = null }) => {
129
+ const htmlId = useId();
130
+ const [temporaryEntry, setTemporaryEntry] = useState(null);
131
+ const userHasMadeDeliberateChange = useRef(false);
132
+ const refine = initRefinery({
133
+ max,
134
+ min,
135
+ decimalPlaces,
136
+ nullable: true
137
+ });
138
+ const allowDecimal = decimalPlaces === void 0 || decimalPlaces > 0;
139
+ const handleBlur = () => {
140
+ if (userHasMadeDeliberateChange.current) {
141
+ set(refine(value ?? null));
142
+ setTemporaryEntry(null);
143
+ }
144
+ userHasMadeDeliberateChange.current = false;
145
+ };
146
+ const handleChange = (event) => {
147
+ if (onChange) onChange(event);
148
+ if (set === void 0) return;
149
+ userHasMadeDeliberateChange.current = true;
150
+ const input = event.target.value;
151
+ if (isValidNonNumber(input) || isDecimalInProgress(input)) {
152
+ setTemporaryEntry(input);
153
+ const textInterpretation = isDecimalInProgress(input) ? input : min?.toString() ?? `0`;
154
+ const newValue = textToValue(textInterpretation, allowDecimal);
155
+ set(refine(newValue));
156
+ return;
157
+ }
158
+ setTemporaryEntry(null);
159
+ const inputIsNumeric = !Number.isNaN(Number(input)) && !input.includes(` `) || allowDecimal && input === `.` || allowDecimal && input === `-.` || input === `` || input === `-`;
160
+ const numericValue = textToValue(input, allowDecimal);
161
+ if (inputIsNumeric) set(refine(numericValue));
162
+ };
163
+ const displayValue = temporaryEntry ?? valueToText(value ? refine(value) : value);
164
+ return /* @__PURE__ */ jsxs("span", { children: [label ? /* @__PURE__ */ jsx("label", {
165
+ htmlFor: htmlId,
166
+ children: label
167
+ }) : null, autoSize ? /* @__PURE__ */ jsx(ElasticInput, {
168
+ type: "text",
169
+ value: displayValue,
170
+ placeholder: placeholder ?? `-`,
171
+ onChange: handleChange,
172
+ onBlur: handleBlur,
173
+ disabled,
174
+ name: name ?? htmlId,
175
+ id: htmlId,
176
+ onClick,
177
+ "data-testid": testid
178
+ }) : /* @__PURE__ */ jsx("input", {
179
+ type: "text",
180
+ value: displayValue,
181
+ placeholder: placeholder ?? `-`,
182
+ onChange: handleChange,
183
+ onBlur: handleBlur,
184
+ disabled,
185
+ name: name ?? htmlId,
186
+ id: htmlId,
187
+ onClick,
188
+ "data-testid": testid
189
+ })] });
190
+ };
191
+
192
+ //#endregion
193
+ //#region src/react-devtools/elastic-input/TextInput.tsx
194
+ const TextInput = ({ value, set, label, placeholder, autoSize = false, testid }) => {
195
+ const htmlId = useId();
196
+ return /* @__PURE__ */ jsxs("span", { children: [label ? /* @__PURE__ */ jsx("label", {
197
+ htmlFor: htmlId,
198
+ children: label
199
+ }) : null, autoSize ? /* @__PURE__ */ jsx(ElasticInput, {
200
+ id: htmlId,
201
+ type: "text",
202
+ value,
203
+ onChange: (e) => set?.(e.target.value),
204
+ disabled: set === void 0,
205
+ placeholder,
206
+ "data-testid": testid
207
+ }) : /* @__PURE__ */ jsx("input", {
208
+ id: htmlId,
209
+ type: "text",
210
+ value,
211
+ onChange: (e) => set?.(e.target.value),
212
+ disabled: set === void 0,
213
+ placeholder,
214
+ "data-testid": testid
215
+ })] });
216
+ };
217
+
218
+ //#endregion
219
+ //#region src/react-devtools/json-editor/editors-by-type/non-json.tsx
220
+ const NonJsonEditor = ({ data, testid }) => {
221
+ return data === void 0 ? /* @__PURE__ */ jsx(ElasticInput, {
222
+ disabled: true,
223
+ value: "undefined",
224
+ "data-testid": `${testid}-undefined`
225
+ }) : /* @__PURE__ */ jsx(ElasticInput, {
226
+ disabled: true,
227
+ value: Object.getPrototypeOf(data).constructor.name + ` ` + JSON.stringify(data),
228
+ "data-testid": `${testid}-non-json-${Object.getPrototypeOf(data).constructor.name}`
229
+ });
230
+ };
231
+
232
+ //#endregion
233
+ //#region src/react-devtools/json-editor/json-editor-internal.tsx
234
+ const JsonEditor_INTERNAL = ({ data, set, name, rename, remove, recast, path = [], isReadonly = () => false, isHidden = () => false, className, style, Header: HeaderDisplay, Components, testid }) => {
235
+ const dataIsJson = isJson(data);
236
+ const refined = jsonRefinery.refine(data) ?? {
237
+ type: `non-json`,
238
+ data
239
+ };
240
+ const SubEditor = dataIsJson ? SubEditors[refined.type] : NonJsonEditor;
241
+ const disabled = isReadonly(path);
242
+ return isHidden(path) ? null : /* @__PURE__ */ jsx(Components.ErrorBoundary, { children: /* @__PURE__ */ jsxs(Components.EditorWrapper, {
243
+ className,
244
+ style,
245
+ testid,
246
+ children: [
247
+ remove ? disabled ? /* @__PURE__ */ jsx(Components.Button, {
248
+ disabled: true,
249
+ testid: `${testid}-delete`,
250
+ children: /* @__PURE__ */ jsx(Components.DeleteIcon, {})
251
+ }) : /* @__PURE__ */ jsx(Components.Button, {
252
+ testid: `${testid}-delete`,
253
+ onClick: () => {
254
+ remove();
255
+ },
256
+ children: /* @__PURE__ */ jsx(Components.DeleteIcon, {})
257
+ }) : null,
258
+ HeaderDisplay && /* @__PURE__ */ jsx(HeaderDisplay, { data }),
259
+ rename && /* @__PURE__ */ jsx(Components.KeyWrapper, { children: /* @__PURE__ */ jsx(ElasticInput, {
260
+ value: name,
261
+ onChange: disabled ? void 0 : (e) => {
262
+ rename(e.target.value);
263
+ },
264
+ disabled,
265
+ "data-testid": `${testid}-rename`
266
+ }) }),
267
+ /* @__PURE__ */ jsx(SubEditor, {
268
+ data: refined.data,
269
+ set,
270
+ remove,
271
+ rename,
272
+ path,
273
+ isReadonly,
274
+ isHidden,
275
+ Components,
276
+ testid
277
+ }),
278
+ recast && dataIsJson ? /* @__PURE__ */ jsx("select", {
279
+ onChange: disabled ? void 0 : (e) => {
280
+ recast(e.target.value);
281
+ },
282
+ value: refined.type,
283
+ disabled,
284
+ "data-testid": `${testid}-recast`,
285
+ children: Object.keys(SubEditors).map((type) => /* @__PURE__ */ jsx("option", {
286
+ value: type,
287
+ children: type
288
+ }, type))
289
+ }) : null
290
+ ]
291
+ }) });
292
+ };
293
+
294
+ //#endregion
295
+ //#region src/react-devtools/json-editor/editors-by-type/utilities/array-elements.ts
296
+ const makeElementSetters = (data, set) => data.map((value, index) => (newValue) => {
297
+ set(() => {
298
+ const newData = [...data];
299
+ newData[index] = become(newValue)(value);
300
+ return newData;
301
+ });
302
+ });
303
+
304
+ //#endregion
305
+ //#region src/react-devtools/json-editor/editors-by-type/array-editor.tsx
306
+ const ArrayEditor = ({ path = [], isReadonly = () => false, isHidden = () => false, data, set, Components, testid }) => {
307
+ const setElement = makeElementSetters(data, set);
308
+ return /* @__PURE__ */ jsx(Fragment$1, { children: data.map((element, index) => {
309
+ const newPath = [...path, index];
310
+ return /* @__PURE__ */ jsx(JsonEditor_INTERNAL, {
311
+ path: newPath,
312
+ isReadonly,
313
+ isHidden,
314
+ data: element,
315
+ set: setElement[index],
316
+ Components,
317
+ className: "json_editor_element",
318
+ testid: `${testid}-element-${index}`
319
+ }, newPath.join(``));
320
+ }) });
321
+ };
322
+
323
+ //#endregion
324
+ //#region src/react-devtools/json-editor/editors-by-type/utilities/cast-json.ts
325
+ const stringToBoolean = (str) => str === `true`;
326
+ const stringToNumber = (str) => Number(str);
327
+ const stringToArray = (str) => str.split(`,`);
328
+ const stringToObject = (str) => {
329
+ try {
330
+ return JSON.parse(str);
331
+ } catch (e) {
332
+ return { [str]: str };
333
+ }
334
+ };
335
+ const objectToString = (obj) => JSON.stringify(obj);
336
+ const objectToBoolean = (obj) => obj[`true`] === true;
337
+ const objectToNumber = (obj) => Number(obj[`number`] ?? obj[`size`] ?? obj[`count`] ?? 0);
338
+ const objectToArray = (obj) => Object.entries(obj);
339
+ const booleanToString = (bool) => bool.toString();
340
+ const booleanToNumber = (bool) => +bool;
341
+ const booleanToObject = (bool) => ({ [bool.toString()]: bool });
342
+ const booleanToArray = (bool) => [bool];
343
+ const numberToString = (num) => num.toString();
344
+ const numberToBoolean = (num) => num === 1;
345
+ const numberToObject = (num) => ({ number: num });
346
+ const numberToArray = (num) => Array(num).fill(null);
347
+ const arrayToString = (arr) => arr.join(`,`);
348
+ const arrayToNumber = (arr) => arr.length;
349
+ const arrayToBoolean = (arr) => typeof arr[0] === `boolean` ? arr[0] : arr.length > 0;
350
+ const arrayToObject = (arr) => arr.reduce((acc, cur, idx) => {
351
+ acc[`${idx}`] = cur;
352
+ return acc;
353
+ }, {});
354
+ const nullToString = () => ``;
355
+ const nullToNumber = () => 0;
356
+ const nullToBoolean = () => false;
357
+ const nullToArray = () => [];
358
+ const nullToObject = () => ({});
359
+
360
+ //#endregion
361
+ //#region src/react-devtools/json-editor/editors-by-type/utilities/cast-to-json.ts
362
+ const castToJson = (input) => {
363
+ const refined = jsonRefinery.refine(input);
364
+ switch (refined?.type) {
365
+ case `array`: {
366
+ const data = refined.data;
367
+ return {
368
+ get array() {
369
+ return data;
370
+ },
371
+ get boolean() {
372
+ return arrayToBoolean(data);
373
+ },
374
+ get number() {
375
+ return arrayToNumber(data);
376
+ },
377
+ get object() {
378
+ return arrayToObject(data);
379
+ },
380
+ get string() {
381
+ return arrayToString(data);
382
+ },
383
+ get null() {
384
+ return null;
385
+ }
386
+ };
387
+ }
388
+ case `boolean`: {
389
+ const data = refined.data;
390
+ return {
391
+ get array() {
392
+ return booleanToArray(data);
393
+ },
394
+ get boolean() {
395
+ return data;
396
+ },
397
+ get number() {
398
+ return booleanToNumber(data);
399
+ },
400
+ get object() {
401
+ return booleanToObject(data);
402
+ },
403
+ get string() {
404
+ return booleanToString(data);
405
+ },
406
+ get null() {
407
+ return null;
408
+ }
409
+ };
410
+ }
411
+ case `number`: {
412
+ const data = refined.data;
413
+ return {
414
+ get array() {
415
+ return numberToArray(data);
416
+ },
417
+ get boolean() {
418
+ return numberToBoolean(data);
419
+ },
420
+ get number() {
421
+ return data;
422
+ },
423
+ get object() {
424
+ return numberToObject(data);
425
+ },
426
+ get string() {
427
+ return numberToString(data);
428
+ },
429
+ get null() {
430
+ return null;
431
+ }
432
+ };
433
+ }
434
+ case `object`: {
435
+ const data = refined.data;
436
+ return {
437
+ get array() {
438
+ return objectToArray(data);
439
+ },
440
+ get boolean() {
441
+ return objectToBoolean(data);
442
+ },
443
+ get number() {
444
+ return objectToNumber(data);
445
+ },
446
+ get object() {
447
+ return data;
448
+ },
449
+ get string() {
450
+ return objectToString(data);
451
+ },
452
+ get null() {
453
+ return null;
454
+ }
455
+ };
456
+ }
457
+ case `string`: {
458
+ const data = refined.data;
459
+ return {
460
+ get array() {
461
+ return stringToArray(data);
462
+ },
463
+ get boolean() {
464
+ return stringToBoolean(data);
465
+ },
466
+ get number() {
467
+ return stringToNumber(data);
468
+ },
469
+ get object() {
470
+ return stringToObject(data);
471
+ },
472
+ get string() {
473
+ return data;
474
+ },
475
+ get null() {
476
+ return null;
477
+ }
478
+ };
479
+ }
480
+ case `null`:
481
+ case void 0: return {
482
+ get array() {
483
+ return nullToArray();
484
+ },
485
+ get boolean() {
486
+ return nullToBoolean();
487
+ },
488
+ get number() {
489
+ return nullToNumber();
490
+ },
491
+ get object() {
492
+ return nullToObject();
493
+ },
494
+ get string() {
495
+ return nullToString();
496
+ },
497
+ get null() {
498
+ return null;
499
+ }
500
+ };
501
+ }
502
+ };
503
+
504
+ //#endregion
505
+ //#region src/react-devtools/json-editor/editors-by-type/utilities/object-properties.ts
506
+ const makePropertySetters = (data, set) => fromEntries(toEntries(data).map(([key, value]) => [key, (newValue) => {
507
+ set({
508
+ ...data,
509
+ [key]: become(newValue)(value)
510
+ });
511
+ }]));
512
+ const makePropertyRenamers = (data, set, stableKeyMapRef) => fromEntries(toEntries(data).map(([key, value]) => [key, (newKey) => {
513
+ if (!Object.hasOwn(data, newKey)) set(() => {
514
+ const entries = Object.entries(data);
515
+ const index = entries.findIndex(([k]) => k === key);
516
+ entries[index] = [newKey, value];
517
+ const stableKeyMap = stableKeyMapRef.current;
518
+ stableKeyMapRef.current = {
519
+ ...stableKeyMap,
520
+ [newKey]: stableKeyMap[key]
521
+ };
522
+ return Object.fromEntries(entries);
523
+ });
524
+ }]));
525
+ const makePropertyRemovers = (data, set) => fromEntries(toEntries(data).map(([key]) => [key, () => {
526
+ set(() => {
527
+ const { [key]: _,...rest } = data;
528
+ return rest;
529
+ });
530
+ }]));
531
+ const makePropertyRecasters = (data, set) => fromEntries(toEntries(data).map(([key, value]) => [key, (newType) => {
532
+ set(() => ({
533
+ ...data,
534
+ [key]: castToJson(value)[newType]
535
+ }));
536
+ }]));
537
+ const makePropertyCreationInterface = (data, set) => (key, type) => (value) => {
538
+ set({
539
+ ...data,
540
+ [key]: value ?? JSON_DEFAULTS[type]
541
+ });
542
+ };
543
+ const makePropertySorter = (data, set, sortFn) => () => {
544
+ const sortedKeys = Object.keys(data).sort(sortFn);
545
+ const sortedObj = {};
546
+ for (const key of sortedKeys) sortedObj[key] = data[key];
547
+ set(sortedObj);
548
+ };
549
+
550
+ //#endregion
551
+ //#region src/react-devtools/json-editor/editors-by-type/object-editor.tsx
552
+ const ObjectEditor = ({ path = [], isReadonly = () => false, isHidden = () => false, data, set, Components, testid }) => {
553
+ const disabled = isReadonly(path);
554
+ const stableKeyMap = useRef(Object.keys(data).reduce((acc, key) => {
555
+ acc[key] = key;
556
+ return acc;
557
+ }, {}));
558
+ const setProperty = makePropertySetters(data, set);
559
+ const renameProperty = makePropertyRenamers(data, set, stableKeyMap);
560
+ const removeProperty = makePropertyRemovers(data, set);
561
+ const recastProperty = makePropertyRecasters(data, set);
562
+ const sortProperties = makePropertySorter(data, set);
563
+ const makePropertyAdder = makePropertyCreationInterface(data, set);
564
+ return /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx(Components.Button, {
565
+ testid: `${testid}-sort-properties`,
566
+ onClick: () => {
567
+ sortProperties();
568
+ },
569
+ disabled,
570
+ children: "Sort"
571
+ }), /* @__PURE__ */ jsxs(Components.ObjectWrapper, { children: [/* @__PURE__ */ jsx("div", {
572
+ className: "json_editor_properties",
573
+ children: Object.keys(data).map((key) => {
574
+ const originalKey = stableKeyMap.current[key];
575
+ const newPath = [...path, key];
576
+ const originalPath = [...path, originalKey];
577
+ return /* @__PURE__ */ jsx(JsonEditor_INTERNAL, {
578
+ path: newPath,
579
+ name: key,
580
+ isReadonly,
581
+ isHidden,
582
+ data: data[key],
583
+ set: setProperty[key],
584
+ rename: renameProperty[key],
585
+ remove: removeProperty[key],
586
+ recast: recastProperty[key],
587
+ className: "json_editor_property",
588
+ Components,
589
+ testid: `${testid}-property-${key}`
590
+ }, originalPath.join(`.`));
591
+ })
592
+ }), disabled ? /* @__PURE__ */ jsx(Components.Button, {
593
+ disabled: true,
594
+ testid: `${testid}-add-property`,
595
+ children: "+"
596
+ }) : /* @__PURE__ */ jsx(Components.Button, {
597
+ testid: `${testid}-add-property`,
598
+ onClick: () => {
599
+ makePropertyAdder(`new_property`, `string`)();
600
+ },
601
+ children: "+"
602
+ })] })] });
603
+ };
604
+
605
+ //#endregion
606
+ //#region src/react-devtools/json-editor/editors-by-type/primitive-editors.tsx
607
+ const BooleanEditor = ({ data, set, Components, testid }) => /* @__PURE__ */ jsx(Components.BooleanWrapper, { children: /* @__PURE__ */ jsx("input", {
608
+ "data-testid": `${testid}-boolean-input`,
609
+ type: "checkbox",
610
+ checked: data,
611
+ onChange: (event) => {
612
+ set(event.target.checked);
613
+ }
614
+ }) });
615
+ const NullEditor = ({ Components, testid }) => /* @__PURE__ */ jsx(Components.Null, { testid: `${testid}-null` });
616
+ const NumberEditor = ({ path = [], isReadonly = () => false, data, set, Components, testid }) => /* @__PURE__ */ jsx(Components.NumberWrapper, { children: /* @__PURE__ */ jsx(NumberInput, {
617
+ testid: `${testid}-number-input`,
618
+ value: data,
619
+ set: isReadonly(path) ? void 0 : (newValue) => {
620
+ set(Number(newValue));
621
+ },
622
+ autoSize: true
623
+ }) });
624
+ const StringEditor = ({ path = [], isReadonly = () => false, data, set, Components, testid }) => {
625
+ return /* @__PURE__ */ jsx(Components.StringWrapper, { children: /* @__PURE__ */ jsx(TextInput, {
626
+ testid: `${testid}-string-input`,
627
+ value: data,
628
+ set: isReadonly(path) ? void 0 : set,
629
+ autoSize: true
630
+ }) });
631
+ };
632
+
633
+ //#endregion
634
+ //#region src/react-devtools/error-boundary/DefaultFallback.tsx
635
+ const DefaultFallback = ({ error, errorInfo }) => {
636
+ const component = errorInfo?.componentStack?.split(` `).filter(Boolean)[2];
637
+ const message = error?.toString() ?? errorInfo?.componentStack ?? `Unknown error`;
638
+ return /* @__PURE__ */ jsx("div", {
639
+ "data-testid": "error-boundary",
640
+ style: {
641
+ flex: `1`,
642
+ background: `black`,
643
+ backgroundImage: `url(./src/assets/kablooey.gif)`,
644
+ backgroundPosition: `center`,
645
+ backgroundSize: `overlay`
646
+ },
647
+ children: /* @__PURE__ */ jsx("div", {
648
+ style: {
649
+ margin: `50px`,
650
+ marginTop: `0`,
651
+ padding: `50px`,
652
+ border: `1px solid dashed`
653
+ },
654
+ children: /* @__PURE__ */ jsxs("span", {
655
+ style: {
656
+ background: `black`,
657
+ color: `white`,
658
+ padding: 10,
659
+ paddingTop: 5
660
+ },
661
+ children: [
662
+ `⚠️ `,
663
+ /* @__PURE__ */ jsx("span", {
664
+ style: {
665
+ color: `#fc0`,
666
+ fontWeight: 700
667
+ },
668
+ children: component
669
+ }),
670
+ ` ⚠️ `,
671
+ message
672
+ ]
673
+ })
674
+ })
675
+ });
676
+ };
677
+
678
+ //#endregion
679
+ //#region src/react-devtools/error-boundary/ReactErrorBoundary.tsx
680
+ var ErrorBoundary = class extends Component {
681
+ constructor(props) {
682
+ super(props);
683
+ this.state = {};
684
+ }
685
+ componentDidCatch(error, errorInfo) {
686
+ this.props.onError?.(error, errorInfo);
687
+ this.setState({
688
+ error,
689
+ errorInfo
690
+ });
691
+ }
692
+ render() {
693
+ const { error, errorInfo } = this.state;
694
+ const { children, Fallback = DefaultFallback } = this.props;
695
+ return errorInfo ? /* @__PURE__ */ jsx(Fallback, {
696
+ error,
697
+ errorInfo
698
+ }) : children;
699
+ }
700
+ };
701
+
702
+ //#endregion
703
+ //#region src/react-devtools/json-editor/default-components.tsx
704
+ const DEFAULT_JSON_EDITOR_COMPONENTS = {
705
+ ErrorBoundary: ({ children }) => /* @__PURE__ */ jsx(ErrorBoundary, { children }),
706
+ Button: ({ onClick, children, disabled, testid }) => /* @__PURE__ */ jsx("button", {
707
+ type: "button",
708
+ className: "json_editor_button",
709
+ onClick,
710
+ disabled,
711
+ "data-testid": testid,
712
+ children
713
+ }),
714
+ EditorWrapper: ({ children, className, testid }) => /* @__PURE__ */ jsx("div", {
715
+ className: `json_editor` + (className ? ` ${className}` : ``),
716
+ "data-testid": testid,
717
+ children
718
+ }),
719
+ ArrayWrapper: ({ children, testid }) => /* @__PURE__ */ jsx("div", {
720
+ className: "json_editor_array",
721
+ "data-testid": testid,
722
+ children
723
+ }),
724
+ ObjectWrapper: ({ children, testid }) => /* @__PURE__ */ jsx("div", {
725
+ className: "json_editor_object",
726
+ "data-testid": testid,
727
+ children
728
+ }),
729
+ StringWrapper: ({ children, testid }) => /* @__PURE__ */ jsx("span", {
730
+ className: "json_editor_string",
731
+ "data-testid": testid,
732
+ children
733
+ }),
734
+ NumberWrapper: ({ children, testid }) => /* @__PURE__ */ jsx("span", {
735
+ className: "json_editor_number",
736
+ "data-testid": testid,
737
+ children
738
+ }),
739
+ BooleanWrapper: ({ children, testid }) => /* @__PURE__ */ jsx("span", {
740
+ className: "json_editor_boolean",
741
+ "data-testid": testid,
742
+ children
743
+ }),
744
+ Null: ({ testid }) => /* @__PURE__ */ jsx("span", {
745
+ className: "json_editor_null",
746
+ "data-testid": testid
747
+ }),
748
+ DeleteIcon: () => /* @__PURE__ */ jsx("span", {
749
+ className: "json_editor_icon json_editor_delete",
750
+ children: "x"
751
+ }),
752
+ MissingPropertyWrapper: ({ children, testid }) => /* @__PURE__ */ jsx("span", {
753
+ className: "json_editor_missing_property",
754
+ "data-testid": testid,
755
+ children
756
+ }),
757
+ KeyWrapper: ({ children, testid }) => /* @__PURE__ */ jsx("span", {
758
+ className: "json_editor_key",
759
+ "data-testid": testid,
760
+ children
761
+ })
762
+ };
763
+
764
+ //#endregion
765
+ //#region src/react-devtools/json-editor/developer-interface.tsx
766
+ const JsonEditor = ({ data, set, name, rename, remove, isReadonly = () => false, isHidden = () => false, className, Header, style, Components: CustomComponents = {}, testid }) => {
767
+ const Components = {
768
+ ...DEFAULT_JSON_EDITOR_COMPONENTS,
769
+ ...CustomComponents
770
+ };
771
+ return /* @__PURE__ */ jsx(JsonEditor_INTERNAL, {
772
+ data,
773
+ set,
774
+ name,
775
+ rename,
776
+ remove,
777
+ path: [],
778
+ isReadonly,
779
+ isHidden,
780
+ className,
781
+ Header,
782
+ style,
783
+ Components,
784
+ testid
785
+ });
786
+ };
787
+
788
+ //#endregion
789
+ //#region src/react-devtools/json-editor/index.ts
790
+ const SubEditors = {
791
+ array: ArrayEditor,
792
+ boolean: BooleanEditor,
793
+ null: NullEditor,
794
+ number: NumberEditor,
795
+ object: ObjectEditor,
796
+ string: StringEditor
797
+ };
798
+
799
+ //#endregion
800
+ //#region src/react-devtools/StateEditor.tsx
801
+ const StateEditor = ({ token }) => {
802
+ const set = useI(token);
803
+ const data = useO(token);
804
+ return /* @__PURE__ */ jsx(JsonEditor, {
805
+ testid: `${token.key}-state-editor`,
806
+ data,
807
+ set
808
+ });
809
+ };
810
+ const ReadonlySelectorViewer = ({ token }) => {
811
+ const data = useO(token);
812
+ return /* @__PURE__ */ jsx(JsonEditor, {
813
+ testid: `${token.key}-state-editor`,
814
+ data,
815
+ set: () => null,
816
+ isReadonly: () => true
817
+ });
818
+ };
819
+ const StoreEditor = ({ token }) => {
820
+ if (token.type === `readonly_selector`) return /* @__PURE__ */ jsx(ReadonlySelectorViewer, { token });
821
+ return /* @__PURE__ */ jsx(StateEditor, { token });
822
+ };
823
+
824
+ //#endregion
825
+ //#region src/react-devtools/store.ts
826
+ function attachDevtoolsStates(store) {
827
+ const introspectionStates = attachIntrospectionStates(store);
828
+ const devtoolsAreOpenState = createStandaloneAtom(store, {
829
+ key: `🔍 Devtools Are Open`,
830
+ default: true,
831
+ effects: typeof window === `undefined` ? [] : [persistSync(window.localStorage, JSON, `🔍 Devtools Are Open`)]
832
+ });
833
+ const devtoolsViewSelectionState = createStandaloneAtom(store, {
834
+ key: `🔍 Devtools View Selection`,
835
+ default: `atoms`,
836
+ effects: typeof window === `undefined` ? [] : [persistSync(window.localStorage, JSON, `🔍 Devtools View`)]
837
+ });
838
+ const devtoolsViewOptionsState = createStandaloneAtom(store, {
839
+ key: `🔍 Devtools View Options`,
840
+ default: [
841
+ `atoms`,
842
+ `selectors`,
843
+ `transactions`,
844
+ `timelines`
845
+ ],
846
+ effects: typeof window === `undefined` ? [] : [persistSync(window.localStorage, JSON, `🔍 Devtools View Options`)]
847
+ });
848
+ const viewIsOpenAtoms = createAtomFamily(store, {
849
+ key: `🔍 Devtools View Is Open`,
850
+ default: false,
851
+ effects: (key) => typeof window === `undefined` ? [] : [persistSync(window.localStorage, JSON, key + `:view-is-open`)]
852
+ });
853
+ return {
854
+ ...introspectionStates,
855
+ devtoolsAreOpenState,
856
+ devtoolsViewSelectionState,
857
+ devtoolsViewOptionsState,
858
+ viewIsOpenAtoms,
859
+ store
860
+ };
861
+ }
862
+ const DevtoolsContext = createContext(attachDevtoolsStates(IMPLICIT.STORE));
863
+
864
+ //#endregion
865
+ //#region src/react-devtools/StateIndex.tsx
866
+ const StateIndexLeafNode = ({ node, isOpenState, typeState }) => {
867
+ const setIsOpen = useI(isOpenState);
868
+ const isOpen = useO(isOpenState);
869
+ const state = useO(node);
870
+ const stateType = useO(typeState);
871
+ const isPrimitive = Boolean(primitiveRefinery.refine(state));
872
+ return /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsxs("header", { children: [
873
+ /* @__PURE__ */ jsx(button.OpenClose, {
874
+ isOpen: isOpen && !isPrimitive,
875
+ testid: `open-close-state-${node.key}`,
876
+ setIsOpen,
877
+ disabled: isPrimitive
878
+ }),
879
+ /* @__PURE__ */ jsxs("main", {
880
+ onClick: () => {
881
+ console.log(node, getState(node));
882
+ },
883
+ onKeyUp: () => {
884
+ console.log(node, getState(node));
885
+ },
886
+ children: [/* @__PURE__ */ jsx("h2", { children: node.family?.subKey ?? node.key }), /* @__PURE__ */ jsxs("span", {
887
+ className: "type detail",
888
+ children: [
889
+ "(",
890
+ stateType,
891
+ ")"
892
+ ]
893
+ })]
894
+ }),
895
+ /* @__PURE__ */ jsx(StoreEditor, { token: node })
896
+ ] }), isOpen && !isPrimitive ? /* @__PURE__ */ jsx("main", { children: /* @__PURE__ */ jsx(StoreEditor, { token: node }) }) : null] });
897
+ };
898
+ const StateIndexTreeNode = ({ node, isOpenState }) => {
899
+ const setIsOpen = useI(isOpenState);
900
+ const isOpen = useO(isOpenState);
901
+ const { typeSelectors, viewIsOpenAtoms, store } = useContext(DevtoolsContext);
902
+ for (const [key, childNode] of node.familyMembers) {
903
+ findInStore(store, viewIsOpenAtoms, key);
904
+ findInStore(store, typeSelectors, childNode.key);
905
+ }
906
+ return /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsxs("header", { children: [/* @__PURE__ */ jsx(button.OpenClose, {
907
+ isOpen,
908
+ testid: `open-close-state-family-${node.key}`,
909
+ setIsOpen
910
+ }), /* @__PURE__ */ jsxs("main", { children: [/* @__PURE__ */ jsx("h2", { children: node.key }), /* @__PURE__ */ jsx("span", {
911
+ className: "type detail",
912
+ children: " (family)"
913
+ })] })] }), isOpen ? [...node.familyMembers.entries()].map(([key, childNode]) => /* @__PURE__ */ jsx(StateIndexNode, {
914
+ node: childNode,
915
+ isOpenState: findInStore(store, viewIsOpenAtoms, childNode.key),
916
+ typeState: findInStore(store, typeSelectors, childNode.key)
917
+ }, key)) : null] });
918
+ };
919
+ const StateIndexNode = ({ node, isOpenState, typeState }) => {
920
+ return /* @__PURE__ */ jsx("section", {
921
+ className: "node state",
922
+ "data-testid": `state-${node.key}`,
923
+ children: `type` in node ? /* @__PURE__ */ jsx(StateIndexLeafNode, {
924
+ node,
925
+ isOpenState,
926
+ typeState
927
+ }) : /* @__PURE__ */ jsx(StateIndexTreeNode, {
928
+ node,
929
+ isOpenState
930
+ })
931
+ });
932
+ };
933
+ const StateIndex = ({ tokenIndex }) => {
934
+ const tokenIds = useO(tokenIndex);
935
+ const { typeSelectors, viewIsOpenAtoms, store } = useContext(DevtoolsContext);
936
+ return /* @__PURE__ */ jsx("article", {
937
+ className: "index state_index",
938
+ "data-testid": "state-index",
939
+ children: [...tokenIds.entries()].filter(([key]) => !key.startsWith(`👁‍🗨`)).sort().map(([key, node]) => {
940
+ return /* @__PURE__ */ jsx(StateIndexNode, {
941
+ node,
942
+ isOpenState: findInStore(store, viewIsOpenAtoms, node.key),
943
+ typeState: findInStore(store, typeSelectors, node.key)
944
+ }, key);
945
+ })
946
+ });
947
+ };
948
+
949
+ //#endregion
950
+ //#region src/react-devtools/Updates.tsx
951
+ const AtomUpdateFC = ({ atomUpdate }) => {
952
+ return /* @__PURE__ */ jsxs("article", {
953
+ className: "node atom_update",
954
+ onClick: () => {
955
+ console.log(atomUpdate);
956
+ },
957
+ onKeyUp: () => {
958
+ console.log(atomUpdate);
959
+ },
960
+ children: [/* @__PURE__ */ jsxs("span", {
961
+ className: "detail",
962
+ children: [atomUpdate.key, ": "]
963
+ }), /* @__PURE__ */ jsx("span", { children: /* @__PURE__ */ jsx("span", {
964
+ className: "summary",
965
+ children: prettyJson.diff(atomUpdate.oldValue, atomUpdate.newValue).summary
966
+ }) })]
967
+ }, atomUpdate.key);
968
+ };
969
+ const TransactionUpdateFC = ({ serialNumber, transactionUpdate }) => {
970
+ return /* @__PURE__ */ jsxs("article", {
971
+ className: "node transaction_update",
972
+ "data-testid": `transaction-update-${transactionUpdate.key}-${serialNumber}`,
973
+ children: [/* @__PURE__ */ jsx("header", { children: /* @__PURE__ */ jsx("h4", { children: serialNumber }) }), /* @__PURE__ */ jsxs("main", { children: [
974
+ /* @__PURE__ */ jsxs("section", {
975
+ className: "transaction_params",
976
+ children: [/* @__PURE__ */ jsx("span", {
977
+ className: "detail",
978
+ children: "params: "
979
+ }), transactionUpdate.params.map((param, index) => {
980
+ return /* @__PURE__ */ jsxs("article", {
981
+ className: "node transaction_param",
982
+ onClick: () => {
983
+ console.log(transactionUpdate);
984
+ },
985
+ onKeyUp: () => {
986
+ console.log(transactionUpdate);
987
+ },
988
+ children: [/* @__PURE__ */ jsxs("span", {
989
+ className: "detail",
990
+ children: [discoverType(param), ": "]
991
+ }), /* @__PURE__ */ jsx("span", {
992
+ className: "summary",
993
+ children: typeof param === `object` && param !== null && `type` in param && `target` in param ? /* @__PURE__ */ jsx(Fragment$1, { children: JSON.stringify(param.type) }) : /* @__PURE__ */ jsx(Fragment$1, { children: JSON.stringify(param) })
994
+ })]
995
+ }, `param` + index);
996
+ })]
997
+ }),
998
+ /* @__PURE__ */ jsxs("section", {
999
+ className: "node transaction_output",
1000
+ children: [
1001
+ /* @__PURE__ */ jsx("span", {
1002
+ className: "detail",
1003
+ children: "output: "
1004
+ }),
1005
+ /* @__PURE__ */ jsx("span", {
1006
+ className: "detail",
1007
+ children: discoverType(transactionUpdate.output)
1008
+ }),
1009
+ transactionUpdate.output ? /* @__PURE__ */ jsxs("span", {
1010
+ className: "summary",
1011
+ children: [": ", JSON.stringify(transactionUpdate.output)]
1012
+ }) : null
1013
+ ]
1014
+ }),
1015
+ /* @__PURE__ */ jsxs("section", {
1016
+ className: "transaction_impact",
1017
+ children: [/* @__PURE__ */ jsx("span", {
1018
+ className: "detail",
1019
+ children: "impact: "
1020
+ }), transactionUpdate.updates.filter((token) => token.type !== `molecule_creation` && token.type !== `molecule_disposal` && token.type !== `molecule_transfer` && token.type !== `state_creation` && token.type !== `state_disposal` && !token.key.startsWith(`👁‍🗨`)).map((update, index) => {
1021
+ switch (update.type) {
1022
+ case `atom_update`:
1023
+ case `selector_update`: return /* @__PURE__ */ jsx(article.AtomUpdate, {
1024
+ serialNumber: index,
1025
+ atomUpdate: update
1026
+ }, `${transactionUpdate.key}:${index}:${update.key}`);
1027
+ case `transaction_update`: return /* @__PURE__ */ jsx(TransactionUpdateFC, {
1028
+ serialNumber: index,
1029
+ transactionUpdate: update
1030
+ }, `${transactionUpdate.key}:${index}:${update.key}`);
1031
+ case `molecule_creation`:
1032
+ case `molecule_disposal`:
1033
+ case `molecule_transfer`:
1034
+ case `state_creation`:
1035
+ case `state_disposal`: return null;
1036
+ }
1037
+ })]
1038
+ })
1039
+ ] })]
1040
+ });
1041
+ };
1042
+ const TimelineUpdateFC = ({ timelineUpdate, serialNumber }) => {
1043
+ return `key` in timelineUpdate ? /* @__PURE__ */ jsxs("article", {
1044
+ className: "node timeline_update",
1045
+ "data-testid": `timeline-update-${typeof timelineUpdate.key === `string` ? timelineUpdate.key : stringifyJson(timelineUpdate.key)}-${serialNumber}`,
1046
+ children: [/* @__PURE__ */ jsx("header", { children: /* @__PURE__ */ jsxs("h4", { children: [
1047
+ timelineUpdate.timestamp,
1048
+ ": ",
1049
+ timelineUpdate.type,
1050
+ " (",
1051
+ timelineUpdate.key,
1052
+ ")"
1053
+ ] }) }), /* @__PURE__ */ jsx("main", { children: timelineUpdate.type === `transaction_update` ? timelineUpdate.updates.filter((token) => token.type !== `molecule_creation` && token.type !== `molecule_disposal` && token.type !== `molecule_transfer` && token.type !== `state_creation` && token.type !== `state_disposal` && !token.key.startsWith(`👁‍🗨`)).map((update, index) => {
1054
+ switch (update.type) {
1055
+ case `atom_update`:
1056
+ case `selector_update`: return /* @__PURE__ */ jsx(article.AtomUpdate, {
1057
+ serialNumber: index,
1058
+ atomUpdate: update
1059
+ }, `${timelineUpdate.key}:${index}:${update.key}`);
1060
+ case `transaction_update`: return /* @__PURE__ */ jsx(TransactionUpdateFC, {
1061
+ serialNumber: index,
1062
+ transactionUpdate: update
1063
+ }, `${timelineUpdate.key}:${index}:${update.key}`);
1064
+ case `molecule_creation`:
1065
+ case `molecule_disposal`:
1066
+ case `molecule_transfer`:
1067
+ case `state_creation`:
1068
+ case `state_disposal`: return null;
1069
+ }
1070
+ }) : timelineUpdate.type === `selector_update` ? timelineUpdate.atomUpdates.filter((token) => !token.key.startsWith(`👁‍🗨`)).map((atomUpdate, index) => {
1071
+ return /* @__PURE__ */ jsx(article.AtomUpdate, {
1072
+ serialNumber: index,
1073
+ atomUpdate
1074
+ }, `${timelineUpdate.key}:${index}:${atomUpdate.key}`);
1075
+ }) : timelineUpdate.type === `atom_update` ? /* @__PURE__ */ jsx(article.AtomUpdate, {
1076
+ serialNumber: timelineUpdate.timestamp,
1077
+ atomUpdate: timelineUpdate
1078
+ }) : null })]
1079
+ }) : null;
1080
+ };
1081
+ const article = {
1082
+ AtomUpdate: AtomUpdateFC,
1083
+ TransactionUpdate: TransactionUpdateFC,
1084
+ TimelineUpdate: TimelineUpdateFC
1085
+ };
1086
+
1087
+ //#endregion
1088
+ //#region src/react-devtools/TimelineIndex.tsx
1089
+ const YouAreHere = () => {
1090
+ return /* @__PURE__ */ jsx("span", {
1091
+ className: "you_are_here",
1092
+ children: "you are here"
1093
+ });
1094
+ };
1095
+ const TimelineLog = ({ token, isOpenState, timelineState }) => {
1096
+ const timeline = useO(timelineState);
1097
+ const isOpen = useO(isOpenState);
1098
+ const setIsOpen = useI(isOpenState);
1099
+ return /* @__PURE__ */ jsxs("section", {
1100
+ className: "node timeline_log",
1101
+ "data-testid": `timeline-${token.key}`,
1102
+ children: [/* @__PURE__ */ jsxs("header", { children: [/* @__PURE__ */ jsx(button.OpenClose, {
1103
+ isOpen,
1104
+ testid: `open-close-timeline-${token.key}`,
1105
+ setIsOpen
1106
+ }), /* @__PURE__ */ jsxs("main", { children: [
1107
+ /* @__PURE__ */ jsx("h2", { children: token.key }),
1108
+ /* @__PURE__ */ jsxs("span", {
1109
+ className: "detail length",
1110
+ children: [
1111
+ "(",
1112
+ timeline.at,
1113
+ "/",
1114
+ timeline.history.length,
1115
+ ")"
1116
+ ]
1117
+ }),
1118
+ /* @__PURE__ */ jsx("span", { className: "gap" }),
1119
+ /* @__PURE__ */ jsxs("nav", { children: [/* @__PURE__ */ jsx("button", {
1120
+ type: "button",
1121
+ onClick: () => {
1122
+ undo(token);
1123
+ },
1124
+ disabled: timeline.at === 0,
1125
+ children: "undo"
1126
+ }), /* @__PURE__ */ jsx("button", {
1127
+ type: "button",
1128
+ onClick: () => {
1129
+ redo(token);
1130
+ },
1131
+ disabled: timeline.at === timeline.history.length,
1132
+ children: "redo"
1133
+ })] })
1134
+ ] })] }), isOpen ? /* @__PURE__ */ jsx("main", { children: timeline.history.map((update, index) => update.type !== `molecule_creation` && update.type !== `molecule_disposal` && update.type !== `state_creation` && update.type !== `state_disposal` ? /* @__PURE__ */ jsxs(Fragment, { children: [
1135
+ index === timeline.at ? /* @__PURE__ */ jsx(YouAreHere, {}) : null,
1136
+ /* @__PURE__ */ jsx(article.TimelineUpdate, {
1137
+ timelineUpdate: update,
1138
+ serialNumber: index
1139
+ }),
1140
+ index === timeline.history.length - 1 && timeline.at === timeline.history.length ? /* @__PURE__ */ jsx(YouAreHere, {}) : null
1141
+ ] }, update.key + index + timeline.at) : null) }) : null]
1142
+ });
1143
+ };
1144
+ const TimelineIndex = () => {
1145
+ const { timelineIndex, timelineSelectors, viewIsOpenAtoms, store } = useContext(DevtoolsContext);
1146
+ const tokenIds = useO(timelineIndex);
1147
+ return /* @__PURE__ */ jsx("article", {
1148
+ className: "index timeline_index",
1149
+ "data-testid": "timeline-index",
1150
+ children: tokenIds.filter((token) => !token.key.startsWith(`👁‍🗨`)).map((token) => {
1151
+ return /* @__PURE__ */ jsx(TimelineLog, {
1152
+ token,
1153
+ isOpenState: findInStore(store, viewIsOpenAtoms, token.key),
1154
+ timelineState: findInStore(store, timelineSelectors, token.key)
1155
+ }, token.key);
1156
+ })
1157
+ });
1158
+ };
1159
+
1160
+ //#endregion
1161
+ //#region src/react-devtools/TransactionIndex.tsx
1162
+ const TransactionLog = ({ token, isOpenState, logState }) => {
1163
+ const log = useO(logState);
1164
+ const isOpen = useO(isOpenState);
1165
+ const setIsOpen = useI(isOpenState);
1166
+ return /* @__PURE__ */ jsxs("section", {
1167
+ className: "node transaction_log",
1168
+ "data-testid": `transaction-${token.key}`,
1169
+ children: [/* @__PURE__ */ jsxs("header", { children: [/* @__PURE__ */ jsx(button.OpenClose, {
1170
+ isOpen,
1171
+ testid: `open-close-transaction-${token.key}`,
1172
+ setIsOpen
1173
+ }), /* @__PURE__ */ jsxs("main", { children: [/* @__PURE__ */ jsx("h2", { children: token.key }), /* @__PURE__ */ jsxs("span", {
1174
+ className: "detail length",
1175
+ children: [
1176
+ "(",
1177
+ log.length,
1178
+ ")"
1179
+ ]
1180
+ })] })] }), isOpen ? /* @__PURE__ */ jsx("main", { children: log.map((update, index) => /* @__PURE__ */ jsx(article.TransactionUpdate, {
1181
+ serialNumber: index,
1182
+ transactionUpdate: update
1183
+ }, update.key + index)) }) : null]
1184
+ });
1185
+ };
1186
+ const TransactionIndex = () => {
1187
+ const { transactionIndex, transactionLogSelectors, viewIsOpenAtoms, store } = useContext(DevtoolsContext);
1188
+ const tokenIds = useO(transactionIndex);
1189
+ return /* @__PURE__ */ jsx("article", {
1190
+ className: "index transaction_index",
1191
+ "data-testid": "transaction-index",
1192
+ children: tokenIds.filter((token) => !token.key.startsWith(`🔍`)).map((token) => {
1193
+ return /* @__PURE__ */ jsx(TransactionLog, {
1194
+ token,
1195
+ isOpenState: findInStore(store, viewIsOpenAtoms, token.key),
1196
+ logState: findInStore(store, transactionLogSelectors, token.key)
1197
+ }, token.key);
1198
+ })
1199
+ });
1200
+ };
1201
+
1202
+ //#endregion
1203
+ //#region src/react-devtools/AtomIODevtools.tsx
1204
+ const AtomIODevtools = () => {
1205
+ const store = useContext(StoreContext);
1206
+ return /* @__PURE__ */ jsx(DevtoolsContext.Provider, {
1207
+ value: attachDevtoolsStates(store),
1208
+ children: /* @__PURE__ */ jsx(AtomIODevtoolsInternal, {})
1209
+ });
1210
+ };
1211
+ const AtomIODevtoolsInternal = () => {
1212
+ const constraintsRef = useRef(null);
1213
+ const { atomIndex, selectorIndex, devtoolsAreOpenState, devtoolsViewSelectionState, devtoolsViewOptionsState } = useContext(DevtoolsContext);
1214
+ const setDevtoolsAreOpen = useI(devtoolsAreOpenState);
1215
+ const devtoolsAreOpen = useO(devtoolsAreOpenState);
1216
+ const setDevtoolsView = useI(devtoolsViewSelectionState);
1217
+ const devtoolsView = useO(devtoolsViewSelectionState);
1218
+ const devtoolsViewOptions = useO(devtoolsViewOptionsState);
1219
+ const mouseHasMoved = useRef(false);
1220
+ return /* @__PURE__ */ jsxs("span", {
1221
+ style: {
1222
+ position: `fixed`,
1223
+ top: 0,
1224
+ left: 0,
1225
+ right: 0,
1226
+ bottom: 0
1227
+ },
1228
+ children: [/* @__PURE__ */ jsx(motion.span, {
1229
+ ref: constraintsRef,
1230
+ "data-css": "atom_io_devtools_zone",
1231
+ style: {
1232
+ position: `fixed`,
1233
+ top: 0,
1234
+ left: 0,
1235
+ right: 0,
1236
+ bottom: 0,
1237
+ pointerEvents: `none`
1238
+ }
1239
+ }), /* @__PURE__ */ jsxs(motion.main, {
1240
+ drag: true,
1241
+ dragConstraints: constraintsRef,
1242
+ "data-css": "atom_io_devtools",
1243
+ transition: spring,
1244
+ style: devtoolsAreOpen ? {} : {
1245
+ backgroundColor: `#0000`,
1246
+ borderColor: `#0000`,
1247
+ maxHeight: 28,
1248
+ maxWidth: 33
1249
+ },
1250
+ children: [devtoolsAreOpen ? /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsxs(motion.header, { children: [/* @__PURE__ */ jsx("h1", { children: "atom.io" }), /* @__PURE__ */ jsx("nav", { children: devtoolsViewOptions.map((viewOption) => /* @__PURE__ */ jsx("button", {
1251
+ type: "button",
1252
+ "data-testid": `view-${viewOption}`,
1253
+ className: viewOption === devtoolsView ? `active` : ``,
1254
+ onClick: () => {
1255
+ setDevtoolsView(viewOption);
1256
+ },
1257
+ disabled: viewOption === devtoolsView,
1258
+ children: viewOption
1259
+ }, viewOption)) })] }), /* @__PURE__ */ jsx(motion.main, { children: /* @__PURE__ */ jsx(LayoutGroup, { children: devtoolsView === `atoms` ? /* @__PURE__ */ jsx(StateIndex, { tokenIndex: atomIndex }) : devtoolsView === `selectors` ? /* @__PURE__ */ jsx(StateIndex, { tokenIndex: selectorIndex }) : devtoolsView === `transactions` ? /* @__PURE__ */ jsx(TransactionIndex, {}) : /* @__PURE__ */ jsx(TimelineIndex, {}) }) })] }) : null, /* @__PURE__ */ jsx("footer", { children: /* @__PURE__ */ jsx("button", {
1260
+ type: "button",
1261
+ onMouseDown: () => mouseHasMoved.current = false,
1262
+ onMouseMove: () => mouseHasMoved.current = true,
1263
+ onMouseUp: () => {
1264
+ if (!mouseHasMoved.current) setDevtoolsAreOpen((open) => !open);
1265
+ },
1266
+ children: "🔍"
1267
+ }) })]
1268
+ })]
1269
+ });
1270
+ };
1271
+
1272
+ //#endregion
1273
+ export { AtomIODevtools, DEFAULT_JSON_EDITOR_COMPONENTS, DEFAULT_NUMBER_CONSTRAINTS, DefaultFallback, ElasticInput, ErrorBoundary, JsonEditor, NumberInput, SubEditors, TextInput, VALID_NON_NUMBERS, VALID_NON_NUMBER_INTERPRETATIONS, castToJson, clampInto, isDecimalInProgress, isValidNonNumber };
1274
+ //# sourceMappingURL=index.js.map