@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
@@ -18,20 +18,14 @@
18
18
  :label="$t('windward.core.shared.settings.title.instructions')"
19
19
  ></v-textarea>
20
20
  </v-container>
21
- <v-container class="pa-0">
22
- <v-text-field
23
- v-model="block.metadata.config.subject"
24
- outlined
25
- :label="$t('windward.core.components.settings.email.subject')"
26
- ></v-text-field>
27
- </v-container>
28
21
  <v-divider class="my-4 primary"></v-divider>
29
22
  <v-container class="pa-0">
30
- <p>Email Items</p>
23
+ <p>{{ $t('windward.core.components.settings.email.items') }}</p>
31
24
  <SortableExpansionPanel
32
25
  v-model="block.metadata.config.emails"
33
26
  @click:close="onRemoveElement($event)"
34
27
  @change="onDragged"
28
+ @update:currentPanel="onUpdatePanel"
35
29
  >
36
30
  <template #header="{ item }">{{
37
31
  item.from
@@ -66,6 +60,17 @@
66
60
  $t('windward.core.components.settings.email.cc')
67
61
  "
68
62
  ></v-text-field>
63
+ <v-text-field
64
+ v-model="
65
+ block.metadata.config.emails[index].subject
66
+ "
67
+ outlined
68
+ :label="
69
+ $t(
70
+ 'windward.core.components.settings.email.subject'
71
+ )
72
+ "
73
+ ></v-text-field>
69
74
  <v-btn
70
75
  @click="
71
76
  onToggleExpand(
@@ -73,24 +78,37 @@
73
78
  index
74
79
  )
75
80
  "
81
+ text
76
82
  >
77
83
  <v-icon
78
84
  v-if="
79
- !block.metadata.config.emails[index].expand
85
+ !block.metadata.config.emails[index]
86
+ .tinymce_expand
80
87
  "
88
+ color="primary"
81
89
  >mdi-arrow-expand-all</v-icon
82
90
  >
83
91
  <v-icon
84
92
  v-if="
85
- block.metadata.config.emails[index].expand
93
+ block.metadata.config.emails[index]
94
+ .tinymce_expand
86
95
  "
96
+ color="primary"
87
97
  >
88
98
  mdi-arrow-collapse-all
89
99
  </v-icon>
90
100
  </v-btn>
91
101
  <TextEditor
92
- v-show="!block.metadata.config.emails[index].expand"
102
+ v-show="
103
+ !block.metadata.config.emails[index]
104
+ .tinymce_expand
105
+ "
93
106
  v-model="block.metadata.config.emails[index].body"
107
+ :label="
108
+ $t(
109
+ 'windward.core.components.settings.email.placeholder'
110
+ )
111
+ "
94
112
  ></TextEditor>
95
113
  </v-container>
96
114
  </template>
@@ -101,7 +119,7 @@
101
119
  <v-btn color="primary" @click="onAddElement"
102
120
  ><v-icon>mdi-plus</v-icon
103
121
  >{{
104
- $t('windward.core.components.settings.accordion.add')
122
+ $t('windward.core.components.settings.email.add')
105
123
  }}</v-btn
106
124
  >
107
125
  </v-row>
@@ -155,19 +173,23 @@ export default {
155
173
  from: '',
156
174
  to: '',
157
175
  cc: '',
176
+ subject: '',
158
177
  body: '',
159
- expand: false,
178
+ tinymce_expand: false,
160
179
  initials: '',
161
180
  }
162
181
  this.block.metadata.config.emails.push(defaultObject)
163
182
  }
164
- this.block.body = this.$t('windward.core.components.content.blocks.email.title')
183
+ this.block.body = this.$t(
184
+ 'windward.core.components.content.blocks.email.title'
185
+ )
165
186
  },
166
187
  data() {
167
188
  return {
168
189
  valid: true,
169
190
  loading: false,
170
191
  expansionPanelKey: 0,
192
+ editingPanel: 0,
171
193
  }
172
194
  },
