|
198 | 198 | * Common field properties that are shared among all field types. |
199 | 199 | * @typedef {object} CommonFieldProps |
200 | 200 | * @property {string} name Unique identifier for the field. It cannot include periods and spaces. |
| 201 | + * @property {boolean | 'duplicate' | 'translate' | 'none'} [i18n] Whether to enable the editor UI |
| 202 | + * in locales other than the default locale. Default: `false`. `duplicate` disables the UI in |
| 203 | + * non-default like `false` but automatically copies the default locale’s value to other locales. |
| 204 | + * `translate` and `none` are aliases of `true` and `false`, respectively. This option only works |
| 205 | + * when i18n is set up with the global and collection-level `i18n` option. |
201 | 206 | */ |
202 | 207 |
|
203 | 208 | /** |
204 | 209 | * Standard field properties for a built-in field type. |
205 | | - * @typedef {object} StandardFieldProps |
| 210 | + * @typedef {object} VisibleFieldProps |
206 | 211 | * @property {string} [label] Label of the field to be displayed in the editor UI. Default: `name` |
207 | 212 | * field value. |
208 | 213 | * @property {string} [comment] Short description of the field to be displayed in the editor UI. |
209 | 214 | * @property {string} [hint] Help message to be displayed below the input UI. Limited Markdown |
210 | 215 | * formatting is supported: bold, italic, strikethrough and links. |
211 | 216 | * @property {boolean} [preview] Whether to show the preview of the field. Default: `true`. |
212 | | - * @property {boolean | 'duplicate' | 'translate' | 'none'} [i18n] Whether to enable the editor UI |
213 | | - * in locales other than the default locale. Default: `false`. `duplicate` disables the UI in |
214 | | - * non-default like `false` but automatically copies the default locale’s value to other locales. |
215 | | - * `translate` and `none` are aliases of `true` and `false`, respectively. This option only works |
216 | | - * when i18n is set up with the global and collection-level `i18n` option. |
217 | 217 | * @property {boolean | LocaleCode[]} [required] Whether to make data input on the field required. |
218 | 218 | * Default: `true`. This option also affects data output if the `omit_empty_optional_fields` global |
219 | 219 | * output option is `true`. If i18n is enabled and the field doesn’t require input in all locales, |
|
225 | 225 | * @see https://sveltiacms.app/en/docs/fields |
226 | 226 | */ |
227 | 227 |
|
228 | | -/** |
229 | | - * Properties for a field that is visible in the editor UI. |
230 | | - * @typedef {CommonFieldProps & StandardFieldProps} VisibleFieldProps |
231 | | - */ |
232 | | - |
233 | 228 | /** |
234 | 229 | * Field validation properties. |
235 | 230 | * @typedef {object} FieldValidationProps |
|
349 | 344 |
|
350 | 345 | /** |
351 | 346 | * Boolean field definition. |
352 | | - * @typedef {VisibleFieldProps & BooleanFieldProps & AdjacentLabelProps} BooleanField |
| 347 | + * @typedef {CommonFieldProps & VisibleFieldProps & BooleanFieldProps & |
| 348 | + * AdjacentLabelProps} BooleanField |
353 | 349 | */ |
354 | 350 |
|
355 | 351 | /** |
|
372 | 368 |
|
373 | 369 | /** |
374 | 370 | * Code field definition. |
375 | | - * @typedef {VisibleFieldProps & FieldValidationProps & CodeFieldProps} CodeField |
| 371 | + * @typedef {CommonFieldProps & VisibleFieldProps & FieldValidationProps & CodeFieldProps} CodeField |
376 | 372 | */ |
377 | 373 |
|
378 | 374 | /** |
|
390 | 386 |
|
391 | 387 | /** |
392 | 388 | * Color field definition. |
393 | | - * @typedef {VisibleFieldProps & FieldValidationProps & ColorFieldProps} ColorField |
| 389 | + * @typedef {CommonFieldProps & VisibleFieldProps & FieldValidationProps & |
| 390 | + * ColorFieldProps} ColorField |
394 | 391 | */ |
395 | 392 |
|
396 | 393 | /** |
|
403 | 400 |
|
404 | 401 | /** |
405 | 402 | * Compute field definition. |
406 | | - * @typedef {VisibleFieldProps & ComputeFieldProps} ComputeField |
| 403 | + * @typedef {CommonFieldProps & VisibleFieldProps & ComputeFieldProps} ComputeField |
407 | 404 | */ |
408 | 405 |
|
409 | 406 | /** |
|
429 | 426 |
|
430 | 427 | /** |
431 | 428 | * DateTime field definition. |
432 | | - * @typedef {VisibleFieldProps & FieldValidationProps & DateTimeFieldProps} DateTimeField |
| 429 | + * @typedef {CommonFieldProps & VisibleFieldProps & FieldValidationProps & |
| 430 | + * DateTimeFieldProps} DateTimeField |
433 | 431 | */ |
434 | 432 |
|
435 | 433 | /** |
|
442 | 440 |
|
443 | 441 | /** |
444 | 442 | * File field definition. |
445 | | - * @typedef {VisibleFieldProps & FieldValidationProps & MediaFieldProps & FileFieldProps } FileField |
| 443 | + * @typedef {CommonFieldProps & VisibleFieldProps & FieldValidationProps & MediaFieldProps & |
| 444 | + * FileFieldProps} FileField |
446 | 445 | */ |
447 | 446 |
|
448 | 447 | /** |
|
451 | 450 | * @property {'hidden'} widget Field type. |
452 | 451 | * @property {any} [default] Default value. Accepts any data type that can be stored with the |
453 | 452 | * configured file format. |
454 | | - * @property {false | 'duplicate' | 'none'} [i18n] Whether to enable the field in locales other than |
455 | | - * the default. Unlike other visible fields, hidden fields can be configured to be enabled in |
456 | | - * non-default locales only when set to `duplicate`. In that case, the default locale’s value is |
457 | | - * automatically copied to other locales. Default: `false`. This option only works when i18n is set |
458 | | - * up with the global and collection-level `i18n` option. |
459 | 453 | * @see https://decapcms.org/docs/widgets/#Hidden |
460 | 454 | * @see https://sveltiacms.app/en/docs/fields/hidden |
461 | 455 | */ |
|
475 | 469 |
|
476 | 470 | /** |
477 | 471 | * Image field definition. |
478 | | - * @typedef {VisibleFieldProps & FieldValidationProps & MediaFieldProps & ImageFieldProps |
479 | | - * } ImageField |
| 472 | + * @typedef {CommonFieldProps & VisibleFieldProps & FieldValidationProps & MediaFieldProps & |
| 473 | + * ImageFieldProps} ImageField |
480 | 474 | */ |
481 | 475 |
|
482 | 476 | /** |
|
492 | 486 |
|
493 | 487 | /** |
494 | 488 | * KeyValue field definition. |
495 | | - * @typedef {VisibleFieldProps & KeyValueFieldProps & MultiValueFieldProps} KeyValueField |
| 489 | + * @typedef {CommonFieldProps & VisibleFieldProps & KeyValueFieldProps & |
| 490 | + * MultiValueFieldProps} KeyValueField |
496 | 491 | */ |
497 | 492 |
|
498 | 493 | /** |
|
508 | 503 |
|
509 | 504 | /** |
510 | 505 | * Base properties for a List field. |
511 | | - * @typedef {VisibleFieldProps & ListFieldProps & MultiValueFieldProps} ListFieldBaseProps |
| 506 | + * @typedef {CommonFieldProps & VisibleFieldProps & ListFieldProps & |
| 507 | + * MultiValueFieldProps} ListFieldBaseProps |
512 | 508 | */ |
513 | 509 |
|
514 | 510 | /** |
|
606 | 602 |
|
607 | 603 | /** |
608 | 604 | * Map field definition. |
609 | | - * @typedef {VisibleFieldProps & FieldValidationProps & MapFieldProps} MapField |
| 605 | + * @typedef {CommonFieldProps & VisibleFieldProps & FieldValidationProps & MapFieldProps} MapField |
610 | 606 | */ |
611 | 607 |
|
612 | 608 | /** |
|
666 | 662 |
|
667 | 663 | /** |
668 | 664 | * RichText field definition. |
669 | | - * @typedef {VisibleFieldProps & FieldValidationProps & RichTextFieldBaseProps & RichTextFieldProps |
670 | | - * } RichTextField |
| 665 | + * @typedef {CommonFieldProps & VisibleFieldProps & FieldValidationProps & RichTextFieldBaseProps & |
| 666 | + * RichTextFieldProps} RichTextField |
671 | 667 | */ |
672 | 668 |
|
673 | 669 | /** |
|
678 | 674 |
|
679 | 675 | /** |
680 | 676 | * Markdown field definition. |
681 | | - * @typedef {VisibleFieldProps & FieldValidationProps & RichTextFieldBaseProps & MarkdownFieldProps |
682 | | - * } MarkdownField |
| 677 | + * @typedef {CommonFieldProps & VisibleFieldProps & FieldValidationProps & RichTextFieldBaseProps & |
| 678 | + * MarkdownFieldProps} MarkdownField |
683 | 679 | */ |
684 | 680 |
|
685 | 681 | /** |
|
701 | 697 |
|
702 | 698 | /** |
703 | 699 | * Number field definition. |
704 | | - * @typedef {VisibleFieldProps & FieldValidationProps & NumberFieldProps & AdjacentLabelProps |
705 | | - * } NumberField |
| 700 | + * @typedef {CommonFieldProps & VisibleFieldProps & FieldValidationProps & NumberFieldProps & |
| 701 | + * AdjacentLabelProps} NumberField |
706 | 702 | */ |
707 | 703 |
|
708 | 704 | /** |
|
720 | 716 |
|
721 | 717 | /** |
722 | 718 | * Base properties for a complex Object field with subfields or variable types. |
723 | | - * @typedef {VisibleFieldProps & ObjectFieldProps} ComplexObjectFieldProps |
| 719 | + * @typedef {CommonFieldProps & VisibleFieldProps & ObjectFieldProps} ComplexObjectFieldProps |
724 | 720 | */ |
725 | 721 |
|
726 | 722 | /** |
|
776 | 772 |
|
777 | 773 | /** |
778 | 774 | * Relation field definition. |
779 | | - * @typedef {VisibleFieldProps & FieldValidationProps & RelationFieldProps & MultiOptionFieldProps |
780 | | - * } RelationField |
| 775 | + * @typedef {CommonFieldProps & VisibleFieldProps & FieldValidationProps & RelationFieldProps & |
| 776 | + * MultiOptionFieldProps} RelationField |
781 | 777 | */ |
782 | 778 |
|
783 | 779 | /** |
|
798 | 794 |
|
799 | 795 | /** |
800 | 796 | * Select field definition. |
801 | | - * @typedef {VisibleFieldProps & FieldValidationProps & SelectFieldProps & MultiOptionFieldProps |
802 | | - * } SelectField |
| 797 | + * @typedef {CommonFieldProps & VisibleFieldProps & FieldValidationProps & SelectFieldProps & |
| 798 | + * MultiOptionFieldProps} SelectField |
803 | 799 | */ |
804 | 800 |
|
805 | 801 | /** |
|
817 | 813 |
|
818 | 814 | /** |
819 | 815 | * String field definition. |
820 | | - * @typedef {VisibleFieldProps & FieldValidationProps & StringFieldProps & AdjacentLabelProps & |
821 | | - * CharCountProps} StringField |
| 816 | + * @typedef {CommonFieldProps & VisibleFieldProps & FieldValidationProps & StringFieldProps & |
| 817 | + * AdjacentLabelProps & CharCountProps} StringField |
822 | 818 | */ |
823 | 819 |
|
824 | 820 | /** |
|
832 | 828 |
|
833 | 829 | /** |
834 | 830 | * Text field definition. |
835 | | - * @typedef {VisibleFieldProps & FieldValidationProps & TextFieldProps & CharCountProps } TextField |
| 831 | + * @typedef {CommonFieldProps & VisibleFieldProps & FieldValidationProps & TextFieldProps & |
| 832 | + * CharCountProps} TextField |
836 | 833 | */ |
837 | 834 |
|
838 | 835 | /** |
|
850 | 847 |
|
851 | 848 | /** |
852 | 849 | * UUID field definition. |
853 | | - * @typedef {VisibleFieldProps & UuidFieldProps} UuidField |
| 850 | + * @typedef {CommonFieldProps & VisibleFieldProps & UuidFieldProps} UuidField |
854 | 851 | */ |
855 | 852 |
|
856 | 853 | /** |
|
912 | 909 |
|
913 | 910 | /** |
914 | 911 | * Entry field using a custom field type. |
915 | | - * @typedef {CommonFieldProps & CustomFieldProps & Record<string, any>} CustomField |
| 912 | + * @typedef {CommonFieldProps & VisibleFieldProps & CustomFieldProps & |
| 913 | + * Record<string, any>} CustomField |
916 | 914 | */ |
917 | 915 |
|
918 | 916 | /** |
|
0 commit comments