reladraw 0.26.0 → 0.26.1

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.
@@ -15,7 +15,7 @@ That matters here specifically. You can't see the SVG you produced. With auto-la
15
15
 
16
16
  ## Check it is installed, and the same version as this skill
17
17
 
18
- This skill teaches reladraw 0.26.0. Once per session, before the first render, run:
18
+ This skill teaches reladraw 0.26.1. Once per session, before the first render, run:
19
19
 
20
20
  ```
21
21
  reladraw --version
@@ -1,4 +1,4 @@
1
- # Syntax reference — 0.26.0
1
+ # Syntax reference — 0.26.1
2
2
 
3
3
  What the language accepts. The changelog at the end lists what changed in each published version; 0.17.0's changes are large, and its entry has a table of every old spelling and what to write instead.
4
4
 
@@ -1288,7 +1288,7 @@ The output is a standalone SVG: every picture is drawn into it as path data, nev
1288
1288
  reladraw render arch.reladraw --page
1289
1289
  ```
1290
1290
 
1291
- `--page` writes `arch.html`: one self-contained file, for opening in a browser, attaching or committing, that needs nothing running and fetches nothing. The page is in the diagram's own colors, so a dark diagram doesn't sit on a white page, and it is headed with `diagram title:`, or the file's name when there is none. Under the title it says which file it was drawn from and when, such as "drawn from arch.reladraw, 2026-11-05 14:32": the page is a snapshot of the file, and is behind it once the file is edited, until it is rendered again. Drag to pan, or use `h` `j` `k` `l`, or press `g` to grab the diagram and pan it with the arrow keys (Shift for bigger steps either way, `g` or Escape to let go); scroll, pinch or double-click to zoom; Fit shows the whole diagram and 100% returns it to its own scale. The zoom is always shown, with "Fit" beside it while the whole diagram is in view. There is a full-screen button. The Save menu saves the page itself, as it was written rather than at its current zoom; the `.reladraw` source it was drawn from; or the picture as an SVG or a PNG, as `render` would draw it; or copies the SVG. Each is named after the source file: `arch.html`, `arch.reladraw`, `arch.svg`, `arch.png`. In Chrome and Edge it asks where to save; other browsers put the file with their downloads. The findings are listed beside it in a panel that folds away, and clicking one lights up what its line drew. A box's or a line's name shows under the pointer. The theme picker draws the diagram in another theme, as `--theme` would, keeping the view and the selection; a page or text color the file states holds in every theme, and Save SVG, PNG and Copy SVG take the theme shown. It starts on "Diagram's theme", the one the file names (or dark), which follows the file when it is rendered again. A theme picked by name is the reader's: it holds on every reladraw page in that browser, whatever the file says, until "Diagram's theme" is picked again.
1291
+ `--page` writes `arch.html`: one self-contained file, for opening in a browser, attaching or committing, that needs nothing running and fetches nothing. The page is in the diagram's own colors, so a dark diagram doesn't sit on a white page, and it is headed with `diagram title:`, or the file's name when there is none. Under the title it says which file it was drawn from and when, such as "drawn from arch.reladraw, 2026-11-05 14:32": the page is a snapshot of the file, and is behind it once the file is edited, until it is rendered again. Drag to pan, or press `g` to grab the diagram and pan it with the arrow keys or `h` `j` `k` `l` (Shift for bigger steps, `g` or Escape to let go); scroll, pinch or double-click to zoom; Fit shows the whole diagram and 100% returns it to its own scale. The zoom is always shown, with "Fit" beside it while the whole diagram is in view. There is a full-screen button. The Save menu saves the page itself, as it was written rather than at its current zoom; the `.reladraw` source it was drawn from; or the picture as an SVG or a PNG, as `render` would draw it; or copies the SVG. Each is named after the source file: `arch.html`, `arch.reladraw`, `arch.svg`, `arch.png`. In Chrome and Edge it asks where to save; other browsers put the file with their downloads. The findings are listed beside it in a panel that folds away, and clicking one lights up what its line drew. A box's or a line's name shows under the pointer. The theme picker draws the diagram in another theme, as `--theme` would, keeping the view and the selection; a page or text color the file states holds in every theme, and Save SVG, PNG and Copy SVG take the theme shown. It starts on "Diagram's theme", the one the file names (or dark), which follows the file when it is rendered again. A theme picked by name is the reader's: it holds on every reladraw page in that browser, whatever the file says, until "Diagram's theme" is picked again.
1292
1292
 
1293
1293
  The side panel can be hidden with the Panel button or `p`, and then stays hidden whatever is selected. With Auto-hide ticked it shows only while something is selected or the findings are open, and the findings start folded. Both choices are remembered by the browser for every page.
1294
1294
 
@@ -1416,6 +1416,10 @@ Designed and absent from the code.
1416
1416
 
1417
1417
  Pre-1.0, so the minor number is where a breaking change goes. Every removal is refused by name with the replacement quoted, rather than dropped in silence: an older file stops with an error saying what to write instead.
1418
1418
 
