payload 1.5.1 → 1.5.3

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.
@@ -16,7 +16,7 @@ const CodeEditor = (props) => {
16
16
  className,
17
17
  (rest === null || rest === void 0 ? void 0 : rest.defaultLanguage) ? `language--${rest.defaultLanguage}` : '',
18
18
  ].filter(Boolean).join(' ');
19
- return (react_1.default.createElement(react_2.default, { height: "35vh", className: classes, options: {
19
+ return (react_1.default.createElement(react_2.default, { height: "35vh", className: classes, theme: theme === 'dark' ? 'vs-dark' : 'vs', options: {
20
20
  detectIndentation: true,
21
21
  minimap: {
22
22
  enabled: false,
@@ -24,7 +24,6 @@ const CodeEditor = (props) => {
24
24
  readOnly: Boolean(readOnly),
25
25
  scrollBeyondLastLine: false,
26
26
  tabSize: 2,
27
- theme: theme === 'dark' ? 'vs-dark' : 'vs',
28
27
  wordWrap: 'on',
29
28
  ...options,
30
29
  }, ...rest }));
@@ -18,12 +18,16 @@ const loadConfig = (logger) => {
18
18
  // eslint-disable-next-line @typescript-eslint/ban-ts-comment
19
19
  // @ts-ignore
20
20
  (0, register_1.default)({
21
+ sourceMaps: 'inline',
21
22
  jsc: {
22
23
  parser: {
23
24
  syntax: 'typescript',
24
25
  tsx: true,
25
26
  },
26
27
  },
28
+ ignore: [
29
+ /node_modules[\\/](?!.pnpm[\\/].*[\\/]node_modules[\\/])(?!payload[\\/]dist[\\/]admin|payload[\\/]components).*/,
30
+ ],
27
31
  module: {
28
32
  type: 'commonjs',
29
33
  },
@@ -82,17 +82,18 @@ export type GlobalConfig = {
82
82
  };
83
83
  };
84
84
  };
85
- export interface SanitizedGlobalConfig extends Omit<DeepRequired<GlobalConfig>, 'fields' | 'versions' | 'graphQL'> {
85
+ export interface SanitizedGlobalConfig extends Omit<DeepRequired<GlobalConfig>, 'fields' | 'versions'> {
86
86
  fields: Field[];
87
87
  versions: SanitizedGlobalVersions;
88
- graphQL?: {
89
- name?: string;
90
- type: GraphQLObjectType;
91
- mutationInputType: GraphQLNonNull<any>;
92
- versionType?: GraphQLObjectType;
93
- };
94
88
  }
95
89
  export type Globals = {
96
90
  Model: GlobalModel;
97
91
  config: SanitizedGlobalConfig[];
92
+ graphQL?: {
93
+ [slug: string]: {
94
+ type: GraphQLObjectType;
95
+ mutationInputType: GraphQLNonNull<any>;
96
+ versionType?: GraphQLObjectType;
97
+ };
98
+ };
98
99
  };
@@ -27,18 +27,21 @@ function initGlobalsGraphQL(payload) {
27
27
  const global = payload.globals.config[slug];
28
28
  const { fields, versions, } = global;
29
29
  const formattedName = ((_a = global.graphQL) === null || _a === void 0 ? void 0 : _a.name) ? global.graphQL.name : (0, pluralize_1.singular)((0, formatLabels_1.toWords)(global.slug, true));
30
- global.graphQL = {};
31
30
  const forceNullableObjectType = Boolean(versions === null || versions === void 0 ? void 0 : versions.drafts);
32
- global.graphQL.type = (0, buildObjectType_1.default)({
33
- payload,
34
- name: formattedName,
35
- parentName: formattedName,
36
- fields,
37
- forceNullable: forceNullableObjectType,
38
- });
39
- global.graphQL.mutationInputType = new graphql_1.GraphQLNonNull((0, buildMutationInputType_1.default)(payload, formattedName, fields, formattedName));
31
+ if (!payload.globals.graphQL)
32
+ payload.globals.graphQL = {};
33
+ payload.globals.graphQL[slug] = {
34
+ type: (0, buildObjectType_1.default)({
35
+ payload,
36
+ name: formattedName,
37
+ parentName: formattedName,
38
+ fields,
39
+ forceNullable: forceNullableObjectType,
40
+ }),
41
+ mutationInputType: new graphql_1.GraphQLNonNull((0, buildMutationInputType_1.default)(payload, formattedName, fields, formattedName)),
42
+ };
40
43
  payload.Query.fields[formattedName] = {
41
- type: global.graphQL.type,
44
+ type: payload.globals.graphQL[slug].type,
42
45
  args: {
43
46
  draft: { type: graphql_1.GraphQLBoolean },
44
47
  ...(payload.config.localization ? {
@@ -49,9 +52,9 @@ function initGlobalsGraphQL(payload) {
49
52
  resolve: (0, findOne_1.default)(global),
50
53
  };
51
54
  payload.Mutation.fields[`update${formattedName}`] = {
52
- type: global.graphQL.type,
55
+ type: payload.globals.graphQL[slug].type,
53
56
  args: {
54
- data: { type: global.graphQL.mutationInputType },
57
+ data: { type: payload.globals.graphQL[slug].mutationInputType },
55
58
  draft: { type: graphql_1.GraphQLBoolean },
56
59
  ...(payload.config.localization ? {
57
60
  locale: { type: payload.types.localeInputType },
@@ -86,7 +89,7 @@ function initGlobalsGraphQL(payload) {
86
89
  type: 'date',
87
90
  },
88
91
  ];
89
- global.graphQL.versionType = (0, buildObjectType_1.default)({
92
+ payload.globals.graphQL[slug].versionType = (0, buildObjectType_1.default)({
90
93
  payload,
91
94
  name: `${formattedName}Version`,
92
95
  parentName: `${formattedName}Version`,
@@ -94,7 +97,7 @@ function initGlobalsGraphQL(payload) {
94
97
  forceNullable: forceNullableObjectType,
95
98
  });
96
99
  payload.Query.fields[`version${(0, formatName_1.default)(formattedName)}`] = {
97
- type: global.graphQL.versionType,
100
+ type: payload.globals.graphQL[slug].versionType,
98
101
  args: {
99
102
  id: { type: graphql_1.GraphQLString },
100
103
  ...(payload.config.localization ? {
@@ -105,7 +108,7 @@ function initGlobalsGraphQL(payload) {
105
108
  resolve: (0, findVersionByID_1.default)(global),
106
109
  };
107
110
  payload.Query.fields[`versions${formattedName}`] = {
108
- type: (0, buildPaginatedListType_1.default)(`versions${(0, formatName_1.default)(formattedName)}`, global.graphQL.versionType),
111
+ type: (0, buildPaginatedListType_1.default)(`versions${(0, formatName_1.default)(formattedName)}`, payload.globals.graphQL[slug].versionType),
109
112
  args: {
110
113
  where: {
111
114
  type: (0, buildWhereInputType_1.default)(`versions${formattedName}`, versionGlobalFields, `versions${formattedName}`),
@@ -121,7 +124,7 @@ function initGlobalsGraphQL(payload) {
121
124
  resolve: (0, findVersions_1.default)(global),
122
125
  };
123
126
  payload.Mutation.fields[`restoreVersion${(0, formatName_1.default)(formattedName)}`] = {
124
- type: global.graphQL.type,
127
+ type: payload.globals.graphQL[slug].type,
125
128
  args: {
126
129
  id: { type: graphql_1.GraphQLString },
127
130
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "payload",
3
- "version": "1.5.1",
3
+ "version": "1.5.3",
4
4
  "description": "Node, React and MongoDB Headless CMS and Application Framework",
5
5
  "license": "MIT",
6
6
  "engines": {