@depict-ai/ui 4.8.11 → 4.8.13

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/ES10/index.cjs CHANGED
@@ -114,7 +114,7 @@ $parcel$export(module.exports, "BreadCrumbs", () => $335c02c1241a9ca8$export$5b7
114
114
  $parcel$export(module.exports, "QuickLinks", () => $335c02c1241a9ca8$export$de035477d6fef996);
115
115
  $parcel$export(module.exports, "CategoryPage", () => $c10e33c4681f8c9b$export$e2bf8ce7779e827e);
116
116
  /*! Depict.ai search and product listing SDK */
117
- const $aa1938dec50d6c12$export$83d89fbfd8236492 = "4.8.11";
117
+ const $aa1938dec50d6c12$export$83d89fbfd8236492 = "4.8.13";
118
118
  function $054b1113e4897051$export$54c6d6ff54e72743(whatToWatch) {
119
119
  const [width, setWidth] = $52FdA$solidjs.createSignal(0);
120
120
  const [height, setHeight] = $52FdA$solidjs.createSignal(0);
@@ -259,7 +259,7 @@ function $858fdcf73148519f$export$6e5611bc7e57e477(props) {
259
259
  };
260
260
  });
261
261
  // Work around https://github.com/solidjs/solid/issues/1828
262
- const [, otherAttributes] = $52FdA$solidjs.splitProps(props, ["resolutions", "size", "src", "srcSet", "loading", "keyRatioUpdating", "sizeHeight", "customUrls" // Can't have properties ending on underscore because the property name mangling will get confused by this <-
262
+ const [, otherAttributes] = $52FdA$solidjs.splitProps(props, ["resolutions", "size", "src", "srcSet", "loading", "keyRatioUpdating", "sizeHeight", "onDecoded", "customUrls" // Can't have properties ending on underscore because the property name mangling will get confused by this <-
263
263
  ]);
264
264
 
265
265
  const [hasSetSize, setHasSetSize] = $52FdA$solidjs.createSignal(false);
@@ -388,11 +388,13 @@ function $858fdcf73148519f$export$6e5611bc7e57e477(props) {
388
388
  }
389
389
  img.decode().catch(e => $52FdA$depictaiutilishared.dwarn("Failed to decode image", e, img)) // Display the image also if loading failed so webdev can debug and doesn't get "no image"
390
390
  .then(async () => {
391
+ var _props$onDecoded;
391
392
  // Also wait with inserting image (i.e. paint) until browser is idle
392
393
  await new Promise(r => executeWhenIdleBatched(r, false));
393
394
  if (gotCleanedUp) return;
394
395
  setHasDecoded(true);
395
396
  hasDecodedFastPath = true;
397
+ (_props$onDecoded = props.onDecoded) === null || _props$onDecoded === void 0 || _props$onDecoded.call(props);
396
398
  });
397
399
  });
398
400
  $52FdA$solidjs.createEffect(() => hasDecoded() && requestAnimationFrame($52FdA$depictaiutilishared.catchify(() => setRAFSinceReturned(prev => !prev))));
@@ -16053,6 +16055,7 @@ function $c19709057a32b2e7$export$780a853d15174484(_ref) {
16053
16055
  } = _ref;
16054
16056
  let wroteAspectRatioToContainer = false; // Only write this once so we don't get into a aspect ratio changed -> size changed -> image source changed -> aspect ratio slightly changed infinite loop
16055
16057
  const [wrapperSize, setWrapperSize] = $52FdA$solidjs.createSignal();
16058
+ const [hasLoaded, setHasLoaded] = $52FdA$solidjs.createSignal(false);
16056
16059
  const isImage = type_ === "image";
