atom.io 0.15.3 → 0.15.5

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 (125) hide show
  1. package/data/dist/index.cjs +29 -16
  2. package/data/dist/index.cjs.map +1 -1
  3. package/data/dist/index.js +30 -17
  4. package/data/dist/index.js.map +1 -1
  5. package/data/src/join.ts +15 -2
  6. package/dist/index.cjs +32 -6
  7. package/dist/index.cjs.map +1 -1
  8. package/dist/index.d.ts +153 -85
  9. package/dist/index.js +157 -1
  10. package/dist/index.js.map +1 -1
  11. package/internal/dist/index.cjs +98 -159
  12. package/internal/dist/index.cjs.map +1 -1
  13. package/internal/dist/index.d.ts +44 -32
  14. package/internal/dist/index.js +89 -105
  15. package/internal/dist/index.js.map +1 -1
  16. package/internal/src/atom/create-regular-atom.ts +1 -1
  17. package/internal/src/get-environment-data.ts +18 -0
  18. package/internal/src/index.ts +2 -0
  19. package/internal/src/ingest-updates/index.ts +3 -0
  20. package/internal/src/ingest-updates/ingest-atom-update.ts +14 -0
  21. package/internal/src/ingest-updates/ingest-selector-update.ts +17 -0
  22. package/internal/src/ingest-updates/ingest-transaction-update.ts +22 -0
  23. package/internal/src/mutable/tracker.ts +4 -4
  24. package/internal/src/not-found-error.ts +3 -8
  25. package/internal/src/operation.ts +4 -4
  26. package/internal/src/selector/create-read-write-selector.ts +6 -4
  27. package/internal/src/selector/create-readonly-selector.ts +3 -3
  28. package/internal/src/selector/register-selector.ts +6 -4
  29. package/internal/src/selector/update-selector-atoms.ts +2 -2
  30. package/internal/src/store/deposit.ts +5 -5
  31. package/internal/src/store/store.ts +4 -4
  32. package/internal/src/store/withdraw-new-family-member.ts +8 -11
  33. package/internal/src/store/withdraw.ts +11 -12
  34. package/internal/src/subscribe/subscribe-to-state.ts +2 -2
  35. package/internal/src/subscribe/subscribe-to-timeline.ts +4 -4
  36. package/internal/src/timeline/add-atom-to-timeline.ts +7 -7
  37. package/internal/src/timeline/create-timeline.ts +29 -21
  38. package/internal/src/timeline/time-travel.ts +19 -45
  39. package/internal/src/transaction/apply-transaction.ts +5 -51
  40. package/internal/src/transaction/build-transaction.ts +9 -2
  41. package/internal/src/transaction/create-transaction.ts +4 -4
  42. package/internal/src/transaction/index.ts +2 -2
  43. package/introspection/dist/index.cjs +9 -9
  44. package/introspection/dist/index.cjs.map +1 -1
  45. package/introspection/dist/index.d.ts +6 -6
  46. package/introspection/dist/index.js +9 -9
  47. package/introspection/dist/index.js.map +1 -1
  48. package/introspection/src/attach-atom-index.ts +4 -4
  49. package/introspection/src/attach-introspection-states.ts +2 -2
  50. package/introspection/src/attach-selector-index.ts +4 -4
  51. package/introspection/src/attach-timeline-family.ts +6 -6
  52. package/introspection/src/attach-timeline-index.ts +6 -4
  53. package/introspection/src/attach-transaction-index.ts +1 -1
  54. package/introspection/src/index.ts +1 -1
  55. package/package.json +11 -12
  56. package/react/dist/index.cjs.map +1 -1
  57. package/react/dist/index.d.ts +4 -4
  58. package/react/dist/index.js.map +1 -1
  59. package/react/src/store-hooks.ts +5 -5
  60. package/react-devtools/dist/index.cjs +7 -9
  61. package/react-devtools/dist/index.cjs.map +1 -1
  62. package/react-devtools/dist/index.d.ts +10 -265
  63. package/react-devtools/dist/index.js +7 -9
  64. package/react-devtools/dist/index.js.map +1 -1
  65. package/react-devtools/src/StateEditor.tsx +3 -3
  66. package/react-devtools/src/StateIndex.tsx +3 -3
  67. package/react-devtools/src/TimelineIndex.tsx +2 -2
  68. package/react-devtools/src/Updates.tsx +1 -1
  69. package/realtime-client/dist/index.cjs +68 -66
  70. package/realtime-client/dist/index.cjs.map +1 -1
  71. package/realtime-client/dist/index.d.ts +8 -7
  72. package/realtime-client/dist/index.js +63 -62
  73. package/realtime-client/dist/index.js.map +1 -1
  74. package/realtime-client/src/pull-family-member.ts +1 -1
  75. package/realtime-client/src/pull.ts +1 -1
  76. package/realtime-client/src/push.ts +2 -3
  77. package/realtime-client/src/realtime-state.ts +11 -3
  78. package/realtime-client/src/server-action.ts +65 -65
  79. package/realtime-react/dist/index.cjs +90 -56
  80. package/realtime-react/dist/index.cjs.map +1 -1
  81. package/realtime-react/dist/index.d.ts +11 -6
  82. package/realtime-react/dist/index.js +89 -55
  83. package/realtime-react/dist/index.js.map +1 -1
  84. package/realtime-react/src/on-mount.ts +23 -0
  85. package/realtime-react/src/realtime-context.tsx +14 -6
  86. package/realtime-react/src/use-pull-family-member.ts +5 -8
  87. package/realtime-react/src/use-pull-mutable-family-member.ts +4 -7
  88. package/realtime-react/src/use-pull-mutable.ts +4 -7
  89. package/realtime-react/src/use-pull.ts +5 -8
  90. package/realtime-react/src/use-push.ts +5 -9
  91. package/realtime-react/src/use-realtime-service.ts +30 -0
  92. package/realtime-react/src/use-server-action.ts +8 -8
  93. package/realtime-server/dist/index.cjs +109 -40
  94. package/realtime-server/dist/index.cjs.map +1 -1
  95. package/realtime-server/dist/index.d.ts +7 -6
  96. package/realtime-server/dist/index.js +90 -39
  97. package/realtime-server/dist/index.js.map +1 -1
  98. package/realtime-server/src/hook-composition/expose-family.ts +2 -2
  99. package/realtime-server/src/hook-composition/expose-mutable-family.ts +1 -1
  100. package/realtime-server/src/hook-composition/expose-single.ts +1 -1
  101. package/realtime-server/src/hook-composition/index.ts +2 -1
  102. package/realtime-server/src/hook-composition/receive-state.ts +2 -2
  103. package/realtime-server/src/hook-composition/receive-transaction.ts +13 -32
  104. package/realtime-server/src/hook-composition/sync-transaction.ts +92 -0
  105. package/realtime-testing/dist/index.cjs +3 -3
  106. package/realtime-testing/dist/index.cjs.map +1 -1
  107. package/realtime-testing/dist/index.js +2 -2
  108. package/realtime-testing/dist/index.js.map +1 -1
  109. package/realtime-testing/src/setup-realtime-test.tsx +4 -3
  110. package/src/atom.ts +30 -7
  111. package/src/dispose.ts +2 -2
  112. package/src/find-state.ts +64 -0
  113. package/src/get-state.ts +2 -2
  114. package/src/index.ts +23 -0
  115. package/src/logger.ts +1 -0
  116. package/src/selector.ts +16 -0
  117. package/src/set-state.ts +2 -2
  118. package/src/silo.ts +2 -2
  119. package/src/subscribe.ts +7 -11
  120. package/src/timeline.ts +20 -12
  121. package/src/transaction.ts +31 -12
  122. package/src/validators.ts +74 -0
  123. package/dist/chunk-K22LR3V6.js +0 -138
  124. package/dist/chunk-K22LR3V6.js.map +0 -1
  125. package/internal/src/set-state/copy-mutable-into-new-store.ts +0 -34
