@windward/core 0.2.1 → 0.2.3

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 (142) hide show
  1. package/.idea/codeStyles/Project.xml +58 -0
  2. package/.idea/codeStyles/codeStyleConfig.xml +5 -0
  3. package/.idea/inspectionProfiles/Project_Default.xml +6 -0
  4. package/.idea/modules.xml +8 -0
  5. package/.idea/php-docker-settings.xml +24 -0
  6. package/.idea/php.xml +19 -0
  7. package/.idea/vcs.xml +6 -0
  8. package/.idea/watcherTasks.xml +4 -0
  9. package/.idea/windward-ui-plugin-core.iml +8 -0
  10. package/components/Content/Blocks/Accordion.vue +13 -4
  11. package/components/Content/Blocks/Email.vue +61 -23
  12. package/components/Content/Blocks/Feedback.vue +2 -1
  13. package/components/Content/Blocks/Image.vue +7 -0
  14. package/components/Content/Blocks/OpenResponseCollate.vue +1 -1
  15. package/components/Content/Blocks/UserUpload.vue +2 -2
  16. package/components/Settings/AccordionSettings.vue +36 -11
  17. package/components/Settings/EmailSettings.vue +61 -19
  18. package/components/Settings/MathSettings.vue +6 -4
  19. package/components/Settings/ScenarioChoiceSettings.vue +54 -47
  20. package/components/Settings/TabSettings.vue +3 -1
  21. package/components/Settings/TextEditorSettings.vue +72 -30
  22. package/components/Settings/UserUploadSettings.vue +3 -3
  23. package/components/Settings/VideoSettings.vue +2 -2
  24. package/components/utils/MathExpressionEditor.vue +4 -5
  25. package/components/utils/TinyMCEWrapper.vue +64 -11
  26. package/components/utils/glossary/CourseGlossary.vue +45 -32
  27. package/config/tinymce.config.ts +2 -1
  28. package/coverage/clover.xml +223 -0
  29. package/coverage/coverage-final.json +16 -0
  30. package/coverage/lcov-report/base.css +224 -0
  31. package/coverage/lcov-report/block-navigation.js +87 -0
  32. package/coverage/lcov-report/components/Content/Blocks/Accordion.vue.html +430 -0
  33. package/coverage/lcov-report/components/Content/Blocks/Image.vue.html +394 -0
  34. package/coverage/lcov-report/components/Content/Blocks/Math.vue.html +262 -0
  35. package/coverage/lcov-report/components/Content/Blocks/RichText.vue.html +295 -0
  36. package/coverage/lcov-report/components/Content/Blocks/Tab.vue.html +415 -0
  37. package/coverage/lcov-report/components/Content/Blocks/Table.vue.html +667 -0
  38. package/coverage/lcov-report/components/Content/Blocks/Video.vue.html +2275 -0
  39. package/coverage/lcov-report/components/Content/Blocks/index.html +206 -0
  40. package/coverage/lcov-report/components/utils/ContentViewer.vue.html +199 -0
  41. package/coverage/lcov-report/components/utils/MathExpressionEditor.vue.html +919 -0
  42. package/coverage/lcov-report/components/utils/MathLiveWrapper.vue.html +343 -0
  43. package/coverage/lcov-report/components/utils/TinyMCEWrapper.vue.html +271 -0
  44. package/coverage/lcov-report/components/utils/index.html +161 -0
  45. package/coverage/lcov-report/config/index.html +116 -0
  46. package/coverage/lcov-report/config/tinymce.config.js.html +493 -0
  47. package/coverage/lcov-report/favicon.png +0 -0
  48. package/coverage/lcov-report/helpers/MathHelper.ts.html +793 -0
  49. package/coverage/lcov-report/helpers/index.html +116 -0
  50. package/coverage/lcov-report/helpers/tinymce/index.html +116 -0
  51. package/coverage/lcov-report/helpers/tinymce/plugin.ts.html +334 -0
  52. package/coverage/lcov-report/index.html +191 -0
  53. package/coverage/lcov-report/prettify.css +1 -0
  54. package/coverage/lcov-report/prettify.js +2 -0
  55. package/coverage/lcov-report/sort-arrow-sprite.png +0 -0
  56. package/coverage/lcov-report/sorter.js +196 -0
  57. package/coverage/lcov-report/test/index.html +116 -0
  58. package/coverage/lcov-report/test/mocks.js.html +457 -0
  59. package/coverage/lcov.info +403 -0
  60. package/helpers/tinymce/plugin.ts +18 -4
  61. package/i18n/en-US/components/content/blocks/email.ts +2 -0
  62. package/i18n/en-US/components/settings/accordion.ts +2 -1
  63. package/i18n/en-US/components/settings/email.ts +1 -0
  64. package/i18n/en-US/components/settings/text_editor.ts +4 -1
  65. package/i18n/es-ES/components/content/blocks/email.ts +2 -0
  66. package/i18n/es-ES/components/settings/accordion.ts +2 -1
  67. package/i18n/es-ES/components/settings/email.ts +1 -0
  68. package/i18n/es-ES/components/settings/text_editor.ts +4 -1
  69. package/i18n/sv-SE/components/content/blocks/email.ts +2 -0
  70. package/i18n/sv-SE/components/settings/accordion.ts +1 -0
  71. package/i18n/sv-SE/components/settings/email.ts +1 -0
  72. package/i18n/sv-SE/components/settings/text_editor.ts +4 -1
  73. package/lib/helpers/GlossaryHelper.d.ts +9 -0
  74. package/lib/helpers/GlossaryHelper.js +118 -0
  75. package/lib/helpers/GlossaryTerm.d.ts +10 -0
  76. package/lib/helpers/GlossaryTerm.js +22 -0
  77. package/lib/helpers/MathHelper.d.ts +99 -0
  78. package/lib/helpers/MathHelper.js +194 -0
  79. package/lib/helpers/tinymce/plugin.d.ts +2 -0
  80. package/lib/helpers/tinymce/plugin.js +86 -0
  81. package/lib/i18n/en-US/components/content/blocks/image.d.ts +6 -0
  82. package/lib/i18n/en-US/components/content/blocks/image.js +7 -0
  83. package/lib/i18n/en-US/components/content/blocks/index.d.ts +75 -0
  84. package/lib/i18n/en-US/components/content/blocks/index.js +14 -0
  85. package/lib/i18n/en-US/components/content/blocks/tab.d.ts +5 -0
  86. package/lib/i18n/en-US/components/content/blocks/tab.js +6 -0
  87. package/lib/i18n/en-US/components/content/blocks/table.d.ts +5 -0
  88. package/lib/i18n/en-US/components/content/blocks/table.js +6 -0
  89. package/lib/i18n/en-US/components/content/blocks/user_upload.d.ts +13 -0
  90. package/lib/i18n/en-US/components/content/blocks/user_upload.js +14 -0
  91. package/lib/i18n/en-US/components/content/blocks/video.d.ts +48 -0
  92. package/lib/i18n/en-US/components/content/blocks/video.js +49 -0
  93. package/lib/i18n/en-US/components/content/index.d.ts +77 -0
  94. package/lib/i18n/en-US/components/content/index.js +6 -0
  95. package/lib/i18n/en-US/components/index.d.ts +140 -0
  96. package/lib/i18n/en-US/components/index.js +12 -0
  97. package/lib/i18n/en-US/components/navigation/image.d.ts +5 -0
  98. package/lib/i18n/en-US/components/navigation/image.js +6 -0
  99. package/lib/i18n/en-US/components/navigation/index.d.ts +10 -0
  100. package/lib/i18n/en-US/components/navigation/index.js +8 -0
  101. package/lib/i18n/en-US/components/navigation/user_upload.d.ts +4 -0
  102. package/lib/i18n/en-US/components/navigation/user_upload.js +5 -0
  103. package/lib/i18n/en-US/components/settings/clickable_icon.d.ts +6 -0
  104. package/lib/i18n/en-US/components/settings/clickable_icon.js +7 -0
  105. package/lib/i18n/en-US/components/settings/image.d.ts +2 -0
  106. package/lib/i18n/en-US/components/settings/image.js +3 -0
  107. package/lib/i18n/en-US/components/settings/index.d.ts +39 -0
  108. package/lib/i18n/en-US/components/settings/index.js +14 -0
  109. package/lib/i18n/en-US/components/settings/text_editor.d.ts +8 -0
  110. package/lib/i18n/en-US/components/settings/text_editor.js +9 -0
  111. package/lib/i18n/en-US/components/settings/user_upload.d.ts +12 -0
  112. package/lib/i18n/en-US/components/settings/user_upload.js +13 -0
  113. package/lib/i18n/en-US/components/settings/video.d.ts +13 -0
  114. package/lib/i18n/en-US/components/settings/video.js +14 -0
  115. package/lib/i18n/en-US/components/utils/index.d.ts +15 -0
  116. package/lib/i18n/en-US/components/utils/index.js +6 -0
  117. package/lib/i18n/en-US/components/utils/tiny_mce_wrapper.d.ts +13 -0
  118. package/lib/i18n/en-US/components/utils/tiny_mce_wrapper.js +14 -0
  119. package/lib/i18n/en-US/index.d.ts +197 -0
  120. package/lib/i18n/en-US/index.js +16 -0
  121. package/lib/i18n/en-US/modules/index.d.ts +2 -0
  122. package/lib/i18n/en-US/modules/index.js +6 -0
  123. package/lib/i18n/en-US/pages/glossary.d.ts +8 -0
  124. package/lib/i18n/en-US/pages/glossary.js +9 -0
  125. package/lib/i18n/en-US/pages/index.d.ts +13 -0
  126. package/lib/i18n/en-US/pages/index.js +8 -0
  127. package/lib/i18n/en-US/pages/user_upload.d.ts +4 -0
  128. package/lib/i18n/en-US/pages/user_upload.js +5 -0
  129. package/lib/i18n/en-US/shared/content_blocks.d.ts +20 -0
  130. package/lib/i18n/en-US/shared/content_blocks.js +21 -0
  131. package/lib/i18n/en-US/shared/index.d.ts +39 -0
  132. package/lib/i18n/en-US/shared/index.js +10 -0
  133. package/lib/i18n/en-US/shared/menu.d.ts +4 -0
  134. package/lib/i18n/en-US/shared/menu.js +5 -0
  135. package/lib/i18n/en-US/shared/settings.d.ts +15 -0
  136. package/lib/i18n/en-US/shared/settings.js +16 -0
  137. package/lib/i18n/en-US.d.ts +197 -0
  138. package/lib/i18n/en-US.js +15 -0
  139. package/lib/models/UserFileAsset.d.ts +5 -0
  140. package/lib/models/UserFileAsset.js +37 -0
  141. package/package.json +1 -1
  142. package/test/Components/Settings/EmailSettings.spec.js +18 -2
