@fusion.dev/helix-headless 0.113.0 → 0.114.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.
@@ -67583,6 +67583,44 @@
67583
67583
  "text": "moved() => void"
67584
67584
  }
67585
67585
  },
67586
+ {
67587
+ "kind": "field",
67588
+ "name": "ready",
67589
+ "type": {
67590
+ "text": "boolean"
67591
+ },
67592
+ "description": "Whether the map has been drawn whole, which `drawn()` says. For a page that\nconnects after `helix-map-ready` has been sent, and missed it.",
67593
+ "readonly": true
67594
+ },
67595
+ {
67596
+ "kind": "field",
67597
+ "name": "whole",
67598
+ "type": {
67599
+ "text": "boolean"
67600
+ },
67601
+ "privacy": "private",
67602
+ "default": "false",
67603
+ "description": "What `ready` reads, written by `drawn()`."
67604
+ },
67605
+ {
67606
+ "kind": "method",
67607
+ "name": "drawn",
67608
+ "return": {
67609
+ "type": {
67610
+ "text": "void"
67611
+ }
67612
+ },
67613
+ "parameters": [
67614
+ {
67615
+ "name": "whole",
67616
+ "default": "true"
67617
+ }
67618
+ ],
67619
+ "description": "Says the map has been drawn whole, or with `false`, that it no longer is.\n\n**Called by whatever draws the map**, as `connectMap` does once its driver\nhas every tile the view needs and the ground where there is terrain, and\nwith `false` when it disconnects. A page drawing its own map calls it when\nthat map is finished. The first call after the map was not drawn sends\n`helix-map-ready` and turns on `:state(ready)`, so a page can wait on the\nevent or select on the state, and a page that connects late reads `ready`.",
67620
+ "type": {
67621
+ "text": "drawn(whole = true) => void"
67622
+ }
67623
+ },
67586
67624
  {
67587
67625
  "kind": "method",
67588
67626
  "name": "say",
@@ -68903,6 +68941,14 @@
68903
68941
  "name": "helix-map-part-change",
68904
68942
  "reactProp": "onhelix-map-part-change"
68905
68943
  },
