@depict-ai/ui 4.10.11 → 4.10.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
@@ -115,7 +115,7 @@ $parcel$export(module.exports, "BreadCrumbs", () => $335c02c1241a9ca8$export$5b7
115
115
  $parcel$export(module.exports, "QuickLinks", () => $335c02c1241a9ca8$export$de035477d6fef996);
116
116
  $parcel$export(module.exports, "CategoryPage", () => $c10e33c4681f8c9b$export$e2bf8ce7779e827e);
117
117
  /*! Depict.ai search and product listing SDK */
118
- const $aa1938dec50d6c12$export$83d89fbfd8236492 = "4.10.11";
118
+ const $aa1938dec50d6c12$export$83d89fbfd8236492 = "4.10.13";
119
119
  function $3e17e871e9d0911d$export$d9f36cf74e24d595(media_query) {
120
120
  const signal = $52FdA$solidjs.createSignal(false);
121
121
  $52FdA$solidjs.onCleanup($52FdA$depictaiutilishared.javascript_media_query(media_query, _ref => {
@@ -2838,7 +2838,16 @@ function $b0477e4d832f090e$export$ca21a16d65b3dd8(_ref) {
2838
2838
  var _c$ = $52FdA$solidjsweb.memo(() => !!get_show_extras());
2839
2839
  return () => _c$() ? i18n_.view_less_() : i18n_.view_more_();
2840
2840
  })());
2841
- $52FdA$solidjsweb.effect(() => _el$.classList.toggle("expanded", !!get_show_extras()));
2841
+ $52FdA$solidjsweb.effect(_p$ => {
2842
+ var _v$ = get_show_extras(),
2843
+ _v$2 = !!get_show_extras();
2844
+ _v$ !== _p$.e && $52FdA$solidjsweb.setAttribute(_el$, "aria-expanded", _p$.e = _v$);
2845
+ _v$2 !== _p$.t && _el$.classList.toggle("expanded", _p$.t = _v$2);
2846
+ return _p$;
2847
+ }, {
2848
+ e: undefined,
2849
+ t: undefined
2850
+ });
2842
2851
  $52FdA$solidjsweb.runHydrationEvents();
2843
2852
  return _el$;
2844
2853
  })();
@@ -3181,7 +3190,7 @@ function $d9239dad9a9d899b$export$430444115f70a734(_ref) {
3181
3190
  return _el$;
3182
3191
  })();
3183
3192
  }
3184
- var $0257c760a99bfacb$var$_tmpl$ = /*#__PURE__*/$52FdA$solidjsweb.template(`<div class=range><div class=input-group><div class=field><input type=number></div><div class=separator>-</div><div class=field><input type=number></div></div><!$><!/><div class=value-text><span class=min><!$><!/><!$><!/><!$><!/></span><span class=max><!$><!/><!$><!/><!$><!/>`),
3193
+ var $0257c760a99bfacb$var$_tmpl$ = /*#__PURE__*/$52FdA$solidjsweb.template(`<div class=range><div class=input-group><div class=field><input type=number></div><div class=separator aria-hidden=true>-</div><div class=field><input type=number></div></div><!$><!/><div class=value-text><span class=min><!$><!/><!$><!/><!$><!/></span><span class=max><!$><!/><!$><!/><!$><!/>`),
3185
3194
  $0257c760a99bfacb$var$_tmpl$2 = /*#__PURE__*/$52FdA$solidjsweb.template(`<div class=slider><div class=progress>`),
3186
3195
  $0257c760a99bfacb$var$_tmpl$3 = /*#__PURE__*/$52FdA$solidjsweb.template(`<div class=range-group><input type=range step=any><input type=range step=any>`);
3187
3196
  function $0257c760a99bfacb$export$e0d834a0ad870cda(_ref) {
@@ -3323,7 +3332,8 @@ function $0257c760a99bfacb$var$RangeSelector(_ref3) {
3323
3332
  min_: min_,
3324
3333
  current_range_: current_range_,
3325
3334
  i18n_: i18n_,
3326
- should_be_disabled_: should_be_disabled_
3335
+ should_be_disabled_: should_be_disabled_,
3336
+ priceFormatting_: price_formatting_
3327
3337
  }), _el$24, _co$7);
3328
3338
  $52FdA$solidjsweb.insert(_el$9, pre_price, _el$11, _co$);
