@sveltia/cms 0.63.1 → 0.64.0

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sveltia/cms",
3
- "version": "0.63.1",
3
+ "version": "0.64.0",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "repository": {
package/types/public.d.ts CHANGED
@@ -158,7 +158,7 @@ export type FieldMediaLibraryOptions = {
158
158
  */
159
159
  export type MediaFieldProps = {
160
160
  /**
161
- * Default value. A file path or complete URL.
161
+ * Default value. Accepts a file path or complete URL.
162
162
  */
163
163
  default?: string;
164
164
  /**
@@ -303,7 +303,7 @@ export type BooleanFieldProps = {
303
303
  */
304
304
  widget: "boolean";
305
305
  /**
306
- * Default value.
306
+ * Default value. Accepts `true` or `false`.
307
307
  */
308
308
  default?: boolean;
309
309
  };
@@ -340,7 +340,7 @@ export type CodeFieldProps = {
340
340
  output_code_only?: boolean;
341
341
  /**
342
342
  * Output property names. It has no effect if
343
- * `output_code_only` is `true`.
343
+ * `output_code_only` is `true`. Default: `{ code: 'code', lang: 'lang' }`.
344
344
  */
345
345
  keys?: {
346
346
  code: string;
@@ -360,7 +360,8 @@ export type ColorFieldProps = {
360
360
  */
361
361
  widget: "color";
362
362
  /**
363
- * Default value. Accepts a Hex color code.
363
+ * Default value. Accepts a Hex color code in the six-value (`#RRGGBB`)
364
+ * or eight-value (`#RRGGBBAA`) syntax.
364
365
  */
365
366
  default?: string;
366
367
  /**
@@ -511,7 +512,9 @@ export type ListFieldProps = {
511
512
  */
512
513
  widget: "list";
513
514
  /**
514
- * Default value.
515
+ * Default value. The
516
+ * format depends on how the field is configured, with or without `field`, `fields` or `types`. See
517
+ * the document for details.
515
518
  */
516
519
  default?: string[] | Record<string, any>[] | Record<string, any>;
517
520
  /**
@@ -569,7 +572,8 @@ export type MapFieldProps = {
569
572
  */
570
573
  widget: "map";
571
574
  /**
572
- * Default value. Accepts a stringified single GeoJSON geometry object.
575
+ * Default value. Accepts a stringified single GeoJSON geometry object
576
+ * that contains `type` and `coordinates` properties.
573
577
  */
574
578
  default?: string;
575
579
  /**
@@ -736,12 +740,14 @@ export type RelationFieldProps = {
736
740
  file?: string;
737
741
  /**
738
742
  * Field name to be stored as the value, or
739
- * `{{slug}}`. It can contain a locale prefix like `{{locale}}/{{slug}}` if i18n is enabled.
743
+ * `{{slug}}` (entry slug). It can contain a locale prefix like `{{locale}}/{{slug}}` if i18n is
744
+ * enabled. Default: `{{slug}}`.
740
745
  */
741
- value_field: FieldKeyPath | string;
746
+ value_field?: FieldKeyPath | string;
742
747
  /**
743
748
  * Name of fields to be displayed. It can
744
- * contain string templates. Default: `value_field` field value.
749
+ * contain string templates. Default: `value_field` field value or the referenced collection’s
750
+ * `identifier_field`, which is `title` by default.
745
751
  */
746
752
  display_fields?: (FieldKeyPath | string)[];
747
753
  /**
@@ -854,13 +860,17 @@ export type UuidFieldProps = {
854
860
  */
855
861
  export type UuidField = CommonFieldProps & UuidFieldProps;
856
862
  /**
857
- * Custom field definition. It can contain any properties.
863
+ * Entry field using a built-in widget.
864
+ */
865
+ export type StandardField = BooleanField | CodeField | ColorField | ComputeField | DateTimeField | FileField | HiddenField | ImageField | KeyValueField | ListField | MapField | MarkdownField | NumberField | ObjectField | RelationField | SelectField | StringField | TextField | UuidField;
866
+ /**
867
+ * Entry field using a custom widget. It can contain any properties.
858
868
  */
859
869
  export type CustomField = CommonFieldProps & Record<string, any>;
860
870
  /**
861
871
  * Entry field.
862
872
  */
863
- export type Field = BooleanField | CodeField | ColorField | ComputeField | DateTimeField | FileField | HiddenField | ImageField | KeyValueField | ListField | MapField | MarkdownField | NumberField | ObjectField | RelationField | SelectField | StringField | TextField | UuidField | CustomField;
873
+ export type Field = StandardField | CustomField;
864
874
  /**
865
875
  * Internationalization (i18n) file structure type.
866
876
  */
@@ -1171,7 +1181,8 @@ export type Collection = {
1171
1181
  */
1172
1182
  extension?: FileExtension;
1173
1183
  /**
1174
- * File format. Entry collection only. Default: `yaml-frontmatter`.
1184
+ * File format. It should match the file extension. Default:
1185
+ * `yaml-frontmatter`.
1175
1186
  */
1176
1187
  format?: FileFormat;
1177
1188
  /**
@@ -1263,7 +1274,7 @@ export type Collection = {
1263
1274
  /**
1264
1275
  * Supported backend name.
1265
1276
  */
1266
- export type BackendName = "github" | "gitlab";
1277
+ export type BackendName = "github" | "gitlab" | "test-repo";
1267
1278
  /**
1268
1279
  * Custom commit messages.
1269
1280
  */
@@ -1309,28 +1320,34 @@ export type BackendOptions = {
1309
1320
  repo?: string;
1310
1321
  /**
1311
1322
  * Git branch name. If omitted, the default branch, usually `main` or
1312
- * `master`, will be used.
1323
+ * `master`, will be used. Git backends only.
1313
1324
  */
1314
1325
  branch?: string;
1315
1326
  /**
1316
- * API endpoint of the backend. Required when using GitHub Enterprise
1317
- * Server or a self-hosted GitLab instance. Default: `https://api.github.com` (GitHub) or
1318
- * `https://gitlab.com/api/v4` (GitLab).
1327
+ * REST API endpoint for the backend. Required when using GitHub
1328
+ * Enterprise Server or a self-hosted GitLab instance. Git backends only. Default:
1329
+ * `https://api.github.com` (GitHub) or `https://gitlab.com/api/v4` (GitLab).
1319
1330
  */
1320
1331
  api_root?: string;
1332
+ /**
1333
+ * GraphQL API endpoint for the backend. Git backends only.
1334
+ * Default: inferred from `api_root` option value.
1335
+ */
1336
+ graphql_api_root?: string;
1321
1337
  /**
1322
1338
  * Site domain used for OAuth, which will be included in the
1323
- * `site_id` param to be sent to the API endpoint. Default: `location.hostname`.
1339
+ * `site_id` param to be sent to the API endpoint. Git backends only. Default: `location.hostname`.
1324
1340
  */
1325
1341
  site_domain?: string;
1326
1342
  /**
1327
1343
  * OAuth base URL origin. Required when using an OAuth client other
1328
- * than Netlify, including Sveltia CMS Authenticator. Default: `https://api.netlify.com`.
1344
+ * than Netlify, including Sveltia CMS Authenticator. Git backends only. Default:
1345
+ * `https://api.netlify.com`.
1329
1346
  */
1330
1347
  base_url?: string;
1331
1348
  /**
1332
- * OAuth base URL path. Default: `auth` (GitHub) or
1333
- * `oauth/authorize` (GitLab).
1349
+ * OAuth base URL path. Git backends only. Default: `auth`
1350
+ * (GitHub) or `oauth/authorize` (GitLab).
1334
1351
  */
1335
1352
  auth_endpoint?: string;
1336
1353
  /**
@@ -1343,7 +1360,7 @@ export type BackendOptions = {
1343
1360
  */
1344
1361
  app_id?: string;
1345
1362
  /**
1346
- * Custom commit messages.
1363
+ * Custom commit messages. Git backends only.
1347
1364
  */
1348
1365
  commit_messages?: CommitMessages;
1349
1366
  /**
@@ -1351,21 +1368,23 @@ export type BackendOptions = {
1351
1368
  */
1352
1369
  preview_context?: string;
1353
1370
  /**
1354
- * Pull request label prefix for Editorial Workflow. Default:
1355
- * `sveltia-cms/`.
1371
+ * Pull request label prefix for Editorial Workflow. Git
1372
+ * backends only. Default: `sveltia-cms/`.
1356
1373
  */
1357
1374
  cms_label_prefix?: string;
1358
1375
  /**
1359
- * Whether to use squash marge for Editorial Workflow. Default:
1360
- * `false`.
1376
+ * Whether to use squash marge for Editorial Workflow. Git
1377
+ * backends only. Default: `false`.
1361
1378
  */
1362
1379
  squash_merges?: boolean;
1363
1380
  /**
1364
- * Whether to use Open Authoring. Default: `false`.
1381
+ * Whether to use Open Authoring. Git backends only. Default:
1382
+ * `false`.
1365
1383
  */
1366
1384
  open_authoring?: boolean;
1367
1385
  /**
1368
- * Authentication scope for Open Authoring.
1386
+ * Authentication scope for Open Authoring. Git
1387
+ * backends only.
1369
1388
  */
1370
1389
  auth_scope?: "repo" | "public_repo";
1371
1390
  /**