@upstep/js 0.9.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 +59 -46
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +164 -137
- 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 +466 -421
- package/dist/support.cjs +1 -1
- package/dist/support.d.ts +10 -1
- package/dist/support.d.ts.map +1 -1
- package/dist/support.js +50 -33
- package/dist/upstep.global.js +27 -14
- package/dist/widget.d.ts +4 -0
- package/dist/widget.d.ts.map +1 -1
- package/package.json +2 -2
package/dist/react.js
CHANGED
|
@@ -1,204 +1,206 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import
|
|
3
|
-
import { U as
|
|
4
|
-
import { scaleRadius as b, DEFAULT_ACCENT 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
|
-
const
|
|
12
|
-
return
|
|
11
|
+
const n = document.documentElement;
|
|
12
|
+
return n.classList.contains("dark") || n.getAttribute("data-theme") === "dark";
|
|
13
13
|
}
|
|
14
|
-
function
|
|
15
|
-
const [
|
|
16
|
-
|
|
17
|
-
if (
|
|
18
|
-
|
|
14
|
+
function se(n, e) {
|
|
15
|
+
const [o, p] = x(() => n === "dark");
|
|
16
|
+
w(() => {
|
|
17
|
+
if (n !== "auto") {
|
|
18
|
+
p(n === "dark");
|
|
19
19
|
return;
|
|
20
20
|
}
|
|
21
|
-
if (
|
|
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
|
-
}), () =>
|
|
27
|
-
}, [
|
|
28
|
-
const { accentColor:
|
|
29
|
-
return
|
|
30
|
-
() =>
|
|
31
|
-
mode:
|
|
32
|
-
accentColor:
|
|
33
|
-
colors:
|
|
34
|
-
radius:
|
|
26
|
+
}), () => a.disconnect();
|
|
27
|
+
}, [n]);
|
|
28
|
+
const { accentColor: c, colors: y, radius: r } = e;
|
|
29
|
+
return X.useMemo(
|
|
30
|
+
() => re({
|
|
31
|
+
mode: o ? "dark" : "light",
|
|
32
|
+
accentColor: c,
|
|
33
|
+
colors: y,
|
|
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
|
-
[
|
|
38
|
+
[o, c, JSON.stringify(y ?? null), r]
|
|
39
39
|
);
|
|
40
40
|
}
|
|
41
|
-
const
|
|
42
|
-
function
|
|
43
|
-
children:
|
|
41
|
+
const G = Z(null);
|
|
42
|
+
function ke({
|
|
43
|
+
children: n,
|
|
44
44
|
...e
|
|
45
45
|
}) {
|
|
46
|
-
const [
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
}, [
|
|
50
|
-
|
|
51
|
-
(
|
|
52
|
-
var
|
|
53
|
-
return (
|
|
46
|
+
const [o] = x(() => new oe(e)), [p, c] = x([]), [y, r] = x(!1), [a, k] = x(!0);
|
|
47
|
+
w(() => {
|
|
48
|
+
o.setUserId(e.userId);
|
|
49
|
+
}, [o, e.userId]), w(() => {
|
|
50
|
+
o.supportIdentityToken = e.supportIdentityToken, document.querySelectorAll("iframe[data-upstep-support]").forEach(
|
|
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
|
|
57
57
|
},
|
|
58
|
-
new URL(
|
|
58
|
+
new URL(o.baseUrl).origin
|
|
59
59
|
);
|
|
60
60
|
}
|
|
61
61
|
);
|
|
62
|
-
}, [
|
|
63
|
-
const
|
|
62
|
+
}, [o, e.supportIdentityToken]);
|
|
63
|
+
const i = z(async () => {
|
|
64
64
|
try {
|
|
65
|
-
const
|
|
66
|
-
|
|
65
|
+
const h = await o.listFeedback({ sort: "votes", limit: 20 });
|
|
66
|
+
c(h.items), k(h.showBranding ?? !0);
|
|
67
67
|
} catch {
|
|
68
68
|
}
|
|
69
|
-
}, [
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
}, [
|
|
73
|
-
const
|
|
74
|
-
async (
|
|
75
|
-
const
|
|
76
|
-
|
|
69
|
+
}, [o]);
|
|
70
|
+
w(() => {
|
|
71
|
+
i();
|
|
72
|
+
}, [i]);
|
|
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
|
-
[
|
|
79
|
-
),
|
|
80
|
-
async (
|
|
78
|
+
[o, i]
|
|
79
|
+
), l = z(
|
|
80
|
+
async (h, v) => {
|
|
81
81
|
try {
|
|
82
|
-
await
|
|
82
|
+
await o.vote(h, v), await i();
|
|
83
83
|
} catch {
|
|
84
84
|
}
|
|
85
85
|
},
|
|
86
|
-
[
|
|
87
|
-
),
|
|
88
|
-
(
|
|
89
|
-
[
|
|
90
|
-
),
|
|
91
|
-
(
|
|
92
|
-
[
|
|
86
|
+
[o, i]
|
|
87
|
+
), d = z(
|
|
88
|
+
(h) => o.getItem(h),
|
|
89
|
+
[o]
|
|
90
|
+
), C = z(() => r(!0), []), F = z(() => r(!1), []), T = z(
|
|
91
|
+
(h) => o.setUserId(h),
|
|
92
|
+
[o]
|
|
93
93
|
);
|
|
94
94
|
return /* @__PURE__ */ t(
|
|
95
|
-
|
|
95
|
+
G.Provider,
|
|
96
96
|
{
|
|
97
97
|
value: {
|
|
98
|
-
client:
|
|
99
|
-
feedItems:
|
|
100
|
-
loadFeed:
|
|
101
|
-
submit:
|
|
102
|
-
vote:
|
|
103
|
-
getItem:
|
|
104
|
-
isOpen:
|
|
105
|
-
open:
|
|
106
|
-
close:
|
|
107
|
-
identify:
|
|
108
|
-
accentColor: e.accentColor ??
|
|
98
|
+
client: o,
|
|
99
|
+
feedItems: p,
|
|
100
|
+
loadFeed: i,
|
|
101
|
+
submit: S,
|
|
102
|
+
vote: l,
|
|
103
|
+
getItem: d,
|
|
104
|
+
isOpen: y,
|
|
105
|
+
open: C,
|
|
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
|
-
children:
|
|
118
|
+
children: n
|
|
118
119
|
}
|
|
119
120
|
);
|
|
120
121
|
}
|
|
121
|
-
function
|
|
122
|
-
const
|
|
123
|
-
if (!
|
|
124
|
-
return
|
|
122
|
+
function U() {
|
|
123
|
+
const n = ee(G);
|
|
124
|
+
if (!n) throw new Error("useUpstep must be used inside <UpstepProvider>");
|
|
125
|
+
return n;
|
|
125
126
|
}
|
|
126
|
-
function
|
|
127
|
-
position:
|
|
127
|
+
function ve({
|
|
128
|
+
position: n = "bottom-right",
|
|
128
129
|
accentColor: e,
|
|
129
|
-
theme:
|
|
130
|
-
colors:
|
|
131
|
-
radius:
|
|
132
|
-
fontFamily:
|
|
133
|
-
hideLauncher:
|
|
134
|
-
chat:
|
|
130
|
+
theme: o,
|
|
131
|
+
colors: p,
|
|
132
|
+
radius: c,
|
|
133
|
+
fontFamily: y,
|
|
134
|
+
hideLauncher: r = !1,
|
|
135
|
+
chat: a = !0,
|
|
136
|
+
feedback: k
|
|
135
137
|
}) {
|
|
136
|
-
var
|
|
137
|
-
const
|
|
138
|
-
accentColor: e ??
|
|
139
|
-
colors:
|
|
140
|
-
radius:
|
|
141
|
-
}),
|
|
142
|
-
colors:
|
|
143
|
-
radius:
|
|
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
|
-
}, B = ((
|
|
180
|
+
}, B = ((N = C.fontFamily) == null ? void 0 : N.trim()) || le;
|
|
179
181
|
function E() {
|
|
180
|
-
|
|
182
|
+
h(), P(null);
|
|
181
183
|
}
|
|
182
|
-
function
|
|
183
|
-
|
|
184
|
+
function K(g) {
|
|
185
|
+
P(g), m("detail");
|
|
184
186
|
}
|
|
185
|
-
return /* @__PURE__ */
|
|
186
|
-
!
|
|
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: b(9999,
|
|
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",
|
|
@@ -206,15 +208,15 @@ function ye({
|
|
|
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:
|
|
228
|
+
padding: L ? "0 12px 80px" : "0 24px 88px",
|
|
227
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: b(20,
|
|
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,31 +289,31 @@ 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
|
-
["list", "
|
|
260
|
-
].map(([
|
|
298
|
+
["list", "Ideas"]
|
|
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: b(8,
|
|
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",
|
|
@@ -284,7 +323,7 @@ function ye({
|
|
|
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: b(20,
|
|
399
|
+
borderRadius: b(20, l.radius),
|
|
361
400
|
padding: "6px 14px",
|
|
362
401
|
fontSize: 14,
|
|
363
402
|
fontWeight: 700,
|
|
@@ -371,14 +410,14 @@ function ye({
|
|
|
371
410
|
{
|
|
372
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: b(8,
|
|
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,70 +456,71 @@ 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:
|
|
425
|
-
children: "
|
|
463
|
+
style: { fontSize: 14, fontWeight: 600, color: l.text },
|
|
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: b(8,
|
|
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"
|
|
440
479
|
},
|
|
441
|
-
children: "+
|
|
480
|
+
children: "+ Suggest an idea"
|
|
442
481
|
}
|
|
443
482
|
)
|
|
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
|
},
|
|
456
|
-
children: "← Back to
|
|
495
|
+
children: "← Back to ideas"
|
|
457
496
|
}
|
|
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:
|
|
504
|
+
feedbackId: A,
|
|
505
|
+
accent: d,
|
|
506
|
+
p: l,
|
|
468
507
|
font: B
|
|
469
508
|
}
|
|
470
509
|
),
|
|
471
|
-
|
|
472
|
-
|
|
510
|
+
u === "create" && /* @__PURE__ */ t(
|
|
511
|
+
ue,
|
|
473
512
|
{
|
|
474
|
-
accent:
|
|
475
|
-
p:
|
|
513
|
+
accent: d,
|
|
514
|
+
p: l,
|
|
476
515
|
font: B,
|
|
477
|
-
|
|
516
|
+
ideasOnly: !!(f && a && i.chat),
|
|
517
|
+
onDone: () => m("list")
|
|
478
518
|
}
|
|
479
519
|
)
|
|
480
520
|
]
|
|
481
521
|
}
|
|
482
522
|
),
|
|
483
|
-
|
|
523
|
+
v && u !== "support" && /* @__PURE__ */ s(
|
|
484
524
|
"a",
|
|
485
525
|
{
|
|
486
526
|
href: "https://upstep.dev",
|
|
@@ -490,9 +530,9 @@ function ye({
|
|
|
490
530
|
display: "block",
|
|
491
531
|
textAlign: "center",
|
|
492
532
|
padding: "8px 0",
|
|
493
|
-
borderTop: `1px solid ${
|
|
533
|
+
borderTop: `1px solid ${l.border}`,
|
|
494
534
|
fontSize: 11,
|
|
495
|
-
color:
|
|
535
|
+
color: l.textFaint,
|
|
496
536
|
textDecoration: "none",
|
|
497
537
|
flexShrink: 0
|
|
498
538
|
},
|
|
@@ -510,24 +550,24 @@ function ye({
|
|
|
510
550
|
)
|
|
511
551
|
] });
|
|
512
552
|
}
|
|
513
|
-
function
|
|
514
|
-
client:
|
|
553
|
+
function ae({
|
|
554
|
+
client: n,
|
|
515
555
|
theme: e,
|
|
516
|
-
accentColor:
|
|
517
|
-
appearance:
|
|
556
|
+
accentColor: o,
|
|
557
|
+
appearance: p
|
|
518
558
|
}) {
|
|
519
|
-
const
|
|
520
|
-
return
|
|
521
|
-
if (
|
|
522
|
-
}, [
|
|
559
|
+
const c = te(null);
|
|
560
|
+
return w(() => {
|
|
561
|
+
if (c.current) return n.connectSupportFrame(c.current);
|
|
562
|
+
}, [n]), /* @__PURE__ */ t(
|
|
523
563
|
"iframe",
|
|
524
564
|
{
|
|
525
|
-
ref:
|
|
565
|
+
ref: c,
|
|
526
566
|
"data-upstep-support": !0,
|
|
527
567
|
title: "Customer support",
|
|
528
|
-
src:
|
|
568
|
+
src: n.supportFrameUrl(e, o, p),
|
|
529
569
|
style: {
|
|
530
|
-
color:
|
|
570
|
+
color: o,
|
|
531
571
|
width: "100%",
|
|
532
572
|
height: "min(560px, calc(100dvh - 168px))",
|
|
533
573
|
minHeight: 300,
|
|
@@ -537,34 +577,34 @@ function ie({
|
|
|
537
577
|
}
|
|
538
578
|
);
|
|
539
579
|
}
|
|
540
|
-
function
|
|
541
|
-
onSelect:
|
|
580
|
+
function de({
|
|
581
|
+
onSelect: n,
|
|
542
582
|
accent: e,
|
|
543
|
-
p:
|
|
583
|
+
p: o
|
|
544
584
|
}) {
|
|
545
|
-
const { feedItems:
|
|
546
|
-
return
|
|
547
|
-
const
|
|
548
|
-
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(
|
|
549
589
|
"div",
|
|
550
590
|
{
|
|
551
|
-
onClick: () =>
|
|
591
|
+
onClick: () => n(r.id),
|
|
552
592
|
style: {
|
|
553
593
|
display: "flex",
|
|
554
594
|
gap: 12,
|
|
555
595
|
padding: 14,
|
|
556
|
-
border: `1px solid ${
|
|
557
|
-
borderRadius: b(14,
|
|
596
|
+
border: `1px solid ${o.border}`,
|
|
597
|
+
borderRadius: b(14, o.radius),
|
|
558
598
|
marginBottom: 10,
|
|
559
|
-
background:
|
|
599
|
+
background: o.bg,
|
|
560
600
|
cursor: "pointer"
|
|
561
601
|
},
|
|
562
602
|
children: [
|
|
563
|
-
/* @__PURE__ */
|
|
603
|
+
/* @__PURE__ */ s(
|
|
564
604
|
"button",
|
|
565
605
|
{
|
|
566
|
-
onClick: (
|
|
567
|
-
|
|
606
|
+
onClick: (i) => {
|
|
607
|
+
i.stopPropagation(), c(r.id, "UP");
|
|
568
608
|
},
|
|
569
609
|
style: {
|
|
570
610
|
display: "flex",
|
|
@@ -574,30 +614,30 @@ function le({
|
|
|
574
614
|
gap: 2,
|
|
575
615
|
minWidth: 46,
|
|
576
616
|
padding: "7px 0",
|
|
577
|
-
borderRadius: b(11,
|
|
617
|
+
borderRadius: b(11, o.radius),
|
|
578
618
|
cursor: "pointer",
|
|
579
619
|
flexShrink: 0,
|
|
580
|
-
border: `1px solid ${
|
|
581
|
-
background:
|
|
620
|
+
border: `1px solid ${a ? e : o.border}`,
|
|
621
|
+
background: a ? o.accentTint : o.bgSoft
|
|
582
622
|
},
|
|
583
623
|
children: [
|
|
584
|
-
/* @__PURE__ */ t(
|
|
624
|
+
/* @__PURE__ */ t(Y, { color: e }),
|
|
585
625
|
/* @__PURE__ */ t(
|
|
586
626
|
"span",
|
|
587
627
|
{
|
|
588
628
|
style: {
|
|
589
629
|
fontSize: 14,
|
|
590
630
|
fontWeight: 700,
|
|
591
|
-
color:
|
|
631
|
+
color: o.text,
|
|
592
632
|
lineHeight: 1.1
|
|
593
633
|
},
|
|
594
|
-
children:
|
|
634
|
+
children: r.upvotes
|
|
595
635
|
}
|
|
596
636
|
)
|
|
597
637
|
]
|
|
598
638
|
}
|
|
599
639
|
),
|
|
600
|
-
/* @__PURE__ */
|
|
640
|
+
/* @__PURE__ */ s("div", { style: { flex: 1, minWidth: 0 }, children: [
|
|
601
641
|
/* @__PURE__ */ t(
|
|
602
642
|
"p",
|
|
603
643
|
{
|
|
@@ -605,17 +645,17 @@ function le({
|
|
|
605
645
|
fontSize: 14,
|
|
606
646
|
fontWeight: 600,
|
|
607
647
|
lineHeight: 1.4,
|
|
608
|
-
color:
|
|
648
|
+
color: o.text,
|
|
609
649
|
margin: "0 0 6px",
|
|
610
650
|
overflow: "hidden",
|
|
611
651
|
display: "-webkit-box",
|
|
612
652
|
WebkitLineClamp: 2,
|
|
613
653
|
WebkitBoxOrient: "vertical"
|
|
614
654
|
},
|
|
615
|
-
children:
|
|
655
|
+
children: k
|
|
616
656
|
}
|
|
617
657
|
),
|
|
618
|
-
/* @__PURE__ */
|
|
658
|
+
/* @__PURE__ */ s(
|
|
619
659
|
"div",
|
|
620
660
|
{
|
|
621
661
|
style: {
|
|
@@ -625,16 +665,16 @@ function le({
|
|
|
625
665
|
flexWrap: "wrap"
|
|
626
666
|
},
|
|
627
667
|
children: [
|
|
628
|
-
/* @__PURE__ */ t(
|
|
629
|
-
|
|
630
|
-
|
|
668
|
+
/* @__PURE__ */ t(O, { type: r.type, p: o }),
|
|
669
|
+
r.status === "PENDING" ? /* @__PURE__ */ t(V, {}) : /* @__PURE__ */ t(
|
|
670
|
+
_,
|
|
631
671
|
{
|
|
632
|
-
status:
|
|
633
|
-
boardStatus:
|
|
634
|
-
p:
|
|
672
|
+
status: r.status,
|
|
673
|
+
boardStatus: r.boardStatus,
|
|
674
|
+
p: o
|
|
635
675
|
}
|
|
636
676
|
),
|
|
637
|
-
/* @__PURE__ */ t("span", { style: { fontSize: 11, color:
|
|
677
|
+
/* @__PURE__ */ t("span", { style: { fontSize: 11, color: o.textFaint }, children: q(r.createdAt) })
|
|
638
678
|
]
|
|
639
679
|
}
|
|
640
680
|
)
|
|
@@ -643,7 +683,7 @@ function le({
|
|
|
643
683
|
"span",
|
|
644
684
|
{
|
|
645
685
|
style: {
|
|
646
|
-
color:
|
|
686
|
+
color: o.textFaint,
|
|
647
687
|
fontSize: 18,
|
|
648
688
|
alignSelf: "center",
|
|
649
689
|
flexShrink: 0
|
|
@@ -653,14 +693,14 @@ function le({
|
|
|
653
693
|
)
|
|
654
694
|
]
|
|
655
695
|
},
|
|
656
|
-
|
|
696
|
+
r.id
|
|
657
697
|
);
|
|
658
|
-
}) }) : /* @__PURE__ */
|
|
698
|
+
}) }) : /* @__PURE__ */ s("div", { style: { textAlign: "center", padding: "40px 0" }, children: [
|
|
659
699
|
/* @__PURE__ */ t(
|
|
660
700
|
"div",
|
|
661
701
|
{
|
|
662
702
|
style: {
|
|
663
|
-
color:
|
|
703
|
+
color: o.textSoft,
|
|
664
704
|
fontSize: 15,
|
|
665
705
|
fontWeight: 600,
|
|
666
706
|
marginBottom: 4
|
|
@@ -668,79 +708,79 @@ function le({
|
|
|
668
708
|
children: "No open feedback yet"
|
|
669
709
|
}
|
|
670
710
|
),
|
|
671
|
-
/* @__PURE__ */ t("div", { style: { color:
|
|
711
|
+
/* @__PURE__ */ t("div", { style: { color: o.textFaint, fontSize: 14 }, children: "Be the first to share one." })
|
|
672
712
|
] });
|
|
673
713
|
}
|
|
674
|
-
function
|
|
675
|
-
feedbackId:
|
|
714
|
+
function ce({
|
|
715
|
+
feedbackId: n,
|
|
676
716
|
accent: e,
|
|
677
|
-
p:
|
|
678
|
-
font:
|
|
717
|
+
p: o,
|
|
718
|
+
font: p
|
|
679
719
|
}) {
|
|
680
|
-
const { vote:
|
|
681
|
-
|
|
682
|
-
let
|
|
683
|
-
return
|
|
684
|
-
|
|
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);
|
|
685
725
|
}).catch(() => {
|
|
686
726
|
}), () => {
|
|
687
|
-
|
|
727
|
+
d = !0;
|
|
688
728
|
};
|
|
689
|
-
}, [
|
|
690
|
-
async function
|
|
691
|
-
if (!(!
|
|
692
|
-
|
|
729
|
+
}, [n, y]);
|
|
730
|
+
async function S() {
|
|
731
|
+
if (!(!r || k)) {
|
|
732
|
+
i(!0);
|
|
693
733
|
try {
|
|
694
|
-
await
|
|
695
|
-
const
|
|
696
|
-
d
|
|
734
|
+
await c(r.id, "UP");
|
|
735
|
+
const d = await y(n);
|
|
736
|
+
a(d);
|
|
697
737
|
} catch {
|
|
698
738
|
} finally {
|
|
699
|
-
|
|
739
|
+
i(!1);
|
|
700
740
|
}
|
|
701
741
|
}
|
|
702
742
|
}
|
|
703
|
-
if (!
|
|
743
|
+
if (!r)
|
|
704
744
|
return /* @__PURE__ */ t(
|
|
705
745
|
"div",
|
|
706
746
|
{
|
|
707
747
|
style: {
|
|
708
748
|
textAlign: "center",
|
|
709
749
|
padding: "40px 0",
|
|
710
|
-
color:
|
|
750
|
+
color: o.textFaint,
|
|
711
751
|
fontSize: 14
|
|
712
752
|
},
|
|
713
753
|
children: "Loading…"
|
|
714
754
|
}
|
|
715
755
|
);
|
|
716
|
-
const
|
|
717
|
-
return /* @__PURE__ */
|
|
718
|
-
|
|
756
|
+
const l = r.title;
|
|
757
|
+
return /* @__PURE__ */ s("div", { children: [
|
|
758
|
+
l && /* @__PURE__ */ t(
|
|
719
759
|
"div",
|
|
720
760
|
{
|
|
721
761
|
style: {
|
|
722
762
|
fontSize: 20,
|
|
723
763
|
fontWeight: 700,
|
|
724
|
-
color:
|
|
764
|
+
color: o.text,
|
|
725
765
|
letterSpacing: "-.02em",
|
|
726
766
|
marginBottom: 10,
|
|
727
767
|
lineHeight: 1.3
|
|
728
768
|
},
|
|
729
|
-
children:
|
|
769
|
+
children: l
|
|
730
770
|
}
|
|
731
771
|
),
|
|
732
|
-
/* @__PURE__ */
|
|
772
|
+
/* @__PURE__ */ s(
|
|
733
773
|
"div",
|
|
734
774
|
{
|
|
735
775
|
style: { display: "flex", gap: 6, marginBottom: 14, flexWrap: "wrap" },
|
|
736
776
|
children: [
|
|
737
|
-
/* @__PURE__ */ t(
|
|
738
|
-
|
|
739
|
-
|
|
777
|
+
/* @__PURE__ */ t(O, { type: r.type, p: o }),
|
|
778
|
+
r.status === "PENDING" ? /* @__PURE__ */ t(V, {}) : /* @__PURE__ */ t(
|
|
779
|
+
_,
|
|
740
780
|
{
|
|
741
|
-
status:
|
|
742
|
-
boardStatus:
|
|
743
|
-
p:
|
|
781
|
+
status: r.status,
|
|
782
|
+
boardStatus: r.boardStatus,
|
|
783
|
+
p: o
|
|
744
784
|
}
|
|
745
785
|
)
|
|
746
786
|
]
|
|
@@ -752,41 +792,41 @@ function se({
|
|
|
752
792
|
style: {
|
|
753
793
|
fontSize: 15,
|
|
754
794
|
lineHeight: 1.6,
|
|
755
|
-
color:
|
|
795
|
+
color: o.textSoft,
|
|
756
796
|
marginBottom: 20
|
|
757
797
|
},
|
|
758
|
-
children:
|
|
798
|
+
children: r.content
|
|
759
799
|
}
|
|
760
800
|
),
|
|
761
|
-
/* @__PURE__ */
|
|
801
|
+
/* @__PURE__ */ s(
|
|
762
802
|
"button",
|
|
763
803
|
{
|
|
764
|
-
onClick:
|
|
765
|
-
disabled:
|
|
804
|
+
onClick: S,
|
|
805
|
+
disabled: k,
|
|
766
806
|
style: {
|
|
767
807
|
display: "inline-flex",
|
|
768
808
|
alignItems: "center",
|
|
769
809
|
gap: 8,
|
|
770
|
-
border: `1px solid ${
|
|
771
|
-
background:
|
|
772
|
-
borderRadius: b(12,
|
|
810
|
+
border: `1px solid ${r.userVote === "UP" ? e : o.border}`,
|
|
811
|
+
background: r.userVote === "UP" ? j(e, 0.08) : o.bgSoft,
|
|
812
|
+
borderRadius: b(12, o.radius),
|
|
773
813
|
padding: "10px 16px",
|
|
774
814
|
cursor: "pointer",
|
|
775
|
-
fontFamily:
|
|
815
|
+
fontFamily: p
|
|
776
816
|
},
|
|
777
817
|
children: [
|
|
778
|
-
/* @__PURE__ */ t(
|
|
779
|
-
/* @__PURE__ */ t("span", { style: { fontSize: 18, fontWeight: 700, color:
|
|
780
|
-
/* @__PURE__ */ t("span", { style: { fontSize: 14, color:
|
|
818
|
+
/* @__PURE__ */ t(Y, { color: e, size: 13 }),
|
|
819
|
+
/* @__PURE__ */ t("span", { style: { fontSize: 18, fontWeight: 700, color: o.text }, children: r.upvotes }),
|
|
820
|
+
/* @__PURE__ */ t("span", { style: { fontSize: 14, color: o.textFaint }, children: r.userVote === "UP" ? "Upvoted" : "Upvote" })
|
|
781
821
|
]
|
|
782
822
|
}
|
|
783
823
|
),
|
|
784
|
-
|
|
824
|
+
r.comments.length > 0 && /* @__PURE__ */ s(
|
|
785
825
|
"div",
|
|
786
826
|
{
|
|
787
827
|
style: {
|
|
788
828
|
marginTop: 28,
|
|
789
|
-
borderTop: `1px solid ${
|
|
829
|
+
borderTop: `1px solid ${o.border}`,
|
|
790
830
|
paddingTop: 20
|
|
791
831
|
},
|
|
792
832
|
children: [
|
|
@@ -797,26 +837,26 @@ function se({
|
|
|
797
837
|
fontSize: 10,
|
|
798
838
|
fontWeight: 700,
|
|
799
839
|
letterSpacing: ".08em",
|
|
800
|
-
color:
|
|
840
|
+
color: o.textFaint,
|
|
801
841
|
marginBottom: 12,
|
|
802
842
|
textTransform: "uppercase"
|
|
803
843
|
},
|
|
804
844
|
children: "Comments"
|
|
805
845
|
}
|
|
806
846
|
),
|
|
807
|
-
|
|
847
|
+
r.comments.map((d) => /* @__PURE__ */ t(pe, { comment: d, p: o, accent: e }, d.id))
|
|
808
848
|
]
|
|
809
849
|
}
|
|
810
850
|
)
|
|
811
851
|
] });
|
|
812
852
|
}
|
|
813
|
-
function
|
|
814
|
-
comment:
|
|
853
|
+
function pe({
|
|
854
|
+
comment: n,
|
|
815
855
|
p: e,
|
|
816
|
-
accent:
|
|
856
|
+
accent: o
|
|
817
857
|
}) {
|
|
818
|
-
var
|
|
819
|
-
return /* @__PURE__ */
|
|
858
|
+
var p;
|
|
859
|
+
return /* @__PURE__ */ s(
|
|
820
860
|
"div",
|
|
821
861
|
{
|
|
822
862
|
style: {
|
|
@@ -827,7 +867,7 @@ function ae({
|
|
|
827
867
|
marginBottom: 10
|
|
828
868
|
},
|
|
829
869
|
children: [
|
|
830
|
-
/* @__PURE__ */
|
|
870
|
+
/* @__PURE__ */ s(
|
|
831
871
|
"div",
|
|
832
872
|
{
|
|
833
873
|
style: {
|
|
@@ -841,17 +881,17 @@ function ae({
|
|
|
841
881
|
"span",
|
|
842
882
|
{
|
|
843
883
|
style: {
|
|
844
|
-
background:
|
|
845
|
-
color:
|
|
884
|
+
background: j(o, 0.125),
|
|
885
|
+
color: o,
|
|
846
886
|
fontSize: 11,
|
|
847
887
|
fontWeight: 700,
|
|
848
888
|
borderRadius: b(20, e.radius),
|
|
849
889
|
padding: "2px 8px"
|
|
850
890
|
},
|
|
851
|
-
children: ((
|
|
891
|
+
children: ((p = n.authorName) == null ? void 0 : p.trim()) || "UpStep Team"
|
|
852
892
|
}
|
|
853
893
|
),
|
|
854
|
-
/* @__PURE__ */ t("span", { style: { fontSize: 11, color: e.textFaint }, children:
|
|
894
|
+
/* @__PURE__ */ t("span", { style: { fontSize: 11, color: e.textFaint }, children: q(n.createdAt) })
|
|
855
895
|
]
|
|
856
896
|
}
|
|
857
897
|
),
|
|
@@ -859,34 +899,37 @@ function ae({
|
|
|
859
899
|
"p",
|
|
860
900
|
{
|
|
861
901
|
style: { fontSize: 16, lineHeight: 1.6, color: e.textSoft, margin: 0 },
|
|
862
|
-
children:
|
|
902
|
+
children: n.content
|
|
863
903
|
}
|
|
864
904
|
)
|
|
865
905
|
]
|
|
866
906
|
}
|
|
867
907
|
);
|
|
868
908
|
}
|
|
869
|
-
function
|
|
870
|
-
accent:
|
|
909
|
+
function ue({
|
|
910
|
+
accent: n,
|
|
871
911
|
p: e,
|
|
872
|
-
font:
|
|
873
|
-
onDone:
|
|
912
|
+
font: o,
|
|
913
|
+
onDone: p,
|
|
914
|
+
ideasOnly: c = !1
|
|
874
915
|
}) {
|
|
875
|
-
const { submit:
|
|
916
|
+
const { submit: y } = U(), [r, a] = x(""), [k, i] = x(""), [S, l] = x(
|
|
917
|
+
c ? "FEATURE" : "GENERAL"
|
|
918
|
+
), [d, C] = x(!1), [F, T] = x(!1), [h, v] = x("");
|
|
876
919
|
async function u() {
|
|
877
|
-
if (!(!
|
|
878
|
-
|
|
920
|
+
if (!(!r.trim() || d)) {
|
|
921
|
+
C(!0), v("");
|
|
879
922
|
try {
|
|
880
|
-
await
|
|
923
|
+
await y(r.trim(), k.trim() || r.trim(), S), T(!0), setTimeout(p, 1200);
|
|
881
924
|
} catch {
|
|
882
|
-
|
|
925
|
+
v("Something went wrong. Please try again.");
|
|
883
926
|
} finally {
|
|
884
|
-
|
|
927
|
+
C(!1);
|
|
885
928
|
}
|
|
886
929
|
}
|
|
887
930
|
}
|
|
888
|
-
if (
|
|
889
|
-
return /* @__PURE__ */
|
|
931
|
+
if (F)
|
|
932
|
+
return /* @__PURE__ */ s("div", { style: { textAlign: "center", paddingTop: 40 }, children: [
|
|
890
933
|
/* @__PURE__ */ t(
|
|
891
934
|
"div",
|
|
892
935
|
{
|
|
@@ -899,9 +942,9 @@ function de({
|
|
|
899
942
|
children: "Submitted"
|
|
900
943
|
}
|
|
901
944
|
),
|
|
902
|
-
/* @__PURE__ */ t("div", { style: { fontSize: 14, color: e.textFaint }, children: "Feedback received. Thank you." })
|
|
945
|
+
/* @__PURE__ */ t("div", { style: { fontSize: 14, color: e.textFaint }, children: c ? "Idea received. Thank you." : "Feedback received. Thank you." })
|
|
903
946
|
] });
|
|
904
|
-
const
|
|
947
|
+
const m = {
|
|
905
948
|
width: "100%",
|
|
906
949
|
border: `1px solid ${e.border}`,
|
|
907
950
|
borderRadius: b(12, e.radius),
|
|
@@ -911,51 +954,53 @@ function de({
|
|
|
911
954
|
outline: "none",
|
|
912
955
|
background: e.bgSoft,
|
|
913
956
|
color: e.text,
|
|
914
|
-
fontFamily:
|
|
957
|
+
fontFamily: o,
|
|
915
958
|
boxSizing: "border-box"
|
|
916
959
|
};
|
|
917
|
-
return /* @__PURE__ */
|
|
918
|
-
/* @__PURE__ */
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
"
|
|
934
|
-
|
|
935
|
-
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
|
|
949
|
-
|
|
950
|
-
|
|
960
|
+
return /* @__PURE__ */ s("div", { children: [
|
|
961
|
+
!c && /* @__PURE__ */ s(R, { children: [
|
|
962
|
+
/* @__PURE__ */ t(
|
|
963
|
+
"div",
|
|
964
|
+
{
|
|
965
|
+
style: {
|
|
966
|
+
fontSize: 10,
|
|
967
|
+
fontWeight: 700,
|
|
968
|
+
letterSpacing: ".08em",
|
|
969
|
+
color: e.textFaint,
|
|
970
|
+
marginBottom: 8,
|
|
971
|
+
textTransform: "uppercase"
|
|
972
|
+
},
|
|
973
|
+
children: "Type"
|
|
974
|
+
}
|
|
975
|
+
),
|
|
976
|
+
/* @__PURE__ */ t("div", { style: { display: "flex", gap: 7, marginBottom: 16 }, children: ["BUG", "FEATURE", "GENERAL"].map((f) => /* @__PURE__ */ s(
|
|
977
|
+
"button",
|
|
978
|
+
{
|
|
979
|
+
onClick: () => l(f),
|
|
980
|
+
style: {
|
|
981
|
+
flex: 1,
|
|
982
|
+
display: "flex",
|
|
983
|
+
alignItems: "center",
|
|
984
|
+
justifyContent: "center",
|
|
985
|
+
gap: 5,
|
|
986
|
+
padding: "8px 10px",
|
|
987
|
+
borderRadius: b(9, e.radius),
|
|
988
|
+
fontSize: 14,
|
|
989
|
+
fontWeight: 600,
|
|
990
|
+
cursor: "pointer",
|
|
991
|
+
background: S === f ? n : e.bg,
|
|
992
|
+
color: S === f ? e.accentText : e.textSoft,
|
|
993
|
+
border: `1px solid ${S === f ? n : e.border}`,
|
|
994
|
+
fontFamily: o
|
|
995
|
+
},
|
|
996
|
+
children: [
|
|
997
|
+
$[f].icon,
|
|
998
|
+
$[f].label
|
|
999
|
+
]
|
|
951
1000
|
},
|
|
952
|
-
|
|
953
|
-
|
|
954
|
-
|
|
955
|
-
]
|
|
956
|
-
},
|
|
957
|
-
h
|
|
958
|
-
)) }),
|
|
1001
|
+
f
|
|
1002
|
+
)) })
|
|
1003
|
+
] }),
|
|
959
1004
|
/* @__PURE__ */ t(
|
|
960
1005
|
"div",
|
|
961
1006
|
{
|
|
@@ -973,14 +1018,14 @@ function de({
|
|
|
973
1018
|
/* @__PURE__ */ t(
|
|
974
1019
|
"input",
|
|
975
1020
|
{
|
|
976
|
-
value:
|
|
977
|
-
onChange: (
|
|
978
|
-
placeholder: "Short summary of the issue or idea",
|
|
1021
|
+
value: r,
|
|
1022
|
+
onChange: (f) => a(f.target.value),
|
|
1023
|
+
placeholder: c ? "What would you like us to build?" : "Short summary of the issue or idea",
|
|
979
1024
|
maxLength: 200,
|
|
980
|
-
style: { ...
|
|
1025
|
+
style: { ...m, marginBottom: 16, display: "block" }
|
|
981
1026
|
}
|
|
982
1027
|
),
|
|
983
|
-
/* @__PURE__ */
|
|
1028
|
+
/* @__PURE__ */ s(
|
|
984
1029
|
"div",
|
|
985
1030
|
{
|
|
986
1031
|
style: {
|
|
@@ -1007,42 +1052,42 @@ function de({
|
|
|
1007
1052
|
/* @__PURE__ */ t(
|
|
1008
1053
|
"textarea",
|
|
1009
1054
|
{
|
|
1010
|
-
value:
|
|
1011
|
-
onChange: (
|
|
1012
|
-
placeholder: "Steps to reproduce, expected behaviour, or more context",
|
|
1055
|
+
value: k,
|
|
1056
|
+
onChange: (f) => i(f.target.value),
|
|
1057
|
+
placeholder: c ? "Why would it help? (optional)" : "Steps to reproduce, expected behaviour, or more context",
|
|
1013
1058
|
maxLength: 2e3,
|
|
1014
1059
|
rows: 4,
|
|
1015
|
-
style: { ...
|
|
1060
|
+
style: { ...m, resize: "vertical", marginBottom: 16 }
|
|
1016
1061
|
}
|
|
1017
1062
|
),
|
|
1018
|
-
|
|
1063
|
+
h && /* @__PURE__ */ t("p", { style: { fontSize: 14, color: "#d6453d", marginBottom: 12 }, children: h }),
|
|
1019
1064
|
/* @__PURE__ */ t(
|
|
1020
1065
|
"button",
|
|
1021
1066
|
{
|
|
1022
1067
|
onClick: u,
|
|
1023
|
-
disabled:
|
|
1068
|
+
disabled: d || !r.trim(),
|
|
1024
1069
|
style: {
|
|
1025
1070
|
width: "100%",
|
|
1026
1071
|
padding: 12,
|
|
1027
|
-
background:
|
|
1072
|
+
background: n,
|
|
1028
1073
|
color: e.accentText,
|
|
1029
1074
|
border: "none",
|
|
1030
1075
|
borderRadius: b(11, e.radius),
|
|
1031
1076
|
fontSize: 14,
|
|
1032
1077
|
fontWeight: 600,
|
|
1033
1078
|
cursor: "pointer",
|
|
1034
|
-
opacity:
|
|
1035
|
-
fontFamily:
|
|
1079
|
+
opacity: d || !r.trim() ? 0.5 : 1,
|
|
1080
|
+
fontFamily: o
|
|
1036
1081
|
},
|
|
1037
|
-
children:
|
|
1082
|
+
children: d ? "Submitting…" : c ? "Suggest idea" : "Submit feedback"
|
|
1038
1083
|
}
|
|
1039
1084
|
)
|
|
1040
1085
|
] });
|
|
1041
1086
|
}
|
|
1042
|
-
const
|
|
1087
|
+
const $ = {
|
|
1043
1088
|
BUG: {
|
|
1044
1089
|
label: "Bug",
|
|
1045
|
-
icon: /* @__PURE__ */
|
|
1090
|
+
icon: /* @__PURE__ */ s(
|
|
1046
1091
|
"svg",
|
|
1047
1092
|
{
|
|
1048
1093
|
width: 12,
|
|
@@ -1062,7 +1107,7 @@ const D = {
|
|
|
1062
1107
|
},
|
|
1063
1108
|
FEATURE: {
|
|
1064
1109
|
label: "Feature",
|
|
1065
|
-
icon: /* @__PURE__ */
|
|
1110
|
+
icon: /* @__PURE__ */ s(
|
|
1066
1111
|
"svg",
|
|
1067
1112
|
{
|
|
1068
1113
|
width: 12,
|
|
@@ -1097,8 +1142,8 @@ const D = {
|
|
|
1097
1142
|
}
|
|
1098
1143
|
)
|
|
1099
1144
|
}
|
|
1100
|
-
},
|
|
1101
|
-
function
|
|
1145
|
+
}, he = { BUG: "#fdecec", FEATURE: "#e9f0fd" }, fe = { BUG: "#d6453d", FEATURE: "#3b76d6" };
|
|
1146
|
+
function O({ type: n, p: e }) {
|
|
1102
1147
|
return /* @__PURE__ */ t(
|
|
1103
1148
|
"span",
|
|
1104
1149
|
{
|
|
@@ -1108,21 +1153,21 @@ function H({ type: o, p: e }) {
|
|
|
1108
1153
|
fontSize: 10.5,
|
|
1109
1154
|
fontWeight: 700,
|
|
1110
1155
|
letterSpacing: ".02em",
|
|
1111
|
-
background:
|
|
1112
|
-
color:
|
|
1156
|
+
background: he[n] ?? e.bgSoft,
|
|
1157
|
+
color: fe[n] ?? e.textSoft
|
|
1113
1158
|
},
|
|
1114
|
-
children:
|
|
1159
|
+
children: n
|
|
1115
1160
|
}
|
|
1116
1161
|
);
|
|
1117
1162
|
}
|
|
1118
|
-
const
|
|
1163
|
+
const ge = {
|
|
1119
1164
|
OPEN: "#b45309",
|
|
1120
1165
|
IN_PROGRESS: "#1d4ed8",
|
|
1121
1166
|
DONE: "#15803d",
|
|
1122
1167
|
CLOSED: "#6b7280"
|
|
1123
1168
|
};
|
|
1124
|
-
function
|
|
1125
|
-
return /* @__PURE__ */
|
|
1169
|
+
function V() {
|
|
1170
|
+
return /* @__PURE__ */ s(
|
|
1126
1171
|
"span",
|
|
1127
1172
|
{
|
|
1128
1173
|
style: {
|
|
@@ -1155,26 +1200,26 @@ function $() {
|
|
|
1155
1200
|
}
|
|
1156
1201
|
);
|
|
1157
1202
|
}
|
|
1158
|
-
function
|
|
1159
|
-
status:
|
|
1203
|
+
function _({
|
|
1204
|
+
status: n,
|
|
1160
1205
|
boardStatus: e,
|
|
1161
|
-
p:
|
|
1206
|
+
p: o
|
|
1162
1207
|
}) {
|
|
1163
|
-
const
|
|
1164
|
-
return /* @__PURE__ */
|
|
1208
|
+
const p = (e == null ? void 0 : e.color) ?? ge[n] ?? "#9ca3af";
|
|
1209
|
+
return /* @__PURE__ */ s(
|
|
1165
1210
|
"span",
|
|
1166
1211
|
{
|
|
1167
1212
|
style: {
|
|
1168
1213
|
display: "inline-flex",
|
|
1169
1214
|
alignItems: "center",
|
|
1170
1215
|
gap: 5,
|
|
1171
|
-
background:
|
|
1172
|
-
border: `1px solid ${
|
|
1173
|
-
borderRadius: b(6,
|
|
1216
|
+
background: o.bgSoft,
|
|
1217
|
+
border: `1px solid ${o.border}`,
|
|
1218
|
+
borderRadius: b(6, o.radius),
|
|
1174
1219
|
padding: "2px 8px",
|
|
1175
1220
|
fontSize: 10,
|
|
1176
1221
|
fontWeight: 600,
|
|
1177
|
-
color:
|
|
1222
|
+
color: o.textSoft
|
|
1178
1223
|
},
|
|
1179
1224
|
children: [
|
|
1180
1225
|
/* @__PURE__ */ t(
|
|
@@ -1184,26 +1229,26 @@ function j({
|
|
|
1184
1229
|
width: 6,
|
|
1185
1230
|
height: 6,
|
|
1186
1231
|
borderRadius: "50%",
|
|
1187
|
-
background:
|
|
1232
|
+
background: p,
|
|
1188
1233
|
display: "inline-block",
|
|
1189
1234
|
flexShrink: 0
|
|
1190
1235
|
}
|
|
1191
1236
|
}
|
|
1192
1237
|
),
|
|
1193
|
-
(e == null ? void 0 : e.name) ??
|
|
1238
|
+
(e == null ? void 0 : e.name) ?? n.replace("_", " ")
|
|
1194
1239
|
]
|
|
1195
1240
|
}
|
|
1196
1241
|
);
|
|
1197
1242
|
}
|
|
1198
|
-
function
|
|
1199
|
-
size:
|
|
1243
|
+
function xe({
|
|
1244
|
+
size: n = 16,
|
|
1200
1245
|
color: e = "currentColor"
|
|
1201
1246
|
}) {
|
|
1202
1247
|
return /* @__PURE__ */ t(
|
|
1203
1248
|
"svg",
|
|
1204
1249
|
{
|
|
1205
|
-
width:
|
|
1206
|
-
height:
|
|
1250
|
+
width: n,
|
|
1251
|
+
height: n,
|
|
1207
1252
|
viewBox: "0 0 24 24",
|
|
1208
1253
|
fill: "none",
|
|
1209
1254
|
stroke: e,
|
|
@@ -1214,8 +1259,8 @@ function he({
|
|
|
1214
1259
|
}
|
|
1215
1260
|
);
|
|
1216
1261
|
}
|
|
1217
|
-
function
|
|
1218
|
-
color:
|
|
1262
|
+
function Y({
|
|
1263
|
+
color: n = "currentColor",
|
|
1219
1264
|
size: e = 11
|
|
1220
1265
|
}) {
|
|
1221
1266
|
return /* @__PURE__ */ t(
|
|
@@ -1225,7 +1270,7 @@ function G({
|
|
|
1225
1270
|
height: e,
|
|
1226
1271
|
viewBox: "0 0 16 16",
|
|
1227
1272
|
fill: "none",
|
|
1228
|
-
stroke:
|
|
1273
|
+
stroke: n,
|
|
1229
1274
|
strokeWidth: 2.2,
|
|
1230
1275
|
strokeLinecap: "round",
|
|
1231
1276
|
strokeLinejoin: "round",
|
|
@@ -1233,14 +1278,14 @@ function G({
|
|
|
1233
1278
|
}
|
|
1234
1279
|
);
|
|
1235
1280
|
}
|
|
1236
|
-
function
|
|
1237
|
-
return new Date(
|
|
1281
|
+
function q(n) {
|
|
1282
|
+
return new Date(n).toLocaleDateString(void 0, {
|
|
1238
1283
|
month: "short",
|
|
1239
1284
|
day: "numeric"
|
|
1240
1285
|
});
|
|
1241
1286
|
}
|
|
1242
1287
|
export {
|
|
1243
|
-
|
|
1244
|
-
|
|
1245
|
-
|
|
1288
|
+
ve as FeedbackWidget,
|
|
1289
|
+
ke as UpstepProvider,
|
|
1290
|
+
U as useUpstep
|
|
1246
1291
|
};
|