neo.mjs 7.4.0 → 7.6.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.
@@ -20,9 +20,9 @@ class ServiceWorker extends ServiceBase {
20
20
  */
21
21
  singleton: true,
22
22
  /**
23
- * @member {String} version='7.4.0'
23
+ * @member {String} version='7.6.0'
24
24
  */
25
- version: '7.4.0'
25
+ version: '7.6.0'
26
26
  }
27
27
 
28
28
  /**
@@ -16,7 +16,7 @@
16
16
  "@type": "Organization",
17
17
  "name": "Neo.mjs"
18
18
  },
19
- "datePublished": "2024-09-15",
19
+ "datePublished": "2024-09-16",
20
20
  "publisher": {
21
21
  "@type": "Organization",
22
22
  "name": "Neo.mjs"
@@ -229,7 +229,13 @@ class List extends BaseList {
229
229
  needsUpdate = true;
230
230
 
231
231
  node.style = {
232
- backgroundImage: `url('${imageBasePath}/blog/${record.image}'), linear-gradient(#777, #333)`
232
+ backgroundImage: [
233
+ `url('${imageBasePath}/blog/${record.image}'),`,
234
+ 'linear-gradient(',
235
+ 'var(--portal-blog-list-gradient-start),',
236
+ 'var(--portal-blog-list-gradient-end)',
237
+ ')'
238
+ ].join('')
233
239
  }
234
240
  }
235
241
  }
@@ -223,7 +223,13 @@ class List extends BaseList {
223
223
  needsUpdate = true;
224
224
 
225
225
  node.style = {
226
- backgroundImage: `url('${imageBasePath}/${record.image}'), linear-gradient(#777, #333)`
226
+ backgroundImage: [
227
+ `url('${imageBasePath}/${record.image}'),`,
228
+ 'linear-gradient(',
229
+ 'var(--portal-examples-list-gradient-start),',
230
+ 'var(--portal-examples-list-gradient-end)',
231
+ ')'
232
+ ].join('')
227
233
  }
228
234
  }
229
235
  }
@@ -1,4 +1,5 @@
1
1
  import Component from '../../../../src/controller/Component.mjs';
2
+ import NeoArray from '../../../../src/util/Array.mjs';
2
3
 
3
4
  /**
4
5
  * @class Portal.view.examples.TabContainerController
@@ -20,6 +21,21 @@ class TabContainerController extends Component {
20
21
  }
21
22
  }
22
23
 
24
+ /**
25
+ * We need to store the current positions, since drag&drop resorting of tabs is enabled
26
+ * @member {String[]} tabItems
27
+ */
28
+ tabItems = ['devmode', 'dist_dev', 'dist_prod']
29
+
30
+ /**
31
+ *
32
+ */
33
+ onComponentConstructed() {
34
+ let me = this;
35
+
36
+ me.component.on('moveTo', me.onMoveTab, me)
37
+ }
38
+
23
39
  /**
24
40
  * @param {Object} params
25
41
  * @param {Object} value
@@ -28,13 +44,23 @@ class TabContainerController extends Component {
28
44
  onExamplesRoute(params, value, oldValue) {
29
45
  let me = this,
30
46
  itemId = params?.itemId || 'dist_prod',
47
+ index = me.tabItems.indexOf(itemId),
31
48
  store = me.getReference(`examples-${itemId.replace('_', '-')}-list`).store;
32
49
 
33
50
  if (store?.getCount() < 1) {
34
51
  store.load()
35
52
  }
36
53
 
37
- me.component.activeIndex = itemId === 'dist_prod' ? 2 : itemId === 'dist_dev' ? 1 : 0
54
+ me.component.activeIndex = index
55
+ }
56
+
57
+ /**
58
+ * @param {Object} data
59
+ * @param {Number} data.fromIndex
60
+ * @param {Number} data.toIndex
61
+ */
62
+ onMoveTab({fromIndex, toIndex}) {
63
+ NeoArray.move(this.tabItems, fromIndex, toIndex)
38
64
  }
