@8btc/mditor 0.0.16 → 0.0.17

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.
@@ -196,3 +196,21 @@
196
196
  color: #0a0a0a !important;
197
197
  }
198
198
  }
199
+
200
+ .vditor-reset .mermaid-error {
201
+ border: 1px dashed rgba(255, 255, 255, 0.2);
202
+ }
203
+
204
+ .vditor-reset .mermaid-error .mermaid-error-icon {
205
+ border: 1px solid rgba(255, 255, 255, 0.2);
206
+ }
207
+
208
+ .vditor-reset .mermaid-error .mermaid-error-title {
209
+ color: rgba(252, 252, 252, 0.9);
210
+ }
211
+ .vditor-reset .mermaid-error .mermaid-error-message {
212
+ color: #a3a3a3;
213
+ }
214
+ .vditor-reset .mermaid-error .mermaid-error-icon {
215
+ color: rgba(252, 252, 252, 0.9);
216
+ }
package/dist/index.css CHANGED
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * Vditor v0.0.16 - A markdown editor written in TypeScript.
2
+ * Vditor v0.0.17 - A markdown editor written in TypeScript.
3
3
  *
4
4
  * MIT License
5
5
  *
@@ -25,7 +25,7 @@
25
25
  *
26
26
  */
27
27
  /*!
28
- * Vditor v0.0.16 - A markdown editor written in TypeScript.
28
+ * Vditor v0.0.17 - A markdown editor written in TypeScript.
29
29
  *
30
30
  * MIT License
31
31
  *
@@ -115,7 +115,7 @@
115
115
  }
116
116
  }
117
117
  .vditor-tooltipped {
118
- position: relative;
118
+ position: relative !important;
119
119
  cursor: pointer;
120
120
  }
121
121
  .vditor-tooltipped::after {
@@ -2124,6 +2124,37 @@
2124
2124
  .vditor--dark .vditor-reset .vditor-selection-tag .vditor-selection-tag__lines {
2125
2125
  color: #b9b9b9;
2126
2126
  }
2127
+ .mermaid-error {
2128
+ border: 1px dashed #E5E5E5;
2129
+ border-radius: 0.625rem;
2130
+ padding: 3rem 1.5rem;
2131
+ text-align: center;
2132
+ }
2133
+ .mermaid-error .mermaid-error-icon {
2134
+ display: inline-block;
2135
+ color: #0A0A0A;
2136
+ padding: 0.5rem;
2137
+ border-radius: 0.5rem;
2138
+ margin-bottom: 1.5rem;
2139
+ border: 1px solid #E5E5E5;
2140
+ line-height: 1;
2141
+ }
2142
+ .mermaid-error .mermaid-error-icon > svg {
2143
+ display: block;
2144
+ stroke-width: 2;
2145
+ }
2146
+ .mermaid-error .mermaid-error-title {
2147
+ font-size: 1.25rem;
2148
+ color: #0A0A0A;
2149
+ font-weight: 700;
2150
+ line-height: 140%;
2151
+ margin-bottom: 0.5rem;
2152
+ }
2153
+ .mermaid-error .mermaid-error-message {
2154
+ font-size: 0.875rem;
2155
+ line-height: 140%;
2156
+ color: #737373;
2157
+ }
2127
2158
  details > summary {
2128
2159
  list-style: none;
2129
2160
  }
package/dist/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * Vditor v0.0.16 - A markdown editor written in TypeScript.
2
+ * Vditor v0.0.17 - A markdown editor written in TypeScript.
3
3
  *
4
4
  * MIT License
5
5
  *
@@ -2844,7 +2844,7 @@ var Vditor = /** @class */ (function () {
2844
2844
  /* harmony export */ "H": () => (/* binding */ _VDITOR_VERSION),
2845
2845
  /* harmony export */ "g": () => (/* binding */ Constants)
2846
2846
  /* harmony export */ });
2847
- var _VDITOR_VERSION = "0.0.16";
2847
+ var _VDITOR_VERSION = "0.0.17";
2848
2848
 
