mirror of
https://github.com/mermaid-js/mermaid.git
synced 2025-08-17 15:29:25 +02:00
Compare commits
7 Commits
v9.2.1
...
sidv/webpa
Author | SHA1 | Date | |
---|---|---|---|
![]() |
166dca4924 | ||
![]() |
75d276e19e | ||
![]() |
2243af1871 | ||
![]() |
41dbf0fa96 | ||
![]() |
1a5e7315c0 | ||
![]() |
da6bb9498a | ||
![]() |
1e417833f4 |
3
.npmrc
3
.npmrc
@@ -1 +1,2 @@
|
||||
auto-install-peers=true
|
||||
auto-install-peers=true
|
||||
strict-peer-dependencies=false
|
14
package.json
14
package.json
@@ -3,19 +3,8 @@
|
||||
"private": true,
|
||||
"version": "9.2.0-rc4",
|
||||
"description": "Markdownish syntax for generating flowcharts, sequence diagrams, class diagrams, gantt charts and git graphs.",
|
||||
"main": "dist/mermaid.core.mjs",
|
||||
"module": "dist/mermaid.core.mjs",
|
||||
"types": "dist/mermaid.d.ts",
|
||||
"type": "module",
|
||||
"packageManager": "pnpm@7.13.2",
|
||||
"exports": {
|
||||
".": {
|
||||
"require": "./dist/mermaid.min.js",
|
||||
"import": "./dist/mermaid.core.mjs",
|
||||
"types": "./dist/mermaid.d.ts"
|
||||
},
|
||||
"./*": "./*"
|
||||
},
|
||||
"keywords": [
|
||||
"diagram",
|
||||
"markdown",
|
||||
@@ -147,9 +136,6 @@
|
||||
"resolutions": {
|
||||
"d3": "^7.0.0"
|
||||
},
|
||||
"files": [
|
||||
"dist"
|
||||
],
|
||||
"sideEffects": [
|
||||
"**/*.css",
|
||||
"**/*.scss"
|
||||
|
@@ -2,10 +2,10 @@
|
||||
"name": "mermaid",
|
||||
"version": "9.2.0",
|
||||
"description": "Markdownish syntax for generating flowcharts, sequence diagrams, class diagrams, gantt charts and git graphs.",
|
||||
"main": "./dist/mermaid.core.mjs",
|
||||
"main": "./dist/mermaid.min.js",
|
||||
"module": "./dist/mermaid.core.mjs",
|
||||
"types": "./dist/mermaid.d.ts",
|
||||
"type": "module",
|
||||
"type": "commonjs",
|
||||
"exports": {
|
||||
".": {
|
||||
"require": "./dist/mermaid.min.js",
|
||||
|
@@ -482,9 +482,9 @@ const parseAsync = (txt: string) => {
|
||||
const renderAsync = (
|
||||
id: string,
|
||||
text: string,
|
||||
cb: (svgCode: string, bindFunctions?: (element: Element) => void) => void,
|
||||
cb?: (svgCode: string, bindFunctions?: (element: Element) => void) => void,
|
||||
container?: Element
|
||||
): Promise<void> => {
|
||||
): Promise<string> => {
|
||||
return new Promise((resolve, reject) => {
|
||||
// This promise will resolve when the mermaidAPI.render call is done.
|
||||
// It will be queued first and will be executed when it is first in line
|
||||
|
@@ -115,19 +115,19 @@ export const decodeEntities = function (text: string): string {
|
||||
*
|
||||
* @param {string} id The id of the element to be rendered
|
||||
* @param {string} text The graph definition
|
||||
* @param {(svgCode: string, bindFunctions?: (element: Element) => void) => void} cb Callback which
|
||||
* @param cb - Optional callback which
|
||||
* is called after rendering is finished with the svg code as inparam.
|
||||
* @param {Element} container Selector to element in which a div with the graph temporarily will be
|
||||
* inserted. If one is provided a hidden div will be inserted in the body of the page instead. The
|
||||
* element will be removed when rendering is completed.
|
||||
* @returns {void}
|
||||
* @returns Returns the rendered element as a string containing the SVG definition.
|
||||
*/
|
||||
const render = function (
|
||||
id: string,
|
||||
text: string,
|
||||
cb: (svgCode: string, bindFunctions?: (element: Element) => void) => void,
|
||||
cb?: (svgCode: string, bindFunctions?: (element: Element) => void) => void,
|
||||
container?: Element
|
||||
): void {
|
||||
): string {
|
||||
addDiagrams();
|
||||
configApi.reset();
|
||||
text = text.replace(/\r\n?/g, '\n'); // parser problems on CRLF ignore all CR and leave LF;;
|
||||
@@ -401,9 +401,9 @@ const render = function (
|
||||
const renderAsync = async function (
|
||||
id: string,
|
||||
text: string,
|
||||
cb: (svgCode: string, bindFunctions?: (element: Element) => void) => void,
|
||||
cb?: (svgCode: string, bindFunctions?: (element: Element) => void) => void,
|
||||
container?: Element
|
||||
): Promise<void> {
|
||||
): Promise<string> {
|
||||
addDiagrams();
|
||||
configApi.reset();
|
||||
text = text.replace(/\r\n?/g, '\n'); // parser problems on CRLF ignore all CR and leave LF;;
|
||||
|
968
pnpm-lock.yaml
generated
968
pnpm-lock.yaml
generated
File diff suppressed because it is too large
Load Diff
@@ -1,3 +1,4 @@
|
||||
packages:
|
||||
# all packages in direct subdirs of packages/
|
||||
- 'packages/*'
|
||||
- 'tests/*'
|
||||
|
22
tests/webpack/package.json
Normal file
22
tests/webpack/package.json
Normal file
@@ -0,0 +1,22 @@
|
||||
{
|
||||
"name": "webpack",
|
||||
"version": "1.0.0",
|
||||
"description": "",
|
||||
"private": true,
|
||||
"module": "commonjs",
|
||||
"scripts": {
|
||||
"build": "webpack",
|
||||
"serve": "webpack serve"
|
||||
},
|
||||
"keywords": [],
|
||||
"author": "",
|
||||
"license": "ISC",
|
||||
"devDependencies": {
|
||||
"webpack": "^5.74.0",
|
||||
"webpack-cli": "^4.10.0",
|
||||
"webpack-dev-server": "^4.11.1"
|
||||
},
|
||||
"dependencies": {
|
||||
"mermaid": "workspace:*"
|
||||
}
|
||||
}
|
10
tests/webpack/public/index.html
Normal file
10
tests/webpack/public/index.html
Normal file
@@ -0,0 +1,10 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<title>Getting Started</title>
|
||||
</head>
|
||||
<body>
|
||||
<script src="./main.js"></script>
|
||||
</body>
|
||||
</html>
|
6
tests/webpack/src/index.js
Normal file
6
tests/webpack/src/index.js
Normal file
@@ -0,0 +1,6 @@
|
||||
/* eslint-disable @typescript-eslint/no-var-requires */
|
||||
/* eslint-disable no-console */
|
||||
const mermaid = require('mermaid');
|
||||
// import mermaid from 'mermaid';
|
||||
|
||||
console.log(mermaid);
|
9
tests/webpack/webpack.config.js
Normal file
9
tests/webpack/webpack.config.js
Normal file
@@ -0,0 +1,9 @@
|
||||
const path = require('path');
|
||||
|
||||
module.exports = {
|
||||
entry: './src/index.js',
|
||||
output: {
|
||||
filename: 'main.js',
|
||||
path: path.resolve(__dirname, 'dist'),
|
||||
},
|
||||
};
|
Reference in New Issue
Block a user