@fusion.dev/helix-headless 0.4.6 → 0.5.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.
@@ -41551,7 +41551,7 @@
41551
41551
  "type": {
41552
41552
  "text": "string"
41553
41553
  },
41554
- "description": "The words, for a listbox that has to match text against them.\n\nRead from the rendered content rather than required as a property, because\nthe content is where a consumer naturally puts it and asking for both is\nasking for two things to disagree.\n\n**The default slot's content, never `this.textContent`.** An option holds\nthree slots: the words, plus `start` for an icon and `end` for a shortcut\nor a count. Neither of the latter two is what a reader searched for, and\n`textContent` runs both onto the end of it. Measured on a font picker whose\noptions carry a two-letter specimen in `end`: the field read\n`Noto Sans Linear BAg`, and typing `ag` matched 1,892 of 1,893 options,\nevery row containing the sample. An option with a keyboard shortcut in its\nend slot has the same fault and a worse one, every row carrying one matching\nevery letter of it.\n\nSix things read this: the collapsed field of Select and of Combobox, the\nlistbox's filter, Combobox's match against typed text, its inline\ncompletion, and the label on a chosen tag.\n\nA node goes to the default slot when it names no other, which is the rule\nthe platform applies at assignment. Asking the same question here rather\nthan a second one is what stops the two disagreeing. Text nodes are\nalways the default slot's and cannot say otherwise.",
41554
+ "description": "The words, for a listbox that has to match text against them.\n\nRead from the rendered content rather than required as a property, because\nthe content is where a consumer naturally puts it and asking for both is\nasking for two things to disagree.\n\n**The default slot's content, never `this.textContent`.** An option holds\nthree slots: the words, plus `start` for an icon and `end` for a shortcut\nor a count. Neither of the latter two is what a reader searched for, and\n`textContent` runs both onto the end of it. Measured on a font picker whose\noptions carry a two-letter specimen in `end`: the field read\n`Noto Sans Linear BAg`, and typing `ag` matched 1,892 of 1,893 options,\nevery row containing the sample. An option with a keyboard shortcut in its\nend slot has the same fault and a worse one, every row carrying one matching\nevery letter of it.\n\nSix things read this: the collapsed field of Select and of Combobox, the\nlistbox's filter, Combobox's match against typed text, its inline\ncompletion, and the label on a chosen tag.\n\nA node goes to the default slot when it names no other, which is the rule\nthe platform applies at assignment. Asking the same question here rather\nthan a second one is what stops the two disagreeing. Text nodes are\nalways the default slot's and cannot say otherwise.\n\n**Text and elements, named rather than \"not an element\".** The filter read\n`!(node instanceof Element) || node.slot === ''`, which admits a comment,\nand `textContent` on a comment is the comment's own body. Every option Lit\nrenders carries one: a child binding is marked with `<!--?lit$1234$-->`, so\nan option written as `` html`<${option}>${size}</${option}>` `` read back as\n`?lit$090648746$25`. Measured in `pagination/footer`, where the trigger\npainted exactly that instead of `25`, on both twins.\n\nIt is worse than one wrong label, because of the six readers listed above:\nthe filter and Combobox's match compare against this string, so a marker in\nit is in every comparison too.",
41555
41555
  "readonly": true
41556
41556
  },
