@fusion.dev/helix-headless 0.101.0 → 0.103.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 +814 -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 +195 -0
- package/dist/map/root/map-root.js +181 -0
- package/package.json +5 -5
- package/types/jsx.d.ts +546 -0
- package/types/svelte.d.ts +1 -0
- package/types/vue.d.ts +130 -0
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,127 @@ 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
|
+
/** Which of the controls this frame draws, as a list of what to keep.
|
|
4812
|
+
|
|
4813
|
+
**A list rather than a switch, because the overlap is not symmetric.**
|
|
4814
|
+
Every map library draws zoom controls and none of them draws pan buttons:
|
|
4815
|
+
MapLibre's navigation control is zoom and a compass, Leaflet's is zoom,
|
|
4816
|
+
Google's is zoom. So a consumer slotting one of those has our zoom twice
|
|
4817
|
+
over and our pan pad not at all, and a single switch would make them choose
|
|
4818
|
+
between a duplicate and nothing.
|
|
4819
|
+
|
|
4820
|
+
`none` draws none of them, which is the right answer where the slotted map
|
|
4821
|
+
already has controls a reader can find: what this family argues for is that
|
|
4822
|
+
*a* findable control exists, never that it is ours. The methods stay public
|
|
4823
|
+
either way, so a consumer drawing their own chrome can still drive the
|
|
4824
|
+
frame.
|
|
4825
|
+
|
|
4826
|
+
Absent is all three, which is this library's rule that a resting value is an
|
|
4827
|
+
attribute's absence, and it is what the stylesheet asks about: the layout
|
|
4828
|
+
rules are written against `[controls]:not([controls~="zoom"])` rather than
|
|
4829
|
+
the bare negation, or a frame that named no list at all would be laid out as
|
|
4830
|
+
though it had dropped everything. */
|
|
4831
|
+
controls?: (HelixHeadlessMap["controls"]) | undefined;
|
|
4832
|
+
/** Which corner the controls sit in.
|
|
4833
|
+
|
|
4834
|
+
**Configurable because there is no safe default**, and this is a collision
|
|
4835
|
+
rather than a taste: MapLibre puts its own controls at the top end, Leaflet
|
|
4836
|
+
and OpenLayers at the top start, Google's zoom at the bottom end. Whichever
|
|
4837
|
+
corner this took would land on somebody's, which is why every one of those
|
|
4838
|
+
libraries made it a setting too.
|
|
4839
|
+
|
|
4840
|
+
Logical corners rather than left and right, so a right-to-left page moves
|
|
4841
|
+
them without a consumer writing a second rule.
|
|
4842
|
+
|
|
4843
|
+
Absent is the top end, which is this library's rule that a resting value is
|
|
4844
|
+
an attribute's absence: a default that reflected would write an attribute
|
|
4845
|
+
onto every host that no server sent and nobody asked for. */
|
|
4846
|
+
"controls-placement"?: (HelixHeadlessMap["controlsPlacement"]) | undefined;
|
|
4847
|
+
/** Which corner the controls sit in.
|
|
4848
|
+
|
|
4849
|
+
**Configurable because there is no safe default**, and this is a collision
|
|
4850
|
+
rather than a taste: MapLibre puts its own controls at the top end, Leaflet
|
|
4851
|
+
and OpenLayers at the top start, Google's zoom at the bottom end. Whichever
|
|
4852
|
+
corner this took would land on somebody's, which is why every one of those
|
|
4853
|
+
libraries made it a setting too.
|
|
4854
|
+
|
|
4855
|
+
Logical corners rather than left and right, so a right-to-left page moves
|
|
4856
|
+
them without a consumer writing a second rule.
|
|
4857
|
+
|
|
4858
|
+
Absent is the top end, which is this library's rule that a resting value is
|
|
4859
|
+
an attribute's absence: a default that reflected would write an attribute
|
|
4860
|
+
onto every host that no server sent and nobody asked for. */
|
|
4861
|
+
controlsPlacement?: (HelixHeadlessMap["controlsPlacement"]) | undefined;
|
|
4862
|
+
/** What the control that fills the screen is called. */
|
|
4863
|
+
"fullscreen-label"?: (HelixHeadlessMap["fullscreenLabel"]) | undefined;
|
|
4864
|
+
/** What the control that fills the screen is called. */
|
|
4865
|
+
fullscreenLabel?: (HelixHeadlessMap["fullscreenLabel"]) | undefined;
|
|
4866
|
+
/** How long the reader may be still before the chrome hides, in milliseconds.
|
|
4867
|
+
|
|
4868
|
+
Zero keeps it up, which is the default: a map's controls are how a keyboard
|
|
4869
|
+
reader operates it, and chrome that hides itself by default would be this
|
|
4870
|
+
component undoing its own argument. Set it for a display map nobody drives. */
|
|
4871
|
+
"idle-delay"?: (HelixHeadlessMap["idleDelay"] | `${number}`) | undefined;
|
|
4872
|
+
/** How long the reader may be still before the chrome hides, in milliseconds.
|
|
4873
|
+
|
|
4874
|
+
Zero keeps it up, which is the default: a map's controls are how a keyboard
|
|
4875
|
+
reader operates it, and chrome that hides itself by default would be this
|
|
4876
|
+
component undoing its own argument. Set it for a display map nobody drives. */
|
|
4877
|
+
idleDelay?: (HelixHeadlessMap["idleDelay"]) | undefined;
|
|
4878
|
+
/** Accessible name for the map, which is the one thing a consumer must write.
|
|
4879
|
+
|
|
4880
|
+
There is no sensible default. "Map" names the widget rather than the place,
|
|
4881
|
+
and a reader meeting three of them on a page learns nothing from hearing the
|
|
4882
|
+
same word three times. */
|
|
4883
|
+
label?: (HelixHeadlessMap["label"]) | undefined;
|
|
4884
|
+
/** What the controls are called, for a page not in English. */
|
|
4885
|
+
"pan-label"?: (HelixHeadlessMap["panLabel"]) | undefined;
|
|
4886
|
+
/** What the controls are called, for a page not in English. */
|
|
4887
|
+
panLabel?: (HelixHeadlessMap["panLabel"]) | undefined;
|
|
4888
|
+
/** How far one press moves the map, as a fraction of what is on screen.
|
|
4889
|
+
|
|
4890
|
+
A fraction rather than a distance, because this frame does not know the
|
|
4891
|
+
scale of what is inside it: a quarter of the viewport is the same gesture at
|
|
4892
|
+
street level and at country level, and a consumer who wants metres can
|
|
4893
|
+
multiply by their own. */
|
|
4894
|
+
"pan-step"?: (HelixHeadlessMap["panStep"] | `${number}`) | undefined;
|
|
4895
|
+
/** How far one press moves the map, as a fraction of what is on screen.
|
|
4896
|
+
|
|
4897
|
+
A fraction rather than a distance, because this frame does not know the
|
|
4898
|
+
scale of what is inside it: a quarter of the viewport is the same gesture at
|
|
4899
|
+
street level and at country level, and a consumer who wants metres can
|
|
4900
|
+
multiply by their own. */
|
|
4901
|
+
panStep?: (HelixHeadlessMap["panStep"]) | undefined;
|
|
4902
|
+
/** What the zoom controls are called. */
|
|
4903
|
+
"zoom-in-label"?: (HelixHeadlessMap["zoomInLabel"]) | undefined;
|
|
4904
|
+
/** What the zoom controls are called. */
|
|
4905
|
+
zoomInLabel?: (HelixHeadlessMap["zoomInLabel"]) | undefined;
|
|
4906
|
+
/** What the zoom control that goes the other way is called. */
|
|
4907
|
+
"zoom-out-label"?: (HelixHeadlessMap["zoomOutLabel"]) | undefined;
|
|
4908
|
+
/** What the zoom control that goes the other way is called. */
|
|
4909
|
+
zoomOutLabel?: (HelixHeadlessMap["zoomOutLabel"]) | undefined;
|
|
4910
|
+
};
|
|
4911
|
+
|
|
4912
|
+
export type HelixHeadlessMapVueEvents = {
|
|
4913
|
+
/** The reader asked the map to move. Answer it against your own map. */
|
|
4914
|
+
"helix-map-pan": HelixHeadlessMapHelixMapPanElementEvent;
|
|
4915
|
+
/** The reader asked the map to zoom, by a direction rather than to a level. */
|
|
4916
|
+
"helix-map-zoom": HelixHeadlessMapHelixMapZoomElementEvent;
|
|
4917
|
+
};
|
|
4918
|
+
|
|
4795
4919
|
/** `HelixHeadlessMegamenu` component event */
|
|
4796
4920
|
export type HelixHeadlessMegamenuElementEvent<E = Event> = TypedEvent<
|
|
4797
4921
|
HelixHeadlessMegamenu,
|
|
@@ -9830,6 +9954,12 @@ export interface WcToolkitVueGlobalComponents {
|
|
|
9830
9954
|
HelixHeadlessLoaderVueProps,
|
|
9831
9955
|
HelixHeadlessLoaderVueEvents
|
|
9832
9956
|
>;
|
|
9957
|
+
/** **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. */
|
|
9958
|
+
"helix-headless-map": DefineCustomElement<
|
|
9959
|
+
HelixHeadlessMap,
|
|
9960
|
+
HelixHeadlessMapVueProps,
|
|
9961
|
+
HelixHeadlessMapVueEvents
|
|
9962
|
+
>;
|
|
9833
9963
|
/** **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
9964
|
"helix-headless-megamenu": DefineCustomElement<
|
|
9835
9965
|
HelixHeadlessMegamenu,
|