atom.io 0.11.0 → 0.12.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 (174) hide show
  1. package/data/dist/index.cjs +614 -0
  2. package/data/dist/index.cjs.map +1 -0
  3. package/data/dist/index.d.cts +158 -0
  4. package/data/dist/index.d.ts +118 -1
  5. package/data/dist/index.js +551 -30
  6. package/data/dist/index.js.map +1 -1
  7. package/data/dist/metafile-cjs.json +1 -0
  8. package/data/dist/metafile-esm.json +1 -0
  9. package/data/package.json +4 -3
  10. package/data/src/index.ts +1 -0
  11. package/data/src/join.ts +450 -0
  12. package/data/src/struct-family.ts +34 -24
  13. package/data/src/struct.ts +6 -8
  14. package/dist/index.cjs +257 -0
  15. package/dist/index.cjs.map +1 -0
  16. package/dist/{index.d.mts → index.d.cts} +10 -11
  17. package/dist/index.d.ts +10 -11
  18. package/dist/index.js +63 -104
  19. package/dist/index.js.map +1 -1
  20. package/dist/metafile-cjs.json +1 -0
  21. package/dist/metafile-esm.json +1 -0
  22. package/internal/dist/{index.mjs → index.cjs} +716 -495
  23. package/internal/dist/index.cjs.map +1 -0
  24. package/internal/dist/{index.d.mts → index.d.cts} +124 -105
  25. package/internal/dist/index.d.ts +124 -105
  26. package/internal/dist/index.js +651 -555
  27. package/internal/dist/index.js.map +1 -1
  28. package/internal/dist/metafile-cjs.json +1 -0
  29. package/internal/dist/metafile-esm.json +1 -0
  30. package/internal/package.json +4 -3
  31. package/internal/src/atom/create-atom.ts +29 -16
  32. package/internal/src/atom/delete-atom.ts +25 -6
  33. package/internal/src/atom/is-default.ts +4 -17
  34. package/internal/src/caching.ts +28 -23
  35. package/internal/src/families/create-atom-family.ts +3 -2
  36. package/internal/src/families/create-readonly-selector-family.ts +1 -1
  37. package/internal/src/families/create-selector-family.ts +4 -4
  38. package/internal/src/index.ts +4 -2
  39. package/internal/src/lazy-map.ts +33 -0
  40. package/internal/src/mutable/create-mutable-atom-family.ts +2 -2
  41. package/internal/src/mutable/create-mutable-atom.ts +1 -2
  42. package/internal/src/mutable/get-json-family.ts +22 -0
  43. package/internal/src/mutable/get-json-token.ts +1 -0
  44. package/internal/src/mutable/index.ts +1 -0
  45. package/internal/src/mutable/tracker-family.ts +1 -2
  46. package/internal/src/mutable/tracker.ts +8 -6
  47. package/internal/src/mutable/transceiver.ts +2 -0
  48. package/internal/src/not-found-error.ts +27 -0
  49. package/internal/src/operation.ts +2 -3
  50. package/internal/src/{get-state-internal.ts → read-or-compute-value.ts} +13 -6
  51. package/internal/src/selector/create-selector.ts +6 -7
  52. package/internal/src/selector/delete-selector.ts +37 -0
  53. package/internal/src/selector/index.ts +2 -1
  54. package/internal/src/selector/register-selector.ts +7 -7
  55. package/internal/src/set-state/copy-mutable-in-transaction.ts +3 -2
  56. package/internal/src/set-state/emit-update.ts +1 -3
  57. package/internal/src/set-state/evict-downstream.ts +6 -8
  58. package/internal/src/set-state/index.ts +1 -1
  59. package/internal/src/set-state/{set-state-internal.ts → set-atom-or-selector.ts} +2 -3
  60. package/internal/src/set-state/set-atom.ts +5 -6
  61. package/internal/src/store/store.ts +1 -1
  62. package/internal/src/store/withdraw-new-family-member.ts +6 -6
  63. package/internal/src/subscribe/recall-state.ts +1 -2
  64. package/internal/src/subscribe/subscribe-to-root-atoms.ts +2 -2
  65. package/internal/src/timeline/add-atom-to-timeline.ts +5 -16
  66. package/internal/src/timeline/{timeline-internal.ts → create-timeline.ts} +4 -5
  67. package/internal/src/timeline/index.ts +2 -2
  68. package/internal/src/timeline/time-travel.ts +89 -0
  69. package/internal/src/transaction/build-transaction.ts +8 -7
  70. package/internal/src/transaction/{transaction-internal.ts → create-transaction.ts} +6 -5
  71. package/internal/src/transaction/index.ts +2 -3
  72. package/introspection/dist/{index.mjs → index.cjs} +54 -29
  73. package/introspection/dist/index.cjs.map +1 -0
  74. package/introspection/dist/{index.d.mts → index.d.cts} +2 -2
  75. package/introspection/dist/index.d.ts +2 -2
  76. package/introspection/dist/index.js +32 -49
  77. package/introspection/dist/index.js.map +1 -1
  78. package/introspection/dist/metafile-cjs.json +1 -0
  79. package/introspection/dist/metafile-esm.json +1 -0
  80. package/introspection/package.json +4 -3
  81. package/introspection/src/attach-introspection-states.ts +2 -2
  82. package/introspection/src/attach-selector-index.ts +8 -4
  83. package/json/dist/{index.mjs → index.cjs} +20 -7
  84. package/json/dist/{index.mjs.map → index.cjs.map} +1 -1
  85. package/json/dist/{index.d.mts → index.d.cts} +1 -1
  86. package/json/dist/index.d.ts +1 -1
  87. package/json/dist/index.js +6 -19
  88. package/json/dist/index.js.map +1 -1
  89. package/json/dist/metafile-cjs.json +1 -0
  90. package/json/dist/metafile-esm.json +1 -0
  91. package/json/package.json +4 -3
  92. package/package.json +48 -47
  93. package/react/dist/index.cjs +59 -0
  94. package/react/dist/index.cjs.map +1 -0
  95. package/react/dist/index.js +20 -42
  96. package/react/dist/index.js.map +1 -1
  97. package/react/dist/metafile-cjs.json +1 -0
  98. package/react/dist/metafile-esm.json +1 -0
  99. package/react/package.json +4 -3
  100. package/react/src/store-hooks.ts +8 -2
  101. package/react-devtools/dist/{index.mjs → index.cjs} +286 -240
  102. package/react-devtools/dist/index.cjs.map +1 -0
  103. package/react-devtools/dist/{index.d.mts → index.d.cts} +29 -17
  104. package/react-devtools/dist/index.d.ts +29 -17
  105. package/react-devtools/dist/index.js +251 -273
  106. package/react-devtools/dist/index.js.map +1 -1
  107. package/react-devtools/dist/metafile-cjs.json +1 -0
  108. package/react-devtools/dist/metafile-esm.json +1 -0
  109. package/react-devtools/package.json +4 -3
  110. package/react-devtools/src/StateEditor.tsx +8 -8
  111. package/realtime-client/dist/{index.mjs → index.cjs} +50 -21
  112. package/realtime-client/dist/index.js +20 -49
  113. package/realtime-client/dist/metafile-cjs.json +1 -0
  114. package/realtime-client/dist/metafile-esm.json +1 -0
  115. package/realtime-client/package.json +4 -3
  116. package/realtime-react/dist/index.cjs +99 -0
  117. package/realtime-react/dist/index.js +35 -66
  118. package/realtime-react/dist/metafile-cjs.json +1 -0
  119. package/realtime-react/dist/metafile-esm.json +1 -0
  120. package/realtime-react/package.json +4 -3
  121. package/realtime-server/dist/{index.mjs → index.cjs} +67 -40
  122. package/realtime-server/dist/index.js +39 -66
  123. package/realtime-server/dist/metafile-cjs.json +1 -0
  124. package/realtime-server/dist/metafile-esm.json +1 -0
  125. package/realtime-server/package.json +4 -3
  126. package/realtime-testing/dist/{index.mjs → index.cjs} +54 -23
  127. package/realtime-testing/dist/index.js +22 -53
  128. package/realtime-testing/dist/metafile-cjs.json +1 -0
  129. package/realtime-testing/dist/metafile-esm.json +1 -0
  130. package/realtime-testing/package.json +4 -3
  131. package/src/atom.ts +6 -8
  132. package/src/dispose.ts +18 -0
  133. package/src/get-state.ts +16 -0
  134. package/src/index.ts +3 -1
  135. package/src/logger.ts +1 -1
  136. package/src/selector.ts +3 -3
  137. package/src/set-state.ts +22 -0
  138. package/src/silo.ts +7 -8
  139. package/src/timeline.ts +6 -11
  140. package/src/transaction.ts +2 -2
  141. package/transceivers/set-rtx/dist/{index.mjs → index.cjs} +40 -36
  142. package/transceivers/set-rtx/dist/index.cjs.map +1 -0
  143. package/transceivers/set-rtx/dist/{index.d.mts → index.d.cts} +2 -1
  144. package/transceivers/set-rtx/dist/index.d.ts +2 -1
  145. package/transceivers/set-rtx/dist/index.js +37 -37
  146. package/transceivers/set-rtx/dist/index.js.map +1 -1
  147. package/transceivers/set-rtx/dist/metafile-cjs.json +1 -0
  148. package/transceivers/set-rtx/dist/metafile-esm.json +1 -0
  149. package/transceivers/set-rtx/package.json +4 -3
  150. package/transceivers/set-rtx/src/set-rtx.ts +29 -26
  151. package/data/dist/index.d.mts +0 -41
  152. package/data/dist/index.mjs +0 -82
  153. package/data/dist/index.mjs.map +0 -1
  154. package/dist/index.mjs +0 -215
  155. package/dist/index.mjs.map +0 -1
  156. package/internal/dist/index.mjs.map +0 -1
  157. package/internal/src/set-state/set-selector-state.ts +0 -8
  158. package/internal/src/timeline/time-travel-internal.ts +0 -109
  159. package/introspection/dist/index.mjs.map +0 -1
  160. package/react/dist/index.mjs +0 -29
  161. package/react/dist/index.mjs.map +0 -1
  162. package/react-devtools/dist/index.mjs.map +0 -1
  163. package/realtime-react/dist/index.mjs +0 -68
  164. package/src/get-set.ts +0 -48
  165. package/transceivers/set-rtx/dist/index.mjs.map +0 -1
  166. /package/react/dist/{index.d.mts → index.d.cts} +0 -0
  167. /package/realtime-client/dist/{index.mjs.map → index.cjs.map} +0 -0
  168. /package/realtime-client/dist/{index.d.mts → index.d.cts} +0 -0
  169. /package/realtime-react/dist/{index.mjs.map → index.cjs.map} +0 -0
  170. /package/realtime-react/dist/{index.d.mts → index.d.cts} +0 -0
  171. /package/realtime-server/dist/{index.mjs.map → index.cjs.map} +0 -0
  172. /package/realtime-server/dist/{index.d.mts → index.d.cts} +0 -0
  173. /package/realtime-testing/dist/{index.mjs.map → index.cjs.map} +0 -0
  174. /package/realtime-testing/dist/{index.d.mts → index.d.cts} +0 -0
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/attach-introspection-states.ts","../src/attach-atom-index.ts","../src/attach-selector-index.ts","../src/attach-timeline-family.ts","../src/attach-timeline-index.ts","../src/attach-transaction-index.ts","../src/attach-transaction-logs.ts"],"names":["IMPLICIT","createAtom","createSelector","target","createAtomFamily","createSelectorFamily"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAQA,YAAY,kBAAkB;;;ACN9B,SAAS,UAAU,YAAY,gBAAgB,cAAc;AAMtD,IAAM,kBAAkB,CAC9B,QAAe,SAAS,UACmB;AAC3C,QAAM,gCAAgC;AAAA,IACrC;AAAA,MACC,KAAK;AAAA,MACL,SAAS,MAAM;AACd,cAAM,mBAAmB,CAAC,GAAG,MAAM,KAAK,EACtC,OAAO,CAAC,CAAC,GAAG,MAAM,CAAC,IAAI,SAAS,0BAAO,CAAC,EACxC,OAAuB,CAAC,KAAK,CAAC,GAAG,MAAM;AACvC,cAAI,GAAG,IAAI,EAAE,KAAK,MA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AAAA,EACD;AACA,QAAM,gCAAgCC;AAAA,IAIrC;AAAA,MACC,KAAK;AAAA,MACL,KACC,CAAC,QACD,CAAC,EAAE,IAAI,MACN,IAAI,yBAAyB,GAAG,CAAC;AAAA,IACpC;AAAA,IACA;AAAA,EACD;AACA,SAAO;AACR;;;AN1BO,IAAM,4BAA4B,CACxC,QAAyC,sBAAS,UAQ9C;AACJ,SAAO;AAAA,IACN,WAAW,gBAAgB,KAAK;AAAA,IAChC,eAAe,oBAAoB,KAAK;AAAA,IACxC,kBAAkB,uBAAuB,KAAK;AAAA,IAC9C,yBAAyB,sBAAsB,KAAK;AAAA,IACpD,eAAe,oBAAoB,KAAK;AAAA,IACxC,mBAAmB,qBAAqB,KAAK;AAAA,EAC9C;AACD","sourcesContent":["import type {\n\tReadonlySelectorFamily,\n\tReadonlySelectorToken,\n\tTimelineToken,\n\tTransactionToken,\n\tTransactionUpdate,\n\tƒn,\n} from \"atom.io\"\nimport * as __INTERNAL__ from \"atom.io/internal\"\nimport type { Timeline } from \"atom.io/internal\"\n\nimport { type AtomTokenIndex, attachAtomIndex } from \"./attach-atom-index\"\nimport type { SelectorTokenIndex } from \"./attach-selector-index\"\nimport { attachSelectorIndex } from \"./attach-selector-index\"\nimport { attachTimelineFamily } from \"./attach-timeline-family\"\nimport { attachTimelineIndex } from \"./attach-timeline-index\"\nimport { attachTransactionIndex } from \"./attach-transaction-index\"\nimport { attachTransactionLogs } from \"./attach-transaction-logs\"\n\nexport const attachIntrospectionStates = (\n\tstore: __INTERNAL__.Store = __INTERNAL__.IMPLICIT.STORE,\n): {\n\tatomIndex: ReadonlySelectorToken<AtomTokenIndex>\n\tselectorIndex: ReadonlySelectorToken<SelectorTokenIndex>\n\ttransactionIndex: ReadonlySelectorToken<TransactionToken<ƒn>[]>\n\tfindTransactionLogState: ReadonlySelectorFamily<TransactionUpdate<ƒn>[]>\n\ttimelineIndex: ReadonlySelectorToken<TimelineToken[]>\n\tfindTimelineState: ReadonlySelectorFamily<Timeline>\n} => {\n\treturn {\n\t\tatomIndex: attachAtomIndex(store),\n\t\tselectorIndex: attachSelectorIndex(store),\n\t\ttransactionIndex: attachTransactionIndex(store),\n\t\tfindTransactionLogState: attachTransactionLogs(store),\n\t\ttimelineIndex: attachTimelineIndex(store),\n\t\tfindTimelineState: attachTimelineFamily(store),\n\t}\n}\n","import type { AtomToken, ReadonlySelectorToken } from \"atom.io\"\nimport type { Store } from \"atom.io/internal\"\nimport { IMPLICIT, createAtom, createSelector, target } from \"atom.io/internal\"\n\nimport type { StateTokenIndex } from \".\"\n\nexport type AtomTokenIndex = StateTokenIndex<AtomToken<unknown>>\n\nexport const attachAtomIndex = (\n\tstore: Store = IMPLICIT.STORE,\n): ReadonlySelectorToken<AtomTokenIndex> => {\n\tconst atomTokenIndexState__INTERNAL = createAtom<AtomTokenIndex>(\n\t\t{\n\t\t\tkey: `👁‍🗨 Atom Token Index (Internal)`,\n\t\t\tdefault: () => {\n\t\t\t\tconst defaultAtomIndex = [...store.atoms]\n\t\t\t\t\t.filter(([key]) => !key.includes(`👁‍🗨`))\n\t\t\t\t\t.reduce<AtomTokenIndex>((acc, [key]) => {\n\t\t\t\t\t\tacc[key] = { key, type: `atom` }\n\t\t\t\t\t\treturn acc\n\t\t\t\t\t}, {})\n\t\t\t\treturn defaultAtomIndex\n\t\t\t},\n\t\t\teffects: [\n\t\t\t\t({ setSelf }) => {\n\t\t\t\t\tstore.subject.atomCreation.subscribe(`introspection`, (atomToken) => {\n\t\t\t\t\t\tif (atomToken.key.includes(`👁‍🗨`)) {\n\t\t\t\t\t\t\treturn\n\t\t\t\t\t\t}\n\t\t\t\t\t\tconst set = () =>\n\t\t\t\t\t\t\tsetSelf((state) => {\n\t\t\t\t\t\t\t\tconst { key, family } = atomToken\n\t\t\t\t\t\t\t\tif (family) {\n\t\t\t\t\t\t\t\t\tconst { key: familyKey, subKey } = family\n\t\t\t\t\t\t\t\t\tconst current = state[familyKey]\n\t\t\t\t\t\t\t\t\tif (current === undefined || `familyMembers` in current) {\n\t\t\t\t\t\t\t\t\t\tconst familyKeyState = current || {\n\t\t\t\t\t\t\t\t\t\t\tkey: familyKey,\n\t\t\t\t\t\t\t\t\t\t\tfamilyMembers: {},\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\treturn {\n\t\t\t\t\t\t\t\t\t\t\t...state,\n\t\t\t\t\t\t\t\t\t\t\t[familyKey]: {\n\t\t\t\t\t\t\t\t\t\t\t\t...familyKeyState,\n\t\t\t\t\t\t\t\t\t\t\t\tfamilyMembers: {\n\t\t\t\t\t\t\t\t\t\t\t\t\t...familyKeyState.familyMembers,\n\t\t\t\t\t\t\t\t\t\t\t\t\t[subKey]: atomToken,\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\treturn {\n\t\t\t\t\t\t\t\t\t...state,\n\t\t\t\t\t\t\t\t\t[key]: atomToken,\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t})\n\t\t\t\t\t\tif (target(store).operation.open) {\n\t\t\t\t\t\t\tconst unsubscribe = store.subject.operationStatus.subscribe(\n\t\t\t\t\t\t\t\t`introspection: waiting to update atom index`,\n\t\t\t\t\t\t\t\t() => {\n\t\t\t\t\t\t\t\t\tunsubscribe()\n\t\t\t\t\t\t\t\t\tset()\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tset()\n\t\t\t\t\t\t}\n\t\t\t\t\t})\n\t\t\t\t},\n\t\t\t],\n\t\t},\n\t\tundefined,\n\t\tstore,\n\t)\n\treturn createSelector(\n\t\t{\n\t\t\tkey: `👁‍🗨 Atom Token Index`,\n\t\t\tget: ({ get }) => get(atomTokenIndexState__INTERNAL),\n\t\t},\n\t\tundefined,\n\t\tstore,\n\t)\n}\n","import type { ReadonlySelectorToken, SelectorToken } from \"atom.io\"\nimport type { Store } from \"atom.io/internal\"\nimport { IMPLICIT, createAtom, createSelector, target } from \"atom.io/internal\"\n\nimport type { StateTokenIndex } from \".\"\n\nexport type SelectorTokenIndex = StateTokenIndex<\n\tReadonlySelectorToken<unknown> | SelectorToken<unknown>\n>\n\nexport const attachSelectorIndex = (\n\tstore: Store = IMPLICIT.STORE,\n): ReadonlySelectorToken<SelectorTokenIndex> => {\n\tconst readonlySelectorTokenIndexState__INTERNAL =\n\t\tcreateAtom<SelectorTokenIndex>(\n\t\t\t{\n\t\t\t\tkey: `👁‍🗨 Selector Token Index (Internal)`,\n\t\t\t\tdefault: () =>\n\t\t\t\t\tObject.assign(\n\t\t\t\t\t\t[...store.readonlySelectors]\n\t\t\t\t\t\t\t.filter(([key]) => !key.includes(`👁‍🗨`))\n\t\t\t\t\t\t\t.reduce<SelectorTokenIndex>((acc, [key]) => {\n\t\t\t\t\t\t\t\tacc[key] = { key, type: `readonly_selector` }\n\t\t\t\t\t\t\t\treturn acc\n\t\t\t\t\t\t\t}, {}),\n\t\t\t\t\t\t[...store.selectors].reduce<SelectorTokenIndex>((acc, [key]) => {\n\t\t\t\t\t\t\tacc[key] = { key, type: `selector` }\n\t\t\t\t\t\t\treturn acc\n\t\t\t\t\t\t}, {}),\n\t\t\t\t\t),\n\t\t\t\teffects: [\n\t\t\t\t\t({ setSelf }) => {\n\t\t\t\t\t\tstore.subject.selectorCreation.subscribe(\n\t\t\t\t\t\t\t`introspection`,\n\t\t\t\t\t\t\t(selectorToken) => {\n\t\t\t\t\t\t\t\tif (selectorToken.key.includes(`👁‍🗨`)) {\n\t\t\t\t\t\t\t\t\treturn\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tconst set = () =>\n\t\t\t\t\t\t\t\t\tsetSelf((state) => {\n\t\t\t\t\t\t\t\t\t\tconst { key, family } = selectorToken\n\t\t\t\t\t\t\t\t\t\tif (family) {\n\t\t\t\t\t\t\t\t\t\t\tconst { key: familyKey, subKey } = family\n\t\t\t\t\t\t\t\t\t\t\tconst current = state[familyKey]\n\t\t\t\t\t\t\t\t\t\t\tif (current === undefined || `familyMembers` in current) {\n\t\t\t\t\t\t\t\t\t\t\t\tconst familyKeyState = current || {\n\t\t\t\t\t\t\t\t\t\t\t\t\tkey: familyKey,\n\t\t\t\t\t\t\t\t\t\t\t\t\tfamilyMembers: {},\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\treturn {\n\t\t\t\t\t\t\t\t\t\t\t\t\t...state,\n\t\t\t\t\t\t\t\t\t\t\t\t\t[familyKey]: {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t...familyKeyState,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tfamilyMembers: {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t...familyKeyState.familyMembers,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t[subKey]: selectorToken,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\treturn {\n\t\t\t\t\t\t\t\t\t\t\t...state,\n\t\t\t\t\t\t\t\t\t\t\t[key]: selectorToken,\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t})\n\t\t\t\t\t\t\t\tif (target(store).operation.open) {\n\t\t\t\t\t\t\t\t\tconst unsubscribe = store.subject.operationStatus.subscribe(\n\t\t\t\t\t\t\t\t\t\t`introspection: waiting to update selector index`,\n\t\t\t\t\t\t\t\t\t\t() => {\n\t\t\t\t\t\t\t\t\t\t\tunsubscribe()\n\t\t\t\t\t\t\t\t\t\t\tset()\n\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\tset()\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t)\n\t\t\t\t\t},\n\t\t\t\t],\n\t\t\t},\n\t\t\tundefined,\n\t\t\tstore,\n\t\t)\n\treturn createSelector({\n\t\tkey: `👁‍🗨 Selector Token Index`,\n\t\tget: ({ get }) => get(readonlySelectorTokenIndexState__INTERNAL),\n\t})\n}\n","import type { ReadonlySelectorFamily } from \"atom.io\"\nimport type { Store, Timeline } from \"atom.io/internal\"\nimport {\n\tIMPLICIT,\n\tSubject,\n\tcreateAtomFamily,\n\tcreateSelectorFamily,\n} from \"atom.io/internal\"\n\nexport const attachTimelineFamily = (\n\tstore: Store = IMPLICIT.STORE,\n): ReadonlySelectorFamily<Timeline> => {\n\tconst findTimelineLogState__INTERNAL = createAtomFamily<Timeline, string>(\n\t\t{\n\t\t\tkey: `👁‍🗨 Timeline Update Log (Internal)`,\n\t\t\tdefault: (key) =>\n\t\t\t\tstore.timelines.get(key) ?? {\n\t\t\t\t\ttype: `timeline`,\n\t\t\t\t\tkey: ``,\n\t\t\t\t\tat: 0,\n\t\t\t\t\ttimeTraveling: null,\n\t\t\t\t\thistory: [],\n\t\t\t\t\tselectorTime: null,\n\t\t\t\t\ttransactionKey: null,\n\t\t\t\t\tinstall: () => {},\n\t\t\t\t\tsubject: new Subject(),\n\t\t\t\t},\n\t\t\teffects: (key) => [\n\t\t\t\t({ setSelf }) => {\n\t\t\t\t\tconst tl = store.timelines.get(key)\n\t\t\t\t\ttl?.subject.subscribe(`introspection`, (_) => {\n\t\t\t\t\t\tif (store.operation.open === true) {\n\t\t\t\t\t\t\tconst unsubscribe = store.subject.operationStatus.subscribe(\n\t\t\t\t\t\t\t\t`introspection`,\n\t\t\t\t\t\t\t\t(operationStatus) => {\n\t\t\t\t\t\t\t\t\tif (operationStatus.open === false) {\n\t\t\t\t\t\t\t\t\t\tunsubscribe()\n\t\t\t\t\t\t\t\t\t\tsetSelf({ ...tl })\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tsetSelf({ ...tl })\n\t\t\t\t\t\t}\n\t\t\t\t\t})\n\t\t\t\t},\n\t\t\t],\n\t\t},\n\t\tstore,\n\t)\n\tconst findTimelineLogState = createSelectorFamily<Timeline, string>(\n\t\t{\n\t\t\tkey: `👁‍🗨 Timeline Update Log`,\n\t\t\tget:\n\t\t\t\t(key) =>\n\t\t\t\t({ get }) =>\n\t\t\t\t\tget(findTimelineLogState__INTERNAL(key)),\n\t\t},\n\t\tstore,\n\t)\n\treturn findTimelineLogState\n}\n","import type { ReadonlySelectorToken, TimelineToken } from \"atom.io\"\nimport type { Store } from \"atom.io/internal\"\nimport { IMPLICIT, createAtom, createSelector } from \"atom.io/internal\"\n\nexport const attachTimelineIndex = (\n\tstore: Store = IMPLICIT.STORE,\n): ReadonlySelectorToken<TimelineToken[]> => {\n\tconst timelineTokenIndexState__INTERNAL = createAtom<TimelineToken[]>(\n\t\t{\n\t\t\tkey: `👁‍🗨 Timeline Token Index (Internal)`,\n\t\t\tdefault: () =>\n\t\t\t\t[...store.timelines].map(([key]): TimelineToken => {\n\t\t\t\t\treturn { key, type: `timeline` }\n\t\t\t\t}),\n\t\t\teffects: [\n\t\t\t\t({ setSelf }) => {\n\t\t\t\t\tstore.subject.timelineCreation.subscribe(\n\t\t\t\t\t\t`introspection`,\n\t\t\t\t\t\t(timelineToken) => {\n\t\t\t\t\t\t\tsetSelf((state) => [...state, timelineToken])\n\t\t\t\t\t\t},\n\t\t\t\t\t)\n\t\t\t\t},\n\t\t\t],\n\t\t},\n\t\tundefined,\n\t\tstore,\n\t)\n\tconst timelineTokenIndex = createSelector(\n\t\t{\n\t\t\tkey: `👁‍🗨 Timeline Token Index`,\n\t\t\tget: ({ get }) => get(timelineTokenIndexState__INTERNAL),\n\t\t},\n\t\tundefined,\n\t\tstore,\n\t)\n\treturn timelineTokenIndex\n}\n","import type { ReadonlySelectorToken, TransactionToken, ƒn } from \"atom.io\"\nimport type { Store } from \"atom.io/internal\"\nimport { IMPLICIT, createAtom, createSelector } from \"atom.io/internal\"\n\nexport const attachTransactionIndex = (\n\tstore: Store = IMPLICIT.STORE,\n): ReadonlySelectorToken<TransactionToken<ƒn>[]> => {\n\tconst transactionTokenIndexState__INTERNAL = createAtom<\n\t\tTransactionToken<ƒn>[]\n\t>(\n\t\t{\n\t\t\tkey: `👁‍🗨 Transaction Token Index (Internal)`,\n\t\t\tdefault: () =>\n\t\t\t\t[...store.transactions].map(([key]): TransactionToken<ƒn> => {\n\t\t\t\t\treturn { key, type: `transaction` }\n\t\t\t\t}),\n\t\t\teffects: [\n\t\t\t\t({ setSelf }) => {\n\t\t\t\t\tstore.subject.transactionCreation.subscribe(\n\t\t\t\t\t\t`introspection`,\n\t\t\t\t\t\t(transactionToken) => {\n\t\t\t\t\t\t\tsetSelf((state) => [...state, transactionToken])\n\t\t\t\t\t\t},\n\t\t\t\t\t)\n\t\t\t\t},\n\t\t\t],\n\t\t},\n\t\tundefined,\n\t\tstore,\n\t)\n\tconst transactionTokenIndex = createSelector(\n\t\t{\n\t\t\tkey: `👁‍🗨 Transaction Token Index`,\n\t\t\tget: ({ get }) => get(transactionTokenIndexState__INTERNAL),\n\t\t},\n\t\tundefined,\n\t\tstore,\n\t)\n\treturn transactionTokenIndex\n}\n","import type { ReadonlySelectorFamily, TransactionUpdate, ƒn } from \"atom.io\"\nimport type { Store } from \"atom.io/internal\"\nimport {\n\tIMPLICIT,\n\tcreateAtomFamily,\n\tcreateSelectorFamily,\n} from \"atom.io/internal\"\n\nexport const attachTransactionLogs = (\n\tstore: Store = IMPLICIT.STORE,\n): ReadonlySelectorFamily<TransactionUpdate<ƒn>[]> => {\n\tconst findTransactionUpdateLog = createAtomFamily<\n\t\tTransactionUpdate<ƒn>[],\n\t\tstring\n\t>(\n\t\t{\n\t\t\tkey: `👁‍🗨 Transaction Update Log (Internal)`,\n\t\t\tdefault: () => [],\n\t\t\teffects: (key) => [\n\t\t\t\t({ setSelf }) => {\n\t\t\t\t\tconst tx = store.transactions.get(key)\n\t\t\t\t\ttx?.subject.subscribe(`introspection`, (transactionUpdate) => {\n\t\t\t\t\t\tif (transactionUpdate.key === key) {\n\t\t\t\t\t\t\tsetSelf((state) => [...state, transactionUpdate])\n\t\t\t\t\t\t}\n\t\t\t\t\t})\n\t\t\t\t},\n\t\t\t],\n\t\t},\n\t\tstore,\n\t)\n\tconst findTransactionUpdateLogState = createSelectorFamily<\n\t\tTransactionUpdate<ƒn>[],\n\t\tstring\n\t>(\n\t\t{\n\t\t\tkey: `👁‍🗨 Transaction Update Log`,\n\t\t\tget:\n\t\t\t\t(key) =>\n\t\t\t\t({ get }) =>\n\t\t\t\t\tget(findTransactionUpdateLog(key)),\n\t\t},\n\t\tstore,\n\t)\n\treturn findTransactionUpdateLogState\n}\n"]}
1
+ {"version":3,"sources":["../src/attach-introspection-states.ts","../src/attach-atom-index.ts","../src/attach-selector-index.ts","../src/attach-timeline-family.ts","../src/attach-timeline-index.ts","../src/attach-transaction-index.ts","../src/attach-transaction-logs.ts"],"names":["IMPLICIT","createAtom","createSelector","target","createAtomFamily","createSelectorFamily"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAQA,YAAY,cAAc;;;ACN1B,SAAS,UAAU,YAAY,gBAAgB,cAAc;AAMtD,IAAM,kBAAkB,CAC9B,QAAe,SAAS,UACmB;AAC3C,QAAM,gCAAgC;AAAA,IACrC;AAAA,MACC,KAAK;AAAA,MACL,SAAS,MAAM;AACd,cAAM,mBAAmB,CAAC,GAAG,MAAM,KAAK,EACtC,OAAO,CAAC,CAAC,GAAG,MAAM,CAAC,IAAI,SAAS,0BAAO,CAAC,EACxC,OAAuB,CAAC,KAAK,CAAC,GAAG,MAAM;AACvC,cAAI,GAAG,IAAI,EAAE,KAAK,MAAM,OAAO;AAC/B,iBA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IACD;AAAA,IACA;AAAA,EACD;AACA,QAAM,gCAAgCC;AAAA,IAIrC;AAAA,MACC,KAAK;AAAA,MACL,KACC,CAAC,QACD,CAAC,EAAE,IAAI,MACN,IAAI,yBAAyB,GAAG,CAAC;AAAA,IACpC;AAAA,IACA;AAAA,EACD;AACA,SAAO;AACR;;;AN1BO,IAAM,4BAA4B,CACxC,QAAiC,kBAAS,UAQtC;AACJ,SAAO;AAAA,IACN,WAAW,gBAAgB,KAAK;AAAA,IAChC,eAAe,oBAAoB,KAAK;AAAA,IACxC,kBAAkB,uBAAuB,KAAK;AAAA,IAC9C,yBAAyB,sBAAsB,KAAK;AAAA,IACpD,eAAe,oBAAoB,KAAK;AAAA,IACxC,mBAAmB,qBAAqB,KAAK;AAAA,EAC9C;AACD","sourcesContent":["import type {\n\tReadonlySelectorFamily,\n\tReadonlySelectorToken,\n\tTimelineToken,\n\tTransactionToken,\n\tTransactionUpdate,\n\tƒn,\n} from \"atom.io\"\nimport * as Internal from \"atom.io/internal\"\nimport type { Timeline } from \"atom.io/internal\"\n\nimport { type AtomTokenIndex, attachAtomIndex } from \"./attach-atom-index\"\nimport type { SelectorTokenIndex } from \"./attach-selector-index\"\nimport { attachSelectorIndex } from \"./attach-selector-index\"\nimport { attachTimelineFamily } from \"./attach-timeline-family\"\nimport { attachTimelineIndex } from \"./attach-timeline-index\"\nimport { attachTransactionIndex } from \"./attach-transaction-index\"\nimport { attachTransactionLogs } from \"./attach-transaction-logs\"\n\nexport const attachIntrospectionStates = (\n\tstore: Internal.Store = Internal.IMPLICIT.STORE,\n): {\n\tatomIndex: ReadonlySelectorToken<AtomTokenIndex>\n\tselectorIndex: ReadonlySelectorToken<SelectorTokenIndex>\n\ttransactionIndex: ReadonlySelectorToken<TransactionToken<ƒn>[]>\n\tfindTransactionLogState: ReadonlySelectorFamily<TransactionUpdate<ƒn>[]>\n\ttimelineIndex: ReadonlySelectorToken<TimelineToken[]>\n\tfindTimelineState: ReadonlySelectorFamily<Timeline>\n} => {\n\treturn {\n\t\tatomIndex: attachAtomIndex(store),\n\t\tselectorIndex: attachSelectorIndex(store),\n\t\ttransactionIndex: attachTransactionIndex(store),\n\t\tfindTransactionLogState: attachTransactionLogs(store),\n\t\ttimelineIndex: attachTimelineIndex(store),\n\t\tfindTimelineState: attachTimelineFamily(store),\n\t}\n}\n","import type { AtomToken, ReadonlySelectorToken } from \"atom.io\"\nimport type { Store } from \"atom.io/internal\"\nimport { IMPLICIT, createAtom, createSelector, target } from \"atom.io/internal\"\n\nimport type { StateTokenIndex } from \".\"\n\nexport type AtomTokenIndex = StateTokenIndex<AtomToken<unknown>>\n\nexport const attachAtomIndex = (\n\tstore: Store = IMPLICIT.STORE,\n): ReadonlySelectorToken<AtomTokenIndex> => {\n\tconst atomTokenIndexState__INTERNAL = createAtom<AtomTokenIndex>(\n\t\t{\n\t\t\tkey: `👁‍🗨 Atom Token Index (Internal)`,\n\t\t\tdefault: () => {\n\t\t\t\tconst defaultAtomIndex = [...store.atoms]\n\t\t\t\t\t.filter(([key]) => !key.includes(`👁‍🗨`))\n\t\t\t\t\t.reduce<AtomTokenIndex>((acc, [key]) => {\n\t\t\t\t\t\tacc[key] = { key, type: `atom` }\n\t\t\t\t\t\treturn acc\n\t\t\t\t\t}, {})\n\t\t\t\treturn defaultAtomIndex\n\t\t\t},\n\t\t\teffects: [\n\t\t\t\t({ setSelf }) => {\n\t\t\t\t\tstore.subject.atomCreation.subscribe(`introspection`, (atomToken) => {\n\t\t\t\t\t\tif (atomToken.key.includes(`👁‍🗨`)) {\n\t\t\t\t\t\t\treturn\n\t\t\t\t\t\t}\n\t\t\t\t\t\tconst set = () =>\n\t\t\t\t\t\t\tsetSelf((state) => {\n\t\t\t\t\t\t\t\tconst { key, family } = atomToken\n\t\t\t\t\t\t\t\tif (family) {\n\t\t\t\t\t\t\t\t\tconst { key: familyKey, subKey } = family\n\t\t\t\t\t\t\t\t\tconst current = state[familyKey]\n\t\t\t\t\t\t\t\t\tif (current === undefined || `familyMembers` in current) {\n\t\t\t\t\t\t\t\t\t\tconst familyKeyState = current || {\n\t\t\t\t\t\t\t\t\t\t\tkey: familyKey,\n\t\t\t\t\t\t\t\t\t\t\tfamilyMembers: {},\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\treturn {\n\t\t\t\t\t\t\t\t\t\t\t...state,\n\t\t\t\t\t\t\t\t\t\t\t[familyKey]: {\n\t\t\t\t\t\t\t\t\t\t\t\t...familyKeyState,\n\t\t\t\t\t\t\t\t\t\t\t\tfamilyMembers: {\n\t\t\t\t\t\t\t\t\t\t\t\t\t...familyKeyState.familyMembers,\n\t\t\t\t\t\t\t\t\t\t\t\t\t[subKey]: atomToken,\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\treturn {\n\t\t\t\t\t\t\t\t\t...state,\n\t\t\t\t\t\t\t\t\t[key]: atomToken,\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t})\n\t\t\t\t\t\tif (target(store).operation.open) {\n\t\t\t\t\t\t\tconst unsubscribe = store.subject.operationStatus.subscribe(\n\t\t\t\t\t\t\t\t`introspection: waiting to update atom index`,\n\t\t\t\t\t\t\t\t() => {\n\t\t\t\t\t\t\t\t\tunsubscribe()\n\t\t\t\t\t\t\t\t\tset()\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tset()\n\t\t\t\t\t\t}\n\t\t\t\t\t})\n\t\t\t\t},\n\t\t\t],\n\t\t},\n\t\tundefined,\n\t\tstore,\n\t)\n\treturn createSelector(\n\t\t{\n\t\t\tkey: `👁‍🗨 Atom Token Index`,\n\t\t\tget: ({ get }) => get(atomTokenIndexState__INTERNAL),\n\t\t},\n\t\tundefined,\n\t\tstore,\n\t)\n}\n","import type { ReadonlySelectorToken, SelectorToken } from \"atom.io\"\nimport type { Store } from \"atom.io/internal\"\nimport { IMPLICIT, createAtom, createSelector, target } from \"atom.io/internal\"\n\nimport type { StateTokenIndex } from \".\"\n\nexport type SelectorTokenIndex = StateTokenIndex<\n\tReadonlySelectorToken<unknown> | SelectorToken<unknown>\n>\n\nexport const attachSelectorIndex = (\n\tstore: Store = IMPLICIT.STORE,\n): ReadonlySelectorToken<SelectorTokenIndex> => {\n\tconst readonlySelectorTokenIndexState__INTERNAL =\n\t\tcreateAtom<SelectorTokenIndex>(\n\t\t\t{\n\t\t\t\tkey: `👁‍🗨 Selector Token Index (Internal)`,\n\t\t\t\tdefault: () =>\n\t\t\t\t\tObject.assign(\n\t\t\t\t\t\t[...store.readonlySelectors]\n\t\t\t\t\t\t\t.filter(([key]) => !key.includes(`👁‍🗨`))\n\t\t\t\t\t\t\t.reduce<SelectorTokenIndex>((acc, [key]) => {\n\t\t\t\t\t\t\t\tacc[key] = { key, type: `readonly_selector` }\n\t\t\t\t\t\t\t\treturn acc\n\t\t\t\t\t\t\t}, {}),\n\t\t\t\t\t\t[...store.selectors].reduce<SelectorTokenIndex>((acc, [key]) => {\n\t\t\t\t\t\t\tacc[key] = { key, type: `selector` }\n\t\t\t\t\t\t\treturn acc\n\t\t\t\t\t\t}, {}),\n\t\t\t\t\t),\n\t\t\t\teffects: [\n\t\t\t\t\t({ setSelf }) => {\n\t\t\t\t\t\tstore.subject.selectorCreation.subscribe(\n\t\t\t\t\t\t\t`introspection`,\n\t\t\t\t\t\t\t(selectorToken) => {\n\t\t\t\t\t\t\t\tif (selectorToken.key.includes(`👁‍🗨`)) {\n\t\t\t\t\t\t\t\t\treturn\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tconst set = () =>\n\t\t\t\t\t\t\t\t\tsetSelf((state) => {\n\t\t\t\t\t\t\t\t\t\tconst { key, family } = selectorToken\n\t\t\t\t\t\t\t\t\t\tif (family) {\n\t\t\t\t\t\t\t\t\t\t\tconst { key: familyKey, subKey } = family\n\t\t\t\t\t\t\t\t\t\t\tconst current = state[familyKey]\n\t\t\t\t\t\t\t\t\t\t\tif (current === undefined || `familyMembers` in current) {\n\t\t\t\t\t\t\t\t\t\t\t\tconst familyKeyState = current || {\n\t\t\t\t\t\t\t\t\t\t\t\t\tkey: familyKey,\n\t\t\t\t\t\t\t\t\t\t\t\t\tfamilyMembers: {},\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\treturn {\n\t\t\t\t\t\t\t\t\t\t\t\t\t...state,\n\t\t\t\t\t\t\t\t\t\t\t\t\t[familyKey]: {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t...familyKeyState,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tfamilyMembers: {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t...familyKeyState.familyMembers,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t[subKey]: selectorToken,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\treturn {\n\t\t\t\t\t\t\t\t\t\t\t...state,\n\t\t\t\t\t\t\t\t\t\t\t[key]: selectorToken,\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t})\n\t\t\t\t\t\t\t\tif (target(store).operation.open) {\n\t\t\t\t\t\t\t\t\tconst unsubscribe = store.subject.operationStatus.subscribe(\n\t\t\t\t\t\t\t\t\t\t`introspection: waiting to update selector index`,\n\t\t\t\t\t\t\t\t\t\t() => {\n\t\t\t\t\t\t\t\t\t\t\tunsubscribe()\n\t\t\t\t\t\t\t\t\t\t\tset()\n\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\tset()\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t)\n\t\t\t\t\t},\n\t\t\t\t],\n\t\t\t},\n\t\t\tundefined,\n\t\t\tstore,\n\t\t)\n\treturn createSelector(\n\t\t{\n\t\t\tkey: `👁‍🗨 Selector Token Index`,\n\t\t\tget: ({ get }) => get(readonlySelectorTokenIndexState__INTERNAL),\n\t\t},\n\t\tundefined,\n\t\tIMPLICIT.STORE,\n\t)\n}\n","import type { ReadonlySelectorFamily } from \"atom.io\"\nimport type { Store, Timeline } from \"atom.io/internal\"\nimport {\n\tIMPLICIT,\n\tSubject,\n\tcreateAtomFamily,\n\tcreateSelectorFamily,\n} from \"atom.io/internal\"\n\nexport const attachTimelineFamily = (\n\tstore: Store = IMPLICIT.STORE,\n): ReadonlySelectorFamily<Timeline> => {\n\tconst findTimelineLogState__INTERNAL = createAtomFamily<Timeline, string>(\n\t\t{\n\t\t\tkey: `👁‍🗨 Timeline Update Log (Internal)`,\n\t\t\tdefault: (key) =>\n\t\t\t\tstore.timelines.get(key) ?? {\n\t\t\t\t\ttype: `timeline`,\n\t\t\t\t\tkey: ``,\n\t\t\t\t\tat: 0,\n\t\t\t\t\ttimeTraveling: null,\n\t\t\t\t\thistory: [],\n\t\t\t\t\tselectorTime: null,\n\t\t\t\t\ttransactionKey: null,\n\t\t\t\t\tinstall: () => {},\n\t\t\t\t\tsubject: new Subject(),\n\t\t\t\t},\n\t\t\teffects: (key) => [\n\t\t\t\t({ setSelf }) => {\n\t\t\t\t\tconst tl = store.timelines.get(key)\n\t\t\t\t\ttl?.subject.subscribe(`introspection`, (_) => {\n\t\t\t\t\t\tif (store.operation.open === true) {\n\t\t\t\t\t\t\tconst unsubscribe = store.subject.operationStatus.subscribe(\n\t\t\t\t\t\t\t\t`introspection`,\n\t\t\t\t\t\t\t\t(operationStatus) => {\n\t\t\t\t\t\t\t\t\tif (operationStatus.open === false) {\n\t\t\t\t\t\t\t\t\t\tunsubscribe()\n\t\t\t\t\t\t\t\t\t\tsetSelf({ ...tl })\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tsetSelf({ ...tl })\n\t\t\t\t\t\t}\n\t\t\t\t\t})\n\t\t\t\t},\n\t\t\t],\n\t\t},\n\t\tstore,\n\t)\n\tconst findTimelineLogState = createSelectorFamily<Timeline, string>(\n\t\t{\n\t\t\tkey: `👁‍🗨 Timeline Update Log`,\n\t\t\tget:\n\t\t\t\t(key) =>\n\t\t\t\t({ get }) =>\n\t\t\t\t\tget(findTimelineLogState__INTERNAL(key)),\n\t\t},\n\t\tstore,\n\t)\n\treturn findTimelineLogState\n}\n","import type { ReadonlySelectorToken, TimelineToken } from \"atom.io\"\nimport type { Store } from \"atom.io/internal\"\nimport { IMPLICIT, createAtom, createSelector } from \"atom.io/internal\"\n\nexport const attachTimelineIndex = (\n\tstore: Store = IMPLICIT.STORE,\n): ReadonlySelectorToken<TimelineToken[]> => {\n\tconst timelineTokenIndexState__INTERNAL = createAtom<TimelineToken[]>(\n\t\t{\n\t\t\tkey: `👁‍🗨 Timeline Token Index (Internal)`,\n\t\t\tdefault: () =>\n\t\t\t\t[...store.timelines].map(([key]): TimelineToken => {\n\t\t\t\t\treturn { key, type: `timeline` }\n\t\t\t\t}),\n\t\t\teffects: [\n\t\t\t\t({ setSelf }) => {\n\t\t\t\t\tstore.subject.timelineCreation.subscribe(\n\t\t\t\t\t\t`introspection`,\n\t\t\t\t\t\t(timelineToken) => {\n\t\t\t\t\t\t\tsetSelf((state) => [...state, timelineToken])\n\t\t\t\t\t\t},\n\t\t\t\t\t)\n\t\t\t\t},\n\t\t\t],\n\t\t},\n\t\tundefined,\n\t\tstore,\n\t)\n\tconst timelineTokenIndex = createSelector(\n\t\t{\n\t\t\tkey: `👁‍🗨 Timeline Token Index`,\n\t\t\tget: ({ get }) => get(timelineTokenIndexState__INTERNAL),\n\t\t},\n\t\tundefined,\n\t\tstore,\n\t)\n\treturn timelineTokenIndex\n}\n","import type { ReadonlySelectorToken, TransactionToken, ƒn } from \"atom.io\"\nimport type { Store } from \"atom.io/internal\"\nimport { IMPLICIT, createAtom, createSelector } from \"atom.io/internal\"\n\nexport const attachTransactionIndex = (\n\tstore: Store = IMPLICIT.STORE,\n): ReadonlySelectorToken<TransactionToken<ƒn>[]> => {\n\tconst transactionTokenIndexState__INTERNAL = createAtom<\n\t\tTransactionToken<ƒn>[]\n\t>(\n\t\t{\n\t\t\tkey: `👁‍🗨 Transaction Token Index (Internal)`,\n\t\t\tdefault: () =>\n\t\t\t\t[...store.transactions].map(([key]): TransactionToken<ƒn> => {\n\t\t\t\t\treturn { key, type: `transaction` }\n\t\t\t\t}),\n\t\t\teffects: [\n\t\t\t\t({ setSelf }) => {\n\t\t\t\t\tstore.subject.transactionCreation.subscribe(\n\t\t\t\t\t\t`introspection`,\n\t\t\t\t\t\t(transactionToken) => {\n\t\t\t\t\t\t\tsetSelf((state) => [...state, transactionToken])\n\t\t\t\t\t\t},\n\t\t\t\t\t)\n\t\t\t\t},\n\t\t\t],\n\t\t},\n\t\tundefined,\n\t\tstore,\n\t)\n\tconst transactionTokenIndex = createSelector(\n\t\t{\n\t\t\tkey: `👁‍🗨 Transaction Token Index`,\n\t\t\tget: ({ get }) => get(transactionTokenIndexState__INTERNAL),\n\t\t},\n\t\tundefined,\n\t\tstore,\n\t)\n\treturn transactionTokenIndex\n}\n","import type { ReadonlySelectorFamily, TransactionUpdate, ƒn } from \"atom.io\"\nimport type { Store } from \"atom.io/internal\"\nimport {\n\tIMPLICIT,\n\tcreateAtomFamily,\n\tcreateSelectorFamily,\n} from \"atom.io/internal\"\n\nexport const attachTransactionLogs = (\n\tstore: Store = IMPLICIT.STORE,\n): ReadonlySelectorFamily<TransactionUpdate<ƒn>[]> => {\n\tconst findTransactionUpdateLog = createAtomFamily<\n\t\tTransactionUpdate<ƒn>[],\n\t\tstring\n\t>(\n\t\t{\n\t\t\tkey: `👁‍🗨 Transaction Update Log (Internal)`,\n\t\t\tdefault: () => [],\n\t\t\teffects: (key) => [\n\t\t\t\t({ setSelf }) => {\n\t\t\t\t\tconst tx = store.transactions.get(key)\n\t\t\t\t\ttx?.subject.subscribe(`introspection`, (transactionUpdate) => {\n\t\t\t\t\t\tif (transactionUpdate.key === key) {\n\t\t\t\t\t\t\tsetSelf((state) => [...state, transactionUpdate])\n\t\t\t\t\t\t}\n\t\t\t\t\t})\n\t\t\t\t},\n\t\t\t],\n\t\t},\n\t\tstore,\n\t)\n\tconst findTransactionUpdateLogState = createSelectorFamily<\n\t\tTransactionUpdate<ƒn>[],\n\t\tstring\n\t>(\n\t\t{\n\t\t\tkey: `👁‍🗨 Transaction Update Log`,\n\t\t\tget:\n\t\t\t\t(key) =>\n\t\t\t\t({ get }) =>\n\t\t\t\t\tget(findTransactionUpdateLog(key)),\n\t\t},\n\t\tstore,\n\t)\n\treturn findTransactionUpdateLogState\n}\n"]}
@@ -0,0 +1 @@
1
+ {"inputs":{"src/attach-atom-index.ts":{"bytes":2213,"imports":[{"path":"atom.io/internal","kind":"import-statement","external":true},{"path":"<runtime>","kind":"import-statement","external":true}],"format":"esm"},"src/attach-selector-index.ts":{"bytes":2622,"imports":[{"path":"atom.io/internal","kind":"import-statement","external":true},{"path":"<runtime>","kind":"import-statement","external":true}],"format":"esm"},"src/attach-timeline-family.ts":{"bytes":1489,"imports":[{"path":"atom.io/internal","kind":"import-statement","external":true},{"path":"<runtime>","kind":"import-statement","external":true}],"format":"esm"},"src/attach-timeline-index.ts":{"bytes":1013,"imports":[{"path":"atom.io/internal","kind":"import-statement","external":true}],"format":"esm"},"src/attach-transaction-index.ts":{"bytes":1086,"imports":[{"path":"atom.io/internal","kind":"import-statement","external":true}],"format":"esm"},"src/attach-transaction-logs.ts":{"bytes":1110,"imports":[{"path":"atom.io/internal","kind":"import-statement","external":true}],"format":"esm"},"src/attach-introspection-states.ts":{"bytes":1462,"imports":[{"path":"atom.io/internal","kind":"import-statement","external":true},{"path":"src/attach-atom-index.ts","kind":"import-statement","original":"./attach-atom-index"},{"path":"src/attach-selector-index.ts","kind":"import-statement","original":"./attach-selector-index"},{"path":"src/attach-timeline-family.ts","kind":"import-statement","original":"./attach-timeline-family"},{"path":"src/attach-timeline-index.ts","kind":"import-statement","original":"./attach-timeline-index"},{"path":"src/attach-transaction-index.ts","kind":"import-statement","original":"./attach-transaction-index"},{"path":"src/attach-transaction-logs.ts","kind":"import-statement","original":"./attach-transaction-logs"}],"format":"esm"},"src/index.ts":{"bytes":488,"imports":[{"path":"src/attach-introspection-states.ts","kind":"import-statement","original":"./attach-introspection-states"}],"format":"esm"}},"outputs":{"dist/index.cjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":20231},"dist/index.cjs":{"imports":[{"path":"atom.io/internal","kind":"import-statement","external":true},{"path":"atom.io/internal","kind":"import-statement","external":true},{"path":"atom.io/internal","kind":"import-statement","external":true},{"path":"atom.io/internal","kind":"import-statement","external":true},{"path":"atom.io/internal","kind":"import-statement","external":true},{"path":"atom.io/internal","kind":"import-statement","external":true},{"path":"atom.io/internal","kind":"import-statement","external":true}],"exports":["attachIntrospectionStates"],"entryPoint":"src/index.ts","inputs":{"src/attach-introspection-states.ts":{"bytesInOutput":432},"src/attach-atom-index.ts":{"bytesInOutput":2373},"src/attach-selector-index.ts":{"bytesInOutput":2740},"src/attach-timeline-family.ts":{"bytesInOutput":1645},"src/attach-timeline-index.ts":{"bytesInOutput":961},"src/attach-transaction-index.ts":{"bytesInOutput":997},"src/attach-transaction-logs.ts":{"bytesInOutput":1011},"src/index.ts":{"bytesInOutput":0}},"bytes":11330}}}
@@ -0,0 +1 @@
1
+ {"inputs":{"src/attach-atom-index.ts":{"bytes":2213,"imports":[{"path":"atom.io/internal","kind":"import-statement","external":true},{"path":"<runtime>","kind":"import-statement","external":true}],"format":"esm"},"src/attach-selector-index.ts":{"bytes":2622,"imports":[{"path":"atom.io/internal","kind":"import-statement","external":true},{"path":"<runtime>","kind":"import-statement","external":true}],"format":"esm"},"src/attach-timeline-family.ts":{"bytes":1489,"imports":[{"path":"atom.io/internal","kind":"import-statement","external":true},{"path":"<runtime>","kind":"import-statement","external":true}],"format":"esm"},"src/attach-timeline-index.ts":{"bytes":1013,"imports":[{"path":"atom.io/internal","kind":"import-statement","external":true}],"format":"esm"},"src/attach-transaction-index.ts":{"bytes":1086,"imports":[{"path":"atom.io/internal","kind":"import-statement","external":true}],"format":"esm"},"src/attach-transaction-logs.ts":{"bytes":1110,"imports":[{"path":"atom.io/internal","kind":"import-statement","external":true}],"format":"esm"},"src/attach-introspection-states.ts":{"bytes":1462,"imports":[{"path":"atom.io/internal","kind":"import-statement","external":true},{"path":"src/attach-atom-index.ts","kind":"import-statement","original":"./attach-atom-index"},{"path":"src/attach-selector-index.ts","kind":"import-statement","original":"./attach-selector-index"},{"path":"src/attach-timeline-family.ts","kind":"import-statement","original":"./attach-timeline-family"},{"path":"src/attach-timeline-index.ts","kind":"import-statement","original":"./attach-timeline-index"},{"path":"src/attach-transaction-index.ts","kind":"import-statement","original":"./attach-transaction-index"},{"path":"src/attach-transaction-logs.ts","kind":"import-statement","original":"./attach-transaction-logs"}],"format":"esm"},"src/index.ts":{"bytes":488,"imports":[{"path":"src/attach-introspection-states.ts","kind":"import-statement","original":"./attach-introspection-states"}],"format":"esm"}},"outputs":{"dist/index.js.map":{"imports":[],"exports":[],"inputs":{},"bytes":20231},"dist/index.js":{"imports":[{"path":"atom.io/internal","kind":"import-statement","external":true},{"path":"atom.io/internal","kind":"import-statement","external":true},{"path":"atom.io/internal","kind":"import-statement","external":true},{"path":"atom.io/internal","kind":"import-statement","external":true},{"path":"atom.io/internal","kind":"import-statement","external":true},{"path":"atom.io/internal","kind":"import-statement","external":true},{"path":"atom.io/internal","kind":"import-statement","external":true}],"exports":["attachIntrospectionStates"],"entryPoint":"src/index.ts","inputs":{"src/attach-introspection-states.ts":{"bytesInOutput":432},"src/attach-atom-index.ts":{"bytesInOutput":2373},"src/attach-selector-index.ts":{"bytesInOutput":2740},"src/attach-timeline-family.ts":{"bytesInOutput":1645},"src/attach-timeline-index.ts":{"bytesInOutput":961},"src/attach-transaction-index.ts":{"bytesInOutput":997},"src/attach-transaction-logs.ts":{"bytesInOutput":1011},"src/index.ts":{"bytesInOutput":0}},"bytes":11330}}}
@@ -1,5 +1,6 @@
1
1
  {
2
2
  "name": "atom.io-introspection",
3
+ "type": "module",
3
4
  "private": true,
4
5
  "main": "dist/index.js",
5
6
  "types": "dist/index.d.ts",
@@ -7,9 +8,9 @@
7
8
  "exports": {
8
9
  ".": {
9
10
  "types": "./dist/index.d.ts",
10
- "browser": "./dist/index.mjs",
11
- "import": "./dist/index.mjs",
12
- "require": "./dist/index.js"
11
+ "browser": "./dist/index.js",
12
+ "import": "./dist/index.js",
13
+ "require": "./dist/index.cjs"
13
14
  }
14
15
  }
15
16
  }
