@payloadcms/plugin-search 3.0.0-beta.35 → 3.0.0-beta.37
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/Search/ui/index.js +25 -14
- package/dist/Search/ui/index.js.map +1 -1
- package/package.json +12 -7
package/dist/Search/ui/index.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
1
2
|
import { useWatchForm } from '@payloadcms/ui/forms/Form';
|
|
2
3
|
import { useConfig } from '@payloadcms/ui/providers/Config';
|
|
3
4
|
import React from 'react';
|
|
@@ -8,20 +9,30 @@ export const LinkToDoc = ()=>{
|
|
|
8
9
|
const config = useConfig();
|
|
9
10
|
const { routes: { admin: adminRoute }, serverURL } = config;
|
|
10
11
|
const href = `${serverURL}${adminRoute}/collections/${relationTo}/${docId}`;
|
|
11
|
-
return /*#__PURE__*/
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
12
|
+
return /*#__PURE__*/ _jsxs("div", {
|
|
13
|
+
children: [
|
|
14
|
+
/*#__PURE__*/ _jsx("div", {
|
|
15
|
+
children: /*#__PURE__*/ _jsx("span", {
|
|
16
|
+
className: "label",
|
|
17
|
+
style: {
|
|
18
|
+
color: '#9A9A9A'
|
|
19
|
+
},
|
|
20
|
+
children: "Doc URL"
|
|
21
|
+
})
|
|
22
|
+
}),
|
|
23
|
+
/*#__PURE__*/ _jsx("div", {
|
|
24
|
+
style: {
|
|
25
|
+
fontWeight: '600',
|
|
26
|
+
overflow: 'hidden',
|
|
27
|
+
textOverflow: 'ellipsis'
|
|
28
|
+
},
|
|
29
|
+
children: /*#__PURE__*/ _jsx("a", {
|
|
30
|
+
href: href,
|
|
31
|
+
children: href
|
|
32
|
+
})
|
|
33
|
+
})
|
|
34
|
+
]
|
|
35
|
+
});
|
|
25
36
|
};
|
|
26
37
|
|
|
27
38
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/Search/ui/index.tsx"],"sourcesContent":["import type { FormState, UIField } from 'payload/types'\n\nimport { useWatchForm } from '@payloadcms/ui/forms/Form'\nimport { useConfig } from '@payloadcms/ui/providers/Config'\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 = FormState & {\n doc: {\n value: {\n relationTo: string\n value: string\n }\n }\n}\n\nexport const LinkToDoc: React.FC<UIField> = () => {\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}/collections/${relationTo}/${docId}`\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":["useWatchForm","useConfig","React","LinkToDoc","form","fields","doc","value","relationTo","docId","config","routes","admin","adminRoute","serverURL","href","div","span","className","style","color","fontWeight","overflow","textOverflow","a"],"rangeMappings":"
|
|
1
|
+
{"version":3,"sources":["../../../src/Search/ui/index.tsx"],"sourcesContent":["import type { FormState, UIField } from 'payload/types'\n\nimport { useWatchForm } from '@payloadcms/ui/forms/Form'\nimport { useConfig } from '@payloadcms/ui/providers/Config'\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 = FormState & {\n doc: {\n value: {\n relationTo: string\n value: string\n }\n }\n}\n\nexport const LinkToDoc: React.FC<UIField> = () => {\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}/collections/${relationTo}/${docId}`\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":["useWatchForm","useConfig","React","LinkToDoc","form","fields","doc","value","relationTo","docId","config","routes","admin","adminRoute","serverURL","href","div","span","className","style","color","fontWeight","overflow","textOverflow","a"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";AAEA,SAASA,YAAY,QAAQ,4BAA2B;AACxD,SAASC,SAAS,QAAQ,kCAAiC;AAC3D,OAAOC,WAAW,QAAO;AAazB,OAAO,MAAMC,YAA+B;IAC1C,MAAMC,OAAOJ;IACb,MAAMK,SAASD,KAAKC,MAAM;IAE1B,MAAM,EACJC,KAAK,EACHC,OAAO,EAAEC,UAAU,EAAED,OAAOE,KAAK,EAAE,EACpC,EACF,GAAGJ;IAEJ,MAAMK,SAAST;IAEf,MAAM,EACJU,QAAQ,EACNC,OAAOC,UAAU,EAClB,EACDC,SAAS,EACV,GAAGJ;IAEJ,MAAMK,OAAO,CAAC,EAAED,UAAU,EAAED,WAAW,aAAa,EAAEL,WAAW,CAAC,EAAEC,MAAM,CAAC;IAE3E,qBACE,MAACO;;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;oBAAET,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.37",
|
|
4
4
|
"description": "Search plugin for Payload",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"payload",
|
|
@@ -38,23 +38,28 @@
|
|
|
38
38
|
],
|
|
39
39
|
"dependencies": {
|
|
40
40
|
"deepmerge": "4.3.1",
|
|
41
|
-
"@payloadcms/ui": "3.0.0-beta.
|
|
41
|
+
"@payloadcms/ui": "3.0.0-beta.37"
|
|
42
42
|
},
|
|
43
43
|
"devDependencies": {
|
|
44
44
|
"@types/express": "^4.17.9",
|
|
45
|
-
"@types/react": "
|
|
45
|
+
"@types/react": "npm:types-react@19.0.0-beta.2",
|
|
46
|
+
"@types/react-dom": "npm:types-react-dom@19.0.0-beta.2",
|
|
46
47
|
"@payloadcms/eslint-config": "1.1.1",
|
|
47
|
-
"payload": "3.0.0-beta.
|
|
48
|
+
"payload": "3.0.0-beta.37"
|
|
48
49
|
},
|
|
49
50
|
"peerDependencies": {
|
|
50
|
-
"react": "^
|
|
51
|
-
"react-dom": "^
|
|
52
|
-
"payload": "3.0.0-beta.
|
|
51
|
+
"react": "^19.0.0 || ^19.0.0-rc-f994737d14-20240522",
|
|
52
|
+
"react-dom": "^19.0.0 || ^19.0.0-rc-f994737d14-20240522",
|
|
53
|
+
"payload": "3.0.0-beta.37"
|
|
53
54
|
},
|
|
54
55
|
"publishConfig": {
|
|
55
56
|
"registry": "https://registry.npmjs.org/"
|
|
56
57
|
},
|
|
57
58
|
"homepage:": "https://payloadcms.com",
|
|
59
|
+
"overrides": {
|
|
60
|
+
"@types/react": "npm:types-react@19.0.0-beta.2",
|
|
61
|
+
"@types/react-dom": "npm:types-react-dom@19.0.0-beta.2"
|
|
62
|
+
},
|
|
58
63
|
"scripts": {
|
|
59
64
|
"build": "pnpm build:swc && pnpm build:types",
|
|
60
65
|
"build:swc": "swc ./src -d ./dist --config-file .swcrc",
|