@firstlook-uat/sdk 0.4.1 → 0.4.2
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/dist/firstlook.es.js +32 -33
- package/dist/firstlook.es.js.map +1 -1
- package/dist/firstlook.umd.js +4 -4
- package/dist/firstlook.umd.js.map +1 -1
- package/package.json +1 -1
package/dist/firstlook.es.js
CHANGED
|
@@ -218,7 +218,7 @@ class N {
|
|
|
218
218
|
f.textContent = `✓ ${b}/${this.checklist.length} 確認済み`;
|
|
219
219
|
};
|
|
220
220
|
p(), h.appendChild(f), c.preamble && h.appendChild(r("p", { className: "fl-quest-description" }, [c.preamble]));
|
|
221
|
-
const
|
|
221
|
+
const g = r("ul", { className: "fl-checklist" });
|
|
222
222
|
for (const b of this.checklist) {
|
|
223
223
|
const k = r("li", { className: "fl-checklist-item" }), v = document.createElement("input");
|
|
224
224
|
v.type = "checkbox", v.className = "fl-checklist-checkbox", v.checked = b.checked;
|
|
@@ -227,9 +227,9 @@ class N {
|
|
|
227
227
|
b.checked = v.checked, k.classList.toggle("fl-checked", b.checked), p();
|
|
228
228
|
}, k.onclick = (q) => {
|
|
229
229
|
q.target !== v && (v.checked = !v.checked, b.checked = v.checked, k.classList.toggle("fl-checked", b.checked), p());
|
|
230
|
-
}, k.appendChild(v), k.appendChild(T),
|
|
230
|
+
}, k.appendChild(v), k.appendChild(T), g.appendChild(k);
|
|
231
231
|
}
|
|
232
|
-
h.appendChild(
|
|
232
|
+
h.appendChild(g);
|
|
233
233
|
} else
|
|
234
234
|
h.appendChild(r("p", { className: "fl-quest-description" }, [t.description]));
|
|
235
235
|
h.appendChild(r("div", { className: "fl-quest-memo-row" }, [
|
|
@@ -251,9 +251,9 @@ class N {
|
|
|
251
251
|
"REC"
|
|
252
252
|
])
|
|
253
253
|
);
|
|
254
|
-
const
|
|
255
|
-
d.appendChild(
|
|
256
|
-
this.minimized && (this.minimized = !1, this.root.className = "fl-quest-overlay", this.root.innerHTML = "", this.root.appendChild(n), this.root.appendChild(o), this.startTimer(
|
|
254
|
+
const m = r("span", { className: "fl-status-timer" }, ["00:00"]);
|
|
255
|
+
d.appendChild(m), o.appendChild(d), this.root.appendChild(o), this.startTimer(m), this.root.onclick = () => {
|
|
256
|
+
this.minimized && (this.minimized = !1, this.root.className = "fl-quest-overlay", this.root.innerHTML = "", this.root.appendChild(n), this.root.appendChild(o), this.startTimer(m));
|
|
257
257
|
};
|
|
258
258
|
}
|
|
259
259
|
renderFeedbackModal(t, e = "memo") {
|
|
@@ -286,25 +286,24 @@ class N {
|
|
|
286
286
|
memo: "気づいたことをメモ...📝"
|
|
287
287
|
}, d = document.createElement("textarea");
|
|
288
288
|
d.className = "fl-feedback-textarea fl-feedback-textarea-modal", d.placeholder = h[e], d.rows = 3, c.appendChild(d);
|
|
289
|
-
const
|
|
289
|
+
const m = "送信", f = e === "ok" ? "スキップ" : "キャンセル", p = r("div", { className: "fl-quest-actions fl-feedback-modal-actions" }, [
|
|
290
290
|
this.createButton("fl-btn fl-btn-skip", f, () => {
|
|
291
|
-
e === "ng" ? this.callbacks.onNgWithFeedback("") : e === "ok"
|
|
291
|
+
e === "ng" ? this.callbacks.onNgWithFeedback("") : e === "ok" ? this.callbacks.onOkWithFeedback("") : e === "concern" && this.callbacks.onConcern(""), s.remove();
|
|
292
292
|
}),
|
|
293
|
-
this.createButton("fl-btn fl-btn-finish",
|
|
294
|
-
const
|
|
293
|
+
this.createButton("fl-btn fl-btn-finish", m, () => {
|
|
294
|
+
const g = d.value.trim();
|
|
295
295
|
if (e === "ng")
|
|
296
|
-
this.callbacks.onNgWithFeedback(
|
|
296
|
+
this.callbacks.onNgWithFeedback(g);
|
|
297
297
|
else if (e === "ok")
|
|
298
|
-
this.callbacks.onOkWithFeedback(
|
|
299
|
-
else if (e === "concern")
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
if (!m) {
|
|
298
|
+
this.callbacks.onOkWithFeedback(g);
|
|
299
|
+
else if (e === "concern")
|
|
300
|
+
this.callbacks.onConcern(g);
|
|
301
|
+
else {
|
|
302
|
+
if (!g) {
|
|
304
303
|
s.remove();
|
|
305
304
|
return;
|
|
306
305
|
}
|
|
307
|
-
this.callbacks.onMemo(
|
|
306
|
+
this.callbacks.onMemo(g);
|
|
308
307
|
}
|
|
309
308
|
s.remove();
|
|
310
309
|
})
|
|
@@ -782,16 +781,16 @@ class K {
|
|
|
782
781
|
<foreignObject width="100%" height="100%">
|
|
783
782
|
${l}
|
|
784
783
|
</foreignObject>
|
|
785
|
-
</svg>`, h = new Blob([c], { type: "image/svg+xml;charset=utf-8" }), d = URL.createObjectURL(h),
|
|
786
|
-
|
|
787
|
-
const f =
|
|
784
|
+
</svg>`, h = new Blob([c], { type: "image/svg+xml;charset=utf-8" }), d = URL.createObjectURL(h), m = document.createElement("canvas");
|
|
785
|
+
m.width = t * window.devicePixelRatio, m.height = e * window.devicePixelRatio;
|
|
786
|
+
const f = m.getContext("2d");
|
|
788
787
|
return f.scale(window.devicePixelRatio, window.devicePixelRatio), new Promise((p) => {
|
|
789
|
-
const
|
|
790
|
-
|
|
791
|
-
f.drawImage(
|
|
792
|
-
},
|
|
788
|
+
const g = new Image();
|
|
789
|
+
g.onload = () => {
|
|
790
|
+
f.drawImage(g, 0, 0, t, e), URL.revokeObjectURL(d), p(m.toDataURL("image/png"));
|
|
791
|
+
}, g.onerror = () => {
|
|
793
792
|
URL.revokeObjectURL(d), p(this.captureScreenshotFallback(t, e));
|
|
794
|
-
},
|
|
793
|
+
}, g.src = d;
|
|
795
794
|
});
|
|
796
795
|
} catch {
|
|
797
796
|
return this.captureScreenshotFallback(window.innerWidth, window.innerHeight);
|
|
@@ -1560,7 +1559,7 @@ class G {
|
|
|
1560
1559
|
* End the current session, persist data, and trigger upload.
|
|
1561
1560
|
*/
|
|
1562
1561
|
async endSession() {
|
|
1563
|
-
var i, n, o, l, c, h, d,
|
|
1562
|
+
var i, n, o, l, c, h, d, m, f, p, g;
|
|
1564
1563
|
if (this.state !== "recording" || !this.sessionId) return null;
|
|
1565
1564
|
this.maxDurationTimer && (clearTimeout(this.maxDurationTimer), this.maxDurationTimer = null), this.backupTimer && (clearInterval(this.backupTimer), this.backupTimer = null), (i = this.sessionRecorder) == null || i.stop(), await ((n = this.voiceRecorder) == null ? void 0 : n.stopAsync()), (o = this.issueReporter) == null || o.stop(), (l = this.fieldMasker) == null || l.stop(), (c = this.watermark) == null || c.hide();
|
|
1566
1565
|
const t = this.questManager.getResults();
|
|
@@ -1599,10 +1598,10 @@ class G {
|
|
|
1599
1598
|
recordings: ((h = this.sessionRecorder) == null ? void 0 : h.getSnapshots()) ?? []
|
|
1600
1599
|
};
|
|
1601
1600
|
await ((d = this.storage) == null ? void 0 : d.saveSession(e));
|
|
1602
|
-
const s = ((
|
|
1601
|
+
const s = ((m = this.issueReporter) == null ? void 0 : m.getAnnotations()) ?? [];
|
|
1603
1602
|
for (const b of s)
|
|
1604
1603
|
await ((f = this.storage) == null ? void 0 : f.saveAnnotation(this.sessionId, b));
|
|
1605
|
-
return await ((p = this.storage) == null ? void 0 : p.enqueueUpload({ session: e, annotations: s })), (
|
|
1604
|
+
return await ((p = this.storage) == null ? void 0 : p.enqueueUpload({ session: e, annotations: s })), (g = this.questOverlay) == null || g.destroy(), this.questOverlay = null, this.state = "finished", this.events.emit({ type: "session:ended", sessionId: this.sessionId }), this.flushUploadQueue(!1), e;
|
|
1606
1605
|
}
|
|
1607
1606
|
/**
|
|
1608
1607
|
* Subscribe to SDK events.
|
|
@@ -1620,9 +1619,9 @@ class G {
|
|
|
1620
1619
|
* Completely destroy the SDK instance and clean up all resources.
|
|
1621
1620
|
*/
|
|
1622
1621
|
destroy() {
|
|
1623
|
-
var t, e, s, i, n, o, l, c, h, d,
|
|
1622
|
+
var t, e, s, i, n, o, l, c, h, d, m, f;
|
|
1624
1623
|
this.maxDurationTimer && (clearTimeout(this.maxDurationTimer), this.maxDurationTimer = null), this.backupTimer && (clearInterval(this.backupTimer), this.backupTimer = null), (t = this.tapTrigger) == null || t.stop(), (e = this.deepLinkTrigger) == null || e.stop(), (s = this.keyboardTrigger) == null || s.stop(), C.clearPersisted(), (i = this.sessionRecorder) == null || i.stop(), (n = this.voiceRecorder) == null || n.stopAsync().catch(() => {
|
|
1625
|
-
}), (o = this.issueReporter) == null || o.stop(), (l = this.fieldMasker) == null || l.stop(), (c = this.watermark) == null || c.hide(), (h = this.questOverlay) == null || h.destroy(), (d = this.debugMenu) == null || d.hide(), (
|
|
1624
|
+
}), (o = this.issueReporter) == null || o.stop(), (l = this.fieldMasker) == null || l.stop(), (c = this.watermark) == null || c.hide(), (h = this.questOverlay) == null || h.destroy(), (d = this.debugMenu) == null || d.hide(), (m = this.hostElement) == null || m.remove(), (f = this.storage) == null || f.close(), this.events.removeAll(), this.config = null, this.questManager = null, this.questOverlay = null, this.sessionRecorder = null, this.voiceRecorder = null, this.issueReporter = null, this.fieldMasker = null, this.debugMenu = null, this.tapTrigger = null, this.deepLinkTrigger = null, this.keyboardTrigger = null, this.storage = null, this.hostElement = null, this.shadowRoot = null, this.sessionId = null, this.state = "idle";
|
|
1626
1625
|
}
|
|
1627
1626
|
// ----------------------------------------------------------------
|
|
1628
1627
|
// Private methods
|
|
@@ -1696,8 +1695,8 @@ class G {
|
|
|
1696
1695
|
if (!this.questManager || !this.questOverlay) return;
|
|
1697
1696
|
const t = this.questManager.getStatus();
|
|
1698
1697
|
if (t.isBlocked) {
|
|
1699
|
-
const
|
|
1700
|
-
this.questOverlay.renderBlocked(
|
|
1698
|
+
const n = this.questManager.getResults().find((l) => l.status === "FAILED"), o = n ? n.questId : "Unknown";
|
|
1699
|
+
this.questOverlay.renderBlocked(o);
|
|
1701
1700
|
return;
|
|
1702
1701
|
}
|
|
1703
1702
|
if (t.isFinished) {
|