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.
Files changed (75) hide show
  1. package/.prettierrc.json +22 -0
  2. package/docs/.vitepress/config.mts +55 -0
  3. package/docs/.vitepress/theme/index.ts +30 -0
  4. package/docs/.vitepress/theme/style.css +130 -0
  5. package/docs/api-examples.md +49 -0
  6. package/docs/auto-imports.d.ts +10 -0
  7. package/docs/components/icon.md +75 -0
  8. package/docs/components.d.ts +13 -0
  9. package/docs/guide/installation.md +1 -0
  10. package/docs/guide/quick-start.md +1 -0
  11. package/docs/index.md +24 -0
  12. package/docs/markdown-examples.md +85 -0
  13. package/docs/package.json +30 -0
  14. package/docs/vite.config.ts +20 -0
  15. package/eslint.config.mjs +90 -0
  16. package/package.json +78 -0
  17. package/packages/components/button/index.ts +13 -0
  18. package/packages/components/button/src/button.ts +20 -0
  19. package/packages/components/button/src/button.vue +39 -0
  20. package/packages/components/button/src/index.scss +3 -0
  21. package/packages/components/icon/index.ts +14 -0
  22. package/packages/components/icon/src/icon.ts +16 -0
  23. package/packages/components/icon/src/icon.vue +35 -0
  24. package/packages/components/icon2/index.ts +14 -0
  25. package/packages/components/icon2/src/icon2.ts +16 -0
  26. package/packages/components/icon2/src/icon2.vue +35 -0
  27. package/packages/components/index.ts +5 -0
  28. package/packages/components/input/index.ts +13 -0
  29. package/packages/components/input/src/index.scss +3 -0
  30. package/packages/components/input/src/input.ts +22 -0
  31. package/packages/components/input/src/input.vue +50 -0
  32. package/packages/components/monaco/index.ts +8 -0
  33. package/packages/components/monaco/src/custom.ts +124 -0
  34. package/packages/components/monaco/src/index.scss +235 -0
  35. package/packages/components/monaco/src/monaco.ts +46 -0
  36. package/packages/components/monaco/src/monaco.vue +472 -0
  37. package/packages/components/package.json +29 -0
  38. package/packages/components/tsconfig.json +34 -0
  39. package/packages/components/tsconfig.tsbuildinfo +1 -0
  40. package/packages/script/build/build.ts +90 -0
  41. package/packages/script/build/buildfull.ts +77 -0
  42. package/packages/script/build/external.ts +21 -0
  43. package/packages/script/build/index.ts +22 -0
  44. package/packages/script/utils/delPath.ts +30 -0
  45. package/packages/script/utils/paths.ts +7 -0
  46. package/packages/theme/gulpfile.js +41 -0
  47. package/packages/theme/package.json +16 -0
  48. package/packages/theme/src/icon.scss +8 -0
  49. package/packages/theme/src/icon2.scss +8 -0
  50. package/packages/theme/src/index.scss +2 -0
  51. package/packages/theme/src/mixins/config.scss +4 -0
  52. package/packages/theme/src/mixins/mixins.scss +80 -0
  53. package/packages/utils/bem.ts +60 -0
  54. package/packages/utils/index.ts +2 -0
  55. package/packages/utils/package.json +16 -0
  56. package/packages/utils/vite.config.ts +61 -0
  57. package/packages/utils/with-install.ts +12 -0
  58. package/play/.vscode/extensions.json +3 -0
  59. package/play/README.md +5 -0
  60. package/play/auto-imports.d.ts +10 -0
  61. package/play/components.d.ts +14 -0
  62. package/play/index.html +13 -0
  63. package/play/package.json +30 -0
  64. package/play/public/vite.svg +1 -0
  65. package/play/src/App.vue +32 -0
  66. package/play/src/assets/vue.svg +1 -0
  67. package/play/src/components/MyInput.vue +25 -0
  68. package/play/src/main.ts +12 -0
  69. package/play/src/vite-env.d.ts +7 -0
  70. package/play/tsconfig.app.json +14 -0
  71. package/play/tsconfig.json +7 -0
  72. package/play/tsconfig.node.json +24 -0
  73. package/play/vite.config.ts +20 -0
  74. package/pnpm-workspace.yaml +5 -0
  75. 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
+ }