@diagrammo/dgmo 0.50.2 → 0.51.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/dist/advanced.d.ts +85 -23
- package/dist/advanced.js +207 -161
- package/dist/{analyzer-UYKBXAKR.js → analyzer-BJ54GIFB.js} +3 -3
- package/dist/auto.css +31 -8
- package/dist/auto.d.ts +6 -0
- package/dist/auto.js +169 -133
- package/dist/auto.mjs +2148 -1024
- package/dist/block.css +28 -8
- package/dist/block.js +97 -68
- package/dist/{charts-d3-MUW3LTML.js → charts-d3-7E4B4IMW.js} +9 -9
- package/dist/{chunk-6IAA2QQ2.js → chunk-2EQMXBBQ.js} +2 -2
- package/dist/{chunk-XJLKLU4D.js → chunk-2ILHQOL3.js} +3 -3
- package/dist/{chunk-SXRTRMEE.js → chunk-2UJSV2VT.js} +3 -3
- package/dist/{chunk-LE4MYMLI.js → chunk-32XPAAET.js} +5 -5
- package/dist/{chunk-NU3XLTGP.js → chunk-332ZR4QU.js} +4 -4
- package/dist/{chunk-F7BFXWNQ.js → chunk-3JLKYGBQ.js} +2 -2
- package/dist/{chunk-QROYX7TT.js → chunk-3LV2NCB6.js} +3 -3
- package/dist/{chunk-SVTI362O.js → chunk-3ODS2VGL.js} +97 -97
- package/dist/{chunk-3XGZF2QJ.js → chunk-3YSQZ75W.js} +6 -6
- package/dist/{chunk-FJUNPCYI.js → chunk-467TVMQL.js} +2 -2
- package/dist/{chunk-HHXOONLX.js → chunk-4B5YISOR.js} +38 -1
- package/dist/{chunk-6HJBFVLO.js → chunk-4QZ43D7I.js} +3 -3
- package/dist/{chunk-QJJZSROI.js → chunk-4VWJ4LW2.js} +7 -7
- package/dist/chunk-4XFBQT5O.js +35 -0
- package/dist/{chunk-2C56LEML.js → chunk-5F5ELR3V.js} +3 -3
- package/dist/{chunk-EAMEADTV.js → chunk-5PDTIBLV.js} +83 -21
- package/dist/{chunk-C2CVAM3U.js → chunk-5PZT4DQG.js} +160 -87
- package/dist/{chunk-IAEC4KLA.js → chunk-5QKQSSPO.js} +2 -2
- package/dist/{chunk-5OWVC2A6.js → chunk-5SVOCD5W.js} +6 -6
- package/dist/{chunk-VBYSIOOY.js → chunk-5WPNFSXP.js} +3 -3
- package/dist/{chunk-4MJ7M6YL.js → chunk-5X6YQA2J.js} +7 -7
- package/dist/{chunk-JJUOHGX2.js → chunk-65WJYYKJ.js} +4 -4
- package/dist/{chunk-3UIKSPFB.js → chunk-6BQFET7X.js} +3 -3
- package/dist/{chunk-U2HGPLZS.js → chunk-6H7O2OPM.js} +14 -1
- package/dist/{chunk-DZXYF2F5.js → chunk-6K2M4VSR.js} +3 -3
- package/dist/{chunk-PGEGPSCZ.js → chunk-6MNGECP2.js} +2 -2
- package/dist/{chunk-3XPUDB7B.js → chunk-6NFYEQDX.js} +266 -38
- package/dist/{chunk-4XK3FLFB.js → chunk-6NYWYNBI.js} +3 -3
- package/dist/{chunk-TWQUYVP3.js → chunk-7DF4J4RL.js} +4 -4
- package/dist/{chunk-H73FP42Q.js → chunk-7DYOELRK.js} +3 -3
- package/dist/{chunk-L3UHP6TD.js → chunk-7L4UJOY6.js} +1 -2
- package/dist/{chunk-QJP6PG7F.js → chunk-AB7INMR5.js} +9 -9
- package/dist/{chunk-3LKM6FMW.js → chunk-AE7II3E3.js} +2 -2
- package/dist/{chunk-BTUTZMPT.js → chunk-AFIEPDLX.js} +97 -42
- package/dist/chunk-APKUAJ2L.js +220 -0
- package/dist/{chunk-X6EZPSW6.js → chunk-AXW3M6OQ.js} +7 -7
- package/dist/{chunk-66RUL3XF.js → chunk-B63YB7X3.js} +5 -5
- package/dist/{chunk-DSWVNQVS.js → chunk-BGP54HVR.js} +4 -59
- package/dist/{chunk-3NODSS6A.js → chunk-BYJBIALT.js} +7 -7
- package/dist/{chunk-3YPY3OXD.js → chunk-CC4YRBWV.js} +2 -2
- package/dist/{chunk-HLJVEAOF.js → chunk-DY7XLRHK.js} +8 -33
- package/dist/{chunk-OMNGQPEZ.js → chunk-E7Y3SYKW.js} +3 -3
- package/dist/{chunk-HTMN2Z6U.js → chunk-EDA6C7MV.js} +50 -7
- package/dist/{chunk-7L3R6I3U.js → chunk-ENRS56GC.js} +3 -3
- package/dist/{chunk-2KGXHFYK.js → chunk-EXOQP75F.js} +7 -7
- package/dist/{chunk-BBGDM4NQ.js → chunk-F3FYUFUH.js} +26 -8
- package/dist/{chunk-GL5UZ6NY.js → chunk-FC5I2KXV.js} +3 -3
- package/dist/{chunk-VVW3F3MD.js → chunk-FTBZV6NE.js} +9 -9
- package/dist/{chunk-7QKLIMRZ.js → chunk-G3PF3S7P.js} +41 -46
- package/dist/{chunk-J6K7RP6P.js → chunk-GD6L76WD.js} +3 -3
- package/dist/{chunk-I2WKW7C7.js → chunk-GGHRAITI.js} +3 -3
- package/dist/{chunk-DN66GPY5.js → chunk-GNSFLJAA.js} +24 -3
- package/dist/{chunk-IUMPEA64.js → chunk-GROLTAWZ.js} +4 -4
- package/dist/{chunk-Q4V4XQWV.js → chunk-GTWKD3QT.js} +2 -2
- package/dist/{chunk-F2L5GCQ4.js → chunk-GU46PPT3.js} +3 -3
- package/dist/{chunk-6IUAK7RZ.js → chunk-H6PI3KJT.js} +2 -2
- package/dist/{chunk-SCQ5VPUF.js → chunk-HFMYN6N2.js} +2 -2
- package/dist/{chunk-GKC3HILQ.js → chunk-I2QZFCS2.js} +27 -4
- package/dist/{chunk-MCZ5LBZD.js → chunk-IE477RQZ.js} +7 -7
- package/dist/{chunk-3Y2DRD7S.js → chunk-IEDMFNU7.js} +3 -3
- package/dist/{chunk-M5RXSRO2.js → chunk-IEWG6J7C.js} +4 -4
- package/dist/{chunk-P7CE7LXL.js → chunk-IUJODQKX.js} +6 -6
- package/dist/{chunk-NWED7CYO.js → chunk-IUO34HKW.js} +6 -6
- package/dist/{chunk-NX4EQS3U.js → chunk-J76PIKAT.js} +2 -2
- package/dist/{chunk-O7WP4ZD4.js → chunk-JED6ZDEE.js} +2 -2
- package/dist/{chunk-6BFZKBGD.js → chunk-JJXGQIRV.js} +2 -2
- package/dist/{chunk-O7NUCTFU.js → chunk-JM4LEPY3.js} +2 -2
- package/dist/{chunk-VDOOQZUD.js → chunk-JSSX2SX4.js} +4 -4
- package/dist/{chunk-SQLNBA64.js → chunk-KFNWFNAA.js} +3 -3
- package/dist/{chunk-KQ57MHRO.js → chunk-KJGG2JKQ.js} +143 -82
- package/dist/{chunk-OTAL43EH.js → chunk-LV4BETUU.js} +8 -2
- package/dist/{chunk-VUJGMJE6.js → chunk-MVN25IF6.js} +4 -4
- package/dist/{chunk-CLD2OKV7.js → chunk-MX2EY5Y7.js} +2 -2
- package/dist/{chunk-T5SHNNGP.js → chunk-ND76YJCN.js} +59 -25
- package/dist/{chunk-KFZYNWWO.js → chunk-NEQ6GJXB.js} +4 -4
- package/dist/{chunk-PFHVU7UA.js → chunk-NI3XQBPB.js} +2 -2
- package/dist/{chunk-WW32K72E.js → chunk-OJTXTQA2.js} +9 -9
- package/dist/{chunk-YNRDWYZP.js → chunk-OQKP2X3D.js} +170 -51
- package/dist/{chunk-AHGF2YYA.js → chunk-OTOHI4JO.js} +2 -2
- package/dist/{chunk-HEVYAHLW.js → chunk-OU7HLO7I.js} +4 -4
- package/dist/{chunk-GBE54KY6.js → chunk-OZPBJM5Q.js} +3 -3
- package/dist/{chunk-EOFPYPAU.js → chunk-P3NRSSUU.js} +51 -11
- package/dist/{chunk-TSA237IM.js → chunk-PZDBOK2Q.js} +2 -2
- package/dist/{chunk-3P2DKJCG.js → chunk-Q62FEYK3.js} +2 -2
- package/dist/{chunk-DFTFPYUD.js → chunk-QHI5XVUJ.js} +7 -7
- package/dist/{chunk-HQCHYB5F.js → chunk-QOOUC2J5.js} +2 -2
- package/dist/{chunk-XEGTMVYY.js → chunk-QZPEGJOM.js} +2 -2
- package/dist/{chunk-TN35C5KM.js → chunk-RAHVMKBG.js} +2 -2
- package/dist/chunk-RBDIYLA5.js +267 -0
- package/dist/{chunk-OTQKUHRS.js → chunk-RBHWPDBB.js} +3 -3
- package/dist/{chunk-BH3UYK36.js → chunk-RLFVAKEO.js} +3 -3
- package/dist/{chunk-3LH5CLP4.js → chunk-RXKTSFDL.js} +150 -5
- package/dist/{chunk-RZ6YKEUJ.js → chunk-TK2VQQX2.js} +6 -6
- package/dist/{chunk-I7F2A35O.js → chunk-TMACGPW5.js} +25 -47
- package/dist/{chunk-5GJYGP5Z.js → chunk-TRM2J7ZN.js} +8 -8
- package/dist/{chunk-BCYVE3N5.js → chunk-TYS6CSS5.js} +2 -2
- package/dist/{chunk-5WFIYXQ6.js → chunk-U5SI5NIM.js} +91 -228
- package/dist/{chunk-KHEYDLMT.js → chunk-VB4UJ3H2.js} +2 -2
- package/dist/{chunk-HGN652MU.js → chunk-VL2O2F3W.js} +2 -2
- package/dist/{chunk-ONA5KPV3.js → chunk-VNSXLA6G.js} +4 -4
- package/dist/{chunk-CMCR5WBW.js → chunk-WBRZJOEC.js} +3 -3
- package/dist/{chunk-5LWQH6QV.js → chunk-WCT3NYCV.js} +1 -1
- package/dist/{chunk-T4VOVZT5.js → chunk-WJ7RW65H.js} +4 -4
- package/dist/{chunk-SCHXJTZL.js → chunk-WQLMU7VG.js} +2 -2
- package/dist/{chunk-C4GQDB5L.js → chunk-WRNFDFPU.js} +2 -2
- package/dist/{chunk-66NVRO4K.js → chunk-X7EC3L2H.js} +7 -7
- package/dist/{chunk-QXKWYZNR.js → chunk-XEQXCIBC.js} +3 -3
- package/dist/{chunk-C63UWAKM.js → chunk-Y2ZE3MSG.js} +2 -2
- package/dist/{chunk-FA6K3FWM.js → chunk-Y6GBQTBK.js} +6 -6
- package/dist/{chunk-7UEMZREK.js → chunk-YAA6IID3.js} +2 -2
- package/dist/{chunk-PZFVK3IH.js → chunk-YGJZWZTY.js} +2 -2
- package/dist/{chunk-7TV5Y53Y.js → chunk-ZJ3LS7DW.js} +3 -3
- package/dist/{chunk-PH5X4GIP.js → chunk-ZO27FGJS.js} +2 -2
- package/dist/cli.cjs +163 -147
- package/dist/clock.js +91 -5
- package/dist/countdown.js +208 -82
- package/dist/dgmo-router-Y2VEX46B.js +86 -0
- package/dist/dimensions-F7B5C4BJ.js +22 -0
- package/dist/editor.js +14 -1
- package/dist/element.d.ts +6 -0
- package/dist/element.js +170 -134
- package/dist/element.mjs +2112 -1009
- package/dist/{flowchart-parser-OE4WHLTF.js → flowchart-parser-MY53QWTZ.js} +4 -4
- package/dist/{flowchart-renderer-GPCSMTOR.js → flowchart-renderer-AQSMEMYF.js} +8 -8
- package/dist/highlight.js +14 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.js +55 -53
- package/dist/{layout-7SKMFYHL.js → layout-46N4JJYK.js} +5 -5
- package/dist/layout-4DIUOX2T.js +14 -0
- package/dist/{layout-7H4H46CS.js → layout-7QXCNOVS.js} +3 -3
- package/dist/{layout-NXG63LWH.js → layout-AM2JWW3X.js} +4 -4
- package/dist/{layout-7MZ5NF2N.js → layout-CBCLPMSG.js} +5 -5
- package/dist/{layout-DC4TVXER.js → layout-EE6GE46Y.js} +5 -5
- package/dist/{layout-FGQWRYYW.js → layout-F4WO357A.js} +3 -3
- package/dist/layout-G23F7LDH.js +9 -0
- package/dist/{layout-QNUQLEHU.js → layout-HYZPWAK5.js} +3 -3
- package/dist/{layout-FWODLIMP.js → layout-JDJAEQ3P.js} +6 -6
- package/dist/layout-MUPRALE5.js +14 -0
- package/dist/{layout-34CLNICW.js → layout-OAC4PEAC.js} +5 -5
- package/dist/{layout-5BG6DFCU.js → layout-YVTNOTN4.js} +6 -6
- package/dist/{layout-PUQCB6AN.js → layout-ZDOSXL5G.js} +7 -7
- package/dist/{layout-search-QS44PI5R.js → layout-search-55FU6HD3.js} +6 -157
- package/dist/map-data/gazetteer.json +1 -1
- package/dist/{parser-36HVKU5U.js → parser-2Q2T4C3B.js} +6 -5
- package/dist/{parser-B5FVS7O6.js → parser-3A42DZ72.js} +3 -3
- package/dist/{parser-CSFUN3CT.js → parser-4RFTKAQX.js} +5 -4
- package/dist/{parser-IJBMRXMC.js → parser-57ILIFZ2.js} +5 -5
- package/dist/{parser-DFFEDKHH.js → parser-5A2UWU6B.js} +3 -3
- package/dist/{parser-H3XEPFPV.js → parser-5PDYJGWA.js} +4 -4
- package/dist/{parser-O4HIUN6G.js → parser-6BJEXUFX.js} +4 -4
- package/dist/{parser-MTOMTWTD.js → parser-6ZKABF5S.js} +6 -5
- package/dist/{parser-WAV5JRPT.js → parser-AIMHGJRR.js} +4 -4
- package/dist/{parser-TXND652E.js → parser-AZJ25OKK.js} +4 -4
- package/dist/{parser-4AI5ZN5F.js → parser-B77S5SZM.js} +3 -3
- package/dist/{parser-IBWNAPY4.js → parser-BEPSWJAD.js} +3 -3
- package/dist/{parser-D5VILGN2.js → parser-BKI42XBQ.js} +4 -4
- package/dist/{parser-LWKKBNSA.js → parser-C3D7MVXY.js} +3 -3
- package/dist/{parser-HYRTF3DO.js → parser-CDG7CHV5.js} +3 -3
- package/dist/{parser-CVMEDULU.js → parser-CZOJ7XQ6.js} +4 -4
- package/dist/{parser-AXKBDGNO.js → parser-E2RL6JYF.js} +5 -5
- package/dist/{parser-PSA4UBSP.js → parser-EH5VE7ZN.js} +4 -4
- package/dist/{parser-K3XXLMUW.js → parser-FQ6GZFMR.js} +4 -4
- package/dist/{parser-RV4M6AS2.js → parser-GKLZKEIK.js} +4 -4
- package/dist/{parser-MPCE5JBG.js → parser-H6ABKHZZ.js} +4 -4
- package/dist/{parser-RZPVAQVX.js → parser-I6GGFKOQ.js} +4 -3
- package/dist/{parser-W4PQUGX3.js → parser-JA7JQ7NF.js} +4 -4
- package/dist/{parser-5OXGPNBF.js → parser-KKTJ6M3Y.js} +5 -5
- package/dist/parser-OK22AC6Y.js +14 -0
- package/dist/{parser-4NO6VZ6S.js → parser-OK2ILHRT.js} +4 -4
- package/dist/{parser-YS7TOS2K.js → parser-OUTPNJWC.js} +3 -3
- package/dist/{parser-KCR2WS3V.js → parser-PORDUX5E.js} +4 -4
- package/dist/{parser-VKOJM7KS.js → parser-SRVFR7PM.js} +4 -4
- package/dist/{parser-TGQZJ5OT.js → parser-UKFFZCFJ.js} +4 -4
- package/dist/{parser-JJR52VAT.js → parser-UMWPLORP.js} +5 -5
- package/dist/{parser-AGVYTQXV.js → parser-Z4TZV2CB.js} +4 -4
- package/dist/{renderer-A5VE5BCI.js → renderer-2AUFT3E2.js} +8 -8
- package/dist/{renderer-FPE3J5VZ.js → renderer-2HTNBIF2.js} +11 -11
- package/dist/{renderer-R2WNIC2C.js → renderer-3K3IB7D5.js} +8 -8
- package/dist/{renderer-2AZ5HJFK.js → renderer-3YNIWF5I.js} +4 -4
- package/dist/{renderer-P5ROYQGU.js → renderer-3YPZHMOU.js} +3 -3
- package/dist/{renderer-JCCHNECZ.js → renderer-4WR6WMVF.js} +9 -9
- package/dist/{renderer-HDCCZURL.js → renderer-66MERVQ2.js} +9 -9
- package/dist/{renderer-2QPMJ2DA.js → renderer-6RKQPNJI.js} +9 -9
- package/dist/{renderer-FYSVXL7M.js → renderer-ARMJBP6C.js} +11 -11
- package/dist/{renderer-6OKF44KS.js → renderer-CO2DW7S7.js} +13 -13
- package/dist/{renderer-BSR2O2H6.js → renderer-EDJ2O4S5.js} +13 -12
- package/dist/{renderer-CYB4LK3G.js → renderer-F7U3MFCV.js} +9 -9
- package/dist/{renderer-5KVCNMOJ.js → renderer-GD2COXVL.js} +4 -2
- package/dist/{renderer-B5TBNZJE.js → renderer-GQIESYEM.js} +8 -8
- package/dist/{renderer-ODUUOPVT.js → renderer-HCKJDFXD.js} +13 -13
- package/dist/{renderer-QAOBLRXV.js → renderer-HYGHO4SJ.js} +10 -10
- package/dist/{renderer-5DSEWF74.js → renderer-JC3RDUT7.js} +8 -8
- package/dist/{renderer-7RH2SI3B.js → renderer-KQB7UGDS.js} +3 -3
- package/dist/{renderer-45PSOL3E.js → renderer-NKJ24TEA.js} +5 -5
- package/dist/{renderer-AUW2BE6G.js → renderer-OYO67VZK.js} +9 -9
- package/dist/{renderer-DAXMXIKD.js → renderer-QIWVHWZO.js} +3 -3
- package/dist/{renderer-PSMMZCKH.js → renderer-QRWACQRI.js} +8 -8
- package/dist/{renderer-4ITCHBT7.js → renderer-QXGN5H3A.js} +5 -5
- package/dist/renderer-QXPP4TA2.js +27 -0
- package/dist/{renderer-KS7YZJE2.js → renderer-RGIYOTKJ.js} +10 -10
- package/dist/{renderer-FF24KZCI.js → renderer-RHT4MHFU.js} +8 -8
- package/dist/{renderer-PPIHO5FI.js → renderer-RYR3TJ46.js} +12 -11
- package/dist/{renderer-NGXZTRK6.js → renderer-SRKDNDFB.js} +8 -8
- package/dist/{renderer-SBS3YWU5.js → renderer-TGTUABCI.js} +8 -8
- package/dist/{renderer-7SD6MSBS.js → renderer-TXJFKPOG.js} +11 -11
- package/dist/{renderer-HVCU2C3Z.js → renderer-UV6MI64M.js} +3 -3
- package/dist/renderer-radial-FWABAZHB.js +21 -0
- package/dist/{resolver-FHBCO3PL.js → resolver-EMTGNR3D.js} +4 -3
- package/dist/{state-parser-3REXRK3R.js → state-parser-6T6CNMPX.js} +4 -4
- package/dist/{state-renderer-XYLNRWXR.js → state-renderer-AWZ3ECAX.js} +8 -8
- package/dist/{themes-PdPR1-hC.d.ts → themes-32xj5ZTW.d.ts} +27 -0
- package/docs/language-reference.md +93 -10
- package/gallery/fixtures/clock.dgmo +3 -3
- package/gallery/fixtures/countdown-tz.dgmo +5 -0
- package/package.json +1 -1
- package/dist/dgmo-router-CE2G67FV.js +0 -84
- package/dist/dimensions-OTBKC5M6.js +0 -22
- package/dist/layout-6RDJHS6E.js +0 -9
- package/dist/layout-J36454XU.js +0 -14
- package/dist/layout-LD6XTLD6.js +0 -14
- package/dist/parser-4WQQQXCG.js +0 -13
- package/dist/renderer-UYMQQCJK.js +0 -24
- package/dist/renderer-radial-F7X5F2VU.js +0 -21
|
@@ -1,66 +1,44 @@
|
|
|
1
|
+
import {
|
|
2
|
+
parseDateToken,
|
|
3
|
+
toInternal
|
|
4
|
+
} from "./chunk-RBDIYLA5.js";
|
|
1
5
|
import {
|
|
2
6
|
TIMELINE_REGISTRY,
|
|
3
7
|
splitNameAndMeta,
|
|
4
8
|
warnUnknownMetaKeys,
|
|
5
9
|
withTagAliases
|
|
6
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-LV4BETUU.js";
|
|
7
11
|
import {
|
|
8
12
|
makeDgmoError
|
|
9
13
|
} from "./chunk-CXK4DZH3.js";
|
|
10
14
|
|
|
11
15
|
// src/timeline/parser.ts
|
|
12
16
|
var TIMELINE_DURATION_RE = /^(\d+(?:\.\d{1,2})?)(min|[dwmyhs])(\?)?$/;
|
|
13
|
-
var DATE_RE = /^(\d{4}(?:-\d{2}(?:-\d{2})?)?)/;
|
|
14
|
-
var TIME_RE = /^\s+(\d{1,2}:\d{2}(?::\d{2})?)/;
|
|
15
17
|
var ARROW_RE = /^\s*(?:->|–>)\s*/;
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
const
|
|
20
|
-
const
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
const date2 = (bce ? "-" : "") + eraMatch[1];
|
|
31
|
-
return {
|
|
32
|
-
date: date2,
|
|
33
|
-
rest: input.slice(eraMatch[0].length),
|
|
34
|
-
timeValid: true,
|
|
35
|
-
invalidTime: void 0
|
|
36
|
-
};
|
|
37
|
-
}
|
|
38
|
-
const dateMatch = input.match(DATE_RE);
|
|
39
|
-
if (!dateMatch) return null;
|
|
40
|
-
let date = dateMatch[1];
|
|
41
|
-
let rest = input.slice(date.length);
|
|
42
|
-
let timeValid = true;
|
|
43
|
-
let invalidTime;
|
|
44
|
-
const timeMatch = rest.match(TIME_RE);
|
|
45
|
-
if (timeMatch) {
|
|
46
|
-
const timeStr = timeMatch[1];
|
|
47
|
-
const { valid } = parseTime(timeStr);
|
|
48
|
-
timeValid = valid;
|
|
49
|
-
if (!valid) invalidTime = timeStr;
|
|
50
|
-
date = `${date} ${timeStr}`;
|
|
51
|
-
rest = rest.slice(timeMatch[0].length);
|
|
52
|
-
}
|
|
53
|
-
return { date, rest, timeValid, invalidTime };
|
|
18
|
+
function parseDateWithOptionalTime(input, ctx) {
|
|
19
|
+
const res = parseDateToken(input, { dateOrder: ctx?.order });
|
|
20
|
+
if (!res) return null;
|
|
21
|
+
const { token, consumed } = res;
|
|
22
|
+
const internal = ctx?.resolve ? ctx.resolve(token).internal : toInternal(
|
|
23
|
+
token,
|
|
24
|
+
token.year ?? ctx?.currentYear ?? (/* @__PURE__ */ new Date()).getFullYear()
|
|
25
|
+
);
|
|
26
|
+
return {
|
|
27
|
+
date: internal,
|
|
28
|
+
rest: input.slice(consumed),
|
|
29
|
+
timeValid: !token.invalidTime,
|
|
30
|
+
invalidTime: token.invalidTime
|
|
31
|
+
};
|
|
54
32
|
}
|
|
55
|
-
function extractDatePrefix(line) {
|
|
56
|
-
const startResult = parseDateWithOptionalTime(line);
|
|
33
|
+
function extractDatePrefix(line, ctx) {
|
|
34
|
+
const startResult = parseDateWithOptionalTime(line, ctx);
|
|
57
35
|
if (!startResult) return null;
|
|
58
36
|
const { date: startDate } = startResult;
|
|
59
37
|
let { rest } = startResult;
|
|
60
38
|
const arrowMatch = rest.match(ARROW_RE);
|
|
61
39
|
if (arrowMatch) {
|
|
62
40
|
rest = rest.slice(arrowMatch[0].length);
|
|
63
|
-
const endResult = parseDateWithOptionalTime(rest);
|
|
41
|
+
const endResult = parseDateWithOptionalTime(rest, ctx);
|
|
64
42
|
if (endResult) {
|
|
65
43
|
let uncertain = false;
|
|
66
44
|
let afterEnd = endResult.rest;
|
|
@@ -209,9 +187,9 @@ function parseTimelineDate(s) {
|
|
|
209
187
|
const yearBase = p.sign * p.year;
|
|
210
188
|
return yearBase + (p.month - 1) / 12 + (p.day - 1) / 365 + p.hour / 8760 + p.minute / 525600 + p.second / 31536e3;
|
|
211
189
|
}
|
|
212
|
-
function parseTimelineEventLine(line, lineNumber, currentGroup, groupMetadata, aliasMap, registry) {
|
|
190
|
+
function parseTimelineEventLine(line, lineNumber, currentGroup, groupMetadata, aliasMap, registry, dateCtx) {
|
|
213
191
|
const diagnostics = [];
|
|
214
|
-
const prefix = extractDatePrefix(line);
|
|
192
|
+
const prefix = extractDatePrefix(line, dateCtx);
|
|
215
193
|
if (!prefix) {
|
|
216
194
|
if (/^\d/.test(line)) {
|
|
217
195
|
const firstToken = line.split(/\s/)[0];
|
|
@@ -336,4 +314,4 @@ export {
|
|
|
336
314
|
parseTimelineDate,
|
|
337
315
|
parseTimelineEventLine
|
|
338
316
|
};
|
|
339
|
-
//# sourceMappingURL=chunk-
|
|
317
|
+
//# sourceMappingURL=chunk-TMACGPW5.js.map
|
|
@@ -3,7 +3,7 @@ import {
|
|
|
3
3
|
} from "./chunk-A44USUV7.js";
|
|
4
4
|
import {
|
|
5
5
|
layoutInfra
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-Y2ZE3MSG.js";
|
|
7
7
|
import {
|
|
8
8
|
renderInlineText
|
|
9
9
|
} from "./chunk-3HDBAXF5.js";
|
|
@@ -18,10 +18,10 @@ import {
|
|
|
18
18
|
} from "./chunk-YYVTBZZC.js";
|
|
19
19
|
import {
|
|
20
20
|
renderIntegratedLegend
|
|
21
|
-
} from "./chunk-
|
|
21
|
+
} from "./chunk-OU7HLO7I.js";
|
|
22
22
|
import {
|
|
23
23
|
getMaxLegendReservedHeight
|
|
24
|
-
} from "./chunk-
|
|
24
|
+
} from "./chunk-YAA6IID3.js";
|
|
25
25
|
import {
|
|
26
26
|
TITLE_FONT_SIZE,
|
|
27
27
|
TITLE_FONT_WEIGHT,
|
|
@@ -41,15 +41,15 @@ import {
|
|
|
41
41
|
LEGEND_PILL_FONT_SIZE,
|
|
42
42
|
LEGEND_PILL_PAD,
|
|
43
43
|
measureLegendText
|
|
44
|
-
} from "./chunk-
|
|
44
|
+
} from "./chunk-QOOUC2J5.js";
|
|
45
45
|
import {
|
|
46
46
|
CHAR_WIDTH_RATIO,
|
|
47
47
|
measureText,
|
|
48
48
|
truncateText
|
|
49
|
-
} from "./chunk-
|
|
49
|
+
} from "./chunk-WCT3NYCV.js";
|
|
50
50
|
import {
|
|
51
51
|
parseInfra
|
|
52
|
-
} from "./chunk-
|
|
52
|
+
} from "./chunk-MVN25IF6.js";
|
|
53
53
|
import {
|
|
54
54
|
preprocessDescriptionLine
|
|
55
55
|
} from "./chunk-IYULMRBE.js";
|
|
@@ -60,7 +60,7 @@ import {
|
|
|
60
60
|
} from "./chunk-P6T66CCZ.js";
|
|
61
61
|
import {
|
|
62
62
|
tagAttrKey
|
|
63
|
-
} from "./chunk-
|
|
63
|
+
} from "./chunk-467TVMQL.js";
|
|
64
64
|
import {
|
|
65
65
|
resolveColor
|
|
66
66
|
} from "./chunk-TLVIHFRO.js";
|
|
@@ -1561,4 +1561,4 @@ export {
|
|
|
1561
1561
|
renderInfra,
|
|
1562
1562
|
parseAndLayoutInfra
|
|
1563
1563
|
};
|
|
1564
|
-
//# sourceMappingURL=chunk-
|
|
1564
|
+
//# sourceMappingURL=chunk-TRM2J7ZN.js.map
|
|
@@ -12,7 +12,7 @@ import {
|
|
|
12
12
|
} from "./chunk-BMR4CIEO.js";
|
|
13
13
|
import {
|
|
14
14
|
measureText
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-WCT3NYCV.js";
|
|
16
16
|
|
|
17
17
|
// src/utils/note-box/metrics.ts
|
|
18
18
|
function normalizeBulletLine(line) {
|
|
@@ -49,4 +49,4 @@ export {
|
|
|
49
49
|
wrapNoteBody,
|
|
50
50
|
noteBoxSize
|
|
51
51
|
};
|
|
52
|
-
//# sourceMappingURL=chunk-
|
|
52
|
+
//# sourceMappingURL=chunk-TYS6CSS5.js.map
|
|
@@ -1,3 +1,15 @@
|
|
|
1
|
+
import {
|
|
2
|
+
buildSwatches
|
|
3
|
+
} from "./chunk-4XFBQT5O.js";
|
|
4
|
+
import {
|
|
5
|
+
fixedParts,
|
|
6
|
+
formatTime,
|
|
7
|
+
handAngles,
|
|
8
|
+
rampColor,
|
|
9
|
+
sunLine,
|
|
10
|
+
workStatus,
|
|
11
|
+
zoneParts
|
|
12
|
+
} from "./chunk-APKUAJ2L.js";
|
|
1
13
|
import {
|
|
2
14
|
FONT_FAMILY
|
|
3
15
|
} from "./chunk-6KFWC4CO.js";
|
|
@@ -11,167 +23,9 @@ import {
|
|
|
11
23
|
|
|
12
24
|
// src/clock/renderer.ts
|
|
13
25
|
import * as d3Selection from "d3-selection";
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
var CLOCK_RAMP = [
|
|
17
|
-
[0, "#3d478f"],
|
|
18
|
-
[4, "#4a4d8c"],
|
|
19
|
-
[6, "#c98a6b"],
|
|
20
|
-
[8, "#d9a441"],
|
|
21
|
-
[11, "#e0b23c"],
|
|
22
|
-
[13, "#4f96c4"],
|
|
23
|
-
[16, "#cc7a33"],
|
|
24
|
-
[19, "#8a5aa0"],
|
|
25
|
-
[24, "#3d478f"]
|
|
26
|
-
];
|
|
27
|
-
function hexLerp(a, b, t) {
|
|
28
|
-
const pa = [1, 3, 5].map((i) => parseInt(a.slice(i, i + 2), 16));
|
|
29
|
-
const pb = [1, 3, 5].map((i) => parseInt(b.slice(i, i + 2), 16));
|
|
30
|
-
const c = pa.map(
|
|
31
|
-
(v, i) => Math.round(v + (pb[i] - v) * t).toString(16).padStart(2, "0")
|
|
32
|
-
);
|
|
33
|
-
return `#${c.join("")}`;
|
|
34
|
-
}
|
|
35
|
-
function rampColor(h) {
|
|
36
|
-
const hh = (h % 24 + 24) % 24;
|
|
37
|
-
for (let i = 0; i < CLOCK_RAMP.length - 1; i++) {
|
|
38
|
-
const [h0, c0] = CLOCK_RAMP[i];
|
|
39
|
-
const [h1, c1] = CLOCK_RAMP[i + 1];
|
|
40
|
-
if (hh >= h0 && hh <= h1) return hexLerp(c0, c1, (hh - h0) / (h1 - h0));
|
|
41
|
-
}
|
|
42
|
-
return CLOCK_RAMP[0][1];
|
|
43
|
-
}
|
|
44
|
-
var SOON_MIN = 60;
|
|
45
|
-
var RAD = Math.PI / 180;
|
|
46
|
-
var DAY_MS = 864e5;
|
|
47
|
-
var J1970 = 2440588;
|
|
48
|
-
var J2000 = 2451545;
|
|
49
|
-
function zoneParts(zone, nowMs) {
|
|
50
|
-
const d = new Date(nowMs);
|
|
51
|
-
try {
|
|
52
|
-
const o = {};
|
|
53
|
-
new Intl.DateTimeFormat("en-US", {
|
|
54
|
-
timeZone: zone,
|
|
55
|
-
hour12: false,
|
|
56
|
-
hour: "2-digit",
|
|
57
|
-
minute: "2-digit",
|
|
58
|
-
second: "2-digit",
|
|
59
|
-
weekday: "short"
|
|
60
|
-
}).formatToParts(d).forEach((x) => {
|
|
61
|
-
o[x.type] = x.value;
|
|
62
|
-
});
|
|
63
|
-
const off = new Intl.DateTimeFormat("en-US", {
|
|
64
|
-
timeZone: zone,
|
|
65
|
-
timeZoneName: "shortOffset"
|
|
66
|
-
}).formatToParts(d).find((x) => x.type === "timeZoneName");
|
|
67
|
-
return {
|
|
68
|
-
h: parseInt(o["hour"], 10) % 24,
|
|
69
|
-
m: parseInt(o["minute"], 10),
|
|
70
|
-
s: parseInt(o["second"], 10),
|
|
71
|
-
weekday: o["weekday"],
|
|
72
|
-
offsetLabel: off ? off.value.replace("GMT", "UTC") : ""
|
|
73
|
-
};
|
|
74
|
-
} catch {
|
|
75
|
-
return {
|
|
76
|
-
h: d.getUTCHours(),
|
|
77
|
-
m: d.getUTCMinutes(),
|
|
78
|
-
s: d.getUTCSeconds(),
|
|
79
|
-
weekday: ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"][d.getUTCDay()],
|
|
80
|
-
offsetLabel: "UTC"
|
|
81
|
-
};
|
|
82
|
-
}
|
|
83
|
-
}
|
|
84
|
-
function pad2(n) {
|
|
85
|
-
return n < 10 ? "0" + n : String(n);
|
|
86
|
-
}
|
|
87
|
-
function formatTime(h, m, s, hours12) {
|
|
88
|
-
const sec = pad2(s);
|
|
89
|
-
if (hours12) {
|
|
90
|
-
const ap = h < 12 ? "am" : "pm";
|
|
91
|
-
let hr = h % 12;
|
|
92
|
-
if (hr === 0) hr = 12;
|
|
93
|
-
return { main: `${hr}:${pad2(m)}`, sec, ap };
|
|
94
|
-
}
|
|
95
|
-
return { main: `${pad2(h)}:${pad2(m)}`, sec, ap: "" };
|
|
96
|
-
}
|
|
97
|
-
function fmtDelta(ms) {
|
|
98
|
-
const m = Math.max(0, Math.round(ms / 6e4));
|
|
99
|
-
if (m < 90) return `${m}m`;
|
|
100
|
-
return `${Math.floor(m / 60)}h ${m % 60}m`;
|
|
101
|
-
}
|
|
102
|
-
function workStatus(parts, work) {
|
|
103
|
-
if (!work) return null;
|
|
104
|
-
const min = parts.h * 60 + parts.m;
|
|
105
|
-
if (!work.days[parts.weekday]) return { cls: "off", text: "Weekend" };
|
|
106
|
-
if (min < work.startMin) {
|
|
107
|
-
const d = work.startMin - min;
|
|
108
|
-
return {
|
|
109
|
-
cls: d <= SOON_MIN ? "soon" : "off",
|
|
110
|
-
text: `starts in ${fmtDelta(d * 6e4)}`
|
|
111
|
-
};
|
|
112
|
-
}
|
|
113
|
-
if (min < work.endMin) {
|
|
114
|
-
return { cls: "ok", text: `${fmtDelta((work.endMin - min) * 6e4)} left` };
|
|
115
|
-
}
|
|
116
|
-
return {
|
|
117
|
-
cls: "off",
|
|
118
|
-
text: `ended ${fmtDelta((min - work.endMin) * 6e4)} ago`
|
|
119
|
-
};
|
|
120
|
-
}
|
|
121
|
-
function toJulian(ms) {
|
|
122
|
-
return ms / DAY_MS - 0.5 + J1970;
|
|
123
|
-
}
|
|
124
|
-
function fromJulian(j) {
|
|
125
|
-
return (j + 0.5 - J1970) * DAY_MS;
|
|
126
|
-
}
|
|
127
|
-
function sunTimes(nowMs, lat, lon) {
|
|
128
|
-
const lw = -lon * RAD;
|
|
129
|
-
const phi = lat * RAD;
|
|
130
|
-
const J = toJulian(nowMs);
|
|
131
|
-
const n = Math.round(J - J2000 - 9e-4 - lw / (2 * Math.PI));
|
|
132
|
-
const Jn = J2000 + 9e-4 + lw / (2 * Math.PI) + n;
|
|
133
|
-
const M = (357.5291 + 0.98560028 * (Jn - J2000)) * RAD;
|
|
134
|
-
const C = (1.9148 * Math.sin(M) + 0.02 * Math.sin(2 * M) + 3e-4 * Math.sin(3 * M)) * RAD;
|
|
135
|
-
const L = M + C + Math.PI + 102.9372 * RAD;
|
|
136
|
-
const Jt = Jn + 53e-4 * Math.sin(M) - 69e-4 * Math.sin(2 * L);
|
|
137
|
-
const dec = Math.asin(Math.sin(L) * Math.sin(23.44 * RAD));
|
|
138
|
-
const cw = (Math.sin(-0.833 * RAD) - Math.sin(phi) * Math.sin(dec)) / (Math.cos(phi) * Math.cos(dec));
|
|
139
|
-
if (cw > 1) return { polar: "night" };
|
|
140
|
-
if (cw < -1) return { polar: "day" };
|
|
141
|
-
const w = Math.acos(cw);
|
|
142
|
-
const Jset = J2000 + 9e-4 + (w + lw) / (2 * Math.PI) + n + 53e-4 * Math.sin(M) - 69e-4 * Math.sin(2 * L);
|
|
143
|
-
return {
|
|
144
|
-
sunriseMs: fromJulian(Jt - (Jset - Jt)),
|
|
145
|
-
sunsetMs: fromJulian(Jset)
|
|
146
|
-
};
|
|
26
|
+
function partsFor(entry, now) {
|
|
27
|
+
return entry.kind === "fixed" ? fixedParts(entry.fixedOffsetMin ?? 0, now) : zoneParts(entry.zone, now);
|
|
147
28
|
}
|
|
148
|
-
function sunLine(nowMs, lat, lon) {
|
|
149
|
-
const t = sunTimes(nowMs, lat, lon);
|
|
150
|
-
if (t.polar) {
|
|
151
|
-
return {
|
|
152
|
-
up: t.polar === "day",
|
|
153
|
-
text: t.polar === "day" ? "midnight sun" : "polar night"
|
|
154
|
-
};
|
|
155
|
-
}
|
|
156
|
-
if (nowMs < t.sunriseMs) {
|
|
157
|
-
return { up: false, text: `sunrise in ${fmtDelta(t.sunriseMs - nowMs)}` };
|
|
158
|
-
}
|
|
159
|
-
if (nowMs < t.sunsetMs) {
|
|
160
|
-
return { up: true, text: `sunset in ${fmtDelta(t.sunsetMs - nowMs)}` };
|
|
161
|
-
}
|
|
162
|
-
const tm = sunTimes(nowMs + DAY_MS, lat, lon);
|
|
163
|
-
if (tm.polar) return { up: false, text: "sunrise in \u2014" };
|
|
164
|
-
return { up: false, text: `sunrise in ${fmtDelta(tm.sunriseMs - nowMs)}` };
|
|
165
|
-
}
|
|
166
|
-
function handAngles(h, m, s) {
|
|
167
|
-
return {
|
|
168
|
-
hour: (h % 12 + m / 60) * 30,
|
|
169
|
-
minute: (m + s / 60) * 6,
|
|
170
|
-
second: s * 6
|
|
171
|
-
};
|
|
172
|
-
}
|
|
173
|
-
|
|
174
|
-
// src/clock/renderer.ts
|
|
175
29
|
var PLACE_ACCENTS = [
|
|
176
30
|
"blue",
|
|
177
31
|
"green",
|
|
@@ -275,34 +129,18 @@ function daysLabel(days) {
|
|
|
275
129
|
return "Mon\u2013Fri";
|
|
276
130
|
return on.join(", ");
|
|
277
131
|
}
|
|
278
|
-
function buildSwatches(palette, muted) {
|
|
279
|
-
const bg = palette.bg;
|
|
280
|
-
const day = resolveColor("orange", palette) ?? "#d98a1f";
|
|
281
|
-
const night = resolveColor("blue", palette) ?? "#4864b0";
|
|
282
|
-
const ok = resolveColor("green", palette) ?? "#3f9e59";
|
|
283
|
-
const soon = resolveColor("orange", palette) ?? "#c9761a";
|
|
284
|
-
return {
|
|
285
|
-
day,
|
|
286
|
-
night,
|
|
287
|
-
dayTint: mix(day, bg, 14),
|
|
288
|
-
nightTint: mix(night, bg, 14),
|
|
289
|
-
ok,
|
|
290
|
-
soon,
|
|
291
|
-
off: muted,
|
|
292
|
-
okSoft: mix(ok, bg, 14),
|
|
293
|
-
soonSoft: mix(soon, bg, 14),
|
|
294
|
-
offSoft: mix(muted, bg, 16),
|
|
295
|
-
// Sundown indicator: a yellow sun by day, a blue moon by night.
|
|
296
|
-
sunIcon: resolveColor("yellow", palette) ?? "#f4b400",
|
|
297
|
-
moonIcon: night
|
|
298
|
-
};
|
|
299
|
-
}
|
|
300
132
|
function renderClock(container, parsed, palette, isDark, exportDims) {
|
|
301
133
|
d3Selection.select(container).selectAll(":not([data-d3-tooltip])").remove();
|
|
302
134
|
const avail = exportDims?.width ?? container.clientWidth;
|
|
303
135
|
const heightHint = exportDims?.height ?? container.clientHeight;
|
|
304
136
|
if (avail <= 0) return;
|
|
305
|
-
const
|
|
137
|
+
const cardM = 8;
|
|
138
|
+
const baseWidth = Math.min(720, Math.max(460, avail));
|
|
139
|
+
const COL_MIN_W = 190;
|
|
140
|
+
const width = exportDims?.width ?? (parsed.columns ? Math.max(
|
|
141
|
+
baseWidth,
|
|
142
|
+
COL_MIN_W * Math.max(1, parsed.entries.length) + 2 * cardM
|
|
143
|
+
) : baseWidth);
|
|
306
144
|
const now = Date.now();
|
|
307
145
|
const baseBg = themeBaseBg(palette, isDark);
|
|
308
146
|
const muted = mix(palette.text, baseBg, 55);
|
|
@@ -316,7 +154,6 @@ function renderClock(container, parsed, palette, isDark, exportDims) {
|
|
|
316
154
|
const rowH = 84;
|
|
317
155
|
const svg = d3Selection.select(container).append("svg").attr("width", width).attr("preserveAspectRatio", "xMidYMid meet").attr("xmlns", "http://www.w3.org/2000/svg").attr("role", "img").attr("aria-label", `${parsed.title ?? "Clock"} \u2014 world clocks`).style("font-family", FONT_FAMILY);
|
|
318
156
|
const bgRect = svg.append("rect").attr("width", width).attr("fill", palette.bg);
|
|
319
|
-
const cardM = 8;
|
|
320
157
|
const card = svg.append("rect").attr("x", cardM).attr("y", cardM).attr("width", width - 2 * cardM).attr("rx", 14).attr("fill", cardFill).attr("stroke", mix(palette.text, palette.bg, 40)).attr("stroke-width", 1);
|
|
321
158
|
clipSeq += 1;
|
|
322
159
|
const clipId = `dgmo-clock-clip-${clipSeq}`;
|
|
@@ -357,7 +194,7 @@ function renderClock(container, parsed, palette, isDark, exportDims) {
|
|
|
357
194
|
if (parsed.face === "digital") {
|
|
358
195
|
let secW = 0;
|
|
359
196
|
for (const e of parsed.entries) {
|
|
360
|
-
const p =
|
|
197
|
+
const p = partsFor(e, now);
|
|
361
198
|
const t = formatTime(p.h, p.m, p.s, parsed.hours12);
|
|
362
199
|
mainW = Math.max(mainW, estWidth(t.main, 48));
|
|
363
200
|
secW = Math.max(secW, estWidth(`:${t.sec}`, 16), estWidth(t.ap, 16));
|
|
@@ -390,7 +227,7 @@ function drawRow(svg, entry, index, parsed, now, rowTop, rowH, geom, col) {
|
|
|
390
227
|
const { padX } = geom;
|
|
391
228
|
const { text, muted, line2, tick, sw, cardFill } = col;
|
|
392
229
|
const center = rowTop + rowH / 2;
|
|
393
|
-
const parts =
|
|
230
|
+
const parts = partsFor(entry, now);
|
|
394
231
|
const hasCoords = entry.lat !== null && entry.lon !== null;
|
|
395
232
|
const sun = parsed.sun && hasCoords ? sunLine(now, entry.lat, entry.lon) : null;
|
|
396
233
|
const up = sun ? sun.up : parts.h >= 6 && parts.h < 18;
|
|
@@ -415,11 +252,13 @@ function drawRow(svg, entry, index, parsed, now, rowTop, rowH, geom, col) {
|
|
|
415
252
|
const rightColLeft = geom.rightX - rightBlockW;
|
|
416
253
|
const g = svg.append("g").attr("data-line-number", entry.lineNumber);
|
|
417
254
|
if (auto) {
|
|
418
|
-
g.append("rect").attr("x", 9).attr("y", rowTop).attr("width", geom.width - 18).attr("height", rowH).attr("fill", auto.laneTint);
|
|
255
|
+
g.append("rect").attr("data-dgmo-clock-lane", "").attr("x", 9).attr("y", rowTop).attr("width", geom.width - 18).attr("height", rowH).attr("fill", auto.laneTint);
|
|
419
256
|
}
|
|
420
257
|
g.attr("data-dgmo-clock", "").attr("data-dgmo-clock-zone", entry.zone).attr("data-dgmo-clock-face", parsed.face).attr("data-dgmo-clock-hours12", parsed.hours12 ? "1" : "0").attr("data-dgmo-clock-sun", sun ? "1" : "0").attr("data-dgmo-clock-c-day", sw.day).attr("data-dgmo-clock-c-night", sw.night).attr("data-dgmo-clock-c-day-soft", sw.dayTint).attr("data-dgmo-clock-c-night-soft", sw.nightTint).attr("data-dgmo-clock-c-ok", sw.ok).attr("data-dgmo-clock-c-soon", sw.soon).attr("data-dgmo-clock-c-off", sw.off).attr("data-dgmo-clock-c-ok-soft", sw.okSoft).attr("data-dgmo-clock-c-soon-soft", sw.soonSoft).attr("data-dgmo-clock-c-off-soft", sw.offSoft);
|
|
421
258
|
if (entry.lat !== null) g.attr("data-dgmo-clock-lat", entry.lat);
|
|
422
259
|
if (entry.lon !== null) g.attr("data-dgmo-clock-lon", entry.lon);
|
|
260
|
+
if (entry.kind === "fixed")
|
|
261
|
+
g.attr("data-dgmo-clock-fixed-offset", entry.fixedOffsetMin ?? 0);
|
|
423
262
|
if (parsed.work) {
|
|
424
263
|
g.attr("data-dgmo-clock-work-start", parsed.work.startMin).attr("data-dgmo-clock-work-end", parsed.work.endMin).attr(
|
|
425
264
|
"data-dgmo-clock-work-days",
|
|
@@ -432,10 +271,7 @@ function drawRow(svg, entry, index, parsed, now, rowTop, rowH, geom, col) {
|
|
|
432
271
|
const ringColor = auto?.solid ?? line2;
|
|
433
272
|
const accentColor = auto?.solid ?? stColor;
|
|
434
273
|
if (auto) {
|
|
435
|
-
g.attr("data-dgmo-clock-auto-solid", auto.solid).attr(
|
|
436
|
-
"data-dgmo-clock-auto-face",
|
|
437
|
-
faceFill
|
|
438
|
-
);
|
|
274
|
+
g.attr("data-dgmo-clock-auto-solid", auto.solid).attr("data-dgmo-clock-auto-face", faceFill).attr("data-dgmo-clock-auto-mode", parsed.colorBy).attr("data-dgmo-clock-cardfill", cardFill);
|
|
439
275
|
}
|
|
440
276
|
if (parsed.face === "analog") {
|
|
441
277
|
const size = rowH - 20;
|
|
@@ -497,7 +333,8 @@ function drawRow(svg, entry, index, parsed, now, rowTop, rowH, geom, col) {
|
|
|
497
333
|
const textX = rightColLeft + 20;
|
|
498
334
|
const textMax = geom.rightX - textX;
|
|
499
335
|
const lines = [];
|
|
500
|
-
if (entry.
|
|
336
|
+
if (entry.kind === "fixed") lines.push({ kind: "fixed" });
|
|
337
|
+
else if (entry.label !== entry.place) lines.push({ kind: "place" });
|
|
501
338
|
if (status) lines.push({ kind: "avail" });
|
|
502
339
|
if (sun) lines.push({ kind: "sun" });
|
|
503
340
|
const lh = 23;
|
|
@@ -517,13 +354,25 @@ function drawRow(svg, entry, index, parsed, now, rowTop, rowH, geom, col) {
|
|
|
517
354
|
} else if (ln.kind === "sun" && sun) {
|
|
518
355
|
drawSunMoon(g, iconX, yy - 5, up, sw, 1.25);
|
|
519
356
|
g.append("text").attr("data-dgmo-clock-sun-line", "").attr("x", textX).attr("y", yy).attr("fill", muted).attr("font-family", FONT_FAMILY).attr("font-size", 13.5).text(ellipsize(sun.text, 13.5, textMax));
|
|
357
|
+
} else if (ln.kind === "fixed") {
|
|
358
|
+
drawFixedGlyph(g, iconX, yy - 5, muted);
|
|
359
|
+
g.append("text").attr("x", textX).attr("y", yy).attr("fill", muted).attr("font-family", FONT_FAMILY).attr("font-size", 13.5).text(ellipsize(`${entry.place} \xB7 no DST`, 13.5, textMax));
|
|
520
360
|
}
|
|
521
361
|
});
|
|
522
362
|
}
|
|
363
|
+
function drawFixedGlyph(parent, cx, cy, color) {
|
|
364
|
+
const g = parent.append("g").attr("transform", `translate(${cx},${cy})`);
|
|
365
|
+
for (let k = 0; k < 3; k++) {
|
|
366
|
+
const a = k * 60 * Math.PI / 180;
|
|
367
|
+
g.append("line").attr("x1", -4 * Math.cos(a)).attr("y1", -4 * Math.sin(a)).attr("x2", 4 * Math.cos(a)).attr("y2", 4 * Math.sin(a)).attr("stroke", color).attr("stroke-width", 1.2).attr("stroke-linecap", "round");
|
|
368
|
+
}
|
|
369
|
+
}
|
|
523
370
|
function bakeAnchors(g, entry, parsed, sun, sw) {
|
|
524
371
|
g.attr("data-dgmo-clock", "").attr("data-dgmo-clock-zone", entry.zone).attr("data-dgmo-clock-face", parsed.face).attr("data-dgmo-clock-hours12", parsed.hours12 ? "1" : "0").attr("data-dgmo-clock-sun", sun ? "1" : "0").attr("data-dgmo-clock-c-day", sw.day).attr("data-dgmo-clock-c-night", sw.night).attr("data-dgmo-clock-c-day-soft", sw.dayTint).attr("data-dgmo-clock-c-night-soft", sw.nightTint).attr("data-dgmo-clock-c-ok", sw.ok).attr("data-dgmo-clock-c-soon", sw.soon).attr("data-dgmo-clock-c-off", sw.off).attr("data-dgmo-clock-c-ok-soft", sw.okSoft).attr("data-dgmo-clock-c-soon-soft", sw.soonSoft).attr("data-dgmo-clock-c-off-soft", sw.offSoft);
|
|
525
372
|
if (entry.lat !== null) g.attr("data-dgmo-clock-lat", entry.lat);
|
|
526
373
|
if (entry.lon !== null) g.attr("data-dgmo-clock-lon", entry.lon);
|
|
374
|
+
if (entry.kind === "fixed")
|
|
375
|
+
g.attr("data-dgmo-clock-fixed-offset", entry.fixedOffsetMin ?? 0);
|
|
527
376
|
if (parsed.work) {
|
|
528
377
|
g.attr("data-dgmo-clock-work-start", parsed.work.startMin).attr("data-dgmo-clock-work-end", parsed.work.endMin).attr(
|
|
529
378
|
"data-dgmo-clock-work-days",
|
|
@@ -538,10 +387,12 @@ function drawColumns(body, parsed, now, top, geom, col) {
|
|
|
538
387
|
const colW = (width - 2 * cardM) / n;
|
|
539
388
|
const tints = [];
|
|
540
389
|
let maxBottom = top;
|
|
390
|
+
const deferred = [];
|
|
391
|
+
let detailTop = top;
|
|
541
392
|
parsed.entries.forEach((entry, i) => {
|
|
542
393
|
const x0 = cardM + i * colW;
|
|
543
394
|
const cx = x0 + colW / 2;
|
|
544
|
-
const parts =
|
|
395
|
+
const parts = partsFor(entry, now);
|
|
545
396
|
const hasCoords = entry.lat !== null && entry.lon !== null;
|
|
546
397
|
const sun = parsed.sun && hasCoords ? sunLine(now, entry.lat, entry.lon) : null;
|
|
547
398
|
const up = sun ? sun.up : parts.h >= 6 && parts.h < 18;
|
|
@@ -566,17 +417,14 @@ function drawColumns(body, parsed, now, top, geom, col) {
|
|
|
566
417
|
const faceFill = auto ? mix(auto.solid, cardFill, 20) : stTint;
|
|
567
418
|
const ringColor = auto?.solid ?? line2;
|
|
568
419
|
const accentColor = auto?.solid ?? stColor;
|
|
420
|
+
const g = body.append("g").attr("data-line-number", entry.lineNumber);
|
|
421
|
+
bakeAnchors(g, entry, parsed, sun, sw);
|
|
569
422
|
if (auto)
|
|
570
423
|
tints.push(
|
|
571
|
-
|
|
424
|
+
g.append("rect").attr("data-dgmo-clock-lane", "").attr("x", x0).attr("y", top).attr("width", colW).attr("fill", auto.laneTint)
|
|
572
425
|
);
|
|
573
|
-
const g = body.append("g").attr("data-line-number", entry.lineNumber);
|
|
574
|
-
bakeAnchors(g, entry, parsed, sun, sw);
|
|
575
426
|
if (auto) {
|
|
576
|
-
g.attr("data-dgmo-clock-auto-solid", auto.solid).attr(
|
|
577
|
-
"data-dgmo-clock-auto-face",
|
|
578
|
-
faceFill
|
|
579
|
-
);
|
|
427
|
+
g.attr("data-dgmo-clock-auto-solid", auto.solid).attr("data-dgmo-clock-auto-face", faceFill).attr("data-dgmo-clock-auto-mode", parsed.colorBy).attr("data-dgmo-clock-cardfill", cardFill);
|
|
580
428
|
}
|
|
581
429
|
let cy = top + (parsed.face === "analog" ? 22 : 36);
|
|
582
430
|
const innerW = colW - 16;
|
|
@@ -599,18 +447,20 @@ function drawColumns(body, parsed, now, top, geom, col) {
|
|
|
599
447
|
fg.append("circle").attr("data-dgmo-clock-center", "").attr("cx", 50).attr("cy", 50).attr("r", 2.6).attr("fill", accentColor);
|
|
600
448
|
cy += size + 6;
|
|
601
449
|
} else {
|
|
602
|
-
const sf =
|
|
603
|
-
const
|
|
450
|
+
const sf = 22;
|
|
451
|
+
const gap = 11;
|
|
452
|
+
const cap = 0.7;
|
|
453
|
+
const tf = fitFont(ts.main, 54, innerW - 30 - gap, 20);
|
|
604
454
|
const mainW = [...ts.main].reduce(
|
|
605
455
|
(w, c) => w + tf * (c === ":" ? 0.334 : 0.6),
|
|
606
456
|
0
|
|
607
457
|
);
|
|
608
458
|
const stackW = Math.max(estWidth(`:${ts.sec}`, sf), estWidth(ts.ap, sf));
|
|
609
|
-
const gLeft = cx - (mainW +
|
|
459
|
+
const gLeft = cx - (mainW + gap + stackW) / 2;
|
|
610
460
|
const baseY = cy + tf * 0.34;
|
|
611
461
|
g.append("text").attr("data-dgmo-clock-digital", "").attr("data-dgmo-clock-digital-part", "main").attr("x", gLeft).attr("y", baseY).attr("fill", timeColor).attr("font-family", FONT_FAMILY).attr("font-size", tf).attr("font-weight", 600).attr("textLength", mainW).attr("lengthAdjust", "spacing").style("font-variant-numeric", "tabular-nums").text(ts.main);
|
|
612
|
-
const stackX = gLeft + mainW +
|
|
613
|
-
g.append("text").attr("data-dgmo-clock-digital-part", "sec").attr("x", stackX).attr("y", baseY - tf *
|
|
462
|
+
const stackX = gLeft + mainW + gap;
|
|
463
|
+
g.append("text").attr("data-dgmo-clock-digital-part", "sec").attr("x", stackX).attr("y", baseY - tf * cap + sf * cap).attr("fill", muted).attr("font-family", FONT_FAMILY).attr("font-size", sf).attr("font-weight", 500).text(`:${ts.sec}`);
|
|
614
464
|
if (ts.ap)
|
|
615
465
|
g.append("text").attr("data-dgmo-clock-digital-part", "ap").attr("x", stackX).attr("y", baseY).attr("fill", muted).attr("font-family", FONT_FAMILY).attr("font-size", sf).attr("font-weight", 500).text(ts.ap);
|
|
616
466
|
cy += tf + 8;
|
|
@@ -635,34 +485,52 @@ function drawColumns(body, parsed, now, top, geom, col) {
|
|
|
635
485
|
);
|
|
636
486
|
cy += alines.length * alh + 12;
|
|
637
487
|
const kinds = [];
|
|
638
|
-
if (entry.
|
|
488
|
+
if (entry.kind === "fixed") kinds.push("fixed");
|
|
489
|
+
else if (entry.label !== entry.place) kinds.push("place");
|
|
639
490
|
if (status) kinds.push("avail");
|
|
640
491
|
if (sun) kinds.push("sun");
|
|
641
492
|
const iconX = x0 + 16;
|
|
642
493
|
const textX = x0 + 28;
|
|
643
494
|
const tmax = colW - 40;
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
495
|
+
deferred.push({
|
|
496
|
+
kinds: kinds.length,
|
|
497
|
+
draw: (startY) => {
|
|
498
|
+
kinds.forEach((kind, j) => {
|
|
499
|
+
const yy = startY + j * 20;
|
|
500
|
+
if (kind === "place") {
|
|
501
|
+
g.append("path").attr("transform", `translate(${iconX},${yy - 4})`).attr("d", "M0,4 L-2.3,-0.6 A2.6,2.6 0 1 1 2.3,-0.6 Z").attr("fill", muted);
|
|
502
|
+
g.append("text").attr("x", textX).attr("y", yy).attr("fill", muted).attr("font-family", FONT_FAMILY).attr("font-size", 12).text(ellipsize(entry.place, 12, tmax));
|
|
503
|
+
} else if (kind === "avail" && status) {
|
|
504
|
+
const stCol = status.cls === "ok" ? sw.ok : status.cls === "soon" ? sw.soon : sw.off;
|
|
505
|
+
const dot = g.append("circle").attr("data-dgmo-clock-status-dot", "").attr("cx", iconX).attr("cy", yy - 4).attr("r", 4);
|
|
506
|
+
if (status.cls === "off")
|
|
507
|
+
dot.attr("fill", "none").attr("stroke", stCol).attr("stroke-width", 1.4);
|
|
508
|
+
else dot.attr("fill", stCol).attr("stroke", "none");
|
|
509
|
+
g.append("text").attr("data-dgmo-clock-status", "").attr("x", textX).attr("y", yy).attr("fill", stCol).attr("font-family", FONT_FAMILY).attr("font-size", 12).attr("font-weight", 600).text(ellipsize(status.text, 12, tmax));
|
|
510
|
+
} else if (kind === "sun" && sun) {
|
|
511
|
+
drawSunMoon(g, iconX, yy - 4, up, sw, 1);
|
|
512
|
+
g.append("text").attr("data-dgmo-clock-sun-line", "").attr("x", textX).attr("y", yy).attr("fill", muted).attr("font-family", FONT_FAMILY).attr("font-size", 11.5).text(ellipsize(sun.text, 11.5, tmax));
|
|
513
|
+
} else if (kind === "fixed") {
|
|
514
|
+
drawFixedGlyph(g, iconX, yy - 4, muted);
|
|
515
|
+
g.append("text").attr("x", textX).attr("y", yy).attr("fill", muted).attr("font-family", FONT_FAMILY).attr("font-size", 11.5).text(ellipsize(`${entry.place} \xB7 no DST`, 11.5, tmax));
|
|
516
|
+
}
|
|
517
|
+
});
|
|
659
518
|
}
|
|
660
519
|
});
|
|
661
|
-
|
|
520
|
+
if (cy > detailTop) detailTop = cy;
|
|
521
|
+
});
|
|
522
|
+
deferred.forEach((d) => {
|
|
523
|
+
d.draw(detailTop);
|
|
524
|
+
const bottom = d.kinds ? detailTop + (d.kinds - 1) * 20 + 8 : detailTop;
|
|
662
525
|
if (bottom > maxBottom) maxBottom = bottom;
|
|
663
526
|
});
|
|
664
527
|
const colBodyH = maxBottom - top + 14;
|
|
665
528
|
tints.forEach((r) => r.attr("height", colBodyH));
|
|
529
|
+
const dividerColor = mix(col.palette.text, col.palette.bg, 40);
|
|
530
|
+
for (let i = 1; i < n; i++) {
|
|
531
|
+
const x = cardM + i * colW;
|
|
532
|
+
body.append("line").attr("data-dgmo-clock-col-divider", "").attr("x1", x).attr("x2", x).attr("y1", top).attr("y2", top + colBodyH).attr("stroke", dividerColor).attr("stroke-width", 1);
|
|
533
|
+
}
|
|
666
534
|
return top + colBodyH + cardM;
|
|
667
535
|
}
|
|
668
536
|
function renderClockForExport(container, parsed, palette, isDark, exportDims) {
|
|
@@ -670,12 +538,7 @@ function renderClockForExport(container, parsed, palette, isDark, exportDims) {
|
|
|
670
538
|
}
|
|
671
539
|
|
|
672
540
|
export {
|
|
673
|
-
zoneParts,
|
|
674
|
-
formatTime,
|
|
675
|
-
workStatus,
|
|
676
|
-
sunLine,
|
|
677
|
-
handAngles,
|
|
678
541
|
renderClock,
|
|
679
542
|
renderClockForExport
|
|
680
543
|
};
|
|
681
|
-
//# sourceMappingURL=chunk-
|
|
544
|
+
//# sourceMappingURL=chunk-U5SI5NIM.js.map
|
|
@@ -17,7 +17,7 @@ import {
|
|
|
17
17
|
import {
|
|
18
18
|
resolveTagColor,
|
|
19
19
|
tagAttrKey
|
|
20
|
-
} from "./chunk-
|
|
20
|
+
} from "./chunk-467TVMQL.js";
|
|
21
21
|
import {
|
|
22
22
|
CATEGORICAL_COLOR_ORDER,
|
|
23
23
|
resolveColor
|
|
@@ -391,4 +391,4 @@ function drawCenteredLabel(g, label, cx, cy, fill, fontSize, tight = false, halo
|
|
|
391
391
|
export {
|
|
392
392
|
renderSwimlaneForExport
|
|
393
393
|
};
|
|
394
|
-
//# sourceMappingURL=chunk-
|
|
394
|
+
//# sourceMappingURL=chunk-VB4UJ3H2.js.map
|