@windward/core 0.0.1
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/.editorconfig +13 -0
- package/.eslintrc.js +11 -0
- package/.prettierrc +4 -0
- package/README.md +86 -0
- package/babel.config.js +1 -0
- package/components/Content/Blocks/Accordion.vue +133 -0
- package/components/Content/Blocks/ClickableIcons.vue +98 -0
- package/components/Content/Blocks/Feedback.vue +323 -0
- package/components/Content/Blocks/FeedbackTemplates/FeedbackQuestionLikert.vue +95 -0
- package/components/Content/Blocks/FeedbackTemplates/FeedbackQuestionOpenResponse.vue +45 -0
- package/components/Content/Blocks/FeedbackTemplates/FeedbackQuestionTrueFalse.vue +55 -0
- package/components/Content/Blocks/Image.vue +116 -0
- package/components/Content/Blocks/Math.vue +87 -0
- package/components/Content/Blocks/Tab.vue +89 -0
- package/components/Content/Blocks/Table.vue +68 -0
- package/components/Content/Blocks/UserUpload/DisplayUserFilesTable.vue +157 -0
- package/components/Content/Blocks/UserUpload/ManageDataTableUserFiles.vue +68 -0
- package/components/Content/Blocks/UserUpload.vue +240 -0
- package/components/Content/Blocks/Video.vue +245 -0
- package/components/Navigation/Items/CourseGlossaryToolNav.vue +39 -0
- package/components/Navigation/Items/GlossaryNav.vue +32 -0
- package/components/Navigation/Items/UserUploadNav.vue +35 -0
- package/components/Settings/AccordionSettings.vue +153 -0
- package/components/Settings/ClickableIconsSettings.vue +189 -0
- package/components/Settings/FeedbackSettings.vue +92 -0
- package/components/Settings/ImageSettings.vue +124 -0
- package/components/Settings/MathSettings.vue +81 -0
- package/components/Settings/TabSettings.vue +139 -0
- package/components/Settings/TextEditorSettings.vue +249 -0
- package/components/Settings/UserUploadSettings.vue +151 -0
- package/components/Settings/VideoSettings.vue +699 -0
- package/components/utils/ContentViewer.vue +69 -0
- package/components/utils/MathExpressionEditor.vue +294 -0
- package/components/utils/MathLiveWrapper.vue +86 -0
- package/components/utils/TinyMCEWrapper.vue +103 -0
- package/components/utils/glossary/CourseGlossary.vue +284 -0
- package/components/utils/glossary/CourseGlossaryForm.vue +106 -0
- package/components/utils/glossary/GlossaryToolTip.vue +87 -0
- package/config/tinymce.config.js +136 -0
- package/helpers/GlossaryHelper.ts +137 -0
- package/helpers/GlossaryTerm.ts +31 -0
- package/helpers/MathHelper.ts +236 -0
- package/helpers/tinymce/plugin.ts +83 -0
- package/i18n/en-US/components/content/blocks/feedback.ts +28 -0
- package/i18n/en-US/components/content/blocks/image.ts +5 -0
- package/i18n/en-US/components/content/blocks/index.ts +15 -0
- package/i18n/en-US/components/content/blocks/tab.ts +4 -0
- package/i18n/en-US/components/content/blocks/table.ts +4 -0
- package/i18n/en-US/components/content/blocks/user_upload.ts +12 -0
- package/i18n/en-US/components/content/blocks/video.ts +53 -0
- package/i18n/en-US/components/content/index.ts +5 -0
- package/i18n/en-US/components/index.ts +12 -0
- package/i18n/en-US/components/navigation/image.ts +4 -0
- package/i18n/en-US/components/navigation/index.ts +7 -0
- package/i18n/en-US/components/navigation/user_upload.ts +3 -0
- package/i18n/en-US/components/settings/clickable_icon.ts +9 -0
- package/i18n/en-US/components/settings/image.ts +1 -0
- package/i18n/en-US/components/settings/index.ts +13 -0
- package/i18n/en-US/components/settings/text_editor.ts +7 -0
- package/i18n/en-US/components/settings/user_upload.ts +11 -0
- package/i18n/en-US/components/settings/video.ts +13 -0
- package/i18n/en-US/components/utils/index.ts +5 -0
- package/i18n/en-US/components/utils/tiny_mce_wrapper.ts +7 -0
- package/i18n/en-US/index.ts +16 -0
- package/i18n/en-US/modules/index.ts +5 -0
- package/i18n/en-US/pages/glossary.ts +7 -0
- package/i18n/en-US/pages/index.ts +7 -0
- package/i18n/en-US/pages/user_upload.ts +3 -0
- package/i18n/en-US/shared/content_blocks.ts +20 -0
- package/i18n/en-US/shared/index.ts +11 -0
- package/i18n/en-US/shared/menu.ts +3 -0
- package/i18n/en-US/shared/permission.ts +15 -0
- package/i18n/en-US/shared/settings.ts +15 -0
- package/index.js +15 -0
- package/jest.config.js +15 -0
- package/models/SurveyResult.ts +8 -0
- package/models/SurveyTemplate.ts +8 -0
- package/models/UserFileAsset.ts +12 -0
- package/package.json +48 -0
- package/pages/glossary.vue +31 -0
- package/pages/userUpload.vue +204 -0
- package/plugin.js +299 -0
- package/test/Components/Content/Blocks/Accordion.spec.js +21 -0
- package/test/Components/Content/Blocks/ClickableIcons.spec.js +21 -0
- package/test/Components/Content/Blocks/Feedback.spec.js +31 -0
- package/test/Components/Content/Blocks/FeedbackTemplates/FeedbackQuestionLikert.spec.js +23 -0
- package/test/Components/Content/Blocks/FeedbackTemplates/FeedbackQuestionOpenResponse.spec.js +23 -0
- package/test/Components/Content/Blocks/FeedbackTemplates/FeedbackQuestionTrueFalse.spec.js +23 -0
- package/test/Components/Content/Blocks/Image.spec.js +34 -0
- package/test/Components/Content/Blocks/Math.spec.js +34 -0
- package/test/Components/Content/Blocks/Tab.spec.js +20 -0
- package/test/Components/Content/Blocks/Table.spec.js +21 -0
- package/test/Components/Content/Blocks/UserUpload.spec.js +25 -0
- package/test/Components/Content/Blocks/Video.spec.js +112 -0
- package/test/Components/Settings/AccordionSettings.spec.js +45 -0
- package/test/Components/Settings/ClickableIconsSettings.spec.js +20 -0
- package/test/Components/Settings/FeedbackSettings.spec.js +20 -0
- package/test/Components/Settings/ImageSettings.spec.js +20 -0
- package/test/Components/Settings/MathSettings.spec.js +20 -0
- package/test/Components/Settings/TabSettings.spec.js +45 -0
- package/test/Components/Settings/UserUploadSettings.spec.js +20 -0
- package/test/__mocks__/componentsMock.js +83 -0
- package/test/__mocks__/contentBlockMock.js +119 -0
- package/test/__mocks__/contentSettingsMock.js +54 -0
- package/test/__mocks__/fileMock.js +1 -0
- package/test/__mocks__/helpersMock.js +53 -0
- package/test/__mocks__/modelMock.js +82 -0
- package/test/__mocks__/styleMock.js +1 -0
- package/test/helpers/GlossaryHelper.spec.js +227 -0
- package/test/helpers/MathHelper.spec.js +128 -0
- package/test/mocks.js +140 -0
- package/tsconfig.json +15 -0
- package/utils/index.js +18 -0
|
@@ -0,0 +1,151 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div>
|
|
3
|
+
<v-switch
|
|
4
|
+
v-model="block.metadata.config.uploadSettings.multiple"
|
|
5
|
+
:label="
|
|
6
|
+
$t(
|
|
7
|
+
'windward.core.components.settings.user_upload.accept_multiple'
|
|
8
|
+
)
|
|
9
|
+
"
|
|
10
|
+
></v-switch>
|
|
11
|
+
<v-select
|
|
12
|
+
v-model="block.metadata.config.uploadSettings.accept"
|
|
13
|
+
:hide-details="true"
|
|
14
|
+
:items="acceptOptions"
|
|
15
|
+
item-text="name"
|
|
16
|
+
item-value="value"
|
|
17
|
+
outlined
|
|
18
|
+
dense
|
|
19
|
+
:label="
|
|
20
|
+
$t('windward.core.components.settings.user_upload.accept_types')
|
|
21
|
+
"
|
|
22
|
+
></v-select>
|
|
23
|
+
<v-btn @click="onToggleExpand()" class="mt-4">
|
|
24
|
+
<v-icon v-if="!block.metadata.config.expand"
|
|
25
|
+
>mdi-arrow-expand-all</v-icon
|
|
26
|
+
>
|
|
27
|
+
<v-icon v-if="block.metadata.config.expand">
|
|
28
|
+
mdi-arrow-collapse-all
|
|
29
|
+
</v-icon>
|
|
30
|
+
</v-btn>
|
|
31
|
+
<v-row v-if="!block.metadata.config.expand">
|
|
32
|
+
<v-col cols="12">
|
|
33
|
+
<h3 class="pb-4 pt-4">
|
|
34
|
+
{{
|
|
35
|
+
$t(
|
|
36
|
+
'windward.core.components.content.blocks.user_upload.instructions_title'
|
|
37
|
+
)
|
|
38
|
+
}}
|
|
39
|
+
</h3>
|
|
40
|
+
<TextEditor v-model="block.metadata.config.instructions" />
|
|
41
|
+
</v-col>
|
|
42
|
+
</v-row>
|
|
43
|
+
<v-skeleton-loader
|
|
44
|
+
v-bind="attrs"
|
|
45
|
+
type=" table-row-divider, list-item, divider, list-item, divider, image,image"
|
|
46
|
+
v-show="block.metadata.config.expand"
|
|
47
|
+
></v-skeleton-loader>
|
|
48
|
+
</div>
|
|
49
|
+
</template>
|
|
50
|
+
<script>
|
|
51
|
+
import BaseContentSettings from '~/components/Content/Tool/BaseContentSettings.js'
|
|
52
|
+
import Crypto from '~/helpers/Crypto'
|
|
53
|
+
import TextEditor from '~/components/Text/TextEditor.vue'
|
|
54
|
+
import _ from 'lodash'
|
|
55
|
+
|
|
56
|
+
export default {
|
|
57
|
+
name: 'UserUploadSettings',
|
|
58
|
+
extends: BaseContentSettings,
|
|
59
|
+
components: { TextEditor },
|
|
60
|
+
beforeMount() {
|
|
61
|
+
if (_.isEmpty(this.block)) {
|
|
62
|
+
this.block = {}
|
|
63
|
+
}
|
|
64
|
+
if (_.isEmpty(this.block.body)) {
|
|
65
|
+
this.block.body = 'user uplaod'
|
|
66
|
+
}
|
|
67
|
+
if (_.isEmpty(this.block.metadata)) {
|
|
68
|
+
this.block.metadata = {}
|
|
69
|
+
}
|
|
70
|
+
if (_.isEmpty(this.block.metadata.config)) {
|
|
71
|
+
this.block.metadata.config = {}
|
|
72
|
+
}
|
|
73
|
+
if (_.isEmpty(this.block.metadata.config.expand)) {
|
|
74
|
+
this.block.metadata.config.expand = false
|
|
75
|
+
}
|
|
76
|
+
if (_.isEmpty(this.block.metadata.config.instructions)) {
|
|
77
|
+
this.block.metadata.config.instructions = ''
|
|
78
|
+
}
|
|
79
|
+
if (_.isEmpty(this.block.metadata.config.uploadSettings)) {
|
|
80
|
+
this.block.metadata.config.uploadSettings = {
|
|
81
|
+
multiple: false,
|
|
82
|
+
accept: '',
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
},
|
|
86
|
+
data() {
|
|
87
|
+
return {
|
|
88
|
+
valid: true,
|
|
89
|
+
debounce: null,
|
|
90
|
+
loading: false,
|
|
91
|
+
key: '',
|
|
92
|
+
acceptOptions: [
|
|
93
|
+
{
|
|
94
|
+
name: this.$t(
|
|
95
|
+
'windward.core.components.settings.user_upload.types.all'
|
|
96
|
+
),
|
|
97
|
+
value: '*',
|
|
98
|
+
},
|
|
99
|
+
{
|
|
100
|
+
name: this.$t(
|
|
101
|
+
'windward.core.components.settings.user_upload.types.all_image'
|
|
102
|
+
),
|
|
103
|
+
value: 'image/jpeg,image/gif,image/png',
|
|
104
|
+
},
|
|
105
|
+
{
|
|
106
|
+
name: this.$t(
|
|
107
|
+
'windward.core.components.settings.user_upload.types.all_word'
|
|
108
|
+
),
|
|
109
|
+
value: 'application/msword,application/vnd.openxmlformats-officedocument.wordprocessingml.document',
|
|
110
|
+
},
|
|
111
|
+
{
|
|
112
|
+
name: this.$t(
|
|
113
|
+
'windward.core.components.settings.user_upload.types.all_excel'
|
|
114
|
+
),
|
|
115
|
+
value: 'application/vnd.ms-excel,application/vnd.openxmlformats-officedocument.spreadsheetml.sheet',
|
|
116
|
+
},
|
|
117
|
+
{
|
|
118
|
+
name: this.$t(
|
|
119
|
+
'windward.core.components.settings.user_upload.types.all_zip'
|
|
120
|
+
),
|
|
121
|
+
value: 'application/zip',
|
|
122
|
+
},
|
|
123
|
+
],
|
|
124
|
+
attrs: {
|
|
125
|
+
class: 'mb-6',
|
|
126
|
+
boilerplate: true,
|
|
127
|
+
elevation: 0,
|
|
128
|
+
},
|
|
129
|
+
}
|
|
130
|
+
},
|
|
131
|
+
mounted() {},
|
|
132
|
+
beforeDestroy() {
|
|
133
|
+
if (this.debouncer) {
|
|
134
|
+
clearTimeout(this.debouncer)
|
|
135
|
+
}
|
|
136
|
+
},
|
|
137
|
+
|
|
138
|
+
methods: {
|
|
139
|
+
onToggleExpand() {
|
|
140
|
+
this.key = Crypto.id()
|
|
141
|
+
return (this.block.metadata.config.expand =
|
|
142
|
+
!this.block.metadata.config.expand)
|
|
143
|
+
},
|
|
144
|
+
},
|
|
145
|
+
}
|
|
146
|
+
</script>
|
|
147
|
+
<style scoped>
|
|
148
|
+
.v-progress-circular {
|
|
149
|
+
margin: 1rem;
|
|
150
|
+
}
|
|
151
|
+
</style>
|