@depict-ai/portal-components 2.7.9 → 2.7.10

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
@@ -1,9 +1,10 @@
1
- import { ModernDisplayWithPageUrl } from "@depict-ai/ui/latest";
1
+ import { ModernDisplayWithPageUrl, SDKRenderingInfo } from "@depict-ai/ui/latest";
2
+ import { Accessor, JSX } from "solid-js";
2
3
  import { SearchFilter } from "@depict-ai/types/api/SearchResponse";
3
4
  import { Locale } from "@depict-ai/react-ui/locales/latest";
4
5
  import { ReactNode } from "react";
5
6
  import { FeaturedInDisplay } from "@depict-ai/types/api/FeaturedInResponseV3";
6
- export const version = "2.7.9";
7
+ export const version = "2.7.10";
7
8
  type TextOptions = {
8
9
  /** Enabled */
9
10
  enabled: boolean;
@@ -43,6 +44,40 @@ type ProductCardSchema = {
43
44
  image_carousel: boolean;
44
45
  image_aspect_ratio: number;
45
46
  };
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
+ search_result_id: string;
58
+ /** SKUs of the different variants, slated for removal */
59
+ variant_skus: string[];
60
+ /** Product of the different variants, slated for removal */
61
+ variant_product_ids: string[];
62
+ }
63
+ type YourVariantDisplay = {
64
+ title: string;
65
+ image_urls: string[];
66
+ videos?: {
67
+ preview_image_url: string;
68
+ video_urls: string[];
69
+ }[];
70
+ page_url: string;
71
+ color_name: string;
72
+ size_name: string | null;
73
+ in_stock: boolean;
74
+ } & ({
75
+ sale_price: Promise<number>;
76
+ original_price: Promise<number>;
77
+ } | {
78
+ sale_price: Promise<undefined>;
79
+ original_price: Promise<undefined>;
80
+ });
46
81
  export function ReactDefaultProductCard(react_props: {
47
82
  options: ProductCardSchema;
48
83
  display: null | ModernDisplayWithPageUrl<any>;
package/dist/main.js CHANGED
@@ -1,9 +1,9 @@
1
1
  var $7jsgb$depictaiutilisharedlatest = require("@depict-ai/utilishared/latest");
2
2
  var $7jsgb$solidjsweb = require("solid-js/web");
3
- var $7jsgb$react = require("react");
4
- var $7jsgb$solidjsstore = require("solid-js/store");
5
3
  var $7jsgb$depictaiuilatest = require("@depict-ai/ui/latest");
6
4
  var $7jsgb$solidjs = require("solid-js");
5
+ var $7jsgb$react = require("react");
6
+ var $7jsgb$solidjsstore = require("solid-js/store");
7
7
  var $7jsgb$reactdom = require("react-dom");
8
8
 
9
9
 
@@ -11,6 +11,7 @@ function $parcel$export(e, n, v, s) {
11
11
  Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
12
12
  }
13
13
 
14
+ $parcel$export(module.exports, "DefaultSolidProductCard", () => $3375ddd88f77967d$export$f11681c54c860912);
14
15
  $parcel$export(module.exports, "ReactDefaultProductCard", () => $70cc6bd7e3f1dd4b$export$d1a48be4967fe67c);
15
16
  $parcel$export(module.exports, "ReactSelectedFilters", () => $19e9e02e1e300b6d$export$aea1707d7b01c3a2);
16
17
  $parcel$export(module.exports, "ReactFilterBody", () => $240090d16a629bfe$export$d929db7fb6179159);
@@ -18,33 +19,10 @@ $parcel$export(module.exports, "ExpandingSection", () => $2214dc111b9e2866$expor
18
19
  $parcel$export(module.exports, "ReactLookCard", () => $35bab9ff48bfe404$export$48787da2a5568bc);
19
20
  $parcel$export(module.exports, "version", () => $0a017be3a74fcc94$export$83d89fbfd8236492);
20
21
  /*! Depict.ai portal components */ // This is where the actual source of your React stuff should live
21
- const $0a017be3a74fcc94$export$83d89fbfd8236492 = "2.7.9";
22
-
23
-
24
-
22
+ const $0a017be3a74fcc94$export$83d89fbfd8236492 = "2.7.10";
25
23
 
26
24
 
27
25
 
28
- function $d38f1fd3cc4cd6b2$export$f6e64e17bd69eeef({ solid_component: solid_component, props: props, wrapper_type: wrapper_type = "div", wrapper_style: wrapper_style = {}, className: className }) {
29
- const wrapper_element_ref = (0, $7jsgb$react.useRef)();
30
- const [[store, write_store]] = (0, $7jsgb$react.useState)(()=>(0, $7jsgb$solidjsstore.createStore)(props));
31
- // Update store when props change
32
- write_store((0, $7jsgb$solidjsstore.reconcile)(props));
33
- (0, $7jsgb$react.useEffect)(()=>{
34
- const wrapper_element = wrapper_element_ref.current;
35
- // If someone only rendered a solid component on the client that *could* be hydrated (no childNodes) then we fall back to `render` to avoid solid complaining about not being able to hydrate or crashing because the result of generateHydrationScript hasn't run at all
36
- // This can happen for HMR or when SSR capable components are only rendered on the client
37
- const dispose = (0, $7jsgb$solidjsweb.render)(()=>solid_component(store, wrapper_element), wrapper_element);
38
- return dispose;
39
- }, []);
40
- return (0, $7jsgb$react.createElement)(wrapper_type, {
41
- ref: wrapper_element_ref,
42
- style: wrapper_style,
43
- className: className
44
- });
45
- }
46
-
47
-
48
26
 
49
27
 
50
28
 
@@ -1030,6 +1008,30 @@ function $3375ddd88f77967d$var$InComponentOrDiv(props) {
1030
1008
 
1031
1009
 
1032
1010
 
1011
+
1012
+
1013
+ function $d38f1fd3cc4cd6b2$export$f6e64e17bd69eeef({ solid_component: solid_component, props: props, wrapper_type: wrapper_type = "div", wrapper_style: wrapper_style = {}, className: className }) {
1014
+ const wrapper_element_ref = (0, $7jsgb$react.useRef)();
1015
+ const [[store, write_store]] = (0, $7jsgb$react.useState)(()=>(0, $7jsgb$solidjsstore.createStore)(props));
1016
+ // Update store when props change
1017
+ write_store((0, $7jsgb$solidjsstore.reconcile)(props));
1018
+ (0, $7jsgb$react.useEffect)(()=>{
1019
+ const wrapper_element = wrapper_element_ref.current;
1020
+ // If someone only rendered a solid component on the client that *could* be hydrated (no childNodes) then we fall back to `render` to avoid solid complaining about not being able to hydrate or crashing because the result of generateHydrationScript hasn't run at all
1021
+ // This can happen for HMR or when SSR capable components are only rendered on the client
1022
+ const dispose = (0, $7jsgb$solidjsweb.render)(()=>solid_component(store, wrapper_element), wrapper_element);
1023
+ return dispose;
1024
+ }, []);
1025
+ return (0, $7jsgb$react.createElement)(wrapper_type, {
1026
+ ref: wrapper_element_ref,
1027
+ style: wrapper_style,
1028
+ className: className
1029
+ });
1030
+ }
1031
+
1032
+
1033
+
1034
+
1033
1035
  function $70cc6bd7e3f1dd4b$export$d1a48be4967fe67c(react_props) {
1034
1036
  return (0, $d38f1fd3cc4cd6b2$export$f6e64e17bd69eeef)({
1035
1037
  solid_component: (props_store)=>{
package/dist/module.js CHANGED
@@ -1,39 +1,16 @@
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 {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 {useRef as $2MCgq$useRef, useState as $2MCgq$useState, useEffect as $2MCgq$useEffect, createElement as $2MCgq$createElement, Fragment as $2MCgq$Fragment} from "react";
4
- import {createStore as $2MCgq$createStore, reconcile as $2MCgq$reconcile} from "solid-js/store";
1
+ import {add_to_version_info as $2MCgq$add_to_version_info, catchify as $2MCgq$catchify, dlog as $2MCgq$dlog, dwarn as $2MCgq$dwarn, standard_price_format as $2MCgq$standard_price_format} from "@depict-ai/utilishared/latest";
2
+ import {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, render as $2MCgq$render} from "solid-js/web";
5
3
  import {media_query_to_accessor as $2MCgq$media_query_to_accessor, TextPlaceholder as $2MCgq$TextPlaceholder, 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, useProductCardIsVisible as $2MCgq$useProductCardIsVisible, 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";
6
4
  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, Show as $2MCgq$Show, children as $2MCgq$children, onCleanup as $2MCgq$onCleanup, For as $2MCgq$For, createRenderEffect as $2MCgq$createRenderEffect, on as $2MCgq$on, useContext as $2MCgq$useContext} from "solid-js";
5
+ import {useRef as $2MCgq$useRef, useState as $2MCgq$useState, useEffect as $2MCgq$useEffect, createElement as $2MCgq$createElement, Fragment as $2MCgq$Fragment} from "react";
6
+ import {createStore as $2MCgq$createStore, reconcile as $2MCgq$reconcile} from "solid-js/store";
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.9";
11
-
12
-
13
-
10
+ const $91c11b750e80ede3$export$83d89fbfd8236492 = "2.7.10";
14
11
 
15
12
 
16
13
 
17
- function $0fe03f2fcd2418f8$export$f6e64e17bd69eeef({ solid_component: solid_component, props: props, wrapper_type: wrapper_type = "div", wrapper_style: wrapper_style = {}, className: className }) {
18
- const wrapper_element_ref = (0, $2MCgq$useRef)();
19
- const [[store, write_store]] = (0, $2MCgq$useState)(()=>(0, $2MCgq$createStore)(props));
20
- // Update store when props change
21
- write_store((0, $2MCgq$reconcile)(props));
22
- (0, $2MCgq$useEffect)(()=>{
23
- const wrapper_element = wrapper_element_ref.current;
24
- // If someone only rendered a solid component on the client that *could* be hydrated (no childNodes) then we fall back to `render` to avoid solid complaining about not being able to hydrate or crashing because the result of generateHydrationScript hasn't run at all
25
- // This can happen for HMR or when SSR capable components are only rendered on the client
26
- const dispose = (0, $2MCgq$render)(()=>solid_component(store, wrapper_element), wrapper_element);
27
- return dispose;
28
- }, []);
29
- return (0, $2MCgq$createElement)(wrapper_type, {
30
- ref: wrapper_element_ref,
31
- style: wrapper_style,
32
- className: className
33
- });
34
- }
35
-
36
-
37
14
 
38
15
 
39
16
 
@@ -1019,6 +996,30 @@ function $29535f590238371c$var$InComponentOrDiv(props) {
1019
996
 
1020
997
 
1021
998
 
999
+
1000
+
1001
+ function $0fe03f2fcd2418f8$export$f6e64e17bd69eeef({ solid_component: solid_component, props: props, wrapper_type: wrapper_type = "div", wrapper_style: wrapper_style = {}, className: className }) {
1002
+ const wrapper_element_ref = (0, $2MCgq$useRef)();
1003
+ const [[store, write_store]] = (0, $2MCgq$useState)(()=>(0, $2MCgq$createStore)(props));
1004
+ // Update store when props change
1005
+ write_store((0, $2MCgq$reconcile)(props));
1006
+ (0, $2MCgq$useEffect)(()=>{
1007
+ const wrapper_element = wrapper_element_ref.current;
1008
+ // If someone only rendered a solid component on the client that *could* be hydrated (no childNodes) then we fall back to `render` to avoid solid complaining about not being able to hydrate or crashing because the result of generateHydrationScript hasn't run at all
1009
+ // This can happen for HMR or when SSR capable components are only rendered on the client
1010
+ const dispose = (0, $2MCgq$render)(()=>solid_component(store, wrapper_element), wrapper_element);
1011
+ return dispose;
1012
+ }, []);
1013
+ return (0, $2MCgq$createElement)(wrapper_type, {
1014
+ ref: wrapper_element_ref,
1015
+ style: wrapper_style,
1016
+ className: className
1017
+ });
1018
+ }
1019
+
1020
+
1021
+
1022
+
1022
1023
  function $474e9d712b745d60$export$d1a48be4967fe67c(react_props) {
1023
1024
  return (0, $0fe03f2fcd2418f8$export$f6e64e17bd69eeef)({
1024
1025
  solid_component: (props_store)=>{
@@ -1222,4 +1223,4 @@ function $8a700ff0722c56b3$export$48787da2a5568bc(react_props) {
1222
1223
  (0, $2MCgq$add_to_version_info)("react-ui", (0, $91c11b750e80ede3$export$83d89fbfd8236492));
1223
1224
 
1224
1225
 
1225
- 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};
1226
+ export {$29535f590238371c$export$f11681c54c860912 as DefaultSolidProductCard, $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.9",
3
+ "version": "2.7.10",
4
4
  "packageManager": "yarn@3.2.2",
5
5
  "source": "src/index.ts",
6
6
  "main": "dist/main.js",