allyhub 0.20.0 → 0.21.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/commands/cloud-tools.js +5 -5
- package/dist/commands/frames.js +8 -8
- package/dist/commands.json +1 -1
- package/dist/help.js +3 -3
- package/dist/node_modules/@allyhub/3d-extension/package.json +1 -1
- package/dist/node_modules/@allyhub/audio/package.json +1 -1
- package/dist/node_modules/@allyhub/blocks/dist/elements.js +1 -1
- package/dist/node_modules/@allyhub/blocks/dist/layout.js +1 -1
- package/dist/node_modules/@allyhub/blocks/dist/palette.js +1 -1
- package/dist/node_modules/@allyhub/blocks/dist/resolve.js +1 -1
- package/dist/node_modules/@allyhub/blocks/package.json +1 -1
- package/dist/node_modules/@allyhub/browser/package.json +1 -1
- package/dist/node_modules/@allyhub/build/package.json +1 -1
- package/dist/node_modules/@allyhub/canvas-extension/package.json +1 -1
- package/dist/node_modules/@allyhub/canvas-model/package.json +1 -1
- package/dist/node_modules/@allyhub/chart/package.json +1 -1
- package/dist/node_modules/@allyhub/check/package.json +1 -1
- package/dist/node_modules/@allyhub/cloud/dist/call.js +2 -2
- package/dist/node_modules/@allyhub/cloud/package.json +1 -1
- package/dist/node_modules/@allyhub/components/package.json +1 -1
- package/dist/node_modules/@allyhub/dev-server/package.json +1 -1
- package/dist/node_modules/@allyhub/diagnostics/package.json +1 -1
- package/dist/node_modules/@allyhub/doc/dist/block-shapes.js +2 -0
- package/dist/node_modules/@allyhub/doc/dist/blocks.js +1 -1
- package/dist/node_modules/@allyhub/doc/dist/docx.js +5 -5
- package/dist/node_modules/@allyhub/doc/dist/shapes.js +2 -2
- package/dist/node_modules/@allyhub/doc/package.json +1 -1
- package/dist/node_modules/@allyhub/doc-extension/dist/cli/import.js +1 -1
- package/dist/node_modules/@allyhub/doc-extension/dist/export.js +1 -1
- package/dist/node_modules/@allyhub/doc-extension/package.json +1 -1
- package/dist/node_modules/@allyhub/doc-print/package.json +1 -1
- package/dist/node_modules/@allyhub/export/package.json +1 -1
- package/dist/node_modules/@allyhub/extension-api/package.json +1 -1
- package/dist/node_modules/@allyhub/extension-host/package.json +1 -1
- package/dist/node_modules/@allyhub/formats/dist/data/page-data.d.ts +9 -1
- package/dist/node_modules/@allyhub/formats/dist/data/page-data.js +1 -1
- package/dist/node_modules/@allyhub/formats/package.json +1 -1
- package/dist/node_modules/@allyhub/html-extension/package.json +1 -1
- package/dist/node_modules/@allyhub/i18n/package.json +1 -1
- package/dist/node_modules/@allyhub/image-draw/package.json +1 -1
- package/dist/node_modules/@allyhub/image-extension/package.json +1 -1
- package/dist/node_modules/@allyhub/image-extension/skills/allyhub/references/images.md +1 -1
- package/dist/node_modules/@allyhub/image-measure/package.json +1 -1
- package/dist/node_modules/@allyhub/image-psd/package.json +1 -1
- package/dist/node_modules/@allyhub/image-render/package.json +1 -1
- package/dist/node_modules/@allyhub/image-runtime/package.json +1 -1
- package/dist/node_modules/@allyhub/image-sdk/package.json +1 -1
- package/dist/node_modules/@allyhub/jobs/package.json +1 -1
- package/dist/node_modules/@allyhub/linkedin-extension/package.json +1 -1
- package/dist/node_modules/@allyhub/linkedin-model/package.json +1 -1
- package/dist/node_modules/@allyhub/linkedin-view/package.json +1 -1
- package/dist/node_modules/@allyhub/linkedin-view/src/style.css +1 -1
- package/dist/node_modules/@allyhub/measure/package.json +1 -1
- package/dist/node_modules/@allyhub/media/package.json +1 -1
- package/dist/node_modules/@allyhub/media-extension/package.json +1 -1
- package/dist/node_modules/@allyhub/model/package.json +1 -1
- package/dist/node_modules/@allyhub/office-extension/package.json +1 -1
- package/dist/node_modules/@allyhub/ooxml/package.json +1 -1
- package/dist/node_modules/@allyhub/piece/package.json +1 -1
- package/dist/node_modules/@allyhub/project/package.json +1 -1
- package/dist/node_modules/@allyhub/protocol/dist/cloud.js +1 -1
- package/dist/node_modules/@allyhub/protocol/package.json +1 -1
- package/dist/node_modules/@allyhub/registry/package.json +1 -1
- package/dist/node_modules/@allyhub/render/package.json +1 -1
- package/dist/node_modules/@allyhub/report-extension/LICENSE +241 -0
- package/dist/node_modules/@allyhub/report-extension/dist/build.js +3 -0
- package/dist/node_modules/@allyhub/report-extension/dist/check.js +37 -0
- package/dist/node_modules/@allyhub/report-extension/dist/cli/index.js +4 -0
- package/dist/node_modules/@allyhub/report-extension/dist/export.js +2 -0
- package/dist/node_modules/@allyhub/report-extension/dist/inline.js +58 -0
- package/dist/node_modules/@allyhub/report-extension/dist/page.js +23 -0
- package/dist/node_modules/@allyhub/report-extension/dist/project-tools.js +33 -0
- package/dist/node_modules/@allyhub/report-extension/dist/styles.js +2 -0
- package/dist/node_modules/@allyhub/report-extension/dist/theme.js +2 -0
- package/dist/node_modules/@allyhub/report-extension/dist/tools.js +2 -0
- package/dist/node_modules/@allyhub/report-extension/dist/workspace.js +2 -0
- package/dist/node_modules/@allyhub/report-extension/package.json +185 -0
- package/dist/node_modules/@allyhub/report-extension/styles/allyhub/STYLE.md +180 -0
- package/dist/node_modules/@allyhub/report-extension/styles/allyhub/style.json +15 -0
- package/dist/node_modules/@allyhub/runtime/package.json +1 -1
- package/dist/node_modules/@allyhub/runtimes/package.json +1 -1
- package/dist/node_modules/@allyhub/scaffold/dist/index.js +5 -5
- package/dist/node_modules/@allyhub/scaffold/package.json +1 -1
- package/dist/node_modules/@allyhub/scenery/package.json +1 -1
- package/dist/node_modules/@allyhub/scenery-host/package.json +1 -1
- package/dist/node_modules/@allyhub/sheet/dist/html.js +10 -10
- package/dist/node_modules/@allyhub/sheet/dist/index.js +1 -1
- package/dist/node_modules/@allyhub/sheet/dist/table-style.js +1 -1
- package/dist/node_modules/@allyhub/sheet/dist/theme.js +1 -1
- package/dist/node_modules/@allyhub/sheet/dist/tiles.js +1 -1
- package/dist/node_modules/@allyhub/sheet/dist/xlsx/charts.js +1 -1
- package/dist/node_modules/@allyhub/sheet/dist/xlsx/tile-shapes.js +2 -0
- package/dist/node_modules/@allyhub/sheet/dist/xlsx/write.js +1 -1
- package/dist/node_modules/@allyhub/sheet/package.json +1 -1
- package/dist/node_modules/@allyhub/sheet-extension/dist/cli/sheet.js +1 -1
- package/dist/node_modules/@allyhub/sheet-extension/package.json +1 -1
- package/dist/node_modules/@allyhub/slides-core/dist/capabilities.js +1 -1
- package/dist/node_modules/@allyhub/slides-core/package.json +1 -1
- package/dist/node_modules/@allyhub/slides-extension/dist/cli/slides.js +1 -1
- package/dist/node_modules/@allyhub/slides-extension/package.json +1 -1
- package/dist/node_modules/@allyhub/slides-pptx/package.json +1 -1
- package/dist/node_modules/@allyhub/slides-runtime/package.json +1 -1
- package/dist/node_modules/@allyhub/stage/package.json +1 -1
- package/dist/node_modules/@allyhub/stage-page/package.json +1 -1
- package/dist/node_modules/@allyhub/stage-runtime/dist/runtime.js +2 -2
- package/dist/node_modules/@allyhub/stage-runtime/package.json +1 -1
- package/dist/node_modules/@allyhub/telemetry/package.json +1 -1
- package/dist/node_modules/@allyhub/text-extension/package.json +1 -1
- package/dist/node_modules/@allyhub/video-core/package.json +1 -1
- package/dist/node_modules/@allyhub/video-extension/package.json +1 -1
- package/dist/node_modules/@allyhub/video-measure/package.json +1 -1
- package/dist/node_modules/@allyhub/video-sdk/package.json +1 -1
- package/dist/node_modules/@allyhub/website/package.json +1 -1
- package/dist/node_modules/@allyhub/website-extension/package.json +1 -1
- package/dist/node_modules/@allyhub/x-extension/package.json +1 -1
- package/dist/node_modules/@allyhub/x-model/package.json +1 -1
- package/dist/node_modules/@allyhub/x-view/package.json +1 -1
- package/dist/package.json +15 -14
- package/dist/works.js +1 -1
- package/editor-web/assets/{abnfDiagram-WEYOIA3C-BkVJMd53.js → abnfDiagram-WEYOIA3C-B4tvwU6C.js} +1 -1
- package/editor-web/assets/{architecture-WOLXFQ4H-C6rnaynZ.js → architecture-WOLXFQ4H-V2fA0vY2.js} +1 -1
- package/editor-web/assets/{architectureDiagram-ZHVYKT53-D3vrh8LK.js → architectureDiagram-ZHVYKT53-B6B7XN0M.js} +1 -1
- package/editor-web/assets/article-DW4eD_8K.js +3 -0
- package/editor-web/assets/article-Dm2dIEwc.js +7 -0
- package/editor-web/assets/bar-button-CJmpgNg4.js +1 -0
- package/editor-web/assets/{blockDiagram-RJAE7QA3-BKngt8H7.js → blockDiagram-RJAE7QA3-BizcUGOM.js} +1 -1
- package/editor-web/assets/{c4Diagram-XDPPPE54-j7sUELqF.js → c4Diagram-XDPPPE54-CBHS0dQ0.js} +1 -1
- package/editor-web/assets/channel-dyUtlVPg.js +1 -0
- package/editor-web/assets/chip-BdQRH3FL.js +1 -0
- package/editor-web/assets/{chunk-2E7WHVMD-BXa-uRSi.js → chunk-2E7WHVMD-CMPBck_Q.js} +1 -1
- package/editor-web/assets/{chunk-4EMNKR2T-B3ntcsZN.js → chunk-4EMNKR2T-Df22Adpt.js} +1 -1
- package/editor-web/assets/{chunk-55XCU76K-AMvnFwUg.js → chunk-55XCU76K-CYrZ6_Q7.js} +1 -1
- package/editor-web/assets/{chunk-7S6XSTFO-BA6esfFu.js → chunk-7S6XSTFO-BfdG9NNW.js} +1 -1
- package/editor-web/assets/{chunk-AQDTSKZB-BT_vANXs.js → chunk-AQDTSKZB-BCzZMoTJ.js} +1 -1
- package/editor-web/assets/{chunk-DSNLSHJZ-DoUgmzGB.js → chunk-DSNLSHJZ-DT0xT8Wf.js} +1 -1
- package/editor-web/assets/{chunk-HAGFOTED-DtnIrCZb.js → chunk-HAGFOTED-Bg3-EotU.js} +1 -1
- package/editor-web/assets/{chunk-HNE4Q36P-BlPwQx3_.js → chunk-HNE4Q36P-BrSym24V.js} +1 -1
- package/editor-web/assets/{chunk-NQOKRVIF-D2r7jp2r.js → chunk-NQOKRVIF-CMxgkJWF.js} +1 -1
- package/editor-web/assets/{chunk-UHW7PFBP-Cmc0_F5o.js → chunk-UHW7PFBP-DWEwoyPy.js} +1 -1
- package/editor-web/assets/{chunk-VQ5W62QI-nJSMqAr0.js → chunk-VQ5W62QI-eTFh5_T9.js} +1 -1
- package/editor-web/assets/{chunk-WQQL4CDK-Btq2nbF6.js → chunk-WQQL4CDK-4PTupr9T.js} +1 -1
- package/editor-web/assets/{chunk-YZO67HFG-DTbcCoGt.js → chunk-YZO67HFG-D5XAAFWm.js} +1 -1
- package/editor-web/assets/{chunk-ZAUX2LTX-DVwkg-2N.js → chunk-ZAUX2LTX-CPsdaisO.js} +1 -1
- package/editor-web/assets/{chunk-ZCHMQSOR-BV39jOOE.js → chunk-ZCHMQSOR-ClnuUyfy.js} +1 -1
- package/editor-web/assets/{classDiagram-v2-4MYWR3UA-Cj74-fhM.js → classDiagram-v2-4MYWR3UA-CM21waNF.js} +1 -1
- package/editor-web/assets/collaborator-CbTacvkB.js +1 -0
- package/editor-web/assets/color-picker-BmKFn2ww.js +1 -0
- package/editor-web/assets/{cynefin-EF2NZ3EQ-C0CkiipV.js → cynefin-EF2NZ3EQ-CJUHTgee.js} +1 -1
- package/editor-web/assets/{cynefinDiagram-WF24UDRP-hdsnJ4cI.js → cynefinDiagram-WF24UDRP-C9RIfuIV.js} +1 -1
- package/editor-web/assets/{dagre-NK4GIZVX-CC7WSgaK.js → dagre-NK4GIZVX-g-01KdpO.js} +1 -1
- package/editor-web/assets/deck-C0VxrlzX.js +1 -0
- package/editor-web/assets/{diagram-CBK3MWTC-DmaVm13J.js → diagram-CBK3MWTC-CbOjWUu-.js} +1 -1
- package/editor-web/assets/{diagram-I5XIIV2D-De8jqp7b.js → diagram-I5XIIV2D-C6psNS8J.js} +1 -1
- package/editor-web/assets/{diagram-ODIL2UCW-B5pBTulX.js → diagram-ODIL2UCW-C9PUE46P.js} +1 -1
- package/editor-web/assets/{diagram-PFBEJUXE-BYsXg5_w.js → diagram-PFBEJUXE-vJ_pnB33.js} +1 -1
- package/editor-web/assets/{diagram-RJA3I4VV-DZ8f6bYe.js → diagram-RJA3I4VV-FwYlEfJ-.js} +1 -1
- package/editor-web/assets/{diagram-TYUNFSNR-qXHUsauD.js → diagram-TYUNFSNR-FKpIxeUc.js} +1 -1
- package/editor-web/assets/{dist-DAhe-kFC.js → dist-B8_6sJ_V.js} +1 -1
- package/editor-web/assets/dist-BI_BaYhO.js +19 -0
- package/editor-web/assets/dist-BaWFMuvr.js +1 -0
- package/editor-web/assets/dist-BdmMT8fP.js +5 -0
- package/editor-web/assets/dist-BgKyM9U6.js +3 -0
- package/editor-web/assets/dist-BqijryYd.js +1 -0
- package/editor-web/assets/dist-ByguWp3a.js +16 -0
- package/editor-web/assets/{dist-9kuRjUTN.js → dist-CB-_0-X4.js} +6 -6
- package/editor-web/assets/dist-CCP24Lel.js +19 -0
- package/editor-web/assets/{dist-B3rd02Cg.js → dist-Cg0Z26Kv.js} +6 -6
- package/editor-web/assets/dist-CtYjYJdv.js +1 -0
- package/editor-web/assets/dist-D07Kj8GR.js +1 -0
- package/editor-web/assets/dist-D2rGVz9C.js +1 -0
- package/editor-web/assets/dist-D3DwRF1k.js +547 -0
- package/editor-web/assets/dist-DCI21ljp.js +6 -0
- package/editor-web/assets/dist-DH8oJJw9.js +35 -0
- package/editor-web/assets/dist-DJvfQvM7.js +24 -0
- package/editor-web/assets/dist-DmCDcb2_.js +4 -0
- package/editor-web/assets/dist-H0z_DXDz.js +19 -0
- package/editor-web/assets/{dist-DA72-4WB.js → dist-QLXI7XGS.js} +1 -1
- package/editor-web/assets/{docx-draw-L54blreB.js → docx-draw-Dxb67W2d.js} +1 -1
- package/editor-web/assets/{ebnfDiagram-V4P3TTPT-B7-IfVI-.js → ebnfDiagram-V4P3TTPT-DBymUM-F.js} +1 -1
- package/editor-web/assets/{elk-QONTBCTQ-Gj_WaeBn.js → elk-QONTBCTQ-BNYR3OlS.js} +1 -1
- package/editor-web/assets/{erDiagram-KYQIGQAA-BDF6Qoqx.js → erDiagram-KYQIGQAA-cTNyOqW6.js} +1 -1
- package/editor-web/assets/esm-Cl3GKSDd.js +21 -0
- package/editor-web/assets/{eventmodeling-K75KTNOO-elxVXXEe.js → eventmodeling-K75KTNOO-C6FUZeXP.js} +1 -1
- package/editor-web/assets/eye-DwfE1USj.js +1 -0
- package/editor-web/assets/flowDiagram-IUGLLWBU-ukTovy07.js +1 -0
- package/editor-web/assets/{ganttDiagram-R7GPNTJY-CEogW3jW.js → ganttDiagram-R7GPNTJY-LD9mqQ1x.js} +1 -1
- package/editor-web/assets/{gitGraph-VSP46ZUC-Bh9cRWFa.js → gitGraph-VSP46ZUC-CtCBcQFl.js} +1 -1
- package/editor-web/assets/{gitGraphDiagram-PDYL7XHY-BQAvdM_V.js → gitGraphDiagram-PDYL7XHY-DYQpOozz.js} +1 -1
- package/editor-web/assets/hint-F4fIBnVU.js +1 -0
- package/editor-web/assets/index-Cah2zchD.css +2 -0
- package/editor-web/assets/index-omhSywJb.js +28 -0
- package/editor-web/assets/{info-OHQRW6UA-CdPrqere.js → info-OHQRW6UA-IXInKPRO.js} +1 -1
- package/editor-web/assets/{infoDiagram-MVDRKAX5-uwIMeP44.js → infoDiagram-MVDRKAX5-Ds7Cei7T.js} +1 -1
- package/editor-web/assets/{ishikawaDiagram-HPEHV2GE-rtfvqK7E.js → ishikawaDiagram-HPEHV2GE-DWs3qtAX.js} +1 -1
- package/editor-web/assets/{journeyDiagram-BOSHW7O7-mmhfIyVG.js → journeyDiagram-BOSHW7O7-BkNKVYBA.js} +1 -1
- package/editor-web/assets/{kanban-definition-FNSA4HC5-Fe7jBsi-.js → kanban-definition-FNSA4HC5-D3dMswnI.js} +1 -1
- package/editor-web/assets/{mermaid-parser.core-BxOSjBH9.js → mermaid-parser.core-D_W_0X0N.js} +3 -3
- package/editor-web/assets/{mermaid.core-BOln9YdH.js → mermaid.core-Bkirj-s5.js} +4 -4
- package/editor-web/assets/{mindmap-definition-6OY57UG3-M3Q1LOtO.js → mindmap-definition-6OY57UG3-CMKkAAvI.js} +1 -1
- package/editor-web/assets/{packet-JDAUHWVQ-Dbb0TUG6.js → packet-JDAUHWVQ-CzCkgCfg.js} +1 -1
- package/editor-web/assets/palette-DchDLJj6.js +1 -0
- package/editor-web/assets/panes-BexRuZd2.js +3 -0
- package/editor-web/assets/{pegDiagram-ECIUJNBX-BZMRpSFC.js → pegDiagram-ECIUJNBX-C8qHkx7M.js} +1 -1
- package/editor-web/assets/{pie-XZMESJXO-Ctm9XdKp.js → pie-XZMESJXO-BJqgxMrD.js} +1 -1
- package/editor-web/assets/{pieDiagram-GNMPY74T-cGbs5ZTl.js → pieDiagram-GNMPY74T-DyNntV5y.js} +1 -1
- package/editor-web/assets/progress-D1Uv3d1b.js +6 -0
- package/editor-web/assets/{quadrantDiagram-D57K4MC3-BUe_zsxT.js → quadrantDiagram-D57K4MC3-BHa-69ir.js} +1 -1
- package/editor-web/assets/{radar-ABXABTNO-CCmKtqLs.js → radar-ABXABTNO-BeRPjBBR.js} +1 -1
- package/editor-web/assets/{railroad-I3PHUGI6-k-yhjhjA.js → railroad-I3PHUGI6-BaRQqRsK.js} +1 -1
- package/editor-web/assets/{railroad-abnf-LNEFI6M7-B-PvntB3.js → railroad-abnf-LNEFI6M7-BZfwomxZ.js} +1 -1
- package/editor-web/assets/{railroad-ebnf-DWYD2UWJ-Ds2rua1h.js → railroad-ebnf-DWYD2UWJ-DbgqpEF5.js} +1 -1
- package/editor-web/assets/{railroad-peg-JR7BVNR7-jNZ2wEp2.js → railroad-peg-JR7BVNR7-BYOf3PsQ.js} +1 -1
- package/editor-web/assets/{railroadDiagram-Y72NRBL7-CTqSQ15w.js → railroadDiagram-Y72NRBL7-B5OAzOsD.js} +1 -1
- package/editor-web/assets/{requirementDiagram-EQYSW5RA-CUblhR5M.js → requirementDiagram-EQYSW5RA-wqYNoqO0.js} +1 -1
- package/editor-web/assets/ribbon-tabs-B3IC9WOt.js +1 -0
- package/editor-web/assets/row-DqS4-5b1.js +1 -0
- package/editor-web/assets/{sankeyDiagram-SY24JHO5-nSz6zDX3.js → sankeyDiagram-SY24JHO5-Crf6GRsa.js} +1 -1
- package/editor-web/assets/{sequenceDiagram-BLEHNHQU-DxTpOYuo.js → sequenceDiagram-BLEHNHQU-DUcHz4_d.js} +1 -1
- package/editor-web/assets/{session-BhClkDyr.js → session--OJYv_B7.js} +1 -1
- package/editor-web/assets/{snapshots-DwGHDN3t.js → snapshots-DYooVfOx.js} +1 -1
- package/editor-web/assets/{stateDiagram-v2-A6IESKWZ-C3e14iHY.js → stateDiagram-v2-A6IESKWZ-DbeLdnpS.js} +1 -1
- package/editor-web/assets/surface-BUoi7cmR.js +1 -0
- package/editor-web/assets/swatch-DCmD1gZl.js +1 -0
- package/editor-web/assets/{swimlanes-B3ENRKFQ-DPPdzNzu.js → swimlanes-B3ENRKFQ-BDi6AeJI.js} +1 -1
- package/editor-web/assets/swimlanesDiagram-AYQRV4AK-2wwOmxbv.js +8 -0
- package/editor-web/assets/switch-b6GCy_ix.js +1 -0
- package/editor-web/assets/syntax-Bqyhj0dw.js +1 -0
- package/editor-web/assets/tablet-C6oePHEW.js +1 -0
- package/editor-web/assets/textarea-Bu6uPEqT.js +1 -0
- package/editor-web/assets/{timeline-definition-JXYKGLGB-DRTJ1_Er.js → timeline-definition-JXYKGLGB-B0awa2hh.js} +1 -1
- package/editor-web/assets/trash-2-SFReAxVM.js +1 -0
- package/editor-web/assets/{treeView-D4JQ5SDB-BYJ_m-i5.js → treeView-D4JQ5SDB-C91G0IGm.js} +1 -1
- package/editor-web/assets/{treemap-SAJKECNS-BcU6I6Rg.js → treemap-SAJKECNS-CiOWiwl2.js} +1 -1
- package/editor-web/assets/updating-D0GEtwnJ.js +1 -0
- package/editor-web/assets/{usecaseDiagram-WPOLBNNX-YV92pS4o.js → usecaseDiagram-WPOLBNNX-DMYM1MRe.js} +1 -1
- package/editor-web/assets/{vennDiagram-Q3Y3IDCW-oAvfHZtf.js → vennDiagram-Q3Y3IDCW-DQIJ5vvN.js} +1 -1
- package/editor-web/assets/{video-SJvDRCJK.js → video-mMOFXHYK.js} +1 -1
- package/editor-web/assets/{wardley-7MLQ67FV-BLNiqxtt.js → wardley-7MLQ67FV-C3H9HG8r.js} +1 -1
- package/editor-web/assets/{wardleyDiagram-IVAIDKWA-SppgC6xW.js → wardleyDiagram-IVAIDKWA-DgsjqY1Y.js} +1 -1
- package/editor-web/assets/{words-BUlNNuH2.js → words-B2jQwWpp.js} +1 -1
- package/editor-web/assets/{words-zMedmPWc.js → words-DgMuEmDO.js} +1 -1
- package/editor-web/assets/workbook-NtMEyLgf.js +41 -0
- package/editor-web/assets/x-BAJilkKD.js +41 -0
- package/editor-web/assets/{xychartDiagram-4URNHDU4-BHMn_jwJ.js → xychartDiagram-4URNHDU4-DzsGI527.js} +1 -1
- package/editor-web/index.html +5 -6
- package/package.json +5 -2
- package/editor-web/assets/article-DHf6mOY_.js +0 -7
- package/editor-web/assets/article-Dns1-Xh-.js +0 -3
- package/editor-web/assets/bar-button-CKPfx2AB.js +0 -1
- package/editor-web/assets/channel-CVWSV3su.js +0 -1
- package/editor-web/assets/chip-Bn_9JRRG.js +0 -1
- package/editor-web/assets/collaborator-XiHOxwGM.js +0 -1
- package/editor-web/assets/deck-DQpNIS2p.js +0 -1
- package/editor-web/assets/dist--z0ZHp4T.js +0 -16
- package/editor-web/assets/dist-B5GOGGEe.js +0 -1
- package/editor-web/assets/dist-Bx6q9kCu.js +0 -1
- package/editor-web/assets/dist-C4hHtrJr.js +0 -1
- package/editor-web/assets/dist-CCXJewsi.js +0 -19
- package/editor-web/assets/dist-CfK2BLl8.js +0 -4
- package/editor-web/assets/dist-Cmux3oJ_.js +0 -1
- package/editor-web/assets/dist-Cspf85KV.js +0 -6
- package/editor-web/assets/dist-DOrGo1GD.js +0 -19
- package/editor-web/assets/dist-DjiCHlSu.js +0 -35
- package/editor-web/assets/dist-Do4a40Wn.js +0 -19
- package/editor-web/assets/dist-FKEWS3Co.js +0 -547
- package/editor-web/assets/dist-QKd2i6kG.js +0 -5
- package/editor-web/assets/dist-SGnOfLhx.js +0 -24
- package/editor-web/assets/dist-VmVB7tl4.js +0 -3
- package/editor-web/assets/esm-PQD5Pn8a.js +0 -21
- package/editor-web/assets/flowDiagram-IUGLLWBU-B-25n8zE.js +0 -1
- package/editor-web/assets/hint-CbwoSBMw.js +0 -1
- package/editor-web/assets/index-CXisi0Cj.css +0 -2
- package/editor-web/assets/index-wMlfx8aT.js +0 -28
- package/editor-web/assets/layout-SWqqA0yV.js +0 -1
- package/editor-web/assets/progress-DZQTiRLv.js +0 -6
- package/editor-web/assets/ribbon-DajdQ_Ya.js +0 -1
- package/editor-web/assets/row-Bei9HNEe.js +0 -1
- package/editor-web/assets/split-DBAbwPZ5.js +0 -3
- package/editor-web/assets/surface-CIF0Ae0z.js +0 -1
- package/editor-web/assets/swatch-BUzr_XmH.js +0 -1
- package/editor-web/assets/swimlanesDiagram-AYQRV4AK-B8n3zOw_.js +0 -8
- package/editor-web/assets/switch-DrZxoPQS.js +0 -1
- package/editor-web/assets/syntax-emXV4DnN.js +0 -1
- package/editor-web/assets/tabs-BwU2E7bU.js +0 -1
- package/editor-web/assets/textarea-BX_ax3X8.js +0 -1
- package/editor-web/assets/type-CvZ0HZsV.js +0 -41
- package/editor-web/assets/workbook-BZKYx4WB.js +0 -41
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/*! AllyHub. Copyright (c) 2026 AllyHub, Inc. All rights reserved. Use is subject to LICENSE.md. */
|
|
2
|
-
import{OFFICE_COLORS as U}from"@allyhub/formats";import{formatColor as V,isValidFormat as q}from"numfmt";import{cellName as T,columnLetter as K}from"./address.js";import{followableLinkAt as Y,linkedLook as X}from"./annotations.js";import{chartDef as Z,chartPlace as J,chartSize as Q,chartSvg as tt}from"./chart.js";import{tileSize as et,tileSvg as
|
|
3
|
-
`)}}class W{calc;sheet;rules;read;drawnFiles;bands=new Map;svgs=new Map;sparks=new Map;constructor(t,e,
|
|
2
|
+
import{OFFICE_COLORS as U}from"@allyhub/formats";import{formatColor as V,isValidFormat as q}from"numfmt";import{cellName as T,columnLetter as K}from"./address.js";import{followableLinkAt as Y,linkedLook as X}from"./annotations.js";import{chartDef as Z,chartPlace as J,chartSize as Q,chartSvg as tt}from"./chart.js";import{tileSize as et,tileSvg as nt}from"./tiles.js";import{sparklineSvg as st,sparklineValues as it}from"./sparklines.js";import{lookColorIn as N}from"./theme.js";import{fileCells as ot,isPicture as rt,pictureHeight as lt,pictureSize as at}from"./files.js";import{generalForms as ct,shownValue as dt}from"./format.js";import{DEFAULT_COLUMN_WIDTH as ht,DEFAULT_ROW_HEIGHT as R,columnHidden as O,columnWidth as F,pageTitleCols as ft,pageTitleRows as pt,rowHeight as gt,rowHidden as I,paginate as ut,usedWithCharts as mt}from"./paginate.js";import{Rules as $t,iconShape as bt}from"./rules.js";import{tableStyleLook as wt,tableStyleOf as yt}from"./table-style.js";import{CellError as xt}from"./values.js";import{placeKey as H}from"./workbook.js";export{ht as DEFAULT_COLUMN_WIDTH,R as DEFAULT_ROW_HEIGHT};const vt={"&":"&","<":"<",">":">",'"':"""},St=n=>{let t="";for(let e=0;e<n.length;e+=32768)t+=String.fromCharCode(...n.subarray(e,e+32768));return btoa(t)},x=n=>n.replace(/[&<>"]/gu,t=>vt[t]??t),Ct={thin:"1px solid",medium:"2px solid",thick:"3px solid",double:"3px double",hair:"1px dotted",dotted:"1px dotted",dashed:"1px dashed",dashDot:"1px dashed",dashDotDot:"1px dashed",mediumDashed:"2px dashed",mediumDashDot:"2px dashed",mediumDashDotDot:"2px dashed",slantDashDot:"2px dashed"},jt={left:"left",center:"center",right:"right",justify:"justify",distributed:"justify",centerContinuous:"center",fill:"left"},kt={top:"top",center:"middle",justify:"middle",distributed:"middle"};function At(n){if(typeof n=="number")return"right";if(typeof n=="boolean"||n instanceof xt)return"center"}const zt={up:"▲","up-right":"◥",right:"▶","down-right":"◢",down:"▼",circle:"●",flag:"⚑",check:"✔",bang:"!",cross:"✖",triangle:"▲",diamond:"◆",bars:"▮",quarter:"◔"};function Mt(n){const{shape:t,color:e,level:i}=bt(n.set,n.index),o=(zt[t]??"●").repeat(t==="bars"?i??1:1);return`<span style="float:left;color:${e}">${o}</span>`}function Dt(n){const t=[];if(n.bold!==void 0&&t.push(`font-weight:${n.bold?"bold":"normal"}`),n.italic!==void 0&&t.push(`font-style:${n.italic?"italic":"normal"}`),n.underline!==void 0||n.strike!==void 0){const o=[n.underline!==void 0&&n.underline!==!1?"underline":"",n.strike===!0?"line-through":""].filter(Boolean);t.push(`text-decoration:${o.length>0?o.join(" "):"none"}`)}n.font!==void 0&&t.push(`font-family:"${n.font.replace(/["\\]/gu,"")}",var(--font)`),n.size!==void 0&&t.push(`font-size:${String(n.size)}pt`),n.color!==void 0&&t.push(`color:${n.color}`);const e=x(n.text),i=n.script==="superscript"?`<sup>${e}</sup>`:n.script==="subscript"?`<sub>${e}</sub>`:e;return t.length===0&&n.script===void 0?e:`<span${t.length===0?"":` style="${t.join(";")}"`}>${i}</span>`}function Rt(n,t,e){const i=[];n.bold===!0&&i.push("font-weight:bold"),n.italic===!0&&i.push("font-style:italic");const o=[n.underline?"underline":"",n.strike===!0?"line-through":""].filter(Boolean);o.length>0&&i.push(`text-decoration:${o.join(" ")}`),n.font!==void 0&&i.push(`font-family:"${n.font.replace(/["\\]/gu,"")}",var(--font)`),n.size!==void 0&&i.push(`font-size:${String(n.size)}pt`);const r=(typeof t=="number"&&e!==void 0&&q(e)?V(e,t)??void 0:void 0)??n.color;typeof r=="string"&&i.push(`color:${r}`);const{fill:l}=n;if(typeof l=="string")i.push(`background:${l}`);else if(l){const a=l.color??l.background;a!==void 0&&i.push(`background:${a}`)}const h=(n.align===void 0||n.align==="general"?void 0:jt[n.align])??At(t);h!==void 0&&i.push(`text-align:${h}`);const d=n.valign===void 0?void 0:kt[n.valign];d!==void 0&&i.push(`vertical-align:${d}`),n.wrap===!0&&i.push("white-space:pre-wrap","overflow-wrap:anywhere"),n.indent!==void 0&&i.push(`padding-left:${String(3+n.indent*9)}px`);for(const a of["left","right","top","bottom"]){const s=n.border?.[a];s&&s.style!=="none"&&i.push(`border-${a}:${Ct[s.style]??"1px solid"} ${s.color??"#000"}`)}return i.join(";")}class B{names=new Map;of(t){if(t==="")return"";let e=this.names.get(t);return e||(e=`s${String(this.names.size)}`,this.names.set(t,e)),e}css(){return[...this.names].map(([t,e])=>`.${e}{${t}}`).join(`
|
|
3
|
+
`)}}class W{calc;sheet;rules;read;drawnFiles;bands=new Map;svgs=new Map;fontRows=new Map;sparks=new Map;constructor(t,e,i){this.calc=t,this.sheet=e,this.read=i;for(const o of e.sparklines)for(const r of o.cells)this.sparks.set(H(r.row,r.col),{group:o,data:r.data});this.rules=e.conditions.length>0?new $t(e,t):void 0}files(){if(this.drawnFiles)return this.drawnFiles;const t=new Map,e=new Map,i=this.read;for(const{row:o,col:r,paths:l,column:h}of i?ot(this.sheet,this.calc):[]){const d=lt(h),a=l.map(s=>{const c=rt(s)?i?.(s):void 0,f=c&&at(c);return!c||!f?x(s):(e.set(o,Math.max(e.get(o)??0,d)),`<img src="data:image/${f.type};base64,${St(c)}" alt="${x(s)}" style="height:${String(d)}px">`)});t.set(H(o,r),a.join(" "))}return this.drawnFiles={cells:t,rows:e},this.drawnFiles}height(t){return this.sheet.spec.rows?.[String(t+1)]?.height??Math.max(this.files().rows.get(t)??R,this.fontHeight(t))}fontHeight(t){const e=this.fontRows.get(t);if(e!==void 0)return e;let i=0;const o=this.sheet.used;if(o)for(let r=o.left;r<=o.right;r++){const l=this.sheet.lookAt(t,r).size;if(l===void 0)continue;const h=this.calc.value(this.sheet,t,r);h===null||h===""||(i=Math.max(i,Math.round(l*4/3*1.25)+4))}return this.fontRows.set(t,i),i}band(t,e){if(e===t.at.row)return;let i=this.bands.get(t);if(!i){i=new Map;let o=0;for(let r=t.at.row+1;r<=t.area.bottom;r++)I(this.calc,this.sheet,r)||i.set(r,o++);this.bands.set(t,i)}return i.get(e)??0}cell(t,e,i,o,r){const{sheet:l}=this,h=this.calc.value(l,t,e),d=this.rules?.at(t,e),a=l.lookAt(t,e),s=l.tableAt(t,e),c=s&&yt(s),f=s&&c?wt(c,s,t,e,this.band(s,t)):void 0,p=Y(this.calc,l,t,e),m={...f,...a,...p?X(a):{},...d?.look,...d?.scale===void 0?{}:{fill:d.scale}};(f?.border||a.border)&&(m.border={...f?.border,...a.border,...d?.look?.border});const u=m.format;let g=Rt(m,h,u);if(d?.bar){const M=`${String(Math.round(d.bar.share*100))}%`;g=[g,`background:linear-gradient(90deg,${d.bar.color} 0%,${d.bar.color}40 ${M},transparent ${M}) 0 50%/100% calc(100% - 4px) no-repeat`].filter(Boolean).join(";")}const w=this.sparks.get(H(t,e));if(w){const M=l.book?.colors??U,L=st(it(this.calc,l,w.data),w.group.spec,100,20,{series:N(w.group.spec.color??"accent1",M),marks:N(w.group.spec.marks??"#D00000",M)});L!==""&&(g=[g,`background:url("data:image/svg+xml,${encodeURIComponent(L)}") 50% 50%/calc(100% - 6px) calc(100% - 6px) no-repeat`].filter(Boolean).join(";"))}const S=this.files().cells.get(H(t,e)),y=d?.icon?Mt(d.icon):"",C=typeof h=="string"?l.runsAt(t,e):void 0,j=S??(d?.bare===!0?"":C?C.map(Dt).join(""):x(dt(h,u))),D=typeof h=="string"&&m.wrap!==!0&&o&&!i,k=typeof h=="number"&&!S&&y===""&&j!=="",A=k&&(u===void 0||u==="General"),z=[r.of(g),D?"over":"",k?"n":""].filter(Boolean).join(" "),$=[z===""?"":` class="${z}"`,A?` data-g="${x(ct(h).slice(1).join(" "))}"`:"",i&&i.rows>1?` rowspan="${String(i.rows)}"`:"",i&&i.cols>1?` colspan="${String(i.cols)}"`:""].join(""),v=k?void 0:p?.to,_=v!==void 0&&/^(?:https?:|mailto:)/iu.test(v)&&j!==""?`<a href="${x(v)}" style="color:inherit;text-decoration:inherit">${j}</a>`:j;return`<td${$}>${y}${_}</td>`}spans(t,e){const i=new Map,o=new Set;for(const r of this.sheet.merges){const l=t.filter(s=>s>=r.top&&s<=r.bottom),h=e.filter(s=>s>=r.left&&s<=r.right),[d]=l,[a]=h;if(!(d===void 0||a===void 0)){for(const s of l)for(const c of h)o.add(`${String(s)}:${String(c)}`);o.delete(`${String(d)}:${String(a)}`),i.set(`${String(d)}:${String(a)}`,{rows:l.length,cols:h.length})}}return{spans:i,covered:o}}table(t,e,i,o){const{sheet:r}=this,{spans:l,covered:h}=this.spans(t,e),d=e.map(f=>F(r,f)),a=o.headings?G:0,s=d.reduce((f,p)=>f+p,0)+a,c=[`<table class="${o.className??""}" style="width:${String(s)}px"><colgroup>`,o.headings?`<col style="width:${String(a)}px">`:"",...d.map(f=>`<col style="width:${String(f)}px">`),"</colgroup>"];o.headings&&c.push(`<thead><tr><th></th>${e.map(f=>`<th>${K(f)}</th>`).join("")}</tr></thead>`),c.push("<tbody>");for(const f of t)c.push(`<tr style="height:${String(this.height(f))}px">`),o.headings&&c.push(`<th>${String(f+1)}</th>`),e.forEach((p,m)=>{const u=`${String(f)}:${String(p)}`;if(h.has(u))return;const g=e[m+1],w=g!==void 0&&r.at(f,g)===void 0&&!h.has(`${String(f)}:${String(g)}`);c.push(this.cell(f,p,l.get(u),w,i))}),c.push("</tr>");return c.push("</tbody></table>"),{html:c.join(""),width:s}}svg(t){let e=this.svgs.get(t);if(e===void 0){const{width:i,height:o}=Q(t.spec);e=tt(Z(this.calc,this.sheet,t),i,o,{font:"var(--font)",...this.sheet.book?{colors:this.sheet.book.colors}:{}}),this.svgs.set(t,e)}return e}charts(t,e,i){const{sheet:o}=this;if(o.charts.length===0&&o.tiles.length===0||t.length===0||e.length===0)return"";const r=(s,c)=>{const f=new Map;let p=0;for(const m of s)f.set(m,p),p+=c(m);return{at:f,sum:p}},l=r(t,s=>this.height(s)),h=r(e,s=>F(o,s)),d=(s,c,f,p)=>{const m=s[0]??0;if(f<m){let g=0;for(let w=f;w<m;w++)g-=p(w);return g}const u=s.find(g=>g>=f);return u===void 0?1/0:c.get(u)??0},a=(s,c,f)=>{const p=J(s,u=>d(t,l.at,u,g=>I(this.calc,o,g)?0:gt(o,g)),u=>d(e,h.at,u,g=>O(o,g)?0:F(o,g)));return p.left<h.sum&&p.left+p.width>0&&p.top<l.sum&&p.top+p.height>0?`<div class="${f}" style="left:${String(i.left+p.left)}px;top:${String(i.top+p.top)}px">${c()}</div>`:""};return[...o.charts.map(s=>a(s.spec,()=>this.svg(s),"chart")),...o.tiles.map(s=>a({...s.spec,...et(s)},()=>nt(this.calc,o,s).svg??"","chart tile"))].join("")}}const G=44,Ft=`
|
|
4
4
|
(() => {
|
|
5
5
|
const fit = () => {
|
|
6
6
|
const cells = Array.from(document.querySelectorAll("td.n"));
|
|
@@ -23,24 +23,24 @@ import{OFFICE_COLORS as U}from"@allyhub/formats";import{formatColor as V,isValid
|
|
|
23
23
|
};
|
|
24
24
|
window.allyhubReady = new Promise((r) => addEventListener("load", r, { once: true })).then(() => document.fonts.ready).then(fit);
|
|
25
25
|
})();
|
|
26
|
-
`;function P(
|
|
27
|
-
${
|
|
28
|
-
:root{--font:${
|
|
26
|
+
`;function P(n,t,e){return`<!doctype html><html><head><meta charset="utf-8"><style>
|
|
27
|
+
${n.css??""}
|
|
28
|
+
:root{--font:${n.font===void 0?"":`"${n.font}",`}Carlito,Calibri,"Noto Sans SC",Arial,sans-serif}
|
|
29
29
|
*{box-sizing:border-box}
|
|
30
30
|
html,body{margin:0;background:#fff;color:#000}
|
|
31
31
|
body{font:11pt/1.2 var(--font)}
|
|
32
32
|
table{table-layout:fixed;border-collapse:collapse}
|
|
33
|
-
td,th{height:${String(
|
|
33
|
+
td,th{height:${String(R)}px;padding:0 3px;overflow:hidden;white-space:pre;vertical-align:bottom}
|
|
34
34
|
td.over{overflow:visible}
|
|
35
35
|
.chart{position:absolute;line-height:0}
|
|
36
36
|
.grid td{border:1px solid #e3e3e3}
|
|
37
37
|
.edged th{border:1px solid #e3e3e3;background:#f5f5f5;color:#555;font-weight:normal;text-align:center;vertical-align:middle;font-size:9pt}
|
|
38
38
|
${t}
|
|
39
|
-
</style><script>${
|
|
39
|
+
</style><script>${Ft}<\/script></head><body>${e}</body></html>`}export function sheetHtml(n,t={}){const e=t.sheets??n.wb.sheets.filter(a=>a.spec.hidden!==!0),i=new B,o=[];let r=0;const l=e.length>1&&t.area===void 0,h=e.map(a=>{const s=new W(n,a,t.file),c=t.area??mt(a)??{top:0,left:0,bottom:0,right:0},f=[];for(let y=c.top;y<=c.bottom;y++)I(n,a,y)||f.push(y);const p=[];for(let y=c.left;y<=c.right;y++)O(a,y)||p.push(y);const m=f.slice(0,t.rows??f.length),u=p.slice(0,t.columns??p.length);if(m.length<f.length||u.length<p.length){const y=m[m.length-1]??c.top,C=u[u.length-1]??c.left;o.push(`${a.name}: drew ${T({row:c.top,col:c.left})}:${T({row:y,col:C})} of ${String(f.length)} rows and ${String(p.length)} columns`)}const g=t.headings===!0,w=s.table(m,u,i,{headings:g,className:g?a.spec.gridlines===!1?"edged":"edged grid":""});r=Math.max(r,w.width);const S=s.charts(m,u,{left:g?G:0,top:g?R:0});return`<section class="sheet">${l?`<h2>${x(a.name)}</h2>`:""}<div class="book">${w.html}${S}</div></section>`});return{html:P(t,`h2{font:bold 12pt var(--font);margin:0 0 8px}
|
|
40
40
|
.sheet+.sheet{margin-top:24px}
|
|
41
41
|
.book{position:relative;width:max-content;overflow:hidden}
|
|
42
|
-
${
|
|
43
|
-
`);return P(
|
|
42
|
+
${i.css()}`,h.join("")),width:r,cut:o}}const E=n=>String(n).padStart(2,"0");export function headerFooterHtml(n,t){let e="",i=0;const o=l=>{e+=`<span style="${l}">`,i++},r={B:"font-weight:bold",I:"font-style:italic",U:"text-decoration:underline",E:"text-decoration:underline double",S:"text-decoration:line-through",X:"vertical-align:super;font-size:smaller",Y:"vertical-align:sub;font-size:smaller"};for(let l=0;l<n.length;l++){const h=n[l]??"";if(h!=="&"){e+=x(h);continue}const d=n[l+1]??"",a=d.toUpperCase();if(l++,d==="&")e+="&";else if(a==="P"||a==="N"){const s=/^[+-]\d+/u.exec(n.slice(l+1)),c=a==="P"?t.page:t.pages;e+=String(c+(s?Number(s[0]):0)),s&&(l+=s[0].length)}else if(a==="D")e+=`${String(t.date.getFullYear())}-${E(t.date.getMonth()+1)}-${E(t.date.getDate())}`;else if(a==="T")e+=`${E(t.date.getHours())}:${E(t.date.getMinutes())}`;else if(a==="F"||a==="Z")e+=x(t.file);else if(a==="A")e+=x(t.sheet);else{if(a==="G")continue;if(r[a]!==void 0)o(r[a]);else if(d==='"'){const s=n.indexOf('"',l+1),[c="",f=""]=n.slice(l+1,s<0?n.length:s).split(",");l=s<0?n.length:s;const p=[c==="-"||c===""?"":`font-family:"${c.replace(/["\\]/gu,"")}",var(--font)`,/bold/iu.test(f)?"font-weight:bold":"",/italic/iu.test(f)?"font-style:italic":""].filter(Boolean).join(";");p!==""&&o(p)}else if(/\d/u.test(d)){const s=/^\d+/u.exec(n.slice(l))?.[0]??d;l+=s.length-1,o(`font-size:${s}pt`)}else if(a==="K"){const s=n.slice(l+1,l+7);l+=6,/^[0-9A-Fa-f]{6}$/u.test(s)&&o(`color:#${s}`)}}}return e+"</span>".repeat(i)}const b=n=>`${String(Math.round(n*1e3)/1e3)}px`;export class SheetPrint{job;calc;drawers=new Map;file;constructor(t,e={}){this.calc=t,this.file=e.file,this.job=ut(t,{...e.sheets?{sheets:e.sheets}:{},height:(i,o)=>this.drawer(i).height(o)})}drawer(t){let e=this.drawers.get(t);return e||(e=new W(this.calc,t,this.file),this.drawers.set(t,e)),e}html(t,e,i){const o=new B,r=new Map,l=[];for(const d of this.job.pages.slice(t,e)){const{of:a}=d,s=`${b(a.paper.width)} ${b(a.paper.height)}`;let c=r.get(s);c===void 0&&(c=`paper${String(r.size)}`,r.set(s,c)),l.push(this.page(d,o,c,i))}const h=[...r].map(([d,a])=>`@page ${a}{size:${d};margin:0}`).join(`
|
|
43
|
+
`);return P(i,`${h}
|
|
44
44
|
.page{position:relative;overflow:hidden;break-after:page}
|
|
45
45
|
.page:last-child{break-after:auto}
|
|
46
46
|
.body,.charts{position:absolute;overflow:hidden}
|
|
@@ -49,4 +49,4 @@ ${o.css()}`,f.join("")),width:r,cut:i}}const E=s=>String(s).padStart(2,"0");expo
|
|
|
49
49
|
.hf>div{flex:1 1 0;overflow:visible}
|
|
50
50
|
.hf>.c{text-align:center}
|
|
51
51
|
.hf>.r{text-align:right}
|
|
52
|
-
${
|
|
52
|
+
${o.css()}`,l.join(""))}page(t,e,i,o){const{of:r}=t,l=this.drawer(r.sheet),{margins:h,scale:d}=r,a=pt(t),s=ft(t),c=r.rows.slice(t.down.from,t.down.to),f=r.cols.slice(t.across.from,t.across.to),p=l.table([...a,...c],[...s,...f],e,{headings:!1}),m=a.reduce(($,v)=>$+l.height(v),0),u=s.reduce(($,v)=>$+F(r.sheet,v),0),g=r.rowAt[t.down.from]??0,w=r.colAt[t.across.from]??0,S=(r.rowAt[t.down.to]??0)-g,y=(r.colAt[t.across.to]??0)-w,C=r.charts.filter($=>$.left<w+y&&$.left+$.width>w&&$.top<g+S&&$.top+$.height>g).map($=>`<div class="chart" style="left:${b($.left-w)};top:${b($.top-g)}">${l.svg($.chart)}</div>`).join(""),j=C===""?"":`<div class="charts" style="left:${b(u)};top:${b(m)};width:${b(y)};height:${b(S)}">${C}</div>`,D=r.paper.width-h.left-h.right,k=r.paper.height-h.top-h.bottom,A={page:t.number,pages:this.job.pages.length,sheet:r.sheet.name,file:o.name,date:o.date},z=($,v)=>$?`<div class="hf" style="left:${b(h.left)};right:${b(h.right)};${v}"><div>${headerFooterHtml($.left??"",A)}</div><div class="c">${headerFooterHtml($.center??"",A)}</div><div class="r">${headerFooterHtml($.right??"",A)}</div></div>`:"";return`<section class="page" style="page:${i};width:${b(r.paper.width)};height:${b(r.paper.height)}">`+z(r.header,`top:${b(h.header)}`)+`<div class="body" style="left:${b(h.left)};top:${b(h.top)};width:${b(D)};height:${b(k)}"><div class="scaled" style="width:${b(D/d)};height:${b(k/d)}${d===1?"":`;transform:scale(${String(d)})`}">`+p.html+j+"</div></div>"+z(r.footer,`bottom:${b(h.footer)}`)+"</section>"}}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/*! AllyHub. Copyright (c) 2026 AllyHub, Inc. All rights reserved. Use is subject to LICENSE.md. */
|
|
2
|
-
export*from"./address.js";export{patchCsv}from"./patch.js";export{printedFacts,printedLines}from"./printed.js";export*from"./values.js";export*from"./workbook.js";export*from"./calc/remote.js";export*from"./calc/server.js";export{CODE as SHEET_CODE,ENTRY as SHEET_ENTRY,codeOf,dataFilesOf,placesOf,readSheetFile}from"./file.js";export{GENERATED,ordinarySheet,typedNumbers,withGenerated}from"./generated.js";export{applyScenario,cellOfName,scenarioNames,scenariosByCell}from"./scenario.js";export{fileCells,hasFiles,isPicture,pictureHeight,pictureSize}from"./files.js";export*from"./formula/ast.js";export{parseFormula}from"./formula/parse.js";export{printFormula,sheetPrefix}from"./formula/print.js";export{moveFormula}from"./formula/move.js";export{rewriteFormula}from"./formula/rewrite.js";export{Calc,ITERATION_DEFAULTS,seededRandom}from"./calc/engine.js";export{analyse}from"./calc/analyse.js";export{FUNCTIONS}from"./calc/functions/index.js";export{Reference}from"./calc/types.js";export{checkWorkbook,placeName}from"./check.js";export{csvOf,csvText,dataValue,excelNumber,tableRows}from"./export.js";export{generalForms,generalText,isDateCode,shownColor,shownValue}from"./format.js";export{DEFAULT_COLUMN_WIDTH,DEFAULT_ROW_HEIGHT,headerFooterHtml,sheetHtml,SheetPrint}from"./html.js";export{PAPERS,PRINT_DEFAULTS,paginate}from"./paginate.js";export{DEFAULT_TABLE_STYLE,tableStyleLook,tableStyleOf}from"./table-style.js";export{TABLE_STYLES}from"./table-styles.js";export{PROFILE_TOP,profileTable}from"./profile.js";export{importRows}from"./import.js";export{patchSheetYaml,patchYaml,writeSheetYaml,writeYaml}from"./write.js";export{asWritten,heightToPixels,inPixels,pixelsToHeight,pixelsToWidth,widthToPixels}from"./units.js";export*from"./edit.js";export*from"./rich.js";export*from"./annotations.js";export*from"./arrange.js";export*from"./outline.js";export*from"./data-tools.js";export{NO_LOOK,autoFill,copyLooks,fillDownTo,moveCells,pasteLooks,shiftCells}from"./fill.js";export{seriesAfter}from"./series.js";export{compareForSort,hasHeader,sortCells,sortedOrder,sortedRows}from"./sort.js";export{filterChoices,filteredRows,regionAround}from"./filter.js";export{Rules,colorBetween,compareValues,holds,iconShape}from"./rules.js";export{choicesIn,invalidCells,joinChoices,listValues,separatorOf,valid}from"./validate.js";export{freeColumn,restructure,tableShape,uniqueColumn,withColumnsUpTo}from"./structure.js";export{SHEET_CHART_DEFAULTS,chartAfter,chartDataRange,chartDef,chartOfRange,chartPlace,chartSize,chartSvg,readCells,readDataRange,textOf}from"./chart.js";export{INSPECT_DEFAULTS,SHEET_FACT_KINDS,inspectWorkbook}from"./inspect.js";export{DIFF_DEFAULTS,diffWorkbooks}from"./diff.js";export{tileChart,tileDef,tileSize,tileSvg,TILE_DEFAULTS}from"./tiles.js";export{sheetArea,sparklineCells,sparklinePoints,sparklinesByPlace,sparklineSvg,sparklineValues}from"./sparklines.js";export{lookColorIn}from"./theme.js";
|
|
2
|
+
export*from"./address.js";export{patchCsv}from"./patch.js";export{printedFacts,printedLines}from"./printed.js";export*from"./values.js";export*from"./workbook.js";export*from"./calc/remote.js";export*from"./calc/server.js";export{CODE as SHEET_CODE,ENTRY as SHEET_ENTRY,codeOf,dataFilesOf,placesOf,readSheetFile}from"./file.js";export{GENERATED,ordinarySheet,typedNumbers,withGenerated}from"./generated.js";export{applyScenario,cellOfName,scenarioNames,scenariosByCell}from"./scenario.js";export{fileCells,hasFiles,isPicture,pictureHeight,pictureSize}from"./files.js";export*from"./formula/ast.js";export{parseFormula}from"./formula/parse.js";export{printFormula,sheetPrefix}from"./formula/print.js";export{moveFormula}from"./formula/move.js";export{rewriteFormula}from"./formula/rewrite.js";export{Calc,ITERATION_DEFAULTS,seededRandom}from"./calc/engine.js";export{analyse}from"./calc/analyse.js";export{FUNCTIONS}from"./calc/functions/index.js";export{Reference}from"./calc/types.js";export{checkWorkbook,placeName}from"./check.js";export{csvOf,csvText,dataValue,excelNumber,tableRows}from"./export.js";export{generalForms,generalText,isDateCode,shownColor,shownValue}from"./format.js";export{DEFAULT_COLUMN_WIDTH,DEFAULT_ROW_HEIGHT,headerFooterHtml,sheetHtml,SheetPrint}from"./html.js";export{PAPERS,PRINT_DEFAULTS,paginate}from"./paginate.js";export{DEFAULT_TABLE_STYLE,tableStyleLook,tableStyleNamed,tableStyleOf}from"./table-style.js";export{TABLE_STYLES}from"./table-styles.js";export{PROFILE_TOP,profileTable}from"./profile.js";export{importRows}from"./import.js";export{patchSheetYaml,patchYaml,writeSheetYaml,writeYaml}from"./write.js";export{asWritten,heightToPixels,inPixels,pixelsToHeight,pixelsToWidth,widthToPixels}from"./units.js";export*from"./edit.js";export*from"./rich.js";export*from"./annotations.js";export*from"./arrange.js";export*from"./outline.js";export*from"./data-tools.js";export{NO_LOOK,autoFill,copyLooks,fillDownTo,moveCells,pasteLooks,shiftCells}from"./fill.js";export{seriesAfter}from"./series.js";export{compareForSort,hasHeader,sortCells,sortedOrder,sortedRows}from"./sort.js";export{filterChoices,filteredRows,regionAround}from"./filter.js";export{Rules,colorBetween,compareValues,holds,iconShape}from"./rules.js";export{choicesIn,invalidCells,joinChoices,listValues,separatorOf,valid}from"./validate.js";export{freeColumn,restructure,tableShape,uniqueColumn,withColumnsUpTo}from"./structure.js";export{SHEET_CHART_DEFAULTS,chartAfter,chartDataRange,chartDef,chartOfRange,chartPlace,chartSize,chartSvg,readCells,readDataRange,textOf}from"./chart.js";export{INSPECT_DEFAULTS,SHEET_FACT_KINDS,inspectWorkbook}from"./inspect.js";export{DIFF_DEFAULTS,diffWorkbooks}from"./diff.js";export{tileChart,tileDef,tileSize,tileSvg,TILE_DEFAULTS}from"./tiles.js";export{sheetArea,sparklineCells,sparklinePoints,sparklinesByPlace,sparklineSvg,sparklineValues}from"./sparklines.js";export{lookColorIn,tintedColor}from"./theme.js";
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/*! AllyHub. Copyright (c) 2026 AllyHub, Inc. All rights reserved. Use is subject to LICENSE.md. */
|
|
2
|
-
import{OFFICE_COLORS as
|
|
2
|
+
import{OFFICE_COLORS as L}from"@allyhub/formats";import{TABLE_STYLES as T}from"./table-styles.js";import{themed as O,themeOrder as k}from"./theme.js";export const DEFAULT_TABLE_STYLE="TableStyleMedium2";const g=new Map;function y(o,i){const c=e=>{if(!e)return;const t={...e};if(e.color!==void 0&&(t.color=O(e.color,i)),e.fill!==void 0&&(t.fill=O(e.fill,i)),e.border){const r={};for(const[s,f]of Object.entries(e.border))r[s]={style:f.style,color:O(f.color,i)};t.border=r}return t},n={};for(const[e,t]of Object.entries(o)){const r=c(t);r&&(n[e]=r)}return n}export function tableStyleOf(o){if(o.spec.style!=="none")return tableStyleNamed(o.spec.style??DEFAULT_TABLE_STYLE,o.sheet.book?.themeOrder)}export function tableStyleNamed(o,i=F){const c=T[o];if(!c)return;const n=i.join();let e=g.get(n);e||(e=new Map,g.set(n,e));let t=e.get(o);return t||(t=y(c,i),e.set(o,t)),t}const F=k(L);export function tableStyleLook(o,i,c,n,e){const{area:t}=i,r={},s={},f=(l,E)=>{if(!l)return;l.bold!==void 0&&(r.bold=l.bold),l.color!==void 0&&(r.color=l.color),l.fill!==void 0&&(r.fill=l.fill);const h=l.border;if(!h)return;const d=(a,S)=>{const _=E[a]?h[a]:h[S];_&&(s[a]=_)};d("left","vertical"),d("right","vertical"),d("top","horizontal"),d("bottom","horizontal")},m={left:n===t.left,right:n===t.right},p={top:c===t.top,bottom:c===t.bottom},b={left:!0,right:!0,...p},u=i.spec;return f(o.whole,{...m,...p}),u.banded_columns===!0&&f((n-t.left)%2===0?o.column:o.column2,b),e!==void 0&&u.banded_rows!==!1&&f(e%2===0?o.stripe:o.stripe2,{...m,top:!0,bottom:!0}),u.last_column===!0&&n===t.right&&f(o.last,b),u.first_column===!0&&n===t.left&&f(o.first,b),e===void 0&&f(o.header,{...m,top:!0,bottom:!0}),Object.keys(s).length>0&&(r.border=s),r}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/*! AllyHub. Copyright (c) 2026 AllyHub, Inc. All rights reserved. Use is subject to LICENSE.md. */
|
|
2
|
-
import{lookColor as
|
|
2
|
+
import{lookColor as p}from"@allyhub/formats";import{tinted as f}from"./xlsx/colors.js";export function themeOrder(e){return[e.lt1,e.dk1,e.lt2,e.dk2,e.accent1,e.accent2,e.accent3,e.accent4,e.accent5,e.accent6,e.hlink,e.folHlink].map(t=>t.slice(1).toUpperCase())}export const themeTint=(e,t,n=0)=>`#${f(e[t].slice(1).toUpperCase(),n)}`,tintedColor=(e,t)=>`#${f(e.slice(1).toUpperCase(),t)}`;export function themed(e,t){if(!e.startsWith("t"))return e;const[n,i]=e.slice(1).split(":"),r=t[Number(n)]??"000000";return`#${f(r,Number(i??0))}`}export const lookColorIn=(e,t)=>p(e,t,(n,i)=>`#${f(n.slice(1).toUpperCase(),i)}`);export function lookInTheme(e,t){const n=r=>r===void 0||r.startsWith("#")?r:lookColorIn(r,t),i={...e};if(e.color!==void 0&&(i.color=n(e.color)),typeof e.fill=="string"?i.fill=n(e.fill):e.fill&&(i.fill={...e.fill,...e.fill.color===void 0?{}:{color:n(e.fill.color)},...e.fill.background===void 0?{}:{background:n(e.fill.background)}}),e.border){const r={};for(const[l,c]of Object.entries(e.border)){if(!c)continue;const d=n(c.color);r[l]=d===void 0?c:{...c,color:d}}i.border=r}return i}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/*! AllyHub. Copyright (c) 2026 AllyHub, Inc. All rights reserved. Use is subject to LICENSE.md. */
|
|
2
|
-
import{blockAlt as k,blockFromFile as
|
|
2
|
+
import{blockAlt as k,blockFromFile as S,blockSvg as j,paletteOfTheme as F}from"@allyhub/blocks";import{blockKindOf as w,OFFICE_COLORS as E,readBlock as _,readBlockItem as T}from"@allyhub/formats";import{cellName as v}from"./address.js";import{chartFormula as x,chartOf as y,SharedFormula as C}from"./workbook.js";import{chartDef as A,chartSvg as I,readCells as D,textOf as L}from"./chart.js";export const TILE_LOOK={tile:"card",radius:0,edge:"rule-strong",figure:{scale:.85},callout:"bar",marker:"square"},TILE_FONT="Calibri, Carlito, Arial, sans-serif",TILE_DEFAULTS={width:320,height:160},tileSize=r=>({width:r.spec.width??TILE_DEFAULTS.width,height:r.spec.height??TILE_DEFAULTS.height});function B(r,e,o){const t=o.replace(/^=/u,"").trim(),s=e.book?.tables.find(u=>u.name.toLowerCase()===t.toLowerCase());if(!s)return;const{top:n,bottom:d,left:c}=s.data,i=[],f=[];for(let u=n;u<=d;u++){const b={},p={};for(const h of s.columns){const l={value:r.value(s.sheet,u,c+h.index),sheet:s.sheet,row:u,col:c+h.index};b[h.name]=l.value instanceof Object?String(l.value):l.value,p[h.name]=L(l)}i.push(b),f.push(p)}return{value:i,shown:f}}function O(r,e,o){const t=B(r,e,o);if(t)return t;const s=new C(x(o),0,0,{file:"",path:[]});if(!s.node)return;const n=D(r,e,s);if(n.length===0)return;const d=n.map(i=>i.value instanceof Object?String(i.value):i.value),c=n.map(L);return n.length===1?{value:d[0],shown:c[0]}:{value:d,shown:c}}export function tileDef(r,e,o){const t=S(o.kind,o.spec[o.kind],{data:n=>O(r,e,n)?.value??void 0,shown:n=>O(r,e,n)?.shown}),s=t.problems.map(n=>`${n.path.length>0?`${n.path.join(".")}: `:""}${n.message}`);return t.block===void 0?{problems:s}:{def:t.block,problems:s}}const $=new WeakMap;function G(r){const e=T("task",{[r]:"1"});return Object.keys(e.fields??{})[0]}export function tileChart(r,e){const o=$.get(e);if(o)return o;const t=w(e.kind)==="chart"?K(r,e):N(r,e);return $.set(e,t),t}function K(r,e){const o=e.spec[e.kind];if(o===null||typeof o!="object")return{};const t=o,n=(typeof t.data=="string"?t.data:"").replace(/^=/u,"").replace(/^.*#/u,"").trim(),d=r.book?.tables.find(a=>a.name.toLowerCase()===n.toLowerCase());if(!d||typeof t.categories!="string")return{};const c=a=>d.columns.find(m=>m.name.toLowerCase()===a.toLowerCase()),i=a=>`${d.name}[${a.name.replace(/([[\]#'])/gu,"'$1")}]`,f=c(t.categories),u=(Array.isArray(t.series)?t.series:[]).map(a=>{const m=typeof a=="string"?{name:a}:a!==null&&typeof a=="object"?a:{},g=typeof m.name=="string"?c(m.name):void 0;return g?{...m,name:g.name,values:i(g)}:void 0});if(!f||u.length===0||u.includes(void 0))return{};const p={...Object.fromEntries(Object.entries(t).filter(([a])=>a!=="data")),at:v(e.at),...e.spec.x===void 0?{}:{x:e.spec.x},...e.spec.y===void 0?{}:{y:e.spec.y},...tileSize(e),categories:i(f),series:u},h=[],l=y(p,e.index,[],(a,m)=>h.push(m));return l&&h.length===0?{chart:l}:{}}function N(r,e){if(w(e.kind)!=="gantt")return{};const o=_(e.kind,e.spec[e.kind]).block?.fields,s=(typeof o?.data=="string"?o.data:"").replace(/^=/u,"").trim(),n=r.book?.tables.find(a=>a.name.toLowerCase()===s.toLowerCase());if(!n)return{};const d=o?.columns??{},c=a=>{const m=d[a];return m!==void 0?n.columns.find(g=>g.name.toLowerCase()===m.toLowerCase()):n.columns.find(g=>G(g.name)===a)},i=c("name"),f=c("start"),u=c("duration"),b=c("group");if(!i||!f||!u)return{problem:`a Gantt over the cells draws Excel's own Gantt from ${n.name}'s task, start and duration columns${!u&&c("end")?": add a duration column, =[@End]-[@Start]":""}; it has ${n.columns.map(a=>a.name).join(", ")}.`};const p=a=>`${n.name}[${a.name.replace(/([[\]#'])/gu,"'$1")}]`,h={type:"bar-stacked",at:v(e.at),...e.spec.x===void 0?{}:{x:e.spec.x},...e.spec.y===void 0?{}:{y:e.spec.y},...tileSize(e),categories:p(i),series:[{name:f.name,values:p(f)},{name:u.name,values:p(u)}],gap_width:40,category_axis:{reverse:!0},value_axis:{gridlines:!0}},l=y(h,e.index,[],()=>{});return l?(l.gantt={...b?{group:new C(x(p(b)),0,0,{file:"",path:[]})}:{}},{chart:l}):{}}export function tileAlt(r,e,o){const{def:t}=tileDef(r,e,o);return t===void 0?"":k(t)}export function tileSvg(r,e,o,t={}){const{def:s,problems:n}=tileDef(r,e,o);if(s===void 0)return{problems:n};const{width:d,height:c}=tileSize(o),i=tileChart(e,o);if(i.chart)return{svg:I(A(r,e,i.chart),d,c,{...e.book?{colors:e.book.colors}:{}}),alt:k(s),problems:n};i.problem!==void 0&&n.push(i.problem);const f=F(e.book?.colors??E,{...t.ground===void 0?{}:{ground:t.ground},font:TILE_FONT});return{svg:j(s,{width:d*.75,height:c*.75},f,{id:t.id??`t${String(o.index)}`,look:TILE_LOOK}),alt:k(s),problems:n}}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/*! AllyHub. Copyright (c) 2026 AllyHub, Inc. All rights reserved. Use is subject to LICENSE.md. */
|
|
2
|
-
import{acrossBase as je,CHART_DEFAULTS as Se,chartExRequires as we,CHARTEX_URI as Ie,chartExReference as Te,chartExXml as Ge,chartSpaceXml as Be,isExtended as _e}from"@allyhub/chart";import{columnLetter as Pe}from"../address.js";import{Reference as Me,Union as We}from"../calc/types.js";import{CellError as Ue}from"../values.js";import{categoryNumbers as Xe,chartDef as qe,chartSize as Ve}from"../chart.js";import{parseFormula as He}from"../formula/parse.js";import{sheetPrefix as Ne}from"../formula/print.js";import{HEAD as Je,attr as m,el as o,flag as De,numberAttr as ee,tag as t,tags as C,textOf as M}from"./xml.js";const Ke="http://schemas.openxmlformats.org/drawingml/2006/spreadsheetDrawing",Qe="http://schemas.openxmlformats.org/drawingml/2006/main",Fe="http://schemas.openxmlformats.org/drawingml/2006/chart",Re="http://schemas.openxmlformats.org/officeDocument/2006/relationships",Ye="http://schemas.openxmlformats.org/markup-compatibility/2006",_=9525,Ze=(e,n)=>`${Ne(e.sheet.name)}$${Pe(e.left)}$${String(e.top+1)}${e.single?"":`:$${Pe(e.right)}$${String(n+1)}`}`;function te(e,n,s){if(!s?.node)return;const r=e.eval(s.node,{sheet:n,row:0,col:0,dr:0,dc:0}),i=l=>Ze(l,Math.min(l.bottom,Math.max(l.top,l.sheet.lastRow)));if(r instanceof Me)return i(r);if(r instanceof We)return`(${r.parts.map(i).join(",")})`;const c=s.node;if(c.kind==="name"&&c.sheet!==void 0&&!(r instanceof Ue&&r.code==="#NAME?"))return`${Ne(c.sheet)}${c.name}`}function et(e,n,s){if(!s?.node)return!1;const r=e.eval(s.node,{sheet:n,row:0,col:0,dr:0,dc:0});return r instanceof Me&&typeof e.value(r.sheet,r.top,r.left)=="number"}export function chartPart(e,n,s){const r=qe(e,n,s),i=s.series.map((a,u)=>({s:a,i:u,values:te(e,n,a.values)})).filter(a=>a.values!==void 0),c={...r,series:i.flatMap(a=>r.series[a.i]??[])},l=et(e,n,s.categories),p=l?Xe(e,n,s):void 0,f={name:a=>te(e,n,i[a]?.s.name),categories:te(e,n,s.categories),numeric:l,...p===void 0?{}:{categoryNumbers:p.values,categoryFormat:p.format},values:a=>i[a]?.values??"",x:a=>te(e,n,i[a]?.s.x??s.categories),sizes:a=>te(e,n,i[a]?.s.sizes)},g=te(e,n,s.title);return _e(c.type)?Ge(c,{refs:{name:f.name,categories:c.categories.length===0?void 0:f.categories,values:f.values}}):Be(c,{refs:f,...g===void 0?{}:{titleRef:g}})}const tt=(e,n,s)=>o("xdr:oneCellAnchor",{},o("xdr:from",{},`<xdr:col>${String(e.col)}</xdr:col>`,`<xdr:colOff>${String(Math.round(e.x*_))}</xdr:colOff>`,`<xdr:row>${String(e.row)}</xdr:row>`,`<xdr:rowOff>${String(Math.round((e.y??0)*_))}</xdr:rowOff>`),o("xdr:ext",{cx:Math.round(e.width*_),cy:Math.round(e.height*_)}),o("xdr:pic",{},o("xdr:nvPicPr",{},o("xdr:cNvPr",{id:n,name:e.name,descr:e.path}),o("xdr:cNvPicPr",{},o("a:picLocks",{noChangeAspect:!0}))),o("xdr:blipFill",{},o("a:blip",{"xmlns:r":Re,"r:embed":`rId${String(s)}`}),o("a:stretch",{},o("a:fillRect"))),o("xdr:spPr",{},o("a:xfrm",{},o("a:off",{x:0,y:0}),o("a:ext",{cx:Math.round(e.width*_),cy:Math.round(e.height*_)})),o("a:prstGeom",{prst:"rect"},o("a:avLst")))),o("xdr:clientData"));export function drawingPart(e,n=[]){const s=(r,i)=>{const{width:c,height:l}=Ve(r.spec),p=o("xdr:graphicFrame",{macro:""},o("xdr:nvGraphicFramePr",{},o("xdr:cNvPr",{id:i+2,name:`Chart ${String(i+1)}`}),o("xdr:cNvGraphicFramePr")),o("xdr:xfrm",{},o("a:off",{x:0,y:0}),o("a:ext",{cx:0,cy:0})),o("a:graphic",{},o("a:graphicData",{uri:Ie},Te(`rId${String(i+1)}`)))),f=o("mc:AlternateContent",{"xmlns:mc":Ye},o("mc:Choice",{[`xmlns:${we(r.spec.type).prefix}`]:we(r.spec.type).namespace,Requires:we(r.spec.type).prefix},p),o("mc:Fallback",{},o("xdr:sp",{macro:"",textlink:""},o("xdr:nvSpPr",{},o("xdr:cNvPr",{id:i+2,name:`Chart ${String(i+1)}`}),o("xdr:cNvSpPr",{},o("a:spLocks",{noTextEdit:!0}))),o("xdr:spPr",{},o("a:xfrm",{},o("a:off",{x:0,y:0}),o("a:ext",{cx:Math.round(c*_),cy:Math.round(l*_)})),o("a:prstGeom",{prst:"rect"},o("a:avLst")),o("a:solidFill",{},o("a:prstClr",{val:"white"})),o("a:ln",{w:1},o("a:solidFill",{},o("a:prstClr",{val:"green"})))),o("xdr:txBody",{},o("a:bodyPr",{vertOverflow:"clip",horzOverflow:"clip"}),o("a:lstStyle"),o("a:p",{},o("a:r",{},o("a:rPr",{lang:"en-US",sz:1100}),o("a:t",{},"This chart isn't available in your version of Excel.")))))));return _e(r.spec.type)?o("xdr:oneCellAnchor",{},o("xdr:from",{},`<xdr:col>${String(r.at.col)}</xdr:col>`,`<xdr:colOff>${String(Math.round((r.spec.x??0)*_))}</xdr:colOff>`,`<xdr:row>${String(r.at.row)}</xdr:row>`,`<xdr:rowOff>${String(Math.round((r.spec.y??0)*_))}</xdr:rowOff>`),o("xdr:ext",{cx:Math.round(c*_),cy:Math.round(l*_)}),f,o("xdr:clientData")):o("xdr:oneCellAnchor",{},o("xdr:from",{},`<xdr:col>${String(r.at.col)}</xdr:col>`,`<xdr:colOff>${String(Math.round((r.spec.x??0)*_))}</xdr:colOff>`,`<xdr:row>${String(r.at.row)}</xdr:row>`,`<xdr:rowOff>${String(Math.round((r.spec.y??0)*_))}</xdr:rowOff>`),o("xdr:ext",{cx:Math.round(c*_),cy:Math.round(l*_)}),o("xdr:graphicFrame",{macro:""},o("xdr:nvGraphicFramePr",{},o("xdr:cNvPr",{id:i+2,name:`Chart ${String(i+1)}`}),o("xdr:cNvGraphicFramePr")),o("xdr:xfrm",{},o("a:off",{x:0,y:0}),o("a:ext",{cx:0,cy:0})),o("a:graphic",{},o("a:graphicData",{uri:Fe},o("c:chart",{"xmlns:c":Fe,"xmlns:r":Re,"r:id":`rId${String(i+1)}`})))),o("xdr:clientData"))};return Je+o("xdr:wsDr",{"xmlns:xdr":Ke,"xmlns:a":Qe},...e.map(s),...n.map((r,i)=>tt(r,e.length+i+2,e.length+i+1)))}function le(e){if(Array.isArray(e))return e.map(le).join("");if(typeof e!="object"||e===null)return"";const n=e,s=[];for(const[r,i]of Object.entries(n))r==="t"?s.push(M(i)):typeof i=="object"&&s.push(le(i));return s.join("")}const ie=e=>{const n=t(e?.solidFill),s=m(t(n?.srgbClr),"val");return s!==void 0?`#${s.toUpperCase()}`:Ee[m(t(n?.schemeClr),"val")??""]},Ee={accent1:"#4472C4",accent2:"#ED7D31",accent3:"#A5A5A5",accent4:"#FFC000",accent5:"#5B9BD5",accent6:"#70AD47"},R=(e,n)=>m(t(e?.[n]),"val"),G=(e,n)=>ee(t(e?.[n]),"val"),ae=(e,n)=>De(t(e?.[n]),"val"),nt=e=>/^"(?:[^"]|"")*"$/u.test(e)?e.slice(1,-1).replaceAll('""','"'):void 0,ue=e=>nt(e)??`=${e}`;function Le(e){if(!e)return;const n=t(e.tx),s=t(n?.strRef);if(s)return ue(M(s.f));const r=le(n?.rich);return r===""?void 0:r}function ke(e){if(!e)return;const n=t(e.scaling),s=t(e.numFmt),r=m(s,"formatCode"),i={},c=Le(t(e.title));c!==void 0&&(i.title=c);const l=G(n,"min"),p=G(n,"max"),f=G(e,"majorUnit");return l!==void 0&&(i.min=l),p!==void 0&&(i.max=p),f!==void 0&&f>0&&(i.major=f),ae(e,"delete")===!0&&(i.visible=!1),R(n,"orientation")==="maxMin"&&(i.reverse=!0),r!==void 0&&r!=="General"&&De(s,"sourceLinked")!==!0&&(i.format=r),i}const U=e=>{const n=t(e?.numRef)??t(e?.strRef),s=n?M(n.f):"";return s===""?void 0:s};function rt(e,n,s=!1){const r=U(t(e[n?"yVal":"val"]));if(r===void 0)return"its numbers are written in the chart";const i={values:r},c=t(e.tx),l=U(c);if(l!==void 0)i.name=ue(l);else{const P=M(c?.v);P!==""&&(i.name=P)}const p=t(e.spPr),f=t(p?.ln),g=t(e.marker),a=n||g!==void 0,u=ie(p)??(a?ie(f)??ie(t(g?.spPr)):void 0);u!==void 0&&(i.color=u);const x=ee(f,"w");if(a&&x!==void 0&&f?.noFill===void 0){const P=Math.max(.25,Number((x/12700).toFixed(2)));P!==Se.lineWidth&&(i.line_width=P)}s&&f?.noFill!==void 0&&(i.line_width=0),ae(e,"smooth")===!0&&(i.smooth=!0);const $=G(g,"size");$!==void 0&&$!==Se.marker&&(i.marker_size=$);const A=n?U(t(e.xVal)):void 0;A!==void 0&&(i.x=A);const h=U(t(e.bubbleSize));h!==void 0&&(i.sizes=h);const v=n?void 0:U(t(e.cat));return{series:i,...v===void 0?{}:{categories:v}}}function Ce(e,n){const s=C(n.ser),r=c=>t(t(c.spPr)?.ln)?.noFill!==void 0,i=c=>R(t(c.marker),"symbol")==="none";switch(e){case"barChart":return st(n);case"lineChart":return s.every(i)?"line":"line-markers";case"areaChart":return ot(n);case"pieChart":return"pie";case"doughnutChart":return"doughnut";case"scatterChart":return s.every(r)?"scatter":s.some(c=>ae(c,"smooth")===!0)?"scatter-smooth":"scatter-lines";case"radarChart":return R(n,"radarStyle")==="filled"?"radar-filled":s.every(i)?"radar":"radar-markers";case"bubbleChart":return"bubble";case"stockChart":return s.length>=4&&n.upDownBars!==void 0?"stock-ohlc":"stock-hlc";default:return}}function st(e){const n=R(e,"barDir")==="bar"?"bar":"column",s=R(e,"grouping");return s==="stacked"?`${n}-stacked`:s==="percentStacked"?`${n}-stacked-100`:`${n}-clustered`}function ot(e){const n=R(e,"grouping");return n==="stacked"?"area-stacked":n==="percentStacked"?"area-stacked-100":"area"}function ze(e){const n=t(t(e?.numRef)?.numCache)??t(e?.numLit),s=[];for(const r of C(n?.pt)){const i=Number(M(r.v));s[ee(r,"idx")??s.length]=Number.isFinite(i)?i:null}return Array.from(s,r=>r??null)}function it(e){const n=[];for(const s of C(e.ser)){const r=C(s.errBars),i=R(r[0],"errDir"),c=t(s.marker),l=R(c,"symbol"),p=t(s.tx),f=r.length===1&&i==="x"?"actual":r.length===1&&i==="y"?"target":r.length>0?void 0:p===void 0&&l==="none"?"join":l!=="none"?"dot":void 0,g=t(s.xVal),a=U(g);if(f===void 0||a===void 0)return;const u={values:a},x=U(p),$=M(p?.v);x!==void 0?u.name=ue(x):$!==""&&(u.name=$);const A=ie(f==="dot"?t(c?.spPr):t(t(r[0]?.spPr)?.ln));A!==void 0&&(u.color=A);const h=G(c,"size");f==="dot"&&h!==void 0&&h!==9&&(u.marker_size=h),n.push({kind:f,series:u,numbers:ze(g)})}return n}function at(e,n,s){const r=n.find(y=>y.kind==="actual"),i=n.find(y=>y.kind==="target"),c=n.filter(y=>y.kind==="dot");if(!r&&(i!==void 0||c.length===0))return;const l=r?"bullet":"dumbbell",p=(y,j)=>{const{color:I,...T}=y.series;return I===void 0||I===Ee[`accent${String(j%6+1)}`]?T:y.series},f=r?[p(r,0),...i?[i.series]:[],...[...e.series].reverse()]:c.map(p),g=r?[r.numbers,i?.numbers??[],...C(s.ser).map(y=>ze(t(y.val)))]:c.map(y=>y.numbers),a=Math.max(0,...g.map(y=>y.length)),u=je({type:l,categories:Array.from({length:a},()=>""),series:g.map((y,j)=>({name:String(j),values:y}))}).value_axis??{},{gap_width:x,category_axis:$,value_axis:A,...h}=e;delete h.overlap;const v={...$};delete v.reverse;const{min:P,max:k,major:b,gridlines:N,...L}=A??{},z={...L,...P===void 0||P===u.minimum_scale?{}:{min:P},...k===void 0||k===u.maximum_scale?{}:{max:k},...b===void 0||b===u.major_unit?{}:{major:b},...N===void 0||N===(u.has_major_gridlines??!0)?{}:{gridlines:N}};return{...h,type:l,series:f,...x===void 0||x===60?{}:{gap_width:x},...Object.keys(z).length>0?{value_axis:z}:{},...Object.keys(v).length>0?{category_axis:v}:{}}}function B(e,n,s){if(e===void 0)return;const r=e.replace(/^=/u,"");if(/(?:^|[(,])'?\[\d+\]/u.test(r))return"it reads another workbook";if(e.includes("#REF!"))return"its cells were deleted (#REF!)";const i=/^(?:'((?:[^']|'')+)'|([^!'(),]+))!/u.exec(r),c=i?.[1]?.replaceAll("''","'")??i?.[2];if(c!==void 0&&!n(c))return`it reads a sheet the workbook does not have (${c})`;const l=He(`=${r}`);if(!l.ok||!fe(l.node,s))return`it names no cells (${r})`}function fe(e,n){switch(e.kind){case"ref":case"structured":return!0;case"name":return e.sheet!==void 0||n(e.name);case"paren":return fe(e.arg,n);case"binary":return(e.op===","||e.op===":")&&fe(e.left,n)&&fe(e.right,n);default:return!1}}export function readChart(e,n=[],s=()=>!0,r=()=>!0){const i=t(e?.chartSpace);if(i?.chartData!==void 0)return dt(i,s,r);const c=t(i?.chart),l=t(c?.plotArea);if(!c||!l)return"it has no plot";const p=Object.entries(l).filter(([d])=>d.endsWith("Chart")).flatMap(([d,O])=>C(O).map(F=>({kind:d,plot:F}))),[f]=p;if(!f)return"it has no plot";const[g,a]=p,u=p.length===2&&g?.kind==="barChart"&&R(g.plot,"barDir")==="bar"&&a?.kind==="scatterChart"?it(a.plot):void 0;if(u&&g&&a){const d=C(a.plot.axId).map(S=>m(S,"val")),O={...l};delete O.scatterChart;const F=readChart({chartSpace:{...i,chart:{...c,plotArea:{...O,valAx:C(l.valAx).filter(S=>!d.includes(m(t(S.axId),"val")))}}}},n,s,r);return typeof F=="string"?F:at(F,u,g.plot)??F}const x=C(l.valAx),$=d=>C(d.axId).map(O=>m(O,"val")),A=d=>{const O=x.find(F=>$(d).includes(m(t(F.axId),"val")));return O!==void 0&&R(O,"axPos")==="r"},h=p.length>1,v=p.map(({kind:d,plot:O})=>({kind:d,plot:O,type:Ce(d,O),secondary:h&&A(O)}));if(h&&v.some(d=>d.type===void 0||!(d.type.startsWith("column")||d.type.startsWith("line")||d.type.startsWith("area"))))return"it combines several kinds of chart, not columns, lines and areas";const P=v.find(d=>!d.secondary)??v[0]??f,{kind:k,plot:b}=P,N=k==="scatterChart"||k==="bubbleChart",L=[];let z,y;const j=v.flatMap(d=>C(d.plot.ser).map(O=>({s:O,of:d}))),I=j.filter(({s:d})=>d.trendline!==void 0).length;I>0&&n.push(I===1?"trendline":`trendlines of ${String(I)} series`);const T=j.filter(({s:d})=>d.errBars!==void 0).length;T>0&&n.push(T===1?"error bars":`error bars of ${String(T)} series`);for(const[d,{s:O,of:F}]of j.entries()){const S=rt(O,N,F.kind==="lineChart");if(typeof S=="string")return S;if(h){const ve=F.type;ve!==void 0&&ve!==Ce(k,b)&&(S.series.type=ve),F.secondary&&(S.series.secondary=!0)}const ye=B(S.series.values,s,r);if(ye!==void 0){n.push(`series ${String(d+1)}, as ${ye}`),y=ye;continue}S.series.name?.startsWith("=")===!0&&B(S.series.name,s,r)!==void 0&&delete S.series.name,B(S.series.x,s,r)!==void 0&&delete S.series.x,B(S.series.sizes,s,r)!==void 0&&delete S.series.sizes,L.push(S.series),B(S.categories,s,r)===void 0&&(z??=S.categories)}if(L.length===0)return y===void 0?"it has no series":`every series ${y.replace(/^it /u,"")}`;const W=Ce(k,b);if(!W)return`a sheet has no ${k.replace(/Chart$/u,"")} chart`;const ne=Le(t(c.title)),re=t(c.legend),X=R(re,"legendPos"),q=t(b.dLbls),E=d=>ae(q,d)===!0,se=E("showVal")||E("showPercent")||E("showCatName")||E("showSerName"),w=R(q,"dLblPos"),D=G(b,"gapWidth"),V=k==="lineChart"&&b.hiLowLines!==void 0?!0:void 0,H=v.find(d=>d.secondary&&d.kind==="barChart"&&d.plot!==b),J=H===void 0?void 0:G(H.plot,"gapWidth"),K=G(b,"overlap"),Q=G(b,"holeSize"),oe=ae(b,"varyColors"),Y=W==="pie"||W==="doughnut",ce=d=>$(b).includes(m(t(d.axId),"val")),de=[...C(l.catAx),...C(l.dateAx)],Z={value:h?x.find(ce)??x[0]:x.find((d,O,F)=>N?O===F.length-1:!0),category:N?x[0]:h?de.find(ce)??de[0]:t(l.catAx)??t(l.dateAx),second:v.some(d=>d.secondary)?x.find(d=>R(d,"axPos")==="r"):void 0},he=ke(Z.value),pe=ke(Z.category);he&&Z.value?.majorGridlines===void 0&&(he.gridlines=!1),pe&&Z.category?.majorGridlines!==void 0&&(pe.gridlines=!0);const xe=ee(t(t(t(t(i?.txPr)?.p)?.pPr)?.defRPr),"sz"),ge=d=>d&&Object.keys(d).length>0?d:void 0,$e=ge(he),Ae=ge(pe),be=ke(Z.second);be&&Z.second?.majorGridlines!==void 0&&(be.gridlines=!0);const Oe=ge(be);return{type:W,at:"A1",...ne===void 0?{}:{title:ne},...z===void 0?{}:{categories:z},series:Y?L.slice(0,1):L,...re?{legend:X==="b"?"bottom":X==="t"?"top":X==="l"?"left":"right"}:{},...se?{labels:{...E("showVal")?{value:!0}:{},...E("showPercent")?{percentage:!0}:{},...E("showCatName")?{category:!0}:{},...E("showSerName")?{series:!0}:{},...w===void 0?{}:{position:w}}}:{},...D===void 0||D===150?{}:{gap_width:D},...K===void 0||W.includes("stacked")?{}:{overlap:K},...Q===void 0||Q===50?{}:{hole_size:Q},...V?{high_low_lines:!0}:{},...J===void 0||J===(D??150)?{}:{secondary_gap_width:J},...oe===!0&&k==="barChart"?{vary_by_categories:!0}:{},...oe===!1&&Y?{vary_by_categories:!1}:{},...$e?{value_axis:$e}:{},...Ae?{category_axis:Ae}:{},...Oe?{secondary_axis:Oe}:{},...xe===void 0||xe===900?{}:{size:xe/100}}}const ct={waterfall:"waterfall",boxWhisker:"box-whisker",clusteredColumn:"histogram",treemap:"treemap",sunburst:"sunburst",funnel:"funnel"};function dt(e,n,s){const r=t(e.chart),i=t(t(r?.plotArea)?.plotAreaRegion),c=C(i?.series),l=c.filter(w=>m(w,"layoutId")!=="paretoLine"),p=c.some(w=>m(w,"layoutId")==="paretoLine"),f=l[0];if(!f)return"it has no series";const g=ct[m(f,"layoutId")??""];if(g===void 0)return`a sheet has no ${m(f,"layoutId")??""} chart`;const a=p?"pareto":g,u=new Map(C(t(e.chartData)?.data).map(w=>[m(w,"id")??"0",w])),x=a==="box-whisker",$=[];let A,h=[];for(const w of x?l:[f]){const D=u.get(m(t(w.dataId),"val")??"0"),V=M(t(D?.numDim)?.f);if(V==="")return"its numbers are written in the chart";if(B(V,n,s)!==void 0)return`its numbers ${String(B(V,n,s))}`;const H={values:V},J=t(t(w.tx)?.txData),K=M(J?.f),Q=M(J?.v);K!==""&&B(K,n,s)===void 0?H.name=ue(K):Q!==""&&(H.name=Q),$.push(H);const oe=t(D?.strDim),Y=M(oe?.f);if(Y!==""&&B(Y,n,s)===void 0&&(A??=Y),h.length===0){const ce=C(oe?.lvl)[0];h=C(ce?.pt).map(de=>M(de))}}const v=t(f.layoutPr),P=t(v?.visibility),k=w=>{const D=m(P,w);return D===void 0?void 0:D==="1"||D==="true"},b=t(v?.binning),N=w=>w===void 0||w.trim()===""||!Number.isFinite(Number(w))?void 0:Number(w),L=N(m(t(b?.binSize),"val")),z=N(m(t(b?.binCount),"val")),y=N(m(b,"overflow")),j=N(m(b,"underflow")),I=C(t(v?.subtotals)?.idx).flatMap(w=>{const D=h[Number(m(w,"val"))];return D===void 0||D===""?[]:[D]}),T=m(t(v?.parentLabelLayout),"val"),W=m(t(v?.statistics),"quartileMethod"),ne=t(r?.title),re=M(t(t(ne?.tx)?.txData)?.v)||le(t(ne?.tx)?.rich),X=t(r?.legend),q=m(X,"pos"),E=t(f.dataLabels),se=t(E?.visibility);return{type:a,at:"A1",...re===""?{}:{title:re},...A===void 0?{}:{categories:A},series:$,...X?{legend:q==="b"?"bottom":q==="t"?"top":q==="l"?"left":"right"}:{},...E===void 0&&(a==="waterfall"||a==="funnel"||a==="treemap"||a==="sunburst")?{labels:!1}:E!==void 0&&!(a==="waterfall"||a==="funnel"||a==="treemap"||a==="sunburst")?{labels:{...m(se,"value")==="1"?{value:!0}:{},...m(se,"categoryName")==="1"?{category:!0}:{},...m(se,"seriesName")==="1"?{series:!0}:{}}}:{},...I.length>0?{totals:I}:{},...k("connectorLines")===!1?{connector_lines:!1}:{},...W==="inclusive"?{quartiles:"inclusive"}:{},...k("meanMarker")===!1?{mean_markers:!1}:{},...k("meanLine")===!0?{mean_line:!0}:{},...k("outliers")===!1?{outliers:!1}:{},...k("nonoutliers")===!0?{inner_points:!0}:{},...L!==void 0&&L>0?{bin_width:L}:z!==void 0&&z>0?{bin_count:Math.round(z)}:{},...y===void 0?{}:{overflow:y},...j===void 0?{}:{underflow:j},...m(b,"intervalClosed")==="l"?{interval_closed:"left"}:{},...T==="overlapping"||T==="none"?{parent_labels:T}:{}}}const me=e=>Math.round(e/_);export function chartAnchors(e,n,s){const r=t(e?.wsDr),i=[],c=[];let l=0;const p=a=>({col:Number(M(a?.col)),row:Number(M(a?.row)),colOff:me(Number(M(a?.colOff))),rowOff:me(Number(M(a?.rowOff)))}),f=a=>{const u=t(a.graphicFrame)??t(t(t(a.AlternateContent)?.Choice)?.graphicFrame);return m(t(t(t(u?.graphic)?.graphicData)?.chart),"id")},g=(a,u,x,$)=>{const A={at:{row:u.row,col:u.col},...u.colOff>0?{x:u.colOff}:{},...u.rowOff>0?{y:u.rowOff}:{},width:x,height:$},h=t(a.pic),v=m(t(t(h?.blipFill)?.blip),"embed");if(h&&v!==void 0){const k=t(t(h.nvPicPr)?.cNvPr),b=m(k,"name"),N=m(k,"descr");c.push({id:v,...A,...b===void 0?{}:{name:b},...N===void 0?{}:{descr:N}});return}const P=f(a);if(P===void 0){l+=1;return}i.push({id:P,...A})};for(const a of C(r?.oneCellAnchor)){const u=t(a.ext);g(a,p(t(a.from)),me(ee(u,"cx")??0),me(ee(u,"cy")??0))}for(const a of C(r?.twoCellAnchor)){const u=p(t(a.from)),x=p(t(a.to));let $=x.colOff-u.colOff;for(let h=u.col;h<x.col;h++)$+=n(h);let A=x.rowOff-u.rowOff;for(let h=u.row;h<x.row;h++)A+=s(h);g(a,u,$,A)}return{anchors:i,pictures:c,others:l}}
|
|
2
|
+
import{acrossBase as je,CHART_DEFAULTS as Se,chartExRequires as we,CHARTEX_URI as Ie,chartExReference as Te,chartExXml as Ge,chartSpaceXml as Be,isExtended as _e}from"@allyhub/chart";import{columnLetter as Pe}from"../address.js";import{Reference as Me,Union as We}from"../calc/types.js";import{CellError as Ue}from"../values.js";import{categoryNumbers as Xe,chartDef as qe,chartSize as Ve}from"../chart.js";import{parseFormula as He}from"../formula/parse.js";import{sheetPrefix as Ne}from"../formula/print.js";import{HEAD as Je,attr as h,el as o,flag as De,numberAttr as ee,tag as t,tags as C,textOf as M}from"./xml.js";const Ke="http://schemas.openxmlformats.org/drawingml/2006/spreadsheetDrawing",Qe="http://schemas.openxmlformats.org/drawingml/2006/main",Fe="http://schemas.openxmlformats.org/drawingml/2006/chart",Re="http://schemas.openxmlformats.org/officeDocument/2006/relationships",Ye="http://schemas.openxmlformats.org/markup-compatibility/2006",_=9525,Ze=(e,n)=>`${Ne(e.sheet.name)}$${Pe(e.left)}$${String(e.top+1)}${e.single?"":`:$${Pe(e.right)}$${String(n+1)}`}`;function te(e,n,s){if(!s?.node)return;const i=e.eval(s.node,{sheet:n,row:0,col:0,dr:0,dc:0}),r=l=>Ze(l,Math.min(l.bottom,Math.max(l.top,l.sheet.lastRow)));if(i instanceof Me)return r(i);if(i instanceof We)return`(${i.parts.map(r).join(",")})`;const a=s.node;if(a.kind==="name"&&a.sheet!==void 0&&!(i instanceof Ue&&i.code==="#NAME?"))return`${Ne(a.sheet)}${a.name}`}function et(e,n,s){if(!s?.node)return!1;const i=e.eval(s.node,{sheet:n,row:0,col:0,dr:0,dc:0});return i instanceof Me&&typeof e.value(i.sheet,i.top,i.left)=="number"}export function chartPart(e,n,s){const i=qe(e,n,s),r=s.series.map((c,u)=>({s:c,i:u,values:te(e,n,c.values)})).filter(c=>c.values!==void 0),a={...i,series:r.flatMap(c=>i.series[c.i]??[])},l=et(e,n,s.categories),m=l?Xe(e,n,s):void 0,f={name:c=>te(e,n,r[c]?.s.name),categories:te(e,n,s.categories),numeric:l,...m===void 0?{}:{categoryNumbers:m.values,categoryFormat:m.format},values:c=>r[c]?.values??"",x:c=>te(e,n,r[c]?.s.x??s.categories),sizes:c=>te(e,n,r[c]?.s.sizes)},x=te(e,n,s.title);return _e(a.type)?Ge(a,{refs:{name:f.name,categories:a.categories.length===0?void 0:f.categories,values:f.values}}):Be(a,{refs:f,...x===void 0?{}:{titleRef:x}})}const tt=(e,n,s)=>o("xdr:oneCellAnchor",{},o("xdr:from",{},`<xdr:col>${String(e.col)}</xdr:col>`,`<xdr:colOff>${String(Math.round(e.x*_))}</xdr:colOff>`,`<xdr:row>${String(e.row)}</xdr:row>`,`<xdr:rowOff>${String(Math.round((e.y??0)*_))}</xdr:rowOff>`),o("xdr:ext",{cx:Math.round(e.width*_),cy:Math.round(e.height*_)}),o("xdr:pic",{},o("xdr:nvPicPr",{},o("xdr:cNvPr",{id:n,name:e.name,descr:e.path}),o("xdr:cNvPicPr",{},o("a:picLocks",{noChangeAspect:!0}))),o("xdr:blipFill",{},o("a:blip",{"xmlns:r":Re,"r:embed":`rId${String(s)}`}),o("a:stretch",{},o("a:fillRect"))),o("xdr:spPr",{},o("a:xfrm",{},o("a:off",{x:0,y:0}),o("a:ext",{cx:Math.round(e.width*_),cy:Math.round(e.height*_)})),o("a:prstGeom",{prst:"rect"},o("a:avLst")))),o("xdr:clientData"));export function drawingPart(e,n=[],s=[]){const i=(r,a)=>{const{width:l,height:m}=Ve(r.spec),f=o("xdr:graphicFrame",{macro:""},o("xdr:nvGraphicFramePr",{},o("xdr:cNvPr",{id:a+2,name:`Chart ${String(a+1)}`}),o("xdr:cNvGraphicFramePr")),o("xdr:xfrm",{},o("a:off",{x:0,y:0}),o("a:ext",{cx:0,cy:0})),o("a:graphic",{},o("a:graphicData",{uri:Ie},Te(`rId${String(a+1)}`)))),x=o("mc:AlternateContent",{"xmlns:mc":Ye},o("mc:Choice",{[`xmlns:${we(r.spec.type).prefix}`]:we(r.spec.type).namespace,Requires:we(r.spec.type).prefix},f),o("mc:Fallback",{},o("xdr:sp",{macro:"",textlink:""},o("xdr:nvSpPr",{},o("xdr:cNvPr",{id:a+2,name:`Chart ${String(a+1)}`}),o("xdr:cNvSpPr",{},o("a:spLocks",{noTextEdit:!0}))),o("xdr:spPr",{},o("a:xfrm",{},o("a:off",{x:0,y:0}),o("a:ext",{cx:Math.round(l*_),cy:Math.round(m*_)})),o("a:prstGeom",{prst:"rect"},o("a:avLst")),o("a:solidFill",{},o("a:prstClr",{val:"white"})),o("a:ln",{w:1},o("a:solidFill",{},o("a:prstClr",{val:"green"})))),o("xdr:txBody",{},o("a:bodyPr",{vertOverflow:"clip",horzOverflow:"clip"}),o("a:lstStyle"),o("a:p",{},o("a:r",{},o("a:rPr",{lang:"en-US",sz:1100}),o("a:t",{},"This chart isn't available in your version of Excel.")))))));return _e(r.spec.type)?o("xdr:oneCellAnchor",{},o("xdr:from",{},`<xdr:col>${String(r.at.col)}</xdr:col>`,`<xdr:colOff>${String(Math.round((r.spec.x??0)*_))}</xdr:colOff>`,`<xdr:row>${String(r.at.row)}</xdr:row>`,`<xdr:rowOff>${String(Math.round((r.spec.y??0)*_))}</xdr:rowOff>`),o("xdr:ext",{cx:Math.round(l*_),cy:Math.round(m*_)}),x,o("xdr:clientData")):o("xdr:oneCellAnchor",{},o("xdr:from",{},`<xdr:col>${String(r.at.col)}</xdr:col>`,`<xdr:colOff>${String(Math.round((r.spec.x??0)*_))}</xdr:colOff>`,`<xdr:row>${String(r.at.row)}</xdr:row>`,`<xdr:rowOff>${String(Math.round((r.spec.y??0)*_))}</xdr:rowOff>`),o("xdr:ext",{cx:Math.round(l*_),cy:Math.round(m*_)}),o("xdr:graphicFrame",{macro:""},o("xdr:nvGraphicFramePr",{},o("xdr:cNvPr",{id:a+2,name:`Chart ${String(a+1)}`}),o("xdr:cNvGraphicFramePr")),o("xdr:xfrm",{},o("a:off",{x:0,y:0}),o("a:ext",{cx:0,cy:0})),o("a:graphic",{},o("a:graphicData",{uri:Fe},o("c:chart",{"xmlns:c":Fe,"xmlns:r":Re,"r:id":`rId${String(a+1)}`})))),o("xdr:clientData"))};return Je+o("xdr:wsDr",{"xmlns:xdr":Ke,"xmlns:a":Qe},...e.map(i),...n.map((r,a)=>tt(r,e.length+a+2,e.length+a+1)),...s)}function le(e){if(Array.isArray(e))return e.map(le).join("");if(typeof e!="object"||e===null)return"";const n=e,s=[];for(const[i,r]of Object.entries(n))i==="t"?s.push(M(r)):typeof r=="object"&&s.push(le(r));return s.join("")}const ie=e=>{const n=t(e?.solidFill),s=h(t(n?.srgbClr),"val");return s!==void 0?`#${s.toUpperCase()}`:Ee[h(t(n?.schemeClr),"val")??""]},Ee={accent1:"#4472C4",accent2:"#ED7D31",accent3:"#A5A5A5",accent4:"#FFC000",accent5:"#5B9BD5",accent6:"#70AD47"},R=(e,n)=>h(t(e?.[n]),"val"),G=(e,n)=>ee(t(e?.[n]),"val"),ae=(e,n)=>De(t(e?.[n]),"val"),nt=e=>/^"(?:[^"]|"")*"$/u.test(e)?e.slice(1,-1).replaceAll('""','"'):void 0,ue=e=>nt(e)??`=${e}`;function Le(e){if(!e)return;const n=t(e.tx),s=t(n?.strRef);if(s)return ue(M(s.f));const i=le(n?.rich);return i===""?void 0:i}function ke(e){if(!e)return;const n=t(e.scaling),s=t(e.numFmt),i=h(s,"formatCode"),r={},a=Le(t(e.title));a!==void 0&&(r.title=a);const l=G(n,"min"),m=G(n,"max"),f=G(e,"majorUnit");return l!==void 0&&(r.min=l),m!==void 0&&(r.max=m),f!==void 0&&f>0&&(r.major=f),ae(e,"delete")===!0&&(r.visible=!1),R(n,"orientation")==="maxMin"&&(r.reverse=!0),i!==void 0&&i!=="General"&&De(s,"sourceLinked")!==!0&&(r.format=i),r}const U=e=>{const n=t(e?.numRef)??t(e?.strRef),s=n?M(n.f):"";return s===""?void 0:s};function rt(e,n,s=!1){const i=U(t(e[n?"yVal":"val"]));if(i===void 0)return"its numbers are written in the chart";const r={values:i},a=t(e.tx),l=U(a);if(l!==void 0)r.name=ue(l);else{const P=M(a?.v);P!==""&&(r.name=P)}const m=t(e.spPr),f=t(m?.ln),x=t(e.marker),c=n||x!==void 0,u=ie(m)??(c?ie(f)??ie(t(x?.spPr)):void 0);u!==void 0&&(r.color=u);const g=ee(f,"w");if(c&&g!==void 0&&f?.noFill===void 0){const P=Math.max(.25,Number((g/12700).toFixed(2)));P!==Se.lineWidth&&(r.line_width=P)}s&&f?.noFill!==void 0&&(r.line_width=0),ae(e,"smooth")===!0&&(r.smooth=!0);const $=G(x,"size");$!==void 0&&$!==Se.marker&&(r.marker_size=$);const A=n?U(t(e.xVal)):void 0;A!==void 0&&(r.x=A);const p=U(t(e.bubbleSize));p!==void 0&&(r.sizes=p);const v=n?void 0:U(t(e.cat));return{series:r,...v===void 0?{}:{categories:v}}}function Ce(e,n){const s=C(n.ser),i=a=>t(t(a.spPr)?.ln)?.noFill!==void 0,r=a=>R(t(a.marker),"symbol")==="none";switch(e){case"barChart":return st(n);case"lineChart":return s.every(r)?"line":"line-markers";case"areaChart":return ot(n);case"pieChart":return"pie";case"doughnutChart":return"doughnut";case"scatterChart":return s.every(i)?"scatter":s.some(a=>ae(a,"smooth")===!0)?"scatter-smooth":"scatter-lines";case"radarChart":return R(n,"radarStyle")==="filled"?"radar-filled":s.every(r)?"radar":"radar-markers";case"bubbleChart":return"bubble";case"stockChart":return s.length>=4&&n.upDownBars!==void 0?"stock-ohlc":"stock-hlc";default:return}}function st(e){const n=R(e,"barDir")==="bar"?"bar":"column",s=R(e,"grouping");return s==="stacked"?`${n}-stacked`:s==="percentStacked"?`${n}-stacked-100`:`${n}-clustered`}function ot(e){const n=R(e,"grouping");return n==="stacked"?"area-stacked":n==="percentStacked"?"area-stacked-100":"area"}function ze(e){const n=t(t(e?.numRef)?.numCache)??t(e?.numLit),s=[];for(const i of C(n?.pt)){const r=Number(M(i.v));s[ee(i,"idx")??s.length]=Number.isFinite(r)?r:null}return Array.from(s,i=>i??null)}function it(e){const n=[];for(const s of C(e.ser)){const i=C(s.errBars),r=R(i[0],"errDir"),a=t(s.marker),l=R(a,"symbol"),m=t(s.tx),f=i.length===1&&r==="x"?"actual":i.length===1&&r==="y"?"target":i.length>0?void 0:m===void 0&&l==="none"?"join":l!=="none"?"dot":void 0,x=t(s.xVal),c=U(x);if(f===void 0||c===void 0)return;const u={values:c},g=U(m),$=M(m?.v);g!==void 0?u.name=ue(g):$!==""&&(u.name=$);const A=ie(f==="dot"?t(a?.spPr):t(t(i[0]?.spPr)?.ln));A!==void 0&&(u.color=A);const p=G(a,"size");f==="dot"&&p!==void 0&&p!==9&&(u.marker_size=p),n.push({kind:f,series:u,numbers:ze(x)})}return n}function at(e,n,s){const i=n.find(y=>y.kind==="actual"),r=n.find(y=>y.kind==="target"),a=n.filter(y=>y.kind==="dot");if(!i&&(r!==void 0||a.length===0))return;const l=i?"bullet":"dumbbell",m=(y,j)=>{const{color:I,...T}=y.series;return I===void 0||I===Ee[`accent${String(j%6+1)}`]?T:y.series},f=i?[m(i,0),...r?[r.series]:[],...[...e.series].reverse()]:a.map(m),x=i?[i.numbers,r?.numbers??[],...C(s.ser).map(y=>ze(t(y.val)))]:a.map(y=>y.numbers),c=Math.max(0,...x.map(y=>y.length)),u=je({type:l,categories:Array.from({length:c},()=>""),series:x.map((y,j)=>({name:String(j),values:y}))}).value_axis??{},{gap_width:g,category_axis:$,value_axis:A,...p}=e;delete p.overlap;const v={...$};delete v.reverse;const{min:P,max:k,major:b,gridlines:N,...L}=A??{},z={...L,...P===void 0||P===u.minimum_scale?{}:{min:P},...k===void 0||k===u.maximum_scale?{}:{max:k},...b===void 0||b===u.major_unit?{}:{major:b},...N===void 0||N===(u.has_major_gridlines??!0)?{}:{gridlines:N}};return{...p,type:l,series:f,...g===void 0||g===60?{}:{gap_width:g},...Object.keys(z).length>0?{value_axis:z}:{},...Object.keys(v).length>0?{category_axis:v}:{}}}function B(e,n,s){if(e===void 0)return;const i=e.replace(/^=/u,"");if(/(?:^|[(,])'?\[\d+\]/u.test(i))return"it reads another workbook";if(e.includes("#REF!"))return"its cells were deleted (#REF!)";const r=/^(?:'((?:[^']|'')+)'|([^!'(),]+))!/u.exec(i),a=r?.[1]?.replaceAll("''","'")??r?.[2];if(a!==void 0&&!n(a))return`it reads a sheet the workbook does not have (${a})`;const l=He(`=${i}`);if(!l.ok||!fe(l.node,s))return`it names no cells (${i})`}function fe(e,n){switch(e.kind){case"ref":case"structured":return!0;case"name":return e.sheet!==void 0||n(e.name);case"paren":return fe(e.arg,n);case"binary":return(e.op===","||e.op===":")&&fe(e.left,n)&&fe(e.right,n);default:return!1}}export function readChart(e,n=[],s=()=>!0,i=()=>!0){const r=t(e?.chartSpace);if(r?.chartData!==void 0)return dt(r,s,i);const a=t(r?.chart),l=t(a?.plotArea);if(!a||!l)return"it has no plot";const m=Object.entries(l).filter(([d])=>d.endsWith("Chart")).flatMap(([d,O])=>C(O).map(F=>({kind:d,plot:F}))),[f]=m;if(!f)return"it has no plot";const[x,c]=m,u=m.length===2&&x?.kind==="barChart"&&R(x.plot,"barDir")==="bar"&&c?.kind==="scatterChart"?it(c.plot):void 0;if(u&&x&&c){const d=C(c.plot.axId).map(S=>h(S,"val")),O={...l};delete O.scatterChart;const F=readChart({chartSpace:{...r,chart:{...a,plotArea:{...O,valAx:C(l.valAx).filter(S=>!d.includes(h(t(S.axId),"val")))}}}},n,s,i);return typeof F=="string"?F:at(F,u,x.plot)??F}const g=C(l.valAx),$=d=>C(d.axId).map(O=>h(O,"val")),A=d=>{const O=g.find(F=>$(d).includes(h(t(F.axId),"val")));return O!==void 0&&R(O,"axPos")==="r"},p=m.length>1,v=m.map(({kind:d,plot:O})=>({kind:d,plot:O,type:Ce(d,O),secondary:p&&A(O)}));if(p&&v.some(d=>d.type===void 0||!(d.type.startsWith("column")||d.type.startsWith("line")||d.type.startsWith("area"))))return"it combines several kinds of chart, not columns, lines and areas";const P=v.find(d=>!d.secondary)??v[0]??f,{kind:k,plot:b}=P,N=k==="scatterChart"||k==="bubbleChart",L=[];let z,y;const j=v.flatMap(d=>C(d.plot.ser).map(O=>({s:O,of:d}))),I=j.filter(({s:d})=>d.trendline!==void 0).length;I>0&&n.push(I===1?"trendline":`trendlines of ${String(I)} series`);const T=j.filter(({s:d})=>d.errBars!==void 0).length;T>0&&n.push(T===1?"error bars":`error bars of ${String(T)} series`);for(const[d,{s:O,of:F}]of j.entries()){const S=rt(O,N,F.kind==="lineChart");if(typeof S=="string")return S;if(p){const ve=F.type;ve!==void 0&&ve!==Ce(k,b)&&(S.series.type=ve),F.secondary&&(S.series.secondary=!0)}const ye=B(S.series.values,s,i);if(ye!==void 0){n.push(`series ${String(d+1)}, as ${ye}`),y=ye;continue}S.series.name?.startsWith("=")===!0&&B(S.series.name,s,i)!==void 0&&delete S.series.name,B(S.series.x,s,i)!==void 0&&delete S.series.x,B(S.series.sizes,s,i)!==void 0&&delete S.series.sizes,L.push(S.series),B(S.categories,s,i)===void 0&&(z??=S.categories)}if(L.length===0)return y===void 0?"it has no series":`every series ${y.replace(/^it /u,"")}`;const W=Ce(k,b);if(!W)return`a sheet has no ${k.replace(/Chart$/u,"")} chart`;const ne=Le(t(a.title)),re=t(a.legend),X=R(re,"legendPos"),q=t(b.dLbls),E=d=>ae(q,d)===!0,se=E("showVal")||E("showPercent")||E("showCatName")||E("showSerName"),w=R(q,"dLblPos"),D=G(b,"gapWidth"),V=k==="lineChart"&&b.hiLowLines!==void 0?!0:void 0,H=v.find(d=>d.secondary&&d.kind==="barChart"&&d.plot!==b),J=H===void 0?void 0:G(H.plot,"gapWidth"),K=G(b,"overlap"),Q=G(b,"holeSize"),oe=ae(b,"varyColors"),Y=W==="pie"||W==="doughnut",ce=d=>$(b).includes(h(t(d.axId),"val")),de=[...C(l.catAx),...C(l.dateAx)],Z={value:p?g.find(ce)??g[0]:g.find((d,O,F)=>N?O===F.length-1:!0),category:N?g[0]:p?de.find(ce)??de[0]:t(l.catAx)??t(l.dateAx),second:v.some(d=>d.secondary)?g.find(d=>R(d,"axPos")==="r"):void 0},he=ke(Z.value),pe=ke(Z.category);he&&Z.value?.majorGridlines===void 0&&(he.gridlines=!1),pe&&Z.category?.majorGridlines!==void 0&&(pe.gridlines=!0);const xe=ee(t(t(t(t(r?.txPr)?.p)?.pPr)?.defRPr),"sz"),ge=d=>d&&Object.keys(d).length>0?d:void 0,$e=ge(he),Ae=ge(pe),be=ke(Z.second);be&&Z.second?.majorGridlines!==void 0&&(be.gridlines=!0);const Oe=ge(be);return{type:W,at:"A1",...ne===void 0?{}:{title:ne},...z===void 0?{}:{categories:z},series:Y?L.slice(0,1):L,...re?{legend:X==="b"?"bottom":X==="t"?"top":X==="l"?"left":"right"}:{},...se?{labels:{...E("showVal")?{value:!0}:{},...E("showPercent")?{percentage:!0}:{},...E("showCatName")?{category:!0}:{},...E("showSerName")?{series:!0}:{},...w===void 0?{}:{position:w}}}:{},...D===void 0||D===150?{}:{gap_width:D},...K===void 0||W.includes("stacked")?{}:{overlap:K},...Q===void 0||Q===50?{}:{hole_size:Q},...V?{high_low_lines:!0}:{},...J===void 0||J===(D??150)?{}:{secondary_gap_width:J},...oe===!0&&k==="barChart"?{vary_by_categories:!0}:{},...oe===!1&&Y?{vary_by_categories:!1}:{},...$e?{value_axis:$e}:{},...Ae?{category_axis:Ae}:{},...Oe?{secondary_axis:Oe}:{},...xe===void 0||xe===900?{}:{size:xe/100}}}const ct={waterfall:"waterfall",boxWhisker:"box-whisker",clusteredColumn:"histogram",treemap:"treemap",sunburst:"sunburst",funnel:"funnel"};function dt(e,n,s){const i=t(e.chart),r=t(t(i?.plotArea)?.plotAreaRegion),a=C(r?.series),l=a.filter(w=>h(w,"layoutId")!=="paretoLine"),m=a.some(w=>h(w,"layoutId")==="paretoLine"),f=l[0];if(!f)return"it has no series";const x=ct[h(f,"layoutId")??""];if(x===void 0)return`a sheet has no ${h(f,"layoutId")??""} chart`;const c=m?"pareto":x,u=new Map(C(t(e.chartData)?.data).map(w=>[h(w,"id")??"0",w])),g=c==="box-whisker",$=[];let A,p=[];for(const w of g?l:[f]){const D=u.get(h(t(w.dataId),"val")??"0"),V=M(t(D?.numDim)?.f);if(V==="")return"its numbers are written in the chart";if(B(V,n,s)!==void 0)return`its numbers ${String(B(V,n,s))}`;const H={values:V},J=t(t(w.tx)?.txData),K=M(J?.f),Q=M(J?.v);K!==""&&B(K,n,s)===void 0?H.name=ue(K):Q!==""&&(H.name=Q),$.push(H);const oe=t(D?.strDim),Y=M(oe?.f);if(Y!==""&&B(Y,n,s)===void 0&&(A??=Y),p.length===0){const ce=C(oe?.lvl)[0];p=C(ce?.pt).map(de=>M(de))}}const v=t(f.layoutPr),P=t(v?.visibility),k=w=>{const D=h(P,w);return D===void 0?void 0:D==="1"||D==="true"},b=t(v?.binning),N=w=>w===void 0||w.trim()===""||!Number.isFinite(Number(w))?void 0:Number(w),L=N(h(t(b?.binSize),"val")),z=N(h(t(b?.binCount),"val")),y=N(h(b,"overflow")),j=N(h(b,"underflow")),I=C(t(v?.subtotals)?.idx).flatMap(w=>{const D=p[Number(h(w,"val"))];return D===void 0||D===""?[]:[D]}),T=h(t(v?.parentLabelLayout),"val"),W=h(t(v?.statistics),"quartileMethod"),ne=t(i?.title),re=M(t(t(ne?.tx)?.txData)?.v)||le(t(ne?.tx)?.rich),X=t(i?.legend),q=h(X,"pos"),E=t(f.dataLabels),se=t(E?.visibility);return{type:c,at:"A1",...re===""?{}:{title:re},...A===void 0?{}:{categories:A},series:$,...X?{legend:q==="b"?"bottom":q==="t"?"top":q==="l"?"left":"right"}:{},...E===void 0&&(c==="waterfall"||c==="funnel"||c==="treemap"||c==="sunburst")?{labels:!1}:E!==void 0&&!(c==="waterfall"||c==="funnel"||c==="treemap"||c==="sunburst")?{labels:{...h(se,"value")==="1"?{value:!0}:{},...h(se,"categoryName")==="1"?{category:!0}:{},...h(se,"seriesName")==="1"?{series:!0}:{}}}:{},...I.length>0?{totals:I}:{},...k("connectorLines")===!1?{connector_lines:!1}:{},...W==="inclusive"?{quartiles:"inclusive"}:{},...k("meanMarker")===!1?{mean_markers:!1}:{},...k("meanLine")===!0?{mean_line:!0}:{},...k("outliers")===!1?{outliers:!1}:{},...k("nonoutliers")===!0?{inner_points:!0}:{},...L!==void 0&&L>0?{bin_width:L}:z!==void 0&&z>0?{bin_count:Math.round(z)}:{},...y===void 0?{}:{overflow:y},...j===void 0?{}:{underflow:j},...h(b,"intervalClosed")==="l"?{interval_closed:"left"}:{},...T==="overlapping"||T==="none"?{parent_labels:T}:{}}}const me=e=>Math.round(e/_);export function chartAnchors(e,n,s){const i=t(e?.wsDr),r=[],a=[];let l=0;const m=c=>({col:Number(M(c?.col)),row:Number(M(c?.row)),colOff:me(Number(M(c?.colOff))),rowOff:me(Number(M(c?.rowOff)))}),f=c=>{const u=t(c.graphicFrame)??t(t(t(c.AlternateContent)?.Choice)?.graphicFrame);return h(t(t(t(u?.graphic)?.graphicData)?.chart),"id")},x=(c,u,g,$)=>{const A={at:{row:u.row,col:u.col},...u.colOff>0?{x:u.colOff}:{},...u.rowOff>0?{y:u.rowOff}:{},width:g,height:$},p=t(c.pic),v=h(t(t(p?.blipFill)?.blip),"embed");if(p&&v!==void 0){const k=t(t(p.nvPicPr)?.cNvPr),b=h(k,"name"),N=h(k,"descr");a.push({id:v,...A,...b===void 0?{}:{name:b},...N===void 0?{}:{descr:N}});return}const P=f(c);if(P===void 0){l+=1;return}r.push({id:P,...A})};for(const c of C(i?.oneCellAnchor)){const u=t(c.ext);x(c,m(t(c.from)),me(ee(u,"cx")??0),me(ee(u,"cy")??0))}for(const c of C(i?.twoCellAnchor)){const u=m(t(c.from)),g=m(t(c.to));let $=g.colOff-u.colOff;for(let p=u.col;p<g.col;p++)$+=n(p);let A=g.rowOff-u.rowOff;for(let p=u.row;p<g.row;p++)A+=s(p);x(c,u,$,A)}return{anchors:r,pictures:a,others:l}}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
/*! AllyHub. Copyright (c) 2026 AllyHub, Inc. All rights reserved. Use is subject to LICENSE.md. */
|
|
2
|
+
import{absolutePath as O,blockLayout as $,paintRgb as k,paletteOfTheme as G}from"@allyhub/blocks";import{OFFICE_COLORS as j}from"@allyhub/formats";import{TILE_LOOK as B,tileDef as C,tileSize as A}from"../tiles.js";import{el as e,xstring as T}from"./xml.js";const E=12700,S=.75,R=new Set(["rect","ellipse","line","text","poly","path","trend","connector","icon","arc"]),f=t=>Math.round(t*E);function w(t,o,r=1){const i=k(t,o);if(!i)return e("a:noFill");const l=(i.alpha??1)*r;return e("a:solidFill",{},e("a:srgbClr",{val:i.hex},...l<1?[e("a:alpha",{val:Math.round(l*1e5)})]:[]))}function p(t,o,r,i={}){return o<=0||!k(t,r)?e("a:ln",{},e("a:noFill")):e("a:ln",{w:f(o),...i.round===!0?{cap:"rnd"}:{}},w(t,r),...i.dash===!0?[e("a:prstDash",{val:"dash"})]:[],...i.round===!0?[e("a:round")]:[],...i.arrow===!0?[e("a:tailEnd",{type:"triangle"})]:[])}function N(t,o,r,i){const l=O(t).match(/[MLCZ]|-?[\d.]+(?:e-?\d+)?/giu)??[];let n="",a=0;const s=()=>Number(l[a++]??0),c=()=>{const d=s(),u=s();return x(d*o+r,u*o+i)};for(;a<l.length;){const d=l[a++];d==="M"?n+=e("a:moveTo",{},c()):d==="L"?n+=e("a:lnTo",{},c()):d==="C"?n+=e("a:cubicBezTo",{},c(),c(),c()):d==="Z"&&(n+=e("a:close"))}return n}const y=(t,o,r,i,l={})=>e("a:xfrm",l,e("a:off",{x:f(t),y:f(o)}),e("a:ext",{cx:f(Math.max(0,r)),cy:f(Math.max(0,i))}));function h(t,o,r,i={}){return e("xdr:sp",{macro:"",textlink:i.textlink??""},e("xdr:nvSpPr",{},e("xdr:cNvPr",{id:t,name:o}),e("xdr:cNvSpPr",i.txBody===void 0?{}:{txBox:!0})),e("xdr:spPr",{},r),...i.txBody===void 0?[]:[i.txBody])}function M(t,o,r){return e("a:custGeom",{},e("a:avLst"),e("a:gdLst"),e("a:ahLst"),e("a:cxnLst"),e("a:rect",{l:0,t:0,r:"r",b:"b"}),e("a:pathLst",{},...r.map(i=>e("a:path",{w:f(Math.max(t,.01)),h:f(Math.max(o,.01)),...i.fill?{}:{fill:"none"}},i.d))))}const x=(t,o)=>e("a:pt",{x:f(t),y:f(o)});function z(t){if(typeof t!="string")return;const o=t.replace(/^=/u,"").trim();return/^(?:(?:'[^']+'|[A-Za-z0-9_.]+)!)?\$?[A-Z]{1,3}\$?\d+$/u.test(o)?o:void 0}function W(t){const o=new Map,r=t.spec[t.kind];if(r===null||typeof r!="object")return o;const i=r.value,l=z(i);l!==void 0&&o.set("value",l);const n=r.items;return Array.isArray(n)&&n.forEach((a,s)=>{if(a===null||typeof a!="object")return;const c=z(a.value);c!==void 0&&o.set(`items/${String(s)}/value`,c)}),o}function _(t,o,r,i){const l=t.face==="display"?"+mj-lt":"+mn-lt",n=t.align==="center"?"ctr":t.align==="right"?"r":"l",a=(d,u)=>e("a:rPr",{lang:"en-US",sz:Math.round(t.size*100),b:d?1:0,...t.caps===!0?{cap:"all"}:{},...t.tracking===void 0?{}:{spc:Math.round(t.tracking*t.size*100)},dirty:0},w(u,o),e("a:latin",{typeface:l}),e("a:ea",{typeface:l}),e("a:cs",{typeface:l})),s=(d,u)=>u===!0||(d??t.weight)>=600,c=r?[e("a:p",{},e("a:pPr",{algn:n}),e("a:fld",{id:`{${String(i).padStart(8,"0")}-0000-4000-8000-000000000000}`,type:"TxLink"},a(t.weight>=600,t.color),e("a:pPr",{algn:n}),e("a:t",{},T(t.lines.map(d=>d.runs.map(u=>u.text).join("")).join("")))))]:t.lines.map(d=>e("a:p",{},e("a:pPr",{algn:n}),...d.runs.map(u=>e("a:r",{},a(s(u.weight,u.bold),u.color??t.color),e("a:t",{},T(u.text))))));return e("xdr:txBody",{},e("a:bodyPr",{wrap:"none",lIns:0,tIns:0,rIns:0,bIns:0,anchor:"t",rtlCol:0,vertOverflow:"overflow",horzOverflow:"overflow"}),e("a:lstStyle"),...c)}function D(t,o,r,i){const l=t.part===""?`Shape ${String(o)}`:t.part;switch(t.type){case"rect":{const n=Math.min(t.r,t.w/2,t.h/2),a=n>0?e("a:prstGeom",{prst:"roundRect"},e("a:avLst",{},e("a:gd",{name:"adj",fmla:`val ${String(Math.round(n/Math.max(.01,Math.min(t.w,t.h))*1e5))}`}))):e("a:prstGeom",{prst:"rect"},e("a:avLst"));return h(o,l,y(t.x,t.y,t.w,t.h)+a+w(t.fill,r)+p(t.line,t.lineWidth,r))}case"ellipse":return h(o,l,y(t.x,t.y,t.w,t.h)+e("a:prstGeom",{prst:"ellipse"},e("a:avLst"))+w(t.fill,r)+p(t.line,t.lineWidth,r));case"line":case"connector":{const n=Math.min(t.x1,t.x2),a=Math.min(t.y1,t.y2),s={...t.x2<t.x1?{flipH:1}:{},...t.y2<t.y1?{flipV:1}:{}},c=t.color;return h(o,l,y(n,a,Math.abs(t.x2-t.x1),Math.abs(t.y2-t.y1),s)+e("a:prstGeom",{prst:"line"},e("a:avLst"))+e("a:noFill")+p(c,t.width,r,{dash:t.type==="line"&&t.dash}))}case"text":{const n=t.lines.length*t.lineHeight,a=i.get(t.part);return h(o,l,y(t.x,t.y,t.w,n)+e("a:prstGeom",{prst:"rect"},e("a:avLst"))+e("a:noFill")+e("a:ln",{},e("a:noFill")),{txBody:_(t,r,a,o),...a===void 0?{}:{textlink:a}})}case"poly":{const[n,...a]=t.points;if(!n)return;const s=e("a:moveTo",{},x(n[0],n[1]))+a.map(([c,d])=>e("a:lnTo",{},x(c,d))).join("")+e("a:close");return h(o,l,y(t.x,t.y,t.w,t.h)+M(t.w,t.h,[{d:s,closed:!0,fill:!0}])+w(t.fill,r)+p(t.line,t.lineWidth,r))}case"path":{let n="";for(const s of t.segs)s[0]==="M"?n+=e("a:moveTo",{},x(s[1]-t.x,s[2]-t.y)):s[0]==="L"?n+=e("a:lnTo",{},x(s[1]-t.x,s[2]-t.y)):s[0]==="C"?n+=e("a:cubicBezTo",{},x(s[1]-t.x,s[2]-t.y),x(s[3]-t.x,s[4]-t.y),x(s[5]-t.x,s[6]-t.y)):n+=e("a:close");const a=k(t.fill,r)!==void 0;return h(o,l,y(t.x,t.y,t.w,t.h)+M(t.w,t.h,[{d:n,closed:a,fill:a}])+w(t.fill,r,t.opacity??1)+p(t.line,t.lineWidth,r,{...t.arrow===!0?{arrow:!0}:{}}))}case"trend":{const n=t.values;if(n.length<2)return;const a=Math.min(...n),c=Math.max(...n)-a||1,d=(v,g)=>x(g/(n.length-1)*t.w,t.h-(v-a)/c*t.h),u=e("a:moveTo",{},d(n[0]??0,0))+n.slice(1).map((v,g)=>e("a:lnTo",{},d(v,g+1))).join("");return h(o,l,y(t.x,t.y,t.w,t.h)+M(t.w,t.h,[{d:u,closed:!1,fill:!1}])+e("a:noFill")+p(t.color,t.width,r))}case"icon":{const n=t.size/24,a=t.paths.map(s=>N(s,n,0,0)).join("");return a===""?void 0:h(o,l,y(t.x,t.y,t.size,t.size)+M(t.size,t.size,[{d:a,closed:!1,fill:!1}])+e("a:noFill")+p(t.color,t.stroke,r,{round:!0}))}case"arc":{const n=2*t.r,a=Math.max(0,Math.min(1,t.share));if(a<=0)return;const s=y(t.cx-t.r,t.cy-t.r,n,n);if(a>=.9999)return h(o,l,s+e("a:prstGeom",{prst:"ellipse"},e("a:avLst"))+e("a:noFill")+p(t.color,t.width,r));const c=e("a:moveTo",{},x(t.r,0))+e("a:arcTo",{wR:f(t.r),hR:f(t.r),stAng:162e5,swAng:Math.round(a*216e5)});return h(o,l,s+M(n,n,[{d:c,closed:!1,fill:!1}])+e("a:noFill")+p(t.color,t.width,r))}default:return}}export function tileShapes(t,o,r,i,l){const{def:n}=C(t,o,r);if(n===void 0)return;const a=A(r),s=a.width*S,c=a.height*S,d=$(n,{width:s,height:c},{look:B});if(d.marks.some(L=>!R.has(L.type)))return;const u=G(o.book?.colors??j),v=W(r),g=[];let b=i+1;for(const L of d.marks){const P=D(L,b,u,v);if(P===void 0)return;g.push(P),b+=1}const F=e("xdr:grpSp",{},e("xdr:nvGrpSpPr",{},e("xdr:cNvPr",{id:i,name:`${r.kind} ${String(r.index+1)}`,descr:l}),e("xdr:cNvGrpSpPr")),e("xdr:grpSpPr",{},e("a:xfrm",{},e("a:off",{x:0,y:0}),e("a:ext",{cx:f(s),cy:f(c)}),e("a:chOff",{x:0,y:0}),e("a:chExt",{cx:f(s),cy:f(c)}))),...g);return{xml:e("xdr:oneCellAnchor",{},e("xdr:from",{},`<xdr:col>${String(r.at.col)}</xdr:col>`,`<xdr:colOff>${String(f((r.spec.x??0)*S))}</xdr:colOff>`,`<xdr:row>${String(r.at.row)}</xdr:row>`,`<xdr:rowOff>${String(f((r.spec.y??0)*S))}</xdr:rowOff>`),e("xdr:ext",{cx:f(s),cy:f(c)}),F,e("xdr:clientData")),ids:b-i}}
|