@windward/core 0.7.0 → 0.9.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 (64) hide show
  1. package/.eslintrc.js +5 -1
  2. package/.prettierrc +3 -2
  3. package/components/Content/Blocks/Accordion.vue +10 -2
  4. package/components/Content/Blocks/BlockQuote.vue +6 -2
  5. package/components/Content/Blocks/ClickableIcons.vue +12 -10
  6. package/components/Content/Blocks/Email.vue +7 -7
  7. package/components/Content/Blocks/GenerateAIQuestionButton.vue +85 -18
  8. package/components/Content/Blocks/HorizontalRule.vue +2 -0
  9. package/components/Content/Blocks/Image.vue +7 -182
  10. package/components/Content/Blocks/OpenResponse.vue +25 -0
  11. package/components/Content/Blocks/OpenResponseCollate.vue +13 -12
  12. package/components/Content/Blocks/ScenarioChoice.vue +10 -2
  13. package/components/Content/Blocks/Tab.vue +27 -3
  14. package/components/Content/Blocks/UserUpload.vue +5 -3
  15. package/components/Content/Blocks/Video.vue +33 -7
  16. package/components/Navigation/Items/GlossaryNav.vue +25 -10
  17. package/components/Settings/AccordionSettings.vue +20 -34
  18. package/components/Settings/BlockQuoteSettings.vue +17 -41
  19. package/components/Settings/ClickableIconsSettings.vue +18 -40
  20. package/components/Settings/EmailSettings.vue +12 -38
  21. package/components/Settings/FileDownloadSettings.vue +10 -35
  22. package/components/Settings/ImageSettings.vue +13 -247
  23. package/components/Settings/OpenResponseCollateSettings.vue +47 -55
  24. package/components/Settings/OpenResponseSettings.vue +62 -36
  25. package/components/Settings/ScenarioChoiceSettings.vue +13 -35
  26. package/components/Settings/TabSettings.vue +25 -34
  27. package/components/Settings/UserUploadSettings.vue +6 -30
  28. package/components/Settings/VideoSettings/SourcePicker.vue +1 -0
  29. package/components/Settings/VideoSettings.vue +6 -42
  30. package/components/utils/ContentViewer.vue +0 -3
  31. package/components/utils/FillInBlank/FillInBlankInput.vue +29 -47
  32. package/components/utils/TinyMCEWrapper.vue +42 -81
  33. package/components/utils/glossary/GlossaryToolTip.vue +6 -0
  34. package/helpers/GlossaryHelper.ts +12 -2
  35. package/helpers/tinymce/WindwardPlugins.ts +166 -118
  36. package/i18n/en-US/components/content/blocks/generate_questions.ts +3 -2
  37. package/i18n/en-US/components/settings/open_response_collate.ts +1 -1
  38. package/i18n/en-US/components/settings/scenario_choice.ts +3 -2
  39. package/i18n/en-US/components/settings/video.ts +1 -1
  40. package/i18n/en-US/components/utils/FillInBlank/FillInBlankInput.ts +2 -0
  41. package/i18n/en-US/components/utils/tiny_mce_wrapper.ts +1 -0
  42. package/i18n/en-US/shared/settings.ts +1 -1
  43. package/i18n/es-ES/components/content/blocks/generate_questions.ts +2 -1
  44. package/i18n/es-ES/components/settings/open_response_collate.ts +1 -1
  45. package/i18n/es-ES/components/settings/scenario_choice.ts +3 -2
  46. package/i18n/es-ES/components/settings/video.ts +1 -1
  47. package/i18n/es-ES/components/utils/FillInBlank/FillInBlankInput.ts +2 -0
  48. package/i18n/es-ES/components/utils/tiny_mce_wrapper.ts +3 -2
  49. package/i18n/es-ES/shared/settings.ts +1 -1
  50. package/i18n/sv-SE/components/content/blocks/generate_questions.ts +2 -1
  51. package/i18n/sv-SE/components/settings/open_response_collate.ts +1 -1
  52. package/i18n/sv-SE/components/settings/scenario_choice.ts +3 -2
  53. package/i18n/sv-SE/components/settings/video.ts +1 -1
  54. package/i18n/sv-SE/components/utils/FillInBlank/FillInBlankInput.ts +2 -0
  55. package/i18n/sv-SE/components/utils/tiny_mce_wrapper.ts +2 -0
  56. package/package.json +3 -2
  57. package/pages/glossary.vue +1 -1
  58. package/stylelint.config.js +14 -0
  59. package/test/Components/Content/Blocks/OpenResponseCollate.spec.js +3 -3
  60. package/test/Components/Settings/TabSettings.spec.js +2 -2
  61. package/test/__mocks__/contentBlockMock.js +20 -0
  62. package/test/__mocks__/modelMock.js +1 -1
  63. package/test/helpers/GlossaryHelper.spec.js +22 -3
  64. package/test/mocks.js +8 -0
