@pushwoosh/smart-components-kit 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/context/index.d.ts +15 -0
- package/context/index.js +10 -0
- package/index.d.ts +0 -0
- package/index.js +1 -0
- package/package.json +41 -0
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { type History } from 'history';
|
|
2
|
+
import type { GrpcBridge } from '@pushwoosh/grpc-bridge';
|
|
3
|
+
import type { HttpClient, RpcClient, GrpcClient } from '@pushwoosh/http-client';
|
|
4
|
+
import type { SessionStore } from '@pushwoosh/session-store';
|
|
5
|
+
export type PushwooshSPAContextType = {
|
|
6
|
+
readonly history: History;
|
|
7
|
+
readonly httpClient: HttpClient;
|
|
8
|
+
readonly rpcClient: RpcClient;
|
|
9
|
+
readonly grpcClient: GrpcClient;
|
|
10
|
+
readonly grpcBridge: GrpcBridge;
|
|
11
|
+
readonly sessionStore: SessionStore;
|
|
12
|
+
};
|
|
13
|
+
export declare const PushwooshSPAContext: import("react").Context<PushwooshSPAContextType | undefined>;
|
|
14
|
+
export declare const PushwooshSPAContextProvider: import("react").Provider<PushwooshSPAContextType | undefined>;
|
|
15
|
+
export declare function usePushwooshSPAContext(): PushwooshSPAContextType;
|
package/context/index.js
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { createContext, useContext } from 'react';
|
|
2
|
+
export const PushwooshSPAContext = createContext(undefined);
|
|
3
|
+
export const PushwooshSPAContextProvider = PushwooshSPAContext.Provider;
|
|
4
|
+
export function usePushwooshSPAContext() {
|
|
5
|
+
const contextValue = useContext(PushwooshSPAContext);
|
|
6
|
+
if (!contextValue) {
|
|
7
|
+
throw new Error('usePushwooshSPAContext must be used within a PushwooshSPAContextProvider');
|
|
8
|
+
}
|
|
9
|
+
return contextValue;
|
|
10
|
+
}
|
package/index.d.ts
ADDED
|
File without changes
|
package/index.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";
|
package/package.json
ADDED
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@pushwoosh/smart-components-kit",
|
|
3
|
+
"main": "index.js",
|
|
4
|
+
"types": "index.d.ts",
|
|
5
|
+
"scripts": {
|
|
6
|
+
"start": "`pushwoosh-engine app:command:dev`",
|
|
7
|
+
"build": "pushwoosh-engine lib:build",
|
|
8
|
+
"check": "npm run check:lint && npm run check:types",
|
|
9
|
+
"check:lint": "echo \"Run check:lint\" && NODE_ENV=production eslint ./src",
|
|
10
|
+
"check:lint-fix": "echo \"Run check:lint\" && NODE_ENV=production eslint . --fix",
|
|
11
|
+
"check:types": "echo \"Run check:types\" && tsc --project tsconfig.json --skipLibCheck --emitDeclarationOnly false --noEmit"
|
|
12
|
+
},
|
|
13
|
+
"pre-commit": "check",
|
|
14
|
+
"devDependencies": {
|
|
15
|
+
"@eslint/js": "^9.10.0",
|
|
16
|
+
"@pushwoosh/frontend-builder-engine": "^0.6.0",
|
|
17
|
+
"@pushwoosh/grpc-bridge": "^1.5.10",
|
|
18
|
+
"@pushwoosh/http-client": "^2.4.12",
|
|
19
|
+
"@pushwoosh/session-store": "^2.4.1",
|
|
20
|
+
"@types/eslint__js": "^8.42.3",
|
|
21
|
+
"@types/react": "^18.3.5",
|
|
22
|
+
"@types/react-dom": "^18.3.0",
|
|
23
|
+
"eslint": "^9.10.0",
|
|
24
|
+
"react": "^18.3.1",
|
|
25
|
+
"react-dom": "^18.3.1",
|
|
26
|
+
"typescript": "^5.6.2",
|
|
27
|
+
"typescript-eslint": "^8.5.0"
|
|
28
|
+
},
|
|
29
|
+
"peerDependencies": {
|
|
30
|
+
"@pushwoosh/grpc-bridge": "^1.5.10",
|
|
31
|
+
"@pushwoosh/http-client": "^2.4.12",
|
|
32
|
+
"@pushwoosh/session-store": "^2.4.1",
|
|
33
|
+
"react": "^18.0.0",
|
|
34
|
+
"react-dom": "^18.0.0",
|
|
35
|
+
"single-spa": "^5.9.3"
|
|
36
|
+
},
|
|
37
|
+
"engines": {
|
|
38
|
+
"node": ">= 18"
|
|
39
|
+
},
|
|
40
|
+
"version": "0.0.1"
|
|
41
|
+
}
|