@windward/core 0.11.0 → 0.12.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # Changelog
2
2
 
3
+ ### Hotfix [0.12.1] created - 2025-02-21
4
+
5
+
6
+ ### Release [0.12.0] created - 2025-02-18
7
+
8
+
3
9
  ### Release [0.11.0] created - 2025-02-05
4
10
 
5
11
 
@@ -64,7 +64,9 @@
64
64
  <ImageAssetViewer
65
65
  v-if="
66
66
  block.metadata.config.items[itemIndex]
67
- .fileConfig.asset
67
+ .fileConfig.asset &&
68
+ block.metadata.config.items[itemIndex]
69
+ .fileConfig.asset.file_asset_id
68
70
  "
69
71
  v-model="
70
72
  block.metadata.config.items[itemIndex]
@@ -245,7 +247,6 @@ export default {
245
247
  default:
246
248
  return 'flex-column '
247
249
  }
248
-
249
250
  },
250
251
  getImageOrder(item) {
251
252
  const margin = item.fileConfig.display?.margin
@@ -37,6 +37,10 @@
37
37
  size="100%"
38
38
  >
39
39
  <ImageAssetViewer
40
+ v-if="
41
+ item.fileConfig.asset &&
42
+ item.fileConfig.asset.file_asset_id
43
+ "
40
44
  v-model="item.fileConfig"
41
45
  :assets="block.assets"
42
46
  class="image-asset-viewer"
@@ -103,7 +103,8 @@ export default {
103
103
  this.$emit('click:generate', generatedQuestion)
104
104
  }
105
105
  } catch (error) {
106
- const errorType = error.response?.data?.errors?.detail?.split('.').pop() || 'default'
106
+ const errorMessage = error.response?.data?.error?.message || 'assessment.error.technical'
107
+ const errorType = errorMessage.split('.').pop()
107
108
  const basePath = 'windward.core.components.content.blocks.generate_questions.error'
108
109
 
109
110
  this.$dialog.error(
@@ -128,4 +129,4 @@ export default {
128
129
  .btn-selector {
129
130
  width: 100%;
130
131
  }
131
- </style>
132
+ </style>
@@ -49,7 +49,11 @@
49
49
  }}
50
50
  </p>
51
51
  <v-alert color="light-blue lighten-4">
52
- <TextViewer v-model="response" :height="200"></TextViewer>
52
+ <TextViewer
53
+ v-model="response"
54
+ :height="200"
55
+ class="alert-text"
56
+ ></TextViewer>
53
57
  </v-alert>
54
58
  <div v-if="block.metadata.config.sample_response">
55
59
  <p>
@@ -63,6 +67,7 @@
63
67
  <TextViewer
64
68
  v-model="block.metadata.config.sample_response"
65
69
  :height="200"
70
+ class="alert-text"
66
71
  ></TextViewer>
67
72
  </v-alert>
68
73
  </div>
@@ -192,3 +197,8 @@ export default {
192
197
  },
193
198
  }
194
199
  </script>
200
+ <style scoped>
201
+ .alert-text {
202
+ color: black !important;
203
+ }
204
+ </style>
@@ -53,7 +53,8 @@
53
53
  <ImageAssetViewer
54
54
  v-if="
55
55
  tabContent.imageAsset &&
56
- tabContent.imageAsset.asset
56
+ tabContent.imageAsset.asset &&
57
+ tabContent.imageAsset.asset.file_asset_id
57
58
  "
58
59
  v-model="tabContent.imageAsset"
59
60
  :assets="block.assets"
@@ -82,6 +83,9 @@ export default {
82
83
  ImageAssetViewer,
83
84
  },
84
85
  extends: BaseContentBlock,
