@jsenv/navi 0.29.380 → 0.29.382
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/dist/dev/jsenv_navi.js +31 -9
- package/dist/dev/jsenv_navi.js.map +3 -3
- package/dist/jsenv_navi.js +31 -9
- package/dist/jsenv_navi.js.map +3 -3
- package/docs/view_transitions.md +16 -7
- package/package.json +1 -1
package/dist/jsenv_navi.js
CHANGED
|
@@ -22296,11 +22296,13 @@ const withCurrentHandlers = (computed, props) => {
|
|
|
22296
22296
|
* - It runs the update no matter what. A transition is about the animation,
|
|
22297
22297
|
* never about the change.
|
|
22298
22298
|
* - It swallows the rejection a SKIPPED transition produces. Starting a
|
|
22299
|
-
* transition while another is running skips that other one, and
|
|
22300
|
-
*
|
|
22301
|
-
*
|
|
22302
|
-
*
|
|
22303
|
-
*
|
|
22299
|
+
* transition while another is running skips that other one, and so does the
|
|
22300
|
+
* document going hidden or its viewport changing size mid-movement; a skipped
|
|
22301
|
+
* transition rejects `ready` with a DOMException that has no stack. Nothing
|
|
22302
|
+
* is waiting on it, so the rejection surfaces as an unhandled error (a full
|
|
22303
|
+
* error overlay in dev, an `unhandledrejection` in an app's error reporting)
|
|
22304
|
+
* for something that is not an error at all — two updates close together is
|
|
22305
|
+
* normal in a list that is being edited, and a phone locks its screen.
|
|
22304
22306
|
*
|
|
22305
22307
|
* navi calls it from wherever it animates a DOM change itself (see list.jsx),
|
|
22306
22308
|
* which is why an application using navi finds the API already there.
|
|
@@ -22362,12 +22364,22 @@ const startViewTransition$2 = (updateCallback) => {
|
|
|
22362
22364
|
};
|
|
22363
22365
|
|
|
22364
22366
|
// "Skipped" is an outcome, not a failure — anything else is still a real error
|
|
22365
|
-
// and must keep travelling.
|
|
22367
|
+
// and must keep travelling. The browser skips for three reasons and names them
|
|
22368
|
+
// differently: `skipTransition()` / another transition starting is an
|
|
22369
|
+
// "AbortError" that says skipped, while a document hidden mid-movement, a
|
|
22370
|
+
// snapshot containing block that changed size (address bar folding, keyboard
|
|
22371
|
+
// opening) and the DOM-update timeout are "InvalidStateError"s that say
|
|
22372
|
+
// aborted. All three are recognized by the message: the name alone would let
|
|
22373
|
+
// an update callback throwing its own InvalidStateError pass for a skip.
|
|
22366
22374
|
const ignoreSkip = (e) => {
|
|
22367
22375
|
if (e && e.name === "AbortError") {
|
|
22368
22376
|
return;
|
|
22369
22377
|
}
|
|
22370
|
-
if (
|
|
22378
|
+
if (
|
|
22379
|
+
e &&
|
|
22380
|
+
typeof e.message === "string" &&
|
|
22381
|
+
/^Transition was (?:skipped|aborted)/.test(e.message)
|
|
22382
|
+
) {
|
|
22371
22383
|
return;
|
|
22372
22384
|
}
|
|
22373
22385
|
throw e;
|
|
@@ -39810,6 +39822,11 @@ const uiStateHoldsNothing = (uiState) => {
|
|
|
39810
39822
|
*/
|
|
39811
39823
|
const NO_ACTION_YET = Symbol("no_action_yet");
|
|
39812
39824
|
|
|
39825
|
+
// The control types rendered as an element `<label for>` can name: HTML's
|
|
39826
|
+
// labelable elements are button, input, select, textarea, output, meter and
|
|
39827
|
+
// progress — a picker's trigger is one of them, a link or a details is not.
|
|
39828
|
+
const CONTROL_TYPES_A_LABEL_CAN_POINT_AT = new Set(["button", "input", "select", "picker"]);
|
|
39829
|
+
|
|
39813
39830
|
// Resets field-specific contexts so nested fields inside this component
|
|
39814
39831
|
// don't inherit the current field's id, message props, or interface reporting.
|
|
39815
39832
|
// Sets ParentUIStateControllerContext to the leaf's own uiStateController so
|
|
@@ -39906,8 +39923,13 @@ const useControlProps = (props, {
|
|
|
39906
39923
|
standalone
|
|
39907
39924
|
} = props;
|
|
39908
39925
|
const idDefault = useId();
|
|
39909
|
-
|
|
39910
|
-
|
|
39926
|
+
// A Field's id is what its Label points at, so only a control a label can
|
|
39927
|
+
// point at (see the set) takes it. A link in the label's own text is a
|
|
39928
|
+
// control too, but never that target: taking the id would make two elements
|
|
39929
|
+
// answer for it, and the label would read the link's state as its control's.
|
|
39930
|
+
const fieldId = useContext(ControlIdContext);
|
|
39931
|
+
const labelable = CONTROL_TYPES_A_LABEL_CAN_POINT_AT.has(controlType);
|
|
39932
|
+
props.id = props.id || (labelable ? fieldId : undefined) || idDefault;
|
|
39911
39933
|
const controlName = useContext(ControlNameContext);
|
|
39912
39934
|
props.name = props.name || controlName;
|
|
39913
39935
|
const isCheckable = isCheckableInput(controlType, props.type);
|