@social-mail/social-mail-client 1.2.19 → 1.2.21
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/modules/monaco/monaco.html +50 -0
- package/content/modules/monaco/monaco.mjs +26 -0
- package/dist/admin/AdminAppIndex.pack.js +349 -37
- package/dist/admin/AdminAppIndex.pack.js.map +1 -1
- package/dist/admin/AdminAppIndex.pack.min.js +10 -9
- package/dist/admin/AdminAppIndex.pack.min.js.map +1 -1
- package/dist/code-editor/CodeEditorPage.d.ts +13 -0
- package/dist/code-editor/CodeEditorPage.d.ts.map +1 -0
- package/dist/code-editor/CodeEditorPage.js +101 -0
- package/dist/code-editor/CodeEditorPage.js.map +1 -0
- package/dist/code-editor/MonaoEditor.d.ts +20 -0
- package/dist/code-editor/MonaoEditor.d.ts.map +1 -0
- package/dist/code-editor/MonaoEditor.js +117 -0
- package/dist/code-editor/MonaoEditor.js.map +1 -0
- package/dist/common/pages/websites/manage/ManageWebSitePage.d.ts.map +1 -1
- package/dist/common/pages/websites/manage/ManageWebSitePage.js +11 -2
- package/dist/common/pages/websites/manage/ManageWebSitePage.js.map +1 -1
- package/dist/common/pages/websites/studio/WebSiteStudioPage.d.ts +4 -0
- package/dist/common/pages/websites/studio/WebSiteStudioPage.d.ts.map +1 -1
- package/dist/common/pages/websites/studio/WebSiteStudioPage.js +12 -1
- package/dist/common/pages/websites/studio/WebSiteStudioPage.js.map +1 -1
- package/dist/site-editor/editor/HtmlPageEditor.d.ts +1 -0
- package/dist/site-editor/editor/HtmlPageEditor.d.ts.map +1 -1
- package/dist/site-editor/editor/HtmlPageEditor.js +23 -8
- package/dist/site-editor/editor/HtmlPageEditor.js.map +1 -1
- package/dist/site-editor/editor/WebSitePageEditor.d.ts +1 -0
- package/dist/site-editor/editor/WebSitePageEditor.d.ts.map +1 -1
- package/dist/site-editor/editor/WebSitePageEditor.js +17 -2
- package/dist/site-editor/editor/WebSitePageEditor.js.map +1 -1
- package/dist/site-editor/styler/StylerSet.d.ts +1 -0
- package/dist/site-editor/styler/StylerSet.d.ts.map +1 -1
- package/dist/site-editor/styler/StylerSet.js +1 -0
- package/dist/site-editor/styler/StylerSet.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/web/AppIndex.pack.js +349 -37
- package/dist/web/AppIndex.pack.js.map +1 -1
- package/dist/web/AppIndex.pack.min.js +10 -9
- package/dist/web/AppIndex.pack.min.js.map +1 -1
- package/dist/web/page/files/FolderPage.d.ts +2 -0
- package/dist/web/page/files/FolderPage.d.ts.map +1 -1
- package/dist/web/page/files/FolderPage.js +39 -16
- package/dist/web/page/files/FolderPage.js.map +1 -1
- package/dist/web/page/files/service/CloudFileService.d.ts +2 -0
- package/dist/web/page/files/service/CloudFileService.d.ts.map +1 -1
- package/dist/web/page/files/service/CloudFileService.js +15 -2
- package/dist/web/page/files/service/CloudFileService.js.map +1 -1
- package/node_modules/@web-atoms/module-loader/package.json +1 -1
- package/node_modules/@web-atoms/module-loader/umd/src/AmdLoader.ts +5 -5
- package/node_modules/@web-atoms/module-loader/umd.js +5 -5
- package/node_modules/@web-atoms/module-loader/umd.js.map +1 -1
- package/node_modules/@web-atoms/web-controls/dist/basic/styles/repeater-style.js +1 -0
- package/node_modules/@web-atoms/web-controls/dist/basic/styles/repeater-style.js.map +1 -1
- package/node_modules/@web-atoms/web-controls/dist/tsconfig.tsbuildinfo +1 -1
- package/node_modules/@web-atoms/web-controls/package.json +1 -1
- package/node_modules/@web-atoms/web-controls/src/basic/styles/repeater-style.ts +1 -0
- package/package.json +3 -3
- package/src/code-editor/CodeEditorPage.tsx +67 -0
- package/src/code-editor/MonaoEditor.tsx +112 -0
- package/src/common/pages/websites/manage/ManageWebSitePage.tsx +7 -0
- package/src/common/pages/websites/studio/WebSiteStudioPage.tsx +22 -1
- package/src/site-editor/editor/HtmlPageEditor.tsx +22 -6
- package/src/site-editor/editor/WebSitePageEditor.tsx +11 -0
- package/src/site-editor/styler/StylerSet.ts +2 -0
- package/src/web/page/files/FolderPage.tsx +57 -29
- package/src/web/page/files/service/CloudFileService.ts +7 -2
|
@@ -16,6 +16,7 @@ import ChooseWebSiteTemplatePage from "../templates/ChooseWebSiteTemplatePage";
|
|
|
16
16
|
import FetchBuilder from "@web-atoms/core/dist/services/FetchBuilder";
|
|
17
17
|
import { FileTreeView } from "../../../controls/tree/FileTreeView";
|
|
18
18
|
import WebSitePageEditor from "../../../../site-editor/editor/WebSitePageEditor";
|
|
19
|
+
import HtmlPageEditor from "../../../../site-editor/editor/HtmlPageEditor";
|
|
19
20
|
|
|
20
21
|
const css = styled.css `
|
|
21
22
|
display: grid;
|
|
@@ -64,11 +65,18 @@ export default class WebSiteStudioPage extends ContentPage {
|
|
|
64
65
|
@InjectProperty
|
|
65
66
|
private cloudFileService: CloudFileService;
|
|
66
67
|
|
|
68
|
+
private lastHtml: string;
|
|
69
|
+
|
|
70
|
+
private htmlEditor: HtmlPageEditor;
|
|
71
|
+
|
|
67
72
|
async init() {
|
|
68
73
|
this.search = "";
|
|
69
74
|
this.root = await this.cloudFileService.root(this.parameters);
|
|
70
75
|
this.root.children ??= [];
|
|
71
|
-
this.root.children.remove((x) => x.isDeleted || (
|
|
76
|
+
this.root.children.remove((x) => x.isDeleted || !(
|
|
77
|
+
/^(text\/(html|css))$/i.test(x.contentType)
|
|
78
|
+
|| x.isFolder
|
|
79
|
+
));
|
|
72
80
|
this.root.children.sort((a, b) => a.isFolder ? -1 : 0);
|
|
73
81
|
|
|
74
82
|
await this.onItemExpanded(this.root);
|
|
@@ -150,6 +158,7 @@ export default class WebSiteStudioPage extends ContentPage {
|
|
|
150
158
|
<WebSitePageEditor
|
|
151
159
|
class="file-list"
|
|
152
160
|
folder={this.root}
|
|
161
|
+
presenter={Bind.presenter((c) => this.htmlEditor = c)}
|
|
153
162
|
event-html-page-changed={(ce: CustomEvent<string>) => this.pageContent = ce.detail}
|
|
154
163
|
htmlPage={Bind.oneWayAsync((s, e, cancelToken) => this.selectedFile
|
|
155
164
|
? FetchBuilder.get(this.selectedFile.downloadUrl)
|
|
@@ -217,4 +226,16 @@ export default class WebSiteStudioPage extends ContentPage {
|
|
|
217
226
|
await this.cloudFileService.saveFile({ appFileID: this.selectedFile.appFileID, content });
|
|
218
227
|
this.pageContent = "";
|
|
219
228
|
}
|
|
229
|
+
|
|
230
|
+
protected hide(): void {
|
|
231
|
+
this.pageContent = this.htmlEditor.htmlPage;
|
|
232
|
+
super.hide();
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
protected show(): void {
|
|
236
|
+
super.show();
|
|
237
|
+
if (this.pageContent) {
|
|
238
|
+
setTimeout(() => this.htmlEditor.htmlPage = this.pageContent, 400);
|
|
239
|
+
}
|
|
240
|
+
}
|
|
220
241
|
}
|
|
@@ -173,10 +173,15 @@ export default class HtmlPageEditor extends AtomControl {
|
|
|
173
173
|
}, 100);
|
|
174
174
|
return;
|
|
175
175
|
}
|
|
176
|
-
void this.ready.then(() => {
|
|
176
|
+
void this.ready.then(async () => {
|
|
177
177
|
if(!this.htmlDocument) {
|
|
178
178
|
return;
|
|
179
179
|
}
|
|
180
|
+
const iframe = this.element as HTMLIFrameElement;
|
|
181
|
+
if(this.htmlDocument !== iframe.contentDocument) {
|
|
182
|
+
this.htmlDocument = void 0;
|
|
183
|
+
await this.loadContentDocument();
|
|
184
|
+
}
|
|
180
185
|
this.htmlDocument.open();
|
|
181
186
|
this.htmlDocument.write(v);
|
|
182
187
|
this.htmlDocument.addEventListener("click", (e) => {
|
|
@@ -366,15 +371,17 @@ export default class HtmlPageEditor extends AtomControl {
|
|
|
366
371
|
</div>
|
|
367
372
|
</div>
|
|
368
373
|
<div data-element="right">
|
|
374
|
+
<button
|
|
375
|
+
data-click-event="open-variables"
|
|
376
|
+
data-layout="icon-button">
|
|
377
|
+
<i class="fas fa-code"/>
|
|
378
|
+
Variables
|
|
379
|
+
</button>
|
|
369
380
|
<Properties/>
|
|
370
381
|
</div>
|
|
371
382
|
</div>);
|
|
372
383
|
|
|
373
|
-
|
|
374
|
-
while(!this.htmlDocument) {
|
|
375
|
-
this.htmlDocument = this.contentEditor.contentDocument;
|
|
376
|
-
await sleep(100);
|
|
377
|
-
}
|
|
384
|
+
await this.loadContentDocument();
|
|
378
385
|
}
|
|
379
386
|
|
|
380
387
|
public buildXNode(node: XNode) {
|
|
@@ -561,4 +568,13 @@ export default class HtmlPageEditor extends AtomControl {
|
|
|
561
568
|
this.pageVariables = StylerSet.instance.vars.map((x) => new StylerVariable(x.name, x.value, this.htmlDocument, onChange));
|
|
562
569
|
|
|
563
570
|
}
|
|
571
|
+
|
|
572
|
+
private async loadContentDocument() {
|
|
573
|
+
this.contentEditor = this.element.querySelector(`[data-element="content-editor"]`);
|
|
574
|
+
while (!this.htmlDocument) {
|
|
575
|
+
this.htmlDocument = this.contentEditor.contentDocument;
|
|
576
|
+
await sleep(100);
|
|
577
|
+
}
|
|
578
|
+
}
|
|
579
|
+
|
|
564
580
|
}
|
|
@@ -7,6 +7,9 @@ import { StylerSet } from "../styler/StylerSet";
|
|
|
7
7
|
import InjectProperty from "@web-atoms/core/dist/core/InjectProperty";
|
|
8
8
|
import CloudFileService from "../../web/page/files/service/CloudFileService";
|
|
9
9
|
import FetchBuilder from "@web-atoms/core/dist/services/FetchBuilder";
|
|
10
|
+
import Action from "@web-atoms/core/dist/view-model/Action";
|
|
11
|
+
import MonacoEditor from "../../code-editor/MonaoEditor";
|
|
12
|
+
import CodeEditorPage from "../../code-editor/CodeEditorPage";
|
|
10
13
|
|
|
11
14
|
export default class WebSitePageEditor extends HtmlPageEditor {
|
|
12
15
|
|
|
@@ -22,6 +25,13 @@ export default class WebSitePageEditor extends HtmlPageEditor {
|
|
|
22
25
|
await this.insertImage(src);
|
|
23
26
|
}
|
|
24
27
|
|
|
28
|
+
@Action({ onEvent: "open-variables"})
|
|
29
|
+
async openVariables() {
|
|
30
|
+
const file = await this.cloudFileService.children(this.folder.appFileID, "styles/vars.css").firstOrDefault();
|
|
31
|
+
const changedFile = await PageNavigator.pushPage(CodeEditorPage, file);
|
|
32
|
+
await this.addStyleSheet(changedFile);
|
|
33
|
+
}
|
|
34
|
+
|
|
25
35
|
protected async setStylerSheet() {
|
|
26
36
|
|
|
27
37
|
const stylerCSS = await this.createFile("styler.css", StylerSet.instance.toString());
|
|
@@ -32,6 +42,7 @@ export default class WebSitePageEditor extends HtmlPageEditor {
|
|
|
32
42
|
.firstOrDefault();
|
|
33
43
|
if (!vars) {
|
|
34
44
|
vars = await this.createFile("vars.css", `* {
|
|
45
|
+
${StylerSet.instance.varsCss}
|
|
35
46
|
}`);
|
|
36
47
|
}
|
|
37
48
|
await this.addStyleSheet(vars);
|
|
@@ -2,7 +2,7 @@ import { ContentPage } from "@web-atoms/web-controls/dist/mobile-app/MobileApp";
|
|
|
2
2
|
import { AppFile, IAppFile } from "../../../model/model";
|
|
3
3
|
import XNode from "@web-atoms/core/dist/core/XNode";
|
|
4
4
|
import UploadEvent from "@web-atoms/web-controls/dist/basic/UploadEvent";
|
|
5
|
-
import AtomRepeater from "@web-atoms/web-controls/dist/basic/AtomRepeater";
|
|
5
|
+
import AtomRepeater, { SelectorCheckBox } from "@web-atoms/web-controls/dist/basic/AtomRepeater";
|
|
6
6
|
import TreeView from "../../../common/controls/tree/TreeView";
|
|
7
7
|
import Bind from "@web-atoms/core/dist/core/Bind";
|
|
8
8
|
import Action from "@web-atoms/core/dist/view-model/Action";
|
|
@@ -65,6 +65,8 @@ export default class FolderPage extends ContentPage {
|
|
|
65
65
|
|
|
66
66
|
private folderTree: TreeView;
|
|
67
67
|
|
|
68
|
+
private selectedFiles: IAppFile[] = [];
|
|
69
|
+
|
|
68
70
|
@InjectProperty
|
|
69
71
|
private cloudFileService: CloudFileService;
|
|
70
72
|
|
|
@@ -139,7 +141,9 @@ export default class FolderPage extends ContentPage {
|
|
|
139
141
|
})}
|
|
140
142
|
>
|
|
141
143
|
<AtomRepeater
|
|
142
|
-
|
|
144
|
+
data-layout="data-grid"
|
|
145
|
+
allowMultipleSelection={true}
|
|
146
|
+
selectedItems={this.selectedFiles}
|
|
143
147
|
items={Bind.oneWayAsync((c, e, cancelToken) =>
|
|
144
148
|
this.cloudFileService.files({
|
|
145
149
|
search: this.search,
|
|
@@ -152,56 +156,73 @@ export default class FolderPage extends ContentPage {
|
|
|
152
156
|
/>
|
|
153
157
|
</div>
|
|
154
158
|
</div>;
|
|
159
|
+
|
|
160
|
+
this.footerRenderer = () => <div
|
|
161
|
+
style-display={Bind.oneWay(() => this.selectedFiles.length > 0)}
|
|
162
|
+
data-layout="command-row">
|
|
163
|
+
<button
|
|
164
|
+
data-click-event="delete-files"
|
|
165
|
+
data-layout="stop-icon-button">
|
|
166
|
+
<i class="fas fa-trash-can"/>
|
|
167
|
+
Delete
|
|
168
|
+
</button>
|
|
169
|
+
</div>;
|
|
155
170
|
}
|
|
156
171
|
|
|
157
172
|
renderFile(item: IAppFile) {
|
|
158
173
|
|
|
159
174
|
if (item.isFolder) {
|
|
160
|
-
return <
|
|
161
|
-
<
|
|
175
|
+
return <div>
|
|
176
|
+
<SelectorCheckBox
|
|
177
|
+
/>
|
|
178
|
+
<div>
|
|
162
179
|
<i class={item.isFolder ? "fiv-viv fiv-icon-folder" : `fiv-viv fiv-icon-${getExtension(item.name)}`} />
|
|
163
180
|
<span data-click-event="open-folder" class="file-link" text={item.name} data-padding-left="auto"/>
|
|
164
|
-
</
|
|
165
|
-
<
|
|
166
|
-
<
|
|
167
|
-
<
|
|
168
|
-
<
|
|
181
|
+
</div>
|
|
182
|
+
<div>{item.isShared && <i title="Shared" class="fas fa-folder-user"/>}</div>
|
|
183
|
+
<div text={toFileSize(item.fileSize)}/>
|
|
184
|
+
<div></div>
|
|
185
|
+
<div><i
|
|
169
186
|
data-click-event="edit-shares"
|
|
170
|
-
class="fas fa-share"/></
|
|
171
|
-
</
|
|
187
|
+
class="fas fa-share"/></div>
|
|
188
|
+
</div>;
|
|
172
189
|
}
|
|
173
190
|
|
|
174
191
|
if( this.parameters.templates && item.contentType === "message/rfc822") {
|
|
175
|
-
return <
|
|
176
|
-
<
|
|
192
|
+
return <div>
|
|
193
|
+
<SelectorCheckBox
|
|
194
|
+
/>
|
|
195
|
+
<div>
|
|
177
196
|
<i class={item.isFolder ? "fiv-viv fiv-icon-folder" : `fiv-viv fiv-icon-${getExtension(item.name)}`} />
|
|
178
197
|
<span
|
|
179
198
|
data-click-event="open-template"
|
|
180
199
|
class="file-link"
|
|
181
200
|
text={item.name}
|
|
182
201
|
data-margin-left="default"/>
|
|
183
|
-
</
|
|
184
|
-
<
|
|
185
|
-
<
|
|
186
|
-
<
|
|
187
|
-
<
|
|
202
|
+
</div>
|
|
203
|
+
<div>{item.isShared && <i title="Shared" class="fas fa-folder-user"/>}</div>
|
|
204
|
+
<div text={toFileSize(item.fileSize)}/>
|
|
205
|
+
<div><a href={item.downloadUrl} target="_blank" download={true}><i class="fas fa-download"/></a></div>
|
|
206
|
+
<div><i
|
|
188
207
|
data-click-event="edit-shares"
|
|
189
|
-
class="fas fa-share"/></
|
|
190
|
-
</
|
|
208
|
+
class="fas fa-share"/></div>
|
|
209
|
+
</div>;
|
|
191
210
|
}
|
|
192
211
|
|
|
193
|
-
return <
|
|
194
|
-
<
|
|
212
|
+
return <div>
|
|
213
|
+
<SelectorCheckBox
|
|
214
|
+
/>
|
|
215
|
+
<div>
|
|
195
216
|
<i class={item.isFolder ? "fiv-viv fiv-icon-folder" : `fiv-viv fiv-icon-${getExtension(item.name)}`} />
|
|
196
217
|
<a href={item.url} target="_blank" text={item.name} data-margin-left="default"></a>
|
|
197
|
-
</
|
|
198
|
-
<
|
|
199
|
-
<
|
|
200
|
-
<
|
|
201
|
-
<
|
|
218
|
+
</div>
|
|
219
|
+
<div>{item.isShared && <i title="Shared" class="fas fa-folder-user"/>}</div>
|
|
220
|
+
<div text={toFileSize(item.fileSize)}/>
|
|
221
|
+
<div><a href={item.downloadUrl} target="_blank" download={true}><i class="fas fa-download"/></a></div>
|
|
222
|
+
<div><i
|
|
202
223
|
data-click-event="edit-shares"
|
|
203
|
-
class="fas fa-share"/></
|
|
204
|
-
</
|
|
224
|
+
class="fas fa-share"/></div>
|
|
225
|
+
</div>;
|
|
205
226
|
}
|
|
206
227
|
|
|
207
228
|
@Action({ onEvent: "edit-shares"})
|
|
@@ -230,6 +251,13 @@ export default class FolderPage extends ContentPage {
|
|
|
230
251
|
await this.cloudFileService.expand(item);
|
|
231
252
|
}
|
|
232
253
|
|
|
254
|
+
@Action({ onEvent: "delete-files"})
|
|
255
|
+
async deleteFiles() {
|
|
256
|
+
await this.cloudFileService.delete(this.selectedFiles);
|
|
257
|
+
this.selectedFiles.clear();
|
|
258
|
+
this.version++;
|
|
259
|
+
}
|
|
260
|
+
|
|
233
261
|
@Action({ onEvent: "files-available"})
|
|
234
262
|
async onFilesUploaded() {
|
|
235
263
|
this.version++;
|
|
@@ -18,6 +18,7 @@ export type ISaveFileModel = ({
|
|
|
18
18
|
} | {
|
|
19
19
|
appFileID: number;
|
|
20
20
|
parentID?: never;
|
|
21
|
+
folder?: never;
|
|
21
22
|
}) & { content: File };
|
|
22
23
|
|
|
23
24
|
@DISingleton()
|
|
@@ -248,8 +249,8 @@ export default class CloudFileService {
|
|
|
248
249
|
|
|
249
250
|
async saveFile(fm: ISaveFileModel) {
|
|
250
251
|
|
|
251
|
-
const { appFileID, content, parentID } = fm;
|
|
252
|
-
return this.localFileService.uploadFile(content, { appFileID, parentID });
|
|
252
|
+
const { appFileID, content, parentID, folder } = fm;
|
|
253
|
+
return this.localFileService.uploadFile(content, { appFileID, parentID, folder });
|
|
253
254
|
|
|
254
255
|
// check if file exists...
|
|
255
256
|
|
|
@@ -273,4 +274,8 @@ export default class CloudFileService {
|
|
|
273
274
|
return file;
|
|
274
275
|
}
|
|
275
276
|
|
|
277
|
+
async delete(files: IAppFile[]) {
|
|
278
|
+
files = files.map(({ appFileID }) => ( AppFile.create({ appFileID, $deleted: true })));
|
|
279
|
+
await this.entityService.save(files);
|
|
280
|
+
}
|
|
276
281
|
}
|