@windward/core 0.0.2 → 0.0.5

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.
@@ -0,0 +1,3 @@
1
+ {
2
+ "git-blame.gitWebUrl": ""
3
+ }
@@ -119,13 +119,13 @@ export default {
119
119
  }
120
120
  </script>
121
121
 
122
- <style scoped>
122
+ <style lang="scss" scoped>
123
123
  .header {
124
124
  color: white;
125
125
  margin-top: 1px;
126
126
  }
127
127
  .body {
128
- background: #f6f9f9;
128
+ background: var(--v-surface-base);
129
129
  }
130
130
  #expansion-panel-setting {
131
131
  z-index: 0;
@@ -2,10 +2,10 @@
2
2
  <div>
3
3
  <v-container>
4
4
  <v-row no-gutters>
5
- <h2>{{ block.metadata.config.title }}</h2>
5
+ <h3>{{ block.metadata.config.title }}</h3>
6
6
  </v-row>
7
7
  <v-row no-gutters>
8
- <h3>{{ block.metadata.config.description }}</h3>
8
+ <h4>{{ block.metadata.config.description }}</h4>
9
9
  </v-row>
10
10
  <v-row no-gutters>
11
11
  <p>
@@ -2,21 +2,21 @@
2
2
  <v-container>
3
3
  <v-container v-if="!doesFeedbackExist">
4
4
  <v-row>
5
- <h2>
5
+ <h3>
6
6
  {{
7
7
  block.metadata.config.definition.name
8
8
  ? block.metadata.config.definition.name
9
9
  : $t(
10
- 'plugin.core.components.content.blocks.feedback.feedback'
10
+ 'windward.core.components.content.blocks.feedback.feedback'
11
11
  )
12
12
  }}
13
- </h2>
13
+ </h3>
14
14
  </v-row>
15
15
  <v-row class="pt-2">
16
16
  <p>
17
17
  {{
18
18
  $t(
19
- 'plugin.core.components.content.blocks.feedback.description'
19
+ 'windward.core.components.content.blocks.feedback.description'
20
20
  )
21
21
  }}
22
22
  </p>
@@ -24,15 +24,15 @@
24
24
  </v-container>
25
25
  <v-container v-if="doesFeedbackExist">
26
26
  <v-row>
27
- <h2>
27
+ <h3>
28
28
  {{ block.metadata.config.definition.name }}
29
- </h2>
29
+ </h3>
30
30
  </v-row>
31
31
  <v-row class="pt-2">
32
32
  <p>
33
33
  {{
34
34
  $t(
35
- 'plugin.core.components.content.blocks.feedback.sent_feedback'
35
+ 'windward.core.components.content.blocks.feedback.sent_feedback'
36
36
  )
37
37
  }}
38
38
  </p>
@@ -87,11 +87,11 @@
87
87
  class="text-center mt-4 mr-2"
88
88
  @click="onReset()"
89
89
  >{{
90
- $t('plugin.core.components.content.blocks.feedback.reset')
90
+ $t('windward.core.components.content.blocks.feedback.reset')
91
91
  }}</v-btn
92
92
  >
93
93
  <v-btn color="success" class="text-center mt-4" @click="validate">{{
94
- $t('plugin.core.components.content.blocks.feedback.save')
94
+ $t('windward.core.components.content.blocks.feedback.save')
95
95
  }}</v-btn>
96
96
  </v-row>
97
97
  <v-form
@@ -193,7 +193,7 @@ export default {
193
193
  chosenPreset: '',
194
194
  studentResponse: '',
195
195
  noResponse: this.$t(
196
- 'plugin.core.components.content.blocks.feedback.no_response_entered'
196
+ 'windward.core.components.content.blocks.feedback.no_response_entered'
197
197
  ),
198
198
  }
199
199
  },
@@ -292,7 +292,7 @@ export default {
292
292
  } else {
293
293
  this.$toast.error(
294
294
  this.$t(
295
- 'plugin.core.components.content.blocks.feedback.fill_out'
295
+ 'windward.core.components.content.blocks.feedback.fill_out'
296
296
  )
297
297
  )
298
298
  }
@@ -9,7 +9,7 @@
9
9
  (v) =>
10
10
  !!v ||
11
11
  $t(
12
- 'plugin.core.components.content.blocks.feedback.required'
12
+ 'windward.core.components.content.blocks.feedback.required'
13
13
  ),
14
14
  ]"
15
15
  row
@@ -21,7 +21,7 @@
21
21
  color="green"
