@windward/core 0.17.0 → 0.18.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/CHANGELOG.md CHANGED
@@ -1,5 +1,8 @@
1
1
  # Changelog
2
2
 
3
+ ### Release [0.18.0] created - 2025-05-21
4
+
5
+
3
6
  ### Release [0.17.0] created - 2025-05-13
4
7
 
5
8
 
@@ -7,7 +7,13 @@
7
7
  "
8
8
  class="pa-0"
9
9
  >
10
- <h2 v-if="block.metadata.config.title" tabindex="0">
10
+ <h2
11
+ v-if="
12
+ block.metadata.config.title &&
13
+ block.metadata.config.display_title
14
+ "
15
+ tabindex="0"
16
+ >
11
17
  {{ block.metadata.config.title }}
12
18
  </h2>
13
19
 
@@ -164,6 +170,9 @@ export default {
164
170
  if (_.isEmpty(this.block.metadata.config.title)) {
165
171
  this.block.metadata.config.title = ''
166
172
  }
173
+ if (!_.isBoolean(this.block.metadata.config.display_title)) {
174
+ this.$set(this.block.metadata.config, 'display_title', true)
175
+ }
167
176
  if (_.isEmpty(this.block.metadata.config.items)) {
168
177
  const defaultObject = {
169
178
  header: '',
@@ -7,7 +7,13 @@
7
7
  "
8
8
  >
9
9
  <v-col cols="12" class="pb-0">
10
- <h2 v-if="block.metadata.config.title" tabindex="0">
10
+ <h2
11
+ v-if="
12
+ block.metadata.config.title &&
13
+ block.metadata.config.display_title
14
+ "
15
+ tabindex="0"
16
+ >
11
17
  {{ block.metadata.config.title }}
12
18
  </h2>
13
19
  <p
@@ -148,6 +154,9 @@ export default {
148
154
  if (_.isEmpty(this.block.metadata.config.title)) {
149
155
  this.block.metadata.config.title = ''
150
156
  }
157
+ if (!_.isBoolean(this.block.metadata.config.display_title)) {
158
+ this.$set(this.block.metadata.config, 'display_title', true)
159
+ }
151
160
  if (_.isEmpty(this.block.metadata.config.instructions)) {
152
161
  this.block.metadata.config.instructions = ''
153
162
  }
@@ -1,15 +1,21 @@
1
1
  <template>
2
2
  <div>
3
3
  <v-container class="pa-0">
4
- <h2 v-if="block.metadata.config.title" tabindex="0">
4
+ <h2
5
+ v-if="
6
+ block.metadata.config.title &&
7
+ block.metadata.config.display_title
8
+ "
9
+ tabindex="0"
10
+ >
5
11
  {{ block.metadata.config.title }}
6
12
  </h2>
7
13
  <p
8
- v-if="block.metadata.config.description"
14
+ v-if="block.metadata.config.instructions"
9
15
  tabindex="0"
10
16
  class="pt-3"
11
17
  >
12
- {{ block.metadata.config.description }}
18
+ {{ block.metadata.config.instructions }}
13
19
  </p>
14
20
  </v-container>
15
21
  <v-container class="pa-0">
@@ -20,7 +26,7 @@
20
26
  :class="rowClass(itemIndex)"
21
27
  class="pa-0"
22
28
  >
23
- <v-col cols="12" v-bind="iconColumnAttrs">
29
+ <v-col cols="8" v-bind="iconColumnAttrs">
24
30
  <button
25
31
  class="mr-1"
26
32
  :class="activatorButtonClass(itemIndex)"
@@ -85,8 +91,8 @@
85
91
  import _ from 'lodash'
86
92
  import he from 'he'
87
93
  import BaseContentBlock from '~/components/Content/Blocks/BaseContentBlock'
88
- import TextViewer from '~/components/Text/TextViewer'
89
94
  import ImageAssetViewer from '~/components/Content/ImageAssetViewer.vue'
95
+ import TextViewer from '~/components/Text/TextViewer'
90
96
 
91
97
  export default {
92
98
  name: 'ClickableIcons',
@@ -95,38 +101,6 @@ export default {
95
101
  ImageAssetViewer,
96
102
  },
97
103
  extends: BaseContentBlock,
98
- beforeMount() {
99
- // Apply the default config
100
- this.block.body = this.$t(
101
- 'windward.core.shared.content_blocks.title.clickable_icons'
102
- )
103
- if (_.isEmpty(this.block.metadata.config.items)) {
104
- this.block.metadata.config.items = []
105
- this.block.metadata.config.description = this.$t(
106
- 'windward.core.components.settings.clickable_icon.information'
107
- )
108
- }
109
- if (_.isEmpty(this.block.metadata.config.title)) {
110
- this.block.metadata.config.title = ''
111
- }
112
- if (_.isEmpty(this.block.metadata.config.description)) {
113
- this.block.metadata.config.description = ''
114
- }
115
- if (_.isEmpty(this.block.metadata.config.display)) {
116
- this.block.metadata.config.display = {
117
- show_title: false,
118
- show_background: false,
119
- round_icon: false,
120
- italic_icon: false,
121
- autocolor: true,
122
- }
123
- }
124
- if (this.block.metadata.config.items.length) {
125
- for (const index in this.block.metadata.config.items) {
126
- this.block.metadata.config.items[index].active = false
127
- }
128
- }
129
- },
130
104
  data() {
131
105
  return {
132
106
  saveState: false,
@@ -154,6 +128,9 @@ export default {
154
128
  ) {
155
129
  classes += ' ' + this.itemColor(itemIndex) + ' black--text'
156
130
  }
131
+ if (window.innerWidth <= 600) {
132
+ classes += 'd-flex justify-center '
133
+ }
157
134
  return classes
158
135
  }
159
136
  },
@@ -261,6 +238,41 @@ export default {
261
238
  }
262
239
  },
263
240
  },
241
+ beforeMount() {
242
+ // Apply the default config
243
+ this.block.body = this.$t(
244
+ 'windward.core.shared.content_blocks.title.clickable_icons'
245
+ )
246
+ if (_.isEmpty(this.block.metadata.config.items)) {
247
+ this.block.metadata.config.items = []
248
+ this.block.metadata.config.description = this.$t(
249
+ 'windward.core.components.settings.clickable_icon.information'
250
+ )
251
+ }
252
+ if (_.isEmpty(this.block.metadata.config.title)) {
253
+ this.block.metadata.config.title = ''
254
+ }
255
+ if (!_.isBoolean(this.block.metadata.config.display_title)) {
256
+ this.$set(this.block.metadata.config, 'display_title', true)
257
+ }
258
+ if (_.isEmpty(this.block.metadata.config.description)) {
259
+ this.block.metadata.config.description = ''
260
+ }
261
+ if (_.isEmpty(this.block.metadata.config.display)) {
262
+ this.block.metadata.config.display = {
263
+ show_title: false,
264
+ show_background: false,
265
+ round_icon: false,
266
+ italic_icon: false,
267
+ autocolor: true,
268
+ }
269
+ }
270
+ if (this.block.metadata.config.items.length) {
271
+ for (const index in this.block.metadata.config.items) {
272
+ this.block.metadata.config.items[index].active = false
273
+ }
274
+ }
275
+ },
264
276
  methods: {
265
277
  isIcon(str) {
266
278
  return str && _.isString(str) && str.indexOf('mdi-') === 0
@@ -295,13 +307,17 @@ button.button-icon.button-icon--rounded {
295
307
  }
296
308
 
297
309
  .button-icon--normal {
298
- .clickable--icon,
310
+ .clickable--icon {
311
+ font-size: 5rem;
312
+ }
299
313
  .clickable--text {
300
314
  font-size: 1.5rem;
301
315
  }
302
316
  }
303
317
  .button-icon--large {
304
- .clickable--icon,
318
+ .clickable--icon {
319
+ font-size: 9rem;
320
+ }
305
321
  .clickable--text {
306
322
  font-size: 2.5rem;
307
323
  }
@@ -7,7 +7,13 @@
7
7
  "
8
8
  >
9
9
  <v-col cols="12" class="pa-0">
10
- <h2 v-if="block.metadata.config.title" tabindex="0">
10
+ <h2
11
+ v-if="
12
+ block.metadata.config.title &&
13
+ block.metadata.config.display_title
14
+ "
15
+ tabindex="0"
16
+ >
11
17
  {{ block.metadata.config.title }}
12
18
  </h2>
13
19
  <p
@@ -21,8 +27,8 @@
21
27
  </v-row>
22
28
  <v-row>
23
29
  <v-expansion-panels
24
- v-model="selectedPanels"
25
30
  :key="expansionPanelKey"
31
+ v-model="selectedPanels"
26
32
  accordion
27
33
  >
28
34
  <v-container
@@ -248,6 +254,9 @@ export default {
248
254
  if (_.isEmpty(this.block.metadata.config.title)) {
249
255
  this.block.metadata.config.title = ''
250
256
  }
257
+ if (!_.isBoolean(this.block.metadata.config.display_title)) {
258
+ this.$set(this.block.metadata.config, 'display_title', true)
259
+ }
251
260
  if (_.isEmpty(this.block.metadata.config.instructions)) {
252
261
  this.block.metadata.config.instructions = ''
253
262
  }
@@ -1,6 +1,11 @@
1
1
  <template>
2
2
  <v-container class="pa-0">
3
- <h2>
3
+ <h2
4
+ v-if="
5
+ block.metadata.config.title &&
6
+ block.metadata.config.display_title
7
+ "
8
+ >
4
9
  {{
5
10
  block.metadata.config.title ||
6
11
  $t(
@@ -125,6 +130,9 @@ export default {
125
130
  'windward.core.components.content.blocks.file_download.default_title'
126
131
  )
127
132
  }
133
+ if (!_.isBoolean(this.block.metadata.config.display_title)) {
134
+ this.$set(this.block.metadata.config, 'display_title', true)
135
+ }
128
136
  if (_.isEmpty(this.block.metadata.config.instructions)) {
129
137
  this.block.metadata.config.instructions = this.$t(
130
138
  'windward.core.components.content.blocks.file_download.default_instructions'
@@ -7,7 +7,13 @@
7
7
  "
8
8
  class="pa-0"
9
9
  >
10
- <h2 v-if="block.metadata.config.title" tabindex="0">
10
+ <h2
11
+ v-if="
12
+ block.metadata.config.title &&
13
+ block.metadata.config.display_title
14
+ "
15
+ tabindex="0"
16
+ >
11
17
  {{ block.metadata.config.title }}
12
18
  </h2>
13
19
 
@@ -155,6 +161,9 @@ export default {
155
161
  if (_.isEmpty(this.block.metadata.config.title)) {
156
162
  this.block.metadata.config.title = ''
157
163
  }
164
+ if (!_.isBoolean(this.block.metadata.config.display_title)) {
165
+ this.$set(this.block.metadata.config, 'display_title', true)
166
+ }
158
167
  if (_.isEmpty(this.block.metadata.config.instructions)) {
159
168
  this.block.metadata.config.instructions = ''
160
169
  }
@@ -1,15 +1,21 @@
1
1
  <template>
2
2
  <div>
3
3
  <v-container class="pa-0">
4
- <h2 v-if="block.metadata.config.title" tabindex="0">
4
+ <h2
5
+ v-if="
6
+ block.metadata.config.title &&
7
+ block.metadata.config.display_title
8
+ "
9
+ tabindex="0"
10
+ >
5
11
  {{ block.metadata.config.title }}
6
12
  </h2>
7
13
  <p
8
- v-if="block.metadata.config.description"
14
+ v-if="block.metadata.config.instructions"
9
15
  tabindex="0"
10
16
  class="pt-3"
11
17
  >
12
- {{ block.metadata.config.description }}
18
+ {{ block.metadata.config.instructions }}
13
19
  </p>
14
20
  <div
15
21
  v-if="choiceIndex !== null && block.metadata.config.show_reset"
@@ -244,8 +250,11 @@ export default {
244
250
  if (_.isEmpty(this.block.metadata.config.title)) {
245
251
  this.block.metadata.config.title = ''
246
252
  }
247
- if (_.isEmpty(this.block.metadata.config.description)) {
248
- this.block.metadata.config.description = ''
253
+ if (!_.isBoolean(this.block.metadata.config.display_title)) {
254
+ this.$set(this.block.metadata.config, 'display_title', true)
255
+ }
256
+ if (_.isEmpty(this.block.metadata.config.instructions)) {
257
+ this.block.metadata.config.instructions = ''
249
258
  }
250
259
  if (_.isEmpty(this.block.metadata.config.display_style)) {
251
260
  this.block.metadata.config.display_style = 'letter'
@@ -7,7 +7,13 @@
7
7
  "
8
8
  class="pa-0"
9
9
  >
10
- <h2 v-if="block.metadata.config.title" tabindex="0">
10
+ <h2
11
+ v-if="
12
+ block.metadata.config.title &&
13
+ block.metadata.config.display_title
14
+ "
15
+ tabindex="0"
16
+ >
11
17
  {{ block.metadata.config.title }}
12
18
  </h2>
13
19
 
@@ -116,6 +122,9 @@ export default {
116
122
  }
117
123
  })
118
124
  }
125
+ if (!_.isBoolean(this.block.metadata.config.display_title)) {
126
+ this.$set(this.block.metadata.config, 'display_title', true)
127
+ }
119
128
  if (_.isEmpty(this.block.metadata.config.currentTab)) {
120
129
  this.block.metadata.config.currentTab = 0
121
130
  }
@@ -185,4 +194,8 @@ export default {
185
194
  }
186
195
  </script>
187
196
 
188
- <style scoped></style>
197
+ <style scoped>
198
+ .text-viewer {
199
+ color: var(--v-primary-base);
200
+ }
201
+ </style>
@@ -1,7 +1,13 @@
1
1
  <template>
2
2
  <v-container class="pa-0">
3
3
  <div>
4
- <h2 v-if="block.metadata.config.title" tabindex="0">
4
+ <h2
5
+ v-if="
6
+ block.metadata.config.title &&
7
+ block.metadata.config.display_title
8
+ "
9
+ tabindex="0"
10
+ >
5
11
  {{ block.metadata.config.title }}
6
12
  </h2>
7
13
  <v-row>
@@ -110,6 +116,9 @@ export default {
110
116
  if (_.isEmpty(this.block.metadata.config)) {
111
117
  this.block.metadata.config = {}
112
118
  }
119
+ if (!_.isBoolean(this.block.metadata.config.display_title)) {
120
+ this.$set(this.block.metadata.config, 'display_title', true)
121
+ }
113
122
  if (_.isEmpty(this.block.metadata.config.instructions)) {
114
123
  this.block.metadata.config.instructions = ''
115
124
  }
@@ -1,10 +1,16 @@
1
1
  <template>
2
2
  <div>
3
- <h2 v-if="block.metadata.config.title" tabindex="0">
3
+ <h2
4
+ v-if="
5
+ block.metadata.config.title &&
6
+ block.metadata.config.display_title
7
+ "
8
+ tabindex="0"
9
+ >
4
10
  {{ block.metadata.config.title }}
5
11
  </h2>
6
- <p v-if="block.metadata.config.description" tabindex="0" class="pt-3">
7
- {{ block.metadata.config.description }}
12
+ <p v-if="block.metadata.config.instructions" tabindex="0" class="pt-3">
13
+ {{ block.metadata.config.instructions }}
8
14
  </p>
9
15
 
10
16
  <VuetifyPlayer
@@ -309,7 +315,7 @@ export default {
309
315
  // Default config settings
310
316
  defaultConfig: {
311
317
  title: '',
312
- description: '',
318
+ instructions: '',
313
319
  // Default settings for new blocks
314
320
  // This will be overridden in beforeMount()
315
321
  type: 'auto', // Allowed auto|video|audio. In audio mode the player has a max-height of 40px. Auto will switch between the other types when needed
@@ -393,6 +399,9 @@ export default {
393
399
  ) {
394
400
  this.block.metadata.config.attributes.playbackrates = [1]
395
401
  }
402
+ if (!_.isBoolean(this.block.metadata.config.display_title)) {
403
+ this.$set(this.block.metadata.config, 'display_title', true)
404
+ }
396
405
  if (_.isEmpty(this.block.assets)) {
397
406
  this.$set(this.block, 'assets', [])
398
407
  }
@@ -2,29 +2,10 @@
2
2
  <div>
3
3
  <v-container class="pa-0">
4
4
  <v-row class="pl-3 pr-3">
5
- <v-text-field
6
- id="block-settings-title"
7
- v-model="block.metadata.config.title"
8
- :autofocus="true"
9
- :rules="$Validation.getRule('block.title')"
10
- :counter="$Validation.getLimit('block.title')"
11
- outlined
12
- :label="
13
- $t(
14
- 'windward.core.components.settings.clickable_icon.title'
15
- )
16
- "
5
+ <BaseContentBlockSettings
6
+ v-model="block.metadata.config"
17
7
  :disabled="render"
18
- ></v-text-field>
19
- <v-textarea
20
- id="block-settings-instructions"
21
- v-model="block.metadata.config.instructions"
22
- :rules="$Validation.getRule('block.instructions')"
23
- :counter="$Validation.getLimit('block.instructions')"
24
- outlined
25
- :label="$t('components.content.settings.base.instructions')"
26
- :disabled="render"
27
- ></v-textarea>
8
+ ></BaseContentBlockSettings>
28
9
  </v-row>
29
10
  <v-divider class="my-4 primary"></v-divider>
30
11
  <p>
@@ -153,10 +134,11 @@
153
134
  import _ from 'lodash'
154
135
  import Crypto from '~/helpers/Crypto'
155
136
  import BaseContentSettings from '~/components/Content/Settings/BaseContentSettings.js'
156
- import TextEditor from '~/components/Text/TextEditor'
157
137
  import SortableExpansionPanel from '~/components/Core/SortableExpansionPanel.vue'
158
138
  import Uuid from '~/helpers/Uuid'
159
139
  import ImageAssetSettings from '~/components/Content/Settings/ImageAssetSettings.vue'
140
+ import BaseContentBlockSettings from '~/components/Content/Settings/BaseContentBlockSettings.vue'
141
+ import TextEditor from '~/components/Text/TextEditor'
160
142
 
161
143
  export default {
162
144
  name: 'AccordionSettings',
@@ -164,8 +146,15 @@ export default {
164
146
  TextEditor,
165
147
  SortableExpansionPanel,
166
148
  ImageAssetSettings,
149
+ BaseContentBlockSettings,
167
150
  },
168
151
  extends: BaseContentSettings,
152
+ data() {
153
+ return {
154
+ expansionPanelKey: '0',
155
+ loading: false,
156
+ }
157
+ },
169
158
  beforeMount() {
170
159
  if (_.isEmpty(this.block)) {
171
160
  this.block = {}
@@ -179,6 +168,9 @@ export default {
179
168
  if (_.isEmpty(this.block.metadata.config.title)) {
180
169
  this.block.metadata.config.title = ''
181
170
  }
171
+ if (!_.isBoolean(this.block.metadata.config.display_title)) {
172
+ this.$set(this.block.metadata.config, 'display_title', true)
173
+ }
182
174
  if (
183
175
  _.isEmpty(this.block.metadata.config.instructions) &&
184
176
  this.block.id &&
@@ -212,12 +204,6 @@ export default {
212
204
  'windward.core.shared.content_blocks.title.accordion'
213
205
  )
214
206
  },
215
- data() {
216
- return {
217
- expansionPanelKey: '0',
218
- loading: false,
219
- }
220
- },
221
207
  beforeDestroy() {
222
208
  if (this.debouncer) {
223
209
  clearTimeout(this.debouncer)
@@ -251,7 +237,7 @@ export default {
251
237
  },
252
238
  onUpdatePanel($event) {
253
239
  if ($event !== this.block.metadata.config.selectedPanels) {
254
- //catch click event to open selected panel to edit
240
+ // catch click event to open selected panel to edit
255
241
  this.block.metadata.config.selectedPanels = $event
256
242
  } else {
257
243
  // if user clicks same panel again expansion panel closes
@@ -1,27 +1,10 @@
1
1
  <template>
2
2
  <div>
3
3
  <v-container class="pa-0">
4
- <v-text-field
5
- id="block-settings-title"
6
- ref="title"
7
- v-model="block.metadata.config.title"
8
- :autofocus="true"
9
- outlined
10
- :counter="$Validation.getLimit('block.title')"
11
- :rules="$Validation.getRule('block.title')"
12
- :label="$t('components.content.settings.base.title')"
13
- :disabled="render"
14
- ></v-text-field>
15
- <v-textarea
16
- id="block-settings-instructions"
17
- v-model="block.metadata.config.instructions"
18
- outlined
19
- auto-grow
20
- :rules="$Validation.getRule('block.instructions')"
21
- :counter="$Validation.getLimit('block.instructions')"
22
- :label="$t('components.content.settings.base.instructions')"
4
+ <BaseContentBlockSettings
5
+ v-model="block.metadata.config"
23
6
  :disabled="render"
24
- ></v-textarea>
7
+ ></BaseContentBlockSettings>
25
8
  </v-container>
26
9
  <v-divider class="my-4 primary"></v-divider>
27
10
  <v-container class="pa-0">
@@ -121,13 +104,41 @@
121
104
  </template>
122
105
  <script>
123
106
  import _ from 'lodash'
107
+ import BaseContentBlockSettings from '~/components/Content/Settings/BaseContentBlockSettings.vue'
124
108
  import TextEditor from '~/components/Text/TextEditor.vue'
125
109
  import BaseContentSettings from '~/components/Content/Settings/BaseContentSettings.js'
126
110
 
127
111
  export default {
128
112
  name: 'BlockQuoteSettings',
113
+ components: { TextEditor, BaseContentBlockSettings },
129
114
  extends: BaseContentSettings,
130
- components: { TextEditor },
115
+ data() {
116
+ return {
117
+ valid: true,
118
+ loading: false,
119
+ sourceTypes: [
120
+ {
121
+ text: this.$t(
122
+ 'windward.core.components.settings.block_quote.source_types.none'
123
+ ),
124
+ value: '',
125
+ },
126
+
127
+ {
128
+ text: this.$t(
129
+ 'windward.core.components.settings.block_quote.source_types.book'
130
+ ),
131
+ value: 'book',
132
+ },
133
+ {
134
+ text: this.$t(
135
+ 'windward.core.components.settings.block_quote.source_types.online_journal'
136
+ ),
137
+ value: 'online_journal',
138
+ },
139
+ ],
140
+ }
141
+ },
131
142
  beforeMount() {
132
143
  if (_.isEmpty(this.block)) {
133
144
  this.block = {}
@@ -141,6 +152,9 @@ export default {
141
152
  if (_.isEmpty(this.block.metadata.config.title)) {
142
153
  this.block.metadata.config.title = ''
143
154
  }
155
+ if (!_.isBoolean(this.block.metadata.config.display_title)) {
156
+ this.$set(this.block.metadata.config, 'display_title', true)
157
+ }
144
158
  if (_.isEmpty(this.block.metadata.config.instructions)) {
145
159
  this.block.metadata.config.instructions = ''
146
160
  }
@@ -159,33 +173,6 @@ export default {
159
173
  'windward.core.components.content.blocks.block_quote.body'
160
174
  )
161
175
  },
162
- data() {
163
- return {
164
- valid: true,
165
- loading: false,
166
- sourceTypes: [
167
- {
168
- text: this.$t(
169
- 'windward.core.components.settings.block_quote.source_types.none'
170
- ),
171
- value: '',
172
- },
173
-
174
- {
175
- text: this.$t(
176
- 'windward.core.components.settings.block_quote.source_types.book'
177
- ),
178
- value: 'book',
179
- },
180
- {
181
- text: this.$t(
182
- 'windward.core.components.settings.block_quote.source_types.online_journal'
183
- ),
184
- value: 'online_journal',
185
- },
186
- ],
187
- }
188
- },
189
176
  methods: {},
190
177
  }
191
178
  </script>
@@ -1,30 +1,14 @@
1
1
  <template>
2
2
  <div>
3
3
  <v-container class="pa-0">
4
- <v-col class="pa-0">
5
- <v-text-field
6
- id="block-settings-title"
7
- v-model="block.metadata.config.title"
8
- :autofocus="true"
9
- :rules="$Validation.getRule('block.title')"
10
- :counter="$Validation.getLimit('block.title')"
11
- outlined
12
- :label="
13
- $t(
14
- 'windward.core.components.settings.clickable_icon.title'
15
- )
16
- "
4
+ <v-container class="pa-0">
5
+ <BaseContentBlockSettings
6
+ v-model="block.metadata.config"
17
7
  :disabled="render"
18
- ></v-text-field>
19
- <v-textarea
20
- id="block-settings-instructions"
21
- v-model="block.metadata.config.description"
22
- :rules="$Validation.getRule('block.instructions')"
23
- :counter="$Validation.getLimit('block.instructions')"
24
- outlined
25
- :label="$t('components.content.settings.base.instructions')"
26
- :disabled="render"
27
- ></v-textarea>
8
+ ></BaseContentBlockSettings>
9
+ </v-container>
10
+ <v-container class="pa-0">
11
+ <v-divider class="my-4 primary"></v-divider>
28
12
  <v-switch
29
13
  v-model="block.metadata.config.display.show_title"
30
14
  :label="
@@ -79,7 +63,7 @@
79
63
  "
80
64
  :disabled="render"
81
65
  ></v-switch>
82
- </v-col>
66
+ </v-container>
83
67
  <v-col class="pa-0">
84
68
  <SortableExpansionPanel
85
69
  v-model="block.metadata.config.items"
@@ -238,12 +222,12 @@
238
222
  <script>
239
223
  import _ from 'lodash'
240
224
  import BaseContentSettings from '~/components/Content/Settings/BaseContentSettings.js'
241
- import TextEditor from '~/components/Text/TextEditor'
242
225
  import TextIconPicker from '~/components/Core/TextIconPicker.vue'
243
226
  import ColorPicker from '~/components/Core/ColorPicker.vue'
244
227
  import SortableExpansionPanel from '~/components/Core/SortableExpansionPanel.vue'
245
- import ContentBlockAsset from '~/components/Content/ContentBlockAsset.vue'
246
228
  import ImageAssetSettings from '~/components/Content/Settings/ImageAssetSettings.vue'
229
+ import BaseContentBlockSettings from '~/components/Content/Settings/BaseContentBlockSettings.vue'
230
+ import TextEditor from '~/components/Text/TextEditor'
247
231
 
248
232
  export default {
249
233
  name: 'ClickableIconsSettings',
@@ -252,8 +236,8 @@ export default {
252
236
  TextEditor,
253
237
  TextIconPicker,
254
238
  ColorPicker,
255
- ContentBlockAsset,
256
239
  ImageAssetSettings,
240
+ BaseContentBlockSettings,
257
241
  },
258
242
  extends: BaseContentSettings,
259
243
  data() {
@@ -299,6 +283,9 @@ export default {
299
283
  if (_.isEmpty(this.block.metadata.config.title)) {
300
284
  this.block.metadata.config.title = ''
301
285
  }
286
+ if (!_.isBoolean(this.block.metadata.config.display_title)) {
287
+ this.$set(this.block.metadata.config, 'display_title', true)
288
+ }
302
289
  if (_.isEmpty(this.block.metadata.config.display)) {
303
290
  this.block.metadata.config.display = {
304
291
  show_title: false,
@@ -1,25 +1,10 @@
1
1
  <template>
2
2
  <div>
3
3
  <v-container class="pa-0">
4
- <v-text-field
5
- v-model="block.metadata.config.title"
6
- :autofocus="true"
7
- ref="title"
8
- outlined
9
- :rules="$Validation.getRule('block.title')"
10
- :counter="$Validation.getLimit('block.title')"
11
- :label="$t('components.content.settings.base.title')"
4
+ <BaseContentBlockSettings
5
+ v-model="block.metadata.config"
12
6
  :disabled="render"
13
- ></v-text-field>
14
- <v-textarea
15
- v-model="block.metadata.config.instructions"
16
- outlined
17
- :rules="$Validation.getRule('block.instructions')"
18
- :counter="$Validation.getLimit('block.instructions')"
19
- auto-grow
20
- :label="$t('components.content.settings.base.instructions')"
21
- :disabled="render"
22
- ></v-textarea>
7
+ ></BaseContentBlockSettings>
23
8
  </v-container>
24
9
  <v-divider class="my-4 primary"></v-divider>
25
10
  <v-container class="pa-0">
@@ -160,17 +145,27 @@
160
145
  <script>
161
146
  import _ from 'lodash'
162
147
  import Crypto from '~/helpers/Crypto'
148
+ import BaseContentBlockSettings from '~/components/Content/Settings/BaseContentBlockSettings.vue'
163
149
  import BaseContentSettings from '~/components/Content/Settings/BaseContentSettings.js'
164
- import TextEditor from '~/components/Text/TextEditor'
165
150
  import SortableExpansionPanel from '~/components/Core/SortableExpansionPanel.vue'
151
+ import TextEditor from '~/components/Text/TextEditor'
166
152
 
167
153
  export default {
168
154
  name: 'EmailSettings',
169
155
  components: {
170
156
  SortableExpansionPanel,
171
157
  TextEditor,
158
+ BaseContentBlockSettings,
172
159
  },
173
160
  extends: BaseContentSettings,
161
+ data() {
162
+ return {
163
+ valid: true,
164
+ loading: false,
165
+ expansionPanelKey: 0,
166
+ editingPanel: 0,
167
+ }
168
+ },
174
169
  beforeMount() {
175
170
  if (_.isEmpty(this.block)) {
176
171
  this.block = {}
@@ -184,6 +179,9 @@ export default {
184
179
  if (_.isEmpty(this.block.metadata.config.title)) {
185
180
  this.block.metadata.config.title = ''
186
181
  }
182
+ if (!_.isBoolean(this.block.metadata.config.display_title)) {
183
+ this.$set(this.block.metadata.config, 'display_title', true)
184
+ }
187
185
  if (_.isEmpty(this.block.metadata.config.instructions)) {
188
186
  this.block.metadata.config.instructions = ''
189
187
  }
@@ -207,14 +205,6 @@ export default {
207
205
  'windward.core.components.content.blocks.email.title'
208
206
  )
209
207
  },
210
- data() {
211
- return {
212
- valid: true,
213
- loading: false,
214
- expansionPanelKey: 0,
215
- editingPanel: 0,
216
- }
217
- },
218
208
  beforeDestroy() {
219
209
  if (this.debouncer) {
220
210
  clearTimeout(this.debouncer)
@@ -226,7 +216,7 @@ export default {
226
216
  methods: {
227
217
  onUpdatePanel($event) {
228
218
  if ($event !== this.block.metadata.config.selectedPanels) {
229
- //catch click event to open selected panel to edit
219
+ // catch click event to open selected panel to edit
230
220
  this.block.metadata.config.selectedPanels = $event
231
221
  } else {
232
222
  // if user clicks same panel again expansion panel closes
@@ -1,24 +1,11 @@
1
1
  <template>
2
2
  <div>
3
- <v-text-field
4
- id="block-settings-title"
5
- v-model="block.metadata.config.title"
6
- outlined
7
- :rules="$Validation.getRule('block.title')"
8
- :counter="$Validation.getLimit('block.title')"
9
- :autofocus="true"
10
- :label="$t('components.content.settings.base.title')"
11
- :disabled="render"
12
- ></v-text-field>
13
- <v-textarea
14
- id="block-settings-instructions"
15
- v-model="block.metadata.config.instructions"
16
- outlined
17
- :rules="$Validation.getRule('block.instructions')"
18
- :counter="$Validation.getLimit('block.instructions')"
19
- :disabled="render"
20
- :label="$t('components.content.settings.base.instructions')"
21
- ></v-textarea>
3
+ <v-container class="pa-0">
4
+ <BaseContentBlockSettings
5
+ v-model="block.metadata.config"
6
+ :disabled="render"
7
+ ></BaseContentBlockSettings>
8
+ </v-container>
22
9
  <v-switch
23
10
  v-model="block.metadata.config.display_detailed"
24
11
  :label="
@@ -91,14 +78,17 @@
91
78
  </template>
92
79
  <script>
93
80
  import BaseContentSettings from '~/components/Content/Settings/BaseContentSettings.js'
94
- import TextEditor from '~/components/Text/TextEditor'
95
81
  import _ from 'lodash'
96
82
  import SortableExpansionPanel from '~/components/Core/SortableExpansionPanel.vue'
83
+ import BaseContentBlockSettings from '~/components/Content/Settings/BaseContentBlockSettings.vue'
97
84
 
98
85
  export default {
99
86
  name: 'FileDownloadSettings',
87
+ components: {
88
+ SortableExpansionPanel,
89
+ BaseContentBlockSettings,
90
+ },
100
91
  extends: BaseContentSettings,
101
- components: { TextEditor, SortableExpansionPanel },
102
92
  data() {
103
93
  return {}
104
94
  },
@@ -141,6 +131,9 @@ export default {
141
131
  if (_.isEmpty(this.block.metadata.config.title)) {
142
132
  this.block.metadata.config.title = ''
143
133
  }
134
+ if (!_.isBoolean(this.block.metadata.config.display_title)) {
135
+ this.$set(this.block.metadata.config, 'display_title', true)
136
+ }
144
137
  if (_.isEmpty(this.block.metadata.config.instructions)) {
145
138
  this.block.metadata.config.instructions = ''
146
139
  }
@@ -1,27 +1,10 @@
1
1
  <template>
2
2
  <v-container>
3
- <v-row class="pl-3 pr-3">
4
- <v-text-field
5
- id="block-settings-title"
6
- v-model="block.metadata.config.title"
7
- :autofocus="true"
8
- :rules="$Validation.getRule('block.title')"
9
- :counter="$Validation.getLimit('block.title')"
10
- outlined
11
- :label="
12
- $t('windward.core.components.settings.clickable_icon.title')
13
- "
3
+ <v-row>
4
+ <BaseContentBlockSettings
5
+ v-model="block.metadata.config"
14
6
  :disabled="render"
15
- ></v-text-field>
16
- <v-textarea
17
- id="block-settings-instructions"
18
- v-model="block.metadata.config.instructions"
19
- :rules="$Validation.getRule('block.instructions')"
20
- :counter="$Validation.getLimit('block.instructions')"
21
- outlined
22
- :label="$t('components.content.settings.base.instructions')"
23
- :disabled="render"
24
- ></v-textarea>
7
+ ></BaseContentBlockSettings>
25
8
  </v-row>
26
9
  <p>
27
10
  {{ $t('windward.core.components.settings.open_response.question') }}
@@ -63,17 +46,21 @@
63
46
 
64
47
  <script>
65
48
  import _ from 'lodash'
66
- import TextEditor from '~/components/Text/TextEditor'
67
49
  import BaseContentSettings from '~/components/Content/Settings/BaseContentSettings.js'
50
+ import BaseContentBlockSettings from '~/components/Content/Settings/BaseContentBlockSettings.vue'
51
+ import TextEditor from '~/components/Text/TextEditor'
68
52
 
69
53
  export default {
70
54
  name: 'ImageSettings',
55
+ components: { TextEditor, BaseContentBlockSettings },
71
56
  extends: BaseContentSettings,
72
- components: { TextEditor },
73
57
  props: {
74
58
  settings: { type: Object, required: false, default: null },
75
59
  context: { type: String, required: false, default: 'block' },
76
60
  },
61
+ data() {
62
+ return {}
63
+ },
77
64
  beforeMount() {
78
65
  if (_.isEmpty(this.block)) {
79
66
  this.block = {}
@@ -90,6 +77,9 @@ export default {
90
77
  if (_.isEmpty(this.block.metadata.config.title)) {
91
78
  this.block.metadata.config.title = ''
92
79
  }
80
+ if (!_.isBoolean(this.block.metadata.config.display_title)) {
81
+ this.$set(this.block.metadata.config, 'display_title', true)
82
+ }
93
83
  if (_.isEmpty(this.block.metadata.config.instructions)) {
94
84
  this.block.metadata.config.instructions = ''
95
85
  }
@@ -100,10 +90,6 @@ export default {
100
90
  this.block.metadata.config.starting_text = ''
101
91
  }
102
92
  },
103
- data() {
104
- return {}
105
- },
106
- watch: {},
107
93
  mounted() {},
108
94
  methods: {},
109
95
  }
@@ -2,28 +2,13 @@
2
2
  <div>
3
3
  <v-container class="pa-0">
4
4
  <v-col class="pa-0">
5
- <v-text-field
6
- id="block-settings-title"
7
- v-model="block.metadata.config.title"
8
- :rules="$Validation.getRule('block.title')"
9
- :counter="$Validation.getLimit('block.title')"
10
- outlined
11
- :label="
12
- $t(
13
- 'windward.core.components.settings.scenario_choice.title'
14
- )
15
- "
16
- :disabled="render"
17
- ></v-text-field>
18
- <v-textarea
19
- id="block-settings-instructions"
20
- v-model="block.metadata.config.description"
21
- :rules="$Validation.getRule('block.instructions')"
22
- :counter="$Validation.getLimit('block.instructions')"
23
- outlined
24
- :label="$t('components.content.settings.base.instructions')"
5
+ <BaseContentBlockSettings
6
+ v-model="block.metadata.config"
25
7
  :disabled="render"
26
- ></v-textarea>
8
+ ></BaseContentBlockSettings>
9
+ </v-col>
10
+ <v-col class="pa-0">
11
+ <v-divider class="my-4 primary"></v-divider>
27
12
  <v-select
28
13
  v-model="block.metadata.config.display_style"
29
14
  :items="displayStyles"
@@ -204,12 +189,13 @@
204
189
  </template>
205
190
  <script>
206
191
  import _ from 'lodash'
192
+ import BaseContentBlockSettings from '~/components/Content/Settings/BaseContentBlockSettings.vue'
207
193
  import { mapGetters } from 'vuex'
208
194
  import BaseContentSettings from '~/components/Content/Settings/BaseContentSettings.js'
209
- import TextEditor from '~/components/Text/TextEditor'
210
195
  import SortableExpansionPanel from '~/components/Core/SortableExpansionPanel.vue'
211
196
  import DialogBox from '~/components/Core/DialogBox.vue'
212
197
  import Uuid from '~/helpers/Uuid'
198
+ import TextEditor from '~/components/Text/TextEditor'
213
199
 
214
200
  export default {
215
201
  name: 'ScenarioChoiceSettings',
@@ -217,13 +203,9 @@ export default {
217
203
  SortableExpansionPanel,
218
204
  TextEditor,
219
205
  DialogBox,
206
+ BaseContentBlockSettings,
220
207
  },
221
208
  extends: BaseContentSettings,
222
- computed: {
223
- ...mapGetters({
224
- contentTree: 'content/getTree',
225
- }),
226
- },
227
209
  data() {
228
210
  return {
229
211
  isLinked: false,
@@ -255,6 +237,11 @@ export default {
255
237
  ],
256
238
  }
257
239
  },
240
+ computed: {
241
+ ...mapGetters({
242
+ contentTree: 'content/getTree',
243
+ }),
244
+ },
258
245
  beforeMount() {
259
246
  if (_.isEmpty(this.block)) {
260
247
  this.block = {}
@@ -273,12 +260,15 @@ export default {
273
260
  if (_.isEmpty(this.block.metadata.config.title)) {
274
261
  this.block.metadata.config.title = ''
275
262
  }
263
+ if (!_.isBoolean(this.block.metadata.config.display_title)) {
264
+ this.$set(this.block.metadata.config, 'display_title', true)
265
+ }
276
266
  if (
277
- _.isEmpty(this.block.metadata.config.description) &&
267
+ _.isEmpty(this.block.metadata.config.instructions) &&
278
268
  this.block.id &&
279
269
  !Uuid.test(this.block.id)
280
270
  ) {
281
- this.block.metadata.config.description = this.$t(
271
+ this.block.metadata.config.instructions = this.$t(
282
272
  'windward.core.components.content.blocks.scenario_choice.information'
283
273
  )
284
274
  }
@@ -1,27 +1,10 @@
1
1
  <template>
2
2
  <div>
3
3
  <v-row class="pl-3 pr-3">
4
- <v-text-field
5
- id="block-settings-title"
6
- v-model="block.metadata.config.title"
7
- :autofocus="true"
8
- :rules="$Validation.getRule('block.title')"
9
- :counter="$Validation.getLimit('block.title')"
10
- outlined
11
- :label="
12
- $t('windward.core.components.settings.clickable_icon.title')
13
- "
4
+ <BaseContentBlockSettings
5
+ v-model="block.metadata.config"
14
6
  :disabled="render"
15
- ></v-text-field>
16
- <v-textarea
17
- id="block-settings-instructions"
18
- v-model="block.metadata.config.instructions"
19
- :rules="$Validation.getRule('block.instructions')"
20
- :counter="$Validation.getLimit('block.instructions')"
21
- outlined
22
- :label="$t('components.content.settings.base.instructions')"
23
- :disabled="render"
24
- ></v-textarea>
7
+ ></BaseContentBlockSettings>
25
8
  </v-row>
26
9
  <v-divider class="my-4 primary"></v-divider>
27
10
  <p>{{ $t('windward.core.components.settings.tab.tabs') }}</p>
@@ -130,16 +113,30 @@
130
113
  <script>
131
114
  import _, { get } from 'lodash'
132
115
  import Crypto from '~/helpers/Crypto'
133
- import TextEditor from '~/components/Text/TextEditor'
134
116
  import ImageAssetSettings from '~/components/Content/Settings/ImageAssetSettings.vue'
135
117
  import BaseContentSettings from '~/components/Content/Settings/BaseContentSettings.js'
136
118
  import SortableExpansionPanel from '~/components/Core/SortableExpansionPanel.vue'
137
119
  import Uuid from '~/helpers/Uuid'
120
+ import BaseContentBlockSettings from '~/components/Content/Settings/BaseContentBlockSettings.vue'
121
+ import TextEditor from '~/components/Text/TextEditor'
138
122
 
139
123
  export default {
140
124
  name: 'TabSettings',
141
- components: { TextEditor, ImageAssetSettings, SortableExpansionPanel },
125
+ components: {
126
+ TextEditor,
127
+ ImageAssetSettings,
128
+ SortableExpansionPanel,
129
+ BaseContentBlockSettings,
130
+ },
142
131
  extends: BaseContentSettings,
132
+ data() {
133
+ return {
134
+ expansionPanelKey: '0',
135
+ textEditorUpdateKey: Crypto.id(),
136
+ valid: true,
137
+ loading: false,
138
+ }
139
+ },
143
140
  beforeMount() {
144
141
  if (_.isEmpty(this.block)) {
145
142
  this.block = {}
@@ -158,6 +155,9 @@ export default {
158
155
  if (_.isEmpty(this.block.metadata.config.title)) {
159
156
  this.block.metadata.config.title = ''
160
157
  }
158
+ if (!_.isBoolean(this.block.metadata.config.display_title)) {
159
+ this.$set(this.block.metadata.config, 'display_title', true)
160
+ }
161
161
  if (
162
162
  _.isEmpty(this.block.metadata.config.instructions) &&
163
163
  this.block.id &&
@@ -188,14 +188,6 @@ export default {
188
188
  this.block.metadata.config.items.push(defaultObject)
189
189
  }
190
190
  },
191
- data() {
192
- return {
193
- expansionPanelKey: '0',
194
- textEditorUpdateKey: Crypto.id(),
195
- valid: true,
196
- loading: false,
197
- }
198
- },
199
191
  mounted() {
200
192
  if (this.block.metadata.config.items.length <= 0) {
201
193
  this.onAddElement()
@@ -1,24 +1,11 @@
1
1
  <template>
2
2
  <div>
3
- <v-text-field
4
- id="block-settings-title"
5
- v-model="block.metadata.config.title"
6
- outlined
7
- :rules="$Validation.getRule('block.title')"
8
- :counter="$Validation.getLimit('block.title')"
9
- :autofocus="true"
10
- :label="$t('components.content.settings.base.title')"
11
- :disabled="render"
12
- ></v-text-field>
13
- <v-textarea
14
- id="block-settings-instructions"
15
- v-model="block.metadata.config.instructions"
16
- :rules="$Validation.getRule('block.instructions')"
17
- :counter="$Validation.getLimit('block.instructions')"
18
- outlined
19
- :label="$t('components.content.settings.base.instructions')"
20
- :disabled="render"
21
- ></v-textarea>
3
+ <v-container>
4
+ <BaseContentBlockSettings
5
+ v-model="block.metadata.config"
6
+ :disabled="render"
7
+ ></BaseContentBlockSettings>
8
+ </v-container>
22
9
  <v-switch
23
10
  v-model="block.metadata.config.uploadSettings.multiple"
24
11
  :label="
@@ -45,15 +32,15 @@
45
32
  </template>
46
33
  <script>
47
34
  import BaseContentSettings from '~/components/Content/Settings/BaseContentSettings.js'
48
- import Crypto from '~/helpers/Crypto'
49
- import TextEditor from '~/components/Text/TextEditor'
50
35
  import _ from 'lodash'
51
36
  import Uuid from '~/helpers/Uuid'
37
+ import BaseContentBlockSettings from '~/components/Content/Settings/BaseContentBlockSettings.vue'
38
+ import TextEditor from '~/components/Text/TextEditor'
52
39
 
53
40
  export default {
54
41
  name: 'UserUploadSettings',
42
+ components: { TextEditor, BaseContentBlockSettings },
55
43
  extends: BaseContentSettings,
56
- components: { TextEditor },
57
44
  beforeMount() {
58
45
  if (_.isEmpty(this.block)) {
59
46
  this.block = {}
@@ -73,6 +60,9 @@ export default {
73
60
  if (_.isEmpty(this.block.metadata.config.title)) {
74
61
  this.block.metadata.config.title = ''
75
62
  }
63
+ if (!_.isBoolean(this.block.metadata.config.display_title)) {
64
+ this.$set(this.block.metadata.config, 'display_title', true)
65
+ }
76
66
  if (
77
67
  _.isEmpty(this.block.metadata.config.instructions) &&
78
68
  this.block.id &&
@@ -2,29 +2,18 @@
2
2
  <div>
3
3
  <v-row>
4
4
  <v-col cols="12">
5
- <v-text-field
6
- id="block-settings-title"
7
- v-model="block.metadata.config.title"
8
- :rules="$Validation.getRule('block.title')"
9
- :counter="$Validation.getLimit('block.title')"
10
- outlined
11
- :label="$t('windward.core.components.settings.video.title')"
5
+ <BaseContentBlockSettings
6
+ v-model="block.metadata.config"
12
7
  :disabled="render"
13
- ></v-text-field>
14
- <v-textarea
15
- id="block-settings-instructions"
16
- v-model="block.metadata.config.description"
17
- outlined
18
- auto-grow
19
- :rules="$Validation.getRule('block.instructions')"
20
- :counter="$Validation.getLimit('block.instructions')"
21
- :label="
8
+ :title-label="
9
+ $t('windward.core.components.settings.video.title')
10
+ "
11
+ :instructions-label="
22
12
  $t(
23
13
  'components.content.settings.base.description_optional'
24
14
  )
25
15
  "
26
- :disabled="render"
27
- ></v-textarea>
16
+ ></BaseContentBlockSettings>
28
17
 
29
18
  <h4 class="mb-3">
30
19
  {{ $t('windward.core.components.settings.video.sources') }}
@@ -404,11 +393,12 @@ import _ from 'lodash'
404
393
  import BaseContentSettings from '~/components/Content/Settings/BaseContentSettings.js'
405
394
  import ContentBlockAsset from '~/components/Content/ContentBlockAsset.vue'
406
395
  import SourcePicker from './VideoSettings/SourcePicker.vue'
396
+ import BaseContentBlockSettings from '~/components/Content/Settings/BaseContentBlockSettings.vue'
407
397
 
408
398
  export default {
409
399
  name: 'VideoSettings',
400
+ components: { ContentBlockAsset, SourcePicker, BaseContentBlockSettings },
410
401
  extends: BaseContentSettings,
411
- components: { ContentBlockAsset, SourcePicker },
412
402
  data() {
413
403
  return {
414
404
  fileTab: null,
@@ -450,6 +440,9 @@ export default {
450
440
  this.onAddPlaylistItem()
451
441
  this.playlistPaginator = 1
452
442
  }
443
+ if (!_.isBoolean(this.block.metadata.config.display_title)) {
444
+ this.$set(this.block.metadata.config, 'display_title', true)
445
+ }
453
446
  },
454
447
  mounted() {
455
448
  this.reloadMedia()
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@windward/core",
3
- "version": "0.17.0",
3
+ "version": "0.18.0",
4
4
  "description": "Windward UI Core Plugins",
5
5
  "main": "plugin.js",
6
6
  "scripts": {
@@ -18,6 +18,7 @@ const shallowMocks = [
18
18
  { path: '~/components/Core/UserAvatar' },
19
19
  { path: '~/components/Text/TextViewer' },
20
20
  { path: '~/components/Text/TextEditor' },
21
+ { path: '~/components/Content/Settings/BaseContentBlockSettings' },
21
22
  ]
22
23
 
23
24
  for (const index in shallowMocks) {