@depict-ai/ui 4.7.30 → 4.7.32
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 +132 -25
- package/ES10/index.d.ts +12 -4
- package/ES10/index.js +132 -25
- package/latest/index.cjs +126 -24
- package/latest/index.d.ts +12 -4
- package/latest/index.js +126 -24
- package/package.json +1 -1
- package/server/ES10/index.cjs +103 -20
- package/server/ES10/index.d.ts +12 -4
- package/server/ES10/index.js +103 -20
- package/server/latest/index.cjs +97 -19
- package/server/latest/index.d.ts +12 -4
- package/server/latest/index.js +97 -19
package/server/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.32";
|
|
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 => {
|
|
@@ -179,7 +179,7 @@ function $b8a8d61b3ec5f5ac$export$3f37af283f8fb843(props) {
|
|
|
179
179
|
}
|
|
180
180
|
});
|
|
181
181
|
}
|
|
182
|
-
var $f8f375d6245ffff2$var$_tmpl$ = ["<div", ' class="
|
|
182
|
+
var $f8f375d6245ffff2$var$_tmpl$ = ["<div", ' class="', '" style="', '">', "</div>"];
|
|
183
183
|
function $f8f375d6245ffff2$export$791ef57e62e21c3f(_ref) {
|
|
184
184
|
let {
|
|
185
185
|
content_blocks_: incoming_content_blocks,
|
|
@@ -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
|
|
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
|
|
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
|
|
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 =
|
|
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
|
-
|
|
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
|
|
262
|
-
if ((
|
|
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 =
|
|
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
|
-
|
|
279
|
+
content_blocks_by_index_[final_target_index] = array;
|
|
278
280
|
}
|
|
279
|
-
} else
|
|
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 =
|
|
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
|
|
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.
|
|
@@ -306,7 +311,7 @@ function $f8f375d6245ffff2$var$wrap_blocks_in_div(rendered_content_blocks, max_s
|
|
|
306
311
|
return !rendering_delayed();
|
|
307
312
|
},
|
|
308
313
|
get children() {
|
|
309
|
-
return $3hooq$solidjsweb.ssr($f8f375d6245ffff2$var$_tmpl$, $3hooq$solidjsweb.ssrHydrationKey(), "grid-column:" + "span ".concat($3hooq$solidjsweb.escape(final_span_columns(), true)) + (";grid-row:" + "span ".concat($3hooq$solidjsweb.escape(final_span_rows(), true))) + (";spans_columns_variable_name:" + $3hooq$solidjsweb.escape(final_span_columns(), true)), $3hooq$solidjsweb.escape($3hooq$solidjsweb.createComponent($f8f375d6245ffff2$var$RenderContent, {
|
|
314
|
+
return $3hooq$solidjsweb.ssr($f8f375d6245ffff2$var$_tmpl$, $3hooq$solidjsweb.ssrHydrationKey(), "content-block-wrapper ".concat(final_span_columns() === max_span_columns() ? "spans-whole-row" : ""), "grid-column:" + "span ".concat($3hooq$solidjsweb.escape(final_span_columns(), true)) + (";grid-row:" + "span ".concat($3hooq$solidjsweb.escape(final_span_rows(), true))) + (";spans_columns_variable_name:" + $3hooq$solidjsweb.escape(final_span_columns(), true)), $3hooq$solidjsweb.escape($3hooq$solidjsweb.createComponent($f8f375d6245ffff2$var$RenderContent, {
|
|
310
315
|
get content() {
|
|
311
316
|
return block.content;
|
|
312
317
|
}
|
|
@@ -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
|
});
|
|
@@ -8971,7 +8977,8 @@ class $9cbefc32b9dab36d$export$f34314aa9505732e {
|
|
|
8971
8977
|
// Please make sure that the signal created by below line always updates AFTER selected_filters_ updates on a "popstate" event. If the filter cache is popped before the selected filters are the code in create_modified_filters() is going to re-calculate search_local_filter_cache without knowing the real value of search_selected_filters, and we'll end up with too few filters in search_local_filter_cache in some cases
|
|
8972
8978
|
local_filter_cache: [],
|
|
8973
8979
|
expanded_hierarchical_filters: [],
|
|
8974
|
-
scroll_restoration_data: []
|
|
8980
|
+
scroll_restoration_data: [],
|
|
8981
|
+
history_content_blocks: []
|
|
8975
8982
|
}),
|
|
8976
8983
|
router_: $parcel$interopDefault($3hooq$babelruntimehelpersclassPrivateFieldGet)(this, $9cbefc32b9dab36d$var$_router),
|
|
8977
8984
|
prefix_: "category" + unique_instance_key_for_state + "_"
|
|
@@ -13290,6 +13297,78 @@ function $8b366fdb0c76194d$var$clear_if_opened_new_tab_with_sideways_url_params_
|
|
|
13290
13297
|
});
|
|
13291
13298
|
tracking_function_for_plp_results(plp_results_);
|
|
13292
13299
|
}
|
|
13300
|
+
var $c19709057a32b2e7$var$_tmpl$ = ["<a", ' class="d-standard-content-wrapper"', "><video", ' muted="" autoplay="" playsinline="" loop class="d-standard-content"></video></a>'];
|
|
13301
|
+
function $c19709057a32b2e7$export$780a853d15174484(_ref) {
|
|
13302
|
+
let {
|
|
13303
|
+
contentBlock_: {
|
|
13304
|
+
content: {
|
|
13305
|
+
link: link,
|
|
13306
|
+
type: type,
|
|
13307
|
+
url: mediaUrl
|
|
13308
|
+
}
|
|
13309
|
+
},
|
|
13310
|
+
router_: router_
|
|
13311
|
+
} = _ref;
|
|
13312
|
+
if (type === "image") {
|
|
13313
|
+
const [wrapperSize, setWrapperSize] = $3hooq$solidjs.createSignal();
|
|
13314
|
+
return $3hooq$solidjsweb.createComponent((0, $3hooq$solidjsweb.Dynamic), $3hooq$solidjsweb.mergeProps({
|
|
13315
|
+
component: link ? "a" : "div",
|
|
13316
|
+
"class": "d-standard-content-wrapper",
|
|
13317
|
+
get onClick() {
|
|
13318
|
+
return $3hooq$depictaiutilisharedlatest.catchify(ev => link && router_.navigate_.go_to_({
|
|
13319
|
+
new_url_: link,
|
|
13320
|
+
is_replace_: false,
|
|
13321
|
+
event_: ev
|
|
13322
|
+
}));
|
|
13323
|
+
}
|
|
13324
|
+
}, link && {
|
|
13325
|
+
href: link
|
|
13326
|
+
}, {
|
|
13327
|
+
get children() {
|
|
13328
|
+
return $3hooq$solidjsweb.createComponent((0, $858fdcf73148519f$export$6e5611bc7e57e477), {
|
|
13329
|
+
get size() {
|
|
13330
|
+
return $3hooq$solidjs.createMemo(() => {
|
|
13331
|
+
var _wrapperSize;
|
|
13332
|
+
return ((_wrapperSize = wrapperSize()) === null || _wrapperSize === void 0 ? void 0 : _wrapperSize()) || 0;
|
|
13333
|
+
});
|
|
13334
|
+
},
|
|
13335
|
+
src: mediaUrl,
|
|
13336
|
+
"class": "d-standard-content"
|
|
13337
|
+
});
|
|
13338
|
+
}
|
|
13339
|
+
}));
|
|
13340
|
+
}
|
|
13341
|
+
if (type === "video") {
|
|
13342
|
+
const pageVisible = $e7a7d2fe8a8217d8$export$54299a3c81f5425();
|
|
13343
|
+
return $3hooq$solidjsweb.ssr($c19709057a32b2e7$var$_tmpl$, $3hooq$solidjsweb.ssrHydrationKey(), $3hooq$solidjsweb.ssrAttribute("href", $3hooq$solidjsweb.escape(link, true), false), $3hooq$solidjsweb.ssrAttribute("src", $3hooq$solidjsweb.escape(mediaUrl, true), false));
|
|
13344
|
+
}
|
|
13345
|
+
}
|
|
13346
|
+
function $0c035bbe7e30b438$export$7a92d995f1bf3592(history_content_blocks_, plp_meta, content_blocks_by_row_, router_) {
|
|
13347
|
+
const [historyContentBlocks, setHistoryContentBlocks] = history_content_blocks_;
|
|
13348
|
+
$3hooq$solidjs.createEffect(() => {
|
|
13349
|
+
var _plp_meta;
|
|
13350
|
+
const serverContentBlock = (_plp_meta = plp_meta()) === null || _plp_meta === void 0 ? void 0 : _plp_meta.content_blocks;
|
|
13351
|
+
if (serverContentBlock && JSON.stringify(serverContentBlock) !== JSON.stringify(historyContentBlocks())) setHistoryContentBlocks(serverContentBlock);
|
|
13352
|
+
});
|
|
13353
|
+
const contentBlocksByRow = $3hooq$solidjs.createMemo(() => {
|
|
13354
|
+
if (content_blocks_by_row_()) return content_blocks_by_row_();
|
|
13355
|
+
const content = [];
|
|
13356
|
+
historyContentBlocks().forEach(row => {
|
|
13357
|
+
const contentBlock = {
|
|
13358
|
+
span_columns: row.span_columns,
|
|
13359
|
+
span_rows: row.span_rows,
|
|
13360
|
+
position: row.position,
|
|
13361
|
+
content: () => $3hooq$solidjsweb.createComponent((0, $c19709057a32b2e7$export$780a853d15174484), {
|
|
13362
|
+
contentBlock_: row,
|
|
13363
|
+
router_: router_
|
|
13364
|
+
})
|
|
13365
|
+
};
|
|
13366
|
+
content[row.row] = contentBlock;
|
|
13367
|
+
});
|
|
13368
|
+
return content;
|
|
13369
|
+
});
|
|
13370
|
+
return contentBlocksByRow;
|
|
13371
|
+
}
|
|
13293
13372
|
var $ede6c70ecdca46fe$var$_tmpl$ = ["<div", ' class="product-count"><!--$-->', "<!--/--> <!--$-->", "<!--/--></div>"],
|
|
13294
13373
|
$ede6c70ecdca46fe$var$_tmpl$2 = ["<div", "></div>"],
|
|
13295
13374
|
$ede6c70ecdca46fe$var$_tmpl$3 = ["<div", ' class="filter-results-for-one-row"><!--$-->', "<!--/--><!--$-->", "<!--/--></div>"],
|
|
@@ -13318,6 +13397,7 @@ function $ede6c70ecdca46fe$export$f7d2f673fc2f091d(_ref) {
|
|
|
13318
13397
|
show_breadcrumbs_: show_breadcrumbs_,
|
|
13319
13398
|
layout_options_: layout_options_,
|
|
13320
13399
|
scroll_restoration_data_: scroll_restoration_data_,
|
|
13400
|
+
history_content_blocks_: history_content_blocks_,
|
|
13321
13401
|
product_card_template_: product_card_template_,
|
|
13322
13402
|
sideways_filter_clearing_flag_: sideways_filter_clearing_flag_,
|
|
13323
13403
|
sorting_query_param_: sorting_query_param_,
|
|
@@ -13386,6 +13466,7 @@ function $ede6c70ecdca46fe$export$f7d2f673fc2f091d(_ref) {
|
|
|
13386
13466
|
}));
|
|
13387
13467
|
// Make "Get Listing" request to get quicklinks, breadcrumbs, title, etc
|
|
13388
13468
|
const [plp_meta] = $3hooq$solidjs.createResource(meta_query_base, $3hooq$depictaiutilisharedlatest.catchify(query => depict_api_.get_listing(query)));
|
|
13469
|
+
const contentBlocksByRow = $0c035bbe7e30b438$export$7a92d995f1bf3592(history_content_blocks_, plp_meta, content_blocks_by_row_, router_);
|
|
13389
13470
|
const available_sortings_ = $3hooq$solidjs.createMemo(() => {
|
|
13390
13471
|
var _plp_products_, _plp_products_$sorts;
|
|
13391
13472
|
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 => {
|
|
@@ -13632,7 +13713,7 @@ function $ede6c70ecdca46fe$export$f7d2f673fc2f091d(_ref) {
|
|
|
13632
13713
|
product_card_template_: product_card_template_,
|
|
13633
13714
|
sort_or_filter_open_: sort_or_filter_open_,
|
|
13634
13715
|
desktop_filter_elements_: desktop_filter_elements_,
|
|
13635
|
-
content_blocks_by_row_:
|
|
13716
|
+
content_blocks_by_row_: contentBlocksByRow,
|
|
13636
13717
|
ConfiguredScrollStatus_: ConfiguredScrollStatus_,
|
|
13637
13718
|
id_currently_querying_for_: id_to_query_for_,
|
|
13638
13719
|
no_results_options_: {
|
|
@@ -13724,7 +13805,8 @@ function $c10e33c4681f8c9b$export$e2bf8ce7779e827e(props) {
|
|
|
13724
13805
|
sorting_open: category_sorting_open_,
|
|
13725
13806
|
expanded_filters: expanded_filters_,
|
|
13726
13807
|
expanded_hierarchical_filters: expanded_hierarchical_filters_,
|
|
13727
|
-
scroll_restoration_data: scroll_restoration_data_
|
|
13808
|
+
scroll_restoration_data: scroll_restoration_data_,
|
|
13809
|
+
history_content_blocks: history_content_blocks_
|
|
13728
13810
|
} = depict_category.historyStateSignals_;
|
|
13729
13811
|
const {
|
|
13730
13812
|
current_sorting_: current_sorting_,
|
|
@@ -13776,6 +13858,7 @@ function $c10e33c4681f8c9b$export$e2bf8ce7779e827e(props) {
|
|
|
13776
13858
|
sideways_filter_clearing_flag_: sideways_filter_clearing_flag_,
|
|
13777
13859
|
content_blocks_by_row_: () => props.content_blocks_by_row,
|
|
13778
13860
|
scroll_restoration_data_: scroll_restoration_data_,
|
|
13861
|
+
history_content_blocks_: history_content_blocks_,
|
|
13779
13862
|
layout_options_: $3hooq$solidjs.createMemo(() => ({
|
|
13780
13863
|
cols_at_size: $5401a6698b0c0658$export$6daf8749b65a1b77(props.cols_at_size),
|
|
13781
13864
|
...grid_spacing_override(),
|
package/server/ES10/index.d.ts
CHANGED
|
@@ -3,7 +3,7 @@ import { report, Amazing_Slider, Display, useExpandingContainer, ColsAtSize, Ele
|
|
|
3
3
|
import { SearchFilter, SearchRequestV3, SortModel } from "@depict-ai/types/api/SearchRequestV3";
|
|
4
4
|
import { ContentLink, SearchResponse, SearchFilter as _SearchFilter1 } from "@depict-ai/types/api/SearchResponse";
|
|
5
5
|
import { Ancestors, ListingSuggestion, SearchSuggestionsResponseV3 } from "@depict-ai/types/api/SearchSuggestionsResponseV3";
|
|
6
|
-
import { ProductListing, GetListingResponse } from "@depict-ai/types/api/GetListingResponse";
|
|
6
|
+
import { ProductListing, GetListingResponse, ContentBlock as _ContentBlock1 } from "@depict-ai/types/api/GetListingResponse";
|
|
7
7
|
import { ProductListingResponseV3, SearchFilter as _SearchFilter2 } from "@depict-ai/types/api/ProductListingResponseV3";
|
|
8
8
|
import { SearchSuggestionsRequestV3 } from "@depict-ai/types/api/SearchSuggestionsRequestV3";
|
|
9
9
|
import { ProductListingRequestV3 } from "@depict-ai/types/api/ProductListingRequestV3";
|
|
@@ -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.32";
|
|
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_: (Awaited<T> | T[])[];
|
|
112
|
+
readonly displaced_products_?: undefined;
|
|
113
|
+
} | {
|
|
114
|
+
readonly content_blocks_by_index_: (Awaited<T> | T[])[];
|
|
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
|
*/
|
|
@@ -1327,6 +1334,7 @@ export class DepictCategory<InputDisplay extends Display, OutputDisplay extends
|
|
|
1327
1334
|
expanded_: boolean;
|
|
1328
1335
|
}[]>;
|
|
1329
1336
|
scroll_restoration_data: Signal<ScrollRestorationData>;
|
|
1337
|
+
history_content_blocks: Signal<_ContentBlock1[]>;
|
|
1330
1338
|
};
|
|
1331
1339
|
/**
|
|
1332
1340
|
* Signal representing the currently selected filters. Will update to always reflect the state of the current URL. Calling the setter triggers a navigation (replaceState) to an updated URL.
|
package/server/ES10/index.js
CHANGED
|
@@ -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.
|
|
13
|
+
const $8db9a15135765c11$export$83d89fbfd8236492 = "4.7.32";
|
|
14
14
|
function $00a5b94f0c11efbb$export$d9f36cf74e24d595(media_query) {
|
|
15
15
|
const signal = $b8hua$createSignal(false);
|
|
16
16
|
$b8hua$onCleanup($b8hua$javascript_media_query(media_query, _ref => {
|
|
@@ -78,7 +78,7 @@ function $3ab4aa97880fb88d$export$3f37af283f8fb843(props) {
|
|
|
78
78
|
}
|
|
79
79
|
});
|
|
80
80
|
}
|
|
81
|
-
var $ff7feae4dddd6073$var$_tmpl$ = ["<div", ' class="
|
|
81
|
+
var $ff7feae4dddd6073$var$_tmpl$ = ["<div", ' class="', '" style="', '">', "</div>"];
|
|
82
82
|
function $ff7feae4dddd6073$export$791ef57e62e21c3f(_ref) {
|
|
83
83
|
let {
|
|
84
84
|
content_blocks_: incoming_content_blocks,
|
|
@@ -115,7 +115,7 @@ function $ff7feae4dddd6073$export$791ef57e62e21c3f(_ref) {
|
|
|
115
115
|
return $b8hua$createMemo(() => $ff7feae4dddd6073$export$92aa5d691d588f3f({
|
|
116
116
|
wrapped_blocks_: get_wrapped_blocks_(),
|
|
117
117
|
n_cols_currently_showing_: n_cols_currently_showing_()
|
|
118
|
-
}));
|
|
118
|
+
}).content_blocks_by_index_);
|
|
119
119
|
}
|
|
120
120
|
function $ff7feae4dddd6073$export$92aa5d691d588f3f(_ref2) {
|
|
121
121
|
let {
|
|
@@ -123,13 +123,15 @@ function $ff7feae4dddd6073$export$92aa5d691d588f3f(_ref2) {
|
|
|
123
123
|
n_cols_currently_showing_: n_cols_currently_showing_
|
|
124
124
|
} = _ref2;
|
|
125
125
|
// This computation should be quite cheap since it just moves around things into an array
|
|
126
|
-
const
|
|
126
|
+
const content_blocks_by_index_ = [];
|
|
127
127
|
const constructed_block_arrays = new WeakSet();
|
|
128
128
|
// Need to keep track of products displaced by blocks above when mapping rows to indexes in the actual grid
|
|
129
|
-
const
|
|
129
|
+
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
|
|
130
130
|
if (!n_cols_currently_showing_)
|
|
131
131
|
// Nope out of here if we don't know how many columns are showing
|
|
132
|
-
return
|
|
132
|
+
return {
|
|
133
|
+
content_blocks_by_index_: content_blocks_by_index_
|
|
134
|
+
};
|
|
133
135
|
for (let i = 0; i < wrapped_blocks_.length; i++) {
|
|
134
136
|
// i = row to show at
|
|
135
137
|
const block = wrapped_blocks_[i];
|
|
@@ -146,25 +148,25 @@ function $ff7feae4dddd6073$export$92aa5d691d588f3f(_ref2) {
|
|
|
146
148
|
// Calculate displacement of us by content blocks above us
|
|
147
149
|
let displacement_by_added_blocks = 0;
|
|
148
150
|
for (let j = 0; j < i; j++) {
|
|
149
|
-
const row =
|
|
151
|
+
const row = displaced_products_[j];
|
|
150
152
|
if (row === undefined) continue; // there were no blocks in this row
|
|
151
153
|
let displaced_items_in_row;
|
|
152
154
|
if (typeof row === "number") displaced_items_in_row = row;else {
|
|
153
155
|
displaced_items_in_row = row.filter(item => item).length;
|
|
154
|
-
|
|
156
|
+
displaced_products_[j] = displaced_items_in_row;
|
|
155
157
|
}
|
|
156
158
|
displacement_by_added_blocks += displaced_items_in_row;
|
|
157
159
|
}
|
|
158
160
|
const index_of_us_in_row = target_index - index_of_first_item_in_row;
|
|
159
161
|
for (let j = 0; j < index_of_us_in_row; j++) {
|
|
160
|
-
var
|
|
161
|
-
if ((
|
|
162
|
+
var _displaced_products_$;
|
|
163
|
+
if ((_displaced_products_$ = displaced_products_[i]) !== null && _displaced_products_$ !== void 0 && _displaced_products_$[j])
|
|
162
164
|
// Add blocks in our *current* row to the displacement, but only the ones to our left
|
|
163
165
|
displacement_by_added_blocks++;
|
|
164
166
|
}
|
|
165
167
|
// Add block to output array at the correct index
|
|
166
168
|
const final_target_index = target_index - displacement_by_added_blocks;
|
|
167
|
-
const existing_block =
|
|
169
|
+
const existing_block = content_blocks_by_index_[final_target_index];
|
|
168
170
|
const block_content = block.content;
|
|
169
171
|
// 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
|
|
170
172
|
if (existing_block) {
|
|
@@ -173,17 +175,20 @@ function $ff7feae4dddd6073$export$92aa5d691d588f3f(_ref2) {
|
|
|
173
175
|
existing_block.push(block_content);else {
|
|
174
176
|
const array = [existing_block, block_content];
|
|
175
177
|
constructed_block_arrays.add(array);
|
|
176
|
-
|
|
178
|
+
content_blocks_by_index_[final_target_index] = array;
|
|
177
179
|
}
|
|
178
|
-
} else
|
|
180
|
+
} else content_blocks_by_index_[final_target_index] = block_content;
|
|
179
181
|
// Update displacement
|
|
180
182
|
for (let j = 0; j < span_rows; j++) {
|
|
181
183
|
var _ref3;
|
|
182
|
-
const row =
|
|
184
|
+
const row = displaced_products_[_ref3 = i + j] || (displaced_products_[_ref3] = []);
|
|
183
185
|
for (let k = index_of_us_in_row; k < index_of_us_in_row + span_columns; k++) row[k] = true;
|
|
184
186
|
}
|
|
185
187
|
}
|
|
186
|
-
return
|
|
188
|
+
return {
|
|
189
|
+
content_blocks_by_index_: content_blocks_by_index_,
|
|
190
|
+
displaced_products_: displaced_products_
|
|
191
|
+
};
|
|
187
192
|
}
|
|
188
193
|
/**
|
|
189
194
|
* 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.
|
|
@@ -205,7 +210,7 @@ function $ff7feae4dddd6073$var$wrap_blocks_in_div(rendered_content_blocks, max_s
|
|
|
205
210
|
return !rendering_delayed();
|
|
206
211
|
},
|
|
207
212
|
get children() {
|
|
208
|
-
return $b8hua$ssr($ff7feae4dddd6073$var$_tmpl$, $b8hua$ssrHydrationKey(), "grid-column:" + "span ".concat($b8hua$escape(final_span_columns(), true)) + (";grid-row:" + "span ".concat($b8hua$escape(final_span_rows(), true))) + (";spans_columns_variable_name:" + $b8hua$escape(final_span_columns(), true)), $b8hua$escape($b8hua$createComponent($ff7feae4dddd6073$var$RenderContent, {
|
|
213
|
+
return $b8hua$ssr($ff7feae4dddd6073$var$_tmpl$, $b8hua$ssrHydrationKey(), "content-block-wrapper ".concat(final_span_columns() === max_span_columns() ? "spans-whole-row" : ""), "grid-column:" + "span ".concat($b8hua$escape(final_span_columns(), true)) + (";grid-row:" + "span ".concat($b8hua$escape(final_span_rows(), true))) + (";spans_columns_variable_name:" + $b8hua$escape(final_span_columns(), true)), $b8hua$escape($b8hua$createComponent($ff7feae4dddd6073$var$RenderContent, {
|
|
209
214
|
get content() {
|
|
210
215
|
return block.content;
|
|
211
216
|
}
|
|
@@ -8384,7 +8389,8 @@ class $284849364a6ef73a$export$e015ed2f2950f2e3 {
|
|
|
8384
8389
|
breadcrumbs: [],
|
|
8385
8390
|
quick_links: [],
|
|
8386
8391
|
image_urls: [],
|
|
8387
|
-
failed: true
|
|
8392
|
+
failed: true,
|
|
8393
|
+
content_blocks: []
|
|
8388
8394
|
}),
|
|
8389
8395
|
method_: "GET"
|
|
8390
8396
|
});
|
|
@@ -8870,7 +8876,8 @@ class $f5f54892fd0c7d9f$export$f34314aa9505732e {
|
|
|
8870
8876
|
// Please make sure that the signal created by below line always updates AFTER selected_filters_ updates on a "popstate" event. If the filter cache is popped before the selected filters are the code in create_modified_filters() is going to re-calculate search_local_filter_cache without knowing the real value of search_selected_filters, and we'll end up with too few filters in search_local_filter_cache in some cases
|
|
8871
8877
|
local_filter_cache: [],
|
|
8872
8878
|
expanded_hierarchical_filters: [],
|
|
8873
|
-
scroll_restoration_data: []
|
|
8879
|
+
scroll_restoration_data: [],
|
|
8880
|
+
history_content_blocks: []
|
|
8874
8881
|
}),
|
|
8875
8882
|
router_: $b8hua$babelruntimehelpersclassPrivateFieldGet(this, $f5f54892fd0c7d9f$var$_router),
|
|
8876
8883
|
prefix_: "category" + unique_instance_key_for_state + "_"
|
|
@@ -13189,6 +13196,78 @@ function $a4777acaffa35a82$var$clear_if_opened_new_tab_with_sideways_url_params_
|
|
|
13189
13196
|
});
|
|
13190
13197
|
tracking_function_for_plp_results(plp_results_);
|
|
13191
13198
|
}
|
|
13199
|
+
var $3b772ef9a35560fe$var$_tmpl$ = ["<a", ' class="d-standard-content-wrapper"', "><video", ' muted="" autoplay="" playsinline="" loop class="d-standard-content"></video></a>'];
|
|
13200
|
+
function $3b772ef9a35560fe$export$780a853d15174484(_ref) {
|
|
13201
|
+
let {
|
|
13202
|
+
contentBlock_: {
|
|
13203
|
+
content: {
|
|
13204
|
+
link: link,
|
|
13205
|
+
type: type,
|
|
13206
|
+
url: mediaUrl
|
|
13207
|
+
}
|
|
13208
|
+
},
|
|
13209
|
+
router_: router_
|
|
13210
|
+
} = _ref;
|
|
13211
|
+
if (type === "image") {
|
|
13212
|
+
const [wrapperSize, setWrapperSize] = $b8hua$createSignal();
|
|
13213
|
+
return $b8hua$createComponent((0, $b8hua$Dynamic), $b8hua$mergeProps1({
|
|
13214
|
+
component: link ? "a" : "div",
|
|
13215
|
+
"class": "d-standard-content-wrapper",
|
|
13216
|
+
get onClick() {
|
|
13217
|
+
return $b8hua$catchify(ev => link && router_.navigate_.go_to_({
|
|
13218
|
+
new_url_: link,
|
|
13219
|
+
is_replace_: false,
|
|
13220
|
+
event_: ev
|
|
13221
|
+
}));
|
|
13222
|
+
}
|
|
13223
|
+
}, link && {
|
|
13224
|
+
href: link
|
|
13225
|
+
}, {
|
|
13226
|
+
get children() {
|
|
13227
|
+
return $b8hua$createComponent((0, $56047603f9d212b6$export$6e5611bc7e57e477), {
|
|
13228
|
+
get size() {
|
|
13229
|
+
return $b8hua$createMemo(() => {
|
|
13230
|
+
var _wrapperSize;
|
|
13231
|
+
return ((_wrapperSize = wrapperSize()) === null || _wrapperSize === void 0 ? void 0 : _wrapperSize()) || 0;
|
|
13232
|
+
});
|
|
13233
|
+
},
|
|
13234
|
+
src: mediaUrl,
|
|
13235
|
+
"class": "d-standard-content"
|
|
13236
|
+
});
|
|
13237
|
+
}
|
|
13238
|
+
}));
|
|
13239
|
+
}
|
|
13240
|
+
if (type === "video") {
|
|
13241
|
+
const pageVisible = $a35e6f680c5bbc60$export$54299a3c81f5425();
|
|
13242
|
+
return $b8hua$ssr($3b772ef9a35560fe$var$_tmpl$, $b8hua$ssrHydrationKey(), $b8hua$ssrAttribute("href", $b8hua$escape(link, true), false), $b8hua$ssrAttribute("src", $b8hua$escape(mediaUrl, true), false));
|
|
13243
|
+
}
|
|
13244
|
+
}
|
|
13245
|
+
function $12ff24fdc4b26d88$export$7a92d995f1bf3592(history_content_blocks_, plp_meta, content_blocks_by_row_, router_) {
|
|
13246
|
+
const [historyContentBlocks, setHistoryContentBlocks] = history_content_blocks_;
|
|
13247
|
+
$b8hua$createEffect(() => {
|
|
13248
|
+
var _plp_meta;
|
|
13249
|
+
const serverContentBlock = (_plp_meta = plp_meta()) === null || _plp_meta === void 0 ? void 0 : _plp_meta.content_blocks;
|
|
13250
|
+
if (serverContentBlock && JSON.stringify(serverContentBlock) !== JSON.stringify(historyContentBlocks())) setHistoryContentBlocks(serverContentBlock);
|
|
13251
|
+
});
|
|
13252
|
+
const contentBlocksByRow = $b8hua$createMemo(() => {
|
|
13253
|
+
if (content_blocks_by_row_()) return content_blocks_by_row_();
|
|
13254
|
+
const content = [];
|
|
13255
|
+
historyContentBlocks().forEach(row => {
|
|
13256
|
+
const contentBlock = {
|
|
13257
|
+
span_columns: row.span_columns,
|
|
13258
|
+
span_rows: row.span_rows,
|
|
13259
|
+
position: row.position,
|
|
13260
|
+
content: () => $b8hua$createComponent((0, $3b772ef9a35560fe$export$780a853d15174484), {
|
|
13261
|
+
contentBlock_: row,
|
|
13262
|
+
router_: router_
|
|
13263
|
+
})
|
|
13264
|
+
};
|
|
13265
|
+
content[row.row] = contentBlock;
|
|
13266
|
+
});
|
|
13267
|
+
return content;
|
|
13268
|
+
});
|
|
13269
|
+
return contentBlocksByRow;
|
|
13270
|
+
}
|
|
13192
13271
|
var $4b4b262708b516ee$var$_tmpl$ = ["<div", ' class="product-count"><!--$-->', "<!--/--> <!--$-->", "<!--/--></div>"],
|
|
13193
13272
|
$4b4b262708b516ee$var$_tmpl$2 = ["<div", "></div>"],
|
|
13194
13273
|
$4b4b262708b516ee$var$_tmpl$3 = ["<div", ' class="filter-results-for-one-row"><!--$-->', "<!--/--><!--$-->", "<!--/--></div>"],
|
|
@@ -13217,6 +13296,7 @@ function $4b4b262708b516ee$export$f7d2f673fc2f091d(_ref) {
|
|
|
13217
13296
|
show_breadcrumbs_: show_breadcrumbs_,
|
|
13218
13297
|
layout_options_: layout_options_,
|
|
13219
13298
|
scroll_restoration_data_: scroll_restoration_data_,
|
|
13299
|
+
history_content_blocks_: history_content_blocks_,
|
|
13220
13300
|
product_card_template_: product_card_template_,
|
|
13221
13301
|
sideways_filter_clearing_flag_: sideways_filter_clearing_flag_,
|
|
13222
13302
|
sorting_query_param_: sorting_query_param_,
|
|
@@ -13285,6 +13365,7 @@ function $4b4b262708b516ee$export$f7d2f673fc2f091d(_ref) {
|
|
|
13285
13365
|
}));
|
|
13286
13366
|
// Make "Get Listing" request to get quicklinks, breadcrumbs, title, etc
|
|
13287
13367
|
const [plp_meta] = $b8hua$createResource(meta_query_base, $b8hua$catchify(query => depict_api_.get_listing(query)));
|
|
13368
|
+
const contentBlocksByRow = $12ff24fdc4b26d88$export$7a92d995f1bf3592(history_content_blocks_, plp_meta, content_blocks_by_row_, router_);
|
|
13288
13369
|
const available_sortings_ = $b8hua$createMemo(() => {
|
|
13289
13370
|
var _plp_products_, _plp_products_$sorts;
|
|
13290
13371
|
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 => {
|
|
@@ -13531,7 +13612,7 @@ function $4b4b262708b516ee$export$f7d2f673fc2f091d(_ref) {
|
|
|
13531
13612
|
product_card_template_: product_card_template_,
|
|
13532
13613
|
sort_or_filter_open_: sort_or_filter_open_,
|
|
13533
13614
|
desktop_filter_elements_: desktop_filter_elements_,
|
|
13534
|
-
content_blocks_by_row_:
|
|
13615
|
+
content_blocks_by_row_: contentBlocksByRow,
|
|
13535
13616
|
ConfiguredScrollStatus_: ConfiguredScrollStatus_,
|
|
13536
13617
|
id_currently_querying_for_: id_to_query_for_,
|
|
13537
13618
|
no_results_options_: {
|
|
@@ -13623,7 +13704,8 @@ function $8821a19349c36651$export$e2bf8ce7779e827e(props) {
|
|
|
13623
13704
|
sorting_open: category_sorting_open_,
|
|
13624
13705
|
expanded_filters: expanded_filters_,
|
|
13625
13706
|
expanded_hierarchical_filters: expanded_hierarchical_filters_,
|
|
13626
|
-
scroll_restoration_data: scroll_restoration_data_
|
|
13707
|
+
scroll_restoration_data: scroll_restoration_data_,
|
|
13708
|
+
history_content_blocks: history_content_blocks_
|
|
13627
13709
|
} = depict_category.historyStateSignals_;
|
|
13628
13710
|
const {
|
|
13629
13711
|
current_sorting_: current_sorting_,
|
|
@@ -13675,6 +13757,7 @@ function $8821a19349c36651$export$e2bf8ce7779e827e(props) {
|
|
|
13675
13757
|
sideways_filter_clearing_flag_: sideways_filter_clearing_flag_,
|
|
13676
13758
|
content_blocks_by_row_: () => props.content_blocks_by_row,
|
|
13677
13759
|
scroll_restoration_data_: scroll_restoration_data_,
|
|
13760
|
+
history_content_blocks_: history_content_blocks_,
|
|
13678
13761
|
layout_options_: $b8hua$createMemo(() => ({
|
|
13679
13762
|
cols_at_size: $a9c7ba6087881ac2$export$6daf8749b65a1b77(props.cols_at_size),
|
|
13680
13763
|
...grid_spacing_override(),
|