@windward/core 0.0.9 → 0.1.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/components/Content/Blocks/BlockQuote.vue +191 -0
- package/components/Content/Blocks/FeedbackTemplates/FeedbackQuestionLikert.vue +25 -14
- package/components/Content/Blocks/FeedbackTemplates/FeedbackQuestionTrueFalse.vue +3 -7
- package/components/Content/Blocks/OpenResponse.vue +20 -14
- package/components/Settings/BlockQuoteSettings.vue +143 -0
- package/components/Settings/OpenResponseSettings.vue +6 -8
- package/components/Settings/TabSettings.vue +7 -4
- package/components/utils/MathExpressionEditor.vue +30 -15
- package/components/utils/TinyMCEWrapper.vue +2 -0
- package/i18n/en-US/components/content/blocks/block_quote.ts +3 -0
- package/i18n/en-US/components/content/blocks/index.ts +2 -0
- package/i18n/en-US/components/settings/block_quote.ts +9 -0
- package/i18n/en-US/components/settings/index.ts +2 -0
- package/i18n/en-US/components/utils/index.ts +2 -0
- package/i18n/en-US/components/utils/math_expression_editor.ts +3 -0
- package/i18n/en-US/shared/content_blocks.ts +1 -0
- package/i18n/en-US/shared/settings.ts +2 -0
- package/i18n/es-ES/components/content/blocks/block_quote.ts +3 -0
- package/i18n/es-ES/components/content/blocks/index.ts +2 -0
- package/i18n/es-ES/components/settings/block_quote.ts +9 -0
- package/i18n/es-ES/components/settings/index.ts +2 -0
- package/i18n/es-ES/components/utils/index.ts +2 -1
- package/i18n/es-ES/components/utils/math_expression_editor.ts +3 -0
- package/i18n/es-ES/shared/content_blocks.ts +1 -0
- package/i18n/es-ES/shared/settings.ts +2 -0
- package/i18n/sv-SE/components/content/blocks/block_quote.ts +3 -0
- package/i18n/sv-SE/components/content/blocks/index.ts +2 -0
- package/i18n/sv-SE/components/settings/block_quote.ts +9 -0
- package/i18n/sv-SE/components/settings/index.ts +2 -0
- package/i18n/sv-SE/components/utils/index.ts +2 -1
- package/i18n/sv-SE/components/utils/math_expression_editor.ts +3 -0
- package/i18n/sv-SE/shared/content_blocks.ts +1 -0
- package/i18n/sv-SE/shared/settings.ts +2 -0
- package/package.json +4 -4
- package/plugin.js +21 -0
- package/test/Components/Content/Blocks/BlockQuote.spec.js +21 -0
- package/test/Components/Settings/BlockQuoteSettings.spec.js +20 -0
|
@@ -0,0 +1,191 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<v-container class="container-left-border">
|
|
3
|
+
<v-row
|
|
4
|
+
v-if="
|
|
5
|
+
block.metadata.config.title ||
|
|
6
|
+
block.metadata.config.instructions
|
|
7
|
+
"
|
|
8
|
+
>
|
|
9
|
+
<v-col cols="12" class="pb-0">
|
|
10
|
+
<h3 v-if="block.metadata.config.title">
|
|
11
|
+
{{ block.metadata.config.title }}
|
|
12
|
+
</h3>
|
|
13
|
+
<p v-if="block.metadata.config.instructions" class="pb-0 mb-0">
|
|
14
|
+
{{ block.metadata.config.instructions }}
|
|
15
|
+
</p>
|
|
16
|
+
</v-col>
|
|
17
|
+
</v-row>
|
|
18
|
+
<v-row>
|
|
19
|
+
<v-col cols="1">
|
|
20
|
+
<v-icon color="primary">mdi-format-quote-open</v-icon>
|
|
21
|
+
</v-col>
|
|
22
|
+
<v-col cols="11" class="pl-0">
|
|
23
|
+
<p class="pt-2">
|
|
24
|
+
{{ block.metadata.config.block_quote.quote }}
|
|
25
|
+
</p>
|
|
26
|
+
</v-col>
|
|
27
|
+
</v-row>
|
|
28
|
+
<v-row>
|
|
29
|
+
<v-col cols="12">
|
|
30
|
+
<p v-if="render">
|
|
31
|
+
{{ finalcitation
|
|
32
|
+
}}<span :class="classCitation">{{ finalsource }}</span>
|
|
33
|
+
</p>
|
|
34
|
+
<p v-if="!render">Citation Here</p>
|
|
35
|
+
</v-col>
|
|
36
|
+
</v-row>
|
|
37
|
+
</v-container>
|
|
38
|
+
</template>
|
|
39
|
+
|
|
40
|
+
<script>
|
|
41
|
+
import _ from 'lodash'
|
|
42
|
+
import BaseContentBlock from '~/components/Content/Blocks/BaseContentBlock'
|
|
43
|
+
|
|
44
|
+
export default {
|
|
45
|
+
name: 'ContentBlockTab',
|
|
46
|
+
extends: BaseContentBlock,
|
|
47
|
+
beforeMount() {
|
|
48
|
+
if (_.isEmpty(this.block)) {
|
|
49
|
+
this.block = {}
|
|
50
|
+
}
|
|
51
|
+
if (_.isEmpty(this.block.metadata)) {
|
|
52
|
+
this.block.metadata = {}
|
|
53
|
+
}
|
|
54
|
+
if (_.isEmpty(this.block.metadata.config)) {
|
|
55
|
+
this.block.metadata.config = {}
|
|
56
|
+
}
|
|
57
|
+
if (_.isEmpty(this.block.metadata.config.title)) {
|
|
58
|
+
this.block.metadata.config.title = ''
|
|
59
|
+
}
|
|
60
|
+
if (_.isEmpty(this.block.metadata.config.instructions)) {
|
|
61
|
+
this.block.metadata.config.instructions = ''
|
|
62
|
+
}
|
|
63
|
+
if (_.isEmpty(this.block.metadata.config.block_quote)) {
|
|
64
|
+
this.block.metadata.config.block_quote = {
|
|
65
|
+
quote: '',
|
|
66
|
+
author: '',
|
|
67
|
+
author_title: '',
|
|
68
|
+
organization: '',
|
|
69
|
+
source_title: '',
|
|
70
|
+
source_type: '',
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
this.block.body = 'block quote'
|
|
74
|
+
},
|
|
75
|
+
data() {
|
|
76
|
+
return {
|
|
77
|
+
finalcitation: '',
|
|
78
|
+
finalsource: '',
|
|
79
|
+
classCitation: '',
|
|
80
|
+
}
|
|
81
|
+
},
|
|
82
|
+
watch: {
|
|
83
|
+
render(newValue) {
|
|
84
|
+
if (newValue) {
|
|
85
|
+
this.createCitation()
|
|
86
|
+
}
|
|
87
|
+
},
|
|
88
|
+
},
|
|
89
|
+
mounted() {
|
|
90
|
+
this.createCitation()
|
|
91
|
+
},
|
|
92
|
+
methods: {
|
|
93
|
+
createCitation() {
|
|
94
|
+
this.finalcitation = ''
|
|
95
|
+
this.finalsource = ''
|
|
96
|
+
let counter = 0
|
|
97
|
+
for (const property in this.block.metadata.config.block_quote) {
|
|
98
|
+
// author details processed here counter added to see if a comma is needed before key
|
|
99
|
+
if (
|
|
100
|
+
property !== 'quote' &&
|
|
101
|
+
property !== 'source_type' &&
|
|
102
|
+
property !== 'source_title' &&
|
|
103
|
+
this.block.metadata.config.block_quote[property] !== null &&
|
|
104
|
+
this.block.metadata.config.block_quote[property] !== ''
|
|
105
|
+
) {
|
|
106
|
+
if (counter > 0) {
|
|
107
|
+
//not first hit so a comma is needed before key
|
|
108
|
+
counter = counter + 1
|
|
109
|
+
this.finalcitation =
|
|
110
|
+
this.finalcitation +
|
|
111
|
+
', ' +
|
|
112
|
+
this.block.metadata.config.block_quote[property]
|
|
113
|
+
} else {
|
|
114
|
+
//first hit, no comma needed
|
|
115
|
+
counter = counter + 1
|
|
116
|
+
this.finalcitation =
|
|
117
|
+
'—' +
|
|
118
|
+
this.finalcitation +
|
|
119
|
+
this.block.metadata.config.block_quote[property]
|
|
120
|
+
}
|
|
121
|
+
// checks that source_type isn't none and there is a source title
|
|
122
|
+
} else if (
|
|
123
|
+
property === 'source_title' &&
|
|
124
|
+
this.block.metadata.config.block_quote['source_type'] !==
|
|
125
|
+
'None' &&
|
|
126
|
+
this.block.metadata.config.block_quote[property] !== null &&
|
|
127
|
+
this.block.metadata.config.block_quote[property] !== ''
|
|
128
|
+
) {
|
|
129
|
+
// filters out source types book. Adds class to italicize books
|
|
130
|
+
if (
|
|
131
|
+
this.block.metadata.config.block_quote[
|
|
132
|
+
'source_type'
|
|
133
|
+
] === 'Book'
|
|
134
|
+
) {
|
|
135
|
+
// checks if comma needed or not
|
|
136
|
+
if (counter > 0) {
|
|
137
|
+
this.finalsource =
|
|
138
|
+
', ' +
|
|
139
|
+
this.block.metadata.config.block_quote[property]
|
|
140
|
+
this.classCitation = 'span-title'
|
|
141
|
+
} else {
|
|
142
|
+
this.finalsource =
|
|
143
|
+
'—' +
|
|
144
|
+
this.block.metadata.config.block_quote[property]
|
|
145
|
+
this.classCitation = 'span-title'
|
|
146
|
+
}
|
|
147
|
+
//checks if online journal
|
|
148
|
+
} else if (
|
|
149
|
+
this.block.metadata.config.block_quote[
|
|
150
|
+
'source_type'
|
|
151
|
+
] === 'Online Journal'
|
|
152
|
+
) {
|
|
153
|
+
// checks if comma needed or not. Not Italicized
|
|
154
|
+
if (counter > 0) {
|
|
155
|
+
this.finalsource =
|
|
156
|
+
', ' +
|
|
157
|
+
'"' +
|
|
158
|
+
this.block.metadata.config.block_quote[
|
|
159
|
+
property
|
|
160
|
+
] +
|
|
161
|
+
'"'
|
|
162
|
+
this.classCitation = ''
|
|
163
|
+
} else {
|
|
164
|
+
this.finalsource =
|
|
165
|
+
'—' +
|
|
166
|
+
'"' +
|
|
167
|
+
this.block.metadata.config.block_quote[
|
|
168
|
+
property
|
|
169
|
+
] +
|
|
170
|
+
'"'
|
|
171
|
+
this.classCitation = ''
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
},
|
|
177
|
+
},
|
|
178
|
+
}
|
|
179
|
+
</script>
|
|
180
|
+
|
|
181
|
+
<style scoped>
|
|
182
|
+
.container-left-border {
|
|
183
|
+
border-style: solid;
|
|
184
|
+
border-color: var(--v-secondary-base);
|
|
185
|
+
border-width: 2px 2px 2px 16px;
|
|
186
|
+
border-radius: 4px;
|
|
187
|
+
}
|
|
188
|
+
.span-title {
|
|
189
|
+
font-style: italic;
|
|
190
|
+
}
|
|
191
|
+
</style>
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
<p class="question">
|
|
4
4
|
{{ value.body }}
|
|
5
5
|
</p>
|
|
6
|
-
<div class="d-flex
|
|
6
|
+
<div class="d-flex">
|
|
7
7
|
<v-radio-group
|
|
8
8
|
:rules="[
|
|
9
9
|
(v) =>
|
|
@@ -12,12 +12,12 @@
|
|
|
12
12
|
'windward.core.components.content.blocks.feedback.required'
|
|
13
13
|
),
|
|
14
14
|
]"
|
|
15
|
-
row
|
|
16
15
|
class="radio-group"
|
|
16
|
+
:row="row"
|
|
17
|
+
:column="column"
|
|
17
18
|
v-model="value.response"
|
|
18
19
|
>
|
|
19
20
|
<v-radio
|
|
20
|
-
class="likert-radio"
|
|
21
21
|
color="green"
|
|
22
22
|
:label="
|
|
23
23
|
$t(
|
|
@@ -27,7 +27,6 @@
|
|
|
27
27
|
value="5"
|
|
28
28
|
></v-radio>
|
|
29
29
|
<v-radio
|
|
30
|
-
class="likert-radio"
|
|
31
30
|
color="light-green"
|
|
32
31
|
:label="
|
|
33
32
|
$t(
|
|
@@ -37,7 +36,6 @@
|
|
|
37
36
|
value="4"
|
|
38
37
|
></v-radio>
|
|
39
38
|
<v-radio
|
|
40
|
-
class="likert-radio"
|
|
41
39
|
color="amber"
|
|
42
40
|
:label="
|
|
43
41
|
$t(
|
|
@@ -47,7 +45,6 @@
|
|
|
47
45
|
value="3"
|
|
48
46
|
></v-radio>
|
|
49
47
|
<v-radio
|
|
50
|
-
class="likert-radio"
|
|
51
48
|
color="orange"
|
|
52
49
|
:label="
|
|
53
50
|
$t(
|
|
@@ -57,7 +54,6 @@
|
|
|
57
54
|
value="2"
|
|
58
55
|
></v-radio>
|
|
59
56
|
<v-radio
|
|
60
|
-
class="likert-radio"
|
|
61
57
|
color="red"
|
|
62
58
|
:label="
|
|
63
59
|
$t(
|
|
@@ -78,7 +74,28 @@ export default {
|
|
|
78
74
|
value: { type: Object, required: true, default: '' },
|
|
79
75
|
},
|
|
80
76
|
data() {
|
|
81
|
-
return {
|
|
77
|
+
return {
|
|
78
|
+
windowWidth: window.innerWidth,
|
|
79
|
+
row: true,
|
|
80
|
+
column: false,
|
|
81
|
+
}
|
|
82
|
+
},
|
|
83
|
+
mounted() {
|
|
84
|
+
this.$nextTick(() => {
|
|
85
|
+
window.addEventListener('resize', this.onResize)
|
|
86
|
+
})
|
|
87
|
+
},
|
|
88
|
+
methods: {
|
|
89
|
+
onResize() {
|
|
90
|
+
this.windowWidth = window.innerWidth
|
|
91
|
+
if (this.windowWidth <= 760) {
|
|
92
|
+
this.row = false
|
|
93
|
+
this.column = true
|
|
94
|
+
} else {
|
|
95
|
+
this.row = true
|
|
96
|
+
this.column = false
|
|
97
|
+
}
|
|
98
|
+
},
|
|
82
99
|
},
|
|
83
100
|
}
|
|
84
101
|
</script>
|
|
@@ -86,10 +103,4 @@ export default {
|
|
|
86
103
|
.question {
|
|
87
104
|
font-weight: bold;
|
|
88
105
|
}
|
|
89
|
-
.radio-group {
|
|
90
|
-
width: 100% !important;
|
|
91
|
-
}
|
|
92
|
-
.likert-radio {
|
|
93
|
-
margin-left: 55px;
|
|
94
|
-
}
|
|
95
106
|
</style>
|
|
@@ -24,7 +24,9 @@
|
|
|
24
24
|
></v-radio>
|
|
25
25
|
<v-radio
|
|
26
26
|
class="likert-radio"
|
|
27
|
-
:label="
|
|
27
|
+
:label="
|
|
28
|
+
$t('windward.core.components.content.blocks.feedback.no')
|
|
29
|
+
"
|
|
28
30
|
value="false"
|
|
29
31
|
></v-radio>
|
|
30
32
|
</v-radio-group>
|
|
@@ -46,10 +48,4 @@ export default {
|
|
|
46
48
|
.question {
|
|
47
49
|
font-weight: bold;
|
|
48
50
|
}
|
|
49
|
-
.radio-group {
|
|
50
|
-
width: 100% !important;
|
|
51
|
-
}
|
|
52
|
-
.likert-radio {
|
|
53
|
-
margin-left: 55px;
|
|
54
|
-
}
|
|
55
51
|
</style>
|
|
@@ -128,22 +128,28 @@ export default {
|
|
|
128
128
|
// Check to see if we have a state already for this block with the same block_id
|
|
129
129
|
// States are loaded via the ContentBlock.id but in this particular case we want to
|
|
130
130
|
// maintain the state ACROSS different ContentBlock.ids but with the same linked Block.id
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
131
|
+
if (this.block.block_id) {
|
|
132
|
+
const userState = await UserContentBlockState.where({
|
|
133
|
+
'metadata->block->tag': 'plugin-core-open-response',
|
|
134
|
+
course_user_id: this.enrollment.id,
|
|
135
|
+
})
|
|
136
|
+
.where('metadata->block->block_id', this.block.block_id)
|
|
137
|
+
.first()
|
|
137
138
|
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
139
|
+
// Apply the "True" state
|
|
140
|
+
if (!_.isEmpty(userState)) {
|
|
141
|
+
this.response = _.get(userState, 'metadata.response', '')
|
|
142
|
+
this.submitted = _.get(
|
|
143
|
+
userState,
|
|
144
|
+
'metadata.submitted',
|
|
145
|
+
false
|
|
146
|
+
)
|
|
147
|
+
}
|
|
143
148
|
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
149
|
+
// If after the state is applied the response is still empty then apply the default response
|
|
150
|
+
if (this.response === '') {
|
|
151
|
+
this.response = this.block.metadata.config.starting_text
|
|
152
|
+
}
|
|
147
153
|
}
|
|
148
154
|
|
|
149
155
|
this.stateLoaded = true
|
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div>
|
|
3
|
+
<v-form ref="form" v-model="valid" v-if="!loading"> </v-form>
|
|
4
|
+
<v-container class="pa-0">
|
|
5
|
+
<v-text-field
|
|
6
|
+
v-model="block.metadata.config.title"
|
|
7
|
+
outlined
|
|
8
|
+
:counter="50"
|
|
9
|
+
:autofocus="true"
|
|
10
|
+
:label="$t('windward.core.shared.settings.title.title')"
|
|
11
|
+
ref="title"
|
|
12
|
+
></v-text-field>
|
|
13
|
+
<v-textarea
|
|
14
|
+
v-model="block.metadata.config.instructions"
|
|
15
|
+
outlined
|
|
16
|
+
auto-grow
|
|
17
|
+
:counter="255"
|
|
18
|
+
:label="$t('windward.core.shared.settings.title.instructions')"
|
|
19
|
+
></v-textarea>
|
|
20
|
+
</v-container>
|
|
21
|
+
<v-divider class="my-4 primary"></v-divider>
|
|
22
|
+
<v-container class="pa-0">
|
|
23
|
+
<v-textarea
|
|
24
|
+
v-model="block.metadata.config.block_quote.quote"
|
|
25
|
+
outlined
|
|
26
|
+
auto-grow
|
|
27
|
+
:counter="255"
|
|
28
|
+
:label="
|
|
29
|
+
$t('windward.core.components.settings.block_quote.body')
|
|
30
|
+
"
|
|
31
|
+
></v-textarea>
|
|
32
|
+
</v-container>
|
|
33
|
+
<v-divider class="my-4 primary"></v-divider>
|
|
34
|
+
<v-container class="pa-0">
|
|
35
|
+
<v-text-field
|
|
36
|
+
v-model="block.metadata.config.block_quote.author"
|
|
37
|
+
outlined
|
|
38
|
+
auto-grow
|
|
39
|
+
:label="
|
|
40
|
+
$t('windward.core.components.settings.block_quote.name')
|
|
41
|
+
"
|
|
42
|
+
></v-text-field>
|
|
43
|
+
<v-text-field
|
|
44
|
+
v-model="block.metadata.config.block_quote.author_title"
|
|
45
|
+
outlined
|
|
46
|
+
auto-grow
|
|
47
|
+
:label="
|
|
48
|
+
$t('windward.core.components.settings.block_quote.title')
|
|
49
|
+
"
|
|
50
|
+
></v-text-field>
|
|
51
|
+
<v-text-field
|
|
52
|
+
v-model="block.metadata.config.block_quote.organization"
|
|
53
|
+
outlined
|
|
54
|
+
auto-grow
|
|
55
|
+
:label="$t('windward.core.components.settings.block_quote.org')"
|
|
56
|
+
></v-text-field>
|
|
57
|
+
<v-text-field
|
|
58
|
+
v-model="block.metadata.config.block_quote.source_title"
|
|
59
|
+
outlined
|
|
60
|
+
auto-grow
|
|
61
|
+
:label="
|
|
62
|
+
$t(
|
|
63
|
+
'windward.core.components.settings.block_quote.source_title'
|
|
64
|
+
)
|
|
65
|
+
"
|
|
66
|
+
></v-text-field>
|
|
67
|
+
<v-select
|
|
68
|
+
v-model="block.metadata.config.block_quote.source_type"
|
|
69
|
+
:items="sourceTypes"
|
|
70
|
+
outlined
|
|
71
|
+
:label="
|
|
72
|
+
$t('windward.core.components.settings.block_quote.type')
|
|
73
|
+
"
|
|
74
|
+
></v-select>
|
|
75
|
+
</v-container>
|
|
76
|
+
<div v-if="loading" class="text-center">
|
|
77
|
+
<v-progress-circular
|
|
78
|
+
:size="70"
|
|
79
|
+
:width="7"
|
|
80
|
+
color="primary"
|
|
81
|
+
indeterminate
|
|
82
|
+
></v-progress-circular>
|
|
83
|
+
</div>
|
|
84
|
+
</div>
|
|
85
|
+
</template>
|
|
86
|
+
<script>
|
|
87
|
+
import _ from 'lodash'
|
|
88
|
+
import BaseContentSettings from '~/components/Content/Tool/BaseContentSettings.js'
|
|
89
|
+
|
|
90
|
+
export default {
|
|
91
|
+
name: 'BlockQuoteSettings',
|
|
92
|
+
extends: BaseContentSettings,
|
|
93
|
+
beforeMount() {
|
|
94
|
+
if (_.isEmpty(this.block)) {
|
|
95
|
+
this.block = {}
|
|
96
|
+
}
|
|
97
|
+
if (_.isEmpty(this.block.metadata)) {
|
|
98
|
+
this.block.metadata = {}
|
|
99
|
+
}
|
|
100
|
+
if (_.isEmpty(this.block.metadata.config)) {
|
|
101
|
+
this.block.metadata.config = {}
|
|
102
|
+
}
|
|
103
|
+
if (_.isEmpty(this.block.metadata.config.title)) {
|
|
104
|
+
this.block.metadata.config.title = ''
|
|
105
|
+
}
|
|
106
|
+
if (_.isEmpty(this.block.metadata.config.instructions)) {
|
|
107
|
+
this.block.metadata.config.instructions = ''
|
|
108
|
+
}
|
|
109
|
+
if (_.isEmpty(this.block.metadata.config.block_quote)) {
|
|
110
|
+
this.block.metadata.config.block_quote = {
|
|
111
|
+
quote: '',
|
|
112
|
+
author: '',
|
|
113
|
+
author_title: '',
|
|
114
|
+
organization: '',
|
|
115
|
+
source_title: '',
|
|
116
|
+
source_type: '',
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
this.block.body = this.$t(
|
|
120
|
+
'windward.core.shared.settings.title.block_quote'
|
|
121
|
+
)
|
|
122
|
+
},
|
|
123
|
+
data() {
|
|
124
|
+
return {
|
|
125
|
+
valid: true,
|
|
126
|
+
loading: false,
|
|
127
|
+
sourceTypes: ['None', 'Book', 'Online Journal'],
|
|
128
|
+
}
|
|
129
|
+
},
|
|
130
|
+
beforeDestroy() {
|
|
131
|
+
if (this.debouncer) {
|
|
132
|
+
clearTimeout(this.debouncer)
|
|
133
|
+
}
|
|
134
|
+
},
|
|
135
|
+
|
|
136
|
+
methods: {},
|
|
137
|
+
}
|
|
138
|
+
</script>
|
|
139
|
+
<style scoped>
|
|
140
|
+
.v-progress-circular {
|
|
141
|
+
margin: 1rem;
|
|
142
|
+
}
|
|
143
|
+
</style>
|
|
@@ -1,34 +1,32 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<v-container>
|
|
3
3
|
<v-form>
|
|
4
|
-
<
|
|
4
|
+
<p>
|
|
5
5
|
{{
|
|
6
6
|
$t(
|
|
7
7
|
'windward.core.components.settings.open_response.question'
|
|
8
8
|
)
|
|
9
9
|
}}
|
|
10
|
-
</
|
|
10
|
+
</p>
|
|
11
11
|
<TextEditor v-model="block.body" :height="200"></TextEditor>
|
|
12
|
-
|
|
13
|
-
<h3 class="pb-2">
|
|
12
|
+
<p class="pt-4">
|
|
14
13
|
{{
|
|
15
14
|
$t(
|
|
16
15
|
'windward.core.components.settings.open_response.sample_response'
|
|
17
16
|
)
|
|
18
17
|
}}
|
|
19
|
-
</
|
|
18
|
+
</p>
|
|
20
19
|
<TextEditor
|
|
21
20
|
v-model="block.metadata.config.sample_response"
|
|
22
21
|
:height="200"
|
|
23
22
|
></TextEditor>
|
|
24
|
-
|
|
25
|
-
<h3 class="pb-2">
|
|
23
|
+
<p class="pt-4">
|
|
26
24
|
{{
|
|
27
25
|
$t(
|
|
28
26
|
'windward.core.components.settings.open_response.starting_text'
|
|
29
27
|
)
|
|
30
28
|
}}
|
|
31
|
-
</
|
|
29
|
+
</p>
|
|
32
30
|
<TextEditor
|
|
33
31
|
v-model="block.metadata.config.starting_text"
|
|
34
32
|
:height="200"
|
|
@@ -5,10 +5,10 @@
|
|
|
5
5
|
<p>{{ $t('windward.core.components.settings.tab.tabs') }}</p>
|
|
6
6
|
<SortableExpansionPanel
|
|
7
7
|
v-model="block.metadata.config.items"
|
|
8
|
+
@change="onDragged"
|
|
8
9
|
@click:close="onRemoveElement($event)"
|
|
9
|
-
:copy="false"
|
|
10
10
|
>
|
|
11
|
-
<template #header="{ item
|
|
11
|
+
<template #header="{ item }">
|
|
12
12
|
{{ item.tabHeader !== '' ? item.tabHeader : 'No Header' }}
|
|
13
13
|
</template>
|
|
14
14
|
<template #body="{ item, index }">
|
|
@@ -42,9 +42,9 @@
|
|
|
42
42
|
</v-icon>
|
|
43
43
|
</v-btn>
|
|
44
44
|
<TextEditor
|
|
45
|
-
:api_key="api_key"
|
|
46
45
|
v-model="block.metadata.config.items[index].content"
|
|
47
46
|
v-if="!item.expand"
|
|
47
|
+
:key="textEditorUpdateKey"
|
|
48
48
|
></TextEditor>
|
|
49
49
|
</v-container>
|
|
50
50
|
</template>
|
|
@@ -109,7 +109,7 @@ export default {
|
|
|
109
109
|
data() {
|
|
110
110
|
return {
|
|
111
111
|
expansionPanelKey: '0',
|
|
112
|
-
|
|
112
|
+
textEditorUpdateKey: Crypto.id(),
|
|
113
113
|
valid: true,
|
|
114
114
|
loading: false,
|
|
115
115
|
}
|
|
@@ -142,6 +142,9 @@ export default {
|
|
|
142
142
|
return (this.block.metadata.config.items[index].expand =
|
|
143
143
|
!this.block.metadata.config.items[index].expand)
|
|
144
144
|
},
|
|
145
|
+
onDragged() {
|
|
146
|
+
this.textEditorUpdateKey = Crypto.id()
|
|
147
|
+
},
|
|
145
148
|
},
|
|
146
149
|
}
|
|
147
150
|
</script>
|
|
@@ -1,14 +1,23 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div>
|
|
3
3
|
<v-card flat class="py-12">
|
|
4
|
-
<
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
4
|
+
<v-card-title>
|
|
5
|
+
{{
|
|
6
|
+
$t(
|
|
7
|
+
'windward.core.components.utils.math_expression_editor.title'
|
|
8
|
+
)
|
|
9
|
+
}}
|
|
10
|
+
</v-card-title>
|
|
11
|
+
<v-card-text>
|
|
12
|
+
<math-live-wrapper
|
|
13
|
+
ref="mathfield"
|
|
14
|
+
v-model="formula"
|
|
15
|
+
:id="mathElementId"
|
|
16
|
+
:options="options"
|
|
17
|
+
:value="value"
|
|
18
|
+
@change="submit"
|
|
19
|
+
></math-live-wrapper>
|
|
20
|
+
</v-card-text>
|
|
12
21
|
</v-card>
|
|
13
22
|
<v-card>
|
|
14
23
|
<v-card-text>
|
|
@@ -115,6 +124,7 @@
|
|
|
115
124
|
import MathHelper from '../../helpers/MathHelper'
|
|
116
125
|
import MathLiveWrapper from './MathLiveWrapper'
|
|
117
126
|
import tinymceConfig from '../../config/tinymce.config'
|
|
127
|
+
import Crypto from '~/helpers/Crypto'
|
|
118
128
|
export default {
|
|
119
129
|
components: { MathLiveWrapper },
|
|
120
130
|
layout: 'plugin',
|
|
@@ -140,6 +150,7 @@ export default {
|
|
|
140
150
|
tab: null,
|
|
141
151
|
toggle_exclusive: true,
|
|
142
152
|
panel: [],
|
|
153
|
+
mathElementId: '',
|
|
143
154
|
}
|
|
144
155
|
},
|
|
145
156
|
computed: {
|
|
@@ -158,6 +169,7 @@ export default {
|
|
|
158
169
|
},
|
|
159
170
|
},
|
|
160
171
|
beforeMount() {
|
|
172
|
+
this.mathElementId = Crypto.id()
|
|
161
173
|
if (this.mode === 'standalone') {
|
|
162
174
|
this.initStandaloneMode()
|
|
163
175
|
}
|
|
@@ -172,7 +184,6 @@ export default {
|
|
|
172
184
|
'*'
|
|
173
185
|
)
|
|
174
186
|
}
|
|
175
|
-
this.$refs.mathfield.focus()
|
|
176
187
|
},
|
|
177
188
|
created() {
|
|
178
189
|
if (this.mode === 'plugin') {
|
|
@@ -263,24 +274,28 @@ export default {
|
|
|
263
274
|
}
|
|
264
275
|
</script>
|
|
265
276
|
|
|
266
|
-
<style scoped>
|
|
277
|
+
<style lang="scss" scoped>
|
|
267
278
|
/* stylelint-disable-next-line selector-type-no-unknown */
|
|
268
279
|
math-field {
|
|
269
280
|
min-height: 150px;
|
|
270
|
-
outline: 2px solid
|
|
281
|
+
outline: 2px solid var(--v-primary-base);
|
|
271
282
|
border-radius: 4px;
|
|
283
|
+
width: 100%;
|
|
284
|
+
background: var(--v-background-base);
|
|
285
|
+
color: var(--v-primary-base);
|
|
272
286
|
}
|
|
273
287
|
/* stylelint-disable-next-line selector-type-no-unknown */
|
|
274
288
|
math-field:focus-within {
|
|
275
|
-
outline:
|
|
289
|
+
outline: 2px solid var(--v-secondary-base);
|
|
276
290
|
border-radius: 4px;
|
|
277
|
-
background:
|
|
291
|
+
background: var(--v-background-base);
|
|
292
|
+
color: var(--v-primary-base);
|
|
278
293
|
}
|
|
279
294
|
.btn {
|
|
280
295
|
cursor: pointer;
|
|
281
296
|
margin: 0 5px 5px 0;
|
|
282
297
|
border: 1px solid #595959;
|
|
283
|
-
background:
|
|
298
|
+
background: var(--v-background-base);
|
|
284
299
|
border-radius: 5px;
|
|
285
300
|
padding: 5px 10px;
|
|
286
301
|
min-height: 40px;
|
|
@@ -288,7 +303,7 @@ math-field:focus-within {
|
|
|
288
303
|
|
|
289
304
|
.btn:hover {
|
|
290
305
|
background: #595959;
|
|
291
|
-
color:
|
|
306
|
+
color: var(--v-background-base);
|
|
292
307
|
}
|
|
293
308
|
.adjustFont {
|
|
294
309
|
font-size: 12px !important;
|
|
@@ -37,6 +37,7 @@ export default {
|
|
|
37
37
|
default:
|
|
38
38
|
'undo redo | formatselect | fontsizeselect | bold italic underline strikethrough removeformat | alignleft aligncenter alignright | table bullist numlist outdent indent | mathButton ',
|
|
39
39
|
},
|
|
40
|
+
root_block: { type: String, required: false, default: 'div' },
|
|
40
41
|
},
|
|
41
42
|
beforeMount() {
|
|
42
43
|
this.text = this.value
|
|
@@ -61,6 +62,7 @@ export default {
|
|
|
61
62
|
return {
|
|
62
63
|
height: 500,
|
|
63
64
|
visual: false,
|
|
65
|
+
forced_root_block: this.root_block,
|
|
64
66
|
menubar: this.menubar,
|
|
65
67
|
menu: {
|
|
66
68
|
insert: {
|
|
@@ -6,6 +6,7 @@ import feedback from './feedback'
|
|
|
6
6
|
import open_response from './open_response'
|
|
7
7
|
import open_response_collate from './open_response_collate'
|
|
8
8
|
import scenarioChoice from './scenario_choice'
|
|
9
|
+
import block_quote from './block_quote'
|
|
9
10
|
|
|
10
11
|
export default {
|
|
11
12
|
user_upload,
|
|
@@ -16,4 +17,5 @@ export default {
|
|
|
16
17
|
open_response,
|
|
17
18
|
open_response_collate,
|
|
18
19
|
scenario_choice: scenarioChoice,
|
|
20
|
+
block_quote
|
|
19
21
|
}
|
|
@@ -8,6 +8,7 @@ import open_response_collate from './open_response_collate'
|
|
|
8
8
|
import scenarioChoice from './scenario_choice'
|
|
9
9
|
import accordion from './accordion'
|
|
10
10
|
import tab from './tab'
|
|
11
|
+
import block_quote from './block_quote'
|
|
11
12
|
|
|
12
13
|
export default {
|
|
13
14
|
accordion,
|
|
@@ -20,4 +21,5 @@ export default {
|
|
|
20
21
|
open_response,
|
|
21
22
|
open_response_collate,
|
|
22
23
|
scenario_choice: scenarioChoice,
|
|
24
|
+
block_quote,
|
|
23
25
|
}
|
|
@@ -6,6 +6,7 @@ import feedback from './feedback'
|
|
|
6
6
|
import open_response from './open_response'
|
|
7
7
|
import open_response_collate from './open_response_collate'
|
|
8
8
|
import scenarioChoice from './scenario_choice'
|
|
9
|
+
import block_quote from './block_quote'
|
|
9
10
|
|
|
10
11
|
export default {
|
|
11
12
|
user_upload,
|
|
@@ -16,4 +17,5 @@ export default {
|
|
|
16
17
|
open_response,
|
|
17
18
|
open_response_collate,
|
|
18
19
|
scenario_choice: scenarioChoice,
|
|
20
|
+
block_quote
|
|
19
21
|
}
|
|
@@ -8,6 +8,7 @@ import open_response_collate from './open_response_collate'
|
|
|
8
8
|
import scenarioChoice from './scenario_choice'
|
|
9
9
|
import accordion from './accordion'
|
|
10
10
|
import tab from './tab'
|
|
11
|
+
import block_quote from './block_quote'
|
|
11
12
|
|
|
12
13
|
export default {
|
|
13
14
|
accordion,
|
|
@@ -20,4 +21,5 @@ export default {
|
|
|
20
21
|
open_response,
|
|
21
22
|
open_response_collate,
|
|
22
23
|
scenario_choice: scenarioChoice,
|
|
24
|
+
block_quote
|
|
23
25
|
}
|
|
@@ -6,6 +6,7 @@ import feedback from './feedback'
|
|
|
6
6
|
import open_response from './open_response'
|
|
7
7
|
import open_response_collate from './open_response_collate'
|
|
8
8
|
import scenarioChoice from './scenario_choice'
|
|
9
|
+
import block_quote from './block_quote'
|
|
9
10
|
|
|
10
11
|
export default {
|
|
11
12
|
user_upload,
|
|
@@ -16,4 +17,5 @@ export default {
|
|
|
16
17
|
open_response,
|
|
17
18
|
open_response_collate,
|
|
18
19
|
scenario_choice: scenarioChoice,
|
|
20
|
+
block_quote
|
|
19
21
|
}
|
|
@@ -8,6 +8,7 @@ import open_response_collate from './open_response_collate'
|
|
|
8
8
|
import scenarioChoice from './scenario_choice'
|
|
9
9
|
import accordion from './accordion'
|
|
10
10
|
import tab from './tab'
|
|
11
|
+
import block_quote from './block_quote'
|
|
11
12
|
|
|
12
13
|
export default {
|
|
13
14
|
accordion,
|
|
@@ -20,4 +21,5 @@ export default {
|
|
|
20
21
|
open_response,
|
|
21
22
|
open_response_collate,
|
|
22
23
|
scenario_choice: scenarioChoice,
|
|
24
|
+
block_quote
|
|
23
25
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@windward/core",
|
|
3
|
-
"version": "0.0
|
|
3
|
+
"version": "0.1.0",
|
|
4
4
|
"description": "Windward UI Core Plugins",
|
|
5
5
|
"main": "plugin.js",
|
|
6
6
|
"scripts": {
|
|
@@ -16,13 +16,13 @@
|
|
|
16
16
|
"license": "MIT",
|
|
17
17
|
"homepage": "https://bitbucket.org/mindedge/windward-ui-plugin-core#readme",
|
|
18
18
|
"dependencies": {
|
|
19
|
-
"@mindedge/vuetify-player": "^0.
|
|
19
|
+
"@mindedge/vuetify-player": "^0.3.0",
|
|
20
20
|
"@tinymce/tinymce-vue": "^3.2.8",
|
|
21
21
|
"eslint": "^8.11.0",
|
|
22
22
|
"he": "^1.2.0",
|
|
23
23
|
"lodash": "^4.17.21",
|
|
24
|
-
"mathlive": "^0.
|
|
25
|
-
"mathml-to-latex": "^1.
|
|
24
|
+
"mathlive": "^0.75.0",
|
|
25
|
+
"mathml-to-latex": "^1.3.0",
|
|
26
26
|
"prettier": "^2.6.0",
|
|
27
27
|
"raw-loader": "^4.0.2"
|
|
28
28
|
},
|
package/plugin.js
CHANGED
|
@@ -9,6 +9,7 @@ import Accordion from './components/Content/Blocks/Accordion'
|
|
|
9
9
|
import Feedback from './components/Content/Blocks/Feedback.vue'
|
|
10
10
|
import ClickableIcons from './components/Content/Blocks/ClickableIcons'
|
|
11
11
|
import ScenarioChoice from './components/Content/Blocks/ScenarioChoice'
|
|
12
|
+
import BlockQuote from './components/Content/Blocks/BlockQuote.vue'
|
|
12
13
|
|
|
13
14
|
import UserUploadNav from './components/Navigation/Items/UserUploadNav.vue'
|
|
14
15
|
|
|
@@ -33,6 +34,7 @@ import VideoSettings from './components/Settings/VideoSettings.vue'
|
|
|
33
34
|
import AccordionSettings from './components/Settings/AccordionSettings.vue'
|
|
34
35
|
import TabSettings from './components/Settings/TabSettings.vue'
|
|
35
36
|
import FeedbackSettings from './components/Settings/FeedbackSettings.vue'
|
|
37
|
+
import BlockQuoteSettigns from './components/Settings/BlockQuoteSettings.vue'
|
|
36
38
|
|
|
37
39
|
import UserUploadPage from './pages/userUpload.vue'
|
|
38
40
|
import GlossaryToolTip from './components/utils/glossary/GlossaryToolTip.vue'
|
|
@@ -251,6 +253,16 @@ export default {
|
|
|
251
253
|
'windward.core.shared.content_blocks.grouping.basic',
|
|
252
254
|
},
|
|
253
255
|
},
|
|
256
|
+
{
|
|
257
|
+
tag: 'core-block-quote',
|
|
258
|
+
template: BlockQuote,
|
|
259
|
+
metadata: {
|
|
260
|
+
icon: 'mdi-format-quote-close',
|
|
261
|
+
name: 'windward.core.shared.content_blocks.title.block_quote',
|
|
262
|
+
grouping:
|
|
263
|
+
'windward.core.shared.content_blocks.grouping.basic',
|
|
264
|
+
},
|
|
265
|
+
},
|
|
254
266
|
],
|
|
255
267
|
settings: [
|
|
256
268
|
{
|
|
@@ -370,6 +382,15 @@ export default {
|
|
|
370
382
|
name: 'windward.core.shared.settings.title.feedback',
|
|
371
383
|
},
|
|
372
384
|
},
|
|
385
|
+
{
|
|
386
|
+
tag: 'core-block-quote-settings',
|
|
387
|
+
template: BlockQuoteSettigns,
|
|
388
|
+
context: ['block.core-block-quote'],
|
|
389
|
+
metadata: {
|
|
390
|
+
icon: 'mdi-notebook-outline',
|
|
391
|
+
name: 'windward.core.shared.settings.title.block_quote',
|
|
392
|
+
},
|
|
393
|
+
},
|
|
373
394
|
],
|
|
374
395
|
},
|
|
375
396
|
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { shallowMount } from '@vue/test-utils'
|
|
2
|
+
import Vuetify from 'vuetify'
|
|
3
|
+
import Vue from 'vue'
|
|
4
|
+
import { defaultMocks } from '@/test/mocks'
|
|
5
|
+
import BlockQuote from '@/components/Content/Blocks/BlockQuote'
|
|
6
|
+
|
|
7
|
+
Vue.use(Vuetify)
|
|
8
|
+
|
|
9
|
+
describe('BlockQuote', () => {
|
|
10
|
+
test('is a Vue instance', () => {
|
|
11
|
+
const wrapper = shallowMount(BlockQuote, {
|
|
12
|
+
propsData: {
|
|
13
|
+
value: {
|
|
14
|
+
body: 'block quote',
|
|
15
|
+
metadata: { config: {} },
|
|
16
|
+
},
|
|
17
|
+
},
|
|
18
|
+
})
|
|
19
|
+
expect(wrapper.vm).toBeTruthy()
|
|
20
|
+
})
|
|
21
|
+
})
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { shallowMount } from '@vue/test-utils'
|
|
2
|
+
import Vuetify from 'vuetify'
|
|
3
|
+
import Vue from 'vue'
|
|
4
|
+
|
|
5
|
+
import { defaultMocks } from '@/test/mocks'
|
|
6
|
+
import BlockQuoteSettings from '@/components/Settings/BlockQuoteSettings'
|
|
7
|
+
|
|
8
|
+
Vue.use(Vuetify)
|
|
9
|
+
|
|
10
|
+
describe('BlockQuoteSettings', () => {
|
|
11
|
+
test('is a Vue instance', () => {
|
|
12
|
+
const wrapper = shallowMount(BlockQuoteSettings, {
|
|
13
|
+
propsData: {
|
|
14
|
+
tag: 'core-block-quote-settings',
|
|
15
|
+
},
|
|
16
|
+
mocks: defaultMocks,
|
|
17
|
+
})
|
|
18
|
+
expect(wrapper.vm).toBeTruthy()
|
|
19
|
+
})
|
|
20
|
+
})
|