173
195
  beforeDestroy() {
@@ -175,14 +197,29 @@ export default {
175
197
  clearTimeout(this.debouncer)
176
198
  }
177
199
  },
200
+ mounted() {
201
+ this.block.metadata.config.selectedPanels = 0
202
+ },
178
203
  methods: {
179
204
  onBeforeSave() {
180
205
  this.block.metadata.config.emails.forEach((element) => {
181
- let matches = element.from.match(/\b(\w)/g)
182
- element.initials = matches.join('')
183
- element.expand = false
206
+ if (element.from) {
207
+ let matches = element.from.match(/\b(\w)/g)
208
+ element.initials = matches.join('')
209
+ }
210
+ element.tinymce_expand = false
184
211
  })
185
212
  },
213
+ onUpdatePanel($event) {
214
+ if ($event !== this.block.metadata.config.selectedPanels) {
215
+ //catch click event to open selected panel to edit
216
+ this.block.metadata.config.selectedPanels = $event
217
+ } else {
218
+ // if user clicks same panel again expansion panel closes
219
+ // setting selected to null will close content blocks expansion panels
220
+ this.block.metadata.config.selectedPanels = null
221
+ }
222
+ },
186
223
  onRemoveElement(event) {
187
224
  this.block.metadata.config.emails.splice(event, 1)
188
225
  this.expansionPanelKey = Crypto.id()
@@ -192,19 +229,24 @@ export default {
192
229
  from: '',
193
230
  to: '',
194
231
  cc: '',
232
+ subject: '',
195
233
  body: '',
196
- expand: false,
234
+ tinymce_expand: false,
197
235
  initials: '',
198
236
  }
199
237
  this.block.metadata.config.emails.push(defaultObject)
238
+ this.block.metadata.config.selectedPanels =
239
+ this.block.metadata.config.emails.length - 1
200
240
  },
201
241
  onToggleExpand(item, index) {
202
242
  this.expansionPanelKey = Crypto.id()
203
- return (item.expand = !item.expand)
243
+ return (item.tinymce_expand = !item.tinymce_expand)
204
244
  },
205
245
  onDragged() {
206
246
  // need to remount body after dragged to update the content body on the element
207
247
  this.expansionPanelKey = Crypto.id()
248
+ //close all panels on drag, leaving them open confuses the tracking as indexes changes around
249
+ this.block.metadata.config.selectedPanels = null
208
250
  },
209
251
  },
210
252
  }
@@ -1,11 +1,11 @@
1
1
  <template>
2
2
  <div>
3
3
  <br />
4
- <v-btn @click="onToggleExpand" class="mb-2">
5
- <v-icon v-if="!block.metadata.config.expand"
4
+ <v-btn @click="onToggleExpand" text class="mb-2">
5
+ <v-icon v-if="!block.metadata.config.expand" color="primary"
6
6
  >mdi-arrow-expand-all</v-icon
7
7
  >
8
- <v-icon v-if="block.metadata.config.expand">
8
+ <v-icon v-if="block.metadata.config.expand" color="primary">
9
9
  mdi-arrow-collapse-all
10
10
  </v-icon>
11
11
  </v-btn>
@@ -36,7 +36,9 @@ export default {
36
36
  this.block = {}
37
37
  }
38
38
  if (_.isEmpty(this.block.body)) {
39
- this.block.body = this.$t('windward.core.shared.content_blocks.title.math')
39
+ this.block.body = this.$t(
40
+ 'windward.core.shared.content_blocks.title.math'
41
+ )
40
42
  }
41
43
  if (_.isEmpty(this.block.metadata)) {
42
44
  this.block.metadata = {}
@@ -1,6 +1,6 @@
1
1
  <template>
2
2
  <div>
3
- <v-container>
3
+ <v-container class="pa-0">
4
4
  <v-col class="pa-0">
5
5
  <v-text-field
6
6
  v-model="block.metadata.config.title"
@@ -47,28 +47,8 @@
47
47
  )