2849
2849
  var Constants = /** @class */ (function () {
2850
2850
  function Constants() {
@@ -3146,7 +3146,7 @@ var Constants = /** @class */ (function () {
3146
3146
  "c#",
3147
3147
  "bat",
3148
3148
  ];
3149
- Constants.CDN = "https://webcdn.wujieai.com/vditor@".concat("0.0.16");
3149
+ Constants.CDN = "https://webcdn.wujieai.com/vditor@".concat("0.0.17");
3150
3150
  Constants.MARKDOWN_OPTIONS = {
3151
3151
  autoSpace: false,
3152
3152
  gfmAutoLink: true,
@@ -5748,19 +5748,19 @@ var mermaidRender = function (element, cdn, theme) {
5748
5748
  startOnLoad: false,
5749
5749
  flowchart: {
5750
5750
  htmlLabels: true,
5751
- useMaxWidth: !0
5751
+ useMaxWidth: !0,
5752
5752
  },
5753
5753
  sequence: {
5754
5754
  useMaxWidth: true,
5755
5755
  diagramMarginX: 8,
5756
5756
  diagramMarginY: 8,
5757
5757
  boxMargin: 8,
5758
- showSequenceNumbers: true // Mermaid 时序图增加序号 https://github.com/siyuan-note/siyuan/pull/6992 https://mermaid.js.org/syntax/sequenceDiagram.html#sequencenumbers
5758
+ showSequenceNumbers: true, // Mermaid 时序图增加序号 https://github.com/siyuan-note/siyuan/pull/6992 https://mermaid.js.org/syntax/sequenceDiagram.html#sequencenumbers
5759
5759
  },
5760
5760
  gantt: {
5761
5761
  leftPadding: 75,
5762
- rightPadding: 20
5763
- }
5762
+ rightPadding: 20,
5763
+ },
5764
5764
  };
5765
5765
  if (theme === "dark") {
5766
5766
  config.theme = "dark";
@@ -5772,7 +5772,8 @@ var mermaidRender = function (element, cdn, theme) {
5772
5772
  switch (_a.label) {
5773
5773
  case 0:
5774
5774
  code = _adapterRender__WEBPACK_IMPORTED_MODULE_1__.mermaidRenderAdapter.getCode(item);
5775
- if (item.getAttribute("data-processed") === "true" || code.trim() === "") {
5775
+ if (item.getAttribute("data-processed") === "true" ||
5776
+ code.trim() === "") {
5776
5777
  return [2 /*return*/];
5777
5778
  }
5778
5779
  id = "mermaid" + (0,_util_function__WEBPACK_IMPORTED_MODULE_3__/* .genUUID */ .Wb)();
@@ -5787,7 +5788,7 @@ var mermaidRender = function (element, cdn, theme) {
5787
5788
  case 3:
5788
5789
  e_1 = _a.sent();
5789
5790
  errorElement = document.querySelector("#" + id);
5790
- item.innerHTML = "".concat(errorElement.outerHTML, "<br>\n<div style=\"text-align: left\"><small>").concat(e_1.message.replace(/\n/, "<br>"), "</small></div>");
5791
+ item.innerHTML = "\n<div class=\"mermaid-error\">\n<div class=\"mermaid-error-icon\"><svg xmlns=\"http://www.w3.org/2000/svg\" width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\" class=\"lucide lucide-bug-icon lucide-bug\"><path d=\"M12 20v-9\"/><path d=\"M14 7a4 4 0 0 1 4 4v3a6 6 0 0 1-12 0v-3a4 4 0 0 1 4-4z\"/><path d=\"M14.12 3.88 16 2\"/><path d=\"M21 21a4 4 0 0 0-3.81-4\"/><path d=\"M21 5a4 4 0 0 1-3.55 3.97\"/><path d=\"M22 13h-4\"/><path d=\"M3 21a4 4 0 0 1 3.81-4\"/><path d=\"M3 5a4 4 0 0 0 3.55 3.97\"/><path d=\"M6 13H2\"/><path d=\"m8 2 1.88 1.88\"/><path d=\"M9 7.13V6a3 3 0 1 1 6 0v1.13\"/></svg></div>\n<div class=\"mermaid-error-title\">\u56FE\u8868\u52A0\u8F7D\u5931\u8D25</div>\n<div class=\"mermaid-error-message\">".concat(e_1.message.replace(/\n/, "<br>"), "</div>\n</div>");
5791
5792
  errorElement.parentElement.remove();
5792
5793
  return [3 /*break*/, 4];
5793
5794
  case 4: