@diagrammo/dgmo 0.72.0 → 0.73.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 +20 -11
- package/dist/advanced.js +115 -116
- package/dist/{analyzer-HQUXKZ5J.js → analyzer-KQWXVQOI.js} +3 -3
- package/dist/block.d.ts +2 -2
- package/dist/block.js +63 -75
- package/dist/calculator-2Z5DUTOB.js +13 -0
- package/dist/{chart-meta-6JaOudSs.d.ts → chart-meta-lP8Rl19E.d.ts} +4 -3
- package/dist/chart-meta.d.ts +3 -3
- package/dist/chart-meta.js +49 -49
- package/dist/{charts-d3-6IHGTXBR.js → charts-d3-S6JPQQFZ.js} +12 -12
- package/dist/{chunk-7BHM774H.js → chunk-25LXU4OQ.js} +8 -8
- package/dist/{chunk-7SEQPFBX.js → chunk-2AC2KTVM.js} +33 -28
- package/dist/{chunk-NUF7YTHA.js → chunk-2M2UC5EU.js} +3 -3
- package/dist/{chunk-CGLBK5Q4.js → chunk-2PU5XWLA.js} +2 -2
- package/dist/{chunk-MWWRIOEN.js → chunk-2TFWQM3E.js} +3 -3
- package/dist/{chunk-FLXDMH7B.js → chunk-3ATHNEOQ.js} +30 -24
- package/dist/{chunk-FFD6A3B2.js → chunk-3AXUJ5PT.js} +16 -10
- package/dist/{chunk-PKTRDOBI.js → chunk-3OKBXV3I.js} +3 -3
- package/dist/{chunk-2VBJCTSG.js → chunk-3X3UD7PN.js} +5 -5
- package/dist/{chunk-DPGI742S.js → chunk-4FKEI4MF.js} +4 -4
- package/dist/{chunk-WPXHTYET.js → chunk-4K5H6LON.js} +4 -4
- package/dist/{chunk-LTGOPJUV.js → chunk-4NYJEK4R.js} +3 -3
- package/dist/{chunk-MTPKBSTR.js → chunk-4SXHMFFP.js} +2 -2
- package/dist/{chunk-VE7PPEU3.js → chunk-54SJUHNY.js} +8 -8
- package/dist/{chunk-BYSRXYRW.js → chunk-5EI23VVR.js} +6 -6
- package/dist/{chunk-OLMWTJVU.js → chunk-5SI6T5A5.js} +1 -1
- package/dist/{chunk-UJXCDF4E.js → chunk-5VMUVJO4.js} +2 -2
- package/dist/{chunk-ZGVVPILJ.js → chunk-6DYZ2JM6.js} +2 -2
- package/dist/{chunk-ELIGVSLE.js → chunk-6G2GJGUC.js} +12 -6
- package/dist/{chunk-E36Q5ABQ.js → chunk-6LGPL4LP.js} +7 -7
- package/dist/{chunk-KJWIU5AM.js → chunk-7GYSVN4Z.js} +3 -3
- package/dist/{chunk-YTFA4VTW.js → chunk-7S5WQXI3.js} +3 -3
- package/dist/{chunk-MKNWMFZU.js → chunk-7VMUKH2Z.js} +31 -27
- package/dist/{chunk-VLXYWPPE.js → chunk-A34AXXBO.js} +7 -7
- package/dist/{chunk-N5247W2W.js → chunk-ABH626W7.js} +14 -9
- package/dist/{chunk-GCTKJDLY.js → chunk-AG3Z47VY.js} +10 -10
- package/dist/{chunk-T7W5LM4N.js → chunk-AMYMV4JZ.js} +5 -5
- package/dist/{chunk-KOVRFBGR.js → chunk-ARM4G2HJ.js} +16 -11
- package/dist/{chunk-UF3EALKC.js → chunk-B5CIHVBP.js} +10 -10
- package/dist/{chunk-MC2H32SM.js → chunk-BVNTXVYJ.js} +4 -4
- package/dist/{chunk-DZ34UUXC.js → chunk-CLKRRKV6.js} +11 -11
- package/dist/{chunk-UY77QQWU.js → chunk-CVGTEAIO.js} +11 -7
- package/dist/{chunk-IXVK7XCN.js → chunk-D5ZZOTE6.js} +2 -2
- package/dist/{chunk-WMHHNK44.js → chunk-DGPFFRLS.js} +2 -2
- package/dist/{chunk-EETUTZ5C.js → chunk-DTYZAXEH.js} +2 -2
- package/dist/{chunk-MUVASOBD.js → chunk-DZC2OCK3.js} +10 -10
- package/dist/{chunk-REBTZP3W.js → chunk-E27E4ZFN.js} +6 -6
- package/dist/{chunk-BSI5EOAX.js → chunk-E3BJVEMZ.js} +7 -11
- package/dist/{chunk-7NK42OIB.js → chunk-E6PNTYRK.js} +2 -2
- package/dist/{chunk-3SNE4CLI.js → chunk-EPJHJF3J.js} +7 -7
- package/dist/{chunk-HBVKOYZD.js → chunk-FGXBIOVK.js} +3 -3
- package/dist/{chunk-U4NFAWQW.js → chunk-FQDH6AL3.js} +9 -9
- package/dist/{chunk-XIZCHGP7.js → chunk-FQFQGPWA.js} +9 -9
- package/dist/{chunk-IKHV5IJB.js → chunk-GE5RO4BS.js} +2 -2
- package/dist/{chunk-KWRW6BLG.js → chunk-GLREDNBA.js} +2 -2
- package/dist/{chunk-UKOOGXRF.js → chunk-H454ZVAS.js} +8 -8
- package/dist/{chunk-VMXV2CL5.js → chunk-HQ34V2XV.js} +5 -5
- package/dist/{chunk-YG35ZCNW.js → chunk-I4YT5KL6.js} +36 -32
- package/dist/{chunk-QAJFIXJE.js → chunk-IDEJ3J4J.js} +28 -28
- package/dist/{chunk-TF7CFAZ5.js → chunk-IEZYF5CN.js} +4 -4
- package/dist/{chunk-RRX4Z4TH.js → chunk-IHOFUR74.js} +2 -2
- package/dist/{chunk-3HN32MEK.js → chunk-INOSOL3J.js} +4 -4
- package/dist/{chunk-6OAKQTXQ.js → chunk-ITAFWUSB.js} +3 -3
- package/dist/{chunk-MX3BYU7V.js → chunk-JLSGQMRA.js} +3 -3
- package/dist/{chunk-P6RPHRX7.js → chunk-JPVRJS74.js} +6 -6
- package/dist/{chunk-6DGMS2WJ.js → chunk-K3O2CZTD.js} +6 -6
- package/dist/{chunk-66VHK7PP.js → chunk-K7P4SCB3.js} +9 -9
- package/dist/{chunk-UTVKOGFF.js → chunk-KCHCOXAL.js} +94 -40
- package/dist/{chunk-VGLSKDDI.js → chunk-KI2L4DWM.js} +3 -3
- package/dist/{chunk-AEYRSPVV.js → chunk-KUDYLU3M.js} +3 -3
- package/dist/{chunk-QITH5XOX.js → chunk-KZKRK57S.js} +11 -11
- package/dist/{chunk-4VUFJ7UA.js → chunk-LGASNVZE.js} +6 -6
- package/dist/{chunk-ET4R3AU5.js → chunk-LM3HY3VG.js} +2 -2
- package/dist/{chunk-RJI6MHHK.js → chunk-LMJKHQ4W.js} +6 -6
- package/dist/{chunk-ZJJWON5O.js → chunk-MK55PZVB.js} +268 -3
- package/dist/{chunk-RTTELOOP.js → chunk-MS5574I7.js} +3 -3
- package/dist/{chunk-I55PVEIX.js → chunk-MSVQ2YCY.js} +2 -2
- package/dist/{chunk-WEC3JPTN.js → chunk-MZMK474U.js} +8 -8
- package/dist/{chunk-NTBHGUXY.js → chunk-NE7JHZCQ.js} +4 -4
- package/dist/{chunk-JIWDWOYA.js → chunk-NQJ7DDUT.js} +4 -4
- package/dist/{chunk-6S53NO3M.js → chunk-O7ZKDUDX.js} +5 -5
- package/dist/{chunk-PBV2C3BW.js → chunk-OMQ5V5NH.js} +24 -20
- package/dist/{chunk-W27BULCB.js → chunk-OR3OX32W.js} +9 -9
- package/dist/{chunk-MFSTE3YG.js → chunk-OYK45NY5.js} +26 -18
- package/dist/{chunk-DHKVHP3Y.js → chunk-PFZDLHHG.js} +9 -9
- package/dist/{chunk-HKL66CKW.js → chunk-PJHYUVD3.js} +9 -9
- package/dist/{chunk-K6MQJ5IV.js → chunk-Q446PFCV.js} +3 -3
- package/dist/{chunk-IW6N2JJL.js → chunk-Q74GP3GK.js} +2 -2
- package/dist/{chunk-L3XB446I.js → chunk-QFHPGDR5.js} +2 -2
- package/dist/{chunk-QPG55HGH.js → chunk-RJUMXXKR.js} +5 -5
- package/dist/{chunk-SPA7DCB3.js → chunk-RN3PAL4E.js} +3 -3
- package/dist/{chunk-WRWUZ2C4.js → chunk-RXSAE6F5.js} +4 -4
- package/dist/{chunk-W7SZKJR6.js → chunk-RYHZFP7Y.js} +4 -4
- package/dist/{chunk-WF2HDQPG.js → chunk-S6OXNZBM.js} +3 -3
- package/dist/{chunk-UNM2PX5D.js → chunk-SNZFXGSE.js} +4 -4
- package/dist/{chunk-LSHROB27.js → chunk-T4L4LKXO.js} +5 -5
- package/dist/{chunk-FTPNAYL2.js → chunk-TJS3J5B3.js} +4 -4
- package/dist/{chunk-7TSBM4BV.js → chunk-TP42IN23.js} +5 -5
- package/dist/{chunk-7RAWNJI5.js → chunk-TTVHS3D5.js} +98 -98
- package/dist/{chunk-6PA32CUB.js → chunk-TXWW4UZM.js} +4 -4
- package/dist/{chunk-GK4AU57A.js → chunk-V7E3RZLQ.js} +5 -5
- package/dist/{chunk-NNMNHE3J.js → chunk-VQEW7XMN.js} +3 -3
- package/dist/{chunk-YYBQ55V2.js → chunk-VWIXRNY2.js} +4 -4
- package/dist/{chunk-YH5KJIO5.js → chunk-W242EWZZ.js} +8 -8
- package/dist/{chunk-2OTYNNHS.js → chunk-WDKLODC3.js} +10 -10
- package/dist/{chunk-OQKP2X3D.js → chunk-WFA6IULY.js} +57 -3
- package/dist/{chunk-HWNF22ZZ.js → chunk-WPEHUSUQ.js} +5 -5
- package/dist/{chunk-NJKUTY4M.js → chunk-WTMP6VZ6.js} +5 -5
- package/dist/{chunk-N34OTOGH.js → chunk-X6LVGU4W.js} +3 -3
- package/dist/{chunk-7U3NDE7T.js → chunk-X6LXZJPT.js} +7 -7
- package/dist/{chunk-UCGEBFUC.js → chunk-XGBUCXU7.js} +4 -4
- package/dist/{chunk-NEC7R2CB.js → chunk-XL2C26LV.js} +3 -3
- package/dist/{chunk-EXNKNJ65.js → chunk-XOGQY4EC.js} +2 -2
- package/dist/{chunk-UNTFANSM.js → chunk-XOOYMOIW.js} +15 -10
- package/dist/{chunk-DEVZWCD5.js → chunk-XUCHK3OJ.js} +21 -12
- package/dist/{chunk-O4OVVK6J.js → chunk-XVJWAE2F.js} +7 -7
- package/dist/{chunk-PZVYUQJA.js → chunk-YDA46XHI.js} +4 -4
- package/dist/{chunk-HZQCKXPB.js → chunk-YGKYQ7LA.js} +42 -42
- package/dist/{chunk-6CLC26GU.js → chunk-YJMWEZOB.js} +2 -2
- package/dist/{chunk-QX53GOI7.js → chunk-YT5ICQ4R.js} +2 -2
- package/dist/{chunk-376ATV2Q.js → chunk-ZIJXK3U5.js} +5 -5
- package/dist/{chunk-5DYDPP7K.js → chunk-ZQ5SROS2.js} +115 -240
- package/dist/completion-registry.js +24 -21
- package/dist/countdown.js +26 -6
- package/dist/{d3-Bfhj-XBX.d.ts → d3--y67plmW.d.ts} +1 -1
- package/dist/dgmo-router-AE6FUBV3.js +89 -0
- package/dist/{dgmo-router-Lya7cs3R.d.ts → dgmo-router-CY5j16Pl.d.ts} +1 -1
- package/dist/dimensions-PRZSDFWR.js +22 -0
- package/dist/flowchart-parser-HR25V5AH.js +21 -0
- package/dist/{flowchart-renderer-JMGOCLTQ.js → flowchart-renderer-FY63GDRH.js} +12 -12
- package/dist/highlight.js +6 -18
- package/dist/index.d.ts +7 -7
- package/dist/index.js +60 -58
- package/dist/{layout-AWPST2S3.js → layout-43A4YMAH.js} +7 -7
- package/dist/layout-4URV4OXF.js +15 -0
- package/dist/{layout-RD7GDM4I.js → layout-B5GQVXXY.js} +4 -4
- package/dist/layout-BWHNERBW.js +15 -0
- package/dist/{layout-5RUQ5FBZ.js → layout-DAYQ46PS.js} +3 -3
- package/dist/{layout-LVMWK4QY.js → layout-KQUSB45X.js} +4 -4
- package/dist/{layout-2DVT24YY.js → layout-O4PR46GN.js} +6 -6
- package/dist/layout-PKGNLY6P.js +15 -0
- package/dist/{layout-WIMQIHBU.js → layout-ROORJQ4X.js} +4 -4
- package/dist/{layout-BGXLVSXL.js → layout-U5OVRUOK.js} +8 -8
- package/dist/{layout-search-C44CJQOB.js → layout-search-UOKEMER5.js} +4 -4
- package/dist/{legend-constants-FP5MFDD4.js → legend-constants-PLN2YHGM.js} +5 -5
- package/dist/{palettes-WQZ2TPVZ.js → palettes-54YSI3IX.js} +4 -4
- package/dist/parser-23MYMNF6.js +14 -0
- package/dist/parser-2FNHLEBN.js +12 -0
- package/dist/{parser-XM6JC3UK.js → parser-2FZ4BDEW.js} +6 -6
- package/dist/parser-3JDQL7QF.js +15 -0
- package/dist/parser-5CAGM3ED.js +16 -0
- package/dist/parser-5RY6ID5M.js +18 -0
- package/dist/parser-6YBYIFS2.js +13 -0
- package/dist/parser-A665TNOV.js +20 -0
- package/dist/parser-AN4SUBQ6.js +11 -0
- package/dist/parser-BC2TAVB3.js +11 -0
- package/dist/parser-BCQBK2XB.js +12 -0
- package/dist/parser-BTTFGJGI.js +12 -0
- package/dist/parser-CAAFD3HB.js +19 -0
- package/dist/parser-COBTDQPC.js +11 -0
- package/dist/parser-DBOJKLDF.js +14 -0
- package/dist/{parser-TJ3SP2MJ.js → parser-DIQ2E5MR.js} +7 -7
- package/dist/parser-EDXD6ZGJ.js +13 -0
- package/dist/parser-GPZYL6ZE.js +11 -0
- package/dist/parser-MDYNA6JL.js +17 -0
- package/dist/parser-PCALQIW2.js +17 -0
- package/dist/parser-PDPZ2I6C.js +13 -0
- package/dist/parser-SQFNO6XG.js +15 -0
- package/dist/{parser-ZIEEBJMU.js → parser-SQMOEVG4.js} +7 -7
- package/dist/parser-TATBFGQ2.js +15 -0
- package/dist/{parser-EX3AGFT5.js → parser-VJEHPDOO.js} +6 -6
- package/dist/{parser-O7GTECFP.js → parser-VQX2LVUJ.js} +5 -5
- package/dist/{parser-CDMP3UVH.js → parser-W2LEO5QM.js} +7 -7
- package/dist/parser-W3QZBUOF.js +13 -0
- package/dist/parser-WQCSMLUI.js +15 -0
- package/dist/parser-X5RGCC3C.js +11 -0
- package/dist/parser-XGUJ7SMG.js +13 -0
- package/dist/parser-XS7DL63K.js +16 -0
- package/dist/parser-XTSWP4N3.js +11 -0
- package/dist/pert.d.ts +10 -0
- package/dist/{renderer-ZRHTC24Q.js → renderer-2DIH3YW6.js} +11 -11
- package/dist/{renderer-IH5C7NQT.js → renderer-2E2Z5N66.js} +6 -6
- package/dist/renderer-4HGNWJRC.js +25 -0
- package/dist/renderer-6U6YW4HX.js +26 -0
- package/dist/{renderer-IZFO3G22.js → renderer-AKZECRNK.js} +17 -17
- package/dist/{renderer-2T2RAFWX.js → renderer-BUMIZJIY.js} +14 -14
- package/dist/renderer-BY5AAKV7.js +25 -0
- package/dist/renderer-DU6D3S6K.js +27 -0
- package/dist/{renderer-UPTO25OX.js → renderer-EAQNSDTC.js} +12 -12
- package/dist/{renderer-FAD65M5Z.js → renderer-EP4GRCDX.js} +6 -6
- package/dist/{renderer-WLA3NQCC.js → renderer-GQUJVPVA.js} +13 -13
- package/dist/{renderer-W7JC2CTQ.js → renderer-HZCYBOAB.js} +6 -6
- package/dist/renderer-IMZKZ6TV.js +23 -0
- package/dist/renderer-J2N5YBFP.js +16 -0
- package/dist/renderer-KJNTNI22.js +26 -0
- package/dist/renderer-LKZZID6J.js +76 -0
- package/dist/renderer-MCWAHNQG.js +22 -0
- package/dist/renderer-MJCSBYAR.js +25 -0
- package/dist/{renderer-CB44E262.js → renderer-NXOSBZPO.js} +13 -13
- package/dist/renderer-ODDULMVE.js +20 -0
- package/dist/renderer-OTHBTGBN.js +16 -0
- package/dist/{renderer-VP4DPLDY.js → renderer-R7Q72DM4.js} +6 -6
- package/dist/renderer-S42JPAZO.js +24 -0
- package/dist/{renderer-QZRM6H4S.js → renderer-SCIHPARI.js} +5 -5
- package/dist/{renderer-K73COK5L.js → renderer-SW5YUK6H.js} +8 -8
- package/dist/{renderer-VEN6AIWW.js → renderer-TBWE67FB.js} +12 -12
- package/dist/{renderer-ACGZ5KJG.js → renderer-V7476J5G.js} +17 -17
- package/dist/renderer-VG4C23TY.js +21 -0
- package/dist/{renderer-E42I44WZ.js → renderer-WG6CUDWI.js} +13 -13
- package/dist/{renderer-2MEPYGAP.js → renderer-XL54ZE4H.js} +13 -13
- package/dist/{renderer-Y4VC3VH4.js → renderer-XNLRQWM6.js} +13 -13
- package/dist/{renderer-CL4X5S3T.js → renderer-YIJYYZZE.js} +12 -12
- package/dist/{renderer-Y3D36RIT.js → renderer-YX6S3U4L.js} +11 -11
- package/dist/renderer-radial-ZZAAPDSY.js +21 -0
- package/dist/{resolver-B3TXWNWF.js → resolver-H5E6V7LJ.js} +3 -3
- package/dist/state-parser-4DJ67MNV.js +19 -0
- package/dist/{state-renderer-FJ2GT4MU.js → state-renderer-IABX3URA.js} +17 -17
- package/dist/{tag-groups-NUA2F1I5.d.ts → tag-groups-DrHT2tEc.d.ts} +10 -0
- package/dist/{themes-Dem5xalq.d.ts → themes-GWhsabnx.d.ts} +2 -2
- package/docs/language-reference.md +49 -11
- package/gallery/fixtures/countdown.dgmo +1 -1
- package/package.json +1 -1
- package/dist/calculator-4CNL2GKU.js +0 -13
- package/dist/dgmo-router-O55I5UXN.js +0 -89
- package/dist/dimensions-EFEBIRS6.js +0 -22
- package/dist/flowchart-parser-LZF2GW2P.js +0 -21
- package/dist/layout-4D5JRUHX.js +0 -15
- package/dist/layout-VMDNULKS.js +0 -15
- package/dist/layout-VVTXA3W2.js +0 -15
- package/dist/parser-2CXA7K5C.js +0 -13
- package/dist/parser-4E2TVMOK.js +0 -13
- package/dist/parser-52AZJ3BA.js +0 -17
- package/dist/parser-52BOCAVQ.js +0 -15
- package/dist/parser-5IPCYVXY.js +0 -12
- package/dist/parser-6BF5TJQH.js +0 -16
- package/dist/parser-6VZISXFY.js +0 -11
- package/dist/parser-6Y5BMNNJ.js +0 -14
- package/dist/parser-7HUZBXKW.js +0 -11
- package/dist/parser-AEJ73QJS.js +0 -11
- package/dist/parser-AWNEAGMJ.js +0 -12
- package/dist/parser-C2QRTZPJ.js +0 -13
- package/dist/parser-CBSYFN6U.js +0 -11
- package/dist/parser-CNKHKQKZ.js +0 -17
- package/dist/parser-GK3JWVHY.js +0 -18
- package/dist/parser-GZKR6BFA.js +0 -14
- package/dist/parser-K26KDCZN.js +0 -11
- package/dist/parser-LTJ5AKY4.js +0 -16
- package/dist/parser-NIGB4EYX.js +0 -12
- package/dist/parser-OHWDJGCP.js +0 -15
- package/dist/parser-QCVEWLCO.js +0 -15
- package/dist/parser-SUAOF72Y.js +0 -13
- package/dist/parser-W2HXBHNC.js +0 -11
- package/dist/parser-WF4R7225.js +0 -15
- package/dist/parser-XRZQ7SC7.js +0 -13
- package/dist/parser-YRJAGBV7.js +0 -19
- package/dist/parser-Z3LN7P6G.js +0 -20
- package/dist/renderer-4DFEFP4X.js +0 -26
- package/dist/renderer-52KYFTNZ.js +0 -16
- package/dist/renderer-B4Q6LUW2.js +0 -24
- package/dist/renderer-E3UQ24DE.js +0 -25
- package/dist/renderer-H5QR3LC3.js +0 -16
- package/dist/renderer-JHWGW4Q7.js +0 -25
- package/dist/renderer-KQIJV5WD.js +0 -19
- package/dist/renderer-MZ4N2SVV.js +0 -25
- package/dist/renderer-QMSFXMAL.js +0 -21
- package/dist/renderer-VOXE7V6L.js +0 -27
- package/dist/renderer-WBG576LB.js +0 -26
- package/dist/renderer-XR4SVKNE.js +0 -22
- package/dist/renderer-YROML2KW.js +0 -76
- package/dist/renderer-YXYEP46H.js +0 -23
- package/dist/renderer-radial-KZ3W4WXI.js +0 -21
- package/dist/state-parser-HJNCGIFT.js +0 -19
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
2
|
monthIndex,
|
|
3
3
|
resolveNext,
|
|
4
|
+
ruleFromAnchor,
|
|
4
5
|
targetToMs,
|
|
5
6
|
weekdayIndex
|
|
6
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-WFA6IULY.js";
|
|
7
8
|
import {
|
|
8
9
|
normalizeDate
|
|
9
10
|
} from "./chunk-DAOFNU6J.js";
|
|
@@ -12,14 +13,47 @@ import {
|
|
|
12
13
|
fillModeFromToken,
|
|
13
14
|
measureIndent,
|
|
14
15
|
parseFirstLine
|
|
15
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-MK55PZVB.js";
|
|
16
17
|
import {
|
|
17
18
|
makeDgmoError,
|
|
18
19
|
makeFail
|
|
19
|
-
} from "./chunk-
|
|
20
|
+
} from "./chunk-5SI6T5A5.js";
|
|
20
21
|
|
|
21
22
|
// src/countdown/parser.ts
|
|
22
|
-
var
|
|
23
|
+
var RETIRED_SLOTS = /* @__PURE__ */ new Set(["on", "at", "from"]);
|
|
24
|
+
function retiredSlotMessage(slot) {
|
|
25
|
+
if (slot === "at")
|
|
26
|
+
return "`at` is gone \u2014 the time rides the anchor: `since 2026-01-05T18:00`, then `every week`.";
|
|
27
|
+
if (slot === "from")
|
|
28
|
+
return "`from` is gone \u2014 the anchor is `since <date>`: `since 2026-07-03`, then `every 2 weeks`.";
|
|
29
|
+
return "`on` is gone \u2014 the date lives in `since`: `since 2026-08-21`, then `every year`.";
|
|
30
|
+
}
|
|
31
|
+
function parseCadence(toks) {
|
|
32
|
+
const low = toks.map((t) => t.toLowerCase());
|
|
33
|
+
const head = low[0] ?? "";
|
|
34
|
+
if (low.length === 1) {
|
|
35
|
+
if (head === "year") return { kind: "year" };
|
|
36
|
+
if (head === "week") return { kind: "week" };
|
|
37
|
+
if (head === "month") return { kind: "month" };
|
|
38
|
+
if (head === "day") return { kind: "interval", n: 1, unit: "day" };
|
|
39
|
+
return null;
|
|
40
|
+
}
|
|
41
|
+
if (head === "month" && low[1] === "by") {
|
|
42
|
+
if (low[2] === "weekday" && low.length === 3)
|
|
43
|
+
return { kind: "month-weekday", last: false };
|
|
44
|
+
if (low[2] === "last" && low[3] === "weekday" && low.length === 4)
|
|
45
|
+
return { kind: "month-weekday", last: true };
|
|
46
|
+
return null;
|
|
47
|
+
}
|
|
48
|
+
if (low.length === 2 && /^\d+$/.test(head)) {
|
|
49
|
+
const unit = low[1].replace(/s$/, "");
|
|
50
|
+
if (unit === "day" || unit === "week" || unit === "month") {
|
|
51
|
+
const n = Number(head);
|
|
52
|
+
if (n >= 1) return { kind: "interval", n, unit };
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
return null;
|
|
56
|
+
}
|
|
23
57
|
var AMPM_RE = /^(\d{1,2})(?::(\d{2}))?\s*([ap]m)$/i;
|
|
24
58
|
function targetToMs2(target, tz = null) {
|
|
25
59
|
const ms = targetToMs(target, tz);
|
|
@@ -33,33 +67,6 @@ function isValidZone(zone) {
|
|
|
33
67
|
return false;
|
|
34
68
|
}
|
|
35
69
|
}
|
|
36
|
-
function ordinalToken(tok) {
|
|
37
|
-
const t = tok.toLowerCase();
|
|
38
|
-
if (t === "last") return -1;
|
|
39
|
-
const m = t.match(/^(\d+)(?:st|nd|rd|th)?$/);
|
|
40
|
-
if (m) {
|
|
41
|
-
const n = Number(m[1]);
|
|
42
|
-
return n >= 1 && n <= 5 ? n : null;
|
|
43
|
-
}
|
|
44
|
-
return null;
|
|
45
|
-
}
|
|
46
|
-
function parse24h(tok) {
|
|
47
|
-
const m = tok.match(TIME_24H_RE);
|
|
48
|
-
if (!m) return null;
|
|
49
|
-
const hour = Number(m[1]);
|
|
50
|
-
const minute = Number(m[2]);
|
|
51
|
-
if (hour > 23 || minute > 59) return null;
|
|
52
|
-
return { hour, minute };
|
|
53
|
-
}
|
|
54
|
-
function parseAt(rest, lineNum, softError) {
|
|
55
|
-
const tok = rest.trim();
|
|
56
|
-
const t = parse24h(tok);
|
|
57
|
-
if (t) return t;
|
|
58
|
-
const fixed = ampmTo24h(tok);
|
|
59
|
-
if (fixed) return parse24h(fixed);
|
|
60
|
-
softError(lineNum, `"at" needs a time like 18:00 or 6:30pm (got "${rest}").`);
|
|
61
|
-
return null;
|
|
62
|
-
}
|
|
63
70
|
function ampmTo24h(tok) {
|
|
64
71
|
const m = tok.match(AMPM_RE);
|
|
65
72
|
if (!m) return null;
|
|
@@ -80,7 +87,7 @@ function parseCountdown(content, palette) {
|
|
|
80
87
|
resolvedMs: null,
|
|
81
88
|
hasTime: false,
|
|
82
89
|
tz: null,
|
|
83
|
-
|
|
90
|
+
sinceMs: null,
|
|
84
91
|
sinceLabel: null,
|
|
85
92
|
units: "human",
|
|
86
93
|
round: "up",
|
|
@@ -104,16 +111,13 @@ function parseCountdown(content, palette) {
|
|
|
104
111
|
const lines = content.split("\n");
|
|
105
112
|
let headerParsed = false;
|
|
106
113
|
let cadence = null;
|
|
107
|
-
let
|
|
108
|
-
let
|
|
109
|
-
let
|
|
110
|
-
let
|
|
114
|
+
let sinceRaw = null;
|
|
115
|
+
let sinceLine = 0;
|
|
116
|
+
let sinceMs = null;
|
|
117
|
+
let sinceHasTime = false;
|
|
111
118
|
let targetRaw = null;
|
|
112
119
|
let targetIsNow = false;
|
|
113
120
|
let targetLine = 1;
|
|
114
|
-
let fromRaw = null;
|
|
115
|
-
let fromLine = 1;
|
|
116
|
-
let anchorMs = null;
|
|
117
121
|
let targetMs = null;
|
|
118
122
|
let hasTargetLine = false;
|
|
119
123
|
let hasEvery = false;
|
|
@@ -178,73 +182,23 @@ function parseCountdown(content, palette) {
|
|
|
178
182
|
// (each slot may also appear on its own line — handled below.)
|
|
179
183
|
case "every": {
|
|
180
184
|
hasEvery = true;
|
|
181
|
-
const
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
let cur = "cadence";
|
|
188
|
-
for (const tok of rest.split(/\s+/).filter(Boolean)) {
|
|
189
|
-
const low = tok.toLowerCase();
|
|
190
|
-
if (low === "on" || low === "at" || low === "from") cur = low;
|
|
191
|
-
else seg[cur].push(tok);
|
|
192
|
-
}
|
|
193
|
-
const head = (seg.cadence[0] ?? "").toLowerCase();
|
|
194
|
-
const bareInterval = (head === "day" || head === "week" || head === "month") && seg.from.length > 0 && seg.on.length === 0;
|
|
195
|
-
if (bareInterval) {
|
|
196
|
-
cadence = "interval";
|
|
197
|
-
intervalN = 1;
|
|
198
|
-
intervalUnit = head;
|
|
199
|
-
} else if (head === "year" || head === "month" || head === "week") {
|
|
200
|
-
cadence = head;
|
|
201
|
-
} else if (head === "day") {
|
|
202
|
-
softError(
|
|
203
|
-
lineNum,
|
|
204
|
-
"`every day` needs `from <date>` (an interval anchor)."
|
|
205
|
-
);
|
|
206
|
-
break;
|
|
207
|
-
} else if (/^\d+$/.test(head) && seg.cadence[1]) {
|
|
208
|
-
const unit = seg.cadence[1].toLowerCase().replace(/s$/, "");
|
|
209
|
-
if (unit === "day" || unit === "week" || unit === "month") {
|
|
210
|
-
cadence = "interval";
|
|
211
|
-
intervalN = Number(head);
|
|
212
|
-
intervalUnit = unit;
|
|
213
|
-
} else {
|
|
214
|
-
softError(
|
|
215
|
-
lineNum,
|
|
216
|
-
`every ${head} <days|weeks|months> \u2014 unknown unit "${seg.cadence[1]}".`
|
|
217
|
-
);
|
|
218
|
-
}
|
|
219
|
-
} else {
|
|
185
|
+
const toks = rest.split(/\s+/).filter(Boolean);
|
|
186
|
+
const stray = toks.find((t) => RETIRED_SLOTS.has(t.toLowerCase()));
|
|
187
|
+
if (stray)
|
|
188
|
+
return fail(lineNum, retiredSlotMessage(stray.toLowerCase()));
|
|
189
|
+
const parsed = parseCadence(toks);
|
|
190
|
+
if (!parsed) {
|
|
220
191
|
emitFreeProseError(lineNum, rest, softError);
|
|
221
192
|
break;
|
|
222
193
|
}
|
|
223
|
-
|
|
224
|
-
onSpec = parseOn(seg.on.join(" "), lineNum, softError);
|
|
225
|
-
if (seg.at.length)
|
|
226
|
-
atTime = parseAt(seg.at.join(" "), lineNum, softError);
|
|
227
|
-
if (seg.from.length) {
|
|
228
|
-
fromRaw = seg.from.join(" ");
|
|
229
|
-
fromLine = lineNum;
|
|
230
|
-
}
|
|
231
|
-
break;
|
|
232
|
-
}
|
|
233
|
-
// Standalone slot lines (lenient multi-line form).
|
|
234
|
-
case "on": {
|
|
235
|
-
onSpec = parseOn(rest, lineNum, softError);
|
|
236
|
-
break;
|
|
237
|
-
}
|
|
238
|
-
case "at": {
|
|
239
|
-
const t = parseAt(rest, lineNum, softError);
|
|
240
|
-
if (t) atTime = t;
|
|
241
|
-
break;
|
|
242
|
-
}
|
|
243
|
-
case "from": {
|
|
244
|
-
fromRaw = rest;
|
|
245
|
-
fromLine = lineNum;
|
|
194
|
+
cadence = parsed;
|
|
246
195
|
break;
|
|
247
196
|
}
|
|
197
|
+
// The standalone slot lines are retired alongside their `every` slots.
|
|
198
|
+
case "on":
|
|
199
|
+
case "at":
|
|
200
|
+
case "from":
|
|
201
|
+
return fail(lineNum, retiredSlotMessage(key));
|
|
248
202
|
// ── Universal date directives (§ BL-121) ──
|
|
249
203
|
case "date-order": {
|
|
250
204
|
const v = rest.toLowerCase();
|
|
@@ -261,9 +215,8 @@ function parseCountdown(content, palette) {
|
|
|
261
215
|
}
|
|
262
216
|
// ── Ordinal / since — numbers a yearly occurrence (resolvedYear − since) ──
|
|
263
217
|
case "since": {
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
else softError(lineNum, `"since" needs a year (got "${rest}").`);
|
|
218
|
+
sinceRaw = rest;
|
|
219
|
+
sinceLine = lineNum;
|
|
267
220
|
break;
|
|
268
221
|
}
|
|
269
222
|
// The eyebrow template: `Nth` → ordinal word, `N` → the number.
|
|
@@ -368,177 +321,99 @@ function parseCountdown(content, palette) {
|
|
|
368
321
|
}
|
|
369
322
|
}
|
|
370
323
|
}
|
|
371
|
-
if (
|
|
372
|
-
|
|
373
|
-
|
|
324
|
+
if (sinceRaw !== null) {
|
|
325
|
+
if (/^\d{4}$/.test(sinceRaw.trim())) {
|
|
326
|
+
return fail(
|
|
327
|
+
sinceLine,
|
|
328
|
+
`"since" needs a full date now (got the bare year "${sinceRaw.trim()}") \u2014 write \`since ${sinceRaw.trim()}-06-14\`. The month and day that used to sit on \`every \u2026 on\` come from here.`
|
|
329
|
+
);
|
|
330
|
+
}
|
|
331
|
+
const iso = normalizeDate(sinceRaw, { order: dateOrder, year: baseYear });
|
|
332
|
+
const effective = iso ?? sinceRaw;
|
|
333
|
+
const ms = targetToMs2(effective, result.tz);
|
|
374
334
|
if (ms === null) {
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
335
|
+
return fail(
|
|
336
|
+
sinceLine,
|
|
337
|
+
`"since" needs a date or datetime (got "${sinceRaw}").`
|
|
338
|
+
);
|
|
378
339
|
}
|
|
340
|
+
sinceMs = ms;
|
|
341
|
+
sinceHasTime = effective.includes(":");
|
|
379
342
|
}
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
343
|
+
const titleLine = result.titleLineNumber ?? 1;
|
|
344
|
+
if ((hasEvery || sinceRaw !== null) && hasTargetLine) {
|
|
345
|
+
return fail(
|
|
346
|
+
titleLine,
|
|
347
|
+
"A countdown has either `target` (one-shot) or `since`/`every` (recurring), not both."
|
|
384
348
|
);
|
|
385
349
|
}
|
|
386
|
-
if (
|
|
350
|
+
if (hasEvery && sinceMs === null) {
|
|
351
|
+
return fail(
|
|
352
|
+
titleLine,
|
|
353
|
+
"`every` needs a `since <date>` to recur from \u2014 it carries the cadence, the anchor carries the date."
|
|
354
|
+
);
|
|
355
|
+
}
|
|
356
|
+
if (result.expired !== null && (hasEvery || sinceMs !== null)) {
|
|
387
357
|
warn(
|
|
388
|
-
|
|
358
|
+
titleLine,
|
|
389
359
|
"`expired` applies only to one-shot `target` blocks; recurring blocks roll forward."
|
|
390
360
|
);
|
|
391
361
|
}
|
|
392
|
-
if (
|
|
393
|
-
const rule =
|
|
394
|
-
cadence,
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
result.titleLineNumber ?? 1,
|
|
399
|
-
softError
|
|
362
|
+
if (sinceMs !== null) {
|
|
363
|
+
const rule = ruleFromAnchor(
|
|
364
|
+
cadence ?? { kind: "year" },
|
|
365
|
+
sinceMs,
|
|
366
|
+
!sinceHasTime,
|
|
367
|
+
result.tz
|
|
400
368
|
);
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
if (atTime) result.hasTime = true;
|
|
406
|
-
}
|
|
369
|
+
result.rule = rule;
|
|
370
|
+
result.resolvedMs = resolveNext(rule, Date.now());
|
|
371
|
+
result.sinceMs = sinceMs;
|
|
372
|
+
if (sinceHasTime) result.hasTime = true;
|
|
407
373
|
} else if (targetMs !== null) {
|
|
408
374
|
result.targetMs = targetMs;
|
|
409
375
|
result.resolvedMs = targetMs;
|
|
410
376
|
}
|
|
411
377
|
if (result.resolvedMs === null && result.error === null) {
|
|
412
|
-
if (!
|
|
378
|
+
if (!hasTargetLine && sinceRaw === null) {
|
|
413
379
|
softError(
|
|
414
|
-
|
|
415
|
-
"Missing `target` or `
|
|
380
|
+
titleLine,
|
|
381
|
+
"Missing `target` (one-shot) or `since <date>` (recurring) \u2014 a countdown needs one."
|
|
416
382
|
);
|
|
417
383
|
}
|
|
418
384
|
}
|
|
419
385
|
return result;
|
|
420
386
|
}
|
|
421
|
-
function parseOn(rest, lineNum, softError) {
|
|
422
|
-
const toks = rest.split(/\s+/).filter(Boolean);
|
|
423
|
-
if (toks.length === 0) {
|
|
424
|
-
softError(
|
|
425
|
-
lineNum,
|
|
426
|
-
'"on" needs a target (e.g. "Aug 21", "3rd Tuesday", "Friday").'
|
|
427
|
-
);
|
|
428
|
-
return null;
|
|
429
|
-
}
|
|
430
|
-
const ord = ordinalToken(toks[0]);
|
|
431
|
-
if (ord !== null && toks[1]) {
|
|
432
|
-
const wd2 = weekdayIndex(toks[1]);
|
|
433
|
-
if (wd2 === null) {
|
|
434
|
-
softError(lineNum, `"${toks[1]}" is not a weekday.`);
|
|
435
|
-
return null;
|
|
436
|
-
}
|
|
437
|
-
return { nth: ord, weekday: wd2 };
|
|
438
|
-
}
|
|
439
|
-
const mo = monthIndex(toks[0]);
|
|
440
|
-
if (mo !== null && toks[1]) {
|
|
441
|
-
const day = Number(toks[1].replace(/(st|nd|rd|th)$/i, ""));
|
|
442
|
-
if (!Number.isInteger(day) || day < 1 || day > 31) {
|
|
443
|
-
softError(lineNum, `"${toks[1]}" is not a valid day of month.`);
|
|
444
|
-
return null;
|
|
445
|
-
}
|
|
446
|
-
return { month: mo, day };
|
|
447
|
-
}
|
|
448
|
-
const wd = weekdayIndex(toks[0]);
|
|
449
|
-
if (wd !== null) return { weekday: wd };
|
|
450
|
-
softError(
|
|
451
|
-
lineNum,
|
|
452
|
-
`"on ${rest}" \u2014 use "Aug 21", "3rd Tuesday", "last Friday", or a weekday.`
|
|
453
|
-
);
|
|
454
|
-
return null;
|
|
455
|
-
}
|
|
456
|
-
function assembleRule(cadence, interval, onSpec, atTime, lineNum, softError) {
|
|
457
|
-
const hour = atTime?.hour ?? 0;
|
|
458
|
-
const minute = atTime?.minute ?? 0;
|
|
459
|
-
const allDay = atTime === null;
|
|
460
|
-
if (cadence === "interval") {
|
|
461
|
-
return {
|
|
462
|
-
kind: "interval",
|
|
463
|
-
intervalN: interval.intervalN,
|
|
464
|
-
intervalUnit: interval.intervalUnit,
|
|
465
|
-
anchorMs: interval.anchorMs ?? void 0,
|
|
466
|
-
hour,
|
|
467
|
-
minute,
|
|
468
|
-
allDay
|
|
469
|
-
};
|
|
470
|
-
}
|
|
471
|
-
if (cadence === "year") {
|
|
472
|
-
if (onSpec?.month === void 0 || onSpec.day === void 0) {
|
|
473
|
-
softError(
|
|
474
|
-
lineNum,
|
|
475
|
-
"`every year` needs `on <Month> <Day>` (e.g. on Aug 21)."
|
|
476
|
-
);
|
|
477
|
-
return null;
|
|
478
|
-
}
|
|
479
|
-
return {
|
|
480
|
-
kind: "month-day",
|
|
481
|
-
month: onSpec.month,
|
|
482
|
-
day: onSpec.day,
|
|
483
|
-
hour,
|
|
484
|
-
minute,
|
|
485
|
-
allDay
|
|
486
|
-
};
|
|
487
|
-
}
|
|
488
|
-
if (cadence === "month") {
|
|
489
|
-
if (onSpec?.nth === void 0 || onSpec.weekday === void 0) {
|
|
490
|
-
softError(
|
|
491
|
-
lineNum,
|
|
492
|
-
"`every month` needs `on <nth> <weekday>`, `on last <weekday>`, or `from <date>`."
|
|
493
|
-
);
|
|
494
|
-
return null;
|
|
495
|
-
}
|
|
496
|
-
return onSpec.nth < 0 ? { kind: "last-weekday", weekday: onSpec.weekday, hour, minute, allDay } : {
|
|
497
|
-
kind: "nth-weekday",
|
|
498
|
-
nth: onSpec.nth,
|
|
499
|
-
weekday: onSpec.weekday,
|
|
500
|
-
hour,
|
|
501
|
-
minute,
|
|
502
|
-
allDay
|
|
503
|
-
};
|
|
504
|
-
}
|
|
505
|
-
if (onSpec?.weekday === void 0 || onSpec.nth !== void 0) {
|
|
506
|
-
softError(lineNum, "`every week` needs `on <weekday>` (e.g. on Friday).");
|
|
507
|
-
return null;
|
|
508
|
-
}
|
|
509
|
-
return { kind: "weekly", weekday: onSpec.weekday, hour, minute, allDay };
|
|
510
|
-
}
|
|
511
387
|
function emitFreeProseError(lineNum, rest, softError) {
|
|
512
388
|
const toks = rest.split(/\s+/).filter(Boolean);
|
|
513
389
|
const problems = [];
|
|
514
|
-
let
|
|
515
|
-
let atPart = "";
|
|
390
|
+
let suggestion = "every year";
|
|
516
391
|
for (let i = 0; i < toks.length; i++) {
|
|
517
392
|
const tok = toks[i];
|
|
518
393
|
const fixed = ampmTo24h(tok);
|
|
519
394
|
if (fixed) {
|
|
520
|
-
problems.push(
|
|
521
|
-
|
|
395
|
+
problems.push(
|
|
396
|
+
`"${tok}": a time belongs on the anchor (since \u2026T${fixed})`
|
|
397
|
+
);
|
|
398
|
+
continue;
|
|
399
|
+
}
|
|
400
|
+
if (weekdayIndex(tok) !== null) {
|
|
401
|
+
problems.push(`"${tok}": a weekday belongs on the anchor`);
|
|
402
|
+
suggestion = "every week";
|
|
522
403
|
continue;
|
|
523
404
|
}
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
if (mo !== null && toks[i + 1] && /^\d/.test(toks[i + 1])) {
|
|
528
|
-
onPart = `year on ${tok} ${toks[i + 1]}`;
|
|
405
|
+
if (monthIndex(tok) !== null && toks[i + 1] && /^\d/.test(toks[i + 1])) {
|
|
406
|
+
problems.push(`"${tok} ${toks[i + 1]}": a date belongs on the anchor`);
|
|
407
|
+
suggestion = "every year";
|
|
529
408
|
}
|
|
530
409
|
}
|
|
531
|
-
if (
|
|
410
|
+
if (problems.length === 0)
|
|
532
411
|
problems.push(
|
|
533
|
-
"
|
|
412
|
+
"unknown cadence \u2014 use year | month | month by [last] weekday | week | day | N days|weeks|months"
|
|
534
413
|
);
|
|
535
|
-
} else if (onPart.startsWith("week")) {
|
|
536
|
-
problems.push("bare weekday needs a cadence");
|
|
537
|
-
}
|
|
538
|
-
const suggestion = onPart ? `every ${onPart}${atPart}` : `every week \u2026${atPart}`;
|
|
539
414
|
softError(
|
|
540
415
|
lineNum,
|
|
541
|
-
|
|
416
|
+
`\`every\` takes a cadence only. ${problems.join("; ")}. Try: \`since <date>\` + \`${suggestion}\`.`
|
|
542
417
|
);
|
|
543
418
|
}
|
|
544
419
|
|
|
@@ -546,4 +421,4 @@ export {
|
|
|
546
421
|
targetToMs2 as targetToMs,
|
|
547
422
|
parseCountdown
|
|
548
423
|
};
|
|
549
|
-
//# sourceMappingURL=chunk-
|
|
424
|
+
//# sourceMappingURL=chunk-ZQ5SROS2.js.map
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import {
|
|
2
2
|
ALL_MARKERS
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-MSVQ2YCY.js";
|
|
4
4
|
import {
|
|
5
5
|
GROUP_ONLY_METADATA,
|
|
6
6
|
STATE_KEYWORDS
|
|
7
|
-
} from "./chunk-
|
|
8
|
-
import "./chunk-
|
|
7
|
+
} from "./chunk-VWIXRNY2.js";
|
|
8
|
+
import "./chunk-4FKEI4MF.js";
|
|
9
9
|
import {
|
|
10
10
|
ALL_CHART_TYPES,
|
|
11
11
|
chartTypes
|
|
12
|
-
} from "./chunk-
|
|
13
|
-
import "./chunk-
|
|
14
|
-
import "./chunk-
|
|
12
|
+
} from "./chunk-MK55PZVB.js";
|
|
13
|
+
import "./chunk-XOGQY4EC.js";
|
|
14
|
+
import "./chunk-5SI6T5A5.js";
|
|
15
15
|
import "./chunk-5WRI5ZAA.js";
|
|
16
16
|
|
|
17
17
|
// src/utils/offered-types.ts
|
|
@@ -632,25 +632,26 @@ var COMPLETION_REGISTRY = /* @__PURE__ */ new Map([
|
|
|
632
632
|
],
|
|
633
633
|
[
|
|
634
634
|
"countdown",
|
|
635
|
-
// Live "N until X". One-shot `target` OR a recurring `
|
|
636
|
-
//
|
|
637
|
-
//
|
|
635
|
+
// Live "N until X". One-shot `target` OR a recurring `since <date>` (+ an
|
|
636
|
+
// optional `every <cadence>`), never both. Every calendar field comes from
|
|
637
|
+
// the anchor, so `on`/`at`/`from` are gone (decision #56).
|
|
638
|
+
// `units`/`round`/`fields` shape the display; `since-label` opts into the
|
|
639
|
+
// ordinal eyebrow. All space-separated key value (no colon).
|
|
638
640
|
withGlobals({
|
|
639
641
|
...DATE_DIRECTIVES,
|
|
640
642
|
target: {
|
|
641
643
|
description: "One-shot instant: a date/datetime (ISO, 7/4, or Jul 4) or `now` (key value)"
|
|
642
644
|
},
|
|
643
645
|
every: {
|
|
644
|
-
description: "
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
description: "Interval anchor date: every [N] day|week|month from <date> (e.g. every month from 2026-01-31)"
|
|
646
|
+
description: "Cadence only \u2014 year | month | month by weekday | month by last weekday | week | day | N days|weeks|months. Omit it and yearly is assumed",
|
|
647
|
+
values: [
|
|
648
|
+
"year",
|
|
649
|
+
"month",
|
|
650
|
+
"month by weekday",
|
|
651
|
+
"month by last weekday",
|
|
652
|
+
"week",
|
|
653
|
+
"day"
|
|
654
|
+
]
|
|
654
655
|
},
|
|
655
656
|
units: {
|
|
656
657
|
description: "human (default) | days | full | clock | weeks | words"
|
|
@@ -665,9 +666,11 @@ var COMPLETION_REGISTRY = /* @__PURE__ */ new Map([
|
|
|
665
666
|
},
|
|
666
667
|
lang: { description: "Locale for words/month names (en)" },
|
|
667
668
|
"on-day": { description: "Text shown on the occurrence day (recurring)" },
|
|
668
|
-
since: {
|
|
669
|
+
since: {
|
|
670
|
+
description: "Recurring anchor \u2014 the whole origin instant (2015-06-14, or 2026-01-05T18:00 for a timed one). Every calendar field derives from it"
|
|
671
|
+
},
|
|
669
672
|
"since-label": {
|
|
670
|
-
description: '
|
|
673
|
+
description: 'Opt into the ordinal eyebrow: Nth \u2192 ordinal word, N \u2192 number (e.g. "Nth Anniversary")'
|
|
671
674
|
},
|
|
672
675
|
expired: { description: "Text shown once a one-shot target passes" }
|
|
673
676
|
})
|
package/dist/countdown.js
CHANGED
|
@@ -215,8 +215,29 @@ function resolveNext(rule, now) {
|
|
|
215
215
|
}
|
|
216
216
|
}
|
|
217
217
|
}
|
|
218
|
-
function ordinalFor(resolvedMs,
|
|
219
|
-
|
|
218
|
+
function ordinalFor(resolvedMs, rule) {
|
|
219
|
+
const anchor = rule.anchorMs;
|
|
220
|
+
if (anchor === void 0) return 0;
|
|
221
|
+
const tz = rule.tz ?? null;
|
|
222
|
+
const a = zoneFields(anchor, tz);
|
|
223
|
+
const r = zoneFields(resolvedMs, tz);
|
|
224
|
+
const months = (r.year - a.year) * 12 + (r.month - a.month);
|
|
225
|
+
const spanDays = (dayStart(resolvedMs, tz) - dayStart(anchor, tz)) / DAY_MS;
|
|
226
|
+
switch (rule.kind) {
|
|
227
|
+
case "month-day":
|
|
228
|
+
return r.year - a.year;
|
|
229
|
+
case "nth-weekday":
|
|
230
|
+
case "last-weekday":
|
|
231
|
+
return months;
|
|
232
|
+
case "weekly":
|
|
233
|
+
return Math.round(spanDays / 7);
|
|
234
|
+
case "interval": {
|
|
235
|
+
const n = rule.intervalN ?? 1;
|
|
236
|
+
if (rule.intervalUnit === "month") return Math.floor(months / n);
|
|
237
|
+
const perStep = rule.intervalUnit === "week" ? 7 : 1;
|
|
238
|
+
return Math.round(spanDays / perStep / n);
|
|
239
|
+
}
|
|
240
|
+
}
|
|
220
241
|
}
|
|
221
242
|
function roundBy(value, mode) {
|
|
222
243
|
return mode === "down" ? Math.floor(value) : mode === "nearest" ? Math.round(value) : Math.ceil(value);
|
|
@@ -489,7 +510,6 @@ function updateNode(node, now) {
|
|
|
489
510
|
}
|
|
490
511
|
if (resolvedMs === null) return;
|
|
491
512
|
const remaining = resolvedMs - now;
|
|
492
|
-
const sinceAttr = node.getAttribute("data-dgmo-countdown-since");
|
|
493
513
|
const custom = node.getAttribute("data-dgmo-countdown-expired");
|
|
494
514
|
const hasTime = node.getAttribute("data-dgmo-countdown-hastime") === "1";
|
|
495
515
|
const frozen = expiredNow && custom !== null;
|
|
@@ -533,12 +553,12 @@ function updateNode(node, now) {
|
|
|
533
553
|
const hasTime2 = node.getAttribute("data-dgmo-countdown-hastime") === "1";
|
|
534
554
|
footer.textContent = formatFooter(resolvedMs, hasTime2, tz);
|
|
535
555
|
}
|
|
556
|
+
const tpl = node.getAttribute("data-dgmo-countdown-since-label");
|
|
536
557
|
const eyebrowEl = svg.querySelector("[data-dgmo-countdown-eyebrow]");
|
|
537
|
-
if (eyebrowEl &&
|
|
538
|
-
const tpl = node.getAttribute("data-dgmo-countdown-since-label") || "Nth";
|
|
558
|
+
if (eyebrowEl && tpl && rule) {
|
|
539
559
|
eyebrowEl.textContent = applyOrdinalTemplate(
|
|
540
560
|
tpl,
|
|
541
|
-
ordinalFor(resolvedMs,
|
|
561
|
+
ordinalFor(resolvedMs, rule)
|
|
542
562
|
);
|
|
543
563
|
}
|
|
544
564
|
const detail = svg.querySelector("[data-dgmo-countdown-detail]");
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { T as TagGroup, D as DgmoError, a as PaletteColors, C as CompactViewState } from './tag-groups-
|
|
1
|
+
import { T as TagGroup, D as DgmoError, a as PaletteColors, C as CompactViewState } from './tag-groups-DrHT2tEc.js';
|
|
2
2
|
|
|
3
3
|
/** A POI / route-stop position: gazetteer name (+ optional ISO scope) or coords. */
|
|
4
4
|
type PoiPos = {
|