@zealsolutions/zeal-ui 1.0.0-alpha.374 → 1.0.0-alpha.375

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