@windward/core 0.6.0 → 0.7.0

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 (158) hide show
  1. package/CHANGELOG.md +8 -1
  2. package/components/Content/Blocks/Accordion.vue +14 -0
  3. package/components/Content/Blocks/ClickableIcons.vue +9 -2
  4. package/components/Content/Blocks/Email.vue +11 -2
  5. package/components/Content/Blocks/GenerateAIQuestionButton.vue +14 -6
  6. package/components/Content/Blocks/HorizontalRule.vue +1 -4
  7. package/components/Content/Blocks/ScenarioChoice.vue +57 -32
  8. package/components/Content/Blocks/Tab.vue +5 -0
  9. package/components/Content/Blocks/UserUpload.vue +1 -8
  10. package/components/Content/Blocks/Video.vue +96 -8
  11. package/components/Settings/AccordionSettings.vue +61 -8
  12. package/components/Settings/BlockQuoteSettings.vue +20 -12
  13. package/components/Settings/ClickableIconsSettings.vue +48 -12
  14. package/components/Settings/EmailSettings.vue +20 -12
  15. package/components/Settings/FileDownloadSettings.vue +22 -16
  16. package/components/Settings/HorizontalRuleSettings.vue +0 -3
  17. package/components/Settings/ScenarioChoiceSettings.vue +29 -14
  18. package/components/Settings/TabSettings.vue +121 -78
  19. package/components/Settings/UserUploadSettings.vue +30 -32
  20. package/components/Settings/VideoSettings/SourcePicker.vue +222 -0
  21. package/components/Settings/VideoSettings.vue +139 -183
  22. package/components/utils/TinyMCEWrapper.vue +3 -2
  23. package/components/utils/assets/tinymce/content/global.scss +14 -0
  24. package/components/utils/glossary/CourseGlossary.vue +52 -27
  25. package/helpers/tinymce/WindwardPlugins.ts +59 -10
  26. package/i18n/en-US/components/content/blocks/generate_questions.ts +2 -1
  27. package/i18n/en-US/components/content/blocks/video.ts +2 -51
  28. package/i18n/en-US/components/settings/accordion.ts +1 -0
  29. package/i18n/en-US/components/settings/tab.ts +1 -0
  30. package/i18n/en-US/components/settings/user_upload.ts +1 -0
  31. package/i18n/en-US/components/settings/video.ts +51 -0
  32. package/i18n/en-US/components/utils/tiny_mce_wrapper.ts +9 -1
  33. package/i18n/es-ES/components/content/blocks/generate_questions.ts +2 -1
  34. package/i18n/es-ES/components/content/blocks/video.ts +3 -53
  35. package/i18n/es-ES/components/settings/accordion.ts +1 -0
  36. package/i18n/es-ES/components/settings/tab.ts +2 -0
  37. package/i18n/es-ES/components/settings/user_upload.ts +1 -0
  38. package/i18n/es-ES/components/settings/video.ts +53 -0
  39. package/i18n/es-ES/components/utils/tiny_mce_wrapper.ts +9 -0
  40. package/i18n/sv-SE/components/content/blocks/generate_questions.ts +2 -1
  41. package/i18n/sv-SE/components/content/blocks/video.ts +2 -51
  42. package/i18n/sv-SE/components/settings/accordion.ts +2 -0
  43. package/i18n/sv-SE/components/settings/tab.ts +1 -0
  44. package/i18n/sv-SE/components/settings/user_upload.ts +1 -0
  45. package/i18n/sv-SE/components/settings/video.ts +51 -0
  46. package/i18n/sv-SE/components/utils/tiny_mce_wrapper.ts +8 -0
  47. package/package.json +2 -1
  48. package/plugin.js +1 -1
  49. package/.idea/codeStyles/Project.xml +0 -58
  50. package/.idea/codeStyles/codeStyleConfig.xml +0 -5
  51. package/.idea/inspectionProfiles/Project_Default.xml +0 -6
  52. package/.idea/modules.xml +0 -8
  53. package/.idea/php-docker-settings.xml +0 -24
  54. package/.idea/php.xml +0 -19
  55. package/.idea/vcs.xml +0 -6
  56. package/.idea/watcherTasks.xml +0 -4
  57. package/.idea/windward-ui-plugin-core.iml +0 -8
  58. package/config/menu.config.json +0 -475
  59. package/coverage/clover.xml +0 -223
  60. package/coverage/coverage-final.json +0 -16
  61. package/coverage/lcov-report/base.css +0 -224
  62. package/coverage/lcov-report/block-navigation.js +0 -87
  63. package/coverage/lcov-report/components/Content/Blocks/Accordion.vue.html +0 -430
  64. package/coverage/lcov-report/components/Content/Blocks/Image.vue.html +0 -394
  65. package/coverage/lcov-report/components/Content/Blocks/Math.vue.html +0 -262
  66. package/coverage/lcov-report/components/Content/Blocks/RichText.vue.html +0 -295
  67. package/coverage/lcov-report/components/Content/Blocks/Tab.vue.html +0 -415
  68. package/coverage/lcov-report/components/Content/Blocks/Table.vue.html +0 -667
  69. package/coverage/lcov-report/components/Content/Blocks/Video.vue.html +0 -2275
  70. package/coverage/lcov-report/components/Content/Blocks/index.html +0 -206
  71. package/coverage/lcov-report/components/utils/ContentViewer.vue.html +0 -199
  72. package/coverage/lcov-report/components/utils/MathExpressionEditor.vue.html +0 -919
  73. package/coverage/lcov-report/components/utils/MathLiveWrapper.vue.html +0 -343
  74. package/coverage/lcov-report/components/utils/TinyMCEWrapper.vue.html +0 -271
  75. package/coverage/lcov-report/components/utils/index.html +0 -161
  76. package/coverage/lcov-report/config/index.html +0 -116
  77. package/coverage/lcov-report/config/tinymce.config.js.html +0 -493
  78. package/coverage/lcov-report/favicon.png +0 -0
  79. package/coverage/lcov-report/helpers/MathHelper.ts.html +0 -793
  80. package/coverage/lcov-report/helpers/index.html +0 -116
  81. package/coverage/lcov-report/helpers/tinymce/index.html +0 -116
  82. package/coverage/lcov-report/helpers/tinymce/plugin.ts.html +0 -334
  83. package/coverage/lcov-report/index.html +0 -191
  84. package/coverage/lcov-report/prettify.css +0 -1
  85. package/coverage/lcov-report/prettify.js +0 -2
  86. package/coverage/lcov-report/sort-arrow-sprite.png +0 -0
  87. package/coverage/lcov-report/sorter.js +0 -196
  88. package/coverage/lcov-report/test/index.html +0 -116
  89. package/coverage/lcov-report/test/mocks.js.html +0 -457
  90. package/coverage/lcov.info +0 -403
  91. package/lib/helpers/GlossaryHelper.d.ts +0 -9
  92. package/lib/helpers/GlossaryHelper.js +0 -118
  93. package/lib/helpers/GlossaryTerm.d.ts +0 -10
  94. package/lib/helpers/GlossaryTerm.js +0 -22
  95. package/lib/helpers/MathHelper.d.ts +0 -99
  96. package/lib/helpers/MathHelper.js +0 -194
  97. package/lib/helpers/tinymce/plugin.d.ts +0 -2
  98. package/lib/helpers/tinymce/plugin.js +0 -86
  99. package/lib/i18n/en-US/components/content/blocks/image.d.ts +0 -6
  100. package/lib/i18n/en-US/components/content/blocks/image.js +0 -7
  101. package/lib/i18n/en-US/components/content/blocks/index.d.ts +0 -75
  102. package/lib/i18n/en-US/components/content/blocks/index.js +0 -14
  103. package/lib/i18n/en-US/components/content/blocks/tab.d.ts +0 -5
  104. package/lib/i18n/en-US/components/content/blocks/tab.js +0 -6
  105. package/lib/i18n/en-US/components/content/blocks/table.d.ts +0 -5
  106. package/lib/i18n/en-US/components/content/blocks/table.js +0 -6
  107. package/lib/i18n/en-US/components/content/blocks/user_upload.d.ts +0 -13
  108. package/lib/i18n/en-US/components/content/blocks/user_upload.js +0 -14
  109. package/lib/i18n/en-US/components/content/blocks/video.d.ts +0 -48
  110. package/lib/i18n/en-US/components/content/blocks/video.js +0 -49
  111. package/lib/i18n/en-US/components/content/index.d.ts +0 -77
  112. package/lib/i18n/en-US/components/content/index.js +0 -6
  113. package/lib/i18n/en-US/components/index.d.ts +0 -140
  114. package/lib/i18n/en-US/components/index.js +0 -12
  115. package/lib/i18n/en-US/components/navigation/image.d.ts +0 -5
  116. package/lib/i18n/en-US/components/navigation/image.js +0 -6
  117. package/lib/i18n/en-US/components/navigation/index.d.ts +0 -10
  118. package/lib/i18n/en-US/components/navigation/index.js +0 -8
  119. package/lib/i18n/en-US/components/navigation/user_upload.d.ts +0 -4
  120. package/lib/i18n/en-US/components/navigation/user_upload.js +0 -5
  121. package/lib/i18n/en-US/components/settings/clickable_icon.d.ts +0 -6
  122. package/lib/i18n/en-US/components/settings/clickable_icon.js +0 -7
  123. package/lib/i18n/en-US/components/settings/image.d.ts +0 -2
  124. package/lib/i18n/en-US/components/settings/image.js +0 -3
  125. package/lib/i18n/en-US/components/settings/index.d.ts +0 -39
  126. package/lib/i18n/en-US/components/settings/index.js +0 -14
  127. package/lib/i18n/en-US/components/settings/text_editor.d.ts +0 -8
  128. package/lib/i18n/en-US/components/settings/text_editor.js +0 -9
  129. package/lib/i18n/en-US/components/settings/user_upload.d.ts +0 -12
  130. package/lib/i18n/en-US/components/settings/user_upload.js +0 -13
  131. package/lib/i18n/en-US/components/settings/video.d.ts +0 -13
  132. package/lib/i18n/en-US/components/settings/video.js +0 -14
  133. package/lib/i18n/en-US/components/utils/index.d.ts +0 -15
  134. package/lib/i18n/en-US/components/utils/index.js +0 -6
  135. package/lib/i18n/en-US/components/utils/tiny_mce_wrapper.d.ts +0 -13
  136. package/lib/i18n/en-US/components/utils/tiny_mce_wrapper.js +0 -14
  137. package/lib/i18n/en-US/index.d.ts +0 -197
  138. package/lib/i18n/en-US/index.js +0 -16
  139. package/lib/i18n/en-US/modules/index.d.ts +0 -2
  140. package/lib/i18n/en-US/modules/index.js +0 -6
  141. package/lib/i18n/en-US/pages/glossary.d.ts +0 -8
  142. package/lib/i18n/en-US/pages/glossary.js +0 -9
  143. package/lib/i18n/en-US/pages/index.d.ts +0 -13
  144. package/lib/i18n/en-US/pages/index.js +0 -8
  145. package/lib/i18n/en-US/pages/user_upload.d.ts +0 -4
  146. package/lib/i18n/en-US/pages/user_upload.js +0 -5
  147. package/lib/i18n/en-US/shared/content_blocks.d.ts +0 -20
  148. package/lib/i18n/en-US/shared/content_blocks.js +0 -21
  149. package/lib/i18n/en-US/shared/index.d.ts +0 -39
  150. package/lib/i18n/en-US/shared/index.js +0 -10
  151. package/lib/i18n/en-US/shared/menu.d.ts +0 -4
  152. package/lib/i18n/en-US/shared/menu.js +0 -5
  153. package/lib/i18n/en-US/shared/settings.d.ts +0 -15
  154. package/lib/i18n/en-US/shared/settings.js +0 -16
  155. package/lib/i18n/en-US.d.ts +0 -197
  156. package/lib/i18n/en-US.js +0 -15
  157. package/lib/models/UserFileAsset.d.ts +0 -5
  158. package/lib/models/UserFileAsset.js +0 -37