39
65
  }
40
66
 
@@ -111,7 +111,7 @@ class FooterContainer extends Container {
111
111
  }, {
112
112
  module: Component,
113
113
  cls : ['neo-version'],
114
- html : 'v7.4.0'
114
+ html : 'v7.6.0'
115
115
  }]
116
116
  }],
117
117
  /**
@@ -20,9 +20,9 @@ class ServiceWorker extends ServiceBase {
20
20
  */
21
21
  singleton: true,
22
22
  /**
23
- * @member {String} version='7.4.0'
23
+ * @member {String} version='7.6.0'
24
24
  */
25
- version: '7.4.0'
25
+ version: '7.6.0'
26
26
  }
27
27
 
28
28
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "neo.mjs",
3
- "version": "7.4.0",
3
+ "version": "7.6.0",
4
4
  "description": "The webworkers driven UI framework",
5
5
  "type": "module",
6
6
  "repository": {
@@ -1,3 +1,15 @@
1
+ @property --portal-blog-list-gradient-end {
2
+ syntax : "<color>";
3
+ initial-value: #333;
4
+ inherits : false;
5
+ }
6
+
7
+ @property --portal-blog-list-gradient-start {
8
+ syntax : "<color>";
9
+ initial-value: #777;
10
+ inherits : false;
11
+ }
12
+
1
13
  .portal-blog-list.neo-list {
2
14
  transition: padding var(--portal-transition-duration) ease-out;
3
15
 
@@ -13,6 +25,26 @@
13
25
  white-space : normal;
14
26
  width : 100%;
15
27
 
28
+ &:focus {
29
+ outline: none;
30
+
31
+ .preview-image {
32
+ --portal-blog-list-gradient-start: darkgreen;
33
+ }
34
+ }
35
+
36
+ &:hover {
37
+ .preview-image {
38
+ --portal-blog-list-gradient-start: #3E63DD;
39
+ }
40
+
41
+ &:focus {
42
+ .preview-image {
43
+ --portal-blog-list-gradient-end: darkgreen;
44
+ }
45
+ }
46
+ }
47
+
16
48
  .content {
17
49
  flex: 1;
18
50
  }
@@ -75,7 +107,7 @@
75
107
  transition : color 250ms ease-out;
76
108
 
77
109
  &:hover {
78
- color: #5d83a7
110
+ color: #8BA6FF
79
111
  }
80
112
  }
81
113
 
@@ -96,6 +128,10 @@
96
128
  background-position : 50% 50%;
97
129
  background-size : cover;
98
130
  height : 100%;
131
+
132
+ transition:
133
+ --portal-blog-list-gradient-end var(--portal-transition-duration) ease-out,
134
+ --portal-blog-list-gradient-start var(--portal-transition-duration) ease-out;
99
135
  }
100
136
  }
101
137
 
@@ -1,3 +1,15 @@
1
+ @property --portal-examples-list-gradient-end {
2
+ syntax : "<color>";
3
+ initial-value: #333;
4
+ inherits : false;
5
+ }
6
+
7
+ @property --portal-examples-list-gradient-start {
8
+ syntax : "<color>";
9
+ initial-value: #777;
10
+ inherits : false;
11
+ }
12
+
1
13
  .portal-examples-list.neo-list {
2
14
  transition: padding var(--portal-transition-duration) ease-out;
3
15
 
@@ -12,6 +24,26 @@
12
24
  white-space : normal;
13
25
  width : 100%;
14
26
 
27
+ &:focus {
28
+ outline: none;
29
+
30
+ .preview-image {
31
+ --portal-examples-list-gradient-start: darkgreen;
32
+ }
33
+ }
34
+
35
+ &:hover {
36
+ .preview-image {
37
+ --portal-examples-list-gradient-start: #3E63DD;
38
+ }
39
+
40
+ &:focus {
41
+ .preview-image {
42
+ --portal-examples-list-gradient-end: darkgreen;
43
+ }
44
+ }
45
+ }
46
+
15
47
  .content {
16
48
  flex: 1;
17
49
  }
@@ -29,8 +61,12 @@
29
61
  color : #ddd;
30
62
  text-decoration : none;
31
63
  transition-duration : var(--portal-transition-duration);
32
- transition-property : font-size, height, width;
64
+ transition-property : color, font-size, height, width;
33
65
  transition-timing-function: ease-out;
66
+
67
+ &:hover {
68
+ color: #8BA6FF
69
+ }
34
70
  }