48
48
  "
49
49
  ></v-switch>
50
-
51
- <v-btn
52
- color="primary"
53
- outlined
54
- block
55
- :disabled="block.metadata.config.items.length > 26"
56
- @click="onAddElement"
57
- >
58
- <v-icon>mdi-plus</v-icon>
59
- <span v-if="block.metadata.config.items.length <= 26">
60
- {{ $t('shared.forms.add') }}
61
- </span>
62
- <span v-else>
63
- {{
64
- $t(
65
- 'windward.core.components.settings.scenario_choice.over_item_limit'
66
- )
67
- }}
68
- </span>
69
- </v-btn>
70
50
  </v-col>
71
- <v-col>
51
+ <v-col class="pa-0">
72
52
  <SortableExpansionPanel
73
53
  v-model="block.metadata.config.items"
74
54
  @click:close="onRemoveElement"
@@ -84,37 +64,64 @@
84
64
  </span>
85
65
  </template>
86
66
  <template #body="{ index }">
87
- <v-text-field
88
- v-model="block.metadata.config.items[index].title"
89
- :id="'item-' + index + '-title'"
90
- :label="
91
- $t(
92
- 'windward.core.components.settings.scenario_choice.item_title'
93
- )
94
- "
95
- ></v-text-field>
67
+ <v-container>
68
+ <v-text-field
69
+ v-model="
70
+ block.metadata.config.items[index].title
71
+ "
72
+ :id="'item-' + index + '-title'"
73
+ :label="
74
+ $t(
75
+ 'windward.core.components.settings.scenario_choice.item_title'
76
+ )
77
+ "
78
+ ></v-text-field>
96
79
 
97
- <v-switch
98
- v-model="block.metadata.config.items[index].correct"
99
- :label="
80
+ <v-switch
81
+ v-model="
82
+ block.metadata.config.items[index].correct
83
+ "
84
+ :label="
85
+ $t(
86
+ 'windward.core.components.settings.scenario_choice.correct_choice'
87
+ )
88
+ "
89
+ ></v-switch>
90
+
91
+ <span>{{
100
92
  $t(
101
- 'windward.core.components.settings.scenario_choice.correct_choice'
93
+ 'windward.core.components.settings.scenario_choice.item_text'
102
94
  )
103
- "
104
- ></v-switch>
105
-
106
- <span>{{
107
- $t(
108
- 'windward.core.components.settings.scenario_choice.item_text'
109
- )
110
- }}</span>
111
- <TextEditor
112
- v-model="block.metadata.config.items[index].body"
113
- :height="200"
114
- ></TextEditor>
95
+ }}</span>
96
+ <TextEditor
97
+ v-model="
98
+ block.metadata.config.items[index].body
99
+ "
100
+ :height="200"
101
+ ></TextEditor>
102
+ </v-container>
115
103
  </template>
116
104
  </SortableExpansionPanel>
117
105
  </v-col>
106
+ <v-row justify="center" class="my-4">
107
+ <v-btn
108
+ color="primary"
109
+ :disabled="block.metadata.config.items.length > 26"
110
+ @click="onAddElement"
111
+ >
112
+ <v-icon>mdi-plus</v-icon>
113
+ <span v-if="block.metadata.config.items.length <= 26">
114
+ {{ $t('shared.forms.add') }}
115
+ </span>
116
+ <span v-else>
117
+ {{
118
+ $t(
119
+ 'windward.core.components.settings.scenario_choice.over_item_limit'
120
+ )
121
+ }}
122
+ </span>
123
+ </v-btn>
124
+ </v-row>
118
125
  </v-container>
119
126
 
120
127
  <DialogBox
@@ -29,15 +29,17 @@
29
29
  "
30
30
  :placeholder="'item ' + (index + 1)"
31
31
  ></v-text-field>
