@fusion.dev/helix-headless 0.101.0 → 0.102.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/custom-elements.json +748 -0
- package/dist/element-events.generated.js +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/dist/map/index.d.ts +1 -0
- package/dist/map/index.js +1 -0
- package/dist/map/root/map-root.d.ts +142 -0
- package/dist/map/root/map-root.js +161 -0
- package/package.json +5 -5
- package/types/jsx.d.ts +376 -0
- package/types/svelte.d.ts +1 -0
- package/types/vue.d.ts +79 -0
package/types/jsx.d.ts
CHANGED
|
@@ -81,6 +81,7 @@ import type {
|
|
|
81
81
|
HelixHeadlessListItem,
|
|
82
82
|
HelixHeadlessListbox,
|
|
83
83
|
HelixHeadlessLoader,
|
|
84
|
+
HelixHeadlessMap,
|
|
84
85
|
HelixHeadlessMegamenu,
|
|
85
86
|
HelixHeadlessMenu,
|
|
86
87
|
HelixHeadlessMenuItem,
|
|
@@ -150,6 +151,8 @@ import type {
|
|
|
150
151
|
HelixHeadlessVideoPlaylistMenu,
|
|
151
152
|
HelixHeadlessVirtualList,
|
|
152
153
|
HelixHistoryEvent,
|
|
154
|
+
HelixMapPanEvent,
|
|
155
|
+
HelixMapZoomEvent,
|
|
153
156
|
HelixNavigateEvent,
|
|
154
157
|
HelixNextEvent,
|
|
155
158
|
HelixPreviousEvent,
|
|
@@ -9380,6 +9383,134 @@ export type HelixHeadlessLoaderSolidJsProps = {
|
|
|
9380
9383
|
textContent?: (string | number) | undefined;
|
|
9381
9384
|
};
|
|
9382
9385
|
|
|
9386
|
+
/** `HelixHeadlessMap` component event */
|
|
9387
|
+
export type HelixHeadlessMapElementEvent<E = Event> = TypedEvent<
|
|
9388
|
+
HelixHeadlessMap,
|
|
9389
|
+
E
|
|
9390
|
+
>;
|
|
9391
|
+
/** `helix-map-pan` event type */
|
|
9392
|
+
export type HelixHeadlessMapHelixMapPanElementEvent =
|
|
9393
|
+
HelixHeadlessMapElementEvent<HelixMapPanEvent>;
|
|
9394
|
+
/** `helix-map-zoom` event type */
|
|
9395
|
+
export type HelixHeadlessMapHelixMapZoomElementEvent =
|
|
9396
|
+
HelixHeadlessMapElementEvent<HelixMapZoomEvent>;
|
|
9397
|
+
|
|
9398
|
+
export type HelixHeadlessMapProps = {
|
|
9399
|
+
/** What the control that fills the screen is called. */
|
|
9400
|
+
"fullscreen-label"?: (HelixHeadlessMap["fullscreenLabel"]) | undefined;
|
|
9401
|
+
/** What the control that fills the screen is called. */
|
|
9402
|
+
fullscreenLabel?: (HelixHeadlessMap["fullscreenLabel"]) | undefined;
|
|
9403
|
+
/** How long the reader may be still before the chrome hides, in milliseconds.
|
|
9404
|
+
|
|
9405
|
+
Zero keeps it up, which is the default: a map's controls are how a keyboard
|
|
9406
|
+
reader operates it, and chrome that hides itself by default would be this
|
|
9407
|
+
component undoing its own argument. Set it for a display map nobody drives. */
|
|
9408
|
+
"idle-delay"?: (HelixHeadlessMap["idleDelay"] | `${number}`) | undefined;
|
|
9409
|
+
/** How long the reader may be still before the chrome hides, in milliseconds.
|
|
9410
|
+
|
|
9411
|
+
Zero keeps it up, which is the default: a map's controls are how a keyboard
|
|
9412
|
+
reader operates it, and chrome that hides itself by default would be this
|
|
9413
|
+
component undoing its own argument. Set it for a display map nobody drives. */
|
|
9414
|
+
idleDelay?: (HelixHeadlessMap["idleDelay"]) | undefined;
|
|
9415
|
+
/** Accessible name for the map, which is the one thing a consumer must write.
|
|
9416
|
+
|
|
9417
|
+
There is no sensible default. "Map" names the widget rather than the place,
|
|
9418
|
+
and a reader meeting three of them on a page learns nothing from hearing the
|
|
9419
|
+
same word three times. */
|
|
9420
|
+
label?: (HelixHeadlessMap["label"]) | undefined;
|
|
9421
|
+
/** What the controls are called, for a page not in English. */
|
|
9422
|
+
"pan-label"?: (HelixHeadlessMap["panLabel"]) | undefined;
|
|
9423
|
+
/** What the controls are called, for a page not in English. */
|
|
9424
|
+
panLabel?: (HelixHeadlessMap["panLabel"]) | undefined;
|
|
9425
|
+
/** How far one press moves the map, as a fraction of what is on screen.
|
|
9426
|
+
|
|
9427
|
+
A fraction rather than a distance, because this frame does not know the
|
|
9428
|
+
scale of what is inside it: a quarter of the viewport is the same gesture at
|
|
9429
|
+
street level and at country level, and a consumer who wants metres can
|
|
9430
|
+
multiply by their own. */
|
|
9431
|
+
"pan-step"?: (HelixHeadlessMap["panStep"] | `${number}`) | undefined;
|
|
9432
|
+
/** How far one press moves the map, as a fraction of what is on screen.
|
|
9433
|
+
|
|
9434
|
+
A fraction rather than a distance, because this frame does not know the
|
|
9435
|
+
scale of what is inside it: a quarter of the viewport is the same gesture at
|
|
9436
|
+
street level and at country level, and a consumer who wants metres can
|
|
9437
|
+
multiply by their own. */
|
|
9438
|
+
panStep?: (HelixHeadlessMap["panStep"]) | undefined;
|
|
9439
|
+
/** What the zoom controls are called. */
|
|
9440
|
+
"zoom-in-label"?: (HelixHeadlessMap["zoomInLabel"]) | undefined;
|
|
9441
|
+
/** What the zoom controls are called. */
|
|
9442
|
+
zoomInLabel?: (HelixHeadlessMap["zoomInLabel"]) | undefined;
|
|
9443
|
+
/** What the zoom control that goes the other way is called. */
|
|
9444
|
+
"zoom-out-label"?: (HelixHeadlessMap["zoomOutLabel"]) | undefined;
|
|
9445
|
+
/** What the zoom control that goes the other way is called. */
|
|
9446
|
+
zoomOutLabel?: (HelixHeadlessMap["zoomOutLabel"]) | undefined;
|
|
9447
|
+
|
|
9448
|
+
/** The reader asked the map to move. Answer it against your own map. */
|
|
9449
|
+
"onhelix-map-pan"?: ((e: HelixHeadlessMapHelixMapPanElementEvent) => void) | undefined;
|
|
9450
|
+
/** The reader asked the map to zoom, by a direction rather than to a level. */
|
|
9451
|
+
"onhelix-map-zoom"?: ((e: HelixHeadlessMapHelixMapZoomElementEvent) => void) | undefined;
|
|
9452
|
+
};
|
|
9453
|
+
|
|
9454
|
+
export type HelixHeadlessMapSolidJsProps = {
|
|
9455
|
+
/** What the control that fills the screen is called. */
|
|
9456
|
+
"attr:fullscreen-label"?: (HelixHeadlessMap["fullscreenLabel"]) | undefined;
|
|
9457
|
+
/** What the control that fills the screen is called. */
|
|
9458
|
+
"prop:fullscreenLabel"?: (HelixHeadlessMap["fullscreenLabel"]) | undefined;
|
|
9459
|
+
/** How long the reader may be still before the chrome hides, in milliseconds.
|
|
9460
|
+
|
|
9461
|
+
Zero keeps it up, which is the default: a map's controls are how a keyboard
|
|
9462
|
+
reader operates it, and chrome that hides itself by default would be this
|
|
9463
|
+
component undoing its own argument. Set it for a display map nobody drives. */
|
|
9464
|
+
"attr:idle-delay"?: (HelixHeadlessMap["idleDelay"] | `${number}`) | undefined;
|
|
9465
|
+
/** How long the reader may be still before the chrome hides, in milliseconds.
|
|
9466
|
+
|
|
9467
|
+
Zero keeps it up, which is the default: a map's controls are how a keyboard
|
|
9468
|
+
reader operates it, and chrome that hides itself by default would be this
|
|
9469
|
+
component undoing its own argument. Set it for a display map nobody drives. */
|
|
9470
|
+
"prop:idleDelay"?: (HelixHeadlessMap["idleDelay"]) | undefined;
|
|
9471
|
+
/** Accessible name for the map, which is the one thing a consumer must write.
|
|
9472
|
+
|
|
9473
|
+
There is no sensible default. "Map" names the widget rather than the place,
|
|
9474
|
+
and a reader meeting three of them on a page learns nothing from hearing the
|
|
9475
|
+
same word three times. */
|
|
9476
|
+
"prop:label"?: (HelixHeadlessMap["label"]) | undefined;
|
|
9477
|
+
/** What the controls are called, for a page not in English. */
|
|
9478
|
+
"attr:pan-label"?: (HelixHeadlessMap["panLabel"]) | undefined;
|
|
9479
|
+
/** What the controls are called, for a page not in English. */
|
|
9480
|
+
"prop:panLabel"?: (HelixHeadlessMap["panLabel"]) | undefined;
|
|
9481
|
+
/** How far one press moves the map, as a fraction of what is on screen.
|
|
9482
|
+
|
|
9483
|
+
A fraction rather than a distance, because this frame does not know the
|
|
9484
|
+
scale of what is inside it: a quarter of the viewport is the same gesture at
|
|
9485
|
+
street level and at country level, and a consumer who wants metres can
|
|
9486
|
+
multiply by their own. */
|
|
9487
|
+
"attr:pan-step"?: (HelixHeadlessMap["panStep"] | `${number}`) | undefined;
|
|
9488
|
+
/** How far one press moves the map, as a fraction of what is on screen.
|
|
9489
|
+
|
|
9490
|
+
A fraction rather than a distance, because this frame does not know the
|
|
9491
|
+
scale of what is inside it: a quarter of the viewport is the same gesture at
|
|
9492
|
+
street level and at country level, and a consumer who wants metres can
|
|
9493
|
+
multiply by their own. */
|
|
9494
|
+
"prop:panStep"?: (HelixHeadlessMap["panStep"]) | undefined;
|
|
9495
|
+
/** What the zoom controls are called. */
|
|
9496
|
+
"attr:zoom-in-label"?: (HelixHeadlessMap["zoomInLabel"]) | undefined;
|
|
9497
|
+
/** What the zoom controls are called. */
|
|
9498
|
+
"prop:zoomInLabel"?: (HelixHeadlessMap["zoomInLabel"]) | undefined;
|
|
9499
|
+
/** What the zoom control that goes the other way is called. */
|
|
9500
|
+
"attr:zoom-out-label"?: (HelixHeadlessMap["zoomOutLabel"]) | undefined;
|
|
9501
|
+
/** What the zoom control that goes the other way is called. */
|
|
9502
|
+
"prop:zoomOutLabel"?: (HelixHeadlessMap["zoomOutLabel"]) | undefined;
|
|
9503
|
+
/** The reader asked the map to move. Answer it against your own map. */
|
|
9504
|
+
"on:helix-map-pan"?: ((e: HelixHeadlessMapHelixMapPanElementEvent) => void) | undefined;
|
|
9505
|
+
/** The reader asked the map to zoom, by a direction rather than to a level. */
|
|
9506
|
+
"on:helix-map-zoom"?: ((e: HelixHeadlessMapHelixMapZoomElementEvent) => void) | undefined;
|
|
9507
|
+
|
|
9508
|
+
/** Set the innerHTML of the element */
|
|
9509
|
+
innerHTML?: (string) | undefined;
|
|
9510
|
+
/** Set the textContent of the element */
|
|
9511
|
+
textContent?: (string | number) | undefined;
|
|
9512
|
+
};
|
|
9513
|
+
|
|
9383
9514
|
/** `HelixHeadlessMegamenu` component event */
|
|
9384
9515
|
export type HelixHeadlessMegamenuElementEvent<E = Event> = TypedEvent<
|
|
9385
9516
|
HelixHeadlessMegamenu,
|
|
@@ -27354,6 +27485,127 @@ export type CustomElements = {
|
|
|
27354
27485
|
HelixHeadlessLoaderProps & BaseProps<HelixHeadlessLoader> & BaseEvents<HelixHeadlessLoader>
|
|
27355
27486
|
>;
|
|
27356
27487
|
|
|
27488
|
+
/**
|
|
27489
|
+
* **Helix draws no map.** There are no tiles here, no projection and no
|
|
27490
|
+
* network, and there should not be: a tile renderer is a library, and what a
|
|
27491
|
+
* design system can add to MapLibre or Leaflet is the frame. The consumer slots
|
|
27492
|
+
* their map and this owns the box, the name, the controls and the way out,
|
|
27493
|
+
* which is the shape `VideoPlaylist` uses for a player it never renders.
|
|
27494
|
+
*
|
|
27495
|
+
* **The accessibility argument is the reason this exists**, and it was measured
|
|
27496
|
+
* rather than assumed: a map embedded the ordinary way is a canvas with no role
|
|
27497
|
+
* and no name, and it has *no node at all* in the accessibility tree. A reader
|
|
27498
|
+
* using a screen reader does not walk past it so much as never meet it. A named
|
|
27499
|
+
* region with controls in it is the whole of the difference.
|
|
27500
|
+
*
|
|
27501
|
+
* **The controls are buttons, and that is a deliberate choice against arrow
|
|
27502
|
+
* keys.** Arrows work here too, but what a screen reader does with them is not
|
|
27503
|
+
* ours to decide: macOS passes them through, Windows readers hold them for
|
|
27504
|
+
* their own reading mode unless a page takes `role="application"`, which costs
|
|
27505
|
+
* the reader their normal way of reading everything else in the frame. A button
|
|
27506
|
+
* is findable and operable in every screen reader on every platform without
|
|
27507
|
+
* that bargain, so panning and zooming are buttons first and keys second.
|
|
27508
|
+
*
|
|
27509
|
+
* **Nothing here moves the map.** Both controls ask, through `helix-map-pan`
|
|
27510
|
+
* and `helix-map-zoom`, and the consumer answers against whatever they slotted.
|
|
27511
|
+
* A frame that moved the map would have to know whose map it was.
|
|
27512
|
+
*
|
|
27513
|
+
* ## Attributes & Properties
|
|
27514
|
+
*
|
|
27515
|
+
* Component attributes and properties that can be applied to the element or by using JavaScript.
|
|
27516
|
+
*
|
|
27517
|
+
* - `fullscreen-label`/`fullscreenLabel`: What the control that fills the screen is called.
|
|
27518
|
+
* - `idle-delay`/`idleDelay`: How long the reader may be still before the chrome hides, in milliseconds.
|
|
27519
|
+
*
|
|
27520
|
+
* Zero keeps it up, which is the default: a map's controls are how a keyboard
|
|
27521
|
+
* reader operates it, and chrome that hides itself by default would be this
|
|
27522
|
+
* component undoing its own argument. Set it for a display map nobody drives.
|
|
27523
|
+
* - `label`: Accessible name for the map, which is the one thing a consumer must write.
|
|
27524
|
+
*
|
|
27525
|
+
* There is no sensible default. "Map" names the widget rather than the place,
|
|
27526
|
+
* and a reader meeting three of them on a page learns nothing from hearing the
|
|
27527
|
+
* same word three times.
|
|
27528
|
+
* - `pan-label`/`panLabel`: What the controls are called, for a page not in English.
|
|
27529
|
+
* - `pan-step`/`panStep`: How far one press moves the map, as a fraction of what is on screen.
|
|
27530
|
+
*
|
|
27531
|
+
* A fraction rather than a distance, because this frame does not know the
|
|
27532
|
+
* scale of what is inside it: a quarter of the viewport is the same gesture at
|
|
27533
|
+
* street level and at country level, and a consumer who wants metres can
|
|
27534
|
+
* multiply by their own.
|
|
27535
|
+
* - `zoom-in-label`/`zoomInLabel`: What the zoom controls are called.
|
|
27536
|
+
* - `zoom-out-label`/`zoomOutLabel`: What the zoom control that goes the other way is called.
|
|
27537
|
+
* - `whenSettled`: Resolves a frame after the first update, when transitions are switched on.
|
|
27538
|
+
*
|
|
27539
|
+
* **Named `whenSettled` because `settled` is taken four times over**, by
|
|
27540
|
+
* Image, Splitter and both color controls, none of them about transitions. A
|
|
27541
|
+
* base class takes the name every subclass then cannot use.
|
|
27542
|
+
*
|
|
27543
|
+
* **The state it reports cannot be watched, which is why this exists.** A
|
|
27544
|
+
* custom state is deliberately not in the DOM, so there is no
|
|
27545
|
+
* `MutationObserver` equivalent for `ElementInternals.states`. Await this
|
|
27546
|
+
* instead.
|
|
27547
|
+
*
|
|
27548
|
+
* Separate from `updateComplete`, which resolves in the microtask checkpoint
|
|
27549
|
+
* the suppression is still active in. That is the distinction `readyToMove`
|
|
27550
|
+
* in `@fusion.dev/helix-testing` is written around.
|
|
27551
|
+
*
|
|
27552
|
+
* It never resolves where `requestAnimationFrame` never fires, which is a
|
|
27553
|
+
* server, a hidden tab, and happy-dom. Callers that must not hang there race
|
|
27554
|
+
* it against a timeout, as the happy-dom harness's `readyToMove` does. The
|
|
27555
|
+
* browser harness's awaits it alone: a browser always runs the frame, and a
|
|
27556
|
+
* timer beside it was a bet on how long one takes, which a busy run lost. (property only) (readonly)
|
|
27557
|
+
*
|
|
27558
|
+
* ## Events
|
|
27559
|
+
*
|
|
27560
|
+
* Events that will be emitted by the component.
|
|
27561
|
+
*
|
|
27562
|
+
* - `helix-map-pan`: The reader asked the map to move. Answer it against your own map.
|
|
27563
|
+
* - `helix-map-zoom`: The reader asked the map to zoom, by a direction rather than to a level.
|
|
27564
|
+
*
|
|
27565
|
+
* ## Slots
|
|
27566
|
+
*
|
|
27567
|
+
* Areas where markup can be added to the component.
|
|
27568
|
+
*
|
|
27569
|
+
* - `(default)`: The map, which is the consumer's own.
|
|
27570
|
+
* - `attribution`: Whoever the tiles belong to, which most licenses require you to say.
|
|
27571
|
+
* - `footer`: Chrome below the map, such as a legend or a scale.
|
|
27572
|
+
* - `header`: Chrome above the map, such as a title or a search field.
|
|
27573
|
+
*
|
|
27574
|
+
* ## Methods
|
|
27575
|
+
*
|
|
27576
|
+
* Methods that can be called to access component functionality.
|
|
27577
|
+
*
|
|
27578
|
+
* - `toggleFullscreen() => void`: Fills the screen with the frame, or comes back.
|
|
27579
|
+
* - `pan(to: Way) => void`: Asks for the map to move, which the consumer answers.
|
|
27580
|
+
* - `zoom(by: number) => void`: Asks for the map to zoom, `1` in and `-1` out.
|
|
27581
|
+
*
|
|
27582
|
+
* ## CSS Parts
|
|
27583
|
+
*
|
|
27584
|
+
* Custom selectors for styling elements within the component.
|
|
27585
|
+
*
|
|
27586
|
+
* - `controls`: The group the pan and zoom buttons sit in.
|
|
27587
|
+
* - `fullscreen`: The button that fills the screen.
|
|
27588
|
+
* - `pan-down`: The button that moves the map down.
|
|
27589
|
+
* - `pan-end`: The button that moves the map the way the text ends, which is right on an English page.
|
|
27590
|
+
* - `pan-start`: The button that moves the map the way the text starts, which is left on an English page.
|
|
27591
|
+
* - `pan-up`: The button that moves the map up.
|
|
27592
|
+
* - `region`: The named region the map is slotted into.
|
|
27593
|
+
* - `viewport`: The box the map is drawn in.
|
|
27594
|
+
* - `zoom-in`: The button that zooms in.
|
|
27595
|
+
* - `zoom-out`: The button that zooms out.
|
|
27596
|
+
*
|
|
27597
|
+
* ## CSS States
|
|
27598
|
+
*
|
|
27599
|
+
* These can be used to apply styling when a component is in a given state.
|
|
27600
|
+
*
|
|
27601
|
+
* - `fullscreen`: While the frame fills the screen.
|
|
27602
|
+
* - `idle`: While the reader has been still long enough to hide the chrome.
|
|
27603
|
+
* - `settled`: Set a frame after the first render. Transitions are held off until it is, so an element never animates its own arrival.
|
|
27604
|
+
*/
|
|
27605
|
+
"helix-headless-map": Partial<
|
|
27606
|
+
HelixHeadlessMapProps & BaseProps<HelixHeadlessMap> & BaseEvents<HelixHeadlessMap>
|
|
27607
|
+
>;
|
|
27608
|
+
|
|
27357
27609
|
/**
|
|
27358
27610
|
* **A disclosure, not a menu, and that is the whole design.** `role="menu"` and
|
|
27359
27611
|
* `menuitem` are for an application's commands: they take over the arrow keys,
|
|
@@ -45701,6 +45953,130 @@ export type CustomElementsSolidJs = {
|
|
|
45701
45953
|
BaseEvents<HelixHeadlessLoader>
|
|
45702
45954
|
>;
|
|
45703
45955
|
|
|
45956
|
+
/**
|
|
45957
|
+
* **Helix draws no map.** There are no tiles here, no projection and no
|
|
45958
|
+
* network, and there should not be: a tile renderer is a library, and what a
|
|
45959
|
+
* design system can add to MapLibre or Leaflet is the frame. The consumer slots
|
|
45960
|
+
* their map and this owns the box, the name, the controls and the way out,
|
|
45961
|
+
* which is the shape `VideoPlaylist` uses for a player it never renders.
|
|
45962
|
+
*
|
|
45963
|
+
* **The accessibility argument is the reason this exists**, and it was measured
|
|
45964
|
+
* rather than assumed: a map embedded the ordinary way is a canvas with no role
|
|
45965
|
+
* and no name, and it has *no node at all* in the accessibility tree. A reader
|
|
45966
|
+
* using a screen reader does not walk past it so much as never meet it. A named
|
|
45967
|
+
* region with controls in it is the whole of the difference.
|
|
45968
|
+
*
|
|
45969
|
+
* **The controls are buttons, and that is a deliberate choice against arrow
|
|
45970
|
+
* keys.** Arrows work here too, but what a screen reader does with them is not
|
|
45971
|
+
* ours to decide: macOS passes them through, Windows readers hold them for
|
|
45972
|
+
* their own reading mode unless a page takes `role="application"`, which costs
|
|
45973
|
+
* the reader their normal way of reading everything else in the frame. A button
|
|
45974
|
+
* is findable and operable in every screen reader on every platform without
|
|
45975
|
+
* that bargain, so panning and zooming are buttons first and keys second.
|
|
45976
|
+
*
|
|
45977
|
+
* **Nothing here moves the map.** Both controls ask, through `helix-map-pan`
|
|
45978
|
+
* and `helix-map-zoom`, and the consumer answers against whatever they slotted.
|
|
45979
|
+
* A frame that moved the map would have to know whose map it was.
|
|
45980
|
+
*
|
|
45981
|
+
* ## Attributes & Properties
|
|
45982
|
+
*
|
|
45983
|
+
* Component attributes and properties that can be applied to the element or by using JavaScript.
|
|
45984
|
+
*
|
|
45985
|
+
* - `fullscreen-label`/`fullscreenLabel`: What the control that fills the screen is called.
|
|
45986
|
+
* - `idle-delay`/`idleDelay`: How long the reader may be still before the chrome hides, in milliseconds.
|
|
45987
|
+
*
|
|
45988
|
+
* Zero keeps it up, which is the default: a map's controls are how a keyboard
|
|
45989
|
+
* reader operates it, and chrome that hides itself by default would be this
|
|
45990
|
+
* component undoing its own argument. Set it for a display map nobody drives.
|
|
45991
|
+
* - `label`: Accessible name for the map, which is the one thing a consumer must write.
|
|
45992
|
+
*
|
|
45993
|
+
* There is no sensible default. "Map" names the widget rather than the place,
|
|
45994
|
+
* and a reader meeting three of them on a page learns nothing from hearing the
|
|
45995
|
+
* same word three times.
|
|
45996
|
+
* - `pan-label`/`panLabel`: What the controls are called, for a page not in English.
|
|
45997
|
+
* - `pan-step`/`panStep`: How far one press moves the map, as a fraction of what is on screen.
|
|
45998
|
+
*
|
|
45999
|
+
* A fraction rather than a distance, because this frame does not know the
|
|
46000
|
+
* scale of what is inside it: a quarter of the viewport is the same gesture at
|
|
46001
|
+
* street level and at country level, and a consumer who wants metres can
|
|
46002
|
+
* multiply by their own.
|
|
46003
|
+
* - `zoom-in-label`/`zoomInLabel`: What the zoom controls are called.
|
|
46004
|
+
* - `zoom-out-label`/`zoomOutLabel`: What the zoom control that goes the other way is called.
|
|
46005
|
+
* - `whenSettled`: Resolves a frame after the first update, when transitions are switched on.
|
|
46006
|
+
*
|
|
46007
|
+
* **Named `whenSettled` because `settled` is taken four times over**, by
|
|
46008
|
+
* Image, Splitter and both color controls, none of them about transitions. A
|
|
46009
|
+
* base class takes the name every subclass then cannot use.
|
|
46010
|
+
*
|
|
46011
|
+
* **The state it reports cannot be watched, which is why this exists.** A
|
|
46012
|
+
* custom state is deliberately not in the DOM, so there is no
|
|
46013
|
+
* `MutationObserver` equivalent for `ElementInternals.states`. Await this
|
|
46014
|
+
* instead.
|
|
46015
|
+
*
|
|
46016
|
+
* Separate from `updateComplete`, which resolves in the microtask checkpoint
|
|
46017
|
+
* the suppression is still active in. That is the distinction `readyToMove`
|
|
46018
|
+
* in `@fusion.dev/helix-testing` is written around.
|
|
46019
|
+
*
|
|
46020
|
+
* It never resolves where `requestAnimationFrame` never fires, which is a
|
|
46021
|
+
* server, a hidden tab, and happy-dom. Callers that must not hang there race
|
|
46022
|
+
* it against a timeout, as the happy-dom harness's `readyToMove` does. The
|
|
46023
|
+
* browser harness's awaits it alone: a browser always runs the frame, and a
|
|
46024
|
+
* timer beside it was a bet on how long one takes, which a busy run lost. (property only) (readonly)
|
|
46025
|
+
*
|
|
46026
|
+
* ## Events
|
|
46027
|
+
*
|
|
46028
|
+
* Events that will be emitted by the component.
|
|
46029
|
+
*
|
|
46030
|
+
* - `helix-map-pan`: The reader asked the map to move. Answer it against your own map.
|
|
46031
|
+
* - `helix-map-zoom`: The reader asked the map to zoom, by a direction rather than to a level.
|
|
46032
|
+
*
|
|
46033
|
+
* ## Slots
|
|
46034
|
+
*
|
|
46035
|
+
* Areas where markup can be added to the component.
|
|
46036
|
+
*
|
|
46037
|
+
* - `(default)`: The map, which is the consumer's own.
|
|
46038
|
+
* - `attribution`: Whoever the tiles belong to, which most licenses require you to say.
|
|
46039
|
+
* - `footer`: Chrome below the map, such as a legend or a scale.
|
|
46040
|
+
* - `header`: Chrome above the map, such as a title or a search field.
|
|
46041
|
+
*
|
|
46042
|
+
* ## Methods
|
|
46043
|
+
*
|
|
46044
|
+
* Methods that can be called to access component functionality.
|
|
46045
|
+
*
|
|
46046
|
+
* - `toggleFullscreen() => void`: Fills the screen with the frame, or comes back.
|
|
46047
|
+
* - `pan(to: Way) => void`: Asks for the map to move, which the consumer answers.
|
|
46048
|
+
* - `zoom(by: number) => void`: Asks for the map to zoom, `1` in and `-1` out.
|
|
46049
|
+
*
|
|
46050
|
+
* ## CSS Parts
|
|
46051
|
+
*
|
|
46052
|
+
* Custom selectors for styling elements within the component.
|
|
46053
|
+
*
|
|
46054
|
+
* - `controls`: The group the pan and zoom buttons sit in.
|
|
46055
|
+
* - `fullscreen`: The button that fills the screen.
|
|
46056
|
+
* - `pan-down`: The button that moves the map down.
|
|
46057
|
+
* - `pan-end`: The button that moves the map the way the text ends, which is right on an English page.
|
|
46058
|
+
* - `pan-start`: The button that moves the map the way the text starts, which is left on an English page.
|
|
46059
|
+
* - `pan-up`: The button that moves the map up.
|
|
46060
|
+
* - `region`: The named region the map is slotted into.
|
|
46061
|
+
* - `viewport`: The box the map is drawn in.
|
|
46062
|
+
* - `zoom-in`: The button that zooms in.
|
|
46063
|
+
* - `zoom-out`: The button that zooms out.
|
|
46064
|
+
*
|
|
46065
|
+
* ## CSS States
|
|
46066
|
+
*
|
|
46067
|
+
* These can be used to apply styling when a component is in a given state.
|
|
46068
|
+
*
|
|
46069
|
+
* - `fullscreen`: While the frame fills the screen.
|
|
46070
|
+
* - `idle`: While the reader has been still long enough to hide the chrome.
|
|
46071
|
+
* - `settled`: Set a frame after the first render. Transitions are held off until it is, so an element never animates its own arrival.
|
|
46072
|
+
*/
|
|
46073
|
+
"helix-headless-map": Partial<
|
|
46074
|
+
HelixHeadlessMapProps &
|
|
46075
|
+
HelixHeadlessMapSolidJsProps &
|
|
46076
|
+
BaseProps<HelixHeadlessMap> &
|
|
46077
|
+
BaseEvents<HelixHeadlessMap>
|
|
46078
|
+
>;
|
|
46079
|
+
|
|
45704
46080
|
/**
|
|
45705
46081
|
* **A disclosure, not a menu, and that is the whole design.** `role="menu"` and
|
|
45706
46082
|
* `menuitem` are for an application's commands: they take over the arrow keys,
|
package/types/svelte.d.ts
CHANGED
|
@@ -69,6 +69,7 @@ declare module 'svelte/elements' {
|
|
|
69
69
|
'helix-headless-list': CustomElements['helix-headless-list']
|
|
70
70
|
'helix-headless-listbox': CustomElements['helix-headless-listbox']
|
|
71
71
|
'helix-headless-loader': CustomElements['helix-headless-loader']
|
|
72
|
+
'helix-headless-map': CustomElements['helix-headless-map']
|
|
72
73
|
'helix-headless-megamenu': CustomElements['helix-headless-megamenu']
|
|
73
74
|
'helix-headless-menu-item': CustomElements['helix-headless-menu-item']
|
|
74
75
|
'helix-headless-menu': CustomElements['helix-headless-menu']
|
package/types/vue.d.ts
CHANGED
|
@@ -64,6 +64,7 @@ import type {
|
|
|
64
64
|
HelixHeadlessList,
|
|
65
65
|
HelixHeadlessListbox,
|
|
66
66
|
HelixHeadlessLoader,
|
|
67
|
+
HelixHeadlessMap,
|
|
67
68
|
HelixHeadlessMegamenu,
|
|
68
69
|
HelixHeadlessMenuItem,
|
|
69
70
|
HelixHeadlessMenu,
|
|
@@ -159,6 +160,8 @@ import type {
|
|
|
159
160
|
HelixShortcutEvent,
|
|
160
161
|
HelixActivateEvent,
|
|
161
162
|
HelixBeforeActivateEvent,
|
|
163
|
+
HelixMapPanEvent,
|
|
164
|
+
HelixMapZoomEvent,
|
|
162
165
|
HelixReadEvent,
|
|
163
166
|
HelixCompleteEvent,
|
|
164
167
|
HelixBeforeCollapseEvent,
|
|
@@ -4792,6 +4795,76 @@ export type HelixHeadlessLoaderVueProps = {
|
|
|
4792
4795
|
|
|
4793
4796
|
export type HelixHeadlessLoaderVueEvents = {};
|
|
4794
4797
|
|
|
4798
|
+
/** `HelixHeadlessMap` component event */
|
|
4799
|
+
export type HelixHeadlessMapElementEvent<E = Event> = TypedEvent<
|
|
4800
|
+
HelixHeadlessMap,
|
|
4801
|
+
E
|
|
4802
|
+
>;
|
|
4803
|
+
/** `helix-map-pan` event type */
|
|
4804
|
+
export type HelixHeadlessMapHelixMapPanElementEvent =
|
|
4805
|
+
HelixHeadlessMapElementEvent<HelixMapPanEvent>;
|
|
4806
|
+
/** `helix-map-zoom` event type */
|
|
4807
|
+
export type HelixHeadlessMapHelixMapZoomElementEvent =
|
|
4808
|
+
HelixHeadlessMapElementEvent<HelixMapZoomEvent>;
|
|
4809
|
+
|
|
4810
|
+
export type HelixHeadlessMapVueProps = {
|
|
4811
|
+
/** What the control that fills the screen is called. */
|
|
4812
|
+
"fullscreen-label"?: (HelixHeadlessMap["fullscreenLabel"]) | undefined;
|
|
4813
|
+
/** What the control that fills the screen is called. */
|
|
4814
|
+
fullscreenLabel?: (HelixHeadlessMap["fullscreenLabel"]) | undefined;
|
|
4815
|
+
/** How long the reader may be still before the chrome hides, in milliseconds.
|
|
4816
|
+
|
|
4817
|
+
Zero keeps it up, which is the default: a map's controls are how a keyboard
|
|
4818
|
+
reader operates it, and chrome that hides itself by default would be this
|
|
4819
|
+
component undoing its own argument. Set it for a display map nobody drives. */
|
|
4820
|
+
"idle-delay"?: (HelixHeadlessMap["idleDelay"] | `${number}`) | undefined;
|
|
4821
|
+
/** How long the reader may be still before the chrome hides, in milliseconds.
|
|
4822
|
+
|
|
4823
|
+
Zero keeps it up, which is the default: a map's controls are how a keyboard
|
|
4824
|
+
reader operates it, and chrome that hides itself by default would be this
|
|
4825
|
+
component undoing its own argument. Set it for a display map nobody drives. */
|
|
4826
|
+
idleDelay?: (HelixHeadlessMap["idleDelay"]) | undefined;
|
|
4827
|
+
/** Accessible name for the map, which is the one thing a consumer must write.
|
|
4828
|
+
|
|
4829
|
+
There is no sensible default. "Map" names the widget rather than the place,
|
|
4830
|
+
and a reader meeting three of them on a page learns nothing from hearing the
|
|
4831
|
+
same word three times. */
|
|
4832
|
+
label?: (HelixHeadlessMap["label"]) | undefined;
|
|
4833
|
+
/** What the controls are called, for a page not in English. */
|
|
4834
|
+
"pan-label"?: (HelixHeadlessMap["panLabel"]) | undefined;
|
|
4835
|
+
/** What the controls are called, for a page not in English. */
|
|
4836
|
+
panLabel?: (HelixHeadlessMap["panLabel"]) | undefined;
|
|
4837
|
+
/** How far one press moves the map, as a fraction of what is on screen.
|
|
4838
|
+
|
|
4839
|
+
A fraction rather than a distance, because this frame does not know the
|
|
4840
|
+
scale of what is inside it: a quarter of the viewport is the same gesture at
|
|
4841
|
+
street level and at country level, and a consumer who wants metres can
|
|
4842
|
+
multiply by their own. */
|
|
4843
|
+
"pan-step"?: (HelixHeadlessMap["panStep"] | `${number}`) | undefined;
|
|
4844
|
+
/** How far one press moves the map, as a fraction of what is on screen.
|
|
4845
|
+
|
|
4846
|
+
A fraction rather than a distance, because this frame does not know the
|
|
4847
|
+
scale of what is inside it: a quarter of the viewport is the same gesture at
|
|
4848
|
+
street level and at country level, and a consumer who wants metres can
|
|
4849
|
+
multiply by their own. */
|
|
4850
|
+
panStep?: (HelixHeadlessMap["panStep"]) | undefined;
|
|
4851
|
+
/** What the zoom controls are called. */
|
|
4852
|
+
"zoom-in-label"?: (HelixHeadlessMap["zoomInLabel"]) | undefined;
|
|
4853
|
+
/** What the zoom controls are called. */
|
|
4854
|
+
zoomInLabel?: (HelixHeadlessMap["zoomInLabel"]) | undefined;
|
|
4855
|
+
/** What the zoom control that goes the other way is called. */
|
|
4856
|
+
"zoom-out-label"?: (HelixHeadlessMap["zoomOutLabel"]) | undefined;
|
|
4857
|
+
/** What the zoom control that goes the other way is called. */
|
|
4858
|
+
zoomOutLabel?: (HelixHeadlessMap["zoomOutLabel"]) | undefined;
|
|
4859
|
+
};
|
|
4860
|
+
|
|
4861
|
+
export type HelixHeadlessMapVueEvents = {
|
|
4862
|
+
/** The reader asked the map to move. Answer it against your own map. */
|
|
4863
|
+
"helix-map-pan": HelixHeadlessMapHelixMapPanElementEvent;
|
|
4864
|
+
/** The reader asked the map to zoom, by a direction rather than to a level. */
|
|
4865
|
+
"helix-map-zoom": HelixHeadlessMapHelixMapZoomElementEvent;
|
|
4866
|
+
};
|
|
4867
|
+
|
|
4795
4868
|
/** `HelixHeadlessMegamenu` component event */
|
|
4796
4869
|
export type HelixHeadlessMegamenuElementEvent<E = Event> = TypedEvent<
|
|
4797
4870
|
HelixHeadlessMegamenu,
|
|
@@ -9830,6 +9903,12 @@ export interface WcToolkitVueGlobalComponents {
|
|
|
9830
9903
|
HelixHeadlessLoaderVueProps,
|
|
9831
9904
|
HelixHeadlessLoaderVueEvents
|
|
9832
9905
|
>;
|
|
9906
|
+
/** **Helix draws no map.** There are no tiles here, no projection and no network, and there should not be: a tile renderer is a library, and what a design system can add to MapLibre or Leaflet is the frame. The consumer slots their map and this owns the box, the name, the controls and the way out, which is the shape 'VideoPlaylist' uses for a player it never renders. **The accessibility argument is the reason this exists**, and it was measured rather than assumed: a map embedded the ordinary way is a canvas with no role and no name, and it has *no node at all* in the accessibility tree. A reader using a screen reader does not walk past it so much as never meet it. A named region with controls in it is the whole of the difference. **The controls are buttons, and that is a deliberate choice against arrow keys.** Arrows work here too, but what a screen reader does with them is not ours to decide: macOS passes them through, Windows readers hold them for their own reading mode unless a page takes 'role="application"', which costs the reader their normal way of reading everything else in the frame. A button is findable and operable in every screen reader on every platform without that bargain, so panning and zooming are buttons first and keys second. **Nothing here moves the map.** Both controls ask, through 'helix-map-pan' and 'helix-map-zoom', and the consumer answers against whatever they slotted. A frame that moved the map would have to know whose map it was. */
|
|
9907
|
+
"helix-headless-map": DefineCustomElement<
|
|
9908
|
+
HelixHeadlessMap,
|
|
9909
|
+
HelixHeadlessMapVueProps,
|
|
9910
|
+
HelixHeadlessMapVueEvents
|
|
9911
|
+
>;
|
|
9833
9912
|
/** **A disclosure, not a menu, and that is the whole design.** 'role="menu"' and 'menuitem' are for an application's commands: they take over the arrow keys, announce "menu" to a reader who asked for navigation, and put every link inside a role that is not a link. This is a button that shows and hides a region of the consumer's own anchors, which leaves a middle click, a modified click and the status bar working. 'Menu' remains right for a row of commands. **It renders no links.** A router renders its own anchor and cannot render one inside this shadow root, so the panel is a slot and what goes in it is the lists and headings the consumer wrote. **It opens on hover, and a press is always the fallback.** 'open-on' says which, and hover is the resting value because a nav bar is where a reader expects to sweep along a row and see each section. */
|
|
9834
9913
|
"helix-headless-megamenu": DefineCustomElement<
|
|
9835
9914
|
HelixHeadlessMegamenu,
|