@wzh-/ai-chat-example 1.0.13 → 1.0.15

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.
Files changed (49) hide show
  1. package/dist/css/index.css +1 -1
  2. package/dist/js/_baseFor.js +309 -0
  3. package/dist/js/architecture-U656AL7Q.js +3 -4
  4. package/dist/js/architectureDiagram-VXUJARFQ.js +53 -54
  5. package/dist/js/blockDiagram-VD42YOAC.js +449 -449
  6. package/dist/js/c4Diagram-YG6GDRKO.js +87 -87
  7. package/dist/js/chunk-B4BG7PRW.js +160 -160
  8. package/dist/js/chunk-DI55MBZ5.js +98 -98
  9. package/dist/js/chunk-FPAJGGOC.js +1373 -197
  10. package/dist/js/chunk-JA3XYJ7Z.js +36 -36
  11. package/dist/js/chunk-JZLCHNYA.js +1461 -1461
  12. package/dist/js/chunk-N4CR4FBY.js +5 -5
  13. package/dist/js/chunk-QXUST7PY.js +226 -226
  14. package/dist/js/chunk-S3R3BYOJ.js +602 -454
  15. package/dist/js/classDiagram-2ON5EDUG.js +2 -2
  16. package/dist/js/classDiagram-v2-WZHVMYZB.js +2 -2
  17. package/dist/js/clone.js +1 -1
  18. package/dist/js/dagre-6UL2VRFP.js +152 -152
  19. package/dist/js/dagre.js +1034 -933
  20. package/dist/js/diagram-PSM6KHXK.js +58 -59
  21. package/dist/js/diagram-QEK2KX5R.js +53 -54
  22. package/dist/js/diagram-S2PKOQOG.js +24 -25
  23. package/dist/js/erDiagram-Q2GNP2WA.js +96 -96
  24. package/dist/js/flatten.js +34 -0
  25. package/dist/js/flowDiagram-NV44I4VS.js +166 -166
  26. package/dist/js/ganttDiagram-JELNMOA3.js +916 -916
  27. package/dist/js/gitGraph-F6HP7TQM.js +3 -4
  28. package/dist/js/gitGraphDiagram-NY62KEGX.js +373 -374
  29. package/dist/js/graphlib.js +264 -143
  30. package/dist/js/index.js +3280 -3266
  31. package/dist/js/info-NVLQJR56.js +3 -4
  32. package/dist/js/infoDiagram-WHAUD3N6.js +3 -4
  33. package/dist/js/isEmpty.js +18 -18
  34. package/dist/js/kanban-definition-3W4ZIXB7.js +2 -2
  35. package/dist/js/line.js +7 -7
  36. package/dist/js/mermaid.core.js +65 -65
  37. package/dist/js/mindmap-definition-VGOIOE7T.js +2 -2
  38. package/dist/js/packet-BFZMPI3H.js +3 -4
  39. package/dist/js/pie-7BOR55EZ.js +3 -4
  40. package/dist/js/pieDiagram-ADFJNKIX.js +39 -40
  41. package/dist/js/radar-NHE76QYJ.js +3 -4
  42. package/dist/js/reduce.js +451 -0
  43. package/dist/js/requirementDiagram-UZGBJVZJ.js +16 -16
  44. package/dist/js/sequenceDiagram-WL72ISMW.js +731 -731
  45. package/dist/js/stateDiagram-FKZM4ZOC.js +83 -83
  46. package/dist/js/stateDiagram-v2-4FDKWEC3.js +2 -2
  47. package/dist/js/treemap-KMMF4GRG.js +3 -4
  48. package/dist/js/xychartDiagram-PRI3JC2R.js +25 -25
  49. package/package.json +14 -7
@@ -1,7 +1,7 @@
1
1
  import { t as k } from "./marked.esm.js";
2
- import { a as decodeEntities } from "./chunk-S3R3BYOJ.js";
3
2
  import { g as log, h as __name, p as select_default } from "./src.js";
4
3
  import { I as sanitizeText, N as renderKatexSanitized, O as hasKatex, s as common_default, y as getConfig } from "./chunk-ABZYJK2D.js";
