@mixd-id/web-scaffold 0.1.230406267 → 0.1.230406268
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/components/Image.vue +1 -0
- package/src/components/List.vue +23 -5
- package/src/components/Modal.vue +14 -10
- package/src/components/Toast.vue +4 -1
- package/src/utils/wss.js +13 -8
- package/src/utils/wss.mjs +3 -1
- package/src/widgets/ComponentSetting.vue +30 -0
- package/tailwind.config.js +10 -0
package/package.json
CHANGED
package/src/components/Image.vue
CHANGED
package/src/components/List.vue
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
<div v-if="readyState === 1"
|
|
4
4
|
class="flex-1 flex flex-row">
|
|
5
5
|
|
|
6
|
-
<div v-if="computedPresetMode === 'sidebar' &&
|
|
6
|
+
<div v-if="computedPresetMode === 'sidebar' && sidebarOpen"
|
|
7
7
|
class="relative flex flex-col border-r-[1px] border-text-50 panel-400"
|
|
8
8
|
:style="sidebarWidth">
|
|
9
9
|
|
|
@@ -11,13 +11,13 @@
|
|
|
11
11
|
class="flex-1"
|
|
12
12
|
@apply="load">
|
|
13
13
|
<template #toolbar>
|
|
14
|
-
<button type="button" class="px-1" @click="
|
|
14
|
+
<button type="button" class="px-1" @click="closeSidebar">
|
|
15
15
|
<svg width="19" height="19" class="fill-text-300 hover:fill-red-500" 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="M312.1 375c9.369 9.369 9.369 24.57 0 33.94s-24.57 9.369-33.94 0L160 289.9l-119 119c-9.369 9.369-24.57 9.369-33.94 0s-9.369-24.57 0-33.94L126.1 256L7.027 136.1c-9.369-9.369-9.369-24.57 0-33.94s24.57-9.369 33.94 0L160 222.1l119-119c9.369-9.369 24.57-9.369 33.94 0s9.369 24.57 0 33.94L193.9 256L312.1 375z"/></svg>
|
|
16
16
|
</button>
|
|
17
17
|
</template>
|
|
18
18
|
</PresetBar>
|
|
19
19
|
|
|
20
|
-
<div v-if="
|
|
20
|
+
<div v-if="sidebarOpen"
|
|
21
21
|
:class="$style.resize1"
|
|
22
22
|
@mousedown="(e) => $util.dragResize(e, resize1)"></div>
|
|
23
23
|
</div>
|
|
@@ -166,6 +166,10 @@ export default{
|
|
|
166
166
|
type: [ String, Boolean ],
|
|
167
167
|
default: true
|
|
168
168
|
},
|
|
169
|
+
editHash: {
|
|
170
|
+
type: String,
|
|
171
|
+
default: '#719ed'
|
|
172
|
+
}
|
|
169
173
|
},
|
|
170
174
|
|
|
171
175
|
methods: {
|
|
@@ -326,7 +330,10 @@ export default{
|
|
|
326
330
|
break
|
|
327
331
|
|
|
328
332
|
case 'sidebar':
|
|
329
|
-
this.
|
|
333
|
+
this.$router.push({
|
|
334
|
+
...this.$route,
|
|
335
|
+
hash: this.$route.hash.replace(this.editHash, '') + this.editHash
|
|
336
|
+
})
|
|
330
337
|
break
|
|
331
338
|
|
|
332
339
|
default:
|
|
@@ -336,6 +343,13 @@ export default{
|
|
|
336
343
|
}
|
|
337
344
|
},
|
|
338
345
|
|
|
346
|
+
closeSidebar(){
|
|
347
|
+
this.$router.replace({
|
|
348
|
+
...this.$route,
|
|
349
|
+
hash: this.$route.hash.replace(this.editHash, '')
|
|
350
|
+
})
|
|
351
|
+
},
|
|
352
|
+
|
|
339
353
|
onSignal(event, items){
|
|
340
354
|
|
|
341
355
|
switch(event){
|
|
@@ -468,9 +482,13 @@ export default{
|
|
|
468
482
|
(this.view ?? this.preset.view)
|
|
469
483
|
},
|
|
470
484
|
|
|
485
|
+
sidebarOpen(){
|
|
486
|
+
return this.$route.hash.indexOf(this.editHash) >= 0
|
|
487
|
+
},
|
|
488
|
+
|
|
471
489
|
sidebarWidth(){
|
|
472
490
|
return {
|
|
473
|
-
width: (!this.
|
|
491
|
+
width: (!this.sidebarOpen ? 0 : (this.config.sidebarWidth ?? '360')) + 'px'
|
|
474
492
|
}
|
|
475
493
|
},
|
|
476
494
|
|
package/src/components/Modal.vue
CHANGED
|
@@ -109,15 +109,24 @@ export default{
|
|
|
109
109
|
methods: {
|
|
110
110
|
|
|
111
111
|
open(context = {}){
|
|
112
|
-
|
|
113
|
-
|
|
112
|
+
this.context = context
|
|
113
|
+
|
|
114
|
+
if(this.hash){
|
|
115
|
+
this.$router.push({
|
|
116
|
+
...this.$route,
|
|
117
|
+
hash: this.$route.hash.replace(this.hash, '') + this.hash
|
|
118
|
+
})
|
|
119
|
+
}
|
|
120
|
+
else{
|
|
121
|
+
this._state = true
|
|
122
|
+
}
|
|
114
123
|
},
|
|
115
124
|
|
|
116
125
|
close(){
|
|
117
126
|
if(this.hash){
|
|
118
127
|
this.$router.replace({
|
|
119
128
|
...this.$route,
|
|
120
|
-
hash: this.$route.hash.replace(`${this.hash}`, '')
|
|
129
|
+
hash: this.hash === '#' ? '' : this.$route.hash.replace(`${this.hash}`, '')
|
|
121
130
|
})
|
|
122
131
|
}
|
|
123
132
|
else{
|
|
@@ -127,13 +136,8 @@ export default{
|
|
|
127
136
|
|
|
128
137
|
dismiss(){
|
|
129
138
|
if(this.isDisabled) return
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
this.$router.push({ hash: this.$route.hash.replace(this.hash, '') })
|
|
133
|
-
}
|
|
134
|
-
else{
|
|
135
|
-
this.$emit('dismiss')
|
|
136
|
-
}
|
|
139
|
+
this.close()
|
|
140
|
+
this.$emit('dismiss')
|
|
137
141
|
},
|
|
138
142
|
|
|
139
143
|
onAfterLeave(){
|
package/src/components/Toast.vue
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
<slot>
|
|
7
7
|
<div class="p-6">
|
|
8
8
|
<div ref="item" :class="$style.item" @mouseover="onMouseOver" @mouseout="onMouseOut">
|
|
9
|
-
<
|
|
9
|
+
<p class="flex-1 whitespace-pre-wrap">{{ text }}</p>
|
|
10
10
|
<div>
|
|
11
11
|
<button type="button" class="text-sm text-primary" @click="close">Dismiss</button>
|
|
12
12
|
</div>
|
|
@@ -58,6 +58,9 @@ export default{
|
|
|
58
58
|
if(this.toast.text){
|
|
59
59
|
return this.toast.text
|
|
60
60
|
}
|
|
61
|
+
else if(this.toast.errors){
|
|
62
|
+
return Object.values(this.toast.errors).join('\n')
|
|
63
|
+
}
|
|
61
64
|
else if(this.toast.message){
|
|
62
65
|
return this.toast.message
|
|
63
66
|
}
|
package/src/utils/wss.js
CHANGED
|
@@ -101,8 +101,8 @@ class WSS extends EventEmitter2{
|
|
|
101
101
|
if((socket.channels ?? {})[channel]){
|
|
102
102
|
delete socket.channels[channel]
|
|
103
103
|
|
|
104
|
-
if(
|
|
105
|
-
|
|
104
|
+
if(process.verbose){
|
|
105
|
+
process.verbose('wss.leave', channel)
|
|
106
106
|
}
|
|
107
107
|
}
|
|
108
108
|
}
|
|
@@ -114,8 +114,8 @@ class WSS extends EventEmitter2{
|
|
|
114
114
|
|
|
115
115
|
socket.channels[channel] = 1
|
|
116
116
|
|
|
117
|
-
if(
|
|
118
|
-
|
|
117
|
+
if(process.verbose){
|
|
118
|
+
process.verbose('wss.join', channel)
|
|
119
119
|
}
|
|
120
120
|
}
|
|
121
121
|
|
|
@@ -156,8 +156,8 @@ class WSS extends EventEmitter2{
|
|
|
156
156
|
data = arr.length > 0 ? JSON.parse(JSON.stringify(arr.pop())) : data
|
|
157
157
|
}
|
|
158
158
|
catch(e){
|
|
159
|
-
if(
|
|
160
|
-
|
|
159
|
+
if(process.verbose){
|
|
160
|
+
process.verbose('wss.error', e)
|
|
161
161
|
}
|
|
162
162
|
|
|
163
163
|
status = 500
|
|
@@ -221,8 +221,13 @@ class WSS extends EventEmitter2{
|
|
|
221
221
|
|
|
222
222
|
async broadcast(channel, { model, event, items }){
|
|
223
223
|
|
|
224
|
-
if(
|
|
225
|
-
|
|
224
|
+
if(process.verbose){
|
|
225
|
+
process.verbose('wss.broadcast', {
|
|
226
|
+
channel,
|
|
227
|
+
model,
|
|
228
|
+
event,
|
|
229
|
+
items
|
|
230
|
+
})
|
|
226
231
|
}
|
|
227
232
|
|
|
228
233
|
for(let socket of this._instance.clients){
|
package/src/utils/wss.mjs
CHANGED
|
@@ -107,7 +107,9 @@ class WSS extends EventEmitter2{
|
|
|
107
107
|
delete this._callbacks[_requestId]
|
|
108
108
|
|
|
109
109
|
if(this._opt.debug){
|
|
110
|
-
|
|
110
|
+
status === 200 ?
|
|
111
|
+
console.log(new Date().getTime() - t1, path, params, data) :
|
|
112
|
+
console.error(new Date().getTime() - t1, path, params, data)
|
|
111
113
|
}
|
|
112
114
|
}
|
|
113
115
|
}
|
|
@@ -1964,6 +1964,36 @@ export default{
|
|
|
1964
1964
|
minWidth: [
|
|
1965
1965
|
[ 'None', 'min-w-none' ],
|
|
1966
1966
|
[ '0', 'min-w-0' ],
|
|
1967
|
+
[ '1', 'min-w-1' ],
|
|
1968
|
+
[ '2', 'min-w-2' ],
|
|
1969
|
+
[ '3', 'min-w-3' ],
|
|
1970
|
+
[ '4', 'min-w-4' ],
|
|
1971
|
+
[ '5', 'min-w-5' ],
|
|
1972
|
+
[ '6', 'min-w-6' ],
|
|
1973
|
+
[ '6', 'min-w-6' ],
|
|
1974
|
+
[ '7', 'min-w-7' ],
|
|
1975
|
+
[ '8', 'min-w-8' ],
|
|
1976
|
+
[ '9', 'min-w-9' ],
|
|
1977
|
+
[ '10', 'min-w-10' ],
|
|
1978
|
+
[ '11', 'min-w-11' ],
|
|
1979
|
+
[ '12', 'min-w-12' ],
|
|
1980
|
+
[ '14', 'min-w-14' ],
|
|
1981
|
+
[ '16', 'min-w-16' ],
|
|
1982
|
+
[ '20', 'min-w-20' ],
|
|
1983
|
+
[ '24', 'min-w-24' ],
|
|
1984
|
+
[ '28', 'min-w-28' ],
|
|
1985
|
+
[ '32', 'min-w-32' ],
|
|
1986
|
+
[ '36', 'min-w-36' ],
|
|
1987
|
+
[ '40', 'min-w-40' ],
|
|
1988
|
+
[ '44', 'min-w-44' ],
|
|
1989
|
+
[ '48', 'min-w-48' ],
|
|
1990
|
+
[ '52', 'min-w-52' ],
|
|
1991
|
+
[ '56', 'min-w-56' ],
|
|
1992
|
+
[ '60', 'min-w-60' ],
|
|
1993
|
+
[ '64', 'min-w-64' ],
|
|
1994
|
+
[ '72', 'min-w-72' ],
|
|
1995
|
+
[ '80', 'min-w-80' ],
|
|
1996
|
+
[ '96', 'min-w-96' ],
|
|
1967
1997
|
[ 'Full', 'min-w-full' ],
|
|
1968
1998
|
[ 'Screen', 'min-w-screen' ],
|
|
1969
1999
|
[ 'Min', 'min-w-min' ],
|
package/tailwind.config.js
CHANGED
|
@@ -73,6 +73,11 @@ module.exports = {
|
|
|
73
73
|
'w-[60px]', 'w-[120px]', 'w-[180px]', 'w-[240px]', 'w-[300px]', 'w-[360px]', 'w-[420px]', 'w-[480px]',
|
|
74
74
|
|
|
75
75
|
'min-w-none', 'min-w-full', 'min-w-min', 'min-w-max', 'min-w-fit', 'min-w-0',
|
|
76
|
+
'md:min-w-0', 'md:min-w-1', 'md:min-w-2', 'md:min-w-3', 'md:min-w-4', 'md:min-w-5', 'md:min-w-6',
|
|
77
|
+
'md:min-w-7', 'md:min-w-8', 'md:min-w-9', 'md:min-w-10', 'md:min-w-11', 'md:min-w-12', 'md:min-w-14',
|
|
78
|
+
'md:min-w-16', 'md:min-w-20', 'md:min-w-24', 'md:min-w-28', 'md:min-w-32', 'md:min-w-36', 'md:min-w-40',
|
|
79
|
+
'md:min-w-44', 'md:min-w-48', 'md:min-w-52', 'md:min-w-56', 'md:min-w-60', 'md:min-w-64', 'md:min-w-72',
|
|
80
|
+
'md:min-w-80', 'md:min-w-96',
|
|
76
81
|
|
|
77
82
|
'max-w-none', 'max-w-0', 'max-w-xs', 'max-w-sm', 'max-w-md', 'max-w-lg', 'max-w-xl', 'max-w-2xl', 'max-w-3xl',
|
|
78
83
|
'max-w-4xl', 'max-w-screen-sm', 'max-w-screen-md', 'max-w-screen-lg', 'max-w-screen-xl', 'max-w-screen-2xl',
|
|
@@ -298,6 +303,11 @@ module.exports = {
|
|
|
298
303
|
'md:w-[60px]', 'md:w-[120px]', 'md:w-[180px]', 'md:w-[240px]', 'md:w-[300px]', 'md:w-[360px]', 'md:w-[420px]', 'md:w-[480px]',
|
|
299
304
|
|
|
300
305
|
'md:min-w-none', 'md:min-w-full', 'md:min-w-min', 'md:min-w-max', 'md:min-w-fit', 'md:min-w-0',
|
|
306
|
+
'md:min-w-0', 'md:min-w-1', 'md:min-w-2', 'md:min-w-3', 'md:min-w-4', 'md:min-w-5', 'md:min-w-6',
|
|
307
|
+
'md:min-w-7', 'md:min-w-8', 'md:min-w-9', 'md:min-w-10', 'md:min-w-11', 'md:min-w-12', 'md:min-w-14',
|
|
308
|
+
'md:min-w-16', 'md:min-w-20', 'md:min-w-24', 'md:min-w-28', 'md:min-w-32', 'md:min-w-36', 'md:min-w-40',
|
|
309
|
+
'md:min-w-44', 'md:min-w-48', 'md:min-w-52', 'md:min-w-56', 'md:min-w-60', 'md:min-w-64', 'md:min-w-72',
|
|
310
|
+
'md:min-w-80', 'md:min-w-96',
|
|
301
311
|
|
|
302
312
|
'md:max-w-none', 'md:max-w-0', 'md:max-w-xs', 'md:max-w-sm', 'md:max-w-md', 'md:max-w-lg', 'md:max-w-xl', 'md:max-w-2xl', 'md:max-w-3xl',
|
|
303
313
|
'md:max-w-4xl', 'md:max-w-screen-sm', 'md:max-w-screen-md', 'md:max-w-screen-lg', 'md:max-w-screen-xl', 'md:max-w-screen-2xl',
|