@mixd-id/web-scaffold 0.1.230406267 → 0.1.230406269

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@mixd-id/web-scaffold",
3
3
  "private": false,
4
- "version": "0.1.230406267",
4
+ "version": "0.1.230406269",
5
5
  "scripts": {
6
6
  "dev": "vite serve",
7
7
  "build": "vite build",
@@ -131,6 +131,7 @@ export default{
131
131
  var reader = new FileReader();
132
132
  reader.addEventListener('load', () => {
133
133
  this.$emit('change', reader.result, e.target.files[0])
134
+ this.$refs.file.value = null
134
135
  }, false)
135
136
  reader.readAsDataURL(e.target.files[0]);
136
137
  }
@@ -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' && config.sidebarOpen"
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="config.sidebarOpen = false">
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="config.sidebarOpen"
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.config.sidebarOpen = !this.config.sidebarOpen
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.config.sidebarOpen ? 0 : (this.config.sidebarWidth ?? '360')) + 'px'
491
+ width: (!this.sidebarOpen ? 0 : (this.config.sidebarWidth ?? '360')) + 'px'
474
492
  }
475
493
  },
476
494
 
@@ -109,15 +109,24 @@ export default{
109
109
  methods: {
110
110
 
111
111
  open(context = {}){
112
- this.context = context
113
- this._state = true
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
- if(this.hash){
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(){
@@ -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
- <div class="flex-1">{{ text }}</div>
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(this._opt.debug){
105
- console.log('leave', channel)
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(this._opt.debug){
118
- console.log('join', channel)
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(this._opt.debug){
160
- console.error(e)
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(this._opt.debug){
225
- console.log('broadcast', channel, JSON.stringify({ model, event, items }).substring(0, 70))
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
- console.log(new Date().getTime() - t1, path, params, data)
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,35 @@ 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
+ [ '7', 'min-w-7' ],
1974
+ [ '8', 'min-w-8' ],
1975
+ [ '9', 'min-w-9' ],
1976
+ [ '10', 'min-w-10' ],
1977
+ [ '11', 'min-w-11' ],
1978
+ [ '12', 'min-w-12' ],
1979
+ [ '14', 'min-w-14' ],
1980
+ [ '16', 'min-w-16' ],
1981
+ [ '20', 'min-w-20' ],
1982
+ [ '24', 'min-w-24' ],
1983
+ [ '28', 'min-w-28' ],
1984
+ [ '32', 'min-w-32' ],
1985
+ [ '36', 'min-w-36' ],
1986
+ [ '40', 'min-w-40' ],
1987
+ [ '44', 'min-w-44' ],
1988
+ [ '48', 'min-w-48' ],
1989
+ [ '52', 'min-w-52' ],
1990
+ [ '56', 'min-w-56' ],
1991
+ [ '60', 'min-w-60' ],
1992
+ [ '64', 'min-w-64' ],
1993
+ [ '72', 'min-w-72' ],
1994
+ [ '80', 'min-w-80' ],
1995
+ [ '96', 'min-w-96' ],
1967
1996
  [ 'Full', 'min-w-full' ],
1968
1997
  [ 'Screen', 'min-w-screen' ],
1969
1998
  [ 'Min', 'min-w-min' ],
@@ -757,6 +757,35 @@ export default{
757
757
  { text:'Min Width', key:'minWidth', values: [
758
758
  [ 'min-w-none', 'None' ],
759
759
  [ 'min-w-0', '0' ],
760
+ [ 'min-w-1', '1' ],
761
+ [ 'min-w-2', '2' ],
762
+ [ 'min-w-3', '3' ],
763
+ [ 'min-w-4', '4' ],
764
+ [ 'min-w-5', '5' ],
765
+ [ 'min-w-6', '6' ],
766
+ [ 'min-w-7', '7' ],
767
+ [ 'min-w-8', '8' ],
768
+ [ 'min-w-9', '9' ],
769
+ [ 'min-w-10', '10' ],
770
+ [ 'min-w-11', '11' ],
771
+ [ 'min-w-12', '12' ],
772
+ [ 'min-w-14', '14' ],
773
+ [ 'min-w-16', '16' ],
774
+ [ 'min-w-20', '20' ],
775
+ [ 'min-w-24', '24' ],
776
+ [ 'min-w-28', '28' ],
777
+ [ 'min-w-32', '32' ],
778
+ [ 'min-w-36', '36' ],
779
+ [ 'min-w-40', '40' ],
780
+ [ 'min-w-44', '44' ],
781
+ [ 'min-w-48', '48' ],
782
+ [ 'min-w-52', '52' ],
783
+ [ 'min-w-56', '56' ],
784
+ [ 'min-w-60', '60' ],
785
+ [ 'min-w-64', '64' ],
786
+ [ 'min-w-72', '72' ],
787
+ [ 'min-w-80', '80' ],
788
+ [ 'min-w-96', '96' ],
760
789
  [ 'min-w-full', 'Full' ],
761
790
  [ 'min-w-screen', 'Screen' ],
762
791
  [ 'min-w-min', 'Min' ],
@@ -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',