@@ -7,9 +7,9 @@ import {
7
7
  newest,
8
8
  } from "atom.io/internal"
9
9
 
10
- import type { StateTokenIndex } from "."
10
+ import type { WritableTokenIndex } from "."
11
11
 
12
- export type AtomTokenIndex = StateTokenIndex<AtomToken<unknown>>
12
+ export type AtomTokenIndex = WritableTokenIndex<AtomToken<unknown>>
13
13
 
14
14
  export const attachAtomIndex = (
15
15
  store: Store = IMPLICIT.STORE,
@@ -28,7 +28,7 @@ export const attachAtomIndex = (
28
28
  },
29
29
  effects: [
30
30
  ({ setSelf }) => {
31
- store.subject.atomCreation.subscribe(`introspection`, (atomToken) => {
31
+ store.on.atomCreation.subscribe(`introspection`, (atomToken) => {
32
32
  if (atomToken.key.includes(`👁‍🗨`)) {
33
33
  return
34
34
  }
@@ -61,7 +61,7 @@ export const attachAtomIndex = (
61
61
  }
62
62
  })
63
63
  if (newest(store).operation.open) {
64
- const unsubscribe = store.subject.operationStatus.subscribe(
64
+ const unsubscribe = store.on.operationClose.subscribe(
65
65
  `introspection: waiting to update atom index`,
66
66
  () => {
67
67
  unsubscribe()
@@ -24,8 +24,8 @@ export const attachIntrospectionStates = (
24
24
  selectorIndex: ReadonlySelectorToken<SelectorTokenIndex>
25
25
  transactionIndex: ReadonlySelectorToken<TransactionToken<ƒn>[]>
26
26
  findTransactionLogState: ReadonlySelectorFamily<TransactionUpdate<ƒn>[]>
27
- timelineIndex: ReadonlySelectorToken<TimelineToken[]>
28
- findTimelineState: ReadonlySelectorFamily<Timeline>
27
+ timelineIndex: ReadonlySelectorToken<TimelineToken<any>[]>
28
+ findTimelineState: ReadonlySelectorFamily<Timeline<any>>
29
29
  } => {
30
30
  return {
31
31
  atomIndex: attachAtomIndex(store),
@@ -7,9 +7,9 @@ import {
7
7
  newest,
8
8
  } from "atom.io/internal"
9
9
 
10
- import type { StateTokenIndex } from "."
10
+ import type { WritableTokenIndex } from "."
11
11
 
12
- export type SelectorTokenIndex = StateTokenIndex<
12
+ export type SelectorTokenIndex = WritableTokenIndex<
13
13
  ReadonlySelectorToken<unknown> | SelectorToken<unknown>
14
14
  >
15
15
 
@@ -35,7 +35,7 @@ export const attachSelectorIndex = (
35
35
  ),
36
36
  effects: [
37
37
  ({ setSelf }) => {
38
- store.subject.selectorCreation.subscribe(
38
+ store.on.selectorCreation.subscribe(
39
39
  `introspection`,
40
40
  (selectorToken) => {
41
41
  if (selectorToken.key.includes(`👁‍🗨`)) {
@@ -70,7 +70,7 @@ export const attachSelectorIndex = (
70
70
  }
71
71
  })
72
72
  if (newest(store).operation.open) {
73
- const unsubscribe = store.subject.operationStatus.subscribe(
73
+ const unsubscribe = store.on.operationClose.subscribe(
74
74
  `introspection: waiting to update selector index`,
75
75
  () => {
76
76
  unsubscribe()
@@ -9,9 +9,9 @@ import {
9
9
 
10
10
  export const attachTimelineFamily = (
11
11
  store: Store = IMPLICIT.STORE,
12
- ): ReadonlySelectorFamily<Timeline> => {
12
+ ): ReadonlySelectorFamily<Timeline<any>> => {
13
13
  const findTimelineLogState__INTERNAL = createRegularAtomFamily<
14
- Timeline,
14
+ Timeline<any>,
15
15
  string
16
16
  >(
17
17
  {
@@ -33,10 +33,10 @@ export const attachTimelineFamily = (
33
33
  const tl = store.timelines.get(key)
34
34
  tl?.subject.subscribe(`introspection`, (_) => {
35
35
  if (store.operation.open === true) {
36
- const unsubscribe = store.subject.operationStatus.subscribe(
36
+ const unsubscribe = store.on.operationClose.subscribe(
37
37
  `introspection`,
38
- (operationStatus) => {
39
- if (operationStatus.open === false) {
38
+ (operationClose) => {
39
+ if (operationClose.open === false) {
40
40
  unsubscribe()
41
41
  setSelf({ ...tl })
42
42
  }
@@ -51,7 +51,7 @@ export const attachTimelineFamily = (
51
51
  },
52
52
  store,
53
53
  )
54
- const findTimelineLogState = createSelectorFamily<Timeline, string>(
54
+ const findTimelineLogState = createSelectorFamily<Timeline<any>, string>(
55
55
  {
56
56
  key: `👁‍🗨 Timeline Update Log`,
57
57
  get:
@@ -4,17 +4,19 @@ import { IMPLICIT, createRegularAtom, createSelector } from "atom.io/internal"
4
4
 
5
5
  export const attachTimelineIndex = (
6
6
  store: Store = IMPLICIT.STORE,
7
- ): ReadonlySelectorToken<TimelineToken[]> => {
8
- const timelineTokenIndexState__INTERNAL = createRegularAtom<TimelineToken[]>(
7
+ ): ReadonlySelectorToken<TimelineToken<any>[]> => {
8
+ const timelineTokenIndexState__INTERNAL = createRegularAtom<
9
+ TimelineToken<any>[]
10
+ >(
9
11
  {
10
12
  key: `👁‍🗨 Timeline Token Index (Internal)`,
11
13
  default: () =>
12
- [...store.timelines].map(([key]): TimelineToken => {
14
+ [...store.timelines].map(([key]): TimelineToken<any> => {
13
15
  return { key, type: `timeline` }
14
16
  }),
15
17
  effects: [
16
18
  ({ setSelf }) => {
17
- store.subject.timelineCreation.subscribe(
19
+ store.on.timelineCreation.subscribe(
18
20
  `introspection`,
19
21
  (timelineToken) => {
20
22
  setSelf((state) => [...state, timelineToken])
@@ -16,7 +16,7 @@ export const attachTransactionIndex = (
16
16
  }),
17
17
  effects: [
18
18
  ({ setSelf }) => {
19
- store.subject.transactionCreation.subscribe(
19
+ store.on.transactionCreation.subscribe(
20
20
  `introspection`,
21
21
  (transactionToken) => {
22
22
  setSelf((state) => [...state, transactionToken])
@@ -12,7 +12,7 @@ export type FamilyNode<
12
12
  familyMembers: Record<string, Token>
13
13
  }
14
14
 
15
- export type StateTokenIndex<
15
+ export type WritableTokenIndex<
16
16
  Token extends
17
17
  | AtomToken<unknown>
18
18
  | ReadonlySelectorToken<unknown>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "atom.io",
3
- "version": "0.15.3",
3
+ "version": "0.15.5",
4
4
  "description": "Composable and testable reactive data library.",
5
5
  "homepage": "https://atom.io.fyi",
6
6
  "sideEffects": false,
@@ -48,19 +48,18 @@
48
48
  }
49
49
  },
50
50
  "devDependencies": {
51
- "@emotion/react": "11.11.3",
52
51
  "@testing-library/react": "14.1.2",
53
52
  "@types/http-proxy": "1.17.14",
54
53
  "@types/npmlog": "7.0.0",
55
- "@types/react": "18.2.46",
54
+ "@types/react": "18.2.47",
56
55
  "@types/tmp": "0.2.6",
57
- "@vitest/coverage-v8": "1.1.0",
58
- "@vitest/ui": "1.1.0",
56
+ "@vitest/coverage-v8": "1.1.3",
57
+ "@vitest/ui": "1.1.3",
59
58
  "concurrently": "8.2.2",
60
- "drizzle-kit": "0.20.9",
61
- "drizzle-orm": "0.29.2",
59
+ "drizzle-kit": "0.20.10",
60
+ "drizzle-orm": "0.29.3",
62
61
  "eslint": "8.56.0",
63
- "framer-motion": "10.16.16",
62
+ "framer-motion": "10.17.9",
64
63
  "happy-dom": "12.10.3",
65
64
  "http-proxy": "1.18.1",
66
65
  "npmlog": "7.0.1",
@@ -69,14 +68,14 @@
69
68
  "react": "18.2.0",
70
69
  "react-dom": "18.2.0",
71
70
  "react-router-dom": "6.21.1",
72
- "socket.io": "4.7.2",
73
- "socket.io-client": "4.7.2",
71
+ "socket.io": "4.7.3",
72
+ "socket.io-client": "4.7.3",
74
73
  "tmp": "0.2.1",
75
74
  "tsup": "8.0.1",
76
75
  "typescript": "5.3.3",
77
- "vite": "5.0.10",
76
+ "vite": "5.0.11",
78
77
  "vite-tsconfig-paths": "4.2.3",
79
- "vitest": "1.1.0"
78
+ "vitest": "1.1.3"
80
79
  },
81
80
  "main": "dist/index.js",
82
81
  "types": "dist/index.d.ts",
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/store-context.tsx","../src/store-hooks.ts"],"names":["React"],"mappings":";AACA,SAAS,gBAAgB;AACzB,YAAY,WAAW;AAQtB;AANM,IAAM,e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M;AACtB,QACC,KAAK,QAAQ,QAAO,qCAAU,OAC9B,KAAK,QAAQ,YAAW,qCAAU,QAAQ,WAC1C,SAAS,YAAY,OACpB;AACD,eAAS,UAAU;AACnB,WAAK,UAAU,YAAY;AAAA,IAC5B;AACA,WAAO,KAAK;AAAA,EACb;AACA,SAAa;AAAA,IACZ,CAAC,aAAa,oBAAoB,OAAO,UAAU,UAAU,EAAE,IAAI,KAAK;AAAA,IACxE;AAAA,IACA;AAAA,EACD;AACD","sourcesContent":["import type { Store } from \"atom.io/internal\"\nimport { IMPLICIT } from \"atom.io/internal\"\nimport * as React from \"react\"\n\nexport const StoreContext = React.createContext<Store>(IMPLICIT.STORE)\n\nexport const StoreProvider: React.FC<{\n\tchildren: React.ReactNode\n\tstore?: Store\n}> = ({ children, store = IMPLICIT.STORE }) => (\n\t<StoreContext.Provider value={store}>{children}</StoreContext.Provider>\n)\n","import * as React from \"react\"\n\nimport { getState, redo, setState, undo } from \"atom.io\"\nimport type {\n\tMutableAtomToken,\n\tReadonlySelectorToken,\n\tStateToken,\n\tTimelineToken,\n} from \"atom.io\"\n\nimport {\n\tgetJsonToken,\n\tsubscribeToState,\n\tsubscribeToTimeline,\n\twithdraw,\n} from \"atom.io/internal\"\nimport type { Json } from \"atom.io/json\"\nimport { StoreContext } from \"./store-context\"\n\nexport function useI<T>(\n\ttoken: StateToken<T>,\n): <New extends T>(next: New | ((old: T) => New)) => void {\n\tconst store = React.useContext(StoreContext)\n\tconst setter: React.MutableRefObject<\n\t\t(<New extends T>(next: New | ((old: T) => New)) => void) | null\n\t> = React.useRef(null)\n\tif (setter.current === null) {\n\t\tsetter.current = (next) => setState(token, next, store)\n\t}\n\treturn setter.current\n}\n\nexport function useO<T>(token: ReadonlySelectorToken<T> | StateToken<T>): T {\n\tconst store = React.useContext(StoreContext)\n\tconst id = React.useId()\n\treturn React.useSyncExternalStore<T>(\n\t\t(dispatch) => subscribeToState(token, dispatch, `use-o:${id}`, store),\n\t\t() => getState(token, store),\n\t\t() => getState(token, store),\n\t)\n}\n\nexport function useJSON<Serializable extends Json.Serializable>(\n\ttoken: MutableAtomToken<any, Serializable>,\n): Serializable {\n\tconst jsonToken = getJsonToken(token)\n\treturn useO(jsonToken)\n}\n\nexport type TimelineMeta = {\n\tat: number\n\tlength: number\n\tundo: () => void\n\tredo: () => void\n}\n\nexport function useTL(token: TimelineToken): TimelineMeta {\n\tconst store = React.useContext(StoreContext)\n\tconst id = React.useId()\n\tconst timeline = withdraw(token, store)\n\tconst tokenRef = React.useRef(token)\n\tconst rebuildMeta = () => {\n\t\treturn {\n\t\t\tat: timeline?.at ?? NaN,\n\t\t\tlength: timeline?.history.length ?? NaN,\n\t\t\tundo: () => undo(token),\n\t\t\tredo: () => redo(token),\n\t\t}\n\t}\n\tconst meta = React.useRef<TimelineMeta>(rebuildMeta())\n\tconst retrieve = () => {\n\t\tif (\n\t\t\tmeta.current.at !== timeline?.at ||\n\t\t\tmeta.current.length !== timeline?.history.length ||\n\t\t\ttokenRef.current !== token\n\t\t) {\n\t\t\ttokenRef.current = token\n\t\t\tmeta.current = rebuildMeta()\n\t\t}\n\t\treturn meta.current\n\t}\n\treturn React.useSyncExternalStore<TimelineMeta>(\n\t\t(dispatch) => subscribeToTimeline(token, dispatch, `use-tl:${id}`, store),\n\t\tretrieve,\n\t\tretrieve,\n\t)\n}\n"]}
1
+ {"version":3,"sources":["../src/store-context.tsx","../src/store-hooks.ts"],"names":["React"],"mappings":";AACA,SAAS,gBAAgB;AACzB,YAAY,WAAW;AAQtB;AANM,IAAM,eAAqB,oBAAqB,SAAS,KAAK;AAE9D,IAAM,gBAGR,CAAC,EAAE,UAAU,QAAQ,SAAS,MAAM,MACxC,oBAAC,aAAa,UAAb,EAAsB,OAAO,OAAQ,UAAS;;;ACVhD,YAAYA,YAAW;AAEvB,SAAS,UAAU,MAAM,UAAU,YAAY;AAQ/C;AAAA,EACC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACM;AAIA,SAAS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AA,IACxE;AAAA,IACA;AAAA,EACD;AACD","sourcesContent":["import type { Store } from \"atom.io/internal\"\nimport { IMPLICIT } from \"atom.io/internal\"\nimport * as React from \"react\"\n\nexport const StoreContext = React.createContext<Store>(IMPLICIT.STORE)\n\nexport const StoreProvider: React.FC<{\n\tchildren: React.ReactNode\n\tstore?: Store\n}> = ({ children, store = IMPLICIT.STORE }) => (\n\t<StoreContext.Provider value={store}>{children}</StoreContext.Provider>\n)\n","import * as React from \"react\"\n\nimport { getState, redo, setState, undo } from \"atom.io\"\nimport type {\n\tMutableAtomToken,\n\tReadableToken,\n\tTimelineToken,\n\tWritableToken,\n} from \"atom.io\"\n\nimport {\n\tgetJsonToken,\n\tsubscribeToState,\n\tsubscribeToTimeline,\n\twithdraw,\n} from \"atom.io/internal\"\nimport type { Json } from \"atom.io/json\"\nimport { StoreContext } from \"./store-context\"\n\nexport function useI<T>(\n\ttoken: WritableToken<T>,\n): <New extends T>(next: New | ((old: T) => New)) => void {\n\tconst store = React.useContext(StoreContext)\n\tconst setter: React.MutableRefObject<\n\t\t(<New extends T>(next: New | ((old: T) => New)) => void) | null\n\t> = React.useRef(null)\n\tif (setter.current === null) {\n\t\tsetter.current = (next) => setState(token, next, store)\n\t}\n\treturn setter.current\n}\n\nexport function useO<T>(token: ReadableToken<T>): T {\n\tconst store = React.useContext(StoreContext)\n\tconst id = React.useId()\n\treturn React.useSyncExternalStore<T>(\n\t\t(dispatch) => subscribeToState(token, dispatch, `use-o:${id}`, store),\n\t\t() => getState(token, store),\n\t\t() => getState(token, store),\n\t)\n}\n\nexport function useJSON<Serializable extends Json.Serializable>(\n\ttoken: MutableAtomToken<any, Serializable>,\n): Serializable {\n\tconst jsonToken = getJsonToken(token)\n\treturn useO(jsonToken)\n}\n\nexport type TimelineMeta = {\n\tat: number\n\tlength: number\n\tundo: () => void\n\tredo: () => void\n}\n\nexport function useTL(token: TimelineToken<any>): TimelineMeta {\n\tconst store = React.useContext(StoreContext)\n\tconst id = React.useId()\n\tconst timeline = withdraw(token, store)\n\tconst tokenRef = React.useRef(token)\n\tconst rebuildMeta = () => {\n\t\treturn {\n\t\t\tat: timeline?.at ?? NaN,\n\t\t\tlength: timeline?.history.length ?? NaN,\n\t\t\tundo: () => undo(token),\n\t\t\tredo: () => redo(token),\n\t\t}\n\t}\n\tconst meta = React.useRef<TimelineMeta>(rebuildMeta())\n\tconst retrieve = () => {\n\t\tif (\n\t\t\tmeta.current.at !== timeline?.at ||\n\t\t\tmeta.current.length !== timeline?.history.length ||\n\t\t\ttokenRef.current !== token\n\t\t) {\n\t\t\ttokenRef.current = token\n\t\t\tmeta.current = rebuildMeta()\n\t\t}\n\t\treturn meta.current\n\t}\n\treturn React.useSyncExternalStore<TimelineMeta>(\n\t\t(dispatch) => subscribeToTimeline(token, dispatch, `use-tl:${id}`, store),\n\t\tretrieve,\n\t\tretrieve,\n\t)\n}\n"]}
@@ -1,6 +1,6 @@
1
1
  import { Store } from 'atom.io/internal';
2
2
  import * as React from 'react';
3
- import { StateToken, ReadonlySelectorToken, MutableAtomToken, TimelineToken } from 'atom.io';
3
+ import { WritableToken, ReadableToken, MutableAtomToken, TimelineToken } from 'atom.io';
4
4
  import { Json } from 'atom.io/json';
5
5
 
6
6
  declare const StoreContext: React.Context<Store>;
@@ -9,8 +9,8 @@ declare const StoreProvider: React.FC<{
9
9
  store?: Store;
10
10
  }>;
11
11
 
12
- declare function useI<T>(token: StateToken<T>): <New extends T>(next: New | ((old: T) => New)) => void;
13
- declare function useO<T>(token: ReadonlySelectorToken<T> | StateToken<T>): T;
12
+ declare function useI<T>(token: WritableToken<T>): <New extends T>(next: New | ((old: T) => New)) => void;
13
+ declare function useO<T>(token: ReadableToken<T>): T;
14
14
  declare function useJSON<Serializable extends Json.Serializable>(token: MutableAtomToken<any, Serializable>): Serializable;
15
15
  type TimelineMeta = {
16
16
  at: number;
@@ -18,6 +18,6 @@ type TimelineMeta = {
18
18
  undo: () => void;
19
19
  redo: () => void;
20
20
  };
21
- declare function useTL(token: TimelineToken): TimelineMeta;
21
+ declare function useTL(token: TimelineToken<any>): TimelineMeta;
22
22
 
23
23
  export { StoreContext, StoreProvider, type TimelineMeta, useI, useJSON, useO, useTL };
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/store-context.tsx","../src/store-hooks.ts"],"names":["React"],"mappings":";;;AACA,SAAS,gBAAgB;AACzB,YAAY,WAAW;AAQtB;AANM,IAAM,eAAqB,oBAAqB,SAAS,KAAK;AAE9D,IAAM,gBAGR,CAAC,EAAE,UAAU,QAAQ,SAAS,MAAM,MACxC,oBAAC,aAAa,UAAb,EAAsB,OAAO,OAAQ,UAAS;;;ACVhD,YAAYA,YAAW;AAEvB,SAAS,UAAU,MAAM,UAAU,YAAY;AAQ/C;AAAA,EACC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACM;AAIA,SAAS,KACf,OACyD;AACzD,QAAM,QAAc,kBAAW,YAAY;AAC3C,QAAM,SAEI,cAAO,IAAI;AACrB,MAAI,OAAO,YAAY,MAAM;AAC5B,WAAO,UAAU,CAAC,SAAS,SAAS,OAAO,MAAM,KAAK;AAAA,EACvD;AACA,SAAO,OAAO;AACf;AAEO,SAAS,KAAQ,OAAoD;AAC3E,QAAM,QAAc,kBAAW,YAAY;AAC3C,QAAM,KAAW,aAAM;AACvB,SAAa;AAAA,IACZ,CAAC,aAAa,iBAAiB,OAAO,UAAU,SAAS,EAAE,IAAI,KAAK;AAAA,IACpE,MAAM,SAAS,OAAO,KAAK;AAAA,IAC3B,MAAM,SAAS,OAAO,KAAK;AAAA,EAC5B;AACD;AAEO,SAAS,QACf,OACe;AACf,QAAM,YAAY,aAAa,KAAK;AACpC,SAAO,KAAK,SAAS;AACtB;AASO,SAAS,MAAM,OAAoC;AACzD,QAAM,QAAc,kBAAW,YAAY;AAC3C,QAAM,KAAW,aAAM;AACvB,QAAM,WAAW,SAAS,OAAO,KAAK;AACtC,QAAM,WAAiB,cAAO,KAAK;AACnC,QAAM,cAAc,MAAM;AA7D3B;AA8DE,WAAO;AAAA,MACN,KAAI,0CAAU,OAAV,YAAgB;AAAA,MACpB,SAAQ,0CAAU,QAAQ,WAAlB,YAA4B;AAAA,MACpC,MAAM,MAAM,KAAK,KAAK;AAAA,MACtB,MAAM,MAAM,KAAK,KAAK;AAAA,IACvB;AAAA,EACD;AACA,QAAM,OAAa,cAAqB,YAAY,CAAC;AACrD,QAAM,WAAW,MAAM;AACtB,QACC,KAAK,QAAQ,QAAO,qCAAU,OAC9B,KAAK,QAAQ,YAAW,qCAAU,QAAQ,WAC1C,SAAS,YAAY,OACpB;AACD,eAAS,UAAU;AACnB,WAAK,UAAU,YAAY;AAAA,IAC5B;AACA,WAAO,KAAK;AAAA,EACb;AACA,SAAa;AAAA,IACZ,CAAC,aAAa,oBAAoB,OAAO,UAAU,UAAU,EAAE,IAAI,KAAK;AAAA,IACxE;AAAA,IACA;AAAA,EACD;AACD","sourcesContent":["import type { Store } from \"atom.io/internal\"\nimport { IMPLICIT } from \"atom.io/internal\"\nimport * as React from \"react\"\n\nexport const StoreContext = React.createContext<Store>(IMPLICIT.STORE)\n\nexport const StoreProvider: React.FC<{\n\tchildren: React.ReactNode\n\tstore?: Store\n}> = ({ children, store = IMPLICIT.STORE }) => (\n\t<StoreContext.Provider value={store}>{children}</StoreContext.Provider>\n)\n","import * as React from \"react\"\n\nimport { getState, redo, setState, undo } from \"atom.io\"\nimport type {\n\tMutableAtomToken,\n\tReadonlySelectorToken,\n\tStateToken,\n\tTimelineToken,\n} from \"atom.io\"\n\nimport {\n\tgetJsonToken,\n\tsubscribeToState,\n\tsubscribeToTimeline,\n\twithdraw,\n} from \"atom.io/internal\"\nimport type { Json } from \"atom.io/json\"\nimport { StoreContext } from \"./store-context\"\n\nexport function useI<T>(\n\ttoken: StateToken<T>,\n): <New extends T>(next: New | ((old: T) => New)) => void {\n\tconst store = React.useContext(StoreContext)\n\tconst setter: React.MutableRefObject<\n\t\t(<New extends T>(next: New | ((old: T) => New)) => void) | null\n\t> = React.useRef(null)\n\tif (setter.current === null) {\n\t\tsetter.current = (next) => setState(token, next, store)\n\t}\n\treturn setter.current\n}\n\nexport function useO<T>(token: ReadonlySelectorToken<T> | StateToken<T>): T {\n\tconst store = React.useContext(StoreContext)\n\tconst id = React.useId()\n\treturn React.useSyncExternalStore<T>(\n\t\t(dispatch) => subscribeToState(token, dispatch, `use-o:${id}`, store),\n\t\t() => getState(token, store),\n\t\t() => getState(token, store),\n\t)\n}\n\nexport function useJSON<Serializable extends Json.Serializable>(\n\ttoken: MutableAtomToken<any, Serializable>,\n): Serializable {\n\tconst jsonToken = getJsonToken(token)\n\treturn useO(jsonToken)\n}\n\nexport type TimelineMeta = {\n\tat: number\n\tlength: number\n\tundo: () => void\n\tredo: () => void\n}\n\nexport function useTL(token: TimelineToken): TimelineMeta {\n\tconst store = React.useContext(StoreContext)\n\tconst id = React.useId()\n\tconst timeline = withdraw(token, store)\n\tconst tokenRef = React.useRef(token)\n\tconst rebuildMeta = () => {\n\t\treturn {\n\t\t\tat: timeline?.at ?? NaN,\n\t\t\tlength: timeline?.history.length ?? NaN,\n\t\t\tundo: () => undo(token),\n\t\t\tredo: () => redo(token),\n\t\t}\n\t}\n\tconst meta = React.useRef<TimelineMeta>(rebuildMeta())\n\tconst retrieve = () => {\n\t\tif (\n\t\t\tmeta.current.at !== timeline?.at ||\n\t\t\tmeta.current.length !== timeline?.history.length ||\n\t\t\ttokenRef.current !== token\n\t\t) {\n\t\t\ttokenRef.current = token\n\t\t\tmeta.current = rebuildMeta()\n\t\t}\n\t\treturn meta.current\n\t}\n\treturn React.useSyncExternalStore<TimelineMeta>(\n\t\t(dispatch) => subscribeToTimeline(token, dispatch, `use-tl:${id}`, store),\n\t\tretrieve,\n\t\tretrieve,\n\t)\n}\n"]}
1
+ {"version":3,"sources":["../src/store-context.tsx","../src/store-hooks.ts"],"names":["React"],"mappings":";;;AACA,SAAS,gBAAgB;AACzB,YAAY,WAAW;AAQtB;AANM,IAAM,eA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;AACtB,QACC,KAAK,QAAQ,QAAO,qCAAU,OAC9B,KAAK,QAAQ,YAAW,qCAAU,QAAQ,WAC1C,SAAS,YAAY,OACpB;AACD,eAAS,UAAU;AACnB,WAAK,UAAU,YAAY;AAAA,IAC5B;AACA,WAAO,KAAK;AAAA,EACb;AACA,SAAa;AAAA,IACZ,CAAC,aAAa,oBAAoB,OAAO,UAAU,UAAU,EAAE,IAAI,KAAK;AAAA,IACxE;AAAA,IACA;AAAA,EACD;AACD","sourcesContent":["import type { Store } from \"atom.io/internal\"\nimport { IMPLICIT } from \"atom.io/internal\"\nimport * as React from \"react\"\n\nexport const StoreContext = React.createContext<Store>(IMPLICIT.STORE)\n\nexport const StoreProvider: React.FC<{\n\tchildren: React.ReactNode\n\tstore?: Store\n}> = ({ children, store = IMPLICIT.STORE }) => (\n\t<StoreContext.Provider value={store}>{children}</StoreContext.Provider>\n)\n","import * as React from \"react\"\n\nimport { getState, redo, setState, undo } from \"atom.io\"\nimport type {\n\tMutableAtomToken,\n\tReadableToken,\n\tTimelineToken,\n\tWritableToken,\n} from \"atom.io\"\n\nimport {\n\tgetJsonToken,\n\tsubscribeToState,\n\tsubscribeToTimeline,\n\twithdraw,\n} from \"atom.io/internal\"\nimport type { Json } from \"atom.io/json\"\nimport { StoreContext } from \"./store-context\"\n\nexport function useI<T>(\n\ttoken: WritableToken<T>,\n): <New extends T>(next: New | ((old: T) => New)) => void {\n\tconst store = React.useContext(StoreContext)\n\tconst setter: React.MutableRefObject<\n\t\t(<New extends T>(next: New | ((old: T) => New)) => void) | null\n\t> = React.useRef(null)\n\tif (setter.current === null) {\n\t\tsetter.current = (next) => setState(token, next, store)\n\t}\n\treturn setter.current\n}\n\nexport function useO<T>(token: ReadableToken<T>): T {\n\tconst store = React.useContext(StoreContext)\n\tconst id = React.useId()\n\treturn React.useSyncExternalStore<T>(\n\t\t(dispatch) => subscribeToState(token, dispatch, `use-o:${id}`, store),\n\t\t() => getState(token, store),\n\t\t() => getState(token, store),\n\t)\n}\n\nexport function useJSON<Serializable extends Json.Serializable>(\n\ttoken: MutableAtomToken<any, Serializable>,\n): Serializable {\n\tconst jsonToken = getJsonToken(token)\n\treturn useO(jsonToken)\n}\n\nexport type TimelineMeta = {\n\tat: number\n\tlength: number\n\tundo: () => void\n\tredo: () => void\n}\n\nexport function useTL(token: TimelineToken<any>): TimelineMeta {\n\tconst store = React.useContext(StoreContext)\n\tconst id = React.useId()\n\tconst timeline = withdraw(token, store)\n\tconst tokenRef = React.useRef(token)\n\tconst rebuildMeta = () => {\n\t\treturn {\n\t\t\tat: timeline?.at ?? NaN,\n\t\t\tlength: timeline?.history.length ?? NaN,\n\t\t\tundo: () => undo(token),\n\t\t\tredo: () => redo(token),\n\t\t}\n\t}\n\tconst meta = React.useRef<TimelineMeta>(rebuildMeta())\n\tconst retrieve = () => {\n\t\tif (\n\t\t\tmeta.current.at !== timeline?.at ||\n\t\t\tmeta.current.length !== timeline?.history.length ||\n\t\t\ttokenRef.current !== token\n\t\t) {\n\t\t\ttokenRef.current = token\n\t\t\tmeta.current = rebuildMeta()\n\t\t}\n\t\treturn meta.current\n\t}\n\treturn React.useSyncExternalStore<TimelineMeta>(\n\t\t(dispatch) => subscribeToTimeline(token, dispatch, `use-tl:${id}`, store),\n\t\tretrieve,\n\t\tretrieve,\n\t)\n}\n"]}
@@ -3,9 +3,9 @@ import * as React from "react"
3
3
  import { getState, redo, setState, undo } from "atom.io"
4
4
  import type {
5
5
  MutableAtomToken,
6
- ReadonlySelectorToken,
7
- StateToken,
6
+ ReadableToken,
8
7
  TimelineToken,
8
+ WritableToken,
9
9
  } from "atom.io"
10
10
 
11
11
  import {
@@ -18,7 +18,7 @@ import type { Json } from "atom.io/json"
18
18
  import { StoreContext } from "./store-context"
19
19
 
20
20
  export function useI<T>(
21
- token: StateToken<T>,
21
+ token: WritableToken<T>,
22
22
  ): <New extends T>(next: New | ((old: T) => New)) => void {
23
23
  const store = React.useContext(StoreContext)
24
24
  const setter: React.MutableRefObject<
@@ -30,7 +30,7 @@ export function useI<T>(
30
30
  return setter.current
31
31
  }
32
32
 
33
- export function useO<T>(token: ReadonlySelectorToken<T> | StateToken<T>): T {
33
+ export function useO<T>(token: ReadableToken<T>): T {
34
34
  const store = React.useContext(StoreContext)
35
35
  const id = React.useId()
36
36
  return React.useSyncExternalStore<T>(
@@ -54,7 +54,7 @@ export type TimelineMeta = {
54
54
  redo: () => void
55
55
  }
56
56
 
57
- export function useTL(token: TimelineToken): TimelineMeta {
57
+ export function useTL(token: TimelineToken<any>): TimelineMeta {
58
58
  const store = React.useContext(StoreContext)
59
59
  const id = React.useId()
60
60
  const timeline = withdraw(token, store)
@@ -947,7 +947,6 @@ var valueToText = (numericValue) => {
947
947
  };
948
948
  var NumberInput = ({
949
949
  autoSize = false,
950
- customCss,
951
950
  decimalPlaces,
952
951
  disabled = false,
953
952
  label,
@@ -996,7 +995,7 @@ var NumberInput = ({
996
995
  }
997
996
  };
998
997
  const displayValue = temporaryEntry != null ? temporaryEntry : valueToText(value ? refine(value) : value);
999
- return /* @__PURE__ */ jsxRuntime.jsxs("span", { css: customCss, children: [
998
+ return /* @__PURE__ */ jsxRuntime.jsxs("span", { children: [
1000
999
  label && /* @__PURE__ */ jsxRuntime.jsx("label", { htmlFor: id, children: label }),
1001
1000
  autoSize ? /* @__PURE__ */ jsxRuntime.jsx(
1002
1001
  ElasticInput,
@@ -1034,10 +1033,9 @@ var TextInput = ({
1034
1033
  set,
1035
1034
  label,
1036
1035
  placeholder,
1037
- customCss,
1038
1036
  autoSize = false
1039
1037
  }) => {
1040
- return /* @__PURE__ */ jsxRuntime.jsxs("span", { css: customCss, children: [
1038
+ return /* @__PURE__ */ jsxRuntime.jsxs("span", { children: [
1041
1039
  /* @__PURE__ */ jsxRuntime.jsx("label", { children: label }),
1042
1040
  autoSize ? /* @__PURE__ */ jsxRuntime.jsx(
1043
1041
  ElasticInput,
@@ -1081,7 +1079,7 @@ var JsonEditor_INTERNAL = ({
1081
1079
  isReadonly = () => false,
1082
1080
  isHidden = () => false,
1083
1081
  className,
1084
- customCss,
1082
+ style,
1085
1083
  Header: HeaderDisplay,
1086
1084
  Components
1087
1085
  }) => {
@@ -1089,7 +1087,7 @@ var JsonEditor_INTERNAL = ({
1089
1087
  const refined = dataIsJson ? refineJsonType(data) : { type: `non-json`, data };
1090
1088
  const SubEditor = dataIsJson ? SubEditors[refined.type] : NonJsonEditor;
1091
1089
  const disabled = isReadonly(path);
1092
- return isHidden(path) ? null : /* @__PURE__ */ jsxRuntime.jsx(Components.ErrorBoundary, { children: /* @__PURE__ */ jsxRuntime.jsxs(Components.EditorWrapper, { className, customCss, children: [
1090
+ return isHidden(path) ? null : /* @__PURE__ */ jsxRuntime.jsx(Components.ErrorBoundary, { children: /* @__PURE__ */ jsxRuntime.jsxs(Components.EditorWrapper, { className, style, children: [
1093
1091
  remove && /* @__PURE__ */ jsxRuntime.jsx(
1094
1092
  Components.Button,
1095
1093
  {
@@ -1874,7 +1872,7 @@ var DEFAULT_JSON_EDITOR_COMPONENTS = {
1874
1872
  children
1875
1873
  }
1876
1874
  ),
1877
- EditorWrapper: ({ children, customCss, className }) => /* @__PURE__ */ jsxRuntime.jsx("div", { className: `json_editor ` + className, css: customCss, children }),
1875
+ EditorWrapper: ({ children, className }) => /* @__PURE__ */ jsxRuntime.jsx("div", { className: `json_editor ` + className, children }),
1878
1876
  EditorLayout: ({
1879
1877
  DeleteButton,
1880
1878
  Header,
@@ -1916,8 +1914,8 @@ var JsonEditor = ({
1916
1914
  isHidden = () => false,
1917
1915
  // isIllegal = () => false,
1918
1916
  className,
1919
- customCss,
1920
1917
  Header,
1918
+ style,
1921
1919
  Components: CustomComponents = {}
1922
1920
  }) => {
1923
1921
  const Components = __spreadValues(__spreadValues({}, DEFAULT_JSON_EDITOR_COMPONENTS), CustomComponents);
@@ -1934,8 +1932,8 @@ var JsonEditor = ({
1934
1932
  isReadonly,
1935
1933
  isHidden,
1936
1934
  className,
1937
- customCss,
1938
1935
  Header,
1936
+ style,
1939
1937
  Components
1940
1938
  }
1941
1939
  );