@windward/core 0.0.7 → 0.0.8

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 (127) 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/Image.vue +35 -8
  11. package/components/Content/Blocks/OpenResponse.vue +32 -10
  12. package/components/Content/Blocks/OpenResponseCollate.vue +69 -42
  13. package/components/Settings/ImageSettings.vue +10 -0
  14. package/components/Settings/OpenResponseCollateSettings.vue +9 -8
  15. package/components/Settings/TextEditorSettings.vue +1 -0
  16. package/components/utils/TinyMCEWrapper.vue +10 -3
  17. package/components/utils/assets/tinymce/css/content.scss +1 -1
  18. package/coverage/clover.xml +223 -0
  19. package/coverage/coverage-final.json +16 -0
  20. package/coverage/lcov-report/base.css +224 -0
  21. package/coverage/lcov-report/block-navigation.js +87 -0
  22. package/coverage/lcov-report/components/Content/Blocks/Accordion.vue.html +430 -0
  23. package/coverage/lcov-report/components/Content/Blocks/Image.vue.html +394 -0
  24. package/coverage/lcov-report/components/Content/Blocks/Math.vue.html +262 -0
  25. package/coverage/lcov-report/components/Content/Blocks/RichText.vue.html +295 -0
  26. package/coverage/lcov-report/components/Content/Blocks/Tab.vue.html +415 -0
  27. package/coverage/lcov-report/components/Content/Blocks/Table.vue.html +667 -0
  28. package/coverage/lcov-report/components/Content/Blocks/Video.vue.html +2275 -0
  29. package/coverage/lcov-report/components/Content/Blocks/index.html +206 -0
  30. package/coverage/lcov-report/components/utils/ContentViewer.vue.html +199 -0
  31. package/coverage/lcov-report/components/utils/MathExpressionEditor.vue.html +919 -0
  32. package/coverage/lcov-report/components/utils/MathLiveWrapper.vue.html +343 -0
  33. package/coverage/lcov-report/components/utils/TinyMCEWrapper.vue.html +271 -0
  34. package/coverage/lcov-report/components/utils/index.html +161 -0
  35. package/coverage/lcov-report/config/index.html +116 -0
  36. package/coverage/lcov-report/config/tinymce.config.js.html +493 -0
  37. package/coverage/lcov-report/favicon.png +0 -0
  38. package/coverage/lcov-report/helpers/MathHelper.ts.html +793 -0
  39. package/coverage/lcov-report/helpers/index.html +116 -0
  40. package/coverage/lcov-report/helpers/tinymce/index.html +116 -0
  41. package/coverage/lcov-report/helpers/tinymce/plugin.ts.html +334 -0
  42. package/coverage/lcov-report/index.html +191 -0
  43. package/coverage/lcov-report/prettify.css +1 -0
  44. package/coverage/lcov-report/prettify.js +2 -0
  45. package/coverage/lcov-report/sort-arrow-sprite.png +0 -0
  46. package/coverage/lcov-report/sorter.js +196 -0
  47. package/coverage/lcov-report/test/index.html +116 -0
  48. package/coverage/lcov-report/test/mocks.js.html +457 -0
  49. package/coverage/lcov.info +403 -0
  50. package/helpers/tinymce/plugin.ts +1 -1
  51. package/i18n/en-US/components/content/blocks/open_response_collate.ts +1 -0
  52. package/i18n/en-US/components/settings/image.ts +3 -1
  53. package/i18n/es-ES/components/content/blocks/open_response_collate.ts +1 -0
  54. package/i18n/es-ES/components/settings/image.ts +3 -1
  55. package/i18n/sv-SE/components/content/blocks/open_response_collate.ts +1 -0
  56. package/i18n/sv-SE/components/settings/image.ts +3 -1
  57. package/lib/helpers/GlossaryHelper.d.ts +9 -0
  58. package/lib/helpers/GlossaryHelper.js +118 -0
  59. package/lib/helpers/GlossaryTerm.d.ts +10 -0
  60. package/lib/helpers/GlossaryTerm.js +22 -0
  61. package/lib/helpers/MathHelper.d.ts +99 -0
  62. package/lib/helpers/MathHelper.js +194 -0
  63. package/lib/helpers/tinymce/plugin.d.ts +2 -0
  64. package/lib/helpers/tinymce/plugin.js +86 -0
  65. package/lib/i18n/en-US/components/content/blocks/image.d.ts +6 -0
  66. package/lib/i18n/en-US/components/content/blocks/image.js +7 -0
  67. package/lib/i18n/en-US/components/content/blocks/index.d.ts +75 -0
  68. package/lib/i18n/en-US/components/content/blocks/index.js +14 -0
  69. package/lib/i18n/en-US/components/content/blocks/tab.d.ts +5 -0
  70. package/lib/i18n/en-US/components/content/blocks/tab.js +6 -0
  71. package/lib/i18n/en-US/components/content/blocks/table.d.ts +5 -0
  72. package/lib/i18n/en-US/components/content/blocks/table.js +6 -0
  73. package/lib/i18n/en-US/components/content/blocks/user_upload.d.ts +13 -0
  74. package/lib/i18n/en-US/components/content/blocks/user_upload.js +14 -0
  75. package/lib/i18n/en-US/components/content/blocks/video.d.ts +48 -0
  76. package/lib/i18n/en-US/components/content/blocks/video.js +49 -0
  77. package/lib/i18n/en-US/components/content/index.d.ts +77 -0
  78. package/lib/i18n/en-US/components/content/index.js +6 -0
  79. package/lib/i18n/en-US/components/index.d.ts +140 -0
  80. package/lib/i18n/en-US/components/index.js +12 -0
  81. package/lib/i18n/en-US/components/navigation/image.d.ts +5 -0
  82. package/lib/i18n/en-US/components/navigation/image.js +6 -0
  83. package/lib/i18n/en-US/components/navigation/index.d.ts +10 -0
  84. package/lib/i18n/en-US/components/navigation/index.js +8 -0
  85. package/lib/i18n/en-US/components/navigation/user_upload.d.ts +4 -0
  86. package/lib/i18n/en-US/components/navigation/user_upload.js +5 -0
  87. package/lib/i18n/en-US/components/settings/clickable_icon.d.ts +6 -0
  88. package/lib/i18n/en-US/components/settings/clickable_icon.js +7 -0
  89. package/lib/i18n/en-US/components/settings/image.d.ts +2 -0
  90. package/lib/i18n/en-US/components/settings/image.js +3 -0
  91. package/lib/i18n/en-US/components/settings/index.d.ts +39 -0
  92. package/lib/i18n/en-US/components/settings/index.js +14 -0
  93. package/lib/i18n/en-US/components/settings/text_editor.d.ts +8 -0
  94. package/lib/i18n/en-US/components/settings/text_editor.js +9 -0
  95. package/lib/i18n/en-US/components/settings/user_upload.d.ts +12 -0
  96. package/lib/i18n/en-US/components/settings/user_upload.js +13 -0
  97. package/lib/i18n/en-US/components/settings/video.d.ts +13 -0
  98. package/lib/i18n/en-US/components/settings/video.js +14 -0
  99. package/lib/i18n/en-US/components/utils/index.d.ts +15 -0
  100. package/lib/i18n/en-US/components/utils/index.js +6 -0
  101. package/lib/i18n/en-US/components/utils/tiny_mce_wrapper.d.ts +13 -0
  102. package/lib/i18n/en-US/components/utils/tiny_mce_wrapper.js +14 -0
  103. package/lib/i18n/en-US/index.d.ts +197 -0
  104. package/lib/i18n/en-US/index.js +16 -0
  105. package/lib/i18n/en-US/modules/index.d.ts +2 -0
  106. package/lib/i18n/en-US/modules/index.js +6 -0
  107. package/lib/i18n/en-US/pages/glossary.d.ts +8 -0
  108. package/lib/i18n/en-US/pages/glossary.js +9 -0
  109. package/lib/i18n/en-US/pages/index.d.ts +13 -0
  110. package/lib/i18n/en-US/pages/index.js +8 -0
  111. package/lib/i18n/en-US/pages/user_upload.d.ts +4 -0
  112. package/lib/i18n/en-US/pages/user_upload.js +5 -0
  113. package/lib/i18n/en-US/shared/content_blocks.d.ts +20 -0
  114. package/lib/i18n/en-US/shared/content_blocks.js +21 -0
  115. package/lib/i18n/en-US/shared/index.d.ts +39 -0
  116. package/lib/i18n/en-US/shared/index.js +10 -0
  117. package/lib/i18n/en-US/shared/menu.d.ts +4 -0
  118. package/lib/i18n/en-US/shared/menu.js +5 -0
  119. package/lib/i18n/en-US/shared/settings.d.ts +15 -0
  120. package/lib/i18n/en-US/shared/settings.js +16 -0
  121. package/lib/i18n/en-US.d.ts +197 -0
  122. package/lib/i18n/en-US.js +15 -0
  123. package/lib/models/UserFileAsset.d.ts +5 -0
  124. package/lib/models/UserFileAsset.js +37 -0
  125. package/package.json +1 -1
  126. package/test/__mocks__/helpersMock.js +3 -0
  127. package/test/__mocks__/modelMock.js +4 -0
