@depict-ai/portal-components 2.7.16 → 2.7.17
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
|
@@ -3,7 +3,7 @@ import { SearchFilter } from "@depict-ai/types/api/SearchResponse";
|
|
|
3
3
|
import { Locale } from "@depict-ai/react-ui/locales/latest";
|
|
4
4
|
import { ReactNode } from "react";
|
|
5
5
|
import { FeaturedInDisplay } from "@depict-ai/types/api/FeaturedInResponseV3";
|
|
6
|
-
export const version = "2.7.
|
|
6
|
+
export const version = "2.7.17";
|
|
7
7
|
type TextOptions = {
|
|
8
8
|
/** Enabled */
|
|
9
9
|
enabled: boolean;
|
package/dist/main.js
CHANGED
|
@@ -18,7 +18,7 @@ $parcel$export(module.exports, "ExpandingSection", () => $2214dc111b9e2866$expor
|
|
|
18
18
|
$parcel$export(module.exports, "ReactLookCard", () => $35bab9ff48bfe404$export$48787da2a5568bc);
|
|
19
19
|
$parcel$export(module.exports, "version", () => $0a017be3a74fcc94$export$83d89fbfd8236492);
|
|
20
20
|
/*! Depict.ai portal components */ // This is where the actual source of your React stuff should live
|
|
21
|
-
const $0a017be3a74fcc94$export$83d89fbfd8236492 = "2.7.
|
|
21
|
+
const $0a017be3a74fcc94$export$83d89fbfd8236492 = "2.7.17";
|
|
22
22
|
|
|
23
23
|
|
|
24
24
|
|
|
@@ -91,7 +91,7 @@ const $3375ddd88f77967d$var$sizeOrder = [
|
|
|
91
91
|
];
|
|
92
92
|
const $3375ddd88f77967d$var$ContainsColorSwatchesContext = /*@__PURE__*/ (0, $7jsgb$solidjs.createContext)();
|
|
93
93
|
let $3375ddd88f77967d$var$colorCanvasContext;
|
|
94
|
-
function $3375ddd88f77967d$export$f11681c54c860912(display, info, configuredOptions_) {
|
|
94
|
+
function $3375ddd88f77967d$export$f11681c54c860912(display, info, configuredOptions_, overrideAspectRatio) {
|
|
95
95
|
const variantDisplays = (0, $7jsgb$solidjs.createMemo)(()=>display()?.variant_displays);
|
|
96
96
|
const defaultVariantIndex = (0, $7jsgb$solidjs.createMemo)(()=>display()?.variant_index);
|
|
97
97
|
const [showVariantIndex, setShowVariantIndex] = (0, $7jsgb$solidjs.createSignal)((0, $7jsgb$solidjs.untrack)(defaultVariantIndex));
|
|
@@ -105,7 +105,7 @@ function $3375ddd88f77967d$export$f11681c54c860912(display, info, configuredOpti
|
|
|
105
105
|
return originalPrice() !== salePrice();
|
|
106
106
|
}
|
|
107
107
|
}));
|
|
108
|
-
const aspectRatio_ = (0, $7jsgb$solidjs.createMemo)(()=>configuredOptions_().image_aspect_ratio);
|
|
108
|
+
const aspectRatio_ = (0, $7jsgb$solidjs.createMemo)(()=>overrideAspectRatio?.() || configuredOptions_().image_aspect_ratio);
|
|
109
109
|
const hasSizes = ()=>configuredOptions_().sizes && sizesInStock_().size > 1;
|
|
110
110
|
const sizesInStock_ = (0, $7jsgb$solidjs.createMemo)(()=>new Map(variantDisplays()?.map((d)=>[
|
|
111
111
|
d.size_name,
|
package/dist/module.js
CHANGED
|
@@ -7,7 +7,7 @@ import {createContext as $2MCgq$createContext, createMemo as $2MCgq$createMemo,
|
|
|
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.17";
|
|
11
11
|
|
|
12
12
|
|
|
13
13
|
|
|
@@ -80,7 +80,7 @@ const $29535f590238371c$var$sizeOrder = [
|
|
|
80
80
|
];
|
|
81
81
|
const $29535f590238371c$var$ContainsColorSwatchesContext = /*@__PURE__*/ (0, $2MCgq$createContext)();
|
|
82
82
|
let $29535f590238371c$var$colorCanvasContext;
|
|
83
|
-
function $29535f590238371c$export$f11681c54c860912(display, info, configuredOptions_) {
|
|
83
|
+
function $29535f590238371c$export$f11681c54c860912(display, info, configuredOptions_, overrideAspectRatio) {
|
|
84
84
|
const variantDisplays = (0, $2MCgq$createMemo)(()=>display()?.variant_displays);
|
|
85
85
|
const defaultVariantIndex = (0, $2MCgq$createMemo)(()=>display()?.variant_index);
|
|
86
86
|
const [showVariantIndex, setShowVariantIndex] = (0, $2MCgq$createSignal)((0, $2MCgq$untrack)(defaultVariantIndex));
|
|
@@ -94,7 +94,7 @@ function $29535f590238371c$export$f11681c54c860912(display, info, configuredOpti
|
|
|
94
94
|
return originalPrice() !== salePrice();
|
|
95
95
|
}
|
|
96
96
|
}));
|
|
97
|
-
const aspectRatio_ = (0, $2MCgq$createMemo)(()=>configuredOptions_().image_aspect_ratio);
|
|
97
|
+
const aspectRatio_ = (0, $2MCgq$createMemo)(()=>overrideAspectRatio?.() || configuredOptions_().image_aspect_ratio);
|
|
98
98
|
const hasSizes = ()=>configuredOptions_().sizes && sizesInStock_().size > 1;
|
|
99
99
|
const sizesInStock_ = (0, $2MCgq$createMemo)(()=>new Map(variantDisplays()?.map((d)=>[
|
|
100
100
|
d.size_name,
|
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.17",
|
|
4
4
|
"packageManager": "yarn@3.2.2",
|
|
5
5
|
"source": "src/index.ts",
|
|
6
6
|
"main": "dist/main.js",
|
|
@@ -101,7 +101,7 @@
|
|
|
101
101
|
"dependencies": {
|
|
102
102
|
"@babel/runtime": "latest",
|
|
103
103
|
"@babel/runtime-corejs3": "^7.22.6",
|
|
104
|
-
"@depict-ai/plp-styling": "^4.4.
|
|
104
|
+
"@depict-ai/plp-styling": "^4.4.17",
|
|
105
105
|
"@depict-ai/react-ui": "^4.8.6",
|
|
106
106
|
"@depict-ai/types": "^5.4.4",
|
|
107
107
|
"@depict-ai/ui": "^4.8.16",
|
|
@@ -130,7 +130,8 @@ export function DefaultSolidProductCard(
|
|
|
130
130
|
// In development (product card editor), a fallback formatting will be used.
|
|
131
131
|
formatPrice: <T extends number | undefined>(price: T) => T extends undefined ? undefined : string;
|
|
132
132
|
}),
|
|
133
|
-
configuredOptions_: Accessor<ProductCardSchema
|
|
133
|
+
configuredOptions_: Accessor<ProductCardSchema>,
|
|
134
|
+
overrideAspectRatio?: Accessor<number>
|
|
134
135
|
) {
|
|
135
136
|
const variantDisplays = createMemo(() => display()?.variant_displays);
|
|
136
137
|
const defaultVariantIndex = createMemo(() => display()?.variant_index);
|
|
@@ -141,7 +142,7 @@ export function DefaultSolidProductCard(
|
|
|
141
142
|
const [salePrice] = createResource(variantToShow, v => v?.sale_price);
|
|
142
143
|
const [originalPrice] = createResource(variantToShow, v => v?.original_price);
|
|
143
144
|
const onSale = createMemo(() => <Suspense>{originalPrice() !== salePrice()}</Suspense>);
|
|
144
|
-
const aspectRatio_ = createMemo(() => configuredOptions_().image_aspect_ratio);
|
|
145
|
+
const aspectRatio_ = createMemo(() => overrideAspectRatio?.() || configuredOptions_().image_aspect_ratio);
|
|
145
146
|
const hasSizes = () => configuredOptions_().sizes && sizesInStock_().size > 1;
|
|
146
147
|
const sizesInStock_ = createMemo(
|
|
147
148
|
() =>
|