@fusion.dev/helix-headless 0.49.0 → 0.49.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
CHANGED
|
@@ -81056,6 +81056,16 @@
|
|
|
81056
81056
|
"default": "undefined",
|
|
81057
81057
|
"description": "Where the divider was before the gesture that may be about to shut it.\n\nA drag writes a position on every pointer move, so by the time it reaches\nthe edge the number it started from is gone. Taken once, on the press, and\nwritten back if the gesture ends shut, so the pane opens to where it was\nrather than to the edge it was dragged against."
|
|
81058
81058
|
},
|
|
81059
|
+
{
|
|
81060
|
+
"kind": "field",
|
|
81061
|
+
"name": "began",
|
|
81062
|
+
"type": {
|
|
81063
|
+
"text": "number | undefined"
|
|
81064
|
+
},
|
|
81065
|
+
"privacy": "private",
|
|
81066
|
+
"default": "undefined",
|
|
81067
|
+
"description": "Where the divider was when the gesture now under way began.\n\nTaken on the press, read once by `settle` and cleared there. `undefined`\nbetween gestures and for every discrete path, where nothing has been\napplied yet and so the position it has *is* the position it began at.\n\nBeside `opened` rather than folded into it: that one is `undefined` for a\npane that starts shut, which is a different question and a real answer."
|
|
81068
|
+
},
|
|
81059
81069
|
{
|
|
81060
81070
|
"kind": "field",
|
|
81061
81071
|
"name": "reached",
|
|
@@ -81294,7 +81304,7 @@
|
|
|
81294
81304
|
}
|
|
81295
81305
|
}
|
|
81296
81306
|
],
|
|
81297
|
-
"description": "Says the arrangement has settled, so a consumer can keep it.\n\nThrough the audited path, so a consumer who owns `position` is told what was\nasked for and decides, and one who does not has already had it applied.\n\n**The second announcement is conditional on the first, because it is derived\nfrom it.** `shutAt` reads the position the gesture ended on, so a refused\n`helix-before-resize` leaves a collapse computed from a number that was\nrefused. Announced anyway, the refusal produced the outcome it was refusing:\nmeasured on a divider at 40 with a listener calling `preventDefault`, Home\nleft `position` reporting 0 and `collapsed` reporting `start`, because the\ncollapse applied and `position` reads the sliver once a pane is shut. The\nreturn of the first request is what says so, and it was being dropped: a\ncancelable event dispatched as a bare statement with nothing reading the\nanswer, which is the shape the navigation cohort named on `Outline` and left.\n\nRefusing the collapse alone still leaves the resize, which is the other way\nround and is coherent: the divider goes where the drag put it and the pane\nis not declared shut. What a consumer cannot have is a pane that collapses\nout from under a position they said no to."
|
|
81307
|
+
"description": "Says the arrangement has settled, so a consumer can keep it.\n\nThrough the audited path, so a consumer who owns `position` is told what was\nasked for and decides, and one who does not has already had it applied.\n\n**The second announcement is conditional on the first, because it is derived\nfrom it.** `shutAt` reads the position the gesture ended on, so a refused\n`helix-before-resize` leaves a collapse computed from a number that was\nrefused. Announced anyway, the refusal produced the outcome it was refusing:\nmeasured on a divider at 40 with a listener calling `preventDefault`, Home\nleft `position` reporting 0 and `collapsed` reporting `start`, because the\ncollapse applied and `position` reads the sliver once a pane is shut. The\nreturn of the first request is what says so, and it was being dropped: a\ncancelable event dispatched as a bare statement with nothing reading the\nanswer, which is the shape the navigation cohort named on `Outline` and left.\n\nRefusing the collapse alone still leaves the resize, which is the other way\nround and is coherent: the divider goes where the drag put it and the pane\nis not declared shut. What a consumer cannot have is a pane that collapses\nout from under a position they said no to.\n\n**A gesture that moved nothing announces nothing, and this is the one place\nthat can say so.** A change carrying the position the divider already had\nrewrites a consumer's stored value from a gesture that moved nothing:\nharmless where the value round-trips exactly, and not where it does not,\nwhich is any consumer storing pixels and dividing by a box. The separator's\n`pointerup` held that as an early return of its own and was the only door\nwith one. There are five: the separator's pointer and arrows, the corner's\npointer and arrows, and a double click through `reset`, and `moveTo` is a\nsixth a consumer can open. Measured in Chromium 17 Sep 2026 on the built\nbundle, every door but the guarded one announced a move of zero: a corner\npress with nothing between announced on both splitters, `Home` on a divider\nalready at its minimum announced, and a double click on one already at its\ndefault announced.\n\n**Measured against where the gesture began, and not against `position`.**\n`move` applies as it goes, so by the time a drag settles the position is\nalready the number about to be announced, and comparing those two would\nsilence every drag there is. `began` is the press; a discrete path takes\nnone and compares against the position, which for it is the same thing.\n\n**Per divider rather than per gesture, which is the corner's question.** The\ncorner drives two at once, so \"moved nothing\" cannot mean \"neither moved\":\na drag along one axis moves one of them, and the other would be announcing\na number nobody asked to change. Each settles on its own and guards on its\nown, so the one that moved still announces while the one that did not stays\nquiet. That is also why the guard cannot live in `handleCornerUp`, which\nonly ever sees the pair.\n\n**The collapse counts as movement, because a refusal can leave the two\ndisagreeing.** A consumer who refuses `helix-before-collapse` has a pane at\nthe edge that is not declared shut, and a guard reading the position alone\nwould then never offer the collapse again: `Home` is already at the\nminimum, so every later press is a move of zero."
|
|
81298
81308
|
},
|
|
81299
81309
|
{
|
|
81300
81310
|
"kind": "field",
|
|
@@ -81806,7 +81816,7 @@
|
|
|
81806
81816
|
"type": {
|
|
81807
81817
|
"text": "HelixBeforeResizeEvent"
|
|
81808
81818
|
},
|
|
81809
|
-
"description": "Fired before the divider settles. Cancelable: refusing it takes the whole of where the gesture ended, so no collapse follows from it either. A drag has already drawn itself by then and holds where it was dropped until the consumer assigns their own.",
|
|
81819
|
+
"description": "Fired before the divider settles, and only where the gesture moved it: a press that moved nothing, a drag that came back, an arrow with nowhere left to go and a corner that moved the other divider are all silent on this one. Cancelable: refusing it takes the whole of where the gesture ended, so no collapse follows from it either. A drag has already drawn itself by then and holds where it was dropped until the consumer assigns their own.",
|
|
81810
81820
|
"name": "helix-before-resize",
|
|
81811
81821
|
"reactProp": "onhelix-before-resize"
|
|
81812
81822
|
}
|
|
@@ -42,7 +42,7 @@ import { type PropertyValues, type TemplateResult } from 'lit';
|
|
|
42
42
|
* @slot start - The pane before the divider.
|
|
43
43
|
*
|
|
44
44
|
* @event {HelixBeforeCollapseEvent} helix-before-collapse - Fired before a pane shuts or reopens, and only where the position it is derived from stood. Cancelable: refusing it leaves the pane as it was and the divider where the gesture put it.
|
|
45
|
-
* @event {HelixBeforeResizeEvent} helix-before-resize - Fired before the divider settles. Cancelable: refusing it takes the whole of where the gesture ended, so no collapse follows from it either. A drag has already drawn itself by then and holds where it was dropped until the consumer assigns their own.
|
|
45
|
+
* @event {HelixBeforeResizeEvent} helix-before-resize - Fired before the divider settles, and only where the gesture moved it: a press that moved nothing, a drag that came back, an arrow with nowhere left to go and a corner that moved the other divider are all silent on this one. Cancelable: refusing it takes the whole of where the gesture ended, so no collapse follows from it either. A drag has already drawn itself by then and holds where it was dropped until the consumer assigns their own.
|
|
46
46
|
*
|
|
47
47
|
* @csspart corner - The handle where two dividers cross, added on the client.
|
|
48
48
|
* @csspart end - The box holding the second.
|
|
@@ -183,6 +183,17 @@ export declare class HelixHeadlessSplitter extends HelixElement {
|
|
|
183
183
|
* rather than to the edge it was dragged against.
|
|
184
184
|
*/
|
|
185
185
|
private opened;
|
|
186
|
+
/**
|
|
187
|
+
* Where the divider was when the gesture now under way began.
|
|
188
|
+
*
|
|
189
|
+
* Taken on the press, read once by `settle` and cleared there. `undefined`
|
|
190
|
+
* between gestures and for every discrete path, where nothing has been
|
|
191
|
+
* applied yet and so the position it has *is* the position it began at.
|
|
192
|
+
*
|
|
193
|
+
* Beside `opened` rather than folded into it: that one is `undefined` for a
|
|
194
|
+
* pane that starts shut, which is a different question and a real answer.
|
|
195
|
+
*/
|
|
196
|
+
private began;
|
|
186
197
|
/**
|
|
187
198
|
* Where the gesture has moved to, whether or not it was applied. See `move`.
|
|
188
199
|
*
|
|
@@ -335,6 +346,40 @@ export declare class HelixHeadlessSplitter extends HelixElement {
|
|
|
335
346
|
* round and is coherent: the divider goes where the drag put it and the pane
|
|
336
347
|
* is not declared shut. What a consumer cannot have is a pane that collapses
|
|
337
348
|
* out from under a position they said no to.
|
|
349
|
+
*
|
|
350
|
+
* **A gesture that moved nothing announces nothing, and this is the one place
|
|
351
|
+
* that can say so.** A change carrying the position the divider already had
|
|
352
|
+
* rewrites a consumer's stored value from a gesture that moved nothing:
|
|
353
|
+
* harmless where the value round-trips exactly, and not where it does not,
|
|
354
|
+
* which is any consumer storing pixels and dividing by a box. The separator's
|
|
355
|
+
* `pointerup` held that as an early return of its own and was the only door
|
|
356
|
+
* with one. There are five: the separator's pointer and arrows, the corner's
|
|
357
|
+
* pointer and arrows, and a double click through `reset`, and `moveTo` is a
|
|
358
|
+
* sixth a consumer can open. Measured in Chromium 17 Sep 2026 on the built
|
|
359
|
+
* bundle, every door but the guarded one announced a move of zero: a corner
|
|
360
|
+
* press with nothing between announced on both splitters, `Home` on a divider
|
|
361
|
+
* already at its minimum announced, and a double click on one already at its
|
|
362
|
+
* default announced.
|
|
363
|
+
*
|
|
364
|
+
* **Measured against where the gesture began, and not against `position`.**
|
|
365
|
+
* `move` applies as it goes, so by the time a drag settles the position is
|
|
366
|
+
* already the number about to be announced, and comparing those two would
|
|
367
|
+
* silence every drag there is. `began` is the press; a discrete path takes
|
|
368
|
+
* none and compares against the position, which for it is the same thing.
|
|
369
|
+
*
|
|
370
|
+
* **Per divider rather than per gesture, which is the corner's question.** The
|
|
371
|
+
* corner drives two at once, so "moved nothing" cannot mean "neither moved":
|
|
372
|
+
* a drag along one axis moves one of them, and the other would be announcing
|
|
373
|
+
* a number nobody asked to change. Each settles on its own and guards on its
|
|
374
|
+
* own, so the one that moved still announces while the one that did not stays
|
|
375
|
+
* quiet. That is also why the guard cannot live in `handleCornerUp`, which
|
|
376
|
+
* only ever sees the pair.
|
|
377
|
+
*
|
|
378
|
+
* **The collapse counts as movement, because a refusal can leave the two
|
|
379
|
+
* disagreeing.** A consumer who refuses `helix-before-collapse` has a pane at
|
|
380
|
+
* the edge that is not declared shut, and a guard reading the position alone
|
|
381
|
+
* would then never offer the collapse again: `Home` is already at the
|
|
382
|
+
* minimum, so every later press is a move of zero.
|
|
338
383
|
*/
|
|
339
384
|
private settle;
|
|
340
385
|
private readonly handlePointerDown;
|
|
@@ -22,6 +22,7 @@ let HelixHeadlessSplitter = HelixHeadlessSplitter_1 = class HelixHeadlessSplitte
|
|
|
22
22
|
this.positionState = undefined;
|
|
23
23
|
this.collapsedState = undefined;
|
|
24
24
|
this.opened = undefined;
|
|
25
|
+
this.began = undefined;
|
|
25
26
|
this.reached = undefined;
|
|
26
27
|
this.dragging = false;
|
|
27
28
|
this.crossings = [];
|
|
@@ -38,6 +39,7 @@ let HelixHeadlessSplitter = HelixHeadlessSplitter_1 = class HelixHeadlessSplitte
|
|
|
38
39
|
: { length: box.width, start: box.left };
|
|
39
40
|
capturePointer(separator, event.pointerId);
|
|
40
41
|
this.opened = this.collapsed ? undefined : this.position;
|
|
42
|
+
this.began = this.position;
|
|
41
43
|
this.reached = undefined;
|
|
42
44
|
this.dragging = true;
|
|
43
45
|
event.preventDefault();
|
|
@@ -62,10 +64,7 @@ let HelixHeadlessSplitter = HelixHeadlessSplitter_1 = class HelixHeadlessSplitte
|
|
|
62
64
|
}
|
|
63
65
|
this.origin = null;
|
|
64
66
|
this.dragging = false;
|
|
65
|
-
|
|
66
|
-
return;
|
|
67
|
-
}
|
|
68
|
-
this.settle(this.reached);
|
|
67
|
+
this.settle(this.reached ?? this.position);
|
|
69
68
|
};
|
|
70
69
|
this.handleKeydown = (event) => {
|
|
71
70
|
const toward = this.travel(event.key);
|
|
@@ -117,6 +116,8 @@ let HelixHeadlessSplitter = HelixHeadlessSplitter_1 = class HelixHeadlessSplitte
|
|
|
117
116
|
capturePointer(handle, event.pointerId);
|
|
118
117
|
this.opened = this.collapsed ? undefined : this.position;
|
|
119
118
|
crossing.by.opened = crossing.by.collapsed ? undefined : crossing.by.position;
|
|
119
|
+
this.began = this.position;
|
|
120
|
+
crossing.by.began = crossing.by.position;
|
|
120
121
|
this.reached = undefined;
|
|
121
122
|
crossing.by.reached = undefined;
|
|
122
123
|
this.dragging = true;
|
|
@@ -299,6 +300,11 @@ let HelixHeadlessSplitter = HelixHeadlessSplitter_1 = class HelixHeadlessSplitte
|
|
|
299
300
|
settle(next) {
|
|
300
301
|
const wanted = this.clamp(next);
|
|
301
302
|
const shut = this.shutAt(wanted);
|
|
303
|
+
const began = this.began ?? this.position;
|
|
304
|
+
this.began = undefined;
|
|
305
|
+
if (wanted === began && shut === this.collapsed) {
|
|
306
|
+
return;
|
|
307
|
+
}
|
|
302
308
|
const moved = requestChange({
|
|
303
309
|
apply: (value) => {
|
|
304
310
|
const previous = this.position;
|
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.49.
|
|
4
|
+
"version": "0.49.1",
|
|
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.49.
|
|
50
|
-
"@fusion.dev/helix-icons": "0.49.
|
|
49
|
+
"@fusion.dev/helix-core": "0.49.1",
|
|
50
|
+
"@fusion.dev/helix-icons": "0.49.1",
|
|
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.49.
|
|
56
|
-
"@fusion.dev/helix-testing": "0.49.
|
|
55
|
+
"@fusion.dev/helix-cem": "0.49.1",
|
|
56
|
+
"@fusion.dev/helix-testing": "0.49.1",
|
|
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",
|
package/types/jsx.d.ts
CHANGED
|
@@ -13338,7 +13338,7 @@ has an honest answer. */
|
|
|
13338
13338
|
"onhelix-before-collapse"?: ((
|
|
13339
13339
|
e: HelixHeadlessSplitterHelixBeforeCollapseElementEvent,
|
|
13340
13340
|
) => void) | undefined;
|
|
13341
|
-
/** Fired before the divider settles. Cancelable: refusing it takes the whole of where the gesture ended, so no collapse follows from it either. A drag has already drawn itself by then and holds where it was dropped until the consumer assigns their own. */
|
|
13341
|
+
/** Fired before the divider settles, and only where the gesture moved it: a press that moved nothing, a drag that came back, an arrow with nowhere left to go and a corner that moved the other divider are all silent on this one. Cancelable: refusing it takes the whole of where the gesture ended, so no collapse follows from it either. A drag has already drawn itself by then and holds where it was dropped until the consumer assigns their own. */
|
|
13342
13342
|
"onhelix-before-resize"?: ((
|
|
13343
13343
|
e: HelixHeadlessSplitterHelixBeforeResizeElementEvent,
|
|
13344
13344
|
) => void) | undefined;
|
|
@@ -13442,7 +13442,7 @@ has an honest answer. */
|
|
|
13442
13442
|
"on:helix-before-collapse"?: ((
|
|
13443
13443
|
e: HelixHeadlessSplitterHelixBeforeCollapseElementEvent,
|
|
13444
13444
|
) => void) | undefined;
|
|
13445
|
-
/** Fired before the divider settles. Cancelable: refusing it takes the whole of where the gesture ended, so no collapse follows from it either. A drag has already drawn itself by then and holds where it was dropped until the consumer assigns their own. */
|
|
13445
|
+
/** Fired before the divider settles, and only where the gesture moved it: a press that moved nothing, a drag that came back, an arrow with nowhere left to go and a corner that moved the other divider are all silent on this one. Cancelable: refusing it takes the whole of where the gesture ended, so no collapse follows from it either. A drag has already drawn itself by then and holds where it was dropped until the consumer assigns their own. */
|
|
13446
13446
|
"on:helix-before-resize"?: ((
|
|
13447
13447
|
e: HelixHeadlessSplitterHelixBeforeResizeElementEvent,
|
|
13448
13448
|
) => void) | undefined;
|
|
@@ -31146,7 +31146,7 @@ export type CustomElements = {
|
|
|
31146
31146
|
* Events that will be emitted by the component.
|
|
31147
31147
|
*
|
|
31148
31148
|
* - `helix-before-collapse`: Fired before a pane shuts or reopens, and only where the position it is derived from stood. Cancelable: refusing it leaves the pane as it was and the divider where the gesture put it.
|
|
31149
|
-
* - `helix-before-resize`: Fired before the divider settles. Cancelable: refusing it takes the whole of where the gesture ended, so no collapse follows from it either. A drag has already drawn itself by then and holds where it was dropped until the consumer assigns their own.
|
|
31149
|
+
* - `helix-before-resize`: Fired before the divider settles, and only where the gesture moved it: a press that moved nothing, a drag that came back, an arrow with nowhere left to go and a corner that moved the other divider are all silent on this one. Cancelable: refusing it takes the whole of where the gesture ended, so no collapse follows from it either. A drag has already drawn itself by then and holds where it was dropped until the consumer assigns their own.
|
|
31150
31150
|
*
|
|
31151
31151
|
* ## Slots
|
|
31152
31152
|
*
|
|
@@ -49194,7 +49194,7 @@ export type CustomElementsSolidJs = {
|
|
|
49194
49194
|
* Events that will be emitted by the component.
|
|
49195
49195
|
*
|
|
49196
49196
|
* - `helix-before-collapse`: Fired before a pane shuts or reopens, and only where the position it is derived from stood. Cancelable: refusing it leaves the pane as it was and the divider where the gesture put it.
|
|
49197
|
-
* - `helix-before-resize`: Fired before the divider settles. Cancelable: refusing it takes the whole of where the gesture ended, so no collapse follows from it either. A drag has already drawn itself by then and holds where it was dropped until the consumer assigns their own.
|
|
49197
|
+
* - `helix-before-resize`: Fired before the divider settles, and only where the gesture moved it: a press that moved nothing, a drag that came back, an arrow with nowhere left to go and a corner that moved the other divider are all silent on this one. Cancelable: refusing it takes the whole of where the gesture ended, so no collapse follows from it either. A drag has already drawn itself by then and holds where it was dropped until the consumer assigns their own.
|
|
49198
49198
|
*
|
|
49199
49199
|
* ## Slots
|
|
49200
49200
|
*
|
package/types/vue.d.ts
CHANGED
|
@@ -6879,7 +6879,7 @@ has an honest answer. */
|
|
|
6879
6879
|
export type HelixHeadlessSplitterVueEvents = {
|
|
6880
6880
|
/** Fired before a pane shuts or reopens, and only where the position it is derived from stood. Cancelable: refusing it leaves the pane as it was and the divider where the gesture put it. */
|
|
6881
6881
|
"helix-before-collapse": HelixHeadlessSplitterHelixBeforeCollapseElementEvent;
|
|
6882
|
-
/** Fired before the divider settles. Cancelable: refusing it takes the whole of where the gesture ended, so no collapse follows from it either. A drag has already drawn itself by then and holds where it was dropped until the consumer assigns their own. */
|
|
6882
|
+
/** Fired before the divider settles, and only where the gesture moved it: a press that moved nothing, a drag that came back, an arrow with nowhere left to go and a corner that moved the other divider are all silent on this one. Cancelable: refusing it takes the whole of where the gesture ended, so no collapse follows from it either. A drag has already drawn itself by then and holds where it was dropped until the consumer assigns their own. */
|
|
6883
6883
|
"helix-before-resize": HelixHeadlessSplitterHelixBeforeResizeElementEvent;
|
|
6884
6884
|
};
|
|
6885
6885
|
|