@fusion.dev/helix-headless 0.105.0 → 0.106.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.
Files changed (162) hide show
  1. package/custom-elements.json +7324 -3890
  2. package/dist/accordion/item/accordion-item.d.ts +17 -16
  3. package/dist/accordion/root/accordion-root.d.ts +13 -17
  4. package/dist/announcement/root/announcement-root.d.ts +24 -31
  5. package/dist/app-header/root/app-header-root.d.ts +14 -14
  6. package/dist/area-chart/root/area-chart-root.d.ts +29 -48
  7. package/dist/avatar/group/avatar-group.d.ts +6 -8
  8. package/dist/avatar/root/avatar-root.d.ts +11 -11
  9. package/dist/badge/root/badge-root.d.ts +14 -15
  10. package/dist/bar-chart/root/bar-chart-root.d.ts +40 -44
  11. package/dist/blockquote/root/blockquote-root.d.ts +5 -7
  12. package/dist/breadcrumbs/breadcrumb/breadcrumb.d.ts +25 -33
  13. package/dist/breadcrumbs/root/breadcrumbs-root.d.ts +12 -11
  14. package/dist/button/root/button-root.d.ts +16 -17
  15. package/dist/button-group/root/button-group-root.d.ts +9 -10
  16. package/dist/callout/root/callout-root.d.ts +10 -15
  17. package/dist/canvas/edge/canvas-edge.d.ts +21 -21
  18. package/dist/canvas/node/canvas-node.d.ts +43 -45
  19. package/dist/canvas/root/canvas-root.d.ts +100 -99
  20. package/dist/card/root/card-root.d.ts +10 -12
  21. package/dist/carousel/root/carousel-root.d.ts +32 -33
  22. package/dist/chat/composer/chat-composer.d.ts +24 -26
  23. package/dist/chat/message/chat-message.d.ts +30 -33
  24. package/dist/chat/root/chat-root.d.ts +63 -80
  25. package/dist/checkbox/root/checkbox-root.d.ts +30 -32
  26. package/dist/checkbox-group/root/checkbox-group-root.d.ts +25 -25
  27. package/dist/code/root/code-root.d.ts +6 -10
  28. package/dist/code-block/root/code-block-root.d.ts +35 -48
  29. package/dist/color-input/root/color-input-root.d.ts +52 -56
  30. package/dist/color-picker/root/color-picker-root.d.ts +49 -49
  31. package/dist/combobox/root/combobox-root.d.ts +52 -53
  32. package/dist/command/root/command-root.d.ts +35 -40
  33. package/dist/copy-button/root/copy-button-root.d.ts +24 -26
  34. package/dist/data-table/root/data-table-root.d.ts +106 -107
  35. package/dist/date-input/root/date-input-root.d.ts +54 -53
  36. package/dist/date-picker/root/date-picker-root.d.ts +25 -21
  37. package/dist/description-list/item/description-list-item.d.ts +7 -7
  38. package/dist/description-list/root/description-list-root.d.ts +10 -15
  39. package/dist/dialog/root/dialog-root.d.ts +22 -19
  40. package/dist/divider/root/divider-root.d.ts +12 -13
  41. package/dist/donut-chart/root/donut-chart-root.d.ts +19 -20
  42. package/dist/drawer/root/drawer-root.d.ts +19 -18
  43. package/dist/drilldown/item/drilldown-item.d.ts +28 -28
  44. package/dist/drilldown/root/drilldown-root.d.ts +22 -28
  45. package/dist/element-events.generated.js +7 -0
  46. package/dist/empty/root/empty-root.d.ts +16 -19
  47. package/dist/file-input/root/file-input-root.d.ts +32 -32
  48. package/dist/filter-input/chip/filter-chip.d.ts +36 -39
  49. package/dist/filter-input/field/filter-field.d.ts +25 -31
  50. package/dist/filter-input/menu/filter-menu.d.ts +50 -47
  51. package/dist/filter-input/operator/filter-operator.d.ts +15 -20
  52. package/dist/filter-input/root/filter-input-root.d.ts +80 -98
  53. package/dist/format-date/root/format-date-root.d.ts +19 -27
  54. package/dist/heatmap/root/heatmap-root.d.ts +40 -41
  55. package/dist/icon/root/icon-root.d.ts +21 -23
  56. package/dist/icon-button/root/icon-button-root.d.ts +12 -14
  57. package/dist/image/root/image-root.d.ts +30 -30
  58. package/dist/input/root/input-root.d.ts +36 -35
  59. package/dist/kbd/root/kbd-root.d.ts +13 -15
  60. package/dist/legend/root/legend-root.d.ts +18 -16
  61. package/dist/lightbox/item/lightbox-item.d.ts +13 -15
  62. package/dist/lightbox/root/lightbox-root.d.ts +40 -41
  63. package/dist/line-chart/root/line-chart-root.d.ts +20 -29
  64. package/dist/list/item/list-item.d.ts +17 -22
  65. package/dist/list/root/list-root.d.ts +6 -7
  66. package/dist/listbox/root/listbox-root.d.ts +42 -41
  67. package/dist/loader/root/loader-root.d.ts +16 -20
  68. package/dist/map/area/map-area.d.ts +6 -0
  69. package/dist/map/area/map-area.js +3 -0
  70. package/dist/map/buildings/map-buildings.d.ts +45 -0
  71. package/dist/map/buildings/map-buildings.js +37 -0
  72. package/dist/map/contours/map-contours.d.ts +61 -0
  73. package/dist/map/contours/map-contours.js +54 -0
  74. package/dist/map/index.d.ts +7 -0
  75. package/dist/map/index.js +5 -0
  76. package/dist/map/landcover/map-landcover.d.ts +47 -0
  77. package/dist/map/landcover/map-landcover.js +37 -0
  78. package/dist/map/marker/map-marker.d.ts +11 -4
  79. package/dist/map/marker/map-marker.js +13 -1
  80. package/dist/map/points/map-points.d.ts +7 -1
  81. package/dist/map/points/map-points.js +3 -0
  82. package/dist/map/raster/map-raster.d.ts +84 -0
  83. package/dist/map/raster/map-raster.js +96 -0
  84. package/dist/map/root/map-root.d.ts +169 -7
  85. package/dist/map/root/map-root.js +352 -4
  86. package/dist/map/route/map-route.d.ts +6 -0
  87. package/dist/map/route/map-route.js +3 -0
  88. package/dist/map/terrain/map-terrain.d.ts +68 -0
  89. package/dist/map/terrain/map-terrain.js +58 -0
  90. package/dist/megamenu/root/megamenu-root.d.ts +27 -25
  91. package/dist/menu/item/menu-item.d.ts +30 -31
  92. package/dist/menu/root/menu-root.d.ts +25 -29
  93. package/dist/meter/root/meter-root.d.ts +22 -21
  94. package/dist/navigation/root/navigation-root.d.ts +13 -16
  95. package/dist/notifications/group/notification-group.d.ts +27 -28
  96. package/dist/notifications/notification/notification.d.ts +35 -42
  97. package/dist/notifications/root/notifications-root.d.ts +22 -24
  98. package/dist/number-input/root/number-input-root.d.ts +46 -50
  99. package/dist/object-inspector/root/object-inspector-root.d.ts +46 -58
  100. package/dist/option/group/option-group.d.ts +11 -11
  101. package/dist/option/root/option-root.d.ts +28 -33
  102. package/dist/outline/root/outline-root.d.ts +18 -17
  103. package/dist/pagination/root/pagination-root.d.ts +37 -39
  104. package/dist/pagination/size/pagination-size.d.ts +37 -43
  105. package/dist/pagination/summary/pagination-summary.d.ts +12 -14
  106. package/dist/pin-input/root/pin-input-root.d.ts +32 -38
  107. package/dist/popover/root/popover-root.d.ts +16 -21
  108. package/dist/progress/root/progress-root.d.ts +16 -14
  109. package/dist/qr-code/root/qr-code-root.d.ts +22 -25
  110. package/dist/quote/root/quote-root.d.ts +5 -6
  111. package/dist/radio/group/radio-group.d.ts +26 -28
  112. package/dist/radio/root/radio-root.d.ts +24 -28
  113. package/dist/rating/root/rating-root.d.ts +27 -30
  114. package/dist/scatter-chart/root/scatter-chart-root.d.ts +43 -55
  115. package/dist/scroll-area/root/scroll-area-root.d.ts +15 -21
  116. package/dist/select/root/select-root.d.ts +41 -44
  117. package/dist/skeleton/root/skeleton-root.d.ts +7 -8
  118. package/dist/skip-link/root/skip-link-root.d.ts +21 -28
  119. package/dist/slider/root/slider-root.d.ts +36 -39
  120. package/dist/sparkline/root/sparkline-root.d.ts +22 -28
  121. package/dist/speed-dial/item/speed-dial-item.d.ts +21 -21
  122. package/dist/speed-dial/root/speed-dial-root.d.ts +25 -27
  123. package/dist/splitter/root/splitter-root.d.ts +37 -41
  124. package/dist/stat/group/stat-group.d.ts +4 -4
  125. package/dist/stat/root/stat-root.d.ts +8 -9
  126. package/dist/steps/root/steps-root.d.ts +11 -14
  127. package/dist/steps/step/step.d.ts +22 -29
  128. package/dist/switch/root/switch-root.d.ts +20 -24
  129. package/dist/table/cell/table-cell.d.ts +18 -8
  130. package/dist/table/cell/table-cell.js +5 -1
  131. package/dist/table/column/table-column.d.ts +62 -55
  132. package/dist/table/root/table-root.d.ts +16 -17
  133. package/dist/table/row/table-row.d.ts +3 -3
  134. package/dist/tabs/panel/tab-panel.d.ts +3 -3
  135. package/dist/tabs/root/tabs-root.d.ts +19 -17
  136. package/dist/tabs/tab/tab.d.ts +6 -6
  137. package/dist/tag/root/tag-root.d.ts +11 -12
  138. package/dist/textarea/root/textarea-root.d.ts +29 -32
  139. package/dist/time-input/root/time-input-root.d.ts +70 -69
  140. package/dist/time-picker/root/time-picker-root.d.ts +58 -66
  141. package/dist/timeline/item/timeline-item.d.ts +18 -24
  142. package/dist/timeline/root/timeline-root.d.ts +13 -21
  143. package/dist/toast/item/toast-item.d.ts +21 -22
  144. package/dist/toast/root/toast-root.d.ts +18 -23
  145. package/dist/toggle/group/toggle-group.d.ts +23 -25
  146. package/dist/toggle/root/toggle-root.d.ts +8 -8
  147. package/dist/toolbar/root/toolbar-root.d.ts +7 -10
  148. package/dist/tooltip/root/tooltip-root.d.ts +41 -47
  149. package/dist/tour/root/tour-root.d.ts +24 -26
  150. package/dist/tour/stop/tour-stop.d.ts +39 -48
  151. package/dist/tree/item/tree-item.d.ts +23 -25
  152. package/dist/tree/root/tree-root.d.ts +13 -12
  153. package/dist/trend/root/trend-root.d.ts +18 -19
  154. package/dist/video/root/video-root.d.ts +108 -101
  155. package/dist/video-playlist/item/video-playlist-item.d.ts +23 -28
  156. package/dist/video-playlist/menu/video-playlist-menu.d.ts +17 -21
  157. package/dist/video-playlist/root/video-playlist-root.d.ts +21 -25
  158. package/dist/virtual-list/root/virtual-list-root.d.ts +27 -26
  159. package/package.json +5 -5
  160. package/types/jsx.d.ts +10363 -9520
  161. package/types/svelte.d.ts +5 -0
  162. package/types/vue.d.ts +1440 -1032
