@depict-ai/ui 4.7.30 → 4.7.31

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/latest/index.cjs CHANGED
@@ -105,7 +105,7 @@ $parcel$export(module.exports, "BreadCrumbs", () => $1f4925833f07df29$export$5b7
105
105
  $parcel$export(module.exports, "QuickLinks", () => $1f4925833f07df29$export$de035477d6fef996);
106
106
  $parcel$export(module.exports, "CategoryPage", () => $14f289047713d67a$export$e2bf8ce7779e827e);
107
107
  /*! Depict.ai search and product listing SDK */
108
- const $b757f75811f3261f$export$83d89fbfd8236492 = "4.7.30";
108
+ const $b757f75811f3261f$export$83d89fbfd8236492 = "4.7.31";
109
109
  function $b54e6192d0caa293$export$d9f36cf74e24d595(media_query) {
110
110
  const signal = $gVhhF$solidjs.createSignal(false);
111
111
  $gVhhF$solidjs.onCleanup($gVhhF$depictaiutilishared.javascript_media_query(media_query, ({
@@ -360,20 +360,22 @@ function $d92f338ba8f9da9b$export$791ef57e62e21c3f({
360
360
  return $gVhhF$solidjs.createMemo(() => $d92f338ba8f9da9b$export$92aa5d691d588f3f({
361
361
  wrapped_blocks_: get_wrapped_blocks_(),
362
362
  n_cols_currently_showing_: n_cols_currently_showing_()
363
- }));
363
+ }).content_blocks_by_index_);
364
364
  }
365
365
  function $d92f338ba8f9da9b$export$92aa5d691d588f3f({
366
366
  wrapped_blocks_: wrapped_blocks_,
367
367
  n_cols_currently_showing_: n_cols_currently_showing_
368
368
  }) {
369
369
  // This computation should be quite cheap since it just moves around things into an array
370
- const content_blocks_by_index = [];
370
+ const content_blocks_by_index_ = [];
371
371
  const constructed_block_arrays = new WeakSet();
372
372
  // Need to keep track of products displaced by blocks above when mapping rows to indexes in the actual grid
373
- const displaced_products = []; // undefined = is product, true = is content block if number instead of tuple number indicates content blocks in that row. Index in first array is row, index in second array is column
373
+ const displaced_products_ = []; // undefined = is product, true = is content block if number instead of tuple number indicates content blocks in that row. Index in first array is row, index in second array is column
374
374
  if (!n_cols_currently_showing_)
375
375
  // Nope out of here if we don't know how many columns are showing
376
- return content_blocks_by_index;
376
+ return {
377
+ content_blocks_by_index_: content_blocks_by_index_
378
+ };
377
379
  for (let i = 0; i < wrapped_blocks_.length; i++) {
378
380
  // i = row to show at
379
381
  const block = wrapped_blocks_[i];
@@ -390,22 +392,22 @@ function $d92f338ba8f9da9b$export$92aa5d691d588f3f({
390
392
  // Calculate displacement of us by content blocks above us
391
393
  let displacement_by_added_blocks = 0;
392
394
  for (let j = 0; j < i; j++) {
393
- const row = displaced_products[j];
395
+ const row = displaced_products_[j];
394
396
  if (row === undefined) continue; // there were no blocks in this row
395
397
  let displaced_items_in_row;
396
398
  if (typeof row === "number") displaced_items_in_row = row;else {
397
399
  displaced_items_in_row = row.filter(item => item).length;
398
- displaced_products[j] = displaced_items_in_row;
400
+ displaced_products_[j] = displaced_items_in_row;
399
401
  }
400
402
  displacement_by_added_blocks += displaced_items_in_row;
401
403
  }
402
404
  const index_of_us_in_row = target_index - index_of_first_item_in_row;
403
- for (let j = 0; j < index_of_us_in_row; j++) if (displaced_products[i]?.[j])
405
+ for (let j = 0; j < index_of_us_in_row; j++) if (displaced_products_[i]?.[j])
404
406
  // Add blocks in our *current* row to the displacement, but only the ones to our left
405
407
  displacement_by_added_blocks++;
406
408
  // Add block to output array at the correct index
407
409
  const final_target_index = target_index - displacement_by_added_blocks;
408
- const existing_block = content_blocks_by_index[final_target_index];
410
+ const existing_block = content_blocks_by_index_[final_target_index];
409
411
  const block_content = block.content;
410
412
  // If two blocks want to exist at the same location (can happen, for example if one block wants to be at the end of a row and the other one at the start of the next row) add an array with both
411
413
  if (existing_block) {
@@ -414,16 +416,19 @@ function $d92f338ba8f9da9b$export$92aa5d691d588f3f({
414
416
  existing_block.push(block_content);else {
415
417
  const array = [existing_block, block_content];
416
418
  constructed_block_arrays.add(array);
417
- content_blocks_by_index[final_target_index] = array;
419
+ content_blocks_by_index_[final_target_index] = array;
418
420
  }
419
- } else content_blocks_by_index[final_target_index] = block_content;
421
+ } else content_blocks_by_index_[final_target_index] = block_content;
420
422
  // Update displacement
421
423
  for (let j = 0; j < span_rows; j++) {
422
- const row = displaced_products[i + j] ||= [];
424
+ const row = displaced_products_[i + j] ||= [];
423
425
  for (let k = index_of_us_in_row; k < index_of_us_in_row + span_columns; k++) row[k] = true;
424
426
  }
425
427
  }
426
- return content_blocks_by_index;
428
+ return {
429
+ content_blocks_by_index_: content_blocks_by_index_,
430
+ displaced_products_: displaced_products_
431
+ };
427
432
  }
428
433
  /**
429
434
  * Takes a store that contains an array from where index is number of row and value is the result of executing the content block rendering function.
@@ -10224,7 +10229,8 @@ class $e1d6c0f3d89d531c$export$e015ed2f2950f2e3 {
10224
10229
  breadcrumbs: [],
10225
10230
  quick_links: [],
10226
10231
  image_urls: [],
10227
- failed: true
10232
+ failed: true,
10233
+ content_blocks: []
10228
10234
  }),
10229
10235
  method_: "GET"
10230
10236
  });
@@ -14881,6 +14887,70 @@ function $bb9760b7a8acdc18$export$7af06a63c5a976c9(el, listing_id, i18n_) {
14881
14887
  $gVhhF$solidjs.onCleanup(disconnect);
14882
14888
  }
14883
14889
  $gVhhF$solidjsweb.delegateEvents(["click"]);
14890
+ var $32c662f618f5d80d$var$_tmpl$ = /*#__PURE__*/$gVhhF$solidjsweb.template(`<a><img>`),
14891
+ $32c662f618f5d80d$var$_tmpl$2 = /*#__PURE__*/$gVhhF$solidjsweb.template(`<a><video loop>`);
14892
+ function $32c662f618f5d80d$export$780a853d15174484({
14893
+ contentBlock: contentBlock,
14894
+ router_: router_
14895
+ }) {
14896
+ if (contentBlock.content.type === "image") return () => (() => {
14897
+ var _el$ = $gVhhF$solidjsweb.getNextElement($32c662f618f5d80d$var$_tmpl$),
14898
+ _el$2 = _el$.firstChild;
14899
+ $gVhhF$solidjsweb.addEventListener(_el$, "click", $gVhhF$depictaiutilisharedlatest.catchify(ev => router_.navigate_.go_to_({
14900
+ new_url_: contentBlock.content.link,
14901
+ is_replace_: false,
14902
+ event_: ev
14903
+ })), true);
14904
+ _el$2.style.setProperty("width", "100%");
14905
+ _el$2.style.setProperty("height", "100%");
14906
+ _el$2.style.setProperty("object-fit", "cover");
14907
+ _el$2.style.setProperty("position", "absolute");
14908
+ _el$2.style.setProperty("inset", "0");
14909
+ $gVhhF$solidjsweb.effect(_p$ => {
14910
+ var _v$ = contentBlock.content.link,
14911
+ _v$2 = contentBlock.content.url;
14912
+ _v$ !== _p$.e && $gVhhF$solidjsweb.setAttribute(_el$, "href", _p$.e = _v$);
14913
+ _v$2 !== _p$.t && $gVhhF$solidjsweb.setAttribute(_el$2, "src", _p$.t = _v$2);
14914
+ return _p$;
14915
+ }, {
14916
+ e: undefined,
14917
+ t: undefined
14918
+ });
14919
+ $gVhhF$solidjsweb.runHydrationEvents();
14920
+ return _el$;
14921
+ })();
14922
+ if (contentBlock.content.type === "video") return () => (() => {
14923
+ var _el$3 = $gVhhF$solidjsweb.getNextElement($32c662f618f5d80d$var$_tmpl$2),
14924
+ _el$4 = _el$3.firstChild;
14925
+ $gVhhF$solidjsweb.addEventListener(_el$3, "click", $gVhhF$depictaiutilisharedlatest.catchify(ev => router_.navigate_.go_to_({
14926
+ new_url_: contentBlock.content.link,
14927
+ is_replace_: false,
14928
+ event_: ev
14929
+ })), true);
14930
+ $gVhhF$solidjsweb.setProperty(_el$4, "controls", false);
14931
+ $gVhhF$solidjsweb.setProperty(_el$4, "muted", true);
14932
+ $gVhhF$solidjsweb.setProperty(_el$4, "autoplay", true);
14933
+ $gVhhF$solidjsweb.setProperty(_el$4, "playsinline", true);
14934
+ _el$4.style.setProperty("width", "100%");
14935
+ _el$4.style.setProperty("height", "100%");
14936
+ _el$4.style.setProperty("object-fit", "cover");
14937
+ _el$4.style.setProperty("position", "absolute");
14938
+ _el$4.style.setProperty("inset", "0");
14939
+ $gVhhF$solidjsweb.effect(_p$ => {
14940
+ var _v$3 = contentBlock.content.link,
14941
+ _v$4 = contentBlock.content.url;
14942
+ _v$3 !== _p$.e && $gVhhF$solidjsweb.setAttribute(_el$3, "href", _p$.e = _v$3);
14943
+ _v$4 !== _p$.t && $gVhhF$solidjsweb.setAttribute(_el$4, "src", _p$.t = _v$4);
14944
+ return _p$;
14945
+ }, {
14946
+ e: undefined,
14947
+ t: undefined
14948
+ });
14949
+ $gVhhF$solidjsweb.runHydrationEvents();
14950
+ return _el$3;
14951
+ })();
14952
+ }
14953
+ $gVhhF$solidjsweb.delegateEvents(["click"]);
14884
14954
  var $840d88a04b2d22a7$var$_tmpl$ = /*#__PURE__*/$gVhhF$solidjsweb.template(`<div class=product-count><!$><!/> <!$><!/>`),
14885
14955
  $840d88a04b2d22a7$var$_tmpl$2 = /*#__PURE__*/$gVhhF$solidjsweb.template(`<div>`),
14886
14956
  $840d88a04b2d22a7$var$_tmpl$3 = /*#__PURE__*/$gVhhF$solidjsweb.template(`<div class=filter-results-for-one-row><!$><!/><!$><!/>`),
@@ -14976,6 +15046,23 @@ function $840d88a04b2d22a7$export$f7d2f673fc2f091d({
14976
15046
  }));
14977
15047
  // Make "Get Listing" request to get quicklinks, breadcrumbs, title, etc
14978
15048
  const [plp_meta] = $gVhhF$solidjs.createResource(meta_query_base, $gVhhF$depictaiutilisharedlatest.catchify(query => depict_api_.get_listing(query)));
15049
+ const contentBlocksByRow = $gVhhF$solidjs.createMemo(() => {
15050
+ if (content_blocks_by_row_()) return content_blocks_by_row_();
15051
+ const content = [];
15052
+ plp_meta()?.content_blocks?.forEach(row => {
15053
+ const contentBlock = {
15054
+ span_columns: row.span_columns,
15055
+ span_rows: row.span_rows,
15056
+ position: row.position,
15057
+ content: $32c662f618f5d80d$export$780a853d15174484({
15058
+ contentBlock: row,
15059
+ router_: router_
15060
+ })
15061
+ };
15062
+ content[row.row] = contentBlock;
15063
+ });
15064
+ return content;
15065
+ });
14979
15066
  const available_sortings_ = $gVhhF$solidjs.createMemo(() => plp_products_()?.sorts?.map(sort => ({
14980
15067
  ...sort,
14981
15068
  order: sort.order ?? "desc"
@@ -15236,7 +15323,7 @@ function $840d88a04b2d22a7$export$f7d2f673fc2f091d({
15236
15323
  product_card_template_: product_card_template_,
15237
15324
  sort_or_filter_open_: sort_or_filter_open_,
15238
15325
  desktop_filter_elements_: desktop_filter_elements_,
15239
- content_blocks_by_row_: content_blocks_by_row_,
15326
+ content_blocks_by_row_: contentBlocksByRow,
15240
15327
  ConfiguredScrollStatus_: ConfiguredScrollStatus_,
15241
15328
  id_currently_querying_for_: id_to_query_for_,
15242
15329
  no_results_options_: {
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.30";
14
+ export const version = "4.7.31";
15
15
  /**
16
16
  * Use `javascript_media_query` but return a reactive accessor instead of taking a callback function
17
17
  */
@@ -93,7 +93,8 @@ export type ContentBlocksByRow = (undefined | ContentBlock)[];
93
93
  /**
94
94
  * Does pure calculations where to put each of the finished wrapped content blocks in the elements in the grid (input is by row). You need to cap span_columns of the blocks to the columns available before passing them to this function.
95
95
  * Also used in the portal in react.
96
- * @returns an array where index is index of the blocks in the "displays array" and value is the content block (elements) to show at that index
96
+ * @returns content_blocks_by_index_: an array where index is index of the blocks in the "displays array" and value is the content block (elements) to show at that index.
97
+ * displaced_products_: internal state that can be used to figure out if there's parts of a content block on a row, see the comment inside this function
97
98
  */
98
99
  export function remap_blocks_to_index<T = () => JSX.Element | Promise<JSX.Element>>({
99
100
  wrapped_blocks_,
@@ -106,7 +107,13 @@ export function remap_blocks_to_index<T = () => JSX.Element | Promise<JSX.Elemen
106
107
  content: T;
107
108
  })[];
108
109
  n_cols_currently_showing_: number | null;
109
- }): JSX.Element[];
110
+ }): {
111
+ content_blocks_by_index_: JSX.Element[];
112
+ readonly displaced_products_?: undefined;
113
+ } | {
114
+ readonly content_blocks_by_index_: JSX.Element[];
115
+ readonly displaced_products_: (number | (true | undefined)[])[];
116
+ };
110
117
  /**
111
118
  * Returns a set containing the element where every element currently touching the screen started touching it.
112
119
  */
@@ -1477,7 +1484,7 @@ type OpenModalParams<OriginalDisplay extends Display, OutputDisplay extends Mode
1477
1484
  * Open the modal with support for alignment.
1478
1485
  * @returns {void}
1479
1486
  */
1480
- export const open_modal_with_alignment: <OriginalDisplay extends Display, OutputDisplay extends ModernDisplay>(openModalParams: OpenModalParams<OriginalDisplay, OutputDisplay>) => void;
1487
+ export const open_modal_with_alignment: <OriginalDisplay extends Display, OutputDisplay extends unknown>(openModalParams: OpenModalParams<OriginalDisplay, OutputDisplay>) => void;
1481
1488
  export function open_search_with_shift_slash(open_search: VoidFunction): () => void;
1482
1489
  export interface PageReplacer {
1483
1490
  readonly render_: () => Node_Array;
@@ -1556,5 +1563,5 @@ export function CategoryPage<OriginalDisplay extends Display, OutputDisplay exte
1556
1563
  content_blocks_by_row?: ContentBlocksByRow;
1557
1564
  layout?: PossibleLayout;
1558
1565
  filterModalParent_?: HTMLElement | ShadowRoot;
1559
- }): import("@depict-ai/utilishared/latest").Node_Array;
1566
+ }): import("@depict-ai/utilishared").Node_Array;
1560
1567
  export type { SearchFilter } from "@depict-ai/types/api/SearchRequestV3";
package/latest/index.js CHANGED
@@ -7,7 +7,7 @@ import { dlog as $9HbP8$dlog, catchify as $9HbP8$catchify, ListenableSet as $9Hb
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.30";
10
+ const $ec291e0010116877$export$83d89fbfd8236492 = "4.7.31";
11
11
  function $dc9262ef6f786812$export$d9f36cf74e24d595(media_query) {
12
12
  const signal = $9HbP8$createSignal(false);
13
13
  $9HbP8$onCleanup($9HbP8$javascript_media_query(media_query, ({
@@ -262,20 +262,22 @@ function $e7a7eb102ddc0c79$export$791ef57e62e21c3f({
262
262
  return $9HbP8$createMemo(() => $e7a7eb102ddc0c79$export$92aa5d691d588f3f({
263
263
  wrapped_blocks_: get_wrapped_blocks_(),
264
264
  n_cols_currently_showing_: n_cols_currently_showing_()
265
- }));
265
+ }).content_blocks_by_index_);
266
266
  }
267
267
  function $e7a7eb102ddc0c79$export$92aa5d691d588f3f({
268
268
  wrapped_blocks_: wrapped_blocks_,
269
269
  n_cols_currently_showing_: n_cols_currently_showing_
270
270
  }) {
271
271
  // This computation should be quite cheap since it just moves around things into an array
272
- const content_blocks_by_index = [];
272
+ const content_blocks_by_index_ = [];
273
273
  const constructed_block_arrays = new WeakSet();
274
274
  // Need to keep track of products displaced by blocks above when mapping rows to indexes in the actual grid
275
- const displaced_products = []; // undefined = is product, true = is content block if number instead of tuple number indicates content blocks in that row. Index in first array is row, index in second array is column
275
+ const displaced_products_ = []; // undefined = is product, true = is content block if number instead of tuple number indicates content blocks in that row. Index in first array is row, index in second array is column
276
276
  if (!n_cols_currently_showing_)
277
277
  // Nope out of here if we don't know how many columns are showing
278
- return content_blocks_by_index;
278
+ return {
279
+ content_blocks_by_index_: content_blocks_by_index_
280
+ };
279
281
  for (let i = 0; i < wrapped_blocks_.length; i++) {
280
282
  // i = row to show at
281
283
  const block = wrapped_blocks_[i];
@@ -292,22 +294,22 @@ function $e7a7eb102ddc0c79$export$92aa5d691d588f3f({
292
294
  // Calculate displacement of us by content blocks above us
293
295
  let displacement_by_added_blocks = 0;
294
296
  for (let j = 0; j < i; j++) {
295
- const row = displaced_products[j];
297
+ const row = displaced_products_[j];
296
298
  if (row === undefined) continue; // there were no blocks in this row
297
299
  let displaced_items_in_row;
298
300
  if (typeof row === "number") displaced_items_in_row = row;else {
299
301
  displaced_items_in_row = row.filter(item => item).length;
300
- displaced_products[j] = displaced_items_in_row;
302
+ displaced_products_[j] = displaced_items_in_row;
301
303
  }
302
304
  displacement_by_added_blocks += displaced_items_in_row;
303
305
  }
304
306
  const index_of_us_in_row = target_index - index_of_first_item_in_row;
305
- for (let j = 0; j < index_of_us_in_row; j++) if (displaced_products[i]?.[j])
307
+ for (let j = 0; j < index_of_us_in_row; j++) if (displaced_products_[i]?.[j])
306
308
  // Add blocks in our *current* row to the displacement, but only the ones to our left
307
309
  displacement_by_added_blocks++;
308
310
  // Add block to output array at the correct index
309
311
  const final_target_index = target_index - displacement_by_added_blocks;
310
- const existing_block = content_blocks_by_index[final_target_index];
312
+ const existing_block = content_blocks_by_index_[final_target_index];
311
313
  const block_content = block.content;
312
314
  // If two blocks want to exist at the same location (can happen, for example if one block wants to be at the end of a row and the other one at the start of the next row) add an array with both
313
315
  if (existing_block) {
@@ -316,16 +318,19 @@ function $e7a7eb102ddc0c79$export$92aa5d691d588f3f({
316
318
  existing_block.push(block_content);else {
317
319
  const array = [existing_block, block_content];
318
320
  constructed_block_arrays.add(array);
319
- content_blocks_by_index[final_target_index] = array;
321
+ content_blocks_by_index_[final_target_index] = array;
320
322
  }
321
- } else content_blocks_by_index[final_target_index] = block_content;
323
+ } else content_blocks_by_index_[final_target_index] = block_content;
322
324
  // Update displacement
323
325
  for (let j = 0; j < span_rows; j++) {
324
- const row = displaced_products[i + j] ||= [];
326
+ const row = displaced_products_[i + j] ||= [];
325
327
  for (let k = index_of_us_in_row; k < index_of_us_in_row + span_columns; k++) row[k] = true;
326
328
  }
327
329
  }
328
- return content_blocks_by_index;
330
+ return {
331
+ content_blocks_by_index_: content_blocks_by_index_,
332
+ displaced_products_: displaced_products_
333
+ };
329
334
  }
330
335
  /**
331
336
  * Takes a store that contains an array from where index is number of row and value is the result of executing the content block rendering function.
@@ -10126,7 +10131,8 @@ class $7fa23e2a0079eca4$export$e015ed2f2950f2e3 {
10126
10131
  breadcrumbs: [],
10127
10132
  quick_links: [],
10128
10133
  image_urls: [],
10129
- failed: true
10134
+ failed: true,
10135
+ content_blocks: []
10130
10136
  }),
10131
10137
  method_: "GET"
10132
10138
  });
@@ -14783,6 +14789,70 @@ function $cc6f5b69378cd164$export$7af06a63c5a976c9(el, listing_id, i18n_) {
14783
14789
  $9HbP8$onCleanup(disconnect);
14784
14790
  }
14785
14791
  $9HbP8$delegateEvents(["click"]);
14792
+ var $f916989c4b1be9f7$var$_tmpl$ = /*#__PURE__*/$9HbP8$template(`<a><img>`),
14793
+ $f916989c4b1be9f7$var$_tmpl$2 = /*#__PURE__*/$9HbP8$template(`<a><video loop>`);
14794
+ function $f916989c4b1be9f7$export$780a853d15174484({
14795
+ contentBlock: contentBlock,
14796
+ router_: router_
14797
+ }) {
14798
+ if (contentBlock.content.type === "image") return () => (() => {
14799
+ var _el$ = $9HbP8$getNextElement($f916989c4b1be9f7$var$_tmpl$),
14800
+ _el$2 = _el$.firstChild;
14801
+ $9HbP8$addEventListener(_el$, "click", $9HbP8$catchify(ev => router_.navigate_.go_to_({
14802
+ new_url_: contentBlock.content.link,
14803
+ is_replace_: false,
14804
+ event_: ev
14805
+ })), true);
14806
+ _el$2.style.setProperty("width", "100%");
14807
+ _el$2.style.setProperty("height", "100%");
14808
+ _el$2.style.setProperty("object-fit", "cover");
14809
+ _el$2.style.setProperty("position", "absolute");
14810
+ _el$2.style.setProperty("inset", "0");
14811
+ $9HbP8$effect(_p$ => {
14812
+ var _v$ = contentBlock.content.link,
14813
+ _v$2 = contentBlock.content.url;
14814
+ _v$ !== _p$.e && $9HbP8$setAttribute(_el$, "href", _p$.e = _v$);
14815
+ _v$2 !== _p$.t && $9HbP8$setAttribute(_el$2, "src", _p$.t = _v$2);
14816
+ return _p$;
14817
+ }, {
14818
+ e: undefined,
14819
+ t: undefined
14820
+ });
14821
+ $9HbP8$runHydrationEvents();
14822
+ return _el$;
14823
+ })();
14824
+ if (contentBlock.content.type === "video") return () => (() => {
14825
+ var _el$3 = $9HbP8$getNextElement($f916989c4b1be9f7$var$_tmpl$2),
14826
+ _el$4 = _el$3.firstChild;
14827
+ $9HbP8$addEventListener(_el$3, "click", $9HbP8$catchify(ev => router_.navigate_.go_to_({
14828
+ new_url_: contentBlock.content.link,
14829
+ is_replace_: false,
14830
+ event_: ev
14831
+ })), true);
14832
+ $9HbP8$setProperty(_el$4, "controls", false);
14833
+ $9HbP8$setProperty(_el$4, "muted", true);
14834
+ $9HbP8$setProperty(_el$4, "autoplay", true);
14835
+ $9HbP8$setProperty(_el$4, "playsinline", true);
14836
+ _el$4.style.setProperty("width", "100%");
14837
+ _el$4.style.setProperty("height", "100%");
14838
+ _el$4.style.setProperty("object-fit", "cover");
14839
+ _el$4.style.setProperty("position", "absolute");
14840
+ _el$4.style.setProperty("inset", "0");
14841
+ $9HbP8$effect(_p$ => {
14842
+ var _v$3 = contentBlock.content.link,
14843
+ _v$4 = contentBlock.content.url;
14844
+ _v$3 !== _p$.e && $9HbP8$setAttribute(_el$3, "href", _p$.e = _v$3);
14845
+ _v$4 !== _p$.t && $9HbP8$setAttribute(_el$4, "src", _p$.t = _v$4);
14846
+ return _p$;
14847
+ }, {
14848
+ e: undefined,
14849
+ t: undefined
14850
+ });
14851
+ $9HbP8$runHydrationEvents();
14852
+ return _el$3;
14853
+ })();
14854
+ }
14855
+ $9HbP8$delegateEvents(["click"]);
14786
14856
  var $df5d81d0fe61ff21$var$_tmpl$ = /*#__PURE__*/$9HbP8$template(`<div class=product-count><!$><!/> <!$><!/>`),
14787
14857
  $df5d81d0fe61ff21$var$_tmpl$2 = /*#__PURE__*/$9HbP8$template(`<div>`),
14788
14858
  $df5d81d0fe61ff21$var$_tmpl$3 = /*#__PURE__*/$9HbP8$template(`<div class=filter-results-for-one-row><!$><!/><!$><!/>`),
@@ -14878,6 +14948,23 @@ function $df5d81d0fe61ff21$export$f7d2f673fc2f091d({
14878
14948
  }));
14879
14949
  // Make "Get Listing" request to get quicklinks, breadcrumbs, title, etc
14880
14950
  const [plp_meta] = $9HbP8$createResource(meta_query_base, $9HbP8$catchify(query => depict_api_.get_listing(query)));
14951
+ const contentBlocksByRow = $9HbP8$createMemo(() => {
14952
+ if (content_blocks_by_row_()) return content_blocks_by_row_();
14953
+ const content = [];
14954
+ plp_meta()?.content_blocks?.forEach(row => {
14955
+ const contentBlock = {
14956
+ span_columns: row.span_columns,
14957
+ span_rows: row.span_rows,
14958
+ position: row.position,
14959
+ content: $f916989c4b1be9f7$export$780a853d15174484({
14960
+ contentBlock: row,
14961
+ router_: router_
14962
+ })
14963
+ };
14964
+ content[row.row] = contentBlock;
14965
+ });
14966
+ return content;
14967
+ });
14881
14968
  const available_sortings_ = $9HbP8$createMemo(() => plp_products_()?.sorts?.map(sort => ({
14882
14969
  ...sort,
14883
14970
  order: sort.order ?? "desc"
@@ -15138,7 +15225,7 @@ function $df5d81d0fe61ff21$export$f7d2f673fc2f091d({
15138
15225
  product_card_template_: product_card_template_,
15139
15226
  sort_or_filter_open_: sort_or_filter_open_,
15140
15227
  desktop_filter_elements_: desktop_filter_elements_,
15141
- content_blocks_by_row_: content_blocks_by_row_,
15228
+ content_blocks_by_row_: contentBlocksByRow,
15142
15229
  ConfiguredScrollStatus_: ConfiguredScrollStatus_,
15143
15230
  id_currently_querying_for_: id_to_query_for_,
15144
15231
  no_results_options_: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@depict-ai/ui",
3
- "version": "4.7.30",
3
+ "version": "4.7.31",
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",
@@ -111,7 +111,7 @@ $parcel$export(module.exports, "BreadCrumbs", () => $335c02c1241a9ca8$export$5b7
111
111
  $parcel$export(module.exports, "QuickLinks", () => $335c02c1241a9ca8$export$de035477d6fef996);
112
112
  $parcel$export(module.exports, "CategoryPage", () => $c10e33c4681f8c9b$export$e2bf8ce7779e827e);
113
113
  /*! Depict.ai search and product listing SDK */
114
- const $aa1938dec50d6c12$export$83d89fbfd8236492 = "4.7.30";
114
+ const $aa1938dec50d6c12$export$83d89fbfd8236492 = "4.7.31";
115
115
  function $3e17e871e9d0911d$export$d9f36cf74e24d595(media_query) {
116
116
  const signal = $3hooq$solidjs.createSignal(false);
117
117
  $3hooq$solidjs.onCleanup($3hooq$depictaiutilishared.javascript_media_query(media_query, _ref => {
@@ -216,7 +216,7 @@ function $f8f375d6245ffff2$export$791ef57e62e21c3f(_ref) {
216
216
  return $3hooq$solidjs.createMemo(() => $f8f375d6245ffff2$export$92aa5d691d588f3f({
217
217
  wrapped_blocks_: get_wrapped_blocks_(),
218
218
  n_cols_currently_showing_: n_cols_currently_showing_()
219
- }));
219
+ }).content_blocks_by_index_);
220
220
  }
221
221
  function $f8f375d6245ffff2$export$92aa5d691d588f3f(_ref2) {
222
222
  let {
@@ -224,13 +224,15 @@ function $f8f375d6245ffff2$export$92aa5d691d588f3f(_ref2) {
224
224
  n_cols_currently_showing_: n_cols_currently_showing_
225
225
  } = _ref2;
226
226
  // This computation should be quite cheap since it just moves around things into an array
227
- const content_blocks_by_index = [];
227
+ const content_blocks_by_index_ = [];
228
228
  const constructed_block_arrays = new WeakSet();
229
229
  // Need to keep track of products displaced by blocks above when mapping rows to indexes in the actual grid
230
- const displaced_products = []; // undefined = is product, true = is content block if number instead of tuple number indicates content blocks in that row. Index in first array is row, index in second array is column
230
+ const displaced_products_ = []; // undefined = is product, true = is content block if number instead of tuple number indicates content blocks in that row. Index in first array is row, index in second array is column
231
231
  if (!n_cols_currently_showing_)
232
232
  // Nope out of here if we don't know how many columns are showing
233
- return content_blocks_by_index;
233
+ return {
234
+ content_blocks_by_index_: content_blocks_by_index_
235
+ };
234
236
  for (let i = 0; i < wrapped_blocks_.length; i++) {
235
237
  // i = row to show at
236
238
  const block = wrapped_blocks_[i];
@@ -247,25 +249,25 @@ function $f8f375d6245ffff2$export$92aa5d691d588f3f(_ref2) {
247
249
  // Calculate displacement of us by content blocks above us
248
250
  let displacement_by_added_blocks = 0;
249
251
  for (let j = 0; j < i; j++) {
250
- const row = displaced_products[j];
252
+ const row = displaced_products_[j];
251
253
  if (row === undefined) continue; // there were no blocks in this row
252
254
  let displaced_items_in_row;
253
255
  if (typeof row === "number") displaced_items_in_row = row;else {
254
256
  displaced_items_in_row = row.filter(item => item).length;
255
- displaced_products[j] = displaced_items_in_row;
257
+ displaced_products_[j] = displaced_items_in_row;
256
258
  }
257
259
  displacement_by_added_blocks += displaced_items_in_row;
258
260
  }
259
261
  const index_of_us_in_row = target_index - index_of_first_item_in_row;
260
262
  for (let j = 0; j < index_of_us_in_row; j++) {
261
- var _displaced_products$i;
262
- if ((_displaced_products$i = displaced_products[i]) !== null && _displaced_products$i !== void 0 && _displaced_products$i[j])
263
+ var _displaced_products_$;
264
+ if ((_displaced_products_$ = displaced_products_[i]) !== null && _displaced_products_$ !== void 0 && _displaced_products_$[j])
263
265
  // Add blocks in our *current* row to the displacement, but only the ones to our left
264
266
  displacement_by_added_blocks++;
265
267
  }
266
268
  // Add block to output array at the correct index
267
269
  const final_target_index = target_index - displacement_by_added_blocks;
268
- const existing_block = content_blocks_by_index[final_target_index];
270
+ const existing_block = content_blocks_by_index_[final_target_index];
269
271
  const block_content = block.content;
270
272
  // If two blocks want to exist at the same location (can happen, for example if one block wants to be at the end of a row and the other one at the start of the next row) add an array with both
271
273
  if (existing_block) {
@@ -274,17 +276,20 @@ function $f8f375d6245ffff2$export$92aa5d691d588f3f(_ref2) {
274
276
  existing_block.push(block_content);else {
275
277
  const array = [existing_block, block_content];
276
278
  constructed_block_arrays.add(array);
277
- content_blocks_by_index[final_target_index] = array;
279
+ content_blocks_by_index_[final_target_index] = array;
278
280
  }
279
- } else content_blocks_by_index[final_target_index] = block_content;
281
+ } else content_blocks_by_index_[final_target_index] = block_content;
280
282
  // Update displacement
281
283
  for (let j = 0; j < span_rows; j++) {
282
284
  var _ref3;
283
- const row = displaced_products[_ref3 = i + j] || (displaced_products[_ref3] = []);
285
+ const row = displaced_products_[_ref3 = i + j] || (displaced_products_[_ref3] = []);
284
286
  for (let k = index_of_us_in_row; k < index_of_us_in_row + span_columns; k++) row[k] = true;
285
287
  }
286
288
  }
287
- return content_blocks_by_index;
289
+ return {
290
+ content_blocks_by_index_: content_blocks_by_index_,
291
+ displaced_products_: displaced_products_
292
+ };
288
293
  }
289
294
  /**
290
295
  * Takes a store that contains an array from where index is number of row and value is the result of executing the content block rendering function.
@@ -8485,7 +8490,8 @@ class $e270e9f953fcbc58$export$e015ed2f2950f2e3 {
8485
8490
  breadcrumbs: [],
8486
8491
  quick_links: [],
8487
8492
  image_urls: [],
8488
- failed: true
8493
+ failed: true,
8494
+ content_blocks: []
8489
8495
  }),
8490
8496
  method_: "GET"
8491
8497
  });
@@ -13290,6 +13296,16 @@ function $8b366fdb0c76194d$var$clear_if_opened_new_tab_with_sideways_url_params_
13290
13296
  });
13291
13297
  tracking_function_for_plp_results(plp_results_);
13292
13298
  }
13299
+ var $c19709057a32b2e7$var$_tmpl$ = ["<a", "><img", ' style="', '"></a>'],
13300
+ $c19709057a32b2e7$var$_tmpl$2 = ["<a", "><video", ' muted="" autoplay="" playsinline="" loop style="', '"></video></a>'];
13301
+ function $c19709057a32b2e7$export$780a853d15174484(_ref) {
13302
+ let {
13303
+ contentBlock: contentBlock,
13304
+ router_: router_
13305
+ } = _ref;
13306
+ if (contentBlock.content.type === "image") return () => $3hooq$solidjsweb.ssr($c19709057a32b2e7$var$_tmpl$, $3hooq$solidjsweb.ssrHydrationKey() + $3hooq$solidjsweb.ssrAttribute("href", $3hooq$solidjsweb.escape(contentBlock.content.link, true), false), $3hooq$solidjsweb.ssrAttribute("src", $3hooq$solidjsweb.escape(contentBlock.content.url, true), false), "width:100%;height:100%;object-fit:cover;position:absolute;inset:0");
13307
+ if (contentBlock.content.type === "video") return () => $3hooq$solidjsweb.ssr($c19709057a32b2e7$var$_tmpl$2, $3hooq$solidjsweb.ssrHydrationKey() + $3hooq$solidjsweb.ssrAttribute("href", $3hooq$solidjsweb.escape(contentBlock.content.link, true), false), $3hooq$solidjsweb.ssrAttribute("src", $3hooq$solidjsweb.escape(contentBlock.content.url, true), false), "width:100%;height:100%;object-fit:cover;position:absolute;inset:0");
13308
+ }
13293
13309
  var $ede6c70ecdca46fe$var$_tmpl$ = ["<div", ' class="product-count"><!--$-->', "<!--/--> <!--$-->", "<!--/--></div>"],
13294
13310
  $ede6c70ecdca46fe$var$_tmpl$2 = ["<div", "></div>"],
13295
13311
  $ede6c70ecdca46fe$var$_tmpl$3 = ["<div", ' class="filter-results-for-one-row"><!--$-->', "<!--/--><!--$-->", "<!--/--></div>"],
@@ -13386,6 +13402,24 @@ function $ede6c70ecdca46fe$export$f7d2f673fc2f091d(_ref) {
13386
13402
  }));
13387
13403
  // Make "Get Listing" request to get quicklinks, breadcrumbs, title, etc
13388
13404
  const [plp_meta] = $3hooq$solidjs.createResource(meta_query_base, $3hooq$depictaiutilisharedlatest.catchify(query => depict_api_.get_listing(query)));
13405
+ const contentBlocksByRow = $3hooq$solidjs.createMemo(() => {
13406
+ var _plp_meta, _plp_meta$content_blo;
13407
+ if (content_blocks_by_row_()) return content_blocks_by_row_();
13408
+ const content = [];
13409
+ (_plp_meta = plp_meta()) === null || _plp_meta === void 0 || (_plp_meta$content_blo = _plp_meta.content_blocks) === null || _plp_meta$content_blo === void 0 || _plp_meta$content_blo.forEach(row => {
13410
+ const contentBlock = {
13411
+ span_columns: row.span_columns,
13412
+ span_rows: row.span_rows,
13413
+ position: row.position,
13414
+ content: $c19709057a32b2e7$export$780a853d15174484({
13415
+ contentBlock: row,
13416
+ router_: router_
13417
+ })
13418
+ };
13419
+ content[row.row] = contentBlock;
13420
+ });
13421
+ return content;
13422
+ });
13389
13423
  const available_sortings_ = $3hooq$solidjs.createMemo(() => {
13390
13424
  var _plp_products_, _plp_products_$sorts;
13391
13425
  return (_plp_products_ = plp_products_()) === null || _plp_products_ === void 0 ? void 0 : (_plp_products_$sorts = _plp_products_.sorts) === null || _plp_products_$sorts === void 0 ? void 0 : _plp_products_$sorts.map(sort => {
@@ -13401,13 +13435,13 @@ function $ede6c70ecdca46fe$export$f7d2f673fc2f091d(_ref) {
13401
13435
  return (_plp_products_2 = plp_products_()) === null || _plp_products_2 === void 0 ? void 0 : _plp_products_2.filters;
13402
13436
  });
13403
13437
  const title = $3hooq$solidjs.createMemo(() => {
13404
- var _plp_meta;
13405
- return (_plp_meta = plp_meta()) === null || _plp_meta === void 0 ? void 0 : _plp_meta.title;
13438
+ var _plp_meta2;
13439
+ return (_plp_meta2 = plp_meta()) === null || _plp_meta2 === void 0 ? void 0 : _plp_meta2.title;
13406
13440
  });
13407
13441
  const crumb_data_ = $ede6c70ecdca46fe$var$add_us_to_crumbs(plp_meta);
13408
13442
  const quicklinks_data_ = $3hooq$solidjs.createMemo(() => {
13409
- var _plp_meta2;
13410
- return (_plp_meta2 = plp_meta()) === null || _plp_meta2 === void 0 ? void 0 : _plp_meta2.quick_links;
13443
+ var _plp_meta3;
13444
+ return (_plp_meta3 = plp_meta()) === null || _plp_meta3 === void 0 ? void 0 : _plp_meta3.quick_links;
13411
13445
  });
13412
13446
  const [sort_or_filter_open_, set_sort_or_filter_open_] = $3hooq$solidjs.createSignal(false);
13413
13447
  const [desktop_filter_elements_, set_desktop_filter_elements] = $3hooq$solidjs.createSignal();
@@ -13632,7 +13666,7 @@ function $ede6c70ecdca46fe$export$f7d2f673fc2f091d(_ref) {
13632
13666
  product_card_template_: product_card_template_,
13633
13667
  sort_or_filter_open_: sort_or_filter_open_,
13634
13668
  desktop_filter_elements_: desktop_filter_elements_,
13635
- content_blocks_by_row_: content_blocks_by_row_,
13669
+ content_blocks_by_row_: contentBlocksByRow,
13636
13670
  ConfiguredScrollStatus_: ConfiguredScrollStatus_,
13637
13671
  id_currently_querying_for_: id_to_query_for_,
13638
13672
  no_results_options_: {
@@ -13673,8 +13707,8 @@ function $ede6c70ecdca46fe$export$f7d2f673fc2f091d(_ref) {
13673
13707
  function $ede6c70ecdca46fe$var$add_us_to_crumbs(plp_meta) {
13674
13708
  const href_accessor = $3hooq$depictaiutilisharedlatest.use_href_accessor();
13675
13709
  return $3hooq$solidjs.createMemo(() => {
13676
- var _plp_meta3;
13677
- const api_value = (_plp_meta3 = plp_meta()) === null || _plp_meta3 === void 0 ? void 0 : _plp_meta3.breadcrumbs;
13710
+ var _plp_meta4;
13711
+ const api_value = (_plp_meta4 = plp_meta()) === null || _plp_meta4 === void 0 ? void 0 : _plp_meta4.breadcrumbs;
13678
13712
  if (!api_value) return api_value;
13679
13713
  return [...api_value, $3hooq$solidjs.mergeProps(plp_meta(), {
13680
13714
  get page_url() {