-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add lit-element project (#507)
Demonstrate that bpmn-visualization can be integrated in a Web Component. Built with Vite. Use patch-package to patch mxGraph and make it correctly handles `ShadowRoot`.
- Loading branch information
Showing
16 changed files
with
1,256 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
# Logs | ||
logs | ||
*.log | ||
npm-debug.log* | ||
yarn-debug.log* | ||
yarn-error.log* | ||
pnpm-debug.log* | ||
lerna-debug.log* | ||
|
||
node_modules | ||
package-lock.json | ||
dist | ||
dist-ssr | ||
*.local | ||
|
||
# Editor directories and files | ||
.vscode/* | ||
!.vscode/extensions.json | ||
.idea | ||
.DS_Store | ||
*.suo | ||
*.ntvs* | ||
*.njsproj | ||
*.sln | ||
*.sw? |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
package-lock=true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
# Integrate `bpmn-visualization` in a lit-element TypeScript project built with Vite | ||
|
||
To run locally: | ||
|
||
1. `npm install` | ||
2. `npm start` | ||
3. [localhost app](http://localhost:5173) | ||
|
||
You will see the following diagram: | ||
|
||
![BPMN diagram in the home page](docs/home.png) | ||
|
||
The code calling `bpmn-visualization` to render the BPMN diagram is available in [index.ts](src/index.ts). | ||
|
||
If you want to bundle the application, run `npm run build` and then run `npm run preview` to access to a preview of the | ||
bundle application with http://localhost:4173. | ||
|
||
## Specific mxGraph patch to make it work | ||
|
||
To workaround bug [#2738](https://github.com/process-analytics/bpmn-visualization-js/issues/2738) "[BUG] Failed to execute 'getComputedStyle' when using lit", | ||
`mxGraph` is patched using [patch-package](https://www.npmjs.com/package/patch-package) as the root cause of the bug is an issue in the `mxGraph` code. | ||
|
||
The patch has been created by modifying manually `node_modules/mxgraph/javascript/dist/build.js` | ||
and then running: `npx patch-package mxgraph` |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="UTF-8" /> | ||
<link rel="icon" type="image/svg+xml" href="favicon.svg" /> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> | ||
<title>bpmn-visualization TypeScript Integration with lit-element</title> | ||
<script type="module" src="/src/index.ts"></script> | ||
</head> | ||
<body> | ||
<h1 class="title">bpmn-visualization TypeScript Integration with lit-element</h1> | ||
<bpmn-diag></bpmn-diag> | ||
<footer></footer> | ||
</body> | ||
</html> |
Oops, something went wrong.