@depict-ai/ui 4.7.34 → 4.8.0

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, "QuickLinks", () => $335c02c1241a9ca8$export$de03
114
114
  $parcel$export(module.exports, "CategoryPage", () => $c10e33c4681f8c9b$export$e2bf8ce7779e827e);
115
115
  $parcel$export(module.exports, "makeSizeAccessors", () => $054b1113e4897051$export$54c6d6ff54e72743);
116
116
  /*! Depict.ai search and product listing SDK */
117
- const $aa1938dec50d6c12$export$83d89fbfd8236492 = "4.7.34";
117
+ const $aa1938dec50d6c12$export$83d89fbfd8236492 = "4.8.0";
118
118
  const $d067f3a30f047b41$var$ListingContext = /*@__PURE__*/$52FdA$solidjs.createContext();
119
119
  function $d067f3a30f047b41$export$e68cff63f76bd15b(props) {
120
120
  const our_object = {};
@@ -284,7 +284,7 @@ function $858fdcf73148519f$export$6e5611bc7e57e477(props) {
284
284
  img.addEventListener("load", $52FdA$depictaiutilishared.catchify(() => {
285
285
  const aspectRatio_ = img.naturalWidth / img.naturalHeight;
286
286
  if (srcJustChanged)
287
- // Always key object-fit-cover compensation to avoid loading-different-images-infinite-loop
287
+ // Always key object-fit-cover compensation to one src, to avoid loading-different-images-infinite-loop
288
288
  setOurRatioKeyed(aspectRatio_);else if (props.keyRatioUpdating) return;
289
289
  srcJustChanged = false;
290
290
  // Save our aspect ratio whenever it changes, so that we can base the containers on the most dominant aspect ratio, used in SearchModalV2 and LookItem
@@ -12156,8 +12156,15 @@ function $484eec37514a982e$export$3925f87b1545cfc6(_ref) {
12156
12156
  return for_id === id_currently_querying_for_();
12157
12157
  })) === null || _get_scroll_restorati2 === void 0 ? void 0 : _get_scroll_restorati2.min_results_loaded) !== null && _get_scroll_restorati !== void 0 ? _get_scroll_restorati : min_products_to_fetch_);
12158
12158
  });
