@jsenv/navi 0.29.446 → 0.29.447
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 +16 -0
- package/dist/dev/jsenv_navi.js.map +2 -2
- package/dist/jsenv_navi.js +16 -0
- package/dist/jsenv_navi.js.map +2 -2
- package/docs/AI_INSTRUCTIONS.md +4 -2
- package/docs/scroll.md +38 -0
- package/package.json +1 -1
package/dist/jsenv_navi.js
CHANGED
|
@@ -93477,6 +93477,12 @@ const DEFAULT_PLACEHOLDER_LIGHT = "#d4d8dd";
|
|
|
93477
93477
|
const DEFAULT_PLACEHOLDER_DARK = "#374151";
|
|
93478
93478
|
|
|
93479
93479
|
/**
|
|
93480
|
+
* The props may come in any order: `src` and `srcset` reach the element after
|
|
93481
|
+
* `loading` and the other hints. A plain `<img>` (or `<Box as="img">`) written
|
|
93482
|
+
* in JSX must put `loading` before `src`: WebKit, so every browser on iOS,
|
|
93483
|
+
* decides whether to load when `src` is set, and an image whose `src` came
|
|
93484
|
+
* first loads, lazy or not.
|
|
93485
|
+
*
|
|
93480
93486
|
* @param {string|false} [props.placeholderColor] - Background color shown while the image loads.
|
|
93481
93487
|
* Defaults to a light gray. Pass `false` to disable.
|
|
93482
93488
|
* @param {boolean} [props.placeholderDark] - Use a dark default placeholder color,
|
|
@@ -93486,6 +93492,9 @@ const DEFAULT_PLACEHOLDER_DARK = "#374151";
|
|
|
93486
93492
|
const Image = ({
|
|
93487
93493
|
placeholderColor,
|
|
93488
93494
|
placeholderDark = false,
|
|
93495
|
+
srcset,
|
|
93496
|
+
srcSet,
|
|
93497
|
+
src,
|
|
93489
93498
|
...rest
|
|
93490
93499
|
}) => {
|
|
93491
93500
|
import.meta.css = [css$5, "@jsenv/navi/src/graphic/image.jsx"];
|
|
@@ -93510,6 +93519,13 @@ const Image = ({
|
|
|
93510
93519
|
imageEl.setAttribute("navi-loaded", "");
|
|
93511
93520
|
rest.onLoad?.(e);
|
|
93512
93521
|
}
|
|
93522
|
+
// Last, srcset before src: an <img> decides its request when they are
|
|
93523
|
+
// set, with the attributes it has at that moment. WebKit loads an image
|
|
93524
|
+
// whose src arrives before loading="lazy", and does not take it back.
|
|
93525
|
+
,
|
|
93526
|
+
srcset: srcset,
|
|
93527
|
+
srcSet: srcSet,
|
|
93528
|
+
src: src
|
|
93513
93529
|
});
|
|
93514
93530
|
};
|
|
93515
93531
|
|