@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.
Files changed (26) hide show
  1. package/content/templates/plain/blank.html +38 -0
  2. package/css-for-email.js +78 -0
  3. package/dist/admin/AdminAppIndex.pack.js +6 -4
  4. package/dist/admin/AdminAppIndex.pack.js.map +1 -1
  5. package/dist/admin/AdminAppIndex.pack.min.js +1 -1
  6. package/dist/admin/AdminAppIndex.pack.min.js.map +1 -1
  7. package/dist/common/pages/files/service/CloudFileService.d.ts +2 -0
  8. package/dist/common/pages/files/service/CloudFileService.d.ts.map +1 -1
  9. package/dist/common/pages/files/service/CloudFileService.js +6 -4
  10. package/dist/common/pages/files/service/CloudFileService.js.map +1 -1
  11. package/dist/site-editor-app/SiteEditorApp.pack.js +38 -7
  12. package/dist/site-editor-app/SiteEditorApp.pack.js.map +1 -1
  13. package/dist/site-editor-app/SiteEditorApp.pack.min.js +1 -1
  14. package/dist/site-editor-app/SiteEditorApp.pack.min.js.map +1 -1
  15. package/dist/site-editor-app/pages/websites/studio/WebSiteStudioPage.d.ts +1 -0
  16. package/dist/site-editor-app/pages/websites/studio/WebSiteStudioPage.d.ts.map +1 -1
  17. package/dist/site-editor-app/pages/websites/studio/WebSiteStudioPage.js +32 -3
  18. package/dist/site-editor-app/pages/websites/studio/WebSiteStudioPage.js.map +1 -1
  19. package/dist/tsconfig.tsbuildinfo +1 -1
  20. package/dist/web/AppIndex.pack.js +6 -4
  21. package/dist/web/AppIndex.pack.js.map +1 -1
  22. package/dist/web/AppIndex.pack.min.js +1 -1
  23. package/dist/web/AppIndex.pack.min.js.map +1 -1
  24. package/package.json +1 -1
  25. package/src/common/pages/files/service/CloudFileService.ts +5 -4
  26. package/src/site-editor-app/pages/websites/studio/WebSiteStudioPage.tsx +31 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@social-mail/social-mail-client",
3
- "version": "1.9.95",
3
+ "version": "1.9.97",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -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
- : void 0}
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."