dnhyxc-ui-vue 1.0.0
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/.prettierrc.json +22 -0
- package/docs/.vitepress/config.mts +55 -0
- package/docs/.vitepress/theme/index.ts +30 -0
- package/docs/.vitepress/theme/style.css +130 -0
- package/docs/api-examples.md +49 -0
- package/docs/auto-imports.d.ts +10 -0
- package/docs/components/icon.md +75 -0
- package/docs/components.d.ts +13 -0
- package/docs/guide/installation.md +1 -0
- package/docs/guide/quick-start.md +1 -0
- package/docs/index.md +24 -0
- package/docs/markdown-examples.md +85 -0
- package/docs/package.json +30 -0
- package/docs/vite.config.ts +20 -0
- package/eslint.config.mjs +90 -0
- package/package.json +78 -0
- package/packages/components/button/index.ts +13 -0
- package/packages/components/button/src/button.ts +20 -0
- package/packages/components/button/src/button.vue +39 -0
- package/packages/components/button/src/index.scss +3 -0
- package/packages/components/icon/index.ts +14 -0
- package/packages/components/icon/src/icon.ts +16 -0
- package/packages/components/icon/src/icon.vue +35 -0
- package/packages/components/icon2/index.ts +14 -0
- package/packages/components/icon2/src/icon2.ts +16 -0
- package/packages/components/icon2/src/icon2.vue +35 -0
- package/packages/components/index.ts +5 -0
- package/packages/components/input/index.ts +13 -0
- package/packages/components/input/src/index.scss +3 -0
- package/packages/components/input/src/input.ts +22 -0
- package/packages/components/input/src/input.vue +50 -0
- package/packages/components/monaco/index.ts +8 -0
- package/packages/components/monaco/src/custom.ts +124 -0
- package/packages/components/monaco/src/index.scss +235 -0
- package/packages/components/monaco/src/monaco.ts +46 -0
- package/packages/components/monaco/src/monaco.vue +472 -0
- package/packages/components/package.json +29 -0
- package/packages/components/tsconfig.json +34 -0
- package/packages/components/tsconfig.tsbuildinfo +1 -0
- package/packages/script/build/build.ts +90 -0
- package/packages/script/build/buildfull.ts +77 -0
- package/packages/script/build/external.ts +21 -0
- package/packages/script/build/index.ts +22 -0
- package/packages/script/utils/delPath.ts +30 -0
- package/packages/script/utils/paths.ts +7 -0
- package/packages/theme/gulpfile.js +41 -0
- package/packages/theme/package.json +16 -0
- package/packages/theme/src/icon.scss +8 -0
- package/packages/theme/src/icon2.scss +8 -0
- package/packages/theme/src/index.scss +2 -0
- package/packages/theme/src/mixins/config.scss +4 -0
- package/packages/theme/src/mixins/mixins.scss +80 -0
- package/packages/utils/bem.ts +60 -0
- package/packages/utils/index.ts +2 -0
- package/packages/utils/package.json +16 -0
- package/packages/utils/vite.config.ts +61 -0
- package/packages/utils/with-install.ts +12 -0
- package/play/.vscode/extensions.json +3 -0
- package/play/README.md +5 -0
- package/play/auto-imports.d.ts +10 -0
- package/play/components.d.ts +14 -0
- package/play/index.html +13 -0
- package/play/package.json +30 -0
- package/play/public/vite.svg +1 -0
- package/play/src/App.vue +32 -0
- package/play/src/assets/vue.svg +1 -0
- package/play/src/components/MyInput.vue +25 -0
- package/play/src/main.ts +12 -0
- package/play/src/vite-env.d.ts +7 -0
- package/play/tsconfig.app.json +14 -0
- package/play/tsconfig.json +7 -0
- package/play/tsconfig.node.json +24 -0
- package/play/vite.config.ts +20 -0
- package/pnpm-workspace.yaml +5 -0
- package/tsconfig.json +35 -0
@@ -0,0 +1,235 @@
|
|
1
|
+
.n-monaco {
|
2
|
+
position: relative;
|
3
|
+
height: 100%;
|
4
|
+
border-radius: 5px;
|
5
|
+
box-sizing: border-box;
|
6
|
+
box-shadow: 0 0 5px 0 #ccc;
|
7
|
+
// box-shadow: 0 0 5px 0 var(--card-shadow);
|
8
|
+
overflow: hidden;
|
9
|
+
|
10
|
+
.toolbar {
|
11
|
+
display: flex;
|
12
|
+
align-items: center;
|
13
|
+
justify-content: space-between;
|
14
|
+
height: 40px;
|
15
|
+
padding: 0 10px;
|
16
|
+
box-sizing: border-box;
|
17
|
+
background-color: #fff;
|
18
|
+
border-bottom: 1px solid #ccc;
|
19
|
+
// border-bottom: 1px solid var(--chat-border-color);
|
20
|
+
border-top-left-radius: 5px;
|
21
|
+
border-top-right-radius: 5px;
|
22
|
+
|
23
|
+
.create-action {
|
24
|
+
height: 40px;
|
25
|
+
line-height: 40px;
|
26
|
+
// .ellipsisMore(1);
|
27
|
+
}
|
28
|
+
|
29
|
+
.prev-action {
|
30
|
+
display: flex;
|
31
|
+
justify-content: space-between;
|
32
|
+
}
|
33
|
+
|
34
|
+
.menu-list {
|
35
|
+
display: flex;
|
36
|
+
align-items: center;
|
37
|
+
}
|
38
|
+
|
39
|
+
.left {
|
40
|
+
flex: 1;
|
41
|
+
display: flex;
|
42
|
+
justify-content: space-between;
|
43
|
+
align-items: center;
|
44
|
+
margin-right: 10px;
|
45
|
+
// .ellipsis;
|
46
|
+
|
47
|
+
.code-action {
|
48
|
+
display: flex;
|
49
|
+
justify-content: flex-start;
|
50
|
+
align-items: center;
|
51
|
+
margin-bottom: 1px;
|
52
|
+
}
|
53
|
+
|
54
|
+
.action {
|
55
|
+
display: inline-block;
|
56
|
+
color: skyblue;
|
57
|
+
// color: var(--el-color-primary);
|
58
|
+
font-size: 14px;
|
59
|
+
height: 20px;
|
60
|
+
line-height: 20px;
|
61
|
+
cursor: pointer;
|
62
|
+
margin-right: 14px;
|
63
|
+
text-shadow: #ccc;
|
64
|
+
// text-shadow: var(--text-shadow);
|
65
|
+
outline: none;
|
66
|
+
|
67
|
+
&:hover {
|
68
|
+
color: skyblue;
|
69
|
+
// color: var(--el-color-primary-light-3);
|
70
|
+
outline: none;
|
71
|
+
}
|
72
|
+
|
73
|
+
.diff {
|
74
|
+
margin-left: 14px;
|
75
|
+
}
|
76
|
+
}
|
77
|
+
|
78
|
+
.un-save {
|
79
|
+
font-size: 12px;
|
80
|
+
color: orange;
|
81
|
+
// color: @font-danger;
|
82
|
+
|
83
|
+
&:hover {
|
84
|
+
color: orange;
|
85
|
+
// color: @font-danger;
|
86
|
+
}
|
87
|
+
|
88
|
+
cursor: default;
|
89
|
+
}
|
90
|
+
|
91
|
+
.save-draft {
|
92
|
+
position: relative;
|
93
|
+
|
94
|
+
&::before {
|
95
|
+
position: absolute;
|
96
|
+
right: -6px;
|
97
|
+
top: -2px;
|
98
|
+
content: '';
|
99
|
+
width: 8px;
|
100
|
+
height: 8px;
|
101
|
+
background: orange;
|
102
|
+
// background: @font-danger;
|
103
|
+
border-radius: 8px;
|
104
|
+
// opacity: v-bind(showDot);
|
105
|
+
}
|
106
|
+
|
107
|
+
.is-loading {
|
108
|
+
position: absolute;
|
109
|
+
top: -5px;
|
110
|
+
right: -9px;
|
111
|
+
|
112
|
+
.loading-icon {
|
113
|
+
font-size: 12px;
|
114
|
+
}
|
115
|
+
}
|
116
|
+
}
|
117
|
+
|
118
|
+
.run-code {
|
119
|
+
margin-right: 14px;
|
120
|
+
}
|
121
|
+
|
122
|
+
.clear-code {
|
123
|
+
margin-left: 0;
|
124
|
+
margin-right: 14px;
|
125
|
+
}
|
126
|
+
|
127
|
+
.icon-yuyan {
|
128
|
+
font-size: 16px;
|
129
|
+
}
|
130
|
+
|
131
|
+
.icon-sketchpad-theme {
|
132
|
+
font-size: 15px;
|
133
|
+
}
|
134
|
+
|
135
|
+
.icon-tishi {
|
136
|
+
font-size: 16px;
|
137
|
+
margin-top: -2px;
|
138
|
+
}
|
139
|
+
|
140
|
+
.icon-bianjiqi {
|
141
|
+
font-size: 17px;
|
142
|
+
}
|
143
|
+
|
144
|
+
.clear {
|
145
|
+
font-size: 14px;
|
146
|
+
color: orange;
|
147
|
+
// color: @font-danger;
|
148
|
+
margin-right: 14px;
|
149
|
+
padding: 0;
|
150
|
+
margin-top: -2px;
|
151
|
+
height: 20px;
|
152
|
+
line-height: 20px;
|
153
|
+
text-shadow: #ccc;
|
154
|
+
// text-shadow: var(--text-shadow);
|
155
|
+
}
|
156
|
+
}
|
157
|
+
|
158
|
+
.right {
|
159
|
+
display: flex;
|
160
|
+
justify-content: flex-end;
|
161
|
+
min-width: 132px;
|
162
|
+
font-size: 14px;
|
163
|
+
color: #ccc;
|
164
|
+
// color: @font-4;
|
165
|
+
|
166
|
+
.language-text {
|
167
|
+
height: 40px;
|
168
|
+
line-height: 38px;
|
169
|
+
// .ellipsisMore(1);
|
170
|
+
}
|
171
|
+
|
172
|
+
.result-text {
|
173
|
+
margin-right: 2px;
|
174
|
+
}
|
175
|
+
}
|
176
|
+
}
|
177
|
+
|
178
|
+
.monaco-editor-wrap {
|
179
|
+
// height: calc(100% - 40px);
|
180
|
+
height: 500px;
|
181
|
+
// padding: 10px 3px 0;
|
182
|
+
padding: 1px;
|
183
|
+
border-bottom-left-radius: 5px;
|
184
|
+
border-bottom-right-radius: 5px;
|
185
|
+
background-color: #fff;
|
186
|
+
// background-color: #fff;
|
187
|
+
box-sizing: border-box;
|
188
|
+
|
189
|
+
:deep {
|
190
|
+
.monaco-editor,
|
191
|
+
.overflow-guard {
|
192
|
+
border-bottom-left-radius: 5px;
|
193
|
+
border-bottom-right-radius: 5px;
|
194
|
+
}
|
195
|
+
}
|
196
|
+
}
|
197
|
+
|
198
|
+
// .dark-toolbar,
|
199
|
+
// .dark-monaco-editor-wrap {
|
200
|
+
// // background-color: v-bind(background);
|
201
|
+
// }
|
202
|
+
|
203
|
+
.model-content {
|
204
|
+
height: 72vh;
|
205
|
+
|
206
|
+
.shortcuts {
|
207
|
+
display: flex;
|
208
|
+
justify-content: center;
|
209
|
+
padding: 10px 0;
|
210
|
+
color: red;
|
211
|
+
// color: var(--font-1);
|
212
|
+
|
213
|
+
.key-name {
|
214
|
+
margin-right: 20px;
|
215
|
+
font-weight: 700;
|
216
|
+
}
|
217
|
+
|
218
|
+
.key-desc {
|
219
|
+
color: red;
|
220
|
+
// color: var(--font-3);
|
221
|
+
}
|
222
|
+
}
|
223
|
+
}
|
224
|
+
}
|
225
|
+
|
226
|
+
// :deep {
|
227
|
+
// .dropdown-text {
|
228
|
+
// color: var(--font-1);
|
229
|
+
|
230
|
+
// &:hover {
|
231
|
+
// color: var(--theme-blue);
|
232
|
+
// background-color: var(--pre-bg-color);
|
233
|
+
// }
|
234
|
+
// }
|
235
|
+
// }
|
@@ -0,0 +1,46 @@
|
|
1
|
+
import { type ExtractPropTypes, type PropType } from 'vue';
|
2
|
+
import * as monaco from 'monaco-editor/esm/vs/editor/editor.api.js';
|
3
|
+
import type Monaco from './monaco.vue';
|
4
|
+
export const monacoProps = {
|
5
|
+
editType: Boolean,
|
6
|
+
editorBgColor: String,
|
7
|
+
onChangeEditor: Function as PropType<(value?: string) => void>,
|
8
|
+
onPublish: Function as PropType<(value?: string) => void>,
|
9
|
+
onClear: Function as PropType<() => void>,
|
10
|
+
onShowDraft: Function as PropType<() => void>,
|
11
|
+
toPreview: Function as PropType<(id: string) => void>,
|
12
|
+
saveLoading: Boolean,
|
13
|
+
onSaveDraft: Function as PropType<(editor: monaco.editor.IStandaloneCodeEditor) => void>,
|
14
|
+
// onSaveDraft?: (editor: monaco.editor.IStandaloneCodeEditor) => void;
|
15
|
+
isCodeEdit: Boolean,
|
16
|
+
readonly: Boolean,
|
17
|
+
code: String, // 传入的code内容
|
18
|
+
theme: String,
|
19
|
+
getLanguage: Function as PropType<(language: string) => void>,
|
20
|
+
getCodeContent: Function as PropType<(code: string) => void>,
|
21
|
+
getMonacoEditor: Function as PropType<
|
22
|
+
(
|
23
|
+
editor: monaco.editor.IStandaloneCodeEditor,
|
24
|
+
onChangeLanguage: (language: string) => void,
|
25
|
+
setTheme: (theme: string) => void
|
26
|
+
) => void
|
27
|
+
>,
|
28
|
+
onEnter: Function as PropType<(code: string) => void>,
|
29
|
+
saveText: String,
|
30
|
+
language: String,
|
31
|
+
languages: Array as PropType<string[]>,
|
32
|
+
showDot: Number,
|
33
|
+
prevContent: String,
|
34
|
+
shortcutKeys: Array as PropType<{ name: string; desc: string }[]>,
|
35
|
+
shortcutPos: Number
|
36
|
+
} as const;
|
37
|
+
|
38
|
+
export type MonacoProps = ExtractPropTypes<typeof monacoProps>;
|
39
|
+
|
40
|
+
export type MonacoInstance = InstanceType<typeof Monaco> & unknown;
|
41
|
+
|
42
|
+
declare module 'vue' {
|
43
|
+
export interface GlobalComponents {
|
44
|
+
NMonaco: typeof Monaco;
|
45
|
+
}
|
46
|
+
}
|