@social-mail/social-mail-client 1.9.95 → 1.9.97
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/templates/plain/blank.html +38 -0
- package/css-for-email.js +78 -0
- package/dist/admin/AdminAppIndex.pack.js +6 -4
- package/dist/admin/AdminAppIndex.pack.js.map +1 -1
- package/dist/admin/AdminAppIndex.pack.min.js +1 -1
- package/dist/admin/AdminAppIndex.pack.min.js.map +1 -1
- package/dist/common/pages/files/service/CloudFileService.d.ts +2 -0
- package/dist/common/pages/files/service/CloudFileService.d.ts.map +1 -1
- package/dist/common/pages/files/service/CloudFileService.js +6 -4
- package/dist/common/pages/files/service/CloudFileService.js.map +1 -1
- package/dist/site-editor-app/SiteEditorApp.pack.js +38 -7
- package/dist/site-editor-app/SiteEditorApp.pack.js.map +1 -1
- package/dist/site-editor-app/SiteEditorApp.pack.min.js +1 -1
- package/dist/site-editor-app/SiteEditorApp.pack.min.js.map +1 -1
- package/dist/site-editor-app/pages/websites/studio/WebSiteStudioPage.d.ts +1 -0
- package/dist/site-editor-app/pages/websites/studio/WebSiteStudioPage.d.ts.map +1 -1
- package/dist/site-editor-app/pages/websites/studio/WebSiteStudioPage.js +32 -3
- package/dist/site-editor-app/pages/websites/studio/WebSiteStudioPage.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/web/AppIndex.pack.js +6 -4
- package/dist/web/AppIndex.pack.js.map +1 -1
- package/dist/web/AppIndex.pack.min.js +1 -1
- package/dist/web/AppIndex.pack.min.js.map +1 -1
- package/package.json +1 -1
- package/src/common/pages/files/service/CloudFileService.ts +5 -4
- package/src/site-editor-app/pages/websites/studio/WebSiteStudioPage.tsx +31 -1
package/package.json
CHANGED
|
@@ -16,11 +16,13 @@ const hideActivityIndicator = true;
|
|
|
16
16
|
export type ISaveFileModel = ({
|
|
17
17
|
parentID: number;
|
|
18
18
|
folder?: string;
|
|
19
|
+
name?: string,
|
|
19
20
|
appFileID?: never;
|
|
20
21
|
} | {
|
|
21
22
|
appFileID: number;
|
|
22
23
|
parentID?: never;
|
|
23
24
|
folder?: never;
|
|
25
|
+
name?: never;
|
|
24
26
|
}) & { content: File };
|
|
25
27
|
|
|
26
28
|
@DISingleton()
|
|
@@ -127,7 +129,7 @@ export default class CloudFileService {
|
|
|
127
129
|
|
|
128
130
|
async getFolder(id, cancelToken = null) {
|
|
129
131
|
const folder = await this.entityService.query(AppFile)
|
|
130
|
-
.where({id}, (p) => (x) => x.appFileID === p.id)
|
|
132
|
+
.where({id}, (p) => (x) => x.appFileID === p.id && x.isDeleted === false)
|
|
131
133
|
.include((x) => x.creator)
|
|
132
134
|
.firstOrDefault({ cancelToken });
|
|
133
135
|
folder.children = [];
|
|
@@ -152,7 +154,6 @@ export default class CloudFileService {
|
|
|
152
154
|
&& (x.contentType === "text/html" || x.isFolder === true)
|
|
153
155
|
)
|
|
154
156
|
.include((x) => x.creator)
|
|
155
|
-
.include((x) => x.children)
|
|
156
157
|
.toArray({ cancelToken });
|
|
157
158
|
|
|
158
159
|
root.children = [];
|
|
@@ -402,8 +403,8 @@ export default class CloudFileService {
|
|
|
402
403
|
|
|
403
404
|
async saveFile(fm: ISaveFileModel) {
|
|
404
405
|
|
|
405
|
-
const { appFileID, content, parentID, folder } = fm;
|
|
406
|
-
return this.localFileService.uploadFile(content, { appFileID, parentID, folder
|
|
406
|
+
const { appFileID, content, parentID, folder, name } = fm;
|
|
407
|
+
return this.localFileService.uploadFile(content, { appFileID, parentID, folder, name });
|
|
407
408
|
|
|
408
409
|
// check if file exists...
|
|
409
410
|
|
|
@@ -39,6 +39,7 @@ import StudioLayers from "./layers/StudioLayers";
|
|
|
39
39
|
import Designs from "../../../../site-editor/tools/designs/Designs";
|
|
40
40
|
import SiteEditorCommands from "../../../commands/SiteEditorCommands";
|
|
41
41
|
import Loader from "../../../../common/controls/Loader";
|
|
42
|
+
import { UMD } from "@web-atoms/core/dist/core/types";
|
|
42
43
|
|
|
43
44
|
export default class WebSiteStudioPage extends ContentPage {
|
|
44
45
|
|
|
@@ -231,7 +232,13 @@ export default class WebSiteStudioPage extends ContentPage {
|
|
|
231
232
|
/>
|
|
232
233
|
]
|
|
233
234
|
: [])
|
|
234
|
-
:
|
|
235
|
+
: [
|
|
236
|
+
<MenuItem
|
|
237
|
+
icon="fas fa-file"
|
|
238
|
+
data-click-event="new-html-file"
|
|
239
|
+
label="New Html Page"
|
|
240
|
+
/>
|
|
241
|
+
]}
|
|
235
242
|
event-selected-item-changing={(ce) => {
|
|
236
243
|
if (this.modified) {
|
|
237
244
|
if(confirm("Page is modified but not saved, your changes will be lost")) {
|
|
@@ -421,6 +428,29 @@ export default class WebSiteStudioPage extends ContentPage {
|
|
|
421
428
|
}
|
|
422
429
|
}
|
|
423
430
|
|
|
431
|
+
@Action({ onEvent: "new-html-file"})
|
|
432
|
+
async newHtmlPage(file: IAppFile) {
|
|
433
|
+
let fileName = prompt("Enter name of new file (without .html extension)", "");
|
|
434
|
+
if (!fileName) {
|
|
435
|
+
return;
|
|
436
|
+
}
|
|
437
|
+
|
|
438
|
+
if(!fileName.endsWith(".html")) {
|
|
439
|
+
fileName += ".html";
|
|
440
|
+
}
|
|
441
|
+
|
|
442
|
+
const text = await FetchBuilder.get(UMD.resolvePath("@social-mail/social-mail-client/content/templates/plain/blank.html"))
|
|
443
|
+
.asText();
|
|
444
|
+
|
|
445
|
+
const content = new File([text], fileName, { type: "text/html"} );
|
|
446
|
+
|
|
447
|
+
await this.cloudFileService.saveFile({
|
|
448
|
+
parentID: file.appFileID,
|
|
449
|
+
name: fileName + ".html",
|
|
450
|
+
content
|
|
451
|
+
});
|
|
452
|
+
}
|
|
453
|
+
|
|
424
454
|
@Action({
|
|
425
455
|
onEvent: "publish-website",
|
|
426
456
|
success: "Web site published successfully."
|