@kvass/rich-text 1.4.10 → 1.4.12

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,6 +1,6 @@
1
1
  {
2
2
  "name": "@kvass/rich-text",
3
- "version": "1.4.10",
3
+ "version": "1.4.12",
4
4
  "description": "rich text component for kvass",
5
5
  "main": "src/Component.vue",
6
6
  "scripts": {
@@ -34,11 +34,11 @@
34
34
  },
35
35
  "dependencies": {
36
36
  "@kvass/storage": "^1.1.0",
37
- "@tiptap/extension-image": "^2.0.0-beta.220",
38
- "@tiptap/extension-link": "^2.0.0-beta.220",
39
- "@tiptap/extension-superscript": "^2.2.1",
40
- "@tiptap/pm": "^2.0.0-beta.220",
41
- "@tiptap/starter-kit": "^2.0.0-beta.220",
42
- "@tiptap/vue-2": "^2.0.0-beta.220"
37
+ "@tiptap/extension-image": "^2.2.2",
38
+ "@tiptap/extension-link": "^2.2.2",
39
+ "@tiptap/extension-superscript": "^2.2.2",
40
+ "@tiptap/pm": "^2.2.2",
41
+ "@tiptap/starter-kit": "^2.2.2",
42
+ "@tiptap/vue-2": "^2.2.2"
43
43
  }
44
44
  }
package/src/Component.vue CHANGED
@@ -88,7 +88,8 @@ const DefaultCommands = [
88
88
  'link',
89
89
  'cta',
90
90
  ]
91
- const DefaultLabels = { primary: 'Primær', secondary: 'Sekundær' }
91
+
92
+ import { Options } from './index'
92
93
 
93
94
  export { DefaultCommands }
94
95
  export default {
@@ -104,7 +105,7 @@ export default {
104
105
  },
105
106
  labels: {
106
107
  type: Object,
107
- default: () => DefaultLabels,
108
+ default: () => Options.labels,
108
109
  },
109
110
  },
110
111
  watch: {
@@ -200,7 +201,7 @@ export default {
200
201
  extension: Link,
201
202
  appearance: {
202
203
  menu: true,
203
- bubble: false,
204
+ bubble: true,
204
205
  },
205
206
  },
206
207
  {
@@ -225,7 +226,7 @@ export default {
225
226
  extension: CallToAction,
226
227
  appearance: {
227
228
  menu: true,
228
- bubble: false,
229
+ bubble: true,
229
230
  },
230
231
  },
231
232
  ]
@@ -291,6 +292,9 @@ export default {
291
292
  let html = this.editor.getHTML().replace(/^<p>\s*<\/p>$/, '')
292
293
  this.$emit('input', html)
293
294
  },
295
+ onSelectionUpdate: ({ editor }) => {
296
+ if (!this.bubbleShouldShow({ editor })) this.bubbleState = null
297
+ },
294
298
  })
295
299
  },
296
300
  beforeDestroy() {
@@ -316,6 +320,10 @@ export default {
316
320
  background-color: var(--vue-elder-input-color, #fafafa);
317
321
  }
318
322
 
323
+ .tippy-content > div {
324
+ visibility: visible !important; // Fix for visibility bug
325
+ }
326
+
319
327
  &:not(.richtext--disabled):focus-within {
320
328
  outline: 1px solid var(--primary);
321
329
  border-radius: var(--border-radius, 3px);
package/src/index.js CHANGED
@@ -1,2 +1,17 @@
1
1
  import Component from './Component'
2
2
  export default Component
3
+
4
+ const Options = {
5
+ labels: {
6
+ primary: 'Primærfarge',
7
+ secondary: 'Sekundærfarge',
8
+ },
9
+ }
10
+ const setup = options => {
11
+ for (let key in options) {
12
+ if (!(key in Options)) return
13
+ Options[key] = options[key]
14
+ }
15
+ }
16
+
17
+ export { setup, Options }