1419
+ **0.26.1**
1420
+
1421
+ - `h` `j` `k` `l` now pan only while the diagram is grabbed with `g`, as the arrow keys do, on the `--page` page and in the playground. In 0.26.0 they panned without a grab.
1422
+
1419
1423
  **0.26.0**
1420
1424
 
1421
1425
  - **The arrow keys pan a diagram**, on the `--page` page and in the playground. Press `g` to grab the diagram: a border and a hint show it is held, the arrows pan it a step at a time, and Shift makes the steps bigger. `g` again or Escape lets go, and the arrows go back to whatever else uses them. Clicking into a text field lets go too. `h` `j` `k` `l` pan the same way without a grab.
package/README.md CHANGED
@@ -94,7 +94,7 @@ To install the skill from the main branch instead, which can run ahead of the re
94
94
 
95
95
  ## Status
96
96
 
97
- Version 0.26.0. Early stage, but works. The parser, layout engine, and SVG renderer are written in TypeScript, with zero runtime dependencies. There is a command-line tool that turns a .reladraw text file into an SVG, and an element that does the same inside a web page.
97
+ Version 0.26.1. Early stage, but works. The parser, layout engine, and SVG renderer are written in TypeScript, with zero runtime dependencies. There is a command-line tool that turns a .reladraw text file into an SVG, and an element that does the same inside a web page.
98
98
 
99
99
  ## License
100
100
 
package/SYNTAX.md CHANGED
@@ -1,4 +1,4 @@
1
- # Syntax reference — 0.26.0
1
+ # Syntax reference — 0.26.1
2
2
 
3
3
  What the language accepts. The changelog at the end lists what changed in each published version; 0.17.0's changes are large, and its entry has a table of every old spelling and what to write instead.
4
4
 
@@ -1288,7 +1288,7 @@ The output is a standalone SVG: every picture is drawn into it as path data, nev
1288
1288
  reladraw render arch.reladraw --page
