vue-devui 1.5.6 → 1.5.7-hotfix.2
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/action-timeline/style.css +1 -1
- package/alert/index.es.js +13 -3
- package/alert/index.umd.js +11 -1
- package/alert/style.css +1 -1
- package/auto-complete/style.css +1 -1
- package/badge/style.css +1 -1
- package/breadcrumb/style.css +1 -1
- package/button/style.css +1 -1
- package/card/style.css +1 -1
- package/carousel/style.css +1 -1
- package/checkbox/style.css +1 -1
- package/code-editor/index.es.js +39 -23
- package/code-editor/index.umd.js +7 -7
- package/code-review/index.es.js +6229 -23
- package/code-review/index.umd.js +38 -1
- package/code-review/style.css +1 -1
- package/collapse/style.css +1 -1
- package/date-picker-pro/style.css +1 -1
- package/drawer/style.css +1 -1
- package/dropdown/style.css +1 -1
- package/editable-select/style.css +1 -1
- package/editor-md/index.es.js +2 -1
- package/editor-md/index.umd.js +30 -30
- package/editor-md/style.css +1 -1
- package/form/style.css +1 -1
- package/global.d.ts +2 -1
- package/icon/style.css +1 -1
- package/image-preview/style.css +1 -1
- package/input/style.css +1 -1
- package/input-number/index.es.js +1 -0
- package/input-number/index.umd.js +14 -14
- package/input-number/style.css +1 -1
- package/mention/style.css +1 -1
- package/menu/index.es.js +1 -0
- package/menu/index.umd.js +1 -1
- package/menu/style.css +1 -1
- package/message/style.css +1 -1
- package/modal/style.css +1 -1
- package/notification/style.css +1 -1
- package/nuxt/components/CodeReviewInjectionKey.js +3 -0
- package/overlay/style.css +1 -1
- package/package.json +10 -9
- package/pagination/index.es.js +7 -1
- package/pagination/index.umd.js +7 -1
- package/pagination/style.css +1 -1
- package/panel/style.css +1 -1
- package/popover/style.css +1 -1
- package/progress/index.es.js +1 -0
- package/progress/index.umd.js +2 -2
- package/radio/style.css +1 -1
- package/result/style.css +1 -1
- package/search/style.css +1 -1
- package/select/index.es.js +7 -1
- package/select/index.umd.js +7 -1
- package/select/style.css +1 -1
- package/slider/index.es.js +1 -0
- package/slider/index.umd.js +1 -1
- package/slider/style.css +1 -1
- package/splitter/index.es.js +1 -0
- package/splitter/index.umd.js +9 -9
- package/splitter/style.css +1 -1
- package/status/style.css +1 -1
- package/steps/style.css +1 -1
- package/style.css +1 -1
- package/switch/style.css +1 -1
- package/table/index.es.js +1 -0
- package/table/index.umd.js +12 -12
- package/table/style.css +1 -1
- package/tabs/style.css +1 -1
- package/tag/style.css +1 -1
- package/textarea/style.css +1 -1
- package/time-picker/style.css +1 -1
- package/time-select/index.es.js +7 -1
- package/time-select/index.umd.js +7 -1
- package/time-select/style.css +1 -1
- package/timeline/style.css +1 -1
- package/tooltip/style.css +1 -1
- package/tree/index.es.js +1 -0
- package/tree/index.umd.js +11 -11
- package/tree/style.css +1 -1
- package/types/code-editor/src/code-highlight-directive.d.ts +5 -0
- package/types/code-editor/src/composables/use-code-editor.d.ts +2 -2
- package/types/code-review/src/code-review-types.d.ts +12 -1
- package/types/code-review/src/code-review.d.ts +10 -2
- package/types/code-review/src/components/code-review-header.d.ts +2 -0
- package/types/code-review/src/components/code-review-icons.d.ts +2 -0
- package/types/code-review/src/composables/use-code-review-header.d.ts +6 -0
- package/types/code-review/src/composables/use-code-review.d.ts +3 -1
- package/types/shared/utils/index.d.ts +1 -0
- package/types/shared/utils/to-clipboard.d.ts +1 -0
- package/upload/style.css +1 -1
- package/vue-devui.es.js +225 -40
- package/vue-devui.umd.js +63 -50
package/code-editor/index.es.js
CHANGED
|
@@ -5498,7 +5498,7 @@ function useCodeEditor(props, ctx) {
|
|
|
5498
5498
|
addCommentIcon,
|
|
5499
5499
|
expandCommentIcon
|
|
5500
5500
|
} = toRefs(props);
|
|
5501
|
-
let
|
|
5501
|
+
let monaco2;
|
|
5502
5502
|
let editor;
|
|
5503
5503
|
let diffEditor;
|
|
5504
5504
|
let themeService;
|
|
@@ -5537,14 +5537,14 @@ function useCodeEditor(props, ctx) {
|
|
|
5537
5537
|
});
|
|
5538
5538
|
onMounted(async () => {
|
|
5539
5539
|
if (inBrowser) {
|
|
5540
|
-
|
|
5540
|
+
monaco2 = await import("monaco-editor");
|
|
5541
5541
|
setCurrentTheme();
|
|
5542
5542
|
init();
|
|
5543
5543
|
if (mode.value === "review") {
|
|
5544
5544
|
nextTick(() => {
|
|
5545
5545
|
refreshDecorations();
|
|
5546
|
-
refreshOverlayWidgets();
|
|
5547
5546
|
refreshViewZones();
|
|
5547
|
+
refreshOverlayWidgets();
|
|
5548
5548
|
});
|
|
5549
5549
|
}
|
|
5550
5550
|
}
|
|
@@ -5556,15 +5556,15 @@ function useCodeEditor(props, ctx) {
|
|
|
5556
5556
|
initDiffEditor();
|
|
5557
5557
|
}
|
|
5558
5558
|
if (!options.value["theme"]) {
|
|
5559
|
-
|
|
5559
|
+
monaco2.editor.setTheme(currentTheme);
|
|
5560
5560
|
}
|
|
5561
5561
|
handleAutoHeight();
|
|
5562
5562
|
setValueEmitter();
|
|
5563
5563
|
}
|
|
5564
5564
|
function initNormalEditor() {
|
|
5565
5565
|
if (!editor) {
|
|
5566
|
-
editor =
|
|
5567
|
-
editor.setModel(
|
|
5566
|
+
editor = monaco2.editor.create(editorEl.value, options.value);
|
|
5567
|
+
editor.setModel(monaco2.editor.createModel(modelValue.value, options.value["language"]));
|
|
5568
5568
|
ctx.emit("afterEditorInit", editor);
|
|
5569
5569
|
if (mode.value === "review") {
|
|
5570
5570
|
editor.onMouseMove(handleMouseMove);
|
|
@@ -5575,10 +5575,10 @@ function useCodeEditor(props, ctx) {
|
|
|
5575
5575
|
}
|
|
5576
5576
|
function initDiffEditor() {
|
|
5577
5577
|
if (!diffEditor) {
|
|
5578
|
-
diffEditor =
|
|
5578
|
+
diffEditor = monaco2.editor.createDiffEditor(editorEl.value, options.value);
|
|
5579
5579
|
diffEditor.setModel({
|
|
5580
|
-
original:
|
|
5581
|
-
modified:
|
|
5580
|
+
original: monaco2.editor.createModel(originalText.value, options.value["language"]),
|
|
5581
|
+
modified: monaco2.editor.createModel(modelValue.value, options.value["language"])
|
|
5582
5582
|
});
|
|
5583
5583
|
ctx.emit("afterEditorInit", diffEditor);
|
|
5584
5584
|
}
|
|
@@ -5591,11 +5591,10 @@ function useCodeEditor(props, ctx) {
|
|
|
5591
5591
|
}
|
|
5592
5592
|
}
|
|
5593
5593
|
function setEditorValue() {
|
|
5594
|
-
var _a;
|
|
5595
5594
|
if (!editor || !editor.getModel()) {
|
|
5596
5595
|
return;
|
|
5597
5596
|
}
|
|
5598
|
-
|
|
5597
|
+
editor.getModel().setValue(modelValue.value);
|
|
5599
5598
|
}
|
|
5600
5599
|
function setDiffEditorValue() {
|
|
5601
5600
|
var _a;
|
|
@@ -5614,7 +5613,7 @@ function useCodeEditor(props, ctx) {
|
|
|
5614
5613
|
currentTheme = themeService && themeService.currentTheme.isDark ? "vs" : "vs-dark";
|
|
5615
5614
|
}
|
|
5616
5615
|
if (editor) {
|
|
5617
|
-
|
|
5616
|
+
monaco2.editor.setTheme(currentTheme);
|
|
5618
5617
|
}
|
|
5619
5618
|
}
|
|
5620
5619
|
function handleAutoHeight() {
|
|
@@ -5647,9 +5646,11 @@ function useCodeEditor(props, ctx) {
|
|
|
5647
5646
|
const language = options.value.language;
|
|
5648
5647
|
if (editor) {
|
|
5649
5648
|
if (mode.value === "normal" || mode.value === "review") {
|
|
5649
|
+
monaco2.editor.setModelLanguage(editor.getModel(), language);
|
|
5650
|
+
} else if (mode.value === "diff") {
|
|
5650
5651
|
const model = diffEditor.getModel();
|
|
5651
|
-
|
|
5652
|
-
|
|
5652
|
+
monaco2.editor.setModelLanguage(model.modified, language);
|
|
5653
|
+
monaco2.editor.setModelLanguage(model.original, language);
|
|
5653
5654
|
}
|
|
5654
5655
|
}
|
|
5655
5656
|
}
|
|
@@ -5663,7 +5664,7 @@ function useCodeEditor(props, ctx) {
|
|
|
5663
5664
|
}
|
|
5664
5665
|
function updateEditorHeightAuto() {
|
|
5665
5666
|
var _a;
|
|
5666
|
-
const lineHeight = editor.getOption(
|
|
5667
|
+
const lineHeight = editor.getOption(monaco2.editor.EditorOption.lineHeight);
|
|
5667
5668
|
const lineCount = ((_a = editor.getModel()) == null ? void 0 : _a.getLineCount()) || 1;
|
|
5668
5669
|
const height = editor.getTopForLineNumber(lineCount + 1) + lineHeight;
|
|
5669
5670
|
if (editorEl.value) {
|
|
@@ -5677,8 +5678,8 @@ function useCodeEditor(props, ctx) {
|
|
|
5677
5678
|
if (!isDecorationExisted(currentLineNumber)) {
|
|
5678
5679
|
const lineDecoration = [
|
|
5679
5680
|
{
|
|
5680
|
-
range: new
|
|
5681
|
-
|
|
5681
|
+
range: new monaco2.Range(currentLineNumber, 0, currentLineNumber, 0),
|
|
5682
|
+
options: {
|
|
5682
5683
|
isWholeLine: true,
|
|
5683
5684
|
glyphMarginClassName: `icon-pointer ${addCommentIcon.value}`
|
|
5684
5685
|
}
|
|
@@ -5704,12 +5705,12 @@ function useCodeEditor(props, ctx) {
|
|
|
5704
5705
|
setTimeout(() => {
|
|
5705
5706
|
currentDecorations = editor.deltaDecorations(currentDecorations, tempDecorations);
|
|
5706
5707
|
});
|
|
5707
|
-
|
|
5708
|
+
currentLineDecoration = editor.deltaDecorations(currentLineDecoration, []);
|
|
5708
5709
|
}
|
|
5709
5710
|
}
|
|
5710
5711
|
function setDecorations(decoration) {
|
|
5711
5712
|
return {
|
|
5712
|
-
range: new
|
|
5713
|
+
range: new monaco2.Range(decoration.lineNumber, 1, decoration.lineNumber, 1),
|
|
5713
5714
|
options: {
|
|
5714
5715
|
isWholeLine: true,
|
|
5715
5716
|
className: decoration.customClasses || "",
|
|
@@ -5749,7 +5750,7 @@ function useCodeEditor(props, ctx) {
|
|
|
5749
5750
|
heightInPx: comment.heightInPx ? comment.heightInPx : 0,
|
|
5750
5751
|
afterColumn: 1,
|
|
5751
5752
|
domNode: document.createElement("div"),
|
|
5752
|
-
|
|
5753
|
+
onDomNodeTop: (top) => {
|
|
5753
5754
|
layoutOverlayWidget(comment.lineNumber, { top });
|
|
5754
5755
|
},
|
|
5755
5756
|
onComputedHeight: (height) => {
|
|
@@ -5772,7 +5773,7 @@ function useCodeEditor(props, ctx) {
|
|
|
5772
5773
|
}
|
|
5773
5774
|
function calculateLayoutInfo(positionInfos, editorLayoutInfo, index2) {
|
|
5774
5775
|
let _offsetLeft = 0;
|
|
5775
|
-
const indexOffsetLeft = comments.value[index2].
|
|
5776
|
+
const indexOffsetLeft = comments.value[index2].offsetLeft;
|
|
5776
5777
|
if (indexOffsetLeft) {
|
|
5777
5778
|
_offsetLeft = indexOffsetLeft;
|
|
5778
5779
|
} else {
|
|
@@ -5785,8 +5786,8 @@ function useCodeEditor(props, ctx) {
|
|
|
5785
5786
|
offsetLeft: _offsetLeft
|
|
5786
5787
|
};
|
|
5787
5788
|
}
|
|
5788
|
-
function handleDomNodePosition(top,
|
|
5789
|
-
comments.value[index2].domNode.style.height = `${
|
|
5789
|
+
function handleDomNodePosition(top, height, index2) {
|
|
5790
|
+
comments.value[index2].domNode.style.height = `${height}px`;
|
|
5790
5791
|
if (heightMap.get(index2) === 0) {
|
|
5791
5792
|
comments.value[index2].domNode.style.top = `-${1e4 + top}px`;
|
|
5792
5793
|
} else {
|
|
@@ -5863,11 +5864,26 @@ var CodeEditor = defineComponent({
|
|
|
5863
5864
|
}, null);
|
|
5864
5865
|
}
|
|
5865
5866
|
});
|
|
5867
|
+
let monaco;
|
|
5868
|
+
const CodeHighlightDirective = {
|
|
5869
|
+
async mounted(el) {
|
|
5870
|
+
if (inBrowser) {
|
|
5871
|
+
monaco = await import("monaco-editor");
|
|
5872
|
+
monaco.editor.colorizeElement(el);
|
|
5873
|
+
}
|
|
5874
|
+
},
|
|
5875
|
+
updated(el) {
|
|
5876
|
+
if (inBrowser) {
|
|
5877
|
+
monaco.editor.colorizeElement(el);
|
|
5878
|
+
}
|
|
5879
|
+
}
|
|
5880
|
+
};
|
|
5866
5881
|
var index = {
|
|
5867
5882
|
title: "Code Editor \u4EE3\u7801\u7F16\u8F91\u5668",
|
|
5868
5883
|
category: "\u6F14\u8FDB\u4E2D",
|
|
5869
5884
|
status: "100%",
|
|
5870
5885
|
install(app) {
|
|
5886
|
+
app.directive("d-code-highlight", CodeHighlightDirective);
|
|
5871
5887
|
app.component(CodeEditor.name, CodeEditor);
|
|
5872
5888
|
}
|
|
5873
5889
|
};
|