@mixd-id/web-scaffold 0.2.240705 → 0.2.250801009

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 +79 -167
  11. package/src/components/Card.vue +235 -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 +8 -3
  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 +524 -402
  44. package/src/components/ListContextMenu.vue +88 -0
  45. package/src/components/ListItem.vue +5 -3
  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 +11 -17
  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 +11 -16
  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 +147 -67
  94. package/src/themes/default/index.js +83 -155
  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 +37 -29
  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 +112 -234
  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 +227 -116
  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 +693 -704
  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
@@ -1,86 +1,93 @@
1
1
  <template>
2
2
  <div :class="$style.comp">
3
- <div>
4
- <label class="text-text-400">Title</label>
5
- <Textbox v-model="item.props.title" class="mt-1" />
6
- </div>
7
-
8
- <div>
9
- <label class="text-text-400">Description</label>
10
- <Textarea v-model="item.props.description" rows="3" class="mt-1" />
11
- </div>
12
-
13
- <div>
14
- <div class="flex flex-row items-center">
15
- <label class="text-text-400 flex-1">Testimonials</label>
16
- <button type="button" class="text-primary" @click="$refs.modal.open({ createdAt:'2023-01-01' })">Add</button>
17
- </div>
18
- <ListItem :items="items"
19
- @reorder="(from, to) => { items.splice(to, 0, items.splice(from, 1)[0]); $emit('change') }">
20
- <template v-slot="{ item, index }">
21
- <div class="flex flex-row items-center gap-3 cursor-pointer">
22
- <div data-reorder>
23
- <svg width="14" height="14" class="fill-text-300" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><path d="M496 288H16c-8.8 0-16 7.2-16 16v32c0 8.8 7.2 16 16 16h480c8.8 0 16-7.2 16-16v-32c0-8.8-7.2-16-16-16zm0-128H16c-8.8 0-16 7.2-16 16v32c0 8.8 7.2 16 16 16h480c8.8 0 16-7.2 16-16v-32c0-8.8-7.2-16-16-16z"/></svg>
24
- </div>
25
- <div class="flex-1 p-2" @click="$refs.modal.open(item)">
26
- <p class="line-clamp-2">
27
- {{ item.text }}
28
- </p>
29
- </div>
30
- <div>
31
- <button type="button" @click="confirm($t('Remove this item?'), '', () => { items.splice(index, 1); $emit('change') })">
32
- <svg width="16" height="16" class="fill-text-300 hover:fill-red-500" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 320 512"><path d="M207.6 256l107.72-107.72c6.23-6.23 6.23-16.34 0-22.58l-25.03-25.03c-6.23-6.23-16.34-6.23-22.58 0L160 208.4 52.28 100.68c-6.23-6.23-16.34-6.23-22.58 0L4.68 125.7c-6.23 6.23-6.23 16.34 0 22.58L112.4 256 4.68 363.72c-6.23 6.23-6.23 16.34 0 22.58l25.03 25.03c6.23 6.23 16.34 6.23 22.58 0L160 303.6l107.72 107.72c6.23 6.23 16.34 6.23 22.58 0l25.03-25.03c6.23-6.23 6.23-16.34 0-22.58L207.6 256z"/></svg>
33
- </button>
34
- </div>
35
- </div>
36
- </template>
37
- </ListItem>
38
- </div>
39
-
40
- <Modal ref="modal" width="360" height="420">
41
- <template v-slot:head>
42
- <div class="relative p-5">
43
- <h3>Add Testimonial</h3>
44
- <div class="absolute top-0 right-0 p-2">
45
- <button type="button" class="p-2" @click="$refs.modal.close()">
46
- <svg width="24" height="24" viewBox="0 0 24 24" class="fill-text-300 hover:fill-red-500" xmlns="http://www.w3.org/2000/svg">
47
- <path d="M6.53034 5.46965C6.23745 5.17676 5.76257 5.17676 5.46968 5.46965C5.17679 5.76255 5.17679 6.23742 5.46968 6.53031L10.9393 12L5.46967 17.4697C5.17678 17.7626 5.17678 18.2374 5.46967 18.5303C5.76256 18.8232 6.23744 18.8232 6.53033 18.5303L12 13.0606L17.4697 18.5303C17.7626 18.8232 18.2375 18.8232 18.5303 18.5303C18.8232 18.2374 18.8232 17.7626 18.5303 17.4697L13.0607 12L18.5303 6.53032C18.8232 6.23743 18.8232 5.76256 18.5303 5.46966C18.2374 5.17677 17.7626 5.17677 17.4697 5.46966L12 10.9393L6.53034 5.46965Z"/>
48
- </svg>
49
- </button>
50
- </div>
51
- </div>
52
- </template>
53
- <template v-slot:foot="{ context }">
54
- <div class="p-6">
55
- <Button @click="apply(context)"
56
- :state="!context.text || !context.name || !context.createdAt ? -1 : 1"
57
- class="w-full">Add Testimonial</Button>
58
- </div>
59
- </template>
60
- <template #default="{ context }">
61
- <div class="flex-1 p-6 flex flex-col gap-6">
62
- <Textarea v-model="context.text" rows="5" placeholder="Text"></Textarea>
63
- <div class="flex flex-row gap-4 items-center">
64
- <Image ref="image" class="w-[64px] aspect-square rounded-full bg-text-50"
65
- :src="imageSrc(context.imageUrl)"
66
- :editable="true"
67
- @click="$refs.image.edit()"
68
- @change="(base64, file) => context.imageUrl = file"/>
69
- <div class="flex-1 flex flex-col gap-1">
70
- <Textbox v-model="context.name" placeholder="Name" />
71
- <Datepicker v-model="context.createdAt" placeholder="Time" mode="popup" />
72
- </div>
73
- </div>
74
- </div>
75
- </template>
76
- </Modal>
77
-
78
-
79
- <ComponentSetting :item="item"
80
- :view-type="viewType"
81
- :view-types="viewTypes"
82
- default-display="block"
83
- @change="$emit('change')" />
3
+
4
+ <div class="p-6 py-4 flex flex-col gap-4">
5
+ <div>
6
+ <label class="text-text-400">Title</label>
7
+ <Textbox v-model="item.props.title" class="mt-1" />
8
+ </div>
9
+
10
+ <div>
11
+ <label class="text-text-400">Description</label>
12
+ <Textarea v-model="item.props.description" rows="3" class="mt-1" />
13
+ </div>
14
+
15
+ <div>
16
+ <div class="flex flex-row items-center">
17
+ <label class="text-text-400 flex-1">Testimonials</label>
18
+ <button type="button" class="text-primary" @click="$refs.modal.open({ createdAt:'2023-01-01' })">Add</button>
19
+ </div>
20
+ <ListItem :items="items"
21
+ class="bg-base-300 border-border-200 border-[1px] rounded-lg overflow-hidden"
22
+ container-class="divide-y divide-border-50"
23
+ @reorder="(from, to) => { items.splice(to, 0, items.splice(from, 1)[0]); $emit('change') }">
24
+ <template v-slot="{ item, index }">
25
+ <div class="flex flex-row items-center gap-3 cursor-pointer px-3">
26
+ <div data-reorder>
27
+ <svg width="14" height="14" class="fill-text-300" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><path d="M496 288H16c-8.8 0-16 7.2-16 16v32c0 8.8 7.2 16 16 16h480c8.8 0 16-7.2 16-16v-32c0-8.8-7.2-16-16-16zm0-128H16c-8.8 0-16 7.2-16 16v32c0 8.8 7.2 16 16 16h480c8.8 0 16-7.2 16-16v-32c0-8.8-7.2-16-16-16z"/></svg>
28
+ </div>
29
+ <div class="flex-1 p-2" @click="$refs.modal.open(item)">
30
+ <p class="line-clamp-2">
31
+ {{ item.text }}
32
+ </p>
33
+ </div>
34
+ <div>
35
+ <button type="button" @click="confirm($t('Remove this item?'), '', () => { items.splice(index, 1); $emit('change') })">
36
+ <svg width="16" height="16" class="fill-text-300 hover:fill-red-500" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 320 512"><path d="M207.6 256l107.72-107.72c6.23-6.23 6.23-16.34 0-22.58l-25.03-25.03c-6.23-6.23-16.34-6.23-22.58 0L160 208.4 52.28 100.68c-6.23-6.23-16.34-6.23-22.58 0L4.68 125.7c-6.23 6.23-6.23 16.34 0 22.58L112.4 256 4.68 363.72c-6.23 6.23-6.23 16.34 0 22.58l25.03 25.03c6.23 6.23 16.34 6.23 22.58 0L160 303.6l107.72 107.72c6.23 6.23 16.34 6.23 22.58 0l25.03-25.03c6.23-6.23 6.23-16.34 0-22.58L207.6 256z"/></svg>
37
+ </button>
38
+ </div>
39
+ </div>
40
+ </template>
41
+ </ListItem>
42
+ </div>
43
+ </div>
44
+
45
+
46
+ <ComponentSetting2 :item="item"
47
+ :view-type="viewType"
48
+ :view-types="viewTypes"
49
+ :view-index="viewIndex"
50
+ defaultDisplay="block"
51
+ @change="$emit('change')" />
52
+
53
+ <Modal ref="modal" width="360" height="420">
54
+ <template v-slot:head>
55
+ <div class="relative p-5">
56
+ <h3>Add Testimonial</h3>
57
+ <div class="absolute top-0 right-0 p-2">
58
+ <button type="button" class="p-2" @click="$refs.modal.close()">
59
+ <svg width="24" height="24" viewBox="0 0 24 24" class="fill-text-300 hover:fill-red-500" xmlns="http://www.w3.org/2000/svg">
60
+ <path d="M6.53034 5.46965C6.23745 5.17676 5.76257 5.17676 5.46968 5.46965C5.17679 5.76255 5.17679 6.23742 5.46968 6.53031L10.9393 12L5.46967 17.4697C5.17678 17.7626 5.17678 18.2374 5.46967 18.5303C5.76256 18.8232 6.23744 18.8232 6.53033 18.5303L12 13.0606L17.4697 18.5303C17.7626 18.8232 18.2375 18.8232 18.5303 18.5303C18.8232 18.2374 18.8232 17.7626 18.5303 17.4697L13.0607 12L18.5303 6.53032C18.8232 6.23743 18.8232 5.76256 18.5303 5.46966C18.2374 5.17677 17.7626 5.17677 17.4697 5.46966L12 10.9393L6.53034 5.46965Z"/>
61
+ </svg>
62
+ </button>
63
+ </div>
64
+ </div>
65
+ </template>
66
+ <template v-slot:foot="{ context }">
67
+ <div class="p-6">
68
+ <Button @click="apply(context)"
69
+ :state="!context.text || !context.name || !context.createdAt ? -1 : 1"
70
+ class="w-full">Add Testimonial</Button>
71
+ </div>
72
+ </template>
73
+ <template #default="{ context }">
74
+ <div class="flex-1 p-6 flex flex-col gap-6">
75
+ <Textarea v-model="context.text" rows="5" placeholder="Text"></Textarea>
76
+ <div class="flex flex-row gap-4 items-center">
77
+ <Image ref="image" class="w-[64px] aspect-square rounded-full bg-text-50"
78
+ :src="imageSrc(context.imageUrl)"
79
+ :editable="true"
80
+ @click="$refs.image.edit()"
81
+ @change="(base64, file) => context.imageUrl = file"/>
82
+ <div class="flex-1 flex flex-col gap-1">
83
+ <Textbox v-model="context.name" placeholder="Name" />
84
+ <Datepicker v-model="context.createdAt" placeholder="Time" mode="popup" />
85
+ </div>
86
+ </div>
87
+ </div>
88
+ </template>
89
+ </Modal>
90
+
84
91
  </div>
