schematex 0.8.3 → 0.9.1
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/ai/ai-sdk.cjs +9 -9
- package/dist/ai/ai-sdk.d.cts +2 -2
- package/dist/ai/ai-sdk.d.ts +2 -2
- package/dist/ai/ai-sdk.js +4 -4
- package/dist/ai/index.cjs +55 -16
- package/dist/ai/index.cjs.map +1 -1
- package/dist/ai/index.d.cts +37 -2
- package/dist/ai/index.d.ts +37 -2
- package/dist/ai/index.js +47 -4
- package/dist/ai/index.js.map +1 -1
- package/dist/browser.cjs +10 -10
- package/dist/browser.js +4 -4
- package/dist/{chunk-FQ4JUNTE.cjs → chunk-2R4UXKCT.cjs} +1014 -333
- package/dist/chunk-2R4UXKCT.cjs.map +1 -0
- package/dist/{chunk-DR3DDDQY.cjs → chunk-47SGK5R6.cjs} +56 -6
- package/dist/chunk-47SGK5R6.cjs.map +1 -0
- package/dist/{chunk-T3GV7OVF.js → chunk-EBX4KCYW.js} +19 -2
- package/dist/chunk-EBX4KCYW.js.map +1 -0
- package/dist/{chunk-JIJWGHRN.cjs → chunk-FJVQGBPU.cjs} +19 -2
- package/dist/chunk-FJVQGBPU.cjs.map +1 -0
- package/dist/{chunk-HPEAE3JM.js → chunk-J34HDRFY.js} +56 -6
- package/dist/chunk-J34HDRFY.js.map +1 -0
- package/dist/{chunk-UGB42BGK.cjs → chunk-QYC6WZEM.cjs} +7 -7
- package/dist/{chunk-UGB42BGK.cjs.map → chunk-QYC6WZEM.cjs.map} +1 -1
- package/dist/{chunk-LM5X7ZNR.js → chunk-VOJGLBE5.js} +4 -4
- package/dist/{chunk-LM5X7ZNR.js.map → chunk-VOJGLBE5.js.map} +1 -1
- package/dist/{chunk-S7GR77NY.js → chunk-Z5ML4QYG.js} +1012 -331
- package/dist/chunk-Z5ML4QYG.js.map +1 -0
- package/dist/diagrams/circuit/index.cjs +8 -8
- package/dist/diagrams/circuit/index.js +1 -1
- package/dist/diagrams/flowchart/index.cjs +7 -7
- package/dist/diagrams/flowchart/index.d.cts +1 -1
- package/dist/diagrams/flowchart/index.d.ts +1 -1
- package/dist/diagrams/flowchart/index.js +1 -1
- package/dist/{index-B0YO7rx8.d.cts → index-BiXWjQht.d.cts} +10 -4
- package/dist/{index-u3KZBdas.d.ts → index-Cq8y1aaa.d.ts} +10 -4
- package/dist/index.cjs +40 -40
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +6 -6
- package/dist/react.cjs +4 -4
- package/dist/react.js +3 -3
- package/dist/{tools-bqQ92FwC.d.ts → tools-BbTuTWs_.d.ts} +1 -1
- package/dist/{tools-CjW8usJE.d.cts → tools-D5dkAqNy.d.cts} +1 -1
- package/package.json +1 -1
- package/dist/chunk-DR3DDDQY.cjs.map +0 -1
- package/dist/chunk-FQ4JUNTE.cjs.map +0 -1
- package/dist/chunk-HPEAE3JM.js.map +0 -1
- package/dist/chunk-JIJWGHRN.cjs.map +0 -1
- package/dist/chunk-S7GR77NY.js.map +0 -1
- package/dist/chunk-T3GV7OVF.js.map +0 -1
|
@@ -1080,12 +1080,18 @@ var FC_CONST = {
|
|
|
1080
1080
|
labelHPad: 16,
|
|
1081
1081
|
minNodeWidth: 72,
|
|
1082
1082
|
/**
|
|
1083
|
-
* Cap on per-line label width.
|
|
1084
|
-
*
|
|
1085
|
-
*
|
|
1086
|
-
* full-width chars) still fit without truncation or text overflow.
|
|
1083
|
+
* Cap on per-line label width. Labels wider than `wrapLabelWidth` are
|
|
1084
|
+
* auto-wrapped first (see `wrapLabel`), so this clamp only bites on
|
|
1085
|
+
* unbreakable single tokens that survive wrapping (URLs, ids).
|
|
1087
1086
|
*/
|
|
1088
1087
|
maxLabelWidth: 420,
|
|
1088
|
+
/**
|
|
1089
|
+
* Auto-wrap target: a single-line label measuring wider than this is
|
|
1090
|
+
* broken into multiple lines (preferring spaces, falling back to CJK
|
|
1091
|
+
* char boundaries). ≈38 Latin chars / ≈20 full-width chars per line —
|
|
1092
|
+
* keeps prose nodes near a readable 3:1 aspect instead of a 400px strip.
|
|
1093
|
+
*/
|
|
1094
|
+
wrapLabelWidth: 260,
|
|
1089
1095
|
crossingSweepIters: 24
|
|
1090
1096
|
};
|
|
1091
1097
|
var SHAPE_SLANT = {
|
|
@@ -1132,6 +1138,49 @@ function measureLabelWidth(label) {
|
|
|
1132
1138
|
}
|
|
1133
1139
|
return max;
|
|
1134
1140
|
}
|
|
1141
|
+
function wrapLabel(label) {
|
|
1142
|
+
const text2 = String(label);
|
|
1143
|
+
if (/<br\s*\/?>|\n/i.test(text2)) return label;
|
|
1144
|
+
if (/<\/?[bi]>/i.test(text2)) return label;
|
|
1145
|
+
if (measureLineWidth(text2) <= FC_CONST.wrapLabelWidth) return label;
|
|
1146
|
+
const maxW = FC_CONST.wrapLabelWidth;
|
|
1147
|
+
const lines = [];
|
|
1148
|
+
let line2 = "";
|
|
1149
|
+
let lineW = 0;
|
|
1150
|
+
let breakAt = -1;
|
|
1151
|
+
let breakIsSpace = false;
|
|
1152
|
+
for (const ch of text2) {
|
|
1153
|
+
const code = ch.codePointAt(0) ?? 0;
|
|
1154
|
+
const chW = isFullWidth(code) ? FC_CONST.cjkCharWidth : FC_CONST.charWidth;
|
|
1155
|
+
if (ch === " " && line2.length > 0) {
|
|
1156
|
+
breakAt = line2.length;
|
|
1157
|
+
breakIsSpace = true;
|
|
1158
|
+
}
|
|
1159
|
+
if (lineW + chW > maxW && line2.length > 0) {
|
|
1160
|
+
if (breakAt > 0) {
|
|
1161
|
+
const head = line2.slice(0, breakAt);
|
|
1162
|
+
const tail = line2.slice(breakIsSpace ? breakAt + 1 : breakAt);
|
|
1163
|
+
lines.push(head);
|
|
1164
|
+
line2 = tail;
|
|
1165
|
+
} else {
|
|
1166
|
+
lines.push(line2);
|
|
1167
|
+
line2 = "";
|
|
1168
|
+
}
|
|
1169
|
+
lineW = measureLineWidth(line2);
|
|
1170
|
+
breakAt = -1;
|
|
1171
|
+
breakIsSpace = false;
|
|
1172
|
+
if (ch === " " && line2.length === 0) continue;
|
|
1173
|
+
}
|
|
1174
|
+
line2 += ch;
|
|
1175
|
+
lineW += chW;
|
|
1176
|
+
if (isFullWidth(code)) {
|
|
1177
|
+
breakAt = line2.length;
|
|
1178
|
+
breakIsSpace = false;
|
|
1179
|
+
}
|
|
1180
|
+
}
|
|
1181
|
+
if (line2.length > 0) lines.push(line2);
|
|
1182
|
+
return lines.join("\n");
|
|
1183
|
+
}
|
|
1135
1184
|
function greedyFAS(nodeIds, edges) {
|
|
1136
1185
|
const outAdj = /* @__PURE__ */ new Map();
|
|
1137
1186
|
const inAdj = /* @__PURE__ */ new Map();
|
|
@@ -1672,6 +1721,7 @@ function hasOverlappingTopLevelClusters(ast, layerMap, sgParent) {
|
|
|
1672
1721
|
function layoutFlowchart(ast) {
|
|
1673
1722
|
const dir = ast.direction;
|
|
1674
1723
|
const isHorizontalDir = dir === "LR" || dir === "RL";
|
|
1724
|
+
for (const n of ast.nodes) n.label = wrapLabel(n.label);
|
|
1675
1725
|
const sizeOf = (n) => {
|
|
1676
1726
|
const rawTextW = measureLabelWidth(n.label);
|
|
1677
1727
|
const labelW = Math.min(
|
|
@@ -2541,5 +2591,5 @@ var flowchart = {
|
|
|
2541
2591
|
};
|
|
2542
2592
|
|
|
2543
2593
|
export { FC_CONST, flowchart, iconNames, layoutFlowchart, parseFlowchart, renderFlowchart, renderFlowchartAST, renderIcon };
|
|
2544
|
-
//# sourceMappingURL=chunk-
|
|
2545
|
-
//# sourceMappingURL=chunk-
|
|
2594
|
+
//# sourceMappingURL=chunk-J34HDRFY.js.map
|
|
2595
|
+
//# sourceMappingURL=chunk-J34HDRFY.js.map
|