@sveltia/cms 0.19.0 → 0.19.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.
Files changed (3) hide show
  1. package/README.md +49 -29
  2. package/dist/sveltia-cms.js +163 -163
  3. package/package.json +1 -1
package/README.md CHANGED
@@ -22,7 +22,7 @@ Our goal is to make it a viable successor to Netlify CMS, expand the Git-based h
22
22
 
23
23
  ## Features
24
24
 
25
- We are working hard to create a **much better alternative to Netlify/Decap CMS**. Here’s what makes Sveltia CMS different. (Whoa, there are so many!)
25
+ We are working hard to create a **much better alternative to Netlify CMS** and Decap CMS. Here’s what makes Sveltia CMS different. Look how serious we are!
26
26
 
27
27
  ### Compatible with Netlify/Decap CMS
28
28
 
@@ -43,7 +43,7 @@ We are working hard to create a **much better alternative to Netlify/Decap CMS**
43
43
 
44
44
  - Built completely from scratch with Svelte instead of forking React-based Netlify/Decap CMS. The app starts fast and stays fast. The compiled code is vanilla JavaScript — you can use it with almost any framework.
45
45
  - Small footprint: The bundle size is less than 350 KB when minified and gzipped, compared to 1.5 MB of Netlify/Decap CMS. And [no virtual DOM overhead](https://svelte.dev/blog/virtual-dom-is-pure-overhead).
46
- - Uses the GraphQL API for GitHub/GitLab to quickly fetch content at once, so that entries and assets can be listed and searched instantly[^32]. It also avoids the slowness and potential API rate limit violations caused by hundreds of requests with Relation widgets[^14].
46
+ - 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]. It also avoids the slowness and potential API rate limit violations caused by hundreds of requests with Relation widgets[^14].
47
47
  - Saving entries and assets is also much faster thanks to the [GraphQL mutation](https://github.blog/changelog/2021-09-13-a-simpler-api-for-authoring-commits/).
48
48
  - A list of repository files is cached locally for faster startup and bandwidth savings.
49
49
  - Thumbnails of assets, including PDF files, are generated and cached for faster rendering of the Asset Library and other parts of the CMS[^39].
@@ -95,7 +95,7 @@ We are working hard to create a **much better alternative to Netlify/Decap CMS**
95
95
  - Entry slug template tags support [filter transformations](https://decapcms.org/docs/summary-strings/) just like summary string template tags[^29].
96
96
  - You can set the maximum number of characters for an entry slug with the new `slug_length` collection option[^25].
97
97
 
98
- ### Better data entry
98
+ ### Better content editing
99
99
 
100
100
  - Required fields, not optional fields, are clearly marked for efficient data entry.
101
101
  - Leading and trailing spaces in text-type field values are automatically removed when you save the entry[^37].
@@ -104,32 +104,41 @@ We are working hard to create a **much better alternative to Netlify/Decap CMS**
104
104
  - Fields with validation errors are automatically expanded if they are part of nested, collapsed objects[^40].
105
105
  - 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].
106
106
 
107
- ### Better fields/widgets
108
-
109
- - The String widget supports the `type` property that accepts `url` or `email` as a value, which will validate the value as a URL or email.
110
- - The String widget supports the `prefix` and `suffix` string properties, which automatically prepend and/or append the developer-defined value to the user-input value.
111
- - The Boolean, Number and String widgets support the `before_input` and `after_input` string properties, which allow developers to display custom labels before and/or after the input UI[^28]. Markdown is supported in the value.
112
- - Relation field options are displayed with no additional API requests[^14]. The `options_length` property is therefore ignored.
113
- - The `summary` for the List and Object widgets is displayed correctly when it refers to a Relation field[^36].
114
- - Provides a reimagined all-in-one asset selection dialog for File and Image fields.
115
- - [Collection-specific assets](#use-a-custom-media-folder-for-a-collection) will be listed first for easy selection, while all assets can also be displayed in a separate tab[^19].
116
- - New assets can be uploaded by dragging & dropping them into the dialog[^20].
117
- - A file/image URL can also be entered in the dialog.
118
- - Integration with Pexels, Pixabay and Unsplash makes it easy to select and insert free stock photos[^8].
119
- - The Object widget supports [variable types](https://decapcms.org/docs/variable-type-widgets/) just like the List widget. This allows you to have dependent fields in a collection[^30].
120
- - Optional Object fields (`widget: object` with `required: false`) can be manually added or removed. If unadded or removed, the required subfields won’t trigger validation errors[^16].
121
- - In addition to [generating UUIDs for entry slugs](#use-a-random-id-for-an-entry-slug), Sveltia CMS also supports the proposed `uuid` widget with the following properties[^12]:
122
- - `prefix`: A string to be prepended to the value. Default: an empty string.
123
- - `use_b32_encoding`: Whether to encode the value with Base32. Default: `false`.
124
- - `read_only`: Whether to make the field read-only. Default: `true`.
125
- - The experimental `compute` widget allows to reference the value of other fields in the same collection, similar to the `summary` property for the List and Object widgets. Use the `value` property to define the value template, e.g. `posts-{{fields.slug}}` ([example](https://github.com/sveltia/sveltia-cms/issues/111)).
107
+ ### Better widgets
108
+
109
+ - List
110
+ - Supports previewing variable types without having to register a preview template[^42].
111
+ - Object
112
+ - Supports [variable types](https://decapcms.org/docs/variable-type-widgets/) just like the List widget. This allows you to have dependent fields in a collection[^30].
113
+ - Optional Object fields (`required: false`) can be manually added or removed. If unadded or removed, the required subfields won’t trigger validation errors[^16].
114
+ - Relation
115
+ - Field options are displayed with no additional API requests[^14]. The `options_length` property is therefore ignored.
116
+ - String
117
+ - Supports the `type` property that accepts `url` or `email` as a value, which will validate the value as a URL or email.
118
+ - Supports the `prefix` and `suffix` string properties, which automatically prepend and/or append the developer-defined value to the user-input value.
119
+ - Boolean, Number and String
120
+ - Supports the `before_input` and `after_input` string properties, which allow developers to display custom labels before and/or after the input UI[^28]. Markdown is supported in the value.
121
+ - List and Object
122
+ - The `summary` is displayed correctly when it refers to a Relation field[^36].
123
+ - File and Image
124
+ - Provides a reimagined all-in-one asset selection dialog for File and Image fields.
125
+ - [Collection-specific assets](#use-a-custom-media-folder-for-a-collection) will be listed first for easy selection, while all assets can also be displayed in a separate tab[^19].
126
+ - New assets can be uploaded by dragging & dropping them into the dialog[^20].
127
+ - A URL can also be entered in the dialog.
128
+ - Integration with Pexels, Pixabay and Unsplash makes it easy to select and insert free stock photos[^8].
129
+ - New widgets
130
+ - In addition to [generating UUIDs for entry slugs](#use-a-random-id-for-an-entry-slug), Sveltia CMS also supports the proposed `uuid` widget with the following properties[^12]:
131
+ - `prefix`: A string to be prepended to the value. Default: an empty string.
132
+ - `use_b32_encoding`: Whether to encode the value with Base32. Default: `false`.
133
+ - `read_only`: Whether to make the field read-only. Default: `true`.
134
+ - The experimental `compute` widget allows to reference the value of other fields in the same collection, similar to the `summary` property for the List and Object widgets. Use the `value` property to define the value template, e.g. `posts-{{fields.slug}}` ([example](https://github.com/sveltia/sveltia-cms/issues/111)).
126
135
 
127
136
  ### Better asset management
128
137
 
129
138
  - A completely new Asset Library, built separately from the image selection dialog, makes it easy to manage all of your files, including images, videos and documents.
130
139
  - Navigate between the global media folder and per-collection media folders[^6].
131
140
  - Preview image, audio, video, text and PDF files. Check your site’s [CSP](#set-up-content-security-policy) if the preview doesn’t work.
132
- - Copy the public URL, file path or text/image data of a selected asset to clipboard.
141
+ - Copy the public URL, file path, text data or image data of a selected asset to clipboard.
133
142
  - Edit plaintext assets, including SVG images.
134
143
  - Replace existing assets.
135
144
  - Download one or more selected assets at once.
@@ -155,8 +164,8 @@ While it’s not our goal to recreate all the features found in Netlify/Decap CM
155
164
  | Editorial Workflow | Not supported yet. |
156
165
  | Open Authoring | Not supported yet. |
157
166
  | Collections | Nested collections are not supported yet. |
158
- | Widgets | [See below](#widget-limitations) for the current limitations. |
159
- | Customizations | Custom widgets, custom previews, custom formatters, manual initialization and CMS event subscriptions are not supported yet. |
167
+ | Widgets | Custom widgets are not supported yet. [See below](#widget-limitations) for other limitations. |
168
+ | Customizations | Custom previews, custom formatters, manual initialization and event subscriptions are not supported yet. |
160
169
 
161
170
  ### Widget limitations
162
171
 
@@ -182,6 +191,7 @@ While it’s not our goal to recreate all the features found in Netlify/Decap CM
182
191
  ### Before the 1.0 release
183
192
 
184
193
  - [Svelte 5](https://svelte.dev/blog/runes) migration
194
+ - Automation test coverage
185
195
  - Further Netlify/Decap CMS compatibility, including Editorial Workflow
186
196
  - Localization
187
197
  - Documentation
@@ -214,14 +224,23 @@ Alternatively, you can probably use one of the [Netlify/Decap CMS templates](htt
214
224
 
215
225
  ### Migration
216
226
 
217
- Have a look at the [compatibility chart](#compatibility) above first. If you’re already using Netlify/Decap CMS with the GitHub/GitLab backend and don’t have any custom widget, custom preview or plugin, migrating to Sveltia CMS is super easy. Edit `/admin/index.html` to replace the CMS `script` tag, and push the change to your repository:
227
+ Have a look at the [compatibility chart](#compatibility) above first. If you’re already using Netlify/Decap CMS with the GitHub or GitLab backend and don’t have any custom widget, custom preview or plugin, migrating to Sveltia CMS is super easy. Edit `/admin/index.html` to replace the CMS `script` tag, and push the change to your repository.
228
+
229
+ From Netlify CMS:
218
230
 
219
231
  ```diff
220
232
  -<script src="https://unpkg.com/netlify-cms@^2.0.0/dist/netlify-cms.js"></script>
221
233
  +<script src="https://unpkg.com/@sveltia/cms/dist/sveltia-cms.js" type="module"></script>
222
234
  ```
223
235
 
224
- That’s it! You can open `https://[hostname]/admin/` as before to start editing. There is even no authentication process if you’ve already been signed in with GitHub/GitLab on Netlify/Decap CMS because Sveltia CMS uses your auth token stored in the browser. Simple enough!
236
+ From Decap CMS:
237
+
238
+ ```diff
239
+ -<script src="https://unpkg.com/decap-cms@^3.0.0/dist/decap-cms.js"></script>
240
+ +<script src="https://unpkg.com/@sveltia/cms/dist/sveltia-cms.js" type="module"></script>
241
+ ```
242
+
243
+ That’s it! You can open `https://[hostname]/admin/` as before to start editing. There is even no authentication process if you’ve already been signed in with GitHub or GitLab on Netlify/Decap CMS because Sveltia CMS uses your auth token stored in the browser. Simple enough!
225
244
 
226
245
  That said, we strongly recommend testing your new Sveltia CMS instance first on your local machine. [See below](#work-with-a-local-git-repository) for how.
227
246
 
@@ -229,7 +248,7 @@ That said, we strongly recommend testing your new Sveltia CMS instance first on
229
248
 
230
249
  ### Move your site from Netlify to another hosting service
231
250
 
232
- You can host your Sveltia CMS-managed site anywhere, such as [Cloudflare Pages](https://pages.cloudflare.com/) or [GitHub Pages](https://pages.github.com/). But moving away from Netlify means you can no longer sign in with GitHub/GitLab via Netlify. Instead, you can use [our own OAuth client](https://github.com/sveltia/sveltia-cms-auth), which can be easily deployed to Cloudflare Workers, or [any other 3rd party client](https://decapcms.org/docs/external-oauth-clients/) made for Netlify/Decap CMS.
251
+ You can host your Sveltia CMS-managed site anywhere, such as [Cloudflare Pages](https://pages.cloudflare.com/) or [GitHub Pages](https://pages.github.com/). But moving away from Netlify means you can no longer sign in with GitHub or GitLab via Netlify. Instead, you can use [our own OAuth client](https://github.com/sveltia/sveltia-cms-auth), which can be easily deployed to Cloudflare Workers, or [any other 3rd party client](https://decapcms.org/docs/external-oauth-clients/) made for Netlify/Decap CMS.
233
252
 
234
253
  ### Work with a local Git repository
235
254
 
@@ -451,7 +470,7 @@ Want to build a website with Sveltia CMS? Maintainer [@kyoshino](https://github.
451
470
 
452
471
  ## Contributions
453
472
 
454
- Sveltia CMS is still in early beta, so we do expect various problems. Please [report any bugs to us](https://github.com/sveltia/sveltia-cms/issues/new). Feel free to submit feature requests as well. Meanwhile, pull requests may not be accepted for the time being due to limited review resources. As we get closer to the 1.0 release, we’ll be welcoming [localizers](https://github.com/sveltia/sveltia-cms/blob/main/src/lib/locales/README.md).
473
+ Since Sveltia CMS is still in beta, we expect various problems. Please [report any bugs to us](https://github.com/sveltia/sveltia-cms/issues/new) so we can make it better for everyone. Feel free to submit feature requests as well. Meanwhile, pull requests may not be accepted for the time being due to limited review resources and the upcoming Svelte 5 migration. As we get closer to the 1.0 release, we’ll be welcoming [localizers](https://github.com/sveltia/sveltia-cms/blob/main/src/lib/locales/README.md).
455
474
 
456
475
  ## Related links
457
476
 
@@ -507,3 +526,4 @@ This software is provided “as is” without any express or implied warranty. W
507
526
  [^39]: Netlify/Decap CMS [#946](https://github.com/decaporg/decap-cms/issues/946)
508
527
  [^40]: Netlify/Decap CMS [#5630](https://github.com/decaporg/decap-cms/issues/5630)
509
528
  [^41]: Netlify/Decap CMS [#7011](https://github.com/decaporg/decap-cms/issues/7011)
529
+ [^42]: Netlify/Decap CMS [#2307](https://github.com/decaporg/decap-cms/issues/2307)