@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/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.1";
|
|
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,60 @@ 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
|
-
|
|
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 {
|
|
766
|
+
view_more_button: view_more_button,
|
|
767
|
+
max_rows: max_rows
|
|
768
|
+
} = props;
|
|
769
|
+
if (!view_more_button) {
|
|
770
|
+
if (max_rows) return {
|
|
771
|
+
max_rows: max_rows
|
|
772
|
+
};
|
|
773
|
+
return "all";
|
|
774
|
+
}
|
|
775
|
+
return {
|
|
776
|
+
max_rows: max_rows,
|
|
777
|
+
start_rows: view_more_button.start_rows,
|
|
778
|
+
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,
|
|
779
|
+
button: (() => {
|
|
780
|
+
const _el$ = $52FdA$solidjsweb.getNextElement($41227f10ad680afd$var$_tmpl$);
|
|
781
|
+
$52FdA$solidjsweb.insert(_el$, () => view_more_button.text);
|
|
782
|
+
return _el$;
|
|
783
|
+
})()
|
|
784
|
+
};
|
|
785
|
+
});
|
|
786
|
+
const grid_spacing_override = $52FdA$solidjs.createMemo(() => {
|
|
787
|
+
const {
|
|
788
|
+
grid_spacing: grid_spacing
|
|
789
|
+
} = props; // can be reactive
|
|
790
|
+
return typeof grid_spacing === "string" ? {
|
|
791
|
+
grid_spacing: grid_spacing
|
|
792
|
+
} : {
|
|
793
|
+
override_vertical_spacing: grid_spacing.vertical,
|
|
794
|
+
grid_spacing: grid_spacing.horizontal
|
|
795
|
+
};
|
|
796
|
+
});
|
|
797
|
+
const [recommendations_resource_] = $52FdA$solidjs.createResource(() => props.recommendations, recs => recs);
|
|
798
|
+
return (() => {
|
|
799
|
+
const _el$2 = $52FdA$solidjsweb.getNextElement($41227f10ad680afd$var$_tmpl$2);
|
|
800
|
+
$52FdA$solidjsweb.insert(_el$2, () => $2c920813c92d6987$export$7da560f849543dff({
|
|
801
|
+
rows_object_: rows_object_,
|
|
802
|
+
product_card_template_: function () {
|
|
803
|
+
return props.product_card_template(...arguments);
|
|
804
|
+
},
|
|
805
|
+
recommendations_resource_: recommendations_resource_,
|
|
806
|
+
market_: () => props.market,
|
|
807
|
+
merchant_: () => props.merchant,
|
|
808
|
+
layout_options_: $52FdA$solidjs.createMemo(() => ({
|
|
809
|
+
cols_at_size: $5401a6698b0c0658$export$6daf8749b65a1b77($b1ea8d47bcf03111$export$ff7109b9b2b206ba(props.cols_at_size)),
|
|
810
|
+
...grid_spacing_override()
|
|
811
|
+
}))
|
|
812
|
+
}));
|
|
813
|
+
return _el$2;
|
|
814
|
+
})();
|
|
815
|
+
}, "RecommendationGrid failed");
|
|
747
816
|
}
|
|
748
817
|
const $858fdcf73148519f$var$_tmpl$ = /*#__PURE__*/$52FdA$solidjsweb.template(`<img>`, 1);
|
|
749
818
|
function $858fdcf73148519f$export$e6fffe67d4cdd848(whatToWatch) {
|
|
@@ -1434,7 +1503,7 @@ const $6b92e147c6e24046$export$48513f6b9f8ce62d = props => {
|
|
|
1434
1503
|
const label = $52FdA$solidjs.createMemo(() => props.label_);
|
|
1435
1504
|
const checked = $52FdA$solidjs.createMemo(() => props.checked_);
|
|
1436
1505
|
const value = $52FdA$solidjs.createMemo(() => props.value_);
|
|
1437
|
-
const is_count_zero = $52FdA$solidjs.createMemo(() => props.is_count_zero_);
|
|
1506
|
+
const is_count_zero = $52FdA$solidjs.createMemo(() => props.is_count_zero_ || count() === 0);
|
|
1438
1507
|
const id = $52FdA$depictaiutilishared.make_random_classname();
|
|
1439
1508
|
return (/* We can't use actual margin because ExpandingContainer gets messed up */(() => {
|
|
1440
1509
|
const _el$ = $52FdA$solidjsweb.getNextElement($6b92e147c6e24046$var$_tmpl$2),
|
|
@@ -1474,14 +1543,17 @@ const $6b92e147c6e24046$export$48513f6b9f8ce62d = props => {
|
|
|
1474
1543
|
}
|
|
1475
1544
|
}), _el$8, _co$);
|
|
1476
1545
|
$52FdA$solidjsweb.effect(_p$ => {
|
|
1477
|
-
const _v$ = !!
|
|
1478
|
-
_v$2 = value()
|
|
1546
|
+
const _v$ = !!is_count_zero(),
|
|
1547
|
+
_v$2 = value(),
|
|
1548
|
+
_v$3 = !checked() && is_count_zero();
|
|
1479
1549
|
_v$ !== _p$._v$ && _el$.classList.toggle("count-0", _p$._v$ = _v$);
|
|
1480
1550
|
_v$2 !== _p$._v$2 && $52FdA$solidjsweb.setAttribute(_el$3, "name", _p$._v$2 = _v$2);
|
|
1551
|
+
_v$3 !== _p$._v$3 && (_el$3.disabled = _p$._v$3 = _v$3);
|
|
1481
1552
|
return _p$;
|
|
1482
1553
|
}, {
|
|
1483
1554
|
_v$: undefined,
|
|
1484
|
-
_v$2: undefined
|
|
1555
|
+
_v$2: undefined,
|
|
1556
|
+
_v$3: undefined
|
|
1485
1557
|
});
|
|
1486
1558
|
$52FdA$solidjsweb.effect(() => _el$3.checked = checked());
|
|
1487
1559
|
return _el$;
|
|
@@ -2384,6 +2456,10 @@ function $9c1d49181fb3002a$var$render_stuff(data, existing_filter, i18n_) {
|
|
|
2384
2456
|
});
|
|
2385
2457
|
}
|
|
2386
2458
|
}), _el$16, _co$5);
|
|
2459
|
+
$52FdA$solidjsweb.effect(() => {
|
|
2460
|
+
var _value12;
|
|
2461
|
+
return _el$14.classList.toggle("count-0", !!(((_value12 = value()) === null || _value12 === void 0 ? void 0 : _value12.count_) === 0));
|
|
2462
|
+
});
|
|
2387
2463
|
return _el$12;
|
|
2388
2464
|
})();
|
|
2389
2465
|
},
|
|
@@ -2404,8 +2480,8 @@ function $9c1d49181fb3002a$var$render_stuff(data, existing_filter, i18n_) {
|
|
|
2404
2480
|
},
|
|
2405
2481
|
get children() {
|
|
2406
2482
|
return $9c1d49181fb3002a$var$render_stuff($52FdA$solidjs.createMemo(() => {
|
|
2407
|
-
var
|
|
2408
|
-
return ((
|
|
2483
|
+
var _value13;
|
|
2484
|
+
return ((_value13 = value()) === null || _value13 === void 0 ? void 0 : _value13.children_) || {};
|
|
2409
2485
|
}), existing_filter, i18n_);
|
|
2410
2486
|
}
|
|
2411
2487
|
});
|
|
@@ -2592,7 +2668,8 @@ function $9c1d49181fb3002a$var$expand_until_choice(data_structure) {
|
|
|
2592
2668
|
});
|
|
2593
2669
|
}
|
|
2594
2670
|
const $cd0e5524f9476f9b$var$_tmpl$ = /*#__PURE__*/$52FdA$solidjsweb.template(`<div class="checkbox-grid"></div>`, 2),
|
|
2595
|
-
$cd0e5524f9476f9b$var$_tmpl$2 = /*#__PURE__*/$52FdA$solidjsweb.template(`<
|
|
2671
|
+
$cd0e5524f9476f9b$var$_tmpl$2 = /*#__PURE__*/$52FdA$solidjsweb.template(`<span class="count-wrapper"><span class="count"></span></span>`, 4),
|
|
2672
|
+
$cd0e5524f9476f9b$var$_tmpl$3 = /*#__PURE__*/$52FdA$solidjsweb.template(`<button class="major-minor-transition"><!#><!/><!#><!/></button>`, 6);
|
|
2596
2673
|
const $cd0e5524f9476f9b$export$414f6a19d38e655c = _ref => {
|
|
2597
2674
|
let {
|
|
2598
2675
|
filter_: filter_,
|
|
@@ -2634,7 +2711,11 @@ const $cd0e5524f9476f9b$export$414f6a19d38e655c = _ref => {
|
|
|
2634
2711
|
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
2712
|
});
|
|
2636
2713
|
return (() => {
|
|
2637
|
-
const _el$2 = $52FdA$solidjsweb.getNextElement($cd0e5524f9476f9b$var$_tmpl$
|
|
2714
|
+
const _el$2 = $52FdA$solidjsweb.getNextElement($cd0e5524f9476f9b$var$_tmpl$3),
|
|
2715
|
+
_el$5 = _el$2.firstChild,
|
|
2716
|
+
[_el$6, _co$] = $52FdA$solidjsweb.getNextMarker(_el$5.nextSibling),
|
|
2717
|
+
_el$7 = _el$6.nextSibling,
|
|
2718
|
+
[_el$8, _co$2] = $52FdA$solidjsweb.getNextMarker(_el$7.nextSibling);
|
|
2638
2719
|
$52FdA$solidjsweb.addEventListener(_el$2, "click", $52FdA$depictaiutilishared.catchify(() => {
|
|
2639
2720
|
const set_filter = existing_filter();
|
|
2640
2721
|
const {
|
|
@@ -2655,16 +2736,30 @@ const $cd0e5524f9476f9b$export$414f6a19d38e655c = _ref => {
|
|
|
2655
2736
|
const selected_filters = [...get_selected_filters().filter(f => f !== set_filter), ...(new_filter_object.data.length ? [new_filter_object] : [])];
|
|
2656
2737
|
set_selected_filters(selected_filters);
|
|
2657
2738
|
}), true);
|
|
2658
|
-
$52FdA$solidjsweb.insert(_el$2, () => value().value_);
|
|
2739
|
+
$52FdA$solidjsweb.insert(_el$2, () => value().value_, _el$6, _co$);
|
|
2740
|
+
$52FdA$solidjsweb.insert(_el$2, $52FdA$solidjsweb.createComponent((0, $52FdA$solidjs.Show), {
|
|
2741
|
+
get when() {
|
|
2742
|
+
return value().count_ != undefined;
|
|
2743
|
+
},
|
|
2744
|
+
get children() {
|
|
2745
|
+
const _el$3 = $52FdA$solidjsweb.getNextElement($cd0e5524f9476f9b$var$_tmpl$2),
|
|
2746
|
+
_el$4 = _el$3.firstChild;
|
|
2747
|
+
$52FdA$solidjsweb.insert(_el$4, () => value().count_);
|
|
2748
|
+
return _el$3;
|
|
2749
|
+
}
|
|
2750
|
+
}), _el$8, _co$2);
|
|
2659
2751
|
$52FdA$solidjsweb.effect(_p$ => {
|
|
2660
|
-
const _v$ = !is_selected(),
|
|
2661
|
-
_v$2 =
|
|
2662
|
-
|
|
2663
|
-
_v$
|
|
2752
|
+
const _v$ = value().count_ === 0 && !is_selected(),
|
|
2753
|
+
_v$2 = !is_selected(),
|
|
2754
|
+
_v$3 = !!is_selected();
|
|
2755
|
+
_v$ !== _p$._v$ && (_el$2.disabled = _p$._v$ = _v$);
|
|
2756
|
+
_v$2 !== _p$._v$2 && _el$2.classList.toggle("minor", _p$._v$2 = _v$2);
|
|
2757
|
+
_v$3 !== _p$._v$3 && _el$2.classList.toggle("major", _p$._v$3 = _v$3);
|
|
2664
2758
|
return _p$;
|
|
2665
2759
|
}, {
|
|
2666
2760
|
_v$: undefined,
|
|
2667
|
-
_v$2: undefined
|
|
2761
|
+
_v$2: undefined,
|
|
2762
|
+
_v$3: undefined
|
|
2668
2763
|
});
|
|
2669
2764
|
$52FdA$solidjsweb.runHydrationEvents();
|
|
2670
2765
|
return _el$2;
|
|
@@ -6799,35 +6894,6 @@ function $ede6c70ecdca46fe$export$f7d2f673fc2f091d(_ref) {
|
|
|
6799
6894
|
return _el$13;
|
|
6800
6895
|
})()];
|
|
6801
6896
|
}
|
|
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
6897
|
function $5dd9d0d3ea82e2dd$export$477caf01aecaeb2a(options) {
|
|
6832
6898
|
var _globalThis$location$, _globalThis$location;
|
|
6833
6899
|
const router_ = options.router_;
|
|
@@ -8622,7 +8688,7 @@ function $3cf7b4db1e203c93$export$605674723bcc715c() {
|
|
|
8622
8688
|
const $0677d509ad208e22$var$_tmpl$ = /*#__PURE__*/$52FdA$solidjsweb.template(`<a class="suggestion"></a>`, 2),
|
|
8623
8689
|
$0677d509ad208e22$var$_tmpl$2 = /*#__PURE__*/$52FdA$solidjsweb.template(`<div class="search-icon"></div>`, 2),
|
|
8624
8690
|
$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),
|
|
8691
|
+
$0677d509ad208e22$var$_tmpl$4 = /*#__PURE__*/$52FdA$solidjsweb.template(`<div class="with-parent-title"><!#><!/><span class="value line-clamp"></span></div>`, 6),
|
|
8626
8692
|
$0677d509ad208e22$var$_tmpl$5 = /*#__PURE__*/$52FdA$solidjsweb.template(`<div class="with-icon"><!#><!/><!#><!/></div>`, 6),
|
|
8627
8693
|
$0677d509ad208e22$var$_tmpl$6 = /*#__PURE__*/$52FdA$solidjsweb.template(`<h2 class="text"></h2>`, 2),
|
|
8628
8694
|
$0677d509ad208e22$var$_tmpl$7 = /*#__PURE__*/$52FdA$solidjsweb.template(`<div class="suggestion-container query"><!#><!/><!#><!/></div>`, 6),
|
|
@@ -10016,7 +10082,9 @@ function $f1fc9ea3e7632eba$export$f631859cab12b342(_ref) {
|
|
|
10016
10082
|
function $bf4a8d57aa8dd1c8$export$9ff751cd77687edc(_ref) {
|
|
10017
10083
|
let {
|
|
10018
10084
|
search_results_: search_results_,
|
|
10019
|
-
router_: router_
|
|
10085
|
+
router_: router_,
|
|
10086
|
+
queries_without_content_results_: queries_without_content_results_,
|
|
10087
|
+
get_search_query_: get_search_query_
|
|
10020
10088
|
} = _ref;
|
|
10021
10089
|
const content_results = $52FdA$solidjs.createMemo(() => {
|
|
10022
10090
|
var _search_results_;
|
|
@@ -10032,6 +10100,10 @@ function $bf4a8d57aa8dd1c8$export$9ff751cd77687edc(_ref) {
|
|
|
10032
10100
|
}
|
|
10033
10101
|
return map;
|
|
10034
10102
|
});
|
|
10103
|
+
$52FdA$solidjs.createEffect(() => {
|
|
10104
|
+
const results = content_results();
|
|
10105
|
+
if (Array.isArray(results) && results.length === 0) queries_without_content_results_.add($52FdA$solidjs.untrack(get_search_query_));
|
|
10106
|
+
});
|
|
10035
10107
|
return $52FdA$solidjsweb.createComponent((0, $52FdA$solidjs.For), {
|
|
10036
10108
|
get each() {
|
|
10037
10109
|
return [...content_results_by_page_url().keys()];
|
|
@@ -10098,8 +10170,15 @@ function $eab939d0b95b75ee$export$6d0c9c22f6652669(_ref) {
|
|
|
10098
10170
|
number_: num_results,
|
|
10099
10171
|
i18n_: i18n_
|
|
10100
10172
|
});
|
|
10101
|
-
const
|
|
10173
|
+
const queries_without_content_results_ = new (0, $52FdA$depictaiutilishared.ListenableSet)();
|
|
10174
|
+
const [check_query, set_check_query] = $52FdA$solidjs.createSignal(false);
|
|
10175
|
+
const placeholders_enabled = $52FdA$solidjs.createMemo(() => {
|
|
10176
|
+
// don't show placeholders when the user toggles filters
|
|
10177
|
+
check_query();
|
|
10178
|
+
return !queries_without_content_results_.has(get_search_query_());
|
|
10179
|
+
});
|
|
10102
10180
|
const rows_object = $eab939d0b95b75ee$var$make_state_saved_rows(content_results_rows_, i18n_);
|
|
10181
|
+
for (const ev of ["add", "delete"]) queries_without_content_results_.addEventListener(ev, () => set_check_query(prev => !prev));
|
|
10103
10182
|
return (() => {
|
|
10104
10183
|
const _el$ = $52FdA$solidjsweb.getNextElement($eab939d0b95b75ee$var$_tmpl$),
|
|
10105
10184
|
_el$2 = _el$.firstChild,
|
|
@@ -10125,36 +10204,27 @@ function $eab939d0b95b75ee$export$6d0c9c22f6652669(_ref) {
|
|
|
10125
10204
|
get children() {
|
|
10126
10205
|
return $52FdA$solidjsweb.createComponent((0, $52FdA$solidjs.Suspense), {
|
|
10127
10206
|
get fallback() {
|
|
10128
|
-
return (()
|
|
10129
|
-
|
|
10130
|
-
|
|
10131
|
-
|
|
10132
|
-
|
|
10133
|
-
|
|
10134
|
-
return $52FdA$solidjs.createMemo(() => layout_options_().cols_at_size);
|
|
10135
|
-
}
|
|
10136
|
-
});
|
|
10137
|
-
})();
|
|
10207
|
+
return $52FdA$solidjsweb.createComponent((0, $05f255c0a94b9ca1$export$4405d077f0a20494), {
|
|
10208
|
+
content_results_rows_: content_results_rows_,
|
|
10209
|
+
get cols_at_size_() {
|
|
10210
|
+
return $52FdA$solidjs.createMemo(() => layout_options_().cols_at_size);
|
|
10211
|
+
}
|
|
10212
|
+
});
|
|
10138
10213
|
},
|
|
10139
10214
|
get children() {
|
|
10140
10215
|
return $52FdA$solidjsweb.createComponent((0, $bf4a8d57aa8dd1c8$export$9ff751cd77687edc), {
|
|
10141
10216
|
router_: router_,
|
|
10142
|
-
search_results_: search_results_
|
|
10217
|
+
search_results_: search_results_,
|
|
10218
|
+
queries_without_content_results_: queries_without_content_results_,
|
|
10219
|
+
get_search_query_: get_search_query_
|
|
10143
10220
|
});
|
|
10144
10221
|
}
|
|
10145
10222
|
});
|
|
10146
10223
|
}
|
|
10147
10224
|
})), _el$5, _co$2);
|
|
10148
|
-
$52FdA$solidjsweb.effect(
|
|
10225
|
+
$52FdA$solidjsweb.effect(() => {
|
|
10149
10226
|
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
|
|
10227
|
+
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
10228
|
});
|
|
10159
10229
|
return _el$;
|
|
10160
10230
|
})();
|
|
@@ -10643,7 +10713,7 @@ function $ddd39c5f36f49703$var$_classApplyDescriptorGet(receiver, descriptor) {
|
|
|
10643
10713
|
* 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
10714
|
*/
|
|
10645
10715
|
const $ddd39c5f36f49703$var$privately_shared_properties = /*@__PURE__*/new WeakMap();
|
|
10646
|
-
const $ddd39c5f36f49703$var$content_search_default =
|
|
10716
|
+
const $ddd39c5f36f49703$var$content_search_default = true;
|
|
10647
10717
|
const $ddd39c5f36f49703$var$min_products_to_fetch_ = 20;
|
|
10648
10718
|
const $ddd39c5f36f49703$export$bde3eb976dfded9 = depict_search => {
|
|
10649
10719
|
var _privately_shared_pro;
|