@payloadcms/plugin-search 3.0.0-beta.37 → 3.0.0-beta.38

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.
@@ -0,0 +1,3 @@
1
+ import React from 'react';
2
+ export declare const LinkToDocClient: React.FC;
3
+ //# sourceMappingURL=index.client.d.ts.map
@@ -0,0 +1 @@
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,EA6CnC,CAAA"}
@@ -0,0 +1,39 @@
1
+ 'use client';
2
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
+ import { useWatchForm } from '@payloadcms/ui/forms/Form';
4
+ import { useConfig } from '@payloadcms/ui/providers/Config';
5
+ import React from 'react';
6
+ export const LinkToDocClient = ()=>{
7
+ const form = useWatchForm();
8
+ const fields = form.fields;
9
+ const { doc: { value: { relationTo, value: docId } } } = fields;
10
+ const config = useConfig();
11
+ const { routes: { admin: adminRoute }, serverURL } = config;
12
+ const href = `${serverURL}${adminRoute}/collections/${relationTo}/${docId}`;
13
+ return /*#__PURE__*/ _jsxs("div", {
14
+ children: [
15
+ /*#__PURE__*/ _jsx("div", {
16
+ children: /*#__PURE__*/ _jsx("span", {
17
+ className: "label",
18
+ style: {
19
+ color: '#9A9A9A'
20
+ },
21
+ children: "Doc URL"
22
+ })
23
+ }),
24
+ /*#__PURE__*/ _jsx("div", {
25
+ style: {
26
+ fontWeight: '600',
27
+ overflow: 'hidden',
28
+ textOverflow: 'ellipsis'
29
+ },
30
+ children: /*#__PURE__*/ _jsx("a", {
31
+ href: href,
32
+ children: href
33
+ })
34
+ })
35
+ ]
36
+ });
37
+ };
38
+
39
+ //# sourceMappingURL=index.client.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/Search/ui/index.client.tsx"],"sourcesContent":["'use client'\n\nimport type { FormState } 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 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}/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","LinkToDocClient","form","fields","doc","value","relationTo","docId","config","routes","admin","adminRoute","serverURL","href","div","span","className","style","color","fontWeight","overflow","textOverflow","a"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAAA;;AAIA,SAASA,YAAY,QAAQ,4BAA2B;AACxD,SAASC,SAAS,QAAQ,kCAAiC;AAC3D,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,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"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/Search/ui/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAa,OAAO,EAAE,MAAM,eAAe,CAAA;AAIvD,OAAO,KAAK,MAAM,OAAO,CAAA;AAazB,eAAO,MAAM,SAAS,EAAE,KAAK,CAAC,EAAE,CAAC,OAAO,CA6CvC,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/Search/ui/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,eAAe,CAAA;AAE5C,OAAO,KAAK,MAAM,OAAO,CAAA;AAIzB,eAAO,MAAM,SAAS,EAAE,KAAK,CAAC,EAAE,CAAC,OAAO,CAMvC,CAAA"}
@@ -1,37 +1,9 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { useWatchForm } from '@payloadcms/ui/forms/Form';
3
- import { useConfig } from '@payloadcms/ui/providers/Config';
1
+ import { jsx as _jsx } from "react/jsx-runtime";
4
2
  import React from 'react';
3
+ import { LinkToDocClient } from './index.client.js';
5
4
  export const LinkToDoc = ()=>{
6
- const form = useWatchForm();
7
- const fields = form.fields;
8
- const { doc: { value: { relationTo, value: docId } } } = fields;
9
- const config = useConfig();
10
- const { routes: { admin: adminRoute }, serverURL } = config;
11
- const href = `${serverURL}${adminRoute}/collections/${relationTo}/${docId}`;
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
- ]
5
+ return /*#__PURE__*/ _jsx("div", {
6
+ children: /*#__PURE__*/ _jsx(LinkToDocClient, {})
35
7
  });
36
8
  };
37
9
 
@@ -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":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","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"}
1
+ {"version":3,"sources":["../../../src/Search/ui/index.tsx"],"sourcesContent":["import type { UIField } from 'payload/types'\n\nimport React from 'react'\n\nimport { LinkToDocClient } from './index.client.js'\n\nexport const LinkToDoc: React.FC<UIField> = () => {\n return (\n <div>\n <LinkToDocClient />\n </div>\n )\n}\n"],"names":["React","LinkToDocClient","LinkToDoc","div"],"rangeMappings":";;;;;;;","mappings":";AAEA,OAAOA,WAAW,QAAO;AAEzB,SAASC,eAAe,QAAQ,oBAAmB;AAEnD,OAAO,MAAMC,YAA+B;IAC1C,qBACE,KAACC;kBACC,cAAA,KAACF;;AAGP,EAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@payloadcms/plugin-search",
3
- "version": "3.0.0-beta.37",
3
+ "version": "3.0.0-beta.38",
4
4
  "description": "Search plugin for Payload",
5
5
  "keywords": [
6
6
  "payload",
@@ -38,19 +38,19 @@
38
38
  ],
39
39
  "dependencies": {
40
40
  "deepmerge": "4.3.1",
41
- "@payloadcms/ui": "3.0.0-beta.37"
41
+ "@payloadcms/ui": "3.0.0-beta.38"
42
42
  },
43
43
  "devDependencies": {
44
44
  "@types/express": "^4.17.9",
45
45
  "@types/react": "npm:types-react@19.0.0-beta.2",
46
46
  "@types/react-dom": "npm:types-react-dom@19.0.0-beta.2",
47
47
  "@payloadcms/eslint-config": "1.1.1",
48
- "payload": "3.0.0-beta.37"
48
+ "payload": "3.0.0-beta.38"
49
49
  },
50
50
  "peerDependencies": {
51
51
  "react": "^19.0.0 || ^19.0.0-rc-f994737d14-20240522",
52
52
  "react-dom": "^19.0.0 || ^19.0.0-rc-f994737d14-20240522",
53
- "payload": "3.0.0-beta.37"
53
+ "payload": "3.0.0-beta.38"
54
54
  },
55
55
  "publishConfig": {
56
56
  "registry": "https://registry.npmjs.org/"