@windward/core 0.4.3 → 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.
Files changed (159) hide show
  1. package/.idea/codeStyles/Project.xml +58 -0
  2. package/.idea/codeStyles/codeStyleConfig.xml +5 -0
  3. package/.idea/inspectionProfiles/Project_Default.xml +6 -0
  4. package/.idea/modules.xml +8 -0
  5. package/.idea/php-docker-settings.xml +24 -0
  6. package/.idea/php.xml +19 -0
  7. package/.idea/vcs.xml +6 -0
  8. package/.idea/watcherTasks.xml +4 -0
  9. package/.idea/windward-ui-plugin-core.iml +8 -0
  10. package/components/Content/Blocks/Accordion.vue +10 -6
  11. package/components/Content/Blocks/ClickableIcons.vue +6 -5
  12. package/components/Content/Blocks/Feedback.vue +1 -1
  13. package/components/Content/Blocks/FileDownload/FileLinks.vue +82 -0
  14. package/components/Content/Blocks/FileDownload/FileTable.vue +106 -0
  15. package/components/Content/Blocks/FileDownload.vue +145 -0
  16. package/components/Content/Blocks/GenerateAIQuestionButton.vue +61 -0
  17. package/components/Content/Blocks/ScenarioChoice.vue +2 -2
  18. package/components/Content/Blocks/UserUpload.vue +15 -36
  19. package/components/Content/Blocks/Video.vue +2 -57
  20. package/components/Settings/AccordionSettings.vue +3 -6
  21. package/components/Settings/BlockQuoteSettings.vue +2 -2
  22. package/components/Settings/EmailSettings.vue +2 -2
  23. package/components/Settings/FileDownloadSettings.vue +168 -0
  24. package/components/Settings/UserUploadSettings.vue +36 -39
  25. package/components/utils/ContentViewer.vue +1 -0
  26. package/components/utils/TinyMCEWrapper.vue +15 -16
  27. package/components/utils/assets/tinymce/content/global.scss +10 -0
  28. package/config/menu.config.json +475 -0
  29. package/coverage/clover.xml +223 -0
  30. package/coverage/coverage-final.json +16 -0
  31. package/coverage/lcov-report/base.css +224 -0
  32. package/coverage/lcov-report/block-navigation.js +87 -0
  33. package/coverage/lcov-report/components/Content/Blocks/Accordion.vue.html +430 -0
  34. package/coverage/lcov-report/components/Content/Blocks/Image.vue.html +394 -0
  35. package/coverage/lcov-report/components/Content/Blocks/Math.vue.html +262 -0
  36. package/coverage/lcov-report/components/Content/Blocks/RichText.vue.html +295 -0
  37. package/coverage/lcov-report/components/Content/Blocks/Tab.vue.html +415 -0
  38. package/coverage/lcov-report/components/Content/Blocks/Table.vue.html +667 -0
  39. package/coverage/lcov-report/components/Content/Blocks/Video.vue.html +2275 -0
  40. package/coverage/lcov-report/components/Content/Blocks/index.html +206 -0
  41. package/coverage/lcov-report/components/utils/ContentViewer.vue.html +199 -0
  42. package/coverage/lcov-report/components/utils/MathExpressionEditor.vue.html +919 -0
  43. package/coverage/lcov-report/components/utils/MathLiveWrapper.vue.html +343 -0
  44. package/coverage/lcov-report/components/utils/TinyMCEWrapper.vue.html +271 -0
  45. package/coverage/lcov-report/components/utils/index.html +161 -0
  46. package/coverage/lcov-report/config/index.html +116 -0
  47. package/coverage/lcov-report/config/tinymce.config.js.html +493 -0
  48. package/coverage/lcov-report/favicon.png +0 -0
  49. package/coverage/lcov-report/helpers/MathHelper.ts.html +793 -0
  50. package/coverage/lcov-report/helpers/index.html +116 -0
  51. package/coverage/lcov-report/helpers/tinymce/index.html +116 -0
  52. package/coverage/lcov-report/helpers/tinymce/plugin.ts.html +334 -0
  53. package/coverage/lcov-report/index.html +191 -0
  54. package/coverage/lcov-report/prettify.css +1 -0
  55. package/coverage/lcov-report/prettify.js +2 -0
  56. package/coverage/lcov-report/sort-arrow-sprite.png +0 -0
  57. package/coverage/lcov-report/sorter.js +196 -0
  58. package/coverage/lcov-report/test/index.html +116 -0
  59. package/coverage/lcov-report/test/mocks.js.html +457 -0
  60. package/coverage/lcov.info +403 -0
  61. package/i18n/en-US/components/content/blocks/file_download.ts +5 -0
  62. package/i18n/en-US/components/content/blocks/generate_questions.ts +3 -0
  63. package/i18n/en-US/components/content/blocks/index.ts +4 -0
  64. package/i18n/en-US/components/content/blocks/user_upload.ts +0 -2
  65. package/i18n/en-US/components/settings/file_download.ts +8 -0
  66. package/i18n/en-US/components/settings/index.ts +2 -0
  67. package/i18n/en-US/shared/content_blocks.ts +1 -0
  68. package/i18n/en-US/shared/settings.ts +1 -3
  69. package/i18n/es-ES/components/content/blocks/file_download.ts +5 -0
  70. package/i18n/es-ES/components/content/blocks/generate_questions.ts +3 -0
  71. package/i18n/es-ES/components/content/blocks/index.ts +6 -2
  72. package/i18n/es-ES/components/content/blocks/user_upload.ts +0 -2
  73. package/i18n/es-ES/components/settings/file_download.ts +8 -0
  74. package/i18n/es-ES/components/settings/index.ts +4 -2
  75. package/i18n/es-ES/shared/content_blocks.ts +1 -0
  76. package/i18n/es-ES/shared/settings.ts +1 -3
  77. package/i18n/sv-SE/components/content/blocks/file_download.ts +5 -0
  78. package/i18n/sv-SE/components/content/blocks/generate_questions.ts +3 -0
  79. package/i18n/sv-SE/components/content/blocks/index.ts +4 -0
  80. package/i18n/sv-SE/components/content/blocks/user_upload.ts +0 -2
  81. package/i18n/sv-SE/components/settings/file_download.ts +8 -0
  82. package/i18n/sv-SE/components/settings/index.ts +4 -2
  83. package/i18n/sv-SE/shared/content_blocks.ts +1 -0
  84. package/i18n/sv-SE/shared/settings.ts +2 -4
  85. package/lib/helpers/GlossaryHelper.d.ts +9 -0
  86. package/lib/helpers/GlossaryHelper.js +118 -0
  87. package/lib/helpers/GlossaryTerm.d.ts +10 -0
  88. package/lib/helpers/GlossaryTerm.js +22 -0
  89. package/lib/helpers/MathHelper.d.ts +99 -0
  90. package/lib/helpers/MathHelper.js +194 -0
  91. package/lib/helpers/tinymce/plugin.d.ts +2 -0
  92. package/lib/helpers/tinymce/plugin.js +86 -0
  93. package/lib/i18n/en-US/components/content/blocks/image.d.ts +6 -0
  94. package/lib/i18n/en-US/components/content/blocks/image.js +7 -0
  95. package/lib/i18n/en-US/components/content/blocks/index.d.ts +75 -0
  96. package/lib/i18n/en-US/components/content/blocks/index.js +14 -0
  97. package/lib/i18n/en-US/components/content/blocks/tab.d.ts +5 -0
  98. package/lib/i18n/en-US/components/content/blocks/tab.js +6 -0
  99. package/lib/i18n/en-US/components/content/blocks/table.d.ts +5 -0
  100. package/lib/i18n/en-US/components/content/blocks/table.js +6 -0
  101. package/lib/i18n/en-US/components/content/blocks/user_upload.d.ts +13 -0
  102. package/lib/i18n/en-US/components/content/blocks/user_upload.js +14 -0
  103. package/lib/i18n/en-US/components/content/blocks/video.d.ts +48 -0
  104. package/lib/i18n/en-US/components/content/blocks/video.js +49 -0
  105. package/lib/i18n/en-US/components/content/index.d.ts +77 -0
  106. package/lib/i18n/en-US/components/content/index.js +6 -0
  107. package/lib/i18n/en-US/components/index.d.ts +140 -0
  108. package/lib/i18n/en-US/components/index.js +12 -0
  109. package/lib/i18n/en-US/components/navigation/image.d.ts +5 -0
  110. package/lib/i18n/en-US/components/navigation/image.js +6 -0
  111. package/lib/i18n/en-US/components/navigation/index.d.ts +10 -0
  112. package/lib/i18n/en-US/components/navigation/index.js +8 -0
  113. package/lib/i18n/en-US/components/navigation/user_upload.d.ts +4 -0
  114. package/lib/i18n/en-US/components/navigation/user_upload.js +5 -0
  115. package/lib/i18n/en-US/components/settings/clickable_icon.d.ts +6 -0
  116. package/lib/i18n/en-US/components/settings/clickable_icon.js +7 -0
  117. package/lib/i18n/en-US/components/settings/image.d.ts +2 -0
  118. package/lib/i18n/en-US/components/settings/image.js +3 -0
  119. package/lib/i18n/en-US/components/settings/index.d.ts +39 -0
  120. package/lib/i18n/en-US/components/settings/index.js +14 -0
  121. package/lib/i18n/en-US/components/settings/text_editor.d.ts +8 -0
  122. package/lib/i18n/en-US/components/settings/text_editor.js +9 -0
  123. package/lib/i18n/en-US/components/settings/user_upload.d.ts +12 -0
  124. package/lib/i18n/en-US/components/settings/user_upload.js +13 -0
  125. package/lib/i18n/en-US/components/settings/video.d.ts +13 -0
  126. package/lib/i18n/en-US/components/settings/video.js +14 -0
  127. package/lib/i18n/en-US/components/utils/index.d.ts +15 -0
  128. package/lib/i18n/en-US/components/utils/index.js +6 -0
  129. package/lib/i18n/en-US/components/utils/tiny_mce_wrapper.d.ts +13 -0
  130. package/lib/i18n/en-US/components/utils/tiny_mce_wrapper.js +14 -0
  131. package/lib/i18n/en-US/index.d.ts +197 -0
  132. package/lib/i18n/en-US/index.js +16 -0
  133. package/lib/i18n/en-US/modules/index.d.ts +2 -0
  134. package/lib/i18n/en-US/modules/index.js +6 -0
  135. package/lib/i18n/en-US/pages/glossary.d.ts +8 -0
  136. package/lib/i18n/en-US/pages/glossary.js +9 -0
  137. package/lib/i18n/en-US/pages/index.d.ts +13 -0
  138. package/lib/i18n/en-US/pages/index.js +8 -0
  139. package/lib/i18n/en-US/pages/user_upload.d.ts +4 -0
  140. package/lib/i18n/en-US/pages/user_upload.js +5 -0
  141. package/lib/i18n/en-US/shared/content_blocks.d.ts +20 -0
  142. package/lib/i18n/en-US/shared/content_blocks.js +21 -0
  143. package/lib/i18n/en-US/shared/index.d.ts +39 -0
  144. package/lib/i18n/en-US/shared/index.js +10 -0
  145. package/lib/i18n/en-US/shared/menu.d.ts +4 -0
  146. package/lib/i18n/en-US/shared/menu.js +5 -0
  147. package/lib/i18n/en-US/shared/settings.d.ts +15 -0
  148. package/lib/i18n/en-US/shared/settings.js +16 -0
  149. package/lib/i18n/en-US.d.ts +197 -0
  150. package/lib/i18n/en-US.js +15 -0
  151. package/lib/models/UserFileAsset.d.ts +5 -0
  152. package/lib/models/UserFileAsset.js +37 -0
  153. package/package.json +2 -2
  154. package/plugin.js +20 -0
  155. package/test/Components/Content/Blocks/FileDownload.spec.js +25 -0
  156. package/test/Components/Content/Blocks/Video.spec.js +0 -22
  157. package/test/Components/Settings/FileDownloadSettings.spec.js +20 -0
  158. package/test/Components/Settings/UserUploadSettings.spec.js +1 -1
  159. package/utils/index.js +2 -0