32
- <v-btn @click="onToggleExpand(index)" class="mb-3">
32
+ <v-btn @click="onToggleExpand(index)" text class="mb-3">
33
33
  <v-icon
34
34
  v-if="
35
35
  !block.metadata.config.items[index].expand
36
36
  "
37
+ color="primary"
37
38
  >mdi-arrow-expand-all</v-icon
38
39
  >
39
40
  <v-icon
40
41
  v-if="block.metadata.config.items[index].expand"
42
+ color="primary"
41
43
  >
42
44
  mdi-arrow-collapse-all
43
45
  </v-icon>
@@ -2,37 +2,79 @@
2
2
  <div>
3
3
  <br />
4
4
  <v-card elevation="0">
5
- <v-btn-toggle v-model="settingSelector" multiple>
6
- <v-btn>
7
- <v-icon>mdi-comment-text-multiple</v-icon>
8
- {{
9
- $t(
10
- 'windward.core.components.settings.text_editor.glossary'
11
- )
12
- }}
13
- </v-btn>
14
- <v-btn>
15
- <v-icon> mdi-text-long</v-icon>
16
- {{
17
- $t(
18
- 'windward.core.components.settings.text_editor.Text_editor'
19
- )
20
- }}
21
- </v-btn>
22
- <v-btn
23
- v-if="settingSelector.includes(1)"
24
- @click="
25
- block.metadata.config.expand =
26
- !block.metadata.config.expand
27
- "
28
- >
29
- <v-icon v-if="!block.metadata.config.expand"
30
- >mdi-arrow-expand-all</v-icon
5
+ <v-btn-toggle v-model="settingSelector" multiple borderless>
6
+ <v-tooltip top>
7
+ <template #activator="{ on, attrs }">
8
+ <v-btn v-bind="attrs" v-on="on" text>
9
+ <v-icon>mdi-comment-text-multiple</v-icon>
10
+ {{
11
+ $t(
12
+ 'windward.core.components.settings.text_editor.glossary'
13
+ )
14
+ }}
15
+ </v-btn>
16
+ </template>
17
+ <span>
18
+ {{
19
+ $t(
20
+ 'windward.core.components.settings.text_editor.click_to_hide_glossary'
21
+ )
22
+ }}</span
23
+ >
24
+ </v-tooltip>
25
+
26
+ <v-tooltip top>
27
+ <template #activator="{ on, attrs }">
28
+ <v-btn v-bind="attrs" v-on="on" text>
29
+ <v-icon> mdi-text-long</v-icon>
30
+ {{
31
+ $t(
32
+ 'windward.core.components.settings.text_editor.text_editor'
33
+ )
34
+ }}
35
+ </v-btn>
36
+ </template>
37
+ <span>
38
+ {{
39
+ $t(
40
+ 'windward.core.components.settings.text_editor.click_to_hide_editor'
41
+ )
42
+ }}</span
43
+ >
44
+ </v-tooltip>
45
+
46
+ <v-tooltip top v-if="settingSelector.includes(1)">
47
+ <template #activator="{ on, attrs }">
48
+ <v-btn
49
+ v-bind="attrs"
50
+ v-on="on"
51
+ @click="
52
+ block.metadata.config.expand =
53
+ !block.metadata.config.expand
54
+ "
55
+ text
56
+ >
57
+ <v-icon
58
+ v-if="!block.metadata.config.expand"
59
+ color="primary"
60
+ >mdi-arrow-expand-all</v-icon
61
+ >
62
+ <v-icon
63
+ v-if="block.metadata.config.expand"
64
+ color="primary"
65
+ >
66
+ mdi-arrow-collapse-all
67
+ </v-icon>
68
+ </v-btn>
69
+ </template>
70
+ <span>
71
+ {{
72
+ $t(
73
+ 'windward.core.components.settings.text_editor.click_to_expand'
74
+ )
75
+ }}</span
31
76
  >
