Skip to content

Commit da2f8a1

Browse files
authored
release 1.5.5 (#1607)
1 parent a5bc46f commit da2f8a1

36 files changed

+3604
-59
lines changed

packages/devui-vue/devui-cli/commands/build.js

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,19 @@ const baseConfig = defineConfig({
2121
});
2222

2323
const rollupOptions = {
24-
external: ['vue', 'vue-router', '@vueuse/core', '@floating-ui/dom', 'monaco-editor'],
24+
external: [
25+
'vue',
26+
'vue-router',
27+
'@vueuse/core',
28+
'@floating-ui/dom',
29+
'monaco-editor',
30+
/codemirror/,
31+
'highlight.js',
32+
/markdown-it/,
33+
/mermaid/,
34+
'xss',
35+
'diff2html',
36+
],
2537
output: {
2638
globals: {
2739
vue: 'Vue',

packages/devui-vue/devui/carousel/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ export { Carousel, CarouselItem };
77
export default {
88
title: 'Carousel 走马灯',
99
category: '数据展示',
10-
status: '80%',
10+
status: '100%',
1111
install(app: App): void {
1212
app.component(Carousel.name, Carousel);
1313
app.component(CarouselItem.name, CarouselItem);
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
import type { App } from 'vue';
2+
import CodeReview from './src/code-review';
3+
export * from './src/code-review-types';
4+
5+
export { CodeReview };
6+
7+
export default {
8+
title: 'CodeReview 代码检视',
9+
category: '演进中',
10+
status: '100%',
11+
install(app: App): void {
12+
app.component(CodeReview.name, CodeReview);
13+
},
14+
};
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
import type { ExtractPropTypes, PropType } from 'vue';
2+
3+
export type OutputFormat = 'line-by-line' | 'side-by-side';
4+
5+
export const codeReviewProps = {
6+
diff: {
7+
type: String,
8+
required: true,
9+
default: '',
10+
},
11+
outputFormat: {
12+
type: String as PropType<OutputFormat>,
13+
default: 'line-by-line',
14+
},
15+
};
16+
export type CodeReviewProps = ExtractPropTypes<typeof codeReviewProps>;
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
@import '../../styles-var/devui-var.scss';
2+
3+
.#{$devui-prefix}-code-review {
4+
tr {
5+
border: none;
6+
}
7+
8+
th,
9+
td {
10+
border: none;
11+
padding: 0;
12+
}
13+
}
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
import { defineComponent } from 'vue';
2+
import { codeReviewProps } from './code-review-types';
3+
import type { CodeReviewProps } from './code-review-types';
4+
import { useNamespace } from '../../shared/hooks/use-namespace';
5+
import { useCodeReview } from './composables/use-code-review';
6+
import 'diff2html/bundles/css/diff2html.min.css';
7+
import './code-review.scss';
8+
9+
export default defineComponent({
10+
name: 'DCodeReview',
11+
props: codeReviewProps,
12+
setup(props: CodeReviewProps) {
13+
const ns = useNamespace('code-review');
14+
const { renderHtml } = useCodeReview(props);
15+
16+
return () => <div class={ns.b()} v-html={renderHtml.value}></div>;
17+
},
18+
});
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
import { toRefs, ref, onMounted } from 'vue';
2+
import * as Diff2Html from 'diff2html';
3+
import type { CodeReviewProps } from '../code-review-types';
4+
5+
export function useCodeReview(props: CodeReviewProps) {
6+
const { diff, outputFormat } = toRefs(props);
7+
const renderHtml = ref('');
8+
9+
onMounted(() => {
10+
renderHtml.value = Diff2Html.html(diff.value, {
11+
drawFileList: true,
12+
matching: 'lines',
13+
outputFormat: outputFormat.value,
14+
});
15+
});
16+
17+
return { renderHtml };
18+
}
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
import type { App } from 'vue';
2+
import EditorMd from './src/editor-md';
3+
import MdRender from './src/components/md-render';
4+
export * from './src/editor-md-types';
5+
6+
export { EditorMd, MdRender };
7+
8+
export default {
9+
title: 'Markdown MD编辑器',
10+
category: '演进中',
11+
status: '100%',
12+
install(app: App): void {
13+
app.component(EditorMd.name, EditorMd);
14+
app.component(MdRender.name, MdRender);
15+
}
16+
};

0 commit comments

Comments
 (0)