@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
@@ -56,7 +56,7 @@
56
56
 
57
57
  <script>
58
58
 
59
- import groupBy from "lodash/groupBy";
59
+ import {groupBy} from "../utils/helpers.mjs";
60
60
 
61
61
  export default{
62
62
 
@@ -1,7 +1,7 @@
1
1
  <template>
2
2
  <div :class="$style.comp">
3
3
 
4
- <div class="flex flex-col gap-6">
4
+ <div class="p-6 py-4 flex flex-col gap-4">
5
5
 
6
6
  <div>
7
7
  <label class="text-text-400">Video ID</label>
@@ -24,11 +24,12 @@
24
24
 
25
25
  </div>
26
26
 
27
- <ComponentSetting2 :item="item"
28
- :view-type="viewType"
29
- :view-types="viewTypes"
30
- defaultDisplay="flex"
31
- @change="$emit('change')" />
27
+ <ComponentSetting2 :item="item"
28
+ :view-type="viewType"
29
+ :view-types="viewTypes"
30
+ :view-index="viewIndex"
31
+ defaultDisplay="block"
32
+ @change="$emit('change')" />
32
33
 
33
34
  </div>
34
35
  </template>
@@ -41,14 +42,16 @@ export default{
41
42
 
42
43
  props: {
43
44
 
44
- item: {
45
- type: Object,
46
- required: true
47
- },
45
+ item: {
46
+ type: Object,
47
+ required: true
48
+ },
48
49
 
49
- viewType: String,
50
+ viewType: String,
50
51
 
51
- viewTypes: Array,
52
+ viewIndex: Number,
53
+
54
+ viewTypes: Array,
52
55
 
53
56
  }
54
57
 
@@ -59,7 +62,7 @@ export default{
59
62
  <style module>
60
63
 
61
64
  .comp{
62
- @apply flex flex-col gap-8;
65
+ @apply flex flex-col divide-y divide-border-50;
63
66
  }
64
67
 
65
68
  </style>
@@ -9,8 +9,9 @@ module.exports = {
9
9
  plugins: [
10
10
  /*require('@tailwindcss/line-clamp'),*/
11
11
  /*require('@mixd-id/web-scaffold/themes/default'),*/
12
- require('./src/views/themes')
12
+ require('./src/views/themes/default')
13
13
  ],
14
+
14
15
  safelist: [
15
16
 
16
17
  'flex-wrap', 'flex-wrap-reverse', 'flex-nowrap',
@@ -472,42 +473,9 @@ module.exports = {
472
473
  'md:line-clamp-6', 'md:line-clamp-none',
473
474
 
474
475
  ],
476
+
475
477
  theme: {
476
478
  extend: {
477
- height: {
478
- '10vh': '10vh',
479
- '20vh': '20vh',
480
- '30vh': '30vh',
481
- '40vh': '40vh',
482
- '50vh': '50vh',
483
- '60vh': '60vh',
484
- '70vh': '70vh',
485
- '80vh': '80vh',
486
- '90vh': '90vh',
487
- '100vh': '100vh',
488
- },
489
- backgroundSize: {
490
- '50%': '50%',
491
- '40%': '40%',
492
- '30%': '30%',
493
- '20%': '20%',
494
- '10%': '10%',
495
- },
496
- minWidth: {
497
- '0': '0',
498
- '1/12': '8%',
499
- '2/12': '16%',
500
- '3/12': '25%',
501
- '4/12': '33%',
502
- '5/12': '41%',
503
- '6/12': '50%',
504
- '7/12': '58%',
505
- '8/12': '66%',
506
- '9/12': '75%',
507
- '10/12': '83%',
508
- '11/12': '91%',
509
- 'full': '100%',
510
- }
511
479
  }
512
480
  }
513
481
  }
@@ -1,266 +0,0 @@
1
- {
2
- "params": [
3
- {
4
- "key": "{message.body}",
5
- "op": "contains",
6
- "value": "hello"
7
- },
8
- {
9
- "key": "{message.direction}",
10
- "value": 1
11
- },
12
- {
13
- "key": "{message.channelId}",
14
- "value": 1
15
- },
16
- {
17
- "key": "{message.inbox.mobileNumber}",
18
- "op": "contains",
19
- "value": "+6287823888111"
20
- }
21
- ],
22
- "output": [
23
- {
24
- "params": {
25
- "text": "Hello {name} welcome, please select between these beverages:\n\n\n\n\n1. Coffees\n\n2. Tea"
26
- },
27
- "type": "reply",
28
- "text": "Reply"
29
- },
30
- {
31
- "params": {
32
- "text": "xzczxc"
33
- },
34
- "type": "log",
35
- "text": "Log"
36
- }
37
- ],
38
- "id": 1,
39
- "enabled": true,
40
- "uid": "55a54008ad1ba589aa210d2629c1df41",
41
- "parentId": null,
42
- "rootParentId": null,
43
- "userId": 2,
44
- "sequence": 0,
45
- "name": "Handle hello @@",
46
- "type": 1,
47
- "event": "message.create",
48
- "isFallback": false,
49
- "createdAt": "2024-08-10T08:13:27.000Z",
50
- "updatedAt": "2024-08-24T08:46:09.000Z",
51
- "weight": null,
52
- "items": [
53
- {
54
- "params": [
55
- {
56
- "key": "{message.body}",
57
- "op": "contains",
58
- "value": "coffee"
59
- },
60
- {
61
- "key": "{message.direction}",
62
- "value": 1
63
- }
64
- ],
65
- "output": [
66
- {
67
- "params": {
68
- "text": "Cofeee"
69
- },
70
- "type": "log",
71
- "text": "Log",
72
- "items": [
73
- {
74
- "text": "Name",
75
- "value": "{message.inbox.name}"
76
- },
77
- {
78
- "text": "Text",
79
- "value": "{message.body}"
80
- }
81
- ]
82
- }
83
- ],
84
- "id": 39,
85
- "enabled": true,
86
- "uid": "d4ec222d86f8f4c3d8006dfe3907ada3",
87
- "parentId": 1,
88
- "rootParentId": null,
89
- "userId": 2,
90
- "sequence": 0,
91
- "name": "Coffee",
92
- "type": 1,
93
- "event": "message.create",
94
- "isFallback": false,
95
- "createdAt": "2024-08-18T07:43:41.000Z",
96
- "updatedAt": "2024-08-24T08:46:09.000Z",
97
- "weight": null,
98
- "items": []
99
- },
100
- {
101
- "params": [
102
- {
103
- "key": "{message.body}",
104
- "op": "contains",
105
- "value": "Tea"
106
- },
107
- {
108
- "key": "{message.direction}",
109
- "value": 1
110
- }
111
- ],
112
- "output": [
113
- {
114
- "params": {
115
- "text": "Tea with Baking Soda"
116
- },
117
- "type": "log",
118
- "text": "Log",
119
- "items": [
120
- {
121
- "text": "Name",
122
- "value": "{message.inbox.name}"
123
- },
124
- {
125
- "text": "Text",
126
- "value": "{message.body}"
127
- }
128
- ]
129
- }
130
- ],
131
- "id": 42,
132
- "enabled": true,
133
- "uid": "78fd150298136c2224f521ad8460ac4d",
134
- "parentId": 1,
135
- "rootParentId": null,
136
- "userId": 2,
137
- "sequence": 1,
138
- "name": "Tea",
139
- "type": 1,
140
- "event": "message.create",
141
- "isFallback": false,
142
- "createdAt": "2024-08-18T08:11:49.000Z",
143
- "updatedAt": "2024-08-24T08:46:09.000Z",
144
- "weight": null,
145
- "items": [
146
- {
147
- "params": [
148
- {
149
- "key": "{message.body}",
150
- "op": "contains",
151
- "value": "earl"
152
- }
153
- ],
154
- "output": [
155
- {
156
- "params": {
157
- "text": "Ok {message.inbox.name}, your earl tea will be served in 5 minutes"
158
- },
159
- "type": "log",
160
- "text": "Log",
161
- "items": [
162
- {
163
- "text": "Name",
164
- "value": "{message.inbox.name}"
165
- },
166
- {
167
- "text": "Text",
168
- "value": "{message.body}"
169
- }
170
- ]
171
- }
172
- ],
173
- "id": 43,
174
- "enabled": true,
175
- "uid": "3a745cd46789deafb55739f088328eaa",
176
- "parentId": 42,
177
- "rootParentId": null,
178
- "userId": 2,
179
- "sequence": 0,
180
- "name": "Earl",
181
- "type": 1,
182
- "event": "message.create",
183
- "isFallback": false,
184
- "createdAt": "2024-08-18T08:24:19.000Z",
185
- "updatedAt": "2024-08-24T08:46:09.000Z",
186
- "weight": null,
187
- "items": []
188
- },
189
- {
190
- "params": [],
191
- "output": [
192
- {
193
- "params": {
194
- "text": "Sorry, we dont serve this"
195
- },
196
- "type": "log",
197
- "text": "Log",
198
- "items": [
199
- {
200
- "text": "Name",
201
- "value": "{message.inbox.name}"
202
- },
203
- {
204
- "text": "Text",
205
- "value": "{message.body}"
206
- }
207
- ]
208
- }
209
- ],
210
- "id": 47,
211
- "enabled": true,
212
- "uid": "5243cc818c1d9f711b45a86ab03ed582",
213
- "parentId": 42,
214
- "rootParentId": null,
215
- "userId": 2,
216
- "sequence": 1,
217
- "name": "Other Teas",
218
- "type": 1,
219
- "event": "message.create",
220
- "isFallback": true,
221
- "createdAt": "2024-08-18T08:57:42.000Z",
222
- "updatedAt": "2024-08-24T08:46:09.000Z",
223
- "weight": null,
224
- "items": []
225
- }
226
- ]
227
- },
228
- {
229
- "params": [],
230
- "output": [
231
- {
232
- "params": {
233
- "text": "Sorry, we dont provide this beverages"
234
- },
235
- "type": "log",
236
- "text": "Log",
237
- "items": [
238
- {
239
- "text": "Name",
240
- "value": "{message.inbox.name}"
241
- },
242
- {
243
- "text": "Text",
244
- "value": "{message.body}"
245
- }
246
- ]
247
- }
248
- ],
249
- "id": 46,
250
- "enabled": true,
251
- "uid": "5199af6c2e0ee6fbe2ca1bb2381ac640",
252
- "parentId": 1,
253
- "rootParentId": null,
254
- "userId": 2,
255
- "sequence": 2,
256
- "name": "Other Beverages",
257
- "type": 1,
258
- "event": "message.create",
259
- "isFallback": true,
260
- "createdAt": "2024-08-18T08:40:59.000Z",
261
- "updatedAt": "2024-08-24T08:46:09.000Z",
262
- "weight": null,
263
- "items": []
264
- }
265
- ]
266
- }
package/src/App.vue DELETED
@@ -1,25 +0,0 @@
1
- <template>
2
- <router-view></router-view>
3
- </template>
4
-
5
- <script>
6
-
7
- export default {
8
- name: 'App',
9
-
10
- setup(){
11
-
12
- }
13
- }
14
-
15
- </script>
16
-
17
- <style>
18
-
19
-
20
- </style>
21
-
22
- <style module>
23
-
24
-
25
- </style>
@@ -1,57 +0,0 @@
1
- <template>
2
- <div :class="$style.comp" @click="$emit('search')">
3
- <div class="flex flex-row gap-1">
4
- <div :class="$style.key">
5
- <div :class="$style.metaKey"></div>
6
- <div :class="$style.lKey"></div>
7
- </div>
8
- </div>
9
- <div class="text-text-300 min-w-[120px]">
10
- Search...
11
- </div>
12
- </div>
13
- </template>
14
-
15
- <script>
16
-
17
- export default{
18
-
19
- emits: [ 'search' ],
20
-
21
- mounted() {
22
- window.addEventListener('keydown', this.onKeyDown)
23
- },
24
-
25
- methods: {
26
-
27
- onKeyDown(e){
28
- if((e.metaKey || e.ctrlKey) && e.keyCode === 75){
29
- this.$emit('search')
30
- }
31
- }
32
-
33
- }
34
-
35
- }
36
-
37
- </script>
38
-
39
- <style module>
40
-
41
- .comp{
42
- @apply h-[var(--h-cp)];
43
- @apply border-text-200 bg-base-50 border-[1px] rounded-lg flex flex-row items-center gap-1 cursor-pointer;
44
- }
45
-
46
- .key{
47
- @apply border-[1px] border-text-200 rounded-md px-1 bg-base-300;
48
- @apply flex flex-row gap-1 px-2 m-1;
49
- }
50
- .metaKey:before{
51
- content: "⌘"
52
- }
53
- .lKey:before{
54
- content: "K"
55
- }
56
-
57
- </style>
@@ -1,27 +0,0 @@
1
- import { createApp } from './main'
2
- import NProgress from "nprogress";
3
- import 'nprogress/nprogress.css';
4
-
5
- const { app, router, pinia } = createApp()
6
-
7
- if(typeof window.__hydration !== 'undefined'){
8
- pinia.state.value = window.__hydration ?? {}
9
- document.getElementById('aHlj').remove()
10
- document.getElementById('aHlk').remove()
11
- }
12
-
13
- NProgress.configure({ showSpinner: false });
14
-
15
- router.beforeEach(async (to, from, next) => {
16
- NProgress.start()
17
- next()
18
- })
19
-
20
- router.afterEach(() => {
21
- NProgress.done()
22
- })
23
-
24
- // wait until router is ready before mounting to ensure hydration match
25
- router.isReady().then(() => {
26
- app.mount(document.body.firstElementChild)
27
- })
@@ -1,73 +0,0 @@
1
- import { createApp } from './main'
2
- import { renderToString } from 'vue/server-renderer'
3
- import path, { basename } from 'path'
4
-
5
- export async function render(req, manifest) {
6
-
7
- let url = req.originalUrl
8
- let redirect = undefined
9
- let cookie = []
10
-
11
- const { app, router, pinia } = createApp()
12
-
13
- // set the router to the desired URL before rendering
14
- router.push({ path:url })
15
- await router.isReady()
16
-
17
- const ctx = {}
18
- const html = await renderToString(app, ctx)
19
-
20
- const preloadLinks = renderPreloadLinks(ctx.modules, manifest)
21
- const serializePinia = "null"
22
- const modalOverlay = ctx.teleports ? ctx.teleports['.bW9k'] ?? '' : ''
23
- const contextOverlay = ctx.teleports ? ctx.teleports['.Y29u'] ?? '' : ''
24
- const alertOverlay = ctx.teleports ? ctx.teleports['.YWxl'] ?? '' : ''
25
- const toastOverlay = ctx.teleports ? ctx.teleports['.dG9h'] ?? '' : ''
26
-
27
- return [ html, preloadLinks, serializePinia, redirect, cookie, modalOverlay, alertOverlay, contextOverlay, toastOverlay ]
28
- }
29
-
30
- function renderPreloadLinks(modules, manifest) {
31
- let links = ''
32
- const seen = new Set()
33
- modules.forEach((id) => {
34
- const files = manifest[id]
35
- if (files) {
36
- files.forEach((file) => {
37
- if (!seen.has(file)) {
38
- seen.add(file)
39
- const filename = basename(file)
40
- if (manifest[filename]) {
41
- for (const depFile of manifest[filename]) {
42
- links += renderPreloadLink(depFile)
43
- seen.add(depFile)
44
- }
45
- }
46
- links += renderPreloadLink(file)
47
- }
48
- })
49
- }
50
- })
51
- return links
52
- }
53
-
54
- function renderPreloadLink(file) {
55
- if (file.endsWith('.js')) {
56
- return `<link rel="modulepreload" crossorigin href="${file}">`
57
- } else if (file.endsWith('.css')) {
58
- return `<link rel="stylesheet" href="${file}">`
59
- } else if (file.endsWith('.woff')) {
60
- return ` <link rel="preload" href="${file}" as="font" type="font/woff" crossorigin>`
61
- } else if (file.endsWith('.woff2')) {
62
- return ` <link rel="preload" href="${file}" as="font" type="font/woff2" crossorigin>`
63
- } else if (file.endsWith('.gif')) {
64
- return ` <link rel="preload" href="${file}" as="image" type="image/gif">`
65
- } else if (file.endsWith('.jpg') || file.endsWith('.jpeg')) {
66
- return ` <link rel="preload" href="${file}" as="image" type="image/jpeg">`
67
- } else if (file.endsWith('.png')) {
68
- return ` <link rel="preload" href="${file}" as="image" type="image/png">`
69
- } else {
70
- // TODO
71
- return ''
72
- }
73
- }
@@ -1,2 +0,0 @@
1
- import {EventEmitter} from "events";
2
- export const eventBus = new EventEmitter();
package/src/main.js DELETED
@@ -1,29 +0,0 @@
1
- import App from './App.vue'
2
- import {createSSRApp, defineAsyncComponent} from 'vue'
3
- import { createPinia } from 'pinia'
4
- import { createRouter } from './router'
5
- import WebScaffold from './index'
6
- import './index.css'
7
-
8
- export function createApp(){
9
-
10
- const app = createSSRApp(App)
11
- const router = createRouter()
12
- const pinia = createPinia()
13
-
14
- app.use(router)
15
- app.use(pinia)
16
- app.use(WebScaffold)
17
-
18
- return { app, router, pinia }
19
- }
20
-
21
-
22
- /*
23
- createApp(App)
24
- .use(componentPlugins)
25
- .use(router)
26
- .mount('#app')
27
-
28
- if(typeof document !== 'undefined')
29
- document.body.firstElementChild.removeAttribute('data-v-app')*/