@knime/kds-code-editor 2.6.3
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/LICENSE +710 -0
- package/README.md +133 -0
- package/dist/assets/editor.worker-CLAZlRUj.js.map +1 -0
- package/dist/assets/json.worker-CWsWF5cb.js.map +1 -0
- package/dist/editor.worker-CtYtPH8e.js +21 -0
- package/dist/editor.worker-CtYtPH8e.js.map +1 -0
- package/dist/index.css +80 -0
- package/dist/index.js +1185 -0
- package/dist/index.js.map +1 -0
- package/dist/json.worker-B5MqtfsC.js +21 -0
- package/dist/json.worker-B5MqtfsC.js.map +1 -0
- package/dist/src/CodeEditor/KdsCodeEditor.vue.d.ts +18 -0
- package/dist/src/CodeEditor/KdsCodeEditor.vue.d.ts.map +1 -0
- package/dist/src/CodeEditor/enums.d.ts +7 -0
- package/dist/src/CodeEditor/enums.d.ts.map +1 -0
- package/dist/src/CodeEditor/index.d.ts +5 -0
- package/dist/src/CodeEditor/index.d.ts.map +1 -0
- package/dist/src/CodeEditor/monacoEnvironment.d.ts +2 -0
- package/dist/src/CodeEditor/monacoEnvironment.d.ts.map +1 -0
- package/dist/src/CodeEditor/tomlLanguage.d.ts +2 -0
- package/dist/src/CodeEditor/tomlLanguage.d.ts.map +1 -0
- package/dist/src/CodeEditor/types.d.ts +101 -0
- package/dist/src/CodeEditor/types.d.ts.map +1 -0
- package/dist/src/index.d.ts +3 -0
- package/dist/src/index.d.ts.map +1 -0
- package/package.json +57 -0
- package/patches/monaco-editor@0.55.1.patch +85 -0
package/dist/index.js
ADDED
|
@@ -0,0 +1,1185 @@
|
|
|
1
|
+
import { Fragment, computed, createBlock, createCommentVNode, createElementBlock, createElementVNode, defineComponent, mergeModels, mergeProps, normalizeClass, normalizeStyle, onMounted, onUnmounted, openBlock, ref, renderList, toDisplayString, unref, useId, useModel, useTemplateRef, watch } from "vue";
|
|
2
|
+
import { useClipboard } from "@vueuse/core";
|
|
3
|
+
import { KeyCode, editor } from "monaco-editor";
|
|
4
|
+
import { KdsButton, KdsMenuButton, KdsProgressButton, KdsSubText, KdsToggleButton, useKdsDarkMode } from "@knime/kds-components";
|
|
5
|
+
import './index.css';//#region ../styles/dist/tokens/ts/font.js
|
|
6
|
+
/**
|
|
7
|
+
* Do not edit directly, this file was auto-generated
|
|
8
|
+
* from the design token sources in src/tokens.
|
|
9
|
+
*/
|
|
10
|
+
var font = {
|
|
11
|
+
base: {
|
|
12
|
+
display: {
|
|
13
|
+
xsmall: {
|
|
14
|
+
fontFamily: "Roboto",
|
|
15
|
+
fontWeight: 700,
|
|
16
|
+
fontSize: {
|
|
17
|
+
value: 18,
|
|
18
|
+
unit: "px"
|
|
19
|
+
},
|
|
20
|
+
lineHeight: "normal",
|
|
21
|
+
css: {
|
|
22
|
+
value: "700 18px/normal Roboto, sans-serif",
|
|
23
|
+
variable: "var(--kds-font-base-display-xsmall)"
|
|
24
|
+
}
|
|
25
|
+
},
|
|
26
|
+
small: {
|
|
27
|
+
fontFamily: "Roboto",
|
|
28
|
+
fontWeight: 700,
|
|
29
|
+
fontSize: {
|
|
30
|
+
value: 20,
|
|
31
|
+
unit: "px"
|
|
32
|
+
},
|
|
33
|
+
lineHeight: "normal",
|
|
34
|
+
css: {
|
|
35
|
+
value: "700 20px/normal Roboto, sans-serif",
|
|
36
|
+
variable: "var(--kds-font-base-display-small)"
|
|
37
|
+
}
|
|
38
|
+
},
|
|
39
|
+
medium: {
|
|
40
|
+
fontFamily: "Roboto",
|
|
41
|
+
fontWeight: 700,
|
|
42
|
+
fontSize: {
|
|
43
|
+
value: 24,
|
|
44
|
+
unit: "px"
|
|
45
|
+
},
|
|
46
|
+
lineHeight: "normal",
|
|
47
|
+
css: {
|
|
48
|
+
value: "700 24px/normal Roboto, sans-serif",
|
|
49
|
+
variable: "var(--kds-font-base-display-medium)"
|
|
50
|
+
}
|
|
51
|
+
},
|
|
52
|
+
large: {
|
|
53
|
+
fontFamily: "Roboto",
|
|
54
|
+
fontWeight: 700,
|
|
55
|
+
fontSize: {
|
|
56
|
+
value: 32,
|
|
57
|
+
unit: "px"
|
|
58
|
+
},
|
|
59
|
+
lineHeight: "normal",
|
|
60
|
+
css: {
|
|
61
|
+
value: "700 32px/normal Roboto, sans-serif",
|
|
62
|
+
variable: "var(--kds-font-base-display-large)"
|
|
63
|
+
}
|
|
64
|
+
},
|
|
65
|
+
xlarge: {
|
|
66
|
+
fontFamily: "Roboto",
|
|
67
|
+
fontWeight: 700,
|
|
68
|
+
fontSize: {
|
|
69
|
+
value: 40,
|
|
70
|
+
unit: "px"
|
|
71
|
+
},
|
|
72
|
+
lineHeight: "normal",
|
|
73
|
+
css: {
|
|
74
|
+
value: "700 40px/normal Roboto, sans-serif",
|
|
75
|
+
variable: "var(--kds-font-base-display-xlarge)"
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
},
|
|
79
|
+
title: {
|
|
80
|
+
xsmall: {
|
|
81
|
+
fontFamily: "Roboto",
|
|
82
|
+
fontWeight: 500,
|
|
83
|
+
fontSize: {
|
|
84
|
+
value: 10,
|
|
85
|
+
unit: "px"
|
|
86
|
+
},
|
|
87
|
+
lineHeight: "normal",
|
|
88
|
+
css: {
|
|
89
|
+
value: "500 10px/normal Roboto, sans-serif",
|
|
90
|
+
variable: "var(--kds-font-base-title-xsmall)"
|
|
91
|
+
}
|
|
92
|
+
},
|
|
93
|
+
small: {
|
|
94
|
+
fontFamily: "Roboto",
|
|
95
|
+
fontWeight: 500,
|
|
96
|
+
fontSize: {
|
|
97
|
+
value: 12,
|
|
98
|
+
unit: "px"
|
|
99
|
+
},
|
|
100
|
+
lineHeight: "normal",
|
|
101
|
+
css: {
|
|
102
|
+
value: "500 12px/normal Roboto, sans-serif",
|
|
103
|
+
variable: "var(--kds-font-base-title-small)"
|
|
104
|
+
}
|
|
105
|
+
},
|
|
106
|
+
"small-strong": {
|
|
107
|
+
fontFamily: "Roboto",
|
|
108
|
+
fontWeight: 700,
|
|
109
|
+
fontSize: {
|
|
110
|
+
value: 12,
|
|
111
|
+
unit: "px"
|
|
112
|
+
},
|
|
113
|
+
lineHeight: "normal",
|
|
114
|
+
css: {
|
|
115
|
+
value: "700 12px/normal Roboto, sans-serif",
|
|
116
|
+
variable: "var(--kds-font-base-title-small-strong)"
|
|
117
|
+
}
|
|
118
|
+
},
|
|
119
|
+
medium: {
|
|
120
|
+
fontFamily: "Roboto",
|
|
121
|
+
fontWeight: 500,
|
|
122
|
+
fontSize: {
|
|
123
|
+
value: 14,
|
|
124
|
+
unit: "px"
|
|
125
|
+
},
|
|
126
|
+
lineHeight: "normal",
|
|
127
|
+
css: {
|
|
128
|
+
value: "500 14px/normal Roboto, sans-serif",
|
|
129
|
+
variable: "var(--kds-font-base-title-medium)"
|
|
130
|
+
}
|
|
131
|
+
},
|
|
132
|
+
"medium-strong": {
|
|
133
|
+
fontFamily: "Roboto",
|
|
134
|
+
fontWeight: 700,
|
|
135
|
+
fontSize: {
|
|
136
|
+
value: 14,
|
|
137
|
+
unit: "px"
|
|
138
|
+
},
|
|
139
|
+
lineHeight: "normal",
|
|
140
|
+
css: {
|
|
141
|
+
value: "700 14px/normal Roboto, sans-serif",
|
|
142
|
+
variable: "var(--kds-font-base-title-medium-strong)"
|
|
143
|
+
}
|
|
144
|
+
},
|
|
145
|
+
large: {
|
|
146
|
+
fontFamily: "Roboto",
|
|
147
|
+
fontWeight: 500,
|
|
148
|
+
fontSize: {
|
|
149
|
+
value: 16,
|
|
150
|
+
unit: "px"
|
|
151
|
+
},
|
|
152
|
+
lineHeight: "normal",
|
|
153
|
+
css: {
|
|
154
|
+
value: "500 16px/normal Roboto, sans-serif",
|
|
155
|
+
variable: "var(--kds-font-base-title-large)"
|
|
156
|
+
}
|
|
157
|
+
},
|
|
158
|
+
"large-strong": {
|
|
159
|
+
fontFamily: "Roboto",
|
|
160
|
+
fontWeight: 700,
|
|
161
|
+
fontSize: {
|
|
162
|
+
value: 16,
|
|
163
|
+
unit: "px"
|
|
164
|
+
},
|
|
165
|
+
lineHeight: "normal",
|
|
166
|
+
css: {
|
|
167
|
+
value: "700 16px/normal Roboto, sans-serif",
|
|
168
|
+
variable: "var(--kds-font-base-title-large-strong)"
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
},
|
|
172
|
+
body: {
|
|
173
|
+
small: {
|
|
174
|
+
fontFamily: "Roboto",
|
|
175
|
+
fontWeight: 400,
|
|
176
|
+
fontSize: {
|
|
177
|
+
value: 12,
|
|
178
|
+
unit: "px"
|
|
179
|
+
},
|
|
180
|
+
lineHeight: 1.5,
|
|
181
|
+
css: {
|
|
182
|
+
value: "400 12px/1.5 Roboto, sans-serif",
|
|
183
|
+
variable: "var(--kds-font-base-body-small)"
|
|
184
|
+
}
|
|
185
|
+
},
|
|
186
|
+
"small-italic": {
|
|
187
|
+
fontFamily: "Roboto",
|
|
188
|
+
fontWeight: 400,
|
|
189
|
+
fontSize: {
|
|
190
|
+
value: 12,
|
|
191
|
+
unit: "px"
|
|
192
|
+
},
|
|
193
|
+
lineHeight: 1.5,
|
|
194
|
+
fontStyle: "italic",
|
|
195
|
+
css: {
|
|
196
|
+
value: "italic 400 12px/1.5 Roboto, sans-serif",
|
|
197
|
+
variable: "var(--kds-font-base-body-small-italic)"
|
|
198
|
+
}
|
|
199
|
+
},
|
|
200
|
+
"small-strong": {
|
|
201
|
+
fontFamily: "Roboto",
|
|
202
|
+
fontWeight: 700,
|
|
203
|
+
fontSize: {
|
|
204
|
+
value: 12,
|
|
205
|
+
unit: "px"
|
|
206
|
+
},
|
|
207
|
+
lineHeight: 1.5,
|
|
208
|
+
css: {
|
|
209
|
+
value: "700 12px/1.5 Roboto, sans-serif",
|
|
210
|
+
variable: "var(--kds-font-base-body-small-strong)"
|
|
211
|
+
}
|
|
212
|
+
},
|
|
213
|
+
"small-strong-italic": {
|
|
214
|
+
fontFamily: "Roboto",
|
|
215
|
+
fontWeight: 700,
|
|
216
|
+
fontSize: {
|
|
217
|
+
value: 12,
|
|
218
|
+
unit: "px"
|
|
219
|
+
},
|
|
220
|
+
lineHeight: 1.5,
|
|
221
|
+
fontStyle: "italic",
|
|
222
|
+
css: {
|
|
223
|
+
value: "italic 700 12px/1.5 Roboto, sans-serif",
|
|
224
|
+
variable: "var(--kds-font-base-body-small-strong-italic)"
|
|
225
|
+
}
|
|
226
|
+
},
|
|
227
|
+
medium: {
|
|
228
|
+
fontFamily: "Roboto",
|
|
229
|
+
fontWeight: 400,
|
|
230
|
+
fontSize: {
|
|
231
|
+
value: 14,
|
|
232
|
+
unit: "px"
|
|
233
|
+
},
|
|
234
|
+
lineHeight: 1.5,
|
|
235
|
+
css: {
|
|
236
|
+
value: "400 14px/1.5 Roboto, sans-serif",
|
|
237
|
+
variable: "var(--kds-font-base-body-medium)"
|
|
238
|
+
}
|
|
239
|
+
},
|
|
240
|
+
"medium-strong": {
|
|
241
|
+
fontFamily: "Roboto",
|
|
242
|
+
fontWeight: 700,
|
|
243
|
+
fontSize: {
|
|
244
|
+
value: 14,
|
|
245
|
+
unit: "px"
|
|
246
|
+
},
|
|
247
|
+
lineHeight: 1.5,
|
|
248
|
+
css: {
|
|
249
|
+
value: "700 14px/1.5 Roboto, sans-serif",
|
|
250
|
+
variable: "var(--kds-font-base-body-medium-strong)"
|
|
251
|
+
}
|
|
252
|
+
},
|
|
253
|
+
large: {
|
|
254
|
+
fontFamily: "Roboto",
|
|
255
|
+
fontWeight: 400,
|
|
256
|
+
fontSize: {
|
|
257
|
+
value: 16,
|
|
258
|
+
unit: "px"
|
|
259
|
+
},
|
|
260
|
+
lineHeight: 1.5,
|
|
261
|
+
css: {
|
|
262
|
+
value: "400 16px/1.5 Roboto, sans-serif",
|
|
263
|
+
variable: "var(--kds-font-base-body-large)"
|
|
264
|
+
}
|
|
265
|
+
},
|
|
266
|
+
"large-strong": {
|
|
267
|
+
fontFamily: "Roboto",
|
|
268
|
+
fontWeight: 700,
|
|
269
|
+
fontSize: {
|
|
270
|
+
value: 16,
|
|
271
|
+
unit: "px"
|
|
272
|
+
},
|
|
273
|
+
lineHeight: 1.5,
|
|
274
|
+
css: {
|
|
275
|
+
value: "700 16px/1.5 Roboto, sans-serif",
|
|
276
|
+
variable: "var(--kds-font-base-body-large-strong)"
|
|
277
|
+
}
|
|
278
|
+
},
|
|
279
|
+
xlarge: {
|
|
280
|
+
fontFamily: "Roboto",
|
|
281
|
+
fontWeight: 400,
|
|
282
|
+
fontSize: {
|
|
283
|
+
value: 20,
|
|
284
|
+
unit: "px"
|
|
285
|
+
},
|
|
286
|
+
lineHeight: 1.5,
|
|
287
|
+
css: {
|
|
288
|
+
value: "400 20px/1.5 Roboto, sans-serif",
|
|
289
|
+
variable: "var(--kds-font-base-body-xlarge)"
|
|
290
|
+
}
|
|
291
|
+
}
|
|
292
|
+
},
|
|
293
|
+
subtext: {
|
|
294
|
+
xsmall: {
|
|
295
|
+
fontFamily: "Roboto",
|
|
296
|
+
fontWeight: 400,
|
|
297
|
+
fontSize: {
|
|
298
|
+
value: 9,
|
|
299
|
+
unit: "px"
|
|
300
|
+
},
|
|
301
|
+
lineHeight: "normal",
|
|
302
|
+
css: {
|
|
303
|
+
value: "400 9px/normal Roboto, sans-serif",
|
|
304
|
+
variable: "var(--kds-font-base-subtext-xsmall)"
|
|
305
|
+
}
|
|
306
|
+
},
|
|
307
|
+
small: {
|
|
308
|
+
fontFamily: "Roboto",
|
|
309
|
+
fontWeight: 400,
|
|
310
|
+
fontSize: {
|
|
311
|
+
value: 10,
|
|
312
|
+
unit: "px"
|
|
313
|
+
},
|
|
314
|
+
lineHeight: "normal",
|
|
315
|
+
css: {
|
|
316
|
+
value: "400 10px/normal Roboto, sans-serif",
|
|
317
|
+
variable: "var(--kds-font-base-subtext-small)"
|
|
318
|
+
}
|
|
319
|
+
},
|
|
320
|
+
medium: {
|
|
321
|
+
fontFamily: "Roboto",
|
|
322
|
+
fontWeight: 400,
|
|
323
|
+
fontSize: {
|
|
324
|
+
value: 12,
|
|
325
|
+
unit: "px"
|
|
326
|
+
},
|
|
327
|
+
lineHeight: "normal",
|
|
328
|
+
css: {
|
|
329
|
+
value: "400 12px/normal Roboto, sans-serif",
|
|
330
|
+
variable: "var(--kds-font-base-subtext-medium)"
|
|
331
|
+
}
|
|
332
|
+
}
|
|
333
|
+
},
|
|
334
|
+
interactive: {
|
|
335
|
+
"xsmall-strong": {
|
|
336
|
+
fontFamily: "Roboto",
|
|
337
|
+
fontWeight: 500,
|
|
338
|
+
fontSize: {
|
|
339
|
+
value: 11,
|
|
340
|
+
unit: "px"
|
|
341
|
+
},
|
|
342
|
+
lineHeight: "normal",
|
|
343
|
+
css: {
|
|
344
|
+
value: "500 11px/normal Roboto, sans-serif",
|
|
345
|
+
variable: "var(--kds-font-base-interactive-xsmall-strong)"
|
|
346
|
+
}
|
|
347
|
+
},
|
|
348
|
+
small: {
|
|
349
|
+
fontFamily: "Roboto",
|
|
350
|
+
fontWeight: 400,
|
|
351
|
+
fontSize: {
|
|
352
|
+
value: 12,
|
|
353
|
+
unit: "px"
|
|
354
|
+
},
|
|
355
|
+
lineHeight: "normal",
|
|
356
|
+
css: {
|
|
357
|
+
value: "400 12px/normal Roboto, sans-serif",
|
|
358
|
+
variable: "var(--kds-font-base-interactive-small)"
|
|
359
|
+
}
|
|
360
|
+
},
|
|
361
|
+
"small-italic": {
|
|
362
|
+
fontFamily: "Roboto",
|
|
363
|
+
fontWeight: 400,
|
|
364
|
+
fontSize: {
|
|
365
|
+
value: 12,
|
|
366
|
+
unit: "px"
|
|
367
|
+
},
|
|
368
|
+
lineHeight: "normal",
|
|
369
|
+
fontStyle: "italic",
|
|
370
|
+
css: {
|
|
371
|
+
value: "italic 400 12px/normal Roboto, sans-serif",
|
|
372
|
+
variable: "var(--kds-font-base-interactive-small-italic)"
|
|
373
|
+
}
|
|
374
|
+
},
|
|
375
|
+
"small-strong": {
|
|
376
|
+
fontFamily: "Roboto",
|
|
377
|
+
fontWeight: 500,
|
|
378
|
+
fontSize: {
|
|
379
|
+
value: 12,
|
|
380
|
+
unit: "px"
|
|
381
|
+
},
|
|
382
|
+
lineHeight: "normal",
|
|
383
|
+
css: {
|
|
384
|
+
value: "500 12px/normal Roboto, sans-serif",
|
|
385
|
+
variable: "var(--kds-font-base-interactive-small-strong)"
|
|
386
|
+
}
|
|
387
|
+
},
|
|
388
|
+
medium: {
|
|
389
|
+
fontFamily: "Roboto",
|
|
390
|
+
fontWeight: 400,
|
|
391
|
+
fontSize: {
|
|
392
|
+
value: 14,
|
|
393
|
+
unit: "px"
|
|
394
|
+
},
|
|
395
|
+
lineHeight: "normal",
|
|
396
|
+
css: {
|
|
397
|
+
value: "400 14px/normal Roboto, sans-serif",
|
|
398
|
+
variable: "var(--kds-font-base-interactive-medium)"
|
|
399
|
+
}
|
|
400
|
+
},
|
|
401
|
+
"medium-strong": {
|
|
402
|
+
fontFamily: "Roboto",
|
|
403
|
+
fontWeight: 500,
|
|
404
|
+
fontSize: {
|
|
405
|
+
value: 14,
|
|
406
|
+
unit: "px"
|
|
407
|
+
},
|
|
408
|
+
lineHeight: "normal",
|
|
409
|
+
css: {
|
|
410
|
+
value: "500 14px/normal Roboto, sans-serif",
|
|
411
|
+
variable: "var(--kds-font-base-interactive-medium-strong)"
|
|
412
|
+
}
|
|
413
|
+
},
|
|
414
|
+
large: {
|
|
415
|
+
fontFamily: "Roboto",
|
|
416
|
+
fontWeight: 400,
|
|
417
|
+
fontSize: {
|
|
418
|
+
value: 16,
|
|
419
|
+
unit: "px"
|
|
420
|
+
},
|
|
421
|
+
lineHeight: "normal",
|
|
422
|
+
css: {
|
|
423
|
+
value: "400 16px/normal Roboto, sans-serif",
|
|
424
|
+
variable: "var(--kds-font-base-interactive-large)"
|
|
425
|
+
}
|
|
426
|
+
},
|
|
427
|
+
"large-strong": {
|
|
428
|
+
fontFamily: "Roboto",
|
|
429
|
+
fontWeight: 500,
|
|
430
|
+
fontSize: {
|
|
431
|
+
value: 16,
|
|
432
|
+
unit: "px"
|
|
433
|
+
},
|
|
434
|
+
lineHeight: "normal",
|
|
435
|
+
css: {
|
|
436
|
+
value: "500 16px/normal Roboto, sans-serif",
|
|
437
|
+
variable: "var(--kds-font-base-interactive-large-strong)"
|
|
438
|
+
}
|
|
439
|
+
}
|
|
440
|
+
},
|
|
441
|
+
code: {
|
|
442
|
+
xsmall: {
|
|
443
|
+
fontFamily: "Roboto Mono",
|
|
444
|
+
fontWeight: 400,
|
|
445
|
+
fontSize: {
|
|
446
|
+
value: 10,
|
|
447
|
+
unit: "px"
|
|
448
|
+
},
|
|
449
|
+
lineHeight: "normal",
|
|
450
|
+
css: {
|
|
451
|
+
value: "400 10px/normal 'Roboto Mono', monospace",
|
|
452
|
+
variable: "var(--kds-font-base-code-xsmall)"
|
|
453
|
+
}
|
|
454
|
+
},
|
|
455
|
+
small: {
|
|
456
|
+
fontFamily: "Roboto Mono",
|
|
457
|
+
fontWeight: 400,
|
|
458
|
+
fontSize: {
|
|
459
|
+
value: 11,
|
|
460
|
+
unit: "px"
|
|
461
|
+
},
|
|
462
|
+
lineHeight: "normal",
|
|
463
|
+
css: {
|
|
464
|
+
value: "400 11px/normal 'Roboto Mono', monospace",
|
|
465
|
+
variable: "var(--kds-font-base-code-small)"
|
|
466
|
+
}
|
|
467
|
+
}
|
|
468
|
+
}
|
|
469
|
+
},
|
|
470
|
+
workflow: {
|
|
471
|
+
annotation: {
|
|
472
|
+
headline: {
|
|
473
|
+
H1: {
|
|
474
|
+
fontFamily: "Roboto Condensed",
|
|
475
|
+
fontWeight: 700,
|
|
476
|
+
fontSize: {
|
|
477
|
+
value: 36,
|
|
478
|
+
unit: "px"
|
|
479
|
+
},
|
|
480
|
+
lineHeight: 1.5,
|
|
481
|
+
css: {
|
|
482
|
+
value: "700 36px/1.5 'Roboto Condensed', sans-serif",
|
|
483
|
+
variable: "var(--kds-font-workflow-annotation-headline-h1)"
|
|
484
|
+
}
|
|
485
|
+
},
|
|
486
|
+
H2: {
|
|
487
|
+
fontFamily: "Roboto Condensed",
|
|
488
|
+
fontWeight: 700,
|
|
489
|
+
fontSize: {
|
|
490
|
+
value: 30,
|
|
491
|
+
unit: "px"
|
|
492
|
+
},
|
|
493
|
+
lineHeight: 1.5,
|
|
494
|
+
css: {
|
|
495
|
+
value: "700 30px/1.5 'Roboto Condensed', sans-serif",
|
|
496
|
+
variable: "var(--kds-font-workflow-annotation-headline-h2)"
|
|
497
|
+
}
|
|
498
|
+
},
|
|
499
|
+
H3: {
|
|
500
|
+
fontFamily: "Roboto Condensed",
|
|
501
|
+
fontWeight: 700,
|
|
502
|
+
fontSize: {
|
|
503
|
+
value: 26,
|
|
504
|
+
unit: "px"
|
|
505
|
+
},
|
|
506
|
+
lineHeight: 1.5,
|
|
507
|
+
css: {
|
|
508
|
+
value: "700 26px/1.5 'Roboto Condensed', sans-serif",
|
|
509
|
+
variable: "var(--kds-font-workflow-annotation-headline-h3)"
|
|
510
|
+
}
|
|
511
|
+
},
|
|
512
|
+
H4: {
|
|
513
|
+
fontFamily: "Roboto Condensed",
|
|
514
|
+
fontWeight: 700,
|
|
515
|
+
fontSize: {
|
|
516
|
+
value: 22,
|
|
517
|
+
unit: "px"
|
|
518
|
+
},
|
|
519
|
+
lineHeight: 1.5,
|
|
520
|
+
css: {
|
|
521
|
+
value: "700 22px/1.5 'Roboto Condensed', sans-serif",
|
|
522
|
+
variable: "var(--kds-font-workflow-annotation-headline-h4)"
|
|
523
|
+
}
|
|
524
|
+
},
|
|
525
|
+
H5: {
|
|
526
|
+
fontFamily: "Roboto Condensed",
|
|
527
|
+
fontWeight: 700,
|
|
528
|
+
fontSize: {
|
|
529
|
+
value: 16,
|
|
530
|
+
unit: "px"
|
|
531
|
+
},
|
|
532
|
+
lineHeight: 1.5,
|
|
533
|
+
css: {
|
|
534
|
+
value: "700 16px/1.5 'Roboto Condensed', sans-serif",
|
|
535
|
+
variable: "var(--kds-font-workflow-annotation-headline-h5)"
|
|
536
|
+
}
|
|
537
|
+
},
|
|
538
|
+
"H1-italic": {
|
|
539
|
+
fontFamily: "Roboto Condensed",
|
|
540
|
+
fontWeight: 700,
|
|
541
|
+
fontSize: {
|
|
542
|
+
value: 36,
|
|
543
|
+
unit: "px"
|
|
544
|
+
},
|
|
545
|
+
lineHeight: 1.5,
|
|
546
|
+
css: {
|
|
547
|
+
value: "700 36px/1.5 'Roboto Condensed', sans-serif",
|
|
548
|
+
variable: "var(--kds-font-workflow-annotation-headline-h1-italic)"
|
|
549
|
+
}
|
|
550
|
+
},
|
|
551
|
+
"H2-italic": {
|
|
552
|
+
fontFamily: "Roboto Condensed",
|
|
553
|
+
fontWeight: 700,
|
|
554
|
+
fontSize: {
|
|
555
|
+
value: 30,
|
|
556
|
+
unit: "px"
|
|
557
|
+
},
|
|
558
|
+
lineHeight: 1.5,
|
|
559
|
+
css: {
|
|
560
|
+
value: "700 30px/1.5 'Roboto Condensed', sans-serif",
|
|
561
|
+
variable: "var(--kds-font-workflow-annotation-headline-h2-italic)"
|
|
562
|
+
}
|
|
563
|
+
},
|
|
564
|
+
"H3-italic": {
|
|
565
|
+
fontFamily: "Roboto Condensed",
|
|
566
|
+
fontWeight: 700,
|
|
567
|
+
fontSize: {
|
|
568
|
+
value: 26,
|
|
569
|
+
unit: "px"
|
|
570
|
+
},
|
|
571
|
+
lineHeight: 1.5,
|
|
572
|
+
css: {
|
|
573
|
+
value: "700 26px/1.5 'Roboto Condensed', sans-serif",
|
|
574
|
+
variable: "var(--kds-font-workflow-annotation-headline-h3-italic)"
|
|
575
|
+
}
|
|
576
|
+
},
|
|
577
|
+
"H4-italic": {
|
|
578
|
+
fontFamily: "Roboto Condensed",
|
|
579
|
+
fontWeight: 700,
|
|
580
|
+
fontSize: {
|
|
581
|
+
value: 22,
|
|
582
|
+
unit: "px"
|
|
583
|
+
},
|
|
584
|
+
lineHeight: 1.5,
|
|
585
|
+
css: {
|
|
586
|
+
value: "700 22px/1.5 'Roboto Condensed', sans-serif",
|
|
587
|
+
variable: "var(--kds-font-workflow-annotation-headline-h4-italic)"
|
|
588
|
+
}
|
|
589
|
+
},
|
|
590
|
+
"H5-italic": {
|
|
591
|
+
fontFamily: "Roboto Condensed",
|
|
592
|
+
fontWeight: 700,
|
|
593
|
+
fontSize: {
|
|
594
|
+
value: 16,
|
|
595
|
+
unit: "px"
|
|
596
|
+
},
|
|
597
|
+
lineHeight: 1.5,
|
|
598
|
+
css: {
|
|
599
|
+
value: "700 16px/1.5 'Roboto Condensed', sans-serif",
|
|
600
|
+
variable: "var(--kds-font-workflow-annotation-headline-h5-italic)"
|
|
601
|
+
}
|
|
602
|
+
},
|
|
603
|
+
H6: {
|
|
604
|
+
fontFamily: "Roboto Condensed",
|
|
605
|
+
fontWeight: 700,
|
|
606
|
+
fontSize: {
|
|
607
|
+
value: 13,
|
|
608
|
+
unit: "px"
|
|
609
|
+
},
|
|
610
|
+
lineHeight: 1.5,
|
|
611
|
+
css: {
|
|
612
|
+
value: "700 13px/1.5 'Roboto Condensed', sans-serif",
|
|
613
|
+
variable: "var(--kds-font-workflow-annotation-headline-h6)"
|
|
614
|
+
}
|
|
615
|
+
},
|
|
616
|
+
"H6-italic": {
|
|
617
|
+
fontFamily: "Roboto Condensed",
|
|
618
|
+
fontWeight: 700,
|
|
619
|
+
fontSize: {
|
|
620
|
+
value: 13,
|
|
621
|
+
unit: "px"
|
|
622
|
+
},
|
|
623
|
+
lineHeight: 1.5,
|
|
624
|
+
css: {
|
|
625
|
+
value: "700 13px/1.5 'Roboto Condensed', sans-serif",
|
|
626
|
+
variable: "var(--kds-font-workflow-annotation-headline-h6-italic)"
|
|
627
|
+
}
|
|
628
|
+
}
|
|
629
|
+
},
|
|
630
|
+
body: {
|
|
631
|
+
small: {
|
|
632
|
+
fontFamily: "Roboto Condensed",
|
|
633
|
+
fontWeight: 400,
|
|
634
|
+
fontSize: {
|
|
635
|
+
value: 13,
|
|
636
|
+
unit: "px"
|
|
637
|
+
},
|
|
638
|
+
lineHeight: 1.5,
|
|
639
|
+
css: {
|
|
640
|
+
value: "400 13px/1.5 'Roboto Condensed', sans-serif",
|
|
641
|
+
variable: "var(--kds-font-workflow-annotation-body-small)"
|
|
642
|
+
}
|
|
643
|
+
},
|
|
644
|
+
"small-italic": {
|
|
645
|
+
fontFamily: "Roboto Condensed",
|
|
646
|
+
fontWeight: 400,
|
|
647
|
+
fontSize: {
|
|
648
|
+
value: 13,
|
|
649
|
+
unit: "px"
|
|
650
|
+
},
|
|
651
|
+
lineHeight: 1.5,
|
|
652
|
+
fontStyle: "italic",
|
|
653
|
+
css: {
|
|
654
|
+
value: "italic 400 13px/1.5 'Roboto Condensed', sans-serif",
|
|
655
|
+
variable: "var(--kds-font-workflow-annotation-body-small-italic)"
|
|
656
|
+
}
|
|
657
|
+
},
|
|
658
|
+
"small-strong": {
|
|
659
|
+
fontFamily: "Roboto Condensed",
|
|
660
|
+
fontWeight: 700,
|
|
661
|
+
fontSize: {
|
|
662
|
+
value: 13,
|
|
663
|
+
unit: "px"
|
|
664
|
+
},
|
|
665
|
+
lineHeight: 1.5,
|
|
666
|
+
css: {
|
|
667
|
+
value: "700 13px/1.5 'Roboto Condensed', sans-serif",
|
|
668
|
+
variable: "var(--kds-font-workflow-annotation-body-small-strong)"
|
|
669
|
+
}
|
|
670
|
+
},
|
|
671
|
+
"small-strong-Italic": {
|
|
672
|
+
fontFamily: "Roboto Condensed",
|
|
673
|
+
fontWeight: 700,
|
|
674
|
+
fontSize: {
|
|
675
|
+
value: 13,
|
|
676
|
+
unit: "px"
|
|
677
|
+
},
|
|
678
|
+
lineHeight: 1.5,
|
|
679
|
+
fontStyle: "italic",
|
|
680
|
+
css: {
|
|
681
|
+
value: "italic 700 13px/1.5 'Roboto Condensed', sans-serif",
|
|
682
|
+
variable: "var(--kds-font-workflow-annotation-body-small-strong-italic)"
|
|
683
|
+
}
|
|
684
|
+
}
|
|
685
|
+
}
|
|
686
|
+
},
|
|
687
|
+
node: {
|
|
688
|
+
name: {
|
|
689
|
+
fontFamily: "Roboto Condensed",
|
|
690
|
+
fontWeight: 700,
|
|
691
|
+
fontSize: {
|
|
692
|
+
value: 13,
|
|
693
|
+
unit: "px"
|
|
694
|
+
},
|
|
695
|
+
css: {
|
|
696
|
+
value: "700 13px 'Roboto Condensed', sans-serif",
|
|
697
|
+
variable: "var(--kds-font-workflow-node-name)"
|
|
698
|
+
}
|
|
699
|
+
},
|
|
700
|
+
label: {
|
|
701
|
+
fontFamily: "Roboto Condensed",
|
|
702
|
+
fontWeight: 400,
|
|
703
|
+
fontSize: {
|
|
704
|
+
value: 12,
|
|
705
|
+
unit: "px"
|
|
706
|
+
},
|
|
707
|
+
css: {
|
|
708
|
+
value: "400 12px 'Roboto Condensed', sans-serif",
|
|
709
|
+
variable: "var(--kds-font-workflow-node-label)"
|
|
710
|
+
}
|
|
711
|
+
},
|
|
712
|
+
status: {
|
|
713
|
+
fontFamily: "Roboto Condensed",
|
|
714
|
+
fontWeight: 400,
|
|
715
|
+
fontSize: {
|
|
716
|
+
value: 8,
|
|
717
|
+
unit: "px"
|
|
718
|
+
},
|
|
719
|
+
css: {
|
|
720
|
+
value: "400 8px 'Roboto Condensed', sans-serif",
|
|
721
|
+
variable: "var(--kds-font-workflow-node-status)"
|
|
722
|
+
}
|
|
723
|
+
}
|
|
724
|
+
}
|
|
725
|
+
},
|
|
726
|
+
dataapp: {
|
|
727
|
+
H1: {
|
|
728
|
+
fontFamily: "Roboto",
|
|
729
|
+
fontWeight: 700,
|
|
730
|
+
fontSize: {
|
|
731
|
+
value: 36,
|
|
732
|
+
unit: "px"
|
|
733
|
+
},
|
|
734
|
+
lineHeight: 1.5,
|
|
735
|
+
css: {
|
|
736
|
+
value: "700 36px/1.5 Roboto, sans-serif",
|
|
737
|
+
variable: "var(--kds-font-dataapp-h1)"
|
|
738
|
+
}
|
|
739
|
+
},
|
|
740
|
+
H2: {
|
|
741
|
+
fontFamily: "Roboto",
|
|
742
|
+
fontWeight: 700,
|
|
743
|
+
fontSize: {
|
|
744
|
+
value: 30,
|
|
745
|
+
unit: "px"
|
|
746
|
+
},
|
|
747
|
+
lineHeight: 1.5,
|
|
748
|
+
css: {
|
|
749
|
+
value: "700 30px/1.5 Roboto, sans-serif",
|
|
750
|
+
variable: "var(--kds-font-dataapp-h2)"
|
|
751
|
+
}
|
|
752
|
+
},
|
|
753
|
+
H3: {
|
|
754
|
+
fontFamily: "Roboto",
|
|
755
|
+
fontWeight: 700,
|
|
756
|
+
fontSize: {
|
|
757
|
+
value: 26,
|
|
758
|
+
unit: "px"
|
|
759
|
+
},
|
|
760
|
+
lineHeight: 1.5,
|
|
761
|
+
css: {
|
|
762
|
+
value: "700 26px/1.5 Roboto, sans-serif",
|
|
763
|
+
variable: "var(--kds-font-dataapp-h3)"
|
|
764
|
+
}
|
|
765
|
+
},
|
|
766
|
+
H4: {
|
|
767
|
+
fontFamily: "Roboto",
|
|
768
|
+
fontWeight: 700,
|
|
769
|
+
fontSize: {
|
|
770
|
+
value: 22,
|
|
771
|
+
unit: "px"
|
|
772
|
+
},
|
|
773
|
+
lineHeight: 1.5,
|
|
774
|
+
css: {
|
|
775
|
+
value: "700 22px/1.5 Roboto, sans-serif",
|
|
776
|
+
variable: "var(--kds-font-dataapp-h4)"
|
|
777
|
+
}
|
|
778
|
+
},
|
|
779
|
+
H5: {
|
|
780
|
+
fontFamily: "Roboto",
|
|
781
|
+
fontWeight: 700,
|
|
782
|
+
fontSize: {
|
|
783
|
+
value: 16,
|
|
784
|
+
unit: "px"
|
|
785
|
+
},
|
|
786
|
+
lineHeight: 1.5,
|
|
787
|
+
css: {
|
|
788
|
+
value: "700 16px/1.5 Roboto, sans-serif",
|
|
789
|
+
variable: "var(--kds-font-dataapp-h5)"
|
|
790
|
+
}
|
|
791
|
+
},
|
|
792
|
+
H6: {
|
|
793
|
+
fontFamily: "Roboto",
|
|
794
|
+
fontWeight: 700,
|
|
795
|
+
fontSize: {
|
|
796
|
+
value: 13,
|
|
797
|
+
unit: "px"
|
|
798
|
+
},
|
|
799
|
+
lineHeight: 1.5,
|
|
800
|
+
css: {
|
|
801
|
+
value: "700 13px/1.5 Roboto, sans-serif",
|
|
802
|
+
variable: "var(--kds-font-dataapp-h6)"
|
|
803
|
+
}
|
|
804
|
+
},
|
|
805
|
+
body: {
|
|
806
|
+
fontFamily: "Roboto",
|
|
807
|
+
fontWeight: 700,
|
|
808
|
+
fontSize: {
|
|
809
|
+
value: 13,
|
|
810
|
+
unit: "px"
|
|
811
|
+
},
|
|
812
|
+
lineHeight: 1.5,
|
|
813
|
+
css: {
|
|
814
|
+
value: "700 13px/1.5 Roboto, sans-serif",
|
|
815
|
+
variable: "var(--kds-font-dataapp-body)"
|
|
816
|
+
}
|
|
817
|
+
},
|
|
818
|
+
"body-small": {
|
|
819
|
+
fontFamily: "Roboto",
|
|
820
|
+
fontWeight: 700,
|
|
821
|
+
fontSize: {
|
|
822
|
+
value: 10,
|
|
823
|
+
unit: "px"
|
|
824
|
+
},
|
|
825
|
+
lineHeight: 1.5,
|
|
826
|
+
css: {
|
|
827
|
+
value: "700 10px/1.5 Roboto, sans-serif",
|
|
828
|
+
variable: "var(--kds-font-dataapp-body-small)"
|
|
829
|
+
}
|
|
830
|
+
}
|
|
831
|
+
},
|
|
832
|
+
chart: {
|
|
833
|
+
title: {
|
|
834
|
+
fontFamily: "Roboto",
|
|
835
|
+
fontWeight: 700,
|
|
836
|
+
fontSize: {
|
|
837
|
+
value: 18,
|
|
838
|
+
unit: "px"
|
|
839
|
+
},
|
|
840
|
+
lineHeight: "normal",
|
|
841
|
+
css: {
|
|
842
|
+
value: "700 18px/normal Roboto, sans-serif",
|
|
843
|
+
variable: "var(--kds-font-chart-title)"
|
|
844
|
+
}
|
|
845
|
+
},
|
|
846
|
+
subtitle: {
|
|
847
|
+
fontFamily: "Roboto",
|
|
848
|
+
fontWeight: 400,
|
|
849
|
+
fontSize: {
|
|
850
|
+
value: 12,
|
|
851
|
+
unit: "px"
|
|
852
|
+
},
|
|
853
|
+
lineHeight: 1.5,
|
|
854
|
+
css: {
|
|
855
|
+
value: "400 12px/1.5 Roboto, sans-serif",
|
|
856
|
+
variable: "var(--kds-font-chart-subtitle)"
|
|
857
|
+
}
|
|
858
|
+
},
|
|
859
|
+
"axis-name": {
|
|
860
|
+
fontFamily: "Roboto",
|
|
861
|
+
fontWeight: 400,
|
|
862
|
+
fontSize: {
|
|
863
|
+
value: 12,
|
|
864
|
+
unit: "px"
|
|
865
|
+
},
|
|
866
|
+
lineHeight: 1.5,
|
|
867
|
+
css: {
|
|
868
|
+
value: "400 12px/1.5 Roboto, sans-serif",
|
|
869
|
+
variable: "var(--kds-font-chart-axis-name)"
|
|
870
|
+
}
|
|
871
|
+
},
|
|
872
|
+
"axis-label": {
|
|
873
|
+
fontFamily: "Roboto",
|
|
874
|
+
fontWeight: 500,
|
|
875
|
+
fontSize: {
|
|
876
|
+
value: 11,
|
|
877
|
+
unit: "px"
|
|
878
|
+
},
|
|
879
|
+
lineHeight: "normal",
|
|
880
|
+
css: {
|
|
881
|
+
value: "500 11px/normal Roboto, sans-serif",
|
|
882
|
+
variable: "var(--kds-font-chart-axis-label)"
|
|
883
|
+
}
|
|
884
|
+
},
|
|
885
|
+
legend: {
|
|
886
|
+
fontFamily: "Roboto",
|
|
887
|
+
fontWeight: 500,
|
|
888
|
+
fontSize: {
|
|
889
|
+
value: 11,
|
|
890
|
+
unit: "px"
|
|
891
|
+
},
|
|
892
|
+
lineHeight: "normal",
|
|
893
|
+
css: {
|
|
894
|
+
value: "500 11px/normal Roboto, sans-serif",
|
|
895
|
+
variable: "var(--kds-font-chart-legend)"
|
|
896
|
+
}
|
|
897
|
+
},
|
|
898
|
+
tooltip: {
|
|
899
|
+
fontFamily: "Roboto",
|
|
900
|
+
fontWeight: 400,
|
|
901
|
+
fontSize: {
|
|
902
|
+
value: 12,
|
|
903
|
+
unit: "px"
|
|
904
|
+
},
|
|
905
|
+
lineHeight: 1.5,
|
|
906
|
+
css: {
|
|
907
|
+
value: "400 12px/1.5 Roboto, sans-serif",
|
|
908
|
+
variable: "var(--kds-font-chart-tooltip)"
|
|
909
|
+
}
|
|
910
|
+
},
|
|
911
|
+
label: {
|
|
912
|
+
fontFamily: "Roboto",
|
|
913
|
+
fontWeight: 400,
|
|
914
|
+
fontSize: {
|
|
915
|
+
value: 10,
|
|
916
|
+
unit: "px"
|
|
917
|
+
},
|
|
918
|
+
lineHeight: "normal",
|
|
919
|
+
css: {
|
|
920
|
+
value: "400 10px/normal Roboto, sans-serif",
|
|
921
|
+
variable: "var(--kds-font-chart-label)"
|
|
922
|
+
}
|
|
923
|
+
}
|
|
924
|
+
}
|
|
925
|
+
};
|
|
926
|
+
//#endregion
|
|
927
|
+
//#region src/CodeEditor/enums.ts
|
|
928
|
+
var kdsCodeEditorState = {
|
|
929
|
+
DEFAULT: "default",
|
|
930
|
+
ERROR: "error",
|
|
931
|
+
WARNING: "warning"
|
|
932
|
+
};
|
|
933
|
+
var kdsCodeEditorStates = Object.values(kdsCodeEditorState);
|
|
934
|
+
//#endregion
|
|
935
|
+
//#region src/CodeEditor/monacoEnvironment.ts
|
|
936
|
+
document.fonts?.ready.then(() => {
|
|
937
|
+
editor.remeasureFonts();
|
|
938
|
+
});
|
|
939
|
+
var setupMonacoEnvironment = () => {
|
|
940
|
+
if (self.MonacoEnvironment) return;
|
|
941
|
+
self.MonacoEnvironment = { getWorker: async (_workerId, label) => {
|
|
942
|
+
if (label === "json") {
|
|
943
|
+
const { default: JSONWorker } = await import("./json.worker-B5MqtfsC.js");
|
|
944
|
+
return new JSONWorker();
|
|
945
|
+
}
|
|
946
|
+
const { default: EditorWorker } = await import("./editor.worker-CtYtPH8e.js");
|
|
947
|
+
return new EditorWorker();
|
|
948
|
+
} };
|
|
949
|
+
};
|
|
950
|
+
//#endregion
|
|
951
|
+
//#region src/CodeEditor/KdsCodeEditor.vue?vue&type=script&setup=true&lang.ts
|
|
952
|
+
var _hoisted_1 = {
|
|
953
|
+
key: 0,
|
|
954
|
+
class: "header"
|
|
955
|
+
};
|
|
956
|
+
var _hoisted_2 = { class: "left-block" };
|
|
957
|
+
var _hoisted_3 = { class: "title" };
|
|
958
|
+
var _hoisted_4 = {
|
|
959
|
+
key: 0,
|
|
960
|
+
class: "title"
|
|
961
|
+
};
|
|
962
|
+
var _hoisted_5 = { class: "action-buttons" };
|
|
963
|
+
var INITIAL_LINE_HEIGHT = 18;
|
|
964
|
+
var EXTRA_PADDING = 3;
|
|
965
|
+
var DEFAULT_OVERVIEW_RULER_LANES = 3;
|
|
966
|
+
var MONACO_THEME_LIGHT = "vs-light";
|
|
967
|
+
var MONACO_THEME_DARK = "vs-dark";
|
|
968
|
+
var KdsCodeEditor_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineComponent({
|
|
969
|
+
__name: "KdsCodeEditor",
|
|
970
|
+
props: /*@__PURE__*/ mergeModels({
|
|
971
|
+
language: { default: "plaintext" },
|
|
972
|
+
languageLabel: { default: () => void 0 },
|
|
973
|
+
hideHeader: {
|
|
974
|
+
type: Boolean,
|
|
975
|
+
default: false
|
|
976
|
+
},
|
|
977
|
+
state: { default: () => kdsCodeEditorState.DEFAULT },
|
|
978
|
+
overviewRuler: {
|
|
979
|
+
type: Boolean,
|
|
980
|
+
default: false
|
|
981
|
+
},
|
|
982
|
+
readOnly: {
|
|
983
|
+
type: Boolean,
|
|
984
|
+
default: false
|
|
985
|
+
},
|
|
986
|
+
subText: { default: () => void 0 },
|
|
987
|
+
copyable: {
|
|
988
|
+
type: Boolean,
|
|
989
|
+
default: true
|
|
990
|
+
},
|
|
991
|
+
editorActions: { default: () => void 0 },
|
|
992
|
+
minRows: { default: () => void 0 },
|
|
993
|
+
maxRows: { default: () => void 0 }
|
|
994
|
+
}, {
|
|
995
|
+
"modelValue": { default: "" },
|
|
996
|
+
"modelModifiers": {}
|
|
997
|
+
}),
|
|
998
|
+
emits: ["update:modelValue"],
|
|
999
|
+
setup(__props, { expose: __expose }) {
|
|
1000
|
+
setupMonacoEnvironment();
|
|
1001
|
+
const modelValue = useModel(__props, "modelValue");
|
|
1002
|
+
const subTextId = useId();
|
|
1003
|
+
const container = useTemplateRef("editor-container");
|
|
1004
|
+
let editorInstance;
|
|
1005
|
+
const isEditorFocused = ref(false);
|
|
1006
|
+
const headerLabel = computed(() => __props.languageLabel ?? __props.language.toUpperCase());
|
|
1007
|
+
const editorAriaLabel = computed(() => `${headerLabel.value} code editor${__props.readOnly ? ", read-only" : ""}. Press Escape followed by Tab to move focus out of the editor.`);
|
|
1008
|
+
const fillContainer = computed(() => __props.minRows === void 0 && __props.maxRows === void 0);
|
|
1009
|
+
const lineHeight = ref(INITIAL_LINE_HEIGHT);
|
|
1010
|
+
const contentLineCount = ref(1);
|
|
1011
|
+
const editorHeight = computed(() => {
|
|
1012
|
+
if (fillContainer.value) return;
|
|
1013
|
+
const floor = Math.max(__props.minRows ?? 1, 1);
|
|
1014
|
+
const cap = __props.maxRows ?? Infinity;
|
|
1015
|
+
const rows = Math.min(cap, Math.max(floor, contentLineCount.value));
|
|
1016
|
+
return `${lineHeight.value * rows + EXTRA_PADDING}px`;
|
|
1017
|
+
});
|
|
1018
|
+
const codeFont = font.base.code.small;
|
|
1019
|
+
const getMonacoTheme = (isDark) => isDark ? MONACO_THEME_DARK : MONACO_THEME_LIGHT;
|
|
1020
|
+
const { isDarkMode } = useKdsDarkMode();
|
|
1021
|
+
const getEditorInputElement = () => container.value?.querySelector("[role=\"textbox\"]");
|
|
1022
|
+
const syncEditorInputAria = () => {
|
|
1023
|
+
const input = getEditorInputElement();
|
|
1024
|
+
if (!input) return;
|
|
1025
|
+
if (__props.subText) input.setAttribute("aria-describedby", subTextId);
|
|
1026
|
+
else input.removeAttribute("aria-describedby");
|
|
1027
|
+
if (__props.state === kdsCodeEditorState.ERROR) input.setAttribute("aria-invalid", "true");
|
|
1028
|
+
else input.removeAttribute("aria-invalid");
|
|
1029
|
+
};
|
|
1030
|
+
watch([() => __props.subText, () => __props.state], syncEditorInputAria);
|
|
1031
|
+
const { copy, copied } = useClipboard({ copiedDuring: 2e3 });
|
|
1032
|
+
const copyButtonAriaLabel = computed(() => copied.value ? `Copied ${headerLabel.value} to clipboard` : `Copy ${headerLabel.value} to clipboard`);
|
|
1033
|
+
const copyToClipboard = () => {
|
|
1034
|
+
copy(editorInstance?.getModel()?.getValue() ?? "");
|
|
1035
|
+
};
|
|
1036
|
+
onMounted(() => {
|
|
1037
|
+
if (!container.value) return;
|
|
1038
|
+
editorInstance = editor.create(container.value, {
|
|
1039
|
+
value: modelValue.value,
|
|
1040
|
+
language: __props.language,
|
|
1041
|
+
automaticLayout: true,
|
|
1042
|
+
minimap: { enabled: false },
|
|
1043
|
+
overviewRulerLanes: __props.overviewRuler ? DEFAULT_OVERVIEW_RULER_LANES : 0,
|
|
1044
|
+
scrollBeyondLastLine: false,
|
|
1045
|
+
lineNumbersMinChars: 3,
|
|
1046
|
+
fontFamily: `"${codeFont.fontFamily}", monospace`,
|
|
1047
|
+
fontWeight: `${codeFont.fontWeight}`,
|
|
1048
|
+
fontSize: codeFont.fontSize.value,
|
|
1049
|
+
fixedOverflowWidgets: true,
|
|
1050
|
+
scrollbar: { alwaysConsumeMouseWheel: false },
|
|
1051
|
+
readOnly: __props.readOnly,
|
|
1052
|
+
theme: getMonacoTheme(isDarkMode.value),
|
|
1053
|
+
ariaLabel: editorAriaLabel.value,
|
|
1054
|
+
accessibilitySupport: "on"
|
|
1055
|
+
});
|
|
1056
|
+
syncEditorInputAria();
|
|
1057
|
+
lineHeight.value = editorInstance.getOption(editor.EditorOption.lineHeight);
|
|
1058
|
+
contentLineCount.value = editorInstance.getModel()?.getLineCount() ?? 1;
|
|
1059
|
+
editorInstance.onDidChangeModelContent(() => {
|
|
1060
|
+
const value = editorInstance?.getModel()?.getValue() ?? "";
|
|
1061
|
+
contentLineCount.value = editorInstance?.getModel()?.getLineCount() ?? 1;
|
|
1062
|
+
if (value !== modelValue.value) modelValue.value = value;
|
|
1063
|
+
});
|
|
1064
|
+
let tabFocusArmed = false;
|
|
1065
|
+
const setTabFocus = (armed) => {
|
|
1066
|
+
if (tabFocusArmed !== armed) {
|
|
1067
|
+
tabFocusArmed = armed;
|
|
1068
|
+
editorInstance?.updateOptions({ tabFocusMode: armed });
|
|
1069
|
+
}
|
|
1070
|
+
};
|
|
1071
|
+
const tabFocusNeutralKeys = [
|
|
1072
|
+
KeyCode.Tab,
|
|
1073
|
+
KeyCode.Shift,
|
|
1074
|
+
KeyCode.Ctrl,
|
|
1075
|
+
KeyCode.Alt,
|
|
1076
|
+
KeyCode.Meta
|
|
1077
|
+
];
|
|
1078
|
+
editorInstance.onKeyDown((event) => {
|
|
1079
|
+
if (event.keyCode === KeyCode.Escape) setTabFocus(true);
|
|
1080
|
+
else if (!tabFocusNeutralKeys.includes(event.keyCode)) setTabFocus(false);
|
|
1081
|
+
});
|
|
1082
|
+
editorInstance.onDidFocusEditorText(() => {
|
|
1083
|
+
setTabFocus(false);
|
|
1084
|
+
isEditorFocused.value = true;
|
|
1085
|
+
});
|
|
1086
|
+
editorInstance.onDidBlurEditorText(() => {
|
|
1087
|
+
isEditorFocused.value = false;
|
|
1088
|
+
});
|
|
1089
|
+
});
|
|
1090
|
+
watch(isDarkMode, (isDark) => {
|
|
1091
|
+
if (editorInstance) editorInstance.updateOptions({ theme: getMonacoTheme(isDark) });
|
|
1092
|
+
});
|
|
1093
|
+
watch(() => __props.readOnly, (isReadOnly) => {
|
|
1094
|
+
editorInstance?.updateOptions({ readOnly: isReadOnly });
|
|
1095
|
+
});
|
|
1096
|
+
watch(editorAriaLabel, (ariaLabel) => {
|
|
1097
|
+
editorInstance?.updateOptions({ ariaLabel });
|
|
1098
|
+
});
|
|
1099
|
+
watch(() => __props.overviewRuler, (enabled) => {
|
|
1100
|
+
editorInstance?.updateOptions({ overviewRulerLanes: enabled ? DEFAULT_OVERVIEW_RULER_LANES : 0 });
|
|
1101
|
+
});
|
|
1102
|
+
watch(() => __props.language, (newLanguage) => {
|
|
1103
|
+
const model = editorInstance?.getModel();
|
|
1104
|
+
if (model) editor.setModelLanguage(model, newLanguage);
|
|
1105
|
+
});
|
|
1106
|
+
watch(modelValue, (newValue) => {
|
|
1107
|
+
const model = editorInstance?.getModel();
|
|
1108
|
+
if (model && newValue !== model.getValue()) {
|
|
1109
|
+
model.pushStackElement();
|
|
1110
|
+
model.pushEditOperations([], [{
|
|
1111
|
+
range: model.getFullModelRange(),
|
|
1112
|
+
text: newValue ?? ""
|
|
1113
|
+
}], () => null);
|
|
1114
|
+
}
|
|
1115
|
+
});
|
|
1116
|
+
onUnmounted(() => {
|
|
1117
|
+
editorInstance?.dispose();
|
|
1118
|
+
});
|
|
1119
|
+
__expose({
|
|
1120
|
+
/** The underlying Monaco editor instance, available after mount. */
|
|
1121
|
+
getEditor: () => editorInstance });
|
|
1122
|
+
return (_ctx, _cache) => {
|
|
1123
|
+
return openBlock(), createElementBlock("div", { class: normalizeClass(["kds-code-editor", { fill: fillContainer.value }]) }, [createElementVNode("div", { class: normalizeClass([
|
|
1124
|
+
"editor",
|
|
1125
|
+
__props.state,
|
|
1126
|
+
{ focused: isEditorFocused.value }
|
|
1127
|
+
]) }, [!__props.hideHeader ? (openBlock(), createElementBlock("div", _hoisted_1, [createElementVNode("div", _hoisted_2, [createElementVNode("span", _hoisted_3, toDisplayString(headerLabel.value), 1), __props.readOnly === true ? (openBlock(), createElementBlock("span", _hoisted_4, "(Read-only)")) : createCommentVNode("", true)]), createElementVNode("div", _hoisted_5, [(openBlock(true), createElementBlock(Fragment, null, renderList(__props.editorActions, (action, index) => {
|
|
1128
|
+
return openBlock(), createElementBlock(Fragment, { key: `editor-action-${index}` }, [action.type === "button" ? (openBlock(), createBlock(unref(KdsButton), mergeProps({
|
|
1129
|
+
key: 0,
|
|
1130
|
+
ref_for: true
|
|
1131
|
+
}, action.props, {
|
|
1132
|
+
size: "small",
|
|
1133
|
+
onClick: action.onClick
|
|
1134
|
+
}), null, 16, ["onClick"])) : action.type === "toggleButton" ? (openBlock(), createBlock(unref(KdsToggleButton), mergeProps({
|
|
1135
|
+
key: 1,
|
|
1136
|
+
ref_for: true
|
|
1137
|
+
}, action.props, {
|
|
1138
|
+
size: "small",
|
|
1139
|
+
"onUpdate:modelValue": action.onUpdateModelValue
|
|
1140
|
+
}), null, 16, ["onUpdate:modelValue"])) : action.type === "menuButton" ? (openBlock(), createBlock(unref(KdsMenuButton), mergeProps({
|
|
1141
|
+
key: 2,
|
|
1142
|
+
ref_for: true
|
|
1143
|
+
}, action.props, {
|
|
1144
|
+
size: "small",
|
|
1145
|
+
onItemClick: action.onItemClick
|
|
1146
|
+
}), null, 16, ["onItemClick"])) : createCommentVNode("", true)], 64);
|
|
1147
|
+
}), 128)), __props.copyable ? (openBlock(), createBlock(unref(KdsProgressButton), mergeProps({ key: 0 }, { ariaLabel: copyButtonAriaLabel.value }, {
|
|
1148
|
+
"leading-icon": unref(copied) ? "checkmark" : "copy",
|
|
1149
|
+
state: unref(copied) ? "success" : "default",
|
|
1150
|
+
size: "small",
|
|
1151
|
+
variant: "transparent",
|
|
1152
|
+
onClick: copyToClipboard
|
|
1153
|
+
}), null, 16, ["leading-icon", "state"])) : createCommentVNode("", true)])])) : createCommentVNode("", true), createElementVNode("div", {
|
|
1154
|
+
ref: "editor-container",
|
|
1155
|
+
class: "code",
|
|
1156
|
+
style: normalizeStyle(editorHeight.value ? { height: editorHeight.value } : void 0)
|
|
1157
|
+
}, null, 4)], 2), __props.subText ? (openBlock(), createBlock(unref(KdsSubText), {
|
|
1158
|
+
key: 0,
|
|
1159
|
+
id: unref(subTextId),
|
|
1160
|
+
"sub-text": __props.subText,
|
|
1161
|
+
error: __props.state === unref(kdsCodeEditorState).ERROR,
|
|
1162
|
+
warning: __props.state === unref(kdsCodeEditorState).WARNING
|
|
1163
|
+
}, null, 8, [
|
|
1164
|
+
"id",
|
|
1165
|
+
"sub-text",
|
|
1166
|
+
"error",
|
|
1167
|
+
"warning"
|
|
1168
|
+
])) : createCommentVNode("", true)], 2);
|
|
1169
|
+
};
|
|
1170
|
+
}
|
|
1171
|
+
});
|
|
1172
|
+
//#endregion
|
|
1173
|
+
//#region \0plugin-vue:export-helper
|
|
1174
|
+
var _plugin_vue_export_helper_default = (sfc, props) => {
|
|
1175
|
+
const target = sfc.__vccOpts || sfc;
|
|
1176
|
+
for (const [key, val] of props) target[key] = val;
|
|
1177
|
+
return target;
|
|
1178
|
+
};
|
|
1179
|
+
//#endregion
|
|
1180
|
+
//#region src/CodeEditor/KdsCodeEditor.vue
|
|
1181
|
+
var KdsCodeEditor_default = /*#__PURE__*/ _plugin_vue_export_helper_default(KdsCodeEditor_vue_vue_type_script_setup_true_lang_default, [["__scopeId", "data-v-9af67a44"]]);
|
|
1182
|
+
//#endregion
|
|
1183
|
+
export { KdsCodeEditor_default as KdsCodeEditor, kdsCodeEditorState, kdsCodeEditorStates, setupMonacoEnvironment };
|
|
1184
|
+
|
|
1185
|
+
//# sourceMappingURL=index.js.map
|