@diagrammo/dgmo 0.64.1 → 0.66.0
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/LICENSE +1 -1
- package/dist/advanced.d.ts +6773 -0
- package/dist/advanced.js +71 -71
- package/dist/block.d.ts +159 -0
- package/dist/block.js +21 -16
- package/dist/chart-meta-CpicJ1kj.d.ts +239 -0
- package/dist/chart-meta.d.ts +3 -0
- package/dist/chart-meta.js +3 -3
- package/dist/{charts-d3-ZTXJWEHI.js → charts-d3-I6OE5K3B.js} +9 -9
- package/dist/{chunk-C6DMG2V6.js → chunk-27YPE7NO.js} +28 -12
- package/dist/{chunk-RBAW7VUG.js → chunk-2EPV7CLY.js} +5 -7
- package/dist/{chunk-SCJ7CAJF.js → chunk-3HOCNSPD.js} +2 -2
- package/dist/{chunk-VOJOARA6.js → chunk-3OT63FS4.js} +82 -77
- package/dist/{chunk-Z2ADWRSW.js → chunk-3PSPUYT5.js} +3 -3
- package/dist/{chunk-RBBJIHNL.js → chunk-4IE42ODL.js} +11 -11
- package/dist/{chunk-SMCUX42K.js → chunk-4TM7MWU4.js} +7 -6
- package/dist/{chunk-H3HFC3SQ.js → chunk-5GM6BZO7.js} +3 -3
- package/dist/{chunk-7T3A2UK3.js → chunk-5T7K6QND.js} +15 -16
- package/dist/{chunk-NKRCPBTJ.js → chunk-6BOPYGJC.js} +6 -6
- package/dist/{chunk-MHI6W6XS.js → chunk-6IUL6LER.js} +10 -7
- package/dist/{chunk-S5RWWISJ.js → chunk-7L53J53J.js} +4 -4
- package/dist/{chunk-WDJ4HAGO.js → chunk-A6CTYC7O.js} +2 -2
- package/dist/{chunk-CDMF7P5A.js → chunk-BBCKUAUR.js} +2 -2
- package/dist/{chunk-AA4M6F2P.js → chunk-BBY57XAA.js} +3 -3
- package/dist/{chunk-NKRVFQGO.js → chunk-BDI25HWH.js} +18 -6
- package/dist/{chunk-SVR3YFM3.js → chunk-C666LP3O.js} +20 -15
- package/dist/{chunk-KRTO7NRK.js → chunk-D2WHS23S.js} +2 -2
- package/dist/{chunk-LYTEVE2N.js → chunk-DBF4IM4U.js} +20 -15
- package/dist/{chunk-PCWPYOT4.js → chunk-ET4R3AU5.js} +4 -4
- package/dist/{chunk-2KOBOIB2.js → chunk-FBD5ASMB.js} +2 -2
- package/dist/{chunk-ES66QH6J.js → chunk-FG24NXKN.js} +2 -2
- package/dist/{chunk-3CIOJ5YJ.js → chunk-FJ57274M.js} +3 -1
- package/dist/{chunk-6BVIZW5N.js → chunk-FLFBY5GN.js} +14 -12
- package/dist/{chunk-XUN3MIO3.js → chunk-G64OVYUT.js} +2 -2
- package/dist/{chunk-RQL25P3U.js → chunk-G7QZF6T3.js} +9 -9
- package/dist/{chunk-IGIJZHB6.js → chunk-GC7CBX6C.js} +6 -6
- package/dist/{chunk-B6AONGTI.js → chunk-GDQN2TPX.js} +21 -14
- package/dist/{chunk-CZUSH6NI.js → chunk-GMLSYNFP.js} +10 -9
- package/dist/{chunk-R6HCNSP6.js → chunk-GOW5VO6M.js} +2 -2
- package/dist/{chunk-SPHC4RYF.js → chunk-GXOMKWQ5.js} +10 -9
- package/dist/{chunk-MQHOKBJ6.js → chunk-IJ4FUFTR.js} +5 -5
- package/dist/{chunk-V3UQSKWJ.js → chunk-IJSFEU4J.js} +9 -9
- package/dist/{chunk-LSFZDBAP.js → chunk-IKHV5IJB.js} +2 -2
- package/dist/{chunk-LMXAB4YM.js → chunk-IZ6RWMBM.js} +9 -9
- package/dist/{chunk-6VJCURWU.js → chunk-J2EXBAPZ.js} +4 -5
- package/dist/{chunk-IX6N5MCY.js → chunk-JCL4K7AK.js} +12 -11
- package/dist/{chunk-OBKM6GIJ.js → chunk-JTUDM7S4.js} +10 -10
- package/dist/{chunk-CVVICCSB.js → chunk-L65WI4HO.js} +4 -4
- package/dist/{chunk-67D4MN2H.js → chunk-LK6LTSLH.js} +2 -2
- package/dist/{chunk-KOHIF4LD.js → chunk-MBODBL7C.js} +6 -5
- package/dist/chunk-MTGGOCND.js +638 -0
- package/dist/{chunk-VJARCVMH.js → chunk-MU3CJPJF.js} +2 -2
- package/dist/{chunk-RKTIIU7Z.js → chunk-N6XI5VTA.js} +4 -4
- package/dist/{chunk-ODUT5WMC.js → chunk-NVOU7N6C.js} +2 -2
- package/dist/{chunk-DB2KQ5DN.js → chunk-O274UTXH.js} +5 -5
- package/dist/{chunk-T4QXHE34.js → chunk-OWUWLZJT.js} +13 -11
- package/dist/{chunk-LDVUPGWC.js → chunk-OWVDD5EC.js} +2 -2
- package/dist/{chunk-M4HYPDER.js → chunk-P5OCINCI.js} +8 -8
- package/dist/{chunk-YLK3JNWP.js → chunk-QNCXONBR.js} +2 -2
- package/dist/{chunk-I2ATN25N.js → chunk-R4XM44BW.js} +25 -16
- package/dist/{chunk-37EHGTQ2.js → chunk-R7S5542V.js} +4 -4
- package/dist/{chunk-DJCZWQ2A.js → chunk-RTTZIX34.js} +4 -4
- package/dist/{chunk-OMTBYLKN.js → chunk-TPKNA2U5.js} +9 -7
- package/dist/{chunk-DN5HEDE4.js → chunk-TT5B36WO.js} +16 -20
- package/dist/{chunk-SF3JAWMY.js → chunk-TWILCDUE.js} +3 -3
- package/dist/{chunk-NIZM3LAG.js → chunk-UINRIO77.js} +10 -10
- package/dist/{chunk-5H2LIQIH.js → chunk-UJXCDF4E.js} +4 -4
- package/dist/{chunk-Z5ID35YP.js → chunk-UTCPNJND.js} +2 -4
- package/dist/{chunk-U42ZEK7L.js → chunk-V4BYBIBU.js} +24 -15
- package/dist/{chunk-L4IN4OBB.js → chunk-VLI5SYXW.js} +7 -7
- package/dist/{chunk-43E26CDA.js → chunk-VS2M72PF.js} +4 -4
- package/dist/{chunk-KZ3PCDUJ.js → chunk-VV6HZQ5K.js} +2 -2
- package/dist/{chunk-Z5BTSBWW.js → chunk-WF2HDQPG.js} +4 -4
- package/dist/{chunk-JU2VMFYC.js → chunk-X26BF4T2.js} +2 -2
- package/dist/{chunk-TAJ2XFTT.js → chunk-XKMCL2YJ.js} +19 -16
- package/dist/{chunk-7GUYGQR4.js → chunk-XVEPB2UU.js} +4 -4
- package/dist/{chunk-YHTKDIF2.js → chunk-YGFNITPC.js} +11 -11
- package/dist/{chunk-I24O2RWT.js → chunk-YJOOIOSR.js} +84 -14
- package/dist/{chunk-KPX2OWZR.js → chunk-YKWHUPBP.js} +13 -14
- package/dist/{chunk-FRC4LDTQ.js → chunk-YMYPFX4O.js} +36 -30
- package/dist/cloud-reference.d.ts +96 -0
- package/dist/completion-registry.d.ts +129 -0
- package/dist/d3-Bfhj-XBX.d.ts +496 -0
- package/dist/{dgmo-router-QWRF7ZKM.js → dgmo-router-464FE256.js} +4 -4
- package/dist/dgmo-router-EAW7XiBE.d.ts +280 -0
- package/dist/{dimensions-ES6O2T4H.js → dimensions-RD3Y7FCF.js} +7 -7
- package/dist/{flowchart-renderer-EXMRHFTQ.js → flowchart-renderer-6JKM2FA4.js} +7 -7
- package/dist/index.d.ts +210 -0
- package/dist/index.js +15 -15
- package/dist/{layout-HBWT2G23.js → layout-4LNMXLVK.js} +3 -3
- package/dist/{layout-UU4VJTOP.js → layout-62ERBWCM.js} +3 -3
- package/dist/{layout-N6X46MWG.js → layout-6SKHNQYO.js} +4 -4
- package/dist/{layout-OH4VQ3OI.js → layout-7JULRP4Y.js} +4 -4
- package/dist/{layout-QTZO6CW5.js → layout-FA37VP7V.js} +4 -4
- package/dist/layout-IN53LAE6.js +9 -0
- package/dist/{layout-H4H4OFE4.js → layout-IO6ORC5T.js} +3 -3
- package/dist/{layout-54P3DAXY.js → layout-LVMWK4QY.js} +5 -5
- package/dist/{layout-WCOEZPOI.js → layout-MNOTDWXW.js} +4 -4
- package/dist/{layout-2T2VCCTM.js → layout-RD7GDM4I.js} +5 -5
- package/dist/{layout-SKQMIXTG.js → layout-SBQTN2YM.js} +4 -4
- package/dist/{layout-5E2NQZNM.js → layout-SGYR6HBX.js} +3 -3
- package/dist/{layout-W3ZBJOIK.js → layout-WIMQIHBU.js} +5 -5
- package/dist/{layout-search-AJ6VUVUI.js → layout-search-C44CJQOB.js} +5 -5
- package/dist/{legend-constants-QQU3QYBF.js → legend-constants-RGINV5SF.js} +3 -3
- package/dist/live-link-resolve.d.ts +73 -0
- package/dist/{parser-KSIYWKYF.js → parser-CSKF2KNO.js} +8 -4
- package/dist/{parser-2BGDJJ2L.js → parser-WLL63XH7.js} +2 -2
- package/dist/{renderer-XLEYPLVL.js → renderer-2UIQVKXK.js} +8 -8
- package/dist/{renderer-KOWVTTYR.js → renderer-3GG2DEFQ.js} +7 -7
- package/dist/{renderer-XLPNUOYA.js → renderer-6NDYVZXQ.js} +10 -10
- package/dist/{renderer-2ARNFXSC.js → renderer-6ST44AVP.js} +10 -10
- package/dist/{renderer-YLM4CGBG.js → renderer-ALP46W2X.js} +8 -8
- package/dist/{renderer-HLWEJQJW.js → renderer-BEVY3UP5.js} +5 -5
- package/dist/{renderer-H6AQ4UIR.js → renderer-BXPWSNTJ.js} +13 -13
- package/dist/{renderer-BYWLJDT4.js → renderer-EWTETTII.js} +8 -8
- package/dist/{renderer-KK2534AF.js → renderer-FHXAWDNI.js} +4 -4
- package/dist/{renderer-OB77AT7V.js → renderer-FI4IKF4I.js} +7 -7
- package/dist/{renderer-DMVUBKP7.js → renderer-GHYH6DLG.js} +4 -4
- package/dist/{renderer-LSBXYOID.js → renderer-GYYJ4APT.js} +10 -10
- package/dist/{renderer-M43ROWET.js → renderer-JFOHE3YB.js} +9 -9
- package/dist/{renderer-OA7FSZ4A.js → renderer-L5QGQTLV.js} +3 -3
- package/dist/{renderer-7OOC2ZO2.js → renderer-L7S6YVM6.js} +4 -4
- package/dist/{renderer-YELZR4QT.js → renderer-LCHVBTV4.js} +12 -12
- package/dist/{renderer-IN3UPTZS.js → renderer-M4DAYNWC.js} +3 -3
- package/dist/{renderer-WN47AMUM.js → renderer-NXIK3LOA.js} +8 -8
- package/dist/{renderer-QR5343AR.js → renderer-OWUXQDHM.js} +3 -3
- package/dist/{renderer-FCO42JLK.js → renderer-PJNJOCLB.js} +8 -8
- package/dist/{renderer-OYTERGAO.js → renderer-QQBUBD66.js} +9 -9
- package/dist/{renderer-PM7JPC3J.js → renderer-REFE3YFH.js} +11 -11
- package/dist/{renderer-C6KOE774.js → renderer-RL2JGVPC.js} +10 -10
- package/dist/{renderer-ZNTLBQ45.js → renderer-RVFPPKWN.js} +9 -9
- package/dist/{renderer-QEHUJHRK.js → renderer-SFQHFPC5.js} +10 -10
- package/dist/{renderer-LO4FXQHP.js → renderer-T4CMBGA5.js} +8 -8
- package/dist/{renderer-NHFRVCDC.js → renderer-T66477EQ.js} +9 -9
- package/dist/{renderer-M3PQKXK2.js → renderer-TJD6A3AK.js} +13 -13
- package/dist/{renderer-2E7LQC32.js → renderer-URPIVAPI.js} +3 -3
- package/dist/{renderer-T5CUGSXP.js → renderer-WENGQEX6.js} +7 -7
- package/dist/{renderer-WR3FA3FF.js → renderer-WR6J7NKH.js} +8 -8
- package/dist/{renderer-YBEZ5V2H.js → renderer-X3V2G4UL.js} +3 -3
- package/dist/{renderer-KPEQ72FY.js → renderer-YAW4VHAI.js} +11 -11
- package/dist/{renderer-radial-XWAKJACV.js → renderer-radial-HOUGPUPW.js} +7 -7
- package/dist/{state-renderer-LIESKSBO.js → state-renderer-JJSQJZEL.js} +11 -11
- package/dist/tag-groups-NUA2F1I5.d.ts +263 -0
- package/dist/themes-Dem5xalq.d.ts +139 -0
- package/docs/ai-integration.md +1 -1
- package/docs/language-reference.md +5 -0
- package/gallery/fixtures/er.dgmo +1 -1
- package/package.json +5 -3
- package/dist/chunk-4ASYQ347.js +0 -185
- package/dist/layout-5XGYNYVT.js +0 -9
package/dist/chunk-4ASYQ347.js
DELETED
|
@@ -1,185 +0,0 @@
|
|
|
1
|
-
// src/utils/text-measure.ts
|
|
2
|
-
var CHAR_W = {
|
|
3
|
-
" ": 0.28,
|
|
4
|
-
"!": 0.28,
|
|
5
|
-
'"': 0.36,
|
|
6
|
-
"#": 0.56,
|
|
7
|
-
"$": 0.56,
|
|
8
|
-
"%": 0.89,
|
|
9
|
-
"&": 0.67,
|
|
10
|
-
"'": 0.19,
|
|
11
|
-
"(": 0.33,
|
|
12
|
-
")": 0.33,
|
|
13
|
-
"*": 0.39,
|
|
14
|
-
"+": 0.58,
|
|
15
|
-
",": 0.28,
|
|
16
|
-
"-": 0.33,
|
|
17
|
-
".": 0.28,
|
|
18
|
-
"/": 0.28,
|
|
19
|
-
"0": 0.56,
|
|
20
|
-
"1": 0.56,
|
|
21
|
-
"2": 0.56,
|
|
22
|
-
"3": 0.56,
|
|
23
|
-
"4": 0.56,
|
|
24
|
-
"5": 0.56,
|
|
25
|
-
"6": 0.56,
|
|
26
|
-
"7": 0.56,
|
|
27
|
-
"8": 0.56,
|
|
28
|
-
"9": 0.56,
|
|
29
|
-
":": 0.28,
|
|
30
|
-
";": 0.28,
|
|
31
|
-
"<": 0.58,
|
|
32
|
-
"=": 0.58,
|
|
33
|
-
">": 0.58,
|
|
34
|
-
"?": 0.56,
|
|
35
|
-
"@": 1.02,
|
|
36
|
-
A: 0.67,
|
|
37
|
-
B: 0.67,
|
|
38
|
-
C: 0.72,
|
|
39
|
-
D: 0.72,
|
|
40
|
-
E: 0.67,
|
|
41
|
-
F: 0.61,
|
|
42
|
-
G: 0.78,
|
|
43
|
-
H: 0.72,
|
|
44
|
-
I: 0.28,
|
|
45
|
-
J: 0.5,
|
|
46
|
-
K: 0.67,
|
|
47
|
-
L: 0.56,
|
|
48
|
-
M: 0.83,
|
|
49
|
-
N: 0.72,
|
|
50
|
-
O: 0.78,
|
|
51
|
-
P: 0.67,
|
|
52
|
-
Q: 0.78,
|
|
53
|
-
R: 0.72,
|
|
54
|
-
S: 0.67,
|
|
55
|
-
T: 0.61,
|
|
56
|
-
U: 0.72,
|
|
57
|
-
V: 0.67,
|
|
58
|
-
W: 0.94,
|
|
59
|
-
X: 0.67,
|
|
60
|
-
Y: 0.67,
|
|
61
|
-
Z: 0.61,
|
|
62
|
-
a: 0.56,
|
|
63
|
-
b: 0.56,
|
|
64
|
-
c: 0.5,
|
|
65
|
-
d: 0.56,
|
|
66
|
-
e: 0.56,
|
|
67
|
-
f: 0.28,
|
|
68
|
-
g: 0.56,
|
|
69
|
-
h: 0.56,
|
|
70
|
-
i: 0.22,
|
|
71
|
-
j: 0.22,
|
|
72
|
-
k: 0.5,
|
|
73
|
-
l: 0.22,
|
|
74
|
-
m: 0.83,
|
|
75
|
-
n: 0.56,
|
|
76
|
-
o: 0.56,
|
|
77
|
-
p: 0.56,
|
|
78
|
-
q: 0.56,
|
|
79
|
-
r: 0.33,
|
|
80
|
-
s: 0.5,
|
|
81
|
-
t: 0.28,
|
|
82
|
-
u: 0.56,
|
|
83
|
-
v: 0.5,
|
|
84
|
-
w: 0.72,
|
|
85
|
-
x: 0.5,
|
|
86
|
-
y: 0.5,
|
|
87
|
-
z: 0.5
|
|
88
|
-
};
|
|
89
|
-
var DEFAULT_W = 0.56;
|
|
90
|
-
var CHAR_WIDTH_RATIO = DEFAULT_W;
|
|
91
|
-
var MEASURE_CACHE = /* @__PURE__ */ new Map();
|
|
92
|
-
var MEASURE_CACHE_MAX = 1e4;
|
|
93
|
-
function extendWidth(acc, text, fontSize) {
|
|
94
|
-
let w = acc;
|
|
95
|
-
for (let i = 0; i < text.length; i++) {
|
|
96
|
-
w += (CHAR_W[text.charAt(i)] ?? DEFAULT_W) * fontSize;
|
|
97
|
-
}
|
|
98
|
-
return w;
|
|
99
|
-
}
|
|
100
|
-
function measureText(text, fontSize) {
|
|
101
|
-
const key = `${fontSize}|${text}`;
|
|
102
|
-
const cached = MEASURE_CACHE.get(key);
|
|
103
|
-
if (cached !== void 0) return cached;
|
|
104
|
-
const w = extendWidth(0, text, fontSize);
|
|
105
|
-
if (MEASURE_CACHE.size >= MEASURE_CACHE_MAX) MEASURE_CACHE.clear();
|
|
106
|
-
MEASURE_CACHE.set(key, w);
|
|
107
|
-
return w;
|
|
108
|
-
}
|
|
109
|
-
function truncateText(text, fontSize, maxWidth) {
|
|
110
|
-
if (measureText(text, fontSize) <= maxWidth) return text;
|
|
111
|
-
const ellipsis = "\u2026";
|
|
112
|
-
const ellipsisW = measureText(ellipsis, fontSize);
|
|
113
|
-
if (ellipsisW > maxWidth) return "";
|
|
114
|
-
const prefix = [0];
|
|
115
|
-
for (let i = 0; i < text.length; i++) {
|
|
116
|
-
prefix.push(extendWidth(prefix[i], text.charAt(i), fontSize));
|
|
117
|
-
}
|
|
118
|
-
let lo = 0;
|
|
119
|
-
let hi = text.length;
|
|
120
|
-
while (lo < hi) {
|
|
121
|
-
const mid = Math.ceil((lo + hi) / 2);
|
|
122
|
-
if (prefix[mid] + ellipsisW <= maxWidth) {
|
|
123
|
-
lo = mid;
|
|
124
|
-
} else {
|
|
125
|
-
hi = mid - 1;
|
|
126
|
-
}
|
|
127
|
-
}
|
|
128
|
-
return lo === 0 ? ellipsis : text.slice(0, lo) + ellipsis;
|
|
129
|
-
}
|
|
130
|
-
function wrapTextToWidth(text, fontSize, maxWidth, opts) {
|
|
131
|
-
const words = text.split(/\s+/).filter((w) => w.length > 0);
|
|
132
|
-
if (words.length === 0) return [""];
|
|
133
|
-
const hardBreak = opts?.hardBreak ?? false;
|
|
134
|
-
const spaceW = (CHAR_W[" "] ?? DEFAULT_W) * fontSize;
|
|
135
|
-
const lines = [];
|
|
136
|
-
let current = "";
|
|
137
|
-
let currentW = 0;
|
|
138
|
-
const pushWord = (word) => {
|
|
139
|
-
const testW = extendWidth(current ? currentW + spaceW : 0, word, fontSize);
|
|
140
|
-
if (testW <= maxWidth || !current) {
|
|
141
|
-
current = current ? `${current} ${word}` : word;
|
|
142
|
-
currentW = testW;
|
|
143
|
-
} else {
|
|
144
|
-
lines.push(current);
|
|
145
|
-
current = word;
|
|
146
|
-
currentW = extendWidth(0, word, fontSize);
|
|
147
|
-
}
|
|
148
|
-
};
|
|
149
|
-
for (const word of words) {
|
|
150
|
-
if (hardBreak && measureText(word, fontSize) > maxWidth) {
|
|
151
|
-
if (current) {
|
|
152
|
-
lines.push(current);
|
|
153
|
-
current = "";
|
|
154
|
-
currentW = 0;
|
|
155
|
-
}
|
|
156
|
-
let chunk = "";
|
|
157
|
-
let chunkW = 0;
|
|
158
|
-
for (const ch of word) {
|
|
159
|
-
const candW = extendWidth(chunkW, ch, fontSize);
|
|
160
|
-
if (chunk && candW > maxWidth) {
|
|
161
|
-
lines.push(chunk);
|
|
162
|
-
chunk = ch;
|
|
163
|
-
chunkW = extendWidth(0, ch, fontSize);
|
|
164
|
-
} else {
|
|
165
|
-
chunk += ch;
|
|
166
|
-
chunkW = candW;
|
|
167
|
-
}
|
|
168
|
-
}
|
|
169
|
-
current = chunk;
|
|
170
|
-
currentW = chunkW;
|
|
171
|
-
continue;
|
|
172
|
-
}
|
|
173
|
-
pushWord(word);
|
|
174
|
-
}
|
|
175
|
-
if (current) lines.push(current);
|
|
176
|
-
return lines.length > 0 ? lines : [""];
|
|
177
|
-
}
|
|
178
|
-
|
|
179
|
-
export {
|
|
180
|
-
CHAR_WIDTH_RATIO,
|
|
181
|
-
measureText,
|
|
182
|
-
truncateText,
|
|
183
|
-
wrapTextToWidth
|
|
184
|
-
};
|
|
185
|
-
//# sourceMappingURL=chunk-4ASYQ347.js.map
|