@depict-ai/ui 4.3.13 → 4.4.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 +134 -69
- package/ES10/index.d.ts +1 -1
- package/ES10/index.js +134 -69
- package/latest/index.cjs +131 -71
- package/latest/index.d.ts +1 -1
- package/latest/index.js +131 -71
- package/package.json +2 -2
- package/server/ES10/index.cjs +64 -19
- package/server/ES10/index.d.ts +1 -1
- package/server/ES10/index.js +64 -19
- package/server/latest/index.cjs +61 -19
- package/server/latest/index.d.ts +1 -1
- package/server/latest/index.js +61 -19
package/latest/index.d.ts
CHANGED
|
@@ -10,7 +10,7 @@ import { ProductListingRequestV3 } from "@depict-ai/types/api/ProductListingRequ
|
|
|
10
10
|
import { GetListingRequest } from "@depict-ai/types/api/GetListingRequest";
|
|
11
11
|
import { BaseSearchRequestV3 } from "@depict-ai/types/api/BaseSearchRequestV3";
|
|
12
12
|
import { SearchFilter as _SearchFilter3 } from "@depict-ai/types/api/SearchRequestV2";
|
|
13
|
-
export const version = "4.
|
|
13
|
+
export const version = "4.4.0";
|
|
14
14
|
declare const LISTING_ID = "listingId";
|
|
15
15
|
declare const EXTERNAL_ID = "externalId";
|
|
16
16
|
type ScrollRestorationData = {
|
package/latest/index.js
CHANGED
|
@@ -7,7 +7,7 @@ import { createStore as $9HbP8$createStore, reconcile as $9HbP8$reconcile } from
|
|
|
7
7
|
/*! Depict.ai search and product listing SDK */
|
|
8
8
|
import { register_es_version } from "../multi_import_deduplicator.mjs";
|
|
9
9
|
register_es_version("ui", "latest");
|
|
10
|
-
const $ec291e0010116877$export$83d89fbfd8236492 = "4.
|
|
10
|
+
const $ec291e0010116877$export$83d89fbfd8236492 = "4.4.0";
|
|
11
11
|
const $b5cccc8ee7d24677$var$transform_elements = sorted_cols_at_size => {
|
|
12
12
|
const cols_at_size = [];
|
|
13
13
|
for (let i = 0; i < sorted_cols_at_size.length; i++) {
|
|
@@ -1252,9 +1252,9 @@ function $5a6c386e1bde5665$export$b73ed90f0ee50dc3({
|
|
|
1252
1252
|
is_replace_: false,
|
|
1253
1253
|
event_: event_
|
|
1254
1254
|
});
|
|
1255
|
-
if (event_.defaultPrevented)
|
|
1256
|
-
//
|
|
1257
|
-
|
|
1255
|
+
if (!event_.defaultPrevented)
|
|
1256
|
+
// If the user opened in a new tab, prevent the event from propagating to the parent which would close the look
|
|
1257
|
+
event_.stopImmediatePropagation();
|
|
1258
1258
|
}
|
|
1259
1259
|
});
|
|
1260
1260
|
}
|
|
@@ -1607,12 +1607,7 @@ function $28ee4f7db3cc44b8$export$44809a8a3e867e30({
|
|
|
1607
1607
|
var _el$ = $9HbP8$getNextElement($28ee4f7db3cc44b8$var$_tmpl$);
|
|
1608
1608
|
$9HbP8$addEventListener(_el$, "click", $9HbP8$catchify(({
|
|
1609
1609
|
target: target
|
|
1610
|
-
}) =>
|
|
1611
|
-
// Don't toggle when clicking on the links
|
|
1612
|
-
const selector = "a[href]";
|
|
1613
|
-
if (target.matches(selector) || target.closest(selector)) return;
|
|
1614
|
-
setUserWantsExpanded(prev => !prev);
|
|
1615
|
-
}), true);
|
|
1610
|
+
}) => setUserWantsExpanded(prev => !prev)), true);
|
|
1616
1611
|
_el$.classList.toggle("placeholder", !!!display_);
|
|
1617
1612
|
$9HbP8$runHydrationEvents();
|
|
1618
1613
|
return _el$;
|
|
@@ -3329,9 +3324,12 @@ let $f86ba724282f6690$export$44dad306455dddf;
|
|
|
3329
3324
|
DEPICT_ID["PLP_CATEGORY"] = "depict-plp-category";
|
|
3330
3325
|
})($f86ba724282f6690$export$44dad306455dddf || ($f86ba724282f6690$export$44dad306455dddf = {}));
|
|
3331
3326
|
var $5285d2814d0fac0c$var$_tmpl$ = /*#__PURE__*/$9HbP8$template(`<button class=back type=button>`),
|
|
3332
|
-
$5285d2814d0fac0c$var$_tmpl$2 = /*#__PURE__*/$9HbP8$template(`<
|
|
3327
|
+
$5285d2814d0fac0c$var$_tmpl$2 = /*#__PURE__*/$9HbP8$template(`<button type=button class=clear>`),
|
|
3328
|
+
$5285d2814d0fac0c$var$_tmpl$3 = /*#__PURE__*/$9HbP8$template(`<div class=spacer>`),
|
|
3329
|
+
$5285d2814d0fac0c$var$_tmpl$4 = /*#__PURE__*/$9HbP8$template(`<button class="submit major"type=button>`),
|
|
3330
|
+
$5285d2814d0fac0c$var$_tmpl$5 = /*#__PURE__*/$9HbP8$template(`<div class=search-field role=search><!$><!/><!$><!/><div class=field><!$><!/><input class=query tabindex=0><!$><!/></div><!$><!/><!$><!/>`);
|
|
3333
3331
|
function $5285d2814d0fac0c$export$b94867ecbd698f21({
|
|
3334
|
-
search_field_value_:
|
|
3332
|
+
search_field_value_: [searchFieldValue, setSearchFieldValue],
|
|
3335
3333
|
input_field_ref_: input_field_ref_,
|
|
3336
3334
|
field_element_ref_: field_element_ref_,
|
|
3337
3335
|
submit_query_: submit_query_,
|
|
@@ -3356,30 +3354,102 @@ function $5285d2814d0fac0c$export$b94867ecbd698f21({
|
|
|
3356
3354
|
})); // focus field on render
|
|
3357
3355
|
const owner_of_field_element = $9HbP8$getOwner();
|
|
3358
3356
|
const isNewModal = BackIcon_[(0, $66db7a014e20802e$export$1ea76ea778b880dd)] === 2;
|
|
3357
|
+
const [backButtonWidthAccessor, setBackButtonWidthAccessor] = $9HbP8$createSignal();
|
|
3358
|
+
const getBackButtonWidth = () => backButtonWidthAccessor()?.();
|
|
3359
|
+
const searchFieldEmpty = $9HbP8$createMemo(() => !searchFieldValue());
|
|
3360
|
+
const BackButton = () => $9HbP8$createComponent((0, $9HbP8$Show), {
|
|
3361
|
+
when: on_back_,
|
|
3362
|
+
get children() {
|
|
3363
|
+
var _el$ = $9HbP8$getNextElement($5285d2814d0fac0c$var$_tmpl$);
|
|
3364
|
+
$9HbP8$spread(_el$, $9HbP8$mergeProps({
|
|
3365
|
+
get onClick() {
|
|
3366
|
+
return $9HbP8$catchify(on_back_);
|
|
3367
|
+
},
|
|
3368
|
+
get ["aria-label"]() {
|
|
3369
|
+
return i18n_.back_();
|
|
3370
|
+
}
|
|
3371
|
+
}, isNewModal && {
|
|
3372
|
+
ref: el => {
|
|
3373
|
+
setBackButtonWidthAccessor(() => $2449872a62a75a20$export$ebdc3711f7e02ccd(el));
|
|
3374
|
+
$9HbP8$onCleanup(() => setBackButtonWidthAccessor());
|
|
3375
|
+
}
|
|
3376
|
+
}), false, true);
|
|
3377
|
+
$9HbP8$insert(_el$, isNewModal ? $9HbP8$createComponent((0, $19976a74d273070d$export$3b621d86b1566b2), {}) : $9HbP8$createComponent(BackIcon_, {}));
|
|
3378
|
+
$9HbP8$runHydrationEvents();
|
|
3379
|
+
return _el$;
|
|
3380
|
+
}
|
|
3381
|
+
});
|
|
3382
|
+
const ClearButton = () => (() => {
|
|
3383
|
+
var _el$2 = $9HbP8$getNextElement($5285d2814d0fac0c$var$_tmpl$2);
|
|
3384
|
+
$9HbP8$spread(_el$2, $9HbP8$mergeProps({
|
|
3385
|
+
get classList() {
|
|
3386
|
+
return {
|
|
3387
|
+
empty: searchFieldEmpty()
|
|
3388
|
+
};
|
|
3389
|
+
},
|
|
3390
|
+
get style() {
|
|
3391
|
+
return isNewModal || !searchFieldEmpty() ? "" : "display: none";
|
|
3392
|
+
},
|
|
3393
|
+
get onClick() {
|
|
3394
|
+
return $9HbP8$catchify(() => {
|
|
3395
|
+
if (isNewModal && searchFieldEmpty()) return;
|
|
3396
|
+
setSearchFieldValue("");
|
|
3397
|
+
clear_filters_(true);
|
|
3398
|
+
if (!disabled_) input_element.focus();
|
|
3399
|
+
});
|
|
3400
|
+
}
|
|
3401
|
+
}, () => searchFieldEmpty() ? {
|
|
3402
|
+
"aria-hidden": "true"
|
|
3403
|
+
} : {
|
|
3404
|
+
title: i18n_.clear_filters_query_sorting_after_submit_()
|
|
3405
|
+
}), false, true);
|
|
3406
|
+
$9HbP8$insert(_el$2, isNewModal ? $9HbP8$createComponent((0, $9HbP8$Show), {
|
|
3407
|
+
get when() {
|
|
3408
|
+
return !searchFieldEmpty();
|
|
3409
|
+
},
|
|
3410
|
+
get fallback() {
|
|
3411
|
+
return $9HbP8$createComponent((0, $16f0ed5ea30d8d9c$export$82eafebb825fc23f), {});
|
|
3412
|
+
},
|
|
3413
|
+
get children() {
|
|
3414
|
+
return $9HbP8$createComponent(BackIcon_, {});
|
|
3415
|
+
}
|
|
3416
|
+
}) : $9HbP8$createComponent((0, $19976a74d273070d$export$3b621d86b1566b2), {}));
|
|
3417
|
+
$9HbP8$runHydrationEvents();
|
|
3418
|
+
return _el$2;
|
|
3419
|
+
})();
|
|
3359
3420
|
return (() => {
|
|
3360
|
-
var _el$ = $9HbP8$getNextElement($5285d2814d0fac0c$var$_tmpl$
|
|
3361
|
-
_el$
|
|
3421
|
+
var _el$3 = $9HbP8$getNextElement($5285d2814d0fac0c$var$_tmpl$5),
|
|
3422
|
+
_el$12 = _el$3.firstChild,
|
|
3423
|
+
[_el$13, _co$3] = $9HbP8$getNextMarker(_el$12.nextSibling),
|
|
3424
|
+
_el$14 = _el$13.nextSibling,
|
|
3425
|
+
[_el$15, _co$4] = $9HbP8$getNextMarker(_el$14.nextSibling),
|
|
3426
|
+
_el$5 = _el$15.nextSibling,
|
|
3427
|
+
_el$7 = _el$5.firstChild,
|
|
3362
3428
|
[_el$8, _co$] = $9HbP8$getNextMarker(_el$7.nextSibling),
|
|
3363
|
-
_el$
|
|
3364
|
-
_el$
|
|
3365
|
-
_el$
|
|
3366
|
-
_el$
|
|
3367
|
-
|
|
3368
|
-
|
|
3429
|
+
_el$6 = _el$8.nextSibling,
|
|
3430
|
+
_el$9 = _el$6.nextSibling,
|
|
3431
|
+
[_el$10, _co$2] = $9HbP8$getNextMarker(_el$9.nextSibling),
|
|
3432
|
+
_el$16 = _el$5.nextSibling,
|
|
3433
|
+
[_el$17, _co$5] = $9HbP8$getNextMarker(_el$16.nextSibling),
|
|
3434
|
+
_el$18 = _el$17.nextSibling,
|
|
3435
|
+
[_el$19, _co$6] = $9HbP8$getNextMarker(_el$18.nextSibling);
|
|
3436
|
+
_el$3.classList.toggle("in-modal", !!!!on_back_);
|
|
3437
|
+
$9HbP8$insert(_el$3, $9HbP8$createComponent((0, $9HbP8$Show), {
|
|
3438
|
+
get when() {
|
|
3439
|
+
return getBackButtonWidth() !== undefined && on_back_;
|
|
3440
|
+
},
|
|
3369
3441
|
get children() {
|
|
3370
|
-
var _el$
|
|
3371
|
-
$9HbP8$
|
|
3372
|
-
|
|
3373
|
-
$9HbP8$effect(() => $9HbP8$setAttribute(_el$2, "aria-label", i18n_.back_()));
|
|
3374
|
-
$9HbP8$runHydrationEvents();
|
|
3375
|
-
return _el$2;
|
|
3442
|
+
var _el$4 = $9HbP8$getNextElement($5285d2814d0fac0c$var$_tmpl$3);
|
|
3443
|
+
$9HbP8$effect(() => (getBackButtonWidth(), _el$4.style.setProperty("width", getBackButtonWidth() + "px")));
|
|
3444
|
+
return _el$4;
|
|
3376
3445
|
}
|
|
3377
|
-
}), _el$
|
|
3446
|
+
}), _el$13, _co$3);
|
|
3447
|
+
$9HbP8$insert(_el$3, !isNewModal && $9HbP8$createComponent(BackButton, {}), _el$15, _co$4);
|
|
3378
3448
|
$9HbP8$use(el => {
|
|
3379
3449
|
field_div = el;
|
|
3380
3450
|
field_element_ref_?.(el);
|
|
3381
|
-
}, _el$
|
|
3382
|
-
$9HbP8$addEventListener(_el$
|
|
3451
|
+
}, _el$5);
|
|
3452
|
+
$9HbP8$addEventListener(_el$5, "click", $9HbP8$catchify(({
|
|
3383
3453
|
target: target,
|
|
3384
3454
|
currentTarget: currentTarget,
|
|
3385
3455
|
detail: detail
|
|
@@ -3403,7 +3473,8 @@ function $5285d2814d0fac0c$export$b94867ecbd698f21({
|
|
|
3403
3473
|
}
|
|
3404
3474
|
}
|
|
3405
3475
|
}), true);
|
|
3406
|
-
_el$
|
|
3476
|
+
$9HbP8$insert(_el$5, isNewModal && $9HbP8$createComponent(ClearButton, {}), _el$8, _co$);
|
|
3477
|
+
_el$6.$$pointerdown = ({
|
|
3407
3478
|
pointerType: pointerType
|
|
3408
3479
|
}) => {
|
|
3409
3480
|
// When selecting text with a mouse we want a SearchField to be focussed even when releasing the mouse outside the .field element (we assume the event listener which opens the modal is attached to that).
|
|
@@ -3421,7 +3492,7 @@ function $5285d2814d0fac0c$export$b94867ecbd698f21({
|
|
|
3421
3492
|
$9HbP8$runWithOwner(owner_of_field_element, () => $9HbP8$onCleanup(() => window.removeEventListener("pointerup", handler)));
|
|
3422
3493
|
}
|
|
3423
3494
|
};
|
|
3424
|
-
$9HbP8$addEventListener(_el$
|
|
3495
|
+
$9HbP8$addEventListener(_el$6, "select", $9HbP8$catchify(() => {
|
|
3425
3496
|
if (disabled_)
|
|
3426
3497
|
// just in case. The field not actually being disabled when being disabled_ is so that you can focus it and open the modal. We don't want any of the other input-field-interaction features to work
|
|
3427
3498
|
return;
|
|
@@ -3433,14 +3504,14 @@ function $5285d2814d0fac0c$export$b94867ecbd698f21({
|
|
|
3433
3504
|
once: true
|
|
3434
3505
|
});
|
|
3435
3506
|
}));
|
|
3436
|
-
$9HbP8$addEventListener(_el$
|
|
3507
|
+
$9HbP8$addEventListener(_el$6, "input", $9HbP8$catchify(() => {
|
|
3437
3508
|
const {
|
|
3438
3509
|
value: value
|
|
3439
3510
|
} = input_element;
|
|
3440
3511
|
if (!disabled_ && !value.length) clear_filters_(false); // if the user clears the whole field, reset filters on next submit
|
|
3441
|
-
|
|
3512
|
+
setSearchFieldValue(value);
|
|
3442
3513
|
}), true);
|
|
3443
|
-
$9HbP8$addEventListener(_el$
|
|
3514
|
+
$9HbP8$addEventListener(_el$6, "keydown", $9HbP8$catchify(e => {
|
|
3444
3515
|
if (disabled_) {
|
|
3445
3516
|
if (e.key !== "Tab" && e.key !== "Shift")
|
|
3446
3517
|
// alow tab-selecting the input field and then open the modal when the user start writing but also to move past the field with tab
|
|
@@ -3454,45 +3525,36 @@ function $5285d2814d0fac0c$export$b94867ecbd698f21({
|
|
|
3454
3525
|
input_element = el;
|
|
3455
3526
|
input_field_ref_?.(el);
|
|
3456
3527
|
});
|
|
3457
|
-
typeof _ref$ === "function" && $9HbP8$use(_ref$, _el$
|
|
3458
|
-
_el$
|
|
3459
|
-
$9HbP8$
|
|
3460
|
-
|
|
3461
|
-
|
|
3462
|
-
|
|
3463
|
-
|
|
3464
|
-
|
|
3465
|
-
|
|
3466
|
-
|
|
3467
|
-
|
|
3468
|
-
|
|
3469
|
-
|
|
3528
|
+
typeof _ref$ === "function" && $9HbP8$use(_ref$, _el$6);
|
|
3529
|
+
_el$6.classList.toggle("has-adjacent-back-button", !!!!on_back_);
|
|
3530
|
+
$9HbP8$insert(_el$5, !isNewModal && $9HbP8$createComponent(ClearButton, {}), _el$10, _co$2);
|
|
3531
|
+
$9HbP8$insert(_el$3, isNewModal && $9HbP8$createComponent(BackButton, {}), _el$17, _co$5);
|
|
3532
|
+
$9HbP8$insert(_el$3, $9HbP8$createComponent((0, $9HbP8$Show), {
|
|
3533
|
+
when: !isNewModal,
|
|
3534
|
+
get children() {
|
|
3535
|
+
var _el$11 = $9HbP8$getNextElement($5285d2814d0fac0c$var$_tmpl$4);
|
|
3536
|
+
$9HbP8$addEventListener(_el$11, "click", $9HbP8$catchify(() => submit_query_()), true);
|
|
3537
|
+
var _ref$2 = submit_button_ref_;
|
|
3538
|
+
typeof _ref$2 === "function" ? $9HbP8$use(_ref$2, _el$11) : submit_button_ref_ = _el$11;
|
|
3539
|
+
$9HbP8$insert(_el$11, $9HbP8$createComponent((0, $16f0ed5ea30d8d9c$export$82eafebb825fc23f), {}));
|
|
3540
|
+
$9HbP8$effect(() => $9HbP8$setAttribute(_el$11, "aria-label", i18n_.search_submit_button_aria_label_()));
|
|
3541
|
+
$9HbP8$runHydrationEvents();
|
|
3542
|
+
return _el$11;
|
|
3470
3543
|
}
|
|
3471
|
-
},
|
|
3472
|
-
tabindex: "-1"
|
|
3473
|
-
} : {
|
|
3474
|
-
"aria-label": i18n_.search_submit_button_aria_label_()
|
|
3475
|
-
}), false, true);
|
|
3476
|
-
$9HbP8$insert(_el$6, $9HbP8$createComponent((0, $16f0ed5ea30d8d9c$export$82eafebb825fc23f), {}));
|
|
3544
|
+
}), _el$19, _co$6);
|
|
3477
3545
|
$9HbP8$effect(_p$ => {
|
|
3478
3546
|
var _v$ = i18n_.search_field_field_aria_label_(),
|
|
3479
|
-
_v$2 = i18n_.placeholder_text_()
|
|
3480
|
-
|
|
3481
|
-
|
|
3482
|
-
_v$ !== _p$.e && $9HbP8$setAttribute(_el$4, "aria-label", _p$.e = _v$);
|
|
3483
|
-
_v$2 !== _p$.t && $9HbP8$setAttribute(_el$4, "placeholder", _p$.t = _v$2);
|
|
3484
|
-
_v$3 !== _p$.a && $9HbP8$setAttribute(_el$5, "title", _p$.a = _v$3);
|
|
3485
|
-
_p$.o = $9HbP8$style(_el$5, _v$4, _p$.o);
|
|
3547
|
+
_v$2 = i18n_.placeholder_text_();
|
|
3548
|
+
_v$ !== _p$.e && $9HbP8$setAttribute(_el$6, "aria-label", _p$.e = _v$);
|
|
3549
|
+
_v$2 !== _p$.t && $9HbP8$setAttribute(_el$6, "placeholder", _p$.t = _v$2);
|
|
3486
3550
|
return _p$;
|
|
3487
3551
|
}, {
|
|
3488
3552
|
e: undefined,
|
|
3489
|
-
t: undefined
|
|
3490
|
-
a: undefined,
|
|
3491
|
-
o: undefined
|
|
3553
|
+
t: undefined
|
|
3492
3554
|
});
|
|
3493
|
-
$9HbP8$effect(() => $9HbP8$setProperty(_el$
|
|
3555
|
+
$9HbP8$effect(() => $9HbP8$setProperty(_el$6, "value", searchFieldValue()));
|
|
3494
3556
|
$9HbP8$runHydrationEvents();
|
|
3495
|
-
return _el
|
|
3557
|
+
return _el$3;
|
|
3496
3558
|
})();
|
|
3497
3559
|
}
|
|
3498
3560
|
$9HbP8$delegateEvents(["click", "keydown", "input", "pointerdown"]);
|
|
@@ -3672,7 +3734,7 @@ function $42912431795f188e$var$RawClassicSearchModal({
|
|
|
3672
3734
|
};
|
|
3673
3735
|
});
|
|
3674
3736
|
const search_field = $5285d2814d0fac0c$export$b94867ecbd698f21({
|
|
3675
|
-
BackIcon_: (
|
|
3737
|
+
BackIcon_: (0, $ffb84ffbf4014982$export$8d8893ffd8aca39a),
|
|
3676
3738
|
input_field_ref_: element => set_input_field(element),
|
|
3677
3739
|
override_on_enter_: e => on_enter_in_search_field_function?.(e),
|
|
3678
3740
|
on_back_: close_modal_,
|
|
@@ -3688,7 +3750,6 @@ function $42912431795f188e$var$RawClassicSearchModal({
|
|
|
3688
3750
|
input_el.setSelectionRange(start, end);
|
|
3689
3751
|
}
|
|
3690
3752
|
});
|
|
3691
|
-
search_field.classList.add("in-modal");
|
|
3692
3753
|
const modal_element = (() => {
|
|
3693
3754
|
var _el$4 = $9HbP8$getNextElement($42912431795f188e$var$_tmpl$3),
|
|
3694
3755
|
_el$5 = _el$4.firstChild,
|
|
@@ -4912,7 +4973,7 @@ function $500a16dd18ee5a71$var$RawSearchModalV2({
|
|
|
4912
4973
|
return _el$7;
|
|
4913
4974
|
})();
|
|
4914
4975
|
const search_field = $5285d2814d0fac0c$export$b94867ecbd698f21({
|
|
4915
|
-
BackIcon_: (
|
|
4976
|
+
BackIcon_: (0, $5cec65dd06ade2c4$export$11e9f390c90a537f),
|
|
4916
4977
|
input_field_ref_: element => set_input_field(element),
|
|
4917
4978
|
override_on_enter_: e => on_enter_in_search_field_function?.(e),
|
|
4918
4979
|
on_back_: close_modal_,
|
|
@@ -4928,7 +4989,6 @@ function $500a16dd18ee5a71$var$RawSearchModalV2({
|
|
|
4928
4989
|
input_el.setSelectionRange(start, end);
|
|
4929
4990
|
}
|
|
4930
4991
|
});
|
|
4931
|
-
search_field.classList.add("in-modal");
|
|
4932
4992
|
if (setSearchFieldOuterWidth_) {
|
|
4933
4993
|
const resizeObserver = new ResizeObserver($9HbP8$catchify(records => setSearchFieldOuterWidth_(records.at(-1).contentRect.width)));
|
|
4934
4994
|
resizeObserver.observe(search_field);
|
|
@@ -12718,7 +12778,7 @@ function $0e562a5b247b1fc2$export$44f738469d5570cf({
|
|
|
12718
12778
|
const closeDuration_ = pxOffCenter > 100 ? 150 : 100;
|
|
12719
12779
|
setPollAlignment_(true);
|
|
12720
12780
|
// Fade out submit button so there aren't two overlapping buttons for a split second
|
|
12721
|
-
submitButton_
|
|
12781
|
+
submitButton_?.animate([{
|
|
12722
12782
|
opacity: 1
|
|
12723
12783
|
}, {
|
|
12724
12784
|
opacity: 0
|
|
@@ -12800,7 +12860,7 @@ function $0e562a5b247b1fc2$export$44f738469d5570cf({
|
|
|
12800
12860
|
duration: closeDuration_,
|
|
12801
12861
|
fill: "forwards",
|
|
12802
12862
|
easing: "ease-out"
|
|
12803
|
-
}).finished, submitButton_
|
|
12863
|
+
}).finished, submitButton_?.animate([{
|
|
12804
12864
|
opacity: 0
|
|
12805
12865
|
}, {
|
|
12806
12866
|
opacity: 1
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@depict-ai/ui",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.4.0",
|
|
4
4
|
"description": "Base package containing the actual UI of Depict UI along with translations, with a not-simplified API. We recommend using @depict-ai/js-ui or @depict-ai/react-ui instead.",
|
|
5
5
|
"packageManager": "yarn@3.2.2",
|
|
6
6
|
"sass": "styles.scss",
|
|
@@ -236,7 +236,7 @@
|
|
|
236
236
|
"@babel/plugin-transform-typescript": "^7.22.9",
|
|
237
237
|
"@babel/runtime": "latest",
|
|
238
238
|
"@babel/runtime-corejs3": "^7.22.6",
|
|
239
|
-
"@depict-ai/plp-styling": "^4.0
|
|
239
|
+
"@depict-ai/plp-styling": "^4.1.0",
|
|
240
240
|
"@depict-ai/types": "^5.1.2",
|
|
241
241
|
"@depict-ai/utilishared": "^2.1.2",
|
|
242
242
|
"solid-js": "^1.8.12"
|
package/server/ES10/index.cjs
CHANGED
|
@@ -100,7 +100,7 @@ $parcel$export(module.exports, "BreadCrumbs", () => $335c02c1241a9ca8$export$5b7
|
|
|
100
100
|
$parcel$export(module.exports, "QuickLinks", () => $335c02c1241a9ca8$export$de035477d6fef996);
|
|
101
101
|
$parcel$export(module.exports, "CategoryPage", () => $c10e33c4681f8c9b$export$e2bf8ce7779e827e);
|
|
102
102
|
/*! Depict.ai search and product listing SDK */
|
|
103
|
-
const $aa1938dec50d6c12$export$83d89fbfd8236492 = "4.
|
|
103
|
+
const $aa1938dec50d6c12$export$83d89fbfd8236492 = "4.4.0";
|
|
104
104
|
const $5401a6698b0c0658$var$transform_elements = sorted_cols_at_size => {
|
|
105
105
|
const cols_at_size = [];
|
|
106
106
|
for (let i = 0; i < sorted_cols_at_size.length; i++) {
|
|
@@ -3055,11 +3055,12 @@ let $c95c6dd9e93acd82$export$44dad306455dddf;
|
|
|
3055
3055
|
DEPICT_ID["SEARCH_PAGE"] = "depict-search-page";
|
|
3056
3056
|
DEPICT_ID["PLP_CATEGORY"] = "depict-plp-category";
|
|
3057
3057
|
})($c95c6dd9e93acd82$export$44dad306455dddf || ($c95c6dd9e93acd82$export$44dad306455dddf = {}));
|
|
3058
|
-
var $29e5dbeb69da7a36$var$_tmpl$ = ["<
|
|
3059
|
-
$29e5dbeb69da7a36$var$_tmpl$2 = ["<
|
|
3058
|
+
var $29e5dbeb69da7a36$var$_tmpl$ = ["<div", ' style="', '" class="spacer"></div>'],
|
|
3059
|
+
$29e5dbeb69da7a36$var$_tmpl$2 = ["<button", ' class="submit major" type="button"', ">", "</button>"],
|
|
3060
|
+
$29e5dbeb69da7a36$var$_tmpl$3 = ["<div", ' class="', '" role="search"><!--$-->', "<!--/--><!--$-->", '<!--/--><div class="field"><!--$-->', '<!--/--><input class="', '" tabindex="0"', "><!--$-->", "<!--/--></div><!--$-->", "<!--/--><!--$-->", "<!--/--></div>"];
|
|
3060
3061
|
function $29e5dbeb69da7a36$export$b94867ecbd698f21(_ref) {
|
|
3061
3062
|
let {
|
|
3062
|
-
search_field_value_:
|
|
3063
|
+
search_field_value_: [searchFieldValue, setSearchFieldValue],
|
|
3063
3064
|
input_field_ref_: input_field_ref_,
|
|
3064
3065
|
field_element_ref_: field_element_ref_,
|
|
3065
3066
|
submit_query_: submit_query_,
|
|
@@ -3084,19 +3085,65 @@ function $29e5dbeb69da7a36$export$b94867ecbd698f21(_ref) {
|
|
|
3084
3085
|
})); // focus field on render
|
|
3085
3086
|
const owner_of_field_element = $3hooq$solidjs.getOwner();
|
|
3086
3087
|
const isNewModal = BackIcon_[(0, $072ab198d82c3eb7$export$1ea76ea778b880dd)] === 2;
|
|
3087
|
-
|
|
3088
|
+
const [backButtonWidthAccessor, setBackButtonWidthAccessor] = $3hooq$solidjs.createSignal();
|
|
3089
|
+
const getBackButtonWidth = () => {
|
|
3090
|
+
var _backButtonWidthAcces;
|
|
3091
|
+
return (_backButtonWidthAcces = backButtonWidthAccessor()) === null || _backButtonWidthAcces === void 0 ? void 0 : _backButtonWidthAcces();
|
|
3092
|
+
};
|
|
3093
|
+
const searchFieldEmpty = $3hooq$solidjs.createMemo(() => !searchFieldValue());
|
|
3094
|
+
const BackButton = () => $3hooq$solidjsweb.createComponent((0, $3hooq$solidjs.Show), {
|
|
3088
3095
|
when: on_back_,
|
|
3089
3096
|
get children() {
|
|
3090
|
-
return $3hooq$solidjsweb.
|
|
3097
|
+
return $3hooq$solidjsweb.ssrElement("button", $3hooq$solidjsweb.mergeProps({
|
|
3098
|
+
"class": "back",
|
|
3099
|
+
type: "button",
|
|
3100
|
+
get ["aria-label"]() {
|
|
3101
|
+
return i18n_.back_();
|
|
3102
|
+
}
|
|
3103
|
+
}, isNewModal && {
|
|
3104
|
+
ref: el => {
|
|
3105
|
+
setBackButtonWidthAccessor(() => $c387d7f1d9fb66c0$export$ebdc3711f7e02ccd(el));
|
|
3106
|
+
$3hooq$solidjs.onCleanup(() => setBackButtonWidthAccessor());
|
|
3107
|
+
}
|
|
3108
|
+
}), () => isNewModal ? $3hooq$solidjsweb.escape($3hooq$solidjsweb.createComponent((0, $083b2336093176cf$export$3b621d86b1566b2), {})) : $3hooq$solidjsweb.escape($3hooq$solidjsweb.createComponent(BackIcon_, {})), true);
|
|
3091
3109
|
}
|
|
3092
|
-
})
|
|
3093
|
-
|
|
3094
|
-
type: "button"
|
|
3095
|
-
|
|
3096
|
-
|
|
3110
|
+
});
|
|
3111
|
+
const ClearButton = () => $3hooq$solidjsweb.ssrElement("button", $3hooq$solidjsweb.mergeProps({
|
|
3112
|
+
type: "button",
|
|
3113
|
+
get ["class"]() {
|
|
3114
|
+
return "clear ".concat(searchFieldEmpty() ? "empty" : "");
|
|
3115
|
+
},
|
|
3116
|
+
get style() {
|
|
3117
|
+
return isNewModal || !searchFieldEmpty() ? "" : "display: none";
|
|
3118
|
+
}
|
|
3119
|
+
}, () => searchFieldEmpty() ? {
|
|
3120
|
+
"aria-hidden": "true"
|
|
3097
3121
|
} : {
|
|
3098
|
-
|
|
3099
|
-
}), () => $3hooq$solidjsweb.escape($3hooq$solidjsweb.createComponent((0, $
|
|
3122
|
+
title: i18n_.clear_filters_query_sorting_after_submit_()
|
|
3123
|
+
}), () => isNewModal ? $3hooq$solidjsweb.escape($3hooq$solidjsweb.createComponent((0, $3hooq$solidjs.Show), {
|
|
3124
|
+
get when() {
|
|
3125
|
+
return !searchFieldEmpty();
|
|
3126
|
+
},
|
|
3127
|
+
get fallback() {
|
|
3128
|
+
return $3hooq$solidjsweb.createComponent((0, $5b88b077e48a4451$export$82eafebb825fc23f), {});
|
|
3129
|
+
},
|
|
3130
|
+
get children() {
|
|
3131
|
+
return $3hooq$solidjsweb.createComponent(BackIcon_, {});
|
|
3132
|
+
}
|
|
3133
|
+
})) : $3hooq$solidjsweb.escape($3hooq$solidjsweb.createComponent((0, $083b2336093176cf$export$3b621d86b1566b2), {})), true);
|
|
3134
|
+
return $3hooq$solidjsweb.ssr($29e5dbeb69da7a36$var$_tmpl$3, $3hooq$solidjsweb.ssrHydrationKey(), "search-field ".concat(!!on_back_ ? "in-modal" : ""), $3hooq$solidjsweb.escape($3hooq$solidjsweb.createComponent((0, $3hooq$solidjs.Show), {
|
|
3135
|
+
get when() {
|
|
3136
|
+
return getBackButtonWidth() !== undefined && on_back_;
|
|
3137
|
+
},
|
|
3138
|
+
get children() {
|
|
3139
|
+
return $3hooq$solidjsweb.ssr($29e5dbeb69da7a36$var$_tmpl$, $3hooq$solidjsweb.ssrHydrationKey(), "width:" + ($3hooq$solidjsweb.escape(getBackButtonWidth(), true) + "px"));
|
|
3140
|
+
}
|
|
3141
|
+
})), !isNewModal && $3hooq$solidjsweb.escape($3hooq$solidjsweb.createComponent(BackButton, {})), isNewModal && $3hooq$solidjsweb.escape($3hooq$solidjsweb.createComponent(ClearButton, {})), "query ".concat(!!on_back_ ? "has-adjacent-back-button" : ""), $3hooq$solidjsweb.ssrAttribute("aria-label", $3hooq$solidjsweb.escape(i18n_.search_field_field_aria_label_(), true), false) + $3hooq$solidjsweb.ssrAttribute("value", $3hooq$solidjsweb.escape(searchFieldValue(), true), false) + $3hooq$solidjsweb.ssrAttribute("placeholder", $3hooq$solidjsweb.escape(i18n_.placeholder_text_(), true), false), !isNewModal && $3hooq$solidjsweb.escape($3hooq$solidjsweb.createComponent(ClearButton, {})), isNewModal && $3hooq$solidjsweb.escape($3hooq$solidjsweb.createComponent(BackButton, {})), $3hooq$solidjsweb.escape($3hooq$solidjsweb.createComponent((0, $3hooq$solidjs.Show), {
|
|
3142
|
+
when: !isNewModal,
|
|
3143
|
+
get children() {
|
|
3144
|
+
return $3hooq$solidjsweb.ssr($29e5dbeb69da7a36$var$_tmpl$2, $3hooq$solidjsweb.ssrHydrationKey(), $3hooq$solidjsweb.ssrAttribute("aria-label", $3hooq$solidjsweb.escape(i18n_.search_submit_button_aria_label_(), true), false), $3hooq$solidjsweb.escape($3hooq$solidjsweb.createComponent((0, $5b88b077e48a4451$export$82eafebb825fc23f), {})));
|
|
3145
|
+
}
|
|
3146
|
+
})));
|
|
3100
3147
|
}
|
|
3101
3148
|
function $8c2e68c6d458169b$export$fe334901e8bebd57() {
|
|
3102
3149
|
const cleanup_fns = [];
|
|
@@ -3263,7 +3310,7 @@ function $9035b24c2dbd3f36$var$RawClassicSearchModal(_ref) {
|
|
|
3263
3310
|
};
|
|
3264
3311
|
});
|
|
3265
3312
|
const search_field = $29e5dbeb69da7a36$export$b94867ecbd698f21({
|
|
3266
|
-
BackIcon_: (
|
|
3313
|
+
BackIcon_: (0, $820f2920cc576f7e$export$8d8893ffd8aca39a),
|
|
3267
3314
|
input_field_ref_: element => set_input_field(element),
|
|
3268
3315
|
override_on_enter_: e => {
|
|
3269
3316
|
var _on_enter_in_search_f;
|
|
@@ -3282,7 +3329,6 @@ function $9035b24c2dbd3f36$var$RawClassicSearchModal(_ref) {
|
|
|
3282
3329
|
input_el.setSelectionRange(start, end);
|
|
3283
3330
|
}
|
|
3284
3331
|
});
|
|
3285
|
-
search_field.classList.add("in-modal");
|
|
3286
3332
|
const modal_element = $3hooq$solidjsweb.ssr($9035b24c2dbd3f36$var$_tmpl$3, $3hooq$solidjsweb.ssrHydrationKey(), "depict-search-modal", "".concat("body", " ").concat($3hooq$solidjsweb.escape($3hooq$solidjsweb.escape(random_classname, true), true)), $3hooq$solidjsweb.escape(search_field), $3hooq$solidjsweb.escape($3hooq$solidjsweb.createComponent((0, $1b3cf201cdd38687$export$b69d0d92862de18b), {
|
|
3287
3333
|
severity_: "error",
|
|
3288
3334
|
message_: "Autocomplete/suggestions failed",
|
|
@@ -4320,7 +4366,7 @@ function $43600b30502feeda$var$RawSearchModalV2(_ref) {
|
|
|
4320
4366
|
};
|
|
4321
4367
|
const discoverMoreSection = $3hooq$solidjsweb.ssr($43600b30502feeda$var$_tmpl$2, $3hooq$solidjsweb.ssrHydrationKey(), get_search_field_value_() ? $3hooq$solidjsweb.escape(i18n_.modal_view_all_results_()($3hooq$solidjsweb.ssr($43600b30502feeda$var$_tmpl$3, $3hooq$solidjsweb.ssrHydrationKey(), $3hooq$solidjsweb.escape(formattedTotalNumberResults())))) : $3hooq$solidjsweb.escape(i18n_.modal_discover_more_()));
|
|
4322
4368
|
const search_field = $29e5dbeb69da7a36$export$b94867ecbd698f21({
|
|
4323
|
-
BackIcon_: (
|
|
4369
|
+
BackIcon_: (0, $50b50df3efaa8776$export$11e9f390c90a537f),
|
|
4324
4370
|
input_field_ref_: element => set_input_field(element),
|
|
4325
4371
|
override_on_enter_: e => {
|
|
4326
4372
|
var _on_enter_in_search_f;
|
|
@@ -4339,7 +4385,6 @@ function $43600b30502feeda$var$RawSearchModalV2(_ref) {
|
|
|
4339
4385
|
input_el.setSelectionRange(start, end);
|
|
4340
4386
|
}
|
|
4341
4387
|
});
|
|
4342
|
-
search_field.classList.add("in-modal");
|
|
4343
4388
|
if (setSearchFieldOuterWidth_) {
|
|
4344
4389
|
const resizeObserver = new ResizeObserver($3hooq$depictaiutilishared.catchify(records => setSearchFieldOuterWidth_(records.at(-1).contentRect.width)));
|
|
4345
4390
|
resizeObserver.observe(search_field);
|
|
@@ -11160,7 +11205,7 @@ function $a60bc7692ce52705$export$44f738469d5570cf(_ref) {
|
|
|
11160
11205
|
const closeDuration_ = pxOffCenter > 100 ? 150 : 100;
|
|
11161
11206
|
setPollAlignment_(true);
|
|
11162
11207
|
// Fade out submit button so there aren't two overlapping buttons for a split second
|
|
11163
|
-
submitButton_.animate([{
|
|
11208
|
+
submitButton_ === null || submitButton_ === void 0 || submitButton_.animate([{
|
|
11164
11209
|
opacity: 1
|
|
11165
11210
|
}, {
|
|
11166
11211
|
opacity: 0
|
|
@@ -11242,7 +11287,7 @@ function $a60bc7692ce52705$export$44f738469d5570cf(_ref) {
|
|
|
11242
11287
|
duration: closeDuration_,
|
|
11243
11288
|
fill: "forwards",
|
|
11244
11289
|
easing: "ease-out"
|
|
11245
|
-
}).finished, submitButton_.animate([{
|
|
11290
|
+
}).finished, submitButton_ === null || submitButton_ === void 0 ? void 0 : submitButton_.animate([{
|
|
11246
11291
|
opacity: 0
|
|
11247
11292
|
}, {
|
|
11248
11293
|
opacity: 1
|
package/server/ES10/index.d.ts
CHANGED
|
@@ -10,7 +10,7 @@ import { ProductListingRequestV3 } from "@depict-ai/types/api/ProductListingRequ
|
|
|
10
10
|
import { GetListingRequest } from "@depict-ai/types/api/GetListingRequest";
|
|
11
11
|
import { BaseSearchRequestV3 } from "@depict-ai/types/api/BaseSearchRequestV3";
|
|
12
12
|
import { SearchFilter as _SearchFilter3 } from "@depict-ai/types/api/SearchRequestV2";
|
|
13
|
-
export const version = "4.
|
|
13
|
+
export const version = "4.4.0";
|
|
14
14
|
declare const LISTING_ID = "listingId";
|
|
15
15
|
declare const EXTERNAL_ID = "externalId";
|
|
16
16
|
type ScrollRestorationData = {
|