86
+ data() {
87
+ return {}
88
+ },
85
89
  beforeMount() {
86
90
  this.block.body = this.$t(
87
91
  'windward.core.shared.content_blocks.title.tab'
@@ -116,9 +120,6 @@ export default {
116
120
  this.block.metadata.config.currentTab = 0
117
121
  }
118
122
  },
119
- data() {
120
- return {}
121
- },
122
123
  methods: {
123
124
  async onBeforeSave() {
124
125
  this.block.metadata.config.items.forEach((element) => {
@@ -127,12 +128,15 @@ export default {
127
128
  this.block.metadata.config.currentTab = null
128
129
  },
129
130
  getImageWidth(item) {
130
- if (item.imageAsset?.display) {
131
+ if (item?.imageAsset?.display) {
131
132
  return String(item.imageAsset.display.width) + '%'
132
133
  }
133
134
  },
134
135
  getTextImageContainerClass(item) {
135
- const { margin, width } = item.imageAsset.display
136
+ const { margin, width } = item?.imageAsset?.display || {
137
+ margin: null,
138
+ width: null,
139
+ }
136
140
  // if full width set container to column
137
141
  if (width === 100) {
138
142
  return margin === 'top'
@@ -159,7 +163,7 @@ export default {
159
163
  }
160
164
  },
161
165
  getImageOrder(item) {
162
- const margin = item.imageAsset.display?.margin
166
+ const margin = item?.imageAsset?.display?.margin
163
167
  // filter out tab blocks that were created before custom
164
168
  // spacing was added to image asset settings
165
169
  if (margin) {
@@ -11,6 +11,7 @@
11
11
  <label v-if="label" class="editor-label">{{ label }}</label>
12
12
  </slot>
13
13
  <Editor
14
+ ref="editor"
14
15
  :id="editorId"
15
16
  :key="seed + (isDarkTheme ? '-theme-dark' : '-theme-light')"
16
17
  v-model="text"
@@ -468,6 +469,13 @@ export default {
468
469
  },
469
470
 
470
471
  methods: {
472
+ getEditor() {
473
+ if (this.$refs.editor && this.$refs.editor.editor) {
474
+ return this.$refs.editor.editor
475
+ } else {
476
+ return null
477
+ }
478
+ },
471
479
  read() {
472
480
  if (this.paused) {
473
481
  this.resume()
@@ -1,64 +1,64 @@
1
1
  <template>
2
- <div
3
- v-click-outside="onClickOutside"
4
- class="glossary-word"
5
- :class="{ active: show }"
6
- @click="show = !show"
7
- >
8
- <v-tooltip
2
+ <div class="glossary-word" :class="{ active: show }">
3
+ <v-menu
9
4
  v-model="show"
10
- top
11
- :open-on-hover="false"
12
- color="primary"
5
+ :close-on-content-click="false"
6
+ offset-y
13
7
  max-width="768px"
14
- z-index="10"
15
8
  >
16
9
  <template #activator="{ on }">
17
- <span tabindex="0" v-on="on">
10
+ <span
11
+ tabindex="0"
12
+ v-on="on"
13
+ @click.stop="show = !show"
14
+ >
18
15
  <slot name="term"></slot>
19
16
  </span>
20
17
  </template>
21
- <div>
22
- <div v-if="$slots['definition']">
23
- <h6 class="text-capitalize">
24
- <slot name="term"></slot>
25
- {{
26
- $t(
27
- 'windward.core.components.utils.tiny_mce_wrapper.definition'
28
- )
29
- }}
30
- :
31
- </h6>
32
- <p>
33
- <slot name="definition"></slot>
34
- </p>
35
- </div>
36
- <div v-if="$slots['alternate_forms']">
37
- <h4 class="text-capitalize">
38
- <slot name="term"></slot>
39
- {{
40
- $t(
41
- 'windward.core.components.utils.tiny_mce_wrapper.alternate_forms'
42
- )
43
- }}
44
- :
45
- </h4>
46
- <p><slot name="alternate_forms"></slot></p>
47
- </div>
48
18
 
49
- <div v-if="$slots['related_terms']">
50
- <h4 class="text-capitalize">
51
- {{
52
- $t(
53
- 'windward.core.components.utils.tiny_mce_wrapper.related_terms'
54
- )
55
- }}
56
- :
57
- </h4>
58
- <p><slot name="related_terms"></slot></p>
59
- </div>
60
- </div>
61
- </v-tooltip>
19
+ <v-card>
20
+ <v-card-text>
21
+ <div v-if="$slots['definition']">
22
+ <h6 class="text-capitalize">
23
+ <slot name="term"></slot>
24
+ {{
25
+ $t(
26
+ 'windward.core.components.utils.tiny_mce_wrapper.definition'
27
+ )
28
+ }}
29
+ :
30
+ </h6>
31
+ <p>
32
+ <slot name="definition"></slot>
33
+ </p>
34
+ </div>
35
+ <div v-if="$slots['alternate_forms']">
36
+ <h4 class="text-capitalize">
37
+ <slot name="term"></slot>
38
+ {{
39
+ $t(
40
+ 'windward.core.components.utils.tiny_mce_wrapper.alternate_forms'
41
+ )
42
+ }}
43
+ :
44
+ </h4>
45
+ <p><slot name="alternate_forms"></slot></p>
46
+ </div>
47
+
48
+ <div v-if="$slots['related_terms']">
49
+ <h4 class="text-capitalize">
50
+ {{
51
+ $t(
52
+ 'windward.core.components.utils.tiny_mce_wrapper.related_terms'
53
+ )
54
+ }}
55
+ :
56
+ </h4>
57
+ <p><slot name="related_terms"></slot></p>
58
+ </div>
59
+ </v-card-text>
60
+ </v-card>
61
+ </v-menu>
62
62
  </div>
63
63
  </template>
64
64
 
@@ -67,14 +67,12 @@ export default {
67
67
  name: 'GlossaryToolTip',
68
68
  data() {
69
69
  return {
70
- show: false,
70
+ show: false
71
71
  }
72
72
  },
73
- methods: {
74
- onClickOutside() {
75
- this.show = false
76
- },
77
- },
73
+ beforeDestroy() {
74
+ this.show = false
75
+ }
78
76
  }
79
77
  </script>
80
78
 
@@ -1,25 +1,20 @@
1
1
  export default {
2
2
  error: {
3
3
  default: 'Could not generate question from provided content.',
4
- default_support:
5
- 'Please try again or contact support if the issue persists.',
6
-
4
+ default_support: 'Please try again or contact support if the issue persists.',
5
+
7
6
  insufficient_content: 'More content needed to generate questions.',
8
- insufficient_content_support:
9
- 'Please add more text, examples, or explanations to this section. We recommend at least 2-3 paragraphs of content.',
10
-
11
- content_mismatch: "Content doesn't match question type.",
12
- content_mismatch_support:
13
- "The current content isn't suitable for this type of question. Consider adding more specific examples or comparable items.",
14
-
7
+ insufficient_content_support: 'Please add more text, examples, or explanations to this section. We recommend at least 2-3 paragraphs of content.',
8
+
9
+ content_mismatch: 'Content doesn\'t match question type.',
10
+ content_mismatch_support: 'The current content isn\'t suitable for this type of question. Consider adding more specific examples or comparable items.',
11
+
15
12
  llm_unavailable: 'Question generation temporarily unavailable.',
16
- llm_unavailable_support:
17
- "We're unable to connect to our AI service at the moment. Please try again in a few minutes.",
18
-
13
+ llm_unavailable_support: 'We\'re unable to connect to our AI service at the moment. Please try again in a few minutes.',
14
+
19
15
  technical: 'Unable to process request.',
20
- technical_support:
21
- 'Something went wrong. Please try again or contact support if this continues.',
16
+ technical_support: 'Something went wrong. Please try again or contact support if this continues.'
22
17
  },
23
18
  button_label: 'Generate Question',
24
- selected_pages: 'Selected Page',
19
+ selected_pages: 'Selected Page'
25
20
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@windward/core",
3
- "version": "0.11.0",
3
+ "version": "0.12.1",
4
4
  "description": "Windward UI Core Plugins",
5
5
  "main": "plugin.js",
6
6
  "scripts": {