41557
41557
  {
@@ -164,6 +164,18 @@ export declare class HelixHeadlessOption extends HelixElement {
164
164
  * the platform applies at assignment. Asking the same question here rather
165
165
  * than a second one is what stops the two disagreeing. Text nodes are
166
166
  * always the default slot's and cannot say otherwise.
167
+ *
168
+ * **Text and elements, named rather than "not an element".** The filter read
169
+ * `!(node instanceof Element) || node.slot === ''`, which admits a comment,
170
+ * and `textContent` on a comment is the comment's own body. Every option Lit
171
+ * renders carries one: a child binding is marked with `<!--?lit$1234$-->`, so
172
+ * an option written as `` html`<${option}>${size}</${option}>` `` read back as
173
+ * `?lit$090648746$25`. Measured in `pagination/footer`, where the trigger
174
+ * painted exactly that instead of `25`, on both twins.
175
+ *
176
+ * It is worse than one wrong label, because of the six readers listed above:
177
+ * the filter and Combobox's match compare against this string, so a marker in
178
+ * it is in every comparison too.
167
179
  */
168
180
  get text(): string;
169
181
  /** Makes this choice and announces it. */
@@ -27,7 +27,7 @@ let HelixHeadlessOption = class HelixHeadlessOption extends HelixElement {
27
27
  }
28
28
  get text() {
29
29
  return [...this.childNodes]
30
- .filter((node) => !(node instanceof Element) || node.slot === '')
30
+ .filter((node) => node.nodeType === Node.TEXT_NODE || (node instanceof Element && node.slot === ''))
31
31
  .map((node) => node.textContent ?? '')
32
32
  .join('')
33
33
  .trim();
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.4.6",
4
+ "version": "0.5.0",
5
5
  "license": "MIT",
6
6
  "author": "Ross Sheppard <ross.sheppard@fusion.dev>",
7
7
  "repository": {
@@ -45,14 +45,14 @@
45
45
  },
46
46
  "bugs": "https://github.com/project-fusion/fusion/issues",
47
47
  "dependencies": {
48
- "@fusion.dev/helix-core": "0.4.6",
49
- "@fusion.dev/helix-icons": "0.4.6",
48
+ "@fusion.dev/helix-core": "0.5.0",
49
+ "@fusion.dev/helix-icons": "0.5.0",
50
50
  "uqr": "^0.1.3"
51
51
  },
52
52
  "devDependencies": {
53
53
  "@custom-elements-manifest/analyzer": "^0.11.0",
54
- "@fusion.dev/helix-cem": "0.4.6",
55
- "@fusion.dev/helix-testing": "0.4.6",
54
+ "@fusion.dev/helix-cem": "0.5.0",
55
+ "@fusion.dev/helix-testing": "0.5.0",
56
56
  "@fusion.dev/scripts": "0.0.0-dev",
57
57
  "@happy-dom/global-registrator": "^20.0.0",
58
58
  "@lit-labs/ssr": "^3.3.0",
package/types/jsx.d.ts CHANGED
@@ -23172,7 +23172,19 @@ export type CustomElements = {
23172
23172
  * A node goes to the default slot when it names no other, which is the rule
23173
23173
  * the platform applies at assignment. Asking the same question here rather
23174
23174
  * than a second one is what stops the two disagreeing. Text nodes are
23175
- * always the default slot's and cannot say otherwise. (property only) (readonly)
23175
+ * always the default slot's and cannot say otherwise.
23176
+ *
23177
+ * **Text and elements, named rather than "not an element".** The filter read
23178
+ * `!(node instanceof Element) || node.slot === ''`, which admits a comment,
23179
+ * and `textContent` on a comment is the comment's own body. Every option Lit
23180
+ * renders carries one: a child binding is marked with `<!--?lit$1234$-->`, so
23181
+ * an option written as `` html`<${option}>${size}</${option}>` `` read back as
23182
+ * `?lit$090648746$25`. Measured in `pagination/footer`, where the trigger
23183
+ * painted exactly that instead of `25`, on both twins.
23184
+ *
23185
+ * It is worse than one wrong label, because of the six readers listed above:
23186
+ * the filter and Combobox's match compare against this string, so a marker in
23187
+ * it is in every comparison too. (property only) (readonly)
23176
23188
  * - `whenSettled`: Resolves a frame after the first update, when transitions are switched on.
23177
23189
  *
23178
23190
  * **Named `whenSettled` because `settled` is taken four times over**, by
@@ -37438,7 +37450,19 @@ export type CustomElementsSolidJs = {
37438
37450
  * A node goes to the default slot when it names no other, which is the rule
37439
37451
  * the platform applies at assignment. Asking the same question here rather
37440
37452
  * than a second one is what stops the two disagreeing. Text nodes are
37441
- * always the default slot's and cannot say otherwise. (property only) (readonly)
37453
+ * always the default slot's and cannot say otherwise.
37454
+ *
37455
+ * **Text and elements, named rather than "not an element".** The filter read
37456
+ * `!(node instanceof Element) || node.slot === ''`, which admits a comment,
37457
+ * and `textContent` on a comment is the comment's own body. Every option Lit
37458
+ * renders carries one: a child binding is marked with `<!--?lit$1234$-->`, so
37459
+ * an option written as `` html`<${option}>${size}</${option}>` `` read back as
37460
+ * `?lit$090648746$25`. Measured in `pagination/footer`, where the trigger
37461
+ * painted exactly that instead of `25`, on both twins.
37462
+ *
37463
+ * It is worse than one wrong label, because of the six readers listed above:
37464
+ * the filter and Combobox's match compare against this string, so a marker in
37465
+ * it is in every comparison too. (property only) (readonly)
37442
37466
  * - `whenSettled`: Resolves a frame after the first update, when transitions are switched on.
37443
37467
  *
37444
37468
  * **Named `whenSettled` because `settled` is taken four times over**, by