@kerusiweb/core 3.0.0 → 3.1.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/README.md +6 -2
- package/dist/view/index.d.ts +6 -2
- package/dist/view/index.d.ts.map +1 -1
- package/dist/view/index.js +6 -2
- package/dist/view/index.js.map +1 -1
- package/dist/view/seat-card-placement.d.ts +60 -0
- package/dist/view/seat-card-placement.d.ts.map +1 -0
- package/dist/view/seat-card-placement.js +94 -0
- package/dist/view/seat-card-placement.js.map +1 -0
- package/dist/view/seat-card.d.ts +83 -0
- package/dist/view/seat-card.d.ts.map +1 -0
- package/dist/view/seat-card.js +68 -0
- package/dist/view/seat-card.js.map +1 -0
- package/dist/view/seat-hover.d.ts +90 -0
- package/dist/view/seat-hover.d.ts.map +1 -0
- package/dist/view/seat-hover.js +205 -0
- package/dist/view/seat-hover.js.map +1 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -48,8 +48,12 @@ const d = seatBodyPath(x, y, width, height); // → 'M4 8 …', ready for <path
|
|
|
48
48
|
|
|
49
49
|
**`view/`: presentation policy, still framework-free.** The colour system
|
|
50
50
|
(`DEFAULT_KERUSI_COLORS`, `seatFill`, `readableOn`), the ARIA strings
|
|
51
|
-
(`seatAriaLabel`, `disallowedAnnouncement`),
|
|
52
|
-
(`toggleSeatSelection`, `summarizeSelection`, `DisallowedReason`)
|
|
51
|
+
(`seatAriaLabel`, `disallowedAnnouncement`), the selection rules
|
|
52
|
+
(`toggleSeatSelection`, `summarizeSelection`, `DisallowedReason`), and the rules
|
|
53
|
+
behind seat hover and seat cards: `reduceSeatHover()` (the pointer-type filter,
|
|
54
|
+
the pause during a pan or zoom, the open and close delays) and `placeSeatCard()`
|
|
55
|
+
(side, position and arrow offset, with flip and clamp), both pure, plus the
|
|
56
|
+
`SeatClick` and `KerusiSeatCardContext` types.
|
|
53
57
|
|
|
54
58
|
## Server-side use
|
|
55
59
|
|
package/dist/view/index.d.ts
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Presentation policy that is still framework-free: the colour system a
|
|
3
3
|
* renderer resolves seat fills from, the ARIA strings it announces, the
|
|
4
|
-
* selection rules that decide whether a seat may be toggled,
|
|
5
|
-
*
|
|
4
|
+
* selection rules that decide whether a seat may be toggled, the zoom, pan and
|
|
5
|
+
* gesture arithmetic behind a zoomable map, and the hover rules and card
|
|
6
|
+
* placement behind seat events and seat cards.
|
|
6
7
|
*
|
|
7
8
|
* A binding turns these into markup; none of them know how.
|
|
8
9
|
*/
|
|
@@ -12,6 +13,9 @@ export * from './kerusi-seatmap-colors.js';
|
|
|
12
13
|
export * from './rtl.js';
|
|
13
14
|
export * from './seat-glyph.js';
|
|
14
15
|
export * from './seat-aria.js';
|
|
16
|
+
export * from './seat-card.js';
|
|
17
|
+
export * from './seat-card-placement.js';
|
|
18
|
+
export * from './seat-hover.js';
|
|
15
19
|
export * from './selection.js';
|
|
16
20
|
export * from './viewport.js';
|
|
17
21
|
export * from './viewport-gesture.js';
|
package/dist/view/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/view/index.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/view/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,cAAc,sBAAsB,CAAC;AACrC,cAAc,wBAAwB,CAAC;AACvC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,UAAU,CAAC;AACzB,cAAc,iBAAiB,CAAC;AAChC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,0BAA0B,CAAC;AACzC,cAAc,iBAAiB,CAAC;AAChC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,eAAe,CAAC;AAC9B,cAAc,uBAAuB,CAAC"}
|
package/dist/view/index.js
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Presentation policy that is still framework-free: the colour system a
|
|
3
3
|
* renderer resolves seat fills from, the ARIA strings it announces, the
|
|
4
|
-
* selection rules that decide whether a seat may be toggled,
|
|
5
|
-
*
|
|
4
|
+
* selection rules that decide whether a seat may be toggled, the zoom, pan and
|
|
5
|
+
* gesture arithmetic behind a zoomable map, and the hover rules and card
|
|
6
|
+
* placement behind seat events and seat cards.
|
|
6
7
|
*
|
|
7
8
|
* A binding turns these into markup; none of them know how.
|
|
8
9
|
*/
|
|
@@ -12,6 +13,9 @@ export * from './kerusi-seatmap-colors.js';
|
|
|
12
13
|
export * from './rtl.js';
|
|
13
14
|
export * from './seat-glyph.js';
|
|
14
15
|
export * from './seat-aria.js';
|
|
16
|
+
export * from './seat-card.js';
|
|
17
|
+
export * from './seat-card-placement.js';
|
|
18
|
+
export * from './seat-hover.js';
|
|
15
19
|
export * from './selection.js';
|
|
16
20
|
export * from './viewport.js';
|
|
17
21
|
export * from './viewport-gesture.js';
|
package/dist/view/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/view/index.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/view/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,cAAc,sBAAsB,CAAC;AACrC,cAAc,wBAAwB,CAAC;AACvC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,UAAU,CAAC;AACzB,cAAc,iBAAiB,CAAC;AAChC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,0BAA0B,CAAC;AACzC,cAAc,iBAAiB,CAAC;AAChC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,eAAe,CAAC;AAC9B,cAAc,uBAAuB,CAAC"}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import type { SeatCardPlacement, SeatCardSide } from './seat-card.js';
|
|
2
|
+
/**
|
|
3
|
+
* Where a seat card goes: the arithmetic only.
|
|
4
|
+
*
|
|
5
|
+
* A binding measures three boxes in CSS pixels, all in the same coordinate
|
|
6
|
+
* space (the map root's, in practice), and hands them in. Because the seat's box
|
|
7
|
+
* is its on-screen one, zoom, pan and rotation are already in it: a rotated
|
|
8
|
+
* seat is its bounding box, a zoomed one is as large as it is drawn.
|
|
9
|
+
*/
|
|
10
|
+
export interface CardRect {
|
|
11
|
+
x: number;
|
|
12
|
+
y: number;
|
|
13
|
+
width: number;
|
|
14
|
+
height: number;
|
|
15
|
+
}
|
|
16
|
+
export interface CardSize {
|
|
17
|
+
width: number;
|
|
18
|
+
height: number;
|
|
19
|
+
}
|
|
20
|
+
export interface SeatCardPlacementInput {
|
|
21
|
+
/** The seat's on-screen box. */
|
|
22
|
+
seat: CardRect;
|
|
23
|
+
/** The card's own size, borders included. */
|
|
24
|
+
card: CardSize;
|
|
25
|
+
/** The box the card must stay inside: the map's root. */
|
|
26
|
+
container: CardRect;
|
|
27
|
+
/** The side to try first. Default `top`. */
|
|
28
|
+
placement?: SeatCardPlacement;
|
|
29
|
+
/** Space left between the seat and the card, for the arrow. Default `8`. */
|
|
30
|
+
offset?: number;
|
|
31
|
+
/**
|
|
32
|
+
* How far in from a card's corner the arrow keeps, so it never sits on the
|
|
33
|
+
* rounded part. Default `12`.
|
|
34
|
+
*/
|
|
35
|
+
arrowInset?: number;
|
|
36
|
+
}
|
|
37
|
+
export interface SeatCardPosition {
|
|
38
|
+
/** The side of the seat the card ended up on, after any flip. */
|
|
39
|
+
side: SeatCardSide;
|
|
40
|
+
/** The card's top-left corner, in the same space as the inputs. */
|
|
41
|
+
x: number;
|
|
42
|
+
y: number;
|
|
43
|
+
/**
|
|
44
|
+
* Where the arrow sits along the card's edge that faces the seat: measured
|
|
45
|
+
* from the card's left edge for `top` and `bottom`, from its top edge for
|
|
46
|
+
* `left` and `right`. Points at the seat's centre, kept off the corners.
|
|
47
|
+
*/
|
|
48
|
+
arrowOffset: number;
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* Places a card against a seat.
|
|
52
|
+
*
|
|
53
|
+
* The card sits on the preferred side. If it would not fit there but would fit
|
|
54
|
+
* on the opposite side, it flips. `auto` takes the side with the most room.
|
|
55
|
+
* Either way the card is then clamped inside the container along the other
|
|
56
|
+
* axis, and, when no side fits at all, along both. A card larger than the
|
|
57
|
+
* container is pinned to its top-left.
|
|
58
|
+
*/
|
|
59
|
+
export declare function placeSeatCard(input: SeatCardPlacementInput): SeatCardPosition;
|
|
60
|
+
//# sourceMappingURL=seat-card-placement.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"seat-card-placement.d.ts","sourceRoot":"","sources":["../../src/view/seat-card-placement.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAEtE;;;;;;;GAOG;AAEH,MAAM,WAAW,QAAQ;IACvB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,QAAQ;IACvB,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,sBAAsB;IACrC,gCAAgC;IAChC,IAAI,EAAE,QAAQ,CAAC;IACf,6CAA6C;IAC7C,IAAI,EAAE,QAAQ,CAAC;IACf,yDAAyD;IACzD,SAAS,EAAE,QAAQ,CAAC;IACpB,4CAA4C;IAC5C,SAAS,CAAC,EAAE,iBAAiB,CAAC;IAC9B,4EAA4E;IAC5E,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB;;;OAGG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED,MAAM,WAAW,gBAAgB;IAC/B,iEAAiE;IACjE,IAAI,EAAE,YAAY,CAAC;IACnB,mEAAmE;IACnE,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV;;;;OAIG;IACH,WAAW,EAAE,MAAM,CAAC;CACrB;AAYD;;;;;;;;GAQG;AACH,wBAAgB,aAAa,CAAC,KAAK,EAAE,sBAAsB,GAAG,gBAAgB,CAuC7E"}
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
const OPPOSITE = {
|
|
2
|
+
top: 'bottom',
|
|
3
|
+
bottom: 'top',
|
|
4
|
+
left: 'right',
|
|
5
|
+
right: 'left',
|
|
6
|
+
};
|
|
7
|
+
/** What `auto` tries, in order, when sides tie. */
|
|
8
|
+
const AUTO_ORDER = ['top', 'bottom', 'right', 'left'];
|
|
9
|
+
/**
|
|
10
|
+
* Places a card against a seat.
|
|
11
|
+
*
|
|
12
|
+
* The card sits on the preferred side. If it would not fit there but would fit
|
|
13
|
+
* on the opposite side, it flips. `auto` takes the side with the most room.
|
|
14
|
+
* Either way the card is then clamped inside the container along the other
|
|
15
|
+
* axis, and, when no side fits at all, along both. A card larger than the
|
|
16
|
+
* container is pinned to its top-left.
|
|
17
|
+
*/
|
|
18
|
+
export function placeSeatCard(input) {
|
|
19
|
+
const { seat, card, container } = input;
|
|
20
|
+
const offset = input.offset ?? 8;
|
|
21
|
+
const inset = input.arrowInset ?? 12;
|
|
22
|
+
const preferred = input.placement ?? 'top';
|
|
23
|
+
const side = chooseSide(preferred, input, offset);
|
|
24
|
+
const cx = seat.x + seat.width / 2;
|
|
25
|
+
const cy = seat.y + seat.height / 2;
|
|
26
|
+
let x;
|
|
27
|
+
let y;
|
|
28
|
+
switch (side) {
|
|
29
|
+
case 'top':
|
|
30
|
+
x = cx - card.width / 2;
|
|
31
|
+
y = seat.y - offset - card.height;
|
|
32
|
+
break;
|
|
33
|
+
case 'bottom':
|
|
34
|
+
x = cx - card.width / 2;
|
|
35
|
+
y = seat.y + seat.height + offset;
|
|
36
|
+
break;
|
|
37
|
+
case 'left':
|
|
38
|
+
x = seat.x - offset - card.width;
|
|
39
|
+
y = cy - card.height / 2;
|
|
40
|
+
break;
|
|
41
|
+
case 'right':
|
|
42
|
+
x = seat.x + seat.width + offset;
|
|
43
|
+
y = cy - card.height / 2;
|
|
44
|
+
break;
|
|
45
|
+
}
|
|
46
|
+
x = clamp(x, container.x, container.x + container.width - card.width);
|
|
47
|
+
y = clamp(y, container.y, container.y + container.height - card.height);
|
|
48
|
+
const vertical = side === 'top' || side === 'bottom';
|
|
49
|
+
const along = vertical ? cx - x : cy - y;
|
|
50
|
+
const extent = vertical ? card.width : card.height;
|
|
51
|
+
return { side, x, y, arrowOffset: clamp(along, Math.min(inset, extent / 2), extent - inset) };
|
|
52
|
+
}
|
|
53
|
+
/** Room on one side of the seat, inside the container. */
|
|
54
|
+
function room(side, input) {
|
|
55
|
+
const { seat, container } = input;
|
|
56
|
+
switch (side) {
|
|
57
|
+
case 'top':
|
|
58
|
+
return seat.y - container.y;
|
|
59
|
+
case 'bottom':
|
|
60
|
+
return container.y + container.height - (seat.y + seat.height);
|
|
61
|
+
case 'left':
|
|
62
|
+
return seat.x - container.x;
|
|
63
|
+
case 'right':
|
|
64
|
+
return container.x + container.width - (seat.x + seat.width);
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
function fits(side, input, offset) {
|
|
68
|
+
const needed = side === 'top' || side === 'bottom' ? input.card.height + offset : input.card.width + offset;
|
|
69
|
+
return room(side, input) >= needed;
|
|
70
|
+
}
|
|
71
|
+
function chooseSide(preferred, input, offset) {
|
|
72
|
+
if (preferred === 'auto') {
|
|
73
|
+
const fitting = AUTO_ORDER.find((side) => fits(side, input, offset));
|
|
74
|
+
if (fitting) {
|
|
75
|
+
return fitting;
|
|
76
|
+
}
|
|
77
|
+
// Nothing fits whole: take the side with the most room.
|
|
78
|
+
return AUTO_ORDER.reduce((best, side) => (room(side, input) > room(best, input) ? side : best));
|
|
79
|
+
}
|
|
80
|
+
if (fits(preferred, input, offset)) {
|
|
81
|
+
return preferred;
|
|
82
|
+
}
|
|
83
|
+
const opposite = OPPOSITE[preferred];
|
|
84
|
+
if (fits(opposite, input, offset)) {
|
|
85
|
+
return opposite;
|
|
86
|
+
}
|
|
87
|
+
// Neither side fits: stay with whichever has more room, preferring the asked-for one.
|
|
88
|
+
return room(opposite, input) > room(preferred, input) ? opposite : preferred;
|
|
89
|
+
}
|
|
90
|
+
/** `min` wins when the range is inverted, which pins an oversized card to the top-left. */
|
|
91
|
+
function clamp(value, min, max) {
|
|
92
|
+
return Math.max(min, Math.min(value, max));
|
|
93
|
+
}
|
|
94
|
+
//# sourceMappingURL=seat-card-placement.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"seat-card-placement.js","sourceRoot":"","sources":["../../src/view/seat-card-placement.ts"],"names":[],"mappings":"AAuDA,MAAM,QAAQ,GAAuC;IACnD,GAAG,EAAE,QAAQ;IACb,MAAM,EAAE,KAAK;IACb,IAAI,EAAE,OAAO;IACb,KAAK,EAAE,MAAM;CACd,CAAC;AAEF,mDAAmD;AACnD,MAAM,UAAU,GAA4B,CAAC,KAAK,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,CAAC,CAAC;AAE/E;;;;;;;;GAQG;AACH,MAAM,UAAU,aAAa,CAAC,KAA6B;IACzD,MAAM,EAAE,IAAI,EAAE,IAAI,EAAE,SAAS,EAAE,GAAG,KAAK,CAAC;IACxC,MAAM,MAAM,GAAG,KAAK,CAAC,MAAM,IAAI,CAAC,CAAC;IACjC,MAAM,KAAK,GAAG,KAAK,CAAC,UAAU,IAAI,EAAE,CAAC;IACrC,MAAM,SAAS,GAAG,KAAK,CAAC,SAAS,IAAI,KAAK,CAAC;IAE3C,MAAM,IAAI,GAAG,UAAU,CAAC,SAAS,EAAE,KAAK,EAAE,MAAM,CAAC,CAAC;IAClD,MAAM,EAAE,GAAG,IAAI,CAAC,CAAC,GAAG,IAAI,CAAC,KAAK,GAAG,CA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CAAC,GAAG,EAAE,IAAI,CAAC,GAAG,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC,CAAC;AAC7C,CAAC"}
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import type { RenderSeat } from '../render/render-model.js';
|
|
2
|
+
/**
|
|
3
|
+
* The vocabulary of seat hover and click, shared by both bindings.
|
|
4
|
+
*
|
|
5
|
+
* Hover and click are independent and optional (D10): a binding reports them as
|
|
6
|
+
* events, and can also show a card anchored to the seat on either one. What a
|
|
7
|
+
* card says is the consumer's; this module only names the pieces.
|
|
8
|
+
*/
|
|
9
|
+
/** Which side of the seat a card sits on. */
|
|
10
|
+
export type SeatCardSide = 'top' | 'bottom' | 'left' | 'right';
|
|
11
|
+
/** The side a card prefers. `auto` takes whichever side has the most room. */
|
|
12
|
+
export type SeatCardPlacement = SeatCardSide | 'auto';
|
|
13
|
+
/**
|
|
14
|
+
* What opened a card. `focus` only occurs with `hoverCardOnFocus` (D12).
|
|
15
|
+
*/
|
|
16
|
+
export type SeatCardTrigger = 'hover' | 'focus' | 'click';
|
|
17
|
+
/**
|
|
18
|
+
* `default` draws the library's plain look; `none` drops the background, border,
|
|
19
|
+
* padding, shadow and arrow, leaving only positioning (D11).
|
|
20
|
+
*/
|
|
21
|
+
export type SeatCardAppearance = 'default' | 'none';
|
|
22
|
+
/** What activated a seat. */
|
|
23
|
+
export type SeatClickSource = 'pointer' | 'keyboard';
|
|
24
|
+
/**
|
|
25
|
+
* What `onSeatClick` / `seatClick` reports (D13). A read-only notification: it
|
|
26
|
+
* cannot cancel or change what the click does.
|
|
27
|
+
*/
|
|
28
|
+
export interface SeatClick {
|
|
29
|
+
seat: RenderSeat;
|
|
30
|
+
/** Whether the seat was selected before this click. */
|
|
31
|
+
selected: boolean;
|
|
32
|
+
/** What activated it: a pointer click or tap, or Enter/Space on a focused seat. */
|
|
33
|
+
source: SeatClickSource;
|
|
34
|
+
}
|
|
35
|
+
/** What a card's content is handed. */
|
|
36
|
+
export interface KerusiSeatCardContext {
|
|
37
|
+
/** Everything the document knows about the seat, already resolved. */
|
|
38
|
+
seat: RenderSeat;
|
|
39
|
+
/** Whether the seat is in the current selection. */
|
|
40
|
+
selected: boolean;
|
|
41
|
+
/** What opened the card. */
|
|
42
|
+
trigger: SeatCardTrigger;
|
|
43
|
+
/** Closes the card. Most useful for a click card's own buttons. */
|
|
44
|
+
close: () => void;
|
|
45
|
+
}
|
|
46
|
+
/** Milliseconds before a hover card opens and, after the pointer leaves, closes. */
|
|
47
|
+
export interface HoverCardDelay {
|
|
48
|
+
open: number;
|
|
49
|
+
close: number;
|
|
50
|
+
}
|
|
51
|
+
export declare const DEFAULT_HOVER_CARD_DELAY: Readonly<HoverCardDelay>;
|
|
52
|
+
/** Fills in whichever half of the delay the caller left out; negatives become 0. */
|
|
53
|
+
export declare function resolveHoverCardDelay(delay?: Partial<HoverCardDelay>): HoverCardDelay;
|
|
54
|
+
/** The pointer types that can hover. Touch has no hover (D10). */
|
|
55
|
+
export declare function canHover(pointerType: string | undefined): boolean;
|
|
56
|
+
/**
|
|
57
|
+
* The id a card element carries, from a per-map-instance prefix. A seat points
|
|
58
|
+
* at its hover card with `aria-describedby`; a click card is labelled by the seat
|
|
59
|
+
* through its own `aria-label`, so the id there is only a stable hook.
|
|
60
|
+
*/
|
|
61
|
+
export declare function seatCardId(prefix: string, kind: 'hover' | 'click'): string;
|
|
62
|
+
/** The `data-*` attributes a card mirrors from its seat, so CSS can pick cards out by seat. */
|
|
63
|
+
export interface SeatCardDataAttributes {
|
|
64
|
+
'data-seat-id': string;
|
|
65
|
+
'data-seat-status': string;
|
|
66
|
+
'data-seat-type': string;
|
|
67
|
+
'data-section-id': string;
|
|
68
|
+
}
|
|
69
|
+
export declare function seatCardDataAttributes(seat: RenderSeat): SeatCardDataAttributes;
|
|
70
|
+
/** The class list for a card element: the hooks, then the consumer's own. */
|
|
71
|
+
export declare function seatCardClassName(trigger: 'hover' | 'click', appearance: SeatCardAppearance, extra?: string): string;
|
|
72
|
+
/**
|
|
73
|
+
* A CSS length as pixels, for the two tokens placement needs as numbers
|
|
74
|
+
* (`--kerusi-seat-card-offset`, `--kerusi-seat-card-arrow-size`).
|
|
75
|
+
*
|
|
76
|
+
* Reads `px`, `rem`, `em` and unitless numbers; anything else (a `calc()`, a
|
|
77
|
+
* percentage, an unset property) yields `fallback`.
|
|
78
|
+
*/
|
|
79
|
+
export declare function cssLengthToPx(value: string | null | undefined, fallback: number, fontSizes?: {
|
|
80
|
+
root?: number;
|
|
81
|
+
element?: number;
|
|
82
|
+
}): number;
|
|
83
|
+
//# sourceMappingURL=seat-card.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"seat-card.d.ts","sourceRoot":"","sources":["../../src/view/seat-card.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AAG5D;;;;;;GAMG;AAEH,6CAA6C;AAC7C,MAAM,MAAM,YAAY,GAAG,KAAK,GAAG,QAAQ,GAAG,MAAM,GAAG,OAAO,CAAC;AAE/D,8EAA8E;AAC9E,MAAM,MAAM,iBAAiB,GAAG,YAAY,GAAG,MAAM,CAAC;AAEtD;;GAEG;AACH,MAAM,MAAM,eAAe,GAAG,OAAO,GAAG,OAAO,GAAG,OAAO,CAAC;AAE1D;;;GAGG;AACH,MAAM,MAAM,kBAAkB,GAAG,SAAS,GAAG,MAAM,CAAC;AAEpD,6BAA6B;AAC7B,MAAM,MAAM,eAAe,GAAG,SAAS,GAAG,UAAU,CAAC;AAErD;;;GAGG;AACH,MAAM,WAAW,SAAS;IACxB,IAAI,EAAE,UAAU,CAAC;IACjB,uDAAuD;IACvD,QAAQ,EAAE,OAAO,CAAC;IAClB,mFAAmF;IACnF,MAAM,EAAE,eAAe,CAAC;CACzB;AAED,uCAAuC;AACvC,MAAM,WAAW,qBAAqB;IACpC,sEAAsE;IACtE,IAAI,EAAE,UAAU,CAAC;IACjB,oDAAoD;IACpD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 -0,0 +1,68 @@
|
|
|
1
|
+
import { seatDataAttributes } from './seat-glyph.js';
|
|
2
|
+
export const DEFAULT_HOVER_CARD_DELAY = Object.freeze({
|
|
3
|
+
open: 150,
|
|
4
|
+
close: 100,
|
|
5
|
+
});
|
|
6
|
+
/** Fills in whichever half of the delay the caller left out; negatives become 0. */
|
|
7
|
+
export function resolveHoverCardDelay(delay) {
|
|
8
|
+
const pick = (value, fallback) => typeof value === 'number' && Number.isFinite(value) ? Math.max(0, value) : fallback;
|
|
9
|
+
return {
|
|
10
|
+
open: pick(delay?.open, DEFAULT_HOVER_CARD_DELAY.open),
|
|
11
|
+
close: pick(delay?.close, DEFAULT_HOVER_CARD_DELAY.close),
|
|
12
|
+
};
|
|
13
|
+
}
|
|
14
|
+
/** The pointer types that can hover. Touch has no hover (D10). */
|
|
15
|
+
export function canHover(pointerType) {
|
|
16
|
+
return pointerType === 'mouse' || pointerType === 'pen';
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* The id a card element carries, from a per-map-instance prefix. A seat points
|
|
20
|
+
* at its hover card with `aria-describedby`; a click card is labelled by the seat
|
|
21
|
+
* through its own `aria-label`, so the id there is only a stable hook.
|
|
22
|
+
*/
|
|
23
|
+
export function seatCardId(prefix, kind) {
|
|
24
|
+
return `${prefix}-seat-card-${kind}`;
|
|
25
|
+
}
|
|
26
|
+
export function seatCardDataAttributes(seat) {
|
|
27
|
+
const data = seatDataAttributes(seat);
|
|
28
|
+
return {
|
|
29
|
+
'data-seat-id': seat.id,
|
|
30
|
+
'data-seat-status': data.status,
|
|
31
|
+
'data-seat-type': data.type,
|
|
32
|
+
'data-section-id': data.section,
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
/** The class list for a card element: the hooks, then the consumer's own. */
|
|
36
|
+
export function seatCardClassName(trigger, appearance, extra) {
|
|
37
|
+
return [
|
|
38
|
+
'kerusi-seat-card',
|
|
39
|
+
`kerusi-seat-card--${trigger}`,
|
|
40
|
+
appearance === 'none' ? 'kerusi-seat-card--bare' : '',
|
|
41
|
+
extra ?? '',
|
|
42
|
+
]
|
|
43
|
+
.filter(Boolean)
|
|
44
|
+
.join(' ');
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* A CSS length as pixels, for the two tokens placement needs as numbers
|
|
48
|
+
* (`--kerusi-seat-card-offset`, `--kerusi-seat-card-arrow-size`).
|
|
49
|
+
*
|
|
50
|
+
* Reads `px`, `rem`, `em` and unitless numbers; anything else (a `calc()`, a
|
|
51
|
+
* percentage, an unset property) yields `fallback`.
|
|
52
|
+
*/
|
|
53
|
+
export function cssLengthToPx(value, fallback, fontSizes = {}) {
|
|
54
|
+
const match = /^\s*(-?\d*\.?\d+)\s*(px|rem|em)?\s*$/i.exec(value ?? '');
|
|
55
|
+
if (!match) {
|
|
56
|
+
return fallback;
|
|
57
|
+
}
|
|
58
|
+
const amount = Number(match[1]);
|
|
59
|
+
switch ((match[2] ?? 'px').toLowerCase()) {
|
|
60
|
+
case 'rem':
|
|
61
|
+
return amount * (fontSizes.root ?? 16);
|
|
62
|
+
case 'em':
|
|
63
|
+
return amount * (fontSizes.element ?? fontSizes.root ?? 16);
|
|
64
|
+
default:
|
|
65
|
+
return amount;
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
//# sourceMappingURL=seat-card.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"seat-card.js","sourceRoot":"","sources":["../../src/view/seat-card.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AA4DrD,MAAM,CAAC,MAAM,wBAAwB,GAA6B,MAAM,CAAC,MAAM,CAAC;IAC9E,IAAI,EAAE,GAAG;IACT,KAAK,EAAE,GAAG;CACX,CAAC,CAAC;AAEH,oFAAoF;AACpF,MAAM,UAAU,qBAAqB,CAAC,KAA+B;IACnE,MAAM,IAAI,GAAG,CAAC,KAAyB,EAAE,QAAgB,EAAE,EAAE,CAC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AACH,MAAM,UAAU,aAAa,CAC3B,KAAgC,EAChC,QAAgB,EAChB,YAAiD,EAAE;IAEnD,MAAM,KAAK,GAAG,uCAAuC,CAAC,IAAI,CAAC,KAAK,IAAI,EAAE,CAAC,CAAC;IACxE,IAAI,CAAC,KAAK,EAAE,CAAC;QACX,OAAO,QAAQ,CAAC;IAClB,CAAC;IACD,MAAM,MAAM,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;IAChC,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,IAAI,CAAC,CAAC,WAAW,EAAE,EAAE,CAAC;QACzC,KAAK,KAAK;YACR,OAAO,MAAM,GAAG,CAAC,SAAS,CAAC,IAAI,IAAI,EAAE,CAAC,CAAC;QACzC,KAAK,IAAI;YACP,OAAO,MAAM,GAAG,CAAC,SAAS,CAAC,OAAO,IAAI,SAAS,CAAC,IAAI,IAAI,EAAE,CAAC,CAAC;QAC9D;YACE,OAAO,MAAM,CAAC;IAClB,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
import { type HoverCardDelay } from './seat-card.js';
|
|
2
|
+
/**
|
|
3
|
+
* Seat hover as a reducer, the way `reduceGesture()` does pan and pinch.
|
|
4
|
+
*
|
|
5
|
+
* A binding feeds in what the pointer, the keyboard and its timers did, and
|
|
6
|
+
* applies what comes back: the seat to report to `onSeatHover` / `seatHover`,
|
|
7
|
+
* which hover card should be showing, and the one timer it should be running.
|
|
8
|
+
* The rules live here, once, so the two bindings cannot drift apart (D10):
|
|
9
|
+
*
|
|
10
|
+
* - Only a mouse or a pen hovers. Touch has no hover, and a tap stays a tap.
|
|
11
|
+
* - The seat is reported once on entry and once, as `null`, on leave. Moving
|
|
12
|
+
* within a seat reports nothing.
|
|
13
|
+
* - While the map is panned or zoomed the hover is cleared once. It resumes on
|
|
14
|
+
* the first pointer move after the gesture ends, not before.
|
|
15
|
+
* - A hover card opens after `delay.open`, stays while the pointer is on the
|
|
16
|
+
* seat or on the card (WCAG 1.4.13 "hoverable"), and closes `delay.close`
|
|
17
|
+
* after the pointer leaves both. `Escape` dismisses it, and it stays dismissed
|
|
18
|
+
* until the pointer or focus has left that seat (WCAG 1.4.13 "dismissible").
|
|
19
|
+
* - Keyboard focus shows the card only when the binding feeds `focus` events,
|
|
20
|
+
* which it does only with `hoverCardOnFocus` (D12).
|
|
21
|
+
*/
|
|
22
|
+
export interface SeatHoverState {
|
|
23
|
+
/** The seat the pointer is over, as last reported. */
|
|
24
|
+
readonly hoveredId: string | null;
|
|
25
|
+
/** True from the start of a pan or zoom until the next pointer move. */
|
|
26
|
+
readonly suppressed: boolean;
|
|
27
|
+
/** The seat whose hover card is showing. */
|
|
28
|
+
readonly cardId: string | null;
|
|
29
|
+
/** Why the card is showing. */
|
|
30
|
+
readonly cardTrigger: 'hover' | 'focus' | null;
|
|
31
|
+
/** The seat a running open timer will show a card for. */
|
|
32
|
+
readonly pendingId: string | null;
|
|
33
|
+
/** True while a close timer is running. */
|
|
34
|
+
readonly closing: boolean;
|
|
35
|
+
/** True while the pointer is on the card itself. */
|
|
36
|
+
readonly overCard: boolean;
|
|
37
|
+
/** The seat the focus is on, when focus is being followed. */
|
|
38
|
+
readonly focusedId: string | null;
|
|
39
|
+
/** A seat whose card `Escape` dismissed, until the pointer and focus leave it. */
|
|
40
|
+
readonly dismissedId: string | null;
|
|
41
|
+
}
|
|
42
|
+
export declare const IDLE_SEAT_HOVER: SeatHoverState;
|
|
43
|
+
export type SeatHoverEvent = {
|
|
44
|
+
type: 'enter' | 'move';
|
|
45
|
+
seatId: string;
|
|
46
|
+
pointerType: string;
|
|
47
|
+
} | {
|
|
48
|
+
type: 'leave';
|
|
49
|
+
seatId: string;
|
|
50
|
+
pointerType: string;
|
|
51
|
+
}
|
|
52
|
+
/** A pan, pinch or wheel zoom began. */
|
|
53
|
+
| {
|
|
54
|
+
type: 'gesture';
|
|
55
|
+
} | {
|
|
56
|
+
type: 'card-enter' | 'card-leave';
|
|
57
|
+
} | {
|
|
58
|
+
type: 'focus' | 'blur';
|
|
59
|
+
seatId: string;
|
|
60
|
+
} | {
|
|
61
|
+
type: 'escape';
|
|
62
|
+
}
|
|
63
|
+
/** The open or close timer the reducer asked for has run out. */
|
|
64
|
+
| {
|
|
65
|
+
type: 'timer';
|
|
66
|
+
kind: 'open' | 'close';
|
|
67
|
+
}
|
|
68
|
+
/** The seat the card is for no longer exists, or the feature was turned off. */
|
|
69
|
+
| {
|
|
70
|
+
type: 'reset';
|
|
71
|
+
};
|
|
72
|
+
/** The one timer the binding should be running, if any. */
|
|
73
|
+
export type SeatHoverTimer = {
|
|
74
|
+
action: 'start';
|
|
75
|
+
kind: 'open' | 'close';
|
|
76
|
+
ms: number;
|
|
77
|
+
} | {
|
|
78
|
+
action: 'clear';
|
|
79
|
+
};
|
|
80
|
+
export interface SeatHoverResult {
|
|
81
|
+
state: SeatHoverState;
|
|
82
|
+
/** Present when `onSeatHover` should be called: with this seat, or `null`. */
|
|
83
|
+
report?: {
|
|
84
|
+
seatId: string | null;
|
|
85
|
+
};
|
|
86
|
+
/** Absent when the timer is to be left as it is. */
|
|
87
|
+
timer?: SeatHoverTimer;
|
|
88
|
+
}
|
|
89
|
+
export declare function reduceSeatHover(state: SeatHoverState, event: SeatHoverEvent, delay: HoverCardDelay): SeatHoverResult;
|
|
90
|
+
//# sourceMappingURL=seat-hover.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"seat-hover.d.ts","sourceRoot":"","sources":["../../src/view/seat-hover.ts"],"names":[],"mappings":"AAAA,OAAO,EAAY,KAAK,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAE/D;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,MAAM,WAAW,cAAc;IAC7B,sDAAsD;IACtD,QAAQ,CAAC,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IAClC,wEAAwE;IACxE,QAAQ,CAAC,UAAU,EAAE,OAAO,CAAC;I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AE,MAAM,EAAE,OAAO,CAAC;IAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC;IAAC,EAAE,EAAE,MAAM,CAAA;CAAE,GAAG;IAAE,MAAM,EAAE,OAAO,CAAA;CAAE,CAAC;AAEhF,MAAM,WAAW,eAAe;IAC9B,KAAK,EAAE,cAAc,CAAC;IACtB,8EAA8E;IAC9E,MAAM,CAAC,EAAE;QAAE,MAAM,EAAE,MAAM,GAAG,IAAI,CAAA;KAAE,CAAC;IACnC,oDAAoD;IACpD,KAAK,CAAC,EAAE,cAAc,CAAC;CACxB;AAED,wBAAgB,eAAe,CAC7B,KAAK,EAAE,cAAc,EACrB,KAAK,EAAE,cAAc,EACrB,KAAK,EAAE,cAAc,GACpB,eAAe,CAgCjB"}
|
|
@@ -0,0 +1,205 @@
|
|
|
1
|
+
import { canHover } from './seat-card.js';
|
|
2
|
+
export const IDLE_SEAT_HOVER = Object.freeze({
|
|
3
|
+
hoveredId: null,
|
|
4
|
+
suppressed: false,
|
|
5
|
+
cardId: null,
|
|
6
|
+
cardTrigger: null,
|
|
7
|
+
pendingId: null,
|
|
8
|
+
closing: false,
|
|
9
|
+
overCard: false,
|
|
10
|
+
focusedId: null,
|
|
11
|
+
dismissedId: null,
|
|
12
|
+
});
|
|
13
|
+
export function reduceSeatHover(state, event, delay) {
|
|
14
|
+
switch (event.type) {
|
|
15
|
+
case 'enter':
|
|
16
|
+
case 'move':
|
|
17
|
+
return canHover(event.pointerType) ? onPointerOver(state, event.seatId, delay) : { state };
|
|
18
|
+
case 'leave':
|
|
19
|
+
return canHover(event.pointerType) ? onPointerOut(state, event.seatId, delay) : { state };
|
|
20
|
+
case 'gesture':
|
|
21
|
+
return onGesture(state);
|
|
22
|
+
case 'card-enter':
|
|
23
|
+
return state.cardId === null
|
|
24
|
+
? { state }
|
|
25
|
+
: { state: { ...state, overCard: true, closing: false }, timer: { action: 'clear' } };
|
|
26
|
+
case 'card-leave':
|
|
27
|
+
return onCardLeave(state, delay);
|
|
28
|
+
case 'focus':
|
|
29
|
+
return onFocus(state, event.seatId);
|
|
30
|
+
case 'blur':
|
|
31
|
+
return onBlur(state, event.seatId);
|
|
32
|
+
case 'escape':
|
|
33
|
+
return onEscape(state);
|
|
34
|
+
case 'timer':
|
|
35
|
+
return onTimer(state, event.kind);
|
|
36
|
+
case 'reset':
|
|
37
|
+
return state === IDLE_SEAT_HOVER
|
|
38
|
+
? { state }
|
|
39
|
+
: {
|
|
40
|
+
state: IDLE_SEAT_HOVER,
|
|
41
|
+
timer: { action: 'clear' },
|
|
42
|
+
report: state.hoveredId === null ? undefined : { seatId: null },
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
function onPointerOver(state, seatId, delay) {
|
|
47
|
+
if (state.hoveredId === seatId && !state.suppressed) {
|
|
48
|
+
return { state };
|
|
49
|
+
}
|
|
50
|
+
const resumed = { ...state, suppressed: false, hoveredId: seatId };
|
|
51
|
+
const report = { seatId };
|
|
52
|
+
if (state.dismissedId === seatId) {
|
|
53
|
+
return { state: resumed, report };
|
|
54
|
+
}
|
|
55
|
+
// Already showing this seat's card (the pointer came back during the close
|
|
56
|
+
// delay, or the card was opened by focus): keep it.
|
|
57
|
+
if (state.cardId === seatId) {
|
|
58
|
+
return {
|
|
59
|
+
state: { ...resumed, closing: false, pendingId: null },
|
|
60
|
+
report,
|
|
61
|
+
timer: { action: 'clear' },
|
|
62
|
+
};
|
|
63
|
+
}
|
|
64
|
+
// Another seat's card is showing: move to this one at once, so sweeping
|
|
65
|
+
// across a row does not flicker the card through its open delay each time.
|
|
66
|
+
if (state.cardId !== null) {
|
|
67
|
+
return {
|
|
68
|
+
state: {
|
|
69
|
+
...resumed,
|
|
70
|
+
cardId: seatId,
|
|
71
|
+
cardTrigger: 'hover',
|
|
72
|
+
closing: false,
|
|
73
|
+
overCard: false,
|
|
74
|
+
pendingId: null,
|
|
75
|
+
},
|
|
76
|
+
report,
|
|
77
|
+
timer: { action: 'clear' },
|
|
78
|
+
};
|
|
79
|
+
}
|
|
80
|
+
if (delay.open <= 0) {
|
|
81
|
+
return {
|
|
82
|
+
state: { ...resumed, cardId: seatId, cardTrigger: 'hover', pendingId: null },
|
|
83
|
+
report,
|
|
84
|
+
timer: { action: 'clear' },
|
|
85
|
+
};
|
|
86
|
+
}
|
|
87
|
+
return {
|
|
88
|
+
state: { ...resumed, pendingId: seatId },
|
|
89
|
+
report,
|
|
90
|
+
timer: { action: 'start', kind: 'open', ms: delay.open },
|
|
91
|
+
};
|
|
92
|
+
}
|
|
93
|
+
function onPointerOut(state, seatId, delay) {
|
|
94
|
+
if (state.hoveredId !== seatId) {
|
|
95
|
+
return { state };
|
|
96
|
+
}
|
|
97
|
+
const left = {
|
|
98
|
+
...state,
|
|
99
|
+
hoveredId: null,
|
|
100
|
+
pendingId: null,
|
|
101
|
+
dismissedId: state.dismissedId === seatId && state.focusedId !== seatId ? null : state.dismissedId,
|
|
102
|
+
};
|
|
103
|
+
const report = { seatId: null };
|
|
104
|
+
// A card the pointer opened lingers for the close delay, so the pointer can
|
|
105
|
+
// travel into it. One that focus opened stays with the focus.
|
|
106
|
+
if (state.cardId === seatId && state.cardTrigger === 'hover' && !state.overCard) {
|
|
107
|
+
if (delay.close <= 0) {
|
|
108
|
+
return { state: closeCard(left), report, timer: { action: 'clear' } };
|
|
109
|
+
}
|
|
110
|
+
return {
|
|
111
|
+
state: { ...left, closing: true },
|
|
112
|
+
report,
|
|
113
|
+
timer: { action: 'start', kind: 'close', ms: delay.close },
|
|
114
|
+
};
|
|
115
|
+
}
|
|
116
|
+
return {
|
|
117
|
+
state: left,
|
|
118
|
+
report,
|
|
119
|
+
timer: state.pendingId === null && !state.closing ? undefined : { action: 'clear' },
|
|
120
|
+
};
|
|
121
|
+
}
|
|
122
|
+
function onGesture(state) {
|
|
123
|
+
const hadHover = state.hoveredId !== null;
|
|
124
|
+
return {
|
|
125
|
+
state: { ...closeCard(state), hoveredId: null, pendingId: null, suppressed: true },
|
|
126
|
+
report: hadHover ? { seatId: null } : undefined,
|
|
127
|
+
timer: { action: 'clear' },
|
|
128
|
+
};
|
|
129
|
+
}
|
|
130
|
+
function onCardLeave(state, delay) {
|
|
131
|
+
if (!state.overCard) {
|
|
132
|
+
return { state };
|
|
133
|
+
}
|
|
134
|
+
const off = { ...state, overCard: false };
|
|
135
|
+
// Back on the seat, or the card is held open by focus: nothing to close.
|
|
136
|
+
if (state.cardId === null || state.cardTrigger !== 'hover' || state.hoveredId === state.cardId) {
|
|
137
|
+
return { state: off };
|
|
138
|
+
}
|
|
139
|
+
if (delay.close <= 0) {
|
|
140
|
+
return { state: closeCard(off), timer: { action: 'clear' } };
|
|
141
|
+
}
|
|
142
|
+
return {
|
|
143
|
+
state: { ...off, closing: true },
|
|
144
|
+
timer: { action: 'start', kind: 'close', ms: delay.close },
|
|
145
|
+
};
|
|
146
|
+
}
|
|
147
|
+
function onFocus(state, seatId) {
|
|
148
|
+
const focused = { ...state, focusedId: seatId };
|
|
149
|
+
if (state.dismissedId === seatId || state.cardId === seatId) {
|
|
150
|
+
return { state: focused };
|
|
151
|
+
}
|
|
152
|
+
return {
|
|
153
|
+
state: {
|
|
154
|
+
...focused,
|
|
155
|
+
cardId: seatId,
|
|
156
|
+
cardTrigger: 'focus',
|
|
157
|
+
pendingId: null,
|
|
158
|
+
closing: false,
|
|
159
|
+
overCard: false,
|
|
160
|
+
},
|
|
161
|
+
timer: { action: 'clear' },
|
|
162
|
+
};
|
|
163
|
+
}
|
|
164
|
+
function onBlur(state, seatId) {
|
|
165
|
+
if (state.focusedId !== seatId) {
|
|
166
|
+
return { state };
|
|
167
|
+
}
|
|
168
|
+
const blurred = {
|
|
169
|
+
...state,
|
|
170
|
+
focusedId: null,
|
|
171
|
+
dismissedId: state.dismissedId === seatId && state.hoveredId !== seatId ? null : state.dismissedId,
|
|
172
|
+
};
|
|
173
|
+
if (state.cardId !== seatId || state.cardTrigger !== 'focus') {
|
|
174
|
+
return { state: blurred };
|
|
175
|
+
}
|
|
176
|
+
// The pointer is still on the seat: the card carries on as a hover card.
|
|
177
|
+
if (state.hoveredId === seatId) {
|
|
178
|
+
return { state: { ...blurred, cardTrigger: 'hover' } };
|
|
179
|
+
}
|
|
180
|
+
return { state: closeCard(blurred), timer: { action: 'clear' } };
|
|
181
|
+
}
|
|
182
|
+
function onEscape(state) {
|
|
183
|
+
if (state.cardId === null && state.pendingId === null) {
|
|
184
|
+
return { state };
|
|
185
|
+
}
|
|
186
|
+
return {
|
|
187
|
+
state: { ...closeCard(state), pendingId: null, dismissedId: state.cardId ?? state.pendingId },
|
|
188
|
+
timer: { action: 'clear' },
|
|
189
|
+
};
|
|
190
|
+
}
|
|
191
|
+
function onTimer(state, kind) {
|
|
192
|
+
if (kind === 'open' && state.pendingId !== null) {
|
|
193
|
+
return {
|
|
194
|
+
state: { ...state, cardId: state.pendingId, cardTrigger: 'hover', pendingId: null },
|
|
195
|
+
};
|
|
196
|
+
}
|
|
197
|
+
if (kind === 'close' && state.closing) {
|
|
198
|
+
return { state: closeCard(state) };
|
|
199
|
+
}
|
|
200
|
+
return { state };
|
|
201
|
+
}
|
|
202
|
+
function closeCard(state) {
|
|
203
|
+
return { ...state, cardId: null, cardTrigger: null, closing: false, overCard: false };
|
|
204
|
+
}
|
|
205
|
+
//# sourceMappingURL=seat-hover.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"seat-hover.js","sourceRoot":"","sources":["../../src/view/seat-hover.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAuB,MAAM,gBAAgB,CAAC;AA4C/D,MAAM,CAAC,MAAM,eAAe,GAAmB,MAAM,CAAC,MAAM,CAAC;IAC3D,SAAS,EAAE,IAAI;IACf,UAAU,EAAE,KAAK;IACjB,MAAM,EAAE,IAAI;IACZ,WAAW,EAAE,IAAI;IACjB,SAAS,EAAE,IAAI;IACf,OAAO,EAAE,KAAK;IACd,QAAQ,EAAE,KAAK;IACf,SAAS,EAAE,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AE,IAAsB;IAC5D,IAAI,IAAI,KAAK,MAAM,IAAI,KAAK,CAAC,SAAS,KAAK,IAAI,EAAE,CAAC;QAChD,OAAO;YACL,KAAK,EAAE,EAAE,GAAG,KAAK,EAAE,MAAM,EAAE,KAAK,CAAC,SAAS,EAAE,WAAW,EAAE,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE;SACpF,CAAC;IACJ,CAAC;IACD,IAAI,IAAI,KAAK,OAAO,IAAI,KAAK,CAAC,OAAO,EAAE,CAAC;QACtC,OAAO,EAAE,KAAK,EAAE,SAAS,CAAC,KAAK,CAAC,EAAE,CAAC;IACrC,CAAC;IACD,OAAO,EAAE,KAAK,EAAE,CAAC;AACnB,CAAC;AAED,SAAS,SAAS,CAAC,KAAqB;IACtC,OAAO,EAAE,GAAG,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,WAAW,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,KAAK,EAAE,CAAC;AACxF,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kerusiweb/core",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.1.0",
|
|
4
4
|
"description": "Framework-agnostic core for the Kerusi Seat Map & Availability Format: document types, a conformance validator, and the render model and geometry a seat-map renderer consumes.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"kerusi",
|