neo.mjs 7.2.0 → 7.3.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.
@@ -24,6 +24,16 @@ class List extends BaseList {
24
24
  * @member {String[]} baseCls=['portal-examples-list','neo-list']
25
25
  */
26
26
  baseCls: ['portal-examples-list', 'neo-list'],
27
+ /**
28
+ * @member {String} baseUrl='https://neomjs.com/'
29
+ */
30
+ baseUrl: 'https://neomjs.com/',
31
+ /**
32
+ * The env of the example links.
33
+ * Valid values are 'development', 'dist/development', 'dist/production'
34
+ * @member {String} environment='development'
35
+ */
36
+ environment: 'development',
27
37
  /**
28
38
  * @member {Neo.data.Store} store=Examples
29
39
  */
@@ -32,6 +42,10 @@ class List extends BaseList {
32
42
  * @member {String|null} storeUrl_=null
33
43
  */
34
44
  storeUrl_: null,
45
+ /**
46
+ * @member {String} sourceBaseUrl='https://github.com/neo.mjs/neo/tree/dev/'
47
+ */
48
+ sourceBaseUrl: 'https://github.com/neo.mjs/neo/tree/dev/',
35
49
  /**
36
50
  * @member {Boolean} useWrapperNode=true
37
51
  */
@@ -84,16 +98,14 @@ class List extends BaseList {
84
98
  }
85
99
 
86
100
  return [
87
- {cls: ['content', 'neo-relative'], cn: [
101
+ {cls: ['content', 'neo-relative'], removeDom: record.hidden, cn: [
88
102
  {cls: ['neo-full-size', 'preview-image'], style: {
89
103
  backgroundImage: `url('${basePath}/${record.image}'), linear-gradient(#777, #333)`}
90
104
  },
91
105
  {cls: ['neo-absolute', 'neo-item-bottom-position'], cn: [
92
- {tag: 'a', cls: ['neo-title'], href: record.url, target: '_blank', cn: [
93
- {html: record.name.replace(List.nameRegEx, "$1")}
94
- ]},
106
+ {...this.createLink(record)},
95
107
  {cls: ['neo-top-20'], cn: [
96
- {tag: 'a', cls: ['fab fa-github', 'neo-github-image'], href: record.sourceUrl, target: '_blank'},
108
+ {tag: 'a', cls: ['fab fa-github', 'neo-github-image'], href: this.sourceBaseUrl + record.sourceUrl, target: '_blank'},
97
109
  {cls: ['neo-inner-content'], cn: [
98
110
  {cls: ['neo-inner-details'], html: record.browsers.join(', ')},
99
111
  {cls: ['neo-inner-details'], html: record.environments.join(', ')}
@@ -104,6 +116,28 @@ class List extends BaseList {
104
116
  ]
105
117
  }
106
118
 
119
+ /**
120
+ *
121
+ * @param {Object} record
122
+ * @returns {Object}
123
+ */
124
+ createLink(record) {
125
+ let vdom = {
126
+ tag : 'a',
127
+ cls : ['neo-title'],
128
+ cn : [{html: record.name.replace(List.nameRegEx, "$1")}],
129
+ href: this.baseUrl + record.url
130
+ };
131
+
132
+ // Do not open multi-window examples inside a new browser window, in case the environment is the same.
133
+ // E.g. opening the multi-window covid app & the portal app inside the same app worker is problematic.
134
+ if (!record.sharedWorkers || this.environment !== Neo.config.environment) {
135
+ vdom.target = '_blank'
136
+ }
137
+
138
+ return vdom
139
+ }
140
+
107
141
  /**
108
142
  * @returns {Object}
109
143
  */
@@ -49,6 +49,7 @@ class TabContainer extends Container {
49
49
  text : 'DevMode'
50
50
  }
51
51
  }, {
52
+ environment : 'dist/development',
52
53
  reference : 'examples-dist-dev-list',
53
54
  storeUrl : '../../apps/portal/resources/data/examples_dist_dev.json',
54
55
  tabButtonConfig: {
@@ -57,6 +58,7 @@ class TabContainer extends Container {
57
58
  text : 'dist/dev'
58
59
  }
59
60
  }, {
61
+ environment : 'dist/production',
60
62
  reference : 'examples-dist-prod-list',
61
63
  storeUrl : '../../apps/portal/resources/data/examples_dist_prod.json',
62
64
  tabButtonConfig: {
@@ -111,7 +111,7 @@ class FooterContainer extends Container {
111
111
  }, {
112
112
  module: Component,
113
113
  cls : ['neo-version'],
114
- html : 'v7.2.0'
114
+ html : 'v7.3.0'
115
115
  }]
116
116
  }],
117
117
  /**
@@ -3,6 +3,7 @@ import Base from './Base.mjs';
3
3
  /**
4
4
  * @class RealWorld.api.Article
5
5
  * @extends RealWorld.api.Base
6
+ * @singleton
6
7
  */
7
8
  class Article extends Base {
8
9
  static config = {
@@ -14,7 +15,12 @@ class Article extends Base {
14
15
  /**
15
16
  * @member {String} resource='/articles'
16
17
  */
17
- resource: '/articles'
18
+ resource: '/articles',
19
+ /**
20
+ * @member {Boolean} singleton=true
21
+ * @protected
22
+ */
23
+ singleton: true
18
24
  }
19
25
 
20
26
  /**
@@ -3,6 +3,7 @@ import Base from './Base.mjs';
3
3
  /**
4
4
  * @class RealWorld.api.Favorite
5
5
  * @extends RealWorld.api.Base
6
+ * @singleton
6
7
  */
7
8
  class Favorite extends Base {
8
9
  static config = {
@@ -10,7 +11,12 @@ class Favorite extends Base {
10
11
  * @member {String} className='RealWorld.api.Favorite'
11
12
  * @protected
12
13
  */
13
- className: 'RealWorld.api.Favorite'
14
+ className: 'RealWorld.api.Favorite',
15
+ /**
16
+ * @member {Boolean} singleton=true
17
+ * @protected
18
+ */
19
+ singleton: true
14
20
  }
15
21
 
16
22
  /**
@@ -3,6 +3,7 @@ import Base from './Base.mjs';
3
3
  /**
4
4
  * @class RealWorld.api.Profile
5
5
  * @extends RealWorld.api.Base
6
+ * @singleton
6
7
  */
7
8
  class Profile extends Base {
8
9
  static config = {
@@ -14,7 +15,12 @@ class Profile extends Base {
14
15
  /**
15
16
  * @member {String} resource='/profiles'
16
17
  */
17
- resource: '/profiles'
18
+ resource: '/profiles',
19
+ /**
20
+ * @member {Boolean} singleton=true
21
+ * @protected
22
+ */
23
+ singleton: true
18
24
  }
19
25
 
20
26
  /**
@@ -3,6 +3,7 @@ import Base from './Base.mjs';
3
3
  /**
4
4
  * @class RealWorld.api.Tag
5
5
  * @extends RealWorld.api.Base
6
+ * @singleton
6
7
  */
7
8
  class Tag extends Base {
8
9
  static config = {
@@ -14,7 +15,12 @@ class Tag extends Base {
14
15
  /**
15
16
  * @member {String} resource='/tags'
16
17
  */
17
- resource: '/tags'
18
+ resource: '/tags',
19
+ /**
20
+ * @member {Boolean} singleton=true
21
+ * @protected
22
+ */
23
+ singleton: true
18
24
  }
19
25
  }
20
26
 
@@ -3,6 +3,7 @@ import Base from './Base.mjs';
3
3
  /**
4
4
  * @class RealWorld.api.User
5
5
  * @extends RealWorld.api.Base
6
+ * @singleton
6
7
  */
7
8
  class User extends Base {
8
9
  static config = {
@@ -14,7 +15,12 @@ class User extends Base {
14
15
  /**
15
16
  * @member {String} resource='/tags'
16
17
  */
17
- resource: '/users'
18
+ resource: '/users',
19
+ /**
20
+ * @member {Boolean} singleton=true
21
+ * @protected
22
+ */
23
+ singleton: true
18
24
  }
19
25
  }
20
26
 
@@ -3,6 +3,7 @@ import Base from './Base.mjs';
3
3
  /**
4
4
  * @class RealWorld2.api.Article
5
5
  * @extends RealWorld2.api.Base
6
+ * @singleton
6
7
  */
7
8
  class Article extends Base {
8
9
  static config = {
@@ -14,7 +15,12 @@ class Article extends Base {
14
15
  /**
15
16
  * @member {String} resource='/articles'
16
17
  */
17
- resource: '/articles'
18
+ resource: '/articles',
19
+ /**
20
+ * @member {Boolean} singleton=true
21
+ * @protected
22
+ */
23
+ singleton: true
18
24
  }
19
25
 
20
26
  /**
@@ -3,6 +3,7 @@ import Base from './Base.mjs';
3
3
  /**
4
4
  * @class RealWorld2.api.Favorite
5
5
  * @extends RealWorld2.api.Base
6
+ * @singleton
6
7
  */
7
8
  class Favorite extends Base {
8
9
  static config = {
@@ -10,7 +11,12 @@ class Favorite extends Base {
10
11
  * @member {String} className='RealWorld2.api.Favorite'
11
12
  * @protected
12
13
  */
13
- className: 'RealWorld2.api.Favorite'
14
+ className: 'RealWorld2.api.Favorite',
15
+ /**
16
+ * @member {Boolean} singleton=true
17
+ * @protected
18
+ */
19
+ singleton: true
14
20
  }
15
21
 
16
22
  /**
@@ -3,6 +3,7 @@ import Base from './Base.mjs';
3
3
  /**
4
4
  * @class RealWorld2.api.Profile
5
5
  * @extends RealWorld2.api.Base
6
+ * @singleton
6
7
  */
7
8
  class Profile extends Base {
8
9
  static config = {
@@ -14,7 +15,12 @@ class Profile extends Base {
14
15
  /**
15
16
  * @member {String} resource='/profiles'
16
17
  */
17
- resource: '/profiles'
18
+ resource: '/profiles',
19
+ /**
20
+ * @member {Boolean} singleton=true
21
+ * @protected
22
+ */
23
+ singleton: true
18
24
  }
19
25
 
20
26
  /**
@@ -3,6 +3,7 @@ import Base from './Base.mjs';
3
3
  /**
4
4
  * @class RealWorld2.api.Tag
5
5
  * @extends RealWorld2.api.Base
6
+ * @singleton
6
7
  */
7
8
  class Tag extends Base {
8
9
  static config = {
@@ -14,7 +15,12 @@ class Tag extends Base {
14
15
  /**
15
16
  * @member {String} resource='/tags'
16
17
  */
17
- resource: '/tags'
18
+ resource: '/tags',
19
+ /**
20
+ * @member {Boolean} singleton=true
21
+ * @protected
22
+ */
23
+ singleton: true
18
24
  }
19
25
  }
20
26
 
@@ -3,6 +3,7 @@ import Base from './Base.mjs';
3
3
  /**
4
4
  * @class RealWorld2.api.User
5
5
  * @extends RealWorld2.api.Base
6
+ * @singleton
6
7
  */
7
8
  class User extends Base {
8
9
  static config = {
@@ -14,7 +15,12 @@ class User extends Base {
14
15
  /**
15
16
  * @member {String} resource='/tags'
16
17
  */
17
- resource: '/users'
18
+ resource: '/users',
19
+ /**
20
+ * @member {Boolean} singleton=true
21
+ * @protected
22
+ */
23
+ singleton: true
18
24
  }
19
25
  }
20
26
 
@@ -20,9 +20,9 @@ class ServiceWorker extends ServiceBase {
20
20
  */
21
21
  singleton: true,
22
22
  /**
23
- * @member {String} version='7.2.0'
23
+ * @member {String} version='7.3.0'
24
24
  */
25
- version: '7.2.0'
25
+ version: '7.3.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.2.0",
3
+ "version": "7.3.0",
4
4
  "description": "The webworkers driven UI framework",
5
5
  "type": "module",
6
6
  "repository": {
@@ -49,7 +49,7 @@
49
49
  "clean-webpack-plugin": "^4.0.0",
50
50
  "commander": "^12.1.0",
51
51
  "cssnano": "^7.0.6",
52
- "envinfo": "^7.13.0",
52
+ "envinfo": "^7.14.0",
53
53
  "fs-extra": "^11.2.0",
54
54
  "highlightjs-line-numbers.js": "^2.8.0",
55
55
  "inquirer": "^10.2.2",
@@ -5,6 +5,7 @@
5
5
  cursor : default;
6
6
  display : flex;
7
7
  max-width : 800px;
8
+ margin : 0 auto;
8
9
  overflow : hidden;
9
10
  padding : 0;
10
11
  transition : height var(--portal-transition-duration) ease-out, margin-bottom var(--portal-transition-duration) ease-out;
@@ -1,8 +1,8 @@
1
1
  .portal-examples-tab-container.neo-tab-container {
2
- margin : 0 auto;
3
- max-width: 830px;
2
+
4
3
  }
5
4
 
5
+ // must not be inside the root class to honor the styling for tab button drag&drop
6
6
  .portal-examples-tab-header-toolbar.neo-tab-header-toolbar {
7
7
  background-color: #8BA6FF;
8
8
 
@@ -262,12 +262,12 @@ const DefaultConfig = {
262
262
  useVdomWorker: true,
263
263
  /**
264
264
  * buildScripts/injectPackageVersion.mjs will update this value
265
- * @default '7.2.0'
265
+ * @default '7.3.0'
266
266
  * @memberOf! module:Neo
267
267
  * @name config.version
268
268
  * @type String
269
269
  */
270
- version: '7.2.0'
270
+ version: '7.3.0'
271
271
  };
272
272
 
273
273
  Object.assign(DefaultConfig, {
@@ -346,11 +346,12 @@ class MainContainer extends Container {
346
346
  let me = this;
347
347
 
348
348
  me._editEventContainer = value = Neo.create({
349
- module : EditEventContainer,
350
- appName: me.appName,
351
- model : {parent: me.getModel()},
352
- owner : me,
353
- width : 250,
349
+ module : EditEventContainer,
350
+ appName : me.appName,
351
+ model : {parent: me.getModel()},
352
+ owner : me,
353
+ width : 250,
354
+ windowId: me.windowId,
354
355
  ...me.editEventContainerConfig
355
356
  })
356
357
  }