@poe-platform/safe-bash 0.1.806 → 0.1.807
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 +4 -0
- package/dist/image-ast/portable.d.ts +8 -0
- package/dist/image-ast/portable.js +2 -0
- package/dist/safe-bash/chunks/{chunk-KRA6WK4Z.js → chunk-3Y54SR4R.js} +6 -6
- package/dist/safe-bash/chunks/{chunk-OYJI4L4J.js → chunk-PPAA3LJS.js} +1 -1
- package/dist/safe-bash/chunks/{chunk-SCROOJV7.js → chunk-XZ2Y4RWC.js} +2 -2
- package/dist/safe-bash/command-chunks/{biff-AU4VGVMD-6EQ64QPG.js → biff-YBHP7ZES-M7TU7NA5.js} +1211 -1205
- package/dist/safe-bash/command-chunks/chunk-2A6TBB4F.js +14 -0
- package/dist/safe-bash/command-chunks/chunk-2AF7J6FE.js +372 -0
- package/dist/safe-bash/command-chunks/{chunk-AITNVBXO.js → chunk-2ANW3FXH.js} +4 -4
- package/dist/safe-bash/command-chunks/chunk-2B6XWO6A.js +730 -0
- package/dist/safe-bash/command-chunks/chunk-2BKOSQD3.js +11 -0
- package/dist/safe-bash/command-chunks/chunk-2EUH5B6A.js +127 -0
- package/dist/safe-bash/command-chunks/chunk-2FOLUJLI.js +400 -0
- package/dist/safe-bash/command-chunks/{chunk-CZLX3KVF.js → chunk-2GILUQJY.js} +4 -6
- package/dist/safe-bash/command-chunks/chunk-2HHGDJ7J.js +280 -0
- package/dist/safe-bash/command-chunks/chunk-2NE2GPSF.js +546 -0
- package/dist/safe-bash/command-chunks/chunk-2P7BLWWI.js +272 -0
- package/dist/safe-bash/command-chunks/chunk-2PSVE7I5.js +101 -0
- package/dist/safe-bash/command-chunks/chunk-2UUFZMOH.js +503 -0
- package/dist/safe-bash/command-chunks/chunk-2VGAC6S6.js +393 -0
- package/dist/safe-bash/command-chunks/chunk-2W54TAGI.js +162 -0
- package/dist/safe-bash/command-chunks/chunk-326A5G42.js +328 -0
- package/dist/safe-bash/command-chunks/chunk-36KIT4DU.js +218 -0
- package/dist/safe-bash/command-chunks/chunk-3CHQG25N.js +455 -0
- package/dist/safe-bash/command-chunks/chunk-3JQ3RF2O.js +72 -0
- package/dist/safe-bash/command-chunks/chunk-3MLJWSYL.js +92 -0
- package/dist/safe-bash/command-chunks/{chunk-ASYR2LU7.js → chunk-3RQCLLQA.js} +5 -5
- package/dist/safe-bash/command-chunks/chunk-3SEQG5JH.js +521 -0
- package/dist/safe-bash/command-chunks/chunk-3SWT2KYH.js +78 -0
- package/dist/safe-bash/command-chunks/chunk-3VETFXYR.js +170 -0
- package/dist/safe-bash/command-chunks/chunk-3W6PTHHB.js +65 -0
- package/dist/safe-bash/command-chunks/chunk-457CU3IC.js +8 -0
- package/dist/safe-bash/command-chunks/chunk-45BW6MGM.js +250 -0
- package/dist/safe-bash/command-chunks/chunk-47MFDPH4.js +419 -0
- package/dist/safe-bash/command-chunks/chunk-4ATHODCG.js +444 -0
- package/dist/safe-bash/command-chunks/chunk-4DJICIFV.js +227 -0
- package/dist/safe-bash/command-chunks/chunk-4FNQPK7C.js +385 -0
- package/dist/safe-bash/command-chunks/chunk-4LXDJES2.js +65 -0
- package/dist/safe-bash/command-chunks/chunk-4QRXKUD2.js +662 -0
- package/dist/safe-bash/command-chunks/chunk-4QYNOBWZ.js +455 -0
- package/dist/safe-bash/command-chunks/{chunk-MWNWT6HG.js → chunk-4XFFIKA3.js} +5 -5
- package/dist/safe-bash/command-chunks/chunk-5AU5ENL5.js +180 -0
- package/dist/safe-bash/command-chunks/chunk-5DFZAJHL.js +324 -0
- package/dist/safe-bash/command-chunks/chunk-5GEFJROP.js +270 -0
- package/dist/safe-bash/command-chunks/chunk-5HWX4XYW.js +263 -0
- package/dist/safe-bash/command-chunks/chunk-5LKNP4IF.js +872 -0
- package/dist/safe-bash/command-chunks/chunk-5OEHUIVE.js +240 -0
- package/dist/safe-bash/command-chunks/chunk-6EHVFKM7.js +171 -0
- package/dist/safe-bash/command-chunks/chunk-6JTPLJ3B.js +155 -0
- package/dist/safe-bash/command-chunks/chunk-6KLUPQ65.js +496 -0
- package/dist/safe-bash/command-chunks/chunk-6NS5RXQ7.js +285 -0
- package/dist/safe-bash/command-chunks/chunk-6PJIQEH4.js +3472 -0
- package/dist/safe-bash/command-chunks/chunk-763ECQWB.js +566 -0
- package/dist/safe-bash/command-chunks/chunk-7DADVPKN.js +23 -0
- package/dist/safe-bash/command-chunks/chunk-7LEADSSA.js +164 -0
- package/dist/safe-bash/command-chunks/chunk-7MMSBVUP.js +732 -0
- package/dist/safe-bash/command-chunks/chunk-7OXNWLSL.js +35 -0
- package/dist/safe-bash/command-chunks/chunk-7PZASWL6.js +354 -0
- package/dist/safe-bash/command-chunks/{chunk-ZBR3UH4P.js → chunk-7QH3WAMQ.js} +2 -2
- package/dist/safe-bash/command-chunks/{chunk-CB3HTIDK.js → chunk-7SOE7XIS.js} +11 -11
- package/dist/safe-bash/command-chunks/chunk-7Y3ZQ6FE.js +56 -0
- package/dist/safe-bash/command-chunks/chunk-A2YEQYCC.js +289 -0
- package/dist/safe-bash/command-chunks/chunk-A3XE767Q.js +502 -0
- package/dist/safe-bash/command-chunks/{chunk-MWY75E3F.js → chunk-A6LCBGE6.js} +187 -187
- package/dist/safe-bash/command-chunks/{chunk-HFUL6E5I.js → chunk-A7CE4EIU.js} +33 -151
- package/dist/safe-bash/command-chunks/chunk-A7EMM3SB.js +297 -0
- package/dist/safe-bash/command-chunks/{chunk-G3YO3JIN.js → chunk-ABH5FMMA.js} +1 -1
- package/dist/safe-bash/command-chunks/chunk-AEJZEGW7.js +1376 -0
- package/dist/safe-bash/command-chunks/chunk-AELXRNM6.js +207 -0
- package/dist/safe-bash/command-chunks/chunk-AEZIPWRI.js +260 -0
- package/dist/safe-bash/command-chunks/{chunk-AHD3CGAY.js → chunk-AFPXADZG.js} +4 -4
- package/dist/safe-bash/command-chunks/chunk-AIOB34IX.js +201 -0
- package/dist/safe-bash/command-chunks/chunk-AJEYCC4X.js +262 -0
- package/dist/safe-bash/command-chunks/chunk-ALMHXDKZ.js +321 -0
- package/dist/safe-bash/command-chunks/chunk-AQ6RTM2M.js +309 -0
- package/dist/safe-bash/command-chunks/chunk-AQNFEGMZ.js +481 -0
- package/dist/safe-bash/command-chunks/{chunk-2AKKYY5G.js → chunk-ASZ4EMKE.js} +1 -1
- package/dist/safe-bash/command-chunks/chunk-AYJGINE5.js +144 -0
- package/dist/safe-bash/command-chunks/{chunk-MRFW2E6B.js → chunk-B4UWZCQR.js} +1 -1
- package/dist/safe-bash/command-chunks/chunk-BDYKJTBQ.js +43 -0
- package/dist/safe-bash/command-chunks/chunk-BERVTMQB.js +41 -0
- package/dist/safe-bash/command-chunks/chunk-BZOY2UMP.js +275 -0
- package/dist/safe-bash/command-chunks/{chunk-W47KIMSP.js → chunk-C2EYJT4S.js} +1 -1
- package/dist/safe-bash/command-chunks/chunk-CK5Q6RDE.js +342 -0
- package/dist/safe-bash/command-chunks/chunk-CKEODJVT.js +992 -0
- package/dist/safe-bash/command-chunks/{chunk-Z7UIOPHJ.js → chunk-DCMSPMMD.js} +1 -1
- package/dist/safe-bash/command-chunks/chunk-DE66JRWJ.js +352 -0
- package/dist/safe-bash/command-chunks/chunk-DKNNYPOI.js +409 -0
- package/dist/safe-bash/command-chunks/chunk-DV745GFU.js +294 -0
- package/dist/safe-bash/command-chunks/chunk-DXX2Z2QA.js +33 -0
- package/dist/safe-bash/command-chunks/chunk-E7AYF54A.js +473 -0
- package/dist/safe-bash/command-chunks/chunk-EDSFQJAU.js +159 -0
- package/dist/safe-bash/command-chunks/{chunk-UQ3KEUCF.js → chunk-ESD5ZD74.js} +7 -1
- package/dist/safe-bash/command-chunks/chunk-EUXUCRCI.js +1739 -0
- package/dist/safe-bash/command-chunks/chunk-F2ORFLCH.js +3669 -0
- package/dist/safe-bash/command-chunks/chunk-FANIWOBM.js +311 -0
- package/dist/safe-bash/command-chunks/chunk-FOO3AXFK.js +47 -0
- package/dist/safe-bash/command-chunks/chunk-FRZ5P5AB.js +131 -0
- package/dist/safe-bash/command-chunks/chunk-FZSQMMYV.js +276 -0
- package/dist/safe-bash/command-chunks/{chunk-P6NUIMMX.js → chunk-G5F2VSQ7.js} +1 -1
- package/dist/safe-bash/command-chunks/chunk-GGOZXIGH.js +299 -0
- package/dist/safe-bash/command-chunks/chunk-GIESJLR2.js +241 -0
- package/dist/safe-bash/command-chunks/chunk-GLPIFP7N.js +385 -0
- package/dist/safe-bash/command-chunks/chunk-GZ2N24A2.js +342 -0
- package/dist/safe-bash/command-chunks/chunk-H2NWPMNW.js +216 -0
- package/dist/safe-bash/command-chunks/chunk-HHLVI2CB.js +3949 -0
- package/dist/safe-bash/command-chunks/chunk-HJDE7ZNV.js +82 -0
- package/dist/safe-bash/command-chunks/chunk-HOAM3F5I.js +124 -0
- package/dist/safe-bash/command-chunks/chunk-HPKUFWHW.js +482 -0
- package/dist/safe-bash/command-chunks/chunk-HPMVMOD2.js +109 -0
- package/dist/safe-bash/command-chunks/chunk-HQAHDJPX.js +8 -0
- package/dist/safe-bash/command-chunks/chunk-HR2Y6YEP.js +12 -0
- package/dist/safe-bash/command-chunks/chunk-HUNXIAOL.js +62 -0
- package/dist/safe-bash/command-chunks/chunk-I4JWZOSP.js +244 -0
- package/dist/safe-bash/command-chunks/chunk-I6AMDG2T.js +85 -0
- package/dist/safe-bash/command-chunks/chunk-IB2Q5CL3.js +288 -0
- package/dist/safe-bash/command-chunks/chunk-IFNLDOJ4.js +316 -0
- package/dist/safe-bash/command-chunks/chunk-IKHBXETN.js +174 -0
- package/dist/safe-bash/command-chunks/chunk-IOSWG5JS.js +228 -0
- package/dist/safe-bash/command-chunks/chunk-IQFRPIXH.js +317 -0
- package/dist/safe-bash/command-chunks/chunk-IR6ZKAUH.js +582 -0
- package/dist/safe-bash/command-chunks/chunk-IW7PEB4I.js +297 -0
- package/dist/safe-bash/command-chunks/chunk-JGGRMERW.js +36 -0
- package/dist/safe-bash/command-chunks/chunk-JHAY3KYC.js +520 -0
- package/dist/safe-bash/command-chunks/{chunk-UO25D4WG.js → chunk-JITDS55R.js} +22 -22
- package/dist/safe-bash/command-chunks/chunk-JJK3CU7Z.js +6 -0
- package/dist/safe-bash/command-chunks/{chunk-XKZWUMH4.js → chunk-JN7GNI2C.js} +1 -1
- package/dist/safe-bash/command-chunks/chunk-JQ3EJKHF.js +160 -0
- package/dist/safe-bash/command-chunks/chunk-JQE256UO.js +292 -0
- package/dist/safe-bash/command-chunks/chunk-JQZ3BXWY.js +382 -0
- package/dist/safe-bash/command-chunks/{chunk-7DLR4HCC.js → chunk-JWSOFSGI.js} +22 -22
- package/dist/safe-bash/command-chunks/chunk-K3CDZMUN.js +168 -0
- package/dist/safe-bash/command-chunks/{chunk-SUYSZJI3.js → chunk-K5COUQAQ.js} +4 -4
- package/dist/safe-bash/command-chunks/chunk-K7HUXUN2.js +489 -0
- package/dist/safe-bash/command-chunks/chunk-KB3CY3QO.js +62 -0
- package/dist/safe-bash/command-chunks/chunk-KCBVOYAY.js +92 -0
- package/dist/safe-bash/command-chunks/chunk-KD25ICP4.js +366 -0
- package/dist/safe-bash/command-chunks/chunk-KDKQ5D55.js +180 -0
- package/dist/safe-bash/command-chunks/chunk-KNKDUEDW.js +521 -0
- package/dist/safe-bash/command-chunks/chunk-KR2PQ7GD.js +174 -0
- package/dist/safe-bash/command-chunks/chunk-KS6WUDPM.js +153 -0
- package/dist/safe-bash/command-chunks/{chunk-XFHUSZBM.js → chunk-KUGV3SSL.js} +5 -5
- package/dist/safe-bash/command-chunks/chunk-L2JAP5KO.js +249 -0
- package/dist/safe-bash/command-chunks/chunk-L2KEA6SN.js +271 -0
- package/dist/safe-bash/command-chunks/chunk-L3WY5ASN.js +526 -0
- package/dist/safe-bash/command-chunks/chunk-L4XEXXVQ.js +399 -0
- package/dist/safe-bash/command-chunks/chunk-LDTUZIJK.js +90 -0
- package/dist/safe-bash/command-chunks/chunk-LHDB4QO5.js +479 -0
- package/dist/safe-bash/command-chunks/chunk-LHL6RWGJ.js +548 -0
- package/dist/safe-bash/command-chunks/chunk-LHRXDH45.js +164 -0
- package/dist/safe-bash/command-chunks/chunk-LQOKYG3O.js +153 -0
- package/dist/safe-bash/command-chunks/chunk-LRDME6WV.js +12 -0
- package/dist/safe-bash/command-chunks/chunk-LWVDJB5S.js +305 -0
- package/dist/safe-bash/command-chunks/chunk-M57GLLK4.js +27 -0
- package/dist/safe-bash/command-chunks/chunk-MAHX3IW3.js +108 -0
- package/dist/safe-bash/command-chunks/{chunk-LQZSR6DT.js → chunk-MDV7W5AS.js} +2 -2
- package/dist/safe-bash/command-chunks/chunk-MG7AJD5E.js +168 -0
- package/dist/safe-bash/command-chunks/chunk-MHJ3DQUE.js +213 -0
- package/dist/safe-bash/command-chunks/chunk-MLGNBD7V.js +552 -0
- package/dist/safe-bash/command-chunks/chunk-MN2M33JK.js +237 -0
- package/dist/safe-bash/command-chunks/chunk-MOL3TRBT.js +32 -0
- package/dist/safe-bash/command-chunks/chunk-MQFXMBGD.js +75 -0
- package/dist/safe-bash/command-chunks/chunk-MQPWE22J.js +171 -0
- package/dist/safe-bash/command-chunks/chunk-MQU6Q75R.js +523 -0
- package/dist/safe-bash/command-chunks/chunk-MWAAMNAM.js +353 -0
- package/dist/safe-bash/command-chunks/chunk-MZ4BTMTI.js +240 -0
- package/dist/safe-bash/command-chunks/chunk-N4DY4FPA.js +679 -0
- package/dist/safe-bash/command-chunks/chunk-N74TJL6X.js +183 -0
- package/dist/safe-bash/command-chunks/chunk-NA5Q4V2H.js +304 -0
- package/dist/safe-bash/command-chunks/chunk-NSM366N6.js +22 -0
- package/dist/safe-bash/command-chunks/chunk-NY4ZPV3N.js +523 -0
- package/dist/safe-bash/command-chunks/chunk-NYBF2BVE.js +17 -0
- package/dist/safe-bash/command-chunks/chunk-OBK24KGM.js +24 -0
- package/dist/safe-bash/command-chunks/{chunk-GDAS4LY7.js → chunk-OEKLEUUW.js} +4 -4
- package/dist/safe-bash/command-chunks/chunk-OGWJD5QP.js +404 -0
- package/dist/safe-bash/command-chunks/chunk-OIPATOZW.js +154 -0
- package/dist/safe-bash/command-chunks/chunk-OP6J3OLL.js +243 -0
- package/dist/safe-bash/command-chunks/chunk-OTTMIB3C.js +266 -0
- package/dist/safe-bash/command-chunks/{chunk-OZHPB4KD.js → chunk-OU4VE5CR.js} +12 -12
- package/dist/safe-bash/command-chunks/chunk-P42REFYL.js +228 -0
- package/dist/safe-bash/command-chunks/{chunk-YJ3TFZB2.js → chunk-PQOAM5SC.js} +1 -1
- package/dist/safe-bash/command-chunks/chunk-PQOIOVF2.js +444 -0
- package/dist/safe-bash/command-chunks/chunk-PRQEVUNE.js +205 -0
- package/dist/safe-bash/command-chunks/{chunk-W5OR7COJ.js → chunk-PVLPWVRH.js} +21 -21
- package/dist/safe-bash/command-chunks/{chunk-BNG4ZMZ3.js → chunk-PXL4NBYP.js} +1 -78
- package/dist/safe-bash/command-chunks/chunk-Q6W5FRZG.js +41 -0
- package/dist/safe-bash/command-chunks/{chunk-KLCHCSIV.js → chunk-QGD64UHJ.js} +1 -1
- package/dist/safe-bash/command-chunks/chunk-QHS7PDG3.js +188 -0
- package/dist/safe-bash/command-chunks/chunk-QXCSASIE.js +151 -0
- package/dist/safe-bash/command-chunks/chunk-QYCBVKFT.js +255 -0
- package/dist/safe-bash/command-chunks/chunk-R4TYL2G6.js +1529 -0
- package/dist/safe-bash/command-chunks/chunk-RAXJVM4U.js +625 -0
- package/dist/safe-bash/command-chunks/chunk-RBFZYSZZ.js +207 -0
- package/dist/safe-bash/command-chunks/chunk-RJHVJZ4H.js +185 -0
- package/dist/safe-bash/command-chunks/chunk-RKPPUYZE.js +213 -0
- package/dist/safe-bash/command-chunks/chunk-RMJNV6Q7.js +23 -0
- package/dist/safe-bash/command-chunks/{chunk-MR2RLUPV.js → chunk-RQHQCJMV.js} +11 -9
- package/dist/safe-bash/command-chunks/chunk-RR6QQ25D.js +71 -0
- package/dist/safe-bash/command-chunks/{chunk-JW3KIZU6.js → chunk-RUXY7GN5.js} +1 -1
- package/dist/safe-bash/command-chunks/chunk-RZC7QHL6.js +112 -0
- package/dist/safe-bash/command-chunks/chunk-RZJRR4UJ.js +1677 -0
- package/dist/safe-bash/command-chunks/chunk-S4OBYRNI.js +639 -0
- package/dist/safe-bash/command-chunks/{chunk-DQNDEWCI.js → chunk-S65T5JJO.js} +12 -12
- package/dist/safe-bash/command-chunks/chunk-S6PPBBXX.js +77 -0
- package/dist/safe-bash/command-chunks/chunk-SCG4LK5U.js +265 -0
- package/dist/safe-bash/command-chunks/chunk-SDTC2BLK.js +143 -0
- package/dist/safe-bash/command-chunks/chunk-SEK43FRN.js +357 -0
- package/dist/safe-bash/command-chunks/chunk-SH45NZ2P.js +194 -0
- package/dist/safe-bash/command-chunks/chunk-SM733XRT.js +250 -0
- package/dist/safe-bash/command-chunks/chunk-SSRGI476.js +116 -0
- package/dist/safe-bash/command-chunks/chunk-SUUD352U.js +127 -0
- package/dist/safe-bash/command-chunks/{chunk-B5F2KQYA.js → chunk-SWUVHT7G.js} +1 -1
- package/dist/safe-bash/command-chunks/chunk-TBAH4XGI.js +38 -0
- package/dist/safe-bash/command-chunks/chunk-TBVWTZTR.js +469 -0
- package/dist/safe-bash/command-chunks/chunk-TGHQGJNR.js +144 -0
- package/dist/safe-bash/command-chunks/{chunk-Q6JLT2EY.js → chunk-TL3KDYEM.js} +8 -110
- package/dist/safe-bash/command-chunks/chunk-TVAEX4WQ.js +473 -0
- package/dist/safe-bash/command-chunks/chunk-TZ2J6LGM.js +163 -0
- package/dist/safe-bash/command-chunks/chunk-UICO7H6S.js +186 -0
- package/dist/safe-bash/command-chunks/chunk-UJTJFMIN.js +501 -0
- package/dist/safe-bash/command-chunks/chunk-UMWWCLBG.js +109 -0
- package/dist/safe-bash/command-chunks/chunk-UPXFSGQG.js +134 -0
- package/dist/safe-bash/command-chunks/chunk-UWUYSXYT.js +272 -0
- package/dist/safe-bash/command-chunks/{chunk-5FMXQUDY.js → chunk-UZOGSYJP.js} +1 -1
- package/dist/safe-bash/command-chunks/chunk-V3RGA5PS.js +125 -0
- package/dist/safe-bash/command-chunks/chunk-VEUQWV2V.js +287 -0
- package/dist/safe-bash/command-chunks/chunk-VGKYTZT5.js +161 -0
- package/dist/safe-bash/command-chunks/chunk-VQUEIEVP.js +410 -0
- package/dist/safe-bash/command-chunks/chunk-VU3YUC3U.js +169 -0
- package/dist/safe-bash/command-chunks/chunk-W32KW66B.js +27 -0
- package/dist/safe-bash/command-chunks/chunk-W543LSYH.js +899 -0
- package/dist/safe-bash/command-chunks/chunk-W5YFDYHO.js +387 -0
- package/dist/safe-bash/command-chunks/chunk-W6DV2CLS.js +267 -0
- package/dist/safe-bash/command-chunks/chunk-WAKYUXVQ.js +215 -0
- package/dist/safe-bash/command-chunks/chunk-WGOL3MM6.js +125 -0
- package/dist/safe-bash/command-chunks/{chunk-N2A7V3WY.js → chunk-WHNYT34N.js} +3 -3
- package/dist/safe-bash/command-chunks/chunk-WOZCIRJ5.js +169 -0
- package/dist/safe-bash/command-chunks/chunk-WVB6ONZS.js +232 -0
- package/dist/safe-bash/command-chunks/chunk-WVESNAND.js +25 -0
- package/dist/safe-bash/command-chunks/chunk-XDEA3TL5.js +322 -0
- package/dist/safe-bash/command-chunks/chunk-XFEUWSYG.js +357 -0
- package/dist/safe-bash/command-chunks/chunk-XFMJ4RMS.js +2849 -0
- package/dist/safe-bash/command-chunks/chunk-XH6DXJHX.js +196 -0
- package/dist/safe-bash/command-chunks/chunk-XNJ67APB.js +6 -0
- package/dist/safe-bash/command-chunks/chunk-XP6BHGZ6.js +227 -0
- package/dist/safe-bash/command-chunks/chunk-XXFHTGV2.js +142 -0
- package/dist/safe-bash/command-chunks/chunk-Y5GI5PVT.js +139 -0
- package/dist/safe-bash/command-chunks/chunk-Y6KHC3JB.js +177 -0
- package/dist/safe-bash/command-chunks/{chunk-2UWPMSME.js → chunk-Y72LPXST.js} +8 -8
- package/dist/safe-bash/command-chunks/chunk-YDRWQZNB.js +69 -0
- package/dist/safe-bash/command-chunks/{chunk-P4OJBL2B.js → chunk-YFZ6FPIC.js} +1 -1
- package/dist/safe-bash/command-chunks/chunk-YH4DC4RP.js +171 -0
- package/dist/safe-bash/command-chunks/chunk-YH7KKMMN.js +463 -0
- package/dist/safe-bash/command-chunks/{chunk-MN3BB4WW.js → chunk-YP3WWV5N.js} +4 -4
- package/dist/safe-bash/command-chunks/chunk-YPVBU7QF.js +2817 -0
- package/dist/safe-bash/command-chunks/chunk-YQYVEVUE.js +1621 -0
- package/dist/safe-bash/command-chunks/chunk-YRNBIU5U.js +175 -0
- package/dist/safe-bash/command-chunks/chunk-Z7ESJVFP.js +10 -0
- package/dist/safe-bash/command-chunks/chunk-ZTAFAHY3.js +653 -0
- package/dist/safe-bash/command-chunks/chunk-ZXKOMB24.js +85 -0
- package/dist/safe-bash/command-chunks/{clipboard-XCSQACOK-SHFXT53F.js → clipboard-6SDGQGC3-TVJ3CG7A.js} +4 -4
- package/dist/safe-bash/command-chunks/{command-engine-4TEGTXCQ.js → command-engine-KMLHVFMA.js} +356 -316
- package/dist/safe-bash/command-chunks/{engine-QDC5VCGO-LYAAFESF.js → engine-EOYR2WTY-KUFLFTDE.js} +2 -4
- package/dist/safe-bash/command-chunks/{gnumeric-OCFH63UT-YI7SG7TN.js → gnumeric-ABKSRBZJ-MPIIPXKP.js} +3 -3
- package/dist/safe-bash/command-chunks/inspection-command-ULEU7ZVV.js +7 -0
- package/dist/safe-bash/command-chunks/model-store-JUFU3RSW.js +54 -0
- package/dist/safe-bash/command-chunks/pdf-22JDKKAR-UDWNSWYB.js +338 -0
- package/dist/safe-bash/command-chunks/{pptx-XG3YSXWZ-XAG36NAB.js → pptx-YDKHIGCD-H7FU4VMJ.js} +2 -2
- package/dist/safe-bash/commands/bc/index.browser.js +2 -2
- package/dist/safe-bash/commands/diffpdf/index.d.ts +2 -0
- package/dist/safe-bash/commands/diffpdf/index.js +2 -0
- package/dist/safe-bash/commands/dot/index.d.ts +2 -0
- package/dist/safe-bash/commands/dot/index.js +2 -0
- package/dist/safe-bash/commands/llm/collections.browser.js +6 -0
- package/dist/safe-bash/commands/llm/collections.d.ts +2 -0
- package/dist/safe-bash/commands/llm/collections.js +2 -0
- package/dist/safe-bash/commands/pandoc/index.browser.js +1 -1
- package/dist/safe-bash/commands/rsvg-convert/index.d.ts +2 -0
- package/dist/safe-bash/commands/rsvg-convert/index.js +2 -0
- package/dist/safe-bash/commands/safejs/io.d.ts +1 -1
- package/dist/safe-bash/commands/safejs/io.js +1 -1
- package/dist/safe-bash/commands/safejs/options.d.ts +1 -1
- package/dist/safe-bash/commands/safejs/options.js +1 -1
- package/dist/safe-bash/commands/safejs/render.d.ts +1 -1
- package/dist/safe-bash/commands/safejs/render.js +1 -1
- package/dist/safe-bash/commands/safejs/runtime.d.ts +1 -1
- package/dist/safe-bash/commands/safejs/runtime.js +1 -1
- package/dist/safe-bash/commands/safejs/types.d.ts +1 -1
- package/dist/safe-bash/commands/safejs/types.js +1 -1
- package/dist/safe-bash/commands/wdiff/index.d.ts +2 -0
- package/dist/safe-bash/commands/wdiff/index.js +2 -0
- package/dist/safe-bash/core.d.ts +4 -0
- package/dist/safe-bash/core.js +4 -0
- package/dist/safe-bash/full-core.browser.js +59 -35
- package/dist/safe-bash/optional-host.browser.js +7 -7
- package/dist/safe-bash/plugins/index.browser.js +7 -7
- package/dist/safe-bash/registry-entry.browser.js +6 -6
- package/dist/safe-bash/search.browser.js +2 -2
- package/dist/safe-bash/shell-entry.browser.js +3 -3
- package/dist/safe-bash-checksum-engine/index.js +83 -40
- package/dist/safe-bash-checksum-engine/md5.d.ts +2 -0
- package/dist/safe-bash-checksum-engine/md5.js +7 -0
- package/dist/safe-bash-command-awk/awk-inspection.js +2 -2
- package/dist/safe-bash-command-awk/awk-runtime.js +2 -2
- package/dist/safe-bash-command-awk/awk.js +7 -7
- package/dist/safe-bash-command-awk/index.js +7 -7
- package/dist/safe-bash-command-chmod/command.js +1 -1
- package/dist/safe-bash-command-chmod/index.js +1 -1
- package/dist/safe-bash-command-csvkit/index.js +6 -6
- package/dist/safe-bash-command-diff/index.js +3 -3
- package/dist/safe-bash-command-diffpdf/LICENSE +21 -0
- package/dist/safe-bash-command-diffpdf/index.d.ts +12 -0
- package/dist/safe-bash-command-diffpdf/index.js +107 -0
- package/dist/safe-bash-command-docx/command.d.ts +36 -0
- package/dist/{safe-bash-docx-engine → safe-bash-command-docx}/discovery.d.ts +4 -4
- package/dist/safe-bash-command-docx/index.js +1 -1
- package/dist/{safe-bash-docx-engine → safe-bash-command-docx}/inspection-command.d.ts +6 -6
- package/dist/safe-bash-command-docx/sdk.d.ts +4 -0
- package/dist/safe-bash-command-docx/sdk.js +24 -0
- package/dist/safe-bash-command-dot/LICENSE +21 -0
- package/dist/safe-bash-command-dot/index.d.ts +14 -0
- package/dist/safe-bash-command-dot/index.js +1298 -0
- package/dist/safe-bash-command-du/arguments.d.ts +1 -1
- package/dist/safe-bash-command-du/arguments.js +1 -1
- package/dist/safe-bash-command-du/du.js +2 -2
- package/dist/safe-bash-command-du/index.js +2 -2
- package/dist/safe-bash-command-factor/command.js +2 -2
- package/dist/safe-bash-command-factor/index.js +2 -2
- package/dist/safe-bash-command-ffmpeg/index.js +16 -16
- package/dist/safe-bash-command-imagemagick/index.js +21 -53
- package/dist/safe-bash-command-llm/collections-embed.d.ts +23 -0
- package/dist/safe-bash-command-llm/collections.d.ts +38 -0
- package/dist/safe-bash-command-llm/collections.js +423 -0
- package/dist/safe-bash-command-llm/command.js +4 -2
- package/dist/safe-bash-command-llm/index.js +12 -8
- package/dist/safe-bash-command-llm/openai.js +4 -3
- package/dist/safe-bash-command-llm/providers/index.js +6 -4
- package/dist/safe-bash-command-llm/providers/openai.js +4 -3
- package/dist/safe-bash-command-node/commands/node/browser.js +9 -12
- package/dist/safe-bash-command-node/commands/node/buffer.js +2 -2
- package/dist/safe-bash-command-node/commands/node/default-runtime.js +9 -12
- package/dist/safe-bash-command-node/commands/node/filesystem.js +3 -3
- package/dist/safe-bash-command-node/commands/node/safejs.js +9 -12
- package/dist/safe-bash-command-node/commands/node/source-maps.js +2 -2
- package/dist/safe-bash-command-node/commands/node/timers.js +3 -3
- package/dist/safe-bash-command-node/commands/safejs/io.d.ts +1 -35
- package/dist/safe-bash-command-node/commands/safejs/io.js +3 -7
- package/dist/safe-bash-command-node/commands/safejs/options.d.ts +2 -22
- package/dist/safe-bash-command-node/commands/safejs/options.js +1 -1
- package/dist/safe-bash-command-node/commands/safejs/render.d.ts +1 -1
- package/dist/safe-bash-command-node/commands/safejs/render.js +3 -5
- package/dist/safe-bash-command-node/commands/safejs/runtime.d.ts +2 -25
- package/dist/safe-bash-command-node/commands/safejs/runtime.js +1 -7
- package/dist/safe-bash-command-node/commands/safejs/types.d.ts +2 -85
- package/dist/safe-bash-command-node/commands/safejs/types.js +1 -1
- package/dist/safe-bash-command-node/integrations/safejs/filesystem.d.ts +2 -5
- package/dist/safe-bash-command-node/integrations/safejs/filesystem.js +3 -3
- package/dist/safe-bash-command-node/integrations/safejs/shell.js +1 -1
- package/dist/safe-bash-command-node/integrations/safejs/values.d.ts +1 -7
- package/dist/safe-bash-command-node/integrations/safejs/values.js +1 -1
- package/dist/safe-bash-command-openssl/index.js +15452 -420
- package/dist/safe-bash-command-pandoc/command.js +1 -1
- package/dist/safe-bash-command-pandoc/index.js +1 -1
- package/dist/safe-bash-command-patch/index.js +5 -5
- package/dist/safe-bash-command-patch/patch.js +4 -4
- package/dist/safe-bash-command-playwright-cli/index.js +25 -25
- package/dist/safe-bash-command-playwright-cli/playwright/abilities.js +8 -8
- package/dist/safe-bash-command-playwright-cli/playwright/controller.js +16 -16
- package/dist/safe-bash-command-playwright-cli/playwright/index.js +25 -25
- package/dist/safe-bash-command-playwright-cli/playwright/standard-capabilities.js +4 -4
- package/dist/{safe-bash-pptx-engine → safe-bash-command-pptx}/command-engine.d.ts +5 -13
- package/dist/safe-bash-command-pptx/engine.d.ts +4 -0
- package/dist/safe-bash-command-pptx/engine.js +37 -0
- package/dist/safe-bash-command-pptx/index.js +1 -1
- package/dist/safe-bash-command-python/executor.js +15 -15
- package/dist/safe-bash-command-python/index.js +15 -15
- package/dist/safe-bash-command-python/jspi.js +4 -4
- package/dist/safe-bash-command-qrencode/index.js +1 -4
- package/dist/safe-bash-command-rsvg-convert/LICENSE +21 -0
- package/dist/safe-bash-command-rsvg-convert/index.d.ts +13 -0
- package/dist/safe-bash-command-rsvg-convert/index.js +84 -0
- package/dist/safe-bash-command-safejs/LICENSE +21 -0
- package/dist/safe-bash-command-safejs/filesystem.d.ts +5 -0
- package/dist/safe-bash-command-safejs/filesystem.js +7 -0
- package/dist/safe-bash-command-safejs/index.d.ts +4 -0
- package/dist/safe-bash-command-safejs/index.js +19 -0
- package/dist/safe-bash-command-safejs/io.d.ts +35 -0
- package/dist/safe-bash-command-safejs/io.js +12 -0
- package/dist/safe-bash-command-safejs/options.d.ts +22 -0
- package/dist/safe-bash-command-safejs/options.js +11 -0
- package/dist/safe-bash-command-safejs/render.d.ts +1 -0
- package/dist/safe-bash-command-safejs/render.js +9 -0
- package/dist/safe-bash-command-safejs/runtime.d.ts +25 -0
- package/dist/safe-bash-command-safejs/runtime.js +13 -0
- package/dist/safe-bash-command-safejs/types.d.ts +85 -0
- package/dist/safe-bash-command-safejs/types.js +7 -0
- package/dist/safe-bash-command-safejs/values.d.ts +7 -0
- package/dist/safe-bash-command-safejs/values.js +19 -0
- package/dist/safe-bash-command-sips/index.js +1 -14
- package/dist/safe-bash-command-ssconvert/index.js +413 -546
- package/dist/safe-bash-command-ssconvert/rendering/chart/axis.d.ts +1 -26
- package/dist/safe-bash-command-ssconvert/rendering/chart/error-bar.d.ts +1 -39
- package/dist/safe-bash-command-ssconvert/rendering/chart/layout.d.ts +1 -24
- package/dist/safe-bash-command-ssconvert/rendering/chart/line.d.ts +1 -23
- package/dist/safe-bash-command-ssconvert/rendering/chart/marker.d.ts +1 -35
- package/dist/safe-bash-command-ssconvert/rendering/chart/pie.d.ts +1 -32
- package/dist/safe-bash-command-ssconvert/rendering/images/index.d.ts +1 -26
- package/dist/safe-bash-command-ssconvert/rendering/print/header-footer.d.ts +1 -16
- package/dist/safe-bash-command-ssconvert/rendering/print/layout.d.ts +1 -65
- package/dist/safe-bash-command-ssconvert/rendering/print/pagination.d.ts +1 -34
- package/dist/safe-bash-command-tar/create.js +4 -4
- package/dist/safe-bash-command-tar/extract.js +4 -4
- package/dist/safe-bash-command-tar/index.js +16 -14
- package/dist/safe-bash-command-tar/modes.js +6 -6
- package/dist/safe-bash-command-tar/options.d.ts +3 -1
- package/dist/safe-bash-command-tar/options.js +1 -1
- package/dist/safe-bash-command-unzip/index.js +4 -4
- package/dist/safe-bash-command-wdiff/LICENSE +21 -0
- package/dist/safe-bash-command-wdiff/index.d.ts +12 -0
- package/dist/safe-bash-command-wdiff/index.js +123 -0
- package/dist/safe-bash-compression-engine/bounded-codec.js +2 -2
- package/dist/safe-bash-compression-engine/codec-loader.js +1 -1
- package/dist/safe-bash-compression-engine/files.js +5 -5
- package/dist/safe-bash-compression-engine/index.js +4 -4
- package/dist/safe-bash-compression-engine/operand.js +5 -5
- package/dist/safe-bash-compression-engine/stream.js +4 -4
- package/dist/safe-bash-compression-engine/zstd-decode.js +3 -3
- package/dist/safe-bash-contracts/escaping.js +2 -2
- package/dist/safe-bash-contracts/index.js +15 -15
- package/dist/safe-bash-docx-engine/admission.js +31 -0
- package/dist/safe-bash-docx-engine/ancillary-resources.js +38 -0
- package/dist/safe-bash-docx-engine/archive.js +24 -0
- package/dist/safe-bash-docx-engine/argument-json.js +25 -0
- package/dist/safe-bash-docx-engine/batch-operations.d.ts +7 -0
- package/dist/safe-bash-docx-engine/batch-operations.js +95 -0
- package/dist/safe-bash-docx-engine/batch-result-schema.d.ts +2 -0
- package/dist/safe-bash-docx-engine/batch-result-schema.js +145 -0
- package/dist/safe-bash-docx-engine/batch.js +106 -0
- package/dist/safe-bash-docx-engine/bookmarks.js +43 -0
- package/dist/safe-bash-docx-engine/budget.js +18 -0
- package/dist/safe-bash-docx-engine/charts.js +35 -0
- package/dist/safe-bash-docx-engine/command-option-rules.d.ts +1 -0
- package/dist/safe-bash-docx-engine/command-option-rules.js +24 -0
- package/dist/safe-bash-docx-engine/command-properties.d.ts +1 -0
- package/dist/safe-bash-docx-engine/command-properties.js +18 -0
- package/dist/safe-bash-docx-engine/command-selection.d.ts +1 -0
- package/dist/safe-bash-docx-engine/command-selection.js +15 -0
- package/dist/safe-bash-docx-engine/comments.js +53 -0
- package/dist/safe-bash-docx-engine/control-bindings.js +45 -0
- package/dist/safe-bash-docx-engine/control-repeat.js +46 -0
- package/dist/safe-bash-docx-engine/controls.js +52 -0
- package/dist/safe-bash-docx-engine/create.js +36 -0
- package/dist/safe-bash-docx-engine/diagrams.js +43 -0
- package/dist/safe-bash-docx-engine/diff.js +33 -0
- package/dist/safe-bash-docx-engine/discovery-result-schema.d.ts +72 -0
- package/dist/safe-bash-docx-engine/discovery-result-schema.js +36 -0
- package/dist/safe-bash-docx-engine/document-properties.js +43 -0
- package/dist/safe-bash-docx-engine/equations.js +53 -0
- package/dist/safe-bash-docx-engine/extract.js +40 -0
- package/dist/safe-bash-docx-engine/fields.js +48 -0
- package/dist/safe-bash-docx-engine/font-inventory.js +40 -0
- package/dist/safe-bash-docx-engine/font-resources.js +33 -0
- package/dist/safe-bash-docx-engine/image-batch-operations.d.ts +4 -0
- package/dist/safe-bash-docx-engine/image-batch-operations.js +35 -0
- package/dist/safe-bash-docx-engine/image-insertion.js +46 -0
- package/dist/safe-bash-docx-engine/image-layout.js +43 -0
- package/dist/safe-bash-docx-engine/image-replacement.js +48 -0
- package/dist/safe-bash-docx-engine/images.js +49 -0
- package/dist/safe-bash-docx-engine/index.d.ts +1 -3
- package/dist/safe-bash-docx-engine/index.js +369 -19350
- package/dist/safe-bash-docx-engine/inspection.js +49 -0
- package/dist/safe-bash-docx-engine/invocation.d.ts +50 -0
- package/dist/safe-bash-docx-engine/invocation.js +66 -0
- package/dist/safe-bash-docx-engine/io-errors.js +11 -0
- package/dist/safe-bash-docx-engine/io.js +29 -0
- package/dist/safe-bash-docx-engine/links.js +47 -0
- package/dist/safe-bash-docx-engine/lists.js +46 -0
- package/dist/safe-bash-docx-engine/location-token.js +27 -0
- package/dist/safe-bash-docx-engine/locations.js +39 -0
- package/dist/safe-bash-docx-engine/model-context.js +15 -0
- package/dist/safe-bash-docx-engine/model-errors.js +13 -0
- package/dist/safe-bash-docx-engine/notes.js +48 -0
- package/dist/safe-bash-docx-engine/objects.js +49 -0
- package/dist/safe-bash-docx-engine/operation-json-schema.js +21 -0
- package/dist/safe-bash-docx-engine/operation-schema.js +29 -0
- package/dist/safe-bash-docx-engine/pack-uri-batch-operations.d.ts +3 -0
- package/dist/safe-bash-docx-engine/pack-uri-batch-operations.js +15 -0
- package/dist/safe-bash-docx-engine/pack.js +38 -0
- package/dist/safe-bash-docx-engine/package-view-batch-operations.d.ts +4 -0
- package/dist/safe-bash-docx-engine/package-view-batch-operations.js +47 -0
- package/dist/safe-bash-docx-engine/package-xml.js +25 -0
- package/dist/safe-bash-docx-engine/pandoc-adapter.js +55 -6
- package/dist/safe-bash-docx-engine/paragraph-edit.js +52 -0
- package/dist/safe-bash-docx-engine/part-provider.js +18 -0
- package/dist/safe-bash-docx-engine/property-values.js +46 -0
- package/dist/safe-bash-docx-engine/publication.js +40 -0
- package/dist/safe-bash-docx-engine/removal.js +44 -0
- package/dist/safe-bash-docx-engine/revision-decisions.js +46 -0
- package/dist/safe-bash-docx-engine/revision-edit.js +43 -0
- package/dist/safe-bash-docx-engine/revisions.js +42 -0
- package/dist/safe-bash-docx-engine/run-format.js +43 -0
- package/dist/safe-bash-docx-engine/sanitize.js +59 -0
- package/dist/safe-bash-docx-engine/sections.js +47 -0
- package/dist/safe-bash-docx-engine/settings.js +36 -0
- package/dist/safe-bash-docx-engine/shape-edit.js +47 -0
- package/dist/safe-bash-docx-engine/signatures.js +42 -0
- package/dist/safe-bash-docx-engine/simple-selection.d.ts +1 -1
- package/dist/safe-bash-docx-engine/stories.js +48 -0
- package/dist/safe-bash-docx-engine/structure-model-batch-operations.d.ts +3 -0
- package/dist/safe-bash-docx-engine/structure-model-batch-operations.js +64 -0
- package/dist/safe-bash-docx-engine/style-model-batch-operations.js +57 -0
- package/dist/safe-bash-docx-engine/style-model-result-schema.d.ts +4 -0
- package/dist/safe-bash-docx-engine/style-model-result-schema.js +76 -0
- package/dist/safe-bash-docx-engine/styles.js +44 -0
- package/dist/safe-bash-docx-engine/table-edit.js +52 -0
- package/dist/safe-bash-docx-engine/table-read.js +38 -0
- package/dist/safe-bash-docx-engine/template.js +45 -0
- package/dist/safe-bash-docx-engine/text-replace.js +47 -0
- package/dist/safe-bash-docx-engine/text-resource-read.js +42 -0
- package/dist/safe-bash-docx-engine/text.js +36 -0
- package/dist/safe-bash-docx-engine/validation.js +30 -0
- package/dist/safe-bash-docx-engine/xml-parts.js +48 -0
- package/dist/safe-bash-markdown-engine/index.js +3 -3
- package/dist/safe-bash-network-engine/aggregate.js +3 -3
- package/dist/safe-bash-network-engine/args.js +3 -3
- package/dist/safe-bash-network-engine/body.js +4 -4
- package/dist/safe-bash-network-engine/decode.js +3 -3
- package/dist/safe-bash-network-engine/fetch-transport.js +3 -3
- package/dist/safe-bash-network-engine/index.js +3 -3
- package/dist/safe-bash-network-engine/output.js +3 -3
- package/dist/safe-bash-network-engine/platform-portable.js +3 -3
- package/dist/safe-bash-network-engine/shared.js +2 -2
- package/dist/safe-bash-network-engine/transfer.js +20 -20
- package/dist/safe-bash-pptx-engine/bytes.d.ts +1 -4
- package/dist/safe-bash-pptx-engine/bytes.js +2 -11
- package/dist/safe-bash-pptx-engine/index.d.ts +1 -103
- package/dist/safe-bash-pptx-engine/index.js +1 -662
- package/dist/safe-bash-presentation-engine/LICENSE +21 -0
- package/dist/safe-bash-presentation-engine/accessibility.js +43 -0
- package/dist/safe-bash-presentation-engine/animation-editing.js +29 -0
- package/dist/safe-bash-presentation-engine/animations.js +23 -0
- package/dist/safe-bash-presentation-engine/backgrounds.js +26 -0
- package/dist/safe-bash-presentation-engine/bytes.d.ts +4 -0
- package/dist/safe-bash-presentation-engine/bytes.js +13 -0
- package/dist/safe-bash-presentation-engine/chart-editing.js +60 -0
- package/dist/{safe-bash-pptx-engine → safe-bash-presentation-engine}/chart-enums.d.ts +2 -2
- package/dist/{safe-bash-pptx-engine → safe-bash-presentation-engine}/chart-object-operations.d.ts +1 -1
- package/dist/safe-bash-presentation-engine/chart-object-operations.js +35 -0
- package/dist/safe-bash-presentation-engine/charts.js +41 -0
- package/dist/{safe-bash-pptx-engine → safe-bash-presentation-engine}/color-enums.d.ts +5 -5
- package/dist/safe-bash-presentation-engine/command-placeholder.js +64 -0
- package/dist/safe-bash-presentation-engine/comments.js +32 -0
- package/dist/safe-bash-presentation-engine/connector-operations.js +50 -0
- package/dist/safe-bash-presentation-engine/connectors.js +49 -0
- package/dist/safe-bash-presentation-engine/content-types.js +9 -0
- package/dist/safe-bash-presentation-engine/contracts.js +0 -0
- package/dist/safe-bash-presentation-engine/creation.js +15 -0
- package/dist/safe-bash-presentation-engine/diff.js +40 -0
- package/dist/{safe-bash-pptx-engine → safe-bash-presentation-engine}/drawing-enums.d.ts +20 -20
- package/dist/safe-bash-presentation-engine/drawing-format.js +44 -0
- package/dist/safe-bash-presentation-engine/drawing-operations.js +41 -0
- package/dist/safe-bash-presentation-engine/drawing-schema.d.ts +1549 -0
- package/dist/safe-bash-presentation-engine/drawing-schema.js +33 -0
- package/dist/safe-bash-presentation-engine/equations.js +30 -0
- package/dist/safe-bash-presentation-engine/errors.js +23 -0
- package/dist/safe-bash-presentation-engine/fields.js +32 -0
- package/dist/safe-bash-presentation-engine/font-metrics.js +12 -0
- package/dist/safe-bash-presentation-engine/image-extraction.js +29 -0
- package/dist/safe-bash-presentation-engine/image-formatting.js +43 -0
- package/dist/safe-bash-presentation-engine/image-insertion.js +26 -0
- package/dist/safe-bash-presentation-engine/image-metadata.d.ts +9 -0
- package/dist/safe-bash-presentation-engine/image-metadata.js +9 -0
- package/dist/safe-bash-presentation-engine/image-replacement.js +30 -0
- package/dist/safe-bash-presentation-engine/image-value.js +15 -0
- package/dist/safe-bash-presentation-engine/images.js +30 -0
- package/dist/safe-bash-presentation-engine/index.d.ts +100 -0
- package/dist/safe-bash-presentation-engine/index.js +791 -0
- package/dist/safe-bash-presentation-engine/layouts.js +31 -0
- package/dist/safe-bash-presentation-engine/length.js +21 -0
- package/dist/safe-bash-presentation-engine/links.js +33 -0
- package/dist/safe-bash-presentation-engine/masters.js +54 -0
- package/dist/safe-bash-presentation-engine/media-editing.js +35 -0
- package/dist/safe-bash-presentation-engine/media-extraction.js +24 -0
- package/dist/safe-bash-presentation-engine/media.js +23 -0
- package/dist/safe-bash-presentation-engine/memberships.js +24 -0
- package/dist/safe-bash-presentation-engine/notes.js +27 -0
- package/dist/safe-bash-presentation-engine/ole-enum.js +10 -0
- package/dist/safe-bash-presentation-engine/ole-insertion.js +29 -0
- package/dist/safe-bash-presentation-engine/opaque-objects.js +21 -0
- package/dist/safe-bash-presentation-engine/package-reader.js +13 -0
- package/dist/safe-bash-presentation-engine/package-tools.js +25 -0
- package/dist/safe-bash-presentation-engine/package-uri.d.ts +13 -0
- package/dist/safe-bash-presentation-engine/package-uri.js +16 -0
- package/dist/safe-bash-presentation-engine/package-writer.js +13 -0
- package/dist/{safe-bash-pptx-engine → safe-bash-presentation-engine}/presentation-model.d.ts +1 -1
- package/dist/safe-bash-presentation-engine/presentation-model.js +63 -0
- package/dist/safe-bash-presentation-engine/presentation-settings.js +25 -0
- package/dist/safe-bash-presentation-engine/properties.js +37 -0
- package/dist/safe-bash-presentation-engine/publication.d.ts +10 -0
- package/dist/safe-bash-presentation-engine/publication.js +0 -0
- package/dist/safe-bash-presentation-engine/relationships.js +16 -0
- package/dist/safe-bash-presentation-engine/resource-limits.js +8 -0
- package/dist/safe-bash-presentation-engine/sanitize.js +24 -0
- package/dist/safe-bash-presentation-engine/selector-schema.js +7 -0
- package/dist/safe-bash-presentation-engine/selectors.js +26 -0
- package/dist/safe-bash-presentation-engine/shape-groups.js +47 -0
- package/dist/safe-bash-presentation-engine/shape-operations.js +48 -0
- package/dist/safe-bash-presentation-engine/shape-path-operations.js +44 -0
- package/dist/safe-bash-presentation-engine/shape-paths.js +31 -0
- package/dist/safe-bash-presentation-engine/shape-presets.js +11 -0
- package/dist/safe-bash-presentation-engine/shape-selection.js +43 -0
- package/dist/safe-bash-presentation-engine/shape-transforms.js +28 -0
- package/dist/{safe-bash-pptx-engine → safe-bash-presentation-engine}/shape-types.d.ts +1 -1
- package/dist/{safe-bash-pptx-engine → safe-bash-presentation-engine}/shapes.d.ts +1 -1
- package/dist/safe-bash-presentation-engine/shapes.js +66 -0
- package/dist/safe-bash-presentation-engine/slide-copy.js +24 -0
- package/dist/safe-bash-presentation-engine/slide-import.js +27 -0
- package/dist/safe-bash-presentation-engine/slide-merge-split.js +33 -0
- package/dist/safe-bash-presentation-engine/slide-model.js +74 -0
- package/dist/safe-bash-presentation-engine/slide-removal.js +25 -0
- package/dist/safe-bash-presentation-engine/slide-transfer-budget.js +17 -0
- package/dist/safe-bash-presentation-engine/slides.js +26 -0
- package/dist/safe-bash-presentation-engine/table-operations.js +51 -0
- package/dist/safe-bash-presentation-engine/table-spans.js +42 -0
- package/dist/safe-bash-presentation-engine/tables.js +45 -0
- package/dist/safe-bash-presentation-engine/tags.js +25 -0
- package/dist/safe-bash-presentation-engine/template-bindings.js +44 -0
- package/dist/safe-bash-presentation-engine/template-repeat.js +51 -0
- package/dist/safe-bash-presentation-engine/text-fitting.js +39 -0
- package/dist/safe-bash-presentation-engine/text-frames.js +52 -0
- package/dist/safe-bash-presentation-engine/text-paragraphs.js +58 -0
- package/dist/safe-bash-presentation-engine/text-reading.js +23 -0
- package/dist/safe-bash-presentation-engine/text-replacement.js +24 -0
- package/dist/safe-bash-presentation-engine/text-runs.js +45 -0
- package/dist/safe-bash-presentation-engine/themes.js +31 -0
- package/dist/safe-bash-presentation-engine/transitions.js +27 -0
- package/dist/safe-bash-presentation-engine/validation.js +14 -0
- package/dist/safe-bash-presentation-engine/xml-parts.js +25 -0
- package/dist/safe-bash-presentation-engine/xml-view.js +8 -0
- package/dist/safe-bash-presentation-engine/xml.js +8 -0
- package/dist/safe-bash-sqlite-engine/sqlite-edit-snapshot.d.ts +15 -0
- package/dist/safe-bash-sqlite-engine/sqlite-finalization.d.ts +7 -0
- package/dist/safe-bash-sqlite-engine/sqlite-pages.d.ts +18 -0
- package/dist/safe-bash-sqlite-engine/sqlite-record-read.d.ts +8 -0
- package/dist/safe-bash-sqlite-engine/sqlite-record-write.d.ts +20 -0
- package/dist/safe-bash-sqlite-engine/storage.d.ts +2 -0
- package/dist/safe-bash-sqlite-engine/storage.js +236 -55
- package/dist/safe-bash-svg-engine/LICENSE +21 -0
- package/dist/safe-bash-svg-engine/index.d.ts +8 -0
- package/dist/safe-bash-svg-engine/index.js +477 -0
- package/dist/safe-bash-zip-engine/index.js +3 -3
- package/dist/safe-bash-zip-engine/zip/repair.js +3 -3
- package/dist/safe-bash-zip-engine/zip/sfx.js +3 -3
- package/dist/safe-bash-zip-engine/zip-format.js +3 -3
- package/dist/safe-playwright-cloudflare/browser-provider.generated.js +55 -18
- package/dist/safe-playwright-cloudflare/browser-run-code-guest.generated.js +1 -1
- package/dist/spreadsheet-engine/datasource.js +4 -1
- package/dist/spreadsheet-engine/formulas/functions/math.js +3 -1
- package/dist/spreadsheet-engine/rendering/chart/axis.d.ts +26 -0
- package/dist/spreadsheet-engine/rendering/chart/axis.js +61 -0
- package/dist/spreadsheet-engine/rendering/chart/error-bar.d.ts +39 -0
- package/dist/spreadsheet-engine/rendering/chart/error-bar.js +59 -0
- package/dist/spreadsheet-engine/rendering/chart/layout.d.ts +24 -0
- package/dist/spreadsheet-engine/rendering/chart/layout.js +54 -0
- package/dist/spreadsheet-engine/rendering/chart/line.d.ts +23 -0
- package/dist/spreadsheet-engine/rendering/chart/line.js +56 -0
- package/dist/spreadsheet-engine/rendering/chart/marker.d.ts +35 -0
- package/dist/spreadsheet-engine/rendering/chart/marker.js +52 -0
- package/dist/spreadsheet-engine/rendering/chart/pie.d.ts +32 -0
- package/dist/spreadsheet-engine/rendering/chart/pie.js +47 -0
- package/dist/{safe-bash-command-ssconvert → spreadsheet-engine}/rendering/images/codecs.d.ts +0 -1
- package/dist/spreadsheet-engine/rendering/images/codecs.js +253 -0
- package/dist/spreadsheet-engine/rendering/images/index.d.ts +26 -0
- package/dist/spreadsheet-engine/rendering/images/index.js +144 -0
- package/dist/spreadsheet-engine/rendering/images/profile-raster.d.ts +4 -0
- package/dist/spreadsheet-engine/rendering/images/profile-raster.js +72 -0
- package/dist/spreadsheet-engine/rendering/images/scene.d.ts +3 -0
- package/dist/spreadsheet-engine/rendering/images/scene.js +34 -0
- package/dist/spreadsheet-engine/rendering/print/cell-style.d.ts +10 -0
- package/dist/spreadsheet-engine/rendering/print/cell-style.js +52 -0
- package/dist/spreadsheet-engine/rendering/print/font-normalization-data.d.ts +43 -0
- package/dist/spreadsheet-engine/rendering/print/font-normalization-data.js +1558 -0
- package/dist/spreadsheet-engine/rendering/print/font-normalization.d.ts +3 -0
- package/dist/spreadsheet-engine/rendering/print/font-normalization.js +113 -0
- package/dist/spreadsheet-engine/rendering/print/font-shaping.d.ts +18 -0
- package/dist/spreadsheet-engine/rendering/print/font-shaping.js +271 -0
- package/dist/spreadsheet-engine/rendering/print/harfbuzz/data.d.ts +1 -0
- package/dist/spreadsheet-engine/rendering/print/harfbuzz/data.js +2 -0
- package/dist/spreadsheet-engine/rendering/print/header-footer.d.ts +16 -0
- package/dist/spreadsheet-engine/rendering/print/header-footer.js +92 -0
- package/dist/spreadsheet-engine/rendering/print/layout.d.ts +65 -0
- package/dist/spreadsheet-engine/rendering/print/layout.js +75 -0
- package/dist/spreadsheet-engine/rendering/print/pagination.d.ts +34 -0
- package/dist/spreadsheet-engine/rendering/print/pagination.js +126 -0
- package/dist/spreadsheet-engine/rendering/print/settings.d.ts +42 -0
- package/dist/spreadsheet-engine/rendering/print/settings.js +159 -0
- package/dist/spreadsheet-format-xls/biff-metadata.js +3 -3
- package/dist/spreadsheet-format-xls/biff-write-metadata.d.ts +1 -1
- package/dist/spreadsheet-format-xls/biff-write-metadata.js +20 -3
- package/dist/spreadsheet-format-xls/biff-write.js +1 -1
- package/package.json +239 -12
- package/third-party/spreadsheet-engine/scripts/harfbuzz/README.md +39 -0
- package/third-party/spreadsheet-engine/scripts/harfbuzz/allocator.cc +18 -0
- package/third-party/spreadsheet-engine/scripts/harfbuzz/build.mjs +94 -0
- package/third-party/spreadsheet-engine/scripts/harfbuzz/completion.patch +98 -0
- package/third-party/spreadsheet-engine/scripts/harfbuzz/config-override.h +19 -0
- package/third-party/spreadsheet-engine/scripts/harfbuzz/exports.json +29 -0
- package/third-party/spreadsheet-engine/scripts/harfbuzz/sources.json +274 -0
- package/third-party/spreadsheet-engine/scripts/harfbuzz/verify.d.mts +10 -0
- package/third-party/spreadsheet-engine/scripts/harfbuzz/verify.mjs +96 -0
- package/third-party/spreadsheet-engine/scripts/harfbuzz/verify.test.mjs +60 -0
- package/third-party/spreadsheet-engine/src/rendering/images/NOTICE.md +22 -0
- package/third-party/spreadsheet-engine/src/rendering/print/NOTICE.md +30 -0
- package/third-party/spreadsheet-engine/src/rendering/print/font-normalization-NOTICE.md +64 -0
- package/third-party/spreadsheet-engine/src/rendering/print/font-normalization-data.ts +1558 -0
- package/third-party/spreadsheet-engine/src/rendering/print/font-normalization.ts +91 -0
- package/third-party/spreadsheet-engine/src/rendering/print/harfbuzz/EMSCRIPTEN-LICENSE.txt +102 -0
- package/third-party/spreadsheet-engine/src/rendering/print/harfbuzz/HARFBUZZ-LICENSE.txt +42 -0
- package/third-party/spreadsheet-engine/src/rendering/print/harfbuzz/LIBCXX-LICENSE.txt +311 -0
- package/third-party/spreadsheet-engine/src/rendering/print/harfbuzz/LIBCXXABI-LICENSE.txt +311 -0
- package/third-party/spreadsheet-engine/src/rendering/print/harfbuzz/MUSL-LICENSE.txt +193 -0
- package/third-party/spreadsheet-engine/src/rendering/print/harfbuzz/NOTICE.md +41 -0
- package/third-party/spreadsheet-engine/src/rendering/print/harfbuzz/data.ts +2 -0
- package/dist/safe-bash/command-chunks/chunk-C5TUE2FE.js +0 -169
- package/dist/safe-bash/command-chunks/chunk-CVKW2YIC.js +0 -13631
- package/dist/safe-bash/command-chunks/chunk-JBGGUHQY.js +0 -17617
- package/dist/safe-bash/command-chunks/chunk-S4R2JDPL.js +0 -35
- package/dist/safe-bash/command-chunks/chunk-TU5IFVCX.js +0 -33708
- package/dist/safe-bash/command-chunks/chunk-TUWGIF22.js +0 -328
- package/dist/safe-bash/command-chunks/data-2FJOPYXA-PDKMLCGR.js +0 -8
- package/dist/safe-bash/command-chunks/index.browser-2NLML6H4.js +0 -269
- package/dist/safe-bash/command-chunks/model-store-EEI3QS4G.js +0 -10
- package/dist/safe-bash/command-chunks/pdf-M2GFAR2A-FCJMJCAP.js +0 -683
- package/dist/safe-bash-command-ssconvert/rendering/images/formats.d.ts +0 -2
- package/dist/safe-bash-docx-engine/command.d.ts +0 -65
- package/dist/safe-bash/chunks/{chunk-4T4RQYRI.js → chunk-5HRGBHZH.js} +10 -10
- package/dist/safe-bash/chunks/{chunk-QUS6X4MS.js → chunk-EOQMDRTY.js} +0 -0
- package/dist/safe-bash/command-chunks/{chunk-2L3JKGUH.js → chunk-4LYZBDZF.js} +4 -4
- package/dist/safe-bash/command-chunks/{chunk-EMMSXKEJ.js → chunk-4Q4R3VZU.js} +0 -0
- package/dist/safe-bash/command-chunks/{chunk-5RLK2QSY.js → chunk-7JEIWA3A.js} +5 -5
- package/dist/safe-bash/command-chunks/{chunk-AV6N7DDA.js → chunk-DDYPQAXN.js} +3 -3
- package/dist/safe-bash/command-chunks/{chunk-OOB7YCFQ.js → chunk-FMJKCVSQ.js} +3 -3
- package/dist/safe-bash/command-chunks/{chunk-FUL2C4EX.js → chunk-HFKS6AET.js} +3 -3
- package/dist/safe-bash/command-chunks/{chunk-2M3WUEDX.js → chunk-J6K5Q53O.js} +10 -10
- package/dist/safe-bash/command-chunks/{chunk-ATWMLV75.js → chunk-RJXZYDSN.js} +7 -7
- package/dist/safe-bash/command-chunks/{chunk-JD3NSHFT.js → chunk-TVGIJ56E.js} +3 -3
- package/dist/safe-bash/command-chunks/{chunk-3I33KPQH.js → chunk-X2HVVMTW.js} +6 -6
- package/dist/safe-bash/command-chunks/{odf-UKSXPNOZ-NCL5P7YL.js → odf-UKSXPNOZ-BV2LCKTB.js} +0 -0
- package/dist/{safe-bash/command-chunks/chunk-3SVT5VB7.js → safe-bash-docx-engine/operation-types.js} +0 -0
- package/dist/{safe-bash-pptx-engine → safe-bash-presentation-engine}/accessibility.d.ts +0 -0
- package/dist/{safe-bash-pptx-engine → safe-bash-presentation-engine}/animation-editing.d.ts +0 -0
- package/dist/{safe-bash-pptx-engine → safe-bash-presentation-engine}/animations.d.ts +0 -0
- package/dist/{safe-bash-pptx-engine → safe-bash-presentation-engine}/backgrounds.d.ts +0 -0
- package/dist/{safe-bash-pptx-engine → safe-bash-presentation-engine}/chart-data-model.d.ts +0 -0
- package/dist/{safe-bash-pptx-engine → safe-bash-presentation-engine}/chart-editing.d.ts +0 -0
- package/dist/{safe-bash-pptx-engine → safe-bash-presentation-engine}/chart-font-operations.d.ts +0 -0
- package/dist/{safe-bash-pptx-engine → safe-bash-presentation-engine}/chart-model-axes.d.ts +0 -0
- package/dist/{safe-bash-pptx-engine → safe-bash-presentation-engine}/chart-model-core.d.ts +0 -0
- package/dist/{safe-bash-pptx-engine → safe-bash-presentation-engine}/chart-model-series.d.ts +0 -0
- package/dist/{safe-bash-pptx-engine → safe-bash-presentation-engine}/chart-model.d.ts +0 -0
- package/dist/{safe-bash-pptx-engine → safe-bash-presentation-engine}/chart-objects.d.ts +0 -0
- package/dist/{safe-bash-pptx-engine → safe-bash-presentation-engine}/chart-workbook.d.ts +0 -0
- package/dist/{safe-bash-pptx-engine → safe-bash-presentation-engine}/charts.d.ts +0 -0
- package/dist/{safe-bash-pptx-engine → safe-bash-presentation-engine}/command-placeholder.d.ts +0 -0
- package/dist/{safe-bash-pptx-engine → safe-bash-presentation-engine}/comments.d.ts +0 -0
- package/dist/{safe-bash-pptx-engine → safe-bash-presentation-engine}/connector-operations.d.ts +0 -0
- package/dist/{safe-bash-pptx-engine → safe-bash-presentation-engine}/connectors-model.d.ts +0 -0
- package/dist/{safe-bash-pptx-engine → safe-bash-presentation-engine}/connectors.d.ts +0 -0
- package/dist/{safe-bash-pptx-engine → safe-bash-presentation-engine}/content-types.d.ts +0 -0
- package/dist/{safe-bash-pptx-engine → safe-bash-presentation-engine}/contracts.d.ts +0 -0
- package/dist/{safe-bash-pptx-engine → safe-bash-presentation-engine}/creation.d.ts +0 -0
- package/dist/{safe-bash-pptx-engine → safe-bash-presentation-engine}/diagram-resources.d.ts +0 -0
- package/dist/{safe-bash-pptx-engine → safe-bash-presentation-engine}/diff.d.ts +0 -0
- package/dist/{safe-bash-pptx-engine → safe-bash-presentation-engine}/drawing-format.d.ts +0 -0
- package/dist/{safe-bash-pptx-engine → safe-bash-presentation-engine}/drawing-operations.d.ts +0 -0
- package/dist/{safe-bash-pptx-engine → safe-bash-presentation-engine}/equations.d.ts +0 -0
- package/dist/{safe-bash-pptx-engine → safe-bash-presentation-engine}/errors.d.ts +0 -0
- package/dist/{safe-bash-pptx-engine → safe-bash-presentation-engine}/fields.d.ts +0 -0
- package/dist/{safe-bash-pptx-engine → safe-bash-presentation-engine}/font-metrics.d.ts +0 -0
- package/dist/{safe-bash-pptx-engine → safe-bash-presentation-engine}/freeform-builder.d.ts +0 -0
- package/dist/{safe-bash-pptx-engine → safe-bash-presentation-engine}/group-model.d.ts +0 -0
- package/dist/{safe-bash-pptx-engine → safe-bash-presentation-engine}/image-extraction.d.ts +0 -0
- package/dist/{safe-bash-pptx-engine → safe-bash-presentation-engine}/image-formatting.d.ts +0 -0
- package/dist/{safe-bash-pptx-engine → safe-bash-presentation-engine}/image-insertion.d.ts +0 -0
- package/dist/{safe-bash-pptx-engine → safe-bash-presentation-engine}/image-replacement.d.ts +0 -0
- package/dist/{safe-bash-pptx-engine → safe-bash-presentation-engine}/image-value.d.ts +0 -0
- package/dist/{safe-bash-pptx-engine → safe-bash-presentation-engine}/images.d.ts +0 -0
- package/dist/{safe-bash-pptx-engine → safe-bash-presentation-engine}/inventory.d.ts +0 -0
- package/dist/{safe-bash-pptx-engine → safe-bash-presentation-engine}/language-enum.d.ts +0 -0
- package/dist/{safe-bash-pptx-engine → safe-bash-presentation-engine}/layouts.d.ts +0 -0
- package/dist/{safe-bash-pptx-engine → safe-bash-presentation-engine}/length.d.ts +0 -0
- package/dist/{safe-bash-pptx-engine → safe-bash-presentation-engine}/links-model.d.ts +4 -4
- /package/dist/{safe-bash-pptx-engine → safe-bash-presentation-engine}/links.d.ts +0 -0
- /package/dist/{safe-bash-pptx-engine → safe-bash-presentation-engine}/masters.d.ts +0 -0
- /package/dist/{safe-bash-pptx-engine → safe-bash-presentation-engine}/media-editing.d.ts +0 -0
- /package/dist/{safe-bash-pptx-engine → safe-bash-presentation-engine}/media-enum.d.ts +0 -0
- /package/dist/{safe-bash-pptx-engine → safe-bash-presentation-engine}/media-extraction.d.ts +0 -0
- /package/dist/{safe-bash-pptx-engine → safe-bash-presentation-engine}/media.d.ts +0 -0
- /package/dist/{safe-bash-pptx-engine → safe-bash-presentation-engine}/memberships.d.ts +0 -0
- /package/dist/{safe-bash-pptx-engine → safe-bash-presentation-engine}/modern-comments.d.ts +0 -0
- /package/dist/{safe-bash-pptx-engine → safe-bash-presentation-engine}/notes.d.ts +0 -0
- /package/dist/{safe-bash-pptx-engine → safe-bash-presentation-engine}/ole-enum.d.ts +0 -0
- /package/dist/{safe-bash-pptx-engine → safe-bash-presentation-engine}/ole-insertion.d.ts +0 -0
- /package/dist/{safe-bash-pptx-engine → safe-bash-presentation-engine}/opaque-objects.d.ts +0 -0
- /package/dist/{safe-bash-pptx-engine → safe-bash-presentation-engine}/package-reader.d.ts +0 -0
- /package/dist/{safe-bash-pptx-engine → safe-bash-presentation-engine}/package-tools.d.ts +0 -0
- /package/dist/{safe-bash-pptx-engine → safe-bash-presentation-engine}/package-view.d.ts +0 -0
- /package/dist/{safe-bash-pptx-engine → safe-bash-presentation-engine}/package-writer.d.ts +0 -0
- /package/dist/{safe-bash-pptx-engine → safe-bash-presentation-engine}/paragraph-alignment.d.ts +0 -0
- /package/dist/{safe-bash-pptx-engine → safe-bash-presentation-engine}/presentation-settings.d.ts +0 -0
- /package/dist/{safe-bash-pptx-engine → safe-bash-presentation-engine}/properties.d.ts +0 -0
- /package/dist/{safe-bash-pptx-engine → safe-bash-presentation-engine}/relationships.d.ts +0 -0
- /package/dist/{safe-bash-pptx-engine → safe-bash-presentation-engine}/resource-limits.d.ts +0 -0
- /package/dist/{safe-bash-pptx-engine → safe-bash-presentation-engine}/sanitize.d.ts +0 -0
- /package/dist/{safe-bash-pptx-engine → safe-bash-presentation-engine}/selector-schema.d.ts +0 -0
- /package/dist/{safe-bash-pptx-engine → safe-bash-presentation-engine}/selectors.d.ts +0 -0
- /package/dist/{safe-bash-pptx-engine → safe-bash-presentation-engine}/shape-adjustments.d.ts +0 -0
- /package/dist/{safe-bash-pptx-engine → safe-bash-presentation-engine}/shape-groups.d.ts +0 -0
- /package/dist/{safe-bash-pptx-engine → safe-bash-presentation-engine}/shape-operations.d.ts +0 -0
- /package/dist/{safe-bash-pptx-engine → safe-bash-presentation-engine}/shape-path-operations.d.ts +0 -0
- /package/dist/{safe-bash-pptx-engine → safe-bash-presentation-engine}/shape-paths.d.ts +0 -0
- /package/dist/{safe-bash-pptx-engine → safe-bash-presentation-engine}/shape-placeholder-types.d.ts +0 -0
- /package/dist/{safe-bash-pptx-engine → safe-bash-presentation-engine}/shape-presets.d.ts +0 -0
- /package/dist/{safe-bash-pptx-engine → safe-bash-presentation-engine}/shape-selection.d.ts +0 -0
- /package/dist/{safe-bash-pptx-engine → safe-bash-presentation-engine}/shape-transforms.d.ts +0 -0
- /package/dist/{safe-bash-pptx-engine → safe-bash-presentation-engine}/slide-copy.d.ts +0 -0
- /package/dist/{safe-bash-pptx-engine → safe-bash-presentation-engine}/slide-import.d.ts +0 -0
- /package/dist/{safe-bash-pptx-engine → safe-bash-presentation-engine}/slide-layout-model.d.ts +0 -0
- /package/dist/{safe-bash-pptx-engine → safe-bash-presentation-engine}/slide-merge-split.d.ts +0 -0
- /package/dist/{safe-bash-pptx-engine → safe-bash-presentation-engine}/slide-model.d.ts +0 -0
- /package/dist/{safe-bash-pptx-engine → safe-bash-presentation-engine}/slide-removal.d.ts +0 -0
- /package/dist/{safe-bash-pptx-engine → safe-bash-presentation-engine}/slide-transfer-budget.d.ts +0 -0
- /package/dist/{safe-bash-pptx-engine → safe-bash-presentation-engine}/slides.d.ts +0 -0
- /package/dist/{safe-bash-pptx-engine → safe-bash-presentation-engine}/table-operations.d.ts +0 -0
- /package/dist/{safe-bash-pptx-engine → safe-bash-presentation-engine}/table-spans.d.ts +0 -0
- /package/dist/{safe-bash-pptx-engine → safe-bash-presentation-engine}/tables-model.d.ts +0 -0
- /package/dist/{safe-bash-pptx-engine → safe-bash-presentation-engine}/tables.d.ts +0 -0
- /package/dist/{safe-bash-pptx-engine → safe-bash-presentation-engine}/tags.d.ts +0 -0
- /package/dist/{safe-bash-pptx-engine → safe-bash-presentation-engine}/template-bindings.d.ts +0 -0
- /package/dist/{safe-bash-pptx-engine → safe-bash-presentation-engine}/template-repeat.d.ts +0 -0
- /package/dist/{safe-bash-pptx-engine → safe-bash-presentation-engine}/text-fitting.d.ts +0 -0
- /package/dist/{safe-bash-pptx-engine → safe-bash-presentation-engine}/text-frame-enums.d.ts +0 -0
- /package/dist/{safe-bash-pptx-engine → safe-bash-presentation-engine}/text-frames.d.ts +0 -0
- /package/dist/{safe-bash-pptx-engine → safe-bash-presentation-engine}/text-paragraphs.d.ts +0 -0
- /package/dist/{safe-bash-pptx-engine → safe-bash-presentation-engine}/text-reading.d.ts +0 -0
- /package/dist/{safe-bash-pptx-engine → safe-bash-presentation-engine}/text-replacement.d.ts +0 -0
- /package/dist/{safe-bash-pptx-engine → safe-bash-presentation-engine}/text-run-color.d.ts +0 -0
- /package/dist/{safe-bash-pptx-engine → safe-bash-presentation-engine}/text-runs.d.ts +0 -0
- /package/dist/{safe-bash-pptx-engine → safe-bash-presentation-engine}/text-style-resolution.d.ts +0 -0
- /package/dist/{safe-bash-pptx-engine → safe-bash-presentation-engine}/themes.d.ts +0 -0
- /package/dist/{safe-bash-pptx-engine → safe-bash-presentation-engine}/transitions.d.ts +0 -0
- /package/dist/{safe-bash-pptx-engine → safe-bash-presentation-engine}/validation.d.ts +0 -0
- /package/dist/{safe-bash-pptx-engine → safe-bash-presentation-engine}/xml-parts.d.ts +0 -0
- /package/dist/{safe-bash-pptx-engine → safe-bash-presentation-engine}/xml-view.d.ts +0 -0
- /package/dist/{safe-bash-pptx-engine → safe-bash-presentation-engine}/xml.d.ts +0 -0
|
@@ -0,0 +1,1621 @@
|
|
|
1
|
+
import {
|
|
2
|
+
PackageView,
|
|
3
|
+
StylesPart,
|
|
4
|
+
admitDocumentModel,
|
|
5
|
+
bindXmlElementView,
|
|
6
|
+
packageAdmitImages,
|
|
7
|
+
packageBindStyles,
|
|
8
|
+
packageStyleAllocationIds
|
|
9
|
+
} from "./chunk-RZJRR4UJ.js";
|
|
10
|
+
import {
|
|
11
|
+
editLatentStyles,
|
|
12
|
+
readLatentStyles,
|
|
13
|
+
styleLinkPatches
|
|
14
|
+
} from "./chunk-SDTC2BLK.js";
|
|
15
|
+
import {
|
|
16
|
+
modelVfsResolver
|
|
17
|
+
} from "./chunk-A7EMM3SB.js";
|
|
18
|
+
import {
|
|
19
|
+
contextData
|
|
20
|
+
} from "./chunk-2W54TAGI.js";
|
|
21
|
+
import {
|
|
22
|
+
addDocumentStylesPart
|
|
23
|
+
} from "./chunk-MQFXMBGD.js";
|
|
24
|
+
import {
|
|
25
|
+
assertDocumentEditable,
|
|
26
|
+
publicationGenerationGuard,
|
|
27
|
+
publishDocumentArchive
|
|
28
|
+
} from "./chunk-HPKUFWHW.js";
|
|
29
|
+
import {
|
|
30
|
+
SemanticValidationError
|
|
31
|
+
} from "./chunk-3SEQG5JH.js";
|
|
32
|
+
import {
|
|
33
|
+
PublicationError
|
|
34
|
+
} from "./chunk-JGGRMERW.js";
|
|
35
|
+
import {
|
|
36
|
+
DocumentXmlEditor,
|
|
37
|
+
UnsupportedEditError,
|
|
38
|
+
activeXmlChildren,
|
|
39
|
+
alignments,
|
|
40
|
+
assertFormattingHistoryEditable,
|
|
41
|
+
formattedRunProperties,
|
|
42
|
+
highlights,
|
|
43
|
+
insertActiveLatentStyles,
|
|
44
|
+
mergeStyleChildren,
|
|
45
|
+
newTabStopXml,
|
|
46
|
+
paragraphProperties,
|
|
47
|
+
paragraphUnits,
|
|
48
|
+
renderContent,
|
|
49
|
+
replaceActiveStyleXml,
|
|
50
|
+
replaceNativeTabCollectionXml,
|
|
51
|
+
runElementOpen,
|
|
52
|
+
storedMeasure,
|
|
53
|
+
styleAttribute,
|
|
54
|
+
styleChild,
|
|
55
|
+
styleDisplayName,
|
|
56
|
+
styleInteger,
|
|
57
|
+
styleStoredName,
|
|
58
|
+
styleToggle,
|
|
59
|
+
tabAlignmentXml,
|
|
60
|
+
themes,
|
|
61
|
+
underline,
|
|
62
|
+
xmlValue
|
|
63
|
+
} from "./chunk-YPVBU7QF.js";
|
|
64
|
+
import {
|
|
65
|
+
storedBoolean
|
|
66
|
+
} from "./chunk-VEUQWV2V.js";
|
|
67
|
+
import {
|
|
68
|
+
documentDialects
|
|
69
|
+
} from "./chunk-MG7AJD5E.js";
|
|
70
|
+
import {
|
|
71
|
+
Twips,
|
|
72
|
+
WD_STYLE_TYPE,
|
|
73
|
+
callableConstructor,
|
|
74
|
+
enumFamilies,
|
|
75
|
+
enumValue,
|
|
76
|
+
numericSequence,
|
|
77
|
+
plainLength,
|
|
78
|
+
snapshotSequence,
|
|
79
|
+
validateDocxValue
|
|
80
|
+
} from "./chunk-R4TYL2G6.js";
|
|
81
|
+
import {
|
|
82
|
+
BoundsError,
|
|
83
|
+
MissingKeyError,
|
|
84
|
+
OwnershipError,
|
|
85
|
+
StaleHandleError
|
|
86
|
+
} from "./chunk-OBK24KGM.js";
|
|
87
|
+
import {
|
|
88
|
+
parseDocumentXml
|
|
89
|
+
} from "./chunk-MWAAMNAM.js";
|
|
90
|
+
import {
|
|
91
|
+
DocumentBudget,
|
|
92
|
+
InputTypeError,
|
|
93
|
+
InvalidDocumentError,
|
|
94
|
+
InvalidValueError,
|
|
95
|
+
archiveSettings,
|
|
96
|
+
budgetSharesReservations
|
|
97
|
+
} from "./chunk-IQFRPIXH.js";
|
|
98
|
+
|
|
99
|
+
// packages/safe-bash-docx-engine/src/model-output.ts
|
|
100
|
+
function modelOutput(output, flags, context, source) {
|
|
101
|
+
const options = contextData(flags, ["force", "inPlace", "dryRun"]);
|
|
102
|
+
if (!output || typeof output !== "object" && typeof output !== "function")
|
|
103
|
+
throw new InputTypeError("Expected an explicit document output capability.");
|
|
104
|
+
if ("path" in output || "capability" in output) {
|
|
105
|
+
const record = contextData(output, ["path", "capability"]);
|
|
106
|
+
const resolver = modelVfsResolver(record.path, record.capability, context);
|
|
107
|
+
const filesystem = resolver.filesystem;
|
|
108
|
+
if (!filesystem) throw new PublicationError("unsupported-publication", "Virtual output requires explicit publication authority.");
|
|
109
|
+
if (source && (!source.input || source.filesystem !== filesystem))
|
|
110
|
+
throw new PublicationError("unsupported-publication", "Input identity requires the same admitted filesystem authority.");
|
|
111
|
+
if (options.inPlace && (!source || source.path !== record.path))
|
|
112
|
+
throw new PublicationError("conflict", "In-place output must name the admitted input.");
|
|
113
|
+
const publication = {
|
|
114
|
+
...options,
|
|
115
|
+
...source?.input ? { input: source.input } : {},
|
|
116
|
+
...options.inPlace ? {} : { output: record.path }
|
|
117
|
+
};
|
|
118
|
+
return { options: publication, filesystem };
|
|
119
|
+
}
|
|
120
|
+
if (options.inPlace || options.force) throw new InputTypeError("Stream output cannot use path replacement intent.");
|
|
121
|
+
return { options: { ...options, output: "-" }, stdout: output };
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
// packages/safe-bash-docx-engine/src/comparison-operand.ts
|
|
125
|
+
function requireComparisonOperand(value) {
|
|
126
|
+
if (value === void 0) throw new InputTypeError("Expected a comparison operand.");
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
// packages/safe-bash-docx-engine/src/formatting-model.ts
|
|
130
|
+
var formattingXmlOwners = /* @__PURE__ */ new WeakMap();
|
|
131
|
+
function modelFormattingOwner(store, ref) {
|
|
132
|
+
const owner = {
|
|
133
|
+
budget: store.context.budget,
|
|
134
|
+
get part() {
|
|
135
|
+
store.node(ref);
|
|
136
|
+
return store.part(ref.part);
|
|
137
|
+
},
|
|
138
|
+
get identity() {
|
|
139
|
+
return store.identity(ref);
|
|
140
|
+
},
|
|
141
|
+
getXml: () => new TextDecoder().decode(store.element(ref).serialize()),
|
|
142
|
+
setXml: (source) => store.change(ref.part, (xml) => xml.replaceElement(store.node(ref), source))
|
|
143
|
+
};
|
|
144
|
+
formattingXmlOwners.set(owner, {
|
|
145
|
+
budget: store.context.budget,
|
|
146
|
+
read: () => store.xml(ref.part),
|
|
147
|
+
resolve: () => store.node(ref),
|
|
148
|
+
change: (action) => store.change(ref.part, action)
|
|
149
|
+
});
|
|
150
|
+
return owner;
|
|
151
|
+
}
|
|
152
|
+
var ownerBudgets = /* @__PURE__ */ new WeakMap();
|
|
153
|
+
function ownerBudget(owner) {
|
|
154
|
+
if (owner.budget) return owner.budget;
|
|
155
|
+
const identity = owner.identity, key = identity !== null && typeof identity === "object" ? identity : owner;
|
|
156
|
+
let budget = ownerBudgets.get(key);
|
|
157
|
+
if (!budget) {
|
|
158
|
+
budget = new DocumentBudget();
|
|
159
|
+
ownerBudgets.set(key, budget);
|
|
160
|
+
}
|
|
161
|
+
return budget;
|
|
162
|
+
}
|
|
163
|
+
function editor(owner) {
|
|
164
|
+
return new DocumentXmlEditor(new TextEncoder().encode(owner.getXml()), {}, void 0, ownerBudget(owner));
|
|
165
|
+
}
|
|
166
|
+
function readView(owner, fragment, root) {
|
|
167
|
+
const binding = formattingXmlOwners.get(owner), xml = fragment ?? binding?.read() ?? editor(owner);
|
|
168
|
+
const view = { xml, root: root ?? (fragment ? xml.root : binding?.resolve(xml) ?? xml.root) };
|
|
169
|
+
return { ...view, children: activeXmlChildren(view.xml, ownerBudget(owner)) };
|
|
170
|
+
}
|
|
171
|
+
var ownerXmlViews = /* @__PURE__ */ new WeakMap();
|
|
172
|
+
function ownerView(owner, key = "root", resolve = (ignoredXml, root) => root, changed, removeRoot) {
|
|
173
|
+
const identity = owner.identity, bindingKey = identity !== null && typeof identity === "object" ? identity : owner;
|
|
174
|
+
let views = ownerXmlViews.get(bindingKey);
|
|
175
|
+
if (!views) {
|
|
176
|
+
views = /* @__PURE__ */ new Map();
|
|
177
|
+
ownerXmlViews.set(bindingKey, views);
|
|
178
|
+
}
|
|
179
|
+
let view = views.get(key);
|
|
180
|
+
if (!view) {
|
|
181
|
+
const budget = ownerBudget(owner), binding = formattingXmlOwners.get(owner);
|
|
182
|
+
view = bindXmlElementView({
|
|
183
|
+
budget,
|
|
184
|
+
...removeRoot ? { removeRoot } : {},
|
|
185
|
+
read: binding?.read ?? (() => editor(owner)),
|
|
186
|
+
resolve: (xml) => resolve(xml, binding?.resolve(xml) ?? xml.root),
|
|
187
|
+
change: (action) => {
|
|
188
|
+
if (binding) binding.change(action);
|
|
189
|
+
else {
|
|
190
|
+
const xml = editor(owner);
|
|
191
|
+
action(xml);
|
|
192
|
+
owner.setXml(new TextDecoder().decode(xml.serialize()));
|
|
193
|
+
}
|
|
194
|
+
changed?.();
|
|
195
|
+
}
|
|
196
|
+
});
|
|
197
|
+
views.set(key, view);
|
|
198
|
+
}
|
|
199
|
+
return view;
|
|
200
|
+
}
|
|
201
|
+
function child(node, name, children = (node2) => node2.children) {
|
|
202
|
+
return children(node).find((c) => c.namespace === node.namespace && c.localName === name);
|
|
203
|
+
}
|
|
204
|
+
function property(owner, kind, name) {
|
|
205
|
+
const view = readView(owner), props = child(view.root, kind, view.children);
|
|
206
|
+
return props && child(props, name, view.children);
|
|
207
|
+
}
|
|
208
|
+
function attr(node, name = "val") {
|
|
209
|
+
return node?.attributes.find((a) => a.namespace === node.namespace && a.localName === name)?.value;
|
|
210
|
+
}
|
|
211
|
+
function update(owner, kind, values) {
|
|
212
|
+
const binding = formattingXmlOwners.get(owner);
|
|
213
|
+
if (binding) {
|
|
214
|
+
binding.change((xml2) => {
|
|
215
|
+
const root2 = binding.resolve(xml2), children = activeXmlChildren(xml2, ownerBudget(owner)), props2 = child(root2, kind + "Pr", children);
|
|
216
|
+
assertFormattingHistoryEditable(xml2.root, root2, children, ownerBudget(owner));
|
|
217
|
+
let replacement2 = kind === "r" ? formattedRunProperties(xml2, root2, values, children) : paragraphProperties(xml2, root2, values, void 0, children, null);
|
|
218
|
+
if (!replacement2) replacement2 = props2 ? runElementOpen(props2) + `</${props2.name}>` : `<fmt:${kind}Pr xmlns:fmt="${root2.namespace}"/>`;
|
|
219
|
+
const tab = kind === "p" ? values.tabStopAdd : void 0, tabs = props2 && child(props2, "tabs", children);
|
|
220
|
+
if (tab && tabs) {
|
|
221
|
+
xml2[replaceNativeTabCollectionXml](props2, replacement2, tabs, newTabStopXml(root2.namespace, tab, null), paragraphUnits(tab.position));
|
|
222
|
+
return;
|
|
223
|
+
}
|
|
224
|
+
if (props2) {
|
|
225
|
+
if (replacement2 !== xml2.sourceXml(props2)) xml2.replaceElement(props2, replacement2);
|
|
226
|
+
} else if (replacement2) xml2.insertChildren(root2, replacement2, root2.children[0]);
|
|
227
|
+
});
|
|
228
|
+
return;
|
|
229
|
+
}
|
|
230
|
+
const xml = editor(owner), root = xml.root;
|
|
231
|
+
if (root.localName !== kind) throw new TypeError("Formatting requires the matching admitted owner element.");
|
|
232
|
+
assertFormattingHistoryEditable(xml.root, root, activeXmlChildren(xml, ownerBudget(owner)), ownerBudget(owner));
|
|
233
|
+
const props = child(root, kind + "Pr");
|
|
234
|
+
let replacement = kind === "r" ? formattedRunProperties(xml, root, values) : paragraphProperties(xml, root, values, void 0, void 0, null);
|
|
235
|
+
if (!replacement) replacement = `<fmt:${kind}Pr xmlns:fmt="${root.namespace}"/>`;
|
|
236
|
+
const patches = /* @__PURE__ */ new Map();
|
|
237
|
+
if (props) patches.set(props, replacement);
|
|
238
|
+
owner.setXml(runElementOpen(root) + (props ? "" : replacement) + xml.sourceXml(root, patches, true) + `</${root.name}>`);
|
|
239
|
+
}
|
|
240
|
+
function tri(value) {
|
|
241
|
+
if (value !== null && typeof value !== "boolean") throw new InputTypeError("Expected true, false or null.");
|
|
242
|
+
}
|
|
243
|
+
function booleanValue(node) {
|
|
244
|
+
if (!node) return null;
|
|
245
|
+
return storedBoolean(attr(node) ?? "1", "Invalid boolean formatting value.");
|
|
246
|
+
}
|
|
247
|
+
function storedFormattingToken(node, attribute, values, message, required = false) {
|
|
248
|
+
const value = attr(node, attribute);
|
|
249
|
+
if (node && required && value === void 0 || value !== void 0 && !values.includes(value)) throw new InvalidDocumentError(message);
|
|
250
|
+
return value;
|
|
251
|
+
}
|
|
252
|
+
var fontFlags = {
|
|
253
|
+
all_caps: ["allCaps", "caps"],
|
|
254
|
+
bold: ["bold", "b"],
|
|
255
|
+
complex_script: ["complexScriptEnabled", "cs"],
|
|
256
|
+
cs_bold: ["csBold", "bCs"],
|
|
257
|
+
cs_italic: ["csItalic", "iCs"],
|
|
258
|
+
double_strike: ["doubleStrike", "dstrike"],
|
|
259
|
+
emboss: ["emboss", "emboss"],
|
|
260
|
+
hidden: ["hidden", "vanish"],
|
|
261
|
+
imprint: ["imprint", "imprint"],
|
|
262
|
+
italic: ["italic", "i"],
|
|
263
|
+
math: ["math", "oMath"],
|
|
264
|
+
no_proof: ["noProof", "noProof"],
|
|
265
|
+
outline: ["outline", "outline"],
|
|
266
|
+
rtl: ["rtl", "rtl"],
|
|
267
|
+
shadow: ["shadow", "shadow"],
|
|
268
|
+
small_caps: ["smallCaps", "smallCaps"],
|
|
269
|
+
snap_to_grid: ["snapToGrid", "snapToGrid"],
|
|
270
|
+
spec_vanish: ["specVanish", "specVanish"],
|
|
271
|
+
strike: ["strike", "strike"],
|
|
272
|
+
web_hidden: ["webHidden", "webHidden"]
|
|
273
|
+
};
|
|
274
|
+
var Font = class _Font {
|
|
275
|
+
constructor(owner) {
|
|
276
|
+
this.owner = owner;
|
|
277
|
+
void owner.identity;
|
|
278
|
+
this.colorFormat = new ColorFormat(owner);
|
|
279
|
+
}
|
|
280
|
+
owner;
|
|
281
|
+
colorFormat;
|
|
282
|
+
get color() {
|
|
283
|
+
void this.owner.identity;
|
|
284
|
+
return this.colorFormat;
|
|
285
|
+
}
|
|
286
|
+
get part() {
|
|
287
|
+
return this.owner.part ?? null;
|
|
288
|
+
}
|
|
289
|
+
equals(other) {
|
|
290
|
+
requireComparisonOperand(other);
|
|
291
|
+
const identity = this.owner.identity ?? this.owner;
|
|
292
|
+
return other instanceof _Font && identity === (other.owner.identity ?? other.owner);
|
|
293
|
+
}
|
|
294
|
+
get element() {
|
|
295
|
+
return ownerView(this.owner);
|
|
296
|
+
}
|
|
297
|
+
get name() {
|
|
298
|
+
return attr(property(this.owner, "rPr", "rFonts"), "ascii") ?? null;
|
|
299
|
+
}
|
|
300
|
+
set name(value) {
|
|
301
|
+
if (value !== null && typeof value !== "string") throw new InputTypeError("Expected a font name or null.");
|
|
302
|
+
update(this.owner, "r", { font: value });
|
|
303
|
+
}
|
|
304
|
+
get size() {
|
|
305
|
+
const node = property(this.owner, "rPr", "sz"), value = attr(node);
|
|
306
|
+
if (node && value === void 0) throw new InvalidDocumentError("Missing stored font size.");
|
|
307
|
+
return value === void 0 ? null : storedMeasure(value, "half-point");
|
|
308
|
+
}
|
|
309
|
+
set size(value) {
|
|
310
|
+
value = value === null ? null : plainLength(value);
|
|
311
|
+
if (value !== null && !validateDocxValue("Length", value)) throw new InputTypeError("Expected a font length or null.");
|
|
312
|
+
update(this.owner, "r", { size: value === null ? null : { value: paragraphUnits(value, 1), unit: "emu" } });
|
|
313
|
+
}
|
|
314
|
+
get underline() {
|
|
315
|
+
const value = attr(property(this.owner, "rPr", "u"));
|
|
316
|
+
if (value === void 0) return null;
|
|
317
|
+
if (value === "single") return true;
|
|
318
|
+
if (value === "none") return false;
|
|
319
|
+
const name = Object.keys(underline).find((key) => underline[key] === value);
|
|
320
|
+
if (!name) throw new InvalidDocumentError("Invalid underline value.");
|
|
321
|
+
return enumFamilies.WD_UNDERLINE[name];
|
|
322
|
+
}
|
|
323
|
+
set underline(value) {
|
|
324
|
+
if (!validateDocxValue("boolean | WD_UNDERLINE | null", value) || value !== null && typeof value === "object" && !Object.hasOwn(underline, value.name)) throw new InputTypeError("Invalid underline value.");
|
|
325
|
+
update(this.owner, "r", { underline: value });
|
|
326
|
+
}
|
|
327
|
+
get highlight_color() {
|
|
328
|
+
const node = property(this.owner, "rPr", "highlight"), value = attr(node);
|
|
329
|
+
if (!node) return null;
|
|
330
|
+
if (value === void 0) throw new InvalidDocumentError("Missing stored highlight color.");
|
|
331
|
+
const name = Object.keys(highlights).find((key) => highlights[key] === value);
|
|
332
|
+
if (!name) throw new InvalidDocumentError("Invalid highlight color.");
|
|
333
|
+
return enumFamilies.WD_COLOR_INDEX[name];
|
|
334
|
+
}
|
|
335
|
+
set highlight_color(value) {
|
|
336
|
+
if (!validateDocxValue("WD_COLOR_INDEX | null", value) || value !== null && !Object.hasOwn(highlights, value.name)) throw new InputTypeError("Invalid highlight color.");
|
|
337
|
+
update(this.owner, "r", { highlight: value });
|
|
338
|
+
}
|
|
339
|
+
get superscript() {
|
|
340
|
+
const value = storedFormattingToken(property(this.owner, "rPr", "vertAlign"), "val", ["baseline", "superscript", "subscript"], "Invalid vertical alignment.", true);
|
|
341
|
+
return value === void 0 ? null : value === "superscript";
|
|
342
|
+
}
|
|
343
|
+
set superscript(value) {
|
|
344
|
+
this.baseline("superscript", value);
|
|
345
|
+
}
|
|
346
|
+
get subscript() {
|
|
347
|
+
const value = storedFormattingToken(property(this.owner, "rPr", "vertAlign"), "val", ["baseline", "superscript", "subscript"], "Invalid vertical alignment.", true);
|
|
348
|
+
return value === void 0 ? null : value === "subscript";
|
|
349
|
+
}
|
|
350
|
+
set subscript(value) {
|
|
351
|
+
this.baseline("subscript", value);
|
|
352
|
+
}
|
|
353
|
+
baseline(mode, value) {
|
|
354
|
+
tri(value);
|
|
355
|
+
update(this.owner, "r", { baseline: value === true ? mode : value === false ? "baseline" : null });
|
|
356
|
+
}
|
|
357
|
+
};
|
|
358
|
+
for (const [name, [option, tag]] of Object.entries(fontFlags)) Object.defineProperty(Font.prototype, name, {
|
|
359
|
+
get() {
|
|
360
|
+
return booleanValue(property(this.owner, "rPr", tag));
|
|
361
|
+
},
|
|
362
|
+
set(value) {
|
|
363
|
+
tri(value);
|
|
364
|
+
update(this.owner, "r", { [option]: value });
|
|
365
|
+
},
|
|
366
|
+
enumerable: true
|
|
367
|
+
});
|
|
368
|
+
var paragraphFlags = { keep_with_next: ["keepWithNext", "keepNext"], keep_together: ["keepTogether", "keepLines"], widow_control: ["widowControl", "widowControl"], page_break_before: ["pageBreakBefore", "pageBreakBefore"] };
|
|
369
|
+
var ParagraphFormat = class _ParagraphFormat {
|
|
370
|
+
constructor(owner) {
|
|
371
|
+
this.owner = owner;
|
|
372
|
+
void owner.identity;
|
|
373
|
+
}
|
|
374
|
+
owner;
|
|
375
|
+
tabs;
|
|
376
|
+
get tab_stops() {
|
|
377
|
+
const view = readView(this.owner);
|
|
378
|
+
if (!child(view.root, "pPr", view.children)) update(this.owner, "p", {});
|
|
379
|
+
return this.tabs ??= new TabStops(this.owner);
|
|
380
|
+
}
|
|
381
|
+
get part() {
|
|
382
|
+
return this.owner.part ?? null;
|
|
383
|
+
}
|
|
384
|
+
equals(other) {
|
|
385
|
+
requireComparisonOperand(other);
|
|
386
|
+
const identity = this.owner.identity ?? this.owner;
|
|
387
|
+
return other instanceof _ParagraphFormat && identity === (other.owner.identity ?? other.owner);
|
|
388
|
+
}
|
|
389
|
+
get element() {
|
|
390
|
+
return ownerView(this.owner);
|
|
391
|
+
}
|
|
392
|
+
get alignment() {
|
|
393
|
+
const node = property(this.owner, "pPr", "jc"), value = attr(node);
|
|
394
|
+
if (!node) return null;
|
|
395
|
+
if (value === void 0) throw new InvalidDocumentError("Missing stored paragraph alignment.");
|
|
396
|
+
const normalized = value === "start" ? "left" : value === "end" ? "right" : value;
|
|
397
|
+
const name = Object.keys(alignments).find((key) => alignments[key] === normalized);
|
|
398
|
+
if (!name) throw new InvalidDocumentError("Invalid paragraph alignment.");
|
|
399
|
+
return enumFamilies.WD_PARAGRAPH_ALIGNMENT[name];
|
|
400
|
+
}
|
|
401
|
+
set alignment(value) {
|
|
402
|
+
if (!validateDocxValue("WD_PARAGRAPH_ALIGNMENT | null", value)) throw new InputTypeError("Invalid paragraph alignment.");
|
|
403
|
+
update(this.owner, "p", { alignment: value });
|
|
404
|
+
}
|
|
405
|
+
get right_indent() {
|
|
406
|
+
const node = property(this.owner, "pPr", "ind"), value = attr(node, "end") ?? attr(node, "right");
|
|
407
|
+
return value === void 0 ? null : storedMeasure(value);
|
|
408
|
+
}
|
|
409
|
+
set right_indent(value) {
|
|
410
|
+
this.length("rightIndent", value);
|
|
411
|
+
}
|
|
412
|
+
get first_line_indent() {
|
|
413
|
+
const node = property(this.owner, "pPr", "ind"), hanging = attr(node, "hanging"), first = attr(node, "firstLine");
|
|
414
|
+
return hanging !== void 0 ? Twips(-storedMeasure(hanging, "unsigned-twip").emu / 635) : first === void 0 ? null : storedMeasure(first, "unsigned-twip");
|
|
415
|
+
}
|
|
416
|
+
set first_line_indent(value) {
|
|
417
|
+
this.length("firstLineIndent", value);
|
|
418
|
+
}
|
|
419
|
+
get space_before() {
|
|
420
|
+
const value = attr(property(this.owner, "pPr", "spacing"), "before");
|
|
421
|
+
return value === void 0 ? null : storedMeasure(value, "unsigned-twip");
|
|
422
|
+
}
|
|
423
|
+
set space_before(value) {
|
|
424
|
+
this.length("spaceBefore", value);
|
|
425
|
+
}
|
|
426
|
+
get space_after() {
|
|
427
|
+
const value = attr(property(this.owner, "pPr", "spacing"), "after");
|
|
428
|
+
return value === void 0 ? null : storedMeasure(value, "unsigned-twip");
|
|
429
|
+
}
|
|
430
|
+
set space_after(value) {
|
|
431
|
+
this.length("spaceAfter", value);
|
|
432
|
+
}
|
|
433
|
+
length(option, value) {
|
|
434
|
+
value = value === null ? null : plainLength(value);
|
|
435
|
+
if (!validateDocxValue("Length | null", value)) throw new InputTypeError("Expected a length or null.");
|
|
436
|
+
update(this.owner, "p", { [option]: value });
|
|
437
|
+
}
|
|
438
|
+
get line_spacing() {
|
|
439
|
+
const node = property(this.owner, "pPr", "spacing"), value = attr(node, "line"), rule = storedFormattingToken(node, "lineRule", ["auto", "exact", "atLeast"], "Invalid line spacing rule.");
|
|
440
|
+
return value === void 0 ? null : ["exact", "atLeast"].includes(rule ?? "auto") ? storedMeasure(value) : storedMeasure(value).emu / 152400;
|
|
441
|
+
}
|
|
442
|
+
set line_spacing(value) {
|
|
443
|
+
value = value !== null && typeof value === "object" ? plainLength(value) : value;
|
|
444
|
+
if (!validateDocxValue("Length | finite number | null", value)) throw new InputTypeError("Invalid line spacing.");
|
|
445
|
+
update(this.owner, "p", { lineSpacing: value, ...value !== null && typeof value === "object" && this.line_spacing_rule?.name === "AT_LEAST" ? { lineSpacingRule: { enum: "WD_LINE_SPACING", name: "AT_LEAST" } } : {} });
|
|
446
|
+
}
|
|
447
|
+
get line_spacing_rule() {
|
|
448
|
+
const node = property(this.owner, "pPr", "spacing"), rule = storedFormattingToken(node, "lineRule", ["auto", "exact", "atLeast"], "Invalid line spacing rule."), line = attr(node, "line");
|
|
449
|
+
if (line === void 0 && rule === void 0) return null;
|
|
450
|
+
const emu = line === void 0 ? void 0 : storedMeasure(line).emu;
|
|
451
|
+
const name = rule === "exact" ? "EXACTLY" : rule === "atLeast" ? "AT_LEAST" : emu === 152400 ? "SINGLE" : emu === 228600 ? "ONE_POINT_FIVE" : emu === 304800 ? "DOUBLE" : "MULTIPLE";
|
|
452
|
+
return enumFamilies.WD_LINE_SPACING[name];
|
|
453
|
+
}
|
|
454
|
+
set line_spacing_rule(value) {
|
|
455
|
+
if (!validateDocxValue("WD_LINE_SPACING | null", value)) throw new InputTypeError("Invalid line spacing rule.");
|
|
456
|
+
update(this.owner, "p", { lineSpacingRule: value });
|
|
457
|
+
}
|
|
458
|
+
get left_indent() {
|
|
459
|
+
const ind = property(this.owner, "pPr", "ind");
|
|
460
|
+
const value = attr(ind, "start") ?? attr(ind, "left");
|
|
461
|
+
return value === void 0 ? null : storedMeasure(value);
|
|
462
|
+
}
|
|
463
|
+
set left_indent(value) {
|
|
464
|
+
value = value === null ? null : plainLength(value);
|
|
465
|
+
if (value !== null && !validateDocxValue("Length", value)) throw new InputTypeError("Expected a length or null.");
|
|
466
|
+
update(this.owner, "p", { leftIndent: value });
|
|
467
|
+
}
|
|
468
|
+
};
|
|
469
|
+
for (const [name, [option, tag]] of Object.entries(paragraphFlags)) Object.defineProperty(ParagraphFormat.prototype, name, {
|
|
470
|
+
get() {
|
|
471
|
+
return booleanValue(property(this.owner, "pPr", tag));
|
|
472
|
+
},
|
|
473
|
+
set(value) {
|
|
474
|
+
tri(value);
|
|
475
|
+
update(this.owner, "p", { [option]: value });
|
|
476
|
+
},
|
|
477
|
+
enumerable: true
|
|
478
|
+
});
|
|
479
|
+
var alignments2 = { left: "LEFT", start: "START", center: "CENTER", right: "RIGHT", end: "END", decimal: "DECIMAL", bar: "BAR", list: "LIST", clear: "CLEAR", num: "NUM" };
|
|
480
|
+
var leaders = { none: "SPACES", dot: "DOTS", hyphen: "DASHES", underscore: "LINES", heavy: "HEAVY", middleDot: "MIDDLE_DOT" };
|
|
481
|
+
var tabCollections = /* @__PURE__ */ new WeakMap();
|
|
482
|
+
var TabStops = class _TabStops {
|
|
483
|
+
constructor(owner) {
|
|
484
|
+
this.owner = owner;
|
|
485
|
+
const identity = owner.identity;
|
|
486
|
+
const key = identity !== null && typeof identity === "object" ? identity : owner;
|
|
487
|
+
const existing = tabCollections.get(key);
|
|
488
|
+
if (existing) return existing;
|
|
489
|
+
const collection = numericSequence(this);
|
|
490
|
+
tabCollections.set(key, collection);
|
|
491
|
+
return collection;
|
|
492
|
+
}
|
|
493
|
+
owner;
|
|
494
|
+
snapshot = "";
|
|
495
|
+
readRoot;
|
|
496
|
+
tabSnapshot = "";
|
|
497
|
+
records = [];
|
|
498
|
+
retainXmlIds = false;
|
|
499
|
+
nextId = 0;
|
|
500
|
+
get element() {
|
|
501
|
+
return ownerView(this.owner, "tabs", (xml, root) => child(root, "pPr", readView(this.owner, xml, root).children) ?? root);
|
|
502
|
+
}
|
|
503
|
+
get part() {
|
|
504
|
+
return this.owner.part ?? null;
|
|
505
|
+
}
|
|
506
|
+
equals(other) {
|
|
507
|
+
requireComparisonOperand(other);
|
|
508
|
+
const identity = this.owner.identity ?? this.owner;
|
|
509
|
+
return other instanceof _TabStops && identity === (other.owner.identity ?? other.owner);
|
|
510
|
+
}
|
|
511
|
+
elementFor(id, xml, ownerRoot) {
|
|
512
|
+
if (!xml || !this.retainXmlIds) this.refresh();
|
|
513
|
+
const index = this.records.findIndex((record) => record.id === id);
|
|
514
|
+
if (index < 0) throw new StaleHandleError("Tab stop handle is no longer valid.");
|
|
515
|
+
const view = readView(this.owner, xml, ownerRoot), root = child(view.root, "pPr", view.children) ?? view.root;
|
|
516
|
+
const tabs = child(root, "tabs", view.children);
|
|
517
|
+
const node = tabs && view.children(tabs).filter((node2) => node2.namespace === root.namespace && node2.localName === "tab")[index];
|
|
518
|
+
if (!node) throw new StaleHandleError("Tab stop handle is no longer valid.");
|
|
519
|
+
return node;
|
|
520
|
+
}
|
|
521
|
+
refresh() {
|
|
522
|
+
const source = this.owner.getXml(), view = readView(this.owner);
|
|
523
|
+
if (source === this.snapshot && view.root === this.readRoot) return;
|
|
524
|
+
this.readRoot = view.root;
|
|
525
|
+
const { xml, root, children } = view, props = child(root, "pPr", children), tabs = props && child(props, "tabs", children);
|
|
526
|
+
const tabXml = tabs ? xml.sourceXml(tabs) : "";
|
|
527
|
+
if (tabXml === this.tabSnapshot) {
|
|
528
|
+
this.snapshot = source;
|
|
529
|
+
return;
|
|
530
|
+
}
|
|
531
|
+
const nodes = tabs ? children(tabs).filter((c) => c.namespace === root.namespace && c.localName === "tab") : [];
|
|
532
|
+
const retained = this.retainXmlIds && nodes.length === this.records.length ? this.records : void 0;
|
|
533
|
+
this.records = nodes.map((node, index) => {
|
|
534
|
+
const position = storedMeasure(attr(node, "pos") ?? "", "twip", "Invalid tab stop properties.").emu / 635;
|
|
535
|
+
const alignment = alignments2[attr(node)], leader = leaders[attr(node, "leader") ?? "none"];
|
|
536
|
+
if (!alignment || !leader) throw new InvalidDocumentError("Invalid tab stop properties.");
|
|
537
|
+
return { id: retained?.[index]?.id ?? this.nextId++, value: { position: { value: position, unit: "twip" }, alignment: { enum: "WD_TAB_ALIGNMENT", name: alignment }, leader: { enum: "WD_TAB_LEADER", name: leader } } };
|
|
538
|
+
});
|
|
539
|
+
this.retainXmlIds = false;
|
|
540
|
+
this.tabSnapshot = tabXml;
|
|
541
|
+
this.snapshot = source;
|
|
542
|
+
}
|
|
543
|
+
remember() {
|
|
544
|
+
this.snapshot = this.owner.getXml();
|
|
545
|
+
const view = readView(this.owner), props = child(view.root, "pPr", view.children), tabs = props && child(props, "tabs", view.children);
|
|
546
|
+
this.readRoot = view.root;
|
|
547
|
+
this.tabSnapshot = tabs ? view.xml.sourceXml(tabs) : "";
|
|
548
|
+
}
|
|
549
|
+
xmlChanged() {
|
|
550
|
+
this.retainXmlIds = true;
|
|
551
|
+
}
|
|
552
|
+
removeXml(id) {
|
|
553
|
+
this.refresh();
|
|
554
|
+
const index = this.records.findIndex((record) => record.id === id);
|
|
555
|
+
if (index < 0) throw new StaleHandleError("Tab stop handle is no longer valid.");
|
|
556
|
+
const binding = formattingXmlOwners.get(this.owner);
|
|
557
|
+
if (binding) binding.change((xml) => xml.replaceElement(this.elementFor(id, xml, binding.resolve(xml)), ""));
|
|
558
|
+
else {
|
|
559
|
+
const xml = editor(this.owner);
|
|
560
|
+
xml.replaceElement(this.elementFor(id, xml, xml.root), "");
|
|
561
|
+
this.owner.setXml(new TextDecoder().decode(xml.serialize()));
|
|
562
|
+
}
|
|
563
|
+
this.records.splice(index, 1);
|
|
564
|
+
this.remember();
|
|
565
|
+
}
|
|
566
|
+
get length() {
|
|
567
|
+
this.refresh();
|
|
568
|
+
return this.records.length;
|
|
569
|
+
}
|
|
570
|
+
at(index) {
|
|
571
|
+
this.refresh();
|
|
572
|
+
const record = this.records[this.index(index)];
|
|
573
|
+
return new TabStop(this, record.id);
|
|
574
|
+
}
|
|
575
|
+
index(index) {
|
|
576
|
+
if (!Number.isSafeInteger(index)) throw new InputTypeError("Expected an integer tab index.");
|
|
577
|
+
const resolved = index < 0 ? this.records.length + index : index;
|
|
578
|
+
if (resolved < 0 || resolved >= this.records.length) throw new BoundsError("Tab stop index is out of range.");
|
|
579
|
+
return resolved;
|
|
580
|
+
}
|
|
581
|
+
*[Symbol.iterator]() {
|
|
582
|
+
this.refresh();
|
|
583
|
+
for (const record of [...this.records]) yield new TabStop(this, record.id);
|
|
584
|
+
}
|
|
585
|
+
add_tab_stop(position, alignment = { enum: "WD_TAB_ALIGNMENT", name: "LEFT" }, leader = { enum: "WD_TAB_LEADER", name: "SPACES" }) {
|
|
586
|
+
this.refresh();
|
|
587
|
+
const value = { position: plainLength(position), alignment, leader };
|
|
588
|
+
if (!validateDocxValue("{position: Length; alignment?: WD_TAB_ALIGNMENT; leader?: WD_TAB_LEADER}", value)) throw new InputTypeError("Expected valid tab stop properties.");
|
|
589
|
+
const nativeAlignment = tabAlignmentXml(readView(this.owner).root.namespace, alignment.name);
|
|
590
|
+
update(this.owner, "p", { tabStopAdd: value });
|
|
591
|
+
const record = { id: this.nextId++, value: { ...value, alignment: { enum: "WD_TAB_ALIGNMENT", name: alignments2[nativeAlignment] }, position: { value: paragraphUnits(position), unit: "twip" } } };
|
|
592
|
+
this.records.push(record);
|
|
593
|
+
this.records.sort((a, b) => a.value.position.value - b.value.position.value);
|
|
594
|
+
this.remember();
|
|
595
|
+
return new TabStop(this, record.id);
|
|
596
|
+
}
|
|
597
|
+
remove(index) {
|
|
598
|
+
this.refresh();
|
|
599
|
+
const resolved = this.index(index);
|
|
600
|
+
update(this.owner, "p", { tabStopDelete: resolved });
|
|
601
|
+
this.records.splice(resolved, 1);
|
|
602
|
+
this.remember();
|
|
603
|
+
}
|
|
604
|
+
clear_all() {
|
|
605
|
+
update(this.owner, "p", { tabStopsClear: true });
|
|
606
|
+
this.records = [];
|
|
607
|
+
this.remember();
|
|
608
|
+
}
|
|
609
|
+
value(id) {
|
|
610
|
+
this.refresh();
|
|
611
|
+
const record = this.records.find((r) => r.id === id);
|
|
612
|
+
if (!record) throw new StaleHandleError("Tab stop handle is no longer valid.");
|
|
613
|
+
return structuredClone(record.value);
|
|
614
|
+
}
|
|
615
|
+
change(id, patch) {
|
|
616
|
+
this.refresh();
|
|
617
|
+
const index = this.records.findIndex((r) => r.id === id);
|
|
618
|
+
if (index < 0) throw new StaleHandleError("Tab stop handle is no longer valid.");
|
|
619
|
+
const value = { ...this.records[index].value, ...patch, ...patch.position !== void 0 ? { position: plainLength(patch.position) } : {} };
|
|
620
|
+
if (!validateDocxValue("{position: Length; alignment?: WD_TAB_ALIGNMENT; leader?: WD_TAB_LEADER}", value)) throw new InputTypeError("Expected valid tab stop properties.");
|
|
621
|
+
const nativeAlignment = patch.alignment === void 0 ? void 0 : tabAlignmentXml(readView(this.owner).root.namespace, patch.alignment.name);
|
|
622
|
+
const binding = formattingXmlOwners.get(this.owner);
|
|
623
|
+
const apply = (xml, root) => {
|
|
624
|
+
const children = activeXmlChildren(xml, ownerBudget(this.owner));
|
|
625
|
+
assertFormattingHistoryEditable(xml.root, root, children, ownerBudget(this.owner));
|
|
626
|
+
const props = child(root, "pPr", children), tabs = props && child(props, "tabs", children);
|
|
627
|
+
const stops = tabs ? children(tabs).filter((node2) => node2.namespace === tabs.namespace && node2.localName === "tab") : [], node = stops[index];
|
|
628
|
+
if (!tabs || !node || !xml.compatibility.canEdit(node)) throw new UnsupportedEditError("The tab stop is inside preserved compatibility content.");
|
|
629
|
+
const values = {};
|
|
630
|
+
if (patch.position !== void 0) values.pos = String(paragraphUnits(value.position));
|
|
631
|
+
if (nativeAlignment !== void 0) values.val = nativeAlignment;
|
|
632
|
+
if (patch.leader !== void 0) values.leader = value.leader.name === "SPACES" ? null : Object.keys(leaders).find((key) => leaders[key] === value.leader.name);
|
|
633
|
+
let prefix = [...node.namespaces].find(([name, namespace]) => name && namespace === node.namespace)?.[0] ?? "tf";
|
|
634
|
+
while (node.namespaces.has(prefix) && node.namespaces.get(prefix) !== node.namespace) prefix += "f";
|
|
635
|
+
const attributes = [...node.attributes.filter((attribute) => attribute.namespace !== node.namespace || !Object.hasOwn(values, attribute.localName)), ...Object.entries(values).filter(([, text]) => text !== null).map(([name, text]) => ({ name: prefix + ":" + name, localName: name, namespace: node.namespace, value: text }))];
|
|
636
|
+
const changed = runElementOpen({ ...node, namespaces: new Map([...node.namespaces, [prefix, node.namespace]]), attributes }) + xml.sourceXml(node, /* @__PURE__ */ new Map(), true) + `</${node.name}>`;
|
|
637
|
+
if (patch.position === void 0) xml.replaceElement(node, changed);
|
|
638
|
+
else {
|
|
639
|
+
const next = stops.find((stop, offset) => offset !== index && storedMeasure(attr(stop, "pos") ?? "").emu > paragraphUnits(value.position) * 635);
|
|
640
|
+
const changes = /* @__PURE__ */ new Map([[node, ""]]);
|
|
641
|
+
if (next) changes.set(next, changed + xml.sourceXml(next));
|
|
642
|
+
xml[replaceNativeTabCollectionXml](tabs, runElementOpen(tabs) + xml.sourceXml(tabs, changes, true) + (next ? "" : changed) + `</${tabs.name}>`, tabs, changed, paragraphUnits(value.position), node);
|
|
643
|
+
}
|
|
644
|
+
};
|
|
645
|
+
if (binding) binding.change((xml) => apply(xml, binding.resolve(xml)));
|
|
646
|
+
else {
|
|
647
|
+
const xml = editor(this.owner);
|
|
648
|
+
apply(xml, xml.root);
|
|
649
|
+
this.owner.setXml(new TextDecoder().decode(xml.serialize()));
|
|
650
|
+
}
|
|
651
|
+
const record = { id, value: { ...value, ...nativeAlignment === void 0 ? {} : { alignment: { enum: "WD_TAB_ALIGNMENT", name: alignments2[nativeAlignment] } }, position: { value: paragraphUnits(value.position), unit: "twip" } } };
|
|
652
|
+
if (patch.position !== void 0) {
|
|
653
|
+
this.records.splice(index, 1);
|
|
654
|
+
this.records.push(record);
|
|
655
|
+
this.records.sort((a, b) => a.value.position.value - b.value.position.value);
|
|
656
|
+
} else this.records[index] = record;
|
|
657
|
+
this.remember();
|
|
658
|
+
}
|
|
659
|
+
};
|
|
660
|
+
Object.defineProperty(TabStops.prototype, "delete", { value: TabStops.prototype.remove });
|
|
661
|
+
var TabStop = class _TabStop {
|
|
662
|
+
constructor(collection, id) {
|
|
663
|
+
this.collection = collection;
|
|
664
|
+
this.id = id;
|
|
665
|
+
}
|
|
666
|
+
collection;
|
|
667
|
+
id;
|
|
668
|
+
get element() {
|
|
669
|
+
void this.collection.value(this.id);
|
|
670
|
+
return ownerView(this.collection.owner, `tab:${this.id}`, (xml, root) => this.collection.elementFor(this.id, xml, root), () => this.collection.xmlChanged(), () => this.collection.removeXml(this.id));
|
|
671
|
+
}
|
|
672
|
+
get part() {
|
|
673
|
+
this.collection.value(this.id);
|
|
674
|
+
return this.collection.part;
|
|
675
|
+
}
|
|
676
|
+
equals(other) {
|
|
677
|
+
requireComparisonOperand(other);
|
|
678
|
+
this.collection.value(this.id);
|
|
679
|
+
if (!(other instanceof _TabStop)) return false;
|
|
680
|
+
other.collection.value(other.id);
|
|
681
|
+
return this.collection.equals(other.collection) && this.id === other.id;
|
|
682
|
+
}
|
|
683
|
+
get position() {
|
|
684
|
+
return Twips(paragraphUnits(this.collection.value(this.id).position, 1) / 635);
|
|
685
|
+
}
|
|
686
|
+
set position(value) {
|
|
687
|
+
if (value === void 0) throw new InputTypeError("Expected a tab position length.");
|
|
688
|
+
this.collection.change(this.id, { position: value });
|
|
689
|
+
}
|
|
690
|
+
get alignment() {
|
|
691
|
+
return enumFamilies.WD_TAB_ALIGNMENT[this.collection.value(this.id).alignment.name];
|
|
692
|
+
}
|
|
693
|
+
set alignment(value) {
|
|
694
|
+
if (value === void 0) throw new InputTypeError("Expected a tab alignment.");
|
|
695
|
+
this.collection.change(this.id, { alignment: value });
|
|
696
|
+
}
|
|
697
|
+
get leader() {
|
|
698
|
+
return enumFamilies.WD_TAB_LEADER[this.collection.value(this.id).leader.name];
|
|
699
|
+
}
|
|
700
|
+
set leader(value) {
|
|
701
|
+
if (value === void 0) throw new InputTypeError("Expected a tab leader or explicit null reset.");
|
|
702
|
+
this.collection.change(this.id, { leader: value ?? { enum: "WD_TAB_LEADER", name: "SPACES" } });
|
|
703
|
+
}
|
|
704
|
+
};
|
|
705
|
+
function assertRgbSearchValue(value) {
|
|
706
|
+
if (typeof value !== "number" || !Number.isFinite(value)) throw new InputTypeError("Expected a finite numeric color search value.");
|
|
707
|
+
}
|
|
708
|
+
var RGBColorValue = class {
|
|
709
|
+
length = 3;
|
|
710
|
+
values;
|
|
711
|
+
constructor(red, green, blue) {
|
|
712
|
+
if ([red, green, blue].some((value) => typeof value !== "number" || !Number.isInteger(value))) throw new InputTypeError("RGB components must be integers.");
|
|
713
|
+
if ([red, green, blue].some((value) => value < 0 || value > 255)) throw new InvalidValueError("RGB components must be between zero and 255.");
|
|
714
|
+
this.values = Object.freeze([red, green, blue]);
|
|
715
|
+
Object.freeze(this);
|
|
716
|
+
return numericSequence(this);
|
|
717
|
+
}
|
|
718
|
+
static from_string(value) {
|
|
719
|
+
if (!validateDocxValue("RGBColor", value)) throw new InputTypeError("Expected six hexadecimal color digits.");
|
|
720
|
+
return new RGBColor(...[0, 2, 4].map((offset) => Number.parseInt(value.slice(offset, offset + 2), 16)));
|
|
721
|
+
}
|
|
722
|
+
toString() {
|
|
723
|
+
return this.values.map((value) => value.toString(16).padStart(2, "0")).join("").toUpperCase();
|
|
724
|
+
}
|
|
725
|
+
*[Symbol.iterator]() {
|
|
726
|
+
yield* this.values;
|
|
727
|
+
}
|
|
728
|
+
at(index) {
|
|
729
|
+
if (!Number.isSafeInteger(index)) throw new InputTypeError("Expected an integer component index.");
|
|
730
|
+
const value = this.values.at(index);
|
|
731
|
+
if (value === void 0) throw new BoundsError("Color component index is out of range.");
|
|
732
|
+
return value;
|
|
733
|
+
}
|
|
734
|
+
toArray() {
|
|
735
|
+
return snapshotSequence(this.values);
|
|
736
|
+
}
|
|
737
|
+
slice(start = 0, end = 3) {
|
|
738
|
+
if (!Number.isSafeInteger(start) || !Number.isSafeInteger(end)) throw new InputTypeError("Expected integer slice bounds.");
|
|
739
|
+
return snapshotSequence(this.values.slice(start, end));
|
|
740
|
+
}
|
|
741
|
+
count(value) {
|
|
742
|
+
assertRgbSearchValue(value);
|
|
743
|
+
return this.values.filter((item) => item === value).length;
|
|
744
|
+
}
|
|
745
|
+
index(value, start = 0, stop = 3) {
|
|
746
|
+
assertRgbSearchValue(value);
|
|
747
|
+
if (!Number.isSafeInteger(start) || !Number.isSafeInteger(stop)) throw new InputTypeError("Expected integer component bounds.");
|
|
748
|
+
const first = Math.min(3, Math.max(0, start < 0 ? 3 + start : start)), end = Math.min(3, Math.max(0, stop < 0 ? 3 + stop : stop));
|
|
749
|
+
for (let index = first; index < end; index++) if (this.values[index] === value) return index;
|
|
750
|
+
throw new InvalidValueError("Color component was not found.");
|
|
751
|
+
}
|
|
752
|
+
includes(value) {
|
|
753
|
+
assertRgbSearchValue(value);
|
|
754
|
+
return this.values.includes(value);
|
|
755
|
+
}
|
|
756
|
+
*reversed() {
|
|
757
|
+
for (let index = this.values.length - 1; index >= 0; index--) yield this.values[index];
|
|
758
|
+
}
|
|
759
|
+
equals(other) {
|
|
760
|
+
requireComparisonOperand(other);
|
|
761
|
+
return other instanceof RGBColor && this.values.every((value, index) => value === other.values[index]);
|
|
762
|
+
}
|
|
763
|
+
};
|
|
764
|
+
var RGBColor = callableConstructor(RGBColorValue);
|
|
765
|
+
var ColorFormat = class _ColorFormat {
|
|
766
|
+
constructor(owner) {
|
|
767
|
+
this.owner = owner;
|
|
768
|
+
}
|
|
769
|
+
owner;
|
|
770
|
+
get part() {
|
|
771
|
+
return this.owner.part ?? null;
|
|
772
|
+
}
|
|
773
|
+
equals(other) {
|
|
774
|
+
requireComparisonOperand(other);
|
|
775
|
+
const identity = this.owner.identity ?? this.owner;
|
|
776
|
+
return other instanceof _ColorFormat && identity === (other.owner.identity ?? other.owner);
|
|
777
|
+
}
|
|
778
|
+
get element() {
|
|
779
|
+
return ownerView(this.owner);
|
|
780
|
+
}
|
|
781
|
+
get rgb() {
|
|
782
|
+
const value = attr(property(this.owner, "rPr", "color"));
|
|
783
|
+
if (value === void 0 || value === "auto") return null;
|
|
784
|
+
if (!validateDocxValue("RGBColor", value)) throw new InvalidDocumentError("Invalid stored RGB color.");
|
|
785
|
+
return RGBColor.from_string(value);
|
|
786
|
+
}
|
|
787
|
+
set rgb(value) {
|
|
788
|
+
if (value !== null && !(value instanceof RGBColor)) throw new InputTypeError("Expected RGBColor or null.");
|
|
789
|
+
if (value === null && !property(this.owner, "rPr", "color")) return;
|
|
790
|
+
update(this.owner, "r", { color: value === null ? null : value.toString() });
|
|
791
|
+
}
|
|
792
|
+
get theme_color() {
|
|
793
|
+
const value = attr(property(this.owner, "rPr", "color"), "themeColor");
|
|
794
|
+
if (value === void 0) return null;
|
|
795
|
+
const name = Object.keys(themes).find((key) => themes[key] === value);
|
|
796
|
+
if (!name) throw new InvalidDocumentError("Invalid theme color.");
|
|
797
|
+
return enumFamilies.MSO_THEME_COLOR[name];
|
|
798
|
+
}
|
|
799
|
+
set theme_color(value) {
|
|
800
|
+
if (!validateDocxValue("MSO_THEME_COLOR | null", value) || value !== null && !Object.hasOwn(themes, value.name)) throw new InputTypeError("Invalid theme color.");
|
|
801
|
+
if (value === null && !property(this.owner, "rPr", "color")) return;
|
|
802
|
+
if (value !== null && !property(this.owner, "rPr", "color")) {
|
|
803
|
+
update(this.owner, "r", { color: "000000", themeColor: value });
|
|
804
|
+
} else update(this.owner, "r", value === null ? { color: null } : { themeColor: value });
|
|
805
|
+
}
|
|
806
|
+
get type() {
|
|
807
|
+
const node = property(this.owner, "rPr", "color");
|
|
808
|
+
return node === void 0 ? null : enumFamilies.MSO_COLOR_TYPE[attr(node, "themeColor") !== void 0 ? "THEME" : attr(node) === "auto" ? "AUTO" : "RGB"];
|
|
809
|
+
}
|
|
810
|
+
};
|
|
811
|
+
|
|
812
|
+
// packages/safe-bash-docx-engine/src/styles-model.ts
|
|
813
|
+
var types = { PARAGRAPH: "paragraph", CHARACTER: "character", TABLE: "table", LIST: "numbering" };
|
|
814
|
+
function typeName(type) {
|
|
815
|
+
enumValue(type);
|
|
816
|
+
if (type.enum !== "WD_STYLE_TYPE") throw new InputTypeError("Expected a style type.");
|
|
817
|
+
return types[type.name];
|
|
818
|
+
}
|
|
819
|
+
var order = "name aliases basedOn next link autoRedefine hidden uiPriority semiHidden unhideWhenUsed qFormat locked personal personalCompose personalReply rsid pPr rPr tblPr trPr tcPr tblStylePr".split(" ");
|
|
820
|
+
function tri2(value) {
|
|
821
|
+
if (value !== null && typeof value !== "boolean") throw new InputTypeError("Expected true, false or null.");
|
|
822
|
+
}
|
|
823
|
+
function nullableInteger(value) {
|
|
824
|
+
if (value !== null && typeof value !== "number") throw new InputTypeError("Expected a signed 32-bit integer or null.");
|
|
825
|
+
if (value !== null && (!Number.isInteger(value) || value < -2147483648 || value > 2147483647)) throw new InvalidValueError("Expected a signed 32-bit integer or null.");
|
|
826
|
+
}
|
|
827
|
+
var StyleStore = class {
|
|
828
|
+
constructor(source, context, writable, partname, ownerPackage, part) {
|
|
829
|
+
this.source = source;
|
|
830
|
+
this.context = context;
|
|
831
|
+
this.writable = writable;
|
|
832
|
+
this.part = part ?? new StylePartView(this, partname, ownerPackage);
|
|
833
|
+
this.tokens = this.nodes(this.editor()).map((_, i) => i);
|
|
834
|
+
this.nextToken = this.tokens.length;
|
|
835
|
+
const xml = this.editor();
|
|
836
|
+
this.latentTokens = (readLatentStyles(xml.root, void 0, activeXmlChildren(xml, archiveSettings(context).budget))?.entries ?? []).map((_, index) => index);
|
|
837
|
+
this.nextLatentToken = this.latentTokens.length;
|
|
838
|
+
if (part) part[packageBindStyles](new Styles(this), () => this.xmlView("styles-root", (xml2) => xml2.root));
|
|
839
|
+
}
|
|
840
|
+
source;
|
|
841
|
+
context;
|
|
842
|
+
writable;
|
|
843
|
+
revision = 0;
|
|
844
|
+
latentGeneration = 0;
|
|
845
|
+
activePublications = 0;
|
|
846
|
+
tokens;
|
|
847
|
+
latentTokens;
|
|
848
|
+
nextLatentToken;
|
|
849
|
+
nextToken;
|
|
850
|
+
cachedEditor;
|
|
851
|
+
warnings = [];
|
|
852
|
+
part;
|
|
853
|
+
views = /* @__PURE__ */ new Map();
|
|
854
|
+
xmlView(key, resolve, removeRoot) {
|
|
855
|
+
let view = this.views.get(key);
|
|
856
|
+
if (!view) {
|
|
857
|
+
const budget = archiveSettings(this.context).budget;
|
|
858
|
+
let originalChildren = (node) => node.children;
|
|
859
|
+
let originalLatentRoot;
|
|
860
|
+
view = bindXmlElementView({
|
|
861
|
+
budget,
|
|
862
|
+
read: () => this.editor(),
|
|
863
|
+
resolve,
|
|
864
|
+
change: (action) => this.change((xml) => {
|
|
865
|
+
originalChildren = activeXmlChildren(xml, budget);
|
|
866
|
+
originalLatentRoot = styleChild(xml.root, "latentStyles", originalChildren);
|
|
867
|
+
action(xml);
|
|
868
|
+
}),
|
|
869
|
+
...removeRoot ? { removeRoot } : {},
|
|
870
|
+
inserted: (parent, node, index) => {
|
|
871
|
+
if (node.kind !== "element" || node.name.namespaceURI !== parent.namespace) return;
|
|
872
|
+
const styles = parent.localName === "styles" && node.name.localName === "style";
|
|
873
|
+
const latent = parent.localName === "latentStyles" && node.name.localName === "lsdException";
|
|
874
|
+
if (!styles && !latent) return;
|
|
875
|
+
const preceding = /* @__PURE__ */ new Set(), pending = parent.children.slice(0, index);
|
|
876
|
+
while (pending.length) {
|
|
877
|
+
const current = pending.pop();
|
|
878
|
+
budget.charge("work", 1);
|
|
879
|
+
preceding.add(current);
|
|
880
|
+
for (const child2 of current.children) pending.push(child2);
|
|
881
|
+
}
|
|
882
|
+
const position = originalChildren(parent).filter((n) => n.namespace === parent.namespace && n.localName === node.name.localName && preceding.has(n)).length;
|
|
883
|
+
if (styles) this.tokens.splice(position, 0, this.nextToken++);
|
|
884
|
+
else this.latentTokens.splice(position, 0, this.nextLatentToken++);
|
|
885
|
+
},
|
|
886
|
+
removed: (parent, node) => {
|
|
887
|
+
if (node === originalLatentRoot) {
|
|
888
|
+
this.latentGeneration++;
|
|
889
|
+
this.latentTokens.splice(0);
|
|
890
|
+
}
|
|
891
|
+
if (parent?.localName === "styles" && node.localName === "style" && node.namespace === parent.namespace) this.tokens.splice(originalChildren(parent).filter((n) => n.localName === "style" && n.namespace === parent.namespace).indexOf(node), 1);
|
|
892
|
+
if (parent?.localName === "latentStyles" && node.localName === "lsdException" && node.namespace === parent.namespace) this.latentTokens.splice(originalChildren(parent).filter((n) => n.localName === "lsdException" && n.namespace === parent.namespace).indexOf(node), 1);
|
|
893
|
+
}
|
|
894
|
+
});
|
|
895
|
+
this.views.set(key, view);
|
|
896
|
+
}
|
|
897
|
+
return view;
|
|
898
|
+
}
|
|
899
|
+
identities = /* @__PURE__ */ new Map();
|
|
900
|
+
identity(token, kind) {
|
|
901
|
+
const key = `${token}:${kind}`;
|
|
902
|
+
let id = this.identities.get(key);
|
|
903
|
+
if (!id) {
|
|
904
|
+
id = Object.freeze({});
|
|
905
|
+
this.identities.set(key, id);
|
|
906
|
+
}
|
|
907
|
+
return id;
|
|
908
|
+
}
|
|
909
|
+
editor() {
|
|
910
|
+
if (!this.cachedEditor) {
|
|
911
|
+
const settings = archiveSettings(this.context);
|
|
912
|
+
this.cachedEditor = new DocumentXmlEditor(this.source, {}, void 0, settings.budget);
|
|
913
|
+
}
|
|
914
|
+
return this.cachedEditor;
|
|
915
|
+
}
|
|
916
|
+
readChild(node, name) {
|
|
917
|
+
return styleChild(node, name, activeXmlChildren(this.editor(), archiveSettings(this.context).budget));
|
|
918
|
+
}
|
|
919
|
+
nodes(xml) {
|
|
920
|
+
return activeXmlChildren(xml, archiveSettings(this.context).budget)(xml.root).filter((n) => n.namespace === xml.root.namespace && n.localName === "style");
|
|
921
|
+
}
|
|
922
|
+
node(xml, token) {
|
|
923
|
+
const index = this.tokens.indexOf(token), node = this.nodes(xml)[index];
|
|
924
|
+
if (!node) throw new StaleHandleError("The style handle is no longer valid.");
|
|
925
|
+
return node;
|
|
926
|
+
}
|
|
927
|
+
change(action) {
|
|
928
|
+
if (this.activePublications) throw new PublicationError("conflict", "Model publication is committing.");
|
|
929
|
+
this.writable();
|
|
930
|
+
const xml = this.editor();
|
|
931
|
+
try {
|
|
932
|
+
action(xml);
|
|
933
|
+
const source = xml.serialize(), previous = this.source;
|
|
934
|
+
archiveSettings(this.context).budget.charge("work", source.length);
|
|
935
|
+
if (source.length !== previous.length || source.some((byte, index) => byte !== previous[index])) this.revision++;
|
|
936
|
+
this.source = source;
|
|
937
|
+
} finally {
|
|
938
|
+
this.cachedEditor = void 0;
|
|
939
|
+
}
|
|
940
|
+
}
|
|
941
|
+
checkpoint() {
|
|
942
|
+
const tokens = this.tokens.slice(), latentTokens = this.latentTokens.slice(), latentGeneration = this.latentGeneration, revision = this.revision, warningCount = this.warnings.length;
|
|
943
|
+
return () => {
|
|
944
|
+
this.tokens.splice(0, this.tokens.length, ...tokens);
|
|
945
|
+
this.latentTokens.splice(0, this.latentTokens.length, ...latentTokens);
|
|
946
|
+
this.latentGeneration = latentGeneration;
|
|
947
|
+
this.revision = revision;
|
|
948
|
+
this.warnings.length = warningCount;
|
|
949
|
+
this.cachedEditor = void 0;
|
|
950
|
+
};
|
|
951
|
+
}
|
|
952
|
+
add(markup, count = 1) {
|
|
953
|
+
this.change((xml) => xml.insertChildren(xml.root, markup));
|
|
954
|
+
const token = this.nextToken;
|
|
955
|
+
for (let index = 0; index < count; index++) this.tokens.push(this.nextToken++);
|
|
956
|
+
return token;
|
|
957
|
+
}
|
|
958
|
+
remove(token) {
|
|
959
|
+
this.change((xml) => xml[replaceActiveStyleXml](this.node(xml, token), ""));
|
|
960
|
+
this.tokens.splice(this.tokens.indexOf(token), 1);
|
|
961
|
+
}
|
|
962
|
+
};
|
|
963
|
+
var styleOwnerCheckpoints = /* @__PURE__ */ new WeakMap();
|
|
964
|
+
var styleModelMutations = /* @__PURE__ */ new WeakMap();
|
|
965
|
+
var resolveHeadingStyle = /* @__PURE__ */ Symbol("resolve-heading-style");
|
|
966
|
+
var provisionNamedStyles = /* @__PURE__ */ Symbol("provision-named-styles");
|
|
967
|
+
var setStyleLinks = /* @__PURE__ */ Symbol("set-style-links");
|
|
968
|
+
var StylePartView = class _StylePartView extends StylesPart {
|
|
969
|
+
constructor(store, partname, ownerPackage) {
|
|
970
|
+
super(ownerPackage, partname);
|
|
971
|
+
this.store = store;
|
|
972
|
+
Object.freeze(this);
|
|
973
|
+
}
|
|
974
|
+
store;
|
|
975
|
+
#styles;
|
|
976
|
+
static default(owner) {
|
|
977
|
+
if (!(owner instanceof PackageView)) throw new InputTypeError("Expected an admitted owner package.");
|
|
978
|
+
const edges = [...owner.main_document_part.rels.values()].filter((edge) => Object.values(documentDialects).some((dialect) => edge.reltype === `${dialect.r}/styles`) && !edge.is_external);
|
|
979
|
+
if (edges.length !== 1 || !(edges[0].target_part instanceof _StylePartView)) throw new InvalidValueError("Expected the live styles part of this owner.");
|
|
980
|
+
return edges[0].target_part;
|
|
981
|
+
}
|
|
982
|
+
get styles() {
|
|
983
|
+
return this.#styles ??= new Styles(this.store);
|
|
984
|
+
}
|
|
985
|
+
get blob() {
|
|
986
|
+
const bytes = this.store.source, budget = archiveSettings(this.store.context).budget;
|
|
987
|
+
budget.charge("work", bytes.length);
|
|
988
|
+
budget.charge("retainedBytes", bytes.length);
|
|
989
|
+
return new Uint8Array(bytes);
|
|
990
|
+
}
|
|
991
|
+
get element() {
|
|
992
|
+
return this.store.xmlView("styles-root", (xml) => xml.root);
|
|
993
|
+
}
|
|
994
|
+
};
|
|
995
|
+
var Styles = class _Styles {
|
|
996
|
+
constructor(store) {
|
|
997
|
+
this.store = store;
|
|
998
|
+
}
|
|
999
|
+
store;
|
|
1000
|
+
get rawElement() {
|
|
1001
|
+
return this.store.editor().root;
|
|
1002
|
+
}
|
|
1003
|
+
get element() {
|
|
1004
|
+
return this.store.xmlView("styles-root", (xml) => xml.root);
|
|
1005
|
+
}
|
|
1006
|
+
get part() {
|
|
1007
|
+
return this.store.part;
|
|
1008
|
+
}
|
|
1009
|
+
equals(other) {
|
|
1010
|
+
requireComparisonOperand(other);
|
|
1011
|
+
return other instanceof _Styles && other.store === this.store;
|
|
1012
|
+
}
|
|
1013
|
+
get length() {
|
|
1014
|
+
return this.store.tokens.length;
|
|
1015
|
+
}
|
|
1016
|
+
*[Symbol.iterator]() {
|
|
1017
|
+
for (const token of [...this.store.tokens]) yield this.wrap(token);
|
|
1018
|
+
}
|
|
1019
|
+
wrap(token) {
|
|
1020
|
+
const xml = this.store.editor(), kind = styleAttribute(this.store.node(xml, token), "type") ?? "paragraph";
|
|
1021
|
+
return kind === "table" ? new TableStyle(this.store, token, this) : kind === "paragraph" ? new ParagraphStyle(this.store, token, this) : kind === "character" ? new CharacterStyle(this.store, token, this) : new BaseStyle(this.store, token, this);
|
|
1022
|
+
}
|
|
1023
|
+
has(name) {
|
|
1024
|
+
if (typeof name !== "string") throw new InputTypeError("Styles are keyed by name.");
|
|
1025
|
+
return [...this].some((style) => style.name !== null && (style.name === name || style.builtin && styleStoredName(style.name) === styleStoredName(name)));
|
|
1026
|
+
}
|
|
1027
|
+
at(name) {
|
|
1028
|
+
if (typeof name !== "string") throw new InputTypeError("Styles are keyed by name.");
|
|
1029
|
+
const styles = [...this], exact = styles.filter((style) => style.name === name);
|
|
1030
|
+
const matches = exact.length ? exact : styles.filter((style) => style.builtin && style.name !== null && styleStoredName(style.name) === styleStoredName(name));
|
|
1031
|
+
if (matches.length === 1) return matches[0];
|
|
1032
|
+
if (matches.length > 1) throw new InvalidValueError("Style name is ambiguous.");
|
|
1033
|
+
const byId = [...this].find((style) => style.style_id === name);
|
|
1034
|
+
if (!byId) throw new MissingKeyError("Style name was not found.");
|
|
1035
|
+
this.store.warnings.push({ code: "deprecated-style-id-lookup" });
|
|
1036
|
+
return byId;
|
|
1037
|
+
}
|
|
1038
|
+
[resolveHeadingStyle](level) {
|
|
1039
|
+
const budget = archiveSettings(this.store.context).budget;
|
|
1040
|
+
const root = this.rawElement;
|
|
1041
|
+
const rendered = renderContent({ version: 1, blocks: [{ kind: "paragraph", level }] }, root.namespace, budget, root, void 0, this.part.package[packageStyleAllocationIds]());
|
|
1042
|
+
if (rendered.styles) return this.wrap(this.store.add(rendered.styles));
|
|
1043
|
+
const paragraph = parseDocumentXml(new TextEncoder().encode(rendered.body), {}, budget).root;
|
|
1044
|
+
const id = styleAttribute(styleChild(styleChild(paragraph, "pPr"), "pStyle"), "val");
|
|
1045
|
+
const style = [...this].find((style2) => style2.style_id === id);
|
|
1046
|
+
if (!(style instanceof ParagraphStyle)) throw new InvalidValueError("Expected the allocated paragraph heading style.");
|
|
1047
|
+
return style;
|
|
1048
|
+
}
|
|
1049
|
+
add_style(name, style_type, builtin = false) {
|
|
1050
|
+
if (typeof name !== "string" || typeof builtin !== "boolean") throw new InputTypeError("Expected a style name and builtin flag.");
|
|
1051
|
+
if (!name.length) throw new InvalidValueError("Expected a nonempty style name.");
|
|
1052
|
+
const type = typeName(style_type);
|
|
1053
|
+
if ([...this].some((style) => style.name === styleDisplayName(name, builtin))) throw new InvalidValueError("The style name already exists.");
|
|
1054
|
+
const ids = this.part.package[packageStyleAllocationIds]();
|
|
1055
|
+
let serial = 1;
|
|
1056
|
+
while (ids.has(`Style${serial}`)) serial++;
|
|
1057
|
+
const namespace = this.rawElement.namespace;
|
|
1058
|
+
return this.wrap(this.store.add(`<st:style xmlns:st="${namespace}" st:type="${type}" st:styleId="Style${serial}"${builtin ? "" : ' st:customStyle="1"'}><st:name st:val="${xmlValue(styleStoredName(name, builtin))}"/></st:style>`));
|
|
1059
|
+
}
|
|
1060
|
+
[provisionNamedStyles](definitions) {
|
|
1061
|
+
const existing = definitions.map((definition) => this.has(definition.name) ? this.at(definition.name) : null);
|
|
1062
|
+
const missing = definitions.filter((_, index2) => existing[index2] === null);
|
|
1063
|
+
if (!missing.length) return existing;
|
|
1064
|
+
const ids = this.part.package[packageStyleAllocationIds](), namespace = this.rawElement.namespace;
|
|
1065
|
+
let serial = 1;
|
|
1066
|
+
const markup = missing.map((definition) => {
|
|
1067
|
+
while (ids.has(`Style${serial}`)) serial++;
|
|
1068
|
+
const id = `Style${serial++}`;
|
|
1069
|
+
ids.add(id);
|
|
1070
|
+
return `<st:style xmlns:st="${namespace}" st:type="${typeName(definition.type)}" st:styleId="${id}" st:customStyle="1"><st:name st:val="${xmlValue(styleStoredName(definition.name))}"/></st:style>`;
|
|
1071
|
+
}).join("");
|
|
1072
|
+
const first = this.store.add(markup, missing.length);
|
|
1073
|
+
let index = 0;
|
|
1074
|
+
return existing.map((style) => style ?? this.wrap(first + index++));
|
|
1075
|
+
}
|
|
1076
|
+
default(style_type) {
|
|
1077
|
+
const type = typeName(style_type);
|
|
1078
|
+
return [...this].filter((s) => types[s.type.name] === type && storedBoolean([...s.element.attributes].find(([name]) => name.namespaceURI === s.element.namespace && name.localName === "default")?.[1] ?? "0")).at(-1) ?? null;
|
|
1079
|
+
}
|
|
1080
|
+
get_by_id(style_id, style_type) {
|
|
1081
|
+
if (style_id !== null && typeof style_id !== "string") throw new InputTypeError("Expected a style ID or null.");
|
|
1082
|
+
const type = typeName(style_type);
|
|
1083
|
+
if (style_id === null || style_id === "") return this.default(style_type);
|
|
1084
|
+
return [...this].find((s) => s.style_id === style_id && types[s.type.name] === type) ?? this.default(style_type);
|
|
1085
|
+
}
|
|
1086
|
+
get_style_id(style_or_name, style_type) {
|
|
1087
|
+
typeName(style_type);
|
|
1088
|
+
if (style_or_name === null) return null;
|
|
1089
|
+
const style = typeof style_or_name === "string" ? this.at(style_or_name) : style_or_name;
|
|
1090
|
+
if (!(style instanceof BaseStyle)) throw new InputTypeError("Expected a style of the requested type.");
|
|
1091
|
+
if (style.collection !== this) throw new OwnershipError("Expected an owned style.");
|
|
1092
|
+
if (style.type.name !== style_type.name) throw new InputTypeError("Expected a style of the requested type.");
|
|
1093
|
+
return style.style_id === this.default(style_type)?.style_id ? null : style.style_id;
|
|
1094
|
+
}
|
|
1095
|
+
get latent_styles() {
|
|
1096
|
+
if (!this.store.readChild(this.rawElement, "latentStyles")) this.store.change((xml) => xml[insertActiveLatentStyles]());
|
|
1097
|
+
return new LatentStyles(this.store);
|
|
1098
|
+
}
|
|
1099
|
+
};
|
|
1100
|
+
var BaseStyle = class _BaseStyle {
|
|
1101
|
+
constructor(store, token, collection) {
|
|
1102
|
+
this.store = store;
|
|
1103
|
+
this.token = token;
|
|
1104
|
+
this.collection = collection;
|
|
1105
|
+
}
|
|
1106
|
+
store;
|
|
1107
|
+
token;
|
|
1108
|
+
collection;
|
|
1109
|
+
get rawElement() {
|
|
1110
|
+
const xml = this.store.editor();
|
|
1111
|
+
return this.store.node(xml, this.token);
|
|
1112
|
+
}
|
|
1113
|
+
get element() {
|
|
1114
|
+
void this.rawElement;
|
|
1115
|
+
return this.store.xmlView(`style:${this.token}`, (xml) => this.store.node(xml, this.token), () => this.delete());
|
|
1116
|
+
}
|
|
1117
|
+
get part() {
|
|
1118
|
+
void this.rawElement;
|
|
1119
|
+
return this.store.part;
|
|
1120
|
+
}
|
|
1121
|
+
equals(other) {
|
|
1122
|
+
requireComparisonOperand(other);
|
|
1123
|
+
void this.rawElement;
|
|
1124
|
+
if (!(other instanceof _BaseStyle) || other.store !== this.store) return false;
|
|
1125
|
+
void other.rawElement;
|
|
1126
|
+
return other.token === this.token;
|
|
1127
|
+
}
|
|
1128
|
+
setValue(tag, value) {
|
|
1129
|
+
this.store.change((xml) => {
|
|
1130
|
+
const node = this.store.node(xml, this.token), children = activeXmlChildren(xml, archiveSettings(this.store.context).budget);
|
|
1131
|
+
xml[replaceActiveStyleXml](node, mergeStyleChildren(xml, node, /* @__PURE__ */ new Map([[tag, value === null ? "" : `<st:${tag} xmlns:st="${node.namespace}" st:val="${xmlValue(value)}"/>`]]), order, {}, children));
|
|
1132
|
+
});
|
|
1133
|
+
}
|
|
1134
|
+
setAttribute(name, value) {
|
|
1135
|
+
this.store.change((xml) => {
|
|
1136
|
+
const node = this.store.node(xml, this.token);
|
|
1137
|
+
xml[replaceActiveStyleXml](node, mergeStyleChildren(xml, node, /* @__PURE__ */ new Map(), order, { [name]: value }));
|
|
1138
|
+
});
|
|
1139
|
+
}
|
|
1140
|
+
[setStyleLinks](options) {
|
|
1141
|
+
this.store.change((xml) => {
|
|
1142
|
+
const budget = archiveSettings(this.store.context).budget, children = activeXmlChildren(xml, budget);
|
|
1143
|
+
const selected = this.store.node(xml, this.token);
|
|
1144
|
+
const patches = styleLinkPatches(this.store.nodes(xml), selected, options, children, budget);
|
|
1145
|
+
for (const [node, patch] of patches) {
|
|
1146
|
+
const updates = /* @__PURE__ */ new Map();
|
|
1147
|
+
if (patch.link !== void 0) updates.set("link", patch.link === null ? "" : `<st:link xmlns:st="${node.namespace}" st:val="${xmlValue(patch.link)}"/>`);
|
|
1148
|
+
const attributes = patch.default === void 0 ? {} : { default: patch.default };
|
|
1149
|
+
const markup = mergeStyleChildren(xml, node, updates, order, attributes, children);
|
|
1150
|
+
if (markup !== xml.sourceXml(node)) xml[replaceActiveStyleXml](node, markup);
|
|
1151
|
+
}
|
|
1152
|
+
});
|
|
1153
|
+
}
|
|
1154
|
+
get name() {
|
|
1155
|
+
const value = styleAttribute(this.store.readChild(this.rawElement, "name"), "val");
|
|
1156
|
+
return value === void 0 ? null : styleDisplayName(value, this.builtin);
|
|
1157
|
+
}
|
|
1158
|
+
set name(value) {
|
|
1159
|
+
if (value !== null && typeof value !== "string") throw new InputTypeError("Expected a style name or null.");
|
|
1160
|
+
if (value === "") throw new InvalidValueError("Expected a nonempty style name or null.");
|
|
1161
|
+
this.setValue("name", value);
|
|
1162
|
+
}
|
|
1163
|
+
get style_id() {
|
|
1164
|
+
return styleAttribute(this.rawElement, "styleId") ?? null;
|
|
1165
|
+
}
|
|
1166
|
+
set style_id(value) {
|
|
1167
|
+
if (value !== null && typeof value !== "string") throw new InputTypeError("Expected a style ID or null.");
|
|
1168
|
+
if (value === "") throw new InvalidValueError("Expected a nonempty style ID or null.");
|
|
1169
|
+
this.setAttribute("styleId", value);
|
|
1170
|
+
}
|
|
1171
|
+
get type() {
|
|
1172
|
+
const type = styleAttribute(this.rawElement, "type") ?? "paragraph";
|
|
1173
|
+
const key = Object.keys(types).find((k) => types[k] === type);
|
|
1174
|
+
if (!key) throw new InvalidDocumentError("Unknown stored style type.");
|
|
1175
|
+
return WD_STYLE_TYPE[key];
|
|
1176
|
+
}
|
|
1177
|
+
get builtin() {
|
|
1178
|
+
return !storedBoolean(styleAttribute(this.rawElement, "customStyle") ?? "0");
|
|
1179
|
+
}
|
|
1180
|
+
get priority() {
|
|
1181
|
+
return styleInteger(styleAttribute(this.store.readChild(this.rawElement, "uiPriority"), "val"));
|
|
1182
|
+
}
|
|
1183
|
+
set priority(value) {
|
|
1184
|
+
nullableInteger(value);
|
|
1185
|
+
this.setValue("uiPriority", value === null ? null : String(value));
|
|
1186
|
+
}
|
|
1187
|
+
get hidden() {
|
|
1188
|
+
return this.flag("semiHidden");
|
|
1189
|
+
}
|
|
1190
|
+
set hidden(value) {
|
|
1191
|
+
tri2(value);
|
|
1192
|
+
this.setValue("semiHidden", value ? "1" : null);
|
|
1193
|
+
}
|
|
1194
|
+
get locked() {
|
|
1195
|
+
return this.flag("locked");
|
|
1196
|
+
}
|
|
1197
|
+
set locked(value) {
|
|
1198
|
+
tri2(value);
|
|
1199
|
+
this.setValue("locked", value ? "1" : null);
|
|
1200
|
+
}
|
|
1201
|
+
get quick_style() {
|
|
1202
|
+
return this.flag("qFormat");
|
|
1203
|
+
}
|
|
1204
|
+
set quick_style(value) {
|
|
1205
|
+
tri2(value);
|
|
1206
|
+
this.setValue("qFormat", value ? "1" : null);
|
|
1207
|
+
}
|
|
1208
|
+
get unhide_when_used() {
|
|
1209
|
+
return this.flag("unhideWhenUsed");
|
|
1210
|
+
}
|
|
1211
|
+
set unhide_when_used(value) {
|
|
1212
|
+
tri2(value);
|
|
1213
|
+
this.setValue("unhideWhenUsed", value ? "1" : null);
|
|
1214
|
+
}
|
|
1215
|
+
flag(tag) {
|
|
1216
|
+
return styleToggle(this.store.readChild(this.rawElement, tag)) ?? false;
|
|
1217
|
+
}
|
|
1218
|
+
delete() {
|
|
1219
|
+
this.store.remove(this.token);
|
|
1220
|
+
}
|
|
1221
|
+
};
|
|
1222
|
+
var CharacterStyle = class _CharacterStyle extends BaseStyle {
|
|
1223
|
+
formattingOwner(kind) {
|
|
1224
|
+
const { store, token } = this;
|
|
1225
|
+
const owner = { budget: archiveSettings(store.context).budget, get part() {
|
|
1226
|
+
store.node(store.editor(), token);
|
|
1227
|
+
return store.part;
|
|
1228
|
+
}, get identity() {
|
|
1229
|
+
store.node(store.editor(), token);
|
|
1230
|
+
return store.identity(token, kind);
|
|
1231
|
+
}, getXml: () => {
|
|
1232
|
+
const xml = this.store.editor(), node = this.store.node(xml, this.token), props = styleChild(node, kind + "Pr");
|
|
1233
|
+
return `<st:${kind} xmlns:st="${node.namespace}">${props ? runElementOpen(props) + xml.sourceXml(props, /* @__PURE__ */ new Map(), true) + `</${props.name}>` : ""}</st:${kind}>`;
|
|
1234
|
+
}, setXml: (source) => {
|
|
1235
|
+
const fragment = new DocumentXmlEditor(new TextEncoder().encode(source));
|
|
1236
|
+
const props = styleChild(fragment.root, kind + "Pr");
|
|
1237
|
+
this.store.change((xml) => {
|
|
1238
|
+
const node = this.store.node(xml, this.token);
|
|
1239
|
+
xml[replaceActiveStyleXml](node, mergeStyleChildren(xml, node, /* @__PURE__ */ new Map([[kind + "Pr", props ? runElementOpen(props) + fragment.sourceXml(props, /* @__PURE__ */ new Map(), true) + `</${props.name}>` : ""]]), order));
|
|
1240
|
+
});
|
|
1241
|
+
} };
|
|
1242
|
+
formattingXmlOwners.set(owner, {
|
|
1243
|
+
budget: archiveSettings(store.context).budget,
|
|
1244
|
+
read: () => store.editor(),
|
|
1245
|
+
resolve: (xml) => store.node(xml, token),
|
|
1246
|
+
change: (action) => store.change(action)
|
|
1247
|
+
});
|
|
1248
|
+
return owner;
|
|
1249
|
+
}
|
|
1250
|
+
get font() {
|
|
1251
|
+
return new Font(this.formattingOwner("r"));
|
|
1252
|
+
}
|
|
1253
|
+
get base_style() {
|
|
1254
|
+
const id = styleAttribute(this.store.readChild(this.rawElement, "basedOn"), "val");
|
|
1255
|
+
return id === void 0 ? null : [...this.collection].find((s) => s.style_id === id) ?? null;
|
|
1256
|
+
}
|
|
1257
|
+
set base_style(value) {
|
|
1258
|
+
if (value !== null) {
|
|
1259
|
+
if (!(value instanceof BaseStyle)) throw new InputTypeError("Expected a base style of the same type.");
|
|
1260
|
+
if (value.collection !== this.collection) throw new OwnershipError("Expected a base style from this document.");
|
|
1261
|
+
if (value.type.name !== this.type.name) throw new InputTypeError("Expected a base style of the same type.");
|
|
1262
|
+
}
|
|
1263
|
+
const visited = /* @__PURE__ */ new Set();
|
|
1264
|
+
let next = value;
|
|
1265
|
+
while (next) {
|
|
1266
|
+
if (next.style_id === this.style_id || visited.has(next.style_id)) throw new InvalidValueError("A style base cannot form a cycle.");
|
|
1267
|
+
visited.add(next.style_id);
|
|
1268
|
+
next = next instanceof _CharacterStyle ? next.base_style : null;
|
|
1269
|
+
}
|
|
1270
|
+
this.setValue("basedOn", value?.style_id ?? null);
|
|
1271
|
+
}
|
|
1272
|
+
};
|
|
1273
|
+
var ParagraphStyle = class extends CharacterStyle {
|
|
1274
|
+
get paragraph_format() {
|
|
1275
|
+
return new ParagraphFormat(this.formattingOwner("p"));
|
|
1276
|
+
}
|
|
1277
|
+
get next_paragraph_style() {
|
|
1278
|
+
const id = styleAttribute(this.store.readChild(this.rawElement, "next"), "val");
|
|
1279
|
+
return [...this.collection].find((s) => s.style_id === id && s.type.name === "PARAGRAPH") ?? this;
|
|
1280
|
+
}
|
|
1281
|
+
set next_paragraph_style(value) {
|
|
1282
|
+
if (value !== null) {
|
|
1283
|
+
if (!(value instanceof BaseStyle)) throw new InputTypeError("Expected a paragraph style.");
|
|
1284
|
+
if (value.collection !== this.collection) throw new OwnershipError("Expected an owned paragraph style.");
|
|
1285
|
+
if (value.type.name !== "PARAGRAPH") throw new InputTypeError("Expected a paragraph style.");
|
|
1286
|
+
}
|
|
1287
|
+
this.setValue("next", value?.style_id === this.style_id ? null : value?.style_id ?? null);
|
|
1288
|
+
}
|
|
1289
|
+
};
|
|
1290
|
+
var TableStyle = class extends ParagraphStyle {
|
|
1291
|
+
};
|
|
1292
|
+
var LatentStyles = class _LatentStyles {
|
|
1293
|
+
constructor(store) {
|
|
1294
|
+
this.store = store;
|
|
1295
|
+
this.generation = store.latentGeneration;
|
|
1296
|
+
}
|
|
1297
|
+
store;
|
|
1298
|
+
generation;
|
|
1299
|
+
get rawElement() {
|
|
1300
|
+
if (this.generation !== this.store.latentGeneration) throw new StaleHandleError("The latent styles handle is no longer valid.");
|
|
1301
|
+
const node = this.store.readChild(this.store.editor().root, "latentStyles");
|
|
1302
|
+
if (!node) throw new StaleHandleError("The latent styles handle is no longer valid.");
|
|
1303
|
+
return node;
|
|
1304
|
+
}
|
|
1305
|
+
get element() {
|
|
1306
|
+
void this.rawElement;
|
|
1307
|
+
return this.store.xmlView(`latent-root:${this.generation}`, (xml) => {
|
|
1308
|
+
void this.rawElement;
|
|
1309
|
+
const node = this.store.readChild(xml.root, "latentStyles");
|
|
1310
|
+
if (!node) throw new StaleHandleError("The XML owner is detached.");
|
|
1311
|
+
return node;
|
|
1312
|
+
}, () => this.removeContainer());
|
|
1313
|
+
}
|
|
1314
|
+
removeContainer() {
|
|
1315
|
+
void this.rawElement;
|
|
1316
|
+
this.store.change((xml) => xml.replaceElement(this.rawElement, ""));
|
|
1317
|
+
this.store.latentGeneration++;
|
|
1318
|
+
this.store.latentTokens.splice(0);
|
|
1319
|
+
}
|
|
1320
|
+
xmlView(token) {
|
|
1321
|
+
void this.entry(token);
|
|
1322
|
+
return this.store.xmlView(`latent:${token}`, (xml) => this.node(token, xml), () => this.remove(token));
|
|
1323
|
+
}
|
|
1324
|
+
get part() {
|
|
1325
|
+
void this.rawElement;
|
|
1326
|
+
return this.store.part;
|
|
1327
|
+
}
|
|
1328
|
+
equals(other) {
|
|
1329
|
+
requireComparisonOperand(other);
|
|
1330
|
+
void this.rawElement;
|
|
1331
|
+
if (other instanceof _LatentStyles && other.store === this.store) void other.rawElement;
|
|
1332
|
+
return other instanceof _LatentStyles && other.store === this.store && other.generation === this.generation;
|
|
1333
|
+
}
|
|
1334
|
+
info() {
|
|
1335
|
+
void this.rawElement;
|
|
1336
|
+
const xml = this.store.editor();
|
|
1337
|
+
return readLatentStyles(xml.root, void 0, activeXmlChildren(xml, archiveSettings(this.store.context).budget));
|
|
1338
|
+
}
|
|
1339
|
+
get length() {
|
|
1340
|
+
return this.info().entries.length;
|
|
1341
|
+
}
|
|
1342
|
+
*[Symbol.iterator]() {
|
|
1343
|
+
void this.rawElement;
|
|
1344
|
+
for (const token of [...this.store.latentTokens]) {
|
|
1345
|
+
void this.rawElement;
|
|
1346
|
+
yield new LatentStyle(this, token);
|
|
1347
|
+
}
|
|
1348
|
+
}
|
|
1349
|
+
has(name) {
|
|
1350
|
+
if (typeof name !== "string") throw new InputTypeError("Latent styles are keyed by name.");
|
|
1351
|
+
return this.info().entries.some((s) => styleStoredName(s.name) === styleStoredName(name));
|
|
1352
|
+
}
|
|
1353
|
+
at(name) {
|
|
1354
|
+
if (typeof name !== "string") throw new InputTypeError("Latent styles are keyed by name.");
|
|
1355
|
+
const index = this.info().entries.findIndex((entry) => styleStoredName(entry.name) === styleStoredName(name));
|
|
1356
|
+
if (index < 0) throw new MissingKeyError("Latent style name was not found.");
|
|
1357
|
+
return new LatentStyle(this, this.store.latentTokens[index]);
|
|
1358
|
+
}
|
|
1359
|
+
add_latent_style(name) {
|
|
1360
|
+
void this.rawElement;
|
|
1361
|
+
if (typeof name !== "string") throw new InputTypeError("Expected a latent style name.");
|
|
1362
|
+
if (!name.length) throw new InvalidValueError("Expected a nonempty latent style name.");
|
|
1363
|
+
this.store.change((xml) => {
|
|
1364
|
+
const node = this.store.readChild(xml.root, "latentStyles");
|
|
1365
|
+
xml.insertChildren(node, `<st:lsdException xmlns:st="${node.namespace}" st:name="${xmlValue(styleStoredName(name))}"/>`);
|
|
1366
|
+
});
|
|
1367
|
+
const token = this.store.nextLatentToken++;
|
|
1368
|
+
this.store.latentTokens.push(token);
|
|
1369
|
+
return new LatentStyle(this, token);
|
|
1370
|
+
}
|
|
1371
|
+
entry(token) {
|
|
1372
|
+
const index = this.store.latentTokens.indexOf(token), entry = this.info().entries[index];
|
|
1373
|
+
if (!entry) throw new StaleHandleError("The latent style handle is no longer valid.");
|
|
1374
|
+
return entry;
|
|
1375
|
+
}
|
|
1376
|
+
node(token, xml = this.store.editor()) {
|
|
1377
|
+
void this.rawElement;
|
|
1378
|
+
const children = activeXmlChildren(xml, archiveSettings(this.store.context).budget), root = styleChild(xml.root, "latentStyles", children);
|
|
1379
|
+
const index = this.store.latentTokens.indexOf(token), node = root && children(root).filter((n) => n.namespace === xml.root.namespace && n.localName === "lsdException")[index];
|
|
1380
|
+
if (!node) throw new StaleHandleError("The latent style handle is no longer valid.");
|
|
1381
|
+
return node;
|
|
1382
|
+
}
|
|
1383
|
+
change(token, key, value) {
|
|
1384
|
+
const names = { hidden: "semiHidden", locked: "locked", quickStyle: "qFormat", unhideWhenUsed: "unhideWhenUsed", priority: "uiPriority" };
|
|
1385
|
+
this.store.change((xml) => {
|
|
1386
|
+
const node = this.node(token, xml);
|
|
1387
|
+
xml.replaceElement(node, mergeStyleChildren(xml, node, /* @__PURE__ */ new Map(), [], { [names[key]]: value === null ? null : typeof value === "boolean" ? String(Number(value)) : String(value) }));
|
|
1388
|
+
});
|
|
1389
|
+
}
|
|
1390
|
+
remove(token) {
|
|
1391
|
+
this.store.change((xml) => {
|
|
1392
|
+
xml.replaceElement(this.node(token, xml), "");
|
|
1393
|
+
});
|
|
1394
|
+
this.store.latentTokens.splice(this.store.latentTokens.indexOf(token), 1);
|
|
1395
|
+
}
|
|
1396
|
+
setDefault(key, value) {
|
|
1397
|
+
void this.rawElement;
|
|
1398
|
+
this.store.change((xml) => {
|
|
1399
|
+
editLatentStyles(xml, "styles.latent.defaults.set", { [key]: value }, activeXmlChildren(xml, archiveSettings(this.store.context).budget));
|
|
1400
|
+
});
|
|
1401
|
+
}
|
|
1402
|
+
get default_to_hidden() {
|
|
1403
|
+
return this.info().defaults.defaultToHidden;
|
|
1404
|
+
}
|
|
1405
|
+
set default_to_hidden(value) {
|
|
1406
|
+
if (typeof value !== "boolean") throw new InputTypeError("Expected a boolean.");
|
|
1407
|
+
this.setDefault("defaultToHidden", value);
|
|
1408
|
+
}
|
|
1409
|
+
get default_to_locked() {
|
|
1410
|
+
return this.info().defaults.defaultToLocked;
|
|
1411
|
+
}
|
|
1412
|
+
set default_to_locked(value) {
|
|
1413
|
+
if (typeof value !== "boolean") throw new InputTypeError("Expected a boolean.");
|
|
1414
|
+
this.setDefault("defaultToLocked", value);
|
|
1415
|
+
}
|
|
1416
|
+
get default_to_quick_style() {
|
|
1417
|
+
return this.info().defaults.defaultToQuickStyle;
|
|
1418
|
+
}
|
|
1419
|
+
set default_to_quick_style(value) {
|
|
1420
|
+
if (typeof value !== "boolean") throw new InputTypeError("Expected a boolean.");
|
|
1421
|
+
this.setDefault("defaultToQuickStyle", value);
|
|
1422
|
+
}
|
|
1423
|
+
get default_to_unhide_when_used() {
|
|
1424
|
+
return this.info().defaults.defaultToUnhideWhenUsed;
|
|
1425
|
+
}
|
|
1426
|
+
set default_to_unhide_when_used(value) {
|
|
1427
|
+
if (typeof value !== "boolean") throw new InputTypeError("Expected a boolean.");
|
|
1428
|
+
this.setDefault("defaultToUnhideWhenUsed", value);
|
|
1429
|
+
}
|
|
1430
|
+
get default_priority() {
|
|
1431
|
+
return this.info().defaults.defaultPriority;
|
|
1432
|
+
}
|
|
1433
|
+
set default_priority(value) {
|
|
1434
|
+
nullableInteger(value);
|
|
1435
|
+
this.setDefault("defaultPriority", value);
|
|
1436
|
+
}
|
|
1437
|
+
get load_count() {
|
|
1438
|
+
return this.info().defaults.loadCount;
|
|
1439
|
+
}
|
|
1440
|
+
set load_count(value) {
|
|
1441
|
+
nullableInteger(value);
|
|
1442
|
+
this.setDefault("loadCount", value);
|
|
1443
|
+
}
|
|
1444
|
+
};
|
|
1445
|
+
var LatentStyle = class _LatentStyle {
|
|
1446
|
+
constructor(collection, token) {
|
|
1447
|
+
this.collection = collection;
|
|
1448
|
+
this.token = token;
|
|
1449
|
+
}
|
|
1450
|
+
collection;
|
|
1451
|
+
token;
|
|
1452
|
+
get name() {
|
|
1453
|
+
return this.collection.entry(this.token).name;
|
|
1454
|
+
}
|
|
1455
|
+
get part() {
|
|
1456
|
+
void this.name;
|
|
1457
|
+
return this.collection.part;
|
|
1458
|
+
}
|
|
1459
|
+
get element() {
|
|
1460
|
+
return this.collection.xmlView(this.token);
|
|
1461
|
+
}
|
|
1462
|
+
equals(other) {
|
|
1463
|
+
requireComparisonOperand(other);
|
|
1464
|
+
void this.name;
|
|
1465
|
+
if (other instanceof _LatentStyle) void other.name;
|
|
1466
|
+
return other instanceof _LatentStyle && this.collection.equals(other.collection) && this.token === other.token;
|
|
1467
|
+
}
|
|
1468
|
+
get priority() {
|
|
1469
|
+
return this.collection.entry(this.token).priority;
|
|
1470
|
+
}
|
|
1471
|
+
set priority(value) {
|
|
1472
|
+
nullableInteger(value);
|
|
1473
|
+
this.collection.change(this.token, "priority", value);
|
|
1474
|
+
}
|
|
1475
|
+
get hidden() {
|
|
1476
|
+
return this.collection.entry(this.token).hidden;
|
|
1477
|
+
}
|
|
1478
|
+
set hidden(value) {
|
|
1479
|
+
tri2(value);
|
|
1480
|
+
this.collection.change(this.token, "hidden", value);
|
|
1481
|
+
}
|
|
1482
|
+
get locked() {
|
|
1483
|
+
return this.collection.entry(this.token).locked;
|
|
1484
|
+
}
|
|
1485
|
+
set locked(value) {
|
|
1486
|
+
tri2(value);
|
|
1487
|
+
this.collection.change(this.token, "locked", value);
|
|
1488
|
+
}
|
|
1489
|
+
get quick_style() {
|
|
1490
|
+
return this.collection.entry(this.token).quickStyle;
|
|
1491
|
+
}
|
|
1492
|
+
set quick_style(value) {
|
|
1493
|
+
tri2(value);
|
|
1494
|
+
this.collection.change(this.token, "quickStyle", value);
|
|
1495
|
+
}
|
|
1496
|
+
get unhide_when_used() {
|
|
1497
|
+
return this.collection.entry(this.token).unhideWhenUsed;
|
|
1498
|
+
}
|
|
1499
|
+
set unhide_when_used(value) {
|
|
1500
|
+
tri2(value);
|
|
1501
|
+
this.collection.change(this.token, "unhideWhenUsed", value);
|
|
1502
|
+
}
|
|
1503
|
+
delete() {
|
|
1504
|
+
this.collection.remove(this.token);
|
|
1505
|
+
}
|
|
1506
|
+
};
|
|
1507
|
+
async function openDocumentStyleModel(input, context) {
|
|
1508
|
+
return bindDocumentStyleModel(await admitDocumentModel(input, context));
|
|
1509
|
+
}
|
|
1510
|
+
async function bindDocumentStyleModel({ archive: admitted, settings, source }) {
|
|
1511
|
+
const edges = admitted.package.relationships("/" + admitted.mainPart).filter((e) => e.reltype === `${documentDialects[admitted.dialect].r}/styles`);
|
|
1512
|
+
if (edges.length > 1 || edges[0]?.is_external) throw new UnsupportedEditError("Expected one internal styles part.");
|
|
1513
|
+
let archive = admitted;
|
|
1514
|
+
let part = edges[0]?.target_part.name;
|
|
1515
|
+
const createdStylesPart = part === void 0;
|
|
1516
|
+
if (!part) {
|
|
1517
|
+
const result = addDocumentStylesPart(admitted, admitted, "", settings.budget);
|
|
1518
|
+
archive = result.archive;
|
|
1519
|
+
part = result.name;
|
|
1520
|
+
}
|
|
1521
|
+
let stylesPart = part;
|
|
1522
|
+
let bindingReady = false;
|
|
1523
|
+
const packageView = new PackageView({
|
|
1524
|
+
context: settings,
|
|
1525
|
+
snapshot: () => bindingReady ? snapshot() : archive,
|
|
1526
|
+
version: () => bindingReady ? store.revision : 0,
|
|
1527
|
+
writable: () => {
|
|
1528
|
+
if (store.activePublications) throw new PublicationError("conflict", "Model publication is committing.");
|
|
1529
|
+
assertDocumentEditable(admitted, settings);
|
|
1530
|
+
},
|
|
1531
|
+
stage: (candidate, rename) => {
|
|
1532
|
+
archive = candidate;
|
|
1533
|
+
if (rename?.from === "/" + stylesPart) stylesPart = rename.to.slice(1);
|
|
1534
|
+
},
|
|
1535
|
+
save: async (output, options) => {
|
|
1536
|
+
await model.save(output, options);
|
|
1537
|
+
}
|
|
1538
|
+
});
|
|
1539
|
+
const store = new StyleStore(archive.members.find((m) => m.name === stylesPart).bytes, settings, () => assertDocumentEditable(admitted, settings), "/" + stylesPart, packageView);
|
|
1540
|
+
store.revision = createdStylesPart ? 1 : 0;
|
|
1541
|
+
const styles = store.part.styles;
|
|
1542
|
+
styleModelMutations.set(styles, store);
|
|
1543
|
+
function snapshot() {
|
|
1544
|
+
const root = store.editor().root, ids = /* @__PURE__ */ new Set();
|
|
1545
|
+
for (const node of store.nodes(store.editor())) {
|
|
1546
|
+
const id = styleAttribute(node, "styleId"), type = styleAttribute(node, "type") ?? "paragraph";
|
|
1547
|
+
if (!Object.values(types).includes(type) || id !== void 0 && ids.has(id)) throw new SemanticValidationError([
|
|
1548
|
+
{ code: "style-definition-graph", part: "/" + stylesPart, location: "/styles", message: "Invalid style definition graph." }
|
|
1549
|
+
]);
|
|
1550
|
+
if (id !== void 0) ids.add(id);
|
|
1551
|
+
}
|
|
1552
|
+
if (!documentDialects[admitted.dialect] || root.namespace !== documentDialects[admitted.dialect].w || root.localName !== "styles") throw new InvalidValueError("Invalid styles part root.");
|
|
1553
|
+
return { ...archive, members: archive.members.map((m) => m.name === stylesPart ? { ...m, bytes: store.source } : m) };
|
|
1554
|
+
}
|
|
1555
|
+
;
|
|
1556
|
+
bindingReady = true;
|
|
1557
|
+
const guard = () => {
|
|
1558
|
+
const revision = store.revision, graphRevision = packageView.revision;
|
|
1559
|
+
return () => {
|
|
1560
|
+
if (store.revision !== revision || packageView.revision !== graphRevision) throw new PublicationError("conflict", "Model changed during publication.");
|
|
1561
|
+
store.activePublications++;
|
|
1562
|
+
return () => {
|
|
1563
|
+
store.activePublications--;
|
|
1564
|
+
};
|
|
1565
|
+
};
|
|
1566
|
+
};
|
|
1567
|
+
const model = { styles, package: packageView, get warnings() {
|
|
1568
|
+
return store.warnings.slice();
|
|
1569
|
+
}, async save(output, options = {}) {
|
|
1570
|
+
const target = modelOutput(output, options, settings, source);
|
|
1571
|
+
assertDocumentEditable(admitted, settings);
|
|
1572
|
+
await publishDocumentArchive(snapshot(), target.options, { ...settings, ...target, [publicationGenerationGuard]: guard(), encoding: { order: "input", compression: "store" } });
|
|
1573
|
+
}, async publish(options, publication) {
|
|
1574
|
+
assertDocumentEditable(admitted, settings);
|
|
1575
|
+
const caller = archiveSettings(publication);
|
|
1576
|
+
if (publication.budget && !settings.budget[budgetSharesReservations](caller.budget)) throw new PublicationError("unsupported-publication", "Publication must share admitted resource reservations.");
|
|
1577
|
+
const signal = AbortSignal.any([settings.signal, caller.signal]);
|
|
1578
|
+
const limits = Object.fromEntries(Object.entries(settings.limits).map(([key, value]) => [key, Math.min(value, caller.limits[key])]));
|
|
1579
|
+
const budget = settings.budget.lower(Object.fromEntries(Object.entries(settings.budget.limits).map(([key, value]) => [key, Math.min(value, caller.budget.limits[key])])), signal);
|
|
1580
|
+
return publishDocumentArchive(snapshot(), options, { ...publication, limits, signal, budget, [publicationGenerationGuard]: guard() });
|
|
1581
|
+
} };
|
|
1582
|
+
await packageView[packageAdmitImages]();
|
|
1583
|
+
return model;
|
|
1584
|
+
}
|
|
1585
|
+
function bindDocumentStyles(owner) {
|
|
1586
|
+
const store = new StyleStore(owner.read(), owner.context, () => owner.writable(), owner.partname, owner.package, owner.part);
|
|
1587
|
+
Object.defineProperty(store, "source", {
|
|
1588
|
+
get: () => owner.read(),
|
|
1589
|
+
set: (source) => owner.write(source)
|
|
1590
|
+
});
|
|
1591
|
+
const styles = store.part.styles;
|
|
1592
|
+
styleModelMutations.set(styles, store);
|
|
1593
|
+
styleOwnerCheckpoints.set(styles, () => store.checkpoint());
|
|
1594
|
+
return styles;
|
|
1595
|
+
}
|
|
1596
|
+
|
|
1597
|
+
export {
|
|
1598
|
+
requireComparisonOperand,
|
|
1599
|
+
modelOutput,
|
|
1600
|
+
modelFormattingOwner,
|
|
1601
|
+
Font,
|
|
1602
|
+
ParagraphFormat,
|
|
1603
|
+
TabStops,
|
|
1604
|
+
TabStop,
|
|
1605
|
+
RGBColor,
|
|
1606
|
+
ColorFormat,
|
|
1607
|
+
styleOwnerCheckpoints,
|
|
1608
|
+
resolveHeadingStyle,
|
|
1609
|
+
provisionNamedStyles,
|
|
1610
|
+
setStyleLinks,
|
|
1611
|
+
StylePartView,
|
|
1612
|
+
Styles,
|
|
1613
|
+
BaseStyle,
|
|
1614
|
+
CharacterStyle,
|
|
1615
|
+
ParagraphStyle,
|
|
1616
|
+
TableStyle,
|
|
1617
|
+
LatentStyles,
|
|
1618
|
+
LatentStyle,
|
|
1619
|
+
openDocumentStyleModel,
|
|
1620
|
+
bindDocumentStyles
|
|
1621
|
+
};
|