@fusion.dev/helix-core 0.228.0 → 0.229.1
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 +1 -1
- package/dist/controllers/floating-controller/floating-controller.d.ts +1 -1
- package/dist/helix-form-element/report-in-place.d.ts +11 -0
- package/dist/helix-form-element/report-in-place.js +10 -0
- package/dist/mixins/mixin-field/mixin-field.js +3 -1
- package/dist/mixins/mixin-picker-feedback/mixin-picker-feedback.js +3 -1
- package/dist/mixins/mixin-voice/mixin-voice.js +1 -1
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +4 -4
|
@@ -16,7 +16,7 @@ export type { Side };
|
|
|
16
16
|
*
|
|
17
17
|
* **And a public attribute should not be defined by a dependency.** Floating UI
|
|
18
18
|
* adding a placement would widen five components' published API with nobody
|
|
19
|
-
* deciding to, which is the same argument that keeps a `
|
|
19
|
+
* deciding to, which is the same argument that keeps a `layout` union out of a
|
|
20
20
|
* shared type. The two are held equal in this controller's spec, where a type
|
|
21
21
|
* assertion is a test and is typechecked like one, so the day theirs widens is
|
|
22
22
|
* a failed build rather than a quiet change out there.
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Keeps a failed submit to one message.
|
|
3
|
+
*
|
|
4
|
+
* A control that draws its own feedback under the field also got the browser's
|
|
5
|
+
* bubble over it, so a reader saw the message twice, measured October 31, 2026.
|
|
6
|
+
* Refusing the `invalid` event removes the bubble. It also removes the focus the
|
|
7
|
+
* browser would have moved to the first invalid control, so the first one takes
|
|
8
|
+
* focus here. A fieldset is in `form.elements` and matches `:invalid` when a
|
|
9
|
+
* control inside it does, and it cannot hold focus, so it is passed over.
|
|
10
|
+
*/
|
|
11
|
+
export declare const reportInPlace: (control: HTMLElement, event: Event) => void;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export const reportInPlace = (control, event) => {
|
|
2
|
+
event.preventDefault();
|
|
3
|
+
const form = control.form;
|
|
4
|
+
const first = form
|
|
5
|
+
? [...form.elements].find((element) => element.localName !== 'fieldset' && element.matches(':invalid'))
|
|
6
|
+
: control;
|
|
7
|
+
if (first === control && event.isTrusted) {
|
|
8
|
+
control.focus();
|
|
9
|
+
}
|
|
10
|
+
};
|
|
@@ -3,6 +3,7 @@ import { html, nothing } from 'lit';
|
|
|
3
3
|
import { property, state } from 'lit/decorators.js';
|
|
4
4
|
import { auditField } from '@fusion.dev/helix-core/audits/name';
|
|
5
5
|
import { internalsOf } from '../../helix-element/helix-element.js';
|
|
6
|
+
import { reportInPlace } from '../../helix-form-element/report-in-place.js';
|
|
6
7
|
import { hostAria } from '../../utils/host-aria/host-aria.js';
|
|
7
8
|
const HINT_ID = 'helix-hint';
|
|
8
9
|
const FEEDBACK_ID = 'helix-feedback';
|
|
@@ -164,9 +165,10 @@ export const MixinField = (Base) => {
|
|
|
164
165
|
const touch = () => {
|
|
165
166
|
this.touched = true;
|
|
166
167
|
};
|
|
167
|
-
this.addEventListener('invalid', () => {
|
|
168
|
+
this.addEventListener('invalid', (event) => {
|
|
168
169
|
if (!this.checkingValidity) {
|
|
169
170
|
touch();
|
|
171
|
+
reportInPlace(this, event);
|
|
170
172
|
}
|
|
171
173
|
});
|
|
172
174
|
this.addEventListener('change', touch);
|
|
@@ -2,6 +2,7 @@ import { __decorate } from "tslib";
|
|
|
2
2
|
import { html, nothing } from 'lit';
|
|
3
3
|
import { property, state } from 'lit/decorators.js';
|
|
4
4
|
import { internalsOf } from '../../helix-element/helix-element.js';
|
|
5
|
+
import { reportInPlace } from '../../helix-form-element/report-in-place.js';
|
|
5
6
|
import { hostAria } from '../../utils/host-aria/host-aria.js';
|
|
6
7
|
export const MixinPickerFeedback = (Base) => {
|
|
7
8
|
class PickerFeedbackElement extends Base {
|
|
@@ -30,9 +31,10 @@ export const MixinPickerFeedback = (Base) => {
|
|
|
30
31
|
const touch = () => {
|
|
31
32
|
this.touched = true;
|
|
32
33
|
};
|
|
33
|
-
this.addEventListener('invalid', () => {
|
|
34
|
+
this.addEventListener('invalid', (event) => {
|
|
34
35
|
if (!this.checkingValidity) {
|
|
35
36
|
touch();
|
|
37
|
+
reportInPlace(this, event);
|
|
36
38
|
}
|
|
37
39
|
});
|
|
38
40
|
this.addEventListener('change', touch);
|
|
@@ -179,7 +179,7 @@ export const MixinVoice = (Base) => {
|
|
|
179
179
|
const tier = this.constructor.tier;
|
|
180
180
|
if (this.heard && customElements.get(`${tier}voice-level`)) {
|
|
181
181
|
const meter = this.tag('voice-level');
|
|
182
|
-
return html `<${meter} part="voice-level" exportparts="canvas: voice-level-canvas" aria-hidden="true"
|
|
182
|
+
return html `<${meter} part="voice-level" exportparts="canvas: voice-level-canvas" aria-hidden="true" pattern="spectrum"></${meter}>`;
|
|
183
183
|
}
|
|
184
184
|
return drawIcon(microphone);
|
|
185
185
|
}
|
package/dist/version.d.ts
CHANGED
package/dist/version.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const VERSION = '0.
|
|
1
|
+
export const VERSION = '0.229.1';
|
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.
|
|
4
|
+
"version": "0.229.1",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "Fusion Development Group",
|
|
7
7
|
"repository": {
|
|
@@ -81,12 +81,12 @@
|
|
|
81
81
|
"bugs": "https://github.com/project-fusion/fusion/issues",
|
|
82
82
|
"dependencies": {
|
|
83
83
|
"@floating-ui/dom": "^1.8.0",
|
|
84
|
-
"@fusion.dev/helix-icons": "0.
|
|
84
|
+
"@fusion.dev/helix-icons": "0.229.1",
|
|
85
85
|
"tslib": "^2.8.1"
|
|
86
86
|
},
|
|
87
87
|
"devDependencies": {
|
|
88
|
-
"@fusion.dev/helix-cem": "0.
|
|
89
|
-
"@fusion.dev/helix-testing": "0.
|
|
88
|
+
"@fusion.dev/helix-cem": "0.229.1",
|
|
89
|
+
"@fusion.dev/helix-testing": "0.229.1",
|
|
90
90
|
"@lit-labs/ssr": "^4.1.0",
|
|
91
91
|
"lit": "^3.2.1"
|
|
92
92
|
},
|