@windward/core 0.8.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.
- package/.eslintrc.js +5 -1
- package/.prettierrc +3 -2
- package/components/Content/Blocks/ClickableIcons.vue +3 -9
- package/components/Content/Blocks/GenerateAIQuestionButton.vue +85 -18
- package/components/Content/Blocks/Image.vue +7 -182
- package/components/Content/Blocks/Tab.vue +10 -0
- package/components/Navigation/Items/GlossaryNav.vue +25 -10
- package/components/Settings/ImageSettings.vue +12 -240
- package/components/Settings/TabSettings.vue +17 -1
- package/components/utils/ContentViewer.vue +0 -3
- package/components/utils/FillInBlank/FillInBlankInput.vue +29 -47
- package/components/utils/TinyMCEWrapper.vue +36 -78
- package/components/utils/glossary/GlossaryToolTip.vue +6 -0
- package/helpers/tinymce/WindwardPlugins.ts +166 -118
- package/i18n/en-US/components/content/blocks/generate_questions.ts +3 -2
- package/i18n/en-US/components/utils/FillInBlank/FillInBlankInput.ts +2 -0
- package/i18n/en-US/components/utils/tiny_mce_wrapper.ts +1 -0
- package/i18n/es-ES/components/content/blocks/generate_questions.ts +2 -1
- package/i18n/es-ES/components/utils/FillInBlank/FillInBlankInput.ts +2 -0
- package/i18n/es-ES/components/utils/tiny_mce_wrapper.ts +3 -2
- package/i18n/sv-SE/components/content/blocks/generate_questions.ts +2 -1
- package/i18n/sv-SE/components/utils/FillInBlank/FillInBlankInput.ts +2 -0
- package/i18n/sv-SE/components/utils/tiny_mce_wrapper.ts +2 -0
- package/package.json +2 -1
- package/pages/glossary.vue +1 -1
- package/stylelint.config.js +14 -0
- package/test/Components/Content/Blocks/OpenResponseCollate.spec.js +3 -3
- package/test/Components/Settings/TabSettings.spec.js +2 -2
- package/test/__mocks__/contentBlockMock.js +20 -0
|
@@ -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>
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Scanner } from 'accessibility-scanner'
|
|
2
|
-
import local from '../../i18n/index'
|
|
3
2
|
import _ from 'lodash'
|
|
3
|
+
import local from '../../i18n/index'
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* Class representing the WindwardPlugins.
|
|
@@ -9,11 +9,9 @@ export class WindwardPlugins {
|
|
|
9
9
|
editor: any
|
|
10
10
|
formula: any
|
|
11
11
|
fillInBlank: any
|
|
12
|
-
private window: any
|
|
13
|
-
|
|
12
|
+
private window: any
|
|
14
13
|
|
|
15
14
|
constructor(editor: any) {
|
|
16
|
-
|
|
17
15
|
this.editor = editor
|
|
18
16
|
this.formula = undefined
|
|
19
17
|
this.fillInBlank = undefined
|
|
@@ -21,16 +19,18 @@ export class WindwardPlugins {
|
|
|
21
19
|
this.register()
|
|
22
20
|
}
|
|
23
21
|
|
|
24
|
-
public $t(key: string, replacements: string[]=[]): string {
|
|
25
|
-
const lang = local.messages[navigator
|
|
26
|
-
let str = _.get(lang, key)
|
|
22
|
+
public $t(key: string, replacements: string[] = []): string {
|
|
23
|
+
const lang = local.messages[_.get(navigator, 'languages[0]', 'en-US')] // Get the browser language
|
|
24
|
+
let str = _.get(lang, key) // Get the message string using lodash's get function
|
|
27
25
|
|
|
28
|
-
str = str.replace(
|
|
26
|
+
str = str.replace(
|
|
27
|
+
/{(\d+)}/g,
|
|
28
|
+
(match: any, number: any) => replacements[number] ?? match
|
|
29
|
+
)
|
|
29
30
|
|
|
30
|
-
return str
|
|
31
|
+
return str
|
|
31
32
|
}
|
|
32
33
|
|
|
33
|
-
|
|
34
34
|
/**
|
|
35
35
|
* registers an icon with the given icon name and SVG path.
|
|
36
36
|
*
|
|
@@ -40,18 +40,24 @@ export class WindwardPlugins {
|
|
|
40
40
|
* @return {void}
|
|
41
41
|
*/
|
|
42
42
|
private registerIcon(iconName: string, svgPath: string) {
|
|
43
|
-
this.editor.ui.registry.addIcon(
|
|
44
|
-
iconName,
|
|
45
|
-
svgPath
|
|
46
|
-
)
|
|
43
|
+
this.editor.ui.registry.addIcon(iconName, svgPath)
|
|
47
44
|
}
|
|
48
45
|
/**
|
|
49
46
|
* Adds icons to the editor's UI registry.
|
|
50
47
|
*/
|
|
51
48
|
private addIcons() {
|
|
52
|
-
this.registerIcon(
|
|
53
|
-
|
|
54
|
-
|
|
49
|
+
this.registerIcon(
|
|
50
|
+
'mathIcon',
|
|
51
|
+
'<svg x="0px" y="0px"width="20px" height="20px" viewBox="0 0 445.878 445.878" style="enable-background:new 0 0 445.878 445.878;"><path d="M426.024,86.447H209.705l-84.911,298.911c-2.568,7.967-9.854,13.482-18.22,13.771c-0.236,0-0.464,0.006-0.688,0.006 c-8.092,0-15.41-4.924-18.436-12.478l-34.714-86.782H19.851C8.884,299.876,0,290.986,0,280.022 c0-10.965,8.893-19.854,19.851-19.854H66.18c8.109,0,15.421,4.941,18.436,12.483l19.237,48.09l72.472-260.218 c2.639-8.213,10.279-13.781,18.903-13.781h230.798c10.97,0,19.854,8.89,19.854,19.851S436.988,86.447,426.024,86.447z M436.723,353.227l-78.259-87.904l74.576-82.783c1.318-1.454,1.638-3.547,0.857-5.341c-0.804-1.791-2.577-2.946-4.54-2.946h-47.18 c-1.442,0-2.802,0.629-3.759,1.72l-50.059,58.047l-49.674-58.029c-0.939-1.103-2.317-1.738-3.771-1.738h-49.334 c-1.956,0-3.729,1.149-4.521,2.929c-0.81,1.785 0.479,3.875,0.824,5.332l73.743,82.81l-77.641,87.923 c-1.297,1.465-1.605,3.552 0.813,5.325c0.813,1.785,2.586,2.92,4.528,2.92h48.9c1.472,0,2.867-0.65,3.807-1.785l51.819-62.181 l53.05,62.229c0.951,1.11,2.328,1.743,3.782,1.743h49.97c1.962,0,3.735-1.141,4.527-2.926 C438.354,356.779,438.035,354.692,436.723,353.227z"/></svg>'
|
|
52
|
+
)
|
|
53
|
+
this.registerIcon(
|
|
54
|
+
'fibIcon',
|
|
55
|
+
'<svg width="20px" height="20px" viewBox="0 0 24 24"><path d="M17,7H22V17H17V19A1,1 0 0,0 18,20H20V22H17.5C16.95,22 16,21.55 16,21C16,21.55 15.05,22 14.5,22H12V20H14A1,1 0 0,0 15,19V5A1,1 0 0,0 14,4H12V2H14.5C15.05,2 16,2.45 16,3C16,2.45 16.95,2 17.5,2H20V4H18A1,1 0 0,0 17,5V7M2,7H13V9H4V15H13V17H2V7M20,15V9H17V15H20Z" /></svg>'
|
|
56
|
+
)
|
|
57
|
+
this.registerIcon(
|
|
58
|
+
'glossaryIcon',
|
|
59
|
+
'<svg viewBox="0 0 24 24" width="20px" height="20px" ><path d="M3,15H1V3A2,2 0 0,1 3,1H19V3H3V15M12,23A1,1 0 0,1 11,22V19H7A2,2 0 0,1 5,17V7A2,2 0 0,1 7,5H21A2,2 0 0,1 23,7V17A2,2 0 0,1 21,19H16.9L13.2,22.71C13,22.89 12.76,23 12.5,23H12M9,9V11H19V9H9M9,13V15H17V13H9Z"></path></svg>'
|
|
60
|
+
)
|
|
55
61
|
}
|
|
56
62
|
/**
|
|
57
63
|
* Opens the equation editor window in the TinyMCE editor.
|
|
@@ -61,8 +67,8 @@ export class WindwardPlugins {
|
|
|
61
67
|
this.editor.addCommand('equation-window', (data: any) => {
|
|
62
68
|
return this.editor.windowManager.openUrl({
|
|
63
69
|
url: '/plugins/tinymce/math',
|
|
64
|
-
width: .75*this.window.innerWidth,
|
|
65
|
-
height: .9*this.window.innerHeight,
|
|
70
|
+
width: 0.75 * this.window.innerWidth,
|
|
71
|
+
height: 0.9 * this.window.innerHeight,
|
|
66
72
|
title: 'Equation editor',
|
|
67
73
|
buttons: [
|
|
68
74
|
{
|
|
@@ -79,7 +85,7 @@ export class WindwardPlugins {
|
|
|
79
85
|
if (data.currentTarget) {
|
|
80
86
|
this.editor.selection.select(data.currentTarget)
|
|
81
87
|
}
|
|
82
|
-
|
|
88
|
+
this.editor.selection.setContent(
|
|
83
89
|
` <span class='windward-math-content'>` +
|
|
84
90
|
this.formula +
|
|
85
91
|
`</span> `
|
|
@@ -95,7 +101,10 @@ export class WindwardPlugins {
|
|
|
95
101
|
this.formula = message.content
|
|
96
102
|
break
|
|
97
103
|
case 'math-plugin-mounted':
|
|
98
|
-
this.window.postMessage(
|
|
104
|
+
this.window.postMessage(
|
|
105
|
+
{ latex: data.latex ?? '' },
|
|
106
|
+
'*'
|
|
107
|
+
)
|
|
99
108
|
break
|
|
100
109
|
}
|
|
101
110
|
},
|
|
@@ -103,67 +112,77 @@ export class WindwardPlugins {
|
|
|
103
112
|
})
|
|
104
113
|
}
|
|
105
114
|
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
115
|
+
/**
|
|
116
|
+
* Adds custom buttons to the editor's user interface registry.
|
|
117
|
+
*/
|
|
118
|
+
private addButtons() {
|
|
119
|
+
this.addButtonToEditor(
|
|
120
|
+
'mathButton',
|
|
121
|
+
'mathIcon',
|
|
122
|
+
this.$t('windward.core.components.utils.tiny_mce_wrapper.math'),
|
|
123
|
+
() => {
|
|
124
|
+
this.editor.execCommand('equation-window', true)
|
|
125
|
+
}
|
|
126
|
+
)
|
|
127
|
+
this.addButtonToEditor(
|
|
128
|
+
'glossaryButton',
|
|
129
|
+
'glossaryIcon',
|
|
130
|
+
this.$t('windward.core.components.utils.tiny_mce_wrapper.glossary'),
|
|
131
|
+
() => {
|
|
132
|
+
this.editor.formatter.apply('glossary')
|
|
133
|
+
}
|
|
134
|
+
)
|
|
135
|
+
this.addButtonToEditor(
|
|
136
|
+
'fibInsertButton',
|
|
137
|
+
'fibIcon',
|
|
138
|
+
this.$t(
|
|
139
|
+
'windward.core.components.utils.tiny_mce_wrapper.fill_blank'
|
|
140
|
+
),
|
|
141
|
+
() => {
|
|
142
|
+
this.editor.execCommand('fib-window', true)
|
|
143
|
+
}
|
|
144
|
+
)
|
|
145
|
+
this.addButtonToEditor(
|
|
146
|
+
'fibFormatButton',
|
|
147
|
+
'fibIcon',
|
|
148
|
+
this.$t(
|
|
149
|
+
'windward.core.components.utils.tiny_mce_wrapper.fill_blank'
|
|
150
|
+
),
|
|
151
|
+
() => {
|
|
152
|
+
this.editor.formatter.apply('fib')
|
|
153
|
+
}
|
|
154
|
+
)
|
|
143
155
|
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
156
|
+
this.addButtonToEditor(
|
|
157
|
+
'a11yButton',
|
|
158
|
+
'accessibility-check',
|
|
159
|
+
this.$t(
|
|
160
|
+
'windward.core.components.utils.tiny_mce_wrapper.accessibility'
|
|
161
|
+
),
|
|
162
|
+
() => {
|
|
163
|
+
this.setAccessibilityIssues(this.editor)
|
|
164
|
+
}
|
|
165
|
+
)
|
|
166
|
+
}
|
|
153
167
|
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
168
|
+
/**
|
|
169
|
+
* Add a button to the editor's UI registry
|
|
170
|
+
* @param {string} name Name of the button
|
|
171
|
+
* @param {string} icon Icon name of the button
|
|
172
|
+
* @param {() => void} onAction Callback function for the action to be done when the button is clicked
|
|
173
|
+
*/
|
|
174
|
+
private addButtonToEditor(
|
|
175
|
+
name: string,
|
|
176
|
+
icon: string,
|
|
177
|
+
tooltip: string,
|
|
178
|
+
onAction: () => void
|
|
179
|
+
) {
|
|
180
|
+
this.editor.ui.registry.addButton(name, {
|
|
181
|
+
icon: icon,
|
|
182
|
+
tooltip: tooltip,
|
|
183
|
+
onAction: onAction,
|
|
184
|
+
})
|
|
185
|
+
}
|
|
167
186
|
/**
|
|
168
187
|
* Adds a menu item to the editor's UI registry.
|
|
169
188
|
*
|
|
@@ -173,14 +192,19 @@ export class WindwardPlugins {
|
|
|
173
192
|
* @param icon - The command to be executed on item click.
|
|
174
193
|
* @returns {void}
|
|
175
194
|
*/
|
|
176
|
-
private addEditorMenuItem(
|
|
195
|
+
private addEditorMenuItem(
|
|
196
|
+
itemKey: string,
|
|
197
|
+
itemText: string,
|
|
198
|
+
command: string,
|
|
199
|
+
icon: string
|
|
200
|
+
): void {
|
|
177
201
|
this.editor.ui.registry.addMenuItem(itemKey, {
|
|
178
202
|
text: itemText,
|
|
179
203
|
icon: icon,
|
|
180
204
|
onAction: () => {
|
|
181
205
|
this.editor.execCommand(command, true)
|
|
182
206
|
},
|
|
183
|
-
})
|
|
207
|
+
})
|
|
184
208
|
}
|
|
185
209
|
|
|
186
210
|
/**
|
|
@@ -188,8 +212,13 @@ export class WindwardPlugins {
|
|
|
188
212
|
* @returns {void}
|
|
189
213
|
*/
|
|
190
214
|
private addMenuItems() {
|
|
191
|
-
this.addEditorMenuItem('math', 'Math', 'equation-window','mathIcon')
|
|
192
|
-
this.addEditorMenuItem(
|
|
215
|
+
this.addEditorMenuItem('math', 'Math', 'equation-window', 'mathIcon')
|
|
216
|
+
this.addEditorMenuItem(
|
|
217
|
+
'FIB',
|
|
218
|
+
'Fill in the blank',
|
|
219
|
+
'fib-window',
|
|
220
|
+
'fibIcon'
|
|
221
|
+
)
|
|
193
222
|
}
|
|
194
223
|
|
|
195
224
|
/**
|
|
@@ -199,8 +228,7 @@ export class WindwardPlugins {
|
|
|
199
228
|
* @returns {void}
|
|
200
229
|
*/
|
|
201
230
|
private init() {
|
|
202
|
-
|
|
203
|
-
this.editor.on('init',()=>{
|
|
231
|
+
this.editor.on('init', () => {
|
|
204
232
|
this.setOnDoubleClickEquationContent(this.editor)
|
|
205
233
|
this.setOnClickFillInBlank(this.editor)
|
|
206
234
|
})
|
|
@@ -212,11 +240,10 @@ export class WindwardPlugins {
|
|
|
212
240
|
*
|
|
213
241
|
* @returns {void} This method does not return anything.
|
|
214
242
|
*/
|
|
215
|
-
|
|
216
|
-
this.editor.on('SetContent',
|
|
243
|
+
private setContent() {
|
|
244
|
+
this.editor.on('SetContent', () => {
|
|
217
245
|
this.setOnDoubleClickEquationContent(this.editor)
|
|
218
246
|
this.setOnClickFillInBlank(this.editor)
|
|
219
|
-
|
|
220
247
|
})
|
|
221
248
|
}
|
|
222
249
|
|
|
@@ -224,8 +251,8 @@ export class WindwardPlugins {
|
|
|
224
251
|
* Adds event listeners for handling input events.
|
|
225
252
|
* @return {void}
|
|
226
253
|
*/
|
|
227
|
-
|
|
228
|
-
this.editor.on('input', () =>{
|
|
254
|
+
setInputEvents() {
|
|
255
|
+
this.editor.on('input', () => {
|
|
229
256
|
this.setOnDoubleClickEquationContent(this.editor)
|
|
230
257
|
this.setOnClickFillInBlank(this.editor)
|
|
231
258
|
})
|
|
@@ -262,11 +289,13 @@ export class WindwardPlugins {
|
|
|
262
289
|
* Opens a fill in the blank window in the TinyMCE editor.
|
|
263
290
|
* @return {void}
|
|
264
291
|
*/
|
|
265
|
-
fillInBlankWindow()
|
|
266
|
-
this.editor.addCommand('fib-window',
|
|
292
|
+
fillInBlankWindow() {
|
|
293
|
+
this.editor.addCommand('fib-window', (data: any) => {
|
|
267
294
|
return this.editor.windowManager.openUrl({
|
|
268
295
|
url: '/plugins/tinymce/FIB',
|
|
269
|
-
title: this.$t(
|
|
296
|
+
title: this.$t(
|
|
297
|
+
'windward.core.components.utils.tiny_mce_wrapper.fill_blank'
|
|
298
|
+
),
|
|
270
299
|
buttons: [
|
|
271
300
|
{
|
|
272
301
|
type: 'cancel',
|
|
@@ -284,10 +313,10 @@ export class WindwardPlugins {
|
|
|
284
313
|
}
|
|
285
314
|
this.editor.selection.setContent(
|
|
286
315
|
`<span class='windward-fill-blank' data-feedback =` +
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
316
|
+
this.fillInBlank.feedback +
|
|
317
|
+
` >` +
|
|
318
|
+
this.fillInBlank.answer +
|
|
319
|
+
`</span>`
|
|
291
320
|
)
|
|
292
321
|
|
|
293
322
|
this.editor.windowManager.close()
|
|
@@ -304,7 +333,10 @@ export class WindwardPlugins {
|
|
|
304
333
|
break
|
|
305
334
|
case 'fib-plugin-mounted':
|
|
306
335
|
this.window.parent.postMessage(
|
|
307
|
-
{
|
|
336
|
+
{
|
|
337
|
+
answer: data.answer,
|
|
338
|
+
feedback: data.feedback,
|
|
339
|
+
},
|
|
308
340
|
'*'
|
|
309
341
|
)
|
|
310
342
|
break
|
|
@@ -343,28 +375,45 @@ export class WindwardPlugins {
|
|
|
343
375
|
}
|
|
344
376
|
}
|
|
345
377
|
|
|
346
|
-
|
|
347
378
|
setAccessibilityIssues(editor: any) {
|
|
348
|
-
const tinymceDoc = editor.getDoc()
|
|
349
|
-
tinymceDoc
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
379
|
+
const tinymceDoc = editor.getDoc()
|
|
380
|
+
tinymceDoc
|
|
381
|
+
.querySelectorAll('p.a11y-error')
|
|
382
|
+
.forEach((el: any) => el.remove())
|
|
383
|
+
tinymceDoc
|
|
384
|
+
.querySelectorAll('.a11y-error--highlight')
|
|
385
|
+
.forEach((el: any) => el.classList.remove('a11y-error--highlight'))
|
|
386
|
+
const scanner = Scanner.fromHtmlText(editor.getContent())
|
|
387
|
+
const report = scanner.runScan()
|
|
353
388
|
report.forEach((lineItem: any) => {
|
|
354
|
-
lineItem.issues.forEach((item) => {
|
|
355
|
-
let elements = Array.prototype
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
elements.
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
389
|
+
lineItem.issues.forEach((item: any) => {
|
|
390
|
+
let elements = Array.prototype.slice.call(
|
|
391
|
+
tinymceDoc.getElementsByTagName(item.tagName)
|
|
392
|
+
)
|
|
393
|
+
elements = elements.filter(
|
|
394
|
+
(res) => res.outerHTML === item.outerHTML
|
|
395
|
+
)
|
|
396
|
+
// only get the element that are on report
|
|
397
|
+
elements.forEach((element) => {
|
|
398
|
+
element.classList.add('a11y-error--highlight')
|
|
399
|
+
element.outerHTML =
|
|
400
|
+
element.outerHTML +
|
|
401
|
+
'<p class="a11y-error" ><em>' +
|
|
402
|
+
this.$t(
|
|
403
|
+
'windward.core.components.utils.tiny_mce_wrapper.' +
|
|
404
|
+
lineItem.key
|
|
405
|
+
) +
|
|
406
|
+
' ' +
|
|
407
|
+
this.$t(
|
|
408
|
+
'windward.core.components.utils.tiny_mce_wrapper.wcag_guidelines',
|
|
409
|
+
[lineItem.success_criterion]
|
|
410
|
+
) +
|
|
411
|
+
'.</em></p>'
|
|
412
|
+
})
|
|
413
|
+
})
|
|
414
|
+
})
|
|
365
415
|
}
|
|
366
416
|
|
|
367
|
-
|
|
368
417
|
/**
|
|
369
418
|
* Registers the application, initializing necessary components and setting up the user interface.
|
|
370
419
|
*
|
|
@@ -381,4 +430,3 @@ export class WindwardPlugins {
|
|
|
381
430
|
this.init()
|
|
382
431
|
}
|
|
383
432
|
}
|
|
384
|
-
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
export default {
|
|
2
2
|
accessibility: 'Accesibilidad',
|
|
3
|
+
aria_text:
|
|
4
|
+
'Presione ALT + F10 o fn + opción + F10 para acceder a la barra de herramientas.',
|
|
3
5
|
glossary: 'Glosario',
|
|
4
6
|
term: 'Término del glosario',
|
|
5
7
|
alternate_forms: 'Formas alternativas',
|
|
@@ -25,6 +27,5 @@ export default {
|
|
|
25
27
|
wcag_guidelines: '(Directrices WCAG {0})',
|
|
26
28
|
link_href_missing:
|
|
27
29
|
'El Elemento HTML Anchor <a> debe contener un atributo href',
|
|
28
|
-
link_text_missing:
|
|
29
|
-
'El Elemento HTML Anchor <a> debe contener texto. ',
|
|
30
|
+
link_text_missing: 'El Elemento HTML Anchor <a> debe contener texto. ',
|
|
30
31
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@windward/core",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.9.0",
|
|
4
4
|
"description": "Windward UI Core Plugins",
|
|
5
5
|
"main": "plugin.js",
|
|
6
6
|
"scripts": {
|
|
@@ -38,6 +38,7 @@
|
|
|
38
38
|
"@babel/preset-env": "^7.16.11",
|
|
39
39
|
"@mindedge/vue-api-query": "^1.14.0",
|
|
40
40
|
"@nuxtjs/axios": "^5.13.6",
|
|
41
|
+
"@nuxtjs/eslint-config-typescript": "^12.1.0",
|
|
41
42
|
"@types/lodash": "^4.14.180",
|
|
42
43
|
"@vue/cli-plugin-babel": "^5.0.4",
|
|
43
44
|
"@vue/cli-plugin-typescript": "^5.0.4",
|
package/pages/glossary.vue
CHANGED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
module.exports = {
|
|
2
|
+
extends: ['stylelint-config-standard', 'stylelint-config-prettier'],
|
|
3
|
+
// add your custom config here
|
|
4
|
+
// https://stylelint.io/user-guide/configure
|
|
5
|
+
rules: {
|
|
6
|
+
'at-rule-no-unknown': null,
|
|
7
|
+
'selector-pseudo-element-no-unknown': [
|
|
8
|
+
true,
|
|
9
|
+
{
|
|
10
|
+
ignorePseudoElements: ['v-deep'],
|
|
11
|
+
},
|
|
12
|
+
],
|
|
13
|
+
},
|
|
14
|
+
}
|
|
@@ -2,13 +2,13 @@ import { shallowMount } from '@vue/test-utils'
|
|
|
2
2
|
import Vue from 'vue'
|
|
3
3
|
import Vuetify from 'vuetify'
|
|
4
4
|
import { defaultMocks } from '@/test/mocks'
|
|
5
|
-
import
|
|
5
|
+
import OpenResponseCollate from '@/components/Content/Blocks/OpenResponseCollate.vue'
|
|
6
6
|
|
|
7
7
|
Vue.use(Vuetify)
|
|
8
8
|
|
|
9
|
-
describe('
|
|
9
|
+
describe('OpenResponseCollate content block component', () => {
|
|
10
10
|
test('is a Vue instance', () => {
|
|
11
|
-
const wrapper = shallowMount(
|
|
11
|
+
const wrapper = shallowMount(OpenResponseCollate, {
|
|
12
12
|
vuetify: new Vuetify(),
|
|
13
13
|
mocks: defaultMocks,
|
|
14
14
|
propsData: {
|
|
@@ -27,8 +27,8 @@ describe('TabSettings', () => {
|
|
|
27
27
|
})
|
|
28
28
|
wrapper.vm.onAddElement()
|
|
29
29
|
expect(wrapper.vm.$data.block.metadata.config.items).toEqual([
|
|
30
|
-
{ tabHeader: '', expand: false, content: '' },
|
|
31
|
-
{ tabHeader: '', expand: false, content: '' },
|
|
30
|
+
{ tabHeader: '', expand: false, content: '', imageAsset: null },
|
|
31
|
+
{ tabHeader: '', expand: false, content: '', imageAsset: null },
|
|
32
32
|
])
|
|
33
33
|
})
|
|
34
34
|
|
|
@@ -20,6 +20,26 @@ jest.mock(
|
|
|
20
20
|
{ virtual: true }
|
|
21
21
|
)
|
|
22
22
|
|
|
23
|
+
jest.mock(
|
|
24
|
+
'~/components/Content/ImageAssetViewer.vue',
|
|
25
|
+
() => {
|
|
26
|
+
return jest.fn().mockImplementation(() => {
|
|
27
|
+
return { test: () => {} }
|
|
28
|
+
})
|
|
29
|
+
},
|
|
30
|
+
{ virtual: true }
|
|
31
|
+
)
|
|
32
|
+
|
|
33
|
+
jest.mock(
|
|
34
|
+
'~/components/Content/Settings/ImageAssetSettings.vue',
|
|
35
|
+
() => {
|
|
36
|
+
return jest.fn().mockImplementation(() => {
|
|
37
|
+
return { test: () => {} }
|
|
38
|
+
})
|
|
39
|
+
},
|
|
40
|
+
{ virtual: true }
|
|
41
|
+
)
|
|
42
|
+
|
|
23
43
|
jest.mock(
|
|
24
44
|
'~/components/Content/Blocks/BaseContentBlock',
|
|
25
45
|
() => {
|