@@ -0,0 +1,58 @@
1
+ <component name="ProjectCodeStyleConfiguration">
2
+ <code_scheme name="Project" version="173">
3
+ <HTMLCodeStyleSettings>
4
+ <option name="HTML_SPACE_INSIDE_EMPTY_TAG" value="true" />
5
+ <option name="HTML_ENFORCE_QUOTES" value="true" />
6
+ </HTMLCodeStyleSettings>
7
+ <JSCodeStyleSettings version="0">
8
+ <option name="FORCE_SEMICOLON_STYLE" value="true" />
9
+ <option name="SPACE_BEFORE_FUNCTION_LEFT_PARENTH" value="false" />
10
+ <option name="FORCE_QUOTE_STYlE" value="true" />
11
+ <option name="ENFORCE_TRAILING_COMMA" value="Remove" />
12
+ <option name="SPACES_WITHIN_OBJECT_LITERAL_BRACES" value="true" />
13
+ <option name="SPACES_WITHIN_IMPORTS" value="true" />
14
+ </JSCodeStyleSettings>
15
+ <TypeScriptCodeStyleSettings version="0">
16
+ <option name="FORCE_SEMICOLON_STYLE" value="true" />
17
+ <option name="SPACE_BEFORE_FUNCTION_LEFT_PARENTH" value="false" />
18
+ <option name="FORCE_QUOTE_STYlE" value="true" />
19
+ <option name="ENFORCE_TRAILING_COMMA" value="Remove" />
20
+ <option name="SPACES_WITHIN_OBJECT_LITERAL_BRACES" value="true" />
21
+ <option name="SPACES_WITHIN_IMPORTS" value="true" />
22
+ </TypeScriptCodeStyleSettings>
23
+ <VueCodeStyleSettings>
24
+ <option name="INTERPOLATION_NEW_LINE_AFTER_START_DELIMITER" value="false" />
25
+ <option name="INTERPOLATION_NEW_LINE_BEFORE_END_DELIMITER" value="false" />
26
+ </VueCodeStyleSettings>
27
+ <codeStyleSettings language="HTML">
28
+ <option name="SOFT_MARGINS" value="80" />
29
+ <indentOptions>
30
+ <option name="INDENT_SIZE" value="2" />
31
+ <option name="CONTINUATION_INDENT_SIZE" value="2" />
32
+ <option name="TAB_SIZE" value="2" />
33
+ </indentOptions>
34
+ </codeStyleSettings>
35
+ <codeStyleSettings language="JavaScript">
36
+ <option name="SOFT_MARGINS" value="80" />
37
+ <indentOptions>
38
+ <option name="INDENT_SIZE" value="2" />
39
+ <option name="CONTINUATION_INDENT_SIZE" value="2" />
40
+ <option name="TAB_SIZE" value="2" />
41
+ </indentOptions>
42
+ </codeStyleSettings>
43
+ <codeStyleSettings language="TypeScript">
44
+ <option name="SOFT_MARGINS" value="80" />
45
+ <indentOptions>
46
+ <option name="INDENT_SIZE" value="2" />
47
+ <option name="CONTINUATION_INDENT_SIZE" value="2" />
48
+ <option name="TAB_SIZE" value="2" />
49
+ </indentOptions>
50
+ </codeStyleSettings>
51
+ <codeStyleSettings language="Vue">
52
+ <option name="SOFT_MARGINS" value="80" />
53
+ <indentOptions>
54
+ <option name="CONTINUATION_INDENT_SIZE" value="2" />
55
+ </indentOptions>
56
+ </codeStyleSettings>
57
+ </code_scheme>
58
+ </component>
@@ -0,0 +1,5 @@
1
+ <component name="ProjectCodeStyleConfiguration">
2
+ <state>
3
+ <option name="USE_PER_PROJECT_SETTINGS" value="true" />
4
+ </state>
5
+ </component>
@@ -0,0 +1,6 @@
1
+ <component name="InspectionProjectProfileManager">
2
+ <profile version="1.0">
3
+ <option name="myName" value="Project Default" />
4
+ <inspection_tool class="Eslint" enabled="true" level="WARNING" enabled_by_default="true" />
5
+ </profile>
6
+ </component>
@@ -0,0 +1,8 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <project version="4">
3
+ <component name="ProjectModuleManager">
4
+ <modules>
5
+ <module fileurl="file://$PROJECT_DIR$/.idea/windward-ui-plugin-core.iml" filepath="$PROJECT_DIR$/.idea/windward-ui-plugin-core.iml" />
6
+ </modules>
7
+ </component>
8
+ </project>
@@ -0,0 +1,24 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <project version="4">
3
+ <component name="PhpDockerContainerSettings">
4
+ <list>
5
+ <map>
6
+ <entry key="79d59a8f-c56c-4789-b96c-e55a326ab125">
7
+ <value>
8
+ <DockerContainerSettings>
9
+ <option name="version" value="1" />
10
+ <option name="volumeBindings">
11
+ <list>
12
+ <DockerVolumeBindingImpl>
13
+ <option name="containerPath" value="/opt/project" />
14
+ <option name="hostPath" value="$PROJECT_DIR$" />
15
+ </DockerVolumeBindingImpl>
16
+ </list>
17
+ </option>
18
+ </DockerContainerSettings>
19
+ </value>
20
+ </entry>
21
+ </map>
22
+ </list>
23
+ </component>
24
+ </project>
package/.idea/php.xml ADDED
@@ -0,0 +1,19 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <project version="4">
3
+ <component name="MessDetectorOptionsConfiguration">
4
+ <option name="transferred" value="true" />
5
+ </component>
6
+ <component name="PHPCSFixerOptionsConfiguration">
7
+ <option name="transferred" value="true" />
8
+ </component>
9
+ <component name="PHPCodeSnifferOptionsConfiguration">
10
+ <option name="highlightLevel" value="WARNING" />
11
+ <option name="transferred" value="true" />
12
+ </component>
13
+ <component name="PhpStanOptionsConfiguration">
14
+ <option name="transferred" value="true" />
15
+ </component>
16
+ <component name="PsalmOptionsConfiguration">
17
+ <option name="transferred" value="true" />
18
+ </component>
19
+ </project>
package/.idea/vcs.xml ADDED
@@ -0,0 +1,6 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <project version="4">
3
+ <component name="VcsDirectoryMappings">
4
+ <mapping directory="" vcs="Git" />
5
+ </component>
6
+ </project>
@@ -0,0 +1,4 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <project version="4">
3
+ <component name="ProjectTasksOptions" suppressed-tasks="SCSS" />
4
+ </project>
@@ -0,0 +1,8 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <module type="WEB_MODULE" version="4">
3
+ <component name="NewModuleRootManager">
4
+ <content url="file://$MODULE_DIR$" />
5
+ <orderEntry type="inheritedJdk" />
6
+ <orderEntry type="sourceFolder" forTests="false" />
7
+ </component>
8
+ </module>
@@ -1,18 +1,27 @@
1
1
  <template>