22
22
  :label="
23
23
  $t(
24
- 'plugin.core.components.content.blocks.feedback.scale.strongly_agree'
24
+ 'windward.core.components.content.blocks.feedback.scale.strongly_agree'
25
25
  )
26
26
  "
27
27
  value="5"
@@ -31,7 +31,7 @@
31
31
  color="light-green"
32
32
  :label="
33
33
  $t(
34
- 'plugin.core.components.content.blocks.feedback.scale.agree'
34
+ 'windward.core.components.content.blocks.feedback.scale.agree'
35
35
  )
36
36
  "
37
37
  value="4"
@@ -41,7 +41,7 @@
41
41
  color="amber"
42
42
  :label="
43
43
  $t(
44
- 'plugin.core.components.content.blocks.feedback.scale.neutral'
44
+ 'windward.core.components.content.blocks.feedback.scale.neutral'
45
45
  )
46
46
  "
47
47
  value="3"
@@ -51,7 +51,7 @@
51
51
  color="orange"
52
52
  :label="
53
53
  $t(
54
- 'plugin.core.components.content.blocks.feedback.scale.disagree'
54
+ 'windward.core.components.content.blocks.feedback.scale.disagree'
55
55
  )
56
56
  "
57
57
  value="2"
@@ -61,7 +61,7 @@
61
61
  color="red"
62
62
  :label="
63
63
  $t(
64
- 'plugin.core.components.content.blocks.feedback.scale.strongly_disagree'
64
+ 'windward.core.components.content.blocks.feedback.scale.strongly_disagree'
65
65
  )
66
66
  "
67
67
  value="1"
@@ -32,7 +32,7 @@ export default {
32
32
  data() {
33
33
  return {
34
34
  noResponse: this.$t(
35
- 'plugin.core.components.content.blocks.feedback.no_response_entered'
35
+ 'windward.core.components.content.blocks.feedback.no_response_entered'
36
36
  ),
37
37
  }
38
38
  },
@@ -8,7 +8,7 @@
8
8
  (v) =>
9
9
  !!v ||
10
10
  $t(
11
- 'plugin.core.components.content.blocks.feedback.required'
11
+ 'windward.core.components.content.blocks.feedback.required'
12
12
  ),
13
13
  ]"
14
14
  row
@@ -18,13 +18,13 @@
18
18
  <v-radio
19
19
  class="likert-radio"
20
20
  :label="
21
- $t('plugin.core.components.content.blocks.feedback.yes')
21
+ $t('windward.core.components.content.blocks.feedback.yes')
22
22
  "
23
23
  value="true"
24
24
  ></v-radio>
25
25
  <v-radio
26
26
  class="likert-radio"
27
- :label="$t('plugin.core.components.content.blocks.feedback.no')"
27
+ :label="$t('windward.core.components.content.blocks.feedback.no')"
28
28
  value="false"
29
29
  ></v-radio>
30
30
  </v-radio-group>
@@ -1,7 +1,11 @@
1
1
  <template>
2
2
  <div>
3
3
  <v-container>
4
- <v-tabs background-color="primary">
4
+ <v-tabs
5
+ background-color="primary"
6
+ v-model="block.metadata.config.tab"
7
+ >
8
+ <v-tabs-slider color="primary"></v-tabs-slider>
5
9
  <v-tab
6
10
  v-for="(tab, tabIndex) in block.metadata.config.items"
7
11
  :key="tabIndex"
@@ -61,6 +65,9 @@ export default {
61
65
  content: '',
62
66
  }
63
67
  this.block.metadata.config.items = []
68
+ if (_.isEmpty(this.block.metadata.config.tab)) {
69
+ this.block.metadata.config.tab = 0
70
+ }
64
71
  this.block.metadata.config.items.push(defaultObject)