@@ -0,0 +1,22 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ var GlossaryTerm = /** @class */ (function () {
4
+ function GlossaryTerm(params) {
5
+ this.alternate_forms = null;
6
+ this.related_term = null;
7
+ this.required = ['term', 'definition'];
8
+ this.required.forEach(function (field) {
9
+ if (!params[field]) {
10
+ throw new Error('Glossary term ' + field + ' is required');
11
+ }
12
+ });
13
+ this.term = params.term;
14
+ this.definition = params.definition;
15
+ this.alternate_forms = params.alternate_forms || null;
16
+ this.related_term = params.related_term || null;
17
+ }
18
+ GlossaryTerm.toString = function () {
19
+ };
20
+ return GlossaryTerm;
21
+ }());
22
+ exports.default = GlossaryTerm;
@@ -0,0 +1,99 @@
1
+ import * as mathLiveObject from 'mathlive';
2
+ export default class MathHelper {
3
+ /**
4
+ * expose mathlive object
5
+ */
6
+ static Mathlive: typeof mathLiveObject;
7
+ /**
8
+ * containsMathML
9
+ * @param content
10
+ * checks is string contains mathml
11
+ * @return boolean
12
+ *
13
+ */
14
+ static containsMathML(content: string): boolean;
15
+ /**
16
+ * containsLatex
17
+ * @param content
18
+ * checks is string contains latex
19
+ * @return boolean
20
+ *
21
+ */
22
+ static containsLatex(content: string): boolean;
23
+ /**
24
+ * containSREnhancedLatex
25
+ * @param content
26
+ * checks is string contains latex
27
+ * @return boolean
28
+ *
29
+ */
30
+ static containSREnhancedLatex(content: string): boolean;
31
+ /**
32
+ * convertMathMLToLatex
33
+ * @param content
34
+ * attempts to find mml in content string and replace it with latex equivalent
35
+ * @return string
36
+ */
37
+ static convertContentMathMLtoLatex(content: string): string;
38
+ /**
39
+ * wrapMathContentForTinyMCE
40
+ * @param content
41
+ * wrap content in span with math class for tinymce
42
+ * @return string
43
+ */
44
+ static wrapMathContentForTinyMCE(content: string): string;
45
+ /**
46
+ * check Math Content Wrapped For TMCE
47
+ * @param content
48
+ * checks all content
49
+ * @return string
50
+ */
51
+ static checkMathContentWrappedForTMCE(content: string): boolean;
52
+ /**
53
+ * convertContentLatexToHtml
54
+ * @param content
55
+ * attempts to find latex in content string and replace it with latex equivalent
56
+ * @return string
57
+ *
58
+ */
59
+ static convertContentLatexToHtml(content: string): string;
60
+ /**
61
+ * convertContentSREnhancedLatexToHtml
62
+ * @param content
63
+ * attempts to find latex in content string and place custom SR text on renderer math div
64
+ * @return string
65
+ *
66
+ */
67
+ static convertContentSREnhancedLatexToHtml(content: string): string;
68
+ /**
69
+ * convertMathContentToHtml
70
+ * @param content
71
+ * attempts to find any math format in content string and convert it to HTML
72
+ * @return string
73
+ *
74
+ */
75
+ static convertMathContentToHtml(content: string): string;
76
+ /**
77
+ * convertMathMLToLatex
78
+ * @param content
79
+ * converts mml to latex
80
+ *
81
+ */
82
+ static convertMathMLToLatex(content: string): string;
83
+ /**
84
+ * parseSREnhancedLatexString
85
+ * @param content
86
+ * parse SR enhanced latex string and return Object
87
+ * @return Object
88
+ *
89
+ */
90
+ static parseSREnhancedLatexString(content: string): object;
91
+ /**
92
+ * parseSRLatex
93
+ * @param content
94
+ * parse latex expression from string
95
+ * @return any
96
+ *
97
+ */
98
+ static parseLatexString(content: string): string;
99
+ }
@@ -0,0 +1,194 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ var mathLiveObject = require("mathlive");
4
+ var _ = require("lodash");
5
+ var Mathml2latex = require('mathml-to-latex');
6
+ var MathHelper = /** @class */ (function () {
7
+ function MathHelper() {
8
+ }
9
+ /**
10
+ * containsMathML
11
+ * @param content
12
+ * checks is string contains mathml
13
+ * @return boolean
14
+ *
15
+ */
16
+ MathHelper.containsMathML = function (content) {
17
+ var regex = /\<math.*?>.*?<\/math>/s;
18
+ return regex.exec(content) !== null;
19
+ };
20
+ /**
21
+ * containsLatex
22
+ * @param content
23
+ * checks is string contains latex
24
+ * @return boolean
25
+ *
26
+ */
27
+ MathHelper.containsLatex = function (content) {
28
+ var regex = /\$\$.*?\$\$/g;
29
+ return regex.exec(content) !== null;
30
+ };
31
+ /**
32
+ * containSREnhancedLatex
33
+ * @param content
34
+ * checks is string contains latex
35
+ * @return boolean
36
+ *
37
+ */
38
+ MathHelper.containSREnhancedLatex = function (content) {
39
+ var regex = /\*\*.*?\*\*/g;
40
+ return regex.exec(content) !== null;
41
+ };
42
+ /**
43
+ * convertMathMLToLatex
44
+ * @param content
45
+ * attempts to find mml in content string and replace it with latex equivalent
46
+ * @return string
47
+ */
48
+ MathHelper.convertContentMathMLtoLatex = function (content) {
49
+ var regex = /\<math.*?>.*?<\/math>/g;
50
+ var matches = content.match(regex);
51
+ if (matches) {
52
+ matches.forEach(function (match) {
53
+ content = content.replace(match, "$$$" + Mathml2latex.convert(match) + '$$$');
54
+ });
55
+ }
56
+ return content;
57
+ };
58
+ /**
59
+ * wrapMathContentForTinyMCE
60
+ * @param content
61
+ * wrap content in span with math class for tinymce
62
+ * @return string
63
+ */
64
+ MathHelper.wrapMathContentForTinyMCE = function (content) {
65
+ var regex = /(\*\*|\$\$)(.*?)\1/g;
66
+ var matches = content.match(regex);
67
+ if (matches) {
68
+ matches.forEach(function (match) {
69
+ var temp = match.replace(/\$\$/g, '');
70
+ if (match.match(/\$\$.*?\$\$/g) !== null) {
71
+ content = content.replace(match, "<span class ='windward-math-content'>$$$" +
72
+ temp +
73
+ '$$$</span>');
74
+ }
75
+ if (match.match(/\*\*(.*?)\*\*/g) !== null) {
76
+ content = content.replace(match, "<span class ='windward-math-content'>" +
77
+ match +
78
+ '</span>');
79
+ }
80
+ });
81
+ }
82
+ return content;
83
+ };
84
+ /**
85
+ * check Math Content Wrapped For TMCE
86
+ * @param content
87
+ * checks all content
88
+ * @return string
89
+ */
90
+ MathHelper.checkMathContentWrappedForTMCE = function (content) {
91
+ var regex = /\<span class ='windward-math-content'>(\*\*|\$\$)(.*?)\1<\/span>/g;
92
+ return regex.exec(content) !== null;
93
+ };
94
+ /**
95
+ * convertContentLatexToHtml
96
+ * @param content
97
+ * attempts to find latex in content string and replace it with latex equivalent
98
+ * @return string
99
+ *
100
+ */
101
+ MathHelper.convertContentLatexToHtml = function (content) {
102
+ var regex = /\$\$.*?\$\$/g;
103
+ var matches = content.match(regex);
104
+ if (matches) {
105
+ matches.forEach(function (match) {
106
+ content = content.replace(match, '<span tabindex="0" aria-label="' +
107
+ // @ts-ignore
108
+ mathLiveObject.convertLatexToSpeakableText(match) +
109
+ '"> <span tabindex="-1" >' +
110
+ mathLiveObject.convertLatexToMarkup(_.unescape(match)) +
111
+ '</span></span>');
112
+ });
113
+ }
114
+ return content;
115
+ };
116
+ /**
117
+ * convertContentSREnhancedLatexToHtml
118
+ * @param content
119
+ * attempts to find latex in content string and place custom SR text on renderer math div
120
+ * @return string
121
+ *
122
+ */
123
+ MathHelper.convertContentSREnhancedLatexToHtml = function (content) {
124
+ var regex = /\*\*.*?\*\*/g;
125
+ var matches = content.match(regex);
126
+ if (matches) {
127
+ matches.forEach(function (match) {
128
+ var mathObject = JSON.parse(match.replace(/\*\*/g, ''));
129
+ content = content.replace(match, '<span tabindex="0" aria-label="' +
130
+ mathObject.sr_text +
131
+ '"> <span tabindex="-1" >' +
132
+ mathLiveObject.convertLatexToMarkup('$$' + _.unescape(mathObject.latex) + '$$') +
133
+ '</span></span>');
134
+ });
135
+ }
136
+ return content;
137
+ };
138
+ /**
139
+ * convertMathContentToHtml
140
+ * @param content
141
+ * attempts to find any math format in content string and convert it to HTML
142
+ * @return string
143
+ *
144
+ */
145
+ MathHelper.convertMathContentToHtml = function (content) {
146
+ return MathHelper.convertContentSREnhancedLatexToHtml(MathHelper.convertContentLatexToHtml(MathHelper.convertContentMathMLtoLatex(content)));
147
+ };
148
+ /**
149
+ * convertMathMLToLatex
150
+ * @param content
151
+ * converts mml to latex
152
+ *
153
+ */
154
+ MathHelper.convertMathMLToLatex = function (content) {
155
+ return Mathml2latex.convert(content);
156
+ };
157
+ /**
158
+ * parseSREnhancedLatexString
159
+ * @param content
160
+ * parse SR enhanced latex string and return Object
161
+ * @return Object
162
+ *
163
+ */
164
+ MathHelper.parseSREnhancedLatexString = function (content) {
165
+ var regex = /\*\*.*?\*\*/g;
166
+ var matches = content.match(regex);
167
+ if (matches) {
168
+ var mathobject = JSON.parse(matches[0].replace(/\*\*/g, ''));
169
+ return mathobject;
170
+ }
171
+ return {};
172
+ };
173
+ /**
174
+ * parseSRLatex
175
+ * @param content
176
+ * parse latex expression from string
177
+ * @return any
178
+ *
179
+ */
180
+ MathHelper.parseLatexString = function (content) {
181
+ var regex = /\$\$.*?\$\$/g;
182
+ var matches = content.match(regex);
183
+ if (matches) {
184
+ return matches[0].replace(/\$\$/g, '');
185
+ }
186
+ return '';
187
+ };
188
+ /**
189
+ * expose mathlive object
190
+ */
191
+ MathHelper.Mathlive = mathLiveObject;
192
+ return MathHelper;
193
+ }());
194
+ exports.default = MathHelper;
@@ -0,0 +1,2 @@
1
+ declare const MathEditorPlugin: (editor: any) => void;
2
+ export { MathEditorPlugin };
@@ -0,0 +1,86 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.MathEditorPlugin = void 0;
4
+ var MathEditorPlugin = function (editor) {
5
+ var formula;
6
+ // ----- Events ----- //
7
+ editor.ui.registry.addIcon('insertMath', '<svg x="0px" y="0px"width="20px" height="20px" viewBox="0 0 445.878 445.878" style="enable-background:new 0 0 445.878 445.878;">' +
8
+ '<path d="M426.024,86.447H209.705l-84.911,298.911c-2.568,7.967-9.854,13.482-18.22,13.771c-0.236,0-0.464,0.006-0.688,0.006 c-8.092,0-15.41-4.924-18.436-12.478l-34.714-86.782H19.851C8.884,299.876,0,290.986,0,280.022 c0-10.965,8.893-19.854,19.851-19.854H66.18c8.109,0,15.421,4.941,18.436,12.483l19.237,48.09l72.472-260.218 c2.639-8.213,10.279-13.781,18.903-13.781h230.798c10.97,0,19.854,8.89,19.854,19.851S436.988,86.447,426.024,86.447z M436.723,353.227l-78.259-87.904l74.576-82.783c1.318-1.454,1.638-3.547,0.857-5.341c-0.804-1.791-2.577-2.946-4.54-2.946h-47.18 c-1.442,0-2.802,0.629-3.759,1.72l-50.059,58.047l-49.674-58.029c-0.939-1.103-2.317-1.738-3.771-1.738h-49.334 c-1.956,0-3.729,1.149-4.521,2.929c-0.81,1.785 0.479,3.875,0.824,5.332l73.743,82.81l-77.641,87.923 c-1.297,1.465-1.605,3.552 0.813,5.325c0.813,1.785,2.586,2.92,4.528,2.92h48.9c1.472,0,2.867-0.65,3.807-1.785l51.819-62.181 l53.05,62.229c0.951,1.11,2.328,1.743,3.782,1.743h49.97c1.962,0,3.735-1.141,4.527-2.926 C438.354,356.779,438.035,354.692,436.723,353.227z"/>' +
9
+ '</svg>');
10
+ editor.addCommand('equation-window', function (data) {
11
+ return editor.windowManager.openUrl({
12
+ url: '/plugins/tinymce/math',
13
+ title: 'Equation editor',
14
+ width: 800,
15
+ height: 600,
16
+ buttons: [
17
+ {
18
+ type: 'cancel',
19
+ text: 'cancel',
20
+ },
21
+ {
22
+ type: 'custom',
23
+ text: 'submit',
24
+ primary: true,
25
+ },
26
+ ],
27
+ onAction: function () {
28
+ if (data.currentTarget) {
29
+ editor.selection.select(data.currentTarget);
30
+ }
31
+ editor.selection.setContent(" <span class='windward-math-content'>" +
32
+ formula +
33
+ "</span>");
34
+ editor.windowManager.close();
35
+ setOnClickEquationContent(editor);
36
+ },
37
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
38
+ onMessage: function (instance, message) {
39
+ switch (message.mceAction) {
40
+ case 'equation-insert':
41
+ formula = message.content;
42
+ break;
43
+ case 'math-plugin-mounted':
44
+ window.parent.postMessage({ latex: data.latex }, '*');
45
+ break;
46
+ }
47
+ },
48
+ });
49
+ });
50
+ editor.ui.registry.addButton('mathButton', {
51
+ icon: 'insertMath',
52
+ onAction: function () {
53
+ editor.execCommand('equation-window', true);
54
+ },
55
+ });
56
+ editor.ui.registry.addMenuItem('math', {
57
+ text: 'Math',
58
+ icon: 'insertMath',
59
+ onAction: function () {
60
+ editor.execCommand('equation-window', true);
61
+ },
62
+ });
63
+ editor.on('init', function () {
64
+ setOnClickEquationContent(editor);
65
+ });
66
+ function setOnClickEquationContent(editor) {
67
+ var tinymceDoc = editor.getDoc();
68
+ var mqSpan = tinymceDoc.getElementsByClassName('windward-math-content');
69
+ // Add onclick listener to all equation content
70
+ for (var _i = 0, mqSpan_1 = mqSpan; _i < mqSpan_1.length; _i++) {
71
+ var equationContent = mqSpan_1[_i];
72
+ equationContent.contentEditable = 'true';
73
+ if (equationContent.onclick) {
74
+ continue;
75
+ }
76
+ equationContent.onclick = function (event) {
77
+ event.stopPropagation();
78
+ editor.execCommand('equation-window', {
79
+ latex: event.target.innerText,
80
+ currentTarget: event.target,
81
+ });
82
+ };
83
+ }
84
+ }
85
+ };
86
+ exports.MathEditorPlugin = MathEditorPlugin;
@@ -0,0 +1,6 @@
1
+ declare const _default: {
2
+ title: string;
3
+ description: string;
4
+ no_image_url: string;
5
+ };
6
+ export default _default;
@@ -0,0 +1,7 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.default = {
4
+ title: 'Pick an image',
5
+ description: 'Pick an image to display',
6
+ no_image_url: 'No Image Selected',
7
+ };
@@ -0,0 +1,75 @@
1
+ declare const _default: {
2
+ user_upload: {
3
+ user_uploads: string;
4
+ dialog_view: string;
5
+ instructions: string;
6
+ instructions_none: string;
7
+ instructions_title: string;
8
+ must_save: string;
9
+ uploaded: string;
10
+ name: string;
11
+ size: string;
12
+ download: string;
13
+ };
14
+ image: {
15
+ title: string;
16
+ description: string;
17
+ no_image_url: string;
18
+ };
19
+ video: {
20
+ tabs: {
21
+ video: string;
22
+ poster: string;
23
+ preroll: string;
24
+ postroll: string;
25
+ };
26
+ forms: {
27
+ unsaved: string;
28
+ cancel: string;
29
+ confirm: string;
30
+ };
31
+ video: {
32
+ title: string;
33
+ configure_blurb: string;
34
+ not_configured_title: string;
35
+ edit_prompt: string;
36
+ autoplay: string;
37
+ controls: string;
38
+ loop: string;
39
+ muted: string;
40
+ disablepictureinpicture: string;
41
+ poster: string;
42
+ playback_rates: string;
43
+ rewind: string;
44
+ playsinline: string;
45
+ captionsmenu: string;
46
+ playlistmenu: string;
47
+ playlistautoadvance: string;
48
+ };
49
+ caption: {
50
+ title: string;
51
+ configure_blurb: string;
52
+ };
53
+ poster: {
54
+ title: string;
55
+ configure_blurb: string;
56
+ };
57
+ preroll: {
58
+ title: string;
59
+ configure_blurb: string;
60
+ };
61
+ postroll: {
62
+ title: string;
63
+ configure_blurb: string;
64
+ };
65
+ };
66
+ table: {
67
+ column: string;
68
+ row: string;
69
+ };
70
+ tab: {
71
+ add_tab: string;
72
+ delete_tab: string;
73
+ };
74
+ };
75
+ export default _default;
@@ -0,0 +1,14 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ var user_upload_1 = require("./user_upload");
4
+ var image_1 = require("./image");
5
+ var video_1 = require("./video");
6
+ var table_1 = require("./table");
7
+ var tab_1 = require("./tab");
8
+ exports.default = {
9
+ user_upload: user_upload_1.default,
10
+ image: image_1.default,
11
+ video: video_1.default,
12
+ table: table_1.default,
13
+ tab: tab_1.default,
14
+ };
@@ -0,0 +1,5 @@
1
+ declare const _default: {
2
+ add_tab: string;
3
+ delete_tab: string;
4
+ };
5
+ export default _default;
@@ -0,0 +1,6 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.default = {
4
+ add_tab: 'Add Tab',
5
+ delete_tab: 'Delete Tab'
6
+ };
@@ -0,0 +1,5 @@
1
+ declare const _default: {
2
+ column: string;
3
+ row: string;
4
+ };
5
+ export default _default;
@@ -0,0 +1,6 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.default = {
4
+ column: 'column',
5
+ row: 'cell',
6
+ };
@@ -0,0 +1,13 @@
1
+ declare const _default: {
2
+ user_uploads: string;
3
+ dialog_view: string;
4
+ instructions: string;
5
+ instructions_none: string;
6
+ instructions_title: string;
7
+ must_save: string;
8
+ uploaded: string;
9
+ name: string;
10
+ size: string;
11
+ download: string;
12
+ };
13
+ export default _default;
@@ -0,0 +1,14 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.default = {
4
+ user_uploads: 'User Uploads',
5
+ dialog_view: 'View Uploads',
6
+ instructions: 'Instructions:',
7
+ instructions_none: 'None',
8
+ instructions_title: 'Student instructions:',
9
+ must_save: 'You must save this block before users can make uploads',
10
+ uploaded: 'Uploaded',
11
+ name: 'Name',
12
+ size: 'Size',
13
+ download: 'Download',
14
+ };
@@ -0,0 +1,48 @@
1
+ declare const _default: {
2
+ tabs: {
3
+ video: string;
4
+ poster: string;
5
+ preroll: string;
6
+ postroll: string;
7
+ };
8
+ forms: {
9
+ unsaved: string;
10
+ cancel: string;
11
+ confirm: string;
12
+ };
13
+ video: {
14
+ title: string;
15
+ configure_blurb: string;
16
+ not_configured_title: string;
17
+ edit_prompt: string;
18
+ autoplay: string;
19
+ controls: string;
20
+ loop: string;
21
+ muted: string;
22
+ disablepictureinpicture: string;
23
+ poster: string;
24
+ playback_rates: string;
25
+ rewind: string;
26
+ playsinline: string;
27
+ captionsmenu: string;
28
+ playlistmenu: string;
29
+ playlistautoadvance: string;
30
+ };
31
+ caption: {
32
+ title: string;
33
+ configure_blurb: string;
34
+ };
35
+ poster: {
36
+ title: string;
37
+ configure_blurb: string;
38
+ };
39
+ preroll: {
40
+ title: string;
41
+ configure_blurb: string;
42
+ };
43
+ postroll: {
44
+ title: string;
45
+ configure_blurb: string;
46
+ };
47
+ };
48
+ export default _default;
@@ -0,0 +1,49 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.default = {
4
+ tabs: {
5
+ video: 'Video',
6
+ poster: 'Poster',
7
+ preroll: 'Preroll',
8
+ postroll: 'Postroll',
9
+ },
10
+ forms: {
11
+ unsaved: 'You have unsaved changes. Would you like to save them?',
12
+ cancel: 'Cancel',
13
+ confirm: 'Confirm',
14
+ },
15
+ video: {
16
+ title: 'Video File',
17
+ configure_blurb: 'Upload a video file (.mp4 or .webm), pick one from the file manager, or add via the public URL',
18
+ not_configured_title: 'Video not configured',
19
+ edit_prompt: 'Edit this block to get started',
20
+ autoplay: 'Autoplay on load',
21
+ controls: 'Show Controls',
22
+ loop: 'Loop video',
23
+ muted: 'Start muted',
24
+ disablepictureinpicture: 'Disable picture-in-picture button',
25
+ poster: 'Video poster',
26
+ playback_rates: 'Playback Rates',
27
+ rewind: 'Allow 10 Second Rewind',
28
+ playsinline: 'Disable fullscreen and force inline viewing',
29
+ captionsmenu: 'Show the interactive captions menu',
30
+ playlistmenu: 'Show playlist menu (Requires more than 1 video selected to show)',
31
+ playlistautoadvance: 'Auto-advance the playlist on media end',
32
+ },
33
+ caption: {
34
+ title: 'Captions File',
35
+ configure_blurb: 'Upload a captions file (.vtt or .xml), pick one from the file manager, or add via the public URL',
36
+ },
37
+ poster: {
38
+ title: 'Poster Image File',
39
+ configure_blurb: 'Upload a poster file (.png or .jpg), pick one from the file manager, or add via the public URL. This is the image that appears before the video is played.',
40
+ },
41
+ preroll: {
42
+ title: 'Preroll Video File',
43
+ configure_blurb: 'Upload a preroll video file (.mp4 or .webm), pick one from the file manager, or add via the public URL',
44
+ },
45
+ postroll: {
46
+ title: 'Postroll Video File',
47
+ configure_blurb: 'Upload a postroll video file (.mp4 or .webm), pick one from the file manager, or add via the public URL',
48
+ },
49
+ };