@@ -2,21 +2,22 @@
2
2
  <div>
3
3
  <v-row class="pl-3 pr-3">
4
4
  <v-text-field
5
+ id="block-settings-title"
5
6
  v-model="block.metadata.config.title"
6
7
  :autofocus="true"
7
- :rules="validation.shortInputRules"
8
- :counter="50"
8
+ :rules="$Validation.getRule('block.title')"
9
+ :counter="$Validation.getLimit('block.title')"
9
10
  outlined
10
- id="title"
11
11
  :label="
12
12
  $t('windward.core.components.settings.clickable_icon.title')
13
13
  "
14
14
  :disabled="render"
15
15
  ></v-text-field>
16
16
  <v-textarea
17
+ id="block-settings-instructions"
17
18
  v-model="block.metadata.config.instructions"
18
- :rules="validation.instructionRule"
19
- :counter="255"
19
+ :rules="$Validation.getRule('block.instructions')"
20
+ :counter="$Validation.getLimit('block.instructions')"
20
21
  outlined
21
22
  :label="$t('components.content.settings.base.instructions')"
22
23
  :disabled="render"
@@ -43,8 +44,8 @@
43
44
  outlined
44
45
  :autofocus="true"
45
46
  v-model="block.metadata.config.items[index].tabHeader"
46
- :counter="50"
47
- :rules="validation.shortInputRules"
47
+ :rules="$Validation.getRule('shortInput')"
48
+ :counter="$Validation.getLimit('shortInput')"
48
49
  :label="'item ' + (index + 1)"
49
50
  :disabled="render"
50
51
  ></v-text-field>
@@ -73,6 +74,19 @@
73
74
  :key="textEditorUpdateKey"
74
75
  :disabled="render"
75
76
  ></TextEditor>
77
+
78
+ <v-card class="mt-2">
79
+ <v-card-text>
80
+ <ImageAssetSettings
81
+ v-model="
82
+ block.metadata.config.items[index]
83
+ .imageAsset
84
+ "
85
+ :assets.sync="block.assets"
86
+ >
87
+ </ImageAssetSettings>
88
+ </v-card-text>
89
+ </v-card>
76
90
  </v-container>
77
91
  </template>
78
92
  </SortableExpansionPanel>
@@ -102,13 +116,14 @@
102
116
  import _, { get } from 'lodash'
103
117
  import Crypto from '~/helpers/Crypto'
104
118
  import TextEditor from '~/components/Text/TextEditor'
119
+ import ImageAssetSettings from '~/components/Content/Settings/ImageAssetSettings.vue'
105
120
  import BaseContentSettings from '~/components/Content/Settings/BaseContentSettings.js'
106
121
  import SortableExpansionPanel from '~/components/Core/SortableExpansionPanel.vue'
107
122
  import Uuid from '~/helpers/Uuid'
108
123
 
