@payloadcms/plugin-search 3.8.0 → 3.9.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.
|
@@ -11,13 +11,13 @@ export const LinkToDocClient = ()=>{
|
|
|
11
11
|
const { value } = useField({
|
|
12
12
|
path: 'doc'
|
|
13
13
|
});
|
|
14
|
+
if (!value?.relationTo || !value?.value) {
|
|
15
|
+
return null;
|
|
16
|
+
}
|
|
14
17
|
const href = `${serverURL}${formatAdminURL({
|
|
15
18
|
adminRoute,
|
|
16
19
|
path: `/collections/${value.relationTo || ''}/${value.value || ''}`
|
|
17
20
|
})}`;
|
|
18
|
-
if (!value.relationTo || !value.value) {
|
|
19
|
-
return null;
|
|
20
|
-
}
|
|
21
21
|
return /*#__PURE__*/ _jsxs("div", {
|
|
22
22
|
style: {
|
|
23
23
|
marginBottom: 'var(--spacing-field, 1rem)'
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/Search/ui/LinkToDoc/index.client.tsx"],"sourcesContent":["'use client'\n\nimport { useConfig, useField } 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\nexport const LinkToDocClient: React.FC = () => {\n const { config } = useConfig()\n\n const {\n routes: {\n admin: adminRoute, // already includes leading slash\n },\n serverURL,\n } = config\n\n const { value } = useField<{ relationTo?: string; value?: string }>({ path: 'doc' })\n\n const href = `${serverURL}${formatAdminURL({\n adminRoute,\n path: `/collections/${value.relationTo || ''}/${value.value || ''}`,\n })}`\n\n
|
|
1
|
+
{"version":3,"sources":["../../../../src/Search/ui/LinkToDoc/index.client.tsx"],"sourcesContent":["'use client'\n\nimport { useConfig, useField } 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\nexport const LinkToDocClient: React.FC = () => {\n const { config } = useConfig()\n\n const {\n routes: {\n admin: adminRoute, // already includes leading slash\n },\n serverURL,\n } = config\n\n const { value } = useField<{ relationTo?: string; value?: string }>({ path: 'doc' })\n\n if (!value?.relationTo || !value?.value) {\n return null\n }\n\n const href = `${serverURL}${formatAdminURL({\n adminRoute,\n path: `/collections/${value.relationTo || ''}/${value.value || ''}`,\n })}`\n\n return (\n <div style={{ marginBottom: 'var(--spacing-field, 1rem)' }}>\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} target=\"_blank\">\n {href}\n </a>\n </div>\n </div>\n )\n}\n"],"names":["useConfig","useField","formatAdminURL","React","LinkToDocClient","config","routes","admin","adminRoute","serverURL","value","path","relationTo","href","div","style","marginBottom","span","className","color","fontWeight","overflow","textOverflow","a","target"],"mappings":"AAAA;;AAEA,SAASA,SAAS,EAAEC,QAAQ,QAAQ,iBAAgB;AACpD,SAASC,cAAc,QAAQ,wBAAuB;AACtD,OAAOC,WAAW,QAAO;AACzB,+GAA+G;AAC/G,uFAAuF;AAEvF,OAAO,MAAMC,kBAA4B;IACvC,MAAM,EAAEC,MAAM,EAAE,GAAGL;IAEnB,MAAM,EACJM,QAAQ,EACNC,OAAOC,UAAU,EAClB,EACDC,SAAS,EACV,GAAGJ;IAEJ,MAAM,EAAEK,KAAK,EAAE,GAAGT,SAAkD;QAAEU,MAAM;IAAM;IAElF,IAAI,CAACD,OAAOE,cAAc,CAACF,OAAOA,OAAO;QACvC,OAAO;IACT;IAEA,MAAMG,OAAO,GAAGJ,YAAYP,eAAe;QACzCM;QACAG,MAAM,CAAC,aAAa,EAAED,MAAME,UAAU,IAAI,GAAG,CAAC,EAAEF,MAAMA,KAAK,IAAI,IAAI;IACrE,IAAI;IAEJ,qBACE,MAACI;QAAIC,OAAO;YAAEC,cAAc;QAA6B;;0BACvD,KAACF;0BACC,cAAA,KAACG;oBACCC,WAAU;oBACVH,OAAO;wBACLI,OAAO;oBACT;8BACD;;;0BAKH,KAACL;gBACCC,OAAO;oBACLK,YAAY;oBACZC,UAAU;oBACVC,cAAc;gBAChB;0BAEA,cAAA,KAACC;oBAAEV,MAAMA;oBAAMW,QAAO;8BACnBX;;;;;AAKX,EAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@payloadcms/plugin-search",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.9.0",
|
|
4
4
|
"description": "Search plugin for Payload",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"payload",
|
|
@@ -49,19 +49,19 @@
|
|
|
49
49
|
"dist"
|
|
50
50
|
],
|
|
51
51
|
"dependencies": {
|
|
52
|
-
"@payloadcms/next": "3.
|
|
53
|
-
"@payloadcms/ui": "3.
|
|
52
|
+
"@payloadcms/next": "3.9.0",
|
|
53
|
+
"@payloadcms/ui": "3.9.0"
|
|
54
54
|
},
|
|
55
55
|
"devDependencies": {
|
|
56
56
|
"@types/react": "19.0.1",
|
|
57
57
|
"@types/react-dom": "19.0.1",
|
|
58
58
|
"@payloadcms/eslint-config": "3.0.0",
|
|
59
|
-
"payload": "3.
|
|
59
|
+
"payload": "3.9.0"
|
|
60
60
|
},
|
|
61
61
|
"peerDependencies": {
|
|
62
62
|
"react": "^19.0.0 || ^19.0.0-rc-65a56d0e-20241020",
|
|
63
63
|
"react-dom": "^19.0.0 || ^19.0.0-rc-65a56d0e-20241020",
|
|
64
|
-
"payload": "3.
|
|
64
|
+
"payload": "3.9.0"
|
|
65
65
|
},
|
|
66
66
|
"publishConfig": {
|
|
67
67
|
"registry": "https://registry.npmjs.org/"
|
|
File without changes
|