@fusion.dev/helix-core 0.179.0 → 0.180.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.
@@ -378,6 +378,15 @@
378
378
  "default": "'inline'",
379
379
  "description": "Which axis the readings are laid out along.\n\n**An axis and not a boolean, because two of the four charts do not use x.**\nA horizontal bar chart runs its categories *down* the box, so resolving\nevery reading from the pointer's x leaves a move from the first row to the\nlast never changing the answer: measured on four rows, all four reported\nthe third, which is the slot the middle of the box falls in. It looks like\na tooltip that will not follow and is a tooltip reading the wrong axis.\n\n`none` is the ring. Its slices are real elements at every angle, so the\nreading under the pointer is the one the pointer is over, and arithmetic on\neither axis would answer with whichever slice shared a coordinate: at three\no'clock and at nine o'clock, x alone gives the same slice for opposite\nsides. The slices call `set` and this only holds the answer."
380
380
  },
381
+ {
382
+ "kind": "field",
383
+ "name": "drawnLtr",
384
+ "type": {
385
+ "text": "boolean"
386
+ },
387
+ "default": "false",
388
+ "description": "Whether the plot is drawn left to right on every page, as Scatter Chart's\nplane is, so the arrows follow the drawing rather than the page's\ndirection. Off, the arrow pointing along the line of text moves on."
389
+ },
381
390
  {
382
391
  "kind": "field",
383
392
  "name": "onReading",
@@ -12852,6 +12861,14 @@
12852
12861
  "path": "src/index.ts",
12853
12862
  "declarations": [],
12854
12863
  "exports": [
12864
+ {
12865
+ "kind": "js",
12866
+ "name": "auditChildren",
12867
+ "declaration": {
12868
+ "name": "auditChildren",
12869
+ "package": "#audit-children"
12870
+ }
12871
+ },
12855
12872
  {
12856
12873
  "kind": "js",
12857
12874
  "name": "auditName",
@@ -24587,6 +24604,86 @@
24587
24604
  }
24588
24605
  ]
24589
24606
  },
