@depict-ai/ui 1.4.25 → 2.0.0
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 +231 -170
- package/ES10/index.d.ts +27 -31
- package/ES10/index.js +233 -172
- package/README.md +2 -1
- package/latest/index.cjs +220 -166
- package/latest/index.d.ts +27 -31
- package/latest/index.js +222 -168
- package/locales/require.js +1152 -0
- package/package.json +7 -7
- package/server/ES10/index.cjs +190 -139
- package/server/ES10/index.d.ts +27 -31
- package/server/ES10/index.js +192 -141
- package/server/latest/index.cjs +180 -131
- package/server/latest/index.d.ts +27 -31
- package/server/latest/index.js +182 -133
package/ES10/index.cjs
CHANGED
|
@@ -66,7 +66,7 @@ $parcel$export(module.exports, "defaultColsAtSize", () => $33eed84f447aa0c0$expo
|
|
|
66
66
|
$parcel$export(module.exports, "defaultCategoryTitlePlugin", () => $33eed84f447aa0c0$export$7bf543b9d9be2c22);
|
|
67
67
|
$parcel$export(module.exports, "version", () => $aa1938dec50d6c12$export$83d89fbfd8236492);
|
|
68
68
|
/*! Depict.ai search and product listing SDK */
|
|
69
|
-
const $aa1938dec50d6c12$export$83d89fbfd8236492 = "
|
|
69
|
+
const $aa1938dec50d6c12$export$83d89fbfd8236492 = "2.0.0";
|
|
70
70
|
const $5401a6698b0c0658$var$transform_elements = sorted_cols_at_size => {
|
|
71
71
|
const cols_at_size = [];
|
|
72
72
|
for (let i = 0; i < sorted_cols_at_size.length; i++) {
|
|
@@ -140,7 +140,9 @@ function $b1ea8d47bcf03111$export$ff7109b9b2b206ba(sdk_cols_at_size) {
|
|
|
140
140
|
}
|
|
141
141
|
function $8edd3cf30d1fd8b4$export$a2cc176055f8f08() {
|
|
142
142
|
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.";
|
|
143
|
-
return (0, $52FdA$solidjsweb.isServer) ?
|
|
143
|
+
return (0, $52FdA$solidjsweb.isServer) ? {
|
|
144
|
+
t: "<!-- ".concat(text, " -->")
|
|
145
|
+
} : document.createComment(text);
|
|
144
146
|
}
|
|
145
147
|
function $e82d0d417fa613e8$export$2f0cbfbb4354bb52(elements) {
|
|
146
148
|
// FYI this probably doesn't work on hugely deep nestings or large amount of elements
|
|
@@ -366,9 +368,14 @@ function $1b3cf201cdd38687$export$b69d0d92862de18b(props) {
|
|
|
366
368
|
const $6c2c739b113a8ddf$var$_tmpl$ = /*#__PURE__*/$52FdA$solidjsweb.template(`<div></div>`, 2),
|
|
367
369
|
$6c2c739b113a8ddf$var$_tmpl$2 = /*#__PURE__*/$52FdA$solidjsweb.template(`<style type="text/css"></style>`, 2);
|
|
368
370
|
function $6c2c739b113a8ddf$export$d21e32dfedac04be(props) {
|
|
371
|
+
const container_class = "x" + $52FdA$solidjs.createUniqueId();
|
|
369
372
|
const container_element_ = (() => {
|
|
370
373
|
const _el$ = $52FdA$solidjsweb.getNextElement($6c2c739b113a8ddf$var$_tmpl$);
|
|
371
|
-
$52FdA$solidjsweb.spread(_el$, $52FdA$solidjsweb.mergeProps(() => props.element_attributes
|
|
374
|
+
$52FdA$solidjsweb.spread(_el$, $52FdA$solidjsweb.mergeProps(() => props.element_attributes, {
|
|
375
|
+
"classList": {
|
|
376
|
+
[container_class]: true
|
|
377
|
+
}
|
|
378
|
+
}), false, true);
|
|
372
379
|
$52FdA$solidjsweb.insert(_el$, () => props.children);
|
|
373
380
|
$52FdA$solidjsweb.runHydrationEvents();
|
|
374
381
|
return _el$;
|
|
@@ -379,12 +386,18 @@ function $6c2c739b113a8ddf$export$d21e32dfedac04be(props) {
|
|
|
379
386
|
},
|
|
380
387
|
severity_: "error",
|
|
381
388
|
get children() {
|
|
382
|
-
return $6c2c739b113a8ddf$export$445d8d3f5f706a40(props, container_element_);
|
|
389
|
+
return $6c2c739b113a8ddf$export$445d8d3f5f706a40(props, container_element_, false, container_class);
|
|
383
390
|
}
|
|
384
391
|
});
|
|
385
392
|
}
|
|
386
393
|
function $6c2c739b113a8ddf$export$445d8d3f5f706a40(props, container_element) {
|
|
387
394
|
let insert_after_container = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
|
|
395
|
+
let container_class = arguments.length > 3 ? arguments[3] : undefined;
|
|
396
|
+
if (!container_class) {
|
|
397
|
+
// only try to add if it wasn't provided, so that we have a code path without classList when doing SSR
|
|
398
|
+
container_class = $52FdA$depictaiutilishared.make_random_classname();
|
|
399
|
+
container_element.classList.add(container_class);
|
|
400
|
+
}
|
|
388
401
|
// Copy of Layout from utilishared but using solid-js signals instead of async iterable IPNS
|
|
389
402
|
const show_all_rows = $52FdA$solidjs.createMemo(() => props.rows === "all");
|
|
390
403
|
const rows_or_empty_object = $52FdA$solidjs.createMemo(() => show_all_rows() ? {} : props.rows);
|
|
@@ -399,10 +412,9 @@ function $6c2c739b113a8ddf$export$445d8d3f5f706a40(props, container_element) {
|
|
|
399
412
|
return !(!button || Array.isArray(button) && !button.length);
|
|
400
413
|
});
|
|
401
414
|
const [get_styling, set_styling] = $52FdA$solidjs.createSignal();
|
|
402
|
-
const container_class = $52FdA$depictaiutilishared.make_random_classname();
|
|
403
415
|
const selector_beginning = ".depict .".concat(container_class, ">"); // class so ppl can have id if needed
|
|
404
416
|
const [get_children_count, set_children_count] = $52FdA$solidjs.createSignal(0);
|
|
405
|
-
const update_children_count = () => set_children_count(container_element.children.length);
|
|
417
|
+
const update_children_count = () => (0, $52FdA$solidjsweb.isServer) ? 20 : set_children_count(container_element.children.length);
|
|
406
418
|
const col_styling = $52FdA$solidjs.createMemo(() => $52FdA$depictaiutilishared.n_col_styling_with_dist(selector_beginning, props.grid_spacing, props.cols_at_size, props.layout, props.override_vertical_spacing));
|
|
407
419
|
const default_currently_visible_signal = $52FdA$solidjs.createSignal($52FdA$solidjs.untrack(() => {
|
|
408
420
|
var _rows_or_empty_object;
|
|
@@ -411,43 +423,39 @@ function $6c2c739b113a8ddf$export$445d8d3f5f706a40(props, container_element) {
|
|
|
411
423
|
const rows_visible_signal = $52FdA$solidjs.createMemo(() => rows_or_empty_object().currently_visible || default_currently_visible_signal);
|
|
412
424
|
const get_rows_visible = $52FdA$solidjs.createMemo(() => rows_visible_signal()[0]());
|
|
413
425
|
const set_rows_visible = $52FdA$solidjs.createMemo(() => rows_visible_signal()[1]);
|
|
414
|
-
const view_more_button_class = $52FdA$
|
|
415
|
-
const view_less_button_class = $52FdA$
|
|
416
|
-
const style_element = (() => {
|
|
417
|
-
const _el$2 = $52FdA$solidjsweb.getNextElement($6c2c739b113a8ddf$var$_tmpl$2);
|
|
418
|
-
$52FdA$solidjsweb.insert(_el$2, get_styling);
|
|
419
|
-
return _el$2;
|
|
420
|
-
})();
|
|
426
|
+
const view_more_button_class = "m" + $52FdA$solidjs.createUniqueId();
|
|
427
|
+
const view_less_button_class = "l" + $52FdA$solidjs.createUniqueId(); // https://github.com/solidjs/solid-docs/issues/263#issuecomment-1622388079
|
|
421
428
|
const view_more_button_container = $52FdA$solidjs.createMemo(() => have_a_view_more_button() && (() => {
|
|
422
|
-
const _el$
|
|
423
|
-
$52FdA$solidjsweb.addEventListener(_el$
|
|
429
|
+
const _el$2 = $52FdA$solidjsweb.getNextElement($6c2c739b113a8ddf$var$_tmpl$);
|
|
430
|
+
$52FdA$solidjsweb.addEventListener(_el$2, "click", $52FdA$depictaiutilishared.catchify(() => set_rows_visible()(prev => {
|
|
424
431
|
var _rows_or_empty_object2;
|
|
425
432
|
return prev + ((_rows_or_empty_object2 = rows_or_empty_object().rows_per_click) !== null && _rows_or_empty_object2 !== void 0 ? _rows_or_empty_object2 : 1);
|
|
426
433
|
})), true);
|
|
427
|
-
$52FdA$solidjsweb.className(_el$
|
|
428
|
-
$52FdA$solidjsweb.insert(_el$
|
|
434
|
+
$52FdA$solidjsweb.className(_el$2, "load-more-container ".concat(view_more_button_class));
|
|
435
|
+
$52FdA$solidjsweb.insert(_el$2, () => rows_or_empty_object().button);
|
|
429
436
|
$52FdA$solidjsweb.runHydrationEvents();
|
|
430
|
-
return _el$
|
|
437
|
+
return _el$2;
|
|
431
438
|
})());
|
|
432
439
|
// 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
|
|
433
440
|
const view_less_button_container = $52FdA$solidjs.createMemo(() => have_a_view_less_button() && (() => {
|
|
434
|
-
const _el$
|
|
435
|
-
$52FdA$solidjsweb.addEventListener(_el$
|
|
441
|
+
const _el$3 = $52FdA$solidjsweb.getNextElement($6c2c739b113a8ddf$var$_tmpl$);
|
|
442
|
+
$52FdA$solidjsweb.addEventListener(_el$3, "click", $52FdA$depictaiutilishared.catchify(() => set_rows_visible()(() => {
|
|
436
443
|
var _rows_or_empty_object3;
|
|
437
444
|
return (_rows_or_empty_object3 = rows_or_empty_object().start_rows) !== null && _rows_or_empty_object3 !== void 0 ? _rows_or_empty_object3 : 1;
|
|
438
445
|
})), true);
|
|
439
|
-
$52FdA$solidjsweb.className(_el$
|
|
440
|
-
$52FdA$solidjsweb.insert(_el$
|
|
446
|
+
$52FdA$solidjsweb.className(_el$3, "load-less-container ".concat(view_less_button_class));
|
|
447
|
+
$52FdA$solidjsweb.insert(_el$3, () => rows_or_empty_object().view_less_button);
|
|
441
448
|
$52FdA$solidjsweb.runHydrationEvents();
|
|
442
|
-
return _el$
|
|
449
|
+
return _el$3;
|
|
443
450
|
})());
|
|
444
|
-
|
|
451
|
+
const [force_style_update, set_force_style_update] = $52FdA$solidjs.createSignal("");
|
|
445
452
|
$52FdA$solidjs.createComputed(() => {
|
|
446
453
|
// Make sure we don't have more rows visible than max_rows (this could happen by max_rows being decreased)
|
|
447
454
|
const rows_visible = get_rows_visible();
|
|
448
455
|
const max_rows = rows_or_empty_object().max_rows;
|
|
449
456
|
if (!isNaN(max_rows) && max_rows >= 0 && rows_visible > max_rows) set_rows_visible()(max_rows);
|
|
450
457
|
});
|
|
458
|
+
$52FdA$solidjs.createEffect(() => set_force_style_update(" ")); // force style update after hydration due to https://discord.com/channels/722131463138705510/722167424186843267/1151544212517552168
|
|
451
459
|
$52FdA$solidjs.createRenderEffect(() => {
|
|
452
460
|
// Be careful to only read show_all_rows in here (ofc doesn't apply to nested effects)
|
|
453
461
|
if (show_all_rows()) {
|
|
@@ -456,11 +464,13 @@ function $6c2c739b113a8ddf$export$445d8d3f5f706a40(props, container_element) {
|
|
|
456
464
|
return;
|
|
457
465
|
}
|
|
458
466
|
update_children_count();
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
467
|
+
if (!(0, $52FdA$solidjsweb.isServer)) {
|
|
468
|
+
const mutation_observer = new MutationObserver($52FdA$depictaiutilishared.catchify(update_children_count));
|
|
469
|
+
mutation_observer.observe(container_element, {
|
|
470
|
+
childList: true
|
|
471
|
+
});
|
|
472
|
+
$52FdA$solidjs.onCleanup(() => mutation_observer.disconnect());
|
|
473
|
+
}
|
|
464
474
|
set_styling(
|
|
465
475
|
// this is needed because solid will think that the memo-accessor is a setter function otherwise
|
|
466
476
|
() => $52FdA$solidjs.createMemo(() => {
|
|
@@ -471,7 +481,7 @@ function $6c2c739b113a8ddf$export$445d8d3f5f706a40(props, container_element) {
|
|
|
471
481
|
} = rows_or_empty_object();
|
|
472
482
|
const rows_visible = get_rows_visible();
|
|
473
483
|
const children_count = get_children_count();
|
|
474
|
-
return col_styling() + props.cols_at_size.map(options => {
|
|
484
|
+
return force_style_update() + col_styling() + props.cols_at_size.map(options => {
|
|
475
485
|
const [recs_per_row, min, max] = options;
|
|
476
486
|
let should_hide_view_more_button;
|
|
477
487
|
let visible_recs;
|
|
@@ -492,6 +502,11 @@ function $6c2c739b113a8ddf$export$445d8d3f5f706a40(props, container_element) {
|
|
|
492
502
|
}).join("");
|
|
493
503
|
}));
|
|
494
504
|
});
|
|
505
|
+
const style_element = (() => {
|
|
506
|
+
const _el$4 = $52FdA$solidjsweb.getNextElement($6c2c739b113a8ddf$var$_tmpl$2);
|
|
507
|
+
$52FdA$solidjsweb.insert(_el$4, get_styling);
|
|
508
|
+
return _el$4;
|
|
509
|
+
})(); // need to create this after set_styling has been called or else there will be no styling in the SSR'd output
|
|
495
510
|
if (insert_after_container) container_element.after(style_element);
|
|
496
511
|
return [container_element, $52FdA$solidjsweb.memo(view_more_button_container), $52FdA$solidjsweb.memo(view_less_button_container), style_element];
|
|
497
512
|
}
|
|
@@ -522,18 +537,26 @@ function $ad8ec7729fffeb9c$export$6649caad96ef8870(_ref) {
|
|
|
522
537
|
slider_ref_: slider_ref_,
|
|
523
538
|
faded_opacity_ = 0.7,
|
|
524
539
|
mutation_plugins_ = [],
|
|
525
|
-
disable_fading_: disable_fading_
|
|
540
|
+
disable_fading_: disable_fading_,
|
|
541
|
+
arrow_width_: arrow_width_,
|
|
542
|
+
arrow_height_: arrow_height_
|
|
526
543
|
} = _ref;
|
|
527
544
|
const slider = new (0, $52FdA$depictaiutilishared.Amazing_Slider)({
|
|
528
545
|
button_contents: {
|
|
529
546
|
left: [(() => {
|
|
530
547
|
const _el$ = $52FdA$solidjsweb.getNextElement($ad8ec7729fffeb9c$var$_tmpl$);
|
|
531
|
-
$52FdA$solidjsweb.insert(_el$, $52FdA$solidjsweb.createComponent((0, $9d19451330d04c3c$export$8be2714ec7f169ee), {
|
|
548
|
+
$52FdA$solidjsweb.insert(_el$, $52FdA$solidjsweb.createComponent((0, $9d19451330d04c3c$export$8be2714ec7f169ee), {
|
|
549
|
+
height_: arrow_height_,
|
|
550
|
+
width_: arrow_width_
|
|
551
|
+
}));
|
|
532
552
|
return _el$;
|
|
533
553
|
})()],
|
|
534
554
|
right: [(() => {
|
|
535
555
|
const _el$2 = $52FdA$solidjsweb.getNextElement($ad8ec7729fffeb9c$var$_tmpl$);
|
|
536
|
-
$52FdA$solidjsweb.insert(_el$2, $52FdA$solidjsweb.createComponent((0, $9d19451330d04c3c$export$8be2714ec7f169ee), {
|
|
556
|
+
$52FdA$solidjsweb.insert(_el$2, $52FdA$solidjsweb.createComponent((0, $9d19451330d04c3c$export$8be2714ec7f169ee), {
|
|
557
|
+
height_: arrow_height_,
|
|
558
|
+
width_: arrow_width_
|
|
559
|
+
}));
|
|
537
560
|
return _el$2;
|
|
538
561
|
})()]
|
|
539
562
|
},
|
|
@@ -562,6 +585,8 @@ function $236a257ee52e5414$export$d41d19e89346fa2(_ref) {
|
|
|
562
585
|
});
|
|
563
586
|
const num_placeholders_ = () => 20;
|
|
564
587
|
const slider = $52FdA$solidjsweb.createComponent((0, $ad8ec7729fffeb9c$export$6649caad96ef8870), {
|
|
588
|
+
arrow_height_: 25,
|
|
589
|
+
arrow_width_: 12.5,
|
|
565
590
|
disable_fading_: true,
|
|
566
591
|
slider_ref_: slider => {
|
|
567
592
|
const {
|
|
@@ -606,36 +631,68 @@ function $236a257ee52e5414$export$d41d19e89346fa2(_ref) {
|
|
|
606
631
|
children: slider
|
|
607
632
|
});
|
|
608
633
|
}
|
|
634
|
+
function $d05611ff6b8c8357$export$23fca46f3143581f(component, error_message) {
|
|
635
|
+
const component_in_error_boundary = do_with_elements => {
|
|
636
|
+
const error_boundary_wrapped = $1b3cf201cdd38687$export$b69d0d92862de18b({
|
|
637
|
+
severity_: "error",
|
|
638
|
+
message_: error_message,
|
|
639
|
+
get children() {
|
|
640
|
+
const elements = component();
|
|
641
|
+
do_with_elements === null || do_with_elements === void 0 || do_with_elements(elements);
|
|
642
|
+
return elements;
|
|
643
|
+
}
|
|
644
|
+
});
|
|
645
|
+
// This might return an accessor, in that case we need to "unwrap" it since our SDK consumers expect HTML elements or arrays thereof
|
|
646
|
+
if (typeof error_boundary_wrapped === "function")
|
|
647
|
+
// @ts-ignore
|
|
648
|
+
return error_boundary_wrapped();
|
|
649
|
+
// On the server it returns a string, so we just return that
|
|
650
|
+
return error_boundary_wrapped;
|
|
651
|
+
};
|
|
652
|
+
const owner = $52FdA$solidjs.getOwner();
|
|
653
|
+
if (owner == null) return $52FdA$solidjs.createRoot(dispose => {
|
|
654
|
+
// 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
|
|
655
|
+
return component_in_error_boundary(elements => {
|
|
656
|
+
const have_multiple = Array.isArray(elements);
|
|
657
|
+
if (have_multiple ? !(elements !== null && elements !== void 0 && elements.length) : !elements) return;
|
|
658
|
+
(0, $52FdA$depictaiutilishared.observer).onremoved(have_multiple ? elements[0] : elements, dispose);
|
|
659
|
+
});
|
|
660
|
+
});else
|
|
661
|
+
// we're already in a root so cleanups are handled
|
|
662
|
+
return component_in_error_boundary();
|
|
663
|
+
}
|
|
609
664
|
const $2badc30d7c6610e1$var$_tmpl$ = /*#__PURE__*/$52FdA$solidjsweb.template(`<div class="depict recommendations"></div>`, 2);
|
|
610
665
|
function $2badc30d7c6610e1$export$9574e176201e5e8d(props) {
|
|
611
|
-
|
|
612
|
-
const {
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
grid_spacing
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
666
|
+
return $d05611ff6b8c8357$export$23fca46f3143581f(() => {
|
|
667
|
+
const grid_spacing_override = $52FdA$solidjs.createMemo(() => {
|
|
668
|
+
const {
|
|
669
|
+
grid_spacing: grid_spacing
|
|
670
|
+
} = props; // can be reactive
|
|
671
|
+
return typeof grid_spacing === "string" ? {
|
|
672
|
+
grid_spacing: grid_spacing
|
|
673
|
+
} : {
|
|
674
|
+
override_vertical_spacing: grid_spacing.vertical,
|
|
675
|
+
grid_spacing: grid_spacing.horizontal
|
|
676
|
+
};
|
|
677
|
+
});
|
|
678
|
+
const [recommendations_resource_] = $52FdA$solidjs.createResource(() => props.recommendations, recs => recs);
|
|
679
|
+
return (() => {
|
|
680
|
+
const _el$ = $52FdA$solidjsweb.getNextElement($2badc30d7c6610e1$var$_tmpl$);
|
|
681
|
+
$52FdA$solidjsweb.insert(_el$, () => $236a257ee52e5414$export$d41d19e89346fa2({
|
|
682
|
+
product_card_template_: function () {
|
|
683
|
+
return props.product_card_template(...arguments);
|
|
684
|
+
},
|
|
685
|
+
recommendations_resource_: recommendations_resource_,
|
|
686
|
+
market_: () => props.market,
|
|
687
|
+
merchant_: () => props.merchant,
|
|
688
|
+
layout_options_: $52FdA$solidjs.createMemo(() => ({
|
|
689
|
+
cols_at_size: $5401a6698b0c0658$export$6daf8749b65a1b77($b1ea8d47bcf03111$export$ff7109b9b2b206ba(props.cols_at_size)),
|
|
690
|
+
...grid_spacing_override()
|
|
691
|
+
}))
|
|
692
|
+
}));
|
|
693
|
+
return _el$;
|
|
694
|
+
})();
|
|
695
|
+
}, "RecommendationSlider failed");
|
|
639
696
|
}
|
|
640
697
|
const $2c920813c92d6987$var$_tmpl$ = /*#__PURE__*/$52FdA$solidjsweb.template(`<div class="recommendation-grid"><!#><!/><!#><!/></div>`, 6);
|
|
641
698
|
function $2c920813c92d6987$export$7da560f849543dff(_ref) {
|
|
@@ -702,48 +759,51 @@ function $2c920813c92d6987$export$7da560f849543dff(_ref) {
|
|
|
702
759
|
const $41227f10ad680afd$var$_tmpl$ = /*#__PURE__*/$52FdA$solidjsweb.template(`<button class="show-more major" type="button"></button>`, 2),
|
|
703
760
|
$41227f10ad680afd$var$_tmpl$2 = /*#__PURE__*/$52FdA$solidjsweb.template(`<div class="depict plp recommendations"></div>`, 2);
|
|
704
761
|
function $41227f10ad680afd$export$9756467d34d91cdb(props) {
|
|
705
|
-
|
|
706
|
-
const
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
const
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
762
|
+
return $d05611ff6b8c8357$export$23fca46f3143581f(() => {
|
|
763
|
+
const rows_object_ = $52FdA$solidjs.createMemo(() => {
|
|
764
|
+
var _view_more_button$row;
|
|
765
|
+
const view_more_button = props.view_more_button;
|
|
766
|
+
if (!view_more_button) return "all";
|
|
767
|
+
return {
|
|
768
|
+
start_rows: view_more_button.start_rows,
|
|
769
|
+
rows_per_click: (_view_more_button$row = view_more_button.rows_per_click) !== null && _view_more_button$row !== void 0 ? _view_more_button$row : 2,
|
|
770
|
+
button: (() => {
|
|
771
|
+
const _el$ = $52FdA$solidjsweb.getNextElement($41227f10ad680afd$var$_tmpl$);
|
|
772
|
+
$52FdA$solidjsweb.insert(_el$, () => view_more_button.text);
|
|
773
|
+
return _el$;
|
|
774
|
+
})()
|
|
775
|
+
};
|
|
776
|
+
});
|
|
777
|
+
const grid_spacing_override = $52FdA$solidjs.createMemo(() => {
|
|
778
|
+
const {
|
|
779
|
+
grid_spacing: grid_spacing
|
|
780
|
+
} = props; // can be reactive
|
|
781
|
+
return typeof grid_spacing === "string" ? {
|
|
782
|
+
grid_spacing: grid_spacing
|
|
783
|
+
} : {
|
|
784
|
+
override_vertical_spacing: grid_spacing.vertical,
|
|
785
|
+
grid_spacing: grid_spacing.horizontal
|
|
786
|
+
};
|
|
787
|
+
});
|
|
788
|
+
const [recommendations_resource_] = $52FdA$solidjs.createResource(() => props.recommendations, recs => recs);
|
|
789
|
+
return (() => {
|
|
790
|
+
const _el$2 = $52FdA$solidjsweb.getNextElement($41227f10ad680afd$var$_tmpl$2);
|
|
791
|
+
$52FdA$solidjsweb.insert(_el$2, () => $2c920813c92d6987$export$7da560f849543dff({
|
|
792
|
+
rows_object_: rows_object_,
|
|
793
|
+
product_card_template_: function () {
|
|
794
|
+
return props.product_card_template(...arguments);
|
|
795
|
+
},
|
|
796
|
+
recommendations_resource_: recommendations_resource_,
|
|
797
|
+
market_: () => props.market,
|
|
798
|
+
merchant_: () => props.merchant,
|
|
799
|
+
layout_options_: $52FdA$solidjs.createMemo(() => ({
|
|
800
|
+
cols_at_size: $5401a6698b0c0658$export$6daf8749b65a1b77($b1ea8d47bcf03111$export$ff7109b9b2b206ba(props.cols_at_size)),
|
|
801
|
+
...grid_spacing_override()
|
|
802
|
+
}))
|
|
803
|
+
}));
|
|
804
|
+
return _el$2;
|
|
805
|
+
})();
|
|
806
|
+
}, "RecommendationGrid failed");
|
|
747
807
|
}
|
|
748
808
|
const $858fdcf73148519f$var$_tmpl$ = /*#__PURE__*/$52FdA$solidjsweb.template(`<img>`, 1);
|
|
749
809
|
function $858fdcf73148519f$export$e6fffe67d4cdd848(whatToWatch) {
|
|
@@ -1434,7 +1494,7 @@ const $6b92e147c6e24046$export$48513f6b9f8ce62d = props => {
|
|
|
1434
1494
|
const label = $52FdA$solidjs.createMemo(() => props.label_);
|
|
1435
1495
|
const checked = $52FdA$solidjs.createMemo(() => props.checked_);
|
|
1436
1496
|
const value = $52FdA$solidjs.createMemo(() => props.value_);
|
|
1437
|
-
const is_count_zero = $52FdA$solidjs.createMemo(() => props.is_count_zero_);
|
|
1497
|
+
const is_count_zero = $52FdA$solidjs.createMemo(() => props.is_count_zero_ || count() === 0);
|
|
1438
1498
|
const id = $52FdA$depictaiutilishared.make_random_classname();
|
|
1439
1499
|
return (/* We can't use actual margin because ExpandingContainer gets messed up */(() => {
|
|
1440
1500
|
const _el$ = $52FdA$solidjsweb.getNextElement($6b92e147c6e24046$var$_tmpl$2),
|
|
@@ -1474,14 +1534,17 @@ const $6b92e147c6e24046$export$48513f6b9f8ce62d = props => {
|
|
|
1474
1534
|
}
|
|
1475
1535
|
}), _el$8, _co$);
|
|
1476
1536
|
$52FdA$solidjsweb.effect(_p$ => {
|
|
1477
|
-
const _v$ = !!
|
|
1478
|
-
_v$2 = value()
|
|
1537
|
+
const _v$ = !!is_count_zero(),
|
|
1538
|
+
_v$2 = value(),
|
|
1539
|
+
_v$3 = !checked() && is_count_zero();
|
|
1479
1540
|
_v$ !== _p$._v$ && _el$.classList.toggle("count-0", _p$._v$ = _v$);
|
|
1480
1541
|
_v$2 !== _p$._v$2 && $52FdA$solidjsweb.setAttribute(_el$3, "name", _p$._v$2 = _v$2);
|
|
1542
|
+
_v$3 !== _p$._v$3 && (_el$3.disabled = _p$._v$3 = _v$3);
|
|
1481
1543
|
return _p$;
|
|
1482
1544
|
}, {
|
|
1483
1545
|
_v$: undefined,
|
|
1484
|
-
_v$2: undefined
|
|
1546
|
+
_v$2: undefined,
|
|
1547
|
+
_v$3: undefined
|
|
1485
1548
|
});
|
|
1486
1549
|
$52FdA$solidjsweb.effect(() => _el$3.checked = checked());
|
|
1487
1550
|
return _el$;
|
|
@@ -2384,6 +2447,10 @@ function $9c1d49181fb3002a$var$render_stuff(data, existing_filter, i18n_) {
|
|
|
2384
2447
|
});
|
|
2385
2448
|
}
|
|
2386
2449
|
}), _el$16, _co$5);
|
|
2450
|
+
$52FdA$solidjsweb.effect(() => {
|
|
2451
|
+
var _value12;
|
|
2452
|
+
return _el$14.classList.toggle("count-0", !!(((_value12 = value()) === null || _value12 === void 0 ? void 0 : _value12.count_) === 0));
|
|
2453
|
+
});
|
|
2387
2454
|
return _el$12;
|
|
2388
2455
|
})();
|
|
2389
2456
|
},
|
|
@@ -2404,8 +2471,8 @@ function $9c1d49181fb3002a$var$render_stuff(data, existing_filter, i18n_) {
|
|
|
2404
2471
|
},
|
|
2405
2472
|
get children() {
|
|
2406
2473
|
return $9c1d49181fb3002a$var$render_stuff($52FdA$solidjs.createMemo(() => {
|
|
2407
|
-
var
|
|
2408
|
-
return ((
|
|
2474
|
+
var _value13;
|
|
2475
|
+
return ((_value13 = value()) === null || _value13 === void 0 ? void 0 : _value13.children_) || {};
|
|
2409
2476
|
}), existing_filter, i18n_);
|
|
2410
2477
|
}
|
|
2411
2478
|
});
|
|
@@ -2592,7 +2659,8 @@ function $9c1d49181fb3002a$var$expand_until_choice(data_structure) {
|
|
|
2592
2659
|
});
|
|
2593
2660
|
}
|
|
2594
2661
|
const $cd0e5524f9476f9b$var$_tmpl$ = /*#__PURE__*/$52FdA$solidjsweb.template(`<div class="checkbox-grid"></div>`, 2),
|
|
2595
|
-
$cd0e5524f9476f9b$var$_tmpl$2 = /*#__PURE__*/$52FdA$solidjsweb.template(`<
|
|
2662
|
+
$cd0e5524f9476f9b$var$_tmpl$2 = /*#__PURE__*/$52FdA$solidjsweb.template(`<span class="count-wrapper"><span class="count"></span></span>`, 4),
|
|
2663
|
+
$cd0e5524f9476f9b$var$_tmpl$3 = /*#__PURE__*/$52FdA$solidjsweb.template(`<button class="major-minor-transition"><!#><!/><!#><!/></button>`, 6);
|
|
2596
2664
|
const $cd0e5524f9476f9b$export$414f6a19d38e655c = _ref => {
|
|
2597
2665
|
let {
|
|
2598
2666
|
filter_: filter_,
|
|
@@ -2634,7 +2702,11 @@ const $cd0e5524f9476f9b$export$414f6a19d38e655c = _ref => {
|
|
|
2634
2702
|
return (_existing_filter = existing_filter()) === null || _existing_filter === void 0 ? void 0 : (_existing_filter$data = _existing_filter.data) === null || _existing_filter$data === void 0 ? void 0 : _existing_filter$data.includes(value().value_);
|
|
2635
2703
|
});
|
|
2636
2704
|
return (() => {
|
|
2637
|
-
const _el$2 = $52FdA$solidjsweb.getNextElement($cd0e5524f9476f9b$var$_tmpl$
|
|
2705
|
+
const _el$2 = $52FdA$solidjsweb.getNextElement($cd0e5524f9476f9b$var$_tmpl$3),
|
|
2706
|
+
_el$5 = _el$2.firstChild,
|
|
2707
|
+
[_el$6, _co$] = $52FdA$solidjsweb.getNextMarker(_el$5.nextSibling),
|
|
2708
|
+
_el$7 = _el$6.nextSibling,
|
|
2709
|
+
[_el$8, _co$2] = $52FdA$solidjsweb.getNextMarker(_el$7.nextSibling);
|
|
2638
2710
|
$52FdA$solidjsweb.addEventListener(_el$2, "click", $52FdA$depictaiutilishared.catchify(() => {
|
|
2639
2711
|
const set_filter = existing_filter();
|
|
2640
2712
|
const {
|
|
@@ -2655,16 +2727,30 @@ const $cd0e5524f9476f9b$export$414f6a19d38e655c = _ref => {
|
|
|
2655
2727
|
const selected_filters = [...get_selected_filters().filter(f => f !== set_filter), ...(new_filter_object.data.length ? [new_filter_object] : [])];
|
|
2656
2728
|
set_selected_filters(selected_filters);
|
|
2657
2729
|
}), true);
|
|
2658
|
-
$52FdA$solidjsweb.insert(_el$2, () => value().value_);
|
|
2730
|
+
$52FdA$solidjsweb.insert(_el$2, () => value().value_, _el$6, _co$);
|
|
2731
|
+
$52FdA$solidjsweb.insert(_el$2, $52FdA$solidjsweb.createComponent((0, $52FdA$solidjs.Show), {
|
|
2732
|
+
get when() {
|
|
2733
|
+
return value().count_ != undefined;
|
|
2734
|
+
},
|
|
2735
|
+
get children() {
|
|
2736
|
+
const _el$3 = $52FdA$solidjsweb.getNextElement($cd0e5524f9476f9b$var$_tmpl$2),
|
|
2737
|
+
_el$4 = _el$3.firstChild;
|
|
2738
|
+
$52FdA$solidjsweb.insert(_el$4, () => value().count_);
|
|
2739
|
+
return _el$3;
|
|
2740
|
+
}
|
|
2741
|
+
}), _el$8, _co$2);
|
|
2659
2742
|
$52FdA$solidjsweb.effect(_p$ => {
|
|
2660
|
-
const _v$ = !is_selected(),
|
|
2661
|
-
_v$2 =
|
|
2662
|
-
|
|
2663
|
-
_v$
|
|
2743
|
+
const _v$ = value().count_ === 0 && !is_selected(),
|
|
2744
|
+
_v$2 = !is_selected(),
|
|
2745
|
+
_v$3 = !!is_selected();
|
|
2746
|
+
_v$ !== _p$._v$ && (_el$2.disabled = _p$._v$ = _v$);
|
|
2747
|
+
_v$2 !== _p$._v$2 && _el$2.classList.toggle("minor", _p$._v$2 = _v$2);
|
|
2748
|
+
_v$3 !== _p$._v$3 && _el$2.classList.toggle("major", _p$._v$3 = _v$3);
|
|
2664
2749
|
return _p$;
|
|
2665
2750
|
}, {
|
|
2666
2751
|
_v$: undefined,
|
|
2667
|
-
_v$2: undefined
|
|
2752
|
+
_v$2: undefined,
|
|
2753
|
+
_v$3: undefined
|
|
2668
2754
|
});
|
|
2669
2755
|
$52FdA$solidjsweb.runHydrationEvents();
|
|
2670
2756
|
return _el$2;
|
|
@@ -6799,35 +6885,6 @@ function $ede6c70ecdca46fe$export$f7d2f673fc2f091d(_ref) {
|
|
|
6799
6885
|
return _el$13;
|
|
6800
6886
|
})()];
|
|
6801
6887
|
}
|
|
6802
|
-
function $d05611ff6b8c8357$export$23fca46f3143581f(component, error_message) {
|
|
6803
|
-
const component_in_error_boundary = do_with_elements => {
|
|
6804
|
-
const error_boundary_wrapped = $1b3cf201cdd38687$export$b69d0d92862de18b({
|
|
6805
|
-
severity_: "error",
|
|
6806
|
-
message_: error_message,
|
|
6807
|
-
get children() {
|
|
6808
|
-
const elements = component();
|
|
6809
|
-
do_with_elements === null || do_with_elements === void 0 || do_with_elements(elements);
|
|
6810
|
-
return elements;
|
|
6811
|
-
}
|
|
6812
|
-
});
|
|
6813
|
-
// This might return an accessor, in that case we need to "unwrap" it since our SDK consumers expect HTML elements or arrays thereof
|
|
6814
|
-
if (typeof error_boundary_wrapped === "function")
|
|
6815
|
-
// @ts-ignore
|
|
6816
|
-
return error_boundary_wrapped();
|
|
6817
|
-
// On the server it returns a string, so we just return that
|
|
6818
|
-
return error_boundary_wrapped;
|
|
6819
|
-
};
|
|
6820
|
-
const owner = $52FdA$solidjs.getOwner();
|
|
6821
|
-
if (owner == null) return $52FdA$solidjs.createRoot(dispose => {
|
|
6822
|
-
// 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
|
|
6823
|
-
return component_in_error_boundary(elements => {
|
|
6824
|
-
if (!(elements !== null && elements !== void 0 && elements.length)) return;
|
|
6825
|
-
(0, $52FdA$depictaiutilishared.observer).onremoved(elements[0], dispose);
|
|
6826
|
-
});
|
|
6827
|
-
});else
|
|
6828
|
-
// we're already in a root so cleanups are handled
|
|
6829
|
-
return component_in_error_boundary();
|
|
6830
|
-
}
|
|
6831
6888
|
function $5dd9d0d3ea82e2dd$export$477caf01aecaeb2a(options) {
|
|
6832
6889
|
var _globalThis$location$, _globalThis$location;
|
|
6833
6890
|
const router_ = options.router_;
|
|
@@ -8622,7 +8679,7 @@ function $3cf7b4db1e203c93$export$605674723bcc715c() {
|
|
|
8622
8679
|
const $0677d509ad208e22$var$_tmpl$ = /*#__PURE__*/$52FdA$solidjsweb.template(`<a class="suggestion"></a>`, 2),
|
|
8623
8680
|
$0677d509ad208e22$var$_tmpl$2 = /*#__PURE__*/$52FdA$solidjsweb.template(`<div class="search-icon"></div>`, 2),
|
|
8624
8681
|
$0677d509ad208e22$var$_tmpl$3 = /*#__PURE__*/$52FdA$solidjsweb.template(`<span class="type"></span>`, 2),
|
|
8625
|
-
$0677d509ad208e22$var$_tmpl$4 = /*#__PURE__*/$52FdA$solidjsweb.template(`<div><!#><!/><span class="value"></span></div>`, 6),
|
|
8682
|
+
$0677d509ad208e22$var$_tmpl$4 = /*#__PURE__*/$52FdA$solidjsweb.template(`<div class="with-parent-title"><!#><!/><span class="value line-clamp"></span></div>`, 6),
|
|
8626
8683
|
$0677d509ad208e22$var$_tmpl$5 = /*#__PURE__*/$52FdA$solidjsweb.template(`<div class="with-icon"><!#><!/><!#><!/></div>`, 6),
|
|
8627
8684
|
$0677d509ad208e22$var$_tmpl$6 = /*#__PURE__*/$52FdA$solidjsweb.template(`<h2 class="text"></h2>`, 2),
|
|
8628
8685
|
$0677d509ad208e22$var$_tmpl$7 = /*#__PURE__*/$52FdA$solidjsweb.template(`<div class="suggestion-container query"><!#><!/><!#><!/></div>`, 6),
|
|
@@ -10016,7 +10073,9 @@ function $f1fc9ea3e7632eba$export$f631859cab12b342(_ref) {
|
|
|
10016
10073
|
function $bf4a8d57aa8dd1c8$export$9ff751cd77687edc(_ref) {
|
|
10017
10074
|
let {
|
|
10018
10075
|
search_results_: search_results_,
|
|
10019
|
-
router_: router_
|
|
10076
|
+
router_: router_,
|
|
10077
|
+
queries_without_content_results_: queries_without_content_results_,
|
|
10078
|
+
get_search_query_: get_search_query_
|
|
10020
10079
|
} = _ref;
|
|
10021
10080
|
const content_results = $52FdA$solidjs.createMemo(() => {
|
|
10022
10081
|
var _search_results_;
|
|
@@ -10032,6 +10091,10 @@ function $bf4a8d57aa8dd1c8$export$9ff751cd77687edc(_ref) {
|
|
|
10032
10091
|
}
|
|
10033
10092
|
return map;
|
|
10034
10093
|
});
|
|
10094
|
+
$52FdA$solidjs.createEffect(() => {
|
|
10095
|
+
const results = content_results();
|
|
10096
|
+
if (Array.isArray(results) && results.length === 0) queries_without_content_results_.add($52FdA$solidjs.untrack(get_search_query_));
|
|
10097
|
+
});
|
|
10035
10098
|
return $52FdA$solidjsweb.createComponent((0, $52FdA$solidjs.For), {
|
|
10036
10099
|
get each() {
|
|
10037
10100
|
return [...content_results_by_page_url().keys()];
|
|
@@ -10098,8 +10161,15 @@ function $eab939d0b95b75ee$export$6d0c9c22f6652669(_ref) {
|
|
|
10098
10161
|
number_: num_results,
|
|
10099
10162
|
i18n_: i18n_
|
|
10100
10163
|
});
|
|
10101
|
-
const
|
|
10164
|
+
const queries_without_content_results_ = new (0, $52FdA$depictaiutilishared.ListenableSet)();
|
|
10165
|
+
const [check_query, set_check_query] = $52FdA$solidjs.createSignal(false);
|
|
10166
|
+
const placeholders_enabled = $52FdA$solidjs.createMemo(() => {
|
|
10167
|
+
// don't show placeholders when the user toggles filters
|
|
10168
|
+
check_query();
|
|
10169
|
+
return !queries_without_content_results_.has(get_search_query_());
|
|
10170
|
+
});
|
|
10102
10171
|
const rows_object = $eab939d0b95b75ee$var$make_state_saved_rows(content_results_rows_, i18n_);
|
|
10172
|
+
for (const ev of ["add", "delete"]) queries_without_content_results_.addEventListener(ev, () => set_check_query(prev => !prev));
|
|
10103
10173
|
return (() => {
|
|
10104
10174
|
const _el$ = $52FdA$solidjsweb.getNextElement($eab939d0b95b75ee$var$_tmpl$),
|
|
10105
10175
|
_el$2 = _el$.firstChild,
|
|
@@ -10125,36 +10195,27 @@ function $eab939d0b95b75ee$export$6d0c9c22f6652669(_ref) {
|
|
|
10125
10195
|
get children() {
|
|
10126
10196
|
return $52FdA$solidjsweb.createComponent((0, $52FdA$solidjs.Suspense), {
|
|
10127
10197
|
get fallback() {
|
|
10128
|
-
return (()
|
|
10129
|
-
|
|
10130
|
-
|
|
10131
|
-
|
|
10132
|
-
|
|
10133
|
-
|
|
10134
|
-
return $52FdA$solidjs.createMemo(() => layout_options_().cols_at_size);
|
|
10135
|
-
}
|
|
10136
|
-
});
|
|
10137
|
-
})();
|
|
10198
|
+
return $52FdA$solidjsweb.createComponent((0, $05f255c0a94b9ca1$export$4405d077f0a20494), {
|
|
10199
|
+
content_results_rows_: content_results_rows_,
|
|
10200
|
+
get cols_at_size_() {
|
|
10201
|
+
return $52FdA$solidjs.createMemo(() => layout_options_().cols_at_size);
|
|
10202
|
+
}
|
|
10203
|
+
});
|
|
10138
10204
|
},
|
|
10139
10205
|
get children() {
|
|
10140
10206
|
return $52FdA$solidjsweb.createComponent((0, $bf4a8d57aa8dd1c8$export$9ff751cd77687edc), {
|
|
10141
10207
|
router_: router_,
|
|
10142
|
-
search_results_: search_results_
|
|
10208
|
+
search_results_: search_results_,
|
|
10209
|
+
queries_without_content_results_: queries_without_content_results_,
|
|
10210
|
+
get_search_query_: get_search_query_
|
|
10143
10211
|
});
|
|
10144
10212
|
}
|
|
10145
10213
|
});
|
|
10146
10214
|
}
|
|
10147
10215
|
})), _el$5, _co$2);
|
|
10148
|
-
$52FdA$solidjsweb.effect(
|
|
10216
|
+
$52FdA$solidjsweb.effect(() => {
|
|
10149
10217
|
var _content_results2;
|
|
10150
|
-
|
|
10151
|
-
_v$2 = is_loading_() || ((_content_results2 = content_results()) === null || _content_results2 === void 0 ? void 0 : _content_results2.length) > 0 ? "" : "none";
|
|
10152
|
-
_v$ !== _p$._v$ && _el$.classList.toggle("loading", _p$._v$ = _v$);
|
|
10153
|
-
_v$2 !== _p$._v$2 && _el$.style.setProperty("display", _p$._v$2 = _v$2);
|
|
10154
|
-
return _p$;
|
|
10155
|
-
}, {
|
|
10156
|
-
_v$: undefined,
|
|
10157
|
-
_v$2: undefined
|
|
10218
|
+
return _el$.style.setProperty("display", is_loading_() && placeholders_enabled() || ((_content_results2 = content_results()) === null || _content_results2 === void 0 ? void 0 : _content_results2.length) > 0 ? "" : "none");
|
|
10158
10219
|
});
|
|
10159
10220
|
return _el$;
|
|
10160
10221
|
})();
|
|
@@ -10643,7 +10704,7 @@ function $ddd39c5f36f49703$var$_classApplyDescriptorGet(receiver, descriptor) {
|
|
|
10643
10704
|
* 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.
|
|
10644
10705
|
*/
|
|
10645
10706
|
const $ddd39c5f36f49703$var$privately_shared_properties = /*@__PURE__*/new WeakMap();
|
|
10646
|
-
const $ddd39c5f36f49703$var$content_search_default =
|
|
10707
|
+
const $ddd39c5f36f49703$var$content_search_default = true;
|
|
10647
10708
|
const $ddd39c5f36f49703$var$min_products_to_fetch_ = 20;
|
|
10648
10709
|
const $ddd39c5f36f49703$export$bde3eb976dfded9 = depict_search => {
|
|
10649
10710
|
var _privately_shared_pro;
|