3329
3339
  $52FdA$solidjsweb.insert(_el$9, $52FdA$solidjsweb.createComponent((0, $f38f2e64ebe2da86$export$a71e92cfbb498adc), {
@@ -3388,7 +3398,8 @@ function $0257c760a99bfacb$var$ExponentialSlider(_ref6) {
3388
3398
  min_: min_,
3389
3399
  i18n_: i18n_,
3390
3400
  max_: max_,
3391
- should_be_disabled_: should_be_disabled_
3401
+ should_be_disabled_: should_be_disabled_,
3402
+ priceFormatting_: priceFormatting_
3392
3403
  } = _ref6;
3393
3404
  // inspired by https://observablehq.com/@mbostock/nonlinear-slider
3394
3405
  const transform_linear_to_nonlinear = _ref7 => {
@@ -3425,7 +3436,8 @@ function $0257c760a99bfacb$var$ExponentialSlider(_ref6) {
3425
3436
  max_: modified_max,
3426
3437
  offset_value_calculator_: offset_value_calculator_,
3427
3438
  i18n_: i18n_,
3428
- should_be_disabled_: should_be_disabled_
3439
+ should_be_disabled_: should_be_disabled_,
3440
+ priceFormatting_: priceFormatting_
3429
3441
  });
3430
3442
  }
3431
3443
  function $0257c760a99bfacb$var$LinearSlider(_ref8) {
@@ -3435,12 +3447,17 @@ function $0257c760a99bfacb$var$LinearSlider(_ref8) {
3435
3447
  current_range_: current_range_,
3436
3448
  offset_value_calculator_: offset_value_calculator_,
3437
3449
  i18n_: i18n_,
3438
- should_be_disabled_: should_be_disabled_
3450
+ should_be_disabled_: should_be_disabled_,
3451
+ priceFormatting_: priceFormatting_
3439
3452
  } = _ref8;
3440
3453
  let range_input_1;
3441
3454
  let range_input_2;
3442
3455
  let clickable_slider;
3443
3456
  const [get_current_range, set_current_range] = current_range_;
3457
+ const formatRealPrice = value => {
3458
+ const priceFormatting = priceFormatting_();
3459
+ return priceFormatting.pre_ + $52FdA$depictaiutilishared.standard_price_format(value, priceFormatting.places_after_comma_, priceFormatting.decimal_places_delimiter_, priceFormatting.thousands_delimiter_) + priceFormatting.post_;
3460
+ };
3444
3461
  const progress_styling = $52FdA$solidjs.createMemo(() => {
3445
3462
  const min = min_();
3446
3463
  const span = max_() - min;
@@ -3497,20 +3514,24 @@ function $0257c760a99bfacb$var$LinearSlider(_ref8) {
3497
3514
  $52FdA$solidjsweb.effect(_p$ => {
3498
3515
  var _v$10 = should_be_disabled_(),
3499
3516
  _v$11 = i18n_.range_filter_low_point_aria_label_(),
3500
- _v$12 = min_(),
3501
- _v$13 = max_(),
3502
- _v$14 = should_be_disabled_(),
3503
- _v$15 = i18n_.range_filter_high_point_aria_label_(),
3504
- _v$16 = min_(),
3505
- _v$17 = max_();
3517
+ _v$12 = formatRealPrice(get_current_range()[0]),
3518
+ _v$13 = min_(),
3519
+ _v$14 = max_(),
3520
+ _v$15 = should_be_disabled_(),
3521
+ _v$16 = i18n_.range_filter_high_point_aria_label_(),
3522
+ _v$17 = formatRealPrice(get_current_range()[1]),
3523
+ _v$18 = min_(),
3524
+ _v$19 = max_();
3506
3525
  _v$10 !== _p$.e && $52FdA$solidjsweb.setProperty(_el$28, "disabled", _p$.e = _v$10);
3507
3526
  _v$11 !== _p$.t && $52FdA$solidjsweb.setAttribute(_el$28, "aria-label", _p$.t = _v$11);
3508
- _v$12 !== _p$.a && $52FdA$solidjsweb.setAttribute(_el$28, "min", _p$.a = _v$12);
3509
- _v$13 !== _p$.o && $52FdA$solidjsweb.setAttribute(_el$28, "max", _p$.o = _v$13);
3510
- _v$14 !== _p$.i && $52FdA$solidjsweb.setProperty(_el$29, "disabled", _p$.i = _v$14);
3511
- _v$15 !== _p$.n && $52FdA$solidjsweb.setAttribute(_el$29, "aria-label", _p$.n = _v$15);
3512
- _v$16 !== _p$.s && $52FdA$solidjsweb.setAttribute(_el$29, "min", _p$.s = _v$16);
3513
- _v$17 !== _p$.h && $52FdA$solidjsweb.setAttribute(_el$29, "max", _p$.h = _v$17);
3527
+ _v$12 !== _p$.a && $52FdA$solidjsweb.setAttribute(_el$28, "aria-valuetext", _p$.a = _v$12);
3528
+ _v$13 !== _p$.o && $52FdA$solidjsweb.setAttribute(_el$28, "min", _p$.o = _v$13);
3529
+ _v$14 !== _p$.i && $52FdA$solidjsweb.setAttribute(_el$28, "max", _p$.i = _v$14);
3530
+ _v$15 !== _p$.n && $52FdA$solidjsweb.setProperty(_el$29, "disabled", _p$.n = _v$15);
3531
+ _v$16 !== _p$.s && $52FdA$solidjsweb.setAttribute(_el$29, "aria-label", _p$.s = _v$16);
3532
+ _v$17 !== _p$.h && $52FdA$solidjsweb.setAttribute(_el$29, "aria-valuetext", _p$.h = _v$17);
3533
+ _v$18 !== _p$.r && $52FdA$solidjsweb.setAttribute(_el$29, "min", _p$.r = _v$18);
3534
+ _v$19 !== _p$.d && $52FdA$solidjsweb.setAttribute(_el$29, "max", _p$.d = _v$19);
3514
3535
  return _p$;
3515
3536
  }, {
3516
3537
  e: undefined,
@@ -3520,7 +3541,9 @@ function $0257c760a99bfacb$var$LinearSlider(_ref8) {
3520
3541
  i: undefined,
3521
3542
  n: undefined,
3522
3543
  s: undefined,
3523
- h: undefined
3544
+ h: undefined,
3545
+ r: undefined,
3546
+ d: undefined
3524
3547
  });
3525
3548
  $52FdA$solidjsweb.effect(() => $52FdA$solidjsweb.setProperty(_el$28, "value", $52FdA$solidjs.createMemo(() => {
3526
3549
  min_();
@@ -4479,6 +4502,13 @@ const $cd0e5524f9476f9b$export$414f6a19d38e655c = _ref => {
4479
4502
  _el$7 = _el$6.nextSibling,
4480
4503
  [_el$8, _co$2] = $52FdA$solidjsweb.getNextMarker(_el$7.nextSibling);
4481
4504
  $52FdA$solidjsweb.spread(_el$2, $52FdA$solidjsweb.mergeProps(attributes, {
4505
+ "type": "button",
4506
+ get ["aria-pressed"]() {
4507
+ return is_selected();
4508
+ },
4509
+ get ["aria-label"]() {
4510
+ return $52FdA$solidjsweb.memo(() => value().count_ != undefined)() ? "".concat(label(), ", ").concat(value().count_) : label();
4511
+ },
4482
4512
  get disabled() {
4483
4513
  return $52FdA$solidjsweb.memo(() => !!count_zero())() && !is_selected();
4484
4514
  },
@@ -4690,7 +4720,14 @@ function $476a3dc36afc1938$export$82ed4b28ecb67608(_ref) {
4690
4720
  return !!(data !== null && data !== void 0 && data.some(item => $e2d74bb03cc5252e$export$325f75597868c4f0(item) === value));
4691
4721
  });
4692
4722
  const value = $52FdA$solidjs.createMemo(() => checkbox().value_);
4693
- const label_text = $52FdA$solidjs.createMemo(() => checkbox().name_ || value() + "");
4723
+ const label_text = $52FdA$solidjs.createMemo(() => {
4724
+ const name = checkbox().name_;
4725
+ if (name) return name;
4726
+ const value_string = value() + "";
4727
+ if (backendFilterV2()) return value_string;
4728
+ // Legacy values are "Name;#hex" - split is used to get the name so that screen readers don't announce the hex code
4729
+ return value_string.split(";")[0] || value_string;
4730
+ });
4694
4731
  const count = $52FdA$solidjs.createMemo(() => checkbox().count_);
4695
4732
  const colorNameDatasetValue = $52FdA$solidjs.createMemo(() => {
4696
4733
  var _split2;
@@ -5185,7 +5222,7 @@ $52FdA$solidjsweb.delegateEvents(["input", "click"]);
5185
5222
  var $164d474fea221d77$var$_tmpl$ = /*#__PURE__*/$52FdA$solidjsweb.template(`<div class=filter-collapsible>`),
5186
5223
  $164d474fea221d77$var$_tmpl$2 = /*#__PURE__*/$52FdA$solidjsweb.template(`<button class=clear-group><!$><!/><span>`),
5187
5224
  $164d474fea221d77$var$_tmpl$3 = /*#__PURE__*/$52FdA$solidjsweb.template(`<div class=view-more-clear><!$><!/><!$><!/>`),
5188
- $164d474fea221d77$var$_tmpl$4 = /*#__PURE__*/$52FdA$solidjsweb.template(`<div class=filter-collapsible-body><div class=filter-part><!$><!/><!$><!/></div><!$><!/>`),
5225
+ $164d474fea221d77$var$_tmpl$4 = /*#__PURE__*/$52FdA$solidjsweb.template(`<div class=filter-collapsible-body><fieldset class=filter-part><!$><!/><!$><!/></fieldset><!$><!/>`),
5189
5226
  $164d474fea221d77$var$_tmpl$5 = /*#__PURE__*/$52FdA$solidjsweb.template(`<details class=filter-collapsible>`),
5190
5227
  $164d474fea221d77$var$_tmpl$6 = /*#__PURE__*/$52FdA$solidjsweb.template(`<summary class=filter-group-summary><div class=summary><span></span><div class=selected-w-sign><!$><!/><!$><!/>`),
5191
5228
  $164d474fea221d77$var$_tmpl$7 = /*#__PURE__*/$52FdA$solidjsweb.template(`<div class=ungrouped>`),
@@ -5288,6 +5325,7 @@ function $164d474fea221d77$var$ActualFilterBody(props) {
5288
5325
  var _get_details_width;
5289
5326
  return get_details_width === null || get_details_width === void 0 ? void 0 : (_get_details_width = get_details_width()) === null || _get_details_width === void 0 ? void 0 : _get_details_width();
5290
5327
  });
5328
+ const title_id = $52FdA$depictaiutilishared.make_random_classname();
5291
5329
  return $52FdA$solidjsweb.createComponent((0, $4cfe8400ed3f92c4$export$6c6d7a51fa9aa15d), {
5292
5330
  is_open_: is_open,
5293
5331
  get details_() {
@@ -5308,6 +5346,7 @@ function $164d474fea221d77$var$ActualFilterBody(props) {
5308
5346
  [_el$25, _co$7] = $52FdA$solidjsweb.getNextMarker(_el$24.nextSibling),
5309
5347
  _el$26 = _el$25.nextSibling,
5310
5348
  [_el$27, _co$8] = $52FdA$solidjsweb.getNextMarker(_el$26.nextSibling);
5349
+ $52FdA$solidjsweb.setAttribute(_el$22, "id", title_id);
5311
5350
  $52FdA$solidjsweb.insert(_el$22, section_);
5312
5351
  $52FdA$solidjsweb.insert(_el$23, $52FdA$solidjsweb.createComponent((0, $52FdA$solidjs.Show), {
5313
5352
  get when() {
@@ -5342,6 +5381,7 @@ function $164d474fea221d77$var$ActualFilterBody(props) {
5342
5381
  [_el$7, _co$2] = $52FdA$solidjsweb.getNextMarker(_el$6.nextSibling),
5343
5382
  _el$17 = _el$3.nextSibling,
5344
5383
  [_el$18, _co$6] = $52FdA$solidjsweb.getNextMarker(_el$17.nextSibling);
5384
+ $52FdA$solidjsweb.setAttribute(_el$3, "aria-labelledby", title_id);
5345
5385
  $52FdA$solidjsweb.insert(_el$3, $52FdA$solidjsweb.createComponent(SearchThisFilterGroup_, {}), _el$5, _co$);
5346
5386
  $52FdA$solidjsweb.insert(_el$3, $52FdA$solidjsweb.createComponent((0, $52FdA$solidjs.Index), {
5347
5387
  get each() {
@@ -8012,7 +8052,7 @@ function $28535bb7671c63d1$export$e4b984597b71e989(props) {
8012
8052
  })));
8013
8053
  return container;
8014
8054
  }
8015
- const $f3db423dc84bc35d$var$customUrls = (url, width) => {
8055
+ const $f3db423dc84bc35d$var$defaultCustomUrls = (url, width) => {
8016
8056
  var _url$startsWith;
8017
8057
  if (url !== null && url !== void 0 && (_url$startsWith = url.startsWith) !== null && _url$startsWith !== void 0 && _url$startsWith.call(url, "https://cdn.shopify.com"))
8018
8058
  // The shopify image resizing CDN blocks Cloudflare's image resizer. It's possible that we can't detect shopify image URLs sometimes because they go to the merchant's domain,
@@ -8022,18 +8062,23 @@ const $f3db423dc84bc35d$var$customUrls = (url, width) => {
8022
8062
  return "https://app.depict.ai/cdn-cgi/image/width=".concat(width, ",format=auto/").concat(url);
8023
8063
  };
8024
8064
  function $f3db423dc84bc35d$export$9d4a4b669b1929ab(props) {
8065
+ var _props$imageResizer_;
8066
+ const resolvedCustomUrls = (_props$imageResizer_ = props.imageResizer_) !== null && _props$imageResizer_ !== void 0 ? _props$imageResizer_ : $f3db423dc84bc35d$var$defaultCustomUrls;
8025
8067
  return $52FdA$solidjsweb.createComponent((0, $28535bb7671c63d1$export$e4b984597b71e989), $52FdA$solidjsweb.mergeProps(props, {
8026
8068
  get imgProps() {
8027
8069
  return {
8028
8070
  ...props.imgProps,
8029
- customUrls: $f3db423dc84bc35d$var$customUrls
8071
+ customUrls: resolvedCustomUrls
8030
8072
  };
8031
8073
  }
8032
8074
  }));
8033
8075
  }
8034
8076
  function $f3db423dc84bc35d$export$140423fa4bfb6d63(props) {
8035
8077
  return $52FdA$solidjsweb.createComponent((0, $858fdcf73148519f$export$6e5611bc7e57e477), $52FdA$solidjsweb.mergeProps(props, {
8036
- customUrls: $f3db423dc84bc35d$var$customUrls
8078
+ get customUrls() {
8079
+ var _props$imageResizer_2;
8080
+ return (_props$imageResizer_2 = props.imageResizer_) !== null && _props$imageResizer_2 !== void 0 ? _props$imageResizer_2 : $f3db423dc84bc35d$var$defaultCustomUrls;
8081
+ }
8037
8082
  }));
8038
8083
  }
8039
8084
  let $8e8c89c02c16dc7b$var$cachedHlsModule;
@@ -8059,7 +8104,8 @@ function $c19709057a32b2e7$export$780a853d15174484(_ref) {
8059
8104
  router_: router_,
8060
8105
  setAspectRatioWas_: setAspectRatioWas_,
8061
8106
  mediaUrl_: mediaUrl_,
8062
- aspectRatioWhenAloneInRow_: aspectRatioWhenAloneInRow_
8107
+ aspectRatioWhenAloneInRow_: aspectRatioWhenAloneInRow_,
8108
+ imageResizer_: imageResizer_
8063
8109
  } = _ref;
8064
8110
  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
8065
8111
  const [wrapperSize, setWrapperSize] = $52FdA$solidjs.createSignal();
@@ -8115,7 +8161,8 @@ function $c19709057a32b2e7$export$780a853d15174484(_ref) {
8115
8161
  src: mediaUrl_,
8116
8162
  "class": "d-standard-content",
8117
8163
  onDecoded: () => setHasLoaded(true),
8118
- ref: el => el.addEventListener("load", $52FdA$depictaiutilisharedlatest.catchify(() => setAspectRatio(el.naturalWidth / el.naturalHeight)))
8164
+ ref: el => el.addEventListener("load", $52FdA$depictaiutilisharedlatest.catchify(() => setAspectRatio(el.naturalWidth / el.naturalHeight))),
8165
+ imageResizer_: imageResizer_
8119
8166
  });
8120
8167
  }
8121
8168
  }), $52FdA$solidjsweb.createComponent((0, $52FdA$solidjs.Match), {
@@ -8166,7 +8213,7 @@ function $c19709057a32b2e7$export$780a853d15174484(_ref) {
8166
8213
  }
8167
8214
  }));
8168
8215
  }
8169
- function $0c035bbe7e30b438$export$7a92d995f1bf3592(history_content_blocks_, plp_meta, content_blocks_by_row_, router_, products_request_loading_) {
8216
+ function $0c035bbe7e30b438$export$7a92d995f1bf3592(history_content_blocks_, plp_meta, content_blocks_by_row_, router_, products_request_loading_, imageResizer_) {
8170
8217
  let hasSeenContentBlock = false;
8171
8218
  const [historyContentBlocks, setHistoryContentBlocks] = history_content_blocks_;
8172
8219
  const contentComponents = new Map();
@@ -8222,7 +8269,8 @@ function $0c035bbe7e30b438$export$7a92d995f1bf3592(history_content_blocks_, plp_
8222
8269
  ...prev.aspectRatios,
8223
8270
  [componentCacheKey]: Math.round(aspectRatio * 100) / 100
8224
8271
  }
8225
- }))
8272
+ })),
8273
+ imageResizer_: imageResizer_
8226
8274
  });
8227
8275
  contentComponents.set(componentCacheKey, component);
8228
8276
  }
@@ -8287,7 +8335,8 @@ function $ede6c70ecdca46fe$export$f7d2f673fc2f091d(_ref) {
8287
8335
  filterModalParent_: filterModalParent_,
8288
8336
  showSliderArrow_: showSliderArrow_,
8289
8337
  hideCount0FilterOptions_: hideCount0FilterOptions_,
8290
- switchToFiltersDrawerBreakpoint_: switchToFiltersDrawerBreakpoint_
8338
+ switchToFiltersDrawerBreakpoint_: switchToFiltersDrawerBreakpoint_,
8339
+ imageResizer_: imageResizer_
8291
8340
  } = _ref;
8292
8341
  let results_for;
8293
8342
  let only_show_filters_opener_;
@@ -8383,7 +8432,7 @@ function $ede6c70ecdca46fe$export$f7d2f673fc2f091d(_ref) {
8383
8432
  setMetaRequestsForQuery(prev => prev.set(query.id_type_ + query.id_to_query_for_, listing));
8384
8433
  return result;
8385
8434
  }));
8386
- const contentBlocksByRow = $0c035bbe7e30b438$export$7a92d995f1bf3592(history_content_blocks_, plp_meta, content_blocks_by_row_, router_, () => plp_products_.loading);
8435
+ const contentBlocksByRow = $0c035bbe7e30b438$export$7a92d995f1bf3592(history_content_blocks_, plp_meta, content_blocks_by_row_, router_, () => plp_products_.loading, imageResizer_);
8387
8436
  const countOfProductsForUI = $e335e2ff536c1a0b$export$a86bc18439445599(plp_products_, all_products_loaded_, currentlyLoadedDisplays);
8388
8437
  const available_sortings_ = $52FdA$solidjs.createMemo(() => {
8389
8438
  var _plp_products_, _plp_products_$sorts;
@@ -8969,7 +9018,8 @@ function $53dca9b7b01789b1$export$b73ed90f0ee50dc3(_ref) {
8969
9018
  outerRef_: outerRef_,
8970
9019
  animationDuration_: animationDuration_,
8971
9020
  priceFormatting_: priceFormatting_,
8972
- pseudoRouter_: pseudoRouter_
9021
+ pseudoRouter_: pseudoRouter_,
9022
+ imageResizer_: imageResizer_
8973
9023
  } = _ref;
8974
9024
  const variantToUse = $52FdA$solidjs.createMemo(() => {
8975
9025
  const display = display_();
@@ -9058,7 +9108,8 @@ function $53dca9b7b01789b1$export$b73ed90f0ee50dc3(_ref) {
9058
9108
  },
9059
9109
  imgProps: {
9060
9110
  keyRatioUpdating: true
9061
- }
9111
+ },
9112
+ imageResizer_: imageResizer_
9062
9113
  });
9063
9114
  }
9064
9115
  }));
@@ -9264,7 +9315,8 @@ function $1709366c442d8933$export$ebf0b1d4f90c09ae(_ref) {
9264
9315
  supportsHover_: supportsHover_,
9265
9316
  priceFormatting_: priceFormatting_,
9266
9317
  pseudoRouter_: pseudoRouter_,
9267
- containerHeight_: containerHeight_
9318
+ containerHeight_: containerHeight_,
9319
+ imageResizer_: imageResizer_
9268
9320
  } = _ref;
9269
9321
  let isAffectedByChromeBug = false;
9270
9322
  // If the user requests the drawer to be expanded or not
@@ -9332,6 +9384,7 @@ function $1709366c442d8933$export$ebf0b1d4f90c09ae(_ref) {
9332
9384
  userWantsExpandedSignal_: userWantsExpandedSignal_,
9333
9385
  textFadeInAnimationRunning_: textFadeInAnimationRunning,
9334
9386
  priceFormatting_: priceFormatting_,
9387
+ imageResizer_: imageResizer_,
9335
9388
  outerRef_: el => $52FdA$solidjs.createEffect(() => {
9336
9389
  if (index !== 0) return;
9337
9390
  const resizeObserver = new ResizeObserver($52FdA$depictaiutilishared.catchify(records => setLookItemHeight(records.at(-1).contentRect.height)));
@@ -9391,7 +9444,8 @@ function $ae325261371de459$export$44809a8a3e867e30(_ref) {
9391
9444
  placeholderImageAspectRatio_: placeholderImageAspectRatio_,
9392
9445
  animationDuration_: animationDuration_,
9393
9446
  priceFormatting_: priceFormatting_,
9394
- pseudoRouter_: pseudoRouter_
9447
+ pseudoRouter_: pseudoRouter_,
9448
+ imageResizer_: imageResizer_
9395
9449
  } = _ref;
9396
9450
  let container;
9397
9451
  const useWantsExpandedSignal_ = $52FdA$solidjs.createSignal(false);
@@ -9481,7 +9535,8 @@ function $ae325261371de459$export$44809a8a3e867e30(_ref) {
9481
9535
  return (_display_ = display_()) === null || _display_ === void 0 ? void 0 : (_display_$image_urls = _display_.image_urls) === null || _display_$image_urls === void 0 ? void 0 : _display_$image_urls[0];
9482
9536
  },
9483
9537
  aspectRatio: placeholderImageAspectRatio_,
9484
- autoAdjustAspectRatio: true
9538
+ autoAdjustAspectRatio: true,
9539
+ imageResizer_: imageResizer_
9485
9540
  });
9486
9541
  }
9487
9542
  }), _el$3, _co$);
@@ -9497,7 +9552,8 @@ function $ae325261371de459$export$44809a8a3e867e30(_ref) {
9497
9552
  FavoriteButton_: FavoriteButton_,
9498
9553
  priceFormatting_: priceFormatting_,
9499
9554
  pseudoRouter_: pseudoRouter_,
9500
- containerHeight_: containerHeight_
9555
+ containerHeight_: containerHeight_,
9556
+ imageResizer_: imageResizer_
9501
9557
  }), _el$5, _co$2);
9502
9558
  $52FdA$solidjsweb.effect(() => _el$.classList.toggle("placeholder", !display_()));
9503
9559
  $52FdA$solidjsweb.runHydrationEvents();
@@ -9782,7 +9838,8 @@ function $e57cd46536ad992e$export$2c9f9bf2092486aa(props) {
9782
9838
  animationDuration_: expandingAnimationDuration,
9783
9839
  expandedLooksSignal_: $e57cd46536ad992e$var$expandedLooksSignal_,
9784
9840
  priceFormatting_: () => props.priceFormatting_,
9785
- pseudoRouter_: pseudoRouter
9841
+ pseudoRouter_: pseudoRouter,
9842
+ imageResizer_: props.imageResizer_
9786
9843
  }),
9787
9844
  recommendations_resource_: looksResource,
9788
9845
  title_: () => props.title_,
@@ -11757,7 +11814,8 @@ function $d1e7b96fb13cd1d3$export$67152d26d4f56ee8(_ref) {
11757
11814
  merchant_: merchant_,
11758
11815
  keyboardNavigationGroupIndex_: keyboardNavigationGroupIndex_,
11759
11816
  index_: index_,
11760
- selected_index_: [read_selected_index_, write_selected_index_]
11817
+ selected_index_: [read_selected_index_, write_selected_index_],
11818
+ imageResizer_: imageResizer_
11761
11819
  } = _ref;
11762
11820
  const href = $52FdA$solidjs.createMemo(() => {
11763
11821
  var _listing_;
@@ -11824,7 +11882,8 @@ function $d1e7b96fb13cd1d3$export$67152d26d4f56ee8(_ref) {
11824
11882
  get children() {
11825
11883
  var _el$3 = $52FdA$solidjsweb.getNextElement($d1e7b96fb13cd1d3$var$_tmpl$2);
11826
11884
  $52FdA$solidjsweb.insert(_el$3, $52FdA$solidjsweb.createComponent($d1e7b96fb13cd1d3$export$ea41102db9bd68c3, {
11827
- image_urls_: image_urls
11885
+ image_urls_: image_urls,
11886
+ imageResizer_: imageResizer_
11828
11887
  }));
11829
11888
  return _el$3;
11830
11889
  }
@@ -11870,7 +11929,8 @@ function $d1e7b96fb13cd1d3$export$67152d26d4f56ee8(_ref) {
11870
11929
  }
11871
11930
  function $d1e7b96fb13cd1d3$export$ea41102db9bd68c3(_ref3) {
11872
11931
  let {
11873
- image_urls_: image_urls_
11932
+ image_urls_: image_urls_,
11933
+ imageResizer_: imageResizer_
11874
11934
  } = _ref3;
11875
11935
  return $52FdA$solidjsweb.createComponent((0, $52FdA$solidjs.Show), {
11876
11936
  get when() {
@@ -11894,7 +11954,8 @@ function $d1e7b96fb13cd1d3$export$ea41102db9bd68c3(_ref3) {
11894
11954
  },
11895
11955
  imgProps: {
11896
11956
  style: "object-fit: cover;"
11897
- }
11957
+ },
11958
+ imageResizer_: imageResizer_
11898
11959
  })
11899
11960
  });
11900
11961
  }
@@ -11925,7 +11986,8 @@ function $f765bad01136eee1$export$c8d7e00464029b45(_ref) {
11925
11986
  selected_index_: selected_index_,
11926
11987
  modalLayoutStacked_: modalLayoutStacked_,
11927
11988
  showPlaceholders_: showPlaceholders_,
11928
- currently_showing_suggestions_: [, set_currently_showing_suggestions]
11989
+ currently_showing_suggestions_: [, set_currently_showing_suggestions],
11990
+ imageResizer_: imageResizer_
11929
11991
  } = _ref;
11930
11992
  const listings_by_id = $52FdA$solidjs.createMemo(() => Object.fromEntries((listing_suggestions_() || []).map(listing => [listing.listing_id, listing])));
11931
11993
  const productCards = $52FdA$solidjsweb.createComponent((0, $52FdA$solidjs.For), {
@@ -11943,7 +12005,8 @@ function $f765bad01136eee1$export$c8d7e00464029b45(_ref) {
11943
12005
  merchant_: merchant_,
11944
12006
  keyboardNavigationGroupIndex_: itemIndex_,
11945
12007
  index_: index,
11946
- selected_index_: selected_index_
12008
+ selected_index_: selected_index_,
12009
+ imageResizer_: imageResizer_
11947
12010
  });
11948
12011
  }
11949
12012
  });
@@ -12336,7 +12399,8 @@ function $43600b30502feeda$var$RawSearchModalV2(_ref) {
12336
12399
  sorting_query_param_: sorting_query_param_,
12337
12400
  filter_query_param_prefix_: filter_query_param_prefix_,
12338
12401
  setSearchFieldOuterWidth_: setSearchFieldOuterWidth_,
12339
- forceUseDiv_: forceUseDiv_
12402
+ forceUseDiv_: forceUseDiv_,
12403
+ imageResizer_: imageResizer_
12340
12404
  } = _ref;
12341
12405
  let on_enter_in_search_field_function;
12342
12406
  let listingSuggestionsDebounceTimeout;
@@ -12554,7 +12618,8 @@ function $43600b30502feeda$var$RawSearchModalV2(_ref) {
12554
12618
  },
12555
12619
  imgProps: {
12556
12620
  alt: "Product image"
12557
- }
12621
+ },
12622
+ imageResizer_: imageResizer_
12558
12623
  }),
