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

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 (44) hide show
  1. package/content/modules/monaco/monaco.html +57 -5
  2. package/dist/admin/AdminAppIndex.pack.js +253 -142
  3. package/dist/admin/AdminAppIndex.pack.js.map +1 -1
  4. package/dist/admin/AdminAppIndex.pack.min.js +3 -3
  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/site-editor/editor/WebSitePageEditor.d.ts.map +1 -1
  27. package/dist/site-editor/editor/WebSitePageEditor.js.map +1 -1
  28. package/dist/tsconfig.tsbuildinfo +1 -1
  29. package/dist/web/AppIndex.pack.js +337 -226
  30. package/dist/web/AppIndex.pack.js.map +1 -1
  31. package/dist/web/AppIndex.pack.min.js +4 -4
  32. package/dist/web/AppIndex.pack.min.js.map +1 -1
  33. package/dist/web/page/mails/mini-compose/Insert.d.ts.map +1 -1
  34. package/dist/web/page/mails/mini-compose/Insert.js +16 -3
  35. package/dist/web/page/mails/mini-compose/Insert.js.map +1 -1
  36. package/package.json +1 -1
  37. package/src/code-editor/CodeEditorPage.tsx +14 -8
  38. package/src/code-editor/CodeSnippetPage.tsx +78 -0
  39. package/src/code-editor/ICodeSnippet.ts +5 -0
  40. package/src/code-editor/MonacoService.ts +112 -0
  41. package/src/code-editor/MonaoEditor.tsx +89 -112
  42. package/src/monaco.d.ts +9124 -0
  43. package/src/site-editor/editor/WebSitePageEditor.tsx +0 -2
  44. package/src/web/page/mails/mini-compose/Insert.tsx +11 -1
@@ -23,9 +23,54 @@
23
23
 
24
24
  require(['vs/editor/editor.main'], function() {
25
25
 
26
+ let editor;
27
+
26
28
  var parentEditor = frameElement.parentEditor;
29
+ const container = document.getElementById("container");
30
+ parentEditor.codeEditor.container = container;
31
+ parentEditor.codeEditor.colorize = (code) => {
32
+ return new Promise((resolve, reject) => {
33
+ const div = document.createElement("div");
34
+
35
+ const moveOut = (e) => {
36
+ const s = e.style;
37
+ s.position = "absolute";
38
+ s.left = "-10000px";
39
+ s.top = "-10000px";
40
+ s.maxWidth = "1000px";
41
+ s.overflow = "hidden";
42
+ };
43
+
44
+ moveOut(div);
45
+
46
+ const body = document.body;
47
+ const pre = document.createElement("pre");
48
+ pre.innerHTML = code;
49
+ div.appendChild(pre);
50
+ body.appendChild(div);
51
+ setTimeout(() => {
52
+
53
+
54
+ const mapStyle = (e) => {
55
+ const cs = window.getComputedStyle(e);
56
+ e.style.fontWeight = cs.fontWeight;
57
+ e.style.color = cs.color;
58
+ e.style.background = cs.background;
59
+ e.style.backgroundColor = cs.backgroundColor;
60
+ let start = e.firstElementChild;
61
+ while(start) {
62
+ mapStyle(start);
63
+ start = start.nextElementSibling;
64
+ }
65
+ };
66
+
67
+ mapStyle(pre);
27
68
 
28
- parentEditor.codeEditor.container = document.getElementById("container");
69
+ resolve(pre.outerHTML);
70
+
71
+ }, 1);
72
+ });
73
+ };
29
74
  window.open = function() {
30
75
  var a = {
31
76
  opener: {},
@@ -38,12 +83,19 @@
38
83
  });
39
84
  return a;
40
85
  };
41
- parentEditor.resolve(monaco);
42
86
 
43
- window.onresize = function() {
44
- parentEditor.onresize();
45
- };
87
+ try {
88
+ editor = monaco.editor.create(container);
89
+ parentEditor.resolve({
90
+ editor,
91
+ monaco
92
+ });
93
+
94
+ window.onresize = () => editor.layout();
46
95
 
96
+ } catch (erorr) {
97
+ parentEditor.reject(error);
98
+ }
47
99
  });
48
100
  </script>
49
101
  </body>