4
+ import { a as decodeEntities } from "./chunk-S3R3BYOJ.js";
5
5
  var defaultIconDimensions = Object.freeze({
6
6
  left: 0,
7
7
  top: 0,
@@ -231,16 +231,16 @@ var unknownIcon = {
231
231
  height: 80,
232
232
  width: 80
233
233
  }, iconsStore = /* @__PURE__ */ new Map(), loaderStore = /* @__PURE__ */ new Map(), registerIconPacks = /* @__PURE__ */ __name((l) => {
234
- for (let R of l) {
235
- if (!R.name) throw Error("Invalid icon loader. Must have a \"name\" property with non-empty string value.");
236
- if (log.debug("Registering icon pack:", R.name), "loader" in R) loaderStore.set(R.name, R.loader);
237
- else if ("icons" in R) iconsStore.set(R.name, R.icons);
238
- else throw log.error("Invalid icon loader:", R), Error("Invalid icon loader. Must have either \"icons\" or \"loader\" property.");
234
+ for (let z of l) {
235
+ if (!z.name) throw Error("Invalid icon loader. Must have a \"name\" property with non-empty string value.");
236
+ if (log.debug("Registering icon pack:", z.name), "loader" in z) loaderStore.set(z.name, z.loader);
237
+ else if ("icons" in z) iconsStore.set(z.name, z.icons);
238
+ else throw log.error("Invalid icon loader:", z), Error("Invalid icon loader. Must have either \"icons\" or \"loader\" property.");
239
239
  }
240
- }, "registerIconPacks"), getRegisteredIconData = /* @__PURE__ */ __name(async (l, R) => {
241
- let B = stringToIcon(l, !0, R !== void 0);
240
+ }, "registerIconPacks"), getRegisteredIconData = /* @__PURE__ */ __name(async (l, z) => {
241
+ let B = stringToIcon(l, !0, z !== void 0);
242
242
  if (!B) throw Error(`Invalid icon name: ${l}`);
243
- let V = B.prefix || R;
243
+ let V = B.prefix || z;
244
244
  if (!V) throw Error(`Icon name must contain a prefix: ${l}`);
245
245
  let H = iconsStore.get(V);
246
246
  if (!H) {
@@ -264,14 +264,14 @@ var unknownIcon = {
264
264
  } catch {
265
265
  return !1;
266
266
  }
267
- }, "isIconAvailable"), getIconSVG = /* @__PURE__ */ __name(async (l, R, B) => {
268
- let V;
267
+ }, "isIconAvailable"), getIconSVG = /* @__PURE__ */ __name(async (l, z, B) => {
268
+ let H;
269
269
  try {
270
- V = await getRegisteredIconData(l, R?.fallbackPrefix);
270
+ H = await getRegisteredIconData(l, z?.fallbackPrefix);
271
271
  } catch (l) {
272
- log.error(l), V = unknownIcon;
272
+ log.error(l), H = unknownIcon;
273
273
  }
274
- let U = iconToSVG(V, R);
274
+ let U = iconToSVG(H, z);
275
275
  return sanitizeText(iconToHTML(replaceIDs(U.body), {
276
276
  ...U.attributes,
277
277
  ...B
@@ -282,8 +282,8 @@ function preprocessMarkdown(l, { markdownAutoWrap: R }) {
282
282
  return R === !1 ? z.replace(/ /g, " ") : z;
283
283
  }
284
284
  __name(preprocessMarkdown, "preprocessMarkdown");
285
- function markdownToLines(R, z = {}) {
286
- let V = preprocessMarkdown(R, z), H = k.lexer(V), U = [[]], W = 0;
285
+ function markdownToLines(R, B = {}) {
286
+ let V = preprocessMarkdown(R, B), H = k.lexer(V), U = [[]], W = 0;
287
287
  function G(l, R = "normal") {
288
288
  l.type === "text" ? l.text.split("\n").forEach((l, z) => {
289
289
  z !== 0 && (W++, U.push([])), l.split(" ").forEach((l) => {
@@ -312,8 +312,8 @@ function markdownToLines(R, z = {}) {
312
312
  }), U;
313
313
  }
314
314
  __name(markdownToLines, "markdownToLines");
315
- function markdownToHTML(R, { markdownAutoWrap: V } = {}) {
316
- let H = k.lexer(R);
315
+ function markdownToHTML(B, { markdownAutoWrap: V } = {}) {
316
+ let H = k.lexer(B);
317
317
  function U(l) {
318
318
  return l.type === "text" ? V === !1 ? l.text.replace(/\n */g, "<br/>").replace(/ /g, "&nbsp;") : l.text.replace(/\n */g, "<br/>") : l.type === "strong" ? `<strong>${l.tokens?.map(U).join("")}</strong>` : l.type === "em" ? `<em>${l.tokens?.map(U).join("")}</em>` : l.type === "paragraph" ? `<p>${l.tokens?.map(U).join("")}</p>` : l.type === "space" ? "" : l.type === "html" ? `${l.text}` : l.type === "escape" ? l.text : (log.warn(`Unsupported markdown: ${l.type}`), l.raw);
319
319
  }
@@ -378,11 +378,11 @@ function applyStyle(l, R) {
378
378
  R && l.attr("style", R);
379
379
  }
380
380
  __name(applyStyle, "applyStyle");
381
- async function addHtmlSpan(l, R, z, B, V = !1, q = getConfig()) {
381
+ async function addHtmlSpan(l, R, z, B, K = !1, q = getConfig()) {
382
382
  let J = l.append("foreignObject");
383
383
  J.attr("width", `${10 * z}px`), J.attr("height", `${10 * z}px`);
384
384
  let Y = J.append("xhtml:div"), X = hasKatex(R.label) ? await renderKatexSanitized(R.label.replace(common_default.lineBreakRegex, "\n"), q) : sanitizeText(R.label, q), Z = R.isNode ? "nodeLabel" : "edgeLabel", Q = Y.append("span");
385
- Q.html(X), applyStyle(Q, R.labelStyle), Q.attr("class", `${Z} ${B}`), applyStyle(Y, R.labelStyle), Y.style("display", "table-cell"), Y.style("white-space", "nowrap"), Y.style("line-height", "1.5"), Y.style("max-width", z + "px"), Y.style("text-align", "center"), Y.attr("xmlns", "http://www.w3.org/1999/xhtml"), V && Y.attr("class", "labelBkg");
385
+ Q.html(X), applyStyle(Q, R.labelStyle), Q.attr("class", `${Z} ${B}`), applyStyle(Y, R.labelStyle), Y.style("display", "table-cell"), Y.style("white-space", "nowrap"), Y.style("line-height", "1.5"), Y.style("max-width", z + "px"), Y.style("text-align", "center"), Y.attr("xmlns", "http://www.w3.org/1999/xhtml"), K && Y.attr("class", "labelBkg");
386
386
  let $ = Y.node().getBoundingClientRect();
387
387
  return $.width === z && (Y.style("display", "table"), Y.style("white-space", "break-spaces"), Y.style("width", z + "px"), $ = Y.node().getBoundingClientRect()), J.node();
388
388
  }
@@ -408,10 +408,10 @@ function computeDimensionOfText(l, R, z) {
408
408
  return H && B.remove(), H;
409
409
  }
410
410
  __name(computeDimensionOfText, "computeDimensionOfText");
411
- function createFormattedText(l, R, z, V = !1) {
411
+ function createFormattedText(l, R, B, V = !1) {
412
412
  let H = 1.1, U = R.append("g"), W = U.insert("rect").attr("class", "background").attr("style", "stroke: none"), G = U.append("text").attr("y", "-10.1"), K = 0;
413
- for (let R of z) {
414
- let z = /* @__PURE__ */ __name((R) => computeWidthOfText(U, H, R) <= l, "checkWidth"), V = z(R) ? [R] : splitLineToFitWidth(R, z);
413
+ for (let R of B) {
414
+ let B = /* @__PURE__ */ __name((R) => computeWidthOfText(U, H, R) <= l, "checkWidth"), V = B(R) ? [R] : splitLineToFitWidth(R, B);
415
415
  for (let l of V) updateTextContentAndStyles(createTspan(G, K, H), l), K++;
416
416
  }
417
417
  if (V) {
@@ -429,32 +429,32 @@ function updateTextContentAndStyles(l, R) {
429
429
  __name(updateTextContentAndStyles, "updateTextContentAndStyles");
430
430
  async function replaceIconSubstring(l, R = {}) {
431
431
  let z = [];
432
- l.replace(/(fa[bklrs]?):fa-([\w-]+)/g, (l, B, V) => (z.push((async () => {
433
- let z = `${B}:${V}`;
432
+ l.replace(/(fa[bklrs]?):fa-([\w-]+)/g, (l, B, H) => (z.push((async () => {
433
+ let z = `${B}:${H}`;
434
434
  return await isIconAvailable(z) ? await getIconSVG(z, void 0, { class: "label-icon" }) : `<i class='${sanitizeText(l, R).replace(":", " ")}'></i>`;
435
435
  })()), l));
436
436
  let B = await Promise.all(z);
437
437
  return l.replace(/(fa[bklrs]?):fa-([\w-]+)/g, () => B.shift() ?? "");
438
438
  }
439
439
  __name(replaceIconSubstring, "replaceIconSubstring");
440
- var createText = /* @__PURE__ */ __name(async (l, B = "", { style: H = "", isTitle: U = !1, classes: G = "", useHtmlLabels: K = !0, isNode: q = !0, width: J = 200, addSvgBackground: Y = !1 } = {}, X) => {
441
- if (log.debug("XYZ createText", B, H, U, G, K, q, "addSvgBackground: ", Y), K) {
442
- let z = await replaceIconSubstring(decodeEntities(markdownToHTML(B, X)), X), V = B.replace(/\\\\/g, "\\");
440
+ var createText = /* @__PURE__ */ __name(async (l, z = "", { style: V = "", isTitle: H = !1, classes: W = "", useHtmlLabels: G = !0, isNode: q = !0, width: J = 200, addSvgBackground: Y = !1 } = {}, X) => {
441
+ if (log.debug("XYZ createText", z, V, H, W, G, q, "addSvgBackground: ", Y), G) {
442
+ let R = await replaceIconSubstring(decodeEntities(markdownToHTML(z, X)), X), B = z.replace(/\\\\/g, "\\");
443
443
  return await addHtmlSpan(l, {
444
444
  isNode: q,
445
- label: hasKatex(B) ? V : z,
446
- labelStyle: H.replace("fill:", "color:")
447
- }, J, G, Y, X);
445
+ label: hasKatex(z) ? B : R,
446
+ labelStyle: V.replace("fill:", "color:")
447
+ }, J, W, Y, X);
448
448
  } else {
449
- let R = createFormattedText(J, l, markdownToLines(B.replace(/<br\s*\/?>/g, "<br/>").replace("<br>", "<br/>"), X), B ? Y : !1);
449
+ let R = createFormattedText(J, l, markdownToLines(z.replace(/<br\s*\/?>/g, "<br/>").replace("<br>", "<br/>"), X), z ? Y : !1);
450
450
  if (q) {
451
- /stroke:/.exec(H) && (H = H.replace("stroke:", "lineColor:"));
452
- let l = H.replace(/stroke:[^;]+;?/g, "").replace(/stroke-width:[^;]+;?/g, "").replace(/fill:[^;]+;?/g, "").replace(/color:/g, "fill:");
451
+ /stroke:/.exec(V) && (V = V.replace("stroke:", "lineColor:"));
452
+ let l = V.replace(/stroke:[^;]+;?/g, "").replace(/stroke-width:[^;]+;?/g, "").replace(/fill:[^;]+;?/g, "").replace(/color:/g, "fill:");
453
453
  select_default(R).attr("style", l);
454
454
  } else {
455
- let l = H.replace(/stroke:[^;]+;?/g, "").replace(/stroke-width:[^;]+;?/g, "").replace(/fill:[^;]+;?/g, "").replace(/background:/g, "fill:");
455
+ let l = V.replace(/stroke:[^;]+;?/g, "").replace(/stroke-width:[^;]+;?/g, "").replace(/fill:[^;]+;?/g, "").replace(/background:/g, "fill:");
456
456
  select_default(R).select("rect").attr("style", l.replace(/background:/g, "fill:"));
457
- let z = H.replace(/stroke:[^;]+;?/g, "").replace(/stroke-width:[^;]+;?/g, "").replace(/fill:[^;]+;?/g, "").replace(/color:/g, "fill:");
457
+ let z = V.replace(/stroke:[^;]+;?/g, "").replace(/stroke-width:[^;]+;?/g, "").replace(/fill:[^;]+;?/g, "").replace(/color:/g, "fill:");
458
458
  select_default(R).select("text").attr("style", z);
459
459
  }
460
460
  return R;