neo.mjs 7.13.0 → 7.14.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.13.0'
23
+ * @member {String} version='7.14.0'
24
24
  */
25
- version: '7.13.0'
25
+ version: '7.14.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-10-02",
19
+ "datePublished": "2024-10-12",
20
20
  "publisher": {
21
21
  "@type": "Organization",
22
22
  "name": "Neo.mjs"
@@ -1,4 +1,16 @@
1
1
  [{
2
+ "author" : "Henrique Sagara",
3
+ "authorImage" : "author_htsagara.png",
4
+ "date" : "Oct 04, 2024",
5
+ "id" : 62,
6
+ "image" : "neo-website-logo.png",
7
+ "name" : "Neo.mjs: A high-performance open-source JavaScript framework.",
8
+ "provider" : "Dev.to",
9
+ "publisher" : "",
10
+ "selectedInto": [],
11
+ "type" : "Blog Post",
12
+ "url" : "https://dev.to/htsagara/neomjs-a-high-performance-open-source-javascript-framework-739"
13
+ }, {
2
14
  "author" : "Nikhilesh Joshi",
3
15
  "authorImage" : "author_hashnj.jpg",
4
16
  "date" : "Oct 01, 2024",
@@ -111,7 +111,7 @@ class FooterContainer extends Container {
111
111
  }, {
112
112
  module: Component,
113
113
  cls : ['neo-version'],
114
- html : 'v7.13.0'
114
+ html : 'v7.14.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.13.0'
23
+ * @member {String} version='7.14.0'
24
24
  */
25
- version: '7.13.0'
25
+ version: '7.14.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.13.0",
3
+ "version": "7.14.0",
4
4
  "description": "The webworkers driven UI framework",
5
5
  "type": "module",
6
6
  "repository": {
@@ -60,7 +60,7 @@
60
60
  "neo-jsdoc": "1.0.1",
61
61
  "neo-jsdoc-x": "1.0.5",
62
62
  "postcss": "^8.4.47",
63
- "sass": "^1.79.4",
63
+ "sass": "^1.79.5",
64
64
  "siesta-lite": "5.5.2",
65
65
  "url": "^0.11.4",
66
66
  "webpack": "^5.95.0",
@@ -1,17 +1,22 @@
1
1
  @font-face {
2
2
  font-family: "GT-Planar";
3
- src: url("../../../../../../../../resources/fonts/GT-Planar-Regular.otf") format("opentype");
3
+ src : url("../../../../../../../../resources/fonts/GT-Planar-Regular.otf") format("opentype");
4
4
  }
5
+
5
6
  .portal-home-main-neo.portal-home-content-view {
6
- padding: 3em;
7
+ background-color: #ffffff;
8
+ background-image: url("data:image/svg+xml,%3Csvg width='8' height='8' viewBox='0 0 6 6' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='%23504e54' fill-opacity='0.18' fill-rule='evenodd'%3E%3Cpath d='M5 0h1L0 6V5zM6 5v1H5z'/%3E%3C/g%3E%3C/svg%3E");
9
+ padding : 3em;
7
10
 
8
11
  .logo-container {
9
- display : flex;
10
- flex-direction : row;
11
- flex-wrap : wrap;
12
- gap : 20px;
13
- min-width : 240px;
14
- min-height : 130px;
12
+ align-items : center;
13
+ background-color: transparent;
14
+ display : flex;
15
+ flex-direction : row;
16
+ flex-wrap : wrap;
17
+ gap : 20px;
18
+ min-height : 130px;
19
+ min-width : 240px;
15
20
  }
16
21
 
17
22
  .button-group {
@@ -22,56 +27,47 @@
22
27
  }
23
28
 
24
29
  .neo-h1 {
25
- font-size : 110px;
26
30
  font-family: "GT-Planar";
27
- line-height: 1;
31
+ font-size : 60px;
28
32
  }
29
33
 
30
34
  .neo-h2 {
31
- margin: 2rem;
35
+ font-size : 2.5rem;
36
+ font-weight: 800;
37
+ margin : 1.25rem;
32
38
  }
33
39
 
34
40
  .neo-h3 {
35
- margin : 1rem 14rem;
36
- max-width: 900px;
41
+ margin : 1rem 14rem;
42
+ max-width : 900px;
43
+ text-align: center;
37
44
  }
38
45
 
39
46
  .vector {
47
+ background-color : transparent;
40
48
  background-image : url("../../../../../../../../resources/images/logo/neo_logo_primary.svg");
41
49
  background-position: center center;
42
50
  background-repeat : no-repeat;
43
51
  background-size : contain;
44
- height : 10VW;
45
- max-height : 130px;
46
- min-height : 120px;
47
- min-width : 140px;
48
- }
49
-
50
- @media (max-width: 1000px) {
51
- .neo-h3 {
52
- margin: 1rem 10rem;
53
- }
52
+ height : 80px;
53
+ width : 80px;
54
54
  }
55
55
 
56
- @media (max-width: 900px) {
56
+ @media (max-width : 1000px) {
57
57
  .neo-h3 {
58
58
  margin: 1rem 7rem;
59
59
  }
60
60
  }
61
61
 
62
- @media (max-width: 645px) {
62
+ @media (max-width : 645px) {
63
63
  padding: 1.5em 0.5em;
64
64
 
65
65
  .logo-container {
66
66
  gap: 10px;
67
67
  }
68
68
 
69
- .neo-h1 {
70
- line-height: 1.2;
71
- }
72
-
73
69
  .neo-h2 {
74
- margin: 0.5rem 0;
70
+ margin: 0.5rem 0.5rem;
75
71
  }
76
72
 
77
73
  .neo-h3 {
@@ -79,7 +75,7 @@
79
75
  }
80
76
 
81
77
  .vector {
82
- height: 17VW;
78
+ height: 17vw;
83
79
  }
84
80
 
85
81
  .button-group {
@@ -87,18 +83,27 @@
87
83
  }
88
84
  }
89
85
 
90
- @media (max-width: 500px) {
86
+ @media (max-width : 500px) {
91
87
  .logo-container {
92
88
  gap: 10px;
93
89
  }
94
90
 
95
91
  .neo-h1 {
96
- font-size : 100px;
97
- line-height: 1.2;
92
+ font-size: 40px;
98
93
  }
99
94
 
100
95
  .neo-h2 {
101
- margin: 0.5rem 2rem;
96
+ font-size: 2rem;
97
+ margin : 0.5rem 2rem;
98
+ }
99
+
100
+ .neo-h3 {
101
+ font-size: 1.15rem;
102
+ }
103
+
104
+ .vector {
105
+ height: 70px;
106
+ width : 70px;
102
107
  }
103
108
  }
104
109
  }
@@ -262,12 +262,12 @@ const DefaultConfig = {
262
262
  useVdomWorker: true,
263
263
  /**
264
264
  * buildScripts/injectPackageVersion.mjs will update this value
265
- * @default '7.13.0'
265
+ * @default '7.14.0'
266
266
  * @memberOf! module:Neo
267
267
  * @name config.version
268
268
  * @type String
269
269
  */
270
- version: '7.13.0'
270
+ version: '7.14.0'
271
271
  };
272
272
 
273
273
  Object.assign(DefaultConfig, {
@@ -0,0 +1,88 @@
1
+ import Base from './Base.mjs';
2
+
3
+ /**
4
+ * Basic support for File System Access API
5
+ *
6
+ * Note: the "File System API" is available in Web Workers.
7
+ * However, the "File System Access API" extensions are Not available in Web Workers,
8
+ * because they must handle user gestures and Web Workers do Not have access to the
9
+ * UI, aka main, thread.
10
+ *
11
+ * The extensions return a promises fulfilled by FileSystemHandles,
12
+ * the FileSystemHandles are serializable and make it through (Neo's) Web Worker
13
+ * postMessage signaling to the App worker code, and we are in business,
14
+ *
15
+ * Only supported by Chrome, Edge, Opera; tested with Neo on Chrome, Opera, Edge:
16
+ * https://developer.chrome.com/docs/capabilities/web-apis/file-system-access#browser_support
17
+ *
18
+ * Note: method parameters (the opts below) are identical to the method parameters in
19
+ * https://developer.mozilla.org/en-US/docs/Web/API/Window/showOpenFilePicker
20
+ *
21
+ * @class Neo.main.addon.FileSystemAccess
22
+ * @extends Neo.main.addon.Base
23
+ */
24
+ class FileSystemAccess extends Base {
25
+ static config = {
26
+ /**
27
+ * @member {String} className='Neo.main.addon.FileSystemAccess'
28
+ * @protected
29
+ */
30
+ className: 'Neo.main.addon.FileSystemAccess',
31
+ /**
32
+ * Remote method access for other workers
33
+ * @member {Object} remote
34
+ * @protected
35
+ */
36
+ remote: {
37
+ app: [
38
+ 'showDirectoryPicker',
39
+ 'showOpenFilePicker',
40
+ 'showSaveFilePicker',
41
+ 'supported'
42
+ ]
43
+ }
44
+ }
45
+
46
+ /**
47
+ * Shows a directory picker which allows the user to select a directory.
48
+ * returns a promise fulfilled by a directory handle object.
49
+ * See: https://developer.mozilla.org/en-US/docs/Web/API/Window/showDirectoryPicker
50
+ * @param {Object} [opts]
51
+ * @returns {Promise<FileSystemDirectoryHandle>}
52
+ */
53
+ async showDirectoryPicker(opts) {
54
+ return await window.showDirectoryPicker(opts)
55
+ }
56
+
57
+ /**
58
+ * Shows a file picker which allows a user to select a file or files.
59
+ * returns a promise fulfilled an array of 1 or more filehandle objects.
60
+ * See: https://developer.mozilla.org/en-US/docs/Web/API/Window/showOpenFilePicker
61
+ * @param {Object} [opts]
62
+ * @returns {Promise<FileSystemFileHandle[]>}
63
+ */
64
+ async showOpenFilePicker(opts) {
65
+ return await window.showOpenFilePicker(opts)
66
+ }
67
+
68
+ /**
69
+ * Shows a file picker that allows a user to save a file.
70
+ * returns a promise fulfilled by a filehandle object fulfillment.
71
+ * See: https://developer.mozilla.org/en-US/docs/Web/API/Window/showSaveFilePicker
72
+ * @param {Object} [opts]
73
+ * @returns {Promise<FileSystemFileHandle>}
74
+ */
75
+ async showSaveFilePicker(opts) {
76
+ return await window.showSaveFilePicker(opts)
77
+ }
78
+
79
+ /**
80
+ * Tests if the browser supports the File System Access API.
81
+ * @returns {Boolean}
82
+ **/
83
+ supported() {
84
+ return 'showOpenFilePicker' in window
85
+ }
86
+ }
87
+
88
+ export default Neo.setupClass(FileSystemAccess);
@@ -42,7 +42,7 @@ class ServiceWorker extends Base {
42
42
  * or in case of a force refresh.
43
43
  * See: https://www.w3.org/TR/service-workers/#navigator-service-worker-controller
44
44
  */
45
- WorkerManager.serviceWorker = registration.active;
45
+ WorkerManager.serviceWorker = registration.active
46
46
  }
47
47
 
48
48
  WorkerManager.sendMessage('service', {
@@ -60,7 +60,7 @@ class ServiceWorker extends Base {
60
60
  onBeforeUnload() {
61
61
  WorkerManager.sendMessage('service', {
62
62
  action: 'unregisterPort'
63
- });
63
+ })
64
64
  }
65
65
  }
66
66
 
@@ -96,7 +96,7 @@ class ServiceBase extends Base {
96
96
 
97
97
  /**
98
98
  * @param {String} name=this.cacheName
99
- * @returns {Object}
99
+ * @returns {Promise<Object>}
100
100
  */
101
101
  async clearCache(name=this.cacheName) {
102
102
  await caches.delete(name);
@@ -104,7 +104,7 @@ class ServiceBase extends Base {
104
104
  }
105
105
 
106
106
  /**
107
- * @returns {Object}
107
+ * @returns {Promise<Object>}
108
108
  */
109
109
  async clearCaches() {
110
110
  let keys = await caches.keys();
@@ -289,6 +289,7 @@ class ServiceBase extends Base {
289
289
  * @param {String} [data.cacheName=this.cacheName]
290
290
  * @param {String[]|String} data.files
291
291
  * @param {Boolean} [data.foreReload=false]
292
+ * @returns {Promise<Object>}
292
293
  */
293
294
  async preloadAssets(data) {
294
295
  let cacheName = data.cacheName || this.cacheName,
@@ -348,7 +349,7 @@ class ServiceBase extends Base {
348
349
  * @param {Boolean} data.options.ignoreMethod=false
349
350
  * @param {Boolean} data.options.ignoreSearch=false
350
351
  * @param {Boolean} data.options.ignoreVary=false
351
- * @returns {Object}
352
+ * @returns {Promise<Object>}
352
353
  */
353
354
  async removeAssets(data) {
354
355
  if (!Neo.isObject(data)) {
@@ -356,9 +357,9 @@ class ServiceBase extends Base {
356
357
  }
357
358
 
358
359
  let {assets, options={}} = data,
359
- cacheName = data.cacheName || this.cacheName,
360
- cache = await caches.open(cacheName),
361
- promises = [];
360
+ cacheName = data.cacheName || this.cacheName,
361
+ cache = await caches.open(cacheName),
362
+ promises = [];
362
363
 
363
364
  if (!Array.isArray(assets)) {
364
365
  assets = [assets]