@yoast/ai-insights-client 1.0.1 → 1.1.1
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/README.md +0 -4
- package/dist/ai-insights-client.cjs.js +1293 -0
- package/dist/{index.css → ai-insights-client.css} +1 -1
- package/dist/ai-insights-client.es.js +32070 -0
- package/dist/index.d.ts +1 -0
- package/package.json +48 -12
- package/dist/1-BrandInfo-CinffkUh.js +0 -1432
- package/dist/2-QuerySelection-BzbyqeHz.js +0 -145
- package/dist/BrandList-DzzZhRJ8.js +0 -460
- package/dist/CXEL7IU7-wPFoEf3d.js +0 -42
- package/dist/HASRA6WW-BgmA3kL8.js +0 -8913
- package/dist/I3HPI4QX-BR0UzjLo.js +0 -33
- package/dist/PaperActions-CJVyQXH2.js +0 -30
- package/dist/Settings-pN5RkxPZ.js +0 -156
- package/dist/index-B56vBhjW.js +0 -49644
- package/dist/index-BhDYrlIQ.js +0 -36
- package/dist/index.js +0 -10
|
@@ -1,145 +0,0 @@
|
|
|
1
|
-
import { r as a, b as I, a as q, au as A, av as M, j as t, v as $, c as x, B as p, aw as D, S as G, C as O, k as P, T as _ } from "./index-B56vBhjW.js";
|
|
2
|
-
import { P as z } from "./PaperActions-CJVyQXH2.js";
|
|
3
|
-
function B(o, u) {
|
|
4
|
-
return /* @__PURE__ */ a.createElement("svg", Object.assign({
|
|
5
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
6
|
-
fill: "none",
|
|
7
|
-
viewBox: "0 0 24 24",
|
|
8
|
-
strokeWidth: 2,
|
|
9
|
-
stroke: "currentColor",
|
|
10
|
-
"aria-hidden": "true",
|
|
11
|
-
ref: u
|
|
12
|
-
}, o), /* @__PURE__ */ a.createElement("path", {
|
|
13
|
-
strokeLinecap: "round",
|
|
14
|
-
strokeLinejoin: "round",
|
|
15
|
-
d: "M15 15l-2 5L9 9l11 4-5 2zm0 0l5 5M7.188 2.239l.777 2.897M5.136 7.965l-2.898-.777M13.95 4.05l-2.122 2.122m-5.657 5.656l-2.12 2.122"
|
|
16
|
-
}));
|
|
17
|
-
}
|
|
18
|
-
const F = a.forwardRef(B), v = 5, S = "Generating...", U = "Re-generating...", Y = ["******************************", "***********************", "*******************************************************", "***********************************************", "***************************************************************", "*******************************************************", "*******************************************************", "***********************************************"], X = Array.from({
|
|
19
|
-
length: v
|
|
20
|
-
}, (o, u) => ({
|
|
21
|
-
id: `query-${u}`,
|
|
22
|
-
text: S,
|
|
23
|
-
isRegenerating: !0
|
|
24
|
-
})), V = () => {
|
|
25
|
-
const {
|
|
26
|
-
brandId: o
|
|
27
|
-
} = I(), u = q(), [c, g] = a.useState(X), [m, N] = a.useState(!1), [r, f] = a.useState([]), C = r.length || v, {
|
|
28
|
-
data: d,
|
|
29
|
-
isRefetching: i,
|
|
30
|
-
refetch: b
|
|
31
|
-
} = A(o || "", {
|
|
32
|
-
quantity: C
|
|
33
|
-
}, {
|
|
34
|
-
query: {
|
|
35
|
-
enabled: !!o
|
|
36
|
-
}
|
|
37
|
-
}), {
|
|
38
|
-
mutate: j,
|
|
39
|
-
isPending: E
|
|
40
|
-
} = M({
|
|
41
|
-
mutation: {
|
|
42
|
-
onSuccess: (e) => {
|
|
43
|
-
e?.status && e.status >= 200 && e.status < 300 && u("/setup/analysis");
|
|
44
|
-
},
|
|
45
|
-
onError: (e) => {
|
|
46
|
-
console.error("Error saving queries:", e);
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
});
|
|
50
|
-
a.useEffect(() => {
|
|
51
|
-
d?.data && c.every((e) => e.text === S) && g(d.data.map((e, s) => ({
|
|
52
|
-
id: `query-${s}`,
|
|
53
|
-
text: e,
|
|
54
|
-
isRegenerating: !1
|
|
55
|
-
})));
|
|
56
|
-
}, [d, c]), a.useEffect(() => {
|
|
57
|
-
if (d?.data && !i && r.length > 0) {
|
|
58
|
-
const e = d.data, s = r.map(Number);
|
|
59
|
-
g((n) => n.map((l, y) => {
|
|
60
|
-
const h = s.indexOf(y);
|
|
61
|
-
return {
|
|
62
|
-
...l,
|
|
63
|
-
text: h >= 0 && e[h] ? e[h] : l.text,
|
|
64
|
-
isRegenerating: !1
|
|
65
|
-
};
|
|
66
|
-
}));
|
|
67
|
-
}
|
|
68
|
-
}, [d, i, r]);
|
|
69
|
-
const k = a.useMemo(() => i || c.length === 0, [i, c.length]), w = a.useCallback((e) => {
|
|
70
|
-
const s = e.toString();
|
|
71
|
-
f((n) => n.includes(s) ? n.filter((l) => l !== s) : [...n, s]);
|
|
72
|
-
}, []), Q = a.useCallback((e, s) => {
|
|
73
|
-
g((n) => n.map((l, y) => y === e ? {
|
|
74
|
-
...l,
|
|
75
|
-
text: s
|
|
76
|
-
} : l));
|
|
77
|
-
}, []), R = () => {
|
|
78
|
-
N(!m), f([]);
|
|
79
|
-
}, T = a.useCallback(() => {
|
|
80
|
-
i || r.length === 0 || (g((e) => e.map((s, n) => ({
|
|
81
|
-
...s,
|
|
82
|
-
isRegenerating: r.includes(n.toString())
|
|
83
|
-
}))), b());
|
|
84
|
-
}, [i, r, b]), L = a.useCallback((e) => {
|
|
85
|
-
e.preventDefault(), o && j({
|
|
86
|
-
brandId: o,
|
|
87
|
-
data: c.map((s) => s.text)
|
|
88
|
-
});
|
|
89
|
-
}, [o, c, j]);
|
|
90
|
-
return /* @__PURE__ */ t.jsxs("form", { onSubmit: L, children: [
|
|
91
|
-
/* @__PURE__ */ t.jsxs("div", { className: "yst-mb-8", children: [
|
|
92
|
-
/* @__PURE__ */ t.jsx($, { size: "2", className: "yst-mb-2", children: "Your queries" }),
|
|
93
|
-
/* @__PURE__ */ t.jsxs("div", { className: "yst-space-y-4", children: [
|
|
94
|
-
/* @__PURE__ */ t.jsx("p", { children: "You can edit your queries or regenerate new ones with AI." }),
|
|
95
|
-
/* @__PURE__ */ t.jsx("div", { className: x("yst-flex yst-gap-3", m ? "yst-justify-end" : "yst-justify-start"), children: m ? /* @__PURE__ */ t.jsxs(t.Fragment, { children: [
|
|
96
|
-
/* @__PURE__ */ t.jsx(p, { size: "small", variant: "secondary", onClick: R, children: "Cancel" }),
|
|
97
|
-
/* @__PURE__ */ t.jsxs(p, { size: "small", onClick: T, className: "yst-gap-1.5", isLoading: i, disabled: i || r.length === 0, children: [
|
|
98
|
-
/* @__PURE__ */ t.jsx(D, {}),
|
|
99
|
-
"Re-generate selected prompts"
|
|
100
|
-
] })
|
|
101
|
-
] }) : /* @__PURE__ */ t.jsxs(p, { size: "small", variant: "secondary", onClick: R, className: "yst-gap-1.5", children: [
|
|
102
|
-
/* @__PURE__ */ t.jsx(F, {}),
|
|
103
|
-
"Select prompts to regenerate"
|
|
104
|
-
] }) })
|
|
105
|
-
] })
|
|
106
|
-
] }),
|
|
107
|
-
/* @__PURE__ */ t.jsx("div", { className: "yst-mb-8", children: c.length === 0 ? Y.map((e, s) => /* @__PURE__ */ t.jsx("div", { className: x("yst-mb-4 yst-cursor-pointer yst-rounded yst-border yst-border-slate-300 yst-p-3 yst-transition-colors", "yst-bg-white"), children: /* @__PURE__ */ t.jsx(G, { children: e || "Example placeholder query for demonstration purposes." }) }, `placeholder-query-${s}`)) : c.map((e, s) => {
|
|
108
|
-
const n = e.isRegenerating ? U : e.text;
|
|
109
|
-
return /* @__PURE__ */ t.jsx("div", { className: x("yst-mb-4"), children: /* @__PURE__ */ t.jsxs("div", { className: "yst-flex yst-gap-2", children: [
|
|
110
|
-
m && /* @__PURE__ */ t.jsx("div", { className: "yst-flex yst-items-center", children: /* @__PURE__ */ t.jsx(
|
|
111
|
-
O,
|
|
112
|
-
{
|
|
113
|
-
id: `query-regenerate-${s}`,
|
|
114
|
-
name: `query-regenerate-${s}`,
|
|
115
|
-
value: s.toString(),
|
|
116
|
-
checked: r.includes(s.toString()),
|
|
117
|
-
onChange: () => w(s),
|
|
118
|
-
disabled: i
|
|
119
|
-
}
|
|
120
|
-
) }),
|
|
121
|
-
/* @__PURE__ */ t.jsxs("div", { className: "yst-flex-1", children: [
|
|
122
|
-
/* @__PURE__ */ t.jsxs(P, { htmlFor: `query-text-${s}`, className: "yst-mb-2 yst-block yst-text-sm yst-font-medium yst-text-slate-700", children: [
|
|
123
|
-
"Prompt ",
|
|
124
|
-
s + 1
|
|
125
|
-
] }),
|
|
126
|
-
/* @__PURE__ */ t.jsx(_, { id: `query-text-${s}`, type: "text", value: n, onChange: (l) => {
|
|
127
|
-
e.isRegenerating || Q(s, l.target.value);
|
|
128
|
-
}, placeholder: "Enter your query...", className: "yst-w-full", disabled: e.isRegenerating })
|
|
129
|
-
] })
|
|
130
|
-
] }) }, e.id);
|
|
131
|
-
}) }),
|
|
132
|
-
/* @__PURE__ */ t.jsx(
|
|
133
|
-
z,
|
|
134
|
-
{
|
|
135
|
-
sparkCost: 1,
|
|
136
|
-
buttonText: "Start analysis (~ 5 minutes)",
|
|
137
|
-
isButtonDisabled: k,
|
|
138
|
-
isLoading: E
|
|
139
|
-
}
|
|
140
|
-
)
|
|
141
|
-
] });
|
|
142
|
-
};
|
|
143
|
-
export {
|
|
144
|
-
V as default
|
|
145
|
-
};
|
|
@@ -1,460 +0,0 @@
|
|
|
1
|
-
import { r as t, R as l, _ as F, c as B, P as o, l as E, u as de, a as me, b as ue, d as ye, e as pe, j as e, f as Y, g as he, T as J, h as p, B as h, i as xe, L as ge, M as N, k as fe, C as K, S as P, F as Q } from "./index-B56vBhjW.js";
|
|
2
|
-
function je(r, n) {
|
|
3
|
-
return /* @__PURE__ */ t.createElement("svg", Object.assign({
|
|
4
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
5
|
-
viewBox: "0 0 20 20",
|
|
6
|
-
fill: "currentColor",
|
|
7
|
-
"aria-hidden": "true",
|
|
8
|
-
ref: n
|
|
9
|
-
}, r), /* @__PURE__ */ t.createElement("path", {
|
|
10
|
-
fillRule: "evenodd",
|
|
11
|
-
d: "M12.707 5.293a1 1 0 010 1.414L9.414 10l3.293 3.293a1 1 0 01-1.414 1.414l-4-4a1 1 0 010-1.414l4-4a1 1 0 011.414 0z",
|
|
12
|
-
clipRule: "evenodd"
|
|
13
|
-
}));
|
|
14
|
-
}
|
|
15
|
-
const ve = t.forwardRef(je);
|
|
16
|
-
function we(r, n) {
|
|
17
|
-
return /* @__PURE__ */ t.createElement("svg", Object.assign({
|
|
18
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
19
|
-
viewBox: "0 0 20 20",
|
|
20
|
-
fill: "currentColor",
|
|
21
|
-
"aria-hidden": "true",
|
|
22
|
-
ref: n
|
|
23
|
-
}, r), /* @__PURE__ */ t.createElement("path", {
|
|
24
|
-
fillRule: "evenodd",
|
|
25
|
-
d: "M7.293 14.707a1 1 0 010-1.414L10.586 10 7.293 6.707a1 1 0 011.414-1.414l4 4a1 1 0 010 1.414l-4 4a1 1 0 01-1.414 0z",
|
|
26
|
-
clipRule: "evenodd"
|
|
27
|
-
}));
|
|
28
|
-
}
|
|
29
|
-
const Ne = t.forwardRef(we);
|
|
30
|
-
function Ce(r, n) {
|
|
31
|
-
return /* @__PURE__ */ t.createElement("svg", Object.assign({
|
|
32
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
33
|
-
viewBox: "0 0 20 20",
|
|
34
|
-
fill: "currentColor",
|
|
35
|
-
"aria-hidden": "true",
|
|
36
|
-
ref: n
|
|
37
|
-
}, r), /* @__PURE__ */ t.createElement("path", {
|
|
38
|
-
fillRule: "evenodd",
|
|
39
|
-
d: "M2 5a2 2 0 012-2h12a2 2 0 012 2v2a2 2 0 01-2 2H4a2 2 0 01-2-2V5zm14 1a1 1 0 11-2 0 1 1 0 012 0zM2 13a2 2 0 012-2h12a2 2 0 012 2v2a2 2 0 01-2 2H4a2 2 0 01-2-2v-2zm14 1a1 1 0 11-2 0 1 1 0 012 0z",
|
|
40
|
-
clipRule: "evenodd"
|
|
41
|
-
}));
|
|
42
|
-
}
|
|
43
|
-
const be = t.forwardRef(Ce);
|
|
44
|
-
function Re(r, n) {
|
|
45
|
-
return /* @__PURE__ */ t.createElement("svg", Object.assign({
|
|
46
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
47
|
-
fill: "none",
|
|
48
|
-
viewBox: "0 0 24 24",
|
|
49
|
-
strokeWidth: 2,
|
|
50
|
-
stroke: "currentColor",
|
|
51
|
-
"aria-hidden": "true",
|
|
52
|
-
ref: n
|
|
53
|
-
}, r), /* @__PURE__ */ t.createElement("path", {
|
|
54
|
-
strokeLinecap: "round",
|
|
55
|
-
strokeLinejoin: "round",
|
|
56
|
-
d: "M13.875 18.825A10.05 10.05 0 0112 19c-4.478 0-8.268-2.943-9.543-7a9.97 9.97 0 011.563-3.029m5.858.908a3 3 0 114.243 4.243M9.878 9.878l4.242 4.242M9.88 9.88l-3.29-3.29m7.532 7.532l3.29 3.29M3 3l3.59 3.59m0 0A9.953 9.953 0 0112 5c4.478 0 8.268 2.943 9.543 7a10.025 10.025 0 01-4.132 5.411m0 0L21 21"
|
|
57
|
-
}));
|
|
58
|
-
}
|
|
59
|
-
const ke = t.forwardRef(Re);
|
|
60
|
-
function Ee(r, n) {
|
|
61
|
-
return /* @__PURE__ */ t.createElement("svg", Object.assign({
|
|
62
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
63
|
-
fill: "none",
|
|
64
|
-
viewBox: "0 0 24 24",
|
|
65
|
-
strokeWidth: 2,
|
|
66
|
-
stroke: "currentColor",
|
|
67
|
-
"aria-hidden": "true",
|
|
68
|
-
ref: n
|
|
69
|
-
}, r), /* @__PURE__ */ t.createElement("path", {
|
|
70
|
-
strokeLinecap: "round",
|
|
71
|
-
strokeLinejoin: "round",
|
|
72
|
-
d: "M15 12a3 3 0 11-6 0 3 3 0 016 0z"
|
|
73
|
-
}), /* @__PURE__ */ t.createElement("path", {
|
|
74
|
-
strokeLinecap: "round",
|
|
75
|
-
strokeLinejoin: "round",
|
|
76
|
-
d: "M2.458 12C3.732 7.943 7.523 5 12 5c4.478 0 8.268 2.943 9.542 7-1.274 4.057-5.064 7-9.542 7-4.477 0-8.268-2.943-9.542-7z"
|
|
77
|
-
}));
|
|
78
|
-
}
|
|
79
|
-
const Be = t.forwardRef(Ee);
|
|
80
|
-
function Me(r, n) {
|
|
81
|
-
return /* @__PURE__ */ t.createElement("svg", Object.assign({
|
|
82
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
83
|
-
fill: "none",
|
|
84
|
-
viewBox: "0 0 24 24",
|
|
85
|
-
strokeWidth: 2,
|
|
86
|
-
stroke: "currentColor",
|
|
87
|
-
"aria-hidden": "true",
|
|
88
|
-
ref: n
|
|
89
|
-
}, r), /* @__PURE__ */ t.createElement("path", {
|
|
90
|
-
strokeLinecap: "round",
|
|
91
|
-
strokeLinejoin: "round",
|
|
92
|
-
d: "M5 12h14M5 12a2 2 0 01-2-2V6a2 2 0 012-2h14a2 2 0 012 2v4a2 2 0 01-2 2M5 12a2 2 0 00-2 2v4a2 2 0 002 2h14a2 2 0 002-2v-4a2 2 0 00-2-2m-2-4h.01M17 16h.01"
|
|
93
|
-
}));
|
|
94
|
-
}
|
|
95
|
-
const Se = t.forwardRef(Me), v = ({
|
|
96
|
-
className: r,
|
|
97
|
-
children: n,
|
|
98
|
-
active: u,
|
|
99
|
-
disabled: i,
|
|
100
|
-
...y
|
|
101
|
-
}) => /* @__PURE__ */ l.createElement("button", F({
|
|
102
|
-
type: "button",
|
|
103
|
-
className: B("yst-pagination__button", r, u && !i && "yst-pagination__button--active", i && "yst-pagination__button--disabled"),
|
|
104
|
-
disabled: i
|
|
105
|
-
}, y), n);
|
|
106
|
-
v.displayName = "Pagination.Button";
|
|
107
|
-
v.propTypes = {
|
|
108
|
-
className: o.string,
|
|
109
|
-
children: o.node.isRequired,
|
|
110
|
-
active: o.bool,
|
|
111
|
-
disabled: o.bool
|
|
112
|
-
};
|
|
113
|
-
v.defaultProps = {
|
|
114
|
-
className: "",
|
|
115
|
-
active: !1,
|
|
116
|
-
// eslint-disable-next-line no-undefined
|
|
117
|
-
disabled: void 0
|
|
118
|
-
};
|
|
119
|
-
const X = () => /* @__PURE__ */ l.createElement("span", {
|
|
120
|
-
className: "yst-pagination-display__truncated"
|
|
121
|
-
}, "..."), O = ({
|
|
122
|
-
current: r,
|
|
123
|
-
total: n,
|
|
124
|
-
onNavigate: u,
|
|
125
|
-
maxPageButtons: i,
|
|
126
|
-
disabled: y
|
|
127
|
-
}) => {
|
|
128
|
-
const m = t.useMemo(() => E.clamp(n, 1, i), [n, i]), c = t.useMemo(() => E.round(m / 2, 0), [m]), C = t.useMemo(() => n > i && i > 1 && r !== c + 1, [n, i, c]), g = t.useMemo(() => n - (m - c) + 1, [n, m, c]), b = t.useMemo(() => r > c && r < g, [r, c, g]);
|
|
129
|
-
return /* @__PURE__ */ l.createElement(l.Fragment, null, E.range(c).map((x) => {
|
|
130
|
-
const d = x + 1;
|
|
131
|
-
return /* @__PURE__ */ l.createElement(v, {
|
|
132
|
-
key: d,
|
|
133
|
-
className: "yst-px-4",
|
|
134
|
-
onClick: u,
|
|
135
|
-
"data-page": d,
|
|
136
|
-
active: d === r,
|
|
137
|
-
disabled: y
|
|
138
|
-
}, d);
|
|
139
|
-
}), C && /* @__PURE__ */ l.createElement(X, null), b && /* @__PURE__ */ l.createElement(l.Fragment, null, /* @__PURE__ */ l.createElement(v, {
|
|
140
|
-
className: "yst-px-4",
|
|
141
|
-
onClick: u,
|
|
142
|
-
"data-page": r,
|
|
143
|
-
active: !0,
|
|
144
|
-
disabled: y
|
|
145
|
-
}, r), r !== g - 1 && /* @__PURE__ */ l.createElement(X, null)), E.rangeRight(m - c).map((x) => {
|
|
146
|
-
const d = n - x;
|
|
147
|
-
return /* @__PURE__ */ l.createElement(v, {
|
|
148
|
-
key: d,
|
|
149
|
-
className: "yst-px-4",
|
|
150
|
-
onClick: u,
|
|
151
|
-
"data-page": d,
|
|
152
|
-
active: d === r,
|
|
153
|
-
disabled: y
|
|
154
|
-
}, d);
|
|
155
|
-
}));
|
|
156
|
-
};
|
|
157
|
-
O.displayName = "Pagination.DisplayButtons";
|
|
158
|
-
O.propTypes = {
|
|
159
|
-
current: o.number.isRequired,
|
|
160
|
-
total: o.number.isRequired,
|
|
161
|
-
onNavigate: o.func.isRequired,
|
|
162
|
-
maxPageButtons: o.number.isRequired,
|
|
163
|
-
disabled: o.bool.isRequired
|
|
164
|
-
};
|
|
165
|
-
const A = ({
|
|
166
|
-
current: r,
|
|
167
|
-
total: n
|
|
168
|
-
}) => /* @__PURE__ */ l.createElement("bdo", {
|
|
169
|
-
dir: "ltr",
|
|
170
|
-
className: "yst-pagination-display__text"
|
|
171
|
-
}, /* @__PURE__ */ l.createElement("span", {
|
|
172
|
-
className: "yst-pagination-display__current-text"
|
|
173
|
-
}, r), " / ", n);
|
|
174
|
-
A.displayName = "Pagination.DisplayText";
|
|
175
|
-
A.propTypes = {
|
|
176
|
-
current: o.number.isRequired,
|
|
177
|
-
total: o.number.isRequired
|
|
178
|
-
};
|
|
179
|
-
const $ = {
|
|
180
|
-
display: {
|
|
181
|
-
buttons: "buttons",
|
|
182
|
-
text: "text"
|
|
183
|
-
}
|
|
184
|
-
}, D = ({
|
|
185
|
-
className: r,
|
|
186
|
-
current: n,
|
|
187
|
-
total: u,
|
|
188
|
-
onNavigate: i,
|
|
189
|
-
variant: y,
|
|
190
|
-
maxPageButtons: m,
|
|
191
|
-
disabled: c,
|
|
192
|
-
screenReaderTextPrevious: C,
|
|
193
|
-
screenReaderTextNext: g,
|
|
194
|
-
...b
|
|
195
|
-
}) => {
|
|
196
|
-
const x = de(), d = t.useCallback(({
|
|
197
|
-
target: M
|
|
198
|
-
}) => i(E.parseInt(M.dataset.page)), [i]);
|
|
199
|
-
return /* @__PURE__ */ l.createElement("nav", F({
|
|
200
|
-
className: B("yst-pagination", r)
|
|
201
|
-
}, b), /* @__PURE__ */ l.createElement(v, {
|
|
202
|
-
className: "yst-rounded-s-md",
|
|
203
|
-
onClick: d,
|
|
204
|
-
"data-page": n - 1,
|
|
205
|
-
disabled: c || n - 1 < 1
|
|
206
|
-
}, /* @__PURE__ */ l.createElement("span", {
|
|
207
|
-
className: "yst-pointer-events-none yst-sr-only"
|
|
208
|
-
}, C), /* @__PURE__ */ l.createElement(ve, F({
|
|
209
|
-
className: "yst-pointer-events-none yst-h-5 yst-w-5"
|
|
210
|
-
}, x))), y === $.display.text && /* @__PURE__ */ l.createElement(A, {
|
|
211
|
-
current: n,
|
|
212
|
-
total: u
|
|
213
|
-
}), y === $.display.buttons && /* @__PURE__ */ l.createElement(O, {
|
|
214
|
-
current: n,
|
|
215
|
-
total: u,
|
|
216
|
-
maxPageButtons: m,
|
|
217
|
-
onNavigate: d,
|
|
218
|
-
disabled: c
|
|
219
|
-
}), /* @__PURE__ */ l.createElement(v, {
|
|
220
|
-
className: "yst-rounded-e-md",
|
|
221
|
-
onClick: d,
|
|
222
|
-
"data-page": n + 1,
|
|
223
|
-
disabled: c || n + 1 > u
|
|
224
|
-
}, /* @__PURE__ */ l.createElement("span", {
|
|
225
|
-
className: "yst-pointer-events-none yst-sr-only"
|
|
226
|
-
}, g), /* @__PURE__ */ l.createElement(Ne, F({
|
|
227
|
-
className: "yst-pointer-events-none yst-h-5 yst-w-5"
|
|
228
|
-
}, x))));
|
|
229
|
-
};
|
|
230
|
-
D.propTypes = {
|
|
231
|
-
className: o.string,
|
|
232
|
-
current: o.number.isRequired,
|
|
233
|
-
total: o.number.isRequired,
|
|
234
|
-
onNavigate: o.func.isRequired,
|
|
235
|
-
variant: o.oneOf(Object.keys($.display)),
|
|
236
|
-
maxPageButtons: o.number,
|
|
237
|
-
disabled: o.bool,
|
|
238
|
-
screenReaderTextPrevious: o.string.isRequired,
|
|
239
|
-
screenReaderTextNext: o.string.isRequired
|
|
240
|
-
};
|
|
241
|
-
D.defaultProps = {
|
|
242
|
-
className: "",
|
|
243
|
-
variant: $.display.buttons,
|
|
244
|
-
maxPageButtons: 6,
|
|
245
|
-
disabled: !1
|
|
246
|
-
};
|
|
247
|
-
const Te = () => {
|
|
248
|
-
const r = me(), [n, u] = t.useState(!1), [i, y] = t.useState({}), [m, c] = t.useState(""), [C, g] = t.useState(1), [b, x] = t.useState({}), [d, M] = t.useState(!1), [S, G] = t.useState(""), [w, I] = t.useState([]), {
|
|
249
|
-
brandId: _
|
|
250
|
-
} = ue(), {
|
|
251
|
-
data: Z,
|
|
252
|
-
isLoading: ee
|
|
253
|
-
} = ye(_, {
|
|
254
|
-
query: {
|
|
255
|
-
enabled: !!_
|
|
256
|
-
}
|
|
257
|
-
}), {
|
|
258
|
-
mutate: se,
|
|
259
|
-
isPending: q
|
|
260
|
-
} = pe({
|
|
261
|
-
mutation: {
|
|
262
|
-
onSuccess: (s) => {
|
|
263
|
-
console.log("Group created successfully", s);
|
|
264
|
-
},
|
|
265
|
-
onError: (s) => {
|
|
266
|
-
console.error("Error creating group:", s);
|
|
267
|
-
}
|
|
268
|
-
}
|
|
269
|
-
}), z = 10, L = Z?.data?.associatedBrands?.filter((s) => m ? s.name.toLowerCase().includes(m.toLowerCase()) : !0) || [], ae = Math.ceil(L.length / z), V = (C - 1) * z, W = L.slice(V, V + z), U = (s) => {
|
|
270
|
-
console.log("Edit brand:", s);
|
|
271
|
-
}, T = Object.entries(b).filter(([, s]) => s).map(([s]) => s), te = () => {
|
|
272
|
-
console.log("Group brands:", T);
|
|
273
|
-
const s = L.filter((a) => T.includes(a.id)).map((a) => a.name);
|
|
274
|
-
G(s.length > 0 ? s[0] : "New Group"), I(T), M(!0);
|
|
275
|
-
}, ne = (s) => {
|
|
276
|
-
c(s.target.value), g(1);
|
|
277
|
-
}, re = (s) => {
|
|
278
|
-
x((a) => ({
|
|
279
|
-
...a,
|
|
280
|
-
[s]: !a[s]
|
|
281
|
-
}));
|
|
282
|
-
}, le = () => {
|
|
283
|
-
r("/");
|
|
284
|
-
}, oe = (s) => {
|
|
285
|
-
x((a) => ({
|
|
286
|
-
...a,
|
|
287
|
-
[s.id]: !1
|
|
288
|
-
})), y((a) => {
|
|
289
|
-
const j = s.id in a ? !a[s.id] : !s.included;
|
|
290
|
-
return {
|
|
291
|
-
...a,
|
|
292
|
-
[s.id]: j
|
|
293
|
-
};
|
|
294
|
-
}), u(!0);
|
|
295
|
-
}, ie = () => {
|
|
296
|
-
x({}), y({}), u(!1);
|
|
297
|
-
}, H = () => {
|
|
298
|
-
M(!1), G(""), I([]);
|
|
299
|
-
}, ce = () => {
|
|
300
|
-
!S.trim() || w.length === 0 || (se({
|
|
301
|
-
brandId: _,
|
|
302
|
-
data: {
|
|
303
|
-
groupName: S.trim(),
|
|
304
|
-
brandIds: w
|
|
305
|
-
}
|
|
306
|
-
}), H());
|
|
307
|
-
}, f = (s, a) => i[s] || // if not in map, check brand directly
|
|
308
|
-
i[s] === void 0 && a.included === !0, R = [{
|
|
309
|
-
Header: "Brand name",
|
|
310
|
-
accessor: "name",
|
|
311
|
-
Cell: ({
|
|
312
|
-
value: s,
|
|
313
|
-
row: a
|
|
314
|
-
}) => /* @__PURE__ */ e.jsx("span", { className: "yst-font-medium yst-text-slate-900", children: /* @__PURE__ */ e.jsx(K, { id: `brand-checkbox-${a.id}`, checked: !!b[a.id], onChange: () => re(a.id), value: s, label: /* @__PURE__ */ e.jsxs("span", { className: "yst-flex yst-items-center yst-gap-1", children: [
|
|
315
|
-
a.type === "group" && /* @__PURE__ */ e.jsx(be, { className: "yst-h-4 yst-w-4 yst-text-slate-400" }),
|
|
316
|
-
s
|
|
317
|
-
] }), name: `brand-checkbox-${a.id}`, disabled: !f(a.id, a) }) }),
|
|
318
|
-
LoadingComponent: ({
|
|
319
|
-
id: s = ""
|
|
320
|
-
}) => /* @__PURE__ */ e.jsxs("div", { className: "yst-flex", children: [
|
|
321
|
-
/* @__PURE__ */ e.jsx(K, { id: `loading-row-checkbox-${s}`, value: "loading...", disabled: !0, name: `brand-checkbox-${s}` }),
|
|
322
|
-
" ",
|
|
323
|
-
/* @__PURE__ */ e.jsx(P, { className: "yst-h-6 yst-w-32", id: `loading-row-skeleton-${s}` })
|
|
324
|
-
] })
|
|
325
|
-
}, {
|
|
326
|
-
Header: "Mentions",
|
|
327
|
-
accessor: "mentionsFound",
|
|
328
|
-
Cell: ({
|
|
329
|
-
row: s
|
|
330
|
-
}) => /* @__PURE__ */ e.jsxs("span", { className: B("yst-text-sm"), children: [
|
|
331
|
-
/* @__PURE__ */ e.jsx("span", { className: B({
|
|
332
|
-
"yst-text-slate-900": f(s.id, s),
|
|
333
|
-
"yst-text-slate-400": !f(s.id, s)
|
|
334
|
-
}), children: s.mentionsFound }),
|
|
335
|
-
" ",
|
|
336
|
-
/* @__PURE__ */ e.jsxs("span", { className: B({
|
|
337
|
-
"yst-text-slate-500": f(s.id, s),
|
|
338
|
-
"yst-text-slate-300": !f(s.id, s)
|
|
339
|
-
}), children: [
|
|
340
|
-
"/ ",
|
|
341
|
-
s.mentionsTotal
|
|
342
|
-
] })
|
|
343
|
-
] }),
|
|
344
|
-
LoadingComponent: () => /* @__PURE__ */ e.jsx(P, { className: "yst-h-6 yst-w-8" })
|
|
345
|
-
}, {
|
|
346
|
-
Header: "Actions",
|
|
347
|
-
accessor: "id",
|
|
348
|
-
Cell: ({
|
|
349
|
-
value: s,
|
|
350
|
-
row: a
|
|
351
|
-
}) => /* @__PURE__ */ e.jsx(e.Fragment, { children: a.type === "group" ? /* @__PURE__ */ e.jsxs(
|
|
352
|
-
h,
|
|
353
|
-
{
|
|
354
|
-
variant: "tertiary",
|
|
355
|
-
size: "small",
|
|
356
|
-
onClick: () => U(s),
|
|
357
|
-
className: "yst-gap-1.5 yst-px-0",
|
|
358
|
-
disabled: !f(a.id, a),
|
|
359
|
-
children: [
|
|
360
|
-
/* @__PURE__ */ e.jsx(Q, { className: "yst-h-4 yst-w-4" }),
|
|
361
|
-
"Edit group"
|
|
362
|
-
]
|
|
363
|
-
}
|
|
364
|
-
) : /* @__PURE__ */ e.jsxs(
|
|
365
|
-
h,
|
|
366
|
-
{
|
|
367
|
-
variant: "tertiary",
|
|
368
|
-
size: "small",
|
|
369
|
-
onClick: () => U(s),
|
|
370
|
-
className: "yst-gap-1.5 yst-px-0",
|
|
371
|
-
disabled: !f(a.id, a),
|
|
372
|
-
children: [
|
|
373
|
-
/* @__PURE__ */ e.jsx(Q, { className: "yst-h-4 yst-w-4" }),
|
|
374
|
-
"Rename"
|
|
375
|
-
]
|
|
376
|
-
}
|
|
377
|
-
) }),
|
|
378
|
-
LoadingComponent: () => /* @__PURE__ */ e.jsx(P, { className: "yst-h-6 yst-w-24" })
|
|
379
|
-
}, {
|
|
380
|
-
Header: "Exclude",
|
|
381
|
-
accessor: "included",
|
|
382
|
-
Cell: ({
|
|
383
|
-
row: s
|
|
384
|
-
}) => /* @__PURE__ */ e.jsx(h, { variant: "tertiary", size: "small", onClick: () => oe(s), className: "yst-gap-1.5 yst-px-0", children: f(s.id, s) ? /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
385
|
-
/* @__PURE__ */ e.jsx(ke, { className: "yst-h-4 yst-w-4" }),
|
|
386
|
-
" Exclude"
|
|
387
|
-
] }) : /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
388
|
-
/* @__PURE__ */ e.jsx(Be, { className: "yst-h-4 yst-w-4" }),
|
|
389
|
-
" Include"
|
|
390
|
-
] }) }),
|
|
391
|
-
LoadingComponent: () => /* @__PURE__ */ e.jsx(P, { className: "yst-h-6 yst-w-20" })
|
|
392
|
-
}];
|
|
393
|
-
return /* @__PURE__ */ e.jsxs(Y, { className: "yst-mx-auto yst-max-w-2xl", children: [
|
|
394
|
-
/* @__PURE__ */ e.jsx(he, { title: "Brand list ", children: /* @__PURE__ */ e.jsx("p", { children: "These are the brands found in responses to your example prompts. Group related brands to improve your analysis. You can rename or exclude irrelevant brands, and new brands will be added automatically if they appear in future analysis runs." }) }),
|
|
395
|
-
/* @__PURE__ */ e.jsxs(Y.Content, { children: [
|
|
396
|
-
/* @__PURE__ */ e.jsx("div", { className: "yst-mb-6", children: /* @__PURE__ */ e.jsx(J, { id: "brand-search", label: "Search brands", placeholder: "Search brands", value: m, onChange: ne }) }),
|
|
397
|
-
/* @__PURE__ */ e.jsx("div", { className: "yst-mb-6", children: /* @__PURE__ */ e.jsxs(p, { columns: R, className: "yst-w-full", variant: "minimal", children: [
|
|
398
|
-
/* @__PURE__ */ e.jsx(p.Head, { children: /* @__PURE__ */ e.jsx(p.Row, { children: R.map((s) => /* @__PURE__ */ e.jsx(p.Header, { children: s.Header }, s.accessor)) }) }),
|
|
399
|
-
/* @__PURE__ */ e.jsx(p.Body, { children: ee ? [1, 2, 3].map((s, a) => /* @__PURE__ */ e.jsx(p.Row, { children: R.map((j, k) => /* @__PURE__ */ e.jsx(p.Cell, { children: /* @__PURE__ */ e.jsx(j.LoadingComponent, { id: `skeleton-${a}-${k}` }, j.accessor) }, `cell-${k}`)) }, a)) : W.length === 0 ? (
|
|
400
|
-
/* NO RESULTS FOUND */
|
|
401
|
-
/* @__PURE__ */ e.jsx(p.Row, { children: /* @__PURE__ */ e.jsx(p.Cell, { colSpan: R.length, children: /* @__PURE__ */ e.jsxs("div", { className: "yst-py-12 yst-text-center", children: [
|
|
402
|
-
/* @__PURE__ */ e.jsx("h3", { className: "yst-mt-4 yst-text-lg yst-font-medium yst-text-slate-900", children: "No brands found" }),
|
|
403
|
-
/* @__PURE__ */ e.jsx("p", { className: "yst-mt-2 yst-text-sm yst-text-slate-500", children: m ? `No brands match "${m}". Try a different search term.` : "No brands have been found yet. Run an analysis to discover brands." }),
|
|
404
|
-
m && /* @__PURE__ */ e.jsx(h, { variant: "secondary", size: "small", onClick: () => {
|
|
405
|
-
c(""), g(1);
|
|
406
|
-
}, className: "yst-mt-4", children: "Clear search" })
|
|
407
|
-
] }) }) })
|
|
408
|
-
) : (
|
|
409
|
-
/* DATA ROWS */
|
|
410
|
-
W.map((s) => /* @__PURE__ */ e.jsx(p.Row, { children: R.map((a) => /* @__PURE__ */ e.jsx(p.Cell, { children: a.Cell ? a.Cell({
|
|
411
|
-
value: s[a.accessor],
|
|
412
|
-
row: s
|
|
413
|
-
}) : s[a.accessor] }, a.accessor)) }, s.id))
|
|
414
|
-
) })
|
|
415
|
-
] }) }),
|
|
416
|
-
/* @__PURE__ */ e.jsxs("div", { className: "yst-flex yst-items-center yst-justify-between", children: [
|
|
417
|
-
/* @__PURE__ */ e.jsxs(h, { variant: "secondary", onClick: te, className: "yst-mb-0 yst-gap-2", disabled: T.length < 2, children: [
|
|
418
|
-
/* @__PURE__ */ e.jsx(Se, {}),
|
|
419
|
-
" Group brands"
|
|
420
|
-
] }),
|
|
421
|
-
/* @__PURE__ */ e.jsx(D, { variant: "text", current: C, total: ae, onNavigate: g, className: "yst-flex-row", screenReaderTextPrevious: "Previous page", screenReaderTextNext: "Next page" })
|
|
422
|
-
] })
|
|
423
|
-
] }),
|
|
424
|
-
/* @__PURE__ */ e.jsx(xe, { children: /* @__PURE__ */ e.jsx("div", { className: "yst-flex yst-items-center yst-justify-end yst-gap-4", children: n ? /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
425
|
-
/* @__PURE__ */ e.jsx(h, { variant: "secondary", className: "yst-mb-0", onClick: ie, children: "Discard changes" }),
|
|
426
|
-
/* @__PURE__ */ e.jsx(h, { variant: "primary", className: "yst-mb-0", onClick: le, children: "Save changes" })
|
|
427
|
-
] }) : /* @__PURE__ */ e.jsx(h, { as: ge, to: "/", variant: "primary", className: "yst-mb-0", children: "Show analysis →" }) }) }),
|
|
428
|
-
/* @__PURE__ */ e.jsx(N, { isOpen: d, onClose: H, children: /* @__PURE__ */ e.jsx(N.Panel, { children: /* @__PURE__ */ e.jsxs(N.Container, { children: [
|
|
429
|
-
/* @__PURE__ */ e.jsx(N.Container.Header, { children: /* @__PURE__ */ e.jsx(N.Title, { children: "Edit brand group" }) }),
|
|
430
|
-
/* @__PURE__ */ e.jsxs(N.Container.Content, { className: "yst-space-y-4", children: [
|
|
431
|
-
/* @__PURE__ */ e.jsxs("div", { children: [
|
|
432
|
-
/* @__PURE__ */ e.jsx("label", { htmlFor: "groupName", className: "yst-mb-2 yst-block yst-text-sm yst-font-medium", children: "Group name" }),
|
|
433
|
-
/* @__PURE__ */ e.jsx(J, { id: "groupName", value: S, onChange: (s) => G(s.target.value), placeholder: "Enter group name", className: "yst-w-full" })
|
|
434
|
-
] }),
|
|
435
|
-
/* @__PURE__ */ e.jsxs("div", { children: [
|
|
436
|
-
w.length && /* @__PURE__ */ e.jsxs(fe, { className: "yst-mb-2 yst-block yst-text-sm yst-font-medium", children: [
|
|
437
|
-
"Brands in group (",
|
|
438
|
-
w.length,
|
|
439
|
-
")"
|
|
440
|
-
] }),
|
|
441
|
-
/* @__PURE__ */ e.jsx("div", { className: "yst-max-h-40 yst-space-y-2 yst-overflow-y-auto", children: w.map((s) => {
|
|
442
|
-
const a = L.find((j) => j.id === s);
|
|
443
|
-
return a && /* @__PURE__ */ e.jsxs("div", { className: "yst-flex yst-items-center yst-justify-between yst-rounded yst-bg-gray-50 yst-p-2", children: [
|
|
444
|
-
/* @__PURE__ */ e.jsx("span", { className: "yst-text-sm", children: a.name }),
|
|
445
|
-
/* @__PURE__ */ e.jsx(h, { variant: "ghost", size: "small", onClick: () => I((j) => j.filter((k) => k !== s)), className: "yst-hover:text-red-700 yst-text-red-500", children: "Remove" })
|
|
446
|
-
] }, s);
|
|
447
|
-
}) }),
|
|
448
|
-
w.length === 0 && /* @__PURE__ */ e.jsx("p", { className: "yst-text-sm yst-italic yst-text-gray-500", children: "No brands selected" })
|
|
449
|
-
] })
|
|
450
|
-
] }),
|
|
451
|
-
/* @__PURE__ */ e.jsx(N.Container.Footer, { children: /* @__PURE__ */ e.jsxs("div", { className: "yst-flex yst-justify-end yst-gap-2", children: [
|
|
452
|
-
/* @__PURE__ */ e.jsx(h, { variant: "secondary", onClick: H, disabled: q, children: "Cancel" }),
|
|
453
|
-
/* @__PURE__ */ e.jsx(h, { variant: "primary", onClick: ce, disabled: !S.trim() || w.length === 0 || q, children: q ? "Saving..." : "Save group" })
|
|
454
|
-
] }) })
|
|
455
|
-
] }) }) })
|
|
456
|
-
] });
|
|
457
|
-
};
|
|
458
|
-
export {
|
|
459
|
-
Te as default
|
|
460
|
-
};
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
import { c as s, T as c, P as u, a as i, b as m, C as P, Q as d } from "./HASRA6WW-BgmA3kL8.js";
|
|
2
|
-
import { ay as v, az as C, aA as e } from "./index-B56vBhjW.js";
|
|
3
|
-
var h = (t) => {
|
|
4
|
-
const [r, o] = s({
|
|
5
|
-
prefix: "TanstackQueryDevtools"
|
|
6
|
-
}), a = v(), l = C(() => {
|
|
7
|
-
const n = r.theme_preference || c;
|
|
8
|
-
return n !== "system" ? n : a();
|
|
9
|
-
});
|
|
10
|
-
return e(d.Provider, {
|
|
11
|
-
value: t,
|
|
12
|
-
get children() {
|
|
13
|
-
return e(u, {
|
|
14
|
-
disabled: !0,
|
|
15
|
-
localStore: r,
|
|
16
|
-
setLocalStore: o,
|
|
17
|
-
get children() {
|
|
18
|
-
return e(i.Provider, {
|
|
19
|
-
value: l,
|
|
20
|
-
get children() {
|
|
21
|
-
return e(m, {
|
|
22
|
-
get children() {
|
|
23
|
-
return e(P, {
|
|
24
|
-
localStore: r,
|
|
25
|
-
setLocalStore: o,
|
|
26
|
-
get onClose() {
|
|
27
|
-
return t.onClose;
|
|
28
|
-
},
|
|
29
|
-
showPanelViewOnly: !0
|
|
30
|
-
});
|
|
31
|
-
}
|
|
32
|
-
});
|
|
33
|
-
}
|
|
34
|
-
});
|
|
35
|
-
}
|
|
36
|
-
});
|
|
37
|
-
}
|
|
38
|
-
});
|
|
39
|
-
}, p = h;
|
|
40
|
-
export {
|
|
41
|
-
p as default
|
|
42
|
-
};
|