@diagrammo/dgmo 0.95.0 → 0.97.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/README.md +1 -1
- package/dist/advanced.d.ts +190 -568
- package/dist/advanced.js +259 -470
- package/dist/block.d.ts +8 -0
- package/dist/block.js +144 -73
- package/dist/{calculator-BNH3GSJE.js → calculator-CIGGTURF.js} +2 -2
- package/dist/{chart-meta-BbjsRY7o.d.ts → chart-meta-B7niEd52.d.ts} +3 -1
- package/dist/chart-meta.d.ts +2 -2
- package/dist/chart-meta.js +19 -19
- package/dist/{chart-types-Cppnp31G.d.ts → chart-types-Dxtv4XSz.d.ts} +4 -5
- package/dist/{charts-d3-SZV2SFTM.js → charts-d3-INWEGMSD.js} +14 -14
- package/dist/{chunk-P5XA627W.js → chunk-2FMOLWX4.js} +73 -65
- package/dist/{chunk-MLY5ALOV.js → chunk-2SZILMQT.js} +57 -15
- package/dist/chunk-35A3J4Z5.js +14 -0
- package/dist/{chunk-UXNA2H2V.js → chunk-3C4OXVZJ.js} +2 -2
- package/dist/{chunk-IZHGT5HD.js → chunk-3HL6NSSQ.js} +63 -18
- package/dist/{chunk-2WQ3YZMN.js → chunk-3IUMSK72.js} +2 -2
- package/dist/{chunk-LAXMUSGW.js → chunk-44RLIAYC.js} +17 -10
- package/dist/{chunk-H7AXCRO7.js → chunk-453IWXZ3.js} +0 -11
- package/dist/{chunk-2I4UQG7W.js → chunk-47INRTZ6.js} +2 -2
- package/dist/{chunk-IN7XI6NO.js → chunk-4NMRS6HW.js} +1 -1
- package/dist/{chunk-KLBTJEIK.js → chunk-4TK26YHH.js} +2 -2
- package/dist/{chunk-CN4RDJDV.js → chunk-5TGZBHEJ.js} +1 -1
- package/dist/{chunk-IXHWS2HI.js → chunk-5WZYJC2P.js} +2 -2
- package/dist/{chunk-KBDMEOLI.js → chunk-65JFUANT.js} +1 -1
- package/dist/{chunk-D3K4U3ZM.js → chunk-6K2W3FH7.js} +8 -5
- package/dist/{chunk-NXU4N5WT.js → chunk-6OUMYNAJ.js} +1 -1
- package/dist/{chunk-KRPLP5LP.js → chunk-6PUBFB6D.js} +24 -3
- package/dist/{chunk-EXHXTMVR.js → chunk-6S2H6EKN.js} +3 -3
- package/dist/{chunk-KSZB7TIY.js → chunk-6SDEXSJY.js} +42 -22
- package/dist/{chunk-IQN2NGEU.js → chunk-6YBZFOTA.js} +13 -13
- package/dist/{chunk-IHN6WDEY.js → chunk-74XR7Z3I.js} +13 -13
- package/dist/{chunk-2J2CWWWK.js → chunk-7ASVGFW3.js} +1 -1
- package/dist/{chunk-BH2SF4TT.js → chunk-7QKWU7FX.js} +3 -3
- package/dist/{chunk-A6YINTY6.js → chunk-7RACGVUY.js} +1 -1
- package/dist/{chunk-VB4VMB2I.js → chunk-7TEAFIEJ.js} +9 -5
- package/dist/{chunk-UNCCZ3NU.js → chunk-A3V72YIL.js} +14 -1
- package/dist/{chunk-BCV2VJTM.js → chunk-A5LFM62B.js} +3 -3
- package/dist/{chunk-U6VS3T2M.js → chunk-AULFF7L2.js} +4 -4
- package/dist/{chunk-LKZCUFOW.js → chunk-B7ZH5EQ2.js} +2 -2
- package/dist/{chunk-VGAMBOOC.js → chunk-C6ME2L4T.js} +2 -2
- package/dist/{chunk-3PP746YM.js → chunk-CGP7RGLJ.js} +1 -1
- package/dist/{chunk-67N26CER.js → chunk-CLW45YKE.js} +2 -1
- package/dist/{chunk-VTESGA5F.js → chunk-CUOMNKYW.js} +4 -4
- package/dist/{chunk-CDM6XMOT.js → chunk-CUTEHGXO.js} +2 -2
- package/dist/{chunk-NERQSSYD.js → chunk-D67YE4LR.js} +1 -1
- package/dist/{chunk-XOMIYMQ3.js → chunk-D7KZE2XJ.js} +39 -17
- package/dist/{chunk-NMS5XSLX.js → chunk-DFEVFLEG.js} +3 -3
- package/dist/{chunk-EBVVMUAA.js → chunk-DKMZ4VMV.js} +1 -1
- package/dist/{chunk-V5D6GDNK.js → chunk-DRY4W4W6.js} +36 -15
- package/dist/{chunk-XJQ6Z3FO.js → chunk-E6GHXMH2.js} +8 -8
- package/dist/{chunk-KBEWVCK3.js → chunk-EBJLT7PH.js} +1 -1
- package/dist/{chunk-TASRGDYP.js → chunk-EEIGHOJR.js} +92 -23
- package/dist/{chunk-AQQUJEDN.js → chunk-EUPUVYWO.js} +1 -1
- package/dist/{chunk-7IALGIOI.js → chunk-F2OAZHOX.js} +10 -5
- package/dist/{chunk-JXGSTBW6.js → chunk-FK6HZYGK.js} +4 -14
- package/dist/{chunk-OSSTOSXU.js → chunk-FTW2E2YH.js} +7 -10
- package/dist/{chunk-5P2L5QXE.js → chunk-FZVCS2XY.js} +4 -2
- package/dist/chunk-G24NSISJ.js +69 -0
- package/dist/{chunk-EBIDNRSR.js → chunk-GFQFLLP3.js} +2 -2
- package/dist/{chunk-RQTDUZUH.js → chunk-GLLYHYGT.js} +27 -17
- package/dist/{chunk-VLC6WNRD.js → chunk-GULGSH2Z.js} +4 -0
- package/dist/{chunk-H5NVCOEJ.js → chunk-GXBH7WNN.js} +2 -2
- package/dist/{chunk-C6G36F5S.js → chunk-H242TVAE.js} +9 -9
- package/dist/{chunk-5XBYLYYI.js → chunk-H7DZYHQF.js} +3 -3
- package/dist/{chunk-GLCMUTO5.js → chunk-HQNZJMNS.js} +1 -1
- package/dist/{chunk-IY62DXT2.js → chunk-IAM3IDL4.js} +2 -2
- package/dist/{chunk-IGJEKO2P.js → chunk-II6D6NWX.js} +8 -8
- package/dist/{chunk-AULZD45V.js → chunk-IUFTAFGN.js} +2 -2
- package/dist/{chunk-FWVE373X.js → chunk-IZEKHIV6.js} +3 -3
- package/dist/{chunk-BQMHJ6OW.js → chunk-J3YM6RA5.js} +22 -14
- package/dist/{chunk-R6EGUTIV.js → chunk-J467QBZF.js} +23 -3
- package/dist/{chunk-JJ7RGTAU.js → chunk-J7JF4QKA.js} +40 -30
- package/dist/{chunk-E7F76M3U.js → chunk-JULBDTNU.js} +61 -9
- package/dist/{chunk-EPDBWATV.js → chunk-K7RRXZHS.js} +4 -2
- package/dist/{chunk-ZECJ7Q6C.js → chunk-KMB754DO.js} +33 -6
- package/dist/chunk-KNKZGRRB.js +439 -0
- package/dist/{chunk-XIUGSUE4.js → chunk-KTGJQJB3.js} +6 -2
- package/dist/{chunk-4SACN2C5.js → chunk-KW3CC7SB.js} +1 -1
- package/dist/{chunk-3GUEYQGL.js → chunk-L3K5O3Z5.js} +3 -3
- package/dist/chunk-LRTSTDJ6.js +126 -0
- package/dist/{chunk-NBAAIRFP.js → chunk-LZATSXAA.js} +5 -2
- package/dist/{chunk-USE6HIOZ.js → chunk-MJ725XHD.js} +1156 -330
- package/dist/{chunk-3KVUFHUJ.js → chunk-NBISN6FH.js} +2 -2
- package/dist/{chunk-RITTLIDJ.js → chunk-NN5RUHXV.js} +84 -16
- package/dist/{chunk-62GLKE6Q.js → chunk-NOZMRPXI.js} +112 -157
- package/dist/{chunk-4XYZJTFO.js → chunk-NQFZ7LXC.js} +14 -6
- package/dist/chunk-NTDWVTEY.js +12 -0
- package/dist/{chunk-BQO24BDM.js → chunk-O3HRF25Z.js} +1 -1
- package/dist/{chunk-ZD3QCNB7.js → chunk-OSSA5UWA.js} +3 -3
- package/dist/{chunk-UOCWYLYT.js → chunk-OZXKW5NA.js} +1 -1
- package/dist/{chunk-NPDVWFAQ.js → chunk-PLQZJZ2K.js} +1 -1
- package/dist/chunk-PRG7NIUU.js +272 -0
- package/dist/{chunk-S4SJ4LLY.js → chunk-PSNRB75I.js} +3 -3
- package/dist/{chunk-QPQWY5RU.js → chunk-PT5VFY3B.js} +38 -14
- package/dist/{chunk-KAO7JL4I.js → chunk-PU5X3P3T.js} +6 -5
- package/dist/{chunk-J7Q4AB23.js → chunk-PZ5LAAO3.js} +2 -2
- package/dist/{chunk-TOHTKLKE.js → chunk-Q5Q5JLRT.js} +1 -1
- package/dist/{chunk-Y3SIQN4J.js → chunk-Q6V342WS.js} +17 -5
- package/dist/{chunk-RBVFNUAL.js → chunk-QDPTOIG7.js} +5 -5
- package/dist/{chunk-ERT7XDQW.js → chunk-QIITSGI5.js} +1 -1
- package/dist/{chunk-NM5V5EKY.js → chunk-QLIZ7SB7.js} +1 -1
- package/dist/chunk-QLNLRZ37.js +181 -0
- package/dist/{chunk-HHVIE45A.js → chunk-QOLRTPGH.js} +6 -6
- package/dist/{chunk-2ZW4NBYX.js → chunk-R4SXMBGF.js} +1 -1
- package/dist/chunk-R4U7IIRX.js +178 -0
- package/dist/{chunk-BRGRIZQB.js → chunk-RC6PISCK.js} +4 -2
- package/dist/{chunk-UIEKW4SG.js → chunk-REKLKGR6.js} +3 -4
- package/dist/{chunk-TIIZIAGS.js → chunk-RFGQDIOI.js} +843 -233
- package/dist/{chunk-FVTYJUXR.js → chunk-ROFSIFSY.js} +4 -4
- package/dist/{chunk-VSAKEMDD.js → chunk-ROH4LYBL.js} +71 -21
- package/dist/{chunk-4UVCTLRH.js → chunk-SNDCXT5R.js} +9 -7
- package/dist/{chunk-R46N5KR4.js → chunk-SQBCNEJB.js} +2 -1
- package/dist/{chunk-66JTY4AN.js → chunk-TDUBTDXS.js} +1 -1
- package/dist/{chunk-PGSGJLUR.js → chunk-TMB4YY3J.js} +34 -4
- package/dist/{chunk-UZ7EZW3B.js → chunk-TO53KK2P.js} +6 -1
- package/dist/{chunk-5KKZXA44.js → chunk-V3ICBS2O.js} +7 -5
- package/dist/{chunk-GWQRTA5W.js → chunk-V65EDV6S.js} +3 -3
- package/dist/{chunk-VF7IKIRS.js → chunk-VKT3BVRO.js} +35 -11
- package/dist/{chunk-L5S32VZJ.js → chunk-VOO65FKC.js} +12 -12
- package/dist/{chunk-PVWIBKV2.js → chunk-VQWLASDC.js} +2 -2
- package/dist/{chunk-JILEYZ2V.js → chunk-VVL2KKG4.js} +1 -1
- package/dist/{chunk-GI5R5B3S.js → chunk-VVZDBUHA.js} +2 -2
- package/dist/{chunk-PGBTUGDB.js → chunk-W46OMHOK.js} +23 -27
- package/dist/{chunk-XCKNFFKM.js → chunk-WH6E6SHC.js} +2 -4
- package/dist/{chunk-H6BT45SN.js → chunk-WPYJAHRP.js} +1 -1
- package/dist/{chunk-LJGE43SG.js → chunk-WXGFB2O2.js} +3 -3
- package/dist/{chunk-YQMIKX54.js → chunk-XCYGOCMS.js} +102 -52
- package/dist/{chunk-BTP2BMWN.js → chunk-XEMCNQQW.js} +15 -15
- package/dist/{chunk-NVZ7R4EK.js → chunk-XMUFXJI2.js} +6 -6
- package/dist/{chunk-AM42TLSZ.js → chunk-XZGXVN4T.js} +5 -5
- package/dist/{chunk-5OTA2PUH.js → chunk-YCIBBVI2.js} +2 -2
- package/dist/{chunk-V2NQV7VL.js → chunk-YFIDR7JH.js} +2 -2
- package/dist/{chunk-USZLHYEQ.js → chunk-YFWIFKRQ.js} +3 -3
- package/dist/{chunk-6XLMTAEX.js → chunk-YIHRLY55.js} +33 -6
- package/dist/{chunk-CYRB2JTN.js → chunk-YLKPRT6U.js} +1 -1
- package/dist/{chunk-KMU65FYM.js → chunk-YSDSFXQD.js} +1 -1
- package/dist/{chunk-ZI6WC24V.js → chunk-ZBJV4KNU.js} +1 -1
- package/dist/{chunk-4EX4OKGZ.js → chunk-ZCKVTZHD.js} +41 -19
- package/dist/{chunk-7PJBJ2DU.js → chunk-ZMVMGZAJ.js} +1 -1
- package/dist/{chunk-6EFCOES2.js → chunk-ZRW4B4KF.js} +48 -14
- package/dist/{chunk-A2A2I4Z4.js → chunk-ZTKO2RD4.js} +5 -5
- package/dist/collapse-6IGH2B24.js +31 -0
- package/dist/{collapse-BSPH3BFM.js → collapse-6X5S2S3G.js} +2 -1
- package/dist/collapse-GOWNCVHZ.js +7 -0
- package/dist/collapse-HNTPLB2Q.js +11 -0
- package/dist/collapse-NUM7DPJA.js +10 -0
- package/dist/completion-registry.js +28 -39
- package/dist/countdown.js +1 -1
- package/dist/dgmo-router-RSYWR5IS.js +101 -0
- package/dist/dimensions-KXAI7U2B.js +21 -0
- package/dist/editor.js +884 -222
- package/dist/{flowchart-parser-J3VWIFWB.js → flowchart-parser-UI5VZNGJ.js} +5 -5
- package/dist/{flowchart-renderer-FECH5KK5.js → flowchart-renderer-IYWPKPCF.js} +18 -18
- package/dist/fold-at-line-DmSAa1eU.d.ts +11 -0
- package/dist/highlight.js +886 -224
- package/dist/index.d.ts +89 -6
- package/dist/index.js +91 -70
- package/dist/{layout-TIBRMWHL.js → layout-6VY3DHYD.js} +6 -6
- package/dist/{layout-5SZ5A64I.js → layout-7C2QZCEZ.js} +10 -10
- package/dist/{layout-2WESJYRE.js → layout-7E7BNOGO.js} +3 -2
- package/dist/layout-BSK374N6.js +11 -0
- package/dist/{layout-RH3N46HP.js → layout-FJDBY3WG.js} +6 -5
- package/dist/{layout-YBMT74MG.js → layout-G3RVKEC4.js} +10 -10
- package/dist/{layout-KV27UW25.js → layout-GC5XX2RH.js} +2 -2
- package/dist/{layout-JTIRCKAW.js → layout-R6ULGQJK.js} +6 -6
- package/dist/{layout-HFBK5UEG.js → layout-ROI5KVSO.js} +3 -3
- package/dist/{layout-3TSVAGWH.js → layout-SPPS225I.js} +3 -3
- package/dist/{layout-HF3PMI4H.js → layout-VTGOYGRC.js} +2 -2
- package/dist/{layout-EWXHEXNS.js → layout-WBH5IHYK.js} +10 -10
- package/dist/layout-WTHBGTH2.js +15 -0
- package/dist/layout-ZCCABSV7.js +15 -0
- package/dist/{layout-search-AWPJWBKT.js → layout-search-DSIDKKQO.js} +8 -8
- package/dist/{legend-constants-55MFBXYF.js → legend-constants-KF3MKWL2.js} +2 -2
- package/dist/{parser-NUU3DVW4.js → parser-3PMYAVFL.js} +2 -2
- package/dist/{parser-KJPPUN4D.js → parser-5KVFS4RN.js} +2 -2
- package/dist/{parser-6TDWUKM5.js → parser-BA43YPIQ.js} +3 -3
- package/dist/{parser-EFF22GYO.js → parser-CFAYEWLF.js} +3 -3
- package/dist/{parser-A3AN76RQ.js → parser-DRFEX6OX.js} +3 -3
- package/dist/{parser-H5OODY5N.js → parser-DWVBRBB2.js} +3 -3
- package/dist/{parser-BJ7RJNUM.js → parser-E4B7HJT2.js} +3 -3
- package/dist/{parser-5UZV32ZI.js → parser-FWQY3HJX.js} +2 -2
- package/dist/{parser-RTWPFKXG.js → parser-GMCXCJSP.js} +3 -3
- package/dist/{parser-NL73FSFI.js → parser-IHFHPFL7.js} +3 -3
- package/dist/{parser-BTSTKY5G.js → parser-IU6425JW.js} +6 -6
- package/dist/{parser-ZRIZFDZY.js → parser-IZYIXDJX.js} +6 -6
- package/dist/{parser-4TBSWULQ.js → parser-JQGUTDSX.js} +3 -3
- package/dist/{parser-TUAEX6ML.js → parser-JRKPOO2Z.js} +3 -3
- package/dist/{parser-KMKVFET2.js → parser-KI2XYB2R.js} +2 -2
- package/dist/parser-LDVVBP7S.js +12 -0
- package/dist/{parser-YG625J5H.js → parser-MAGFK6OK.js} +4 -4
- package/dist/{parser-AR2GON37.js → parser-MH5BDN7X.js} +4 -4
- package/dist/{parser-EAQPZX2B.js → parser-MUHFEM4G.js} +3 -3
- package/dist/{parser-RCIEKN7Y.js → parser-P375HO7Q.js} +2 -2
- package/dist/{parser-GMQJISZ6.js → parser-PYY5BRLQ.js} +2 -2
- package/dist/parser-QEMFMVF5.js +12 -0
- package/dist/{parser-GDLKUBTO.js → parser-QIPDBT5M.js} +2 -2
- package/dist/{parser-BT4NI6JY.js → parser-RNBDDEGL.js} +3 -3
- package/dist/{parser-MA7L3XND.js → parser-RSWZGQA7.js} +6 -6
- package/dist/{parser-K2DI26SC.js → parser-SGX2PVR5.js} +2 -2
- package/dist/{parser-KKF6Y5MM.js → parser-SJUEFKNM.js} +4 -3
- package/dist/{parser-3QIFY5IN.js → parser-UMNBPXG2.js} +2 -2
- package/dist/{parser-F7NDRPMA.js → parser-WE4VSBBY.js} +3 -3
- package/dist/{parser-4Y6PODW6.js → parser-WKEYS7N3.js} +3 -3
- package/dist/{parser-KLCSFQ3J.js → parser-WPXUUNA2.js} +3 -3
- package/dist/{parser-LTRQASGB.js → parser-XP3RCOTN.js} +3 -3
- package/dist/{parser-2IKPQVKX.js → parser-YV4RBHG7.js} +3 -3
- package/dist/{parser-3LT3ZUUC.js → parser-YZ3J542U.js} +2 -2
- package/dist/{redraw-AHW7EUUF.js → redraw-BZ4GI6IC.js} +6 -4
- package/dist/{redraw-STZ4WJAI.js → redraw-LEOXS7C6.js} +3 -3
- package/dist/{renderer-IGSHD3OT.js → renderer-2V5NVI3V.js} +16 -16
- package/dist/renderer-4PKYVOYL.js +39 -0
- package/dist/{renderer-IVHD7ENY.js → renderer-66SCERH7.js} +14 -12
- package/dist/renderer-6IAXRZLK.js +85 -0
- package/dist/{renderer-XCLARXCK.js → renderer-6O5SV5YE.js} +10 -10
- package/dist/{renderer-IXBOT6DU.js → renderer-7OXMSF4R.js} +4 -4
- package/dist/{renderer-AM7P4LN7.js → renderer-A36NL2SS.js} +8 -8
- package/dist/{renderer-ACQQ2JXA.js → renderer-ASPBBACI.js} +13 -11
- package/dist/{renderer-W4MUMXJE.js → renderer-BXVTYE27.js} +7 -6
- package/dist/renderer-CC6O6GQK.js +18 -0
- package/dist/{renderer-Y47EM337.js → renderer-CNDB4JTZ.js} +17 -17
- package/dist/renderer-COV2DXTM.js +41 -0
- package/dist/renderer-DXCATVLO.js +30 -0
- package/dist/{renderer-JYHA6R2D.js → renderer-E5E3OJ42.js} +12 -11
- package/dist/{renderer-DAZWHNLI.js → renderer-E7LC7HCU.js} +5 -5
- package/dist/{renderer-RUSQJFFC.js → renderer-F3JYZERE.js} +4 -4
- package/dist/{renderer-7OGGV327.js → renderer-FAFSRFGR.js} +9 -9
- package/dist/renderer-HIB6LZWZ.js +26 -0
- package/dist/renderer-HLDRRFZB.js +28 -0
- package/dist/renderer-INQMQPNN.js +22 -0
- package/dist/renderer-ITJ67HXO.js +27 -0
- package/dist/{renderer-UTEEJDGB.js → renderer-JLOKFKOZ.js} +14 -13
- package/dist/{renderer-2LYX6NHN.js → renderer-KOPJ76GS.js} +10 -10
- package/dist/{renderer-MWZC7TMD.js → renderer-M2467III.js} +14 -13
- package/dist/{renderer-HX6ICPDX.js → renderer-MYKL6VG6.js} +6 -6
- package/dist/{renderer-BXD5KVSR.js → renderer-S6L3JR6C.js} +11 -11
- package/dist/{renderer-NOYLNVTI.js → renderer-SYWVZ4CY.js} +3 -3
- package/dist/renderer-TCTZZ5Y6.js +32 -0
- package/dist/{renderer-QTPWRRJ7.js → renderer-UIHCYXBY.js} +12 -12
- package/dist/{renderer-36446HSH.js → renderer-WIBVOPRC.js} +6 -4
- package/dist/{renderer-2QPHDBZY.js → renderer-XMJ6XZGL.js} +12 -11
- package/dist/{renderer-TINHO2IO.js → renderer-ZTHXOBXW.js} +8 -8
- package/dist/{renderer-radial-WFUX3Z3C.js → renderer-radial-FC25BDCZ.js} +8 -8
- package/dist/{state-parser-PMNHLHLE.js → state-parser-2PQRH5JE.js} +6 -6
- package/dist/state-renderer-YP6HWLJR.js +43 -0
- package/dist/{themes-DzIH3Hjv.d.ts → themes-DoLdhUXV.d.ts} +1 -1
- package/docs/ai-integration.md +4 -4
- package/docs/language-reference.md +154 -104
- package/gallery/fixtures/swot-relabel.dgmo +19 -0
- package/gallery/fixtures/swot-tags.dgmo +16 -0
- package/gallery/fixtures/swot.dgmo +13 -0
- package/gallery/fixtures/whiteboard.dgmo +1 -0
- package/package.json +1 -1
- package/dist/chunk-6BQSDF77.js +0 -734
- package/dist/chunk-NWSPPGIE.js +0 -60
- package/dist/chunk-R2K5L4UA.js +0 -49
- package/dist/chunk-VBMRZCMQ.js +0 -1465
- package/dist/chunk-WZBZXZ6T.js +0 -636
- package/dist/collapse-TCVK3RPO.js +0 -8
- package/dist/dgmo-router-6YLKM6WU.js +0 -101
- package/dist/dimensions-DS6FWLRY.js +0 -21
- package/dist/layout-D4L44NRG.js +0 -11
- package/dist/layout-MXHR3P35.js +0 -15
- package/dist/layout-ND26WVX2.js +0 -15
- package/dist/layout-VDCJOZSH.js +0 -11
- package/dist/parser-PEZ7RN43.js +0 -14
- package/dist/parser-YHDGKPZI.js +0 -14
- package/dist/renderer-4VGO27EE.js +0 -41
- package/dist/renderer-6BDK47V6.js +0 -30
- package/dist/renderer-ISQJ2ELA.js +0 -25
- package/dist/renderer-KJ3V5BYP.js +0 -26
- package/dist/renderer-O6RP52CQ.js +0 -22
- package/dist/renderer-P3WR7TKD.js +0 -39
- package/dist/renderer-UGW4N2W5.js +0 -28
- package/dist/renderer-WPN2SXGT.js +0 -29
- package/dist/renderer-XDX6S7OV.js +0 -30
- package/dist/renderer-ZV6KCLCL.js +0 -85
- package/dist/state-renderer-JQ5DS66J.js +0 -42
- package/gallery/fixtures/sketch.dgmo +0 -22
package/dist/chunk-WZBZXZ6T.js
DELETED
|
@@ -1,636 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
SKETCH_DIAGNOSTIC_CODES
|
|
3
|
-
} from "./chunk-NWSPPGIE.js";
|
|
4
|
-
import {
|
|
5
|
-
parseInArrowLabel
|
|
6
|
-
} from "./chunk-N7VMGZCU.js";
|
|
7
|
-
import {
|
|
8
|
-
normalizeName
|
|
9
|
-
} from "./chunk-NOTA6TEI.js";
|
|
10
|
-
import {
|
|
11
|
-
AUTO_TAG_COLOR_SENTINEL,
|
|
12
|
-
finalizeAutoTagColors,
|
|
13
|
-
injectDefaultTagMetadata,
|
|
14
|
-
matchTagBlockHeading,
|
|
15
|
-
stripDefaultModifier,
|
|
16
|
-
tagAttrKey,
|
|
17
|
-
validateTagGroupNames,
|
|
18
|
-
validateTagValues
|
|
19
|
-
} from "./chunk-4SACN2C5.js";
|
|
20
|
-
import {
|
|
21
|
-
SKETCH_REGISTRY,
|
|
22
|
-
extractColor,
|
|
23
|
-
fillModeFromToken,
|
|
24
|
-
measureIndent,
|
|
25
|
-
parseFirstLine,
|
|
26
|
-
recognizeGlobalBoolean,
|
|
27
|
-
splitNameAndMeta,
|
|
28
|
-
stripQuotes,
|
|
29
|
-
warnUnknownMetaKeys,
|
|
30
|
-
withTagAliases
|
|
31
|
-
} from "./chunk-TIIZIAGS.js";
|
|
32
|
-
import {
|
|
33
|
-
NAME_DIAGNOSTIC_CODES,
|
|
34
|
-
formatDgmoError,
|
|
35
|
-
makeDgmoError,
|
|
36
|
-
makeFail,
|
|
37
|
-
nameMergedMessage,
|
|
38
|
-
suggest
|
|
39
|
-
} from "./chunk-BYU54C3S.js";
|
|
40
|
-
|
|
41
|
-
// src/sketch/parser.ts
|
|
42
|
-
var EDGE_FORMS = [
|
|
43
|
-
{ re: /^<-(.+?)->\s*(.+)$/, heads: "both", dashed: false, labeled: true },
|
|
44
|
-
{ re: /^<~(.+?)~>\s*(.+)$/, heads: "both", dashed: true, labeled: true },
|
|
45
|
-
{ re: /^<->\s*(.+)$/, heads: "both", dashed: false, labeled: false },
|
|
46
|
-
{ re: /^<~>\s*(.+)$/, heads: "both", dashed: true, labeled: false },
|
|
47
|
-
{ re: /^-(.+?)->\s*(.+)$/, heads: "one", dashed: false, labeled: true },
|
|
48
|
-
{ re: /^~(.+?)~>\s*(.+)$/, heads: "one", dashed: true, labeled: true },
|
|
49
|
-
{ re: /^->\s*(.+)$/, heads: "one", dashed: false, labeled: false },
|
|
50
|
-
{ re: /^~>\s*(.+)$/, heads: "one", dashed: true, labeled: false },
|
|
51
|
-
{ re: /^--\s+(.+)$/, heads: "none", dashed: false, labeled: false },
|
|
52
|
-
{ re: /^~~\s+(.+)$/, heads: "none", dashed: true, labeled: false },
|
|
53
|
-
{ re: /^-(.+?)-\s+(.+)$/, heads: "none", dashed: false, labeled: true },
|
|
54
|
-
{ re: /^~(.+?)~\s+(.+)$/, heads: "none", dashed: true, labeled: true }
|
|
55
|
-
];
|
|
56
|
-
var EDGE_START_RE = /^[<\-~]/;
|
|
57
|
-
var LEFT_ARROW_RE = /^<[-~](?![-~]?>)/;
|
|
58
|
-
var BOX_RE = /^\[([^\]]*)\]\s*(.*)$/;
|
|
59
|
-
var BOX_TAIL_ALIAS_RE = /^as\s+([A-Za-z][A-Za-z0-9_]{0,11})(?=\s|,|$)\s*,?\s*/;
|
|
60
|
-
var AT_VALUE_RE = /^(-?\d+)\s+(-?\d+)$/;
|
|
61
|
-
var SKETCH_AT_MAX = 2e3;
|
|
62
|
-
var MAX_BOX_DEPTH = 2;
|
|
63
|
-
function parseSketch(content, palette) {
|
|
64
|
-
const options = {
|
|
65
|
-
noLegend: false,
|
|
66
|
-
legendInline: false,
|
|
67
|
-
fillMode: void 0,
|
|
68
|
-
noDescriptions: false,
|
|
69
|
-
noTitle: false
|
|
70
|
-
};
|
|
71
|
-
const result = {
|
|
72
|
-
type: "sketch",
|
|
73
|
-
title: null,
|
|
74
|
-
titleLineNumber: null,
|
|
75
|
-
nodes: [],
|
|
76
|
-
edges: [],
|
|
77
|
-
boxes: [],
|
|
78
|
-
tagGroups: [],
|
|
79
|
-
options,
|
|
80
|
-
diagnostics: [],
|
|
81
|
-
error: null
|
|
82
|
-
};
|
|
83
|
-
const fail = makeFail(result);
|
|
84
|
-
const pushError = (line, message, code) => {
|
|
85
|
-
result.diagnostics.push(makeDgmoError(line, message, "error", code));
|
|
86
|
-
};
|
|
87
|
-
const warn = (line, message, code) => {
|
|
88
|
-
result.diagnostics.push(makeDgmoError(line, message, "warning", code));
|
|
89
|
-
};
|
|
90
|
-
if (!content?.trim()) {
|
|
91
|
-
return fail(0, "No content provided");
|
|
92
|
-
}
|
|
93
|
-
const lines = content.split("\n");
|
|
94
|
-
const nodes = [];
|
|
95
|
-
const boxes = [];
|
|
96
|
-
const nodeById = /* @__PURE__ */ new Map();
|
|
97
|
-
const aliasIndex = /* @__PURE__ */ new Map();
|
|
98
|
-
const labelIndex = /* @__PURE__ */ new Map();
|
|
99
|
-
const boxByNorm = /* @__PURE__ */ new Map();
|
|
100
|
-
const pendingEdges = [];
|
|
101
|
-
const tagAliasMap = /* @__PURE__ */ new Map();
|
|
102
|
-
let idCounter = 0;
|
|
103
|
-
const registryFor = () => withTagAliases(SKETCH_REGISTRY, new Set(tagAliasMap.keys()));
|
|
104
|
-
const parseAt = (raw, lineNumber) => {
|
|
105
|
-
if (raw === void 0) return null;
|
|
106
|
-
const m = raw.trim().match(AT_VALUE_RE);
|
|
107
|
-
if (!m) {
|
|
108
|
-
warn(
|
|
109
|
-
lineNumber,
|
|
110
|
-
`Invalid at: value "${raw}" \u2014 expected two integers (at: C R); shape will flow-place`
|
|
111
|
-
);
|
|
112
|
-
return null;
|
|
113
|
-
}
|
|
114
|
-
const c = parseInt(m[1], 10);
|
|
115
|
-
const r = parseInt(m[2], 10);
|
|
116
|
-
if (!Number.isSafeInteger(c) || !Number.isSafeInteger(r) || Math.abs(c) > SKETCH_AT_MAX || Math.abs(r) > SKETCH_AT_MAX) {
|
|
117
|
-
warn(
|
|
118
|
-
lineNumber,
|
|
119
|
-
`at: coordinate "${raw}" is out of range \u2014 half-slot coords must be whole numbers within \xB1${SKETCH_AT_MAX}; shape will flow-place`,
|
|
120
|
-
SKETCH_DIAGNOSTIC_CODES.AT_OUT_OF_RANGE
|
|
121
|
-
);
|
|
122
|
-
return null;
|
|
123
|
-
}
|
|
124
|
-
return { c, r };
|
|
125
|
-
};
|
|
126
|
-
const liftReserved = (meta, lineNumber) => {
|
|
127
|
-
const shapeRaw = meta["shape"];
|
|
128
|
-
if (shapeRaw !== void 0) {
|
|
129
|
-
pushError(
|
|
130
|
-
lineNumber,
|
|
131
|
-
`shape: ${shapeRaw.trim()} is not supported in sketch \u2014 every box is a plain rectangle; remove the shape: clause`,
|
|
132
|
-
SKETCH_DIAGNOSTIC_CODES.SHAPE_UNSUPPORTED
|
|
133
|
-
);
|
|
134
|
-
delete meta["shape"];
|
|
135
|
-
}
|
|
136
|
-
const at = parseAt(meta["at"], lineNumber);
|
|
137
|
-
delete meta["at"];
|
|
138
|
-
delete meta["collapsed"];
|
|
139
|
-
return { at };
|
|
140
|
-
};
|
|
141
|
-
const addShape = (trimmed, lineNumber, box) => {
|
|
142
|
-
const snm = splitNameAndMeta(
|
|
143
|
-
trimmed,
|
|
144
|
-
registryFor(),
|
|
145
|
-
tagAliasMap,
|
|
146
|
-
palette,
|
|
147
|
-
result.diagnostics,
|
|
148
|
-
lineNumber
|
|
149
|
-
);
|
|
150
|
-
let label = stripQuotes(snm.name.trim()).trim();
|
|
151
|
-
if (snm.color) label = `${label} ${snm.color}`.trim();
|
|
152
|
-
if (!label) {
|
|
153
|
-
warn(lineNumber, `Shape line has no name \u2014 ignored`);
|
|
154
|
-
return null;
|
|
155
|
-
}
|
|
156
|
-
const meta = { ...snm.meta };
|
|
157
|
-
warnUnknownMetaKeys(
|
|
158
|
-
meta,
|
|
159
|
-
registryFor(),
|
|
160
|
-
(m) => warn(lineNumber, m),
|
|
161
|
-
snm.name
|
|
162
|
-
);
|
|
163
|
-
const { at } = liftReserved(meta, lineNumber);
|
|
164
|
-
const norm = normalizeName(label);
|
|
165
|
-
if (snm.alias !== void 0 && aliasIndex.has(snm.alias)) {
|
|
166
|
-
warn(
|
|
167
|
-
lineNumber,
|
|
168
|
-
`Duplicate alias "${snm.alias}" \u2014 the first declaration keeps it`
|
|
169
|
-
);
|
|
170
|
-
}
|
|
171
|
-
const alias = snm.alias !== void 0 && !aliasIndex.has(snm.alias) ? snm.alias : void 0;
|
|
172
|
-
if (alias === void 0 && snm.alias === void 0) {
|
|
173
|
-
const existing = labelIndex.get(norm);
|
|
174
|
-
if (existing && existing.length > 0) {
|
|
175
|
-
const first = nodeById.get(existing[0]);
|
|
176
|
-
for (const [k, v] of Object.entries(meta)) {
|
|
177
|
-
if (!(k in first.metadata)) first.metadata[k] = v;
|
|
178
|
-
}
|
|
179
|
-
if (first.at === null && at !== null) first.at = at;
|
|
180
|
-
warn(
|
|
181
|
-
lineNumber,
|
|
182
|
-
nameMergedMessage({
|
|
183
|
-
incomingDisplay: label,
|
|
184
|
-
incomingLine: lineNumber,
|
|
185
|
-
existingDisplay: first.label,
|
|
186
|
-
existingLine: first.lineNumber
|
|
187
|
-
}),
|
|
188
|
-
NAME_DIAGNOSTIC_CODES.NAME_MERGED
|
|
189
|
-
);
|
|
190
|
-
return first;
|
|
191
|
-
}
|
|
192
|
-
}
|
|
193
|
-
const id = `sketch-node-${++idCounter}`;
|
|
194
|
-
const node = {
|
|
195
|
-
id,
|
|
196
|
-
label,
|
|
197
|
-
...alias !== void 0 && { alias },
|
|
198
|
-
at,
|
|
199
|
-
metadata: meta,
|
|
200
|
-
...box !== null && { boxLabel: box.label },
|
|
201
|
-
lineNumber
|
|
202
|
-
};
|
|
203
|
-
nodes.push(node);
|
|
204
|
-
nodeById.set(id, node);
|
|
205
|
-
if (alias !== void 0) aliasIndex.set(alias, id);
|
|
206
|
-
const list = labelIndex.get(norm);
|
|
207
|
-
if (list) list.push(id);
|
|
208
|
-
else labelIndex.set(norm, [id]);
|
|
209
|
-
if (box !== null) box.children.push(id);
|
|
210
|
-
return node;
|
|
211
|
-
};
|
|
212
|
-
const parseBoxTail = (tail, lineNumber) => {
|
|
213
|
-
let rest = tail.trim();
|
|
214
|
-
let alias;
|
|
215
|
-
const aliasMatch = rest.match(BOX_TAIL_ALIAS_RE);
|
|
216
|
-
if (aliasMatch) {
|
|
217
|
-
alias = aliasMatch[1];
|
|
218
|
-
rest = rest.slice(aliasMatch[0].length);
|
|
219
|
-
}
|
|
220
|
-
let collapsed = false;
|
|
221
|
-
rest = rest.replace(/(^|,|\s)collapsed(?=\s|,|$)/i, (_m, pre) => {
|
|
222
|
-
collapsed = true;
|
|
223
|
-
return pre === "," ? "," : pre;
|
|
224
|
-
});
|
|
225
|
-
const meta = {};
|
|
226
|
-
let at = null;
|
|
227
|
-
for (const seg of rest.split(",")) {
|
|
228
|
-
const t = seg.trim();
|
|
229
|
-
if (!t) continue;
|
|
230
|
-
const colonIdx = t.indexOf(":");
|
|
231
|
-
if (colonIdx < 0) {
|
|
232
|
-
warn(lineNumber, `Unrecognized box metadata "${t}" \u2014 ignored`);
|
|
233
|
-
continue;
|
|
234
|
-
}
|
|
235
|
-
const rawKey = t.slice(0, colonIdx).trim().toLowerCase();
|
|
236
|
-
const value = t.slice(colonIdx + 1).trim();
|
|
237
|
-
if (rawKey === "at") {
|
|
238
|
-
at = parseAt(value, lineNumber);
|
|
239
|
-
} else if (value) {
|
|
240
|
-
meta[tagAliasMap.get(rawKey) ?? rawKey] = value;
|
|
241
|
-
}
|
|
242
|
-
}
|
|
243
|
-
return { ...alias !== void 0 && { alias }, at, collapsed, meta };
|
|
244
|
-
};
|
|
245
|
-
const openBox = (label, tail, lineNumber, parentBoxId) => {
|
|
246
|
-
const norm = normalizeName(label);
|
|
247
|
-
const existing = boxByNorm.get(norm);
|
|
248
|
-
const { alias, at, collapsed, meta } = parseBoxTail(tail, lineNumber);
|
|
249
|
-
if (existing) {
|
|
250
|
-
warn(
|
|
251
|
-
lineNumber,
|
|
252
|
-
`Box "${label}" already declared on line ${existing.lineNumber} \u2014 shapes are added to it`
|
|
253
|
-
);
|
|
254
|
-
return existing;
|
|
255
|
-
}
|
|
256
|
-
const box = {
|
|
257
|
-
id: `[${norm}]`,
|
|
258
|
-
label: label.trim(),
|
|
259
|
-
...alias !== void 0 && { alias },
|
|
260
|
-
at,
|
|
261
|
-
metadata: meta,
|
|
262
|
-
collapsed,
|
|
263
|
-
children: [],
|
|
264
|
-
childBoxes: [],
|
|
265
|
-
parentBoxId,
|
|
266
|
-
lineNumber
|
|
267
|
-
};
|
|
268
|
-
boxes.push(box);
|
|
269
|
-
if (parentBoxId !== null) {
|
|
270
|
-
boxByNorm.get(normalizeName(parentBoxId.slice(1, -1)))?.childBoxes.push(box.id);
|
|
271
|
-
}
|
|
272
|
-
boxByNorm.set(norm, box);
|
|
273
|
-
if (alias !== void 0) {
|
|
274
|
-
if (aliasIndex.has(alias)) {
|
|
275
|
-
warn(
|
|
276
|
-
lineNumber,
|
|
277
|
-
`Duplicate alias "${alias}" \u2014 the first declaration keeps it`
|
|
278
|
-
);
|
|
279
|
-
} else {
|
|
280
|
-
aliasIndex.set(alias, box.id);
|
|
281
|
-
}
|
|
282
|
-
}
|
|
283
|
-
return box;
|
|
284
|
-
};
|
|
285
|
-
const addEdge = (trimmed, lineNumber, sourceId) => {
|
|
286
|
-
for (const form of EDGE_FORMS) {
|
|
287
|
-
const m = trimmed.match(form.re);
|
|
288
|
-
if (!m) continue;
|
|
289
|
-
let label;
|
|
290
|
-
let targetRegion;
|
|
291
|
-
if (form.labeled) {
|
|
292
|
-
const labelResult = parseInArrowLabel(m[1], lineNumber);
|
|
293
|
-
result.diagnostics.push(...labelResult.diagnostics);
|
|
294
|
-
label = labelResult.label;
|
|
295
|
-
targetRegion = m[2];
|
|
296
|
-
} else {
|
|
297
|
-
targetRegion = m[1];
|
|
298
|
-
}
|
|
299
|
-
const snm = splitNameAndMeta(
|
|
300
|
-
targetRegion.trim(),
|
|
301
|
-
registryFor(),
|
|
302
|
-
tagAliasMap,
|
|
303
|
-
palette,
|
|
304
|
-
result.diagnostics,
|
|
305
|
-
lineNumber,
|
|
306
|
-
{ peelAlias: false }
|
|
307
|
-
);
|
|
308
|
-
let targetRaw = snm.name.trim();
|
|
309
|
-
if (snm.color) targetRaw = `${targetRaw} ${snm.color}`.trim();
|
|
310
|
-
const meta = { ...snm.meta };
|
|
311
|
-
delete meta["at"];
|
|
312
|
-
delete meta["shape"];
|
|
313
|
-
warnUnknownMetaKeys(meta, registryFor(), (msg) => warn(lineNumber, msg));
|
|
314
|
-
if (!targetRaw) {
|
|
315
|
-
warn(lineNumber, `Edge has no target \u2014 ignored`);
|
|
316
|
-
return;
|
|
317
|
-
}
|
|
318
|
-
pendingEdges.push({
|
|
319
|
-
sourceId,
|
|
320
|
-
targetRaw,
|
|
321
|
-
...label !== void 0 && { label },
|
|
322
|
-
heads: form.heads,
|
|
323
|
-
dashed: form.dashed,
|
|
324
|
-
metadata: meta,
|
|
325
|
-
lineNumber
|
|
326
|
-
});
|
|
327
|
-
return;
|
|
328
|
-
}
|
|
329
|
-
if (LEFT_ARROW_RE.test(trimmed)) {
|
|
330
|
-
pushError(
|
|
331
|
-
lineNumber,
|
|
332
|
-
`Left-pointing arrows are not supported \u2014 write the edge from the other side (B -> A instead of A <- B)`
|
|
333
|
-
);
|
|
334
|
-
return;
|
|
335
|
-
}
|
|
336
|
-
warn(lineNumber, `Malformed edge "${trimmed}" \u2014 ignored`);
|
|
337
|
-
};
|
|
338
|
-
let firstLineConsumed = false;
|
|
339
|
-
let contentStarted = false;
|
|
340
|
-
let currentTagGroup = null;
|
|
341
|
-
const boxStack = [];
|
|
342
|
-
const boxAt = (indent) => {
|
|
343
|
-
while (boxStack.length > 0 && indent <= boxStack[boxStack.length - 1].indent) {
|
|
344
|
-
boxStack.pop();
|
|
345
|
-
}
|
|
346
|
-
return boxStack[boxStack.length - 1] ?? null;
|
|
347
|
-
};
|
|
348
|
-
let currentShape = null;
|
|
349
|
-
for (let i = 0; i < lines.length; i++) {
|
|
350
|
-
const raw = lines[i];
|
|
351
|
-
const lineNumber = i + 1;
|
|
352
|
-
const trimmed = raw.trim();
|
|
353
|
-
if (!trimmed) {
|
|
354
|
-
currentTagGroup = null;
|
|
355
|
-
continue;
|
|
356
|
-
}
|
|
357
|
-
if (trimmed.startsWith("//")) continue;
|
|
358
|
-
const indent = measureIndent(raw);
|
|
359
|
-
if (!firstLineConsumed) {
|
|
360
|
-
firstLineConsumed = true;
|
|
361
|
-
const firstLine = parseFirstLine(trimmed);
|
|
362
|
-
if (firstLine?.chartType !== "sketch") {
|
|
363
|
-
let msg = `Expected chart type "sketch", got "${firstLine?.chartType ?? trimmed.split(/\s+/)[0]}"`;
|
|
364
|
-
const hint = suggest(firstLine?.chartType ?? "", ["sketch"]);
|
|
365
|
-
if (hint) msg += `. ${hint}`;
|
|
366
|
-
return fail(lineNumber, msg);
|
|
367
|
-
}
|
|
368
|
-
result.title = firstLine.title ?? null;
|
|
369
|
-
result.titleLineNumber = lineNumber;
|
|
370
|
-
continue;
|
|
371
|
-
}
|
|
372
|
-
if (indent === 0) {
|
|
373
|
-
const tagBlockMatch = matchTagBlockHeading(trimmed);
|
|
374
|
-
if (tagBlockMatch) {
|
|
375
|
-
if (contentStarted) {
|
|
376
|
-
pushError(
|
|
377
|
-
lineNumber,
|
|
378
|
-
"Tag groups must appear before sketch content",
|
|
379
|
-
"E_TAG_DECLARED_AFTER_CONTENT"
|
|
380
|
-
);
|
|
381
|
-
continue;
|
|
382
|
-
}
|
|
383
|
-
currentTagGroup = {
|
|
384
|
-
name: tagBlockMatch.name,
|
|
385
|
-
...tagBlockMatch.alias !== void 0 && {
|
|
386
|
-
alias: tagBlockMatch.alias
|
|
387
|
-
},
|
|
388
|
-
entries: [],
|
|
389
|
-
lineNumber
|
|
390
|
-
};
|
|
391
|
-
if (tagBlockMatch.alias) {
|
|
392
|
-
tagAliasMap.set(
|
|
393
|
-
tagBlockMatch.alias.toLowerCase(),
|
|
394
|
-
tagAttrKey(tagBlockMatch.name)
|
|
395
|
-
);
|
|
396
|
-
}
|
|
397
|
-
tagAliasMap.set(
|
|
398
|
-
tagAttrKey(tagBlockMatch.name),
|
|
399
|
-
tagAttrKey(tagBlockMatch.name)
|
|
400
|
-
);
|
|
401
|
-
if (tagBlockMatch.inlineValues) {
|
|
402
|
-
for (const entry of tagBlockMatch.inlineValues) {
|
|
403
|
-
const { text: cleanEntry, isDefault } = stripDefaultModifier(entry);
|
|
404
|
-
const { label, color } = extractColor(
|
|
405
|
-
cleanEntry,
|
|
406
|
-
palette,
|
|
407
|
-
result.diagnostics,
|
|
408
|
-
lineNumber
|
|
409
|
-
);
|
|
410
|
-
if (isDefault) currentTagGroup.defaultValue = label;
|
|
411
|
-
currentTagGroup.entries.push({
|
|
412
|
-
value: label,
|
|
413
|
-
color: color ?? AUTO_TAG_COLOR_SENTINEL,
|
|
414
|
-
// When a color resolved, the recognized name is the entry's last
|
|
415
|
-
// token — keep it so a reparse can tell authored from auto.
|
|
416
|
-
...color !== void 0 && {
|
|
417
|
-
authoredColor: cleanEntry.trim().split(/\s+/).pop()
|
|
418
|
-
},
|
|
419
|
-
lineNumber
|
|
420
|
-
});
|
|
421
|
-
}
|
|
422
|
-
}
|
|
423
|
-
result.tagGroups.push(currentTagGroup);
|
|
424
|
-
continue;
|
|
425
|
-
}
|
|
426
|
-
}
|
|
427
|
-
if (currentTagGroup && indent > 0) {
|
|
428
|
-
const { text: cleanEntry, isDefault } = stripDefaultModifier(trimmed);
|
|
429
|
-
const { label, color } = extractColor(
|
|
430
|
-
cleanEntry,
|
|
431
|
-
palette,
|
|
432
|
-
result.diagnostics,
|
|
433
|
-
lineNumber
|
|
434
|
-
);
|
|
435
|
-
if (isDefault) currentTagGroup.defaultValue = label;
|
|
436
|
-
currentTagGroup.entries.push({
|
|
437
|
-
value: label,
|
|
438
|
-
color: color ?? AUTO_TAG_COLOR_SENTINEL,
|
|
439
|
-
// When a color resolved, the recognized name is the entry's last token
|
|
440
|
-
// — keep it so a reparse can tell authored from auto.
|
|
441
|
-
...color !== void 0 && {
|
|
442
|
-
authoredColor: cleanEntry.trim().split(/\s+/).pop()
|
|
443
|
-
},
|
|
444
|
-
lineNumber
|
|
445
|
-
});
|
|
446
|
-
continue;
|
|
447
|
-
}
|
|
448
|
-
currentTagGroup = null;
|
|
449
|
-
if (indent === 0 && /^legend-inline\s*$/i.test(trimmed)) {
|
|
450
|
-
options.legendInline = true;
|
|
451
|
-
continue;
|
|
452
|
-
}
|
|
453
|
-
if (indent === 0 && /^no-legend\s*$/i.test(trimmed)) {
|
|
454
|
-
options.noLegend = true;
|
|
455
|
-
continue;
|
|
456
|
-
}
|
|
457
|
-
if (indent === 0 && fillModeFromToken(trimmed) !== null) {
|
|
458
|
-
const fm = fillModeFromToken(trimmed);
|
|
459
|
-
options.fillMode = fm === "tint" ? void 0 : fm;
|
|
460
|
-
continue;
|
|
461
|
-
}
|
|
462
|
-
if (indent === 0 && /^no-descriptions\s*$/i.test(trimmed)) {
|
|
463
|
-
options.noDescriptions = true;
|
|
464
|
-
continue;
|
|
465
|
-
}
|
|
466
|
-
if (indent === 0) {
|
|
467
|
-
const shared = recognizeGlobalBoolean(trimmed);
|
|
468
|
-
if (shared !== null) {
|
|
469
|
-
if (shared === "no-title") options.noTitle = true;
|
|
470
|
-
continue;
|
|
471
|
-
}
|
|
472
|
-
}
|
|
473
|
-
contentStarted = true;
|
|
474
|
-
if (trimmed.startsWith(">")) {
|
|
475
|
-
const descLine = trimmed.slice(1).replace(/^ /, "");
|
|
476
|
-
if (indent > 0 && currentShape && indent > currentShape.indent) {
|
|
477
|
-
const node2 = nodeById.get(currentShape.id);
|
|
478
|
-
if (node2) {
|
|
479
|
-
node2.description = node2.description === void 0 ? descLine : `${node2.description}
|
|
480
|
-
${descLine}`;
|
|
481
|
-
}
|
|
482
|
-
} else {
|
|
483
|
-
warn(
|
|
484
|
-
lineNumber,
|
|
485
|
-
`Description "${trimmed}" has no shape \u2014 indent it under the shape it describes`
|
|
486
|
-
);
|
|
487
|
-
}
|
|
488
|
-
continue;
|
|
489
|
-
}
|
|
490
|
-
if (EDGE_START_RE.test(trimmed)) {
|
|
491
|
-
if (indent > 0 && currentShape && indent > currentShape.indent) {
|
|
492
|
-
addEdge(trimmed, lineNumber, currentShape.id);
|
|
493
|
-
} else if (indent > 0 && boxAt(indent)) {
|
|
494
|
-
addEdge(trimmed, lineNumber, boxAt(indent).box.id);
|
|
495
|
-
} else {
|
|
496
|
-
warn(
|
|
497
|
-
lineNumber,
|
|
498
|
-
`Edge "${trimmed}" has no source shape \u2014 indent it under the shape it leaves from`
|
|
499
|
-
);
|
|
500
|
-
}
|
|
501
|
-
continue;
|
|
502
|
-
}
|
|
503
|
-
const boxMatch = trimmed.match(BOX_RE);
|
|
504
|
-
if (boxMatch) {
|
|
505
|
-
const label = boxMatch[1].trim();
|
|
506
|
-
if (!label) {
|
|
507
|
-
warn(lineNumber, "Box has no label \u2014 ignored");
|
|
508
|
-
continue;
|
|
509
|
-
}
|
|
510
|
-
while (boxStack.length > 0 && indent <= boxStack[boxStack.length - 1].indent) {
|
|
511
|
-
boxStack.pop();
|
|
512
|
-
}
|
|
513
|
-
const depth = boxStack.length + 1;
|
|
514
|
-
if (depth > MAX_BOX_DEPTH) {
|
|
515
|
-
pushError(
|
|
516
|
-
lineNumber,
|
|
517
|
-
`Box "${label}" is nested ${depth} levels deep \u2014 sketch boxes nest to depth ${MAX_BOX_DEPTH}; its shapes join the box above it`,
|
|
518
|
-
SKETCH_DIAGNOSTIC_CODES.BOX_DEPTH
|
|
519
|
-
);
|
|
520
|
-
continue;
|
|
521
|
-
}
|
|
522
|
-
const parent = boxStack[boxStack.length - 1] ?? null;
|
|
523
|
-
const box = openBox(
|
|
524
|
-
label,
|
|
525
|
-
boxMatch[2] ?? "",
|
|
526
|
-
lineNumber,
|
|
527
|
-
parent ? parent.box.id : null
|
|
528
|
-
);
|
|
529
|
-
boxStack.push({ box, indent });
|
|
530
|
-
currentShape = null;
|
|
531
|
-
continue;
|
|
532
|
-
}
|
|
533
|
-
if (indent === 0) {
|
|
534
|
-
boxStack.length = 0;
|
|
535
|
-
const node2 = addShape(trimmed, lineNumber, null);
|
|
536
|
-
currentShape = node2 ? { id: node2.id, indent } : null;
|
|
537
|
-
continue;
|
|
538
|
-
}
|
|
539
|
-
const owner = boxAt(indent);
|
|
540
|
-
if (owner) {
|
|
541
|
-
const node2 = addShape(trimmed, lineNumber, owner.box);
|
|
542
|
-
currentShape = node2 ? { id: node2.id, indent } : currentShape;
|
|
543
|
-
continue;
|
|
544
|
-
}
|
|
545
|
-
warn(
|
|
546
|
-
lineNumber,
|
|
547
|
-
`Indented line "${trimmed}" has no parent box \u2014 treated as a top-level shape`
|
|
548
|
-
);
|
|
549
|
-
const node = addShape(trimmed, lineNumber, null);
|
|
550
|
-
currentShape = node ? { id: node.id, indent } : currentShape;
|
|
551
|
-
}
|
|
552
|
-
const allTargets = [
|
|
553
|
-
...aliasIndex.keys(),
|
|
554
|
-
...nodes.map((n) => n.label),
|
|
555
|
-
...boxes.map((b) => b.label)
|
|
556
|
-
];
|
|
557
|
-
for (const pe of pendingEdges) {
|
|
558
|
-
let targetId;
|
|
559
|
-
const bracketMatch = pe.targetRaw.match(/^\[([^\]]*)\]$/);
|
|
560
|
-
if (bracketMatch) {
|
|
561
|
-
targetId = boxByNorm.get(normalizeName(bracketMatch[1]))?.id ?? null;
|
|
562
|
-
} else if (aliasIndex.has(pe.targetRaw)) {
|
|
563
|
-
targetId = aliasIndex.get(pe.targetRaw);
|
|
564
|
-
} else {
|
|
565
|
-
const norm = normalizeName(stripQuotes(pe.targetRaw).trim());
|
|
566
|
-
const labelHits = labelIndex.get(norm) ?? [];
|
|
567
|
-
if (labelHits.length > 1) {
|
|
568
|
-
pushError(
|
|
569
|
-
pe.lineNumber,
|
|
570
|
-
`Edge target "${pe.targetRaw}" matches more than one shape \u2014 give each duplicate an alias (as x) and target the alias`,
|
|
571
|
-
SKETCH_DIAGNOSTIC_CODES.AMBIGUOUS_TARGET
|
|
572
|
-
);
|
|
573
|
-
continue;
|
|
574
|
-
}
|
|
575
|
-
targetId = labelHits[0] ?? boxByNorm.get(norm)?.id ?? null;
|
|
576
|
-
}
|
|
577
|
-
if (targetId === null) {
|
|
578
|
-
let msg = `Unknown edge target "${pe.targetRaw}"`;
|
|
579
|
-
const hint = suggest(pe.targetRaw, allTargets);
|
|
580
|
-
if (hint) msg += `. ${hint}`;
|
|
581
|
-
warn(pe.lineNumber, msg);
|
|
582
|
-
continue;
|
|
583
|
-
}
|
|
584
|
-
if (targetId === pe.sourceId) {
|
|
585
|
-
warn(pe.lineNumber, `Edge from "${pe.targetRaw}" to itself \u2014 ignored`);
|
|
586
|
-
continue;
|
|
587
|
-
}
|
|
588
|
-
result.edges.push({
|
|
589
|
-
sourceId: pe.sourceId,
|
|
590
|
-
targetId,
|
|
591
|
-
...pe.label !== void 0 && { label: pe.label },
|
|
592
|
-
heads: pe.heads,
|
|
593
|
-
dashed: pe.dashed,
|
|
594
|
-
metadata: pe.metadata,
|
|
595
|
-
lineNumber: pe.lineNumber
|
|
596
|
-
});
|
|
597
|
-
}
|
|
598
|
-
finalizeAutoTagColors(result.tagGroups, palette);
|
|
599
|
-
if (result.tagGroups.length > 0) {
|
|
600
|
-
const tagKeys = result.tagGroups.map((g) => tagAttrKey(g.name));
|
|
601
|
-
for (const box of boxes) {
|
|
602
|
-
for (const childId of box.children) {
|
|
603
|
-
const child = nodeById.get(childId);
|
|
604
|
-
if (!child) continue;
|
|
605
|
-
for (const k of tagKeys) {
|
|
606
|
-
if (!(k in child.metadata) && box.metadata[k] !== void 0) {
|
|
607
|
-
child.metadata[k] = box.metadata[k];
|
|
608
|
-
}
|
|
609
|
-
}
|
|
610
|
-
}
|
|
611
|
-
}
|
|
612
|
-
injectDefaultTagMetadata([...nodes, ...boxes], result.tagGroups);
|
|
613
|
-
validateTagValues(
|
|
614
|
-
[...nodes, ...boxes, ...result.edges],
|
|
615
|
-
result.tagGroups,
|
|
616
|
-
(line, message) => warn(line, message),
|
|
617
|
-
suggest
|
|
618
|
-
);
|
|
619
|
-
validateTagGroupNames(
|
|
620
|
-
result.tagGroups,
|
|
621
|
-
(line, message) => warn(line, message)
|
|
622
|
-
);
|
|
623
|
-
}
|
|
624
|
-
result.nodes = nodes;
|
|
625
|
-
result.boxes = boxes;
|
|
626
|
-
if (nodes.length === 0 && boxes.length === 0 && !result.error) {
|
|
627
|
-
const diag = makeDgmoError(1, "No shapes found in sketch");
|
|
628
|
-
result.diagnostics.push(diag);
|
|
629
|
-
result.error = formatDgmoError(diag);
|
|
630
|
-
}
|
|
631
|
-
return result;
|
|
632
|
-
}
|
|
633
|
-
|
|
634
|
-
export {
|
|
635
|
-
parseSketch
|
|
636
|
-
};
|