@fusion.dev/helix-headless 0.53.2 → 0.53.3

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.
@@ -36,9 +36,10 @@ declare const HelixHeadlessDataTable_base: (new (...args: any[]) => import("@fus
36
36
  * **`selectable` adds a column of checkboxes, keyed on `row-key`.** A row is
37
37
  * selected by its identity rather than its position, so a selection survives a
38
38
  * sort, a filter and a page. `selected` is the chosen keys, comma separated, the
39
- * shape Listbox uses for a multiple choice, and like `sort` it is controlled
40
- * when set and seeded by `default-selected`. The box in the heading selects every
41
- * row in the result, across pages, and shows a dash while only some are chosen.
39
+ * shape Listbox uses for a multiple choice, and like `sort` writing it applies
40
+ * while `default-selected` is what the markup declared. The box in the heading
41
+ * selects every row in the result, across pages, and shows a dash while only
42
+ * some are chosen.
42
43
  * Choosing one of many, rather than several, is opening a row, and that is a
43
44
  * link or a button in a cell rather than a selection.
44
45
  *
@@ -91,7 +91,7 @@ export declare class HelixHeadlessDonutChart extends HelixHeadlessDonutChart_bas
91
91
  * `--donut-chart-stroke`, which is a number a rule can do sums with where the
92
92
  * word is not. Reflected, it wrote a value onto every host a script had set
93
93
  * it on for nothing to read. `sweep` beside it is the converse and reflects,
94
- * because three rules select on it.
94
+ * because the styled sheet selects on it.
95
95
  */
96
96
  hole?: 'large' | 'none' | 'small';
97
97
  /**
@@ -56,20 +56,19 @@ declare const HelixHeadlessFilterInput_base: (new (...args: any[]) => import("@f
56
56
  * `selectionStart` and `setSelectionRange` to write a completion back and put
57
57
  * the caret after it, or the next parse reads the wrong term.
58
58
  *
59
- * **Three things here have three different owners, and only one of them is a
60
- * controlled property.**
59
+ * **Three things here have three different owners.**
61
60
  *
62
- * `value` is the text, and it is uncontrolled by default: the reader types, the
63
- * element applies it, and `input` says so. **Writing `value` does not take that
64
- * over.** It is a seed and a correction, so a consumer who sets it and then
65
- * expects the field to hold still will watch the next keystroke overwrite them.
61
+ * `value` is the text: the reader types, the element applies it, and `input`
62
+ * says so. **Writing `value` does not take that over.** It is a seed and a
63
+ * correction, so a consumer who sets it and then expects the field to hold
64
+ * still will watch the next keystroke overwrite them.
66
65
  * Ownership is taken by refusing `helix-before-change` and writing the value
67
66
  * you want, which is the same shape every field in this library uses and is
68
67
  * worth saying out loud here because the property looks like React's.
69
68
  * `default-value` seeds the field without claiming anything.
70
69
  *
71
- * `open` is the suggestions panel, and it is the ordinary controlled pair:
72
- * refuse `helix-before-open` or `helix-before-close` to take the decision, and
70
+ * `open` is the suggestions panel, and it is the ordinary pair: refuse
71
+ * `helix-before-open` or `helix-before-close` to take the decision, and
73
72
  * `default-open` to seed it.
74
73
  *
75
74
  * The tokens are neither, because they are not state. They are the consumer's
@@ -153,6 +153,16 @@ export declare class HelixHeadlessObjectInspector extends HelixElement {
153
153
  private active;
154
154
  /** Set by a keyboard move, so the next render brings the active row into view. */
155
155
  private revealing;
156
+ /**
157
+ * How tall a row is taken to be before it has been drawn, in pixels.
158
+ *
159
+ * A constant rather than the property `VirtualList` and `DataTable` carry:
160
+ * every row here is one line of the same text at this family's own leading,
161
+ * so there is nothing for a consumer to tell it. `reveal` falls back to this
162
+ * when a drawn row measures zero, and the two have to be the same number or a
163
+ * keyboard move scrolls by a different row than the window counted with.
164
+ */
165
+ static readonly ESTIMATE = 24;
156
166
  private readonly virtualize;
157
167
  private get root();
158
168
  /** Every visible row, in order, worked out once per change rather than per read. */
@@ -4,6 +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
+ var HelixHeadlessObjectInspector_1;
7
8
  import { CopyController, customElement, HelixElement, inlineStep, scrollItemIntoView, VirtualizeController, } from '@fusion.dev/helix-core';
8
9
  import { caretDown, caretRight } from '@fusion.dev/helix-icons';
9
10
  import { html, nothing } from 'lit';
@@ -30,7 +31,7 @@ let HelixHeadlessObjectInspector = class HelixHeadlessObjectInspector extends He
30
31
  this.virtualize = new VirtualizeController(this, {
31
32
  container: () => (this.windowed ? this.partNamed('tree') : null),
32
33
  count: () => this.rows.length,
33
- estimate: () => 24,
34
+ estimate: () => HelixHeadlessObjectInspector_1.ESTIMATE,
34
35
  measured: () => this.windowed,
35
36
  rows: () => [...(this.renderRoot?.querySelectorAll('[part~="row"]') ?? [])].map((element) => ({ element, index: Number(element.dataset.index) })),
36
37
  });
@@ -95,6 +96,8 @@ let HelixHeadlessObjectInspector = class HelixHeadlessObjectInspector extends He
95
96
  event.preventDefault();
96
97
  };
97
98
  }