12559
12624
  ...instant_results_options_
12560
12625
  }), _el$4, _co$);
@@ -12585,7 +12650,8 @@ function $43600b30502feeda$var$RawSearchModalV2(_ref) {
12585
12650
  selected_index_: selected_index_,
12586
12651
  currently_showing_suggestions_: currently_showing_suggestions_,
12587
12652
  modalLayoutStacked_: modalLayoutStacked_,
12588
- showPlaceholders_: () => !suggestions_response_.latest
12653
+ showPlaceholders_: () => !suggestions_response_.latest,
12654
+ imageResizer_: imageResizer_
12589
12655
  });
12590
12656
  }
12591
12657
  });
@@ -15958,6 +16024,7 @@ class $ddd39c5f36f49703$export$ac6237957a15b3f0 {
15958
16024
  display_transformers: display_transformers,
15959
16025
  api: api,
15960
16026
  searchModalComponent: searchModalComponent,
16027
+ imageResizer_: imageResizer_,
15961
16028
  // Stuff needed for non-standard customer deployments that we shouldn't actually expose
15962
16029
  disable_scrolling_during_modal = true,
15963
16030
  bottom_distance_under_modal: bottom_distance_under_modal,
@@ -16121,6 +16188,7 @@ class $ddd39c5f36f49703$export$ac6237957a15b3f0 {
16121
16188
  },
16122
16189
  i18n_: i18n_,
16123
16190
  enable_category_suggestions_: enable_category_suggestions,
16191
+ imageResizer_: imageResizer_,
16124
16192
  disable_scrolling_: disable_scrolling_during_modal,
16125
16193
  bottom_distance_under_modal_: bottom_distance_under_modal
16126
16194
  }, override_modal_element);