@@ -0,0 +1,222 @@
1
+ <template>
2
+ <div>
3
+ <ContentBlockAsset
4
+ :value="source"
5
+ :assets="assets"
6
+ mimes="video/mp4,video/webm,video/youtube,audio/mpeg,audio/ogg,audio/webm,audio/wav"
7
+ allow-url
8
+ class="mb-4"
9
+ :disabled="disabled"
10
+ @input="$emit('update:source', $event)"
11
+ @change="onSourceChange"
12
+ @update:assets="onUpdateAssets"
13
+ >
14
+ <template #title>
15
+ {{
16
+ sourceLabel ||
17
+ $t('windward.core.components.settings.video.place_source')
18
+ }}
19
+ </template>
20
+ <template #description>
21
+ {{
22
+ sourceDescription ||
23
+ $t(
24
+ 'windward.core.components.settings.video.video.configure_blurb'
25
+ )
26
+ }}
27
+ </template>
28
+ </ContentBlockAsset>
29
+
30
+ <v-tooltip
31
+ v-if="
32
+ $PermissionService.userHasAccessTo(
33
+ 'windward.global.file',
34
+ 'writable'
35
+ )
36
+ "
37
+ top
38
+ color="primary"
39
+ >
40
+ <template #activator="{ on, attrs }">
41
+ <v-switch
42
+ v-model="sourceInherit"
43
+ :disabled="disabled || !source"
44
+ >
45
+ <template #label>
46
+ <span v-bind="attrs" v-on="on">
47
+ {{
48
+ $t(
49
+ 'windward.core.components.settings.video.inherit_captions'
50
+ )
51
+ }}
52
+ <v-icon x-small class="help-offset-icon">
53
+ mdi-help
54
+ </v-icon>
55
+ </span>
56
+ </template>
57
+ </v-switch>
58
+ </template>
59
+ <span class="span-description">{{
60
+ $t(
61
+ 'windward.core.components.settings.video.inherit_global_toggle_description'
62
+ )
63
+ }}</span>
64
+ </v-tooltip>
65
+
66
+ <v-alert v-if="sourceInherit && !hasLinkedCaptions" type="warning">
67
+ {{
68
+ $t(
69
+ 'windward.core.components.settings.video.inherit_missing_captions'
70
+ )
71
+ }}
72
+ </v-alert>
73
+
74
+ <ContentBlockAsset
75
+ v-if="sourceInherit && hasLinkedCaptions"
76
+ :value="linkedCaptions"
77
+ :assets="assets"
78
+ disabled
79
+ ></ContentBlockAsset>
80
+
81
+ <ContentBlockAsset
82
+ v-if="!sourceInherit"
83
+ :value="track"
84
+ :assets="assets"
85
+ mimes="text/vtt,text/xml"
86
+ allow-url
87
+ class="mb-4"
88
+ :disabled="disabled || sourceInherit || !source"
89
+ @input="$emit('update:track', $event)"
90
+ @change="onTrackChange"
91
+ @update:assets="$emit('update:assets', $event)"
92
+ >
93
+ <template #title>
94
+ {{
95
+ trackLabel ||
96
+ $t('windward.core.components.settings.video.caption.title')
97
+ }}
98
+ </template>
99
+ <template #description>
100
+ {{
101
+ trackDescription ||
102
+ $t(
103
+ 'windward.core.components.settings.video.caption.configure_blurb'
104
+ )
105
+ }}
106
+ </template>
107
+ </ContentBlockAsset>
108
+ </div>
109
+ </template>
110
+ <script>
111
+ import _ from 'lodash'
112
+ import ContentBlockAsset from '~/components/Content/ContentBlockAsset.vue'
113
+
114
+ export default {
115
+ name: 'VideoSettingsSourcePicker',
116
+ components: { ContentBlockAsset },
117
+ props: {
118
+ source: {
119
+ type: Object,
120
+ required: false,
121
+ default: () => {
122
+ return {}
123
+ },
124
+ },
125
+ track: {
126
+ type: Object,
127
+ required: false,
128
+ default: () => {
129
+ return {}
130
+ },
131
+ },
132
+ assets: {
133
+ type: Array,
134
+ required: false,
135
+ default: () => {
136
+ return []
137
+ },
138
+ },
139
+ sourceLabel: {
140
+ type: String,
141
+ required: false,
142
+ default: '',
143
+ },
144
+ trackLabel: {
145
+ type: String,
146
+ required: false,
147
+ default: '',
148
+ },
149
+ sourceDescription: {
150
+ type: String,
151
+ required: false,
152
+ default: '',
153
+ },
154
+ trackDescription: {
155
+ type: String,
156
+ required: false,
157
+ default: '',
158
+ },
159
+ disabled: {
160
+ type: Boolean,
161
+ required: false,
162
+ default: false,
163
+ },
164
+ },
165
+ data() {
166
+ return {
167
+ sourceInherit: true,
168
+ linkedCaptions: null,
169
+ }
170
+ },
171
+ computed: {
172
+ hasLinkedCaptions() {
173
+ return this.linkedCaptions !== null
174
+ },
175
+ linkedCaptionsName() {
176
+ return _.get(
177
+ this.linkedCaptions,
178
+ 'asset.name',
179
+ _.get(this.linkedCaptions, 'asset.public_url', '???')
180
+ )
181
+ },
182
+ },
183
+ watch: {},
184
+ beforeMount() {},
185
+ mounted() {
186
+ this.linkedCaptions = this.getLinkedCaptions(this.source)
187
+ // Turn inherit switch on if there's a source and no tracks are enabled
188
+ this.sourceInherit = this.source && !this.track
189
+ },
190
+ methods: {
191
+ onSourceChange(file, rawFile) {
192
+ this.linkedCaptions = this.getLinkedCaptions(rawFile)
193
+ this.sourceInherit = this.linkedCaptions !== null
194
+
195
+ this.$emit('change:source', file, rawFile)
196
+ },
197
+ onTrackChange(file, rawFile) {
198
+ if (!file && this.hasLinkedCaptions) {
199
+ this.sourceInherit = true
200
+ }
201
+ this.$emit('change:track', file, rawFile)
202
+ },
203
+ onUpdateAssets(assets) {
204
+ this.$emit('update:assets', assets)
205
+ },
206
+ getLinkedCaptions(file) {
207
+ if (!file) {
208
+ return null
209
+ }
210
+ // Check to see if the video source has a linked asset and it's a vtt file
211
+ const linkedCaption = _.find(
212
+ _.get(file, 'asset.linked_assets', []),
213
+ function (f) {
214
+ return _.get(f, 'asset.metadata.extension', '') === 'vtt'
215
+ }
216
+ )
217
+
218
+ return linkedCaption || null
219
+ },
220
+ },
221
+ }
222
+ </script>