24607
+ {
24608
+ "kind": "javascript-module",
24609
+ "path": "src/utils/audit-children/audit-children-off.ts",
24610
+ "declarations": [
24611
+ {
24612
+ "kind": "function",
24613
+ "name": "auditChildren",
24614
+ "description": "The unregistered-child warning in a production build: nothing.\n\n`#audit-children` resolves here unless the bundler or runtime asks for the\n`development` condition, so a production build carries none of the audit's\ncode. The signature is the audit's, so a call site reads the same in both\nbuilds. See `audit-children.ts`.",
24615
+ "type": {
24616
+ "text": "typeof audit"
24617
+ }
24618
+ }
24619
+ ],
24620
+ "exports": [
24621
+ {
24622
+ "kind": "js",
24623
+ "name": "auditChildren",
24624
+ "declaration": {
24625
+ "name": "auditChildren",
24626
+ "module": "src/utils/audit-children/audit-children-off.ts"
24627
+ }
24628
+ }
24629
+ ]
24630
+ },
24631
+ {
24632
+ "kind": "javascript-module",
24633
+ "path": "src/utils/audit-children/audit-children.ts",
24634
+ "declarations": [
24635
+ {
24636
+ "kind": "function",
24637
+ "name": "auditChildren",
24638
+ "return": {
24639
+ "type": {
24640
+ "text": "void"
24641
+ }
24642
+ },
24643
+ "parameters": [
24644
+ {
24645
+ "name": "host",
24646
+ "type": {
24647
+ "text": "HTMLElement"
24648
+ }
24649
+ },
24650
+ {
24651
+ "name": "part",
24652
+ "type": {
24653
+ "text": "string"
24654
+ }
24655
+ },
24656
+ {
24657
+ "name": "entry",
24658
+ "type": {
24659
+ "text": "string"
24660
+ }
24661
+ },
24662
+ {
24663
+ "name": "consequence",
24664
+ "type": {
24665
+ "text": "string"
24666
+ }
24667
+ },
24668
+ {
24669
+ "name": "drawn",
24670
+ "default": "false"
24671
+ }
24672
+ ],
24673
+ "description": "Reports a child from another family that a container holds and nobody\nregistered, naming the entry to import.\n\n**A container does not register another family's children.** An option\nbelongs to the Option family, and a page writing one inside a Select imports\n`@fusion.dev/helix/option` itself, as it imports the Select. Left out, the\noption is an unknown element: the list reads no choices and nothing throws.\nThis says so, once for each container tag and child tag on the page, with\nthe line to add.\n\nAsked once the page has loaded and painted, so an entry a later module\nimports is not taken for a missing one.\n\n**In a development build only**, as `missing-name` is: every container would\npay for a sentence meant for the person writing the page. Core imports it as\n`#audit-children`, which `package.json` resolves here under the\n`development` condition and to `audit-children-off.ts`, which does nothing,\neverywhere else.\n\n`part` is the child's tag after the tier, such as `option`, and `entry` its\nfamily's entry, such as `option`; the host's `tier` gives the rest of both.\n`consequence` says what the missing child costs, after \"so\". `drawn` is for\nchildren the host draws from data, such as the options of Listbox's `items`:\nthe page wrote none, so an undefined tag is reported without one in the\nhost's light DOM."
24674
+ }
24675
+ ],
24676
+ "exports": [
24677
+ {
24678
+ "kind": "js",
24679
+ "name": "auditChildren",
24680
+ "declaration": {
24681
+ "name": "auditChildren",
24682
+ "module": "src/utils/audit-children/audit-children.ts"
24683
+ }
24684
+ }
24685
+ ]
24686
+ },
24590
24687
  {
24591
24688
  "kind": "javascript-module",
24592
24689
  "path": "src/utils/audit-name/audit-name-off.ts",
@@ -33987,7 +34084,7 @@
33987
34084
  "type": {
33988
34085
  "text": "string"
33989
34086
  },
33990
- "default": "'0.179.0'",
34087
+ "default": "'0.180.0'",
33991
34088
  "description": "The version of the package this file ships in.\n\n**Written by `fusion/scripts/version.mjs`** wherever it writes the package's\n`package.json`, and stamped back into the repository beside it after a\nrelease, so the two never disagree; a spec beside this holds them to it.\nNothing else in the running code knows which release it is."
33992
34089
  }
33993
34090
  ],
@@ -34623,6 +34720,6 @@
34623
34720
  ],
34624
34721
  "helix": {
34625
34722
  "package": "@fusion.dev/helix-core",
34626
- "version": "0.179.0"
34723
+ "version": "0.180.0"
34627
34724
  }
34628
34725
  }
