@depict-ai/portal-components 2.7.18 → 2.7.19
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 +37 -1
- package/dist/main.js +87 -1
- package/dist/module.js +86 -2
- package/package.json +2 -2
package/dist/index.d.ts
CHANGED
|
@@ -1,9 +1,11 @@
|
|
|
1
|
+
import { ModernDisplay } from "@depict-ai/utilishared";
|
|
2
|
+
import { BaseProductListingConfig } from "@depict-ai/ui";
|
|
1
3
|
import { ModernDisplayWithPageUrl } from "@depict-ai/ui/latest";
|
|
2
4
|
import { SearchFilter } from "@depict-ai/types/api/SearchResponse";
|
|
3
5
|
import { Locale } from "@depict-ai/react-ui/locales/latest";
|
|
4
6
|
import { ReactNode } from "react";
|
|
5
7
|
import { FeaturedInDisplay } from "@depict-ai/types/api/FeaturedInResponseV3";
|
|
6
|
-
export const version = "2.7.
|
|
8
|
+
export const version = "2.7.19";
|
|
7
9
|
type TextOptions = {
|
|
8
10
|
/** Enabled */
|
|
9
11
|
enabled: boolean;
|
|
@@ -43,6 +45,40 @@ type ProductCardSchema = {
|
|
|
43
45
|
image_carousel: boolean;
|
|
44
46
|
image_aspect_ratio: number;
|
|
45
47
|
};
|
|
48
|
+
interface PortalRecsConfig<T extends ModernDisplay> extends BaseProductListingConfig {
|
|
49
|
+
/**
|
|
50
|
+
* A promise containing the recommendations to render, see https://docs.depict.ai/api-guide/recommendations/api-client/fetching
|
|
51
|
+
*/
|
|
52
|
+
recommendations: Promise<T[]>;
|
|
53
|
+
/**
|
|
54
|
+
* Title to show when recommendations are being shown
|
|
55
|
+
*/
|
|
56
|
+
title?: string;
|
|
57
|
+
/**
|
|
58
|
+
* Config to use for the product card
|
|
59
|
+
*/
|
|
60
|
+
productCardConfig: ProductCardSchema;
|
|
61
|
+
}
|
|
62
|
+
interface PortalRecommendationGridConfig<T extends ModernDisplay> extends PortalRecsConfig<T> {
|
|
63
|
+
maxRows?: number;
|
|
64
|
+
viewMoreButton?: {
|
|
65
|
+
text: string;
|
|
66
|
+
startRows?: number;
|
|
67
|
+
rowsPerClick?: number;
|
|
68
|
+
};
|
|
69
|
+
}
|
|
70
|
+
/**
|
|
71
|
+
* Copy-pasted RecommendationGrid from react-ui that's hardcoded to render the default product card
|
|
72
|
+
* By not wrapping the default product card in a react component again we get working placeholder (react's rendering delay otherwise makes them not show sometimes) and working <ListingContext> and therefore videos, correctly dosed sizes. etc
|
|
73
|
+
*/
|
|
74
|
+
export function PortalRecsGrid<T extends ModernDisplay>(props: Parameters<typeof SolidWrapper<T>>[0]): import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>>;
|
|
75
|
+
declare function SolidWrapper<T extends ModernDisplay>(props: PortalRecommendationGridConfig<T>): HTMLDivElement;
|
|
76
|
+
/**
|
|
77
|
+
* Copy-pasted RecommendationGrid from react-ui that's hardcoded to render the default product card
|
|
78
|
+
* By not wrapping the default product card in a react component again we get working placeholder (react's rendering delay otherwise makes them not show sometimes) and working <ListingContext> and therefore videos, correctly dosed sizes. etc
|
|
79
|
+
*/
|
|
80
|
+
export function PortalRecsSlider<T extends ModernDisplay>(props: Parameters<typeof _SolidWrapper1<T>>[0]): import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>>;
|
|
81
|
+
declare function _SolidWrapper1<T extends ModernDisplay>(props: PortalRecsConfig<T>): HTMLDivElement;
|
|
46
82
|
export function ReactDefaultProductCard(react_props: {
|
|
47
83
|
options?: ProductCardSchema;
|
|
48
84
|
display: null | ModernDisplayWithPageUrl<any>;
|
package/dist/main.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
var $7jsgb$depictaiutilisharedlatest = require("@depict-ai/utilishared/latest");
|
|
2
|
+
var $7jsgb$depictaiui = require("@depict-ai/ui");
|
|
2
3
|
var $7jsgb$solidjsweb = require("solid-js/web");
|
|
3
4
|
var $7jsgb$react = require("react");
|
|
4
5
|
var $7jsgb$solidjsstore = require("solid-js/store");
|
|
@@ -11,6 +12,8 @@ function $parcel$export(e, n, v, s) {
|
|
|
11
12
|
Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
|
|
12
13
|
}
|
|
13
14
|
|
|
15
|
+
$parcel$export(module.exports, "PortalRecsGrid", () => $9b4cfecb283dbb57$export$d20a7e68f6a71456);
|
|
16
|
+
$parcel$export(module.exports, "PortalRecsSlider", () => $1113a95ded76fc38$export$a640309a759938e9);
|
|
14
17
|
$parcel$export(module.exports, "ReactDefaultProductCard", () => $70cc6bd7e3f1dd4b$export$d1a48be4967fe67c);
|
|
15
18
|
$parcel$export(module.exports, "ReactSelectedFilters", () => $19e9e02e1e300b6d$export$aea1707d7b01c3a2);
|
|
16
19
|
$parcel$export(module.exports, "ReactFilterBody", () => $240090d16a629bfe$export$d929db7fb6179159);
|
|
@@ -18,7 +21,8 @@ $parcel$export(module.exports, "ExpandingSection", () => $2214dc111b9e2866$expor
|
|
|
18
21
|
$parcel$export(module.exports, "ReactLookCard", () => $35bab9ff48bfe404$export$48787da2a5568bc);
|
|
19
22
|
$parcel$export(module.exports, "version", () => $0a017be3a74fcc94$export$83d89fbfd8236492);
|
|
20
23
|
/*! Depict.ai portal components */ // This is where the actual source of your React stuff should live
|
|
21
|
-
const $0a017be3a74fcc94$export$83d89fbfd8236492 = "2.7.
|
|
24
|
+
const $0a017be3a74fcc94$export$83d89fbfd8236492 = "2.7.19";
|
|
25
|
+
|
|
22
26
|
|
|
23
27
|
|
|
24
28
|
|
|
@@ -1015,6 +1019,88 @@ function $3375ddd88f77967d$var$InComponentOrDiv(props) {
|
|
|
1015
1019
|
|
|
1016
1020
|
|
|
1017
1021
|
|
|
1022
|
+
function $9b4cfecb283dbb57$export$d20a7e68f6a71456(props) {
|
|
1023
|
+
return (0, $d38f1fd3cc4cd6b2$export$f6e64e17bd69eeef)({
|
|
1024
|
+
solid_component: $9b4cfecb283dbb57$export$ef681ece395f74,
|
|
1025
|
+
props: props,
|
|
1026
|
+
wrapper_type: "section"
|
|
1027
|
+
});
|
|
1028
|
+
}
|
|
1029
|
+
function $9b4cfecb283dbb57$export$ef681ece395f74(props) {
|
|
1030
|
+
return (0, $7jsgb$depictaiui.RecommendationGrid)({
|
|
1031
|
+
get recommendations () {
|
|
1032
|
+
return props.recommendations;
|
|
1033
|
+
},
|
|
1034
|
+
product_card_template: (display, info)=>{
|
|
1035
|
+
return (0, $3375ddd88f77967d$export$f11681c54c860912)(()=>display, info && {
|
|
1036
|
+
...info,
|
|
1037
|
+
depictCardsDataset: {},
|
|
1038
|
+
formatPrice: (price)=>price && (0, $7jsgb$depictaiutilisharedlatest.standard_price_format)(price)
|
|
1039
|
+
}, ()=>props.productCardConfig);
|
|
1040
|
+
},
|
|
1041
|
+
get cols_at_size () {
|
|
1042
|
+
return props.columnsAtSize || (0, $7jsgb$depictaiui.defaultColsAtSize);
|
|
1043
|
+
},
|
|
1044
|
+
get grid_spacing () {
|
|
1045
|
+
return props.gridSpacing ?? (0, $7jsgb$depictaiui.defaultGridSpacing);
|
|
1046
|
+
},
|
|
1047
|
+
get max_rows () {
|
|
1048
|
+
return props.maxRows;
|
|
1049
|
+
},
|
|
1050
|
+
get title () {
|
|
1051
|
+
return props.title;
|
|
1052
|
+
},
|
|
1053
|
+
get view_more_button () {
|
|
1054
|
+
const { viewMoreButton: viewMoreButton } = props;
|
|
1055
|
+
return viewMoreButton ? {
|
|
1056
|
+
text: viewMoreButton.text,
|
|
1057
|
+
start_rows: viewMoreButton.startRows ?? 2,
|
|
1058
|
+
rows_per_click: viewMoreButton.rowsPerClick
|
|
1059
|
+
} : undefined;
|
|
1060
|
+
}
|
|
1061
|
+
});
|
|
1062
|
+
}
|
|
1063
|
+
|
|
1064
|
+
|
|
1065
|
+
|
|
1066
|
+
|
|
1067
|
+
|
|
1068
|
+
|
|
1069
|
+
function $1113a95ded76fc38$export$a640309a759938e9(props) {
|
|
1070
|
+
return (0, $d38f1fd3cc4cd6b2$export$f6e64e17bd69eeef)({
|
|
1071
|
+
solid_component: $1113a95ded76fc38$var$SolidWrapper,
|
|
1072
|
+
props: props,
|
|
1073
|
+
wrapper_type: "section"
|
|
1074
|
+
});
|
|
1075
|
+
}
|
|
1076
|
+
function $1113a95ded76fc38$var$SolidWrapper(props) {
|
|
1077
|
+
return (0, $7jsgb$depictaiui.RecommendationSlider)({
|
|
1078
|
+
get recommendations () {
|
|
1079
|
+
return props.recommendations;
|
|
1080
|
+
},
|
|
1081
|
+
product_card_template: (display, info)=>{
|
|
1082
|
+
return (0, $3375ddd88f77967d$export$f11681c54c860912)(()=>display, info && {
|
|
1083
|
+
...info,
|
|
1084
|
+
depictCardsDataset: {},
|
|
1085
|
+
formatPrice: (price)=>price && (0, $7jsgb$depictaiutilisharedlatest.standard_price_format)(price)
|
|
1086
|
+
}, ()=>props.productCardConfig);
|
|
1087
|
+
},
|
|
1088
|
+
get cols_at_size () {
|
|
1089
|
+
return props.columnsAtSize || (0, $7jsgb$depictaiui.defaultColsAtSize);
|
|
1090
|
+
},
|
|
1091
|
+
get grid_spacing () {
|
|
1092
|
+
return props.gridSpacing ?? (0, $7jsgb$depictaiui.defaultGridSpacing);
|
|
1093
|
+
},
|
|
1094
|
+
get title () {
|
|
1095
|
+
return props.title;
|
|
1096
|
+
}
|
|
1097
|
+
});
|
|
1098
|
+
}
|
|
1099
|
+
|
|
1100
|
+
|
|
1101
|
+
|
|
1102
|
+
|
|
1103
|
+
|
|
1018
1104
|
function $70cc6bd7e3f1dd4b$export$d1a48be4967fe67c(react_props) {
|
|
1019
1105
|
return (0, $d38f1fd3cc4cd6b2$export$f6e64e17bd69eeef)({
|
|
1020
1106
|
solid_component: (props_store)=>{
|
package/dist/module.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
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
|
+
import {RecommendationGrid as $2MCgq$RecommendationGrid, defaultColsAtSize as $2MCgq$defaultColsAtSize, defaultGridSpacing as $2MCgq$defaultGridSpacing, RecommendationSlider as $2MCgq$RecommendationSlider} from "@depict-ai/ui";
|
|
2
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
4
|
import {useRef as $2MCgq$useRef, useState as $2MCgq$useState, useEffect as $2MCgq$useEffect, createElement as $2MCgq$createElement, Fragment as $2MCgq$Fragment} from "react";
|
|
4
5
|
import {createStore as $2MCgq$createStore, reconcile as $2MCgq$reconcile} from "solid-js/store";
|
|
@@ -7,7 +8,8 @@ import {createContext as $2MCgq$createContext, createMemo as $2MCgq$createMemo,
|
|
|
7
8
|
import {createPortal as $2MCgq$createPortal} from "react-dom";
|
|
8
9
|
|
|
9
10
|
/*! Depict.ai portal components */ // This is where the actual source of your React stuff should live
|
|
10
|
-
const $91c11b750e80ede3$export$83d89fbfd8236492 = "2.7.
|
|
11
|
+
const $91c11b750e80ede3$export$83d89fbfd8236492 = "2.7.19";
|
|
12
|
+
|
|
11
13
|
|
|
12
14
|
|
|
13
15
|
|
|
@@ -1004,6 +1006,88 @@ function $29535f590238371c$var$InComponentOrDiv(props) {
|
|
|
1004
1006
|
|
|
1005
1007
|
|
|
1006
1008
|
|
|
1009
|
+
function $8ade1943efc108c6$export$d20a7e68f6a71456(props) {
|
|
1010
|
+
return (0, $0fe03f2fcd2418f8$export$f6e64e17bd69eeef)({
|
|
1011
|
+
solid_component: $8ade1943efc108c6$export$ef681ece395f74,
|
|
1012
|
+
props: props,
|
|
1013
|
+
wrapper_type: "section"
|
|
1014
|
+
});
|
|
1015
|
+
}
|
|
1016
|
+
function $8ade1943efc108c6$export$ef681ece395f74(props) {
|
|
1017
|
+
return (0, $2MCgq$RecommendationGrid)({
|
|
1018
|
+
get recommendations () {
|
|
1019
|
+
return props.recommendations;
|
|
1020
|
+
},
|
|
1021
|
+
product_card_template: (display, info)=>{
|
|
1022
|
+
return (0, $29535f590238371c$export$f11681c54c860912)(()=>display, info && {
|
|
1023
|
+
...info,
|
|
1024
|
+
depictCardsDataset: {},
|
|
1025
|
+
formatPrice: (price)=>price && (0, $2MCgq$standard_price_format)(price)
|
|
1026
|
+
}, ()=>props.productCardConfig);
|
|
1027
|
+
},
|
|
1028
|
+
get cols_at_size () {
|
|
1029
|
+
return props.columnsAtSize || (0, $2MCgq$defaultColsAtSize);
|
|
1030
|
+
},
|
|
1031
|
+
get grid_spacing () {
|
|
1032
|
+
return props.gridSpacing ?? (0, $2MCgq$defaultGridSpacing);
|
|
1033
|
+
},
|
|
1034
|
+
get max_rows () {
|
|
1035
|
+
return props.maxRows;
|
|
1036
|
+
},
|
|
1037
|
+
get title () {
|
|
1038
|
+
return props.title;
|
|
1039
|
+
},
|
|
1040
|
+
get view_more_button () {
|
|
1041
|
+
const { viewMoreButton: viewMoreButton } = props;
|
|
1042
|
+
return viewMoreButton ? {
|
|
1043
|
+
text: viewMoreButton.text,
|
|
1044
|
+
start_rows: viewMoreButton.startRows ?? 2,
|
|
1045
|
+
rows_per_click: viewMoreButton.rowsPerClick
|
|
1046
|
+
} : undefined;
|
|
1047
|
+
}
|
|
1048
|
+
});
|
|
1049
|
+
}
|
|
1050
|
+
|
|
1051
|
+
|
|
1052
|
+
|
|
1053
|
+
|
|
1054
|
+
|
|
1055
|
+
|
|
1056
|
+
function $e3716493302f533c$export$a640309a759938e9(props) {
|
|
1057
|
+
return (0, $0fe03f2fcd2418f8$export$f6e64e17bd69eeef)({
|
|
1058
|
+
solid_component: $e3716493302f533c$var$SolidWrapper,
|
|
1059
|
+
props: props,
|
|
1060
|
+
wrapper_type: "section"
|
|
1061
|
+
});
|
|
1062
|
+
}
|
|
1063
|
+
function $e3716493302f533c$var$SolidWrapper(props) {
|
|
1064
|
+
return (0, $2MCgq$RecommendationSlider)({
|
|
1065
|
+
get recommendations () {
|
|
1066
|
+
return props.recommendations;
|
|
1067
|
+
},
|
|
1068
|
+
product_card_template: (display, info)=>{
|
|
1069
|
+
return (0, $29535f590238371c$export$f11681c54c860912)(()=>display, info && {
|
|
1070
|
+
...info,
|
|
1071
|
+
depictCardsDataset: {},
|
|
1072
|
+
formatPrice: (price)=>price && (0, $2MCgq$standard_price_format)(price)
|
|
1073
|
+
}, ()=>props.productCardConfig);
|
|
1074
|
+
},
|
|
1075
|
+
get cols_at_size () {
|
|
1076
|
+
return props.columnsAtSize || (0, $2MCgq$defaultColsAtSize);
|
|
1077
|
+
},
|
|
1078
|
+
get grid_spacing () {
|
|
1079
|
+
return props.gridSpacing ?? (0, $2MCgq$defaultGridSpacing);
|
|
1080
|
+
},
|
|
1081
|
+
get title () {
|
|
1082
|
+
return props.title;
|
|
1083
|
+
}
|
|
1084
|
+
});
|
|
1085
|
+
}
|
|
1086
|
+
|
|
1087
|
+
|
|
1088
|
+
|
|
1089
|
+
|
|
1090
|
+
|
|
1007
1091
|
function $474e9d712b745d60$export$d1a48be4967fe67c(react_props) {
|
|
1008
1092
|
return (0, $0fe03f2fcd2418f8$export$f6e64e17bd69eeef)({
|
|
1009
1093
|
solid_component: (props_store)=>{
|
|
@@ -1245,4 +1329,4 @@ function $8a700ff0722c56b3$export$48787da2a5568bc(react_props) {
|
|
|
1245
1329
|
(0, $2MCgq$add_to_version_info)("react-ui", (0, $91c11b750e80ede3$export$83d89fbfd8236492));
|
|
1246
1330
|
|
|
1247
1331
|
|
|
1248
|
-
export {$474e9d712b745d60$export$d1a48be4967fe67c as ReactDefaultProductCard, $0cb1638b3c084153$export$aea1707d7b01c3a2 as ReactSelectedFilters, $890b58a81f64b470$export$d929db7fb6179159 as ReactFilterBody, $c79c5cb5e9424dd7$export$4ea53cd12ff17334 as ExpandingSection, $8a700ff0722c56b3$export$48787da2a5568bc as ReactLookCard, $91c11b750e80ede3$export$83d89fbfd8236492 as version};
|
|
1332
|
+
export {$8ade1943efc108c6$export$d20a7e68f6a71456 as PortalRecsGrid, $e3716493302f533c$export$a640309a759938e9 as PortalRecsSlider, $474e9d712b745d60$export$d1a48be4967fe67c as ReactDefaultProductCard, $0cb1638b3c084153$export$aea1707d7b01c3a2 as ReactSelectedFilters, $890b58a81f64b470$export$d929db7fb6179159 as ReactFilterBody, $c79c5cb5e9424dd7$export$4ea53cd12ff17334 as ExpandingSection, $8a700ff0722c56b3$export$48787da2a5568bc as ReactLookCard, $91c11b750e80ede3$export$83d89fbfd8236492 as version};
|
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.19",
|
|
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.18",
|
|
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",
|