@mixd-id/web-scaffold 0.2.250801013 → 0.2.250801014

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 (185) hide show
  1. package/docs/components/AIDashboard.md +472 -0
  2. package/docs/components/WebPageBuilder.md +125 -0
  3. package/package.json +7 -30
  4. package/src/components/AIChat.vue +479 -0
  5. package/src/components/AIChatItem.vue +168 -0
  6. package/src/components/AIChatTextbox.vue +56 -0
  7. package/src/components/AIDashboard.vue +1113 -0
  8. package/src/components/Card.vue +3 -1
  9. package/src/components/Chart.vue +2 -1
  10. package/src/components/CodeEditor.vue +121 -13
  11. package/src/components/ColorPicker.vue +6 -2
  12. package/src/components/Dashboard.vue +493 -212
  13. package/src/components/Dropdown.vue +0 -1
  14. package/src/components/HTMLEditor.vue +9 -1
  15. package/src/components/List.vue +226 -58
  16. package/src/components/MarkdownEdit.vue +123 -4
  17. package/src/components/PresetSelectorFilterItem.vue +1 -0
  18. package/src/components/TextWithTag.vue +3 -3
  19. package/src/components/TreeView.vue +1 -1
  20. package/src/components/VirtualTable.vue +166 -75
  21. package/src/index.js +3 -55
  22. package/src/instructions/dashboard.js +203 -0
  23. package/src/utils/ai-chat-answer.mjs +240 -0
  24. package/src/utils/ai-chat.js +167 -0
  25. package/src/utils/ai-dashboard-chat.mjs +371 -0
  26. package/src/utils/ai-dashboard.js +321 -0
  27. package/src/utils/ai-list-chat.mjs +407 -0
  28. package/src/utils/dashboard.js +13 -0
  29. package/src/utils/list.mjs +146 -91
  30. package/src/utils/preset-selector.mjs +183 -27
  31. package/src/utils/wss.js +0 -2
  32. package/src/widgets/ColumnSelector.vue +22 -33
  33. package/src/widgets/LLMChat.vue +327 -0
  34. package/src/widgets/PresetBar.vue +31 -8
  35. package/src/widgets/PresetBarPivot.vue +147 -15
  36. package/src/widgets/PresetBarPivotColumnEdit.vue +8 -19
  37. package/src/widgets/PresetBarPivotValueEdit.vue +172 -0
  38. package/src/widgets/PresetSelector.vue +8 -4
  39. package/src/widgets/WebPageBuilder.vue +153 -352
  40. package/docs/components/ArrayList.md +0 -39
  41. package/docs/components/Box.md +0 -15
  42. package/docs/components/ChartBar.md +0 -34
  43. package/docs/components/DayTimeRange.md +0 -20
  44. package/docs/components/ErrorText.md +0 -15
  45. package/docs/components/FBLogin.md +0 -21
  46. package/docs/components/GHeatMaps.md +0 -16
  47. package/docs/components/GSignIn.md +0 -21
  48. package/docs/components/GmapsDirection.md +0 -20
  49. package/docs/components/IconMenu.md +0 -20
  50. package/src/components/ArrayList.vue +0 -49
  51. package/src/components/Box.vue +0 -34
  52. package/src/components/ChartBar.vue +0 -192
  53. package/src/components/DayTimeRange.vue +0 -126
  54. package/src/components/ErrorText.vue +0 -57
  55. package/src/components/FBLogin.vue +0 -194
  56. package/src/components/GHeatMaps.vue +0 -317
  57. package/src/components/GSignIn.vue +0 -166
  58. package/src/components/GmapsDirection.vue +0 -191
  59. package/src/components/IconMenu.vue +0 -95
  60. package/src/components/IconPlus.vue +0 -89
  61. package/src/components/Image360.vue +0 -140
  62. package/src/components/ImageFullScreen.vue +0 -101
  63. package/src/components/ImportModal.vue +0 -260
  64. package/src/components/ListContextMenu.vue +0 -88
  65. package/src/components/LogViewerItem.vue +0 -116
  66. package/src/components/MultilineText.vue +0 -174
  67. package/src/components/PageBuilder.vue +0 -449
  68. package/src/components/SplitPane.vue +0 -129
  69. package/src/components/TabView.vue +0 -105
  70. package/src/components/TableView.vue +0 -200
  71. package/src/components/TableViewHead.vue +0 -159
  72. package/src/components/Test.vue +0 -23
  73. package/src/components/TextEditor.vue +0 -85
  74. package/src/components/Tooltip.vue +0 -143
  75. package/src/components/TreeViewItem1.vue +0 -282
  76. package/src/components/VirtualScroll.vue +0 -282
  77. package/src/configs/dashboard/bar.js +0 -10
  78. package/src/configs/dashboard/collection-1.js +0 -5
  79. package/src/configs/dashboard/data-table.js +0 -9
  80. package/src/configs/dashboard/doughnut.js +0 -7
  81. package/src/configs/dashboard/gheatmaps.js +0 -9
  82. package/src/configs/dashboard/grid-2.js +0 -34
  83. package/src/configs/dashboard/grid-3.js +0 -34
  84. package/src/configs/dashboard/grid-4.js +0 -34
  85. package/src/configs/dashboard/grid.js +0 -15
  86. package/src/configs/dashboard/metric.js +0 -10
  87. package/src/configs/dashboard/pie.js +0 -7
  88. package/src/configs/dashboard/polar-area.js +0 -7
  89. package/src/configs/dashboard/virtual-table.js +0 -9
  90. package/src/configs/icons-fa.json +0 -12
  91. package/src/middleware/http/trim-string.js +0 -20
  92. package/src/mixin/ready-state.js +0 -37
  93. package/src/stores/components.js +0 -36
  94. package/src/stores/datasource.js +0 -11
  95. package/src/utils/event-bus.js +0 -8
  96. package/src/utils/helpers.cjs +0 -635
  97. package/src/utils/importer.js +0 -209
  98. package/src/utils/listview.js +0 -1287
  99. package/src/utils/preset-selector.cjs +0 -1455
  100. package/src/utils/preset-selector.js +0 -1452
  101. package/src/utils/queue.js +0 -63
  102. package/src/utils/web.js +0 -50
  103. package/src/utils/web.mjs +0 -120
  104. package/src/widgets/BackgroundSetting.vue +0 -132
  105. package/src/widgets/BorderSetting.vue +0 -201
  106. package/src/widgets/BotEditor/BotEditorActions.vue +0 -163
  107. package/src/widgets/BotEditor/BotEditorSettings.vue +0 -21
  108. package/src/widgets/BotEditor.vue +0 -248
  109. package/src/widgets/BoxSetting.vue +0 -53
  110. package/src/widgets/CheckoutSetting.vue +0 -46
  111. package/src/widgets/ComponentPropertyLabel.vue +0 -35
  112. package/src/widgets/ComponentPropertySelector.vue +0 -115
  113. package/src/widgets/ComponentSetting3.vue +0 -231
  114. package/src/widgets/EffectSetting.vue +0 -94
  115. package/src/widgets/FiltersSetting.vue +0 -88
  116. package/src/widgets/Header.vue +0 -15
  117. package/src/widgets/Header0.vue +0 -41
  118. package/src/widgets/Header0Setting.vue +0 -75
  119. package/src/widgets/HeaderSetting.vue +0 -102
  120. package/src/widgets/LayoutSetting.vue +0 -251
  121. package/src/widgets/LogViewer.vue +0 -85
  122. package/src/widgets/MarginPaddingSetting.vue +0 -58
  123. package/src/widgets/MarginSetting.vue +0 -142
  124. package/src/widgets/MenuEditor.vue +0 -251
  125. package/src/widgets/PaddingSetting.vue +0 -142
  126. package/src/widgets/SizingSetting.vue +0 -306
  127. package/src/widgets/SpacingSetting.vue +0 -77
  128. package/src/widgets/StyleSetting.vue +0 -543
  129. package/src/widgets/StyleSetting2.vue +0 -90
  130. package/src/widgets/TransitionSetting.vue +0 -64
  131. package/src/widgets/TypographySetting.vue +0 -334
  132. package/src/widgets/UserActionBuilder/UserActionCondition.vue +0 -99
  133. package/src/widgets/UserActionBuilder/UserActionConsole.vue +0 -97
  134. package/src/widgets/UserActionBuilder/UserActionItem.vue +0 -273
  135. package/src/widgets/UserActionBuilder/UserActionOutput.vue +0 -150
  136. package/src/widgets/UserActionBuilder/UserActionOutputDelay.vue +0 -27
  137. package/src/widgets/UserActionBuilder/UserActionOutputLog.vue +0 -28
  138. package/src/widgets/UserActionBuilder/UserActionOutputReply.vue +0 -112
  139. package/src/widgets/UserActionBuilder/UserActionProps.vue +0 -213
  140. package/src/widgets/UserActionBuilder.vue +0 -314
  141. package/src/widgets/WebPageBuilder4/BackgroundColorSetting.vue +0 -54
  142. package/src/widgets/WebPageBuilder4/BackgroundPositionSetting.vue +0 -75
  143. package/src/widgets/WebPageBuilder4/BackgroundRepeatSetting.vue +0 -72
  144. package/src/widgets/WebPageBuilder4/BackgroundSizeSetting.vue +0 -72
  145. package/src/widgets/WebPageBuilder4/BlurSetting.vue +0 -72
  146. package/src/widgets/WebPageBuilder4/BorderColorSetting.vue +0 -54
  147. package/src/widgets/WebPageBuilder4/BorderRadiusSetting.vue +0 -75
  148. package/src/widgets/WebPageBuilder4/BorderSizeSetting.vue +0 -69
  149. package/src/widgets/WebPageBuilder4/BorderStyleSetting.vue +0 -72
  150. package/src/widgets/WebPageBuilder4/BoxShadowSetting.vue +0 -73
  151. package/src/widgets/WebPageBuilder4/ButtonSetting.vue +0 -65
  152. package/src/widgets/WebPageBuilder4/CarouselSetting.vue +0 -178
  153. package/src/widgets/WebPageBuilder4/DisplaySetting.vue +0 -76
  154. package/src/widgets/WebPageBuilder4/FlexAlignSetting.vue +0 -71
  155. package/src/widgets/WebPageBuilder4/FlexDirectionSetting.vue +0 -70
  156. package/src/widgets/WebPageBuilder4/FlexJustifySetting.vue +0 -74
  157. package/src/widgets/WebPageBuilder4/FlexPropertySetting.vue +0 -71
  158. package/src/widgets/WebPageBuilder4/FlexSetting.vue +0 -96
  159. package/src/widgets/WebPageBuilder4/FlexWrapSetting.vue +0 -69
  160. package/src/widgets/WebPageBuilder4/GapSetting.vue +0 -75
  161. package/src/widgets/WebPageBuilder4/GrayscaleSetting.vue +0 -68
  162. package/src/widgets/WebPageBuilder4/GridSetting.vue +0 -216
  163. package/src/widgets/WebPageBuilder4/HeightSetting.vue +0 -98
  164. package/src/widgets/WebPageBuilder4/ImageSetting.vue +0 -102
  165. package/src/widgets/WebPageBuilder4/MarginSetting.vue +0 -73
  166. package/src/widgets/WebPageBuilder4/MaxHeightSetting.vue +0 -82
  167. package/src/widgets/WebPageBuilder4/MaxWidthSetting.vue +0 -90
  168. package/src/widgets/WebPageBuilder4/MinHeightSetting.vue +0 -81
  169. package/src/widgets/WebPageBuilder4/MinWidthSetting.vue +0 -101
  170. package/src/widgets/WebPageBuilder4/MultiValueSetting.vue +0 -163
  171. package/src/widgets/WebPageBuilder4/OpacitySetting.vue +0 -77
  172. package/src/widgets/WebPageBuilder4/OverflowSetting.vue +0 -81
  173. package/src/widgets/WebPageBuilder4/PaddingSetting.vue +0 -57
  174. package/src/widgets/WebPageBuilder4/PositionSetting.vue +0 -191
  175. package/src/widgets/WebPageBuilder4/PropertySetting.vue +0 -176
  176. package/src/widgets/WebPageBuilder4/TextSetting.vue +0 -72
  177. package/src/widgets/WebPageBuilder4/TreeView.vue +0 -46
  178. package/src/widgets/WebPageBuilder4/TreeViewItem.vue +0 -303
  179. package/src/widgets/WebPageBuilder4/WebPageComponentSelector.vue +0 -141
  180. package/src/widgets/WebPageBuilder4/WebPagePropertySelector.vue +0 -168
  181. package/src/widgets/WebPageBuilder4/WidthSetting.vue +0 -105
  182. package/src/widgets/WebPageBuilder4/ZIndexSetting.vue +0 -72
  183. package/src/widgets/WebPagePreview.vue +0 -295
  184. package/src/widgets/WebPageSelector.vue +0 -173
  185. package/src/widgets/WebTemplateCreator.vue +0 -156
