Skip to content

Commit

Permalink
fix(workspace): fix merging the next branch
Browse files Browse the repository at this point in the history
  • Loading branch information
alexjoverm committed Nov 15, 2021
1 parent ad41ac8 commit 5e60168
Show file tree
Hide file tree
Showing 11 changed files with 662 additions and 2,993 deletions.
1 change: 0 additions & 1 deletion .husky/.gitignore

This file was deleted.

2 changes: 1 addition & 1 deletion lib/cypress/component/index.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import StoryblokVue from "@storyblok/vue";
describe("@storyblok/vue", () => {
beforeEach(() => {
mount(Demo, {
extensions: {
global: {
plugins: [StoryblokVue],
},
});
Expand Down
52 changes: 19 additions & 33 deletions lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,39 +6,25 @@ const addClass = (el, className) => {
}
};

function install(Vue) {
Vue.directive("editable", {
bind: function (el, binding) {
if (
typeof binding.value._editable === "undefined" ||
binding.value._editable === null
) {
return;
}
export default {
install: (app) => {
app.directive("editable", {
beforeMount(el, binding) {
if (binding.value) {
const node = binding.value._editable;
if (typeof node === "undefined" || node === null) return;

var options = JSON.parse(
binding.value._editable
.replace("<!--#storyblok#", "")
.replace("-->", "")
);
const cleared = node
.replace("<!--#storyblok#", "")
.replace("-->", "");
const options = JSON.parse(cleared);

el.setAttribute("data-blok-c", JSON.stringify(options));
el.setAttribute("data-blok-uid", options.id + "-" + options.uid);
el.setAttribute("data-blok-c", JSON.stringify(options));
el.setAttribute("data-blok-uid", options.id + "-" + options.uid);

addClass(el, "storyblok__outline");
},
});

if (
typeof window !== "undefined" &&
typeof window.storyblok !== "undefined"
) {
Vue.prototype.$storyblok = window.storyblok;
}
}

if (typeof window !== "undefined" && window.Vue) {
window.Vue.use(install);
}

export default install;
addClass(el, "storyblok__outline");
}
},
});
},
};
20 changes: 10 additions & 10 deletions lib/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,30 +25,30 @@
"devDependencies": {
"@babel/core": "^7.15.0",
"@cypress/vite-dev-server": "^2.0.7",
"@cypress/vue": "^2.2.3",
"@cypress/vue": "^3.0.3",
"@vitejs/plugin-vue": "^1.3.0",
"@vue/babel-preset-app": "^4.5.13",
"@vue/test-utils": "^1.2.2",
"@vue/compiler-sfc": "^3.2.1",
"@vue/test-utils": "next",
"babel-jest": "^26.6.3",
"cypress": "^8.3.0",
"eslint-plugin-cypress": "^2.12.1",
"eslint-plugin-jest": "^25.2.4",
"jest": "^26.6.3",
"vite": "^2.4.4",
"vue": "^2.6.14",
"vue-jest": "^4.0.1",
"vue-template-compiler": "^2.6.14"
},
"babel": {
"presets": [
"@vue/babel-preset-app"
]
"vue": "^3.0.0",
"vue-jest": "next"
},
"eslintConfig": {
"env": {
"node": true
}
},
"babel": {
"presets": [
"@vue/babel-preset-app"
]
},
"jest": {
"moduleFileExtensions": [
"js",
Expand Down
Loading

0 comments on commit 5e60168

Please sign in to comment.