@@ -6,7 +6,7 @@ import type {
6
6
  TransactionUpdate,
7
7
  ƒn,
8
8
  } from "atom.io"
9
- import * as __INTERNAL__ from "atom.io/internal"
9
+ import * as Internal from "atom.io/internal"
10
10
  import type { Timeline } from "atom.io/internal"
11
11
 
12
12
  import { type AtomTokenIndex, attachAtomIndex } from "./attach-atom-index"
@@ -18,7 +18,7 @@ import { attachTransactionIndex } from "./attach-transaction-index"
18
18
  import { attachTransactionLogs } from "./attach-transaction-logs"
19
19
 
20
20
  export const attachIntrospectionStates = (
21
- store: __INTERNAL__.Store = __INTERNAL__.IMPLICIT.STORE,
21
+ store: Internal.Store = Internal.IMPLICIT.STORE,
22
22
  ): {
23
23
  atomIndex: ReadonlySelectorToken<AtomTokenIndex>
24
24
  selectorIndex: ReadonlySelectorToken<SelectorTokenIndex>
@@ -83,8 +83,12 @@ export const attachSelectorIndex = (
83
83
  undefined,
84
84
  store,
85
85
  )
86
- return createSelector({
87
- key: `👁‍🗨 Selector Token Index`,
88
- get: ({ get }) => get(readonlySelectorTokenIndexState__INTERNAL),
89
- })
86
+ return createSelector(
87
+ {
88
+ key: `👁‍🗨 Selector Token Index`,
89
+ get: ({ get }) => get(readonlySelectorTokenIndexState__INTERNAL),
90
+ },
91
+ undefined,
92
+ IMPLICIT.STORE,
93
+ )
90
94
  }