@@ -17031,7 +17099,8 @@ function $c10e33c4681f8c9b$export$e2bf8ce7779e827e(props) {
17031
17099
  product_card_template_: product_card_template,
17032
17100
  sorting_query_param_: sorting_query_param_,
17033
17101
  filter_query_param_prefix_: filter_query_param_prefix_,
17034
- switchToFiltersDrawerBreakpoint_: () => props.switchToFiltersDrawerBreakpoint_
17102
+ switchToFiltersDrawerBreakpoint_: () => props.switchToFiltersDrawerBreakpoint_,
17103
+ imageResizer_: props.imageResizer_
17035
17104
  });
17036
17105
  }, "Entire CategoryPage failed");
17037
17106
  }
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.10.11";
14
+ export const version = "4.10.13";
15
15
  /**
16
16
  * Use `javascript_media_query` but return a reactive accessor instead of taking a callback function
17
17
  */
@@ -632,14 +632,19 @@ export function ShopifyContainedImage(props: {
632
632
  class?: string;
633
633
  imgProps?: Omit<Parameters<typeof ShopifyResponsiveImg>[0], "size" | "src">;
634
634
  }): HTMLDivElement;
635
+ export type ImageResizer = (url: string, width: number) => string;
635
636
  /**
636
637
  * Hacks ShopifyContainedImage work even for non-shopify image urls by forcing the format to be WebP
637
638
  */
