@phun-ky/arclace 0.3.0 → 1.0.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 +16 -0
- package/README.md +71 -2
- package/package.json +4 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,21 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [1.0.0](https://github.com/phun-ky/arclace/compare/0.3.0...1.0.0) (2026-11-04)
|
|
4
|
+
|
|
5
|
+
### Documentation
|
|
6
|
+
|
|
7
|
+
* ✏️ 1.0 release notes, banners and policies ([e929cea](https://github.com/phun-ky/arclace/commit/e929ceace112eca7bc265b9bd57210d40a9ed347)), closes [#21](https://github.com/phun-ky/arclace/issues/21)
|
|
8
|
+
* ✏️ a docs site design to match the Bow mark ([a769977](https://github.com/phun-ky/arclace/commit/a769977f01a220e30da64c02422a11775053d838)), closes [#75](https://github.com/phun-ky/arclace/issues/75)
|
|
9
|
+
* ✏️ a logo for Arclace ([84b5dae](https://github.com/phun-ky/arclace/commit/84b5dae26ac836e4369506cd7e76351714386e24)), closes [#73](https://github.com/phun-ky/arclace/issues/73), references [#73](https://github.com/phun-ky/arclace/issues/73)
|
|
10
|
+
* ✏️ meet AA text contrast on the docs site ([793ae66](https://github.com/phun-ky/arclace/commit/793ae66f53f1e999e8d2fdcd7b7f82ae25a14d6e)), closes [#68](https://github.com/phun-ky/arclace/issues/68), references [#99acb2](https://github.com/phun-ky/arclace/issues/99acb2) [#5d747b](https://github.com/phun-ky/arclace/issues/5d747b) [#2865f0](https://github.com/phun-ky/arclace/issues/2865f0) [#f2f6ff](https://github.com/phun-ky/arclace/issues/f2f6ff)
|
|
11
|
+
* ✏️ record signed releases from 0.3.0 on ([7d84dfc](https://github.com/phun-ky/arclace/commit/7d84dfc53074013a9d360bbf08f140a9b8ce0f1b)), closes [#66](https://github.com/phun-ky/arclace/issues/66)
|
|
12
|
+
* ✏️ say how the lines work with assistive technology ([f4b8419](https://github.com/phun-ky/arclace/commit/f4b84197b6f216d76cfda9f9884104555e12b8cf)), closes [#60](https://github.com/phun-ky/arclace/issues/60), references [#68](https://github.com/phun-ky/arclace/issues/68)
|
|
13
|
+
* ✏️ switch the logo to the Bow mark ([9b3f6ac](https://github.com/phun-ky/arclace/commit/9b3f6ac5d57b219b6faa81f702ebd239d99fb33b)), references [#73](https://github.com/phun-ky/arclace/issues/73) [#73](https://github.com/phun-ky/arclace/issues/73)
|
|
14
|
+
|
|
15
|
+
### Refactoring
|
|
16
|
+
|
|
17
|
+
* 💡 share the Chrome renderer between the logo and the banners ([d626118](https://github.com/phun-ky/arclace/commit/d626118eba5efb3e17408e225079c0a634d86037)), references [#21](https://github.com/phun-ky/arclace/issues/21)
|
|
18
|
+
|
|
3
19
|
## [0.3.0](https://github.com/phun-ky/arclace/compare/0.2.0...0.3.0) (2026-11-04)
|
|
4
20
|
|
|
5
21
|
### ⚠ BREAKING CHANGES
|
package/README.md
CHANGED
|
@@ -1,10 +1,18 @@
|
|
|
1
1
|
# @phun-ky/arclace
|
|
2
2
|
|
|
3
|
+
<picture>
|
|
4
|
+
<source media="(prefers-color-scheme: dark)" srcset="./docs/public/logo/banner-dark.png">
|
|
5
|
+
<img alt="Arclace: a tied lace with two loops and two tails, with the tagline: draw SVG lines between DOM elements" src="./docs/public/logo/banner-light.png">
|
|
6
|
+
</picture>
|
|
7
|
+
|
|
3
8
|
[](https://www.bestpractices.dev/projects/16333)
|
|
4
9
|
[](https://scorecard.dev/viewer/?uri=github.com/phun-ky/arclace)
|
|
5
10
|
|
|
6
11
|
> Draw SVG lines between DOM elements.
|
|
7
12
|
|
|
13
|
+
**1.0 is out:** [release notes](https://phun-ky.net/arclace/guide/releases/1.0)
|
|
14
|
+
and [upgrading from 0.x](https://phun-ky.net/arclace/guide/upgrading).
|
|
15
|
+
|
|
8
16
|
Point it at two elements and it draws a line between them: a curve, a straight
|
|
9
17
|
line or an orthogonal "circuit board" line, with optional arrows, labels and
|
|
10
18
|
anchors. The lines follow the elements when they move, resize, scroll or get
|
|
@@ -89,7 +97,8 @@ const arclace = createConnections(
|
|
|
89
97
|
|
|
90
98
|
Each instance adds one `<svg class="arc-svg">` to its container, absolutely
|
|
91
99
|
positioned over the container's content, and draws every line into it. The
|
|
92
|
-
overlay doesn't block clicks (`pointer-events: none`)
|
|
100
|
+
overlay doesn't block clicks (`pointer-events: none`), and is hidden from
|
|
101
|
+
assistive technology (`aria-hidden`); see [Accessibility](#accessibility).
|
|
93
102
|
|
|
94
103
|
- Put all the elements you connect inside the container. If the container is
|
|
95
104
|
`position: static` it is changed to `position: relative` so the overlay
|
|
@@ -247,8 +256,25 @@ clickable, turn pointer events back on for the paths:
|
|
|
247
256
|
}
|
|
248
257
|
```
|
|
249
258
|
|
|
259
|
+
A line can't take keyboard focus and is hidden from screen readers, so make a
|
|
260
|
+
click on it a shortcut for a control that is in your page anyway, such as a
|
|
261
|
+
button:
|
|
262
|
+
|
|
263
|
+
```html
|
|
264
|
+
<div id="diagram">
|
|
265
|
+
<div class="box" id="a">A</div>
|
|
266
|
+
<div class="box" id="b">B</div>
|
|
267
|
+
<div class="box" id="c">C</div>
|
|
268
|
+
<button type="button" id="details">Show A to B</button>
|
|
269
|
+
</div>
|
|
270
|
+
```
|
|
271
|
+
|
|
250
272
|
```ts
|
|
251
|
-
|
|
273
|
+
const showDetails = () => console.log(connection.id);
|
|
274
|
+
|
|
275
|
+
document.querySelector('#details')?.addEventListener('click', showDetails);
|
|
276
|
+
// The same action for pointer users who click the line
|
|
277
|
+
connection.path.addEventListener('click', showDetails);
|
|
252
278
|
```
|
|
253
279
|
|
|
254
280
|
## Keeping lines in sync
|
|
@@ -280,6 +306,49 @@ useEffect(() => {
|
|
|
280
306
|
}, []);
|
|
281
307
|
```
|
|
282
308
|
|
|
309
|
+
## Accessibility
|
|
310
|
+
|
|
311
|
+
The lines are decorative. The overlay has `aria-hidden="true"`, so screen
|
|
312
|
+
readers don't announce lines, arrows or labels, and a line can't take keyboard
|
|
313
|
+
focus. Whatever a line tells sighted users must also be in your page's own HTML.
|
|
314
|
+
|
|
315
|
+
The simplest way is to connect elements whose markup already says how they
|
|
316
|
+
relate. Lines between the items of an ordered list show a sequence that a screen
|
|
317
|
+
reader reads out as a list of steps:
|
|
318
|
+
|
|
319
|
+
```html
|
|
320
|
+
<ol id="diagram">
|
|
321
|
+
<li class="box" id="a">Build</li>
|
|
322
|
+
<li class="box" id="b">Test</li>
|
|
323
|
+
<li class="box" id="c">Deploy</li>
|
|
324
|
+
</ol>
|
|
325
|
+
```
|
|
326
|
+
|
|
327
|
+
```ts
|
|
328
|
+
const arclace = new Arclace({ container: '#diagram' });
|
|
329
|
+
|
|
330
|
+
arclace.connect('#a', '#b', { arrow: 'end' });
|
|
331
|
+
arclace.connect('#b', '#c', { arrow: 'end' });
|
|
332
|
+
```
|
|
333
|
+
|
|
334
|
+
Beyond that:
|
|
335
|
+
|
|
336
|
+
- **Describe other relationships in text,** for example in a table of what
|
|
337
|
+
connects to what, or in a sentence that `aria-describedby` on a focusable
|
|
338
|
+
element points at.
|
|
339
|
+
- **Repeat labels in the page.** A label is part of the overlay, so its text
|
|
340
|
+
isn't announced either.
|
|
341
|
+
- **Don't tell lines apart by color alone.** Use `dashed`, `arrow` or a label as
|
|
342
|
+
well, and give lines a contrast of at least 3:1 with the background so they
|
|
343
|
+
stay visible with low vision.
|
|
344
|
+
- **Motion:** with the stylesheet, `animated` lines stop moving when the user
|
|
345
|
+
asks for reduced motion (`prefers-reduced-motion`).
|
|
346
|
+
- **Clickable lines** need the same action on a control in the page; see
|
|
347
|
+
[Clickable lines](#clickable-lines).
|
|
348
|
+
|
|
349
|
+
Arclace doesn't add `aria-describedby` or any other attribute to your elements:
|
|
350
|
+
it only changes what it draws.
|
|
351
|
+
|
|
283
352
|
## Development
|
|
284
353
|
|
|
285
354
|
```shell
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@phun-ky/arclace",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "1.0.0",
|
|
4
4
|
"description": "Draw SVG lines between DOM elements. Framework agnostic, zero dependencies.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"connect",
|
|
@@ -58,6 +58,7 @@
|
|
|
58
58
|
"node": ">=22.12.0"
|
|
59
59
|
},
|
|
60
60
|
"scripts": {
|
|
61
|
+
"banners": "node scripts/banners/render.mjs",
|
|
61
62
|
"bestpractices:url": "node scripts/bestpractices-url.mjs",
|
|
62
63
|
"build": "rm -rf dts && vite build && tsc -p tsconfig.build.json && rollup -c",
|
|
63
64
|
"check:bestpractices": "node scripts/check-bestpractices.mjs",
|
|
@@ -71,11 +72,12 @@
|
|
|
71
72
|
"docs:build": "vitepress build docs",
|
|
72
73
|
"docs:preview": "vitepress preview docs",
|
|
73
74
|
"lint": "eslint .",
|
|
75
|
+
"logo": "node scripts/render-logo.mjs",
|
|
74
76
|
"prepare": "git config core.hooksPath .githooks || true",
|
|
75
77
|
"prepublishOnly": "npm run build",
|
|
76
78
|
"preview": "vite preview",
|
|
77
79
|
"release": "release-it",
|
|
78
|
-
"release:dry-run": ".github/scripts/
|
|
80
|
+
"release:dry-run": ".github/scripts/release-dry-run.sh",
|
|
79
81
|
"test": "node --import tsx --import global-jsdom/register --test --no-warnings 'src/**/__tests__/**/*.spec.ts'",
|
|
80
82
|
"pretest:ci": "rm -rf coverage && mkdir -p coverage",
|
|
81
83
|
"test:ci": "node --import tsx --import global-jsdom/register --test --no-warnings --experimental-test-coverage --test-coverage-include='src/**/*.ts' --test-coverage-exclude='src/**/__tests__/**' --test-coverage-exclude='src/types.ts' --test-coverage-lines=99 --test-coverage-functions=100 --test-coverage-branches=95 --test-reporter=cobertura --test-reporter-destination=coverage/cobertura-coverage.xml --test-reporter=spec --test-reporter-destination=stdout 'src/**/__tests__/**/*.spec.ts'",
|