16057
16060
  const setAspectRatio = aspectRatio => {
16058
16061
  if (wroteAspectRatioToContainer) return;
@@ -16077,9 +16080,16 @@ function $c19709057a32b2e7$export$780a853d15174484(_ref) {
16077
16080
  href: link_
16078
16081
  }, {
16079
16082
  get children() {
16080
- return [$52FdA$solidjsweb.createComponent((0, $b8a8d61b3ec5f5ac$export$3f37af283f8fb843), {
16081
- width: "100%",
16082
- height: "100%"
16083
+ return [$52FdA$solidjsweb.createComponent((0, $52FdA$solidjs.Show), {
16084
+ get when() {
16085
+ return !hasLoaded();
16086
+ },
16087
+ get children() {
16088
+ return $52FdA$solidjsweb.createComponent((0, $b8a8d61b3ec5f5ac$export$3f37af283f8fb843), {
16089
+ width: "100%",
16090
+ height: "100%"
16091
+ });
16092
+ }
16083
16093
  }), $52FdA$solidjsweb.createComponent((0, $52FdA$solidjs.Switch), {
16084
16094
  get children() {
16085
16095
  return [$52FdA$solidjsweb.createComponent((0, $52FdA$solidjs.Match), {
@@ -16096,6 +16106,7 @@ function $c19709057a32b2e7$export$780a853d15174484(_ref) {
16096
16106
  },
16097
16107
  src: mediaUrl_,
16098
16108
  "class": "d-standard-content",
16109
+ onDecoded: () => setHasLoaded(true),
16099
16110
  ref: el => el.addEventListener("load", $52FdA$depictaiutilisharedlatest.catchify(() => setAspectRatio(el.naturalWidth / el.naturalHeight)))
16100
16111
  });
16101
16112
  }
@@ -16110,6 +16121,7 @@ function $c19709057a32b2e7$export$780a853d15174484(_ref) {
16110
16121
  if (pageVisible()) element.play().catch(e => $52FdA$depictaiutilishared.dlog("Failed to play", e));else element.pause();
16111
16122
  });
16112
16123
  }, _el$);
16124
+ _el$.addEventListener("playing", () => setHasLoaded(true));
16113
16125
  $52FdA$solidjsweb.setAttribute(_el$, "src", mediaUrl_);
16114
16126
  $52FdA$solidjsweb.setProperty(_el$, "controls", false);
16115
16127
  $52FdA$solidjsweb.setProperty(_el$, "muted", true);
package/ES10/index.d.ts CHANGED
@@ -11,7 +11,7 @@ import { GetListingRequest } from "@depict-ai/types/api/GetListingRequest";
11
11
  import { BaseSearchRequestV3 } from "@depict-ai/types/api/BaseSearchRequestV3";
12
12
  import { FeaturedInDisplay } from "@depict-ai/types/api/FeaturedInResponseV3";
13
13
  import { SearchFilter as _SearchFilter3 } from "@depict-ai/types/api/SearchRequestV2";
14
- export const version = "4.8.11";
14
+ export const version = "4.8.13";
15
15
  /**
16
16
  * Returns two accessors (one width and one height) that will update when the size of the provided element changes, to be used with ResponsiveImg
17
17
  */
@@ -127,6 +127,10 @@ export function ShopifyResponsiveImg(props: {
127
127
  */
128
128
  sizeHeight?: Accessor<number>;
129
129
  src: string;
130
+ /**
131
+ * When image is not lazy loaded this callback will be called every time the image has been decoded
132
+ */
133
+ onDecoded?: VoidFunction;
130
134
  loading?: "eager" | "lazy" | "force-lazy";
131
135
  customUrls?: (url: string, width: number) => string;
132
136
  /**
package/ES10/index.js CHANGED
@@ -10,7 +10,7 @@ import $8tj43$babelruntimehelpersclassPrivateFieldGet from "@babel/runtime/helpe
10
10
  /*! Depict.ai search and product listing SDK */
11
11
  import { register_es_version } from "../multi_import_deduplicator.mjs";
12
12
  register_es_version("ui", "ES10");
13
- const $8db9a15135765c11$export$83d89fbfd8236492 = "4.8.11";
13
+ const $8db9a15135765c11$export$83d89fbfd8236492 = "4.8.13";
14
14
  function $4be619ec2cd7bba3$export$54c6d6ff54e72743(whatToWatch) {
15
15
  const [width, setWidth] = $8tj43$createSignal(0);
16
16
  const [height, setHeight] = $8tj43$createSignal(0);
@@ -155,7 +155,7 @@ function $56047603f9d212b6$export$6e5611bc7e57e477(props) {
155
155
  };
156
156
  });
157
157
  // Work around https://github.com/solidjs/solid/issues/1828
158
- const [, otherAttributes] = $8tj43$splitProps(props, ["resolutions", "size", "src", "srcSet", "loading", "keyRatioUpdating", "sizeHeight", "customUrls" // Can't have properties ending on underscore because the property name mangling will get confused by this <-
158
+ const [, otherAttributes] = $8tj43$splitProps(props, ["resolutions", "size", "src", "srcSet", "loading", "keyRatioUpdating", "sizeHeight", "onDecoded", "customUrls" // Can't have properties ending on underscore because the property name mangling will get confused by this <-
159
159
  ]);
160
160
 
161
161
  const [hasSetSize, setHasSetSize] = $8tj43$createSignal(false);
@@ -284,11 +284,13 @@ function $56047603f9d212b6$export$6e5611bc7e57e477(props) {
284
284
  }
285
285
  img.decode().catch(e => $8tj43$dwarn("Failed to decode image", e, img)) // Display the image also if loading failed so webdev can debug and doesn't get "no image"
286
286
  .then(async () => {
287
+ var _props$onDecoded;
287
288
  // Also wait with inserting image (i.e. paint) until browser is idle
288
289
  await new Promise(r => executeWhenIdleBatched(r, false));
289
290
  if (gotCleanedUp) return;
290
291
  setHasDecoded(true);
291
292
  hasDecodedFastPath = true;
293
+ (_props$onDecoded = props.onDecoded) === null || _props$onDecoded === void 0 || _props$onDecoded.call(props);
292
294
  });
293
295
  });
294
296
  $8tj43$createEffect(() => hasDecoded() && requestAnimationFrame($8tj43$catchify(() => setRAFSinceReturned(prev => !prev))));
@@ -15949,6 +15951,7 @@ function $3b772ef9a35560fe$export$780a853d15174484(_ref) {
15949
15951
  } = _ref;
15950
15952
  let wroteAspectRatioToContainer = false; // Only write this once so we don't get into a aspect ratio changed -> size changed -> image source changed -> aspect ratio slightly changed infinite loop
15951
15953
  const [wrapperSize, setWrapperSize] = $8tj43$createSignal();
15954
+ const [hasLoaded, setHasLoaded] = $8tj43$createSignal(false);
15952
15955
  const isImage = type_ === "image";
15953
15956
  const setAspectRatio = aspectRatio => {
15954
15957
  if (wroteAspectRatioToContainer) return;
@@ -15973,9 +15976,16 @@ function $3b772ef9a35560fe$export$780a853d15174484(_ref) {
15973
15976
  href: link_
15974
15977
  }, {
15975
15978
  get children() {
15976
- return [$8tj43$createComponent((0, $3ab4aa97880fb88d$export$3f37af283f8fb843), {
15977
- width: "100%",
15978
- height: "100%"
15979
+ return [$8tj43$createComponent((0, $8tj43$Show), {
15980
+ get when() {
15981
+ return !hasLoaded();
15982
+ },
15983
+ get children() {
15984
+ return $8tj43$createComponent((0, $3ab4aa97880fb88d$export$3f37af283f8fb843), {
15985
+ width: "100%",
15986
+ height: "100%"
15987
+ });
15988
+ }
15979
15989
  }), $8tj43$createComponent((0, $8tj43$Switch), {
15980
15990
  get children() {
15981
15991
  return [$8tj43$createComponent((0, $8tj43$Match), {
@@ -15992,6 +16002,7 @@ function $3b772ef9a35560fe$export$780a853d15174484(_ref) {
15992
16002
  },
15993
16003
  src: mediaUrl_,
15994
16004
  "class": "d-standard-content",
16005
+ onDecoded: () => setHasLoaded(true),
15995
16006
  ref: el => el.addEventListener("load", $8tj43$catchify1(() => setAspectRatio(el.naturalWidth / el.naturalHeight)))
15996
16007
  });
15997
16008
  }
@@ -16006,6 +16017,7 @@ function $3b772ef9a35560fe$export$780a853d15174484(_ref) {
16006
16017
  if (pageVisible()) element.play().catch(e => $8tj43$dlog1("Failed to play", e));else element.pause();
16007
16018
  });
16008
16019
  }, _el$);
16020
+ _el$.addEventListener("playing", () => setHasLoaded(true));
16009
16021
  $8tj43$setAttribute(_el$, "src", mediaUrl_);
16010
16022
  $8tj43$setProperty(_el$, "controls", false);
16011
16023
  $8tj43$setProperty(_el$, "muted", true);
package/latest/index.cjs CHANGED
@@ -108,7 +108,7 @@ $parcel$export(module.exports, "BreadCrumbs", () => $1f4925833f07df29$export$5b7
108
108
  $parcel$export(module.exports, "QuickLinks", () => $1f4925833f07df29$export$de035477d6fef996);
109
109
  $parcel$export(module.exports, "CategoryPage", () => $14f289047713d67a$export$e2bf8ce7779e827e);
110
110
  /*! Depict.ai search and product listing SDK */
111
- const $b757f75811f3261f$export$83d89fbfd8236492 = "4.8.11";
111
+ const $b757f75811f3261f$export$83d89fbfd8236492 = "4.8.13";
112
112
  function $128302ab61dab8f1$export$54c6d6ff54e72743(whatToWatch) {
113
113
  const [width, setWidth] = $gVhhF$solidjs.createSignal(0);
114
114
  const [height, setHeight] = $gVhhF$solidjs.createSignal(0);
@@ -248,7 +248,7 @@ function $19950faaac026e09$export$6e5611bc7e57e477(props) {
248
248
  };
249
249
  });
250
250
  // Work around https://github.com/solidjs/solid/issues/1828
251
- const [, otherAttributes] = $gVhhF$solidjs.splitProps(props, ["resolutions", "size", "src", "srcSet", "loading", "keyRatioUpdating", "sizeHeight", "customUrls" // Can't have properties ending on underscore because the property name mangling will get confused by this <-
251
+ const [, otherAttributes] = $gVhhF$solidjs.splitProps(props, ["resolutions", "size", "src", "srcSet", "loading", "keyRatioUpdating", "sizeHeight", "onDecoded", "customUrls" // Can't have properties ending on underscore because the property name mangling will get confused by this <-
252
252
  ]);
253
253
 
254
254
  const [hasSetSize, setHasSetSize] = $gVhhF$solidjs.createSignal(false);
@@ -379,6 +379,7 @@ function $19950faaac026e09$export$6e5611bc7e57e477(props) {
379
379
  if (gotCleanedUp) return;
380
380
  setHasDecoded(true);
381
381
  hasDecodedFastPath = true;
382
+ props.onDecoded?.();
382
383
  });
383
384
  });
384
385
  $gVhhF$solidjs.createEffect(() => hasDecoded() && requestAnimationFrame($gVhhF$depictaiutilishared.catchify(() => setRAFSinceReturned(prev => !prev))));
@@ -15006,6 +15007,7 @@ function $32c662f618f5d80d$export$780a853d15174484({
15006
15007
  }) {
15007
15008
  let wroteAspectRatioToContainer = false; // Only write this once so we don't get into a aspect ratio changed -> size changed -> image source changed -> aspect ratio slightly changed infinite loop
15008
15009
  const [wrapperSize, setWrapperSize] = $gVhhF$solidjs.createSignal();
15010
+ const [hasLoaded, setHasLoaded] = $gVhhF$solidjs.createSignal(false);
15009
15011
  const isImage = type_ === "image";
15010
15012
  const setAspectRatio = aspectRatio => {
15011
15013
  if (wroteAspectRatioToContainer) return;
@@ -15030,9 +15032,16 @@ function $32c662f618f5d80d$export$780a853d15174484({
15030
15032
  href: link_
15031
15033
  }, {
15032
15034
  get children() {
15033
- return [$gVhhF$solidjsweb.createComponent((0, $3bc4a89b971a3af5$export$3f37af283f8fb843), {
15034
- width: "100%",
15035
- height: "100%"
15035
+ return [$gVhhF$solidjsweb.createComponent((0, $gVhhF$solidjs.Show), {
15036
+ get when() {
15037
+ return !hasLoaded();
15038
+ },
15039
+ get children() {
15040
+ return $gVhhF$solidjsweb.createComponent((0, $3bc4a89b971a3af5$export$3f37af283f8fb843), {
15041
+ width: "100%",
15042
+ height: "100%"
15043
+ });
15044
+ }
15036
15045
  }), $gVhhF$solidjsweb.createComponent((0, $gVhhF$solidjs.Switch), {
15037
15046
  get children() {
15038
15047
  return [$gVhhF$solidjsweb.createComponent((0, $gVhhF$solidjs.Match), {
@@ -15043,6 +15052,7 @@ function $32c662f618f5d80d$export$780a853d15174484({
15043
15052
  sizeHeight: () => wrapperSize()?.[1]?.() || 0,
15044
15053
  src: mediaUrl_,
15045
15054
  "class": "d-standard-content",
15055
+ onDecoded: () => setHasLoaded(true),
15046
15056
  ref: el => el.addEventListener("load", $gVhhF$depictaiutilisharedlatest.catchify(() => setAspectRatio(el.naturalWidth / el.naturalHeight)))
15047
15057
  });
15048
15058
  }
@@ -15057,6 +15067,7 @@ function $32c662f618f5d80d$export$780a853d15174484({
15057
15067
  if (pageVisible()) element.play().catch(e => $gVhhF$depictaiutilishared.dlog("Failed to play", e));else element.pause();
15058
15068
  });
15059
15069
  }, _el$);
15070
+ _el$.addEventListener("playing", () => setHasLoaded(true));
15060
15071
  $gVhhF$solidjsweb.setAttribute(_el$, "src", mediaUrl_);
15061
15072
  $gVhhF$solidjsweb.setProperty(_el$, "controls", false);
15062
15073
  $gVhhF$solidjsweb.setProperty(_el$, "muted", true);
package/latest/index.d.ts CHANGED
@@ -11,7 +11,7 @@ import { GetListingRequest } from "@depict-ai/types/api/GetListingRequest";
11
11
  import { BaseSearchRequestV3 } from "@depict-ai/types/api/BaseSearchRequestV3";
12
12
  import { FeaturedInDisplay } from "@depict-ai/types/api/FeaturedInResponseV3";
13
13
  import { SearchFilter as _SearchFilter3 } from "@depict-ai/types/api/SearchRequestV2";
14
- export const version = "4.8.11";
14
+ export const version = "4.8.13";
15
15
  /**
16
16
  * Returns two accessors (one width and one height) that will update when the size of the provided element changes, to be used with ResponsiveImg
17
17
  */
@@ -127,6 +127,10 @@ export function ShopifyResponsiveImg(props: {
127
127
  */
128
128
  sizeHeight?: Accessor<number>;
129
129
  src: string;
130
+ /**
131
+ * When image is not lazy loaded this callback will be called every time the image has been decoded
132
+ */
133
+ onDecoded?: VoidFunction;
130
134
  loading?: "eager" | "lazy" | "force-lazy";
131
135
  customUrls?: (url: string, width: number) => string;
132
136
  /**
package/latest/index.js CHANGED
@@ -7,7 +7,7 @@ import { dlog as $9HbP8$dlog, catchify as $9HbP8$catchify1, ListenableSet as $9H
7
7
  /*! Depict.ai search and product listing SDK */
8
8
  import { register_es_version } from "../multi_import_deduplicator.mjs";
9
9
  register_es_version("ui", "latest");
10
- const $ec291e0010116877$export$83d89fbfd8236492 = "4.8.11";
10
+ const $ec291e0010116877$export$83d89fbfd8236492 = "4.8.13";
11
11
  function $a444a52bafa0dacc$export$54c6d6ff54e72743(whatToWatch) {
12
12
  const [width, setWidth] = $9HbP8$createSignal(0);
13
13
  const [height, setHeight] = $9HbP8$createSignal(0);
@@ -147,7 +147,7 @@ function $e8ffe11ed01df0fe$export$6e5611bc7e57e477(props) {
147
147
  };
148
148
  });
149
149
  // Work around https://github.com/solidjs/solid/issues/1828
150
- const [, otherAttributes] = $9HbP8$splitProps(props, ["resolutions", "size", "src", "srcSet", "loading", "keyRatioUpdating", "sizeHeight", "customUrls" // Can't have properties ending on underscore because the property name mangling will get confused by this <-
150
+ const [, otherAttributes] = $9HbP8$splitProps(props, ["resolutions", "size", "src", "srcSet", "loading", "keyRatioUpdating", "sizeHeight", "onDecoded", "customUrls" // Can't have properties ending on underscore because the property name mangling will get confused by this <-
151
151
  ]);
152
152
 
153
153
  const [hasSetSize, setHasSetSize] = $9HbP8$createSignal(false);
@@ -278,6 +278,7 @@ function $e8ffe11ed01df0fe$export$6e5611bc7e57e477(props) {
278
278
  if (gotCleanedUp) return;
279
279
  setHasDecoded(true);
280
280
  hasDecodedFastPath = true;
281
+ props.onDecoded?.();
281
282
  });
282
283
  });
283
284
  $9HbP8$createEffect(() => hasDecoded() && requestAnimationFrame($9HbP8$catchify(() => setRAFSinceReturned(prev => !prev))));
@@ -14905,6 +14906,7 @@ function $f916989c4b1be9f7$export$780a853d15174484({
14905
14906
  }) {
14906
14907
  let wroteAspectRatioToContainer = false; // Only write this once so we don't get into a aspect ratio changed -> size changed -> image source changed -> aspect ratio slightly changed infinite loop
14907
14908
  const [wrapperSize, setWrapperSize] = $9HbP8$createSignal();
14909
+ const [hasLoaded, setHasLoaded] = $9HbP8$createSignal(false);
14908
14910
  const isImage = type_ === "image";
14909
14911
  const setAspectRatio = aspectRatio => {
14910
14912
  if (wroteAspectRatioToContainer) return;
@@ -14929,9 +14931,16 @@ function $f916989c4b1be9f7$export$780a853d15174484({
14929
14931
  href: link_
14930
14932
  }, {
14931
14933
  get children() {
14932
- return [$9HbP8$createComponent((0, $7f60f09116a3fe61$export$3f37af283f8fb843), {
14933
- width: "100%",
14934
- height: "100%"
14934
+ return [$9HbP8$createComponent((0, $9HbP8$Show), {
14935
+ get when() {
14936
+ return !hasLoaded();
14937
+ },
14938
+ get children() {
14939
+ return $9HbP8$createComponent((0, $7f60f09116a3fe61$export$3f37af283f8fb843), {
14940
+ width: "100%",
14941
+ height: "100%"
14942
+ });
14943
+ }
14935
14944
  }), $9HbP8$createComponent((0, $9HbP8$Switch), {
14936
14945
  get children() {
14937
14946
  return [$9HbP8$createComponent((0, $9HbP8$Match), {
@@ -14942,6 +14951,7 @@ function $f916989c4b1be9f7$export$780a853d15174484({
14942
14951
  sizeHeight: () => wrapperSize()?.[1]?.() || 0,
14943
14952
  src: mediaUrl_,
14944
14953
  "class": "d-standard-content",
14954
+ onDecoded: () => setHasLoaded(true),
14945
14955
  ref: el => el.addEventListener("load", $9HbP8$catchify1(() => setAspectRatio(el.naturalWidth / el.naturalHeight)))
14946
14956
  });
14947
14957
  }
@@ -14956,6 +14966,7 @@ function $f916989c4b1be9f7$export$780a853d15174484({
14956
14966
  if (pageVisible()) element.play().catch(e => $9HbP8$dlog1("Failed to play", e));else element.pause();
14957
14967
  });
14958
14968
  }, _el$);
14969
+ _el$.addEventListener("playing", () => setHasLoaded(true));
14959
14970
  $9HbP8$setAttribute(_el$, "src", mediaUrl_);
14960
14971
  $9HbP8$setProperty(_el$, "controls", false);
14961
14972
  $9HbP8$setProperty(_el$, "muted", true);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@depict-ai/ui",
3
- "version": "4.8.11",
3
+ "version": "4.8.13",
4
4
  "description": "Base package containing the actual UI of Depict UI along with translations, with a not-simplified API. We recommend using @depict-ai/js-ui or @depict-ai/react-ui instead.",
5
5
  "packageManager": "yarn@3.2.2",
6
6
  "sass": "styles.scss",
@@ -114,7 +114,7 @@ $parcel$export(module.exports, "BreadCrumbs", () => $335c02c1241a9ca8$export$5b7
114
114
  $parcel$export(module.exports, "QuickLinks", () => $335c02c1241a9ca8$export$de035477d6fef996);
115
115
  $parcel$export(module.exports, "CategoryPage", () => $c10e33c4681f8c9b$export$e2bf8ce7779e827e);
116
116
  /*! Depict.ai search and product listing SDK */
117
- const $aa1938dec50d6c12$export$83d89fbfd8236492 = "4.8.11";
117
+ const $aa1938dec50d6c12$export$83d89fbfd8236492 = "4.8.13";
118
118
  function $054b1113e4897051$export$54c6d6ff54e72743(whatToWatch) {
119
119
  const [width, setWidth] = $3hooq$solidjs.createSignal(0);
120
120
  const [height, setHeight] = $3hooq$solidjs.createSignal(0);
@@ -245,7 +245,7 @@ function $858fdcf73148519f$export$6e5611bc7e57e477(props) {
245
245
  };
246
246
  });
247
247
  // Work around https://github.com/solidjs/solid/issues/1828
248
- const [, otherAttributes] = $3hooq$solidjs.splitProps(props, ["resolutions", "size", "src", "srcSet", "loading", "keyRatioUpdating", "sizeHeight", "customUrls" // Can't have properties ending on underscore because the property name mangling will get confused by this <-
248
+ const [, otherAttributes] = $3hooq$solidjs.splitProps(props, ["resolutions", "size", "src", "srcSet", "loading", "keyRatioUpdating", "sizeHeight", "onDecoded", "customUrls" // Can't have properties ending on underscore because the property name mangling will get confused by this <-
249
249
  ]);
250
250
 
251
251
  const [hasSetSize, setHasSetSize] = $3hooq$solidjs.createSignal(false);
@@ -374,11 +374,13 @@ function $858fdcf73148519f$export$6e5611bc7e57e477(props) {
374
374
  }
375
375
  img.decode().catch(e => $3hooq$depictaiutilishared.dwarn("Failed to decode image", e, img)) // Display the image also if loading failed so webdev can debug and doesn't get "no image"
376
376
  .then(async () => {
377
+ var _props$onDecoded;
377
378
  // Also wait with inserting image (i.e. paint) until browser is idle
378
379
  await new Promise(r => executeWhenIdleBatched(r, false));
379
380
  if (gotCleanedUp) return;
380
381
  setHasDecoded(true);
381
382
  hasDecodedFastPath = true;
383
+ (_props$onDecoded = props.onDecoded) === null || _props$onDecoded === void 0 || _props$onDecoded.call(props);
382
384
  });
383
385
  });
384
386
  $3hooq$solidjs.createEffect(() => hasDecoded() && requestAnimationFrame($3hooq$depictaiutilishared.catchify(() => setRAFSinceReturned(prev => !prev))));
@@ -13414,6 +13416,7 @@ function $c19709057a32b2e7$export$780a853d15174484(_ref) {
13414
13416
  } = _ref;
13415
13417
  let wroteAspectRatioToContainer = false; // Only write this once so we don't get into a aspect ratio changed -> size changed -> image source changed -> aspect ratio slightly changed infinite loop
13416
13418
  const [wrapperSize, setWrapperSize] = $3hooq$solidjs.createSignal();
13419
+ const [hasLoaded, setHasLoaded] = $3hooq$solidjs.createSignal(false);
13417
13420
  const isImage = type_ === "image";
13418
13421
  const setAspectRatio = aspectRatio => {
13419
13422
  if (wroteAspectRatioToContainer) return;
@@ -13437,9 +13440,16 @@ function $c19709057a32b2e7$export$780a853d15174484(_ref) {
13437
13440
  href: link_
13438
13441
  }, {
13439
13442
  get children() {
13440
- return [$3hooq$solidjsweb.createComponent((0, $b8a8d61b3ec5f5ac$export$3f37af283f8fb843), {
13441
- width: "100%",
13442
- height: "100%"
13443
+ return [$3hooq$solidjsweb.createComponent((0, $3hooq$solidjs.Show), {
13444
+ get when() {
13445
+ return !hasLoaded();
13446
+ },
13447
+ get children() {
13448
+ return $3hooq$solidjsweb.createComponent((0, $b8a8d61b3ec5f5ac$export$3f37af283f8fb843), {
13449
+ width: "100%",
13450
+ height: "100%"
13451
+ });
13452
+ }
13443
13453
  }), $3hooq$solidjsweb.createComponent((0, $3hooq$solidjs.Switch), {
13444
13454
  get children() {
13445
13455
  return [$3hooq$solidjsweb.createComponent((0, $3hooq$solidjs.Match), {
@@ -13455,7 +13465,8 @@ function $c19709057a32b2e7$export$780a853d15174484(_ref) {
13455
13465
  return ((_wrapperSize2 = wrapperSize()) === null || _wrapperSize2 === void 0 ? void 0 : (_wrapperSize2$ = _wrapperSize2[1]) === null || _wrapperSize2$ === void 0 ? void 0 : _wrapperSize2$.call(_wrapperSize2)) || 0;
13456
13466
  },
13457
13467
  src: mediaUrl_,
13458
- "class": "d-standard-content"
13468
+ "class": "d-standard-content",
13469
+ onDecoded: () => setHasLoaded(true)
13459
13470
  });
13460
13471
  }
13461
13472
  }), $3hooq$solidjsweb.createComponent((0, $3hooq$solidjs.Match), {
@@ -11,7 +11,7 @@ import { GetListingRequest } from "@depict-ai/types/api/GetListingRequest";
11
11
  import { BaseSearchRequestV3 } from "@depict-ai/types/api/BaseSearchRequestV3";
12
12
  import { FeaturedInDisplay } from "@depict-ai/types/api/FeaturedInResponseV3";
13
13
  import { SearchFilter as _SearchFilter3 } from "@depict-ai/types/api/SearchRequestV2";
14
- export const version = "4.8.11";
14
+ export const version = "4.8.13";
15
15
  /**
16
16
  * Returns two accessors (one width and one height) that will update when the size of the provided element changes, to be used with ResponsiveImg
17
17
  */
@@ -127,6 +127,10 @@ export function ShopifyResponsiveImg(props: {
127
127
  */
128
128
  sizeHeight?: Accessor<number>;
129
129
  src: string;
130
+ /**
131
+ * When image is not lazy loaded this callback will be called every time the image has been decoded
132
+ */
133
+ onDecoded?: VoidFunction;
130
134
  loading?: "eager" | "lazy" | "force-lazy";
131
135
  customUrls?: (url: string, width: number) => string;
132
136
  /**
@@ -10,7 +10,7 @@ import $b8hua$babelruntimehelpersclassPrivateFieldGet from "@babel/runtime/helpe
10
10
  /*! Depict.ai search and product listing SDK */
11
11
  import { register_es_version } from "../../multi_import_deduplicator.mjs";
12
12
  register_es_version("ui", "ES10");
13
- const $8db9a15135765c11$export$83d89fbfd8236492 = "4.8.11";
13
+ const $8db9a15135765c11$export$83d89fbfd8236492 = "4.8.13";
14
14
  function $4be619ec2cd7bba3$export$54c6d6ff54e72743(whatToWatch) {
15
15
  const [width, setWidth] = $b8hua$createSignal(0);
16
16
  const [height, setHeight] = $b8hua$createSignal(0);
@@ -141,7 +141,7 @@ function $56047603f9d212b6$export$6e5611bc7e57e477(props) {
141
141
  };
142
142
  });
143
143
  // Work around https://github.com/solidjs/solid/issues/1828
144
- const [, otherAttributes] = $b8hua$splitProps(props, ["resolutions", "size", "src", "srcSet", "loading", "keyRatioUpdating", "sizeHeight", "customUrls" // Can't have properties ending on underscore because the property name mangling will get confused by this <-
144
+ const [, otherAttributes] = $b8hua$splitProps(props, ["resolutions", "size", "src", "srcSet", "loading", "keyRatioUpdating", "sizeHeight", "onDecoded", "customUrls" // Can't have properties ending on underscore because the property name mangling will get confused by this <-
145
145
  ]);
146
146
 
147
147
  const [hasSetSize, setHasSetSize] = $b8hua$createSignal(false);
@@ -270,11 +270,13 @@ function $56047603f9d212b6$export$6e5611bc7e57e477(props) {
270
270
  }
271
271
  img.decode().catch(e => $b8hua$dwarn("Failed to decode image", e, img)) // Display the image also if loading failed so webdev can debug and doesn't get "no image"
272
272
  .then(async () => {
273
+ var _props$onDecoded;
273
274
  // Also wait with inserting image (i.e. paint) until browser is idle
274
275
  await new Promise(r => executeWhenIdleBatched(r, false));
275
276
  if (gotCleanedUp) return;
276
277
  setHasDecoded(true);
277
278
  hasDecodedFastPath = true;
279
+ (_props$onDecoded = props.onDecoded) === null || _props$onDecoded === void 0 || _props$onDecoded.call(props);
278
280
  });
279
281
  });
280
282
  $b8hua$createEffect(() => hasDecoded() && requestAnimationFrame($b8hua$catchify(() => setRAFSinceReturned(prev => !prev))));
@@ -13310,6 +13312,7 @@ function $3b772ef9a35560fe$export$780a853d15174484(_ref) {
13310
13312
  } = _ref;
13311
13313
  let wroteAspectRatioToContainer = false; // Only write this once so we don't get into a aspect ratio changed -> size changed -> image source changed -> aspect ratio slightly changed infinite loop
13312
13314
  const [wrapperSize, setWrapperSize] = $b8hua$createSignal();
13315
+ const [hasLoaded, setHasLoaded] = $b8hua$createSignal(false);
13313
13316
  const isImage = type_ === "image";
13314
13317
  const setAspectRatio = aspectRatio => {
13315
13318
  if (wroteAspectRatioToContainer) return;
@@ -13333,9 +13336,16 @@ function $3b772ef9a35560fe$export$780a853d15174484(_ref) {
13333
13336
  href: link_
13334
13337
  }, {
13335
13338
  get children() {
13336
- return [$b8hua$createComponent((0, $3ab4aa97880fb88d$export$3f37af283f8fb843), {
13337
- width: "100%",
13338
- height: "100%"
13339
+ return [$b8hua$createComponent((0, $b8hua$Show), {
13340
+ get when() {
13341
+ return !hasLoaded();
13342
+ },
13343
+ get children() {
13344
+ return $b8hua$createComponent((0, $3ab4aa97880fb88d$export$3f37af283f8fb843), {
13345
+ width: "100%",
13346
+ height: "100%"
13347
+ });
13348
+ }
13339
13349
  }), $b8hua$createComponent((0, $b8hua$Switch), {
13340
13350
  get children() {
13341
13351
  return [$b8hua$createComponent((0, $b8hua$Match), {
@@ -13351,7 +13361,8 @@ function $3b772ef9a35560fe$export$780a853d15174484(_ref) {
13351
13361
  return ((_wrapperSize2 = wrapperSize()) === null || _wrapperSize2 === void 0 ? void 0 : (_wrapperSize2$ = _wrapperSize2[1]) === null || _wrapperSize2$ === void 0 ? void 0 : _wrapperSize2$.call(_wrapperSize2)) || 0;
13352
13362
  },
13353
13363
  src: mediaUrl_,
13354
- "class": "d-standard-content"
13364
+ "class": "d-standard-content",
13365
+ onDecoded: () => setHasLoaded(true)
13355
13366
  });
13356
13367
  }
13357
13368
  }), $b8hua$createComponent((0, $b8hua$Match), {
@@ -108,7 +108,7 @@ $parcel$export(module.exports, "BreadCrumbs", () => $1f4925833f07df29$export$5b7
108
108
  $parcel$export(module.exports, "QuickLinks", () => $1f4925833f07df29$export$de035477d6fef996);
109
109
  $parcel$export(module.exports, "CategoryPage", () => $14f289047713d67a$export$e2bf8ce7779e827e);
110
110
  /*! Depict.ai search and product listing SDK */
111
- const $b757f75811f3261f$export$83d89fbfd8236492 = "4.8.11";
111
+ const $b757f75811f3261f$export$83d89fbfd8236492 = "4.8.13";
112
112
  function $128302ab61dab8f1$export$54c6d6ff54e72743(whatToWatch) {
113
113
  const [width, setWidth] = $5vyXB$solidjs.createSignal(0);
114
114
  const [height, setHeight] = $5vyXB$solidjs.createSignal(0);
@@ -234,7 +234,7 @@ function $19950faaac026e09$export$6e5611bc7e57e477(props) {
234
234
  };
235
235
  });
236
236
  // Work around https://github.com/solidjs/solid/issues/1828
237
- const [, otherAttributes] = $5vyXB$solidjs.splitProps(props, ["resolutions", "size", "src", "srcSet", "loading", "keyRatioUpdating", "sizeHeight", "customUrls" // Can't have properties ending on underscore because the property name mangling will get confused by this <-
237
+ const [, otherAttributes] = $5vyXB$solidjs.splitProps(props, ["resolutions", "size", "src", "srcSet", "loading", "keyRatioUpdating", "sizeHeight", "onDecoded", "customUrls" // Can't have properties ending on underscore because the property name mangling will get confused by this <-
238
238
  ]);
239
239
 
240
240
  const [hasSetSize, setHasSetSize] = $5vyXB$solidjs.createSignal(false);
@@ -365,6 +365,7 @@ function $19950faaac026e09$export$6e5611bc7e57e477(props) {
365
365
  if (gotCleanedUp) return;
366
366
  setHasDecoded(true);
367
367
  hasDecodedFastPath = true;
368
+ props.onDecoded?.();
368
369
  });
369
370
  });
370
371
  $5vyXB$solidjs.createEffect(() => hasDecoded() && requestAnimationFrame($5vyXB$depictaiutilishared.catchify(() => setRAFSinceReturned(prev => !prev))));
@@ -12448,6 +12449,7 @@ function $32c662f618f5d80d$export$780a853d15174484({
12448
12449
  }) {
12449
12450
  let wroteAspectRatioToContainer = false; // Only write this once so we don't get into a aspect ratio changed -> size changed -> image source changed -> aspect ratio slightly changed infinite loop
12450
12451
  const [wrapperSize, setWrapperSize] = $5vyXB$solidjs.createSignal();
12452
+ const [hasLoaded, setHasLoaded] = $5vyXB$solidjs.createSignal(false);
12451
12453
  const isImage = type_ === "image";
12452
12454
  const setAspectRatio = aspectRatio => {
12453
12455
  if (wroteAspectRatioToContainer) return;
@@ -12471,9 +12473,16 @@ function $32c662f618f5d80d$export$780a853d15174484({
12471
12473
  href: link_
12472
12474
  }, {
12473
12475
  get children() {
12474
- return [$5vyXB$solidjsweb.createComponent((0, $3bc4a89b971a3af5$export$3f37af283f8fb843), {
12475
- width: "100%",
12476
- height: "100%"
12476
+ return [$5vyXB$solidjsweb.createComponent((0, $5vyXB$solidjs.Show), {
12477
+ get when() {
12478
+ return !hasLoaded();
12479
+ },
12480
+ get children() {
12481
+ return $5vyXB$solidjsweb.createComponent((0, $3bc4a89b971a3af5$export$3f37af283f8fb843), {
12482
+ width: "100%",
12483
+ height: "100%"
12484
+ });
12485
+ }
12477
12486
  }), $5vyXB$solidjsweb.createComponent((0, $5vyXB$solidjs.Switch), {
12478
12487
  get children() {
12479
12488
  return [$5vyXB$solidjsweb.createComponent((0, $5vyXB$solidjs.Match), {
@@ -12483,7 +12492,8 @@ function $32c662f618f5d80d$export$780a853d15174484({
12483
12492
  size: () => wrapperSize()?.[0]?.() || 0,
12484
12493
  sizeHeight: () => wrapperSize()?.[1]?.() || 0,
12485
12494
  src: mediaUrl_,
12486
- "class": "d-standard-content"
12495
+ "class": "d-standard-content",
12496
+ onDecoded: () => setHasLoaded(true)
12487
12497
  });
12488
12498
  }
12489
12499
  }), $5vyXB$solidjsweb.createComponent((0, $5vyXB$solidjs.Match), {
@@ -11,7 +11,7 @@ import { GetListingRequest } from "@depict-ai/types/api/GetListingRequest";
11
11
  import { BaseSearchRequestV3 } from "@depict-ai/types/api/BaseSearchRequestV3";
12
12
  import { FeaturedInDisplay } from "@depict-ai/types/api/FeaturedInResponseV3";
13
13
  import { SearchFilter as _SearchFilter3 } from "@depict-ai/types/api/SearchRequestV2";
14
- export const version = "4.8.11";
14
+ export const version = "4.8.13";
15
15
  /**
16
16
  * Returns two accessors (one width and one height) that will update when the size of the provided element changes, to be used with ResponsiveImg
17
17
  */
@@ -127,6 +127,10 @@ export function ShopifyResponsiveImg(props: {
127
127
  */
128
128
  sizeHeight?: Accessor<number>;
129
129
  src: string;
130
+ /**
131
+ * When image is not lazy loaded this callback will be called every time the image has been decoded
132
+ */
133
+ onDecoded?: VoidFunction;
130
134
  loading?: "eager" | "lazy" | "force-lazy";
131
135
  customUrls?: (url: string, width: number) => string;
132
136
  /**
@@ -7,7 +7,7 @@ import { dlog as $i7OB2$dlog, catchify as $i7OB2$catchify1, ListenableSet as $i7
7
7
  /*! Depict.ai search and product listing SDK */
8
8
  import { register_es_version } from "../../multi_import_deduplicator.mjs";
9
9
  register_es_version("ui", "latest");
10
- const $ec291e0010116877$export$83d89fbfd8236492 = "4.8.11";
10
+ const $ec291e0010116877$export$83d89fbfd8236492 = "4.8.13";
11
11
  function $a444a52bafa0dacc$export$54c6d6ff54e72743(whatToWatch) {
12
12
  const [width, setWidth] = $i7OB2$createSignal(0);
13
13
  const [height, setHeight] = $i7OB2$createSignal(0);
@@ -133,7 +133,7 @@ function $e8ffe11ed01df0fe$export$6e5611bc7e57e477(props) {
133
133
  };
134
134
  });
135
135
  // Work around https://github.com/solidjs/solid/issues/1828
136
- const [, otherAttributes] = $i7OB2$splitProps(props, ["resolutions", "size", "src", "srcSet", "loading", "keyRatioUpdating", "sizeHeight", "customUrls" // Can't have properties ending on underscore because the property name mangling will get confused by this <-
136
+ const [, otherAttributes] = $i7OB2$splitProps(props, ["resolutions", "size", "src", "srcSet", "loading", "keyRatioUpdating", "sizeHeight", "onDecoded", "customUrls" // Can't have properties ending on underscore because the property name mangling will get confused by this <-
137
137
  ]);
138
138
 
139
139
  const [hasSetSize, setHasSetSize] = $i7OB2$createSignal(false);
@@ -264,6 +264,7 @@ function $e8ffe11ed01df0fe$export$6e5611bc7e57e477(props) {
264
264
  if (gotCleanedUp) return;
265
265
  setHasDecoded(true);
266
266
  hasDecodedFastPath = true;
267
+ props.onDecoded?.();
267
268
  });
268
269
  });
269
270
  $i7OB2$createEffect(() => hasDecoded() && requestAnimationFrame($i7OB2$catchify(() => setRAFSinceReturned(prev => !prev))));
@@ -12347,6 +12348,7 @@ function $f916989c4b1be9f7$export$780a853d15174484({
12347
12348
  }) {
12348
12349
  let wroteAspectRatioToContainer = false; // Only write this once so we don't get into a aspect ratio changed -> size changed -> image source changed -> aspect ratio slightly changed infinite loop
12349
12350
  const [wrapperSize, setWrapperSize] = $i7OB2$createSignal();
12351
+ const [hasLoaded, setHasLoaded] = $i7OB2$createSignal(false);
12350
12352
  const isImage = type_ === "image";
12351
12353
  const setAspectRatio = aspectRatio => {
12352
12354
  if (wroteAspectRatioToContainer) return;
@@ -12370,9 +12372,16 @@ function $f916989c4b1be9f7$export$780a853d15174484({
12370
12372
  href: link_
12371
12373
  }, {
12372
12374
  get children() {
12373
- return [$i7OB2$createComponent((0, $7f60f09116a3fe61$export$3f37af283f8fb843), {
12374
- width: "100%",
12375
- height: "100%"
12375
+ return [$i7OB2$createComponent((0, $i7OB2$Show), {
12376
+ get when() {
12377
+ return !hasLoaded();
12378
+ },
12379
+ get children() {
12380
+ return $i7OB2$createComponent((0, $7f60f09116a3fe61$export$3f37af283f8fb843), {
12381
+ width: "100%",
12382
+ height: "100%"
12383
+ });
12384
+ }
12376
12385
  }), $i7OB2$createComponent((0, $i7OB2$Switch), {
12377
12386
  get children() {
12378
12387
  return [$i7OB2$createComponent((0, $i7OB2$Match), {
@@ -12382,7 +12391,8 @@ function $f916989c4b1be9f7$export$780a853d15174484({
12382
12391
  size: () => wrapperSize()?.[0]?.() || 0,
12383
12392
  sizeHeight: () => wrapperSize()?.[1]?.() || 0,
12384
12393
  src: mediaUrl_,
12385
- "class": "d-standard-content"
12394
+ "class": "d-standard-content",
12395
+ onDecoded: () => setHasLoaded(true)
12386
12396
  });
12387
12397
  }
12388
12398
  }), $i7OB2$createComponent((0, $i7OB2$Match), {