@windward/core 0.1.1 → 0.1.3
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/ClickableIcons.vue +6 -5
- package/components/Content/Blocks/Email.vue +4 -2
- package/components/Content/Blocks/Image.vue +84 -40
- package/components/Settings/ClickableIconsSettings.vue +56 -41
- package/components/Settings/ImageSettings.vue +7 -0
- package/components/utils/FillInBlank/FillInBlankInput.vue +7 -2
- package/helpers/MathHelper.ts +3 -3
- package/i18n/en-US/components/settings/image.ts +1 -0
- package/i18n/es-ES/components/settings/image.ts +1 -0
- package/i18n/sv-SE/components/settings/image.ts +1 -0
- package/package.json +1 -1
- package/plugin.js +1 -20
- package/test/Components/Settings/EmailSettings.spec.js +2 -2
- package/test/helpers/MathHelper.spec.js +1 -1
|
@@ -20,12 +20,11 @@
|
|
|
20
20
|
no-gutters
|
|
21
21
|
:class="rowClass(itemIndex)"
|
|
22
22
|
>
|
|
23
|
-
<v-col cols="2">
|
|
23
|
+
<v-col cols="12" xl="2" lg="3" md="3" sm="3">
|
|
24
24
|
<v-btn
|
|
25
|
-
class="
|
|
25
|
+
class="button-icon pa-1 mb-4"
|
|
26
26
|
:color="itemColor(itemIndex)"
|
|
27
27
|
:fab="block.metadata.config.display.round_icon"
|
|
28
|
-
x-large
|
|
29
28
|
outlined
|
|
30
29
|
@click="item.active = !item.active"
|
|
31
30
|
>
|
|
@@ -37,7 +36,7 @@
|
|
|
37
36
|
}}</span>
|
|
38
37
|
</v-btn>
|
|
39
38
|
</v-col>
|
|
40
|
-
<v-col cols="10">
|
|
39
|
+
<v-col cols="12" xl="10" lg="9" md="9" sm="9">
|
|
41
40
|
<h4
|
|
42
41
|
v-if="
|
|
43
42
|
block.metadata.config.display.show_title ||
|
|
@@ -185,9 +184,11 @@ export default {
|
|
|
185
184
|
.option-container {
|
|
186
185
|
border-radius: 1rem;
|
|
187
186
|
}
|
|
188
|
-
.
|
|
187
|
+
.button-icon {
|
|
189
188
|
border-width: 4px;
|
|
190
189
|
background: #fff;
|
|
190
|
+
height: 74px !important;
|
|
191
|
+
width: 74px;
|
|
191
192
|
}
|
|
192
193
|
.text-icon {
|
|
193
194
|
font-size: 1.5rem;
|
|
@@ -70,14 +70,16 @@
|
|
|
70
70
|
>{{ item.from ? item.from : 'From' }}
|
|
71
71
|
</span>
|
|
72
72
|
</v-col>
|
|
73
|
-
<v-col> </v-col>
|
|
74
73
|
</v-row>
|
|
75
74
|
</v-expansion-panel-header>
|
|
76
75
|
<v-expansion-panel-content>
|
|
77
76
|
<v-container class="pa-0 container-details">
|
|
78
77
|
<v-row>
|
|
79
78
|
<v-col cols="1"></v-col>
|
|
80
|
-
<v-col
|
|
79
|
+
<v-col
|
|
80
|
+
class="pa-0 div-details"
|
|
81
|
+
v-if="item.to || item.cc"
|
|
82
|
+
>
|
|
81
83
|
<div class="div-details-to pl-4">
|
|
82
84
|
{{
|
|
83
85
|
$t(
|
|
@@ -1,50 +1,84 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div>
|
|
3
|
-
<
|
|
4
|
-
<v-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
3
|
+
<v-container class="pa-0 ma-0">
|
|
4
|
+
<div v-if="!block.body" class="img-holder">
|
|
5
|
+
<v-skeleton-loader
|
|
6
|
+
height="300px"
|
|
7
|
+
:elevation="2"
|
|
8
|
+
type="image"
|
|
9
|
+
></v-skeleton-loader>
|
|
9
10
|
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
11
|
+
<div class="no-source-overlay">
|
|
12
|
+
<v-icon x-large>mdi-file-question</v-icon><br />
|
|
13
|
+
{{
|
|
14
|
+
$t(
|
|
15
|
+
'windward.core.components.content.blocks.image.no_image_url'
|
|
16
|
+
)
|
|
17
|
+
}}
|
|
18
|
+
</div>
|
|
17
19
|
</div>
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
20
|
+
<v-responsive :aspect-ratio="aspectRatio">
|
|
21
|
+
<v-img
|
|
22
|
+
v-if="block.body"
|
|
23
|
+
:alt="block.metadata.config.alt"
|
|
24
|
+
:aria-describedby="block.metadata.config.aria_described_by"
|
|
25
|
+
:class="imageClass"
|
|
26
|
+
:src="block.body"
|
|
27
|
+
contain
|
|
28
|
+
@click="onHandleModal"
|
|
29
|
+
>
|
|
30
|
+
<template #placeholder>
|
|
31
|
+
<v-skeleton-loader
|
|
32
|
+
type="image, image, list-item-avatar"
|
|
33
|
+
height="100%"
|
|
34
|
+
width="100%"
|
|
35
|
+
></v-skeleton-loader>
|
|
36
|
+
</template>
|
|
37
|
+
</v-img>
|
|
38
|
+
</v-responsive>
|
|
39
|
+
<TextViewer
|
|
40
|
+
v-if="describedById"
|
|
41
|
+
v-model="describedByText"
|
|
42
|
+
:id="describedById"
|
|
43
|
+
class="sr-only"
|
|
44
|
+
></TextViewer>
|
|
45
|
+
</v-container>
|
|
46
|
+
<Dialog v-model="dialog" persistent :trigger="false">
|
|
47
|
+
<template #title></template>
|
|
48
|
+
<template #form="{ on, attrs }">
|
|
49
|
+
<v-responsive
|
|
50
|
+
:aspect-ratio="aspectRatio"
|
|
51
|
+
v-bind="attrs"
|
|
52
|
+
v-on="on"
|
|
53
|
+
>
|
|
54
|
+
<v-img
|
|
55
|
+
v-if="block.body"
|
|
56
|
+
:alt="block.metadata.config.alt"
|
|
57
|
+
:aria-describedby="
|
|
58
|
+
block.metadata.config.aria_described_by
|
|
59
|
+
"
|
|
60
|
+
:class="imageClass"
|
|
61
|
+
:src="block.body"
|
|
62
|
+
contain
|
|
63
|
+
@click="onHandleModal"
|
|
64
|
+
>
|
|
65
|
+
<template #placeholder>
|
|
66
|
+
<v-skeleton-loader
|
|
67
|
+
type="image, image, list-item-avatar"
|
|
68
|
+
height="100%"
|
|
69
|
+
width="100%"
|
|
70
|
+
></v-skeleton-loader>
|
|
71
|
+
</template>
|
|
72
|
+
</v-img>
|
|
73
|
+
</v-responsive>
|
|
74
|
+
</template>
|
|
75
|
+
</Dialog>
|
|
43
76
|
</div>
|
|
44
77
|
</template>
|
|
45
78
|
|
|
46
79
|
<script>
|
|
47
80
|
import _ from 'lodash'
|
|
81
|
+
import Dialog from '~/components/Dialog'
|
|
48
82
|
import TextViewer from '~/components/Text/TextViewer'
|
|
49
83
|
import Crypto from '~/helpers/Crypto'
|
|
50
84
|
import BaseContentBlock from '~/components/Content/Blocks/BaseContentBlock'
|
|
@@ -53,12 +87,14 @@ export default {
|
|
|
53
87
|
name: 'ContentBlockImage',
|
|
54
88
|
extends: BaseContentBlock,
|
|
55
89
|
components: {
|
|
90
|
+
Dialog,
|
|
56
91
|
TextViewer,
|
|
57
92
|
},
|
|
58
93
|
data() {
|
|
59
94
|
return {
|
|
60
95
|
id: 'image_' + Crypto.id(),
|
|
61
96
|
aspectRatio: undefined,
|
|
97
|
+
dialog: false,
|
|
62
98
|
}
|
|
63
99
|
},
|
|
64
100
|
beforeMount() {
|
|
@@ -71,6 +107,9 @@ export default {
|
|
|
71
107
|
if (!_.isBoolean(this.block.metadata.config.hide_background)) {
|
|
72
108
|
this.block.metadata.config.hide_background = false
|
|
73
109
|
}
|
|
110
|
+
if (!_.isBoolean(this.block.metadata.config.modal)) {
|
|
111
|
+
this.block.metadata.config.modal = false
|
|
112
|
+
}
|
|
74
113
|
if (_.isEmpty(this.block.metadata.config.aria_describedby)) {
|
|
75
114
|
this.block.metadata.config.aria_describedby = ''
|
|
76
115
|
}
|
|
@@ -111,8 +150,13 @@ export default {
|
|
|
111
150
|
}
|
|
112
151
|
},
|
|
113
152
|
},
|
|
114
|
-
|
|
115
|
-
|
|
153
|
+
methods: {
|
|
154
|
+
onHandleModal() {
|
|
155
|
+
if (this.block.metadata.config.modal) {
|
|
156
|
+
this.dialog = true
|
|
157
|
+
}
|
|
158
|
+
},
|
|
159
|
+
},
|
|
116
160
|
}
|
|
117
161
|
</script>
|
|
118
162
|
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div>
|
|
3
|
-
<v-container>
|
|
3
|
+
<v-container class="pa-0">
|
|
4
4
|
<v-col class="pa-0">
|
|
5
5
|
<v-text-field
|
|
6
6
|
v-model="block.metadata.config.title"
|
|
7
|
+
outlined
|
|
7
8
|
id="title"
|
|
8
9
|
:label="
|
|
9
10
|
$t(
|
|
@@ -13,6 +14,7 @@
|
|
|
13
14
|
></v-text-field>
|
|
14
15
|
<v-text-field
|
|
15
16
|
v-model="block.metadata.config.description"
|
|
17
|
+
outlined
|
|
16
18
|
id="description"
|
|
17
19
|
:label="
|
|
18
20
|
$t(
|
|
@@ -60,12 +62,8 @@
|
|
|
60
62
|
)
|
|
61
63
|
"
|
|
62
64
|
></v-switch>
|
|
63
|
-
<v-btn color="primary" outlined block @click="onAddElement"
|
|
64
|
-
><v-icon>mdi-plus</v-icon
|
|
65
|
-
>{{ $t('shared.forms.add') }}</v-btn
|
|
66
|
-
>
|
|
67
65
|
</v-col>
|
|
68
|
-
<v-col>
|
|
66
|
+
<v-col class="pa-0">
|
|
69
67
|
<SortableExpansionPanel
|
|
70
68
|
v-model="block.metadata.config.items"
|
|
71
69
|
@click:close="onRemoveElement"
|
|
@@ -86,47 +84,64 @@
|
|
|
86
84
|
</span>
|
|
87
85
|
</template>
|
|
88
86
|
<template #body="{ index }">
|
|
89
|
-
<
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
87
|
+
<v-container>
|
|
88
|
+
<TextIconPicker
|
|
89
|
+
v-model="
|
|
90
|
+
block.metadata.config.items[index].icon
|
|
91
|
+
"
|
|
92
|
+
:label="
|
|
93
|
+
$t(
|
|
94
|
+
'windward.core.components.settings.clickable_icon.item_icon',
|
|
95
|
+
[index + 1]
|
|
96
|
+
)
|
|
97
|
+
"
|
|
98
|
+
></TextIconPicker>
|
|
99
|
+
<v-text-field
|
|
100
|
+
v-model="
|
|
101
|
+
block.metadata.config.items[index].title
|
|
102
|
+
"
|
|
103
|
+
:id="'item-' + index + '-title'"
|
|
104
|
+
outlined
|
|
105
|
+
:label="
|
|
106
|
+
$t(
|
|
107
|
+
'windward.core.components.settings.clickable_icon.item_title'
|
|
108
|
+
)
|
|
109
|
+
"
|
|
110
|
+
></v-text-field>
|
|
107
111
|
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
+
<ColorPicker
|
|
113
|
+
v-if="!block.metadata.config.display.autocolor"
|
|
114
|
+
v-model="
|
|
115
|
+
block.metadata.config.items[index].color
|
|
116
|
+
"
|
|
117
|
+
:label="
|
|
118
|
+
$t(
|
|
119
|
+
'windward.core.components.settings.clickable_icon.item_color'
|
|
120
|
+
)
|
|
121
|
+
"
|
|
122
|
+
></ColorPicker>
|
|
123
|
+
<v-divider class="mt-3 mb-3" />
|
|
124
|
+
<span>{{
|
|
112
125
|
$t(
|
|
113
|
-
'windward.core.components.settings.clickable_icon.
|
|
126
|
+
'windward.core.components.settings.clickable_icon.item_text'
|
|
114
127
|
)
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
<TextEditor
|
|
124
|
-
v-model="block.metadata.config.items[index].body"
|
|
125
|
-
:height="200"
|
|
126
|
-
></TextEditor>
|
|
128
|
+
}}</span>
|
|
129
|
+
<TextEditor
|
|
130
|
+
v-model="
|
|
131
|
+
block.metadata.config.items[index].body
|
|
132
|
+
"
|
|
133
|
+
:height="200"
|
|
134
|
+
></TextEditor>
|
|
135
|
+
</v-container>
|
|
127
136
|
</template>
|
|
128
137
|
</SortableExpansionPanel>
|
|
129
138
|
</v-col>
|
|
139
|
+
<v-row justify="center" class="my-4">
|
|
140
|
+
<v-btn color="primary" @click="onAddElement"
|
|
141
|
+
><v-icon>mdi-plus</v-icon
|
|
142
|
+
>{{ $t('shared.forms.add') }}</v-btn
|
|
143
|
+
>
|
|
144
|
+
</v-row>
|
|
130
145
|
</v-container>
|
|
131
146
|
</div>
|
|
132
147
|
</template>
|
|
@@ -23,6 +23,10 @@
|
|
|
23
23
|
$t('windward.core.components.settings.image.hide_background')
|
|
24
24
|
"
|
|
25
25
|
></v-switch>
|
|
26
|
+
<v-switch
|
|
27
|
+
v-model="block.metadata.config.modal"
|
|
28
|
+
:label="$t('windward.core.components.settings.image.modal')"
|
|
29
|
+
></v-switch>
|
|
26
30
|
|
|
27
31
|
<v-form>
|
|
28
32
|
<v-text-field
|
|
@@ -79,6 +83,9 @@ export default {
|
|
|
79
83
|
if (!_.isBoolean(this.block.metadata.config.hide_background)) {
|
|
80
84
|
this.block.metadata.config.hide_background = false
|
|
81
85
|
}
|
|
86
|
+
if (!_.isBoolean(this.block.metadata.config.modal)) {
|
|
87
|
+
this.block.metadata.config.modal = false
|
|
88
|
+
}
|
|
82
89
|
if (_.isEmpty(this.block.metadata.config.aria_describedby)) {
|
|
83
90
|
this.block.metadata.config.aria_describedby = ''
|
|
84
91
|
}
|
|
@@ -82,6 +82,11 @@
|
|
|
82
82
|
"
|
|
83
83
|
@input="showAnswer = false"
|
|
84
84
|
@keydown="onPressEnter"
|
|
85
|
+
:aria-label="
|
|
86
|
+
$t(
|
|
87
|
+
'windward.core.components.utils.tiny_mce_wrapper.fill_in_blank'
|
|
88
|
+
)
|
|
89
|
+
"
|
|
85
90
|
></v-text-field>
|
|
86
91
|
|
|
87
92
|
<v-btn
|
|
@@ -134,8 +139,8 @@ export default {
|
|
|
134
139
|
computed: {
|
|
135
140
|
answerIsCorrect() {
|
|
136
141
|
if (
|
|
137
|
-
_.trim(_.toLower(this.answer)) ===
|
|
138
|
-
_.trim(_.toLower(this.userInput))
|
|
142
|
+
_.replace(_.trim(_.toLower(this.answer)),new RegExp(' ','g'), '', ) ===
|
|
143
|
+
_.replace(_.trim(_.toLower(this.userInput)),new RegExp(' ','g'), '', )
|
|
139
144
|
) {
|
|
140
145
|
return true
|
|
141
146
|
}
|
package/helpers/MathHelper.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as mathLiveObject from 'mathlive'
|
|
2
2
|
import * as _ from 'lodash'
|
|
3
|
-
|
|
3
|
+
import { MathMLToLaTeX } from 'mathml-to-latex';
|
|
4
4
|
export default class MathHelper {
|
|
5
5
|
/**
|
|
6
6
|
* expose mathlive object
|
|
@@ -59,7 +59,7 @@ export default class MathHelper {
|
|
|
59
59
|
matches.forEach((match) => {
|
|
60
60
|
content = content.replace(
|
|
61
61
|
match,
|
|
62
|
-
`$$$` +
|
|
62
|
+
`$$$` + MathMLToLaTeX.convert(match) + '$$$'
|
|
63
63
|
)
|
|
64
64
|
})
|
|
65
65
|
}
|
|
@@ -194,7 +194,7 @@ export default class MathHelper {
|
|
|
194
194
|
*
|
|
195
195
|
*/
|
|
196
196
|
public static convertMathMLToLatex(content: string): string {
|
|
197
|
-
return
|
|
197
|
+
return MathMLToLaTeX.convert(content)
|
|
198
198
|
}
|
|
199
199
|
|
|
200
200
|
/**
|
package/package.json
CHANGED
package/plugin.js
CHANGED
|
@@ -165,16 +165,6 @@ export default {
|
|
|
165
165
|
'windward.core.shared.content_blocks.grouping.basic',
|
|
166
166
|
},
|
|
167
167
|
},
|
|
168
|
-
{
|
|
169
|
-
tag: 'core-math',
|
|
170
|
-
template: Math,
|
|
171
|
-
metadata: {
|
|
172
|
-
icon: 'mdi-math-integral',
|
|
173
|
-
name: 'windward.core.shared.content_blocks.title.math',
|
|
174
|
-
grouping:
|
|
175
|
-
'windward.core.shared.content_blocks.grouping.basic',
|
|
176
|
-
},
|
|
177
|
-
},
|
|
178
168
|
{
|
|
179
169
|
tag: 'core-accordion',
|
|
180
170
|
template: Accordion,
|
|
@@ -262,7 +252,7 @@ export default {
|
|
|
262
252
|
icon: 'mdi-email',
|
|
263
253
|
name: 'windward.core.shared.content_blocks.title.email',
|
|
264
254
|
grouping:
|
|
265
|
-
|
|
255
|
+
'windward.core.shared.content_blocks.grouping.basic',
|
|
266
256
|
},
|
|
267
257
|
},
|
|
268
258
|
{
|
|
@@ -376,15 +366,6 @@ export default {
|
|
|
376
366
|
name: 'windward.core.shared.settings.title.text_editor',
|
|
377
367
|
},
|
|
378
368
|
},
|
|
379
|
-
{
|
|
380
|
-
tag: 'core-math-settings',
|
|
381
|
-
template: MathSettings,
|
|
382
|
-
context: ['block.core-math'],
|
|
383
|
-
metadata: {
|
|
384
|
-
icon: 'mdi-notebook-outline',
|
|
385
|
-
name: 'windward.core.shared.settings.title.math',
|
|
386
|
-
},
|
|
387
|
-
},
|
|
388
369
|
{
|
|
389
370
|
tag: 'core-feedback-settings',
|
|
390
371
|
template: FeedbackSettings,
|
|
@@ -27,8 +27,8 @@ describe('EmailSettings', () => {
|
|
|
27
27
|
})
|
|
28
28
|
wrapper.vm.onAddElement()
|
|
29
29
|
expect(wrapper.vm.$data.block.metadata.config.emails).toEqual([
|
|
30
|
-
{ from: '', to: '', cc: '', body: '', expand: false },
|
|
31
|
-
{ from: '', to: '', cc: '', body: '', expand: false },
|
|
30
|
+
{ from: '', to: '', cc: '', body: '', expand: false, initials: '' },
|
|
31
|
+
{ from: '', to: '', cc: '', body: '', expand: false, initials: '' },
|
|
32
32
|
])
|
|
33
33
|
})
|
|
34
34
|
|
|
@@ -7,7 +7,7 @@ const text =
|
|
|
7
7
|
' Et inventore hic aut.'
|
|
8
8
|
const mathML =
|
|
9
9
|
'<math xmlns="http://www.w3.org/1998/Math/MathML"><mfrac><mn>1</mn><mn>2</mn></mfrac><mo>+</mo><mfrac><mn>3</mn><mn>4</mn></mfrac></math>'
|
|
10
|
-
const latexContent = '\\frac{1}{2}
|
|
10
|
+
const latexContent = '\\frac{1}{2} + \\frac{3}{4}'
|
|
11
11
|
const srEnhancedlatex =
|
|
12
12
|
'**' +
|
|
13
13
|
JSON.stringify({
|