2
2
  <div>
3
- <p v-if="!block.body">
4
- <v-img
5
- class="img-holder"
6
- src="https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcTNCyiabrwN6YV6s3Mj5IzREZCnQqqwT4A3Bw&usqp=CAU"
7
- contain
8
- ></v-img>
9
- </p>
3
+ <div v-if="!block.body" class="img-holder">
4
+ <v-skeleton-loader
5
+ height="300px"
6
+ :elevation="2"
7
+ type="image"
8
+ ></v-skeleton-loader>
9
+
10
+ <div class="no-source-overlay">
11
+ <v-icon x-large>mdi-file-question</v-icon><br />
12
+ {{
13
+ $t(
14
+ 'windward.core.components.content.blocks.image.no_image_url'
15
+ )
16
+ }}
17
+ </div>
18
+ </div>
10
19
  <v-responsive :aspect-ratio="aspectRatio">
11
20
  <v-img
12
21
  v-if="block.body"
13
22
  :alt="block.metadata.config.alt"
14
23
  :aria-describedby="block.metadata.config.aria_described_by"
15
- class="img-display"
24
+ :class="imageClass"
16
25
  :src="block.body"
17
26
  contain
18
27
  >
@@ -59,6 +68,9 @@ export default {
59
68
  if (_.isEmpty(this.block.metadata.config.alt)) {
60
69
  this.block.metadata.config.alt = ''
61
70
  }
71
+ if (!_.isBoolean(this.block.metadata.config.hide_background)) {
72
+ this.block.metadata.config.hide_background = false
73
+ }
62
74
  if (_.isEmpty(this.block.metadata.config.aria_describedby)) {
63
75
  this.block.metadata.config.aria_describedby = ''
64
76
  }
@@ -75,6 +87,14 @@ export default {
75
87
  describedByText() {
76
88
  return _.get(this.block.metadata, 'config.aria_describedby', null)
77
89
  },
90
+ imageClass() {
91
+ let imageClass = ''
92
+ // If NOT hide background, inclide the extra class
93
+ if (!_.get(this.block.metadata, 'config.hide_background', false)) {
94
+ imageClass += ' img-white'
95
+ }
96
+ return 'img-display' + imageClass
97
+ },
78
98
  },
79
99
  watch: {
80
100
  value(newValue) {
@@ -103,6 +123,13 @@ export default {
103
123
  .img-holder {
104
124
  max-height: 300px;
105
125
  }
126
+ .img-white {
127
+ background: #fff;
128
+ }
129
+ .no-source-overlay {
130
+ text-align: center;
131
+ margin-top: -175px;
132
+ }
106
133
  ::v-deep .v-skeleton-loader.v-skeleton-loader--is-loading {
107
134
  .v-skeleton-loader__image {
108
135
  height: 100%;
@@ -75,9 +75,11 @@
75
75
 
76
76
  <script>
77
77
  import _ from 'lodash'
78
+ import { mapGetters } from 'vuex'
78
79
  import TextViewer from '~/components/Text/TextViewer.vue'
79
80
  import TextEditor from '~/components/Text/TextEditor.vue'
80
81
  import BaseContentBlock from '~/components/Content/Blocks/BaseContentBlock'
82
+ import UserContentBlockState from '~/models/UserContentBlockState'
81
83
 
82
84
  export default {
83
85
  name: 'ContentBlockOpenResponse',
@@ -93,6 +95,18 @@ export default {
93
95
  submitted: false,
94
96
  }
95
97
  },
98
+ computed: {
99
+ ...mapGetters({
100
+ enrollment: 'enrollment/get',
101
+ }),
102
+ canSubmit() {
103
+ // Make sure the response is not empty and not equal to the starting text
104
+ return (
105
+ this.response &&
106
+ this.response !== this.block.metadata.config.starting_text
107
+ )
108
+ },
109
+ },
96
110
  beforeMount() {
97
111
  if (_.isEmpty(this.block.body)) {
98
112
  this.block.body = ''
@@ -107,23 +121,31 @@ export default {
107
121
  this.block.metadata.config.starting_text = ''
108
122
  }
109
123
  },
110
- computed: {
111
- canSubmit() {
112
- // Make sure the response is not empty and not equal to the starting text
113
- return (
114
- this.response &&
115
- this.response !== this.block.metadata.config.starting_text
116
- )
117
- },
118
- },
119
124
  watch: {},
120
125
  mounted() {},
121
126
  methods: {
122
- onAfterSetContentBlockState() {
127
+ async onAfterSetContentBlockState() {
128
+ // Check to see if we have a state already for this block with the same block_id
129
+ // States are loaded via the ContentBlock.id but in this particular case we want to
130
+ // maintain the state ACROSS different ContentBlock.ids but with the same linked Block.id
131
+ const userState = await UserContentBlockState.where({
132
+ 'metadata->block->tag': 'plugin-core-open-response',
133
+ course_user_id: this.enrollment.id,
134
+ })
135
+ .where('metadata->block->block_id', this.block.block_id)
136
+ .first()
137
+
138
+ // Apply the "True" state
139
+ if (!_.isEmpty(userState)) {
140
+ this.response = _.get(userState, 'metadata.response', '')
141
+ this.submitted = _.get(userState, 'metadata.submitted', false)
142
+ }
143
+
123
144
  // If after the state is applied the response is still empty then apply the default response
124
145
  if (this.response === '') {
125
146
  this.response = this.block.metadata.config.starting_text
126
147
  }
148
+
127
149
  this.stateLoaded = true
128
150
  },
129
151
  onSubmit() {
@@ -31,7 +31,9 @@ export default {
31
31
  extends: BaseContentBlock,
32
32
  components: {},
33
33
  data() {
34
- return {}
34
+ return {
35
+ saveState: false, // Override the base block to disable state saving
36
+ }
35
37
  },
36
38
  beforeMount() {
37
39
  if (_.isEmpty(this.block.body)) {
@@ -46,7 +48,8 @@ export default {
46
48
  if (_.isEmpty(this.block.metadata.config.filename)) {
47
49
  this.block.metadata.config.filename = ''
48
50
  }
49
- if (_.isEmpty(this.block.metadata.config.include_prompts)) {
51
+ // _.isEmpty(true) returns false. use isBoolean to check if this prop exists
52
+ if (!_.isBoolean(this.block.metadata.config.include_prompts)) {
50
53
  this.block.metadata.config.include_prompts = false
51
54
  }
52
55
  },
@@ -62,50 +65,74 @@ export default {
62
65
  mounted() {},
63
66
  methods: {
64
67
  async onCollate() {
65
- let userState = await UserContentBlockState.where({
66
- 'metadata->block->tag': 'plugin-core-open-response',
67
- course_user_id: this.enrollment.id,
68
- })
69
- .whereIn('content_block_id', this.block.metadata.config.linked)
70
- .get()
71
- let collated = ''
68
+ try {
69
+ let userState = await UserContentBlockState.where({
70
+ 'metadata->block->tag': 'plugin-core-open-response',
71
+ course_user_id: this.enrollment.id,
72
+ })
73
+ .whereIn(
74
+ 'metadata->block->block_id',
75
+ this.block.metadata.config.linked
76
+ )
77
+ .get()
78
+ let collated = ''
79
+ const sortedStates = []
72
80
 
73
- userState.forEach((state) => {
74
- // Prepend the prompt from the state if include prompts is enabled
75
- if (this.block.metadata.config.include_prompts) {
76
- collated +=
77
- '<strong>' +
78
- state.metadata.block.body +
79
- '</strong><hr />'
80
- }
81
- if (!_.isEmpty(state.metadata.response)) {
82
- collated += '\n' + state.metadata.response
83
- } else {
84
- collated +=
85
- '\n<p>' +
86
- this.$t(
87
- 'windward.core.components.content.blocks.open_response_collate.no_response'
88
- ) +
89
- '</p>'
81
+ // Sorted the states based on the linked order
82
+ this.block.metadata.config.linked.forEach((linkedId) => {
83
+ const found = userState.find((state) => {
84
+ return state.metadata.block.block_id === linkedId
85
+ })
86
+ if (found) {
87
+ sortedStates.push(found)
88
+ }
89
+ })
90
+
91
+ sortedStates.forEach((state) => {
92
+ // Prepend the prompt from the state if include prompts is enabled
93
+ if (this.block.metadata.config.include_prompts) {
94
+ collated +=
95
+ '<strong>' +
96
+ state.metadata.block.body +
97
+ '</strong><hr />'
98
+ }
99
+ if (!_.isEmpty(state.metadata.response)) {
100
+ collated += '\n' + state.metadata.response
101
+ } else {
102
+ collated +=
103
+ '\n<p>' +
104
+ this.$t(
105
+ 'windward.core.components.content.blocks.open_response_collate.no_response'
106
+ ) +
107
+ '</p>'
108
+ }
109
+ })
110
+ let filename = this.block.metadata.config.filename
111
+ if (_.isEmpty(this.block.metadata.config.filename)) {
112
+ // Default filename is the users name + the current page
113
+ filename =
114
+ this.$auth.user.last_name +
115
+ '_' +
116
+ this.$auth.user.first_name +
117
+ '_' +
118
+ _.get(this.content, 'content.name_prefix') +
119
+ _.get(this.content, 'content.name')
120
+
121
+ // Change spaces to underscores and remove special characters
122
+ filename = filename.replaceAll(/\s+/gi, '_')
123
+ filename = filename.replaceAll(/[^a-z0-9\-\_]/gi, '')
90
124
  }
91
- })
92
- let filename = this.block.metadata.config.filename
93
- if (_.isEmpty(this.block.metadata.config.filename)) {
94
- // Default filename is the users name + the current page
95
- filename =
96
- this.$auth.user.last_name +
97
- '_' +
98
- this.$auth.user.first_name +
99
- '_' +
100
- _.get(this.content, 'content.name_prefix') +
101
- _.get(this.content, 'content.name')
102
125
 
103
- // Change spaces to underscores and remove special characters
104
- filename = filename.replaceAll(/\s+/gi, '_')
105
- filename = filename.replaceAll(/[^a-z0-9\-\_]/gi, '')
126
+ this.generateDocument(collated, filename)
127
+ } catch (e) {
128
+ // eslint-disable-next-line no-console
129
+ console.error(e)
130
+ this.$dialog.error(
131
+ this.$t(
132
+ 'windward.core.components.content.blocks.open_response_collate.generate_error'
133
+ )
134
+ )
106
135
  }
107
-
108
- this.generateDocument(collated, filename)
109
136
  },
110
137
  generateDocument(htmlBody, filename = '') {
111
138
  // Specify file name. If one isn't supplied then a default name of `exported_document_YYYY-MM-DD.doc` is used
@@ -17,6 +17,13 @@
17
17
  </template>
18
18
  </ContentBlockAsset>
19
19
 
20
+ <v-switch
21
+ v-model="block.metadata.config.hide_background"
22
+ :label="
23
+ $t('windward.core.components.settings.image.hide_background')
24
+ "
25
+ ></v-switch>
26
+
20
27
  <v-form>
21
28
  <v-text-field
22
29
  v-model="block.metadata.config.alt"
@@ -69,6 +76,9 @@ export default {
69
76
  if (_.isEmpty(this.block.metadata.config.alt)) {
70
77
  this.block.metadata.config.alt = ''
71
78
  }
79
+ if (!_.isBoolean(this.block.metadata.config.hide_background)) {
80
+ this.block.metadata.config.hide_background = false
81
+ }
72
82
  if (_.isEmpty(this.block.metadata.config.aria_describedby)) {
73
83
  this.block.metadata.config.aria_describedby = ''
74
84
  }
@@ -38,8 +38,8 @@
38
38
  >
39
39
  <v-list-item
40
40
  v-for="contentBlock in contentBlocks"
41
- :key="contentBlock.id"
42
- :value="contentBlock.id"
41
+ :key="contentBlock.block_id"
42
+ :value="contentBlock.block_id"
43
43
  >
44
44
  <template #default="{ active }">
45
45
  <v-list-item-icon>
@@ -133,7 +133,8 @@ export default {
133
133
  if (_.isEmpty(this.block.metadata.config.filename)) {
134
134
  this.block.metadata.config.filename = ''
135
135
  }
136
- if (_.isEmpty(this.block.metadata.config.include_prompts)) {
136
+ // _.isEmpty(true) returns false. use isBoolean to check if this prop exists
137
+ if (!_.isBoolean(this.block.metadata.config.include_prompts)) {
137
138
  this.block.metadata.config.include_prompts = false
138
139
  }
139
140
 
@@ -151,19 +152,19 @@ export default {
151
152
  this.setLinkedBlocks()
152
153
  },
153
154
  setLinkedBlocks() {
154
- const linkedContentIds = []
155
+ const linkedBlockIds = []
155
156
 
156
157
  // Loop over content blocks since they have the correct order we want to collate
157
158
  this.contentBlocks.forEach((contentBlock) => {
158
159
  // If the unsorted this.linked includes the block id, add it in the right order
159
- if (this.linked.includes(contentBlock.id)) {
160
- linkedContentIds.push(contentBlock.id)
160
+ if (this.linked.includes(contentBlock.block_id)) {
161
+ linkedBlockIds.push(contentBlock.block_id)
161
162
  }
162
163
  })
163
164
 
164
165
  // Set the linked and also body for convenience
165
- this.block.metadata.config.linked = linkedContentIds
166
- this.block.body = linkedContentIds.join()
166
+ this.block.metadata.config.linked = linkedBlockIds
167
+ this.block.body = linkedBlockIds.join()
167
168
  },
168
169
  },
169
170
  }
@@ -103,6 +103,7 @@
103
103
  v-show="
104
104
  settingSelector.includes(1) && !block.metadata.config.expand
105
105
  "
106
+ autofill
106
107
  ></text-editor>
107
108
  <v-skeleton-loader
108
109
  v-bind="attrs"
@@ -6,7 +6,7 @@
6
6
  :api-key="api_key"
7
7
  :init="config"
8
8
  tag-name="div"
9
- model-events="change keydown blur focus paste input submit"
9
+ model-events="change keydown blur focus paste input submit SetContent"
10
10
  >
11
11
  </editor>
12
12
  </template>
@@ -29,13 +29,13 @@ export default {
29
29
  menubar: {
30
30
  type: String,
31
31
  required: false,
32
- default: 'file edit insert format view table windward help',
32
+ default: 'edit insert format view table windward help',
33
33
  },
34
34
  toolbar: {
35
35
  type: String,
36
36
  required: false,
37
37
  default:
38
- 'undo redo | formatselect | bold italic | alignleft aligncenter alignright | table bullist numlist outdent indent | mathButton ',
38
+ 'undo redo | formatselect | fontsizeselect | bold italic underline strikethrough removeformat | alignleft aligncenter alignright | table bullist numlist outdent indent | mathButton ',
39
39
  },
40
40
  },
41
41
  beforeMount() {
@@ -71,6 +71,10 @@ export default {
71
71
  title: 'Table',
72
72
  items: 'inserttable | tableprops | deletetable',
73
73
  },
74
+ format: {
75
+ title: 'Format',
76
+ items: ' bold italic underline strikethrough superscript subscript codeformat | formats align | forecolor backcolor | language | removeformat',
77
+ },
74
78
  },
75
79
  plugins: [
76
80
  'advlist autolink lists link charmap',
@@ -85,6 +89,8 @@ export default {
85
89
  table_default_attributes: {
86
90
  class: 'default',
87
91
  },
92
+ font_size_formats:
93
+ '8pt 10pt 12pt 14pt 16pt 18pt 24pt 36pt 48pt',
88
94
  table_class_list: [
89
95
  { title: 'None', value: ' ' },
90
96
  {
@@ -163,6 +169,7 @@ export default {
163
169
  WindwardPlugins
164
170
  )
165
171
  },
172
+
166
173
  formats: {
167
174
  glossary: {
168
175
  inline: 'span',
@@ -193,5 +193,5 @@ span.windward-fill-blank{
193
193
  color: #000000;
194
194
  }
195
195
 
196
-
196
+ body { font-family: 'Roboto', sans-serif; }
197
197