@depict-ai/portal-components 2.7.33 → 2.7.35
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/dist/index.d.ts +1 -1
- package/dist/main.js +36 -18
- package/dist/module.js +37 -19
- package/package.json +5 -4
- package/src/specialForShopify/DefaultSolidProductCard.tsx +30 -6
package/dist/index.d.ts
CHANGED
|
@@ -4,7 +4,7 @@ import { SearchFilter } from "@depict-ai/types/api/SearchResponse";
|
|
|
4
4
|
import { Locale } from "@depict-ai/react-ui/locales/latest";
|
|
5
5
|
import { ReactNode } from "react";
|
|
6
6
|
import { FeaturedInDisplay } from "@depict-ai/types/api/FeaturedInResponseV3";
|
|
7
|
-
export const version = "2.7.
|
|
7
|
+
export const version = "2.7.35";
|
|
8
8
|
type TextOptions = {
|
|
9
9
|
/** Enabled */
|
|
10
10
|
enabled: boolean;
|
package/dist/main.js
CHANGED
|
@@ -20,7 +20,7 @@ $parcel$export(module.exports, "ExpandingSection", () => $2214dc111b9e2866$expor
|
|
|
20
20
|
$parcel$export(module.exports, "ReactLookCard", () => $35bab9ff48bfe404$export$48787da2a5568bc);
|
|
21
21
|
$parcel$export(module.exports, "version", () => $0a017be3a74fcc94$export$83d89fbfd8236492);
|
|
22
22
|
/*! Depict.ai portal components */ // This is where the actual source of your React stuff should live
|
|
23
|
-
const $0a017be3a74fcc94$export$83d89fbfd8236492 = "2.7.
|
|
23
|
+
const $0a017be3a74fcc94$export$83d89fbfd8236492 = "2.7.35";
|
|
24
24
|
|
|
25
25
|
|
|
26
26
|
|
|
@@ -95,8 +95,7 @@ const $3375ddd88f77967d$var$sizeOrder = [
|
|
|
95
95
|
];
|
|
96
96
|
const $3375ddd88f77967d$var$ContainsColorSwatchesContext = /*@__PURE__*/ (0, $7jsgb$solidjs.createContext)();
|
|
97
97
|
let $3375ddd88f77967d$var$colorCanvasContext;
|
|
98
|
-
function $3375ddd88f77967d$export$f11681c54c860912(display, info, configuredOptions_,
|
|
99
|
-
overrideAspectRatio) {
|
|
98
|
+
function $3375ddd88f77967d$export$f11681c54c860912(display, info, configuredOptions_, overrideAspectRatio) {
|
|
100
99
|
const variantDisplays = (0, $7jsgb$solidjs.createMemo)(()=>display()?.variant_displays);
|
|
101
100
|
const defaultVariantIndex = (0, $7jsgb$solidjs.createMemo)(()=>display()?.variant_index);
|
|
102
101
|
const [showVariantIndex, setShowVariantIndex] = (0, $7jsgb$solidjs.createSignal)((0, $7jsgb$solidjs.untrack)(defaultVariantIndex));
|
|
@@ -148,13 +147,17 @@ overrideAspectRatio) {
|
|
|
148
147
|
(0, $7jsgb$solidjsweb.use)((el)=>props?.ref?.(el), _el$);
|
|
149
148
|
(0, $7jsgb$solidjsweb.insert)(_el$, ()=>props.children);
|
|
150
149
|
(0, $7jsgb$solidjsweb.effect)((_p$)=>{
|
|
151
|
-
var _v$ = props.class, _v$2 = variantToShow()?.page_url || "#";
|
|
150
|
+
var _v$ = props.class, _v$2 = variantToShow()?.page_url || "#", _v$3 = !props.focusable_, _v$4 = props.focusable_ ? undefined : -1;
|
|
152
151
|
_v$ !== _p$.e && (0, $7jsgb$solidjsweb.className)(_el$, _p$.e = _v$);
|
|
153
152
|
_v$2 !== _p$.t && (0, $7jsgb$solidjsweb.setAttribute)(_el$, "href", _p$.t = _v$2);
|
|
153
|
+
_v$3 !== _p$.a && (0, $7jsgb$solidjsweb.setAttribute)(_el$, "aria-hidden", _p$.a = _v$3);
|
|
154
|
+
_v$4 !== _p$.o && (0, $7jsgb$solidjsweb.setAttribute)(_el$, "tabindex", _p$.o = _v$4);
|
|
154
155
|
return _p$;
|
|
155
156
|
}, {
|
|
156
157
|
e: undefined,
|
|
157
|
-
t: undefined
|
|
158
|
+
t: undefined,
|
|
159
|
+
a: undefined,
|
|
160
|
+
o: undefined
|
|
158
161
|
});
|
|
159
162
|
return _el$;
|
|
160
163
|
})();
|
|
@@ -202,10 +205,20 @@ overrideAspectRatio) {
|
|
|
202
205
|
const element = (0, $7jsgb$solidjsweb.createComponent)($3375ddd88f77967d$var$ContainsColorSwatchesProvider, {
|
|
203
206
|
get children () {
|
|
204
207
|
var _el$3 = $3375ddd88f77967d$var$_tmpl$3();
|
|
205
|
-
(0, $7jsgb$solidjsweb.
|
|
206
|
-
|
|
208
|
+
(0, $7jsgb$solidjsweb.spread)(_el$3, (0, $7jsgb$solidjsweb.mergeProps)({
|
|
209
|
+
get style () {
|
|
210
|
+
return mainStyle();
|
|
211
|
+
},
|
|
212
|
+
get onMouseEnter () {
|
|
213
|
+
return (0, $7jsgb$depictaiutilisharedlatest.catchify)(()=>!noHoverSupport_() && setCardIsHovered(true));
|
|
214
|
+
},
|
|
215
|
+
get onMouseLeave () {
|
|
216
|
+
return (0, $7jsgb$depictaiutilisharedlatest.catchify)(()=>!noHoverSupport_() && setCardIsHovered(false));
|
|
217
|
+
}
|
|
218
|
+
}, ()=>configuredOptions_().overrideMainAttributes_), false, true);
|
|
207
219
|
(0, $7jsgb$solidjsweb.insert)(_el$3, (0, $7jsgb$solidjsweb.createComponent)(LinkWrapped, {
|
|
208
220
|
"class": "upper",
|
|
221
|
+
focusable_: true,
|
|
209
222
|
get children () {
|
|
210
223
|
return (0, $7jsgb$solidjsweb.createComponent)($3375ddd88f77967d$var$ImagesAndVideos, {
|
|
211
224
|
image_urls_: ()=>variantToShow()?.image_urls,
|
|
@@ -346,14 +359,15 @@ overrideAspectRatio) {
|
|
|
346
359
|
wrapperComponent_: ()=>containsColorSwatches() && LinkWrapped,
|
|
347
360
|
ref_: ref_
|
|
348
361
|
}),
|
|
349
|
-
HoveredComponent_: ({ ref_: ref_ })=>(0, $7jsgb$solidjsweb.createComponent)($3375ddd88f77967d$var$ColorSwatches, {
|
|
362
|
+
HoveredComponent_: ({ ref_: ref_, isHidden_: isHidden_ })=>(0, $7jsgb$solidjsweb.createComponent)($3375ddd88f77967d$var$ColorSwatches, {
|
|
350
363
|
colorMap_: colorMap,
|
|
351
364
|
showVariantIndex_: showVariantIndex,
|
|
352
365
|
setShowVariantIndex_: setShowVariantIndex,
|
|
353
366
|
colorsAtIndex_: ()=>variantDisplays()?.map((variant)=>variant.color_name),
|
|
354
367
|
ref_: ref_,
|
|
355
368
|
wantedContainerHeightRem_: swatchContainerHeight,
|
|
356
|
-
defaultVariantIndex_: defaultVariantIndex
|
|
369
|
+
defaultVariantIndex_: defaultVariantIndex,
|
|
370
|
+
isHidden_: isHidden_
|
|
357
371
|
}),
|
|
358
372
|
cardIsHovered_: cardIsHovered
|
|
359
373
|
});
|
|
@@ -367,7 +381,6 @@ overrideAspectRatio) {
|
|
|
367
381
|
}
|
|
368
382
|
});
|
|
369
383
|
}, null);
|
|
370
|
-
(0, $7jsgb$solidjsweb.effect)((_$p)=>(0, $7jsgb$solidjsweb.style)(_el$3, mainStyle(), _$p));
|
|
371
384
|
return _el$3;
|
|
372
385
|
}
|
|
373
386
|
});
|
|
@@ -473,13 +486,14 @@ overrideAspectRatio) {
|
|
|
473
486
|
ref_: (el)=>defaultElement = el
|
|
474
487
|
}),
|
|
475
488
|
(0, $7jsgb$solidjsweb.createComponent)(HoveredComponent_, {
|
|
476
|
-
ref_: (el)=>hoveredElement = el
|
|
489
|
+
ref_: (el)=>hoveredElement = el,
|
|
490
|
+
isHidden_: ()=>!cardIsHovered_()
|
|
477
491
|
})
|
|
478
492
|
];
|
|
479
493
|
}
|
|
480
494
|
});
|
|
481
495
|
}
|
|
482
|
-
function $3375ddd88f77967d$var$ColorSwatches({ colorMap_: colorMap_, setShowVariantIndex_: setShowVariantIndex_, showVariantIndex_: showVariantIndex_, colorsAtIndex_: colorsAtIndex_, wantedContainerHeightRem_: wantedContainerHeightRem_, defaultVariantIndex_: defaultVariantIndex_, ref_: ref_ }) {
|
|
496
|
+
function $3375ddd88f77967d$var$ColorSwatches({ colorMap_: colorMap_, setShowVariantIndex_: setShowVariantIndex_, showVariantIndex_: showVariantIndex_, colorsAtIndex_: colorsAtIndex_, wantedContainerHeightRem_: wantedContainerHeightRem_, defaultVariantIndex_: defaultVariantIndex_, ref_: ref_, isHidden_: isHidden_ }) {
|
|
483
497
|
let unHoverDebouncedTimeout;
|
|
484
498
|
const entriesToShow = ()=>[
|
|
485
499
|
...colorMap_().entries()
|
|
@@ -525,17 +539,21 @@ function $3375ddd88f77967d$var$ColorSwatches({ colorMap_: colorMap_, setShowVari
|
|
|
525
539
|
(0, $7jsgb$solidjsweb.setAttribute)(_el$6, "href", pageUrl_);
|
|
526
540
|
(0, $7jsgb$solidjsweb.setAttribute)(_el$6, "title", colorName);
|
|
527
541
|
(0, $7jsgb$solidjsweb.effect)((_p$)=>{
|
|
528
|
-
var _v$
|
|
529
|
-
_p$.e
|
|
530
|
-
_v$
|
|
531
|
-
|
|
532
|
-
_v$
|
|
542
|
+
var _v$5 = isHidden_?.(), _v$6 = isHidden_?.() ? -1 : undefined, _v$7 = `--background:${invalidColor() ? "white" : hexColor_}`, _v$8 = !!(colorsAtIndex_()?.[showVariantIndex_()] === colorName), _v$9 = !!thisColorIsDefaultColor(), _v$10 = !!($3375ddd88f77967d$var$isLightColor(hexColor_) || invalidColor());
|
|
543
|
+
_v$5 !== _p$.e && (0, $7jsgb$solidjsweb.setAttribute)(_el$6, "aria-hidden", _p$.e = _v$5);
|
|
544
|
+
_v$6 !== _p$.t && (0, $7jsgb$solidjsweb.setAttribute)(_el$6, "tabindex", _p$.t = _v$6);
|
|
545
|
+
_p$.a = (0, $7jsgb$solidjsweb.style)(_el$6, _v$7, _p$.a);
|
|
546
|
+
_v$8 !== _p$.o && _el$6.classList.toggle("selected", _p$.o = _v$8);
|
|
547
|
+
_v$9 !== _p$.i && _el$6.classList.toggle("first", _p$.i = _v$9);
|
|
548
|
+
_v$10 !== _p$.n && _el$6.classList.toggle("light-colored", _p$.n = _v$10);
|
|
533
549
|
return _p$;
|
|
534
550
|
}, {
|
|
535
551
|
e: undefined,
|
|
536
552
|
t: undefined,
|
|
537
553
|
a: undefined,
|
|
538
|
-
o: undefined
|
|
554
|
+
o: undefined,
|
|
555
|
+
i: undefined,
|
|
556
|
+
n: undefined
|
|
539
557
|
});
|
|
540
558
|
return _el$6;
|
|
541
559
|
})();
|
package/dist/module.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import {add_to_version_info as $2MCgq$add_to_version_info, standard_price_format as $2MCgq$standard_price_format, catchify as $2MCgq$catchify, dlog as $2MCgq$dlog, dwarn as $2MCgq$dwarn} from "@depict-ai/utilishared/latest";
|
|
2
2
|
import {RecommendationGrid as $2MCgq$RecommendationGrid, defaultColsAtSize as $2MCgq$defaultColsAtSize, defaultGridSpacing as $2MCgq$defaultGridSpacing, media_query_to_accessor as $2MCgq$media_query_to_accessor, TextPlaceholder as $2MCgq$TextPlaceholder, useListing as $2MCgq$useListing, shopifyContainedImageContextSymbol as $2MCgq$shopifyContainedImageContextSymbol, usePLPLayout as $2MCgq$usePLPLayout, useProductCardIsVisible as $2MCgq$useProductCardIsVisible, useSlidableInformation as $2MCgq$useSlidableInformation, SlidableItems as $2MCgq$SlidableItems, ImagePlaceholder as $2MCgq$ImagePlaceholder, ImageContainer as $2MCgq$ImageContainer, ShopifyContainedImage as $2MCgq$ShopifyContainedImage, useVisibilityState as $2MCgq$useVisibilityState, useProductCardIndex as $2MCgq$useProductCardIndex, RecommendationSlider as $2MCgq$RecommendationSlider, accessor_of_object_to_object_with_accessor_values as $2MCgq$accessor_of_object_to_object_with_accessor_values, create_modified_filters as $2MCgq$create_modified_filters, SelectedFilters as $2MCgq$SelectedFilters, FilterBody as $2MCgq$FilterBody, ExpandingDetails as $2MCgq$ExpandingDetails, ListingProvider as $2MCgq$ListingProvider, PseudoRouter as $2MCgq$PseudoRouter, LookCard as $2MCgq$LookCard} from "@depict-ai/ui/latest";
|
|
3
|
-
import {render as $2MCgq$render, template as $2MCgq$template, createComponent as $2MCgq$createComponent, addEventListener as $2MCgq$addEventListener, use as $2MCgq$use, insert as $2MCgq$insert, effect as $2MCgq$effect, className as $2MCgq$className, setAttribute as $2MCgq$setAttribute,
|
|
3
|
+
import {render as $2MCgq$render, template as $2MCgq$template, createComponent as $2MCgq$createComponent, addEventListener as $2MCgq$addEventListener, use as $2MCgq$use, insert as $2MCgq$insert, effect as $2MCgq$effect, className as $2MCgq$className, setAttribute as $2MCgq$setAttribute, spread as $2MCgq$spread, mergeProps as $2MCgq$mergeProps, memo as $2MCgq$memo, style as $2MCgq$style, classList as $2MCgq$classList, delegateEvents as $2MCgq$delegateEvents} from "solid-js/web";
|
|
4
4
|
import {useRef as $2MCgq$useRef, useState as $2MCgq$useState, useEffect as $2MCgq$useEffect, createElement as $2MCgq$createElement, Fragment as $2MCgq$Fragment} from "react";
|
|
5
5
|
import {createStore as $2MCgq$createStore, reconcile as $2MCgq$reconcile} from "solid-js/store";
|
|
6
6
|
import {createContext as $2MCgq$createContext, createMemo as $2MCgq$createMemo, createSignal as $2MCgq$createSignal, untrack as $2MCgq$untrack, createResource as $2MCgq$createResource, Suspense as $2MCgq$Suspense, createEffect as $2MCgq$createEffect, children as $2MCgq$children, Show as $2MCgq$Show, onCleanup as $2MCgq$onCleanup, For as $2MCgq$For, createRenderEffect as $2MCgq$createRenderEffect, on as $2MCgq$on, useContext as $2MCgq$useContext} from "solid-js";
|
|
7
7
|
import {createPortal as $2MCgq$createPortal} from "react-dom";
|
|
8
8
|
|
|
9
9
|
/*! Depict.ai portal components */ // This is where the actual source of your React stuff should live
|
|
10
|
-
const $91c11b750e80ede3$export$83d89fbfd8236492 = "2.7.
|
|
10
|
+
const $91c11b750e80ede3$export$83d89fbfd8236492 = "2.7.35";
|
|
11
11
|
|
|
12
12
|
|
|
13
13
|
|
|
@@ -82,8 +82,7 @@ const $29535f590238371c$var$sizeOrder = [
|
|
|
82
82
|
];
|
|
83
83
|
const $29535f590238371c$var$ContainsColorSwatchesContext = /*@__PURE__*/ (0, $2MCgq$createContext)();
|
|
84
84
|
let $29535f590238371c$var$colorCanvasContext;
|
|
85
|
-
function $29535f590238371c$export$f11681c54c860912(display, info, configuredOptions_,
|
|
86
|
-
overrideAspectRatio) {
|
|
85
|
+
function $29535f590238371c$export$f11681c54c860912(display, info, configuredOptions_, overrideAspectRatio) {
|
|
87
86
|
const variantDisplays = (0, $2MCgq$createMemo)(()=>display()?.variant_displays);
|
|
88
87
|
const defaultVariantIndex = (0, $2MCgq$createMemo)(()=>display()?.variant_index);
|
|
89
88
|
const [showVariantIndex, setShowVariantIndex] = (0, $2MCgq$createSignal)((0, $2MCgq$untrack)(defaultVariantIndex));
|
|
@@ -135,13 +134,17 @@ overrideAspectRatio) {
|
|
|
135
134
|
(0, $2MCgq$use)((el)=>props?.ref?.(el), _el$);
|
|
136
135
|
(0, $2MCgq$insert)(_el$, ()=>props.children);
|
|
137
136
|
(0, $2MCgq$effect)((_p$)=>{
|
|
138
|
-
var _v$ = props.class, _v$2 = variantToShow()?.page_url || "#";
|
|
137
|
+
var _v$ = props.class, _v$2 = variantToShow()?.page_url || "#", _v$3 = !props.focusable_, _v$4 = props.focusable_ ? undefined : -1;
|
|
139
138
|
_v$ !== _p$.e && (0, $2MCgq$className)(_el$, _p$.e = _v$);
|
|
140
139
|
_v$2 !== _p$.t && (0, $2MCgq$setAttribute)(_el$, "href", _p$.t = _v$2);
|
|
140
|
+
_v$3 !== _p$.a && (0, $2MCgq$setAttribute)(_el$, "aria-hidden", _p$.a = _v$3);
|
|
141
|
+
_v$4 !== _p$.o && (0, $2MCgq$setAttribute)(_el$, "tabindex", _p$.o = _v$4);
|
|
141
142
|
return _p$;
|
|
142
143
|
}, {
|
|
143
144
|
e: undefined,
|
|
144
|
-
t: undefined
|
|
145
|
+
t: undefined,
|
|
146
|
+
a: undefined,
|
|
147
|
+
o: undefined
|
|
145
148
|
});
|
|
146
149
|
return _el$;
|
|
147
150
|
})();
|
|
@@ -189,10 +192,20 @@ overrideAspectRatio) {
|
|
|
189
192
|
const element = (0, $2MCgq$createComponent)($29535f590238371c$var$ContainsColorSwatchesProvider, {
|
|
190
193
|
get children () {
|
|
191
194
|
var _el$3 = $29535f590238371c$var$_tmpl$3();
|
|
192
|
-
(0, $2MCgq$
|
|
193
|
-
|
|
195
|
+
(0, $2MCgq$spread)(_el$3, (0, $2MCgq$mergeProps)({
|
|
196
|
+
get style () {
|
|
197
|
+
return mainStyle();
|
|
198
|
+
},
|
|
199
|
+
get onMouseEnter () {
|
|
200
|
+
return (0, $2MCgq$catchify)(()=>!noHoverSupport_() && setCardIsHovered(true));
|
|
201
|
+
},
|
|
202
|
+
get onMouseLeave () {
|
|
203
|
+
return (0, $2MCgq$catchify)(()=>!noHoverSupport_() && setCardIsHovered(false));
|
|
204
|
+
}
|
|
205
|
+
}, ()=>configuredOptions_().overrideMainAttributes_), false, true);
|
|
194
206
|
(0, $2MCgq$insert)(_el$3, (0, $2MCgq$createComponent)(LinkWrapped, {
|
|
195
207
|
"class": "upper",
|
|
208
|
+
focusable_: true,
|
|
196
209
|
get children () {
|
|
197
210
|
return (0, $2MCgq$createComponent)($29535f590238371c$var$ImagesAndVideos, {
|
|
198
211
|
image_urls_: ()=>variantToShow()?.image_urls,
|
|
@@ -333,14 +346,15 @@ overrideAspectRatio) {
|
|
|
333
346
|
wrapperComponent_: ()=>containsColorSwatches() && LinkWrapped,
|
|
334
347
|
ref_: ref_
|
|
335
348
|
}),
|
|
336
|
-
HoveredComponent_: ({ ref_: ref_ })=>(0, $2MCgq$createComponent)($29535f590238371c$var$ColorSwatches, {
|
|
349
|
+
HoveredComponent_: ({ ref_: ref_, isHidden_: isHidden_ })=>(0, $2MCgq$createComponent)($29535f590238371c$var$ColorSwatches, {
|
|
337
350
|
colorMap_: colorMap,
|
|
338
351
|
showVariantIndex_: showVariantIndex,
|
|
339
352
|
setShowVariantIndex_: setShowVariantIndex,
|
|
340
353
|
colorsAtIndex_: ()=>variantDisplays()?.map((variant)=>variant.color_name),
|
|
341
354
|
ref_: ref_,
|
|
342
355
|
wantedContainerHeightRem_: swatchContainerHeight,
|
|
343
|
-
defaultVariantIndex_: defaultVariantIndex
|
|
356
|
+
defaultVariantIndex_: defaultVariantIndex,
|
|
357
|
+
isHidden_: isHidden_
|
|
344
358
|
}),
|
|
345
359
|
cardIsHovered_: cardIsHovered
|
|
346
360
|
});
|
|
@@ -354,7 +368,6 @@ overrideAspectRatio) {
|
|
|
354
368
|
}
|
|
355
369
|
});
|
|
356
370
|
}, null);
|
|
357
|
-
(0, $2MCgq$effect)((_$p)=>(0, $2MCgq$style)(_el$3, mainStyle(), _$p));
|
|
358
371
|
return _el$3;
|
|
359
372
|
}
|
|
360
373
|
});
|
|
@@ -460,13 +473,14 @@ overrideAspectRatio) {
|
|
|
460
473
|
ref_: (el)=>defaultElement = el
|
|
461
474
|
}),
|
|
462
475
|
(0, $2MCgq$createComponent)(HoveredComponent_, {
|
|
463
|
-
ref_: (el)=>hoveredElement = el
|
|
476
|
+
ref_: (el)=>hoveredElement = el,
|
|
477
|
+
isHidden_: ()=>!cardIsHovered_()
|
|
464
478
|
})
|
|
465
479
|
];
|
|
466
480
|
}
|
|
467
481
|
});
|
|
468
482
|
}
|
|
469
|
-
function $29535f590238371c$var$ColorSwatches({ colorMap_: colorMap_, setShowVariantIndex_: setShowVariantIndex_, showVariantIndex_: showVariantIndex_, colorsAtIndex_: colorsAtIndex_, wantedContainerHeightRem_: wantedContainerHeightRem_, defaultVariantIndex_: defaultVariantIndex_, ref_: ref_ }) {
|
|
483
|
+
function $29535f590238371c$var$ColorSwatches({ colorMap_: colorMap_, setShowVariantIndex_: setShowVariantIndex_, showVariantIndex_: showVariantIndex_, colorsAtIndex_: colorsAtIndex_, wantedContainerHeightRem_: wantedContainerHeightRem_, defaultVariantIndex_: defaultVariantIndex_, ref_: ref_, isHidden_: isHidden_ }) {
|
|
470
484
|
let unHoverDebouncedTimeout;
|
|
471
485
|
const entriesToShow = ()=>[
|
|
472
486
|
...colorMap_().entries()
|
|
@@ -512,17 +526,21 @@ function $29535f590238371c$var$ColorSwatches({ colorMap_: colorMap_, setShowVari
|
|
|
512
526
|
(0, $2MCgq$setAttribute)(_el$6, "href", pageUrl_);
|
|
513
527
|
(0, $2MCgq$setAttribute)(_el$6, "title", colorName);
|
|
514
528
|
(0, $2MCgq$effect)((_p$)=>{
|
|
515
|
-
var _v$
|
|
516
|
-
_p$.e
|
|
517
|
-
_v$
|
|
518
|
-
|
|
519
|
-
_v$
|
|
529
|
+
var _v$5 = isHidden_?.(), _v$6 = isHidden_?.() ? -1 : undefined, _v$7 = `--background:${invalidColor() ? "white" : hexColor_}`, _v$8 = !!(colorsAtIndex_()?.[showVariantIndex_()] === colorName), _v$9 = !!thisColorIsDefaultColor(), _v$10 = !!($29535f590238371c$var$isLightColor(hexColor_) || invalidColor());
|
|
530
|
+
_v$5 !== _p$.e && (0, $2MCgq$setAttribute)(_el$6, "aria-hidden", _p$.e = _v$5);
|
|
531
|
+
_v$6 !== _p$.t && (0, $2MCgq$setAttribute)(_el$6, "tabindex", _p$.t = _v$6);
|
|
532
|
+
_p$.a = (0, $2MCgq$style)(_el$6, _v$7, _p$.a);
|
|
533
|
+
_v$8 !== _p$.o && _el$6.classList.toggle("selected", _p$.o = _v$8);
|
|
534
|
+
_v$9 !== _p$.i && _el$6.classList.toggle("first", _p$.i = _v$9);
|
|
535
|
+
_v$10 !== _p$.n && _el$6.classList.toggle("light-colored", _p$.n = _v$10);
|
|
520
536
|
return _p$;
|
|
521
537
|
}, {
|
|
522
538
|
e: undefined,
|
|
523
539
|
t: undefined,
|
|
524
540
|
a: undefined,
|
|
525
|
-
o: undefined
|
|
541
|
+
o: undefined,
|
|
542
|
+
i: undefined,
|
|
543
|
+
n: undefined
|
|
526
544
|
});
|
|
527
545
|
return _el$6;
|
|
528
546
|
})();
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@depict-ai/portal-components",
|
|
3
|
-
"version": "2.7.
|
|
3
|
+
"version": "2.7.35",
|
|
4
4
|
"packageManager": "yarn@3.2.2",
|
|
5
5
|
"source": "src/index.ts",
|
|
6
6
|
"main": "dist/main.js",
|
|
@@ -71,7 +71,8 @@
|
|
|
71
71
|
"sass": "./dist/styles/index.scss"
|
|
72
72
|
},
|
|
73
73
|
"./styles/*": "./dist/styles/*",
|
|
74
|
-
"./src/specialForShopify/DefaultSolidProductCard.tsx": "./src/specialForShopify/DefaultSolidProductCard.tsx"
|
|
74
|
+
"./src/specialForShopify/DefaultSolidProductCard.tsx": "./src/specialForShopify/DefaultSolidProductCard.tsx",
|
|
75
|
+
"./src/specialForShopify/DefaultSolidProductCard": "./src/specialForShopify/DefaultSolidProductCard.tsx"
|
|
75
76
|
},
|
|
76
77
|
"files": [
|
|
77
78
|
"/dist",
|
|
@@ -101,10 +102,10 @@
|
|
|
101
102
|
"dependencies": {
|
|
102
103
|
"@babel/runtime": "latest",
|
|
103
104
|
"@babel/runtime-corejs3": "^7.22.6",
|
|
104
|
-
"@depict-ai/plp-styling": "^4.4.
|
|
105
|
+
"@depict-ai/plp-styling": "^4.4.21",
|
|
105
106
|
"@depict-ai/react-ui": "^4.8.7",
|
|
106
107
|
"@depict-ai/types": "^5.4.5",
|
|
107
|
-
"@depict-ai/ui": "^4.8.
|
|
108
|
+
"@depict-ai/ui": "^4.8.30",
|
|
108
109
|
"@depict-ai/utilishared": "^2.4.7",
|
|
109
110
|
"parcel": "^2.10.3",
|
|
110
111
|
"solid-js": "^1.8.16"
|
|
@@ -134,7 +134,18 @@ export function DefaultSolidProductCard(
|
|
|
134
134
|
// In development (product card editor), a fallback formatting will be used.
|
|
135
135
|
formatPrice: <T extends number | undefined>(price: T) => T extends undefined ? undefined : string;
|
|
136
136
|
}),
|
|
137
|
-
configuredOptions_: Accessor<
|
|
137
|
+
configuredOptions_: Accessor<
|
|
138
|
+
ProductCardSchema & {
|
|
139
|
+
/**
|
|
140
|
+
* used in Depict portal where we don't have a provider with an IntersectionObserver
|
|
141
|
+
*/
|
|
142
|
+
forceIsVisible_?: boolean;
|
|
143
|
+
/**
|
|
144
|
+
* Used in Depict shopify app admin UI when this is a non-user configured product card
|
|
145
|
+
*/
|
|
146
|
+
overrideMainAttributes_?: JSX.HTMLAttributes<HTMLDivElement>;
|
|
147
|
+
}
|
|
148
|
+
>,
|
|
138
149
|
overrideAspectRatio?: Accessor<number>
|
|
139
150
|
) {
|
|
140
151
|
const variantDisplays = createMemo(() => display()?.variant_displays);
|
|
@@ -191,12 +202,19 @@ export function DefaultSolidProductCard(
|
|
|
191
202
|
return Math.max(...considerSize);
|
|
192
203
|
});
|
|
193
204
|
|
|
194
|
-
const LinkWrapped = (props: {
|
|
205
|
+
const LinkWrapped = (props: {
|
|
206
|
+
children: JSX.Element;
|
|
207
|
+
class?: string;
|
|
208
|
+
ref?: (el: HTMLAnchorElement) => void;
|
|
209
|
+
focusable_?: boolean;
|
|
210
|
+
}) => (
|
|
195
211
|
<a
|
|
196
212
|
class={props.class}
|
|
197
213
|
href={variantToShow()?.page_url || "#"}
|
|
198
214
|
// Work around https://github.com/solidjs/solid/issues/2137
|
|
199
215
|
ref={el => props?.ref?.(el)}
|
|
216
|
+
aria-hidden={!props.focusable_}
|
|
217
|
+
tabIndex={props.focusable_ ? undefined : -1}
|
|
200
218
|
onClick={catchify(e => {
|
|
201
219
|
const { target } = e;
|
|
202
220
|
const navbuttonSelector = ".d-navbutton";
|
|
@@ -256,8 +274,9 @@ export function DefaultSolidProductCard(
|
|
|
256
274
|
style={mainStyle()}
|
|
257
275
|
onMouseEnter={catchify(() => !noHoverSupport_() && setCardIsHovered(true))}
|
|
258
276
|
onMouseLeave={catchify(() => !noHoverSupport_() && setCardIsHovered(false))}
|
|
277
|
+
{...configuredOptions_().overrideMainAttributes_}
|
|
259
278
|
>
|
|
260
|
-
<LinkWrapped class="upper">
|
|
279
|
+
<LinkWrapped class="upper" focusable_={true}>
|
|
261
280
|
<ImagesAndVideos
|
|
262
281
|
image_urls_={() => variantToShow()?.image_urls}
|
|
263
282
|
video_={() => variantToShow()?.video}
|
|
@@ -366,7 +385,7 @@ export function DefaultSolidProductCard(
|
|
|
366
385
|
ref_={ref_}
|
|
367
386
|
/>
|
|
368
387
|
)}
|
|
369
|
-
HoveredComponent_={({ ref_ }) => (
|
|
388
|
+
HoveredComponent_={({ ref_, isHidden_ }) => (
|
|
370
389
|
<ColorSwatches
|
|
371
390
|
colorMap_={colorMap}
|
|
372
391
|
showVariantIndex_={showVariantIndex}
|
|
@@ -375,6 +394,7 @@ export function DefaultSolidProductCard(
|
|
|
375
394
|
ref_={ref_}
|
|
376
395
|
wantedContainerHeightRem_={swatchContainerHeight}
|
|
377
396
|
defaultVariantIndex_={defaultVariantIndex}
|
|
397
|
+
isHidden_={isHidden_}
|
|
378
398
|
/>
|
|
379
399
|
)}
|
|
380
400
|
cardIsHovered_={cardIsHovered}
|
|
@@ -411,7 +431,7 @@ function AnimatedRowSwitch({
|
|
|
411
431
|
containerComponent_,
|
|
412
432
|
}: {
|
|
413
433
|
DefaultComponent_: (props: { ref_: (el: HTMLElement) => void }) => JSX.Element;
|
|
414
|
-
HoveredComponent_: (props: { ref_: (el: HTMLElement) => void }) => JSX.Element;
|
|
434
|
+
HoveredComponent_: (props: { ref_: (el: HTMLElement) => void; isHidden_: Accessor<boolean> }) => JSX.Element;
|
|
415
435
|
cardIsHovered_: Accessor<boolean>;
|
|
416
436
|
containerComponent_: Accessor<
|
|
417
437
|
false | ((props: { ref?: (el: HTMLElement) => void; class: string; children: JSX.Element }) => JSX.Element)
|
|
@@ -500,7 +520,7 @@ function AnimatedRowSwitch({
|
|
|
500
520
|
ref_={(el: HTMLElement) => (containerElement = el)}
|
|
501
521
|
>
|
|
502
522
|
<DefaultComponent_ ref_={el => (defaultElement = el)} />
|
|
503
|
-
<HoveredComponent_ ref_={el => (hoveredElement = el)} />
|
|
523
|
+
<HoveredComponent_ ref_={el => (hoveredElement = el)} isHidden_={() => !cardIsHovered_()} />
|
|
504
524
|
</InComponentOrDiv>
|
|
505
525
|
);
|
|
506
526
|
}
|
|
@@ -513,6 +533,7 @@ function ColorSwatches({
|
|
|
513
533
|
wantedContainerHeightRem_,
|
|
514
534
|
defaultVariantIndex_,
|
|
515
535
|
ref_,
|
|
536
|
+
isHidden_,
|
|
516
537
|
}: {
|
|
517
538
|
colorMap_: Accessor<Map<string, { hexColor_: string; pageUrl_: string; variantIndex_: number }>>;
|
|
518
539
|
setShowVariantIndex_: Setter<number | undefined>;
|
|
@@ -521,6 +542,7 @@ function ColorSwatches({
|
|
|
521
542
|
wantedContainerHeightRem_: Accessor<number | undefined>;
|
|
522
543
|
defaultVariantIndex_: Accessor<number | undefined>;
|
|
523
544
|
ref_?: (el: HTMLDivElement) => void;
|
|
545
|
+
isHidden_?: Accessor<boolean>;
|
|
524
546
|
}) {
|
|
525
547
|
let unHoverDebouncedTimeout: ReturnType<typeof setTimeout> | undefined;
|
|
526
548
|
const entriesToShow = () => [...colorMap_().entries()].slice(0, 12);
|
|
@@ -569,6 +591,8 @@ function ColorSwatches({
|
|
|
569
591
|
500
|
|
570
592
|
);
|
|
571
593
|
})}
|
|
594
|
+
aria-hidden={isHidden_?.()}
|
|
595
|
+
tabIndex={isHidden_?.() ? -1 : undefined}
|
|
572
596
|
href={pageUrl_}
|
|
573
597
|
class="d-swatch"
|
|
574
598
|
ref={element =>
|