85
92
  </template>
86
93
 
@@ -117,14 +124,16 @@ export default{
117
124
 
118
125
  props: {
119
126
 
120
- item: {
121
- type: Object,
122
- required: true
123
- },
127
+ item: {
128
+ type: Object,
129
+ required: true
130
+ },
131
+
132
+ viewType: String,
124
133
 
125
- viewType: String,
134
+ viewIndex: Number,
126
135
 
127
- viewTypes: Array,
136
+ viewTypes: Array,
128
137
 
129
138
  },
130
139
 
@@ -146,7 +155,7 @@ export default{
146
155
  <style module>
147
156
 
148
157
  .comp{
149
- @apply flex flex-col gap-4;
158
+ @apply flex flex-col divide-y divide-border-50;
150
159
  }
151
160
 
152
161
  </style>
@@ -1,7 +1,7 @@
1
1
  <template>
2
2
  <div :class="$style.comp">
3
3
 
4
- <div class="flex flex-col gap-4">
4
+ <div class="p-6 py-4 flex flex-col gap-4">
5
5
  <div>
6
6
  <label class="text-text-400">Text</label>
7
7
  <Textbox v-model="item.props.text"
@@ -26,11 +26,12 @@
26
26
  </div>
27
27
  </div>
28
28
 
29
- <ComponentSetting :item="item"
30
- :view-type="viewType"
31
- :view-types="viewTypes"
32
- default-display="block"
33
- @change="apply" />
29
+ <ComponentSetting2 :item="item"
30
+ :view-type="viewType"
31
+ :view-types="viewTypes"
32
+ :view-index="viewIndex"
33
+ defaultDisplay="block"
34
+ @change="$emit('change')" />
34
35
  </div>
35
36
  </template>
36
37
 
@@ -42,14 +43,16 @@ export default{
42
43
 
43
44
  props: {
44
45
 
45
- item: {
46
- type: Object,
47
- required: true
48
- },
46
+ item: {
47
+ type: Object,
48
+ required: true
49
+ },
49
50
 
50
- viewType: String,
51
+ viewType: String,
51
52
 
52
- viewTypes: Array,
53
+ viewIndex: Number,
54
+
55
+ viewTypes: Array,
53
56
 
54
57
  },
55
58
 
@@ -72,7 +75,7 @@ export default{
72
75
  <style module>
73
76
 
74
77
  .comp{
75
- @apply flex flex-col gap-8;
78
+ @apply flex flex-col divide-y divide-border-50
76
79
  }
77
80
 
78
81
  </style>
@@ -1,6 +1,14 @@
1
1
  <template>
2
2
  <div class="flex flex-col relative">
3
3
 
4
+ <div class="p-3 flex flex-row items-start gap-3">
5
+ <div class="flex-1">
6
+ <h5>Simulation</h5>
7
+ </div>
8
+ <button type="button" class="text-primary" @click="reset">Reset</button>
9
+ <button type="button" class="text-primary" @click="clear">Clear</button>
10
+ </div>
11
+
4
12
  <div class="flex-1 overflow-y-auto flex flex-col-reverse px-3 gap-2">
5
13
  <div v-for="_message in reversedMessages"
6
14
  class="p-1 bg-text-50 self-start"
@@ -9,14 +17,9 @@
9
17
  </div>
10
18
  </div>
11
19
 
12
- <div class="absolute top-0 right-0 p-3">
13
- <button type="button" class="text-primary" @click="clear">Clear</button>
14
- </div>
15
-
16
- <div class="p-2 flex flex-row gap-2">
20
+ <div class="p-3 flex flex-row gap-2">
17
21
  <Textbox v-model="message.body" class="flex-1" />
18
22
  <Button class="px-4" @click="send">Send</Button>
19
- <Button class="px-3" variant="secondary" @click="reset">Reset</Button>
20
23
  </div>
21
24
  </div>
22
25
  </template>
@@ -25,7 +28,7 @@
25
28
 
26
29
  export default{
27
30
 
28
- emits: [ 'test-message', 'test-reset' ],
31
+ inject: [ 'getUser', 'socket' ],
29
32
 
30
33
  computed: {
31
34
 
@@ -38,7 +41,8 @@ export default{
38
41
  data(){
39
42
  return {
40
43
  message: {},
41
- messages: []
44
+ messages: [],
45
+ context: null,
42
46
  }
43
47
  },
44
48
 
@@ -53,15 +57,31 @@ export default{
53
57
  },
54
58
 
55
59
  reset(){
56
- this.$emit('test-reset')
60
+ this.context = {}
57
61
  },
58
62
 
59
63
  send(){
60
- this.$emit('test-message', this.message)
64
+ this.socket.send(`${this.controller}.test-message`, {
65
+ userId: this.getUser().id,
66
+ message: this.message,
67
+ context: this.context
68
+ })
69
+ .then(res => {
70
+ this.context = res.context ?? this.context
71
+ if(res.message)
72
+ this.messages.push(res.message)
73
+ })
74
+
61
75
  this.messages.push(this.message)
62
76
  this.message = {}
63
77
  },
64
78
 
79
+ },
80
+
81
+ props: {
82
+
83
+ controller: String
84
+
65
85
  }
66
86
 
67
87
  }
@@ -8,7 +8,7 @@
8
8
  <template v-slot:head>
9
9
  <div class="relative p-6">
10
10
  <h3 v-if="!instance.type">{{ $t('Select Type') }}</h3>
11
- <h3 v-else @click="log(instance)">{{ $t(instance.text) }}</h3>
11
+ <h3 v-else>{{ $t(instance.text) }}</h3>
12
12
  <div class="absolute top-0 right-0 p-2">
13
13
  <button type="button" class="p-2" @click="close">
14
14
  <svg width="24" height="24" viewBox="0 0 24 24" class="fill-text-300 hover:fill-red-500" xmlns="http://www.w3.org/2000/svg">
@@ -37,7 +37,7 @@
37
37
 
38
38
  <div v-if="!instance.type" class="flex-1">
39
39
 
40
- <div class="flex flex-col divide-text-50 border-t-[1px] border-b-[1px] border-text-50">
40
+ <div class="flex flex-col divide-border-50 border-t-[1px] border-b-[1px] border-border-50">
41
41
  <button v-for="output in outputs"
42
42
  type="button"
43
43
  class="p-3 px-6 text-left"
@@ -1,75 +1,78 @@
1
1
  <template>
2
2
  <div class="p-6 pt-0 flex flex-col gap-5">
3
3
 
4
- <div class="flex flex-col gap-4">
4
+ <div class="flex justify-center">
5
+ <Tabs :items="tabItems" v-model="output.params.type" />
6
+ </div>
7
+
8
+ <div v-if="output.params.type === 1">
5
9
  <div>
6
- <div class="flex flex-row">
7
- <Checkbox v-model="output.params.useTemplate">
8
- Use Template
9
- </Checkbox>
10
- </div>
11
- <Dropdown v-model="output.params.templateName" class="mt-2">
12
- <option v-for="template in whatsappTemplates" :value="template.name">{{ template.name }}</option>
13
- </Dropdown>
10
+ <label class="text-text-400">Image</label>
11
+ <Image :src="output.params.imageUrl"
12
+ :editable="true"
13
+ @change="(base64, file) => output.params.imageUrl = file"
14
+ ref="image"
15
+ class="w-full min-h-[100px] border-[1px] border-border-200 bg-base-500 rounded-lg flex">
16
+ <template #empty>
17
+ <div class="flex-1 flex items-center justify-center">
18
+ <button type="button" @click="$refs.image.edit()">
19
+ <svg width="24" height="24" class="fill-text-300 hover:fill-primary" 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="M630.8 469.1l-55.95-43.85C575.3 422.2 575.1 419.2 575.1 416l.0034-320c0-35.35-28.65-64-64-64H127.1C113.6 32 100.4 36.98 89.78 45.06L38.81 5.113C28.34-3.058 13.31-1.246 5.109 9.192C-3.063 19.63-1.235 34.72 9.187 42.89L601.2 506.9C605.6 510.3 610.8 512 615.1 512c7.125 0 14.17-3.156 18.91-9.188C643.1 492.4 641.2 477.3 630.8 469.1zM223.1 149.6l-64.29-50.39C164.2 97.15 169.9 96 175.1 96c26.51 0 48 21.49 48 48C223.1 145.9 223.4 147.7 223.1 149.6zM331.2 234.3l23.45-35.18C357.7 194.7 362.7 192 368 192s10.35 2.672 13.31 7.125l103.9 155.9L331.2 234.3zM145.1 416c-6.021 0-11.53-3.379-14.26-8.75c-2.73-5.367-2.215-11.81 1.334-16.68l70-96C206.1 290.4 210.9 288 216 288s9.916 2.441 12.93 6.574l32.46 44.51l16.43-24.65L63.99 146.8L63.99 416c0 35.35 28.65 64 64 64h361.1l-81.66-64H145.1z"/></svg>
20
+ </button>
21
+ </div>
22
+ </template>
23
+ </Image>
14
24
  </div>
15
25
 
16
- <div v-if="!output.params.useTemplate" class="flex flex-col gap-4">
17
-
18
- <div>
19
- <label class="text-text-400">Image</label>
20
- <Image :src="output.params.imageUrl"
21
- :editable="true"
22
- @change="(base64, file) => output.params.imageUrl = file"
23
- ref="image"
24
- class="w-full min-h-[100px] border-[1px] border-text-200 bg-base-500 rounded-lg flex">
25
- <template #empty>
26
- <div class="flex-1 flex items-center justify-center">
27
- <button type="button" @click="$refs.image.edit()">
28
- <svg width="24" height="24" class="fill-text-300 hover:fill-primary" 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="M630.8 469.1l-55.95-43.85C575.3 422.2 575.1 419.2 575.1 416l.0034-320c0-35.35-28.65-64-64-64H127.1C113.6 32 100.4 36.98 89.78 45.06L38.81 5.113C28.34-3.058 13.31-1.246 5.109 9.192C-3.063 19.63-1.235 34.72 9.187 42.89L601.2 506.9C605.6 510.3 610.8 512 615.1 512c7.125 0 14.17-3.156 18.91-9.188C643.1 492.4 641.2 477.3 630.8 469.1zM223.1 149.6l-64.29-50.39C164.2 97.15 169.9 96 175.1 96c26.51 0 48 21.49 48 48C223.1 145.9 223.4 147.7 223.1 149.6zM331.2 234.3l23.45-35.18C357.7 194.7 362.7 192 368 192s10.35 2.672 13.31 7.125l103.9 155.9L331.2 234.3zM145.1 416c-6.021 0-11.53-3.379-14.26-8.75c-2.73-5.367-2.215-11.81 1.334-16.68l70-96C206.1 290.4 210.9 288 216 288s9.916 2.441 12.93 6.574l32.46 44.51l16.43-24.65L63.99 146.8L63.99 416c0 35.35 28.65 64 64 64h361.1l-81.66-64H145.1z"/></svg>
29
- </button>
30
- </div>
31
- </template>
32
- </Image>
33
- </div>
26
+ <div>
27
+ <label class="text-text-400">Text</label>
28
+ <TextWithTag rows="5" v-model="output.params.text" :items="replyTextItems" />
29
+ </div>
34
30
 
35
- <div>
36
- <label class="text-text-400">Text</label>
37
- <TextWithTag rows="5" v-model="output.params.text" :items="replyTextItems" />
38
- </div>
31
+ <div>
32
+ <label class="text-text-400">Footer</label>
33
+ <Textbox v-model="output.params.footer" maxlength="50" />
34
+ </div>
39
35
 
40
- <div>
41
- <label class="text-text-400">Footer</label>
42
- <Textbox v-model="output.params.footer" maxlength="50" />
36
+ <div>
37
+ <div class="flex flex-row gap-2 items-center">
38
+ <label class="flex-1 text-text-400">Buttons</label>
39
+ <button type="button" class="text-primary" @click="$array(output.params, 'buttons').push({})">
40
+ {{ $t('Add Button') }}
41
+ </button>
43
42
  </div>
44
-
45
- <div>
46
- <div class="flex flex-row gap-2 items-center">
47
- <label class="flex-1 text-text-400">Buttons</label>
48
- <button type="button" class="text-primary" @click="$array(output.params, 'buttons').push({})">
49
- {{ $t('Add Button') }}
50
- </button>
51
- </div>
52
- <ListItem :items="output.params.buttons"
53
- @reorder="(from, to) => { output.params.buttons.splice(to, 0, output.params.buttons.splice(from, 1)[0]); }">
54
- <template v-slot="{ item, index }">
55
- <div class="flex flex-row items-center gap-3">
56
- <div data-reorder>
57
- <svg width="14" height="14" class="fill-text-300" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><path d="M496 288H16c-8.8 0-16 7.2-16 16v32c0 8.8 7.2 16 16 16h480c8.8 0 16-7.2 16-16v-32c0-8.8-7.2-16-16-16zm0-128H16c-8.8 0-16 7.2-16 16v32c0 8.8 7.2 16 16 16h480c8.8 0 16-7.2 16-16v-32c0-8.8-7.2-16-16-16z"/></svg>
58
- </div>
59
- <div class="flex-1 flex flex-row gap-2 items-center">
60
- <Textbox class="w-[100px]" placeholder="Text" v-model="item.text" />
61
- </div>
62
- <div>
63
- <button type="button" @click="output.params.buttons.splice(index, 1)">
64
- <svg width="16" height="16" class="fill-text-300 hover:fill-red-500" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 320 512"><path d="M207.6 256l107.72-107.72c6.23-6.23 6.23-16.34 0-22.58l-25.03-25.03c-6.23-6.23-16.34-6.23-22.58 0L160 208.4 52.28 100.68c-6.23-6.23-16.34-6.23-22.58 0L4.68 125.7c-6.23 6.23-6.23 16.34 0 22.58L112.4 256 4.68 363.72c-6.23 6.23-6.23 16.34 0 22.58l25.03 25.03c6.23 6.23 16.34 6.23 22.58 0L160 303.6l107.72 107.72c6.23 6.23 16.34 6.23 22.58 0l25.03-25.03c6.23-6.23 6.23-16.34 0-22.58L207.6 256z"/></svg>
65
- </button>
66
- </div>
43
+ <ListItem :items="output.params.buttons"
44
+ @reorder="(from, to) => { output.params.buttons.splice(to, 0, output.params.buttons.splice(from, 1)[0]); }">
45
+ <template v-slot="{ item, index }">
46
+ <div class="flex flex-row items-center gap-3">
47
+ <div data-reorder>
48
+ <svg width="14" height="14" class="fill-text-300" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><path d="M496 288H16c-8.8 0-16 7.2-16 16v32c0 8.8 7.2 16 16 16h480c8.8 0 16-7.2 16-16v-32c0-8.8-7.2-16-16-16zm0-128H16c-8.8 0-16 7.2-16 16v32c0 8.8 7.2 16 16 16h480c8.8 0 16-7.2 16-16v-32c0-8.8-7.2-16-16-16z"/></svg>
67
49
  </div>
68
- </template>
69
- </ListItem>
70
- </div>
50
+ <div class="flex-1 flex flex-row gap-2 items-center">
51
+ <Textbox class="w-[100px]" placeholder="Text" v-model="item.text" />
52
+ </div>
53
+ <div>
54
+ <button type="button" @click="output.params.buttons.splice(index, 1)">
55
+ <svg width="16" height="16" class="fill-text-300 hover:fill-red-500" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 320 512"><path d="M207.6 256l107.72-107.72c6.23-6.23 6.23-16.34 0-22.58l-25.03-25.03c-6.23-6.23-16.34-6.23-22.58 0L160 208.4 52.28 100.68c-6.23-6.23-16.34-6.23-22.58 0L4.68 125.7c-6.23 6.23-6.23 16.34 0 22.58L112.4 256 4.68 363.72c-6.23 6.23-6.23 16.34 0 22.58l25.03 25.03c6.23 6.23 16.34 6.23 22.58 0L160 303.6l107.72 107.72c6.23 6.23 16.34 6.23 22.58 0l25.03-25.03c6.23-6.23 6.23-16.34 0-22.58L207.6 256z"/></svg>
56
+ </button>
57
+ </div>
58
+ </div>
59
+ </template>
60
+ </ListItem>
61
+ </div>
62
+ </div>
63
+
64
+ <div v-else>
71
65
 
66
+ <div>
67
+ <label class="text-text-400">Template</label>
68
+ <Dropdown v-model="output.params.value">
69
+ <option value="hello_world">hello_world</option>
70
+ <option value="welcome1">welcome1</option>
71
+ <option value="select_beverages">select_beverages</option>
72
+ <option value="test7">test7</option>
73
+ </Dropdown>
72
74
  </div>
75
+
73
76
  </div>
74
77
 
75
78
  </div>
@@ -92,36 +95,10 @@ export default{
92
95
  tabItems(){
93
96
  return [
94
97
  { text:"Text", value:1 },
95
- this.getWhatsappTemplateSrc() ? { text:"Template", value:2 } : null,
98
+ { text:"Template", value:2 },
96
99
  ]
97
- .filter(_ => _)
98
- }
99
-
100
- },
101
-
102
- data(){
103
- return {
104
- whatsappTemplates: null
105
100
  }
106
- },
107
-
108
- inject: [ 'getWhatsappTemplateSrc', 'socket' ],
109
-
110
- methods: {
111
-
112
- loadWhatsappTemplate(){
113
- const src = this.getWhatsappTemplateSrc()
114
-
115
- if(src){
116
- this.socket.send(src, {})
117
- .then(templates => this.whatsappTemplates = templates)
118
- }
119
- }
120
-
121
- },
122
101
 
123
- mounted() {
124
- this.loadWhatsappTemplate()
125
102
  },
126
103
 
127
104
  props: {
@@ -43,7 +43,7 @@
43
43
  </button>
44
44
  </div>
45
45
  <ListItem :items="instance.conditions"
46
- class="mt-2 bg-transparent border-[1px] border-text-200 rounded-xl overflow-hidden"
46
+ class="mt-2 bg-transparent border-[1px] border-border-200 rounded-xl overflow-hidden"
47
47
  container-class="flex flex-col gap-2"
48
48
  @reorder="(from, to) => { instance.conditions.splice(to, 0, instance.conditions.splice(from, 1)[0]); }">
49
49
  <template v-slot="{ item, index }">
@@ -67,7 +67,7 @@
67
67
  </template>
68
68
 
69
69
  <template #empty>
70
- <div class="flex justify-center p-2 bg-base-300 rounded-xl border-[1px] rounded-xl border-text-200">
70
+ <div class="flex justify-center p-2 bg-base-300 rounded-xl border-[1px] rounded-xl border-border-200">
71
71
  <p class="text-text-400">{{ $t('All conditions') }}</p>
72
72
  </div>
73
73
  </template>
@@ -82,7 +82,7 @@
82
82
  <button type="button" class="text-primary" @click="$refs.userActionOutput.create()">Add Output</button>
83
83
  </div>
84
84
  <ListItem :items="instance.outputs"
85
- class="mt-2 border-[1px] rounded-xl border-text-200"
85
+ class="mt-2 border-[1px] rounded-xl border-border-200"
86
86
  container-class="divide-y divide-text-200"
87
87
  @reorder="(from, to) => { instance.outputs.splice(to, 0, instance.outputs.splice(from, 1)[0]); }">
88
88
  <template v-slot="{ item, index }">
@@ -18,7 +18,7 @@
18
18
 
19
19
  <div class="flex-1 flex flex-col">
20
20
  <label class="text-text-300">Actions</label>
21
- <VirtualGrid :items="items" class="flex-1 rounded-xl" container-class="divide-y divide-text-50">
21
+ <VirtualGrid :items="items" class="flex-1 rounded-xl" container-class="divide-y divide-border-50">
22
22
  <template #item="{ item }">
23
23
  <div class="p-3 hover:bg-base-500 flex flex-row"
24
24
  :class="item.uid === actionUid ? 'bg-base-500' : 'bg-base-400'"
@@ -40,7 +40,7 @@
40
40
  <div class="flex-1 flex flex-row">
41
41
  <div class="flex-1 flex flex-col">
42
42
 
43
- <div class="p-2 flex flex-row items-center panel-400 border-b-[1px] border-text-50">
43
+ <div class="p-2 flex flex-row items-center panel-400 border-b-[1px] border-border-50">
44
44
  <h5 class="pl-3">{{ item?.name }}</h5>
45
45
  <div class="flex-1"></div>
46
46
  <div>
@@ -209,10 +209,6 @@ export default{
209
209
  this.$refs.console.addMessage(message)
210
210
  },
211
211
 
212
- getWhatsappTemplateSrc(){
213
- return this.whatsappTemplateSrc
214
- },
215
-
216
212
  testMessage(message){
217
213
  this.$emit('test-message', {
218
214
  message,
@@ -262,18 +258,10 @@ export default{
262
258
 
263
259
  src: [ String ],
264
260
 
265
- whatsappTemplateSrc: String,
266
-
267
261
  uid: String,
268
262
 
269
263
  },
270
264
 
271
- provide(){
272
- return {
273
- getWhatsappTemplateSrc: this.getWhatsappTemplateSrc
274
- }
275
- },
276
-
277
265
  watch: {
278
266
 
279
267
  actionUid: {
@@ -303,7 +291,7 @@ export default{
303
291
  }
304
292
 
305
293
  .leftBoundary {
306
- @apply absolute top-0 right-0 bottom-0 w-[3px] border-r-[1px] border-text-50 cursor-e-resize;
294
+ @apply absolute top-0 right-0 bottom-0 w-[3px] border-r-[1px] border-border-50 cursor-e-resize;
307
295
  }
308
296
 
309
297
  .contentPane{
@@ -320,7 +308,7 @@ export default{
320
308
  }
321
309
 
322
310
  .rightBoundary {
323
- @apply absolute top-0 left-0 bottom-0 w-[3px] border-l-[1px] border-text-50 cursor-w-resize;
311
+ @apply absolute top-0 left-0 bottom-0 w-[3px] border-l-[1px] border-border-50 cursor-w-resize;
324
312
  }
325
313
 
326
314
  </style>