@upstep/js 0.10.0 → 0.11.0
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 +24 -0
- package/dist/index.cjs +42 -42
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +53 -47
- package/dist/react.cjs +1 -1
- package/dist/react.d.ts +9 -1
- package/dist/react.d.ts.map +1 -1
- package/dist/react.js +334 -295
- package/dist/upstep.global.js +4 -4
- package/dist/widget.d.ts +3 -0
- package/dist/widget.d.ts.map +1 -1
- package/package.json +2 -2
package/dist/react.js
CHANGED
|
@@ -1,56 +1,56 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import
|
|
3
|
-
import { U as
|
|
4
|
-
import { scaleRadius as
|
|
5
|
-
const
|
|
6
|
-
function
|
|
7
|
-
return
|
|
1
|
+
import { jsxs as s, Fragment as R, jsx as t } from "react/jsx-runtime";
|
|
2
|
+
import X, { createContext as Z, useState as x, useEffect as w, useCallback as z, useContext as ee, useRef as te } from "react";
|
|
3
|
+
import { U as oe } from "./api-CROQwfAo.mjs";
|
|
4
|
+
import { scaleRadius as b, DEFAULT_ACCENT as ne, buildWidgetPalette as re, withAlpha as ie } from "./theme.js";
|
|
5
|
+
const le = '-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Helvetica,Arial,sans-serif';
|
|
6
|
+
function j(n, e) {
|
|
7
|
+
return ie(n, e) ?? `color-mix(in srgb, ${n} ${Math.round(e * 100)}%, transparent)`;
|
|
8
8
|
}
|
|
9
|
-
function
|
|
9
|
+
function H() {
|
|
10
10
|
if (typeof document > "u") return !1;
|
|
11
11
|
const n = document.documentElement;
|
|
12
12
|
return n.classList.contains("dark") || n.getAttribute("data-theme") === "dark";
|
|
13
13
|
}
|
|
14
|
-
function
|
|
15
|
-
const [o, p] =
|
|
16
|
-
|
|
14
|
+
function se(n, e) {
|
|
15
|
+
const [o, p] = x(() => n === "dark");
|
|
16
|
+
w(() => {
|
|
17
17
|
if (n !== "auto") {
|
|
18
18
|
p(n === "dark");
|
|
19
19
|
return;
|
|
20
20
|
}
|
|
21
|
-
if (p(
|
|
22
|
-
const
|
|
23
|
-
return
|
|
21
|
+
if (p(H()), typeof MutationObserver > "u") return;
|
|
22
|
+
const a = new MutationObserver(() => p(H()));
|
|
23
|
+
return a.observe(document.documentElement, {
|
|
24
24
|
attributes: !0,
|
|
25
25
|
attributeFilter: ["class", "data-theme"]
|
|
26
|
-
}), () =>
|
|
26
|
+
}), () => a.disconnect();
|
|
27
27
|
}, [n]);
|
|
28
|
-
const { accentColor: c, colors:
|
|
29
|
-
return
|
|
30
|
-
() =>
|
|
28
|
+
const { accentColor: c, colors: y, radius: r } = e;
|
|
29
|
+
return X.useMemo(
|
|
30
|
+
() => re({
|
|
31
31
|
mode: o ? "dark" : "light",
|
|
32
32
|
accentColor: c,
|
|
33
|
-
colors:
|
|
33
|
+
colors: y,
|
|
34
34
|
radius: r
|
|
35
35
|
}),
|
|
36
36
|
// `colors` is usually an inline object literal, so compare it by value.
|
|
37
37
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
38
|
-
[o, c, JSON.stringify(
|
|
38
|
+
[o, c, JSON.stringify(y ?? null), r]
|
|
39
39
|
);
|
|
40
40
|
}
|
|
41
|
-
const
|
|
42
|
-
function
|
|
41
|
+
const G = Z(null);
|
|
42
|
+
function ke({
|
|
43
43
|
children: n,
|
|
44
44
|
...e
|
|
45
45
|
}) {
|
|
46
|
-
const [o] =
|
|
47
|
-
|
|
46
|
+
const [o] = x(() => new oe(e)), [p, c] = x([]), [y, r] = x(!1), [a, k] = x(!0);
|
|
47
|
+
w(() => {
|
|
48
48
|
o.setUserId(e.userId);
|
|
49
|
-
}, [o, e.userId]),
|
|
49
|
+
}, [o, e.userId]), w(() => {
|
|
50
50
|
o.supportIdentityToken = e.supportIdentityToken, document.querySelectorAll("iframe[data-upstep-support]").forEach(
|
|
51
|
-
(
|
|
52
|
-
var
|
|
53
|
-
return (
|
|
51
|
+
(h) => {
|
|
52
|
+
var v;
|
|
53
|
+
return (v = h.contentWindow) == null ? void 0 : v.postMessage(
|
|
54
54
|
{
|
|
55
55
|
type: "upstep:support:identity",
|
|
56
56
|
token: e.supportIdentityToken
|
|
@@ -60,161 +60,163 @@ function be({
|
|
|
60
60
|
}
|
|
61
61
|
);
|
|
62
62
|
}, [o, e.supportIdentityToken]);
|
|
63
|
-
const i =
|
|
63
|
+
const i = z(async () => {
|
|
64
64
|
try {
|
|
65
|
-
const
|
|
66
|
-
c(
|
|
65
|
+
const h = await o.listFeedback({ sort: "votes", limit: 20 });
|
|
66
|
+
c(h.items), k(h.showBranding ?? !0);
|
|
67
67
|
} catch {
|
|
68
68
|
}
|
|
69
69
|
}, [o]);
|
|
70
|
-
|
|
70
|
+
w(() => {
|
|
71
71
|
i();
|
|
72
72
|
}, [i]);
|
|
73
|
-
const
|
|
74
|
-
async (
|
|
75
|
-
const
|
|
76
|
-
|
|
73
|
+
const S = z(
|
|
74
|
+
async (h, v, u) => {
|
|
75
|
+
const m = { content: v };
|
|
76
|
+
h.trim() && (m.title = h.trim()), u !== void 0 && (m.type = u), await o.submitFeedback(m), await i();
|
|
77
77
|
},
|
|
78
78
|
[o, i]
|
|
79
|
-
),
|
|
80
|
-
async (
|
|
79
|
+
), l = z(
|
|
80
|
+
async (h, v) => {
|
|
81
81
|
try {
|
|
82
|
-
await o.vote(
|
|
82
|
+
await o.vote(h, v), await i();
|
|
83
83
|
} catch {
|
|
84
84
|
}
|
|
85
85
|
},
|
|
86
86
|
[o, i]
|
|
87
|
-
),
|
|
88
|
-
(
|
|
87
|
+
), d = z(
|
|
88
|
+
(h) => o.getItem(h),
|
|
89
89
|
[o]
|
|
90
|
-
), C =
|
|
91
|
-
(
|
|
90
|
+
), C = z(() => r(!0), []), F = z(() => r(!1), []), T = z(
|
|
91
|
+
(h) => o.setUserId(h),
|
|
92
92
|
[o]
|
|
93
93
|
);
|
|
94
94
|
return /* @__PURE__ */ t(
|
|
95
|
-
|
|
95
|
+
G.Provider,
|
|
96
96
|
{
|
|
97
97
|
value: {
|
|
98
98
|
client: o,
|
|
99
99
|
feedItems: p,
|
|
100
100
|
loadFeed: i,
|
|
101
|
-
submit:
|
|
102
|
-
vote:
|
|
103
|
-
getItem:
|
|
104
|
-
isOpen:
|
|
101
|
+
submit: S,
|
|
102
|
+
vote: l,
|
|
103
|
+
getItem: d,
|
|
104
|
+
isOpen: y,
|
|
105
105
|
open: C,
|
|
106
|
-
close:
|
|
107
|
-
identify:
|
|
108
|
-
accentColor: e.accentColor ??
|
|
106
|
+
close: F,
|
|
107
|
+
identify: T,
|
|
108
|
+
accentColor: e.accentColor ?? ne,
|
|
109
109
|
customAccentColor: e.accentColor,
|
|
110
110
|
theme: e.theme ?? "auto",
|
|
111
111
|
colors: e.colors,
|
|
112
112
|
radius: e.radius,
|
|
113
113
|
fontFamily: e.fontFamily,
|
|
114
|
-
showBranding:
|
|
115
|
-
chat: e.chat !== !1
|
|
114
|
+
showBranding: a,
|
|
115
|
+
chat: e.chat !== !1,
|
|
116
|
+
feedback: e.feedback !== !1
|
|
116
117
|
},
|
|
117
118
|
children: n
|
|
118
119
|
}
|
|
119
120
|
);
|
|
120
121
|
}
|
|
121
|
-
function
|
|
122
|
-
const n =
|
|
122
|
+
function U() {
|
|
123
|
+
const n = ee(G);
|
|
123
124
|
if (!n) throw new Error("useUpstep must be used inside <UpstepProvider>");
|
|
124
125
|
return n;
|
|
125
126
|
}
|
|
126
|
-
function
|
|
127
|
+
function ve({
|
|
127
128
|
position: n = "bottom-right",
|
|
128
129
|
accentColor: e,
|
|
129
130
|
theme: o,
|
|
130
131
|
colors: p,
|
|
131
132
|
radius: c,
|
|
132
|
-
fontFamily:
|
|
133
|
+
fontFamily: y,
|
|
133
134
|
hideLauncher: r = !1,
|
|
134
|
-
chat:
|
|
135
|
+
chat: a = !0,
|
|
136
|
+
feedback: k
|
|
135
137
|
}) {
|
|
136
|
-
var
|
|
137
|
-
const
|
|
138
|
-
accentColor: e ??
|
|
139
|
-
colors: p ??
|
|
140
|
-
radius: c ??
|
|
141
|
-
}),
|
|
142
|
-
colors: p ??
|
|
143
|
-
radius: c ??
|
|
144
|
-
fontFamily:
|
|
138
|
+
var N;
|
|
139
|
+
const i = U(), S = (k ?? !0) && i.feedback, l = se(o ?? i.theme, {
|
|
140
|
+
accentColor: e ?? i.customAccentColor,
|
|
141
|
+
colors: p ?? i.colors,
|
|
142
|
+
radius: c ?? i.radius
|
|
143
|
+
}), d = l.accent, C = {
|
|
144
|
+
colors: p ?? i.colors,
|
|
145
|
+
radius: c ?? i.radius,
|
|
146
|
+
fontFamily: y ?? i.fontFamily
|
|
145
147
|
}, {
|
|
146
|
-
isOpen:
|
|
147
|
-
open:
|
|
148
|
-
close:
|
|
149
|
-
showBranding:
|
|
150
|
-
} =
|
|
151
|
-
|
|
152
|
-
let
|
|
153
|
-
if (
|
|
154
|
-
|
|
148
|
+
isOpen: F,
|
|
149
|
+
open: T,
|
|
150
|
+
close: h,
|
|
151
|
+
showBranding: v
|
|
152
|
+
} = i, [u, m] = x("list"), [f, M] = x(!1), W = f && a && i.chat;
|
|
153
|
+
w(() => {
|
|
154
|
+
let g = !0;
|
|
155
|
+
if (i.client.chat = i.chat, !i.chat || !a) {
|
|
156
|
+
M(!1);
|
|
155
157
|
return;
|
|
156
158
|
}
|
|
157
|
-
return
|
|
158
|
-
|
|
159
|
+
return i.client.supportEnabled().then((I) => {
|
|
160
|
+
g && M(I);
|
|
159
161
|
}), () => {
|
|
160
|
-
|
|
162
|
+
g = !1;
|
|
161
163
|
};
|
|
162
|
-
}, [
|
|
163
|
-
(!
|
|
164
|
-
}, [
|
|
165
|
-
|
|
166
|
-
}, [
|
|
167
|
-
const [
|
|
168
|
-
|
|
169
|
-
const
|
|
170
|
-
|
|
171
|
-
const
|
|
172
|
-
return
|
|
164
|
+
}, [i.client, i.chat, a]), w(() => {
|
|
165
|
+
(!i.chat || !a) && u === "support" && m("list");
|
|
166
|
+
}, [i.chat, a, u]), w(() => {
|
|
167
|
+
F && m(f && a && i.chat ? "support" : "list");
|
|
168
|
+
}, [F, f, a, i.chat]);
|
|
169
|
+
const [A, P] = x(null), [L, D] = x(!1);
|
|
170
|
+
w(() => {
|
|
171
|
+
const g = window.matchMedia("(max-width: 639px)");
|
|
172
|
+
D(g.matches);
|
|
173
|
+
const I = (Q) => D(Q.matches);
|
|
174
|
+
return g.addEventListener("change", I), () => g.removeEventListener("change", I);
|
|
173
175
|
}, []);
|
|
174
|
-
const
|
|
176
|
+
const J = {
|
|
175
177
|
position: "fixed",
|
|
176
178
|
bottom: 24,
|
|
177
179
|
right: 24
|
|
178
|
-
},
|
|
179
|
-
function
|
|
180
|
-
|
|
180
|
+
}, B = ((N = C.fontFamily) == null ? void 0 : N.trim()) || le;
|
|
181
|
+
function E() {
|
|
182
|
+
h(), P(null);
|
|
181
183
|
}
|
|
182
|
-
function
|
|
183
|
-
|
|
184
|
+
function K(g) {
|
|
185
|
+
P(g), m("detail");
|
|
184
186
|
}
|
|
185
|
-
return /* @__PURE__ */
|
|
186
|
-
!r && /* @__PURE__ */
|
|
187
|
+
return /* @__PURE__ */ s(R, { children: [
|
|
188
|
+
!r && (S || W) && /* @__PURE__ */ s(
|
|
187
189
|
"button",
|
|
188
190
|
{
|
|
189
|
-
"aria-label": "Open help and feedback",
|
|
190
|
-
onClick:
|
|
191
|
+
"aria-label": S ? "Open help and feedback" : "Open support chat",
|
|
192
|
+
onClick: T,
|
|
191
193
|
style: {
|
|
192
|
-
...
|
|
194
|
+
...J,
|
|
193
195
|
zIndex: 9998,
|
|
194
196
|
display: "inline-flex",
|
|
195
197
|
alignItems: "center",
|
|
196
198
|
gap: 7,
|
|
197
|
-
background:
|
|
198
|
-
color:
|
|
199
|
+
background: d,
|
|
200
|
+
color: l.accentText,
|
|
199
201
|
border: "none",
|
|
200
|
-
borderRadius:
|
|
201
|
-
padding:
|
|
202
|
+
borderRadius: b(9999, l.radius),
|
|
203
|
+
padding: L ? "12px" : "12px 18px",
|
|
202
204
|
fontSize: 14,
|
|
203
205
|
fontWeight: 600,
|
|
204
206
|
cursor: "pointer",
|
|
205
|
-
fontFamily:
|
|
207
|
+
fontFamily: B,
|
|
206
208
|
boxShadow: "0 6px 20px rgba(26,25,21,.18)"
|
|
207
209
|
},
|
|
208
210
|
children: [
|
|
209
|
-
/* @__PURE__ */ t(
|
|
210
|
-
!
|
|
211
|
+
/* @__PURE__ */ t(xe, { size: 16 }),
|
|
212
|
+
!L && (W ? S ? "Help & feedback" : "Help" : "Feedback")
|
|
211
213
|
]
|
|
212
214
|
}
|
|
213
215
|
),
|
|
214
|
-
|
|
216
|
+
F && (S || W) && /* @__PURE__ */ t(
|
|
215
217
|
"div",
|
|
216
218
|
{
|
|
217
|
-
onClick: (
|
|
219
|
+
onClick: (g) => g.target === g.currentTarget && E(),
|
|
218
220
|
style: {
|
|
219
221
|
position: "fixed",
|
|
220
222
|
inset: 0,
|
|
@@ -223,18 +225,18 @@ function ye({
|
|
|
223
225
|
display: "flex",
|
|
224
226
|
alignItems: "flex-end",
|
|
225
227
|
justifyContent: "flex-end",
|
|
226
|
-
padding:
|
|
227
|
-
fontFamily:
|
|
228
|
+
padding: L ? "0 12px 80px" : "0 24px 88px",
|
|
229
|
+
fontFamily: B
|
|
228
230
|
},
|
|
229
|
-
children: /* @__PURE__ */
|
|
231
|
+
children: /* @__PURE__ */ s(
|
|
230
232
|
"div",
|
|
231
233
|
{
|
|
232
234
|
style: {
|
|
233
|
-
background:
|
|
234
|
-
border: `1px solid ${
|
|
235
|
-
borderRadius:
|
|
235
|
+
background: l.bg,
|
|
236
|
+
border: `1px solid ${l.border}`,
|
|
237
|
+
borderRadius: b(20, l.radius),
|
|
236
238
|
width: "100%",
|
|
237
|
-
maxWidth:
|
|
239
|
+
maxWidth: f && a && i.chat ? 460 : 440,
|
|
238
240
|
maxHeight: "calc(100dvh - 112px)",
|
|
239
241
|
display: "flex",
|
|
240
242
|
flexDirection: "column",
|
|
@@ -242,7 +244,44 @@ function ye({
|
|
|
242
244
|
boxShadow: "0 24px 64px rgba(0,0,0,.28)"
|
|
243
245
|
},
|
|
244
246
|
children: [
|
|
245
|
-
|
|
247
|
+
W && !S ? /* @__PURE__ */ s(
|
|
248
|
+
"div",
|
|
249
|
+
{
|
|
250
|
+
style: {
|
|
251
|
+
display: "flex",
|
|
252
|
+
alignItems: "center",
|
|
253
|
+
gap: 14,
|
|
254
|
+
padding: "14px 16px 14px 20px",
|
|
255
|
+
borderBottom: `1px solid ${l.border}`,
|
|
256
|
+
flexShrink: 0
|
|
257
|
+
},
|
|
258
|
+
children: [
|
|
259
|
+
/* @__PURE__ */ t(
|
|
260
|
+
"span",
|
|
261
|
+
{
|
|
262
|
+
style: { flex: 1, fontSize: 16, fontWeight: 600, color: l.text },
|
|
263
|
+
children: "Support"
|
|
264
|
+
}
|
|
265
|
+
),
|
|
266
|
+
/* @__PURE__ */ t(
|
|
267
|
+
"button",
|
|
268
|
+
{
|
|
269
|
+
"aria-label": "Close",
|
|
270
|
+
onClick: E,
|
|
271
|
+
style: {
|
|
272
|
+
border: 0,
|
|
273
|
+
background: "transparent",
|
|
274
|
+
color: l.textSoft,
|
|
275
|
+
padding: 6,
|
|
276
|
+
cursor: "pointer",
|
|
277
|
+
fontSize: 14
|
|
278
|
+
},
|
|
279
|
+
children: "✕"
|
|
280
|
+
}
|
|
281
|
+
)
|
|
282
|
+
]
|
|
283
|
+
}
|
|
284
|
+
) : W ? /* @__PURE__ */ s(
|
|
246
285
|
"div",
|
|
247
286
|
{
|
|
248
287
|
style: {
|
|
@@ -250,41 +289,41 @@ function ye({
|
|
|
250
289
|
alignItems: "center",
|
|
251
290
|
gap: 14,
|
|
252
291
|
padding: "10px 14px",
|
|
253
|
-
borderBottom: `1px solid ${
|
|
292
|
+
borderBottom: `1px solid ${l.border}`,
|
|
254
293
|
flexShrink: 0
|
|
255
294
|
},
|
|
256
295
|
children: [
|
|
257
296
|
/* @__PURE__ */ t("div", { style: { display: "flex", flex: 1, gap: 4 }, children: [
|
|
258
297
|
["support", "Support"],
|
|
259
298
|
["list", "Ideas"]
|
|
260
|
-
].map(([
|
|
299
|
+
].map(([g, I]) => /* @__PURE__ */ t(
|
|
261
300
|
"button",
|
|
262
301
|
{
|
|
263
|
-
onClick: () =>
|
|
302
|
+
onClick: () => m(g),
|
|
264
303
|
style: {
|
|
265
304
|
flex: 1,
|
|
266
305
|
border: 0,
|
|
267
|
-
borderRadius:
|
|
306
|
+
borderRadius: b(8, l.radius),
|
|
268
307
|
padding: "9px 12px",
|
|
269
|
-
background: (
|
|
270
|
-
color: (
|
|
308
|
+
background: (u === "support" ? g === "support" : g === "list") ? l.bgSoft : "transparent",
|
|
309
|
+
color: (u === "support" ? g === "support" : g === "list") ? l.text : l.textSoft,
|
|
271
310
|
fontSize: 14,
|
|
272
311
|
fontWeight: 600,
|
|
273
312
|
cursor: "pointer"
|
|
274
313
|
},
|
|
275
|
-
children:
|
|
314
|
+
children: I
|
|
276
315
|
},
|
|
277
|
-
|
|
316
|
+
g
|
|
278
317
|
)) }),
|
|
279
318
|
/* @__PURE__ */ t(
|
|
280
319
|
"button",
|
|
281
320
|
{
|
|
282
321
|
"aria-label": "Close",
|
|
283
|
-
onClick:
|
|
322
|
+
onClick: E,
|
|
284
323
|
style: {
|
|
285
324
|
border: 0,
|
|
286
325
|
background: "transparent",
|
|
287
|
-
color:
|
|
326
|
+
color: l.textSoft,
|
|
288
327
|
padding: 6,
|
|
289
328
|
cursor: "pointer",
|
|
290
329
|
fontSize: 14
|
|
@@ -294,7 +333,7 @@ function ye({
|
|
|
294
333
|
)
|
|
295
334
|
]
|
|
296
335
|
}
|
|
297
|
-
) : /* @__PURE__ */
|
|
336
|
+
) : /* @__PURE__ */ s(
|
|
298
337
|
"div",
|
|
299
338
|
{
|
|
300
339
|
style: {
|
|
@@ -302,20 +341,20 @@ function ye({
|
|
|
302
341
|
alignItems: "center",
|
|
303
342
|
justifyContent: "space-between",
|
|
304
343
|
padding: "16px 20px",
|
|
305
|
-
borderBottom: `1px solid ${
|
|
344
|
+
borderBottom: `1px solid ${l.border}`,
|
|
306
345
|
flexShrink: 0
|
|
307
346
|
},
|
|
308
347
|
children: [
|
|
309
|
-
/* @__PURE__ */
|
|
310
|
-
|
|
348
|
+
/* @__PURE__ */ s("div", { style: { display: "flex", alignItems: "center", gap: 8 }, children: [
|
|
349
|
+
u !== "list" && /* @__PURE__ */ t(
|
|
311
350
|
"button",
|
|
312
351
|
{
|
|
313
|
-
onClick: () =>
|
|
352
|
+
onClick: () => m("list"),
|
|
314
353
|
style: {
|
|
315
354
|
background: "none",
|
|
316
355
|
border: "none",
|
|
317
356
|
cursor: "pointer",
|
|
318
|
-
color:
|
|
357
|
+
color: d,
|
|
319
358
|
fontSize: 14,
|
|
320
359
|
fontWeight: 600,
|
|
321
360
|
padding: 0
|
|
@@ -323,41 +362,41 @@ function ye({
|
|
|
323
362
|
children: "← Back"
|
|
324
363
|
}
|
|
325
364
|
),
|
|
326
|
-
|
|
365
|
+
u === "list" && /* @__PURE__ */ t(
|
|
327
366
|
"span",
|
|
328
367
|
{
|
|
329
368
|
style: {
|
|
330
369
|
fontWeight: 700,
|
|
331
370
|
fontSize: 16,
|
|
332
|
-
color:
|
|
371
|
+
color: l.text,
|
|
333
372
|
letterSpacing: "-.01em"
|
|
334
373
|
},
|
|
335
374
|
children: "Feedback"
|
|
336
375
|
}
|
|
337
376
|
),
|
|
338
|
-
|
|
377
|
+
u === "create" && /* @__PURE__ */ t(
|
|
339
378
|
"span",
|
|
340
379
|
{
|
|
341
380
|
style: {
|
|
342
381
|
fontWeight: 700,
|
|
343
382
|
fontSize: 16,
|
|
344
|
-
color:
|
|
383
|
+
color: l.text,
|
|
345
384
|
letterSpacing: "-.01em"
|
|
346
385
|
},
|
|
347
386
|
children: "New feedback"
|
|
348
387
|
}
|
|
349
388
|
)
|
|
350
389
|
] }),
|
|
351
|
-
/* @__PURE__ */
|
|
352
|
-
|
|
390
|
+
/* @__PURE__ */ s("div", { style: { display: "flex", alignItems: "center", gap: 8 }, children: [
|
|
391
|
+
u === "list" && /* @__PURE__ */ t(
|
|
353
392
|
"button",
|
|
354
393
|
{
|
|
355
|
-
onClick: () =>
|
|
394
|
+
onClick: () => m("create"),
|
|
356
395
|
style: {
|
|
357
|
-
background:
|
|
358
|
-
color:
|
|
396
|
+
background: d,
|
|
397
|
+
color: l.accentText,
|
|
359
398
|
border: "none",
|
|
360
|
-
borderRadius:
|
|
399
|
+
borderRadius: b(20, l.radius),
|
|
361
400
|
padding: "6px 14px",
|
|
362
401
|
fontSize: 14,
|
|
363
402
|
fontWeight: 700,
|
|
@@ -369,16 +408,16 @@ function ye({
|
|
|
369
408
|
/* @__PURE__ */ t(
|
|
370
409
|
"button",
|
|
371
410
|
{
|
|
372
|
-
onClick:
|
|
411
|
+
onClick: E,
|
|
373
412
|
style: {
|
|
374
|
-
background:
|
|
413
|
+
background: l.bgSoft,
|
|
375
414
|
border: "none",
|
|
376
415
|
width: 28,
|
|
377
416
|
height: 28,
|
|
378
|
-
borderRadius:
|
|
417
|
+
borderRadius: b(8, l.radius),
|
|
379
418
|
fontSize: 14,
|
|
380
419
|
cursor: "pointer",
|
|
381
|
-
color:
|
|
420
|
+
color: l.textSoft,
|
|
382
421
|
display: "flex",
|
|
383
422
|
alignItems: "center",
|
|
384
423
|
justifyContent: "center"
|
|
@@ -390,25 +429,25 @@ function ye({
|
|
|
390
429
|
]
|
|
391
430
|
}
|
|
392
431
|
),
|
|
393
|
-
/* @__PURE__ */
|
|
432
|
+
/* @__PURE__ */ s(
|
|
394
433
|
"div",
|
|
395
434
|
{
|
|
396
435
|
style: {
|
|
397
436
|
flex: 1,
|
|
398
437
|
overflowY: "auto",
|
|
399
|
-
padding:
|
|
438
|
+
padding: u === "support" ? 0 : "16px 20px 24px"
|
|
400
439
|
},
|
|
401
440
|
children: [
|
|
402
|
-
|
|
403
|
-
|
|
441
|
+
u === "support" && a && i.chat && /* @__PURE__ */ t(
|
|
442
|
+
ae,
|
|
404
443
|
{
|
|
405
|
-
client:
|
|
406
|
-
accentColor:
|
|
407
|
-
theme:
|
|
408
|
-
appearance:
|
|
444
|
+
client: i.client,
|
|
445
|
+
accentColor: d,
|
|
446
|
+
theme: l.dark ? "dark" : "light",
|
|
447
|
+
appearance: C
|
|
409
448
|
}
|
|
410
449
|
),
|
|
411
|
-
|
|
450
|
+
f && a && i.chat && u !== "support" && /* @__PURE__ */ t(
|
|
412
451
|
"div",
|
|
413
452
|
{
|
|
414
453
|
style: {
|
|
@@ -417,23 +456,23 @@ function ye({
|
|
|
417
456
|
justifyContent: "space-between",
|
|
418
457
|
marginBottom: 16
|
|
419
458
|
},
|
|
420
|
-
children:
|
|
459
|
+
children: u === "list" ? /* @__PURE__ */ s(R, { children: [
|
|
421
460
|
/* @__PURE__ */ t(
|
|
422
461
|
"span",
|
|
423
462
|
{
|
|
424
|
-
style: { fontSize: 14, fontWeight: 600, color:
|
|
463
|
+
style: { fontSize: 14, fontWeight: 600, color: l.text },
|
|
425
464
|
children: "Ideas"
|
|
426
465
|
}
|
|
427
466
|
),
|
|
428
467
|
/* @__PURE__ */ t(
|
|
429
468
|
"button",
|
|
430
469
|
{
|
|
431
|
-
onClick: () =>
|
|
470
|
+
onClick: () => m("create"),
|
|
432
471
|
style: {
|
|
433
472
|
border: 0,
|
|
434
|
-
borderRadius:
|
|
435
|
-
background:
|
|
436
|
-
color:
|
|
473
|
+
borderRadius: b(8, l.radius),
|
|
474
|
+
background: d,
|
|
475
|
+
color: l.accentText,
|
|
437
476
|
fontSize: 14,
|
|
438
477
|
padding: "7px 10px",
|
|
439
478
|
cursor: "pointer"
|
|
@@ -444,12 +483,12 @@ function ye({
|
|
|
444
483
|
] }) : /* @__PURE__ */ t(
|
|
445
484
|
"button",
|
|
446
485
|
{
|
|
447
|
-
onClick: () =>
|
|
486
|
+
onClick: () => m("list"),
|
|
448
487
|
style: {
|
|
449
488
|
border: 0,
|
|
450
489
|
background: "none",
|
|
451
490
|
padding: 0,
|
|
452
|
-
color:
|
|
491
|
+
color: l.textSoft,
|
|
453
492
|
fontSize: 14,
|
|
454
493
|
cursor: "pointer"
|
|
455
494
|
},
|
|
@@ -458,30 +497,30 @@ function ye({
|
|
|
458
497
|
)
|
|
459
498
|
}
|
|
460
499
|
),
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
500
|
+
u === "list" && /* @__PURE__ */ t(de, { onSelect: K, accent: d, p: l }),
|
|
501
|
+
u === "detail" && A && /* @__PURE__ */ t(
|
|
502
|
+
ce,
|
|
464
503
|
{
|
|
465
|
-
feedbackId:
|
|
466
|
-
accent:
|
|
467
|
-
p:
|
|
468
|
-
font:
|
|
504
|
+
feedbackId: A,
|
|
505
|
+
accent: d,
|
|
506
|
+
p: l,
|
|
507
|
+
font: B
|
|
469
508
|
}
|
|
470
509
|
),
|
|
471
|
-
|
|
472
|
-
|
|
510
|
+
u === "create" && /* @__PURE__ */ t(
|
|
511
|
+
ue,
|
|
473
512
|
{
|
|
474
|
-
accent:
|
|
475
|
-
p:
|
|
476
|
-
font:
|
|
477
|
-
ideasOnly: !!(
|
|
478
|
-
onDone: () =>
|
|
513
|
+
accent: d,
|
|
514
|
+
p: l,
|
|
515
|
+
font: B,
|
|
516
|
+
ideasOnly: !!(f && a && i.chat),
|
|
517
|
+
onDone: () => m("list")
|
|
479
518
|
}
|
|
480
519
|
)
|
|
481
520
|
]
|
|
482
521
|
}
|
|
483
522
|
),
|
|
484
|
-
|
|
523
|
+
v && u !== "support" && /* @__PURE__ */ s(
|
|
485
524
|
"a",
|
|
486
525
|
{
|
|
487
526
|
href: "https://upstep.dev",
|
|
@@ -491,9 +530,9 @@ function ye({
|
|
|
491
530
|
display: "block",
|
|
492
531
|
textAlign: "center",
|
|
493
532
|
padding: "8px 0",
|
|
494
|
-
borderTop: `1px solid ${
|
|
533
|
+
borderTop: `1px solid ${l.border}`,
|
|
495
534
|
fontSize: 11,
|
|
496
|
-
color:
|
|
535
|
+
color: l.textFaint,
|
|
497
536
|
textDecoration: "none",
|
|
498
537
|
flexShrink: 0
|
|
499
538
|
},
|
|
@@ -511,14 +550,14 @@ function ye({
|
|
|
511
550
|
)
|
|
512
551
|
] });
|
|
513
552
|
}
|
|
514
|
-
function
|
|
553
|
+
function ae({
|
|
515
554
|
client: n,
|
|
516
555
|
theme: e,
|
|
517
556
|
accentColor: o,
|
|
518
557
|
appearance: p
|
|
519
558
|
}) {
|
|
520
|
-
const c =
|
|
521
|
-
return
|
|
559
|
+
const c = te(null);
|
|
560
|
+
return w(() => {
|
|
522
561
|
if (c.current) return n.connectSupportFrame(c.current);
|
|
523
562
|
}, [n]), /* @__PURE__ */ t(
|
|
524
563
|
"iframe",
|
|
@@ -538,15 +577,15 @@ function ie({
|
|
|
538
577
|
}
|
|
539
578
|
);
|
|
540
579
|
}
|
|
541
|
-
function
|
|
580
|
+
function de({
|
|
542
581
|
onSelect: n,
|
|
543
582
|
accent: e,
|
|
544
583
|
p: o
|
|
545
584
|
}) {
|
|
546
|
-
const { feedItems: p, vote: c } =
|
|
547
|
-
return
|
|
548
|
-
const
|
|
549
|
-
return /* @__PURE__ */
|
|
585
|
+
const { feedItems: p, vote: c } = U(), y = p.filter((r) => r.status !== "CLOSED");
|
|
586
|
+
return y.length ? /* @__PURE__ */ t(R, { children: y.map((r) => {
|
|
587
|
+
const a = r.userVote === "UP", k = r.title ?? r.content;
|
|
588
|
+
return /* @__PURE__ */ s(
|
|
550
589
|
"div",
|
|
551
590
|
{
|
|
552
591
|
onClick: () => n(r.id),
|
|
@@ -555,13 +594,13 @@ function le({
|
|
|
555
594
|
gap: 12,
|
|
556
595
|
padding: 14,
|
|
557
596
|
border: `1px solid ${o.border}`,
|
|
558
|
-
borderRadius:
|
|
597
|
+
borderRadius: b(14, o.radius),
|
|
559
598
|
marginBottom: 10,
|
|
560
599
|
background: o.bg,
|
|
561
600
|
cursor: "pointer"
|
|
562
601
|
},
|
|
563
602
|
children: [
|
|
564
|
-
/* @__PURE__ */
|
|
603
|
+
/* @__PURE__ */ s(
|
|
565
604
|
"button",
|
|
566
605
|
{
|
|
567
606
|
onClick: (i) => {
|
|
@@ -575,14 +614,14 @@ function le({
|
|
|
575
614
|
gap: 2,
|
|
576
615
|
minWidth: 46,
|
|
577
616
|
padding: "7px 0",
|
|
578
|
-
borderRadius:
|
|
617
|
+
borderRadius: b(11, o.radius),
|
|
579
618
|
cursor: "pointer",
|
|
580
619
|
flexShrink: 0,
|
|
581
|
-
border: `1px solid ${
|
|
582
|
-
background:
|
|
620
|
+
border: `1px solid ${a ? e : o.border}`,
|
|
621
|
+
background: a ? o.accentTint : o.bgSoft
|
|
583
622
|
},
|
|
584
623
|
children: [
|
|
585
|
-
/* @__PURE__ */ t(
|
|
624
|
+
/* @__PURE__ */ t(Y, { color: e }),
|
|
586
625
|
/* @__PURE__ */ t(
|
|
587
626
|
"span",
|
|
588
627
|
{
|
|
@@ -598,7 +637,7 @@ function le({
|
|
|
598
637
|
]
|
|
599
638
|
}
|
|
600
639
|
),
|
|
601
|
-
/* @__PURE__ */
|
|
640
|
+
/* @__PURE__ */ s("div", { style: { flex: 1, minWidth: 0 }, children: [
|
|
602
641
|
/* @__PURE__ */ t(
|
|
603
642
|
"p",
|
|
604
643
|
{
|
|
@@ -613,10 +652,10 @@ function le({
|
|
|
613
652
|
WebkitLineClamp: 2,
|
|
614
653
|
WebkitBoxOrient: "vertical"
|
|
615
654
|
},
|
|
616
|
-
children:
|
|
655
|
+
children: k
|
|
617
656
|
}
|
|
618
657
|
),
|
|
619
|
-
/* @__PURE__ */
|
|
658
|
+
/* @__PURE__ */ s(
|
|
620
659
|
"div",
|
|
621
660
|
{
|
|
622
661
|
style: {
|
|
@@ -626,16 +665,16 @@ function le({
|
|
|
626
665
|
flexWrap: "wrap"
|
|
627
666
|
},
|
|
628
667
|
children: [
|
|
629
|
-
/* @__PURE__ */ t(
|
|
630
|
-
r.status === "PENDING" ? /* @__PURE__ */ t(
|
|
631
|
-
|
|
668
|
+
/* @__PURE__ */ t(O, { type: r.type, p: o }),
|
|
669
|
+
r.status === "PENDING" ? /* @__PURE__ */ t(V, {}) : /* @__PURE__ */ t(
|
|
670
|
+
_,
|
|
632
671
|
{
|
|
633
672
|
status: r.status,
|
|
634
673
|
boardStatus: r.boardStatus,
|
|
635
674
|
p: o
|
|
636
675
|
}
|
|
637
676
|
),
|
|
638
|
-
/* @__PURE__ */ t("span", { style: { fontSize: 11, color: o.textFaint }, children:
|
|
677
|
+
/* @__PURE__ */ t("span", { style: { fontSize: 11, color: o.textFaint }, children: q(r.createdAt) })
|
|
639
678
|
]
|
|
640
679
|
}
|
|
641
680
|
)
|
|
@@ -656,7 +695,7 @@ function le({
|
|
|
656
695
|
},
|
|
657
696
|
r.id
|
|
658
697
|
);
|
|
659
|
-
}) }) : /* @__PURE__ */
|
|
698
|
+
}) }) : /* @__PURE__ */ s("div", { style: { textAlign: "center", padding: "40px 0" }, children: [
|
|
660
699
|
/* @__PURE__ */ t(
|
|
661
700
|
"div",
|
|
662
701
|
{
|
|
@@ -672,29 +711,29 @@ function le({
|
|
|
672
711
|
/* @__PURE__ */ t("div", { style: { color: o.textFaint, fontSize: 14 }, children: "Be the first to share one." })
|
|
673
712
|
] });
|
|
674
713
|
}
|
|
675
|
-
function
|
|
714
|
+
function ce({
|
|
676
715
|
feedbackId: n,
|
|
677
716
|
accent: e,
|
|
678
717
|
p: o,
|
|
679
718
|
font: p
|
|
680
719
|
}) {
|
|
681
|
-
const { vote: c, getItem:
|
|
682
|
-
|
|
683
|
-
let
|
|
684
|
-
return
|
|
685
|
-
|
|
720
|
+
const { vote: c, getItem: y } = U(), [r, a] = x(null), [k, i] = x(!1);
|
|
721
|
+
w(() => {
|
|
722
|
+
let d = !1;
|
|
723
|
+
return y(n).then((C) => {
|
|
724
|
+
d || a(C);
|
|
686
725
|
}).catch(() => {
|
|
687
726
|
}), () => {
|
|
688
|
-
|
|
727
|
+
d = !0;
|
|
689
728
|
};
|
|
690
|
-
}, [n,
|
|
691
|
-
async function
|
|
692
|
-
if (!(!r ||
|
|
729
|
+
}, [n, y]);
|
|
730
|
+
async function S() {
|
|
731
|
+
if (!(!r || k)) {
|
|
693
732
|
i(!0);
|
|
694
733
|
try {
|
|
695
734
|
await c(r.id, "UP");
|
|
696
|
-
const
|
|
697
|
-
d
|
|
735
|
+
const d = await y(n);
|
|
736
|
+
a(d);
|
|
698
737
|
} catch {
|
|
699
738
|
} finally {
|
|
700
739
|
i(!1);
|
|
@@ -714,9 +753,9 @@ function se({
|
|
|
714
753
|
children: "Loading…"
|
|
715
754
|
}
|
|
716
755
|
);
|
|
717
|
-
const
|
|
718
|
-
return /* @__PURE__ */
|
|
719
|
-
|
|
756
|
+
const l = r.title;
|
|
757
|
+
return /* @__PURE__ */ s("div", { children: [
|
|
758
|
+
l && /* @__PURE__ */ t(
|
|
720
759
|
"div",
|
|
721
760
|
{
|
|
722
761
|
style: {
|
|
@@ -727,17 +766,17 @@ function se({
|
|
|
727
766
|
marginBottom: 10,
|
|
728
767
|
lineHeight: 1.3
|
|
729
768
|
},
|
|
730
|
-
children:
|
|
769
|
+
children: l
|
|
731
770
|
}
|
|
732
771
|
),
|
|
733
|
-
/* @__PURE__ */
|
|
772
|
+
/* @__PURE__ */ s(
|
|
734
773
|
"div",
|
|
735
774
|
{
|
|
736
775
|
style: { display: "flex", gap: 6, marginBottom: 14, flexWrap: "wrap" },
|
|
737
776
|
children: [
|
|
738
|
-
/* @__PURE__ */ t(
|
|
739
|
-
r.status === "PENDING" ? /* @__PURE__ */ t(
|
|
740
|
-
|
|
777
|
+
/* @__PURE__ */ t(O, { type: r.type, p: o }),
|
|
778
|
+
r.status === "PENDING" ? /* @__PURE__ */ t(V, {}) : /* @__PURE__ */ t(
|
|
779
|
+
_,
|
|
741
780
|
{
|
|
742
781
|
status: r.status,
|
|
743
782
|
boardStatus: r.boardStatus,
|
|
@@ -759,30 +798,30 @@ function se({
|
|
|
759
798
|
children: r.content
|
|
760
799
|
}
|
|
761
800
|
),
|
|
762
|
-
/* @__PURE__ */
|
|
801
|
+
/* @__PURE__ */ s(
|
|
763
802
|
"button",
|
|
764
803
|
{
|
|
765
|
-
onClick:
|
|
766
|
-
disabled:
|
|
804
|
+
onClick: S,
|
|
805
|
+
disabled: k,
|
|
767
806
|
style: {
|
|
768
807
|
display: "inline-flex",
|
|
769
808
|
alignItems: "center",
|
|
770
809
|
gap: 8,
|
|
771
810
|
border: `1px solid ${r.userVote === "UP" ? e : o.border}`,
|
|
772
|
-
background: r.userVote === "UP" ?
|
|
773
|
-
borderRadius:
|
|
811
|
+
background: r.userVote === "UP" ? j(e, 0.08) : o.bgSoft,
|
|
812
|
+
borderRadius: b(12, o.radius),
|
|
774
813
|
padding: "10px 16px",
|
|
775
814
|
cursor: "pointer",
|
|
776
815
|
fontFamily: p
|
|
777
816
|
},
|
|
778
817
|
children: [
|
|
779
|
-
/* @__PURE__ */ t(
|
|
818
|
+
/* @__PURE__ */ t(Y, { color: e, size: 13 }),
|
|
780
819
|
/* @__PURE__ */ t("span", { style: { fontSize: 18, fontWeight: 700, color: o.text }, children: r.upvotes }),
|
|
781
820
|
/* @__PURE__ */ t("span", { style: { fontSize: 14, color: o.textFaint }, children: r.userVote === "UP" ? "Upvoted" : "Upvote" })
|
|
782
821
|
]
|
|
783
822
|
}
|
|
784
823
|
),
|
|
785
|
-
r.comments.length > 0 && /* @__PURE__ */
|
|
824
|
+
r.comments.length > 0 && /* @__PURE__ */ s(
|
|
786
825
|
"div",
|
|
787
826
|
{
|
|
788
827
|
style: {
|
|
@@ -805,30 +844,30 @@ function se({
|
|
|
805
844
|
children: "Comments"
|
|
806
845
|
}
|
|
807
846
|
),
|
|
808
|
-
r.comments.map((
|
|
847
|
+
r.comments.map((d) => /* @__PURE__ */ t(pe, { comment: d, p: o, accent: e }, d.id))
|
|
809
848
|
]
|
|
810
849
|
}
|
|
811
850
|
)
|
|
812
851
|
] });
|
|
813
852
|
}
|
|
814
|
-
function
|
|
853
|
+
function pe({
|
|
815
854
|
comment: n,
|
|
816
855
|
p: e,
|
|
817
856
|
accent: o
|
|
818
857
|
}) {
|
|
819
858
|
var p;
|
|
820
|
-
return /* @__PURE__ */
|
|
859
|
+
return /* @__PURE__ */ s(
|
|
821
860
|
"div",
|
|
822
861
|
{
|
|
823
862
|
style: {
|
|
824
863
|
background: e.bgSoft,
|
|
825
864
|
border: `1px solid ${e.border}`,
|
|
826
|
-
borderRadius:
|
|
865
|
+
borderRadius: b(12, e.radius),
|
|
827
866
|
padding: 14,
|
|
828
867
|
marginBottom: 10
|
|
829
868
|
},
|
|
830
869
|
children: [
|
|
831
|
-
/* @__PURE__ */
|
|
870
|
+
/* @__PURE__ */ s(
|
|
832
871
|
"div",
|
|
833
872
|
{
|
|
834
873
|
style: {
|
|
@@ -842,17 +881,17 @@ function ae({
|
|
|
842
881
|
"span",
|
|
843
882
|
{
|
|
844
883
|
style: {
|
|
845
|
-
background:
|
|
884
|
+
background: j(o, 0.125),
|
|
846
885
|
color: o,
|
|
847
886
|
fontSize: 11,
|
|
848
887
|
fontWeight: 700,
|
|
849
|
-
borderRadius:
|
|
888
|
+
borderRadius: b(20, e.radius),
|
|
850
889
|
padding: "2px 8px"
|
|
851
890
|
},
|
|
852
891
|
children: ((p = n.authorName) == null ? void 0 : p.trim()) || "UpStep Team"
|
|
853
892
|
}
|
|
854
893
|
),
|
|
855
|
-
/* @__PURE__ */ t("span", { style: { fontSize: 11, color: e.textFaint }, children:
|
|
894
|
+
/* @__PURE__ */ t("span", { style: { fontSize: 11, color: e.textFaint }, children: q(n.createdAt) })
|
|
856
895
|
]
|
|
857
896
|
}
|
|
858
897
|
),
|
|
@@ -867,30 +906,30 @@ function ae({
|
|
|
867
906
|
}
|
|
868
907
|
);
|
|
869
908
|
}
|
|
870
|
-
function
|
|
909
|
+
function ue({
|
|
871
910
|
accent: n,
|
|
872
911
|
p: e,
|
|
873
912
|
font: o,
|
|
874
913
|
onDone: p,
|
|
875
914
|
ideasOnly: c = !1
|
|
876
915
|
}) {
|
|
877
|
-
const { submit:
|
|
916
|
+
const { submit: y } = U(), [r, a] = x(""), [k, i] = x(""), [S, l] = x(
|
|
878
917
|
c ? "FEATURE" : "GENERAL"
|
|
879
|
-
), [
|
|
880
|
-
async function
|
|
881
|
-
if (!(!r.trim() ||
|
|
882
|
-
C(!0),
|
|
918
|
+
), [d, C] = x(!1), [F, T] = x(!1), [h, v] = x("");
|
|
919
|
+
async function u() {
|
|
920
|
+
if (!(!r.trim() || d)) {
|
|
921
|
+
C(!0), v("");
|
|
883
922
|
try {
|
|
884
|
-
await
|
|
923
|
+
await y(r.trim(), k.trim() || r.trim(), S), T(!0), setTimeout(p, 1200);
|
|
885
924
|
} catch {
|
|
886
|
-
|
|
925
|
+
v("Something went wrong. Please try again.");
|
|
887
926
|
} finally {
|
|
888
927
|
C(!1);
|
|
889
928
|
}
|
|
890
929
|
}
|
|
891
930
|
}
|
|
892
|
-
if (
|
|
893
|
-
return /* @__PURE__ */
|
|
931
|
+
if (F)
|
|
932
|
+
return /* @__PURE__ */ s("div", { style: { textAlign: "center", paddingTop: 40 }, children: [
|
|
894
933
|
/* @__PURE__ */ t(
|
|
895
934
|
"div",
|
|
896
935
|
{
|
|
@@ -905,10 +944,10 @@ function de({
|
|
|
905
944
|
),
|
|
906
945
|
/* @__PURE__ */ t("div", { style: { fontSize: 14, color: e.textFaint }, children: c ? "Idea received. Thank you." : "Feedback received. Thank you." })
|
|
907
946
|
] });
|
|
908
|
-
const
|
|
947
|
+
const m = {
|
|
909
948
|
width: "100%",
|
|
910
949
|
border: `1px solid ${e.border}`,
|
|
911
|
-
borderRadius:
|
|
950
|
+
borderRadius: b(12, e.radius),
|
|
912
951
|
padding: "10px 12px",
|
|
913
952
|
fontSize: 16,
|
|
914
953
|
lineHeight: 1.6,
|
|
@@ -918,8 +957,8 @@ function de({
|
|
|
918
957
|
fontFamily: o,
|
|
919
958
|
boxSizing: "border-box"
|
|
920
959
|
};
|
|
921
|
-
return /* @__PURE__ */
|
|
922
|
-
!c && /* @__PURE__ */
|
|
960
|
+
return /* @__PURE__ */ s("div", { children: [
|
|
961
|
+
!c && /* @__PURE__ */ s(R, { children: [
|
|
923
962
|
/* @__PURE__ */ t(
|
|
924
963
|
"div",
|
|
925
964
|
{
|
|
@@ -934,10 +973,10 @@ function de({
|
|
|
934
973
|
children: "Type"
|
|
935
974
|
}
|
|
936
975
|
),
|
|
937
|
-
/* @__PURE__ */ t("div", { style: { display: "flex", gap: 7, marginBottom: 16 }, children: ["BUG", "FEATURE", "GENERAL"].map((
|
|
976
|
+
/* @__PURE__ */ t("div", { style: { display: "flex", gap: 7, marginBottom: 16 }, children: ["BUG", "FEATURE", "GENERAL"].map((f) => /* @__PURE__ */ s(
|
|
938
977
|
"button",
|
|
939
978
|
{
|
|
940
|
-
onClick: () =>
|
|
979
|
+
onClick: () => l(f),
|
|
941
980
|
style: {
|
|
942
981
|
flex: 1,
|
|
943
982
|
display: "flex",
|
|
@@ -945,21 +984,21 @@ function de({
|
|
|
945
984
|
justifyContent: "center",
|
|
946
985
|
gap: 5,
|
|
947
986
|
padding: "8px 10px",
|
|
948
|
-
borderRadius:
|
|
987
|
+
borderRadius: b(9, e.radius),
|
|
949
988
|
fontSize: 14,
|
|
950
989
|
fontWeight: 600,
|
|
951
990
|
cursor: "pointer",
|
|
952
|
-
background:
|
|
953
|
-
color:
|
|
954
|
-
border: `1px solid ${
|
|
991
|
+
background: S === f ? n : e.bg,
|
|
992
|
+
color: S === f ? e.accentText : e.textSoft,
|
|
993
|
+
border: `1px solid ${S === f ? n : e.border}`,
|
|
955
994
|
fontFamily: o
|
|
956
995
|
},
|
|
957
996
|
children: [
|
|
958
|
-
|
|
959
|
-
|
|
997
|
+
$[f].icon,
|
|
998
|
+
$[f].label
|
|
960
999
|
]
|
|
961
1000
|
},
|
|
962
|
-
|
|
1001
|
+
f
|
|
963
1002
|
)) })
|
|
964
1003
|
] }),
|
|
965
1004
|
/* @__PURE__ */ t(
|
|
@@ -980,13 +1019,13 @@ function de({
|
|
|
980
1019
|
"input",
|
|
981
1020
|
{
|
|
982
1021
|
value: r,
|
|
983
|
-
onChange: (
|
|
1022
|
+
onChange: (f) => a(f.target.value),
|
|
984
1023
|
placeholder: c ? "What would you like us to build?" : "Short summary of the issue or idea",
|
|
985
1024
|
maxLength: 200,
|
|
986
|
-
style: { ...
|
|
1025
|
+
style: { ...m, marginBottom: 16, display: "block" }
|
|
987
1026
|
}
|
|
988
1027
|
),
|
|
989
|
-
/* @__PURE__ */
|
|
1028
|
+
/* @__PURE__ */ s(
|
|
990
1029
|
"div",
|
|
991
1030
|
{
|
|
992
1031
|
style: {
|
|
@@ -1013,42 +1052,42 @@ function de({
|
|
|
1013
1052
|
/* @__PURE__ */ t(
|
|
1014
1053
|
"textarea",
|
|
1015
1054
|
{
|
|
1016
|
-
value:
|
|
1017
|
-
onChange: (
|
|
1055
|
+
value: k,
|
|
1056
|
+
onChange: (f) => i(f.target.value),
|
|
1018
1057
|
placeholder: c ? "Why would it help? (optional)" : "Steps to reproduce, expected behaviour, or more context",
|
|
1019
1058
|
maxLength: 2e3,
|
|
1020
1059
|
rows: 4,
|
|
1021
|
-
style: { ...
|
|
1060
|
+
style: { ...m, resize: "vertical", marginBottom: 16 }
|
|
1022
1061
|
}
|
|
1023
1062
|
),
|
|
1024
|
-
|
|
1063
|
+
h && /* @__PURE__ */ t("p", { style: { fontSize: 14, color: "#d6453d", marginBottom: 12 }, children: h }),
|
|
1025
1064
|
/* @__PURE__ */ t(
|
|
1026
1065
|
"button",
|
|
1027
1066
|
{
|
|
1028
|
-
onClick:
|
|
1029
|
-
disabled:
|
|
1067
|
+
onClick: u,
|
|
1068
|
+
disabled: d || !r.trim(),
|
|
1030
1069
|
style: {
|
|
1031
1070
|
width: "100%",
|
|
1032
1071
|
padding: 12,
|
|
1033
1072
|
background: n,
|
|
1034
1073
|
color: e.accentText,
|
|
1035
1074
|
border: "none",
|
|
1036
|
-
borderRadius:
|
|
1075
|
+
borderRadius: b(11, e.radius),
|
|
1037
1076
|
fontSize: 14,
|
|
1038
1077
|
fontWeight: 600,
|
|
1039
1078
|
cursor: "pointer",
|
|
1040
|
-
opacity:
|
|
1079
|
+
opacity: d || !r.trim() ? 0.5 : 1,
|
|
1041
1080
|
fontFamily: o
|
|
1042
1081
|
},
|
|
1043
|
-
children:
|
|
1082
|
+
children: d ? "Submitting…" : c ? "Suggest idea" : "Submit feedback"
|
|
1044
1083
|
}
|
|
1045
1084
|
)
|
|
1046
1085
|
] });
|
|
1047
1086
|
}
|
|
1048
|
-
const
|
|
1087
|
+
const $ = {
|
|
1049
1088
|
BUG: {
|
|
1050
1089
|
label: "Bug",
|
|
1051
|
-
icon: /* @__PURE__ */
|
|
1090
|
+
icon: /* @__PURE__ */ s(
|
|
1052
1091
|
"svg",
|
|
1053
1092
|
{
|
|
1054
1093
|
width: 12,
|
|
@@ -1068,7 +1107,7 @@ const D = {
|
|
|
1068
1107
|
},
|
|
1069
1108
|
FEATURE: {
|
|
1070
1109
|
label: "Feature",
|
|
1071
|
-
icon: /* @__PURE__ */
|
|
1110
|
+
icon: /* @__PURE__ */ s(
|
|
1072
1111
|
"svg",
|
|
1073
1112
|
{
|
|
1074
1113
|
width: 12,
|
|
@@ -1103,32 +1142,32 @@ const D = {
|
|
|
1103
1142
|
}
|
|
1104
1143
|
)
|
|
1105
1144
|
}
|
|
1106
|
-
},
|
|
1107
|
-
function
|
|
1145
|
+
}, he = { BUG: "#fdecec", FEATURE: "#e9f0fd" }, fe = { BUG: "#d6453d", FEATURE: "#3b76d6" };
|
|
1146
|
+
function O({ type: n, p: e }) {
|
|
1108
1147
|
return /* @__PURE__ */ t(
|
|
1109
1148
|
"span",
|
|
1110
1149
|
{
|
|
1111
1150
|
style: {
|
|
1112
1151
|
padding: "2px 8px",
|
|
1113
|
-
borderRadius:
|
|
1152
|
+
borderRadius: b(9999, e.radius),
|
|
1114
1153
|
fontSize: 10.5,
|
|
1115
1154
|
fontWeight: 700,
|
|
1116
1155
|
letterSpacing: ".02em",
|
|
1117
|
-
background:
|
|
1118
|
-
color:
|
|
1156
|
+
background: he[n] ?? e.bgSoft,
|
|
1157
|
+
color: fe[n] ?? e.textSoft
|
|
1119
1158
|
},
|
|
1120
1159
|
children: n
|
|
1121
1160
|
}
|
|
1122
1161
|
);
|
|
1123
1162
|
}
|
|
1124
|
-
const
|
|
1163
|
+
const ge = {
|
|
1125
1164
|
OPEN: "#b45309",
|
|
1126
1165
|
IN_PROGRESS: "#1d4ed8",
|
|
1127
1166
|
DONE: "#15803d",
|
|
1128
1167
|
CLOSED: "#6b7280"
|
|
1129
1168
|
};
|
|
1130
|
-
function
|
|
1131
|
-
return /* @__PURE__ */
|
|
1169
|
+
function V() {
|
|
1170
|
+
return /* @__PURE__ */ s(
|
|
1132
1171
|
"span",
|
|
1133
1172
|
{
|
|
1134
1173
|
style: {
|
|
@@ -1161,13 +1200,13 @@ function j() {
|
|
|
1161
1200
|
}
|
|
1162
1201
|
);
|
|
1163
1202
|
}
|
|
1164
|
-
function
|
|
1203
|
+
function _({
|
|
1165
1204
|
status: n,
|
|
1166
1205
|
boardStatus: e,
|
|
1167
1206
|
p: o
|
|
1168
1207
|
}) {
|
|
1169
|
-
const p = (e == null ? void 0 : e.color) ??
|
|
1170
|
-
return /* @__PURE__ */
|
|
1208
|
+
const p = (e == null ? void 0 : e.color) ?? ge[n] ?? "#9ca3af";
|
|
1209
|
+
return /* @__PURE__ */ s(
|
|
1171
1210
|
"span",
|
|
1172
1211
|
{
|
|
1173
1212
|
style: {
|
|
@@ -1176,7 +1215,7 @@ function G({
|
|
|
1176
1215
|
gap: 5,
|
|
1177
1216
|
background: o.bgSoft,
|
|
1178
1217
|
border: `1px solid ${o.border}`,
|
|
1179
|
-
borderRadius:
|
|
1218
|
+
borderRadius: b(6, o.radius),
|
|
1180
1219
|
padding: "2px 8px",
|
|
1181
1220
|
fontSize: 10,
|
|
1182
1221
|
fontWeight: 600,
|
|
@@ -1201,7 +1240,7 @@ function G({
|
|
|
1201
1240
|
}
|
|
1202
1241
|
);
|
|
1203
1242
|
}
|
|
1204
|
-
function
|
|
1243
|
+
function xe({
|
|
1205
1244
|
size: n = 16,
|
|
1206
1245
|
color: e = "currentColor"
|
|
1207
1246
|
}) {
|
|
@@ -1220,7 +1259,7 @@ function he({
|
|
|
1220
1259
|
}
|
|
1221
1260
|
);
|
|
1222
1261
|
}
|
|
1223
|
-
function
|
|
1262
|
+
function Y({
|
|
1224
1263
|
color: n = "currentColor",
|
|
1225
1264
|
size: e = 11
|
|
1226
1265
|
}) {
|
|
@@ -1239,14 +1278,14 @@ function O({
|
|
|
1239
1278
|
}
|
|
1240
1279
|
);
|
|
1241
1280
|
}
|
|
1242
|
-
function
|
|
1281
|
+
function q(n) {
|
|
1243
1282
|
return new Date(n).toLocaleDateString(void 0, {
|
|
1244
1283
|
month: "short",
|
|
1245
1284
|
day: "numeric"
|
|
1246
1285
|
});
|
|
1247
1286
|
}
|
|
1248
1287
|
export {
|
|
1249
|
-
|
|
1250
|
-
|
|
1251
|
-
|
|
1288
|
+
ve as FeedbackWidget,
|
|
1289
|
+
ke as UpstepProvider,
|
|
1290
|
+
U as useUpstep
|
|
1252
1291
|
};
|