1289
1289
  ```
1290
1290
 
1291
- `--page` writes `arch.html`: one self-contained file, for opening in a browser, attaching or committing, that needs nothing running and fetches nothing. The page is in the diagram's own colors, so a dark diagram doesn't sit on a white page, and it is headed with `diagram title:`, or the file's name when there is none. Under the title it says which file it was drawn from and when, such as "drawn from arch.reladraw, 2026-11-05 14:32": the page is a snapshot of the file, and is behind it once the file is edited, until it is rendered again. Drag to pan, or use `h` `j` `k` `l`, or press `g` to grab the diagram and pan it with the arrow keys (Shift for bigger steps either way, `g` or Escape to let go); scroll, pinch or double-click to zoom; Fit shows the whole diagram and 100% returns it to its own scale. The zoom is always shown, with "Fit" beside it while the whole diagram is in view. There is a full-screen button. The Save menu saves the page itself, as it was written rather than at its current zoom; the `.reladraw` source it was drawn from; or the picture as an SVG or a PNG, as `render` would draw it; or copies the SVG. Each is named after the source file: `arch.html`, `arch.reladraw`, `arch.svg`, `arch.png`. In Chrome and Edge it asks where to save; other browsers put the file with their downloads. The findings are listed beside it in a panel that folds away, and clicking one lights up what its line drew. A box's or a line's name shows under the pointer. The theme picker draws the diagram in another theme, as `--theme` would, keeping the view and the selection; a page or text color the file states holds in every theme, and Save SVG, PNG and Copy SVG take the theme shown. It starts on "Diagram's theme", the one the file names (or dark), which follows the file when it is rendered again. A theme picked by name is the reader's: it holds on every reladraw page in that browser, whatever the file says, until "Diagram's theme" is picked again.
1291
+ `--page` writes `arch.html`: one self-contained file, for opening in a browser, attaching or committing, that needs nothing running and fetches nothing. The page is in the diagram's own colors, so a dark diagram doesn't sit on a white page, and it is headed with `diagram title:`, or the file's name when there is none. Under the title it says which file it was drawn from and when, such as "drawn from arch.reladraw, 2026-11-05 14:32": the page is a snapshot of the file, and is behind it once the file is edited, until it is rendered again. Drag to pan, or press `g` to grab the diagram and pan it with the arrow keys or `h` `j` `k` `l` (Shift for bigger steps, `g` or Escape to let go); scroll, pinch or double-click to zoom; Fit shows the whole diagram and 100% returns it to its own scale. The zoom is always shown, with "Fit" beside it while the whole diagram is in view. There is a full-screen button. The Save menu saves the page itself, as it was written rather than at its current zoom; the `.reladraw` source it was drawn from; or the picture as an SVG or a PNG, as `render` would draw it; or copies the SVG. Each is named after the source file: `arch.html`, `arch.reladraw`, `arch.svg`, `arch.png`. In Chrome and Edge it asks where to save; other browsers put the file with their downloads. The findings are listed beside it in a panel that folds away, and clicking one lights up what its line drew. A box's or a line's name shows under the pointer. The theme picker draws the diagram in another theme, as `--theme` would, keeping the view and the selection; a page or text color the file states holds in every theme, and Save SVG, PNG and Copy SVG take the theme shown. It starts on "Diagram's theme", the one the file names (or dark), which follows the file when it is rendered again. A theme picked by name is the reader's: it holds on every reladraw page in that browser, whatever the file says, until "Diagram's theme" is picked again.
1292
1292
 
1293
1293
  The side panel can be hidden with the Panel button or `p`, and then stays hidden whatever is selected. With Auto-hide ticked it shows only while something is selected or the findings are open, and the findings start folded. Both choices are remembered by the browser for every page.
1294
1294
 
@@ -1416,6 +1416,10 @@ Designed and absent from the code.
1416
1416
 
1417
1417
  Pre-1.0, so the minor number is where a breaking change goes. Every removal is refused by name with the replacement quoted, rather than dropped in silence: an older file stops with an error saying what to write instead.
1418
1418
 
1419
+ **0.26.1**
1420
+
1421
+ - `h` `j` `k` `l` now pan only while the diagram is grabbed with `g`, as the arrow keys do, on the `--page` page and in the playground. In 0.26.0 they panned without a grab.
1422
+
1419
1423
  **0.26.0**
1420
1424
 
1421
1425
  - **The arrow keys pan a diagram**, on the `--page` page and in the playground. Press `g` to grab the diagram: a border and a hint show it is held, the arrows pan it a step at a time, and Shift makes the steps bigger. `g` again or Escape lets go, and the arrows go back to whatever else uses them. Clicking into a text field lets go too. `h` `j` `k` `l` pan the same way without a grab.
package/dist/viewer.d.ts CHANGED
@@ -2,8 +2,8 @@
2
2
  * The pan and zoom shared by the page `render --page` writes and the
3
3
  * playground, so the two look at a diagram the same way: − and +, Fit, 100%,
4
4
  * the zoom always shown and saying "Fit" while fitted, the wheel, a pinch, a
5
- * drag, a double-click, the keys + - 0 1, h j k l to pan, and g to grab the
6
- * diagram so the arrows pan it too.
5
+ * drag, a double-click, the keys + - 0 1, and g to grab the diagram so the
6
+ * arrows or h j k l pan it.
7
7
  *
8
8
  * It is browser code kept as a string, since it runs in a page, not here: the
9
9
  * page writes it into its script, and the playground's build writes it into
package/dist/viewer.js CHANGED
@@ -2,8 +2,8 @@
2
2
  * The pan and zoom shared by the page `render --page` writes and the
3
3
  * playground, so the two look at a diagram the same way: − and +, Fit, 100%,
4
4
  * the zoom always shown and saying "Fit" while fitted, the wheel, a pinch, a
5
- * drag, a double-click, the keys + - 0 1, h j k l to pan, and g to grab the
6
- * diagram so the arrows pan it too.
5
+ * drag, a double-click, the keys + - 0 1, and g to grab the diagram so the
6
+ * arrows or h j k l pan it.
7
7
  *
8
8
  * It is browser code kept as a string, since it runs in a page, not here: the
9
9
  * page writes it into its script, and the playground's build writes it into
@@ -174,7 +174,7 @@ function panZoom(view, stage, label, buttons) {
174
174
  return !!(target && target.closest && target.closest('input, textarea, select, [contenteditable]'));
175
175
  }
176
176
 
177
- // g grabs the diagram, and while it is held the arrows pan it; g again or
177
+ // g grabs the diagram, and while it is held the arrows or h j k l pan it; g again or
178
178
  // Escape lets go, and the arrows go back to whatever else uses them. The
179
179
  // keys are taken before the page's own handlers see them, so a held
180
180
  // diagram's arrows don't also move a list or a divider, and its Escape lets
@@ -193,16 +193,17 @@ function panZoom(view, stage, label, buttons) {
193
193
  }
194
194
 
195
195
  var ARROWS = { ArrowLeft: [1, 0], ArrowRight: [-1, 0], ArrowUp: [0, 1], ArrowDown: [0, -1] };
196
- // h j k l pan as the arrows do, without a grab: nothing else uses them.
196
+ // h j k l pan as the arrows do, and like them only while the diagram is
197
+ // held, so g is the one way into panning from the keyboard.
197
198
  var LETTERS = { h: [1, 0], l: [-1, 0], k: [0, 1], j: [0, -1] };
198
199
 
199
200
  document.addEventListener('keydown', function (event) {
200
201
  if (event.ctrlKey || event.metaKey || event.altKey) return;
201
202
  if (typing(event.target)) return;
202
- var arrow = (held && ARROWS[event.key]) || LETTERS[event.key.toLowerCase()];
203
+ var arrow = ARROWS[event.key] || LETTERS[event.key.toLowerCase()];
203
204
  if (event.key === 'g' || event.key === 'G') grab(!held);
204
205
  else if (held && event.key === 'Escape') grab(false);
205
- else if (arrow) {
206
+ else if (held && arrow) {
206
207
  // A tenth of the view a press, half of it with Shift; held down, the
207
208
  // key repeats.
208
209
  var room = size();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "reladraw",
3
- "version": "0.26.0",
3
+ "version": "0.26.1",
4
4
  "description": "A diagram language where you say where things go.",
5
5
  "type": "module",
6
6
  "bin": {