@poe-platform/safe-bash 0.1.810 → 0.1.811
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 +1 -0
- package/dist/audio-ast/index.js +248 -179
- 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/index.js +151 -56
- package/dist/pdf-ast/retained-document.d.ts +2 -0
- package/dist/safe-bash/audio-ast.browser.js +2 -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-3EFLKBAH-NYWZOYQS.js} +2141 -2136
- 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-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-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-YTFWPJ3F.js → chunk-5LI2DLNZ.js} +26 -26
- package/dist/safe-bash/command-chunks/{chunk-CHR2OD2U.js → chunk-5MB64DWR.js} +9 -9
- package/dist/safe-bash/command-chunks/{chunk-3ZWBBS6U.js → chunk-5OO2P27R.js} +340 -34
- 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-D5AYP2UM.js → chunk-72C3TZ2U.js} +25 -15
- 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-JON5DB3Z.js → chunk-B5LDP7AA.js} +2 -2
- 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-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-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-BYZUOF6X.js → chunk-KL3OIBKB.js} +3742 -3726
- 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-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-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-DCD32BEY.js → chunk-VU3EQF7F.js} +91 -53
- 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-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-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-ZEPDT6I5.js → chunk-YSY6R6AS.js} +21 -25
- package/dist/safe-bash/command-chunks/{chunk-SE5SJ4JT.js → chunk-Z2JW6M2D.js} +3 -3
- package/dist/safe-bash/command-chunks/{chunk-WC2OCF4H.js → chunk-ZHRGYR7B.js} +7 -7
- 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/{engine-MEPOXIXT-WZMRHACG.js → engine-AXXFTGCL-QBQNBI6K.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-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 +1 -1
- package/dist/safe-bash-command-patch/patch.js +1 -1
- package/dist/safe-bash-command-pdftk/index.js +616 -265
- 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-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 +55 -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 +95 -93
- 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 +54 -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-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 +2 -0
- package/dist/safe-bash-presentation-engine/slides.js +21 -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 +36 -23
- package/dist/spreadsheet-format-xls/biff-encryption.js +1 -1
- 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/package.json +5 -2
- package/dist/safe-bash/command-chunks/pdf-LOZAXXS6-ERI57IAV.js +0 -557
|
@@ -1,35 +1,329 @@
|
|
|
1
|
+
import {
|
|
2
|
+
openRetainedPresentationIndex
|
|
3
|
+
} from "./chunk-L5MCW6CM.js";
|
|
1
4
|
import {
|
|
2
5
|
writePackageArchive
|
|
3
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-DM2CPMB4.js";
|
|
4
7
|
import {
|
|
5
8
|
SelectionError,
|
|
6
9
|
readSelectionIndex
|
|
7
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-X7FA7ZD5.js";
|
|
8
11
|
import {
|
|
9
12
|
readPackage
|
|
10
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-XPD636C4.js";
|
|
11
14
|
import {
|
|
12
15
|
readBinary
|
|
13
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-PNGDJA6M.js";
|
|
14
17
|
import {
|
|
18
|
+
openRetainedPresentationValidation,
|
|
15
19
|
validatePresentation
|
|
16
|
-
} from "./chunk-
|
|
20
|
+
} from "./chunk-RNSKXOG3.js";
|
|
21
|
+
import {
|
|
22
|
+
openRetainedContentTypes,
|
|
23
|
+
openRetainedRelationshipGraph
|
|
24
|
+
} from "./chunk-QC5RMGSA.js";
|
|
17
25
|
import {
|
|
18
26
|
parseXmlPart
|
|
19
|
-
} from "./chunk-
|
|
27
|
+
} from "./chunk-554Z6IKP.js";
|
|
20
28
|
import {
|
|
21
29
|
parseContentTypes
|
|
22
|
-
} from "./chunk-
|
|
30
|
+
} from "./chunk-WJCN2IXI.js";
|
|
23
31
|
import {
|
|
24
32
|
readRelationshipGraph
|
|
25
|
-
} from "./chunk-
|
|
33
|
+
} from "./chunk-ZMHEGDU2.js";
|
|
26
34
|
import {
|
|
27
35
|
asciiKey,
|
|
36
|
+
partName,
|
|
28
37
|
relativePartReference
|
|
29
|
-
} from "./chunk-
|
|
38
|
+
} from "./chunk-36XGIPOG.js";
|
|
30
39
|
import {
|
|
31
|
-
OfficeError
|
|
32
|
-
|
|
40
|
+
OfficeError,
|
|
41
|
+
RetainedValues,
|
|
42
|
+
characters,
|
|
43
|
+
equal,
|
|
44
|
+
literal,
|
|
45
|
+
openRetainedXmlDocument,
|
|
46
|
+
resolveOfficeResources,
|
|
47
|
+
stageRetainedXmlEdits
|
|
48
|
+
} from "./chunk-Q73EMLLZ.js";
|
|
49
|
+
|
|
50
|
+
// packages/safe-bash-presentation-engine/src/retained-slide-settings.ts
|
|
51
|
+
import { PagedStorage } from "@poe-platform/safe-fs/storage";
|
|
52
|
+
function unsupported(message) {
|
|
53
|
+
throw new OfficeError("unsupported-edit", message, "validate-intent");
|
|
54
|
+
}
|
|
55
|
+
async function contains(source, needles, lower = false) {
|
|
56
|
+
const maximum = Math.max(...needles.map((value) => value.length));
|
|
57
|
+
let window = "";
|
|
58
|
+
for await (const character of characters(source)) {
|
|
59
|
+
window = (window + (lower ? character.toLowerCase() : character)).slice(-maximum);
|
|
60
|
+
if (needles.some((value) => window.endsWith(value))) return true;
|
|
61
|
+
}
|
|
62
|
+
return false;
|
|
63
|
+
}
|
|
64
|
+
async function* escaped(text, quote) {
|
|
65
|
+
let buffer = "";
|
|
66
|
+
for (const character of text) {
|
|
67
|
+
buffer += character === "&" ? "&" : character === "<" ? "<" : character === ">" ? ">" : character === quote ? quote === '"' ? """ : "'" : character === " " ? "	" : character === "\n" ? " " : character === "\r" ? " " : character;
|
|
68
|
+
if (buffer.length >= 4096) {
|
|
69
|
+
yield* literal(buffer);
|
|
70
|
+
buffer = "";
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
if (buffer) yield* literal(buffer);
|
|
74
|
+
}
|
|
75
|
+
async function openRetainedSlideSettings(archive, fingerprint, options, settings) {
|
|
76
|
+
const context = resolveOfficeResources(settings), workingStorage = { ...settings.workingStorage }, signal = context.signal ?? new AbortController().signal, resources = { ...context, workingStorage, signal };
|
|
77
|
+
const prepared = prepareSlideMutationOptions(options, context);
|
|
78
|
+
if ("position" in options) throw new OfficeError("invalid-value", "Slide settings do not reorder slides.", "usage");
|
|
79
|
+
const queries = prepared.map((query) => ({ ...query, ...query.position ? { position: { ...query.position } } : {} }));
|
|
80
|
+
const name = options.name, hidden = options.hidden, allowEmpty = options.allowEmpty;
|
|
81
|
+
const limits = { ...context.xmlLimits, ...context.relationshipLimits, maxBytes: Math.min(context.xmlLimits.maxBytes, context.relationshipLimits.maxBytes), maxEntries: context.archiveLimits.maxMembers };
|
|
82
|
+
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");
|
|
83
|
+
const pages = new PagedStorage({ fs: workingStorage.fs, cwd: workingStorage.directory, env: {}, signal }, (workingStorage.cacheBytes ?? 1024 * 1024) / 16384);
|
|
84
|
+
let closed = false, closing, first = 0, last = 0, affected = 0, changed = false;
|
|
85
|
+
let types, graph, index;
|
|
86
|
+
const check = () => {
|
|
87
|
+
if (closed) throw new OfficeError("invalid-handle", "Slide mutation is closed.", "serialize");
|
|
88
|
+
if (signal.aborted) throw new OfficeError("cancelled", "Operation cancelled.", "serialize");
|
|
89
|
+
};
|
|
90
|
+
const close = () => {
|
|
91
|
+
closed = true;
|
|
92
|
+
return closing ??= (async () => {
|
|
93
|
+
const results = await Promise.allSettled([types?.close(), graph?.close(), index?.close(), pages.close()]);
|
|
94
|
+
for (const result of results) if (result.status === "rejected") throw result.reason;
|
|
95
|
+
})();
|
|
96
|
+
};
|
|
97
|
+
const values = new RetainedValues(pages, check, signal);
|
|
98
|
+
async function write(pointer, row2) {
|
|
99
|
+
const bytes = new Uint8Array(row2.length * 8), view = new DataView(bytes.buffer);
|
|
100
|
+
row2.forEach((value, i) => view.setFloat64(i * 8, value, true));
|
|
101
|
+
await pages.write(pointer, bytes);
|
|
102
|
+
}
|
|
103
|
+
async function row(pointer, count) {
|
|
104
|
+
const bytes = await pages.read(pointer, count * 8), view = new DataView(bytes.buffer, bytes.byteOffset, bytes.byteLength);
|
|
105
|
+
return Array.from({ length: count }, (_, i) => view.getFloat64(i * 8, true));
|
|
106
|
+
}
|
|
107
|
+
async function* entries() {
|
|
108
|
+
check();
|
|
109
|
+
for (let pointer = first; pointer; ) {
|
|
110
|
+
const item = await row(pointer, 3);
|
|
111
|
+
let text = "";
|
|
112
|
+
const decoder = new TextDecoder();
|
|
113
|
+
for await (const bytes of values.read({ start: item[1], length: item[2] })) text += decoder.decode(bytes, { stream: true });
|
|
114
|
+
yield JSON.parse(text + decoder.decode());
|
|
115
|
+
pointer = item[0];
|
|
116
|
+
check();
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
async function replacement(part) {
|
|
120
|
+
check();
|
|
121
|
+
const value = await values.find("changes", () => literal(asciiKey(partName(part, false))));
|
|
122
|
+
return value ? values.read(value) : void 0;
|
|
123
|
+
}
|
|
124
|
+
const candidate = {
|
|
125
|
+
async *parts() {
|
|
126
|
+
check();
|
|
127
|
+
for await (const part of archive.parts()) {
|
|
128
|
+
check();
|
|
129
|
+
yield part;
|
|
130
|
+
}
|
|
131
|
+
},
|
|
132
|
+
async has(part) {
|
|
133
|
+
check();
|
|
134
|
+
return archive.has(part);
|
|
135
|
+
},
|
|
136
|
+
async byteLength(part) {
|
|
137
|
+
check();
|
|
138
|
+
return (await values.find("changes", () => literal(asciiKey(partName(part, false)))))?.length ?? archive.byteLength(part);
|
|
139
|
+
},
|
|
140
|
+
async *read(part) {
|
|
141
|
+
check();
|
|
142
|
+
const value = await replacement(part);
|
|
143
|
+
if (value) yield* value;
|
|
144
|
+
else yield* archive.read(part);
|
|
145
|
+
check();
|
|
146
|
+
}
|
|
147
|
+
};
|
|
148
|
+
try {
|
|
149
|
+
types = await openRetainedContentTypes(archive.read("/[Content_Types].xml"), resources, limits);
|
|
150
|
+
graph = await openRetainedRelationshipGraph(archive, { ...resources, xmlLimits: { ...context.xmlLimits, maxBytes: context.relationshipLimits.maxBytes } });
|
|
151
|
+
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.");
|
|
152
|
+
async function* owners() {
|
|
153
|
+
yield "/";
|
|
154
|
+
yield* graph.parts();
|
|
155
|
+
}
|
|
156
|
+
for await (const owner of owners()) for await (const edge of graph.outgoing(owner)) {
|
|
157
|
+
if (await contains(edge.type(), ["/digital-signature/"])) unsupported("Signed and macro-enabled packages cannot be changed.");
|
|
158
|
+
let suffix = "";
|
|
159
|
+
for await (const character of characters(edge.type())) suffix = (suffix + character).slice(-11);
|
|
160
|
+
if (suffix === "/vbaProject") unsupported("Signed and macro-enabled packages cannot be changed.");
|
|
161
|
+
}
|
|
162
|
+
await types.close();
|
|
163
|
+
types = void 0;
|
|
164
|
+
await graph.close();
|
|
165
|
+
graph = void 0;
|
|
166
|
+
const validation = await openRetainedPresentationValidation(archive, resources, limits);
|
|
167
|
+
const valid = validation.valid;
|
|
168
|
+
await validation.close();
|
|
169
|
+
if (!valid) throw new OfficeError("invalid-opc", "Slide editing requires a valid presentation graph.", "validate-intent");
|
|
170
|
+
index = await openRetainedPresentationIndex(archive, fingerprint, resources);
|
|
171
|
+
for (const query of queries) {
|
|
172
|
+
try {
|
|
173
|
+
for await (const record of index.records.select(query)) {
|
|
174
|
+
if (record.kind !== "slide" || await values.find("selected", () => literal(record.id))) throw new SelectionError("invalid-selection");
|
|
175
|
+
const id = await values.store(literal(record.id));
|
|
176
|
+
await values.insert("selected", id, id);
|
|
177
|
+
const target = await values.store(literal(JSON.stringify({ location: record.location, part: record.part }))), pointer = pages.allocate(24);
|
|
178
|
+
await write(pointer, [0, target.start, target.length]);
|
|
179
|
+
if (last) await write(last, [pointer]);
|
|
180
|
+
else first = pointer;
|
|
181
|
+
last = pointer;
|
|
182
|
+
affected++;
|
|
183
|
+
}
|
|
184
|
+
} catch (error) {
|
|
185
|
+
if (!(allowEmpty && error instanceof SelectionError && error.code === "missing-selection")) throw error;
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
const presentation = await openRetainedXmlDocument(archive.read(index.records.main), resources);
|
|
189
|
+
let failed = false;
|
|
190
|
+
try {
|
|
191
|
+
let stack = pages.allocate(16);
|
|
192
|
+
await write(stack, [0, presentation.reference(presentation.root)]);
|
|
193
|
+
while (stack) {
|
|
194
|
+
const frame = await row(stack, 2);
|
|
195
|
+
stack = frame[0];
|
|
196
|
+
const node = await presentation.node(frame[1]);
|
|
197
|
+
if (node.kind !== "element") continue;
|
|
198
|
+
if (await equal(presentation.namespace(node), literal("http://schemas.openxmlformats.org/markup-compatibility/2006"))) unsupported("Conditional presentation structure cannot be changed.");
|
|
199
|
+
if (await equal(presentation.raw(node.localName), literal("modifyVerifier")) && await equal(presentation.namespace(node), presentation.namespace(presentation.root))) unsupported("Protected presentations cannot be changed.");
|
|
200
|
+
for await (const child2 of presentation.children(node)) {
|
|
201
|
+
const pointer = pages.allocate(16);
|
|
202
|
+
await write(pointer, [stack, presentation.reference(child2)]);
|
|
203
|
+
stack = pointer;
|
|
204
|
+
}
|
|
205
|
+
}
|
|
206
|
+
} catch (error) {
|
|
207
|
+
failed = true;
|
|
208
|
+
throw error;
|
|
209
|
+
} finally {
|
|
210
|
+
try {
|
|
211
|
+
await presentation.close();
|
|
212
|
+
} catch (error) {
|
|
213
|
+
if (!failed) await Promise.reject(error);
|
|
214
|
+
}
|
|
215
|
+
}
|
|
216
|
+
for await (const target of entries()) {
|
|
217
|
+
const document = await openRetainedXmlDocument(archive.read(target.part), resources);
|
|
218
|
+
let failed2 = false;
|
|
219
|
+
try {
|
|
220
|
+
const changes = [];
|
|
221
|
+
async function attr2(node, key) {
|
|
222
|
+
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;
|
|
223
|
+
return void 0;
|
|
224
|
+
}
|
|
225
|
+
if (name !== void 0) {
|
|
226
|
+
let common;
|
|
227
|
+
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"))) {
|
|
228
|
+
if (common) throw new OfficeError("ambiguous-selection", "Ambiguous presentation structure.", "select");
|
|
229
|
+
common = child2;
|
|
230
|
+
}
|
|
231
|
+
if (!common) unsupported("Conditional slide labels cannot be changed.");
|
|
232
|
+
const value = await attr2(common, "name");
|
|
233
|
+
if (!await equal(value ? document.text(value) : literal(""), literal(name))) changes.push({ node: common.name.start, attribute: "name", value: name || null, existing: Boolean(value) });
|
|
234
|
+
}
|
|
235
|
+
if (hidden !== void 0) {
|
|
236
|
+
const value = await attr2(document.root, "show");
|
|
237
|
+
let show = "", started = false, trailing = false;
|
|
238
|
+
if (value) for await (const character of characters(document.text(value))) {
|
|
239
|
+
if (!character.trim()) {
|
|
240
|
+
if (started) trailing = true;
|
|
241
|
+
} else {
|
|
242
|
+
if (trailing || show.length >= 5) throw new OfficeError("invalid-opc", "Invalid slide visibility.", "validate-intent");
|
|
243
|
+
started = true;
|
|
244
|
+
show += character;
|
|
245
|
+
}
|
|
246
|
+
}
|
|
247
|
+
if (value && !["0", "1", "true", "false"].includes(show)) throw new OfficeError("invalid-opc", "Invalid slide visibility.", "validate-intent");
|
|
248
|
+
if ((show === "0" || show === "false") !== hidden) changes.push({ node: document.root.name.start, attribute: "show", value: hidden ? "0" : "1", existing: Boolean(value) });
|
|
249
|
+
}
|
|
250
|
+
if (changes.length) {
|
|
251
|
+
const mutation = await stageRetainedXmlEdits(archive.read(target.part), async function* (xml) {
|
|
252
|
+
let active, attributeStart = 0, matching = false;
|
|
253
|
+
for await (const token of xml.tokens()) {
|
|
254
|
+
if (token.kind === "start-name") {
|
|
255
|
+
active = changes.find((change) => change.node === token.range.start);
|
|
256
|
+
matching = false;
|
|
257
|
+
} else if (active && token.kind === "attribute-name") {
|
|
258
|
+
attributeStart = token.range.start;
|
|
259
|
+
matching = await equal(xml.read(token.range), literal(active.attribute));
|
|
260
|
+
} else if (active && token.kind === "attribute-value") {
|
|
261
|
+
if (matching) {
|
|
262
|
+
if (active.value === null) yield { range: { start: attributeStart, length: token.range.start + token.range.length + 1 - attributeStart }, replacement: literal("") };
|
|
263
|
+
else {
|
|
264
|
+
let quote = '"';
|
|
265
|
+
for await (const bytes of xml.read({ start: token.range.start - 1, length: 1 })) quote = String.fromCharCode(bytes[0]);
|
|
266
|
+
yield { range: token.range, replacement: escaped(active.value, quote) };
|
|
267
|
+
}
|
|
268
|
+
}
|
|
269
|
+
} else if (active && token.kind === "start-end") {
|
|
270
|
+
if (!active.existing && active.value !== null) {
|
|
271
|
+
const change = active;
|
|
272
|
+
yield { range: { start: token.range.start - (token.empty ? 2 : 1), length: 0 }, replacement: (async function* () {
|
|
273
|
+
yield* literal(` ${change.attribute}="`);
|
|
274
|
+
yield* escaped(change.value, '"');
|
|
275
|
+
yield* literal('"');
|
|
276
|
+
})() };
|
|
277
|
+
}
|
|
278
|
+
active = void 0;
|
|
279
|
+
}
|
|
280
|
+
}
|
|
281
|
+
}, resources);
|
|
282
|
+
let mutationFailed = false;
|
|
283
|
+
try {
|
|
284
|
+
const value = await values.store(mutation.bytes()), key = await values.store(literal(asciiKey(target.part)));
|
|
285
|
+
await values.insert("changes", key, value);
|
|
286
|
+
changed = true;
|
|
287
|
+
} catch (error) {
|
|
288
|
+
mutationFailed = true;
|
|
289
|
+
throw error;
|
|
290
|
+
} finally {
|
|
291
|
+
try {
|
|
292
|
+
await mutation.close();
|
|
293
|
+
} catch (error) {
|
|
294
|
+
if (!mutationFailed) await Promise.reject(error);
|
|
295
|
+
}
|
|
296
|
+
}
|
|
297
|
+
}
|
|
298
|
+
} catch (error) {
|
|
299
|
+
failed2 = true;
|
|
300
|
+
throw error;
|
|
301
|
+
} finally {
|
|
302
|
+
try {
|
|
303
|
+
await document.close();
|
|
304
|
+
} catch (error) {
|
|
305
|
+
if (!failed2) await Promise.reject(error);
|
|
306
|
+
}
|
|
307
|
+
}
|
|
308
|
+
}
|
|
309
|
+
if (changed) {
|
|
310
|
+
const result = await openRetainedPresentationValidation(candidate, resources, limits);
|
|
311
|
+
const valid2 = result.valid;
|
|
312
|
+
await result.close();
|
|
313
|
+
if (!valid2) throw new OfficeError("invalid-opc", "Changed slides fail graph validation.", "validate-result");
|
|
314
|
+
}
|
|
315
|
+
await index.close();
|
|
316
|
+
index = void 0;
|
|
317
|
+
check();
|
|
318
|
+
return Object.freeze({ ...candidate, changed, affected, replacement, async *targets() {
|
|
319
|
+
for await (const entry of entries()) yield entry.location;
|
|
320
|
+
}, close });
|
|
321
|
+
} catch (error) {
|
|
322
|
+
await close().catch(() => {
|
|
323
|
+
});
|
|
324
|
+
throw error;
|
|
325
|
+
}
|
|
326
|
+
}
|
|
33
327
|
|
|
34
328
|
// packages/safe-bash-presentation-engine/src/slides.ts
|
|
35
329
|
var contentNamespace = "http://schemas.openxmlformats.org/package/2006/content-types";
|
|
@@ -51,7 +345,7 @@ var dialects = [
|
|
|
51
345
|
function invalid(message) {
|
|
52
346
|
throw new OfficeError("invalid-value", message, "usage");
|
|
53
347
|
}
|
|
54
|
-
function
|
|
348
|
+
function unsupported2(message) {
|
|
55
349
|
throw new OfficeError("unsupported-edit", message, "validate-intent");
|
|
56
350
|
}
|
|
57
351
|
function attr(node, name, namespace = "") {
|
|
@@ -78,16 +372,16 @@ function fields(value, allowed) {
|
|
|
78
372
|
if (!value || typeof value !== "object" || ![Object.prototype, null].includes(Object.getPrototypeOf(value)) || Object.keys(value).some((key) => !allowed.includes(key)))
|
|
79
373
|
invalid("Expected a structured slide insertion object.");
|
|
80
374
|
}
|
|
81
|
-
function
|
|
375
|
+
function* escapedSlideText(text, maximum) {
|
|
82
376
|
if (typeof text !== "string") invalid("Expected text.");
|
|
83
377
|
if (text.length > maximum)
|
|
84
378
|
throw new OfficeError("resource-limit", "Slide text exceeds limits.", "usage");
|
|
85
|
-
let
|
|
379
|
+
let length = 0;
|
|
86
380
|
for (const ch of text) {
|
|
87
381
|
const code = ch.codePointAt(0);
|
|
88
382
|
if (code < 32 && ![9, 10, 13].includes(code) || code >= 55296 && code <= 57343 || code === 65534 || code === 65535)
|
|
89
383
|
invalid("Text contains an invalid XML character.");
|
|
90
|
-
|
|
384
|
+
const value = {
|
|
91
385
|
"&": "&",
|
|
92
386
|
"<": "<",
|
|
93
387
|
">": ">",
|
|
@@ -96,9 +390,15 @@ function escape(text, maximum) {
|
|
|
96
390
|
"\n": " ",
|
|
97
391
|
" ": "	"
|
|
98
392
|
}[ch] ?? ch;
|
|
99
|
-
|
|
393
|
+
length += value.length;
|
|
394
|
+
if (length > maximum)
|
|
100
395
|
throw new OfficeError("resource-limit", "Slide text exceeds limits.", "usage");
|
|
396
|
+
yield value;
|
|
101
397
|
}
|
|
398
|
+
}
|
|
399
|
+
function escape(text, maximum) {
|
|
400
|
+
let result = "";
|
|
401
|
+
for (const value of escapedSlideText(text, maximum)) result += value;
|
|
102
402
|
return result;
|
|
103
403
|
}
|
|
104
404
|
function relationshipPart(owner) {
|
|
@@ -180,13 +480,13 @@ function prepareSlideInsertion(reader, options, context) {
|
|
|
180
480
|
if (name === "/[Content_Types].xml") continue;
|
|
181
481
|
const type = types.get(name).toLowerCase();
|
|
182
482
|
if (type.includes("digital-signature") || type.includes("macroenabled") || type.includes("vbaproject") || asciiKey(name).startsWith("/_xmlsignatures/"))
|
|
183
|
-
|
|
483
|
+
unsupported2("Signed and macro-enabled packages cannot be changed.");
|
|
184
484
|
}
|
|
185
485
|
for (const owner of ["/", ...graph.parts])
|
|
186
486
|
if (graph.outgoing(owner).some(
|
|
187
487
|
(edge) => edge.type.includes("/digital-signature/") || edge.type.endsWith("/vbaProject")
|
|
188
488
|
))
|
|
189
|
-
|
|
489
|
+
unsupported2("Signed and macro-enabled packages cannot be changed.");
|
|
190
490
|
if (!validatePresentation(reader, validationLimits).valid)
|
|
191
491
|
throw new OfficeError(
|
|
192
492
|
"invalid-opc",
|
|
@@ -200,9 +500,9 @@ function prepareSlideInsertion(reader, options, context) {
|
|
|
200
500
|
while (presentationNodes.length) {
|
|
201
501
|
const node = presentationNodes.pop();
|
|
202
502
|
if (node.name.namespace === d.p && node.name.localName === "modifyVerifier")
|
|
203
|
-
|
|
503
|
+
unsupported2("Protected presentations cannot be changed.");
|
|
204
504
|
if (node.name.namespace === "http://schemas.openxmlformats.org/markup-compatibility/2006")
|
|
205
|
-
|
|
505
|
+
unsupported2("Conditional presentation structure cannot be changed.");
|
|
206
506
|
presentationNodes.push(...node.children);
|
|
207
507
|
}
|
|
208
508
|
const list = child(presentation.root, "sldIdLst", d.p);
|
|
@@ -211,7 +511,7 @@ function prepareSlideInsertion(reader, options, context) {
|
|
|
211
511
|
) ?? [];
|
|
212
512
|
const position = options.position ?? ids.length + 1;
|
|
213
513
|
if (position > ids.length + 1) invalid("Insertion position is outside the slide list.");
|
|
214
|
-
if (list && ids.length !== list.children.length)
|
|
514
|
+
if (list && ids.length !== list.children.length) unsupported2("Unsupported slide-list content.");
|
|
215
515
|
const candidates = graph.parts.filter((name) => types.get(name) === `${typePrefix}slideLayout+xml`).filter((name) => {
|
|
216
516
|
if (options.layout.startsWith("/")) return name === options.layout;
|
|
217
517
|
const document = parseXmlPart(reader.get(name), context.xmlLimits);
|
|
@@ -226,7 +526,7 @@ function prepareSlideInsertion(reader, options, context) {
|
|
|
226
526
|
const layout = candidates[0];
|
|
227
527
|
const layoutDocument = parseXmlPart(reader.get(layout), context.xmlLimits);
|
|
228
528
|
if (layoutDocument.root.name.namespace !== d.p)
|
|
229
|
-
|
|
529
|
+
unsupported2("Layout dialect must match the presentation.");
|
|
230
530
|
const masters = graph.outgoing(layout).filter((edge) => edge.type === `${d.r}/slideMaster` && !edge.external);
|
|
231
531
|
const masterEdges = graph.outgoing(main).filter(
|
|
232
532
|
(edge) => edge.type === `${d.r}/slideMaster` && edge.targetPart === masters[0]?.targetPart
|
|
@@ -244,12 +544,12 @@ function prepareSlideInsertion(reader, options, context) {
|
|
|
244
544
|
const placeholders = [];
|
|
245
545
|
const keys = /* @__PURE__ */ new Set();
|
|
246
546
|
for (const node of tree.children) {
|
|
247
|
-
if (node.name.namespace !== d.p)
|
|
547
|
+
if (node.name.namespace !== d.p) unsupported2("Unsupported layout drawing content.");
|
|
248
548
|
if (node.name.localName !== "sp") {
|
|
249
549
|
if (!["nvGrpSpPr", "grpSpPr", "pic", "graphicFrame", "cxnSp", "grpSp"].includes(
|
|
250
550
|
node.name.localName
|
|
251
551
|
))
|
|
252
|
-
|
|
552
|
+
unsupported2("Unsupported layout drawing content.");
|
|
253
553
|
continue;
|
|
254
554
|
}
|
|
255
555
|
const nv = child(node, "nvSpPr", d.p);
|
|
@@ -277,7 +577,7 @@ function prepareSlideInsertion(reader, options, context) {
|
|
|
277
577
|
if (ph.attributes.some(
|
|
278
578
|
(attribute) => attribute.name.namespace || !["type", "idx", "sz", "orient", "hasCustomPrompt"].includes(attribute.name.localName)
|
|
279
579
|
))
|
|
280
|
-
|
|
580
|
+
unsupported2("Unsupported placeholder attributes.");
|
|
281
581
|
placeholders.push({
|
|
282
582
|
type,
|
|
283
583
|
index,
|
|
@@ -314,7 +614,7 @@ function prepareSlideInsertion(reader, options, context) {
|
|
|
314
614
|
"select"
|
|
315
615
|
);
|
|
316
616
|
if (!textPlaceholderTypes.includes(matches[0].type))
|
|
317
|
-
|
|
617
|
+
unsupported2("Rich-content placeholders cannot be populated as text.");
|
|
318
618
|
assigned.add(matches[0]);
|
|
319
619
|
matches[0].text = assignment.text;
|
|
320
620
|
}
|
|
@@ -416,7 +716,7 @@ function prepareSlideInsertion(reader, options, context) {
|
|
|
416
716
|
);
|
|
417
717
|
return { changes, part: slide, slideId, position };
|
|
418
718
|
}
|
|
419
|
-
|
|
719
|
+
function prepareSlideMutationOptions(options, context) {
|
|
420
720
|
fields(options, ["selection", "position", "name", "hidden", "allowEmpty"]);
|
|
421
721
|
if ([options.position, options.name, options.hidden].every((value) => value === void 0))
|
|
422
722
|
invalid("At least one slide update is required.");
|
|
@@ -429,7 +729,7 @@ async function mutateSlides(input, options, context) {
|
|
|
429
729
|
invalid("Expected a boolean slide setting.");
|
|
430
730
|
if (!context?.xmlLimits || !context.relationshipLimits)
|
|
431
731
|
invalid("Explicit XML and relationship limits are required.");
|
|
432
|
-
if (options.name !== void 0)
|
|
732
|
+
if (options.name !== void 0) for (const value of escapedSlideText(options.name, context.xmlLimits.maxBytes)) void value;
|
|
433
733
|
const queries = Array.isArray(options.selection) ? options.selection : [options.selection];
|
|
434
734
|
if (!queries.length) throw new SelectionError("invalid-selection");
|
|
435
735
|
if (queries.length > context.relationshipLimits.maxParts)
|
|
@@ -437,6 +737,10 @@ async function mutateSlides(input, options, context) {
|
|
|
437
737
|
for (const query of queries)
|
|
438
738
|
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
739
|
throw new SelectionError("invalid-selection");
|
|
740
|
+
return queries;
|
|
741
|
+
}
|
|
742
|
+
async function mutateSlides(input, options, context) {
|
|
743
|
+
const queries = prepareSlideMutationOptions(options, context);
|
|
440
744
|
const source = await readBinary(input, context);
|
|
441
745
|
const reader = await readPackage(source, context);
|
|
442
746
|
const limits = {
|
|
@@ -452,13 +756,13 @@ async function mutateSlides(input, options, context) {
|
|
|
452
756
|
if (name === "/[Content_Types].xml") continue;
|
|
453
757
|
const type = types.get(name).toLowerCase();
|
|
454
758
|
if (type.includes("digital-signature") || type.includes("macroenabled") || type.includes("vbaproject") || asciiKey(name).startsWith("/_xmlsignatures/"))
|
|
455
|
-
|
|
759
|
+
unsupported2("Signed and macro-enabled packages cannot be changed.");
|
|
456
760
|
}
|
|
457
761
|
for (const owner of ["/", ...graph.parts])
|
|
458
762
|
if (graph.outgoing(owner).some(
|
|
459
763
|
(edge) => edge.type.includes("/digital-signature/") || edge.type.endsWith("/vbaProject")
|
|
460
764
|
))
|
|
461
|
-
|
|
765
|
+
unsupported2("Signed and macro-enabled packages cannot be changed.");
|
|
462
766
|
if (!validatePresentation(reader, limits).valid)
|
|
463
767
|
throw new OfficeError(
|
|
464
768
|
"invalid-opc",
|
|
@@ -493,16 +797,16 @@ async function mutateSlides(input, options, context) {
|
|
|
493
797
|
while (pending.length) {
|
|
494
798
|
const node = pending.pop();
|
|
495
799
|
if (node.name.namespace === d.p && node.name.localName === "modifyVerifier")
|
|
496
|
-
|
|
800
|
+
unsupported2("Protected presentations cannot be changed.");
|
|
497
801
|
if (node.name.namespace === "http://schemas.openxmlformats.org/markup-compatibility/2006")
|
|
498
|
-
|
|
802
|
+
unsupported2("Conditional presentation structure cannot be changed.");
|
|
499
803
|
pending.push(...node.children);
|
|
500
804
|
}
|
|
501
805
|
const changes = /* @__PURE__ */ new Map();
|
|
502
806
|
if (selected.length && options.position !== void 0) {
|
|
503
807
|
const list = child(presentation.root, "sldIdLst", d.p);
|
|
504
808
|
if (list.children.some((node) => node.name.namespace !== d.p || node.name.localName !== "sldId"))
|
|
505
|
-
|
|
809
|
+
unsupported2("Unsupported slide-list content.");
|
|
506
810
|
const ordered = index.slides.filter((slide) => !identities.has(slide.id));
|
|
507
811
|
ordered.splice(options.position - 1, 0, ...selected);
|
|
508
812
|
if (ordered.some((slide, i) => slide.id !== index.slides[i].id)) {
|
|
@@ -520,7 +824,7 @@ async function mutateSlides(input, options, context) {
|
|
|
520
824
|
let changed = false;
|
|
521
825
|
if (options.name !== void 0) {
|
|
522
826
|
const common = child(document.root, "cSld", d.p);
|
|
523
|
-
if (!common)
|
|
827
|
+
if (!common) unsupported2("Conditional slide labels cannot be changed.");
|
|
524
828
|
if ((attr(common, "name") ?? "") !== options.name) {
|
|
525
829
|
document = document.merge(common, {
|
|
526
830
|
attributes: [{ namespace: "", localName: "name", value: options.name || null }]
|
|
@@ -560,7 +864,9 @@ async function mutateSlides(input, options, context) {
|
|
|
560
864
|
}
|
|
561
865
|
|
|
562
866
|
export {
|
|
867
|
+
openRetainedSlideSettings,
|
|
563
868
|
addSlide,
|
|
564
869
|
prepareSlideInsertion,
|
|
870
|
+
prepareSlideMutationOptions,
|
|
565
871
|
mutateSlides
|
|
566
872
|
};
|
|
@@ -1,22 +1,22 @@
|
|
|
1
1
|
import {
|
|
2
2
|
loadShared
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-56NYSX65.js";
|
|
4
4
|
import {
|
|
5
5
|
writePackageArchive
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-DM2CPMB4.js";
|
|
7
7
|
import {
|
|
8
8
|
readBinary
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-PNGDJA6M.js";
|
|
10
10
|
import {
|
|
11
11
|
parseContentTypes
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-WJCN2IXI.js";
|
|
13
13
|
import {
|
|
14
14
|
asciiKey,
|
|
15
15
|
partName
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-36XGIPOG.js";
|
|
17
17
|
import {
|
|
18
18
|
OfficeError
|
|
19
|
-
} from "./chunk-
|
|
19
|
+
} from "./chunk-Q73EMLLZ.js";
|
|
20
20
|
|
|
21
21
|
// packages/safe-bash-presentation-engine/src/package-tools.ts
|
|
22
22
|
import { sha256 } from "@noble/hashes/sha2.js";
|
|
@@ -1,41 +1,41 @@
|
|
|
1
1
|
import {
|
|
2
2
|
readMemberships
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-HDJVJTCK.js";
|
|
4
4
|
import {
|
|
5
5
|
remapCopiedXml
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-MPUHH2KR.js";
|
|
7
7
|
import {
|
|
8
8
|
writePackageArchive
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-DM2CPMB4.js";
|
|
10
10
|
import {
|
|
11
11
|
SelectionError,
|
|
12
12
|
readSelectionIndex
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-X7FA7ZD5.js";
|
|
14
14
|
import {
|
|
15
15
|
readPackage
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-XPD636C4.js";
|
|
17
17
|
import {
|
|
18
18
|
readBinary
|
|
19
|
-
} from "./chunk-
|
|
19
|
+
} from "./chunk-PNGDJA6M.js";
|
|
20
20
|
import {
|
|
21
21
|
validatePresentation
|
|
22
|
-
} from "./chunk-
|
|
22
|
+
} from "./chunk-RNSKXOG3.js";
|
|
23
23
|
import {
|
|
24
24
|
parseXmlPart
|
|
25
|
-
} from "./chunk-
|
|
25
|
+
} from "./chunk-554Z6IKP.js";
|
|
26
26
|
import {
|
|
27
27
|
parseContentTypes
|
|
28
|
-
} from "./chunk-
|
|
28
|
+
} from "./chunk-WJCN2IXI.js";
|
|
29
29
|
import {
|
|
30
30
|
readRelationshipGraph
|
|
31
|
-
} from "./chunk-
|
|
31
|
+
} from "./chunk-ZMHEGDU2.js";
|
|
32
32
|
import {
|
|
33
33
|
asciiKey,
|
|
34
34
|
relativePartReference
|
|
35
|
-
} from "./chunk-
|
|
35
|
+
} from "./chunk-36XGIPOG.js";
|
|
36
36
|
import {
|
|
37
37
|
OfficeError
|
|
38
|
-
} from "./chunk-
|
|
38
|
+
} from "./chunk-Q73EMLLZ.js";
|
|
39
39
|
|
|
40
40
|
// packages/safe-bash-presentation-engine/src/slide-copy.ts
|
|
41
41
|
var dialects = [
|
|
@@ -4,13 +4,13 @@ import {
|
|
|
4
4
|
invalid,
|
|
5
5
|
loadShared,
|
|
6
6
|
nextRel
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-56NYSX65.js";
|
|
8
8
|
import {
|
|
9
9
|
parseXmlPart
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-554Z6IKP.js";
|
|
11
11
|
import {
|
|
12
12
|
OfficeError
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-Q73EMLLZ.js";
|
|
14
14
|
|
|
15
15
|
// packages/safe-bash-presentation-engine/src/properties.ts
|
|
16
16
|
import { SaxesParser } from "saxes";
|