quidproquo-web-react 0.1.12 → 0.1.14

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 (242) hide show
  1. package/lib/commonjs/hooks/index.d.ts +0 -1
  2. package/lib/commonjs/hooks/index.js +0 -1
  3. package/lib/commonjs/hooks/index.js.map +1 -1
  4. package/lib/commonjs/hooks/useQpq.js +2 -2
  5. package/lib/commonjs/hooks/useQpq.js.map +1 -1
  6. package/lib/commonjs/index.d.ts +3 -0
  7. package/lib/commonjs/index.js +3 -0
  8. package/lib/commonjs/index.js.map +1 -1
  9. package/lib/commonjs/{hooks/asmj → qpqContext}/QpqContextProvider.d.ts +3 -5
  10. package/lib/commonjs/qpqContext/QpqContextProvider.js +16 -0
  11. package/lib/commonjs/qpqContext/QpqContextProvider.js.map +1 -0
  12. package/lib/commonjs/qpqContext/index.d.ts +3 -0
  13. package/lib/commonjs/qpqContext/index.js +20 -0
  14. package/lib/commonjs/qpqContext/index.js.map +1 -0
  15. package/lib/commonjs/qpqContext/qpqReactContext.d.ts +2 -0
  16. package/lib/commonjs/qpqContext/qpqReactContext.js +6 -0
  17. package/lib/commonjs/qpqContext/qpqReactContext.js.map +1 -0
  18. package/lib/commonjs/qpqContext/useQpqContextValue.d.ts +2 -0
  19. package/lib/commonjs/qpqContext/useQpqContextValue.js +10 -0
  20. package/lib/commonjs/qpqContext/useQpqContextValue.js.map +1 -0
  21. package/lib/commonjs/qpqContext/useQpqContextValues.d.ts +2 -0
  22. package/lib/commonjs/qpqContext/useQpqContextValues.js +10 -0
  23. package/lib/commonjs/qpqContext/useQpqContextValues.js.map +1 -0
  24. package/lib/commonjs/runtime/ActionProcessorListResolverFactory.d.ts +3 -0
  25. package/lib/commonjs/runtime/ActionProcessorListResolverFactory.js +3 -0
  26. package/lib/commonjs/runtime/ActionProcessorListResolverFactory.js.map +1 -0
  27. package/lib/commonjs/runtime/BubbleReducerDispatchContext.d.ts +1 -0
  28. package/lib/commonjs/runtime/BubbleReducerDispatchContext.js +9 -0
  29. package/lib/commonjs/runtime/BubbleReducerDispatchContext.js.map +1 -0
  30. package/lib/commonjs/runtime/QpqBubbleReducer.d.ts +1 -0
  31. package/lib/commonjs/runtime/QpqBubbleReducer.js +3 -0
  32. package/lib/commonjs/runtime/QpqBubbleReducer.js.map +1 -0
  33. package/lib/commonjs/runtime/QpqMappedApi.js.map +1 -0
  34. package/lib/commonjs/runtime/QpqRuntimeEffectCatcher.d.ts +9 -0
  35. package/lib/commonjs/runtime/QpqRuntimeEffectCatcher.js +13 -0
  36. package/lib/commonjs/runtime/QpqRuntimeEffectCatcher.js.map +1 -0
  37. package/lib/commonjs/runtime/actionProcessor/getStateDispatchActionProcessor.js.map +1 -0
  38. package/lib/commonjs/runtime/actionProcessor/getStateReadActionProcessor.js.map +1 -0
  39. package/lib/commonjs/runtime/actionProcessor/index.js.map +1 -0
  40. package/lib/commonjs/runtime/createQpqRuntimeComputed.d.ts +7 -0
  41. package/lib/commonjs/runtime/createQpqRuntimeComputed.js +7 -0
  42. package/lib/commonjs/runtime/createQpqRuntimeComputed.js.map +1 -0
  43. package/lib/commonjs/runtime/createQpqRuntimeDefinition.d.ts +16 -0
  44. package/lib/commonjs/runtime/createQpqRuntimeDefinition.js +10 -0
  45. package/lib/commonjs/runtime/createQpqRuntimeDefinition.js.map +1 -0
  46. package/lib/commonjs/runtime/getQpqRuntimeAreaKey.d.ts +3 -0
  47. package/lib/commonjs/runtime/getQpqRuntimeAreaKey.js +6 -0
  48. package/lib/commonjs/runtime/getQpqRuntimeAreaKey.js.map +1 -0
  49. package/lib/commonjs/runtime/index.d.ts +12 -0
  50. package/lib/commonjs/{hooks/asmj → runtime}/index.js +6 -2
  51. package/lib/commonjs/runtime/index.js.map +1 -0
  52. package/lib/commonjs/{hooks/asmj → runtime}/useBubbleReducer.d.ts +1 -1
  53. package/lib/commonjs/{hooks/asmj → runtime}/useBubbleReducer.js +2 -2
  54. package/lib/commonjs/runtime/useBubbleReducer.js.map +1 -0
  55. package/lib/commonjs/runtime/useQpqAreaBinding.d.ts +11 -0
  56. package/lib/commonjs/runtime/useQpqAreaBinding.js +81 -0
  57. package/lib/commonjs/runtime/useQpqAreaBinding.js.map +1 -0
  58. package/lib/commonjs/runtime/useQpqRuntime.d.ts +4 -0
  59. package/lib/commonjs/runtime/useQpqRuntime.js +28 -0
  60. package/lib/commonjs/runtime/useQpqRuntime.js.map +1 -0
  61. package/lib/commonjs/runtime/useQpqRuntimeComputed.d.ts +2 -0
  62. package/lib/commonjs/runtime/useQpqRuntimeComputed.js +26 -0
  63. package/lib/commonjs/runtime/useQpqRuntimeComputed.js.map +1 -0
  64. package/lib/commonjs/store/QpqStoreProvider.d.ts +8 -0
  65. package/lib/commonjs/store/QpqStoreProvider.js +13 -0
  66. package/lib/commonjs/store/QpqStoreProvider.js.map +1 -0
  67. package/lib/commonjs/store/connectQpqStoreToReduxDevTools.d.ts +2 -0
  68. package/lib/commonjs/store/connectQpqStoreToReduxDevTools.js +144 -0
  69. package/lib/commonjs/store/connectQpqStoreToReduxDevTools.js.map +1 -0
  70. package/lib/commonjs/store/createQpqStore.d.ts +22 -0
  71. package/lib/commonjs/store/createQpqStore.js +160 -0
  72. package/lib/commonjs/store/createQpqStore.js.map +1 -0
  73. package/lib/commonjs/store/index.d.ts +5 -0
  74. package/lib/commonjs/store/index.js +22 -0
  75. package/lib/commonjs/store/index.js.map +1 -0
  76. package/lib/commonjs/store/qpqStoreContext.d.ts +3 -0
  77. package/lib/commonjs/store/qpqStoreContext.js +6 -0
  78. package/lib/commonjs/store/qpqStoreContext.js.map +1 -0
  79. package/lib/commonjs/store/useQpqStore.d.ts +2 -0
  80. package/lib/commonjs/store/useQpqStore.js +14 -0
  81. package/lib/commonjs/store/useQpqStore.js.map +1 -0
  82. package/lib/commonjs/useFieldBinding/useFieldBinding.d.ts +1 -1
  83. package/lib/commonjs/useFieldBinding/useFieldBinding.js +2 -2
  84. package/lib/commonjs/useFieldBinding/useFieldBinding.js.map +1 -1
  85. package/lib/commonjs/useSharedQueryParams/sharedQueryParamsRuntime.d.ts +1 -1
  86. package/lib/commonjs/useSharedQueryParams/sharedQueryParamsRuntime.js +7 -2
  87. package/lib/commonjs/useSharedQueryParams/sharedQueryParamsRuntime.js.map +1 -1
  88. package/lib/commonjs/webSocketQueue/hooks/useQpqWebsocketQueueRuntime.d.ts +4 -5
  89. package/lib/commonjs/webSocketQueue/hooks/useQpqWebsocketQueueRuntime.js +3 -3
  90. package/lib/commonjs/webSocketQueue/hooks/useQpqWebsocketQueueRuntime.js.map +1 -1
  91. package/lib/commonjs/webSocketQueue/hooks/useWebsocketQueueSendEvent.js +8 -1
  92. package/lib/commonjs/webSocketQueue/hooks/useWebsocketQueueSendEvent.js.map +1 -1
  93. package/lib/esm/hooks/index.d.ts +0 -1
  94. package/lib/esm/hooks/index.js +0 -1
  95. package/lib/esm/hooks/index.js.map +1 -1
  96. package/lib/esm/hooks/useQpq.js +1 -1
  97. package/lib/esm/hooks/useQpq.js.map +1 -1
  98. package/lib/esm/index.d.ts +3 -0
  99. package/lib/esm/index.js +3 -0
  100. package/lib/esm/index.js.map +1 -1
  101. package/lib/esm/{hooks/asmj → qpqContext}/QpqContextProvider.d.ts +3 -5
  102. package/lib/esm/{hooks/asmj → qpqContext}/QpqContextProvider.js +2 -10
  103. package/lib/esm/qpqContext/QpqContextProvider.js.map +1 -0
  104. package/lib/esm/qpqContext/index.d.ts +3 -0
  105. package/lib/esm/qpqContext/index.js +4 -0
  106. package/lib/esm/qpqContext/index.js.map +1 -0
  107. package/lib/esm/qpqContext/qpqReactContext.d.ts +2 -0
  108. package/lib/esm/qpqContext/qpqReactContext.js +3 -0
  109. package/lib/esm/qpqContext/qpqReactContext.js.map +1 -0
  110. package/lib/esm/qpqContext/useQpqContextValue.d.ts +2 -0
  111. package/lib/esm/qpqContext/useQpqContextValue.js +6 -0
  112. package/lib/esm/qpqContext/useQpqContextValue.js.map +1 -0
  113. package/lib/esm/qpqContext/useQpqContextValues.d.ts +2 -0
  114. package/lib/esm/qpqContext/useQpqContextValues.js +6 -0
  115. package/lib/esm/qpqContext/useQpqContextValues.js.map +1 -0
  116. package/lib/esm/runtime/ActionProcessorListResolverFactory.d.ts +3 -0
  117. package/lib/esm/runtime/ActionProcessorListResolverFactory.js +2 -0
  118. package/lib/esm/runtime/ActionProcessorListResolverFactory.js.map +1 -0
  119. package/lib/esm/runtime/BubbleReducerDispatchContext.d.ts +1 -0
  120. package/lib/esm/runtime/BubbleReducerDispatchContext.js +6 -0
  121. package/lib/esm/runtime/BubbleReducerDispatchContext.js.map +1 -0
  122. package/lib/esm/runtime/QpqBubbleReducer.d.ts +1 -0
  123. package/lib/esm/runtime/QpqBubbleReducer.js +2 -0
  124. package/lib/esm/runtime/QpqBubbleReducer.js.map +1 -0
  125. package/lib/esm/runtime/QpqMappedApi.js.map +1 -0
  126. package/lib/esm/runtime/QpqRuntimeEffectCatcher.d.ts +9 -0
  127. package/lib/esm/{hooks/asmj → runtime}/QpqRuntimeEffectCatcher.js +3 -3
  128. package/lib/esm/runtime/QpqRuntimeEffectCatcher.js.map +1 -0
  129. package/lib/esm/runtime/actionProcessor/getStateDispatchActionProcessor.js.map +1 -0
  130. package/lib/esm/runtime/actionProcessor/getStateReadActionProcessor.js.map +1 -0
  131. package/lib/esm/runtime/actionProcessor/index.js.map +1 -0
  132. package/lib/esm/runtime/createQpqRuntimeComputed.d.ts +7 -0
  133. package/lib/esm/runtime/createQpqRuntimeComputed.js +4 -0
  134. package/lib/esm/runtime/createQpqRuntimeComputed.js.map +1 -0
  135. package/lib/esm/runtime/createQpqRuntimeDefinition.d.ts +16 -0
  136. package/lib/esm/runtime/createQpqRuntimeDefinition.js +10 -0
  137. package/lib/esm/runtime/createQpqRuntimeDefinition.js.map +1 -0
  138. package/lib/esm/runtime/getQpqRuntimeAreaKey.d.ts +3 -0
  139. package/lib/esm/runtime/getQpqRuntimeAreaKey.js +2 -0
  140. package/lib/esm/runtime/getQpqRuntimeAreaKey.js.map +1 -0
  141. package/lib/esm/runtime/index.d.ts +12 -0
  142. package/lib/esm/runtime/index.js +13 -0
  143. package/lib/esm/runtime/index.js.map +1 -0
  144. package/lib/esm/{hooks/asmj → runtime}/useBubbleReducer.d.ts +1 -1
  145. package/lib/esm/{hooks/asmj → runtime}/useBubbleReducer.js +1 -1
  146. package/lib/esm/runtime/useBubbleReducer.js.map +1 -0
  147. package/lib/esm/runtime/useQpqAreaBinding.d.ts +11 -0
  148. package/lib/esm/runtime/useQpqAreaBinding.js +68 -0
  149. package/lib/esm/runtime/useQpqAreaBinding.js.map +1 -0
  150. package/lib/esm/runtime/useQpqRuntime.d.ts +4 -0
  151. package/lib/esm/runtime/useQpqRuntime.js +25 -0
  152. package/lib/esm/runtime/useQpqRuntime.js.map +1 -0
  153. package/lib/esm/runtime/useQpqRuntimeComputed.d.ts +2 -0
  154. package/lib/esm/runtime/useQpqRuntimeComputed.js +23 -0
  155. package/lib/esm/runtime/useQpqRuntimeComputed.js.map +1 -0
  156. package/lib/esm/store/QpqStoreProvider.d.ts +8 -0
  157. package/lib/esm/store/QpqStoreProvider.js +9 -0
  158. package/lib/esm/store/QpqStoreProvider.js.map +1 -0
  159. package/lib/esm/store/connectQpqStoreToReduxDevTools.d.ts +2 -0
  160. package/lib/esm/store/connectQpqStoreToReduxDevTools.js +137 -0
  161. package/lib/esm/store/connectQpqStoreToReduxDevTools.js.map +1 -0
  162. package/lib/esm/store/createQpqStore.d.ts +22 -0
  163. package/lib/esm/store/createQpqStore.js +156 -0
  164. package/lib/esm/store/createQpqStore.js.map +1 -0
  165. package/lib/esm/store/index.d.ts +5 -0
  166. package/lib/esm/store/index.js +6 -0
  167. package/lib/esm/store/index.js.map +1 -0
  168. package/lib/esm/store/qpqStoreContext.d.ts +3 -0
  169. package/lib/esm/store/qpqStoreContext.js +3 -0
  170. package/lib/esm/store/qpqStoreContext.js.map +1 -0
  171. package/lib/esm/store/useQpqStore.d.ts +2 -0
  172. package/lib/esm/store/useQpqStore.js +10 -0
  173. package/lib/esm/store/useQpqStore.js.map +1 -0
  174. package/lib/esm/useFieldBinding/useFieldBinding.d.ts +1 -1
  175. package/lib/esm/useFieldBinding/useFieldBinding.js +1 -1
  176. package/lib/esm/useFieldBinding/useFieldBinding.js.map +1 -1
  177. package/lib/esm/useSharedQueryParams/sharedQueryParamsRuntime.d.ts +1 -1
  178. package/lib/esm/useSharedQueryParams/sharedQueryParamsRuntime.js +7 -2
  179. package/lib/esm/useSharedQueryParams/sharedQueryParamsRuntime.js.map +1 -1
  180. package/lib/esm/webSocketQueue/hooks/useQpqWebsocketQueueRuntime.d.ts +4 -5
  181. package/lib/esm/webSocketQueue/hooks/useQpqWebsocketQueueRuntime.js +3 -3
  182. package/lib/esm/webSocketQueue/hooks/useQpqWebsocketQueueRuntime.js.map +1 -1
  183. package/lib/esm/webSocketQueue/hooks/useWebsocketQueueSendEvent.js +8 -1
  184. package/lib/esm/webSocketQueue/hooks/useWebsocketQueueSendEvent.js.map +1 -1
  185. package/package.json +8 -9
  186. package/lib/commonjs/hooks/asmj/QpqContextProvider.js +0 -26
  187. package/lib/commonjs/hooks/asmj/QpqContextProvider.js.map +0 -1
  188. package/lib/commonjs/hooks/asmj/QpqMappedApi.js.map +0 -1
  189. package/lib/commonjs/hooks/asmj/QpqRuntimeEffectCatcher.d.ts +0 -14
  190. package/lib/commonjs/hooks/asmj/QpqRuntimeEffectCatcher.js +0 -14
  191. package/lib/commonjs/hooks/asmj/QpqRuntimeEffectCatcher.js.map +0 -1
  192. package/lib/commonjs/hooks/asmj/actionProcessor/getStateDispatchActionProcessor.js.map +0 -1
  193. package/lib/commonjs/hooks/asmj/actionProcessor/getStateReadActionProcessor.js.map +0 -1
  194. package/lib/commonjs/hooks/asmj/actionProcessor/index.js.map +0 -1
  195. package/lib/commonjs/hooks/asmj/bubbleReducer.d.ts +0 -5
  196. package/lib/commonjs/hooks/asmj/bubbleReducer.js +0 -29
  197. package/lib/commonjs/hooks/asmj/bubbleReducer.js.map +0 -1
  198. package/lib/commonjs/hooks/asmj/createQpqRuntimeDefinition.d.ts +0 -22
  199. package/lib/commonjs/hooks/asmj/createQpqRuntimeDefinition.js +0 -53
  200. package/lib/commonjs/hooks/asmj/createQpqRuntimeDefinition.js.map +0 -1
  201. package/lib/commonjs/hooks/asmj/index.d.ts +0 -8
  202. package/lib/commonjs/hooks/asmj/index.js.map +0 -1
  203. package/lib/commonjs/hooks/asmj/useBubbleReducer.js.map +0 -1
  204. package/lib/commonjs/hooks/asmj/useQpqRuntime.d.ts +0 -6
  205. package/lib/commonjs/hooks/asmj/useQpqRuntime.js +0 -49
  206. package/lib/commonjs/hooks/asmj/useQpqRuntime.js.map +0 -1
  207. package/lib/esm/hooks/asmj/QpqContextProvider.js.map +0 -1
  208. package/lib/esm/hooks/asmj/QpqMappedApi.js.map +0 -1
  209. package/lib/esm/hooks/asmj/QpqRuntimeEffectCatcher.d.ts +0 -14
  210. package/lib/esm/hooks/asmj/QpqRuntimeEffectCatcher.js.map +0 -1
  211. package/lib/esm/hooks/asmj/actionProcessor/getStateDispatchActionProcessor.js.map +0 -1
  212. package/lib/esm/hooks/asmj/actionProcessor/getStateReadActionProcessor.js.map +0 -1
  213. package/lib/esm/hooks/asmj/actionProcessor/index.js.map +0 -1
  214. package/lib/esm/hooks/asmj/bubbleReducer.d.ts +0 -5
  215. package/lib/esm/hooks/asmj/bubbleReducer.js +0 -25
  216. package/lib/esm/hooks/asmj/bubbleReducer.js.map +0 -1
  217. package/lib/esm/hooks/asmj/createQpqRuntimeDefinition.d.ts +0 -22
  218. package/lib/esm/hooks/asmj/createQpqRuntimeDefinition.js +0 -47
  219. package/lib/esm/hooks/asmj/createQpqRuntimeDefinition.js.map +0 -1
  220. package/lib/esm/hooks/asmj/index.d.ts +0 -8
  221. package/lib/esm/hooks/asmj/index.js +0 -9
  222. package/lib/esm/hooks/asmj/index.js.map +0 -1
  223. package/lib/esm/hooks/asmj/useBubbleReducer.js.map +0 -1
  224. package/lib/esm/hooks/asmj/useQpqRuntime.d.ts +0 -6
  225. package/lib/esm/hooks/asmj/useQpqRuntime.js +0 -38
  226. package/lib/esm/hooks/asmj/useQpqRuntime.js.map +0 -1
  227. /package/lib/commonjs/{hooks/asmj → runtime}/QpqMappedApi.d.ts +0 -0
  228. /package/lib/commonjs/{hooks/asmj → runtime}/QpqMappedApi.js +0 -0
  229. /package/lib/commonjs/{hooks/asmj → runtime}/actionProcessor/getStateDispatchActionProcessor.d.ts +0 -0
  230. /package/lib/commonjs/{hooks/asmj → runtime}/actionProcessor/getStateDispatchActionProcessor.js +0 -0
  231. /package/lib/commonjs/{hooks/asmj → runtime}/actionProcessor/getStateReadActionProcessor.d.ts +0 -0
  232. /package/lib/commonjs/{hooks/asmj → runtime}/actionProcessor/getStateReadActionProcessor.js +0 -0
  233. /package/lib/commonjs/{hooks/asmj → runtime}/actionProcessor/index.d.ts +0 -0
  234. /package/lib/commonjs/{hooks/asmj → runtime}/actionProcessor/index.js +0 -0
  235. /package/lib/esm/{hooks/asmj → runtime}/QpqMappedApi.d.ts +0 -0
  236. /package/lib/esm/{hooks/asmj → runtime}/QpqMappedApi.js +0 -0
  237. /package/lib/esm/{hooks/asmj → runtime}/actionProcessor/getStateDispatchActionProcessor.d.ts +0 -0
  238. /package/lib/esm/{hooks/asmj → runtime}/actionProcessor/getStateDispatchActionProcessor.js +0 -0
  239. /package/lib/esm/{hooks/asmj → runtime}/actionProcessor/getStateReadActionProcessor.d.ts +0 -0
  240. /package/lib/esm/{hooks/asmj → runtime}/actionProcessor/getStateReadActionProcessor.js +0 -0
  241. /package/lib/esm/{hooks/asmj → runtime}/actionProcessor/index.d.ts +0 -0
  242. /package/lib/esm/{hooks/asmj → runtime}/actionProcessor/index.js +0 -0
