@social-mail/social-mail-client 1.2.33 → 1.2.35

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 (95) hide show
  1. package/content/modules/monaco/monaco.html +57 -5
  2. package/dist/admin/AdminAppIndex.pack.js +336 -150
  3. package/dist/admin/AdminAppIndex.pack.js.map +1 -1
  4. package/dist/admin/AdminAppIndex.pack.min.js +7 -7
  5. package/dist/admin/AdminAppIndex.pack.min.js.map +1 -1
  6. package/dist/code-editor/CodeEditorPage.d.ts +1 -0
  7. package/dist/code-editor/CodeEditorPage.d.ts.map +1 -1
  8. package/dist/code-editor/CodeEditorPage.js +12 -18
  9. package/dist/code-editor/CodeEditorPage.js.map +1 -1
  10. package/dist/code-editor/CodeSnippetPage.d.ts +19 -0
  11. package/dist/code-editor/CodeSnippetPage.d.ts.map +1 -0
  12. package/dist/code-editor/CodeSnippetPage.js +98 -0
  13. package/dist/code-editor/CodeSnippetPage.js.map +1 -0
  14. package/dist/code-editor/ICodeSnippet.d.ts +6 -0
  15. package/dist/code-editor/ICodeSnippet.d.ts.map +1 -0
  16. package/dist/code-editor/ICodeSnippet.js +9 -0
  17. package/dist/code-editor/ICodeSnippet.js.map +1 -0
  18. package/dist/code-editor/MonacoService.d.ts +20 -0
  19. package/dist/code-editor/MonacoService.d.ts.map +1 -0
  20. package/dist/code-editor/MonacoService.js +120 -0
  21. package/dist/code-editor/MonacoService.js.map +1 -0
  22. package/dist/code-editor/MonaoEditor.d.ts +0 -19
  23. package/dist/code-editor/MonaoEditor.d.ts.map +1 -1
  24. package/dist/code-editor/MonaoEditor.js +3 -111
  25. package/dist/code-editor/MonaoEditor.js.map +1 -1
  26. package/dist/public/channel/BlogService.d.ts +15 -0
  27. package/dist/public/channel/BlogService.d.ts.map +1 -0
  28. package/dist/public/channel/BlogService.js +69 -0
  29. package/dist/public/channel/BlogService.js.map +1 -0
  30. package/dist/public/channel/ChannelView.d.ts +13 -0
  31. package/dist/public/channel/ChannelView.d.ts.map +1 -0
  32. package/dist/public/channel/ChannelView.js +80 -0
  33. package/dist/public/channel/ChannelView.js.map +1 -0
  34. package/dist/public/channel/ChannelView.pack.js +17831 -0
  35. package/dist/public/channel/ChannelView.pack.js.map +1 -0
  36. package/dist/public/channel/ChannelView.pack.min.js +576 -0
  37. package/dist/public/channel/ChannelView.pack.min.js.map +1 -0
  38. package/dist/public/channel/channelViewStyle.d.ts +2 -0
  39. package/dist/public/channel/channelViewStyle.d.ts.map +1 -0
  40. package/dist/public/channel/channelViewStyle.js +53 -0
  41. package/dist/public/channel/channelViewStyle.js.map +1 -0
  42. package/dist/services/email/EmailContentDownloader.d.ts +6 -0
  43. package/dist/services/email/EmailContentDownloader.d.ts.map +1 -0
  44. package/dist/services/email/EmailContentDownloader.js +44 -0
  45. package/dist/services/email/EmailContentDownloader.js.map +1 -0
  46. package/dist/site-editor/editor/SelectedElement.d.ts +1 -0
  47. package/dist/site-editor/editor/SelectedElement.d.ts.map +1 -1
  48. package/dist/site-editor/editor/SelectedElement.js +11 -1
  49. package/dist/site-editor/editor/SelectedElement.js.map +1 -1
  50. package/dist/site-editor/editor/WebSitePageEditor.d.ts.map +1 -1
  51. package/dist/site-editor/editor/WebSitePageEditor.js.map +1 -1
  52. package/dist/site-editor/properties/Properties.d.ts.map +1 -1
  53. package/dist/site-editor/properties/Properties.js +5 -3
  54. package/dist/site-editor/properties/Properties.js.map +1 -1
  55. package/dist/site-editor/properties/controls/PropertyEditor.d.ts +6 -0
  56. package/dist/site-editor/properties/controls/PropertyEditor.d.ts.map +1 -1
  57. package/dist/site-editor/properties/controls/PropertyEditor.js +21 -3
  58. package/dist/site-editor/properties/controls/PropertyEditor.js.map +1 -1
  59. package/dist/site-editor/properties/groups/AttributeEditor.d.ts +2 -0
  60. package/dist/site-editor/properties/groups/AttributeEditor.d.ts.map +1 -0
  61. package/dist/site-editor/properties/groups/AttributeEditor.js +34 -0
  62. package/dist/site-editor/properties/groups/AttributeEditor.js.map +1 -0
  63. package/dist/tsconfig.tsbuildinfo +1 -1
  64. package/dist/web/AppIndex.pack.js +420 -234
  65. package/dist/web/AppIndex.pack.js.map +1 -1
  66. package/dist/web/AppIndex.pack.min.js +8 -8
  67. package/dist/web/AppIndex.pack.min.js.map +1 -1
  68. package/dist/web/page/mails/mini-compose/Insert.d.ts.map +1 -1
  69. package/dist/web/page/mails/mini-compose/Insert.js +16 -3
  70. package/dist/web/page/mails/mini-compose/Insert.js.map +1 -1
  71. package/dist/web/page/mails/mini-compose/MiniComposeBox.d.ts.map +1 -1
  72. package/dist/web/page/mails/mini-compose/MiniComposeBox.js +8 -0
  73. package/dist/web/page/mails/mini-compose/MiniComposeBox.js.map +1 -1
  74. package/dist/web/page/mails/service/ConversationService.js +1 -1
  75. package/dist/web/page/mails/service/ConversationService.js.map +1 -1
  76. package/index.js +7 -1
  77. package/package.json +1 -1
  78. package/src/code-editor/CodeEditorPage.tsx +14 -8
  79. package/src/code-editor/CodeSnippetPage.tsx +78 -0
  80. package/src/code-editor/ICodeSnippet.ts +5 -0
  81. package/src/code-editor/MonacoService.ts +112 -0
  82. package/src/code-editor/MonaoEditor.tsx +89 -112
  83. package/src/monaco.d.ts +9124 -0
  84. package/src/public/channel/BlogService.ts +50 -0
  85. package/src/public/channel/ChannelView.tsx +76 -0
  86. package/src/public/channel/channelViewStyle.ts +42 -0
  87. package/src/services/email/EmailContentDownloader.ts +33 -0
  88. package/src/site-editor/editor/SelectedElement.tsx +12 -1
  89. package/src/site-editor/editor/WebSitePageEditor.tsx +0 -2
  90. package/src/site-editor/properties/Properties.tsx +2 -1
  91. package/src/site-editor/properties/controls/PropertyEditor.tsx +16 -3
  92. package/src/site-editor/properties/groups/AttributeEditor.tsx +20 -0
  93. package/src/web/page/mails/mini-compose/Insert.tsx +11 -1
  94. package/src/web/page/mails/mini-compose/MiniComposeBox.tsx +5 -0
  95. package/src/web/page/mails/service/ConversationService.tsx +1 -1
