@koumoul/vjsf 3.19.1 → 3.19.2

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": "@koumoul/vjsf",
3
- "version": "3.19.1",
3
+ "version": "3.19.2",
4
4
  "description": "Generate forms for the vuetify UI library (vuejs) based on annotated JSON schemas.",
5
5
  "scripts": {
6
6
  "test": "vitest run",
@@ -3,6 +3,8 @@ import { provide, inject, ref, computed } from 'vue'
3
3
  const globalClipboardKey = Symbol('vjsf:clipboard')
4
4
 
5
5
  export const createClipboard = () => {
6
+ // if already provided on parent, do not re-create
7
+ if (inject(globalClipboardKey, null)) return
6
8
  const store = {}
7
9
  provide(globalClipboardKey, store)
8
10
  }
@@ -12,6 +14,7 @@ export const createClipboard = () => {
12
14
  */
13
15
  export default function (keyGetter) {
14
16
  const store = inject(globalClipboardKey)
17
+ if (!store) throw new Error('useClipboard called without prior createClipboard')
15
18
  return computed({
16
19
  get () {
17
20
  const key = keyGetter()
@@ -1 +1 @@
1
- {"version":3,"file":"use-clipboard.d.ts","sourceRoot":"","sources":["../../src/composables/use-clipboard.js"],"names":[],"mappings":"AASA;;GAEG;AACH,4CAFW,MAAM,MAAM,+CAgBtB;AAtBM,wCAGN"}
1
+ {"version":3,"file":"use-clipboard.d.ts","sourceRoot":"","sources":["../../src/composables/use-clipboard.js"],"names":[],"mappings":"AAWA;;GAEG;AACH,4CAFW,MAAM,MAAM,+CAiBtB;AAzBM,wCAKN"}