@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.
@@ -31997,26 +31997,20 @@ System.register(["@web-atoms/core/dist/core/XNode", "@web-atoms/core/dist/style/
31997
31997
 
31998
31998
  AmdLoader.instance.setup("@social-mail/social-mail-client/dist/site-editor/toolbars/EditorToolbar");
31999
31999
 
32000
- System.register(["@web-atoms/core/dist/core/Bind", "@web-atoms/core/dist/core/XNode", "./EditorToolbar", "../commands/EditorCommand"], function (_export, _context) {
32000
+ System.register(["@web-atoms/core/dist/core/Bind", "@web-atoms/core/dist/core/XNode", "./EditorToolbar"], function (_export, _context) {
32001
32001
  "use strict";
32002
32002
 
32003
- var Bind, XNode, EditorToolbar, EditorCommand;
32003
+ var Bind, XNode, EditorToolbar;
32004
32004
  function UndoRedoToolbar() {
32005
32005
  return XNode.create(EditorToolbar, {
32006
32006
  "data-element": "undo"
32007
32007
  }, XNode.create("i", {
32008
- "event-click": EditorCommand.onClick(editor => {
32009
- editor.redoList.insert(editor.redoList.length, editor.htmlDocument.documentElement.innerHTML);
32010
- editor.htmlDocument.documentElement.innerHTML = editor.undoList.removeAt(editor.undoList.length - 1);
32011
- }),
32008
+ "data-click-event": "undo",
32012
32009
  title: "Undo",
32013
32010
  "data-disabled": Bind.oneWay(editor => editor.undoList.length === 0),
32014
32011
  class: "fas fa-undo"
32015
32012
  }), XNode.create("i", {
32016
- "event-click": EditorCommand.onClick(editor => {
32017
- editor.undoList.insert(editor.undoList.length, editor.htmlDocument.documentElement.innerHTML);
32018
- editor.htmlDocument.documentElement.innerHTML = editor.redoList.removeAt(editor.redoList.length - 1);
32019
- }),
32013
+ "data-click-event": "redo",
32020
32014
  title: "Redo",
32021
32015
  "data-disabled": Bind.oneWay(editor => editor.redoList.length === 0),
32022
32016
  class: "fas fa-redo"
@@ -32030,8 +32024,6 @@ System.register(["@web-atoms/core/dist/core/Bind", "@web-atoms/core/dist/core/XN
32030
32024
  XNode = _webAtomsCoreDistCoreXNode.default;
32031
32025
  }, function (_EditorToolbar) {
32032
32026
  EditorToolbar = _EditorToolbar.default;
32033
- }, function (_commandsEditorCommand) {
32034
- EditorCommand = _commandsEditorCommand.EditorCommand;
32035
32027
  }],
32036
32028
  execute: function () {}
32037
32029
  };
@@ -32170,6 +32162,7 @@ System.register(["tslib", "@web-atoms/core/dist/core/XNode", "@web-atoms/core/di
32170
32162
  "data-layout": "vertical-flex-stretch-items"
32171
32163
  }, ...nodes) : nodes[0];
32172
32164
  return XNode.create(Expander, Object.assign({
32165
+ "data-element": "expander-property-editor",
32173
32166
  isExpanded: isExpanded
32174
32167
  }, a), label && XNode.create("label", null, label), child);
32175
32168
  }
@@ -32248,25 +32241,53 @@ System.register(["tslib", "@web-atoms/core/dist/core/XNode", "@web-atoms/core/di
32248
32241
  styled.css`
32249
32242
 
32250
32243
  display: grid;
32251
- grid-template-columns: auto 1fr;
32252
- grid-template-rows: auto auto;
32244
+ grid-template-columns: 1fr;
32245
+ grid-template-rows: auto auto auto;
32246
+ justify-items: stretch;
32247
+ align-items: center;
32253
32248
  column-gap: 5px;
32249
+ max-width: 200px;
32250
+ & > * {
32251
+ width: 100%;
32252
+ }
32254
32253
  & > label {
32255
32254
  grid-row: 1;
32256
32255
  grid-column: 1;
32257
32256
  }
32258
32257
 
32259
32258
  & > [data-element=editor] {
32260
- grid-row: 1;
32261
- grid-column: 2;
32259
+ grid-row: 2;
32260
+ grid-column: 1;
32262
32261
  }
32263
32262
 
32264
32263
  & > [data-element=custom] {
32265
- grid-row: 2;
32266
- grid-column: 1 / span 2;
32264
+ grid-row: 3;
32265
+ grid-column: 1;
32266
+ }
32267
+
32268
+ & select {
32269
+ outline: none;
32270
+ border: none;
32271
+ background-color: #e7e7e775;
32272
+ border-radius: 9999px;
32273
+ padding-left: 10px;
32274
+ padding-right: 10px;
32267
32275
  }
32268
32276
 
32269
32277
  `.installGlobal("[data-element=property-editor]");
32278
+ styled.css`
32279
+
32280
+ & select {
32281
+ outline: none;
32282
+ border: none;
32283
+ background-color: #e7e7e775;
32284
+ border-radius: 9999px;
32285
+ padding-left: 10px;
32286
+ padding-right: 10px;
32287
+ }
32288
+
32289
+
32290
+ `.installGlobal("[data-element=expander-property-editor]");
32270
32291
  }
32271
32292
  };
32272
32293
  });
@@ -32364,15 +32385,15 @@ System.register(["@web-atoms/core/dist/style/styled", "@web-atoms/core/dist/core
32364
32385
  primarySurfaceText: "gray",
32365
32386
  secondaryBackground: "#00808050",
32366
32387
  secondaryColor: "gray",
32367
- secondaryAccent: "blue",
32388
+ secondaryAccent: "#318984a8",
32368
32389
  secondaryAccentText: "white",
32369
- secondarySurface: "#00A0A080",
32390
+ secondarySurface: "#FFFFFFA0",
32370
32391
  secondarySurfaceText: "gray",
32371
- tertiaryBackground: "#7b4fc596",
32392
+ tertiaryBackground: "#cfa55c87",
32372
32393
  tertiaryColor: "gray",
32373
- tertiaryAccent: "blue",
32394
+ tertiaryAccent: "#e17b42cf",
32374
32395
  tertiaryAccentText: "white",
32375
- tertiarySurface: "#0000A080",
32396
+ tertiarySurface: "#FFFFFFA0",
32376
32397
  tertiarySurfaceText: "gray"
32377
32398
  }));
32378
32399
  _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]);
@@ -34848,6 +34869,7 @@ System.register(["tslib", "@web-atoms/core/dist/core/Bind", "@web-atoms/core/dis
34848
34869
  grid-column: 3;
34849
34870
  border-left: solid 1px lightgray;
34850
34871
  border-radius: 0;
34872
+ overflow: auto;
34851
34873
  }
34852
34874
 
34853
34875
  & > [data-element=editor] {
@@ -34997,6 +35019,30 @@ System.register(["tslib", "@web-atoms/core/dist/core/Bind", "@web-atoms/core/dis
34997
35019
  }, {
34998
35020
  capture: true
34999
35021
  });
35022
+ this.htmlDocument.addEventListener("keydown", e => {
35023
+ if (e.ctrlKey || e.metaKey) {
35024
+ switch (e.key) {
35025
+ case "s":
35026
+ this.contentEditor.dispatchEvent(new CustomEvent("savePage", {
35027
+ bubbles: true
35028
+ }));
35029
+ e.preventDefault();
35030
+ break;
35031
+ case "z":
35032
+ this.contentEditor.dispatchEvent(new CustomEvent("undo", {
35033
+ bubbles: true
35034
+ }));
35035
+ e.preventDefault();
35036
+ break;
35037
+ case "y":
35038
+ this.contentEditor.dispatchEvent(new CustomEvent("redo", {
35039
+ bubbles: true
35040
+ }));
35041
+ e.preventDefault();
35042
+ break;
35043
+ }
35044
+ }
35045
+ });
35000
35046
  InstallDragDropHelper(this);
35001
35047
  this.htmlDocument.close();
35002
35048
  setTimeout(() => {
@@ -35154,6 +35200,20 @@ System.register(["tslib", "@web-atoms/core/dist/core/Bind", "@web-atoms/core/dis
35154
35200
  return this.insertImage(prompt("Image Src", ""));
35155
35201
  });
35156
35202
  }
35203
+ onKeyUp(d, ke) {
35204
+ if (ke.ctrlKey) {
35205
+ switch (ke.key) {
35206
+ case "z":
35207
+ ke.preventDefault();
35208
+ this.undo();
35209
+ break;
35210
+ case "y":
35211
+ ke.preventDefault();
35212
+ this.redo();
35213
+ break;
35214
+ }
35215
+ }
35216
+ }
35157
35217
  insertImage(src, style) {
35158
35218
  return __awaiter(this, void 0, void 0, function* () {
35159
35219
  let img;
@@ -35237,6 +35297,14 @@ System.register(["tslib", "@web-atoms/core/dist/core/Bind", "@web-atoms/core/dis
35237
35297
  this.hover.update();
35238
35298
  }, 100);
35239
35299
  }
35300
+ undo() {
35301
+ this.redoList.insert(this.redoList.length, this.htmlDocument.documentElement.innerHTML);
35302
+ this.htmlDocument.documentElement.innerHTML = this.undoList.removeAt(this.undoList.length - 1);
35303
+ }
35304
+ redo() {
35305
+ this.undoList.insert(this.undoList.length, this.htmlDocument.documentElement.innerHTML);
35306
+ this.htmlDocument.documentElement.innerHTML = this.redoList.removeAt(this.redoList.length - 1);
35307
+ }
35240
35308
  setStylerSheet() {
35241
35309
  return __awaiter(this, void 0, void 0, function* () {
35242
35310
  const document = this.htmlDocument;
@@ -35275,6 +35343,15 @@ System.register(["tslib", "@web-atoms/core/dist/core/Bind", "@web-atoms/core/dis
35275
35343
  __decorate([Action({
35276
35344
  onEvent: "change-image"
35277
35345
  }), __metadata("design:type", Function), __metadata("design:paramtypes", []), __metadata("design:returntype", Promise)], HtmlPageEditor.prototype, "changeImage", null);
35346
+ __decorate([Action({
35347
+ onEvent: "keyup"
35348
+ }), __metadata("design:type", Function), __metadata("design:paramtypes", [Object, KeyboardEvent]), __metadata("design:returntype", void 0)], HtmlPageEditor.prototype, "onKeyUp", null);
35349
+ __decorate([Action({
35350
+ onEvent: "undo"
35351
+ }), __metadata("design:type", Function), __metadata("design:paramtypes", []), __metadata("design:returntype", void 0)], HtmlPageEditor.prototype, "undo", null);
35352
+ __decorate([Action({
35353
+ onEvent: "redo"
35354
+ }), __metadata("design:type", Function), __metadata("design:paramtypes", []), __metadata("design:returntype", void 0)], HtmlPageEditor.prototype, "redo", null);
35278
35355
  }
35279
35356
  };
35280
35357
  });