65
72
  } else {
66
73
  this.block.metadata.config.items.forEach((element) => {
@@ -21,9 +21,9 @@
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
+ <h3 v-if="block.metadata.config.title" class="pl-4">
25
25
  {{ block.metadata.config.title }}
26
- </h2>
26
+ </h3>
27
27
  <VuetifyPlayer
28
28
  v-if="hasSource"
29
29
  :language="$i18n && $i18n.locale ? $i18n.locale : 'en-US'"
@@ -1,8 +1,8 @@
1
1
  <template>
2
2
  <div>
3
- <h2 class="pb-4">
4
- {{ $t('plugin.core.components.content.blocks.feedback.preset') }}
5
- </h2>
3
+ <h4 class="pb-4">
4
+ {{ $t('windward.core.components.content.blocks.feedback.preset') }}
5
+ </h4>
6
6
  <v-row>
7
7
  <v-col v-for="preset in templates" :key="preset.id" cols="6">
8
8
  <v-tooltip top>
@@ -4,7 +4,7 @@
4
4
  <v-icon>mdi-plus</v-icon>
5
5
  {{ $t('windward.core.components.content.blocks.tab.add_tab') }}
6
6
  </v-btn>
7
- <v-expansion-panels flat>
7
+ <v-expansion-panels flat v-model="block.metadata.config.tab">
8
8
  <v-expansion-panel
9
9
  v-for="(item, itemIndex) in block.metadata.config.items"
10
10
  :key="itemIndex"
@@ -59,7 +59,7 @@
59
59
  </template>
60
60
 
61
61
  <script>
62
- import _ from 'lodash'
62
+ import _, { get } from 'lodash'
63
63
  import Crypto from '~/helpers/Crypto'
64
64
  import TextEditor from '~/components/Text/TextEditor.vue'
65
65
  import BaseContentSettings from '~/components/Content/Tool/BaseContentSettings.js'
@@ -81,6 +81,9 @@ export default {
81
81
  if (_.isEmpty(this.block.metadata.config)) {
82
82
  this.block.metadata.config = {}
83
83
  }
84
+ if (_.isEmpty(this.block.metadata.config.tab)) {
85
+ this.block.metadata.config.tab = 0
86
+ }
84
87
  if (_.isEmpty(this.block.metadata.config.items)) {
85
88
  const defaultObject = {
86
89
  tabHeader: '',
@@ -30,13 +30,13 @@
30
30
  </v-btn>
31
31
  <v-row v-if="!block.metadata.config.expand">
32
32
  <v-col cols="12">
33
- <h3 class="pb-4 pt-4">
33
+ <h4 class="pb-4 pt-4">
34
34
  {{
35
35
  $t(
36
36
  'windward.core.components.content.blocks.user_upload.instructions_title'
37
37
  )
38
38
  }}
39
- </h3>
39
+ </h4>
40
40
  <TextEditor v-model="block.metadata.config.instructions" />
41
41
  </v-col>
42
42
  </v-row>
@@ -6,9 +6,9 @@
6
6
  v-model="block.metadata.config.title"
7
7
  :label="$t('windward.core.components.settings.video.title')"
8
8
  ></v-text-field>
9
- <h1 class="mb-3">
9
+ <h4 class="mb-3">
10
10
  {{ $t('windward.core.components.settings.video.sources') }}
11
- </h1>
11
+ </h4>
12
12
  <v-tabs v-model="fileTab" fixed-tabs background-color="accent">
13
13
  <v-tab>
14
14
  {{
@@ -211,9 +211,9 @@
211
211
  </v-row>
212
212
  <v-row>
213
213
  <v-col cols="12">
214
- <h1 class="mb-3">
214
+ <h4 class="mb-3">
215
215
  {{ $t('windward.core.components.settings.video.playlist') }}
216
- </h1>
216
+ </h4>
217
217
  <div>
218
218
  <strong
219
219
  v-if="
@@ -311,9 +311,9 @@
311
311
  </v-row>
312
312
  <v-row>
313
313
  <v-col cols="12">
314
- <h1 class="mb-3">
314
+ <h4 class="mb-3">
315
315
  {{ $t('windward.core.components.settings.video.playback') }}
316
- </h1>
316
+ </h4>
317
317
  <v-card elevation="0">
318
318
  <v-card-text>
319
319
  <v-row>
@@ -48,9 +48,9 @@ export default {
48
48
  }
49
49
  </script>
50
50
 
51
- <style>
51
+ <style lang="scss">
52
52
  .text-viewer {
53
- min-height: 100px;
53
+ min-height: 50px !important;
54
54
  }
55
55
  .text-viewer table tr td {
56
56
  padding: 10px !important;
@@ -66,4 +66,7 @@ img {
66
66
  height: 100% !important;
67
67
  width: 100% !important;
68
68
  }
69
+ .text-viewer {
70
+ @import './assets/tinymce/css/content';
71
+ }
69
72
  </style>
@@ -1,19 +1,22 @@
1
1
  <template>
2
2
  <editor
3
+ :key="seed + config.skin"
3
4
  v-model="text"
4
5
  initial-value=""
5
6
  :api-key="api_key"
6
7
  :init="config"
7
8
  tag-name="div"
8
- model-events="change keydown blur focus paste input"
9
- @input="change"
9
+ model-events="change keydown blur focus paste input submit"
10
10
  >
11
11
  </editor>
12
12
  </template>
13
13
 
14
14
  <script>
15
+ import _ from 'lodash'
15
16
  import Editor from '@tinymce/tinymce-vue'
16
17
  import { MathEditorPlugin } from '../../helpers/tinymce/plugin'
18
+ import contentCss from '!raw-loader!sass-loader!./assets/tinymce/css/content.scss'
19
+ import Crypto from '~/helpers/Crypto'
17
20
  export default {
18
21
  name: 'ContentEditorRichText',
19
22
  components: {
@@ -22,25 +25,127 @@ export default {
22
25
  props: {
23
26
  value: { type: String, required: true, default: '' },
24
27
  api_key: { type: String, required: true, default: '' },
28
+ height: { type: Number, required: false, default: null },
25
29
  },
26
30
  beforeMount() {
27
31
  this.text = this.value
32
+ if (this.height !== null) {
33
+ this.config.height = this.height
34
+ }
28
35
  },
29
36
  data() {
30
37
  return {
31
38
  render: true,
32
39
  text: '',
33
- config: {
40
+ seed: Crypto.id(),
41
+ }
42
+ },
43
+ watch: {
44
+ text: function (newVal) {
45
+ this.$emit('input', this.text)
46
+ },
47
+ },
48
+ computed: {
49
+ config() {
50
+ return {
34
51
  height: 500,
35
- menubar: true,
52
+ visual: false,
53
+ menubar: 'file edit insert format view table help',
54
+ menu: {
55
+ insert: {
56
+ title: 'Insert',
57
+ items: ' link inserttable | charmap | anchor | math | insertdatetime',
58
+ },
59
+ table: {
60
+ title: 'Table',
61
+ items: 'inserttable | tableprops | deletetable',
62
+ },
63
+ },
36
64
  plugins: [
37
- 'advlist autolink lists link image charmap',
65
+ 'advlist autolink lists link charmap',
38
66
  'searchreplace visualblocks code fullscreen',
39
- 'print preview anchor insertdatetime media',
40
- 'paste code help wordcount table MathEditor ',
67
+ 'anchor insertdatetime ',
68
+ 'paste code wordcount table MathEditor ',
41
69
  ],
42
70
  toolbar:
43
- 'undo redo | formatselect | bold italic | alignleft aligncenter alignright | bullist numlist outdent indent | MathEditor | help',
71
+ 'undo redo | formatselect | bold italic | alignleft aligncenter alignright | table bullist numlist outdent indent | mathButton',
72
+ table_advtab: false,
73
+ table_cell_advtab: false,
74
+ table_row_advtab: false,
75
+ table_default_attributes: {
76
+ class: 'default',
77
+ },
78
+ table_class_list: [
79
+ { title: 'None', value: ' ' },
80
+ {
81
+ title: this.$t(
82
+ 'windward.core.components.utils.tiny_mce_wrapper.table.default'
83
+ ),
84
+ menu: [
85
+ {
86
+ title: this.$t(
87
+ 'windward.core.components.utils.tiny_mce_wrapper.table.default'
88
+ ),
89
+ value: 'windward-table-default',
90
+ },
91
+ {
92
+ title: this.$t(
93
+ 'windward.core.components.utils.tiny_mce_wrapper.table.default_white_line'
94
+ ),
95
+ value: 'windward-table-default windward-table-default--lines',
96
+ },
97
+ ],
98
+ },
99
+ {
100
+ title: this.$t(
101
+ 'windward.core.components.utils.tiny_mce_wrapper.table.excel'
102
+ ),
103
+ value: 'windward-table-excel',
104
+ },
105
+ {
106
+ title: this.$t(
107
+ 'windward.core.components.utils.tiny_mce_wrapper.table.ledger'
108
+ ),
109
+ menu: [
110
+ {
111
+ title: this.$t(
112
+ 'windward.core.components.utils.tiny_mce_wrapper.table.ledger'
113
+ ),
114
+ value: 'windward-table-ledger',
115
+ },
116
+ {
117
+ title: this.$t(
118
+ 'windward.core.components.utils.tiny_mce_wrapper.table.ledger_right'
119
+ ),
120
+ value: 'windward-table-ledger windward-table-ledger--right-align',
121
+ },
122
+ {
123
+ title: this.$t(
124
+ 'windward.core.components.utils.tiny_mce_wrapper.table.ledger_left'
125
+ ),
126
+ value: 'windward-table-ledger windward-table-ledger--left-align',
127
+ },
128
+ ],
129
+ },
130
+ {
131
+ title: this.$t(
132
+ 'windward.core.components.utils.tiny_mce_wrapper.table.project_management'
133
+ ),
134
+ value: 'windward-table-pmexample',
135
+ },
136
+ {
137
+ title: this.$t(
138
+ 'windward.core.components.utils.tiny_mce_wrapper.table.t_chart'
139
+ ),
140
+ value: 'windward-table-t-chart',
141
+ },
142
+ {
143
+ title: this.$t(
144
+ 'windward.core.components.utils.tiny_mce_wrapper.table.subject_report'
145
+ ),
146
+ value: 'windward-table-subject-report',
147
+ },
148
+ ],
44
149
  setup() {
45
150
  // Here we can add plugin
46
151
  window.tinymce.PluginManager.add(
@@ -80,23 +185,12 @@ export default {
80
185
  'windward.core.shared.content_blocks.grouping.placeholder'
81
186
  ),
82
187
  //required as it will be displayed as inline style in tinymce renderer
83
- content_style:
84
- '.glossary-word {\n' +
85
- ' display: inline-block;\n' +
86
- ' border-radius: 12px;\n' +
87
- ' padding: 0px 7px;\n' +
88
- ' background-color: #ffd269;\n ' +
89
- ' font-weight: bold;\n' +
90
- ' color: #1a1d1e;' +
91
- '}',
188
+
189
+ skin: this.$vuetify.theme.isDark ? 'oxide-dark' : 'oxide',
190
+ content_css: this.$vuetify.theme.isDark ? 'dark' : 'default',
191
+ content_style: contentCss,
92
192
  importcss_append: true,
93
- },
94
- }
95
- },
96
- updated() {},
97
- methods: {
98
- change() {
99
- this.$emit('input', this.text)
193
+ }
100
194
  },
101
195
  },
102
196
  }
@@ -0,0 +1,188 @@
1
+
2
+ table {
3
+ max-width: 100%;
4
+ border: 1px solid black;
5
+ border-spacing: 0;
6
+
7
+ th, td {
8
+ border: 1px solid black;
9
+ padding: 3px;
10
+ }
11
+
12
+ }
13
+ table {
14
+ &.windward-table-default {
15
+
16
+ color: black;
17
+
18
+ th {
19
+ color: white;
20
+ padding: 16px;
21
+ background-color: #3B4143FF;
22
+ }
23
+
24
+ th, td {
25
+ text-align: left;
26
+ border: 1px solid black;
27
+ }
28
+
29
+
30
+ tr:nth-child(even) {
31
+ td {
32
+ background-color: #ffffff;
33
+ }
34
+ }
35
+
36
+ tr:nth-child(odd) {
37
+ td {
38
+ background-color: #EAEAEC;
39
+ }
40
+ }
41
+
42
+
43
+ &--lines{
44
+ border: 1px solid #ffffff;
45
+ th, td {
46
+ border: 1px solid #ffffff;
47
+ }
48
+ }
49
+
50
+ }
51
+
52
+ &.windward-table-excel {
53
+ padding-bottom: 20px;
54
+ padding-top: 20px;
55
+
56
+ td th {
57
+ border: 1px solid black;
58
+ }
59
+
60
+ th {
61
+ font-weight: bold;
62
+ padding: 3px;
63
+ text-align: center;
64
+ color: black;
65
+ background-color: #D7CCC8;
66
+ }
67
+
68
+ td {
69
+ background-color: white;
70
+ color: #000;
71
+ padding: 5px;
72
+ text-align: left;
73
+
74
+ }
75
+ }
76
+
77
+ &.windward-table-pmexample {
78
+ color: black;
79
+
80
+ th {
81
+ color: white;
82
+ padding: 16px;
83
+ background-color: #206e8c;
84
+ }
85
+
86
+ th, td {
87
+ text-align: left;
88
+
89
+ }
90
+
91
+ tr:nth-child(even) {
92
+ th {
93
+ border: 1px solid black;
94
+
95
+ }
96
+
97
+ td {
98
+ border: 1px solid black;
99
+ background-color: #ffffff;
100
+
101
+ }
102
+
103
+ }
104
+
105
+ tr:nth-child(odd) {
106
+ th {
107
+ border: 1px solid black;
108
+ }
109
+
110
+ td {
111
+ border: 1px solid black;
112
+ background-color: #EAEAEC;
113
+ }
114
+ }
115
+ }
116
+
117
+
118
+ /* ledger table */
119
+ &.windward-table-ledger {
120
+ &--right-align {
121
+ text-align: right;
122
+ }
123
+
124
+ &--left-align {
125
+ text-align: left;
126
+ }
127
+
128
+ border: 3px solid black;
129
+ background-color: white;
130
+ color: black;
131
+
132
+ thead, th {
133
+ border: 3px solid black;
134
+ font-weight: bold;
135
+ }
136
+
137
+
138
+ tr {
139
+ td {
140
+ border: 1px solid black;
141
+ }
142
+ }
143
+ }
144
+
145
+ &.windward-table-t-chart {
146
+ text-align: center;
147
+ background-color: white;
148
+ color: black;
149
+
150
+ th {
151
+ border-bottom: 3px solid black;
152
+ border-right: 3px solid black;
153
+ font-weight: bold;
154
+ }
155
+
156
+ th:last-child, td:last-child {
157
+ border-right: 0;
158
+ }
159
+
160
+ td {
161
+ border: 1px solid black;
162
+ border-right: 3px solid black;
163
+ }
164
+ }
165
+
166
+ &.windward-table-subject-report {
167
+ border: 1px solid black;
168
+ background-color: white;
169
+ color: black;
170
+ text-align: left;
171
+ padding: 11px;
172
+
173
+ thead, th {
174
+ font-weight: bold;
175
+ background-color: #EAEAEC;
176
+ padding: 3px;
177
+ }
178
+
179
+ td th {
180
+ border: 1px solid black;
181
+ }
182
+
183
+ }
184
+ }
185
+
186
+
187
+
188
+
@@ -38,7 +38,7 @@ export default class GlossaryHelper {
38
38
 
39
39
  }
40
40
  public static containsGlossaryTerms(content :string): boolean {
41
- const regex = /<span.*?.class="glossary-word".*?>(.*?)<\/span>/g
41
+ const regex = this.glossaryRegex
42
42
 
43
43
  return regex.exec(content) !== null
44
44
  }
@@ -1,7 +1,9 @@
1
1
  const MathEditorPlugin = function (editor: any) {
2
2
  let formula: any
3
3
  // ----- Events ----- //
4
-
4
+ editor.ui.registry.addIcon('insertMath', '<svg x="0px" y="0px"width="20px" height="20px" viewBox="0 0 445.878 445.878" style="enable-background:new 0 0 445.878 445.878;">' +
5
+ '<path d="M426.024,86.447H209.705l-84.911,298.911c-2.568,7.967-9.854,13.482-18.22,13.771c-0.236,0-0.464,0.006-0.688,0.006 c-8.092,0-15.41-4.924-18.436-12.478l-34.714-86.782H19.851C8.884,299.876,0,290.986,0,280.022 c0-10.965,8.893-19.854,19.851-19.854H66.18c8.109,0,15.421,4.941,18.436,12.483l19.237,48.09l72.472-260.218 c2.639-8.213,10.279-13.781,18.903-13.781h230.798c10.97,0,19.854,8.89,19.854,19.851S436.988,86.447,426.024,86.447z M436.723,353.227l-78.259-87.904l74.576-82.783c1.318-1.454,1.638-3.547,0.857-5.341c-0.804-1.791-2.577-2.946-4.54-2.946h-47.18 c-1.442,0-2.802,0.629-3.759,1.72l-50.059,58.047l-49.674-58.029c-0.939-1.103-2.317-1.738-3.771-1.738h-49.334 c-1.956,0-3.729,1.149-4.521,2.929c-0.81,1.785 0.479,3.875,0.824,5.332l73.743,82.81l-77.641,87.923 c-1.297,1.465-1.605,3.552 0.813,5.325c0.813,1.785,2.586,2.92,4.528,2.92h48.9c1.472,0,2.867-0.65,3.807-1.785l51.819-62.181 l53.05,62.229c0.951,1.11,2.328,1.743,3.782,1.743h49.97c1.962,0,3.735-1.141,4.527-2.926 C438.354,356.779,438.035,354.692,436.723,353.227z"/>' +
6
+ '</svg>' );
5
7
  editor.addCommand('equation-window', function (data: any) {
6
8
  return editor.windowManager.openUrl({
7
9
  url: '/plugins/tinymce/math',
@@ -46,9 +48,15 @@ const MathEditorPlugin = function (editor: any) {
46
48
  })
47
49
  })
48
50
 
49
- editor.ui.registry.addButton('MathEditor', {
50
- text: 'Math Editor',
51
- icon: 'gamma',
51
+ editor.ui.registry.addButton('mathButton', {
52
+ icon: 'insertMath',
53
+ onAction: () => {
54
+ editor.execCommand('equation-window', true)
55
+ },
56
+ })
57
+ editor.ui.registry.addMenuItem('math', {
58
+ text: 'Math',
59
+ icon: 'insertMath',
52
60
  onAction: () => {
53
61
  editor.execCommand('equation-window', true)
54
62
  },
@@ -80,4 +88,5 @@ const MathEditorPlugin = function (editor: any) {
80
88
  }
81
89
  }
82
90
 
91
+
83
92
  export { MathEditorPlugin }
@@ -4,4 +4,15 @@ export default {
4
4
  alternate_forms: 'Alternate Forms',
5
5
  definition: 'definition',
6
6
  related_terms: 'related terms',
7
+ table: {
8
+ default: 'Default Table',
9
+ default_white_line: 'Default Table white lines',
10
+ excel: 'Excel Table',
11
+ ledger: 'Ledger Table',
12
+ ledger_right: 'Right Aligned Ledger Table',
13
+ ledger_left: 'Left Aligned Ledger Table',
14
+ project_management: 'Project Management',
15
+ t_chart: 'T Chart',
16
+ subject_report: 'Subject Report',
17
+ },
7
18
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@windward/core",
3
- "version": "0.0.2",
3
+ "version": "0.0.5",
4
4
  "description": "Windward UI Core Plugins",
5
5
  "main": "plugin.js",
6
6
  "scripts": {
@@ -22,7 +22,8 @@
22
22
  "lodash": "^4.17.21",
23
23
  "mathlive": "^0.73.7",
24
24
  "mathml-to-latex": "^1.2.0",
25
- "prettier": "^2.6.0"
25
+ "prettier": "^2.6.0",
26
+ "raw-loader": "^4.0.2"
26
27
  },
27
28
  "devDependencies": {
28
29
  "@babel/preset-env": "^7.16.11",
@@ -38,6 +39,7 @@
38
39
  "eslint-plugin-nuxt": "^3.2.0",
39
40
  "eslint-plugin-prettier": "^4.0.0",
40
41
  "jest": "^26.6.3",
42
+ "node-sass": "^8.0.0",
41
43
  "ts-jest": "^26.5.6",
42
44
  "typescript": "^4.6.3",
43
45
  "vue": "^2.6.14",
@@ -2,9 +2,9 @@
2
2
  <v-row justify="center" align="center">
3
3
  <v-col cols="10">
4
4
  <div class="d-flex mb-5">
5
- <h1 class="mr-auto flex-grow-1">
5
+ <h2 class="mr-auto flex-grow-1">
6
6
  {{ $t('windward.core.pages.glossary.title') }}
7
- </h1>
7
+ </h2>
8
8
  </div>
9
9
 
10
10
  <v-spacer class="mt-5 mb-5" />
@@ -1,6 +1,6 @@
1
1
  <template>
2
2
  <v-container>
3
- <h1>{{ $t('windward.core.pages.user_upload.title') }}</h1>
3
+ <h2>{{ $t('windward.core.pages.user_upload.title') }}</h2>
4
4
  <v-divider class="mt-5 mb-5" />
5
5
  <v-data-table
6
6
  :headers="headers"
package/plugin.js CHANGED
@@ -2,7 +2,6 @@ import enUS from './i18n/en-US'
2
2
 
3
3
  // Content Blocks
4
4
  import Video from './components/Content/Blocks/Video'
5
- import Table from './components/Content/Blocks/Table'
6
5
  import Tab from './components/Content/Blocks/Tab'
7
6
  import Math from './components/Content/Blocks/Math'
8
7
  import MathExpressionEditor from './components/utils/MathExpressionEditor'
@@ -122,16 +121,6 @@ export default {
122
121
  'windward.core.shared.content_blocks.grouping.multimedia',
123
122
  },
124
123
  },
125
- {
126
- tag: 'core-table',
127
- template: Table,
128
- metadata: {
129
- icon: 'mdi-table',
130
- name: 'windward.core.shared.content_blocks.title.default_table',
131
- grouping:
132
- 'windward.core.shared.content_blocks.grouping.basic',
133
- },
134
- },
135
124
  {
136
125
  tag: 'core-tab',
137
126
  template: Tab,
@@ -197,9 +186,9 @@ export default {
197
186
  template: Feedback,
198
187
  metadata: {
199
188
  icon: 'mdi-message',
200
- name: 'plugin.core.shared.content_blocks.title.feedback',
189
+ name: 'windward.core.shared.content_blocks.title.feedback',
201
190
  grouping:
202
- 'plugin.core.shared.content_blocks.grouping.basic',
191
+ 'windward.core.shared.content_blocks.grouping.basic',
203
192
  },
204
193
  },
205
194
  ],
@@ -291,7 +280,7 @@ export default {
291
280
  context: ['block.core-feedback'],
292
281
  metadata: {
293
282
  icon: 'mdi-notebook-outline',
294
- name: 'plugin.core.shared.settings.title.feedback',
283
+ name: 'windward.core.shared.settings.title.feedback',
295
284
  },
296
285
  },
297
286
  ],
@@ -1,68 +0,0 @@
1
- <template>
2
- <v-container>
3
- <TextEditor
4
- v-if="!render && block.metadata.config.expand"
5
- v-model="block.body"
6
- />
7
- <TextViewer
8
- v-if="render || !block.metadata.config.expand"
9
- v-model="block.body"
10
- />
11
- </v-container>
12
- </template>
13
- <script>
14
- import _ from 'lodash'
15
- import TextViewer from '~/components/Text/TextViewer.vue'
16
- import TextEditor from '~/components/Text/TextEditor.vue'
17
- import BaseContentBlock from '~/components/Content/Blocks/BaseContentBlock'
18
- export default {
19
- name: 'ContentBlockTable',
20
- components: { TextEditor, TextViewer },
21
- extends: BaseContentBlock,
22
- beforeMount() {
23
- // Apply the default config
24
- if (_.isEmpty(this.block.body)) {
25
- this.block.body = this.tablePreset
26
- }
27
- if (_.isEmpty(this.block.metadata.config)) {
28
- this.block.metadata.config = { expand: false }
29
- }
30
- },
31
- data() {
32
- return {
33
- tablePreset: `<table style="border-collapse: collapse; width: 99.951%;" border="1">
34
- <tbody>
35
- <tr>
36
- <td style="width: 19.7426%;">&nbsp;</td>
37
- <td style="width: 19.7426%;">&nbsp;</td>
38
- <td style="width: 19.7426%;">&nbsp;</td>
39
- <td style="width: 19.7555%;">&nbsp;</td>
40
- </tr>
41
- <tr>
42
- <td style="width: 19.7426%;">&nbsp;</td>
43
- <td style="width: 19.7426%;">&nbsp;</td>
44
- <td style="width: 19.7426%;">&nbsp;</td>
45
- <td style="width: 19.7555%;">&nbsp;</td>
46
- </tr>
47
- <tr>
48
- <td style="width: 19.7426%;">&nbsp;</td>
49
- <td style="width: 19.7426%;">&nbsp;</td>
50
- <td style="width: 19.7426%;">&nbsp;</td>
51
- <td style="width: 19.7555%;">&nbsp;</td>
52
- </tr>
53
- <tr>
54
- <td style="width: 19.7426%;">&nbsp;</td>
55
- <td style="width: 19.7426%;">&nbsp;</td>
56
- <td style="width: 19.7426%;">&nbsp;</td>
57
- <td style="width: 19.7555%;">&nbsp;</td>
58
- </tr>
59
- </tbody>
60
- </table>`,
61
- }
62
- },
63
- mounted() {},
64
- methods: {},
65
- }
66
- </script>
67
-
68
- <style scoped></style>
@@ -1,21 +0,0 @@
1
- import { shallowMount } from '@vue/test-utils'
2
- import Vuetify from 'vuetify'
3
- import Vue from 'vue'
4
-
5
- import { defaultMocks } from '@/test/mocks'
6
- import Table from '@/components/Content/Blocks/Table'
7
-
8
- Vue.use(Vuetify)
9
-
10
- describe('Table Component', () => {
11
- test('is a Vue instance', () => {
12
- const wrapper = shallowMount(Table, {
13
- vuetify: new Vuetify(),
14
- mocks: defaultMocks,
15
- propsData: {
16
- value: { body: 'Table', metadata: { config: {} } },
17
- },
18
- })
19
- expect(wrapper.vm).toBeTruthy()
20
- })
21
- })