@alphabite/medusa-wishlist 0.7.2 → 0.7.3
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.
|
@@ -83,10 +83,7 @@ const WishlistAnalyticsTab = () => {
|
|
|
83
83
|
}
|
|
84
84
|
});
|
|
85
85
|
const maxTrend = react.useMemo(
|
|
86
|
-
() => Math.max(
|
|
87
|
-
1,
|
|
88
|
-
...(data == null ? void 0 : data.trend.map((t) => Math.max(t.wishlists, t.items))) ?? [1]
|
|
89
|
-
),
|
|
86
|
+
() => Math.max(1, ...(data == null ? void 0 : data.trend.map((t) => t.items)) ?? [1]),
|
|
90
87
|
[data]
|
|
91
88
|
);
|
|
92
89
|
if (isError) {
|
|
@@ -156,41 +153,26 @@ const WishlistAnalyticsTab = () => {
|
|
|
156
153
|
)
|
|
157
154
|
] }),
|
|
158
155
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col gap-2 rounded-lg border p-4", children: [
|
|
159
|
-
/* @__PURE__ */ jsxRuntime.jsx(ui.Text, { size: "small", weight: "plus", children: "
|
|
156
|
+
/* @__PURE__ */ jsxRuntime.jsx(ui.Text, { size: "small", weight: "plus", children: "Items added over time" }),
|
|
160
157
|
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex h-40 items-end gap-1 overflow-x-auto", children: data.trend.map((t) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
161
158
|
"div",
|
|
162
159
|
{
|
|
163
160
|
className: "flex min-w-[10px] flex-1 flex-col items-center justify-end gap-0.5",
|
|
164
|
-
title: `${t.date}: ${t.
|
|
165
|
-
children: /* @__PURE__ */ jsxRuntime.
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
minHeight: t.wishlists > 0 ? "2px" : void 0
|
|
173
|
-
}
|
|
174
|
-
}
|
|
175
|
-
),
|
|
176
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
177
|
-
"div",
|
|
178
|
-
{
|
|
179
|
-
className: "w-1/2 rounded-t bg-ui-fg-muted",
|
|
180
|
-
style: {
|
|
181
|
-
height: `${t.items / maxTrend * 100}%`,
|
|
182
|
-
minHeight: t.items > 0 ? "2px" : void 0
|
|
183
|
-
}
|
|
161
|
+
title: `${t.date}: ${t.items} items`,
|
|
162
|
+
children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex h-32 w-full items-end justify-center", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
163
|
+
"div",
|
|
164
|
+
{
|
|
165
|
+
className: "w-full rounded-t bg-ui-fg-interactive",
|
|
166
|
+
style: {
|
|
167
|
+
height: `${t.items / maxTrend * 100}%`,
|
|
168
|
+
minHeight: t.items > 0 ? "2px" : void 0
|
|
184
169
|
}
|
|
185
|
-
|
|
186
|
-
|
|
170
|
+
}
|
|
171
|
+
) })
|
|
187
172
|
},
|
|
188
173
|
t.date
|
|
189
174
|
)) }),
|
|
190
|
-
/* @__PURE__ */ jsxRuntime.
|
|
191
|
-
/* @__PURE__ */ jsxRuntime.jsx(ui.Text, { size: "xsmall", className: "text-ui-fg-subtle", children: "▮ Wishlists" }),
|
|
192
|
-
/* @__PURE__ */ jsxRuntime.jsx(ui.Text, { size: "xsmall", className: "text-ui-fg-muted", children: "▮ Items" })
|
|
193
|
-
] })
|
|
175
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex gap-4", children: /* @__PURE__ */ jsxRuntime.jsx(ui.Text, { size: "xsmall", className: "text-ui-fg-subtle", children: "▮ Items" }) })
|
|
194
176
|
] }),
|
|
195
177
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col gap-2", children: [
|
|
196
178
|
/* @__PURE__ */ jsxRuntime.jsx(ui.Heading, { level: "h3", children: "Most-wishlisted products (top 10)" }),
|
|
@@ -80,10 +80,7 @@ const WishlistAnalyticsTab = () => {
|
|
|
80
80
|
}
|
|
81
81
|
});
|
|
82
82
|
const maxTrend = useMemo(
|
|
83
|
-
() => Math.max(
|
|
84
|
-
1,
|
|
85
|
-
...(data == null ? void 0 : data.trend.map((t) => Math.max(t.wishlists, t.items))) ?? [1]
|
|
86
|
-
),
|
|
83
|
+
() => Math.max(1, ...(data == null ? void 0 : data.trend.map((t) => t.items)) ?? [1]),
|
|
87
84
|
[data]
|
|
88
85
|
);
|
|
89
86
|
if (isError) {
|
|
@@ -153,41 +150,26 @@ const WishlistAnalyticsTab = () => {
|
|
|
153
150
|
)
|
|
154
151
|
] }),
|
|
155
152
|
/* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-2 rounded-lg border p-4", children: [
|
|
156
|
-
/* @__PURE__ */ jsx(Text, { size: "small", weight: "plus", children: "
|
|
153
|
+
/* @__PURE__ */ jsx(Text, { size: "small", weight: "plus", children: "Items added over time" }),
|
|
157
154
|
/* @__PURE__ */ jsx("div", { className: "flex h-40 items-end gap-1 overflow-x-auto", children: data.trend.map((t) => /* @__PURE__ */ jsx(
|
|
158
155
|
"div",
|
|
159
156
|
{
|
|
160
157
|
className: "flex min-w-[10px] flex-1 flex-col items-center justify-end gap-0.5",
|
|
161
|
-
title: `${t.date}: ${t.
|
|
162
|
-
children: /* @__PURE__ */
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
minHeight: t.wishlists > 0 ? "2px" : void 0
|
|
170
|
-
}
|
|
171
|
-
}
|
|
172
|
-
),
|
|
173
|
-
/* @__PURE__ */ jsx(
|
|
174
|
-
"div",
|
|
175
|
-
{
|
|
176
|
-
className: "w-1/2 rounded-t bg-ui-fg-muted",
|
|
177
|
-
style: {
|
|
178
|
-
height: `${t.items / maxTrend * 100}%`,
|
|
179
|
-
minHeight: t.items > 0 ? "2px" : void 0
|
|
180
|
-
}
|
|
158
|
+
title: `${t.date}: ${t.items} items`,
|
|
159
|
+
children: /* @__PURE__ */ jsx("div", { className: "flex h-32 w-full items-end justify-center", children: /* @__PURE__ */ jsx(
|
|
160
|
+
"div",
|
|
161
|
+
{
|
|
162
|
+
className: "w-full rounded-t bg-ui-fg-interactive",
|
|
163
|
+
style: {
|
|
164
|
+
height: `${t.items / maxTrend * 100}%`,
|
|
165
|
+
minHeight: t.items > 0 ? "2px" : void 0
|
|
181
166
|
}
|
|
182
|
-
|
|
183
|
-
|
|
167
|
+
}
|
|
168
|
+
) })
|
|
184
169
|
},
|
|
185
170
|
t.date
|
|
186
171
|
)) }),
|
|
187
|
-
/* @__PURE__ */
|
|
188
|
-
/* @__PURE__ */ jsx(Text, { size: "xsmall", className: "text-ui-fg-subtle", children: "▮ Wishlists" }),
|
|
189
|
-
/* @__PURE__ */ jsx(Text, { size: "xsmall", className: "text-ui-fg-muted", children: "▮ Items" })
|
|
190
|
-
] })
|
|
172
|
+
/* @__PURE__ */ jsx("div", { className: "flex gap-4", children: /* @__PURE__ */ jsx(Text, { size: "xsmall", className: "text-ui-fg-subtle", children: "▮ Items" }) })
|
|
191
173
|
] }),
|
|
192
174
|
/* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-2", children: [
|
|
193
175
|
/* @__PURE__ */ jsx(Heading, { level: "h3", children: "Most-wishlisted products (top 10)" }),
|