@@ -1,213 +0,0 @@
1
- <template>
2
- <div v-if="instance" class="p-6 flex flex-col gap-6" @dblclick="log(instance)">
3
-
4
- <div class="flex flex-row gap-5">
5
- <div class="flex-1">
6
- <label>Name</label>
7
- <Textbox v-model="instance.name" class="mt-2"/>
8
- </div>
9
- <div v-if="instance.parentId > 0">
10
- <label>Enabled</label>
11
- <Switch v-model="instance.enabled" class="mt-2"/>
12
- </div>
13
- </div>
14
-
15
- <div>
16
- <label>Type</label>
17
- <div class="flex flex-row gap-3 mt-2">
18
- <Dropdown v-model.number="instance.type" class="w-full">
19
- <option :value="1">Event</option>
20
- <option :value="2">Time Based</option>
21
- <option :value="3">Fallback</option>
22
- </Dropdown>
23
- </div>
24
- </div>
25
-
26
- <div v-if="instance.type === 1">
27
- <label>Event</label>
28
- <div class="flex flex-row gap-3 mt-2">
29
- <Dropdown v-model.number="instance.key" class="w-full">
30
- <option value="onNewMessage">On New Message</option>
31
- </Dropdown>
32
- </div>
33
- </div>
34
-
35
- <div v-if="instance.type === 1" class="flex flex-col gap-6">
36
-
37
- <div>
38
- <div class="flex flex-row items-center gap-2">
39
- <label class="flex-1">Condition</label>
40
- <button type="button" class="text-primary"
41
- @click="$refs.userActionCondition.open({}, addCondition)">
42
- Add Condition
43
- </button>
44
- </div>
45
- <ListItem :items="instance.conditions"
46
- class="mt-2 bg-transparent border-[1px] border-border-200 rounded-xl overflow-hidden"
47
- container-class="flex flex-col gap-2"
48
- @reorder="(from, to) => { instance.conditions.splice(to, 0, instance.conditions.splice(from, 1)[0]); }">
49
- <template v-slot="{ item, index }">
50
- <div class="flex flex-row items-center gap-2 px-3 bg-base-500 p-2">
51
- <div data-reorder>
52
- <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>
53
- </div>
54
-
55
- <div class="flex-1 flex flex-row gap-2" @click="$refs.userActionCondition.open(item, _ => Object.assign(item, _))">
56
- <label>{{ item.key }}</label>
57
- <p class="text-text-400 flex-1 text-ellipsis whitespace-nowrap overflow-hidden">{{ item.op }}</p>
58
- <p class="text-text-400 flex-1 text-ellipsis whitespace-nowrap overflow-hidden">{{ item.value }}</p>
59
- </div>
60
-
61
- <div>
62
- <button type="button" @click="instance.conditions.splice(index, 1)">
63
- <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>
64
- </button>
65
- </div>
66
- </div>
67
- </template>
68
-
69
- <template #empty>
70
- <div class="flex justify-center p-2 bg-base-300 rounded-xl border-[1px] rounded-xl border-border-200">
71
- <p class="text-text-400">{{ $t('All conditions') }}</p>
72
- </div>
73
- </template>
74
- </ListItem>
75
- </div>
76
-
77
- </div>
78
-
79
- <div>
80
- <div class="flex flex-row items-center gap-2">
81
- <label class="flex-1">Output</label>
82
- <button type="button" class="text-primary" @click="$refs.userActionOutput.create()">Add Output</button>
83
- </div>
84
- <ListItem :items="instance.outputs"
85
- class="mt-2 border-[1px] rounded-xl border-border-200"
86
- container-class="divide-y divide-text-200"
87
- @reorder="(from, to) => { instance.outputs.splice(to, 0, instance.outputs.splice(from, 1)[0]); }">
88
- <template v-slot="{ item, index }">
89
- <div class="flex flex-row items-center gap-3 px-3">
90
- <div data-reorder>
91
- <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>
92
- </div>
93
- <div class="flex-1 p-2 flex flex-row items-center gap-2" @click="$refs.userActionOutput.open(item, index)">
94
- <p>{{ item.text }}</p>
95
- <p class="flex-1 text-text-300 text-ellipsis whitespace-nowrap overflow-hidden"></p>
96
- </div>
97
- <button type="button" @click="instance.outputs.splice(index, 1)">
98
- <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>
99
- </button>
100
- </div>
101
- </template>
102
-
103
- <template #empty>
104
- <div class="flex justify-center p-2 bg-base-300 rounded-xl">
105
- <p class="text-text-400">{{ $t('No actions') }}</p>
106
- </div>
107
- </template>
108
- </ListItem>
109
-
110
- <UserActionOutput ref="userActionOutput"
111
- :outputs="outputs"
112
- @apply="(instance, index) => addOutput(instance, index)" />
113
-
114
- <UserActionCondition ref="userActionCondition" />
115
- </div>
116
-
117
- </div>
118
- </template>
119
-
120
- <script>
121
-
122
- import UserActionOutput from "./UserActionOutput.vue";
123
- import UserActionCondition from "./UserActionCondition.vue";
124
-
125
- export default{
126
-
127
- components: {UserActionCondition, UserActionOutput},
128
-
129
- computed: {
130
-
131
- conditions(){
132
- return (this.eventOpt[this.instance.event]?.conditions ?? [])
133
- .reduce((acc, cur) => {
134
- acc[cur.key] = cur
135
- return acc
136
- }, {})
137
- },
138
-
139
- outputs(){
140
- return [
141
- { type: "log", text:"Log" },
142
- { type: "reply", text:"Reply" },
143
- { type: "delay", text:"Delay" },
144
- { type: "reset", text:"Reset" },
145
- { type: "endChat", text:"End Chat" },
146
- { type: "startChat", text:"Start Chat" },
147
- { type: "endConversation", text:"End Conversation" },
148
- ]
149
- return this.eventOpt[this.instance.key]?.outputs ?? []
150
- },
151
-
152
- },
153
-
154
- data(){
155
- return {
156
- }
157
- },
158
-
159
- methods: {
160
-
161
- addCondition(condition){
162
- this.$util.push(this.instance.conditions, condition)
163
- },
164
-
165
- addOutput(output, idx){
166
- if(!this.instance) return
167
-
168
- if(!Array.isArray(this.instance.outputs))
169
- this.instance.outputs = []
170
-
171
- typeof idx === 'number' ?
172
- Object.assign(this.instance.outputs[idx], output) :
173
- this.instance.outputs.push(output)
174
- },
175
-
176
- },
177
-
178
- props: {
179
- instance: Object,
180
-
181
- eventOpt: {
182
- type: Object,
183
- default: () => ({
184
-
185
- 'onNewMessage': {
186
- text: 'On message create',
187
- conditions: [
188
- { key:"{message.body}", text:"Text", type:"string", operators:[ [ 'contains', 'Contains' ], [ 'startsWith', 'Starts With' ] ] },
189
- { key:"{message.direction}", text:"Direction", type:"enum", enum:[ [ 1, 'In' ], [ 2, 'Out' ] ] },
190
- { key:"{message.channelId}", text:"Channel", type:"enum", enum:[ [ 1, 'Whatsapp' ] ] },
191
- { key:"{message.inbox.mobileNumber}", text:"Mobile Number" }
192
- ],
193
- outputs: [
194
- { type: "log", text:"Log" },
195
- { type: "reply", text:"Reply" },
196
- { type: "delay", text:"Delay" },
197
- ]
198
- }
199
-
200
- })
201
- },
202
- }
203
- }
204
-
205
- </script>
206
-
207
- <style module>
208
-
209
- .comp{
210
-
211
- }
212
-
213
- </style>
@@ -1,314 +0,0 @@
1
- <template>
2
- <div :class="$style.comp">
3
-
4
- <div :class="$style.leftPane"
5
- :style="leftStyle">
6
- <div :class="$style.leftBoundary" @mousedown="(e) => $util.dragResize(e, resize1)"></div>
7
-
8
- <div class="flex-1 flex flex-col gap-5 p-5">
9
-
10
- <div class="flex flex-row items-center gap-2">
11
- <div class="flex-1">
12
- <h5>User</h5>
13
- </div>
14
- <button type="button" @click="create">
15
- <svg width="21" height="21" class="fill-primary" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512"><!--! Font Awesome Pro 6.0.0-alpha3 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) --><path d="M432 256c0 17.69-14.33 32.01-32 32.01H256v144c0 17.69-14.33 31.99-32 31.99s-32-14.3-32-31.99v-144H48c-17.67 0-32-14.32-32-32.01s14.33-31.99 32-31.99H192v-144c0-17.69 14.33-32.01 32-32.01s32 14.32 32 32.01v144h144C417.7 224 432 238.3 432 256z"/></svg>
16
- </button>
17
- </div>
18
-
19
- <div class="flex-1 flex flex-col">
20
- <label class="text-text-300">Actions</label>
21
- <VirtualGrid :items="items" class="flex-1 rounded-xl" container-class="divide-y divide-border-50">
22
- <template #item="{ item }">
23
- <div class="p-3 hover:bg-base-500 flex flex-row"
24
- :class="item.uid === actionUid ? 'bg-base-500' : 'bg-base-400'"
25
- @click="$emit('select', item.uid)">
26
- <label class="flex-1 text-ellipsis overflow-hidden whitespace-nowrap">{{ item.name }}</label>
27
- <button type="button" @click="$emit('remove', item )">
28
- <svg width="14" height="14" class="fill-text-300 hover:fill-red-600" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 320 512"><!--! Font Awesome Pro 6.0.0-alpha3 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) --><path d="M310.6 361.4c12.5 12.5 12.5 32.75 0 45.25C304.4 412.9 296.2 416 288 416s-16.38-3.125-22.62-9.375L160 301.3L54.63 406.6C48.38 412.9 40.19 416 32 416S15.63 412.9 9.375 406.6c-12.5-12.5-12.5-32.75 0-45.25l105.4-105.4L9.375 150.6c-12.5-12.5-12.5-32.75 0-45.25s32.75-12.5 45.25 0L160 210.8l105.4-105.4c12.5-12.5 32.75-12.5 45.25 0s12.5 32.75 0 45.25l-105.4 105.4L310.6 361.4z"/></svg>
29
- </button>
30
- </div>
31
- </template>
32
- </VirtualGrid>
33
- </div>
34
- </div>
35
-
36
- </div>
37
-
38
- <div v-if="actionUid" class="flex-1 flex flex-col">
39
-
40
- <div class="flex-1 flex flex-row">
41
- <div class="flex-1 flex flex-col">
42
-
43
- <div class="p-2 flex flex-row items-center panel-400 border-b-[1px] border-border-50">
44
- <h5 class="pl-3">{{ item?.name }}</h5>
45
- <div class="flex-1"></div>
46
- <div>
47
- <Button class="px-6 rounded-full" @click="save">Save</Button>
48
- </div>
49
- </div>
50
-
51
- <div class="flex-1 overflow-auto">
52
- <div class="p-12" v-if="item">
53
- <UserActionItem :config="config"
54
- :item="item"
55
- :removable="false"
56
- @select="select" />
57
- </div>
58
- </div>
59
-
60
- <div class="p-5" v-if="item && item.type === 1 && item.key === 'onNewMessage'">
61
- <UserActionConsole ref="console"
62
- @test-message="testMessage"
63
- @test-reset="$emit('test-reset')" />
64
- </div>
65
-
66
- </div>
67
-
68
- <div :class="$style.rightPane" :style="rightStyle">
69
- <div :class="$style.rightBoundary" @mousedown="(e) => $util.dragResize(e, resize2)"></div>
70
-
71
- <UserActionProps ref="userActionProps" :instance="selectedItem" />
72
-
73
- </div>
74
- </div>
75
-
76
- </div>
77
-
78
- <div v-else class="flex-1 flex flex-col items-center justify-center">
79
- <strong>No action selected</strong>
80
- <p>Please select action from left panel</p>
81
- </div>
82
-
83
- </div>
84
- </template>
85
-
86
- <script>
87
-
88
- import UserActionItem from './UserActionBuilder/UserActionItem.vue'
89
- import UserActionOutput from './UserActionBuilder/UserActionOutput.vue'
90
- import VirtualGrid from '../components/VirtualGrid.vue'
91
- import UserActionConsole from "./UserActionBuilder/UserActionConsole.vue";
92
- import UserActionProps from "./UserActionBuilder/UserActionProps.vue";
93
-
94
- export default{
95
-
96
- components: {
97
- UserActionProps,
98
- UserActionConsole,
99
- UserActionOutput,
100
- UserActionItem,
101
- VirtualGrid
102
- },
103
-
104
- computed: {
105
-
106
- canIsFallback(){
107
- return true
108
- },
109
-
110
- cConfig(){
111
- return this.config ?? this._config
112
- },
113
-
114
- leftBar() {
115
- if (!this.cConfig.leftBar) {
116
- this.cConfig.leftBar = {
117
- width: 240
118
- }
119
- }
120
-
121
- return this.cConfig.leftBar
122
- },
123
-
124
- leftStyle() {
125
- return {
126
- width: this.leftBar.width + 'px'
127
- }
128
- },
129
-
130
- rightBar() {
131
- if (!this.cConfig.rightBar) {
132
- this.cConfig.rightBar = {
133
- width: 240
134
- }
135
- }
136
-
137
- return this.cConfig.rightBar
138
- },
139
-
140
- rightStyle() {
141
- return {
142
- width: this.rightBar.width + 'px'
143
- }
144
- },
145
-
146
- selectedItem(){
147
- if (!this.config.selectedUid) return
148
- if (!this.item) return
149
-
150
- const findComponents = (items, uid) => {
151
- for (let item of items) {
152
- if (item.uid === uid)
153
- return item
154
-
155
- if (item.items) {
156
- const component = findComponents(item.items, uid)
157
- if (component)
158
- return component
159
- }
160
- }
161
- }
162
-
163
- if(this.item.uid === this.config.selectedUid)
164
- return this.item
165
- return findComponents(this.item.items ?? [], this.config.selectedUid)
166
- },
167
-
168
- },
169
-
170
- data(){
171
- return {
172
- _config: {},
173
- items: null,
174
- item: null,
175
- }
176
- },
177
-
178
- emits: [ 'remove', 'select', 'test-message', 'test-reset' ],
179
-
180
- inject: [ 'alert', 'confirm', 'socket', 'toast' ],
181
-
182
- methods: {
183
-
184
- create(){
185
- this.socket.send(`${this.src}.create`, {})
186
- .then(_ => {
187
- this.$emit('select', _.uid)
188
- })
189
- .catch(err => this.alert(err))
190
- },
191
-
192
- load(){
193
- this.socket.send(`${this.src}.load`, { uid: this.uid })
194
- .then(({ items }) => {
195
- this.items = items
196
- })
197
- .catch(err => this.toast(err))
198
- },
199
-
200
- open(item){
201
- this.socket.send(`${this.src}.open`, { uid: item.uid })
202
- .then(({ item }) => {
203
- this.item = item
204
- })
205
- .catch(err => this.toast(err))
206
- },
207
-
208
- addTestMessage(message){
209
- this.$refs.console.addMessage(message)
210
- },
211
-
212
- testMessage(message){
213
- this.$emit('test-message', {
214
- message,
215
- action: this.item
216
- })
217
- },
218
-
219
- resize1(w) {
220
- const nextWidth = this.leftBar.width + w
221
- if (nextWidth >= 200 && nextWidth <= 480) {
222
- this.leftBar.width += w
223
- }
224
- },
225
-
226
- resize2(w) {
227
- const nextWidth = this.rightBar.width - w
228
- if (nextWidth >= 240 && nextWidth <= 480) {
229
- this.rightBar.width -= w
230
- }
231
- },
232
-
233
- save(){
234
- this.socket.send(`${this.src}.save`, { userId:this.uid, item:this.item })
235
- .then(_ => this.toast('Saved'))
236
- .catch(err => this.alert(err))
237
- },
238
-
239
- select(item){
240
- this.config.selectedUid = item.uid
241
- }
242
-
243
- },
244
-
245
- mounted() {
246
- this.load()
247
- },
248
-
249
- props: {
250
-
251
- actionUid: String,
252
-
253
- config: Object,
254
-
255
- timeOpt: {
256
- type: Object
257
- },
258
-
259
- src: [ String ],
260
-
261
- uid: String,
262
-
263
- },
264
-
265
- watch: {
266
-
267
- actionUid: {
268
- immediate: true,
269
- handler(to){
270
- if(to){
271
- this.open({ uid: to })
272
- }
273
- }
274
- }
275
-
276
- }
277
-
278
- }
279
-
280
- </script>
281
-
282
- <style module>
283
-
284
- .comp{
285
- @apply flex flex-row;
286
- }
287
-
288
- .leftPane{
289
- @apply relative overflow-y-auto;
290
- @apply flex flex-col panel-400;
291
- }
292
-
293
- .leftBoundary {
294
- @apply absolute top-0 right-0 bottom-0 w-[3px] border-r-[1px] border-border-50 cursor-e-resize;
295
- }
296
-
297
- .contentPane{
298
- @apply flex-1 flex flex-row;
299
- }
300
-
301
- .treePane{
302
- @apply flex-1;
303
- }
304
-
305
- .rightPane {
306
- @apply relative overflow-y-auto panel-400;
307
-
308
- }
309
-
310
- .rightBoundary {
311
- @apply absolute top-0 left-0 bottom-0 w-[3px] border-l-[1px] border-border-50 cursor-w-resize;
312
- }
313
-
314
- </style>
@@ -1,54 +0,0 @@
1
- <template>
2
- <div :class="$style.comp">
3
- <div class="flex flex-row items-center">
4
- <label class="flex-1">Background Color</label>
5
- <ColorPicker v-model="bgColors[index]" :prefix="`${viewType}bg-`" />
6
- </div>
7
- </div>
8
- </template>
9
-
10
- <script>
11
-
12
- export default{
13
-
14
- inject: [ 'viewTypes' ],
15
-
16
- props: {
17
-
18
- index: {
19
- type: Number,
20
- required: true
21
- },
22
-
23
- value: {
24
- type: Object,
25
- required: true
26
- },
27
-
28
- viewType: {
29
- type: String,
30
- required: true
31
- },
32
-
33
- },
34
-
35
- computed: {
36
-
37
- bgColors(){
38
- if(!Array.isArray(this.value.props.bgColors))
39
- this.value.props.bgColors = this.viewTypes.map(_ => '')
40
- return this.value.props.bgColors
41
- }
42
-
43
- }
44
-
45
- }
46
-
47
- </script>
48
-
49
- <style module>
50
-
51
- .comp{
52
- }
53
-
54
- </style>
@@ -1,75 +0,0 @@
1
- <template>
2
- <div :class="$style.comp">
3
- <div class="flex flex-row items-center">
4
- <label class="flex-1">Background Position</label>
5
- <Dropdown v-model="bgPosition[index]">
6
- <option value="">Unset</option>
7
- <option v-for="value in values" :value="`${viewType}${value[0]}`">
8
- {{ value[1] }}
9
- </option>
10
- </Dropdown>
11
- </div>
12
- </div>
13
- </template>
14
-
15
- <script>
16
-
17
- export default{
18
-
19
- inject: [ 'viewTypes' ],
20
-
21
- props: {
22
-
23
- index: {
24
- type: Number,
25
- required: true
26
- },
27
-
28
- value: {
29
- type: Object,
30
- required: true
31
- },
32
-
33
- viewType: {
34
- type: String,
35
- required: true
36
- },
37
-
38
- },
39
-
40
- computed: {
41
-
42
- bgPosition(){
43
- if(!Array.isArray(this.value.props.bgPosition))
44
- this.value.props.bgPosition = this.viewTypes.map(_ => '')
45
- return this.value.props.bgPosition
46
- }
47
-
48
- },
49
-
50
- data(){
51
- return {
52
- values: [
53
- [ 'bg-center', 'Center' ],
54
- [ 'bg-top', 'Top' ],
55
- [ 'bg-right', 'Right' ],
56
- [ 'bg-bottom', 'Bottom' ],
57
- [ 'bg-left', 'Left' ],
58
- [ 'bg-top-right', 'Top Right' ],
59
- [ 'bg-top-left', 'Top Left' ],
60
- [ 'bg-bottom-right', 'Bottom Right' ],
61
- [ 'bg-bottom-left', 'Bottom Left' ],
62
- ]
63
- }
64
- }
65
-
66
- }
67
-
68
- </script>
69
-
70
- <style module>
71
-
72
- .comp{
73
- }
74
-
75
- </style>