vditor 3.8.10 → 3.8.13
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.
- package/README.md +3 -2
- package/dist/index.css +2 -2
- package/dist/index.min.js +1 -15469
- package/dist/js/highlight.js/solidity.min.js +73 -0
- package/dist/js/highlight.js/styles/abap.css +7 -7
- package/dist/js/highlight.js/styles/algol.css +7 -6
- package/dist/js/highlight.js/styles/algol_nu.css +7 -7
- package/dist/js/highlight.js/styles/arduino.css +7 -5
- package/dist/js/highlight.js/styles/autumn.css +7 -5
- package/dist/js/highlight.js/styles/borland.css +7 -6
- package/dist/js/highlight.js/styles/bw.css +7 -6
- package/dist/js/highlight.js/styles/colorful.css +7 -5
- package/dist/js/highlight.js/styles/dracula.css +9 -8
- package/dist/js/highlight.js/styles/emacs.css +7 -6
- package/dist/js/highlight.js/styles/friendly.css +7 -6
- package/dist/js/highlight.js/styles/fruity.css +7 -5
- package/dist/js/highlight.js/styles/github.css +7 -6
- package/dist/js/highlight.js/styles/igor.css +7 -5
- package/dist/js/highlight.js/styles/lovelace.css +7 -6
- package/dist/js/highlight.js/styles/manni.css +7 -6
- package/dist/js/highlight.js/styles/monokai.css +7 -6
- package/dist/js/highlight.js/styles/monokailight.css +7 -6
- package/dist/js/highlight.js/styles/murphy.css +7 -7
- package/dist/js/highlight.js/styles/native.css +7 -6
- package/dist/js/highlight.js/styles/paraiso-dark.css +7 -6
- package/dist/js/highlight.js/styles/paraiso-light.css +7 -6
- package/dist/js/highlight.js/styles/pastie.css +7 -7
- package/dist/js/highlight.js/styles/perldoc.css +7 -6
- package/dist/js/highlight.js/styles/pygments.css +7 -6
- package/dist/js/highlight.js/styles/rainbow_dash.css +7 -6
- package/dist/js/highlight.js/styles/rrt.css +7 -6
- package/dist/js/highlight.js/styles/solarized-dark.css +7 -6
- package/dist/js/highlight.js/styles/solarized-dark256.css +7 -6
- package/dist/js/highlight.js/styles/solarized-light.css +7 -6
- package/dist/js/highlight.js/styles/swapoff.css +7 -7
- package/dist/js/highlight.js/styles/tango.css +7 -7
- package/dist/js/highlight.js/styles/trac.css +7 -6
- package/dist/js/highlight.js/styles/vim.css +7 -6
- package/dist/js/highlight.js/styles/vs.css +7 -6
- package/dist/js/highlight.js/styles/xcode.css +7 -6
- package/dist/js/highlight.js/yul.min.js +30 -0
- package/dist/js/katex/mhchem.min.js +1 -0
- package/dist/js/lute/lute.min.js +47 -46
- package/dist/method.min.js +1 -2370
- package/dist/ts/toolbar/Emoji.d.ts +1 -1
- package/dist/types/index.d.ts +2 -0
- package/package.json +17 -11
- package/src/ts/constants.ts +59 -56
- package/src/ts/ir/index.ts +5 -0
- package/src/ts/markdown/highlightRender.ts +65 -61
- package/src/ts/markdown/mathRender.ts +29 -27
- package/src/ts/sv/index.ts +6 -0
- package/src/ts/toolbar/Emoji.ts +19 -20
- package/src/ts/ui/initUI.ts +4 -0
- package/src/ts/undo/index.ts +3 -0
- package/src/ts/upload/index.ts +1 -1
- package/src/ts/util/Options.ts +5 -0
- package/src/ts/util/fixBrowserBehavior.ts +1248 -1245
- package/src/ts/wysiwyg/highlightToolbarWYSIWYG.ts +12 -18
- package/src/ts/wysiwyg/index.ts +2 -0
|
@@ -588,14 +588,18 @@ export const highlightToolbarWYSIWYG = (vditor: IVditor) => {
|
|
|
588
588
|
setPopoverPosition(vditor, footnotesRefElement);
|
|
589
589
|
}
|
|
590
590
|
|
|
591
|
-
let blockRenderElement = hasClosestByClassName(typeElement, "vditor-wysiwyg__block") as HTMLElement;
|
|
592
591
|
// block popover: math-inline, math-block, html-block, html-inline, code-block, html-entity
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
592
|
+
let blockRenderElement = hasClosestByClassName(typeElement, "vditor-wysiwyg__block") as HTMLElement;
|
|
593
|
+
const isBlock = blockRenderElement ? blockRenderElement.getAttribute("data-type").indexOf("block") > -1 : false;
|
|
594
|
+
vditor.wysiwyg.element
|
|
595
|
+
.querySelectorAll(".vditor-wysiwyg__preview")
|
|
596
|
+
.forEach((itemElement) => {
|
|
597
|
+
if (!blockRenderElement || (blockRenderElement && isBlock && !blockRenderElement.contains(itemElement))) {
|
|
598
|
+
const previousElement = itemElement.previousElementSibling as HTMLElement;
|
|
599
|
+
previousElement.style.display = "none";
|
|
600
|
+
}
|
|
601
|
+
});
|
|
602
|
+
if (blockRenderElement && isBlock) {
|
|
599
603
|
vditor.wysiwyg.popover.innerHTML = "";
|
|
600
604
|
genUp(range, blockRenderElement, vditor);
|
|
601
605
|
genDown(range, blockRenderElement, vditor);
|
|
@@ -694,17 +698,8 @@ export const highlightToolbarWYSIWYG = (vditor: IVditor) => {
|
|
|
694
698
|
}
|
|
695
699
|
setPopoverPosition(vditor, blockRenderElement);
|
|
696
700
|
} else {
|
|
697
|
-
if (!blockRenderElement) {
|
|
698
|
-
vditor.wysiwyg.element
|
|
699
|
-
.querySelectorAll(".vditor-wysiwyg__preview")
|
|
700
|
-
.forEach((itemElement) => {
|
|
701
|
-
const previousElement = itemElement.previousElementSibling as HTMLElement;
|
|
702
|
-
previousElement.style.display = "none";
|
|
703
|
-
});
|
|
704
|
-
}
|
|
705
701
|
blockRenderElement = undefined;
|
|
706
702
|
}
|
|
707
|
-
|
|
708
703
|
if (headingElement) {
|
|
709
704
|
vditor.wysiwyg.popover.innerHTML = "";
|
|
710
705
|
|
|
@@ -972,8 +967,6 @@ const linkHotkey = (
|
|
|
972
967
|
};
|
|
973
968
|
|
|
974
969
|
export const genAPopover = (vditor: IVditor, aElement: HTMLElement) => {
|
|
975
|
-
const lang: keyof II18n | "" = vditor.options.lang;
|
|
976
|
-
const options: IOptions = vditor.options;
|
|
977
970
|
vditor.wysiwyg.popover.innerHTML = "";
|
|
978
971
|
|
|
979
972
|
const updateA = () => {
|
|
@@ -982,6 +975,7 @@ export const genAPopover = (vditor: IVditor, aElement: HTMLElement) => {
|
|
|
982
975
|
}
|
|
983
976
|
aElement.setAttribute("href", input1.value);
|
|
984
977
|
aElement.setAttribute("title", input2.value);
|
|
978
|
+
afterRenderEvent(vditor);
|
|
985
979
|
};
|
|
986
980
|
|
|
987
981
|
aElement.querySelectorAll("[data-marker]").forEach((item: HTMLElement) => {
|
package/src/ts/wysiwyg/index.ts
CHANGED
|
@@ -335,9 +335,11 @@ class WYSIWYG {
|
|
|
335
335
|
}
|
|
336
336
|
if (this.preventInput) {
|
|
337
337
|
this.preventInput = false;
|
|
338
|
+
afterRenderEvent(vditor);
|
|
338
339
|
return;
|
|
339
340
|
}
|
|
340
341
|
if (this.composingLock || event.data === "‘" || event.data === "“" || event.data === "《") {
|
|
342
|
+
afterRenderEvent(vditor);
|
|
341
343
|
return;
|
|
342
344
|
}
|
|
343
345
|
const range = getSelection().getRangeAt(0);
|