[
  {
    "path": ".github/workflows/CI.yml",
    "content": "name: CI\non: [ push, pull_request ]\njobs:\n  Build:\n\n    strategy:\n      matrix:\n        os: [ ubuntu-latest ]\n        node-version: [ 16 ]\n\n    runs-on: ${{ matrix.os }}\n\n    steps:\n    - name: Checkout\n      uses: actions/checkout@v6\n    - name: Use Node.js\n      uses: actions/setup-node@v6\n      with:\n        node-version: ${{ matrix.node-version }}\n        cache: 'npm'\n    - name: Install dependencies\n      run: npm ci\n    - name: Build\n      run: npm run all\n"
  },
  {
    "path": ".gitignore",
    "content": "node_modules\ndist"
  },
  {
    "path": "CHANGELOG.md",
    "content": "# Changelog\n\nAll notable changes to [react-bpmn](https://github.com/bpmn-io/react-bpmn) are documented here. We use [semantic versioning](http://semver.org/) for releases.\n\n## Unreleased\n\n___Note:__ Yet to be released changes appear here._\n\n## 0.2.0\n\n* `FEAT`: allow open pre-loaded diagram (via `diagramXML` prop)\n\n## 0.1.1\n\n* `FIX`: correct url update handling\n\n## 0.1.0\n\n_Initial Release._"
  },
  {
    "path": "LICENSE",
    "content": "The MIT License (MIT)\n\nCopyright (c) 2019-present Camunda Services GmbH\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE."
  },
  {
    "path": "README.md",
    "content": "# react-bpmn\n\n[![CI](https://github.com/bpmn-io/react-bpmn/workflows/CI/badge.svg)](https://github.com/bpmn-io/react-bpmn/actions?query=workflow%3ACI)\n\nUse [bpmn-js](https://github.com/bpmn-io/bpmn-js) to display BPMN 2.0 diagrams in a [React](https://reactjs.org/) application.\n\n\n## Usage\n\n```javascript\nimport ReactBpmn from 'react-bpmn';\n\n\nfunction App(props) {\n\n  function onShown() {\n    console.log('diagram shown');\n  }\n\n  function onLoading() {\n    console.log('diagram loading');\n  }\n\n  function onError(err) {\n    console.log('failed to show diagram');\n  }\n\n  return (\n    <ReactBpmn\n      url=\"/public/diagram.bpmn\"\n      onShown={ onShown }\n      onLoading={ onLoading }\n      onError={ onError }\n    />\n  );\n}\n```\n\n## Development\n\nTo get the development setup make sure to have [NodeJS](https://nodejs.org/en/download/) installed.\nAs soon as you are set up, clone the project and execute\n\n```\nnpm install\nnpm run all\n```\n\n## Example\n\nTo run the example, execute `npm run start` and open http://localhost:9869/public in your Webbrowser.\n\n## Resources\n\n* [Issues](https://github.com/bpmn-io/react-bpmn/issues)\n* [Example](./example)\n\n\n## License\n\nMIT"
  },
  {
    "path": "example/README.md",
    "content": "# react-bpmn Example\n\nAn example how to use [react-bpmn](../) to display a BPMN 2.0 diagram in a React app.\n\n![react-bpmn example screenshot](./docs/screenshot.png)\n\n\n## Run the Example\n\nTo run the example:\n\n```\nnpm install\nnpm start\n```\n\nThis puts up the example to [localhost:9869/public/index.html](http://localhost:9869/public/index.html).\n\n\n## License\n\nMIT"
  },
  {
    "path": "example/package.json",
    "content": "{\n  \"name\": \"react-bpmn-example\",\n  \"version\": \"0.0.0\",\n  \"description\": \"An example using react-bpmn inside a React application\",\n  \"private\": true,\n  \"scripts\": {\n    \"start\": \"sirv . start --dev --port=9869\"\n  },\n  \"license\": \"MIT\",\n  \"dependencies\": {\n    \"bpmn-js\": \"^18.0.0\",\n    \"react-bpmn\": \"^0.2.0\"\n  },\n  \"devDependencies\": {\n    \"sirv-cli\": \"^3.0.0\"\n  }\n}"
  },
  {
    "path": "example/public/diagram.bpmn",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<definitions xmlns=\"http://www.omg.org/spec/BPMN/20100524/MODEL\" xmlns:bpmndi=\"http://www.omg.org/spec/BPMN/20100524/DI\" xmlns:omgdc=\"http://www.omg.org/spec/DD/20100524/DC\" xmlns:omgdi=\"http://www.omg.org/spec/DD/20100524/DI\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" targetNamespace=\"\" xsi:schemaLocation=\"http://www.omg.org/spec/BPMN/20100524/MODEL http://www.omg.org/spec/BPMN/2.0/20100501/BPMN20.xsd\">\n  <collaboration id=\"sid-c0e745ff-361e-4afb-8c8d-2a1fc32b1424\">\n    <participant id=\"sid-87F4C1D6-25E1-4A45-9DA7-AD945993D06F\" name=\"Customer\" processRef=\"sid-C3803939-0872-457F-8336-EAE484DC4A04\" />\n  </collaboration>\n  <process id=\"sid-C3803939-0872-457F-8336-EAE484DC4A04\" name=\"Customer\" processType=\"None\" isClosed=\"false\" isExecutable=\"false\">\n    <extensionElements />\n    <laneSet id=\"sid-b167d0d7-e761-4636-9200-76b7f0e8e83a\">\n      <lane id=\"sid-57E4FE0D-18E4-478D-BC5D-B15164E93254\">\n        <flowNodeRef>sid-52EB1772-F36E-433E-8F5B-D5DFD26E6F26</flowNodeRef>\n        <flowNodeRef>sid-E49425CF-8287-4798-B622-D2A7D78EF00B</flowNodeRef>\n        <flowNodeRef>sid-D7F237E8-56D0-4283-A3CE-4F0EFE446138</flowNodeRef>\n        <flowNodeRef>sid-E433566C-2289-4BEB-A19C-1697048900D2</flowNodeRef>\n        <flowNodeRef>sid-5134932A-1863-4FFA-BB3C-A4B4078B11A9</flowNodeRef>\n        <flowNodeRef>SCAN_OK</flowNodeRef>\n      </lane>\n    </laneSet>\n    <task id=\"sid-52EB1772-F36E-433E-8F5B-D5DFD26E6F26\" name=\"Scan QR code\">\n      <incoming>sid-4DC479E5-5C20-4948-BCFC-9EC5E2F66D8D</incoming>\n      <outgoing>sid-EE8A7BA0-5D66-4F8B-80E3-CC2751B3856A</outgoing>\n    </task>\n    <task id=\"sid-E49425CF-8287-4798-B622-D2A7D78EF00B\" name=\"Open product information in mobile  app\">\n      <incoming>sid-8B820AF5-DC5C-4618-B854-E08B71FB55CB</incoming>\n      <outgoing>sid-57EB1F24-BD94-479A-BF1F-57F1EAA19C6C</outgoing>\n    </task>\n    <startEvent id=\"sid-D7F237E8-56D0-4283-A3CE-4F0EFE446138\" name=\"Notices&#10;QR code\">\n      <outgoing>sid-7B791A11-2F2E-4D80-AFB3-91A02CF2B4FD</outgoing>\n    </startEvent>\n    <endEvent id=\"sid-E433566C-2289-4BEB-A19C-1697048900D2\" name=\"Is informed\">\n      <incoming>sid-57EB1F24-BD94-479A-BF1F-57F1EAA19C6C</incoming>\n    </endEvent>\n    <exclusiveGateway id=\"sid-5134932A-1863-4FFA-BB3C-A4B4078B11A9\">\n      <incoming>sid-7B791A11-2F2E-4D80-AFB3-91A02CF2B4FD</incoming>\n      <incoming>sid-337A23B9-A923-4CCE-B613-3E247B773CCE</incoming>\n      <outgoing>sid-4DC479E5-5C20-4948-BCFC-9EC5E2F66D8D</outgoing>\n    </exclusiveGateway>\n    <exclusiveGateway id=\"SCAN_OK\" name=\"Scan successful?&#10;\">\n      <incoming>sid-EE8A7BA0-5D66-4F8B-80E3-CC2751B3856A</incoming>\n      <outgoing>sid-8B820AF5-DC5C-4618-B854-E08B71FB55CB</outgoing>\n      <outgoing>sid-337A23B9-A923-4CCE-B613-3E247B773CCE</outgoing>\n    </exclusiveGateway>\n    <sequenceFlow id=\"sid-337A23B9-A923-4CCE-B613-3E247B773CCE\" name=\"Yes\" sourceRef=\"SCAN_OK\" targetRef=\"sid-5134932A-1863-4FFA-BB3C-A4B4078B11A9\" />\n    <sequenceFlow id=\"sid-4DC479E5-5C20-4948-BCFC-9EC5E2F66D8D\" sourceRef=\"sid-5134932A-1863-4FFA-BB3C-A4B4078B11A9\" targetRef=\"sid-52EB1772-F36E-433E-8F5B-D5DFD26E6F26\" />\n    <sequenceFlow id=\"sid-8B820AF5-DC5C-4618-B854-E08B71FB55CB\" name=\"No\" sourceRef=\"SCAN_OK\" targetRef=\"sid-E49425CF-8287-4798-B622-D2A7D78EF00B\" />\n    <sequenceFlow id=\"sid-57EB1F24-BD94-479A-BF1F-57F1EAA19C6C\" sourceRef=\"sid-E49425CF-8287-4798-B622-D2A7D78EF00B\" targetRef=\"sid-E433566C-2289-4BEB-A19C-1697048900D2\" />\n    <sequenceFlow id=\"sid-EE8A7BA0-5D66-4F8B-80E3-CC2751B3856A\" sourceRef=\"sid-52EB1772-F36E-433E-8F5B-D5DFD26E6F26\" targetRef=\"SCAN_OK\" />\n    <sequenceFlow id=\"sid-7B791A11-2F2E-4D80-AFB3-91A02CF2B4FD\" sourceRef=\"sid-D7F237E8-56D0-4283-A3CE-4F0EFE446138\" targetRef=\"sid-5134932A-1863-4FFA-BB3C-A4B4078B11A9\" />\n  </process>\n  <bpmndi:BPMNDiagram id=\"sid-74620812-92c4-44e5-949c-aa47393d3830\">\n    <bpmndi:BPMNPlane id=\"sid-cdcae759-2af7-4a6d-bd02-53f3352a731d\" bpmnElement=\"sid-c0e745ff-361e-4afb-8c8d-2a1fc32b1424\">\n      <bpmndi:BPMNShape id=\"sid-87F4C1D6-25E1-4A45-9DA7-AD945993D06F_gui\" bpmnElement=\"sid-87F4C1D6-25E1-4A45-9DA7-AD945993D06F\" isHorizontal=\"true\">\n        <omgdc:Bounds x=\"83\" y=\"105\" width=\"933\" height=\"250\" />\n        <bpmndi:BPMNLabel labelStyle=\"sid-84cb49fd-2f7c-44fb-8950-83c3fa153d3b\">\n          <omgdc:Bounds x=\"47.49999999999999\" y=\"170.42857360839844\" width=\"12.000000000000014\" height=\"59.142852783203125\" />\n        </bpmndi:BPMNLabel>\n      </bpmndi:BPMNShape>\n      <bpmndi:BPMNShape id=\"sid-57E4FE0D-18E4-478D-BC5D-B15164E93254_gui\" bpmnElement=\"sid-57E4FE0D-18E4-478D-BC5D-B15164E93254\" isHorizontal=\"true\">\n        <omgdc:Bounds x=\"113\" y=\"105\" width=\"903\" height=\"250\" />\n      </bpmndi:BPMNShape>\n      <bpmndi:BPMNShape id=\"sid-52EB1772-F36E-433E-8F5B-D5DFD26E6F26_gui\" bpmnElement=\"sid-52EB1772-F36E-433E-8F5B-D5DFD26E6F26\">\n        <omgdc:Bounds x=\"393\" y=\"170\" width=\"100\" height=\"80\" />\n        <bpmndi:BPMNLabel labelStyle=\"sid-84cb49fd-2f7c-44fb-8950-83c3fa153d3b\">\n          <omgdc:Bounds x=\"360.5\" y=\"172\" width=\"84\" height=\"12\" />\n        </bpmndi:BPMNLabel>\n      </bpmndi:BPMNShape>\n      <bpmndi:BPMNShape id=\"sid-E49425CF-8287-4798-B622-D2A7D78EF00B_gui\" bpmnElement=\"sid-E49425CF-8287-4798-B622-D2A7D78EF00B\">\n        <omgdc:Bounds x=\"728\" y=\"170\" width=\"100\" height=\"80\" />\n        <bpmndi:BPMNLabel labelStyle=\"sid-84cb49fd-2f7c-44fb-8950-83c3fa153d3b\">\n          <omgdc:Bounds x=\"695.9285736083984\" y=\"162\" width=\"83.14285278320312\" height=\"36\" />\n        </bpmndi:BPMNLabel>\n      </bpmndi:BPMNShape>\n      <bpmndi:BPMNEdge id=\"sid-EE8A7BA0-5D66-4F8B-80E3-CC2751B3856A_gui\" bpmnElement=\"sid-EE8A7BA0-5D66-4F8B-80E3-CC2751B3856A\">\n        <omgdi:waypoint x=\"493\" y=\"210\" />\n        <omgdi:waypoint x=\"585\" y=\"210\" />\n        <bpmndi:BPMNLabel>\n          <omgdc:Bounds x=\"494\" y=\"185\" width=\"90\" height=\"20\" />\n        </bpmndi:BPMNLabel>\n      </bpmndi:BPMNEdge>\n      <bpmndi:BPMNEdge id=\"sid-8B820AF5-DC5C-4618-B854-E08B71FB55CB_gui\" bpmnElement=\"sid-8B820AF5-DC5C-4618-B854-E08B71FB55CB\">\n        <omgdi:waypoint x=\"635\" y=\"210\" />\n        <omgdi:waypoint x=\"728\" y=\"210\" />\n        <bpmndi:BPMNLabel labelStyle=\"sid-e0502d32-f8d1-41cf-9c4a-cbb49fecf581\">\n          <omgdc:Bounds x=\"642\" y=\"185\" width=\"16\" height=\"12\" />\n        </bpmndi:BPMNLabel>\n      </bpmndi:BPMNEdge>\n      <bpmndi:BPMNEdge id=\"sid-7B791A11-2F2E-4D80-AFB3-91A02CF2B4FD_gui\" bpmnElement=\"sid-7B791A11-2F2E-4D80-AFB3-91A02CF2B4FD\">\n        <omgdi:waypoint x=\"223\" y=\"210\" />\n        <omgdi:waypoint x=\"275\" y=\"210\" />\n        <bpmndi:BPMNLabel>\n          <omgdc:Bounds x=\"204\" y=\"185\" width=\"90\" height=\"20\" />\n        </bpmndi:BPMNLabel>\n      </bpmndi:BPMNEdge>\n      <bpmndi:BPMNEdge id=\"sid-4DC479E5-5C20-4948-BCFC-9EC5E2F66D8D_gui\" bpmnElement=\"sid-4DC479E5-5C20-4948-BCFC-9EC5E2F66D8D\">\n        <omgdi:waypoint x=\"325\" y=\"210\" />\n        <omgdi:waypoint x=\"393\" y=\"210\" />\n        <bpmndi:BPMNLabel>\n          <omgdc:Bounds x=\"314\" y=\"185\" width=\"90\" height=\"20\" />\n        </bpmndi:BPMNLabel>\n      </bpmndi:BPMNEdge>\n      <bpmndi:BPMNEdge id=\"sid-57EB1F24-BD94-479A-BF1F-57F1EAA19C6C_gui\" bpmnElement=\"sid-57EB1F24-BD94-479A-BF1F-57F1EAA19C6C\">\n        <omgdi:waypoint x=\"828\" y=\"210\" />\n        <omgdi:waypoint x=\"901\" y=\"210\" />\n        <bpmndi:BPMNLabel>\n          <omgdc:Bounds x=\"820\" y=\"185\" width=\"90\" height=\"20\" />\n        </bpmndi:BPMNLabel>\n      </bpmndi:BPMNEdge>\n      <bpmndi:BPMNEdge id=\"sid-337A23B9-A923-4CCE-B613-3E247B773CCE_gui\" bpmnElement=\"sid-337A23B9-A923-4CCE-B613-3E247B773CCE\">\n        <omgdi:waypoint x=\"611\" y=\"234\" />\n        <omgdi:waypoint x=\"610.5\" y=\"299\" />\n        <omgdi:waypoint x=\"300.5\" y=\"299\" />\n        <omgdi:waypoint x=\"301\" y=\"234\" />\n        <bpmndi:BPMNLabel labelStyle=\"sid-e0502d32-f8d1-41cf-9c4a-cbb49fecf581\">\n          <omgdc:Bounds x=\"585\" y=\"236\" width=\"21\" height=\"12\" />\n        </bpmndi:BPMNLabel>\n      </bpmndi:BPMNEdge>\n      <bpmndi:BPMNShape id=\"StartEvent_0l6sgn0_di\" bpmnElement=\"sid-D7F237E8-56D0-4283-A3CE-4F0EFE446138\">\n        <omgdc:Bounds x=\"187\" y=\"192\" width=\"36\" height=\"36\" />\n        <bpmndi:BPMNLabel>\n          <omgdc:Bounds x=\"182\" y=\"229\" width=\"46\" height=\"24\" />\n        </bpmndi:BPMNLabel>\n      </bpmndi:BPMNShape>\n      <bpmndi:BPMNShape id=\"EndEvent_0xwuvv5_di\" bpmnElement=\"sid-E433566C-2289-4BEB-A19C-1697048900D2\">\n        <omgdc:Bounds x=\"901\" y=\"192\" width=\"36\" height=\"36\" />\n        <bpmndi:BPMNLabel>\n          <omgdc:Bounds x=\"892\" y=\"231\" width=\"56\" height=\"12\" />\n        </bpmndi:BPMNLabel>\n      </bpmndi:BPMNShape>\n      <bpmndi:BPMNShape id=\"ExclusiveGateway_1g0eih2_di\" bpmnElement=\"sid-5134932A-1863-4FFA-BB3C-A4B4078B11A9\" isMarkerVisible=\"true\">\n        <omgdc:Bounds x=\"275\" y=\"185\" width=\"50\" height=\"50\" />\n        <bpmndi:BPMNLabel>\n          <omgdc:Bounds x=\"210\" y=\"160\" width=\"90\" height=\"12\" />\n        </bpmndi:BPMNLabel>\n      </bpmndi:BPMNShape>\n      <bpmndi:BPMNShape id=\"ExclusiveGateway_0vci1x5_di\" bpmnElement=\"SCAN_OK\" isMarkerVisible=\"true\">\n        <omgdc:Bounds x=\"585\" y=\"185\" width=\"50\" height=\"50\" />\n        <bpmndi:BPMNLabel>\n          <omgdc:Bounds x=\"568\" y=\"157\" width=\"88\" height=\"24\" />\n        </bpmndi:BPMNLabel>\n      </bpmndi:BPMNShape>\n    </bpmndi:BPMNPlane>\n    <bpmndi:BPMNLabelStyle id=\"sid-e0502d32-f8d1-41cf-9c4a-cbb49fecf581\">\n      <omgdc:Font name=\"Arial\" size=\"11\" isBold=\"false\" isItalic=\"false\" isUnderline=\"false\" isStrikeThrough=\"false\" />\n    </bpmndi:BPMNLabelStyle>\n    <bpmndi:BPMNLabelStyle id=\"sid-84cb49fd-2f7c-44fb-8950-83c3fa153d3b\">\n      <omgdc:Font name=\"Arial\" size=\"12\" isBold=\"false\" isItalic=\"false\" isUnderline=\"false\" isStrikeThrough=\"false\" />\n    </bpmndi:BPMNLabelStyle>\n  </bpmndi:BPMNDiagram>\n</definitions>"
  },
  {
    "path": "example/public/index.html",
    "content": "<!DOCTYPE html>\n<html>\n<head>\n  <title>react-bpmn example</title>\n\n  <!-- app dependency -->\n  <script src=\"https://unpkg.com/react@18/umd/react.development.js\"></script>\n  <script src=\"https://unpkg.com/react-dom@18/umd/react-dom.development.js\"></script>\n\n  <!-- dependency for the UMD bundle -->\n  <script src=\"../node_modules/bpmn-js/dist/bpmn-navigated-viewer.development.js\"></script>\n\n  <!-- react-bpmn umd distribution -->\n  <script src=\"../node_modules/react-bpmn/dist/react-bpmn.umd.js\"></script>\n\n  <!-- Don't use this in production: -->\n  <script src=\"https://unpkg.com/@babel/standalone@7.12.12/babel.min.js\"></script>\n\n  <style>\n    .diagram-container {\n      height:  400px;\n    }\n\n    .react-bpmn-diagram-container {\n      width: 100%;\n      height:  100%;\n    }\n  </style>\n</head>\n<body>\n  <div>\n    <h1>Display BPMN 2.0 Diagrams Using React</h1>\n\n    <p>\n      Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aenean a tincidunt dolor. Nam semper est ut mauris cursus, vel laoreet nunc vehicula. Mauris nec semper ipsum. Integer feugiat mi at elementum fringilla. Nunc malesuada ante sed ligula pretium, eu lobortis lorem rhoncus. Praesent et ipsum ante. Aliquam est mi, ultrices ut neque eget, mollis pulvinar sem. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Nullam auctor porta sapien in venenatis.\n    </p>\n\n    <p>\n      In fringilla suscipit odio quis tincidunt. Morbi felis elit, blandit a volutpat eget, rutrum ut mi. Duis ac orci at nibh semper vehicula. Quisque vulputate, nibh vitae laoreet convallis, urna erat imperdiet eros, et interdum arcu arcu ac risus. Maecenas in tellus nisi. Mauris quis lectus luctus, condimentum orci eu, rhoncus sapien. Aliquam at lobortis mauris, eget facilisis arcu. Quisque metus purus, rhoncus et tortor id, ornare maximus neque. Donec et ex tincidunt, malesuada lacus in, volutpat eros. Cras nisi arcu, dapibus quis odio sit amet, placerat blandit elit. Nullam at dictum mauris. Nulla feugiat elit ex, a pulvinar velit faucibus a. Nulla tincidunt velit purus, in faucibus ligula ornare venenatis.\n    </p>\n\n    <div id=\"diagram\" class=\"diagram-container\"></div>\n\n    <p>\n      Ut vestibulum, magna at molestie tempus, enim sem molestie est, vel tincidunt orci leo vel sapien. Vivamus convallis, purus in rhoncus ultricies, mauris sapien condimentum sapien, vel porta urna est eu leo. Nam dui erat, venenatis at metus ut, rutrum rutrum lacus. Fusce non eros vehicula, aliquet nibh vitae, bibendum dolor. Sed hendrerit lectus ex. Mauris id venenatis metus. In hac habitasse platea dictumst.\n    </p>\n\n    <p>\n      Etiam molestie, erat eget tincidunt rutrum, nulla odio pulvinar nibh, in pulvinar felis mauris a nunc. Sed eu ullamcorper ex, id tincidunt metus. Quisque lectus enim, vehicula eget aliquam sit amet, semper ut nisl. Vivamus ultrices, cras odio massa, sagittis in luctus sed, mattis eu massa. Nam erat nibh, pulvinar vel hendrerit quis, ultricies eu sapien. Integer fringilla sapien ex, et posuere arcu euismod et.\n    </p>\n\n    <p>\n      Suspendisse potenti. In ut lorem vitae dolor molestie commodo. Vivamus mattis gravida metus, porttitor ornare augue lacinia suscipit. Duis condimentum fringilla nisl, non consequat odio mollis id. Nulla tincidunt interdum elit, sed tristique ex laoreet lobortis. Suspendisse in felis vitae magna convallis semper. Nullam odio risus, venenatis eget erat ac, pretium aliquet urna. Duis luctus lobortis maximus.\n    </p>\n  </div>\n  <script type=\"text/babel\">\n    function onError(err) {\n      console.error('failed to render diagram', err);\n    }\n\n    function onLoading() {\n      console.log('loading diagram');\n    }\n\n    function onShown() {\n      console.log('diagram shown');\n    }\n\n    function ExternalLoadedBpmn({ url }) {\n      const [diagramXML, setDiagramXML] = React.useState();\n\n      React.useEffect(() => {\n        const abortController = new AbortController();\n        const loadXml = async () => {\n          try {\n            const response = await fetch(url, {\n              signal: abortController.signal\n            });\n            const result = await response.text();\n            setDiagramXML(result);\n\n          } catch (error) {\n            if (!abortController.signal.aborted) {\n              console.log(error);\n            }\n          }\n        }\n\n        loadXml();\n\n        return () => abortController.abort();\n      }, [url])\n\n      return (\n        diagramXML\n          ? <ReactBpmn\n            diagramXML={diagramXML}\n            onLoading={onLoading}\n            onShown={onShown}\n            onError={onError}\n          />\n          : null\n      );\n    }\n\n    const container = document.querySelector('#diagram');\n    const root = ReactDOM.createRoot(container);\n    root.render(\n      <div>\n        <ReactBpmn\n          url=\"/public/diagram.bpmn\"\n          onLoading={onLoading}\n          onShown={onShown}\n          onError={onError}\n        />\n        <hr />\n\n        <ExternalLoadedBpmn\n          url=\"/public/diagram.bpmn\"\n          onLoading={onLoading}\n          onShown={onShown}\n          onError={onError}\n        />\n      </div>\n    )\n  </script>\n</body>\n</html>\n"
  },
  {
    "path": "package.json",
    "content": "{\n  \"name\": \"react-bpmn\",\n  \"version\": \"0.2.0\",\n  \"description\": \"Embed BPMN 2.0 diagrams in your React app\",\n  \"main\": \"dist/index.js\",\n  \"files\": [\n    \"dist\",\n    \"src\"\n  ],\n  \"scripts\": {\n    \"all\": \"npm run bundle\",\n    \"bundle\": \"cross-env NODE_ENV=production rollup -c --bundleConfigAsCjs\",\n    \"prepublishOnly\": \"npm run bundle\",\n    \"postinstall\": \"cd example && npm install\",\n    \"start\": \"cd example && npm start\"\n  },\n  \"module\": \"dist/index.esm.js\",\n  \"repository\": {\n    \"type\": \"git\",\n    \"url\": \"git+https://github.com/bpmn-io/react-bpmn.git\"\n  },\n  \"keywords\": [\n    \"bpmn-js\",\n    \"bpmn\",\n    \"react-js\",\n    \"react\"\n  ],\n  \"author\": {\n    \"name\": \"Nico Rehwaldt\",\n    \"url\": \"https://github.com/nikku\"\n  },\n  \"license\": \"MIT\",\n  \"devDependencies\": {\n    \"@babel/core\": \"^7.19.0\",\n    \"@babel/preset-env\": \"^7.19.0\",\n    \"@rollup/plugin-babel\": \"^7.0.0\",\n    \"@rollup/plugin-commonjs\": \"^29.0.0\",\n    \"@rollup/plugin-node-resolve\": \"^16.0.0\",\n    \"@rollup/plugin-replace\": \"^6.0.0\",\n    \"babel-preset-react-app\": \"^10.0.1\",\n    \"cross-env\": \"^10.0.0\",\n    \"react\": \"^19.0.0\",\n    \"react-dom\": \"^19.0.0\",\n    \"rollup\": \"^4.18.0\"\n  }\n}\n"
  },
  {
    "path": "renovate.json",
    "content": "{\n  \"$schema\": \"https://docs.renovatebot.com/renovate-schema.json\",\n  \"extends\": [\n    \"github>bpmn-io/renovate-config:recommended\"\n  ]\n}\n"
  },
  {
    "path": "rollup.config.js",
    "content": "import pkg from './package.json';\n\nimport cjs from '@rollup/plugin-commonjs';\n\nimport { babel } from '@rollup/plugin-babel';\n\nimport nodeResolve from '@rollup/plugin-node-resolve';\n\nimport replace from '@rollup/plugin-replace';\n\nfunction pgl() {\n  return [\n    cjs(),\n    nodeResolve(),\n    replace({\n      'process.env.NODE_ENV': JSON.stringify( 'production' )\n    }),\n    babel({\n      babelrc: false,\n      babelHelpers: 'runtime',\n      exclude: 'node_modules/**',\n      presets: [\n        ['@babel/env', { modules: false }],\n        'react-app'\n      ]\n    })\n  ];\n}\n\nexport default [\n  {\n    input: './src/index.jsx',\n    output: {\n      name: 'ReactBpmn',\n      file: `dist/react-bpmn.umd.js`,\n      format: 'umd'\n    },\n    plugins: pgl()\n  },\n  {\n    input: './src/index.jsx',\n    output: [\n      { file: pkg.main, format: 'cjs' },\n      { file: pkg.module, format: 'es' }\n    ],\n    plugins: pgl()\n  }\n];"
  },
  {
    "path": "src/index.jsx",
    "content": "import React from 'react';\n\nimport BpmnJS from 'bpmn-js/dist/bpmn-navigated-viewer.production.min.js';\n\n\nexport default class ReactBpmn extends React.Component {\n\n  constructor(props) {\n    super(props);\n\n    this.state = { };\n\n    this.containerRef = React.createRef();\n  }\n\n  componentDidMount() {\n\n    const {\n      url,\n      diagramXML\n    } = this.props;\n\n    const container = this.containerRef.current;\n\n    this.bpmnViewer = new BpmnJS({ container });\n\n    this.bpmnViewer.on('import.done', (event) => {\n      const {\n        error,\n        warnings\n      } = event;\n\n      if (error) {\n        return this.handleError(error);\n      }\n\n      this.bpmnViewer.get('canvas').zoom('fit-viewport');\n\n      return this.handleShown(warnings);\n    });\n\n    if (url) {\n      return this.fetchDiagram(url);\n    }\n\n    if (diagramXML) {\n      return this.displayDiagram(diagramXML);\n    }\n  }\n\n  componentWillUnmount() {\n    this.bpmnViewer.destroy();\n  }\n\n  componentDidUpdate(prevProps, prevState) {\n    const {\n      props,\n      state\n    } = this;\n\n    if (props.url !== prevProps.url) {\n      return this.fetchDiagram(props.url);\n    }\n\n    const currentXML = props.diagramXML || state.diagramXML;\n\n    const previousXML = prevProps.diagramXML || prevState.diagramXML;\n\n    if (currentXML && currentXML !== previousXML) {\n      return this.displayDiagram(currentXML);\n    }\n  }\n\n  displayDiagram(diagramXML) {\n    this.bpmnViewer.importXML(diagramXML);\n  }\n\n  fetchDiagram(url) {\n\n    this.handleLoading();\n\n    fetch(url)\n      .then(response => response.text())\n      .then(text => this.setState({ diagramXML: text }))\n      .catch(err => this.handleError(err));\n  }\n\n  handleLoading() {\n    const { onLoading } = this.props;\n\n    if (onLoading) {\n      onLoading();\n    }\n  }\n\n  handleError(err) {\n    const { onError } = this.props;\n\n    if (onError) {\n      onError(err);\n    }\n  }\n\n  handleShown(warnings) {\n    const { onShown } = this.props;\n\n    if (onShown) {\n      onShown(warnings);\n    }\n  }\n\n  render() {\n    return (\n      <div className=\"react-bpmn-diagram-container\" ref={ this.containerRef }></div>\n    );\n  }\n}\n"
  }
]