@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
package/content/editor/edit.html
CHANGED
|
@@ -10,10 +10,10 @@
|
|
|
10
10
|
}
|
|
11
11
|
</style>
|
|
12
12
|
<body>
|
|
13
|
-
<link href="https://cdn.jsdelivr.net/npm/grapesjs@0.21.
|
|
14
|
-
<script src="https://cdn.jsdelivr.net/npm/grapesjs@0.21.
|
|
13
|
+
<link href="https://cdn.jsdelivr.net/npm/grapesjs@0.21.10/dist/css/grapes.min.css" rel="stylesheet"/>
|
|
14
|
+
<script src="https://cdn.jsdelivr.net/npm/grapesjs@0.21.10/dist/grapes.min.js"></script>
|
|
15
15
|
<script src="https://cdn.jsdelivr.net/npm/grapesjs-preset-webpage@1.0.3/dist/index.js"></script>
|
|
16
|
-
<script src="https://cdn.jsdelivr.net/npm/grapesjs-preset-webpage@1.0.2"></script>
|
|
16
|
+
<!-- <script src="https://cdn.jsdelivr.net/npm/grapesjs-preset-webpage@1.0.2"></script> -->
|
|
17
17
|
<script src="https://cdn.jsdelivr.net/npm/grapesjs-blocks-basic@1.0.1"></script>
|
|
18
18
|
<script src="https://cdn.jsdelivr.net/npm/grapesjs-plugin-forms@2.0.5"></script>
|
|
19
19
|
<script src="https://cdn.jsdelivr.net/npm/grapesjs-component-countdown@1.0.1"></script>
|
|
@@ -39411,6 +39411,13 @@ System.register(["@web-atoms/core/dist/core/XNode", "@web-atoms/core/dist/web/co
|
|
|
39411
39411
|
}
|
|
39412
39412
|
}
|
|
39413
39413
|
|
|
39414
|
+
&[styler-full-screen] {
|
|
39415
|
+
width: 100%;
|
|
39416
|
+
max-width: 100%;
|
|
39417
|
+
padding: 0;
|
|
39418
|
+
margin: 0;
|
|
39419
|
+
}
|
|
39420
|
+
|
|
39414
39421
|
`.expand("[styler-layout=main]"));
|
|
39415
39422
|
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>`;
|
|
39416
39423
|
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>`;
|
|
@@ -40203,6 +40210,12 @@ System.register(["./Styler", "./properties/stylerBorder", "./properties/layouts/
|
|
|
40203
40210
|
}
|
|
40204
40211
|
}
|
|
40205
40212
|
return `
|
|
40213
|
+
|
|
40214
|
+
html, body {
|
|
40215
|
+
margin: 0;
|
|
40216
|
+
padding: 0;
|
|
40217
|
+
}
|
|
40218
|
+
|
|
40206
40219
|
* {
|
|
40207
40220
|
box-sizing: border-box;
|
|
40208
40221
|
}
|
|
@@ -40215,12 +40228,20 @@ System.register(["./Styler", "./properties/stylerBorder", "./properties/layouts/
|
|
|
40215
40228
|
background-color: var(--body-color);
|
|
40216
40229
|
color: var(--default-text-color);
|
|
40217
40230
|
}
|
|
40231
|
+
|
|
40232
|
+
img {
|
|
40233
|
+
object-fit: none;
|
|
40234
|
+
}
|
|
40218
40235
|
|
|
40219
40236
|
${StylerSets.low.join("\n")}
|
|
40220
40237
|
|
|
40221
40238
|
${properties.join("\n")}
|
|
40222
40239
|
|
|
40223
40240
|
${StylerSets.high.join("\n")}
|
|
40241
|
+
|
|
40242
|
+
* {
|
|
40243
|
+
caret-color: #40404080 !important;
|
|
40244
|
+
}
|
|
40224
40245
|
|
|
40225
40246
|
`;
|
|
40226
40247
|
}
|
|
@@ -41702,7 +41723,7 @@ System.register(["@web-atoms/core/dist/core/XNode", "./Block"], function (_expor
|
|
|
41702
41723
|
System.register(["@web-atoms/core/dist/core/XNode", "./Block", "../styler/StylerSets", "@web-atoms/core/dist/style/styled", "../styler/Styler"], function (_export, _context) {
|
|
41703
41724
|
"use strict";
|
|
41704
41725
|
|
|
41705
|
-
var XNode, Block, StylerSets, styled, stylerVars, BlogComponent;
|
|
41726
|
+
var XNode, Block, StylerSets, styled, stylerVars, BlogComponent, TypeWriterComponent;
|
|
41706
41727
|
return {
|
|
41707
41728
|
setters: [function (_webAtomsCoreDistCoreXNode) {
|
|
41708
41729
|
XNode = _webAtomsCoreDistCoreXNode.default;
|
|
@@ -41753,6 +41774,17 @@ System.register(["@web-atoms/core/dist/core/XNode", "./Block", "../styler/Styler
|
|
|
41753
41774
|
"data-view": "dist/public/channel/ChannelView"
|
|
41754
41775
|
})
|
|
41755
41776
|
}));
|
|
41777
|
+
_export("TypeWriterComponent", TypeWriterComponent = Block({
|
|
41778
|
+
className: "fad fa-input-text",
|
|
41779
|
+
title: "Add TypeWriter Component",
|
|
41780
|
+
factory: () => XNode.create("section", {
|
|
41781
|
+
"styler-layout": "component",
|
|
41782
|
+
"data-package": "@social-mail/social-mail-client",
|
|
41783
|
+
"data-host": "true",
|
|
41784
|
+
"data-view": "dist/public/components/TypeWriter",
|
|
41785
|
+
"data-json-args": `["Passionate Actor", "Method Actor", "Teleprompter"]`
|
|
41786
|
+
})
|
|
41787
|
+
}));
|
|
41756
41788
|
}
|
|
41757
41789
|
};
|
|
41758
41790
|
});
|
|
@@ -42275,10 +42307,10 @@ System.register(["@web-atoms/core/dist/core/XNode", "./Block", "@web-atoms/core/
|
|
|
42275
42307
|
|
|
42276
42308
|
AmdLoader.instance.setup("@social-mail/social-mail-client/dist/site-editor/blocks/PriceBox");
|
|
42277
42309
|
|
|
42278
|
-
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) {
|
|
42310
|
+
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) {
|
|
42279
42311
|
"use strict";
|
|
42280
42312
|
|
|
42281
|
-
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;
|
|
42313
|
+
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;
|
|
42282
42314
|
_export("default", void 0);
|
|
42283
42315
|
return {
|
|
42284
42316
|
setters: [function (_tslib) {
|
|
@@ -42335,6 +42367,7 @@ System.register(["tslib", "@web-atoms/core/dist/core/Bind", "@web-atoms/core/dis
|
|
|
42335
42367
|
List = _blocksList.List;
|
|
42336
42368
|
}, function (_blocksComponents) {
|
|
42337
42369
|
BlogComponent = _blocksComponents.BlogComponent;
|
|
42370
|
+
TypeWriterComponent = _blocksComponents.TypeWriterComponent;
|
|
42338
42371
|
}, function (_webAtomsCoreDistCoreTypes) {
|
|
42339
42372
|
UMD = _webAtomsCoreDistCoreTypes.UMD;
|
|
42340
42373
|
}, function (_blocksButtons) {
|
|
@@ -42350,6 +42383,8 @@ System.register(["tslib", "@web-atoms/core/dist/core/Bind", "@web-atoms/core/dis
|
|
|
42350
42383
|
descendentElementIterator = _webAtomsCoreDistWebCoreAtomUI.descendentElementIterator;
|
|
42351
42384
|
}, function (_blocksPriceBox) {
|
|
42352
42385
|
PriceTable = _blocksPriceBox.PriceTable;
|
|
42386
|
+
}, function (_webAtomsCoreDistCoreBindableProperty) {
|
|
42387
|
+
BindableProperty = _webAtomsCoreDistCoreBindableProperty.BindableProperty;
|
|
42353
42388
|
}],
|
|
42354
42389
|
execute: function () {
|
|
42355
42390
|
styled.css`
|
|
@@ -42486,102 +42521,23 @@ System.register(["tslib", "@web-atoms/core/dist/core/Bind", "@web-atoms/core/dis
|
|
|
42486
42521
|
}, 100);
|
|
42487
42522
|
return;
|
|
42488
42523
|
}
|
|
42489
|
-
void this.ready.then(() =>
|
|
42490
|
-
|
|
42491
|
-
|
|
42492
|
-
|
|
42493
|
-
|
|
42494
|
-
|
|
42495
|
-
this.
|
|
42496
|
-
|
|
42497
|
-
|
|
42498
|
-
this.htmlDocument.open();
|
|
42499
|
-
this.htmlDocument.write(v);
|
|
42500
|
-
this.htmlDocument.addEventListener("click", e => {
|
|
42501
|
-
const target = e.target;
|
|
42502
|
-
const previous = this.selection.element;
|
|
42503
|
-
if (previous === null || previous === void 0 ? void 0 : previous.isContentEditable) {
|
|
42504
|
-
let start = target;
|
|
42505
|
-
while (start) {
|
|
42506
|
-
if (previous === target) {
|
|
42507
|
-
return;
|
|
42508
|
-
}
|
|
42509
|
-
start = start.parentElement;
|
|
42510
|
-
}
|
|
42511
|
-
if (previous !== this.htmlDocument.body) {
|
|
42512
|
-
previous.removeAttribute("contentEditable");
|
|
42513
|
-
}
|
|
42514
|
-
this.commit();
|
|
42524
|
+
void this.ready.then(() => {
|
|
42525
|
+
const dom = new DOMParser();
|
|
42526
|
+
const doc = dom.parseFromString(v, "text/html");
|
|
42527
|
+
let baseElement = doc.querySelector("base");
|
|
42528
|
+
if (baseElement) {
|
|
42529
|
+
const href = baseElement.getAttribute("href");
|
|
42530
|
+
if (href !== this.baseUrl) {
|
|
42531
|
+
this.originalBaseUrl = href;
|
|
42532
|
+
baseElement.setAttribute("href", this.baseUrl);
|
|
42515
42533
|
}
|
|
42516
|
-
|
|
42517
|
-
|
|
42518
|
-
|
|
42519
|
-
|
|
42520
|
-
|
|
42521
|
-
|
|
42522
|
-
|
|
42523
|
-
if (element.tagName === "IMG") {
|
|
42524
|
-
this.changeImage().catch(console.error);
|
|
42525
|
-
return;
|
|
42526
|
-
}
|
|
42527
|
-
if (element.getAttribute("data-editable") === "false") {
|
|
42528
|
-
return;
|
|
42529
|
-
}
|
|
42530
|
-
if (element.hasAttribute("data-web-atoms-view")) {
|
|
42531
|
-
return;
|
|
42532
|
-
}
|
|
42533
|
-
this.setSelection(element);
|
|
42534
|
-
});
|
|
42535
|
-
this.htmlDocument.addEventListener("scroll", e => {
|
|
42536
|
-
this.hover.update();
|
|
42537
|
-
this.selection.update();
|
|
42538
|
-
}, {
|
|
42539
|
-
passive: true
|
|
42540
|
-
});
|
|
42541
|
-
this.htmlDocument.addEventListener("pointerover", e => {
|
|
42542
|
-
let target = e.target;
|
|
42543
|
-
target = target.nodeType === Node.ELEMENT_NODE && target.tagName ? target : target.parentElement;
|
|
42544
|
-
if (this.hover.element === target) {
|
|
42545
|
-
return;
|
|
42546
|
-
}
|
|
42547
|
-
this.hover.update(target);
|
|
42548
|
-
}, {
|
|
42549
|
-
capture: true
|
|
42550
|
-
});
|
|
42551
|
-
this.htmlDocument.addEventListener("keydown", e => {
|
|
42552
|
-
if (e.ctrlKey || e.metaKey) {
|
|
42553
|
-
switch (e.key) {
|
|
42554
|
-
case "s":
|
|
42555
|
-
this.contentEditor.dispatchEvent(new CustomEvent("savePage", {
|
|
42556
|
-
bubbles: true
|
|
42557
|
-
}));
|
|
42558
|
-
e.preventDefault();
|
|
42559
|
-
break;
|
|
42560
|
-
case "z":
|
|
42561
|
-
this.contentEditor.dispatchEvent(new CustomEvent("undo", {
|
|
42562
|
-
bubbles: true
|
|
42563
|
-
}));
|
|
42564
|
-
e.preventDefault();
|
|
42565
|
-
break;
|
|
42566
|
-
case "y":
|
|
42567
|
-
this.contentEditor.dispatchEvent(new CustomEvent("redo", {
|
|
42568
|
-
bubbles: true
|
|
42569
|
-
}));
|
|
42570
|
-
e.preventDefault();
|
|
42571
|
-
break;
|
|
42572
|
-
}
|
|
42573
|
-
}
|
|
42574
|
-
});
|
|
42575
|
-
InstallDragDropHelper(this);
|
|
42576
|
-
this.htmlDocument.close();
|
|
42577
|
-
this.htmlDocument.body.contentEditable = "true";
|
|
42578
|
-
setTimeout(() => {
|
|
42579
|
-
this.app.runAsync(() => __awaiter(this, void 0, void 0, function* () {
|
|
42580
|
-
yield this.setStylerSheet();
|
|
42581
|
-
this.loadVariables();
|
|
42582
|
-
}));
|
|
42583
|
-
}, 10);
|
|
42584
|
-
}));
|
|
42534
|
+
} else {
|
|
42535
|
+
baseElement = doc.createElement("base");
|
|
42536
|
+
baseElement.setAttribute("href", this.baseUrl);
|
|
42537
|
+
doc.head.insertAdjacentElement("afterbegin", baseElement);
|
|
42538
|
+
}
|
|
42539
|
+
return this.initDocument(doc.documentElement.outerHTML);
|
|
42540
|
+
});
|
|
42585
42541
|
}
|
|
42586
42542
|
constructor(app, e) {
|
|
42587
42543
|
super(app, e);
|
|
@@ -42620,7 +42576,7 @@ System.register(["tslib", "@web-atoms/core/dist/core/Bind", "@web-atoms/core/dis
|
|
|
42620
42576
|
class: "fa-solid fa-code"
|
|
42621
42577
|
}))), XNode.create(EditorToolbar, {
|
|
42622
42578
|
"data-element": "left"
|
|
42623
|
-
}, 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", {
|
|
42579
|
+
}, 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", {
|
|
42624
42580
|
"data-element": "editor",
|
|
42625
42581
|
"style-max-width": Bind.oneWay(() => this.maxWidth > 768 ? "" : this.maxWidth + "px")
|
|
42626
42582
|
}, XNode.create("div", {
|
|
@@ -42694,7 +42650,7 @@ System.register(["tslib", "@web-atoms/core/dist/core/Bind", "@web-atoms/core/dis
|
|
|
42694
42650
|
}, XNode.create("i", {
|
|
42695
42651
|
class: "fas fa-code"
|
|
42696
42652
|
}), "Variables"), XNode.create(Properties, null))));
|
|
42697
|
-
|
|
42653
|
+
this.contentEditor = this.element.querySelector(`[data-element="content-editor"]`);
|
|
42698
42654
|
});
|
|
42699
42655
|
}
|
|
42700
42656
|
buildXNode(node) {
|
|
@@ -42846,6 +42802,7 @@ System.register(["tslib", "@web-atoms/core/dist/core/Bind", "@web-atoms/core/dis
|
|
|
42846
42802
|
}
|
|
42847
42803
|
}
|
|
42848
42804
|
commit() {
|
|
42805
|
+
var _a;
|
|
42849
42806
|
this.redoList.clear();
|
|
42850
42807
|
const lastHtml = this.lastHtml;
|
|
42851
42808
|
const clone = this.htmlDocument.documentElement.cloneNode(true);
|
|
@@ -42876,6 +42833,16 @@ System.register(["tslib", "@web-atoms/core/dist/core/Bind", "@web-atoms/core/dis
|
|
|
42876
42833
|
}
|
|
42877
42834
|
this.undoList.add(this.lastHtml);
|
|
42878
42835
|
this.lastHtml = currentHtml;
|
|
42836
|
+
if (this.baseUrl) {
|
|
42837
|
+
if (!this.originalBaseUrl) {
|
|
42838
|
+
(_a = clone.querySelector("base")) === null || _a === void 0 ? void 0 : _a.remove();
|
|
42839
|
+
} else {
|
|
42840
|
+
const baseUrl = clone.querySelector("base");
|
|
42841
|
+
if (baseUrl) {
|
|
42842
|
+
baseUrl.setAttribute("href", this.originalBaseUrl);
|
|
42843
|
+
}
|
|
42844
|
+
}
|
|
42845
|
+
}
|
|
42879
42846
|
this.element.dispatchEvent(new CustomEvent("htmlPageChanged", {
|
|
42880
42847
|
detail: clone.outerHTML,
|
|
42881
42848
|
bubbles: true
|
|
@@ -42896,6 +42863,98 @@ System.register(["tslib", "@web-atoms/core/dist/core/Bind", "@web-atoms/core/dis
|
|
|
42896
42863
|
this.htmlDocument.documentElement.innerHTML = this.redoList.removeAt(this.redoList.length - 1);
|
|
42897
42864
|
this.htmlDocument.body.contentEditable = "true";
|
|
42898
42865
|
}
|
|
42866
|
+
initDocument(v) {
|
|
42867
|
+
void this.ready.then(() => __awaiter(this, void 0, void 0, function* () {
|
|
42868
|
+
this.htmlDocument = void 0;
|
|
42869
|
+
yield this.loadContentDocument();
|
|
42870
|
+
this.htmlDocument.open();
|
|
42871
|
+
this.htmlDocument.write(v);
|
|
42872
|
+
this.htmlDocument.addEventListener("click", e => {
|
|
42873
|
+
const target = e.target;
|
|
42874
|
+
const previous = this.selection.element;
|
|
42875
|
+
if (previous === null || previous === void 0 ? void 0 : previous.isContentEditable) {
|
|
42876
|
+
let start = target;
|
|
42877
|
+
while (start) {
|
|
42878
|
+
if (previous === target) {
|
|
42879
|
+
return;
|
|
42880
|
+
}
|
|
42881
|
+
start = start.parentElement;
|
|
42882
|
+
}
|
|
42883
|
+
if (previous !== this.htmlDocument.body) {
|
|
42884
|
+
previous.removeAttribute("contentEditable");
|
|
42885
|
+
}
|
|
42886
|
+
this.commit();
|
|
42887
|
+
}
|
|
42888
|
+
e.preventDefault();
|
|
42889
|
+
this.setSelection(target);
|
|
42890
|
+
});
|
|
42891
|
+
this.htmlDocument.addEventListener("dblclick", e => {
|
|
42892
|
+
const target = e.target;
|
|
42893
|
+
e.preventDefault();
|
|
42894
|
+
const element = target.nodeType === Node.ELEMENT_NODE ? target : target.parentElement;
|
|
42895
|
+
if (element.tagName === "IMG") {
|
|
42896
|
+
this.changeImage().catch(console.error);
|
|
42897
|
+
return;
|
|
42898
|
+
}
|
|
42899
|
+
if (element.getAttribute("data-editable") === "false") {
|
|
42900
|
+
return;
|
|
42901
|
+
}
|
|
42902
|
+
if (element.hasAttribute("data-web-atoms-view")) {
|
|
42903
|
+
return;
|
|
42904
|
+
}
|
|
42905
|
+
this.setSelection(element);
|
|
42906
|
+
});
|
|
42907
|
+
this.htmlDocument.addEventListener("scroll", e => {
|
|
42908
|
+
this.hover.update();
|
|
42909
|
+
this.selection.update();
|
|
42910
|
+
}, {
|
|
42911
|
+
passive: true
|
|
42912
|
+
});
|
|
42913
|
+
this.htmlDocument.addEventListener("pointerover", e => {
|
|
42914
|
+
let target = e.target;
|
|
42915
|
+
target = target.nodeType === Node.ELEMENT_NODE && target.tagName ? target : target.parentElement;
|
|
42916
|
+
if (this.hover.element === target) {
|
|
42917
|
+
return;
|
|
42918
|
+
}
|
|
42919
|
+
this.hover.update(target);
|
|
42920
|
+
}, {
|
|
42921
|
+
capture: true
|
|
42922
|
+
});
|
|
42923
|
+
this.htmlDocument.addEventListener("keydown", e => {
|
|
42924
|
+
if (e.ctrlKey || e.metaKey) {
|
|
42925
|
+
switch (e.key) {
|
|
42926
|
+
case "s":
|
|
42927
|
+
this.contentEditor.dispatchEvent(new CustomEvent("savePage", {
|
|
42928
|
+
bubbles: true
|
|
42929
|
+
}));
|
|
42930
|
+
e.preventDefault();
|
|
42931
|
+
break;
|
|
42932
|
+
case "z":
|
|
42933
|
+
this.contentEditor.dispatchEvent(new CustomEvent("undo", {
|
|
42934
|
+
bubbles: true
|
|
42935
|
+
}));
|
|
42936
|
+
e.preventDefault();
|
|
42937
|
+
break;
|
|
42938
|
+
case "y":
|
|
42939
|
+
this.contentEditor.dispatchEvent(new CustomEvent("redo", {
|
|
42940
|
+
bubbles: true
|
|
42941
|
+
}));
|
|
42942
|
+
e.preventDefault();
|
|
42943
|
+
break;
|
|
42944
|
+
}
|
|
42945
|
+
}
|
|
42946
|
+
});
|
|
42947
|
+
InstallDragDropHelper(this);
|
|
42948
|
+
this.htmlDocument.close();
|
|
42949
|
+
this.htmlDocument.body.contentEditable = "true";
|
|
42950
|
+
setTimeout(() => {
|
|
42951
|
+
this.app.runAsync(() => __awaiter(this, void 0, void 0, function* () {
|
|
42952
|
+
yield this.setStylerSheet();
|
|
42953
|
+
this.loadVariables();
|
|
42954
|
+
}));
|
|
42955
|
+
}, 10);
|
|
42956
|
+
}));
|
|
42957
|
+
}
|
|
42899
42958
|
setStylerSheet() {
|
|
42900
42959
|
return __awaiter(this, void 0, void 0, function* () {
|
|
42901
42960
|
const document = this.htmlDocument;
|
|
@@ -42930,10 +42989,10 @@ System.register(["tslib", "@web-atoms/core/dist/core/Bind", "@web-atoms/core/dis
|
|
|
42930
42989
|
this.htmlDocument = this.contentEditor.contentDocument;
|
|
42931
42990
|
yield sleep(100);
|
|
42932
42991
|
}
|
|
42933
|
-
this.htmlDocument.body.contentEditable = "true";
|
|
42934
42992
|
});
|
|
42935
42993
|
}
|
|
42936
42994
|
});
|
|
42995
|
+
__decorate([BindableProperty, __metadata("design:type", String)], HtmlPageEditor.prototype, "baseUrl", void 0);
|
|
42937
42996
|
__decorate([Action({
|
|
42938
42997
|
onEvent: "delete-element"
|
|
42939
42998
|
}), __metadata("design:type", Function), __metadata("design:paramtypes", []), __metadata("design:returntype", Promise)], HtmlPageEditor.prototype, "deleteElement", null);
|
|
@@ -43783,6 +43842,7 @@ System.register(["tslib", "@web-atoms/core/dist/core/InjectProperty", "@web-atom
|
|
|
43783
43842
|
}
|
|
43784
43843
|
const indexHtml = this.root.children.find(x => x.name === "index.html");
|
|
43785
43844
|
this.selectedFile = indexHtml;
|
|
43845
|
+
const baseUrl = `/api/site/draft/${this.root.appFileID}/`;
|
|
43786
43846
|
this.titleRenderer = () => XNode.create("div", {
|
|
43787
43847
|
"data-layout": "row"
|
|
43788
43848
|
}, XNode.create("div", {
|
|
@@ -43813,7 +43873,13 @@ System.register(["tslib", "@web-atoms/core/dist/core/InjectProperty", "@web-atom
|
|
|
43813
43873
|
"data-click-event": "view-website",
|
|
43814
43874
|
icon: "fad fa-globe-pointer",
|
|
43815
43875
|
text: "View Site"
|
|
43816
|
-
}),
|
|
43876
|
+
}), XNode.create("a", {
|
|
43877
|
+
href: `/api/site/draft/${this.webSite.folderID}`,
|
|
43878
|
+
target: "_blank"
|
|
43879
|
+
}, XNode.create(EditIconTextButton, {
|
|
43880
|
+
icon: "fad fa-globe-pointer",
|
|
43881
|
+
text: "Preview Draft"
|
|
43882
|
+
})), this.parameters.templates && XNode.create("div", {
|
|
43817
43883
|
"data-layout": "row",
|
|
43818
43884
|
"style-display": Bind.oneWay(() => this.selectedFile.appFileID > 0)
|
|
43819
43885
|
}, XNode.create("i", {
|
|
@@ -43846,6 +43912,7 @@ System.register(["tslib", "@web-atoms/core/dist/core/InjectProperty", "@web-atom
|
|
|
43846
43912
|
}
|
|
43847
43913
|
}), XNode.create(WebSitePageEditor, {
|
|
43848
43914
|
class: "file-list",
|
|
43915
|
+
baseUrl: baseUrl,
|
|
43849
43916
|
folder: this.root,
|
|
43850
43917
|
presenter: Bind.presenter(c => this.htmlEditor = c),
|
|
43851
43918
|
"event-html-page-changed": ce => this.pageContent = ce.detail,
|