@sveltia/cms 0.65.0 → 0.67.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/README.md +50 -25
- package/dist/sveltia-cms.js +125 -125
- package/dist/sveltia-cms.js.map +1 -1
- package/dist/sveltia-cms.mjs +122 -122
- package/dist/sveltia-cms.mjs.map +1 -1
- package/package.json +1 -1
- package/types/public.d.ts +37 -28
package/package.json
CHANGED
package/types/public.d.ts
CHANGED
|
@@ -14,7 +14,7 @@ export type FieldKeyPath = string;
|
|
|
14
14
|
*/
|
|
15
15
|
export type MediaLibraryName = "default" | "cloudinary" | "uploadcare";
|
|
16
16
|
/**
|
|
17
|
-
* Configuration for the
|
|
17
|
+
* Configuration for the default media library.
|
|
18
18
|
*/
|
|
19
19
|
export type DefaultMediaLibraryOptions = {
|
|
20
20
|
/**
|
|
@@ -23,11 +23,11 @@ export type DefaultMediaLibraryOptions = {
|
|
|
23
23
|
max_file_size?: number;
|
|
24
24
|
};
|
|
25
25
|
/**
|
|
26
|
-
* Options for the
|
|
26
|
+
* Options for the default media library.
|
|
27
27
|
*/
|
|
28
28
|
export type DefaultMediaLibrary = {
|
|
29
29
|
/**
|
|
30
|
-
* Configuration for the
|
|
30
|
+
* Configuration for the default media library.
|
|
31
31
|
*/
|
|
32
32
|
config?: DefaultMediaLibraryOptions;
|
|
33
33
|
};
|
|
@@ -94,9 +94,9 @@ export type MediaLibrary = DefaultMediaLibrary | CloudinaryMediaLibrary | Upload
|
|
|
94
94
|
/**
|
|
95
95
|
* Unified media library option that supports multiple libraries.
|
|
96
96
|
*/
|
|
97
|
-
export type
|
|
97
|
+
export type MediaLibraryMap = {
|
|
98
98
|
/**
|
|
99
|
-
* Options for the
|
|
99
|
+
* Options for the default media library.
|
|
100
100
|
*/
|
|
101
101
|
default?: DefaultMediaLibrary;
|
|
102
102
|
/**
|
|
@@ -194,14 +194,15 @@ export type MediaFieldProps = {
|
|
|
194
194
|
public_folder?: string;
|
|
195
195
|
/**
|
|
196
196
|
* Legacy media library option
|
|
197
|
-
* that allows only one library.
|
|
197
|
+
* that allows only one library. This overrides the global `media_library` option. Use
|
|
198
|
+
* `media_libraries` instead to support multiple libraries.
|
|
198
199
|
*/
|
|
199
200
|
media_library?: MediaLibrary & FieldMediaLibraryOptions;
|
|
200
201
|
/**
|
|
201
202
|
* Unified media library option that supports multiple
|
|
202
|
-
* libraries.
|
|
203
|
+
* libraries. This overrides the global `media_libraries` option.
|
|
203
204
|
*/
|
|
204
|
-
media_libraries?:
|
|
205
|
+
media_libraries?: MediaLibraryMap;
|
|
205
206
|
/**
|
|
206
207
|
* Whether to enable multiple item selection in an external
|
|
207
208
|
* media library. Default: `true`.
|
|
@@ -230,13 +231,13 @@ export type MultiOptionFieldProps = {
|
|
|
230
231
|
*/
|
|
231
232
|
multiple?: boolean;
|
|
232
233
|
/**
|
|
233
|
-
* Minimum number of items that can be selected.
|
|
234
|
-
* `
|
|
234
|
+
* Minimum number of items that can be selected. Ignored if `multiple` is
|
|
235
|
+
* `false`. Default: 0.
|
|
235
236
|
*/
|
|
236
237
|
min?: number;
|
|
237
238
|
/**
|
|
238
|
-
* Maximum number of items that can be selected.
|
|
239
|
-
*
|
|
239
|
+
* Maximum number of items that can be selected. Ignored if `multiple` is
|
|
240
|
+
* `false`. Default: infinity.
|
|
240
241
|
*/
|
|
241
242
|
max?: number;
|
|
242
243
|
/**
|
|
@@ -277,7 +278,7 @@ export type VariableFieldType = {
|
|
|
277
278
|
*/
|
|
278
279
|
export type VariableFieldProps = {
|
|
279
280
|
/**
|
|
280
|
-
* Set of nested Object
|
|
281
|
+
* Set of nested Object fields to be selected or added.
|
|
281
282
|
*/
|
|
282
283
|
types?: VariableFieldType[];
|
|
283
284
|
/**
|
|
@@ -348,7 +349,8 @@ export type CodeFieldProps = {
|
|
|
348
349
|
default?: string | Record<string, string>;
|
|
349
350
|
/**
|
|
350
351
|
* Default language to be selected, like `js`. See
|
|
351
|
-
* https://prismjs.com/#supported-languages for a list of supported languages.
|
|
352
|
+
* https://prismjs.com/#supported-languages for a list of supported languages. Default: empty
|
|
353
|
+
* string, which is plaintext.
|
|
352
354
|
*/
|
|
353
355
|
default_language?: string;
|
|
354
356
|
/**
|
|
@@ -392,7 +394,7 @@ export type ColorFieldProps = {
|
|
|
392
394
|
*/
|
|
393
395
|
allowInput?: boolean;
|
|
394
396
|
/**
|
|
395
|
-
* Whether to edit/save the alpha channel value.
|
|
397
|
+
* Whether to edit/save the alpha channel value. Default: `false`.
|
|
396
398
|
*/
|
|
397
399
|
enableAlpha?: boolean;
|
|
398
400
|
};
|
|
@@ -823,9 +825,10 @@ export type StringFieldProps = {
|
|
|
823
825
|
*/
|
|
824
826
|
default?: string;
|
|
825
827
|
/**
|
|
826
|
-
*
|
|
828
|
+
* Data type. It’s useful when the input value needs a
|
|
829
|
+
* validation. Default: text.
|
|
827
830
|
*/
|
|
828
|
-
type?: "
|
|
831
|
+
type?: "text" | "url" | "email";
|
|
829
832
|
/**
|
|
830
833
|
* A string to be prepended to the value. Default: empty string.
|
|
831
834
|
*/
|
|
@@ -1145,7 +1148,7 @@ export type Collection = {
|
|
|
1145
1148
|
icon?: string;
|
|
1146
1149
|
/**
|
|
1147
1150
|
* Field name to be used as the title and slug of an
|
|
1148
|
-
* entry. Entry collection only. Default: `title
|
|
1151
|
+
* entry. Entry collection only. Default: `title`.
|
|
1149
1152
|
*/
|
|
1150
1153
|
identifier_field?: FieldKeyPath;
|
|
1151
1154
|
/**
|
|
@@ -1293,10 +1296,14 @@ export type Collection = {
|
|
|
1293
1296
|
*/
|
|
1294
1297
|
limit?: number;
|
|
1295
1298
|
};
|
|
1299
|
+
/**
|
|
1300
|
+
* Supported Git backend name.
|
|
1301
|
+
*/
|
|
1302
|
+
export type GitBackendName = "github" | "gitlab";
|
|
1296
1303
|
/**
|
|
1297
1304
|
* Supported backend name.
|
|
1298
1305
|
*/
|
|
1299
|
-
export type BackendName =
|
|
1306
|
+
export type BackendName = GitBackendName | "test-repo";
|
|
1300
1307
|
/**
|
|
1301
1308
|
* Custom commit messages.
|
|
1302
1309
|
*/
|
|
@@ -1468,7 +1475,7 @@ export type YamlFormatOptions = {
|
|
|
1468
1475
|
* String value’s default quote type. Default:
|
|
1469
1476
|
* 'none'.
|
|
1470
1477
|
*/
|
|
1471
|
-
quote?: "none" | "
|
|
1478
|
+
quote?: "none" | "single" | "double";
|
|
1472
1479
|
};
|
|
1473
1480
|
/**
|
|
1474
1481
|
* Data output options.
|
|
@@ -1493,8 +1500,9 @@ export type OutputOptions = {
|
|
|
1493
1500
|
*/
|
|
1494
1501
|
export type SiteConfig = {
|
|
1495
1502
|
/**
|
|
1496
|
-
* Whether to load
|
|
1497
|
-
*
|
|
1503
|
+
* Whether to load YAML/JSON site configuration file(s) when
|
|
1504
|
+
* manually initializing the CMS. This works only in the `CMS.init()` method’s `config` option.
|
|
1505
|
+
* Default: `true`.
|
|
1498
1506
|
*/
|
|
1499
1507
|
load_config_file?: boolean;
|
|
1500
1508
|
/**
|
|
@@ -1502,7 +1510,8 @@ export type SiteConfig = {
|
|
|
1502
1510
|
*/
|
|
1503
1511
|
backend: BackendOptions;
|
|
1504
1512
|
/**
|
|
1505
|
-
* Publish mode.
|
|
1513
|
+
* Publish mode. An empty string is
|
|
1514
|
+
* the same as `simple`. Default: `simple`.
|
|
1506
1515
|
*/
|
|
1507
1516
|
publish_mode?: "simple" | "editorial_workflow" | "";
|
|
1508
1517
|
/**
|
|
@@ -1518,16 +1527,16 @@ export type SiteConfig = {
|
|
|
1518
1527
|
/**
|
|
1519
1528
|
* Legacy media library option
|
|
1520
1529
|
* that allows only one library. This overrides the global `media_library` option. Use
|
|
1521
|
-
* `media_libraries` to support multiple libraries.
|
|
1530
|
+
* `media_libraries` instead to support multiple libraries.
|
|
1522
1531
|
*/
|
|
1523
1532
|
media_library?: MediaLibrary & GlobalMediaLibraryOptions;
|
|
1524
1533
|
/**
|
|
1525
1534
|
* Unified media library option that supports multiple
|
|
1526
|
-
* libraries.
|
|
1535
|
+
* libraries.
|
|
1527
1536
|
*/
|
|
1528
|
-
media_libraries?:
|
|
1537
|
+
media_libraries?: MediaLibraryMap;
|
|
1529
1538
|
/**
|
|
1530
|
-
* Site URL. Default: `location.origin
|
|
1539
|
+
* Site URL. Default: current site’s origin (`location.origin`).
|
|
1531
1540
|
*/
|
|
1532
1541
|
site_url?: string;
|
|
1533
1542
|
/**
|
|
@@ -1536,7 +1545,7 @@ export type SiteConfig = {
|
|
|
1536
1545
|
display_url?: string;
|
|
1537
1546
|
/**
|
|
1538
1547
|
* Absolute URL or absolute path to the site logo that will be
|
|
1539
|
-
* displayed on the
|
|
1548
|
+
* displayed on the entrance page and the browser’s tab (favicon). A square image works best.
|
|
1540
1549
|
* Default: Sveltia logo.
|
|
1541
1550
|
*/
|
|
1542
1551
|
logo_url?: string;
|