@sveltia/cms 0.63.1 → 0.65.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 +59 -15
- package/dist/sveltia-cms.js +177 -177
- package/dist/sveltia-cms.js.map +1 -1
- package/dist/sveltia-cms.mjs +177 -177
- package/dist/sveltia-cms.mjs.map +1 -1
- package/package.json +1 -1
- package/types/public.d.ts +79 -31
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
|
+
- [Configure multiple media libraries](#configure-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,8 +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,
|
|
121
|
-
- Target:
|
|
121
|
+
- So far, 185+ issues, or 375+ if including duplicates, have been effectively solved in Sveltia CMS
|
|
122
|
+
- Target:
|
|
123
|
+
- 200 issues, or 400 if including duplicates, by GA (almost there)
|
|
124
|
+
- 350 issues, or 600 if including duplicates, in the future (yes, you read that right)
|
|
122
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)
|
|
123
126
|
- Most of the bugs, including annoying crashes, are already solved
|
|
124
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
|
|
@@ -127,7 +130,7 @@ While we fix reported bugs as quickly as possible, usually within 24 hours, our
|
|
|
127
130
|
- Responding to requests from the maintainer’s clients
|
|
128
131
|
- Making the code clean and maintainable
|
|
129
132
|
|
|
130
|
-
<br>
|
|
131
134
|
|
|
132
135
|
## Differentiators
|
|
133
136
|
|
|
@@ -150,8 +153,8 @@ We hope Netlify/Decap CMS users will be pleased and surprised by the numerous im
|
|
|
150
153
|
### Better performance
|
|
151
154
|
|
|
152
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).
|
|
153
|
-
- 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
|
|
154
|
-
- Small footprint: The bundle size is
|
|
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/).
|
|
155
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.
|
|
156
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]
|
|
157
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/).
|
|
@@ -208,7 +211,7 @@ We hope Netlify/Decap CMS users will be pleased and surprised by the numerous im
|
|
|
208
211
|
|
|
209
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]
|
|
210
213
|
- Supports a [JSON configuration file](#providing-a-json-configuration-file) that can be generated for bulk or complex collections.[^60]
|
|
211
|
-
- We keep our
|
|
214
|
+
- 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.
|
|
212
215
|
|
|
213
216
|
### Better backend support
|
|
214
217
|
|
|
@@ -222,6 +225,7 @@ We hope Netlify/Decap CMS users will be pleased and surprised by the numerous im
|
|
|
222
225
|
- Users won’t get a 404 Not Found error when you sign in to the GitLab backend.[^115]
|
|
223
226
|
- Features the all-new local backend that boosts DX. See the [productivity section](#better-productivity) above.
|
|
224
227
|
- Developers can select the local and remote backends while working on a local server.
|
|
228
|
+
- The Test backend stores entries and assets in the browser’s [origin private file system](https://web.dev/articles/origin-private-file-system) (OPFS). Developers are free to play with the CMS without discarding changes.[^194]
|
|
225
229
|
|
|
226
230
|
### Better i18n support
|
|
227
231
|
|
|
@@ -406,7 +410,8 @@ Sveltia CMS has been built with a multilingual architecture from the very beginn
|
|
|
406
410
|
- `slug` can be used for `value_field` to show all available options instead of just one in some situations.[^91]
|
|
407
411
|
- Template strings with a wildcard like `{{cities.*.name}}` can also be used for `value_field`.[^94]
|
|
408
412
|
- `display_fields` is displayed in the Preview Pane instead of `value_field`.
|
|
409
|
-
- The redundant `search_fields` option is
|
|
413
|
+
- The redundant `search_fields` option is optional in Sveltia CMS, as it defaults to `display_fields`, `value_field` or the collection’s `identifier_field`, which is `title` by default.
|
|
414
|
+
- The `value_field` option is also optional in Sveltia CMS, as it defaults to entry slugs (`{{slug}}`).
|
|
410
415
|
- A new item created in a referenced collection is immediately available in the options.[^138]
|
|
411
416
|
- Select
|
|
412
417
|
- It’s possible to select an option with value `0`.[^56]
|
|
@@ -476,19 +481,22 @@ Sveltia CMS has been built with a multilingual architecture from the very beginn
|
|
|
476
481
|
- Users can add assets using the Quick Add button in the upper right corner of the application.
|
|
477
482
|
- Files are uploaded with their original names, without converting uppercase letters and spaces to lowercase letters and hyphens.[^97]
|
|
478
483
|
- No fatal application crash when uploading assets.[^112]
|
|
484
|
+
- Supports multiple media libraries with the [new `media_libraries` option](#configure-multiple-media-libraries).[^195]
|
|
485
|
+
- 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](#configure-multiple-media-libraries).
|
|
479
486
|
|
|
480
487
|
### Better customization
|
|
481
488
|
|
|
482
489
|
- The application renders within the dimensions of a [custom mount element](https://decapcms.org/docs/custom-mounting/), if exists.[^109]
|
|
483
490
|
- 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]
|
|
484
|
-
- `CMS.registerCustomFormat()` supports async parser/formatter functions.[^149]
|
|
491
|
+
- [`CMS.registerCustomFormat()`](https://decapcms.org/docs/custom-formatters/) supports async parser/formatter functions.[^149]
|
|
492
|
+
- 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).
|
|
485
493
|
|
|
486
494
|
### Better localization
|
|
487
495
|
|
|
488
496
|
- 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.
|
|
489
497
|
- 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]
|
|
490
498
|
- Long menu item labels, especially in non-English locales, don’t overflow the dropdown container.[^117]
|
|
491
|
-
- 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.
|
|
499
|
+
- 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.
|
|
492
500
|
|
|
493
501
|
## Compatibility
|
|
494
502
|
|
|
@@ -514,6 +522,11 @@ However, 100% feature parity is not planned, and some features are still missing
|
|
|
514
522
|
- The theme and keymap inline settings of the Code widget, along with support for some languages: We use the [Prism](https://prismjs.com/)-powered code block functionality in Lexical instead of [CodeMirror](https://codemirror.net/). Prism may be [replaced by Shiki](https://github.com/facebook/lexical/issues/6575) in the future.
|
|
515
523
|
- Remark plugins for the Markdown widget: Not compatible with our Lexical-based rich text editor.
|
|
516
524
|
- Support for an absolute URL in the [`public_folder`](https://decapcms.org/docs/configuration-options/#public-folder) option: Such configuration is not recommended, as stated in the Netlify/Decap CMS document.
|
|
525
|
+
- Performance-related options: Sveltia CMS has [drastically improved performance](#better-performance) with GraphQL enabled by default, so these are no longer relevant:
|
|
526
|
+
- Global: [`search`](https://decapcms.org/docs/configuration-options/#search)
|
|
527
|
+
- Backend: [`use_graphql`](https://decapcms.org/docs/github-backend/#graphql-api)
|
|
528
|
+
- Relation widget: `options_length`
|
|
529
|
+
- The global [`locale`](https://decapcms.org/docs/configuration-options/#locale) option and `CMS.registerLocale()` method: Sveltia CMS automatically detects the user’s preferred language and changes the UI locale as [mentioned above](#better-localization).
|
|
517
530
|
- [Undocumented methods](https://github.com/sveltia/sveltia-cms/blob/c69446da7bb0bab7405be741c0f92850c5dddfa8/src/main.js#L14-L37) exposed on the `CMS` object: This includes custom backends and custom media libraries, if any. We may support these features in the future, but our implementation would likely be incompatible with Netlify/Decap CMS.
|
|
518
531
|
- Any other undocumented options/features. Exceptions apply.
|
|
519
532
|
|
|
@@ -523,11 +536,11 @@ These Netlify/Decap CMS features are not yet implemented in Sveltia CMS. We are
|
|
|
523
536
|
|
|
524
537
|
- Comprehensive site config validation
|
|
525
538
|
- [Localization](https://github.com/sveltia/sveltia-cms/blob/main/src/lib/locales/README.md) other than English and Japanese
|
|
526
|
-
- [
|
|
539
|
+
- [Cloudinary](https://decapcms.org/docs/cloudinary/) and [Uploadcare](https://decapcms.org/docs/uploadcare/) media libraries ([#4](https://github.com/sveltia/sveltia-cms/discussions/4))
|
|
527
540
|
- Field-specific media folders for the [File](https://decapcms.org/docs/widgets/#file) and [Image](https://decapcms.org/docs/widgets/#image) widgets
|
|
528
541
|
- [Map](https://decapcms.org/docs/widgets/#map) widget
|
|
529
|
-
- [
|
|
530
|
-
- [Custom
|
|
542
|
+
- [Custom widgets](https://decapcms.org/docs/custom-widgets/)
|
|
543
|
+
- [Custom editor components](https://decapcms.org/docs/custom-widgets/#registereditorcomponent): Support for preview, Object/List widgets, and the `default` field option
|
|
531
544
|
- [Custom previews](https://decapcms.org/docs/customization/) ([#51](https://github.com/sveltia/sveltia-cms/issues/51))
|
|
532
545
|
- [Event hooks](https://decapcms.org/docs/registering-events/) ([#167](https://github.com/sveltia/sveltia-cms/issues/167))
|
|
533
546
|
|
|
@@ -575,11 +588,11 @@ As the product evolves, we’ll implement a built-in configuration editor and pr
|
|
|
575
588
|
|
|
576
589
|
Here are some starter kits for popular frameworks created by community members. More to come! (Note: These third-party resources are not necessarily reviewed by the Sveltia CMS team.)
|
|
577
590
|
|
|
578
|
-
- 11ty
|
|
579
|
-
- [Eleventy starter template](https://github.com/danurbanowicz/eleventy-sveltia-cms-starter) by [@danurbanowicz](https://github.com/danurbanowicz)
|
|
580
591
|
- Astro
|
|
581
592
|
- [astro-sveltia-cms](https://github.com/majesticostudio/astro-sveltia-cms), [astro-starter](https://github.com/zankhq/astro-starter) and [astros](https://github.com/zankhq/astros) by [@zanhk](https://github.com/zanhk)
|
|
582
593
|
- [Astro i18n Starter](https://github.com/yacosta738/astro-cms) by [@yacosta738](https://github.com/yacosta738)
|
|
594
|
+
- Eleventy (11ty)
|
|
595
|
+
- [Eleventy starter template](https://github.com/danurbanowicz/eleventy-sveltia-cms-starter) by [@danurbanowicz](https://github.com/danurbanowicz)
|
|
583
596
|
- Hugo
|
|
584
597
|
- [Hugo module](https://github.com/privatemaker/headless-cms) by [@privatemaker](https://github.com/privatemaker)
|
|
585
598
|
- [hugolify-sveltia-cms](https://github.com/Hugolify/hugolify-sveltia-cms/) by [@sebousan](https://github.com/sebousan)
|
|
@@ -894,6 +907,33 @@ collections:
|
|
|
894
907
|
slug: '{{uuid_short}}' # or {{uuid}} or {{uuid_shorter}}
|
|
895
908
|
```
|
|
896
909
|
|
|
910
|
+
### Configure multiple media libraries
|
|
911
|
+
|
|
912
|
+
The traditional [`media_library`](https://decapcms.org/docs/configuration-options/#media-library) option allows developers to configure only one media library:
|
|
913
|
+
|
|
914
|
+
```yaml
|
|
915
|
+
media_library:
|
|
916
|
+
name: default
|
|
917
|
+
config:
|
|
918
|
+
max_file_size: 1024000
|
|
919
|
+
```
|
|
920
|
+
|
|
921
|
+
Sveltia CMS has added support for multiple media libraries with the new `media_libraries` option. It can be used as a global option as well as a File/Image field option.
|
|
922
|
+
|
|
923
|
+
```yaml
|
|
924
|
+
media_libraries:
|
|
925
|
+
default:
|
|
926
|
+
config:
|
|
927
|
+
max_file_size: 1024000
|
|
928
|
+
cloudinary:
|
|
929
|
+
config:
|
|
930
|
+
cloud_name: your_cloud_name
|
|
931
|
+
api_key: your_api_key
|
|
932
|
+
uploadcare:
|
|
933
|
+
config:
|
|
934
|
+
publicKey: YOUR_UPLOADCARE_PUBLIC_KEY
|
|
935
|
+
```
|
|
936
|
+
|
|
897
937
|
### Editing data files with a top-level list
|
|
898
938
|
|
|
899
939
|
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):
|
|
@@ -1389,7 +1429,7 @@ This software is provided “as is” without any express or implied warranty. W
|
|
|
1389
1429
|
|
|
1390
1430
|
[^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)
|
|
1391
1431
|
|
|
1392
|
-
[^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).
|
|
1432
|
+
[^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).
|
|
1393
1433
|
|
|
1394
1434
|
[^114]: Netlify/Decap CMS [#5029](https://github.com/decaporg/decap-cms/issues/5029), [#5048](https://github.com/decaporg/decap-cms/issues/5048)
|
|
1395
1435
|
|
|
@@ -1550,3 +1590,7 @@ This software is provided “as is” without any express or implied warranty. W
|
|
|
1550
1590
|
[^192]: Netlify/Decap CMS [#6527](https://github.com/decaporg/decap-cms/issues/6527)
|
|
1551
1591
|
|
|
1552
1592
|
[^193]: Netlify/Decap CMS [#6800](https://github.com/decaporg/decap-cms/issues/6800)
|
|
1593
|
+
|
|
1594
|
+
[^194]: Netlify/Decap CMS [#7157](https://github.com/decaporg/decap-cms/issues/7157)
|
|
1595
|
+
|
|
1596
|
+
[^195]: Netlify/Decap CMS [#5901](https://github.com/decaporg/decap-cms/issues/5901)
|