@social-mail/social-mail-client 1.2.201 → 1.2.203

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 (34) hide show
  1. package/dist/admin/AdminAppIndex.pack.js +230 -6
  2. package/dist/admin/AdminAppIndex.pack.js.map +1 -1
  3. package/dist/admin/AdminAppIndex.pack.min.js +27 -5
  4. package/dist/admin/AdminAppIndex.pack.min.js.map +1 -1
  5. package/dist/common/pages/files/FileHistoryPage.d.ts +9 -0
  6. package/dist/common/pages/files/FileHistoryPage.d.ts.map +1 -0
  7. package/dist/common/pages/files/FileHistoryPage.js +73 -0
  8. package/dist/common/pages/files/FileHistoryPage.js.map +1 -0
  9. package/dist/common/pages/websites/studio/WebSiteStudioPage.d.ts +1 -0
  10. package/dist/common/pages/websites/studio/WebSiteStudioPage.d.ts.map +1 -1
  11. package/dist/common/pages/websites/studio/WebSiteStudioPage.js +28 -2
  12. package/dist/common/pages/websites/studio/WebSiteStudioPage.js.map +1 -1
  13. package/dist/services/files/FileHistoryService.d.ts +14 -0
  14. package/dist/services/files/FileHistoryService.d.ts.map +1 -0
  15. package/dist/services/files/FileHistoryService.js +67 -0
  16. package/dist/services/files/FileHistoryService.js.map +1 -0
  17. package/dist/site-editor/blocks/MarqueeText.d.ts +9 -0
  18. package/dist/site-editor/blocks/MarqueeText.d.ts.map +1 -0
  19. package/dist/site-editor/blocks/MarqueeText.js +47 -0
  20. package/dist/site-editor/blocks/MarqueeText.js.map +1 -0
  21. package/dist/site-editor/editor/HtmlPageEditor.d.ts.map +1 -1
  22. package/dist/site-editor/editor/HtmlPageEditor.js +5 -3
  23. package/dist/site-editor/editor/HtmlPageEditor.js.map +1 -1
  24. package/dist/tsconfig.tsbuildinfo +1 -1
  25. package/dist/web/AppIndex.pack.js +230 -6
  26. package/dist/web/AppIndex.pack.js.map +1 -1
  27. package/dist/web/AppIndex.pack.min.js +27 -5
  28. package/dist/web/AppIndex.pack.min.js.map +1 -1
  29. package/package.json +1 -1
  30. package/src/common/pages/files/FileHistoryPage.tsx +53 -0
  31. package/src/common/pages/websites/studio/WebSiteStudioPage.tsx +19 -0
  32. package/src/services/files/FileHistoryService.ts +45 -0
  33. package/src/site-editor/blocks/MarqueeText.tsx +46 -0
  34. package/src/site-editor/editor/HtmlPageEditor.tsx +2 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@social-mail/social-mail-client",
3
- "version": "1.2.201",
3
+ "version": "1.2.203",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -0,0 +1,53 @@
1
+ import { PopupWindowPage } from "@web-atoms/web-controls/dist/mobile-app/MobileApp";
2
+ import { IAppFile, IAppFileVersion } from "../../../model/model";
3
+ import XNode from "@web-atoms/core/dist/core/XNode";
4
+ import AtomRepeater from "@web-atoms/web-controls/dist/basic/AtomRepeater";
5
+ import InfiniteRepeater from "../../controls/repeater/InfiniteRepeater";
6
+ import InjectProperty from "@web-atoms/core/dist/core/InjectProperty";
7
+ import { FileHistoryService } from "../../../services/files/FileHistoryService";
8
+ import { DateFormats } from "../../date/DateFormats";
9
+ import { toFileSize } from "../../NumberFormats";
10
+ import { SaveIconTextButton } from "../../controls/buttons/IconButton";
11
+ import Action from "@web-atoms/core/dist/view-model/Action";
12
+
13
+ export default class FileHistoryPage extends PopupWindowPage<IAppFile, IAppFile> {
14
+
15
+
16
+ @InjectProperty
17
+ fileHistoryService: FileHistoryService;
18
+
19
+ async init() {
20
+ this.title = this.parameters.name + " History";
21
+
22
+ this.renderer = <div>
23
+ <AtomRepeater
24
+ data-layout="data-grid"
25
+ { ... InfiniteRepeater.pagedItems((start) => (c, e, cancelToken) => this.fileHistoryService.list({
26
+ appFileID: this.parameters.appFileID,
27
+ start,
28
+ cancelToken
29
+ }))}
30
+ itemRenderer={(item: IAppFileVersion) => <div>
31
+ <label text={item.versionID}/>
32
+ <label text={ DateFormats.relative.short(item.dateCreated)}/>
33
+ <label text={ toFileSize(item.fileContent.contentSize)}/>
34
+ <br/>
35
+ <SaveIconTextButton
36
+ data-click-event="restore-file"
37
+ text="Restore"
38
+ />
39
+ </div>}
40
+ />
41
+ </div>;
42
+ }
43
+
44
+ @Action({
45
+ confirm: "Are you sure you want to restore this version?",
46
+ onEvent: "restore-file",
47
+ close: true,
48
+ success: "File restored successfully."
49
+ })
50
+ async restoreFile(version: IAppFileVersion) {
51
+ return await this.fileHistoryService.restore(version);
52
+ }
53
+ }
@@ -26,6 +26,7 @@ import ViewWebSitePage from "../view/ViewWebSitePage";
26
26
  import WebSiteBlogsPage from "../blogs/WebSiteBlogsPage";
27
27
  import GrapesJSEditor from "../../../controls/html/grapes-js/GrapesJSEditor";
28
28
  import { apiPath } from "../../../apiPath";