68944
+ {
68945
+ "type": {
68946
+ "text": "HelixMapReadyEvent"
68947
+ },
68948
+ "description": "The map has been drawn whole: its style, every tile the view needs, and the ground where it has terrain. Sent once per connection. Show a map that is finished on it, where it would otherwise draw in stages.",
68949
+ "name": "helix-map-ready",
68950
+ "reactProp": "onhelix-map-ready"
68951
+ },
68906
68952
  {
68907
68953
  "type": {
68908
68954
  "text": "HelixMapRotateEvent"
@@ -69306,6 +69352,10 @@
69306
69352
  "description": "The user has been still long enough for the header and footer to fade.",
69307
69353
  "name": "idle"
69308
69354
  },
69355
+ {
69356
+ "description": "The map has been drawn whole, after `helix-map-ready`.",
69357
+ "name": "ready"
69358
+ },
69309
69359
  {
69310
69360
  "description": "Set one frame after the first render. Transitions wait for it, so an element does not animate its own arrival.",
69311
69361
  "name": "settled",
@@ -105,6 +105,7 @@ registerElementEvents({
105
105
  'helix-map-cluster',
106
106
  'helix-map-pan',
107
107
  'helix-map-part-change',
108
+ 'helix-map-ready',
108
109
  'helix-map-rotate',
109
110
  'helix-map-tilt',
110
111
  'helix-map-zoom',
@@ -70,6 +70,7 @@ declare const HelixHeadlessMap_base: (new (...args: any[]) => import("@fusion.de
70
70
  * @event {HelixMapClusterEvent} helix-map-cluster - A cluster was pressed. Sent from the marker that shows the cluster, with the names of its places.
71
71
  * @event {HelixMapPanEvent} helix-map-pan - A pan button or arrow key was pressed. Move your map in response.
72
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 {HelixMapReadyEvent} helix-map-ready - The map has been drawn whole: its style, every tile the view needs, and the ground where it has terrain. Sent once per connection. Show a map that is finished on it, where it would otherwise draw in stages.
73
74
  * @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
75
  * @event {HelixMapTiltEvent} helix-map-tilt - The 3D button, or Shift with Up or Down, was pressed. Tilt your map in response.
75
76
  * @event {HelixMapZoomEvent} helix-map-zoom - A zoom button or key was pressed, with a direction. Zoom your map in response.
@@ -111,6 +112,7 @@ declare const HelixHeadlessMap_base: (new (...args: any[]) => import("@fusion.de
111
112
  *
112
113
  * @cssstate fullscreen - The map fills the screen.
113
114
  * @cssstate idle - The user has been still long enough for the header and footer to fade.
115
+ * @cssstate ready - The map has been drawn whole, after `helix-map-ready`.
114
116
  */
115
117
  export declare class HelixHeadlessMap extends HelixHeadlessMap_base {
116
118
  /**
@@ -220,6 +222,24 @@ export declare class HelixHeadlessMap extends HelixHeadlessMap_base {
220
222
  * say, so it says which way the map moved.
221
223
  */
222
224
  moved(): void;
225
+ /**
226
+ * Whether the map has been drawn whole, which `drawn()` says. For a page that
227
+ * connects after `helix-map-ready` has been sent, and missed it.
228
+ */
229
+ get ready(): boolean;
230
+ /** What `ready` reads, written by `drawn()`. */
231
+ private whole;
232
+ /**
233
+ * Says the map has been drawn whole, or with `false`, that it no longer is.
234
+ *
235
+ * **Called by whatever draws the map**, as `connectMap` does once its driver
236
+ * has every tile the view needs and the ground where there is terrain, and
237
+ * with `false` when it disconnects. A page drawing its own map calls it when
238
+ * that map is finished. The first call after the map was not drawn sends
239
+ * `helix-map-ready` and turns on `:state(ready)`, so a page can wait on the
240
+ * event or select on the state, and a page that connects late reads `ready`.
241
+ */
242
+ drawn(whole?: boolean): void;
223
243
  private say;
224
244
  /** Records what a reader asked, so the answer can be said. */
225
245
  private ask;
@@ -4,7 +4,7 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
4
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
5
  return c > 3 && r && Object.defineProperty(target, key, r), r;
6
6
  };
7
- import { customElement, fillTemplate, formatNumbers, HelixActivateEvent, HelixElement, HelixMapClusterEvent, HelixMapPanEvent, HelixMapPartChangeEvent, HelixMapRotateEvent, HelixMapTiltEvent, HelixMapZoomEvent, hostAria, KeyboardNavigationController, MixinViewport, } from '@fusion.dev/helix-core';
7
+ import { customElement, fillTemplate, formatNumbers, HelixActivateEvent, HelixElement, HelixMapClusterEvent, HelixMapPanEvent, HelixMapPartChangeEvent, HelixMapReadyEvent, HelixMapRotateEvent, HelixMapTiltEvent, HelixMapZoomEvent, hostAria, KeyboardNavigationController, MixinViewport, } from '@fusion.dev/helix-core';
8
8
  import { buildings, cloudRain, dotsNine, leaf, mountains, path, polygon, stack, target, } from '@fusion.dev/helix-icons';
9
9
  import { html, nothing } from 'lit';
10
10
  import { property, state } from 'lit/decorators.js';
@@ -67,6 +67,7 @@ let HelixHeadlessMap = class HelixHeadlessMap extends MixinViewport(HelixElement
67
67
  this.said = '';
68
68
  this.asked = undefined;
69
69
  this.settling = undefined;
70
+ this.whole = false;
70
71
  this.layersOpen = false;
71
72
  this.handleOutside = (event) => {
72
73
  if (!event.composedPath().includes(this)) {
@@ -141,6 +142,19 @@ let HelixHeadlessMap = class HelixHeadlessMap extends MixinViewport(HelixElement
141
142
  clearTimeout(this.settling);
142
143
  this.settling = setTimeout(() => this.say(), SETTLES);
143
144
  }
145
+ get ready() {
146
+ return this.whole;
147
+ }
148
+ drawn(whole = true) {
149
+ if (whole === this.whole) {
150
+ return;
151
+ }
152
+ this.whole = whole;
153
+ this.toggleState('ready', whole);
154
+ if (whole) {
155
+ this.dispatchEvent(new HelixMapReadyEvent());
156
+ }
157
+ }
144
158
  say() {
145
159
  const asked = this.asked;
146
160
  this.asked = undefined;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@fusion.dev/helix-headless",
3
3
  "description": "Headless component tier. Structure, accessibility, state, and form participation. No styling.",
4
- "version": "0.113.0",
4
+ "version": "0.114.0",
5
5
  "license": "MIT",
6
6
  "author": "Ross Sheppard <ross.sheppard@fusion.dev>",
7
7
  "repository": {
@@ -46,13 +46,13 @@
46
46
  },
47
47
  "bugs": "https://github.com/project-fusion/fusion/issues",
48
48
  "dependencies": {
49
- "@fusion.dev/helix-core": "0.113.0",
50
- "@fusion.dev/helix-icons": "0.113.0",
49
+ "@fusion.dev/helix-core": "0.114.0",
50
+ "@fusion.dev/helix-icons": "0.114.0",
51
51
  "uqr": "^0.1.3"
52
52
  },
53
53
  "devDependencies": {
54
- "@fusion.dev/helix-cem": "0.113.0",
55
- "@fusion.dev/helix-testing": "0.113.0",
54
+ "@fusion.dev/helix-cem": "0.114.0",
55
+ "@fusion.dev/helix-testing": "0.114.0",
56
56
  "@fusion.dev/scripts": "0.0.0-dev",
57
57
  "@happy-dom/global-registrator": "^20.0.0",
58
58
  "@lit-labs/ssr": "^4.1.0",
package/types/jsx.d.ts CHANGED
@@ -184,6 +184,7 @@ import type {
184
184
  HelixMapClusterEvent,
185
185
  HelixMapPanEvent,
186
186
  HelixMapPartChangeEvent,
187
+ HelixMapReadyEvent,
187
188
  HelixMapRotateEvent,
188
189
  HelixMapTiltEvent,
189
190
  HelixMapZoomEvent,
@@ -12025,6 +12026,9 @@ export type HelixHeadlessMapHelixMapPanElementEvent =
12025
12026
  /** `helix-map-part-change` event type */
12026
12027
  export type HelixHeadlessMapHelixMapPartChangeElementEvent =
12027
12028
  HelixHeadlessMapElementEvent<HelixMapPartChangeEvent>;
12029
+ /** `helix-map-ready` event type */
12030
+ export type HelixHeadlessMapHelixMapReadyElementEvent =
12031
+ HelixHeadlessMapElementEvent<HelixMapReadyEvent>;
12028
12032
  /** `helix-map-rotate` event type */
12029
12033
  export type HelixHeadlessMapHelixMapRotateElementEvent =
12030
12034
  HelixHeadlessMapElementEvent<HelixMapRotateEvent>;
@@ -12280,6 +12284,8 @@ at any zoom, and a consumer who wants their own units multiplies by them. */
12280
12284
  "onhelix-map-part-change"?: ((
12281
12285
  e: HelixHeadlessMapHelixMapPartChangeElementEvent,
12282
12286
  ) => void) | undefined;
12287
+ /** The map has been drawn whole: its style, every tile the view needs, and the ground where it has terrain. Sent once per connection. Show a map that is finished on it, where it would otherwise draw in stages. */
12288
+ "onhelix-map-ready"?: ((e: HelixHeadlessMapHelixMapReadyElementEvent) => void) | undefined;
12283
12289
  /** A rotate or Face north button, or Shift with Left or Right, was pressed. Turn your map in response. */
12284
12290
  "onhelix-map-rotate"?: ((
12285
12291
  e: HelixHeadlessMapHelixMapRotateElementEvent,
@@ -12534,6 +12540,8 @@ at any zoom, and a consumer who wants their own units multiplies by them. */
12534
12540
  "on:helix-map-part-change"?: ((
12535
12541
  e: HelixHeadlessMapHelixMapPartChangeElementEvent,
12536
12542
  ) => void) | undefined;
12543
+ /** The map has been drawn whole: its style, every tile the view needs, and the ground where it has terrain. Sent once per connection. Show a map that is finished on it, where it would otherwise draw in stages. */
12544
+ "on:helix-map-ready"?: ((e: HelixHeadlessMapHelixMapReadyElementEvent) => void) | undefined;
12537
12545
  /** A rotate or Face north button, or Shift with Left or Right, was pressed. Turn your map in response. */
12538
12546
  "on:helix-map-rotate"?: ((
12539
12547
  e: HelixHeadlessMapHelixMapRotateElementEvent,
@@ -33190,6 +33198,8 @@ export type CustomElements = {
33190
33198
  * - `pan-up-label`/`panUpLabel`: The pan up button's label.
33191
33199
  * - `zoom-in-label`/`zoomInLabel`: The zoom in button's label.
33192
33200
  * - `zoom-out-label`/`zoomOutLabel`: The zoom out button's label.
33201
+ * - `ready`: Whether the map has been drawn whole, which `drawn()` says. For a page that
33202
+ * connects after `helix-map-ready` has been sent, and missed it. (property only) (readonly)
33193
33203
  * - `whenSettled`: Resolves a frame after the first update, when transitions are switched on.
33194
33204
  *
33195
33205
  * **Named `whenSettled` because `settled` is taken four times over**, by
@@ -33219,6 +33229,7 @@ export type CustomElements = {
33219
33229
  * - `helix-map-cluster`: A cluster was pressed. Sent from the marker that shows the cluster, with the names of its places.
33220
33230
  * - `helix-map-pan`: A pan button or arrow key was pressed. Move your map in response.
33221
33231
  * - `helix-map-part-change`: Clustering was turned on or off. Used by `connectMap`; pages do not need to listen for it.
33232
+ * - `helix-map-ready`: The map has been drawn whole: its style, every tile the view needs, and the ground where it has terrain. Sent once per connection. Show a map that is finished on it, where it would otherwise draw in stages.
33222
33233
  * - `helix-map-rotate`: A rotate or Face north button, or Shift with Left or Right, was pressed. Turn your map in response.
33223
33234
  * - `helix-map-tilt`: The 3D button, or Shift with Up or Down, was pressed. Tilt your map in response.
33224
33235
  * - `helix-map-zoom`: A zoom button or key was pressed, with a direction. Zoom your map in response.
@@ -33250,6 +33261,14 @@ export type CustomElements = {
33250
33261
  * animation is one sentence, and it is the view's state where there is one:
33251
33262
  * the zoom level, the way the map faces, its tilt. A pan has no state to
33252
33263
  * say, so it says which way the map moved.
33264
+ * - `drawn(whole = true) => void`: Says the map has been drawn whole, or with `false`, that it no longer is.
33265
+ *
33266
+ * **Called by whatever draws the map**, as `connectMap` does once its driver
33267
+ * has every tile the view needs and the ground where there is terrain, and
33268
+ * with `false` when it disconnects. A page drawing its own map calls it when
33269
+ * that map is finished. The first call after the map was not drawn sends
33270
+ * `helix-map-ready` and turns on `:state(ready)`, so a page can wait on the
33271
+ * event or select on the state, and a page that connects late reads `ready`.
33253
33272
  * - `rotate(by: number) => void`: Turns the map by some degrees, clockwise where positive.
33254
33273
  * - `faceNorth() => void`: Turns the map to face north.
33255
33274
  * - `tilt(by: number) => void`: Tilts the map by some degrees, toward the horizon where positive.
@@ -33307,6 +33326,7 @@ export type CustomElements = {
33307
33326
  *
33308
33327
  * - `fullscreen`: The map fills the screen.
33309
33328
  * - `idle`: The user has been still long enough for the header and footer to fade.
33329
+ * - `ready`: The map has been drawn whole, after `helix-map-ready`.
33310
33330
  * - `settled`: Set one frame after the first render. Transitions wait for it, so an element does not animate its own arrival.
33311
33331
  */
33312
33332
  "helix-headless-map": Partial<
@@ -53263,6 +53283,8 @@ export type CustomElementsSolidJs = {
53263
53283
  * - `pan-up-label`/`panUpLabel`: The pan up button's label.
53264
53284
  * - `zoom-in-label`/`zoomInLabel`: The zoom in button's label.
53265
53285
  * - `zoom-out-label`/`zoomOutLabel`: The zoom out button's label.
53286
+ * - `ready`: Whether the map has been drawn whole, which `drawn()` says. For a page that
53287
+ * connects after `helix-map-ready` has been sent, and missed it. (property only) (readonly)
53266
53288
  * - `whenSettled`: Resolves a frame after the first update, when transitions are switched on.
53267
53289
  *
53268
53290
  * **Named `whenSettled` because `settled` is taken four times over**, by
@@ -53292,6 +53314,7 @@ export type CustomElementsSolidJs = {
53292
53314
  * - `helix-map-cluster`: A cluster was pressed. Sent from the marker that shows the cluster, with the names of its places.
53293
53315
  * - `helix-map-pan`: A pan button or arrow key was pressed. Move your map in response.
53294
53316
  * - `helix-map-part-change`: Clustering was turned on or off. Used by `connectMap`; pages do not need to listen for it.
53317
+ * - `helix-map-ready`: The map has been drawn whole: its style, every tile the view needs, and the ground where it has terrain. Sent once per connection. Show a map that is finished on it, where it would otherwise draw in stages.
53295
53318
  * - `helix-map-rotate`: A rotate or Face north button, or Shift with Left or Right, was pressed. Turn your map in response.
53296
53319
  * - `helix-map-tilt`: The 3D button, or Shift with Up or Down, was pressed. Tilt your map in response.
53297
53320
  * - `helix-map-zoom`: A zoom button or key was pressed, with a direction. Zoom your map in response.
@@ -53323,6 +53346,14 @@ export type CustomElementsSolidJs = {
53323
53346
  * animation is one sentence, and it is the view's state where there is one:
53324
53347
  * the zoom level, the way the map faces, its tilt. A pan has no state to
53325
53348
  * say, so it says which way the map moved.
53349
+ * - `drawn(whole = true) => void`: Says the map has been drawn whole, or with `false`, that it no longer is.
53350
+ *
53351
+ * **Called by whatever draws the map**, as `connectMap` does once its driver
53352
+ * has every tile the view needs and the ground where there is terrain, and
53353
+ * with `false` when it disconnects. A page drawing its own map calls it when
53354
+ * that map is finished. The first call after the map was not drawn sends
53355
+ * `helix-map-ready` and turns on `:state(ready)`, so a page can wait on the
53356
+ * event or select on the state, and a page that connects late reads `ready`.
53326
53357
  * - `rotate(by: number) => void`: Turns the map by some degrees, clockwise where positive.
53327
53358
  * - `faceNorth() => void`: Turns the map to face north.
53328
53359
  * - `tilt(by: number) => void`: Tilts the map by some degrees, toward the horizon where positive.
@@ -53380,6 +53411,7 @@ export type CustomElementsSolidJs = {
53380
53411
  *
53381
53412
  * - `fullscreen`: The map fills the screen.
53382
53413
  * - `idle`: The user has been still long enough for the header and footer to fade.
53414
+ * - `ready`: The map has been drawn whole, after `helix-map-ready`.
53383
53415
  * - `settled`: Set one frame after the first render. Transitions wait for it, so an element does not animate its own arrival.
53384
53416
  */
53385
53417
  "helix-headless-map": Partial<
package/types/vue.d.ts CHANGED
@@ -200,6 +200,7 @@ import type {
200
200
  HelixMapPartChangeEvent,
201
201
  HelixMapClusterEvent,
202
202
  HelixMapPanEvent,
203
+ HelixMapReadyEvent,
203
204
  HelixMapRotateEvent,
204
205
  HelixMapTiltEvent,
205
206
  HelixMapZoomEvent,
@@ -6169,6 +6170,9 @@ export type HelixHeadlessMapHelixMapPanElementEvent =
6169
6170
  /** `helix-map-part-change` event type */
6170
6171
  export type HelixHeadlessMapHelixMapPartChangeElementEvent =
6171
6172
  HelixHeadlessMapElementEvent<HelixMapPartChangeEvent>;
6173
+ /** `helix-map-ready` event type */
6174
+ export type HelixHeadlessMapHelixMapReadyElementEvent =
6175
+ HelixHeadlessMapElementEvent<HelixMapReadyEvent>;
6172
6176
  /** `helix-map-rotate` event type */
6173
6177
  export type HelixHeadlessMapHelixMapRotateElementEvent =
6174
6178
  HelixHeadlessMapElementEvent<HelixMapRotateEvent>;
@@ -6422,6 +6426,8 @@ export type HelixHeadlessMapVueEvents = {
6422
6426
  "helix-map-pan": HelixHeadlessMapHelixMapPanElementEvent;
6423
6427
  /** Clustering was turned on or off. Used by `connectMap`; pages do not need to listen for it. */
6424
6428
  "helix-map-part-change": HelixHeadlessMapHelixMapPartChangeElementEvent;
6429
+ /** The map has been drawn whole: its style, every tile the view needs, and the ground where it has terrain. Sent once per connection. Show a map that is finished on it, where it would otherwise draw in stages. */
6430
+ "helix-map-ready": HelixHeadlessMapHelixMapReadyElementEvent;
6425
6431
  /** A rotate or Face north button, or Shift with Left or Right, was pressed. Turn your map in response. */
6426
6432
  "helix-map-rotate": HelixHeadlessMapHelixMapRotateElementEvent;
6427
6433
  /** The 3D button, or Shift with Up or Down, was pressed. Tilt your map in response. */