@magicx-eng/ai-autocomplete-vanilla 0.38.2 → 0.38.3
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/index.d.mts +20 -13
- package/dist/index.d.ts +20 -13
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +1 -1
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -2171,23 +2171,29 @@ interface ScrollArrowArgs {
|
|
|
2171
2171
|
declare function attachScrollArrow({ dropdown, grid, button, }: ScrollArrowArgs): ScrollArrowController;
|
|
2172
2172
|
|
|
2173
2173
|
/**
|
|
2174
|
-
* Small pictures from Shopify's image CDN, for PNG uploads.
|
|
2174
|
+
* Small pictures from Shopify's image CDN, for PNG and WebP uploads.
|
|
2175
2175
|
*
|
|
2176
2176
|
* A Shopify catalog's `image_url` is the original upload, drawn here in a
|
|
2177
2177
|
* 40px option square or a 116px product card. PNG product photos are the
|
|
2178
2178
|
* heavy ones: an 830×1080 PNG is 1–2 MB, and picking "Lehengas" on
|
|
2179
|
-
* gayathrisarees.com loaded 16.5 MB of them.
|
|
2180
|
-
*
|
|
2181
|
-
*
|
|
2179
|
+
* gayathrisarees.com loaded 16.5 MB of them. WebP uploads are lighter but
|
|
2180
|
+
* still far more than a tile needs: opening the search on solene.shop loaded
|
|
2181
|
+
* 992 KB of them for six category tiles, 48 KB at `width=120`. Shopify
|
|
2182
|
+
* resizes on request (`?width=`) and caches every resize at its edge. JPEG
|
|
2183
|
+
* uploads are left as they are (tens to a few hundred KB).
|
|
2182
2184
|
*
|
|
2183
2185
|
* `format=pjpg` is set too, because some PNG uploads carry megabytes of Adobe
|
|
2184
2186
|
* XMP metadata that Shopify copies into every resize: one Gayathri Sarees
|
|
2185
2187
|
* photo came back 1.6 MB at `width=200` as PNG and 4.1 MB as AVIF, while
|
|
2186
2188
|
* `width=200&format=pjpg` (a progressive JPEG, metadata dropped) was 28 KB.
|
|
2187
|
-
*
|
|
2188
|
-
*
|
|
2189
|
-
*
|
|
2190
|
-
*
|
|
2189
|
+
* Shopify keeps a PNG that has an alpha channel as WebP/AVIF instead, so a
|
|
2190
|
+
* transparent cut-out is never flattened. A WebP upload gets `width` alone:
|
|
2191
|
+
* it has no such bloat, and Shopify's own pick (AVIF or WebP) is smaller than
|
|
2192
|
+
* a JPEG (48 KB against 68 KB for Solene's twelve).
|
|
2193
|
+
*
|
|
2194
|
+
* Only Shopify-hosted PNG and WebP files are touched —
|
|
2195
|
+
* `cdn.shopify.com/s/files/…` and a store's own `/cdn/shop/…`. Any other URL
|
|
2196
|
+
* comes back unchanged. The widths are fixed
|
|
2191
2197
|
* (three times the default drawn size, for 3× phone screens) rather than
|
|
2192
2198
|
* measured, so every visitor asks for the same URL and hits the same cached
|
|
2193
2199
|
* resize.
|
|
@@ -2197,22 +2203,23 @@ declare const OPTION_IMAGE_WIDTH = 120;
|
|
|
2197
2203
|
/** Product-strip cards (116px). */
|
|
2198
2204
|
declare const PRODUCT_IMAGE_WIDTH = 360;
|
|
2199
2205
|
/**
|
|
2200
|
-
* `url` asked for at `width`
|
|
2201
|
-
* otherwise `url` unchanged. Any `width`
|
|
2202
|
-
* replaced; other parameters (`v=`, the
|
|
2206
|
+
* `url` asked for at `width` when it is a Shopify-hosted PNG (with
|
|
2207
|
+
* `format=pjpg`) or WebP; otherwise `url` unchanged. Any `width` already on
|
|
2208
|
+
* the URL is replaced, and a PNG's `format` too; other parameters (`v=`, the
|
|
2209
|
+
* cache-busting version) are kept. A
|
|
2203
2210
|
* root-relative URL (a store's own `/cdn/shop/…`) is read against the page and
|
|
2204
2211
|
* stays relative.
|
|
2205
2212
|
*/
|
|
2206
2213
|
declare function shopifyImageSrc(url: string, width: number): string;
|
|
2207
2214
|
/**
|
|
2208
2215
|
* The URLs a product card tries for `imageUrl`, in order (`imageSources` at
|
|
2209
|
-
* the card width): trimmed, sized down when it is a Shopify-hosted PNG, with
|
|
2216
|
+
* the card width): trimmed, sized down when it is a Shopify-hosted PNG or WebP, with
|
|
2210
2217
|
* the original as the fallback. Empty for an absent or blank URL.
|
|
2211
2218
|
*/
|
|
2212
2219
|
declare function productImageSources(url: string | null | undefined): string[];
|
|
2213
2220
|
/**
|
|
2214
2221
|
* The `src` a product card draws `imageUrl` with first: trimmed, and sized
|
|
2215
|
-
* down when it is a Shopify-hosted PNG. `undefined` for an absent or blank URL.
|
|
2222
|
+
* down when it is a Shopify-hosted PNG or WebP. `undefined` for an absent or blank URL.
|
|
2216
2223
|
*/
|
|
2217
2224
|
declare function productImageSrc(url: string | null | undefined): string | undefined;
|
|
2218
2225
|
|
package/dist/index.d.ts
CHANGED
|
@@ -2171,23 +2171,29 @@ interface ScrollArrowArgs {
|
|
|
2171
2171
|
declare function attachScrollArrow({ dropdown, grid, button, }: ScrollArrowArgs): ScrollArrowController;
|
|
2172
2172
|
|
|
2173
2173
|
/**
|
|
2174
|
-
* Small pictures from Shopify's image CDN, for PNG uploads.
|
|
2174
|
+
* Small pictures from Shopify's image CDN, for PNG and WebP uploads.
|
|
2175
2175
|
*
|
|
2176
2176
|
* A Shopify catalog's `image_url` is the original upload, drawn here in a
|
|
2177
2177
|
* 40px option square or a 116px product card. PNG product photos are the
|
|
2178
2178
|
* heavy ones: an 830×1080 PNG is 1–2 MB, and picking "Lehengas" on
|
|
2179
|
-
* gayathrisarees.com loaded 16.5 MB of them.
|
|
2180
|
-
*
|
|
2181
|
-
*
|
|
2179
|
+
* gayathrisarees.com loaded 16.5 MB of them. WebP uploads are lighter but
|
|
2180
|
+
* still far more than a tile needs: opening the search on solene.shop loaded
|
|
2181
|
+
* 992 KB of them for six category tiles, 48 KB at `width=120`. Shopify
|
|
2182
|
+
* resizes on request (`?width=`) and caches every resize at its edge. JPEG
|
|
2183
|
+
* uploads are left as they are (tens to a few hundred KB).
|
|
2182
2184
|
*
|
|
2183
2185
|
* `format=pjpg` is set too, because some PNG uploads carry megabytes of Adobe
|
|
2184
2186
|
* XMP metadata that Shopify copies into every resize: one Gayathri Sarees
|
|
2185
2187
|
* photo came back 1.6 MB at `width=200` as PNG and 4.1 MB as AVIF, while
|
|
2186
2188
|
* `width=200&format=pjpg` (a progressive JPEG, metadata dropped) was 28 KB.
|
|
2187
|
-
*
|
|
2188
|
-
*
|
|
2189
|
-
*
|
|
2190
|
-
*
|
|
2189
|
+
* Shopify keeps a PNG that has an alpha channel as WebP/AVIF instead, so a
|
|
2190
|
+
* transparent cut-out is never flattened. A WebP upload gets `width` alone:
|
|
2191
|
+
* it has no such bloat, and Shopify's own pick (AVIF or WebP) is smaller than
|
|
2192
|
+
* a JPEG (48 KB against 68 KB for Solene's twelve).
|
|
2193
|
+
*
|
|
2194
|
+
* Only Shopify-hosted PNG and WebP files are touched —
|
|
2195
|
+
* `cdn.shopify.com/s/files/…` and a store's own `/cdn/shop/…`. Any other URL
|
|
2196
|
+
* comes back unchanged. The widths are fixed
|
|
2191
2197
|
* (three times the default drawn size, for 3× phone screens) rather than
|
|
2192
2198
|
* measured, so every visitor asks for the same URL and hits the same cached
|
|
2193
2199
|
* resize.
|
|
@@ -2197,22 +2203,23 @@ declare const OPTION_IMAGE_WIDTH = 120;
|
|
|
2197
2203
|
/** Product-strip cards (116px). */
|
|
2198
2204
|
declare const PRODUCT_IMAGE_WIDTH = 360;
|
|
2199
2205
|
/**
|
|
2200
|
-
* `url` asked for at `width`
|
|
2201
|
-
* otherwise `url` unchanged. Any `width`
|
|
2202
|
-
* replaced; other parameters (`v=`, the
|
|
2206
|
+
* `url` asked for at `width` when it is a Shopify-hosted PNG (with
|
|
2207
|
+
* `format=pjpg`) or WebP; otherwise `url` unchanged. Any `width` already on
|
|
2208
|
+
* the URL is replaced, and a PNG's `format` too; other parameters (`v=`, the
|
|
2209
|
+
* cache-busting version) are kept. A
|
|
2203
2210
|
* root-relative URL (a store's own `/cdn/shop/…`) is read against the page and
|
|
2204
2211
|
* stays relative.
|
|
2205
2212
|
*/
|
|
2206
2213
|
declare function shopifyImageSrc(url: string, width: number): string;
|
|
2207
2214
|
/**
|
|
2208
2215
|
* The URLs a product card tries for `imageUrl`, in order (`imageSources` at
|
|
2209
|
-
* the card width): trimmed, sized down when it is a Shopify-hosted PNG, with
|
|
2216
|
+
* the card width): trimmed, sized down when it is a Shopify-hosted PNG or WebP, with
|
|
2210
2217
|
* the original as the fallback. Empty for an absent or blank URL.
|
|
2211
2218
|
*/
|
|
2212
2219
|
declare function productImageSources(url: string | null | undefined): string[];
|
|
2213
2220
|
/**
|
|
2214
2221
|
* The `src` a product card draws `imageUrl` with first: trimmed, and sized
|
|
2215
|
-
* down when it is a Shopify-hosted PNG. `undefined` for an absent or blank URL.
|
|
2222
|
+
* down when it is a Shopify-hosted PNG or WebP. `undefined` for an absent or blank URL.
|
|
2216
2223
|
*/
|
|
2217
2224
|
declare function productImageSrc(url: string | null | undefined): string | undefined;
|
|
2218
2225
|
|