@fusion.dev/helix-headless 0.209.0 → 0.211.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/api.json +1 -1
- package/custom-elements.json +1 -1
- package/dist/canvas/root/canvas-root.d.ts +39 -1
- package/dist/canvas/root/canvas-root.js +4 -0
- package/dist/graph/root/graph-root.d.ts +50 -10
- package/dist/graph/root/graph-root.js +24 -23
- package/dist/legend/root/legend-root.d.ts +9 -15
- package/dist/legend/root/legend-root.js +10 -20
- package/dist/map/root/map-root.d.ts +59 -2
- package/dist/map/root/map-root.js +123 -33
- package/dist/toolbar/root/toolbar-root.d.ts +5 -88
- package/dist/toolbar/root/toolbar-root.js +10 -227
- package/examples.json +1 -1
- package/lint.json +1 -1
- package/package.json +5 -5
- package/types/jsx.d.ts +240 -10
- package/types/vue.d.ts +3 -3
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import { type CanvasView, HelixElement, type ViewportPanDetail, type ViewportWay, type ViewportZoomDetail } from '@fusion.dev/helix-core';
|
|
2
2
|
import { type PropertyValues, type TemplateResult } from 'lit';
|
|
3
|
+
import type { StaticValue } from 'lit/static-html.js';
|
|
4
|
+
import '../../icon-button/index.js';
|
|
3
5
|
import { type CanvasArrangeOptions } from '../arrange.js';
|
|
4
6
|
import { type CanvasDocument, type CanvasRoute, type CanvasTone } from './canvas-document.js';
|
|
5
7
|
export type { CanvasArrangeOptions } from '../arrange.js';
|
|
@@ -50,6 +52,9 @@ declare const HelixHeadlessCanvas_base: (new (...args: any[]) => import("@fusion
|
|
|
50
52
|
* board, where the arrow keys pan it.
|
|
51
53
|
* - Plus and minus zoom the board, on the board and on a card or a
|
|
52
54
|
* connection.
|
|
55
|
+
* - The pan and zoom buttons are a toolbar and one tab stop. The arrow keys
|
|
56
|
+
* move between them by where they sit, Right from the up arrow to zoom in,
|
|
57
|
+
* and Enter or Space presses one.
|
|
53
58
|
* - The arrow keys move through the cards in reading order. The card you land
|
|
54
59
|
* on scrolls into view, and its connections are announced with it.
|
|
55
60
|
* - The card you land on is selected. Control or Command with an arrow key,
|
|
@@ -162,7 +167,7 @@ declare const HelixHeadlessCanvas_base: (new (...args: any[]) => import("@fusion
|
|
|
162
167
|
*
|
|
163
168
|
* @csspart arrow - The arrowhead at an end of a connection that has one.
|
|
164
169
|
* @csspart board - The plane the cards are placed on, which pans and zooms.
|
|
165
|
-
* @csspart controls - The
|
|
170
|
+
* @csspart controls - The toolbar the pan and zoom buttons sit in, one tab stop.
|
|
166
171
|
* @csspart draft - The connection being drawn, before `helix-connect` is sent.
|
|
167
172
|
* @csspart edge - One connector between two cards.
|
|
168
173
|
* @csspart edge-end - An end of a selected connection. Drag it, or click it to pick it up.
|
|
@@ -170,6 +175,10 @@ declare const HelixHeadlessCanvas_base: (new (...args: any[]) => import("@fusion
|
|
|
170
175
|
* @csspart edges - A layer the connectors are drawn in: one holding the arrowhead, and one after each card holding the connections leaving it, so they are read in the order the arrows walk them. Give it `z-index: -1` to draw it under the cards.
|
|
171
176
|
* @csspart footer - The strip below the board.
|
|
172
177
|
* @csspart fullscreen - The button that makes the board fill the screen.
|
|
178
|
+
* @csspart fullscreen-button - `fullscreen`'s inner button.
|
|
179
|
+
* @csspart fullscreen-live - `fullscreen`'s live region, which speaks while it is pending.
|
|
180
|
+
* @csspart fullscreen-spinner - The ring `fullscreen` turns while it is pending.
|
|
181
|
+
* @csspart fullscreen-text - The box `fullscreen`'s glyph sits in.
|
|
173
182
|
* @csspart gesture-hint - Words over the board for a moment when it lets a gesture pass to the page, such as how to zoom it.
|
|
174
183
|
* @csspart gesture-status - The line shown while a board with `gestures="activate"` has the gestures.
|
|
175
184
|
* @csspart header - The strip above the board.
|
|
@@ -181,13 +190,37 @@ declare const HelixHeadlessCanvas_base: (new (...args: any[]) => import("@fusion
|
|
|
181
190
|
* @csspart minimap-node - One card in the minimap.
|
|
182
191
|
* @csspart minimap-view - The frame in the minimap around what is on screen.
|
|
183
192
|
* @csspart pan-down - The button that moves the board down.
|
|
193
|
+
* @csspart pan-down-button - `pan-down`'s inner button.
|
|
194
|
+
* @csspart pan-down-live - `pan-down`'s live region, which speaks while it is pending.
|
|
195
|
+
* @csspart pan-down-spinner - The ring `pan-down` turns while it is pending.
|
|
196
|
+
* @csspart pan-down-text - The box `pan-down`'s glyph sits in.
|
|
184
197
|
* @csspart pan-end - The button that moves the board toward the end of a line of text: right in English.
|
|
198
|
+
* @csspart pan-end-button - `pan-end`'s inner button.
|
|
199
|
+
* @csspart pan-end-live - `pan-end`'s live region, which speaks while it is pending.
|
|
200
|
+
* @csspart pan-end-spinner - The ring `pan-end` turns while it is pending.
|
|
201
|
+
* @csspart pan-end-text - The box `pan-end`'s glyph sits in.
|
|
185
202
|
* @csspart pan-start - The button that moves the board toward the start of a line of text: left in English.
|
|
203
|
+
* @csspart pan-start-button - `pan-start`'s inner button.
|
|
204
|
+
* @csspart pan-start-live - `pan-start`'s live region, which speaks while it is pending.
|
|
205
|
+
* @csspart pan-start-spinner - The ring `pan-start` turns while it is pending.
|
|
206
|
+
* @csspart pan-start-text - The box `pan-start`'s glyph sits in.
|
|
186
207
|
* @csspart pan-up - The button that moves the board up.
|
|
208
|
+
* @csspart pan-up-button - `pan-up`'s inner button.
|
|
209
|
+
* @csspart pan-up-live - `pan-up`'s live region, which speaks while it is pending.
|
|
210
|
+
* @csspart pan-up-spinner - The ring `pan-up` turns while it is pending.
|
|
211
|
+
* @csspart pan-up-text - The box `pan-up`'s glyph sits in.
|
|
187
212
|
* @csspart region - The named region the board is drawn in.
|
|
188
213
|
* @csspart viewport - The box the board is drawn inside.
|
|
189
214
|
* @csspart zoom-in - The button that zooms in.
|
|
215
|
+
* @csspart zoom-in-button - `zoom-in`'s inner button.
|
|
216
|
+
* @csspart zoom-in-live - `zoom-in`'s live region, which speaks while it is pending.
|
|
217
|
+
* @csspart zoom-in-spinner - The ring `zoom-in` turns while it is pending.
|
|
218
|
+
* @csspart zoom-in-text - The box `zoom-in`'s glyph sits in.
|
|
190
219
|
* @csspart zoom-out - The button that zooms out.
|
|
220
|
+
* @csspart zoom-out-button - `zoom-out`'s inner button.
|
|
221
|
+
* @csspart zoom-out-live - `zoom-out`'s live region, which speaks while it is pending.
|
|
222
|
+
* @csspart zoom-out-spinner - The ring `zoom-out` turns while it is pending.
|
|
223
|
+
* @csspart zoom-out-text - The box `zoom-out`'s glyph sits in.
|
|
191
224
|
*
|
|
192
225
|
* @cssproperty --canvas-zoom - The board's zoom, which the board writes: 1 at the document's own size, 0.5 at half. The cards inherit it, so a card's stylesheet can draw less when the board is far out, such as a border that stays one pixel wide at `calc(1px / var(--canvas-zoom))`.
|
|
193
226
|
*
|
|
@@ -592,6 +625,11 @@ export declare class HelixHeadlessCanvas extends HelixHeadlessCanvas_base {
|
|
|
592
625
|
*/
|
|
593
626
|
private readonly sides;
|
|
594
627
|
private readEdges;
|
|
628
|
+
/**
|
|
629
|
+
* The board's controls, each an Icon Button: named here, where this family's
|
|
630
|
+
* imports register it, though the surface draws most of them.
|
|
631
|
+
*/
|
|
632
|
+
protected get controlTag(): StaticValue;
|
|
595
633
|
/** The events this family names for itself, the surface being shared. */
|
|
596
634
|
protected panEvent(detail: ViewportPanDetail): Event;
|
|
597
635
|
protected zoomEvent(detail: ViewportZoomDetail): Event;
|
|
@@ -2,6 +2,7 @@ import { __decorate } from "tslib";
|
|
|
2
2
|
import { assignSlots, auditName, capturePointer, customElement, formatPercent, formatWords, HelixBeforeMoveEvent, HelixBeforePasteEvent, HelixBeforeReconnectEvent, HelixBeforeRelabelEvent, HelixCanvasEditEvent, HelixCanvasPanEvent, HelixCanvasViewEvent, HelixCanvasZoomEvent, HelixConnectEvent, HelixElement, HelixMoveEvent, HelixPastedEvent, HelixReconnectEvent, HelixRelabelEvent, HelixRemoveEvent, HelixSelectEvent, hostAria, inlineStep, isRtl, MixinViewport, numberConverter, words, wordsConverter, wordsLocale, } from '@fusion.dev/helix-core';
|
|
3
3
|
import { html, nothing, svg } from 'lit';
|
|
4
4
|
import { property, state } from 'lit/decorators.js';
|
|
5
|
+
import '../../icon-button/index.js';
|
|
5
6
|
import { arrangement } from '../arrange.js';
|
|
6
7
|
import { descriptionOf } from '../describe.js';
|
|
7
8
|
import { HelixHeadlessCanvasEdge } from '../edge/canvas-edge.js';
|
|
@@ -887,6 +888,9 @@ let HelixHeadlessCanvas = class HelixHeadlessCanvas extends MixinViewport(HelixE
|
|
|
887
888
|
});
|
|
888
889
|
});
|
|
889
890
|
}
|
|
891
|
+
get controlTag() {
|
|
892
|
+
return this.tag('icon-button');
|
|
893
|
+
}
|
|
890
894
|
panEvent(detail) {
|
|
891
895
|
return new HelixCanvasPanEvent(detail);
|
|
892
896
|
}
|
|
@@ -1,5 +1,7 @@
|
|
|
1
|
-
import { type GraphSignalDetail, HelixElement,
|
|
1
|
+
import { type GraphSignalDetail, HelixElement, ToolbarController, type ViewportPanDetail, type ViewportZoomDetail } from '@fusion.dev/helix-core';
|
|
2
2
|
import { nothing, type PropertyValues, type TemplateResult } from 'lit';
|
|
3
|
+
import { type StaticValue } from 'lit/static-html.js';
|
|
4
|
+
import '../../icon-button/index.js';
|
|
3
5
|
import { type GraphLink, type GraphNode } from './graph-model.js';
|
|
4
6
|
declare const HelixHeadlessGraph_base: (new (...args: any[]) => import("@fusion.dev/helix-core").ViewportElement) & (new (...args: any[]) => import("@fusion.dev/helix-core").MixinControllerActiveInterface) & typeof HelixElement;
|
|
5
7
|
/**
|
|
@@ -43,7 +45,9 @@ declare const HelixHeadlessGraph_base: (new (...args: any[]) => import("@fusion.
|
|
|
43
45
|
* or hides its notes. `hiddenGroups` holds the groups turned off, and the
|
|
44
46
|
* list holds only what the drawing shows. The legend is a toolbar and one tab
|
|
45
47
|
* stop: the arrow keys, Home, End and a group's first letters move between
|
|
46
|
-
* its buttons, and Space or Enter presses one.
|
|
48
|
+
* its buttons, and Space or Enter presses one. The pan and zoom buttons are
|
|
49
|
+
* a toolbar and one tab stop too, the arrow keys moving between them by where
|
|
50
|
+
* they sit on screen.
|
|
47
51
|
*
|
|
48
52
|
* `nodes` and `links` are properties, never markup: a graph of ten thousand
|
|
49
53
|
* notes as ten thousand elements would cost what the renderer exists to save.
|
|
@@ -86,13 +90,17 @@ declare const HelixHeadlessGraph_base: (new (...args: any[]) => import("@fusion.
|
|
|
86
90
|
* @csspart after - The room the notes after those drawn would take, so the list scrolls its whole length.
|
|
87
91
|
* @csspart before - The room the notes before those drawn would take.
|
|
88
92
|
* @csspart body - The drawing beside the list, or above it where the frame is narrow.
|
|
89
|
-
* @csspart controls - The
|
|
93
|
+
* @csspart controls - The toolbar the pan and zoom buttons sit in, one tab stop.
|
|
90
94
|
* @csspart count - How many notes the list holds, which a search narrows, at the end of the search bar.
|
|
91
95
|
* @csspart empty - The box in place of the list when it holds no notes, holding the `empty` slot.
|
|
92
96
|
* @csspart filter-icon - The icon beside the search field.
|
|
93
97
|
* @csspart filter-mark - The default icon beside the search field, shown when none is slotted.
|
|
94
98
|
* @csspart footer - The strip below the graph.
|
|
95
99
|
* @csspart fullscreen - The button that makes the graph fill the screen.
|
|
100
|
+
* @csspart fullscreen-button - `fullscreen`'s inner button.
|
|
101
|
+
* @csspart fullscreen-live - `fullscreen`'s live region, which speaks while it is pending.
|
|
102
|
+
* @csspart fullscreen-spinner - The ring `fullscreen` turns while it is pending.
|
|
103
|
+
* @csspart fullscreen-text - The box `fullscreen`'s glyph sits in.
|
|
96
104
|
* @csspart gesture-hint - Words over the graph for a moment when it lets a gesture pass to the page, such as how to zoom it.
|
|
97
105
|
* @csspart gesture-status - The line shown while a graph with `gestures="activate"` has the gestures.
|
|
98
106
|
* @csspart header - The strip above the graph.
|
|
@@ -110,10 +118,30 @@ declare const HelixHeadlessGraph_base: (new (...args: any[]) => import("@fusion.
|
|
|
110
118
|
* @csspart note-relation - How a note stands to the selected one, such as "Linked from Alpha".
|
|
111
119
|
* @csspart note-selected - The selected note, first in the list.
|
|
112
120
|
* @csspart notes-toggle - The button among the controls that opens the search and the list over the drawing, with `no-panel`.
|
|
121
|
+
* @csspart notes-toggle-button - `notes-toggle`'s inner button.
|
|
122
|
+
* @csspart notes-toggle-live - `notes-toggle`'s live region, which speaks while it is pending.
|
|
123
|
+
* @csspart notes-toggle-spinner - The ring `notes-toggle` turns while it is pending.
|
|
124
|
+
* @csspart notes-toggle-text - The box `notes-toggle`'s glyph sits in.
|
|
113
125
|
* @csspart pan-down - The button that moves the graph down.
|
|
126
|
+
* @csspart pan-down-button - `pan-down`'s inner button.
|
|
127
|
+
* @csspart pan-down-live - `pan-down`'s live region, which speaks while it is pending.
|
|
128
|
+
* @csspart pan-down-spinner - The ring `pan-down` turns while it is pending.
|
|
129
|
+
* @csspart pan-down-text - The box `pan-down`'s glyph sits in.
|
|
114
130
|
* @csspart pan-end - The button that moves the graph toward the end of a line of text: right in English.
|
|
131
|
+
* @csspart pan-end-button - `pan-end`'s inner button.
|
|
132
|
+
* @csspart pan-end-live - `pan-end`'s live region, which speaks while it is pending.
|
|
133
|
+
* @csspart pan-end-spinner - The ring `pan-end` turns while it is pending.
|
|
134
|
+
* @csspart pan-end-text - The box `pan-end`'s glyph sits in.
|
|
115
135
|
* @csspart pan-start - The button that moves the graph toward the start of a line of text: left in English.
|
|
136
|
+
* @csspart pan-start-button - `pan-start`'s inner button.
|
|
137
|
+
* @csspart pan-start-live - `pan-start`'s live region, which speaks while it is pending.
|
|
138
|
+
* @csspart pan-start-spinner - The ring `pan-start` turns while it is pending.
|
|
139
|
+
* @csspart pan-start-text - The box `pan-start`'s glyph sits in.
|
|
116
140
|
* @csspart pan-up - The button that moves the graph up.
|
|
141
|
+
* @csspart pan-up-button - `pan-up`'s inner button.
|
|
142
|
+
* @csspart pan-up-live - `pan-up`'s live region, which speaks while it is pending.
|
|
143
|
+
* @csspart pan-up-spinner - The ring `pan-up` turns while it is pending.
|
|
144
|
+
* @csspart pan-up-text - The box `pan-up`'s glyph sits in.
|
|
117
145
|
* @csspart panel - The search field and the list, beside the drawing or below it, or over the drawing when opened with `no-panel`.
|
|
118
146
|
* @csspart region - The frame: the drawing, its controls and the list.
|
|
119
147
|
* @csspart search - The bar holding the icon, the search field and the count.
|
|
@@ -123,7 +151,15 @@ declare const HelixHeadlessGraph_base: (new (...args: any[]) => import("@fusion.
|
|
|
123
151
|
* @csspart stop-layout - The button that stops a layout that has run past five seconds, where the notes stand.
|
|
124
152
|
* @csspart viewport - The box the renderer draws in.
|
|
125
153
|
* @csspart zoom-in - The zoom in button.
|
|
154
|
+
* @csspart zoom-in-button - `zoom-in`'s inner button.
|
|
155
|
+
* @csspart zoom-in-live - `zoom-in`'s live region, which speaks while it is pending.
|
|
156
|
+
* @csspart zoom-in-spinner - The ring `zoom-in` turns while it is pending.
|
|
157
|
+
* @csspart zoom-in-text - The box `zoom-in`'s glyph sits in.
|
|
126
158
|
* @csspart zoom-out - The zoom out button.
|
|
159
|
+
* @csspart zoom-out-button - `zoom-out`'s inner button.
|
|
160
|
+
* @csspart zoom-out-live - `zoom-out`'s live region, which speaks while it is pending.
|
|
161
|
+
* @csspart zoom-out-spinner - The ring `zoom-out` turns while it is pending.
|
|
162
|
+
* @csspart zoom-out-text - The box `zoom-out`'s glyph sits in.
|
|
127
163
|
*
|
|
128
164
|
* @cssstate empty - The list holds no notes: the graph has none, or a search or the groups hid them all.
|
|
129
165
|
* @cssstate fullscreen - The graph fills the screen.
|
|
@@ -343,15 +379,14 @@ export declare class HelixHeadlessGraph extends HelixHeadlessGraph_base {
|
|
|
343
379
|
* and wrote `active` itself.
|
|
344
380
|
*/
|
|
345
381
|
private selectionAsked;
|
|
346
|
-
/** The legend's button that holds its one tab stop, by place: the one a reader was last on, or the first. */
|
|
347
|
-
private legendStop;
|
|
348
382
|
/**
|
|
349
|
-
* The arrow keys, Home, End and typed
|
|
350
|
-
* so a legend of twelve groups is one tab stop, as
|
|
351
|
-
* toolbar is. Only a press that starts on a legend
|
|
352
|
-
* own arrows pan the drawing, and the list's walk
|
|
383
|
+
* The legend's buttons as one tab stop: the arrow keys, Home, End and typed
|
|
384
|
+
* letters move among them, so a legend of twelve groups is one tab stop, as
|
|
385
|
+
* the `Legend` family's toolbar is. Only a press that starts on a legend
|
|
386
|
+
* button moves: the frame's own arrows pan the drawing, and the list's walk
|
|
387
|
+
* the notes. Both axes, the buttons wrapping onto more lines.
|
|
353
388
|
*/
|
|
354
|
-
protected readonly legendKeys:
|
|
389
|
+
protected readonly legendKeys: ToolbarController;
|
|
355
390
|
private readonly virtualize;
|
|
356
391
|
/**
|
|
357
392
|
* @internal The notes the drawing shows, which `connectGraph` reads: those
|
|
@@ -441,6 +476,11 @@ export declare class HelixHeadlessGraph extends HelixHeadlessGraph_base {
|
|
|
441
476
|
protected firstUpdated(changed: PropertyValues): void;
|
|
442
477
|
protected willUpdate(changed: PropertyValues): void;
|
|
443
478
|
protected updated(changed: PropertyValues): void;
|
|
479
|
+
/**
|
|
480
|
+
* The graph's controls, each an Icon Button: named here, where this family's
|
|
481
|
+
* imports register it, though the surface draws most of them.
|
|
482
|
+
*/
|
|
483
|
+
protected get controlTag(): StaticValue;
|
|
444
484
|
/** The pan request, and the side it goes to, which `moved()` then says. */
|
|
445
485
|
protected panEvent(detail: ViewportPanDetail): Event;
|
|
446
486
|
/** The zoom request, and which way it goes, which `moved()` then says. */
|
|
@@ -1,12 +1,15 @@
|
|
|
1
1
|
import { __decorate } from "tslib";
|
|
2
|
-
import { auditName, customElement,
|
|
2
|
+
import { auditName, customElement, formatWords, HelixElement, HelixGraphFilterEvent, HelixGraphLayoutEvent, HelixGraphPanEvent, HelixGraphPartChangeEvent, HelixGraphReadyEvent, HelixGraphSignalEvent, HelixGraphZoomEvent, isRtl, MixinControllerActive, MixinViewport, numberConverter, SCROLLER_RULE, scrollRoom, scrollWithin, ToolbarController, Typeahead, VIRTUAL_RULE, VirtualizeController, words, wordsLocale, } from '@fusion.dev/helix-core';
|
|
3
3
|
import { list, magnifyingGlass } from '@fusion.dev/helix-icons';
|
|
4
4
|
import { html, nothing } from 'lit';
|
|
5
5
|
import { property, state } from 'lit/decorators.js';
|
|
6
|
+
import { html as staticHtml } from 'lit/static-html.js';
|
|
7
|
+
import '../../icon-button/index.js';
|
|
6
8
|
import { repeat } from 'lit/directives/repeat.js';
|
|
7
9
|
import { unsafeSVG } from 'lit/directives/unsafe-svg.js';
|
|
8
10
|
import { adjacencyOf, cursorAfter, entriesOf, groupsOf, nameOf, sortedOf, within, withoutGroups, } from './graph-model.js';
|
|
9
11
|
const LONG_LAYOUT = 5000;
|
|
12
|
+
const stopPress = (event) => event.stopPropagation();
|
|
10
13
|
let HelixHeadlessGraph = class HelixHeadlessGraph extends MixinViewport(MixinControllerActive(HelixElement)) {
|
|
11
14
|
constructor() {
|
|
12
15
|
super(...arguments);
|
|
@@ -59,14 +62,12 @@ let HelixHeadlessGraph = class HelixHeadlessGraph extends MixinViewport(MixinCon
|
|
|
59
62
|
this.whole = false;
|
|
60
63
|
this.said = '';
|
|
61
64
|
this.countAsked = false;
|
|
62
|
-
this.
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
selects: () => false,
|
|
69
|
-
typeahead: typeaheadBy((item) => item.words ?? ''),
|
|
65
|
+
this.legendKeys = new ToolbarController(this, {
|
|
66
|
+
arrows: () => 'both',
|
|
67
|
+
members: () => [...(this.partNamed('legend')?.children ?? [])],
|
|
68
|
+
own: true,
|
|
69
|
+
watch: () => this.renderRoot,
|
|
70
|
+
words: (button) => button.textContent?.trim() ?? '',
|
|
70
71
|
});
|
|
71
72
|
this.virtualize = new VirtualizeController(this, {
|
|
72
73
|
container: () => this.partNamed('list'),
|
|
@@ -326,6 +327,9 @@ let HelixHeadlessGraph = class HelixHeadlessGraph extends MixinViewport(MixinCon
|
|
|
326
327
|
this.dispatchEvent(new HelixGraphPartChangeEvent({ kind: 'focus' }));
|
|
327
328
|
}
|
|
328
329
|
}
|
|
330
|
+
get controlTag() {
|
|
331
|
+
return this.tag('icon-button');
|
|
332
|
+
}
|
|
329
333
|
panEvent(detail) {
|
|
330
334
|
this.asked = this.sideOf(detail.to);
|
|
331
335
|
return new HelixGraphPanEvent(detail);
|
|
@@ -373,20 +377,15 @@ let HelixHeadlessGraph = class HelixHeadlessGraph extends MixinViewport(MixinCon
|
|
|
373
377
|
return nothing;
|
|
374
378
|
}
|
|
375
379
|
const hidden = new Set(this.hiddenGroups);
|
|
376
|
-
const stop = Math.min(this.legendStop, this.groups.length - 1);
|
|
377
380
|
return html `<div part="legend" role="toolbar" aria-label=${this.legendLabel}>
|
|
378
|
-
${this.groups.map(({ name, tone }
|
|
381
|
+
${this.groups.map(({ name, tone }) => {
|
|
379
382
|
const shown = !hidden.has(name);
|
|
380
383
|
return html `<button
|
|
381
384
|
part="legend-item${shown ? '' : ' legend-item-hidden'}"
|
|
382
385
|
type="button"
|
|
383
|
-
tabindex=${index === stop ? '0' : '-1'}
|
|
384
386
|
aria-pressed=${shown ? 'true' : 'false'}
|
|
385
387
|
data-tone=${tone ?? nothing}
|
|
386
388
|
@click=${() => this.toggleGroup(name)}
|
|
387
|
-
@focus=${() => {
|
|
388
|
-
this.legendStop = index;
|
|
389
|
-
}}
|
|
390
389
|
>
|
|
391
390
|
<span part="legend-swatch" aria-hidden="true"></span>${name}
|
|
392
391
|
</button>`;
|
|
@@ -560,18 +559,23 @@ let HelixHeadlessGraph = class HelixHeadlessGraph extends MixinViewport(MixinCon
|
|
|
560
559
|
if (!this.noPanel) {
|
|
561
560
|
return nothing;
|
|
562
561
|
}
|
|
563
|
-
|
|
562
|
+
const button = this.controlTag;
|
|
563
|
+
const { material, raised } = this.controlAxes;
|
|
564
|
+
return staticHtml `<${button}
|
|
564
565
|
part="notes-toggle"
|
|
566
|
+
exportparts="button: notes-toggle-button, live: notes-toggle-live, spinner: notes-toggle-spinner, text: notes-toggle-text"
|
|
565
567
|
aria-controls="panel"
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
568
|
+
.expanded=${this.panelOpen}
|
|
569
|
+
label=${this.notesLabel}
|
|
570
|
+
material=${material ?? nothing}
|
|
571
|
+
?raised=${raised}
|
|
569
572
|
@click=${() => this.togglePanel()}
|
|
573
|
+
@helix-press=${stopPress}
|
|
570
574
|
>
|
|
571
575
|
<svg aria-hidden="true" fill="currentColor" viewBox=${list.viewBox}>
|
|
572
576
|
${unsafeSVG(list.content)}
|
|
573
577
|
</svg>
|
|
574
|
-
|
|
578
|
+
</${button}>`;
|
|
575
579
|
}
|
|
576
580
|
renderFilterIcon() {
|
|
577
581
|
return html `<slot name="filter-icon">
|
|
@@ -882,9 +886,6 @@ __decorate([
|
|
|
882
886
|
__decorate([
|
|
883
887
|
state()
|
|
884
888
|
], HelixHeadlessGraph.prototype, "said", void 0);
|
|
885
|
-
__decorate([
|
|
886
|
-
state()
|
|
887
|
-
], HelixHeadlessGraph.prototype, "legendStop", void 0);
|
|
888
889
|
HelixHeadlessGraph = __decorate([
|
|
889
890
|
customElement('helix-headless-graph')
|
|
890
891
|
], HelixHeadlessGraph);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { HelixElement,
|
|
1
|
+
import { HelixElement, SourceController, ToolbarController } from '@fusion.dev/helix-core';
|
|
2
2
|
import { nothing, type PropertyValues, type TemplateResult } from 'lit';
|
|
3
3
|
/**
|
|
4
4
|
* @summary A list of the series in a chart, each name beside the color it is drawn in.
|
|
@@ -108,17 +108,12 @@ export declare class HelixHeadlessLegend extends HelixElement {
|
|
|
108
108
|
toggles: boolean;
|
|
109
109
|
protected readonly source: SourceController;
|
|
110
110
|
/**
|
|
111
|
-
* The
|
|
112
|
-
*
|
|
111
|
+
* The toggles as one tab stop: the arrow keys, Home, End and typed letters
|
|
112
|
+
* move among them, so a legend of twelve series is one tab stop, as a
|
|
113
|
+
* toolbar of toggle buttons is. Both axes, the entries wrapping onto more
|
|
114
|
+
* lines. Nothing without `toggles`, where there is nothing to press.
|
|
113
115
|
*/
|
|
114
|
-
|
|
115
|
-
/**
|
|
116
|
-
* The arrow keys, Home, End and typed letters among the toggles, so a
|
|
117
|
-
* legend of twelve series is one tab stop, as a toolbar of
|
|
118
|
-
* toggle buttons is. Nothing without `toggles`, where there is nothing to
|
|
119
|
-
* press.
|
|
120
|
-
*/
|
|
121
|
-
protected readonly keys: KeyboardNavigationController;
|
|
116
|
+
protected readonly keys: ToolbarController;
|
|
122
117
|
/** The table this legend last wrote its `hidden-series` to, so leaving undoes it. */
|
|
123
118
|
private wroteTo;
|
|
124
119
|
/** Whether this update writes `hidden-series` to the table, decided before the render. */
|
|
@@ -198,11 +193,10 @@ export declare class HelixHeadlessLegend extends HelixElement {
|
|
|
198
193
|
* The button around a name under `toggles`, behind a seam a tier can move.
|
|
199
194
|
*
|
|
200
195
|
* Pressed while its series is shown, which is the state a reader changes by
|
|
201
|
-
* pressing it: a toggle button says whether its thing is on.
|
|
202
|
-
*
|
|
203
|
-
* the toggle at `index`.
|
|
196
|
+
* pressing it: a toggle button says whether its thing is on. Which toggle
|
|
197
|
+
* holds the one tab stop is `keys`'s to say, so the button names none.
|
|
204
198
|
*/
|
|
205
|
-
protected renderToggle(name: string, off: boolean, index?: number
|
|
199
|
+
protected renderToggle(name: string, off: boolean, index?: number): TemplateResult;
|
|
206
200
|
}
|
|
207
201
|
declare global {
|
|
208
202
|
interface HTMLElementTagNameMap {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { __decorate } from "tslib";
|
|
2
|
-
import { customElement,
|
|
2
|
+
import { customElement, HelixElement, requestValue, SourceController, seriesIndex, seriesKey, ToolbarController, } from '@fusion.dev/helix-core';
|
|
3
3
|
import { html, nothing } from 'lit';
|
|
4
|
-
import { property
|
|
4
|
+
import { property } from 'lit/decorators.js';
|
|
5
5
|
import { isHidden, namesIn, toggledNames } from '../hidden-series.js';
|
|
6
6
|
let HelixHeadlessLegend = class HelixHeadlessLegend extends HelixElement {
|
|
7
7
|
constructor() {
|
|
@@ -11,14 +11,12 @@ let HelixHeadlessLegend = class HelixHeadlessLegend extends HelixElement {
|
|
|
11
11
|
this.label = '';
|
|
12
12
|
this.toggles = false;
|
|
13
13
|
this.source = new SourceController(this);
|
|
14
|
-
this.
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
selects: () => false,
|
|
21
|
-
typeahead: typeaheadBy((item) => item.words ?? ''),
|
|
14
|
+
this.keys = new ToolbarController(this, {
|
|
15
|
+
arrows: () => 'both',
|
|
16
|
+
members: () => (this.toggles ? [...(this.partNamed('list')?.children ?? [])] : []),
|
|
17
|
+
own: true,
|
|
18
|
+
watch: () => this.renderRoot,
|
|
19
|
+
words: (button) => button.textContent?.trim() ?? '',
|
|
22
20
|
});
|
|
23
21
|
this.wroteTo = null;
|
|
24
22
|
this.writes = false;
|
|
@@ -75,7 +73,6 @@ let HelixHeadlessLegend = class HelixHeadlessLegend extends HelixElement {
|
|
|
75
73
|
render() {
|
|
76
74
|
const named = this.label || this.source.element?.querySelector('caption')?.textContent?.trim();
|
|
77
75
|
const names = this.names();
|
|
78
|
-
const stop = Math.min(this.stop, names.length - 1);
|
|
79
76
|
const toolbar = this.toggles;
|
|
80
77
|
return html `<ul
|
|
81
78
|
aria-label=${named || nothing}
|
|
@@ -90,7 +87,7 @@ let HelixHeadlessLegend = class HelixHeadlessLegend extends HelixElement {
|
|
|
90
87
|
style="--chart-series: var(--chart-series-${seriesIndex(index)})"
|
|
91
88
|
role=${toolbar ? 'none' : 'listitem'}
|
|
92
89
|
>
|
|
93
|
-
${this.renderSwatch(name, index)}${toolbar ? this.renderToggle(name, off, index
|
|
90
|
+
${this.renderSwatch(name, index)}${toolbar ? this.renderToggle(name, off, index) : this.renderName(name, index)}
|
|
94
91
|
</li>`;
|
|
95
92
|
})}
|
|
96
93
|
</ul>`;
|
|
@@ -101,16 +98,12 @@ let HelixHeadlessLegend = class HelixHeadlessLegend extends HelixElement {
|
|
|
101
98
|
renderName(name, _index) {
|
|
102
99
|
return html `<span part="name">${name}</span>`;
|
|
103
100
|
}
|
|
104
|
-
renderToggle(name, off, index = 0
|
|
101
|
+
renderToggle(name, off, index = 0) {
|
|
105
102
|
return html `<button
|
|
106
103
|
aria-pressed=${off ? 'false' : 'true'}
|
|
107
104
|
part="toggle"
|
|
108
|
-
tabindex=${holds ? '0' : '-1'}
|
|
109
105
|
type="button"
|
|
110
106
|
@click=${() => this.toggle(name)}
|
|
111
|
-
@focus=${() => {
|
|
112
|
-
this.stop = index;
|
|
113
|
-
}}
|
|
114
107
|
>
|
|
115
108
|
${this.renderName(name, index)}
|
|
116
109
|
</button>`;
|
|
@@ -131,9 +124,6 @@ __decorate([
|
|
|
131
124
|
__decorate([
|
|
132
125
|
property({ reflect: true, type: Boolean })
|
|
133
126
|
], HelixHeadlessLegend.prototype, "toggles", void 0);
|
|
134
|
-
__decorate([
|
|
135
|
-
state()
|
|
136
|
-
], HelixHeadlessLegend.prototype, "stop", void 0);
|
|
137
127
|
HelixHeadlessLegend = __decorate([
|
|
138
128
|
customElement('helix-headless-legend')
|
|
139
129
|
], HelixHeadlessLegend);
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import { HelixElement, KeyboardNavigationController, type ViewportControlsPlacement, type ViewportPanDetail, type ViewportZoomDetail } from '@fusion.dev/helix-core';
|
|
2
2
|
import { nothing, type PropertyValues, type TemplateResult } from 'lit';
|
|
3
|
+
import { type StaticValue } from 'lit/static-html.js';
|
|
4
|
+
import '../../icon-button/index.js';
|
|
3
5
|
/**
|
|
4
6
|
* What `ViewportControlsPlacement` is called for a map.
|
|
5
7
|
*
|
|
@@ -27,7 +29,9 @@ declare const HelixHeadlessMap_base: (new (...args: any[]) => import("@fusion.de
|
|
|
27
29
|
* map. Dragging is otherwise the only way a pointer moves the map, so add them
|
|
28
30
|
* where the map has to be usable without dragging, as WCAG 2.2 asks at level
|
|
29
31
|
* AA. The arrow keys pan the map and Shift with Left or Right turns it either
|
|
30
|
-
* way.
|
|
32
|
+
* way. The buttons are a toolbar and one tab stop: on them, the arrow keys
|
|
33
|
+
* move between the buttons by where they sit, and Shift with an arrow still
|
|
34
|
+
* turns or tilts the map.
|
|
31
35
|
*
|
|
32
36
|
* The pan and zoom buttons and the arrow keys send `helix-map-pan` and
|
|
33
37
|
* `helix-map-zoom`. Move your map in response, or connect it with
|
|
@@ -98,10 +102,18 @@ declare const HelixHeadlessMap_base: (new (...args: any[]) => import("@fusion.de
|
|
|
98
102
|
*
|
|
99
103
|
* @csspart attribution - The strip under the map that holds the credit.
|
|
100
104
|
* @csspart compass - The compass and the pan and rotate buttons around it.
|
|
101
|
-
* @csspart controls - The column of buttons that move the map.
|
|
105
|
+
* @csspart controls - The column of buttons that move the map, a toolbar and one tab stop.
|
|
102
106
|
* @csspart face-north - The compass: its needle points north as the map turns, and pressing it turns the map to face north.
|
|
107
|
+
* @csspart face-north-button - `face-north`'s inner button.
|
|
108
|
+
* @csspart face-north-live - `face-north`'s live region, which speaks while it is pending.
|
|
109
|
+
* @csspart face-north-spinner - The ring `face-north` turns while it is pending.
|
|
110
|
+
* @csspart face-north-text - The box `face-north`'s glyph sits in.
|
|
103
111
|
* @csspart footer - The strip below the map.
|
|
104
112
|
* @csspart fullscreen - The button that makes the map fill the screen.
|
|
113
|
+
* @csspart fullscreen-button - `fullscreen`'s inner button.
|
|
114
|
+
* @csspart fullscreen-live - `fullscreen`'s live region, which speaks while it is pending.
|
|
115
|
+
* @csspart fullscreen-spinner - The ring `fullscreen` turns while it is pending.
|
|
116
|
+
* @csspart fullscreen-text - The box `fullscreen`'s glyph sits in.
|
|
105
117
|
* @csspart gesture-hint - Words over the map for a moment when it lets a gesture pass to the page, such as how to zoom it.
|
|
106
118
|
* @csspart gesture-status - The line shown while a map with `gestures="activate"` has the gestures.
|
|
107
119
|
* @csspart header - The strip above the map.
|
|
@@ -113,6 +125,10 @@ declare const HelixHeadlessMap_base: (new (...args: any[]) => import("@fusion.de
|
|
|
113
125
|
* @csspart layers - The list of the map's shown layers, such as routes, areas, and points, read by screen readers.
|
|
114
126
|
* @csspart layers-menu - The menu of the map's layers, which the layers button opens.
|
|
115
127
|
* @csspart layers-toggle - The button that opens and closes the layers menu.
|
|
128
|
+
* @csspart layers-toggle-button - `layers-toggle`'s inner button.
|
|
129
|
+
* @csspart layers-toggle-live - `layers-toggle`'s live region, which speaks while it is pending.
|
|
130
|
+
* @csspart layers-toggle-spinner - The ring `layers-toggle` turns while it is pending.
|
|
131
|
+
* @csspart layers-toggle-text - The box `layers-toggle`'s glyph sits in.
|
|
116
132
|
* @csspart live - What screen readers hear after the map moves: the zoom level, the way it faces, its tilt, or the way it moved. Visually hidden in the styled tier.
|
|
117
133
|
* @csspart map-type - One map type's card in the layers menu: a radio button, its picture, and its name.
|
|
118
134
|
* @csspart map-type-name - The name on a map type's card.
|
|
@@ -120,16 +136,52 @@ declare const HelixHeadlessMap_base: (new (...args: any[]) => import("@fusion.de
|
|
|
120
136
|
* @csspart map-types - The map-type cards at the top of the layers menu, where the map has imagery.
|
|
121
137
|
* @csspart needle - The compass needle, turned to point north.
|
|
122
138
|
* @csspart pan-down - The button that pans the map down.
|
|
139
|
+
* @csspart pan-down-button - `pan-down`'s inner button.
|
|
140
|
+
* @csspart pan-down-live - `pan-down`'s live region, which speaks while it is pending.
|
|
141
|
+
* @csspart pan-down-spinner - The ring `pan-down` turns while it is pending.
|
|
142
|
+
* @csspart pan-down-text - The box `pan-down`'s glyph sits in.
|
|
123
143
|
* @csspart pan-end - The button that pans toward the end of a line of text: right in English.
|
|
144
|
+
* @csspart pan-end-button - `pan-end`'s inner button.
|
|
145
|
+
* @csspart pan-end-live - `pan-end`'s live region, which speaks while it is pending.
|
|
146
|
+
* @csspart pan-end-spinner - The ring `pan-end` turns while it is pending.
|
|
147
|
+
* @csspart pan-end-text - The box `pan-end`'s glyph sits in.
|
|
124
148
|
* @csspart pan-start - The button that pans toward the start of a line of text: left in English.
|
|
149
|
+
* @csspart pan-start-button - `pan-start`'s inner button.
|
|
150
|
+
* @csspart pan-start-live - `pan-start`'s live region, which speaks while it is pending.
|
|
151
|
+
* @csspart pan-start-spinner - The ring `pan-start` turns while it is pending.
|
|
152
|
+
* @csspart pan-start-text - The box `pan-start`'s glyph sits in.
|
|
125
153
|
* @csspart pan-up - The button that pans the map up.
|
|
154
|
+
* @csspart pan-up-button - `pan-up`'s inner button.
|
|
155
|
+
* @csspart pan-up-live - `pan-up`'s live region, which speaks while it is pending.
|
|
156
|
+
* @csspart pan-up-spinner - The ring `pan-up` turns while it is pending.
|
|
157
|
+
* @csspart pan-up-text - The box `pan-up`'s glyph sits in.
|
|
126
158
|
* @csspart region - The named region the map sits in.
|
|
127
159
|
* @csspart rotate-left - The button that turns the map counterclockwise.
|
|
160
|
+
* @csspart rotate-left-button - `rotate-left`'s inner button.
|
|
161
|
+
* @csspart rotate-left-live - `rotate-left`'s live region, which speaks while it is pending.
|
|
162
|
+
* @csspart rotate-left-spinner - The ring `rotate-left` turns while it is pending.
|
|
163
|
+
* @csspart rotate-left-text - The box `rotate-left`'s glyph sits in.
|
|
128
164
|
* @csspart rotate-right - The button that turns the map clockwise.
|
|
165
|
+
* @csspart rotate-right-button - `rotate-right`'s inner button.
|
|
166
|
+
* @csspart rotate-right-live - `rotate-right`'s live region, which speaks while it is pending.
|
|
167
|
+
* @csspart rotate-right-spinner - The ring `rotate-right` turns while it is pending.
|
|
168
|
+
* @csspart rotate-right-text - The box `rotate-right`'s glyph sits in.
|
|
129
169
|
* @csspart tilt - The 3D button, which tilts the map and makes it flat again. Pressed while the map is tilted.
|
|
170
|
+
* @csspart tilt-button - `tilt`'s inner button.
|
|
171
|
+
* @csspart tilt-live - `tilt`'s live region, which speaks while it is pending.
|
|
172
|
+
* @csspart tilt-spinner - The ring `tilt` turns while it is pending.
|
|
173
|
+
* @csspart tilt-text - The box `tilt`'s glyph sits in.
|
|
130
174
|
* @csspart viewport - The box the map is drawn in.
|
|
131
175
|
* @csspart zoom-in - The button that zooms in.
|
|
176
|
+
* @csspart zoom-in-button - `zoom-in`'s inner button.
|
|
177
|
+
* @csspart zoom-in-live - `zoom-in`'s live region, which speaks while it is pending.
|
|
178
|
+
* @csspart zoom-in-spinner - The ring `zoom-in` turns while it is pending.
|
|
179
|
+
* @csspart zoom-in-text - The box `zoom-in`'s glyph sits in.
|
|
132
180
|
* @csspart zoom-out - The button that zooms out.
|
|
181
|
+
* @csspart zoom-out-button - `zoom-out`'s inner button.
|
|
182
|
+
* @csspart zoom-out-live - `zoom-out`'s live region, which speaks while it is pending.
|
|
183
|
+
* @csspart zoom-out-spinner - The ring `zoom-out` turns while it is pending.
|
|
184
|
+
* @csspart zoom-out-text - The box `zoom-out`'s glyph sits in.
|
|
133
185
|
*
|
|
134
186
|
* @cssproperty --map-needle-turn - How far the needle turns to point north, as an angle. The frame writes it from `bearing`.
|
|
135
187
|
*
|
|
@@ -493,6 +545,11 @@ export declare class HelixHeadlessMap extends HelixHeadlessMap_base {
|
|
|
493
545
|
private get keyShortcuts();
|
|
494
546
|
/** Shift with the arrow keys: left and right rotate, and up and down tilt in steps. */
|
|
495
547
|
protected handleMoreKeys(event: KeyboardEvent): boolean;
|
|
548
|
+
/**
|
|
549
|
+
* The map's controls, each an Icon Button: named here, where this family's
|
|
550
|
+
* imports register it, though the surface draws most of them.
|
|
551
|
+
*/
|
|
552
|
+
protected get controlTag(): StaticValue;
|
|
496
553
|
/** The events this family names, the surface naming none of its own. */
|
|
497
554
|
protected panEvent(detail: ViewportPanDetail): Event;
|
|
498
555
|
protected zoomEvent(detail: ViewportZoomDetail): Event;
|