@datocms/astro 0.6.8 → 0.6.10
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
|
@@ -171,8 +171,12 @@ const enableClickToEditValue =
|
|
|
171
171
|
};
|
|
172
172
|
document.addEventListener('astro:page-load', this.pageLoadHandler);
|
|
173
173
|
|
|
174
|
-
// Enable click-to-edit mode if requested via prop
|
|
175
|
-
|
|
174
|
+
// Enable click-to-edit mode if requested via prop.
|
|
175
|
+
// Never enable when running inside an iframe (e.g. the DatoCMS Web Previews plugin),
|
|
176
|
+
// because the plugin already manages its own editing experience.
|
|
177
|
+
const isInIframe = window.self !== window.top;
|
|
178
|
+
|
|
179
|
+
if (enableClickToEdit && !isInIframe) {
|
|
176
180
|
// Check if hoverOnly is set and device doesn't support hover
|
|
177
181
|
const hoverOnly = typeof enableClickToEdit === 'object' && enableClickToEdit.hoverOnly;
|
|
178
182
|
|