638
- export function ModernResponsiveContainedImage(props: Parameters<typeof ShopifyContainedImage>[0]): import("solid-js").JSX.Element;
639
+ export function ModernResponsiveContainedImage(props: Parameters<typeof ShopifyContainedImage>[0] & {
640
+ imageResizer_?: ImageResizer;
641
+ }): import("solid-js").JSX.Element;
639
642
  /**
640
643
  * Wrapper around ShopifyResponsiveImg (component that just does an image, without wrapping in div). The wrapper allows ShopifyResponsiveImg to work both with shopify CDN URLs and arbitrary URLs, where the latter will be fed through Depict's cloudflare resizer.
641
644
  */
642
- export function ModernResponsiveImage(props: Parameters<typeof ShopifyResponsiveImg>[0]): import("solid-js").JSX.Element;
645
+ export function ModernResponsiveImage(props: Parameters<typeof ShopifyResponsiveImg>[0] & {
646
+ imageResizer_?: ImageResizer;
647
+ }): import("solid-js").JSX.Element;
643
648
  export function CrossIcon(props?: JSX.SvgSVGAttributes<SVGSVGElement>): SVGElement;
644
649
  /**
645
650
  * Symbol used to identify the version of a SearchModal function. Values right now: 1 = 1st gen classic modal, 2 = second gen modal
@@ -730,7 +735,8 @@ declare function RawSearchModalV2<InputDisplay extends Display, OutputDisplay ex
730
735
  sorting_query_param_,
731
736
  filter_query_param_prefix_,
732
737
  setSearchFieldOuterWidth_,
733
- forceUseDiv_
738
+ forceUseDiv_,
739
+ imageResizer_
734
740
  }: {
735
741
  search_field_value_: Signal<string>;
736
742
  get_search_query_: Accessor<string>;
@@ -767,6 +773,7 @@ declare function RawSearchModalV2<InputDisplay extends Display, OutputDisplay ex
767
773
  enable_category_suggestions_?: boolean;
768
774
  dont_sync_search_field_value_except_on_submit_?: boolean;
769
775
  content_search_enabled_: Accessor<boolean>;
776
+ imageResizer_?: ImageResizer;
770
777
  }): HTMLDivElement[];
771
778
  export const SearchModalV2: typeof RawSearchModalV2;
772
779
  /**
@@ -855,6 +862,13 @@ export type BaseProviderConfig<InputDisplay extends Display, PossibleTransformed
855
862
  * We recommend to just use an incrementing number for this, e.g. "1", "2", "3", ...
856
863
  */