32
- <v-icon v-if="block.metadata.config.expand">
33
- mdi-arrow-collapse-all
34
- </v-icon>
35
- </v-btn>
77
+ </v-tooltip>
36
78
  </v-btn-toggle>
37
79
  <br />
38
80
  </v-card>
@@ -20,11 +20,11 @@
20
20
  $t('windward.core.components.settings.user_upload.accept_types')
21
21
  "
22
22
  ></v-select>
23
- <v-btn @click="onToggleExpand()" class="mt-4">
24
- <v-icon v-if="!block.metadata.config.expand"
23
+ <v-btn @click="onToggleExpand()" text class="mt-4">
24
+ <v-icon v-if="!block.metadata.config.expand" color="primary"
25
25
  >mdi-arrow-expand-all</v-icon
26
26
  >
27
- <v-icon v-if="block.metadata.config.expand">
27
+ <v-icon v-if="block.metadata.config.expand" color="primary">
28
28
  mdi-arrow-collapse-all
29
29
  </v-icon>
30
30
  </v-btn>
@@ -257,7 +257,7 @@
257
257
  <v-btn
258
258
  v-bind="attrs"
259
259
  v-on="on"
260
- outlined
260
+ text
261
261
  color="error"
262
262
  :disabled="
263
263
  block.metadata.config.playlist.length <= 1
@@ -287,7 +287,7 @@
287
287
  v-bind="attrs"
288
288
  v-on="on"
289
289
  color="primary"
290
- outlined
290
+ text
291
291
  @click="onAddPlaylistItem"
292
292
  >
293
293
  <v-icon>mdi-plus</v-icon>
@@ -34,17 +34,16 @@
34
34
  >
35
35
  <v-container>
36
36
  <div class="flex-wrap col-12">
37
- <v-btn
38
- :min-height="index < 4 ? 40 : 60"
37
+ <button
39
38
  v-for="(
40
39
  button, buttonIndex
41
40
  ) in keyboard.buttons"
42
41
  :key="buttonIndex"
43
42
  class="btn"
44
43
  @click="insert(button)"
45
- v-html="convertLatexToMarkup(button.text)"
44
+ v-html="'<strong>'+convertLatexToMarkup(button.text)+'</strong>'"
46
45
  >
47
- </v-btn>
46
+ </button>
48
47
  </div>
49
48
  </v-container>
50
49
  </v-tab-item>
@@ -134,7 +133,7 @@ export default {
134
133
  options: {
135
134
  smartFence: true,
136
135
  smartMode: false,
137
- virtualKeyboardMode: 'auto',
136
+ virtualKeyboardMode: 'none',
138
137
  keypressSound: 'none',
139
138
  plonkSound: 'none',
140
139
  readOnly: false,
@@ -1,6 +1,6 @@
1
1
  <template>
2
- <div>
3
- <div class="included">
2
+ <div :class="'tinymce-included-' + seed">
3
+ <div>
4
4
  <editor
5
5
  :key="seed + config.skin"
6
6
  v-model="text"
@@ -10,13 +10,31 @@
10
10
  tag-name="div"
11
11
  model-events="change keydown blur focus mouseDown paste input submit SetContent"
12
12
  @onfocus="onEditorFocus"
13
+ v-click-outside="{
14
+ handler: onClickOutside,
15
+ closeConditional,
16
+ include,
17
+ }"
13
18
  >
14
19
  </editor>
15
20
  </div>
21
+
16
22
  <v-btn-toggle dense multiple class="pt-1 d-flex justify-end">
17
- <v-btn v-if="render" color="primary" @click="onClickCollapse">{{
18
- $t('windward.core.components.utils.tiny_mce_wrapper.minimize')
19
- }}</v-btn>
23
+ <slot name="actions-prepend" :render="render"></slot>
24
+ <slot name="actions" :render="render">
25
+ <v-btn
26
+ v-if="render"
27
+ color="primary"
28
+ outlined
29
+ @click="onClickOutside"
30
+ >{{
31
+ $t(
32
+ 'windward.core.components.utils.tiny_mce_wrapper.minimize'
33
+ )
34
+ }}
35
+ </v-btn>
36
+ </slot>
37
+ <slot name="actions-append" :render="render"></slot>
20
38
  </v-btn-toggle>
21
39
  </div>
22
40
  </template>
@@ -45,9 +63,10 @@ export default {
45
63
  type: String,
46
64
  required: false,
47
65
  default:
48
- 'undo redo | formatselect | fontsizeselect | bold italic underline strikethrough removeformat | alignleft aligncenter alignright | table bullist numlist outdent indent | mathButton ',
66
+ 'undo redo | formatselect | fontsizeselect | bold italic underline strikethrough removeformat | alignleft aligncenter alignright | table bullist numlist outdent indent | glossaryButton fibButton mathButton ',
49
67
  },
50
68
  root_block: { type: String, required: false, default: 'div' },
69
+ label: { type: String, required: true, default: '' },
51
70
  },