29
+ import FileHistoryPage from "../../files/FileHistoryPage";
29
30
 
30
31
  const css = styled.css `
31
32
  display: grid;
@@ -179,6 +180,11 @@ export default class WebSiteStudioPage extends ContentPage {
179
180
  icon="fas fa-copy"
180
181
  data-click-event="duplicate-html"
181
182
  label="Duplicate Page"
183
+ />,
184
+ <MenuItem
185
+ icon="fas fa-history"
186
+ data-click-event="file-history"
187
+ label="File History"
182
188
  />
183
189
  ]
184
190
  : [])
@@ -303,6 +309,19 @@ export default class WebSiteStudioPage extends ContentPage {
303
309
  this.selectedFile = file;
304
310
  }
305
311
 
312
+ @Action({ onEvent: "file-history"})
313
+ async fileHistory(file: IAppFile) {
314
+ const { fileContentID, url, downloadUrl } = await PageNavigator.pushPageForResult(FileHistoryPage, file);
315
+ // restore...
316
+ const { selectedFile } = this;
317
+ if (file.appFileID === selectedFile?.appFileID) {
318
+ // refresh...
319
+ selectedFile.url = url;
320
+ selectedFile.downloadUrl = downloadUrl;
321
+ selectedFile.fileContentID = fileContentID;
322
+ }
323
+ }
324
+
306
325
  @Action({
307
326
  onEvent: "publish-website",
308
327
  confirm: "Are you sure you want to publish this version?",
@@ -0,0 +1,45 @@
1
+ import DITransient from "@web-atoms/core/dist/di/DITransient";
2
+ import { Inject } from "@web-atoms/core/dist/di/Inject";
3
+ import EntityService from "../EntityService";
4
+ import { CancelToken } from "@web-atoms/core/dist/core/types";
5
+ import { AppFile, AppFileVersion, IAppFileVersion } from "../../model/model";
6
+ import { Sql } from "../../common/Sql";
7
+
8
+ @DITransient()
9
+ export class FileHistoryService {
10
+
11
+ @Inject
12
+ private entityService: EntityService;
13
+
14
+ async list({
15
+ start = 0,
16
+ size = 20,
17
+ appFileID = 0,
18
+ search = "",
19
+ cancelToken = void 0 as CancelToken
20
+ }) {
21
+ let q = this.entityService.query(AppFileVersion)
22
+ .where({ appFileID }, (p) => (x) => x.fileID === p.appFileID);
23
+ if (search) {
24
+ q = q.where({ search }, (p) => (x) => Sql.text.includes( x.fileContent.textDocument.searchable, p.search));
25
+ }
26
+ return q
27
+ .include((x) => x.fileContent)
28
+ .orderByDescending((x) => x.versionID)
29
+ .toPagedList({
30
+ start,
31
+ size,
32
+ cancelToken
33
+ });
34
+ }
35
+
36
+ async restore(version: IAppFileVersion) {
37
+ const { fileID, fileContentID } = version;
38
+ const file = await this.entityService.query(AppFile)
39
+ .where({ fileID }, (p) => (x) => x.appFileID === p.fileID)
40
+ .firstOrDefault();
41
+ file.fileContentID = fileContentID;
42
+ await this.entityService.save(file);
43
+ return file;
44
+ }
45
+ }
@@ -0,0 +1,46 @@
1
+ /* eslint-disable @typescript-eslint/naming-convention */
2
+
3
+ import XNode from "@web-atoms/core/dist/core/XNode";
4
+ import { Block } from "./Block";
5
+ import { StylerSets } from "../styler/StylerSets";
6
+ import styled from "@web-atoms/core/dist/style/styled";
7
+
8
+ StylerSets.register("low", styled.css `
9
+
10
+
11
+ &:empty:before {
12
+ background-color: #ddd;
13
+ color: #000;
14
+ font-size: 16px;
15
+ font-weight: bold;
16
+ font-family: 'Courier New', Courier, monospace;
17
+ height: 100%;
18
+ display: flex;
19
+ justify-items: center;
20
+ align-items: center;
21
+ min-height: 30px;
22
+ opacity: 0.3;
23
+ border-radius: 3px;
24
+ white-space: nowrap;
25
+ overflow: hidden;
26
+ text-overflow: ellipsis;
27
+ content: "Marquee Text";
28
+
29
+ }
30
+ `.expand("marquee-text"));
31
+
32
+ /* eslint-disable @typescript-eslint/no-namespace */
33
+ declare global {
34
+ namespace JSX {
35
+ interface IntrinsicElements {
36
+ "marquee-text": any;
37
+ }
38
+ }
39
+ }
40
+
41
+ export const MarqueeText = Block({
42
+ className: "fad fa-text",
43
+ title: "Add Marquee Text",
44
+ factory: () => <marquee-text
45
+ >Your Slding Text</marquee-text>
46
+ });
@@ -41,6 +41,7 @@ import { InlinePopupButton } from "@web-atoms/web-controls/dist/basic/InlinePopu
41
41
  import { VideoPlayer } from "../blocks/VideoPlayer";
42
42
  import { BackgroundVideo } from "../blocks/BackgroundVideo";
43
43
  import { TextMask } from "../blocks/TextMask";
44
+ import { MarqueeText } from "../blocks/MarqueeText";
44
45
 
45
46
  styled.css `
46
47
  display: grid;
@@ -304,6 +305,7 @@ export default class HtmlPageEditor extends AtomControl {
304
305
  <BackgroundVideo/>
305
306
  <TextMask/>
306
307
  <ImageGallery/>
308
+ <MarqueeText/>
307
309
  </EditorToolbar>}></InlinePopupButton>
308
310
  </EditorToolbar>
309
311
  <div data-element="editor"