12159
- const doesnt_have_content_blocks = $52FdA$solidjs.createMemo(() => !content_blocks_by_row_());
12160
- const content_blocks_ = $52FdA$solidjs.createMemo(() => doesnt_have_content_blocks() ? () => [] : $f8f375d6245ffff2$export$791ef57e62e21c3f({
12159
+ const layout = $52FdA$solidjs.createMemo(() => {
12160
+ const incoming_layout = layout_options_().layout;
12161
+ if (incoming_layout === "slider-without-filters") return "slider";
12162
+ return incoming_layout || "grid";
12163
+ });
12164
+ const doesnt_have_content_blocks = $52FdA$solidjs.createMemo(() => !content_blocks_by_row_() || layout() !== "grid");
12165
+ const content_blocks_ = $52FdA$solidjs.createMemo(() => doesnt_have_content_blocks() ?
12166
+ // This bailing here is to not use proxy/stores and retain old browser compatibility when no content blocks are present
12167
+ () => [] : $f8f375d6245ffff2$export$791ef57e62e21c3f({
12161
12168
  content_blocks_: content_blocks_by_row_,
12162
12169
  cols_at_size_: modified_cols_at_size,
12163
12170
  set_top_row_shortened_by_: set_top_row_shortened_by_
@@ -12169,11 +12176,6 @@ function $484eec37514a982e$export$3925f87b1545cfc6(_ref) {
12169
12176
  num_placeholders_: num_placeholders_
12170
12177
  });
12171
12178
  });
12172
- const layout = $52FdA$solidjs.createMemo(() => {
12173
- const incoming_layout = layout_options_().layout;
12174
- if (incoming_layout === "slider-without-filters") return "slider";
12175
- return incoming_layout || "grid";
12176
- });
12177
12179
  const [get_suspense_is_blocked, set_suspense_is_blocked] = $52FdA$solidjs.createSignal(false);
12178
12180
  const block_suspense_if_needed = () => {
12179
12181
  if (!is_just_after_plp_results_update) return;
@@ -12196,7 +12198,6 @@ function $484eec37514a982e$export$3925f87b1545cfc6(_ref) {
12196
12198
  }, {
12197
12199
  defer: true
12198
12200
  }));
12199
- $52FdA$solidjs.createEffect(() => layout() !== "grid" && !doesnt_have_content_blocks() && $52FdA$depictaiutilishared.dwarn("Slider layout doesn't support content blocks"));
12200
12201
  /*
12201
12202
  This suspense ensures that if someone has async templates, we still show placeholders until the product cards actually have finished rendering (automagically since they're createResource's)
12202
12203
  We're creating it outside the <Show> so that we can benefit from <For>'s optimisation between changing results
@@ -16030,6 +16031,7 @@ function $c19709057a32b2e7$export$780a853d15174484(_ref) {
16030
16031
  }
16031
16032
  $52FdA$solidjsweb.delegateEvents(["click"]);
16032
16033
  function $0c035bbe7e30b438$export$7a92d995f1bf3592(history_content_blocks_, plp_meta, content_blocks_by_row_, router_) {
16034
+ let hasSeenContentBlock = false;
16033
16035
  const [historyContentBlocks, setHistoryContentBlocks] = history_content_blocks_;
16034
16036
  $52FdA$solidjs.createEffect(() => {
16035
16037
  var _plp_meta;
@@ -16037,9 +16039,16 @@ function $0c035bbe7e30b438$export$7a92d995f1bf3592(history_content_blocks_, plp_
16037
16039
  if (serverContentBlock && JSON.stringify(serverContentBlock) !== JSON.stringify(historyContentBlocks())) setHistoryContentBlocks(serverContentBlock);
16038
16040
  });
16039
16041
  const contentBlocksByRow = $52FdA$solidjs.createMemo(() => {
16040
- if (content_blocks_by_row_()) return content_blocks_by_row_();
16042
+ const developerProvided = content_blocks_by_row_();
16043
+ const fromHistory = historyContentBlocks();
16044
+ if (developerProvided) return developerProvided;
16045
+ // If we didn't get any content blocks (backend always return empty array) and we haven't seen any content blocks yet, return undefined
16046
+ // This is so the result rendering (PLPResults) will still use flexbox provided rendering on existing customers, so adding this isn't a breaking change
16047
+ // We don't want to switch rendering method every time one switches between a collection that hasn't vs has content blocks though, so once we've seen one content block we'll switch to css-grid-based rendering
16048
+ if (!(fromHistory !== null && fromHistory !== void 0 && fromHistory.length) && !hasSeenContentBlock) return undefined;
16041
16049
  const content = [];
16042
- historyContentBlocks().forEach(row => {
16050
+ hasSeenContentBlock = true;
16051
+ fromHistory.forEach(row => {
16043
16052
  const contentBlock = {
16044
16053
  span_columns: row.span_columns,
16045
16054
  span_rows: row.span_rows,
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.7.34";
14
+ export const version = "4.8.0";
15
15
  /**
16
16
  * Provider to wrap every listing (group of products) in
17
17
  * Used for example for deduplicating ResizeObservers for responsive images
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.7.34";
13
+ const $8db9a15135765c11$export$83d89fbfd8236492 = "4.8.0";
14
14
  const $5441862cd2f5e111$var$ListingContext = /*@__PURE__*/$8tj43$createContext();
15
15
  function $5441862cd2f5e111$export$e68cff63f76bd15b(props) {
16
16
  const our_object = {};
@@ -180,7 +180,7 @@ function $56047603f9d212b6$export$6e5611bc7e57e477(props) {
180
180
  img.addEventListener("load", $8tj43$catchify(() => {
181
181
  const aspectRatio_ = img.naturalWidth / img.naturalHeight;
182
182
  if (srcJustChanged)
183
- // Always key object-fit-cover compensation to avoid loading-different-images-infinite-loop
183
+ // Always key object-fit-cover compensation to one src, to avoid loading-different-images-infinite-loop
184
184
  setOurRatioKeyed(aspectRatio_);else if (props.keyRatioUpdating) return;
185
185
  srcJustChanged = false;
186
186
  // Save our aspect ratio whenever it changes, so that we can base the containers on the most dominant aspect ratio, used in SearchModalV2 and LookItem
@@ -12052,8 +12052,15 @@ function $7faea0096f14b59b$export$3925f87b1545cfc6(_ref) {
12052
12052
  return for_id === id_currently_querying_for_();
12053
12053
  })) === null || _get_scroll_restorati2 === void 0 ? void 0 : _get_scroll_restorati2.min_results_loaded) !== null && _get_scroll_restorati !== void 0 ? _get_scroll_restorati : min_products_to_fetch_);
12054
12054
  });
12055
- const doesnt_have_content_blocks = $8tj43$createMemo(() => !content_blocks_by_row_());
12056
- const content_blocks_ = $8tj43$createMemo(() => doesnt_have_content_blocks() ? () => [] : $ff7feae4dddd6073$export$791ef57e62e21c3f({
12055
+ const layout = $8tj43$createMemo(() => {
12056
+ const incoming_layout = layout_options_().layout;
12057
+ if (incoming_layout === "slider-without-filters") return "slider";
12058
+ return incoming_layout || "grid";
12059
+ });
12060
+ const doesnt_have_content_blocks = $8tj43$createMemo(() => !content_blocks_by_row_() || layout() !== "grid");
12061
+ const content_blocks_ = $8tj43$createMemo(() => doesnt_have_content_blocks() ?
12062
+ // This bailing here is to not use proxy/stores and retain old browser compatibility when no content blocks are present
12063
+ () => [] : $ff7feae4dddd6073$export$791ef57e62e21c3f({
12057
12064
  content_blocks_: content_blocks_by_row_,
12058
12065
  cols_at_size_: modified_cols_at_size,
12059
12066
  set_top_row_shortened_by_: set_top_row_shortened_by_
@@ -12065,11 +12072,6 @@ function $7faea0096f14b59b$export$3925f87b1545cfc6(_ref) {
12065
12072
  num_placeholders_: num_placeholders_
12066
12073
  });
12067
12074
  });
12068
- const layout = $8tj43$createMemo(() => {
12069
- const incoming_layout = layout_options_().layout;
12070
- if (incoming_layout === "slider-without-filters") return "slider";
12071
- return incoming_layout || "grid";
12072
- });
12073
12075
  const [get_suspense_is_blocked, set_suspense_is_blocked] = $8tj43$createSignal(false);
12074
12076
  const block_suspense_if_needed = () => {
12075
12077
  if (!is_just_after_plp_results_update) return;
@@ -12092,7 +12094,6 @@ function $7faea0096f14b59b$export$3925f87b1545cfc6(_ref) {
12092
12094
  }, {
12093
12095
  defer: true
12094
12096
  }));
12095
- $8tj43$createEffect(() => layout() !== "grid" && !doesnt_have_content_blocks() && $8tj43$dwarn("Slider layout doesn't support content blocks"));
12096
12097
  /*
12097
12098
  This suspense ensures that if someone has async templates, we still show placeholders until the product cards actually have finished rendering (automagically since they're createResource's)
12098
12099
  We're creating it outside the <Show> so that we can benefit from <For>'s optimisation between changing results
@@ -15926,6 +15927,7 @@ function $3b772ef9a35560fe$export$780a853d15174484(_ref) {
15926
15927
  }
15927
15928
  $8tj43$delegateEvents(["click"]);
15928
15929
  function $12ff24fdc4b26d88$export$7a92d995f1bf3592(history_content_blocks_, plp_meta, content_blocks_by_row_, router_) {
15930
+ let hasSeenContentBlock = false;
15929
15931
  const [historyContentBlocks, setHistoryContentBlocks] = history_content_blocks_;
15930
15932
  $8tj43$createEffect(() => {
15931
15933
  var _plp_meta;
@@ -15933,9 +15935,16 @@ function $12ff24fdc4b26d88$export$7a92d995f1bf3592(history_content_blocks_, plp_
15933
15935
  if (serverContentBlock && JSON.stringify(serverContentBlock) !== JSON.stringify(historyContentBlocks())) setHistoryContentBlocks(serverContentBlock);
15934
15936
  });
15935
15937
  const contentBlocksByRow = $8tj43$createMemo(() => {
15936
- if (content_blocks_by_row_()) return content_blocks_by_row_();
15938
+ const developerProvided = content_blocks_by_row_();
15939
+ const fromHistory = historyContentBlocks();
15940
+ if (developerProvided) return developerProvided;
15941
+ // If we didn't get any content blocks (backend always return empty array) and we haven't seen any content blocks yet, return undefined
15942
+ // This is so the result rendering (PLPResults) will still use flexbox provided rendering on existing customers, so adding this isn't a breaking change
15943
+ // We don't want to switch rendering method every time one switches between a collection that hasn't vs has content blocks though, so once we've seen one content block we'll switch to css-grid-based rendering
15944
+ if (!(fromHistory !== null && fromHistory !== void 0 && fromHistory.length) && !hasSeenContentBlock) return undefined;
15937
15945
  const content = [];
15938
- historyContentBlocks().forEach(row => {
15946
+ hasSeenContentBlock = true;
15947
+ fromHistory.forEach(row => {
15939
15948
  const contentBlock = {
15940
15949
  span_columns: row.span_columns,
15941
15950
  span_rows: row.span_rows,
package/latest/index.cjs CHANGED
@@ -108,7 +108,7 @@ $parcel$export(module.exports, "QuickLinks", () => $1f4925833f07df29$export$de03
108
108
  $parcel$export(module.exports, "CategoryPage", () => $14f289047713d67a$export$e2bf8ce7779e827e);
109
109
  $parcel$export(module.exports, "makeSizeAccessors", () => $128302ab61dab8f1$export$54c6d6ff54e72743);
110
110
  /*! Depict.ai search and product listing SDK */
111
- const $b757f75811f3261f$export$83d89fbfd8236492 = "4.7.34";
111
+ const $b757f75811f3261f$export$83d89fbfd8236492 = "4.8.0";
112
112
  const $84798aaa863a4909$var$ListingContext = /*@__PURE__*/$gVhhF$solidjs.createContext();
113
113
  function $84798aaa863a4909$export$e68cff63f76bd15b(props) {
114
114
  const our_object = {};
@@ -276,7 +276,7 @@ function $19950faaac026e09$export$6e5611bc7e57e477(props) {
276
276
  img.addEventListener("load", $gVhhF$depictaiutilishared.catchify(() => {
277
277
  const aspectRatio_ = img.naturalWidth / img.naturalHeight;
278
278
  if (srcJustChanged)
279
- // Always key object-fit-cover compensation to avoid loading-different-images-infinite-loop
279
+ // Always key object-fit-cover compensation to one src, to avoid loading-different-images-infinite-loop
280
280
  setOurRatioKeyed(aspectRatio_);else if (props.keyRatioUpdating) return;
281
281
  srcJustChanged = false;
282
282
  // Save our aspect ratio whenever it changes, so that we can base the containers on the most dominant aspect ratio, used in SearchModalV2 and LookItem
@@ -11444,8 +11444,15 @@ function $fe76fb463cc60b89$export$3925f87b1545cfc6({
11444
11444
  for_id: for_id
11445
11445
  }) => for_id === id_currently_querying_for_())?.min_results_loaded ?? min_products_to_fetch_);
11446
11446
  });
11447
- const doesnt_have_content_blocks = $gVhhF$solidjs.createMemo(() => !content_blocks_by_row_());
11448
- const content_blocks_ = $gVhhF$solidjs.createMemo(() => doesnt_have_content_blocks() ? () => [] : $d92f338ba8f9da9b$export$791ef57e62e21c3f({
11447
+ const layout = $gVhhF$solidjs.createMemo(() => {
11448
+ const incoming_layout = layout_options_().layout;
11449
+ if (incoming_layout === "slider-without-filters") return "slider";
11450
+ return incoming_layout || "grid";
11451
+ });
11452
+ const doesnt_have_content_blocks = $gVhhF$solidjs.createMemo(() => !content_blocks_by_row_() || layout() !== "grid");
11453
+ const content_blocks_ = $gVhhF$solidjs.createMemo(() => doesnt_have_content_blocks() ?
11454
+ // This bailing here is to not use proxy/stores and retain old browser compatibility when no content blocks are present
11455
+ () => [] : $d92f338ba8f9da9b$export$791ef57e62e21c3f({
11449
11456
  content_blocks_: content_blocks_by_row_,
11450
11457
  cols_at_size_: modified_cols_at_size,
11451
11458
  set_top_row_shortened_by_: set_top_row_shortened_by_
@@ -11457,11 +11464,6 @@ function $fe76fb463cc60b89$export$3925f87b1545cfc6({
11457
11464
  num_placeholders_: num_placeholders_
11458
11465
  });
11459
11466
  });
11460
- const layout = $gVhhF$solidjs.createMemo(() => {
11461
- const incoming_layout = layout_options_().layout;
11462
- if (incoming_layout === "slider-without-filters") return "slider";
11463
- return incoming_layout || "grid";
11464
- });
11465
11467
  const [get_suspense_is_blocked, set_suspense_is_blocked] = $gVhhF$solidjs.createSignal(false);
11466
11468
  const block_suspense_if_needed = () => {
11467
11469
  if (!is_just_after_plp_results_update) return;
@@ -11484,7 +11486,6 @@ function $fe76fb463cc60b89$export$3925f87b1545cfc6({
11484
11486
  }, {
11485
11487
  defer: true
11486
11488
  }));
11487
- $gVhhF$solidjs.createEffect(() => layout() !== "grid" && !doesnt_have_content_blocks() && $gVhhF$depictaiutilishared.dwarn("Slider layout doesn't support content blocks"));
11488
11489
  /*
11489
11490
  This suspense ensures that if someone has async templates, we still show placeholders until the product cards actually have finished rendering (automagically since they're createResource's)
11490
11491
  We're creating it outside the <Show> so that we can benefit from <For>'s optimisation between changing results
@@ -14981,15 +14982,23 @@ function $32c662f618f5d80d$export$780a853d15174484({
14981
14982
  }
14982
14983
  $gVhhF$solidjsweb.delegateEvents(["click"]);
14983
14984
  function $0a80939bf0a1e9cc$export$7a92d995f1bf3592(history_content_blocks_, plp_meta, content_blocks_by_row_, router_) {
14985
+ let hasSeenContentBlock = false;
14984
14986
  const [historyContentBlocks, setHistoryContentBlocks] = history_content_blocks_;
14985
14987
  $gVhhF$solidjs.createEffect(() => {
14986
14988
  const serverContentBlock = plp_meta()?.content_blocks;
14987
14989
  if (serverContentBlock && JSON.stringify(serverContentBlock) !== JSON.stringify(historyContentBlocks())) setHistoryContentBlocks(serverContentBlock);
14988
14990
  });
14989
14991
  const contentBlocksByRow = $gVhhF$solidjs.createMemo(() => {
14990
- if (content_blocks_by_row_()) return content_blocks_by_row_();
14992
+ const developerProvided = content_blocks_by_row_();
14993
+ const fromHistory = historyContentBlocks();
14994
+ if (developerProvided) return developerProvided;
14995
+ // If we didn't get any content blocks (backend always return empty array) and we haven't seen any content blocks yet, return undefined
14996
+ // This is so the result rendering (PLPResults) will still use flexbox provided rendering on existing customers, so adding this isn't a breaking change
14997
+ // We don't want to switch rendering method every time one switches between a collection that hasn't vs has content blocks though, so once we've seen one content block we'll switch to css-grid-based rendering
14998
+ if (!fromHistory?.length && !hasSeenContentBlock) return undefined;
14991
14999
  const content = [];
14992
- historyContentBlocks().forEach(row => {
15000
+ hasSeenContentBlock = true;
15001
+ fromHistory.forEach(row => {
14993
15002
  const contentBlock = {
14994
15003
  span_columns: row.span_columns,
14995
15004
  span_rows: row.span_rows,
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.7.34";
14
+ export const version = "4.8.0";
15
15
  /**
16
16
  * Provider to wrap every listing (group of products) in
17
17
  * Used for example for deduplicating ResizeObservers for responsive images
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.7.34";
10
+ const $ec291e0010116877$export$83d89fbfd8236492 = "4.8.0";
11
11
  const $011607bdf658f807$var$ListingContext = /*@__PURE__*/$9HbP8$createContext();
12
12
  function $011607bdf658f807$export$e68cff63f76bd15b(props) {
13
13
  const our_object = {};
@@ -175,7 +175,7 @@ function $e8ffe11ed01df0fe$export$6e5611bc7e57e477(props) {
175
175
  img.addEventListener("load", $9HbP8$catchify(() => {
176
176
  const aspectRatio_ = img.naturalWidth / img.naturalHeight;
177
177
  if (srcJustChanged)
178
- // Always key object-fit-cover compensation to avoid loading-different-images-infinite-loop
178
+ // Always key object-fit-cover compensation to one src, to avoid loading-different-images-infinite-loop
179
179
  setOurRatioKeyed(aspectRatio_);else if (props.keyRatioUpdating) return;
180
180
  srcJustChanged = false;
181
181
  // Save our aspect ratio whenever it changes, so that we can base the containers on the most dominant aspect ratio, used in SearchModalV2 and LookItem
@@ -11343,8 +11343,15 @@ function $2d25e42846eac370$export$3925f87b1545cfc6({
11343
11343
  for_id: for_id
11344
11344
  }) => for_id === id_currently_querying_for_())?.min_results_loaded ?? min_products_to_fetch_);
11345
11345
  });
11346
- const doesnt_have_content_blocks = $9HbP8$createMemo(() => !content_blocks_by_row_());
11347
- const content_blocks_ = $9HbP8$createMemo(() => doesnt_have_content_blocks() ? () => [] : $e7a7eb102ddc0c79$export$791ef57e62e21c3f({
11346
+ const layout = $9HbP8$createMemo(() => {
11347
+ const incoming_layout = layout_options_().layout;
11348
+ if (incoming_layout === "slider-without-filters") return "slider";
11349
+ return incoming_layout || "grid";
11350
+ });
11351
+ const doesnt_have_content_blocks = $9HbP8$createMemo(() => !content_blocks_by_row_() || layout() !== "grid");
11352
+ const content_blocks_ = $9HbP8$createMemo(() => doesnt_have_content_blocks() ?
11353
+ // This bailing here is to not use proxy/stores and retain old browser compatibility when no content blocks are present
11354
+ () => [] : $e7a7eb102ddc0c79$export$791ef57e62e21c3f({
11348
11355
  content_blocks_: content_blocks_by_row_,
11349
11356
  cols_at_size_: modified_cols_at_size,
11350
11357
  set_top_row_shortened_by_: set_top_row_shortened_by_
@@ -11356,11 +11363,6 @@ function $2d25e42846eac370$export$3925f87b1545cfc6({
11356
11363
  num_placeholders_: num_placeholders_
11357
11364
  });
11358
11365
  });
11359
- const layout = $9HbP8$createMemo(() => {
11360
- const incoming_layout = layout_options_().layout;
11361
- if (incoming_layout === "slider-without-filters") return "slider";
11362
- return incoming_layout || "grid";
11363
- });
11364
11366
  const [get_suspense_is_blocked, set_suspense_is_blocked] = $9HbP8$createSignal(false);
11365
11367
  const block_suspense_if_needed = () => {
11366
11368
  if (!is_just_after_plp_results_update) return;
@@ -11383,7 +11385,6 @@ function $2d25e42846eac370$export$3925f87b1545cfc6({
11383
11385
  }, {
11384
11386
  defer: true
11385
11387
  }));
11386
- $9HbP8$createEffect(() => layout() !== "grid" && !doesnt_have_content_blocks() && $9HbP8$dwarn("Slider layout doesn't support content blocks"));
11387
11388
  /*
11388
11389
  This suspense ensures that if someone has async templates, we still show placeholders until the product cards actually have finished rendering (automagically since they're createResource's)
11389
11390
  We're creating it outside the <Show> so that we can benefit from <For>'s optimisation between changing results
@@ -14880,15 +14881,23 @@ function $f916989c4b1be9f7$export$780a853d15174484({
14880
14881
  }
14881
14882
  $9HbP8$delegateEvents(["click"]);
14882
14883
  function $486360b09f0d5729$export$7a92d995f1bf3592(history_content_blocks_, plp_meta, content_blocks_by_row_, router_) {
14884
+ let hasSeenContentBlock = false;
14883
14885
  const [historyContentBlocks, setHistoryContentBlocks] = history_content_blocks_;
14884
14886
  $9HbP8$createEffect(() => {
14885
14887
  const serverContentBlock = plp_meta()?.content_blocks;
14886
14888
  if (serverContentBlock && JSON.stringify(serverContentBlock) !== JSON.stringify(historyContentBlocks())) setHistoryContentBlocks(serverContentBlock);
14887
14889
  });
14888
14890
  const contentBlocksByRow = $9HbP8$createMemo(() => {
14889
- if (content_blocks_by_row_()) return content_blocks_by_row_();
14891
+ const developerProvided = content_blocks_by_row_();
14892
+ const fromHistory = historyContentBlocks();
14893
+ if (developerProvided) return developerProvided;
14894
+ // If we didn't get any content blocks (backend always return empty array) and we haven't seen any content blocks yet, return undefined
14895
+ // This is so the result rendering (PLPResults) will still use flexbox provided rendering on existing customers, so adding this isn't a breaking change
14896
+ // We don't want to switch rendering method every time one switches between a collection that hasn't vs has content blocks though, so once we've seen one content block we'll switch to css-grid-based rendering
14897
+ if (!fromHistory?.length && !hasSeenContentBlock) return undefined;
14890
14898
  const content = [];
14891
- historyContentBlocks().forEach(row => {
14899
+ hasSeenContentBlock = true;
14900
+ fromHistory.forEach(row => {
14892
14901
  const contentBlock = {
14893
14902
  span_columns: row.span_columns,
14894
14903
  span_rows: row.span_rows,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@depict-ai/ui",
3
- "version": "4.7.34",
3
+ "version": "4.8.0",
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",
@@ -236,7 +236,7 @@
236
236
  "@babel/plugin-transform-typescript": "^7.22.9",
237
237
  "@babel/runtime": "latest",
238
238
  "@babel/runtime-corejs3": "^7.22.6",
239
- "@depict-ai/plp-styling": "^4.4.8",
239
+ "@depict-ai/plp-styling": "^4.4.9",
240
240
  "@depict-ai/types": "^5.4.2",
241
241
  "@depict-ai/utilishared": "^2.4.4",
242
242
  "solid-js": "^1.8.12"
@@ -114,7 +114,7 @@ $parcel$export(module.exports, "QuickLinks", () => $335c02c1241a9ca8$export$de03
114
114
  $parcel$export(module.exports, "CategoryPage", () => $c10e33c4681f8c9b$export$e2bf8ce7779e827e);
115
115
  $parcel$export(module.exports, "makeSizeAccessors", () => $054b1113e4897051$export$54c6d6ff54e72743);
116
116
  /*! Depict.ai search and product listing SDK */
117
- const $aa1938dec50d6c12$export$83d89fbfd8236492 = "4.7.34";
117
+ const $aa1938dec50d6c12$export$83d89fbfd8236492 = "4.8.0";
118
118
  const $d067f3a30f047b41$var$ListingContext = /*@__PURE__*/$3hooq$solidjs.createContext();
119
119
  function $d067f3a30f047b41$export$e68cff63f76bd15b(props) {
120
120
  const our_object = {};
@@ -270,7 +270,7 @@ function $858fdcf73148519f$export$6e5611bc7e57e477(props) {
270
270
  img.addEventListener("load", $3hooq$depictaiutilishared.catchify(() => {
271
271
  const aspectRatio_ = img.naturalWidth / img.naturalHeight;
272
272
  if (srcJustChanged)
273
- // Always key object-fit-cover compensation to avoid loading-different-images-infinite-loop
273
+ // Always key object-fit-cover compensation to one src, to avoid loading-different-images-infinite-loop
274
274
  setOurRatioKeyed(aspectRatio_);else if (props.keyRatioUpdating) return;
275
275
  srcJustChanged = false;
276
276
  // Save our aspect ratio whenever it changes, so that we can base the containers on the most dominant aspect ratio, used in SearchModalV2 and LookItem
@@ -10145,8 +10145,15 @@ function $484eec37514a982e$export$3925f87b1545cfc6(_ref) {
10145
10145
  return for_id === id_currently_querying_for_();
10146
10146
  })) === null || _get_scroll_restorati2 === void 0 ? void 0 : _get_scroll_restorati2.min_results_loaded) !== null && _get_scroll_restorati !== void 0 ? _get_scroll_restorati : min_products_to_fetch_);
10147
10147
  });
10148
- const doesnt_have_content_blocks = $3hooq$solidjs.createMemo(() => !content_blocks_by_row_());
10149
- const content_blocks_ = $3hooq$solidjs.createMemo(() => doesnt_have_content_blocks() ? () => [] : $f8f375d6245ffff2$export$791ef57e62e21c3f({
10148
+ const layout = $3hooq$solidjs.createMemo(() => {
10149
+ const incoming_layout = layout_options_().layout;
10150
+ if (incoming_layout === "slider-without-filters") return "slider";
10151
+ return incoming_layout || "grid";
10152
+ });
10153
+ const doesnt_have_content_blocks = $3hooq$solidjs.createMemo(() => !content_blocks_by_row_() || layout() !== "grid");
10154
+ const content_blocks_ = $3hooq$solidjs.createMemo(() => doesnt_have_content_blocks() ?
10155
+ // This bailing here is to not use proxy/stores and retain old browser compatibility when no content blocks are present
10156
+ () => [] : $f8f375d6245ffff2$export$791ef57e62e21c3f({
10150
10157
  content_blocks_: content_blocks_by_row_,
10151
10158
  cols_at_size_: modified_cols_at_size,
10152
10159
  set_top_row_shortened_by_: set_top_row_shortened_by_
@@ -10158,11 +10165,6 @@ function $484eec37514a982e$export$3925f87b1545cfc6(_ref) {
10158
10165
  num_placeholders_: num_placeholders_
10159
10166
  });
10160
10167
  });
10161
- const layout = $3hooq$solidjs.createMemo(() => {
10162
- const incoming_layout = layout_options_().layout;
10163
- if (incoming_layout === "slider-without-filters") return "slider";
10164
- return incoming_layout || "grid";
10165
- });
10166
10168
  const [get_suspense_is_blocked, set_suspense_is_blocked] = $3hooq$solidjs.createSignal(false);
10167
10169
  const block_suspense_if_needed = () => {
10168
10170
  if (!is_just_after_plp_results_update) return;
@@ -10185,7 +10187,6 @@ function $484eec37514a982e$export$3925f87b1545cfc6(_ref) {
10185
10187
  }, {
10186
10188
  defer: true
10187
10189
  }));
10188
- $3hooq$solidjs.createEffect(() => layout() !== "grid" && !doesnt_have_content_blocks() && $3hooq$depictaiutilishared.dwarn("Slider layout doesn't support content blocks"));
10189
10190
  /*
10190
10191
  This suspense ensures that if someone has async templates, we still show placeholders until the product cards actually have finished rendering (automagically since they're createResource's)
10191
10192
  We're creating it outside the <Show> so that we can benefit from <For>'s optimisation between changing results
@@ -13377,6 +13378,7 @@ function $c19709057a32b2e7$export$780a853d15174484(_ref) {
13377
13378
  }
13378
13379
  }
13379
13380
  function $0c035bbe7e30b438$export$7a92d995f1bf3592(history_content_blocks_, plp_meta, content_blocks_by_row_, router_) {
13381
+ let hasSeenContentBlock = false;
13380
13382
  const [historyContentBlocks, setHistoryContentBlocks] = history_content_blocks_;
13381
13383
  $3hooq$solidjs.createEffect(() => {
13382
13384
  var _plp_meta;
@@ -13384,9 +13386,16 @@ function $0c035bbe7e30b438$export$7a92d995f1bf3592(history_content_blocks_, plp_
13384
13386
  if (serverContentBlock && JSON.stringify(serverContentBlock) !== JSON.stringify(historyContentBlocks())) setHistoryContentBlocks(serverContentBlock);
13385
13387
  });
13386
13388
  const contentBlocksByRow = $3hooq$solidjs.createMemo(() => {
13387
- if (content_blocks_by_row_()) return content_blocks_by_row_();
13389
+ const developerProvided = content_blocks_by_row_();
13390
+ const fromHistory = historyContentBlocks();
13391
+ if (developerProvided) return developerProvided;
13392
+ // If we didn't get any content blocks (backend always return empty array) and we haven't seen any content blocks yet, return undefined
13393
+ // This is so the result rendering (PLPResults) will still use flexbox provided rendering on existing customers, so adding this isn't a breaking change
13394
+ // We don't want to switch rendering method every time one switches between a collection that hasn't vs has content blocks though, so once we've seen one content block we'll switch to css-grid-based rendering
13395
+ if (!(fromHistory !== null && fromHistory !== void 0 && fromHistory.length) && !hasSeenContentBlock) return undefined;
13388
13396
  const content = [];
13389
- historyContentBlocks().forEach(row => {
13397
+ hasSeenContentBlock = true;
13398
+ fromHistory.forEach(row => {
13390
13399
  const contentBlock = {
13391
13400
  span_columns: row.span_columns,
13392
13401
  span_rows: row.span_rows,
@@ -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.7.34";
14
+ export const version = "4.8.0";
15
15
  /**
16
16
  * Provider to wrap every listing (group of products) in
17
17
  * Used for example for deduplicating ResizeObservers for responsive images
@@ -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.7.34";
13
+ const $8db9a15135765c11$export$83d89fbfd8236492 = "4.8.0";
14
14
  const $5441862cd2f5e111$var$ListingContext = /*@__PURE__*/$b8hua$createContext();
15
15
  function $5441862cd2f5e111$export$e68cff63f76bd15b(props) {
16
16
  const our_object = {};
@@ -166,7 +166,7 @@ function $56047603f9d212b6$export$6e5611bc7e57e477(props) {
166
166
  img.addEventListener("load", $b8hua$catchify(() => {
167
167
  const aspectRatio_ = img.naturalWidth / img.naturalHeight;
168
168
  if (srcJustChanged)
169
- // Always key object-fit-cover compensation to avoid loading-different-images-infinite-loop
169
+ // Always key object-fit-cover compensation to one src, to avoid loading-different-images-infinite-loop
170
170
  setOurRatioKeyed(aspectRatio_);else if (props.keyRatioUpdating) return;
171
171
  srcJustChanged = false;
172
172
  // Save our aspect ratio whenever it changes, so that we can base the containers on the most dominant aspect ratio, used in SearchModalV2 and LookItem
@@ -10041,8 +10041,15 @@ function $7faea0096f14b59b$export$3925f87b1545cfc6(_ref) {
10041
10041
  return for_id === id_currently_querying_for_();
10042
10042
  })) === null || _get_scroll_restorati2 === void 0 ? void 0 : _get_scroll_restorati2.min_results_loaded) !== null && _get_scroll_restorati !== void 0 ? _get_scroll_restorati : min_products_to_fetch_);
10043
10043
  });
10044
- const doesnt_have_content_blocks = $b8hua$createMemo(() => !content_blocks_by_row_());
10045
- const content_blocks_ = $b8hua$createMemo(() => doesnt_have_content_blocks() ? () => [] : $ff7feae4dddd6073$export$791ef57e62e21c3f({
10044
+ const layout = $b8hua$createMemo(() => {
10045
+ const incoming_layout = layout_options_().layout;
10046
+ if (incoming_layout === "slider-without-filters") return "slider";
10047
+ return incoming_layout || "grid";
10048
+ });
10049
+ const doesnt_have_content_blocks = $b8hua$createMemo(() => !content_blocks_by_row_() || layout() !== "grid");
10050
+ const content_blocks_ = $b8hua$createMemo(() => doesnt_have_content_blocks() ?
10051
+ // This bailing here is to not use proxy/stores and retain old browser compatibility when no content blocks are present
10052
+ () => [] : $ff7feae4dddd6073$export$791ef57e62e21c3f({
10046
10053
  content_blocks_: content_blocks_by_row_,
10047
10054
  cols_at_size_: modified_cols_at_size,
10048
10055
  set_top_row_shortened_by_: set_top_row_shortened_by_
@@ -10054,11 +10061,6 @@ function $7faea0096f14b59b$export$3925f87b1545cfc6(_ref) {
10054
10061
  num_placeholders_: num_placeholders_
10055
10062
  });
10056
10063
  });
10057
- const layout = $b8hua$createMemo(() => {
10058
- const incoming_layout = layout_options_().layout;
10059
- if (incoming_layout === "slider-without-filters") return "slider";
10060
- return incoming_layout || "grid";
10061
- });
10062
10064
  const [get_suspense_is_blocked, set_suspense_is_blocked] = $b8hua$createSignal(false);
10063
10065
  const block_suspense_if_needed = () => {
10064
10066
  if (!is_just_after_plp_results_update) return;
@@ -10081,7 +10083,6 @@ function $7faea0096f14b59b$export$3925f87b1545cfc6(_ref) {
10081
10083
  }, {
10082
10084
  defer: true
10083
10085
  }));
10084
- $b8hua$createEffect(() => layout() !== "grid" && !doesnt_have_content_blocks() && $b8hua$dwarn("Slider layout doesn't support content blocks"));
10085
10086
  /*
10086
10087
  This suspense ensures that if someone has async templates, we still show placeholders until the product cards actually have finished rendering (automagically since they're createResource's)
10087
10088
  We're creating it outside the <Show> so that we can benefit from <For>'s optimisation between changing results
@@ -13273,6 +13274,7 @@ function $3b772ef9a35560fe$export$780a853d15174484(_ref) {
13273
13274
  }
13274
13275
  }
13275
13276
  function $12ff24fdc4b26d88$export$7a92d995f1bf3592(history_content_blocks_, plp_meta, content_blocks_by_row_, router_) {
13277
+ let hasSeenContentBlock = false;
13276
13278
  const [historyContentBlocks, setHistoryContentBlocks] = history_content_blocks_;
13277
13279
  $b8hua$createEffect(() => {
13278
13280
  var _plp_meta;
@@ -13280,9 +13282,16 @@ function $12ff24fdc4b26d88$export$7a92d995f1bf3592(history_content_blocks_, plp_
13280
13282
  if (serverContentBlock && JSON.stringify(serverContentBlock) !== JSON.stringify(historyContentBlocks())) setHistoryContentBlocks(serverContentBlock);
13281
13283
  });
13282
13284
  const contentBlocksByRow = $b8hua$createMemo(() => {
13283
- if (content_blocks_by_row_()) return content_blocks_by_row_();
13285
+ const developerProvided = content_blocks_by_row_();
13286
+ const fromHistory = historyContentBlocks();
13287
+ if (developerProvided) return developerProvided;
13288
+ // If we didn't get any content blocks (backend always return empty array) and we haven't seen any content blocks yet, return undefined
13289
+ // This is so the result rendering (PLPResults) will still use flexbox provided rendering on existing customers, so adding this isn't a breaking change
13290
+ // We don't want to switch rendering method every time one switches between a collection that hasn't vs has content blocks though, so once we've seen one content block we'll switch to css-grid-based rendering
13291
+ if (!(fromHistory !== null && fromHistory !== void 0 && fromHistory.length) && !hasSeenContentBlock) return undefined;
13284
13292
  const content = [];
13285
- historyContentBlocks().forEach(row => {
13293
+ hasSeenContentBlock = true;
13294
+ fromHistory.forEach(row => {
13286
13295
  const contentBlock = {
13287
13296
  span_columns: row.span_columns,
13288
13297
  span_rows: row.span_rows,
@@ -108,7 +108,7 @@ $parcel$export(module.exports, "QuickLinks", () => $1f4925833f07df29$export$de03
108
108
  $parcel$export(module.exports, "CategoryPage", () => $14f289047713d67a$export$e2bf8ce7779e827e);
109
109
  $parcel$export(module.exports, "makeSizeAccessors", () => $128302ab61dab8f1$export$54c6d6ff54e72743);
110
110
  /*! Depict.ai search and product listing SDK */
111
- const $b757f75811f3261f$export$83d89fbfd8236492 = "4.7.34";
111
+ const $b757f75811f3261f$export$83d89fbfd8236492 = "4.8.0";
112
112
  const $84798aaa863a4909$var$ListingContext = /*@__PURE__*/$5vyXB$solidjs.createContext();
113
113
  function $84798aaa863a4909$export$e68cff63f76bd15b(props) {
114
114
  const our_object = {};
@@ -262,7 +262,7 @@ function $19950faaac026e09$export$6e5611bc7e57e477(props) {
262
262
  img.addEventListener("load", $5vyXB$depictaiutilishared.catchify(() => {
263
263
  const aspectRatio_ = img.naturalWidth / img.naturalHeight;
264
264
  if (srcJustChanged)
265
- // Always key object-fit-cover compensation to avoid loading-different-images-infinite-loop
265
+ // Always key object-fit-cover compensation to one src, to avoid loading-different-images-infinite-loop
266
266
  setOurRatioKeyed(aspectRatio_);else if (props.keyRatioUpdating) return;
267
267
  srcJustChanged = false;
268
268
  // Save our aspect ratio whenever it changes, so that we can base the containers on the most dominant aspect ratio, used in SearchModalV2 and LookItem
@@ -9490,8 +9490,15 @@ function $fe76fb463cc60b89$export$3925f87b1545cfc6({
9490
9490
  for_id: for_id
9491
9491
  }) => for_id === id_currently_querying_for_())?.min_results_loaded ?? min_products_to_fetch_);
9492
9492
  });
9493
- const doesnt_have_content_blocks = $5vyXB$solidjs.createMemo(() => !content_blocks_by_row_());
9494
- const content_blocks_ = $5vyXB$solidjs.createMemo(() => doesnt_have_content_blocks() ? () => [] : $d92f338ba8f9da9b$export$791ef57e62e21c3f({
9493
+ const layout = $5vyXB$solidjs.createMemo(() => {
9494
+ const incoming_layout = layout_options_().layout;
9495
+ if (incoming_layout === "slider-without-filters") return "slider";
9496
+ return incoming_layout || "grid";
9497
+ });
9498
+ const doesnt_have_content_blocks = $5vyXB$solidjs.createMemo(() => !content_blocks_by_row_() || layout() !== "grid");
9499
+ const content_blocks_ = $5vyXB$solidjs.createMemo(() => doesnt_have_content_blocks() ?
9500
+ // This bailing here is to not use proxy/stores and retain old browser compatibility when no content blocks are present
9501
+ () => [] : $d92f338ba8f9da9b$export$791ef57e62e21c3f({
9495
9502
  content_blocks_: content_blocks_by_row_,
9496
9503
  cols_at_size_: modified_cols_at_size,
9497
9504
  set_top_row_shortened_by_: set_top_row_shortened_by_
@@ -9503,11 +9510,6 @@ function $fe76fb463cc60b89$export$3925f87b1545cfc6({
9503
9510
  num_placeholders_: num_placeholders_
9504
9511
  });
9505
9512
  });
9506
- const layout = $5vyXB$solidjs.createMemo(() => {
9507
- const incoming_layout = layout_options_().layout;
9508
- if (incoming_layout === "slider-without-filters") return "slider";
9509
- return incoming_layout || "grid";
9510
- });
9511
9513
  const [get_suspense_is_blocked, set_suspense_is_blocked] = $5vyXB$solidjs.createSignal(false);
9512
9514
  const block_suspense_if_needed = () => {
9513
9515
  if (!is_just_after_plp_results_update) return;
@@ -9530,7 +9532,6 @@ function $fe76fb463cc60b89$export$3925f87b1545cfc6({
9530
9532
  }, {
9531
9533
  defer: true
9532
9534
  }));
9533
- $5vyXB$solidjs.createEffect(() => layout() !== "grid" && !doesnt_have_content_blocks() && $5vyXB$depictaiutilishared.dwarn("Slider layout doesn't support content blocks"));
9534
9535
  /*
9535
9536
  This suspense ensures that if someone has async templates, we still show placeholders until the product cards actually have finished rendering (automagically since they're createResource's)
9536
9537
  We're creating it outside the <Show> so that we can benefit from <For>'s optimisation between changing results
@@ -12404,15 +12405,23 @@ function $32c662f618f5d80d$export$780a853d15174484({
12404
12405
  }
12405
12406
  }
12406
12407
  function $0a80939bf0a1e9cc$export$7a92d995f1bf3592(history_content_blocks_, plp_meta, content_blocks_by_row_, router_) {
12408
+ let hasSeenContentBlock = false;
12407
12409
  const [historyContentBlocks, setHistoryContentBlocks] = history_content_blocks_;
12408
12410
  $5vyXB$solidjs.createEffect(() => {
12409
12411
  const serverContentBlock = plp_meta()?.content_blocks;
12410
12412
  if (serverContentBlock && JSON.stringify(serverContentBlock) !== JSON.stringify(historyContentBlocks())) setHistoryContentBlocks(serverContentBlock);
12411
12413
  });
12412
12414
  const contentBlocksByRow = $5vyXB$solidjs.createMemo(() => {
12413
- if (content_blocks_by_row_()) return content_blocks_by_row_();
12415
+ const developerProvided = content_blocks_by_row_();
12416
+ const fromHistory = historyContentBlocks();
12417
+ if (developerProvided) return developerProvided;
12418
+ // If we didn't get any content blocks (backend always return empty array) and we haven't seen any content blocks yet, return undefined
12419
+ // This is so the result rendering (PLPResults) will still use flexbox provided rendering on existing customers, so adding this isn't a breaking change
12420
+ // We don't want to switch rendering method every time one switches between a collection that hasn't vs has content blocks though, so once we've seen one content block we'll switch to css-grid-based rendering
12421
+ if (!fromHistory?.length && !hasSeenContentBlock) return undefined;
12414
12422
  const content = [];
12415
- historyContentBlocks().forEach(row => {
12423
+ hasSeenContentBlock = true;
12424
+ fromHistory.forEach(row => {
12416
12425
  const contentBlock = {
12417
12426
  span_columns: row.span_columns,
12418
12427
  span_rows: row.span_rows,
@@ -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.7.34";
14
+ export const version = "4.8.0";
15
15
  /**
16
16
  * Provider to wrap every listing (group of products) in
17
17
  * Used for example for deduplicating ResizeObservers for responsive images
@@ -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.7.34";
10
+ const $ec291e0010116877$export$83d89fbfd8236492 = "4.8.0";
11
11
  const $011607bdf658f807$var$ListingContext = /*@__PURE__*/$i7OB2$createContext();
12
12
  function $011607bdf658f807$export$e68cff63f76bd15b(props) {
13
13
  const our_object = {};
@@ -161,7 +161,7 @@ function $e8ffe11ed01df0fe$export$6e5611bc7e57e477(props) {
161
161
  img.addEventListener("load", $i7OB2$catchify(() => {
162
162
  const aspectRatio_ = img.naturalWidth / img.naturalHeight;
163
163
  if (srcJustChanged)
164
- // Always key object-fit-cover compensation to avoid loading-different-images-infinite-loop
164
+ // Always key object-fit-cover compensation to one src, to avoid loading-different-images-infinite-loop
165
165
  setOurRatioKeyed(aspectRatio_);else if (props.keyRatioUpdating) return;
166
166
  srcJustChanged = false;
167
167
  // Save our aspect ratio whenever it changes, so that we can base the containers on the most dominant aspect ratio, used in SearchModalV2 and LookItem
@@ -9389,8 +9389,15 @@ function $2d25e42846eac370$export$3925f87b1545cfc6({
9389
9389
  for_id: for_id
9390
9390
  }) => for_id === id_currently_querying_for_())?.min_results_loaded ?? min_products_to_fetch_);
9391
9391
  });
9392
- const doesnt_have_content_blocks = $i7OB2$createMemo(() => !content_blocks_by_row_());
9393
- const content_blocks_ = $i7OB2$createMemo(() => doesnt_have_content_blocks() ? () => [] : $e7a7eb102ddc0c79$export$791ef57e62e21c3f({
9392
+ const layout = $i7OB2$createMemo(() => {
9393
+ const incoming_layout = layout_options_().layout;
9394
+ if (incoming_layout === "slider-without-filters") return "slider";
9395
+ return incoming_layout || "grid";
9396
+ });
9397
+ const doesnt_have_content_blocks = $i7OB2$createMemo(() => !content_blocks_by_row_() || layout() !== "grid");
9398
+ const content_blocks_ = $i7OB2$createMemo(() => doesnt_have_content_blocks() ?
9399
+ // This bailing here is to not use proxy/stores and retain old browser compatibility when no content blocks are present
9400
+ () => [] : $e7a7eb102ddc0c79$export$791ef57e62e21c3f({
9394
9401
  content_blocks_: content_blocks_by_row_,
9395
9402
  cols_at_size_: modified_cols_at_size,
9396
9403
  set_top_row_shortened_by_: set_top_row_shortened_by_
@@ -9402,11 +9409,6 @@ function $2d25e42846eac370$export$3925f87b1545cfc6({
9402
9409
  num_placeholders_: num_placeholders_
9403
9410
  });
9404
9411
  });
9405
- const layout = $i7OB2$createMemo(() => {
9406
- const incoming_layout = layout_options_().layout;
9407
- if (incoming_layout === "slider-without-filters") return "slider";
9408
- return incoming_layout || "grid";
9409
- });
9410
9412
  const [get_suspense_is_blocked, set_suspense_is_blocked] = $i7OB2$createSignal(false);
9411
9413
  const block_suspense_if_needed = () => {
9412
9414
  if (!is_just_after_plp_results_update) return;
@@ -9429,7 +9431,6 @@ function $2d25e42846eac370$export$3925f87b1545cfc6({
9429
9431
  }, {
9430
9432
  defer: true
9431
9433
  }));
9432
- $i7OB2$createEffect(() => layout() !== "grid" && !doesnt_have_content_blocks() && $i7OB2$dwarn("Slider layout doesn't support content blocks"));
9433
9434
  /*
9434
9435
  This suspense ensures that if someone has async templates, we still show placeholders until the product cards actually have finished rendering (automagically since they're createResource's)
9435
9436
  We're creating it outside the <Show> so that we can benefit from <For>'s optimisation between changing results
@@ -12303,15 +12304,23 @@ function $f916989c4b1be9f7$export$780a853d15174484({
12303
12304
  }
12304
12305
  }
12305
12306
  function $486360b09f0d5729$export$7a92d995f1bf3592(history_content_blocks_, plp_meta, content_blocks_by_row_, router_) {
12307
+ let hasSeenContentBlock = false;
12306
12308
  const [historyContentBlocks, setHistoryContentBlocks] = history_content_blocks_;
12307
12309
  $i7OB2$createEffect(() => {
12308
12310
  const serverContentBlock = plp_meta()?.content_blocks;
12309
12311
  if (serverContentBlock && JSON.stringify(serverContentBlock) !== JSON.stringify(historyContentBlocks())) setHistoryContentBlocks(serverContentBlock);
12310
12312
  });
12311
12313
  const contentBlocksByRow = $i7OB2$createMemo(() => {
12312
- if (content_blocks_by_row_()) return content_blocks_by_row_();
12314
+ const developerProvided = content_blocks_by_row_();
12315
+ const fromHistory = historyContentBlocks();
12316
+ if (developerProvided) return developerProvided;
12317
+ // If we didn't get any content blocks (backend always return empty array) and we haven't seen any content blocks yet, return undefined
12318
+ // This is so the result rendering (PLPResults) will still use flexbox provided rendering on existing customers, so adding this isn't a breaking change
12319
+ // We don't want to switch rendering method every time one switches between a collection that hasn't vs has content blocks though, so once we've seen one content block we'll switch to css-grid-based rendering
12320
+ if (!fromHistory?.length && !hasSeenContentBlock) return undefined;
12313
12321
  const content = [];
12314
- historyContentBlocks().forEach(row => {
12322
+ hasSeenContentBlock = true;
12323
+ fromHistory.forEach(row => {
12315
12324
  const contentBlock = {
12316
12325
  span_columns: row.span_columns,
12317
12326
  span_rows: row.span_rows,