109
124
  export default {
110
125
  name: 'TabSettings',
111
- components: { TextEditor, SortableExpansionPanel },
126
+ components: { TextEditor, ImageAssetSettings, SortableExpansionPanel },
112
127
  extends: BaseContentSettings,
113
128
  beforeMount() {
114
129
  if (_.isEmpty(this.block)) {
@@ -145,6 +160,7 @@ export default {
145
160
  tabHeader: '',
146
161
  expand: false,
147
162
  content: '',
163
+ imageAsset: null,
148
164
  }
149
165
  this.block.metadata.config.items = []
150
166
  this.block.metadata.config.items.push(defaultObject)
@@ -156,32 +172,6 @@ export default {
156
172
  textEditorUpdateKey: Crypto.id(),
157
173
  valid: true,
158
174
  loading: false,
159
- validation: {
160
- shortInputRules: [
161
- (v) => {
162
- if (v && v.length >= 50) {
163
- return this.$t(
164
- 'windward.core.shared.settings.errors.input_limitations',
165
- [50]
166
- )
167
- } else {
168
- return true
169
- }
170
- },
171
- ],
172
- instructionRule: [
173
- (v) => {
174
- if (v && v.length >= 255) {
175
- return this.$t(
176
- 'windward.core.shared.settings.errors.input_limitations',
177
- [255]
178
- )
179
- } else {
180
- return true
181
- }
182
- },
183
- ],
184
- },
185
175
  }
186
176
  },
187
177
  mounted() {
@@ -200,6 +190,7 @@ export default {
200
190
  tabHeader: '',
201
191
  expand: false,
202
192
  content: '',
193
+ imageAsset: null,
203
194
  }
204
195
  this.block.metadata.config.items.push(defaultObject)
205
196
  this.block.metadata.config.currentTab =
@@ -1,18 +1,20 @@
1
1
  <template>
2
2
  <div>
3
3
  <v-text-field
4
+ id="block-settings-title"
4
5
  v-model="block.metadata.config.title"
5
6
  outlined
6
- :rules="validation.titleRules"
7
- :counter="50"
7
+ :rules="$Validation.getRule('block.title')"
8
+ :counter="$Validation.getLimit('block.title')"
8
9
  :autofocus="true"
9
10
  :label="$t('components.content.settings.base.title')"
10
11
  :disabled="render"
11
12
  ></v-text-field>
12
13
  <v-textarea
14
+ id="block-settings-instructions"
13
15
  v-model="block.metadata.config.instructions"
14
- :rules="validation.instructionRule"
15
- :counter="255"
16
+ :rules="$Validation.getRule('block.instructions')"
17
+ :counter="$Validation.getLimit('block.instructions')"
16
18
  outlined
17
19
  :label="$t('components.content.settings.base.instructions')"
18
20
  :disabled="render"
@@ -129,32 +131,6 @@ export default {
129
131
  boilerplate: true,
130
132
  elevation: 0,
131
133
  },
132
- validation: {
133
- titleRules: [
134
- (v) => {
135
- if (v && v.length >= 50) {
136
- return this.$t(
137
- 'windward.core.shared.settings.errors.input_limitations',
138
- [50]
139
- )
140
- } else {
141
- return true
142
- }
143
- },
144
- ],
145
- instructionRule: [
146
- (v) => {
147
- if (v && v.length >= 255) {
148
- return this.$t(
149
- 'windward.core.shared.settings.errors.input_limitations',
150
- [255]
151
- )
152
- } else {
153
- return true
154
- }
155
- },
156
- ],
157
- },
158
134
  }
159
135
  },
160
136
  mounted() {},
@@ -84,6 +84,7 @@
84
84
  :assets="assets"
85
85
  mimes="text/vtt,text/xml"
86
86
  allow-url
87
+ outlined
87
88
  class="mb-4"
88
89
  :disabled="disabled || sourceInherit || !source"
89
90
  @input="$emit('update:track', $event)"
@@ -3,19 +3,21 @@
3
3
  <v-row>
4
4
  <v-col cols="12">
5
5
  <v-text-field
6
+ id="block-settings-title"
6
7
  v-model="block.metadata.config.title"
7
- :counter="50"
8
+ :rules="$Validation.getRule('block.title')"
9
+ :counter="$Validation.getLimit('block.title')"
8
10
  outlined
9
- :rules="validation.shortInputRules"
10
11
  :label="$t('windward.core.components.settings.video.title')"
11
12
  :disabled="render"
12
13
  ></v-text-field>
13
14
  <v-textarea
15
+ id="block-settings-instructions"
14
16
  v-model="block.metadata.config.description"
15
17
  outlined
16
18
  auto-grow
17
- :rules="validation.instructionRule"
18
- :counter="255"
19
+ :rules="$Validation.getRule('block.instructions')"
20
+ :counter="$Validation.getLimit('block.instructions')"
19
21
  :label="
20
22
  $t(
21
23
  'components.content.settings.base.description_optional'
@@ -426,44 +428,6 @@ export default {
426
428
  },
427
429
  },
428
430
  },
