@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/ES10/index.cjs +111 -22
- package/ES10/index.d.ts +12 -5
- package/ES10/index.js +111 -22
- package/latest/index.cjs +102 -15
- package/latest/index.d.ts +12 -5
- package/latest/index.js +102 -15
- package/package.json +1 -1
- package/server/ES10/index.cjs +56 -22
- package/server/ES10/index.d.ts +12 -5
- package/server/ES10/index.js +56 -22
- package/server/latest/index.cjs +47 -15
- package/server/latest/index.d.ts +12 -5
- package/server/latest/index.js +47 -15
package/ES10/index.cjs
CHANGED
|
@@ -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.
|
|
114
|
+
const $aa1938dec50d6c12$export$83d89fbfd8236492 = "4.7.31";
|
|
115
115
|
function $3e17e871e9d0911d$export$d9f36cf74e24d595(media_query) {
|
|
116
116
|
const signal = $52FdA$solidjs.createSignal(false);
|
|
117
117
|
$52FdA$solidjs.onCleanup($52FdA$depictaiutilishared.javascript_media_query(media_query, _ref => {
|
|
@@ -383,7 +383,7 @@ function $f8f375d6245ffff2$export$791ef57e62e21c3f(_ref) {
|
|
|
383
383
|
return $52FdA$solidjs.createMemo(() => $f8f375d6245ffff2$export$92aa5d691d588f3f({
|
|
384
384
|
wrapped_blocks_: get_wrapped_blocks_(),
|
|
385
385
|
n_cols_currently_showing_: n_cols_currently_showing_()
|
|
386
|
-
}));
|
|
386
|
+
}).content_blocks_by_index_);
|
|
387
387
|
}
|
|
388
388
|
function $f8f375d6245ffff2$export$92aa5d691d588f3f(_ref2) {
|
|
389
389
|
let {
|
|
@@ -391,13 +391,15 @@ function $f8f375d6245ffff2$export$92aa5d691d588f3f(_ref2) {
|
|
|
391
391
|
n_cols_currently_showing_: n_cols_currently_showing_
|
|
392
392
|
} = _ref2;
|
|
393
393
|
// This computation should be quite cheap since it just moves around things into an array
|
|
394
|
-
const
|
|
394
|
+
const content_blocks_by_index_ = [];
|
|
395
395
|
const constructed_block_arrays = new WeakSet();
|
|
396
396
|
// Need to keep track of products displaced by blocks above when mapping rows to indexes in the actual grid
|
|
397
|
-
const
|
|
397
|
+
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
|
|
398
398
|
if (!n_cols_currently_showing_)
|
|
399
399
|
// Nope out of here if we don't know how many columns are showing
|
|
400
|
-
return
|
|
400
|
+
return {
|
|
401
|
+
content_blocks_by_index_: content_blocks_by_index_
|
|
402
|
+
};
|
|
401
403
|
for (let i = 0; i < wrapped_blocks_.length; i++) {
|
|
402
404
|
// i = row to show at
|
|
403
405
|
const block = wrapped_blocks_[i];
|
|
@@ -414,25 +416,25 @@ function $f8f375d6245ffff2$export$92aa5d691d588f3f(_ref2) {
|
|
|
414
416
|
// Calculate displacement of us by content blocks above us
|
|
415
417
|
let displacement_by_added_blocks = 0;
|
|
416
418
|
for (let j = 0; j < i; j++) {
|
|
417
|
-
const row =
|
|
419
|
+
const row = displaced_products_[j];
|
|
418
420
|
if (row === undefined) continue; // there were no blocks in this row
|
|
419
421
|
let displaced_items_in_row;
|
|
420
422
|
if (typeof row === "number") displaced_items_in_row = row;else {
|
|
421
423
|
displaced_items_in_row = row.filter(item => item).length;
|
|
422
|
-
|
|
424
|
+
displaced_products_[j] = displaced_items_in_row;
|
|
423
425
|
}
|
|
424
426
|
displacement_by_added_blocks += displaced_items_in_row;
|
|
425
427
|
}
|
|
426
428
|
const index_of_us_in_row = target_index - index_of_first_item_in_row;
|
|
427
429
|
for (let j = 0; j < index_of_us_in_row; j++) {
|
|
428
|
-
var
|
|
429
|
-
if ((
|
|
430
|
+
var _displaced_products_$;
|
|
431
|
+
if ((_displaced_products_$ = displaced_products_[i]) !== null && _displaced_products_$ !== void 0 && _displaced_products_$[j])
|
|
430
432
|
// Add blocks in our *current* row to the displacement, but only the ones to our left
|
|
431
433
|
displacement_by_added_blocks++;
|
|
432
434
|
}
|
|
433
435
|
// Add block to output array at the correct index
|
|
434
436
|
const final_target_index = target_index - displacement_by_added_blocks;
|
|
435
|
-
const existing_block =
|
|
437
|
+
const existing_block = content_blocks_by_index_[final_target_index];
|
|
436
438
|
const block_content = block.content;
|
|
437
439
|
// 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
|
|
438
440
|
if (existing_block) {
|
|
@@ -441,17 +443,20 @@ function $f8f375d6245ffff2$export$92aa5d691d588f3f(_ref2) {
|
|
|
441
443
|
existing_block.push(block_content);else {
|
|
442
444
|
const array = [existing_block, block_content];
|
|
443
445
|
constructed_block_arrays.add(array);
|
|
444
|
-
|
|
446
|
+
content_blocks_by_index_[final_target_index] = array;
|
|
445
447
|
}
|
|
446
|
-
} else
|
|
448
|
+
} else content_blocks_by_index_[final_target_index] = block_content;
|
|
447
449
|
// Update displacement
|
|
448
450
|
for (let j = 0; j < span_rows; j++) {
|
|
449
451
|
var _ref3;
|
|
450
|
-
const row =
|
|
452
|
+
const row = displaced_products_[_ref3 = i + j] || (displaced_products_[_ref3] = []);
|
|
451
453
|
for (let k = index_of_us_in_row; k < index_of_us_in_row + span_columns; k++) row[k] = true;
|
|
452
454
|
}
|
|
453
455
|
}
|
|
454
|
-
return
|
|
456
|
+
return {
|
|
457
|
+
content_blocks_by_index_: content_blocks_by_index_,
|
|
458
|
+
displaced_products_: displaced_products_
|
|
459
|
+
};
|
|
455
460
|
}
|
|
456
461
|
/**
|
|
457
462
|
* 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.
|
|
@@ -10645,7 +10650,8 @@ class $e270e9f953fcbc58$export$e015ed2f2950f2e3 {
|
|
|
10645
10650
|
breadcrumbs: [],
|
|
10646
10651
|
quick_links: [],
|
|
10647
10652
|
image_urls: [],
|
|
10648
|
-
failed: true
|
|
10653
|
+
failed: true,
|
|
10654
|
+
content_blocks: []
|
|
10649
10655
|
}),
|
|
10650
10656
|
method_: "GET"
|
|
10651
10657
|
});
|
|
@@ -15919,6 +15925,71 @@ function $c3a7faae6f2b93c9$export$7af06a63c5a976c9(el, listing_id, i18n_) {
|
|
|
15919
15925
|
$52FdA$solidjs.onCleanup(disconnect);
|
|
15920
15926
|
}
|
|
15921
15927
|
$52FdA$solidjsweb.delegateEvents(["click"]);
|
|
15928
|
+
var $c19709057a32b2e7$var$_tmpl$ = /*#__PURE__*/$52FdA$solidjsweb.template(`<a><img>`),
|
|
15929
|
+
$c19709057a32b2e7$var$_tmpl$2 = /*#__PURE__*/$52FdA$solidjsweb.template(`<a><video loop>`);
|
|
15930
|
+
function $c19709057a32b2e7$export$780a853d15174484(_ref) {
|
|
15931
|
+
let {
|
|
15932
|
+
contentBlock: contentBlock,
|
|
15933
|
+
router_: router_
|
|
15934
|
+
} = _ref;
|
|
15935
|
+
if (contentBlock.content.type === "image") return () => (() => {
|
|
15936
|
+
var _el$ = $52FdA$solidjsweb.getNextElement($c19709057a32b2e7$var$_tmpl$),
|
|
15937
|
+
_el$2 = _el$.firstChild;
|
|
15938
|
+
$52FdA$solidjsweb.addEventListener(_el$, "click", $52FdA$depictaiutilisharedlatest.catchify(ev => router_.navigate_.go_to_({
|
|
15939
|
+
new_url_: contentBlock.content.link,
|
|
15940
|
+
is_replace_: false,
|
|
15941
|
+
event_: ev
|
|
15942
|
+
})), true);
|
|
15943
|
+
_el$2.style.setProperty("width", "100%");
|
|
15944
|
+
_el$2.style.setProperty("height", "100%");
|
|
15945
|
+
_el$2.style.setProperty("object-fit", "cover");
|
|
15946
|
+
_el$2.style.setProperty("position", "absolute");
|
|
15947
|
+
_el$2.style.setProperty("inset", "0");
|
|
15948
|
+
$52FdA$solidjsweb.effect(_p$ => {
|
|
15949
|
+
var _v$ = contentBlock.content.link,
|
|
15950
|
+
_v$2 = contentBlock.content.url;
|
|
15951
|
+
_v$ !== _p$.e && $52FdA$solidjsweb.setAttribute(_el$, "href", _p$.e = _v$);
|
|
15952
|
+
_v$2 !== _p$.t && $52FdA$solidjsweb.setAttribute(_el$2, "src", _p$.t = _v$2);
|
|
15953
|
+
return _p$;
|
|
15954
|
+
}, {
|
|
15955
|
+
e: undefined,
|
|
15956
|
+
t: undefined
|
|
15957
|
+
});
|
|
15958
|
+
$52FdA$solidjsweb.runHydrationEvents();
|
|
15959
|
+
return _el$;
|
|
15960
|
+
})();
|
|
15961
|
+
if (contentBlock.content.type === "video") return () => (() => {
|
|
15962
|
+
var _el$3 = $52FdA$solidjsweb.getNextElement($c19709057a32b2e7$var$_tmpl$2),
|
|
15963
|
+
_el$4 = _el$3.firstChild;
|
|
15964
|
+
$52FdA$solidjsweb.addEventListener(_el$3, "click", $52FdA$depictaiutilisharedlatest.catchify(ev => router_.navigate_.go_to_({
|
|
15965
|
+
new_url_: contentBlock.content.link,
|
|
15966
|
+
is_replace_: false,
|
|
15967
|
+
event_: ev
|
|
15968
|
+
})), true);
|
|
15969
|
+
$52FdA$solidjsweb.setProperty(_el$4, "controls", false);
|
|
15970
|
+
$52FdA$solidjsweb.setProperty(_el$4, "muted", true);
|
|
15971
|
+
$52FdA$solidjsweb.setProperty(_el$4, "autoplay", true);
|
|
15972
|
+
$52FdA$solidjsweb.setProperty(_el$4, "playsinline", true);
|
|
15973
|
+
_el$4.style.setProperty("width", "100%");
|
|
15974
|
+
_el$4.style.setProperty("height", "100%");
|
|
15975
|
+
_el$4.style.setProperty("object-fit", "cover");
|
|
15976
|
+
_el$4.style.setProperty("position", "absolute");
|
|
15977
|
+
_el$4.style.setProperty("inset", "0");
|
|
15978
|
+
$52FdA$solidjsweb.effect(_p$ => {
|
|
15979
|
+
var _v$3 = contentBlock.content.link,
|
|
15980
|
+
_v$4 = contentBlock.content.url;
|
|
15981
|
+
_v$3 !== _p$.e && $52FdA$solidjsweb.setAttribute(_el$3, "href", _p$.e = _v$3);
|
|
15982
|
+
_v$4 !== _p$.t && $52FdA$solidjsweb.setAttribute(_el$4, "src", _p$.t = _v$4);
|
|
15983
|
+
return _p$;
|
|
15984
|
+
}, {
|
|
15985
|
+
e: undefined,
|
|
15986
|
+
t: undefined
|
|
15987
|
+
});
|
|
15988
|
+
$52FdA$solidjsweb.runHydrationEvents();
|
|
15989
|
+
return _el$3;
|
|
15990
|
+
})();
|
|
15991
|
+
}
|
|
15992
|
+
$52FdA$solidjsweb.delegateEvents(["click"]);
|
|
15922
15993
|
var $ede6c70ecdca46fe$var$_tmpl$ = /*#__PURE__*/$52FdA$solidjsweb.template(`<div class=product-count><!$><!/> <!$><!/>`),
|
|
15923
15994
|
$ede6c70ecdca46fe$var$_tmpl$2 = /*#__PURE__*/$52FdA$solidjsweb.template(`<div>`),
|
|
15924
15995
|
$ede6c70ecdca46fe$var$_tmpl$3 = /*#__PURE__*/$52FdA$solidjsweb.template(`<div class=filter-results-for-one-row><!$><!/><!$><!/>`),
|
|
@@ -16015,6 +16086,24 @@ function $ede6c70ecdca46fe$export$f7d2f673fc2f091d(_ref) {
|
|
|
16015
16086
|
}));
|
|
16016
16087
|
// Make "Get Listing" request to get quicklinks, breadcrumbs, title, etc
|
|
16017
16088
|
const [plp_meta] = $52FdA$solidjs.createResource(meta_query_base, $52FdA$depictaiutilisharedlatest.catchify(query => depict_api_.get_listing(query)));
|
|
16089
|
+
const contentBlocksByRow = $52FdA$solidjs.createMemo(() => {
|
|
16090
|
+
var _plp_meta, _plp_meta$content_blo;
|
|
16091
|
+
if (content_blocks_by_row_()) return content_blocks_by_row_();
|
|
16092
|
+
const content = [];
|
|
16093
|
+
(_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 => {
|
|
16094
|
+
const contentBlock = {
|
|
16095
|
+
span_columns: row.span_columns,
|
|
16096
|
+
span_rows: row.span_rows,
|
|
16097
|
+
position: row.position,
|
|
16098
|
+
content: $c19709057a32b2e7$export$780a853d15174484({
|
|
16099
|
+
contentBlock: row,
|
|
16100
|
+
router_: router_
|
|
16101
|
+
})
|
|
16102
|
+
};
|
|
16103
|
+
content[row.row] = contentBlock;
|
|
16104
|
+
});
|
|
16105
|
+
return content;
|
|
16106
|
+
});
|
|
16018
16107
|
const available_sortings_ = $52FdA$solidjs.createMemo(() => {
|
|
16019
16108
|
var _plp_products_, _plp_products_$sorts;
|
|
16020
16109
|
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 => {
|
|
@@ -16030,13 +16119,13 @@ function $ede6c70ecdca46fe$export$f7d2f673fc2f091d(_ref) {
|
|
|
16030
16119
|
return (_plp_products_2 = plp_products_()) === null || _plp_products_2 === void 0 ? void 0 : _plp_products_2.filters;
|
|
16031
16120
|
});
|
|
16032
16121
|
const title = $52FdA$solidjs.createMemo(() => {
|
|
16033
|
-
var
|
|
16034
|
-
return (
|
|
16122
|
+
var _plp_meta2;
|
|
16123
|
+
return (_plp_meta2 = plp_meta()) === null || _plp_meta2 === void 0 ? void 0 : _plp_meta2.title;
|
|
16035
16124
|
});
|
|
16036
16125
|
const crumb_data_ = $ede6c70ecdca46fe$var$add_us_to_crumbs(plp_meta);
|
|
16037
16126
|
const quicklinks_data_ = $52FdA$solidjs.createMemo(() => {
|
|
16038
|
-
var
|
|
16039
|
-
return (
|
|
16127
|
+
var _plp_meta3;
|
|
16128
|
+
return (_plp_meta3 = plp_meta()) === null || _plp_meta3 === void 0 ? void 0 : _plp_meta3.quick_links;
|
|
16040
16129
|
});
|
|
16041
16130
|
const [sort_or_filter_open_, set_sort_or_filter_open_] = $52FdA$solidjs.createSignal(false);
|
|
16042
16131
|
const [desktop_filter_elements_, set_desktop_filter_elements] = $52FdA$solidjs.createSignal();
|
|
@@ -16303,7 +16392,7 @@ function $ede6c70ecdca46fe$export$f7d2f673fc2f091d(_ref) {
|
|
|
16303
16392
|
product_card_template_: product_card_template_,
|
|
16304
16393
|
sort_or_filter_open_: sort_or_filter_open_,
|
|
16305
16394
|
desktop_filter_elements_: desktop_filter_elements_,
|
|
16306
|
-
content_blocks_by_row_:
|
|
16395
|
+
content_blocks_by_row_: contentBlocksByRow,
|
|
16307
16396
|
ConfiguredScrollStatus_: ConfiguredScrollStatus_,
|
|
16308
16397
|
id_currently_querying_for_: id_to_query_for_,
|
|
16309
16398
|
no_results_options_: {
|
|
@@ -16348,8 +16437,8 @@ function $ede6c70ecdca46fe$export$f7d2f673fc2f091d(_ref) {
|
|
|
16348
16437
|
function $ede6c70ecdca46fe$var$add_us_to_crumbs(plp_meta) {
|
|
16349
16438
|
const href_accessor = $52FdA$depictaiutilisharedlatest.use_href_accessor();
|
|
16350
16439
|
return $52FdA$solidjs.createMemo(() => {
|
|
16351
|
-
var
|
|
16352
|
-
const api_value = (
|
|
16440
|
+
var _plp_meta4;
|
|
16441
|
+
const api_value = (_plp_meta4 = plp_meta()) === null || _plp_meta4 === void 0 ? void 0 : _plp_meta4.breadcrumbs;
|
|
16353
16442
|
if (!api_value) return api_value;
|
|
16354
16443
|
return [...api_value, $52FdA$solidjs.mergeProps(plp_meta(), {
|
|
16355
16444
|
get page_url() {
|
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.
|
|
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
|
-
}):
|
|
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
|
|
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
|
|
1566
|
+
}): import("@depict-ai/utilishared").Node_Array;
|
|
1560
1567
|
export type { SearchFilter } from "@depict-ai/types/api/SearchRequestV3";
|
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.
|
|
13
|
+
const $8db9a15135765c11$export$83d89fbfd8236492 = "4.7.31";
|
|
14
14
|
function $00a5b94f0c11efbb$export$d9f36cf74e24d595(media_query) {
|
|
15
15
|
const signal = $8tj43$createSignal(false);
|
|
16
16
|
$8tj43$onCleanup($8tj43$javascript_media_query(media_query, _ref => {
|
|
@@ -282,7 +282,7 @@ function $ff7feae4dddd6073$export$791ef57e62e21c3f(_ref) {
|
|
|
282
282
|
return $8tj43$createMemo(() => $ff7feae4dddd6073$export$92aa5d691d588f3f({
|
|
283
283
|
wrapped_blocks_: get_wrapped_blocks_(),
|
|
284
284
|
n_cols_currently_showing_: n_cols_currently_showing_()
|
|
285
|
-
}));
|
|
285
|
+
}).content_blocks_by_index_);
|
|
286
286
|
}
|
|
287
287
|
function $ff7feae4dddd6073$export$92aa5d691d588f3f(_ref2) {
|
|
288
288
|
let {
|
|
@@ -290,13 +290,15 @@ function $ff7feae4dddd6073$export$92aa5d691d588f3f(_ref2) {
|
|
|
290
290
|
n_cols_currently_showing_: n_cols_currently_showing_
|
|
291
291
|
} = _ref2;
|
|
292
292
|
// This computation should be quite cheap since it just moves around things into an array
|
|
293
|
-
const
|
|
293
|
+
const content_blocks_by_index_ = [];
|
|
294
294
|
const constructed_block_arrays = new WeakSet();
|
|
295
295
|
// Need to keep track of products displaced by blocks above when mapping rows to indexes in the actual grid
|
|
296
|
-
const
|
|
296
|
+
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
|
|
297
297
|
if (!n_cols_currently_showing_)
|
|
298
298
|
// Nope out of here if we don't know how many columns are showing
|
|
299
|
-
return
|
|
299
|
+
return {
|
|
300
|
+
content_blocks_by_index_: content_blocks_by_index_
|
|
301
|
+
};
|
|
300
302
|
for (let i = 0; i < wrapped_blocks_.length; i++) {
|
|
301
303
|
// i = row to show at
|
|
302
304
|
const block = wrapped_blocks_[i];
|
|
@@ -313,25 +315,25 @@ function $ff7feae4dddd6073$export$92aa5d691d588f3f(_ref2) {
|
|
|
313
315
|
// Calculate displacement of us by content blocks above us
|
|
314
316
|
let displacement_by_added_blocks = 0;
|
|
315
317
|
for (let j = 0; j < i; j++) {
|
|
316
|
-
const row =
|
|
318
|
+
const row = displaced_products_[j];
|
|
317
319
|
if (row === undefined) continue; // there were no blocks in this row
|
|
318
320
|
let displaced_items_in_row;
|
|
319
321
|
if (typeof row === "number") displaced_items_in_row = row;else {
|
|
320
322
|
displaced_items_in_row = row.filter(item => item).length;
|
|
321
|
-
|
|
323
|
+
displaced_products_[j] = displaced_items_in_row;
|
|
322
324
|
}
|
|
323
325
|
displacement_by_added_blocks += displaced_items_in_row;
|
|
324
326
|
}
|
|
325
327
|
const index_of_us_in_row = target_index - index_of_first_item_in_row;
|
|
326
328
|
for (let j = 0; j < index_of_us_in_row; j++) {
|
|
327
|
-
var
|
|
328
|
-
if ((
|
|
329
|
+
var _displaced_products_$;
|
|
330
|
+
if ((_displaced_products_$ = displaced_products_[i]) !== null && _displaced_products_$ !== void 0 && _displaced_products_$[j])
|
|
329
331
|
// Add blocks in our *current* row to the displacement, but only the ones to our left
|
|
330
332
|
displacement_by_added_blocks++;
|
|
331
333
|
}
|
|
332
334
|
// Add block to output array at the correct index
|
|
333
335
|
const final_target_index = target_index - displacement_by_added_blocks;
|
|
334
|
-
const existing_block =
|
|
336
|
+
const existing_block = content_blocks_by_index_[final_target_index];
|
|
335
337
|
const block_content = block.content;
|
|
336
338
|
// 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
|
|
337
339
|
if (existing_block) {
|
|
@@ -340,17 +342,20 @@ function $ff7feae4dddd6073$export$92aa5d691d588f3f(_ref2) {
|
|
|
340
342
|
existing_block.push(block_content);else {
|
|
341
343
|
const array = [existing_block, block_content];
|
|
342
344
|
constructed_block_arrays.add(array);
|
|
343
|
-
|
|
345
|
+
content_blocks_by_index_[final_target_index] = array;
|
|
344
346
|
}
|
|
345
|
-
} else
|
|
347
|
+
} else content_blocks_by_index_[final_target_index] = block_content;
|
|
346
348
|
// Update displacement
|
|
347
349
|
for (let j = 0; j < span_rows; j++) {
|
|
348
350
|
var _ref3;
|
|
349
|
-
const row =
|
|
351
|
+
const row = displaced_products_[_ref3 = i + j] || (displaced_products_[_ref3] = []);
|
|
350
352
|
for (let k = index_of_us_in_row; k < index_of_us_in_row + span_columns; k++) row[k] = true;
|
|
351
353
|
}
|
|
352
354
|
}
|
|
353
|
-
return
|
|
355
|
+
return {
|
|
356
|
+
content_blocks_by_index_: content_blocks_by_index_,
|
|
357
|
+
displaced_products_: displaced_products_
|
|
358
|
+
};
|
|
354
359
|
}
|
|
355
360
|
/**
|
|
356
361
|
* 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.
|
|
@@ -10544,7 +10549,8 @@ class $284849364a6ef73a$export$e015ed2f2950f2e3 {
|
|
|
10544
10549
|
breadcrumbs: [],
|
|
10545
10550
|
quick_links: [],
|
|
10546
10551
|
image_urls: [],
|
|
10547
|
-
failed: true
|
|
10552
|
+
failed: true,
|
|
10553
|
+
content_blocks: []
|
|
10548
10554
|
}),
|
|
10549
10555
|
method_: "GET"
|
|
10550
10556
|
});
|
|
@@ -15818,6 +15824,71 @@ function $1145661fd3ca5519$export$7af06a63c5a976c9(el, listing_id, i18n_) {
|
|
|
15818
15824
|
$8tj43$onCleanup(disconnect);
|
|
15819
15825
|
}
|
|
15820
15826
|
$8tj43$delegateEvents(["click"]);
|
|
15827
|
+
var $3b772ef9a35560fe$var$_tmpl$ = /*#__PURE__*/$8tj43$template(`<a><img>`),
|
|
15828
|
+
$3b772ef9a35560fe$var$_tmpl$2 = /*#__PURE__*/$8tj43$template(`<a><video loop>`);
|
|
15829
|
+
function $3b772ef9a35560fe$export$780a853d15174484(_ref) {
|
|
15830
|
+
let {
|
|
15831
|
+
contentBlock: contentBlock,
|
|
15832
|
+
router_: router_
|
|
15833
|
+
} = _ref;
|
|
15834
|
+
if (contentBlock.content.type === "image") return () => (() => {
|
|
15835
|
+
var _el$ = $8tj43$getNextElement($3b772ef9a35560fe$var$_tmpl$),
|
|
15836
|
+
_el$2 = _el$.firstChild;
|
|
15837
|
+
$8tj43$addEventListener(_el$, "click", $8tj43$catchify(ev => router_.navigate_.go_to_({
|
|
15838
|
+
new_url_: contentBlock.content.link,
|
|
15839
|
+
is_replace_: false,
|
|
15840
|
+
event_: ev
|
|
15841
|
+
})), true);
|
|
15842
|
+
_el$2.style.setProperty("width", "100%");
|
|
15843
|
+
_el$2.style.setProperty("height", "100%");
|
|
15844
|
+
_el$2.style.setProperty("object-fit", "cover");
|
|
15845
|
+
_el$2.style.setProperty("position", "absolute");
|
|
15846
|
+
_el$2.style.setProperty("inset", "0");
|
|
15847
|
+
$8tj43$effect(_p$ => {
|
|
15848
|
+
var _v$ = contentBlock.content.link,
|
|
15849
|
+
_v$2 = contentBlock.content.url;
|
|
15850
|
+
_v$ !== _p$.e && $8tj43$setAttribute(_el$, "href", _p$.e = _v$);
|
|
15851
|
+
_v$2 !== _p$.t && $8tj43$setAttribute(_el$2, "src", _p$.t = _v$2);
|
|
15852
|
+
return _p$;
|
|
15853
|
+
}, {
|
|
15854
|
+
e: undefined,
|
|
15855
|
+
t: undefined
|
|
15856
|
+
});
|
|
15857
|
+
$8tj43$runHydrationEvents();
|
|
15858
|
+
return _el$;
|
|
15859
|
+
})();
|
|
15860
|
+
if (contentBlock.content.type === "video") return () => (() => {
|
|
15861
|
+
var _el$3 = $8tj43$getNextElement($3b772ef9a35560fe$var$_tmpl$2),
|
|
15862
|
+
_el$4 = _el$3.firstChild;
|
|
15863
|
+
$8tj43$addEventListener(_el$3, "click", $8tj43$catchify(ev => router_.navigate_.go_to_({
|
|
15864
|
+
new_url_: contentBlock.content.link,
|
|
15865
|
+
is_replace_: false,
|
|
15866
|
+
event_: ev
|
|
15867
|
+
})), true);
|
|
15868
|
+
$8tj43$setProperty(_el$4, "controls", false);
|
|
15869
|
+
$8tj43$setProperty(_el$4, "muted", true);
|
|
15870
|
+
$8tj43$setProperty(_el$4, "autoplay", true);
|
|
15871
|
+
$8tj43$setProperty(_el$4, "playsinline", true);
|
|
15872
|
+
_el$4.style.setProperty("width", "100%");
|
|
15873
|
+
_el$4.style.setProperty("height", "100%");
|
|
15874
|
+
_el$4.style.setProperty("object-fit", "cover");
|
|
15875
|
+
_el$4.style.setProperty("position", "absolute");
|
|
15876
|
+
_el$4.style.setProperty("inset", "0");
|
|
15877
|
+
$8tj43$effect(_p$ => {
|
|
15878
|
+
var _v$3 = contentBlock.content.link,
|
|
15879
|
+
_v$4 = contentBlock.content.url;
|
|
15880
|
+
_v$3 !== _p$.e && $8tj43$setAttribute(_el$3, "href", _p$.e = _v$3);
|
|
15881
|
+
_v$4 !== _p$.t && $8tj43$setAttribute(_el$4, "src", _p$.t = _v$4);
|
|
15882
|
+
return _p$;
|
|
15883
|
+
}, {
|
|
15884
|
+
e: undefined,
|
|
15885
|
+
t: undefined
|
|
15886
|
+
});
|
|
15887
|
+
$8tj43$runHydrationEvents();
|
|
15888
|
+
return _el$3;
|
|
15889
|
+
})();
|
|
15890
|
+
}
|
|
15891
|
+
$8tj43$delegateEvents(["click"]);
|
|
15821
15892
|
var $4b4b262708b516ee$var$_tmpl$ = /*#__PURE__*/$8tj43$template(`<div class=product-count><!$><!/> <!$><!/>`),
|
|
15822
15893
|
$4b4b262708b516ee$var$_tmpl$2 = /*#__PURE__*/$8tj43$template(`<div>`),
|
|
15823
15894
|
$4b4b262708b516ee$var$_tmpl$3 = /*#__PURE__*/$8tj43$template(`<div class=filter-results-for-one-row><!$><!/><!$><!/>`),
|
|
@@ -15914,6 +15985,24 @@ function $4b4b262708b516ee$export$f7d2f673fc2f091d(_ref) {
|
|
|
15914
15985
|
}));
|
|
15915
15986
|
// Make "Get Listing" request to get quicklinks, breadcrumbs, title, etc
|
|
15916
15987
|
const [plp_meta] = $8tj43$createResource(meta_query_base, $8tj43$catchify(query => depict_api_.get_listing(query)));
|
|
15988
|
+
const contentBlocksByRow = $8tj43$createMemo(() => {
|
|
15989
|
+
var _plp_meta, _plp_meta$content_blo;
|
|
15990
|
+
if (content_blocks_by_row_()) return content_blocks_by_row_();
|
|
15991
|
+
const content = [];
|
|
15992
|
+
(_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 => {
|
|
15993
|
+
const contentBlock = {
|
|
15994
|
+
span_columns: row.span_columns,
|
|
15995
|
+
span_rows: row.span_rows,
|
|
15996
|
+
position: row.position,
|
|
15997
|
+
content: $3b772ef9a35560fe$export$780a853d15174484({
|
|
15998
|
+
contentBlock: row,
|
|
15999
|
+
router_: router_
|
|
16000
|
+
})
|
|
16001
|
+
};
|
|
16002
|
+
content[row.row] = contentBlock;
|
|
16003
|
+
});
|
|
16004
|
+
return content;
|
|
16005
|
+
});
|
|
15917
16006
|
const available_sortings_ = $8tj43$createMemo(() => {
|
|
15918
16007
|
var _plp_products_, _plp_products_$sorts;
|
|
15919
16008
|
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 => {
|
|
@@ -15929,13 +16018,13 @@ function $4b4b262708b516ee$export$f7d2f673fc2f091d(_ref) {
|
|
|
15929
16018
|
return (_plp_products_2 = plp_products_()) === null || _plp_products_2 === void 0 ? void 0 : _plp_products_2.filters;
|
|
15930
16019
|
});
|
|
15931
16020
|
const title = $8tj43$createMemo(() => {
|
|
15932
|
-
var
|
|
15933
|
-
return (
|
|
16021
|
+
var _plp_meta2;
|
|
16022
|
+
return (_plp_meta2 = plp_meta()) === null || _plp_meta2 === void 0 ? void 0 : _plp_meta2.title;
|
|
15934
16023
|
});
|
|
15935
16024
|
const crumb_data_ = $4b4b262708b516ee$var$add_us_to_crumbs(plp_meta);
|
|
15936
16025
|
const quicklinks_data_ = $8tj43$createMemo(() => {
|
|
15937
|
-
var
|
|
15938
|
-
return (
|
|
16026
|
+
var _plp_meta3;
|
|
16027
|
+
return (_plp_meta3 = plp_meta()) === null || _plp_meta3 === void 0 ? void 0 : _plp_meta3.quick_links;
|
|
15939
16028
|
});
|
|
15940
16029
|
const [sort_or_filter_open_, set_sort_or_filter_open_] = $8tj43$createSignal(false);
|
|
15941
16030
|
const [desktop_filter_elements_, set_desktop_filter_elements] = $8tj43$createSignal();
|
|
@@ -16202,7 +16291,7 @@ function $4b4b262708b516ee$export$f7d2f673fc2f091d(_ref) {
|
|
|
16202
16291
|
product_card_template_: product_card_template_,
|
|
16203
16292
|
sort_or_filter_open_: sort_or_filter_open_,
|
|
16204
16293
|
desktop_filter_elements_: desktop_filter_elements_,
|
|
16205
|
-
content_blocks_by_row_:
|
|
16294
|
+
content_blocks_by_row_: contentBlocksByRow,
|
|
16206
16295
|
ConfiguredScrollStatus_: ConfiguredScrollStatus_,
|
|
16207
16296
|
id_currently_querying_for_: id_to_query_for_,
|
|
16208
16297
|
no_results_options_: {
|
|
@@ -16247,8 +16336,8 @@ function $4b4b262708b516ee$export$f7d2f673fc2f091d(_ref) {
|
|
|
16247
16336
|
function $4b4b262708b516ee$var$add_us_to_crumbs(plp_meta) {
|
|
16248
16337
|
const href_accessor = $8tj43$use_href_accessor1();
|
|
16249
16338
|
return $8tj43$createMemo(() => {
|
|
16250
|
-
var
|
|
16251
|
-
const api_value = (
|
|
16339
|
+
var _plp_meta4;
|
|
16340
|
+
const api_value = (_plp_meta4 = plp_meta()) === null || _plp_meta4 === void 0 ? void 0 : _plp_meta4.breadcrumbs;
|
|
16252
16341
|
if (!api_value) return api_value;
|
|
16253
16342
|
return [...api_value, $8tj43$mergeProps(plp_meta(), {
|
|
16254
16343
|
get page_url() {
|