@payloadcms/plugin-search 3.0.0-beta.68 → 3.0.0-beta.69
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.client.d.ts","sourceRoot":"","sources":["../../../src/Search/ui/index.client.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.client.d.ts","sourceRoot":"","sources":["../../../src/Search/ui/index.client.tsx"],"names":[],"mappings":"AAMA,OAAO,KAAK,MAAM,OAAO,CAAA;AAazB,eAAO,MAAM,eAAe,EAAE,KAAK,CAAC,EAgDnC,CAAA"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
3
|
import { useConfig, useWatchForm } from '@payloadcms/ui';
|
|
4
|
+
import { formatAdminURL } from '@payloadcms/ui/shared';
|
|
4
5
|
import React from 'react';
|
|
5
6
|
export const LinkToDocClient = ()=>{
|
|
6
7
|
const form = useWatchForm();
|
|
@@ -8,7 +9,10 @@ export const LinkToDocClient = ()=>{
|
|
|
8
9
|
const { doc: { value: { relationTo, value: docId } } } = fields;
|
|
9
10
|
const config = useConfig();
|
|
10
11
|
const { routes: { admin: adminRoute }, serverURL } = config;
|
|
11
|
-
const href = `${serverURL}${
|
|
12
|
+
const href = `${serverURL}${formatAdminURL({
|
|
13
|
+
adminRoute,
|
|
14
|
+
path: '/collections/${relationTo}/${docId}'
|
|
15
|
+
})}`;
|
|
12
16
|
return /*#__PURE__*/ _jsxs("div", {
|
|
13
17
|
children: [
|
|
14
18
|
/*#__PURE__*/ _jsx("div", {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/Search/ui/index.client.tsx"],"sourcesContent":["'use client'\n\nimport type { FormState } from 'payload'\n\nimport { useConfig, useWatchForm } from '@payloadcms/ui'\nimport React from 'react'\n// TODO: fix this import to work in dev mode within the monorepo in a way that is backwards compatible with 1.x\n// import CopyToClipboard from 'payload/dist/admin/components/elements/CopyToClipboard'\n\ntype FieldsWithDoc = {\n doc: {\n value: {\n relationTo: string\n value: string\n }\n }\n} & FormState\n\nexport const LinkToDocClient: React.FC = () => {\n const form = useWatchForm()\n const fields = form.fields as FieldsWithDoc\n\n const {\n doc: {\n value: { relationTo, value: docId },\n },\n } = fields\n\n const config = useConfig()\n\n const {\n routes: {\n admin: adminRoute, // already includes leading slash\n },\n serverURL,\n } = config\n\n const href = `${serverURL}${adminRoute
|
|
1
|
+
{"version":3,"sources":["../../../src/Search/ui/index.client.tsx"],"sourcesContent":["'use client'\n\nimport type { FormState } from 'payload'\n\nimport { useConfig, useWatchForm } from '@payloadcms/ui'\nimport { formatAdminURL } from '@payloadcms/ui/shared'\nimport React from 'react'\n// TODO: fix this import to work in dev mode within the monorepo in a way that is backwards compatible with 1.x\n// import CopyToClipboard from 'payload/dist/admin/components/elements/CopyToClipboard'\n\ntype FieldsWithDoc = {\n doc: {\n value: {\n relationTo: string\n value: string\n }\n }\n} & FormState\n\nexport const LinkToDocClient: React.FC = () => {\n const form = useWatchForm()\n const fields = form.fields as FieldsWithDoc\n\n const {\n doc: {\n value: { relationTo, value: docId },\n },\n } = fields\n\n const config = useConfig()\n\n const {\n routes: {\n admin: adminRoute, // already includes leading slash\n },\n serverURL,\n } = config\n\n const href = `${serverURL}${formatAdminURL({\n adminRoute,\n path: '/collections/${relationTo}/${docId}',\n })}`\n\n return (\n <div>\n <div>\n <span\n className=\"label\"\n style={{\n color: '#9A9A9A',\n }}\n >\n Doc URL\n </span>\n {/* <CopyToClipboard value={href} /> */}\n </div>\n <div\n style={{\n fontWeight: '600',\n overflow: 'hidden',\n textOverflow: 'ellipsis',\n }}\n >\n <a href={href}>{href}</a>\n </div>\n </div>\n )\n}\n"],"names":["useConfig","useWatchForm","formatAdminURL","React","LinkToDocClient","form","fields","doc","value","relationTo","docId","config","routes","admin","adminRoute","serverURL","href","path","div","span","className","style","color","fontWeight","overflow","textOverflow","a"],"mappings":"AAAA;;AAIA,SAASA,SAAS,EAAEC,YAAY,QAAQ,iBAAgB;AACxD,SAASC,cAAc,QAAQ,wBAAuB;AACtD,OAAOC,WAAW,QAAO;AAazB,OAAO,MAAMC,kBAA4B;IACvC,MAAMC,OAAOJ;IACb,MAAMK,SAASD,KAAKC,MAAM;IAE1B,MAAM,EACJC,KAAK,EACHC,OAAO,EAAEC,UAAU,EAAED,OAAOE,KAAK,EAAE,EACpC,EACF,GAAGJ;IAEJ,MAAMK,SAASX;IAEf,MAAM,EACJY,QAAQ,EACNC,OAAOC,UAAU,EAClB,EACDC,SAAS,EACV,GAAGJ;IAEJ,MAAMK,OAAO,CAAC,EAAED,UAAU,EAAEb,eAAe;QACzCY;QACAG,MAAM;IACR,GAAG,CAAC;IAEJ,qBACE,MAACC;;0BACC,KAACA;0BACC,cAAA,KAACC;oBACCC,WAAU;oBACVC,OAAO;wBACLC,OAAO;oBACT;8BACD;;;0BAKH,KAACJ;gBACCG,OAAO;oBACLE,YAAY;oBACZC,UAAU;oBACVC,cAAc;gBAChB;0BAEA,cAAA,KAACC;oBAAEV,MAAMA;8BAAOA;;;;;AAIxB,EAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@payloadcms/plugin-search",
|
|
3
|
-
"version": "3.0.0-beta.
|
|
3
|
+
"version": "3.0.0-beta.69",
|
|
4
4
|
"description": "Search plugin for Payload",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"payload",
|
|
@@ -37,19 +37,19 @@
|
|
|
37
37
|
"dist"
|
|
38
38
|
],
|
|
39
39
|
"dependencies": {
|
|
40
|
-
"@payloadcms/ui": "3.0.0-beta.
|
|
40
|
+
"@payloadcms/ui": "3.0.0-beta.69"
|
|
41
41
|
},
|
|
42
42
|
"devDependencies": {
|
|
43
43
|
"@types/express": "^4.17.9",
|
|
44
44
|
"@types/react": "npm:types-react@19.0.0-rc.0",
|
|
45
45
|
"@types/react-dom": "npm:types-react-dom@19.0.0-rc.0",
|
|
46
|
-
"payload": "3.0.0-beta.
|
|
46
|
+
"payload": "3.0.0-beta.69",
|
|
47
47
|
"@payloadcms/eslint-config": "3.0.0-beta.59"
|
|
48
48
|
},
|
|
49
49
|
"peerDependencies": {
|
|
50
50
|
"react": "^19.0.0 || ^19.0.0-rc-6230622a1a-20240610",
|
|
51
51
|
"react-dom": "^19.0.0 || ^19.0.0-rc-6230622a1a-20240610",
|
|
52
|
-
"payload": "3.0.0-beta.
|
|
52
|
+
"payload": "3.0.0-beta.69"
|
|
53
53
|
},
|
|
54
54
|
"publishConfig": {
|
|
55
55
|
"registry": "https://registry.npmjs.org/"
|