@focus-reactive/payload-plugin-comments 1.3.0 → 1.4.0
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.
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/providers/CommentsProviderWrapper/index.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAY,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAOjD,UAAU,KAAK;IACb,QAAQ,EAAE,SAAS,CAAC;CACrB;AAED,wBAAgB,uBAAuB,CAAC,EAAE,QAAQ,EAAE,EAAE,KAAK,2CAuB1D"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/providers/CommentsProviderWrapper/index.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAY,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAOjD,OAAO,kBAAkB,CAAC;AAE1B,UAAU,KAAK;IACb,QAAQ,EAAE,SAAS,CAAC;CACrB;AAED,wBAAgB,uBAAuB,CAAC,EAAE,QAAQ,EAAE,EAAE,KAAK,2CAuB1D"}
|
|
@@ -5,6 +5,7 @@ import { QueryClient, QueryClientProvider } from "@tanstack/react-query";
|
|
|
5
5
|
import { useConfig } from "@payloadcms/ui";
|
|
6
6
|
import { CommentsDrawerProvider } from "../CommentsDrawerProvider";
|
|
7
7
|
import { CommentsProvider } from "../CommentsProvider";
|
|
8
|
+
import "../../styles.css";
|
|
8
9
|
function CommentsProviderWrapper({ children }) {
|
|
9
10
|
const { config } = useConfig();
|
|
10
11
|
const [queryClient] = useState(
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/providers/CommentsProviderWrapper/index.tsx"],"sourcesContent":["\"use client\";\n\nimport { useState, type ReactNode } from \"react\";\nimport { QueryClient, QueryClientProvider } from \"@tanstack/react-query\";\nimport { useConfig } from \"@payloadcms/ui\";\nimport { CommentsDrawerProvider } from \"../CommentsDrawerProvider\";\nimport { CommentsProvider } from \"../CommentsProvider\";\nimport type { CommentsPluginConfigStorage } from \"../../types\";\n\ninterface Props {\n children: ReactNode;\n}\n\nexport function CommentsProviderWrapper({ children }: Props) {\n const { config } = useConfig();\n const [queryClient] = useState(\n () =>\n new QueryClient({\n defaultOptions: {\n queries: { retry: 1 },\n mutations: { retry: 0 },\n },\n }),\n );\n\n const pluginConfig = config.admin?.custom?.commentsPlugin as CommentsPluginConfigStorage | undefined;\n const usernameFieldRawPath = pluginConfig?.usernameFieldPath;\n const usernameFieldPath = usernameFieldRawPath === \"\" ? undefined : usernameFieldRawPath;\n\n return (\n <QueryClientProvider client={queryClient}>\n <CommentsProvider usernameFieldPath={usernameFieldPath}>\n <CommentsDrawerProvider>{children}</CommentsDrawerProvider>\n </CommentsProvider>\n </QueryClientProvider>\n );\n}\n"],"mappings":";
|
|
1
|
+
{"version":3,"sources":["../../../src/providers/CommentsProviderWrapper/index.tsx"],"sourcesContent":["\"use client\";\n\nimport { useState, type ReactNode } from \"react\";\nimport { QueryClient, QueryClientProvider } from \"@tanstack/react-query\";\nimport { useConfig } from \"@payloadcms/ui\";\nimport { CommentsDrawerProvider } from \"../CommentsDrawerProvider\";\nimport { CommentsProvider } from \"../CommentsProvider\";\nimport type { CommentsPluginConfigStorage } from \"../../types\";\n\nimport \"../../styles.css\";\n\ninterface Props {\n children: ReactNode;\n}\n\nexport function CommentsProviderWrapper({ children }: Props) {\n const { config } = useConfig();\n const [queryClient] = useState(\n () =>\n new QueryClient({\n defaultOptions: {\n queries: { retry: 1 },\n mutations: { retry: 0 },\n },\n }),\n );\n\n const pluginConfig = config.admin?.custom?.commentsPlugin as CommentsPluginConfigStorage | undefined;\n const usernameFieldRawPath = pluginConfig?.usernameFieldPath;\n const usernameFieldPath = usernameFieldRawPath === \"\" ? undefined : usernameFieldRawPath;\n\n return (\n <QueryClientProvider client={queryClient}>\n <CommentsProvider usernameFieldPath={usernameFieldPath}>\n <CommentsDrawerProvider>{children}</CommentsDrawerProvider>\n </CommentsProvider>\n </QueryClientProvider>\n );\n}\n"],"mappings":";AAkCQ;AAhCR,SAAS,gBAAgC;AACzC,SAAS,aAAa,2BAA2B;AACjD,SAAS,iBAAiB;AAC1B,SAAS,8BAA8B;AACvC,SAAS,wBAAwB;AAGjC,OAAO;AAMA,SAAS,wBAAwB,EAAE,SAAS,GAAU;AAC3D,QAAM,EAAE,OAAO,IAAI,UAAU;AAC7B,QAAM,CAAC,WAAW,IAAI;AAAA,IACpB,MACE,IAAI,YAAY;AAAA,MACd,gBAAgB;AAAA,QACd,SAAS,EAAE,OAAO,EAAE;AAAA,QACpB,WAAW,EAAE,OAAO,EAAE;AAAA,MACxB;AAAA,IACF,CAAC;AAAA,EACL;AAEA,QAAM,eAAe,OAAO,OAAO,QAAQ;AAC3C,QAAM,uBAAuB,cAAc;AAC3C,QAAM,oBAAoB,yBAAyB,KAAK,SAAY;AAEpE,SACE,oBAAC,uBAAoB,QAAQ,aAC3B,8BAAC,oBAAiB,mBAChB,8BAAC,0BAAwB,UAAS,GACpC,GACF;AAEJ;","names":[]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@focus-reactive/payload-plugin-comments",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.4.0",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"author": "FocusReactive <ship@focusreactive.com>",
|
|
6
6
|
"keywords": [
|
|
@@ -47,8 +47,7 @@
|
|
|
47
47
|
"./providers/CommentsProviderWrapper": {
|
|
48
48
|
"import": "./dist/providers/CommentsProviderWrapper/index.js",
|
|
49
49
|
"types": "./dist/providers/CommentsProviderWrapper/index.d.ts"
|
|
50
|
-
}
|
|
51
|
-
"./styles.css": "./dist/styles.css"
|
|
50
|
+
}
|
|
52
51
|
},
|
|
53
52
|
"scripts": {
|
|
54
53
|
"build": "node node_modules/tsup/dist/cli-default.js && tsc --emitDeclarationOnly --declarationMap",
|