@poe-platform/safe-bash 0.1.810 → 0.1.812
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/audio-ast/flac-source.d.ts +13 -0
- package/dist/audio-ast/index.d.ts +2 -0
- package/dist/audio-ast/index.js +253 -179
- package/dist/audio-ast/vorbis.d.ts +14 -0
- package/dist/image-ast/index.js +1 -1
- package/dist/json-ast/backed-json-parser.d.ts +12 -1
- package/dist/json-ast/index.d.ts +1 -1
- package/dist/office-xml/index.d.ts +1 -0
- package/dist/office-xml/retained-xml-edits.d.ts +22 -0
- package/dist/pdf-ast/cos/qpdf-json-document.d.ts +2 -1
- package/dist/pdf-ast/cos/value-parser.d.ts +23 -2
- package/dist/pdf-ast/extract/retained-form-field-details.d.ts +20 -0
- package/dist/pdf-ast/extract/retained-form-fields.d.ts +17 -4
- package/dist/pdf-ast/index.d.ts +1 -0
- package/dist/pdf-ast/index.js +844 -384
- package/dist/pdf-ast/retained-document.d.ts +6 -0
- package/dist/safe-bash/audio-ast.browser.js +3 -1
- package/dist/safe-bash/chunks/{chunk-65TFMAZU.js → chunk-BUYRKFW2.js} +8 -35
- package/dist/safe-bash/chunks/{chunk-ZA5FQ34E.js → chunk-TPG55BAQ.js} +0 -2
- package/dist/safe-bash/command-chunks/{biff-ORSHM4YX-QYPGRDAZ.js → biff-YKPDH35C-MVQIWNKV.js} +2192 -2155
- package/dist/safe-bash/command-chunks/{chunk-HEHGHIE2.js → chunk-22MOB45U.js} +6 -6
- package/dist/safe-bash/command-chunks/{chunk-6DEWZMOL.js → chunk-2CORNDGF.js} +2 -2
- package/dist/safe-bash/command-chunks/{chunk-DCD32BEY.js → chunk-2JSDKQ4J.js} +201 -84
- package/dist/safe-bash/command-chunks/{chunk-6UHGIWFX.js → chunk-2ZFLMWOX.js} +1 -1
- package/dist/safe-bash/command-chunks/{chunk-HONWGFDA.js → chunk-33YCKZZX.js} +6 -6
- package/dist/safe-bash/command-chunks/{chunk-AXWPJRY6.js → chunk-36XGIPOG.js} +1 -1
- package/dist/safe-bash/command-chunks/{chunk-D5AYP2UM.js → chunk-3Q247UDJ.js} +26 -16
- package/dist/safe-bash/command-chunks/{chunk-32ADKP5E.js → chunk-456PHA3L.js} +1 -1
- package/dist/safe-bash/command-chunks/{chunk-UJXP3T6R.js → chunk-4CKFNXRN.js} +1 -1
- package/dist/safe-bash/command-chunks/{chunk-5L6GHFRW.js → chunk-554Z6IKP.js} +2 -2
- package/dist/safe-bash/command-chunks/{chunk-ORZRWT62.js → chunk-56NYSX65.js} +9 -9
- package/dist/safe-bash/command-chunks/{chunk-53JP3S6H.js → chunk-5HPU7D36.js} +4 -4
- package/dist/safe-bash/command-chunks/{chunk-HARUYHH7.js → chunk-5HUICAWD.js} +1 -1
- package/dist/safe-bash/command-chunks/{chunk-IC5GJI7E.js → chunk-5Q22ZLNC.js} +6 -6
- package/dist/safe-bash/command-chunks/{chunk-YO3V5RLY.js → chunk-6CCQI6XZ.js} +12 -12
- package/dist/safe-bash/command-chunks/{chunk-EO2IVGV7.js → chunk-6M6TM5Z5.js} +3 -3
- package/dist/safe-bash/command-chunks/{chunk-Z54Z3KRN.js → chunk-6QBMND4A.js} +1 -1
- package/dist/safe-bash/command-chunks/{chunk-INX4JMQ6.js → chunk-6VPQ3CDZ.js} +5 -5
- package/dist/safe-bash/command-chunks/{chunk-VGXVN3BX.js → chunk-7GKKMNL6.js} +8 -8
- package/dist/safe-bash/command-chunks/{chunk-TZJC67W3.js → chunk-7PVHO47B.js} +6 -6
- package/dist/safe-bash/command-chunks/{chunk-CM3C7AXJ.js → chunk-A2CLZMQZ.js} +1 -1
- package/dist/safe-bash/command-chunks/{chunk-ASR27KHW.js → chunk-A5FZBR7X.js} +4 -4
- package/dist/safe-bash/command-chunks/{chunk-DMDHE5KC.js → chunk-AHA6IWAJ.js} +6 -6
- package/dist/safe-bash/command-chunks/{chunk-PTZ55XXN.js → chunk-APEWTWCC.js} +6 -6
- package/dist/safe-bash/command-chunks/{chunk-YUVH6CE4.js → chunk-ATTWQVR2.js} +17 -17
- package/dist/safe-bash/command-chunks/{chunk-2VCKUNDZ.js → chunk-B2C3UPJS.js} +27 -17
- package/dist/safe-bash/command-chunks/{chunk-JON5DB3Z.js → chunk-B5LDP7AA.js} +2 -2
- package/dist/safe-bash/command-chunks/{chunk-YTFWPJ3F.js → chunk-CJQSAATC.js} +26 -26
- package/dist/safe-bash/command-chunks/{chunk-CHJL6JMU.js → chunk-COKYZUBW.js} +1 -1
- package/dist/safe-bash/command-chunks/{chunk-KCTV4NVX.js → chunk-CRV2Q3PB.js} +1 -1
- package/dist/safe-bash/command-chunks/{chunk-V3WXPCKN.js → chunk-CV7M2QJU.js} +7 -7
- package/dist/safe-bash/command-chunks/{chunk-VPDSQPSN.js → chunk-DM2CPMB4.js} +2 -2
- package/dist/safe-bash/command-chunks/{chunk-3DTDMEOP.js → chunk-EAGIJ4VW.js} +1 -1
- package/dist/safe-bash/command-chunks/{chunk-JW6CMBF2.js → chunk-EHSM5ZQS.js} +8 -8
- package/dist/safe-bash/command-chunks/{chunk-WIOH7ZQN.js → chunk-ENT3IV2G.js} +12 -12
- package/dist/safe-bash/command-chunks/{chunk-5IE4LJGB.js → chunk-EUT24Y5Z.js} +8 -8
- package/dist/safe-bash/command-chunks/{chunk-WC2OCF4H.js → chunk-FDCIPJBQ.js} +7 -7
- package/dist/safe-bash/command-chunks/{chunk-COKZFXHG.js → chunk-FIIAYCWS.js} +2 -2
- package/dist/safe-bash/command-chunks/{chunk-MWVFP2HY.js → chunk-GEM47B2P.js} +7 -7
- package/dist/safe-bash/command-chunks/{chunk-EHL6B34L.js → chunk-HDJVJTCK.js} +9 -9
- package/dist/safe-bash/command-chunks/{chunk-JMM3MNAY.js → chunk-HKATEVAP.js} +6 -6
- package/dist/safe-bash/command-chunks/{chunk-VWY3EAVQ.js → chunk-HTVIYLVB.js} +4 -4
- package/dist/safe-bash/command-chunks/{chunk-CHR2OD2U.js → chunk-HWQ2UHMT.js} +9 -9
- package/dist/safe-bash/command-chunks/{chunk-Z4QJMDK3.js → chunk-IT7TAC3F.js} +16 -16
- package/dist/safe-bash/command-chunks/{chunk-EWS4KYJE.js → chunk-JFYWVQ4V.js} +8 -8
- package/dist/safe-bash/command-chunks/{chunk-ZCX63QWA.js → chunk-JOCFI7TG.js} +1 -1
- package/dist/safe-bash/command-chunks/{chunk-F5WTH4O4.js → chunk-JQVHUSDD.js} +5 -5
- package/dist/safe-bash/command-chunks/{chunk-O4VJEGL6.js → chunk-K5GB2YMN.js} +10 -10
- package/dist/safe-bash/command-chunks/{chunk-27C3NT5V.js → chunk-KB7DUBVL.js} +5 -5
- package/dist/safe-bash/command-chunks/{chunk-4DZ32PI7.js → chunk-KCOJA7EM.js} +7 -7
- package/dist/safe-bash/command-chunks/{chunk-CAXJ4RLF.js → chunk-KJ4XXZIL.js} +12 -12
- package/dist/safe-bash/command-chunks/{chunk-U6QHTC5J.js → chunk-L5MCW6CM.js} +4 -4
- package/dist/safe-bash/command-chunks/{chunk-LVL3A7YE.js → chunk-LCZDBW55.js} +5 -5
- package/dist/safe-bash/command-chunks/{chunk-DJVRDUCA.js → chunk-LXLLA4PM.js} +17 -17
- package/dist/safe-bash/command-chunks/{chunk-K7AGAS3K.js → chunk-M7QE2MN7.js} +6 -6
- package/dist/safe-bash/command-chunks/{chunk-SWT6ILF2.js → chunk-MPUHH2KR.js} +3 -3
- package/dist/safe-bash/command-chunks/{chunk-3ZWBBS6U.js → chunk-NARD63DY.js} +437 -34
- package/dist/safe-bash/command-chunks/{chunk-DC3OJLRB.js → chunk-NQDIT667.js} +5 -5
- package/dist/safe-bash/command-chunks/{chunk-LWZVDDJA.js → chunk-NUGQQDGE.js} +5 -1
- package/dist/safe-bash/command-chunks/{chunk-MFLQZLFR.js → chunk-OA75SGN2.js} +7 -7
- package/dist/safe-bash/command-chunks/{chunk-5LATYOF7.js → chunk-OEJM666F.js} +5 -5
- package/dist/safe-bash/command-chunks/{chunk-AF25YYIO.js → chunk-PMAM4N33.js} +9 -9
- package/dist/safe-bash/command-chunks/{chunk-KMMAJ6H6.js → chunk-PNGDJA6M.js} +2 -2
- package/dist/safe-bash/command-chunks/{chunk-62BHPSKJ.js → chunk-Q6S57NOQ.js} +7 -7
- package/dist/safe-bash/command-chunks/{chunk-KJ3PEDI2.js → chunk-Q73EMLLZ.js} +146 -4
- package/dist/safe-bash/command-chunks/{chunk-FXKBM5KJ.js → chunk-QC5RMGSA.js} +3 -3
- package/dist/safe-bash/command-chunks/{chunk-UQ6UIZMM.js → chunk-QD7ZRDUN.js} +1 -1
- package/dist/safe-bash/command-chunks/{chunk-JHUYZZGV.js → chunk-QYMEASQ6.js} +4 -4
- package/dist/safe-bash/command-chunks/{chunk-3GY5VDIX.js → chunk-QZZ73J2O.js} +6 -6
- package/dist/safe-bash/command-chunks/{chunk-S2CYIGWH.js → chunk-R6EGGK5M.js} +7 -7
- package/dist/safe-bash/command-chunks/{chunk-7AVN3OBH.js → chunk-RHYJVTJO.js} +2 -2
- package/dist/safe-bash/command-chunks/{chunk-EWGDSO6U.js → chunk-RID6VYS3.js} +8 -8
- package/dist/safe-bash/command-chunks/{chunk-MMBRBANA.js → chunk-RNSKXOG3.js} +6 -6
- package/dist/safe-bash/command-chunks/{chunk-D3ZRZTY5.js → chunk-RQIQ75W5.js} +5 -5
- package/dist/safe-bash/command-chunks/{chunk-DWKQPLRT.js → chunk-RRL3Y562.js} +11 -11
- package/dist/safe-bash/command-chunks/{chunk-NXCMXD74.js → chunk-S6R3IB36.js} +1 -1
- package/dist/safe-bash/command-chunks/{chunk-XUPKFHAQ.js → chunk-SDTPO2VV.js} +7 -7
- package/dist/safe-bash/command-chunks/{chunk-PIAGKRFW.js → chunk-SPLOIABU.js} +3 -3
- package/dist/safe-bash/command-chunks/{chunk-Z5QOVRVH.js → chunk-SU26FZLJ.js} +1 -1
- package/dist/safe-bash/command-chunks/{chunk-WLTJDNSQ.js → chunk-TVH4JORU.js} +3 -3
- package/dist/safe-bash/command-chunks/{chunk-6XVMWFHD.js → chunk-TW73OXPR.js} +6 -6
- package/dist/safe-bash/command-chunks/{chunk-SFO43CID.js → chunk-UAXSE3XE.js} +5 -5
- package/dist/safe-bash/command-chunks/{chunk-K35BSUHO.js → chunk-UYWSIIUX.js} +7 -7
- package/dist/safe-bash/command-chunks/{chunk-2E2YEDVB.js → chunk-W5YSINXC.js} +6 -6
- package/dist/safe-bash/command-chunks/{chunk-EYNT4OEJ.js → chunk-WGG6G2KG.js} +7 -7
- package/dist/safe-bash/command-chunks/{chunk-DVQBZXMQ.js → chunk-WJCN2IXI.js} +2 -2
- package/dist/safe-bash/command-chunks/{chunk-XBZ4ZWGL.js → chunk-WVMHRNXZ.js} +3 -3
- package/dist/safe-bash/command-chunks/{chunk-7GXUCQI4.js → chunk-WXRYDALR.js} +4 -4
- package/dist/safe-bash/command-chunks/{chunk-S4IIOSRA.js → chunk-X7FA7ZD5.js} +8 -8
- package/dist/safe-bash/command-chunks/{chunk-DPR5CYQV.js → chunk-XITDDJFT.js} +2 -0
- package/dist/safe-bash/command-chunks/{chunk-SFCERNHU.js → chunk-XPD636C4.js} +3 -3
- package/dist/safe-bash/command-chunks/{chunk-HYDWQLJ3.js → chunk-XRVKWGVQ.js} +6 -6
- package/dist/safe-bash/command-chunks/{chunk-ZEPDT6I5.js → chunk-XVLWZTPY.js} +249 -51
- package/dist/safe-bash/command-chunks/{chunk-3UJWHRK4.js → chunk-XVP6V5K3.js} +6 -6
- package/dist/safe-bash/command-chunks/{chunk-KTI3BULE.js → chunk-XZ2FWFNV.js} +6 -6
- package/dist/safe-bash/command-chunks/{chunk-QK3CHRGL.js → chunk-Y4EYCZFT.js} +10 -10
- package/dist/safe-bash/command-chunks/{chunk-GTWVMFBK.js → chunk-YORJDX4V.js} +4 -4
- package/dist/safe-bash/command-chunks/{chunk-H6F5SN2N.js → chunk-YSMNXMAO.js} +4 -4
- package/dist/safe-bash/command-chunks/{chunk-SE5SJ4JT.js → chunk-Z2JW6M2D.js} +3 -3
- package/dist/safe-bash/command-chunks/{chunk-WH3TIOTS.js → chunk-ZEGNRZV2.js} +9 -2
- package/dist/safe-bash/command-chunks/{chunk-BYZUOF6X.js → chunk-ZEX53S5I.js} +4010 -3980
- package/dist/safe-bash/command-chunks/{chunk-HQYFRQ5W.js → chunk-ZIIO6GRY.js} +7 -7
- package/dist/safe-bash/command-chunks/{chunk-NTRZMQZP.js → chunk-ZMHEGDU2.js} +2 -2
- package/dist/safe-bash/command-chunks/{chunk-EYBXHGA6.js → chunk-ZXR6LXV5.js} +2 -2
- package/dist/safe-bash/command-chunks/{command-engine-BEWABZ75.js → command-engine-BCUQGJJ4.js} +58 -21
- package/dist/safe-bash/command-chunks/{engine-MEPOXIXT-WZMRHACG.js → engine-LAUEWYSQ-DQCEI5HE.js} +1 -1
- package/dist/safe-bash/command-chunks/pdf-XHHFTOT4-UJJYOYJ2.js +573 -0
- package/dist/safe-bash/commands/diff-patch/index.js +0 -3
- package/dist/safe-bash/commands/diff3/index.js +0 -2
- package/dist/safe-bash/full-core.browser.js +2 -2
- package/dist/safe-bash/plugins/index.browser.js +2 -2
- package/dist/safe-bash/plugins/index.js +3 -1
- package/dist/safe-bash/plugins/portable-commands.d.ts +1 -1
- package/dist/safe-bash/plugins/portable-commands.js +5 -3
- package/dist/safe-bash/registry-entry.browser.js +1 -1
- package/dist/safe-bash-command-apply-patch/apply.js +4 -4
- package/dist/safe-bash-command-apply-patch/index.js +4 -4
- package/dist/safe-bash-command-apply-patch/matcher.js +2 -2
- package/dist/safe-bash-command-apply-patch/parser.js +2 -2
- package/dist/safe-bash-command-apply-patch/shared.d.ts +2 -0
- package/dist/safe-bash-command-apply-patch/shared.js +1 -1
- package/dist/safe-bash-command-diff/index.js +0 -2
- package/dist/safe-bash-command-diff3/index.js +830 -56
- package/dist/safe-bash-command-ffmpeg/index.js +1 -1
- package/dist/safe-bash-command-ffprobe/index.js +2 -2
- package/dist/safe-bash-command-ffprobe/media.js +2 -2
- package/dist/safe-bash-command-html-to-markdown/index.js +75 -21
- package/dist/safe-bash-command-pandoc/command.js +3 -3
- package/dist/safe-bash-command-pandoc/execution.d.ts +2 -2
- package/dist/safe-bash-command-pandoc/index.d.ts +1 -1
- package/dist/safe-bash-command-pandoc/index.js +14 -14
- package/dist/safe-bash-command-pandoc/lua-filters.js +2 -2
- package/dist/safe-bash-command-pandoc/types.d.ts +17 -2
- package/dist/safe-bash-command-patch/index.js +2 -2
- package/dist/safe-bash-command-patch/patch-publication.js +1 -1
- package/dist/safe-bash-command-patch/patch.js +2 -2
- package/dist/safe-bash-command-pdftk/index.js +649 -265
- package/dist/safe-bash-command-pptx/command-engine.d.ts +12 -3
- package/dist/safe-bash-command-pptx/engine.d.ts +2 -2
- package/dist/safe-bash-command-pptx/engine.js +1 -1
- package/dist/safe-bash-command-qpdf/index.js +115 -9
- package/dist/safe-bash-command-soffice/index.js +1 -1
- package/dist/safe-bash-command-ssconvert/index.js +2 -2
- package/dist/safe-bash-command-xq/index.js +45 -29
- package/dist/safe-bash-diff-engine/document.d.ts +2 -1
- package/dist/safe-bash-diff-engine/document.js +7 -4
- package/dist/safe-bash-presentation-engine/accessibility.js +30 -30
- package/dist/safe-bash-presentation-engine/animation-editing.js +15 -15
- package/dist/safe-bash-presentation-engine/animations.js +15 -15
- package/dist/safe-bash-presentation-engine/backgrounds.js +16 -16
- package/dist/safe-bash-presentation-engine/bytes.js +3 -3
- package/dist/safe-bash-presentation-engine/chart-editing.js +33 -33
- package/dist/safe-bash-presentation-engine/chart-object-operations.js +24 -24
- package/dist/safe-bash-presentation-engine/charts.js +30 -30
- package/dist/safe-bash-presentation-engine/command-placeholder.js +56 -55
- package/dist/safe-bash-presentation-engine/comments.js +16 -16
- package/dist/safe-bash-presentation-engine/connector-operations.js +31 -31
- package/dist/safe-bash-presentation-engine/connectors.js +28 -28
- package/dist/safe-bash-presentation-engine/content-types.js +4 -4
- package/dist/safe-bash-presentation-engine/creation.js +6 -6
- package/dist/safe-bash-presentation-engine/diff.js +31 -31
- package/dist/safe-bash-presentation-engine/drawing-format.js +19 -19
- package/dist/safe-bash-presentation-engine/drawing-operations.js +30 -30
- package/dist/safe-bash-presentation-engine/drawing-schema.js +20 -20
- package/dist/safe-bash-presentation-engine/equations.js +16 -16
- package/dist/safe-bash-presentation-engine/errors.js +2 -2
- package/dist/safe-bash-presentation-engine/fields.js +16 -16
- package/dist/safe-bash-presentation-engine/font-metrics.js +3 -3
- package/dist/safe-bash-presentation-engine/image-extraction.js +19 -19
- package/dist/safe-bash-presentation-engine/image-formatting.js +31 -31
- package/dist/safe-bash-presentation-engine/image-insertion.js +17 -17
- package/dist/safe-bash-presentation-engine/image-replacement.js +20 -20
- package/dist/safe-bash-presentation-engine/image-value.js +4 -4
- package/dist/safe-bash-presentation-engine/images.js +18 -18
- package/dist/safe-bash-presentation-engine/index.d.ts +1 -1
- package/dist/safe-bash-presentation-engine/index.js +99 -95
- package/dist/safe-bash-presentation-engine/layouts.js +15 -15
- package/dist/safe-bash-presentation-engine/length.js +3 -3
- package/dist/safe-bash-presentation-engine/links.js +15 -15
- package/dist/safe-bash-presentation-engine/masters.js +14 -14
- package/dist/safe-bash-presentation-engine/media-editing.js +23 -23
- package/dist/safe-bash-presentation-engine/media-extraction.js +16 -16
- package/dist/safe-bash-presentation-engine/media.js +15 -15
- package/dist/safe-bash-presentation-engine/memberships.js +14 -14
- package/dist/safe-bash-presentation-engine/notes.js +15 -15
- package/dist/safe-bash-presentation-engine/ole-enum.js +4 -4
- package/dist/safe-bash-presentation-engine/ole-insertion.js +19 -19
- package/dist/safe-bash-presentation-engine/opaque-objects.js +9 -9
- package/dist/safe-bash-presentation-engine/package-reader.js +5 -5
- package/dist/safe-bash-presentation-engine/package-tools.js +15 -15
- package/dist/safe-bash-presentation-engine/package-uri.js +3 -3
- package/dist/safe-bash-presentation-engine/package-writer.js +4 -4
- package/dist/safe-bash-presentation-engine/presentation-model.js +55 -54
- package/dist/safe-bash-presentation-engine/presentation-settings.js +13 -13
- package/dist/safe-bash-presentation-engine/properties.js +15 -15
- package/dist/safe-bash-presentation-engine/relationships.js +4 -4
- package/dist/safe-bash-presentation-engine/resource-limits.js +1 -1
- package/dist/safe-bash-presentation-engine/retained-inspection.js +12 -12
- package/dist/safe-bash-presentation-engine/retained-package.js +4 -4
- package/dist/safe-bash-presentation-engine/retained-slide-publication.d.ts +24 -0
- package/dist/safe-bash-presentation-engine/retained-slide-settings.d.ts +15 -0
- package/dist/safe-bash-presentation-engine/retained-text.js +17 -17
- package/dist/safe-bash-presentation-engine/sanitize.js +16 -16
- package/dist/safe-bash-presentation-engine/selectors.js +10 -10
- package/dist/safe-bash-presentation-engine/shape-groups.js +30 -30
- package/dist/safe-bash-presentation-engine/shape-operations.js +29 -29
- package/dist/safe-bash-presentation-engine/shape-path-operations.js +31 -31
- package/dist/safe-bash-presentation-engine/shape-paths.js +15 -15
- package/dist/safe-bash-presentation-engine/shape-presets.js +3 -3
- package/dist/safe-bash-presentation-engine/shape-selection.js +30 -30
- package/dist/safe-bash-presentation-engine/shape-transforms.js +17 -17
- package/dist/safe-bash-presentation-engine/shapes.js +26 -26
- package/dist/safe-bash-presentation-engine/slide-copy.js +16 -16
- package/dist/safe-bash-presentation-engine/slide-import.js +17 -17
- package/dist/safe-bash-presentation-engine/slide-merge-split.js +19 -19
- package/dist/safe-bash-presentation-engine/slide-model.js +42 -42
- package/dist/safe-bash-presentation-engine/slide-removal.js +17 -17
- package/dist/safe-bash-presentation-engine/slide-transfer-budget.js +9 -9
- package/dist/safe-bash-presentation-engine/slides.d.ts +3 -0
- package/dist/safe-bash-presentation-engine/slides.js +24 -16
- package/dist/safe-bash-presentation-engine/table-operations.js +32 -32
- package/dist/safe-bash-presentation-engine/table-spans.js +31 -31
- package/dist/safe-bash-presentation-engine/tables.js +30 -30
- package/dist/safe-bash-presentation-engine/tags.js +15 -15
- package/dist/safe-bash-presentation-engine/template-bindings.js +32 -32
- package/dist/safe-bash-presentation-engine/template-repeat.js +39 -39
- package/dist/safe-bash-presentation-engine/text-fitting.js +26 -26
- package/dist/safe-bash-presentation-engine/text-frames.js +26 -26
- package/dist/safe-bash-presentation-engine/text-paragraphs.js +26 -26
- package/dist/safe-bash-presentation-engine/text-reading.js +11 -11
- package/dist/safe-bash-presentation-engine/text-replacement.js +16 -16
- package/dist/safe-bash-presentation-engine/text-runs.js +19 -19
- package/dist/safe-bash-presentation-engine/themes.js +15 -15
- package/dist/safe-bash-presentation-engine/transitions.js +15 -15
- package/dist/safe-bash-presentation-engine/validation.js +9 -9
- package/dist/safe-bash-presentation-engine/xml-parts.js +15 -15
- package/dist/safe-bash-presentation-engine/xml-view.js +3 -3
- package/dist/safe-bash-presentation-engine/xml.js +3 -3
- package/dist/safe-bash-xml-engine/json.d.ts +1 -0
- package/dist/safe-bash-xml-engine/json.js +203 -0
- package/dist/safe-bash-xml-engine/stored-json.d.ts +5 -0
- package/dist/spreadsheet-engine/rendering/print/bidi-runs.d.ts +5 -0
- package/dist/spreadsheet-engine/rendering/print/bidi-runs.js +35 -0
- package/dist/spreadsheet-engine/rendering/print/control-bidi.d.ts +8 -0
- package/dist/spreadsheet-engine/rendering/print/control-bidi.js +80 -0
- package/dist/spreadsheet-format-xls/biff-encrypted-properties.d.ts +4 -4
- package/dist/spreadsheet-format-xls/biff-encrypted-properties.js +76 -30
- package/dist/spreadsheet-format-xls/biff-encryption.js +1 -1
- package/dist/spreadsheet-format-xls/biff-metadata.d.ts +1 -0
- package/dist/spreadsheet-format-xls/biff-metadata.js +2 -2
- package/dist/spreadsheet-format-xls/biff-property-bytes.d.ts +4 -1
- package/dist/spreadsheet-format-xls/biff-property-bytes.js +1 -1
- package/dist/spreadsheet-format-xls/biff-range.js +1 -1
- package/dist/spreadsheet-format-xls/biff-write-metadata.js +10 -1
- package/package.json +5 -2
- package/dist/safe-bash/command-chunks/pdf-LOZAXXS6-ERI57IAV.js +0 -557
|
@@ -1,35 +1,425 @@
|
|
|
1
|
+
import {
|
|
2
|
+
openPackageArchive
|
|
3
|
+
} from "./chunk-ZXR6LXV5.js";
|
|
4
|
+
import {
|
|
5
|
+
openRetainedPresentationIndex,
|
|
6
|
+
stageRetainedOutput,
|
|
7
|
+
streamJson
|
|
8
|
+
} from "./chunk-L5MCW6CM.js";
|
|
1
9
|
import {
|
|
2
10
|
writePackageArchive
|
|
3
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-DM2CPMB4.js";
|
|
4
12
|
import {
|
|
5
13
|
SelectionError,
|
|
6
14
|
readSelectionIndex
|
|
7
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-X7FA7ZD5.js";
|
|
8
16
|
import {
|
|
9
17
|
readPackage
|
|
10
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-XPD636C4.js";
|
|
11
19
|
import {
|
|
12
20
|
readBinary
|
|
13
|
-
} from "./chunk-
|
|
21
|
+
} from "./chunk-PNGDJA6M.js";
|
|
14
22
|
import {
|
|
23
|
+
openRetainedPresentationValidation,
|
|
15
24
|
validatePresentation
|
|
16
|
-
} from "./chunk-
|
|
25
|
+
} from "./chunk-RNSKXOG3.js";
|
|
26
|
+
import {
|
|
27
|
+
openRetainedContentTypes,
|
|
28
|
+
openRetainedRelationshipGraph
|
|
29
|
+
} from "./chunk-QC5RMGSA.js";
|
|
17
30
|
import {
|
|
18
31
|
parseXmlPart
|
|
19
|
-
} from "./chunk-
|
|
32
|
+
} from "./chunk-554Z6IKP.js";
|
|
20
33
|
import {
|
|
21
34
|
parseContentTypes
|
|
22
|
-
} from "./chunk-
|
|
35
|
+
} from "./chunk-WJCN2IXI.js";
|
|
23
36
|
import {
|
|
24
37
|
readRelationshipGraph
|
|
25
|
-
} from "./chunk-
|
|
38
|
+
} from "./chunk-ZMHEGDU2.js";
|
|
26
39
|
import {
|
|
27
40
|
asciiKey,
|
|
41
|
+
partName,
|
|
28
42
|
relativePartReference
|
|
29
|
-
} from "./chunk-
|
|
43
|
+
} from "./chunk-36XGIPOG.js";
|
|
30
44
|
import {
|
|
31
|
-
OfficeError
|
|
32
|
-
|
|
45
|
+
OfficeError,
|
|
46
|
+
RetainedValues,
|
|
47
|
+
characters,
|
|
48
|
+
equal,
|
|
49
|
+
literal,
|
|
50
|
+
openRetainedXmlDocument,
|
|
51
|
+
resolveOfficeResources,
|
|
52
|
+
stageRetainedXmlEdits
|
|
53
|
+
} from "./chunk-Q73EMLLZ.js";
|
|
54
|
+
|
|
55
|
+
// packages/safe-bash-presentation-engine/src/retained-slide-settings.ts
|
|
56
|
+
import { PagedStorage } from "@poe-platform/safe-fs/storage";
|
|
57
|
+
function unsupported(message) {
|
|
58
|
+
throw new OfficeError("unsupported-edit", message, "validate-intent");
|
|
59
|
+
}
|
|
60
|
+
async function contains(source, needles, lower = false) {
|
|
61
|
+
const maximum = Math.max(...needles.map((value) => value.length));
|
|
62
|
+
let window = "";
|
|
63
|
+
for await (const character of characters(source)) {
|
|
64
|
+
window = (window + (lower ? character.toLowerCase() : character)).slice(-maximum);
|
|
65
|
+
if (needles.some((value) => window.endsWith(value))) return true;
|
|
66
|
+
}
|
|
67
|
+
return false;
|
|
68
|
+
}
|
|
69
|
+
async function* escaped(text, quote) {
|
|
70
|
+
let buffer = "";
|
|
71
|
+
for (const character of text) {
|
|
72
|
+
buffer += character === "&" ? "&" : character === "<" ? "<" : character === ">" ? ">" : character === quote ? quote === '"' ? """ : "'" : character === " " ? "	" : character === "\n" ? " " : character === "\r" ? " " : character;
|
|
73
|
+
if (buffer.length >= 4096) {
|
|
74
|
+
yield* literal(buffer);
|
|
75
|
+
buffer = "";
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
if (buffer) yield* literal(buffer);
|
|
79
|
+
}
|
|
80
|
+
async function openRetainedSlideSettings(archive, fingerprint, options, settings) {
|
|
81
|
+
const context = resolveOfficeResources(settings), workingStorage = { ...settings.workingStorage }, signal = context.signal ?? new AbortController().signal, resources = { ...context, workingStorage, signal };
|
|
82
|
+
const prepared = prepareSlideMutationOptions(options, context);
|
|
83
|
+
if ("position" in options) throw new OfficeError("invalid-value", "Slide settings do not reorder slides.", "usage");
|
|
84
|
+
const queries = prepared.map((query) => ({ ...query, ...query.position ? { position: { ...query.position } } : {} }));
|
|
85
|
+
const name = options.name, hidden = options.hidden, allowEmpty = options.allowEmpty;
|
|
86
|
+
const limits = { ...context.xmlLimits, ...context.relationshipLimits, maxBytes: Math.min(context.xmlLimits.maxBytes, context.relationshipLimits.maxBytes), maxEntries: context.archiveLimits.maxMembers };
|
|
87
|
+
if (!workingStorage.fs || !workingStorage.directory?.startsWith("/") || workingStorage.cacheBytes !== void 0 && (!Number.isSafeInteger(workingStorage.cacheBytes) || workingStorage.cacheBytes < 16384 || workingStorage.cacheBytes % 16384)) throw new OfficeError("invalid-value", "Explicit slide mutation storage and a valid cache budget are required.", "usage");
|
|
88
|
+
const pages = new PagedStorage({ fs: workingStorage.fs, cwd: workingStorage.directory, env: {}, signal }, (workingStorage.cacheBytes ?? 1024 * 1024) / 16384);
|
|
89
|
+
let closed = false, closing, first = 0, last = 0, affected = 0, changed = false;
|
|
90
|
+
let types, graph, index;
|
|
91
|
+
const check = () => {
|
|
92
|
+
if (closed) throw new OfficeError("invalid-handle", "Slide mutation is closed.", "serialize");
|
|
93
|
+
if (signal.aborted) throw new OfficeError("cancelled", "Operation cancelled.", "serialize");
|
|
94
|
+
};
|
|
95
|
+
const close = () => {
|
|
96
|
+
closed = true;
|
|
97
|
+
return closing ??= (async () => {
|
|
98
|
+
const results = await Promise.allSettled([types?.close(), graph?.close(), index?.close(), pages.close()]);
|
|
99
|
+
for (const result of results) if (result.status === "rejected") throw result.reason;
|
|
100
|
+
})();
|
|
101
|
+
};
|
|
102
|
+
const values = new RetainedValues(pages, check, signal);
|
|
103
|
+
async function write(pointer, row2) {
|
|
104
|
+
const bytes = new Uint8Array(row2.length * 8), view = new DataView(bytes.buffer);
|
|
105
|
+
row2.forEach((value, i) => view.setFloat64(i * 8, value, true));
|
|
106
|
+
await pages.write(pointer, bytes);
|
|
107
|
+
}
|
|
108
|
+
async function row(pointer, count) {
|
|
109
|
+
const bytes = await pages.read(pointer, count * 8), view = new DataView(bytes.buffer, bytes.byteOffset, bytes.byteLength);
|
|
110
|
+
return Array.from({ length: count }, (_, i) => view.getFloat64(i * 8, true));
|
|
111
|
+
}
|
|
112
|
+
async function* entries() {
|
|
113
|
+
check();
|
|
114
|
+
for (let pointer = first; pointer; ) {
|
|
115
|
+
const item = await row(pointer, 3);
|
|
116
|
+
let text = "";
|
|
117
|
+
const decoder = new TextDecoder();
|
|
118
|
+
for await (const bytes of values.read({ start: item[1], length: item[2] })) text += decoder.decode(bytes, { stream: true });
|
|
119
|
+
yield JSON.parse(text + decoder.decode());
|
|
120
|
+
pointer = item[0];
|
|
121
|
+
check();
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
async function replacement(part) {
|
|
125
|
+
check();
|
|
126
|
+
const value = await values.find("changes", () => literal(asciiKey(partName(part, false))));
|
|
127
|
+
return value ? values.read(value) : void 0;
|
|
128
|
+
}
|
|
129
|
+
const candidate = {
|
|
130
|
+
async *parts() {
|
|
131
|
+
check();
|
|
132
|
+
for await (const part of archive.parts()) {
|
|
133
|
+
check();
|
|
134
|
+
yield part;
|
|
135
|
+
}
|
|
136
|
+
},
|
|
137
|
+
async has(part) {
|
|
138
|
+
check();
|
|
139
|
+
return archive.has(part);
|
|
140
|
+
},
|
|
141
|
+
async byteLength(part) {
|
|
142
|
+
check();
|
|
143
|
+
return (await values.find("changes", () => literal(asciiKey(partName(part, false)))))?.length ?? archive.byteLength(part);
|
|
144
|
+
},
|
|
145
|
+
async *read(part) {
|
|
146
|
+
check();
|
|
147
|
+
const value = await replacement(part);
|
|
148
|
+
if (value) yield* value;
|
|
149
|
+
else yield* archive.read(part);
|
|
150
|
+
check();
|
|
151
|
+
}
|
|
152
|
+
};
|
|
153
|
+
try {
|
|
154
|
+
types = await openRetainedContentTypes(archive.read("/[Content_Types].xml"), resources, limits);
|
|
155
|
+
graph = await openRetainedRelationshipGraph(archive, { ...resources, xmlLimits: { ...context.xmlLimits, maxBytes: context.relationshipLimits.maxBytes } });
|
|
156
|
+
for await (const part of archive.parts()) if (part !== "/[Content_Types].xml" && (part.toLowerCase().startsWith("/_xmlsignatures/") || await contains(await types.get(part), ["digital-signature", "macroenabled", "vbaproject"], true))) unsupported("Signed and macro-enabled packages cannot be changed.");
|
|
157
|
+
async function* owners() {
|
|
158
|
+
yield "/";
|
|
159
|
+
yield* graph.parts();
|
|
160
|
+
}
|
|
161
|
+
for await (const owner of owners()) for await (const edge of graph.outgoing(owner)) {
|
|
162
|
+
if (await contains(edge.type(), ["/digital-signature/"])) unsupported("Signed and macro-enabled packages cannot be changed.");
|
|
163
|
+
let suffix = "";
|
|
164
|
+
for await (const character of characters(edge.type())) suffix = (suffix + character).slice(-11);
|
|
165
|
+
if (suffix === "/vbaProject") unsupported("Signed and macro-enabled packages cannot be changed.");
|
|
166
|
+
}
|
|
167
|
+
await types.close();
|
|
168
|
+
types = void 0;
|
|
169
|
+
await graph.close();
|
|
170
|
+
graph = void 0;
|
|
171
|
+
const validation = await openRetainedPresentationValidation(archive, resources, limits);
|
|
172
|
+
const valid = validation.valid;
|
|
173
|
+
await validation.close();
|
|
174
|
+
if (!valid) throw new OfficeError("invalid-opc", "Slide editing requires a valid presentation graph.", "validate-intent");
|
|
175
|
+
index = await openRetainedPresentationIndex(archive, fingerprint, resources);
|
|
176
|
+
for (const query of queries) {
|
|
177
|
+
try {
|
|
178
|
+
for await (const record of index.records.select(query)) {
|
|
179
|
+
if (record.kind !== "slide" || await values.find("selected", () => literal(record.id))) throw new SelectionError("invalid-selection");
|
|
180
|
+
const id = await values.store(literal(record.id));
|
|
181
|
+
await values.insert("selected", id, id);
|
|
182
|
+
const target = await values.store(literal(JSON.stringify({ location: record.location, part: record.part }))), pointer = pages.allocate(24);
|
|
183
|
+
await write(pointer, [0, target.start, target.length]);
|
|
184
|
+
if (last) await write(last, [pointer]);
|
|
185
|
+
else first = pointer;
|
|
186
|
+
last = pointer;
|
|
187
|
+
affected++;
|
|
188
|
+
}
|
|
189
|
+
} catch (error) {
|
|
190
|
+
if (!(allowEmpty && error instanceof SelectionError && error.code === "missing-selection")) throw error;
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
const presentation = await openRetainedXmlDocument(archive.read(index.records.main), resources);
|
|
194
|
+
let failed = false;
|
|
195
|
+
try {
|
|
196
|
+
let stack = pages.allocate(16);
|
|
197
|
+
await write(stack, [0, presentation.reference(presentation.root)]);
|
|
198
|
+
while (stack) {
|
|
199
|
+
const frame = await row(stack, 2);
|
|
200
|
+
stack = frame[0];
|
|
201
|
+
const node = await presentation.node(frame[1]);
|
|
202
|
+
if (node.kind !== "element") continue;
|
|
203
|
+
if (await equal(presentation.namespace(node), literal("http://schemas.openxmlformats.org/markup-compatibility/2006"))) unsupported("Conditional presentation structure cannot be changed.");
|
|
204
|
+
if (await equal(presentation.raw(node.localName), literal("modifyVerifier")) && await equal(presentation.namespace(node), presentation.namespace(presentation.root))) unsupported("Protected presentations cannot be changed.");
|
|
205
|
+
for await (const child2 of presentation.children(node)) {
|
|
206
|
+
const pointer = pages.allocate(16);
|
|
207
|
+
await write(pointer, [stack, presentation.reference(child2)]);
|
|
208
|
+
stack = pointer;
|
|
209
|
+
}
|
|
210
|
+
}
|
|
211
|
+
} catch (error) {
|
|
212
|
+
failed = true;
|
|
213
|
+
throw error;
|
|
214
|
+
} finally {
|
|
215
|
+
try {
|
|
216
|
+
await presentation.close();
|
|
217
|
+
} catch (error) {
|
|
218
|
+
if (!failed) await Promise.reject(error);
|
|
219
|
+
}
|
|
220
|
+
}
|
|
221
|
+
for await (const target of entries()) {
|
|
222
|
+
const document = await openRetainedXmlDocument(archive.read(target.part), resources);
|
|
223
|
+
let failed2 = false;
|
|
224
|
+
try {
|
|
225
|
+
const changes = [];
|
|
226
|
+
async function attr2(node, key) {
|
|
227
|
+
for await (const value of document.attributes(node)) if (await equal(document.namespace(value), literal("")) && await equal(document.raw(value.localName), literal(key))) return value;
|
|
228
|
+
return void 0;
|
|
229
|
+
}
|
|
230
|
+
if (name !== void 0) {
|
|
231
|
+
let common;
|
|
232
|
+
for await (const child2 of document.children(document.root)) if (child2.kind === "element" && await equal(document.namespace(child2), document.namespace(document.root)) && await equal(document.raw(child2.localName), literal("cSld"))) {
|
|
233
|
+
if (common) throw new OfficeError("ambiguous-selection", "Ambiguous presentation structure.", "select");
|
|
234
|
+
common = child2;
|
|
235
|
+
}
|
|
236
|
+
if (!common) unsupported("Conditional slide labels cannot be changed.");
|
|
237
|
+
const value = await attr2(common, "name");
|
|
238
|
+
if (!await equal(value ? document.text(value) : literal(""), literal(name))) changes.push({ node: common.name.start, attribute: "name", value: name || null, existing: Boolean(value) });
|
|
239
|
+
}
|
|
240
|
+
if (hidden !== void 0) {
|
|
241
|
+
const value = await attr2(document.root, "show");
|
|
242
|
+
let show = "", started = false, trailing = false;
|
|
243
|
+
if (value) for await (const character of characters(document.text(value))) {
|
|
244
|
+
if (!character.trim()) {
|
|
245
|
+
if (started) trailing = true;
|
|
246
|
+
} else {
|
|
247
|
+
if (trailing || show.length >= 5) throw new OfficeError("invalid-opc", "Invalid slide visibility.", "validate-intent");
|
|
248
|
+
started = true;
|
|
249
|
+
show += character;
|
|
250
|
+
}
|
|
251
|
+
}
|
|
252
|
+
if (value && !["0", "1", "true", "false"].includes(show)) throw new OfficeError("invalid-opc", "Invalid slide visibility.", "validate-intent");
|
|
253
|
+
if ((show === "0" || show === "false") !== hidden) changes.push({ node: document.root.name.start, attribute: "show", value: hidden ? "0" : "1", existing: Boolean(value) });
|
|
254
|
+
}
|
|
255
|
+
if (changes.length) {
|
|
256
|
+
const mutation = await stageRetainedXmlEdits(archive.read(target.part), async function* (xml) {
|
|
257
|
+
let active, attributeStart = 0, matching = false;
|
|
258
|
+
for await (const token of xml.tokens()) {
|
|
259
|
+
if (token.kind === "start-name") {
|
|
260
|
+
active = changes.find((change) => change.node === token.range.start);
|
|
261
|
+
matching = false;
|
|
262
|
+
} else if (active && token.kind === "attribute-name") {
|
|
263
|
+
attributeStart = token.range.start;
|
|
264
|
+
matching = await equal(xml.read(token.range), literal(active.attribute));
|
|
265
|
+
} else if (active && token.kind === "attribute-value") {
|
|
266
|
+
if (matching) {
|
|
267
|
+
if (active.value === null) yield { range: { start: attributeStart, length: token.range.start + token.range.length + 1 - attributeStart }, replacement: literal("") };
|
|
268
|
+
else {
|
|
269
|
+
let quote = '"';
|
|
270
|
+
for await (const bytes of xml.read({ start: token.range.start - 1, length: 1 })) quote = String.fromCharCode(bytes[0]);
|
|
271
|
+
yield { range: token.range, replacement: escaped(active.value, quote) };
|
|
272
|
+
}
|
|
273
|
+
}
|
|
274
|
+
} else if (active && token.kind === "start-end") {
|
|
275
|
+
if (!active.existing && active.value !== null) {
|
|
276
|
+
const change = active;
|
|
277
|
+
yield { range: { start: token.range.start - (token.empty ? 2 : 1), length: 0 }, replacement: (async function* () {
|
|
278
|
+
yield* literal(` ${change.attribute}="`);
|
|
279
|
+
yield* escaped(change.value, '"');
|
|
280
|
+
yield* literal('"');
|
|
281
|
+
})() };
|
|
282
|
+
}
|
|
283
|
+
active = void 0;
|
|
284
|
+
}
|
|
285
|
+
}
|
|
286
|
+
}, resources);
|
|
287
|
+
let mutationFailed = false;
|
|
288
|
+
try {
|
|
289
|
+
const value = await values.store(mutation.bytes()), key = await values.store(literal(asciiKey(target.part)));
|
|
290
|
+
await values.insert("changes", key, value);
|
|
291
|
+
changed = true;
|
|
292
|
+
} catch (error) {
|
|
293
|
+
mutationFailed = true;
|
|
294
|
+
throw error;
|
|
295
|
+
} finally {
|
|
296
|
+
try {
|
|
297
|
+
await mutation.close();
|
|
298
|
+
} catch (error) {
|
|
299
|
+
if (!mutationFailed) await Promise.reject(error);
|
|
300
|
+
}
|
|
301
|
+
}
|
|
302
|
+
}
|
|
303
|
+
} catch (error) {
|
|
304
|
+
failed2 = true;
|
|
305
|
+
throw error;
|
|
306
|
+
} finally {
|
|
307
|
+
try {
|
|
308
|
+
await document.close();
|
|
309
|
+
} catch (error) {
|
|
310
|
+
if (!failed2) await Promise.reject(error);
|
|
311
|
+
}
|
|
312
|
+
}
|
|
313
|
+
}
|
|
314
|
+
if (changed) {
|
|
315
|
+
const result = await openRetainedPresentationValidation(candidate, resources, limits);
|
|
316
|
+
const valid2 = result.valid;
|
|
317
|
+
await result.close();
|
|
318
|
+
if (!valid2) throw new OfficeError("invalid-opc", "Changed slides fail graph validation.", "validate-result");
|
|
319
|
+
}
|
|
320
|
+
await index.close();
|
|
321
|
+
index = void 0;
|
|
322
|
+
check();
|
|
323
|
+
return Object.freeze({ ...candidate, changed, affected, replacement, async *targets() {
|
|
324
|
+
for await (const entry of entries()) yield entry.location;
|
|
325
|
+
}, close });
|
|
326
|
+
} catch (error) {
|
|
327
|
+
await close().catch(() => {
|
|
328
|
+
});
|
|
329
|
+
throw error;
|
|
330
|
+
}
|
|
331
|
+
}
|
|
332
|
+
|
|
333
|
+
// packages/safe-bash-presentation-engine/src/retained-slide-publication.ts
|
|
334
|
+
import { PagedStorage as PagedStorage2 } from "@poe-platform/safe-fs/storage";
|
|
335
|
+
import { sha256 } from "@noble/hashes/sha2.js";
|
|
336
|
+
async function stageRetainedSlideSettings(input, options, settings, output) {
|
|
337
|
+
const signal = settings.signal ?? new AbortController().signal;
|
|
338
|
+
const hash = sha256.create();
|
|
339
|
+
for await (const bytes of input.stream()) {
|
|
340
|
+
signal.throwIfAborted();
|
|
341
|
+
hash.update(bytes);
|
|
342
|
+
}
|
|
343
|
+
const hex = (bytes) => Array.from(bytes, (byte) => byte.toString(16).padStart(2, "0")).join("");
|
|
344
|
+
const before = hex(hash.digest());
|
|
345
|
+
const archive = await openPackageArchive(input, settings);
|
|
346
|
+
let mutation, pages, response;
|
|
347
|
+
let closed = false, closing;
|
|
348
|
+
const check = () => {
|
|
349
|
+
if (closed) throw new OfficeError("invalid-handle", "Slide output is closed.", "publish");
|
|
350
|
+
signal.throwIfAborted();
|
|
351
|
+
};
|
|
352
|
+
const close = () => {
|
|
353
|
+
closed = true;
|
|
354
|
+
return closing ??= (async () => {
|
|
355
|
+
const results = await Promise.allSettled([response?.close(), mutation?.close(), pages?.close(), archive.close()]);
|
|
356
|
+
for (const result of results) if (result.status === "rejected") throw result.reason;
|
|
357
|
+
})();
|
|
358
|
+
};
|
|
359
|
+
try {
|
|
360
|
+
mutation = await openRetainedSlideSettings(archive, before, options, settings);
|
|
361
|
+
let size = input.size, fingerprint = before, start = 0;
|
|
362
|
+
if (mutation.changed) {
|
|
363
|
+
const working = settings.workingStorage;
|
|
364
|
+
pages = new PagedStorage2({ fs: working.fs, cwd: working.directory, env: {}, signal }, (working.cacheBytes ?? 1024 * 1024) / 16384);
|
|
365
|
+
start = pages.allocate(0);
|
|
366
|
+
size = 0;
|
|
367
|
+
const digest = sha256.create();
|
|
368
|
+
await archive.rewrite({ async write(bytes2) {
|
|
369
|
+
check();
|
|
370
|
+
for (let offset = 0; offset < bytes2.length; offset += 16384) {
|
|
371
|
+
check();
|
|
372
|
+
const owned = new Uint8Array(bytes2.subarray(offset, offset + 16384));
|
|
373
|
+
await pages.append(owned);
|
|
374
|
+
digest.update(owned);
|
|
375
|
+
size += owned.length;
|
|
376
|
+
}
|
|
377
|
+
} }, { replace: mutation.replacement });
|
|
378
|
+
fingerprint = hex(digest.digest());
|
|
379
|
+
}
|
|
380
|
+
async function* bytes() {
|
|
381
|
+
check();
|
|
382
|
+
if (!pages) {
|
|
383
|
+
yield* input.stream();
|
|
384
|
+
check();
|
|
385
|
+
return;
|
|
386
|
+
}
|
|
387
|
+
for (let offset = 0; offset < size; offset += 16384) {
|
|
388
|
+
check();
|
|
389
|
+
yield await pages.read(start + offset, Math.min(16384, size - offset));
|
|
390
|
+
}
|
|
391
|
+
check();
|
|
392
|
+
}
|
|
393
|
+
async function* locations() {
|
|
394
|
+
for await (const location of mutation.targets()) yield { ...location, fingerprint };
|
|
395
|
+
}
|
|
396
|
+
async function* effects() {
|
|
397
|
+
if (fingerprint !== before) for await (const location of locations()) yield { location, action: "update", feature: "F07" };
|
|
398
|
+
}
|
|
399
|
+
const dryRun = output.dryRun;
|
|
400
|
+
async function* content() {
|
|
401
|
+
if (output.destination === "-" && !dryRun) {
|
|
402
|
+
yield* bytes();
|
|
403
|
+
return;
|
|
404
|
+
}
|
|
405
|
+
if (output.json) {
|
|
406
|
+
yield* streamJson({ version: 1, operation: "slides.set", ok: true, data: {
|
|
407
|
+
effects: effects(),
|
|
408
|
+
outputs: dryRun ? [] : [{ path: output.destination, sha256: fingerprint, bytes: size }],
|
|
409
|
+
fingerprint: dryRun ? null : fingerprint
|
|
410
|
+
}, warnings: [], errors: [], affected: mutation.affected, locations: locations() });
|
|
411
|
+
yield new TextEncoder().encode("\n");
|
|
412
|
+
} else yield new TextEncoder().encode(`${dryRun ? "Validated" : "Updated"} ${mutation.affected} slide(s)
|
|
413
|
+
`);
|
|
414
|
+
}
|
|
415
|
+
response = await stageRetainedOutput(content(), settings, output.maxOutputBytes);
|
|
416
|
+
return Object.freeze({ bytes, size, fingerprint, output: response, close });
|
|
417
|
+
} catch (error) {
|
|
418
|
+
await close().catch(() => {
|
|
419
|
+
});
|
|
420
|
+
throw error;
|
|
421
|
+
}
|
|
422
|
+
}
|
|
33
423
|
|
|
34
424
|
// packages/safe-bash-presentation-engine/src/slides.ts
|
|
35
425
|
var contentNamespace = "http://schemas.openxmlformats.org/package/2006/content-types";
|
|
@@ -51,7 +441,7 @@ var dialects = [
|
|
|
51
441
|
function invalid(message) {
|
|
52
442
|
throw new OfficeError("invalid-value", message, "usage");
|
|
53
443
|
}
|
|
54
|
-
function
|
|
444
|
+
function unsupported2(message) {
|
|
55
445
|
throw new OfficeError("unsupported-edit", message, "validate-intent");
|
|
56
446
|
}
|
|
57
447
|
function attr(node, name, namespace = "") {
|
|
@@ -78,16 +468,16 @@ function fields(value, allowed) {
|
|
|
78
468
|
if (!value || typeof value !== "object" || ![Object.prototype, null].includes(Object.getPrototypeOf(value)) || Object.keys(value).some((key) => !allowed.includes(key)))
|
|
79
469
|
invalid("Expected a structured slide insertion object.");
|
|
80
470
|
}
|
|
81
|
-
function
|
|
471
|
+
function* escapedSlideText(text, maximum) {
|
|
82
472
|
if (typeof text !== "string") invalid("Expected text.");
|
|
83
473
|
if (text.length > maximum)
|
|
84
474
|
throw new OfficeError("resource-limit", "Slide text exceeds limits.", "usage");
|
|
85
|
-
let
|
|
475
|
+
let length = 0;
|
|
86
476
|
for (const ch of text) {
|
|
87
477
|
const code = ch.codePointAt(0);
|
|
88
478
|
if (code < 32 && ![9, 10, 13].includes(code) || code >= 55296 && code <= 57343 || code === 65534 || code === 65535)
|
|
89
479
|
invalid("Text contains an invalid XML character.");
|
|
90
|
-
|
|
480
|
+
const value = {
|
|
91
481
|
"&": "&",
|
|
92
482
|
"<": "<",
|
|
93
483
|
">": ">",
|
|
@@ -96,9 +486,15 @@ function escape(text, maximum) {
|
|
|
96
486
|
"\n": " ",
|
|
97
487
|
" ": "	"
|
|
98
488
|
}[ch] ?? ch;
|
|
99
|
-
|
|
489
|
+
length += value.length;
|
|
490
|
+
if (length > maximum)
|
|
100
491
|
throw new OfficeError("resource-limit", "Slide text exceeds limits.", "usage");
|
|
492
|
+
yield value;
|
|
101
493
|
}
|
|
494
|
+
}
|
|
495
|
+
function escape(text, maximum) {
|
|
496
|
+
let result = "";
|
|
497
|
+
for (const value of escapedSlideText(text, maximum)) result += value;
|
|
102
498
|
return result;
|
|
103
499
|
}
|
|
104
500
|
function relationshipPart(owner) {
|
|
@@ -180,13 +576,13 @@ function prepareSlideInsertion(reader, options, context) {
|
|
|
180
576
|
if (name === "/[Content_Types].xml") continue;
|
|
181
577
|
const type = types.get(name).toLowerCase();
|
|
182
578
|
if (type.includes("digital-signature") || type.includes("macroenabled") || type.includes("vbaproject") || asciiKey(name).startsWith("/_xmlsignatures/"))
|
|
183
|
-
|
|
579
|
+
unsupported2("Signed and macro-enabled packages cannot be changed.");
|
|
184
580
|
}
|
|
185
581
|
for (const owner of ["/", ...graph.parts])
|
|
186
582
|
if (graph.outgoing(owner).some(
|
|
187
583
|
(edge) => edge.type.includes("/digital-signature/") || edge.type.endsWith("/vbaProject")
|
|
188
584
|
))
|
|
189
|
-
|
|
585
|
+
unsupported2("Signed and macro-enabled packages cannot be changed.");
|
|
190
586
|
if (!validatePresentation(reader, validationLimits).valid)
|
|
191
587
|
throw new OfficeError(
|
|
192
588
|
"invalid-opc",
|
|
@@ -200,9 +596,9 @@ function prepareSlideInsertion(reader, options, context) {
|
|
|
200
596
|
while (presentationNodes.length) {
|
|
201
597
|
const node = presentationNodes.pop();
|
|
202
598
|
if (node.name.namespace === d.p && node.name.localName === "modifyVerifier")
|
|
203
|
-
|
|
599
|
+
unsupported2("Protected presentations cannot be changed.");
|
|
204
600
|
if (node.name.namespace === "http://schemas.openxmlformats.org/markup-compatibility/2006")
|
|
205
|
-
|
|
601
|
+
unsupported2("Conditional presentation structure cannot be changed.");
|
|
206
602
|
presentationNodes.push(...node.children);
|
|
207
603
|
}
|
|
208
604
|
const list = child(presentation.root, "sldIdLst", d.p);
|
|
@@ -211,7 +607,7 @@ function prepareSlideInsertion(reader, options, context) {
|
|
|
211
607
|
) ?? [];
|
|
212
608
|
const position = options.position ?? ids.length + 1;
|
|
213
609
|
if (position > ids.length + 1) invalid("Insertion position is outside the slide list.");
|
|
214
|
-
if (list && ids.length !== list.children.length)
|
|
610
|
+
if (list && ids.length !== list.children.length) unsupported2("Unsupported slide-list content.");
|
|
215
611
|
const candidates = graph.parts.filter((name) => types.get(name) === `${typePrefix}slideLayout+xml`).filter((name) => {
|
|
216
612
|
if (options.layout.startsWith("/")) return name === options.layout;
|
|
217
613
|
const document = parseXmlPart(reader.get(name), context.xmlLimits);
|
|
@@ -226,7 +622,7 @@ function prepareSlideInsertion(reader, options, context) {
|
|
|
226
622
|
const layout = candidates[0];
|
|
227
623
|
const layoutDocument = parseXmlPart(reader.get(layout), context.xmlLimits);
|
|
228
624
|
if (layoutDocument.root.name.namespace !== d.p)
|
|
229
|
-
|
|
625
|
+
unsupported2("Layout dialect must match the presentation.");
|
|
230
626
|
const masters = graph.outgoing(layout).filter((edge) => edge.type === `${d.r}/slideMaster` && !edge.external);
|
|
231
627
|
const masterEdges = graph.outgoing(main).filter(
|
|
232
628
|
(edge) => edge.type === `${d.r}/slideMaster` && edge.targetPart === masters[0]?.targetPart
|
|
@@ -244,12 +640,12 @@ function prepareSlideInsertion(reader, options, context) {
|
|
|
244
640
|
const placeholders = [];
|
|
245
641
|
const keys = /* @__PURE__ */ new Set();
|
|
246
642
|
for (const node of tree.children) {
|
|
247
|
-
if (node.name.namespace !== d.p)
|
|
643
|
+
if (node.name.namespace !== d.p) unsupported2("Unsupported layout drawing content.");
|
|
248
644
|
if (node.name.localName !== "sp") {
|
|
249
645
|
if (!["nvGrpSpPr", "grpSpPr", "pic", "graphicFrame", "cxnSp", "grpSp"].includes(
|
|
250
646
|
node.name.localName
|
|
251
647
|
))
|
|
252
|
-
|
|
648
|
+
unsupported2("Unsupported layout drawing content.");
|
|
253
649
|
continue;
|
|
254
650
|
}
|
|
255
651
|
const nv = child(node, "nvSpPr", d.p);
|
|
@@ -277,7 +673,7 @@ function prepareSlideInsertion(reader, options, context) {
|
|
|
277
673
|
if (ph.attributes.some(
|
|
278
674
|
(attribute) => attribute.name.namespace || !["type", "idx", "sz", "orient", "hasCustomPrompt"].includes(attribute.name.localName)
|
|
279
675
|
))
|
|
280
|
-
|
|
676
|
+
unsupported2("Unsupported placeholder attributes.");
|
|
281
677
|
placeholders.push({
|
|
282
678
|
type,
|
|
283
679
|
index,
|
|
@@ -314,7 +710,7 @@ function prepareSlideInsertion(reader, options, context) {
|
|
|
314
710
|
"select"
|
|
315
711
|
);
|
|
316
712
|
if (!textPlaceholderTypes.includes(matches[0].type))
|
|
317
|
-
|
|
713
|
+
unsupported2("Rich-content placeholders cannot be populated as text.");
|
|
318
714
|
assigned.add(matches[0]);
|
|
319
715
|
matches[0].text = assignment.text;
|
|
320
716
|
}
|
|
@@ -416,7 +812,7 @@ function prepareSlideInsertion(reader, options, context) {
|
|
|
416
812
|
);
|
|
417
813
|
return { changes, part: slide, slideId, position };
|
|
418
814
|
}
|
|
419
|
-
|
|
815
|
+
function prepareSlideMutationOptions(options, context) {
|
|
420
816
|
fields(options, ["selection", "position", "name", "hidden", "allowEmpty"]);
|
|
421
817
|
if ([options.position, options.name, options.hidden].every((value) => value === void 0))
|
|
422
818
|
invalid("At least one slide update is required.");
|
|
@@ -429,7 +825,7 @@ async function mutateSlides(input, options, context) {
|
|
|
429
825
|
invalid("Expected a boolean slide setting.");
|
|
430
826
|
if (!context?.xmlLimits || !context.relationshipLimits)
|
|
431
827
|
invalid("Explicit XML and relationship limits are required.");
|
|
432
|
-
if (options.name !== void 0)
|
|
828
|
+
if (options.name !== void 0) for (const value of escapedSlideText(options.name, context.xmlLimits.maxBytes)) void value;
|
|
433
829
|
const queries = Array.isArray(options.selection) ? options.selection : [options.selection];
|
|
434
830
|
if (!queries.length) throw new SelectionError("invalid-selection");
|
|
435
831
|
if (queries.length > context.relationshipLimits.maxParts)
|
|
@@ -437,6 +833,10 @@ async function mutateSlides(input, options, context) {
|
|
|
437
833
|
for (const query of queries)
|
|
438
834
|
if (!query || typeof query !== "object" || query.kind !== void 0 && query.kind !== "slide" || query.scope !== void 0 && query.scope !== "slides" || !query.all && query.token === void 0 && query.id === void 0 && query.name === void 0 && query.position === void 0)
|
|
439
835
|
throw new SelectionError("invalid-selection");
|
|
836
|
+
return queries;
|
|
837
|
+
}
|
|
838
|
+
async function mutateSlides(input, options, context) {
|
|
839
|
+
const queries = prepareSlideMutationOptions(options, context);
|
|
440
840
|
const source = await readBinary(input, context);
|
|
441
841
|
const reader = await readPackage(source, context);
|
|
442
842
|
const limits = {
|
|
@@ -452,13 +852,13 @@ async function mutateSlides(input, options, context) {
|
|
|
452
852
|
if (name === "/[Content_Types].xml") continue;
|
|
453
853
|
const type = types.get(name).toLowerCase();
|
|
454
854
|
if (type.includes("digital-signature") || type.includes("macroenabled") || type.includes("vbaproject") || asciiKey(name).startsWith("/_xmlsignatures/"))
|
|
455
|
-
|
|
855
|
+
unsupported2("Signed and macro-enabled packages cannot be changed.");
|
|
456
856
|
}
|
|
457
857
|
for (const owner of ["/", ...graph.parts])
|
|
458
858
|
if (graph.outgoing(owner).some(
|
|
459
859
|
(edge) => edge.type.includes("/digital-signature/") || edge.type.endsWith("/vbaProject")
|
|
460
860
|
))
|
|
461
|
-
|
|
861
|
+
unsupported2("Signed and macro-enabled packages cannot be changed.");
|
|
462
862
|
if (!validatePresentation(reader, limits).valid)
|
|
463
863
|
throw new OfficeError(
|
|
464
864
|
"invalid-opc",
|
|
@@ -493,16 +893,16 @@ async function mutateSlides(input, options, context) {
|
|
|
493
893
|
while (pending.length) {
|
|
494
894
|
const node = pending.pop();
|
|
495
895
|
if (node.name.namespace === d.p && node.name.localName === "modifyVerifier")
|
|
496
|
-
|
|
896
|
+
unsupported2("Protected presentations cannot be changed.");
|
|
497
897
|
if (node.name.namespace === "http://schemas.openxmlformats.org/markup-compatibility/2006")
|
|
498
|
-
|
|
898
|
+
unsupported2("Conditional presentation structure cannot be changed.");
|
|
499
899
|
pending.push(...node.children);
|
|
500
900
|
}
|
|
501
901
|
const changes = /* @__PURE__ */ new Map();
|
|
502
902
|
if (selected.length && options.position !== void 0) {
|
|
503
903
|
const list = child(presentation.root, "sldIdLst", d.p);
|
|
504
904
|
if (list.children.some((node) => node.name.namespace !== d.p || node.name.localName !== "sldId"))
|
|
505
|
-
|
|
905
|
+
unsupported2("Unsupported slide-list content.");
|
|
506
906
|
const ordered = index.slides.filter((slide) => !identities.has(slide.id));
|
|
507
907
|
ordered.splice(options.position - 1, 0, ...selected);
|
|
508
908
|
if (ordered.some((slide, i) => slide.id !== index.slides[i].id)) {
|
|
@@ -520,7 +920,7 @@ async function mutateSlides(input, options, context) {
|
|
|
520
920
|
let changed = false;
|
|
521
921
|
if (options.name !== void 0) {
|
|
522
922
|
const common = child(document.root, "cSld", d.p);
|
|
523
|
-
if (!common)
|
|
923
|
+
if (!common) unsupported2("Conditional slide labels cannot be changed.");
|
|
524
924
|
if ((attr(common, "name") ?? "") !== options.name) {
|
|
525
925
|
document = document.merge(common, {
|
|
526
926
|
attributes: [{ namespace: "", localName: "name", value: options.name || null }]
|
|
@@ -560,7 +960,10 @@ async function mutateSlides(input, options, context) {
|
|
|
560
960
|
}
|
|
561
961
|
|
|
562
962
|
export {
|
|
963
|
+
openRetainedSlideSettings,
|
|
964
|
+
stageRetainedSlideSettings,
|
|
563
965
|
addSlide,
|
|
564
966
|
prepareSlideInsertion,
|
|
967
|
+
prepareSlideMutationOptions,
|
|
565
968
|
mutateSlides
|
|
566
969
|
};
|
|
@@ -4,20 +4,20 @@ import {
|
|
|
4
4
|
escape,
|
|
5
5
|
invalid,
|
|
6
6
|
loadShared
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-56NYSX65.js";
|
|
8
8
|
import {
|
|
9
9
|
SelectionError,
|
|
10
10
|
decodeSelectionToken
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-X7FA7ZD5.js";
|
|
12
12
|
import {
|
|
13
13
|
parseXmlPart
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-554Z6IKP.js";
|
|
15
15
|
import {
|
|
16
16
|
partName
|
|
17
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-36XGIPOG.js";
|
|
18
18
|
import {
|
|
19
19
|
OfficeError
|
|
20
|
-
} from "./chunk-
|
|
20
|
+
} from "./chunk-Q73EMLLZ.js";
|
|
21
21
|
|
|
22
22
|
// packages/safe-bash-presentation-engine/src/animation-editing.ts
|
|
23
23
|
import { SaxesParser } from "saxes";
|