scavold 0.4.0 → 0.5.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/CHANGELOG.md +18 -1
- package/COMPONENTS.md +8 -2
- package/lib/containers.js +2 -0
- package/lib/sectionManifest.js +18 -5
- package/package.json +1 -1
- package/scripts/check-fixture.js +6 -0
- package/styles/layouts.css +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -9,6 +9,20 @@ one offered; a patch release does not.
|
|
|
9
9
|
|
|
10
10
|
## [Unreleased]
|
|
11
11
|
|
|
12
|
+
## [0.5.0] — 2026-10-04
|
|
13
|
+
|
|
14
|
+
### Added
|
|
15
|
+
|
|
16
|
+
- A `group` container: content held together only to arrange it — an image with the
|
|
17
|
+
paragraph flowing around it, say — without claiming a meaning, rendered as a `<div>`.
|
|
18
|
+
It offers the same layouts as a section, for where no sectioning element fits.
|
|
19
|
+
|
|
20
|
+
### Changed
|
|
21
|
+
|
|
22
|
+
- The option of `details` that makes blocks close each other is called "Accordion" in
|
|
23
|
+
the editor ("Akkordeon" in German), so it is not mistaken for the new group. It is
|
|
24
|
+
still written `group=` in Markdown.
|
|
25
|
+
|
|
12
26
|
## [0.4.0] — 2026-10-04
|
|
13
27
|
|
|
14
28
|
### Added
|
|
@@ -36,6 +50,8 @@ one offered; a patch release does not.
|
|
|
36
50
|
|
|
37
51
|
## [0.3.0] — 2026-10-04
|
|
38
52
|
|
|
53
|
+
Tagged, not published to npm; its changes reach sites with 0.4.0.
|
|
54
|
+
|
|
39
55
|
### Added
|
|
40
56
|
|
|
41
57
|
- A `card` container: a unit of its own, such as an image, a heading and a few lines.
|
|
@@ -430,7 +446,8 @@ First published release. Version `0.1.0` existed in-tree only.
|
|
|
430
446
|
- Only images are processed out of `media_folder`; other file types (video, documents)
|
|
431
447
|
are never copied into the build output and have to live in the static folder.
|
|
432
448
|
|
|
433
|
-
[Unreleased]: https://gitlab.com/cratly/scavold/-/compare/v0.
|
|
449
|
+
[Unreleased]: https://gitlab.com/cratly/scavold/-/compare/v0.5.0...main
|
|
450
|
+
[0.5.0]: https://gitlab.com/cratly/scavold/-/compare/v0.4.0...v0.5.0
|
|
434
451
|
[0.4.0]: https://gitlab.com/cratly/scavold/-/compare/v0.3.0...v0.4.0
|
|
435
452
|
[0.3.0]: https://gitlab.com/cratly/scavold/-/compare/v0.2.1...v0.3.0
|
|
436
453
|
[0.2.1]: https://gitlab.com/cratly/scavold/-/compare/v0.2.0...v0.2.1
|
package/COMPONENTS.md
CHANGED
|
@@ -134,6 +134,11 @@ component for each container name they declare in `.cratly.config.yaml`.
|
|
|
134
134
|
|
|
135
135
|
See [`useContainer`](#usecontainer-props) for building custom container components.
|
|
136
136
|
|
|
137
|
+
`:::group` is a built-in mapped to it: content held together only to arrange it, with no
|
|
138
|
+
meaning of its own, rendered as `<div class="group">`. It offers the same
|
|
139
|
+
[layout](#layout) as a section. Use it where no sectioning element fits — HTML keeps
|
|
140
|
+
`<div>` for exactly that.
|
|
141
|
+
|
|
137
142
|
---
|
|
138
143
|
|
|
139
144
|
### `<ScavoldCover>`
|
|
@@ -991,8 +996,9 @@ async function enhanceApp( context ) {
|
|
|
991
996
|
|
|
992
997
|
#### Layout
|
|
993
998
|
|
|
994
|
-
`section`, `article` and `aside` take a `layout` arranging their
|
|
995
|
-
usually — and the content after it. Left out, the block stands
|
|
999
|
+
`section`, `article` and `aside`, and the generic `group`, take a `layout` arranging their
|
|
1000
|
+
first block — an image, usually — and the content after it. Left out, the block stands
|
|
1001
|
+
above the content.
|
|
996
1002
|
|
|
997
1003
|
```markdown
|
|
998
1004
|
::: section layout=float-left
|
package/lib/containers.js
CHANGED
|
@@ -36,6 +36,8 @@ function defaultContainerMap() {
|
|
|
36
36
|
map.cover = "ScavoldCover";
|
|
37
37
|
map.details = "ScavoldDetails";
|
|
38
38
|
map.grid = "ScavoldGrid";
|
|
39
|
+
// Groups content for arranging it only, carrying no meaning of its own: a <div>.
|
|
40
|
+
map.group = "ScavoldContainer";
|
|
39
41
|
map.pagelist = "ScavoldPageList";
|
|
40
42
|
|
|
41
43
|
return map;
|
package/lib/sectionManifest.js
CHANGED
|
@@ -159,6 +159,19 @@ export const BUILTIN_SECTIONS = {
|
|
|
159
159
|
} ] ),
|
|
160
160
|
),
|
|
161
161
|
|
|
162
|
+
// Arranges content without claiming a meaning for it, which is what HTML keeps <div>
|
|
163
|
+
// for; ScavoldContainer renders it as one. Not the default type in the editor, so
|
|
164
|
+
// that choosing it stays a choice.
|
|
165
|
+
group: {
|
|
166
|
+
label: text( "Group", "Gruppe" ),
|
|
167
|
+
hint: text(
|
|
168
|
+
"Holds content together only to arrange it — an image with the paragraph flowing around it, say — without meaning of its own. Content with a topic of its own is a section; one that stands on its own, an article.",
|
|
169
|
+
"Fasst Inhalt nur zusammen, um ihn anzuordnen – etwa ein Bild mit dem Absatz, der es umfließt –, ohne eigene Bedeutung. Inhalt mit eigenem Thema ist ein Abschnitt, Inhalt, der für sich steht, ein Artikel.",
|
|
170
|
+
),
|
|
171
|
+
docs: docs( "group" ),
|
|
172
|
+
props: { layout: LAYOUT_PROP },
|
|
173
|
+
},
|
|
174
|
+
|
|
162
175
|
video: {
|
|
163
176
|
label: text( "Video", "Video" ),
|
|
164
177
|
hint: text( "Embedded video with playback controls.", "Eingebettetes Video mit Bedienelementen." ),
|
|
@@ -290,10 +303,10 @@ export const BUILTIN_SECTIONS = {
|
|
|
290
303
|
open: { type: "boolean", label: text( "Expanded at first", "Anfangs aufgeklappt" ) },
|
|
291
304
|
group: {
|
|
292
305
|
type: "text",
|
|
293
|
-
label: text( "
|
|
306
|
+
label: text( "Accordion", "Akkordeon" ),
|
|
294
307
|
hint: text(
|
|
295
|
-
"
|
|
296
|
-
"Blöcke mit demselben
|
|
308
|
+
"Details with the same accordion name close each other, so only one of them is expanded at a time.",
|
|
309
|
+
"Ausklappbare Blöcke mit demselben Akkordeon-Namen schließen einander, sodass immer nur einer aufgeklappt ist.",
|
|
297
310
|
),
|
|
298
311
|
},
|
|
299
312
|
},
|
|
@@ -302,8 +315,8 @@ export const BUILTIN_SECTIONS = {
|
|
|
302
315
|
grid: {
|
|
303
316
|
label: text( "Grid", "Raster" ),
|
|
304
317
|
hint: text(
|
|
305
|
-
"Puts the blocks written inside side by side in columns, starting a new row when a row is full — a paragraph, an image or an embedded
|
|
306
|
-
"Stellt die Blöcke darin in Spalten nebeneinander und beginnt eine neue Zeile, wenn eine voll ist – ein Absatz, ein Bild oder ein eingebetteter
|
|
318
|
+
"Puts the blocks written inside side by side in columns, starting a new row when a row is full — a paragraph, an image or an embedded container each fill one cell. On narrow screens the grid drops columns by itself.",
|
|
319
|
+
"Stellt die Blöcke darin in Spalten nebeneinander und beginnt eine neue Zeile, wenn eine voll ist – ein Absatz, ein Bild oder ein eingebetteter Container füllt je eine Zelle. Auf schmalen Bildschirmen werden es von selbst weniger Spalten.",
|
|
307
320
|
),
|
|
308
321
|
docs: docs( "grid" ),
|
|
309
322
|
props: {
|
package/package.json
CHANGED
package/scripts/check-fixture.js
CHANGED
|
@@ -249,6 +249,12 @@ expect( />Read more<\/a>/.test( containers ), "shows a translated text on a card
|
|
|
249
249
|
expect( tags( containers, "section" ).some( t => /data-layout="float-left"/.test( t ) ) &&
|
|
250
250
|
tags( containers, "aside" ).some( t => /data-layout="split-right"/.test( t ) ),
|
|
251
251
|
"marks a sectioning container with the layout asked for" );
|
|
252
|
+
expect( tags( containers, "div" ).some( t => /class="group"/.test( t ) && /data-layout="float-right"/.test( t ) ),
|
|
253
|
+
"renders a group as a plain <div> carrying its layout" );
|
|
254
|
+
expect( !/container ':::group' is not declared/.test( log ) &&
|
|
255
|
+
manifest.sections?.group?.props?.layout?.values?.length === 4 &&
|
|
256
|
+
manifest.sections?.details?.props?.group?.label?.de === "Akkordeon",
|
|
257
|
+
"offers the group as a type of its own, and calls the details option an accordion" );
|
|
252
258
|
const css = new Bun.Glob( "assets/**/*.css" ).scanSync( { cwd: DIST } ).map( f => readFileSync( join( DIST, f ), "utf-8" ) ).toArray().join( "\n" );
|
|
253
259
|
expect( /\[data-layout=(["']?)split-left\1\]/.test( css ) && /@container/.test( css ),
|
|
254
260
|
"ships the stylesheet of the layout variants with the theme" );
|
package/styles/layouts.css
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*
|
|
2
|
-
* Layout variants of a section, article or
|
|
2
|
+
* Layout variants of a section, article, aside or group — `::: group layout=float-left` —
|
|
3
3
|
* arranging its first block, an image usually, and the content after it:
|
|
4
4
|
*
|
|
5
5
|
* float-left / float-right the content flows around the block and on below it
|