Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions .agent/skills/basalt-html/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,13 @@ Markup your script builds (a `.row`) isn't seen: add `<!-- basalt:use rows -->`
- **diagram-zoom** `.diagram`: added for you, with `dialog`; `"zoom": false` drops Expand.
- **diagram-export** `"export": true`: added for you; SVG and PNG downloads in the foot.
- **diagram-text** `"variant": "text"`: added for you; a sequence in box-drawing art, else its transcript.
- **diagram-scale** `"type": "gantt"`: added for you with a gantt or a timeline; arithmetic only.
- **diagram-gantt** `"type": "gantt"`: added for you; no dependency lines (`after` is written in the row), a bar never widened.
- **diagram-matrix** `"type": "kanban"`: added for you (and journey, service-blueprint, story-map); read-only, an empty cell in words.
- **diagram-timeline** `"type": "timeline"`: added for you; `at` is an instant with its offset, breaks are yours alone.
- **diagram-schedule** `"type": "schedule"`: added for you; write durations and `after`, never a number.
- **diagram-state** `"type": "state"`: added for you; `event`, `guard`, `action`, never a `label`.
- **diagram-deployment** `"type": "deployment"`: added for you; `environment` is required, artifacts are rows.
- **sparkline** `.sparkline`: JSON in `script[data-sparkline]`; one line, no axes or series (that is a `chart`).
- **palette** `data-open-palette`, `Basalt.init({ palette })`: `keys` is an array, `['⌘', 'S']`: ⌘, ⌃ or ⌥ plus one key.
- **command-list** `.command-list`: the script builds it; items are the palette's; ⌘K goes to the palette when the page has one.
Expand Down
7 changes: 5 additions & 2 deletions .agent/skills/basalt-html/compose.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -692,7 +692,7 @@ function writeDiagrams(markup, held, parts, notes, marks) {
// Each card's mark: a bundled id is checked and its rule written once; the page's own mark is read into the page and named by an id, so the JSON
// the script reads carries the id and never a path.
// An automatic figure (DECISIONS 306, 1.8) is placed here, at build time, for both directions; the page holds the placement and never elkjs.
if (spec && spec.layout === "auto" && !spec.placement && ["architecture", "flowchart", "schema"].includes(spec.type)) {
if (spec && spec.layout === "auto" && !spec.placement && ["architecture", "flowchart", "schema", "state", "deployment", "schedule"].includes(spec.type)) {
try {
spec.placement = placeNow(parts, spec);
const inner = `\n${JSON.stringify(spec).replace(/</g, "\\u003c")}\n`;
Expand Down Expand Up @@ -720,7 +720,10 @@ function writeDiagrams(markup, held, parts, notes, marks) {
}
if (!engine) {
const context = { window: { Basalt: { _: { step() {}, esc: (x) => x } } }, console: { warn() {}, error() {}, log() {} } };
vm.runInNewContext(read(parts, "diagram.js"), context);
// The type modules (DECISIONS 359) register their types with the diagram module, so their figures' words are written here too.
const ctx = vm.createContext(context);
for (const name of ["diagram-scale", "diagram-gantt", "diagram-matrix", "diagram-timeline", "diagram-schedule", "diagram-state", "diagram-deployment"]) if (exists(parts, `${name}.js`)) vm.runInContext(read(parts, `${name}.js`), ctx);
vm.runInContext(read(parts, "diagram.js"), ctx);
engine = context.window.Basalt._.diagramMarkup;
}
let made;
Expand Down
1 change: 1 addition & 0 deletions .agent/skills/basalt-html/parts/diagram-deployment.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions .agent/skills/basalt-html/parts/diagram-deployment.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions .agent/skills/basalt-html/parts/diagram-gantt.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
Loading