@mixd-id/web-scaffold 0.2.240706 → 0.2.250801010

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 (220) hide show
  1. package/docs/components/Dashboard.md +56 -0
  2. package/log.txt +7 -0
  3. package/package.json +27 -19
  4. package/src/components/404.vue +61 -0
  5. package/src/components/AccountIcon.vue +19 -0
  6. package/src/components/Ahref.vue +1 -1
  7. package/src/components/Alert.vue +4 -13
  8. package/src/components/ArrayList.vue +49 -0
  9. package/src/components/Article.vue +24 -30
  10. package/src/components/Button.vue +83 -169
  11. package/src/components/Card.vue +257 -0
  12. package/src/components/Carousel.vue +61 -60
  13. package/src/components/Cart.vue +192 -0
  14. package/src/components/CartIcon.vue +89 -0
  15. package/src/components/ChartBar.vue +2 -3
  16. package/src/components/Checkbox.vue +20 -11
  17. package/src/components/Checkout.vue +373 -0
  18. package/src/components/CheckoutDelivery.vue +267 -0
  19. package/src/components/CodeEditor.vue +5 -16
  20. package/src/components/CollapsiblePanel.vue +70 -0
  21. package/src/components/ColorPicker.vue +12 -5
  22. package/src/components/ColorPicker2.vue +41 -19
  23. package/src/components/ColorPicker3.vue +100 -0
  24. package/src/components/Confirm.vue +9 -7
  25. package/src/components/ContextMenu.vue +122 -206
  26. package/src/components/ContextMenuItem.vue +53 -0
  27. package/src/components/Dashboard.vue +243 -0
  28. package/src/components/Dashboard2.vue +118 -0
  29. package/src/components/DashboardComponentSelector.vue +96 -0
  30. package/src/components/DashboardConfigs.vue +202 -0
  31. package/src/components/Datepicker.vue +102 -41
  32. package/src/components/DayTimeRange.vue +3 -2
  33. package/src/components/Dropdown.vue +7 -4
  34. package/src/components/Flex.vue +14 -40
  35. package/src/components/GHeatMaps.vue +2 -2
  36. package/src/components/Grid.vue +6 -6
  37. package/src/components/HTMLEditor.vue +27 -14
  38. package/src/components/Image.vue +62 -108
  39. package/src/components/ImagePreview.vue +14 -4
  40. package/src/components/ImageUploader.vue +114 -0
  41. package/src/components/ImportModal.vue +3 -3
  42. package/src/components/Link.vue +62 -6
  43. package/src/components/List.vue +528 -403
  44. package/src/components/ListContextMenu.vue +88 -0
  45. package/src/components/ListItem.vue +6 -4
  46. package/src/components/ListPage1.vue +14 -15
  47. package/src/components/ListView.vue +5 -6
  48. package/src/components/ListViewSettings.vue +2 -2
  49. package/src/components/LogViewerItem.vue +1 -1
  50. package/src/components/MarkdownEdit.vue +128 -0
  51. package/src/components/MarkdownPreview.vue +102 -0
  52. package/src/components/MenuItem1.vue +36 -0
  53. package/src/components/Modal.vue +95 -43
  54. package/src/components/MultiDropdown.vue +124 -0
  55. package/src/components/MultilineText.vue +1 -4
  56. package/src/components/OTPField.vue +40 -26
  57. package/src/components/ObjectTree.vue +1 -1
  58. package/src/components/PageBuilder.vue +3 -3
  59. package/src/components/Paragraph.vue +1 -2
  60. package/src/components/PresetSelectorFilterItem.vue +107 -95
  61. package/src/components/Radio.vue +1 -1
  62. package/src/components/SearchModal.vue +153 -0
  63. package/src/components/Slider.vue +1 -1
  64. package/src/components/Svg.vue +1 -1
  65. package/src/components/SvgEditor.vue +173 -0
  66. package/src/components/Switch.vue +4 -5
  67. package/src/components/Table.vue +2 -2
  68. package/src/components/TableView.vue +2 -3
  69. package/src/components/TableViewHead.vue +2 -2
  70. package/src/components/Tabs.vue +1 -1
  71. package/src/components/Testimonial.vue +2 -2
  72. package/src/components/Text.vue +7 -22
  73. package/src/components/TextEditor.vue +3 -3
  74. package/src/components/TextWithTag.vue +61 -30
  75. package/src/components/Textarea.vue +16 -22
  76. package/src/components/Textbox.vue +9 -19
  77. package/src/components/Timepicker.vue +25 -15
  78. package/src/components/Toast.vue +5 -3
  79. package/src/components/TreeMenu.vue +122 -0
  80. package/src/components/TreeView.vue +15 -10
  81. package/src/components/TreeView2.vue +38 -0
  82. package/src/components/TreeViewItem.vue +58 -29
  83. package/src/components/TreeViewItem2.vue +55 -0
  84. package/src/components/Uploader.vue +45 -0
  85. package/src/components/Video.vue +119 -0
  86. package/src/components/VirtualGrid.vue +24 -7
  87. package/src/components/VirtualTable.vue +363 -128
  88. package/src/configs/dashboard/data-table.js +9 -0
  89. package/src/configs/web-page-builder.js +118 -0
  90. package/src/directives/intersect.js +26 -0
  91. package/src/hooks/device.js +14 -0
  92. package/src/index.js +62 -107
  93. package/src/mixin/component.js +151 -67
  94. package/src/themes/default/index.js +118 -159
  95. package/src/utils/dashboard.js +22 -962
  96. package/src/utils/helpers.cjs +635 -0
  97. package/src/utils/helpers.js +91 -60
  98. package/src/utils/helpers.mjs +245 -12
  99. package/src/utils/importer.js +22 -3
  100. package/src/utils/list.mjs +1509 -0
  101. package/src/utils/preset-selector.cjs +1455 -0
  102. package/src/utils/preset-selector.js +489 -95
  103. package/src/utils/preset-selector.mjs +59 -20
  104. package/src/utils/queue.js +63 -0
  105. package/src/utils/web.mjs +120 -0
  106. package/src/utils/wss.js +38 -36
  107. package/src/utils/wss.mjs +24 -19
  108. package/src/widgets/AhrefSetting.vue +16 -13
  109. package/src/widgets/ArticleSetting.vue +15 -27
  110. package/src/widgets/BackgroundColorSetting.vue +153 -0
  111. package/src/widgets/BorderColorSetting.vue +57 -0
  112. package/src/widgets/BotEditor/BotEditorActions.vue +3 -2
  113. package/src/widgets/BotEditor/BotEditorSettings.vue +21 -0
  114. package/src/widgets/BotEditor.vue +35 -15
  115. package/src/widgets/ButtonSetting.vue +12 -13
  116. package/src/widgets/CarouselSetting.vue +33 -45
  117. package/src/widgets/CartSetting.vue +46 -0
  118. package/src/widgets/CheckoutSetting.vue +46 -0
  119. package/src/widgets/CollapsiblePanelSetting.vue +46 -0
  120. package/src/widgets/ColumnSelector.vue +29 -5
  121. package/src/widgets/ComponentSetting.vue +1 -1
  122. package/src/widgets/ComponentSetting2.vue +145 -236
  123. package/src/widgets/ComponentSetting3.vue +1 -1
  124. package/src/widgets/ContactForm.vue +3 -3
  125. package/src/widgets/ContactFormSetting.vue +41 -30
  126. package/src/widgets/Dashboard/BarChart.vue +47 -11
  127. package/src/widgets/Dashboard/BarChartSetting.vue +1 -1
  128. package/src/widgets/Dashboard/DataTable.vue +125 -0
  129. package/src/widgets/Dashboard/DataTableSetting.vue +243 -0
  130. package/src/widgets/Dashboard/DatasourceSelector.vue +1 -1
  131. package/src/widgets/Dashboard/Doughnut.vue +49 -7
  132. package/src/widgets/Dashboard/DoughnutSetting.vue +2 -2
  133. package/src/widgets/Dashboard/Metric.vue +78 -19
  134. package/src/widgets/Dashboard/MetricSetting.vue +81 -28
  135. package/src/widgets/Dashboard/Pie.vue +55 -6
  136. package/src/widgets/Dashboard/PieSetting.vue +1 -1
  137. package/src/widgets/Dashboard/PolarArea.vue +49 -7
  138. package/src/widgets/Dashboard/PolarAreaSetting.vue +1 -1
  139. package/src/widgets/Dashboard/SharingModal.vue +4 -5
  140. package/src/widgets/Dashboard/ViewSelector.vue +2 -2
  141. package/src/widgets/Dashboard/VirtualTableSetting.vue +121 -184
  142. package/src/widgets/{Dashboard.vue → Dashboard0.vue} +426 -343
  143. package/src/widgets/EmbeddedVideoSetting.vue +7 -5
  144. package/src/widgets/FAQ.vue +16 -3
  145. package/src/widgets/FAQSetting.vue +53 -47
  146. package/src/widgets/FeatureList.vue +3 -0
  147. package/src/widgets/FeatureListSetting.vue +112 -102
  148. package/src/widgets/FlexSetting.vue +83 -106
  149. package/src/widgets/GridSetting.vue +71 -196
  150. package/src/widgets/Header2.vue +34 -71
  151. package/src/widgets/Header2Setting.vue +95 -179
  152. package/src/widgets/HeaderSetting.vue +16 -18
  153. package/src/widgets/IconListSetting.vue +69 -65
  154. package/src/widgets/ImageSetting.vue +33 -60
  155. package/src/widgets/LinkSetting.vue +60 -37
  156. package/src/widgets/LinkSettingModal.vue +173 -0
  157. package/src/widgets/LogViewer.vue +1 -1
  158. package/src/widgets/MarginSetting.vue +2 -2
  159. package/src/widgets/MenuEditor.vue +1 -1
  160. package/src/widgets/MenuItem1Setting.vue +78 -0
  161. package/src/widgets/ModalSetting.vue +42 -44
  162. package/src/widgets/MultiValueSetting.vue +2 -2
  163. package/src/widgets/MultiValueSetting2.vue +78 -45
  164. package/src/widgets/OGSettingModal.vue +103 -0
  165. package/src/widgets/PaddingSetting.vue +2 -2
  166. package/src/widgets/ParagraphSetting.vue +16 -13
  167. package/src/widgets/PositionSetting.vue +209 -0
  168. package/src/widgets/PresetBar.vue +359 -210
  169. package/src/widgets/PresetBarPivot.vue +31 -19
  170. package/src/widgets/PresetSelector.vue +29 -17
  171. package/src/widgets/SearchModalSetting.vue +70 -0
  172. package/src/widgets/Share.vue +1 -2
  173. package/src/widgets/ShareSetting.vue +67 -60
  174. package/src/widgets/StyleSetting.vue +365 -150
  175. package/src/widgets/TestimonialSetting.vue +97 -88
  176. package/src/widgets/TextBlockSetting.vue +16 -13
  177. package/src/widgets/UserActionBuilder/UserActionConsole.vue +30 -10
  178. package/src/widgets/UserActionBuilder/UserActionOutput.vue +2 -2
  179. package/src/widgets/UserActionBuilder/UserActionOutputReply.vue +64 -87
  180. package/src/widgets/UserActionBuilder/UserActionProps.vue +3 -3
  181. package/src/widgets/UserActionBuilder.vue +4 -16
  182. package/src/widgets/WebComponentSelector.vue +15 -11
  183. package/src/widgets/WebLayoutSelector.vue +41 -270
  184. package/src/widgets/WebPageBuilder.vue +1019 -707
  185. package/src/widgets/WebPageBuilder2.vue +7 -7
  186. package/src/widgets/WebPageBuilder4/ButtonSetting.vue +0 -8
  187. package/src/widgets/WebPageBuilder4/CarouselSetting.vue +63 -7
  188. package/src/widgets/WebPageBuilder4/FlexAlignSetting.vue +3 -3
  189. package/src/widgets/WebPageBuilder4/FlexSetting.vue +1 -10
  190. package/src/widgets/WebPageBuilder4/MultiValueSetting.vue +2 -2
  191. package/src/widgets/WebPageBuilder4/PropertySetting.vue +0 -7
  192. package/src/widgets/WebPageBuilder4/WebPageComponentSelector.vue +1 -7
  193. package/src/widgets/WebPageBuilder4.vue +289 -575
  194. package/src/widgets/WebPageSelector.vue +1 -1
  195. package/src/widgets/YoutubeVideoSetting.vue +16 -13
  196. package/tailwind.config.js +3 -35
  197. package/docs/schema/user-action.json +0 -266
  198. package/src/App.vue +0 -25
  199. package/src/components/SearchButton.vue +0 -57
  200. package/src/entry-client.js +0 -27
  201. package/src/entry-server.js +0 -73
  202. package/src/events/event.js +0 -2
  203. package/src/main.js +0 -29
  204. package/src/mixin/website.js +0 -121
  205. package/src/router.js +0 -57
  206. package/src/widgets/MobileMenu.vue +0 -182
  207. package/src/widgets/WebPageBuilder4/ActionSetting.vue +0 -158
  208. package/src/widgets/WebPageBuilder4/ColorSetting.vue +0 -63
  209. package/src/widgets/WebPageBuilder4/DataSetting.vue +0 -92
  210. package/src/widgets/WebPageBuilder4/FontSizeSetting.vue +0 -76
  211. package/src/widgets/WebPageBuilder4/LinkSetting.vue +0 -68
  212. package/src/widgets/WebPageBuilder4/MobileMenuSetting.vue +0 -106
  213. package/src/widgets/WebPageBuilder4/Setting.vue +0 -73
  214. package/src/widgets/WebPageBuilder4/StyleSetting.vue +0 -77
  215. package/src/widgets/WebPageBuilder4/SvgSetting.vue +0 -207
  216. package/src/widgets/WebPageBuilder4/TextTransformSetting.vue +0 -70
  217. package/src/widgets/WebPageBuilder4/WebPageDataEdit.vue +0 -121
  218. package/test.json +0 -22
  219. /package/src/widgets/{Header1.vue → Header0.vue} +0 -0
  220. /package/src/widgets/{Header1Setting.vue → Header0Setting.vue} +0 -0
