@social-mail/social-mail-client 1.2.131 → 1.2.133
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/content/editor/edit.html +3 -3
- package/dist/admin/AdminAppIndex.pack.js +169 -102
- package/dist/admin/AdminAppIndex.pack.js.map +1 -1
- package/dist/admin/AdminAppIndex.pack.min.js +13 -6
- package/dist/admin/AdminAppIndex.pack.min.js.map +1 -1
- package/dist/common/controls/html/grapes-js/GrapesJSEditor.d.ts.map +1 -1
- package/dist/common/controls/html/grapes-js/GrapesJSEditor.js +18 -1
- package/dist/common/controls/html/grapes-js/GrapesJSEditor.js.map +1 -1
- package/dist/common/pages/websites/studio/WebSiteStudioPage.d.ts.map +1 -1
- package/dist/common/pages/websites/studio/WebSiteStudioPage.js +9 -1
- package/dist/common/pages/websites/studio/WebSiteStudioPage.js.map +1 -1
- package/dist/public/components/typewriter/TypeWriter.d.ts +9 -0
- package/dist/public/components/typewriter/TypeWriter.d.ts.map +1 -0
- package/dist/public/components/typewriter/TypeWriter.js +78 -0
- package/dist/public/components/typewriter/TypeWriter.js.map +1 -0
- package/dist/site-editor/blocks/Block.js +7 -0
- package/dist/site-editor/blocks/Block.js.map +1 -1
- package/dist/site-editor/blocks/Components.d.ts +1 -0
- package/dist/site-editor/blocks/Components.d.ts.map +1 -1
- package/dist/site-editor/blocks/Components.js +12 -1
- package/dist/site-editor/blocks/Components.js.map +1 -1
- package/dist/site-editor/editor/HtmlPageEditor.d.ts +3 -0
- package/dist/site-editor/editor/HtmlPageEditor.d.ts.map +1 -1
- package/dist/site-editor/editor/HtmlPageEditor.js +127 -100
- package/dist/site-editor/editor/HtmlPageEditor.js.map +1 -1
- package/dist/site-editor/styler/StylerSet.d.ts.map +1 -1
- package/dist/site-editor/styler/StylerSet.js +14 -0
- package/dist/site-editor/styler/StylerSet.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/web/AppIndex.pack.js +169 -102
- package/dist/web/AppIndex.pack.js.map +1 -1
- package/dist/web/AppIndex.pack.min.js +13 -6
- package/dist/web/AppIndex.pack.min.js.map +1 -1
- package/package.json +1 -1
- package/src/common/controls/html/grapes-js/GrapesJSEditor.tsx +19 -1
- package/src/common/pages/websites/studio/WebSiteStudioPage.tsx +20 -0
- package/src/public/components/typewriter/TypeWriter.tsx +74 -0
- package/src/site-editor/blocks/Block.tsx +7 -0
- package/src/site-editor/blocks/Components.tsx +14 -1
- package/src/site-editor/editor/HtmlPageEditor.tsx +146 -97
- package/src/site-editor/styler/StylerSet.ts +14 -0
|
@@ -35950,6 +35950,13 @@ System.register(["@web-atoms/core/dist/core/XNode", "@web-atoms/core/dist/web/co
|
|
|
35950
35950
|
}
|
|
35951
35951
|
}
|
|
35952
35952
|
|
|
35953
|
+
&[styler-full-screen] {
|
|
35954
|
+
width: 100%;
|
|
35955
|
+
max-width: 100%;
|
|
35956
|
+
padding: 0;
|
|
35957
|
+
margin: 0;
|
|
35958
|
+
}
|
|
35959
|
+
|
|
35953
35960
|
`.expand("[styler-layout=main]"));
|
|
35954
35961
|
svg = `<svg xmlns="http://www.w3.org/2000/svg" height="16" width="14" viewBox="0 0 448 512"><!--!Font Awesome Free 6.5.1 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2024 Fonticons, Inc.--><path d="M0 96C0 78.3 14.3 64 32 64H416c17.7 0 32 14.3 32 32s-14.3 32-32 32H32C14.3 128 0 113.7 0 96zM0 256c0-17.7 14.3-32 32-32H416c17.7 0 32 14.3 32 32s-14.3 32-32 32H32c-17.7 0-32-14.3-32-32zM448 416c0 17.7-14.3 32-32 32H32c-17.7 0-32-14.3-32-32s14.3-32 32-32H416c17.7 0 32 14.3 32 32z"/></svg>`;
|
|
35955
35962
|
svgCross = `<svg xmlns="http://www.w3.org/2000/svg" height="16" width="12" viewBox="0 0 384 512"><!--!Font Awesome Pro 6.5.1 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2024 Fonticons, Inc.--><path class="fa-secondary" opacity=".4" d="M297.4 406.6c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3L237.3 256 342.6 150.6c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0L192 210.7 86.6 105.4c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3L146.7 256 41.4 361.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0L192 301.3 297.4 406.6z"/><path class="fa-primary" d=""/></svg>`;
|
|
@@ -36742,6 +36749,12 @@ System.register(["./Styler", "./properties/stylerBorder", "./properties/layouts/
|
|
|
36742
36749
|
}
|
|
36743
36750
|
}
|
|
36744
36751
|
return `
|
|
36752
|
+
|
|
36753
|
+
html, body {
|
|
36754
|
+
margin: 0;
|
|
36755
|
+
padding: 0;
|
|
36756
|
+
}
|
|
36757
|
+
|
|
36745
36758
|
* {
|
|
36746
36759
|
box-sizing: border-box;
|
|
36747
36760
|
}
|
|
@@ -36754,12 +36767,20 @@ System.register(["./Styler", "./properties/stylerBorder", "./properties/layouts/
|
|
|
36754
36767
|
background-color: var(--body-color);
|
|
36755
36768
|
color: var(--default-text-color);
|
|
36756
36769
|
}
|
|
36770
|
+
|
|
36771
|
+
img {
|
|
36772
|
+
object-fit: none;
|
|
36773
|
+
}
|
|
36757
36774
|
|
|
36758
36775
|
${StylerSets.low.join("\n")}
|
|
36759
36776
|
|
|
36760
36777
|
${properties.join("\n")}
|
|
36761
36778
|
|
|
36762
36779
|
${StylerSets.high.join("\n")}
|
|
36780
|
+
|
|
36781
|
+
* {
|
|
36782
|
+
caret-color: #40404080 !important;
|
|
36783
|
+
}
|
|
36763
36784
|
|
|
36764
36785
|
`;
|
|
36765
36786
|
}
|
|
@@ -38241,7 +38262,7 @@ System.register(["@web-atoms/core/dist/core/XNode", "./Block"], function (_expor
|
|
|
38241
38262
|
System.register(["@web-atoms/core/dist/core/XNode", "./Block", "../styler/StylerSets", "@web-atoms/core/dist/style/styled", "../styler/Styler"], function (_export, _context) {
|
|
38242
38263
|
"use strict";
|
|
38243
38264
|
|
|
38244
|
-
var XNode, Block, StylerSets, styled, stylerVars, BlogComponent;
|
|
38265
|
+
var XNode, Block, StylerSets, styled, stylerVars, BlogComponent, TypeWriterComponent;
|
|
38245
38266
|
return {
|
|
38246
38267
|
setters: [function (_webAtomsCoreDistCoreXNode) {
|
|
38247
38268
|
XNode = _webAtomsCoreDistCoreXNode.default;
|
|
@@ -38292,6 +38313,17 @@ System.register(["@web-atoms/core/dist/core/XNode", "./Block", "../styler/Styler
|
|
|
38292
38313
|
"data-view": "dist/public/channel/ChannelView"
|
|
38293
38314
|
})
|
|
38294
38315
|
}));
|
|
38316
|
+
_export("TypeWriterComponent", TypeWriterComponent = Block({
|
|
38317
|
+
className: "fad fa-input-text",
|
|
38318
|
+
title: "Add TypeWriter Component",
|
|
38319
|
+
factory: () => XNode.create("section", {
|
|
38320
|
+
"styler-layout": "component",
|
|
38321
|
+
"data-package": "@social-mail/social-mail-client",
|
|
38322
|
+
"data-host": "true",
|
|
38323
|
+
"data-view": "dist/public/components/TypeWriter",
|
|
38324
|
+
"data-json-args": `["Passionate Actor", "Method Actor", "Teleprompter"]`
|
|
38325
|
+
})
|
|
38326
|
+
}));
|
|
38295
38327
|
}
|
|
38296
38328
|
};
|
|
38297
38329
|
});
|
|
@@ -38814,10 +38846,10 @@ System.register(["@web-atoms/core/dist/core/XNode", "./Block", "@web-atoms/core/
|
|
|
38814
38846
|
|
|
38815
38847
|
AmdLoader.instance.setup("@social-mail/social-mail-client/dist/site-editor/blocks/PriceBox");
|
|
38816
38848
|
|
|
38817
|
-
System.register(["tslib", "@web-atoms/core/dist/core/Bind", "@web-atoms/core/dist/core/XNode", "@web-atoms/core/dist/core/sleep", "@web-atoms/core/dist/style/styled", "@web-atoms/core/dist/view-model/Action", "@web-atoms/core/dist/web/controls/AtomControl", "../drag-drop/DragDropHelper", "../toolbars/UndoRedoToolbar", "../blocks/WrapGrid", "../toolbars/EditorToolbar", "../properties/Properties", "../styler/StylerSet", "./SelectedElement", "@web-atoms/core/dist/core/AtomBinder", "../styler/Styler", "../blocks/ImageBox", "../blocks/RowBox", "../blocks/ColumnBox", "../blocks/VerticalImageBox", "../blocks/Image", "../blocks/ImageCard", "../blocks/TextBox", "../blocks/Card", "../blocks/List", "../blocks/Components", "@web-atoms/core/dist/core/types", "../blocks/Buttons", "../blocks/Columns2", "../blocks/Columns3", "../blocks/RightImageBox", "@web-atoms/core/dist/web/core/AtomUI", "../blocks/PriceBox"], function (_export, _context) {
|
|
38849
|
+
System.register(["tslib", "@web-atoms/core/dist/core/Bind", "@web-atoms/core/dist/core/XNode", "@web-atoms/core/dist/core/sleep", "@web-atoms/core/dist/style/styled", "@web-atoms/core/dist/view-model/Action", "@web-atoms/core/dist/web/controls/AtomControl", "../drag-drop/DragDropHelper", "../toolbars/UndoRedoToolbar", "../blocks/WrapGrid", "../toolbars/EditorToolbar", "../properties/Properties", "../styler/StylerSet", "./SelectedElement", "@web-atoms/core/dist/core/AtomBinder", "../styler/Styler", "../blocks/ImageBox", "../blocks/RowBox", "../blocks/ColumnBox", "../blocks/VerticalImageBox", "../blocks/Image", "../blocks/ImageCard", "../blocks/TextBox", "../blocks/Card", "../blocks/List", "../blocks/Components", "@web-atoms/core/dist/core/types", "../blocks/Buttons", "../blocks/Columns2", "../blocks/Columns3", "../blocks/RightImageBox", "@web-atoms/core/dist/web/core/AtomUI", "../blocks/PriceBox", "@web-atoms/core/dist/core/BindableProperty"], function (_export, _context) {
|
|
38818
38850
|
"use strict";
|
|
38819
38851
|
|
|
38820
|
-
var __awaiter, __decorate, __metadata, Bind, XNode, sleep, styled, Action, AtomControl, InstallDragDropHelper, UndoRedoToolbar, WrapGrid, EditorToolbar, Properties, StylerSet, SelectedElement, AtomBinder, StylerVariable, ImageBox, RowBox, ColumnBox, VerticalImageBox, Image, ImageCard, TextBox, Card, List, BlogComponent, UMD, ImageLink, LinkButton, Columns2, Columns3, RightImageBox, descendentElementIterator, PriceTable, HtmlPageEditor, desktopWidth, tabletWidth, mobileWidth;
|
|
38852
|
+
var __awaiter, __decorate, __metadata, Bind, XNode, sleep, styled, Action, AtomControl, InstallDragDropHelper, UndoRedoToolbar, WrapGrid, EditorToolbar, Properties, StylerSet, SelectedElement, AtomBinder, StylerVariable, ImageBox, RowBox, ColumnBox, VerticalImageBox, Image, ImageCard, TextBox, Card, List, BlogComponent, TypeWriterComponent, UMD, ImageLink, LinkButton, Columns2, Columns3, RightImageBox, descendentElementIterator, PriceTable, BindableProperty, HtmlPageEditor, desktopWidth, tabletWidth, mobileWidth;
|
|
38821
38853
|
_export("default", void 0);
|
|
38822
38854
|
return {
|
|
38823
38855
|
setters: [function (_tslib) {
|
|
@@ -38874,6 +38906,7 @@ System.register(["tslib", "@web-atoms/core/dist/core/Bind", "@web-atoms/core/dis
|
|
|
38874
38906
|
List = _blocksList.List;
|
|
38875
38907
|
}, function (_blocksComponents) {
|
|
38876
38908
|
BlogComponent = _blocksComponents.BlogComponent;
|
|
38909
|
+
TypeWriterComponent = _blocksComponents.TypeWriterComponent;
|
|
38877
38910
|
}, function (_webAtomsCoreDistCoreTypes) {
|
|
38878
38911
|
UMD = _webAtomsCoreDistCoreTypes.UMD;
|
|
38879
38912
|
}, function (_blocksButtons) {
|
|
@@ -38889,6 +38922,8 @@ System.register(["tslib", "@web-atoms/core/dist/core/Bind", "@web-atoms/core/dis
|
|
|
38889
38922
|
descendentElementIterator = _webAtomsCoreDistWebCoreAtomUI.descendentElementIterator;
|
|
38890
38923
|
}, function (_blocksPriceBox) {
|
|
38891
38924
|
PriceTable = _blocksPriceBox.PriceTable;
|
|
38925
|
+
}, function (_webAtomsCoreDistCoreBindableProperty) {
|
|
38926
|
+
BindableProperty = _webAtomsCoreDistCoreBindableProperty.BindableProperty;
|
|
38892
38927
|
}],
|
|
38893
38928
|
execute: function () {
|
|
38894
38929
|
styled.css`
|
|
@@ -39025,102 +39060,23 @@ System.register(["tslib", "@web-atoms/core/dist/core/Bind", "@web-atoms/core/dis
|
|
|
39025
39060
|
}, 100);
|
|
39026
39061
|
return;
|
|
39027
39062
|
}
|
|
39028
|
-
void this.ready.then(() =>
|
|
39029
|
-
|
|
39030
|
-
|
|
39031
|
-
|
|
39032
|
-
|
|
39033
|
-
|
|
39034
|
-
this.
|
|
39035
|
-
|
|
39036
|
-
|
|
39037
|
-
this.htmlDocument.open();
|
|
39038
|
-
this.htmlDocument.write(v);
|
|
39039
|
-
this.htmlDocument.addEventListener("click", e => {
|
|
39040
|
-
const target = e.target;
|
|
39041
|
-
const previous = this.selection.element;
|
|
39042
|
-
if (previous === null || previous === void 0 ? void 0 : previous.isContentEditable) {
|
|
39043
|
-
let start = target;
|
|
39044
|
-
while (start) {
|
|
39045
|
-
if (previous === target) {
|
|
39046
|
-
return;
|
|
39047
|
-
}
|
|
39048
|
-
start = start.parentElement;
|
|
39049
|
-
}
|
|
39050
|
-
if (previous !== this.htmlDocument.body) {
|
|
39051
|
-
previous.removeAttribute("contentEditable");
|
|
39052
|
-
}
|
|
39053
|
-
this.commit();
|
|
39063
|
+
void this.ready.then(() => {
|
|
39064
|
+
const dom = new DOMParser();
|
|
39065
|
+
const doc = dom.parseFromString(v, "text/html");
|
|
39066
|
+
let baseElement = doc.querySelector("base");
|
|
39067
|
+
if (baseElement) {
|
|
39068
|
+
const href = baseElement.getAttribute("href");
|
|
39069
|
+
if (href !== this.baseUrl) {
|
|
39070
|
+
this.originalBaseUrl = href;
|
|
39071
|
+
baseElement.setAttribute("href", this.baseUrl);
|
|
39054
39072
|
}
|
|
39055
|
-
|
|
39056
|
-
|
|
39057
|
-
|
|
39058
|
-
|
|
39059
|
-
|
|
39060
|
-
|
|
39061
|
-
|
|
39062
|
-
if (element.tagName === "IMG") {
|
|
39063
|
-
this.changeImage().catch(console.error);
|
|
39064
|
-
return;
|
|
39065
|
-
}
|
|
39066
|
-
if (element.getAttribute("data-editable") === "false") {
|
|
39067
|
-
return;
|
|
39068
|
-
}
|
|
39069
|
-
if (element.hasAttribute("data-web-atoms-view")) {
|
|
39070
|
-
return;
|
|
39071
|
-
}
|
|
39072
|
-
this.setSelection(element);
|
|
39073
|
-
});
|
|
39074
|
-
this.htmlDocument.addEventListener("scroll", e => {
|
|
39075
|
-
this.hover.update();
|
|
39076
|
-
this.selection.update();
|
|
39077
|
-
}, {
|
|
39078
|
-
passive: true
|
|
39079
|
-
});
|
|
39080
|
-
this.htmlDocument.addEventListener("pointerover", e => {
|
|
39081
|
-
let target = e.target;
|
|
39082
|
-
target = target.nodeType === Node.ELEMENT_NODE && target.tagName ? target : target.parentElement;
|
|
39083
|
-
if (this.hover.element === target) {
|
|
39084
|
-
return;
|
|
39085
|
-
}
|
|
39086
|
-
this.hover.update(target);
|
|
39087
|
-
}, {
|
|
39088
|
-
capture: true
|
|
39089
|
-
});
|
|
39090
|
-
this.htmlDocument.addEventListener("keydown", e => {
|
|
39091
|
-
if (e.ctrlKey || e.metaKey) {
|
|
39092
|
-
switch (e.key) {
|
|
39093
|
-
case "s":
|
|
39094
|
-
this.contentEditor.dispatchEvent(new CustomEvent("savePage", {
|
|
39095
|
-
bubbles: true
|
|
39096
|
-
}));
|
|
39097
|
-
e.preventDefault();
|
|
39098
|
-
break;
|
|
39099
|
-
case "z":
|
|
39100
|
-
this.contentEditor.dispatchEvent(new CustomEvent("undo", {
|
|
39101
|
-
bubbles: true
|
|
39102
|
-
}));
|
|
39103
|
-
e.preventDefault();
|
|
39104
|
-
break;
|
|
39105
|
-
case "y":
|
|
39106
|
-
this.contentEditor.dispatchEvent(new CustomEvent("redo", {
|
|
39107
|
-
bubbles: true
|
|
39108
|
-
}));
|
|
39109
|
-
e.preventDefault();
|
|
39110
|
-
break;
|
|
39111
|
-
}
|
|
39112
|
-
}
|
|
39113
|
-
});
|
|
39114
|
-
InstallDragDropHelper(this);
|
|
39115
|
-
this.htmlDocument.close();
|
|
39116
|
-
this.htmlDocument.body.contentEditable = "true";
|
|
39117
|
-
setTimeout(() => {
|
|
39118
|
-
this.app.runAsync(() => __awaiter(this, void 0, void 0, function* () {
|
|
39119
|
-
yield this.setStylerSheet();
|
|
39120
|
-
this.loadVariables();
|
|
39121
|
-
}));
|
|
39122
|
-
}, 10);
|
|
39123
|
-
}));
|
|
39073
|
+
} else {
|
|
39074
|
+
baseElement = doc.createElement("base");
|
|
39075
|
+
baseElement.setAttribute("href", this.baseUrl);
|
|
39076
|
+
doc.head.insertAdjacentElement("afterbegin", baseElement);
|
|
39077
|
+
}
|
|
39078
|
+
return this.initDocument(doc.documentElement.outerHTML);
|
|
39079
|
+
});
|
|
39124
39080
|
}
|
|
39125
39081
|
constructor(app, e) {
|
|
39126
39082
|
super(app, e);
|
|
@@ -39159,7 +39115,7 @@ System.register(["tslib", "@web-atoms/core/dist/core/Bind", "@web-atoms/core/dis
|
|
|
39159
39115
|
class: "fa-solid fa-code"
|
|
39160
39116
|
}))), XNode.create(EditorToolbar, {
|
|
39161
39117
|
"data-element": "left"
|
|
39162
|
-
}, XNode.create(TextBox, null), XNode.create(Image, null), XNode.create(WrapGrid, null), XNode.create(VerticalImageBox, null), XNode.create(ImageBox, null), XNode.create(RightImageBox, null), XNode.create(Card, null), XNode.create(ImageCard, null), XNode.create(RowBox, null), XNode.create(ColumnBox, null), XNode.create(Columns2, null), XNode.create(Columns3, null), XNode.create(List, null), XNode.create(BlogComponent, null), XNode.create(ImageLink, null), XNode.create(LinkButton, null), XNode.create(PriceTable, null)), XNode.create("div", {
|
|
39118
|
+
}, XNode.create(TextBox, null), XNode.create(Image, null), XNode.create(WrapGrid, null), XNode.create(VerticalImageBox, null), XNode.create(ImageBox, null), XNode.create(RightImageBox, null), XNode.create(Card, null), XNode.create(ImageCard, null), XNode.create(RowBox, null), XNode.create(ColumnBox, null), XNode.create(Columns2, null), XNode.create(Columns3, null), XNode.create(List, null), XNode.create(BlogComponent, null), XNode.create(ImageLink, null), XNode.create(LinkButton, null), XNode.create(PriceTable, null), XNode.create(TypeWriterComponent, null)), XNode.create("div", {
|
|
39163
39119
|
"data-element": "editor",
|
|
39164
39120
|
"style-max-width": Bind.oneWay(() => this.maxWidth > 768 ? "" : this.maxWidth + "px")
|
|
39165
39121
|
}, XNode.create("div", {
|
|
@@ -39233,7 +39189,7 @@ System.register(["tslib", "@web-atoms/core/dist/core/Bind", "@web-atoms/core/dis
|
|
|
39233
39189
|
}, XNode.create("i", {
|
|
39234
39190
|
class: "fas fa-code"
|
|
39235
39191
|
}), "Variables"), XNode.create(Properties, null))));
|
|
39236
|
-
|
|
39192
|
+
this.contentEditor = this.element.querySelector(`[data-element="content-editor"]`);
|
|
39237
39193
|
});
|
|
39238
39194
|
}
|
|
39239
39195
|
buildXNode(node) {
|
|
@@ -39385,6 +39341,7 @@ System.register(["tslib", "@web-atoms/core/dist/core/Bind", "@web-atoms/core/dis
|
|
|
39385
39341
|
}
|
|
39386
39342
|
}
|
|
39387
39343
|
commit() {
|
|
39344
|
+
var _a;
|
|
39388
39345
|
this.redoList.clear();
|
|
39389
39346
|
const lastHtml = this.lastHtml;
|
|
39390
39347
|
const clone = this.htmlDocument.documentElement.cloneNode(true);
|
|
@@ -39415,6 +39372,16 @@ System.register(["tslib", "@web-atoms/core/dist/core/Bind", "@web-atoms/core/dis
|
|
|
39415
39372
|
}
|
|
39416
39373
|
this.undoList.add(this.lastHtml);
|
|
39417
39374
|
this.lastHtml = currentHtml;
|
|
39375
|
+
if (this.baseUrl) {
|
|
39376
|
+
if (!this.originalBaseUrl) {
|
|
39377
|
+
(_a = clone.querySelector("base")) === null || _a === void 0 ? void 0 : _a.remove();
|
|
39378
|
+
} else {
|
|
39379
|
+
const baseUrl = clone.querySelector("base");
|
|
39380
|
+
if (baseUrl) {
|
|
39381
|
+
baseUrl.setAttribute("href", this.originalBaseUrl);
|
|
39382
|
+
}
|
|
39383
|
+
}
|
|
39384
|
+
}
|
|
39418
39385
|
this.element.dispatchEvent(new CustomEvent("htmlPageChanged", {
|
|
39419
39386
|
detail: clone.outerHTML,
|
|
39420
39387
|
bubbles: true
|
|
@@ -39435,6 +39402,98 @@ System.register(["tslib", "@web-atoms/core/dist/core/Bind", "@web-atoms/core/dis
|
|
|
39435
39402
|
this.htmlDocument.documentElement.innerHTML = this.redoList.removeAt(this.redoList.length - 1);
|
|
39436
39403
|
this.htmlDocument.body.contentEditable = "true";
|
|
39437
39404
|
}
|
|
39405
|
+
initDocument(v) {
|
|
39406
|
+
void this.ready.then(() => __awaiter(this, void 0, void 0, function* () {
|
|
39407
|
+
this.htmlDocument = void 0;
|
|
39408
|
+
yield this.loadContentDocument();
|
|
39409
|
+
this.htmlDocument.open();
|
|
39410
|
+
this.htmlDocument.write(v);
|
|
39411
|
+
this.htmlDocument.addEventListener("click", e => {
|
|
39412
|
+
const target = e.target;
|
|
39413
|
+
const previous = this.selection.element;
|
|
39414
|
+
if (previous === null || previous === void 0 ? void 0 : previous.isContentEditable) {
|
|
39415
|
+
let start = target;
|
|
39416
|
+
while (start) {
|
|
39417
|
+
if (previous === target) {
|
|
39418
|
+
return;
|
|
39419
|
+
}
|
|
39420
|
+
start = start.parentElement;
|
|
39421
|
+
}
|
|
39422
|
+
if (previous !== this.htmlDocument.body) {
|
|
39423
|
+
previous.removeAttribute("contentEditable");
|
|
39424
|
+
}
|
|
39425
|
+
this.commit();
|
|
39426
|
+
}
|
|
39427
|
+
e.preventDefault();
|
|
39428
|
+
this.setSelection(target);
|
|
39429
|
+
});
|
|
39430
|
+
this.htmlDocument.addEventListener("dblclick", e => {
|
|
39431
|
+
const target = e.target;
|
|
39432
|
+
e.preventDefault();
|
|
39433
|
+
const element = target.nodeType === Node.ELEMENT_NODE ? target : target.parentElement;
|
|
39434
|
+
if (element.tagName === "IMG") {
|
|
39435
|
+
this.changeImage().catch(console.error);
|
|
39436
|
+
return;
|
|
39437
|
+
}
|
|
39438
|
+
if (element.getAttribute("data-editable") === "false") {
|
|
39439
|
+
return;
|
|
39440
|
+
}
|
|
39441
|
+
if (element.hasAttribute("data-web-atoms-view")) {
|
|
39442
|
+
return;
|
|
39443
|
+
}
|
|
39444
|
+
this.setSelection(element);
|
|
39445
|
+
});
|
|
39446
|
+
this.htmlDocument.addEventListener("scroll", e => {
|
|
39447
|
+
this.hover.update();
|
|
39448
|
+
this.selection.update();
|
|
39449
|
+
}, {
|
|
39450
|
+
passive: true
|
|
39451
|
+
});
|
|
39452
|
+
this.htmlDocument.addEventListener("pointerover", e => {
|
|
39453
|
+
let target = e.target;
|
|
39454
|
+
target = target.nodeType === Node.ELEMENT_NODE && target.tagName ? target : target.parentElement;
|
|
39455
|
+
if (this.hover.element === target) {
|
|
39456
|
+
return;
|
|
39457
|
+
}
|
|
39458
|
+
this.hover.update(target);
|
|
39459
|
+
}, {
|
|
39460
|
+
capture: true
|
|
39461
|
+
});
|
|
39462
|
+
this.htmlDocument.addEventListener("keydown", e => {
|
|
39463
|
+
if (e.ctrlKey || e.metaKey) {
|
|
39464
|
+
switch (e.key) {
|
|
39465
|
+
case "s":
|
|
39466
|
+
this.contentEditor.dispatchEvent(new CustomEvent("savePage", {
|
|
39467
|
+
bubbles: true
|
|
39468
|
+
}));
|
|
39469
|
+
e.preventDefault();
|
|
39470
|
+
break;
|
|
39471
|
+
case "z":
|
|
39472
|
+
this.contentEditor.dispatchEvent(new CustomEvent("undo", {
|
|
39473
|
+
bubbles: true
|
|
39474
|
+
}));
|
|
39475
|
+
e.preventDefault();
|
|
39476
|
+
break;
|
|
39477
|
+
case "y":
|
|
39478
|
+
this.contentEditor.dispatchEvent(new CustomEvent("redo", {
|
|
39479
|
+
bubbles: true
|
|
39480
|
+
}));
|
|
39481
|
+
e.preventDefault();
|
|
39482
|
+
break;
|
|
39483
|
+
}
|
|
39484
|
+
}
|
|
39485
|
+
});
|
|
39486
|
+
InstallDragDropHelper(this);
|
|
39487
|
+
this.htmlDocument.close();
|
|
39488
|
+
this.htmlDocument.body.contentEditable = "true";
|
|
39489
|
+
setTimeout(() => {
|
|
39490
|
+
this.app.runAsync(() => __awaiter(this, void 0, void 0, function* () {
|
|
39491
|
+
yield this.setStylerSheet();
|
|
39492
|
+
this.loadVariables();
|
|
39493
|
+
}));
|
|
39494
|
+
}, 10);
|
|
39495
|
+
}));
|
|
39496
|
+
}
|
|
39438
39497
|
setStylerSheet() {
|
|
39439
39498
|
return __awaiter(this, void 0, void 0, function* () {
|
|
39440
39499
|
const document = this.htmlDocument;
|
|
@@ -39469,10 +39528,10 @@ System.register(["tslib", "@web-atoms/core/dist/core/Bind", "@web-atoms/core/dis
|
|
|
39469
39528
|
this.htmlDocument = this.contentEditor.contentDocument;
|
|
39470
39529
|
yield sleep(100);
|
|
39471
39530
|
}
|
|
39472
|
-
this.htmlDocument.body.contentEditable = "true";
|
|
39473
39531
|
});
|
|
39474
39532
|
}
|
|
39475
39533
|
});
|
|
39534
|
+
__decorate([BindableProperty, __metadata("design:type", String)], HtmlPageEditor.prototype, "baseUrl", void 0);
|
|
39476
39535
|
__decorate([Action({
|
|
39477
39536
|
onEvent: "delete-element"
|
|
39478
39537
|
}), __metadata("design:type", Function), __metadata("design:paramtypes", []), __metadata("design:returntype", Promise)], HtmlPageEditor.prototype, "deleteElement", null);
|
|
@@ -40472,6 +40531,7 @@ System.register(["tslib", "@web-atoms/core/dist/core/InjectProperty", "@web-atom
|
|
|
40472
40531
|
}
|
|
40473
40532
|
const indexHtml = this.root.children.find(x => x.name === "index.html");
|
|
40474
40533
|
this.selectedFile = indexHtml;
|
|
40534
|
+
const baseUrl = `/api/site/draft/${this.root.appFileID}/`;
|
|
40475
40535
|
this.titleRenderer = () => XNode.create("div", {
|
|
40476
40536
|
"data-layout": "row"
|
|
40477
40537
|
}, XNode.create("div", {
|
|
@@ -40502,7 +40562,13 @@ System.register(["tslib", "@web-atoms/core/dist/core/InjectProperty", "@web-atom
|
|
|
40502
40562
|
"data-click-event": "view-website",
|
|
40503
40563
|
icon: "fad fa-globe-pointer",
|
|
40504
40564
|
text: "View Site"
|
|
40505
|
-
}),
|
|
40565
|
+
}), XNode.create("a", {
|
|
40566
|
+
href: `/api/site/draft/${this.webSite.folderID}`,
|
|
40567
|
+
target: "_blank"
|
|
40568
|
+
}, XNode.create(EditIconTextButton, {
|
|
40569
|
+
icon: "fad fa-globe-pointer",
|
|
40570
|
+
text: "Preview Draft"
|
|
40571
|
+
})), this.parameters.templates && XNode.create("div", {
|
|
40506
40572
|
"data-layout": "row",
|
|
40507
40573
|
"style-display": Bind.oneWay(() => this.selectedFile.appFileID > 0)
|
|
40508
40574
|
}, XNode.create("i", {
|
|
@@ -40535,6 +40601,7 @@ System.register(["tslib", "@web-atoms/core/dist/core/InjectProperty", "@web-atom
|
|
|
40535
40601
|
}
|
|
40536
40602
|
}), XNode.create(WebSitePageEditor, {
|
|
40537
40603
|
class: "file-list",
|
|
40604
|
+
baseUrl: baseUrl,
|
|
40538
40605
|
folder: this.root,
|
|
40539
40606
|
presenter: Bind.presenter(c => this.htmlEditor = c),
|
|
40540
40607
|
"event-html-page-changed": ce => this.pageContent = ce.detail,
|