@sveltia/cms 0.28.0 → 0.29.1

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
@@ -27,11 +27,11 @@ Our goal is to make it a viable successor to Netlify CMS, expand the Git-based h
27
27
  While we are fixing reported bugs as fast as we can, usually within 24 hours, the 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 different kinds of activities:
28
28
 
29
29
  - Ensuring maximum compatibility with existing versions of Netlify/Decap CMS
30
- - Tackling as many [issues reported to Netlify/Decap CMS](https://github.com/decaporg/decap-cms/issues) as possible (so far 80+ of them have been effectively solved in Sveltia CMS, with the goal of reaching 100 by GA)
30
+ - Tackling as many [issues reported to Netlify/Decap CMS](https://github.com/decaporg/decap-cms/issues) as possible (so far 90+ of them have been effectively solved in Sveltia CMS, with the goal of reaching 100 by GA)
31
31
  - Responding to user feedback
32
32
  - Implementing our own enhancement ideas
33
33
 
34
- At this point, **we are on track to ship version 1.0 in Q3 2024**. Check our [release notes](https://github.com/sveltia/sveltia-cms/releases) for updates.
34
+ Sveltia CMS **version 1.0 is expected to ship in Q3 2024**. Check our [release notes](https://github.com/sveltia/sveltia-cms/releases) for updates.
35
35
 
36
36
  ## Features
37
37
 
@@ -68,7 +68,7 @@ We are working hard to create a **significantly better alternative to Netlify CM
68
68
  - In addition to a streamlined workflow, it offers great performance by loading files natively through the browser rather than using a slow, ad hoc REST API.
69
69
  - It also avoids a number of issues, including the 30 MB file size limit[^51], an unknown error with `publish_mode`[^75], and an unused `logo_url`[^49].
70
70
  - Eliminates some workflow disruptions in the Content Editor:
71
- - A backup of an entry draft is automatically created without interruption by a confirmation dialog. It can then be reliably restored without unexpected overwriting[^85].
71
+ - A local backup of an entry draft is automatically created without interruption by a confirmation dialog. It can then be reliably restored without unexpected overwriting[^85].
72
72
  - Click once (the Save button) instead of twice (Publish > Publish now) to save an entry.
73
73
  - The editor closes automatically when an entry is saved.
74
74
  - You can upload multiple assets at once[^5].
@@ -109,6 +109,7 @@ We are working hard to create a **significantly better alternative to Netlify CM
109
109
 
110
110
  - Sveltia CMS has been built with a multilingual architecture from the very beginning. You can expect top-notch i18n support, as it’s required by clients of maintainer [@kyoshino](https://github.com/kyoshino), who himself was a long-time Japanese localizer for Mozilla and currently lives in a [city](https://en.wikipedia.org/wiki/Toronto) where 150+ languages are spoken.
111
111
  - You can easily switch between locales while editing with just a click on a button instead of a dropdown list.
112
+ - Language labels appear in human-readable display names instead of ISO 639 language codes, which not everyone is familiar with. For example, it might be difficult to recognize `DE` as German or `NL` as Dutch.
112
113
  - Fields in non-default locales are validated as expected[^13].
113
114
  - Boolean, DateTime, List and Number fields in the entry preview are displayed in a localized format.
114
115
  - [Integrates DeepL](#using-deepl-to-translate-entry-fields) to allow translation of text fields from another locale with one click.
@@ -118,10 +119,11 @@ We are working hard to create a **significantly better alternative to Netlify CM
118
119
  - Raises a validation error instead of failing silently if the `single_file` structure is used and a required field is not filled in any of the locales[^55].
119
120
  - [Entry-relative media folders](https://decapcms.org/docs/collection-folder/#media-and-public-folder) can be used in conjunction with the `multiple_folders` i18n structure[^21].
120
121
  - Boolean fields are updated in real time between locales like other widgets to avoid confusion[^35].
121
- - Relation fields with i18n enabled won’t trigger a change in content draft status when you start editing an existing entry[^84].
122
+ - Relation fields with i18n enabled won’t trigger a change in the content draft status when you start editing an existing entry[^84].
122
123
  - Solves problems with Chinese, Japanese and Korean (CJK) [IME](https://en.wikipedia.org/wiki/Input_method) text input in the rich text editor for the Markdown widget[^54].
123
124
  - You can use the `{{locale}}` template tag in the [`preview_path`](https://decapcms.org/docs/configuration-options/#preview_path) collection option to provide site preview links for each language[^63].
124
125
  - You can [localize entry slugs](#localizing-entry-slugs) while linking the localized files[^80], thanks to the support for Hugo’s `translationKey`[^81].
126
+ - Supports multiple files/folders i18n structure for file collections[^87]. To enable it, simply use the `{{locale}}` template tag in the `file` path option, e.g. `content/pages/about.{{locale}}.json` or `content/pages/{{locale}}/about.json`. The global `structure` option only applies to folder collections as before.
125
127
 
126
128
  ### Better collections
127
129
 
@@ -134,6 +136,9 @@ We are working hard to create a **significantly better alternative to Netlify CM
134
136
  - Single quotes in a slug will be replaced with `sanitize_replacement` (default: hyphen) rather than being removed[^52].
135
137
  - You can use nested fields (dot notation) in the `path` option for a folder collection, e.g. `{{fields.state.name}}/{{slug}}`[^62].
136
138
  - You can use Markdown in collection descriptions[^79]. Bold, italic, strikethrough, code and links are allowed.
139
+ - The New Entry button won’t appear when a developer accidentally sets the `create: true` option on a file collection because it’s useless[^89].
140
+ - The Delete Entry button won’t appear when a developer accidentally sets the `delete: true` option on a file collection because these preset files should not be deleted.
141
+ - A folder collection filter with a boolean value works as expected[^93].
137
142
 
138
143
  ### Better content editing
139
144
 
@@ -142,12 +147,14 @@ We are working hard to create a **significantly better alternative to Netlify CM
142
147
  - You can hide the preview of a specific field with `preview: false`.
143
148
  - Fields with validation errors are automatically expanded if they are part of nested, collapsed objects[^40].
144
149
  - When you click on a field in the Preview pane, the corresponding field in the Editor pane is highlighted. It will be automatically expanded if collapsed[^41].
150
+ - The Preview pane displays the titles of all fields, making it easier to see which fields are filled in.
151
+ - Provides better scroll synchronization between the panes when editing or previewing an entry[^92].
145
152
  - You can use a full regular expression, including flags, for the widget `pattern` option[^82]. For example, if you want to allow 280 characters or less in a multiline text field, you could write `/^.{0,280}$/s` (but you can now use the `maxlength` option instead).
146
153
  - A long validation error message is displayed in full, without being hidden behind the field label[^59].
147
154
 
148
155
  ### Better data output
149
156
 
150
- - The keys in generated JSON/TOML/YAML content are always sorted according to the order of configured fields, making Git commits clean and consistent[^86].
157
+ - Keys in generated JSON/TOML/YAML content are always sorted by the order of configured fields, making Git commits clean and consistent[^86].
151
158
  - For data consistency, Boolean, List (see below) and other fields are always saved as a proper value, such as an empty string or an empty array, rather than nothing, even if it’s optional or empty.
152
159
  - Leading and trailing spaces in text-type field values are automatically removed when you save an entry[^37].
153
160
  - JSON/TOML/YAML data is saved with a new line at the end of the file to prevent unnecessary changes being made to the file[^11][^69].
@@ -158,6 +165,8 @@ We are working hard to create a **significantly better alternative to Netlify CM
158
165
  - Boolean
159
166
  - A required Boolean field with no default value is saved as `false` by default, without raising a confusing validation error[^45].
160
167
  - An optional Boolean field with no default value is also saved as `false` by default, rather than nothing[^46].
168
+ - DateTime
169
+ - A DateTime field doesn’t trigger a change in the content draft status when you’ve just started editing a new entry[^90].
161
170
  - Hidden
162
171
  - The `default` value is saved when you create a file collection item, not just a folder collection item[^78].
163
172
  - List
@@ -168,18 +177,23 @@ We are working hard to create a **significantly better alternative to Netlify CM
168
177
  - Markdown
169
178
  - The rich text editor is built with [Lexical](https://github.com/facebook/lexical) instead of [Slate](https://github.com/ianstormtaylor/slate), which solves various problems found in Netlify/Decap CMS, including fatal application crashes[^53][^70][^71][^72][^73].
170
179
  - You can set the default editor mode by changing the order of the `modes` option[^58]. If you want to use the plain text editor by default, add `modes: [raw, rich_text]` to the field configuration.
180
+ - Line breaks are rendered as line breaks in the Preview pane according to GitHub Flavored Markdown.
171
181
  - Object
172
182
  - Sveltia CMS offers two ways to have conditional fields in a collection[^30]:
173
183
  - You can use [variable types](https://decapcms.org/docs/variable-type-widgets/) (the `types` option) with the Object widget just like the List widget.
174
- - An optional Object field (`required: false`) can be manually added or removed with a checkbox. If unadded or removed, the required subfields won’t trigger validation errors[^16].
184
+ - An optional Object field (`required: false`) can be manually added or removed with a checkbox[^88]. If unadded or removed, the required subfields won’t trigger validation errors[^16].
175
185
  - Relation
176
186
  - Field options are displayed with no additional API requests[^14]. The confusing `options_length` option, which defaults to 20, is therefore ignored[^76].
187
+ - `slug` can be used for `value_field` to show all available options instead of just one in some situations[^91].
188
+ - `display_fields` is displayed in the Preview page instead of `value_field`.
177
189
  - The redundant `search_fields` option is not required in Sveltia CMS, as it defaults to `display_fields` (and `value_field`).
178
190
  - Select
179
191
  - It’s possible to select an option with value `0`[^56].
192
+ - `label` is displayed in the Preview page instead of `value`.
180
193
  - String
181
194
  - When a YouTube video URL is entered in a String field, it appears as an embedded video in the preview pane.
182
195
  - Check your site’s [CSP](#setting-up-content-security-policy) if the preview doesn’t work.
196
+ - When a regular URL is entered in a String field, it appears as a link that can be opened in a new browser tab.
183
197
  - Supports the `type` option that accepts `url` or `email` as a value, which will validate the value as a URL or email.
184
198
  - Supports the `prefix` and `suffix` string options, which automatically prepend and/or append the developer-defined value to the user-input value.
185
199
  - Boolean, Number and String
@@ -190,6 +204,7 @@ We are working hard to create a **significantly better alternative to Netlify CM
190
204
  - A new asset can be uploaded by dragging & dropping it into the dialog[^20].
191
205
  - A URL can also be entered in the dialog.
192
206
  - Integration with Pexels, Pixabay and Unsplash makes it easy to select and insert a free stock photo[^8]. More services will be added later.
207
+ - Large images automatically fit in the Preview pane instead of being displayed at their original size, which can easily exceed the width of the pane.
193
208
  - List and Object
194
209
  - The `summary` is displayed correctly when it refers to a Relation field[^36].
195
210
  - Markdown, String and Text
@@ -229,6 +244,7 @@ We are working hard to create a **significantly better alternative to Netlify CM
229
244
  - 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].
230
245
  - Assets stored in an entry-relative media folder are automatically deleted when the associated entry is deleted because these assets are not available for other entries[^22].
231
246
  - Hidden files (dot files) don’t appear in the Asset Library[^47].
247
+ - You can add assets using the Quick Add button in the upper right corner of the application.
232
248
 
233
249
  ## Compatibility
234
250
 
@@ -273,7 +289,7 @@ If we have missed any other features, let us know by [filing an issue](https://g
273
289
  ### Before the 1.0 release
274
290
 
275
291
  - Enhanced compatibility with Netlify/Decap CMS (see above for the status)
276
- - Automation test coverage (Vitest + Playwright)
292
+ - Broad automation test coverage (Vitest + Playwright)
277
293
  - [Svelte 5](https://svelte.dev/blog/svelte-5-release-candidate) migration
278
294
  - Localization
279
295
  - Documentation
@@ -414,14 +430,14 @@ You can have an icon for each collection for easy identification in the collecti
414
430
 
415
431
  ### Adding dividers to the collection list
416
432
 
417
- Sveltia CMS allows developers to add dividers to the collection list to distinguish different types of collections. To do this, insert a fake collection with the `divider: true` option. In VS Code, you may get a validation error if `config.yml` is treated as a “Netlify YAML config” file. You can work around this by adding a random `name` and an empty `files`:
433
+ Sveltia CMS allows developers to add dividers to the collection list to distinguish different types of collections. To do this, insert a fake collection with the `divider: true` option along with a random `name`. In VS Code, you may get a validation error if `config.yml` is treated as a “Netlify YAML config” file. You can work around this by adding an empty `files` as well:
418
434
 
419
435
  ```yaml
420
436
  collections:
421
437
  - name: products
422
438
  ...
423
439
  - divider: true
424
- name: d1 # d2, d3, etc.
440
+ name: d1 # d2, d3, etc. Should be unique for each divider
425
441
  files: []
426
442
  - name: pages
427
443
  ...
@@ -751,7 +767,7 @@ This software is provided “as is” without any express or implied warranty. W
751
767
  [^50]: Netlify/Decap CMS [#4646](https://github.com/decaporg/decap-cms/issues/4646), [#7167](https://github.com/decaporg/decap-cms/issues/7167)
752
768
  [^51]: Netlify/Decap CMS [#6731](https://github.com/decaporg/decap-cms/issues/6731)
753
769
  [^52]: Netlify/Decap CMS [#7147](https://github.com/decaporg/decap-cms/issues/7147)
754
- [^53]: Netlify/Decap CMS [#5673](https://github.com/decaporg/decap-cms/issues/5673), [#6707](https://github.com/decaporg/decap-cms/issues/6707)
770
+ [^53]: Netlify/Decap CMS [#512](https://github.com/decaporg/decap-cms/issues/512), [#5673](https://github.com/decaporg/decap-cms/issues/5673), [#6707](https://github.com/decaporg/decap-cms/issues/6707)
755
771
  [^54]: Netlify/Decap CMS [#1347](https://github.com/decaporg/decap-cms/issues/1347), [#4629](https://github.com/decaporg/decap-cms/issues/4629), [#6287](https://github.com/decaporg/decap-cms/issues/6287) — Decap 3.0 updated the Slate editor in an attempt to fix the problems, but the IME issues remain unresolved when using a mobile/tablet browser.
756
772
  [^55]: Netlify/Decap CMS [#4480](https://github.com/decaporg/decap-cms/issues/4480), [#6353](https://github.com/decaporg/decap-cms/issues/6353)
757
773
  [^56]: Netlify/Decap CMS [#6515](https://github.com/decaporg/decap-cms/issues/6515)
@@ -776,7 +792,7 @@ This software is provided “as is” without any express or implied warranty. W
776
792
  [^75]: Netlify/Decap CMS [#5472](https://github.com/decaporg/decap-cms/issues/5472)
777
793
  [^76]: Netlify/Decap CMS [#4738](https://github.com/decaporg/decap-cms/issues/4738)
778
794
  [^77]: Netlify/Decap CMS [#6565](https://github.com/decaporg/decap-cms/issues/6565)
779
- [^78]: Netlify/Decap CMS [#3046](https://github.com/decaporg/decap-cms/issues/3046)
795
+ [^78]: Netlify/Decap CMS [#2294](https://github.com/decaporg/decap-cms/issues/2294), [#3046](https://github.com/decaporg/decap-cms/issues/3046), [#4363](https://github.com/decaporg/decap-cms/issues/4363)
780
796
  [^79]: Netlify/Decap CMS [#5726](https://github.com/decaporg/decap-cms/issues/5726)
781
797
  [^80]: Netlify/Decap CMS [#5493](https://github.com/decaporg/decap-cms/issues/5493), [#6600](https://github.com/decaporg/decap-cms/issues/6600)
782
798
  [^81]: Netlify/Decap CMS [#4645](https://github.com/decaporg/decap-cms/issues/4645)
@@ -785,4 +801,11 @@ This software is provided “as is” without any express or implied warranty. W
785
801
  [^84]: Netlify/Decap CMS [#7142](https://github.com/decaporg/decap-cms/issues/7142)
786
802
  [^85]: Netlify/Decap CMS [#5055](https://github.com/decaporg/decap-cms/issues/5055), [#5470](https://github.com/decaporg/decap-cms/issues/5470), [#6989](https://github.com/decaporg/decap-cms/issues/6989)
787
803
  [^86]: Netlify/Decap CMS [#6759](https://github.com/decaporg/decap-cms/issues/6759), [#6901](https://github.com/decaporg/decap-cms/issues/6901)
804
+ [^87]: Netlify/Decap CMS [#5280](https://github.com/decaporg/decap-cms/issues/5280)
805
+ [^88]: Netlify/Decap CMS [#1267](https://github.com/decaporg/decap-cms/issues/1267)
806
+ [^89]: Netlify/Decap CMS [#4255](https://github.com/decaporg/decap-cms/issues/4255)
807
+ [^90]: Netlify/Decap CMS [#725](https://github.com/decaporg/decap-cms/issues/725)
808
+ [^91]: Netlify/Decap CMS [#4954](https://github.com/decaporg/decap-cms/issues/4954)
809
+ [^92]: Netlify/Decap CMS [#1466](https://github.com/decaporg/decap-cms/issues/1466)
810
+ [^93]: Netlify/Decap CMS [#1000](https://github.com/decaporg/decap-cms/issues/1000)
788
811
  [^100]: 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) — These `removeChild` crashes are common in React apps and seem to be caused by a [browser extension](https://github.com/facebook/react/issues/17256) or [Google Translate](https://github.com/facebook/react/issues/11538).