@windward/core 0.5.2 → 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 (53) hide show
  1. package/CHANGELOG.md +11 -0
  2. package/components/Content/Blocks/Accordion.vue +28 -0
  3. package/components/Content/Blocks/ClickableIcons.vue +31 -21
  4. package/components/Content/Blocks/Email.vue +11 -2
  5. package/components/Content/Blocks/FileDownload.vue +6 -8
  6. package/components/Content/Blocks/GenerateAIQuestionButton.vue +14 -6
  7. package/components/Content/Blocks/HorizontalRule.vue +1 -4
  8. package/components/Content/Blocks/ScenarioChoice.vue +58 -33
  9. package/components/Content/Blocks/Tab.vue +5 -0
  10. package/components/Content/Blocks/UserUpload.vue +1 -8
  11. package/components/Content/Blocks/Video.vue +96 -8
  12. package/components/Settings/AccordionSettings.vue +176 -136
  13. package/components/Settings/BlockQuoteSettings.vue +41 -2
  14. package/components/Settings/ClickableIconsSettings.vue +66 -10
  15. package/components/Settings/EmailSettings.vue +39 -4
  16. package/components/Settings/FileDownloadSettings.vue +38 -7
  17. package/components/Settings/HorizontalRuleSettings.vue +0 -3
  18. package/components/Settings/ScenarioChoiceSettings.vue +47 -9
  19. package/components/Settings/TabSettings.vue +124 -71
  20. package/components/Settings/TextEditorSettings.vue +14 -2
  21. package/components/Settings/UserUploadSettings.vue +42 -23
  22. package/components/Settings/VideoSettings/SourcePicker.vue +222 -0
  23. package/components/Settings/VideoSettings.vue +151 -165
  24. package/components/utils/TinyMCEWrapper.vue +25 -3
  25. package/components/utils/assets/tinymce/content/global.scss +14 -0
  26. package/components/utils/glossary/CourseGlossary.vue +52 -27
  27. package/helpers/tinymce/WindwardPlugins.ts +59 -10
  28. package/i18n/en-US/components/content/blocks/generate_questions.ts +2 -1
  29. package/i18n/en-US/components/content/blocks/video.ts +2 -51
  30. package/i18n/en-US/components/settings/accordion.ts +1 -0
  31. package/i18n/en-US/components/settings/tab.ts +1 -0
  32. package/i18n/en-US/components/settings/user_upload.ts +1 -0
  33. package/i18n/en-US/components/settings/video.ts +51 -0
  34. package/i18n/en-US/components/utils/tiny_mce_wrapper.ts +9 -1
  35. package/i18n/en-US/shared/settings.ts +3 -0
  36. package/i18n/es-ES/components/content/blocks/generate_questions.ts +2 -1
  37. package/i18n/es-ES/components/content/blocks/video.ts +3 -53
  38. package/i18n/es-ES/components/settings/accordion.ts +1 -0
  39. package/i18n/es-ES/components/settings/tab.ts +2 -0
  40. package/i18n/es-ES/components/settings/user_upload.ts +1 -0
  41. package/i18n/es-ES/components/settings/video.ts +53 -0
  42. package/i18n/es-ES/components/utils/tiny_mce_wrapper.ts +9 -0
  43. package/i18n/es-ES/shared/settings.ts +3 -0
  44. package/i18n/sv-SE/components/content/blocks/generate_questions.ts +2 -1
  45. package/i18n/sv-SE/components/content/blocks/video.ts +2 -51
  46. package/i18n/sv-SE/components/settings/accordion.ts +2 -0
  47. package/i18n/sv-SE/components/settings/tab.ts +1 -0
  48. package/i18n/sv-SE/components/settings/user_upload.ts +1 -0
  49. package/i18n/sv-SE/components/settings/video.ts +51 -0
  50. package/i18n/sv-SE/components/utils/tiny_mce_wrapper.ts +8 -0
  51. package/i18n/sv-SE/shared/settings.ts +3 -0
  52. package/package.json +2 -1
  53. package/plugin.js +1 -1
@@ -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>