@depict-ai/ui 1.4.25 → 2.0.1
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 +240 -170
- package/ES10/index.d.ts +28 -31
- package/ES10/index.js +242 -172
- package/README.md +2 -1
- package/latest/index.cjs +229 -166
- package/latest/index.d.ts +28 -31
- package/latest/index.js +231 -168
- package/locales/require.js +1152 -0
- package/package.json +7 -7
- package/server/ES10/index.cjs +199 -139
- package/server/ES10/index.d.ts +28 -31
- package/server/ES10/index.js +201 -141
- package/server/latest/index.cjs +189 -131
- package/server/latest/index.d.ts +28 -31
- package/server/latest/index.js +191 -133
package/README.md
CHANGED
|
@@ -7,4 +7,5 @@ Breaking changes:
|
|
|
7
7
|
- 1.1.0 made the `include_input_field` option of `SearchPage` default to true
|
|
8
8
|
- 1.2.0 added `page_url_creator` and changed typing to support it. The only breaking change is that this potentially causes type errors where the resolution is to move the generics to the provider instead of the SearchPage and CategoryPage components.
|
|
9
9
|
- 1.3.0 moved `depict-filter-sort-mobile-modal-container` from being a class to being an id
|
|
10
|
-
- 1.4.0 Added `brand_` translation string to Locale.
|
|
10
|
+
- 1.4.0 Added `brand_` translation string to Locale.
|
|
11
|
+
- 2.0.0 Made `enable_content_search` `true` by default. Redesigned filter counts.
|
package/latest/index.cjs
CHANGED
|
@@ -60,7 +60,7 @@ $parcel$export(module.exports, "defaultColsAtSize", () => $a3280f0aad997933$expo
|
|
|
60
60
|
$parcel$export(module.exports, "defaultCategoryTitlePlugin", () => $a3280f0aad997933$export$7bf543b9d9be2c22);
|
|
61
61
|
$parcel$export(module.exports, "version", () => $b757f75811f3261f$export$83d89fbfd8236492);
|
|
62
62
|
/*! Depict.ai search and product listing SDK */
|
|
63
|
-
const $b757f75811f3261f$export$83d89fbfd8236492 = "
|
|
63
|
+
const $b757f75811f3261f$export$83d89fbfd8236492 = "2.0.1";
|
|
64
64
|
const $4e04be41243c3d80$var$transform_elements = sorted_cols_at_size => {
|
|
65
65
|
const cols_at_size = [];
|
|
66
66
|
for (let i = 0; i < sorted_cols_at_size.length; i++) {
|
|
@@ -119,7 +119,9 @@ function $ab7c6c7911bae2f5$export$ff7109b9b2b206ba(sdk_cols_at_size, min_width_f
|
|
|
119
119
|
}
|
|
120
120
|
function $fc23d7668ae0011d$export$a2cc176055f8f08() {
|
|
121
121
|
const text = "Please try setting `colsAtSize` on the `SearchPage`/`CategoryPage` components to change the grid before setting it with CSS. If you do with CSS, set `ColsAtSize` to an empty array to ensure no declarations created by the SDK leak through.";
|
|
122
|
-
return (0, $gVhhF$solidjsweb.isServer) ?
|
|
122
|
+
return (0, $gVhhF$solidjsweb.isServer) ? {
|
|
123
|
+
t: `<!-- ${text} -->`
|
|
124
|
+
} : document.createComment(text);
|
|
123
125
|
}
|
|
124
126
|
function $5f7d55c710fd1bc2$export$2f0cbfbb4354bb52(elements) {
|
|
125
127
|
// FYI this probably doesn't work on hugely deep nestings or large amount of elements
|
|
@@ -334,9 +336,14 @@ function $edafe91daf3091d7$export$b69d0d92862de18b(props) {
|
|
|
334
336
|
const $f48d0fbb00835aaa$var$_tmpl$ = /*#__PURE__*/$gVhhF$solidjsweb.template(`<div></div>`, 2),
|
|
335
337
|
$f48d0fbb00835aaa$var$_tmpl$2 = /*#__PURE__*/$gVhhF$solidjsweb.template(`<style type="text/css"></style>`, 2);
|
|
336
338
|
function $f48d0fbb00835aaa$export$d21e32dfedac04be(props) {
|
|
339
|
+
const container_class = "x" + $gVhhF$solidjs.createUniqueId();
|
|
337
340
|
const container_element_ = (() => {
|
|
338
341
|
const _el$ = $gVhhF$solidjsweb.getNextElement($f48d0fbb00835aaa$var$_tmpl$);
|
|
339
|
-
$gVhhF$solidjsweb.spread(_el$, $gVhhF$solidjsweb.mergeProps(() => props.element_attributes
|
|
342
|
+
$gVhhF$solidjsweb.spread(_el$, $gVhhF$solidjsweb.mergeProps(() => props.element_attributes, {
|
|
343
|
+
"classList": {
|
|
344
|
+
[container_class]: true
|
|
345
|
+
}
|
|
346
|
+
}), false, true);
|
|
340
347
|
$gVhhF$solidjsweb.insert(_el$, () => props.children);
|
|
341
348
|
$gVhhF$solidjsweb.runHydrationEvents();
|
|
342
349
|
return _el$;
|
|
@@ -347,11 +354,16 @@ function $f48d0fbb00835aaa$export$d21e32dfedac04be(props) {
|
|
|
347
354
|
},
|
|
348
355
|
severity_: "error",
|
|
349
356
|
get children() {
|
|
350
|
-
return $f48d0fbb00835aaa$export$445d8d3f5f706a40(props, container_element_);
|
|
357
|
+
return $f48d0fbb00835aaa$export$445d8d3f5f706a40(props, container_element_, false, container_class);
|
|
351
358
|
}
|
|
352
359
|
});
|
|
353
360
|
}
|
|
354
|
-
function $f48d0fbb00835aaa$export$445d8d3f5f706a40(props, container_element, insert_after_container = false) {
|
|
361
|
+
function $f48d0fbb00835aaa$export$445d8d3f5f706a40(props, container_element, insert_after_container = false, container_class) {
|
|
362
|
+
if (!container_class) {
|
|
363
|
+
// only try to add if it wasn't provided, so that we have a code path without classList when doing SSR
|
|
364
|
+
container_class = $gVhhF$depictaiutilishared.make_random_classname();
|
|
365
|
+
container_element.classList.add(container_class);
|
|
366
|
+
}
|
|
355
367
|
// Copy of Layout from utilishared but using solid-js signals instead of async iterable IPNS
|
|
356
368
|
const show_all_rows = $gVhhF$solidjs.createMemo(() => props.rows === "all");
|
|
357
369
|
const rows_or_empty_object = $gVhhF$solidjs.createMemo(() => show_all_rows() ? {} : props.rows);
|
|
@@ -366,46 +378,41 @@ function $f48d0fbb00835aaa$export$445d8d3f5f706a40(props, container_element, ins
|
|
|
366
378
|
return !(!button || Array.isArray(button) && !button.length);
|
|
367
379
|
});
|
|
368
380
|
const [get_styling, set_styling] = $gVhhF$solidjs.createSignal();
|
|
369
|
-
const container_class = $gVhhF$depictaiutilishared.make_random_classname();
|
|
370
381
|
const selector_beginning = `.depict .${container_class}>`; // class so ppl can have id if needed
|
|
371
382
|
const [get_children_count, set_children_count] = $gVhhF$solidjs.createSignal(0);
|
|
372
|
-
const update_children_count = () => set_children_count(container_element.children.length);
|
|
383
|
+
const update_children_count = () => (0, $gVhhF$solidjsweb.isServer) ? 20 : set_children_count(container_element.children.length);
|
|
373
384
|
const col_styling = $gVhhF$solidjs.createMemo(() => $gVhhF$depictaiutilishared.n_col_styling_with_dist(selector_beginning, props.grid_spacing, props.cols_at_size, props.layout, props.override_vertical_spacing));
|
|
374
385
|
const default_currently_visible_signal = $gVhhF$solidjs.createSignal($gVhhF$solidjs.untrack(() => rows_or_empty_object().start_rows ?? 1)); // Keep this signal here, so it doesn't change when rows_or_empty_object and I think it's to be expected that the "internal default signal" stays the same
|
|
375
386
|
const rows_visible_signal = $gVhhF$solidjs.createMemo(() => rows_or_empty_object().currently_visible || default_currently_visible_signal);
|
|
376
387
|
const get_rows_visible = $gVhhF$solidjs.createMemo(() => rows_visible_signal()[0]());
|
|
377
388
|
const set_rows_visible = $gVhhF$solidjs.createMemo(() => rows_visible_signal()[1]);
|
|
378
|
-
const view_more_button_class = $gVhhF$
|
|
379
|
-
const view_less_button_class = $gVhhF$
|
|
380
|
-
const style_element = (() => {
|
|
381
|
-
const _el$2 = $gVhhF$solidjsweb.getNextElement($f48d0fbb00835aaa$var$_tmpl$2);
|
|
382
|
-
$gVhhF$solidjsweb.insert(_el$2, get_styling);
|
|
383
|
-
return _el$2;
|
|
384
|
-
})();
|
|
389
|
+
const view_more_button_class = "m" + $gVhhF$solidjs.createUniqueId();
|
|
390
|
+
const view_less_button_class = "l" + $gVhhF$solidjs.createUniqueId(); // https://github.com/solidjs/solid-docs/issues/263#issuecomment-1622388079
|
|
385
391
|
const view_more_button_container = $gVhhF$solidjs.createMemo(() => have_a_view_more_button() && (() => {
|
|
386
|
-
const _el$
|
|
387
|
-
$gVhhF$solidjsweb.addEventListener(_el$
|
|
388
|
-
$gVhhF$solidjsweb.className(_el$
|
|
389
|
-
$gVhhF$solidjsweb.insert(_el$
|
|
392
|
+
const _el$2 = $gVhhF$solidjsweb.getNextElement($f48d0fbb00835aaa$var$_tmpl$);
|
|
393
|
+
$gVhhF$solidjsweb.addEventListener(_el$2, "click", $gVhhF$depictaiutilishared.catchify(() => set_rows_visible()(prev => prev + (rows_or_empty_object().rows_per_click ?? 1))), true);
|
|
394
|
+
$gVhhF$solidjsweb.className(_el$2, `load-more-container ${view_more_button_class}`);
|
|
395
|
+
$gVhhF$solidjsweb.insert(_el$2, () => rows_or_empty_object().button);
|
|
390
396
|
$gVhhF$solidjsweb.runHydrationEvents();
|
|
391
|
-
return _el$
|
|
397
|
+
return _el$2;
|
|
392
398
|
})());
|
|
393
399
|
// We need to have duplicate buttons because which ones is shown depends on the number of rows visible and therefore on the viewport size and therefore on the css media queries
|
|
394
400
|
const view_less_button_container = $gVhhF$solidjs.createMemo(() => have_a_view_less_button() && (() => {
|
|
395
|
-
const _el$
|
|
396
|
-
$gVhhF$solidjsweb.addEventListener(_el$
|
|
397
|
-
$gVhhF$solidjsweb.className(_el$
|
|
398
|
-
$gVhhF$solidjsweb.insert(_el$
|
|
401
|
+
const _el$3 = $gVhhF$solidjsweb.getNextElement($f48d0fbb00835aaa$var$_tmpl$);
|
|
402
|
+
$gVhhF$solidjsweb.addEventListener(_el$3, "click", $gVhhF$depictaiutilishared.catchify(() => set_rows_visible()(() => rows_or_empty_object().start_rows ?? 1)), true);
|
|
403
|
+
$gVhhF$solidjsweb.className(_el$3, `load-less-container ${view_less_button_class}`);
|
|
404
|
+
$gVhhF$solidjsweb.insert(_el$3, () => rows_or_empty_object().view_less_button);
|
|
399
405
|
$gVhhF$solidjsweb.runHydrationEvents();
|
|
400
|
-
return _el$
|
|
406
|
+
return _el$3;
|
|
401
407
|
})());
|
|
402
|
-
|
|
408
|
+
const [force_style_update, set_force_style_update] = $gVhhF$solidjs.createSignal("");
|
|
403
409
|
$gVhhF$solidjs.createComputed(() => {
|
|
404
410
|
// Make sure we don't have more rows visible than max_rows (this could happen by max_rows being decreased)
|
|
405
411
|
const rows_visible = get_rows_visible();
|
|
406
412
|
const max_rows = rows_or_empty_object().max_rows;
|
|
407
413
|
if (!isNaN(max_rows) && max_rows >= 0 && rows_visible > max_rows) set_rows_visible()(max_rows);
|
|
408
414
|
});
|
|
415
|
+
$gVhhF$solidjs.createEffect(() => set_force_style_update(" ")); // force style update after hydration due to https://discord.com/channels/722131463138705510/722167424186843267/1151544212517552168
|
|
409
416
|
$gVhhF$solidjs.createRenderEffect(() => {
|
|
410
417
|
// Be careful to only read show_all_rows in here (ofc doesn't apply to nested effects)
|
|
411
418
|
if (show_all_rows()) {
|
|
@@ -414,11 +421,13 @@ function $f48d0fbb00835aaa$export$445d8d3f5f706a40(props, container_element, ins
|
|
|
414
421
|
return;
|
|
415
422
|
}
|
|
416
423
|
update_children_count();
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
424
|
+
if (!(0, $gVhhF$solidjsweb.isServer)) {
|
|
425
|
+
const mutation_observer = new MutationObserver($gVhhF$depictaiutilishared.catchify(update_children_count));
|
|
426
|
+
mutation_observer.observe(container_element, {
|
|
427
|
+
childList: true
|
|
428
|
+
});
|
|
429
|
+
$gVhhF$solidjs.onCleanup(() => mutation_observer.disconnect());
|
|
430
|
+
}
|
|
422
431
|
set_styling(
|
|
423
432
|
// this is needed because solid will think that the memo-accessor is a setter function otherwise
|
|
424
433
|
() => $gVhhF$solidjs.createMemo(() => {
|
|
@@ -429,7 +438,7 @@ function $f48d0fbb00835aaa$export$445d8d3f5f706a40(props, container_element, ins
|
|
|
429
438
|
} = rows_or_empty_object();
|
|
430
439
|
const rows_visible = get_rows_visible();
|
|
431
440
|
const children_count = get_children_count();
|
|
432
|
-
return col_styling() + props.cols_at_size.map(options => {
|
|
441
|
+
return force_style_update() + col_styling() + props.cols_at_size.map(options => {
|
|
433
442
|
const [recs_per_row, min, max] = options;
|
|
434
443
|
let should_hide_view_more_button;
|
|
435
444
|
let visible_recs;
|
|
@@ -450,6 +459,11 @@ function $f48d0fbb00835aaa$export$445d8d3f5f706a40(props, container_element, ins
|
|
|
450
459
|
}).join("");
|
|
451
460
|
}));
|
|
452
461
|
});
|
|
462
|
+
const style_element = (() => {
|
|
463
|
+
const _el$4 = $gVhhF$solidjsweb.getNextElement($f48d0fbb00835aaa$var$_tmpl$2);
|
|
464
|
+
$gVhhF$solidjsweb.insert(_el$4, get_styling);
|
|
465
|
+
return _el$4;
|
|
466
|
+
})(); // need to create this after set_styling has been called or else there will be no styling in the SSR'd output
|
|
453
467
|
if (insert_after_container) container_element.after(style_element);
|
|
454
468
|
return [container_element, $gVhhF$solidjsweb.memo(view_more_button_container), $gVhhF$solidjsweb.memo(view_less_button_container), style_element];
|
|
455
469
|
}
|
|
@@ -477,18 +491,26 @@ function $a0e53f99354809d9$export$6649caad96ef8870({
|
|
|
477
491
|
slider_ref_: slider_ref_,
|
|
478
492
|
faded_opacity_ = 0.7,
|
|
479
493
|
mutation_plugins_ = [],
|
|
480
|
-
disable_fading_: disable_fading_
|
|
494
|
+
disable_fading_: disable_fading_,
|
|
495
|
+
arrow_width_: arrow_width_,
|
|
496
|
+
arrow_height_: arrow_height_
|
|
481
497
|
}) {
|
|
482
498
|
const slider = new (0, $gVhhF$depictaiutilishared.Amazing_Slider)({
|
|
483
499
|
button_contents: {
|
|
484
500
|
left: [(() => {
|
|
485
501
|
const _el$ = $gVhhF$solidjsweb.getNextElement($a0e53f99354809d9$var$_tmpl$);
|
|
486
|
-
$gVhhF$solidjsweb.insert(_el$, $gVhhF$solidjsweb.createComponent((0, $0f313083912e447a$export$8be2714ec7f169ee), {
|
|
502
|
+
$gVhhF$solidjsweb.insert(_el$, $gVhhF$solidjsweb.createComponent((0, $0f313083912e447a$export$8be2714ec7f169ee), {
|
|
503
|
+
height_: arrow_height_,
|
|
504
|
+
width_: arrow_width_
|
|
505
|
+
}));
|
|
487
506
|
return _el$;
|
|
488
507
|
})()],
|
|
489
508
|
right: [(() => {
|
|
490
509
|
const _el$2 = $gVhhF$solidjsweb.getNextElement($a0e53f99354809d9$var$_tmpl$);
|
|
491
|
-
$gVhhF$solidjsweb.insert(_el$2, $gVhhF$solidjsweb.createComponent((0, $0f313083912e447a$export$8be2714ec7f169ee), {
|
|
510
|
+
$gVhhF$solidjsweb.insert(_el$2, $gVhhF$solidjsweb.createComponent((0, $0f313083912e447a$export$8be2714ec7f169ee), {
|
|
511
|
+
height_: arrow_height_,
|
|
512
|
+
width_: arrow_width_
|
|
513
|
+
}));
|
|
492
514
|
return _el$2;
|
|
493
515
|
})()]
|
|
494
516
|
},
|
|
@@ -513,6 +535,8 @@ function $363ce4d1d71041aa$export$d41d19e89346fa2({
|
|
|
513
535
|
const is_showing_something = $gVhhF$solidjs.createMemo(() => recommendations_resource_.loading || recommendations_resource_()?.length);
|
|
514
536
|
const num_placeholders_ = () => 20;
|
|
515
537
|
const slider = $gVhhF$solidjsweb.createComponent((0, $a0e53f99354809d9$export$6649caad96ef8870), {
|
|
538
|
+
arrow_height_: 25,
|
|
539
|
+
arrow_width_: 12.5,
|
|
516
540
|
disable_fading_: true,
|
|
517
541
|
slider_ref_: slider => {
|
|
518
542
|
const {
|
|
@@ -557,34 +581,66 @@ function $363ce4d1d71041aa$export$d41d19e89346fa2({
|
|
|
557
581
|
children: slider
|
|
558
582
|
});
|
|
559
583
|
}
|
|
584
|
+
function $95837413165cc2df$export$23fca46f3143581f(component, error_message) {
|
|
585
|
+
const component_in_error_boundary = do_with_elements => {
|
|
586
|
+
const error_boundary_wrapped = $edafe91daf3091d7$export$b69d0d92862de18b({
|
|
587
|
+
severity_: "error",
|
|
588
|
+
message_: error_message,
|
|
589
|
+
get children() {
|
|
590
|
+
const elements = component();
|
|
591
|
+
do_with_elements?.(elements);
|
|
592
|
+
return elements;
|
|
593
|
+
}
|
|
594
|
+
});
|
|
595
|
+
// This might return an accessor, in that case we need to "unwrap" it since our SDK consumers expect HTML elements or arrays thereof
|
|
596
|
+
if (typeof error_boundary_wrapped === "function")
|
|
597
|
+
// @ts-ignore
|
|
598
|
+
return error_boundary_wrapped();
|
|
599
|
+
// On the server it returns a string, so we just return that
|
|
600
|
+
return error_boundary_wrapped;
|
|
601
|
+
};
|
|
602
|
+
const owner = $gVhhF$solidjs.getOwner();
|
|
603
|
+
if (owner == null) return $gVhhF$solidjs.createRoot(dispose => {
|
|
604
|
+
// if we're not already run in a root, create a root and automatically dispose it when the first returned element is removed from the DOM
|
|
605
|
+
return component_in_error_boundary(elements => {
|
|
606
|
+
const have_multiple = Array.isArray(elements);
|
|
607
|
+
if (have_multiple ? !elements?.length : !elements) return;
|
|
608
|
+
(0, $gVhhF$depictaiutilishared.observer).onremoved(have_multiple ? elements[0] : elements, dispose);
|
|
609
|
+
});
|
|
610
|
+
});else
|
|
611
|
+
// we're already in a root so cleanups are handled
|
|
612
|
+
return component_in_error_boundary();
|
|
613
|
+
}
|
|
560
614
|
const $72f96c4782db0b1b$var$_tmpl$ = /*#__PURE__*/$gVhhF$solidjsweb.template(`<div class="depict recommendations"></div>`, 2);
|
|
561
615
|
function $72f96c4782db0b1b$export$9574e176201e5e8d(props) {
|
|
562
|
-
|
|
563
|
-
const {
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
grid_spacing
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
616
|
+
return $95837413165cc2df$export$23fca46f3143581f(() => {
|
|
617
|
+
const grid_spacing_override = $gVhhF$solidjs.createMemo(() => {
|
|
618
|
+
const {
|
|
619
|
+
grid_spacing: grid_spacing
|
|
620
|
+
} = props; // can be reactive
|
|
621
|
+
return typeof grid_spacing === "string" ? {
|
|
622
|
+
grid_spacing: grid_spacing
|
|
623
|
+
} : {
|
|
624
|
+
override_vertical_spacing: grid_spacing.vertical,
|
|
625
|
+
grid_spacing: grid_spacing.horizontal
|
|
626
|
+
};
|
|
627
|
+
});
|
|
628
|
+
const [recommendations_resource_] = $gVhhF$solidjs.createResource(() => props.recommendations, recs => recs);
|
|
629
|
+
return (() => {
|
|
630
|
+
const _el$ = $gVhhF$solidjsweb.getNextElement($72f96c4782db0b1b$var$_tmpl$);
|
|
631
|
+
$gVhhF$solidjsweb.insert(_el$, () => $363ce4d1d71041aa$export$d41d19e89346fa2({
|
|
632
|
+
product_card_template_: (...args) => props.product_card_template(...args),
|
|
633
|
+
recommendations_resource_: recommendations_resource_,
|
|
634
|
+
market_: () => props.market,
|
|
635
|
+
merchant_: () => props.merchant,
|
|
636
|
+
layout_options_: $gVhhF$solidjs.createMemo(() => ({
|
|
637
|
+
cols_at_size: $4e04be41243c3d80$export$6daf8749b65a1b77($ab7c6c7911bae2f5$export$ff7109b9b2b206ba(props.cols_at_size)),
|
|
638
|
+
...grid_spacing_override()
|
|
639
|
+
}))
|
|
640
|
+
}));
|
|
641
|
+
return _el$;
|
|
642
|
+
})();
|
|
643
|
+
}, "RecommendationSlider failed");
|
|
588
644
|
}
|
|
589
645
|
const $b8e79813f4f7ebe4$var$_tmpl$ = /*#__PURE__*/$gVhhF$solidjsweb.template(`<div class="recommendation-grid"><!#><!/><!#><!/></div>`, 6);
|
|
590
646
|
function $b8e79813f4f7ebe4$export$7da560f849543dff({
|
|
@@ -647,46 +703,57 @@ function $b8e79813f4f7ebe4$export$7da560f849543dff({
|
|
|
647
703
|
const $1f8dbf7e28b3eff2$var$_tmpl$ = /*#__PURE__*/$gVhhF$solidjsweb.template(`<button class="show-more major" type="button"></button>`, 2),
|
|
648
704
|
$1f8dbf7e28b3eff2$var$_tmpl$2 = /*#__PURE__*/$gVhhF$solidjsweb.template(`<div class="depict plp recommendations"></div>`, 2);
|
|
649
705
|
function $1f8dbf7e28b3eff2$export$9756467d34d91cdb(props) {
|
|
650
|
-
|
|
651
|
-
const
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
};
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
706
|
+
return $95837413165cc2df$export$23fca46f3143581f(() => {
|
|
707
|
+
const rows_object_ = $gVhhF$solidjs.createMemo(() => {
|
|
708
|
+
const {
|
|
709
|
+
view_more_button: view_more_button,
|
|
710
|
+
max_rows: max_rows
|
|
711
|
+
} = props;
|
|
712
|
+
if (!view_more_button) {
|
|
713
|
+
if (max_rows) return {
|
|
714
|
+
max_rows: max_rows
|
|
715
|
+
};
|
|
716
|
+
return "all";
|
|
717
|
+
}
|
|
718
|
+
return {
|
|
719
|
+
max_rows: max_rows,
|
|
720
|
+
start_rows: view_more_button.start_rows,
|
|
721
|
+
rows_per_click: view_more_button.rows_per_click ?? 2,
|
|
722
|
+
button: (() => {
|
|
723
|
+
const _el$ = $gVhhF$solidjsweb.getNextElement($1f8dbf7e28b3eff2$var$_tmpl$);
|
|
724
|
+
$gVhhF$solidjsweb.insert(_el$, () => view_more_button.text);
|
|
725
|
+
return _el$;
|
|
726
|
+
})()
|
|
727
|
+
};
|
|
728
|
+
});
|
|
729
|
+
const grid_spacing_override = $gVhhF$solidjs.createMemo(() => {
|
|
730
|
+
const {
|
|
731
|
+
grid_spacing: grid_spacing
|
|
732
|
+
} = props; // can be reactive
|
|
733
|
+
return typeof grid_spacing === "string" ? {
|
|
734
|
+
grid_spacing: grid_spacing
|
|
735
|
+
} : {
|
|
736
|
+
override_vertical_spacing: grid_spacing.vertical,
|
|
737
|
+
grid_spacing: grid_spacing.horizontal
|
|
738
|
+
};
|
|
739
|
+
});
|
|
740
|
+
const [recommendations_resource_] = $gVhhF$solidjs.createResource(() => props.recommendations, recs => recs);
|
|
741
|
+
return (() => {
|
|
742
|
+
const _el$2 = $gVhhF$solidjsweb.getNextElement($1f8dbf7e28b3eff2$var$_tmpl$2);
|
|
743
|
+
$gVhhF$solidjsweb.insert(_el$2, () => $b8e79813f4f7ebe4$export$7da560f849543dff({
|
|
744
|
+
rows_object_: rows_object_,
|
|
745
|
+
product_card_template_: (...args) => props.product_card_template(...args),
|
|
746
|
+
recommendations_resource_: recommendations_resource_,
|
|
747
|
+
market_: () => props.market,
|
|
748
|
+
merchant_: () => props.merchant,
|
|
749
|
+
layout_options_: $gVhhF$solidjs.createMemo(() => ({
|
|
750
|
+
cols_at_size: $4e04be41243c3d80$export$6daf8749b65a1b77($ab7c6c7911bae2f5$export$ff7109b9b2b206ba(props.cols_at_size)),
|
|
751
|
+
...grid_spacing_override()
|
|
752
|
+
}))
|
|
753
|
+
}));
|
|
754
|
+
return _el$2;
|
|
755
|
+
})();
|
|
756
|
+
}, "RecommendationGrid failed");
|
|
690
757
|
}
|
|
691
758
|
const $19950faaac026e09$var$_tmpl$ = /*#__PURE__*/$gVhhF$solidjsweb.template(`<img>`, 1);
|
|
692
759
|
function $19950faaac026e09$export$e6fffe67d4cdd848(whatToWatch) {
|
|
@@ -1358,7 +1425,7 @@ const $b3cf6ca8dc0e9998$export$48513f6b9f8ce62d = props => {
|
|
|
1358
1425
|
const label = $gVhhF$solidjs.createMemo(() => props.label_);
|
|
1359
1426
|
const checked = $gVhhF$solidjs.createMemo(() => props.checked_);
|
|
1360
1427
|
const value = $gVhhF$solidjs.createMemo(() => props.value_);
|
|
1361
|
-
const is_count_zero = $gVhhF$solidjs.createMemo(() => props.is_count_zero_);
|
|
1428
|
+
const is_count_zero = $gVhhF$solidjs.createMemo(() => props.is_count_zero_ || count() === 0);
|
|
1362
1429
|
const id = $gVhhF$depictaiutilishared.make_random_classname();
|
|
1363
1430
|
return (/* We can't use actual margin because ExpandingContainer gets messed up */(() => {
|
|
1364
1431
|
const _el$ = $gVhhF$solidjsweb.getNextElement($b3cf6ca8dc0e9998$var$_tmpl$2),
|
|
@@ -1394,14 +1461,17 @@ const $b3cf6ca8dc0e9998$export$48513f6b9f8ce62d = props => {
|
|
|
1394
1461
|
}
|
|
1395
1462
|
}), _el$8, _co$);
|
|
1396
1463
|
$gVhhF$solidjsweb.effect(_p$ => {
|
|
1397
|
-
const _v$ = !!
|
|
1398
|
-
_v$2 = value()
|
|
1464
|
+
const _v$ = !!is_count_zero(),
|
|
1465
|
+
_v$2 = value(),
|
|
1466
|
+
_v$3 = !checked() && is_count_zero();
|
|
1399
1467
|
_v$ !== _p$._v$ && _el$.classList.toggle("count-0", _p$._v$ = _v$);
|
|
1400
1468
|
_v$2 !== _p$._v$2 && $gVhhF$solidjsweb.setAttribute(_el$3, "name", _p$._v$2 = _v$2);
|
|
1469
|
+
_v$3 !== _p$._v$3 && (_el$3.disabled = _p$._v$3 = _v$3);
|
|
1401
1470
|
return _p$;
|
|
1402
1471
|
}, {
|
|
1403
1472
|
_v$: undefined,
|
|
1404
|
-
_v$2: undefined
|
|
1473
|
+
_v$2: undefined,
|
|
1474
|
+
_v$3: undefined
|
|
1405
1475
|
});
|
|
1406
1476
|
$gVhhF$solidjsweb.effect(() => _el$3.checked = checked());
|
|
1407
1477
|
return _el$;
|
|
@@ -2238,6 +2308,7 @@ function $3bdc00a1353c1150$var$render_stuff(data, existing_filter, i18n_) {
|
|
|
2238
2308
|
return $gVhhF$solidjs.createMemo(() => value()?.is_expanded_?.ui_should_show_expanded_?.() ?? false);
|
|
2239
2309
|
}
|
|
2240
2310
|
}), _el$16, _co$5);
|
|
2311
|
+
$gVhhF$solidjsweb.effect(() => _el$14.classList.toggle("count-0", !!(value()?.count_ === 0)));
|
|
2241
2312
|
return _el$12;
|
|
2242
2313
|
})();
|
|
2243
2314
|
},
|
|
@@ -2429,7 +2500,8 @@ function $3bdc00a1353c1150$var$expand_until_choice(data_structure) {
|
|
|
2429
2500
|
});
|
|
2430
2501
|
}
|
|
2431
2502
|
const $0ef1681699140f1a$var$_tmpl$ = /*#__PURE__*/$gVhhF$solidjsweb.template(`<div class="checkbox-grid"></div>`, 2),
|
|
2432
|
-
$0ef1681699140f1a$var$_tmpl$2 = /*#__PURE__*/$gVhhF$solidjsweb.template(`<
|
|
2503
|
+
$0ef1681699140f1a$var$_tmpl$2 = /*#__PURE__*/$gVhhF$solidjsweb.template(`<span class="count-wrapper"><span class="count"></span></span>`, 4),
|
|
2504
|
+
$0ef1681699140f1a$var$_tmpl$3 = /*#__PURE__*/$gVhhF$solidjsweb.template(`<button class="major-minor-transition"><!#><!/><!#><!/></button>`, 6);
|
|
2433
2505
|
const $0ef1681699140f1a$export$414f6a19d38e655c = ({
|
|
2434
2506
|
filter_: filter_,
|
|
2435
2507
|
selected_filters_: [get_selected_filters, set_selected_filters]
|
|
@@ -2461,7 +2533,11 @@ const $0ef1681699140f1a$export$414f6a19d38e655c = ({
|
|
|
2461
2533
|
children: value => {
|
|
2462
2534
|
const is_selected = $gVhhF$solidjs.createMemo(() => existing_filter()?.data?.includes(value().value_));
|
|
2463
2535
|
return (() => {
|
|
2464
|
-
const _el$2 = $gVhhF$solidjsweb.getNextElement($0ef1681699140f1a$var$_tmpl$
|
|
2536
|
+
const _el$2 = $gVhhF$solidjsweb.getNextElement($0ef1681699140f1a$var$_tmpl$3),
|
|
2537
|
+
_el$5 = _el$2.firstChild,
|
|
2538
|
+
[_el$6, _co$] = $gVhhF$solidjsweb.getNextMarker(_el$5.nextSibling),
|
|
2539
|
+
_el$7 = _el$6.nextSibling,
|
|
2540
|
+
[_el$8, _co$2] = $gVhhF$solidjsweb.getNextMarker(_el$7.nextSibling);
|
|
2465
2541
|
$gVhhF$solidjsweb.addEventListener(_el$2, "click", $gVhhF$depictaiutilishared.catchify(() => {
|
|
2466
2542
|
const set_filter = existing_filter();
|
|
2467
2543
|
const {
|
|
@@ -2482,16 +2558,30 @@ const $0ef1681699140f1a$export$414f6a19d38e655c = ({
|
|
|
2482
2558
|
const selected_filters = [...get_selected_filters().filter(f => f !== set_filter), ...(new_filter_object.data.length ? [new_filter_object] : [])];
|
|
2483
2559
|
set_selected_filters(selected_filters);
|
|
2484
2560
|
}), true);
|
|
2485
|
-
$gVhhF$solidjsweb.insert(_el$2, () => value().value_);
|
|
2561
|
+
$gVhhF$solidjsweb.insert(_el$2, () => value().value_, _el$6, _co$);
|
|
2562
|
+
$gVhhF$solidjsweb.insert(_el$2, $gVhhF$solidjsweb.createComponent((0, $gVhhF$solidjs.Show), {
|
|
2563
|
+
get when() {
|
|
2564
|
+
return value().count_ != undefined;
|
|
2565
|
+
},
|
|
2566
|
+
get children() {
|
|
2567
|
+
const _el$3 = $gVhhF$solidjsweb.getNextElement($0ef1681699140f1a$var$_tmpl$2),
|
|
2568
|
+
_el$4 = _el$3.firstChild;
|
|
2569
|
+
$gVhhF$solidjsweb.insert(_el$4, () => value().count_);
|
|
2570
|
+
return _el$3;
|
|
2571
|
+
}
|
|
2572
|
+
}), _el$8, _co$2);
|
|
2486
2573
|
$gVhhF$solidjsweb.effect(_p$ => {
|
|
2487
|
-
const _v$ = !is_selected(),
|
|
2488
|
-
_v$2 =
|
|
2489
|
-
|
|
2490
|
-
_v$
|
|
2574
|
+
const _v$ = value().count_ === 0 && !is_selected(),
|
|
2575
|
+
_v$2 = !is_selected(),
|
|
2576
|
+
_v$3 = !!is_selected();
|
|
2577
|
+
_v$ !== _p$._v$ && (_el$2.disabled = _p$._v$ = _v$);
|
|
2578
|
+
_v$2 !== _p$._v$2 && _el$2.classList.toggle("minor", _p$._v$2 = _v$2);
|
|
2579
|
+
_v$3 !== _p$._v$3 && _el$2.classList.toggle("major", _p$._v$3 = _v$3);
|
|
2491
2580
|
return _p$;
|
|
2492
2581
|
}, {
|
|
2493
2582
|
_v$: undefined,
|
|
2494
|
-
_v$2: undefined
|
|
2583
|
+
_v$2: undefined,
|
|
2584
|
+
_v$3: undefined
|
|
2495
2585
|
});
|
|
2496
2586
|
$gVhhF$solidjsweb.runHydrationEvents();
|
|
2497
2587
|
return _el$2;
|
|
@@ -6317,35 +6407,6 @@ function $840d88a04b2d22a7$export$f7d2f673fc2f091d({
|
|
|
6317
6407
|
return _el$13;
|
|
6318
6408
|
})()];
|
|
6319
6409
|
}
|
|
6320
|
-
function $95837413165cc2df$export$23fca46f3143581f(component, error_message) {
|
|
6321
|
-
const component_in_error_boundary = do_with_elements => {
|
|
6322
|
-
const error_boundary_wrapped = $edafe91daf3091d7$export$b69d0d92862de18b({
|
|
6323
|
-
severity_: "error",
|
|
6324
|
-
message_: error_message,
|
|
6325
|
-
get children() {
|
|
6326
|
-
const elements = component();
|
|
6327
|
-
do_with_elements?.(elements);
|
|
6328
|
-
return elements;
|
|
6329
|
-
}
|
|
6330
|
-
});
|
|
6331
|
-
// This might return an accessor, in that case we need to "unwrap" it since our SDK consumers expect HTML elements or arrays thereof
|
|
6332
|
-
if (typeof error_boundary_wrapped === "function")
|
|
6333
|
-
// @ts-ignore
|
|
6334
|
-
return error_boundary_wrapped();
|
|
6335
|
-
// On the server it returns a string, so we just return that
|
|
6336
|
-
return error_boundary_wrapped;
|
|
6337
|
-
};
|
|
6338
|
-
const owner = $gVhhF$solidjs.getOwner();
|
|
6339
|
-
if (owner == null) return $gVhhF$solidjs.createRoot(dispose => {
|
|
6340
|
-
// if we're not already run in a root, create a root and automatically dispose it when the first returned element is removed from the DOM
|
|
6341
|
-
return component_in_error_boundary(elements => {
|
|
6342
|
-
if (!elements?.length) return;
|
|
6343
|
-
(0, $gVhhF$depictaiutilishared.observer).onremoved(elements[0], dispose);
|
|
6344
|
-
});
|
|
6345
|
-
});else
|
|
6346
|
-
// we're already in a root so cleanups are handled
|
|
6347
|
-
return component_in_error_boundary();
|
|
6348
|
-
}
|
|
6349
6410
|
function $c79fd10a3ab7d6e0$export$477caf01aecaeb2a(options) {
|
|
6350
6411
|
const router_ = options.router_;
|
|
6351
6412
|
const search_query_url_param_name_ = "search_query_url_param_name_" in options ? options.search_query_url_param_name_ : undefined;
|
|
@@ -7991,7 +8052,7 @@ function $c0125412b4ea0c93$export$605674723bcc715c(props = {}) {
|
|
|
7991
8052
|
const $6b65ba8af12c5a26$var$_tmpl$ = /*#__PURE__*/$gVhhF$solidjsweb.template(`<a class="suggestion"></a>`, 2),
|
|
7992
8053
|
$6b65ba8af12c5a26$var$_tmpl$2 = /*#__PURE__*/$gVhhF$solidjsweb.template(`<div class="search-icon"></div>`, 2),
|
|
7993
8054
|
$6b65ba8af12c5a26$var$_tmpl$3 = /*#__PURE__*/$gVhhF$solidjsweb.template(`<span class="type"></span>`, 2),
|
|
7994
|
-
$6b65ba8af12c5a26$var$_tmpl$4 = /*#__PURE__*/$gVhhF$solidjsweb.template(`<div><!#><!/><span class="value"></span></div>`, 6),
|
|
8055
|
+
$6b65ba8af12c5a26$var$_tmpl$4 = /*#__PURE__*/$gVhhF$solidjsweb.template(`<div class="with-parent-title"><!#><!/><span class="value line-clamp"></span></div>`, 6),
|
|
7995
8056
|
$6b65ba8af12c5a26$var$_tmpl$5 = /*#__PURE__*/$gVhhF$solidjsweb.template(`<div class="with-icon"><!#><!/><!#><!/></div>`, 6),
|
|
7996
8057
|
$6b65ba8af12c5a26$var$_tmpl$6 = /*#__PURE__*/$gVhhF$solidjsweb.template(`<h2 class="text"></h2>`, 2),
|
|
7997
8058
|
$6b65ba8af12c5a26$var$_tmpl$7 = /*#__PURE__*/$gVhhF$solidjsweb.template(`<div class="suggestion-container query"><!#><!/><!#><!/></div>`, 6),
|
|
@@ -9319,7 +9380,9 @@ function $76227de40be817e5$export$f631859cab12b342({
|
|
|
9319
9380
|
}
|
|
9320
9381
|
function $8781fcec27b20709$export$9ff751cd77687edc({
|
|
9321
9382
|
search_results_: search_results_,
|
|
9322
|
-
router_: router_
|
|
9383
|
+
router_: router_,
|
|
9384
|
+
queries_without_content_results_: queries_without_content_results_,
|
|
9385
|
+
get_search_query_: get_search_query_
|
|
9323
9386
|
}) {
|
|
9324
9387
|
const content_results = $gVhhF$solidjs.createMemo(() => search_results_()?.content_search_links);
|
|
9325
9388
|
const content_results_by_page_url = $gVhhF$solidjs.createMemo(() => {
|
|
@@ -9332,6 +9395,10 @@ function $8781fcec27b20709$export$9ff751cd77687edc({
|
|
|
9332
9395
|
}
|
|
9333
9396
|
return map;
|
|
9334
9397
|
});
|
|
9398
|
+
$gVhhF$solidjs.createEffect(() => {
|
|
9399
|
+
const results = content_results();
|
|
9400
|
+
if (Array.isArray(results) && results.length === 0) queries_without_content_results_.add($gVhhF$solidjs.untrack(get_search_query_));
|
|
9401
|
+
});
|
|
9335
9402
|
return $gVhhF$solidjsweb.createComponent((0, $gVhhF$solidjs.For), {
|
|
9336
9403
|
get each() {
|
|
9337
9404
|
return [...content_results_by_page_url().keys()];
|
|
@@ -9384,8 +9451,15 @@ function $3716b8caf7f959e2$export$6d0c9c22f6652669({
|
|
|
9384
9451
|
number_: num_results,
|
|
9385
9452
|
i18n_: i18n_
|
|
9386
9453
|
});
|
|
9387
|
-
const
|
|
9454
|
+
const queries_without_content_results_ = new (0, $gVhhF$depictaiutilishared.ListenableSet)();
|
|
9455
|
+
const [check_query, set_check_query] = $gVhhF$solidjs.createSignal(false);
|
|
9456
|
+
const placeholders_enabled = $gVhhF$solidjs.createMemo(() => {
|
|
9457
|
+
// don't show placeholders when the user toggles filters
|
|
9458
|
+
check_query();
|
|
9459
|
+
return !queries_without_content_results_.has(get_search_query_());
|
|
9460
|
+
});
|
|
9388
9461
|
const rows_object = $3716b8caf7f959e2$var$make_state_saved_rows(content_results_rows_, i18n_);
|
|
9462
|
+
for (const ev of ["add", "delete"]) queries_without_content_results_.addEventListener(ev, () => set_check_query(prev => !prev));
|
|
9389
9463
|
return (() => {
|
|
9390
9464
|
const _el$ = $gVhhF$solidjsweb.getNextElement($3716b8caf7f959e2$var$_tmpl$),
|
|
9391
9465
|
_el$2 = _el$.firstChild,
|
|
@@ -9411,36 +9485,25 @@ function $3716b8caf7f959e2$export$6d0c9c22f6652669({
|
|
|
9411
9485
|
get children() {
|
|
9412
9486
|
return $gVhhF$solidjsweb.createComponent((0, $gVhhF$solidjs.Suspense), {
|
|
9413
9487
|
get fallback() {
|
|
9414
|
-
return (()
|
|
9415
|
-
|
|
9416
|
-
|
|
9417
|
-
|
|
9418
|
-
|
|
9419
|
-
|
|
9420
|
-
return $gVhhF$solidjs.createMemo(() => layout_options_().cols_at_size);
|
|
9421
|
-
}
|
|
9422
|
-
});
|
|
9423
|
-
})();
|
|
9488
|
+
return $gVhhF$solidjsweb.createComponent((0, $c2f92eb265a14529$export$4405d077f0a20494), {
|
|
9489
|
+
content_results_rows_: content_results_rows_,
|
|
9490
|
+
get cols_at_size_() {
|
|
9491
|
+
return $gVhhF$solidjs.createMemo(() => layout_options_().cols_at_size);
|
|
9492
|
+
}
|
|
9493
|
+
});
|
|
9424
9494
|
},
|
|
9425
9495
|
get children() {
|
|
9426
9496
|
return $gVhhF$solidjsweb.createComponent((0, $8781fcec27b20709$export$9ff751cd77687edc), {
|
|
9427
9497
|
router_: router_,
|
|
9428
|
-
search_results_: search_results_
|
|
9498
|
+
search_results_: search_results_,
|
|
9499
|
+
queries_without_content_results_: queries_without_content_results_,
|
|
9500
|
+
get_search_query_: get_search_query_
|
|
9429
9501
|
});
|
|
9430
9502
|
}
|
|
9431
9503
|
});
|
|
9432
9504
|
}
|
|
9433
9505
|
})), _el$5, _co$2);
|
|
9434
|
-
$gVhhF$solidjsweb.effect(
|
|
9435
|
-
const _v$ = !!is_showing_placeholders(),
|
|
9436
|
-
_v$2 = is_loading_() || content_results()?.length > 0 ? "" : "none";
|
|
9437
|
-
_v$ !== _p$._v$ && _el$.classList.toggle("loading", _p$._v$ = _v$);
|
|
9438
|
-
_v$2 !== _p$._v$2 && _el$.style.setProperty("display", _p$._v$2 = _v$2);
|
|
9439
|
-
return _p$;
|
|
9440
|
-
}, {
|
|
9441
|
-
_v$: undefined,
|
|
9442
|
-
_v$2: undefined
|
|
9443
|
-
});
|
|
9506
|
+
$gVhhF$solidjsweb.effect(() => _el$.style.setProperty("display", is_loading_() && placeholders_enabled() || content_results()?.length > 0 ? "" : "none"));
|
|
9444
9507
|
return _el$;
|
|
9445
9508
|
})();
|
|
9446
9509
|
}
|
|
@@ -9875,7 +9938,7 @@ const $2c61e4cd8229c49a$var$_tmpl$ = /*#__PURE__*/$gVhhF$solidjsweb.template(`<d
|
|
|
9875
9938
|
* Type for the private properties that are shared between the different exported search SDK wrapper functions. SDK users are not allowed to change/access these, they're an internal implementation detail.
|
|
9876
9939
|
*/
|
|
9877
9940
|
const $2c61e4cd8229c49a$var$privately_shared_properties = /*@__PURE__*/new WeakMap();
|
|
9878
|
-
const $2c61e4cd8229c49a$var$content_search_default =
|
|
9941
|
+
const $2c61e4cd8229c49a$var$content_search_default = true;
|
|
9879
9942
|
const $2c61e4cd8229c49a$var$min_products_to_fetch_ = 20;
|
|
9880
9943
|
const $2c61e4cd8229c49a$export$bde3eb976dfded9 = depict_search => $2c61e4cd8229c49a$var$privately_shared_properties.get(depict_search)?.search_query_updating_blocked_;
|
|
9881
9944
|
class $2c61e4cd8229c49a$export$ac6237957a15b3f0 {
|