@editora/core 1.0.8 → 1.0.10
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 +6 -1
- package/dist/{ApprovalWorkflowPlugin.native-C3jtAYjG.mjs → ApprovalWorkflowPlugin.native-BZ6jO-Wj.mjs} +136 -133
- package/dist/BlockquotePlugin.native-57_Xcjl1.mjs +212 -0
- package/dist/{BlocksLibraryPlugin.native-HMWKxWNs.mjs → BlocksLibraryPlugin.native-5sdsXsiE.mjs} +90 -87
- package/dist/{BoldPlugin.native-BAzzoqU5.mjs → BoldPlugin.native-CSh_LiIJ.mjs} +11 -7
- package/dist/CapitalizationPlugin.native-DLV4oPmB.mjs +159 -0
- package/dist/ChecklistPlugin.native-BS-kMz9O.mjs +371 -0
- package/dist/{CitationsPlugin.native-BnU0qCwR.mjs → CitationsPlugin.native-DQgoCd1B.mjs} +132 -129
- package/dist/ClearFormattingPlugin.native-DIS6AN2t.mjs +172 -0
- package/dist/CodePlugin.native-C5l1IeSS.mjs +4570 -0
- package/dist/{ContentRulesPlugin.native-nBLQ8QFZ.mjs → ContentRulesPlugin.native-vPx5nC73.mjs} +105 -102
- package/dist/{DataBindingPlugin.native-jQ1JPRTp.mjs → DataBindingPlugin.native-BoXwghTz.mjs} +49 -46
- package/dist/DirectionPlugin.native-Bl-QLFzO.mjs +153 -0
- package/dist/{DocSchemaPlugin.native-CHOge18O.mjs → DocSchemaPlugin.native-DUSVRHqT.mjs} +55 -52
- package/dist/{EmbedIframePlugin.native-DKJx2OS7.mjs → EmbedIframePlugin.native-BF_-LjTq.mjs} +287 -115
- package/dist/HeadingPlugin.native-DZdvubrQ.mjs +249 -0
- package/dist/{HistoryPlugin.native-TDnVMsEO.mjs → HistoryPlugin.native-D2wl32jV.mjs} +88 -103
- package/dist/{ItalicPlugin.native-CQjjDyUL.mjs → ItalicPlugin.native-CmnlwFHB.mjs} +15 -11
- package/dist/MathPlugin.native-NwWPHVmj.mjs +369 -0
- package/dist/{MediaManagerPlugin.native-BiXiK8FC.mjs → MediaManagerPlugin.native-eOsTJFpw.mjs} +204 -202
- package/dist/MergeTagPlugin.native-BzRVoD9-.mjs +580 -0
- package/dist/{PIIRedactionPlugin.native-DcsjmtV1.mjs → PIIRedactionPlugin.native-g7j4jOmm.mjs} +158 -155
- package/dist/{SlashCommandsPlugin.native-CmxvMEaE.mjs → SlashCommandsPlugin.native-BiN6ODw5.mjs} +2 -2
- package/dist/{SmartPastePlugin.native-BOKKtF07.mjs → SmartPastePlugin.native-CZAEHkyt.mjs} +127 -124
- package/dist/{SpecialCharactersPlugin.native-CZDato89.mjs → SpecialCharactersPlugin.native-DaG4b19I.mjs} +100 -76
- package/dist/{StrikethroughPlugin.native-0Be7j49s.mjs → StrikethroughPlugin.native-V0TL4F48.mjs} +12 -26
- package/dist/TemplatePlugin.native-DLjFUaPW.mjs +1150 -0
- package/dist/{TranslationWorkflowPlugin.native-Bz6jDGvj.mjs → TranslationWorkflowPlugin.native-DdF16tgT.mjs} +104 -101
- package/dist/{UnderlinePlugin.native-QpIcK4L2.mjs → UnderlinePlugin.native-DZzg23rv.mjs} +8 -4
- package/dist/editora.min.js +1 -1
- package/dist/editora.umd.js +1 -1
- package/dist/index-CPMGUZfB.js +10 -0
- package/dist/{index-DqC57IEH.mjs → index-DBoj6QfW.mjs} +17 -15
- package/dist/index.cjs.js +1 -1
- package/dist/index.esm.js +2 -2
- package/dist/inlineFormatting-DJ0-NZtx.mjs +97 -0
- package/dist/plugin-loader.js +37 -37
- package/dist/webcomponent-core.js +18 -16
- package/dist/webcomponent-core.min.css +1 -1
- package/dist/webcomponent-core.min.js +139 -62
- package/dist/webcomponent.cjs.js +1 -1
- package/dist/webcomponent.esm.js +1 -1
- package/dist/webcomponent.js +50 -48
- package/dist/webcomponent.min.css +1 -1
- package/dist/webcomponent.min.js +1174 -1071
- package/package.json +11 -5
- package/LICENSE +0 -21
- package/dist/BlockquotePlugin.native-JFmOLsxN.mjs +0 -48
- package/dist/CapitalizationPlugin.native-DOMsh5R7.mjs +0 -79
- package/dist/ChecklistPlugin.native-nuSSEFNI.mjs +0 -309
- package/dist/ClearFormattingPlugin.native-Bq_XcTh2.mjs +0 -140
- package/dist/CodePlugin.native-DlpTPdkd.mjs +0 -2691
- package/dist/DirectionPlugin.native-CDnbdNyl.mjs +0 -130
- package/dist/HeadingPlugin.native-DrLYwQnQ.mjs +0 -64
- package/dist/MathPlugin.native-f_mDp8VL.mjs +0 -292
- package/dist/MergeTagPlugin.native-C3eOfEgw.mjs +0 -559
- package/dist/TemplatePlugin.native-CrpfKRJ8.mjs +0 -602
- package/dist/index-D1LOqg5C.js +0 -10
package/dist/{PIIRedactionPlugin.native-DcsjmtV1.mjs → PIIRedactionPlugin.native-g7j4jOmm.mjs}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const x = ".rte-content, .editora-content", ae = "[data-editora-editor], .rte-editor, .editora-editor, editora-editor",
|
|
1
|
+
const x = ".rte-content, .editora-content", ae = "[data-editora-editor], .rte-editor, .editora-editor, editora-editor", Ee = "__editoraCommandEditorRoot", ve = "rte-pii-redaction-styles", u = "rte-pii-redaction-panel", k = "pii-redaction", v = "piiRedaction", $ = ':is([data-theme="dark"], .dark, .editora-theme-dark, .rte-theme-dark)', be = typeof NodeFilter != "undefined" ? NodeFilter.SHOW_TEXT : 4, ze = [
|
|
2
2
|
"email",
|
|
3
3
|
"phone",
|
|
4
4
|
"ssn",
|
|
@@ -6,7 +6,7 @@ const x = ".rte-content, .editora-content", ae = "[data-editora-editor], .rte-ed
|
|
|
6
6
|
"ipv4",
|
|
7
7
|
"api-key",
|
|
8
8
|
"jwt"
|
|
9
|
-
],
|
|
9
|
+
], Fe = {
|
|
10
10
|
panelTitle: "PII Redaction",
|
|
11
11
|
panelAriaLabel: "PII redaction panel",
|
|
12
12
|
scanText: "Scan PII",
|
|
@@ -23,7 +23,7 @@ const x = ".rte-content, .editora-content", ae = "[data-editora-editor], .rte-ed
|
|
|
23
23
|
matchLabel: "Detected",
|
|
24
24
|
maskedLabel: "Masked",
|
|
25
25
|
excerptLabel: "Context"
|
|
26
|
-
},
|
|
26
|
+
}, He = {
|
|
27
27
|
email: {
|
|
28
28
|
label: "Email",
|
|
29
29
|
severity: "medium",
|
|
@@ -43,7 +43,7 @@ const x = ".rte-content, .editora-content", ae = "[data-editora-editor], .rte-ed
|
|
|
43
43
|
label: "Credit Card",
|
|
44
44
|
severity: "high",
|
|
45
45
|
pattern: /\b(?:\d[ -]*?){13,19}\b/g,
|
|
46
|
-
validator: (e) =>
|
|
46
|
+
validator: (e) => je(e)
|
|
47
47
|
},
|
|
48
48
|
ipv4: {
|
|
49
49
|
label: "IPv4",
|
|
@@ -60,38 +60,38 @@ const x = ".rte-content, .editora-content", ae = "[data-editora-editor], .rte-ed
|
|
|
60
60
|
severity: "high",
|
|
61
61
|
pattern: /\beyJ[A-Za-z0-9_-]{10,}\.[A-Za-z0-9_-]{10,}\.[A-Za-z0-9_-]{10,}\b/g
|
|
62
62
|
}
|
|
63
|
-
}, f = /* @__PURE__ */ new WeakMap(), I = /* @__PURE__ */ new WeakMap(), E = /* @__PURE__ */ new WeakMap(), S = /* @__PURE__ */ new WeakMap(), te = /* @__PURE__ */ new WeakMap(),
|
|
64
|
-
let G = 0,
|
|
63
|
+
}, f = /* @__PURE__ */ new WeakMap(), I = /* @__PURE__ */ new WeakMap(), E = /* @__PURE__ */ new WeakMap(), S = /* @__PURE__ */ new WeakMap(), te = /* @__PURE__ */ new WeakMap(), ue = /* @__PURE__ */ new WeakMap(), Q = /* @__PURE__ */ new WeakMap(), m = /* @__PURE__ */ new Map(), V = /* @__PURE__ */ new WeakMap(), W = /* @__PURE__ */ new Set(), j = /* @__PURE__ */ new Set();
|
|
64
|
+
let G = 0, Be = 0, $e = 0, M = null, g = null, L = null, D = null, _ = null, R = null, N = null;
|
|
65
65
|
function b(e) {
|
|
66
66
|
return e.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """).replace(/'/g, "'");
|
|
67
67
|
}
|
|
68
|
-
function
|
|
68
|
+
function Ke(e) {
|
|
69
69
|
return e.replace(/\u00A0/g, " ").replace(/\s+/g, " ").trim();
|
|
70
70
|
}
|
|
71
71
|
function Y(e) {
|
|
72
72
|
const t = e.flags.includes("g") ? e.flags : `${e.flags}g`;
|
|
73
73
|
return new RegExp(e.source, t);
|
|
74
74
|
}
|
|
75
|
-
function
|
|
75
|
+
function ge(e) {
|
|
76
76
|
return new RegExp(e.source, e.flags);
|
|
77
77
|
}
|
|
78
78
|
function X(e, t, n) {
|
|
79
79
|
return Math.max(t, Math.min(n, e));
|
|
80
80
|
}
|
|
81
|
-
function
|
|
81
|
+
function qe(e, t) {
|
|
82
82
|
return e === "high" || e === "medium" || e === "low" ? e : t;
|
|
83
83
|
}
|
|
84
|
-
function
|
|
84
|
+
function We(e) {
|
|
85
85
|
const t = (e || "*").slice(0, 1) || "*";
|
|
86
86
|
return /[A-Za-z0-9._%+\-\s]/.test(t) ? "*" : t;
|
|
87
87
|
}
|
|
88
|
-
function
|
|
88
|
+
function Ie(e) {
|
|
89
89
|
let t = 2166136261;
|
|
90
90
|
for (let n = 0; n < e.length; n += 1)
|
|
91
91
|
t ^= e.charCodeAt(n), t = Math.imul(t, 16777619);
|
|
92
92
|
return t >>> 0;
|
|
93
93
|
}
|
|
94
|
-
function
|
|
94
|
+
function je(e) {
|
|
95
95
|
const t = e.replace(/\D/g, "");
|
|
96
96
|
if (t.length < 13 || t.length > 19) return !1;
|
|
97
97
|
let n = 0, i = !1;
|
|
@@ -101,8 +101,8 @@ function We(e) {
|
|
|
101
101
|
}
|
|
102
102
|
return n % 10 === 0;
|
|
103
103
|
}
|
|
104
|
-
function
|
|
105
|
-
const n =
|
|
104
|
+
function Ze(e, t) {
|
|
105
|
+
const n = He[e];
|
|
106
106
|
if (typeof t == "boolean")
|
|
107
107
|
return {
|
|
108
108
|
type: e,
|
|
@@ -125,7 +125,7 @@ function je(e, t) {
|
|
|
125
125
|
return {
|
|
126
126
|
type: e,
|
|
127
127
|
label: n.label,
|
|
128
|
-
severity:
|
|
128
|
+
severity: qe(t.severity, n.severity),
|
|
129
129
|
enabled: t.enabled !== !1,
|
|
130
130
|
pattern: i,
|
|
131
131
|
validator: n.validator
|
|
@@ -133,30 +133,30 @@ function je(e, t) {
|
|
|
133
133
|
}
|
|
134
134
|
function ee(e = {}) {
|
|
135
135
|
var i, o, r, a;
|
|
136
|
-
const t =
|
|
136
|
+
const t = ze.map((l) => {
|
|
137
137
|
var c;
|
|
138
|
-
return
|
|
138
|
+
return Ze(l, (c = e.detectors) == null ? void 0 : c[l]);
|
|
139
139
|
}), n = t.map((l) => `${l.type}:${l.enabled ? "1" : "0"}:${l.severity}:${l.pattern.source}:${l.pattern.flags}`).join("|");
|
|
140
140
|
return {
|
|
141
141
|
enableRealtime: e.enableRealtime !== !1,
|
|
142
142
|
debounceMs: X(Number((i = e.debounceMs) != null ? i : 220), 60, 3e3),
|
|
143
143
|
maxFindings: X(Number((o = e.maxFindings) != null ? o : 140), 1, 500),
|
|
144
|
-
maskChar:
|
|
144
|
+
maskChar: We(e.maskChar),
|
|
145
145
|
revealStart: X(Number((r = e.revealStart) != null ? r : 2), 0, 12),
|
|
146
146
|
revealEnd: X(Number((a = e.revealEnd) != null ? a : 2), 0, 12),
|
|
147
147
|
redactionMode: e.redactionMode === "mask" ? "mask" : "token",
|
|
148
148
|
redactionToken: (e.redactionToken || "REDACTED").trim() || "REDACTED",
|
|
149
149
|
skipInCodeBlocks: e.skipInCodeBlocks !== !1,
|
|
150
150
|
labels: {
|
|
151
|
-
...
|
|
151
|
+
...Fe,
|
|
152
152
|
...e.labels || {}
|
|
153
153
|
},
|
|
154
|
-
normalizeText: e.normalizeText ||
|
|
154
|
+
normalizeText: e.normalizeText || Ke,
|
|
155
155
|
detectors: t,
|
|
156
156
|
detectorSignature: n
|
|
157
157
|
};
|
|
158
158
|
}
|
|
159
|
-
function
|
|
159
|
+
function se(e) {
|
|
160
160
|
const t = {};
|
|
161
161
|
return e.detectors.forEach((n) => {
|
|
162
162
|
t[n.type] = {
|
|
@@ -179,10 +179,10 @@ function ce(e) {
|
|
|
179
179
|
detectors: t
|
|
180
180
|
};
|
|
181
181
|
}
|
|
182
|
-
function
|
|
182
|
+
function me(e) {
|
|
183
183
|
return e.closest(ae) || e;
|
|
184
184
|
}
|
|
185
|
-
function
|
|
185
|
+
function Ve(e) {
|
|
186
186
|
const t = e.closest("[data-editora-editor]");
|
|
187
187
|
if (t && z(t) === e)
|
|
188
188
|
return t;
|
|
@@ -192,7 +192,7 @@ function Ze(e) {
|
|
|
192
192
|
return n;
|
|
193
193
|
n = n.parentElement;
|
|
194
194
|
}
|
|
195
|
-
return
|
|
195
|
+
return me(e);
|
|
196
196
|
}
|
|
197
197
|
function z(e) {
|
|
198
198
|
if (!e) return null;
|
|
@@ -200,11 +200,11 @@ function z(e) {
|
|
|
200
200
|
const t = e.querySelector(x);
|
|
201
201
|
return t instanceof HTMLElement ? t : null;
|
|
202
202
|
}
|
|
203
|
-
function
|
|
203
|
+
function Ue() {
|
|
204
204
|
if (typeof window == "undefined") return null;
|
|
205
|
-
const e = window[
|
|
205
|
+
const e = window[Ee];
|
|
206
206
|
if (!(e instanceof HTMLElement)) return null;
|
|
207
|
-
window[
|
|
207
|
+
window[Ee] = null;
|
|
208
208
|
const t = z(e);
|
|
209
209
|
if (t) return t;
|
|
210
210
|
const n = e.closest(ae);
|
|
@@ -218,19 +218,19 @@ function Ve() {
|
|
|
218
218
|
function J(e) {
|
|
219
219
|
return e ? (e.getAttribute("data-theme") || e.getAttribute("theme") || "").toLowerCase() === "dark" ? !0 : e.classList.contains("dark") || e.classList.contains("editora-theme-dark") || e.classList.contains("rte-theme-dark") : !1;
|
|
220
220
|
}
|
|
221
|
-
function
|
|
222
|
-
const t =
|
|
221
|
+
function Ge(e) {
|
|
222
|
+
const t = me(e);
|
|
223
223
|
if (J(t)) return !0;
|
|
224
224
|
const n = t.closest("[data-theme], [theme], .dark, .editora-theme-dark, .rte-theme-dark");
|
|
225
225
|
return J(n) ? !0 : J(document.documentElement) || J(document.body);
|
|
226
226
|
}
|
|
227
227
|
function ne(e, t) {
|
|
228
|
-
e.classList.remove("rte-pii-redaction-theme-dark"),
|
|
228
|
+
e.classList.remove("rte-pii-redaction-theme-dark"), Ge(t) && e.classList.add("rte-pii-redaction-theme-dark");
|
|
229
229
|
}
|
|
230
230
|
function re(e) {
|
|
231
231
|
return e ? e.nodeType === Node.ELEMENT_NODE ? e : e.parentElement : null;
|
|
232
232
|
}
|
|
233
|
-
function
|
|
233
|
+
function he(e) {
|
|
234
234
|
const t = te.get(e);
|
|
235
235
|
typeof t == "number" && (window.clearTimeout(t), j.delete(t), te.delete(e));
|
|
236
236
|
}
|
|
@@ -257,10 +257,10 @@ function le(e = 0) {
|
|
|
257
257
|
}
|
|
258
258
|
function q() {
|
|
259
259
|
Array.from(W).forEach((t) => {
|
|
260
|
-
t.isConnected ||
|
|
260
|
+
t.isConnected || Ce(t);
|
|
261
261
|
});
|
|
262
262
|
}
|
|
263
|
-
function
|
|
263
|
+
function Ye(e) {
|
|
264
264
|
var t, n, i, o;
|
|
265
265
|
for (let r = 0; r < e.length; r += 1) {
|
|
266
266
|
const a = e[r];
|
|
@@ -281,7 +281,7 @@ function T(e, t = !0) {
|
|
|
281
281
|
const r = e.editorElement, a = z(r);
|
|
282
282
|
if (a) return a;
|
|
283
283
|
}
|
|
284
|
-
const n =
|
|
284
|
+
const n = Ue();
|
|
285
285
|
if (n) return n;
|
|
286
286
|
const i = window.getSelection();
|
|
287
287
|
if (i && i.rangeCount > 0) {
|
|
@@ -296,12 +296,12 @@ function T(e, t = !0) {
|
|
|
296
296
|
}
|
|
297
297
|
return g && g.isConnected ? g : (g && !g.isConnected && (g = null), t ? document.querySelector(x) : null);
|
|
298
298
|
}
|
|
299
|
-
function
|
|
299
|
+
function Ce(e) {
|
|
300
300
|
var t;
|
|
301
|
-
|
|
301
|
+
he(e), (t = m.get(e)) == null || t.remove(), m.delete(e), V.delete(e), f.delete(e), I.delete(e), E.delete(e), S.delete(e), ue.delete(e), Q.delete(e), W.delete(e), g === e && (g = null);
|
|
302
302
|
}
|
|
303
303
|
function C(e, t, n) {
|
|
304
|
-
const i =
|
|
304
|
+
const i = Ve(e);
|
|
305
305
|
Array.from(
|
|
306
306
|
i.querySelectorAll(
|
|
307
307
|
`.rte-toolbar-button[data-command="${t}"], .editora-toolbar-button[data-command="${t}"]`
|
|
@@ -316,50 +316,50 @@ function w(e, t) {
|
|
|
316
316
|
function ie(e) {
|
|
317
317
|
return V.get(e) === !0;
|
|
318
318
|
}
|
|
319
|
-
function
|
|
319
|
+
function Te(e, t, n, i) {
|
|
320
320
|
if (!e) return e;
|
|
321
321
|
if (e.length <= n + i)
|
|
322
322
|
return t.repeat(e.length);
|
|
323
323
|
const o = e.slice(0, n), r = i > 0 ? e.slice(e.length - i) : "";
|
|
324
324
|
return `${o}${t.repeat(Math.max(1, e.length - n - i))}${r}`;
|
|
325
325
|
}
|
|
326
|
-
function
|
|
326
|
+
function de(e, t, n) {
|
|
327
327
|
const i = e.replace(/\D/g, "");
|
|
328
328
|
if (i.length === 0) return e;
|
|
329
329
|
let o = 0;
|
|
330
330
|
const r = Math.max(0, i.length - n);
|
|
331
331
|
return e.split("").map((a) => /\d/.test(a) ? (o += 1, o <= r ? t : a) : a).join("");
|
|
332
332
|
}
|
|
333
|
-
function
|
|
333
|
+
function Xe(e, t) {
|
|
334
334
|
const n = e.indexOf("@");
|
|
335
335
|
if (n <= 0) return e;
|
|
336
336
|
const i = e.slice(0, n), o = e.slice(n + 1);
|
|
337
337
|
return i.length <= 2 ? `${i[0] || ""}${t}[at]${o}` : `${i[0]}${t.repeat(Math.max(1, i.length - 2))}${i[i.length - 1]}[at]${o}`;
|
|
338
338
|
}
|
|
339
|
-
function
|
|
339
|
+
function Je(e, t) {
|
|
340
340
|
const n = e.split(".");
|
|
341
341
|
return n.length !== 4 ? e : `${n[0]}.${n[1]}.${n[2]}.${t.repeat(Math.max(1, n[3].length))}`;
|
|
342
342
|
}
|
|
343
|
-
function Ce(e, t, n) {
|
|
344
|
-
return e && (t === "email" ? Ye(e, n.maskChar) : t === "phone" || t === "ssn" || t === "credit-card" ? se(e, n.maskChar, 4) : t === "ipv4" ? Xe(e, n.maskChar) : t === "api-key" || t === "jwt" ? Ie(e, n.maskChar, 0, 0) : Ie(e, n.maskChar, n.revealStart, n.revealEnd));
|
|
345
|
-
}
|
|
346
343
|
function Re(e, t, n) {
|
|
347
|
-
return n.
|
|
344
|
+
return e && (t === "email" ? Xe(e, n.maskChar) : t === "phone" || t === "ssn" || t === "credit-card" ? de(e, n.maskChar, 4) : t === "ipv4" ? Je(e, n.maskChar) : t === "api-key" || t === "jwt" ? Te(e, n.maskChar, 0, 0) : Te(e, n.maskChar, n.revealStart, n.revealEnd));
|
|
345
|
+
}
|
|
346
|
+
function Se(e, t, n) {
|
|
347
|
+
return n.redactionMode === "mask" ? Re(e, t, n) : `[${n.redactionToken}:${t.toUpperCase()}]`;
|
|
348
348
|
}
|
|
349
|
-
function
|
|
350
|
-
return
|
|
349
|
+
function Qe(e) {
|
|
350
|
+
return $e += 1, `pii-${e}-${Date.now().toString(36)}-${$e.toString(36)}`;
|
|
351
351
|
}
|
|
352
|
-
function
|
|
352
|
+
function xe(e, t) {
|
|
353
353
|
var n;
|
|
354
354
|
return t.skipInCodeBlocks ? !!((n = e.parentElement) != null && n.closest("code, pre, kbd, samp")) : !1;
|
|
355
355
|
}
|
|
356
|
-
function
|
|
356
|
+
function et(e, t) {
|
|
357
357
|
return t.some((n) => e.start < n.end && n.start < e.end);
|
|
358
358
|
}
|
|
359
|
-
function
|
|
359
|
+
function tt(e, t, n) {
|
|
360
360
|
const i = [];
|
|
361
361
|
t.filter((a) => a.enabled).forEach((a) => {
|
|
362
|
-
const l =
|
|
362
|
+
const l = ge(a.pattern);
|
|
363
363
|
let c = l.exec(e);
|
|
364
364
|
for (; c && i.length < n * 5; ) {
|
|
365
365
|
const d = c[0] || "", s = c.index, p = s + d.length;
|
|
@@ -375,18 +375,18 @@ function et(e, t, n) {
|
|
|
375
375
|
const r = [];
|
|
376
376
|
for (let a = 0; a < i.length && !(r.length >= n); a += 1) {
|
|
377
377
|
const l = i[a];
|
|
378
|
-
|
|
378
|
+
et({ start: l.start, end: l.end }, r) || r.push(l);
|
|
379
379
|
}
|
|
380
380
|
return r;
|
|
381
381
|
}
|
|
382
|
-
function
|
|
382
|
+
function fe(e, t = 120) {
|
|
383
383
|
return e.length <= t ? e : `${e.slice(0, t - 1).trimEnd()}...`;
|
|
384
384
|
}
|
|
385
|
-
function
|
|
385
|
+
function nt(e, t, n) {
|
|
386
386
|
const i = Math.max(0, t - 28), o = Math.min(e.length, n + 28);
|
|
387
|
-
return
|
|
387
|
+
return fe(e.slice(i, o).trim(), 180);
|
|
388
388
|
}
|
|
389
|
-
function
|
|
389
|
+
function rt(e, t) {
|
|
390
390
|
const n = le(t);
|
|
391
391
|
return n.total = e.length, e.forEach((i) => {
|
|
392
392
|
n.byType[i.type] += 1, i.severity === "high" ? n.high += 1 : i.severity === "medium" ? n.medium += 1 : n.low += 1;
|
|
@@ -402,7 +402,7 @@ function F(e, t, n) {
|
|
|
402
402
|
const o = H(e, n);
|
|
403
403
|
i.textContent = o ? n.labels.realtimeOnText : n.labels.realtimeOffText, i.setAttribute("aria-pressed", o ? "true" : "false"), C(e, "togglePIIRealtime", o);
|
|
404
404
|
}
|
|
405
|
-
function
|
|
405
|
+
function it(e, t) {
|
|
406
406
|
e.setAttribute("aria-label", t.labels.panelAriaLabel);
|
|
407
407
|
const n = e.querySelector(".rte-pii-redaction-title");
|
|
408
408
|
n && (n.textContent = t.labels.panelTitle);
|
|
@@ -441,8 +441,8 @@ function B(e) {
|
|
|
441
441
|
<span class="rte-pii-redaction-badge">${b(s.severity.toUpperCase())}</span>
|
|
442
442
|
<span class="rte-pii-redaction-type">${b(p)}</span>
|
|
443
443
|
</button>
|
|
444
|
-
<p class="rte-pii-redaction-line"><strong>${b(n.labels.matchLabel)}:</strong> ${b(
|
|
445
|
-
<p class="rte-pii-redaction-line"><strong>${b(n.labels.maskedLabel)}:</strong> ${b(
|
|
444
|
+
<p class="rte-pii-redaction-line"><strong>${b(n.labels.matchLabel)}:</strong> ${b(fe(s.match, 80))}</p>
|
|
445
|
+
<p class="rte-pii-redaction-line"><strong>${b(n.labels.maskedLabel)}:</strong> ${b(fe(s.masked, 80))}</p>
|
|
446
446
|
${s.excerpt ? `<p class="rte-pii-redaction-line"><strong>${b(n.labels.excerptLabel)}:</strong> ${b(s.excerpt)}</p>` : ""}
|
|
447
447
|
<p class="rte-pii-redaction-help">${b(A)}</p>
|
|
448
448
|
<div class="rte-pii-redaction-item-actions">
|
|
@@ -455,16 +455,16 @@ function B(e) {
|
|
|
455
455
|
}).join("");
|
|
456
456
|
}
|
|
457
457
|
}
|
|
458
|
-
function
|
|
458
|
+
function pe(e, t) {
|
|
459
459
|
if (!t.classList.contains("show")) return;
|
|
460
|
-
const i =
|
|
460
|
+
const i = me(e).getBoundingClientRect(), o = Math.min(window.innerWidth - 20, 390), r = Math.max(10, window.innerWidth - o - 10), a = Math.min(Math.max(10, i.right - o), r), l = Math.max(10, Math.min(window.innerHeight - 10 - 280, i.top + 10));
|
|
461
461
|
t.style.width = `${o}px`, t.style.left = `${a}px`, t.style.top = `${l}px`, t.style.maxHeight = `${Math.max(260, window.innerHeight - 20)}px`;
|
|
462
462
|
}
|
|
463
463
|
function H(e, t) {
|
|
464
464
|
const n = S.get(e);
|
|
465
465
|
return typeof n == "boolean" ? n : t ? t.enableRealtime : !0;
|
|
466
466
|
}
|
|
467
|
-
function
|
|
467
|
+
function Ae(e, t) {
|
|
468
468
|
if (t === e.innerHTML) return;
|
|
469
469
|
const n = window.execEditorCommand || window.executeEditorCommand;
|
|
470
470
|
if (typeof n == "function")
|
|
@@ -473,10 +473,10 @@ function Se(e, t) {
|
|
|
473
473
|
} catch (i) {
|
|
474
474
|
}
|
|
475
475
|
}
|
|
476
|
-
function
|
|
476
|
+
function Me(e) {
|
|
477
477
|
e.dispatchEvent(new Event("input", { bubbles: !0 }));
|
|
478
478
|
}
|
|
479
|
-
function
|
|
479
|
+
function Pe(e, t) {
|
|
480
480
|
e.dispatchEvent(
|
|
481
481
|
new CustomEvent("editora:pii-redacted", {
|
|
482
482
|
bubbles: !0,
|
|
@@ -486,13 +486,13 @@ function Me(e, t) {
|
|
|
486
486
|
})
|
|
487
487
|
);
|
|
488
488
|
}
|
|
489
|
-
function
|
|
489
|
+
function Le(e, t) {
|
|
490
490
|
return (I.get(e) || []).find((i) => i.id === t);
|
|
491
491
|
}
|
|
492
|
-
function
|
|
492
|
+
function ot(e) {
|
|
493
493
|
const t = m.get(e);
|
|
494
494
|
if (t) return t;
|
|
495
|
-
const n = f.get(e) || M || ee(), i = `rte-pii-redaction-panel-${
|
|
495
|
+
const n = f.get(e) || M || ee(), i = `rte-pii-redaction-panel-${Be++}`, o = document.createElement("section");
|
|
496
496
|
return o.className = u, o.id = i, o.setAttribute("role", "dialog"), o.setAttribute("aria-modal", "false"), o.setAttribute("aria-label", n.labels.panelAriaLabel), o.innerHTML = `
|
|
497
497
|
<header class="rte-pii-redaction-header">
|
|
498
498
|
<h2 class="rte-pii-redaction-title">${b(n.labels.panelTitle)}</h2>
|
|
@@ -536,18 +536,18 @@ function it(e) {
|
|
|
536
536
|
return;
|
|
537
537
|
}
|
|
538
538
|
if (c === "redact-all") {
|
|
539
|
-
|
|
539
|
+
ye(e, d);
|
|
540
540
|
return;
|
|
541
541
|
}
|
|
542
542
|
if (c === "locate-finding") {
|
|
543
|
-
const s = l.getAttribute("data-finding-id") || "", p =
|
|
543
|
+
const s = l.getAttribute("data-finding-id") || "", p = Le(e, s);
|
|
544
544
|
if (!p) return;
|
|
545
|
-
|
|
545
|
+
ct(e, p, d);
|
|
546
546
|
return;
|
|
547
547
|
}
|
|
548
548
|
if (c === "redact-finding") {
|
|
549
549
|
const s = l.getAttribute("data-finding-id") || "";
|
|
550
|
-
|
|
550
|
+
Ne(e, s, d);
|
|
551
551
|
}
|
|
552
552
|
}), o.addEventListener("keydown", (r) => {
|
|
553
553
|
if (r.key === "Escape") {
|
|
@@ -570,23 +570,23 @@ function Z(e, t = !1) {
|
|
|
570
570
|
}
|
|
571
571
|
function O(e) {
|
|
572
572
|
q();
|
|
573
|
-
const t =
|
|
573
|
+
const t = ot(e);
|
|
574
574
|
m.forEach((i, o) => {
|
|
575
575
|
o !== e && Z(o, !1);
|
|
576
|
-
}), t.classList.add("show"), V.set(e, !0), C(e, "togglePIIRedactionPanel", !0), ne(t, e),
|
|
576
|
+
}), t.classList.add("show"), V.set(e, !0), C(e, "togglePIIRedactionPanel", !0), ne(t, e), pe(e, t), B(e);
|
|
577
577
|
const n = t.querySelector('[data-action="run-scan"]');
|
|
578
578
|
n == null || n.focus();
|
|
579
579
|
}
|
|
580
|
-
function
|
|
580
|
+
function De(e, t) {
|
|
581
581
|
const n = ie(e);
|
|
582
582
|
return (typeof t == "boolean" ? t : !n) ? O(e) : Z(e), !0;
|
|
583
583
|
}
|
|
584
|
-
function
|
|
584
|
+
function at(e, t) {
|
|
585
585
|
const n = t.normalizeText(e.innerText || e.textContent || ""), i = e.innerHTML;
|
|
586
|
-
return `${n.length}:${
|
|
586
|
+
return `${n.length}:${Ie(n)}:${i.length}:${Ie(i)}:${t.detectorSignature}`;
|
|
587
587
|
}
|
|
588
|
-
function
|
|
589
|
-
const n = [], i =
|
|
588
|
+
function lt(e, t) {
|
|
589
|
+
const n = [], i = ge(e.pattern);
|
|
590
590
|
let o = i.exec(t);
|
|
591
591
|
for (; o; ) {
|
|
592
592
|
const r = o[0] || "", a = o.index, l = a + r.length;
|
|
@@ -594,16 +594,16 @@ function at(e, t) {
|
|
|
594
594
|
}
|
|
595
595
|
return n;
|
|
596
596
|
}
|
|
597
|
-
function
|
|
597
|
+
function _e(e, t, n) {
|
|
598
598
|
const i = n.detectors.find((c) => c.type === t.type && c.enabled);
|
|
599
599
|
if (!i) return null;
|
|
600
600
|
const o = t.match.toLowerCase();
|
|
601
601
|
let r = 0;
|
|
602
|
-
const a = document.createTreeWalker(e,
|
|
602
|
+
const a = document.createTreeWalker(e, be, null);
|
|
603
603
|
let l = a.nextNode();
|
|
604
604
|
for (; l; ) {
|
|
605
|
-
if (!
|
|
606
|
-
const c =
|
|
605
|
+
if (!xe(l, n)) {
|
|
606
|
+
const c = lt(i, l.data);
|
|
607
607
|
for (let d = 0; d < c.length; d += 1) {
|
|
608
608
|
const s = c[d];
|
|
609
609
|
if (s.value.toLowerCase() === o && (r += 1, r === t.occurrence)) {
|
|
@@ -616,8 +616,8 @@ function De(e, t, n) {
|
|
|
616
616
|
}
|
|
617
617
|
return null;
|
|
618
618
|
}
|
|
619
|
-
function
|
|
620
|
-
const i =
|
|
619
|
+
function ct(e, t, n) {
|
|
620
|
+
const i = _e(e, t, n);
|
|
621
621
|
if (!i) return !1;
|
|
622
622
|
const o = window.getSelection();
|
|
623
623
|
if (!o) return !1;
|
|
@@ -628,27 +628,27 @@ function lt(e, t, n) {
|
|
|
628
628
|
async function h(e, t, n = !1) {
|
|
629
629
|
var p;
|
|
630
630
|
w(e, t);
|
|
631
|
-
const i =
|
|
632
|
-
if (!n &&
|
|
631
|
+
const i = at(e, t);
|
|
632
|
+
if (!n && ue.get(e) === i)
|
|
633
633
|
return I.get(e) || [];
|
|
634
634
|
const o = (Q.get(e) || 0) + 1;
|
|
635
635
|
Q.set(e, o);
|
|
636
|
-
const r = [], a = /* @__PURE__ */ new Map(), l = document.createTreeWalker(e,
|
|
636
|
+
const r = [], a = /* @__PURE__ */ new Map(), l = document.createTreeWalker(e, be, null);
|
|
637
637
|
let c = l.nextNode();
|
|
638
638
|
for (; c && r.length < t.maxFindings; ) {
|
|
639
639
|
const A = c.data || "";
|
|
640
|
-
if (A.trim() && !
|
|
641
|
-
const P =
|
|
640
|
+
if (A.trim() && !xe(c, t)) {
|
|
641
|
+
const P = tt(A, t.detectors, t.maxFindings - r.length);
|
|
642
642
|
for (let K = 0; K < P.length && !(r.length >= t.maxFindings); K += 1) {
|
|
643
|
-
const y = P[K],
|
|
644
|
-
a.set(
|
|
645
|
-
id:
|
|
643
|
+
const y = P[K], ke = `${y.type}:${y.value.toLowerCase()}`, we = (a.get(ke) || 0) + 1;
|
|
644
|
+
a.set(ke, we), r.push({
|
|
645
|
+
id: Qe(y.type),
|
|
646
646
|
type: y.type,
|
|
647
647
|
severity: y.severity,
|
|
648
648
|
match: y.value,
|
|
649
|
-
masked:
|
|
650
|
-
occurrence:
|
|
651
|
-
excerpt:
|
|
649
|
+
masked: Re(y.value, y.type, t),
|
|
650
|
+
occurrence: we,
|
|
651
|
+
excerpt: nt(A, y.start, y.end),
|
|
652
652
|
suggestion: "Review and redact this value before external sharing."
|
|
653
653
|
});
|
|
654
654
|
}
|
|
@@ -657,8 +657,8 @@ async function h(e, t, n = !1) {
|
|
|
657
657
|
}
|
|
658
658
|
if (Q.get(e) !== o)
|
|
659
659
|
return I.get(e) || [];
|
|
660
|
-
const d = ((p = E.get(e)) == null ? void 0 : p.redactedCount) || 0, s =
|
|
661
|
-
return
|
|
660
|
+
const d = ((p = E.get(e)) == null ? void 0 : p.redactedCount) || 0, s = rt(r, d);
|
|
661
|
+
return ue.set(e, i), I.set(e, r), E.set(e, s), B(e), e.dispatchEvent(
|
|
662
662
|
new CustomEvent("editora:pii-scan", {
|
|
663
663
|
bubbles: !0,
|
|
664
664
|
detail: {
|
|
@@ -668,36 +668,36 @@ async function h(e, t, n = !1) {
|
|
|
668
668
|
})
|
|
669
669
|
), r;
|
|
670
670
|
}
|
|
671
|
-
function
|
|
671
|
+
function st(e, t) {
|
|
672
672
|
let n = e, i = 0;
|
|
673
673
|
return t.detectors.filter((r) => r.enabled).forEach((r) => {
|
|
674
|
-
const a =
|
|
675
|
-
n = n.replace(a, (l) => r.validator && !r.validator(l) ? l : (i += 1,
|
|
674
|
+
const a = ge(r.pattern);
|
|
675
|
+
n = n.replace(a, (l) => r.validator && !r.validator(l) ? l : (i += 1, Se(l, r.type, t)));
|
|
676
676
|
}), { nextValue: n, count: i };
|
|
677
677
|
}
|
|
678
|
-
async function
|
|
678
|
+
async function Ne(e, t, n) {
|
|
679
679
|
var d;
|
|
680
680
|
if (U(e)) {
|
|
681
681
|
const s = m.get(e);
|
|
682
682
|
return s && oe(s, n.labels.readonlyRedactionText), !1;
|
|
683
683
|
}
|
|
684
|
-
const i =
|
|
684
|
+
const i = Le(e, t);
|
|
685
685
|
if (!i) return !1;
|
|
686
|
-
const o =
|
|
686
|
+
const o = _e(e, i, n);
|
|
687
687
|
if (!o) return !1;
|
|
688
|
-
const r = e.innerHTML, a =
|
|
688
|
+
const r = e.innerHTML, a = Se(i.match, i.type, n);
|
|
689
689
|
if (o.startContainer === o.endContainer && o.startContainer.nodeType === Node.TEXT_NODE) {
|
|
690
690
|
const s = o.startContainer, p = s.data, A = o.startOffset, P = o.endOffset;
|
|
691
691
|
s.data = `${p.slice(0, A)}${a}${p.slice(P)}`;
|
|
692
692
|
} else
|
|
693
693
|
o.deleteContents(), o.insertNode(document.createTextNode(a));
|
|
694
|
-
|
|
694
|
+
Me(e), Ae(e, r);
|
|
695
695
|
const l = ((d = E.get(e)) == null ? void 0 : d.redactedCount) || 0;
|
|
696
696
|
await h(e, n, !0);
|
|
697
697
|
const c = E.get(e);
|
|
698
|
-
return c && (c.redactedCount = l + 1, B(e)),
|
|
698
|
+
return c && (c.redactedCount = l + 1, B(e)), Pe(e, 1), !0;
|
|
699
699
|
}
|
|
700
|
-
async function
|
|
700
|
+
async function ye(e, t) {
|
|
701
701
|
var d;
|
|
702
702
|
if (U(e)) {
|
|
703
703
|
const s = m.get(e);
|
|
@@ -706,10 +706,10 @@ async function xe(e, t) {
|
|
|
706
706
|
(I.get(e) || []).length === 0 && await h(e, t, !0);
|
|
707
707
|
const i = e.innerHTML;
|
|
708
708
|
let o = 0;
|
|
709
|
-
const r = document.createTreeWalker(e,
|
|
709
|
+
const r = document.createTreeWalker(e, be, null);
|
|
710
710
|
let a = r.nextNode();
|
|
711
711
|
for (; a; ) {
|
|
712
|
-
if (
|
|
712
|
+
if (xe(a, t)) {
|
|
713
713
|
a = r.nextNode();
|
|
714
714
|
continue;
|
|
715
715
|
}
|
|
@@ -718,42 +718,45 @@ async function xe(e, t) {
|
|
|
718
718
|
a = r.nextNode();
|
|
719
719
|
continue;
|
|
720
720
|
}
|
|
721
|
-
const p =
|
|
721
|
+
const p = st(s, t);
|
|
722
722
|
p.count > 0 && p.nextValue !== s && (a.data = p.nextValue, o += p.count), a = r.nextNode();
|
|
723
723
|
}
|
|
724
724
|
if (o === 0) return 0;
|
|
725
|
-
|
|
725
|
+
Me(e), Ae(e, i);
|
|
726
726
|
const l = ((d = E.get(e)) == null ? void 0 : d.redactedCount) || 0;
|
|
727
727
|
await h(e, t, !0);
|
|
728
728
|
const c = E.get(e);
|
|
729
|
-
return c && (c.redactedCount = l + o, B(e)),
|
|
729
|
+
return c && (c.redactedCount = l + o, B(e)), Pe(e, o), o;
|
|
730
730
|
}
|
|
731
|
-
function
|
|
731
|
+
function Oe(e) {
|
|
732
732
|
const t = f.get(e) || M;
|
|
733
733
|
if (!t || !H(e, t) || U(e)) return;
|
|
734
|
-
|
|
734
|
+
he(e);
|
|
735
735
|
const n = window.setTimeout(() => {
|
|
736
736
|
j.delete(n), te.delete(e), h(e, t, !1);
|
|
737
737
|
}, t.debounceMs);
|
|
738
738
|
j.add(n), te.set(e, n);
|
|
739
739
|
}
|
|
740
|
-
function
|
|
741
|
-
|
|
742
|
-
return (e.metaKey || e.ctrlKey) && e.altKey && e.shiftKey && t === "i";
|
|
740
|
+
function ce(e) {
|
|
741
|
+
return typeof e.key == "string" ? e.key.toLowerCase() : "";
|
|
743
742
|
}
|
|
744
743
|
function dt(e) {
|
|
745
|
-
const t = e
|
|
746
|
-
return (e.metaKey || e.ctrlKey) && e.altKey && e.shiftKey && t === "
|
|
744
|
+
const t = ce(e);
|
|
745
|
+
return (e.metaKey || e.ctrlKey) && e.altKey && e.shiftKey && t === "i";
|
|
747
746
|
}
|
|
748
747
|
function ut(e) {
|
|
749
|
-
const t = e
|
|
750
|
-
return (e.metaKey || e.ctrlKey) && e.altKey && e.shiftKey && t === "
|
|
748
|
+
const t = ce(e);
|
|
749
|
+
return (e.metaKey || e.ctrlKey) && e.altKey && e.shiftKey && t === "u";
|
|
751
750
|
}
|
|
752
751
|
function ft(e) {
|
|
753
|
-
const t = e
|
|
754
|
-
return (e.metaKey || e.ctrlKey) && e.altKey && e.shiftKey && t === "
|
|
752
|
+
const t = ce(e);
|
|
753
|
+
return (e.metaKey || e.ctrlKey) && e.altKey && e.shiftKey && t === "m";
|
|
755
754
|
}
|
|
756
755
|
function pt(e) {
|
|
756
|
+
const t = ce(e);
|
|
757
|
+
return (e.metaKey || e.ctrlKey) && e.altKey && e.shiftKey && t === "y";
|
|
758
|
+
}
|
|
759
|
+
function bt(e) {
|
|
757
760
|
var i;
|
|
758
761
|
const t = re(e.target);
|
|
759
762
|
if (t) {
|
|
@@ -779,10 +782,10 @@ function pt(e) {
|
|
|
779
782
|
}
|
|
780
783
|
return null;
|
|
781
784
|
}
|
|
782
|
-
function
|
|
783
|
-
if (typeof document == "undefined" || document.getElementById(
|
|
785
|
+
function gt() {
|
|
786
|
+
if (typeof document == "undefined" || document.getElementById(ve)) return;
|
|
784
787
|
const e = document.createElement("style");
|
|
785
|
-
e.id =
|
|
788
|
+
e.id = ve, e.textContent = `
|
|
786
789
|
.rte-toolbar-group-items.${k},
|
|
787
790
|
.editora-toolbar-group-items.${k},
|
|
788
791
|
.rte-toolbar-group-items.${v},
|
|
@@ -1179,7 +1182,7 @@ function bt() {
|
|
|
1179
1182
|
}
|
|
1180
1183
|
`, document.head.appendChild(e);
|
|
1181
1184
|
}
|
|
1182
|
-
function
|
|
1185
|
+
function mt(e) {
|
|
1183
1186
|
M = e, L || (L = (t) => {
|
|
1184
1187
|
q();
|
|
1185
1188
|
const n = t.target, i = n == null ? void 0 : n.closest(x);
|
|
@@ -1188,34 +1191,34 @@ function gt(e) {
|
|
|
1188
1191
|
const o = f.get(i) || e;
|
|
1189
1192
|
w(i, o), f.set(i, o), C(i, "togglePIIRedactionPanel", ie(i)), C(i, "togglePIIRealtime", H(i, o));
|
|
1190
1193
|
const r = m.get(i);
|
|
1191
|
-
r && (ne(r, i),
|
|
1194
|
+
r && (ne(r, i), pe(i, r), F(i, r, o));
|
|
1192
1195
|
}, document.addEventListener("focusin", L, !0)), D || (D = (t) => {
|
|
1193
1196
|
const n = t.target, i = n == null ? void 0 : n.closest(x);
|
|
1194
|
-
i && (g = i,
|
|
1197
|
+
i && (g = i, Oe(i));
|
|
1195
1198
|
}, document.addEventListener("input", D, !0)), _ || (_ = (t) => {
|
|
1196
1199
|
if (t.defaultPrevented) return;
|
|
1197
1200
|
const n = t.target;
|
|
1198
1201
|
if (n != null && n.closest(`.${u} input, .${u} textarea, .${u} select`)) return;
|
|
1199
|
-
const i =
|
|
1202
|
+
const i = bt(t);
|
|
1200
1203
|
if (!i) return;
|
|
1201
1204
|
const o = f.get(i) || M || e;
|
|
1202
1205
|
if (w(i, o), f.set(i, o), g = i, t.key === "Escape" && ie(i)) {
|
|
1203
1206
|
t.preventDefault(), Z(i, !0);
|
|
1204
1207
|
return;
|
|
1205
1208
|
}
|
|
1206
|
-
if (st(t)) {
|
|
1207
|
-
t.preventDefault(), t.stopPropagation(), Le(i);
|
|
1208
|
-
return;
|
|
1209
|
-
}
|
|
1210
1209
|
if (dt(t)) {
|
|
1211
|
-
t.preventDefault(), t.stopPropagation(),
|
|
1210
|
+
t.preventDefault(), t.stopPropagation(), De(i);
|
|
1212
1211
|
return;
|
|
1213
1212
|
}
|
|
1214
1213
|
if (ut(t)) {
|
|
1215
|
-
t.preventDefault(), t.stopPropagation(),
|
|
1214
|
+
t.preventDefault(), t.stopPropagation(), h(i, o, !0), O(i);
|
|
1216
1215
|
return;
|
|
1217
1216
|
}
|
|
1218
1217
|
if (ft(t)) {
|
|
1218
|
+
t.preventDefault(), t.stopPropagation(), U(i) || (ye(i, o), O(i));
|
|
1219
|
+
return;
|
|
1220
|
+
}
|
|
1221
|
+
if (pt(t)) {
|
|
1219
1222
|
t.preventDefault(), t.stopPropagation();
|
|
1220
1223
|
const r = !H(i, o);
|
|
1221
1224
|
S.set(i, r);
|
|
@@ -1224,21 +1227,21 @@ function gt(e) {
|
|
|
1224
1227
|
}
|
|
1225
1228
|
}, document.addEventListener("keydown", _, !0)), R || (R = () => {
|
|
1226
1229
|
q(), m.forEach((t, n) => {
|
|
1227
|
-
!n.isConnected || !t.isConnected || (ne(t, n),
|
|
1230
|
+
!n.isConnected || !t.isConnected || (ne(t, n), pe(n, t));
|
|
1228
1231
|
});
|
|
1229
1232
|
}, window.addEventListener("scroll", R, !0), window.addEventListener("resize", R)), !N && typeof MutationObserver != "undefined" && document.body && (N = new MutationObserver((t) => {
|
|
1230
|
-
|
|
1233
|
+
Ye(t) && q();
|
|
1231
1234
|
}), N.observe(document.body, {
|
|
1232
1235
|
childList: !0,
|
|
1233
1236
|
subtree: !0
|
|
1234
1237
|
}));
|
|
1235
1238
|
}
|
|
1236
|
-
function
|
|
1237
|
-
L && (document.removeEventListener("focusin", L, !0), L = null), D && (document.removeEventListener("input", D, !0), D = null), _ && (document.removeEventListener("keydown", _, !0), _ = null), R && (window.removeEventListener("scroll", R, !0), window.removeEventListener("resize", R), R = null), N && (N.disconnect(), N = null), m.forEach((e) => e.remove()), m.clear(), W.forEach((e) =>
|
|
1239
|
+
function ht() {
|
|
1240
|
+
L && (document.removeEventListener("focusin", L, !0), L = null), D && (document.removeEventListener("input", D, !0), D = null), _ && (document.removeEventListener("keydown", _, !0), _ = null), R && (window.removeEventListener("scroll", R, !0), window.removeEventListener("resize", R), R = null), N && (N.disconnect(), N = null), m.forEach((e) => e.remove()), m.clear(), W.forEach((e) => he(e)), W.clear(), M = null, g = null;
|
|
1238
1241
|
}
|
|
1239
|
-
const
|
|
1242
|
+
const xt = (e = {}) => {
|
|
1240
1243
|
const t = ee(e), n = /* @__PURE__ */ new Set();
|
|
1241
|
-
return
|
|
1244
|
+
return gt(), {
|
|
1242
1245
|
name: "piiRedaction",
|
|
1243
1246
|
toolbar: [
|
|
1244
1247
|
{
|
|
@@ -1290,7 +1293,7 @@ const ht = (e = {}) => {
|
|
|
1290
1293
|
if (!r) return !1;
|
|
1291
1294
|
const a = f.get(r) || t;
|
|
1292
1295
|
w(r, a), f.set(r, a), g = r;
|
|
1293
|
-
const l =
|
|
1296
|
+
const l = De(r, typeof i == "boolean" ? i : void 0);
|
|
1294
1297
|
return ie(r) && h(r, a, !1), l;
|
|
1295
1298
|
},
|
|
1296
1299
|
runPIIScan: async (i, o) => {
|
|
@@ -1304,14 +1307,14 @@ const ht = (e = {}) => {
|
|
|
1304
1307
|
if (!r) return !1;
|
|
1305
1308
|
const a = f.get(r) || t;
|
|
1306
1309
|
w(r, a), f.set(r, a), g = r;
|
|
1307
|
-
const l = await
|
|
1310
|
+
const l = await ye(r, a);
|
|
1308
1311
|
return l > 0 && O(r), l > 0;
|
|
1309
1312
|
},
|
|
1310
1313
|
redactPIIFinding: async (i, o) => {
|
|
1311
1314
|
const r = T(o);
|
|
1312
1315
|
if (!r || typeof i != "string" || !i) return !1;
|
|
1313
1316
|
const a = f.get(r) || t;
|
|
1314
|
-
return w(r, a), f.set(r, a), g = r,
|
|
1317
|
+
return w(r, a), f.set(r, a), g = r, Ne(r, i, a);
|
|
1315
1318
|
},
|
|
1316
1319
|
togglePIIRealtime: (i, o) => {
|
|
1317
1320
|
const r = T(o);
|
|
@@ -1346,21 +1349,21 @@ const ht = (e = {}) => {
|
|
|
1346
1349
|
const r = T(o);
|
|
1347
1350
|
if (!r || !i || typeof i != "object") return !1;
|
|
1348
1351
|
const a = f.get(r) || t, l = ee({
|
|
1349
|
-
...
|
|
1352
|
+
...se(a),
|
|
1350
1353
|
...i,
|
|
1351
1354
|
labels: {
|
|
1352
1355
|
...a.labels,
|
|
1353
1356
|
...i.labels || {}
|
|
1354
1357
|
},
|
|
1355
1358
|
detectors: {
|
|
1356
|
-
...
|
|
1359
|
+
...se(a).detectors || {},
|
|
1357
1360
|
...i.detectors || {}
|
|
1358
1361
|
},
|
|
1359
1362
|
normalizeText: i.normalizeText || a.normalizeText
|
|
1360
1363
|
});
|
|
1361
1364
|
f.set(r, l), typeof i.enableRealtime == "boolean" && S.set(r, i.enableRealtime);
|
|
1362
1365
|
const c = m.get(r);
|
|
1363
|
-
return c && (
|
|
1366
|
+
return c && (it(c, l), B(r), F(r, c, l)), h(r, l, !0), !0;
|
|
1364
1367
|
}
|
|
1365
1368
|
},
|
|
1366
1369
|
keymap: {
|
|
@@ -1375,22 +1378,22 @@ const ht = (e = {}) => {
|
|
|
1375
1378
|
},
|
|
1376
1379
|
init: function(o) {
|
|
1377
1380
|
G += 1;
|
|
1378
|
-
const r = this && typeof this.__pluginConfig == "object" ? ee({ ...
|
|
1379
|
-
|
|
1381
|
+
const r = this && typeof this.__pluginConfig == "object" ? ee({ ...se(t), ...this.__pluginConfig }) : t;
|
|
1382
|
+
mt(r);
|
|
1380
1383
|
const a = T(
|
|
1381
1384
|
o != null && o.editorElement ? { editorElement: o.editorElement } : void 0,
|
|
1382
1385
|
!1
|
|
1383
1386
|
);
|
|
1384
|
-
a && (g = a, n.add(a), w(a, r), f.set(a, r), C(a, "togglePIIRedactionPanel", !1), C(a, "togglePIIRealtime", r.enableRealtime), r.enableRealtime &&
|
|
1387
|
+
a && (g = a, n.add(a), w(a, r), f.set(a, r), C(a, "togglePIIRedactionPanel", !1), C(a, "togglePIIRealtime", r.enableRealtime), r.enableRealtime && Oe(a));
|
|
1385
1388
|
},
|
|
1386
1389
|
destroy: () => {
|
|
1387
|
-
n.forEach((i) =>
|
|
1390
|
+
n.forEach((i) => Ce(i)), n.clear(), G = Math.max(0, G - 1), !(G > 0) && (j.forEach((i) => {
|
|
1388
1391
|
window.clearTimeout(i);
|
|
1389
|
-
}), j.clear(),
|
|
1392
|
+
}), j.clear(), ht());
|
|
1390
1393
|
}
|
|
1391
1394
|
};
|
|
1392
1395
|
};
|
|
1393
1396
|
export {
|
|
1394
|
-
|
|
1397
|
+
xt as PIIRedactionPlugin
|
|
1395
1398
|
};
|
|
1396
|
-
//# sourceMappingURL=PIIRedactionPlugin.native-
|
|
1399
|
+
//# sourceMappingURL=PIIRedactionPlugin.native-g7j4jOmm.mjs.map
|