file-viewer3 1.0.8 → 1.0.26
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/LICENSE +160 -0
- package/README.en.md +390 -0
- package/README.md +306 -89
- package/dist/components/3MFLoader.js +527 -0
- package/dist/components/AMFLoader.js +188 -0
- package/dist/components/ArchiveViewer.js +526 -0
- package/dist/components/AudioViewer.js +66 -0
- package/dist/components/CadViewer.js +9040 -0
- package/dist/components/CodeViewer.js +151 -0
- package/dist/components/ColladaLoader.js +2282 -0
- package/dist/components/DrawingViewer.js +295 -0
- package/dist/components/EdaViewer.js +630 -0
- package/dist/components/EmailViewer.js +276 -0
- package/dist/components/EpubViewer.js +172 -0
- package/dist/components/FBXLoader.js +1574 -0
- package/dist/components/GLTFLoader.js +1383 -0
- package/dist/components/ImageViewer.js +1516 -1895
- package/dist/components/KMZLoader.js +45 -0
- package/dist/components/MarkdownViewer.js +1456 -1557
- package/dist/components/ModelViewer.js +797 -0
- package/dist/components/OBJLoader.js +287 -0
- package/dist/components/OfdViewer.js +133 -0
- package/dist/components/PCDLoader.js +141 -0
- package/dist/components/PLYLoader.js +305 -0
- package/dist/components/PdfView.js +27662 -21655
- package/dist/components/PptxRender.js +11170 -21118
- package/dist/components/STLLoader.js +83 -0
- package/dist/components/TDSLoader.js +228 -0
- package/dist/components/TypstViewer.js +1697 -0
- package/dist/components/USDLoader.js +2526 -0
- package/dist/components/UmdViewer.js +1873 -0
- package/dist/components/VRMLLoader.js +6422 -0
- package/dist/components/VTKLoader.js +337 -0
- package/dist/components/XYZLoader.js +30 -0
- package/dist/components/XlsxTable.js +7871 -69873
- package/dist/components/__vite-browser-external.js +7 -0
- package/dist/components/_plugin-vue_export-helper.js +8 -0
- package/dist/components/ar-SA-G6X2FPQ2.js +523 -0
- package/dist/components/arc.js +79 -0
- package/dist/components/architecture-7EHR7CIX.js +3 -0
- package/dist/components/architectureDiagram-3BPJPVTR.js +4096 -0
- package/dist/components/archive.js +24 -0
- package/dist/components/asyncToGenerator.js +29 -0
- package/dist/components/audio.js +19 -0
- package/dist/components/az-AZ-76LH7QW2.js +523 -0
- package/dist/components/bash.js +169 -0
- package/dist/components/bg-BG-XCXSNQG7.js +523 -0
- package/dist/components/blockDiagram-GPEHLZMM.js +3357 -0
- package/dist/components/bn-BD-2XOGV67Q.js +523 -0
- package/dist/components/c4Diagram-AAUBKEIU.js +2957 -0
- package/dist/components/ca-ES-6MX7JW3Y.js +523 -0
- package/dist/components/cad.js +23 -0
- package/dist/components/cfb.js +1174 -0
- package/dist/components/channel.js +5 -0
- package/dist/components/chunk-2J33WTMH.js +26 -0
- package/dist/components/chunk-3OPIFGDE.js +4167 -0
- package/dist/components/chunk-4BX2VUAB.js +19 -0
- package/dist/components/chunk-55IACEB6.js +9 -0
- package/dist/components/chunk-5ZQYHXKU.js +669 -0
- package/dist/components/chunk-6U3AYISY.js +624 -0
- package/dist/components/chunk-727SXJPM.js +3356 -0
- package/dist/components/chunk-AGHRB4JF.js +324 -0
- package/dist/components/chunk-AQP2D5EJ.js +2055 -0
- package/dist/components/chunk-BSJP7CBP.js +83 -0
- package/dist/components/chunk-CSCIHK7Q.js +3500 -0
- package/dist/components/chunk-EIO257PC.js +1836 -0
- package/dist/components/chunk-FMBD7UC4.js +5 -0
- package/dist/components/chunk-K2UTITRG.js +17627 -0
- package/dist/components/chunk-KSCS5N6A.js +572 -0
- package/dist/components/chunk-L5ZTLDWV.js +40 -0
- package/dist/components/chunk-LZXEDZCA.js +60 -0
- package/dist/components/chunk-ND2GUHAM.js +61 -0
- package/dist/components/chunk-NNHCCRGN.js +20425 -0
- package/dist/components/chunk-NZK2D7GU.js +68 -0
- package/dist/components/chunk-O5CBEL6O.js +1894 -0
- package/dist/components/chunk-QZHKN3VN.js +12 -0
- package/dist/components/chunk-SRAX5OIU.js +22 -0
- package/dist/components/chunk-WU5MYG2G.js +14 -0
- package/dist/components/chunk-XPW4576I.js +1146 -0
- package/dist/components/chunk-Z3N5DIM6.js +59 -0
- package/dist/components/chunk-ZUYEQ4TG.js +22 -0
- package/dist/components/chunk.js +23 -0
- package/dist/components/classDiagram-4FO5ZUOK.js +29 -0
- package/dist/components/classDiagram-v2-Q7XG4LA2.js +29 -0
- package/dist/components/compiler.js +2 -0
- package/dist/components/core.js +845 -0
- package/dist/components/cose-bilkent-S5V4N54A.js +2268 -0
- package/dist/components/cpp.js +225 -0
- package/dist/components/cs-CZ-2BRQDIVT.js +523 -0
- package/dist/components/csharp.js +260 -0
- package/dist/components/css.js +140 -0
- package/dist/components/cytoscape.esm.js +18114 -0
- package/dist/components/da-DK-5WZEPLOC.js +523 -0
- package/dist/components/dagre-BM42HDAG.js +325 -0
- package/dist/components/dagre.js +1936 -0
- package/dist/components/de-DE-XR44H4JA.js +523 -0
- package/dist/components/defaultLocale.js +201 -0
- package/dist/components/defineProperty.js +50 -0
- package/dist/components/diagram-2AECGRRQ.js +229 -0
- package/dist/components/diagram-5GNKFQAL.js +108 -0
- package/dist/components/diagram-KO2AKTUF.js +443 -0
- package/dist/components/diagram-LMA3HP47.js +139 -0
- package/dist/components/diagram-OG6HWLK6.js +541 -0
- package/dist/components/diff.js +39 -0
- package/dist/components/directory-open-01563666.js +26 -0
- package/dist/components/directory-open-4ed118d0.js +83 -0
- package/dist/components/dist.js +50 -0
- package/dist/components/dist2.js +3291 -0
- package/dist/components/dist3.js +1593 -0
- package/dist/components/documentSearch.js +378 -0
- package/dist/components/docx-preview.js +3113 -0
- package/dist/components/drawing.js +19 -0
- package/dist/components/ebook.js +16 -0
- package/dist/components/eda.js +20 -0
- package/dist/components/el-GR-BZB4AONW.js +523 -0
- package/dist/components/email.js +21 -0
- package/dist/components/en-B4ZKOASM.js +3 -0
- package/dist/components/erDiagram-TEJ5UH35.js +1719 -0
- package/dist/components/es-ES-U4NZUMDT.js +523 -0
- package/dist/components/eu-ES-A7QVB2H4.js +523 -0
- package/dist/components/eventmodeling-FCH6USID.js +3 -0
- package/dist/components/fa-IR-HGAKTJCU.js +523 -0
- package/dist/components/fflate.module.js +323 -0
- package/dist/components/fi-FI-Z5N7JZ37.js +523 -0
- package/dist/components/file-open-002ab408.js +38 -0
- package/dist/components/file-open-7c801643.js +24 -0
- package/dist/components/file-save-3189631c.js +40 -0
- package/dist/components/file-save-745eba88.js +36 -0
- package/dist/components/flowDiagram-I6XJVG4X.js +4181 -0
- package/dist/components/fr-FR-RHASNOE6.js +523 -0
- package/dist/components/ganttDiagram-6RSMTGT7.js +2182 -0
- package/dist/components/gitGraph-WXDBUCRP.js +3 -0
- package/dist/components/gitGraphDiagram-PVQCEYII.js +788 -0
- package/dist/components/gl-ES-HMX3MZ6V.js +523 -0
- package/dist/components/global-compiler.js +23 -0
- package/dist/components/global-renderer.js +23 -0
- package/dist/components/go.js +140 -0
- package/dist/components/graphlib.js +1267 -0
- package/dist/components/he-IL-6SHJWFNN.js +523 -0
- package/dist/components/hi-IN-IWLTKZ5I.js +523 -0
- package/dist/components/hu-HU-A5ZG7DT2.js +523 -0
- package/dist/components/id-ID-SAP4L64H.js +523 -0
- package/dist/components/image-GAAHSSAO.js +3 -0
- package/dist/components/image-blob-reduce.esm.js +1429 -0
- package/dist/components/image.js +17 -0
- package/dist/components/info-J43DQDTF.js +3 -0
- package/dist/components/infoDiagram-5YYISTIA.js +26 -0
- package/dist/components/ini.js +88 -0
- package/dist/components/init.js +15 -0
- package/dist/components/ishikawaDiagram-YF4QCWOH.js +718 -0
- package/dist/components/it-IT-JPQ66NNP.js +523 -0
- package/dist/components/ja-JP-DBVTYXUO.js +523 -0
- package/dist/components/java.js +169 -0
- package/dist/components/javascript.js +436 -0
- package/dist/components/journeyDiagram-JHISSGLW.js +885 -0
- package/dist/components/json.js +36 -0
- package/dist/components/jszip.min.js +3033 -0
- package/dist/components/kaa-6HZHGXH3.js +523 -0
- package/dist/components/kab-KAB-ZGHBKWFO.js +523 -0
- package/dist/components/kanban-definition-UN3LZRKU.js +986 -0
- package/dist/components/katex.js +21979 -0
- package/dist/components/kk-KZ-P5N5QNE5.js +523 -0
- package/dist/components/km-KH-HSX4SM5Z.js +523 -0
- package/dist/components/ko-KR-MTYHY66A.js +523 -0
- package/dist/components/ku-TR-6OUDTVRD.js +523 -0
- package/dist/components/lib.js +4877 -0
- package/dist/components/libarchive.js +360 -0
- package/dist/components/linear.js +289 -0
- package/dist/components/lt-LT-XHIRWOB4.js +523 -0
- package/dist/components/lv-LV-5QDEKY6T.js +523 -0
- package/dist/components/markdown.js +181 -0
- package/dist/components/md.js +17 -0
- package/dist/components/mermaid-parser.core.js +328 -0
- package/dist/components/mindmap-definition-RKZ34NQL.js +1016 -0
- package/dist/components/model.js +21 -0
- package/dist/components/mp4.js +12 -0
- package/dist/components/mr-IN-CRQNXWMA.js +523 -0
- package/dist/components/my-MM-5M5IBNSE.js +523 -0
- package/dist/components/nb-NO-T6EIAALU.js +523 -0
- package/dist/components/nestedRender.js +158 -0
- package/dist/components/nl-NL-IS3SIHDZ.js +523 -0
- package/dist/components/nn-NO-6E72VCQL.js +523 -0
- package/dist/components/objectSpread2.js +29 -0
- package/dist/components/objectWithoutProperties.js +28 -0
- package/dist/components/oc-FR-POXYY2M6.js +523 -0
- package/dist/components/ofd.js +5261 -0
- package/dist/components/ofd2.js +16 -0
- package/dist/components/ordinal.js +65 -0
- package/dist/components/pa-IN-N4M65BXN.js +523 -0
- package/dist/components/packet-YPE3B663.js +3 -0
- package/dist/components/pdf.js +24 -0
- package/dist/components/percentages-BXMCSKIN.js +3 -0
- package/dist/components/php.js +294 -0
- package/dist/components/pica.js +1009 -0
- package/dist/components/pie-LRSECV5Y.js +3 -0
- package/dist/components/pie.js +47 -0
- package/dist/components/pieDiagram-4H26LBE5.js +130 -0
- package/dist/components/pl-PL-T2D74RX3.js +523 -0
- package/dist/components/postal-mime.js +3146 -0
- package/dist/components/pptx.js +15 -0
- package/dist/components/printLayout.js +42 -0
- package/dist/components/prod.js +21770 -0
- package/dist/components/pt-BR-5N22H2LF.js +523 -0
- package/dist/components/pt-PT-UZXXM6DQ.js +523 -0
- package/dist/components/python.js +238 -0
- package/dist/components/quadrantDiagram-W4KKPZXB.js +1988 -0
- package/dist/components/radar-GUYGQ44K.js +3 -0
- package/dist/components/renderer.js +2 -0
- package/dist/components/requirementDiagram-4Y6WPE33.js +2230 -0
- package/dist/components/ro-RO-JPDTUUEW.js +523 -0
- package/dist/components/rough.esm.js +1355 -0
- package/dist/components/roundRect.js +90 -0
- package/dist/components/ru-RU-B4JR7IUQ.js +523 -0
- package/dist/components/rust.js +169 -0
- package/dist/components/sankeyDiagram-5OEKKPKP.js +972 -0
- package/dist/components/sequenceDiagram-3UESZ5HK.js +4255 -0
- package/dist/components/shared.js +175 -0
- package/dist/components/shared2.js +4 -0
- package/dist/components/si-LK-N5RQ5JYF.js +523 -0
- package/dist/components/sk-SK-C5VTKIMK.js +523 -0
- package/dist/components/sl-SI-NN7IZMDC.js +523 -0
- package/dist/components/sourceLoading.js +134 -0
- package/dist/components/sql.js +118 -0
- package/dist/components/src.js +2664 -0
- package/dist/components/src2.js +10722 -0
- package/dist/components/stateDiagram-AJRCARHV.js +217 -0
- package/dist/components/stateDiagram-v2-BHNVJYJU.js +27 -0
- package/dist/components/subset-shared.chunk.js +3 -0
- package/dist/components/subset-worker.chunk.js +21 -0
- package/dist/components/sv-SE-XGPEYMSR.js +523 -0
- package/dist/components/ta-IN-2NMHFXQM.js +523 -0
- package/dist/components/text.js +20 -0
- package/dist/components/th-TH-HPSO5L25.js +523 -0
- package/dist/components/three.module.js +13134 -0
- package/dist/components/time.js +910 -0
- package/dist/components/timeline-definition-PNZ67QCA.js +1084 -0
- package/dist/components/tr-TR-DEFEU3FU.js +523 -0
- package/dist/components/treeView-BLDUP644.js +3 -0
- package/dist/components/treemap-LRROVOQU.js +3 -0
- package/dist/components/typescript.js +521 -0
- package/dist/components/typst.js +25 -0
- package/dist/components/uk-UA-QMV73CPH.js +523 -0
- package/dist/components/umd.js +16 -0
- package/dist/components/use.js +422 -0
- package/dist/components/util.js +49 -0
- package/dist/components/vennDiagram-CIIHVFJN.js +1880 -0
- package/dist/components/vi-VN-M7AON7JQ.js +523 -0
- package/dist/components/viewerZoom.js +92 -0
- package/dist/components/wardley-L42UT6IY.js +3 -0
- package/dist/components/wardleyDiagram-YWT4CUSO.js +656 -0
- package/dist/components/wasm-pack-shim.js +1711 -0
- package/dist/components/wasm-pack-shim2.js +934 -0
- package/dist/components/wasm.js +97 -0
- package/dist/components/word.js +3055 -0
- package/dist/components/worker-ref.js +15 -20
- package/dist/components/xlsx.js +21 -0
- package/dist/components/xml.js +166 -0
- package/dist/components/xychartDiagram-2RQKCTM6.js +2015 -0
- package/dist/components/yaml.js +144 -0
- package/dist/components/zh-CN-LNUGB5OW.js +523 -0
- package/dist/components/zh-HK-E62DVLB3.js +523 -0
- package/dist/components/zh-TW-RAJ6MFWO.js +523 -0
- package/dist/file-viewer3.css +2 -0
- package/dist/index.mjs +3292 -5
- package/dist/src/App.vue.d.ts +3 -0
- package/dist/src/compare/CompareApp.vue.d.ts +3 -0
- package/dist/src/compare/main.d.ts +0 -0
- package/dist/src/compare/useSynchronizedScroll.d.ts +7 -0
- package/dist/src/components/HelloWorld.vue.d.ts +3 -0
- package/dist/src/components/utils.d.ts +4 -0
- package/dist/src/main.d.ts +0 -0
- package/dist/src/package/common/printCapability.d.ts +27 -0
- package/dist/src/package/common/printLayout.d.ts +16 -0
- package/dist/src/package/common/sourceLoading.d.ts +10 -0
- package/dist/src/package/common/type.d.ts +522 -8
- package/dist/src/package/common/worker-ref.d.ts +1 -1
- package/dist/src/package/components/FileViewer/FileViewer.vue.d.ts +74 -24
- package/dist/src/package/components/FileViewer/exportDocumentTemplate.d.ts +9 -0
- package/dist/src/package/components/FileViewer/hooks/useViewerDocumentFeatures.d.ts +29 -0
- package/dist/src/package/components/FileViewer/hooks/useViewerExport.d.ts +21 -0
- package/dist/src/package/components/FileViewer/hooks/useViewerWatermark.d.ts +8 -0
- package/dist/src/package/components/FileViewer/hooks/useViewerZoom.d.ts +34 -0
- package/dist/src/package/components/FileViewer/index.d.ts +1 -1
- package/dist/src/package/components/FileViewer/util.d.ts +2 -1
- package/dist/src/package/index.d.ts +14 -4
- package/dist/src/package/use/documentLocation.d.ts +15 -0
- package/dist/src/package/use/documentSearch.d.ts +234 -0
- package/dist/src/package/use/index.d.ts +4 -0
- package/dist/src/package/use/loading.d.ts +33 -0
- package/dist/src/package/use/viewerZoom.d.ts +42 -0
- package/dist/src/package/use/worker.d.ts +2 -2
- package/dist/src/package/vendors/archive/ArchiveViewer.vue.d.ts +9 -0
- package/dist/src/package/vendors/archive/cache.d.ts +10 -0
- package/dist/src/package/vendors/archive/fallback.d.ts +9 -0
- package/dist/src/package/vendors/archive/index.d.ts +3 -0
- package/dist/src/package/vendors/archive/shared.d.ts +24 -0
- package/dist/src/package/vendors/audio/AudioViewer.vue.d.ts +7 -0
- package/dist/src/package/vendors/audio/index.d.ts +7 -0
- package/dist/src/package/vendors/cad/CadViewer.vue.d.ts +9 -0
- package/dist/src/package/vendors/cad/index.d.ts +8 -0
- package/dist/src/package/vendors/drawing/DrawingViewer.vue.d.ts +15 -0
- package/dist/src/package/vendors/drawing/index.d.ts +7 -0
- package/dist/src/package/vendors/ebook/EpubViewer.vue.d.ts +6 -0
- package/dist/src/package/vendors/ebook/index.d.ts +7 -0
- package/dist/src/package/vendors/eda/EdaViewer.vue.d.ts +8 -0
- package/dist/src/package/vendors/eda/index.d.ts +2 -0
- package/dist/src/package/vendors/eda/parser.d.ts +77 -0
- package/dist/src/package/vendors/email/EmailViewer.vue.d.ts +10 -0
- package/dist/src/package/vendors/email/index.d.ts +2 -0
- package/dist/src/package/vendors/image/ImageViewer.vue.d.ts +6 -13
- package/dist/src/package/vendors/image/index.d.ts +1 -1
- package/dist/src/package/vendors/md/MarkdownViewer.vue.d.ts +6 -13
- package/dist/src/package/vendors/md/index.d.ts +1 -1
- package/dist/src/package/vendors/model/ModelViewer.vue.d.ts +8 -0
- package/dist/src/package/vendors/model/index.d.ts +3 -0
- package/dist/src/package/vendors/model/shared.d.ts +1 -0
- package/dist/src/package/vendors/nestedRender.d.ts +10 -0
- package/dist/src/package/vendors/ofd/OfdViewer.vue.d.ts +6 -0
- package/dist/src/package/vendors/ofd/index.d.ts +7 -0
- package/dist/src/package/vendors/pdf/PdfView.vue.d.ts +10 -13
- package/dist/src/package/vendors/pdf/index.d.ts +2 -1
- package/dist/src/package/vendors/pdf/worker/pdf.worker.d.ts +0 -0
- package/dist/src/package/vendors/pptx/PptxRender.vue.d.ts +9 -81
- package/dist/src/package/vendors/pptx/index.d.ts +1 -1
- package/dist/src/package/vendors/renders.d.ts +1 -1
- package/dist/src/package/vendors/text/CodeViewer.vue.d.ts +7 -13
- package/dist/src/package/vendors/text/index.d.ts +6 -2
- package/dist/src/package/vendors/typst/TypstViewer.vue.d.ts +15 -0
- package/dist/src/package/vendors/typst/index.d.ts +8 -0
- package/dist/src/package/vendors/umd/UmdViewer.vue.d.ts +6 -0
- package/dist/src/package/vendors/umd/index.d.ts +7 -0
- package/dist/src/package/vendors/umd/parser.d.ts +30 -0
- package/dist/src/package/vendors/word/doc.d.ts +5 -0
- package/dist/src/package/vendors/word/docx.d.ts +5 -0
- package/dist/src/package/vendors/word/docx.worker.d.ts +1 -0
- package/dist/src/package/vendors/word/index.d.ts +3 -0
- package/dist/src/package/vendors/xlsx/XlsxTable.state.d.ts +80 -0
- package/dist/src/package/vendors/xlsx/XlsxTable.view.d.ts +25 -0
- package/dist/src/package/vendors/xlsx/XlsxTable.vue.d.ts +6 -21
- package/dist/src/package/vendors/xlsx/index.d.ts +3 -2
- package/dist/src/package/vendors/xlsx/util.d.ts +0 -5
- package/dist/src/package/vendors/xlsx/worker/index.d.ts +4 -6
- package/dist/src/package/vendors/xlsx/worker/sheetjs/SheetJsModel.d.ts +73 -0
- package/dist/src/package/vendors/xlsx/worker/sheetjs/sheet.worker.d.ts +1 -0
- package/dist/style.css +1 -57
- package/dist/wasm/cad/dwfv-render.wasm +0 -0
- package/dist/wasm/cad/dwg-worker.js +24 -0
- package/dist/wasm/cad/libredwg-web.js +15 -0
- package/dist/wasm/cad/libredwg-web.wasm +0 -0
- package/package.json +118 -42
- package/.vscode/extensions.json +0 -3
- package/dist/components/_commonjs-dynamic-modules.js +0 -6
- package/dist/components/_commonjsHelpers.js +0 -36
- package/dist/components/docx-preview.min.js +0 -5287
- package/dist/components/index.js +0 -1717
- package/dist/favicon.ico +0 -0
- package/dist/index.umd.js +0 -436
- package/dist/src/package/vendors/docx/index.d.ts +0 -4
- package/dist/src/package/vendors/xlsx/render.d.ts +0 -6
- package/dist/src/package/vendors/xlsx/worker/xls/SheetJsModel.d.ts +0 -36
- package/dist/src/package/vendors/xlsx/worker/xlsx/ExcelJsModel.d.ts +0 -39
- package/dist/src/package/vendors/xlsx/worker/xlsx/context.d.ts +0 -7
- package/dist/src/package/vendors/xlsx/worker/xlsx/index.d.ts +0 -4
- package/dist/src/package/vendors/xlsx/worker/xlsx/util.d.ts +0 -10
- package/dist/worker/pdf.worker.js +0 -66
- package/dist/worker/pptx.worker.js +0 -21
- package/dist/worker/sheet.worker.js +0 -38
- package/dist/worker/xlsx.worker.js +0 -65
- /package/dist/src/package/vendors/xlsx/worker/{xlsx → sheetjs}/color.d.ts +0 -0
- /package/dist/src/package/vendors/xlsx/worker/{xls → sheetjs}/index.d.ts +0 -0
|
@@ -0,0 +1,443 @@
|
|
|
1
|
+
import { n as e, t } from "./objectSpread2.js";
|
|
2
|
+
import { n, t as r } from "./asyncToGenerator.js";
|
|
3
|
+
import { n as i, r as a } from "./chunk-AGHRB4JF.js";
|
|
4
|
+
import { H as o, K as s, U as c, Y as l, a as u, b as d, f, v as p, w as m, x as h, y as g, z as _ } from "./chunk-CSCIHK7Q.js";
|
|
5
|
+
import { Q as ee } from "./src.js";
|
|
6
|
+
import { _ as v, i as te, t as ne } from "./chunk-5ZQYHXKU.js";
|
|
7
|
+
import { b as re } from "./chunk-NNHCCRGN.js";
|
|
8
|
+
import { t as ie } from "./mermaid-parser.core.js";
|
|
9
|
+
import { t as ae } from "./chunk-4BX2VUAB.js";
|
|
10
|
+
e(), n();
|
|
11
|
+
var y = "position frame", b = "frame positioned", x = "position relation", S = "relation positioned", oe = /* @__PURE__ */ i(function(e) {
|
|
12
|
+
a.debug("options str", e);
|
|
13
|
+
}, "setOptions"), se = /* @__PURE__ */ i(function() {
|
|
14
|
+
return {};
|
|
15
|
+
}, "getOptions"), ce = /* @__PURE__ */ i(function() {
|
|
16
|
+
C(), u();
|
|
17
|
+
}, "clear");
|
|
18
|
+
function C() {
|
|
19
|
+
w = {};
|
|
20
|
+
}
|
|
21
|
+
i(C, "reset");
|
|
22
|
+
var le = f.eventmodeling, ue = /* @__PURE__ */ i(() => te(t(t({}, le), d().eventmodeling)), "getConfig"), w = {};
|
|
23
|
+
function T() {
|
|
24
|
+
let e = de, { ast: n } = w, r = O();
|
|
25
|
+
if (!n) throw Error("No data for EventModel");
|
|
26
|
+
return n.frames.forEach((t, i) => {
|
|
27
|
+
let o = F(t, n.dataEntities, r);
|
|
28
|
+
e = J(e, {
|
|
29
|
+
$kind: y,
|
|
30
|
+
index: i,
|
|
31
|
+
frame: t,
|
|
32
|
+
textProps: o
|
|
33
|
+
});
|
|
34
|
+
let s;
|
|
35
|
+
V(t) ? (a.debug("source frame", t.sourceFrames), s = n.frames.filter((e) => t.sourceFrames.some((t) => t.$refText === e.name)), s.forEach((n) => {
|
|
36
|
+
e = J(e, {
|
|
37
|
+
$kind: x,
|
|
38
|
+
index: i,
|
|
39
|
+
frame: t,
|
|
40
|
+
sourceFrame: n
|
|
41
|
+
});
|
|
42
|
+
})) : e = J(e, {
|
|
43
|
+
$kind: x,
|
|
44
|
+
index: i,
|
|
45
|
+
frame: t
|
|
46
|
+
});
|
|
47
|
+
}), e = t(t({}, e), {}, { sortedSwimlanesArray: R(e.swimlanes) }), e;
|
|
48
|
+
}
|
|
49
|
+
i(T, "getState");
|
|
50
|
+
function E(e) {
|
|
51
|
+
w.ast = e;
|
|
52
|
+
}
|
|
53
|
+
i(E, "setAst");
|
|
54
|
+
var D = {
|
|
55
|
+
swimlaneMinHeight: 70,
|
|
56
|
+
swimlanePadding: 15,
|
|
57
|
+
swimlaneGap: 10,
|
|
58
|
+
boxPadding: 10,
|
|
59
|
+
boxOverlap: 90,
|
|
60
|
+
boxDefaultY: 0,
|
|
61
|
+
boxMinWidth: 80,
|
|
62
|
+
boxMaxWidth: 450,
|
|
63
|
+
boxMinHeight: 80,
|
|
64
|
+
boxMaxHeight: 750,
|
|
65
|
+
contentStartX: 250,
|
|
66
|
+
textMaxWidth: 430,
|
|
67
|
+
boxTextFontWeight: "bold",
|
|
68
|
+
boxTextPadding: 10,
|
|
69
|
+
swimlaneTextFontWeight: "bold",
|
|
70
|
+
labelUiAutomation: "UI/Automation",
|
|
71
|
+
labelUiAutomationPrefix: "UI/A: ",
|
|
72
|
+
labelCommandReadModel: "Command/Read Model",
|
|
73
|
+
labelCommandReadModelPrefix: "C/RM: ",
|
|
74
|
+
labelEvents: "Events",
|
|
75
|
+
labelEventsPrefix: "Stream: "
|
|
76
|
+
};
|
|
77
|
+
function O() {
|
|
78
|
+
return D;
|
|
79
|
+
}
|
|
80
|
+
i(O, "getDiagramProps");
|
|
81
|
+
var de = {
|
|
82
|
+
boxes: [],
|
|
83
|
+
swimlanes: {},
|
|
84
|
+
relations: [],
|
|
85
|
+
maxR: 0,
|
|
86
|
+
sortedSwimlanesArray: []
|
|
87
|
+
};
|
|
88
|
+
function k(e) {
|
|
89
|
+
let t = e.split(".");
|
|
90
|
+
if (t.length === 2) return t[0];
|
|
91
|
+
}
|
|
92
|
+
i(k, "extractNamespace");
|
|
93
|
+
function A(e) {
|
|
94
|
+
let t = e.split(".");
|
|
95
|
+
return t.length === 2 ? t[1] : e;
|
|
96
|
+
}
|
|
97
|
+
i(A, "extractName");
|
|
98
|
+
function j(e, t) {
|
|
99
|
+
if (!(!t || t.length === 0)) return Object.values(e).find((e) => e.namespace === t);
|
|
100
|
+
}
|
|
101
|
+
i(j, "findSwimlaneByNamespace");
|
|
102
|
+
function M(e, t, n) {
|
|
103
|
+
return Math.max(t, ...Object.keys(e).filter((e) => {
|
|
104
|
+
let r = Number.parseInt(e);
|
|
105
|
+
return r > t && r < n;
|
|
106
|
+
}).map((e) => Number.parseInt(e))) + 1;
|
|
107
|
+
}
|
|
108
|
+
i(M, "findNextAvailableIndex");
|
|
109
|
+
function N(e, t) {
|
|
110
|
+
let n = k(e.entityIdentifier), r = j(t, n);
|
|
111
|
+
switch (e.modelEntityType) {
|
|
112
|
+
case "ui":
|
|
113
|
+
case "pcr":
|
|
114
|
+
case "processor": return r ? {
|
|
115
|
+
index: r.index,
|
|
116
|
+
label: r.namespace || D.labelUiAutomation
|
|
117
|
+
} : n ? {
|
|
118
|
+
index: M(t, 0, 100),
|
|
119
|
+
label: D.labelUiAutomationPrefix + n
|
|
120
|
+
} : {
|
|
121
|
+
index: 0,
|
|
122
|
+
label: D.labelUiAutomation
|
|
123
|
+
};
|
|
124
|
+
case "rmo":
|
|
125
|
+
case "readmodel":
|
|
126
|
+
case "cmd":
|
|
127
|
+
case "command": return r ? {
|
|
128
|
+
index: r.index,
|
|
129
|
+
label: r.namespace || D.labelCommandReadModel
|
|
130
|
+
} : n ? {
|
|
131
|
+
index: M(t, 100, 200),
|
|
132
|
+
label: D.labelCommandReadModelPrefix + n
|
|
133
|
+
} : {
|
|
134
|
+
index: 100,
|
|
135
|
+
label: D.labelCommandReadModel
|
|
136
|
+
};
|
|
137
|
+
default: return r ? {
|
|
138
|
+
index: r.index,
|
|
139
|
+
label: r.namespace || D.labelEvents
|
|
140
|
+
} : n ? {
|
|
141
|
+
index: M(t, 200, 300),
|
|
142
|
+
label: D.labelEventsPrefix + n
|
|
143
|
+
} : {
|
|
144
|
+
index: 200,
|
|
145
|
+
label: D.labelEvents
|
|
146
|
+
};
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
i(N, "calculateSwimlaneProps");
|
|
150
|
+
function P(e) {
|
|
151
|
+
let { themeVariables: t } = d();
|
|
152
|
+
switch (e.modelEntityType) {
|
|
153
|
+
case "ui":
|
|
154
|
+
var n, r;
|
|
155
|
+
return {
|
|
156
|
+
fill: (n = t.emUiFill) == null ? "white" : n,
|
|
157
|
+
stroke: (r = t.emUiStroke) == null ? "#dbdada" : r
|
|
158
|
+
};
|
|
159
|
+
case "pcr":
|
|
160
|
+
case "processor":
|
|
161
|
+
var i, a;
|
|
162
|
+
return {
|
|
163
|
+
fill: (i = t.emProcessorFill) == null ? "#edb3f6" : i,
|
|
164
|
+
stroke: (a = t.emProcessorStroke) == null ? "#b88cbf" : a
|
|
165
|
+
};
|
|
166
|
+
case "rmo":
|
|
167
|
+
case "readmodel":
|
|
168
|
+
var o, s;
|
|
169
|
+
return {
|
|
170
|
+
fill: (o = t.emReadModelFill) == null ? "#d3f1a2" : o,
|
|
171
|
+
stroke: (s = t.emReadModelStroke) == null ? "#a3b732" : s
|
|
172
|
+
};
|
|
173
|
+
case "cmd":
|
|
174
|
+
case "command":
|
|
175
|
+
var c, l;
|
|
176
|
+
return {
|
|
177
|
+
fill: (c = t.emCommandFill) == null ? "#bcd6fe" : c,
|
|
178
|
+
stroke: (l = t.emCommandStroke) == null ? "#679ac3" : l
|
|
179
|
+
};
|
|
180
|
+
case "evt":
|
|
181
|
+
case "event":
|
|
182
|
+
var u, f;
|
|
183
|
+
return {
|
|
184
|
+
fill: (u = t.emEventFill) == null ? "#ffb778" : u,
|
|
185
|
+
stroke: (f = t.emEventStroke) == null ? "#c19a0f" : f
|
|
186
|
+
};
|
|
187
|
+
default: return {
|
|
188
|
+
fill: "red",
|
|
189
|
+
stroke: "black"
|
|
190
|
+
};
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
i(P, "calculateEntityVisualProps");
|
|
194
|
+
function F(e, t, n) {
|
|
195
|
+
var r;
|
|
196
|
+
let i = d(), o = _((r = A(e.entityIdentifier)) == null ? "" : r, i), s, c = {
|
|
197
|
+
fontSize: 16,
|
|
198
|
+
fontWeight: 700,
|
|
199
|
+
fontFamily: "\"trebuchet ms\", verdana, arial, sans-serif",
|
|
200
|
+
joinWith: "<br/>"
|
|
201
|
+
}, l = `<b>${v(o, n.textMaxWidth, c)}</b>`;
|
|
202
|
+
if (e.dataInlineValue && (s = e.dataInlineValue, s = s.substring(s.indexOf("{") + 1), s = s.substring(0, s.lastIndexOf("}") - 1), s = _(s, i), s = v(s, n.textMaxWidth, c), s = s.replaceAll(" ", " ")), e.dataReference) {
|
|
203
|
+
let r = t.find((t) => {
|
|
204
|
+
var n;
|
|
205
|
+
return t.name === ((n = e.dataReference) == null ? void 0 : n.$refText);
|
|
206
|
+
});
|
|
207
|
+
r && (s = r.dataBlockValue, s = s.substring(s.indexOf("{\n") + 2), s = s.substring(0, s.lastIndexOf("}") - 1), s = _(s, i), s = v(s, n.textMaxWidth, c), s = s.replaceAll(" ", " "), s += "<br/>");
|
|
208
|
+
}
|
|
209
|
+
let u = s !== void 0;
|
|
210
|
+
u && (l += `<br/><br/><code style="text-align: left; display: block;max-width:${n.textMaxWidth}px">${s}</code>`);
|
|
211
|
+
let f = {
|
|
212
|
+
fontSize: c.fontSize,
|
|
213
|
+
fontWeight: c.fontWeight,
|
|
214
|
+
fontFamily: c.fontFamily
|
|
215
|
+
}, p = ne(l, f), m = u ? p.width / 3 : p.width, h = {
|
|
216
|
+
content: l,
|
|
217
|
+
width: m,
|
|
218
|
+
height: p.height
|
|
219
|
+
};
|
|
220
|
+
return a.debug(`[${e.name}] ${e.entityIdentifier} text`, h), h;
|
|
221
|
+
}
|
|
222
|
+
i(F, "calculateTextProps");
|
|
223
|
+
function fe(e, t) {
|
|
224
|
+
let n = t, r = P(n.frame), i = {
|
|
225
|
+
width: n.textProps.width + 2 * D.boxTextPadding,
|
|
226
|
+
height: n.textProps.height + 2 * D.boxTextPadding
|
|
227
|
+
};
|
|
228
|
+
return [{
|
|
229
|
+
$kind: b,
|
|
230
|
+
frame: n.frame,
|
|
231
|
+
index: n.index,
|
|
232
|
+
visual: r,
|
|
233
|
+
dimension: i,
|
|
234
|
+
textProps: n.textProps
|
|
235
|
+
}];
|
|
236
|
+
}
|
|
237
|
+
i(fe, "decidePositionFrame");
|
|
238
|
+
function I(e, t, n) {
|
|
239
|
+
return t === void 0 ? D.contentStartX : t.index === e.index && e.r ? e.r + D.boxPadding : n === void 0 ? D.contentStartX : n.r - D.boxOverlap + D.boxPadding;
|
|
240
|
+
}
|
|
241
|
+
i(I, "calculateX");
|
|
242
|
+
function L(e, t) {
|
|
243
|
+
let n = [...e.map((e) => e.r), t];
|
|
244
|
+
return Math.max(...n);
|
|
245
|
+
}
|
|
246
|
+
i(L, "calculateMaxRight");
|
|
247
|
+
function R(e) {
|
|
248
|
+
return Object.values(e).sort((e, t) => e.index - t.index);
|
|
249
|
+
}
|
|
250
|
+
i(R, "sortedSwimlanesArray");
|
|
251
|
+
function z(e, n) {
|
|
252
|
+
let r = n, i = N(r.frame, e.swimlanes), a;
|
|
253
|
+
a = i.index in e.swimlanes ? e.swimlanes[i.index] : {
|
|
254
|
+
index: i.index,
|
|
255
|
+
label: i.label,
|
|
256
|
+
r: 0,
|
|
257
|
+
y: i.index * D.swimlaneMinHeight + D.swimlaneGap,
|
|
258
|
+
height: D.swimlaneMinHeight,
|
|
259
|
+
maxHeight: D.swimlaneMinHeight
|
|
260
|
+
};
|
|
261
|
+
let o = e.boxes.length > 0 ? e.boxes[e.boxes.length - 1] : void 0, s = e.previousSwimlaneNumber === void 0 ? void 0 : e.swimlanes[e.previousSwimlaneNumber], c = {
|
|
262
|
+
width: Math.max(D.boxMinWidth, Math.min(D.boxMaxWidth, r.dimension.width)) + 2 * D.boxPadding,
|
|
263
|
+
height: Math.max(D.boxMinHeight, Math.min(D.boxMaxHeight, r.dimension.height)) + 2 * D.boxPadding
|
|
264
|
+
}, l = I(a, s, o), u = l + c.width + D.boxPadding, d = L(Object.values(e.swimlanes), u);
|
|
265
|
+
a.r = l + c.width, a.maxHeight = Math.max(a.maxHeight, c.height), a.height = Math.max(D.swimlaneMinHeight, a.maxHeight) + 2 * D.swimlanePadding;
|
|
266
|
+
let f = {
|
|
267
|
+
x: l,
|
|
268
|
+
y: D.swimlanePadding + a.y,
|
|
269
|
+
r: u,
|
|
270
|
+
dimension: c,
|
|
271
|
+
leftSibling: !1,
|
|
272
|
+
swimlane: a,
|
|
273
|
+
visual: r.visual,
|
|
274
|
+
text: r.textProps.content,
|
|
275
|
+
frame: r.frame,
|
|
276
|
+
index: r.index
|
|
277
|
+
}, p = t(t({}, e), {}, {
|
|
278
|
+
boxes: [...e.boxes, f],
|
|
279
|
+
swimlanes: t(t({}, e.swimlanes), {}, { [`${a.index}`]: a }),
|
|
280
|
+
previousSwimlaneNumber: i.index,
|
|
281
|
+
previousFrame: r.frame,
|
|
282
|
+
maxR: d
|
|
283
|
+
}), m = R(p.swimlanes);
|
|
284
|
+
m.length > 0 && (m[0].y = 0);
|
|
285
|
+
for (let e = 1; e < m.length; e++) {
|
|
286
|
+
let t = m[e], n = m[e - 1];
|
|
287
|
+
t.y = n.y + n.height + D.swimlaneGap;
|
|
288
|
+
}
|
|
289
|
+
return p;
|
|
290
|
+
}
|
|
291
|
+
i(z, "evolveFramePositioned");
|
|
292
|
+
function B(e, t) {
|
|
293
|
+
return e === 0 && t.sourceFrames.length === 0;
|
|
294
|
+
}
|
|
295
|
+
i(B, "isFirstFrame");
|
|
296
|
+
function V(e) {
|
|
297
|
+
return e.sourceFrames !== void 0 && e.sourceFrames !== null && e.sourceFrames.length > 0;
|
|
298
|
+
}
|
|
299
|
+
i(V, "hasSourceFrame");
|
|
300
|
+
function H(e, t) {
|
|
301
|
+
if (t != null) return e.find((e) => e.frame.name === t.name);
|
|
302
|
+
}
|
|
303
|
+
i(H, "findBoxByFrame");
|
|
304
|
+
function U(e, t, n) {
|
|
305
|
+
if (!(n < 0)) for (let r = n; r >= 0; r--) {
|
|
306
|
+
let n = e[r];
|
|
307
|
+
if (n.swimlane.index !== t) return n;
|
|
308
|
+
}
|
|
309
|
+
}
|
|
310
|
+
i(U, "findBoxByLineIndex");
|
|
311
|
+
function W(e, t) {
|
|
312
|
+
let n = t;
|
|
313
|
+
if (re(n.frame) || B(n.index, n.frame)) return [];
|
|
314
|
+
let r = H(e.boxes, n.frame);
|
|
315
|
+
if (r === void 0) throw Error(`Target box not found for frame ${n.frame.name}`);
|
|
316
|
+
let i;
|
|
317
|
+
return i = n.sourceFrame ? H(e.boxes, n.sourceFrame) : U(e.boxes, r.swimlane.index, n.index - 1), i === void 0 ? [] : [{
|
|
318
|
+
$kind: S,
|
|
319
|
+
frame: n.frame,
|
|
320
|
+
index: n.index,
|
|
321
|
+
sourceBox: i,
|
|
322
|
+
targetBox: r
|
|
323
|
+
}];
|
|
324
|
+
}
|
|
325
|
+
i(W, "decidePositionRelation");
|
|
326
|
+
function G(e, n) {
|
|
327
|
+
let r = n, i = {
|
|
328
|
+
visual: {
|
|
329
|
+
fill: "none",
|
|
330
|
+
stroke: "#000"
|
|
331
|
+
},
|
|
332
|
+
source: {
|
|
333
|
+
x: r.sourceBox.x,
|
|
334
|
+
y: r.sourceBox.y
|
|
335
|
+
},
|
|
336
|
+
target: {
|
|
337
|
+
x: r.targetBox.x,
|
|
338
|
+
y: r.targetBox.y
|
|
339
|
+
},
|
|
340
|
+
sourceBox: r.sourceBox,
|
|
341
|
+
targetBox: r.targetBox
|
|
342
|
+
};
|
|
343
|
+
return t(t({}, e), {}, { relations: [...e.relations, i] });
|
|
344
|
+
}
|
|
345
|
+
i(G, "evolveRelationPositioned");
|
|
346
|
+
var pe = {
|
|
347
|
+
[y]: fe,
|
|
348
|
+
[x]: W
|
|
349
|
+
}, me = {
|
|
350
|
+
[b]: z,
|
|
351
|
+
[S]: G
|
|
352
|
+
};
|
|
353
|
+
function K(e, t) {
|
|
354
|
+
let n = pe[t.$kind];
|
|
355
|
+
if (n == null) return [];
|
|
356
|
+
let r = n(e, t);
|
|
357
|
+
return a.debug("decided events", r), r;
|
|
358
|
+
}
|
|
359
|
+
i(K, "decide");
|
|
360
|
+
function q(e, t) {
|
|
361
|
+
let n = t.reduce((e, t) => {
|
|
362
|
+
let n = me[t.$kind];
|
|
363
|
+
return n == null ? e : n(e, t);
|
|
364
|
+
}, e);
|
|
365
|
+
return a.debug("evolve events", {
|
|
366
|
+
state: e,
|
|
367
|
+
newState: n,
|
|
368
|
+
events: t
|
|
369
|
+
}), n;
|
|
370
|
+
}
|
|
371
|
+
i(q, "evolve");
|
|
372
|
+
function J(e, t) {
|
|
373
|
+
return q(e, K(e, t));
|
|
374
|
+
}
|
|
375
|
+
i(J, "dispatch");
|
|
376
|
+
var Y = {
|
|
377
|
+
getConfig: ue,
|
|
378
|
+
setOptions: oe,
|
|
379
|
+
getOptions: se,
|
|
380
|
+
clear: ce,
|
|
381
|
+
setAccTitle: c,
|
|
382
|
+
getAccTitle: g,
|
|
383
|
+
getAccDescription: p,
|
|
384
|
+
setAccDescription: o,
|
|
385
|
+
setDiagramTitle: s,
|
|
386
|
+
getDiagramTitle: m,
|
|
387
|
+
setAst: E,
|
|
388
|
+
getDiagramProps: O,
|
|
389
|
+
getState: T
|
|
390
|
+
}, he = { parse: /* @__PURE__ */ i(function() {
|
|
391
|
+
var e = r(function* (e) {
|
|
392
|
+
let t = yield ie("eventmodeling", e);
|
|
393
|
+
a.debug(t), Y.setAst(t), ae(t, Y);
|
|
394
|
+
});
|
|
395
|
+
return function(t) {
|
|
396
|
+
return e.apply(this, arguments);
|
|
397
|
+
};
|
|
398
|
+
}(), "parse") }, X = h(), ge = X == null ? void 0 : X.eventmodeling;
|
|
399
|
+
function Z(e, t) {
|
|
400
|
+
return (n) => {
|
|
401
|
+
let r = n.swimlane.y + t.swimlanePadding, i = e.append("g").attr("class", "em-box");
|
|
402
|
+
i.append("rect").attr("x", n.x).attr("y", r).attr("rx", "3").attr("width", n.dimension.width).attr("height", n.dimension.height).attr("stroke", n.visual.stroke).attr("fill", n.visual.fill), i.append("foreignObject").attr("x", n.x + t.boxPadding).attr("y", r + 10).attr("width", n.dimension.width - 2 * t.boxPadding).attr("height", n.dimension.height - 2 * t.boxPadding).append("xhtml:div").style("display", "table").style("height", "100%").style("width", "100%").append("span").style("display", "table-cell").style("text-align", "center").style("vertical-align", "middle").html(n.text);
|
|
403
|
+
};
|
|
404
|
+
}
|
|
405
|
+
i(Z, "renderD3Box");
|
|
406
|
+
function _e(e, t) {
|
|
407
|
+
return e > t;
|
|
408
|
+
}
|
|
409
|
+
i(_e, "dirUpwards");
|
|
410
|
+
function Q(e, t, n, r) {
|
|
411
|
+
return (i) => {
|
|
412
|
+
var o;
|
|
413
|
+
let s = i.sourceBox.swimlane.y + t.swimlanePadding, c = i.targetBox.swimlane.y + t.swimlanePadding, l = _e(s, c), u = i.sourceBox.x + i.sourceBox.dimension.width * 2 / 3, d = i.targetBox.x + i.targetBox.dimension.width / 3, f, p;
|
|
414
|
+
a.debug(`rendering relation up=${l} for `, {
|
|
415
|
+
sourceBox: i.sourceBox,
|
|
416
|
+
targetBox: i.targetBox
|
|
417
|
+
}), l ? (f = s, p = c + i.targetBox.dimension.height) : (f = s + i.sourceBox.dimension.height, p = c);
|
|
418
|
+
let m = (o = r.emRelationStroke) == null ? i.visual.stroke : o;
|
|
419
|
+
e.append("path").attr("class", "em-relation").attr("fill", i.visual.fill).attr("stroke", m).attr("stroke-width", "1").attr("marker-end", `url(#${n})`).attr("d", `M${u} ${f} L${d} ${p}`);
|
|
420
|
+
};
|
|
421
|
+
}
|
|
422
|
+
i(Q, "renderD3Relation");
|
|
423
|
+
function $(e, t, n, r) {
|
|
424
|
+
return (i) => {
|
|
425
|
+
var a, o;
|
|
426
|
+
let s = e.append("g").attr("class", "em-swimlane"), c = (a = r.emSwimlaneBackgroundOdd) == null ? "rgb(250,250,250)" : a, l = (o = r.emSwimlaneBackgroundStroke) == null ? "rgb(240,240,240)" : o;
|
|
427
|
+
s.append("rect").attr("x", 0).attr("y", i.y).attr("rx", "3").attr("width", t + n.swimlanePadding).attr("height", i.height).attr("fill", c).attr("stroke", l), s.append("text").attr("font-weight", n.swimlaneTextFontWeight).attr("x", 30).attr("y", i.y + 30).text(i.label);
|
|
428
|
+
};
|
|
429
|
+
}
|
|
430
|
+
i($, "renderD3Swimlane");
|
|
431
|
+
var ve = {
|
|
432
|
+
parser: he,
|
|
433
|
+
db: Y,
|
|
434
|
+
renderer: { draw: /* @__PURE__ */ i(function(e, t, n, r) {
|
|
435
|
+
var i, o;
|
|
436
|
+
if (a.debug("in eventmodeling renderer", e + "\n", "id:", t, n), !ge) throw Error("EventModeling config not found");
|
|
437
|
+
let s = r.db, { themeVariables: c, eventmodeling: u } = h(), d = ee(`[id="${t}"]`), f = s.getDiagramProps(), p = s.getState(), m = `em-arrowhead-${t}`, g = (i = c.emArrowhead) == null ? "#000000" : i;
|
|
438
|
+
p.sortedSwimlanesArray.forEach($(d, p.maxR, f, c)), p.boxes.forEach(Z(d, f)), p.relations.forEach(Q(d, f, m, c)), d.append("defs").append("marker").attr("id", m).attr("markerWidth", "10").attr("markerHeight", "7").attr("refX", "10").attr("refY", "3.5").attr("orient", "auto").append("polygon").attr("points", "0 0, 10 3.5, 0 7").attr("fill", g), l(void 0, d, (o = u == null ? void 0 : u.padding) == null ? 30 : o, u == null ? void 0 : u.useMaxWidth);
|
|
439
|
+
}, "draw") },
|
|
440
|
+
styles: /* @__PURE__ */ i((e) => "", "getStyles")
|
|
441
|
+
};
|
|
442
|
+
//#endregion
|
|
443
|
+
export { ve as diagram };
|
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
import { n as e, t } from "./objectSpread2.js";
|
|
2
|
+
import { n, t as r } from "./asyncToGenerator.js";
|
|
3
|
+
import { n as i, r as a } from "./chunk-AGHRB4JF.js";
|
|
4
|
+
import { H as o, K as s, U as c, a as l, b as u, c as d, f, v as p, w as m, y as h } from "./chunk-CSCIHK7Q.js";
|
|
5
|
+
import { i as g } from "./chunk-5ZQYHXKU.js";
|
|
6
|
+
import { t as _ } from "./chunk-WU5MYG2G.js";
|
|
7
|
+
import { t as v } from "./mermaid-parser.core.js";
|
|
8
|
+
import { t as y } from "./chunk-4BX2VUAB.js";
|
|
9
|
+
e(), n();
|
|
10
|
+
var b, x = f.packet, S = (b = class {
|
|
11
|
+
constructor() {
|
|
12
|
+
this.packet = [], this.setAccTitle = c, this.getAccTitle = h, this.setDiagramTitle = s, this.getDiagramTitle = m, this.getAccDescription = p, this.setAccDescription = o;
|
|
13
|
+
}
|
|
14
|
+
getConfig() {
|
|
15
|
+
let e = g(t(t({}, x), u().packet));
|
|
16
|
+
return e.showBits && (e.paddingY += 10), e;
|
|
17
|
+
}
|
|
18
|
+
getPacket() {
|
|
19
|
+
return this.packet;
|
|
20
|
+
}
|
|
21
|
+
pushWord(e) {
|
|
22
|
+
e.length > 0 && this.packet.push(e);
|
|
23
|
+
}
|
|
24
|
+
clear() {
|
|
25
|
+
l(), this.packet = [];
|
|
26
|
+
}
|
|
27
|
+
}, i(b, "PacketDB"), b), C = 1e4, w = /* @__PURE__ */ i((e, t) => {
|
|
28
|
+
y(e, t);
|
|
29
|
+
let n = -1, r = [], i = 1, { bitsPerRow: o } = t.getConfig();
|
|
30
|
+
for (let { start: l, end: u, bits: d, label: f } of e.blocks) {
|
|
31
|
+
var s;
|
|
32
|
+
if (l !== void 0 && u !== void 0 && u < l) throw Error(`Packet block ${l} - ${u} is invalid. End must be greater than start.`);
|
|
33
|
+
if (l != null || (l = n + 1), l !== n + 1) {
|
|
34
|
+
var c;
|
|
35
|
+
throw Error(`Packet block ${l} - ${(c = u) == null ? l : c} is not contiguous. It should start from ${n + 1}.`);
|
|
36
|
+
}
|
|
37
|
+
if (d === 0) throw Error(`Packet block ${l} is invalid. Cannot have a zero bit field.`);
|
|
38
|
+
for (u != null || (u = l + ((s = d) == null ? 1 : s) - 1), d != null || (d = u - l + 1), n = u, a.debug(`Packet block ${l} - ${n} with label ${f}`); r.length <= o + 1 && t.getPacket().length < C;) {
|
|
39
|
+
let [e, n] = T({
|
|
40
|
+
start: l,
|
|
41
|
+
end: u,
|
|
42
|
+
bits: d,
|
|
43
|
+
label: f
|
|
44
|
+
}, i, o);
|
|
45
|
+
if (r.push(e), e.end + 1 === i * o && (t.pushWord(r), r = [], i++), !n) break;
|
|
46
|
+
({start: l, end: u, bits: d, label: f} = n);
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
t.pushWord(r);
|
|
50
|
+
}, "populate"), T = /* @__PURE__ */ i((e, t, n) => {
|
|
51
|
+
if (e.start === void 0) throw Error("start should have been set during first phase");
|
|
52
|
+
if (e.end === void 0) throw Error("end should have been set during first phase");
|
|
53
|
+
if (e.start > e.end) throw Error(`Block start ${e.start} is greater than block end ${e.end}.`);
|
|
54
|
+
if (e.end + 1 <= t * n) return [e, void 0];
|
|
55
|
+
let r = t * n - 1, i = t * n;
|
|
56
|
+
return [{
|
|
57
|
+
start: e.start,
|
|
58
|
+
end: r,
|
|
59
|
+
label: e.label,
|
|
60
|
+
bits: r - e.start
|
|
61
|
+
}, {
|
|
62
|
+
start: i,
|
|
63
|
+
end: e.end,
|
|
64
|
+
label: e.label,
|
|
65
|
+
bits: e.end - i
|
|
66
|
+
}];
|
|
67
|
+
}, "getNextFittingBlock"), E = {
|
|
68
|
+
parser: { yy: void 0 },
|
|
69
|
+
parse: /* @__PURE__ */ i(function() {
|
|
70
|
+
var e = r(function* (e) {
|
|
71
|
+
var t;
|
|
72
|
+
let n = yield v("packet", e), r = (t = E.parser) == null ? void 0 : t.yy;
|
|
73
|
+
if (!(r instanceof S)) throw Error("parser.parser?.yy was not a PacketDB. This is due to a bug within Mermaid, please report this issue at https://github.com/mermaid-js/mermaid/issues.");
|
|
74
|
+
a.debug(n), w(n, r);
|
|
75
|
+
});
|
|
76
|
+
return function(t) {
|
|
77
|
+
return e.apply(this, arguments);
|
|
78
|
+
};
|
|
79
|
+
}(), "parse")
|
|
80
|
+
}, D = /* @__PURE__ */ i((e, t, n, r) => {
|
|
81
|
+
let i = r.db, a = i.getConfig(), { rowHeight: o, paddingY: s, bitWidth: c, bitsPerRow: l } = a, u = i.getPacket(), f = i.getDiagramTitle(), p = o + s, m = p * (u.length + 1) - (f ? 0 : o), h = c * l + 2, g = _(t);
|
|
82
|
+
g.attr("viewBox", `0 0 ${h} ${m}`), d(g, m, h, a.useMaxWidth);
|
|
83
|
+
for (let [e, t] of u.entries()) O(g, t, e, a);
|
|
84
|
+
g.append("text").text(f).attr("x", h / 2).attr("y", m - p / 2).attr("dominant-baseline", "middle").attr("text-anchor", "middle").attr("class", "packetTitle");
|
|
85
|
+
}, "draw"), O = /* @__PURE__ */ i((e, t, n, { rowHeight: r, paddingX: i, paddingY: a, bitWidth: o, bitsPerRow: s, showBits: c }) => {
|
|
86
|
+
let l = e.append("g"), u = n * (r + a) + a;
|
|
87
|
+
for (let e of t) {
|
|
88
|
+
let t = e.start % s * o + 1, n = (e.end - e.start + 1) * o - i;
|
|
89
|
+
if (l.append("rect").attr("x", t).attr("y", u).attr("width", n).attr("height", r).attr("class", "packetBlock"), l.append("text").attr("x", t + n / 2).attr("y", u + r / 2).attr("class", "packetLabel").attr("dominant-baseline", "middle").attr("text-anchor", "middle").text(e.label), !c) continue;
|
|
90
|
+
let a = e.end === e.start, d = u - 2;
|
|
91
|
+
l.append("text").attr("x", t + (a ? n / 2 : 0)).attr("y", d).attr("class", "packetByte start").attr("dominant-baseline", "auto").attr("text-anchor", a ? "middle" : "start").text(e.start), a || l.append("text").attr("x", t + n).attr("y", d).attr("class", "packetByte end").attr("dominant-baseline", "auto").attr("text-anchor", "end").text(e.end);
|
|
92
|
+
}
|
|
93
|
+
}, "drawWord"), k = { draw: D }, A = {
|
|
94
|
+
byteFontSize: "10px",
|
|
95
|
+
startByteColor: "black",
|
|
96
|
+
endByteColor: "black",
|
|
97
|
+
labelColor: "black",
|
|
98
|
+
labelFontSize: "12px",
|
|
99
|
+
titleColor: "black",
|
|
100
|
+
titleFontSize: "14px",
|
|
101
|
+
blockStrokeColor: "black",
|
|
102
|
+
blockStrokeWidth: "1",
|
|
103
|
+
blockFillColor: "#efefef"
|
|
104
|
+
}, j = {
|
|
105
|
+
parser: E,
|
|
106
|
+
get db() {
|
|
107
|
+
return new S();
|
|
108
|
+
},
|
|
109
|
+
renderer: k,
|
|
110
|
+
styles: /* @__PURE__ */ i(({ packet: e } = {}) => {
|
|
111
|
+
let t = g(A, e);
|
|
112
|
+
return `
|
|
113
|
+
.packetByte {
|
|
114
|
+
font-size: ${t.byteFontSize};
|
|
115
|
+
}
|
|
116
|
+
.packetByte.start {
|
|
117
|
+
fill: ${t.startByteColor};
|
|
118
|
+
}
|
|
119
|
+
.packetByte.end {
|
|
120
|
+
fill: ${t.endByteColor};
|
|
121
|
+
}
|
|
122
|
+
.packetLabel {
|
|
123
|
+
fill: ${t.labelColor};
|
|
124
|
+
font-size: ${t.labelFontSize};
|
|
125
|
+
}
|
|
126
|
+
.packetTitle {
|
|
127
|
+
fill: ${t.titleColor};
|
|
128
|
+
font-size: ${t.titleFontSize};
|
|
129
|
+
}
|
|
130
|
+
.packetBlock {
|
|
131
|
+
stroke: ${t.blockStrokeColor};
|
|
132
|
+
stroke-width: ${t.blockStrokeWidth};
|
|
133
|
+
fill: ${t.blockFillColor};
|
|
134
|
+
}
|
|
135
|
+
`;
|
|
136
|
+
}, "styles")
|
|
137
|
+
};
|
|
138
|
+
//#endregion
|
|
139
|
+
export { j as diagram };
|