@@ -1,112 +1,89 @@
1
- import { UMD } from "@web-atoms/core/dist/core/types";
2
- import { AtomControl } from "@web-atoms/core/dist/web/controls/AtomControl";
3
- import { IAppFile } from "../model/model";
4
- import { BindableProperty } from "@web-atoms/core/dist/core/BindableProperty";
5
- import FetchBuilder from "@web-atoms/core/dist/services/FetchBuilder";
6
-
7
- const monacoPath = UMD.resolvePath("@social-mail/social-mail-client/content/modules/monaco/monaco.html");
8
-
9
- export default class MonacoEditor extends AtomControl {
10
-
11
- public "event-file-changed": CustomEvent<{ file: IAppFile, content: string }>;
12
-
13
- public element: HTMLIFrameElement;
14
-
15
- @BindableProperty
16
- public file: IAppFile;
17
-
18
- private codeModelDisposable: any;
19
-
20
- private monaco: any;
21
- private editor: any;
22
- private container: any;
23
-
24
- constructor(app, e = document.createElement("iframe")) {
25
- super(app, e);
26
- this.element.style.border = "none";
27
- this.runAfterInit(() => this.app.runAsync(() => this.init()));
28
- }
29
-
30
- onPropertyChanged(name: string): void {
31
- super.onPropertyChanged(name);
32
- switch(name) {
33
- case "file":
34
- this.app.runAsync(() => this.loadFile());
35
- break;
36
- }
37
- }
38
-
39
- init() {
40
- const monaco = (async () => {
41
- const srcdoc = await FetchBuilder.get(monacoPath).responseAsText();
42
- return this.monaco = await new Promise<any>((resolve, reject) => {
43
- (this.element as any).parentEditor = {
44
- resolve,
45
- reject,
46
- onresize: () => this.editor?.layout(),
47
- codeEditor: this
48
- };
49
- this.element.srcdoc = srcdoc;
50
- });
51
- })();
52
- const value = Promise.resolve(monaco);
53
- Object.defineProperty(this, "init", { value: () => value});
54
- return this.monaco = monaco;
55
- }
56
-
57
- createEditor() {
58
- const editor = (async () => {
59
- return this.editor = await this.monaco.editor.create(this.container);
60
- })();
61
- const value = Promise.resolve(editor);
62
- Object.defineProperty(this, "createEditor", { value: () => value});
63
- return editor;
64
- }
65
-
66
- async loadFile() {
67
-
68
- await this.init();
69
-
70
- this.codeModelDisposable?.dispose();
71
-
72
- const editor = await this.createEditor();
73
-
74
- const { file, monaco } = this;
75
-
76
- const originalContent = await FetchBuilder.get(file.downloadUrl).responseAsText();
77
-
78
- const name = file.name;
79
- let language = "html";
80
- if (/\.(ts|tsx)$/i.test(name)) {
81
- language = "typescript";
82
- } else if (/\.(js|jsx)$/i.test(name)) {
83
- language = "javascript";
84
- } else if (/\.(json)$/i.test(name)) {
85
- language = "json";
86
- } else if (/\.(css)$/i.test(name)) {
87
- language = "css";
88
- }
89
- const uri = monaco.Uri.parse(`http://a/${file.path}-${file.name}`);
90
- const m = monaco.editor.getModel(uri);
91
-
92
- const model = monaco.editor.createModel(
93
- originalContent,
94
- language,
95
- uri);
96
- editor.setModel(model);
97
-
98
- let id = 0;
99
-
100
- this.codeModelDisposable = this.registerDisposable(model.onDidChangeContent(() => {
101
- if (id) {
102
- clearTimeout(id);
103
- }
104
- id = setTimeout(() => {
105
- const content = model.getValue();
106
- this.element.dispatchEvent(new CustomEvent("fileChanged", {
107
- detail: { file: this.file, content, originalContent }
108
- }));
109
- }, 500);
110
- }));
111
- }
112
- }
1
+ // import { UMD } from "@web-atoms/core/dist/core/types";
2
+ // import { AtomControl } from "@web-atoms/core/dist/web/controls/AtomControl";
3
+ // import { IAppFile } from "../model/model";
4
+ // import { BindableProperty } from "@web-atoms/core/dist/core/BindableProperty";
5
+ // import FetchBuilder from "@web-atoms/core/dist/services/FetchBuilder";
6
+ // import { ICodeSnippetModel } from "./ICodeSnippet";
7
+ // import InjectProperty from "@web-atoms/core/dist/core/InjectProperty";
8
+ // import MonacoService from "./MonacoService";
9
+
10
+ // const monacoPath = UMD.resolvePath("@social-mail/social-mail-client/content/modules/monaco/monaco.html");
11
+
12
+ // export default class MonacoEditor extends AtomControl {
13
+
14
+ // public "event-file-changed": CustomEvent<{ file: IAppFile, content: string }>;
15
+
16
+ // public element: HTMLIFrameElement;
17
+
18
+ // @BindableProperty
19
+ // public code: string;
20
+
21
+ // @BindableProperty
22
+ // public fileUri: string = "https://a/sample.html";
23
+
24
+ // @InjectProperty
25
+ // private monacoService: MonacoService;
26
+
27
+ // private codeModelDisposable: any;
28
+
29
+ // private monaco: typeof monaco;
30
+
31
+ // private editor: monaco.editor.IStandaloneCodeEditor;
32
+
33
+ // constructor(app, e = document.createElement("iframe")) {
34
+ // super(app, e);
35
+ // this.element.style.border = "none";
36
+ // this.runAfterInit(() => this.app.runAsync(() => this.init()));
37
+ // }
38
+
39
+ // onPropertyChanged(name: string): void {
40
+ // super.onPropertyChanged(name);
41
+ // switch(name) {
42
+ // case "code":
43
+ // this.app.runAsync(() => this.loadFile());
44
+ // break;
45
+ // }
46
+ // }
47
+
48
+ // init() {
49
+ // const result = this.monacoService.createEditor(this, this.element)
50
+ // .then(({ monaco, editor }) => {
51
+ // this.monaco = monaco;
52
+ // this.editor = editor;
53
+ // });
54
+ // Object.defineProperty(this, "init", { value: () => result });
55
+ // return result;
56
+ // }
57
+
58
+
59
+ // async loadFile() {
60
+
61
+ // await this.init();
62
+
63
+ // if (!this.code) {
64
+ // return;
65
+ // }
66
+
67
+ // const { monaco, editor, code } = this;
68
+ // const model = this.monacoService.createModel({ code, url: this.fileUri });
69
+ // editor.setModel(model);
70
+
71
+ // this.codeModelDisposable?.dispose();
72
+
73
+ // let id = 0;
74
+
75
+ // this.codeModelDisposable = this.registerDisposable(model.onDidChangeContent(() => {
76
+ // if (id) {
77
+ // clearTimeout(id);
78
+ // }
79
+ // id = setTimeout(() => {
80
+ // const content = model.getValue();
81
+ // this.code = content;
82
+ // this.element.dispatchEvent(new CustomEvent("codeChanged", {
83
+ // detail: { code: content, originalContent: code }
84
+ // }));
85
+ // }, 500);
86
+ // }));
87
+
88
+ // }
89
+ // }