@sveltia/cms 0.67.1 → 0.69.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 +52 -8
- package/dist/sveltia-cms.js +167 -169
- package/dist/sveltia-cms.js.map +1 -1
- package/dist/sveltia-cms.mjs +152 -154
- package/dist/sveltia-cms.mjs.map +1 -1
- package/package.json +2 -2
- package/types/public.d.ts +66 -0
package/README.md
CHANGED
|
@@ -67,6 +67,7 @@ The free, open source alternative to Netlify/Decap CMS is now in public beta, tu
|
|
|
67
67
|
- [Disabling non-default locale content](#disabling-non-default-locale-content)
|
|
68
68
|
- [Using a random ID for an entry slug](#using-a-random-id-for-an-entry-slug)
|
|
69
69
|
- [Configuring multiple media libraries](#configuring-multiple-media-libraries)
|
|
70
|
+
- [Optimizing images for upload](#optimizing-images-for-upload)
|
|
70
71
|
- [Editing data files with a top-level list](#editing-data-files-with-a-top-level-list)
|
|
71
72
|
- [Changing the input type of a DateTime field](#changing-the-input-type-of-a-datetime-field)
|
|
72
73
|
- [Controlling data output](#controlling-data-output)
|
|
@@ -78,6 +79,7 @@ The free, open source alternative to Netlify/Decap CMS is now in public beta, tu
|
|
|
78
79
|
- [Roadmap](#roadmap)
|
|
79
80
|
- [Before the 1.0 release](#before-the-10-release)
|
|
80
81
|
- [After the 1.0 release](#after-the-10-release)
|
|
82
|
+
- [Trivia](#trivia)
|
|
81
83
|
- [Related links](#related-links)
|
|
82
84
|
- [As seen on](#as-seen-on)
|
|
83
85
|
- [Disclaimer](#disclaimer)
|
|
@@ -102,8 +104,6 @@ Sveltia CMS is the only project that doesn’t inherit the complexity, technical
|
|
|
102
104
|
|
|
103
105
|
While Sveltia CMS is specifically designed to replace legacy Netlify CMS instances, it also aims to serve as a substitute for the other Netlify CMS successors. We hope that, especially with the [robust i18n support](#better-i18n-support), our product will eventually become an attractive choice for anyone looking for a free headless CMS.
|
|
104
106
|
|
|
105
|
-
Trivia: The [original version of Netlify CMS](https://github.com/netlify/netlify-cms-legacy) was built with Ember before being rewritten in React. And now we are completely rewriting it in Svelte. So this is effectively the second time the application has gone through a framework migration.
|
|
106
|
-
|
|
107
107
|
### Our goals
|
|
108
108
|
|
|
109
109
|
- Making Sveltia CMS a viable, definitive successor to Netlify CMS
|
|
@@ -116,12 +116,12 @@ Trivia: The [original version of Netlify CMS](https://github.com/netlify/netlify
|
|
|
116
116
|
|
|
117
117
|
Sveltia CMS is currently in **beta** and version 1.0 (GA) is expected to ship in mid-2025. Check our [release notes](https://github.com/sveltia/sveltia-cms/releases) for updates. See also our [roadmap](#roadmap).
|
|
118
118
|
|
|
119
|
-
While we fix reported bugs as quickly as possible, usually within 24 hours, our overall progress may be slower than you think. The thing is, it’s not just a personal project of [@kyoshino](https://github.com/kyoshino), but also involves
|
|
119
|
+
While we fix reported bugs as quickly as possible, usually within 24 hours, our overall progress may be slower than you think. The thing is, it’s not just a personal project of [@kyoshino](https://github.com/kyoshino), but also a complicated system that involves various kinds of activities that require considerable effort:
|
|
120
120
|
|
|
121
121
|
- Ensuring substantial [compatibility with Netlify/Decap CMS](#compatibility)
|
|
122
122
|
- Providing partial [compatibility with Static CMS](#compatibility-with-static-cms)
|
|
123
123
|
- Tackling as many [Netlify/Decap CMS issues](https://github.com/decaporg/decap-cms/issues) as possible
|
|
124
|
-
- So far,
|
|
124
|
+
- So far, 190+ issues, or 380+ if including duplicates, have been effectively solved in Sveltia CMS
|
|
125
125
|
- Target:
|
|
126
126
|
- 200 issues, or 400 if including duplicates, by GA (almost there)
|
|
127
127
|
- 350 issues, or 600 if including duplicates, in the future
|
|
@@ -133,7 +133,7 @@ While we fix reported bugs as quickly as possible, usually within 24 hours, our
|
|
|
133
133
|
- Responding to requests from the maintainer’s clients
|
|
134
134
|
- Making the code clean and maintainable
|
|
135
135
|
|
|
136
|
-
<br>
|
|
137
137
|
|
|
138
138
|
## Differentiators
|
|
139
139
|
|
|
@@ -228,7 +228,7 @@ We hope Netlify/Decap CMS users will be pleased and surprised by the numerous im
|
|
|
228
228
|
- Users won’t get a 404 Not Found error when you sign in to the GitLab backend.[^115]
|
|
229
229
|
- Features the all-new local backend that boosts DX. See the [productivity section](#better-productivity) above.
|
|
230
230
|
- Developers can select the local and remote backends while working on a local server.
|
|
231
|
-
- 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]
|
|
231
|
+
- 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] The persistent storage is not yet supported in Safari.
|
|
232
232
|
|
|
233
233
|
### Better i18n support
|
|
234
234
|
|
|
@@ -366,6 +366,7 @@ Sveltia CMS has been built with a multilingual architecture from the very beginn
|
|
|
366
366
|
- Code
|
|
367
367
|
- More than 300 languages are available, thanks to [Prism](https://prismjs.com/)’s extensive language support.
|
|
368
368
|
- The language switcher always appears in the user interface, so it’s easy to spot and change the selected language.
|
|
369
|
+
- Dynamic loading of language modes work as expected.[^198]
|
|
369
370
|
- Code fields under a List field work as expected, saving both code and language.[^181]
|
|
370
371
|
- Color
|
|
371
372
|
- The widget doesn’t cause scrolling issues.[^128]
|
|
@@ -477,6 +478,7 @@ Sveltia CMS has been built with a multilingual architecture from the very beginn
|
|
|
477
478
|
- Sort or filter assets by name or file type.
|
|
478
479
|
- View asset details, including size, dimensions, commit author/date and a list of entries that use the selected asset.
|
|
479
480
|
- Enhancements to media library integrations:
|
|
481
|
+
- The default media library comes with a [built-in image optimizer](#optimizing-images-for-upload). With a few lines of configuration, images uploaded by users are automatically converted to WebP format for reduced size,[^199] and it’s also possible to specify a maximum width and/or height.[^200] SVG images can also be optimized.
|
|
480
482
|
- Supports multiple media libraries with the [new `media_libraries` option](#configuring-multiple-media-libraries).[^195]
|
|
481
483
|
- 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).
|
|
482
484
|
- The global `media_folder` can be an empty string (or `.` or `/`) if you want to store assets in the root folder.
|
|
@@ -577,6 +579,7 @@ Sveltia CMS provides partial compatibility with [Static CMS](https://github.com/
|
|
|
577
579
|
### Other notes
|
|
578
580
|
|
|
579
581
|
- Make sure you’re using the latest stable version of a modern web browser. Firefox ESR and its derivatives, including Tor Browser and Mullvad Browser, are not officially supported, although they may still work. The [local repository workflow](#working-with-a-local-git-repository) requires Chrome, Edge or another Chromium-based browser.
|
|
582
|
+
- The persistent storage for the Test backend is not yet supported in Safari.
|
|
580
583
|
- Sveltia CMS requires a [secure context](https://developer.mozilla.org/en-US/docs/Web/Security/Secure_Contexts), meaning it only works with HTTPS, `localhost` or `127.0.0.1` URLs. If you’re running a remote server yourself and the content is served over HTTP, get a TLS certificate from [Let’s Encrypt](https://letsencrypt.org/).
|
|
581
584
|
- The GitLab backend requires GitLab 16.3 or later.
|
|
582
585
|
- Found a compatibility issue or other missing feature? [Let us know](https://github.com/sveltia/sveltia-cms/issues/new?labels=bug). Bear in mind that undocumented behaviour can easily be overlooked.
|
|
@@ -824,7 +827,7 @@ Note that the Translation button on the pane header only translates empty fields
|
|
|
824
827
|
If you have upgraded to DeepL API Pro, provide your new Authentication Key:
|
|
825
828
|
|
|
826
829
|
1. Click the Account button in the upper right corner, then click Settings.
|
|
827
|
-
1. Select the
|
|
830
|
+
1. Select the Contents tab.
|
|
828
831
|
1. Replace your free API key ending with `:fx` with the new paid API key in the DeepL API Authentication Key field.
|
|
829
832
|
1. Close the Settings dialog.
|
|
830
833
|
|
|
@@ -943,7 +946,8 @@ media_libraries:
|
|
|
943
946
|
default:
|
|
944
947
|
config:
|
|
945
948
|
max_file_size: 1024000
|
|
946
|
-
|
|
949
|
+
transformations:
|
|
950
|
+
# See the next section
|
|
947
951
|
cloudinary:
|
|
948
952
|
config:
|
|
949
953
|
cloud_name: YOUR_CLOUD_NAME
|
|
@@ -957,6 +961,36 @@ media_libraries:
|
|
|
957
961
|
defaultOperations: '/resize/800x600/'
|
|
958
962
|
```
|
|
959
963
|
|
|
964
|
+
### Optimizing images for upload
|
|
965
|
+
|
|
966
|
+
Ever wanted to prevent end-users from adding huge images to your repository? The built-in optimizer in Sveltia CMS makes developers’ lives easier with a simple configuration like this:
|
|
967
|
+
|
|
968
|
+
```yaml
|
|
969
|
+
media_libraries:
|
|
970
|
+
default:
|
|
971
|
+
config:
|
|
972
|
+
transformations:
|
|
973
|
+
raster_image: # original format
|
|
974
|
+
format: webp # new format, only `webp` is supported
|
|
975
|
+
quality: 85 # default: 85
|
|
976
|
+
width: 2048 # default: original size
|
|
977
|
+
height: 2048 # default: original size
|
|
978
|
+
svg:
|
|
979
|
+
optimize: true
|
|
980
|
+
```
|
|
981
|
+
|
|
982
|
+
Then, whenever a user selects images to upload, those images are automatically optimized, all within the browser. Raster images such as PNG and JPEG are automatically converted to WebP format and resized if necessary. SVG images are minified using the [SVGO](https://github.com/svg/svgo) library.
|
|
983
|
+
|
|
984
|
+
In case you’re not aware, [WebP](https://developers.google.com/speed/webp) offers better compression than JPEG and PNG and is now [widely supported](https://caniuse.com/webp) across major browsers. So there is no reason not to use WebP on the web.
|
|
985
|
+
|
|
986
|
+
- As [noted above](#configuring-multiple-media-libraries), the `media_libraries` option can be global at the root level of `config.yml`, which applies to both entry fields and the Asset Library, or field-specific for the File/Image widgets.
|
|
987
|
+
- `raster_image` applies to any supported raster image format: `avif`, `bmp`, `gif`, `jpeg`, `png` and `webp`. If you like, you can use a specific format as key instead of `raster_image`.
|
|
988
|
+
- The `width` and `height` options are the maximum width and height, respectively. If an image is larger than the specified dimension, it will be scaled down. Smaller images will not be resized.
|
|
989
|
+
- File processing is a bit slow on Safari because [native WebP encoding](https://caniuse.com/mdn-api_htmlcanvaselement_toblob_type_parameter_webp) is not yet supported and a [third-party library](https://github.com/jamsinclair/jSquash) is used instead.
|
|
990
|
+
- AVIF conversion is not supported at this time because no browser has native encoding support and the library is very slow.
|
|
991
|
+
- This feature is not intended for creating image variants in different formats and sizes. It should be done with a framework during the build process.
|
|
992
|
+
- We may add more transformation options in the future.
|
|
993
|
+
|
|
960
994
|
### Editing data files with a top-level list
|
|
961
995
|
|
|
962
996
|
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):
|
|
@@ -1211,6 +1245,10 @@ See [Contributing to Sveltia CMS](https://github.com/sveltia/sveltia-cms/blob/ma
|
|
|
1211
1245
|
- Official starter templates for the most popular frameworks, including SvelteKit and Next.js
|
|
1212
1246
|
- and so much more!
|
|
1213
1247
|
|
|
1248
|
+
## Trivia
|
|
1249
|
+
|
|
1250
|
+
- The [original version of Netlify CMS](https://github.com/netlify/netlify-cms-legacy) was built with Ember before being rewritten in React. And now we are completely rewriting it in Svelte. So this is effectively the second time the application has gone through a framework migration.
|
|
1251
|
+
|
|
1214
1252
|
## Related links
|
|
1215
1253
|
|
|
1216
1254
|
- Introducing Sveltia CMS: a short technical presentation by [@kyoshino](https://github.com/kyoshino) during the _This Week in Svelte_ online meetup on March 31, 2023 — [recording](https://youtu.be/-YjLubiieYs?t=1660) & [slides](https://docs.google.com/presentation/d/1Wi4ty-1AwOp2-zy7LctmzCV4rrdYPfke9NGhO0DdRdM)
|
|
@@ -1619,3 +1657,9 @@ This software is provided “as is” without any express or implied warranty. W
|
|
|
1619
1657
|
[^196]: Netlify/Decap CMS [#3057](https://github.com/decaporg/decap-cms/issues/3057) — We use Svelte though.
|
|
1620
1658
|
|
|
1621
1659
|
[^197]: Netlify/Decap CMS [#3457](https://github.com/decaporg/decap-cms/issues/3457), [#3624](https://github.com/decaporg/decap-cms/issues/3624)
|
|
1660
|
+
|
|
1661
|
+
[^198]: Netlify/Decap CMS [#7442](https://github.com/decaporg/decap-cms/issues/7442)
|
|
1662
|
+
|
|
1663
|
+
[^199]: Netlify/Decap CMS [#5419](https://github.com/decaporg/decap-cms/issues/5419), [#7107](https://github.com/decaporg/decap-cms/issues/7107)
|
|
1664
|
+
|
|
1665
|
+
[^200]: Netlify/Decap CMS [#1322](https://github.com/decaporg/decap-cms/issues/1322), [#6442](https://github.com/decaporg/decap-cms/issues/6442)
|