52
71
  beforeMount() {
53
72
  this.text = this.value
@@ -81,7 +100,7 @@ export default {
81
100
  },
82
101
  filteredHeight() {
83
102
  if (!this.render) {
84
- return 50
103
+ return 100
85
104
  } else if (this.height !== null) {
86
105
  return this.height
87
106
  } else {
@@ -90,6 +109,7 @@ export default {
90
109
  },
91
110
  config() {
92
111
  return {
112
+ draggable_modal: true,
93
113
  height: this.filteredHeight,
94
114
  visual: false,
95
115
  forced_root_block: this.root_block,
@@ -263,9 +283,11 @@ export default {
263
283
  },
264
284
  ],
265
285
  style_formats_merge: true,
266
- placeholder: this.$t(
267
- 'windward.core.shared.settings.title.placeholder'
268
- ),
286
+ placeholder: this.label
287
+ ? this.label
288
+ : this.$t(
289
+ 'windward.core.shared.settings.title.placeholder'
290
+ ),
269
291
  //required as it will be displayed as inline style in tinymce renderer
270
292
 
271
293
  skin: this.$vuetify.theme.isDark ? 'oxide-dark' : 'oxide',
@@ -284,6 +306,10 @@ export default {
284
306
  importcss_append: true,
285
307
  }
286
308
  },
309
+
310
+ elementBody() {
311
+ return [document.querySelector('.tinymce-included-' + this.seed)]
312
+ },
287
313
  },
288
314
  methods: {
289
315
  onEditorFocus() {
@@ -292,12 +318,39 @@ export default {
292
318
  this.render = true
293
319
  }
294
320
  },
295
- onClickCollapse() {
321
+ onClickOutside() {
296
322
  if (this.render) {
297
323
  this.seed = Crypto.id()
298
324
  this.render = false
299
325
  }
300
326
  },
327
+ include() {
328
+ // vuetify function to include an element with this class into clickable area without close
329
+ return this.elementBody
330
+ },
331
+
332
+ closeConditional(e) {
333
+ const targetClass = e.target.className
334
+ let parentNode
335
+ //check if target is svg element
336
+ if (e.target.matches('svg') || e.target instanceof SVGElement) {
337
+ parentNode = e.target.parentNode.parentNode
338
+ } else {
339
+ parentNode = e.target.parentNode
340
+ }
341
+
342
+ if (
343
+ parentNode.closest('.tinymce-included-' + this.seed) ||
344
+ _.includes(targetClass, 'tinymce-included-' + this.seed) ||
345
+ _.includes(targetClass, 'tox') ||
346
+ _.includes(parentNode.className, 'tox')
347
+ ) {
348
+ return false
349
+ } else {
350
+ this.onClickOutside()
351
+ return true
352
+ }
353
+ },
301
354
  },
302
355
  }
303
356
  </script>