@@ -162,6 +162,12 @@ export declare class ChartPointerController implements ReactiveController {
162
162
  * sides. The slices call `set` and this only holds the answer.
163
163
  */
164
164
  axis: 'block' | 'inline' | 'none';
165
+ /**
166
+ * Whether the plot is drawn left to right on every page, as Scatter Chart's
167
+ * plane is, so the arrows follow the drawing rather than the page's
168
+ * direction. Off, the arrow pointing along the line of text moves on.
169
+ */
170
+ drawnLtr: boolean;
165
171
  /**
166
172
  * Hears the reading: `change` each time it moves or is put away, and
167
173
  * `press` when it is clicked, tapped, or pressed with Enter or Space.
@@ -10,6 +10,7 @@ export class ChartPointerController {
10
10
  this.keyed = false;
11
11
  this.series = -1;
12
12
  this.axis = 'inline';
13
+ this.drawnLtr = false;
13
14
  this.by = 'mouse';
14
15
  this.said = { at: -1, series: -1 };
15
16
  this.tapped = false;
@@ -87,7 +88,7 @@ export class ChartPointerController {
87
88
  count,
88
89
  grid: this.grid,
89
90
  page: this.page(count),
90
- rtl: isRtl(this.host),
91
+ rtl: !this.drawnLtr && isRtl(this.host),
91
92
  series: this.columns().length,
92
93
  });
93
94
  if (next === undefined) {
package/dist/index.d.ts CHANGED
@@ -1,3 +1,4 @@
1
+ export { auditChildren } from '@fusion.dev/helix-core/audits/children';
1
2
  export { auditName } from '@fusion.dev/helix-core/audits/name';
2
3
  export { auditNesting } from '@fusion.dev/helix-core/audits/nesting';
3
4
  export { auditServed } from '@fusion.dev/helix-core/audits/served';
package/dist/index.js CHANGED
@@ -1,3 +1,4 @@
1
+ export { auditChildren } from '@fusion.dev/helix-core/audits/children';
1
2
  export { auditName } from '@fusion.dev/helix-core/audits/name';
2
3
  export { auditNesting } from '@fusion.dev/helix-core/audits/nesting';
3
4
  export { auditServed } from '@fusion.dev/helix-core/audits/served';
@@ -0,0 +1,10 @@
1
+ import type { auditChildren as audit } from './audit-children.js';
2
+ /**
3
+ * The unregistered-child warning in a production build: nothing.
4
+ *
5
+ * `#audit-children` resolves here unless the bundler or runtime asks for the
6
+ * `development` condition, so a production build carries none of the audit's
7
+ * code. The signature is the audit's, so a call site reads the same in both
8
+ * builds. See `audit-children.ts`.
9
+ */
10
+ export declare const auditChildren: typeof audit;
@@ -0,0 +1 @@
1
+ export const auditChildren = () => { };
@@ -0,0 +1,28 @@
1
+ /**
2
+ * Reports a child from another family that a container holds and nobody
3
+ * registered, naming the entry to import.
4
+ *
5
+ * **A container does not register another family's children.** An option
6
+ * belongs to the Option family, and a page writing one inside a Select imports
7
+ * `@fusion.dev/helix/option` itself, as it imports the Select. Left out, the
8
+ * option is an unknown element: the list reads no choices and nothing throws.
9
+ * This says so, once for each container tag and child tag on the page, with
10
+ * the line to add.
11
+ *
12
+ * Asked once the page has loaded and painted, so an entry a later module
13
+ * imports is not taken for a missing one.
14
+ *
15
+ * **In a development build only**, as `missing-name` is: every container would
16
+ * pay for a sentence meant for the person writing the page. Core imports it as
17
+ * `#audit-children`, which `package.json` resolves here under the
18
+ * `development` condition and to `audit-children-off.ts`, which does nothing,
19
+ * everywhere else.
20
+ *
21
+ * `part` is the child's tag after the tier, such as `option`, and `entry` its
22
+ * family's entry, such as `option`; the host's `tier` gives the rest of both.
23
+ * `consequence` says what the missing child costs, after "so". `drawn` is for
24
+ * children the host draws from data, such as the options of Listbox's `items`:
25
+ * the page wrote none, so an undefined tag is reported without one in the
26
+ * host's light DOM.
27
+ */
28
+ export declare const auditChildren: (host: HTMLElement, part: string, entry: string, consequence: string, drawn?: boolean) => void;
@@ -0,0 +1,37 @@
1
+ import { reportRuntime } from '../report-runtime/report-runtime.js';
2
+ const reported = new Set();
3
+ export const auditChildren = (host, part, entry, consequence, drawn = false) => {
4
+ if (typeof window === 'undefined') {
5
+ return;
6
+ }
7
+ const tier = host.constructor.tier ?? 'helix-headless-';
8
+ const tag = `${tier}${part}`;
9
+ const key = `${host.localName}>${tag}`;
10
+ if (reported.has(key)) {
11
+ return;
12
+ }
13
+ const check = () => {
14
+ if (reported.has(key) ||
15
+ !host.isConnected ||
16
+ customElements.get(tag) !== undefined ||
17
+ (!drawn && host.querySelector(tag) === null)) {
18
+ return;
19
+ }
20
+ reported.add(key);
21
+ const pkg = tier === 'helix-' ? '@fusion.dev/helix' : '@fusion.dev/helix-headless';
22
+ reportRuntime({
23
+ kind: 'unregistered-part',
24
+ message: `<${tag}> in <${host.localName}> is not registered, so ${consequence}. Import '${pkg}/${entry}'.`,
25
+ tag: host.localName,
26
+ });
27
+ };
28
+ const frame = () => {
29
+ requestAnimationFrame(check);
30
+ };
31
+ if (document.readyState === 'complete') {
32
+ frame();
33
+ }
34
+ else {
35
+ window.addEventListener('load', frame, { once: true });
36
+ }
37
+ };
package/dist/version.d.ts CHANGED
@@ -6,4 +6,4 @@
6
6
  * release, so the two never disagree; a spec beside this holds them to it.
7
7
  * Nothing else in the running code knows which release it is.
8
8
  */
9
- export declare const VERSION = "0.179.0";
9
+ export declare const VERSION = "0.180.0";
package/dist/version.js CHANGED
@@ -1 +1 @@
1
- export const VERSION = '0.179.0';
1
+ export const VERSION = '0.180.0';
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@fusion.dev/helix-core",
3
3
  "description": "Helix element primitives: base classes, mixins, decorators, utilities.",
4
- "version": "0.179.0",
4
+ "version": "0.180.0",
5
5
  "license": "MIT",
6
6
  "author": "Ross Sheppard <ross.sheppard@fusion.dev>",
7
7
  "repository": {
@@ -17,6 +17,12 @@
17
17
  "types": "./dist/index.d.ts",
18
18
  "default": "./dist/index.js"
19
19
  },
20
+ "./audits/children": {
21
+ "types": "./dist/utils/audit-children/audit-children.d.ts",
22
+ "development": "./dist/utils/audit-children/audit-children.js",
23
+ "helix-development": "./dist/utils/audit-children/audit-children.js",
24
+ "default": "./dist/utils/audit-children/audit-children-off.js"
25
+ },
20
26
  "./audits/name": {
21
27
  "types": "./dist/utils/audit-name/audit-name.d.ts",
22
28
  "development": "./dist/utils/audit-name/audit-name.js",
@@ -68,16 +74,21 @@
68
74
  "bugs": "https://github.com/project-fusion/fusion/issues",
69
75
  "dependencies": {
70
76
  "@floating-ui/dom": "^1.8.0",
71
- "@fusion.dev/helix-icons": "0.179.0"
77
+ "@fusion.dev/helix-icons": "0.180.0"
72
78
  },
73
79
  "devDependencies": {
74
- "@fusion.dev/helix-cem": "0.179.0",
75
- "@fusion.dev/helix-testing": "0.179.0",
80
+ "@fusion.dev/helix-cem": "0.180.0",
81
+ "@fusion.dev/helix-testing": "0.180.0",
76
82
  "@lit-labs/ssr": "^4.1.0",
77
83
  "lit": "^3.2.1"
78
84
  },
79
85
  "homepage": "https://fusion.dev",
80
86
  "imports": {
87
+ "#audit-children": {
88
+ "development": "./src/utils/audit-children/audit-children.ts",
89
+ "helix-development": "./src/utils/audit-children/audit-children.ts",
90
+ "default": "./src/utils/audit-children/audit-children-off.ts"
91
+ },
81
92
  "#audit-name": {
82
93
  "development": "./src/utils/audit-name/audit-name.ts",
83
94
  "helix-development": "./src/utils/audit-name/audit-name.ts",