neo.mjs 6.15.0 → 6.15.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.
@@ -20,9 +20,9 @@ class ServiceWorker extends ServiceBase {
20
20
  */
21
21
  singleton: true,
22
22
  /**
23
- * @member {String} version='6.15.0'
23
+ * @member {String} version='6.15.1'
24
24
  */
25
- version: '6.15.0'
25
+ version: '6.15.1'
26
26
  }
27
27
 
28
28
  /**
@@ -67,12 +67,13 @@ class MainContainerController extends Controller {
67
67
  /**
68
68
  * @param {Object} data
69
69
  * @param {String} data.appName
70
+ * @param {Number} data.windowId
70
71
  */
71
- async onAppConnect(data) {
72
+ async onAppConnect(data) {console.log(data);
72
73
  let me = this,
73
74
  app = Neo.apps[data.appName],
74
75
  mainView = app.mainView,
75
- windowId = mainView.windowId,
76
+ {windowId} = data,
76
77
  searchString = await Neo.Main.getByPath({path: 'location.search', windowId}),
77
78
  livePreviewId = me.decodeUri(searchString.substring(1)).id,
78
79
  livePreview = Neo.getComponent(livePreviewId),
@@ -91,32 +92,38 @@ class MainContainerController extends Controller {
91
92
  /**
92
93
  * @param {Object} data
93
94
  * @param {String} data.appName
95
+ * @param {Number} data.windowId
94
96
  */
95
97
  async onAppDisconnect(data) {
96
- let me = this,
97
- app = Neo.apps[data.appName],
98
- mainView = app.mainView,
99
- windowId = mainView.windowId,
100
- searchString = await Neo.Main.getByPath({path: 'location.search', windowId}),
101
- livePreviewId = me.decodeUri(searchString.substring(1)).id,
102
- livePreview = Neo.getComponent(livePreviewId),
103
- sourceContainer = livePreview.getReference('preview'),
104
- tabContainer = livePreview.tabContainer,
105
- sourceView = mainView.removeAt(0, false);
106
-
107
- console.log(data, me.connectedApps);
108
-
109
- livePreview.previewContainer = null;
110
- sourceContainer.add(sourceView);
111
-
112
- tabContainer.activeIndex = 1; // switch to the source view
113
-
114
- livePreview.getReference('popout-window-button').disabled = false;
115
- tabContainer.getTabAtIndex(1).disabled = false;
116
-
117
- /*Neo.Main.windowClose({
118
- names: me.connectedApps
119
- })*/
98
+ let me = this,
99
+ {appName, windowId} = data,
100
+ app = Neo.apps[appName],
101
+ mainView = app.mainView;
102
+
103
+ // Closing a code preview window needs to drop the preview back into the related main app
104
+ if (appName !== 'Portal') {
105
+ let searchString = await Neo.Main.getByPath({path: 'location.search', windowId}),
106
+ livePreviewId = me.decodeUri(searchString.substring(1)).id,
107
+ livePreview = Neo.getComponent(livePreviewId),
108
+ sourceContainer = livePreview.getReference('preview'),
109
+ tabContainer = livePreview.tabContainer,
110
+ sourceView = mainView.removeAt(0, false);
111
+
112
+ livePreview.previewContainer = null;
113
+ sourceContainer.add(sourceView);
114
+
115
+ tabContainer.activeIndex = 1; // switch to the source view
116
+
117
+ livePreview.getReference('popout-window-button').disabled = false;
118
+ tabContainer.getTabAtIndex(1).disabled = false
119
+ }
120
+ // Close popup windows when closing or reloading the main window
121
+ else {
122
+ Neo.Main.windowClose({
123
+ names: me.connectedApps,
124
+ windowId
125
+ })
126
+ }
120
127
  }
121
128
 
122
129
  /**
@@ -3,5 +3,5 @@
3
3
  "basePath" : "../../",
4
4
  "environment" : "development",
5
5
  "mainPath" : "./Main.mjs",
6
- "mainThreadAddons": ["DragDrop", "Stylesheet"]
6
+ "mainThreadAddons": ["DragDrop", "Navigator", "Stylesheet"]
7
7
  }
@@ -306,6 +306,7 @@ class MembersList extends Base {
306
306
  item.examples.forEach(example => {
307
307
  itemConfig.cn.push({
308
308
  tag: 'pre',
309
+ cls: ['hljs'],
309
310
  cn : [{
310
311
  tag : 'code',
311
312
  html: example
@@ -47,7 +47,7 @@ class SourceViewComponent extends Component {
47
47
  */
48
48
  _vdom:
49
49
  {cn: [
50
- {tag: 'pre', cn: [
50
+ {tag: 'pre', cls: ['hljs'], cn: [
51
51
  {tag: 'code', class: 'language-javascript'}
52
52
  ]}
53
53
  ]}
@@ -17,7 +17,7 @@ code,
17
17
  display : block;
18
18
  font-size : 12px;
19
19
  overflow-x: auto;
20
- padding : 0.5em;
20
+ padding : 0;
21
21
  }
22
22
 
23
23
  .hljs,
@@ -117,4 +117,4 @@ code,
117
117
 
118
118
  .neo-highlighted-line {
119
119
  background-color: #3c3f41 !important;
120
- }
120
+ }
@@ -14,7 +14,7 @@ pre.hljs {
14
14
  display : block;
15
15
  font-size : 12px;
16
16
  overflow-x: auto;
17
- padding : 0.5em;
17
+ padding : 0;
18
18
  }
19
19
 
20
20
  .hljs-comment,
@@ -133,4 +133,4 @@ pre.hljs {
133
133
 
134
134
  .neo-highlighted-line {
135
135
  background-color: #cee8fc !important;
136
- }
136
+ }
@@ -20,9 +20,9 @@ class ServiceWorker extends ServiceBase {
20
20
  */
21
21
  singleton: true,
22
22
  /**
23
- * @member {String} version='6.15.0'
23
+ * @member {String} version='6.15.1'
24
24
  */
25
- version: '6.15.0'
25
+ version: '6.15.1'
26
26
  }
27
27
 
28
28
  /**
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
 
2
2
  {
3
3
  "name": "neo.mjs",
4
- "version": "6.15.0",
4
+ "version": "6.15.1",
5
5
  "description": "The webworkers driven UI framework",
6
6
  "type": "module",
7
7
  "repository": {
@@ -56,22 +56,3 @@ mark {
56
56
  color : black;
57
57
  padding : 0.1em 0.2em;
58
58
  }
59
-
60
-
61
-
62
- .neo-splitter {
63
- opacity: 1;
64
- margin: 8px 2px;
65
- border-radius: 100px;
66
- border: unset !important;
67
-
68
- &:hover, &:active {
69
- background-color: #5595F5 !important;
70
- }
71
- }
72
-
73
- .neo-dragproxy {
74
- &.neo-splitter {
75
- background-color: #5595F5 !important;
76
- }
77
- }
@@ -1,5 +1,22 @@
1
1
  :root .neo-theme-neo-light { // .neo-splitter
2
2
  --splitter-background-color: #f2f2f2;
3
3
  --splitter-border : 1px solid #ddd;
4
- --splitter-hover-color : #5d83a7
4
+ --splitter-hover-color : #5d83a7;
5
+
6
+ .neo-splitter {
7
+ opacity: 1;
8
+ margin: 8px 2px;
9
+ border-radius: 100px;
10
+ border: unset !important;
11
+
12
+ &:hover, &:active {
13
+ background-color: #5595F5 !important;
14
+ }
15
+ }
16
+
17
+ .neo-dragproxy {
18
+ &.neo-splitter {
19
+ background-color: #5595F5 !important;
20
+ }
21
+ }
5
22
  }
@@ -260,12 +260,12 @@ const DefaultConfig = {
260
260
  useVdomWorker: true,
261
261
  /**
262
262
  * buildScripts/injectPackageVersion.mjs will update this value
263
- * @default '6.15.0'
263
+ * @default '6.15.1'
264
264
  * @memberOf! module:Neo
265
265
  * @name config.version
266
266
  * @type String
267
267
  */
268
- version: '6.15.0'
268
+ version: '6.15.1'
269
269
  };
270
270
 
271
271
  Object.assign(DefaultConfig, {
@@ -412,7 +412,7 @@ class DomEvents extends Base {
412
412
  let manager = Neo.worker.Manager;
413
413
 
414
414
  manager.appNames.forEach(appName => {
415
- manager.broadcast({action: 'disconnect', appName})
415
+ manager.broadcast({action: 'disconnect', appName, windowId: manager.windowId})
416
416
  })
417
417
  }
418
418
 
@@ -109,11 +109,12 @@ class Base extends CoreBase {
109
109
  * Only relevant for SharedWorkers
110
110
  * @param {Object} data
111
111
  */
112
- onConnect(data) {
112
+ async onConnect(data) {
113
113
  // short delay to ensure app VCs are in place
114
- setTimeout(() => {
115
- this.fire('connect', {appName: data.appName})
116
- }, 10)
114
+ await this.timeout(10);
115
+
116
+ let {appName, windowId} = data;
117
+ this.fire('connect', {appName, windowId})
117
118
  }
118
119
 
119
120
  /**
@@ -162,7 +163,8 @@ class Base extends CoreBase {
162
163
  * @param {Object} data
163
164
  */
164
165
  onDisconnect(data) {
165
- this.fire('disconnect', {appName: data.appName})
166
+ let {appName, windowId} = data;
167
+ this.fire('disconnect', {appName, windowId})
166
168
  }
167
169
 
168
170
  /**
@@ -212,7 +214,7 @@ class Base extends CoreBase {
212
214
  for (port of me.ports) {
213
215
  if (!port.appName) {
214
216
  port.appName = appName;
215
- me.onConnect({appName});
217
+ me.onConnect({appName, windowId: port.windowId});
216
218
  break
217
219
  }
218
220
  }