429
- validation: {
430
- shortInputRules: [
431
- (v) => {
432
- if (v && v.length >= 50) {
433
- return this.$t(
434
- 'windward.core.shared.settings.errors.input_limitations',
435
- [50]
436
- )
437
- } else {
438
- return true
439
- }
440
- },
441
- ],
442
- instructionRule: [
443
- (v) => {
444
- if (v && v.length >= 255) {
445
- return this.$t(
446
- 'windward.core.shared.settings.errors.input_limitations',
447
- [255]
448
- )
449
- } else {
450
- return true
451
- }
452
- },
453
- ],
454
- clueRule: [
455
- (v) => {
456
- if (v && v.length >= 155) {
457
- return this.$t(
458
- 'windward.core.shared.settings.errors.input_limitations',
459
- [155]
460
- )
461
- } else {
462
- return true
463
- }
464
- },
465
- ],
466
- },
467
431
  showPreRoll: false,
468
432
  showPostRoll: false,
469
433
  }
@@ -62,9 +62,6 @@ export default {
62
62
  </script>
63
63
 
64
64
  <style lang="scss">
65
- .text-viewer {
66
- min-height: 50px !important;
67
- }
68
65
  .text-viewer table tr td {
69
66
  padding: 10px !important;
70
67
  }
@@ -2,30 +2,24 @@
2
2
  <span class="fib">
3
3
  <v-dialog v-model="show" max-width="300">
4
4
  <v-card>
5
- <v-card-title class="text-h5">
6
- {{
7
- answerIsCorrect
8
- ? $t(
9
- 'windward.core.components.utils.fill_in_the_blank.fill_in_blank_input.correct'
10
- )
11
- : $t(
12
- 'windward.core.components.utils.fill_in_the_blank.fill_in_blank_input.incorrect'
13
- )
14
- }}
15
- </v-card-title>
16
- <v-card-text>
17
- <div v-if="answerIsCorrect || showAnswer">
5
+ <v-card-text class="pt-6">
6
+ <div>
18
7
  <p>
19
- <ContentViewer v-model="computedDescription" />
8
+ {{
9
+ $t(
10
+ 'windward.core.components.utils.fill_in_the_blank.fill_in_blank_input.user_input',
11
+ [userInput]
12
+ )
13
+ }}
14
+ </p>
15
+ <p class="pb-0 mb-0">
16
+ {{
17
+ $t(
18
+ 'windward.core.components.utils.fill_in_the_blank.fill_in_blank_input.correct_answer',
19
+ [answer]
20
+ )
21
+ }}
20
22
  </p>
21
- </div>
22
- <div v-else-if="!answerIsCorrect && userInput">
23
- {{
24
- $t(
25
- 'windward.core.components.utils.fill_in_the_blank.fill_in_blank_input.input_incorrect',
26
- [userInput]
27
- )
28
- }}
29
23
  </div>
30
24
  </v-card-text>
31
25
  <v-card-actions>
@@ -37,31 +31,14 @@
37
31
  elevation="0"
38
32
  outlined
39
33
  @click="show = false"
40
- >
41
- {{
42
- answerIsCorrect
43
- ? $t(
44
- 'windward.core.components.utils.fill_in_the_blank.fill_in_blank_input.close'
45
- )
46
- : $t(
47
- 'windward.core.components.utils.fill_in_the_blank.fill_in_blank_input.try_again'
48
- )
49
- }}
50
- </v-btn>
51
- <v-btn
52
- color="primary"
53
- outlined
54
- elevation="0"
55
- @click="displayAnswer"
56
- v-if="!answerIsCorrect"
57
34
  >
58
35
  {{
59
36
  $t(
60
- 'windward.core.components.utils.fill_in_the_blank.fill_in_blank_input.answer'
37
+ 'windward.core.components.utils.fill_in_the_blank.fill_in_blank_input.close'
61
38
  )
62
39
  }}
63
- </v-btn></v-row
64
- >
40
+ </v-btn>
41
+ </v-row>
65
42
  </v-container>
66
43
  </v-card-actions>
67
44
  </v-card>
@@ -142,8 +119,16 @@ export default {
142
119
  computed: {
143
120
  answerIsCorrect() {
144
121
  if (
145
- _.replace(_.trim(_.toLower(this.answer)),new RegExp(' ','g'), '', ) ===
146
- _.replace(_.trim(_.toLower(this.userInput)),new RegExp(' ','g'), '', )
122
+ _.replace(
123
+ _.trim(_.toLower(this.answer)),
124
+ new RegExp(' ', 'g'),
125
+ ''
126
+ ) ===
127
+ _.replace(
128
+ _.trim(_.toLower(this.userInput)),
129
+ new RegExp(' ', 'g'),
130
+ ''
131
+ )
147
132
  ) {
148
133
  return true
149
134
  }
@@ -158,9 +143,6 @@ export default {
158
143
  }
159
144
  return ''
160
145
  },
161
- computedDescription() {
162
- return atob(this.description)
163
- },
164
146
  },
165
147
  methods: {
166
148
  setFocusAction() {
@@ -7,8 +7,9 @@
7
7
  "
8
8
  :data-cy="dataCy"
9
9
  >
10
- <label v-if="label" class="editor-label">{{ label }}</label>
11
-
10
+ <slot name="label" :render="render">
11
+ <label v-if="label" class="editor-label">{{ label }}</label>
12
+ </slot>
12
13
  <Editor
13
14
  :id="id"
14
15
  :key="seed + (isDarkTheme ? '-theme-dark' : '-theme-light')"
@@ -17,22 +18,18 @@
17
18
  :init="config"
18
19
  tag-name="div"
19
20
  model-events="change keydown blur focus mouseDown paste input submit SetContent"
20
- @onfocus="onEditorFocus"
21
- v-click-outside="{
22
- handler: onClickOutside,
23
- closeConditional,
24
- include,
25
- }"
26
21
  >
27
22
  </Editor>
28
23
 
29
- <label v-if="hint" class="editor-hint">{{ hint }}</label>
24
+ <slot name="hint" :render="render">
25
+ <label v-if="hint" class="editor-hint">{{ hint }}</label>
26
+ </slot>
30
27
  </div>
31
28
 
32
29
  <v-btn-toggle dense multiple class="pt-1 d-flex justify-end">
33
30
  <slot name="actions-prepend" :render="render"></slot>
34
31
  <slot name="actions" :render="render">
35
- <v-btn-toggle dense v-if="allowRead">
32
+ <v-btn-toggle v-if="allowRead" dense>
36
33
  <v-btn v-if="render" color="primary" outlined @click="read">
37
34
  <v-icon> mdi-play</v-icon>
38
35
  </v-btn>
@@ -48,19 +45,6 @@
48
45
  <v-icon> mdi-stop</v-icon>
49
46
  </v-btn>
50
47
  </v-btn-toggle>
51
-
52
- <v-btn
53
- v-if="render && !inline"
54
- color="primary"
55
- elevation="0"
56
- outlined
57
- @click="onClickOutside"
58
- >{{
59
- $t(
60
- 'windward.core.components.utils.tiny_mce_wrapper.minimize'
61
- )
62
- }}
63
- </v-btn>
64
48
  </slot>
65
49
  <slot name="actions-append" :render="render"></slot>
66
50
  </v-btn-toggle>
@@ -121,12 +105,14 @@ import 'tinymce/skins/ui/oxide-dark/content.js'
121
105
  import 'tinymce/skins/content/default/content.js'
122
106
  import 'tinymce/skins/content/dark/content.js'
123
107
 
108
+ import { Synthesizer } from 'speechreader'
109
+ import Crypto from '~/helpers/Crypto'
110
+ import MathHelper from '../../helpers/MathHelper'
124
111
  import { WindwardPlugins } from '../../helpers/tinymce/WindwardPlugins'
112
+
125
113
  import ContentCss from '!raw-loader!sass-loader!./assets/tinymce/content/global.scss'
126
114
  import EditorCss from '!raw-loader!sass-loader!./assets/tinymce/ui/global.scss'
127
- import Crypto from '~/helpers/Crypto'
128
- import MathHelper from '../../helpers/MathHelper'
129
- import { Synthesizer } from 'speechreader'
115
+
130
116
  export default {
131
117
  name: 'ContentEditorRichText',
132
118
  components: {
@@ -147,19 +133,12 @@ export default {
147
133
  default:
148
134
  'undo redo | styles | bold italic underline strikethrough removeformat | alignleft aligncenter alignright | table tablerowprops tablecellprops |bullist numlist outdent indent |glossaryButton fibFormatButton mathButton a11yButton',
149
135
  },
150
- root_block: { type: String, required: false, default: 'div' },
136
+ rootBlock: { type: String, required: false, default: 'div' },
151
137
  label: { type: String, required: false, default: '' },
152
138
  hint: { type: String, required: false, default: '' },
153
139
  inline: { type: Boolean, required: false, default: false },
154
140
  allowRead: { type: Boolean, required: false, default: false },
155
141
  },
156
- beforeMount() {
157
- if (MathHelper.containsLatex(this.value)) {
158
- this.text = MathHelper.wrapMathContentForTinyMCE(this.value)
159
- } else {
160
- this.text = this.value
161
- }
162
- },
163
142
  data() {
164
143
  return {
165
144
  render: false,
@@ -169,11 +148,7 @@ export default {
169
148
  paused: false,
170
149
  }
171
150
  },
172
- watch: {
173
- text: function (newVal) {
174
- this.$emit('input', this.text)
175
- },
176
- },
151
+
177
152
  computed: {
178
153
  dataCy() {
179
154
  return (
@@ -186,36 +161,12 @@ export default {
186
161
  isDarkTheme() {
187
162
  return this.$vuetify.theme.isDark
188
163
  },
189
- filteredMenubar() {
190
- if (this.render) {
191
- return this.menubar
192
- } else {
193
- return ''
194
- }
195
- },
196
- filteredToolbar() {
197
- if (this.render) {
198
- return this.toolbar
199
- } else {
200
- return ''
201
- }
202
- },
203
- filteredHeight() {
204
- if (!this.render) {
205
- return 100
206
- } else if (this.height !== null) {
207
- return this.height
208
- } else {
209
- return 500
210
- }
211
- },
212
164
  config() {
213
165
  return {
214
166
  draggable_modal: true,
215
- height: this.filteredHeight,
216
167
  visual: false,
217
- forced_root_block: this.root_block,
218
- menubar: this.filteredMenubar,
168
+ forced_root_block: this.rootBlock,
169
+ menubar: this.menubar,
219
170
  toolbar_mode: 'sliding',
220
171
  browser_spellcheck: true,
221
172
  contextmenu: false,
@@ -241,7 +192,11 @@ export default {
241
192
  items: ' bold italic underline strikethrough superscript subscript codeformat | formats align | language | removeformat',
242
193
  },
243
194
  },
195
+ autoresize_min_height: 100,
196
+ autoresize_max_height: 1000,
197
+ autoresize_bottom_margin: 0,
244
198
  plugins: [
199
+ 'autoresize',
245
200
  'advlist',
246
201
  'autolink',
247
202
  'lists',
@@ -257,8 +212,13 @@ export default {
257
212
  'wordcount',
258
213
  'table',
259
214
  'WindwardToolKit',
215
+ 'help',
260
216
  ],
261
- toolbar: this.filteredToolbar,
217
+ help_accessibility: true,
218
+ iframe_aria_text: this.$t(
219
+ 'windward.core.components.utils.tiny_mce_wrapper.aria_text'
220
+ ),
221
+ toolbar: this.toolbar,
262
222
  inline: this.inline,
263
223
  table_advtab: false,
264
224
  table_cell_advtab: false,
@@ -349,7 +309,6 @@ export default {
349
309
  }
350
310
  )
351
311
  },
352
-
353
312
  formats: {
354
313
  glossary: {
355
314
  inline: 'span',
@@ -477,6 +436,21 @@ export default {
477
436
  return []
478
437
  },
479
438
  },
439
+
440
+ watch: {
441
+ text: function (_newVal) {
442
+ this.$emit('input', this.text)
443
+ },
444
+ },
445
+
446
+ beforeMount() {
447
+ if (MathHelper.containsLatex(this.value)) {
448
+ this.text = MathHelper.wrapMathContentForTinyMCE(this.value)
449
+ } else {
450
+ this.text = this.value
451
+ }
452
+ },
453
+
480
454
  methods: {
481
455
  read() {
482
456
  if (this.paused) {
@@ -507,18 +481,6 @@ export default {
507
481
  this.paused = false
508
482
  }
509
483
  },
510
- onEditorFocus() {
511
- if (!this.render) {
512
- this.seed = Crypto.id()
513
- this.render = true
514
- }
515
- },
516
- onClickOutside() {
517
- if (this.render) {
518
- this.seed = Crypto.id()
519
- this.render = false
520
- }
521
- },
522
484
  include() {
523
485
  // vuetify function to include an element with this class into clickable area without close
524
486
  return this.elementBody
@@ -527,7 +489,7 @@ export default {
527
489
  closeConditional(e) {
528
490
  const targetClass = e.target.className
529
491
  let parentNode
530
- //check if target is svg element
492
+ // check if target is svg element
531
493
  if (e.target.matches('svg') || e.target instanceof SVGElement) {
532
494
  parentNode = e.target.parentNode.parentNode
533
495
  } else {
@@ -543,7 +505,6 @@ export default {
543
505
  ) {
544
506
  return false
545
507
  } else {
546
- this.onClickOutside()
547
508
  return true
548
509
  }
549
510
  },
@@ -1,6 +1,7 @@
1
1
  <template>
2
2
  <div
3
3
  class="glossary-word"
4
+ :class="{ active: show }"
4
5
  v-click-outside="onClickOutside"
5
6
  @click="show = !show"
6
7
  >
@@ -19,6 +20,7 @@
19
20
  <div>
20
21
  <div v-if="this.$slots['definition']">
21
22
  <h6 class="text-capitalize">
23
+ <slot name="term"></slot>
22
24
  {{
23
25
  $t(
24
26
  'windward.core.components.utils.tiny_mce_wrapper.definition'
@@ -32,6 +34,7 @@
32
34
  </div>
33
35
  <div v-if="this.$slots['alternate_forms']">
34
36
  <h4 class="text-capitalize">
37
+ <slot name="term"></slot>
35
38
  {{
36
39
  $t(
37
40
  'windward.core.components.utils.tiny_mce_wrapper.alternate_forms'
@@ -84,4 +87,7 @@ export default {
84
87
  font-weight: bold;
85
88
  color: var(--v-dark-text-base);
86
89
  }
90
+ .active {
91
+ background: var(--v-secondary-base) !important;
92
+ }
87
93
  </style>