@mixd-id/web-scaffold 0.1.230406150 → 0.1.230406151

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.230406150",
4
+ "version": "0.1.230406151",
5
5
  "scripts": {
6
6
  "dev": "vite serve",
7
7
  "build": "vite build",
@@ -131,7 +131,9 @@ export default{
131
131
  this.alert
132
132
 
133
133
  if(err.errors){
134
- return Object.values(err.errors).join("\n")
134
+ return typeof err.errors === 'object' && Object.keys(err.errors).length > 0 ?
135
+ Object.values(err.errors).join("\n") :
136
+ err.errors
135
137
  }
136
138
  else if(err.message){
137
139
  return err.message
@@ -1,6 +1,6 @@
1
1
  <template>
2
2
  <div :class="$style.comp">
3
- <article :class="$style.article"
3
+ <article ref="article" :class="$style.article"
4
4
  v-html="htmlText"
5
5
  :contenteditable="editMode"
6
6
  @input="onInput"
@@ -27,7 +27,7 @@ export default{
27
27
  methods: {
28
28
 
29
29
  getSelection(){
30
- const { text = '', href = '', target = '' } = saveSelection(this.$el)
30
+ const { text = '', href = '', target = '' } = saveSelection(this.$refs.article)
31
31
  return {
32
32
  text,
33
33
  href,
@@ -55,7 +55,7 @@ export default{
55
55
 
56
56
  onClick(){
57
57
  if(this.editMode){
58
- let { element } = getSelection(this.$el)
58
+ let { element } = getSelection(this.$refs.article)
59
59
 
60
60
  const table = this.closest(element, 'table')
61
61
 
@@ -81,7 +81,7 @@ export default{
81
81
  uid: this.uid,
82
82
  type: 'setProp',
83
83
  value: {
84
- htmlText: this.$el.innerHTML
84
+ htmlText: this.$refs.article.innerHTML
85
85
  }
86
86
  }, '*')
87
87
  },
@@ -100,7 +100,7 @@ export default{
100
100
 
101
101
  addTableColumn(){
102
102
 
103
- let { element } = getSelection(this.$el)
103
+ let { element } = getSelection(this.$refs.article)
104
104
  if(element.nodeType !== 1)
105
105
  element = element.parentNode
106
106
  const table = this.closest(element, 'table')
@@ -129,7 +129,7 @@ export default{
129
129
 
130
130
  addTableRow(){
131
131
 
132
- let { element } = getSelection(this.$el)
132
+ let { element } = getSelection(this.$refs.article)
133
133
  if(element.nodeType !== 1)
134
134
  element = element.parentNode
135
135
  const table = this.closest(element, 'table')
@@ -153,7 +153,7 @@ export default{
153
153
 
154
154
  removeTableRow(){
155
155
 
156
- let { element } = getSelection(this.$el)
156
+ let { element } = getSelection(this.$refs.article)
157
157
  if(element.nodeType !== 1)
158
158
  element = element.parentNode
159
159
  const table = this.closest(element, 'table')
@@ -170,7 +170,7 @@ export default{
170
170
 
171
171
  removeTableColumn(){
172
172
 
173
- let { element } = getSelection(this.$el)
173
+ let { element } = getSelection(this.$refs.article)
174
174
  if(element.nodeType !== 1)
175
175
  element = element.parentNode
176
176
  const table = this.closest(element, 'table')
@@ -231,7 +231,7 @@ export default{
231
231
 
232
232
  case 'saveSelection':
233
233
  case 'getSelection':
234
- const sel = saveSelection(this.$el)
234
+ const sel = saveSelection(this.$refs.article)
235
235
  const { text, target, href } = sel
236
236
  result = {
237
237
  text,
@@ -256,7 +256,7 @@ export default{
256
256
  break
257
257
 
258
258
  case 'removeLink':
259
- const { element } = getSelection(this.$el)
259
+ const { element } = getSelection(this.$refs.article)
260
260
 
261
261
  let a = element
262
262
  while(a && a.tagName !== 'A'){
@@ -239,7 +239,7 @@ export default{
239
239
  }
240
240
 
241
241
  .modalBody{
242
- @apply flex-1 min-h-0 overflow-y-auto flex bg-base-400;
242
+ @apply flex-1 min-h-0 overflow-y-auto flex;
243
243
  }
244
244
 
245
245
  .overlay{
@@ -3,7 +3,7 @@
3
3
  <div v-for="(icon, index) in icons" :key="index" class="text-center p-3">
4
4
  <router-link :to="icon.target ?? ''">
5
5
  <Image :src="imageUrl(icon)" class="inline-block aspect-square w-[90%] md:w-[95%] max-w-[64px] rounded-xl"
6
- spinner-type="shimmer"/>
6
+ spinner-type="shimmer" edit-selectable="false"/>
7
7
  <small class="block mt-1 text-center text-xs md:text-sm">{{ icon.text }}</small>
8
8
  </router-link>
9
9
  </div>
@@ -1009,10 +1009,10 @@ export default{
1009
1009
 
1010
1010
  onKeyDown(e){
1011
1011
  if(e.keyCode === 67 && (e.metaKey || e.ctrlKey)){
1012
- this.copy()
1012
+ //this.copy()
1013
1013
  }
1014
1014
  else if(e.keyCode === 86 && (e.metaKey || e.ctrlKey)){
1015
- this.paste(e)
1015
+ //this.paste(e)
1016
1016
  }
1017
1017
  /*else if(e.keyCode === 8){
1018
1018
  if(this.currentItem){