@depict-ai/portal-components 2.7.34 → 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 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.34";
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.34";
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_, // forceIsVisible_ used in Depict portal where we don't have a provider with an IntersectionObserver
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));
@@ -206,8 +205,17 @@ overrideAspectRatio) {
206
205
  const element = (0, $7jsgb$solidjsweb.createComponent)($3375ddd88f77967d$var$ContainsColorSwatchesProvider, {
207
206
  get children () {
208
207
  var _el$3 = $3375ddd88f77967d$var$_tmpl$3();
209
- (0, $7jsgb$solidjsweb.addEventListener)(_el$3, "mouseleave", (0, $7jsgb$depictaiutilisharedlatest.catchify)(()=>!noHoverSupport_() && setCardIsHovered(false)));
210
- (0, $7jsgb$solidjsweb.addEventListener)(_el$3, "mouseenter", (0, $7jsgb$depictaiutilisharedlatest.catchify)(()=>!noHoverSupport_() && setCardIsHovered(true)));
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);
211
219
  (0, $7jsgb$solidjsweb.insert)(_el$3, (0, $7jsgb$solidjsweb.createComponent)(LinkWrapped, {
212
220
  "class": "upper",
213
221
  focusable_: true,
@@ -373,7 +381,6 @@ overrideAspectRatio) {
373
381
  }
374
382
  });
375
383
  }, null);
376
- (0, $7jsgb$solidjsweb.effect)((_$p)=>(0, $7jsgb$solidjsweb.style)(_el$3, mainStyle(), _$p));
377
384
  return _el$3;
378
385
  }
379
386
  });
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, memo as $2MCgq$memo, style as $2MCgq$style, classList as $2MCgq$classList, spread as $2MCgq$spread, mergeProps as $2MCgq$mergeProps, delegateEvents as $2MCgq$delegateEvents} from "solid-js/web";
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.34";
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_, // forceIsVisible_ used in Depict portal where we don't have a provider with an IntersectionObserver
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));
@@ -193,8 +192,17 @@ overrideAspectRatio) {
193
192
  const element = (0, $2MCgq$createComponent)($29535f590238371c$var$ContainsColorSwatchesProvider, {
194
193
  get children () {
195
194
  var _el$3 = $29535f590238371c$var$_tmpl$3();
196
- (0, $2MCgq$addEventListener)(_el$3, "mouseleave", (0, $2MCgq$catchify)(()=>!noHoverSupport_() && setCardIsHovered(false)));
197
- (0, $2MCgq$addEventListener)(_el$3, "mouseenter", (0, $2MCgq$catchify)(()=>!noHoverSupport_() && setCardIsHovered(true)));
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);
198
206
  (0, $2MCgq$insert)(_el$3, (0, $2MCgq$createComponent)(LinkWrapped, {
199
207
  "class": "upper",
200
208
  focusable_: true,
@@ -360,7 +368,6 @@ overrideAspectRatio) {
360
368
  }
361
369
  });
362
370
  }, null);
363
- (0, $2MCgq$effect)((_$p)=>(0, $2MCgq$style)(_el$3, mainStyle(), _$p));
364
371
  return _el$3;
365
372
  }
366
373
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@depict-ai/portal-components",
3
- "version": "2.7.34",
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.20",
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.29",
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<ProductCardSchema & { forceIsVisible_?: boolean }>, // forceIsVisible_ used in Depict portal where we don't have a provider with an IntersectionObserver
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);
@@ -263,6 +274,7 @@ export function DefaultSolidProductCard(
263
274
  style={mainStyle()}
264
275
  onMouseEnter={catchify(() => !noHoverSupport_() && setCardIsHovered(true))}
265
276
  onMouseLeave={catchify(() => !noHoverSupport_() && setCardIsHovered(false))}
277
+ {...configuredOptions_().overrideMainAttributes_}
266
278
  >
267
279
  <LinkWrapped class="upper" focusable_={true}>
268
280
  <ImagesAndVideos