@@ -0,0 +1,4 @@
1
+ import { ActionProcessorListResolverFactory } from './ActionProcessorListResolverFactory';
2
+ import { QpqRuntimeDefinition } from './createQpqRuntimeDefinition';
3
+ import { QpqApi, QpqMappedApi } from './QpqMappedApi';
4
+ export declare function useQpqRuntime<TState, TAction, TApi extends QpqApi>(definition: QpqRuntimeDefinition<TState, TAction, TApi>, instanceName?: string, getActionProcessors?: ActionProcessorListResolverFactory<TState>): [QpqMappedApi<TApi>, TState, (action: TAction) => void];
@@ -0,0 +1,28 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.useQpqRuntime = useQpqRuntime;
4
+ const react_1 = require("react");
5
+ const useQpqAreaBinding_1 = require("./useQpqAreaBinding");
6
+ function useQpqRuntime(definition, instanceName, getActionProcessors) {
7
+ const { subscribe, getCurrentState, dispatch, resolver } = (0, useQpqAreaBinding_1.useQpqAreaBinding)(definition, instanceName, getActionProcessors);
8
+ const state = (0, react_1.useSyncExternalStore)(subscribe, getCurrentState, getCurrentState);
9
+ // Api generators are memoized to prevent unnecessary re-renders.
10
+ const [memoedApiGenerators] = (0, react_1.useState)(() => definition.api);
11
+ // Wrap and remap each API generator using the resolver.
12
+ const api = (0, react_1.useMemo)(() => {
13
+ const wrapped = {};
14
+ for (const key in memoedApiGenerators) {
15
+ if (Object.prototype.hasOwnProperty.call(memoedApiGenerators, key)) {
16
+ // Remove the 'ask' prefix and lower-case the first character.
17
+ const withoutAsk = key.slice(3); // e.g., "FetchTodos"
18
+ const newKey = withoutAsk.charAt(0).toLowerCase() + withoutAsk.slice(1); // "fetchTodos"
19
+ // We know newKey matches our mapped type so we can assign.
20
+ // (A type assertion is used here to quiet the compiler.)
21
+ wrapped[newKey] = resolver(memoedApiGenerators[key]);
22
+ }
23
+ }
24
+ return wrapped;
25
+ }, [resolver, memoedApiGenerators]);
26
+ return [api, state, dispatch];
27
+ }
28
+ //# sourceMappingURL=useQpqRuntime.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useQpqRuntime.js","sourceRoot":"","sources":["../../../src/runtime/useQpqRuntime.ts"],"names":[],"mappings":";;AAOA,sCA6BC;AApCD,iCAAgE;AAKhE,2DAAwD;AAExD,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SyncExternalStore } from 'react';\n\nimport { ActionProcessorListResolverFactory } from './ActionProcessorListResolverFactory';\nimport { QpqRuntimeDefinition } from './createQpqRuntimeDefinition';\nimport { QpqApi, QpqMappedApi } from './QpqMappedApi';\nimport { useQpqAreaBinding } from './useQpqAreaBinding';\n\nexport function useQpqRuntime<TState, TAction, TApi extends QpqApi>(\n definition: QpqRuntimeDefinition<TState, TAction, TApi>,\n instanceName?: string,\n getActionProcessors?: ActionProcessorListResolverFactory<TState>,\n): [QpqMappedApi<TApi>, TState, (action: TAction) => void] {\n const { subscribe, getCurrentState, dispatch, resolver } = useQpqAreaBinding(definition, instanceName, getActionProcessors);\n\n const state = useSyncExternalStore(subscribe, getCurrentState, getCurrentState);\n\n // Api generators are memoized to prevent unnecessary re-renders.\n const [memoedApiGenerators] = useState(() => definition.api);\n\n // Wrap and remap each API generator using the resolver.\n const api = useMemo(() => {\n const wrapped: Record<string, any> = {};\n for (const key in memoedApiGenerators) {\n if (Object.prototype.hasOwnProperty.call(memoedApiGenerators, key)) {\n // Remove the 'ask' prefix and lower-case the first character.\n const withoutAsk = key.slice(3); // e.g., \"FetchTodos\"\n const newKey = withoutAsk.charAt(0).toLowerCase() + withoutAsk.slice(1); // \"fetchTodos\"\n // We know newKey matches our mapped type so we can assign.\n // (A type assertion is used here to quiet the compiler.)\n wrapped[newKey] = resolver(memoedApiGenerators[key as any]) as any;\n }\n }\n return wrapped;\n }, [resolver, memoedApiGenerators]);\n\n return [api as QpqMappedApi<TApi>, state, dispatch];\n}\n"]}
@@ -0,0 +1,2 @@
1
+ import { QpqRuntimeComputed } from './createQpqRuntimeComputed';
2
+ export declare function useQpqRuntimeComputed<TState, TSlice>(computed: QpqRuntimeComputed<TState, TSlice>, instanceName?: string): TSlice;
@@ -0,0 +1,26 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.useQpqRuntimeComputed = useQpqRuntimeComputed;
4
+ const react_1 = require("react");
5
+ const useEffectCallback_1 = require("../hooks/useEffectCallback");
6
+ const useQpqAreaBinding_1 = require("./useQpqAreaBinding");
7
+ function useQpqRuntimeComputed(computed, instanceName) {
8
+ const { subscribe, getCurrentState } = (0, useQpqAreaBinding_1.useQpqAreaBinding)(computed.definition, instanceName);
9
+ const sliceCache = (0, react_1.useRef)(null);
10
+ // The snapshot returns a referentially stable slice so the component only
11
+ // re-renders when its slice actually changes, not on every area update.
12
+ const computeStableSlice = () => {
13
+ const state = getCurrentState();
14
+ const cached = sliceCache.current;
15
+ if (cached && Object.is(cached.state, state)) {
16
+ return cached.slice;
17
+ }
18
+ const slice = computed.compute(state);
19
+ const stableSlice = cached && Object.is(cached.slice, slice) ? cached.slice : slice;
20
+ sliceCache.current = { state, slice: stableSlice };
21
+ return stableSlice;
22
+ };
23
+ const getSlice = (0, useEffectCallback_1.useEffectCallback)(computeStableSlice);
24
+ return (0, react_1.useSyncExternalStore)(subscribe, getSlice, getSlice);
25
+ }
26
+ //# sourceMappingURL=useQpqRuntimeComputed.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useQpqRuntimeComputed.js","sourceRoot":"","sources":["../../../src/runtime/useQpqRuntimeComputed.ts"],"names":[],"mappings":";;AAaA,sDAwBC;AAnCD,iCAAqD;AAErD,kEAA+D;AAE/D,2DAAwD;AAOxD,SAAgB,qBAAqB,CAAiB,QAA4C,EAAE,YAAqB;IACvH,MAAM,EAAE,SAAS,EAAE,eAAe,EAAE,GAAG,IAAA,qCAAiB,EAAC,QAAQ,CAAC,UAAU,EAAE,YAAY,CAAC,CAAC;IAE5F,MAAM,UAAU,GAAG,IAAA,cAAM,EAA4C,IAAI,CAAC,CAAC;IAE3E,0EAA0E;IAC1E,wEAAwE;IACxE,MAAM,kBAAkB,GAAG,GAAW,EAAE;QACtC,MAAM,KAAK,GAAG,eAAe,EAAE,CAAC;QAChC,MAAM,MAAM,GAAG,UAAU,CAAC,OAAO,CAAC;QAElC,IAAI,MAAM,IAAI,MAAM,CAAC,EAAE,CAAC,MAAM,CAAC,KAAK,EAAE,KAAK,CAAC,EAAE,CAAC;YAC7C,OAAO,MAAM,CAAC,KAAK,CAAC;QACtB,CAAC;QAED,MAAM,KAAK,GAAG,QAAQ,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;QACtC,MAAM,WAAW,GAAG,MAAM,IAAI,MAAM,CAAC,EAAE,CAAC,MAAM,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC;QAEpF,UAAU,CAAC,OAAO,GAAG,EAAE,KAAK,EAAE,KAAK,EAAE,WAAW,EAAE,CAAC;QACnD,OAAO,WAAW,CAAC;IACrB,CAAC,CAAC;IACF,MAAM,QAAQ,GAAG,IAAA,qCAAiB,EAAC,kBAAkB,CAAC,CAAC;IAEvD,OAAO,IAAA,4BAAoB,EAAC,SAAS,EAAE,QAAQ,EAAE,QAAQ,CAAC,CAAC;AAC7D,CAAC","sourcesContent":["import { Nullable } from 'quidproquo-core';\n\nimport { useRef, useSyncExternalStore } from 'react';\n\nimport { useEffectCallback } from '../hooks/useEffectCallback';\nimport { QpqRuntimeComputed } from './createQpqRuntimeComputed';\nimport { useQpqAreaBinding } from './useQpqAreaBinding';\n\ntype SliceCacheEntry<TState, TSlice> = {\n state: TState;\n slice: TSlice;\n};\n\nexport function useQpqRuntimeComputed<TState, TSlice>(computed: QpqRuntimeComputed<TState, TSlice>, instanceName?: string): TSlice {\n const { subscribe, getCurrentState } = useQpqAreaBinding(computed.definition, instanceName);\n\n const sliceCache = useRef<Nullable<SliceCacheEntry<TState, TSlice>>>(null);\n\n // The snapshot returns a referentially stable slice so the component only\n // re-renders when its slice actually changes, not on every area update.\n const computeStableSlice = (): TSlice => {\n const state = getCurrentState();\n const cached = sliceCache.current;\n\n if (cached && Object.is(cached.state, state)) {\n return cached.slice;\n }\n\n const slice = computed.compute(state);\n const stableSlice = cached && Object.is(cached.slice, slice) ? cached.slice : slice;\n\n sliceCache.current = { state, slice: stableSlice };\n return stableSlice;\n };\n const getSlice = useEffectCallback(computeStableSlice);\n\n return useSyncExternalStore(subscribe, getSlice, getSlice);\n}\n"]}
@@ -0,0 +1,8 @@
1
+ import { ReactNode } from 'react';
2
+ import { QpqStore } from './createQpqStore';
3
+ type QpqStoreProviderProps = {
4
+ store?: QpqStore;
5
+ children: ReactNode;
6
+ };
7
+ export declare const QpqStoreProvider: ({ store, children }: QpqStoreProviderProps) => import("react").JSX.Element;
8
+ export {};
@@ -0,0 +1,13 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.QpqStoreProvider = void 0;
4
+ const jsx_runtime_1 = require("react/jsx-runtime");
5
+ const react_1 = require("react");
6
+ const createQpqStore_1 = require("./createQpqStore");
7
+ const qpqStoreContext_1 = require("./qpqStoreContext");
8
+ const QpqStoreProvider = ({ store, children }) => {
9
+ const [ownStore] = (0, react_1.useState)(createQpqStore_1.createQpqStore);
10
+ return (0, jsx_runtime_1.jsx)(qpqStoreContext_1.qpqStoreContext.Provider, { value: store !== null && store !== void 0 ? store : ownStore, children: children });
11
+ };
12
+ exports.QpqStoreProvider = QpqStoreProvider;
13
+ //# sourceMappingURL=QpqStoreProvider.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"QpqStoreProvider.js","sourceRoot":"","sources":["../../../src/store/QpqStoreProvider.tsx"],"names":[],"mappings":";;;;AAAA,iCAA4C;AAE5C,qDAA4D;AAC5D,uDAAoD;AAS7C,MAAM,gBAAgB,GAAG,CAAC,EAAE,KAAK,EAAE,QAAQ,EAAyB,EAAE,EAAE;IAC7E,MAAM,CAAC,QAAQ,CAAC,GAAG,IAAA,gBAAQ,EAAC,+BAAc,CAAC,CAAC;IAE5C,OAAO,uBAAC,iCAAe,CAAC,QAAQ,IAAC,KAAK,EAAE,KAAK,aAAL,KAAK,cAAL,KAAK,GAAI,QAAQ,YAAG,QAAQ,GAA4B,CAAC;AACnG,CAAC,CAAC;AAJW,QAAA,gBAAgB,oBAI3B","sourcesContent":["import { ReactNode, useState } from 'react';\n\nimport { createQpqStore, QpqStore } from './createQpqStore';\nimport { qpqStoreContext } from './qpqStoreContext';\n\ntype QpqStoreProviderProps = {\n // Pass a store the app created itself when imperative (non-react) code also\n // needs to read it; omitted, the provider creates and owns one.\n store?: QpqStore;\n children: ReactNode;\n};\n\nexport const QpqStoreProvider = ({ store, children }: QpqStoreProviderProps) => {\n const [ownStore] = useState(createQpqStore);\n\n return <qpqStoreContext.Provider value={store ?? ownStore}>{children}</qpqStoreContext.Provider>;\n};\n"]}
@@ -0,0 +1,2 @@
1
+ import type { QpqStore } from './createQpqStore';
2
+ export declare const connectQpqStoreToReduxDevTools: (store: QpqStore, name?: string) => (() => void);
@@ -0,0 +1,144 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.connectQpqStoreToReduxDevTools = void 0;
4
+ // The buttons we can honour. Skip/reorder stay off: they need replaying the
5
+ // effect log through the binders' reducers, which live outside the store.
6
+ const DEVTOOLS_FEATURES = {
7
+ pause: false,
8
+ lock: true,
9
+ persist: false,
10
+ export: true,
11
+ import: false,
12
+ jump: true,
13
+ skip: false,
14
+ reorder: false,
15
+ dispatch: false,
16
+ test: false,
17
+ };
18
+ // Wires a qpq store to the Redux DevTools browser extension: the devtools
19
+ // state pane shows the ENTIRE app state (one key per bound area), every
20
+ // seed / set_state / release lands as a named action with diffs, and the
21
+ // jump/slider controls time travel the store.
22
+ //
23
+ // Time travel freezes the world automatically: any jump away from the newest
24
+ // action freezes the store (live writes dropped, releases deferred, onInit
25
+ // skipped, sends muted), and jumping back to the newest action thaws it.
26
+ // While frozen, restores can resurrect released areas at count 0, so
27
+ // components popping in render the historical state instead of fetching.
28
+ // The extension's lock button is a manual freeze with the same semantics,
29
+ // and COMMIT adopts whatever is on screen as the new present.
30
+ //
31
+ // A noop returning a noop when the extension is not installed, so call it
32
+ // unconditionally right after creating the store.
33
+ const connectQpqStoreToReduxDevTools = (store, name = 'qpq-store') => {
34
+ var _a;
35
+ const extension = globalThis.__REDUX_DEVTOOLS_EXTENSION__;
36
+ if (!extension) {
37
+ return () => { };
38
+ }
39
+ const connection = extension.connect({ name, features: DEVTOOLS_FEATURES });
40
+ // Mirrors the extension's action ids (@@INIT is 0, each send increments,
41
+ // init resets) so a jump back onto the newest action is recognisable as
42
+ // "back at head". If a jump arrives without an actionId the store stays
43
+ // frozen; lock-off or COMMIT are the manual ways out.
44
+ let latestActionId = 0;
45
+ let isJumpedAwayFromHead = false;
46
+ let isLockedByUser = false;
47
+ const syncFrozen = () => {
48
+ if (isJumpedAwayFromHead || isLockedByUser) {
49
+ store.freeze();
50
+ }
51
+ else {
52
+ store.thaw();
53
+ }
54
+ };
55
+ const restoreSnapshot = (snapshot) => {
56
+ for (const [areaKey, areaState] of Object.entries(snapshot)) {
57
+ store.restoreAreaState(areaKey, areaState);
58
+ }
59
+ };
60
+ const parseSerializedState = (serializedState) => {
61
+ try {
62
+ return JSON.parse(serializedState);
63
+ }
64
+ catch (_a) {
65
+ console.warn('qpq store devtools: could not parse time-travel state, ignoring jump');
66
+ return undefined;
67
+ }
68
+ };
69
+ // RESET returns to this baseline; COMMIT moves it to the present.
70
+ let committedSnapshot = store.getSnapshot();
71
+ connection.init(committedSnapshot);
72
+ const handleJump = (message) => {
73
+ var _a;
74
+ const snapshot = message.state ? parseSerializedState(message.state) : undefined;
75
+ if (!snapshot) {
76
+ return;
77
+ }
78
+ isJumpedAwayFromHead = ((_a = message.payload) === null || _a === void 0 ? void 0 : _a.actionId) !== latestActionId;
79
+ // Freeze before restoring so a jump into the past can resurrect released
80
+ // areas; on the jump back to head, restore first and thaw after so the
81
+ // sweep sees final bind counts.
82
+ if (isJumpedAwayFromHead) {
83
+ syncFrozen();
84
+ restoreSnapshot(snapshot);
85
+ }
86
+ else {
87
+ restoreSnapshot(snapshot);
88
+ syncFrozen();
89
+ }
90
+ };
91
+ const handleDevToolsMessage = (message) => {
92
+ var _a, _b;
93
+ if (message.type !== 'DISPATCH') {
94
+ return;
95
+ }
96
+ const payloadType = (_a = message.payload) === null || _a === void 0 ? void 0 : _a.type;
97
+ if (payloadType === 'JUMP_TO_ACTION' || payloadType === 'JUMP_TO_STATE') {
98
+ handleJump(message);
99
+ return;
100
+ }
101
+ if (payloadType === 'LOCK_CHANGES') {
102
+ isLockedByUser = ((_b = message.payload) === null || _b === void 0 ? void 0 : _b.status) === true;
103
+ syncFrozen();
104
+ return;
105
+ }
106
+ // Adopt whatever is on screen (possibly a jumped-to past) as the new
107
+ // present: thaw first so the sweep runs, then rebase the baseline.
108
+ if (payloadType === 'COMMIT') {
109
+ isJumpedAwayFromHead = false;
110
+ syncFrozen();
111
+ committedSnapshot = store.getSnapshot();
112
+ connection.init(committedSnapshot);
113
+ latestActionId = 0;
114
+ return;
115
+ }
116
+ if (payloadType === 'ROLLBACK' || payloadType === 'RESET') {
117
+ const snapshot = payloadType === 'ROLLBACK' && message.state ? parseSerializedState(message.state) : committedSnapshot;
118
+ if (!snapshot) {
119
+ return;
120
+ }
121
+ restoreSnapshot(snapshot);
122
+ isJumpedAwayFromHead = false;
123
+ syncFrozen();
124
+ connection.init(store.getSnapshot());
125
+ latestActionId = 0;
126
+ }
127
+ };
128
+ const unsubscribeDevTools = (_a = connection.subscribe) === null || _a === void 0 ? void 0 : _a.call(connection, handleDevToolsMessage);
129
+ const unsubscribeStore = store.subscribeToStore((event) => {
130
+ // Frozen means the world is on pause: seeds from pop-ins mid-scrub are
131
+ // history echoes, not new activity, and must not grow the action log.
132
+ if (store.isFrozen()) {
133
+ return;
134
+ }
135
+ latestActionId += 1;
136
+ connection.send({ type: `${event.type}: ${event.areaKey}` }, store.getSnapshot());
137
+ });
138
+ return () => {
139
+ unsubscribeStore();
140
+ unsubscribeDevTools === null || unsubscribeDevTools === void 0 ? void 0 : unsubscribeDevTools();
141
+ };
142
+ };
143
+ exports.connectQpqStoreToReduxDevTools = connectQpqStoreToReduxDevTools;
144
+ //# sourceMappingURL=connectQpqStoreToReduxDevTools.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"connectQpqStoreToReduxDevTools.js","sourceRoot":"","sources":["../../../src/store/connectQpqStoreToReduxDevTools.ts"],"names":[],"mappings":";;;AAoBA,4EAA4E;AAC5E,0EAA0E;AAC1E,MAAM,iBAAiB,GAA4B;IACjD,KAAK,EAAE,KAAK;IACZ,IAAI,EAAE,IAAI;IACV,OAAO,EAAE,KAAK;IACd,MAAM,EAAE,IAAI;IACZ,MAAM,EAAE,KAAK;IACb,IAAI,EAAE,IAAI;IACV,IAAI,EAAE,KAAK;IACX,OAAO,EAAE,KAAK;IACd,QAAQ,EAAE,KAAK;IACf,IAAI,EAAE,KAAK;CACZ,CAAC;AAEF,0EAA0E;AAC1E,wEAAwE;AACxE,yEAAyE;AACzE,8CAA8C;AAC9C,EAAE;AACF,6EAA6E;AAC7E,2EAA2E;AAC3E,yEAAyE;AACzE,qEAAqE;AACrE,yEAAyE;AACzE,0EAA0E;AAC1E,8DAA8D;AAC9D,EAAE;AACF,0EAA0E;AAC1E,kDAAkD;AAC3C,MAAM,8BAA8B,GAAG,CAAC,KAAe,EAAE,OAAe,WAAW,EAAgB,EAAE;;IAC1G,MAAM,SAAS,GAAI,UAAwE,CAAC,4BAA4B,CAAC;IAEzH,IAAI,CAAC,SAAS,EAAE,CAAC;QACf,OAAO,GAAG,EAAE,GAAE,CAAC,CAAC;IAClB,CAAC;IAED,MAAM,UAAU,GAAG,SAAS,CAAC,OAAO,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,iBAAiB,EAAE,CAAC,CAAC;IAE5E,yEAAyE;IACzE,wEAAwE;IACxE,wEAAwE;IACxE,sDAAsD;IACtD,IAAI,cAAc,GAAG,CAAC,CAAC;IACvB,IAAI,oBAAoB,GAAG,KAAK,CAAC;IACjC,IAAI,cAAc,GAAG,KAAK,CAAC;IAE3B,MAAM,UAAU,GAAG,GAAS,EAAE;QAC5B,IAAI,oBA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B,GAAG,KAAK,CAAC;YAC7B,UAAU,EAAE,CAAC;YACb,UAAU,CAAC,IAAI,CAAC,KAAK,CAAC,WAAW,EAAE,CAAC,CAAC;YACrC,cAAc,GAAG,CAAC,CAAC;QACrB,CAAC;IACH,CAAC,CAAC;IACF,MAAM,mBAAmB,GAAG,MAAA,UAAU,CAAC,SAAS,2DAAG,qBAAqB,CAAC,CAAC;IAE1E,MAAM,gBAAgB,GAAG,KAAK,CAAC,gBAAgB,CAAC,CAAC,KAAK,EAAE,EAAE;QACxD,uEAAuE;QACvE,sEAAsE;QACtE,IAAI,KAAK,CAAC,QAAQ,EAAE,EAAE,CAAC;YACrB,OAAO;QACT,CAAC;QAED,cAAc,IAAI,CAAC,CAAC;QACpB,UAAU,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,GAAG,KAAK,CAAC,IAAI,KAAK,KAAK,CAAC,OAAO,EAAE,EAAE,EAAE,KAAK,CAAC,WAAW,EAAE,CAAC,CAAC;IACpF,CAAC,CAAC,CAAC;IAEH,OAAO,GAAG,EAAE;QACV,gBAAgB,EAAE,CAAC;QACnB,mBAAmB,aAAnB,mBAAmB,uBAAnB,mBAAmB,EAAI,CAAC;IAC1B,CAAC,CAAC;AACJ,CAAC,CAAC;AA3HW,QAAA,8BAA8B,kCA2HzC","sourcesContent":["// Type-only: createQpqStore imports this module at runtime (to honour\n// devToolsName), so the back-edge must stay erasable.\nimport type { QpqStore } from './createQpqStore';\n\ntype ReduxDevToolsMessage = {\n type: string;\n payload?: { type?: string; actionId?: number; status?: boolean };\n state?: string;\n};\n\ntype ReduxDevToolsConnection = {\n init(state: unknown): void;\n send(action: { type: string }, state: unknown): void;\n subscribe?(listener: (message: ReduxDevToolsMessage) => void): (() => void) | undefined;\n};\n\ntype ReduxDevToolsExtension = {\n connect(options: { name: string; features?: Record<string, boolean> }): ReduxDevToolsConnection;\n};\n\n// The buttons we can honour. Skip/reorder stay off: they need replaying the\n// effect log through the binders' reducers, which live outside the store.\nconst DEVTOOLS_FEATURES: Record<string, boolean> = {\n pause: false,\n lock: true,\n persist: false,\n export: true,\n import: false,\n jump: true,\n skip: false,\n reorder: false,\n dispatch: false,\n test: false,\n};\n\n// Wires a qpq store to the Redux DevTools browser extension: the devtools\n// state pane shows the ENTIRE app state (one key per bound area), every\n// seed / set_state / release lands as a named action with diffs, and the\n// jump/slider controls time travel the store.\n//\n// Time travel freezes the world automatically: any jump away from the newest\n// action freezes the store (live writes dropped, releases deferred, onInit\n// skipped, sends muted), and jumping back to the newest action thaws it.\n// While frozen, restores can resurrect released areas at count 0, so\n// components popping in render the historical state instead of fetching.\n// The extension's lock button is a manual freeze with the same semantics,\n// and COMMIT adopts whatever is on screen as the new present.\n//\n// A noop returning a noop when the extension is not installed, so call it\n// unconditionally right after creating the store.\nexport const connectQpqStoreToReduxDevTools = (store: QpqStore, name: string = 'qpq-store'): (() => void) => {\n const extension = (globalThis as { __REDUX_DEVTOOLS_EXTENSION__?: ReduxDevToolsExtension }).__REDUX_DEVTOOLS_EXTENSION__;\n\n if (!extension) {\n return () => {};\n }\n\n const connection = extension.connect({ name, features: DEVTOOLS_FEATURES });\n\n // Mirrors the extension's action ids (@@INIT is 0, each send increments,\n // init resets) so a jump back onto the newest action is recognisable as\n // \"back at head\". If a jump arrives without an actionId the store stays\n // frozen; lock-off or COMMIT are the manual ways out.\n let latestActionId = 0;\n let isJumpedAwayFromHead = false;\n let isLockedByUser = false;\n\n const syncFrozen = (): void => {\n if (isJumpedAwayFromHead || isLockedByUser) {\n store.freeze();\n } else {\n store.thaw();\n }\n };\n\n const restoreSnapshot = (snapshot: Record<string, unknown>): void => {\n for (const [areaKey, areaState] of Object.entries(snapshot)) {\n store.restoreAreaState(areaKey, areaState);\n }\n };\n\n const parseSerializedState = (serializedState: string): Record<string, unknown> | undefined => {\n try {\n return JSON.parse(serializedState) as Record<string, unknown>;\n } catch {\n console.warn('qpq store devtools: could not parse time-travel state, ignoring jump');\n return undefined;\n }\n };\n\n // RESET returns to this baseline; COMMIT moves it to the present.\n let committedSnapshot = store.getSnapshot();\n connection.init(committedSnapshot);\n\n const handleJump = (message: ReduxDevToolsMessage): void => {\n const snapshot = message.state ? parseSerializedState(message.state) : undefined;\n if (!snapshot) {\n return;\n }\n\n isJumpedAwayFromHead = message.payload?.actionId !== latestActionId;\n\n // Freeze before restoring so a jump into the past can resurrect released\n // areas; on the jump back to head, restore first and thaw after so the\n // sweep sees final bind counts.\n if (isJumpedAwayFromHead) {\n syncFrozen();\n restoreSnapshot(snapshot);\n } else {\n restoreSnapshot(snapshot);\n syncFrozen();\n }\n };\n\n const handleDevToolsMessage = (message: ReduxDevToolsMessage): void => {\n if (message.type !== 'DISPATCH') {\n return;\n }\n\n const payloadType = message.payload?.type;\n\n if (payloadType === 'JUMP_TO_ACTION' || payloadType === 'JUMP_TO_STATE') {\n handleJump(message);\n return;\n }\n\n if (payloadType === 'LOCK_CHANGES') {\n isLockedByUser = message.payload?.status === true;\n syncFrozen();\n return;\n }\n\n // Adopt whatever is on screen (possibly a jumped-to past) as the new\n // present: thaw first so the sweep runs, then rebase the baseline.\n if (payloadType === 'COMMIT') {\n isJumpedAwayFromHead = false;\n syncFrozen();\n committedSnapshot = store.getSnapshot();\n connection.init(committedSnapshot);\n latestActionId = 0;\n return;\n }\n\n if (payloadType === 'ROLLBACK' || payloadType === 'RESET') {\n const snapshot = payloadType === 'ROLLBACK' && message.state ? parseSerializedState(message.state) : committedSnapshot;\n if (!snapshot) {\n return;\n }\n\n restoreSnapshot(snapshot);\n isJumpedAwayFromHead = false;\n syncFrozen();\n connection.init(store.getSnapshot());\n latestActionId = 0;\n }\n };\n const unsubscribeDevTools = connection.subscribe?.(handleDevToolsMessage);\n\n const unsubscribeStore = store.subscribeToStore((event) => {\n // Frozen means the world is on pause: seeds from pop-ins mid-scrub are\n // history echoes, not new activity, and must not grow the action log.\n if (store.isFrozen()) {\n return;\n }\n\n latestActionId += 1;\n connection.send({ type: `${event.type}: ${event.areaKey}` }, store.getSnapshot());\n });\n\n return () => {\n unsubscribeStore();\n unsubscribeDevTools?.();\n };\n};\n"]}
@@ -0,0 +1,22 @@
1
+ export type QpqStoreEvent = {
2
+ type: 'seed' | 'set_state' | 'release';
3
+ areaKey: string;
4
+ };
5
+ export type QpqStoreOptions = {
6
+ devToolsName?: string;
7
+ };
8
+ export type QpqStore = {
9
+ hasArea(areaKey: string): boolean;
10
+ getAreaState(areaKey: string): unknown;
11
+ setAreaState(areaKey: string, state: unknown): void;
12
+ restoreAreaState(areaKey: string, state: unknown): void;
13
+ bindArea(areaKey: string, initialState: unknown): boolean;
14
+ unbindArea(areaKey: string): void;
15
+ subscribe(areaKey: string, listener: () => void): () => void;
16
+ subscribeToStore(listener: (event: QpqStoreEvent) => void): () => void;
17
+ getSnapshot(): Record<string, unknown>;
18
+ freeze(): void;
19
+ thaw(): void;
20
+ isFrozen(): boolean;
21
+ };
22
+ export declare function createQpqStore(options?: QpqStoreOptions): QpqStore;
@@ -0,0 +1,160 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.createQpqStore = createQpqStore;
4
+ const connectQpqStoreToReduxDevTools_1 = require("./connectQpqStoreToReduxDevTools");
5
+ // process.env is only defined when a bundler injects it, so reach through
6
+ // globalThis rather than referencing process directly.
7
+ const isDevEnvironment = () => {
8
+ var _a, _b;
9
+ const nodeEnv = (_b = (_a = globalThis.process) === null || _a === void 0 ? void 0 : _a.env) === null || _b === void 0 ? void 0 : _b.NODE_ENV;
10
+ return nodeEnv !== 'production';
11
+ };
12
+ function createQpqStore(options) {
13
+ const areas = new Map();
14
+ // Listener lifetime is independent of area lifetime: React subscribes and
15
+ // binds in separate effects, and an area can be deleted and re-seeded while
16
+ // a subscriber from the same commit is still attached.
17
+ const listenersByArea = new Map();
18
+ // Store-wide observers (devtools, logging) hear every mutation with what
19
+ // happened; per-area subscribers just hear that their area changed.
20
+ const storeListeners = new Set();
21
+ let frozen = false;
22
+ const notifyArea = (areaKey) => {
23
+ const listeners = listenersByArea.get(areaKey);
24
+ if (!listeners) {
25
+ return;
26
+ }
27
+ for (const listener of [...listeners]) {
28
+ listener();
29
+ }
30
+ };
31
+ const notifyStore = (event) => {
32
+ for (const listener of [...storeListeners]) {
33
+ listener(event);
34
+ }
35
+ };
36
+ const store = {
37
+ hasArea: (areaKey) => areas.has(areaKey),
38
+ getAreaState: (areaKey) => { var _a; return (_a = areas.get(areaKey)) === null || _a === void 0 ? void 0 : _a.state; },
39
+ setAreaState: (areaKey, state) => {
40
+ // Frozen: the app is displaying a devtools-restored moment; live writes
41
+ // (in-flight stories, late fetches, websocket pushes) lose, silently,
42
+ // so they cannot repaint the past.
43
+ if (frozen) {
44
+ return;
45
+ }
46
+ const area = areas.get(areaKey);
47
+ // Smart pointer semantics: unbound state does not exist, late writers
48
+ // (in-flight stories, websocket pushes) lose.
49
+ if (!area) {
50
+ if (isDevEnvironment()) {
51
+ console.warn(`qpq store: dropped set_state for unbound area "${areaKey}"`);
52
+ }
53
+ return;
54
+ }
55
+ area.state = state;
56
+ notifyArea(areaKey);
57
+ notifyStore({ type: 'set_state', areaKey });
58
+ },
59
+ restoreAreaState: (areaKey, state) => {
60
+ const area = areas.get(areaKey);
61
+ if (area) {
62
+ area.state = state;
63
+ notifyArea(areaKey);
64
+ return;
65
+ }
66
+ // While frozen a restore may resurrect an area that was released before
67
+ // the freeze: it sits at count 0 so a component popping in binds it
68
+ // (count 0 -> 1, NOT a first bind) and renders the historical state
69
+ // instead of fetching. Thaw sweeps whatever is still unbound.
70
+ if (frozen) {
71
+ areas.set(areaKey, { count: 0, state });
72
+ notifyArea(areaKey);
73
+ }
74
+ },
75
+ bindArea: (areaKey, initialState) => {
76
+ const area = areas.get(areaKey);
77
+ if (area) {
78
+ area.count += 1;
79
+ return false;
80
+ }
81
+ areas.set(areaKey, { count: 1, state: initialState });
82
+ // An unmount can delete the area in the same commit a mount re-seeds
83
+ // it; subscribers must re-read or they keep rendering the deleted state.
84
+ notifyArea(areaKey);
85
+ notifyStore({ type: 'seed', areaKey });
86
+ return true;
87
+ },
88
+ unbindArea: (areaKey) => {
89
+ const area = areas.get(areaKey);
90
+ if (!area) {
91
+ return;
92
+ }
93
+ area.count -= 1;
94
+ if (area.count > 0) {
95
+ return;
96
+ }
97
+ // Frozen: defer the delete (entry stays at count 0) so scrubbing
98
+ // forward can rebind without losing state; thaw does the sweep.
99
+ if (frozen) {
100
+ return;
101
+ }
102
+ areas.delete(areaKey);
103
+ notifyStore({ type: 'release', areaKey });
104
+ },
105
+ subscribe: (areaKey, listener) => {
106
+ let listeners = listenersByArea.get(areaKey);
107
+ if (!listeners) {
108
+ listeners = new Set();
109
+ listenersByArea.set(areaKey, listeners);
110
+ }
111
+ listeners.add(listener);
112
+ const capturedListeners = listeners;
113
+ return () => {
114
+ capturedListeners.delete(listener);
115
+ // Only drop the map entry if it still holds this set; another
116
+ // subscriber may have recreated it after we emptied out.
117
+ if (capturedListeners.size === 0 && listenersByArea.get(areaKey) === capturedListeners) {
118
+ listenersByArea.delete(areaKey);
119
+ }
120
+ };
121
+ },
122
+ subscribeToStore: (listener) => {
123
+ storeListeners.add(listener);
124
+ return () => {
125
+ storeListeners.delete(listener);
126
+ };
127
+ },
128
+ // The entire live app state as one plain object, one key per bound area.
129
+ getSnapshot: () => {
130
+ const snapshot = {};
131
+ for (const [areaKey, area] of areas) {
132
+ snapshot[areaKey] = area.state;
133
+ }
134
+ return snapshot;
135
+ },
136
+ freeze: () => {
137
+ frozen = true;
138
+ },
139
+ thaw: () => {
140
+ if (!frozen) {
141
+ return;
142
+ }
143
+ frozen = false;
144
+ // Sweep the deferred releases and time-travel resurrections nothing is
145
+ // bound to any more.
146
+ for (const [areaKey, area] of [...areas]) {
147
+ if (area.count <= 0) {
148
+ areas.delete(areaKey);
149
+ notifyStore({ type: 'release', areaKey });
150
+ }
151
+ }
152
+ },
153
+ isFrozen: () => frozen,
154
+ };
155
+ if (options === null || options === void 0 ? void 0 : options.devToolsName) {
156
+ (0, connectQpqStoreToReduxDevTools_1.connectQpqStoreToReduxDevTools)(store, options.devToolsName);
157
+ }
158
+ return store;
159
+ }
160
+ //# sourceMappingURL=createQpqStore.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"createQpqStore.js","sourceRoot":"","sources":["../../../src/store/createQpqStore.ts"],"names":[],"mappings":";;AA6CA,wCAsLC;AAnOD,qFAAkF;AAsClF,0EAA0E;AAC1E,uDAAuD;AACvD,MAAM,gBAAgB,GAAG,GAAY,EAAE;;IACrC,MAAM,OAAO,GAAG,MAAA,MAAC,UAA4D,CAAC,OAAO,0CAAE,GAAG,0CAAE,QAAQ,CAAC;IACrG,OAAO,OAAO,KAAK,YAAY,CAAC;AAClC,CAAC,CAAC;AAEF,SAAgB,cAAc,CAAC,OAAyB;IACtD,MAAM,KAAK,GAAG,IAAI,GAAG,EAA6B,CAAC;IAEnD,0EAA0E;IAC1E,4EAA4E;IAC5E,uDAAuD;IACvD,MAAM,eAAe,GAAG,IAAI,GAAG,EAA2B,CAAC;IAE3D,yEAAyE;IACzE,oEAAoE;IACpE,MAAM,cAAc,GAAG,IAAI,GAAG,EAAkC,CAAC;IAEjE,IAAI,MAAM,GAAG,KAAK,CAAC;IAEnB,MAAM,UAAU,GAAG,CAAC,OAAe,EAAQ,EAAE;QAC3C,MAAM,SAAS,GAAG,eAAe,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;QAC/C,IAAI,CAAC,SAAS,EAAE,CAAC;YACf,OAAO;QACT,CAAC;QAED,KAAK,MAAM,QAAQ,IAAI,CAAC,GAAG,SAAS,CAAC,EAAE,CAAC;YACtC,QAAQ,EAAE,CAAC;QACb,CAAC;IACH,CAAC,CAAC;IAEF,MAAM,WAAW,GAAG,CAAC,KAAoB,EAAQ,EAAE;QACjD,KAAK,MAAM,QAAQ,IAAI,CAAC,GAAG,cAAc,CAAC,EAAE,CAAC;YAC3C,QAAQ,CAAC,KAAK,CAAC,CAAC;QAClB,CAAC;IACH,CAAC,CAAC;IA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KAAK,MAAM,CAAC,OAAO,EAAE,IAAI,CAAC,IAAI,CAAC,GAAG,KAAK,CAAC,EAAE,CAAC;gBACzC,IAAI,IAAI,CAAC,KAAK,IAAI,CAAC,EAAE,CAAC;oBACpB,KAAK,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;oBACtB,WAAW,CAAC,EAAE,IAAI,EAAE,SAAS,EAAE,OAAO,EAAE,CAAC,CAAC;gBAC5C,CAAC;YACH,CAAC;QACH,CAAC;QAED,QAAQ,EAAE,GAAY,EAAE,CAAC,MAAM;KAChC,CAAC;IAEF,IAAI,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,YAAY,EAAE,CAAC;QAC1B,IAAA,+DAA8B,EAAC,KAAK,EAAE,OAAO,CAAC,YAAY,CAAC,CAAC;IAC9D,CAAC;IAED,OAAO,KAAK,CAAC;AACf,CAAC","sourcesContent":["import { connectQpqStoreToReduxDevTools } from './connectQpqStoreToReduxDevTools';\n\nexport type QpqStoreEvent = {\n type: 'seed' | 'set_state' | 'release';\n areaKey: string;\n};\n\nexport type QpqStoreOptions = {\n // Connect to the Redux DevTools browser extension under this instance name.\n // Opt-in so anonymous stores (tests, provider-owned) stay unconnected.\n devToolsName?: string;\n};\n\nexport type QpqStore = {\n hasArea(areaKey: string): boolean;\n getAreaState(areaKey: string): unknown;\n setAreaState(areaKey: string, state: unknown): void;\n // Time-travel/hydration escape hatch: writes even while frozen, emits no\n // store event, and while frozen may resurrect an unbound area at count 0.\n restoreAreaState(areaKey: string, state: unknown): void;\n bindArea(areaKey: string, initialState: unknown): boolean;\n unbindArea(areaKey: string): void;\n subscribe(areaKey: string, listener: () => void): () => void;\n subscribeToStore(listener: (event: QpqStoreEvent) => void): () => void;\n getSnapshot(): Record<string, unknown>;\n // Frozen = the world is on pause (devtools time travel): live writes are\n // dropped, releases are deferred, and binders skip onInit. Thaw resumes\n // normal behaviour and sweeps areas nothing is bound to any more.\n freeze(): void;\n thaw(): void;\n isFrozen(): boolean;\n};\n\ntype QpqStoreAreaEntry = {\n count: number;\n state: unknown;\n};\n\n// process.env is only defined when a bundler injects it, so reach through\n// globalThis rather than referencing process directly.\nconst isDevEnvironment = (): boolean => {\n const nodeEnv = (globalThis as { process?: { env?: { NODE_ENV?: string } } }).process?.env?.NODE_ENV;\n return nodeEnv !== 'production';\n};\n\nexport function createQpqStore(options?: QpqStoreOptions): QpqStore {\n const areas = new Map<string, QpqStoreAreaEntry>();\n\n // Listener lifetime is independent of area lifetime: React subscribes and\n // binds in separate effects, and an area can be deleted and re-seeded while\n // a subscriber from the same commit is still attached.\n const listenersByArea = new Map<string, Set<() => void>>();\n\n // Store-wide observers (devtools, logging) hear every mutation with what\n // happened; per-area subscribers just hear that their area changed.\n const storeListeners = new Set<(event: QpqStoreEvent) => void>();\n\n let frozen = false;\n\n const notifyArea = (areaKey: string): void => {\n const listeners = listenersByArea.get(areaKey);\n if (!listeners) {\n return;\n }\n\n for (const listener of [...listeners]) {\n listener();\n }\n };\n\n const notifyStore = (event: QpqStoreEvent): void => {\n for (const listener of [...storeListeners]) {\n listener(event);\n }\n };\n\n const store: QpqStore = {\n hasArea: (areaKey: string): boolean => areas.has(areaKey),\n\n getAreaState: (areaKey: string): unknown => areas.get(areaKey)?.state,\n\n setAreaState: (areaKey: string, state: unknown): void => {\n // Frozen: the app is displaying a devtools-restored moment; live writes\n // (in-flight stories, late fetches, websocket pushes) lose, silently,\n // so they cannot repaint the past.\n if (frozen) {\n return;\n }\n\n const area = areas.get(areaKey);\n\n // Smart pointer semantics: unbound state does not exist, late writers\n // (in-flight stories, websocket pushes) lose.\n if (!area) {\n if (isDevEnvironment()) {\n console.warn(`qpq store: dropped set_state for unbound area \"${areaKey}\"`);\n }\n return;\n }\n\n area.state = state;\n notifyArea(areaKey);\n notifyStore({ type: 'set_state', areaKey });\n },\n\n restoreAreaState: (areaKey: string, state: unknown): void => {\n const area = areas.get(areaKey);\n if (area) {\n area.state = state;\n notifyArea(areaKey);\n return;\n }\n\n // While frozen a restore may resurrect an area that was released before\n // the freeze: it sits at count 0 so a component popping in binds it\n // (count 0 -> 1, NOT a first bind) and renders the historical state\n // instead of fetching. Thaw sweeps whatever is still unbound.\n if (frozen) {\n areas.set(areaKey, { count: 0, state });\n notifyArea(areaKey);\n }\n },\n\n bindArea: (areaKey: string, initialState: unknown): boolean => {\n const area = areas.get(areaKey);\n if (area) {\n area.count += 1;\n return false;\n }\n\n areas.set(areaKey, { count: 1, state: initialState });\n\n // An unmount can delete the area in the same commit a mount re-seeds\n // it; subscribers must re-read or they keep rendering the deleted state.\n notifyArea(areaKey);\n notifyStore({ type: 'seed', areaKey });\n\n return true;\n },\n\n unbindArea: (areaKey: string): void => {\n const area = areas.get(areaKey);\n if (!area) {\n return;\n }\n\n area.count -= 1;\n if (area.count > 0) {\n return;\n }\n\n // Frozen: defer the delete (entry stays at count 0) so scrubbing\n // forward can rebind without losing state; thaw does the sweep.\n if (frozen) {\n return;\n }\n\n areas.delete(areaKey);\n notifyStore({ type: 'release', areaKey });\n },\n\n subscribe: (areaKey: string, listener: () => void): (() => void) => {\n let listeners = listenersByArea.get(areaKey);\n if (!listeners) {\n listeners = new Set();\n listenersByArea.set(areaKey, listeners);\n }\n\n listeners.add(listener);\n\n const capturedListeners = listeners;\n return () => {\n capturedListeners.delete(listener);\n\n // Only drop the map entry if it still holds this set; another\n // subscriber may have recreated it after we emptied out.\n if (capturedListeners.size === 0 && listenersByArea.get(areaKey) === capturedListeners) {\n listenersByArea.delete(areaKey);\n }\n };\n },\n\n subscribeToStore: (listener: (event: QpqStoreEvent) => void): (() => void) => {\n storeListeners.add(listener);\n return () => {\n storeListeners.delete(listener);\n };\n },\n\n // The entire live app state as one plain object, one key per bound area.\n getSnapshot: (): Record<string, unknown> => {\n const snapshot: Record<string, unknown> = {};\n for (const [areaKey, area] of areas) {\n snapshot[areaKey] = area.state;\n }\n return snapshot;\n },\n\n freeze: (): void => {\n frozen = true;\n },\n\n thaw: (): void => {\n if (!frozen) {\n return;\n }\n\n frozen = false;\n\n // Sweep the deferred releases and time-travel resurrections nothing is\n // bound to any more.\n for (const [areaKey, area] of [...areas]) {\n if (area.count <= 0) {\n areas.delete(areaKey);\n notifyStore({ type: 'release', areaKey });\n }\n }\n },\n\n isFrozen: (): boolean => frozen,\n };\n\n if (options?.devToolsName) {\n connectQpqStoreToReduxDevTools(store, options.devToolsName);\n }\n\n return store;\n}\n"]}
@@ -0,0 +1,5 @@
1
+ export * from './connectQpqStoreToReduxDevTools';
2
+ export * from './createQpqStore';
3
+ export * from './qpqStoreContext';
4
+ export * from './QpqStoreProvider';
5
+ export * from './useQpqStore';
@@ -0,0 +1,22 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./connectQpqStoreToReduxDevTools"), exports);
18
+ __exportStar(require("./createQpqStore"), exports);
19
+ __exportStar(require("./qpqStoreContext"), exports);
20
+ __exportStar(require("./QpqStoreProvider"), exports);
21
+ __exportStar(require("./useQpqStore"), exports);
22
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/store/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,mEAAiD;AACjD,mDAAiC;AACjC,oDAAkC;AAClC,qDAAmC;AACnC,gDAA8B","sourcesContent":["export * from './connectQpqStoreToReduxDevTools';\nexport * from './createQpqStore';\nexport * from './qpqStoreContext';\nexport * from './QpqStoreProvider';\nexport * from './useQpqStore';\n"]}
@@ -0,0 +1,3 @@
1
+ import { Nullable } from 'quidproquo-core';
2
+ import { QpqStore } from './createQpqStore';
3
+ export declare const qpqStoreContext: import("react").Context<Nullable<QpqStore>>;
@@ -0,0 +1,6 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.qpqStoreContext = void 0;
4
+ const react_1 = require("react");
5
+ exports.qpqStoreContext = (0, react_1.createContext)(null);
6
+ //# sourceMappingURL=qpqStoreContext.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"qpqStoreContext.js","sourceRoot":"","sources":["../../../src/store/qpqStoreContext.ts"],"names":[],"mappings":";;;AAEA,iCAAsC;AAIzB,QAAA,eAAe,GAAG,IAAA,qBAAa,EAAqB,IAAI,CAAC,CAAC","sourcesContent":["import { Nullable } from 'quidproquo-core';\n\nimport { createContext } from 'react';\n\nimport { QpqStore } from './createQpqStore';\n\nexport const qpqStoreContext = createContext<Nullable<QpqStore>>(null);\n"]}
@@ -0,0 +1,2 @@
1
+ import { QpqStore } from './createQpqStore';
2
+ export declare const useQpqStore: () => QpqStore;
@@ -0,0 +1,14 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.useQpqStore = void 0;
4
+ const react_1 = require("react");
5
+ const qpqStoreContext_1 = require("./qpqStoreContext");
6
+ const useQpqStore = () => {
7
+ const store = (0, react_1.useContext)(qpqStoreContext_1.qpqStoreContext);
8
+ if (!store) {
9
+ throw new Error('useQpqStore must be used inside a QpqStoreProvider');
10
+ }
11
+ return store;
12
+ };
13
+ exports.useQpqStore = useQpqStore;
14
+ //# sourceMappingURL=useQpqStore.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useQpqStore.js","sourceRoot":"","sources":["../../../src/store/useQpqStore.ts"],"names":[],"mappings":";;;AAAA,iCAAmC;AAGnC,uDAAoD;AAE7C,MAAM,WAAW,GAAG,GAAa,EAAE;IACxC,MAAM,KAAK,GAAG,IAAA,kBAAU,EAAC,iCAAe,CAAC,CAAC;IAE1C,IAAI,CAAC,KAAK,EAAE,CAAC;QACX,MAAM,IAAI,KAAK,CAAC,oDAAoD,CAAC,CAAC;IACxE,CAAC;IAED,OAAO,KAAK,CAAC;AACf,CAAC,CAAC;AARW,QAAA,WAAW,eAQtB","sourcesContent":["import { useContext } from 'react';\n\nimport { QpqStore } from './createQpqStore';\nimport { qpqStoreContext } from './qpqStoreContext';\n\nexport const useQpqStore = (): QpqStore => {\n const store = useContext(qpqStoreContext);\n\n if (!store) {\n throw new Error('useQpqStore must be used inside a QpqStoreProvider');\n }\n\n return store;\n};\n"]}
@@ -1,2 +1,2 @@
1
- import { QpqRuntimeComputed } from '../hooks/asmj/createQpqRuntimeDefinition';
1
+ import { QpqRuntimeComputed } from '../runtime/createQpqRuntimeComputed';
2
2
  export declare const useFieldBinding: <TState, V, E = any>(computedAtom: QpqRuntimeComputed<TState, V>, someSetter: (value: V) => Promise<void> | void, valueExtractor?: (event: E, ...args: any[]) => V) => [V, (event: E, ...args: any[]) => void];
