quidproquo-web-react 0.0.253 → 0.0.255
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.
- package/lib/commonjs/api/hooks/index.d.ts +2 -2
- package/lib/commonjs/api/hooks/index.js +18 -18
- package/lib/commonjs/api/hooks/useAuthenticatedNetworkRequest.d.ts +2 -2
- package/lib/commonjs/api/hooks/useAuthenticatedNetworkRequest.js +14 -14
- package/lib/commonjs/api/hooks/useNetworkRequest.d.ts +2 -2
- package/lib/commonjs/api/hooks/useNetworkRequest.js +10 -10
- package/lib/commonjs/api/index.d.ts +1 -1
- package/lib/commonjs/api/index.js +17 -17
- package/lib/commonjs/auth/RefreshAuthTokensProvider.d.ts +7 -8
- package/lib/commonjs/auth/RefreshAuthTokensProvider.js +12 -12
- package/lib/commonjs/auth/authContext.d.ts +2 -3
- package/lib/commonjs/auth/authContext.js +8 -8
- package/lib/commonjs/auth/hooks/index.d.ts +3 -3
- package/lib/commonjs/auth/hooks/index.js +19 -19
- package/lib/commonjs/auth/hooks/useAuthAccessToken.d.ts +1 -1
- package/lib/commonjs/auth/hooks/useAuthAccessToken.js +12 -12
- package/lib/commonjs/auth/hooks/useIsLoggedIn.d.ts +1 -1
- package/lib/commonjs/auth/hooks/useIsLoggedIn.js +9 -9
- package/lib/commonjs/auth/hooks/useRefreshTokens.d.ts +2 -2
- package/lib/commonjs/auth/hooks/useRefreshTokens.js +35 -35
- package/lib/commonjs/auth/index.d.ts +4 -4
- package/lib/commonjs/auth/index.js +20 -20
- package/lib/commonjs/auth/types/AuthState.d.ts +8 -8
- package/lib/commonjs/auth/types/AuthState.js +2 -2
- package/lib/commonjs/auth/types/index.d.ts +1 -1
- package/lib/commonjs/auth/types/index.js +17 -17
- package/lib/commonjs/baseUrl/BaseUrlContext.d.ts +2 -3
- package/lib/commonjs/baseUrl/BaseUrlContext.js +9 -9
- package/lib/commonjs/baseUrl/BaseUrlProvider.d.ts +6 -7
- package/lib/commonjs/baseUrl/BaseUrlProvider.js +9 -9
- package/lib/commonjs/baseUrl/hooks/index.d.ts +1 -1
- package/lib/commonjs/baseUrl/hooks/index.js +17 -17
- package/lib/commonjs/baseUrl/hooks/useBaseUrlResolvers.d.ts +2 -2
- package/lib/commonjs/baseUrl/hooks/useBaseUrlResolvers.js +10 -10
- package/lib/commonjs/baseUrl/index.d.ts +3 -3
- package/lib/commonjs/baseUrl/index.js +19 -19
- package/lib/commonjs/baseUrl/types/BaseUrlResolver.d.ts +6 -6
- package/lib/commonjs/baseUrl/types/BaseUrlResolver.js +2 -2
- package/lib/commonjs/baseUrl/types/index.d.ts +1 -1
- package/lib/commonjs/baseUrl/types/index.js +17 -17
- package/lib/commonjs/hooks/asmj/QpqContextProvider.d.ts +10 -10
- package/lib/commonjs/hooks/asmj/QpqContextProvider.js +20 -20
- package/lib/commonjs/hooks/asmj/QpqMappedApi.d.ts +6 -6
- package/lib/commonjs/hooks/asmj/QpqMappedApi.js +2 -2
- package/lib/commonjs/hooks/asmj/QpqRuntimeEffectCatcher.d.ts +16 -16
- package/lib/commonjs/hooks/asmj/QpqRuntimeEffectCatcher.js +35 -35
- package/lib/commonjs/hooks/asmj/actionProcessor/getStateDispatchActionProcessor.d.ts +3 -3
- package/lib/commonjs/hooks/asmj/actionProcessor/getStateDispatchActionProcessor.js +23 -23
- package/lib/commonjs/hooks/asmj/actionProcessor/getStateReadActionProcessor.d.ts +2 -2
- package/lib/commonjs/hooks/asmj/actionProcessor/getStateReadActionProcessor.js +22 -22
- package/lib/commonjs/hooks/asmj/actionProcessor/index.d.ts +3 -3
- package/lib/commonjs/hooks/asmj/actionProcessor/index.js +18 -18
- package/lib/commonjs/hooks/asmj/createQpqRuntimeDefinition.d.ts +22 -16
- package/lib/commonjs/hooks/asmj/createQpqRuntimeDefinition.js +52 -39
- package/lib/commonjs/hooks/asmj/index.d.ts +6 -6
- package/lib/commonjs/hooks/asmj/index.js +22 -22
- package/lib/commonjs/hooks/asmj/useQpqRuntime.d.ts +4 -4
- package/lib/commonjs/hooks/asmj/useQpqRuntime.js +35 -36
- package/lib/commonjs/hooks/index.d.ts +8 -8
- package/lib/commonjs/hooks/index.js +24 -24
- package/lib/commonjs/hooks/useAsyncEffect.d.ts +2 -2
- package/lib/commonjs/hooks/useAsyncEffect.js +36 -36
- package/lib/commonjs/hooks/useFastCallback.d.ts +2 -2
- package/lib/commonjs/hooks/useFastCallback.js +19 -20
- package/lib/commonjs/hooks/useMetadata/index.d.ts +1 -1
- package/lib/commonjs/hooks/useMetadata/index.js +17 -17
- package/lib/commonjs/hooks/useMetadata/useMetadata.d.ts +5 -5
- package/lib/commonjs/hooks/useMetadata/useMetadata.js +14 -15
- package/lib/commonjs/hooks/useOnKeyDownEffect.d.ts +1 -1
- package/lib/commonjs/hooks/useOnKeyDownEffect.js +22 -23
- package/lib/commonjs/hooks/useQpq.d.ts +2 -2
- package/lib/commonjs/hooks/useQpq.js +45 -44
- package/lib/commonjs/hooks/useRunEvery.d.ts +1 -1
- package/lib/commonjs/hooks/useRunEvery.js +21 -22
- package/lib/commonjs/hooks/useThrottledMemo.d.ts +1 -1
- package/lib/commonjs/hooks/useThrottledMemo.js +31 -32
- package/lib/commonjs/index.d.ts +10 -8
- package/lib/commonjs/index.js +26 -24
- package/lib/commonjs/state/index.d.ts +1 -1
- package/lib/commonjs/state/index.js +17 -17
- package/lib/commonjs/state/useStateUpdater.d.ts +3 -4
- package/lib/commonjs/state/useStateUpdater.js +12 -12
- package/lib/commonjs/useFieldBinding/index.d.ts +1 -0
- package/lib/commonjs/useFieldBinding/index.js +17 -0
- package/lib/commonjs/useFieldBinding/useFieldBinding.d.ts +2 -0
- package/lib/commonjs/useFieldBinding/useFieldBinding.js +21 -0
- package/lib/commonjs/useSharedQueryParams/index.d.ts +2 -0
- package/lib/commonjs/useSharedQueryParams/index.js +18 -0
- package/lib/commonjs/useSharedQueryParams/logic/index.d.ts +4 -0
- package/lib/commonjs/useSharedQueryParams/logic/index.js +20 -0
- package/lib/commonjs/useSharedQueryParams/logic/runtime/askSetParam.d.ts +2 -0
- package/lib/commonjs/useSharedQueryParams/logic/runtime/askSetParam.js +9 -0
- package/lib/commonjs/useSharedQueryParams/logic/runtime/askSyncParams.d.ts +2 -0
- package/lib/commonjs/useSharedQueryParams/logic/runtime/askSyncParams.js +11 -0
- package/lib/commonjs/useSharedQueryParams/logic/runtime/index.d.ts +2 -0
- package/lib/commonjs/useSharedQueryParams/logic/runtime/index.js +18 -0
- package/lib/commonjs/useSharedQueryParams/logic/runtime/sharedQueryParamsLogic.d.ts +4 -0
- package/lib/commonjs/useSharedQueryParams/logic/runtime/sharedQueryParamsLogic.js +7 -0
- package/lib/commonjs/useSharedQueryParams/logic/sharedQueryParamsActionCreator.d.ts +2 -0
- package/lib/commonjs/useSharedQueryParams/logic/sharedQueryParamsActionCreator.js +11 -0
- package/lib/commonjs/useSharedQueryParams/logic/sharedQueryParamsReducer.d.ts +3 -0
- package/lib/commonjs/useSharedQueryParams/logic/sharedQueryParamsReducer.js +13 -0
- package/lib/commonjs/useSharedQueryParams/logic/sharedQueryParamsTypes.d.ts +10 -0
- package/lib/commonjs/useSharedQueryParams/logic/sharedQueryParamsTypes.js +7 -0
- package/lib/commonjs/useSharedQueryParams/sharedQueryParamsRuntime.d.ts +3 -0
- package/lib/commonjs/useSharedQueryParams/sharedQueryParamsRuntime.js +7 -0
- package/lib/commonjs/webSocketQueue/hooks/index.d.ts +2 -2
- package/lib/commonjs/webSocketQueue/hooks/index.js +18 -18
- package/lib/commonjs/webSocketQueue/hooks/useSubscribeToWebSocketQueueEvent.d.ts +3 -3
- package/lib/commonjs/webSocketQueue/hooks/useSubscribeToWebSocketQueueEvent.js +8 -8
- package/lib/commonjs/webSocketQueue/hooks/useWebsocketQueueSendEvent.d.ts +2 -2
- package/lib/commonjs/webSocketQueue/hooks/useWebsocketQueueSendEvent.js +9 -9
- package/lib/commonjs/webSocketQueue/index.d.ts +1 -1
- package/lib/commonjs/webSocketQueue/index.js +17 -17
- package/lib/commonjs/websocket/WebSocketAuthSync/WebSocketAuthSync.d.ts +6 -7
- package/lib/commonjs/websocket/WebSocketAuthSync/WebSocketAuthSync.js +14 -14
- package/lib/commonjs/websocket/WebSocketAuthSync/hooks/index.d.ts +2 -2
- package/lib/commonjs/websocket/WebSocketAuthSync/hooks/index.js +18 -18
- package/lib/commonjs/websocket/WebSocketAuthSync/hooks/useWebsocketAuthSync.d.ts +2 -2
- package/lib/commonjs/websocket/WebSocketAuthSync/hooks/useWebsocketAuthSync.js +37 -37
- package/lib/commonjs/websocket/WebSocketAuthSync/hooks/useWebsocketPingPong.d.ts +1 -1
- package/lib/commonjs/websocket/WebSocketAuthSync/hooks/useWebsocketPingPong.js +16 -16
- package/lib/commonjs/websocket/WebSocketAuthSync/index.d.ts +1 -1
- package/lib/commonjs/websocket/WebSocketAuthSync/index.js +17 -17
- package/lib/commonjs/websocket/WebsocketContext.d.ts +2 -3
- package/lib/commonjs/websocket/WebsocketContext.js +5 -5
- package/lib/commonjs/websocket/WebsocketProvider.d.ts +5 -6
- package/lib/commonjs/websocket/WebsocketProvider.js +11 -11
- package/lib/commonjs/websocket/hooks/index.d.ts +5 -5
- package/lib/commonjs/websocket/hooks/index.js +21 -21
- package/lib/commonjs/websocket/hooks/useSubscribeToWebSocketEvent.d.ts +3 -3
- package/lib/commonjs/websocket/hooks/useSubscribeToWebSocketEvent.js +17 -17
- package/lib/commonjs/websocket/hooks/useSubscribeToWebsocket.d.ts +2 -2
- package/lib/commonjs/websocket/hooks/useSubscribeToWebsocket.js +17 -17
- package/lib/commonjs/websocket/hooks/useWebsocketApi.d.ts +1 -1
- package/lib/commonjs/websocket/hooks/useWebsocketApi.js +10 -10
- package/lib/commonjs/websocket/hooks/useWebsocketManagement.d.ts +2 -2
- package/lib/commonjs/websocket/hooks/useWebsocketManagement.js +17 -17
- package/lib/commonjs/websocket/hooks/useWebsocketSendEvent.d.ts +2 -2
- package/lib/commonjs/websocket/hooks/useWebsocketSendEvent.js +15 -15
- package/lib/commonjs/websocket/index.d.ts +3 -3
- package/lib/commonjs/websocket/index.js +19 -19
- package/lib/esm/api/hooks/index.d.ts +2 -2
- package/lib/esm/api/hooks/index.js +2 -2
- package/lib/esm/api/hooks/useAuthenticatedNetworkRequest.d.ts +2 -2
- package/lib/esm/api/hooks/useAuthenticatedNetworkRequest.js +17 -17
- package/lib/esm/api/hooks/useNetworkRequest.d.ts +2 -2
- package/lib/esm/api/hooks/useNetworkRequest.js +6 -6
- package/lib/esm/api/index.d.ts +1 -1
- package/lib/esm/api/index.js +1 -1
- package/lib/esm/auth/RefreshAuthTokensProvider.d.ts +7 -8
- package/lib/esm/auth/RefreshAuthTokensProvider.js +9 -9
- package/lib/esm/auth/authContext.d.ts +2 -3
- package/lib/esm/auth/authContext.js +5 -5
- package/lib/esm/auth/hooks/index.d.ts +3 -3
- package/lib/esm/auth/hooks/index.js +3 -3
- package/lib/esm/auth/hooks/useAuthAccessToken.d.ts +1 -1
- package/lib/esm/auth/hooks/useAuthAccessToken.js +7 -7
- package/lib/esm/auth/hooks/useIsLoggedIn.d.ts +1 -1
- package/lib/esm/auth/hooks/useIsLoggedIn.js +5 -5
- package/lib/esm/auth/hooks/useRefreshTokens.d.ts +2 -2
- package/lib/esm/auth/hooks/useRefreshTokens.js +31 -31
- package/lib/esm/auth/index.d.ts +4 -4
- package/lib/esm/auth/index.js +4 -4
- package/lib/esm/auth/types/AuthState.d.ts +8 -8
- package/lib/esm/auth/types/AuthState.js +1 -1
- package/lib/esm/auth/types/index.d.ts +1 -1
- package/lib/esm/auth/types/index.js +1 -1
- package/lib/esm/baseUrl/BaseUrlContext.d.ts +2 -3
- package/lib/esm/baseUrl/BaseUrlContext.js +6 -6
- package/lib/esm/baseUrl/BaseUrlProvider.d.ts +6 -7
- package/lib/esm/baseUrl/BaseUrlProvider.js +5 -5
- package/lib/esm/baseUrl/hooks/index.d.ts +1 -1
- package/lib/esm/baseUrl/hooks/index.js +1 -1
- package/lib/esm/baseUrl/hooks/useBaseUrlResolvers.d.ts +2 -2
- package/lib/esm/baseUrl/hooks/useBaseUrlResolvers.js +6 -6
- package/lib/esm/baseUrl/index.d.ts +3 -3
- package/lib/esm/baseUrl/index.js +3 -3
- package/lib/esm/baseUrl/types/BaseUrlResolver.d.ts +6 -6
- package/lib/esm/baseUrl/types/BaseUrlResolver.js +1 -1
- package/lib/esm/baseUrl/types/index.d.ts +1 -1
- package/lib/esm/baseUrl/types/index.js +1 -1
- package/lib/esm/hooks/asmj/QpqContextProvider.d.ts +10 -10
- package/lib/esm/hooks/asmj/QpqContextProvider.js +15 -15
- package/lib/esm/hooks/asmj/QpqMappedApi.d.ts +6 -6
- package/lib/esm/hooks/asmj/QpqMappedApi.js +1 -1
- package/lib/esm/hooks/asmj/QpqRuntimeEffectCatcher.d.ts +16 -16
- package/lib/esm/hooks/asmj/QpqRuntimeEffectCatcher.js +30 -30
- package/lib/esm/hooks/asmj/actionProcessor/getStateDispatchActionProcessor.d.ts +3 -3
- package/lib/esm/hooks/asmj/actionProcessor/getStateDispatchActionProcessor.js +8 -8
- package/lib/esm/hooks/asmj/actionProcessor/getStateReadActionProcessor.d.ts +2 -2
- package/lib/esm/hooks/asmj/actionProcessor/getStateReadActionProcessor.js +7 -7
- package/lib/esm/hooks/asmj/actionProcessor/index.d.ts +3 -3
- package/lib/esm/hooks/asmj/actionProcessor/index.js +6 -6
- package/lib/esm/hooks/asmj/createQpqRuntimeDefinition.d.ts +22 -16
- package/lib/esm/hooks/asmj/createQpqRuntimeDefinition.js +46 -34
- package/lib/esm/hooks/asmj/index.d.ts +6 -6
- package/lib/esm/hooks/asmj/index.js +6 -6
- package/lib/esm/hooks/asmj/useQpqRuntime.d.ts +4 -4
- package/lib/esm/hooks/asmj/useQpqRuntime.js +32 -32
- package/lib/esm/hooks/index.d.ts +8 -8
- package/lib/esm/hooks/index.js +8 -8
- package/lib/esm/hooks/useAsyncEffect.d.ts +2 -2
- package/lib/esm/hooks/useAsyncEffect.js +23 -23
- package/lib/esm/hooks/useFastCallback.d.ts +2 -2
- package/lib/esm/hooks/useFastCallback.js +16 -16
- package/lib/esm/hooks/useMetadata/index.d.ts +1 -1
- package/lib/esm/hooks/useMetadata/index.js +1 -1
- package/lib/esm/hooks/useMetadata/useMetadata.d.ts +5 -5
- package/lib/esm/hooks/useMetadata/useMetadata.js +11 -11
- package/lib/esm/hooks/useOnKeyDownEffect.d.ts +1 -1
- package/lib/esm/hooks/useOnKeyDownEffect.js +19 -19
- package/lib/esm/hooks/useQpq.d.ts +2 -2
- package/lib/esm/hooks/useQpq.js +34 -32
- package/lib/esm/hooks/useRunEvery.d.ts +1 -1
- package/lib/esm/hooks/useRunEvery.js +18 -18
- package/lib/esm/hooks/useThrottledMemo.d.ts +1 -1
- package/lib/esm/hooks/useThrottledMemo.js +28 -28
- package/lib/esm/index.d.ts +10 -8
- package/lib/esm/index.js +10 -8
- package/lib/esm/state/index.d.ts +1 -1
- package/lib/esm/state/index.js +1 -1
- package/lib/esm/state/useStateUpdater.d.ts +3 -4
- package/lib/esm/state/useStateUpdater.js +11 -11
- package/lib/esm/useFieldBinding/index.d.ts +1 -0
- package/lib/esm/useFieldBinding/index.js +1 -0
- package/lib/esm/useFieldBinding/useFieldBinding.d.ts +2 -0
- package/lib/esm/useFieldBinding/useFieldBinding.js +17 -0
- package/lib/esm/useSharedQueryParams/index.d.ts +2 -0
- package/lib/esm/useSharedQueryParams/index.js +2 -0
- package/lib/esm/useSharedQueryParams/logic/index.d.ts +4 -0
- package/lib/esm/useSharedQueryParams/logic/index.js +4 -0
- package/lib/esm/useSharedQueryParams/logic/runtime/askSetParam.d.ts +2 -0
- package/lib/esm/useSharedQueryParams/logic/runtime/askSetParam.js +6 -0
- package/lib/esm/useSharedQueryParams/logic/runtime/askSyncParams.d.ts +2 -0
- package/lib/esm/useSharedQueryParams/logic/runtime/askSyncParams.js +8 -0
- package/lib/esm/useSharedQueryParams/logic/runtime/index.d.ts +2 -0
- package/lib/esm/useSharedQueryParams/logic/runtime/index.js +2 -0
- package/lib/esm/useSharedQueryParams/logic/runtime/sharedQueryParamsLogic.d.ts +4 -0
- package/lib/esm/useSharedQueryParams/logic/runtime/sharedQueryParamsLogic.js +4 -0
- package/lib/esm/useSharedQueryParams/logic/sharedQueryParamsActionCreator.d.ts +2 -0
- package/lib/esm/useSharedQueryParams/logic/sharedQueryParamsActionCreator.js +8 -0
- package/lib/esm/useSharedQueryParams/logic/sharedQueryParamsReducer.d.ts +3 -0
- package/lib/esm/useSharedQueryParams/logic/sharedQueryParamsReducer.js +10 -0
- package/lib/esm/useSharedQueryParams/logic/sharedQueryParamsTypes.d.ts +10 -0
- package/lib/esm/useSharedQueryParams/logic/sharedQueryParamsTypes.js +4 -0
- package/lib/esm/useSharedQueryParams/sharedQueryParamsRuntime.d.ts +3 -0
- package/lib/esm/useSharedQueryParams/sharedQueryParamsRuntime.js +4 -0
- package/lib/esm/webSocketQueue/hooks/index.d.ts +2 -2
- package/lib/esm/webSocketQueue/hooks/index.js +2 -2
- package/lib/esm/webSocketQueue/hooks/useSubscribeToWebSocketQueueEvent.d.ts +3 -3
- package/lib/esm/webSocketQueue/hooks/useSubscribeToWebSocketQueueEvent.js +4 -4
- package/lib/esm/webSocketQueue/hooks/useWebsocketQueueSendEvent.d.ts +2 -2
- package/lib/esm/webSocketQueue/hooks/useWebsocketQueueSendEvent.js +5 -5
- package/lib/esm/webSocketQueue/index.d.ts +1 -1
- package/lib/esm/webSocketQueue/index.js +1 -1
- package/lib/esm/websocket/WebSocketAuthSync/WebSocketAuthSync.d.ts +6 -7
- package/lib/esm/websocket/WebSocketAuthSync/WebSocketAuthSync.js +11 -11
- package/lib/esm/websocket/WebSocketAuthSync/hooks/index.d.ts +2 -2
- package/lib/esm/websocket/WebSocketAuthSync/hooks/index.js +2 -2
- package/lib/esm/websocket/WebSocketAuthSync/hooks/useWebsocketAuthSync.d.ts +2 -2
- package/lib/esm/websocket/WebSocketAuthSync/hooks/useWebsocketAuthSync.js +33 -33
- package/lib/esm/websocket/WebSocketAuthSync/hooks/useWebsocketPingPong.d.ts +1 -1
- package/lib/esm/websocket/WebSocketAuthSync/hooks/useWebsocketPingPong.js +12 -12
- package/lib/esm/websocket/WebSocketAuthSync/index.d.ts +1 -1
- package/lib/esm/websocket/WebSocketAuthSync/index.js +1 -1
- package/lib/esm/websocket/WebsocketContext.d.ts +2 -3
- package/lib/esm/websocket/WebsocketContext.js +2 -2
- package/lib/esm/websocket/WebsocketProvider.d.ts +5 -6
- package/lib/esm/websocket/WebsocketProvider.js +7 -7
- package/lib/esm/websocket/hooks/index.d.ts +5 -5
- package/lib/esm/websocket/hooks/index.js +5 -5
- package/lib/esm/websocket/hooks/useSubscribeToWebSocketEvent.d.ts +3 -3
- package/lib/esm/websocket/hooks/useSubscribeToWebSocketEvent.js +13 -13
- package/lib/esm/websocket/hooks/useSubscribeToWebsocket.d.ts +2 -2
- package/lib/esm/websocket/hooks/useSubscribeToWebsocket.js +13 -13
- package/lib/esm/websocket/hooks/useWebsocketApi.d.ts +1 -1
- package/lib/esm/websocket/hooks/useWebsocketApi.js +6 -6
- package/lib/esm/websocket/hooks/useWebsocketManagement.d.ts +2 -2
- package/lib/esm/websocket/hooks/useWebsocketManagement.js +13 -13
- package/lib/esm/websocket/hooks/useWebsocketSendEvent.d.ts +2 -2
- package/lib/esm/websocket/hooks/useWebsocketSendEvent.js +11 -11
- package/lib/esm/websocket/index.d.ts +3 -3
- package/lib/esm/websocket/index.js +3 -3
- package/package.json +8 -8
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.useBaseUrlResolvers = void 0;
|
|
4
|
-
const react_1 = require("react");
|
|
5
|
-
const BaseUrlContext_1 = require("../BaseUrlContext");
|
|
6
|
-
const useBaseUrlResolvers = () => {
|
|
7
|
-
const baseUrlResolvers = (0, react_1.useContext)(BaseUrlContext_1.BaseUrlContext);
|
|
8
|
-
return baseUrlResolvers;
|
|
9
|
-
};
|
|
10
|
-
exports.useBaseUrlResolvers = useBaseUrlResolvers;
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.useBaseUrlResolvers = void 0;
|
|
4
|
+
const react_1 = require("react");
|
|
5
|
+
const BaseUrlContext_1 = require("../BaseUrlContext");
|
|
6
|
+
const useBaseUrlResolvers = () => {
|
|
7
|
+
const baseUrlResolvers = (0, react_1.useContext)(BaseUrlContext_1.BaseUrlContext);
|
|
8
|
+
return baseUrlResolvers;
|
|
9
|
+
};
|
|
10
|
+
exports.useBaseUrlResolvers = useBaseUrlResolvers;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export * from './BaseUrlProvider';
|
|
2
|
-
export * from './hooks';
|
|
3
|
-
export * from './types';
|
|
1
|
+
export * from './BaseUrlProvider';
|
|
2
|
+
export * from './hooks';
|
|
3
|
+
export * from './types';
|
|
@@ -1,19 +1,19 @@
|
|
|
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("./BaseUrlProvider"), exports);
|
|
18
|
-
__exportStar(require("./hooks"), exports);
|
|
19
|
-
__exportStar(require("./types"), exports);
|
|
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("./BaseUrlProvider"), exports);
|
|
18
|
+
__exportStar(require("./hooks"), exports);
|
|
19
|
+
__exportStar(require("./types"), exports);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
export type BaseUrlResolver = () => string;
|
|
2
|
-
export type BaseUrlResolvers = {
|
|
3
|
-
getApiUrl: BaseUrlResolver;
|
|
4
|
-
getWsUrl: BaseUrlResolver;
|
|
5
|
-
getMFManifestUrl: BaseUrlResolver;
|
|
6
|
-
};
|
|
1
|
+
export type BaseUrlResolver = () => string;
|
|
2
|
+
export type BaseUrlResolvers = {
|
|
3
|
+
getApiUrl: BaseUrlResolver;
|
|
4
|
+
getWsUrl: BaseUrlResolver;
|
|
5
|
+
getMFManifestUrl: BaseUrlResolver;
|
|
6
|
+
};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from './BaseUrlResolver';
|
|
1
|
+
export * from './BaseUrlResolver';
|
|
@@ -1,17 +1,17 @@
|
|
|
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("./BaseUrlResolver"), exports);
|
|
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("./BaseUrlResolver"), exports);
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { QpqContext, QpqContextIdentifier } from 'quidproquo-core';
|
|
2
|
-
import { ReactNode } from 'react';
|
|
3
|
-
interface QpqContextProviderProps<T> {
|
|
4
|
-
contextIdentifier: QpqContextIdentifier<T>;
|
|
5
|
-
value: T;
|
|
6
|
-
children: ReactNode;
|
|
7
|
-
}
|
|
8
|
-
export declare const useQpqContextValues: () => QpqContext<any>;
|
|
9
|
-
export declare const QpqContextProvider: <T>({ contextIdentifier, value, children }: QpqContextProviderProps<T>) => import("react/jsx-runtime").JSX.Element;
|
|
10
|
-
export {};
|
|
1
|
+
import { QpqContext, QpqContextIdentifier } from 'quidproquo-core';
|
|
2
|
+
import { ReactNode } from 'react';
|
|
3
|
+
interface QpqContextProviderProps<T> {
|
|
4
|
+
contextIdentifier: QpqContextIdentifier<T>;
|
|
5
|
+
value: T;
|
|
6
|
+
children: ReactNode;
|
|
7
|
+
}
|
|
8
|
+
export declare const useQpqContextValues: () => QpqContext<any>;
|
|
9
|
+
export declare const QpqContextProvider: <T>({ contextIdentifier, value, children }: QpqContextProviderProps<T>) => import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
export {};
|
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.QpqContextProvider = exports.useQpqContextValues = void 0;
|
|
4
|
-
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
-
const react_1 = require("react");
|
|
6
|
-
// Define a generic type for the React Context
|
|
7
|
-
const qpqReactContext = (0, react_1.createContext)({});
|
|
8
|
-
const useQpqContextValues = () => {
|
|
9
|
-
return (0, react_1.useContext)(qpqReactContext);
|
|
10
|
-
};
|
|
11
|
-
exports.useQpqContextValues = useQpqContextValues;
|
|
12
|
-
const QpqContextProvider = ({ contextIdentifier, value, children }) => {
|
|
13
|
-
// Get the parent context value
|
|
14
|
-
const parentContext = (0, react_1.useContext)(qpqReactContext);
|
|
15
|
-
// Merge parent and current value
|
|
16
|
-
const mergedContext = (0, react_1.useMemo)(() => (Object.assign(Object.assign({}, parentContext), { [contextIdentifier.uniqueName]: value })), [parentContext, contextIdentifier.uniqueName, value]);
|
|
17
|
-
// Provide the merged context down
|
|
18
|
-
return (0, jsx_runtime_1.jsx)(qpqReactContext.Provider,
|
|
19
|
-
};
|
|
20
|
-
exports.QpqContextProvider = QpqContextProvider;
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.QpqContextProvider = exports.useQpqContextValues = void 0;
|
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
const react_1 = require("react");
|
|
6
|
+
// Define a generic type for the React Context
|
|
7
|
+
const qpqReactContext = (0, react_1.createContext)({});
|
|
8
|
+
const useQpqContextValues = () => {
|
|
9
|
+
return (0, react_1.useContext)(qpqReactContext);
|
|
10
|
+
};
|
|
11
|
+
exports.useQpqContextValues = useQpqContextValues;
|
|
12
|
+
const QpqContextProvider = ({ contextIdentifier, value, children }) => {
|
|
13
|
+
// Get the parent context value
|
|
14
|
+
const parentContext = (0, react_1.useContext)(qpqReactContext);
|
|
15
|
+
// Merge parent and current value
|
|
16
|
+
const mergedContext = (0, react_1.useMemo)(() => (Object.assign(Object.assign({}, parentContext), { [contextIdentifier.uniqueName]: value })), [parentContext, contextIdentifier.uniqueName, value]);
|
|
17
|
+
// Provide the merged context down
|
|
18
|
+
return (0, jsx_runtime_1.jsx)(qpqReactContext.Provider, { value: mergedContext, children: children });
|
|
19
|
+
};
|
|
20
|
+
exports.QpqContextProvider = QpqContextProvider;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { AskResponse, AskResponseReturnType, Story } from 'quidproquo-core';
|
|
2
|
-
export type RemoveQpqAskPrefix<K extends string> = K extends `ask${infer R}` ? Uncapitalize<R> : never;
|
|
3
|
-
export type QpqApi = Record<`ask${string}`, Story<any, any>>;
|
|
4
|
-
export type QpqMappedApi<TApi extends QpqApi> = {
|
|
5
|
-
[K in Extract<keyof TApi, string> as RemoveQpqAskPrefix<K>]: TApi[K] extends (...args: infer P) => infer R ? R extends AskResponse<any> ? (...args: P) => Promise<AskResponseReturnType<R>> : never : never;
|
|
6
|
-
};
|
|
1
|
+
import { AskResponse, AskResponseReturnType, Story } from 'quidproquo-core';
|
|
2
|
+
export type RemoveQpqAskPrefix<K extends string> = K extends `ask${infer R}` ? Uncapitalize<R> : never;
|
|
3
|
+
export type QpqApi = Record<`ask${string}`, Story<any, any>>;
|
|
4
|
+
export type QpqMappedApi<TApi extends QpqApi> = {
|
|
5
|
+
[K in Extract<keyof TApi, string> as RemoveQpqAskPrefix<K>]: TApi[K] extends (...args: infer P) => infer R ? R extends AskResponse<any> ? (...args: P) => Promise<AskResponseReturnType<R>> : never : never;
|
|
6
|
+
};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import { ReactNode } from 'react';
|
|
2
|
-
import { QpqApi } from './QpqMappedApi';
|
|
3
|
-
import { QpqRuntimeDefinition } from '.';
|
|
4
|
-
export type QpqBubbleReducer<S, A> = (prevState: S, action: A) => [S, boolean];
|
|
5
|
-
type QpqRuntimeEffectCatcher = {
|
|
6
|
-
runtime: QpqRuntimeDefinition<any, any, any>;
|
|
7
|
-
name?: string;
|
|
8
|
-
};
|
|
9
|
-
export declare const useQpqRuntimeBubblingReducer: <TState, TAction, TApi extends QpqApi>(runtimeDefinition: QpqRuntimeDefinition<TState, TAction, TApi>, name?: string) => [TState, (action: TAction) => void, () => TState];
|
|
10
|
-
export declare const QpqRuntimeEffectCatcherComponent: <TState, TAction, TApi extends QpqApi>({ children, runtime, name, }: QpqRuntimeEffectCatcher & {
|
|
11
|
-
children: ReactNode;
|
|
12
|
-
}) => import("react/jsx-runtime").JSX.Element;
|
|
13
|
-
export declare const QpqRuntimeEffectCatcher: import("react").MemoExoticComponent<(<TState, TAction, TApi extends QpqApi>({ children, runtime, name, }: QpqRuntimeEffectCatcher & {
|
|
14
|
-
children: ReactNode;
|
|
15
|
-
}) => import("react/jsx-runtime").JSX.Element)>;
|
|
16
|
-
export {};
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
import { QpqApi } from './QpqMappedApi';
|
|
3
|
+
import { QpqRuntimeDefinition } from '.';
|
|
4
|
+
export type QpqBubbleReducer<S, A> = (prevState: S, action: A) => [S, boolean];
|
|
5
|
+
type QpqRuntimeEffectCatcher = {
|
|
6
|
+
runtime: QpqRuntimeDefinition<any, any, any>;
|
|
7
|
+
name?: string;
|
|
8
|
+
};
|
|
9
|
+
export declare const useQpqRuntimeBubblingReducer: <TState, TAction, TApi extends QpqApi>(runtimeDefinition: QpqRuntimeDefinition<TState, TAction, TApi>, name?: string) => [TState, (action: TAction) => void, () => TState];
|
|
10
|
+
export declare const QpqRuntimeEffectCatcherComponent: <TState, TAction, TApi extends QpqApi>({ children, runtime, name, }: QpqRuntimeEffectCatcher & {
|
|
11
|
+
children: ReactNode;
|
|
12
|
+
}) => import("react/jsx-runtime").JSX.Element;
|
|
13
|
+
export declare const QpqRuntimeEffectCatcher: import("react").MemoExoticComponent<(<TState, TAction, TApi extends QpqApi>({ children, runtime, name, }: QpqRuntimeEffectCatcher & {
|
|
14
|
+
children: ReactNode;
|
|
15
|
+
}) => import("react/jsx-runtime").JSX.Element)>;
|
|
16
|
+
export {};
|
|
@@ -1,35 +1,35 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.QpqRuntimeEffectCatcher = exports.QpqRuntimeEffectCatcherComponent = exports.useQpqRuntimeBubblingReducer = void 0;
|
|
4
|
-
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
-
const react_1 = require("react");
|
|
6
|
-
const useFastCallback_1 = require("../useFastCallback");
|
|
7
|
-
const _1 = require(".");
|
|
8
|
-
// Create a context with a default NOOP dispatcher
|
|
9
|
-
const BubbleReducerDispatchContext = (0, react_1.createContext)((_action) => {
|
|
10
|
-
// NOOP
|
|
11
|
-
});
|
|
12
|
-
const useQpqRuntimeBubblingReducer = (runtimeDefinition, name) => {
|
|
13
|
-
const runtimeDefinitionInfo = runtimeDefinition(name);
|
|
14
|
-
const [state, setState, getState] = (0, _1.useQpqRuntimeState)(runtimeDefinition, name);
|
|
15
|
-
// Get the parent dispatch from the context
|
|
16
|
-
const parentDispatch = (0, react_1.useContext)(BubbleReducerDispatchContext);
|
|
17
|
-
// Custom Dispatch using functional updates
|
|
18
|
-
const dispatch = (0, useFastCallback_1.useFastCallback)((action) => {
|
|
19
|
-
const [newState, preventBubble] = runtimeDefinitionInfo.reducer(getState(), action);
|
|
20
|
-
if (preventBubble) {
|
|
21
|
-
setState(newState);
|
|
22
|
-
}
|
|
23
|
-
else {
|
|
24
|
-
parentDispatch(action);
|
|
25
|
-
}
|
|
26
|
-
});
|
|
27
|
-
return [state, dispatch, getState];
|
|
28
|
-
};
|
|
29
|
-
exports.useQpqRuntimeBubblingReducer = useQpqRuntimeBubblingReducer;
|
|
30
|
-
const QpqRuntimeEffectCatcherComponent = ({ children, runtime, name, }) => {
|
|
31
|
-
const [api, state, dispatch] = (0, _1.useQpqRuntime)(runtime, undefined, name);
|
|
32
|
-
return (0, jsx_runtime_1.jsx)(BubbleReducerDispatchContext.Provider,
|
|
33
|
-
};
|
|
34
|
-
exports.QpqRuntimeEffectCatcherComponent = QpqRuntimeEffectCatcherComponent;
|
|
35
|
-
exports.QpqRuntimeEffectCatcher = (0, react_1.memo)(exports.QpqRuntimeEffectCatcherComponent);
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.QpqRuntimeEffectCatcher = exports.QpqRuntimeEffectCatcherComponent = exports.useQpqRuntimeBubblingReducer = void 0;
|
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
const react_1 = require("react");
|
|
6
|
+
const useFastCallback_1 = require("../useFastCallback");
|
|
7
|
+
const _1 = require(".");
|
|
8
|
+
// Create a context with a default NOOP dispatcher
|
|
9
|
+
const BubbleReducerDispatchContext = (0, react_1.createContext)((_action) => {
|
|
10
|
+
// NOOP
|
|
11
|
+
});
|
|
12
|
+
const useQpqRuntimeBubblingReducer = (runtimeDefinition, name) => {
|
|
13
|
+
const runtimeDefinitionInfo = (0, react_1.useMemo)(() => runtimeDefinition(name), [runtimeDefinition, name]);
|
|
14
|
+
const [state, setState, getState] = (0, _1.useQpqRuntimeState)(runtimeDefinition, name);
|
|
15
|
+
// Get the parent dispatch from the context
|
|
16
|
+
const parentDispatch = (0, react_1.useContext)(BubbleReducerDispatchContext);
|
|
17
|
+
// Custom Dispatch using functional updates
|
|
18
|
+
const dispatch = (0, useFastCallback_1.useFastCallback)((action) => {
|
|
19
|
+
const [newState, preventBubble] = runtimeDefinitionInfo.reducer(getState(), action);
|
|
20
|
+
if (preventBubble) {
|
|
21
|
+
setState(newState);
|
|
22
|
+
}
|
|
23
|
+
else {
|
|
24
|
+
parentDispatch(action);
|
|
25
|
+
}
|
|
26
|
+
});
|
|
27
|
+
return [state, dispatch, getState];
|
|
28
|
+
};
|
|
29
|
+
exports.useQpqRuntimeBubblingReducer = useQpqRuntimeBubblingReducer;
|
|
30
|
+
const QpqRuntimeEffectCatcherComponent = ({ children, runtime, name, }) => {
|
|
31
|
+
const [api, state, dispatch] = (0, _1.useQpqRuntime)(runtime, undefined, name);
|
|
32
|
+
return (0, jsx_runtime_1.jsx)(BubbleReducerDispatchContext.Provider, { value: dispatch, children: children });
|
|
33
|
+
};
|
|
34
|
+
exports.QpqRuntimeEffectCatcherComponent = QpqRuntimeEffectCatcherComponent;
|
|
35
|
+
exports.QpqRuntimeEffectCatcher = (0, react_1.memo)(exports.QpqRuntimeEffectCatcherComponent);
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { ActionProcessorListResolver } from 'quidproquo-core';
|
|
2
|
-
import { Dispatch } from 'react';
|
|
3
|
-
export declare const getStateDispatchActionListResolver: (dispatch: Dispatch<any>) => ActionProcessorListResolver;
|
|
1
|
+
import { ActionProcessorListResolver } from 'quidproquo-core';
|
|
2
|
+
import { Dispatch } from 'react';
|
|
3
|
+
export declare const getStateDispatchActionListResolver: (dispatch: Dispatch<any>) => ActionProcessorListResolver;
|
|
@@ -1,23 +1,23 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
-
});
|
|
10
|
-
};
|
|
11
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.getStateDispatchActionListResolver = void 0;
|
|
13
|
-
const quidproquo_core_1 = require("quidproquo-core");
|
|
14
|
-
const getProcessStateDispatch = (dispatch) => (
|
|
15
|
-
dispatch(action);
|
|
16
|
-
return (0, quidproquo_core_1.actionResult)(undefined);
|
|
17
|
-
});
|
|
18
|
-
const getStateDispatchActionListResolver = (dispatch) => (_qpqConfig, _dynamicModuleLoader) => __awaiter(void 0, void 0, void 0, function* () {
|
|
19
|
-
return ({
|
|
20
|
-
[quidproquo_core_1.StateActionType.Dispatch]: getProcessStateDispatch(dispatch),
|
|
21
|
-
});
|
|
22
|
-
});
|
|
23
|
-
exports.getStateDispatchActionListResolver = getStateDispatchActionListResolver;
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.getStateDispatchActionListResolver = void 0;
|
|
13
|
+
const quidproquo_core_1 = require("quidproquo-core");
|
|
14
|
+
const getProcessStateDispatch = (dispatch) => (_a) => __awaiter(void 0, [_a], void 0, function* ({ action }) {
|
|
15
|
+
dispatch(action);
|
|
16
|
+
return (0, quidproquo_core_1.actionResult)(undefined);
|
|
17
|
+
});
|
|
18
|
+
const getStateDispatchActionListResolver = (dispatch) => (_qpqConfig, _dynamicModuleLoader) => __awaiter(void 0, void 0, void 0, function* () {
|
|
19
|
+
return ({
|
|
20
|
+
[quidproquo_core_1.StateActionType.Dispatch]: getProcessStateDispatch(dispatch),
|
|
21
|
+
});
|
|
22
|
+
});
|
|
23
|
+
exports.getStateDispatchActionListResolver = getStateDispatchActionListResolver;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { ActionProcessorListResolver } from 'quidproquo-core';
|
|
2
|
-
export declare const getStateReadActionListResolver: <State>(getCurrentState: () => State) => ActionProcessorListResolver;
|
|
1
|
+
import { ActionProcessorListResolver } from 'quidproquo-core';
|
|
2
|
+
export declare const getStateReadActionListResolver: <State>(getCurrentState: () => State) => ActionProcessorListResolver;
|
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
-
});
|
|
10
|
-
};
|
|
11
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.getStateReadActionListResolver = void 0;
|
|
13
|
-
const quidproquo_core_1 = require("quidproquo-core");
|
|
14
|
-
const getProcessStateRead = (getCurrentState) => () => __awaiter(void 0, void 0, void 0, function* () {
|
|
15
|
-
return (0, quidproquo_core_1.actionResult)(getCurrentState());
|
|
16
|
-
});
|
|
17
|
-
const getStateReadActionListResolver = (getCurrentState) => (_qpqConfig, _dynamicModuleLoader) => __awaiter(void 0, void 0, void 0, function* () {
|
|
18
|
-
return ({
|
|
19
|
-
[quidproquo_core_1.StateActionType.Read]: getProcessStateRead(getCurrentState),
|
|
20
|
-
});
|
|
21
|
-
});
|
|
22
|
-
exports.getStateReadActionListResolver = getStateReadActionListResolver;
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.getStateReadActionListResolver = void 0;
|
|
13
|
+
const quidproquo_core_1 = require("quidproquo-core");
|
|
14
|
+
const getProcessStateRead = (getCurrentState) => () => __awaiter(void 0, void 0, void 0, function* () {
|
|
15
|
+
return (0, quidproquo_core_1.actionResult)(getCurrentState());
|
|
16
|
+
});
|
|
17
|
+
const getStateReadActionListResolver = (getCurrentState) => (_qpqConfig, _dynamicModuleLoader) => __awaiter(void 0, void 0, void 0, function* () {
|
|
18
|
+
return ({
|
|
19
|
+
[quidproquo_core_1.StateActionType.Read]: getProcessStateRead(getCurrentState),
|
|
20
|
+
});
|
|
21
|
+
});
|
|
22
|
+
exports.getStateReadActionListResolver = getStateReadActionListResolver;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { ActionProcessorListResolver } from 'quidproquo-core';
|
|
2
|
-
import { Dispatch } from 'react';
|
|
3
|
-
export declare const getStateActionProcessor: <State>(dispatch: Dispatch<any>, getCurrentState: () => State) => ActionProcessorListResolver;
|
|
1
|
+
import { ActionProcessorListResolver } from 'quidproquo-core';
|
|
2
|
+
import { Dispatch } from 'react';
|
|
3
|
+
export declare const getStateActionProcessor: <State>(dispatch: Dispatch<any>, getCurrentState: () => State) => ActionProcessorListResolver;
|
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
-
});
|
|
10
|
-
};
|
|
11
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.getStateActionProcessor = void 0;
|
|
13
|
-
const getStateDispatchActionProcessor_1 = require("./getStateDispatchActionProcessor");
|
|
14
|
-
const getStateReadActionProcessor_1 = require("./getStateReadActionProcessor");
|
|
15
|
-
const getStateActionProcessor = (dispatch, getCurrentState) => (qpqConfig, dynamicModuleLoader) => __awaiter(void 0, void 0, void 0, function* () {
|
|
16
|
-
return (Object.assign(Object.assign({}, (yield (0, getStateDispatchActionProcessor_1.getStateDispatchActionListResolver)(dispatch)(qpqConfig, dynamicModuleLoader))), (yield (0, getStateReadActionProcessor_1.getStateReadActionListResolver)(getCurrentState)(qpqConfig, dynamicModuleLoader))));
|
|
17
|
-
});
|
|
18
|
-
exports.getStateActionProcessor = getStateActionProcessor;
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.getStateActionProcessor = void 0;
|
|
13
|
+
const getStateDispatchActionProcessor_1 = require("./getStateDispatchActionProcessor");
|
|
14
|
+
const getStateReadActionProcessor_1 = require("./getStateReadActionProcessor");
|
|
15
|
+
const getStateActionProcessor = (dispatch, getCurrentState) => (qpqConfig, dynamicModuleLoader) => __awaiter(void 0, void 0, void 0, function* () {
|
|
16
|
+
return (Object.assign(Object.assign({}, (yield (0, getStateDispatchActionProcessor_1.getStateDispatchActionListResolver)(dispatch)(qpqConfig, dynamicModuleLoader))), (yield (0, getStateReadActionProcessor_1.getStateReadActionListResolver)(getCurrentState)(qpqConfig, dynamicModuleLoader))));
|
|
17
|
+
});
|
|
18
|
+
exports.getStateActionProcessor = getStateActionProcessor;
|
|
@@ -1,16 +1,22 @@
|
|
|
1
|
-
import { atom } from 'jotai';
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
export
|
|
1
|
+
import { atom } from 'jotai';
|
|
2
|
+
import { selectAtom } from 'jotai/utils';
|
|
3
|
+
import { QpqApi } from './QpqMappedApi';
|
|
4
|
+
import { QpqBubbleReducer } from './QpqRuntimeEffectCatcher';
|
|
5
|
+
type CustomJotaiReducerAtom<TState> = ReturnType<typeof atom<TState>>;
|
|
6
|
+
type CustomJotaiComputedAtom<TState, TSlice> = ReturnType<typeof selectAtom<TState, TSlice>>;
|
|
7
|
+
export type QpqAsmjState<TState, TAction, TApi extends QpqApi> = {
|
|
8
|
+
atom: CustomJotaiReducerAtom<TState>;
|
|
9
|
+
reducer: QpqBubbleReducer<TState, TAction>;
|
|
10
|
+
initialState: TState;
|
|
11
|
+
api: TApi;
|
|
12
|
+
state: TState;
|
|
13
|
+
};
|
|
14
|
+
type AsmjStateGetter<TState, TAction, TApi extends QpqApi> = (name?: string) => QpqAsmjState<TState, TAction, TApi>;
|
|
15
|
+
type AsmjStateComputer<TState, TSlice> = (name?: string) => CustomJotaiComputedAtom<TState, TSlice>;
|
|
16
|
+
export type QpqRuntimeDefinition<TState, TAction, TApi extends QpqApi> = AsmjStateGetter<TState, TAction, TApi>;
|
|
17
|
+
export type QpqRuntimeComputed<TState, TSlice> = AsmjStateComputer<TState, TSlice>;
|
|
18
|
+
export declare function createQpqRuntimeDefinition<TState, TAction, TApi extends QpqApi>(api: TApi, initialState: TState, reducer?: QpqBubbleReducer<TState, TAction>): QpqRuntimeDefinition<TState, TAction, TApi>;
|
|
19
|
+
export declare function createQpqRuntimeComputed<TState, TAction, TApi extends QpqApi, TSlice>(atom: QpqRuntimeDefinition<TState, TAction, TApi>, compute: (state: TState) => TSlice): QpqRuntimeComputed<TState, TSlice>;
|
|
20
|
+
export declare function useQpqRuntimeState<TState, TAction, TApi extends QpqApi>(atom: QpqRuntimeDefinition<TState, TAction, TApi>, name?: string): [TState, (newState: TState) => void, () => TState];
|
|
21
|
+
export declare function useQpqRuntimeComputed<TState, TSlice>(computedAtom: QpqRuntimeComputed<TState, TSlice>, name?: string): TSlice;
|
|
22
|
+
export {};
|
|
@@ -1,39 +1,52 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
info
|
|
31
|
-
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.createQpqRuntimeDefinition = createQpqRuntimeDefinition;
|
|
4
|
+
exports.createQpqRuntimeComputed = createQpqRuntimeComputed;
|
|
5
|
+
exports.useQpqRuntimeState = useQpqRuntimeState;
|
|
6
|
+
exports.useQpqRuntimeComputed = useQpqRuntimeComputed;
|
|
7
|
+
const react_1 = require("react");
|
|
8
|
+
const jotai_1 = require("jotai");
|
|
9
|
+
const utils_1 = require("jotai/utils");
|
|
10
|
+
function createQpqRuntimeDefinition(api, initialState, reducer = (s) => [s, false]) {
|
|
11
|
+
const namedAtoms = new Map();
|
|
12
|
+
const getCustomNamedAtom = (name) => {
|
|
13
|
+
const actualName = name ? name : '$$qpq-default$$';
|
|
14
|
+
if (!namedAtoms.has(actualName)) {
|
|
15
|
+
const winAtom = {
|
|
16
|
+
atom: (0, jotai_1.atom)(initialState),
|
|
17
|
+
reducer,
|
|
18
|
+
initialState,
|
|
19
|
+
api: api,
|
|
20
|
+
state: initialState,
|
|
21
|
+
};
|
|
22
|
+
namedAtoms.set(actualName, winAtom);
|
|
23
|
+
}
|
|
24
|
+
return namedAtoms.get(actualName);
|
|
25
|
+
};
|
|
26
|
+
return getCustomNamedAtom;
|
|
27
|
+
}
|
|
28
|
+
function createQpqRuntimeComputed(atom, compute) {
|
|
29
|
+
return (name) => {
|
|
30
|
+
const info = atom(name);
|
|
31
|
+
return (0, utils_1.selectAtom)(info.atom, compute);
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
function useQpqRuntimeState(atom, name) {
|
|
35
|
+
const actualAtom = (0, react_1.useMemo)(() => atom(name).atom, [atom, name]);
|
|
36
|
+
const [state, setState] = (0, jotai_1.useAtom)(actualAtom);
|
|
37
|
+
const setStateWrapper = (0, react_1.useCallback)((newState) => {
|
|
38
|
+
const info = atom(name);
|
|
39
|
+
info.state = newState;
|
|
40
|
+
setState(newState);
|
|
41
|
+
}, [setState]);
|
|
42
|
+
const getState = (0, react_1.useCallback)(() => {
|
|
43
|
+
const state = atom(name).state;
|
|
44
|
+
return state;
|
|
45
|
+
}, [atom, name]);
|
|
46
|
+
return [state, setStateWrapper, getState];
|
|
47
|
+
}
|
|
48
|
+
function useQpqRuntimeComputed(computedAtom, name) {
|
|
49
|
+
const computedAtomValue = (0, react_1.useMemo)(() => computedAtom(name), [computedAtom, name]);
|
|
50
|
+
const [state] = (0, jotai_1.useAtom)(computedAtomValue);
|
|
51
|
+
return state;
|
|
52
|
+
}
|