@mixd-id/web-scaffold 0.1.250801001 → 0.1.250801003
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/package.json +1 -1
- package/src/components/Alert.vue +1 -1
- package/src/components/Confirm.vue +1 -1
- package/src/components/ContextMenu.vue +2 -2
- package/src/components/Dropdown.vue +1 -1
- package/src/components/HTMLEditor.vue +5 -4
- package/src/components/List.vue +5 -2
- package/src/components/MarkdownEdit.vue +128 -0
- package/src/components/MarkdownPreview.vue +102 -0
- package/src/components/Modal.vue +1 -1
- package/src/components/MultilineText.vue +1 -1
- package/src/components/Textbox.vue +1 -1
- package/src/components/TreeView2.vue +4 -3
- package/src/components/TreeViewItem2.vue +11 -7
- package/src/components/VirtualTable.vue +2 -2
- package/src/index.js +2 -0
- package/src/themes/default/index.js +8 -8
- package/src/widgets/PresetBar.vue +1 -1
package/package.json
CHANGED
package/src/components/Alert.vue
CHANGED
|
@@ -204,7 +204,7 @@ export default{
|
|
|
204
204
|
}
|
|
205
205
|
|
|
206
206
|
.alert>*{
|
|
207
|
-
@apply max-h-[60vh] overflow-y-auto bg-base-
|
|
207
|
+
@apply max-h-[60vh] overflow-y-auto bg-base-400 dark:bg-base-300 rounded-xl;
|
|
208
208
|
@apply border-[1px] border-text-50;
|
|
209
209
|
@apply min-w-[280px] max-w-[80vw] md:max-w-[480px];
|
|
210
210
|
}
|
|
@@ -122,7 +122,7 @@ export default{
|
|
|
122
122
|
}
|
|
123
123
|
|
|
124
124
|
.confirm>*{
|
|
125
|
-
@apply max-h-[60vh] overflow-y-auto bg-base-300 rounded-xl;
|
|
125
|
+
@apply max-h-[60vh] overflow-y-auto bg-base-400 dark:bg-base-300 rounded-xl;
|
|
126
126
|
@apply border-[1px] border-text-50;
|
|
127
127
|
@apply min-w-[280px] max-w-[80vw] md:max-w-[480px];
|
|
128
128
|
}
|
|
@@ -241,8 +241,8 @@ export default {
|
|
|
241
241
|
<style module>
|
|
242
242
|
|
|
243
243
|
.contextMenu{
|
|
244
|
-
@apply fixed bg-base-400 min-w-[150px] overflow-y-auto;
|
|
245
|
-
@apply whitespace-nowrap shadow-2xl border-[1px] border-text-
|
|
244
|
+
@apply fixed bg-base-400 dark:bg-base-300 min-w-[150px] overflow-y-auto rounded-lg;
|
|
245
|
+
@apply whitespace-nowrap shadow-2xl border-[1px] border-text-50 mt-[1px];
|
|
246
246
|
z-index: 180;
|
|
247
247
|
}
|
|
248
248
|
|
|
@@ -161,7 +161,7 @@ export default {
|
|
|
161
161
|
|
|
162
162
|
.dropdown{
|
|
163
163
|
@apply flex items-center rounded-lg overflow-hidden cursor-pointer relative;
|
|
164
|
-
@apply border-[1px] border-text-200 bg-base-
|
|
164
|
+
@apply border-[1px] border-text-200 bg-base-300;
|
|
165
165
|
}
|
|
166
166
|
.dropdown:not(.readonly){
|
|
167
167
|
@apply hover:border-text-300;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div :class="$style.comp">
|
|
3
3
|
|
|
4
|
-
<div class="overflow-x-auto bg-
|
|
4
|
+
<div class="overflow-x-auto bg-base-400" :class="containerClass" v-if="!readonly">
|
|
5
5
|
<div class="flex flex-row">
|
|
6
6
|
<button class="p-3" type="button" @click="format('bold')">
|
|
7
7
|
<svg width="14" height="14" class="fill-text-400 hover:fill-primary" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 384 512"><path d="M0 64C0 46.3 14.3 32 32 32H80 96 224c70.7 0 128 57.3 128 128c0 31.3-11.3 60.1-30 82.3c37.1 22.4 62 63.1 62 109.7c0 70.7-57.3 128-128 128H96 80 32c-17.7 0-32-14.3-32-32s14.3-32 32-32H48V256 96H32C14.3 96 0 81.7 0 64zM224 224c35.3 0 64-28.7 64-64s-28.7-64-64-64H112V224H224zM112 288V416H256c35.3 0 64-28.7 64-64s-28.7-64-64-64H224 112z"/></svg>
|
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
<button class="p-3" type="button" @click="removeFormat">
|
|
31
31
|
<svg width="14" height="14" class="fill-text-400 hover:fill-primary" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 384 512"><path d="M342.6 150.6c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0L192 210.7 86.6 105.4c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3L146.7 256 41.4 361.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0L192 301.3 297.4 406.6c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3L237.3 256 342.6 150.6z"/></svg>
|
|
32
32
|
</button>
|
|
33
|
-
<button @click="createTable">Table</button>
|
|
33
|
+
<button @click="createTable" class="text-text-400">Table</button>
|
|
34
34
|
</div>
|
|
35
35
|
</div>
|
|
36
36
|
|
|
@@ -382,6 +382,7 @@ export default{
|
|
|
382
382
|
</tr>
|
|
383
383
|
</table>`);
|
|
384
384
|
|
|
385
|
+
this.$refs.tableModal.close()
|
|
385
386
|
},
|
|
386
387
|
|
|
387
388
|
removeFormat(){
|
|
@@ -553,11 +554,11 @@ export default{
|
|
|
553
554
|
<style module>
|
|
554
555
|
|
|
555
556
|
.comp{
|
|
556
|
-
@apply flex-1 flex flex-col border-[1px] border-text-200 rounded-lg;
|
|
557
|
+
@apply flex-1 flex flex-col border-[1px] border-text-200 rounded-lg overflow-hidden;
|
|
557
558
|
}
|
|
558
559
|
|
|
559
560
|
.comp article {
|
|
560
|
-
@apply min-h-[var(--h-cp)] w-full outline-none p-
|
|
561
|
+
@apply min-h-[var(--h-cp)] w-full outline-none p-3 leading-6 bg-base-300;
|
|
561
562
|
@apply flex-1 overflow-auto;
|
|
562
563
|
}
|
|
563
564
|
|
package/src/components/List.vue
CHANGED
|
@@ -88,14 +88,17 @@
|
|
|
88
88
|
</div>
|
|
89
89
|
|
|
90
90
|
<div class="flex flex-row gap-2 gap-1" v-if="Boolean(toolbar)">
|
|
91
|
-
<Textbox v-if="canSearch"
|
|
91
|
+
<Textbox v-if="canSearch"
|
|
92
|
+
class="flex-1 md:w-[240px] bg-base-400 border-text-50"
|
|
93
|
+
placeholder="Search..."
|
|
94
|
+
clearable="1"
|
|
92
95
|
maxlength="100"
|
|
93
96
|
v-model="preset.search"
|
|
94
97
|
@clear="delete preset.search; load()"
|
|
95
98
|
@keyup.enter="load">
|
|
96
99
|
<template #start>
|
|
97
100
|
<div class="p-2 pr-0">
|
|
98
|
-
<svg width="
|
|
101
|
+
<svg width="14" height="14" class="fill-text-300" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><!--! Font Awesome Pro 6.0.0-alpha3 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) --><path d="M504.1 471l-134-134C399.1 301.5 415.1 256.8 415.1 208c0-114.9-93.13-208-208-208S-.0002 93.13-.0002 208S93.12 416 207.1 416c48.79 0 93.55-16.91 129-45.04l134 134C475.7 509.7 481.9 512 488 512s12.28-2.344 16.97-7.031C514.3 495.6 514.3 480.4 504.1 471zM48 208c0-88.22 71.78-160 160-160s160 71.78 160 160s-71.78 160-160 160S48 296.2 48 208z"/></svg>
|
|
99
102
|
</div>
|
|
100
103
|
</template>
|
|
101
104
|
</Textbox>
|
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div :class="$style.comp">
|
|
3
|
+
<div class="flex flex-row divide-x divide-text-50 px-3">
|
|
4
|
+
<button type="button" class="p-3" @click="addMarkdown('table')">
|
|
5
|
+
<svg width="13" height="13" class="fill-text" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><!--! Font Awesome Pro 6.0.0-alpha3 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) --><path d="M448 32H64.05C28.7 32 .0492 60.65 .0492 96v320c0 35.35 28.65 64 64 64h383.1c35.35 0 64-28.65 64-64V96C512 60.65 483.4 32 448 32zM224 416H64v-96h160V416zM224 256H64V160h160V256zM448 416h-160v-96h160V416zM448 256h-160V160h160V256z"/></svg>
|
|
6
|
+
</button>
|
|
7
|
+
<button type="button" class="p-3" @click="addMarkdown('unordered-list')">
|
|
8
|
+
<svg width="13" height="13" class="fill-text" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><!--! Font Awesome Pro 6.0.0-alpha3 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) --><path d="M48 208C21.49 208 0 229.5 0 256s21.49 48 48 48S96 282.5 96 256S74.51 208 48 208zM48 368C21.49 368 0 389.5 0 416s21.49 48 48 48S96 442.5 96 416S74.51 368 48 368zM48 48C21.49 48 0 69.49 0 96s21.49 48 48 48S96 122.5 96 96S74.51 48 48 48zM192 128h288c17.67 0 32-14.33 32-31.1S497.7 64 480 64H192C174.3 64 160 78.33 160 95.1S174.3 128 192 128zM480 224H192C174.3 224 160 238.3 160 256s14.33 32 32 32h288c17.67 0 32-14.33 32-32S497.7 224 480 224zM480 384H192c-17.67 0-32 14.33-32 32s14.33 32 32 32h288c17.67 0 32-14.33 32-32S497.7 384 480 384z"/></svg>
|
|
9
|
+
</button>
|
|
10
|
+
<button type="button" class="p-3" @click="addMarkdown('ordered-list')">
|
|
11
|
+
<svg width="13" height="13" class="fill-text" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><!--! Font Awesome Pro 6.0.0-alpha3 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) --><path d="M480 224H224C206.3 224 192 238.3 192 256s14.33 32 32 32h256c17.67 0 32-14.33 32-32S497.7 224 480 224zM224 128h256c17.67 0 32-14.33 32-32s-14.33-32-32-32H224C206.3 64 192 78.33 192 96S206.3 128 224 128zM480 384H224c-17.67 0-32 14.33-32 32s14.33 32 32 32h256c17.67 0 32-14.33 32-32S497.7 384 480 384zM40 224h80C133.3 224 144 213.3 144 199.1s-10.75-24-24-24h-16V55.99c0-8.594-4.594-16.53-12.06-20.81C84.5 30.91 75.28 30.95 67.91 35.25l-32 18.67C24.47 60.61 20.59 75.3 27.28 86.75C33.13 96.85 45.31 101.1 56 97.29v78.71h-16c-13.25 0-24 10.75-24 24S26.75 224 40 224zM136.3 432h-49.44l36.4-32.48c29.92-25.83 33.54-71.36 8.049-101.5C118.6 282.1 100.7 273.8 80.89 272.2C61.27 270.7 41.93 276.9 26.92 289.9L14.42 300.7c-10.04 8.656-11.17 23.81-2.527 33.86c8.672 10.06 23.8 11.14 33.78 2.516l12.51-10.79c5.24-4.531 12.1-6.672 18.96-6.156c6.926 .5469 13.2 3.734 17.62 8.969c8.703 10.28 7.486 25.26-3.057 34.36l-83.7 74.67c-7.424 6.625-9.982 17.16-6.457 26.47C5.119 473.8 14.01 480 23.96 480h112.4c13.23 0 23.96-10.75 23.96-23.1C160.3 442.8 149.5 432 136.3 432z"/></svg>
|
|
12
|
+
</button>
|
|
13
|
+
<button type="button" class="p-3" @click="addMarkdown('bold')">
|
|
14
|
+
<svg width="13" height="13" class="fill-text" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 384 512"><!--! Font Awesome Pro 6.0.0-alpha3 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) --><path d="M321.1 242.4C340.1 220.1 352 191.6 352 160c0-70.59-57.42-128-128-128L32 32.01c-17.67 0-32 14.31-32 32s14.33 32 32 32h16v320H32c-17.67 0-32 14.31-32 32s14.33 32 32 32h224c70.58 0 128-57.41 128-128C384 305.3 358.6 264.8 321.1 242.4zM112 96.01H224c35.3 0 64 28.72 64 64s-28.7 64-64 64H112V96.01zM256 416H112v-128H256c35.3 0 64 28.71 64 63.1S291.3 416 256 416z"/></svg>
|
|
15
|
+
</button>
|
|
16
|
+
<button type="button" class="p-3" @click="addMarkdown('italic')">
|
|
17
|
+
<svg width="13" height="13" class="fill-text" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 384 512"><!--! Font Awesome Pro 6.0.0-alpha3 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) --><path d="M384 64.01c0 17.69-14.31 32-32 32h-58.67l-133.3 320H224c17.69 0 32 14.31 32 32s-14.31 32-32 32H32c-17.69 0-32-14.31-32-32s14.31-32 32-32h58.67l133.3-320H160c-17.69 0-32-14.31-32-32s14.31-32 32-32h192C369.7 32.01 384 46.33 384 64.01z"/></svg>
|
|
18
|
+
</button>
|
|
19
|
+
<button type="button" class="p-3" @click="addMarkdown('heading1')">
|
|
20
|
+
<svg width="13" height="13" class="fill-text" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 576 512"><!--! Font Awesome Pro 6.0.0-alpha3 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) --><path d="M544 384h-32v-288c0-11.09-5.75-21.38-15.17-27.22c-9.438-5.844-21.23-6.344-31.14-1.406l-64 32c-15.81 7.906-22.22 27.12-14.31 42.94c7.906 15.78 27.09 22.16 42.94 14.31L448 147.8v236.2h-32c-17.67 0-32 14.31-32 32s14.33 32 32 32h128c17.67 0 32-14.31 32-32S561.7 384 544 384zM288 64.01c-17.67 0-32 14.31-32 32v128H64v-128c0-17.69-14.33-32-32-32s-32 14.31-32 32v320c0 17.69 14.33 32 32 32s32-14.31 32-32v-128h192v128c0 17.69 14.33 32 32 32s32-14.31 32-32v-320C320 78.33 305.7 64.01 288 64.01z"/></svg>
|
|
21
|
+
</button>
|
|
22
|
+
<button type="button" class="p-3" @click="addMarkdown('heading2')">
|
|
23
|
+
<svg width="13" height="13" class="fill-text" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 640 512"><!--! Font Awesome Pro 6.0.0-alpha3 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) --><path d="M608 384h-126l100.4-92.5c51.84-47.75 56.81-127.3 11.3-181.2c-22.75-26.94-54.64-43.28-89.8-46.09c-35.09-2.938-69.25 8.344-95.97 31.38l-25.09 21.59c-13.39 11.53-14.91 31.72-3.375 45.13c11.55 13.38 31.72 14.94 45.13 3.375l25.09-21.59c13.69-11.78 31.05-17.66 49.16-16.06c18 1.438 34.33 9.812 45.98 23.59c23.31 27.56 20.77 68.34-5.781 92.81l-160.7 148c-9.703 8.938-12.94 22.88-8.141 35.16S386.8 448 400 448H608c17.67 0 32-14.31 32-32S625.7 384 608 384zM288 64.01c-17.67 0-32 14.31-32 32v128H64v-128c0-17.69-14.33-32-32-32s-32 14.31-32 32v320c0 17.69 14.33 32 32 32s32-14.31 32-32v-128h192v128c0 17.69 14.33 32 32 32s32-14.31 32-32v-320C320 78.33 305.7 64.01 288 64.01z"/></svg>
|
|
24
|
+
</button>
|
|
25
|
+
<button type="button" class="p-3" @click="addMarkdown('heading3')">
|
|
26
|
+
<svg width="13" height="13" class="fill-text" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 640 512"><!--! Font Awesome Pro 6.0.0-alpha3 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) --><path d="M523.9 211.7l91.03-93.38c8.984-9.219 11.58-22.91 6.578-34.78C616.5 71.73 604.9 64.01 592 64.01l-192-.0778c-17.67 0-32 14.39-32 32.08s14.33 32 32 32h116.1l-91.02 93.34c-8.984 9.219-11.58 22.91-6.578 34.78C423.5 267.1 435.1 275.7 448 275.7h73.84C551.7 275.7 576 299.1 576 329.9s-24.3 54.16-54.16 54.16h-62.53c-13.16 0-24.8-8.375-28.95-20.88c-5.578-16.75-23.69-25.88-40.48-20.22c-16.77 5.594-25.83 23.72-20.23 40.47c12.89 38.66 48.94 64.63 89.67 64.63h62.53C587 448 640 395 640 329.9C640 265.4 588.1 212.8 523.9 211.7zM288 64.01c-17.67 0-32 14.31-32 32v128H64v-128c0-17.69-14.33-32-32-32s-32 14.31-32 32v320c0 17.69 14.33 32 32 32s32-14.31 32-32v-128h192v128c0 17.69 14.33 32 32 32s32-14.31 32-32v-320C320 78.33 305.7 64.01 288 64.01z"/></svg>
|
|
27
|
+
</button>
|
|
28
|
+
</div>
|
|
29
|
+
|
|
30
|
+
<textarea ref="textarea" class="flex-1 outline-none p-6 bg-transparent" :value="modelValue" @keyup="keyUp" />
|
|
31
|
+
</div>
|
|
32
|
+
</template>
|
|
33
|
+
|
|
34
|
+
<script>
|
|
35
|
+
|
|
36
|
+
export default{
|
|
37
|
+
|
|
38
|
+
props: {
|
|
39
|
+
|
|
40
|
+
modelValue: String
|
|
41
|
+
|
|
42
|
+
},
|
|
43
|
+
|
|
44
|
+
methods: {
|
|
45
|
+
|
|
46
|
+
addMarkdown(type){
|
|
47
|
+
let content = ''
|
|
48
|
+
|
|
49
|
+
switch(type){
|
|
50
|
+
|
|
51
|
+
case 'table':
|
|
52
|
+
content = `| Header 1 | Header 2 |\n| -------- | -------- |\n| Cell 1 | Cell 2 |\n| Cell 3 | Cell 4 |\n`;
|
|
53
|
+
break;
|
|
54
|
+
|
|
55
|
+
case 'unordered-list':
|
|
56
|
+
content = `- Item 1\n- Item 2\n- Item 3\n`;
|
|
57
|
+
break;
|
|
58
|
+
|
|
59
|
+
case 'ordered-list':
|
|
60
|
+
content = `1. Item 1\n2. Item 2\n3. Item 3\n`;
|
|
61
|
+
break;
|
|
62
|
+
|
|
63
|
+
case 'bold':
|
|
64
|
+
content = `**Bold Text**`;
|
|
65
|
+
break;
|
|
66
|
+
|
|
67
|
+
case 'italic':
|
|
68
|
+
content = `*Italic Text*`;
|
|
69
|
+
break;
|
|
70
|
+
|
|
71
|
+
case 'heading1':
|
|
72
|
+
content = `# Heading 1\n`;
|
|
73
|
+
break;
|
|
74
|
+
|
|
75
|
+
case 'heading2':
|
|
76
|
+
content = `## Heading 2\n`;
|
|
77
|
+
break;
|
|
78
|
+
|
|
79
|
+
case 'heading3':
|
|
80
|
+
content = `### Heading 3\n`;
|
|
81
|
+
break;
|
|
82
|
+
|
|
83
|
+
case 'line':
|
|
84
|
+
content = `---\n`;
|
|
85
|
+
break;
|
|
86
|
+
|
|
87
|
+
case 'component-template-1':
|
|
88
|
+
content = `#### ⏰ TLDR;
|
|
89
|
+
\`\`\`html
|
|
90
|
+
|
|
91
|
+
\`\`\`
|
|
92
|
+
|
|
93
|
+
\`\`\`javascript
|
|
94
|
+
|
|
95
|
+
\`\`\`
|
|
96
|
+
---
|
|
97
|
+
### Properties
|
|
98
|
+
| Key | Type | Required | Remark |
|
|
99
|
+
| -------- | -------- | -------- | -------- |
|
|
100
|
+
### Events
|
|
101
|
+
| Event | Arguments | Remark |
|
|
102
|
+
| -------- | -------- | -------- |
|
|
103
|
+
`
|
|
104
|
+
break
|
|
105
|
+
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
this.$emit('update:modelValue', this.modelValue + content)
|
|
109
|
+
},
|
|
110
|
+
|
|
111
|
+
keyUp(event){
|
|
112
|
+
this.$emit('update:modelValue', event.target.value)
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
</script>
|
|
120
|
+
|
|
121
|
+
<style module>
|
|
122
|
+
|
|
123
|
+
.comp{
|
|
124
|
+
@apply flex flex-col divide-y divide-text-50 relative;
|
|
125
|
+
@apply border-[1px] border-text-200 bg-base-300 hover:border-text-300 rounded-lg;
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
</style>
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<article v-html="markedText" :class="$style.comp" />
|
|
3
|
+
</template>
|
|
4
|
+
|
|
5
|
+
<script setup>
|
|
6
|
+
|
|
7
|
+
import { computed } from "vue";
|
|
8
|
+
import {marked} from "marked";
|
|
9
|
+
|
|
10
|
+
const { modelValue } = defineProps({
|
|
11
|
+
modelValue: String
|
|
12
|
+
})
|
|
13
|
+
|
|
14
|
+
const renderer = new marked.Renderer();
|
|
15
|
+
|
|
16
|
+
renderer.image = function(args) {
|
|
17
|
+
const { href, title, text, tokens } = args
|
|
18
|
+
|
|
19
|
+
if (/\.(mp4|webm|ogg)$/i.test(href)) {
|
|
20
|
+
return `
|
|
21
|
+
<video controls style="max-width:100%;">
|
|
22
|
+
<source src="${href}" type="video/${href.split('.').pop()}">
|
|
23
|
+
Your browser does not support the video tag.
|
|
24
|
+
</video>`;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
return marked.Renderer.prototype.image.call(this, args);
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
marked.setOptions({
|
|
31
|
+
highlight: function (code, lang) {
|
|
32
|
+
if (lang && hljs.getLanguage(lang)) {
|
|
33
|
+
return hljs.highlight(code, { language: lang }).value
|
|
34
|
+
}
|
|
35
|
+
return hljs.highlightAuto(code).value
|
|
36
|
+
},
|
|
37
|
+
langPrefix: 'hljs language-',
|
|
38
|
+
gfm: true,
|
|
39
|
+
breaks: true,
|
|
40
|
+
})
|
|
41
|
+
|
|
42
|
+
marked.setOptions({ renderer });
|
|
43
|
+
|
|
44
|
+
const markedText = computed(() => {
|
|
45
|
+
return marked.parse(modelValue)
|
|
46
|
+
})
|
|
47
|
+
|
|
48
|
+
</script>
|
|
49
|
+
|
|
50
|
+
<style module>
|
|
51
|
+
|
|
52
|
+
.comp{
|
|
53
|
+
@apply p-6 bg-base-300 overflow-y-auto;
|
|
54
|
+
}
|
|
55
|
+
.comp>*{
|
|
56
|
+
@apply mb-2;
|
|
57
|
+
}
|
|
58
|
+
.comp>h1, .comp>h2, .comp>h3, .comp>h4, .comp>h5, .comp>h6{
|
|
59
|
+
@apply mb-6;
|
|
60
|
+
}
|
|
61
|
+
.comp>* + h1, .comp>* + h2, .comp>* + h3, .comp>* + h4, .comp>* + h5, .comp>* + h6{
|
|
62
|
+
@apply mt-8;
|
|
63
|
+
}
|
|
64
|
+
.comp>hr{
|
|
65
|
+
@apply mt-0 mb-4;
|
|
66
|
+
}
|
|
67
|
+
.comp ol, .comp ul{
|
|
68
|
+
@apply ml-8;
|
|
69
|
+
}
|
|
70
|
+
.comp ol{
|
|
71
|
+
@apply list-decimal;
|
|
72
|
+
}
|
|
73
|
+
.comp ul{
|
|
74
|
+
@apply list-disc;
|
|
75
|
+
}
|
|
76
|
+
.comp strong, .comp label, .comp p, .comp li{
|
|
77
|
+
@apply text-lg;
|
|
78
|
+
}
|
|
79
|
+
.comp table{
|
|
80
|
+
table-layout: fixed;
|
|
81
|
+
border-collapse: collapse;
|
|
82
|
+
}
|
|
83
|
+
.comp th{
|
|
84
|
+
@apply text-left;
|
|
85
|
+
}
|
|
86
|
+
.comp th, .comp td{
|
|
87
|
+
@apply p-2 px-5 border-[1px] border-text-50;
|
|
88
|
+
}
|
|
89
|
+
.comp hr{
|
|
90
|
+
@apply border-text-200 my-4;
|
|
91
|
+
}
|
|
92
|
+
.comp pre{
|
|
93
|
+
@apply rounded-2xl overflow-hidden;
|
|
94
|
+
}
|
|
95
|
+
.comp code{
|
|
96
|
+
@apply !bg-primary-100 p-1 text-sm;
|
|
97
|
+
}
|
|
98
|
+
.comp code *{
|
|
99
|
+
font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace !important;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
</style>
|
package/src/components/Modal.vue
CHANGED
|
@@ -358,7 +358,7 @@ export default{
|
|
|
358
358
|
|
|
359
359
|
.modal{
|
|
360
360
|
@apply fixed;
|
|
361
|
-
@apply bg-base-300 w-full;
|
|
361
|
+
@apply bg-base-400 dark:bg-base-300 w-full;
|
|
362
362
|
@apply border-[1px] border-text-50 flex max-h-[90vh] max-w-full;
|
|
363
363
|
@apply rounded-xl overflow-hidden transition-all;
|
|
364
364
|
z-index: 101;
|
|
@@ -137,7 +137,7 @@ export default{
|
|
|
137
137
|
<style module>
|
|
138
138
|
|
|
139
139
|
.textarea{
|
|
140
|
-
@apply flex items-start border-[1px] border-text-200 bg-base-
|
|
140
|
+
@apply flex items-start border-[1px] border-text-200 bg-base-400 rounded-lg overflow-hidden;
|
|
141
141
|
}
|
|
142
142
|
.textarea textarea{
|
|
143
143
|
@apply flex-1 outline-none p-2 bg-transparent resize-none;
|
|
@@ -182,7 +182,7 @@ export default{
|
|
|
182
182
|
|
|
183
183
|
.textbox{
|
|
184
184
|
@apply flex items-center;
|
|
185
|
-
@apply border-[1px] border-text-200 bg-base-
|
|
185
|
+
@apply border-[1px] border-text-200 bg-base-300 hover:border-text-300 rounded-lg;
|
|
186
186
|
@apply overflow-hidden;
|
|
187
187
|
}
|
|
188
188
|
.textbox.active{
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div :class="$style.comp">
|
|
3
3
|
|
|
4
|
-
<TreeViewItem2 v-for="item in items"
|
|
4
|
+
<TreeViewItem2 v-for="(item, index) in items"
|
|
5
5
|
:item="item"
|
|
6
|
+
:index="index"
|
|
6
7
|
:container-class="containerClass">
|
|
7
|
-
<template #default="{ item }">
|
|
8
|
-
<slot :item="item"></slot>
|
|
8
|
+
<template #default="{ item, index }">
|
|
9
|
+
<slot :item="item" :index="index"></slot>
|
|
9
10
|
</template>
|
|
10
11
|
</TreeViewItem2>
|
|
11
12
|
|
|
@@ -1,18 +1,20 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div :class="$style.comp">
|
|
3
3
|
|
|
4
|
-
<slot name="default" :item="item">
|
|
4
|
+
<slot name="default" :item="item" :index="index">
|
|
5
5
|
<div :class="$style.item">
|
|
6
6
|
<label>{{ item.title }}</label>
|
|
7
7
|
</div>
|
|
8
8
|
</slot>
|
|
9
9
|
|
|
10
|
-
<div v-if="(item.items ?? []).length > 0"
|
|
11
|
-
|
|
10
|
+
<div v-if="(item.items ?? []).length > 0"
|
|
11
|
+
:class="containerClass ?? $style.subitems">
|
|
12
|
+
<TreeViewItem2 v-for="(subItem, index) in item.items"
|
|
12
13
|
:item="subItem"
|
|
14
|
+
:index="index"
|
|
13
15
|
:container-class="containerClass">
|
|
14
|
-
<template #default="{ item }">
|
|
15
|
-
<slot :item="item"></slot>
|
|
16
|
+
<template #default="{ item, index }">
|
|
17
|
+
<slot :item="item" :index="index"></slot>
|
|
16
18
|
</template>
|
|
17
19
|
</TreeViewItem2>
|
|
18
20
|
</div>
|
|
@@ -26,7 +28,9 @@ const { } = defineProps({
|
|
|
26
28
|
|
|
27
29
|
containerClass: String,
|
|
28
30
|
|
|
29
|
-
item: Object
|
|
31
|
+
item: Object,
|
|
32
|
+
|
|
33
|
+
index: Number
|
|
30
34
|
})
|
|
31
35
|
|
|
32
36
|
</script>
|
|
@@ -38,7 +42,7 @@ const { } = defineProps({
|
|
|
38
42
|
}
|
|
39
43
|
|
|
40
44
|
.item{
|
|
41
|
-
@apply bg-
|
|
45
|
+
@apply bg-base-400 hover:bg-base-500;
|
|
42
46
|
}
|
|
43
47
|
|
|
44
48
|
.subitems {
|
package/src/index.js
CHANGED
|
@@ -634,6 +634,8 @@ export default{
|
|
|
634
634
|
app.component('Checkout', defineAsyncComponent(() => import("./components/Checkout.vue")))
|
|
635
635
|
app.component('CheckoutSetting', defineAsyncComponent(() => import("./widgets/CheckoutSetting.vue")))
|
|
636
636
|
app.component('TreeMenu', defineAsyncComponent(() => import("./components/TreeMenu.vue")))
|
|
637
|
+
app.component('MarkdownEdit', defineAsyncComponent(() => import("./components/MarkdownEdit.vue")))
|
|
638
|
+
app.component('MarkdownPreview', defineAsyncComponent(() => import("./components/MarkdownPreview.vue")))
|
|
637
639
|
}
|
|
638
640
|
|
|
639
641
|
}
|
|
@@ -22,8 +22,8 @@ const plugin = Plugin(function({ addBase, addUtilities, config, theme }) {
|
|
|
22
22
|
'--base-500': '255, 255, 255',
|
|
23
23
|
'--base': '255, 255, 255',
|
|
24
24
|
|
|
25
|
-
"--text-50": '
|
|
26
|
-
"--text-100": '
|
|
25
|
+
"--text-50": '233, 233, 233',
|
|
26
|
+
"--text-100": '226, 226, 226',
|
|
27
27
|
"--text-200": '217, 217, 217',
|
|
28
28
|
"--text-300": '176, 176, 176',
|
|
29
29
|
"--text-400": '116, 116, 116',
|
|
@@ -64,13 +64,13 @@ const plugin = Plugin(function({ addBase, addUtilities, config, theme }) {
|
|
|
64
64
|
'html[data-theme="dark"], .html[data-theme="dark"]': {
|
|
65
65
|
|
|
66
66
|
"--base-300": '12, 13, 14',
|
|
67
|
-
"--base-400": '
|
|
68
|
-
"--base-500": '
|
|
67
|
+
"--base-400": '17, 21, 28',
|
|
68
|
+
"--base-500": '27, 31, 39',
|
|
69
69
|
|
|
70
|
-
"--text-50": '
|
|
71
|
-
"--text-100": '
|
|
72
|
-
"--text-200": '
|
|
73
|
-
"--text-300": '
|
|
70
|
+
"--text-50": '28, 34, 41',
|
|
71
|
+
"--text-100": '36, 40, 47',
|
|
72
|
+
"--text-200": '65, 67, 69',
|
|
73
|
+
"--text-300": '81, 82, 83',
|
|
74
74
|
"--text-500": '234, 234, 236',
|
|
75
75
|
"--text": '234, 234, 236',
|
|
76
76
|
|
|
@@ -158,7 +158,7 @@
|
|
|
158
158
|
<slot name="toolbar" :edit="true"></slot>
|
|
159
159
|
</div>
|
|
160
160
|
|
|
161
|
-
<div class="flex items-center justify-center border-b-[1px] border-text-
|
|
161
|
+
<div class="flex items-center justify-center border-b-[1px] border-text-50 px-3">
|
|
162
162
|
<Tabs :items="tabItems[config.type ?? 'list']" v-model="configParams.presetBarTabIndex" />
|
|
163
163
|
</div>
|
|
164
164
|
|