@social-mail/social-mail-client 1.8.385 → 1.8.386

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.385",
3
+ "version": "1.8.386",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -14,7 +14,7 @@ import { PasteElementInside } from "./commands/clipboard/PasteElementInside";
14
14
  import { PasteElementAbove } from "./commands/clipboard/PasteElementAbove";
15
15
  import { EditElement } from "./commands/EditElement";
16
16
  import { EditSvg } from "./commands/svg/EditSvg";
17
- import { SplitImageElement } from "./commands/image/DuplicateElement";
17
+ import { ChangeToImageElement, SplitImageElement } from "./commands/image/SplitImage";
18
18
 
19
19
  let last = null as AtomPopover;
20
20
 
@@ -47,6 +47,7 @@ export default function EditorPopupMenu() {
47
47
  <EditElement/>
48
48
  { /inline-svg/i.test(c.selection.element.tagName) && <EditSvg/>}
49
49
  { /^img$/i.test(c.selection.element.tagName) && <SplitImageElement/>}
50
+ { /^image\-slices$/i.test(c.selection.element.tagName) && <ChangeToImageElement/>}
50
51
 
51
52
  <DeleteElement/>
52
53
  </div>
@@ -17,4 +17,20 @@ export const SplitImageElement = () =>
17
17
  current.parentElement.replaceChild(copy, current);
18
18
  c.commit();
19
19
  })}
20
+ />;
21
+
22
+ export const ChangeToImageElement = () =>
23
+ <MenuItem
24
+ icon="fad fa-image"
25
+ label="Convert to Image"
26
+ event-click={BindEditor.event((c) => {
27
+ const current = c.selection.element;
28
+ const copy = current.ownerDocument.createElement("img");
29
+ const a = current.getAttributeNames();
30
+ for (const name of a) {
31
+ copy.setAttribute(name, current.getAttribute(name));
32
+ }
33
+ current.parentElement.replaceChild(copy, current);
34
+ c.commit();
35
+ })}
20
36
  />;
@@ -1,2 +0,0 @@
1
- export declare const SplitImageElement: () => any;
2
- //# sourceMappingURL=DuplicateElement.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"DuplicateElement.d.ts","sourceRoot":"","sources":["../../../../../src/site-editor/menus/commands/image/DuplicateElement.tsx"],"names":[],"mappings":"AAKA,eAAO,MAAM,iBAAiB,WAcpB,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"names":["XNode","_webAtomsCoreDistCoreXNode","default","_propertiesControlsPropertyEditor","BindEditor","_commonControlsMenuMenuItem","MenuItem","execute","_export","SplitImageElement","create","icon","label","event","c","current","selection","element","copy","ownerDocument","createElement","a","getAttributeNames","name","setAttribute","getAttribute","parentElement","replaceChild","commit"],"sources":["../../../../../src/site-editor/menus/commands/image/DuplicateElement.tsx"],"sourcesContent":[null],"mappings":";;;;;;MAAOA,KAAK,GAAAC,0BAAA,CAAAC,OAAA;IAAA,aAAAC,iCAAA;MACHC,UAAU,GAAAD,iCAAA,CAAVC,UAAU;IAAA,aAAAC,2BAAA;MACZC,QAAQ,GAAAD,2BAAA,CAAAH,OAAA;IAAA;IAAAK,OAAA,WAAAA,CAAA;MAAAC,OAAA,sBAGFC,iBAAiB,GAAGA,CAAA,KAC7BT,KAAA,CAAAU,MAAA,CAACJ,QAAQ;QACLK,IAAI,EAAC,aAAa;QAClBC,KAAK,EAAC,aAAa;QAAA,eACNR,UAAU,CAACS,KAAK,CAAEC,CAAC,IAAI;UAChC,MAAMC,OAAO,GAAGD,CAAC,CAACE,SAAS,CAACC,OAAO;UACnC,MAAMC,IAAI,GAAGH,OAAO,CAACI,aAAa,CAACC,aAAa,CAAC,cAAc,CAAC;UAChE,MAAMC,CAAC,GAAGN,OAAO,CAACO,iBAAiB,EAAE;UACrC,KAAK,MAAMC,IAAI,IAAIF,CAAC,EAAE;YAClBH,IAAI,CAACM,YAAY,CAACD,IAAI,EAAER,OAAO,CAACU,YAAY,CAACF,IAAI,CAAC,CAAC;UACvD;UACAR,OAAO,CAACW,aAAa,CAACC,YAAY,CAACT,IAAI,EAAEH,OAAO,CAAC;UACjDD,CAAC,CAACc,MAAM,EAAE;QACd,CAAC;MAAC,EACA;IAAA;EAAA;AAAA","ignoreList":[]}