@storyblok/vue 2.1.2 → 4.0.0

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,16 +1,17 @@
1
1
  {
2
2
  "name": "@storyblok/vue",
3
- "version": "2.1.2",
3
+ "version": "4.0.0",
4
4
  "description": "Storyblok directive for get editable elements.",
5
- "main": "./dist/storyblok-vue.umd.js",
6
- "module": "./dist/storyblok-vue.es.js",
5
+ "main": "./dist/storyblok-vue.js",
6
+ "module": "./dist/storyblok-vue.mjs",
7
7
  "files": [
8
- "dist"
8
+ "dist",
9
+ "composables"
9
10
  ],
10
11
  "exports": {
11
12
  ".": {
12
- "import": "./dist/storyblok-vue.es.js",
13
- "require": "./dist/storyblok-vue.umd.js"
13
+ "import": "./dist/storyblok-vue.mjs",
14
+ "require": "./dist/storyblok-vue.js"
14
15
  }
15
16
  },
16
17
  "scripts": {
@@ -22,33 +23,36 @@
22
23
  "test:e2e-watch": "cypress open-ct",
23
24
  "prepublishOnly": "npm run build && cp ../README.md ./"
24
25
  },
26
+ "dependencies": {
27
+ "@storyblok/js": "^1.0.0"
28
+ },
25
29
  "devDependencies": {
26
30
  "@babel/core": "^7.15.0",
27
31
  "@cypress/vite-dev-server": "^2.0.7",
28
- "@cypress/vue": "^2.2.3",
32
+ "@cypress/vue": "^3.0.3",
29
33
  "@vitejs/plugin-vue": "^1.3.0",
30
34
  "@vue/babel-preset-app": "^4.5.13",
31
- "@vue/test-utils": "^1.2.2",
35
+ "@vue/compiler-sfc": "^3.2.1",
36
+ "@vue/test-utils": "next",
32
37
  "babel-jest": "^26.6.3",
33
38
  "cypress": "^8.3.0",
34
39
  "eslint-plugin-cypress": "^2.12.1",
35
40
  "eslint-plugin-jest": "^25.2.4",
36
41
  "jest": "^26.6.3",
37
- "vite": "^2.4.4",
38
- "vue": "^2.6.14",
39
- "vue-jest": "^4.0.1",
40
- "vue-template-compiler": "^2.6.14"
41
- },
42
- "babel": {
43
- "presets": [
44
- "@vue/babel-preset-app"
45
- ]
42
+ "vite": "^2.7.10",
43
+ "vue": "^3.0.0",
44
+ "vue-jest": "next"
46
45
  },
47
46
  "eslintConfig": {
48
47
  "env": {
49
48
  "node": true
50
49
  }
51
50
  },
51
+ "babel": {
52
+ "presets": [
53
+ "@vue/babel-preset-app"
54
+ ]
55
+ },
52
56
  "jest": {
53
57
  "moduleFileExtensions": [
54
58
  "js",
@@ -69,7 +73,6 @@
69
73
  "storyblok"
70
74
  ],
71
75
  "author": "Alexander Feiglstorfer",
72
- "license": "MIT",
73
76
  "bugs": {
74
77
  "url": "https://github.com/storyblok/storyblok-vue/issues"
75
78
  },
@@ -77,11 +80,10 @@
77
80
  "release": {
78
81
  "branches": [
79
82
  "master",
80
- {
81
- "name": "next",
82
- "channel": "next",
83
- "prerelease": "beta"
84
- }
83
+ "next"
85
84
  ]
85
+ },
86
+ "publishConfig": {
87
+ "access": "public"
86
88
  }
87
89
  }
@@ -1,27 +0,0 @@
1
- const addClass = (el, className) => {
2
- if (el.classList) {
3
- el.classList.add(className);
4
- } else if (!new RegExp("\\b" + className + "\\b").test(el.className)) {
5
- el.className += " " + className;
6
- }
7
- };
8
- function install(Vue) {
9
- Vue.directive("editable", {
10
- bind: function(el, binding) {
11
- if (typeof binding.value._editable === "undefined" || binding.value._editable === null) {
12
- return;
13
- }
14
- var options = JSON.parse(binding.value._editable.replace("<!--#storyblok#", "").replace("-->", ""));
15
- el.setAttribute("data-blok-c", JSON.stringify(options));
16
- el.setAttribute("data-blok-uid", options.id + "-" + options.uid);
17
- addClass(el, "storyblok__outline");
18
- }
19
- });
20
- if (typeof window !== "undefined" && typeof window.storyblok !== "undefined") {
21
- Vue.prototype.$storyblok = window.storyblok;
22
- }
23
- }
24
- if (typeof window !== "undefined" && window.Vue) {
25
- window.Vue.use(install);
26
- }
27
- export { install as default };
@@ -1 +0,0 @@
1
- (function(o,i){typeof exports=="object"&&typeof module!="undefined"?module.exports=i():typeof define=="function"&&define.amd?define(i):(o=typeof globalThis!="undefined"?globalThis:o||self,o.storyblok=i())})(this,function(){"use strict";const o=(e,t)=>{e.classList?e.classList.add(t):new RegExp("\\b"+t+"\\b").test(e.className)||(e.className+=" "+t)};function i(e){e.directive("editable",{bind:function(t,d){if(!(typeof d.value._editable=="undefined"||d.value._editable===null)){var n=JSON.parse(d.value._editable.replace("<!--#storyblok#","").replace("-->",""));t.setAttribute("data-blok-c",JSON.stringify(n)),t.setAttribute("data-blok-uid",n.id+"-"+n.uid),o(t,"storyblok__outline")}}}),typeof window!="undefined"&&typeof window.storyblok!="undefined"&&(e.prototype.$storyblok=window.storyblok)}return typeof window!="undefined"&&window.Vue&&window.Vue.use(i),i});