@depict-ai/react-ui 1.0.11 → 1.0.12

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 { Display } from "@depict-ai/utilishared";
3
3
  import React, { ReactNode, PropsWithChildren, ReactElement } from "react";
4
4
  import { DPC } from "@depict-ai/dpc";
5
5
  import { Locale } from "@depict-ai/ui/locales";
6
- export const version = "1.0.11";
6
+ export const version = "1.0.12";
7
7
  interface PLPConfig<T extends Display> extends BaseProductListingConfig {
8
8
  /**
9
9
  * The product card to use for rendering products.
package/dist/main.js CHANGED
@@ -31,7 +31,7 @@ $parcel$export(module.exports, "version", () => $db7b67857900028b$export$83d89fb
31
31
  $parcel$export(module.exports, "Navigation", () => $b742053c966024b4$export$b8a61e5c71402559);
32
32
  /*! Depict.ai search and product listing react SDK wrapper */ // This is where the actual source of your React stuff should live
33
33
  // Note, if you add an export here, also add one in src-server/main.ts
34
- const $db7b67857900028b$export$83d89fbfd8236492 = "1.0.11";
34
+ const $db7b67857900028b$export$83d89fbfd8236492 = "1.0.12";
35
35
 
36
36
 
37
37
 
package/dist/module.js CHANGED
@@ -11,7 +11,7 @@ import {DPC as $TZSbU$DPC} from "@depict-ai/dpc";
11
11
 
12
12
  /*! Depict.ai search and product listing react SDK wrapper */ // This is where the actual source of your React stuff should live
13
13
  // Note, if you add an export here, also add one in src-server/main.ts
14
- const $c9c4d066f9a5b51b$export$83d89fbfd8236492 = "1.0.11";
14
+ const $c9c4d066f9a5b51b$export$83d89fbfd8236492 = "1.0.12";
15
15
 
16
16
 
17
17
 
@@ -1,4 +1,7 @@
1
1
  import { ReactElement } from "react";
2
+ import { DPC } from "@depict-ai/dpc";
3
+ import { fetchDepictRecommendations, ExclusiveId } from "@depict-ai/ui";
4
+ import { Display } from "@depict-ai/utilishared";
2
5
  type OpenModal = () => void;
3
6
  interface UseSearchModalReturn {
4
7
  open: OpenModal;
@@ -9,7 +12,28 @@ interface UseSearchFieldReturn {
9
12
  */
10
13
  SearchField: () => ReactElement;
11
14
  }
12
- export const version = "0.0.92";
15
+ interface UsePerformanceClientReturn {
16
+ dpc: DPC;
17
+ }
18
+ type FetchRecsOptions = Omit<Parameters<typeof fetchDepictRecommendations>[0], "merchant" | "market" | "userId" | "sessionId"> & ExclusiveId;
19
+ interface UseFetchRecommendationsReturn<T extends Display> {
20
+ /**
21
+ * Fetch recommendations from the Depict API.
22
+ * @example
23
+ * General recommendations for a landing page:
24
+ * ```tsx
25
+ * fetchRecommendations({ type: "landing_page" });
26
+ * ```
27
+ * @example
28
+ * Fetch targeted recommendations for a product details page (PDP):
29
+ * ```tsx
30
+ * fetchRecommendations({ type: "related", productId: "t-shirt-white" })
31
+ * ```
32
+ * @returns {Promise<T[]>}
33
+ */
34
+ fetchRecommendations: (opts: FetchRecsOptions) => Promise<T[]>;
35
+ }
36
+ export const version = "1.0.12";
13
37
  export function DepictProvider(props: any): any;
14
38
  export function SearchPage(): any;
15
39
  export function CategoryPage(): any;
@@ -26,3 +50,5 @@ export function TextPlaceholder(): any;
26
50
  export function useSearchField(): UseSearchFieldReturn;
27
51
  export function openModal(): void;
28
52
  export function useSearchModal(): UseSearchModalReturn;
53
+ export function usePerformanceClient(): UsePerformanceClientReturn;
54
+ export function useFetchRecommendations<T extends Display>(): UseFetchRecommendationsReturn<T>;
@@ -16,10 +16,12 @@ $parcel$export(module.exports, "TextPlaceholder", () => $41e7e5d85b5e0d49$export
16
16
  $parcel$export(module.exports, "useSearchField", () => $41e7e5d85b5e0d49$export$9bb30bbe003b82e0);
17
17
  $parcel$export(module.exports, "openModal", () => $41e7e5d85b5e0d49$export$a7f6cffb6b8ba11c);
18
18
  $parcel$export(module.exports, "useSearchModal", () => $41e7e5d85b5e0d49$export$912994940e660d32);
19
+ $parcel$export(module.exports, "usePerformanceClient", () => $41e7e5d85b5e0d49$export$38b98fae14bd1f64);
20
+ $parcel$export(module.exports, "useFetchRecommendations", () => $41e7e5d85b5e0d49$export$6501da23a2770fc);
19
21
  $parcel$export(module.exports, "version", () => $db7b67857900028b$export$83d89fbfd8236492);
20
22
 
21
23
 
22
- const $db7b67857900028b$export$83d89fbfd8236492 = "0.0.92";
24
+ const $db7b67857900028b$export$83d89fbfd8236492 = "1.0.12";
23
25
 
24
26
 
25
27
  function $41e7e5d85b5e0d49$export$9fac37a9c21c2f3b(props) {
@@ -76,5 +78,25 @@ function $41e7e5d85b5e0d49$export$912994940e660d32() {
76
78
  open: ()=>{}
77
79
  };
78
80
  }
81
+ function $41e7e5d85b5e0d49$export$38b98fae14bd1f64() {
82
+ const mock = {
83
+ get: function(target, property) {
84
+ if (typeof target[property] === "undefined") return ()=>{
85
+ throw new Error("Depict Performance Client is currently not available on the server. Please wrap your call in a useEffect hook or user event handler.");
86
+ };
87
+ return target[property];
88
+ }
89
+ };
90
+ return {
91
+ dpc: new Proxy({}, mock)
92
+ };
93
+ }
94
+ function $41e7e5d85b5e0d49$export$6501da23a2770fc() {
95
+ return {
96
+ fetchRecommendations: ()=>{
97
+ throw new Error("fetchRecommendations is currently not available on the server due to personalisation/user_id related issues. Please only call it on the client.");
98
+ }
99
+ };
100
+ }
79
101
 
80
102
 
@@ -3,7 +3,7 @@ import {jsx as $1RlIW$jsx} from "react/jsx-runtime";
3
3
 
4
4
 
5
5
 
6
- const $c9c4d066f9a5b51b$export$83d89fbfd8236492 = "0.0.92";
6
+ const $c9c4d066f9a5b51b$export$83d89fbfd8236492 = "1.0.12";
7
7
 
8
8
 
9
9
  function $2b1fdeb83610500f$export$9fac37a9c21c2f3b(props) {
@@ -60,6 +60,26 @@ function $2b1fdeb83610500f$export$912994940e660d32() {
60
60
  open: ()=>{}
61
61
  };
62
62
  }
63
+ function $2b1fdeb83610500f$export$38b98fae14bd1f64() {
64
+ const mock = {
65
+ get: function(target, property) {
66
+ if (typeof target[property] === "undefined") return ()=>{
67
+ throw new Error("Depict Performance Client is currently not available on the server. Please wrap your call in a useEffect hook or user event handler.");
68
+ };
69
+ return target[property];
70
+ }
71
+ };
72
+ return {
73
+ dpc: new Proxy({}, mock)
74
+ };
75
+ }
76
+ function $2b1fdeb83610500f$export$6501da23a2770fc() {
77
+ return {
78
+ fetchRecommendations: ()=>{
79
+ throw new Error("fetchRecommendations is currently not available on the server due to personalisation/user_id related issues. Please only call it on the client.");
80
+ }
81
+ };
82
+ }
63
83
 
64
84
 
65
- export {$2b1fdeb83610500f$export$9fac37a9c21c2f3b as DepictProvider, $2b1fdeb83610500f$export$a54ec244c8863715 as SearchPage, $2b1fdeb83610500f$export$f7d2f673fc2f091d as CategoryPage, $2b1fdeb83610500f$export$5646050d516e06bc as BreadCrumbs, $2b1fdeb83610500f$export$466cdc317043f6cb as QuickLinks, $2b1fdeb83610500f$export$80e99ee6b29cadd2 as ComponentAligner, $2b1fdeb83610500f$export$3f37af283f8fb843 as ImagePlaceholder, $2b1fdeb83610500f$export$89c6019e4baa40b1 as TextPlaceholder, $2b1fdeb83610500f$export$9bb30bbe003b82e0 as useSearchField, $2b1fdeb83610500f$export$a7f6cffb6b8ba11c as openModal, $2b1fdeb83610500f$export$912994940e660d32 as useSearchModal, $c9c4d066f9a5b51b$export$83d89fbfd8236492 as version};
85
+ export {$2b1fdeb83610500f$export$9fac37a9c21c2f3b as DepictProvider, $2b1fdeb83610500f$export$a54ec244c8863715 as SearchPage, $2b1fdeb83610500f$export$f7d2f673fc2f091d as CategoryPage, $2b1fdeb83610500f$export$5646050d516e06bc as BreadCrumbs, $2b1fdeb83610500f$export$466cdc317043f6cb as QuickLinks, $2b1fdeb83610500f$export$80e99ee6b29cadd2 as ComponentAligner, $2b1fdeb83610500f$export$3f37af283f8fb843 as ImagePlaceholder, $2b1fdeb83610500f$export$89c6019e4baa40b1 as TextPlaceholder, $2b1fdeb83610500f$export$9bb30bbe003b82e0 as useSearchField, $2b1fdeb83610500f$export$a7f6cffb6b8ba11c as openModal, $2b1fdeb83610500f$export$912994940e660d32 as useSearchModal, $2b1fdeb83610500f$export$38b98fae14bd1f64 as usePerformanceClient, $2b1fdeb83610500f$export$6501da23a2770fc as useFetchRecommendations, $c9c4d066f9a5b51b$export$83d89fbfd8236492 as version};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@depict-ai/react-ui",
3
- "version": "1.0.11",
3
+ "version": "1.0.12",
4
4
  "packageManager": "yarn@3.2.2",
5
5
  "source": "src/index.ts",
6
6
  "main": "dist/main.js",
@@ -1,54 +0,0 @@
1
- import { ReactElement } from "react";
2
- import { DPC } from "@depict-ai/dpc";
3
- import { fetchDepictRecommendations, ExclusiveId } from "@depict-ai/ui";
4
- import { Display } from "@depict-ai/utilishared";
5
- type OpenModal = () => void;
6
- interface UseSearchModalReturn {
7
- open: OpenModal;
8
- }
9
- interface UseSearchFieldReturn {
10
- /**
11
- * A React component that renders the search field.
12
- */
13
- SearchField: () => ReactElement;
14
- }
15
- interface UsePerformanceClientReturn {
16
- dpc: DPC;
17
- }
18
- type FetchRecsOptions = Omit<Parameters<typeof fetchDepictRecommendations>[0], "merchant" | "market" | "userId" | "sessionId"> & ExclusiveId;
19
- interface UseFetchRecommendationsReturn<T extends Display> {
20
- /**
21
- * Fetch recommendations from the Depict API.
22
- * @example
23
- * General recommendations for a landing page:
24
- * ```tsx
25
- * fetchRecommendations({ type: "landing_page" });
26
- * ```
27
- * @example
28
- * Fetch targeted recommendations for a product details page (PDP):
29
- * ```tsx
30
- * fetchRecommendations({ type: "related", productId: "t-shirt-white" })
31
- * ```
32
- * @returns {Promise<T[]>}
33
- */
34
- fetchRecommendations: (opts: FetchRecsOptions) => Promise<T[]>;
35
- }
36
- export const version = "1.0.11";
37
- export function DepictProvider(props: any): any;
38
- export function SearchPage(): any;
39
- export function CategoryPage(): any;
40
- export function BreadCrumbs(): any;
41
- export function QuickLinks(): any;
42
- export function ComponentAligner(): import("react").DetailedReactHTMLElement<{
43
- className: string;
44
- style: {
45
- height: string;
46
- };
47
- }, HTMLElement>;
48
- export function ImagePlaceholder(): any;
49
- export function TextPlaceholder(): any;
50
- export function useSearchField(): UseSearchFieldReturn;
51
- export function openModal(): void;
52
- export function useSearchModal(): UseSearchModalReturn;
53
- export function usePerformanceClient(): UsePerformanceClientReturn;
54
- export function useFetchRecommendations<T extends Display>(): UseFetchRecommendationsReturn<T>;
@@ -1,102 +0,0 @@
1
- var $5efvh$react = require("react");
2
- var $5efvh$reactjsxruntime = require("react/jsx-runtime");
3
-
4
- function $parcel$export(e, n, v, s) {
5
- Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
6
- }
7
-
8
- $parcel$export(module.exports, "DepictProvider", () => $41e7e5d85b5e0d49$export$9fac37a9c21c2f3b);
9
- $parcel$export(module.exports, "SearchPage", () => $41e7e5d85b5e0d49$export$a54ec244c8863715);
10
- $parcel$export(module.exports, "CategoryPage", () => $41e7e5d85b5e0d49$export$f7d2f673fc2f091d);
11
- $parcel$export(module.exports, "BreadCrumbs", () => $41e7e5d85b5e0d49$export$5646050d516e06bc);
12
- $parcel$export(module.exports, "QuickLinks", () => $41e7e5d85b5e0d49$export$466cdc317043f6cb);
13
- $parcel$export(module.exports, "ComponentAligner", () => $41e7e5d85b5e0d49$export$80e99ee6b29cadd2);
14
- $parcel$export(module.exports, "ImagePlaceholder", () => $41e7e5d85b5e0d49$export$3f37af283f8fb843);
15
- $parcel$export(module.exports, "TextPlaceholder", () => $41e7e5d85b5e0d49$export$89c6019e4baa40b1);
16
- $parcel$export(module.exports, "useSearchField", () => $41e7e5d85b5e0d49$export$9bb30bbe003b82e0);
17
- $parcel$export(module.exports, "openModal", () => $41e7e5d85b5e0d49$export$a7f6cffb6b8ba11c);
18
- $parcel$export(module.exports, "useSearchModal", () => $41e7e5d85b5e0d49$export$912994940e660d32);
19
- $parcel$export(module.exports, "usePerformanceClient", () => $41e7e5d85b5e0d49$export$38b98fae14bd1f64);
20
- $parcel$export(module.exports, "useFetchRecommendations", () => $41e7e5d85b5e0d49$export$6501da23a2770fc);
21
- $parcel$export(module.exports, "version", () => $db7b67857900028b$export$83d89fbfd8236492);
22
-
23
-
24
- const $db7b67857900028b$export$83d89fbfd8236492 = "1.0.11";
25
-
26
-
27
- function $41e7e5d85b5e0d49$export$9fac37a9c21c2f3b(props) {
28
- return props.children;
29
- }
30
- function $41e7e5d85b5e0d49$export$a54ec244c8863715() {
31
- return (0, $5efvh$reactjsxruntime.jsx)("div", {
32
- children: []
33
- });
34
- }
35
- function $41e7e5d85b5e0d49$export$f7d2f673fc2f091d() {
36
- return (0, $5efvh$reactjsxruntime.jsx)("div", {
37
- children: []
38
- });
39
- }
40
- function $41e7e5d85b5e0d49$export$5646050d516e06bc() {
41
- return (0, $5efvh$reactjsxruntime.jsx)("div", {
42
- children: []
43
- });
44
- }
45
- function $41e7e5d85b5e0d49$export$466cdc317043f6cb() {
46
- return (0, $5efvh$reactjsxruntime.jsx)("div", {
47
- children: []
48
- });
49
- }
50
- function $41e7e5d85b5e0d49$export$80e99ee6b29cadd2() {
51
- return (0, $5efvh$react.createElement)("div", {
52
- className: "depict aligner",
53
- style: {
54
- height: "100%"
55
- }
56
- });
57
- }
58
- function $41e7e5d85b5e0d49$export$3f37af283f8fb843() {
59
- return (0, $5efvh$reactjsxruntime.jsx)("div", {
60
- children: []
61
- });
62
- }
63
- function $41e7e5d85b5e0d49$export$89c6019e4baa40b1() {
64
- return (0, $5efvh$reactjsxruntime.jsx)("div", {
65
- children: []
66
- });
67
- }
68
- function $41e7e5d85b5e0d49$export$9bb30bbe003b82e0() {
69
- return {
70
- SearchField: ()=>(0, $5efvh$reactjsxruntime.jsx)("div", {
71
- children: []
72
- })
73
- };
74
- }
75
- function $41e7e5d85b5e0d49$export$a7f6cffb6b8ba11c() {}
76
- function $41e7e5d85b5e0d49$export$912994940e660d32() {
77
- return {
78
- open: ()=>{}
79
- };
80
- }
81
- function $41e7e5d85b5e0d49$export$38b98fae14bd1f64() {
82
- const mock = {
83
- get: function(target, property) {
84
- if (typeof target[property] === "undefined") return ()=>{
85
- throw new Error("Depict Performance Client is currently not available on the server. Please wrap your call in a useEffect hook or user event handler.");
86
- };
87
- return target[property];
88
- }
89
- };
90
- return {
91
- dpc: new Proxy({}, mock)
92
- };
93
- }
94
- function $41e7e5d85b5e0d49$export$6501da23a2770fc() {
95
- return {
96
- fetchRecommendations: ()=>{
97
- throw new Error("fetchRecommendations is currently not available on the server due to personalisation/user_id related issues. Please only call it on the client.");
98
- }
99
- };
100
- }
101
-
102
-
@@ -1,85 +0,0 @@
1
- import {createElement as $1RlIW$createElement} from "react";
2
- import {jsx as $1RlIW$jsx} from "react/jsx-runtime";
3
-
4
-
5
-
6
- const $c9c4d066f9a5b51b$export$83d89fbfd8236492 = "1.0.11";
7
-
8
-
9
- function $2b1fdeb83610500f$export$9fac37a9c21c2f3b(props) {
10
- return props.children;
11
- }
12
- function $2b1fdeb83610500f$export$a54ec244c8863715() {
13
- return (0, $1RlIW$jsx)("div", {
14
- children: []
15
- });
16
- }
17
- function $2b1fdeb83610500f$export$f7d2f673fc2f091d() {
18
- return (0, $1RlIW$jsx)("div", {
19
- children: []
20
- });
21
- }
22
- function $2b1fdeb83610500f$export$5646050d516e06bc() {
23
- return (0, $1RlIW$jsx)("div", {
24
- children: []
25
- });
26
- }
27
- function $2b1fdeb83610500f$export$466cdc317043f6cb() {
28
- return (0, $1RlIW$jsx)("div", {
29
- children: []
30
- });
31
- }
32
- function $2b1fdeb83610500f$export$80e99ee6b29cadd2() {
33
- return (0, $1RlIW$createElement)("div", {
34
- className: "depict aligner",
35
- style: {
36
- height: "100%"
37
- }
38
- });
39
- }
40
- function $2b1fdeb83610500f$export$3f37af283f8fb843() {
41
- return (0, $1RlIW$jsx)("div", {
42
- children: []
43
- });
44
- }
45
- function $2b1fdeb83610500f$export$89c6019e4baa40b1() {
46
- return (0, $1RlIW$jsx)("div", {
47
- children: []
48
- });
49
- }
50
- function $2b1fdeb83610500f$export$9bb30bbe003b82e0() {
51
- return {
52
- SearchField: ()=>(0, $1RlIW$jsx)("div", {
53
- children: []
54
- })
55
- };
56
- }
57
- function $2b1fdeb83610500f$export$a7f6cffb6b8ba11c() {}
58
- function $2b1fdeb83610500f$export$912994940e660d32() {
59
- return {
60
- open: ()=>{}
61
- };
62
- }
63
- function $2b1fdeb83610500f$export$38b98fae14bd1f64() {
64
- const mock = {
65
- get: function(target, property) {
66
- if (typeof target[property] === "undefined") return ()=>{
67
- throw new Error("Depict Performance Client is currently not available on the server. Please wrap your call in a useEffect hook or user event handler.");
68
- };
69
- return target[property];
70
- }
71
- };
72
- return {
73
- dpc: new Proxy({}, mock)
74
- };
75
- }
76
- function $2b1fdeb83610500f$export$6501da23a2770fc() {
77
- return {
78
- fetchRecommendations: ()=>{
79
- throw new Error("fetchRecommendations is currently not available on the server due to personalisation/user_id related issues. Please only call it on the client.");
80
- }
81
- };
82
- }
83
-
84
-
85
- export {$2b1fdeb83610500f$export$9fac37a9c21c2f3b as DepictProvider, $2b1fdeb83610500f$export$a54ec244c8863715 as SearchPage, $2b1fdeb83610500f$export$f7d2f673fc2f091d as CategoryPage, $2b1fdeb83610500f$export$5646050d516e06bc as BreadCrumbs, $2b1fdeb83610500f$export$466cdc317043f6cb as QuickLinks, $2b1fdeb83610500f$export$80e99ee6b29cadd2 as ComponentAligner, $2b1fdeb83610500f$export$3f37af283f8fb843 as ImagePlaceholder, $2b1fdeb83610500f$export$89c6019e4baa40b1 as TextPlaceholder, $2b1fdeb83610500f$export$9bb30bbe003b82e0 as useSearchField, $2b1fdeb83610500f$export$a7f6cffb6b8ba11c as openModal, $2b1fdeb83610500f$export$912994940e660d32 as useSearchModal, $2b1fdeb83610500f$export$38b98fae14bd1f64 as usePerformanceClient, $2b1fdeb83610500f$export$6501da23a2770fc as useFetchRecommendations, $c9c4d066f9a5b51b$export$83d89fbfd8236492 as version};