857
864
  uniqueInstanceKeyForState?: string;
865
+ /**
866
+ * Optional function to override the default image resizing CDN. When provided, this function is called
867
+ * with the original image URL and desired width, and should return the resized image URL.
868
+ * By default, Depict uses Cloudflare's image resizer for non-Shopify images, and Shopify's built-in
869
+ * resizer for Shopify CDN images.
870
+ */
871
+ imageResizer?: (url: string, width: number) => string;
858
872
  } & (InputDisplay extends ModernDisplay ? "page_url" extends keyof InputDisplay["variant_displays"][number] ? {
859
873
  /**
860
874
  * Functions that take in a list of categories, content search results or products and then can transform or enrich the data for each category, content search result or product card in a batched way.
@@ -1150,7 +1164,8 @@ export function LookCard({
1150
1164
  placeholderImageAspectRatio_,
1151
1165
  animationDuration_,
1152
1166
  priceFormatting_,
1153
- pseudoRouter_
1167
+ pseudoRouter_,
1168
+ imageResizer_
1154
1169
  }: {
1155
1170
  display_: Accessor<FeaturedInDisplay | null>;
1156
1171
  FavoriteButton_?: (props: {
@@ -1161,6 +1176,7 @@ export function LookCard({
1161
1176
  expandedLooksSignal_: Signal<Set<symbol>>;
1162
1177
  priceFormatting_: Accessor<plp_shared_i18n["price_formatting_"]>;
1163
1178
  pseudoRouter_: PseudoRouter;
1179
+ imageResizer_?: ImageResizer;
1164
1180
  }): JSX.Element;
1165
1181
  /**
1166
1182
  * Render a grid with provided recommendations. displayTransformers will not be applied for this since you yourself provide the displays. Options are reactive.
@@ -1193,6 +1209,7 @@ export function LooksSliderOrGrid(props: {
1193
1209
  };
1194
1210
  onNavigation_?: OnNavigation;
1195
1211
  priceFormatting_: plp_shared_i18n["price_formatting_"];
1212
+ imageResizer_?: (url: string, width: number) => string;
1196
1213
  }): HTMLDivElement;
1197
1214
  export const prefixes_to_preserve_in_history_dot_state: Set<string>;
1198
1215
  /**
@@ -1427,6 +1444,7 @@ type GeneralConstructorOptions<InputDisplay extends Display, OutputDisplay exten
1427
1444
  enable_content_search?: boolean;
1428
1445
  unique_instance_key_for_state?: string;
1429
1446
  searchModalComponent: typeof SearchModalV2<InputDisplay, OutputDisplay> | typeof ClassicSearchModal;
1447
+ imageResizer_?: (url: string, width: number) => string;
1430
1448
  disable_scrolling_during_modal?: boolean;
1431
1449
  bottom_distance_under_modal?: Accessor<number | undefined>;
1432
1450
  override_modal_element?: HTMLElement | ShadowRoot;
@@ -1462,6 +1480,7 @@ export class DepictSearch<InputDisplay extends Display, OutputDisplay extends Mo
1462
1480
  display_transformers,
1463
1481
  api,
1464
1482
  searchModalComponent,
1483
+ imageResizer_,
1465
1484
  disable_scrolling_during_modal,
1466
1485
  bottom_distance_under_modal,
1467
1486
  override_modal_element,
@@ -1623,5 +1642,6 @@ export function CategoryPage<OriginalDisplay extends Display, OutputDisplay exte
1623
1642
  filterModalParent_?: HTMLElement | ShadowRoot;
1624
1643
  showSliderArrow_?: boolean;
1625
1644
  hideCount0FilterOptions_?: boolean;
1645
+ imageResizer_?: (url: string, width: number) => string;
1626
1646
  }): import("@depict-ai/utilishared/latest").Node_Array;
1627
1647
  export type { SearchFilter } from "@depict-ai/types/api/SearchRequestV3";