@barmark/render 0.9.1 → 0.10.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 +9 -1
- package/dist/html.js +3 -1
- package/dist/model.js +3 -3
- package/dist/types.d.ts +3 -1
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -6,6 +6,13 @@ package uses [semantic versioning](https://semver.org/).
|
|
|
6
6
|
|
|
7
7
|
## [Unreleased]
|
|
8
8
|
|
|
9
|
+
## [0.10.0] - 2026-11-03
|
|
10
|
+
|
|
11
|
+
### Added
|
|
12
|
+
|
|
13
|
+
- **The part** a chart names (`part: Electric Guitar 1`) leads the
|
|
14
|
+
header line: "Electric Guitar 1 · G major". The model gains `part`.
|
|
15
|
+
|
|
9
16
|
## [0.9.1] - 2026-11-03
|
|
10
17
|
|
|
11
18
|
### Fixed
|
|
@@ -268,7 +275,8 @@ that needs no script or as the `<barmark-chart>` web component. Requires
|
|
|
268
275
|
zoom without sideways scrolling, the element renders and re-renders, and
|
|
269
276
|
a screen reader hears "bar 9: D". Run them with `bun run test:browser`.
|
|
270
277
|
|
|
271
|
-
[Unreleased]: https://github.com/kevinpeckham/barmark/compare/render-v0.
|
|
278
|
+
[Unreleased]: https://github.com/kevinpeckham/barmark/compare/render-v0.10.0...HEAD
|
|
279
|
+
[0.10.0]: https://github.com/kevinpeckham/barmark/compare/render-v0.9.1...render-v0.10.0
|
|
272
280
|
[0.9.1]: https://github.com/kevinpeckham/barmark/compare/render-v0.9.0...render-v0.9.1
|
|
273
281
|
[0.9.0]: https://github.com/kevinpeckham/barmark/compare/render-v0.8.0...render-v0.9.0
|
|
274
282
|
[0.8.0]: https://github.com/kevinpeckham/barmark/compare/render-v0.7.3...render-v0.8.0
|
package/dist/html.js
CHANGED
|
@@ -48,7 +48,9 @@ function headerHtml(model) {
|
|
|
48
48
|
const title = model.title
|
|
49
49
|
? `<h2 class="bm-title" part="title">${escapeHtml(model.title)}</h2>`
|
|
50
50
|
: "";
|
|
51
|
-
const meta = metaText(model.header)
|
|
51
|
+
const meta = [model.part ? escapeHtml(model.part.name) : "", metaText(model.header)]
|
|
52
|
+
.filter(Boolean)
|
|
53
|
+
.join(" · ");
|
|
52
54
|
if (!title && !meta)
|
|
53
55
|
return "";
|
|
54
56
|
return `<header class="bm-header">${title}${meta ? `<p class="bm-meta" part="meta">${meta}</p>` : ""}</header>`;
|
package/dist/model.js
CHANGED
|
@@ -18,7 +18,7 @@ export function layoutChart(text, options = {}) {
|
|
|
18
18
|
const blocks = groups.map((g) => layoutGroup(g, ctx));
|
|
19
19
|
if (options.rehearsalLetters)
|
|
20
20
|
letterBlocks(blocks);
|
|
21
|
-
return { title: parse.title, header, blocks, diagnostics: parse.diagnostics };
|
|
21
|
+
return { title: parse.title, part: parse.part, header, blocks, diagnostics: parse.diagnostics };
|
|
22
22
|
}
|
|
23
23
|
/** Rehearsal letters mark position: every section occurrence, and leading bars, in play order. */
|
|
24
24
|
function letterBlocks(blocks) {
|
|
@@ -49,7 +49,7 @@ function splitHeader(lines) {
|
|
|
49
49
|
let i = 0;
|
|
50
50
|
for (; i < lines.length; i++) {
|
|
51
51
|
const l = lines[i];
|
|
52
|
-
if (l?.kind === "title")
|
|
52
|
+
if (l?.kind === "title" || l?.kind === "part")
|
|
53
53
|
continue;
|
|
54
54
|
if (l?.kind !== "directive")
|
|
55
55
|
break;
|
|
@@ -58,7 +58,7 @@ function splitHeader(lines) {
|
|
|
58
58
|
delete header.swingPercent;
|
|
59
59
|
Object.assign(header, l.set);
|
|
60
60
|
}
|
|
61
|
-
return { header, body: lines.slice(i).filter((l) => l.kind !== "title") };
|
|
61
|
+
return { header, body: lines.slice(i).filter((l) => l.kind !== "title" && l.kind !== "part") };
|
|
62
62
|
}
|
|
63
63
|
function groupLines(lines) {
|
|
64
64
|
const groups = [];
|
package/dist/types.d.ts
CHANGED
|
@@ -1,10 +1,12 @@
|
|
|
1
|
-
import type { ChartDiagnostic, Direction, Directives, Key, Meter, Repeat, Slot, Words } from "barmark";
|
|
1
|
+
import type { ChartDiagnostic, Direction, Directives, Key, Meter, Part, Repeat, Slot, Words } from "barmark";
|
|
2
2
|
export type LayoutOptions = {
|
|
3
3
|
rehearsalLetters?: boolean;
|
|
4
4
|
};
|
|
5
5
|
/** What to draw, with every musical decision already made. */
|
|
6
6
|
export type ChartModel = {
|
|
7
7
|
title: string | null;
|
|
8
|
+
/** What `part:` names; null when the chart names none. */
|
|
9
|
+
part: Part | null;
|
|
8
10
|
/** Directives before the first heading, bar line or text line. */
|
|
9
11
|
header: Directives;
|
|
10
12
|
blocks: SectionBlock[];
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@barmark/render",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.10.0",
|
|
4
4
|
"description": "Render barmark chord charts as a clean, accessible bar grid: HTML with Declarative Shadow DOM, or the <barmark-chart> web component.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"exports": {
|
|
@@ -47,7 +47,7 @@
|
|
|
47
47
|
"url": "https://github.com/kevinpeckham/barmark/issues"
|
|
48
48
|
},
|
|
49
49
|
"dependencies": {
|
|
50
|
-
"barmark": "^0.
|
|
50
|
+
"barmark": "^0.13.0"
|
|
51
51
|
},
|
|
52
52
|
"scripts": {
|
|
53
53
|
"build": "rm -rf dist && tsc -p tsconfig.build.json",
|