@sveltia/cms 0.72.4 → 0.73.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.72.4",
3
+ "version": "0.73.0",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "repository": {
package/types/public.d.ts CHANGED
@@ -12,7 +12,7 @@ export type FieldKeyPath = string;
12
12
  /**
13
13
  * Supported media library name.
14
14
  */
15
- export type MediaLibraryName = "default" | "cloudinary" | "uploadcare";
15
+ export type MediaLibraryName = "default" | "cloudinary" | "uploadcare" | "stock_assets";
16
16
  /**
17
17
  * Supported raster image format.
18
18
  */
@@ -76,7 +76,7 @@ export type FileTransformations = ImageTransformations;
76
76
  /**
77
77
  * Configuration for the default media library.
78
78
  */
79
- export type DefaultMediaLibraryOptions = {
79
+ export type DefaultMediaLibraryConfig = {
80
80
  /**
81
81
  * Maximum file size in bytes that can be accepted for uploading.
82
82
  */
@@ -95,7 +95,7 @@ export type DefaultMediaLibrary = {
95
95
  /**
96
96
  * Configuration for the default media library.
97
97
  */
98
- config?: DefaultMediaLibraryOptions;
98
+ config?: DefaultMediaLibraryConfig;
99
99
  };
100
100
  /**
101
101
  * Options for the Cloudinary media library.
@@ -153,14 +153,29 @@ export type UploadcareMediaLibrary = {
153
153
  */
154
154
  settings?: UploadcareMediaLibrarySettings;
155
155
  };
156
+ /**
157
+ * Name of supported stock photo/video provider.
158
+ */
159
+ export type StockAssetProviderName = "pexels" | "pixabay" | "unsplash";
160
+ /**
161
+ * Options for the unified stock photo/video media library.
162
+ */
163
+ export type StockAssetMediaLibrary = {
164
+ /**
165
+ * Enabled stock photo/video providers. The stock
166
+ * photo/video section in the asset browser is hidden if an empty array is given. Default: all
167
+ * supported providers.
168
+ */
169
+ providers?: StockAssetProviderName[];
170
+ };
156
171
  /**
157
172
  * Supported media library.
158
173
  */
159
- export type MediaLibrary = DefaultMediaLibrary | CloudinaryMediaLibrary | UploadcareMediaLibrary;
174
+ export type MediaLibrary = DefaultMediaLibrary | CloudinaryMediaLibrary | UploadcareMediaLibrary | StockAssetMediaLibrary;
160
175
  /**
161
176
  * Unified media library option that supports multiple libraries.
162
177
  */
163
- export type MediaLibraryMap = {
178
+ export type MediaLibraries = {
164
179
  /**
165
180
  * Options for the default media library.
166
181
  */
@@ -173,6 +188,11 @@ export type MediaLibraryMap = {
173
188
  * Options for the Uploadcare media library.
174
189
  */
175
190
  uploadcare?: UploadcareMediaLibrary;
191
+ /**
192
+ * Options for the unified stock photo/video media
193
+ * library.
194
+ */
195
+ stock_assets?: StockAssetMediaLibrary;
176
196
  };
177
197
  /**
178
198
  * Common field properties.
@@ -268,7 +288,7 @@ export type MediaFieldProps = {
268
288
  * Unified media library option that supports multiple
269
289
  * libraries. This overrides the global `media_libraries` option.
270
290
  */
271
- media_libraries?: MediaLibraryMap;
291
+ media_libraries?: MediaLibraries;
272
292
  /**
273
293
  * Whether to enable multiple item selection in an external
274
294
  * media library. Default: `true`.
@@ -1622,7 +1642,7 @@ export type SiteConfig = {
1622
1642
  * Unified media library option that supports multiple
1623
1643
  * libraries.
1624
1644
  */
1625
- media_libraries?: MediaLibraryMap;
1645
+ media_libraries?: MediaLibraries;
1626
1646
  /**
1627
1647
  * Site URL. Default: current site’s origin (`location.origin`).
1628
1648
  */