@depict-ai/ui 4.7.35 → 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.35";
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 = {};
@@ -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;
@@ -16039,9 +16041,13 @@ function $0c035bbe7e30b438$export$7a92d995f1bf3592(history_content_blocks_, plp_
16039
16041
  const contentBlocksByRow = $52FdA$solidjs.createMemo(() => {
16040
16042
  const developerProvided = content_blocks_by_row_();
16041
16043
  const fromHistory = historyContentBlocks();
16042
- // If none come from backend/History, fall back to developer provided/what usually is undefined. layout="slider" and layout="slider-without-filters" is only supported if content blocks is undefined, so if we don't do that those layouts are broken.
16043
- if (developerProvided || !fromHistory.length) return developerProvided;
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;
16044
16049
  const content = [];
16050
+ hasSeenContentBlock = true;
16045
16051
  fromHistory.forEach(row => {
16046
16052
  const contentBlock = {
16047
16053
  span_columns: row.span_columns,
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.35";
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.35";
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 = {};
@@ -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;
@@ -15935,9 +15937,13 @@ function $12ff24fdc4b26d88$export$7a92d995f1bf3592(history_content_blocks_, plp_
15935
15937
  const contentBlocksByRow = $8tj43$createMemo(() => {
15936
15938
  const developerProvided = content_blocks_by_row_();
15937
15939
  const fromHistory = historyContentBlocks();
15938
- // If none come from backend/History, fall back to developer provided/what usually is undefined. layout="slider" and layout="slider-without-filters" is only supported if content blocks is undefined, so if we don't do that those layouts are broken.
15939
- if (developerProvided || !fromHistory.length) return developerProvided;
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;
15940
15945
  const content = [];
15946
+ hasSeenContentBlock = true;
15941
15947
  fromHistory.forEach(row => {
15942
15948
  const contentBlock = {
15943
15949
  span_columns: row.span_columns,
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.35";
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 = {};
@@ -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,6 +14982,7 @@ 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;
@@ -14989,9 +14991,13 @@ function $0a80939bf0a1e9cc$export$7a92d995f1bf3592(history_content_blocks_, plp_
14989
14991
  const contentBlocksByRow = $gVhhF$solidjs.createMemo(() => {
14990
14992
  const developerProvided = content_blocks_by_row_();
14991
14993
  const fromHistory = historyContentBlocks();
14992
- // If none come from backend/History, fall back to developer provided/what usually is undefined. layout="slider" and layout="slider-without-filters" is only supported if content blocks is undefined, so if we don't do that those layouts are broken.
14993
- if (developerProvided || !fromHistory.length) return developerProvided;
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;
14994
14999
  const content = [];
15000
+ hasSeenContentBlock = true;
14995
15001
  fromHistory.forEach(row => {
14996
15002
  const contentBlock = {
14997
15003
  span_columns: row.span_columns,
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.35";
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.35";
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 = {};
@@ -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,6 +14881,7 @@ 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;
@@ -14888,9 +14890,13 @@ function $486360b09f0d5729$export$7a92d995f1bf3592(history_content_blocks_, plp_
14888
14890
  const contentBlocksByRow = $9HbP8$createMemo(() => {
14889
14891
  const developerProvided = content_blocks_by_row_();
14890
14892
  const fromHistory = historyContentBlocks();
14891
- // If none come from backend/History, fall back to developer provided/what usually is undefined. layout="slider" and layout="slider-without-filters" is only supported if content blocks is undefined, so if we don't do that those layouts are broken.
14892
- if (developerProvided || !fromHistory.length) return developerProvided;
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;
14893
14898
  const content = [];
14899
+ hasSeenContentBlock = true;
14894
14900
  fromHistory.forEach(row => {
14895
14901
  const contentBlock = {
14896
14902
  span_columns: row.span_columns,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@depict-ai/ui",
3
- "version": "4.7.35",
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",
@@ -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.35";
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 = {};
@@ -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;
@@ -13386,9 +13388,13 @@ function $0c035bbe7e30b438$export$7a92d995f1bf3592(history_content_blocks_, plp_
13386
13388
  const contentBlocksByRow = $3hooq$solidjs.createMemo(() => {
13387
13389
  const developerProvided = content_blocks_by_row_();
13388
13390
  const fromHistory = historyContentBlocks();
13389
- // If none come from backend/History, fall back to developer provided/what usually is undefined. layout="slider" and layout="slider-without-filters" is only supported if content blocks is undefined, so if we don't do that those layouts are broken.
13390
- if (developerProvided || !fromHistory.length) return developerProvided;
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;
13391
13396
  const content = [];
13397
+ hasSeenContentBlock = true;
13392
13398
  fromHistory.forEach(row => {
13393
13399
  const contentBlock = {
13394
13400
  span_columns: row.span_columns,
@@ -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.35";
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.35";
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 = {};
@@ -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;
@@ -13282,9 +13284,13 @@ function $12ff24fdc4b26d88$export$7a92d995f1bf3592(history_content_blocks_, plp_
13282
13284
  const contentBlocksByRow = $b8hua$createMemo(() => {
13283
13285
  const developerProvided = content_blocks_by_row_();
13284
13286
  const fromHistory = historyContentBlocks();
13285
- // If none come from backend/History, fall back to developer provided/what usually is undefined. layout="slider" and layout="slider-without-filters" is only supported if content blocks is undefined, so if we don't do that those layouts are broken.
13286
- if (developerProvided || !fromHistory.length) return developerProvided;
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;
13287
13292
  const content = [];
13293
+ hasSeenContentBlock = true;
13288
13294
  fromHistory.forEach(row => {
13289
13295
  const contentBlock = {
13290
13296
  span_columns: row.span_columns,
@@ -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.35";
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 = {};
@@ -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,6 +12405,7 @@ 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;
@@ -12412,9 +12414,13 @@ function $0a80939bf0a1e9cc$export$7a92d995f1bf3592(history_content_blocks_, plp_
12412
12414
  const contentBlocksByRow = $5vyXB$solidjs.createMemo(() => {
12413
12415
  const developerProvided = content_blocks_by_row_();
12414
12416
  const fromHistory = historyContentBlocks();
12415
- // If none come from backend/History, fall back to developer provided/what usually is undefined. layout="slider" and layout="slider-without-filters" is only supported if content blocks is undefined, so if we don't do that those layouts are broken.
12416
- if (developerProvided || !fromHistory.length) return developerProvided;
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;
12417
12422
  const content = [];
12423
+ hasSeenContentBlock = true;
12418
12424
  fromHistory.forEach(row => {
12419
12425
  const contentBlock = {
12420
12426
  span_columns: row.span_columns,
@@ -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.35";
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.35";
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 = {};
@@ -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,6 +12304,7 @@ 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;
@@ -12311,9 +12313,13 @@ function $486360b09f0d5729$export$7a92d995f1bf3592(history_content_blocks_, plp_
12311
12313
  const contentBlocksByRow = $i7OB2$createMemo(() => {
12312
12314
  const developerProvided = content_blocks_by_row_();
12313
12315
  const fromHistory = historyContentBlocks();
12314
- // If none come from backend/History, fall back to developer provided/what usually is undefined. layout="slider" and layout="slider-without-filters" is only supported if content blocks is undefined, so if we don't do that those layouts are broken.
12315
- if (developerProvided || !fromHistory.length) return developerProvided;
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;
12316
12321
  const content = [];
12322
+ hasSeenContentBlock = true;
12317
12323
  fromHistory.forEach(row => {
12318
12324
  const contentBlock = {
12319
12325
  span_columns: row.span_columns,