@@ -1,26 +1,22 @@
1
1
  <template>
2
- <v-container>
3
- <div v-if="render || !block.metadata.config.expand">
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 v-if="!blockExists" color="warning">
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" class="pl-4">
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('windward.core.shared.settings.title.title')"
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('windward.core.shared.settings.title.instructions')"
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('windward.core.shared.settings.title.title')"
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('windward.core.shared.settings.title.instructions')"
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.expand)) {
81
- this.block.metadata.config.expand = false
84
+ if (_.isEmpty(this.block.metadata.config.title)) {
85
+ this.block.metadata.config.title = ''
82
86
  }
83
- if (_.isEmpty(this.block.metadata.config.instructions)) {
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>
@@ -1,5 +1,6 @@
1
1
  <template>
2
2
  <component
3
+ v-show="value"
3
4
  :class="textViewer ? 'text-viewer' : ''"
4
5
  :is="convertedContent"
5
6
  ></component>
@@ -6,9 +6,7 @@
6
6
  (isDarkTheme ? '--theme-dark' : '--theme-light')
7
7
  "
8
8
  >
9
- <label v-if="value && label" class="editor-label">{{
10
- label
11
- }}</label>
9
+ <label v-if="label" class="editor-label">{{ label }}</label>
12
10
  <Editor
13
11
  :key="seed + (isDarkTheme ? '-theme-dark' : '-theme-light')"
14
12
  v-model="text"
@@ -326,7 +324,7 @@ export default {
326
324
  value: 'windward-table-subject-report',
327
325
  },
328
326
  ],
329
- setup() {
327
+ setup(_editor) {
330
328
  // Here we can add plugin
331
329
  getTinymce().PluginManager.add(
332
330
  'WindwardToolKit',
@@ -434,9 +432,7 @@ export default {
434
432
  ],
435
433
  placeholder: this.label
436
434
  ? this.label
437
- : this.$t(
438
- 'windward.core.shared.settings.title.placeholder'
439
- ),
435
+ : this.$t('components.content.settings.base.placeholder'),
440
436
  //required as it will be displayed as inline style in tinymce renderer
441
437
  skin: false,
442
438
  content_css: this.$vuetify.theme.isDark ? 'dark' : 'default',
@@ -539,15 +535,7 @@ export default {
539
535
  }
540
536
  </script>
541
537
 
542
- <style lang="scss">
543
- html:has(body.theme--light) {
544
- @import './assets/tinymce/ui/light/content.scss';
545
- @import './assets/tinymce/ui/light/skin.scss';
546
- }
547
- html:has(body.theme--dark) {
548
- @import './assets/tinymce/ui/dark/content.scss';
549
- @import './assets/tinymce/ui/dark/skin.scss';
550
- }
538
+ <style lang="scss" scoped>
551
539
  .editor-label {
552
540
  font-size: 1rem;
553
541
  margin-top: -1rem;
@@ -556,3 +544,14 @@ html:has(body.theme--dark) {
556
544
  transform: scale(0.75);
557
545
  }
558
546
  </style>
547
+
548
+ <style lang="scss">
549
+ html body.theme--light {
550
+ @import './assets/tinymce/ui/light/content.scss';
551
+ @import './assets/tinymce/ui/light/skin.scss';
552
+ }
553
+ html body.theme--dark {
554
+ @import './assets/tinymce/ui/dark/content.scss';
555
+ @import './assets/tinymce/ui/dark/skin.scss';
556
+ }
557
+ </style>
@@ -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
  }