@ph-cms/client-sdk 0.1.0 → 0.1.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/dist/context.d.ts +2 -0
- package/dist/context.js +5 -2
- package/dist/hooks/useContent.d.ts +1 -1
- package/package.json +2 -3
package/dist/context.d.ts
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import React, { ReactNode } from 'react';
|
|
2
|
+
import { QueryClient } from '@tanstack/react-query';
|
|
2
3
|
import { PHCMSClient } from './client';
|
|
3
4
|
export interface PHCMSProviderProps {
|
|
4
5
|
client: PHCMSClient;
|
|
6
|
+
queryClient?: QueryClient;
|
|
5
7
|
children: ReactNode;
|
|
6
8
|
}
|
|
7
9
|
export declare const PHCMSProvider: React.FC<PHCMSProviderProps>;
|
package/dist/context.js
CHANGED
|
@@ -35,9 +35,12 @@ var __importStar = (this && this.__importStar) || (function () {
|
|
|
35
35
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
36
|
exports.usePHCMS = exports.PHCMSProvider = void 0;
|
|
37
37
|
const react_1 = __importStar(require("react"));
|
|
38
|
+
const react_query_1 = require("@tanstack/react-query");
|
|
38
39
|
const PHCMSContext = (0, react_1.createContext)(null);
|
|
39
|
-
const PHCMSProvider = ({ client, children }) => {
|
|
40
|
-
|
|
40
|
+
const PHCMSProvider = ({ client, queryClient, children }) => {
|
|
41
|
+
const internalQueryClient = (0, react_1.useMemo)(() => queryClient ?? new react_query_1.QueryClient(), [queryClient]);
|
|
42
|
+
return (react_1.default.createElement(PHCMSContext.Provider, { value: { client } },
|
|
43
|
+
react_1.default.createElement(react_query_1.QueryClientProvider, { client: internalQueryClient }, children)));
|
|
41
44
|
};
|
|
42
45
|
exports.PHCMSProvider = PHCMSProvider;
|
|
43
46
|
const usePHCMS = () => {
|
|
@@ -9,8 +9,8 @@ export declare const contentKeys: {
|
|
|
9
9
|
type?: string | undefined;
|
|
10
10
|
tags?: string[] | undefined;
|
|
11
11
|
channelUid?: string | undefined;
|
|
12
|
-
channelSlug?: string | undefined;
|
|
13
12
|
parentUid?: string | undefined;
|
|
13
|
+
authorUid?: string | undefined;
|
|
14
14
|
rootUid?: string | undefined;
|
|
15
15
|
keyword?: string | undefined;
|
|
16
16
|
orderBy?: "created_at" | "updated_at" | "published_at" | "title" | "view_count" | "like_count" | undefined;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ph-cms/client-sdk",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.1",
|
|
4
4
|
"description": "Unified PH-CMS Client SDK (React + Core)",
|
|
5
5
|
"keywords": [],
|
|
6
6
|
"license": "MIT",
|
|
@@ -22,11 +22,11 @@
|
|
|
22
22
|
],
|
|
23
23
|
"dependencies": {
|
|
24
24
|
"@ph-cms/api-contract": "^0.1.0",
|
|
25
|
+
"@tanstack/react-query": "^5.0.0",
|
|
25
26
|
"axios": "^1.6.0",
|
|
26
27
|
"zod": "^3.22.4"
|
|
27
28
|
},
|
|
28
29
|
"devDependencies": {
|
|
29
|
-
"@tanstack/react-query": "^5.0.0",
|
|
30
30
|
"@types/react": "^18.3.1",
|
|
31
31
|
"@types/react-dom": "^18.3.1",
|
|
32
32
|
"firebase": "^10.0.0",
|
|
@@ -35,7 +35,6 @@
|
|
|
35
35
|
"typescript": "^5.3.3"
|
|
36
36
|
},
|
|
37
37
|
"peerDependencies": {
|
|
38
|
-
"@tanstack/react-query": "^5.0.0",
|
|
39
38
|
"react": ">=18.0.0",
|
|
40
39
|
"firebase": "^10.0.0"
|
|
41
40
|
},
|