@social-mail/social-mail-client 1.2.18 → 1.2.19

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.
@@ -35385,26 +35385,20 @@ System.register(["@web-atoms/core/dist/core/XNode", "@web-atoms/core/dist/style/
35385
35385
 
35386
35386
  AmdLoader.instance.setup("@social-mail/social-mail-client/dist/site-editor/toolbars/EditorToolbar");
35387
35387
 
35388
- System.register(["@web-atoms/core/dist/core/Bind", "@web-atoms/core/dist/core/XNode", "./EditorToolbar", "../commands/EditorCommand"], function (_export, _context) {
35388
+ System.register(["@web-atoms/core/dist/core/Bind", "@web-atoms/core/dist/core/XNode", "./EditorToolbar"], function (_export, _context) {
35389
35389
  "use strict";
35390
35390
 
35391
- var Bind, XNode, EditorToolbar, EditorCommand;
35391
+ var Bind, XNode, EditorToolbar;
35392
35392
  function UndoRedoToolbar() {
35393
35393
  return XNode.create(EditorToolbar, {
35394
35394
  "data-element": "undo"
35395
35395
  }, XNode.create("i", {
35396
- "event-click": EditorCommand.onClick(editor => {
35397
- editor.redoList.insert(editor.redoList.length, editor.htmlDocument.documentElement.innerHTML);
35398
- editor.htmlDocument.documentElement.innerHTML = editor.undoList.removeAt(editor.undoList.length - 1);
35399
- }),
35396
+ "data-click-event": "undo",
35400
35397
  title: "Undo",
35401
35398
  "data-disabled": Bind.oneWay(editor => editor.undoList.length === 0),
35402
35399
  class: "fas fa-undo"
35403
35400
  }), XNode.create("i", {
35404
- "event-click": EditorCommand.onClick(editor => {
35405
- editor.undoList.insert(editor.undoList.length, editor.htmlDocument.documentElement.innerHTML);
35406
- editor.htmlDocument.documentElement.innerHTML = editor.redoList.removeAt(editor.redoList.length - 1);
35407
- }),
35401
+ "data-click-event": "redo",
35408
35402
  title: "Redo",
35409
35403
  "data-disabled": Bind.oneWay(editor => editor.redoList.length === 0),
35410
35404
  class: "fas fa-redo"
@@ -35418,8 +35412,6 @@ System.register(["@web-atoms/core/dist/core/Bind", "@web-atoms/core/dist/core/XN
35418
35412
  XNode = _webAtomsCoreDistCoreXNode.default;
35419
35413
  }, function (_EditorToolbar) {
35420
35414
  EditorToolbar = _EditorToolbar.default;
35421
- }, function (_commandsEditorCommand) {
35422
- EditorCommand = _commandsEditorCommand.EditorCommand;
35423
35415
  }],
35424
35416
  execute: function () {}
35425
35417
  };
@@ -35558,6 +35550,7 @@ System.register(["tslib", "@web-atoms/core/dist/core/XNode", "@web-atoms/core/di
35558
35550
  "data-layout": "vertical-flex-stretch-items"
35559
35551
  }, ...nodes) : nodes[0];
35560
35552
  return XNode.create(Expander, Object.assign({
35553
+ "data-element": "expander-property-editor",
35561
35554
  isExpanded: isExpanded
35562
35555
  }, a), label && XNode.create("label", null, label), child);
35563
35556
  }
@@ -35636,25 +35629,53 @@ System.register(["tslib", "@web-atoms/core/dist/core/XNode", "@web-atoms/core/di
35636
35629
  styled.css`
35637
35630
 
35638
35631
  display: grid;
35639
- grid-template-columns: auto 1fr;
35640
- grid-template-rows: auto auto;
35632
+ grid-template-columns: 1fr;
35633
+ grid-template-rows: auto auto auto;
35634
+ justify-items: stretch;
35635
+ align-items: center;
35641
35636
  column-gap: 5px;
35637
+ max-width: 200px;
35638
+ & > * {
35639
+ width: 100%;
35640
+ }
35642
35641
  & > label {
35643
35642
  grid-row: 1;
35644
35643
  grid-column: 1;
35645
35644
  }
35646
35645
 
35647
35646
  & > [data-element=editor] {
35648
- grid-row: 1;
35649
- grid-column: 2;
35647
+ grid-row: 2;
35648
+ grid-column: 1;
35650
35649
  }
35651
35650
 
35652
35651
  & > [data-element=custom] {
35653
- grid-row: 2;
35654
- grid-column: 1 / span 2;
35652
+ grid-row: 3;
35653
+ grid-column: 1;
35654
+ }
35655
+
35656
+ & select {
35657
+ outline: none;
35658
+ border: none;
35659
+ background-color: #e7e7e775;
35660
+ border-radius: 9999px;
35661
+ padding-left: 10px;
35662
+ padding-right: 10px;
35655
35663
  }
35656
35664
 
35657
35665
  `.installGlobal("[data-element=property-editor]");
35666
+ styled.css`
35667
+
35668
+ & select {
35669
+ outline: none;
35670
+ border: none;
35671
+ background-color: #e7e7e775;
35672
+ border-radius: 9999px;
35673
+ padding-left: 10px;
35674
+ padding-right: 10px;
35675
+ }
35676
+
35677
+
35678
+ `.installGlobal("[data-element=expander-property-editor]");
35658
35679
  }
35659
35680
  };
35660
35681
  });
@@ -35752,15 +35773,15 @@ System.register(["@web-atoms/core/dist/style/styled", "@web-atoms/core/dist/core
35752
35773
  primarySurfaceText: "gray",
35753
35774
  secondaryBackground: "#00808050",
35754
35775
  secondaryColor: "gray",
35755
- secondaryAccent: "blue",
35776
+ secondaryAccent: "#318984a8",
35756
35777
  secondaryAccentText: "white",
35757
- secondarySurface: "#00A0A080",
35778
+ secondarySurface: "#FFFFFFA0",
35758
35779
  secondarySurfaceText: "gray",
35759
- tertiaryBackground: "#7b4fc596",
35780
+ tertiaryBackground: "#cfa55c87",
35760
35781
  tertiaryColor: "gray",
35761
- tertiaryAccent: "blue",
35782
+ tertiaryAccent: "#e17b42cf",
35762
35783
  tertiaryAccentText: "white",
35763
- tertiarySurface: "#0000A080",
35784
+ tertiarySurface: "#FFFFFFA0",
35764
35785
  tertiarySurfaceText: "gray"
35765
35786
  }));
35766
35787
  _export("sizeVarList", sizeVarList = [stylerVars.sizeTiny, stylerVars.sizeSmall, stylerVars.sizeSmaller, stylerVars.sizeDefault, stylerVars.sizeLarger, stylerVars.sizeLarge, stylerVars.relSizeXS, stylerVars.relSizeSmall, stylerVars.relSizeMedium, stylerVars.relSizeLarge, stylerVars.relSizeXL, stylerVars.relSize2XL, stylerVars.relSize3XL, stylerVars.relSize4XL, stylerVars.relSize5XL, stylerVars.relSize6XL, stylerVars.relSize7XL, stylerVars.relSizeFull, stylerVars.relSizeProse]);
@@ -38236,6 +38257,7 @@ System.register(["tslib", "@web-atoms/core/dist/core/Bind", "@web-atoms/core/dis
38236
38257
  grid-column: 3;
38237
38258
  border-left: solid 1px lightgray;
38238
38259
  border-radius: 0;
38260
+ overflow: auto;
38239
38261
  }
38240
38262
 
38241
38263
  & > [data-element=editor] {
@@ -38385,6 +38407,30 @@ System.register(["tslib", "@web-atoms/core/dist/core/Bind", "@web-atoms/core/dis
38385
38407
  }, {
38386
38408
  capture: true
38387
38409
  });
38410
+ this.htmlDocument.addEventListener("keydown", e => {
38411
+ if (e.ctrlKey || e.metaKey) {
38412
+ switch (e.key) {
38413
+ case "s":
38414
+ this.contentEditor.dispatchEvent(new CustomEvent("savePage", {
38415
+ bubbles: true
38416
+ }));
38417
+ e.preventDefault();
38418
+ break;
38419
+ case "z":
38420
+ this.contentEditor.dispatchEvent(new CustomEvent("undo", {
38421
+ bubbles: true
38422
+ }));
38423
+ e.preventDefault();
38424
+ break;
38425
+ case "y":
38426
+ this.contentEditor.dispatchEvent(new CustomEvent("redo", {
38427
+ bubbles: true
38428
+ }));
38429
+ e.preventDefault();
38430
+ break;
38431
+ }
38432
+ }
38433
+ });
38388
38434
  InstallDragDropHelper(this);
38389
38435
  this.htmlDocument.close();
38390
38436
  setTimeout(() => {
@@ -38542,6 +38588,20 @@ System.register(["tslib", "@web-atoms/core/dist/core/Bind", "@web-atoms/core/dis
38542
38588
  return this.insertImage(prompt("Image Src", ""));
38543
38589
  });
38544
38590
  }
38591
+ onKeyUp(d, ke) {
38592
+ if (ke.ctrlKey) {
38593
+ switch (ke.key) {
38594
+ case "z":
38595
+ ke.preventDefault();
38596
+ this.undo();
38597
+ break;
38598
+ case "y":
38599
+ ke.preventDefault();
38600
+ this.redo();
38601
+ break;
38602
+ }
38603
+ }
38604
+ }
38545
38605
  insertImage(src, style) {
38546
38606
  return __awaiter(this, void 0, void 0, function* () {
38547
38607
  let img;
@@ -38625,6 +38685,14 @@ System.register(["tslib", "@web-atoms/core/dist/core/Bind", "@web-atoms/core/dis
38625
38685
  this.hover.update();
38626
38686
  }, 100);
38627
38687
  }
38688
+ undo() {
38689
+ this.redoList.insert(this.redoList.length, this.htmlDocument.documentElement.innerHTML);
38690
+ this.htmlDocument.documentElement.innerHTML = this.undoList.removeAt(this.undoList.length - 1);
38691
+ }
38692
+ redo() {
38693
+ this.undoList.insert(this.undoList.length, this.htmlDocument.documentElement.innerHTML);
38694
+ this.htmlDocument.documentElement.innerHTML = this.redoList.removeAt(this.redoList.length - 1);
38695
+ }
38628
38696
  setStylerSheet() {
38629
38697
  return __awaiter(this, void 0, void 0, function* () {
38630
38698
  const document = this.htmlDocument;
@@ -38663,6 +38731,15 @@ System.register(["tslib", "@web-atoms/core/dist/core/Bind", "@web-atoms/core/dis
38663
38731
  __decorate([Action({
38664
38732
  onEvent: "change-image"
38665
38733
  }), __metadata("design:type", Function), __metadata("design:paramtypes", []), __metadata("design:returntype", Promise)], HtmlPageEditor.prototype, "changeImage", null);
38734
+ __decorate([Action({
38735
+ onEvent: "keyup"
38736
+ }), __metadata("design:type", Function), __metadata("design:paramtypes", [Object, KeyboardEvent]), __metadata("design:returntype", void 0)], HtmlPageEditor.prototype, "onKeyUp", null);
38737
+ __decorate([Action({
38738
+ onEvent: "undo"
38739
+ }), __metadata("design:type", Function), __metadata("design:paramtypes", []), __metadata("design:returntype", void 0)], HtmlPageEditor.prototype, "undo", null);
38740
+ __decorate([Action({
38741
+ onEvent: "redo"
38742
+ }), __metadata("design:type", Function), __metadata("design:paramtypes", []), __metadata("design:returntype", void 0)], HtmlPageEditor.prototype, "redo", null);
38666
38743
  }
38667
38744
  };
38668
38745
  });