@social-mail/social-mail-client 1.8.438 → 1.8.439

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": "@social-mail/social-mail-client",
3
- "version": "1.8.438",
3
+ "version": "1.8.439",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -62,6 +62,7 @@ import { IAppFile } from "../../model/model";
62
62
  import { SelectionUI } from "./ui/SelectionUI";
63
63
  import { desktopScreenWidth, mobileScreenWidth, tabletScreenWidth } from "./sizes";
64
64
  import UIGuides from "./guides/UIGuides";
65
+ import PopupService from "@web-atoms/core/dist/web/services/PopupService";
65
66
 
66
67
  const desktopWidth = desktopScreenWidth;
67
68
  const tabletWidth = tabletScreenWidth;
@@ -613,6 +614,14 @@ export default class HtmlPageEditor extends AtomControl {
613
614
  onEventTarget: document.body
614
615
  })
615
616
  async onToolSelected(item: IToolItem) {
617
+
618
+ const { selection } = this;
619
+ if (selection.element.tagName === "INJECT") {
620
+ return PopupService.alert({
621
+ message: "Cannot insert tool into injected component"
622
+ });
623
+ }
624
+
616
625
  const t = await this.copyAssets(item);
617
626
  const s = this.selectedTarget();
618
627
 
@@ -630,7 +639,7 @@ export default class HtmlPageEditor extends AtomControl {
630
639
  const copy = root.firstElementChild as HTMLElement;
631
640
 
632
641
  setTimeout(() => {
633
- this.selection.update(copy);
642
+ selection.update(copy);
634
643
  }, 10);
635
644
 
636
645
  if(/^(inject|footer)/i.test(s.lastElementChild?.tagName)) {
@@ -210,6 +210,7 @@ export default class StudioLayers extends AtomControl {
210
210
  if (ee === this.editor.selection.element) {
211
211
  return;
212
212
  }
213
+
213
214
  this.editor.selection.update(ee);
214
215
  if (ee.scrollIntoViewIfNeeded) {
215
216
  ee.scrollIntoViewIfNeeded();