35
71
 
36
72
  .neo-inner-content {
@@ -72,14 +108,16 @@
72
108
 
73
109
  .neo-title {
74
110
  color : #fff;
111
+ display : flex;
75
112
  font-weight : 600;
76
113
  line-height : 1;
77
114
  text-decoration: none;
78
115
  text-shadow : 1px 1px 1px #000, 1px 1px 1px #fff;
79
116
  transition : color 250ms ease-out;
117
+ width : fit-content;
80
118
 
81
119
  &:hover {
82
- color: #5d83a7
120
+ color: #8BA6FF
83
121
  }
84
122
  }
85
123
 
@@ -93,6 +131,10 @@
93
131
  background-blend-mode: overlay;
94
132
  background-size : cover;
95
133
  height : 100%;
134
+
135
+ transition:
136
+ --portal-examples-list-gradient-end var(--portal-transition-duration) ease-out,
137
+ --portal-examples-list-gradient-start var(--portal-transition-duration) ease-out;
96
138
  }
97
139
  }
98
140
 
@@ -0,0 +1,3 @@
1
+ :root .neo-theme-neo-light { // .neo-viewport
2
+ --portal-transition-duration: 300ms;
3
+ }
@@ -262,12 +262,12 @@ const DefaultConfig = {
262
262
  useVdomWorker: true,
263
263
  /**
264
264
  * buildScripts/injectPackageVersion.mjs will update this value
265
- * @default '7.4.0'
265
+ * @default '7.6.0'
266
266
  * @memberOf! module:Neo
267
267
  * @name config.version
268
268
  * @type String
269
269
  */
270
- version: '7.4.0'
270
+ version: '7.6.0'
271
271
  };
272
272
 
273
273
  Object.assign(DefaultConfig, {
@@ -20,7 +20,7 @@ class TestClass extends core.Base {
20
20
  }
21
21
  }
22
22
 
23
- Neo.applyClassConfig(TestClass);
23
+ TestClass = Neo.setupClass(TestClass);
24
24
 
25
25
  StartTest(t => {
26
26
  t.it('Default class fields inside constructors', t => {
@@ -73,7 +73,7 @@ StartTest(t => {
73
73
  }
74
74
  }
75
75
 
76
- Neo.applyClassConfig(NeoCtorTest);
76
+ Neo.setupClass(NeoCtorTest);
77
77
 
78
78
  Neo.create(NeoCtorTest);
79
79
 
@@ -243,9 +243,10 @@ StartTest(t => {
243
243
  fieldB = 1;
244
244
 
245
245
  static config = {
246
- configA_: 0,
247
- configB_: 0,
248
- configC_: 0
246
+ className: 'AdvancedClass',
247
+ configA_ : 0,
248
+ configB_ : 0,
249
+ configC_ : 0
249
250
  }
250
251
 
251
252
  afterSetConfigA(value, oldValue) {
@@ -280,7 +281,7 @@ StartTest(t => {
280
281
  }
281
282
  }
282
283
 
283
- Neo.applyClassConfig(AdvancedClass);
284
+ AdvancedClass = Neo.setupClass(AdvancedClass);
284
285
 
285
286
  let instance = Neo.create(AdvancedClass);
286
287
 
@@ -46,7 +46,7 @@ StartTest(t => {
46
46
  }
47
47
  }
48
48
 
49
- Neo.applyClassConfig(TestClass);
49
+ Neo.setupClass(TestClass);
50
50
 
51
51
  instance = Neo.create(TestClass);
52
52