@sveltia/cms 0.29.0 → 0.29.2
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 +34 -10
- package/dist/sveltia-cms.js +149 -149
- package/dist/sveltia-cms.mjs +152 -152
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -27,7 +27,7 @@ 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
|
|
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
|
|
|
@@ -102,13 +102,16 @@ We are working hard to create a **significantly better alternative to Netlify CM
|
|
|
102
102
|
- Uses the GraphQL API where possible for better performance, as mentioned above. You don’t need to set the `use_graphql` option to enable it for GitHub and GitLab.
|
|
103
103
|
- The Git branch name is automatically set to the repository’s default branch (`main`, `master` or whatever) if not specified in the configuration file, preventing data loading errors due to a hardcoded fallback to `master`[^27].
|
|
104
104
|
- You can [disable automatic deployments](#disabling-automatic-deployments) by default or on demand to save costs and resources associated with CI/CD and to publish multiple changes at once[^24].
|
|
105
|
-
- The GitLab backend support comes with background service status checking, just like GitHub.
|
|
105
|
+
- The GitLab backend support comes with background [service status](https://status.gitlab.com/) checking, just like GitHub. Checks are performed frequently and an incident notification is displayed prominently for both services.
|
|
106
106
|
- You can quickly open the source file of an entry or asset in your repository using View on GitHub (or GitLab) under the 3-dot menu.
|
|
107
107
|
|
|
108
108
|
### Better i18n support
|
|
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
|
+
- 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`. For backward compatibility, the global `structure` option only applies to folder collections as before.
|
|
112
|
+
- Eliminates UI confusion — the Preview pane can be displayed without toggling i18n in the Content Editor.
|
|
111
113
|
- You can easily switch between locales while editing with just a click on a button instead of a dropdown list.
|
|
114
|
+
- 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, `NL` as Dutch, or `ZH` as Chinese.)
|
|
112
115
|
- Fields in non-default locales are validated as expected[^13].
|
|
113
116
|
- Boolean, DateTime, List and Number fields in the entry preview are displayed in a localized format.
|
|
114
117
|
- [Integrates DeepL](#using-deepl-to-translate-entry-fields) to allow translation of text fields from another locale with one click.
|
|
@@ -118,11 +121,10 @@ We are working hard to create a **significantly better alternative to Netlify CM
|
|
|
118
121
|
- 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
122
|
- [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
123
|
- 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].
|
|
124
|
+
- Relation fields with i18n enabled won’t trigger a change in the content draft status when you start editing an existing entry[^84].
|
|
122
125
|
- 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
126
|
- 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
127
|
- You can [localize entry slugs](#localizing-entry-slugs) while linking the localized files[^80], thanks to the support for Hugo’s `translationKey`[^81].
|
|
125
|
-
- Supports multiple files/folders i18n structure for file collections[^87]. To enable this, simply use the `{{locale}}` template tag in the `file` path option, e.g. `content/pages/{{locale}}/about.json`. The global `structure` option is only used for folder collections.
|
|
126
128
|
|
|
127
129
|
### Better collections
|
|
128
130
|
|
|
@@ -135,6 +137,9 @@ We are working hard to create a **significantly better alternative to Netlify CM
|
|
|
135
137
|
- Single quotes in a slug will be replaced with `sanitize_replacement` (default: hyphen) rather than being removed[^52].
|
|
136
138
|
- You can use nested fields (dot notation) in the `path` option for a folder collection, e.g. `{{fields.state.name}}/{{slug}}`[^62].
|
|
137
139
|
- You can use Markdown in collection descriptions[^79]. Bold, italic, strikethrough, code and links are allowed.
|
|
140
|
+
- 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].
|
|
141
|
+
- 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.
|
|
142
|
+
- A folder collection filter with a boolean value works as expected[^93].
|
|
138
143
|
|
|
139
144
|
### Better content editing
|
|
140
145
|
|
|
@@ -143,12 +148,14 @@ We are working hard to create a **significantly better alternative to Netlify CM
|
|
|
143
148
|
- You can hide the preview of a specific field with `preview: false`.
|
|
144
149
|
- Fields with validation errors are automatically expanded if they are part of nested, collapsed objects[^40].
|
|
145
150
|
- 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].
|
|
151
|
+
- The Preview pane displays all fields, including each title, making it easier to see which fields are populated.
|
|
152
|
+
- Provides better scroll synchronization between the panes when editing or previewing an entry[^92].
|
|
146
153
|
- 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).
|
|
147
154
|
- A long validation error message is displayed in full, without being hidden behind the field label[^59].
|
|
148
155
|
|
|
149
156
|
### Better data output
|
|
150
157
|
|
|
151
|
-
- Keys in generated JSON/TOML/YAML content are always sorted
|
|
158
|
+
- Keys in generated JSON/TOML/YAML content are always sorted by the order of configured fields, making Git commits clean and consistent[^86].
|
|
152
159
|
- 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.
|
|
153
160
|
- Leading and trailing spaces in text-type field values are automatically removed when you save an entry[^37].
|
|
154
161
|
- 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].
|
|
@@ -159,6 +166,8 @@ We are working hard to create a **significantly better alternative to Netlify CM
|
|
|
159
166
|
- Boolean
|
|
160
167
|
- A required Boolean field with no default value is saved as `false` by default, without raising a confusing validation error[^45].
|
|
161
168
|
- An optional Boolean field with no default value is also saved as `false` by default, rather than nothing[^46].
|
|
169
|
+
- DateTime
|
|
170
|
+
- A DateTime field doesn’t trigger a change in the content draft status when you’ve just started editing a new entry[^90].
|
|
162
171
|
- Hidden
|
|
163
172
|
- The `default` value is saved when you create a file collection item, not just a folder collection item[^78].
|
|
164
173
|
- List
|
|
@@ -169,18 +178,24 @@ We are working hard to create a **significantly better alternative to Netlify CM
|
|
|
169
178
|
- Markdown
|
|
170
179
|
- 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].
|
|
171
180
|
- 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.
|
|
181
|
+
- Line breaks are rendered as line breaks in the Preview pane according to GitHub Flavored Markdown.
|
|
172
182
|
- Object
|
|
173
183
|
- Sveltia CMS offers two ways to have conditional fields in a collection[^30]:
|
|
174
184
|
- You can use [variable types](https://decapcms.org/docs/variable-type-widgets/) (the `types` option) with the Object widget just like the List widget.
|
|
175
|
-
- 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].
|
|
185
|
+
- 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].
|
|
176
186
|
- Relation
|
|
177
187
|
- Field options are displayed with no additional API requests[^14]. The confusing `options_length` option, which defaults to 20, is therefore ignored[^76].
|
|
188
|
+
- `slug` can be used for `value_field` to show all available options instead of just one in some situations[^91].
|
|
189
|
+
- Template strings with a wildcard like `{{cities.*.name}}` can also be used for `value_field`[^94].
|
|
190
|
+
- `display_fields` is displayed in the Preview page instead of `value_field`.
|
|
178
191
|
- The redundant `search_fields` option is not required in Sveltia CMS, as it defaults to `display_fields` (and `value_field`).
|
|
179
192
|
- Select
|
|
180
193
|
- It’s possible to select an option with value `0`[^56].
|
|
194
|
+
- `label` is displayed in the Preview page instead of `value`.
|
|
181
195
|
- String
|
|
182
|
-
- When a YouTube video URL is entered in a String field, it appears as an embedded video in the
|
|
196
|
+
- When a YouTube video URL is entered in a String field, it appears as an embedded video in the Preview pane.
|
|
183
197
|
- Check your site’s [CSP](#setting-up-content-security-policy) if the preview doesn’t work.
|
|
198
|
+
- When a regular URL is entered in a String field, it appears as a link that can be opened in a new browser tab.
|
|
184
199
|
- Supports the `type` option that accepts `url` or `email` as a value, which will validate the value as a URL or email.
|
|
185
200
|
- Supports the `prefix` and `suffix` string options, which automatically prepend and/or append the developer-defined value to the user-input value.
|
|
186
201
|
- Boolean, Number and String
|
|
@@ -191,6 +206,7 @@ We are working hard to create a **significantly better alternative to Netlify CM
|
|
|
191
206
|
- A new asset can be uploaded by dragging & dropping it into the dialog[^20].
|
|
192
207
|
- A URL can also be entered in the dialog.
|
|
193
208
|
- Integration with Pexels, Pixabay and Unsplash makes it easy to select and insert a free stock photo[^8]. More services will be added later.
|
|
209
|
+
- 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.
|
|
194
210
|
- List and Object
|
|
195
211
|
- The `summary` is displayed correctly when it refers to a Relation field[^36].
|
|
196
212
|
- Markdown, String and Text
|
|
@@ -230,6 +246,7 @@ We are working hard to create a **significantly better alternative to Netlify CM
|
|
|
230
246
|
- 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].
|
|
231
247
|
- 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].
|
|
232
248
|
- Hidden files (dot files) don’t appear in the Asset Library[^47].
|
|
249
|
+
- You can add assets using the Quick Add button in the upper right corner of the application.
|
|
233
250
|
|
|
234
251
|
## Compatibility
|
|
235
252
|
|
|
@@ -752,7 +769,7 @@ This software is provided “as is” without any express or implied warranty. W
|
|
|
752
769
|
[^50]: Netlify/Decap CMS [#4646](https://github.com/decaporg/decap-cms/issues/4646), [#7167](https://github.com/decaporg/decap-cms/issues/7167)
|
|
753
770
|
[^51]: Netlify/Decap CMS [#6731](https://github.com/decaporg/decap-cms/issues/6731)
|
|
754
771
|
[^52]: Netlify/Decap CMS [#7147](https://github.com/decaporg/decap-cms/issues/7147)
|
|
755
|
-
[^53]: Netlify/Decap CMS [#5673](https://github.com/decaporg/decap-cms/issues/5673), [#6707](https://github.com/decaporg/decap-cms/issues/6707)
|
|
772
|
+
[^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)
|
|
756
773
|
[^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.
|
|
757
774
|
[^55]: Netlify/Decap CMS [#4480](https://github.com/decaporg/decap-cms/issues/4480), [#6353](https://github.com/decaporg/decap-cms/issues/6353)
|
|
758
775
|
[^56]: Netlify/Decap CMS [#6515](https://github.com/decaporg/decap-cms/issues/6515)
|
|
@@ -776,8 +793,8 @@ This software is provided “as is” without any express or implied warranty. W
|
|
|
776
793
|
[^74]: Netlify/Decap CMS [#4209](https://github.com/decaporg/decap-cms/issues/4209)
|
|
777
794
|
[^75]: Netlify/Decap CMS [#5472](https://github.com/decaporg/decap-cms/issues/5472)
|
|
778
795
|
[^76]: Netlify/Decap CMS [#4738](https://github.com/decaporg/decap-cms/issues/4738)
|
|
779
|
-
[^77]: Netlify/Decap CMS [#6565](https://github.com/decaporg/decap-cms/issues/6565)
|
|
780
|
-
[^78]: Netlify/Decap CMS [#3046](https://github.com/decaporg/decap-cms/issues/3046), [#4363](https://github.com/decaporg/decap-cms/issues/4363)
|
|
796
|
+
[^77]: Netlify/Decap CMS [#3415](https://github.com/decaporg/decap-cms/issues/3415), [#6565](https://github.com/decaporg/decap-cms/issues/6565)
|
|
797
|
+
[^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)
|
|
781
798
|
[^79]: Netlify/Decap CMS [#5726](https://github.com/decaporg/decap-cms/issues/5726)
|
|
782
799
|
[^80]: Netlify/Decap CMS [#5493](https://github.com/decaporg/decap-cms/issues/5493), [#6600](https://github.com/decaporg/decap-cms/issues/6600)
|
|
783
800
|
[^81]: Netlify/Decap CMS [#4645](https://github.com/decaporg/decap-cms/issues/4645)
|
|
@@ -787,4 +804,11 @@ This software is provided “as is” without any express or implied warranty. W
|
|
|
787
804
|
[^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)
|
|
788
805
|
[^86]: Netlify/Decap CMS [#6759](https://github.com/decaporg/decap-cms/issues/6759), [#6901](https://github.com/decaporg/decap-cms/issues/6901)
|
|
789
806
|
[^87]: Netlify/Decap CMS [#5280](https://github.com/decaporg/decap-cms/issues/5280)
|
|
807
|
+
[^88]: Netlify/Decap CMS [#1267](https://github.com/decaporg/decap-cms/issues/1267)
|
|
808
|
+
[^89]: Netlify/Decap CMS [#4255](https://github.com/decaporg/decap-cms/issues/4255)
|
|
809
|
+
[^90]: Netlify/Decap CMS [#725](https://github.com/decaporg/decap-cms/issues/725)
|
|
810
|
+
[^91]: Netlify/Decap CMS [#4954](https://github.com/decaporg/decap-cms/issues/4954)
|
|
811
|
+
[^92]: Netlify/Decap CMS [#1466](https://github.com/decaporg/decap-cms/issues/1466)
|
|
812
|
+
[^93]: Netlify/Decap CMS [#1000](https://github.com/decaporg/decap-cms/issues/1000)
|
|
813
|
+
[^94]: Netlify/Decap CMS [#5487](https://github.com/decaporg/decap-cms/issues/5487)
|
|
790
814
|
[^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).
|