@@ -7,12 +7,20 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
7
7
  import { customElement, HelixElement, HelixMapPartChangeEvent } from '@fusion.dev/helix-core';
8
8
  import { html, nothing } from 'lit';
9
9
  import { property, state } from 'lit/decorators.js';
10
- const BOOKKEEPING = new Set(['current', 'fanned', 'gathered', 'gatheredBy', 'side']);
10
+ const BOOKKEEPING = new Set([
11
+ 'behind',
12
+ 'current',
13
+ 'fanned',
14
+ 'gathered',
15
+ 'gatheredBy',
16
+ 'side',
17
+ ]);
11
18
  let HelixHeadlessMapMarker = class HelixHeadlessMapMarker extends HelixElement {
12
19
  constructor() {
13
20
  super(...arguments);
14
21
  this.current = false;
15
22
  this.gathered = [];
23
+ this.behind = false;
16
24
  this.fanned = false;
17
25
  this.gatheredBy = undefined;
18
26
  this.isMapMarker = true;
@@ -23,6 +31,7 @@ let HelixHeadlessMapMarker = class HelixHeadlessMapMarker extends HelixElement {
23
31
  }
24
32
  willUpdate(changed) {
25
33
  super.willUpdate(changed);
34
+ this.toggleState('behind', this.behind);
26
35
  this.toggleState('cluster', this.gathered.length > 1);
27
36
  this.toggleState('clustered', this.gatheredBy !== undefined);
28
37
  this.toggleState('current', this.current);
@@ -64,6 +73,9 @@ __decorate([
64
73
  __decorate([
65
74
  state()
66
75
  ], HelixHeadlessMapMarker.prototype, "gathered", void 0);
76
+ __decorate([
77
+ state()
78
+ ], HelixHeadlessMapMarker.prototype, "behind", void 0);
67
79
  __decorate([
68
80
  state()
69
81
  ], HelixHeadlessMapMarker.prototype, "fanned", void 0);
@@ -1,6 +1,6 @@
1
1
  import { HelixElement } from '@fusion.dev/helix-core';
2
2
  import { nothing, type PropertyValues, type TemplateResult } from 'lit';
3
- /** A place in a points layer, where it is written as a list rather than GeoJSON. */
3
+ /** A place in a points layer, written as an object with coordinates and an optional name. */
4
4
  export interface MapPointsPlace {
5
5
  /** What pressing it reports, where it is not its label. */
6
6
  id?: string | number | undefined;
@@ -88,6 +88,12 @@ export declare class HelixHeadlessMapPoints extends HelixElement {
88
88
  * the frame's list.
89
89
  */
90
90
  description?: string;
91
+ /**
92
+ * A name this layer shares with other layers, such as a route and its
93
+ * dotted legs. The layers menu shows layers in the same group as one entry,
94
+ * named by the first of them, and its checkbox shows or hides them all.
95
+ */
96
+ group?: string;
91
97
  /** Marks this as a layer for the frame and the connector, whatever its tag. */
92
98
  readonly isMapLayer = true;
93
99
  /** The layer's name, used in the frame's list. */
@@ -137,6 +137,9 @@ __decorate([
137
137
  __decorate([
138
138
  property()
139
139
  ], HelixHeadlessMapPoints.prototype, "description", void 0);
140
+ __decorate([
141
+ property()
142
+ ], HelixHeadlessMapPoints.prototype, "group", void 0);
140
143
  __decorate([
141
144
  property()
142
145
  ], HelixHeadlessMapPoints.prototype, "label", void 0);
@@ -0,0 +1,84 @@
1
+ import { HelixElement } from '@fusion.dev/helix-core';
2
+ import { nothing, type PropertyValues } from 'lit';
3
+ /**
4
+ * @summary Map tiles laid over a map, such as weather radar.
5
+ *
6
+ * @description
7
+ * `connectMap` draws the tiles over the map's land and roads, and under its
8
+ * routes, areas, and place names. Set `ground` to draw them under the roads
9
+ * as well, for imagery of the ground, such as satellite or aerial photographs.
10
+ * Set `max-zoom` to the deepest zoom the provider has tiles for, and the map
11
+ * enlarges those tiles past it. Set `src` to one tile URL with `{z}`, `{x}`,
12
+ * and `{y}` in it, or set `frames` to several, such as the last hour of radar.
13
+ * While `playing` is set, the layer shows the frames in order, `interval`
14
+ * milliseconds each, and starts again from the first.
15
+ *
16
+ * The frames do not play while the user has asked for reduced motion, and the
17
+ * layer shows its last frame. Content that moves for more than five seconds
18
+ * needs a way to pause it, so give `playing` a control on your page.
19
+ *
20
+ * Put the tile provider's credit in `attribution`. The frame shows it beside
21
+ * the map's own credit.
22
+ *
23
+ * @since 0.105.0
24
+ * @status experimental
25
+ * @category media
26
+ * @aliases Weather radar, Tile overlay, Raster layer
27
+ * @documentation https://fusion.dev/helix/components/map
28
+ *
29
+ * @event {HelixMapPartChangeEvent} helix-map-part-change - The tiles, the frame shown, the opacity, or where the tiles are drawn changed. Used by `connectMap`; pages do not need to listen for it.
30
+ */
31
+ export declare class HelixHeadlessMapRaster extends HelixElement {
32
+ /** The tile provider's credit, shown in the frame's footer. Links in it stay links. */
33
+ attribution?: string;
34
+ /** More about the layer. Read after the label in the frame's list. */
35
+ description?: string;
36
+ /** Which of `frames` shows, counting from `0`. Starts at the last frame. */
37
+ frame?: number;
38
+ /** Tile URLs to show in order, one per frame, as a list separated by spaces. */
39
+ frames?: string[];
40
+ /**
41
+ * Draws the tiles as the ground, under the map's roads and place names, for
42
+ * imagery such as satellite photographs.
43
+ */
44
+ ground: boolean;
45
+ /**
46
+ * A name this layer shares with other layers, such as a route and its
47
+ * dotted legs. The layers menu shows layers in the same group as one entry,
48
+ * named by the first of them, and its checkbox shows or hides them all.
49
+ */
50
+ group?: string;
51
+ /** How long each frame shows while `playing`, in milliseconds. */
52
+ interval: number;
53
+ /** Marks this as a layer for the frame and the connector, whatever its tag. */
54
+ readonly isMapLayer = true;
55
+ /** @internal Which kind of layer, which is how the connector draws it. */
56
+ readonly layerKind: 'raster';
57
+ /** The layer's name in the frame's list. */
58
+ label?: string;
59
+ /**
60
+ * The deepest zoom the provider has tiles for. The map enlarges those tiles
61
+ * at deeper zooms, where it would otherwise ask for tiles that do not exist.
62
+ */
63
+ maxZoom?: number;
64
+ /** How opaque the tiles are, from `0` to `1`. */
65
+ opacity: number;
66
+ /** Whether the frames play in order. Has no effect with one frame, or under reduced motion. */
67
+ playing: boolean;
68
+ /** One tile URL with `{z}`, `{x}`, and `{y}` in it, for a layer of one frame. */
69
+ src?: string;
70
+ /** The timer that moves to the next frame while playing. */
71
+ private timer;
72
+ disconnectedCallback(): void;
73
+ private stopTimer;
74
+ /** Starts or stops the timer when the frames, the interval, or `playing` change. */
75
+ private schedule;
76
+ /** Tells the frame and the connector the layer changed, and keeps the timer in step. */
77
+ protected updated(changed: PropertyValues): void;
78
+ protected render(): typeof nothing;
79
+ }
80
+ declare global {
81
+ interface HTMLElementTagNameMap {
82
+ 'helix-headless-map-raster': HelixHeadlessMapRaster;
83
+ }
84
+ }
@@ -0,0 +1,96 @@
1
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
2
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
3
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
4
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
5
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
6
+ };
7
+ import { customElement, HelixElement, HelixMapPartChangeEvent } from '@fusion.dev/helix-core';
8
+ import { nothing } from 'lit';
9
+ import { property } from 'lit/decorators.js';
10
+ const framesConverter = {
11
+ fromAttribute: (value) => value === null ? undefined : value.split(/\s+/).filter((one) => one !== ''),
12
+ toAttribute: (value) => value?.join(' ') ?? null,
13
+ };
14
+ let HelixHeadlessMapRaster = class HelixHeadlessMapRaster extends HelixElement {
15
+ constructor() {
16
+ super(...arguments);
17
+ this.ground = false;
18
+ this.interval = 600;
19
+ this.isMapLayer = true;
20
+ this.layerKind = 'raster';
21
+ this.opacity = 0.7;
22
+ this.playing = false;
23
+ }
24
+ disconnectedCallback() {
25
+ super.disconnectedCallback();
26
+ this.stopTimer();
27
+ }
28
+ stopTimer() {
29
+ if (this.timer !== undefined) {
30
+ clearInterval(this.timer);
31
+ this.timer = undefined;
32
+ }
33
+ }
34
+ schedule() {
35
+ this.stopTimer();
36
+ const count = this.frames?.length ?? 0;
37
+ const reduced = globalThis.matchMedia?.('(prefers-reduced-motion: reduce)').matches ?? false;
38
+ if (!this.playing || count < 2 || reduced) {
39
+ return;
40
+ }
41
+ this.timer = setInterval(() => {
42
+ const at = this.frame ?? count - 1;
43
+ this.frame = (at + 1) % count;
44
+ }, Math.max(100, this.interval));
45
+ }
46
+ updated(changed) {
47
+ super.updated(changed);
48
+ if (changed.has('playing') || changed.has('frames') || changed.has('interval')) {
49
+ this.schedule();
50
+ }
51
+ this.dispatchEvent(new HelixMapPartChangeEvent({ kind: 'layer' }));
52
+ }
53
+ render() {
54
+ return nothing;
55
+ }
56
+ };
57
+ __decorate([
58
+ property()
59
+ ], HelixHeadlessMapRaster.prototype, "attribution", void 0);
60
+ __decorate([
61
+ property()
62
+ ], HelixHeadlessMapRaster.prototype, "description", void 0);
63
+ __decorate([
64
+ property({ type: Number })
65
+ ], HelixHeadlessMapRaster.prototype, "frame", void 0);
66
+ __decorate([
67
+ property({ converter: framesConverter })
68
+ ], HelixHeadlessMapRaster.prototype, "frames", void 0);
69
+ __decorate([
70
+ property({ type: Boolean })
71
+ ], HelixHeadlessMapRaster.prototype, "ground", void 0);
72
+ __decorate([
73
+ property()
74
+ ], HelixHeadlessMapRaster.prototype, "group", void 0);
75
+ __decorate([
76
+ property({ type: Number })
77
+ ], HelixHeadlessMapRaster.prototype, "interval", void 0);
78
+ __decorate([
79
+ property()
80
+ ], HelixHeadlessMapRaster.prototype, "label", void 0);
81
+ __decorate([
82
+ property({ attribute: 'max-zoom', type: Number })
83
+ ], HelixHeadlessMapRaster.prototype, "maxZoom", void 0);
84
+ __decorate([
85
+ property({ type: Number })
86
+ ], HelixHeadlessMapRaster.prototype, "opacity", void 0);
87
+ __decorate([
88
+ property({ type: Boolean })
89
+ ], HelixHeadlessMapRaster.prototype, "playing", void 0);
90
+ __decorate([
91
+ property()
92
+ ], HelixHeadlessMapRaster.prototype, "src", void 0);
93
+ HelixHeadlessMapRaster = __decorate([
94
+ customElement('helix-headless-map-raster')
95
+ ], HelixHeadlessMapRaster);
96
+ export { HelixHeadlessMapRaster };
@@ -7,19 +7,51 @@ import { nothing, type PropertyValues, type TemplateResult } from 'lit';
7
7
  * imported this before the surface was shared still has it.
8
8
  */
9
9
  export type MapControlsPlacement = ViewportControlsPlacement;
10
+ /** How the map draws the ground: the themed map, imagery under its roads and names, or imagery alone. */
11
+ export type MapType = 'hybrid' | 'satellite' | 'standard';
10
12
  declare const HelixHeadlessMap_base: (new (...args: any[]) => import("@fusion.dev/helix-core").ViewportElement) & typeof HelixElement;
11
13
  /**
12
14
  * @summary A frame around a map drawn by another library.
13
15
  *
14
16
  * @description
15
17
  * Wraps a map drawn by MapLibre, Leaflet, or another renderer. The frame adds
16
- * a name for the map, pan and zoom buttons, a fullscreen button, and a strip
17
- * for the map credit. Helix does not draw the map itself.
18
+ * a name for the map, a column of controls, and a strip for the map credit.
19
+ * Helix does not draw the map itself.
20
+ *
21
+ * The controls are one column, and `controls` names which ones: `fullscreen`,
22
+ * `layers`, `tilt`, `zoom`, and `compass`, top to bottom. `zoom compass
23
+ * fullscreen` by default. The compass's needle points north as the map turns,
24
+ * and pressing it turns the map to face north.
25
+ *
26
+ * Add `pan` and `rotate` for buttons around the compass that move and turn the
27
+ * map. Dragging is otherwise the only way a pointer moves the map, so add them
28
+ * where the map has to be usable without dragging, as WCAG 2.2 asks at level
29
+ * AA. The arrow keys pan the map and Shift with Left or Right turns it either
30
+ * way.
18
31
  *
19
32
  * The pan and zoom buttons and the arrow keys send `helix-map-pan` and
20
33
  * `helix-map-zoom`. Move your map in response, or connect it with
21
34
  * `connectMap` from `@fusion.dev/helix-map`, which does this for you.
22
35
  *
36
+ * Add `tilt` to `controls` for the 3D button, which a map with 3D buildings
37
+ * or terrain needs. It is a toggle. Pressed, it tilts the map 50 degrees, and
38
+ * `connectMap` raises the buildings and the ground. Pressed again, it makes the
39
+ * map flat, and lays them flat too. Shift with Up or Down tilts the map in
40
+ * steps. Turning and tilting send `helix-map-rotate` and `helix-map-tilt`,
41
+ * which `connectMap` answers on MapLibre. Leaflet draws maps flat and does not
42
+ * rotate.
43
+ *
44
+ * Add `layers` to `controls` for a layers button. It opens a menu with a tile
45
+ * for each layer, which sets the layer's `hidden` attribute. Layers with the
46
+ * same `group`, such as a route and its dotted legs, share one tile.
47
+ *
48
+ * Imagery, a `helix-map-raster` with `ground`, is a map type and not a tile.
49
+ * The menu opens with a card for each type, Standard, Hybrid, and Satellite,
50
+ * with a picture of the map in it, and `map-type` says which is chosen.
51
+ * Standard hides the imagery, Hybrid draws it under the roads and names, and
52
+ * Satellite draws it alone. `connectMap` does not draw a hidden layer, so a layer you write with
53
+ * `hidden` starts turned off.
54
+ *
23
55
  * Markers, routes, areas, live positions, and points layers go inside the
24
56
  * frame as child elements.
25
57
  *
@@ -38,48 +70,130 @@ declare const HelixHeadlessMap_base: (new (...args: any[]) => import("@fusion.de
38
70
  * @event {HelixMapClusterEvent} helix-map-cluster - A cluster was pressed. Sent from the marker that shows the cluster, with the names of its places.
39
71
  * @event {HelixMapPanEvent} helix-map-pan - A pan button or arrow key was pressed. Move your map in response.
40
72
  * @event {HelixMapPartChangeEvent} helix-map-part-change - Clustering was turned on or off. Used by `connectMap`; pages do not need to listen for it.
73
+ * @event {HelixMapRotateEvent} helix-map-rotate - A rotate or Face north button, or Shift with Left or Right, was pressed. Turn your map in response.
74
+ * @event {HelixMapTiltEvent} helix-map-tilt - The 3D button, or Shift with Up or Down, was pressed. Tilt your map in response.
41
75
  * @event {HelixMapZoomEvent} helix-map-zoom - A zoom button or key was pressed, with a direction. Zoom your map in response.
42
76
  *
43
77
  * @csspart attribution - The strip under the map that holds the credit.
44
- * @csspart controls - The group of pan and zoom buttons.
78
+ * @csspart compass - The compass and the pan and rotate buttons around it.
79
+ * @csspart controls - The column of buttons that move the map.
80
+ * @csspart face-north - The compass: its needle points north as the map turns, and pressing it turns the map to face north.
45
81
  * @csspart footer - The strip below the map.
46
82
  * @csspart fullscreen - The button that makes the map fill the screen.
47
83
  * @csspart header - The strip above the map.
48
- * @csspart layer - One entry in the list of routes, areas, and points layers.
49
- * @csspart layers - The list of routes, areas, and points layers, read by screen readers.
84
+ * @csspart layer - One entry in the list of the map's layers.
85
+ * @csspart layer-choice - One layer's tile in the layers menu, pressed while the layer is shown.
86
+ * @csspart layer-choices - The layer tiles in the layers menu, under the map types.
87
+ * @csspart layer-icon - The picture on a layer's tile, drawn for its kind: a line for a route, a peak for terrain.
88
+ * @csspart layer-name - The name on a layer's tile.
89
+ * @csspart layers - The list of the map's shown layers, such as routes, areas, and points, read by screen readers.
90
+ * @csspart layers-menu - The menu of the map's layers, which the layers button opens.
91
+ * @csspart layers-toggle - The button that opens and closes the layers menu.
92
+ * @csspart map-type - One map type's card in the layers menu: a radio button, its picture, and its name.
93
+ * @csspart map-type-name - The name on a map type's card.
94
+ * @csspart map-type-preview - The picture of the map on a map type's card.
95
+ * @csspart map-types - The map-type cards at the top of the layers menu, where the map has imagery.
96
+ * @csspart needle - The compass needle, turned to point north.
50
97
  * @csspart pan-down - The button that pans the map down.
51
98
  * @csspart pan-end - The button that pans toward the end of a line of text: right in English.
52
99
  * @csspart pan-start - The button that pans toward the start of a line of text: left in English.
53
100
  * @csspart pan-up - The button that pans the map up.
54
101
  * @csspart region - The named region the map sits in.
102
+ * @csspart rotate-left - The button that turns the map counterclockwise.
103
+ * @csspart rotate-right - The button that turns the map clockwise.
104
+ * @csspart tilt - The 3D button, which tilts the map and makes it flat again. Pressed while the map is tilted.
55
105
  * @csspart viewport - The box the map is drawn in.
56
106
  * @csspart zoom-in - The button that zooms in.
57
107
  * @csspart zoom-out - The button that zooms out.
58
108
  *
109
+ * @cssproperty --map-needle-turn - How far the needle turns to point north, as an angle. The frame writes it from `bearing`.
110
+ *
59
111
  * @cssstate fullscreen - The map fills the screen.
60
112
  * @cssstate idle - The user has been still long enough for the header and footer to fade.
61
113
  */
62
114
  export declare class HelixHeadlessMap extends HelixHeadlessMap_base {
115
+ /**
116
+ * The map's rotation, in degrees clockwise from north. `connectMap` keeps it
117
+ * current, and the Face north button's needle turns with it.
118
+ */
119
+ bearing: number;
63
120
  /**
64
121
  * Combines markers that would overlap into one count. Counts split apart as
65
122
  * the map zooms in, and pressing one zooms in to its places.
66
123
  */
67
124
  cluster: boolean;
125
+ /** The Face north button's label. */
126
+ faceNorthLabel: string;
127
+ /** The Hybrid map type's name. */
128
+ hybridLabel: string;
68
129
  /**
69
130
  * The map's name, read by screen readers. Name the place, such as "Delivery
70
131
  * area", so that several maps on one page can be told apart. Required.
71
132
  */
72
133
  label: string;
73
134
  /**
74
- * The name of the list of routes, areas, and points layers, read by screen
75
- * readers.
135
+ * The name of the layers button and menu, and of the list of the map's
136
+ * layers, such as routes, areas, and points, read by screen readers.
76
137
  */
77
138
  layersLabel: string;
139
+ /**
140
+ * @internal Pictures of the map in each map type, written by the connector
141
+ * when the layers menu opens.
142
+ */
143
+ mapPreviews: Partial<Record<MapType, string>>;
144
+ /**
145
+ * How the map draws the ground, where it has imagery: `hybrid` for imagery
146
+ * under the roads and names, and `satellite` for imagery alone. Absent is
147
+ * the standard, themed map. The layers menu chooses it.
148
+ */
149
+ mapType?: 'hybrid' | 'satellite' | undefined;
150
+ /** The name of the map types in the layers menu, read by screen readers. */
151
+ mapTypeLabel: string;
152
+ /**
153
+ * How far the map is tilted, in degrees from looking straight down.
154
+ * `connectMap` keeps it current, and the 3D button is pressed while it is
155
+ * above `0`.
156
+ */
157
+ pitch: number;
158
+ /** The rotate left button's label. */
159
+ rotateLeftLabel: string;
160
+ /** The rotate right button's label. */
161
+ rotateRightLabel: string;
162
+ /** The Satellite map type's name. */
163
+ satelliteLabel: string;
164
+ /** The Standard map type's name. */
165
+ standardLabel: string;
166
+ /** The 3D button's label. */
167
+ tiltLabel: string;
78
168
  /**
79
169
  * The routes and areas among the frame's children, in the order they are
80
170
  * written, which is the order the list names them in.
81
171
  */
82
172
  private get layers();
173
+ /** Whether the layers menu is open. */
174
+ private layersOpen;
175
+ private hiding?;
176
+ /** Closes the layers menu on a press anywhere outside the frame. */
177
+ private readonly handleOutside;
178
+ /**
179
+ * Keys pressed in the layers menu. Escape closes it and returns to its
180
+ * button, and no key reaches the region, where the arrows would pan the map.
181
+ */
182
+ private readonly handleMenuKeydown;
183
+ /**
184
+ * The imagery among the layers: raster layers drawn as the ground, which the
185
+ * map types show and hide rather than a tile of their own.
186
+ */
187
+ private get imagery();
188
+ /** A map type's name on its card. */
189
+ private nameOf;
190
+ /** Shows or hides layers, which `connectMap` draws or takes off the map. */
191
+ private showLayers;
192
+ /**
193
+ * The layers menu's entries, in the order the layers are written: a layer
194
+ * of its own, or every layer in a group, at the place of the first.
195
+ */
196
+ private get layerEntries();
83
197
  /**
84
198
  * A route or area renamed, or its description changed, which the list says
85
199
  * and a slot change does not report.
@@ -123,6 +237,54 @@ export declare class HelixHeadlessMap extends HelixHeadlessMap_base {
123
237
  * keyboard cannot reach, and every one at `0` is a Tab press per place.
124
238
  */
125
239
  protected updated(changed: PropertyValues): void;
240
+ /** Turns the map by some degrees, clockwise where positive. */
241
+ rotate(by: number): void;
242
+ /** Turns the map to face north. */
243
+ faceNorth(): void;
244
+ /** Tilts the map by some degrees, toward the horizon where positive. */
245
+ tilt(by: number): void;
246
+ /** Tilts the map to some degrees from looking straight down. `0` makes it flat. */
247
+ tiltTo(to: number): void;
248
+ /**
249
+ * The layers button and its menu: a tile for each layer or group, in the
250
+ * order they are written, with its picture and name, pressed while it is
251
+ * shown. A group's tile is pressed while any of its layers is shown.
252
+ */
253
+ private renderLayersMenu;
254
+ /**
255
+ * The map types, as cards with a picture of the map in each: Standard,
256
+ * Hybrid, and Satellite. One is chosen, so they are radio buttons, and the
257
+ * arrow keys move between them as a group of radios does.
258
+ */
259
+ private renderMapTypes;
260
+ /**
261
+ * The compass, and the pan and rotate buttons around it where `controls`
262
+ * names them.
263
+ *
264
+ * **One control for which way the map faces and where it goes.** The needle
265
+ * turns with the map and points north; pressing it turns the map back. The
266
+ * arrows around it are the way to move and turn the map without dragging,
267
+ * which a pointer otherwise needs.
268
+ */
269
+ private renderCompass;
270
+ /**
271
+ * The controls, in one column in the order they are read: fullscreen, the
272
+ * layers, 3D, zoom, and the compass with the arrows round it, last, where
273
+ * the room its arrows take is below the column and not inside it.
274
+ *
275
+ * **Drawn here, not by the surface**, which lays its pad out for a board:
276
+ * a map's arrows belong round its compass, and the reading order is the
277
+ * column's, top to bottom.
278
+ */
279
+ protected renderControls(): TemplateResult | typeof nothing;
280
+ /** The controls the map draws while `controls` is absent. */
281
+ protected get restingControls(): string;
282
+ /** Whether the compass is drawn: named, or asked for by the arrows round it. */
283
+ private get drawsCompass();
284
+ /** The keys the region answers, which the compass and `tilt` add to. */
285
+ private get keyShortcuts();
286
+ /** Shift with the arrow keys: left and right rotate, and up and down tilt in steps. */
287
+ protected handleMoreKeys(event: KeyboardEvent): boolean;
126
288
  /** The events this family names, the surface naming none of its own. */
127
289
  protected panEvent(detail: ViewportPanDetail): Event;
128
290
  protected zoomEvent(detail: ViewportZoomDetail): Event;