@windward/core 0.4.2 → 0.5.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/.idea/codeStyles/Project.xml +58 -0
- package/.idea/codeStyles/codeStyleConfig.xml +5 -0
- package/.idea/inspectionProfiles/Project_Default.xml +6 -0
- package/.idea/modules.xml +8 -0
- package/.idea/php-docker-settings.xml +24 -0
- package/.idea/php.xml +19 -0
- package/.idea/vcs.xml +6 -0
- package/.idea/watcherTasks.xml +4 -0
- package/.idea/windward-ui-plugin-core.iml +8 -0
- package/bitbucket-pipelines.yml +14 -0
- package/components/Content/Blocks/Accordion.vue +10 -6
- package/components/Content/Blocks/ClickableIcons.vue +6 -5
- package/components/Content/Blocks/Feedback.vue +1 -1
- package/components/Content/Blocks/FileDownload/FileLinks.vue +82 -0
- package/components/Content/Blocks/FileDownload/FileTable.vue +106 -0
- package/components/Content/Blocks/FileDownload.vue +145 -0
- package/components/Content/Blocks/GenerateAIQuestionButton.vue +61 -0
- package/components/Content/Blocks/ScenarioChoice.vue +2 -2
- package/components/Content/Blocks/UserUpload.vue +15 -36
- package/components/Content/Blocks/Video.vue +2 -57
- package/components/Settings/AccordionSettings.vue +3 -6
- package/components/Settings/BlockQuoteSettings.vue +2 -2
- package/components/Settings/EmailSettings.vue +2 -2
- package/components/Settings/FileDownloadSettings.vue +168 -0
- package/components/Settings/UserUploadSettings.vue +36 -39
- package/components/utils/ContentViewer.vue +1 -0
- package/components/utils/TinyMCEWrapper.vue +18 -7
- package/components/utils/assets/tinymce/content/global.scss +10 -0
- package/config/menu.config.json +475 -0
- package/coverage/clover.xml +223 -0
- package/coverage/coverage-final.json +16 -0
- package/coverage/lcov-report/base.css +224 -0
- package/coverage/lcov-report/block-navigation.js +87 -0
- package/coverage/lcov-report/components/Content/Blocks/Accordion.vue.html +430 -0
- package/coverage/lcov-report/components/Content/Blocks/Image.vue.html +394 -0
- package/coverage/lcov-report/components/Content/Blocks/Math.vue.html +262 -0
- package/coverage/lcov-report/components/Content/Blocks/RichText.vue.html +295 -0
- package/coverage/lcov-report/components/Content/Blocks/Tab.vue.html +415 -0
- package/coverage/lcov-report/components/Content/Blocks/Table.vue.html +667 -0
- package/coverage/lcov-report/components/Content/Blocks/Video.vue.html +2275 -0
- package/coverage/lcov-report/components/Content/Blocks/index.html +206 -0
- package/coverage/lcov-report/components/utils/ContentViewer.vue.html +199 -0
- package/coverage/lcov-report/components/utils/MathExpressionEditor.vue.html +919 -0
- package/coverage/lcov-report/components/utils/MathLiveWrapper.vue.html +343 -0
- package/coverage/lcov-report/components/utils/TinyMCEWrapper.vue.html +271 -0
- package/coverage/lcov-report/components/utils/index.html +161 -0
- package/coverage/lcov-report/config/index.html +116 -0
- package/coverage/lcov-report/config/tinymce.config.js.html +493 -0
- package/coverage/lcov-report/favicon.png +0 -0
- package/coverage/lcov-report/helpers/MathHelper.ts.html +793 -0
- package/coverage/lcov-report/helpers/index.html +116 -0
- package/coverage/lcov-report/helpers/tinymce/index.html +116 -0
- package/coverage/lcov-report/helpers/tinymce/plugin.ts.html +334 -0
- package/coverage/lcov-report/index.html +191 -0
- package/coverage/lcov-report/prettify.css +1 -0
- package/coverage/lcov-report/prettify.js +2 -0
- package/coverage/lcov-report/sort-arrow-sprite.png +0 -0
- package/coverage/lcov-report/sorter.js +196 -0
- package/coverage/lcov-report/test/index.html +116 -0
- package/coverage/lcov-report/test/mocks.js.html +457 -0
- package/coverage/lcov.info +403 -0
- package/i18n/en-US/components/content/blocks/file_download.ts +5 -0
- package/i18n/en-US/components/content/blocks/generate_questions.ts +3 -0
- package/i18n/en-US/components/content/blocks/index.ts +4 -0
- package/i18n/en-US/components/content/blocks/user_upload.ts +0 -2
- package/i18n/en-US/components/settings/file_download.ts +8 -0
- package/i18n/en-US/components/settings/index.ts +2 -0
- package/i18n/en-US/shared/content_blocks.ts +1 -0
- package/i18n/en-US/shared/settings.ts +1 -3
- package/i18n/es-ES/components/content/blocks/file_download.ts +5 -0
- package/i18n/es-ES/components/content/blocks/generate_questions.ts +3 -0
- package/i18n/es-ES/components/content/blocks/index.ts +6 -2
- package/i18n/es-ES/components/content/blocks/user_upload.ts +0 -2
- package/i18n/es-ES/components/settings/file_download.ts +8 -0
- package/i18n/es-ES/components/settings/index.ts +4 -2
- package/i18n/es-ES/shared/content_blocks.ts +1 -0
- package/i18n/es-ES/shared/settings.ts +1 -3
- package/i18n/sv-SE/components/content/blocks/file_download.ts +5 -0
- package/i18n/sv-SE/components/content/blocks/generate_questions.ts +3 -0
- package/i18n/sv-SE/components/content/blocks/index.ts +4 -0
- package/i18n/sv-SE/components/content/blocks/user_upload.ts +0 -2
- package/i18n/sv-SE/components/settings/file_download.ts +8 -0
- package/i18n/sv-SE/components/settings/index.ts +4 -2
- package/i18n/sv-SE/shared/content_blocks.ts +1 -0
- package/i18n/sv-SE/shared/settings.ts +2 -4
- package/lib/helpers/GlossaryHelper.d.ts +9 -0
- package/lib/helpers/GlossaryHelper.js +118 -0
- package/lib/helpers/GlossaryTerm.d.ts +10 -0
- package/lib/helpers/GlossaryTerm.js +22 -0
- package/lib/helpers/MathHelper.d.ts +99 -0
- package/lib/helpers/MathHelper.js +194 -0
- package/lib/helpers/tinymce/plugin.d.ts +2 -0
- package/lib/helpers/tinymce/plugin.js +86 -0
- package/lib/i18n/en-US/components/content/blocks/image.d.ts +6 -0
- package/lib/i18n/en-US/components/content/blocks/image.js +7 -0
- package/lib/i18n/en-US/components/content/blocks/index.d.ts +75 -0
- package/lib/i18n/en-US/components/content/blocks/index.js +14 -0
- package/lib/i18n/en-US/components/content/blocks/tab.d.ts +5 -0
- package/lib/i18n/en-US/components/content/blocks/tab.js +6 -0
- package/lib/i18n/en-US/components/content/blocks/table.d.ts +5 -0
- package/lib/i18n/en-US/components/content/blocks/table.js +6 -0
- package/lib/i18n/en-US/components/content/blocks/user_upload.d.ts +13 -0
- package/lib/i18n/en-US/components/content/blocks/user_upload.js +14 -0
- package/lib/i18n/en-US/components/content/blocks/video.d.ts +48 -0
- package/lib/i18n/en-US/components/content/blocks/video.js +49 -0
- package/lib/i18n/en-US/components/content/index.d.ts +77 -0
- package/lib/i18n/en-US/components/content/index.js +6 -0
- package/lib/i18n/en-US/components/index.d.ts +140 -0
- package/lib/i18n/en-US/components/index.js +12 -0
- package/lib/i18n/en-US/components/navigation/image.d.ts +5 -0
- package/lib/i18n/en-US/components/navigation/image.js +6 -0
- package/lib/i18n/en-US/components/navigation/index.d.ts +10 -0
- package/lib/i18n/en-US/components/navigation/index.js +8 -0
- package/lib/i18n/en-US/components/navigation/user_upload.d.ts +4 -0
- package/lib/i18n/en-US/components/navigation/user_upload.js +5 -0
- package/lib/i18n/en-US/components/settings/clickable_icon.d.ts +6 -0
- package/lib/i18n/en-US/components/settings/clickable_icon.js +7 -0
- package/lib/i18n/en-US/components/settings/image.d.ts +2 -0
- package/lib/i18n/en-US/components/settings/image.js +3 -0
- package/lib/i18n/en-US/components/settings/index.d.ts +39 -0
- package/lib/i18n/en-US/components/settings/index.js +14 -0
- package/lib/i18n/en-US/components/settings/text_editor.d.ts +8 -0
- package/lib/i18n/en-US/components/settings/text_editor.js +9 -0
- package/lib/i18n/en-US/components/settings/user_upload.d.ts +12 -0
- package/lib/i18n/en-US/components/settings/user_upload.js +13 -0
- package/lib/i18n/en-US/components/settings/video.d.ts +13 -0
- package/lib/i18n/en-US/components/settings/video.js +14 -0
- package/lib/i18n/en-US/components/utils/index.d.ts +15 -0
- package/lib/i18n/en-US/components/utils/index.js +6 -0
- package/lib/i18n/en-US/components/utils/tiny_mce_wrapper.d.ts +13 -0
- package/lib/i18n/en-US/components/utils/tiny_mce_wrapper.js +14 -0
- package/lib/i18n/en-US/index.d.ts +197 -0
- package/lib/i18n/en-US/index.js +16 -0
- package/lib/i18n/en-US/modules/index.d.ts +2 -0
- package/lib/i18n/en-US/modules/index.js +6 -0
- package/lib/i18n/en-US/pages/glossary.d.ts +8 -0
- package/lib/i18n/en-US/pages/glossary.js +9 -0
- package/lib/i18n/en-US/pages/index.d.ts +13 -0
- package/lib/i18n/en-US/pages/index.js +8 -0
- package/lib/i18n/en-US/pages/user_upload.d.ts +4 -0
- package/lib/i18n/en-US/pages/user_upload.js +5 -0
- package/lib/i18n/en-US/shared/content_blocks.d.ts +20 -0
- package/lib/i18n/en-US/shared/content_blocks.js +21 -0
- package/lib/i18n/en-US/shared/index.d.ts +39 -0
- package/lib/i18n/en-US/shared/index.js +10 -0
- package/lib/i18n/en-US/shared/menu.d.ts +4 -0
- package/lib/i18n/en-US/shared/menu.js +5 -0
- package/lib/i18n/en-US/shared/settings.d.ts +15 -0
- package/lib/i18n/en-US/shared/settings.js +16 -0
- package/lib/i18n/en-US.d.ts +197 -0
- package/lib/i18n/en-US.js +15 -0
- package/lib/models/UserFileAsset.d.ts +5 -0
- package/lib/models/UserFileAsset.js +37 -0
- package/package.json +2 -2
- package/plugin.js +20 -0
- package/test/Components/Content/Blocks/FileDownload.spec.js +25 -0
- package/test/Components/Content/Blocks/Video.spec.js +0 -22
- package/test/Components/Settings/FileDownloadSettings.spec.js +20 -0
- package/test/Components/Settings/UserUploadSettings.spec.js +1 -1
- package/utils/index.js +2 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div>
|
|
3
|
-
<v-container>
|
|
3
|
+
<v-container class="pa-0">
|
|
4
4
|
<h2>{{ block.metadata.config.title }}</h2>
|
|
5
5
|
<h4>{{ block.metadata.config.description }}</h4>
|
|
6
6
|
<p>
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
</v-btn>
|
|
24
24
|
</div>
|
|
25
25
|
</v-container>
|
|
26
|
-
<v-container>
|
|
26
|
+
<v-container class="pa-0">
|
|
27
27
|
<v-row
|
|
28
28
|
v-for="(item, itemIndex) in block.metadata.config.items"
|
|
29
29
|
:key="itemIndex"
|
|
@@ -1,26 +1,22 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<v-container>
|
|
3
|
-
<div
|
|
2
|
+
<v-container class="pa-0">
|
|
3
|
+
<div>
|
|
4
|
+
<h2 v-if="block.metadata.config.title">
|
|
5
|
+
{{ block.metadata.config.title }}
|
|
6
|
+
</h2>
|
|
4
7
|
<v-row>
|
|
5
8
|
<v-col cols="12">
|
|
6
|
-
{{
|
|
7
|
-
$t(
|
|
8
|
-
'windward.core.components.content.blocks.user_upload.instructions'
|
|
9
|
-
)
|
|
10
|
-
}}
|
|
11
|
-
<p v-if="!block.metadata.config.instructions">
|
|
12
|
-
{{
|
|
13
|
-
$t(
|
|
14
|
-
'windward.core.components.content.blocks.user_upload.instructions_none'
|
|
15
|
-
)
|
|
16
|
-
}}
|
|
17
|
-
</p>
|
|
18
9
|
<TextViewer
|
|
10
|
+
v-if="render || !block.__expandInstructions"
|
|
19
11
|
v-model="block.metadata.config.instructions"
|
|
20
12
|
></TextViewer>
|
|
13
|
+
<TextEditor
|
|
14
|
+
v-if="!render && block.__expandInstructions"
|
|
15
|
+
v-model="block.metadata.config.instructions"
|
|
16
|
+
/>
|
|
21
17
|
</v-col>
|
|
22
|
-
<v-col cols="12">
|
|
23
|
-
<v-alert
|
|
18
|
+
<v-col v-if="!blockExists" cols="12">
|
|
19
|
+
<v-alert color="warning">
|
|
24
20
|
<p>
|
|
25
21
|
{{
|
|
26
22
|
$t(
|
|
@@ -73,20 +69,6 @@
|
|
|
73
69
|
</v-col>
|
|
74
70
|
</v-row>
|
|
75
71
|
</div>
|
|
76
|
-
<div v-if="!render && block.metadata.config.expand">
|
|
77
|
-
<v-row>
|
|
78
|
-
<v-col cols="12">
|
|
79
|
-
<h3 class="pb-4">
|
|
80
|
-
{{
|
|
81
|
-
$t(
|
|
82
|
-
'windward.core.components.content.blocks.user_upload.instructions_title'
|
|
83
|
-
)
|
|
84
|
-
}}
|
|
85
|
-
</h3>
|
|
86
|
-
<TextEditor v-model="block.metadata.config.instructions" />
|
|
87
|
-
</v-col>
|
|
88
|
-
</v-row>
|
|
89
|
-
</div>
|
|
90
72
|
</v-container>
|
|
91
73
|
</template>
|
|
92
74
|
|
|
@@ -119,6 +101,9 @@ export default {
|
|
|
119
101
|
if (_.isEmpty(this.block)) {
|
|
120
102
|
this.block = {}
|
|
121
103
|
}
|
|
104
|
+
// Default the instructions to collapsed
|
|
105
|
+
this.block.__expandInstructions = false
|
|
106
|
+
|
|
122
107
|
if (_.isEmpty(this.block.body)) {
|
|
123
108
|
this.block.body = this.$t(
|
|
124
109
|
'windward.core.shared.content_blocks.title.user_upload'
|
|
@@ -130,9 +115,6 @@ export default {
|
|
|
130
115
|
if (_.isEmpty(this.block.metadata.config)) {
|
|
131
116
|
this.block.metadata.config = {}
|
|
132
117
|
}
|
|
133
|
-
if (_.isEmpty(this.block.metadata.config.expand)) {
|
|
134
|
-
this.block.metadata.config.expand = false
|
|
135
|
-
}
|
|
136
118
|
if (_.isEmpty(this.block.metadata.config.instructions)) {
|
|
137
119
|
this.block.metadata.config.instructions = ''
|
|
138
120
|
}
|
|
@@ -271,9 +253,6 @@ export default {
|
|
|
271
253
|
.first()
|
|
272
254
|
}
|
|
273
255
|
},
|
|
274
|
-
async onBeforeSave() {
|
|
275
|
-
return (this.block.metadata.config.expand = false)
|
|
276
|
-
},
|
|
277
256
|
},
|
|
278
257
|
}
|
|
279
258
|
</script>
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
type="image, image, list-item-avatar"
|
|
22
22
|
class="reload-skeleton"
|
|
23
23
|
></v-skeleton-loader>
|
|
24
|
-
<h2 v-if="block.metadata.config.title"
|
|
24
|
+
<h2 v-if="block.metadata.config.title">
|
|
25
25
|
{{ block.metadata.config.title }}
|
|
26
26
|
</h2>
|
|
27
27
|
<VuetifyPlayer
|
|
@@ -158,10 +158,7 @@ export default {
|
|
|
158
158
|
data() {
|
|
159
159
|
return {
|
|
160
160
|
saveState: false,
|
|
161
|
-
|
|
162
161
|
fileTab: null,
|
|
163
|
-
|
|
164
|
-
saveKey: null, // Used for checking changes in settings
|
|
165
162
|
// Default config settings
|
|
166
163
|
defaultConfig: {
|
|
167
164
|
// Default settings for new blocks
|
|
@@ -247,63 +244,11 @@ export default {
|
|
|
247
244
|
this.$set(this.block, 'assets', [])
|
|
248
245
|
}
|
|
249
246
|
},
|
|
250
|
-
mounted() {
|
|
251
|
-
this.saveKey = this.settingsKey()
|
|
252
|
-
},
|
|
247
|
+
mounted() {},
|
|
253
248
|
methods: {
|
|
254
|
-
/**
|
|
255
|
-
* Hash out the settings to see if there's any changes
|
|
256
|
-
*/
|
|
257
|
-
settingsKey() {
|
|
258
|
-
const str = JSON.stringify(this.block.metadata.config)
|
|
259
|
-
return str.split('').reduce(function (a, b) {
|
|
260
|
-
a = (a << 5) - a + b.charCodeAt(0)
|
|
261
|
-
return a & a
|
|
262
|
-
}, 0)
|
|
263
|
-
},
|
|
264
|
-
async onActionPanelEdit() {
|
|
265
|
-
// Push any setting changes up
|
|
266
|
-
await this.onBeforeSave
|
|
267
|
-
|
|
268
|
-
// We're moving from edit mode to render mode
|
|
269
|
-
// Prompt about any unsaved changes
|
|
270
|
-
if (!this.render && this.settingsKey() !== this.saveKey) {
|
|
271
|
-
const self = this
|
|
272
|
-
this.$toast.info(this.$t('shared.forms.unsaved'), {
|
|
273
|
-
icon: 'mdi-help',
|
|
274
|
-
duration: null,
|
|
275
|
-
action: [
|
|
276
|
-
{
|
|
277
|
-
text: this.$t('shared.forms.cancel'),
|
|
278
|
-
onClick: (e, toastObject) => {
|
|
279
|
-
toastObject.goAway(0)
|
|
280
|
-
self.render = true
|
|
281
|
-
},
|
|
282
|
-
},
|
|
283
|
-
{
|
|
284
|
-
text: this.$t('shared.forms.confirm'),
|
|
285
|
-
// router navigation
|
|
286
|
-
onClick: async (e, toastObject) => {
|
|
287
|
-
await this.onBeforeSave()
|
|
288
|
-
// Saved, rehash the setting changes key
|
|
289
|
-
this.saveKey = this.settingsKey()
|
|
290
|
-
|
|
291
|
-
self.render = true
|
|
292
|
-
toastObject.goAway(0)
|
|
293
|
-
},
|
|
294
|
-
},
|
|
295
|
-
],
|
|
296
|
-
})
|
|
297
|
-
} else {
|
|
298
|
-
this.render = !this.render
|
|
299
|
-
}
|
|
300
|
-
},
|
|
301
249
|
async onBeforeSave() {
|
|
302
250
|
this.block.body = 'video'
|
|
303
251
|
},
|
|
304
|
-
onAfterSave() {
|
|
305
|
-
this.saveKey = this.settingsKey()
|
|
306
|
-
},
|
|
307
252
|
},
|
|
308
253
|
}
|
|
309
254
|
</script>
|
|
@@ -18,9 +18,7 @@
|
|
|
18
18
|
<template #header="{ item }">{{
|
|
19
19
|
item.header
|
|
20
20
|
? item.header
|
|
21
|
-
: $t(
|
|
22
|
-
'windward.core.shared.settings.title.placeholder'
|
|
23
|
-
)
|
|
21
|
+
: $t('components.content.settings.base.placeholder')
|
|
24
22
|
}}</template>
|
|
25
23
|
<template #body="{ index }">
|
|
26
24
|
<v-container :key="expansionPanelKey">
|
|
@@ -31,9 +29,7 @@
|
|
|
31
29
|
:autofocus="true"
|
|
32
30
|
outlined
|
|
33
31
|
:label="
|
|
34
|
-
$t(
|
|
35
|
-
'windward.core.shared.settings.title.title'
|
|
36
|
-
)
|
|
32
|
+
$t('components.content.settings.base.title')
|
|
37
33
|
"
|
|
38
34
|
:disabled="render"
|
|
39
35
|
@focus="onTextAreaFocus"
|
|
@@ -41,6 +37,7 @@
|
|
|
41
37
|
<v-btn
|
|
42
38
|
text
|
|
43
39
|
elevation="0"
|
|
40
|
+
class="mb-3"
|
|
44
41
|
:disabled="render"
|
|
45
42
|
@click="
|
|
46
43
|
onToggleExpand(
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
outlined
|
|
8
8
|
:counter="50"
|
|
9
9
|
:autofocus="true"
|
|
10
|
-
:label="$t('
|
|
10
|
+
:label="$t('components.content.settings.base.title')"
|
|
11
11
|
ref="title"
|
|
12
12
|
:disabled="render"
|
|
13
13
|
></v-text-field>
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
outlined
|
|
17
17
|
auto-grow
|
|
18
18
|
:counter="255"
|
|
19
|
-
:label="$t('
|
|
19
|
+
:label="$t('components.content.settings.base.instructions')"
|
|
20
20
|
:disabled="render"
|
|
21
21
|
></v-textarea>
|
|
22
22
|
</v-container>
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
outlined
|
|
9
9
|
:counter="50"
|
|
10
10
|
:autofocus="true"
|
|
11
|
-
:label="$t('
|
|
11
|
+
:label="$t('components.content.settings.base.title')"
|
|
12
12
|
:disabled="render"
|
|
13
13
|
></v-text-field>
|
|
14
14
|
<v-textarea
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
outlined
|
|
17
17
|
auto-grow
|
|
18
18
|
:counter="255"
|
|
19
|
-
:label="$t('
|
|
19
|
+
:label="$t('components.content.settings.base.instructions')"
|
|
20
20
|
:disabled="render"
|
|
21
21
|
></v-textarea>
|
|
22
22
|
</v-container>
|
|
@@ -0,0 +1,168 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div>
|
|
3
|
+
<v-text-field
|
|
4
|
+
v-model="block.metadata.config.title"
|
|
5
|
+
outlined
|
|
6
|
+
:counter="50"
|
|
7
|
+
:autofocus="true"
|
|
8
|
+
:label="$t('components.content.settings.base.title_optional')"
|
|
9
|
+
:disabled="render"
|
|
10
|
+
></v-text-field>
|
|
11
|
+
<TextEditor
|
|
12
|
+
v-model="block.metadata.config.instructions"
|
|
13
|
+
:disabled="render"
|
|
14
|
+
:label="
|
|
15
|
+
$t('components.content.settings.base.instructions_optional')
|
|
16
|
+
"
|
|
17
|
+
/>
|
|
18
|
+
<v-switch
|
|
19
|
+
v-model="block.metadata.config.display_detailed"
|
|
20
|
+
:label="
|
|
21
|
+
$t(
|
|
22
|
+
'windward.core.components.settings.file_download.display_detailed'
|
|
23
|
+
)
|
|
24
|
+
"
|
|
25
|
+
:disabled="render"
|
|
26
|
+
></v-switch>
|
|
27
|
+
<v-spacer class="my-6" />
|
|
28
|
+
|
|
29
|
+
<SortableExpansionPanel
|
|
30
|
+
v-model="block.metadata.config.items"
|
|
31
|
+
:disabled="render"
|
|
32
|
+
@click:close="onRemoveElement($event)"
|
|
33
|
+
>
|
|
34
|
+
<template #header="{ item }">{{ filename(item) }}</template>
|
|
35
|
+
<template #body="{ index }">
|
|
36
|
+
<v-container>
|
|
37
|
+
<v-text-field
|
|
38
|
+
v-model="block.metadata.config.items[index].name"
|
|
39
|
+
:autofocus="true"
|
|
40
|
+
outlined
|
|
41
|
+
:label="
|
|
42
|
+
$t(
|
|
43
|
+
'windward.core.components.settings.file_download.filename_optional'
|
|
44
|
+
)
|
|
45
|
+
"
|
|
46
|
+
:disabled="render"
|
|
47
|
+
></v-text-field>
|
|
48
|
+
<v-container class="pa-0 pt-3">
|
|
49
|
+
<ContentBlockAsset
|
|
50
|
+
v-model="block.metadata.config.items[index].file"
|
|
51
|
+
:assets.sync="block.assets"
|
|
52
|
+
:label="$t('shared.file.file')"
|
|
53
|
+
:disabled="render"
|
|
54
|
+
>
|
|
55
|
+
<template #title>
|
|
56
|
+
{{
|
|
57
|
+
$t(
|
|
58
|
+
'windward.core.components.settings.file_download.place_file'
|
|
59
|
+
)
|
|
60
|
+
}}
|
|
61
|
+
</template>
|
|
62
|
+
</ContentBlockAsset>
|
|
63
|
+
</v-container>
|
|
64
|
+
</v-container>
|
|
65
|
+
</template>
|
|
66
|
+
</SortableExpansionPanel>
|
|
67
|
+
|
|
68
|
+
<v-container class="pa-0">
|
|
69
|
+
<v-row justify="center" class="my-4">
|
|
70
|
+
<v-btn
|
|
71
|
+
color="primary"
|
|
72
|
+
elevation="0"
|
|
73
|
+
:disabled="render"
|
|
74
|
+
@click="onAddElement"
|
|
75
|
+
><v-icon>mdi-plus</v-icon
|
|
76
|
+
>{{
|
|
77
|
+
$t(
|
|
78
|
+
'windward.core.components.settings.file_download.add'
|
|
79
|
+
)
|
|
80
|
+
}}</v-btn
|
|
81
|
+
>
|
|
82
|
+
</v-row>
|
|
83
|
+
</v-container>
|
|
84
|
+
</div>
|
|
85
|
+
</template>
|
|
86
|
+
<script>
|
|
87
|
+
import BaseContentSettings from '~/components/Content/Settings/BaseContentSettings.js'
|
|
88
|
+
import TextEditor from '~/components/Text/TextEditor'
|
|
89
|
+
import _ from 'lodash'
|
|
90
|
+
import SortableExpansionPanel from '~/components/Core/SortableExpansionPanel.vue'
|
|
91
|
+
|
|
92
|
+
export default {
|
|
93
|
+
name: 'FileDownloadSettings',
|
|
94
|
+
extends: BaseContentSettings,
|
|
95
|
+
components: { TextEditor, SortableExpansionPanel },
|
|
96
|
+
data() {
|
|
97
|
+
return {}
|
|
98
|
+
},
|
|
99
|
+
computed: {
|
|
100
|
+
filename() {
|
|
101
|
+
return (item) => {
|
|
102
|
+
let filename = item.name
|
|
103
|
+
|
|
104
|
+
if (!filename && item.file) {
|
|
105
|
+
const asset = this.resolveAsset(item.file)
|
|
106
|
+
filename =
|
|
107
|
+
_.get(asset, 'name', '') ||
|
|
108
|
+
_.get(asset, 'asset.name', '')
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
if (!filename && item.file) {
|
|
112
|
+
filename = this.$t(
|
|
113
|
+
'windward.core.components.settings.file_download.no_file_selected'
|
|
114
|
+
)
|
|
115
|
+
}
|
|
116
|
+
return filename
|
|
117
|
+
}
|
|
118
|
+
},
|
|
119
|
+
},
|
|
120
|
+
beforeMount() {
|
|
121
|
+
if (_.isEmpty(this.block)) {
|
|
122
|
+
this.block = {}
|
|
123
|
+
}
|
|
124
|
+
if (_.isEmpty(this.block.body)) {
|
|
125
|
+
this.block.body = this.$t(
|
|
126
|
+
'windward.core.shared.content_blocks.title.file_download'
|
|
127
|
+
)
|
|
128
|
+
}
|
|
129
|
+
if (_.isEmpty(this.block.metadata)) {
|
|
130
|
+
this.block.metadata = {}
|
|
131
|
+
}
|
|
132
|
+
if (_.isEmpty(this.block.metadata.config)) {
|
|
133
|
+
this.block.metadata.config = {}
|
|
134
|
+
}
|
|
135
|
+
if (_.isEmpty(this.block.metadata.config.title)) {
|
|
136
|
+
this.block.metadata.config.title = ''
|
|
137
|
+
}
|
|
138
|
+
if (_.isEmpty(this.block.metadata.config.instructions)) {
|
|
139
|
+
this.block.metadata.config.instructions = ''
|
|
140
|
+
}
|
|
141
|
+
if (!_.isBoolean(this.block.metadata.config.display_detailed)) {
|
|
142
|
+
this.block.metadata.config.display_detailed = false
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
if (_.isEmpty(this.block.metadata.config.items)) {
|
|
146
|
+
this.block.metadata.config.items = []
|
|
147
|
+
}
|
|
148
|
+
},
|
|
149
|
+
mounted() {},
|
|
150
|
+
methods: {
|
|
151
|
+
onAddElement() {
|
|
152
|
+
const defaultItem = {
|
|
153
|
+
name: '',
|
|
154
|
+
file: null,
|
|
155
|
+
}
|
|
156
|
+
this.block.metadata.config.items.push(defaultItem)
|
|
157
|
+
},
|
|
158
|
+
onRemoveElement(index) {
|
|
159
|
+
this.block.metadata.config.items.splice(index, 1)
|
|
160
|
+
},
|
|
161
|
+
},
|
|
162
|
+
}
|
|
163
|
+
</script>
|
|
164
|
+
<style scoped>
|
|
165
|
+
.v-progress-circular {
|
|
166
|
+
margin: 1rem;
|
|
167
|
+
}
|
|
168
|
+
</style>
|
|
@@ -1,5 +1,33 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div>
|
|
3
|
+
<v-text-field
|
|
4
|
+
v-model="block.metadata.config.title"
|
|
5
|
+
outlined
|
|
6
|
+
:counter="50"
|
|
7
|
+
:autofocus="true"
|
|
8
|
+
:label="$t('components.content.settings.base.title_optional')"
|
|
9
|
+
:disabled="render"
|
|
10
|
+
></v-text-field>
|
|
11
|
+
<v-btn
|
|
12
|
+
elevation="0"
|
|
13
|
+
text
|
|
14
|
+
class="mb-4"
|
|
15
|
+
:disabled="render"
|
|
16
|
+
@click="block.__expandInstructions = !block.__expandInstructions"
|
|
17
|
+
>
|
|
18
|
+
<v-icon v-if="!block.__expandInstructions" color="primary"
|
|
19
|
+
>mdi-arrow-expand-all</v-icon
|
|
20
|
+
>
|
|
21
|
+
<v-icon v-if="block.__expandInstructions" color="primary">
|
|
22
|
+
mdi-arrow-collapse-all
|
|
23
|
+
</v-icon>
|
|
24
|
+
</v-btn>
|
|
25
|
+
<TextEditor
|
|
26
|
+
v-model="block.metadata.config.instructions"
|
|
27
|
+
:label="$t('components.content.settings.base.instructions')"
|
|
28
|
+
:loading="block.__expandInstructions"
|
|
29
|
+
:disabled="render"
|
|
30
|
+
/>
|
|
3
31
|
<v-switch
|
|
4
32
|
v-model="block.metadata.config.uploadSettings.multiple"
|
|
5
33
|
:label="
|
|
@@ -22,34 +50,6 @@
|
|
|
22
50
|
"
|
|
23
51
|
:disabled="render"
|
|
24
52
|
></v-select>
|
|
25
|
-
<v-btn elevation="0" text class="mt-4" :disabled="render" @click="onToggleExpand()">
|
|
26
|
-
<v-icon v-if="!block.metadata.config.expand" color="primary"
|
|
27
|
-
>mdi-arrow-expand-all</v-icon
|
|
28
|
-
>
|
|
29
|
-
<v-icon v-if="block.metadata.config.expand" color="primary">
|
|
30
|
-
mdi-arrow-collapse-all
|
|
31
|
-
</v-icon>
|
|
32
|
-
</v-btn>
|
|
33
|
-
<v-row v-if="!block.metadata.config.expand">
|
|
34
|
-
<v-col cols="12">
|
|
35
|
-
<h4 class="pb-4 pt-4">
|
|
36
|
-
{{
|
|
37
|
-
$t(
|
|
38
|
-
'windward.core.components.content.blocks.user_upload.instructions_title'
|
|
39
|
-
)
|
|
40
|
-
}}
|
|
41
|
-
</h4>
|
|
42
|
-
<TextEditor
|
|
43
|
-
v-model="block.metadata.config.instructions"
|
|
44
|
-
:disabled="render"
|
|
45
|
-
/>
|
|
46
|
-
</v-col>
|
|
47
|
-
</v-row>
|
|
48
|
-
<v-skeleton-loader
|
|
49
|
-
v-bind="attrs"
|
|
50
|
-
type=" table-row-divider, list-item, divider, list-item, divider, image,image"
|
|
51
|
-
v-show="block.metadata.config.expand"
|
|
52
|
-
></v-skeleton-loader>
|
|
53
53
|
</div>
|
|
54
54
|
</template>
|
|
55
55
|
<script>
|
|
@@ -66,6 +66,10 @@ export default {
|
|
|
66
66
|
if (_.isEmpty(this.block)) {
|
|
67
67
|
this.block = {}
|
|
68
68
|
}
|
|
69
|
+
|
|
70
|
+
// Default the instructions to collapsed
|
|
71
|
+
this.block.__expandInstructions = false
|
|
72
|
+
|
|
69
73
|
if (_.isEmpty(this.block.body)) {
|
|
70
74
|
this.block.body = this.$t(
|
|
71
75
|
'windward.core.shared.content_blocks.title.user_upload'
|
|
@@ -77,10 +81,10 @@ export default {
|
|
|
77
81
|
if (_.isEmpty(this.block.metadata.config)) {
|
|
78
82
|
this.block.metadata.config = {}
|
|
79
83
|
}
|
|
80
|
-
if (_.isEmpty(this.block.metadata.config.
|
|
81
|
-
this.block.metadata.config.
|
|
84
|
+
if (_.isEmpty(this.block.metadata.config.title)) {
|
|
85
|
+
this.block.metadata.config.title = ''
|
|
82
86
|
}
|
|
83
|
-
if (_.isEmpty(this.block.metadata.config.
|
|
87
|
+
if (_.isEmpty(this.block.metadata.config.title)) {
|
|
84
88
|
this.block.metadata.config.instructions = ''
|
|
85
89
|
}
|
|
86
90
|
if (_.isEmpty(this.block.metadata.config.uploadSettings)) {
|
|
@@ -95,7 +99,6 @@ export default {
|
|
|
95
99
|
valid: true,
|
|
96
100
|
debounce: null,
|
|
97
101
|
loading: false,
|
|
98
|
-
key: '',
|
|
99
102
|
acceptOptions: [
|
|
100
103
|
{
|
|
101
104
|
name: this.$t(
|
|
@@ -142,13 +145,7 @@ export default {
|
|
|
142
145
|
}
|
|
143
146
|
},
|
|
144
147
|
|
|
145
|
-
methods: {
|
|
146
|
-
onToggleExpand() {
|
|
147
|
-
this.key = Crypto.id()
|
|
148
|
-
return (this.block.metadata.config.expand =
|
|
149
|
-
!this.block.metadata.config.expand)
|
|
150
|
-
},
|
|
151
|
-
},
|
|
148
|
+
methods: {},
|
|
152
149
|
}
|
|
153
150
|
</script>
|
|
154
151
|
<style scoped>
|
|
@@ -6,6 +6,7 @@
|
|
|
6
6
|
(isDarkTheme ? '--theme-dark' : '--theme-light')
|
|
7
7
|
"
|
|
8
8
|
>
|
|
9
|
+
<label v-if="label" class="editor-label">{{ label }}</label>
|
|
9
10
|
<Editor
|
|
10
11
|
:key="seed + (isDarkTheme ? '-theme-dark' : '-theme-light')"
|
|
11
12
|
v-model="text"
|
|
@@ -44,7 +45,7 @@
|
|
|
44
45
|
</v-btn-toggle>
|
|
45
46
|
|
|
46
47
|
<v-btn
|
|
47
|
-
v-if="render"
|
|
48
|
+
v-if="render && !inline"
|
|
48
49
|
color="primary"
|
|
49
50
|
elevation="0"
|
|
50
51
|
outlined
|
|
@@ -142,6 +143,7 @@ export default {
|
|
|
142
143
|
},
|
|
143
144
|
root_block: { type: String, required: false, default: 'div' },
|
|
144
145
|
label: { type: String, required: true, default: '' },
|
|
146
|
+
inline: { type: Boolean, required: false, default: false },
|
|
145
147
|
allowRead: { type: Boolean, required: false, default: false },
|
|
146
148
|
},
|
|
147
149
|
beforeMount() {
|
|
@@ -242,6 +244,7 @@ export default {
|
|
|
242
244
|
'WindwardToolKit',
|
|
243
245
|
],
|
|
244
246
|
toolbar: this.filteredToolbar,
|
|
247
|
+
inline: this.inline,
|
|
245
248
|
table_advtab: false,
|
|
246
249
|
table_cell_advtab: false,
|
|
247
250
|
table_row_advtab: false,
|
|
@@ -321,7 +324,7 @@ export default {
|
|
|
321
324
|
value: 'windward-table-subject-report',
|
|
322
325
|
},
|
|
323
326
|
],
|
|
324
|
-
setup() {
|
|
327
|
+
setup(_editor) {
|
|
325
328
|
// Here we can add plugin
|
|
326
329
|
getTinymce().PluginManager.add(
|
|
327
330
|
'WindwardToolKit',
|
|
@@ -429,9 +432,7 @@ export default {
|
|
|
429
432
|
],
|
|
430
433
|
placeholder: this.label
|
|
431
434
|
? this.label
|
|
432
|
-
: this.$t(
|
|
433
|
-
'windward.core.shared.settings.title.placeholder'
|
|
434
|
-
),
|
|
435
|
+
: this.$t('components.content.settings.base.placeholder'),
|
|
435
436
|
//required as it will be displayed as inline style in tinymce renderer
|
|
436
437
|
skin: false,
|
|
437
438
|
content_css: this.$vuetify.theme.isDark ? 'dark' : 'default',
|
|
@@ -534,12 +535,22 @@ export default {
|
|
|
534
535
|
}
|
|
535
536
|
</script>
|
|
536
537
|
|
|
538
|
+
<style lang="scss" scoped>
|
|
539
|
+
.editor-label {
|
|
540
|
+
font-size: 1rem;
|
|
541
|
+
margin-top: -1rem;
|
|
542
|
+
display: block;
|
|
543
|
+
transform-origin: top left;
|
|
544
|
+
transform: scale(0.75);
|
|
545
|
+
}
|
|
546
|
+
</style>
|
|
547
|
+
|
|
537
548
|
<style lang="scss">
|
|
538
|
-
html
|
|
549
|
+
html body.theme--light {
|
|
539
550
|
@import './assets/tinymce/ui/light/content.scss';
|
|
540
551
|
@import './assets/tinymce/ui/light/skin.scss';
|
|
541
552
|
}
|
|
542
|
-
html
|
|
553
|
+
html body.theme--dark {
|
|
543
554
|
@import './assets/tinymce/ui/dark/content.scss';
|
|
544
555
|
@import './assets/tinymce/ui/dark/skin.scss';
|
|
545
556
|
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
@import '~/assets/sass/global.scss';
|
|
1
2
|
table {
|
|
2
3
|
max-width: 100%;
|
|
3
4
|
border: 1px solid var(--v-primary-base);
|
|
@@ -190,6 +191,15 @@ body {
|
|
|
190
191
|
font-family: 'Roboto', sans-serif;
|
|
191
192
|
}
|
|
192
193
|
|
|
194
|
+
h1, h2, h3, h4, h5, h6, ul, ol, table {
|
|
195
|
+
margin-top:16px;
|
|
196
|
+
margin-bottom:16px;
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
li::marker {
|
|
200
|
+
font-weight: bold;
|
|
201
|
+
}
|
|
202
|
+
|
|
193
203
|
html:has(body.editor--theme-light) {
|
|
194
204
|
@import './light/content.scss';
|
|
195
205
|
}
|