@depict-ai/portal-components 2.7.13 → 2.7.14
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 +3 -37
- package/dist/main.js +41 -40
- package/dist/module.js +41 -40
- package/package.json +1 -1
- package/src/specialForShopify/DefaultSolidProductCard.tsx +10 -48
package/dist/index.d.ts
CHANGED
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
import { ModernDisplayWithPageUrl
|
|
2
|
-
import { Accessor, JSX } from "solid-js";
|
|
1
|
+
import { ModernDisplayWithPageUrl } from "@depict-ai/ui/latest";
|
|
3
2
|
import { SearchFilter } from "@depict-ai/types/api/SearchResponse";
|
|
4
3
|
import { Locale } from "@depict-ai/react-ui/locales/latest";
|
|
5
4
|
import { ReactNode } from "react";
|
|
6
5
|
import { FeaturedInDisplay } from "@depict-ai/types/api/FeaturedInResponseV3";
|
|
7
|
-
export const version = "2.7.
|
|
6
|
+
export const version = "2.7.14";
|
|
8
7
|
type TextOptions = {
|
|
9
8
|
/** Enabled */
|
|
10
9
|
enabled: boolean;
|
|
@@ -44,41 +43,8 @@ type ProductCardSchema = {
|
|
|
44
43
|
image_carousel: boolean;
|
|
45
44
|
image_aspect_ratio: number;
|
|
46
45
|
};
|
|
47
|
-
/**
|
|
48
|
-
* ProductCard built according to this excerpt of our SDK docs https://docs.depict.ai/js-ui-guide/setup/product-card
|
|
49
|
-
*/
|
|
50
|
-
export function DefaultSolidProductCard(display: Accessor<null | ModernDisplayWithPageUrl<YourDisplay>>, info?: SDKRenderingInfo & {
|
|
51
|
-
depictCardsDataset?: Record<string, string>;
|
|
52
|
-
formatPrice: <T extends number | undefined>(price: T) => T extends undefined ? undefined : string;
|
|
53
|
-
}, configuredOptions_?: Accessor<ProductCardSchema>): JSX.Element;
|
|
54
|
-
interface YourDisplay {
|
|
55
|
-
variant_index: number;
|
|
56
|
-
variant_displays: YourVariantDisplay[];
|
|
57
|
-
}
|
|
58
|
-
type YourVariantDisplay = {
|
|
59
|
-
title: string;
|
|
60
|
-
image_urls: string[];
|
|
61
|
-
videos?: {
|
|
62
|
-
preview_image_url: string;
|
|
63
|
-
video_urls: string[];
|
|
64
|
-
}[];
|
|
65
|
-
video?: {
|
|
66
|
-
preview_image_url: string;
|
|
67
|
-
video_urls: string[];
|
|
68
|
-
};
|
|
69
|
-
page_url: string;
|
|
70
|
-
color_name: string;
|
|
71
|
-
size_name: string | null;
|
|
72
|
-
in_stock: boolean;
|
|
73
|
-
} & ({
|
|
74
|
-
sale_price: Promise<number>;
|
|
75
|
-
original_price: Promise<number>;
|
|
76
|
-
} | {
|
|
77
|
-
sale_price: Promise<undefined>;
|
|
78
|
-
original_price: Promise<undefined>;
|
|
79
|
-
});
|
|
80
46
|
export function ReactDefaultProductCard(react_props: {
|
|
81
|
-
options
|
|
47
|
+
options?: ProductCardSchema;
|
|
82
48
|
display: null | ModernDisplayWithPageUrl<any>;
|
|
83
49
|
}): import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>>;
|
|
84
50
|
export function ReactSelectedFilters(react_props: {
|
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.14";
|
|
22
22
|
|
|
23
23
|
|
|
24
24
|
|
|
@@ -91,44 +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_
|
|
95
|
-
image_radius: "md",
|
|
96
|
-
alignment: "left",
|
|
97
|
-
sizes: true,
|
|
98
|
-
smart_labels: {
|
|
99
|
-
font_size_rem: 0.5,
|
|
100
|
-
enabled: true,
|
|
101
|
-
bold: false,
|
|
102
|
-
italic: false,
|
|
103
|
-
color: "red",
|
|
104
|
-
bg_color: "yellow"
|
|
105
|
-
},
|
|
106
|
-
title: {
|
|
107
|
-
font_size_rem: 1.6,
|
|
108
|
-
enabled: true,
|
|
109
|
-
bold: false,
|
|
110
|
-
italic: false,
|
|
111
|
-
color: "black"
|
|
112
|
-
},
|
|
113
|
-
price: {
|
|
114
|
-
font_size_rem: 1.5,
|
|
115
|
-
enabled: true,
|
|
116
|
-
bold: false,
|
|
117
|
-
italic: false,
|
|
118
|
-
color: "black"
|
|
119
|
-
},
|
|
120
|
-
original_price: {
|
|
121
|
-
font_size_rem: 0.9,
|
|
122
|
-
enabled: true,
|
|
123
|
-
bold: false,
|
|
124
|
-
italic: false,
|
|
125
|
-
color: "black"
|
|
126
|
-
},
|
|
127
|
-
use_hover_image: true,
|
|
128
|
-
image_carousel: true,
|
|
129
|
-
color_options: true,
|
|
130
|
-
image_aspect_ratio: 1
|
|
131
|
-
})) {
|
|
94
|
+
function $3375ddd88f77967d$export$f11681c54c860912(display, info, configuredOptions_) {
|
|
132
95
|
const variantDisplays = (0, $7jsgb$solidjs.createMemo)(()=>display()?.variant_displays);
|
|
133
96
|
const defaultVariantIndex = (0, $7jsgb$solidjs.createMemo)(()=>display()?.variant_index);
|
|
134
97
|
const [showVariantIndex, setShowVariantIndex] = (0, $7jsgb$solidjs.createSignal)((0, $7jsgb$solidjs.untrack)(defaultVariantIndex));
|
|
@@ -1039,7 +1002,45 @@ function $70cc6bd7e3f1dd4b$export$d1a48be4967fe67c(react_props) {
|
|
|
1039
1002
|
set_on_index_change: ()=>{},
|
|
1040
1003
|
depictCardsDataset: {},
|
|
1041
1004
|
formatPrice: (price)=>price && (0, $7jsgb$depictaiutilisharedlatest.standard_price_format)(price)
|
|
1042
|
-
}, ()=>props_store
|
|
1005
|
+
}, ()=>props_store?.options || {
|
|
1006
|
+
image_radius: "md",
|
|
1007
|
+
alignment: "left",
|
|
1008
|
+
sizes: true,
|
|
1009
|
+
smart_labels: {
|
|
1010
|
+
font_size_rem: 1,
|
|
1011
|
+
enabled: true,
|
|
1012
|
+
bold: false,
|
|
1013
|
+
italic: false,
|
|
1014
|
+
color: "#0f0f0f"
|
|
1015
|
+
},
|
|
1016
|
+
title: {
|
|
1017
|
+
font_size_rem: 1,
|
|
1018
|
+
enabled: true,
|
|
1019
|
+
bold: false,
|
|
1020
|
+
italic: false,
|
|
1021
|
+
color: "#0f0f0f"
|
|
1022
|
+
},
|
|
1023
|
+
price: {
|
|
1024
|
+
font_size_rem: 1,
|
|
1025
|
+
enabled: true,
|
|
1026
|
+
bold: false,
|
|
1027
|
+
italic: false,
|
|
1028
|
+
color: "#0f0f0f"
|
|
1029
|
+
},
|
|
1030
|
+
original_price: {
|
|
1031
|
+
font_size_rem: 1,
|
|
1032
|
+
enabled: true,
|
|
1033
|
+
bold: false,
|
|
1034
|
+
italic: false,
|
|
1035
|
+
color: "#0f0f0f"
|
|
1036
|
+
},
|
|
1037
|
+
use_hover_image: true,
|
|
1038
|
+
image_carousel: true,
|
|
1039
|
+
color_options: true,
|
|
1040
|
+
image_aspect_ratio: 1,
|
|
1041
|
+
underline_text: false,
|
|
1042
|
+
is_ejected: false
|
|
1043
|
+
});
|
|
1043
1044
|
},
|
|
1044
1045
|
// Work around in case https://github.com/solidjs/solid/issues/2139 potentially arises
|
|
1045
1046
|
props: structuredClone(react_props),
|
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.14";
|
|
11
11
|
|
|
12
12
|
|
|
13
13
|
|
|
@@ -80,44 +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_
|
|
84
|
-
image_radius: "md",
|
|
85
|
-
alignment: "left",
|
|
86
|
-
sizes: true,
|
|
87
|
-
smart_labels: {
|
|
88
|
-
font_size_rem: 0.5,
|
|
89
|
-
enabled: true,
|
|
90
|
-
bold: false,
|
|
91
|
-
italic: false,
|
|
92
|
-
color: "red",
|
|
93
|
-
bg_color: "yellow"
|
|
94
|
-
},
|
|
95
|
-
title: {
|
|
96
|
-
font_size_rem: 1.6,
|
|
97
|
-
enabled: true,
|
|
98
|
-
bold: false,
|
|
99
|
-
italic: false,
|
|
100
|
-
color: "black"
|
|
101
|
-
},
|
|
102
|
-
price: {
|
|
103
|
-
font_size_rem: 1.5,
|
|
104
|
-
enabled: true,
|
|
105
|
-
bold: false,
|
|
106
|
-
italic: false,
|
|
107
|
-
color: "black"
|
|
108
|
-
},
|
|
109
|
-
original_price: {
|
|
110
|
-
font_size_rem: 0.9,
|
|
111
|
-
enabled: true,
|
|
112
|
-
bold: false,
|
|
113
|
-
italic: false,
|
|
114
|
-
color: "black"
|
|
115
|
-
},
|
|
116
|
-
use_hover_image: true,
|
|
117
|
-
image_carousel: true,
|
|
118
|
-
color_options: true,
|
|
119
|
-
image_aspect_ratio: 1
|
|
120
|
-
})) {
|
|
83
|
+
function $29535f590238371c$export$f11681c54c860912(display, info, configuredOptions_) {
|
|
121
84
|
const variantDisplays = (0, $2MCgq$createMemo)(()=>display()?.variant_displays);
|
|
122
85
|
const defaultVariantIndex = (0, $2MCgq$createMemo)(()=>display()?.variant_index);
|
|
123
86
|
const [showVariantIndex, setShowVariantIndex] = (0, $2MCgq$createSignal)((0, $2MCgq$untrack)(defaultVariantIndex));
|
|
@@ -1028,7 +991,45 @@ function $474e9d712b745d60$export$d1a48be4967fe67c(react_props) {
|
|
|
1028
991
|
set_on_index_change: ()=>{},
|
|
1029
992
|
depictCardsDataset: {},
|
|
1030
993
|
formatPrice: (price)=>price && (0, $2MCgq$standard_price_format)(price)
|
|
1031
|
-
}, ()=>props_store
|
|
994
|
+
}, ()=>props_store?.options || {
|
|
995
|
+
image_radius: "md",
|
|
996
|
+
alignment: "left",
|
|
997
|
+
sizes: true,
|
|
998
|
+
smart_labels: {
|
|
999
|
+
font_size_rem: 1,
|
|
1000
|
+
enabled: true,
|
|
1001
|
+
bold: false,
|
|
1002
|
+
italic: false,
|
|
1003
|
+
color: "#0f0f0f"
|
|
1004
|
+
},
|
|
1005
|
+
title: {
|
|
1006
|
+
font_size_rem: 1,
|
|
1007
|
+
enabled: true,
|
|
1008
|
+
bold: false,
|
|
1009
|
+
italic: false,
|
|
1010
|
+
color: "#0f0f0f"
|
|
1011
|
+
},
|
|
1012
|
+
price: {
|
|
1013
|
+
font_size_rem: 1,
|
|
1014
|
+
enabled: true,
|
|
1015
|
+
bold: false,
|
|
1016
|
+
italic: false,
|
|
1017
|
+
color: "#0f0f0f"
|
|
1018
|
+
},
|
|
1019
|
+
original_price: {
|
|
1020
|
+
font_size_rem: 1,
|
|
1021
|
+
enabled: true,
|
|
1022
|
+
bold: false,
|
|
1023
|
+
italic: false,
|
|
1024
|
+
color: "#0f0f0f"
|
|
1025
|
+
},
|
|
1026
|
+
use_hover_image: true,
|
|
1027
|
+
image_carousel: true,
|
|
1028
|
+
color_options: true,
|
|
1029
|
+
image_aspect_ratio: 1,
|
|
1030
|
+
underline_text: false,
|
|
1031
|
+
is_ejected: false
|
|
1032
|
+
});
|
|
1032
1033
|
},
|
|
1033
1034
|
// Work around in case https://github.com/solidjs/solid/issues/2139 potentially arises
|
|
1034
1035
|
props: structuredClone(react_props),
|
package/package.json
CHANGED
|
@@ -119,56 +119,18 @@ const sizeOrder = [
|
|
|
119
119
|
const ContainsColorSwatchesContext = /*@__PURE__*/ createContext<Signal<boolean>>();
|
|
120
120
|
let colorCanvasContext: CanvasRenderingContext2D | undefined | null;
|
|
121
121
|
|
|
122
|
-
/**
|
|
123
|
-
* ProductCard built according to this excerpt of our SDK docs https://docs.depict.ai/js-ui-guide/setup/product-card
|
|
124
|
-
*/
|
|
125
122
|
export function DefaultSolidProductCard(
|
|
126
123
|
display: Accessor<null | ModernDisplayWithPageUrl<YourDisplay>>,
|
|
127
|
-
info
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
sizes: true,
|
|
138
|
-
smart_labels: {
|
|
139
|
-
font_size_rem: 0.5,
|
|
140
|
-
enabled: true,
|
|
141
|
-
bold: false,
|
|
142
|
-
italic: false,
|
|
143
|
-
color: "red",
|
|
144
|
-
bg_color: "yellow",
|
|
145
|
-
},
|
|
146
|
-
title: {
|
|
147
|
-
font_size_rem: 1.6,
|
|
148
|
-
enabled: true,
|
|
149
|
-
bold: false,
|
|
150
|
-
italic: false,
|
|
151
|
-
color: "black",
|
|
152
|
-
},
|
|
153
|
-
price: {
|
|
154
|
-
font_size_rem: 1.5,
|
|
155
|
-
enabled: true,
|
|
156
|
-
bold: false,
|
|
157
|
-
italic: false,
|
|
158
|
-
color: "black",
|
|
159
|
-
},
|
|
160
|
-
original_price: {
|
|
161
|
-
font_size_rem: 0.9,
|
|
162
|
-
enabled: true,
|
|
163
|
-
bold: false,
|
|
164
|
-
italic: false,
|
|
165
|
-
color: "black",
|
|
166
|
-
},
|
|
167
|
-
use_hover_image: true,
|
|
168
|
-
image_carousel: true,
|
|
169
|
-
color_options: true,
|
|
170
|
-
image_aspect_ratio: 1,
|
|
171
|
-
})
|
|
124
|
+
info:
|
|
125
|
+
| undefined
|
|
126
|
+
| (SDKRenderingInfo & {
|
|
127
|
+
// depictCardsDataset is the dataset of the #depict-cards HTML element. It is empty in the development environment.
|
|
128
|
+
depictCardsDataset?: Record<string, string>;
|
|
129
|
+
// formatPrice takes a price as number (`price` is NOT in cents but the actual price, as returned from Depict) and returns a formatted string. It will use the same currency formatting that the shopify store is configured to use.
|
|
130
|
+
// In development (product card editor), a fallback formatting will be used.
|
|
131
|
+
formatPrice: <T extends number | undefined>(price: T) => T extends undefined ? undefined : string;
|
|
132
|
+
}),
|
|
133
|
+
configuredOptions_: Accessor<ProductCardSchema>
|
|
172
134
|
) {
|
|
173
135
|
const variantDisplays = createMemo(() => display()?.variant_displays);
|
|
174
136
|
const defaultVariantIndex = createMemo(() => display()?.variant_index);
|