@@ -2,9 +2,9 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.useFieldBinding = void 0;
4
4
  const react_1 = require("react");
5
- const createQpqRuntimeDefinition_1 = require("../hooks/asmj/createQpqRuntimeDefinition");
5
+ const useQpqRuntimeComputed_1 = require("../runtime/useQpqRuntimeComputed");
6
6
  const useFieldBinding = (computedAtom, someSetter, valueExtractor) => {
7
- const computedValue = (0, createQpqRuntimeDefinition_1.useQpqRuntimeComputed)(computedAtom);
7
+ const computedValue = (0, useQpqRuntimeComputed_1.useQpqRuntimeComputed)(computedAtom);
8
8
  const [value, setValue] = (0, react_1.useState)(computedValue);
9
9
  const handleChange = (event, ...args) => {
10
10
  const newValue = valueExtractor ? valueExtractor(event, ...args) : event.target.value;
@@ -1 +1 @@
1
- {"version":3,"file":"useFieldBinding.js","sourceRoot":"","sources":["../../../src/useFieldBinding/useFieldBinding.ts"],"names":[],"mappings":";;;AAAA,iCAA4C;AAE5C,yFAAqG;AAE9F,MAAM,eAAe,GAAG,CAC7B,YAA2C,EAC3C,UAA8C,EAC9C,cAAgD,EACP,EAAE;IAC3C,MAAM,aAAa,GAAG,IAAA,kDAAqB,EAAC,YAAY,CAAC,CAAC;IAE1D,MAAM,CAAC,KAAK,EAAE,QAAQ,CAAC,GAAG,IAAA,gBAAQ,EAAI,aAAa,CAAC,CAAC;IAErD,MAAM,YAAY,GAAG,CAAC,KAAQ,EAAE,GAAG,IAAW,EAAE,EAAE;QAChD,MAAM,QAAQ,GAAM,cAAc,CAAC,CAAC,CAAC,cAAc,CAAC,KAAK,EAAE,GAAG,IAAI,CAAC,CAAC,CAAC,CAAE,KAAa,CAAC,MAAM,CAAC,KAAK,CAAC;QAClG,QAAQ,CAAC,QAAQ,CAAC,CAAC;QACnB,UAAU,CAAC,QAAQ,CAAC,CAAC;IACvB,CAAC,CAAC;IAEF,IAAA,iBAAS,EAAC,GAAG,EAAE;QACb,uEAAuE;QACvE,0EAA0E;QAC1E,QAAQ,CAAC,aAAa,CAAC,CAAC;IAC1B,CAAC,EAAE,CAAC,aAAa,CAAC,CAAC,CAAC;IAEpB,OAAO,CAAC,KAAK,EAAE,YAAY,CAAC,CAAC;AAC/B,CAAC,CAAC;AAtBW,QAAA,eAAe,mBAsB1B","sourcesContent":["import { useEffect, useState } from 'react';\n\nimport { QpqRuntimeComputed, useQpqRuntimeComputed } from '../hooks/asmj/createQpqRuntimeDefinition';\n\nexport const useFieldBinding = <TState, V, E = any>(\n computedAtom: QpqRuntimeComputed<TState, V>,\n someSetter: (value: V) => Promise<void> | void,\n valueExtractor?: (event: E, ...args: any[]) => V,\n): [V, (event: E, ...args: any[]) => void] => {\n const computedValue = useQpqRuntimeComputed(computedAtom);\n\n const [value, setValue] = useState<V>(computedValue);\n\n const handleChange = (event: E, ...args: any[]) => {\n const newValue: V = valueExtractor ? valueExtractor(event, ...args) : (event as any).target.value;\n setValue(newValue);\n someSetter(newValue);\n };\n\n useEffect(() => {\n // React bails out when the value is unchanged, so no equality guard is\n // needed — and local edits (which also change `value`) don't re-run this.\n setValue(computedValue);\n }, [computedValue]);\n\n return [value, handleChange];\n};\n"]}
1
+ {"version":3,"file":"useFieldBinding.js","sourceRoot":"","sources":["../../../src/useFieldBinding/useFieldBinding.ts"],"names":[],"mappings":";;;AAAA,iCAA4C;AAG5C,4EAAyE;AAElE,MAAM,eAAe,GAAG,CAC7B,YAA2C,EAC3C,UAA8C,EAC9C,cAAgD,EACP,EAAE;IAC3C,MAAM,aAAa,GAAG,IAAA,6CAAqB,EAAC,YAAY,CAAC,CAAC;IAE1D,MAAM,CAAC,KAAK,EAAE,QAAQ,CAAC,GAAG,IAAA,gBAAQ,EAAI,aAAa,CAAC,CAAC;IAErD,MAAM,YAAY,GAAG,CAAC,KAAQ,EAAE,GAAG,IAAW,EAAE,EAAE;QAChD,MAAM,QAAQ,GAAM,cAAc,CAAC,CAAC,CAAC,cAAc,CAAC,KAAK,EAAE,GAAG,IAAI,CAAC,CAAC,CAAC,CAAE,KAAa,CAAC,MAAM,CAAC,KAAK,CAAC;QAClG,QAAQ,CAAC,QAAQ,CAAC,CAAC;QACnB,UAAU,CAAC,QAAQ,CAAC,CAAC;IACvB,CAAC,CAAC;IAEF,IAAA,iBAAS,EAAC,GAAG,EAAE;QACb,uEAAuE;QACvE,0EAA0E;QAC1E,QAAQ,CAAC,aAAa,CAAC,CAAC;IAC1B,CAAC,EAAE,CAAC,aAAa,CAAC,CAAC,CAAC;IAEpB,OAAO,CAAC,KAAK,EAAE,YAAY,CAAC,CAAC;AAC/B,CAAC,CAAC;AAtBW,QAAA,eAAe,mBAsB1B","sourcesContent":["import { useEffect, useState } from 'react';\n\nimport { QpqRuntimeComputed } from '../runtime/createQpqRuntimeComputed';\nimport { useQpqRuntimeComputed } from '../runtime/useQpqRuntimeComputed';\n\nexport const useFieldBinding = <TState, V, E = any>(\n computedAtom: QpqRuntimeComputed<TState, V>,\n someSetter: (value: V) => Promise<void> | void,\n valueExtractor?: (event: E, ...args: any[]) => V,\n): [V, (event: E, ...args: any[]) => void] => {\n const computedValue = useQpqRuntimeComputed(computedAtom);\n\n const [value, setValue] = useState<V>(computedValue);\n\n const handleChange = (event: E, ...args: any[]) => {\n const newValue: V = valueExtractor ? valueExtractor(event, ...args) : (event as any).target.value;\n setValue(newValue);\n someSetter(newValue);\n };\n\n useEffect(() => {\n // React bails out when the value is unchanged, so no equality guard is\n // needed — and local edits (which also change `value`) don't re-run this.\n setValue(computedValue);\n }, [computedValue]);\n\n return [value, handleChange];\n};\n"]}
@@ -1,3 +1,3 @@
1
- export declare const sharedQueryParamsRuntime: import("../hooks/asmj/createQpqRuntimeDefinition").QpqRuntimeDefinition<import("./logic").SharedQueryParamsState, import("./logic").SharedQueryParamsSetParamEffect, {
1
+ export declare const sharedQueryParamsRuntime: import("../runtime/createQpqRuntimeDefinition").QpqRuntimeDefinition<import("./logic").SharedQueryParamsState, import("./logic").SharedQueryParamsSetParamEffect, {
2
2
  askSetParam: typeof import("./logic/runtime/askSetParam").askSetParam;
3
3
  }>;
@@ -1,8 +1,13 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.sharedQueryParamsRuntime = void 0;
4
- const createQpqRuntimeDefinition_1 = require("../hooks/asmj/createQpqRuntimeDefinition");
4
+ const createQpqRuntimeDefinition_1 = require("../runtime/createQpqRuntimeDefinition");
5
5
  const runtime_1 = require("./logic/runtime");
6
6
  const logic_1 = require("./logic");
7
- exports.sharedQueryParamsRuntime = (0, createQpqRuntimeDefinition_1.createQpqRuntimeDefinition)(runtime_1.sharedQueryParamsLogic, logic_1.sharedQueryParamsInitalState, logic_1.sharedQueryParamsReducer);
7
+ exports.sharedQueryParamsRuntime = (0, createQpqRuntimeDefinition_1.createQpqRuntimeDefinition)({
8
+ uniqueName: 'qpq/web-react/sharedQueryParams',
9
+ api: runtime_1.sharedQueryParamsLogic,
10
+ initialState: logic_1.sharedQueryParamsInitalState,
11
+ reducer: logic_1.sharedQueryParamsReducer,
12
+ });
8
13
  //# sourceMappingURL=sharedQueryParamsRuntime.js.map