@openpresentation/opf 0.14.0 → 0.15.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +24 -38
- package/dist/catalog-refs-BSfGELpt.d.ts +128 -0
- package/dist/catalog-schemas-CinPh5WA.d.ts +12 -0
- package/dist/catalog.d.ts +91 -0
- package/dist/{chunk-XOZ4KMSR.js → catalog.js} +16514 -8800
- package/dist/{chart-data-B_3z9VTb.d.ts → chart-data-BnNqgnC-.d.ts} +1 -1
- package/dist/{chunk-LS2FMPI5.js → chunk-2CJPC4HI.js} +760 -851
- package/dist/{chunk-4VJDTF55.js → chunk-374R35TJ.js} +1 -1
- package/dist/{chunk-UPQQD7MA.js → chunk-3JG4YXWF.js} +7 -5
- package/dist/{chunk-4LDGKLUC.js → chunk-3RKB4RDJ.js} +1 -1
- package/dist/{chunk-BFLVSVA7.js → chunk-5FTUIDUH.js} +1 -1
- package/dist/{chunk-D3TY4TT6.js → chunk-HXHOZ7AH.js} +1407 -154
- package/dist/{chunk-6OXY2CP3.js → chunk-O744SXXA.js} +319 -162
- package/dist/{chunk-JDJBDYSR.js → chunk-QDI75P2M.js} +194 -846
- package/dist/chunk-SPFV27O5.js +210 -0
- package/dist/chunk-TRDXRRQK.js +17 -0
- package/dist/{chunk-Z65B2B77.js → chunk-TWQJLI6E.js} +2 -2
- package/dist/{chunk-Q2TCMN56.js → chunk-U4J75TRG.js} +1 -1
- package/dist/{chunk-XIZUK2XM.js → chunk-UBFJ2QHH.js} +5 -3
- package/dist/{chunk-CSQHPVGL.js → chunk-VGAOJEY7.js} +1 -1
- package/dist/{chunk-5ZU6JAPP.js → chunk-ZPU46TFA.js} +1 -1
- package/dist/{composition-_WEwBe2a.d.ts → composition-D2tghM82.d.ts} +233 -108
- package/dist/composition.d.ts +3 -2
- package/dist/composition.js +2 -2
- package/dist/convert.d.ts +14 -17
- package/dist/convert.js +36 -39
- package/dist/data.d.ts +1 -1
- package/dist/data.js +3 -3
- package/dist/diff.d.ts +1 -1
- package/dist/diff.js +7 -7
- package/dist/docs.js +29 -29
- package/dist/examples.d.ts +1 -1
- package/dist/examples.js +48431 -3697
- package/dist/{finding-C_por275.d.ts → finding-CT_f_vbD.d.ts} +2 -2
- package/dist/format.js +2 -2
- package/dist/index.d.ts +225 -76
- package/dist/index.js +341 -258
- package/dist/json-BFSdESOE.d.ts +19 -0
- package/dist/markdown.d.ts +19 -7
- package/dist/markdown.js +9 -9
- package/dist/{pagination-BZpXLvFL.d.ts → pagination-wedbe7eq.d.ts} +31 -31
- package/dist/pagination.d.ts +4 -5
- package/dist/pagination.js +6 -6
- package/dist/patch.d.ts +1 -1
- package/dist/patch.js +6 -6
- package/dist/{presentation-C5eHkevA.d.ts → presentation-CDKQVkyI.d.ts} +382 -550
- package/dist/repo-readme.js +1 -1
- package/dist/schemas.d.ts +284 -1
- package/dist/schemas.js +1 -1
- package/dist/spec/README.md +1 -1
- package/dist/spec/catalogs/font-schemes/angsana-new.json +1 -1
- package/dist/spec/catalogs/font-schemes/aparajita.json +2 -2
- package/dist/spec/catalogs/font-schemes/arabic-typesetting.json +1 -1
- package/dist/spec/catalogs/font-schemes/batang.json +1 -1
- package/dist/spec/catalogs/font-schemes/daunpenh.json +1 -1
- package/dist/spec/catalogs/font-schemes/david.json +1 -1
- package/dist/spec/catalogs/font-schemes/dilleniaupc.json +1 -1
- package/dist/spec/catalogs/font-schemes/fangsong.json +1 -1
- package/dist/spec/catalogs/font-schemes/gautami.json +1 -1
- package/dist/spec/catalogs/font-schemes/gisha.json +2 -2
- package/dist/spec/catalogs/font-schemes/gungsuh.json +1 -1
- package/dist/spec/catalogs/font-schemes/index.json +1 -1
- package/dist/spec/catalogs/font-schemes/kalinga.json +1 -1
- package/dist/spec/catalogs/font-schemes/kartika.json +1 -1
- package/dist/spec/catalogs/font-schemes/khmer-ui.json +1 -1
- package/dist/spec/catalogs/font-schemes/latha.json +1 -1
- package/dist/spec/catalogs/font-schemes/malgun-gothic.json +1 -1
- package/dist/spec/catalogs/font-schemes/mangal.json +3 -3
- package/dist/spec/catalogs/font-schemes/meiryo.json +1 -1
- package/dist/spec/catalogs/font-schemes/microsoft-jhenghei.json +1 -1
- package/dist/spec/catalogs/font-schemes/microsoft-yahei.json +4 -4
- package/dist/spec/catalogs/font-schemes/mingliu.json +1 -1
- package/dist/spec/catalogs/font-schemes/miriam.json +1 -1
- package/dist/spec/catalogs/font-schemes/ms-mincho.json +1 -1
- package/dist/spec/catalogs/font-schemes/nirmala-ui.json +1 -1
- package/dist/spec/catalogs/font-schemes/noto-naksh-arabic.json +1 -1
- package/dist/spec/catalogs/font-schemes/noto-nastaliq-urdu.json +2 -2
- package/dist/spec/catalogs/font-schemes/noto-sans-arabic.json +3 -3
- package/dist/spec/catalogs/font-schemes/noto-sans-armenian.json +1 -1
- package/dist/spec/catalogs/font-schemes/noto-sans-bengali.json +2 -2
- package/dist/spec/catalogs/font-schemes/noto-sans-devangari.json +2 -2
- package/dist/spec/catalogs/font-schemes/noto-sans-ethiopic.json +1 -1
- package/dist/spec/catalogs/font-schemes/noto-sans-georgian.json +1 -1
- package/dist/spec/catalogs/font-schemes/noto-sans-gujarati.json +1 -1
- package/dist/spec/catalogs/font-schemes/noto-sans-gurmukhi.json +1 -1
- package/dist/spec/catalogs/font-schemes/noto-sans-hebrew.json +1 -1
- package/dist/spec/catalogs/font-schemes/noto-sans-jp.json +1 -1
- package/dist/spec/catalogs/font-schemes/noto-sans-kannada.json +1 -1
- package/dist/spec/catalogs/font-schemes/noto-sans-khmer.json +1 -1
- package/dist/spec/catalogs/font-schemes/noto-sans-kr.json +1 -1
- package/dist/spec/catalogs/font-schemes/noto-sans-malayalam.json +1 -1
- package/dist/spec/catalogs/font-schemes/noto-sans-mongolian.json +1 -1
- package/dist/spec/catalogs/font-schemes/noto-sans-oriya.json +1 -1
- package/dist/spec/catalogs/font-schemes/noto-sans-sc.json +4 -4
- package/dist/spec/catalogs/font-schemes/noto-sans-tamil.json +1 -1
- package/dist/spec/catalogs/font-schemes/noto-sans-tc.json +1 -1
- package/dist/spec/catalogs/font-schemes/noto-sans-telugu.json +1 -1
- package/dist/spec/catalogs/font-schemes/noto-sans-thai.json +1 -1
- package/dist/spec/catalogs/font-schemes/noto-sans.json +4 -4
- package/dist/spec/catalogs/font-schemes/nyala.json +1 -1
- package/dist/spec/catalogs/font-schemes/pmingliu.json +1 -1
- package/dist/spec/catalogs/font-schemes/raavi.json +1 -1
- package/dist/spec/catalogs/font-schemes/sakkal-majalla.json +3 -3
- package/dist/spec/catalogs/font-schemes/shonar-bangla.json +2 -2
- package/dist/spec/catalogs/font-schemes/shruti.json +1 -1
- package/dist/spec/catalogs/font-schemes/simsun.json +1 -1
- package/dist/spec/catalogs/font-schemes/sylfaen.json +2 -2
- package/dist/spec/catalogs/font-schemes/traditional-arabic.json +3 -3
- package/dist/spec/catalogs/font-schemes/tunga.json +1 -1
- package/dist/spec/catalogs/font-schemes/vrinda.json +1 -1
- package/dist/spec/catalogs/font-schemes/yu-gothic.json +1 -1
- package/dist/spec/catalogs/layouts/capability-map.json +1 -4
- package/dist/spec/catalogs/layouts/chart-1x-title-center.json +30 -0
- package/dist/spec/catalogs/layouts/chart-2x-title-center.json +36 -0
- package/dist/spec/catalogs/layouts/chart-2x-vertical-title-left.json +37 -0
- package/dist/spec/catalogs/layouts/chart-3x-bottom-vertical-title-left.json +46 -0
- package/dist/spec/catalogs/layouts/chart-3x-left-title-center.json +45 -0
- package/dist/spec/catalogs/layouts/chart-3x-left.json +40 -0
- package/dist/spec/catalogs/layouts/chart-3x-right-title-center.json +45 -0
- package/dist/spec/catalogs/layouts/chart-3x-right.json +40 -0
- package/dist/spec/catalogs/layouts/chart-3x-title-center.json +39 -0
- package/dist/spec/catalogs/layouts/chart-3x-top-vertical-title-left.json +46 -0
- package/dist/spec/catalogs/layouts/competitive-landscape.json +1 -4
- package/dist/spec/catalogs/layouts/customer-journey.json +1 -4
- package/dist/spec/catalogs/layouts/decision-tree.json +1 -4
- package/dist/spec/catalogs/layouts/ecosystem-map.json +1 -4
- package/dist/spec/catalogs/layouts/extract/canonical.json +0 -9
- package/dist/spec/catalogs/layouts/geographic-map.json +1 -4
- package/dist/spec/catalogs/layouts/icon-grid.json +1 -4
- package/dist/spec/catalogs/layouts/image-1x-crop-title-center.json +32 -0
- package/dist/spec/catalogs/layouts/image-1x-crop-title-left.json +32 -0
- package/dist/spec/catalogs/layouts/image-1x-crop.json +27 -0
- package/dist/spec/catalogs/layouts/image-1x-fit-title-center.json +32 -0
- package/dist/spec/catalogs/layouts/image-1x.json +3 -0
- package/dist/spec/catalogs/layouts/image-2x-crop-title-center.json +38 -0
- package/dist/spec/catalogs/layouts/image-2x-crop-vertical-title-left.json +39 -0
- package/dist/spec/catalogs/layouts/image-2x-crop-vertical.json +34 -0
- package/dist/spec/catalogs/layouts/image-2x-crop.json +33 -0
- package/dist/spec/catalogs/layouts/image-2x-fit-title-center.json +38 -0
- package/dist/spec/catalogs/layouts/image-2x-fit-vertical-title-left.json +39 -0
- package/dist/spec/catalogs/layouts/image-2x-fit-vertical.json +34 -0
- package/dist/spec/catalogs/layouts/image-2x.json +3 -0
- package/dist/spec/catalogs/layouts/image-3x-crop-title-center.json +41 -0
- package/dist/spec/catalogs/layouts/image-3x-crop-vertical-title-left.json +42 -0
- package/dist/spec/catalogs/layouts/image-3x-crop-vertical.json +37 -0
- package/dist/spec/catalogs/layouts/image-3x-crop.json +36 -0
- package/dist/spec/catalogs/layouts/image-3x-fit-title-center.json +41 -0
- package/dist/spec/catalogs/layouts/image-3x-fit-vertical-title-left.json +42 -0
- package/dist/spec/catalogs/layouts/image-3x-fit-vertical.json +37 -0
- package/dist/spec/catalogs/layouts/image-3x-fit.json +36 -0
- package/dist/spec/catalogs/layouts/image-3x.json +3 -0
- package/dist/spec/catalogs/layouts/image-focus.json +3 -6
- package/dist/spec/catalogs/layouts/image-only-1x-crop-title-center.json +31 -0
- package/dist/spec/catalogs/layouts/image-only-1x-fit-title-center.json +31 -0
- package/dist/spec/catalogs/layouts/image-only-2x-crop-title-center.json +37 -0
- package/dist/spec/catalogs/layouts/image-only-2x-crop-vertical-title-left.json +38 -0
- package/dist/spec/catalogs/layouts/image-only-2x-crop-vertical.json +33 -0
- package/dist/spec/catalogs/layouts/image-only-2x-fit-title-center.json +37 -0
- package/dist/spec/catalogs/layouts/image-only-2x-fit-vertical-title-left.json +38 -0
- package/dist/spec/catalogs/layouts/image-only-2x-fit-vertical.json +33 -0
- package/dist/spec/catalogs/layouts/image-only-3x-crop-title-center.json +40 -0
- package/dist/spec/catalogs/layouts/image-only-3x-crop-vertical-title-left.json +41 -0
- package/dist/spec/catalogs/layouts/image-only-3x-crop-vertical.json +36 -0
- package/dist/spec/catalogs/layouts/image-only-3x-crop.json +35 -0
- package/dist/spec/catalogs/layouts/image-only-3x-fit-title-center.json +40 -0
- package/dist/spec/catalogs/layouts/image-only-3x-fit-vertical-title-left.json +41 -0
- package/dist/spec/catalogs/layouts/image-only-3x-fit-vertical.json +36 -0
- package/dist/spec/catalogs/layouts/image-only-3x-fit.json +35 -0
- package/dist/spec/catalogs/layouts/index.json +1041 -151
- package/dist/spec/catalogs/layouts/list-1x-box-title-center.json +32 -0
- package/dist/spec/catalogs/layouts/list-1x-box-vertical-title-center.json +33 -0
- package/dist/spec/catalogs/layouts/list-1x-box-vertical-title-left.json +33 -0
- package/dist/spec/catalogs/layouts/list-1x-box-vertical.json +28 -0
- package/dist/spec/catalogs/layouts/list-1x-box.json +27 -0
- package/dist/spec/catalogs/layouts/list-1x-itemimage-title-center.json +32 -0
- package/dist/spec/catalogs/layouts/list-1x-itemimage-vertical-title-center.json +33 -0
- package/dist/spec/catalogs/layouts/list-1x-title-center.json +31 -0
- package/dist/spec/catalogs/layouts/list-1x-vertical-title-center.json +32 -0
- package/dist/spec/catalogs/layouts/list-2x-box-title-center.json +38 -0
- package/dist/spec/catalogs/layouts/list-2x-box-vertical-title-center.json +39 -0
- package/dist/spec/catalogs/layouts/list-2x-box-vertical-title-left.json +39 -0
- package/dist/spec/catalogs/layouts/list-2x-box-vertical.json +34 -0
- package/dist/spec/catalogs/layouts/list-2x-box.json +33 -0
- package/dist/spec/catalogs/layouts/list-2x-itemimage-title-center.json +38 -0
- package/dist/spec/catalogs/layouts/list-2x-itemimage-vertical-title-center.json +39 -0
- package/dist/spec/catalogs/layouts/list-2x-itemimage-vertical-title-left.json +39 -0
- package/dist/spec/catalogs/layouts/list-2x-itemimage-vertical.json +34 -0
- package/dist/spec/catalogs/layouts/list-2x-title-center.json +37 -0
- package/dist/spec/catalogs/layouts/list-2x-vertical-title-center.json +38 -0
- package/dist/spec/catalogs/layouts/list-2x-vertical-title-left.json +38 -0
- package/dist/spec/catalogs/layouts/list-2x-vertical.json +33 -0
- package/dist/spec/catalogs/layouts/list-3x-box-title-center.json +41 -0
- package/dist/spec/catalogs/layouts/list-3x-box-vertical-title-center.json +42 -0
- package/dist/spec/catalogs/layouts/list-3x-box-vertical-title-left.json +42 -0
- package/dist/spec/catalogs/layouts/list-3x-box-vertical.json +37 -0
- package/dist/spec/catalogs/layouts/list-3x-box.json +36 -0
- package/dist/spec/catalogs/layouts/list-3x-itemimage-title-center.json +41 -0
- package/dist/spec/catalogs/layouts/list-3x-itemimage-vertical-title-center.json +42 -0
- package/dist/spec/catalogs/layouts/list-3x-itemimage-vertical-title-left.json +42 -0
- package/dist/spec/catalogs/layouts/list-3x-itemimage-vertical.json +37 -0
- package/dist/spec/catalogs/layouts/list-3x-itemimage.json +36 -0
- package/dist/spec/catalogs/layouts/list-3x-title-center.json +40 -0
- package/dist/spec/catalogs/layouts/list-3x-vertical-title-center.json +41 -0
- package/dist/spec/catalogs/layouts/list-3x-vertical-title-left.json +41 -0
- package/dist/spec/catalogs/layouts/list-3x-vertical.json +36 -0
- package/dist/spec/catalogs/layouts/list-4x-box-title-center.json +45 -0
- package/dist/spec/catalogs/layouts/list-4x-box-vertical-title-center.json +45 -0
- package/dist/spec/catalogs/layouts/list-4x-box-vertical-title-left.json +45 -0
- package/dist/spec/catalogs/layouts/list-4x-box-vertical.json +40 -0
- package/dist/spec/catalogs/layouts/list-4x-box.json +40 -0
- package/dist/spec/catalogs/layouts/list-4x-itemimage-title-center.json +45 -0
- package/dist/spec/catalogs/layouts/list-4x-itemimage-vertical-title-center.json +45 -0
- package/dist/spec/catalogs/layouts/list-4x-itemimage-vertical-title-left.json +45 -0
- package/dist/spec/catalogs/layouts/list-4x-itemimage-vertical.json +40 -0
- package/dist/spec/catalogs/layouts/list-4x-title-center.json +44 -0
- package/dist/spec/catalogs/layouts/list-4x-vertical-title-center.json +44 -0
- package/dist/spec/catalogs/layouts/list-4x-vertical-title-left.json +44 -0
- package/dist/spec/catalogs/layouts/list-4x-vertical.json +39 -0
- package/dist/spec/catalogs/layouts/list-5x-box-title-center.json +48 -0
- package/dist/spec/catalogs/layouts/list-5x-box-vertical-title-center.json +50 -0
- package/dist/spec/catalogs/layouts/list-5x-box-vertical-title-left.json +50 -0
- package/dist/spec/catalogs/layouts/list-5x-box-vertical.json +45 -0
- package/dist/spec/catalogs/layouts/list-5x-box.json +43 -0
- package/dist/spec/catalogs/layouts/list-5x-itemimage-title-center.json +48 -0
- package/dist/spec/catalogs/layouts/list-5x-itemimage-vertical-title-center.json +48 -0
- package/dist/spec/catalogs/layouts/list-5x-itemimage-vertical-title-left.json +48 -0
- package/dist/spec/catalogs/layouts/list-5x-itemimage-vertical.json +43 -0
- package/dist/spec/catalogs/layouts/list-5x-title-center.json +47 -0
- package/dist/spec/catalogs/layouts/list-5x-vertical-title-center.json +47 -0
- package/dist/spec/catalogs/layouts/list-5x-vertical-title-left.json +47 -0
- package/dist/spec/catalogs/layouts/list-5x-vertical.json +42 -0
- package/dist/spec/catalogs/layouts/list-6x-box-title-center.json +51 -0
- package/dist/spec/catalogs/layouts/list-6x-box-vertical-title-center.json +53 -0
- package/dist/spec/catalogs/layouts/list-6x-box-vertical-title-left.json +53 -0
- package/dist/spec/catalogs/layouts/list-6x-box-vertical.json +48 -0
- package/dist/spec/catalogs/layouts/list-6x-box.json +46 -0
- package/dist/spec/catalogs/layouts/list-6x-itemimage-title-center.json +51 -0
- package/dist/spec/catalogs/layouts/list-6x-itemimage-vertical-title-center.json +51 -0
- package/dist/spec/catalogs/layouts/list-6x-itemimage-vertical-title-left.json +51 -0
- package/dist/spec/catalogs/layouts/list-6x-itemimage-vertical.json +46 -0
- package/dist/spec/catalogs/layouts/list-6x-title-center.json +50 -0
- package/dist/spec/catalogs/layouts/list-6x-vertical-title-center.json +50 -0
- package/dist/spec/catalogs/layouts/list-6x-vertical-title-left.json +50 -0
- package/dist/spec/catalogs/layouts/list-6x-vertical.json +45 -0
- package/dist/spec/catalogs/layouts/network-dependency-map.json +1 -4
- package/dist/spec/catalogs/layouts/number-1x-box-title-center.json +30 -0
- package/dist/spec/catalogs/layouts/number-1x-box.json +25 -0
- package/dist/spec/catalogs/layouts/number-1x-title-center.json +29 -0
- package/dist/spec/catalogs/layouts/number-2x-box-title-center.json +36 -0
- package/dist/spec/catalogs/layouts/number-2x-box.json +31 -0
- package/dist/spec/catalogs/layouts/number-2x-title-center.json +35 -0
- package/dist/spec/catalogs/layouts/number-3x-box-title-center.json +39 -0
- package/dist/spec/catalogs/layouts/number-3x-box.json +34 -0
- package/dist/spec/catalogs/layouts/number-3x-title-center.json +38 -0
- package/dist/spec/catalogs/layouts/number-4x-box-title-center.json +43 -0
- package/dist/spec/catalogs/layouts/number-4x-box.json +38 -0
- package/dist/spec/catalogs/layouts/number-4x-title-center.json +42 -0
- package/dist/spec/catalogs/layouts/number-5x-box-title-center.json +46 -0
- package/dist/spec/catalogs/layouts/number-5x-box.json +41 -0
- package/dist/spec/catalogs/layouts/number-5x-title-center.json +45 -0
- package/dist/spec/catalogs/layouts/number-6x-box-title-center.json +49 -0
- package/dist/spec/catalogs/layouts/number-6x-box.json +44 -0
- package/dist/spec/catalogs/layouts/number-6x-title-center.json +48 -0
- package/dist/spec/catalogs/layouts/persona-grid.json +1 -4
- package/dist/spec/catalogs/layouts/photo-grid.json +1 -4
- package/dist/spec/catalogs/layouts/product-feature.json +1 -4
- package/dist/spec/catalogs/layouts/screenshot-walkthrough.json +1 -4
- package/dist/spec/catalogs/layouts/swimlane-process.json +1 -4
- package/dist/spec/catalogs/layouts/team-bio.json +1 -4
- package/dist/spec/catalogs/layouts/text-1x-box-title-center.json +31 -0
- package/dist/spec/catalogs/layouts/text-1x-box-title-left.json +31 -0
- package/dist/spec/catalogs/layouts/text-1x-center-box-title-center.json +31 -0
- package/dist/spec/catalogs/layouts/text-1x-center-box-title-left.json +31 -0
- package/dist/spec/catalogs/layouts/text-1x-center-box.json +26 -0
- package/dist/spec/catalogs/layouts/text-1x-center-title-center.json +30 -0
- package/dist/spec/catalogs/layouts/text-1x-center-title-left.json +30 -0
- package/dist/spec/catalogs/layouts/text-1x-center.json +25 -0
- package/dist/spec/catalogs/layouts/text-1x-left-box.json +26 -0
- package/dist/spec/catalogs/layouts/text-1x-title-center.json +30 -0
- package/dist/spec/catalogs/layouts/text-2x-box-title-center.json +37 -0
- package/dist/spec/catalogs/layouts/text-2x-box-vertical-title-left.json +37 -0
- package/dist/spec/catalogs/layouts/text-2x-center-box-title-center.json +37 -0
- package/dist/spec/catalogs/layouts/text-2x-center-box-vertical-title-left.json +37 -0
- package/dist/spec/catalogs/layouts/text-2x-center-box.json +32 -0
- package/dist/spec/catalogs/layouts/text-2x-center-title-center.json +36 -0
- package/dist/spec/catalogs/layouts/text-2x-center-vertical-title-left.json +36 -0
- package/dist/spec/catalogs/layouts/text-2x-center.json +31 -0
- package/dist/spec/catalogs/layouts/text-2x-left-box.json +32 -0
- package/dist/spec/catalogs/layouts/text-2x-title-center.json +36 -0
- package/dist/spec/catalogs/layouts/text-2x-vertical-title-left.json +36 -0
- package/dist/spec/catalogs/layouts/text-3x-box-title-center.json +40 -0
- package/dist/spec/catalogs/layouts/text-3x-box-vertical-title-left.json +41 -0
- package/dist/spec/catalogs/layouts/text-3x-center-box-title-center.json +40 -0
- package/dist/spec/catalogs/layouts/text-3x-center-box-vertical-title-left.json +41 -0
- package/dist/spec/catalogs/layouts/text-3x-center-box.json +35 -0
- package/dist/spec/catalogs/layouts/text-3x-center-title-center.json +39 -0
- package/dist/spec/catalogs/layouts/text-3x-center-vertical-title-left.json +40 -0
- package/dist/spec/catalogs/layouts/text-3x-center.json +34 -0
- package/dist/spec/catalogs/layouts/text-3x-left-box.json +35 -0
- package/dist/spec/catalogs/layouts/text-3x-left.json +34 -0
- package/dist/spec/catalogs/layouts/text-3x-title-center.json +39 -0
- package/dist/spec/catalogs/layouts/text-3x-vertical-title-left.json +40 -0
- package/dist/spec/catalogs/layouts/title-center-box.json +27 -0
- package/dist/spec/catalogs/layouts/title-center-image-bottom.json +34 -0
- package/dist/spec/catalogs/layouts/title-center-image-top.json +34 -0
- package/dist/spec/catalogs/layouts/title-center.json +26 -0
- package/dist/spec/catalogs/layouts/title-left-image-bottom.json +34 -0
- package/dist/spec/catalogs/layouts/title-left-image-left.json +34 -0
- package/dist/spec/catalogs/layouts/title-left-image-right.json +34 -0
- package/dist/spec/catalogs/layouts/title-left-image-top.json +34 -0
- package/dist/spec/catalogs/manifest.json +18 -18
- package/dist/spec/catalogs/narratives/heros-journey.json +1 -1
- package/dist/spec/catalogs/narratives/index.json +1 -1
- package/dist/spec/openapi.yaml +3 -3
- package/dist/spec/reference/engine-defaults.json +22 -30
- package/dist/spec/reference/engine-vocabularies.json +1577 -0
- package/dist/spec/schemas/audience.schema.json +5 -26
- package/dist/spec/schemas/catalog-manifest.schema.json +3 -3
- package/dist/spec/schemas/chart-type.schema.json +2 -35
- package/dist/spec/schemas/color-scheme.schema.json +3 -24
- package/dist/spec/schemas/finding.schema.json +1 -1
- package/dist/spec/schemas/font-scheme.schema.json +6 -37
- package/dist/spec/schemas/language.schema.json +7 -28
- package/dist/spec/schemas/layout.schema.json +56 -51
- package/dist/spec/schemas/narrative.schema.json +4 -24
- package/dist/spec/schemas/opf.schema.json +399 -368
- package/dist/spec/schemas/purpose.schema.json +5 -26
- package/dist/spec/schemas/social-platform.schema.json +2 -23
- package/dist/spec/schemas/theme.schema.json +9 -37
- package/dist/spec/schemas/tone.schema.json +4 -25
- package/dist/spec-files.d.ts +1 -1
- package/dist/spec-files.js +1 -1
- package/dist/types.d.ts +1125 -4
- package/dist/{validation-types-zh03LeZy.d.ts → validation-types-BOcY9GTs.d.ts} +7 -7
- package/dist/validator.d.ts +15 -12
- package/dist/validator.js +5 -5
- package/dist/yaml.d.ts +22 -7
- package/dist/yaml.js +10 -9
- package/package.json +5 -9
- package/dist/catalogs-D-yyQWCQ.d.ts +0 -1343
- package/dist/catalogs.d.ts +0 -2
- package/dist/catalogs.js +0 -2
- package/dist/chunk-PIQXLBBJ.js +0 -445
- package/dist/chunk-S5W34SIJ.js +0 -1
- package/dist/previews.d.ts +0 -40
- package/dist/previews.js +0 -1
- package/dist/schemas-DDpqAgyS.d.ts +0 -284
- package/dist/spec/catalogs/layouts/image-bleed.json +0 -20
package/dist/index.js
CHANGED
|
@@ -1,23 +1,312 @@
|
|
|
1
|
-
export { specFileEntries, specFileKinds, specFilePaths } from './chunk-
|
|
2
|
-
export {
|
|
3
|
-
export {
|
|
4
|
-
export {
|
|
5
|
-
export {
|
|
6
|
-
export {
|
|
7
|
-
export {
|
|
8
|
-
export {
|
|
9
|
-
|
|
10
|
-
import './chunk-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
export {
|
|
15
|
-
import './chunk-
|
|
16
|
-
|
|
17
|
-
export {
|
|
18
|
-
export { audience, chartType, colorScheme, fontScheme, language, layout, narrative, presentation, purpose, schemaEntries, schemaNames, schemas, socialPlatform, theme, tone } from './chunk-LS2FMPI5.js';
|
|
1
|
+
export { specFileEntries, specFileKinds, specFilePaths } from './chunk-HXHOZ7AH.js';
|
|
2
|
+
export { OPFDataImportError, importData, parseTabularData } from './chunk-U4J75TRG.js';
|
|
3
|
+
export { fromMarkdown, toMarkdown } from './chunk-3JG4YXWF.js';
|
|
4
|
+
export { OPFMarkdownError } from './chunk-3RKB4RDJ.js';
|
|
5
|
+
export { diff, merge } from './chunk-TWQJLI6E.js';
|
|
6
|
+
export { OPFPatchError, OPFPatchValidationError, applyPatch } from './chunk-5FTUIDUH.js';
|
|
7
|
+
export { OPFFormatError, format } from './chunk-ZPU46TFA.js';
|
|
8
|
+
export { OPFPaginationError, paginate, paginateSlide } from './chunk-UBFJ2QHH.js';
|
|
9
|
+
import './chunk-374R35TJ.js';
|
|
10
|
+
import './chunk-VGAOJEY7.js';
|
|
11
|
+
export { DEFAULT_CHART_PALETTE, DEFAULT_VALIDATION_THRESHOLDS, OPFValidationError, assertValid, assertValidCatalogRecord, findValidationRule, resolveSlideContext, validate, validateCatalogRecord, validationCategories, validationRules } from './chunk-QDI75P2M.js';
|
|
12
|
+
import { isRecord, visitContentPayloads, listVariables, resolveDesignRecords, resolveFontFamilies, resolveCanvasDimensions, imageBackground } from './chunk-O744SXXA.js';
|
|
13
|
+
export { CHART_TYPES, DEFAULT_VARIABLE_DATE_FORMAT, ENGINE_DEFAULT_CHART_TYPES, ENGINE_DEFAULT_COLOR_SCHEME, ENGINE_DEFAULT_FONT_SCHEME, ENGINE_DEFAULT_THEME, LANGUAGES, OPFVariableError, SOCIAL_PLATFORMS, VARIABLE_KINDS, chartNumber, coerceVariableValue, datasetDiagnostics, formatDataNumber, formatVariableNumber, fromExcelNumberFormat, hasContentVariables, inlineChartData, inlineDatasets, inlineTableData, isDatasetRef, isTemplate, isXYChartType, listBuiltinVariables, listVariables, normalizeLanguageFamily, numberFormatError, resolveChartData, resolveDesignRecords, resolveFontScheme, resolveTableData, resolveVariables, suggestChartNumberFix, tableCellDisplayValue, toExcelNumberFormat, unusedDatasets, variableDeclarations } from './chunk-O744SXXA.js';
|
|
14
|
+
export { catalogDisplayKinds, catalogSchemaNames } from './chunk-TRDXRRQK.js';
|
|
15
|
+
import { embeddedCopy, checkCatalogsOption, catalogReferenceSites, parseReference, catalogGroupDeclared, resolveReference, dottedPath, unresolvedReference, recordReferenceSites, catalogGroupSource, registeredCatalog, catalogKinds, CATALOG_GROUP_PATTERN } from './chunk-SPFV27O5.js';
|
|
16
|
+
export { CATALOG_GROUP_PATTERN, CATALOG_REFERENCE_PATTERN, OPFCatalogsOptionError, OPFUnresolvedReferenceError, catalogGroupSource, catalogKinds, catalogRecords, catalogReferenceSites, parseReference, resolveReference, unresolvedReference } from './chunk-SPFV27O5.js';
|
|
17
|
+
export { audience, chartType, colorScheme, fontScheme, language, layout, narrative, presentation, purpose, schemaEntries, schemaNames, schemas, socialPlatform, theme, tone } from './chunk-2CJPC4HI.js';
|
|
19
18
|
export { FONT_POLICY, applyFontPolicyDecisions, fontAvailabilityDiagnostics, fontPolicyFor } from './chunk-WXSPETQ6.js';
|
|
20
19
|
|
|
20
|
+
// src/catalog-helpers.ts
|
|
21
|
+
var isRec = (value) => typeof value === "object" && value !== null && !Array.isArray(value);
|
|
22
|
+
var rec = (value) => isRec(value) ? value : {};
|
|
23
|
+
function canonical(value) {
|
|
24
|
+
if (Array.isArray(value)) return `[${value.map(canonical).join(",")}]`;
|
|
25
|
+
if (isRec(value))
|
|
26
|
+
return `{${Object.keys(value).filter((key) => value[key] !== void 0).sort().map((key) => `${JSON.stringify(key)}:${canonical(value[key])}`).join(",")}}`;
|
|
27
|
+
return JSON.stringify(value);
|
|
28
|
+
}
|
|
29
|
+
function sameRecord(a, b) {
|
|
30
|
+
return canonical(embeddedCopy(a)) === canonical(embeddedCopy(b));
|
|
31
|
+
}
|
|
32
|
+
function setAt(root, path, value) {
|
|
33
|
+
let node = root;
|
|
34
|
+
for (const part of path.slice(0, -1)) node = node[part];
|
|
35
|
+
node[path[path.length - 1]] = value;
|
|
36
|
+
}
|
|
37
|
+
var kindsOf = (group, kind) => {
|
|
38
|
+
if (!isRec(group[kind])) group[kind] = {};
|
|
39
|
+
return group[kind];
|
|
40
|
+
};
|
|
41
|
+
function embed(document, options = {}) {
|
|
42
|
+
const catalogs = { catalogs: checkCatalogsOption(options.catalogs, "embed") };
|
|
43
|
+
const out = structuredClone(rec(document));
|
|
44
|
+
const added = [];
|
|
45
|
+
const unresolved = [];
|
|
46
|
+
const queue = catalogReferenceSites(out);
|
|
47
|
+
const reported = /* @__PURE__ */ new Set();
|
|
48
|
+
while (queue.length) {
|
|
49
|
+
const site = queue.shift();
|
|
50
|
+
const parsed = parseReference(site.reference);
|
|
51
|
+
if (parsed?.group !== void 0 && !catalogGroupDeclared(out, parsed.group)) continue;
|
|
52
|
+
const found = resolveReference(out, site.kind, site.reference, { ...catalogs, ...site.group !== void 0 ? { group: site.group } : {} });
|
|
53
|
+
if (!found) {
|
|
54
|
+
const path = dottedPath(site.path);
|
|
55
|
+
if (!reported.has(path)) {
|
|
56
|
+
reported.add(path);
|
|
57
|
+
unresolved.push(unresolvedReference(out, site.kind, site.reference, path, catalogs));
|
|
58
|
+
}
|
|
59
|
+
continue;
|
|
60
|
+
}
|
|
61
|
+
if (found.origin === "document") continue;
|
|
62
|
+
if (!isRec(out.catalogs)) out.catalogs = {};
|
|
63
|
+
const groups = out.catalogs;
|
|
64
|
+
if (!isRec(groups[found.group])) groups[found.group] = {};
|
|
65
|
+
const group = groups[found.group];
|
|
66
|
+
if (found.group !== "custom" && typeof group.source !== "string" && found.source !== void 0) {
|
|
67
|
+
const rest = { ...group };
|
|
68
|
+
for (const key of Object.keys(group)) delete group[key];
|
|
69
|
+
Object.assign(group, { source: found.source }, rest);
|
|
70
|
+
}
|
|
71
|
+
const copy = embeddedCopy(found.record);
|
|
72
|
+
kindsOf(group, site.kind)[found.id] = copy;
|
|
73
|
+
added.push({ group: found.group, kind: site.kind, id: found.id, ...found.source !== void 0 ? { source: found.source } : {} });
|
|
74
|
+
queue.push(...recordReferenceSites(site.kind, copy, ["catalogs", found.group, site.kind, found.id], found.group));
|
|
75
|
+
}
|
|
76
|
+
return { document: out, added, unresolved };
|
|
77
|
+
}
|
|
78
|
+
function groupNameFor(source) {
|
|
79
|
+
const base = source.startsWith("pkg:") ? source.slice(4).replace(/^@/, "").split("/").slice(0, 2).join("-") : (() => {
|
|
80
|
+
try {
|
|
81
|
+
return new URL(source).hostname.replace(/^www\./, "");
|
|
82
|
+
} catch {
|
|
83
|
+
return source;
|
|
84
|
+
}
|
|
85
|
+
})();
|
|
86
|
+
const name = base.toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/^-+|-+$/g, "");
|
|
87
|
+
return /^[a-z]/.test(name) ? name : `catalog-${name || "source"}`;
|
|
88
|
+
}
|
|
89
|
+
function copySlides(from, to, indexes, options = {}) {
|
|
90
|
+
const catalogs = { catalogs: checkCatalogsOption(options.catalogs, "copySlides") };
|
|
91
|
+
const source = rec(from);
|
|
92
|
+
const target = structuredClone(rec(to));
|
|
93
|
+
const sourceSlides = Array.isArray(source.slides) ? source.slides : [];
|
|
94
|
+
const targetSlides = Array.isArray(target.slides) ? target.slides : [];
|
|
95
|
+
for (const index of indexes)
|
|
96
|
+
if (!Number.isInteger(index) || index < 0 || index >= sourceSlides.length) throw new RangeError(`Slide index ${String(index)} is outside the source presentation's ${sourceSlides.length} slides.`);
|
|
97
|
+
const at = options.at ?? targetSlides.length;
|
|
98
|
+
if (!Number.isInteger(at) || at < 0 || at > targetSlides.length) throw new RangeError(`Insertion index ${String(at)} is outside the target presentation's ${targetSlides.length + 1} positions.`);
|
|
99
|
+
const renamed = [];
|
|
100
|
+
const addedGroups = [];
|
|
101
|
+
const added = [];
|
|
102
|
+
const unresolved = [];
|
|
103
|
+
const hadCatalogs = isRec(target.catalogs);
|
|
104
|
+
const groups = () => {
|
|
105
|
+
if (!isRec(target.catalogs)) target.catalogs = {};
|
|
106
|
+
return target.catalogs;
|
|
107
|
+
};
|
|
108
|
+
const memo = /* @__PURE__ */ new Map();
|
|
109
|
+
const targetGroupFor = (catalogSource, sourceGroupName) => {
|
|
110
|
+
for (const [name2, value] of Object.entries(rec(target.catalogs))) if (name2 !== "custom" && isRec(value) && value.source === catalogSource) return name2;
|
|
111
|
+
if (rec(target.catalogs).default !== false && catalogGroupSource(target, "default", catalogs) === catalogSource) return "default";
|
|
112
|
+
let name = sourceGroupName === "default" || sourceGroupName === "custom" ? groupNameFor(catalogSource) : sourceGroupName;
|
|
113
|
+
for (let n = 2; catalogGroupDeclared(target, name) || name === "default" || name === "custom"; n++) name = `${sourceGroupName === "default" ? groupNameFor(catalogSource) : sourceGroupName}-${n}`;
|
|
114
|
+
groups()[name] = { source: catalogSource };
|
|
115
|
+
addedGroups.push({ name, source: catalogSource });
|
|
116
|
+
return name;
|
|
117
|
+
};
|
|
118
|
+
const bareTaken = (kind, id) => resolveReference(target, kind, id, catalogs) !== void 0;
|
|
119
|
+
const addCustom = (kind, wanted, record, renamed2 = false) => {
|
|
120
|
+
const custom = rec(rec(target.catalogs).custom);
|
|
121
|
+
const existing = rec(custom[kind]);
|
|
122
|
+
for (const [id2, value] of Object.entries(existing)) if ((!renamed2 && id2 === wanted || /^-\d+$/.test(id2.slice(wanted.length))) && id2.startsWith(wanted) && sameRecord(value, record)) return { id: id2, reused: true };
|
|
123
|
+
let n = renamed2 ? 2 : 1;
|
|
124
|
+
let id = renamed2 ? `${wanted}-2` : wanted;
|
|
125
|
+
while (Object.hasOwn(existing, id) || bareTaken(kind, id)) id = `${wanted}-${++n}`;
|
|
126
|
+
if (!isRec(groups().custom)) groups().custom = {};
|
|
127
|
+
kindsOf(groups().custom, kind)[id] = record;
|
|
128
|
+
added.push({ group: "custom", kind, id });
|
|
129
|
+
return { id, reused: false };
|
|
130
|
+
};
|
|
131
|
+
const referenceTo = (kind, group, id, holder) => {
|
|
132
|
+
const found = resolveReference(target, kind, id, { ...catalogs, ...holder !== void 0 ? { group: holder } : {} });
|
|
133
|
+
return found && found.group === group && found.id === id ? id : `${group}:${id}`;
|
|
134
|
+
};
|
|
135
|
+
const place = (kind, reference2, path, holder) => {
|
|
136
|
+
const found = resolveReference(source, kind, reference2, { ...catalogs, ...holder !== void 0 ? { group: holder } : {} });
|
|
137
|
+
if (!found) {
|
|
138
|
+
unresolved.push(unresolvedReference(source, kind, reference2, path, catalogs));
|
|
139
|
+
return void 0;
|
|
140
|
+
}
|
|
141
|
+
const key = `${kind}\0${found.group}\0${found.source ?? ""}\0${found.id}`;
|
|
142
|
+
const known = memo.get(key);
|
|
143
|
+
if (known) return known;
|
|
144
|
+
const incoming = embeddedCopy(found.record);
|
|
145
|
+
const catalogSource = found.group === "custom" ? void 0 : found.source;
|
|
146
|
+
const group = catalogSource === void 0 ? "custom" : targetGroupFor(catalogSource, found.group);
|
|
147
|
+
const inner = recordReferenceSites(kind, incoming, []).map((site) => ({ site, placed: place(site.kind, site.reference, `${path} -> ${site.path.join(".")}`, found.group) }));
|
|
148
|
+
const rewrite = (holderGroup) => {
|
|
149
|
+
const copy = structuredClone(incoming);
|
|
150
|
+
for (const { site, placed: placed2 } of inner) if (placed2) setAt(copy, site.path, referenceTo(site.kind, placed2.group, placed2.id, holderGroup));
|
|
151
|
+
return copy;
|
|
152
|
+
};
|
|
153
|
+
let placed;
|
|
154
|
+
if (group === "custom") {
|
|
155
|
+
const result = addCustom(kind, found.id, rewrite("custom"));
|
|
156
|
+
if (result.id !== found.id && !result.reused) renamed.push({ kind, from: reference2, to: result.id, reason: "custom-conflict" });
|
|
157
|
+
placed = { group: "custom", id: result.id };
|
|
158
|
+
} else {
|
|
159
|
+
const record = rewrite(group);
|
|
160
|
+
const embedded = rec(rec(rec(target.catalogs)[group])[kind]);
|
|
161
|
+
const current = Object.hasOwn(embedded, found.id) ? embedded[found.id] : registeredCatalog(catalogGroupSource(target, group, catalogs), catalogs)?.[kind]?.[found.id];
|
|
162
|
+
if (current === void 0 || sameRecord(current, record)) {
|
|
163
|
+
if (!Object.hasOwn(embedded, found.id)) {
|
|
164
|
+
if (!isRec(groups()[group])) groups()[group] = {};
|
|
165
|
+
const holder2 = groups()[group];
|
|
166
|
+
if (typeof holder2.source !== "string" && catalogSource !== void 0) {
|
|
167
|
+
const rest = { ...holder2 };
|
|
168
|
+
for (const key2 of Object.keys(holder2)) delete holder2[key2];
|
|
169
|
+
Object.assign(holder2, { source: catalogSource }, rest);
|
|
170
|
+
}
|
|
171
|
+
kindsOf(holder2, kind)[found.id] = record;
|
|
172
|
+
added.push({ group, kind, id: found.id, ...catalogSource !== void 0 ? { source: catalogSource } : {} });
|
|
173
|
+
}
|
|
174
|
+
placed = { group, id: found.id };
|
|
175
|
+
} else {
|
|
176
|
+
const { id, reused } = addCustom(kind, found.id, rewrite("custom"), true);
|
|
177
|
+
if (!reused) renamed.push({ kind, from: reference2, to: id, reason: "catalog-revision" });
|
|
178
|
+
placed = { group: "custom", id };
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
memo.set(key, placed);
|
|
182
|
+
return placed;
|
|
183
|
+
};
|
|
184
|
+
const copied = [];
|
|
185
|
+
for (const index of indexes) {
|
|
186
|
+
const slide = structuredClone(sourceSlides[index]);
|
|
187
|
+
const holder = { slides: [slide] };
|
|
188
|
+
for (const site of catalogReferenceSites(holder, { records: false })) {
|
|
189
|
+
const placed = place(site.kind, site.reference, `slides.${index}.${site.path.slice(2).join(".")}`);
|
|
190
|
+
if (placed) setAt(holder, site.path, referenceTo(site.kind, placed.group, placed.id));
|
|
191
|
+
}
|
|
192
|
+
copied.push(holder.slides[0]);
|
|
193
|
+
}
|
|
194
|
+
targetSlides.splice(at, 0, ...copied);
|
|
195
|
+
target.slides = targetSlides;
|
|
196
|
+
if (!hadCatalogs && isRec(target.catalogs) && Object.keys(target.catalogs).length === 0) delete target.catalogs;
|
|
197
|
+
return { document: target, slides: copied.map((_, offset) => at + offset), renamed, addedGroups, added, unresolved };
|
|
198
|
+
}
|
|
199
|
+
var pointerPart = (part) => part.replaceAll("~", "~0").replaceAll("/", "~1");
|
|
200
|
+
function updateFromCatalog(document, catalogs, refs) {
|
|
201
|
+
const options = { catalogs: checkCatalogsOption(catalogs, "updateFromCatalog") };
|
|
202
|
+
const groups = rec(rec(document).catalogs);
|
|
203
|
+
const wanted = refs?.map((ref) => {
|
|
204
|
+
const parsed = parseReference(ref.reference);
|
|
205
|
+
return parsed ? { kind: ref.kind, group: parsed.group ?? "default", id: parsed.id } : void 0;
|
|
206
|
+
});
|
|
207
|
+
const changes = [];
|
|
208
|
+
for (const [group, value] of Object.entries(groups)) {
|
|
209
|
+
if (group === "custom" || !isRec(value)) continue;
|
|
210
|
+
const catalogSource = catalogGroupSource(document, group, options);
|
|
211
|
+
const registered = registeredCatalog(catalogSource, options);
|
|
212
|
+
if (!registered || catalogSource === void 0) continue;
|
|
213
|
+
for (const kind of catalogKinds)
|
|
214
|
+
for (const [id, embedded] of Object.entries(rec(value[kind]))) {
|
|
215
|
+
if (wanted && !wanted.some((entry) => entry && entry.kind === kind && entry.group === group && entry.id === id)) continue;
|
|
216
|
+
const current = registered[kind]?.[id];
|
|
217
|
+
if (current === void 0 || sameRecord(embedded, current)) continue;
|
|
218
|
+
changes.push({ kind, reference: group === "default" ? id : `${group}:${id}`, group, id, source: catalogSource, embedded: rec(embedded), current: embeddedCopy(current) });
|
|
219
|
+
}
|
|
220
|
+
}
|
|
221
|
+
return {
|
|
222
|
+
changes,
|
|
223
|
+
patch: changes.map((change) => ({ op: "replace", path: `/catalogs/${pointerPart(change.group)}/${change.kind}/${pointerPart(change.id)}`, value: change.current }))
|
|
224
|
+
};
|
|
225
|
+
}
|
|
226
|
+
var OPFMoveToCustomError = class extends Error {
|
|
227
|
+
code;
|
|
228
|
+
constructor(code, message) {
|
|
229
|
+
super(message);
|
|
230
|
+
this.name = "OPFMoveToCustomError";
|
|
231
|
+
this.code = code;
|
|
232
|
+
}
|
|
233
|
+
};
|
|
234
|
+
var pointerOf = (path) => `/${path.map((part) => pointerPart(String(part))).join("/")}`;
|
|
235
|
+
function moveToCustom(document, ref, options = {}) {
|
|
236
|
+
const catalogs = { catalogs: checkCatalogsOption(options.catalogs, "moveToCustom") };
|
|
237
|
+
const parsed = parseReference(ref.reference);
|
|
238
|
+
if (!parsed || !catalogKinds.includes(ref.kind)) throw new OPFMoveToCustomError("invalid-reference", `moveToCustom: ${JSON.stringify(ref.reference)} is not a ${String(ref.kind)} reference (an id or name:id).`);
|
|
239
|
+
const { kind } = ref;
|
|
240
|
+
const fromGroup = parsed.group ?? "default";
|
|
241
|
+
if (fromGroup === "custom") throw new OPFMoveToCustomError("already-custom", `moveToCustom: ${ref.reference} already names a record of catalogs.custom.`);
|
|
242
|
+
const before = rec(document);
|
|
243
|
+
const records = rec(rec(rec(before.catalogs)[fromGroup])[kind]);
|
|
244
|
+
if (!Object.hasOwn(records, parsed.id)) throw new OPFMoveToCustomError("not-embedded", `moveToCustom: catalogs.${fromGroup}.${kind} does not embed ${JSON.stringify(parsed.id)}.`);
|
|
245
|
+
const fromId = parsed.id;
|
|
246
|
+
const record = rec(records[fromId]);
|
|
247
|
+
const sites = catalogReferenceSites(before);
|
|
248
|
+
const targets = sites.map((site) => resolveReference(before, site.kind, site.reference, { ...catalogs, ...site.group !== void 0 ? { group: site.group } : {} }));
|
|
249
|
+
const isMoved = (found) => found?.origin === "document" && found.kind === kind && found.group === fromGroup && found.id === fromId;
|
|
250
|
+
const inMoved = (site) => site.path.length >= 4 && site.path[0] === "catalogs" && site.path[1] === fromGroup && site.path[2] === kind && site.path[3] === fromId;
|
|
251
|
+
const after = structuredClone(before);
|
|
252
|
+
const groups = after.catalogs;
|
|
253
|
+
const custom = rec(groups.custom);
|
|
254
|
+
const existing = rec(custom[kind]);
|
|
255
|
+
const moved = structuredClone(record);
|
|
256
|
+
const ownSites = sites.map((site, index) => ({ site, found: targets[index] })).filter(({ site }) => inMoved(site));
|
|
257
|
+
if (options.id !== void 0 && (typeof options.id !== "string" || !CATALOG_GROUP_PATTERN.test(options.id))) throw new OPFMoveToCustomError("invalid-id", `moveToCustom: the new id ${JSON.stringify(options.id)} is not a lowercase kebab-case id.`);
|
|
258
|
+
const wanted = options.id ?? fromId;
|
|
259
|
+
let toId = wanted;
|
|
260
|
+
for (let n = 2; Object.hasOwn(existing, toId) && !sameRecord(existing[toId], moved); n++) toId = `${wanted}-${n}`;
|
|
261
|
+
const reused = Object.hasOwn(existing, toId);
|
|
262
|
+
const patch = [];
|
|
263
|
+
const fromRecords = groups[fromGroup][kind];
|
|
264
|
+
delete fromRecords[fromId];
|
|
265
|
+
patch.push({ op: "remove", path: pointerOf(["catalogs", fromGroup, kind, fromId]) });
|
|
266
|
+
if (Object.keys(fromRecords).length === 0) {
|
|
267
|
+
delete groups[fromGroup][kind];
|
|
268
|
+
patch.push({ op: "remove", path: pointerOf(["catalogs", fromGroup, kind]) });
|
|
269
|
+
}
|
|
270
|
+
if (!isRec(groups.custom)) {
|
|
271
|
+
groups.custom = {};
|
|
272
|
+
patch.push({ op: "add", path: pointerOf(["catalogs", "custom"]), value: {} });
|
|
273
|
+
}
|
|
274
|
+
if (!isRec(groups.custom[kind])) {
|
|
275
|
+
groups.custom[kind] = {};
|
|
276
|
+
patch.push({ op: "add", path: pointerOf(["catalogs", "custom", kind]), value: {} });
|
|
277
|
+
}
|
|
278
|
+
const referenceTo = (targetKind, group, id, holder) => {
|
|
279
|
+
const found = resolveReference(after, targetKind, id, { ...catalogs, ...holder !== void 0 ? { group: holder } : {} });
|
|
280
|
+
return found && found.group === group && found.id === id ? id : `${group}:${id}`;
|
|
281
|
+
};
|
|
282
|
+
if (!reused) {
|
|
283
|
+
groups.custom[kind][toId] = moved;
|
|
284
|
+
for (const { site, found } of ownSites) {
|
|
285
|
+
if (!found) continue;
|
|
286
|
+
const target = isMoved(found) ? { group: "custom", id: toId } : { group: found.group, id: found.id };
|
|
287
|
+
setAt(moved, site.path.slice(4), referenceTo(site.kind, target.group, target.id, "custom"));
|
|
288
|
+
}
|
|
289
|
+
patch.push({ op: "add", path: pointerOf(["catalogs", "custom", kind, toId]), value: structuredClone(moved) });
|
|
290
|
+
}
|
|
291
|
+
const references = [];
|
|
292
|
+
sites.forEach((site, index) => {
|
|
293
|
+
if (inMoved(site) || !isMoved(targets[index])) return;
|
|
294
|
+
const written = referenceTo(kind, "custom", toId, site.group);
|
|
295
|
+
if (written === site.reference) return;
|
|
296
|
+
setAt(after, site.path, written);
|
|
297
|
+
references.push(pointerOf(site.path));
|
|
298
|
+
patch.push({ op: "replace", path: pointerOf(site.path), value: written });
|
|
299
|
+
});
|
|
300
|
+
return {
|
|
301
|
+
document: after,
|
|
302
|
+
from: { kind, group: fromGroup, id: fromId, reference: fromGroup === "default" ? fromId : `${fromGroup}:${fromId}` },
|
|
303
|
+
to: { kind, group: "custom", id: toId, reference: toId },
|
|
304
|
+
references,
|
|
305
|
+
patch,
|
|
306
|
+
...toId !== wanted ? { renamed: { from: wanted, to: toId } } : {}
|
|
307
|
+
};
|
|
308
|
+
}
|
|
309
|
+
|
|
21
310
|
// src/stats.ts
|
|
22
311
|
var DEFAULT_WORDS_PER_MINUTE = 130;
|
|
23
312
|
var KIND_ORDER = ["text", "items", "bullets", "quote", "metric", "code", "timeline", "chart", "table", "image", "video"];
|
|
@@ -55,20 +344,12 @@ var embeddedBytes = (src) => {
|
|
|
55
344
|
return Math.max(0, Math.floor(payload.length * 3 / 4) - padding);
|
|
56
345
|
};
|
|
57
346
|
var srcOf = (asset) => typeof asset === "string" ? asset : isRecord(asset) && typeof asset.src === "string" ? asset.src : void 0;
|
|
58
|
-
|
|
59
|
-
const inline = deck.catalogs?.[kind]?.records;
|
|
60
|
-
const found = (Array.isArray(inline) ? inline : []).find((record) => record?.id === id) ?? catalogs[kind].find((record) => record.id === id);
|
|
61
|
-
return isRecord(found) ? found : void 0;
|
|
62
|
-
};
|
|
63
|
-
var themeRecord = (deck, value) => {
|
|
64
|
-
if (typeof value === "string") return lookup(deck, "themes", value) ?? {};
|
|
65
|
-
if (isRecord(value)) return { ...typeof value.id === "string" ? lookup(deck, "themes", value.id) : void 0, ...value };
|
|
66
|
-
return {};
|
|
67
|
-
};
|
|
68
|
-
function slideSize(deck) {
|
|
347
|
+
function slideSize(deck, catalogs) {
|
|
69
348
|
const design = isRecord(deck.design) ? deck.design : {};
|
|
70
|
-
const
|
|
71
|
-
const
|
|
349
|
+
const records = resolveDesignRecords(deck, void 0, catalogs);
|
|
350
|
+
const theme2 = records.theme;
|
|
351
|
+
const themed = typeof design.theme === "string" && !records.diagnostics.some((diagnostic) => diagnostic.kind === "themes");
|
|
352
|
+
const source = design.dimensions !== void 0 ? "design" : themed && theme2.dimensions !== void 0 ? "theme" : "default";
|
|
72
353
|
const dimensions = design.dimensions ?? theme2.dimensions;
|
|
73
354
|
let width = 40 / 3, height = 7.5;
|
|
74
355
|
try {
|
|
@@ -110,6 +391,7 @@ function visitRuns(value, visit) {
|
|
|
110
391
|
}
|
|
111
392
|
}
|
|
112
393
|
function stats(presentation2, options = {}) {
|
|
394
|
+
const catalogs = { catalogs: checkCatalogsOption(options.catalogs, "stats") };
|
|
113
395
|
if (!isRecord(presentation2)) throw new TypeError("stats needs a presentation object.");
|
|
114
396
|
const deck = presentation2;
|
|
115
397
|
const wordsPerMinute = options.wordsPerMinute ?? DEFAULT_WORDS_PER_MINUTE;
|
|
@@ -178,8 +460,9 @@ function stats(presentation2, options = {}) {
|
|
|
178
460
|
return srcOf(value) !== void 0;
|
|
179
461
|
};
|
|
180
462
|
const backgroundImage = (value) => {
|
|
181
|
-
|
|
182
|
-
|
|
463
|
+
const picture = imageBackground(value);
|
|
464
|
+
if (!picture) return false;
|
|
465
|
+
useAsset(picture.src);
|
|
183
466
|
return true;
|
|
184
467
|
};
|
|
185
468
|
const furnitureImages = (value) => {
|
|
@@ -193,7 +476,7 @@ function stats(presentation2, options = {}) {
|
|
|
193
476
|
}
|
|
194
477
|
};
|
|
195
478
|
const designAssets = (value, scope) => {
|
|
196
|
-
if (!isRecord(value)) return
|
|
479
|
+
if (!isRecord(value)) return;
|
|
197
480
|
logoImages(value.logo);
|
|
198
481
|
if (watermarkOf(value.watermark)) {
|
|
199
482
|
if (scope === "deck") images.watermarks.deck = true;
|
|
@@ -205,7 +488,6 @@ function stats(presentation2, options = {}) {
|
|
|
205
488
|
}
|
|
206
489
|
furnitureImages(value.header);
|
|
207
490
|
furnitureImages(value.footer);
|
|
208
|
-
return contentImage(value.slideImage);
|
|
209
491
|
};
|
|
210
492
|
const organizations = list(deck.organization).filter(isRecord).map((entry) => {
|
|
211
493
|
const hasLogo = srcOf(entry.logo) !== void 0;
|
|
@@ -232,7 +514,7 @@ function stats(presentation2, options = {}) {
|
|
|
232
514
|
filename: str(deck.filename),
|
|
233
515
|
author: list(deck.author).filter((entry) => typeof entry === "string"),
|
|
234
516
|
language: reference(deck.language),
|
|
235
|
-
slideSize: slideSize(deck),
|
|
517
|
+
slideSize: slideSize(deck, catalogs),
|
|
236
518
|
template: deck.template === true,
|
|
237
519
|
tags: Array.isArray(deck.tags) ? deck.tags.filter((tag) => typeof tag === "string") : [],
|
|
238
520
|
takeaways: list(deck.takeaway).filter((entry) => typeof entry === "string").length,
|
|
@@ -246,7 +528,7 @@ function stats(presentation2, options = {}) {
|
|
|
246
528
|
const datasetRecords = isRecord(deck.datasets) ? Object.entries(deck.datasets).filter(([, value]) => isRecord(value)) : [];
|
|
247
529
|
const datasetUse = /* @__PURE__ */ new Map();
|
|
248
530
|
const payloadCounts = { text: 0, items: 0, bullets: 0, quote: 0, metric: 0, code: 0, timeline: 0, chart: 0, table: 0, image: 0, video: 0, blocks: 0, regions: 0, groups: 0, maxDepth: 0 };
|
|
249
|
-
const
|
|
531
|
+
const layouts = /* @__PURE__ */ new Map(), chartTypes = /* @__PURE__ */ new Map(), extensions = /* @__PURE__ */ new Set();
|
|
250
532
|
const chartData = { inline: 0, dataset: 0, source: 0 };
|
|
251
533
|
const tableItems = [];
|
|
252
534
|
let tableRows = 0, tableColumns = 0, datasetBackedTables = 0, chartTotal = 0, captions = 0;
|
|
@@ -256,9 +538,7 @@ function stats(presentation2, options = {}) {
|
|
|
256
538
|
const total = { citations: 0, footnotes: 0, links: 0, cited: /* @__PURE__ */ new Set(), families: /* @__PURE__ */ new Set() };
|
|
257
539
|
const perSlide = [];
|
|
258
540
|
const contentPerSlide = [];
|
|
259
|
-
const
|
|
260
|
-
const deckTheme = themeRecord(deck, design.theme ?? "minimal");
|
|
261
|
-
schemeReferences.push(design.fontScheme ?? deckTheme.fontScheme ?? DEFAULT_FONT_SCHEME);
|
|
541
|
+
const schemeDesigns = [void 0];
|
|
262
542
|
slides.forEach((slide, index) => {
|
|
263
543
|
const id = str(slide.id);
|
|
264
544
|
const ref = { index, id };
|
|
@@ -334,7 +614,7 @@ function stats(presentation2, options = {}) {
|
|
|
334
614
|
if (isRecord(node.chart)) {
|
|
335
615
|
chartTotal++;
|
|
336
616
|
slideCharts++;
|
|
337
|
-
bump(
|
|
617
|
+
bump(chartTypes, str(node.chart.type) ?? "unknown");
|
|
338
618
|
const data = node.chart.data;
|
|
339
619
|
if (isRecord(data)) {
|
|
340
620
|
if (typeof data.dataset === "string") {
|
|
@@ -397,7 +677,7 @@ function stats(presentation2, options = {}) {
|
|
|
397
677
|
if (slide.beat !== void 0) withBeat++;
|
|
398
678
|
if (slide.hidden === true) hidden.push(ref);
|
|
399
679
|
const layout2 = str(slide.layout);
|
|
400
|
-
if (layout2) bump(
|
|
680
|
+
if (layout2) bump(layouts, layout2);
|
|
401
681
|
else withoutLayout++;
|
|
402
682
|
const section = str(slide.section);
|
|
403
683
|
if (section !== null && section !== "") {
|
|
@@ -407,13 +687,12 @@ function stats(presentation2, options = {}) {
|
|
|
407
687
|
} else unsectioned++;
|
|
408
688
|
if (slideDesign) {
|
|
409
689
|
withOwnDesign++;
|
|
410
|
-
|
|
690
|
+
designAssets(slideDesign, "slide");
|
|
411
691
|
for (const kind of ["header", "footer"]) {
|
|
412
692
|
if (slideDesign[kind] === false) headerOverrides[`${kind}Suppressed`]++;
|
|
413
693
|
else if (isRecord(slideDesign[kind])) headerOverrides[kind]++;
|
|
414
694
|
}
|
|
415
|
-
if (slideDesign.fontScheme !== void 0)
|
|
416
|
-
else if (slideDesign.theme !== void 0 && design.fontScheme === void 0) schemeReferences.push(themeRecord(deck, slideDesign.theme).fontScheme ?? DEFAULT_FONT_SCHEME);
|
|
695
|
+
if (slideDesign.fontScheme !== void 0 || slideDesign.theme !== void 0 && design.fontScheme === void 0) schemeDesigns.push(index);
|
|
417
696
|
}
|
|
418
697
|
if (options.perSlide)
|
|
419
698
|
perSlide.push({
|
|
@@ -459,24 +738,26 @@ function stats(presentation2, options = {}) {
|
|
|
459
738
|
unused: variables.filter((variable) => variable.uses.length === 0).map((variable) => variable.id)
|
|
460
739
|
};
|
|
461
740
|
const families = new Set(total.families), schemeIds = /* @__PURE__ */ new Set(), unresolved = /* @__PURE__ */ new Set();
|
|
462
|
-
const addScheme = (
|
|
463
|
-
const resolved =
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
const scheme = resolved.scheme;
|
|
741
|
+
const addScheme = (slideIndex) => {
|
|
742
|
+
const resolved = resolveDesignRecords(deck, slideIndex, catalogs);
|
|
743
|
+
for (const diagnostic of resolved.diagnostics) if (diagnostic.kind === "fontSchemes") unresolved.add(diagnostic.reference);
|
|
744
|
+
if (resolved.fontSchemeReference !== void 0) schemeIds.add(resolved.fontSchemeReference);
|
|
745
|
+
const scheme = resolved.fontScheme;
|
|
468
746
|
const named = resolveFontFamilies(scheme);
|
|
469
747
|
families.add(named.heading);
|
|
470
748
|
families.add(named.body);
|
|
471
749
|
if (scheme.code !== void 0) families.add(named.code);
|
|
472
750
|
if (named.accent) families.add(named.accent);
|
|
473
751
|
};
|
|
474
|
-
for (const entry of
|
|
475
|
-
const
|
|
752
|
+
for (const entry of schemeDesigns) addScheme(entry);
|
|
753
|
+
const catalogGroups = {};
|
|
476
754
|
if (isRecord(deck.catalogs))
|
|
477
|
-
for (const
|
|
478
|
-
const entry = deck.catalogs[
|
|
479
|
-
if (isRecord(entry))
|
|
755
|
+
for (const group of Object.keys(deck.catalogs).sort()) {
|
|
756
|
+
const entry = deck.catalogs[group];
|
|
757
|
+
if (!isRecord(entry)) continue;
|
|
758
|
+
const records = {};
|
|
759
|
+
for (const kind of catalogKinds) if (isRecord(entry[kind])) records[kind] = Object.keys(entry[kind]).length;
|
|
760
|
+
catalogGroups[group] = { source: str(entry.source), records };
|
|
480
761
|
}
|
|
481
762
|
const colorVariables = variables.filter((variable) => variable.kind === "color").map((variable) => ({ id: variable.id, value: typeof variable.value === "string" ? variable.value : null, uses: variable.uses.length }));
|
|
482
763
|
const contentMean = slides.length ? decimals(contentWords / slides.length, 1) : 0;
|
|
@@ -491,7 +772,7 @@ function stats(presentation2, options = {}) {
|
|
|
491
772
|
withBeat,
|
|
492
773
|
sections,
|
|
493
774
|
unsectioned,
|
|
494
|
-
layouts: sortedCounts(
|
|
775
|
+
layouts: sortedCounts(layouts),
|
|
495
776
|
withoutLayout,
|
|
496
777
|
withOwnDesign
|
|
497
778
|
},
|
|
@@ -505,7 +786,7 @@ function stats(presentation2, options = {}) {
|
|
|
505
786
|
notes: { withNotes, withoutNotes },
|
|
506
787
|
speakingTime: { basis: "estimate", wordsPerMinute, notesWords, minutes: decimals(notesWords / wordsPerMinute, 1), declaredMinutes: deckFacts.declaredMinutes },
|
|
507
788
|
images,
|
|
508
|
-
charts: { total: chartTotal, byType: sortedCounts(
|
|
789
|
+
charts: { total: chartTotal, byType: sortedCounts(chartTypes), data: chartData },
|
|
509
790
|
tables: { total: tableItems.length, datasetBacked: datasetBackedTables, rows: tableRows, columns: tableColumns, items: tableItems },
|
|
510
791
|
datasets: { count: datasetItems.length, withSource: datasetItems.filter((item) => item.source !== null).length, items: datasetItems },
|
|
511
792
|
citations: { references: references.length, cited, citations: total.citations, footnotes: total.footnotes, captions, links: total.links },
|
|
@@ -519,208 +800,10 @@ function stats(presentation2, options = {}) {
|
|
|
519
800
|
fonts: { families: sorted(families), schemeIds: sorted(schemeIds), unresolvedSchemeIds: sorted(unresolved), runOverrides: sorted(total.families) },
|
|
520
801
|
colors: { variables: colorVariables },
|
|
521
802
|
extensions: sorted(extensions),
|
|
522
|
-
|
|
803
|
+
catalogs: catalogGroups
|
|
523
804
|
};
|
|
524
805
|
if (options.perSlide) result.perSlide = perSlide;
|
|
525
806
|
return result;
|
|
526
807
|
}
|
|
527
808
|
|
|
528
|
-
|
|
529
|
-
function reportKey(kind, id) {
|
|
530
|
-
return `${kind}:${id}`;
|
|
531
|
-
}
|
|
532
|
-
function referenceId(value) {
|
|
533
|
-
if (typeof value === "string" && bareIdPattern.test(value)) return value;
|
|
534
|
-
if (isRecord(value) && typeof value.id === "string" && bareIdPattern.test(value.id)) return value.id;
|
|
535
|
-
return void 0;
|
|
536
|
-
}
|
|
537
|
-
function addReference(collector, kind, value, reportable) {
|
|
538
|
-
const id = referenceId(value);
|
|
539
|
-
if (!id) return;
|
|
540
|
-
if (reportable) collector.reportable.add(reportKey(kind, id));
|
|
541
|
-
let ids = collector.referenced.get(kind);
|
|
542
|
-
if (!ids) {
|
|
543
|
-
ids = /* @__PURE__ */ new Set();
|
|
544
|
-
collector.referenced.set(kind, ids);
|
|
545
|
-
}
|
|
546
|
-
if (ids.has(id)) return;
|
|
547
|
-
ids.add(id);
|
|
548
|
-
collector.queue.push({ kind, id });
|
|
549
|
-
}
|
|
550
|
-
function collectDesignReferences(collector, design) {
|
|
551
|
-
if (!isRecord(design)) return;
|
|
552
|
-
addReference(collector, "themes", design.theme, true);
|
|
553
|
-
addReference(collector, "colorSchemes", design.colorScheme, true);
|
|
554
|
-
addReference(collector, "fontSchemes", design.fontScheme, true);
|
|
555
|
-
if (isRecord(design.theme)) {
|
|
556
|
-
addReference(collector, "colorSchemes", design.theme.colorScheme, true);
|
|
557
|
-
addReference(collector, "fontSchemes", design.theme.fontScheme, true);
|
|
558
|
-
}
|
|
559
|
-
}
|
|
560
|
-
function collectChartReference(collector, payload) {
|
|
561
|
-
if (!isRecord(payload.chart)) return;
|
|
562
|
-
addReference(collector, "chartTypes", payload.chart.type, typeof payload.chart.type === "string");
|
|
563
|
-
}
|
|
564
|
-
function collectSocialReferences(collector, holder) {
|
|
565
|
-
const entries = Array.isArray(holder) ? holder : [holder];
|
|
566
|
-
for (const entry of entries) {
|
|
567
|
-
if (!isRecord(entry) || !isRecord(entry.socials)) continue;
|
|
568
|
-
for (const key of Object.keys(entry.socials)) addReference(collector, "socialPlatforms", key, false);
|
|
569
|
-
}
|
|
570
|
-
}
|
|
571
|
-
function collectBeatReferences(collector, narrative2) {
|
|
572
|
-
if (!isRecord(narrative2) || !Array.isArray(narrative2.beats)) return;
|
|
573
|
-
for (const beat of narrative2.beats) {
|
|
574
|
-
if (isRecord(beat)) addReference(collector, "layouts", beat.layout, false);
|
|
575
|
-
}
|
|
576
|
-
}
|
|
577
|
-
function collectLanguageReferences(collector, language2) {
|
|
578
|
-
addReference(collector, "languages", language2, false);
|
|
579
|
-
if (!isRecord(language2)) return;
|
|
580
|
-
addReference(collector, "fontSchemes", language2.fontScheme, false);
|
|
581
|
-
addReference(collector, "fontSchemes", language2.googleFontScheme, false);
|
|
582
|
-
}
|
|
583
|
-
function collectDocumentReferences(collector, document) {
|
|
584
|
-
addReference(collector, "narratives", document.narrative, typeof document.narrative === "string");
|
|
585
|
-
addReference(collector, "tones", document.tone, false);
|
|
586
|
-
addReference(collector, "purposes", document.purpose, false);
|
|
587
|
-
collectLanguageReferences(collector, document.language);
|
|
588
|
-
if (Array.isArray(document.audience)) {
|
|
589
|
-
for (const entry of document.audience) addReference(collector, "audiences", entry, true);
|
|
590
|
-
} else if (isRecord(document.audience)) {
|
|
591
|
-
addReference(collector, "audiences", document.audience, true);
|
|
592
|
-
} else {
|
|
593
|
-
addReference(collector, "audiences", document.audience, typeof document.audience === "string");
|
|
594
|
-
}
|
|
595
|
-
collectDesignReferences(collector, document.design);
|
|
596
|
-
collectSocialReferences(collector, document.organization);
|
|
597
|
-
collectSocialReferences(collector, document.speaker);
|
|
598
|
-
if (!Array.isArray(document.slides)) return;
|
|
599
|
-
for (const slide of document.slides) {
|
|
600
|
-
if (!isRecord(slide)) continue;
|
|
601
|
-
addReference(collector, "layouts", slide.layout, false);
|
|
602
|
-
collectDesignReferences(collector, slide.design);
|
|
603
|
-
collectChartReference(collector, slide);
|
|
604
|
-
visitContentPayloads(slide, "", (payload) => {
|
|
605
|
-
collectChartReference(collector, payload);
|
|
606
|
-
});
|
|
607
|
-
}
|
|
608
|
-
}
|
|
609
|
-
function collectRecordReferences(collector, kind, record) {
|
|
610
|
-
if (kind === "themes") {
|
|
611
|
-
addReference(collector, "colorSchemes", record.colorScheme, false);
|
|
612
|
-
addReference(collector, "fontSchemes", record.fontScheme, false);
|
|
613
|
-
} else if (kind === "narratives") {
|
|
614
|
-
collectBeatReferences(collector, record);
|
|
615
|
-
} else if (kind === "languages") {
|
|
616
|
-
addReference(collector, "fontSchemes", record.fontScheme, false);
|
|
617
|
-
addReference(collector, "fontSchemes", record.googleFontScheme, false);
|
|
618
|
-
}
|
|
619
|
-
}
|
|
620
|
-
var bundledIndex;
|
|
621
|
-
function bundledCatalogIndex() {
|
|
622
|
-
if (bundledIndex) return bundledIndex;
|
|
623
|
-
const index = /* @__PURE__ */ new Map();
|
|
624
|
-
for (const entry of catalogEntries) {
|
|
625
|
-
const records = /* @__PURE__ */ new Map();
|
|
626
|
-
for (const record of entry.records) {
|
|
627
|
-
if (isRecord(record) && typeof record.id === "string") records.set(record.id, record);
|
|
628
|
-
}
|
|
629
|
-
index.set(entry.kind, records);
|
|
630
|
-
}
|
|
631
|
-
bundledIndex = index;
|
|
632
|
-
return index;
|
|
633
|
-
}
|
|
634
|
-
function bundledRecord(kind, id) {
|
|
635
|
-
const record = bundledCatalogIndex().get(kind)?.get(id);
|
|
636
|
-
if (!record) return void 0;
|
|
637
|
-
const clone = structuredClone(record);
|
|
638
|
-
delete clone.$schema;
|
|
639
|
-
return clone;
|
|
640
|
-
}
|
|
641
|
-
function readKindState(catalogsField, kind) {
|
|
642
|
-
const entry = catalogsField[kind];
|
|
643
|
-
const inline = /* @__PURE__ */ new Map();
|
|
644
|
-
if (!isRecord(entry)) return { customSource: false, inline };
|
|
645
|
-
if (Array.isArray(entry.records)) {
|
|
646
|
-
for (const record of entry.records) {
|
|
647
|
-
if (isRecord(record) && typeof record.id === "string") inline.set(record.id, record);
|
|
648
|
-
}
|
|
649
|
-
}
|
|
650
|
-
const customSource = typeof entry.source === "string" || Array.isArray(entry.source) && entry.source.length > 0;
|
|
651
|
-
return { customSource, inline };
|
|
652
|
-
}
|
|
653
|
-
function kindState(states, catalogsField, kind) {
|
|
654
|
-
const cached = states.get(kind);
|
|
655
|
-
if (cached) return cached;
|
|
656
|
-
const state = readKindState(catalogsField, kind);
|
|
657
|
-
states.set(kind, state);
|
|
658
|
-
return state;
|
|
659
|
-
}
|
|
660
|
-
function pushReportId(map, kind, id) {
|
|
661
|
-
const list2 = map[kind];
|
|
662
|
-
if (list2) list2.push(id);
|
|
663
|
-
else map[kind] = [id];
|
|
664
|
-
}
|
|
665
|
-
function bundle(value) {
|
|
666
|
-
const report = { added: {}, alreadyInline: {}, keptSources: [], unresolved: {} };
|
|
667
|
-
if (!isRecord(value)) {
|
|
668
|
-
return { presentation: value, report };
|
|
669
|
-
}
|
|
670
|
-
const presentation2 = structuredClone(value);
|
|
671
|
-
if (presentation2.catalogs !== void 0 && !isRecord(presentation2.catalogs)) {
|
|
672
|
-
return { presentation: presentation2, report };
|
|
673
|
-
}
|
|
674
|
-
const catalogsField = isRecord(presentation2.catalogs) ? presentation2.catalogs : {};
|
|
675
|
-
const collector = { queue: [], referenced: /* @__PURE__ */ new Map(), reportable: /* @__PURE__ */ new Set() };
|
|
676
|
-
collectDocumentReferences(collector, presentation2);
|
|
677
|
-
const states = /* @__PURE__ */ new Map();
|
|
678
|
-
const resolved = /* @__PURE__ */ new Map();
|
|
679
|
-
for (let index = 0; index < collector.queue.length; index += 1) {
|
|
680
|
-
const pending = collector.queue[index];
|
|
681
|
-
if (!pending) continue;
|
|
682
|
-
const { kind, id } = pending;
|
|
683
|
-
const state = kindState(states, catalogsField, kind);
|
|
684
|
-
const inlineRecord = state.inline.get(id);
|
|
685
|
-
if (inlineRecord) {
|
|
686
|
-
collectRecordReferences(collector, kind, inlineRecord);
|
|
687
|
-
continue;
|
|
688
|
-
}
|
|
689
|
-
if (state.customSource) continue;
|
|
690
|
-
const record = bundledRecord(kind, id);
|
|
691
|
-
if (!record) continue;
|
|
692
|
-
let kindRecords = resolved.get(kind);
|
|
693
|
-
if (!kindRecords) {
|
|
694
|
-
kindRecords = /* @__PURE__ */ new Map();
|
|
695
|
-
resolved.set(kind, kindRecords);
|
|
696
|
-
}
|
|
697
|
-
kindRecords.set(id, record);
|
|
698
|
-
collectRecordReferences(collector, kind, record);
|
|
699
|
-
}
|
|
700
|
-
for (const [kind, ids] of collector.referenced) {
|
|
701
|
-
const state = kindState(states, catalogsField, kind);
|
|
702
|
-
if (state.customSource) report.keptSources.push(kind);
|
|
703
|
-
const kindResolved = resolved.get(kind);
|
|
704
|
-
const addedIds = [];
|
|
705
|
-
for (const id of [...ids].sort()) {
|
|
706
|
-
if (state.inline.has(id)) pushReportId(report.alreadyInline, kind, id);
|
|
707
|
-
else if (kindResolved?.has(id)) addedIds.push(id);
|
|
708
|
-
else if (!state.customSource && collector.reportable.has(reportKey(kind, id))) {
|
|
709
|
-
pushReportId(report.unresolved, kind, id);
|
|
710
|
-
}
|
|
711
|
-
}
|
|
712
|
-
if (!addedIds.length) continue;
|
|
713
|
-
if (!isRecord(presentation2.catalogs)) presentation2.catalogs = {};
|
|
714
|
-
const catalogs2 = presentation2.catalogs;
|
|
715
|
-
if (!isRecord(catalogs2[kind])) catalogs2[kind] = {};
|
|
716
|
-
const entry = catalogs2[kind];
|
|
717
|
-
if (!Array.isArray(entry.records)) entry.records = [];
|
|
718
|
-
const records = entry.records;
|
|
719
|
-
for (const id of addedIds) records.push(kindResolved?.get(id));
|
|
720
|
-
report.added[kind] = addedIds;
|
|
721
|
-
}
|
|
722
|
-
report.keptSources.sort();
|
|
723
|
-
return { presentation: presentation2, report };
|
|
724
|
-
}
|
|
725
|
-
|
|
726
|
-
export { bundle, stats };
|
|
809
|
+
export { OPFMoveToCustomError, copySlides, embed, moveToCustom, sameRecord, stats, updateFromCatalog };
|