@@ -1,4 +1,6 @@
1
- import { createSelector, IMPLICIT, createSelectorFamily } from 'atom.io/internal';
1
+ 'use strict';
2
+
3
+ var internal = require('atom.io/internal');
2
4
 
3
5
  // ../../anvl/src/json/json-interface.ts
4
6
  var stringSetJsonInterface = {
@@ -42,8 +44,8 @@ var isNull = (input) => {
42
44
  var isPrimitive = (input) => {
43
45
  return isString(input) || isNumber(input) || isBoolean(input) || isNull(input);
44
46
  };
45
- var selectJson = (atom, transform, store = IMPLICIT.STORE) => {
46
- return createSelector(
47
+ var selectJson = (atom, transform, store = internal.IMPLICIT.STORE) => {
48
+ return internal.createSelector(
47
49
  {
48
50
  key: `${atom.key}:JSON`,
49
51
  get: ({ get }) => transform.toJson(get(atom)),
@@ -53,8 +55,8 @@ var selectJson = (atom, transform, store = IMPLICIT.STORE) => {
53
55
  store
54
56
  );
55
57
  };
56
- var selectJsonFamily = (atomFamily, transform, store = IMPLICIT.STORE) => {
57
- const jsonFamily = createSelectorFamily(
58
+ var selectJsonFamily = (atomFamily, transform, store = internal.IMPLICIT.STORE) => {
59
+ const jsonFamily = internal.createSelectorFamily(
58
60
  {
59
61
  key: `${atomFamily.key}:JSON`,
60
62
  get: (key) => ({ get }) => transform.toJson(get(atomFamily(key))),
@@ -73,6 +75,17 @@ var selectJsonFamily = (atomFamily, transform, store = IMPLICIT.STORE) => {
73
75
  return jsonFamily;
74
76
  };
75
77
 
76
- export { JSON_DEFAULTS, JSON_TYPE_NAMES, isBoolean, isNull, isNumber, isPrimitive, isString, parseJson, selectJson, selectJsonFamily, stringSetJsonInterface, stringifyJson };
78
+ exports.JSON_DEFAULTS = JSON_DEFAULTS;
79
+ exports.JSON_TYPE_NAMES = JSON_TYPE_NAMES;
80
+ exports.isBoolean = isBoolean;
81
+ exports.isNull = isNull;
82
+ exports.isNumber = isNumber;
83
+ exports.isPrimitive = isPrimitive;
84
+ exports.isString = isString;
85
+ exports.parseJson = parseJson;
86
+ exports.selectJson = selectJson;
87
+ exports.selectJsonFamily = selectJsonFamily;
88
+ exports.stringSetJsonInterface = stringSetJsonInterface;
89
+ exports.stringifyJson = stringifyJson;
77
90
  //# sourceMappingURL=out.js.map
78
- //# sourceMappingURL=index.mjs.map
91
+ //# sourceMappingURL=index.cjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../anvl/src/json/json-interface.ts","../../../anvl/src/json/index.ts","../../../anvl/src/primitive/index.ts","../src/select-json.ts","../src/select-json-family.ts"],"names":["IMPLICIT"],"mappings":";AAOO,IAAM,yBAGT;AAAA,EACH,QAAQ,CAAC,cAAc,MAAM,KAAK,SAAS;AAAA,EAC3C,UAAU,CAAC,SAAS,IAAI,IAAI,IAAI;AACjC;;;ACTO,IAAM,YAAY,CACxB,QAC4D,KAAK,MAAM,GAAG;AAIpE,IAAM,gBAAgB,CAC5B,SACoB,KAAK,UAAU,IAAI;AAIjC,IAAM,kBAAkB;AAAA,EAC9B;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACD;AAaO,IAAM,gBAA2B;AAAA,EACvC,OAAO,CAAC;AAAA,EACR,SAAS;AAAA,EACT,MAAM;AAAA,EACN,QAAQ;AAAA,EACR,QAAQ,CAAC;AAAA,EACT,QAAQ;AACT;;;ACzCO,IAAM,WAAW,CAAC,UAAoC;AAC5D,SAAO,OAAO,UAAU;AACzB;AAEO,IAAM,WAAW,CAAC,UAAoC;AAC5D,SAAO,OAAO,UAAU;AACzB;AAEO,IAAM,YAAY,CAAC,UAAqC;AAC9D,SAAO,OAAO,UAAU;AACzB;AAEO,IAAM,SAAS,CAAC,UAAkC;AACxD,SAAO,UAAU;AAClB;AAEO,IAAM,cAAc,CAAC,UAAuC;AAClE,SAAO,SAAS,KAAK,KAAK,SAAS,KAAK,KAAK,UAAU,KAAK,KAAK,OAAO,KAAK;AAC9E;;;AClBA,SAAS,gBAAgB;AAEzB,SAAS,sBAAsB;AAGxB,IAAM,aAAa,CACzB,MACA,WACA,QAAe,SAAS,UACK;AAC7B,SAAO;AAAA,IACN;AAAA,MACC,KAAK,GAAG,KAAK,GAAG;AAAA,MAChB,KAAK,CAAC,EAAE,IAAI,MAAM,UAAU,OAAO,IAAI,IAAI,CAAC;AAAA,MAC5C,KAAK,CAAC,EAAE,IAAI,GAAG,aAAa,IAAI,MAAM,UAAU,SAAS,QAAQ,CAAC;AAAA,IACnE;AAAA,IACA;AAAA,IACA;AAAA,EACD;AACD;;;ACnBA,SAAS,YAAAA,WAAU,4BAA4B;AAKxC,IAAM,mBAAmB,CAK/B,YACA,WACA,QAAeA,UAAS,UACS;AACjC,QAAM,aAAa;AAAA,IAClB;AAAA,MACC,KAAK,GAAG,WAAW,GAAG;AAAA,MACtB,KACC,CAAC,QACD,CAAC,EAAE,IAAI,MACN,UAAU,OAAO,IAAI,WAAW,GAAG,CAAC,CAAC;AAAA,MACvC,KACC,CAAC,QACD,CAAC,EAAE,IAAI,GAAG,aACT,IAAI,WAAW,GAAG,GAAG,UAAU,SAAS,QAAQ,CAAC;AAAA,IACpD;AAAA,IACA;AAAA,EACD;AACA,aAAW,QAAQ;AAAA,IAClB,SAAS,MAAM,OAAO,IAAI;AAAA,IAC1B,CAAC,UAAU;AACV,UAAI,MAAM,QAAQ;AACjB,mBAAW,UAAU,MAAM,OAAO,MAAM,CAAM;AAAA,MAC/C;AAAA,IACD;AAAA,EACD;AACA,SAAO;AACR","sourcesContent":["import type { Json } from \".\"\n\nexport type JsonInterface<T, J extends Json.Serializable = Json.Serializable> = {\n\ttoJson: (t: T) => J\n\tfromJson: (json: J) => T\n}\n\nexport const stringSetJsonInterface: JsonInterface<\n\tSet<string>,\n\tJson.Array<string>\n> = {\n\ttoJson: (stringSet) => Array.from(stringSet),\n\tfromJson: (json) => new Set(json),\n}\n","export * from \"./json-interface\"\nimport type * as Json from \"./json\"\nexport { Json }\n\nexport const parseJson = <S extends Stringified<Json.Serializable>>(\n\tstr: S | string,\n): S extends Stringified<infer J> ? J : Json.Serializable => JSON.parse(str)\n\nexport type Stringified<J extends Json.Serializable> = string & { __json: J }\n\nexport const stringifyJson = <J extends Json.Serializable>(\n\tjson: J,\n): Stringified<J> => JSON.stringify(json) as Stringified<J>\n\nexport type Empty = Record<string, never>\n\nexport const JSON_TYPE_NAMES = [\n\t`array`,\n\t`boolean`,\n\t`null`,\n\t`number`,\n\t`object`,\n\t`string`,\n] as const\n\nexport type JsonTypeName = typeof JSON_TYPE_NAMES[number]\n\nexport interface JsonTypes extends Record<JsonTypeName, Json.Serializable> {\n\tarray: Json.Array\n\tboolean: boolean\n\tnull: null\n\tnumber: number\n\tobject: Json.Object\n\tstring: string\n}\n\nexport const JSON_DEFAULTS: JsonTypes = {\n\tarray: [],\n\tboolean: false,\n\tnull: null,\n\tnumber: 0,\n\tobject: {},\n\tstring: ``,\n}\n","export type primitive = boolean | number | string | null\n\nexport const isString = (input: unknown): input is string => {\n\treturn typeof input === `string`\n}\n\nexport const isNumber = (input: unknown): input is number => {\n\treturn typeof input === `number`\n}\n\nexport const isBoolean = (input: unknown): input is boolean => {\n\treturn typeof input === `boolean`\n}\n\nexport const isNull = (input: unknown): input is null => {\n\treturn input === null\n}\n\nexport const isPrimitive = (input: unknown): input is primitive => {\n\treturn isString(input) || isNumber(input) || isBoolean(input) || isNull(input)\n}\n","import type * as AtomIO from \"atom.io\"\nimport type { Store } from \"atom.io/internal\"\nimport { IMPLICIT } from \"atom.io/internal\"\n\nimport { createSelector } from \"atom.io/internal\"\nimport type { Json, JsonInterface } from \".\"\n\nexport const selectJson = <T, J extends Json.Serializable>(\n\tatom: AtomIO.AtomToken<T>,\n\ttransform: JsonInterface<T, J>,\n\tstore: Store = IMPLICIT.STORE,\n): AtomIO.SelectorToken<J> => {\n\treturn createSelector(\n\t\t{\n\t\t\tkey: `${atom.key}:JSON`,\n\t\t\tget: ({ get }) => transform.toJson(get(atom)),\n\t\t\tset: ({ set }, newValue) => set(atom, transform.fromJson(newValue)),\n\t\t},\n\t\tundefined,\n\t\tstore,\n\t)\n}\n","import type * as AtomIO from \"atom.io\"\nimport type { Store } from \"atom.io/internal\"\nimport { IMPLICIT, createSelectorFamily } from \"atom.io/internal\"\n\nimport type { Json, JsonInterface } from \".\"\nimport { parseJson } from \".\"\n\nexport const selectJsonFamily = <\n\tT,\n\tJ extends Json.Serializable,\n\tK extends Json.Serializable,\n>(\n\tatomFamily: AtomIO.AtomFamily<T, K>,\n\ttransform: JsonInterface<T, J>,\n\tstore: Store = IMPLICIT.STORE,\n): AtomIO.SelectorFamily<J, K> => {\n\tconst jsonFamily = createSelectorFamily<J, K>(\n\t\t{\n\t\t\tkey: `${atomFamily.key}:JSON`,\n\t\t\tget:\n\t\t\t\t(key) =>\n\t\t\t\t({ get }) =>\n\t\t\t\t\ttransform.toJson(get(atomFamily(key))),\n\t\t\tset:\n\t\t\t\t(key) =>\n\t\t\t\t({ set }, newValue) =>\n\t\t\t\t\tset(atomFamily(key), transform.fromJson(newValue)),\n\t\t},\n\t\tstore,\n\t)\n\tatomFamily.subject.subscribe(\n\t\t`store=${store.config.name}::json-selector-family`,\n\t\t(token) => {\n\t\t\tif (token.family) {\n\t\t\t\tjsonFamily(parseJson(token.family.subKey) as K)\n\t\t\t}\n\t\t},\n\t)\n\treturn jsonFamily\n}\n"]}
1
+ {"version":3,"sources":["../../../anvl/src/json/json-interface.ts","../../../anvl/src/json/index.ts","../../../anvl/src/primitive/index.ts","../src/select-json.ts","../src/select-json-family.ts"],"names":["IMPLICIT"],"mappings":";AAOO,IAAM,yBAGT;AAAA,EACH,QAAQ,CAAC,cAAc,MAAM,KAAK,SAAS;AAAA,EAC3C,UAAU,CAAC,SAAS,IAAI,IAAI,IAAI;AACjC;;;ACTO,IAAM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AAC,QACD,CAAC,EAAE,IAAI,MACN,UAAU,OAAO,IAAI,WAAW,GAAG,CAAC,CAAC;AAAA,MACvC,KACC,CAAC,QACD,CAAC,EAAE,IAAI,GAAG,aACT,IAAI,WAAW,GAAG,GAAG,UAAU,SAAS,QAAQ,CAAC;AAAA,IACpD;AAAA,IACA;AAAA,EACD;AACA,aAAW,QAAQ;AAAA,IAClB,SAAS,MAAM,OAAO,IAAI;AAAA,IAC1B,CAAC,UAAU;AACV,UAAI,MAAM,QAAQ;AACjB,mBAAW,UAAU,MAAM,OAAO,MAAM,CAAM;AAAA,MAC/C;AAAA,IACD;AAAA,EACD;AACA,SAAO;AACR","sourcesContent":["import type { Json } from \".\"\n\nexport type JsonInterface<T, J extends Json.Serializable = Json.Serializable> = {\n\ttoJson: (t: T) => J\n\tfromJson: (json: J) => T\n}\n\nexport const stringSetJsonInterface: JsonInterface<\n\tSet<string>,\n\tJson.Array<string>\n> = {\n\ttoJson: (stringSet) => Array.from(stringSet),\n\tfromJson: (json) => new Set(json),\n}\n","export * from \"./json-interface\"\nimport type * as Json from \"./json\"\nexport { Json }\n\nexport const parseJson = <S extends Stringified<Json.Serializable>>(\n\tstr: S | string,\n): S extends Stringified<infer J> ? J : Json.Serializable => JSON.parse(str)\n\nexport type Stringified<J extends Json.Serializable> = string & { __json: J }\n\nexport const stringifyJson = <J extends Json.Serializable>(\n\tjson: J,\n): Stringified<J> => JSON.stringify(json) as Stringified<J>\n\nexport type Empty = Record<string, never>\n\nexport const JSON_TYPE_NAMES = [\n\t`array`,\n\t`boolean`,\n\t`null`,\n\t`number`,\n\t`object`,\n\t`string`,\n] as const\n\nexport type JsonTypeName = (typeof JSON_TYPE_NAMES)[number]\n\nexport interface JsonTypes extends Record<JsonTypeName, Json.Serializable> {\n\tarray: Json.Array\n\tboolean: boolean\n\tnull: null\n\tnumber: number\n\tobject: Json.Object\n\tstring: string\n}\n\nexport const JSON_DEFAULTS: JsonTypes = {\n\tarray: [],\n\tboolean: false,\n\tnull: null,\n\tnumber: 0,\n\tobject: {},\n\tstring: ``,\n}\n","export type primitive = boolean | number | string | null\n\nexport const isString = (input: unknown): input is string => {\n\treturn typeof input === `string`\n}\n\nexport const isNumber = (input: unknown): input is number => {\n\treturn typeof input === `number`\n}\n\nexport const isBoolean = (input: unknown): input is boolean => {\n\treturn typeof input === `boolean`\n}\n\nexport const isNull = (input: unknown): input is null => {\n\treturn input === null\n}\n\nexport const isPrimitive = (input: unknown): input is primitive => {\n\treturn isString(input) || isNumber(input) || isBoolean(input) || isNull(input)\n}\n","import type * as AtomIO from \"atom.io\"\nimport type { Store } from \"atom.io/internal\"\nimport { IMPLICIT } from \"atom.io/internal\"\n\nimport { createSelector } from \"atom.io/internal\"\nimport type { Json, JsonInterface } from \".\"\n\nexport const selectJson = <T, J extends Json.Serializable>(\n\tatom: AtomIO.AtomToken<T>,\n\ttransform: JsonInterface<T, J>,\n\tstore: Store = IMPLICIT.STORE,\n): AtomIO.SelectorToken<J> => {\n\treturn createSelector(\n\t\t{\n\t\t\tkey: `${atom.key}:JSON`,\n\t\t\tget: ({ get }) => transform.toJson(get(atom)),\n\t\t\tset: ({ set }, newValue) => set(atom, transform.fromJson(newValue)),\n\t\t},\n\t\tundefined,\n\t\tstore,\n\t)\n}\n","import type * as AtomIO from \"atom.io\"\nimport type { Store } from \"atom.io/internal\"\nimport { IMPLICIT, createSelectorFamily } from \"atom.io/internal\"\n\nimport type { Json, JsonInterface } from \".\"\nimport { parseJson } from \".\"\n\nexport const selectJsonFamily = <\n\tT,\n\tJ extends Json.Serializable,\n\tK extends Json.Serializable,\n>(\n\tatomFamily: AtomIO.AtomFamily<T, K>,\n\ttransform: JsonInterface<T, J>,\n\tstore: Store = IMPLICIT.STORE,\n): AtomIO.SelectorFamily<J, K> => {\n\tconst jsonFamily = createSelectorFamily<J, K>(\n\t\t{\n\t\t\tkey: `${atomFamily.key}:JSON`,\n\t\t\tget:\n\t\t\t\t(key) =>\n\t\t\t\t({ get }) =>\n\t\t\t\t\ttransform.toJson(get(atomFamily(key))),\n\t\t\tset:\n\t\t\t\t(key) =>\n\t\t\t\t({ set }, newValue) =>\n\t\t\t\t\tset(atomFamily(key), transform.fromJson(newValue)),\n\t\t},\n\t\tstore,\n\t)\n\tatomFamily.subject.subscribe(\n\t\t`store=${store.config.name}::json-selector-family`,\n\t\t(token) => {\n\t\t\tif (token.family) {\n\t\t\t\tjsonFamily(parseJson(token.family.subKey) as K)\n\t\t\t}\n\t\t},\n\t)\n\treturn jsonFamily\n}\n"]}
@@ -33,7 +33,7 @@ type Stringified<J extends Serializable> = string & {
33
33
  declare const stringifyJson: <J extends Serializable>(json: J) => Stringified<J>;
34
34
  type Empty = Record<string, never>;
35
35
  declare const JSON_TYPE_NAMES: readonly ["array", "boolean", "null", "number", "object", "string"];
36
- type JsonTypeName = typeof JSON_TYPE_NAMES[number];
36
+ type JsonTypeName = (typeof JSON_TYPE_NAMES)[number];
37
37
  interface JsonTypes extends Record<JsonTypeName, Serializable> {
38
38
  array: Array;
39
39
  boolean: boolean;
@@ -33,7 +33,7 @@ type Stringified<J extends Serializable> = string & {
33
33
  declare const stringifyJson: <J extends Serializable>(json: J) => Stringified<J>;
34
34
  type Empty = Record<string, never>;
35
35
  declare const JSON_TYPE_NAMES: readonly ["array", "boolean", "null", "number", "object", "string"];
36
- type JsonTypeName = typeof JSON_TYPE_NAMES[number];
36
+ type JsonTypeName = (typeof JSON_TYPE_NAMES)[number];
37
37
  interface JsonTypes extends Record<JsonTypeName, Serializable> {
38
38
  array: Array;
39
39
  boolean: boolean;
@@ -1,6 +1,4 @@
1
- 'use strict';
2
-
3
- var internal = require('atom.io/internal');
1
+ import { createSelector, IMPLICIT, createSelectorFamily } from 'atom.io/internal';
4
2
 
5
3
  // ../../anvl/src/json/json-interface.ts
6
4
  var stringSetJsonInterface = {
@@ -44,8 +42,8 @@ var isNull = (input) => {
44
42
  var isPrimitive = (input) => {
45
43
  return isString(input) || isNumber(input) || isBoolean(input) || isNull(input);
46
44
  };
47
- var selectJson = (atom, transform, store = internal.IMPLICIT.STORE) => {
48
- return internal.createSelector(
45
+ var selectJson = (atom, transform, store = IMPLICIT.STORE) => {
46
+ return createSelector(
49
47
  {
50
48
  key: `${atom.key}:JSON`,
51
49
  get: ({ get }) => transform.toJson(get(atom)),
@@ -55,8 +53,8 @@ var selectJson = (atom, transform, store = internal.IMPLICIT.STORE) => {
55
53
  store
56
54
  );
57
55
  };
58
- var selectJsonFamily = (atomFamily, transform, store = internal.IMPLICIT.STORE) => {
59
- const jsonFamily = internal.createSelectorFamily(
56
+ var selectJsonFamily = (atomFamily, transform, store = IMPLICIT.STORE) => {
57
+ const jsonFamily = createSelectorFamily(
60
58
  {
61
59
  key: `${atomFamily.key}:JSON`,
62
60
  get: (key) => ({ get }) => transform.toJson(get(atomFamily(key))),
@@ -75,17 +73,6 @@ var selectJsonFamily = (atomFamily, transform, store = internal.IMPLICIT.STORE)
75
73
  return jsonFamily;
76
74
  };
77
75
 
78
- exports.JSON_DEFAULTS = JSON_DEFAULTS;
79
- exports.JSON_TYPE_NAMES = JSON_TYPE_NAMES;
80
- exports.isBoolean = isBoolean;
81
- exports.isNull = isNull;
82
- exports.isNumber = isNumber;
83
- exports.isPrimitive = isPrimitive;
84
- exports.isString = isString;
85
- exports.parseJson = parseJson;
86
- exports.selectJson = selectJson;
87
- exports.selectJsonFamily = selectJsonFamily;
88
- exports.stringSetJsonInterface = stringSetJsonInterface;
89
- exports.stringifyJson = stringifyJson;
76
+ export { JSON_DEFAULTS, JSON_TYPE_NAMES, isBoolean, isNull, isNumber, isPrimitive, isString, parseJson, selectJson, selectJsonFamily, stringSetJsonInterface, stringifyJson };
90
77
  //# sourceMappingURL=out.js.map
91
78
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../anvl/src/json/json-interface.ts","../../../anvl/src/json/index.ts","../../../anvl/src/primitive/index.ts","../src/select-json.ts","../src/select-json-family.ts"],"names":["IMPLICIT"],"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B;AAKxC,IAAM,mBAAmB,CAK/B,YACA,WACA,QAAeA,UAAS,UACS;AACjC,QAAM,aAAa;AAAA,IAClB;AAAA,MACC,KAAK,GAAG,WAAW,GAAG;AAAA,MACtB,KACC,CAAC,QACD,CAAC,EAAE,IAAI,MACN,UAAU,OAAO,IAAI,WAAW,GAAG,CAAC,CAAC;AAAA,MACvC,KACC,CAAC,QACD,CAAC,EAAE,IAAI,GAAG,aACT,IAAI,WAAW,GAAG,GAAG,UAAU,SAAS,QAAQ,CAAC;AAAA,IACpD;AAAA,IACA;AAAA,EACD;AACA,aAAW,QAAQ;AAAA,IAClB,SAAS,MAAM,OAAO,IAAI;AAAA,IAC1B,CAAC,UAAU;AACV,UAAI,MAAM,QAAQ;AACjB,mBAAW,UAAU,MAAM,OAAO,MAAM,CAAM;AAAA,MAC/C;AAAA,IACD;AAAA,EACD;AACA,SAAO;AACR","sourcesContent":["import type { Json } from \".\"\n\nexport type JsonInterface<T, J extends Json.Serializable = Json.Serializable> = {\n\ttoJson: (t: T) => J\n\tfromJson: (json: J) => T\n}\n\nexport const stringSetJsonInterface: JsonInterface<\n\tSet<string>,\n\tJson.Array<string>\n> = {\n\ttoJson: (stringSet) => Array.from(stringSet),\n\tfromJson: (json) => new Set(json),\n}\n","export * from \"./json-interface\"\nimport type * as Json from \"./json\"\nexport { Json }\n\nexport const parseJson = <S extends Stringified<Json.Serializable>>(\n\tstr: S | string,\n): S extends Stringified<infer J> ? J : Json.Serializable => JSON.parse(str)\n\nexport type Stringified<J extends Json.Serializable> = string & { __json: J }\n\nexport const stringifyJson = <J extends Json.Serializable>(\n\tjson: J,\n): Stringified<J> => JSON.stringify(json) as Stringified<J>\n\nexport type Empty = Record<string, never>\n\nexport const JSON_TYPE_NAMES = [\n\t`array`,\n\t`boolean`,\n\t`null`,\n\t`number`,\n\t`object`,\n\t`string`,\n] as const\n\nexport type JsonTypeName = typeof JSON_TYPE_NAMES[number]\n\nexport interface JsonTypes extends Record<JsonTypeName, Json.Serializable> {\n\tarray: Json.Array\n\tboolean: boolean\n\tnull: null\n\tnumber: number\n\tobject: Json.Object\n\tstring: string\n}\n\nexport const JSON_DEFAULTS: JsonTypes = {\n\tarray: [],\n\tboolean: false,\n\tnull: null,\n\tnumber: 0,\n\tobject: {},\n\tstring: ``,\n}\n","export type primitive = boolean | number | string | null\n\nexport const isString = (input: unknown): input is string => {\n\treturn typeof input === `string`\n}\n\nexport const isNumber = (input: unknown): input is number => {\n\treturn typeof input === `number`\n}\n\nexport const isBoolean = (input: unknown): input is boolean => {\n\treturn typeof input === `boolean`\n}\n\nexport const isNull = (input: unknown): input is null => {\n\treturn input === null\n}\n\nexport const isPrimitive = (input: unknown): input is primitive => {\n\treturn isString(input) || isNumber(input) || isBoolean(input) || isNull(input)\n}\n","import type * as AtomIO from \"atom.io\"\nimport type { Store } from \"atom.io/internal\"\nimport { IMPLICIT } from \"atom.io/internal\"\n\nimport { createSelector } from \"atom.io/internal\"\nimport type { Json, JsonInterface } from \".\"\n\nexport const selectJson = <T, J extends Json.Serializable>(\n\tatom: AtomIO.AtomToken<T>,\n\ttransform: JsonInterface<T, J>,\n\tstore: Store = IMPLICIT.STORE,\n): AtomIO.SelectorToken<J> => {\n\treturn createSelector(\n\t\t{\n\t\t\tkey: `${atom.key}:JSON`,\n\t\t\tget: ({ get }) => transform.toJson(get(atom)),\n\t\t\tset: ({ set }, newValue) => set(atom, transform.fromJson(newValue)),\n\t\t},\n\t\tundefined,\n\t\tstore,\n\t)\n}\n","import type * as AtomIO from \"atom.io\"\nimport type { Store } from \"atom.io/internal\"\nimport { IMPLICIT, createSelectorFamily } from \"atom.io/internal\"\n\nimport type { Json, JsonInterface } from \".\"\nimport { parseJson } from \".\"\n\nexport const selectJsonFamily = <\n\tT,\n\tJ extends Json.Serializable,\n\tK extends Json.Serializable,\n>(\n\tatomFamily: AtomIO.AtomFamily<T, K>,\n\ttransform: JsonInterface<T, J>,\n\tstore: Store = IMPLICIT.STORE,\n): AtomIO.SelectorFamily<J, K> => {\n\tconst jsonFamily = createSelectorFamily<J, K>(\n\t\t{\n\t\t\tkey: `${atomFamily.key}:JSON`,\n\t\t\tget:\n\t\t\t\t(key) =>\n\t\t\t\t({ get }) =>\n\t\t\t\t\ttransform.toJson(get(atomFamily(key))),\n\t\t\tset:\n\t\t\t\t(key) =>\n\t\t\t\t({ set }, newValue) =>\n\t\t\t\t\tset(atomFamily(key), transform.fromJson(newValue)),\n\t\t},\n\t\tstore,\n\t)\n\tatomFamily.subject.subscribe(\n\t\t`store=${store.config.name}::json-selector-family`,\n\t\t(token) => {\n\t\t\tif (token.family) {\n\t\t\t\tjsonFamily(parseJson(token.family.subKey) as K)\n\t\t\t}\n\t\t},\n\t)\n\treturn jsonFamily\n}\n"]}
1
+ {"version":3,"sources":["../../../anvl/src/json/json-interface.ts","../../../anvl/src/json/index.ts","../../../anvl/src/primitive/index.ts","../src/select-json.ts","../src/select-json-family.ts"],"names":["IMPLICIT"],"mappings":";AAOO,IAAM,yBAGT;AAAA,EACH,QAAQ,CAAC,cAAc,MAAM,KAAK,SAAS;AAAA,EAC3C,UAAU,CAAC,SAAS,IAAI,IAAI,IAAI;AACjC;;;ACTO,IAAM,YAAY,CACxB,QAC4D,KAAK,MAAM,GAAG;AAIpE,IAAM,gBAAgB,CAC5B,SACoB,KAAK,UAAU,IAAI;AAIjC,IAAM,kBAAkB;AAAA,EAC9B;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACD;AAaO,IAAM,gBAA2B;AAAA,EACvC,OAAO,CAAC;AAAA,EACR,SAAS;AAAA,EACT,MAAM;AAAA,EACN,QAAQ;AAAA,EACR,QAAQ,CAAC;AAAA,EACT,QAAQ;AACT;;;ACzCO,IAAM,WAAW,CAAC,UAAoC;AAC5D,SAAO,OAAO,UAAU;AACzB;AAEO,IAAM,WAAW,CAAC,UAAoC;AAC5D,SAAO,OAAO,UAAU;AACzB;AAEO,IAAM,YAAY,CAAC,UAAqC;AAC9D,SAAO,OAAO,UAAU;AACzB;AAEO,IAAM,SAAS,CAAC,UAAkC;AACxD,SAAO,UAAU;AAClB;AAEO,IAAM,cAAc,CAAC,UAAuC;AAClE,SAAO,SAAS,KAAK,KAAK,SAAS,KAAK,KAAK,UAAU,KAAK,KAAK,OAAO,KAAK;AAC9E;;;AClBA,SAAS,gBAAgB;AAEzB,SAAS,sBAAsB;AAGxB,IAAM,aAAa,CACzB,MACA,WACA,QAAe,SAAS,UACK;AAC7B,SAAO;AAAA,IACN;AAAA,MACC,KAAK,GAAG,KAAK,GAAG;AAAA,MAChB,KAAK,CAAC,EAAE,IAAI,MAAM,UAAU,OAAO,IAAI,IAAI,CAAC;AAAA,MAC5C,KAAK,CAAC,EAAE,IAAI,GAAG,aAAa,IAAI,MAAM,UAAU,SAAS,QAAQ,CAAC;AAAA,IACnE;AAAA,IACA;AAAA,IACA;AAAA,EACD;AACD;;;ACnBA,SAAS,YAAAA,WAAU,4BAA4B;AAKxC,IAAM,mBAAmB,CAK/B,YACA,WACA,QAAeA,UAAS,UACS;AACjC,QAAM,aAAa;AAAA,IAClB;AAAA,MACC,KAAK,GAAG,WAAW,GAAG;AAAA,MACtB,KACC,CAAC,QACD,CAAC,EAAE,IAAI,MACN,UAAU,OAAO,IAAI,WAAW,GAAG,CAAC,CAAC;AAAA,MACvC,KACC,CAAC,QACD,CAAC,EAAE,IAAI,GAAG,aACT,IAAI,WAAW,GAAG,GAAG,UAAU,SAAS,QAAQ,CAAC;AAAA,IACpD;AAAA,IACA;AAAA,EACD;AACA,aAAW,QAAQ;AAAA,IAClB,SAAS,MAAM,OAAO,IAAI;AAAA,IAC1B,CAAC,UAAU;AACV,UAAI,MAAM,QAAQ;AACjB,mBAAW,UAAU,MAAM,OAAO,MAAM,CAAM;AAAA,MAC/C;AAAA,IACD;AAAA,EACD;AACA,SAAO;AACR","sourcesContent":["import type { Json } from \".\"\n\nexport type JsonInterface<T, J extends Json.Serializable = Json.Serializable> = {\n\ttoJson: (t: T) => J\n\tfromJson: (json: J) => T\n}\n\nexport const stringSetJsonInterface: JsonInterface<\n\tSet<string>,\n\tJson.Array<string>\n> = {\n\ttoJson: (stringSet) => Array.from(stringSet),\n\tfromJson: (json) => new Set(json),\n}\n","export * from \"./json-interface\"\nimport type * as Json from \"./json\"\nexport { Json }\n\nexport const parseJson = <S extends Stringified<Json.Serializable>>(\n\tstr: S | string,\n): S extends Stringified<infer J> ? J : Json.Serializable => JSON.parse(str)\n\nexport type Stringified<J extends Json.Serializable> = string & { __json: J }\n\nexport const stringifyJson = <J extends Json.Serializable>(\n\tjson: J,\n): Stringified<J> => JSON.stringify(json) as Stringified<J>\n\nexport type Empty = Record<string, never>\n\nexport const JSON_TYPE_NAMES = [\n\t`array`,\n\t`boolean`,\n\t`null`,\n\t`number`,\n\t`object`,\n\t`string`,\n] as const\n\nexport type JsonTypeName = (typeof JSON_TYPE_NAMES)[number]\n\nexport interface JsonTypes extends Record<JsonTypeName, Json.Serializable> {\n\tarray: Json.Array\n\tboolean: boolean\n\tnull: null\n\tnumber: number\n\tobject: Json.Object\n\tstring: string\n}\n\nexport const JSON_DEFAULTS: JsonTypes = {\n\tarray: [],\n\tboolean: false,\n\tnull: null,\n\tnumber: 0,\n\tobject: {},\n\tstring: ``,\n}\n","export type primitive = boolean | number | string | null\n\nexport const isString = (input: unknown): input is string => {\n\treturn typeof input === `string`\n}\n\nexport const isNumber = (input: unknown): input is number => {\n\treturn typeof input === `number`\n}\n\nexport const isBoolean = (input: unknown): input is boolean => {\n\treturn typeof input === `boolean`\n}\n\nexport const isNull = (input: unknown): input is null => {\n\treturn input === null\n}\n\nexport const isPrimitive = (input: unknown): input is primitive => {\n\treturn isString(input) || isNumber(input) || isBoolean(input) || isNull(input)\n}\n","import type * as AtomIO from \"atom.io\"\nimport type { Store } from \"atom.io/internal\"\nimport { IMPLICIT } from \"atom.io/internal\"\n\nimport { createSelector } from \"atom.io/internal\"\nimport type { Json, JsonInterface } from \".\"\n\nexport const selectJson = <T, J extends Json.Serializable>(\n\tatom: AtomIO.AtomToken<T>,\n\ttransform: JsonInterface<T, J>,\n\tstore: Store = IMPLICIT.STORE,\n): AtomIO.SelectorToken<J> => {\n\treturn createSelector(\n\t\t{\n\t\t\tkey: `${atom.key}:JSON`,\n\t\t\tget: ({ get }) => transform.toJson(get(atom)),\n\t\t\tset: ({ set }, newValue) => set(atom, transform.fromJson(newValue)),\n\t\t},\n\t\tundefined,\n\t\tstore,\n\t)\n}\n","import type * as AtomIO from \"atom.io\"\nimport type { Store } from \"atom.io/internal\"\nimport { IMPLICIT, createSelectorFamily } from \"atom.io/internal\"\n\nimport type { Json, JsonInterface } from \".\"\nimport { parseJson } from \".\"\n\nexport const selectJsonFamily = <\n\tT,\n\tJ extends Json.Serializable,\n\tK extends Json.Serializable,\n>(\n\tatomFamily: AtomIO.AtomFamily<T, K>,\n\ttransform: JsonInterface<T, J>,\n\tstore: Store = IMPLICIT.STORE,\n): AtomIO.SelectorFamily<J, K> => {\n\tconst jsonFamily = createSelectorFamily<J, K>(\n\t\t{\n\t\t\tkey: `${atomFamily.key}:JSON`,\n\t\t\tget:\n\t\t\t\t(key) =>\n\t\t\t\t({ get }) =>\n\t\t\t\t\ttransform.toJson(get(atomFamily(key))),\n\t\t\tset:\n\t\t\t\t(key) =>\n\t\t\t\t({ set }, newValue) =>\n\t\t\t\t\tset(atomFamily(key), transform.fromJson(newValue)),\n\t\t},\n\t\tstore,\n\t)\n\tatomFamily.subject.subscribe(\n\t\t`store=${store.config.name}::json-selector-family`,\n\t\t(token) => {\n\t\t\tif (token.family) {\n\t\t\t\tjsonFamily(parseJson(token.family.subKey) as K)\n\t\t\t}\n\t\t},\n\t)\n\treturn jsonFamily\n}\n"]}
@@ -0,0 +1 @@
1
+ {"inputs":{"../../anvl/src/json/json-interface.ts":{"bytes":340,"imports":[],"format":"esm"},"../../anvl/src/json/index.ts":{"bytes":980,"imports":[{"path":"../../anvl/src/json/json-interface.ts","kind":"import-statement","original":"./json-interface"}],"format":"esm"},"../../anvl/src/primitive/index.ts":{"bytes":597,"imports":[],"format":"esm"},"src/select-json.ts":{"bytes":621,"imports":[{"path":"atom.io/internal","kind":"import-statement","external":true},{"path":"atom.io/internal","kind":"import-statement","external":true}],"format":"esm"},"src/select-json-family.ts":{"bytes":968,"imports":[{"path":"atom.io/internal","kind":"import-statement","external":true},{"path":"src/index.ts","kind":"import-statement","original":"."}],"format":"esm"},"src/index.ts":{"bytes":155,"imports":[{"path":"../../anvl/src/json/index.ts","kind":"import-statement","original":"~/packages/anvl/src/json"},{"path":"../../anvl/src/primitive/index.ts","kind":"import-statement","original":"~/packages/anvl/src/primitive"},{"path":"src/select-json.ts","kind":"import-statement","original":"./select-json"},{"path":"src/select-json-family.ts","kind":"import-statement","original":"./select-json-family"}],"format":"esm"}},"outputs":{"dist/index.cjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":5634},"dist/index.cjs":{"imports":[{"path":"atom.io/internal","kind":"import-statement","external":true},{"path":"atom.io/internal","kind":"import-statement","external":true},{"path":"atom.io/internal","kind":"import-statement","external":true}],"exports":["JSON_DEFAULTS","JSON_TYPE_NAMES","isBoolean","isNull","isNumber","isPrimitive","isString","parseJson","selectJson","selectJsonFamily","stringSetJsonInterface","stringifyJson"],"entryPoint":"src/index.ts","inputs":{"../../anvl/src/json/json-interface.ts":{"bytesInOutput":118},"../../anvl/src/json/index.ts":{"bytesInOutput":300},"src/index.ts":{"bytesInOutput":0},"../../anvl/src/primitive/index.ts":{"bytesInOutput":373},"src/select-json.ts":{"bytesInOutput":386},"src/select-json-family.ts":{"bytesInOutput":658}},"bytes":2199}}}
@@ -0,0 +1 @@
1
+ {"inputs":{"../../anvl/src/json/json-interface.ts":{"bytes":340,"imports":[],"format":"esm"},"../../anvl/src/json/index.ts":{"bytes":980,"imports":[{"path":"../../anvl/src/json/json-interface.ts","kind":"import-statement","original":"./json-interface"}],"format":"esm"},"../../anvl/src/primitive/index.ts":{"bytes":597,"imports":[],"format":"esm"},"src/select-json.ts":{"bytes":621,"imports":[{"path":"atom.io/internal","kind":"import-statement","external":true},{"path":"atom.io/internal","kind":"import-statement","external":true}],"format":"esm"},"src/select-json-family.ts":{"bytes":968,"imports":[{"path":"atom.io/internal","kind":"import-statement","external":true},{"path":"src/index.ts","kind":"import-statement","original":"."}],"format":"esm"},"src/index.ts":{"bytes":155,"imports":[{"path":"../../anvl/src/json/index.ts","kind":"import-statement","original":"~/packages/anvl/src/json"},{"path":"../../anvl/src/primitive/index.ts","kind":"import-statement","original":"~/packages/anvl/src/primitive"},{"path":"src/select-json.ts","kind":"import-statement","original":"./select-json"},{"path":"src/select-json-family.ts","kind":"import-statement","original":"./select-json-family"}],"format":"esm"}},"outputs":{"dist/index.js.map":{"imports":[],"exports":[],"inputs":{},"bytes":5634},"dist/index.js":{"imports":[{"path":"atom.io/internal","kind":"import-statement","external":true},{"path":"atom.io/internal","kind":"import-statement","external":true},{"path":"atom.io/internal","kind":"import-statement","external":true}],"exports":["JSON_DEFAULTS","JSON_TYPE_NAMES","isBoolean","isNull","isNumber","isPrimitive","isString","parseJson","selectJson","selectJsonFamily","stringSetJsonInterface","stringifyJson"],"entryPoint":"src/index.ts","inputs":{"../../anvl/src/json/json-interface.ts":{"bytesInOutput":118},"../../anvl/src/json/index.ts":{"bytesInOutput":300},"src/index.ts":{"bytesInOutput":0},"../../anvl/src/primitive/index.ts":{"bytesInOutput":373},"src/select-json.ts":{"bytesInOutput":386},"src/select-json-family.ts":{"bytesInOutput":658}},"bytes":2199}}}
package/json/package.json CHANGED
@@ -1,5 +1,6 @@
1
1
  {
2
2
  "name": "atom.io-json",
3
+ "type": "module",
3
4
  "private": true,
4
5
  "main": "dist/index.js",
5
6
  "types": "dist/index.d.ts",
@@ -7,9 +8,9 @@
7
8
  "exports": {
8
9
  ".": {
9
10
  "types": "./dist/index.d.ts",
10
- "browser": "./dist/index.mjs",
11
- "import": "./dist/index.mjs",
12
- "require": "./dist/index.js"
11
+ "browser": "./dist/index.js",
12
+ "import": "./dist/index.js",
13
+ "require": "./dist/index.cjs"
13
14
  }
14
15
  }
15
16
  }
package/package.json CHANGED
@@ -1,9 +1,10 @@
1
1
  {
2
2
  "name": "atom.io",
3
- "version": "0.11.0",
3
+ "version": "0.12.1",
4
4
  "description": "Composable and testable reactive data library.",
5
5
  "homepage": "https://atom.io.fyi",
6
6
  "sideEffects": false,
7
+ "type": "module",
7
8
  "license": "MIT",
8
9
  "author": "Jeremy Banka",
9
10
  "publishConfig": {
@@ -50,15 +51,15 @@
50
51
  "@emotion/react": "11.11.1",
51
52
  "@testing-library/react": "14.1.2",
52
53
  "@types/http-proxy": "1.17.14",
53
- "@types/npmlog": "4.1.6",
54
- "@types/react": "18.2.38",
54
+ "@types/npmlog": "7.0.0",
55
+ "@types/react": "18.2.42",
55
56
  "@types/tmp": "0.2.6",
56
- "@vitest/coverage-v8": "0.34.6",
57
+ "@vitest/coverage-v8": "1.0.1",
57
58
  "concurrently": "8.2.2",
58
- "drizzle-kit": "0.20.4",
59
- "drizzle-orm": "0.29.0",
60
- "eslint": "8.54.0",
61
- "framer-motion": "10.16.5",
59
+ "drizzle-kit": "0.20.6",
60
+ "drizzle-orm": "0.29.1",
61
+ "eslint": "8.55.0",
62
+ "framer-motion": "10.16.12",
62
63
  "happy-dom": "12.10.3",
63
64
  "http-proxy": "1.18.1",
64
65
  "npmlog": "7.0.1",
@@ -66,15 +67,15 @@
66
67
  "preact": "10.19.2",
67
68
  "react": "18.2.0",
68
69
  "react-dom": "18.2.0",
69
- "react-router-dom": "6.19.0",
70
+ "react-router-dom": "6.20.1",
70
71
  "socket.io": "4.7.2",
71
72
  "socket.io-client": "4.7.2",
72
73
  "tmp": "0.2.1",
73
74
  "tsup": "8.0.1",
74
75
  "typescript": "5.3.2",
75
- "vite": "5.0.2",
76
+ "vite": "5.0.5",
76
77
  "vite-tsconfig-paths": "4.2.1",
77
- "vitest": "0.34.6"
78
+ "vitest": "1.0.1"
78
79
  },
79
80
  "main": "dist/index.js",
80
81
  "types": "dist/index.d.ts",
@@ -120,86 +121,86 @@
120
121
  "./package.json": "./package.json",
121
122
  ".": {
122
123
  "types": "./dist/index.d.ts",
123
- "browser": "./dist/index.mjs",
124
- "import": "./dist/index.mjs",
125
- "require": "./dist/index.js"
124
+ "browser": "./dist/index.js",
125
+ "import": "./dist/index.js",
126
+ "require": "./dist/index.cjs"
126
127
  },
127
128
  "./data/package.json": "./data/package.json",
128
129
  "./data": {
129
130
  "types": "./data/dist/index.d.ts",
130
- "browser": "./data/dist/index.mjs",
131
- "import": "./data/dist/index.mjs",
132
- "require": "./data/dist/index.js"
131
+ "browser": "./data/dist/index.js",
132
+ "import": "./data/dist/index.js",
133
+ "require": "./data/dist/index.cjs"
133
134
  },
134
135
  "./internal/package.json": "./internal/package.json",
135
136
  "./internal": {
136
137
  "types": "./internal/dist/index.d.ts",
137
- "browser": "./internal/dist/index.mjs",
138
- "import": "./internal/dist/index.mjs",
139
- "require": "./internal/dist/index.js"
138
+ "browser": "./internal/dist/index.js",
139
+ "import": "./internal/dist/index.js",
140
+ "require": "./internal/dist/index.cjs"
140
141
  },
141
142
  "./introspection/package.json": "./introspection/package.json",
142
143
  "./introspection": {
143
144
  "types": "./introspection/dist/index.d.ts",
144
- "browser": "./introspection/dist/index.mjs",
145
- "import": "./introspection/dist/index.mjs",
146
- "require": "./introspection/dist/index.js"
145
+ "browser": "./introspection/dist/index.js",
146
+ "import": "./introspection/dist/index.js",
147
+ "require": "./introspection/dist/index.cjs"
147
148
  },
148
149
  "./json/package.json": "./json/package.json",
149
150
  "./json": {
150
151
  "types": "./json/dist/index.d.ts",
151
- "browser": "./json/dist/index.mjs",
152
- "import": "./json/dist/index.mjs",
153
- "require": "./json/dist/index.js"
152
+ "browser": "./json/dist/index.js",
153
+ "import": "./json/dist/index.js",
154
+ "require": "./json/dist/index.cjs"
154
155
  },
155
156
  "./react/package.json": "./react/package.json",
156
157
  "./react": {
157
158
  "types": "./react/dist/index.d.ts",
158
- "browser": "./react/dist/index.mjs",
159
- "import": "./react/dist/index.mjs",
160
- "require": "./react/dist/index.js"
159
+ "browser": "./react/dist/index.js",
160
+ "import": "./react/dist/index.js",
161
+ "require": "./react/dist/index.cjs"
161
162
  },
162
163
  "./react-devtools/package.json": "./react-devtools/package.json",
163
164
  "./react-devtools": {
164
165
  "types": "./react-devtools/dist/index.d.ts",
165
- "browser": "./react-devtools/dist/index.mjs",
166
- "import": "./react-devtools/dist/index.mjs",
167
- "require": "./react-devtools/dist/index.js"
166
+ "browser": "./react-devtools/dist/index.js",
167
+ "import": "./react-devtools/dist/index.js",
168
+ "require": "./react-devtools/dist/index.cjs"
168
169
  },
169
170
  "./realtime-client/package.json": "./realtime-client/package.json",
170
171
  "./realtime-client": {
171
172
  "types": "./realtime-client/dist/index.d.ts",
172
- "browser": "./realtime-client/dist/index.mjs",
173
- "import": "./realtime-client/dist/index.mjs",
174
- "require": "./realtime-client/dist/index.js"
173
+ "browser": "./realtime-client/dist/index.js",
174
+ "import": "./realtime-client/dist/index.js",
175
+ "require": "./realtime-client/dist/index.cjs"
175
176
  },
176
177
  "./realtime-react/package.json": "./realtime-react/package.json",
177
178
  "./realtime-react": {
178
179
  "types": "./realtime-react/dist/index.d.ts",
179
- "browser": "./realtime-react/dist/index.mjs",
180
- "import": "./realtime-react/dist/index.mjs",
181
- "require": "./realtime-react/dist/index.js"
180
+ "browser": "./realtime-react/dist/index.js",
181
+ "import": "./realtime-react/dist/index.js",
182
+ "require": "./realtime-react/dist/index.cjs"
182
183
  },
183
184
  "./realtime-server/package.json": "./realtime-server/package.json",
184
185
  "./realtime-server": {
185
186
  "types": "./realtime-server/dist/index.d.ts",
186
- "browser": "./realtime-server/dist/index.mjs",
187
- "import": "./realtime-server/dist/index.mjs",
188
- "require": "./realtime-server/dist/index.js"
187
+ "browser": "./realtime-server/dist/index.js",
188
+ "import": "./realtime-server/dist/index.js",
189
+ "require": "./realtime-server/dist/index.cjs"
189
190
  },
190
191
  "./realtime-testing/package.json": "./realtime-testing/package.json",
191
192
  "./realtime-testing": {
192
193
  "types": "./realtime-testing/dist/index.d.ts",
193
- "browser": "./realtime-testing/dist/index.mjs",
194
- "import": "./realtime-testing/dist/index.mjs",
195
- "require": "./realtime-testing/dist/index.js"
194
+ "browser": "./realtime-testing/dist/index.js",
195
+ "import": "./realtime-testing/dist/index.js",
196
+ "require": "./realtime-testing/dist/index.cjs"
196
197
  },
197
198
  "./transceivers/set-rtx/package.json": "./transceivers/set-rtx/package.json",
198
199
  "./transceivers/set-rtx": {
199
200
  "types": "./transceivers/set-rtx/dist/index.d.ts",
200
- "browser": "./transceivers/set-rtx/dist/index.mjs",
201
- "import": "./transceivers/set-rtx/dist/index.mjs",
202
- "require": "./transceivers/set-rtx/dist/index.js"
201
+ "browser": "./transceivers/set-rtx/dist/index.js",
202
+ "import": "./transceivers/set-rtx/dist/index.js",
203
+ "require": "./transceivers/set-rtx/dist/index.cjs"
203
204
  }
204
205
  },
205
206
  "scripts": {