@diagrammo/dgmo 0.48.2 → 0.50.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/.cursorrules +12 -3
- package/.github/copilot-instructions.md +12 -3
- package/.windsurfrules +12 -3
- package/SKILL.md +12 -3
- package/dist/advanced.d.ts +851 -1
- package/dist/advanced.js +601 -177
- package/dist/auto.css +63 -0
- package/dist/auto.js +220 -110
- package/dist/auto.mjs +45920 -33167
- package/dist/block.css +63 -0
- package/dist/block.d.ts +13 -5
- package/dist/block.js +239 -62
- package/dist/{charts-d3-QOZHKTCT.js → charts-d3-DKUD7MQE.js} +9 -8
- package/dist/{chunk-3MQQNXPD.js → chunk-2C56LEML.js} +3 -3
- package/dist/{chunk-L66GEFB6.js → chunk-2JJ2KNPI.js} +4 -4
- package/dist/{chunk-6SM5NJQH.js → chunk-2QYTMIRR.js} +4 -4
- package/dist/{chunk-RJE5JTVK.js → chunk-3G6TMNVF.js} +7 -7
- package/dist/{chunk-MO5YHHMQ.js → chunk-3LKM6FMW.js} +2 -2
- package/dist/{chunk-76OWZ3BA.js → chunk-3P2DKJCG.js} +2 -2
- package/dist/chunk-3TDRHT4J.js +1043 -0
- package/dist/chunk-3XPUDB7B.js +420 -0
- package/dist/{chunk-2LACINWN.js → chunk-3ZPC476N.js} +7 -7
- package/dist/{chunk-G2H74XJZ.js → chunk-4BMJQFNK.js} +8 -8
- package/dist/{chunk-THXCFRTU.js → chunk-4S723I74.js} +9 -9
- package/dist/{chunk-6NYWYNBI.js → chunk-4XK3FLFB.js} +3 -3
- package/dist/chunk-5JSWBPZZ.js +607 -0
- package/dist/{chunk-WCT3NYCV.js → chunk-5LWQH6QV.js} +1 -1
- package/dist/{chunk-7DTWEFUE.js → chunk-5Z736BSU.js} +8 -8
- package/dist/{chunk-ERLBPDGU.js → chunk-6BFZKBGD.js} +2 -2
- package/dist/{chunk-6HO5ZTXK.js → chunk-6IAA2QQ2.js} +2 -2
- package/dist/{chunk-H6PI3KJT.js → chunk-6IUAK7RZ.js} +2 -2
- package/dist/{chunk-RTLBSQ3G.js → chunk-6M5PJFQG.js} +3 -3
- package/dist/{chunk-Z5CGSFJB.js → chunk-6X4AKWLF.js} +4 -4
- package/dist/{chunk-OJR3MQYV.js → chunk-6ZT4U37Q.js} +291 -52
- package/dist/{chunk-5QXL4NYS.js → chunk-7G2ER4CY.js} +10 -5
- package/dist/chunk-7PQYTZMA.js +681 -0
- package/dist/{chunk-OURHMODR.js → chunk-7RB5Q6MB.js} +11 -11
- package/dist/{chunk-YAA6IID3.js → chunk-7UEMZREK.js} +2 -2
- package/dist/{chunk-AN2MOO5T.js → chunk-A3WQVFBS.js} +3 -3
- package/dist/{chunk-VOKGH627.js → chunk-AHGF2YYA.js} +13 -3
- package/dist/{chunk-CI2G3OEB.js → chunk-ASS5YYIZ.js} +12 -12
- package/dist/{chunk-TYS6CSS5.js → chunk-BCYVE3N5.js} +2 -2
- package/dist/chunk-BDXC7MDK.js +2395 -0
- package/dist/chunk-BTUTZMPT.js +482 -0
- package/dist/{chunk-YGJTDXVR.js → chunk-C4GQDB5L.js} +2 -2
- package/dist/{chunk-Y2ZE3MSG.js → chunk-C63UWAKM.js} +2 -2
- package/dist/{chunk-725LDASD.js → chunk-CLD2OKV7.js} +2 -2
- package/dist/{chunk-WBRZJOEC.js → chunk-CMCR5WBW.js} +3 -3
- package/dist/{chunk-IZMRON6C.js → chunk-CVV36CWI.js} +2 -2
- package/dist/chunk-DMJJ3CEQ.js +254 -0
- package/dist/{chunk-MZSBFAPJ.js → chunk-EJTKV7CY.js} +9 -9
- package/dist/{chunk-FITOLXSX.js → chunk-EOFPYPAU.js} +26 -2
- package/dist/{chunk-X5LCYCL5.js → chunk-ER5SCQWQ.js} +5 -5
- package/dist/{chunk-4OHACBGX.js → chunk-F2L5GCQ4.js} +2 -2
- package/dist/{chunk-FCIIHT24.js → chunk-F5UDBSJY.js} +7 -7
- package/dist/{chunk-3JLKYGBQ.js → chunk-F7BFXWNQ.js} +2 -2
- package/dist/{chunk-FANX6UJR.js → chunk-FAL7NOK3.js} +11 -11
- package/dist/{chunk-BUPDIHML.js → chunk-FB2WHOEQ.js} +4 -4
- package/dist/chunk-FL4IOQ37.js +379 -0
- package/dist/{chunk-LIOHW36Z.js → chunk-GBE54KY6.js} +6 -5
- package/dist/{chunk-RUNNI6VE.js → chunk-GL5UZ6NY.js} +3 -3
- package/dist/{chunk-4GRI7MEB.js → chunk-GPWHQ5FJ.js} +6 -6
- package/dist/chunk-GROQGHCT.js +960 -0
- package/dist/{chunk-SGZYXELT.js → chunk-H73FP42Q.js} +9 -6
- package/dist/{chunk-PBAHEPLQ.js → chunk-HGN652MU.js} +7 -6
- package/dist/{chunk-3SMGIJDD.js → chunk-HHXOONLX.js} +13 -1
- package/dist/{chunk-QOOUC2J5.js → chunk-HQCHYB5F.js} +2 -2
- package/dist/{chunk-AELOBFW5.js → chunk-I4IFRCUB.js} +3 -3
- package/dist/{chunk-GMR5MFHJ.js → chunk-I7F2A35O.js} +2 -2
- package/dist/{chunk-T2OE3YQB.js → chunk-IA3FJYWR.js} +3 -3
- package/dist/chunk-IAEC4KLA.js +492 -0
- package/dist/chunk-IVKC4GID.js +32 -0
- package/dist/{chunk-HSH73DP6.js → chunk-JFYIP7XU.js} +139 -39
- package/dist/{chunk-CKNVO24D.js → chunk-JZNMXEIV.js} +2 -2
- package/dist/chunk-KJXIHOVL.js +940 -0
- package/dist/chunk-L2ZTFHAY.js +331 -0
- package/dist/{chunk-B7JUCQUA.js → chunk-M5RXSRO2.js} +4 -4
- package/dist/{chunk-ULOEATBZ.js → chunk-NFFIKVNO.js} +106 -29
- package/dist/{chunk-PZMETGLY.js → chunk-NISQC5KW.js} +358 -122
- package/dist/chunk-O4VUFXIH.js +574 -0
- package/dist/{chunk-RVMRZAPB.js → chunk-O76UD6VJ.js} +3 -3
- package/dist/{chunk-JM4LEPY3.js → chunk-O7NUCTFU.js} +2 -2
- package/dist/{chunk-JED6ZDEE.js → chunk-O7WP4ZD4.js} +2 -2
- package/dist/{chunk-EVCVDTXE.js → chunk-OHQEMBLI.js} +3 -3
- package/dist/{chunk-ZBWMSD5N.js → chunk-ONA5KPV3.js} +4 -4
- package/dist/{chunk-Y3J7VR52.js → chunk-OTAL43EH.js} +34 -2
- package/dist/{chunk-WCSOJFU3.js → chunk-OTP5KVLO.js} +3 -3
- package/dist/{chunk-RYEGFMUO.js → chunk-PGEGPSCZ.js} +2 -2
- package/dist/{chunk-ZO27FGJS.js → chunk-PH5X4GIP.js} +2 -2
- package/dist/{chunk-ZJEL4H2R.js → chunk-PJUGRJHJ.js} +9 -9
- package/dist/{chunk-ZGR7ULFJ.js → chunk-PLZI6KPM.js} +26 -14
- package/dist/{chunk-3R5POCTZ.js → chunk-PMN3Q7RJ.js} +6 -6
- package/dist/{chunk-YGJZWZTY.js → chunk-PZFVK3IH.js} +2 -2
- package/dist/chunk-Q4V4XQWV.js +158 -0
- package/dist/chunk-QDFNCATJ.js +325 -0
- package/dist/{chunk-QEBUY5NY.js → chunk-QFQ35BTO.js} +4 -4
- package/dist/chunk-QQJUTGQH.js +135 -0
- package/dist/{chunk-PWIHZ6NJ.js → chunk-QUJGFNFN.js} +4 -4
- package/dist/{chunk-J5FIXQRT.js → chunk-R56LASIN.js} +4 -4
- package/dist/{chunk-SRTU6HMQ.js → chunk-RV26LTUU.js} +8 -8
- package/dist/chunk-RV6A2B5S.js +354 -0
- package/dist/{chunk-EB6FPQUP.js → chunk-S5GRONXL.js} +3 -3
- package/dist/{chunk-5MLYVTYM.js → chunk-SCHXJTZL.js} +2 -2
- package/dist/{chunk-T3UBLACL.js → chunk-SCQ5VPUF.js} +19 -5
- package/dist/{chunk-PBHE5UG6.js → chunk-SGFZZAUO.js} +46 -12
- package/dist/{chunk-BUVJFRPY.js → chunk-SU2VBK4L.js} +4 -4
- package/dist/{chunk-SML67VPV.js → chunk-T4BRO3Z6.js} +3 -3
- package/dist/{chunk-NURGB5Z4.js → chunk-TSA237IM.js} +2 -2
- package/dist/chunk-TWCLK2GA.js +273 -0
- package/dist/{chunk-IJZFN3HM.js → chunk-TWQUYVP3.js} +4 -4
- package/dist/{chunk-DKEPS5LH.js → chunk-U2HGPLZS.js} +36 -2
- package/dist/{chunk-B65G5DNL.js → chunk-URSQLCTR.js} +3 -3
- package/dist/{chunk-ILKORZ3H.js → chunk-UUS2GIJZ.js} +7 -7
- package/dist/{chunk-XAKEUMEJ.js → chunk-UXOSVCLJ.js} +4 -4
- package/dist/{chunk-QLCCJEJI.js → chunk-WCUHAQKB.js} +2 -2
- package/dist/{chunk-WVAJFAIA.js → chunk-WWN566I7.js} +257 -101
- package/dist/{chunk-IPWPWM6R.js → chunk-X2NMFTG3.js} +111 -10
- package/dist/{chunk-UWN33VNX.js → chunk-XCLHOZAM.js} +10 -10
- package/dist/{chunk-P235SVAH.js → chunk-XDXNDSKO.js} +2 -2
- package/dist/chunk-XHVV4NVW.js +51 -0
- package/dist/{chunk-33LCUH4H.js → chunk-XMVQ5F4M.js} +4 -4
- package/dist/{chunk-MITI6NOL.js → chunk-YA7D2N2O.js} +11 -11
- package/dist/{chunk-7JEGTRLD.js → chunk-YB3FW24O.js} +3 -3
- package/dist/chunk-YNRDWYZP.js +295 -0
- package/dist/{chunk-44CM72SQ.js → chunk-YZLMKW4T.js} +3 -3
- package/dist/chunk-Z6XJQ6KO.js +452 -0
- package/dist/cli.cjs +179 -133
- package/dist/clock.d.ts +10 -0
- package/dist/clock.js +235 -0
- package/dist/countdown.d.ts +12 -0
- package/dist/countdown.js +450 -0
- package/dist/dgmo-router-QOMFCOOV.js +84 -0
- package/dist/dimensions-P5FSX2QN.js +22 -0
- package/dist/editor.js +43 -2
- package/dist/element.js +220 -110
- package/dist/element.mjs +45920 -33167
- package/dist/{flowchart-parser-ZNSKIBVR.js → flowchart-parser-OE4WHLTF.js} +4 -4
- package/dist/{flowchart-renderer-SNDSII4D.js → flowchart-renderer-GPCSMTOR.js} +8 -8
- package/dist/highlight.d.ts +17 -1
- package/dist/highlight.js +163 -6
- package/dist/index.d.ts +5 -1
- package/dist/index.js +199 -233
- package/dist/{layout-HRBZPFCN.js → layout-34CLNICW.js} +5 -5
- package/dist/layout-46366KBT.js +10 -0
- package/dist/{layout-HWDSRX5E.js → layout-5BG6DFCU.js} +6 -6
- package/dist/layout-6RDJHS6E.js +9 -0
- package/dist/{layout-7QXCNOVS.js → layout-7H4H46CS.js} +3 -3
- package/dist/{layout-46N4JJYK.js → layout-7SKMFYHL.js} +5 -5
- package/dist/{layout-EE6GE46Y.js → layout-DC4TVXER.js} +5 -5
- package/dist/layout-FGQWRYYW.js +14 -0
- package/dist/{layout-S2QBYSK2.js → layout-NXG63LWH.js} +3 -3
- package/dist/{layout-N76NR4ZO.js → layout-PUQCB6AN.js} +7 -7
- package/dist/{layout-HYZPWAK5.js → layout-QNUQLEHU.js} +3 -3
- package/dist/{layout-UM5F4DJB.js → layout-T3OZU5QW.js} +5 -5
- package/dist/layout-TJIWF7EM.js +14 -0
- package/dist/layout-VYELEAW7.js +14 -0
- package/dist/{layout-5RA6QWR6.js → layout-WZHNDT2O.js} +6 -6
- package/dist/{layout-search-OYV77HHS.js → layout-search-QS44PI5R.js} +6 -6
- package/dist/{parser-6BTRLKRZ.js → parser-45DENHFZ.js} +4 -4
- package/dist/{parser-TFZFBVWN.js → parser-4AI5ZN5F.js} +3 -3
- package/dist/{parser-XDVELHRK.js → parser-4P36TUVD.js} +4 -4
- package/dist/{parser-ZSDPZYQP.js → parser-5AURY4A6.js} +4 -4
- package/dist/{parser-N5O4IHUN.js → parser-A2BEFMGK.js} +4 -4
- package/dist/parser-B5FVS7O6.js +11 -0
- package/dist/{parser-NGU3ETO6.js → parser-C2HF2C2E.js} +4 -4
- package/dist/parser-CSFUN3CT.js +14 -0
- package/dist/{parser-TRTHDFPP.js → parser-D3QT6GWN.js} +5 -5
- package/dist/parser-D5637H5H.js +15 -0
- package/dist/{parser-VQP2UJ6W.js → parser-DFFEDKHH.js} +3 -3
- package/dist/parser-DOKMZXVZ.js +13 -0
- package/dist/parser-FMPCVFRK.js +15 -0
- package/dist/{parser-Y6WTBU76.js → parser-HYRTF3DO.js} +3 -3
- package/dist/{parser-I6KXEYFK.js → parser-I2UIJKVQ.js} +4 -4
- package/dist/{parser-O5J4VBII.js → parser-IBWNAPY4.js} +3 -3
- package/dist/{parser-PQ3POX45.js → parser-KUQWRPIT.js} +4 -4
- package/dist/{parser-2MFP2H2E.js → parser-LWKKBNSA.js} +3 -3
- package/dist/{parser-OV7NOBW6.js → parser-O4QFCUW7.js} +5 -5
- package/dist/{parser-IXSZZQHY.js → parser-PGMQDD4G.js} +4 -4
- package/dist/{parser-3STE62GB.js → parser-Q4QKCIWQ.js} +4 -4
- package/dist/parser-QTOB4KFL.js +14 -0
- package/dist/{parser-2EWECDSA.js → parser-QYYM4QVW.js} +4 -4
- package/dist/{parser-4OGOBJJ4.js → parser-RZMQP7MM.js} +4 -4
- package/dist/parser-RZPVAQVX.js +11 -0
- package/dist/parser-SOUJOEYI.js +13 -0
- package/dist/{parser-4FL2CMDG.js → parser-UQE5OWZI.js} +5 -5
- package/dist/{parser-NRAI6O25.js → parser-WAV5JRPT.js} +4 -4
- package/dist/{parser-KNSQSKQO.js → parser-YLKYBRIT.js} +5 -5
- package/dist/{parser-XKRP7QKP.js → parser-YS7TOS2K.js} +3 -3
- package/dist/{parser-AQETEVRW.js → parser-ZSOWUBML.js} +5 -5
- package/dist/{parser-CFZD5IBL.js → parser-ZTBATMLX.js} +4 -4
- package/dist/{renderer-VACVQYML.js → renderer-35HSIDMZ.js} +8 -8
- package/dist/{renderer-5MYBMBYO.js → renderer-4ITCHBT7.js} +5 -5
- package/dist/{renderer-CLJHQPBJ.js → renderer-67NPCBIS.js} +11 -11
- package/dist/{renderer-5NDVNDAZ.js → renderer-6GHYK7DX.js} +9 -9
- package/dist/{renderer-Z7I3W2PP.js → renderer-6RNGHC5Z.js} +8 -8
- package/dist/renderer-72LGR2YF.js +14 -0
- package/dist/{renderer-KQB7UGDS.js → renderer-7RH2SI3B.js} +3 -3
- package/dist/renderer-7SWMIFMM.js +21 -0
- package/dist/renderer-BBCEFILK.js +24 -0
- package/dist/{renderer-JGBKUCZD.js → renderer-BSW7SRIZ.js} +4 -4
- package/dist/{renderer-BYCNMBF7.js → renderer-BY533UWU.js} +11 -11
- package/dist/{renderer-6W5462RB.js → renderer-BZSBPTZJ.js} +9 -9
- package/dist/{renderer-7MVLWWQD.js → renderer-CXUC4KAD.js} +9 -9
- package/dist/{renderer-QIWVHWZO.js → renderer-DAXMXIKD.js} +3 -3
- package/dist/renderer-FZUKFUNZ.js +23 -0
- package/dist/renderer-G2NLGNKF.js +17 -0
- package/dist/renderer-GO3FE3RA.js +24 -0
- package/dist/{renderer-ZGNTUWC4.js → renderer-HPGR6USK.js} +8 -8
- package/dist/{renderer-UV6MI64M.js → renderer-HVCU2C3Z.js} +3 -3
- package/dist/renderer-ICJN2SA2.js +24 -0
- package/dist/{renderer-AWWAF6XD.js → renderer-INEXO7B6.js} +10 -10
- package/dist/{renderer-YY2OSF6E.js → renderer-KDYCFRBX.js} +8 -8
- package/dist/renderer-KY4KQBTF.js +19 -0
- package/dist/{renderer-B2OMQIQG.js → renderer-LBN65V45.js} +13 -13
- package/dist/{renderer-N43WR5GV.js → renderer-MGBWOCXG.js} +10 -10
- package/dist/{renderer-PGX2TKVS.js → renderer-O4JKUGKO.js} +8 -8
- package/dist/{renderer-4JHRUBE6.js → renderer-OOGFODWP.js} +10 -10
- package/dist/{renderer-6EEZHMH4.js → renderer-Q6ZKPLS6.js} +9 -9
- package/dist/{renderer-RPOA5YPZ.js → renderer-SZQ326M5.js} +12 -12
- package/dist/{renderer-ZRNG54CW.js → renderer-TKG6LS4U.js} +11 -11
- package/dist/{renderer-W4M6QLIJ.js → renderer-TQMZGDAX.js} +13 -13
- package/dist/renderer-radial-JELMHQ24.js +21 -0
- package/dist/{resolver-NOAA7ID7.js → resolver-FHBCO3PL.js} +3 -3
- package/dist/{state-parser-Z2V23ATR.js → state-parser-3REXRK3R.js} +4 -4
- package/dist/{state-renderer-B4DQBM6M.js → state-renderer-XYLNRWXR.js} +8 -8
- package/docs/ai-integration.md +12 -3
- package/docs/language-reference.md +429 -24
- package/gallery/fixtures/body.dgmo +17 -0
- package/gallery/fixtures/bracket.dgmo +30 -0
- package/gallery/fixtures/clock.dgmo +8 -0
- package/gallery/fixtures/countdown.dgmo +3 -0
- package/gallery/fixtures/family.dgmo +23 -0
- package/gallery/fixtures/goal.dgmo +4 -0
- package/gallery/fixtures/sketch.dgmo +22 -0
- package/package.json +12 -4
- package/dist/chunk-ODZVHU3R.js +0 -153
- package/dist/dgmo-router-X35VLZLM.js +0 -73
- package/dist/dimensions-J3FHIMJ6.js +0 -22
- package/dist/layout-5T6RH5M6.js +0 -14
- package/dist/layout-G23F7LDH.js +0 -9
- package/dist/layout-OB3RI63S.js +0 -14
- package/dist/parser-JAL2HD4I.js +0 -13
- package/dist/renderer-SMIBCRVB.js +0 -24
- package/dist/renderer-radial-C32GPJQ7.js +0 -21
|
@@ -0,0 +1,379 @@
|
|
|
1
|
+
import {
|
|
2
|
+
preprocessDescriptionLine
|
|
3
|
+
} from "./chunk-IYULMRBE.js";
|
|
4
|
+
import {
|
|
5
|
+
AUTO_TAG_COLOR_SENTINEL,
|
|
6
|
+
finalizeAutoTagColors,
|
|
7
|
+
matchTagBlockHeading,
|
|
8
|
+
resolveActiveTagGroup,
|
|
9
|
+
stripDefaultModifier,
|
|
10
|
+
tagAttrKey
|
|
11
|
+
} from "./chunk-WCUHAQKB.js";
|
|
12
|
+
import {
|
|
13
|
+
extractColor,
|
|
14
|
+
measureIndent,
|
|
15
|
+
parseFirstLine,
|
|
16
|
+
splitNameAndMeta
|
|
17
|
+
} from "./chunk-OTAL43EH.js";
|
|
18
|
+
import {
|
|
19
|
+
makeDgmoError,
|
|
20
|
+
makeFail
|
|
21
|
+
} from "./chunk-CXK4DZH3.js";
|
|
22
|
+
|
|
23
|
+
// src/bracket/parser.ts
|
|
24
|
+
var BEATS_RE = /^(.+?)\s+beats\s+(.+)$/i;
|
|
25
|
+
var VS_RE = /^(.+?)\s+vs\s+(.+)$/i;
|
|
26
|
+
var SCORE_RE = /\s+(\d+\s*[-–]\s*\d+)$/;
|
|
27
|
+
var HOME_RE = /\s+@\s+(.+)$/;
|
|
28
|
+
var SEED_RE = /^seed\s+(\d+)\s+(.+)$/i;
|
|
29
|
+
var MODE_FLAGS = /* @__PURE__ */ new Set(["single-elim", "double-elim", "seeded"]);
|
|
30
|
+
function splitMatch(body) {
|
|
31
|
+
let rest = body;
|
|
32
|
+
let home = null;
|
|
33
|
+
const hm = rest.match(HOME_RE);
|
|
34
|
+
if (hm) {
|
|
35
|
+
home = hm[1].trim();
|
|
36
|
+
rest = rest.slice(0, hm.index).trimEnd();
|
|
37
|
+
}
|
|
38
|
+
let score = null;
|
|
39
|
+
const sm = rest.match(SCORE_RE);
|
|
40
|
+
if (sm) {
|
|
41
|
+
score = sm[1].replace(/\s+/g, "");
|
|
42
|
+
rest = rest.slice(0, sm.index).trimEnd();
|
|
43
|
+
}
|
|
44
|
+
const m = rest.match(BEATS_RE);
|
|
45
|
+
if (m) return { left: m[1].trim(), right: m[2].trim(), score, home };
|
|
46
|
+
return null;
|
|
47
|
+
}
|
|
48
|
+
function parseBracket(content, palette) {
|
|
49
|
+
const result = {
|
|
50
|
+
type: "bracket",
|
|
51
|
+
title: null,
|
|
52
|
+
titleLineNumber: null,
|
|
53
|
+
mode: "single-elim",
|
|
54
|
+
seeded: false,
|
|
55
|
+
roundNames: [],
|
|
56
|
+
sides: [],
|
|
57
|
+
matches: [],
|
|
58
|
+
seeds: [],
|
|
59
|
+
tagGroups: [],
|
|
60
|
+
competitorMeta: /* @__PURE__ */ new Map(),
|
|
61
|
+
activeTag: null,
|
|
62
|
+
noLegend: false,
|
|
63
|
+
noRounds: false,
|
|
64
|
+
diagnostics: [],
|
|
65
|
+
error: null
|
|
66
|
+
};
|
|
67
|
+
const matches = [];
|
|
68
|
+
const seeds = [];
|
|
69
|
+
const sides = [];
|
|
70
|
+
const sideSeen = /* @__PURE__ */ new Set();
|
|
71
|
+
const tagGroups = [];
|
|
72
|
+
const metaAliasMap = /* @__PURE__ */ new Map();
|
|
73
|
+
const competitorMeta = /* @__PURE__ */ new Map();
|
|
74
|
+
const fail = makeFail(result);
|
|
75
|
+
const warn = (line, message) => {
|
|
76
|
+
result.diagnostics.push(makeDgmoError(line, message, "warning"));
|
|
77
|
+
};
|
|
78
|
+
const softError = (line, message) => {
|
|
79
|
+
result.diagnostics.push(makeDgmoError(line, message, "error"));
|
|
80
|
+
};
|
|
81
|
+
if (!content?.trim()) return fail(0, "No content provided");
|
|
82
|
+
const registry = () => ({
|
|
83
|
+
keys: /* @__PURE__ */ new Set(),
|
|
84
|
+
tagAliases: new Set(metaAliasMap.keys())
|
|
85
|
+
});
|
|
86
|
+
const takeMeta = (rest, lineNum) => {
|
|
87
|
+
const split = splitNameAndMeta(
|
|
88
|
+
rest,
|
|
89
|
+
registry(),
|
|
90
|
+
metaAliasMap,
|
|
91
|
+
palette,
|
|
92
|
+
result.diagnostics,
|
|
93
|
+
lineNum
|
|
94
|
+
);
|
|
95
|
+
if (Object.keys(split.meta).length > 0) {
|
|
96
|
+
const prev = competitorMeta.get(split.name) ?? {};
|
|
97
|
+
competitorMeta.set(split.name, { ...prev, ...split.meta });
|
|
98
|
+
}
|
|
99
|
+
return split.name;
|
|
100
|
+
};
|
|
101
|
+
const lines = content.split("\n");
|
|
102
|
+
let headerParsed = false;
|
|
103
|
+
let currentSide = null;
|
|
104
|
+
let currentTagGroup = null;
|
|
105
|
+
let commentaryTarget = null;
|
|
106
|
+
let commentaryIndent = 0;
|
|
107
|
+
let inRoundsBlock = false;
|
|
108
|
+
const roundDefs = [];
|
|
109
|
+
for (let i = 0; i < lines.length; i++) {
|
|
110
|
+
const lineNum = i + 1;
|
|
111
|
+
const raw = lines[i];
|
|
112
|
+
const trimmed = raw.trim();
|
|
113
|
+
if (!trimmed || trimmed.startsWith("//") || trimmed.startsWith("#")) {
|
|
114
|
+
currentTagGroup = null;
|
|
115
|
+
commentaryTarget = null;
|
|
116
|
+
inRoundsBlock = false;
|
|
117
|
+
continue;
|
|
118
|
+
}
|
|
119
|
+
if (!headerParsed) {
|
|
120
|
+
const first = parseFirstLine(trimmed);
|
|
121
|
+
if (first?.chartType !== "bracket") {
|
|
122
|
+
return fail(lineNum, 'Expected "bracket [Title]" as the first line.');
|
|
123
|
+
}
|
|
124
|
+
if (first.title) {
|
|
125
|
+
const { label } = extractColor(
|
|
126
|
+
first.title,
|
|
127
|
+
palette,
|
|
128
|
+
result.diagnostics,
|
|
129
|
+
lineNum
|
|
130
|
+
);
|
|
131
|
+
result.title = label || null;
|
|
132
|
+
}
|
|
133
|
+
result.titleLineNumber = lineNum;
|
|
134
|
+
headerParsed = true;
|
|
135
|
+
continue;
|
|
136
|
+
}
|
|
137
|
+
const indent = measureIndent(raw);
|
|
138
|
+
if (commentaryTarget && indent > commentaryIndent) {
|
|
139
|
+
commentaryTarget.commentary.push(preprocessDescriptionLine(trimmed));
|
|
140
|
+
continue;
|
|
141
|
+
}
|
|
142
|
+
commentaryTarget = null;
|
|
143
|
+
if (inRoundsBlock) {
|
|
144
|
+
if (indent > 0) {
|
|
145
|
+
const { label, color } = extractColor(
|
|
146
|
+
trimmed,
|
|
147
|
+
palette,
|
|
148
|
+
result.diagnostics,
|
|
149
|
+
lineNum
|
|
150
|
+
);
|
|
151
|
+
if (label)
|
|
152
|
+
roundDefs.push(
|
|
153
|
+
color !== void 0 ? { name: label, color } : { name: label }
|
|
154
|
+
);
|
|
155
|
+
continue;
|
|
156
|
+
}
|
|
157
|
+
inRoundsBlock = false;
|
|
158
|
+
}
|
|
159
|
+
const tagHead = matchTagBlockHeading(trimmed);
|
|
160
|
+
if (tagHead) {
|
|
161
|
+
currentTagGroup = {
|
|
162
|
+
name: tagHead.name,
|
|
163
|
+
...tagHead.alias !== void 0 && { alias: tagHead.alias },
|
|
164
|
+
entries: [],
|
|
165
|
+
lineNumber: lineNum
|
|
166
|
+
};
|
|
167
|
+
if (tagHead.alias) {
|
|
168
|
+
metaAliasMap.set(tagHead.alias.toLowerCase(), tagAttrKey(tagHead.name));
|
|
169
|
+
}
|
|
170
|
+
metaAliasMap.set(tagAttrKey(tagHead.name), tagAttrKey(tagHead.name));
|
|
171
|
+
tagGroups.push(currentTagGroup);
|
|
172
|
+
continue;
|
|
173
|
+
}
|
|
174
|
+
if (currentTagGroup && indent > 0) {
|
|
175
|
+
const { text: cleanEntry, isDefault } = stripDefaultModifier(trimmed);
|
|
176
|
+
const { label, color } = extractColor(
|
|
177
|
+
cleanEntry,
|
|
178
|
+
palette,
|
|
179
|
+
result.diagnostics,
|
|
180
|
+
lineNum
|
|
181
|
+
);
|
|
182
|
+
if (isDefault || currentTagGroup.entries.length === 0) {
|
|
183
|
+
currentTagGroup.defaultValue = label;
|
|
184
|
+
}
|
|
185
|
+
currentTagGroup.entries.push({
|
|
186
|
+
value: label,
|
|
187
|
+
color: color ?? AUTO_TAG_COLOR_SENTINEL,
|
|
188
|
+
lineNumber: lineNum
|
|
189
|
+
});
|
|
190
|
+
continue;
|
|
191
|
+
}
|
|
192
|
+
currentTagGroup = null;
|
|
193
|
+
if (indent === 0) currentSide = null;
|
|
194
|
+
const lower = trimmed.toLowerCase();
|
|
195
|
+
const roundsM = trimmed.match(/^rounds\b(.*)$/i);
|
|
196
|
+
if (roundsM) {
|
|
197
|
+
const rest = roundsM[1].trim();
|
|
198
|
+
if (rest) {
|
|
199
|
+
for (const name of rest.split(",").map((s) => s.trim()).filter(Boolean))
|
|
200
|
+
roundDefs.push({ name });
|
|
201
|
+
} else {
|
|
202
|
+
inRoundsBlock = true;
|
|
203
|
+
}
|
|
204
|
+
continue;
|
|
205
|
+
}
|
|
206
|
+
if (MODE_FLAGS.has(lower)) {
|
|
207
|
+
if (lower === "seeded") result.seeded = true;
|
|
208
|
+
else result.mode = lower;
|
|
209
|
+
continue;
|
|
210
|
+
}
|
|
211
|
+
if (lower === "no-legend") {
|
|
212
|
+
result.noLegend = true;
|
|
213
|
+
continue;
|
|
214
|
+
}
|
|
215
|
+
if (lower === "no-round" || lower === "no-rounds") {
|
|
216
|
+
result.noRounds = true;
|
|
217
|
+
continue;
|
|
218
|
+
}
|
|
219
|
+
const accentM = trimmed.match(/^accent\s+(.+)$/i);
|
|
220
|
+
if (accentM) {
|
|
221
|
+
const { color } = extractColor(
|
|
222
|
+
`x ${accentM[1].trim()}`,
|
|
223
|
+
palette,
|
|
224
|
+
result.diagnostics,
|
|
225
|
+
lineNum
|
|
226
|
+
);
|
|
227
|
+
if (color !== void 0) result.accentColor = color;
|
|
228
|
+
continue;
|
|
229
|
+
}
|
|
230
|
+
const sideM = trimmed.match(/^\[(.+?)\](.*)$/);
|
|
231
|
+
if (sideM) {
|
|
232
|
+
const label = sideM[1].trim();
|
|
233
|
+
if (MODE_FLAGS.has(label.toLowerCase())) {
|
|
234
|
+
const lk = label.toLowerCase();
|
|
235
|
+
if (lk === "seeded") result.seeded = true;
|
|
236
|
+
else result.mode = lk;
|
|
237
|
+
continue;
|
|
238
|
+
}
|
|
239
|
+
const { label: cleanLabel, color } = extractColor(
|
|
240
|
+
sideM[2].trim() ? `${label} ${sideM[2].trim()}` : label,
|
|
241
|
+
palette,
|
|
242
|
+
result.diagnostics,
|
|
243
|
+
lineNum
|
|
244
|
+
);
|
|
245
|
+
currentSide = cleanLabel;
|
|
246
|
+
if (!sideSeen.has(cleanLabel)) {
|
|
247
|
+
sideSeen.add(cleanLabel);
|
|
248
|
+
sides.push(
|
|
249
|
+
color !== void 0 ? { label: cleanLabel, color } : { label: cleanLabel }
|
|
250
|
+
);
|
|
251
|
+
}
|
|
252
|
+
continue;
|
|
253
|
+
}
|
|
254
|
+
const side = indent > 0 ? currentSide : null;
|
|
255
|
+
const seedM = trimmed.match(SEED_RE);
|
|
256
|
+
if (seedM) {
|
|
257
|
+
const n = parseInt(seedM[1], 10);
|
|
258
|
+
const name = takeMeta(seedM[2].trim(), lineNum);
|
|
259
|
+
result.seeded = true;
|
|
260
|
+
seeds.push({ seed: n, name, side, lineNumber: lineNum });
|
|
261
|
+
continue;
|
|
262
|
+
}
|
|
263
|
+
const decided = splitMatch(trimmed);
|
|
264
|
+
if (decided) {
|
|
265
|
+
if (decided.left === decided.right) {
|
|
266
|
+
softError(
|
|
267
|
+
lineNum,
|
|
268
|
+
`A match can't be "${decided.left}" against itself.`
|
|
269
|
+
);
|
|
270
|
+
continue;
|
|
271
|
+
}
|
|
272
|
+
if (decided.score) {
|
|
273
|
+
const parts = decided.score.split(/[-–]/).map((x) => parseInt(x, 10));
|
|
274
|
+
if (parts.length === 2 && parts[0] < parts[1]) {
|
|
275
|
+
warn(
|
|
276
|
+
lineNum,
|
|
277
|
+
`Score ${decided.score} shows "${decided.left}" losing, but they're on the winning side \u2014 keeping "${decided.left}" as the winner.`
|
|
278
|
+
);
|
|
279
|
+
}
|
|
280
|
+
}
|
|
281
|
+
const match = {
|
|
282
|
+
p1: decided.left,
|
|
283
|
+
p2: decided.right,
|
|
284
|
+
decided: true,
|
|
285
|
+
score: decided.score,
|
|
286
|
+
side,
|
|
287
|
+
home: decided.home,
|
|
288
|
+
commentary: [],
|
|
289
|
+
lineNumber: lineNum
|
|
290
|
+
};
|
|
291
|
+
matches.push(match);
|
|
292
|
+
commentaryTarget = match;
|
|
293
|
+
commentaryIndent = indent;
|
|
294
|
+
continue;
|
|
295
|
+
}
|
|
296
|
+
let vsBody = trimmed;
|
|
297
|
+
let vsHome = null;
|
|
298
|
+
const vhm = vsBody.match(HOME_RE);
|
|
299
|
+
if (vhm && VS_RE.test(vsBody.slice(0, vhm.index))) {
|
|
300
|
+
vsHome = vhm[1].trim();
|
|
301
|
+
vsBody = vsBody.slice(0, vhm.index).trimEnd();
|
|
302
|
+
}
|
|
303
|
+
const pending = vsBody.match(VS_RE);
|
|
304
|
+
if (pending) {
|
|
305
|
+
const a = pending[1].trim();
|
|
306
|
+
const b = pending[2].trim();
|
|
307
|
+
if (a === b) {
|
|
308
|
+
softError(lineNum, `A match can't be "${a}" against itself.`);
|
|
309
|
+
continue;
|
|
310
|
+
}
|
|
311
|
+
const match = {
|
|
312
|
+
p1: a,
|
|
313
|
+
p2: b,
|
|
314
|
+
decided: false,
|
|
315
|
+
score: null,
|
|
316
|
+
side,
|
|
317
|
+
home: vsHome,
|
|
318
|
+
commentary: [],
|
|
319
|
+
lineNumber: lineNum
|
|
320
|
+
};
|
|
321
|
+
matches.push(match);
|
|
322
|
+
commentaryTarget = match;
|
|
323
|
+
commentaryIndent = indent;
|
|
324
|
+
continue;
|
|
325
|
+
}
|
|
326
|
+
const rosterSplit = splitNameAndMeta(
|
|
327
|
+
trimmed,
|
|
328
|
+
registry(),
|
|
329
|
+
metaAliasMap,
|
|
330
|
+
palette,
|
|
331
|
+
result.diagnostics,
|
|
332
|
+
lineNum
|
|
333
|
+
);
|
|
334
|
+
if (Object.keys(rosterSplit.meta).length > 0) {
|
|
335
|
+
const prev = competitorMeta.get(rosterSplit.name) ?? {};
|
|
336
|
+
competitorMeta.set(rosterSplit.name, { ...prev, ...rosterSplit.meta });
|
|
337
|
+
continue;
|
|
338
|
+
}
|
|
339
|
+
warn(lineNum, `Unrecognized line "${trimmed}".`);
|
|
340
|
+
}
|
|
341
|
+
if (result.mode === "double-elim") {
|
|
342
|
+
warn(
|
|
343
|
+
result.titleLineNumber ?? 1,
|
|
344
|
+
"Double-elimination brackets are not yet supported \u2014 rendering the winners\u2019 side only."
|
|
345
|
+
);
|
|
346
|
+
}
|
|
347
|
+
const seedNames = /* @__PURE__ */ new Map();
|
|
348
|
+
for (const s of seeds) {
|
|
349
|
+
const prev = seedNames.get(s.name);
|
|
350
|
+
if (prev !== void 0) {
|
|
351
|
+
softError(
|
|
352
|
+
s.lineNumber,
|
|
353
|
+
`Duplicate competitor "${s.name}" (already seeded on line ${prev}). Rename one \u2014 names are identifiers.`
|
|
354
|
+
);
|
|
355
|
+
} else {
|
|
356
|
+
seedNames.set(s.name, s.lineNumber);
|
|
357
|
+
}
|
|
358
|
+
}
|
|
359
|
+
finalizeAutoTagColors(tagGroups, palette);
|
|
360
|
+
result.sides = sides;
|
|
361
|
+
result.matches = matches;
|
|
362
|
+
result.seeds = seeds;
|
|
363
|
+
result.roundNames = roundDefs;
|
|
364
|
+
result.tagGroups = tagGroups;
|
|
365
|
+
result.competitorMeta = competitorMeta;
|
|
366
|
+
result.activeTag = resolveActiveTagGroup(tagGroups, void 0);
|
|
367
|
+
if (!result.seeded && matches.length === 0) {
|
|
368
|
+
warn(
|
|
369
|
+
result.titleLineNumber ?? 1,
|
|
370
|
+
'No matches \u2014 add "A beats B" or "A vs B" lines.'
|
|
371
|
+
);
|
|
372
|
+
}
|
|
373
|
+
return result;
|
|
374
|
+
}
|
|
375
|
+
|
|
376
|
+
export {
|
|
377
|
+
parseBracket
|
|
378
|
+
};
|
|
379
|
+
//# sourceMappingURL=chunk-FL4IOQ37.js.map
|
|
@@ -3,7 +3,7 @@ import {
|
|
|
3
3
|
} from "./chunk-I46X5VUA.js";
|
|
4
4
|
import {
|
|
5
5
|
tryCollectNote
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-SCHXJTZL.js";
|
|
7
7
|
import {
|
|
8
8
|
resolveNotes
|
|
9
9
|
} from "./chunk-FMDSF3OV.js";
|
|
@@ -20,7 +20,7 @@ import {
|
|
|
20
20
|
measureIndent,
|
|
21
21
|
parseFirstLine,
|
|
22
22
|
tryParseSharedOption
|
|
23
|
-
} from "./chunk-
|
|
23
|
+
} from "./chunk-OTAL43EH.js";
|
|
24
24
|
import {
|
|
25
25
|
NAME_DIAGNOSTIC_CODES,
|
|
26
26
|
emit,
|
|
@@ -367,8 +367,9 @@ function parseFlowchart(content, palette) {
|
|
|
367
367
|
continue;
|
|
368
368
|
}
|
|
369
369
|
if (!contentStarted) {
|
|
370
|
-
|
|
371
|
-
|
|
370
|
+
const dirMatch = trimmed.match(/^direction[-\s]+(lr|tb)$/i);
|
|
371
|
+
if (dirMatch) {
|
|
372
|
+
result.direction = dirMatch[1].toUpperCase();
|
|
372
373
|
continue;
|
|
373
374
|
}
|
|
374
375
|
if (/^solid-fill$/i.test(trimmed)) {
|
|
@@ -466,4 +467,4 @@ export {
|
|
|
466
467
|
looksLikeFlowchart,
|
|
467
468
|
extractSymbols
|
|
468
469
|
};
|
|
469
|
-
//# sourceMappingURL=chunk-
|
|
470
|
+
//# sourceMappingURL=chunk-GBE54KY6.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
tryCollectNote
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-SCHXJTZL.js";
|
|
4
4
|
import {
|
|
5
5
|
resolveNotes
|
|
6
6
|
} from "./chunk-FMDSF3OV.js";
|
|
@@ -16,7 +16,7 @@ import {
|
|
|
16
16
|
measureIndent,
|
|
17
17
|
parseFirstLine,
|
|
18
18
|
tryParseSharedOption
|
|
19
|
-
} from "./chunk-
|
|
19
|
+
} from "./chunk-OTAL43EH.js";
|
|
20
20
|
import {
|
|
21
21
|
resolveColorWithDiagnostic
|
|
22
22
|
} from "./chunk-TLVIHFRO.js";
|
|
@@ -445,4 +445,4 @@ export {
|
|
|
445
445
|
looksLikeClassDiagram,
|
|
446
446
|
extractSymbols
|
|
447
447
|
};
|
|
448
|
-
//# sourceMappingURL=chunk-
|
|
448
|
+
//# sourceMappingURL=chunk-GL5UZ6NY.js.map
|
|
@@ -2,15 +2,15 @@ import {
|
|
|
2
2
|
parseInlineMarkdown,
|
|
3
3
|
safeHref
|
|
4
4
|
} from "./chunk-3HDBAXF5.js";
|
|
5
|
-
import {
|
|
6
|
-
renderIntegratedLegend
|
|
7
|
-
} from "./chunk-PWIHZ6NJ.js";
|
|
8
5
|
import {
|
|
9
6
|
ScaleContext
|
|
10
7
|
} from "./chunk-YYVTBZZC.js";
|
|
8
|
+
import {
|
|
9
|
+
renderIntegratedLegend
|
|
10
|
+
} from "./chunk-QUJGFNFN.js";
|
|
11
11
|
import {
|
|
12
12
|
getMaxLegendReservedHeight
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-7UEMZREK.js";
|
|
14
14
|
import {
|
|
15
15
|
FONT_FAMILY
|
|
16
16
|
} from "./chunk-6KFWC4CO.js";
|
|
@@ -18,7 +18,7 @@ import {
|
|
|
18
18
|
measureText,
|
|
19
19
|
truncateText,
|
|
20
20
|
wrapTextToWidth
|
|
21
|
-
} from "./chunk-
|
|
21
|
+
} from "./chunk-5LWQH6QV.js";
|
|
22
22
|
import {
|
|
23
23
|
contrastText,
|
|
24
24
|
mix,
|
|
@@ -1601,4 +1601,4 @@ export {
|
|
|
1601
1601
|
renderTechRadar,
|
|
1602
1602
|
renderTechRadarForExport
|
|
1603
1603
|
};
|
|
1604
|
-
//# sourceMappingURL=chunk-
|
|
1604
|
+
//# sourceMappingURL=chunk-GPWHQ5FJ.js.map
|