@windward/core 0.16.0 → 0.18.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 (32) hide show
  1. package/CHANGELOG.md +6 -0
  2. package/components/Content/Blocks/Accordion.vue +49 -39
  3. package/components/Content/Blocks/BlockQuote.vue +10 -1
  4. package/components/Content/Blocks/ClickableIcons.vue +55 -39
  5. package/components/Content/Blocks/Email.vue +11 -2
  6. package/components/Content/Blocks/FileDownload.vue +9 -1
  7. package/components/Content/Blocks/OpenResponse.vue +25 -12
  8. package/components/Content/Blocks/ScenarioChoice.vue +14 -5
  9. package/components/Content/Blocks/Tab.vue +15 -2
  10. package/components/Content/Blocks/UserUpload.vue +10 -1
  11. package/components/Content/Blocks/Video.vue +13 -4
  12. package/components/Navigation/Items/UserUploadNav.vue +4 -0
  13. package/components/Settings/AccordionSettings.vue +16 -30
  14. package/components/Settings/BlockQuoteSettings.vue +35 -48
  15. package/components/Settings/ClickableIconsSettings.vue +14 -27
  16. package/components/Settings/EmailSettings.vue +18 -28
  17. package/components/Settings/FileDownloadSettings.vue +14 -21
  18. package/components/Settings/OpenResponseSettings.vue +13 -27
  19. package/components/Settings/ScenarioChoiceSettings.vue +19 -29
  20. package/components/Settings/TabSettings.vue +22 -30
  21. package/components/Settings/TextEditorSettings.vue +1 -0
  22. package/components/Settings/UserUploadSettings.vue +12 -22
  23. package/components/Settings/VideoSettings.vue +12 -19
  24. package/components/utils/ContentViewer.vue +3 -0
  25. package/components/utils/FillInBlank/FillInBlankInput.vue +32 -28
  26. package/components/{Content/Blocks → utils}/GenerateAIQuestionButton.vue +117 -25
  27. package/components/utils/TinyMCEWrapper.vue +14 -57
  28. package/helpers/tinymce/WindwardPlugins.ts +36 -3
  29. package/models/Activity.ts +9 -0
  30. package/package.json +1 -1
  31. package/test/__mocks__/componentsMock.js +1 -0
  32. package/utils/index.js +1 -1
@@ -142,7 +142,17 @@ export class WindwardPlugins {
142
142
  'glossaryIcon',
143
143
  this.$t('windward.core.components.utils.tiny_mce_wrapper.glossary'),
144
144
  () => {
145
- this.editor.formatter.apply('glossary')
145
+ if (
146
+ this.editor.selection
147
+ .getSel()
148
+ .anchorNode.parentElement.classList.contains(
149
+ 'glossary-word'
150
+ )
151
+ ) {
152
+ this.editor.formatter.remove('glossary')
153
+ } else {
154
+ this.editor.formatter.apply('glossary')
155
+ }
146
156
  }
147
157
  )
148
158
  this.addButtonToEditor(
@@ -210,13 +220,29 @@ export class WindwardPlugins {
210
220
  itemKey: string,
211
221
  itemText: string,
212
222
  command: string,
213
- icon: string
223
+ icon: string,
224
+ type: string = 'command'
214
225
  ): void {
215
226
  this.editor.ui.registry.addMenuItem(itemKey, {
216
227
  text: itemText,
217
228
  icon,
218
229
  onAction: () => {
219
- this.editor.execCommand(command, true)
230
+ switch (type) {
231
+ case 'format':
232
+ if (
233
+ this.editor.selection
234
+ .getNode()
235
+ .classList.contains('glossary-word')
236
+ ) {
237
+ this.editor.formatter.remove(command)
238
+ } else {
239
+ this.editor.formatter.apply(command)
240
+ }
241
+ break
242
+ default:
243
+ this.editor.execCommand(command, true)
244
+ break
245
+ }
220
246
  },
221
247
  })
222
248
  }
@@ -233,6 +259,13 @@ export class WindwardPlugins {
233
259
  'fib-window',
234
260
  'fibIcon'
235
261
  )
262
+ this.addEditorMenuItem(
263
+ 'glossary',
264
+ 'Glossary',
265
+ 'glossary',
266
+ 'glossaryIcon',
267
+ 'format'
268
+ )
236
269
  }
237
270
 
238
271
  /**
@@ -0,0 +1,9 @@
1
+ // @ts-ignore
2
+ import BaseModel from './BaseModel'
3
+
4
+ export default class Activity extends BaseModel {
5
+ // Set the resource route of the model
6
+ resource() {
7
+ return 'activities'
8
+ }
9
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@windward/core",
3
- "version": "0.16.0",
3
+ "version": "0.18.0",
4
4
  "description": "Windward UI Core Plugins",
5
5
  "main": "plugin.js",
6
6
  "scripts": {
@@ -18,6 +18,7 @@ const shallowMocks = [
18
18
  { path: '~/components/Core/UserAvatar' },
19
19
  { path: '~/components/Text/TextViewer' },
20
20
  { path: '~/components/Text/TextEditor' },
21
+ { path: '~/components/Content/Settings/BaseContentBlockSettings' },
21
22
  ]
22
23
 
23
24
  for (const index in shallowMocks) {
package/utils/index.js CHANGED
@@ -7,7 +7,7 @@ import TinyMCEWrapper from '../components/utils/TinyMCEWrapper.vue'
7
7
  import MathExpressionEditor from '../components/utils/MathExpressionEditor'
8
8
  import CourseGlossary from '../components/utils/glossary/CourseGlossary.vue'
9
9
  import CourseGlossaryForm from '../components/utils/glossary/CourseGlossaryForm.vue'
10
- import GenerateAIQuestionButton from '../components/Content/Blocks/GenerateAIQuestionButton.vue'
10
+ import GenerateAIQuestionButton from '../components/utils/GenerateAIQuestionButton.vue'
11
11
 
12
12
  export {
13
13
  MathHelper,