@upstep/js 0.6.1 → 0.7.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 +12 -4
- package/dist/{api-C1UV7Szw.mjs → api-DSXEYv9R.mjs} +38 -16
- package/dist/api-ZqVkOuh0.js +1 -0
- package/dist/api.d.ts +1 -1
- package/dist/api.d.ts.map +1 -1
- package/dist/index.cjs +41 -41
- package/dist/index.js +76 -95
- package/dist/react.cjs +1 -1
- package/dist/react.d.ts.map +1 -1
- package/dist/react.js +903 -291
- package/dist/support.cjs +1 -0
- package/dist/support.d.ts +47 -0
- package/dist/support.d.ts.map +1 -0
- package/dist/support.js +127 -0
- package/dist/upstep.global.js +41 -41
- package/dist/widget.d.ts +0 -2
- package/dist/widget.d.ts.map +1 -1
- package/package.json +9 -4
- package/dist/api-BuSqdsZp.js +0 -1
package/dist/index.js
CHANGED
|
@@ -1,24 +1,24 @@
|
|
|
1
|
-
import { U as
|
|
2
|
-
const
|
|
1
|
+
import { U as h } from "./api-DSXEYv9R.mjs";
|
|
2
|
+
const f = "#D97757", l = {
|
|
3
3
|
bg: "#ffffff",
|
|
4
|
-
bgSoft: "#
|
|
5
|
-
bgHover: "#
|
|
4
|
+
bgSoft: "#f5f5f5",
|
|
5
|
+
bgHover: "#ededed",
|
|
6
6
|
text: "#1a1915",
|
|
7
7
|
textSoft: "#56544d",
|
|
8
8
|
textFaint: "#9b9890",
|
|
9
9
|
border: "#e8e6df",
|
|
10
10
|
overlay: "rgba(26,25,21,.45)"
|
|
11
|
-
},
|
|
11
|
+
}, c = {
|
|
12
12
|
bg: "#000000",
|
|
13
|
-
bgSoft: "#
|
|
14
|
-
bgHover: "#
|
|
13
|
+
bgSoft: "#171717",
|
|
14
|
+
bgHover: "#262626",
|
|
15
15
|
text: "#f5f4f0",
|
|
16
16
|
textSoft: "#b4b1a8",
|
|
17
17
|
textFaint: "#7d7a72",
|
|
18
18
|
border: "#33312c",
|
|
19
19
|
overlay: "rgba(0,0,0,.6)"
|
|
20
20
|
};
|
|
21
|
-
function
|
|
21
|
+
function u(o) {
|
|
22
22
|
if (o === "light" || o === "dark") return o;
|
|
23
23
|
if (typeof document < "u") {
|
|
24
24
|
const t = document.documentElement;
|
|
@@ -26,40 +26,40 @@ function y(o) {
|
|
|
26
26
|
}
|
|
27
27
|
return typeof window < "u" && window.matchMedia && window.matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : "light";
|
|
28
28
|
}
|
|
29
|
-
function
|
|
29
|
+
function x(o, t, e) {
|
|
30
30
|
return `
|
|
31
31
|
#upstep-root *{box-sizing:border-box;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Helvetica,Arial,sans-serif}
|
|
32
|
-
#upstep-btn{position:fixed;bottom:24px
|
|
32
|
+
#upstep-btn{position:fixed;bottom:24px;right:24px;left:auto;z-index:9998;display:inline-flex;align-items:center;gap:7px;background:${o};color:#fff;border:none;border-radius:9999px;padding:12px 18px;font-size:14px;font-weight:600;cursor:pointer;box-shadow:0 6px 20px rgba(26,25,21,.18);transition:transform .15s,box-shadow .15s}
|
|
33
33
|
#upstep-btn svg{width:16px;height:16px;flex-shrink:0}
|
|
34
34
|
#upstep-btn:hover{transform:translateY(-1px);box-shadow:0 8px 26px rgba(26,25,21,.24)}
|
|
35
|
-
#upstep-btn.upstep-dragging{cursor:grabbing;transform:scale(1.06);box-shadow:0 10px 32px rgba(26,25,21,.28);transition:transform .08s,box-shadow .08s}
|
|
36
35
|
@media(max-width:639px){#upstep-btn{padding:12px}#upstep-btn span{display:none}}
|
|
37
|
-
#upstep-backdrop{
|
|
36
|
+
@media(max-width:639px){#upstep-backdrop{padding:0 12px 80px!important}#upstep-modal{max-height:calc(100dvh - 104px)!important}}
|
|
37
|
+
#upstep-backdrop{position:fixed;inset:0;background:transparent;z-index:9999;display:flex;align-items:flex-end;justify-content:flex-end;padding:0 24px 88px;animation:upstep-fade .2s ease}
|
|
38
38
|
@keyframes upstep-fade{from{opacity:0}to{opacity:1}}
|
|
39
39
|
@keyframes upstep-rise{from{opacity:0;transform:translateY(14px)}to{opacity:1;transform:translateY(0)}}
|
|
40
|
-
#upstep-modal{background:${e.bg};border:1px solid ${e.border};border-radius:20px;width:100%;max-width:440px;max-height:
|
|
40
|
+
#upstep-modal{background:${e.bg};border:1px solid ${e.border};border-radius:20px;width:100%;max-width:440px;max-height:calc(100dvh - 112px);display:flex;flex-direction:column;overflow:hidden;box-shadow:0 24px 64px rgba(0,0,0,.28);animation:upstep-rise .26s cubic-bezier(.16,1,.3,1)}
|
|
41
41
|
#upstep-header{display:flex;align-items:flex-start;justify-content:space-between;padding:20px 20px 0}
|
|
42
42
|
#upstep-header h2{margin:0;font-size:16px;font-weight:700;color:${e.text};letter-spacing:-.01em}
|
|
43
|
-
#upstep-header p{margin:2px 0 0;font-size:
|
|
43
|
+
#upstep-header p{margin:2px 0 0;font-size:14px;color:${e.textFaint}}
|
|
44
44
|
#upstep-close{background:${e.bgSoft};border:none;width:28px;height:28px;border-radius:8px;font-size:14px;cursor:pointer;color:${e.textSoft};line-height:1;display:flex;align-items:center;justify-content:center;transition:background .15s}
|
|
45
45
|
#upstep-close:hover{background:${e.bgHover};color:${e.text}}
|
|
46
46
|
#upstep-tabs{display:flex;gap:4px;margin:16px 20px 0;padding:4px;background:${e.bgSoft};border-radius:11px}
|
|
47
|
-
.upstep-tab{flex:1;padding:8px;background:none;border:none;border-radius:8px;font-size:
|
|
47
|
+
.upstep-tab{flex:1;padding:8px;background:none;border:none;border-radius:8px;font-size:14px;font-weight:600;color:${e.textSoft};cursor:pointer;transition:all .15s}
|
|
48
48
|
.upstep-mode .upstep-tab.active{background:${e.bgSoft};box-shadow:none}
|
|
49
49
|
.upstep-tab.active{background:${e.bg};color:${e.text};box-shadow:0 1px 3px rgba(0,0,0,.08)}
|
|
50
50
|
#upstep-body{flex:1;overflow-y:auto;padding:18px 20px 22px}
|
|
51
|
-
.upstep-form textarea{width:100%;min-height:104px;border:1px solid ${e.border};border-radius:12px;padding:12px;font-size:
|
|
51
|
+
.upstep-form textarea{width:100%;min-height:104px;border:1px solid ${e.border};border-radius:12px;padding:12px;font-size:16px;line-height:1.6;resize:vertical;outline:none;background:${e.bgSoft};color:${e.text};transition:border-color .15s}
|
|
52
52
|
.upstep-form textarea::placeholder{color:${e.textFaint}}
|
|
53
53
|
.upstep-form textarea:focus{border-color:${o};background:${e.bg}}
|
|
54
54
|
.upstep-type-row{display:flex;gap:7px;margin:12px 0 4px}
|
|
55
|
-
.upstep-type-btn{flex:1;display:flex;align-items:center;justify-content:center;gap:5px;padding:8px 10px;border-radius:9px;border:1px solid ${e.border};background:${e.bg};color:${e.textSoft};font-size:
|
|
55
|
+
.upstep-type-btn{flex:1;display:flex;align-items:center;justify-content:center;gap:5px;padding:8px 10px;border-radius:9px;border:1px solid ${e.border};background:${e.bg};color:${e.textSoft};font-size:14px;font-weight:600;cursor:pointer;transition:all .15s}
|
|
56
56
|
.upstep-type-btn svg{width:12px;height:12px;flex-shrink:0}
|
|
57
57
|
.upstep-type-btn:hover{border-color:${e.textFaint}}
|
|
58
58
|
.upstep-type-btn.selected{background:${o};color:#fff;border-color:${o}}
|
|
59
59
|
.upstep-submit{width:100%;padding:12px;background:${o};color:#fff;border:none;border-radius:11px;font-size:14px;font-weight:600;cursor:pointer;margin-top:14px;transition:filter .15s}
|
|
60
60
|
.upstep-submit:hover{filter:brightness(.94)}
|
|
61
61
|
.upstep-submit:disabled{opacity:.5;cursor:not-allowed}
|
|
62
|
-
#upstep-form-msg{font-size:
|
|
62
|
+
#upstep-form-msg{font-size:14px;text-align:center;margin-top:12px;color:${o};font-weight:500}
|
|
63
63
|
.upstep-feedback-item{display:flex;gap:12px;padding:14px;border:1px solid ${e.border};border-radius:14px;margin-bottom:10px;background:${e.bg};transition:border-color .15s}
|
|
64
64
|
.upstep-feedback-item:hover{border-color:${e.textFaint}}
|
|
65
65
|
.upstep-vote{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:1px;min-width:46px;padding:7px 0;border-radius:11px;border:1px solid ${e.border};background:${e.bgSoft};cursor:pointer;transition:all .15s}
|
|
@@ -68,7 +68,7 @@ function S(o, t, e) {
|
|
|
68
68
|
.upstep-vote-arrow{font-size:11px;line-height:1;color:${o}}
|
|
69
69
|
.upstep-vote-count{font-size:14px;font-weight:700;color:${e.text};line-height:1.1}
|
|
70
70
|
.upstep-feedback-main{flex:1;min-width:0}
|
|
71
|
-
.upstep-feedback-content{font-size:
|
|
71
|
+
.upstep-feedback-content{font-size:16px;line-height:1.5;color:${e.text};margin:0 0 8px;word-break:break-word}
|
|
72
72
|
.upstep-feedback-meta{display:flex;align-items:center;gap:7px}
|
|
73
73
|
.upstep-badge{display:inline-flex;align-items:center;padding:2px 8px;border-radius:9999px;font-size:10.5px;font-weight:700;letter-spacing:.02em}
|
|
74
74
|
.upstep-badge-bug{background:#fdecec;color:#d6453d}
|
|
@@ -79,10 +79,10 @@ function S(o, t, e) {
|
|
|
79
79
|
.upstep-empty strong{display:block;color:${e.textSoft};font-size:15px;margin-bottom:4px}
|
|
80
80
|
`;
|
|
81
81
|
}
|
|
82
|
-
const
|
|
83
|
-
class
|
|
82
|
+
const m = '<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z"/></svg>';
|
|
83
|
+
class g {
|
|
84
84
|
constructor(t, e = {}) {
|
|
85
|
-
this.isOpen = !1, this.tab = "submit", this.feedItems = [], this.selectedType = "GENERAL", this.loading = !1, this.
|
|
85
|
+
this.isOpen = !1, this.tab = "submit", this.feedItems = [], this.selectedType = "GENERAL", this.loading = !1, this.hasSupport = !1, this.disconnectSupport = null, this.client = t, this.accent = e.accentColor ?? f, this.position = "right", this.showLauncher = e.launcher !== !1, this.themeMode = e.theme ?? "auto", this.palette = u(this.themeMode) === "dark" ? c : l;
|
|
86
86
|
}
|
|
87
87
|
mount() {
|
|
88
88
|
this.injectStyles(), this.showLauncher && this.renderButton(), this.client.supportEnabled().then((t) => {
|
|
@@ -104,48 +104,16 @@ class F {
|
|
|
104
104
|
var e;
|
|
105
105
|
(e = document.getElementById("upstep-styles")) == null || e.remove();
|
|
106
106
|
const t = document.createElement("style");
|
|
107
|
-
t.id = "upstep-styles", t.textContent =
|
|
107
|
+
t.id = "upstep-styles", t.textContent = x(this.accent, this.position, this.palette), document.head.appendChild(t);
|
|
108
108
|
}
|
|
109
109
|
renderButton() {
|
|
110
110
|
const t = document.createElement("button");
|
|
111
|
-
t.id = "upstep-btn", t.setAttribute("aria-label", "Open help and feedback"), t.innerHTML = `${
|
|
112
|
-
this.
|
|
113
|
-
}), document.body.appendChild(t)
|
|
114
|
-
}
|
|
115
|
-
makeDraggable(t) {
|
|
116
|
-
const s = "upstep-btn-pos";
|
|
117
|
-
try {
|
|
118
|
-
const i = localStorage.getItem(s);
|
|
119
|
-
if (i) {
|
|
120
|
-
const { side: d, bottom: u } = JSON.parse(i);
|
|
121
|
-
t.style.left = d === "left" ? "24px" : "auto", t.style.right = d === "right" ? "24px" : "auto", t.style.top = "auto", t.style.bottom = `${u}px`;
|
|
122
|
-
}
|
|
123
|
-
} catch {
|
|
124
|
-
}
|
|
125
|
-
let n = 0, r = 0, l = 0, h = 0, b = !1;
|
|
126
|
-
const k = () => {
|
|
127
|
-
const i = t.getBoundingClientRect(), d = i.left + i.width / 2 < window.innerWidth / 2 ? "left" : "right", u = Math.max(24, Math.min(window.innerHeight - i.height - 24, i.top)), g = window.innerHeight - u - i.height;
|
|
128
|
-
t.style.transition = "left .25s cubic-bezier(.16,1,.3,1),right .25s cubic-bezier(.16,1,.3,1),top .25s cubic-bezier(.16,1,.3,1),bottom .25s cubic-bezier(.16,1,.3,1),transform .15s,box-shadow .15s", t.style.left = d === "left" ? "24px" : "auto", t.style.right = d === "right" ? "24px" : "auto", t.style.top = "auto", t.style.bottom = `${g}px`;
|
|
129
|
-
try {
|
|
130
|
-
localStorage.setItem(s, JSON.stringify({ side: d, bottom: g }));
|
|
131
|
-
} catch {
|
|
132
|
-
}
|
|
133
|
-
}, w = (i) => {
|
|
134
|
-
if (i.pointerType === "mouse" && i.button !== 0) return;
|
|
135
|
-
this.dragMoved = !1, b = !0;
|
|
136
|
-
const d = t.getBoundingClientRect();
|
|
137
|
-
n = i.clientX, r = i.clientY, l = d.left, h = d.top, t.setPointerCapture(i.pointerId), t.style.transition = "none";
|
|
138
|
-
}, $ = (i) => {
|
|
139
|
-
if (!b) return;
|
|
140
|
-
const d = i.clientX - n, u = i.clientY - r;
|
|
141
|
-
!this.dragMoved && Math.hypot(d, u) < 6 || (this.dragMoved || t.classList.add("upstep-dragging"), this.dragMoved = !0, t.style.left = `${l + d}px`, t.style.right = "auto", t.style.top = `${h + u}px`, t.style.bottom = "auto");
|
|
142
|
-
}, f = () => {
|
|
143
|
-
b && (b = !1, t.classList.remove("upstep-dragging"), this.dragMoved && k());
|
|
144
|
-
};
|
|
145
|
-
t.addEventListener("pointerdown", w), t.addEventListener("pointermove", $), t.addEventListener("pointerup", f), t.addEventListener("pointercancel", f);
|
|
111
|
+
t.id = "upstep-btn", t.setAttribute("aria-label", "Open help and feedback"), t.innerHTML = `${m}<span>Feedback</span>`, t.addEventListener("click", () => {
|
|
112
|
+
this.openModal();
|
|
113
|
+
}), document.body.appendChild(t);
|
|
146
114
|
}
|
|
147
115
|
openModal() {
|
|
148
|
-
this.isOpen = !0, this.palette =
|
|
116
|
+
!this.isOpen && this.hasSupport && (this.tab = "support"), this.isOpen = !0, this.palette = u(this.themeMode) === "dark" ? c : l, this.injectStyles(), this.fetchFeed(), this.renderModal();
|
|
149
117
|
}
|
|
150
118
|
closeModal() {
|
|
151
119
|
var t, e;
|
|
@@ -159,28 +127,34 @@ class F {
|
|
|
159
127
|
}
|
|
160
128
|
}
|
|
161
129
|
renderModal() {
|
|
162
|
-
var
|
|
163
|
-
(
|
|
130
|
+
var i, s, n;
|
|
131
|
+
(i = this.disconnectSupport) == null || i.call(this), this.disconnectSupport = null;
|
|
164
132
|
const t = document.createElement("div");
|
|
165
|
-
t.id = "upstep-backdrop", t.addEventListener("click", (
|
|
166
|
-
|
|
133
|
+
t.id = "upstep-backdrop", t.addEventListener("click", (d) => {
|
|
134
|
+
d.target === t && this.closeModal();
|
|
167
135
|
}), t.innerHTML = `
|
|
168
136
|
<div id="upstep-modal" style="max-width:${this.hasSupport ? "460px" : "440px"}">
|
|
169
137
|
${this.hasSupport ? `<div class="upstep-mode" style="display:flex;align-items:center;gap:14px;padding:10px 14px;border-bottom:1px solid ${this.palette.border}"><div id="upstep-tabs" style="margin:0;padding:0;background:transparent;flex:1"><button class="upstep-tab ${this.tab === "support" ? "active" : ""}" data-tab="support">Support</button><button class="upstep-tab ${this.tab === "submit" ? "active" : ""}" data-tab="submit">Feedback</button><button class="upstep-tab ${this.tab === "feed" ? "active" : ""}" data-tab="feed">Ideas</button></div><button id="upstep-close" aria-label="Close" style="flex-shrink:0;background:transparent">✕</button></div>` : `<div id="upstep-header"><div><h2>Share your feedback</h2><p>Tell us what to build next, or vote on ideas.</p></div><button id="upstep-close" aria-label="Close">✕</button></div><div id="upstep-tabs"><button class="upstep-tab ${this.tab === "submit" ? "active" : ""}" data-tab="submit">Give feedback</button><button class="upstep-tab ${this.tab === "feed" ? "active" : ""}" data-tab="feed">Vote on ideas</button></div>`}
|
|
170
138
|
<div id="upstep-body" style="${this.tab === "support" ? "padding:0;overflow:hidden" : ""}">
|
|
171
|
-
${this.tab === "support" ? `<iframe id="upstep-support-frame" title="Customer support" src="${this.client.supportFrameUrl(this.palette.bg === "#000000" ? "dark" : "light")}" style="width:100%;height:min(560px,calc(
|
|
139
|
+
${this.tab === "support" ? `<iframe id="upstep-support-frame" title="Customer support" src="${this.client.supportFrameUrl(this.palette.bg === "#000000" ? "dark" : "light", this.accent)}" style="width:100%;height:min(560px,calc(100dvh - 168px));min-height:300px;border:0;display:block"></iframe>` : this.tab === "submit" ? this.renderSubmitForm() : this.renderFeed()}
|
|
172
140
|
</div>
|
|
173
141
|
</div>
|
|
174
|
-
`, (s = document.getElementById("upstep-backdrop")) == null || s.remove(), document.body.appendChild(t), (n = t.querySelector("#upstep-close")) == null || n.addEventListener("click", () => this.closeModal()), t.querySelectorAll(".upstep-tab").forEach((
|
|
175
|
-
|
|
176
|
-
this.tab =
|
|
142
|
+
`, (s = document.getElementById("upstep-backdrop")) == null || s.remove(), document.body.appendChild(t), (n = t.querySelector("#upstep-close")) == null || n.addEventListener("click", () => this.closeModal()), t.querySelectorAll(".upstep-tab").forEach((d) => {
|
|
143
|
+
d.addEventListener("click", () => {
|
|
144
|
+
this.tab = d.dataset.tab, this.renderModal();
|
|
177
145
|
});
|
|
178
146
|
});
|
|
179
|
-
const e = t.querySelector(
|
|
180
|
-
|
|
147
|
+
const e = t.querySelector(
|
|
148
|
+
"#upstep-support-frame"
|
|
149
|
+
);
|
|
150
|
+
e && (e.style.color = this.accent, this.disconnectSupport = this.client.connectSupportFrame(e)), this.bindSubmitForm(), this.bindVoteButtons();
|
|
181
151
|
}
|
|
182
152
|
renderSubmitForm() {
|
|
183
|
-
const t = ["BUG", "FEATURE", "GENERAL"], e = {
|
|
153
|
+
const t = ["BUG", "FEATURE", "GENERAL"], e = {
|
|
154
|
+
BUG: "Bug",
|
|
155
|
+
FEATURE: "Feature",
|
|
156
|
+
GENERAL: "General"
|
|
157
|
+
}, i = {
|
|
184
158
|
BUG: '<svg viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"><ellipse cx="8" cy="10" rx="3.5" ry="4.5"/><path d="M8 5.5V4M5.5 6.5 3.5 5M10.5 6.5 12.5 5M4.5 10.5 2.5 10M11.5 10.5 13.5 10"/></svg>',
|
|
185
159
|
FEATURE: '<svg viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"><path d="M8 2v1.5M8 12.5V14M2 8h1.5M12.5 8H14M4.1 4.1l1 1M10.9 10.9l1 1M11.9 4.1l-1 1M5.1 10.9l-1 1"/><circle cx="8" cy="8" r="2.5"/></svg>',
|
|
186
160
|
GENERAL: '<svg viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"><path d="M14 9a2 2 0 0 1-2 2H5L2 14V4a2 2 0 0 1 2-2h8a2 2 0 0 1 2 2v5z"/></svg>'
|
|
@@ -189,7 +163,7 @@ class F {
|
|
|
189
163
|
<div class="upstep-form">
|
|
190
164
|
<textarea id="upstep-textarea" placeholder="What's on your mind?" maxlength="2000"></textarea>
|
|
191
165
|
<div class="upstep-type-row">
|
|
192
|
-
${t.map((s) => `<button class="upstep-type-btn${this.selectedType === s ? " selected" : ""}" data-type="${s}">${
|
|
166
|
+
${t.map((s) => `<button class="upstep-type-btn${this.selectedType === s ? " selected" : ""}" data-type="${s}">${i[s]}${e[s]}</button>`).join("")}
|
|
193
167
|
</div>
|
|
194
168
|
<button class="upstep-submit" id="upstep-submit-btn">Send feedback</button>
|
|
195
169
|
<div id="upstep-form-msg"></div>
|
|
@@ -207,10 +181,10 @@ class F {
|
|
|
207
181
|
<span class="upstep-vote-count">${t.upvotes}</span>
|
|
208
182
|
</button>
|
|
209
183
|
<div class="upstep-feedback-main">
|
|
210
|
-
<p class="upstep-feedback-content">${
|
|
184
|
+
<p class="upstep-feedback-content">${b(t.content)}</p>
|
|
211
185
|
<div class="upstep-feedback-meta">
|
|
212
186
|
<span class="upstep-badge upstep-badge-${t.type.toLowerCase()}">${t.type}</span>
|
|
213
|
-
<span class="upstep-badge upstep-badge-general">${
|
|
187
|
+
<span class="upstep-badge upstep-badge-general">${b(((e = t.boardStatus) == null ? void 0 : e.name) ?? t.status.replace("_", " "))}</span>
|
|
214
188
|
<span class="upstep-feedback-date">${new Date(t.createdAt).toLocaleDateString()}</span>
|
|
215
189
|
</div>
|
|
216
190
|
</div>
|
|
@@ -226,18 +200,25 @@ class F {
|
|
|
226
200
|
var t;
|
|
227
201
|
document.querySelectorAll(".upstep-type-btn").forEach((e) => {
|
|
228
202
|
e.addEventListener("click", () => {
|
|
229
|
-
this.selectedType = e.dataset.type, document.querySelectorAll(".upstep-type-btn").forEach((
|
|
203
|
+
this.selectedType = e.dataset.type, document.querySelectorAll(".upstep-type-btn").forEach((i) => i.classList.remove("selected")), e.classList.add("selected");
|
|
230
204
|
});
|
|
231
205
|
}), (t = document.getElementById("upstep-submit-btn")) == null || t.addEventListener("click", async () => {
|
|
232
|
-
const e = document.getElementById(
|
|
206
|
+
const e = document.getElementById(
|
|
207
|
+
"upstep-textarea"
|
|
208
|
+
), i = document.getElementById("upstep-form-msg"), s = document.getElementById(
|
|
209
|
+
"upstep-submit-btn"
|
|
210
|
+
);
|
|
233
211
|
if (!e || this.loading) return;
|
|
234
212
|
const n = e.value.trim();
|
|
235
213
|
if (n) {
|
|
236
214
|
this.loading = !0, s && (s.disabled = !0, s.textContent = "Sending…");
|
|
237
215
|
try {
|
|
238
|
-
await this.client.submitFeedback({
|
|
216
|
+
await this.client.submitFeedback({
|
|
217
|
+
content: n,
|
|
218
|
+
type: this.selectedType
|
|
219
|
+
}), e.value = "", i && (i.textContent = "Feedback received. Thank you."), await this.fetchFeed();
|
|
239
220
|
} catch {
|
|
240
|
-
|
|
221
|
+
i && (i.textContent = "Something went wrong. Please try again.");
|
|
241
222
|
} finally {
|
|
242
223
|
this.loading = !1, s && (s.disabled = !1, s.textContent = "Send feedback");
|
|
243
224
|
}
|
|
@@ -256,54 +237,54 @@ class F {
|
|
|
256
237
|
});
|
|
257
238
|
}
|
|
258
239
|
}
|
|
259
|
-
function
|
|
240
|
+
function b(o) {
|
|
260
241
|
return o.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """);
|
|
261
242
|
}
|
|
262
|
-
let
|
|
263
|
-
const
|
|
243
|
+
let a = null, r = null;
|
|
244
|
+
const y = {
|
|
264
245
|
init(o) {
|
|
265
|
-
if (
|
|
246
|
+
if (a = new h(o), typeof window < "u") {
|
|
266
247
|
const t = {};
|
|
267
248
|
o.accentColor !== void 0 && (t.accentColor = o.accentColor), o.position !== void 0 && (t.position = o.position), o.theme !== void 0 && (t.theme = o.theme), o.launcher !== void 0 && (t.launcher = o.launcher);
|
|
268
249
|
const e = () => {
|
|
269
|
-
|
|
250
|
+
r = new g(a, t), r.mount();
|
|
270
251
|
};
|
|
271
252
|
document.readyState === "loading" ? document.addEventListener("DOMContentLoaded", e) : e();
|
|
272
253
|
}
|
|
273
|
-
return
|
|
254
|
+
return a;
|
|
274
255
|
},
|
|
275
256
|
/** Open the feedback widget — use this to trigger it from your own UI. */
|
|
276
257
|
open() {
|
|
277
|
-
|
|
258
|
+
r == null || r.openWidget();
|
|
278
259
|
},
|
|
279
260
|
/** Close the feedback widget. */
|
|
280
261
|
close() {
|
|
281
|
-
|
|
262
|
+
r == null || r.closeWidget();
|
|
282
263
|
},
|
|
283
264
|
/** Set / update the end-user id at runtime (e.g. after the user logs in). */
|
|
284
265
|
identify(o) {
|
|
285
|
-
|
|
266
|
+
a == null || a.setUserId(o);
|
|
286
267
|
},
|
|
287
268
|
/** Change or clear verified support identity after login/logout. */
|
|
288
269
|
identifySupport(o) {
|
|
289
270
|
var e;
|
|
290
|
-
|
|
271
|
+
a && (a.supportIdentityToken = o);
|
|
291
272
|
const t = document.querySelector("#upstep-support-frame");
|
|
292
|
-
t &&
|
|
273
|
+
t && a && ((e = t.contentWindow) == null || e.postMessage({ type: "upstep:support:identity", token: o }, new URL(a.baseUrl).origin));
|
|
293
274
|
},
|
|
294
275
|
get client() {
|
|
295
|
-
if (!
|
|
296
|
-
return
|
|
276
|
+
if (!a) throw new Error("Upstep.init() must be called first");
|
|
277
|
+
return a;
|
|
297
278
|
}
|
|
298
279
|
};
|
|
299
280
|
if (typeof document < "u") {
|
|
300
|
-
const o = document.currentScript, t = o == null ? void 0 : o.dataset.apiKey, e = o == null ? void 0 : o.dataset.userId,
|
|
281
|
+
const o = document.currentScript, t = o == null ? void 0 : o.dataset.apiKey, e = o == null ? void 0 : o.dataset.userId, i = o == null ? void 0 : o.dataset.baseUrl, s = o == null ? void 0 : o.dataset.accentColor, n = o == null ? void 0 : o.dataset.position, d = o == null ? void 0 : o.dataset.theme;
|
|
301
282
|
if (t) {
|
|
302
|
-
const
|
|
303
|
-
e && (
|
|
283
|
+
const p = { apiKey: t };
|
|
284
|
+
e && (p.userId = e), (o == null ? void 0 : o.dataset.chat) !== void 0 && (p.chat = o.dataset.chat !== "false"), i && (p.baseUrl = i), s && (p.accentColor = s), (n === "left" || n === "right") && (p.position = n), (d === "light" || d === "dark" || d === "auto") && (p.theme = d), y.init(p);
|
|
304
285
|
}
|
|
305
286
|
}
|
|
306
287
|
export {
|
|
307
|
-
|
|
308
|
-
|
|
288
|
+
h as UpstepApiClient,
|
|
289
|
+
y as default
|
|
309
290
|
};
|
package/dist/react.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),i=require("react"),A=require("./api-BuSqdsZp.js"),D="#D97757",H={bg:"#ffffff",bgSoft:"#f6f5f2",bgHover:"#efede8",text:"#1a1915",textSoft:"#56544d",textFaint:"#9b9890",border:"#e8e6df",overlay:"rgba(26,25,21,.45)"},N={bg:"#000000",bgSoft:"#262522",bgHover:"#302e2a",text:"#f5f4f0",textSoft:"#b4b1a8",textFaint:"#7d7a72",border:"#33312c",overlay:"rgba(0,0,0,.6)"};function z(){if(typeof document>"u")return!1;const o=document.documentElement;return o.classList.contains("dark")||o.getAttribute("data-theme")==="dark"}function $(o){const[n,t]=i.useState(()=>o==="dark");return i.useEffect(()=>{if(o!=="auto"){t(o==="dark");return}if(t(z()),typeof MutationObserver>"u")return;const x=new MutationObserver(()=>t(z()));return x.observe(document.documentElement,{attributes:!0,attributeFilter:["class","data-theme"]}),()=>x.disconnect()},[o]),n?N:H}const B=i.createContext(null);function G({children:o,...n}){const[t]=i.useState(()=>new A.UpstepApiClient(n)),[x,f]=i.useState([]),[s,r]=i.useState(!1),[l,m]=i.useState(!0);i.useEffect(()=>{t.setUserId(n.userId)},[t,n.userId]),i.useEffect(()=>{t.supportIdentityToken=n.supportIdentityToken,document.querySelectorAll("iframe[data-upstep-support]").forEach(c=>{var b;return(b=c.contentWindow)==null?void 0:b.postMessage({type:"upstep:support:identity",token:n.supportIdentityToken},new URL(t.baseUrl).origin)})},[t,n.supportIdentityToken]);const d=i.useCallback(async()=>{try{const c=await t.listFeedback({sort:"votes",limit:20});f(c.items),m(c.showBranding??!0)}catch{}},[t]);i.useEffect(()=>{d()},[d]);const j=i.useCallback(async(c,b,S)=>{const p={content:b};c.trim()&&(p.title=c.trim()),S!==void 0&&(p.type=S),await t.submitFeedback(p),await d()},[t,d]),h=i.useCallback(async(c,b)=>{try{await t.vote(c,b),await d()}catch{}},[t,d]),a=i.useCallback(c=>t.getItem(c),[t]),g=i.useCallback(()=>r(!0),[]),y=i.useCallback(()=>r(!1),[]),k=i.useCallback(c=>t.setUserId(c),[t]);return e.jsx(B.Provider,{value:{client:t,feedItems:x,loadFeed:d,submit:j,vote:h,getItem:a,isOpen:s,open:g,close:y,identify:k,accentColor:n.accentColor??D,theme:n.theme??"auto",showBranding:l,chat:n.chat!==!1},children:o})}function w(){const o=i.useContext(B);if(!o)throw new Error("useUpstep must be used inside <UpstepProvider>");return o}function O({position:o="bottom-right",accentColor:n,theme:t,hideLauncher:x=!1,chat:f=!0}){const s=w(),r=n??s.accentColor,l=$(t??s.theme),{isOpen:m,open:d,close:j,showBranding:h}=s,[a,g]=i.useState("list"),[y,k]=i.useState(!1);i.useEffect(()=>{let u=!0;if(s.client.chat=s.chat,!s.chat||!f){k(!1);return}return s.client.supportEnabled().then(v=>{u&&k(v)}),()=>{u=!1}},[s.client,s.chat,f]),i.useEffect(()=>{(!s.chat||!f)&&a==="support"&&g("list")},[s.chat,f,a]);const[c,b]=i.useState(null),[S,p]=i.useState(!1);i.useEffect(()=>{const u=window.matchMedia("(max-width: 639px)");p(u.matches);const v=P=>p(P.matches);return u.addEventListener("change",v),()=>u.removeEventListener("change",v)},[]);const L=o==="bottom-left"?{position:"fixed",bottom:24,left:24}:{position:"fixed",bottom:24,right:24},C='-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Helvetica,Arial,sans-serif';function F(){j(),setTimeout(()=>{g("list"),b(null)},300)}function M(u){b(u),g("detail")}return e.jsxs(e.Fragment,{children:[!x&&e.jsxs("button",{onClick:d,style:{...L,zIndex:9998,display:"inline-flex",alignItems:"center",gap:7,background:r,color:"#fff",border:"none",borderRadius:9999,padding:S?"12px":"12px 18px",fontSize:14,fontWeight:600,cursor:"pointer",fontFamily:C,boxShadow:"0 6px 20px rgba(26,25,21,.18)"},children:[e.jsx(Z,{size:16}),!S&&(y&&f&&s.chat?"Help & feedback":"Feedback")]}),m&&e.jsx("div",{onClick:u=>u.target===u.currentTarget&&F(),style:{position:"fixed",inset:0,background:l.overlay,backdropFilter:"blur(3px)",zIndex:9999,display:"flex",alignItems:"center",justifyContent:"center",padding:16,fontFamily:C},children:e.jsxs("div",{style:{background:l.bg,border:`1px solid ${l.border}`,borderRadius:20,width:"100%",maxWidth:y&&f&&s.chat?460:440,maxHeight:"88vh",display:"flex",flexDirection:"column",overflow:"hidden",boxShadow:"0 24px 64px rgba(0,0,0,.28)"},children:[y&&f&&s.chat?e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:14,padding:"10px 14px",borderBottom:`1px solid ${l.border}`,flexShrink:0},children:[e.jsx("div",{style:{display:"flex",flex:1,gap:4},children:[["support","Support"],["list","Feedback"]].map(([u,v])=>e.jsx("button",{onClick:()=>g(u),style:{flex:1,border:0,borderRadius:8,padding:"9px 12px",background:(a==="support"?u==="support":u==="list")?l.bgSoft:"transparent",color:(a==="support"?u==="support":u==="list")?l.text:l.textSoft,fontSize:12,fontWeight:600,cursor:"pointer"},children:v},u))}),e.jsx("button",{"aria-label":"Close",onClick:F,style:{border:0,background:"transparent",color:l.textSoft,padding:6,cursor:"pointer",fontSize:14},children:"✕"})]}):e.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:"16px 20px",borderBottom:`1px solid ${l.border}`,flexShrink:0},children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8},children:[a!=="list"&&e.jsx("button",{onClick:()=>g("list"),style:{background:"none",border:"none",cursor:"pointer",color:r,fontSize:13,fontWeight:600,padding:0},children:"← Back"}),a==="list"&&e.jsx("span",{style:{fontWeight:700,fontSize:16,color:l.text,letterSpacing:"-.01em"},children:"Feedback"}),a==="create"&&e.jsx("span",{style:{fontWeight:700,fontSize:16,color:l.text,letterSpacing:"-.01em"},children:"New feedback"})]}),e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8},children:[a==="list"&&e.jsx("button",{onClick:()=>g("create"),style:{background:r,color:"#fff",border:"none",borderRadius:20,padding:"6px 14px",fontSize:13,fontWeight:700,cursor:"pointer"},children:"+ New"}),e.jsx("button",{onClick:F,style:{background:l.bgSoft,border:"none",width:28,height:28,borderRadius:8,fontSize:14,cursor:"pointer",color:l.textSoft,display:"flex",alignItems:"center",justifyContent:"center"},children:"✕"})]})]}),e.jsxs("div",{style:{flex:1,overflowY:"auto",padding:a==="support"?0:"16px 20px 24px"},children:[a==="support"&&f&&s.chat&&e.jsx(V,{client:s.client,theme:l.bg==="#000000"?"dark":"light"}),y&&f&&s.chat&&a!=="support"&&e.jsx("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",marginBottom:16},children:a==="list"?e.jsxs(e.Fragment,{children:[e.jsx("span",{style:{fontSize:14,fontWeight:600,color:l.text},children:"Feedback & ideas"}),e.jsx("button",{onClick:()=>g("create"),style:{border:0,borderRadius:8,background:r,color:"white",fontSize:12,padding:"7px 10px",cursor:"pointer"},children:"+ New"})]}):e.jsx("button",{onClick:()=>g("list"),style:{border:0,background:"none",padding:0,color:l.textSoft,fontSize:12,cursor:"pointer"},children:"← Back to feedback"})}),a==="list"&&e.jsx(_,{onSelect:M,accent:r,p:l}),a==="detail"&&c&&e.jsx(q,{feedbackId:c,accent:r,p:l,font:C}),a==="create"&&e.jsx(K,{accent:r,p:l,font:C,onDone:()=>g("list")})]}),h&&a!=="support"&&e.jsxs("a",{href:"https://upstep.dev",target:"_blank",rel:"noopener noreferrer",style:{display:"block",textAlign:"center",padding:"8px 0",borderTop:`1px solid ${l.border}`,fontSize:11,color:l.textFaint,textDecoration:"none",flexShrink:0},children:["Powered by ",e.jsx("strong",{style:{fontWeight:700},children:"Upstep.dev"})]})]})})]})}function V({client:o,theme:n}){const t=i.useRef(null);return i.useEffect(()=>{if(t.current)return o.connectSupportFrame(t.current)},[o]),e.jsx("iframe",{ref:t,"data-upstep-support":!0,title:"Customer support",src:o.supportFrameUrl(n),style:{width:"100%",height:"min(560px, calc(88dvh - 56px))",minHeight:300,border:0,display:"block"}})}function _({onSelect:o,accent:n,p:t}){const{feedItems:x,vote:f}=w(),s=x.filter(r=>r.status!=="CLOSED");return s.length?e.jsx(e.Fragment,{children:s.map(r=>{const l=r.userVote==="UP",m=r.title??r.content;return e.jsxs("div",{onClick:()=>o(r.id),style:{display:"flex",gap:12,padding:14,border:`1px solid ${t.border}`,borderRadius:14,marginBottom:10,background:t.bg,cursor:"pointer"},children:[e.jsxs("button",{onClick:d=>{d.stopPropagation(),f(r.id,"UP")},style:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",gap:2,minWidth:46,padding:"7px 0",borderRadius:11,cursor:"pointer",flexShrink:0,border:`1px solid ${l?n:t.border}`,background:l?`${n}1a`:t.bgSoft},children:[e.jsx(U,{color:n}),e.jsx("span",{style:{fontSize:14,fontWeight:700,color:t.text,lineHeight:1.1},children:r.upvotes})]}),e.jsxs("div",{style:{flex:1,minWidth:0},children:[e.jsx("p",{style:{fontSize:13.5,fontWeight:600,lineHeight:1.4,color:t.text,margin:"0 0 6px",overflow:"hidden",display:"-webkit-box",WebkitLineClamp:2,WebkitBoxOrient:"vertical"},children:m}),e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:6,flexWrap:"wrap"},children:[e.jsx(I,{type:r.type,p:t}),r.status==="PENDING"?e.jsx(W,{}):e.jsx(T,{status:r.status,boardStatus:r.boardStatus,p:t}),e.jsx("span",{style:{fontSize:11,color:t.textFaint},children:R(r.createdAt)})]})]}),e.jsx("span",{style:{color:t.textFaint,fontSize:18,alignSelf:"center",flexShrink:0},children:"›"})]},r.id)})}):e.jsxs("div",{style:{textAlign:"center",padding:"40px 0"},children:[e.jsx("div",{style:{color:t.textSoft,fontSize:15,fontWeight:600,marginBottom:4},children:"No open feedback yet"}),e.jsx("div",{style:{color:t.textFaint,fontSize:14},children:"Be the first to share one."})]})}function q({feedbackId:o,accent:n,p:t,font:x}){const{vote:f,getItem:s}=w(),[r,l]=i.useState(null),[m,d]=i.useState(!1);i.useEffect(()=>{let a=!1;return s(o).then(g=>{a||l(g)}).catch(()=>{}),()=>{a=!0}},[o,s]);async function j(){if(!(!r||m)){d(!0);try{await f(r.id,"UP");const a=await s(o);l(a)}catch{}finally{d(!1)}}}if(!r)return e.jsx("div",{style:{textAlign:"center",padding:"40px 0",color:t.textFaint,fontSize:14},children:"Loading…"});const h=r.title;return e.jsxs("div",{children:[h&&e.jsx("div",{style:{fontSize:20,fontWeight:700,color:t.text,letterSpacing:"-.02em",marginBottom:10,lineHeight:1.3},children:h}),e.jsxs("div",{style:{display:"flex",gap:6,marginBottom:14,flexWrap:"wrap"},children:[e.jsx(I,{type:r.type,p:t}),r.status==="PENDING"?e.jsx(W,{}):e.jsx(T,{status:r.status,boardStatus:r.boardStatus,p:t})]}),e.jsx("p",{style:{fontSize:15,lineHeight:1.6,color:t.textSoft,marginBottom:20},children:r.content}),e.jsxs("button",{onClick:j,disabled:m,style:{display:"inline-flex",alignItems:"center",gap:8,border:`1px solid ${r.userVote==="UP"?n:t.border}`,background:r.userVote==="UP"?`${n}15`:t.bgSoft,borderRadius:12,padding:"10px 16px",cursor:"pointer",fontFamily:x},children:[e.jsx(U,{color:n,size:13}),e.jsx("span",{style:{fontSize:18,fontWeight:700,color:t.text},children:r.upvotes}),e.jsx("span",{style:{fontSize:13,color:t.textFaint},children:r.userVote==="UP"?"Upvoted":"Upvote"})]}),r.comments.length>0&&e.jsxs("div",{style:{marginTop:28,borderTop:`1px solid ${t.border}`,paddingTop:20},children:[e.jsx("div",{style:{fontSize:10,fontWeight:700,letterSpacing:".08em",color:t.textFaint,marginBottom:12,textTransform:"uppercase"},children:"Comments"}),r.comments.map(a=>e.jsx(Y,{comment:a,p:t,accent:n},a.id))]})]})}function Y({comment:o,p:n,accent:t}){var x;return e.jsxs("div",{style:{background:n.bgSoft,border:`1px solid ${n.border}`,borderRadius:12,padding:14,marginBottom:10},children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8,marginBottom:8},children:[e.jsx("span",{style:{background:`${t}20`,color:t,fontSize:11,fontWeight:700,borderRadius:20,padding:"2px 8px"},children:((x=o.authorName)==null?void 0:x.trim())||"UpStep Team"}),e.jsx("span",{style:{fontSize:11,color:n.textFaint},children:R(o.createdAt)})]}),e.jsx("p",{style:{fontSize:14,lineHeight:1.5,color:n.textSoft,margin:0},children:o.content})]})}function K({accent:o,p:n,font:t,onDone:x}){const{submit:f}=w(),[s,r]=i.useState(""),[l,m]=i.useState(""),[d,j]=i.useState("GENERAL"),[h,a]=i.useState(!1),[g,y]=i.useState(!1),[k,c]=i.useState("");async function b(){if(!(!s.trim()||h)){a(!0),c("");try{await f(s.trim(),l.trim()||s.trim(),d),y(!0),setTimeout(x,1200)}catch{c("Something went wrong. Please try again.")}finally{a(!1)}}}if(g)return e.jsxs("div",{style:{textAlign:"center",paddingTop:40},children:[e.jsx("div",{style:{fontSize:18,fontWeight:700,color:n.text,marginBottom:6},children:"Submitted"}),e.jsx("div",{style:{fontSize:14,color:n.textFaint},children:"Feedback received. Thank you."})]});const S={width:"100%",border:`1px solid ${n.border}`,borderRadius:12,padding:"10px 12px",fontSize:14,lineHeight:1.5,outline:"none",background:n.bgSoft,color:n.text,fontFamily:t,boxSizing:"border-box"};return e.jsxs("div",{children:[e.jsx("div",{style:{fontSize:10,fontWeight:700,letterSpacing:".08em",color:n.textFaint,marginBottom:8,textTransform:"uppercase"},children:"Type"}),e.jsx("div",{style:{display:"flex",gap:7,marginBottom:16},children:["BUG","FEATURE","GENERAL"].map(p=>e.jsxs("button",{onClick:()=>j(p),style:{flex:1,display:"flex",alignItems:"center",justifyContent:"center",gap:5,padding:"8px 10px",borderRadius:9,fontSize:12.5,fontWeight:600,cursor:"pointer",background:d===p?o:n.bg,color:d===p?"#fff":n.textSoft,border:`1px solid ${d===p?o:n.border}`,fontFamily:t},children:[E[p].icon,E[p].label]},p))}),e.jsx("div",{style:{fontSize:10,fontWeight:700,letterSpacing:".08em",color:n.textFaint,marginBottom:8,textTransform:"uppercase"},children:"Title"}),e.jsx("input",{value:s,onChange:p=>r(p.target.value),placeholder:"Short summary of the issue or idea",maxLength:200,style:{...S,marginBottom:16,display:"block"}}),e.jsxs("div",{style:{fontSize:10,fontWeight:700,letterSpacing:".08em",color:n.textFaint,marginBottom:8,textTransform:"uppercase"},children:["Description ",e.jsx("span",{style:{fontWeight:400,textTransform:"none",letterSpacing:0},children:"(optional)"})]}),e.jsx("textarea",{value:l,onChange:p=>m(p.target.value),placeholder:"Steps to reproduce, expected behaviour, or more context",maxLength:2e3,rows:4,style:{...S,resize:"vertical",marginBottom:16}}),k&&e.jsx("p",{style:{fontSize:13,color:"#d6453d",marginBottom:12},children:k}),e.jsx("button",{onClick:b,disabled:h||!s.trim(),style:{width:"100%",padding:12,background:o,color:"#fff",border:"none",borderRadius:11,fontSize:14,fontWeight:600,cursor:"pointer",opacity:h||!s.trim()?.5:1,fontFamily:t},children:h?"Submitting…":"Submit feedback"})]})}const E={BUG:{label:"Bug",icon:e.jsxs("svg",{width:12,height:12,viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.8,strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("ellipse",{cx:"8",cy:"10",rx:"3.5",ry:"4.5"}),e.jsx("path",{d:"M8 5.5V4M5.5 6.5 3.5 5M10.5 6.5 12.5 5M4.5 10.5 2.5 10M11.5 10.5 13.5 10"})]})},FEATURE:{label:"Feature",icon:e.jsxs("svg",{width:12,height:12,viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.8,strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("path",{d:"M8 2v1.5M8 12.5V14M2 8h1.5M12.5 8H14M4.1 4.1l1 1M10.9 10.9l1 1M11.9 4.1l-1 1M5.1 10.9l-1 1"}),e.jsx("circle",{cx:"8",cy:"8",r:"2.5"})]})},GENERAL:{label:"General",icon:e.jsx("svg",{width:12,height:12,viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.8,strokeLinecap:"round",strokeLinejoin:"round",children:e.jsx("path",{d:"M14 9a2 2 0 0 1-2 2H5L2 14V4a2 2 0 0 1 2-2h8a2 2 0 0 1 2 2v5z"})})}},J={BUG:"#fdecec",FEATURE:"#e9f0fd"},Q={BUG:"#d6453d",FEATURE:"#3b76d6"};function I({type:o,p:n}){return e.jsx("span",{style:{padding:"2px 8px",borderRadius:9999,fontSize:10.5,fontWeight:700,letterSpacing:".02em",background:J[o]??n.bgSoft,color:Q[o]??n.textSoft},children:o})}const X={OPEN:"#b45309",IN_PROGRESS:"#1d4ed8",DONE:"#15803d",CLOSED:"#6b7280"};function W(){return e.jsxs("span",{style:{display:"inline-flex",alignItems:"center",gap:4,background:"#fff7ed",border:"1px solid #fed7aa",borderRadius:6,padding:"1px 6px",fontSize:10,fontWeight:700,color:"#ea580c"},children:[e.jsx("span",{style:{width:5,height:5,borderRadius:"50%",background:"#ea580c",display:"inline-block"}}),"Pending review"]})}function T({status:o,boardStatus:n,p:t}){const x=(n==null?void 0:n.color)??X[o]??"#9ca3af";return e.jsxs("span",{style:{display:"inline-flex",alignItems:"center",gap:5,background:t.bgSoft,border:`1px solid ${t.border}`,borderRadius:6,padding:"2px 8px",fontSize:10,fontWeight:600,color:t.textSoft},children:[e.jsx("span",{style:{width:6,height:6,borderRadius:"50%",background:x,display:"inline-block",flexShrink:0}}),(n==null?void 0:n.name)??o.replace("_"," ")]})}function Z({size:o=16,color:n="currentColor"}){return e.jsx("svg",{width:o,height:o,viewBox:"0 0 24 24",fill:"none",stroke:n,strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round",children:e.jsx("path",{d:"M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z"})})}function U({color:o="currentColor",size:n=11}){return e.jsx("svg",{width:n,height:n,viewBox:"0 0 16 16",fill:"none",stroke:o,strokeWidth:2.2,strokeLinecap:"round",strokeLinejoin:"round",children:e.jsx("path",{d:"M8 13V3M3 8l5-5 5 5"})})}function R(o){return new Date(o).toLocaleDateString(void 0,{month:"short",day:"numeric"})}exports.FeedbackWidget=O;exports.UpstepProvider=G;exports.useUpstep=w;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),i=require("react"),A=require("./api-ZqVkOuh0.js"),D="#D97757",H={bg:"#ffffff",bgSoft:"#f5f5f5",bgHover:"#ededed",text:"#1a1915",textSoft:"#56544d",textFaint:"#9b9890",border:"#e8e6df",overlay:"rgba(26,25,21,.45)"},N={bg:"#000000",bgSoft:"#171717",bgHover:"#262626",text:"#f5f4f0",textSoft:"#b4b1a8",textFaint:"#7d7a72",border:"#33312c",overlay:"rgba(0,0,0,.6)"};function z(){if(typeof document>"u")return!1;const o=document.documentElement;return o.classList.contains("dark")||o.getAttribute("data-theme")==="dark"}function O(o){const[n,t]=i.useState(()=>o==="dark");return i.useEffect(()=>{if(o!=="auto"){t(o==="dark");return}if(t(z()),typeof MutationObserver>"u")return;const d=new MutationObserver(()=>t(z()));return d.observe(document.documentElement,{attributes:!0,attributeFilter:["class","data-theme"]}),()=>d.disconnect()},[o]),n?N:H}const B=i.createContext(null);function $({children:o,...n}){const[t]=i.useState(()=>new A.UpstepApiClient(n)),[d,c]=i.useState([]),[s,r]=i.useState(!1),[l,h]=i.useState(!0);i.useEffect(()=>{t.setUserId(n.userId)},[t,n.userId]),i.useEffect(()=>{t.supportIdentityToken=n.supportIdentityToken,document.querySelectorAll("iframe[data-upstep-support]").forEach(u=>{var m;return(m=u.contentWindow)==null?void 0:m.postMessage({type:"upstep:support:identity",token:n.supportIdentityToken},new URL(t.baseUrl).origin)})},[t,n.supportIdentityToken]);const p=i.useCallback(async()=>{try{const u=await t.listFeedback({sort:"votes",limit:20});c(u.items),h(u.showBranding??!0)}catch{}},[t]);i.useEffect(()=>{p()},[p]);const j=i.useCallback(async(u,m,S)=>{const x={content:m};u.trim()&&(x.title=u.trim()),S!==void 0&&(x.type=S),await t.submitFeedback(x),await p()},[t,p]),b=i.useCallback(async(u,m)=>{try{await t.vote(u,m),await p()}catch{}},[t,p]),a=i.useCallback(u=>t.getItem(u),[t]),g=i.useCallback(()=>r(!0),[]),y=i.useCallback(()=>r(!1),[]),k=i.useCallback(u=>t.setUserId(u),[t]);return e.jsx(B.Provider,{value:{client:t,feedItems:d,loadFeed:p,submit:j,vote:b,getItem:a,isOpen:s,open:g,close:y,identify:k,accentColor:n.accentColor??D,theme:n.theme??"auto",showBranding:l,chat:n.chat!==!1},children:o})}function w(){const o=i.useContext(B);if(!o)throw new Error("useUpstep must be used inside <UpstepProvider>");return o}function G({position:o="bottom-right",accentColor:n,theme:t,hideLauncher:d=!1,chat:c=!0}){const s=w(),r=n??s.accentColor,l=O(t??s.theme),{isOpen:h,open:p,close:j,showBranding:b}=s,[a,g]=i.useState("list"),[y,k]=i.useState(!1);i.useEffect(()=>{let f=!0;if(s.client.chat=s.chat,!s.chat||!c){k(!1);return}return s.client.supportEnabled().then(v=>{f&&k(v)}),()=>{f=!1}},[s.client,s.chat,c]),i.useEffect(()=>{(!s.chat||!c)&&a==="support"&&g("list")},[s.chat,c,a]),i.useEffect(()=>{h&&g(y&&c&&s.chat?"support":"list")},[h,y,c,s.chat]);const[u,m]=i.useState(null),[S,x]=i.useState(!1);i.useEffect(()=>{const f=window.matchMedia("(max-width: 639px)");x(f.matches);const v=P=>x(P.matches);return f.addEventListener("change",v),()=>f.removeEventListener("change",v)},[]);const L={position:"fixed",bottom:24,right:24},C='-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Helvetica,Arial,sans-serif';function F(){j(),m(null)}function M(f){m(f),g("detail")}return e.jsxs(e.Fragment,{children:[!d&&e.jsxs("button",{"aria-label":"Open help and feedback",onClick:p,style:{...L,zIndex:9998,display:"inline-flex",alignItems:"center",gap:7,background:r,color:"#fff",border:"none",borderRadius:9999,padding:S?"12px":"12px 18px",fontSize:14,fontWeight:600,cursor:"pointer",fontFamily:C,boxShadow:"0 6px 20px rgba(26,25,21,.18)"},children:[e.jsx(Z,{size:16}),!S&&(y&&c&&s.chat?"Help & feedback":"Feedback")]}),h&&e.jsx("div",{onClick:f=>f.target===f.currentTarget&&F(),style:{position:"fixed",inset:0,background:"transparent",zIndex:9999,display:"flex",alignItems:"flex-end",justifyContent:"flex-end",padding:S?"0 12px 80px":"0 24px 88px",fontFamily:C},children:e.jsxs("div",{style:{background:l.bg,border:`1px solid ${l.border}`,borderRadius:20,width:"100%",maxWidth:y&&c&&s.chat?460:440,maxHeight:"calc(100dvh - 112px)",display:"flex",flexDirection:"column",overflow:"hidden",boxShadow:"0 24px 64px rgba(0,0,0,.28)"},children:[y&&c&&s.chat?e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:14,padding:"10px 14px",borderBottom:`1px solid ${l.border}`,flexShrink:0},children:[e.jsx("div",{style:{display:"flex",flex:1,gap:4},children:[["support","Support"],["list","Feedback"]].map(([f,v])=>e.jsx("button",{onClick:()=>g(f),style:{flex:1,border:0,borderRadius:8,padding:"9px 12px",background:(a==="support"?f==="support":f==="list")?l.bgSoft:"transparent",color:(a==="support"?f==="support":f==="list")?l.text:l.textSoft,fontSize:14,fontWeight:600,cursor:"pointer"},children:v},f))}),e.jsx("button",{"aria-label":"Close",onClick:F,style:{border:0,background:"transparent",color:l.textSoft,padding:6,cursor:"pointer",fontSize:14},children:"✕"})]}):e.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:"16px 20px",borderBottom:`1px solid ${l.border}`,flexShrink:0},children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8},children:[a!=="list"&&e.jsx("button",{onClick:()=>g("list"),style:{background:"none",border:"none",cursor:"pointer",color:r,fontSize:14,fontWeight:600,padding:0},children:"← Back"}),a==="list"&&e.jsx("span",{style:{fontWeight:700,fontSize:16,color:l.text,letterSpacing:"-.01em"},children:"Feedback"}),a==="create"&&e.jsx("span",{style:{fontWeight:700,fontSize:16,color:l.text,letterSpacing:"-.01em"},children:"New feedback"})]}),e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8},children:[a==="list"&&e.jsx("button",{onClick:()=>g("create"),style:{background:r,color:"#fff",border:"none",borderRadius:20,padding:"6px 14px",fontSize:14,fontWeight:700,cursor:"pointer"},children:"+ New"}),e.jsx("button",{onClick:F,style:{background:l.bgSoft,border:"none",width:28,height:28,borderRadius:8,fontSize:14,cursor:"pointer",color:l.textSoft,display:"flex",alignItems:"center",justifyContent:"center"},children:"✕"})]})]}),e.jsxs("div",{style:{flex:1,overflowY:"auto",padding:a==="support"?0:"16px 20px 24px"},children:[a==="support"&&c&&s.chat&&e.jsx(V,{client:s.client,accentColor:r,theme:l.bg==="#000000"?"dark":"light"}),y&&c&&s.chat&&a!=="support"&&e.jsx("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",marginBottom:16},children:a==="list"?e.jsxs(e.Fragment,{children:[e.jsx("span",{style:{fontSize:14,fontWeight:600,color:l.text},children:"Feedback & ideas"}),e.jsx("button",{onClick:()=>g("create"),style:{border:0,borderRadius:8,background:r,color:"white",fontSize:14,padding:"7px 10px",cursor:"pointer"},children:"+ New"})]}):e.jsx("button",{onClick:()=>g("list"),style:{border:0,background:"none",padding:0,color:l.textSoft,fontSize:14,cursor:"pointer"},children:"← Back to feedback"})}),a==="list"&&e.jsx(_,{onSelect:M,accent:r,p:l}),a==="detail"&&u&&e.jsx(q,{feedbackId:u,accent:r,p:l,font:C}),a==="create"&&e.jsx(K,{accent:r,p:l,font:C,onDone:()=>g("list")})]}),b&&a!=="support"&&e.jsxs("a",{href:"https://upstep.dev",target:"_blank",rel:"noopener noreferrer",style:{display:"block",textAlign:"center",padding:"8px 0",borderTop:`1px solid ${l.border}`,fontSize:11,color:l.textFaint,textDecoration:"none",flexShrink:0},children:["Powered by"," ",e.jsx("strong",{style:{fontWeight:700},children:"Upstep.dev"})]})]})})]})}function V({client:o,theme:n,accentColor:t}){const d=i.useRef(null);return i.useEffect(()=>{if(d.current)return o.connectSupportFrame(d.current)},[o]),e.jsx("iframe",{ref:d,"data-upstep-support":!0,title:"Customer support",src:o.supportFrameUrl(n,t),style:{color:t,width:"100%",height:"min(560px, calc(100dvh - 168px))",minHeight:300,border:0,display:"block"}})}function _({onSelect:o,accent:n,p:t}){const{feedItems:d,vote:c}=w(),s=d.filter(r=>r.status!=="CLOSED");return s.length?e.jsx(e.Fragment,{children:s.map(r=>{const l=r.userVote==="UP",h=r.title??r.content;return e.jsxs("div",{onClick:()=>o(r.id),style:{display:"flex",gap:12,padding:14,border:`1px solid ${t.border}`,borderRadius:14,marginBottom:10,background:t.bg,cursor:"pointer"},children:[e.jsxs("button",{onClick:p=>{p.stopPropagation(),c(r.id,"UP")},style:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",gap:2,minWidth:46,padding:"7px 0",borderRadius:11,cursor:"pointer",flexShrink:0,border:`1px solid ${l?n:t.border}`,background:l?`${n}1a`:t.bgSoft},children:[e.jsx(U,{color:n}),e.jsx("span",{style:{fontSize:14,fontWeight:700,color:t.text,lineHeight:1.1},children:r.upvotes})]}),e.jsxs("div",{style:{flex:1,minWidth:0},children:[e.jsx("p",{style:{fontSize:14,fontWeight:600,lineHeight:1.4,color:t.text,margin:"0 0 6px",overflow:"hidden",display:"-webkit-box",WebkitLineClamp:2,WebkitBoxOrient:"vertical"},children:h}),e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:6,flexWrap:"wrap"},children:[e.jsx(I,{type:r.type,p:t}),r.status==="PENDING"?e.jsx(W,{}):e.jsx(T,{status:r.status,boardStatus:r.boardStatus,p:t}),e.jsx("span",{style:{fontSize:11,color:t.textFaint},children:R(r.createdAt)})]})]}),e.jsx("span",{style:{color:t.textFaint,fontSize:18,alignSelf:"center",flexShrink:0},children:"›"})]},r.id)})}):e.jsxs("div",{style:{textAlign:"center",padding:"40px 0"},children:[e.jsx("div",{style:{color:t.textSoft,fontSize:15,fontWeight:600,marginBottom:4},children:"No open feedback yet"}),e.jsx("div",{style:{color:t.textFaint,fontSize:14},children:"Be the first to share one."})]})}function q({feedbackId:o,accent:n,p:t,font:d}){const{vote:c,getItem:s}=w(),[r,l]=i.useState(null),[h,p]=i.useState(!1);i.useEffect(()=>{let a=!1;return s(o).then(g=>{a||l(g)}).catch(()=>{}),()=>{a=!0}},[o,s]);async function j(){if(!(!r||h)){p(!0);try{await c(r.id,"UP");const a=await s(o);l(a)}catch{}finally{p(!1)}}}if(!r)return e.jsx("div",{style:{textAlign:"center",padding:"40px 0",color:t.textFaint,fontSize:14},children:"Loading…"});const b=r.title;return e.jsxs("div",{children:[b&&e.jsx("div",{style:{fontSize:20,fontWeight:700,color:t.text,letterSpacing:"-.02em",marginBottom:10,lineHeight:1.3},children:b}),e.jsxs("div",{style:{display:"flex",gap:6,marginBottom:14,flexWrap:"wrap"},children:[e.jsx(I,{type:r.type,p:t}),r.status==="PENDING"?e.jsx(W,{}):e.jsx(T,{status:r.status,boardStatus:r.boardStatus,p:t})]}),e.jsx("p",{style:{fontSize:15,lineHeight:1.6,color:t.textSoft,marginBottom:20},children:r.content}),e.jsxs("button",{onClick:j,disabled:h,style:{display:"inline-flex",alignItems:"center",gap:8,border:`1px solid ${r.userVote==="UP"?n:t.border}`,background:r.userVote==="UP"?`${n}15`:t.bgSoft,borderRadius:12,padding:"10px 16px",cursor:"pointer",fontFamily:d},children:[e.jsx(U,{color:n,size:13}),e.jsx("span",{style:{fontSize:18,fontWeight:700,color:t.text},children:r.upvotes}),e.jsx("span",{style:{fontSize:14,color:t.textFaint},children:r.userVote==="UP"?"Upvoted":"Upvote"})]}),r.comments.length>0&&e.jsxs("div",{style:{marginTop:28,borderTop:`1px solid ${t.border}`,paddingTop:20},children:[e.jsx("div",{style:{fontSize:10,fontWeight:700,letterSpacing:".08em",color:t.textFaint,marginBottom:12,textTransform:"uppercase"},children:"Comments"}),r.comments.map(a=>e.jsx(Y,{comment:a,p:t,accent:n},a.id))]})]})}function Y({comment:o,p:n,accent:t}){var d;return e.jsxs("div",{style:{background:n.bgSoft,border:`1px solid ${n.border}`,borderRadius:12,padding:14,marginBottom:10},children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8,marginBottom:8},children:[e.jsx("span",{style:{background:`${t}20`,color:t,fontSize:11,fontWeight:700,borderRadius:20,padding:"2px 8px"},children:((d=o.authorName)==null?void 0:d.trim())||"UpStep Team"}),e.jsx("span",{style:{fontSize:11,color:n.textFaint},children:R(o.createdAt)})]}),e.jsx("p",{style:{fontSize:16,lineHeight:1.6,color:n.textSoft,margin:0},children:o.content})]})}function K({accent:o,p:n,font:t,onDone:d}){const{submit:c}=w(),[s,r]=i.useState(""),[l,h]=i.useState(""),[p,j]=i.useState("GENERAL"),[b,a]=i.useState(!1),[g,y]=i.useState(!1),[k,u]=i.useState("");async function m(){if(!(!s.trim()||b)){a(!0),u("");try{await c(s.trim(),l.trim()||s.trim(),p),y(!0),setTimeout(d,1200)}catch{u("Something went wrong. Please try again.")}finally{a(!1)}}}if(g)return e.jsxs("div",{style:{textAlign:"center",paddingTop:40},children:[e.jsx("div",{style:{fontSize:18,fontWeight:700,color:n.text,marginBottom:6},children:"Submitted"}),e.jsx("div",{style:{fontSize:14,color:n.textFaint},children:"Feedback received. Thank you."})]});const S={width:"100%",border:`1px solid ${n.border}`,borderRadius:12,padding:"10px 12px",fontSize:16,lineHeight:1.6,outline:"none",background:n.bgSoft,color:n.text,fontFamily:t,boxSizing:"border-box"};return e.jsxs("div",{children:[e.jsx("div",{style:{fontSize:10,fontWeight:700,letterSpacing:".08em",color:n.textFaint,marginBottom:8,textTransform:"uppercase"},children:"Type"}),e.jsx("div",{style:{display:"flex",gap:7,marginBottom:16},children:["BUG","FEATURE","GENERAL"].map(x=>e.jsxs("button",{onClick:()=>j(x),style:{flex:1,display:"flex",alignItems:"center",justifyContent:"center",gap:5,padding:"8px 10px",borderRadius:9,fontSize:14,fontWeight:600,cursor:"pointer",background:p===x?o:n.bg,color:p===x?"#fff":n.textSoft,border:`1px solid ${p===x?o:n.border}`,fontFamily:t},children:[E[x].icon,E[x].label]},x))}),e.jsx("div",{style:{fontSize:10,fontWeight:700,letterSpacing:".08em",color:n.textFaint,marginBottom:8,textTransform:"uppercase"},children:"Title"}),e.jsx("input",{value:s,onChange:x=>r(x.target.value),placeholder:"Short summary of the issue or idea",maxLength:200,style:{...S,marginBottom:16,display:"block"}}),e.jsxs("div",{style:{fontSize:10,fontWeight:700,letterSpacing:".08em",color:n.textFaint,marginBottom:8,textTransform:"uppercase"},children:["Description"," ",e.jsx("span",{style:{fontWeight:400,textTransform:"none",letterSpacing:0},children:"(optional)"})]}),e.jsx("textarea",{value:l,onChange:x=>h(x.target.value),placeholder:"Steps to reproduce, expected behaviour, or more context",maxLength:2e3,rows:4,style:{...S,resize:"vertical",marginBottom:16}}),k&&e.jsx("p",{style:{fontSize:14,color:"#d6453d",marginBottom:12},children:k}),e.jsx("button",{onClick:m,disabled:b||!s.trim(),style:{width:"100%",padding:12,background:o,color:"#fff",border:"none",borderRadius:11,fontSize:14,fontWeight:600,cursor:"pointer",opacity:b||!s.trim()?.5:1,fontFamily:t},children:b?"Submitting…":"Submit feedback"})]})}const E={BUG:{label:"Bug",icon:e.jsxs("svg",{width:12,height:12,viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.8,strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("ellipse",{cx:"8",cy:"10",rx:"3.5",ry:"4.5"}),e.jsx("path",{d:"M8 5.5V4M5.5 6.5 3.5 5M10.5 6.5 12.5 5M4.5 10.5 2.5 10M11.5 10.5 13.5 10"})]})},FEATURE:{label:"Feature",icon:e.jsxs("svg",{width:12,height:12,viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.8,strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("path",{d:"M8 2v1.5M8 12.5V14M2 8h1.5M12.5 8H14M4.1 4.1l1 1M10.9 10.9l1 1M11.9 4.1l-1 1M5.1 10.9l-1 1"}),e.jsx("circle",{cx:"8",cy:"8",r:"2.5"})]})},GENERAL:{label:"General",icon:e.jsx("svg",{width:12,height:12,viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.8,strokeLinecap:"round",strokeLinejoin:"round",children:e.jsx("path",{d:"M14 9a2 2 0 0 1-2 2H5L2 14V4a2 2 0 0 1 2-2h8a2 2 0 0 1 2 2v5z"})})}},J={BUG:"#fdecec",FEATURE:"#e9f0fd"},Q={BUG:"#d6453d",FEATURE:"#3b76d6"};function I({type:o,p:n}){return e.jsx("span",{style:{padding:"2px 8px",borderRadius:9999,fontSize:10.5,fontWeight:700,letterSpacing:".02em",background:J[o]??n.bgSoft,color:Q[o]??n.textSoft},children:o})}const X={OPEN:"#b45309",IN_PROGRESS:"#1d4ed8",DONE:"#15803d",CLOSED:"#6b7280"};function W(){return e.jsxs("span",{style:{display:"inline-flex",alignItems:"center",gap:4,background:"#fff7ed",border:"1px solid #fed7aa",borderRadius:6,padding:"1px 6px",fontSize:10,fontWeight:700,color:"#ea580c"},children:[e.jsx("span",{style:{width:5,height:5,borderRadius:"50%",background:"#ea580c",display:"inline-block"}}),"Pending review"]})}function T({status:o,boardStatus:n,p:t}){const d=(n==null?void 0:n.color)??X[o]??"#9ca3af";return e.jsxs("span",{style:{display:"inline-flex",alignItems:"center",gap:5,background:t.bgSoft,border:`1px solid ${t.border}`,borderRadius:6,padding:"2px 8px",fontSize:10,fontWeight:600,color:t.textSoft},children:[e.jsx("span",{style:{width:6,height:6,borderRadius:"50%",background:d,display:"inline-block",flexShrink:0}}),(n==null?void 0:n.name)??o.replace("_"," ")]})}function Z({size:o=16,color:n="currentColor"}){return e.jsx("svg",{width:o,height:o,viewBox:"0 0 24 24",fill:"none",stroke:n,strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round",children:e.jsx("path",{d:"M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z"})})}function U({color:o="currentColor",size:n=11}){return e.jsx("svg",{width:n,height:n,viewBox:"0 0 16 16",fill:"none",stroke:o,strokeWidth:2.2,strokeLinecap:"round",strokeLinejoin:"round",children:e.jsx("path",{d:"M8 13V3M3 8l5-5 5 5"})})}function R(o){return new Date(o).toLocaleDateString(void 0,{month:"short",day:"numeric"})}exports.FeedbackWidget=G;exports.UpstepProvider=$;exports.useUpstep=w;
|
package/dist/react.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"react.d.ts","sourceRoot":"","sources":["../src/react.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAOZ,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;AACf,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"react.d.ts","sourceRoot":"","sources":["../src/react.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAOZ,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;AACf,OAAO,KAAK,EAEV,QAAQ,EACR,YAAY,EACZ,oBAAoB,EACpB,YAAY,EACb,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,eAAe,EAAE,MAAM,OAAO,CAAC;AAMxC,KAAK,SAAS,GAAG,OAAO,GAAG,MAAM,GAAG,MAAM,CAAC;AAmF3C,UAAU,kBAAkB;IAC1B,MAAM,EAAE,eAAe,CAAC;IACxB,SAAS,EAAE,QAAQ,EAAE,CAAC;IACtB,QAAQ,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;IAC9B,MAAM,EAAE,CACN,KAAK,EAAE,MAAM,EACb,OAAO,EAAE,MAAM,EACf,IAAI,CAAC,EAAE,YAAY,KAChB,OAAO,CAAC,IAAI,CAAC,CAAC;IACnB,IAAI,EAAE,CAAC,UAAU,EAAE,MAAM,EAAE,KAAK,EAAE,IAAI,GAAG,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IAClE,OAAO,EAAE,CAAC,UAAU,EAAE,MAAM,KAAK,OAAO,CAAC,oBAAoB,CAAC,CAAC;IAC/D,MAAM,EAAE,OAAO,CAAC;IAChB,IAAI,EAAE,MAAM,IAAI,CAAC;IACjB,KAAK,EAAE,MAAM,IAAI,CAAC;IAClB,QAAQ,EAAE,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,KAAK,IAAI,CAAC;IAC/C,WAAW,EAAE,MAAM,CAAC;IACpB,KAAK,EAAE,SAAS,CAAC;IACjB,YAAY,EAAE,OAAO,CAAC;IACtB,IAAI,EAAE,OAAO,CAAC;CACf;AAID,wBAAgB,cAAc,CAAC,EAC7B,QAAQ,EACR,GAAG,MAAM,EACV,EAAE,YAAY,GAAG;IAAE,QAAQ,EAAE,SAAS,CAAA;CAAE,qBAgGxC;AAED,wBAAgB,SAAS,IAAI,kBAAkB,CAI9C;AAID,UAAU,mBAAmB;IAC3B,QAAQ,CAAC,EAAE,cAAc,GAAG,aAAa,CAAC;IAC1C,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,mFAAmF;IACnF,IAAI,CAAC,EAAE,OAAO,CAAC;CAChB;AAID,wBAAgB,cAAc,CAAC,EAC7B,QAAyB,EACzB,WAAW,EACX,KAAK,EACL,YAAoB,EACpB,IAAW,GACZ,EAAE,mBAAmB,qBAsYrB"}
|