@getpinax/widget 1.0.0-beta.1 → 1.0.0-beta.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/README.md +270 -24
- package/dist/a11y/scan.d.ts +25 -0
- package/dist/api.d.ts +25 -4
- package/dist/capture/breadcrumbs.d.ts +1 -1
- package/dist/capture/network.d.ts +1 -1
- package/dist/capture/signature.d.ts +5 -0
- package/dist/capture/text.d.ts +17 -1
- package/dist/chunks/{editor-DbHLGwOA.mjs → editor-0Kr31Uly.mjs} +35 -35
- package/dist/chunks/{privacy-DmU6v5Fr.mjs → privacy-B_b1_Y1n.mjs} +2 -2
- package/dist/chunks/{recorder-BUtEB_em.mjs → recorder-tu4yugLw.mjs} +52 -37
- package/dist/chunks/scan-CFQwrtAQ.mjs +46137 -0
- package/dist/chunks/text-D9SaDBT0.mjs +36 -0
- package/dist/chunks/{widget-CkR1Ptzb.mjs → widget-BpTBdX2R.mjs} +530 -219
- package/dist/editor-loader.d.ts +3 -0
- package/dist/editor-loader.embed.d.ts +2 -1
- package/dist/fixcheck.d.ts +11 -0
- package/dist/index.d.ts +41 -2
- package/dist/known.d.ts +27 -0
- package/dist/pinax-axe.js +46167 -0
- package/dist/pinax-editor.js +252 -252
- package/dist/pinax-recorder.js +52 -39
- package/dist/pinax.js +28 -6
- package/dist/pinax.mjs +598 -369
- package/dist/preview.d.ts +14 -1
- package/dist/preview.mjs +36 -23
- package/dist/privacy.d.ts +4 -2
- package/dist/queue.d.ts +2 -1
- package/dist/replay/recorder.d.ts +10 -0
- package/dist/replay/sanitize.d.ts +9 -3
- package/dist/report.d.ts +21 -2
- package/dist/settings.d.ts +11 -2
- package/dist/types.d.ts +113 -3
- package/dist/ui/widget.d.ts +82 -2
- package/package.json +5 -4
- package/dist/chunks/text-8QYEyRYs.mjs +0 -18
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { a as n, i as r, n as i, r as a, t as o } from "./privacy-
|
|
1
|
+
import { c as e, r as t } from "./widget-BpTBdX2R.mjs";
|
|
2
|
+
import { a as n, i as r, n as i, r as a, t as o } from "./privacy-B_b1_Y1n.mjs";
|
|
3
3
|
// src/editor/shapes.ts
|
|
4
4
|
var s = "#FF5C35", c = "#CC3F1B";
|
|
5
5
|
function l(e) {
|
|
@@ -78,27 +78,27 @@ var g = "\n.ed { position: fixed; inset: 0; z-index: 10; display: flex; flex-dir
|
|
|
78
78
|
["text", "Text"],
|
|
79
79
|
["blur", "Blur"]
|
|
80
80
|
], v = 6;
|
|
81
|
-
function y(
|
|
81
|
+
function y(e, n, r, i = []) {
|
|
82
82
|
return new Promise((a) => {
|
|
83
|
-
let o = n.width, s = n.height, c = r ? r.shapes.map((e) => ({ ...e })) : [], u = r?.area ? { ...r.area } : null, f = "box", y = u ? "area" : "full", x = null, S = null, C = null, w =
|
|
83
|
+
let o = n.width, s = n.height, c = r ? r.shapes.map((e) => ({ ...e })) : [], u = r?.area ? { ...r.area } : null, f = "box", y = u ? "area" : "full", x = null, S = null, C = null, w = e.activeElement, T = t("style");
|
|
84
84
|
T.textContent = g;
|
|
85
|
-
let E =
|
|
85
|
+
let E = t("div", {
|
|
86
86
|
class: "ed-sr",
|
|
87
87
|
role: "status",
|
|
88
88
|
"aria-live": "polite"
|
|
89
89
|
}), D = (e) => {
|
|
90
90
|
E.textContent = e;
|
|
91
|
-
}, O =
|
|
91
|
+
}, O = t("canvas", {
|
|
92
92
|
class: "ed-cv",
|
|
93
93
|
width: o,
|
|
94
94
|
height: s,
|
|
95
95
|
tabindex: 0,
|
|
96
96
|
role: "img"
|
|
97
|
-
}), k = O.getContext("2d"), A = (
|
|
97
|
+
}), k = O.getContext("2d"), A = (e, n = "ed-t", r = {}) => t("button", {
|
|
98
98
|
type: "button",
|
|
99
99
|
class: n,
|
|
100
100
|
...r
|
|
101
|
-
},
|
|
101
|
+
}, e), j = A("Whole screen", "ed-t", { "aria-pressed": "true" }), M = A("Select area", "ed-t", { "aria-pressed": "false" }), N = _.map(([e, t]) => {
|
|
102
102
|
let n = A(t, "ed-t", {
|
|
103
103
|
"aria-pressed": "false",
|
|
104
104
|
"data-tool": e
|
|
@@ -106,13 +106,13 @@ function y(t, n, r, i = []) {
|
|
|
106
106
|
return n.addEventListener("click", () => {
|
|
107
107
|
f = e, R = !1, u || (y = "full"), H();
|
|
108
108
|
}), n;
|
|
109
|
-
}), P = A("Undo"), F = A("Clear"), I = A("Cancel"), te = A("Done", "ed-t ed-done"), ne =
|
|
109
|
+
}), P = A("Undo"), F = A("Clear"), I = A("Cancel"), te = A("Done", "ed-t ed-done"), ne = t("p", {
|
|
110
110
|
class: "ed-hint",
|
|
111
111
|
id: "pnx-ed-hint"
|
|
112
|
-
}), L = i.length ?
|
|
112
|
+
}), L = i.length ? t("p", {
|
|
113
113
|
class: "ed-auto",
|
|
114
114
|
id: "pnx-ed-auto"
|
|
115
|
-
},
|
|
115
|
+
}, t("i", { "aria-hidden": "true" }), `${i.length === 1 ? "1 private detail was" : `${i.length} private details were`} blurred automatically (outlined). They stay blurred.`) : null;
|
|
116
116
|
O.setAttribute("aria-describedby", L ? "pnx-ed-hint pnx-ed-auto" : "pnx-ed-hint");
|
|
117
117
|
let R = !1;
|
|
118
118
|
j.addEventListener("click", () => {
|
|
@@ -124,25 +124,25 @@ function y(t, n, r, i = []) {
|
|
|
124
124
|
}), F.addEventListener("click", () => {
|
|
125
125
|
c.length = 0, D("All marks cleared."), H();
|
|
126
126
|
});
|
|
127
|
-
let re =
|
|
127
|
+
let re = t("div", {
|
|
128
128
|
class: "ed-bar",
|
|
129
129
|
role: "toolbar",
|
|
130
130
|
"aria-label": "Screenshot tools"
|
|
131
|
-
},
|
|
131
|
+
}, t("div", {
|
|
132
132
|
class: "ed-grp",
|
|
133
133
|
role: "group",
|
|
134
134
|
"aria-label": "Capture"
|
|
135
|
-
}, j, M),
|
|
135
|
+
}, j, M), t("span", {
|
|
136
136
|
class: "ed-sep",
|
|
137
137
|
"aria-hidden": "true"
|
|
138
|
-
}),
|
|
138
|
+
}), t("div", {
|
|
139
139
|
class: "ed-grp",
|
|
140
140
|
role: "group",
|
|
141
141
|
"aria-label": "Draw"
|
|
142
|
-
}, ...N),
|
|
142
|
+
}, ...N), t("span", {
|
|
143
143
|
class: "ed-sep",
|
|
144
144
|
"aria-hidden": "true"
|
|
145
|
-
}),
|
|
145
|
+
}), t("div", { class: "ed-grp" }, P, F), t("span", { class: "ed-sp" }), t("div", { class: "ed-grp" }, I, te)), z = t("div", { class: "ed-stage" }, O), B = t("div", {
|
|
146
146
|
class: "ed",
|
|
147
147
|
role: "dialog",
|
|
148
148
|
"aria-modal": "true",
|
|
@@ -205,26 +205,26 @@ function y(t, n, r, i = []) {
|
|
|
205
205
|
function G(e) {
|
|
206
206
|
c.push(l(e)), D(`${e.type === "blur" ? "Blurred area" : e.type[0].toUpperCase() + e.type.slice(1)} added.`), H();
|
|
207
207
|
}
|
|
208
|
-
function K(
|
|
208
|
+
function K(e, n) {
|
|
209
209
|
C?.remove();
|
|
210
|
-
let r =
|
|
210
|
+
let r = t("input", {
|
|
211
211
|
class: "ed-txt",
|
|
212
212
|
type: "text",
|
|
213
213
|
maxlength: 120,
|
|
214
214
|
"aria-label": "Label text",
|
|
215
215
|
placeholder: "Type a label, then Enter",
|
|
216
216
|
autocomplete: "off"
|
|
217
|
-
}), i = O.getBoundingClientRect(), a = z.getBoundingClientRect(), c = i.left - a.left +
|
|
217
|
+
}), i = O.getBoundingClientRect(), a = z.getBoundingClientRect(), c = i.left - a.left + e / o * i.width, l = i.top - a.top + n / s * i.height;
|
|
218
218
|
r.style.left = `${Math.min(c, a.width - 170)}px`, r.style.top = `${Math.min(l, a.height - 40)}px`;
|
|
219
|
-
let u = !1, f = (
|
|
219
|
+
let u = !1, f = (t) => {
|
|
220
220
|
if (u) return;
|
|
221
221
|
u = !0;
|
|
222
222
|
let i = r.value.trim();
|
|
223
|
-
if (r.remove(), C = null,
|
|
224
|
-
let
|
|
223
|
+
if (r.remove(), C = null, t && i) {
|
|
224
|
+
let t = d(o, s), r = p(k, i, t);
|
|
225
225
|
G({
|
|
226
226
|
type: "text",
|
|
227
|
-
x: se(
|
|
227
|
+
x: se(e, r.w),
|
|
228
228
|
y: W(n, r.h),
|
|
229
229
|
w: r.w,
|
|
230
230
|
h: r.h,
|
|
@@ -322,17 +322,17 @@ function y(t, n, r, i = []) {
|
|
|
322
322
|
});
|
|
323
323
|
}
|
|
324
324
|
I.addEventListener("click", () => J(null)), te.addEventListener("click", le);
|
|
325
|
-
function ue(
|
|
326
|
-
if (
|
|
327
|
-
else if ((
|
|
328
|
-
else if (
|
|
325
|
+
function ue(t) {
|
|
326
|
+
if (t.key === "Escape") t.preventDefault(), t.stopPropagation(), J(null);
|
|
327
|
+
else if ((t.metaKey || t.ctrlKey) && t.key.toLowerCase() === "z") t.preventDefault(), c.pop() && D("Last mark removed."), H();
|
|
328
|
+
else if (t.key === "Tab") {
|
|
329
329
|
let n = [...B.querySelectorAll("button:not(:disabled), canvas, input")];
|
|
330
330
|
if (!n.length) return;
|
|
331
|
-
let r = n[0], i = n[n.length - 1], a =
|
|
332
|
-
|
|
331
|
+
let r = n[0], i = n[n.length - 1], a = e.activeElement;
|
|
332
|
+
t.shiftKey && a === r ? (t.preventDefault(), i.focus()) : !t.shiftKey && a === i && (t.preventDefault(), r.focus());
|
|
333
333
|
}
|
|
334
334
|
}
|
|
335
|
-
B.addEventListener("keydown", ue, !0),
|
|
335
|
+
B.addEventListener("keydown", ue, !0), e.append(T, B), H(), N[0].focus();
|
|
336
336
|
});
|
|
337
337
|
}
|
|
338
338
|
function b(e) {
|
|
@@ -1319,8 +1319,8 @@ function Rt(e, t) {
|
|
|
1319
1319
|
let n = document.createElement("canvas");
|
|
1320
1320
|
return n.width = Math.max(1, Math.round(e.width * t)), n.height = Math.max(1, Math.round(e.height * t)), n.getContext("2d")?.drawImage(e, 0, 0, n.width, n.height), n;
|
|
1321
1321
|
}
|
|
1322
|
-
function zt(
|
|
1323
|
-
let r =
|
|
1322
|
+
function zt(t, n = It) {
|
|
1323
|
+
let r = t, i = "";
|
|
1324
1324
|
for (let e = 0; e < 6; e++) {
|
|
1325
1325
|
for (let e of [
|
|
1326
1326
|
.85,
|
|
@@ -1332,7 +1332,7 @@ function zt(e, n = It) {
|
|
|
1332
1332
|
}
|
|
1333
1333
|
r = Rt(r, .75);
|
|
1334
1334
|
}
|
|
1335
|
-
if (Lt(i) >
|
|
1335
|
+
if (Lt(i) > e.screenshotBytes || i.length > e.screenshotChars) throw Error("Screenshot too large");
|
|
1336
1336
|
return i;
|
|
1337
1337
|
}
|
|
1338
1338
|
// src/editor/index.ts
|
|
@@ -1365,4 +1365,4 @@ async function Vt(e, t) {
|
|
|
1365
1365
|
}
|
|
1366
1366
|
export { Vt as markUp, Bt as takeScreenshot };
|
|
1367
1367
|
|
|
1368
|
-
//# sourceMappingURL=editor-
|
|
1368
|
+
//# sourceMappingURL=editor-0Kr31Uly.mjs.map
|
|
@@ -29,11 +29,11 @@ function a(e) {
|
|
|
29
29
|
for (let i of t) n += e.slice(r, i.start) + "*".repeat(i.end - i.start), r = i.end;
|
|
30
30
|
return n + e.slice(r);
|
|
31
31
|
}
|
|
32
|
-
var o =
|
|
32
|
+
var o = (e) => RegExp(`^(?:(?:full|your|first|last|guest|customer|client|contact|booking|patient|member|account|lead)\\s+name|name|customer|guest|client|booked by|card ?holder|account holder)${e}`, "i"), s = /* @__PURE__ */ o("\\s*[::]?$"), c = /* @__PURE__ */ o("\\s*[::]\\s*"), l = /\b(?:signed in as|logged in as|welcome back,?)\s+/i;
|
|
33
33
|
function u(e) {
|
|
34
34
|
let t = e.trim();
|
|
35
35
|
return t.length >= 2 && t.length <= 60 && /\p{L}/u.test(t) && t.split(/\s+/).length <= 5;
|
|
36
36
|
}
|
|
37
37
|
export { u as a, i, s as n, a as o, l as r, c as t };
|
|
38
38
|
|
|
39
|
-
//# sourceMappingURL=privacy-
|
|
39
|
+
//# sourceMappingURL=privacy-B_b1_Y1n.mjs.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { o as e } from "./privacy-
|
|
2
|
-
import {
|
|
1
|
+
import { o as e } from "./privacy-B_b1_Y1n.mjs";
|
|
2
|
+
import { a as t } from "./text-D9SaDBT0.mjs";
|
|
3
3
|
// node_modules/@rrweb/record/dist/record.js
|
|
4
4
|
var n = Object.defineProperty, r = (e, t, r) => t in e ? n(e, t, {
|
|
5
5
|
enumerable: !0,
|
|
@@ -2763,62 +2763,77 @@ var jn = /* @__PURE__ */ new Set([
|
|
|
2763
2763
|
"longdesc",
|
|
2764
2764
|
"ping",
|
|
2765
2765
|
"xlink:href"
|
|
2766
|
-
]), Mn =
|
|
2767
|
-
|
|
2766
|
+
]), Mn = /* @__PURE__ */ new Set([
|
|
2767
|
+
"alt",
|
|
2768
|
+
"title",
|
|
2769
|
+
"placeholder",
|
|
2770
|
+
"label",
|
|
2771
|
+
"value",
|
|
2772
|
+
"summary",
|
|
2773
|
+
"abbr",
|
|
2774
|
+
"aria-label",
|
|
2775
|
+
"aria-description",
|
|
2776
|
+
"aria-roledescription",
|
|
2777
|
+
"aria-valuetext",
|
|
2778
|
+
"aria-placeholder"
|
|
2779
|
+
]), Nn = (e) => e === "style" || e === "_cssText" || e.startsWith("rr_");
|
|
2780
|
+
function Pn(n, r) {
|
|
2768
2781
|
let i = n.trim();
|
|
2769
2782
|
return !i || /^(data|blob):/i.test(i) ? n : i.startsWith("#") ? "#" : e(t(i, r));
|
|
2770
2783
|
}
|
|
2771
|
-
function
|
|
2784
|
+
function Fn(e, t) {
|
|
2772
2785
|
return e.split(",").map((e) => {
|
|
2773
2786
|
let [n, ...r] = e.trim().split(/\s+/);
|
|
2774
|
-
return n ? [
|
|
2787
|
+
return n ? [Pn(n, t), ...r].join(" ") : e;
|
|
2775
2788
|
}).join(", ");
|
|
2776
2789
|
}
|
|
2777
|
-
function
|
|
2778
|
-
let
|
|
2790
|
+
function In(t, n, r, i = !1) {
|
|
2791
|
+
let a = {}, o = n?.toLowerCase() === "input" && String(t.type ?? "").toLowerCase() === "hidden";
|
|
2779
2792
|
for (let n in t) {
|
|
2780
|
-
let
|
|
2781
|
-
|
|
2793
|
+
let s = t[n], c = n.toLowerCase();
|
|
2794
|
+
o && c === "value" || (a[n] = typeof s != "string" || Nn(c) ? s : jn.has(c) ? Pn(s, r) : c === "srcset" ? Fn(s, r) : i && Mn.has(c) ? s.replace(/\S/g, "*") : e(s));
|
|
2782
2795
|
}
|
|
2783
|
-
return
|
|
2796
|
+
return a;
|
|
2784
2797
|
}
|
|
2785
|
-
function
|
|
2786
|
-
return JSON.stringify(e, function(e,
|
|
2787
|
-
if (e === "attributes" &&
|
|
2788
|
-
if (e === "data" && this.type === 4 &&
|
|
2789
|
-
let e =
|
|
2798
|
+
function Ln(e, t = typeof location > "u" ? void 0 : location.href, n = {}) {
|
|
2799
|
+
return JSON.stringify(e, function(e, r) {
|
|
2800
|
+
if (e === "attributes" && r && typeof r == "object" && !Array.isArray(r)) return In(r, this.tagName, t, n.maskText === !0);
|
|
2801
|
+
if (e === "data" && this.type === 4 && r && typeof r == "object" && typeof r.href == "string") {
|
|
2802
|
+
let e = r;
|
|
2790
2803
|
return {
|
|
2791
2804
|
...e,
|
|
2792
|
-
href:
|
|
2805
|
+
href: Pn(e.href, t)
|
|
2793
2806
|
};
|
|
2794
2807
|
}
|
|
2795
|
-
return
|
|
2808
|
+
return r;
|
|
2796
2809
|
});
|
|
2797
2810
|
}
|
|
2798
2811
|
// src/replay/recorder.ts
|
|
2799
|
-
var
|
|
2800
|
-
function
|
|
2801
|
-
let n = new On(
|
|
2812
|
+
var Rn = 3e4, zn = 1e4, Bn = "[contenteditable]:not([contenteditable=false])", Vn = "img,picture,video,canvas,iframe", Hn = (e) => e.replace(/\S/g, "*");
|
|
2813
|
+
function Un(t = {}) {
|
|
2814
|
+
let n = t.mask !== "inputs", r = new On(Rn), i = Dn({
|
|
2802
2815
|
emit: (e) => {
|
|
2803
2816
|
try {
|
|
2804
|
-
|
|
2817
|
+
r.push(e);
|
|
2805
2818
|
} catch {}
|
|
2806
2819
|
},
|
|
2807
|
-
checkoutEveryNms:
|
|
2820
|
+
checkoutEveryNms: zn,
|
|
2808
2821
|
maskAllInputs: !0,
|
|
2809
2822
|
blockClass: "pinax-mask",
|
|
2810
2823
|
blockSelector: [
|
|
2811
2824
|
"[data-pinax-mask]",
|
|
2812
2825
|
"input[type=hidden]",
|
|
2826
|
+
n ? Vn : "",
|
|
2813
2827
|
t.exclude
|
|
2814
2828
|
].filter(Boolean).join(","),
|
|
2815
2829
|
maskTextClass: "pinax-mask",
|
|
2816
2830
|
maskTextSelector: "*",
|
|
2817
|
-
maskTextFn: (t,
|
|
2831
|
+
maskTextFn: (t, r) => {
|
|
2832
|
+
if (n) return Hn(t);
|
|
2818
2833
|
try {
|
|
2819
|
-
return
|
|
2834
|
+
return r?.closest?.(`${Bn},[data-pinax-mask],.pinax-mask`) ? Hn(t) : e(t);
|
|
2820
2835
|
} catch {
|
|
2821
|
-
return t
|
|
2836
|
+
return Hn(t);
|
|
2822
2837
|
}
|
|
2823
2838
|
},
|
|
2824
2839
|
slimDOMOptions: "all",
|
|
@@ -2835,25 +2850,25 @@ function Bn(t = {}) {
|
|
|
2835
2850
|
});
|
|
2836
2851
|
return {
|
|
2837
2852
|
async exportReplay(e) {
|
|
2838
|
-
let t =
|
|
2839
|
-
for (let
|
|
2840
|
-
let t =
|
|
2853
|
+
let t = r.segmentCount;
|
|
2854
|
+
for (let i = t; i >= 1; i--) {
|
|
2855
|
+
let t = r.events(i);
|
|
2841
2856
|
if (!t.length) return null;
|
|
2842
|
-
let
|
|
2843
|
-
if (!
|
|
2844
|
-
let
|
|
2845
|
-
if (
|
|
2857
|
+
let a = await An(Ln(t, void 0, { maskText: n }));
|
|
2858
|
+
if (!a) return null;
|
|
2859
|
+
let o = kn(a);
|
|
2860
|
+
if (o.length <= e) return o;
|
|
2846
2861
|
}
|
|
2847
2862
|
return null;
|
|
2848
2863
|
},
|
|
2849
2864
|
stop() {
|
|
2850
2865
|
try {
|
|
2851
|
-
|
|
2866
|
+
i?.();
|
|
2852
2867
|
} catch {}
|
|
2853
|
-
|
|
2868
|
+
r.clear();
|
|
2854
2869
|
}
|
|
2855
2870
|
};
|
|
2856
2871
|
}
|
|
2857
|
-
export {
|
|
2872
|
+
export { zn as CHECKOUT_MS, Vn as MEDIA, Rn as WINDOW_MS, Un as startRecorder };
|
|
2858
2873
|
|
|
2859
|
-
//# sourceMappingURL=recorder-
|
|
2874
|
+
//# sourceMappingURL=recorder-tu4yugLw.mjs.map
|