@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/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.
|
|
108
|
+
const $b757f75811f3261f$export$83d89fbfd8236492 = "4.7.32";
|
|
109
109
|
function $b54e6192d0caa293$export$d9f36cf74e24d595(media_query) {
|
|
110
110
|
const signal = $5vyXB$solidjs.createSignal(false);
|
|
111
111
|
$5vyXB$solidjs.onCleanup($5vyXB$depictaiutilishared.javascript_media_query(media_query, ({
|
|
@@ -166,7 +166,7 @@ function $3bc4a89b971a3af5$export$3f37af283f8fb843(props) {
|
|
|
166
166
|
}
|
|
167
167
|
});
|
|
168
168
|
}
|
|
169
|
-
var $d92f338ba8f9da9b$var$_tmpl$ = ["<div", ' class="
|
|
169
|
+
var $d92f338ba8f9da9b$var$_tmpl$ = ["<div", ' class="', '" style="', '">', "</div>"];
|
|
170
170
|
function $d92f338ba8f9da9b$export$791ef57e62e21c3f({
|
|
171
171
|
content_blocks_: incoming_content_blocks,
|
|
172
172
|
cols_at_size_: cols_at_size_,
|
|
@@ -202,20 +202,22 @@ function $d92f338ba8f9da9b$export$791ef57e62e21c3f({
|
|
|
202
202
|
return $5vyXB$solidjs.createMemo(() => $d92f338ba8f9da9b$export$92aa5d691d588f3f({
|
|
203
203
|
wrapped_blocks_: get_wrapped_blocks_(),
|
|
204
204
|
n_cols_currently_showing_: n_cols_currently_showing_()
|
|
205
|
-
}));
|
|
205
|
+
}).content_blocks_by_index_);
|
|
206
206
|
}
|
|
207
207
|
function $d92f338ba8f9da9b$export$92aa5d691d588f3f({
|
|
208
208
|
wrapped_blocks_: wrapped_blocks_,
|
|
209
209
|
n_cols_currently_showing_: n_cols_currently_showing_
|
|
210
210
|
}) {
|
|
211
211
|
// This computation should be quite cheap since it just moves around things into an array
|
|
212
|
-
const
|
|
212
|
+
const content_blocks_by_index_ = [];
|
|
213
213
|
const constructed_block_arrays = new WeakSet();
|
|
214
214
|
// Need to keep track of products displaced by blocks above when mapping rows to indexes in the actual grid
|
|
215
|
-
const
|
|
215
|
+
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
|
|
216
216
|
if (!n_cols_currently_showing_)
|
|
217
217
|
// Nope out of here if we don't know how many columns are showing
|
|
218
|
-
return
|
|
218
|
+
return {
|
|
219
|
+
content_blocks_by_index_: content_blocks_by_index_
|
|
220
|
+
};
|
|
219
221
|
for (let i = 0; i < wrapped_blocks_.length; i++) {
|
|
220
222
|
// i = row to show at
|
|
221
223
|
const block = wrapped_blocks_[i];
|
|
@@ -232,22 +234,22 @@ function $d92f338ba8f9da9b$export$92aa5d691d588f3f({
|
|
|
232
234
|
// Calculate displacement of us by content blocks above us
|
|
233
235
|
let displacement_by_added_blocks = 0;
|
|
234
236
|
for (let j = 0; j < i; j++) {
|
|
235
|
-
const row =
|
|
237
|
+
const row = displaced_products_[j];
|
|
236
238
|
if (row === undefined) continue; // there were no blocks in this row
|
|
237
239
|
let displaced_items_in_row;
|
|
238
240
|
if (typeof row === "number") displaced_items_in_row = row;else {
|
|
239
241
|
displaced_items_in_row = row.filter(item => item).length;
|
|
240
|
-
|
|
242
|
+
displaced_products_[j] = displaced_items_in_row;
|
|
241
243
|
}
|
|
242
244
|
displacement_by_added_blocks += displaced_items_in_row;
|
|
243
245
|
}
|
|
244
246
|
const index_of_us_in_row = target_index - index_of_first_item_in_row;
|
|
245
|
-
for (let j = 0; j < index_of_us_in_row; j++) if (
|
|
247
|
+
for (let j = 0; j < index_of_us_in_row; j++) if (displaced_products_[i]?.[j])
|
|
246
248
|
// Add blocks in our *current* row to the displacement, but only the ones to our left
|
|
247
249
|
displacement_by_added_blocks++;
|
|
248
250
|
// Add block to output array at the correct index
|
|
249
251
|
const final_target_index = target_index - displacement_by_added_blocks;
|
|
250
|
-
const existing_block =
|
|
252
|
+
const existing_block = content_blocks_by_index_[final_target_index];
|
|
251
253
|
const block_content = block.content;
|
|
252
254
|
// 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
|
|
253
255
|
if (existing_block) {
|
|
@@ -256,16 +258,19 @@ function $d92f338ba8f9da9b$export$92aa5d691d588f3f({
|
|
|
256
258
|
existing_block.push(block_content);else {
|
|
257
259
|
const array = [existing_block, block_content];
|
|
258
260
|
constructed_block_arrays.add(array);
|
|
259
|
-
|
|
261
|
+
content_blocks_by_index_[final_target_index] = array;
|
|
260
262
|
}
|
|
261
|
-
} else
|
|
263
|
+
} else content_blocks_by_index_[final_target_index] = block_content;
|
|
262
264
|
// Update displacement
|
|
263
265
|
for (let j = 0; j < span_rows; j++) {
|
|
264
|
-
const row =
|
|
266
|
+
const row = displaced_products_[i + j] ||= [];
|
|
265
267
|
for (let k = index_of_us_in_row; k < index_of_us_in_row + span_columns; k++) row[k] = true;
|
|
266
268
|
}
|
|
267
269
|
}
|
|
268
|
-
return
|
|
270
|
+
return {
|
|
271
|
+
content_blocks_by_index_: content_blocks_by_index_,
|
|
272
|
+
displaced_products_: displaced_products_
|
|
273
|
+
};
|
|
269
274
|
}
|
|
270
275
|
/**
|
|
271
276
|
* 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.
|
|
@@ -284,7 +289,7 @@ function $d92f338ba8f9da9b$var$wrap_blocks_in_div(rendered_content_blocks, max_s
|
|
|
284
289
|
return !rendering_delayed();
|
|
285
290
|
},
|
|
286
291
|
get children() {
|
|
287
|
-
return $5vyXB$solidjsweb.ssr($d92f338ba8f9da9b$var$_tmpl$, $5vyXB$solidjsweb.ssrHydrationKey(), "grid-column:" + `span ${$5vyXB$solidjsweb.escape(final_span_columns(), true)}` + (";grid-row:" + `span ${$5vyXB$solidjsweb.escape(final_span_rows(), true)}`) + (";spans_columns_variable_name:" + $5vyXB$solidjsweb.escape(final_span_columns(), true)), $5vyXB$solidjsweb.escape($5vyXB$solidjsweb.createComponent($d92f338ba8f9da9b$var$RenderContent, {
|
|
292
|
+
return $5vyXB$solidjsweb.ssr($d92f338ba8f9da9b$var$_tmpl$, $5vyXB$solidjsweb.ssrHydrationKey(), `content-block-wrapper ${final_span_columns() === max_span_columns() ? "spans-whole-row" : ""}`, "grid-column:" + `span ${$5vyXB$solidjsweb.escape(final_span_columns(), true)}` + (";grid-row:" + `span ${$5vyXB$solidjsweb.escape(final_span_rows(), true)}`) + (";spans_columns_variable_name:" + $5vyXB$solidjsweb.escape(final_span_columns(), true)), $5vyXB$solidjsweb.escape($5vyXB$solidjsweb.createComponent($d92f338ba8f9da9b$var$RenderContent, {
|
|
288
293
|
get content() {
|
|
289
294
|
return block.content;
|
|
290
295
|
}
|
|
@@ -8126,7 +8131,8 @@ class $e1d6c0f3d89d531c$export$e015ed2f2950f2e3 {
|
|
|
8126
8131
|
breadcrumbs: [],
|
|
8127
8132
|
quick_links: [],
|
|
8128
8133
|
image_urls: [],
|
|
8129
|
-
failed: true
|
|
8134
|
+
failed: true,
|
|
8135
|
+
content_blocks: []
|
|
8130
8136
|
}),
|
|
8131
8137
|
method_: "GET"
|
|
8132
8138
|
});
|
|
@@ -8390,7 +8396,8 @@ class $48567ac5b39bac56$export$f34314aa9505732e {
|
|
|
8390
8396
|
// 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
|
|
8391
8397
|
local_filter_cache: [],
|
|
8392
8398
|
expanded_hierarchical_filters: [],
|
|
8393
|
-
scroll_restoration_data: []
|
|
8399
|
+
scroll_restoration_data: [],
|
|
8400
|
+
history_content_blocks: []
|
|
8394
8401
|
}),
|
|
8395
8402
|
router_: this.#router,
|
|
8396
8403
|
prefix_: "category" + unique_instance_key_for_state + "_"
|
|
@@ -12328,6 +12335,73 @@ function $ef972f5c10b1c5b4$var$clear_if_opened_new_tab_with_sideways_url_params_
|
|
|
12328
12335
|
});
|
|
12329
12336
|
tracking_function_for_plp_results(plp_results_);
|
|
12330
12337
|
}
|
|
12338
|
+
var $32c662f618f5d80d$var$_tmpl$ = ["<a", ' class="d-standard-content-wrapper"', "><video", ' muted="" autoplay="" playsinline="" loop class="d-standard-content"></video></a>'];
|
|
12339
|
+
function $32c662f618f5d80d$export$780a853d15174484({
|
|
12340
|
+
contentBlock_: {
|
|
12341
|
+
content: {
|
|
12342
|
+
link: link,
|
|
12343
|
+
type: type,
|
|
12344
|
+
url: mediaUrl
|
|
12345
|
+
}
|
|
12346
|
+
},
|
|
12347
|
+
router_: router_
|
|
12348
|
+
}) {
|
|
12349
|
+
if (type === "image") {
|
|
12350
|
+
const [wrapperSize, setWrapperSize] = $5vyXB$solidjs.createSignal();
|
|
12351
|
+
return $5vyXB$solidjsweb.createComponent((0, $5vyXB$solidjsweb.Dynamic), $5vyXB$solidjsweb.mergeProps({
|
|
12352
|
+
component: link ? "a" : "div",
|
|
12353
|
+
"class": "d-standard-content-wrapper",
|
|
12354
|
+
get onClick() {
|
|
12355
|
+
return $5vyXB$depictaiutilisharedlatest.catchify(ev => link && router_.navigate_.go_to_({
|
|
12356
|
+
new_url_: link,
|
|
12357
|
+
is_replace_: false,
|
|
12358
|
+
event_: ev
|
|
12359
|
+
}));
|
|
12360
|
+
}
|
|
12361
|
+
}, link && {
|
|
12362
|
+
href: link
|
|
12363
|
+
}, {
|
|
12364
|
+
get children() {
|
|
12365
|
+
return $5vyXB$solidjsweb.createComponent((0, $19950faaac026e09$export$6e5611bc7e57e477), {
|
|
12366
|
+
get size() {
|
|
12367
|
+
return $5vyXB$solidjs.createMemo(() => wrapperSize()?.() || 0);
|
|
12368
|
+
},
|
|
12369
|
+
src: mediaUrl,
|
|
12370
|
+
"class": "d-standard-content"
|
|
12371
|
+
});
|
|
12372
|
+
}
|
|
12373
|
+
}));
|
|
12374
|
+
}
|
|
12375
|
+
if (type === "video") {
|
|
12376
|
+
const pageVisible = $55cbacb79d3e0cea$export$54299a3c81f5425();
|
|
12377
|
+
return $5vyXB$solidjsweb.ssr($32c662f618f5d80d$var$_tmpl$, $5vyXB$solidjsweb.ssrHydrationKey(), $5vyXB$solidjsweb.ssrAttribute("href", $5vyXB$solidjsweb.escape(link, true), false), $5vyXB$solidjsweb.ssrAttribute("src", $5vyXB$solidjsweb.escape(mediaUrl, true), false));
|
|
12378
|
+
}
|
|
12379
|
+
}
|
|
12380
|
+
function $0a80939bf0a1e9cc$export$7a92d995f1bf3592(history_content_blocks_, plp_meta, content_blocks_by_row_, router_) {
|
|
12381
|
+
const [historyContentBlocks, setHistoryContentBlocks] = history_content_blocks_;
|
|
12382
|
+
$5vyXB$solidjs.createEffect(() => {
|
|
12383
|
+
const serverContentBlock = plp_meta()?.content_blocks;
|
|
12384
|
+
if (serverContentBlock && JSON.stringify(serverContentBlock) !== JSON.stringify(historyContentBlocks())) setHistoryContentBlocks(serverContentBlock);
|
|
12385
|
+
});
|
|
12386
|
+
const contentBlocksByRow = $5vyXB$solidjs.createMemo(() => {
|
|
12387
|
+
if (content_blocks_by_row_()) return content_blocks_by_row_();
|
|
12388
|
+
const content = [];
|
|
12389
|
+
historyContentBlocks().forEach(row => {
|
|
12390
|
+
const contentBlock = {
|
|
12391
|
+
span_columns: row.span_columns,
|
|
12392
|
+
span_rows: row.span_rows,
|
|
12393
|
+
position: row.position,
|
|
12394
|
+
content: () => $5vyXB$solidjsweb.createComponent((0, $32c662f618f5d80d$export$780a853d15174484), {
|
|
12395
|
+
contentBlock_: row,
|
|
12396
|
+
router_: router_
|
|
12397
|
+
})
|
|
12398
|
+
};
|
|
12399
|
+
content[row.row] = contentBlock;
|
|
12400
|
+
});
|
|
12401
|
+
return content;
|
|
12402
|
+
});
|
|
12403
|
+
return contentBlocksByRow;
|
|
12404
|
+
}
|
|
12331
12405
|
var $840d88a04b2d22a7$var$_tmpl$ = ["<div", ' class="product-count"><!--$-->', "<!--/--> <!--$-->", "<!--/--></div>"],
|
|
12332
12406
|
$840d88a04b2d22a7$var$_tmpl$2 = ["<div", "></div>"],
|
|
12333
12407
|
$840d88a04b2d22a7$var$_tmpl$3 = ["<div", ' class="filter-results-for-one-row"><!--$-->', "<!--/--><!--$-->", "<!--/--></div>"],
|
|
@@ -12355,6 +12429,7 @@ function $840d88a04b2d22a7$export$f7d2f673fc2f091d({
|
|
|
12355
12429
|
show_breadcrumbs_: show_breadcrumbs_,
|
|
12356
12430
|
layout_options_: layout_options_,
|
|
12357
12431
|
scroll_restoration_data_: scroll_restoration_data_,
|
|
12432
|
+
history_content_blocks_: history_content_blocks_,
|
|
12358
12433
|
product_card_template_: product_card_template_,
|
|
12359
12434
|
sideways_filter_clearing_flag_: sideways_filter_clearing_flag_,
|
|
12360
12435
|
sorting_query_param_: sorting_query_param_,
|
|
@@ -12423,6 +12498,7 @@ function $840d88a04b2d22a7$export$f7d2f673fc2f091d({
|
|
|
12423
12498
|
}));
|
|
12424
12499
|
// Make "Get Listing" request to get quicklinks, breadcrumbs, title, etc
|
|
12425
12500
|
const [plp_meta] = $5vyXB$solidjs.createResource(meta_query_base, $5vyXB$depictaiutilisharedlatest.catchify(query => depict_api_.get_listing(query)));
|
|
12501
|
+
const contentBlocksByRow = $0a80939bf0a1e9cc$export$7a92d995f1bf3592(history_content_blocks_, plp_meta, content_blocks_by_row_, router_);
|
|
12426
12502
|
const available_sortings_ = $5vyXB$solidjs.createMemo(() => plp_products_()?.sorts?.map(sort => ({
|
|
12427
12503
|
...sort,
|
|
12428
12504
|
order: sort.order ?? "desc"
|
|
@@ -12641,7 +12717,7 @@ function $840d88a04b2d22a7$export$f7d2f673fc2f091d({
|
|
|
12641
12717
|
product_card_template_: product_card_template_,
|
|
12642
12718
|
sort_or_filter_open_: sort_or_filter_open_,
|
|
12643
12719
|
desktop_filter_elements_: desktop_filter_elements_,
|
|
12644
|
-
content_blocks_by_row_:
|
|
12720
|
+
content_blocks_by_row_: contentBlocksByRow,
|
|
12645
12721
|
ConfiguredScrollStatus_: ConfiguredScrollStatus_,
|
|
12646
12722
|
id_currently_querying_for_: id_to_query_for_,
|
|
12647
12723
|
no_results_options_: {
|
|
@@ -12731,7 +12807,8 @@ function $14f289047713d67a$export$e2bf8ce7779e827e(props) {
|
|
|
12731
12807
|
sorting_open: category_sorting_open_,
|
|
12732
12808
|
expanded_filters: expanded_filters_,
|
|
12733
12809
|
expanded_hierarchical_filters: expanded_hierarchical_filters_,
|
|
12734
|
-
scroll_restoration_data: scroll_restoration_data_
|
|
12810
|
+
scroll_restoration_data: scroll_restoration_data_,
|
|
12811
|
+
history_content_blocks: history_content_blocks_
|
|
12735
12812
|
} = depict_category.historyStateSignals_;
|
|
12736
12813
|
const {
|
|
12737
12814
|
current_sorting_: current_sorting_,
|
|
@@ -12777,6 +12854,7 @@ function $14f289047713d67a$export$e2bf8ce7779e827e(props) {
|
|
|
12777
12854
|
sideways_filter_clearing_flag_: sideways_filter_clearing_flag_,
|
|
12778
12855
|
content_blocks_by_row_: () => props.content_blocks_by_row,
|
|
12779
12856
|
scroll_restoration_data_: scroll_restoration_data_,
|
|
12857
|
+
history_content_blocks_: history_content_blocks_,
|
|
12780
12858
|
layout_options_: $5vyXB$solidjs.createMemo(() => ({
|
|
12781
12859
|
cols_at_size: $4e04be41243c3d80$export$6daf8749b65a1b77(props.cols_at_size),
|
|
12782
12860
|
...grid_spacing_override(),
|
package/server/latest/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/latest/index.js
CHANGED
|
@@ -7,7 +7,7 @@ import { dlog as $i7OB2$dlog, catchify as $i7OB2$catchify, ListenableSet as $i7O
|
|
|
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.
|
|
10
|
+
const $ec291e0010116877$export$83d89fbfd8236492 = "4.7.32";
|
|
11
11
|
function $dc9262ef6f786812$export$d9f36cf74e24d595(media_query) {
|
|
12
12
|
const signal = $i7OB2$createSignal(false);
|
|
13
13
|
$i7OB2$onCleanup($i7OB2$javascript_media_query(media_query, ({
|
|
@@ -68,7 +68,7 @@ function $7f60f09116a3fe61$export$3f37af283f8fb843(props) {
|
|
|
68
68
|
}
|
|
69
69
|
});
|
|
70
70
|
}
|
|
71
|
-
var $e7a7eb102ddc0c79$var$_tmpl$ = ["<div", ' class="
|
|
71
|
+
var $e7a7eb102ddc0c79$var$_tmpl$ = ["<div", ' class="', '" style="', '">', "</div>"];
|
|
72
72
|
function $e7a7eb102ddc0c79$export$791ef57e62e21c3f({
|
|
73
73
|
content_blocks_: incoming_content_blocks,
|
|
74
74
|
cols_at_size_: cols_at_size_,
|
|
@@ -104,20 +104,22 @@ function $e7a7eb102ddc0c79$export$791ef57e62e21c3f({
|
|
|
104
104
|
return $i7OB2$createMemo(() => $e7a7eb102ddc0c79$export$92aa5d691d588f3f({
|
|
105
105
|
wrapped_blocks_: get_wrapped_blocks_(),
|
|
106
106
|
n_cols_currently_showing_: n_cols_currently_showing_()
|
|
107
|
-
}));
|
|
107
|
+
}).content_blocks_by_index_);
|
|
108
108
|
}
|
|
109
109
|
function $e7a7eb102ddc0c79$export$92aa5d691d588f3f({
|
|
110
110
|
wrapped_blocks_: wrapped_blocks_,
|
|
111
111
|
n_cols_currently_showing_: n_cols_currently_showing_
|
|
112
112
|
}) {
|
|
113
113
|
// This computation should be quite cheap since it just moves around things into an array
|
|
114
|
-
const
|
|
114
|
+
const content_blocks_by_index_ = [];
|
|
115
115
|
const constructed_block_arrays = new WeakSet();
|
|
116
116
|
// Need to keep track of products displaced by blocks above when mapping rows to indexes in the actual grid
|
|
117
|
-
const
|
|
117
|
+
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
|
|
118
118
|
if (!n_cols_currently_showing_)
|
|
119
119
|
// Nope out of here if we don't know how many columns are showing
|
|
120
|
-
return
|
|
120
|
+
return {
|
|
121
|
+
content_blocks_by_index_: content_blocks_by_index_
|
|
122
|
+
};
|
|
121
123
|
for (let i = 0; i < wrapped_blocks_.length; i++) {
|
|
122
124
|
// i = row to show at
|
|
123
125
|
const block = wrapped_blocks_[i];
|
|
@@ -134,22 +136,22 @@ function $e7a7eb102ddc0c79$export$92aa5d691d588f3f({
|
|
|
134
136
|
// Calculate displacement of us by content blocks above us
|
|
135
137
|
let displacement_by_added_blocks = 0;
|
|
136
138
|
for (let j = 0; j < i; j++) {
|
|
137
|
-
const row =
|
|
139
|
+
const row = displaced_products_[j];
|
|
138
140
|
if (row === undefined) continue; // there were no blocks in this row
|
|
139
141
|
let displaced_items_in_row;
|
|
140
142
|
if (typeof row === "number") displaced_items_in_row = row;else {
|
|
141
143
|
displaced_items_in_row = row.filter(item => item).length;
|
|
142
|
-
|
|
144
|
+
displaced_products_[j] = displaced_items_in_row;
|
|
143
145
|
}
|
|
144
146
|
displacement_by_added_blocks += displaced_items_in_row;
|
|
145
147
|
}
|
|
146
148
|
const index_of_us_in_row = target_index - index_of_first_item_in_row;
|
|
147
|
-
for (let j = 0; j < index_of_us_in_row; j++) if (
|
|
149
|
+
for (let j = 0; j < index_of_us_in_row; j++) if (displaced_products_[i]?.[j])
|
|
148
150
|
// Add blocks in our *current* row to the displacement, but only the ones to our left
|
|
149
151
|
displacement_by_added_blocks++;
|
|
150
152
|
// Add block to output array at the correct index
|
|
151
153
|
const final_target_index = target_index - displacement_by_added_blocks;
|
|
152
|
-
const existing_block =
|
|
154
|
+
const existing_block = content_blocks_by_index_[final_target_index];
|
|
153
155
|
const block_content = block.content;
|
|
154
156
|
// 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
|
|
155
157
|
if (existing_block) {
|
|
@@ -158,16 +160,19 @@ function $e7a7eb102ddc0c79$export$92aa5d691d588f3f({
|
|
|
158
160
|
existing_block.push(block_content);else {
|
|
159
161
|
const array = [existing_block, block_content];
|
|
160
162
|
constructed_block_arrays.add(array);
|
|
161
|
-
|
|
163
|
+
content_blocks_by_index_[final_target_index] = array;
|
|
162
164
|
}
|
|
163
|
-
} else
|
|
165
|
+
} else content_blocks_by_index_[final_target_index] = block_content;
|
|
164
166
|
// Update displacement
|
|
165
167
|
for (let j = 0; j < span_rows; j++) {
|
|
166
|
-
const row =
|
|
168
|
+
const row = displaced_products_[i + j] ||= [];
|
|
167
169
|
for (let k = index_of_us_in_row; k < index_of_us_in_row + span_columns; k++) row[k] = true;
|
|
168
170
|
}
|
|
169
171
|
}
|
|
170
|
-
return
|
|
172
|
+
return {
|
|
173
|
+
content_blocks_by_index_: content_blocks_by_index_,
|
|
174
|
+
displaced_products_: displaced_products_
|
|
175
|
+
};
|
|
171
176
|
}
|
|
172
177
|
/**
|
|
173
178
|
* 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.
|
|
@@ -186,7 +191,7 @@ function $e7a7eb102ddc0c79$var$wrap_blocks_in_div(rendered_content_blocks, max_s
|
|
|
186
191
|
return !rendering_delayed();
|
|
187
192
|
},
|
|
188
193
|
get children() {
|
|
189
|
-
return $i7OB2$ssr($e7a7eb102ddc0c79$var$_tmpl$, $i7OB2$ssrHydrationKey(), "grid-column:" + `span ${$i7OB2$escape(final_span_columns(), true)}` + (";grid-row:" + `span ${$i7OB2$escape(final_span_rows(), true)}`) + (";spans_columns_variable_name:" + $i7OB2$escape(final_span_columns(), true)), $i7OB2$escape($i7OB2$createComponent($e7a7eb102ddc0c79$var$RenderContent, {
|
|
194
|
+
return $i7OB2$ssr($e7a7eb102ddc0c79$var$_tmpl$, $i7OB2$ssrHydrationKey(), `content-block-wrapper ${final_span_columns() === max_span_columns() ? "spans-whole-row" : ""}`, "grid-column:" + `span ${$i7OB2$escape(final_span_columns(), true)}` + (";grid-row:" + `span ${$i7OB2$escape(final_span_rows(), true)}`) + (";spans_columns_variable_name:" + $i7OB2$escape(final_span_columns(), true)), $i7OB2$escape($i7OB2$createComponent($e7a7eb102ddc0c79$var$RenderContent, {
|
|
190
195
|
get content() {
|
|
191
196
|
return block.content;
|
|
192
197
|
}
|
|
@@ -8028,7 +8033,8 @@ class $7fa23e2a0079eca4$export$e015ed2f2950f2e3 {
|
|
|
8028
8033
|
breadcrumbs: [],
|
|
8029
8034
|
quick_links: [],
|
|
8030
8035
|
image_urls: [],
|
|
8031
|
-
failed: true
|
|
8036
|
+
failed: true,
|
|
8037
|
+
content_blocks: []
|
|
8032
8038
|
}),
|
|
8033
8039
|
method_: "GET"
|
|
8034
8040
|
});
|
|
@@ -8292,7 +8298,8 @@ class $961b5c64bef4662f$export$f34314aa9505732e {
|
|
|
8292
8298
|
// 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
|
|
8293
8299
|
local_filter_cache: [],
|
|
8294
8300
|
expanded_hierarchical_filters: [],
|
|
8295
|
-
scroll_restoration_data: []
|
|
8301
|
+
scroll_restoration_data: [],
|
|
8302
|
+
history_content_blocks: []
|
|
8296
8303
|
}),
|
|
8297
8304
|
router_: this.#router,
|
|
8298
8305
|
prefix_: "category" + unique_instance_key_for_state + "_"
|
|
@@ -12230,6 +12237,73 @@ function $e7fce80abe608e01$var$clear_if_opened_new_tab_with_sideways_url_params_
|
|
|
12230
12237
|
});
|
|
12231
12238
|
tracking_function_for_plp_results(plp_results_);
|
|
12232
12239
|
}
|
|
12240
|
+
var $f916989c4b1be9f7$var$_tmpl$ = ["<a", ' class="d-standard-content-wrapper"', "><video", ' muted="" autoplay="" playsinline="" loop class="d-standard-content"></video></a>'];
|
|
12241
|
+
function $f916989c4b1be9f7$export$780a853d15174484({
|
|
12242
|
+
contentBlock_: {
|
|
12243
|
+
content: {
|
|
12244
|
+
link: link,
|
|
12245
|
+
type: type,
|
|
12246
|
+
url: mediaUrl
|
|
12247
|
+
}
|
|
12248
|
+
},
|
|
12249
|
+
router_: router_
|
|
12250
|
+
}) {
|
|
12251
|
+
if (type === "image") {
|
|
12252
|
+
const [wrapperSize, setWrapperSize] = $i7OB2$createSignal();
|
|
12253
|
+
return $i7OB2$createComponent((0, $i7OB2$Dynamic), $i7OB2$mergeProps1({
|
|
12254
|
+
component: link ? "a" : "div",
|
|
12255
|
+
"class": "d-standard-content-wrapper",
|
|
12256
|
+
get onClick() {
|
|
12257
|
+
return $i7OB2$catchify(ev => link && router_.navigate_.go_to_({
|
|
12258
|
+
new_url_: link,
|
|
12259
|
+
is_replace_: false,
|
|
12260
|
+
event_: ev
|
|
12261
|
+
}));
|
|
12262
|
+
}
|
|
12263
|
+
}, link && {
|
|
12264
|
+
href: link
|
|
12265
|
+
}, {
|
|
12266
|
+
get children() {
|
|
12267
|
+
return $i7OB2$createComponent((0, $e8ffe11ed01df0fe$export$6e5611bc7e57e477), {
|
|
12268
|
+
get size() {
|
|
12269
|
+
return $i7OB2$createMemo(() => wrapperSize()?.() || 0);
|
|
12270
|
+
},
|
|
12271
|
+
src: mediaUrl,
|
|
12272
|
+
"class": "d-standard-content"
|
|
12273
|
+
});
|
|
12274
|
+
}
|
|
12275
|
+
}));
|
|
12276
|
+
}
|
|
12277
|
+
if (type === "video") {
|
|
12278
|
+
const pageVisible = $5e3d278ef4c80cd7$export$54299a3c81f5425();
|
|
12279
|
+
return $i7OB2$ssr($f916989c4b1be9f7$var$_tmpl$, $i7OB2$ssrHydrationKey(), $i7OB2$ssrAttribute("href", $i7OB2$escape(link, true), false), $i7OB2$ssrAttribute("src", $i7OB2$escape(mediaUrl, true), false));
|
|
12280
|
+
}
|
|
12281
|
+
}
|
|
12282
|
+
function $486360b09f0d5729$export$7a92d995f1bf3592(history_content_blocks_, plp_meta, content_blocks_by_row_, router_) {
|
|
12283
|
+
const [historyContentBlocks, setHistoryContentBlocks] = history_content_blocks_;
|
|
12284
|
+
$i7OB2$createEffect(() => {
|
|
12285
|
+
const serverContentBlock = plp_meta()?.content_blocks;
|
|
12286
|
+
if (serverContentBlock && JSON.stringify(serverContentBlock) !== JSON.stringify(historyContentBlocks())) setHistoryContentBlocks(serverContentBlock);
|
|
12287
|
+
});
|
|
12288
|
+
const contentBlocksByRow = $i7OB2$createMemo(() => {
|
|
12289
|
+
if (content_blocks_by_row_()) return content_blocks_by_row_();
|
|
12290
|
+
const content = [];
|
|
12291
|
+
historyContentBlocks().forEach(row => {
|
|
12292
|
+
const contentBlock = {
|
|
12293
|
+
span_columns: row.span_columns,
|
|
12294
|
+
span_rows: row.span_rows,
|
|
12295
|
+
position: row.position,
|
|
12296
|
+
content: () => $i7OB2$createComponent((0, $f916989c4b1be9f7$export$780a853d15174484), {
|
|
12297
|
+
contentBlock_: row,
|
|
12298
|
+
router_: router_
|
|
12299
|
+
})
|
|
12300
|
+
};
|
|
12301
|
+
content[row.row] = contentBlock;
|
|
12302
|
+
});
|
|
12303
|
+
return content;
|
|
12304
|
+
});
|
|
12305
|
+
return contentBlocksByRow;
|
|
12306
|
+
}
|
|
12233
12307
|
var $df5d81d0fe61ff21$var$_tmpl$ = ["<div", ' class="product-count"><!--$-->', "<!--/--> <!--$-->", "<!--/--></div>"],
|
|
12234
12308
|
$df5d81d0fe61ff21$var$_tmpl$2 = ["<div", "></div>"],
|
|
12235
12309
|
$df5d81d0fe61ff21$var$_tmpl$3 = ["<div", ' class="filter-results-for-one-row"><!--$-->', "<!--/--><!--$-->", "<!--/--></div>"],
|
|
@@ -12257,6 +12331,7 @@ function $df5d81d0fe61ff21$export$f7d2f673fc2f091d({
|
|
|
12257
12331
|
show_breadcrumbs_: show_breadcrumbs_,
|
|
12258
12332
|
layout_options_: layout_options_,
|
|
12259
12333
|
scroll_restoration_data_: scroll_restoration_data_,
|
|
12334
|
+
history_content_blocks_: history_content_blocks_,
|
|
12260
12335
|
product_card_template_: product_card_template_,
|
|
12261
12336
|
sideways_filter_clearing_flag_: sideways_filter_clearing_flag_,
|
|
12262
12337
|
sorting_query_param_: sorting_query_param_,
|
|
@@ -12325,6 +12400,7 @@ function $df5d81d0fe61ff21$export$f7d2f673fc2f091d({
|
|
|
12325
12400
|
}));
|
|
12326
12401
|
// Make "Get Listing" request to get quicklinks, breadcrumbs, title, etc
|
|
12327
12402
|
const [plp_meta] = $i7OB2$createResource(meta_query_base, $i7OB2$catchify(query => depict_api_.get_listing(query)));
|
|
12403
|
+
const contentBlocksByRow = $486360b09f0d5729$export$7a92d995f1bf3592(history_content_blocks_, plp_meta, content_blocks_by_row_, router_);
|
|
12328
12404
|
const available_sortings_ = $i7OB2$createMemo(() => plp_products_()?.sorts?.map(sort => ({
|
|
12329
12405
|
...sort,
|
|
12330
12406
|
order: sort.order ?? "desc"
|
|
@@ -12543,7 +12619,7 @@ function $df5d81d0fe61ff21$export$f7d2f673fc2f091d({
|
|
|
12543
12619
|
product_card_template_: product_card_template_,
|
|
12544
12620
|
sort_or_filter_open_: sort_or_filter_open_,
|
|
12545
12621
|
desktop_filter_elements_: desktop_filter_elements_,
|
|
12546
|
-
content_blocks_by_row_:
|
|
12622
|
+
content_blocks_by_row_: contentBlocksByRow,
|
|
12547
12623
|
ConfiguredScrollStatus_: ConfiguredScrollStatus_,
|
|
12548
12624
|
id_currently_querying_for_: id_to_query_for_,
|
|
12549
12625
|
no_results_options_: {
|
|
@@ -12633,7 +12709,8 @@ function $442f32a4d80abbde$export$e2bf8ce7779e827e(props) {
|
|
|
12633
12709
|
sorting_open: category_sorting_open_,
|
|
12634
12710
|
expanded_filters: expanded_filters_,
|
|
12635
12711
|
expanded_hierarchical_filters: expanded_hierarchical_filters_,
|
|
12636
|
-
scroll_restoration_data: scroll_restoration_data_
|
|
12712
|
+
scroll_restoration_data: scroll_restoration_data_,
|
|
12713
|
+
history_content_blocks: history_content_blocks_
|
|
12637
12714
|
} = depict_category.historyStateSignals_;
|
|
12638
12715
|
const {
|
|
12639
12716
|
current_sorting_: current_sorting_,
|
|
@@ -12679,6 +12756,7 @@ function $442f32a4d80abbde$export$e2bf8ce7779e827e(props) {
|
|
|
12679
12756
|
sideways_filter_clearing_flag_: sideways_filter_clearing_flag_,
|
|
12680
12757
|
content_blocks_by_row_: () => props.content_blocks_by_row,
|
|
12681
12758
|
scroll_restoration_data_: scroll_restoration_data_,
|
|
12759
|
+
history_content_blocks_: history_content_blocks_,
|
|
12682
12760
|
layout_options_: $i7OB2$createMemo(() => ({
|
|
12683
12761
|
cols_at_size: $b5cccc8ee7d24677$export$6daf8749b65a1b77(props.cols_at_size),
|
|
12684
12762
|
...grid_spacing_override(),
|