payload 3.0.0-beta.28 → 3.0.0-beta.29
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/admin/forms/FieldDescription.d.ts +1 -1
- package/dist/admin/forms/FieldDescription.d.ts.map +1 -1
- package/dist/admin/forms/FieldDescription.js.map +1 -1
- package/dist/admin/forms/Label.d.ts +2 -2
- package/dist/admin/forms/Label.d.ts.map +1 -1
- package/dist/admin/forms/Label.js.map +1 -1
- package/dist/admin/forms/RowLabel.d.ts +1 -1
- package/dist/admin/forms/RowLabel.d.ts.map +1 -1
- package/dist/admin/forms/RowLabel.js.map +1 -1
- package/dist/admin/types.d.ts +1 -1
- package/dist/admin/types.d.ts.map +1 -1
- package/dist/admin/types.js.map +1 -1
- package/dist/bin/generateTypes.d.ts +1 -1
- package/dist/bin/generateTypes.d.ts.map +1 -1
- package/dist/bin/generateTypes.js +12 -8
- package/dist/bin/generateTypes.js.map +1 -1
- package/dist/collections/config/client.d.ts +2 -1
- package/dist/collections/config/client.d.ts.map +1 -1
- package/dist/collections/config/schema.d.ts.map +1 -1
- package/dist/collections/config/schema.js +4 -1
- package/dist/collections/config/schema.js.map +1 -1
- package/dist/collections/config/types.d.ts +2 -1
- package/dist/collections/config/types.d.ts.map +1 -1
- package/dist/collections/config/types.js.map +1 -1
- package/dist/config/schema.js +3 -1
- package/dist/config/schema.js.map +1 -1
- package/dist/config/types.d.ts +14 -3
- package/dist/config/types.d.ts.map +1 -1
- package/dist/config/types.js.map +1 -1
- package/dist/exports/utilities.d.ts +1 -1
- package/dist/exports/utilities.d.ts.map +1 -1
- package/dist/exports/utilities.js +1 -1
- package/dist/exports/utilities.js.map +1 -1
- package/dist/fields/config/client.d.ts +80 -2
- package/dist/fields/config/client.d.ts.map +1 -1
- package/dist/fields/config/sanitize.d.ts.map +1 -1
- package/dist/fields/config/sanitize.js +1 -1
- package/dist/fields/config/sanitize.js.map +1 -1
- package/dist/fields/config/schema.d.ts.map +1 -1
- package/dist/fields/config/schema.js +16 -3
- package/dist/fields/config/schema.js.map +1 -1
- package/dist/fields/config/types.d.ts +16 -6
- package/dist/fields/config/types.d.ts.map +1 -1
- package/dist/fields/config/types.js.map +1 -1
- package/dist/fields/validations.d.ts +1 -0
- package/dist/fields/validations.d.ts.map +1 -1
- package/dist/globals/config/schema.d.ts.map +1 -1
- package/dist/globals/config/schema.js +4 -1
- package/dist/globals/config/schema.js.map +1 -1
- package/dist/globals/config/types.d.ts +2 -1
- package/dist/globals/config/types.d.ts.map +1 -1
- package/dist/globals/config/types.js.map +1 -1
- package/dist/utilities/isReactComponent.d.ts +2 -3
- package/dist/utilities/isReactComponent.d.ts.map +1 -1
- package/dist/utilities/isReactComponent.js +6 -8
- package/dist/utilities/isReactComponent.js.map +1 -1
- package/package.json +2 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/globals/config/schema.ts"],"sourcesContent":["import joi from 'joi'\n\nimport { endpointsSchema } from '../../config/schema.js'\nimport {\n componentSchema,\n customViewSchema,\n livePreviewSchema,\n} from '../../config/shared/componentSchema.js'\n\nconst globalSchema = joi\n .object()\n .keys({\n slug: joi.string().required(),\n access: joi.object({\n read: joi.func(),\n readVersions: joi.func(),\n update: joi.func(),\n }),\n admin: joi.object({\n components: joi.object({\n elements: joi.object({\n PreviewButton: componentSchema,\n PublishButton: componentSchema,\n SaveButton: componentSchema,\n SaveDraftButton: componentSchema,\n }),\n views: joi.object({\n Edit: joi.alternatives().try(\n componentSchema,\n joi.object({\n API: joi.alternatives().try(componentSchema, customViewSchema),\n Default: joi.alternatives().try(componentSchema, customViewSchema),\n Preview: joi.alternatives().try(componentSchema, customViewSchema),\n Version: joi.alternatives().try(componentSchema, customViewSchema),\n Versions: joi.alternatives().try(componentSchema, customViewSchema),\n // Relationships\n // References\n }),\n ),\n }),\n }),\n custom: joi.object().pattern(joi.string(), joi.any()),\n description: joi.alternatives().try(joi.string(),
|
|
1
|
+
{"version":3,"sources":["../../../src/globals/config/schema.ts"],"sourcesContent":["import joi from 'joi'\n\nimport { endpointsSchema } from '../../config/schema.js'\nimport {\n componentSchema,\n customViewSchema,\n livePreviewSchema,\n} from '../../config/shared/componentSchema.js'\n\nconst globalSchema = joi\n .object()\n .keys({\n slug: joi.string().required(),\n access: joi.object({\n read: joi.func(),\n readVersions: joi.func(),\n update: joi.func(),\n }),\n admin: joi.object({\n components: joi.object({\n elements: joi.object({\n Description: componentSchema,\n PreviewButton: componentSchema,\n PublishButton: componentSchema,\n SaveButton: componentSchema,\n SaveDraftButton: componentSchema,\n }),\n views: joi.object({\n Edit: joi.alternatives().try(\n componentSchema,\n joi.object({\n API: joi.alternatives().try(componentSchema, customViewSchema),\n Default: joi.alternatives().try(componentSchema, customViewSchema),\n Preview: joi.alternatives().try(componentSchema, customViewSchema),\n Version: joi.alternatives().try(componentSchema, customViewSchema),\n Versions: joi.alternatives().try(componentSchema, customViewSchema),\n // Relationships\n // References\n }),\n ),\n }),\n }),\n custom: joi.object().pattern(joi.string(), joi.any()),\n description: joi\n .alternatives()\n .try(joi.func(), joi.object().pattern(joi.string(), [joi.string()]), joi.string()),\n group: joi\n .alternatives()\n .try(joi.string(), joi.object().pattern(joi.string(), [joi.string()])),\n hidden: joi.alternatives().try(joi.boolean(), joi.func()),\n hideAPIURL: joi.boolean(),\n livePreview: joi.object(livePreviewSchema),\n preview: joi.func(),\n }),\n custom: joi.object().pattern(joi.string(), joi.any()),\n dbName: joi.alternatives().try(joi.string(), joi.func()),\n endpoints: endpointsSchema,\n fields: joi.array(),\n graphQL: joi.alternatives().try(\n joi.object().keys({\n name: joi.string(),\n }),\n joi.boolean(),\n ),\n hooks: joi.object({\n afterChange: joi.array().items(joi.func()),\n afterRead: joi.array().items(joi.func()),\n beforeChange: joi.array().items(joi.func()),\n beforeRead: joi.array().items(joi.func()),\n beforeValidate: joi.array().items(joi.func()),\n }),\n label: joi\n .alternatives()\n .try(joi.func(), joi.string(), joi.object().pattern(joi.string(), [joi.string()])),\n typescript: joi.object().keys({\n interface: joi.string(),\n }),\n versions: joi.alternatives().try(\n joi.object({\n drafts: joi.alternatives().try(\n joi.object({\n autosave: joi.alternatives().try(\n joi.boolean(),\n joi.object({\n interval: joi.number(),\n }),\n ),\n }),\n joi.boolean(),\n ),\n max: joi.number(),\n }),\n joi.boolean(),\n ),\n })\n .unknown()\n\nexport default globalSchema\n"],"names":["joi","endpointsSchema","componentSchema","customViewSchema","livePreviewSchema","globalSchema","object","keys","slug","string","required","access","read","func","readVersions","update","admin","components","elements","Description","PreviewButton","PublishButton","SaveButton","SaveDraftButton","views","Edit","alternatives","try","API","Default","Preview","Version","Versions","custom","pattern","any","description","group","hidden","boolean","hideAPIURL","livePreview","preview","dbName","endpoints","fields","array","graphQL","name","hooks","afterChange","items","afterRead","beforeChange","beforeRead","beforeValidate","label","typescript","interface","versions","drafts","autosave","interval","number","max","unknown"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAAA,OAAOA,SAAS,MAAK;AAErB,SAASC,eAAe,QAAQ,yBAAwB;AACxD,SACEC,eAAe,EACfC,gBAAgB,EAChBC,iBAAiB,QACZ,yCAAwC;AAE/C,MAAMC,eAAeL,IAClBM,MAAM,GACNC,IAAI,CAAC;IACJC,MAAMR,IAAIS,MAAM,GAAGC,QAAQ;IAC3BC,QAAQX,IAAIM,MAAM,CAAC;QACjBM,MAAMZ,IAAIa,IAAI;QACdC,cAAcd,IAAIa,IAAI;QACtBE,QAAQf,IAAIa,IAAI;IAClB;IACAG,OAAOhB,IAAIM,MAAM,CAAC;QAChBW,YAAYjB,IAAIM,MAAM,CAAC;YACrBY,UAAUlB,IAAIM,MAAM,CAAC;gBACnBa,aAAajB;gBACbkB,eAAelB;gBACfmB,eAAenB;gBACfoB,YAAYpB;gBACZqB,iBAAiBrB;YACnB;YACAsB,OAAOxB,IAAIM,MAAM,C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phQLObjectType } from 'graphql';
|
|
2
2
|
import type { DeepRequired } from 'ts-essentials';
|
|
3
3
|
import type { CustomPreviewButton, CustomPublishButton, CustomSaveButton, CustomSaveDraftButton } from '../../admin/types.js';
|
|
4
|
-
import type { Access, EditConfig, Endpoint, EntityDescription, GeneratePreviewURL, LivePreviewConfig } from '../../config/types.js';
|
|
4
|
+
import type { Access, EditConfig, Endpoint, EntityDescription, EntityDescriptionComponent, GeneratePreviewURL, LivePreviewConfig } from '../../config/types.js';
|
|
5
5
|
import type { DBIdentifierName } from '../../database/types.js';
|
|
6
6
|
import type { Field } from '../../fields/config/types.js';
|
|
7
7
|
import type { PayloadRequestWithData, RequestContext } from '../../types/index.js';
|
|
@@ -56,6 +56,7 @@ export type GlobalAdminOptions = {
|
|
|
56
56
|
*/
|
|
57
57
|
components?: {
|
|
58
58
|
elements?: {
|
|
59
|
+
Description?: EntityDescriptionComponent;
|
|
59
60
|
/**
|
|
60
61
|
* Replaces the "Preview" button
|
|
61
62
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/globals/config/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAA;AAChE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,eAAe,CAAA;AAEjD,OAAO,KAAK,EACV,mBAAmB,EACnB,mBAAmB,EACnB,gBAAgB,EAChB,qBAAqB,EACtB,MAAM,sBAAsB,CAAA;
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/globals/config/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAA;AAChE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,eAAe,CAAA;AAEjD,OAAO,KAAK,EACV,mBAAmB,EACnB,mBAAmB,EACnB,gBAAgB,EAChB,qBAAqB,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AAM,CAAA;IACvC,IAAI,EAAE,MAAM,CAAA;IACZ;;OAEG;IACH,UAAU,CAAC,EAAE;QACX;;WAEG;QACH,SAAS,CAAC,EAAE,MAAM,CAAA;KACnB,CAAA;IACD,QAAQ,CAAC,EAAE,sBAAsB,GAAG,OAAO,CAAA;CAC5C,CAAA;AAED,MAAM,WAAW,qBACf,SAAQ,IAAI,CAAC,YAAY,CAAC,YAAY,CAAC,EAAE,WAAW,GAAG,QAAQ,GAAG,UAAU,CAAC;IAC7E,SAAS,EAAE,QAAQ,EAAE,GAAG,KAAK,CAAA;IAC7B,MAAM,EAAE,KAAK,EAAE,CAAA;IACf,QAAQ,EAAE,uBAAuB,CAAA;CAClC;AAED,MAAM,MAAM,OAAO,GAAG;IACpB,MAAM,EAAE,qBAAqB,EAAE,CAAA;IAC/B,OAAO,CAAC,EACJ;QACE,CAAC,IAAI,EAAE,MAAM,GAAG;YACd,iBAAiB,EAAE,cAAc,CAAC,GAAG,CAAC,CAAA;YACtC,IAAI,EAAE,iBAAiB,CAAA;YACvB,WAAW,CAAC,EAAE,iBAAiB,CAAA;SAChC,CAAA;KACF,GACD,KAAK,CAAA;CACV,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/globals/config/types.ts"],"sourcesContent":["import type { GraphQLNonNull, GraphQLObjectType } from 'graphql'\nimport type { DeepRequired } from 'ts-essentials'\n\nimport type {\n CustomPreviewButton,\n CustomPublishButton,\n CustomSaveButton,\n CustomSaveDraftButton,\n} from '../../admin/types.js'\nimport type {
|
|
1
|
+
{"version":3,"sources":["../../../src/globals/config/types.ts"],"sourcesContent":["import type { GraphQLNonNull, GraphQLObjectType } from 'graphql'\nimport type { DeepRequired } from 'ts-essentials'\n\nimport type {\n CustomPreviewButton,\n CustomPublishButton,\n CustomSaveButton,\n CustomSaveDraftButton,\n} from '../../admin/types.js'\nimport type {\n Access,\n EditConfig,\n Endpoint,\n EntityDescription,\n EntityDescriptionComponent,\n GeneratePreviewURL,\n LivePreviewConfig,\n} from '../../config/types.js'\nimport type { DBIdentifierName } from '../../database/types.js'\nimport type { Field } from '../../fields/config/types.js'\nimport type { PayloadRequestWithData, RequestContext } from '../../types/index.js'\nimport type { Where } from '../../types/index.js'\nimport type { IncomingGlobalVersions, SanitizedGlobalVersions } from '../../versions/types.js'\n\nexport type TypeWithID = {\n id: number | string\n}\n\nexport type BeforeValidateHook = (args: {\n context: RequestContext\n data?: any\n /** The global which this hook is being run on */\n global: SanitizedGlobalConfig\n originalDoc?: any\n req: PayloadRequestWithData\n}) => any\n\nexport type BeforeChangeHook = (args: {\n context: RequestContext\n data: any\n /** The global which this hook is being run on */\n global: SanitizedGlobalConfig\n originalDoc?: any\n req: PayloadRequestWithData\n}) => any\n\nexport type AfterChangeHook = (args: {\n context: RequestContext\n doc: any\n /** The global which this hook is being run on */\n global: SanitizedGlobalConfig\n previousDoc: any\n req: PayloadRequestWithData\n}) => any\n\nexport type BeforeReadHook = (args: {\n context: RequestContext\n doc: any\n /** The global which this hook is being run on */\n global: SanitizedGlobalConfig\n req: PayloadRequestWithData\n}) => any\n\nexport type AfterReadHook = (args: {\n context: RequestContext\n doc: any\n findMany?: boolean\n /** The global which this hook is being run on */\n global: SanitizedGlobalConfig\n query?: Where\n req: PayloadRequestWithData\n}) => any\n\nexport type GlobalAdminOptions = {\n /**\n * Custom admin components\n */\n components?: {\n elements?: {\n Description?: EntityDescriptionComponent\n /**\n * Replaces the \"Preview\" button\n */\n PreviewButton?: CustomPreviewButton\n /**\n * Replaces the \"Publish\" button\n * + drafts must be enabled\n */\n PublishButton?: CustomPublishButton\n /**\n * Replaces the \"Save\" button\n * + drafts must be disabled\n */\n SaveButton?: CustomSaveButton\n /**\n * Replaces the \"Save Draft\" button\n * + drafts must be enabled\n * + autosave must be disabled\n */\n SaveDraftButton?: CustomSaveDraftButton\n }\n views?: {\n /**\n * Set to a React component to replace the entire \"Edit\" view, including all nested routes.\n * Set to an object to replace or modify individual nested routes, or to add new ones.\n */\n Edit?: EditConfig\n }\n }\n /** Extension point to add your custom data. Available in server and client. */\n custom?: Record<string, any>\n /**\n * Custom description for collection\n */\n description?: EntityDescription\n /**\n * Place globals into a navigational group\n * */\n group?: Record<string, string> | string\n /**\n * Exclude the global from the admin nav and routes\n */\n hidden?: ((args: { user: PayloadRequestWithData['user'] }) => boolean) | boolean\n /**\n * Hide the API URL within the Edit view\n */\n hideAPIURL?: boolean\n /**\n * Live preview options\n */\n livePreview?: LivePreviewConfig\n /**\n * Function to generate custom preview URL\n */\n preview?: GeneratePreviewURL\n}\n\nexport type GlobalConfig = {\n access?: {\n read?: Access\n readDrafts?: Access\n readVersions?: Access\n update?: Access\n }\n admin?: GlobalAdminOptions\n /** Extension point to add your custom data. Server only. */\n custom?: Record<string, any>\n /**\n * Customize the SQL table name\n */\n dbName?: DBIdentifierName\n endpoints?: Omit<Endpoint, 'root'>[] | false\n fields: Field[]\n graphQL?:\n | {\n name?: string\n }\n | false\n hooks?: {\n afterChange?: AfterChangeHook[]\n afterRead?: AfterReadHook[]\n beforeChange?: BeforeChangeHook[]\n beforeRead?: BeforeReadHook[]\n beforeValidate?: BeforeValidateHook[]\n }\n label?: Record<string, string> | string\n slug: string\n /**\n * Options used in typescript generation\n */\n typescript?: {\n /**\n * Typescript generation name given to the interface type\n */\n interface?: string\n }\n versions?: IncomingGlobalVersions | boolean\n}\n\nexport interface SanitizedGlobalConfig\n extends Omit<DeepRequired<GlobalConfig>, 'endpoints' | 'fields' | 'versions'> {\n endpoints: Endpoint[] | false\n fields: Field[]\n versions: SanitizedGlobalVersions\n}\n\nexport type Globals = {\n config: SanitizedGlobalConfig[]\n graphQL?:\n | {\n [slug: string]: {\n mutationInputType: GraphQLNonNull<any>\n type: GraphQLObjectType\n versionType?: GraphQLObjectType\n }\n }\n | false\n}\n"],"names":[],"rangeMappings":"","mappings":"AA0LA,WAWC"}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import type React from 'react';
|
|
2
|
-
export declare function
|
|
2
|
+
export declare function isReactServerComponentOrFunction<T extends any>(component: React.ComponentType | any): component is T;
|
|
3
3
|
export declare function isReactClientComponent<T extends any>(component: React.ComponentType | any): component is T;
|
|
4
|
-
export declare function
|
|
5
|
-
export declare function isPlainFunction<T extends Function>(fn: any): fn is T;
|
|
4
|
+
export declare function isReactComponentOrFunction<T extends any>(component: React.ComponentType | any): component is T;
|
|
6
5
|
//# sourceMappingURL=isReactComponent.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"isReactComponent.d.ts","sourceRoot":"","sources":["../../src/utilities/isReactComponent.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;
|
|
1
|
+
{"version":3,"file":"isReactComponent.d.ts","sourceRoot":"","sources":["../../src/utilities/isReactComponent.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAI9B,wBAAgB,gCAAgC,CAAC,CAAC,SAAS,GAAG,EAC5D,SAAS,EAAE,KAAK,CAAC,aAAa,GAAG,GAAG,GACnC,SAAS,IAAI,CAAC,CAUhB;AAED,wBAAgB,sBAAsB,CAAC,CAAC,SAAS,GAAG,EAClD,SAAS,EAAE,KAAK,CAAC,aAAa,GAAG,GAAG,GACnC,SAAS,IAAI,CAAC,CAGhB;AAED,wBAAgB,0BAA0B,CAAC,CAAC,SAAS,GAAG,EACtD,SAAS,EAAE,KAAK,CAAC,aAAa,GAAG,GAAG,GACnC,SAAS,IAAI,CAAC,CAEhB"}
|
|
@@ -1,17 +1,15 @@
|
|
|
1
|
-
import { isValidElement } from 'react';
|
|
2
1
|
import { isPlainObject } from './isPlainObject.js';
|
|
3
|
-
export function
|
|
4
|
-
|
|
2
|
+
export function isReactServerComponentOrFunction(component) {
|
|
3
|
+
const isClassComponent = typeof component === 'function' && component.prototype && typeof component.prototype.render === 'function';
|
|
4
|
+
const isFunctionalComponent = typeof component === 'function' && (!component.prototype || !component.prototype.render);
|
|
5
|
+
return isClassComponent || isFunctionalComponent;
|
|
5
6
|
}
|
|
6
7
|
export function isReactClientComponent(component) {
|
|
7
8
|
// Do this to test for client components (`use client` directive) bc they import as empty objects
|
|
8
9
|
return typeof component === 'object' && !isPlainObject(component);
|
|
9
10
|
}
|
|
10
|
-
export function
|
|
11
|
-
return
|
|
12
|
-
}
|
|
13
|
-
export function isPlainFunction(fn) {
|
|
14
|
-
return typeof fn === 'function' && !isReactComponent(fn);
|
|
11
|
+
export function isReactComponentOrFunction(component) {
|
|
12
|
+
return isReactServerComponentOrFunction(component) || isReactClientComponent(component);
|
|
15
13
|
}
|
|
16
14
|
|
|
17
15
|
//# sourceMappingURL=isReactComponent.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/utilities/isReactComponent.ts"],"sourcesContent":["import type React from 'react'\n\nimport {
|
|
1
|
+
{"version":3,"sources":["../../src/utilities/isReactComponent.ts"],"sourcesContent":["import type React from 'react'\n\nimport { isPlainObject } from './isPlainObject.js'\n\nexport function isReactServerComponentOrFunction<T extends any>(\n component: React.ComponentType | any,\n): component is T {\n const isClassComponent =\n typeof component === 'function' &&\n component.prototype &&\n typeof component.prototype.render === 'function'\n\n const isFunctionalComponent =\n typeof component === 'function' && (!component.prototype || !component.prototype.render)\n\n return isClassComponent || isFunctionalComponent\n}\n\nexport function isReactClientComponent<T extends any>(\n component: React.ComponentType | any,\n): component is T {\n // Do this to test for client components (`use client` directive) bc they import as empty objects\n return typeof component === 'object' && !isPlainObject(component)\n}\n\nexport function isReactComponentOrFunction<T extends any>(\n component: React.ComponentType | any,\n): component is T {\n return isReactServerComponentOrFunction(component) || isReactClientComponent(component)\n}\n"],"names":["isPlainObject","isReactServerComponentOrFunction","component","isClassComponent","prototype","render","isFunctionalComponent","isReactClientComponent","isReactComponentOrFunction"],"rangeMappings":";;;;;;;;;;;;","mappings":"AAEA,SAASA,aAAa,QAAQ,qBAAoB;AAElD,OAAO,SAASC,iCACdC,SAAoC;IAEpC,MAAMC,mBACJ,OAAOD,cAAc,cACrBA,UAAUE,SAAS,IACnB,OAAOF,UAAUE,SAAS,CAACC,MAAM,KAAK;IAExC,MAAMC,wBACJ,OAAOJ,cAAc,cAAe,CAAA,CAACA,UAAUE,SAAS,IAAI,CAACF,UAAUE,SAAS,CAACC,MAAM,AAAD;IAExF,OAAOF,oBAAoBG;AAC7B;AAEA,OAAO,SAASC,uBACdL,SAAoC;IAEpC,iGAAiG;IACjG,OAAO,OAAOA,cAAc,YAAY,CAACF,cAAcE;AACzD;AAEA,OAAO,SAASM,2BACdN,SAAoC;IAEpC,OAAOD,iCAAiCC,cAAcK,uBAAuBL;AAC/E"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "payload",
|
|
3
|
-
"version": "3.0.0-beta.
|
|
3
|
+
"version": "3.0.0-beta.29",
|
|
4
4
|
"description": "Node, React, Headless CMS and Application Framework built on Next.js",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"admin panel",
|
|
@@ -96,7 +96,7 @@
|
|
|
96
96
|
"scmp": "2.1.0",
|
|
97
97
|
"ts-essentials": "7.0.3",
|
|
98
98
|
"uuid": "^9.0.1",
|
|
99
|
-
"@payloadcms/translations": "3.0.0-beta.
|
|
99
|
+
"@payloadcms/translations": "3.0.0-beta.29"
|
|
100
100
|
},
|
|
101
101
|
"devDependencies": {
|
|
102
102
|
"@monaco-editor/react": "4.5.1",
|