@windward/core 0.4.0 → 0.4.2
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/components/Content/Blocks/BlockQuote.vue +2 -2
- package/components/Content/Blocks/ClickableIcons.vue +1 -1
- package/components/Content/Blocks/Email.vue +10 -6
- package/components/Content/Blocks/Feedback.vue +12 -5
- package/components/Content/Blocks/Image.vue +2 -2
- package/components/Content/Blocks/OpenResponse.vue +7 -3
- package/components/Content/Blocks/OpenResponseCollate.vue +1 -1
- package/components/Content/Blocks/ScenarioChoice.vue +2 -2
- package/components/Content/Blocks/UserUpload/DisplayUserFilesTable.vue +2 -0
- package/components/Content/Blocks/UserUpload.vue +1 -0
- package/components/Content/Blocks/Video.vue +2 -2
- package/components/Navigation/Items/AskTheExpert.vue +1 -0
- package/components/Settings/AccordionSettings.vue +2 -0
- package/components/Settings/ClickableIconsSettings.vue +5 -1
- package/components/Settings/EmailSettings.vue +6 -1
- package/components/Settings/FeedbackSettings.vue +1 -0
- package/components/Settings/ImageSettings.vue +7 -8
- package/components/Settings/MathSettings.vue +1 -1
- package/components/Settings/ScenarioChoiceSettings.vue +1 -0
- package/components/Settings/TabSettings.vue +7 -1
- package/components/Settings/TextEditorSettings.vue +4 -2
- package/components/Settings/UserUploadSettings.vue +1 -1
- package/components/Settings/VideoSettings.vue +2 -0
- package/components/utils/FillInBlank/FillInBlankInput.vue +3 -0
- package/components/utils/MathExpressionEditor.vue +89 -56
- package/components/utils/MathLiveWrapper.vue +47 -25
- package/components/utils/TinyMCEWrapper.vue +107 -18
- package/components/utils/assets/tinymce/ui/dark/skin.scss +1 -1
- package/components/utils/assets/tinymce/ui/light/skin.scss +1 -1
- package/components/utils/glossary/CourseGlossary.vue +2 -0
- package/config/tinymce.config.ts +19 -19
- package/helpers/MathHelper.ts +59 -0
- package/helpers/tinymce/WindwardPlugins.ts +335 -0
- package/i18n/en-US/components/settings/image.ts +2 -0
- package/i18n/en-US/components/utils/math_expression_editor.ts +4 -3
- package/i18n/en-US/components/utils/tiny_mce_wrapper.ts +1 -0
- package/i18n/es-ES/components/settings/image.ts +2 -0
- package/i18n/es-ES/components/utils/math_expression_editor.ts +2 -1
- package/i18n/es-ES/components/utils/tiny_mce_wrapper.ts +1 -0
- package/i18n/sv-SE/components/settings/image.ts +2 -0
- package/i18n/sv-SE/components/utils/math_expression_editor.ts +1 -0
- package/i18n/sv-SE/components/utils/tiny_mce_wrapper.ts +1 -0
- package/package.json +3 -2
- package/test/helpers/MathHelper.spec.js +14 -1
- package/tsconfig.json +4 -1
- package/helpers/tinymce/plugin.ts +0 -210
|
@@ -7,9 +7,9 @@
|
|
|
7
7
|
"
|
|
8
8
|
>
|
|
9
9
|
<v-col cols="12" class="pb-0">
|
|
10
|
-
<
|
|
10
|
+
<h2 v-if="block.metadata.config.title">
|
|
11
11
|
{{ block.metadata.config.title }}
|
|
12
|
-
</
|
|
12
|
+
</h2>
|
|
13
13
|
<p v-if="block.metadata.config.instructions" class="pb-0 mb-0">
|
|
14
14
|
{{ block.metadata.config.instructions }}
|
|
15
15
|
</p>
|
|
@@ -7,9 +7,9 @@
|
|
|
7
7
|
"
|
|
8
8
|
>
|
|
9
9
|
<v-col cols="12" class="pa-0">
|
|
10
|
-
<
|
|
10
|
+
<h2 v-if="block.metadata.config.title">
|
|
11
11
|
{{ block.metadata.config.title }}
|
|
12
|
-
</
|
|
12
|
+
</h2>
|
|
13
13
|
<p v-if="block.metadata.config.instructions" class="pb-0 mb-0">
|
|
14
14
|
{{ block.metadata.config.instructions }}
|
|
15
15
|
</p>
|
|
@@ -170,7 +170,7 @@
|
|
|
170
170
|
>
|
|
171
171
|
<v-row class="pt-4">
|
|
172
172
|
<v-col cols="10" class="pa-0">
|
|
173
|
-
<v-btn color="primary" text>
|
|
173
|
+
<v-btn elevation="0" color="primary" text>
|
|
174
174
|
<v-icon>mdi-reply</v-icon>
|
|
175
175
|
{{
|
|
176
176
|
$t(
|
|
@@ -178,7 +178,7 @@
|
|
|
178
178
|
)
|
|
179
179
|
}}</v-btn
|
|
180
180
|
>
|
|
181
|
-
<v-btn color="primary" text>
|
|
181
|
+
<v-btn elevation="0" color="primary" text>
|
|
182
182
|
<v-icon>mdi-reply-all</v-icon>
|
|
183
183
|
{{
|
|
184
184
|
$t(
|
|
@@ -186,7 +186,7 @@
|
|
|
186
186
|
)
|
|
187
187
|
}}</v-btn
|
|
188
188
|
>
|
|
189
|
-
<v-btn color="primary" text>
|
|
189
|
+
<v-btn elevation="0" color="primary" text>
|
|
190
190
|
<v-icon>mdi-share</v-icon>
|
|
191
191
|
{{
|
|
192
192
|
$t(
|
|
@@ -196,7 +196,11 @@
|
|
|
196
196
|
>
|
|
197
197
|
</v-col>
|
|
198
198
|
<v-col cols="2" class="pa-0 d-flex justify-end">
|
|
199
|
-
<v-btn
|
|
199
|
+
<v-btn
|
|
200
|
+
elevation="0"
|
|
201
|
+
color="primary"
|
|
202
|
+
outlined
|
|
203
|
+
>
|
|
200
204
|
{{
|
|
201
205
|
$t(
|
|
202
206
|
'windward.core.components.content.blocks.email.reset'
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
<v-container>
|
|
3
3
|
<v-container v-if="!doesFeedbackExist">
|
|
4
4
|
<v-row>
|
|
5
|
-
<
|
|
5
|
+
<h2>
|
|
6
6
|
{{
|
|
7
7
|
block.metadata.config.definition.name
|
|
8
8
|
? block.metadata.config.definition.name
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
'windward.core.components.content.blocks.feedback.feedback'
|
|
11
11
|
)
|
|
12
12
|
}}
|
|
13
|
-
</
|
|
13
|
+
</h2>
|
|
14
14
|
</v-row>
|
|
15
15
|
<v-row class="pt-2">
|
|
16
16
|
<p>
|
|
@@ -92,15 +92,22 @@
|
|
|
92
92
|
<v-btn
|
|
93
93
|
color="primary"
|
|
94
94
|
outlined
|
|
95
|
+
elevation="0"
|
|
95
96
|
class="text-center mt-4 mr-2"
|
|
96
97
|
@click="onReset()"
|
|
97
98
|
>{{
|
|
98
99
|
$t('windward.core.components.content.blocks.feedback.reset')
|
|
99
100
|
}}</v-btn
|
|
100
101
|
>
|
|
101
|
-
<v-btn
|
|
102
|
-
|
|
103
|
-
|
|
102
|
+
<v-btn
|
|
103
|
+
elevation="0"
|
|
104
|
+
color="success"
|
|
105
|
+
class="text-center mt-4"
|
|
106
|
+
@click="validate"
|
|
107
|
+
>{{
|
|
108
|
+
$t('windward.core.components.content.blocks.feedback.save')
|
|
109
|
+
}}</v-btn
|
|
110
|
+
>
|
|
104
111
|
</v-row>
|
|
105
112
|
<v-form
|
|
106
113
|
ref="form"
|
|
@@ -124,7 +124,7 @@ export default {
|
|
|
124
124
|
altText() {
|
|
125
125
|
// Get the asset info first and fallback to the block metadata if inherit is set to false
|
|
126
126
|
if (_.get(this.block.metadata, 'config.inherit', true)) {
|
|
127
|
-
return _.get(this.fileAsset, 'metadata.props.alt', null)
|
|
127
|
+
return _.get(this.fileAsset, 'asset.metadata.props.alt', null)
|
|
128
128
|
} else {
|
|
129
129
|
return _.get(this.block.metadata, 'config.alt', null)
|
|
130
130
|
}
|
|
@@ -134,7 +134,7 @@ export default {
|
|
|
134
134
|
if (_.get(this.block.metadata, 'config.inherit', true)) {
|
|
135
135
|
return _.get(
|
|
136
136
|
this.fileAsset,
|
|
137
|
-
'metadata.props.aria_describedby',
|
|
137
|
+
'asset.metadata.props.aria_describedby',
|
|
138
138
|
null
|
|
139
139
|
)
|
|
140
140
|
} else {
|
|
@@ -11,6 +11,7 @@
|
|
|
11
11
|
<p class="pa-3 text-center blue-grey lighten-5">
|
|
12
12
|
<v-btn
|
|
13
13
|
color="primary"
|
|
14
|
+
elevation="0"
|
|
14
15
|
:disabled="!canSubmit"
|
|
15
16
|
@click="onSubmit"
|
|
16
17
|
>
|
|
@@ -47,9 +48,12 @@
|
|
|
47
48
|
</v-alert>
|
|
48
49
|
</div>
|
|
49
50
|
<p class="pa-3 text-center blue-grey lighten-5">
|
|
50
|
-
<v-btn
|
|
51
|
-
|
|
52
|
-
|
|
51
|
+
<v-btn
|
|
52
|
+
elevation="0"
|
|
53
|
+
color="primary"
|
|
54
|
+
@click="submitted = false"
|
|
55
|
+
>{{ $t('shared.forms.edit') }}</v-btn
|
|
56
|
+
>
|
|
53
57
|
</p>
|
|
54
58
|
</div>
|
|
55
59
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div>
|
|
3
3
|
<v-container>
|
|
4
|
-
<
|
|
4
|
+
<h2>{{ block.metadata.config.title }}</h2>
|
|
5
5
|
<h4>{{ block.metadata.config.description }}</h4>
|
|
6
6
|
<p>
|
|
7
7
|
{{
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
v-if="choiceIndex !== null && block.metadata.config.show_reset"
|
|
15
15
|
class="text-right"
|
|
16
16
|
>
|
|
17
|
-
<v-btn color="primary" outlined @click="onClickReset">
|
|
17
|
+
<v-btn elevation="0" color="primary" outlined @click="onClickReset">
|
|
18
18
|
{{
|
|
19
19
|
$t(
|
|
20
20
|
'windward.core.components.content.blocks.scenario_choice.try_again'
|
|
@@ -21,9 +21,9 @@
|
|
|
21
21
|
type="image, image, list-item-avatar"
|
|
22
22
|
class="reload-skeleton"
|
|
23
23
|
></v-skeleton-loader>
|
|
24
|
-
<
|
|
24
|
+
<h2 v-if="block.metadata.config.title" class="pl-4">
|
|
25
25
|
{{ block.metadata.config.title }}
|
|
26
|
-
</
|
|
26
|
+
</h2>
|
|
27
27
|
<VuetifyPlayer
|
|
28
28
|
v-if="hasSource"
|
|
29
29
|
:language="$i18n && $i18n.locale ? $i18n.locale : 'en-US'"
|
|
@@ -40,6 +40,7 @@
|
|
|
40
40
|
></v-text-field>
|
|
41
41
|
<v-btn
|
|
42
42
|
text
|
|
43
|
+
elevation="0"
|
|
43
44
|
:disabled="render"
|
|
44
45
|
@click="
|
|
45
46
|
onToggleExpand(
|
|
@@ -134,6 +135,7 @@
|
|
|
134
135
|
<v-row justify="center" class="my-4">
|
|
135
136
|
<v-btn
|
|
136
137
|
color="primary"
|
|
138
|
+
elevation="0"
|
|
137
139
|
:disabled="render"
|
|
138
140
|
@click="onAddElement"
|
|
139
141
|
><v-icon>mdi-plus</v-icon
|
|
@@ -201,7 +201,11 @@
|
|
|
201
201
|
</SortableExpansionPanel>
|
|
202
202
|
</v-col>
|
|
203
203
|
<v-row justify="center" class="my-4">
|
|
204
|
-
<v-btn
|
|
204
|
+
<v-btn
|
|
205
|
+
color="primary"
|
|
206
|
+
elevation="0"
|
|
207
|
+
:disabled="render"
|
|
208
|
+
@click="onAddElement"
|
|
205
209
|
><v-icon>mdi-plus</v-icon
|
|
206
210
|
>{{ $t('shared.forms.add') }}</v-btn
|
|
207
211
|
>
|
|
@@ -85,6 +85,7 @@
|
|
|
85
85
|
index
|
|
86
86
|
)
|
|
87
87
|
"
|
|
88
|
+
elevation="0"
|
|
88
89
|
text
|
|
89
90
|
:disabled="render"
|
|
90
91
|
>
|
|
@@ -125,7 +126,11 @@
|
|
|
125
126
|
</v-container>
|
|
126
127
|
<v-container class="pa-0">
|
|
127
128
|
<v-row justify="center" class="my-4">
|
|
128
|
-
<v-btn
|
|
129
|
+
<v-btn
|
|
130
|
+
color="primary"
|
|
131
|
+
elevation="0"
|
|
132
|
+
:disabled="render"
|
|
133
|
+
@click="onAddElement"
|
|
129
134
|
><v-icon>mdi-plus</v-icon
|
|
130
135
|
>{{
|
|
131
136
|
$t('windward.core.components.settings.email.add')
|
|
@@ -4,18 +4,17 @@
|
|
|
4
4
|
mimes="image/jpeg,image/png,image/gif"
|
|
5
5
|
v-model="block.metadata.config.asset"
|
|
6
6
|
class="mb-4"
|
|
7
|
+
:label="
|
|
8
|
+
$t(
|
|
9
|
+
'windward.core.components.settings.image.current_image_file'
|
|
10
|
+
) + ':'
|
|
11
|
+
"
|
|
7
12
|
:disabled="render"
|
|
13
|
+
:assets.sync="block.assets"
|
|
8
14
|
@click:file="onFileSelect"
|
|
9
15
|
>
|
|
10
16
|
<template #title>
|
|
11
|
-
{{ $t('windward.core.components.
|
|
12
|
-
</template>
|
|
13
|
-
<template #description>
|
|
14
|
-
{{
|
|
15
|
-
$t(
|
|
16
|
-
'windward.core.components.content.blocks.image.description'
|
|
17
|
-
)
|
|
18
|
-
}}
|
|
17
|
+
{{ $t('windward.core.components.settings.image.place_image') }}
|
|
19
18
|
</template>
|
|
20
19
|
</ContentBlockAsset>
|
|
21
20
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div>
|
|
3
3
|
<br />
|
|
4
|
-
<v-btn :disabled="render" @click="onToggleExpand" text class="mb-2">
|
|
4
|
+
<v-btn elevation="0" :disabled="render" @click="onToggleExpand" text class="mb-2">
|
|
5
5
|
<v-icon v-if="!block.metadata.config.expand" color="primary"
|
|
6
6
|
>mdi-arrow-expand-all</v-icon
|
|
7
7
|
>
|
|
@@ -34,6 +34,7 @@
|
|
|
34
34
|
<v-btn
|
|
35
35
|
@click="onToggleExpand(index)"
|
|
36
36
|
text
|
|
37
|
+
elevation="0"
|
|
37
38
|
class="mb-3"
|
|
38
39
|
:disabled="render"
|
|
39
40
|
>
|
|
@@ -61,7 +62,12 @@
|
|
|
61
62
|
</template>
|
|
62
63
|
</SortableExpansionPanel>
|
|
63
64
|
<v-row justify="center" class="my-4">
|
|
64
|
-
<v-btn
|
|
65
|
+
<v-btn
|
|
66
|
+
color="primary"
|
|
67
|
+
elevation="0"
|
|
68
|
+
:disabled="render"
|
|
69
|
+
@click="onAddElement"
|
|
70
|
+
>
|
|
65
71
|
<v-icon>mdi-plus</v-icon>
|
|
66
72
|
{{ $t('windward.core.components.settings.tab.add_tab') }}
|
|
67
73
|
</v-btn>
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
<v-btn-toggle v-model="settingSelector" multiple borderless>
|
|
6
6
|
<v-tooltip top>
|
|
7
7
|
<template #activator="{ on, attrs }">
|
|
8
|
-
<v-btn v-bind="attrs" v-on="on" text :disabled="render">
|
|
8
|
+
<v-btn elevation="0" v-bind="attrs" v-on="on" text :disabled="render">
|
|
9
9
|
<v-icon>mdi-comment-text-multiple</v-icon>
|
|
10
10
|
{{
|
|
11
11
|
$t(
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
|
|
26
26
|
<v-tooltip top>
|
|
27
27
|
<template #activator="{ on, attrs }">
|
|
28
|
-
<v-btn v-bind="attrs" v-on="on" text :disabled="render">
|
|
28
|
+
<v-btn elevation="0" v-bind="attrs" v-on="on" text :disabled="render">
|
|
29
29
|
<v-icon> mdi-text-long</v-icon>
|
|
30
30
|
{{
|
|
31
31
|
$t(
|
|
@@ -48,6 +48,7 @@
|
|
|
48
48
|
<v-btn
|
|
49
49
|
v-bind="attrs"
|
|
50
50
|
v-on="on"
|
|
51
|
+
elevation="0"
|
|
51
52
|
text
|
|
52
53
|
:disabled="render"
|
|
53
54
|
@click="
|
|
@@ -148,6 +149,7 @@
|
|
|
148
149
|
v-model="block.body"
|
|
149
150
|
autofill
|
|
150
151
|
:disabled="render"
|
|
152
|
+
allow-read
|
|
151
153
|
></TextEditor>
|
|
152
154
|
<v-skeleton-loader
|
|
153
155
|
v-bind="attrs"
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
"
|
|
23
23
|
:disabled="render"
|
|
24
24
|
></v-select>
|
|
25
|
-
<v-btn text class="mt-4" :disabled="render" @click="onToggleExpand()">
|
|
25
|
+
<v-btn elevation="0" text class="mt-4" :disabled="render" @click="onToggleExpand()">
|
|
26
26
|
<v-icon v-if="!block.metadata.config.expand" color="primary"
|
|
27
27
|
>mdi-arrow-expand-all</v-icon
|
|
28
28
|
>
|
|
@@ -273,6 +273,7 @@
|
|
|
273
273
|
v-bind="attrs"
|
|
274
274
|
v-on="on"
|
|
275
275
|
text
|
|
276
|
+
elevation="0"
|
|
276
277
|
color="error"
|
|
277
278
|
:disabled="
|
|
278
279
|
render ||
|
|
@@ -302,6 +303,7 @@
|
|
|
302
303
|
<v-btn
|
|
303
304
|
v-bind="attrs"
|
|
304
305
|
v-on="on"
|
|
306
|
+
elevation="0"
|
|
305
307
|
color="primary"
|
|
306
308
|
text
|
|
307
309
|
:disabled="render"
|
|
@@ -34,6 +34,7 @@
|
|
|
34
34
|
><v-btn
|
|
35
35
|
ref="action_button_1"
|
|
36
36
|
color="primary"
|
|
37
|
+
elevation="0"
|
|
37
38
|
outlined
|
|
38
39
|
@click="show = false"
|
|
39
40
|
>
|
|
@@ -50,6 +51,7 @@
|
|
|
50
51
|
<v-btn
|
|
51
52
|
color="primary"
|
|
52
53
|
outlined
|
|
54
|
+
elevation="0"
|
|
53
55
|
@click="displayAnswer"
|
|
54
56
|
v-if="!answerIsCorrect"
|
|
55
57
|
>
|
|
@@ -92,6 +94,7 @@
|
|
|
92
94
|
<v-btn
|
|
93
95
|
v-if="userInput && userInput.length > 0"
|
|
94
96
|
@click="toggleToolTip"
|
|
97
|
+
elevation="0"
|
|
95
98
|
color="primary"
|
|
96
99
|
outlined
|
|
97
100
|
:aria-label="
|
|
@@ -25,6 +25,11 @@
|
|
|
25
25
|
>
|
|
26
26
|
{{ $tc(keyboard.name, keyboard.buttons.length) }}
|
|
27
27
|
</v-tab>
|
|
28
|
+
<v-tab>{{
|
|
29
|
+
$t(
|
|
30
|
+
'windward.core.components.utils.math_expression_editor.accessibility'
|
|
31
|
+
)
|
|
32
|
+
}}</v-tab>
|
|
28
33
|
</v-tabs>
|
|
29
34
|
|
|
30
35
|
<v-tabs-items v-model="tab">
|
|
@@ -50,8 +55,64 @@
|
|
|
50
55
|
</div>
|
|
51
56
|
</v-container>
|
|
52
57
|
</v-tab-item>
|
|
53
|
-
|
|
58
|
+
<v-tab-item>
|
|
59
|
+
<v-container class="pb-4">
|
|
60
|
+
<v-row align="center">
|
|
61
|
+
<v-switch
|
|
62
|
+
v-model="spokenTextChanged"
|
|
63
|
+
:label="
|
|
64
|
+
$t(
|
|
65
|
+
'windward.core.components.utils.math_expression_editor.custom_screen_reader_text'
|
|
66
|
+
)
|
|
67
|
+
"
|
|
68
|
+
hide-details
|
|
69
|
+
class="shrink mr-2 mt-0"
|
|
70
|
+
></v-switch>
|
|
71
|
+
<v-textarea
|
|
72
|
+
v-model="spokenText"
|
|
73
|
+
:disabled="!spokenTextChanged"
|
|
74
|
+
:label="
|
|
75
|
+
$t(
|
|
76
|
+
'windward.core.components.utils.math_expression_editor.screen_reader_text'
|
|
77
|
+
)
|
|
78
|
+
"
|
|
79
|
+
class="col-md-12"
|
|
80
|
+
@input="submit"
|
|
81
|
+
></v-textarea>
|
|
82
|
+
</v-row>
|
|
54
83
|
|
|
84
|
+
<br />
|
|
85
|
+
<v-row class="float-right">
|
|
86
|
+
<v-btn
|
|
87
|
+
primary
|
|
88
|
+
color="success"
|
|
89
|
+
elevation="0"
|
|
90
|
+
@click="setSRText"
|
|
91
|
+
:class="fontSize"
|
|
92
|
+
>{{
|
|
93
|
+
$t(
|
|
94
|
+
'windward.core.components.utils.math_expression_editor.default_screen_reader_text'
|
|
95
|
+
)
|
|
96
|
+
}}
|
|
97
|
+
</v-btn>
|
|
98
|
+
|
|
99
|
+
<v-btn
|
|
100
|
+
color="primary"
|
|
101
|
+
elevation="0"
|
|
102
|
+
:class="fontSize"
|
|
103
|
+
@click="readSRText"
|
|
104
|
+
>{{
|
|
105
|
+
$t(
|
|
106
|
+
'windward.core.components.utils.math_expression_editor.read_text_aloud'
|
|
107
|
+
)
|
|
108
|
+
}}
|
|
109
|
+
</v-btn>
|
|
110
|
+
</v-row>
|
|
111
|
+
</v-container>
|
|
112
|
+
<br />
|
|
113
|
+
</v-tab-item>
|
|
114
|
+
</v-tabs-items>
|
|
115
|
+
<br />
|
|
55
116
|
<math-live-wrapper
|
|
56
117
|
ref="mathfield"
|
|
57
118
|
v-model="formula"
|
|
@@ -61,54 +122,6 @@
|
|
|
61
122
|
@change="submit"
|
|
62
123
|
></math-live-wrapper>
|
|
63
124
|
<br />
|
|
64
|
-
<v-container>
|
|
65
|
-
<v-row align="center">
|
|
66
|
-
<v-switch
|
|
67
|
-
v-model="spokenTextChanged"
|
|
68
|
-
:label="
|
|
69
|
-
$t(
|
|
70
|
-
'windward.core.components.utils.math_expression_editor.custom_screen_reader_text'
|
|
71
|
-
)
|
|
72
|
-
"
|
|
73
|
-
hide-details
|
|
74
|
-
class="shrink mr-2 mt-0"
|
|
75
|
-
></v-switch>
|
|
76
|
-
<v-textarea
|
|
77
|
-
v-model="spokenText"
|
|
78
|
-
:disabled="!spokenTextChanged"
|
|
79
|
-
:label="
|
|
80
|
-
$t(
|
|
81
|
-
'windward.core.components.utils.math_expression_editor.screen_reader_text'
|
|
82
|
-
)
|
|
83
|
-
"
|
|
84
|
-
class="col-md-12"
|
|
85
|
-
@input="submit"
|
|
86
|
-
></v-textarea>
|
|
87
|
-
</v-row>
|
|
88
|
-
</v-container>
|
|
89
|
-
|
|
90
|
-
<br />
|
|
91
|
-
<v-row class="float-right">
|
|
92
|
-
<v-btn
|
|
93
|
-
primary
|
|
94
|
-
color="success"
|
|
95
|
-
@click="setSRText"
|
|
96
|
-
:class="fontSize"
|
|
97
|
-
>{{
|
|
98
|
-
$t(
|
|
99
|
-
'windward.core.components.utils.math_expression_editor.default_screen_reader_text'
|
|
100
|
-
)
|
|
101
|
-
}}
|
|
102
|
-
</v-btn>
|
|
103
|
-
|
|
104
|
-
<v-btn color="primary" :class="fontSize" @click="readSRText"
|
|
105
|
-
>{{
|
|
106
|
-
$t(
|
|
107
|
-
'windward.core.components.utils.math_expression_editor.read_text_aloud'
|
|
108
|
-
)
|
|
109
|
-
}}
|
|
110
|
-
</v-btn>
|
|
111
|
-
</v-row>
|
|
112
125
|
</v-card-text>
|
|
113
126
|
</v-card>
|
|
114
127
|
</div>
|
|
@@ -245,18 +258,38 @@ export default {
|
|
|
245
258
|
this.$emit('input', latex)
|
|
246
259
|
}
|
|
247
260
|
},
|
|
248
|
-
getBtnCode(button) {
|
|
249
|
-
if (button.cmd) {
|
|
261
|
+
getBtnCode(button, isAlpha) {
|
|
262
|
+
if (button.cmd && isAlpha) {
|
|
250
263
|
return button.latex
|
|
251
264
|
}
|
|
252
265
|
return button.text
|
|
253
266
|
},
|
|
267
|
+
|
|
268
|
+
isLastCharValid(str, pos = 0) {
|
|
269
|
+
const lastChar = str.slice(pos, pos + 1)
|
|
270
|
+
const alphanumericRegex = /^[a-z0-9]$/i
|
|
271
|
+
const validSymbols = [')', '}', '|']
|
|
272
|
+
return (
|
|
273
|
+
alphanumericRegex.test(lastChar) ||
|
|
274
|
+
validSymbols.includes(lastChar)
|
|
275
|
+
)
|
|
276
|
+
},
|
|
254
277
|
insert(latex) {
|
|
255
|
-
this.$refs.mathfield.
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
278
|
+
const existingText = this.$refs.mathfield.getValue()
|
|
279
|
+
this.$refs.mathfield.insert(
|
|
280
|
+
this.getBtnCode(
|
|
281
|
+
latex,
|
|
282
|
+
this.isLastCharValid(
|
|
283
|
+
existingText,
|
|
284
|
+
this.$refs.mathfield.$el.position - 1
|
|
285
|
+
)
|
|
286
|
+
),
|
|
287
|
+
{
|
|
288
|
+
selectionMode: 'placeholder',
|
|
289
|
+
insertionMode: 'replaceSelection',
|
|
290
|
+
focus: true,
|
|
291
|
+
}
|
|
292
|
+
)
|
|
260
293
|
},
|
|
261
294
|
|
|
262
295
|
setSRText() {
|