@payloadcms/plugin-redirects 3.0.0-canary.ce278e4 → 3.0.0-canary.e9f7ce1
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/exports/types.js.map +1 -1
- package/dist/index.js.map +1 -1
- package/dist/types.js.map +1 -1
- package/package.json +9 -9
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/exports/types.ts"],"sourcesContent":["export type { RedirectsPluginConfig } from '../types.js'\n"],"names":[],"
|
|
1
|
+
{"version":3,"sources":["../../src/exports/types.ts"],"sourcesContent":["export type { RedirectsPluginConfig } from '../types.js'\n"],"names":[],"mappings":"AAAA,WAAwD"}
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/index.ts"],"sourcesContent":["import type { CollectionConfig, Config, Field } from 'payload'\n\nimport type { RedirectsPluginConfig } from './types.js'\n\nexport const redirectsPlugin =\n (pluginConfig: RedirectsPluginConfig) =>\n (incomingConfig: Config): Config => {\n const defaultFields: Field[] = [\n {\n name: 'from',\n type: 'text',\n index: true,\n label: 'From URL',\n required: true,\n },\n {\n name: 'to',\n type: 'group',\n fields: [\n {\n name: 'type',\n type: 'radio',\n admin: {\n layout: 'horizontal',\n },\n defaultValue: 'reference',\n label: 'To URL Type',\n options: [\n {\n label: 'Internal link',\n value: 'reference',\n },\n {\n label: 'Custom URL',\n value: 'custom',\n },\n ],\n },\n {\n name: 'reference',\n type: 'relationship',\n admin: {\n condition: (_, siblingData) => siblingData?.type === 'reference',\n },\n label: 'Document to redirect to',\n relationTo: pluginConfig?.collections || [],\n required: true,\n },\n {\n name: 'url',\n type: 'text',\n admin: {\n condition: (_, siblingData) => siblingData?.type === 'custom',\n },\n label: 'Custom URL',\n required: true,\n },\n ],\n label: false,\n },\n ]\n\n const redirectsCollection: CollectionConfig = {\n ...(pluginConfig?.overrides || {}),\n slug: pluginConfig?.overrides?.slug || 'redirects',\n access: {\n read: () => true,\n ...(pluginConfig?.overrides?.access || {}),\n },\n admin: {\n defaultColumns: ['from', 'to.type', 'createdAt'],\n ...(pluginConfig?.overrides?.admin || {}),\n },\n fields:\n pluginConfig?.overrides?.fields && typeof pluginConfig?.overrides?.fields === 'function'\n ? pluginConfig?.overrides.fields({ defaultFields })\n : defaultFields,\n }\n\n return {\n ...incomingConfig,\n collections: [...(incomingConfig?.collections || []), redirectsCollection],\n }\n }\n"],"names":["redirectsPlugin","pluginConfig","incomingConfig","defaultFields","name","type","index","label","required","fields","admin","layout","defaultValue","options","value","condition","_","siblingData","relationTo","collections","redirectsCollection","overrides","slug","access","read","defaultColumns"],"
|
|
1
|
+
{"version":3,"sources":["../src/index.ts"],"sourcesContent":["import type { CollectionConfig, Config, Field } from 'payload'\n\nimport type { RedirectsPluginConfig } from './types.js'\n\nexport const redirectsPlugin =\n (pluginConfig: RedirectsPluginConfig) =>\n (incomingConfig: Config): Config => {\n const defaultFields: Field[] = [\n {\n name: 'from',\n type: 'text',\n index: true,\n label: 'From URL',\n required: true,\n },\n {\n name: 'to',\n type: 'group',\n fields: [\n {\n name: 'type',\n type: 'radio',\n admin: {\n layout: 'horizontal',\n },\n defaultValue: 'reference',\n label: 'To URL Type',\n options: [\n {\n label: 'Internal link',\n value: 'reference',\n },\n {\n label: 'Custom URL',\n value: 'custom',\n },\n ],\n },\n {\n name: 'reference',\n type: 'relationship',\n admin: {\n condition: (_, siblingData) => siblingData?.type === 'reference',\n },\n label: 'Document to redirect to',\n relationTo: pluginConfig?.collections || [],\n required: true,\n },\n {\n name: 'url',\n type: 'text',\n admin: {\n condition: (_, siblingData) => siblingData?.type === 'custom',\n },\n label: 'Custom URL',\n required: true,\n },\n ],\n label: false,\n },\n ]\n\n const redirectsCollection: CollectionConfig = {\n ...(pluginConfig?.overrides || {}),\n slug: pluginConfig?.overrides?.slug || 'redirects',\n access: {\n read: () => true,\n ...(pluginConfig?.overrides?.access || {}),\n },\n admin: {\n defaultColumns: ['from', 'to.type', 'createdAt'],\n ...(pluginConfig?.overrides?.admin || {}),\n },\n fields:\n pluginConfig?.overrides?.fields && typeof pluginConfig?.overrides?.fields === 'function'\n ? pluginConfig?.overrides.fields({ defaultFields })\n : defaultFields,\n }\n\n return {\n ...incomingConfig,\n collections: [...(incomingConfig?.collections || []), redirectsCollection],\n }\n }\n"],"names":["redirectsPlugin","pluginConfig","incomingConfig","defaultFields","name","type","index","label","required","fields","admin","layout","defaultValue","options","value","condition","_","siblingData","relationTo","collections","redirectsCollection","overrides","slug","access","read","defaultColumns"],"mappings":"AAIA,OAAO,MAAMA,kBACX,CAACC,eACD,CAACC;QACC,MAAMC,gBAAyB;YAC7B;gBACEC,MAAM;gBACNC,MAAM;gBACNC,OAAO;gBACPC,OAAO;gBACPC,UAAU;YACZ;YACA;gBACEJ,MAAM;gBACNC,MAAM;gBACNI,QAAQ;oBACN;wBACEL,MAAM;wBACNC,MAAM;wBACNK,OAAO;4BACLC,QAAQ;wBACV;wBACAC,cAAc;wBACdL,OAAO;wBACPM,SAAS;4BACP;gCACEN,OAAO;gCACPO,OAAO;4BACT;4BACA;gCACEP,OAAO;gCACPO,OAAO;4BACT;yBACD;oBACH;oBACA;wBACEV,MAAM;wBACNC,MAAM;wBACNK,OAAO;4BACLK,WAAW,CAACC,GAAGC,cAAgBA,aAAaZ,SAAS;wBACvD;wBACAE,OAAO;wBACPW,YAAYjB,cAAckB,eAAe,EAAE;wBAC3CX,UAAU;oBACZ;oBACA;wBACEJ,MAAM;wBACNC,MAAM;wBACNK,OAAO;4BACLK,WAAW,CAACC,GAAGC,cAAgBA,aAAaZ,SAAS;wBACvD;wBACAE,OAAO;wBACPC,UAAU;oBACZ;iBACD;gBACDD,OAAO;YACT;SACD;QAED,MAAMa,sBAAwC;YAC5C,GAAInB,cAAcoB,aAAa,CAAC,CAAC;YACjCC,MAAMrB,cAAcoB,WAAWC,QAAQ;YACvCC,QAAQ;gBACNC,MAAM,IAAM;gBACZ,GAAIvB,cAAcoB,WAAWE,UAAU,CAAC,CAAC;YAC3C;YACAb,OAAO;gBACLe,gBAAgB;oBAAC;oBAAQ;oBAAW;iBAAY;gBAChD,GAAIxB,cAAcoB,WAAWX,SAAS,CAAC,CAAC;YAC1C;YACAD,QACER,cAAcoB,WAAWZ,UAAU,OAAOR,cAAcoB,WAAWZ,WAAW,aAC1ER,cAAcoB,UAAUZ,OAAO;gBAAEN;YAAc,KAC/CA;QACR;QAEA,OAAO;YACL,GAAGD,cAAc;YACjBiB,aAAa;mBAAKjB,gBAAgBiB,eAAe,EAAE;gBAAGC;aAAoB;QAC5E;IACF,EAAC"}
|
package/dist/types.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/types.ts"],"sourcesContent":["import type { CollectionConfig, Field } from 'payload'\n\nexport type FieldsOverride = (args: { defaultFields: Field[] }) => Field[]\n\nexport type RedirectsPluginConfig = {\n collections?: string[]\n overrides?: Partial<Omit<CollectionConfig, 'fields'>> & { fields: FieldsOverride }\n}\n"],"names":[],"
|
|
1
|
+
{"version":3,"sources":["../src/types.ts"],"sourcesContent":["import type { CollectionConfig, Field } from 'payload'\n\nexport type FieldsOverride = (args: { defaultFields: Field[] }) => Field[]\n\nexport type RedirectsPluginConfig = {\n collections?: string[]\n overrides?: Partial<Omit<CollectionConfig, 'fields'>> & { fields: FieldsOverride }\n}\n"],"names":[],"mappings":"AAIA,WAGC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@payloadcms/plugin-redirects",
|
|
3
|
-
"version": "3.0.0-canary.
|
|
3
|
+
"version": "3.0.0-canary.e9f7ce1",
|
|
4
4
|
"description": "Redirects plugin for Payload",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"payload",
|
|
@@ -22,13 +22,13 @@
|
|
|
22
22
|
"exports": {
|
|
23
23
|
".": {
|
|
24
24
|
"import": "./dist/index.js",
|
|
25
|
-
"
|
|
26
|
-
"
|
|
25
|
+
"types": "./dist/index.d.ts",
|
|
26
|
+
"default": "./dist/index.js"
|
|
27
27
|
},
|
|
28
|
-
"
|
|
29
|
-
"import": "./dist/exports
|
|
30
|
-
"
|
|
31
|
-
"
|
|
28
|
+
"./types": {
|
|
29
|
+
"import": "./dist/exports/types.js",
|
|
30
|
+
"types": "./dist/exports/types.d.ts",
|
|
31
|
+
"default": "./dist/exports/types.js"
|
|
32
32
|
}
|
|
33
33
|
},
|
|
34
34
|
"main": "./dist/index.js",
|
|
@@ -43,10 +43,10 @@
|
|
|
43
43
|
"@types/react": "npm:types-react@19.0.0-beta.2",
|
|
44
44
|
"@types/react-dom": "npm:types-react-dom@19.0.0-beta.2",
|
|
45
45
|
"@payloadcms/eslint-config": "1.1.1",
|
|
46
|
-
"payload": "3.0.0-canary.
|
|
46
|
+
"payload": "3.0.0-canary.e9f7ce1"
|
|
47
47
|
},
|
|
48
48
|
"peerDependencies": {
|
|
49
|
-
"payload": "3.0.0-canary.
|
|
49
|
+
"payload": "3.0.0-canary.e9f7ce1"
|
|
50
50
|
},
|
|
51
51
|
"homepage:": "https://payloadcms.com",
|
|
52
52
|
"overrides": {
|