@@ -0,0 +1,88 @@
1
+ <template>
2
+ <ContextMenu ref="contextMenu" class="mt-1">
3
+ <div class="flex flex-col min-w-[200px]">
4
+
5
+ <div class="p-1 sticky top-0 bg-base-500" @click.stop>
6
+ <Textbox :clearable="true" @clear="search = ''" placeholder="Search or add..." v-model="search" />
7
+ </div>
8
+
9
+ <button v-if="viewedItems.length > 0" v-for="text in viewedItems" class="w-full p-3 text-left flex flex-row menu-item"
10
+ @click="select(text)">
11
+ {{ text }}
12
+ </button>
13
+
14
+ <button v-else-if="search.length > 0" type="button" class="w-full p-3 text-primary" @click="add(search)">
15
+ Tambah {{ search }}
16
+ </button>
17
+
18
+ </div>
19
+ </ContextMenu>
20
+ </template>
21
+
22
+ <script>
23
+ import ContextMenu from "./ContextMenu.vue";
24
+
25
+ export default{
26
+ components: {ContextMenu},
27
+
28
+ emits: [ 'select' ],
29
+
30
+ props: {
31
+ items: Array
32
+ },
33
+
34
+ computed: {
35
+
36
+ viewedItems(){
37
+ return (this.items ?? [])
38
+ .filter(text => {
39
+ return text.toLowerCase().includes(this.search.toLowerCase())
40
+ })
41
+ .sort((a, b) => {
42
+ return a.toLowerCase().localeCompare(b.toLowerCase())
43
+ })
44
+ }
45
+
46
+ },
47
+
48
+ data(){
49
+ return {
50
+ search: '',
51
+ cb: null
52
+ }
53
+ },
54
+
55
+ methods: {
56
+
57
+ add(text){
58
+ if(`${text}`.length < 1) return
59
+
60
+ this.items.push(text)
61
+ this.select(text)
62
+ },
63
+
64
+ select(text){
65
+ this.$emit('select', text)
66
+ if(typeof this.cb === 'function')
67
+ this.cb(text)
68
+ },
69
+
70
+ open(caller, cb){
71
+ this.search = ''
72
+ this.cb = cb
73
+ this.$refs.contextMenu.open(caller)
74
+ }
75
+
76
+ }
77
+
78
+ }
79
+
80
+ </script>
81
+
82
+ <style module>
83
+
84
+ .comp{
85
+
86
+ }
87
+
88
+ </style>
@@ -15,7 +15,6 @@ export default{
15
15
 
16
16
  props: {
17
17
  items: [ Array, Object ],
18
- bodyClass: String,
19
18
  containerClass: String,
20
19
  },
21
20
 
@@ -24,7 +23,7 @@ export default{
24
23
  computed: {
25
24
 
26
25
  computedContainerClass(){
27
- return this.containerClass ?? this.bodyClass
26
+ return this.containerClass ?? this.$style.container
28
27
  }
29
28
 
30
29
  },
@@ -117,7 +116,7 @@ export default{
117
116
  this.$el.querySelectorAll('[data-reorder]').forEach((comp) => {
118
117
  if(comp.closest(`.${this.$style.comp}`) === this.$el){
119
118
  comp.addEventListener('mousedown', this.onDrag)
120
- comp.addEventListener('touchstart', this.onDrag)
119
+ comp.addEventListener('touchstart', this.onDrag, { passive:true })
121
120
  }
122
121
  })
123
122
  }
@@ -144,13 +143,16 @@ export default{
144
143
  <style module>
145
144
 
146
145
  .comp{
147
- @apply bg-base-500;
148
146
  }
149
147
 
150
148
  .comp .dragover{
151
149
  @apply opacity-50
152
150
  }
153
151
 
152
+ .container{
153
+ @apply flex flex-col gap-1;
154
+ }
155
+
154
156
  .comp [data-reorder]{
155
157
  @apply cursor-move;
156
158
  }
@@ -29,7 +29,7 @@
29
29
  </div>
30
30
  <div :class="$style.optArea">
31
31
  <Dropdown class="w-[150px]" :value="preset.name" mode="custom" position="bottom-right">
32
- <div class="min-w-[240px] divide-y divide-text-50 p-2 flex flex-col gap-2">
32
+ <div class="min-w-[240px] divide-y divide-border-50 p-2 flex flex-col gap-2">
33
33
  <div v-for="(_preset, idx) in configs.presets" class="cursor-pointer flex flex-row hover:bg-primary-100 rounded-md">
34
34
  <div class="flex-1 p-3" @click="selectPreset(_preset)">
35
35
  {{ _preset.name }}
@@ -37,14 +37,14 @@
37
37
  </div>
38
38
  </div>
39
39
  </Dropdown>
40
- <button class="border-[1px] border-text-200 bg-base-50 hover:border-text-300 rounded-lg p-3"
40
+ <button class="border-[1px] border-border-200 bg-base-300 hover:border-border-300 rounded-lg p-3"
41
41
  @click="openPreset(presetIdx)">
42
42
  <svg width="15" height="15" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512" class="fill-text-300 hover:fill-primary"><!--! Font Awesome Pro 6.3.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2023 Fonticons, Inc. --><path d="M64 256V160H224v96H64zm0 64H224v96H64V320zm224 96V320H448v96H288zM448 256H288V160H448v96zM64 32C28.7 32 0 60.7 0 96V416c0 35.3 28.7 64 64 64H448c35.3 0 64-28.7 64-64V96c0-35.3-28.7-64-64-64H64z"/></svg>
43
43
  </button>
44
44
  </div>
45
45
  </div>
46
46
 
47
- <div class="flex-1 mb-4 flex flex-col bg-base-500 border-text-50 border-[1px] relative" v-if="presetSummary && !isLoading">
47
+ <div class="flex-1 mb-4 flex flex-col bg-base-500 border-border-50 border-[1px] relative" v-if="presetSummary && !isLoading">
48
48
  <div v-if="isSummaryLoading" :class="$style.overlay">
49
49
  <svg class="animate-spin aspect-square w-[48px] h-[48px] text-primary" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24"><circle class="opacity-25" cx="12" cy="12" r="10" stroke="currentColor" stroke-width="4"></circle><path class="opacity-75" fill="currentColor" d="M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"></path></svg>
50
50
  </div>
@@ -140,7 +140,7 @@
140
140
  </div>
141
141
  </ContextMenu>
142
142
 
143
- <div v-if="count > 0 && !summaryTeleport" class="flex flex-row bg-base-500 divide-x divide-text-50 border-[1px] border-text-50">
143
+ <div v-if="count > 0 && !summaryTeleport" class="flex flex-row bg-base-500 divide-x divide-border-50 border-[1px] border-border-50">
144
144
  <div class="p-2 px-3 text-text-400">
145
145
  Count: {{ count }}
146
146
  </div>
@@ -154,7 +154,7 @@
154
154
 
155
155
  </div>
156
156
 
157
- <div v-if="configs.presetOpen" class="w-[360px] border-l-[1px] border-text-50 bg-base-500 flex flex-col">
157
+ <div v-if="configs.presetOpen" class="w-[360px] border-l-[1px] border-border-50 bg-base-500 flex flex-col">
158
158
 
159
159
  <div v-if="configs.presetOpenIdx === -1" class="flex-1 flex flex-col">
160
160
 
@@ -163,9 +163,9 @@
163
163
  <br />
164
164
  </div>
165
165
 
166
- <div class="flex-1 overflow-y-auto border-t-[1px] border-text-50">
166
+ <div class="flex-1 overflow-y-auto border-t-[1px] border-border-50">
167
167
  <div v-for="(preset, idx) in configs.presets"
168
- class="px-6 py-3 flex flex-row gap-2 items-center border-b-[1px] border-text-50 hover:bg-text-50 cursor-pointer">
168
+ class="px-6 py-3 flex flex-row gap-2 items-center border-b-[1px] border-border-50 hover:bg-text-50 cursor-pointer">
169
169
  <div class="px-2">
170
170
  <Checkbox :checked="idx === configs.presetIdx" @change="selectPreset(preset)" />
171
171
  </div>
@@ -294,7 +294,7 @@
294
294
 
295
295
  <div v-if="configs.summaryOpenIdx === -1">
296
296
  <div v-for="(summary, idx) in preset.summaries">
297
- <div class="flex flex-row items-center gap-3 border-text-50 border-[1px] p-2 rounded-lg">
297
+ <div class="flex flex-row items-center gap-3 border-border-50 border-[1px] p-2 rounded-lg">
298
298
  <div class="px-2">
299
299
  <Checkbox v-model="summary.enabled" @change="enableSummary(idx)" />
300
300
  </div>
@@ -555,8 +555,7 @@
555
555
 
556
556
  import throttle from "lodash/throttle";
557
557
  import {urlQuery} from "../utils/helpers.mjs";
558
- import { Bar, Line } from 'vue-chartjs'
559
- import Chart from 'chart.js/auto'
558
+ import {Bar, Line} from 'vue-chartjs'
560
559
  import dayjs from "dayjs";
561
560
  import VirtualTable from "./VirtualTable.vue";
562
561
 
@@ -618,7 +617,7 @@ export default{
618
617
  presetAppearances(){
619
618
  return this.preset.appearances ?? {}
620
619
  },
621
-
620
+
622
621
  presetSortedColumns(){
623
622
  const c = {};
624
623
  (this.preset.sorts ?? []).forEach((_) => c[_.key] = _.type);
@@ -630,7 +629,7 @@ export default{
630
629
  return this.preset.filters.filter((_) => _.key === this.selectedColumn)
631
630
  },
632
631
 
633
-
632
+
634
633
  computedDataSource(){
635
634
  return this.datasource ?? this.model
636
635
  },
@@ -640,7 +639,7 @@ export default{
640
639
  this.presetSummary.title :
641
640
  this.title
642
641
  },
643
-
642
+
644
643
 
645
644
  headerSlots(){
646
645
  const slots = {}
@@ -1387,10 +1386,10 @@ export default{
1387
1386
  }
1388
1387
 
1389
1388
  .vscroll{
1390
- @apply flex-1 flex border-t-[1px] border-b-[1px] border-text-50;
1389
+ @apply flex-1 flex border-t-[1px] border-b-[1px] border-border-50;
1391
1390
  }
1392
1391
  .vscroll>*>*{
1393
- @apply bg-base-500 divide-y divide-text-50;
1392
+ @apply bg-base-500 divide-y divide-border-50;
1394
1393
  }
1395
1394
 
1396
1395
  .optArea{
@@ -21,7 +21,7 @@
21
21
  <h4 class="flex-1">Select Preset</h4>
22
22
  <button type="button" class="text-primary" @click="openPreset">Settings</button>
23
23
  </div>
24
- <div class="border-text-50 border-[1px] divide-y divide-text-50 bg-base-400 rounded-lg overflow-hidden">
24
+ <div class="border-border-50 border-[1px] divide-y divide-border-50 bg-base-400 rounded-lg overflow-hidden">
25
25
  <button type="button" v-for="(preset, idx) in config.presets"
26
26
  class="p-3 text-left hover:bg-primary hover:text-white block w-full"
27
27
  @click="selectPreset(idx)">
@@ -45,7 +45,7 @@
45
45
  </div>
46
46
  </template>
47
47
  <template #foot>
48
- <div class="p-6 py-4 border-t-[1px] border-text-50">
48
+ <div class="p-6 py-4 border-t-[1px] border-border-50">
49
49
  <Button class="w-full md:w-[90px]" @click="applyPreset">Apply</Button>
50
50
  </div>
51
51
  </template>
@@ -77,7 +77,7 @@
77
77
  </div>
78
78
  </div>
79
79
 
80
- <div v-if="$device.media === ''" class="px-6 pb-4 border-b-[1px] border-text-50 bg-base-400 dark:bg-base-300">
80
+ <div v-if="$device.media === ''" class="px-6 pb-4 border-b-[1px] border-border-50 bg-base-400 dark:bg-base-300">
81
81
  <Textbox :placeholder="$t('Search...')" :clearable="true" @clear="clearSearch" v-model="preset.search"
82
82
  @keyup.enter="load" :class="$style.searchBox2">
83
83
  <template #start>
@@ -209,8 +209,7 @@
209
209
  <script>
210
210
 
211
211
  import throttle from "lodash/throttle";
212
- import { Bar, Line } from 'vue-chartjs'
213
- import Chart from 'chart.js/auto'
212
+ import {Bar, Line} from 'vue-chartjs'
214
213
  import dayjs from "dayjs";
215
214
 
216
215
  export default{
@@ -956,7 +955,7 @@ export default{
956
955
  }
957
956
 
958
957
  .mobileItem{
959
- @apply p-3 border-[1px] border-text-100 bg-base-300 rounded-lg;
958
+ @apply p-3 border-[1px] border-border-100 bg-base-300 rounded-lg;
960
959
  }
961
960
 
962
961
  </style>
@@ -1,6 +1,6 @@
1
1
  <template>
2
2
  <div :class="styleComp">
3
- <div class="border-r-[1px] border-text-50 bg-base-400">
3
+ <div class="border-r-[1px] border-border-50 bg-base-400">
4
4
 
5
5
  <div class="p-6 flex flex-row">
6
6
  <h3 class="md:flex-1">Presets</h3>
@@ -152,7 +152,7 @@
152
152
 
153
153
  <div v-if="config.summaryOpenIdx === -1">
154
154
 
155
- <div class="border-text-50 border-[1px] rounded-lg overflow-hidden divide-y divide-text-50">
155
+ <div class="border-border-50 border-[1px] rounded-lg overflow-hidden divide-y divide-border-50">
156
156
  <div v-for="(summary, idx) in preset.summaries">
157
157
  <div class="flex flex-row items-center gap-3 px-2">
158
158
  <div class="p-2">
@@ -110,7 +110,7 @@ export default{
110
110
  }
111
111
 
112
112
  .container{
113
- @apply ml-3 flex flex-col divide-y divide-text-50;
113
+ @apply ml-3 flex flex-col divide-y divide-border-50;
114
114
  }
115
115
 
116
116
  </style>
@@ -0,0 +1,128 @@
1
+ <template>
2
+ <div :class="$style.comp">
3
+ <div class="flex flex-row divide-x divide-border-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-border-50 relative;
125
+ @apply border-[1px] border-border-200 bg-base-300 hover:border-border-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-border-50;
88
+ }
89
+ .comp hr{
90
+ @apply border-border-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>
@@ -0,0 +1,36 @@
1
+ <template>
2
+ <div :class="$style.comp">
3
+
4
+ <div v-for="obj in menu" :class="$style.rootMenu">
5
+ {{ obj.text }}
6
+ </div>
7
+
8
+ </div>
9
+ </template>
10
+
11
+ <script setup>
12
+
13
+ import {defineComponent} from "vue";
14
+ import {componentMixin} from "../mixin/component";
15
+
16
+ defineComponent({
17
+ mixins: [componentMixin],
18
+ });
19
+
20
+ const { menu } = defineProps({
21
+ menu: Array
22
+ })
23
+
24
+ </script>
25
+
26
+ <style module>
27
+
28
+ .comp {
29
+ @apply flex flex-row gap-2;
30
+ }
31
+
32
+ .rootMenu{
33
+ @apply p-3;
34
+ }
35
+
36
+ </style>