@rigel-cms/rigel 1.4.0-rc.3 → 1.4.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/docs/content-model.md +1 -1
- package/docs/extensions.md +1 -1
- package/docs/media.md +3 -3
- package/docs/menus.md +1 -1
- package/docs/preview-hosts.md +2 -2
- package/docs/preview.md +8 -6
- package/docs/seo.md +1 -1
- package/docs/sidebar.md +1 -1
- package/package.json +1 -1
package/docs/content-model.md
CHANGED
|
@@ -75,7 +75,7 @@ A schema reference declares `to: ["callout"]` and stores `{ "_ref": "callout:not
|
|
|
75
75
|
|
|
76
76
|
Schema `markdown` fields store Markdown strings. Article collection bodies store Lexical state in `{ frontmatter, body }` JSON and have a read-only Markdown view. Keep those formats separate. Custom article blocks and widgets are covered in [Extensions](extensions.md).
|
|
77
77
|
|
|
78
|
-
Markdown
|
|
78
|
+
In Inline preview mode, clicking an eligible bound Markdown field on a non-shared schema page opens the article block editor when the source survives a conversion round trip. Unbound fields and shared-document forms keep their properties-panel editor. Set `sidebarOnly: true` on a `markdown` field to keep it in the properties panel even when its preview binding is available, for example a FAQ answer edited beside the question that owns it:
|
|
79
79
|
|
|
80
80
|
```ts
|
|
81
81
|
const faqAnswer = { key: "answer", label: "Answer", type: "markdown", sidebarOnly: true };
|
package/docs/extensions.md
CHANGED
|
@@ -44,7 +44,7 @@ export default defineExtension({
|
|
|
44
44
|
if (typeof data.label !== 'string' || !data.label.trim()) {
|
|
45
45
|
throw new Error('Enter a button label.');
|
|
46
46
|
}
|
|
47
|
-
if (typeof data.href !== 'string' || !/^\/[a-z0-9/-]*$/.test(data.href)) {
|
|
47
|
+
if (typeof data.href !== 'string' || !/^\/(?!\/)[a-z0-9/-]*$/.test(data.href)) {
|
|
48
48
|
throw new Error('Choose a local path such as /contact/.');
|
|
49
49
|
}
|
|
50
50
|
},
|
package/docs/media.md
CHANGED
|
@@ -48,17 +48,17 @@ Metadata lives in `.rigel-media.json` inside the configured media folder, keyed
|
|
|
48
48
|
|
|
49
49
|
New uploads use random UUID filenames.
|
|
50
50
|
|
|
51
|
-
|
|
51
|
+
On the local backend, open an asset in Media, edit its display name, title, description or image alt text, then press Save. Metadata writes validate the listed asset URL, reject unknown fields and use an atomic sidecar replacement. Display names allow safe filename-like characters up to 120 characters without requiring an extension. Titles are capped at 200 characters; descriptions and alt text at 1,000. Nonimages cannot receive alt metadata.
|
|
52
52
|
|
|
53
53
|
Local file uploads send a browser-supplied author label through `X-Rigel-Author`. Rigel uses the browser identity's name or nickname, falling back to `Local user`. This is a descriptive label, not verified ownership or an audit identity. The metadata editor cannot change it. Existing files and URL or stock imports may have no captured author; the interface displays `Local user` as a fallback.
|
|
54
54
|
|
|
55
|
-
|
|
55
|
+
For rich-text image insertion, saved repository-image alt text supplies a default that you can override per use, or leave empty for a decorative image. Image fields store the URL; declare and render a separate alt field where your site needs one. Rigel does not rewrite alt text already stored in content. Rich-text insertions remain unsaved until the document's Save action.
|
|
56
56
|
|
|
57
57
|
## Image URLs and stock providers
|
|
58
58
|
|
|
59
59
|
Image pickers offer Library, Upload, URL and Lorem Picsum. Pexels, Pixabay and Unsplash appear when their keys are configured in Settings under Media. Repository Upload excludes Unsplash.
|
|
60
60
|
|
|
61
|
-
URL, Picsum, Pexels and Pixabay image imports download bytes through the browser and upload them locally. Remote image downloads require HTTPS and browser CORS permission. The import path accepts JPEG, PNG and WebP responses within the configured size limit. Download failures stay visible. The server accepts validated bytes rather than fetching arbitrary remote URLs.
|
|
61
|
+
Remote URL, Picsum, Pexels and Pixabay image imports download bytes through the browser and upload them locally. In a content picker, a root-relative URL can be used directly without making a copy. Remote image downloads require HTTPS and browser CORS permission. The import path accepts JPEG, PNG and WebP responses within the configured size limit. Download failures stay visible. The server accepts validated bytes rather than fetching arbitrary remote URLs.
|
|
62
62
|
|
|
63
63
|
Unsplash selections keep the provider's hotlink and record the download through its API. They do not become repository files. Rich-text stock insertions retain credit links; check the provider's current licensing and [Unsplash hotlinking requirements](https://unsplash.com/documentation#hotlinking) for your use.
|
|
64
64
|
|
package/docs/menus.md
CHANGED
|
@@ -90,6 +90,6 @@ The local menu endpoint supports reading and updating existing regular files. It
|
|
|
90
90
|
|
|
91
91
|
GitHub-backed menus use the configured repository, content root and draft branch. The remote store validates the same menu shape and maximum depth, disallows menu creation, and checks the expected file state before writing. See [GitHub](github.md) for authentication, conflicts and publishing.
|
|
92
92
|
|
|
93
|
-
URL validation accepts HTTP, HTTPS, mailto and tel protocols,
|
|
93
|
+
URL validation accepts HTTP, HTTPS, mailto and tel protocols, along with relative paths and fragments whose destinations your website renderer and browser determine. It rejects protocol-relative URLs, backslashes, leading/trailing whitespace, ASCII spaces and ASCII control characters, and unsafe protocols such as `javascript:`. It does not check whether the destination exists or is trustworthy. Keep the `noopener noreferrer` attributes when rendering new-tab links.
|
|
94
94
|
|
|
95
95
|
For navigation inside the CMS rather than website links, use [sidebar configuration](sidebar.md). See the [documentation index](README.md) for the other guides.
|
package/docs/preview-hosts.md
CHANGED
|
@@ -33,9 +33,9 @@ Bases accept HTTPS with an optional path prefix. For example, `https://www.examp
|
|
|
33
33
|
|
|
34
34
|
## Separate templates from public routes
|
|
35
35
|
|
|
36
|
-
The canvas resolves a configured `template` first. It is a static root-relative path on the editor's own origin, unaffected by either host base.
|
|
36
|
+
The canvas resolves a configured `template` first. It is a static root-relative path on the editor's own origin, unaffected by either host base. Saved schema pages and new or saved articles use it; new schema pages have no canvas until their first Save, even with a template configured. A page mapping can use `{ url: "/about/", template: "/rigel/preview/about/" }`; document and collection mappings accept `template` too. The host must emit the route. Inside the CMS, only `/rigel/preview/` and its descendants are allowed as templates.
|
|
37
37
|
|
|
38
|
-
Without `template`, article canvases use the collection's `new` route even after Save or when reopening an existing article. This lets a prepared empty layout display an in-memory draft without waiting for deployment.
|
|
38
|
+
Without `template`, article canvases use the collection's `new` route even after Save or when reopening an existing article. This lets a prepared empty layout display an in-memory draft without waiting for deployment. With neither `template` nor `new`, an article has no canvas, even if its `url` is mapped. Saved schema pages and legacy copy pages use their mapped routes when no template is configured.
|
|
39
39
|
|
|
40
40
|
Live links always use the real content route, including a new article's eventual URL. Draft website links also use the real route, rather than the canvas template. These links can lead to a page that has not been deployed yet. Edited URL slugs apply to website/live destinations; the prepared canvas can keep using its stable template.
|
|
41
41
|
|
package/docs/preview.md
CHANGED
|
@@ -24,9 +24,9 @@ rigel({
|
|
|
24
24
|
|
|
25
25
|
`pages` maps legacy copy-page slugs. `documents` maps schema type names; `index` is the route for the effective slug `home`. `collections` maps article collection names. Every configured route must actually exist in your host output.
|
|
26
26
|
|
|
27
|
-
`template` is a static editor-local route used by the canvas
|
|
27
|
+
`template` is a static editor-local route used by the canvas for saved schema pages and new or saved articles. It stays on the editor's origin even when `draftUrl` is set. `/rigel/preview/` is the permitted template namespace inside the CMS, not a route generator. The host must supply the prepared page.
|
|
28
28
|
|
|
29
|
-
A collection can instead use `new: "/preview/blog/"`. Without `template`, the article canvas uses `new` for saved articles too, while the public link uses `url`.
|
|
29
|
+
A collection can instead use `new: "/preview/blog/"`. Without `template`, the article canvas uses `new` for saved articles too, while the public link uses `url`. Article canvases require `template` or `new`; a `url` mapping alone provides website links but no canvas. Saved schema pages without `template` use their mapped document route. New schema pages have no canvas until their first Save, even with a configured template. See [Preview hosts](preview-hosts.md) for the full destination rules.
|
|
30
30
|
|
|
31
31
|
## Bind rendered fields
|
|
32
32
|
|
|
@@ -81,11 +81,13 @@ These bindings patch declared regions, not arbitrary component logic. Conditiona
|
|
|
81
81
|
|
|
82
82
|
Browse mode is read-only. Edit mode lets editors select bound regions, work with section structure and open properties. The page remains visible with a notice if the required bindings are missing. A double-click on a supported single-line text binding opens inline editing; Enter accepts the draft value and Escape reverts that inline edit. Neither action writes content.
|
|
83
83
|
|
|
84
|
-
|
|
84
|
+
In Inline preview mode, clicking an eligible bound schema `markdown` region on a non-shared page opens the same block editor the article body uses, mounted on that rendered element. Root-level fields, section fields, nested objects and single-shape object arrays can use this path. Nested-array lookup uses the first declared object shape; fields exclusive to other item types in a heterogeneous array cannot be edited inline. Editors get block handles with duplicate, delete and move actions, drag reordering, insertion between blocks, table and media insertion, inline formatting, and undo and redo. The toolbar and the block handle float beside the prose, which keeps the website's typography and flow. Edits write back to the same in-memory Markdown string, and the active rich-text region belongs to its editor until editing ends rather than being overwritten by the DOM patcher.
|
|
85
85
|
|
|
86
|
-
A field
|
|
86
|
+
A field uses the fallback Markdown editor when its source cannot round-trip through the block format without loss, such as raw HTML, a Markdown table, a fenced block with a language, or a hard-wrapped paragraph. The fallback has its own round-trip check: a language-tagged fence can remain visual there, while unsupported syntax opens in source view. Nothing is converted or written until an editor actually changes the field, and the stored value stays a Markdown string either way. The shared toolbar does not make every article block or format losslessly representable in Markdown; edited content may reopen in the fallback editor. Set `sidebarOnly: true` on a field to keep it in the properties panel, as described in [content model](content-model.md).
|
|
87
87
|
|
|
88
|
-
|
|
88
|
+
Settings > Content > Article body editing selects Inline preview (the default) or Sidebar. Eligible schema Markdown regions use Inline preview in place; the properties panel offers Edit in preview instead of a second editor. Unbound fields, shared-document forms and fields declared `sidebarOnly` keep their properties-panel editor. Sidebar moves eligible rich-text editing back into the panel.
|
|
89
|
+
|
|
90
|
+
Articles use the same canvas, but their body and frontmatter follow separate paths. Inline preview mounts the article body editor on the prepared `$body` element; if that region is unavailable, the body stays in the sidebar. Article frontmatter Markdown fields remain sidebar-edited even when bound in the preview. Only one editor owns an active region, and the preview patcher leaves it alone. Article Markdown view is read-only.
|
|
89
91
|
|
|
90
92
|
Explicit Save writes content through the configured backend. Navigation guards and failed-save handling apply to canvas edits too. Browser preferences save independently. See [GitHub](github.md) for saved drafts and publishing, and [Extensions](extensions.md) for custom article content.
|
|
91
93
|
|
|
@@ -95,6 +97,6 @@ The iframe uses `sandbox="allow-same-origin"` without `allow-scripts`. The trust
|
|
|
95
97
|
|
|
96
98
|
Same-origin pages load directly in the iframe. Cross-origin pages are fetched with CORS, sanitized and displayed in a same-origin `srcdoc` snapshot. There is no draft postMessage bridge. See [Preview hosts](preview-hosts.md) for credentials, headers, CSP and subresource limits before using a remote host.
|
|
97
99
|
|
|
98
|
-
Markdown preview disables raw HTML and passes its rendered output through a DOMPurify allowlist before inserting a DOM fragment. Article preview uses the shared article renderer and sanitizes its output. URL bindings reject script/data schemes, protocol-relative URLs, backslashes, whitespace and control characters; image bindings accept relative or HTTP(S) URLs, and links also accept `mailto:`. Host-specific Markdown plugins and JavaScript syntax highlighting are outside this renderer's scope.
|
|
100
|
+
Markdown preview disables raw HTML and passes its rendered output through a DOMPurify allowlist before inserting a DOM fragment. Article preview uses the shared article renderer and sanitizes its output. URL bindings reject script/data schemes, protocol-relative URLs, backslashes, ASCII whitespace and ASCII control characters; image bindings accept relative or HTTP(S) URLs, and links also accept `mailto:`. Host-specific Markdown plugins and JavaScript syntax highlighting are outside this renderer's scope.
|
|
99
101
|
|
|
100
102
|
The host remains responsible for safe public rendering. Preview sanitization does not sanitize your Astro templates, create public routes or implement draft filtering for visitors. Verify both the editor canvas and the public output when adding a field or section.
|
package/docs/seo.md
CHANGED
|
@@ -68,7 +68,7 @@ const socialImage = imageUrl && ["https:", "http:"].includes(imageUrl.protocol)
|
|
|
68
68
|
</html>
|
|
69
69
|
```
|
|
70
70
|
|
|
71
|
-
Set Astro's `site` to your real public base URL so relative image paths produce production URLs; `Astro.url`
|
|
71
|
+
Set Astro's `site` to your real public base URL so relative image paths produce production URLs; this example falls back to `Astro.url` whenever `site` is unset, including production builds. Choose your own description fallback, title suffix and document language. The starter uses its shared Site settings for the default description and site-name suffix, rather than a fixed product name.
|
|
72
72
|
|
|
73
73
|
Canonical links, social title/description tags, structured data, sitemaps and language alternates remain host-template work. The example emits only the tags shown. Check the built HTML, including absolute image URLs and empty-image behavior, rather than treating the editor canvas as proof that public metadata is correct.
|
|
74
74
|
|
package/docs/sidebar.md
CHANGED
|
@@ -34,7 +34,7 @@ sidebar: [
|
|
|
34
34
|
|
|
35
35
|
Entries appear in configured order. Use headings for labels and separators for plain dividers; these groups are flat, not nested or collapsible. A link's optional `label` overrides its content-derived label.
|
|
36
36
|
|
|
37
|
-
Targets use
|
|
37
|
+
Targets use content IDs or configured names. Category targets use the exact declared category string:
|
|
38
38
|
|
|
39
39
|
| Target | Opens |
|
|
40
40
|
| --- | --- |
|