@payloadcms/plugin-search 3.0.0-canary.220bb7c → 3.0.0-canary.4704e79
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/hooks/deleteFromSearch.d.ts +1 -1
- package/dist/Search/hooks/deleteFromSearch.d.ts.map +1 -1
- package/dist/Search/hooks/deleteFromSearch.js.map +1 -1
- package/dist/Search/index.d.ts +1 -1
- package/dist/Search/index.d.ts.map +1 -1
- package/dist/Search/index.js.map +1 -1
- package/dist/Search/ui/index.client.js.map +1 -1
- package/dist/Search/ui/index.d.ts +1 -1
- package/dist/Search/ui/index.d.ts.map +1 -1
- package/dist/Search/ui/index.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js.map +1 -1
- package/dist/types.d.ts +1 -2
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js.map +1 -1
- package/package.json +6 -6
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"deleteFromSearch.d.ts","sourceRoot":"","sources":["../../../src/Search/hooks/deleteFromSearch.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"deleteFromSearch.d.ts","sourceRoot":"","sources":["../../../src/Search/hooks/deleteFromSearch.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,SAAS,CAAA;AAExD,eAAO,MAAM,gBAAgB,EAAE,yBA+B9B,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/Search/hooks/deleteFromSearch.ts"],"sourcesContent":["import type { CollectionAfterDeleteHook } from 'payload
|
|
1
|
+
{"version":3,"sources":["../../../src/Search/hooks/deleteFromSearch.ts"],"sourcesContent":["import type { CollectionAfterDeleteHook } from 'payload'\n\nexport const deleteFromSearch: CollectionAfterDeleteHook = async ({\n doc,\n req: { payload },\n req,\n}) => {\n try {\n const searchDocQuery = await payload.find({\n collection: 'search',\n depth: 0,\n req,\n where: {\n 'doc.value': {\n equals: doc.id,\n },\n },\n })\n\n if (searchDocQuery?.docs?.[0]) {\n await payload.delete({\n id: searchDocQuery?.docs?.[0]?.id,\n collection: 'search',\n req,\n })\n }\n } catch (err: unknown) {\n payload.logger.error({\n err: `Error deleting search doc: ${err}`,\n })\n }\n\n return doc\n}\n"],"names":["deleteFromSearch","doc","req","payload","searchDocQuery","find","collection","depth","where","equals","id","docs","delete","err","logger","error"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAEA,OAAO,MAAMA,mBAA8C,OAAO,EAChEC,GAAG,EACHC,KAAK,EAAEC,OAAO,EAAE,EAChBD,GAAG,EACJ;IACC,IAAI;QACF,MAAME,iBAAiB,MAAMD,QAAQE,IAAI,CAAC;YACxCC,YAAY;YACZC,OAAO;YACPL;YACAM,OAAO;gBACL,aAAa;oBACXC,QAAQR,IAAIS,EAAE;gBAChB;YACF;QACF;QAEA,IAAIN,gBAAgBO,MAAM,CAAC,EAAE,EAAE;YAC7B,MAAMR,QAAQS,MAAM,CAAC;gBACnBF,IAAIN,gBAAgBO,MAAM,CAAC,EAAE,EAAED;gBAC/BJ,YAAY;gBACZJ;YACF;QACF;IACF,EAAE,OAAOW,KAAc;QACrBV,QAAQW,MAAM,CAACC,KAAK,CAAC;YACnBF,KAAK,CAAC,2BAA2B,EAAEA,IAAI,CAAC;QAC1C;IACF;IAEA,OAAOZ;AACT,EAAC"}
|
package/dist/Search/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { CollectionConfig } from 'payload
|
|
1
|
+
import type { CollectionConfig } from 'payload';
|
|
2
2
|
import type { SearchPluginConfig } from '../types.js';
|
|
3
3
|
export declare const generateSearchCollection: (pluginConfig: SearchPluginConfig) => CollectionConfig;
|
|
4
4
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/Search/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/Search/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAA;AAI/C,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAA;AAKrD,eAAO,MAAM,wBAAwB,iBAAkB,kBAAkB,KAAG,gBA2DzE,CAAA"}
|
package/dist/Search/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/Search/index.ts"],"sourcesContent":["import type { CollectionConfig } from 'payload
|
|
1
|
+
{"version":3,"sources":["../../src/Search/index.ts"],"sourcesContent":["import type { CollectionConfig } from 'payload'\n\nimport deepMerge from 'deepmerge'\n\nimport type { SearchPluginConfig } from '../types.js'\n\nimport { LinkToDoc } from './ui/index.js'\n\n// all settings can be overridden by the config\nexport const generateSearchCollection = (pluginConfig: SearchPluginConfig): CollectionConfig =>\n deepMerge(\n {\n slug: 'search',\n access: {\n create: (): boolean => false,\n read: (): boolean => true,\n },\n admin: {\n defaultColumns: ['title'],\n description:\n 'This is a collection of automatically created search results. These results are used by the global site search and will be updated automatically as documents in the CMS are created or updated.',\n enableRichTextRelationship: false,\n useAsTitle: 'title',\n },\n fields: [\n {\n name: 'title',\n type: 'text',\n admin: {\n readOnly: true,\n },\n },\n {\n name: 'priority',\n type: 'number',\n admin: {\n position: 'sidebar',\n },\n },\n {\n name: 'doc',\n type: 'relationship',\n admin: {\n position: 'sidebar',\n readOnly: true,\n },\n index: true,\n maxDepth: 0,\n relationTo: pluginConfig?.collections || [],\n required: true,\n },\n {\n name: 'docUrl',\n type: 'ui',\n admin: {\n components: {\n Field: LinkToDoc,\n },\n position: 'sidebar',\n },\n },\n ],\n labels: {\n plural: 'Search Results',\n singular: 'Search Result',\n },\n },\n pluginConfig?.searchOverrides || {},\n )\n"],"names":["deepMerge","LinkToDoc","generateSearchCollection","pluginConfig","slug","access","create","read","admin","defaultColumns","description","enableRichTextRelationship","useAsTitle","fields","name","type","readOnly","position","index","maxDepth","relationTo","collections","required","components","Field","labels","plural","singular","searchOverrides"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAEA,OAAOA,eAAe,YAAW;AAIjC,SAASC,SAAS,QAAQ,gBAAe;AAEzC,+CAA+C;AAC/C,OAAO,MAAMC,2BAA2B,CAACC,eACvCH,UACE;QACEI,MAAM;QACNC,QAAQ;YACNC,QAAQ,IAAe;YACvBC,MAAM,IAAe;QACvB;QACAC,OAAO;YACLC,gBAAgB;gBAAC;aAAQ;YACzBC,aACE;YACFC,4BAA4B;YAC5BC,YAAY;QACd;QACAC,QAAQ;YACN;gBACEC,MAAM;gBACNC,MAAM;gBACNP,OAAO;oBACLQ,UAAU;gBACZ;YACF;YACA;gBACEF,MAAM;gBACNC,MAAM;gBACNP,OAAO;oBACLS,UAAU;gBACZ;YACF;YACA;gBACEH,MAAM;gBACNC,MAAM;gBACNP,OAAO;oBACLS,UAAU;oBACVD,UAAU;gBACZ;gBACAE,OAAO;gBACPC,UAAU;gBACVC,YAAYjB,cAAckB,eAAe,EAAE;gBAC3CC,UAAU;YACZ;YACA;gBACER,MAAM;gBACNC,MAAM;gBACNP,OAAO;oBACLe,YAAY;wBACVC,OAAOvB;oBACT;oBACAgB,UAAU;gBACZ;YACF;SACD;QACDQ,QAAQ;YACNC,QAAQ;YACRC,UAAU;QACZ;IACF,GACAxB,cAAcyB,mBAAmB,CAAC,GACnC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/Search/ui/index.client.tsx"],"sourcesContent":["'use client'\n\nimport type { FormState } from 'payload
|
|
1
|
+
{"version":3,"sources":["../../../src/Search/ui/index.client.tsx"],"sourcesContent":["'use client'\n\nimport type { FormState } from 'payload'\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,EAAE,OAAO,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/Search/ui/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,SAAS,CAAA;AAEtC,OAAO,KAAK,MAAM,OAAO,CAAA;AAIzB,eAAO,MAAM,SAAS,EAAE,KAAK,CAAC,EAAE,CAAC,OAAO,CAMvC,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/Search/ui/index.tsx"],"sourcesContent":["import type { UIField } from 'payload
|
|
1
|
+
{"version":3,"sources":["../../../src/Search/ui/index.tsx"],"sourcesContent":["import type { UIField } from 'payload'\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/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { Config } from 'payload
|
|
1
|
+
import type { Config } from 'payload';
|
|
2
2
|
import type { SearchPluginConfig } from './types.js';
|
|
3
3
|
export declare const searchPlugin: (incomingPluginConfig: SearchPluginConfig) => (config: Config) => Config;
|
|
4
4
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,SAAS,CAAA;AAErC,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAA;AAMpD,eAAO,MAAM,YAAY,yBACA,kBAAkB,cAChC,MAAM,KAAG,MAoDjB,CAAA"}
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/index.ts"],"sourcesContent":["import type { Config } from 'payload
|
|
1
|
+
{"version":3,"sources":["../src/index.ts"],"sourcesContent":["import type { Config } from 'payload'\n\nimport type { SearchPluginConfig } from './types.js'\n\nimport { deleteFromSearch } from './Search/hooks/deleteFromSearch.js'\nimport { syncWithSearch } from './Search/hooks/syncWithSearch.js'\nimport { generateSearchCollection } from './Search/index.js'\n\nexport const searchPlugin =\n (incomingPluginConfig: SearchPluginConfig) =>\n (config: Config): Config => {\n const { collections } = config\n\n if (collections) {\n const pluginConfig: SearchPluginConfig = {\n ...incomingPluginConfig,\n deleteDrafts: true,\n syncDrafts: false,\n // write any config defaults here\n }\n\n // add afterChange and afterDelete hooks to every search-enabled collection\n const collectionsWithSearchHooks = config?.collections\n ?.map((collection) => {\n const { hooks: existingHooks } = collection\n\n const enabledCollections = pluginConfig.collections || []\n const isEnabled = enabledCollections.indexOf(collection.slug) > -1\n if (isEnabled) {\n return {\n ...collection,\n hooks: {\n ...collection.hooks,\n afterChange: [\n ...(existingHooks?.afterChange || []),\n async (args: any) => {\n await syncWithSearch({\n ...args,\n collection: collection.slug,\n pluginConfig,\n })\n },\n ],\n afterDelete: [...(existingHooks?.afterDelete || []), deleteFromSearch],\n },\n }\n }\n\n return collection\n })\n .filter(Boolean)\n\n return {\n ...config,\n collections: [\n ...(collectionsWithSearchHooks || []),\n generateSearchCollection(pluginConfig),\n ],\n }\n }\n\n return config\n }\n"],"names":["deleteFromSearch","syncWithSearch","generateSearchCollection","searchPlugin","incomingPluginConfig","config","collections","pluginConfig","deleteDrafts","syncDrafts","collectionsWithSearchHooks","map","collection","hooks","existingHooks","enabledCollections","isEnabled","indexOf","slug","afterChange","args","afterDelete","filter","Boolean"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAIA,SAASA,gBAAgB,QAAQ,qCAAoC;AACrE,SAASC,cAAc,QAAQ,mCAAkC;AACjE,SAASC,wBAAwB,QAAQ,oBAAmB;AAE5D,OAAO,MAAMC,eACX,CAACC,uBACD,CAACC;QACC,MAAM,EAAEC,WAAW,EAAE,GAAGD;QAExB,IAAIC,aAAa;YACf,MAAMC,eAAmC;gBACvC,GAAGH,oBAAoB;gBACvBI,cAAc;gBACdC,YAAY;YAEd;YAEA,2EAA2E;YAC3E,MAAMC,6BAA6BL,QAAQC,aACvCK,IAAI,CAACC;gBACL,MAAM,EAAEC,OAAOC,aAAa,EAAE,GAAGF;gBAEjC,MAAMG,qBAAqBR,aAAaD,WAAW,IAAI,EAAE;gBACzD,MAAMU,YAAYD,mBAAmBE,OAAO,CAACL,WAAWM,IAAI,IAAI,CAAC;gBACjE,IAAIF,WAAW;oBACb,OAAO;wBACL,GAAGJ,UAAU;wBACbC,OAAO;4BACL,GAAGD,WAAWC,KAAK;4BACnBM,aAAa;mCACPL,eAAeK,eAAe,EAAE;gCACpC,OAAOC;oCACL,MAAMnB,eAAe;wCACnB,GAAGmB,IAAI;wCACPR,YAAYA,WAAWM,IAAI;wCAC3BX;oCACF;gCACF;6BACD;4BACDc,aAAa;mCAAKP,eAAeO,eAAe,EAAE;gCAAGrB;6BAAiB;wBACxE;oBACF;gBACF;gBAEA,OAAOY;YACT,GACCU,OAAOC;YAEV,OAAO;gBACL,GAAGlB,MAAM;gBACTC,aAAa;uBACPI,8BAA8B,EAAE;oBACpCR,yBAAyBK;iBAC1B;YACH;QACF;QAEA,OAAOF;IACT,EAAC"}
|
package/dist/types.d.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import type { Payload } from 'payload';
|
|
2
|
-
import type { CollectionAfterChangeHook, CollectionConfig, PayloadRequestWithData } from 'payload/types';
|
|
1
|
+
import type { CollectionAfterChangeHook, CollectionConfig, Payload, PayloadRequestWithData } from 'payload';
|
|
3
2
|
export type DocToSync = {
|
|
4
3
|
[key: string]: any;
|
|
5
4
|
doc: {
|
package/dist/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,yBAAyB,EACzB,gBAAgB,EAChB,OAAO,EACP,sBAAsB,EACvB,MAAM,SAAS,CAAA;AAEhB,MAAM,MAAM,SAAS,GAAG;IACtB,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAA;IAClB,GAAG,EAAE;QACH,UAAU,EAAE,MAAM,CAAA;QAClB,KAAK,EAAE,MAAM,CAAA;KACd,CAAA;IACD,KAAK,EAAE,MAAM,CAAA;CACd,CAAA;AAED,MAAM,MAAM,UAAU,GAAG,CAAC,IAAI,EAAE;IAC9B,WAAW,EAAE;QACX,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAA;KACnB,CAAA;IACD,OAAO,EAAE,OAAO,CAAA;IAChB,GAAG,EAAE,sBAAsB,CAAA;IAC3B,SAAS,EAAE,SAAS,CAAA;CACrB,KAAK,SAAS,GAAG,OAAO,CAAC,SAAS,CAAC,CAAA;AAEpC,MAAM,MAAM,kBAAkB,GAAG;IAC/B,UAAU,CAAC,EAAE,UAAU,CAAA;IACvB,WAAW,CAAC,EAAE,MAAM,EAAE,CAAA;IACtB,iBAAiB,CAAC,EAAE;QAClB,CAAC,UAAU,EAAE,MAAM,GAAG,CAAC,CAAC,GAAG,EAAE,GAAG,KAAK,OAAO,CAAC,MAAM,CAAC,GAAG,MAAM,CAAC,GAAG,MAAM,CAAA;KACxE,CAAA;IACD,YAAY,CAAC,EAAE,OAAO,CAAA;IACtB,eAAe,CAAC,EAAE,OAAO,CAAC,gBAAgB,CAAC,CAAA;IAC3C,UAAU,CAAC,EAAE,OAAO,CAAA;CACrB,CAAA;AAID,MAAM,MAAM,cAAc,GAAG,CAC3B,IAAI,EAAE,IAAI,CAAC,UAAU,CAAC,yBAAyB,CAAC,CAAC,CAAC,CAAC,EAAE,YAAY,CAAC,GAAG;IACnE,UAAU,EAAE,MAAM,CAAA;IAClB,YAAY,EAAE,kBAAkB,CAAA;CACjC,KACE,UAAU,CAAC,yBAAyB,CAAC,CAAA"}
|
package/dist/types.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/types.ts"],"sourcesContent":["import type {
|
|
1
|
+
{"version":3,"sources":["../src/types.ts"],"sourcesContent":["import type {\n CollectionAfterChangeHook,\n CollectionConfig,\n Payload,\n PayloadRequestWithData,\n} from 'payload'\n\nexport type DocToSync = {\n [key: string]: any\n doc: {\n relationTo: string\n value: string\n }\n title: string\n}\n\nexport type BeforeSync = (args: {\n originalDoc: {\n [key: string]: any\n }\n payload: Payload\n req: PayloadRequestWithData\n searchDoc: DocToSync\n}) => DocToSync | Promise<DocToSync>\n\nexport type SearchPluginConfig = {\n beforeSync?: BeforeSync\n collections?: string[]\n defaultPriorities?: {\n [collection: string]: ((doc: any) => Promise<number> | number) | number\n }\n deleteDrafts?: boolean\n searchOverrides?: Partial<CollectionConfig>\n syncDrafts?: boolean\n}\n\n// Extend the `CollectionAfterChangeHook` with more function args\n// Convert the `collection` arg from `SanitizedCollectionConfig` to a string\nexport type SyncWithSearch = (\n Args: Omit<Parameters<CollectionAfterChangeHook>[0], 'collection'> & {\n collection: string\n pluginConfig: SearchPluginConfig\n },\n) => ReturnType<CollectionAfterChangeHook>\n"],"names":[],"rangeMappings":";;","mappings":"AAoCA,iEAAiE;AACjE,4EAA4E;AAC5E,WAK0C"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@payloadcms/plugin-search",
|
|
3
|
-
"version": "3.0.0-canary.
|
|
3
|
+
"version": "3.0.0-canary.4704e79",
|
|
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-canary.
|
|
41
|
+
"@payloadcms/ui": "3.0.0-canary.4704e79"
|
|
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-canary.
|
|
48
|
+
"payload": "3.0.0-canary.4704e79"
|
|
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-canary.
|
|
53
|
+
"payload": "3.0.0-canary.4704e79"
|
|
54
54
|
},
|
|
55
55
|
"publishConfig": {
|
|
56
56
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -61,8 +61,8 @@
|
|
|
61
61
|
"@types/react-dom": "npm:types-react-dom@19.0.0-beta.2"
|
|
62
62
|
},
|
|
63
63
|
"scripts": {
|
|
64
|
-
"build": "pnpm build:
|
|
65
|
-
"build:swc": "swc ./src -d ./dist --config-file .swcrc",
|
|
64
|
+
"build": "pnpm build:types && pnpm build:swc",
|
|
65
|
+
"build:swc": "swc ./src -d ./dist --config-file .swcrc --strip-leading-paths",
|
|
66
66
|
"build:types": "tsc --emitDeclarationOnly --outDir dist",
|
|
67
67
|
"clean": "rimraf {dist,*.tsbuildinfo}",
|
|
68
68
|
"test": "echo \"Error: no tests specified\""
|