@sveltia/cms 0.64.0 → 0.66.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 CHANGED
@@ -65,6 +65,7 @@ The free, open source alternative to Netlify/Decap CMS is now in public beta, tu
65
65
  - [Localizing entry slugs](#localizing-entry-slugs)
66
66
  - [Disabling non-default locale content](#disabling-non-default-locale-content)
67
67
  - [Using a random ID for an entry slug](#using-a-random-id-for-an-entry-slug)
68
+ - [Configuring multiple media libraries](#configuring-multiple-media-libraries)
68
69
  - [Editing data files with a top-level list](#editing-data-files-with-a-top-level-list)
69
70
  - [Changing the input type of a DateTime field](#changing-the-input-type-of-a-datetime-field)
70
71
  - [Controlling data output](#controlling-data-output)
@@ -117,10 +118,10 @@ While we fix reported bugs as quickly as possible, usually within 24 hours, our
117
118
  - Ensuring substantial [compatibility with Netlify/Decap CMS](#compatibility)
118
119
  - Providing partial [compatibility with Static CMS](#compatibility-with-static-cms)
119
120
  - Tackling as many [Netlify/Decap CMS issues](https://github.com/decaporg/decap-cms/issues) as possible
120
- - So far, 180+ issues, or 370+ if including duplicates, have been effectively solved in Sveltia CMS
121
+ - So far, 185+ issues, or 375+ if including duplicates, have been effectively solved in Sveltia CMS
121
122
  - Target:
122
123
  - 200 issues, or 400 if including duplicates, by GA (almost there)
123
- - 300 issues, or 600 if including duplicates, in the future (yes, you read that right)
124
+ - 350 issues, or 600 if including duplicates, in the future (yes, you read that right)
124
125
  - Issues include everything from feature requests to bug reports and [issues closed as stale](https://github.com/decaporg/decap-cms/issues?q=is%3Aissue+%22Closing+as+stale%22) or without an effective solution, as well as [discussions](https://github.com/decaporg/decap-cms/discussions) and stalled [pull requests](https://github.com/decaporg/decap-cms/pulls)
125
126
  - Most of the bugs, including annoying crashes, are already solved
126
127
  - Many of their [top-voted features](https://github.com/decaporg/decap-cms/issues?q=is%3Aissue+is%3Aopen+sort%3Areactions-%2B1-desc) are on our table or already implemented in Sveltia CMS
@@ -129,7 +130,7 @@ While we fix reported bugs as quickly as possible, usually within 24 hours, our
129
130
  - Responding to requests from the maintainer’s clients
130
131
  - Making the code clean and maintainable
131
132
 
132
- ![180 Netlify/Decap CMS Issues Solved in Sveltia CMS](https://raw.githubusercontent.com/sveltia/sveltia-cms/main/docs/headline-1.webp?20250324)<br>
133
+ ![185 Netlify/Decap CMS Issues Solved in Sveltia CMS](https://raw.githubusercontent.com/sveltia/sveltia-cms/main/docs/headline-1.webp?20250327)<br>
133
134
 
134
135
  ## Differentiators
135
136
 
@@ -144,7 +145,7 @@ We hope Netlify/Decap CMS users will be pleased and surprised by the numerous im
144
145
  - Provides immersive dark mode.[^2] The UI theme follows the user’s system preference by default and can be changed in the application settings.
145
146
  - Comes with touch device support, such as larger buttons for easier tapping. While the UI is not yet optimized for small screens, it should work well with large tablets like iPad Pro or Pixel Tablet. Mobile support and other optimizations such as swipe navigation are planned after the 1.0 release.
146
147
  - Made with [Svelte](https://svelte.dev/), not React, means we can spend more time on UX rather than tedious state management. It also allows us to avoid common fatal React application crashes.[^113][^129] Best of all, Svelte offers great performance.
147
- - We build [our own UI library](https://github.com/sveltia/sveltia-ui) to ensure optimal usability without compromising accessibility.
148
+ - We build [our own UI library](https://github.com/sveltia/sveltia-ui), including custom dialogs,[^196] to ensure optimal usability without compromising accessibility.
148
149
  - The in-app Help menu provides all links to useful resources, including release notes, feedback and support.
149
150
  - Users can personalize the application with various settings, including appearance and language. Developer Mode can also be enabled.
150
151
  - Never miss out on the latest features and bug fixes by being notified when an update to the CMS is available.[^31] Then update to the latest version with a single click.[^66]
@@ -152,8 +153,8 @@ We hope Netlify/Decap CMS users will be pleased and surprised by the numerous im
152
153
  ### Better performance
153
154
 
154
155
  - Built completely from scratch with [Svelte](https://svelte.dev/) instead of forking React-based Netlify/Decap CMS. The app starts fast and stays fast with [no virtual DOM overhead](https://svelte.dev/blog/virtual-dom-is-pure-overhead).
155
- - The CMS is compiled and distributed as vanilla JavaScript. You can use it with any framework or static site generator (SSG) that can load static data files during the build process, including Astro, Eleventy, Hugo, Jekyll, Next.js, SvelteKit and VitePress.
156
- - Small footprint: The bundle size is around 500 KB when minified and [brotlied](https://en.wikipedia.org/wiki/Brotli), which is much lighter than Netlify CMS (1.5 MB), Decap CMS (1.9 MB) and Static CMS (2.6 MB).[^57][^64] This number is remarkable because even though we haven’t implemented [some features](#current-limitations) yet, we have added a lot of new features. That’s the power of Svelte + [Vite](https://vite.dev/).
156
+ - The CMS is compiled and distributed as vanilla JavaScript. You can use it with any framework or static site generator (SSG) that can load static files during the build process, including but not limited to Astro, Eleventy, Hugo, Jekyll, Next.js, SvelteKit and VitePress.
157
+ - Small footprint: The bundle size is less than 500 KB when minified and [brotlied](https://en.wikipedia.org/wiki/Brotli), which is much lighter than Netlify CMS (1.5 MB), Decap CMS (1.5 MB) and Static CMS (2.6 MB).[^57][^64] This number is remarkable because even though some Netlify/Decap CMS features are [omitted](#features-not-to-be-implemented) or [unimplemented](#current-limitations) in Sveltia CMS, we have added a lot of new features. That’s the power of Svelte + [Vite](https://vite.dev/).
157
158
  - We have upgraded from Svelte 4 to [Svelte 5](https://svelte.dev/blog/svelte-5-is-alive) to further improve performance, including an even smaller bundle size.
158
159
  - Uses the GraphQL API for GitHub and GitLab to quickly fetch content at once, so that entries and assets can be listed and searched instantly[^32][^65] (the useless `search` configuration option is therefore ignored). It also avoids the slowness and potential API rate limit violations caused by hundreds of requests with Relation widgets.[^14]
159
160
  - Saving entries and assets to GitHub is also much faster thanks to the [GraphQL mutation](https://github.blog/changelog/2021-09-13-a-simpler-api-for-authoring-commits/).
@@ -210,7 +211,8 @@ We hope Netlify/Decap CMS users will be pleased and surprised by the numerous im
210
211
 
211
212
  - Some servers and frameworks are known to remove the trailing slash from the CMS URL (`/admin`) depending on the configuration. In such cases, the config file is loaded from a root-relative URL (`/admin/config.yml`) instead of a regular relative URL (`./config.yml` = `/config.yml`) that results in a 404 Not Found error.[^107]
212
213
  - Supports a [JSON configuration file](#providing-a-json-configuration-file) that can be generated for bulk or complex collections.[^60]
213
- - TypeScript support: We try to keep our type definitions for `CMS.init()` and other methods complete, accurate, up-to-date and annotated.[^190][^191][^192][^193] This makes it easier to provide a site config object when [manually initializing](https://decapcms.org/docs/manual-initialization/) the CMS.
214
+ - Also supports [multiple configuration files](#providing-multiple-configuration-files).[^197]
215
+ - Improved TypeScript support: We try to keep our type definitions for `CMS.init()` and other methods complete, accurate, up-to-date and annotated.[^190][^191][^192][^193] This makes it easier to provide a site config object when [manually initializing](https://decapcms.org/docs/manual-initialization/) the CMS.
214
216
 
215
217
  ### Better backend support
216
218
 
@@ -224,7 +226,7 @@ We hope Netlify/Decap CMS users will be pleased and surprised by the numerous im
224
226
  - Users won’t get a 404 Not Found error when you sign in to the GitLab backend.[^115]
225
227
  - Features the all-new local backend that boosts DX. See the [productivity section](#better-productivity) above.
226
228
  - Developers can select the local and remote backends while working on a local server.
227
- - The Test backend stores changes in the browser’s [origin private file system](https://web.dev/articles/origin-private-file-system) (OPFS) instead of an in-memory cache. Developers can play with the CMS as much as they want without having to discard changes.[^194]
229
+ - The Test backend saves entries and assets in the browser’s [origin private file system](https://web.dev/articles/origin-private-file-system) (OPFS) so that changes are not discarded when the browser tab is closed or reloaded.[^194]
228
230
 
229
231
  ### Better i18n support
230
232
 
@@ -472,6 +474,9 @@ Sveltia CMS has been built with a multilingual architecture from the very beginn
472
474
  - Upload multiple assets at once, including files in nested folders, by browsing or dragging and dropping them into the library.[^5]
473
475
  - Sort or filter assets by name or file type.
474
476
  - View asset details, including size, dimensions, commit author/date and a list of entries that use the selected asset.
477
+ - Enhancements to media library integrations:
478
+ - Supports multiple media libraries with the [new `media_libraries` option](#configuring-multiple-media-libraries).[^195]
479
+ - The `max_file_size` option for the File/Image widget can be defined within the global `media_library` option, using `default` as the library name. It applies to all File/Image entry fields, as well as direct uploads to the Asset Library. The option can also be part of the [new `media_libraries` option](#configuring-multiple-media-libraries).
475
480
  - The global `media_folder` can be an empty string (or `.` or `/`) if you want to store assets in the root folder.
476
481
  - PDF documents are displayed with a thumbnail image in both the Asset Library and the Select File dialog, making it easier to find the file you’re looking for.[^38]
477
482
  - Assets stored in an entry-relative media folder are displayed in the Asset Library.[^142]
@@ -485,14 +490,14 @@ Sveltia CMS has been built with a multilingual architecture from the very beginn
485
490
 
486
491
  - The application renders within the dimensions of a [custom mount element](https://decapcms.org/docs/custom-mounting/), if exists.[^109]
487
492
  - A custom logo defined with the `logo_url` property is displayed on the global application header and the browser tab (favicon).[^134] A smaller logo is also correctly positioned on the authentication page.[^135]
488
- - `CMS.registerCustomFormat()` supports async parser/formatter functions.[^149]
493
+ - [`CMS.registerCustomFormat()`](https://decapcms.org/docs/custom-formatters/) supports async parser/formatter functions.[^149]
494
+ - The component definition for [`CMS.registerEditorComponent()`](https://decapcms.org/docs/custom-widgets/#registereditorcomponent) accepts the `icon` property. Developers can specify a Material Symbols icon name just like [custom collection icons](#using-a-custom-icon-for-a-collection).
489
495
 
490
496
  ### Better localization
491
497
 
492
498
  - The application UI locale is automatically selected based on the preferred language set with the browser.[^132] Users can also change the locale in the application settings. Therefore, the `locale` configuration option is ignored and `CMS.registerLocale()` is not required.
493
499
  - The List widget’s `label` and `label_singular` are not converted to lowercase, which is especially problematic in German, where all nouns are capitalized.[^98]
494
500
  - Long menu item labels, especially in non-English locales, don’t overflow the dropdown container.[^117]
495
- - We are migrating from [`svelte-i18n`](https://github.com/kaisermann/svelte-i18n) to the new [MessageFormat 2](https://github.com/unicode-org/message-format-wg)-based `sveltia-i18n` library for natural-sounding translations in every locale.
496
501
 
497
502
  ## Compatibility
498
503
 
@@ -532,11 +537,11 @@ These Netlify/Decap CMS features are not yet implemented in Sveltia CMS. We are
532
537
 
533
538
  - Comprehensive site config validation
534
539
  - [Localization](https://github.com/sveltia/sveltia-cms/blob/main/src/lib/locales/README.md) other than English and Japanese
540
+ - [Cloudinary](https://decapcms.org/docs/cloudinary/) and [Uploadcare](https://decapcms.org/docs/uploadcare/) media libraries ([#4](https://github.com/sveltia/sveltia-cms/discussions/4))
535
541
  - Field-specific media folders for the [File](https://decapcms.org/docs/widgets/#file) and [Image](https://decapcms.org/docs/widgets/#image) widgets
536
542
  - [Map](https://decapcms.org/docs/widgets/#map) widget
537
- - [Cloudinary](https://decapcms.org/docs/cloudinary/) and [Uploadcare](https://decapcms.org/docs/uploadcare/) media libraries ([#4](https://github.com/sveltia/sveltia-cms/discussions/4))
538
543
  - [Custom widgets](https://decapcms.org/docs/custom-widgets/)
539
- - [Custom editor components](https://decapcms.org/docs/custom-widgets/#registereditorcomponent): Support for `toPreview`, Object/List widgets, and `default` field option
544
+ - [Custom editor components](https://decapcms.org/docs/custom-widgets/#registereditorcomponent): Support for preview, Object/List widgets, and the `default` field option
540
545
  - [Custom previews](https://decapcms.org/docs/customization/) ([#51](https://github.com/sveltia/sveltia-cms/issues/51))
541
546
  - [Event hooks](https://decapcms.org/docs/registering-events/) ([#167](https://github.com/sveltia/sveltia-cms/issues/167))
542
547
 
@@ -661,6 +666,17 @@ Sveltia CMS supports a configuration file written in the JSON format in addition
661
666
 
662
667
  Alternatively, you can [manually initialize](https://decapcms.org/docs/manual-initialization/) the CMS with a JavaScript configuration object.
663
668
 
669
+ ### Providing multiple configuration files
670
+
671
+ With Sveltia CMS, developers can modularize the site configuration. Just provide multiple config links and the CMS will automatically merge them in the order of tag appearance using the [`deepmerge`](https://www.npmjs.com/package/deepmerge) library. It’s possible to use YAML, [JSON](#providing-a-json-configuration-file) or both.
672
+
673
+ ```html
674
+ <link href="/admin/config.yml" type="application/yaml" rel="cms-config-url" />
675
+ <link href="/admin/collections/authors.yml" type="application/yaml" rel="cms-config-url" />
676
+ <link href="/admin/collections/pages.yml" type="application/yaml" rel="cms-config-url" />
677
+ <link href="/admin/collections/posts.yml" type="application/yaml" rel="cms-config-url" />
678
+ ```
679
+
664
680
  ### Working around an authentication error
665
681
 
666
682
  If you get an “Authentication Aborted” error when trying to sign in to GitHub or GitLab using the authorization code flow, you may need to check your site’s [`Cross-Origin-Opener-Policy`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cross-Origin-Opener-Policy). The COOP header is not widely used, but it’s known to break the OAuth flow with a popup window. If that’s your case, changing `same-origin` to `same-origin-allow-popups` solves the problem. ([Discussion](https://github.com/sveltia/sveltia-cms/issues/131))
@@ -903,6 +919,38 @@ collections:
903
919
  slug: '{{uuid_short}}' # or {{uuid}} or {{uuid_shorter}}
904
920
  ```
905
921
 
922
+ ### Configuring multiple media libraries
923
+
924
+ The traditional [`media_library`](https://decapcms.org/docs/configuration-options/#media-library) option allows developers to configure only one media library:
925
+
926
+ ```yaml
927
+ media_library:
928
+ name: default
929
+ config:
930
+ max_file_size: 1024000
931
+ ```
932
+
933
+ Sveltia CMS has added support for multiple media libraries with the new `media_libraries` option so you can mix up the default media library (your repository), [Cloudinary](https://decapcms.org/docs/cloudinary/) and [Uploadcare](https://decapcms.org/docs/uploadcare/). It can be used as a global option as well as a File/Image field option.
934
+
935
+ ```yaml
936
+ media_libraries:
937
+ default:
938
+ config:
939
+ max_file_size: 1024000
940
+ # coming soon: image optimizer options
941
+ cloudinary:
942
+ config:
943
+ cloud_name: YOUR_CLOUD_NAME
944
+ api_key: YOUR_API_KEY
945
+ output_filename_only: true
946
+ uploadcare:
947
+ config:
948
+ publicKey: YOUR_PUBLIC_KEY
949
+ settings:
950
+ autoFilename: true
951
+ defaultOperations: '/resize/800x600/'
952
+ ```
953
+
906
954
  ### Editing data files with a top-level list
907
955
 
908
956
  Sveltia CMS allows you to edit and save a list at the top-level of a data file, without a field name. All you need to do is create a single List field with the new `root` option set to `true`. The configuration below reproduces [this Jekyll data file example](https://jekyllrb.com/docs/datafiles/#example-list-of-members):
@@ -1398,7 +1446,7 @@ This software is provided “as is” without any express or implied warranty. W
1398
1446
 
1399
1447
  [^112]: Netlify/Decap CMS [#5815](https://github.com/decaporg/decap-cms/issues/5815), [#6522](https://github.com/decaporg/decap-cms/issues/6522), [#6532](https://github.com/decaporg/decap-cms/issues/6532), [#6588](https://github.com/decaporg/decap-cms/issues/6588), [#6617](https://github.com/decaporg/decap-cms/issues/6617), [#6640](https://github.com/decaporg/decap-cms/issues/6640), [#6663](https://github.com/decaporg/decap-cms/issues/6663), [#6695](https://github.com/decaporg/decap-cms/issues/6695), [#6697](https://github.com/decaporg/decap-cms/issues/6697), [#6764](https://github.com/decaporg/decap-cms/issues/6764), [#6765](https://github.com/decaporg/decap-cms/issues/6765), [#6835](https://github.com/decaporg/decap-cms/issues/6835), [#6983](https://github.com/decaporg/decap-cms/issues/6983), [#7205](https://github.com/decaporg/decap-cms/issues/7205)
1400
1448
 
1401
- [^113]: Netlify/Decap CMS [#5656](https://github.com/decaporg/decap-cms/issues/5656), [#5837](https://github.com/decaporg/decap-cms/issues/5837), [#5972](https://github.com/decaporg/decap-cms/issues/5972), [#6476](https://github.com/decaporg/decap-cms/issues/6476), [#6516](https://github.com/decaporg/decap-cms/issues/6516), [#6930](https://github.com/decaporg/decap-cms/issues/6930), [#6965](https://github.com/decaporg/decap-cms/issues/6965), [#7080](https://github.com/decaporg/decap-cms/issues/7080), [#7105](https://github.com/decaporg/decap-cms/issues/7105), [#7106](https://github.com/decaporg/decap-cms/issues/7106), [#7119](https://github.com/decaporg/decap-cms/issues/7119), [#7176](https://github.com/decaporg/decap-cms/issues/7176), [#7194](https://github.com/decaporg/decap-cms/issues/7194), [#7244](https://github.com/decaporg/decap-cms/issues/7244), [#7278](https://github.com/decaporg/decap-cms/issues/7278), [#7301](https://github.com/decaporg/decap-cms/issues/7301), [#7342](https://github.com/decaporg/decap-cms/issues/7342), [#7348](https://github.com/decaporg/decap-cms/issues/7348), [#7354](https://github.com/decaporg/decap-cms/issues/7354), [#7376](https://github.com/decaporg/decap-cms/issues/7376), [#7408](https://github.com/decaporg/decap-cms/issues/7408), [#7412](https://github.com/decaporg/decap-cms/issues/7412), [#7413](https://github.com/decaporg/decap-cms/issues/7413), [#7422](https://github.com/decaporg/decap-cms/issues/7422), [#7427](https://github.com/decaporg/decap-cms/issues/7427), [#7434](https://github.com/decaporg/decap-cms/issues/7434) — These `removeChild` crashes are common in React apps, likely caused by a [browser extension](https://github.com/facebook/react/issues/17256) or [Google Translate](https://github.com/facebook/react/issues/11538).
1449
+ [^113]: Netlify/Decap CMS [#5656](https://github.com/decaporg/decap-cms/issues/5656), [#5837](https://github.com/decaporg/decap-cms/issues/5837), [#5972](https://github.com/decaporg/decap-cms/issues/5972), [#6476](https://github.com/decaporg/decap-cms/issues/6476), [#6516](https://github.com/decaporg/decap-cms/issues/6516), [#6930](https://github.com/decaporg/decap-cms/issues/6930), [#6965](https://github.com/decaporg/decap-cms/issues/6965), [#7080](https://github.com/decaporg/decap-cms/issues/7080), [#7105](https://github.com/decaporg/decap-cms/issues/7105), [#7106](https://github.com/decaporg/decap-cms/issues/7106), [#7119](https://github.com/decaporg/decap-cms/issues/7119), [#7176](https://github.com/decaporg/decap-cms/issues/7176), [#7194](https://github.com/decaporg/decap-cms/issues/7194), [#7244](https://github.com/decaporg/decap-cms/issues/7244), [#7278](https://github.com/decaporg/decap-cms/issues/7278), [#7301](https://github.com/decaporg/decap-cms/issues/7301), [#7342](https://github.com/decaporg/decap-cms/issues/7342), [#7348](https://github.com/decaporg/decap-cms/issues/7348), [#7354](https://github.com/decaporg/decap-cms/issues/7354), [#7376](https://github.com/decaporg/decap-cms/issues/7376), [#7408](https://github.com/decaporg/decap-cms/issues/7408), [#7412](https://github.com/decaporg/decap-cms/issues/7412), [#7413](https://github.com/decaporg/decap-cms/issues/7413), [#7422](https://github.com/decaporg/decap-cms/issues/7422), [#7427](https://github.com/decaporg/decap-cms/issues/7427), [#7434](https://github.com/decaporg/decap-cms/issues/7434), [#7438](https://github.com/decaporg/decap-cms/issues/7438) — These `removeChild` crashes are common in React apps, likely caused by a [browser extension](https://github.com/facebook/react/issues/17256) or [Google Translate](https://github.com/facebook/react/issues/11538).
1402
1450
 
1403
1451
  [^114]: Netlify/Decap CMS [#5029](https://github.com/decaporg/decap-cms/issues/5029), [#5048](https://github.com/decaporg/decap-cms/issues/5048)
1404
1452
 
@@ -1561,3 +1609,9 @@ This software is provided “as is” without any express or implied warranty. W
1561
1609
  [^193]: Netlify/Decap CMS [#6800](https://github.com/decaporg/decap-cms/issues/6800)
1562
1610
 
1563
1611
  [^194]: Netlify/Decap CMS [#7157](https://github.com/decaporg/decap-cms/issues/7157)
1612
+
1613
+ [^195]: Netlify/Decap CMS [#5901](https://github.com/decaporg/decap-cms/issues/5901)
1614
+
1615
+ [^196]: Netlify/Decap CMS [#3057](https://github.com/decaporg/decap-cms/issues/3057)
1616
+
1617
+ [^197]: Netlify/Decap CMS [#3457](https://github.com/decaporg/decap-cms/issues/3457), [#3624](https://github.com/decaporg/decap-cms/issues/3624)