99
+ static { HelixHeadlessObjectInspector_1 = this; }
100
+ static { this.ESTIMATE = 24; }
98
101
  get root() {
99
102
  return this.value === undefined ? this.read : this.value;
100
103
  }
@@ -196,7 +199,7 @@ let HelixHeadlessObjectInspector = class HelixHeadlessObjectInspector extends He
196
199
  if (!tree || !this.windowed || !first || !last || attempts === 0) {
197
200
  return;
198
201
  }
199
- const height = first.offsetHeight || 24;
202
+ const height = first.offsetHeight || HelixHeadlessObjectInspector_1.ESTIMATE;
200
203
  const from = Number(this.active > Number(last.dataset.index) ? last.dataset.index : first.dataset.index);
201
204
  tree.scrollTop += (this.active - from) * height;
202
205
  this.virtualize.measure();
@@ -347,7 +350,7 @@ __decorate([
347
350
  __decorate([
348
351
  state()
349
352
  ], HelixHeadlessObjectInspector.prototype, "active", void 0);
350
- HelixHeadlessObjectInspector = __decorate([
353
+ HelixHeadlessObjectInspector = HelixHeadlessObjectInspector_1 = __decorate([
351
354
  customElement('helix-headless-object-inspector')
352
355
  ], HelixHeadlessObjectInspector);
353
356
  export { HelixHeadlessObjectInspector };
@@ -72,11 +72,10 @@ export declare class HelixHeadlessOption extends HelixElement {
72
72
  * A second destination for this row, taken with the modifier held.
73
73
  *
74
74
  * **An attribute rather than a second row, which is the whole point.** A
75
- * palette of eighty-eight components that offered each of them a reference
76
- * page and a sandbox as separate entries would be a palette of a hundred and
77
- * seventy-six, and one earns its keep by getting a reader to one thing in
78
- * three keystrokes. The row already carries the first destination, so the
79
- * second belongs beside it.
75
+ * palette that offered every component a reference page and a sandbox as
76
+ * separate entries would be twice as long, and one earns its keep by getting
77
+ * a reader to one thing in three keystrokes. The row already carries the
78
+ * first destination, so the second belongs beside it.
80
79
  *
81
80
  * Declared here and acted on by whatever owns the list, the same division
82
81
  * selection already uses: an option says what it is and the listbox decides
@@ -269,9 +269,9 @@ export declare class HelixHeadlessPagination extends HelixElement {
269
269
  /**
270
270
  * Says where the reader now is, once they have moved.
271
271
  *
272
- * In `updated` rather than in `request`, so it covers both modes: a controlled
273
- * consumer assigns `page` and never goes through the request path at all, and
274
- * a reader who got there that way deserves the same sentence.
272
+ * In `updated` rather than in `request`, so it covers every path a page moves
273
+ * by: a consumer assigning `page` reaches no request at all, and a reader who
274
+ * got there that way deserves the same sentence.
275
275
  */
276
276
  protected updated(changed: PropertyValues): void;
277
277
  /**
@@ -27,7 +27,8 @@ import '../../select/index.js';
27
27
  * way, through `ElementInternals.states` rather than an attribute the server
28
28
  * never wrote.
29
29
  *
30
- * `value` is the controlled property and `default-value` seeds one this owns.
30
+ * `value` is the size the control holds and `default-value` is what the markup
31
+ * declared.
31
32
  * Changing it announces `helix-before-change`; re-querying and moving back to
32
33
  * page one is the consumer's, because only they know whether the reader's
33
34
  * position should survive it.
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.53.2",
4
+ "version": "0.53.3",
5
5
  "license": "MIT",
6
6
  "author": "Ross Sheppard <ross.sheppard@fusion.dev>",
7
7
  "repository": {
@@ -46,14 +46,14 @@
46
46
  },
47
47
  "bugs": "https://github.com/project-fusion/fusion/issues",
48
48
  "dependencies": {
49
- "@fusion.dev/helix-core": "0.53.2",
50
- "@fusion.dev/helix-icons": "0.53.2",
49
+ "@fusion.dev/helix-core": "0.53.3",
50
+ "@fusion.dev/helix-icons": "0.53.3",
51
51
  "uqr": "^0.1.3"
52
52
  },
53
53
  "devDependencies": {
54
54
  "@custom-elements-manifest/analyzer": "^0.11.0",
55
- "@fusion.dev/helix-cem": "0.53.2",
56
- "@fusion.dev/helix-testing": "0.53.2",
55
+ "@fusion.dev/helix-cem": "0.53.3",
56
+ "@fusion.dev/helix-testing": "0.53.3",
57
57
  "@fusion.dev/scripts": "0.0.0-dev",
58
58
  "@happy-dom/global-registrator": "^20.0.0",
59
59
  "@lit-labs/ssr": "^4.1.0",