@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.
- package/CHANGELOG.md +6 -0
- package/components/Content/Blocks/Accordion.vue +49 -39
- package/components/Content/Blocks/BlockQuote.vue +10 -1
- package/components/Content/Blocks/ClickableIcons.vue +55 -39
- package/components/Content/Blocks/Email.vue +11 -2
- package/components/Content/Blocks/FileDownload.vue +9 -1
- package/components/Content/Blocks/OpenResponse.vue +25 -12
- package/components/Content/Blocks/ScenarioChoice.vue +14 -5
- package/components/Content/Blocks/Tab.vue +15 -2
- package/components/Content/Blocks/UserUpload.vue +10 -1
- package/components/Content/Blocks/Video.vue +13 -4
- package/components/Navigation/Items/UserUploadNav.vue +4 -0
- package/components/Settings/AccordionSettings.vue +16 -30
- package/components/Settings/BlockQuoteSettings.vue +35 -48
- package/components/Settings/ClickableIconsSettings.vue +14 -27
- package/components/Settings/EmailSettings.vue +18 -28
- package/components/Settings/FileDownloadSettings.vue +14 -21
- package/components/Settings/OpenResponseSettings.vue +13 -27
- package/components/Settings/ScenarioChoiceSettings.vue +19 -29
- package/components/Settings/TabSettings.vue +22 -30
- package/components/Settings/TextEditorSettings.vue +1 -0
- package/components/Settings/UserUploadSettings.vue +12 -22
- package/components/Settings/VideoSettings.vue +12 -19
- package/components/utils/ContentViewer.vue +3 -0
- package/components/utils/FillInBlank/FillInBlankInput.vue +32 -28
- package/components/{Content/Blocks → utils}/GenerateAIQuestionButton.vue +117 -25
- package/components/utils/TinyMCEWrapper.vue +14 -57
- package/helpers/tinymce/WindwardPlugins.ts +36 -3
- package/models/Activity.ts +9 -0
- package/package.json +1 -1
- package/test/__mocks__/componentsMock.js +1 -0
- 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
|
-
|
|
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
|
-
|
|
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
|
/**
|
package/package.json
CHANGED
|
@@ -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/
|
|
10
|
+
import GenerateAIQuestionButton from '../components/utils/GenerateAIQuestionButton.vue'
|
|
11
11
|
|
|
12
12
|
export {
|
|
13
13
|
MathHelper,
|