Skip to content

Commit

Permalink
chore(lib): update mermaid 8.5.1 -> 9.0.1
Browse files Browse the repository at this point in the history
  • Loading branch information
dillonzq committed May 7, 2022
1 parent 7f5bcda commit 857047a
Show file tree
Hide file tree
Showing 24 changed files with 76 additions and 1,070 deletions.
4 changes: 2 additions & 2 deletions assets/data/cdn/jsdelivr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@ libFiles:
katexCopyTexCSS: [email protected]/dist/contrib/copy-tex.min.css
katexCopyTexJS: [email protected]/dist/contrib/copy-tex.min.js
katexMhchemJS: [email protected]/dist/contrib/mhchem.min.js
# mermaid@8.5.1 https://github.com/knsv/mermaid
mermaidJS: mermaid@8.5.1/dist/mermaid.min.js
# mermaid@9.0.1 https://github.com/knsv/mermaid
mermaidJS: mermaid@9.0.1/dist/mermaid.min.js
# [email protected] https://echarts.apache.org/
echartsJS: [email protected]/dist/echarts.min.js
echartsMacaronsJS: [email protected]/theme/macarons.min.js
Expand Down
43 changes: 29 additions & 14 deletions assets/js/theme.js
Original file line number Diff line number Diff line change
Expand Up @@ -639,19 +639,27 @@ var Theme = /*#__PURE__*/function () {
value: function initMermaid() {
var _this7 = this;

var $mermaidElements = document.getElementsByClassName('mermaid');
this._mermaidOnSwitchTheme = this._mermaidOnSwitchTheme || function () {
var $mermaidElements = document.getElementsByClassName('mermaid');

if ($mermaidElements.length) {
mermaid.initialize({
startOnLoad: false,
theme: _this7.isDark ? 'dark' : 'neutral',
securityLevel: 'loose'
});

if ($mermaidElements.length) {
mermaid.initialize({
startOnLoad: false,
theme: 'null'
});
this.util.forEach($mermaidElements, function ($mermaid) {
mermaid.mermaidAPI.render('svg-' + $mermaid.id, _this7.data[$mermaid.id], function (svgCode) {
$mermaid.insertAdjacentHTML('afterbegin', svgCode);
}, $mermaid);
});
}
_this7.util.forEach($mermaidElements, function ($mermaid) {
mermaid.render('svg-' + $mermaid.id, _this7.data[$mermaid.id], function (svgCode) {
$mermaid.innerHTML = svgCode;
}, $mermaid);
});
}
};

this.switchThemeEventSet.add(this._mermaidOnSwitchTheme);

this._mermaidOnSwitchTheme();
}
}, {
key: "initEcharts",
Expand Down Expand Up @@ -918,16 +926,23 @@ var Theme = /*#__PURE__*/function () {
_step2;

try {
for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
var _loop = function _loop() {
var event = _step2.value;
event();
window.setTimeout(function () {
event();
}, 100);
};

for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
_loop();
}
} catch (err) {
_iterator2.e(err);
} finally {
_iterator2.f();
}

;
_this12.oldScrollTop = _this12.newScrollTop;
}, false);
}
Expand Down
2 changes: 1 addition & 1 deletion assets/lib/VERSION
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ [email protected] https://github.com/zenorocha/clipboard.js
[email protected] https://github.com/ellisonleao/sharer.js
[email protected] https://github.com/alexmacarthur/typeit
[email protected] https://katex.org/
mermaid@8.5.1 https://github.com/knsv/mermaid
mermaid@9.0.1 https://github.com/knsv/mermaid
[email protected] https://echarts.apache.org/
[email protected] https://github.com/mapbox/mapbox-gl-js
[email protected] https://github.com/MoePlayer/APlayer
Expand Down
43 changes: 2 additions & 41 deletions assets/lib/mermaid/mermaid.min.js

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions assets/lib/mermaid/mermaid.min.js.map

Large diffs are not rendered by default.

19 changes: 0 additions & 19 deletions assets/lib/mermaid/mermaid.scss

This file was deleted.

91 changes: 0 additions & 91 deletions assets/lib/mermaid/themes/class.scss

This file was deleted.

62 changes: 0 additions & 62 deletions assets/lib/mermaid/themes/dark/index.scss

This file was deleted.

60 changes: 0 additions & 60 deletions assets/lib/mermaid/themes/default/index.scss

This file was deleted.

68 changes: 0 additions & 68 deletions assets/lib/mermaid/themes/flowchart.scss

This file was deleted.

Loading

0 comments on commit 857047a

Please sign in to comment.