vue-datocms 8.1.11 → 8.1.13

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/dist/index.cjs.js CHANGED
@@ -60,7 +60,12 @@ function useContentLink(options = {}) {
60
60
  }
61
61
  const enableClickToEdit = (opts) => {
62
62
  var _a;
63
- (_a = controller.value) == null ? void 0 : _a.enableClickToEdit(opts);
63
+ if ((opts == null ? void 0 : opts.hoverOnly) && (typeof window === "undefined" || !window.matchMedia("(hover: hover)").matches)) {
64
+ return;
65
+ }
66
+ (_a = controller.value) == null ? void 0 : _a.enableClickToEdit(
67
+ (opts == null ? void 0 : opts.scrollToNearestTarget) ? { scrollToNearestTarget: opts.scrollToNearestTarget } : void 0
68
+ );
64
69
  };
65
70
  const disableClickToEdit = () => {
66
71
  var _a;
@@ -157,11 +162,15 @@ const ContentLink = vue.defineComponent({
157
162
  root: props.root
158
163
  });
159
164
  vue.onMounted(() => {
160
- if (props.enableClickToEdit && typeof window !== "undefined" && window.parent === window) {
161
- enableClickToEditFn(
162
- props.enableClickToEdit === true ? void 0 : props.enableClickToEdit
163
- );
165
+ if (!props.enableClickToEdit) {
166
+ return;
164
167
  }
168
+ if (window.parent !== window) {
169
+ return;
170
+ }
171
+ enableClickToEditFn(
172
+ props.enableClickToEdit === true ? void 0 : props.enableClickToEdit
173
+ );
165
174
  });
166
175
  vue.watch(
167
176
  () => props.currentPath,
@@ -61,7 +61,12 @@ function useContentLink(options = {}) {
61
61
  }
62
62
  const enableClickToEdit = (opts) => {
63
63
  var _a;
64
- (_a = controller.value) == null ? void 0 : _a.enableClickToEdit(opts);
64
+ if ((opts == null ? void 0 : opts.hoverOnly) && (typeof window === "undefined" || !window.matchMedia("(hover: hover)").matches)) {
65
+ return;
66
+ }
67
+ (_a = controller.value) == null ? void 0 : _a.enableClickToEdit(
68
+ (opts == null ? void 0 : opts.scrollToNearestTarget) ? { scrollToNearestTarget: opts.scrollToNearestTarget } : void 0
69
+ );
65
70
  };
66
71
  const disableClickToEdit = () => {
67
72
  var _a;
@@ -158,11 +163,15 @@ const ContentLink = defineComponent({
158
163
  root: props.root
159
164
  });
160
165
  onMounted(() => {
161
- if (props.enableClickToEdit && typeof window !== "undefined" && window.parent === window) {
162
- enableClickToEditFn(
163
- props.enableClickToEdit === true ? void 0 : props.enableClickToEdit
164
- );
166
+ if (!props.enableClickToEdit) {
167
+ return;
165
168
  }
169
+ if (window.parent !== window) {
170
+ return;
171
+ }
172
+ enableClickToEditFn(
173
+ props.enableClickToEdit === true ? void 0 : props.enableClickToEdit
174
+ );
166
175
  });
167
176
  watch(
168
177
  () => props.currentPath,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vue-datocms",
3
- "version": "8.1.11",
3
+ "version": "8.1.13",
4
4
  "type": "module",
5
5
  "description": "A set of components and utilities to work faster with DatoCMS in Vue.js environments",
6
6
  "keywords": [
@@ -42,7 +42,7 @@
42
42
  "toc": "doctoc --github src/components src/lib"
43
43
  },
44
44
  "dependencies": {
45
- "@datocms/content-link": "^0.3.10",
45
+ "@datocms/content-link": "^0.3.13",
46
46
  "datocms-listen": "^1.0.2",
47
47
  "hls.js": "^1.5.17",
48
48
  "datocms-structured-text-generic-html-renderer": "^5.0.0",