@zealsolutions/zeal-ui 1.0.0-alpha.375 → 1.0.0-alpha.377
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/components/sop-diff/index.js +49 -49
- package/dist/components/tiptap/index.js +1123 -1122
- package/dist/legacyLinks-D66HB1LX.js +194 -0
- package/dist/utils/index.js +24 -22
- package/package.json +1 -1
- package/dist/legacyHtml-qIyv-9pf.js +0 -129
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { n as D } from "../../
|
|
2
|
-
import { computed as
|
|
3
|
-
import { _ as
|
|
4
|
-
const
|
|
1
|
+
import { n as D, c as F } from "../../legacyLinks-D66HB1LX.js";
|
|
2
|
+
import { computed as B, openBlock as f, createElementBlock as b, createElementVNode as v, toDisplayString as x, createCommentVNode as S, Fragment as V, renderList as T, normalizeClass as U, createStaticVNode as j } from "vue";
|
|
3
|
+
import { _ as H } from "../../_plugin-vue_export-helper-CHgC5LLL.js";
|
|
4
|
+
const W = (e) => e === ">", A = (e) => e === "<", P = (e) => /^\s+$/.test(e), E = (e) => /^\s*<[^>]+>\s*$/.test(e), $ = (e) => !E(e);
|
|
5
5
|
class O {
|
|
6
6
|
constructor(t, i, n) {
|
|
7
7
|
this.start_in_before = t, this.start_in_after = i, this.length = n, this.end_in_before = t + n - 1, this.end_in_after = i + n - 1;
|
|
@@ -14,7 +14,7 @@ function N(e) {
|
|
|
14
14
|
const l = e[r];
|
|
15
15
|
switch (t) {
|
|
16
16
|
case "tag":
|
|
17
|
-
|
|
17
|
+
W(l) ? (i += ">", n.push(i), i = "", t = P(l) ? "whitespace" : "char") : i += l;
|
|
18
18
|
break;
|
|
19
19
|
case "char":
|
|
20
20
|
A(l) ? (i && n.push(i), i = "<", t = "tag") : /\s/.test(l) ? (i && n.push(i), i = l, t = "whitespace") : /[\w#@]+/i.test(l) ? i += l : (i && n.push(i), i = l);
|
|
@@ -28,7 +28,7 @@ function N(e) {
|
|
|
28
28
|
}
|
|
29
29
|
return i && n.push(i), n;
|
|
30
30
|
}
|
|
31
|
-
function
|
|
31
|
+
function z(e, t, i, n, r, a, l) {
|
|
32
32
|
let u = n, s = a, d = 0, c = {}, p;
|
|
33
33
|
for (let o = n; o < r; o++) {
|
|
34
34
|
const m = {}, g = e[o], y = i[g];
|
|
@@ -47,10 +47,10 @@ function $(e, t, i, n, r, a, l) {
|
|
|
47
47
|
return d !== 0 && (p = new O(u, s, d)), p;
|
|
48
48
|
}
|
|
49
49
|
function C(e, t, i, n, r, a, l, u) {
|
|
50
|
-
const s =
|
|
50
|
+
const s = z(e, t, i, n, r, a, l);
|
|
51
51
|
return s != null && (n < s.start_in_before && a < s.start_in_after && C(e, t, i, n, s.start_in_before, a, s.start_in_after, u), u.push(s), s.end_in_before <= r && s.end_in_after <= l && C(e, t, i, s.end_in_before + 1, r, s.end_in_after + 1, l, u)), u;
|
|
52
52
|
}
|
|
53
|
-
function
|
|
53
|
+
function Q(e) {
|
|
54
54
|
if (e.find_these == null)
|
|
55
55
|
throw new Error("params must have find_these key");
|
|
56
56
|
if (e.in_these == null)
|
|
@@ -65,11 +65,11 @@ function z(e) {
|
|
|
65
65
|
}
|
|
66
66
|
return t;
|
|
67
67
|
}
|
|
68
|
-
function
|
|
69
|
-
const i = [], n =
|
|
68
|
+
function Y(e, t) {
|
|
69
|
+
const i = [], n = Q({ find_these: e, in_these: t });
|
|
70
70
|
return C(e, t, n, 0, e.length, 0, t.length, i);
|
|
71
71
|
}
|
|
72
|
-
function
|
|
72
|
+
function J(e, t) {
|
|
73
73
|
if (e == null)
|
|
74
74
|
throw new Error("before_tokens?");
|
|
75
75
|
if (t == null)
|
|
@@ -80,7 +80,7 @@ function Y(e, t) {
|
|
|
80
80
|
"true,false": "insert",
|
|
81
81
|
"false,true": "delete",
|
|
82
82
|
"true,true": "none"
|
|
83
|
-
}, l =
|
|
83
|
+
}, l = Y(e, t);
|
|
84
84
|
l.push(new O(e.length, t.length, 0));
|
|
85
85
|
for (let c = 0, p = l.length; c < p; c++) {
|
|
86
86
|
const o = l[c], m = i === o.start_in_before, g = n === o.start_in_after, y = a[[m, g].toString()];
|
|
@@ -121,10 +121,10 @@ function I(e, t) {
|
|
|
121
121
|
let i = "", n = 0;
|
|
122
122
|
const r = t.length;
|
|
123
123
|
for (; !(n >= r); ) {
|
|
124
|
-
const a = G(n, t,
|
|
124
|
+
const a = G(n, t, $);
|
|
125
125
|
if (n += a.length, a.length !== 0 && (i += "<" + e + ">" + a.join("") + "</" + e + ">"), n >= r)
|
|
126
126
|
break;
|
|
127
|
-
const l = G(n, t,
|
|
127
|
+
const l = G(n, t, E);
|
|
128
128
|
n += l.length, i += l.join("");
|
|
129
129
|
}
|
|
130
130
|
return i;
|
|
@@ -135,7 +135,7 @@ const _ = {
|
|
|
135
135
|
delete: (e, t) => I("del", t.slice(e.start_in_before, +e.end_in_before + 1 || 9e9))
|
|
136
136
|
};
|
|
137
137
|
_.replace = (e, t, i) => _.delete(e, t, i) + _.insert(e, t, i);
|
|
138
|
-
function
|
|
138
|
+
function K(e, t, i) {
|
|
139
139
|
let n = "";
|
|
140
140
|
for (let r = 0, a = i.length; r < a; r++) {
|
|
141
141
|
const l = i[r];
|
|
@@ -143,13 +143,13 @@ function J(e, t, i) {
|
|
|
143
143
|
}
|
|
144
144
|
return n;
|
|
145
145
|
}
|
|
146
|
-
function
|
|
146
|
+
function X(e, t) {
|
|
147
147
|
if (e === t)
|
|
148
148
|
return e;
|
|
149
|
-
const i = N(e ?? ""), n = N(t ?? ""), r =
|
|
150
|
-
return
|
|
149
|
+
const i = N(e ?? ""), n = N(t ?? ""), r = J(i, n);
|
|
150
|
+
return K(i, n, r);
|
|
151
151
|
}
|
|
152
|
-
const
|
|
152
|
+
const Z = {
|
|
153
153
|
sop: {
|
|
154
154
|
title: (e) => [e.SOPCode, e.Name].filter(Boolean).join(" — "),
|
|
155
155
|
fields: [
|
|
@@ -346,19 +346,19 @@ function M(e) {
|
|
|
346
346
|
const t = String(e).trim().toLowerCase();
|
|
347
347
|
return t === "true" || t === "1" || t === "yes" ? "Yes" : t === "false" || t === "0" || t === "no" ? "No" : String(e);
|
|
348
348
|
}
|
|
349
|
-
const
|
|
350
|
-
function
|
|
351
|
-
const r =
|
|
349
|
+
const L = (e, t) => e.rich ? D(F(t)) : t;
|
|
350
|
+
function pe(e, t, i = {}, n = null) {
|
|
351
|
+
const r = Z[e];
|
|
352
352
|
if (!r || !t)
|
|
353
353
|
return { title: "", sections: [] };
|
|
354
354
|
const a = { ...t, ...i }, l = n ? { ...n, ...i } : null, u = r.fields.map((s) => {
|
|
355
|
-
const d = s.bool ? M(a[s.key]) :
|
|
355
|
+
const d = s.bool ? M(a[s.key]) : L(s, a[s.key]);
|
|
356
356
|
if (!l)
|
|
357
357
|
return w(d) ? { label: s.label, value: d, rich: !!s.rich } : null;
|
|
358
|
-
const c = s.bool ? M(l[s.key]) :
|
|
358
|
+
const c = s.bool ? M(l[s.key]) : L(s, l[s.key]);
|
|
359
359
|
return !w(d) && !w(c) ? null : {
|
|
360
360
|
label: s.label,
|
|
361
|
-
value:
|
|
361
|
+
value: X(String(d ?? ""), String(c ?? "")),
|
|
362
362
|
rich: !!s.rich,
|
|
363
363
|
// original field richness — the modal uses it to pre-wrap plain diffs
|
|
364
364
|
diff: !0
|
|
@@ -366,25 +366,25 @@ function he(e, t, i = {}, n = null) {
|
|
|
366
366
|
}).filter(Boolean);
|
|
367
367
|
return { title: r.title(n || t), sections: u };
|
|
368
368
|
}
|
|
369
|
-
const
|
|
369
|
+
const ee = { class: "flex flex-col h-full overflow-hidden" }, te = { class: "text-style-sub-header font-medium text-app-950 leading-[1.3]" }, ie = {
|
|
370
370
|
key: 0,
|
|
371
371
|
"data-testid": "preview-diff-legend",
|
|
372
372
|
class: "border-b-[1px] border-steel-300 dark:border-line px-6 py-[10px] flex items-center gap-[16px] text-[12px] text-[#697277] dark:text-content-muted shrink-0"
|
|
373
|
-
},
|
|
373
|
+
}, ne = /* @__PURE__ */ j('<span class="font-semibold" data-v-6cebbfea>Unpublished draft changes</span><span class="flex items-center gap-[5px]" data-v-6cebbfea><span class="inline-block w-[14px] h-[10px] rounded-[2px]" style="background-color:#d4fcbc;" data-v-6cebbfea></span>Added</span><span class="flex items-center gap-[5px]" data-v-6cebbfea><span class="inline-block w-[14px] h-[10px] rounded-[2px]" style="background-color:#fbb6c2;" data-v-6cebbfea></span>Removed</span>', 3), re = {
|
|
374
374
|
key: 0,
|
|
375
375
|
"data-testid": "preview-diff-loading",
|
|
376
376
|
class: "italic"
|
|
377
|
-
},
|
|
377
|
+
}, le = { class: "flex-1 min-h-0 overflow-y-auto px-6 py-5" }, ae = {
|
|
378
378
|
key: 0,
|
|
379
379
|
"data-testid": "preview-empty",
|
|
380
380
|
class: "text-[14px] text-[#697277] dark:text-content-muted"
|
|
381
|
-
},
|
|
381
|
+
}, se = {
|
|
382
382
|
key: 1,
|
|
383
383
|
class: "flex flex-col gap-6"
|
|
384
|
-
},
|
|
384
|
+
}, oe = { class: "font-semibold text-[13px] text-[#326d68] dark:text-proclusteal-950 leading-[1.2] mb-[6px]" }, ce = ["innerHTML"], ue = ["innerHTML"], de = {
|
|
385
385
|
key: 2,
|
|
386
386
|
class: "text-[15px] text-black-950 dark:text-content leading-[1.5] whitespace-pre-wrap"
|
|
387
|
-
},
|
|
387
|
+
}, fe = {
|
|
388
388
|
__name: "SopCompare",
|
|
389
389
|
props: {
|
|
390
390
|
title: { type: String, default: "" },
|
|
@@ -392,38 +392,38 @@ const Z = { class: "flex flex-col h-full overflow-hidden" }, ee = { class: "text
|
|
|
392
392
|
loading: { type: Boolean, default: !1 }
|
|
393
393
|
},
|
|
394
394
|
setup(e) {
|
|
395
|
-
const t = e, i =
|
|
396
|
-
return (n, r) => (f(), b("div",
|
|
397
|
-
v("p",
|
|
398
|
-
i.value || e.loading ? (f(), b("div",
|
|
399
|
-
|
|
400
|
-
e.loading ? (f(), b("span",
|
|
395
|
+
const t = e, i = B(() => t.sections.some((n) => n.diff));
|
|
396
|
+
return (n, r) => (f(), b("div", ee, [
|
|
397
|
+
v("p", te, x(e.title), 1),
|
|
398
|
+
i.value || e.loading ? (f(), b("div", ie, [
|
|
399
|
+
ne,
|
|
400
|
+
e.loading ? (f(), b("span", re, "Loading changes…")) : S("", !0)
|
|
401
401
|
])) : S("", !0),
|
|
402
|
-
v("div",
|
|
403
|
-
e.sections.length ? (f(), b("div",
|
|
404
|
-
(f(!0), b(
|
|
402
|
+
v("div", le, [
|
|
403
|
+
e.sections.length ? (f(), b("div", se, [
|
|
404
|
+
(f(!0), b(V, null, T(e.sections, (a, l) => (f(), b("section", {
|
|
405
405
|
key: l,
|
|
406
406
|
"data-testid": "preview-section"
|
|
407
407
|
}, [
|
|
408
|
-
v("p",
|
|
408
|
+
v("p", oe, x(a.label), 1),
|
|
409
409
|
a.diff ? (f(), b("div", {
|
|
410
410
|
key: 0,
|
|
411
|
-
class:
|
|
411
|
+
class: U(["preview-content text-[15px] text-black-950 dark:text-content leading-[1.5]", { "whitespace-pre-wrap": !a.rich }]),
|
|
412
412
|
innerHTML: a.value
|
|
413
|
-
}, null, 10,
|
|
413
|
+
}, null, 10, ce)) : a.rich ? (f(), b("div", {
|
|
414
414
|
key: 1,
|
|
415
415
|
class: "preview-content text-[15px] text-black-950 dark:text-content leading-[1.5]",
|
|
416
416
|
innerHTML: a.value
|
|
417
|
-
}, null, 8,
|
|
417
|
+
}, null, 8, ue)) : (f(), b("p", de, x(a.value), 1))
|
|
418
418
|
]))), 128))
|
|
419
|
-
])) : (f(), b("p",
|
|
419
|
+
])) : (f(), b("p", ae, " There is no content to preview yet. "))
|
|
420
420
|
])
|
|
421
421
|
]));
|
|
422
422
|
}
|
|
423
|
-
},
|
|
423
|
+
}, ke = /* @__PURE__ */ H(fe, [["__scopeId", "data-v-6cebbfea"]]);
|
|
424
424
|
export {
|
|
425
|
-
|
|
426
|
-
|
|
425
|
+
ke as SopCompare,
|
|
426
|
+
pe as buildPreview,
|
|
427
427
|
w as hasContent,
|
|
428
|
-
|
|
428
|
+
X as htmlDiff
|
|
429
429
|
};
|