@sveltia/cms 0.126.0 → 0.128.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/LICENSE.txt +1 -1
- package/README.md +23 -2772
- package/dist/sveltia-cms.js +223 -223
- package/dist/sveltia-cms.js.map +1 -1
- package/dist/sveltia-cms.mjs +207 -207
- package/dist/sveltia-cms.mjs.map +1 -1
- package/main.d.ts +7 -0
- package/package.json +2 -2
- package/schema/sveltia-cms.json +1 -1
- package/types/public.d.ts +64 -61
package/types/public.d.ts
CHANGED
|
@@ -12,11 +12,11 @@ export type LocaleCode = string;
|
|
|
12
12
|
*/
|
|
13
13
|
export type FieldKeyPath = string;
|
|
14
14
|
/**
|
|
15
|
-
* Cloud media
|
|
15
|
+
* Cloud media storage name.
|
|
16
16
|
*/
|
|
17
17
|
export type CloudMediaLibraryName = "cloudinary" | "uploadcare";
|
|
18
18
|
/**
|
|
19
|
-
* Supported media
|
|
19
|
+
* Supported media storage name.
|
|
20
20
|
*/
|
|
21
21
|
export type MediaLibraryName = "default" | CloudMediaLibraryName | "stock_assets";
|
|
22
22
|
/**
|
|
@@ -35,7 +35,7 @@ export type VectorImageFormat = "svg";
|
|
|
35
35
|
export type RasterImageConversionFormat = "webp";
|
|
36
36
|
/**
|
|
37
37
|
* Raster image transformation options. See our
|
|
38
|
-
* [
|
|
38
|
+
* [documentation](https://sveltiacms.app/en/docs/media/internal#image-optimization) for details.
|
|
39
39
|
*/
|
|
40
40
|
export type RasterImageTransformationOptions = {
|
|
41
41
|
/**
|
|
@@ -112,13 +112,13 @@ export type ImageTransformations = RasterImageTransformations & VectorImageTrans
|
|
|
112
112
|
*/
|
|
113
113
|
export type FileTransformations = ImageTransformations;
|
|
114
114
|
/**
|
|
115
|
-
* Configuration for the default media
|
|
115
|
+
* Configuration for the default media storage.
|
|
116
116
|
*/
|
|
117
117
|
export type DefaultMediaLibraryConfig = {
|
|
118
118
|
/**
|
|
119
|
-
* Whether to allow multiple file selection in the media
|
|
120
|
-
* This option is available for compatibility with the Cloudinary and Uploadcare media
|
|
121
|
-
* but you can simply use the `multiple` option for the File/Image field types instead.
|
|
119
|
+
* Whether to allow multiple file selection in the media storage.
|
|
120
|
+
* This option is available for compatibility with the Cloudinary and Uploadcare media storage
|
|
121
|
+
* providers, but you can simply use the `multiple` option for the File/Image field types instead.
|
|
122
122
|
*/
|
|
123
123
|
multiple?: boolean;
|
|
124
124
|
/**
|
|
@@ -136,21 +136,21 @@ export type DefaultMediaLibraryConfig = {
|
|
|
136
136
|
* File transformation option map. The key is an
|
|
137
137
|
* original format like `png` or `jpeg`. It can also be `raster_image` that matches any supported
|
|
138
138
|
* raster image format. See our
|
|
139
|
-
* [
|
|
139
|
+
* [documentation](https://sveltiacms.app/en/docs/media/internal#image-optimization) for details.
|
|
140
140
|
*/
|
|
141
141
|
transformations?: FileTransformations;
|
|
142
142
|
};
|
|
143
143
|
/**
|
|
144
|
-
* Options for the default media
|
|
144
|
+
* Options for the default media storage.
|
|
145
145
|
*/
|
|
146
146
|
export type DefaultMediaLibrary = {
|
|
147
147
|
/**
|
|
148
|
-
* Configuration for the default media
|
|
148
|
+
* Configuration for the default media storage.
|
|
149
149
|
*/
|
|
150
150
|
config?: DefaultMediaLibraryConfig;
|
|
151
151
|
};
|
|
152
152
|
/**
|
|
153
|
-
* Options for the [Cloudinary media
|
|
153
|
+
* Options for the [Cloudinary media storage](https://sveltiacms.app/en/docs/media/cloudinary).
|
|
154
154
|
*/
|
|
155
155
|
export type CloudinaryMediaLibrary = {
|
|
156
156
|
/**
|
|
@@ -174,7 +174,7 @@ export type CloudinaryMediaLibrary = {
|
|
|
174
174
|
config?: Record<string, any>;
|
|
175
175
|
};
|
|
176
176
|
/**
|
|
177
|
-
* Settings for the [Uploadcare media
|
|
177
|
+
* Settings for the [Uploadcare media storage](https://sveltiacms.app/en/docs/media/uploadcare).
|
|
178
178
|
*/
|
|
179
179
|
export type UploadcareMediaLibrarySettings = {
|
|
180
180
|
/**
|
|
@@ -189,7 +189,7 @@ export type UploadcareMediaLibrarySettings = {
|
|
|
189
189
|
defaultOperations?: string;
|
|
190
190
|
};
|
|
191
191
|
/**
|
|
192
|
-
* Options for the [Uploadcare media
|
|
192
|
+
* Options for the [Uploadcare media storage](https://sveltiacms.app/en/docs/media/uploadcare).
|
|
193
193
|
*/
|
|
194
194
|
export type UploadcareMediaLibrary = {
|
|
195
195
|
/**
|
|
@@ -210,7 +210,7 @@ export type UploadcareMediaLibrary = {
|
|
|
210
210
|
*/
|
|
211
211
|
export type StockAssetProviderName = "pexels" | "pixabay" | "unsplash";
|
|
212
212
|
/**
|
|
213
|
-
* Options for the unified stock photo/video
|
|
213
|
+
* Options for the unified stock photo/video providers.
|
|
214
214
|
*/
|
|
215
215
|
export type StockAssetMediaLibrary = {
|
|
216
216
|
/**
|
|
@@ -221,25 +221,24 @@ export type StockAssetMediaLibrary = {
|
|
|
221
221
|
providers?: StockAssetProviderName[];
|
|
222
222
|
};
|
|
223
223
|
/**
|
|
224
|
-
* Supported [media
|
|
224
|
+
* Supported [media storage](https://sveltiacms.app/en/docs/media).
|
|
225
225
|
*/
|
|
226
226
|
export type MediaLibrary = DefaultMediaLibrary | CloudinaryMediaLibrary | UploadcareMediaLibrary | StockAssetMediaLibrary;
|
|
227
227
|
/**
|
|
228
|
-
* Unified media
|
|
229
|
-
* [
|
|
230
|
-
* details.
|
|
228
|
+
* Unified media storage option that supports multiple storage providers. See our
|
|
229
|
+
* [documentation](https://sveltiacms.app/en/docs/media#configuration) for details.
|
|
231
230
|
*/
|
|
232
231
|
export type MediaLibraries = {
|
|
233
232
|
/**
|
|
234
|
-
* Options for the default media
|
|
233
|
+
* Options for the default media storage.
|
|
235
234
|
*/
|
|
236
235
|
default?: DefaultMediaLibrary;
|
|
237
236
|
/**
|
|
238
|
-
* Options for the Cloudinary media
|
|
237
|
+
* Options for the Cloudinary media storage.
|
|
239
238
|
*/
|
|
240
239
|
cloudinary?: CloudinaryMediaLibrary;
|
|
241
240
|
/**
|
|
242
|
-
* Options for the Uploadcare media
|
|
241
|
+
* Options for the Uploadcare media storage.
|
|
243
242
|
*/
|
|
244
243
|
uploadcare?: UploadcareMediaLibrary;
|
|
245
244
|
/**
|
|
@@ -316,7 +315,7 @@ export type FieldValidationProps = {
|
|
|
316
315
|
pattern?: [string | RegExp, string];
|
|
317
316
|
};
|
|
318
317
|
/**
|
|
319
|
-
* Field-level media
|
|
318
|
+
* Field-level media storage options.
|
|
320
319
|
*/
|
|
321
320
|
export type FieldMediaLibraryOptions = {
|
|
322
321
|
/**
|
|
@@ -370,13 +369,13 @@ export type MediaFieldProps = {
|
|
|
370
369
|
*/
|
|
371
370
|
public_folder?: string;
|
|
372
371
|
/**
|
|
373
|
-
* Legacy media
|
|
372
|
+
* Legacy media storage option
|
|
374
373
|
* that allows only one library. This overrides the global `media_library` option. Use
|
|
375
374
|
* `media_libraries` instead to support multiple libraries.
|
|
376
375
|
*/
|
|
377
376
|
media_library?: MediaLibrary & FieldMediaLibraryOptions;
|
|
378
377
|
/**
|
|
379
|
-
* Unified media
|
|
378
|
+
* Unified media storage option that supports multiple
|
|
380
379
|
* libraries. This overrides the global `media_libraries` option.
|
|
381
380
|
*/
|
|
382
381
|
media_libraries?: MediaLibraries;
|
|
@@ -787,8 +786,7 @@ export type ComplexListFieldBaseProps = {
|
|
|
787
786
|
* Whether to save the field value at the top-level of the data file
|
|
788
787
|
* without the field name. If the `single_file` i18n structure is enabled, the lists will still be
|
|
789
788
|
* saved under locale keys. Default: `false`. See our
|
|
790
|
-
* [
|
|
791
|
-
* details.
|
|
789
|
+
* [documentation](https://sveltiacms.app/en/docs/fields/list#top-level-list) for details.
|
|
792
790
|
*/
|
|
793
791
|
root?: boolean;
|
|
794
792
|
};
|
|
@@ -1273,7 +1271,7 @@ export type I18nOptions = {
|
|
|
1273
1271
|
* Locales to be enabled when
|
|
1274
1272
|
* creating a new entry draft. If this option is used, users will be able to disable the output of
|
|
1275
1273
|
* non-default locales through the UI. See our
|
|
1276
|
-
* [
|
|
1274
|
+
* [documentation](https://sveltiacms.app/en/docs/i18n#disabling-non-default-locale-content) for
|
|
1277
1275
|
* details.
|
|
1278
1276
|
*/
|
|
1279
1277
|
initial_locales?: LocaleCode[] | "all" | "default";
|
|
@@ -1281,8 +1279,8 @@ export type I18nOptions = {
|
|
|
1281
1279
|
* Whether to save collection entries in all the locales.
|
|
1282
1280
|
* Default: `true`.
|
|
1283
1281
|
* @deprecated Use the `initial_locales` option instead, which provides more flexibility.
|
|
1284
|
-
* `save_all_locales: false` is equivalent to `initial_locales: all`. See our
|
|
1285
|
-
* https://
|
|
1282
|
+
* `save_all_locales: false` is equivalent to `initial_locales: all`. See our documentation
|
|
1283
|
+
* https://sveltiacms.app/en/docs/i18n#disabling-non-default-locale-content for details.
|
|
1286
1284
|
*/
|
|
1287
1285
|
save_all_locales?: boolean;
|
|
1288
1286
|
/**
|
|
@@ -1290,7 +1288,7 @@ export type I18nOptions = {
|
|
|
1290
1288
|
* used to add a canonical slug to entry files, which helps Sveltia CMS and some frameworks to link
|
|
1291
1289
|
* localized files when entry slugs are localized. The default property name is `translationKey`
|
|
1292
1290
|
* used in Hugo’s multilingual support, and the default value is the default locale’s slug. See our
|
|
1293
|
-
* [
|
|
1291
|
+
* [documentation](https://sveltiacms.app/en/docs/i18n#localizing-entry-slugs) for details.
|
|
1294
1292
|
*/
|
|
1295
1293
|
canonical_slug?: {
|
|
1296
1294
|
key?: string;
|
|
@@ -1321,8 +1319,7 @@ export type CollectionFile = {
|
|
|
1321
1319
|
* Name of a [Material Symbols
|
|
1322
1320
|
* icon](https://fonts.google.com/icons?icon.set=Material+Symbols) to be displayed in the collection
|
|
1323
1321
|
* file list and other places. See our
|
|
1324
|
-
* [
|
|
1325
|
-
* details.
|
|
1322
|
+
* [documentation](https://sveltiacms.app/en/docs/collections#icons) for details.
|
|
1326
1323
|
*/
|
|
1327
1324
|
icon?: string;
|
|
1328
1325
|
/**
|
|
@@ -1427,8 +1424,7 @@ export type SortableFields = {
|
|
|
1427
1424
|
fields: FieldKeyPath[];
|
|
1428
1425
|
/**
|
|
1429
1426
|
* Default sort settings. See our
|
|
1430
|
-
* [
|
|
1431
|
-
* details.
|
|
1427
|
+
* [documentation](https://sveltiacms.app/en/docs/collections/entries#sorting) for details.
|
|
1432
1428
|
*/
|
|
1433
1429
|
default?: SortableFieldsDefaultOptions;
|
|
1434
1430
|
};
|
|
@@ -1556,7 +1552,7 @@ export type CollectionMetaData = {
|
|
|
1556
1552
|
};
|
|
1557
1553
|
/**
|
|
1558
1554
|
* Index file inclusion options. See our
|
|
1559
|
-
* [
|
|
1555
|
+
* [documentation](https://sveltiacms.app/en/docs/collections/entries#managing-hugo-s-special-index-file)
|
|
1560
1556
|
* for details.
|
|
1561
1557
|
*/
|
|
1562
1558
|
export type CollectionIndexFile = {
|
|
@@ -1588,8 +1584,7 @@ export type CollectionIndexFile = {
|
|
|
1588
1584
|
};
|
|
1589
1585
|
/**
|
|
1590
1586
|
* A divider in the collection list and singleton list. See our
|
|
1591
|
-
* [
|
|
1592
|
-
* details.
|
|
1587
|
+
* [documentation](https://sveltiacms.app/en/docs/collections#dividers) for details.
|
|
1593
1588
|
*/
|
|
1594
1589
|
export type CollectionDivider = {
|
|
1595
1590
|
/**
|
|
@@ -1639,7 +1634,7 @@ export type CommonCollectionProps = {
|
|
|
1639
1634
|
* the global `media_folder` option. It can be a relative path from the project root if it starts
|
|
1640
1635
|
* with a slash. Otherwise it’s a path relative to the entry. If this option is omitted, the global
|
|
1641
1636
|
* `media_folder` option value is used. See our
|
|
1642
|
-
* [
|
|
1637
|
+
* [documentation](https://sveltiacms.app/en/docs/media/internal#collection-level-configuration) for
|
|
1643
1638
|
* details.
|
|
1644
1639
|
*/
|
|
1645
1640
|
media_folder?: string;
|
|
@@ -1687,8 +1682,8 @@ export type CommonCollectionProps = {
|
|
|
1687
1682
|
* Whether to double-quote all the strings values if the YAML
|
|
1688
1683
|
* format is used for file output. Default: `false`.
|
|
1689
1684
|
* @deprecated Use the global YAML format options. `yaml_quote: true` is equivalent to `quote:
|
|
1690
|
-
* double`. See our
|
|
1691
|
-
* details.
|
|
1685
|
+
* double`. See our documentation https://sveltiacms.app/en/docs/data-output#controlling-data-output
|
|
1686
|
+
* for details.
|
|
1692
1687
|
*/
|
|
1693
1688
|
yaml_quote?: boolean;
|
|
1694
1689
|
};
|
|
@@ -1738,16 +1733,16 @@ export type EntryCollectionProps = {
|
|
|
1738
1733
|
/**
|
|
1739
1734
|
* Item slug template. Default: `identifier_field` option value. It cannot
|
|
1740
1735
|
* contain slashes; to organize entries in subfolders, use the `path` option instead. It’s possible
|
|
1741
|
-
* to [localize the slug](https://
|
|
1742
|
-
* random ID](https://
|
|
1743
|
-
*
|
|
1744
|
-
*
|
|
1745
|
-
* slug).
|
|
1736
|
+
* to [localize the slug](https://sveltiacms.app/en/docs/i18n#localizing-entry-slugs) or [use a
|
|
1737
|
+
* random ID](https://sveltiacms.app/en/docs/collections/entries#slug-template-tags). Also, it’s
|
|
1738
|
+
* possible to show a special slug editor field in initial entry drafts by using `{{fields._slug}}`
|
|
1739
|
+
* (with an underscore prefix) or `{{fields._slug | localize}}` (to localize the slug).
|
|
1746
1740
|
*/
|
|
1747
1741
|
slug?: string;
|
|
1748
1742
|
/**
|
|
1749
1743
|
* The maximum number of characters allowed for an entry slug.
|
|
1750
1744
|
* Default: `Infinity`.
|
|
1745
|
+
* @deprecated Use the global `slug.maxlength` option instead.
|
|
1751
1746
|
*/
|
|
1752
1747
|
slug_length?: number;
|
|
1753
1748
|
/**
|
|
@@ -1758,8 +1753,7 @@ export type EntryCollectionProps = {
|
|
|
1758
1753
|
* Custom sortable fields. Default:
|
|
1759
1754
|
* `title`, `name`, `date`, `author` and `description`. For a Git backend, commit author and commit
|
|
1760
1755
|
* date are also included by default. See our
|
|
1761
|
-
* [
|
|
1762
|
-
* details.
|
|
1756
|
+
* [documentation](https://sveltiacms.app/en/docs/collections/entries#sorting) for details.
|
|
1763
1757
|
*/
|
|
1764
1758
|
sortable_fields?: FieldKeyPath[] | SortableFields;
|
|
1765
1759
|
/**
|
|
@@ -1781,7 +1775,7 @@ export type EntryCollectionProps = {
|
|
|
1781
1775
|
/**
|
|
1782
1776
|
* Index file inclusion options. If `true`,
|
|
1783
1777
|
* the default index file name is `_index`, which is used for Hugo’s special index file. See our
|
|
1784
|
-
* [
|
|
1778
|
+
* [documentation](https://sveltiacms.app/en/docs/collections/entries#managing-hugo-s-special-index-file)
|
|
1785
1779
|
* for details.
|
|
1786
1780
|
*/
|
|
1787
1781
|
index_file?: CollectionIndexFile | boolean;
|
|
@@ -1883,15 +1877,16 @@ export type GitBackendProps = {
|
|
|
1883
1877
|
* with any connected CI/CD provider. Default: `undefined`.
|
|
1884
1878
|
* @deprecated Use the new `skip_ci` option instead, which is more intuitive.
|
|
1885
1879
|
* `automatic_deployments: false` is equivalent to `skip_ci: true`, and `automatic_deployments:
|
|
1886
|
-
* true` is equivalent to `skip_ci: false`. See our
|
|
1887
|
-
* https://
|
|
1880
|
+
* true` is equivalent to `skip_ci: false`. See our documentation
|
|
1881
|
+
* https://sveltiacms.app/en/docs/deployments#disabling-automatic-deployments for details.
|
|
1888
1882
|
*/
|
|
1889
1883
|
automatic_deployments?: boolean;
|
|
1890
1884
|
/**
|
|
1891
1885
|
* Whether to enable or disable automatic deployments with any
|
|
1892
1886
|
* connected CI/CD provider, such as GitHub Actions or Cloudflare Pages. If `true`, the `[skip ci]`
|
|
1893
1887
|
* prefix will be added to commit messages. Default: `undefined`. See our
|
|
1894
|
-
* [
|
|
1888
|
+
* [documentation](https://sveltiacms.app/en/docs/deployments#disabling-automatic-deployments) for
|
|
1889
|
+
* details.
|
|
1895
1890
|
*/
|
|
1896
1891
|
skip_ci?: boolean;
|
|
1897
1892
|
};
|
|
@@ -2077,7 +2072,7 @@ export type TestBackend = {
|
|
|
2077
2072
|
*/
|
|
2078
2073
|
export type Backend = GitBackend | TestBackend;
|
|
2079
2074
|
/**
|
|
2080
|
-
* Global media
|
|
2075
|
+
* Global media storage options.
|
|
2081
2076
|
*/
|
|
2082
2077
|
export type GlobalMediaLibraryOptions = {
|
|
2083
2078
|
/**
|
|
@@ -2115,11 +2110,20 @@ export type SlugOptions = {
|
|
|
2115
2110
|
* String to replace sanitized characters. Default: `-`.
|
|
2116
2111
|
*/
|
|
2117
2112
|
sanitize_replacement?: string;
|
|
2113
|
+
/**
|
|
2114
|
+
* The maximum number of characters allowed for an entry slug.
|
|
2115
|
+
* Default: `Infinity`.
|
|
2116
|
+
*/
|
|
2117
|
+
maxlength?: number;
|
|
2118
2118
|
/**
|
|
2119
2119
|
* Whether to trim leading and trailing replacement characters. Default:
|
|
2120
2120
|
* `true`.
|
|
2121
2121
|
*/
|
|
2122
2122
|
trim?: boolean;
|
|
2123
|
+
/**
|
|
2124
|
+
* Whether to convert the slug to lowercase. Default: `true`.
|
|
2125
|
+
*/
|
|
2126
|
+
lowercase?: boolean;
|
|
2123
2127
|
};
|
|
2124
2128
|
/**
|
|
2125
2129
|
* JSON format options.
|
|
@@ -2184,7 +2188,7 @@ export type OutputOptions = {
|
|
|
2184
2188
|
export type CmsConfig = {
|
|
2185
2189
|
/**
|
|
2186
2190
|
* Whether to load YAML/JSON CMS configuration file(s) when
|
|
2187
|
-
* [manually initializing the CMS](https://
|
|
2191
|
+
* [manually initializing the CMS](https://sveltiacms.app/en/docs/api/initialization). This works
|
|
2188
2192
|
* only in the `CMS.init()` method’s `config` option. Default: `true`.
|
|
2189
2193
|
*/
|
|
2190
2194
|
load_config_file?: boolean;
|
|
@@ -2199,7 +2203,7 @@ export type CmsConfig = {
|
|
|
2199
2203
|
publish_mode?: "" | "simple" | "editorial_workflow";
|
|
2200
2204
|
/**
|
|
2201
2205
|
* Global internal media folder path, relative to the project’s
|
|
2202
|
-
* root directory. Required unless a cloud media
|
|
2206
|
+
* root directory. Required unless a cloud media storage is configured.
|
|
2203
2207
|
*/
|
|
2204
2208
|
media_folder?: string;
|
|
2205
2209
|
/**
|
|
@@ -2208,15 +2212,14 @@ export type CmsConfig = {
|
|
|
2208
2212
|
*/
|
|
2209
2213
|
public_folder?: string;
|
|
2210
2214
|
/**
|
|
2211
|
-
* Legacy media
|
|
2215
|
+
* Legacy media storage option
|
|
2212
2216
|
* that allows only one library. This overrides the global `media_library` option. Use
|
|
2213
|
-
* `media_libraries` instead to support multiple
|
|
2217
|
+
* `media_libraries` instead to support multiple storage providers.
|
|
2214
2218
|
*/
|
|
2215
2219
|
media_library?: MediaLibrary & GlobalMediaLibraryOptions;
|
|
2216
2220
|
/**
|
|
2217
|
-
* Unified media
|
|
2218
|
-
* libraries. See our
|
|
2219
|
-
* [README](https://github.com/sveltia/sveltia-cms#configuring-multiple-media-libraries) for
|
|
2221
|
+
* Unified media storage option that supports multiple
|
|
2222
|
+
* libraries. See our [documentation](https://sveltiacms.app/en/docs/media#configuration) for
|
|
2220
2223
|
* details.
|
|
2221
2224
|
*/
|
|
2222
2225
|
media_libraries?: MediaLibraries;
|
|
@@ -2263,7 +2266,7 @@ export type CmsConfig = {
|
|
|
2263
2266
|
* Set of singleton files, such as
|
|
2264
2267
|
* the CMS configuration file or the homepage file. They are not part of any collection and can be
|
|
2265
2268
|
* accessed directly through the collection list. The list can also contain dividers. See our
|
|
2266
|
-
* [
|
|
2269
|
+
* [documentation](https://sveltiacms.app/en/docs/collections/singletons) for details.
|
|
2267
2270
|
*/
|
|
2268
2271
|
singletons?: (CollectionFile | CollectionDivider)[];
|
|
2269
2272
|
/**
|
|
@@ -2276,7 +2279,7 @@ export type CmsConfig = {
|
|
|
2276
2279
|
editor?: EditorOptions;
|
|
2277
2280
|
/**
|
|
2278
2281
|
* Data output options. See our
|
|
2279
|
-
* [
|
|
2282
|
+
* [documentation](https://sveltiacms.app/en/docs/data-output#controlling-data-output) for details.
|
|
2280
2283
|
*/
|
|
2281
2284
|
output?: OutputOptions;
|
|
2282
2285
|
};
|