neo.mjs 6.9.5 → 6.9.7

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.
Files changed (51) hide show
  1. package/.github/CONCEPT.md +2 -2
  2. package/.github/NEOMJS_HISTORY.md +2 -2
  3. package/README.md +10 -10
  4. package/apps/ServiceWorker.mjs +2 -2
  5. package/apps/covid/Util.mjs +1 -1
  6. package/apps/covid/view/HeaderContainer.mjs +1 -1
  7. package/apps/covid/view/MainContainerController.mjs +1 -1
  8. package/apps/learnneo/neo-config.json +1 -0
  9. package/apps/learnneo/store/Content.mjs +52 -2
  10. package/apps/learnneo/view/home/ContentTreeList.mjs +34 -4
  11. package/apps/learnneo/view/home/MainContainer.mjs +17 -29
  12. package/apps/learnneo/view/home/MainContainerController.mjs +15 -25
  13. package/apps/learnneo/view/home/MainContainerModel.mjs +35 -0
  14. package/apps/route/view/HeaderContainer.mjs +1 -1
  15. package/apps/sharedcovid/Util.mjs +1 -1
  16. package/apps/sharedcovid/view/HeaderContainer.mjs +1 -1
  17. package/apps/sharedcovid/view/MainContainerController.mjs +1 -1
  18. package/apps/website/view/blog/List.mjs +1 -1
  19. package/apps/website/view/examples/List.mjs +1 -1
  20. package/examples/ServiceWorker.mjs +2 -2
  21. package/examples/component/coronaGallery/CountryGallery.mjs +1 -1
  22. package/examples/component/coronaHelix/CountryHelix.mjs +1 -1
  23. package/examples/component/toast/resources/highlight/CHANGES.md +2 -2
  24. package/examples/component/toast/resources/highlight/README.md +2 -2
  25. package/examples/form/field/textarea/MainContainer.mjs +7 -1
  26. package/examples/grid/covid/Util.mjs +1 -1
  27. package/examples/preloadingAssets/view/MainContainer.mjs +2 -2
  28. package/examples/preloadingAssets/view/MainContainerController.mjs +1 -1
  29. package/examples/table/covid/Util.mjs +1 -1
  30. package/package.json +1 -1
  31. package/resources/data/learnneo/p/2023-10-01T18-29-19-158Z.md +96 -0
  32. package/resources/data/learnneo/p/2023-10-07T19-18-28-517Z.md +102 -0
  33. package/resources/data/learnneo/p/2023-10-08T20-20-07-934Z.md +75 -0
  34. package/resources/data/learnneo/p/2023-10-08T20-20-37-336Z.md +29 -0
  35. package/resources/data/learnneo/p/2023-10-08T20-37-30-658Z.md +0 -0
  36. package/resources/data/learnneo/p/2023-10-08T21-58-25-809Z.md +68 -0
  37. package/resources/data/learnneo/p/2023-10-08T22-22-11-013Z.md +0 -0
  38. package/resources/data/learnneo/p/2023-10-14T19-25-08-153Z.md +121 -0
  39. package/resources/data/learnneo/pages/whyneo.md +4 -0
  40. package/resources/data/learnneo/t.json +130 -0
  41. package/resources/deck/whyneo.md +80 -0
  42. package/resources/scss/src/apps/learnneo/Viewport.scss +57 -0
  43. package/resources/scss/src/component/Base.scss +16 -16
  44. package/resources/scss/theme-dark/component/Base.scss +6 -0
  45. package/resources/scss/theme-dark/menu/List.scss +0 -1
  46. package/resources/scss/theme-light/component/Base.scss +6 -0
  47. package/resources/scss/theme-light/menu/List.scss +0 -1
  48. package/src/DefaultConfig.mjs +2 -2
  49. package/src/form/field/TextArea.mjs +52 -0
  50. package/src/main/DomAccess.mjs +23 -0
  51. /package/resources/data/learnneo/{content.json → tree.json} +0 -0
@@ -0,0 +1,80 @@
1
+
2
+ #hi
3
+
4
+
5
+ Neo.mjs is a framework used to create browser-based applications.
6
+
7
+ Some key features and benefits of Neo.mjs are:
8
+
9
+ <div type="expander" caption="Multi-Threaded">
10
+ <p>
11
+ When a Neo.mjs application starts, the framework spawns three web-workers.
12
+ Web-workers are each run in their own thread. As a result, a typical Neo.mjs application
13
+ has four threads:
14
+ <ol>
15
+ <li>The _main_ thread, where DOM updates are applied
16
+ <li>An _application_ web-worker where normal application locic is run
17
+ <li>A _data_ web-worker were HTTP and socket calls are run
18
+ <li>A _view_ web-worker that manages delta updates
19
+ </ol>
20
+ </div>
21
+
22
+ <div type="expander" caption="Extreme Speed">
23
+ <p>
24
+ The Neo.mjs web-worker proccesses are automatically run in parallel, on separate CPU cores.
25
+ </p>
26
+ <p>
27
+ By contrast, other JavaScript frameworks run in a single thread. That means
28
+ in a typical framework all business logic, data handling, and DOM rendering compete for
29
+ CPU reasources.
30
+ </p>
31
+ <p>
32
+ This means Neo.mjs applications run and render faster. This is
33
+ particularly beneficial for processor- and data-intensive applications,
34
+ and applications that need to rapidly update what's viewed. In testing, Neo.mjs applications
35
+ easily apply over 20,000 DOM updates per second.
36
+ </p>
37
+ <p>
38
+ If the default four threads aren't enough, you're free to launch additional web-worker threads
39
+ to run other specialized logic.
40
+ </p>
41
+ </div>
42
+
43
+ <div type="expander" caption="Quick Application Development">
44
+ <p>
45
+ Neo.js classes let you specify properties in a way that allows code to detect "before" and "after"
46
+ changes. This makes it easy to handle value validation and transformation, and react to changes.
47
+ </p>
48
+ <p>
49
+ Neo.mjs also has elegant yet powerful state management features that make it easy to create shared,
50
+ bindable data. For example, if two components are bound to the same propery, a change to the
51
+ property will automatically be applied to both components.
52
+ </p>
53
+ </div>
54
+
55
+ <div type="expander" caption="Multi-Window Applications">
56
+ <p>
57
+ Neo.mjs applications can also launch as _shared web workers_, which allows you to have a single
58
+ application run in multiple browser windows; those windows could be moved to multiple monitors.
59
+ </p>
60
+ <p>
61
+ For example, you can have a data analysis application with a control panel on one monitor,
62
+ tabular data in another, and charts on another &mdash; all sharing the same data, handling events
63
+ across windows, running seamlessly as a single application.
64
+ </p>
65
+ </div>
66
+
67
+ <div type="expander" caption="Open-Source and Standards-Based">
68
+ <p>
69
+ Neo.mjs is an open-source library. Features needed for the community can be added to the
70
+ library via pull-requests. And since Neo.mjs uses the standard JavaScript class system,
71
+ all Neo.mjs classes can be extended.
72
+ </p>
73
+ <p>
74
+ Neo.mjs uses standard modular JavaScript, so developers don't need to learn non-standard language
75
+ syntax, and there's no need for special pre-compilers or WebPack modules.
76
+ That means fewer dependencies and easier configuration. Furthermore, the use of
77
+ standard JavaScript makes debugging easier: any statement you write while developing your
78
+ applcation can also be run in the debugging console.
79
+ </p>
80
+ </div>
@@ -0,0 +1,57 @@
1
+ .learn-content {
2
+
3
+ font-size: 13pt;
4
+ letter-spacing: 1px;
5
+
6
+ em,
7
+ i {
8
+ font-family: Palatino, "Times New Roman", serif;
9
+ font-size: 1.07em;
10
+ }
11
+
12
+ p {
13
+ margin: 0em 0.5em .7em 0.5em;
14
+ }
15
+
16
+ padding: 0.5em;
17
+
18
+ overflow: scroll;
19
+
20
+ details summary {
21
+ cursor: pointer;
22
+ transition: margin 300ms ease-out;
23
+ }
24
+
25
+ details[open] {
26
+ margin-bottom: 2em;
27
+ }
28
+
29
+ details summary {
30
+ list-style: none;
31
+ color: #555;
32
+ display: flex;
33
+ /* also removes the list marker */
34
+ align-items: center;
35
+ font-weight: bold;
36
+ }
37
+
38
+ details summary::before {
39
+ content: "\f055";
40
+ }
41
+
42
+ details[open] summary::before {
43
+ content: "\f056";
44
+ }
45
+
46
+ details summary::before {
47
+ font-family: var(--fa-style-family, "Font Awesome 6 Free");
48
+ font-weight: var(--fa-style, 900);
49
+ font-size: 1.3em;
50
+ margin: .4em;
51
+ color: #c4c4c4;
52
+ }
53
+
54
+ summary::-webkit-details-marker {
55
+ display: none;
56
+ }
57
+ }
@@ -1,27 +1,27 @@
1
- .neo-floating {
2
- top : -10000px;
3
- left : -10000px;
4
- position : fixed;
5
- z-index : 1000;
6
- background-color : var(--neo-background-color);
7
- }
8
-
9
- // Shadow at the top
10
- .neo-aligned-top {
11
- box-shadow : 0px -2px 10px rgba(0, 0, 0, 0.3);
12
- }
13
-
14
1
  // Shadow at the bottom
15
2
  .neo-aligned-bottom {
16
- box-shadow : 0px 2px 10px rgba(0, 0, 0, 0.3);
3
+ box-shadow: var(--aligned-bottom-box-shadow);
17
4
  }
18
5
 
19
6
  // Shadow at the left
20
7
  .neo-aligned-left {
21
- box-shadow : -2px 0px 10px rgba(0, 0, 0, 0.3);
8
+ box-shadow: var(--aligned-left-box-shadow);
22
9
  }
23
10
 
24
11
  // Shadow at the right
25
12
  .neo-aligned-right {
26
- box-shadow : 2px 0px 10px rgba(0, 0, 0, 0.3);
13
+ box-shadow: var(--aligned-right-box-shadow);
14
+ }
15
+
16
+ // Shadow at the top
17
+ .neo-aligned-top {
18
+ box-shadow: var(--aligned-top-box-shadow);
19
+ }
20
+
21
+ .neo-floating {
22
+ background-color: var(--neo-background-color);
23
+ left : -10000px;
24
+ position : fixed;
25
+ top : -10000px;
26
+ z-index : 1000;
27
27
  }
@@ -0,0 +1,6 @@
1
+ :root .neo-theme-dark {
2
+ --aligned-bottom-box-shadow: 0px 2px 10px rgba(0, 0, 0, 0.3);
3
+ --aligned-left-box-shadow : -2px 0px 10px rgba(0, 0, 0, 0.3);
4
+ --aligned-right-box-shadow : 2px 0px 10px rgba(0, 0, 0, 0.3);
5
+ --aligned-top-box-shadow : 0px -2px 10px rgba(0, 0, 0, 0.3);
6
+ }
@@ -1,7 +1,6 @@
1
1
  :root .neo-theme-dark { // .neo-menu-list
2
2
  --menu-list-background-color : #3c3f41;
3
3
  --menu-list-border-color : #2b2b2b;
4
- --menu-list-box-shadow : 0 5px 10px rgba(0,0,0,.4);
5
4
  --menu-list-item-background-color : inherit;
6
5
  --menu-list-item-background-color-disabled: inherit;
7
6
  --menu-list-item-background-color-hover : inherit;
@@ -0,0 +1,6 @@
1
+ :root .neo-theme-light {
2
+ --aligned-bottom-box-shadow: 0px 2px 10px rgba(0, 0, 0, 0.3);
3
+ --aligned-left-box-shadow : -2px 0px 10px rgba(0, 0, 0, 0.3);
4
+ --aligned-right-box-shadow : 2px 0px 10px rgba(0, 0, 0, 0.3);
5
+ --aligned-top-box-shadow : 0px -2px 10px rgba(0, 0, 0, 0.3);
6
+ }
@@ -1,7 +1,6 @@
1
1
  :root .neo-theme-light { // .neo-menu-list
2
2
  --menu-list-background-color : #fff;
3
3
  --menu-list-border-color : #1c60a0;
4
- --menu-list-box-shadow : 0 5px 10px rgba(0,0,0,.4);
5
4
  --menu-list-item-background-color : inherit;
6
5
  --menu-list-item-background-color-disabled: inherit;
7
6
  --menu-list-item-background-color-hover : inherit;
@@ -236,12 +236,12 @@ const DefaultConfig = {
236
236
  useVdomWorker: true,
237
237
  /**
238
238
  * buildScripts/injectPackageVersion.mjs will update this value
239
- * @default '6.9.5'
239
+ * @default '6.9.7'
240
240
  * @memberOf! module:Neo
241
241
  * @name config.version
242
242
  * @type String
243
243
  */
244
- version: '6.9.5'
244
+ version: '6.9.7'
245
245
  };
246
246
 
247
247
  Object.assign(DefaultConfig, {
@@ -27,6 +27,12 @@ class TextArea extends Text {
27
27
  * @protected
28
28
  */
29
29
  ntype: 'textarea',
30
+ /**
31
+ * Set this to `true` to have the text area grow and shrink to accommodate
32
+ * any height of text. Bounds can be set using the `minHeight` and `maxHeight` settings.
33
+ * @member {Boolean} autoGrow=false
34
+ */
35
+ autoGrow : false,
30
36
  /**
31
37
  * @member {String[]} baseCls=['neo-textarea','neo-textfield']
32
38
  */
@@ -88,6 +94,17 @@ class TextArea extends Text {
88
94
  this.changeInputElKey('tag', value);
89
95
  }
90
96
 
97
+ /**
98
+ * Triggered after the mounted config got changed
99
+ * @param {Boolean} value
100
+ * @param {Boolean} oldValue
101
+ * @protected
102
+ */
103
+ afterSetMounted(value, oldValue) {
104
+ super.afterSetMounted(value, oldValue);
105
+ this.syncAutoGrowHeight();
106
+ }
107
+
91
108
  /**
92
109
  * Triggered after the resizable config got changed
93
110
  * @param {Boolean} value
@@ -126,6 +143,7 @@ class TextArea extends Text {
126
143
  }
127
144
 
128
145
  super.afterSetValue(value, oldValue);
146
+ this.syncAutoGrowHeight();
129
147
  }
130
148
 
131
149
  /**
@@ -148,6 +166,40 @@ class TextArea extends Text {
148
166
  beforeSetWrap(value, oldValue) {
149
167
  return this.beforeSetEnumValue(value, oldValue, 'wrap', 'wrapValues');
150
168
  }
169
+
170
+ /**
171
+ * @param {Object} data
172
+ * @protected
173
+ */
174
+ onInputValueChange(data) {
175
+ this.syncAutoGrowHeight();
176
+ super.onInputValueChange(data);
177
+ }
178
+
179
+ /**
180
+ * @protected
181
+ */
182
+ async syncAutoGrowHeight() {
183
+ let me = this;
184
+
185
+ if (me.mounted && me.autoGrow) {
186
+ const
187
+ inputEl = me.getInputEl(),
188
+ dims = await Neo.main.DomAccess.getScrollingDimensions({
189
+ appName : me.appName,
190
+ id : me.getInputElId()
191
+ });
192
+
193
+ // We must not show the scrollbar when autoGrowing
194
+ inputEl.style.overflowY = 'hidden';
195
+
196
+ if (dims.scrollHeight > dims.clientHeight - 5) {
197
+ inputEl.height = dims.scrollHeight;
198
+ }
199
+
200
+ me.update();
201
+ }
202
+ }
151
203
  }
152
204
 
153
205
  Neo.applyClassConfig(TextArea);
@@ -100,6 +100,7 @@ class DomAccess extends Base {
100
100
  'focus',
101
101
  'getAttributes',
102
102
  'getBoundingClientRect',
103
+ 'getScrollingDimensions',
103
104
  'measure',
104
105
  'scrollBy',
105
106
  'scrollIntoView',
@@ -459,6 +460,28 @@ class DomAccess extends Base {
459
460
  return nodeId.nodeType ? nodeId : (nodeId === 'body' || nodeId === 'document.body') ? document.body : this.getElement(nodeId);
460
461
  }
461
462
 
463
+ /**
464
+ * @param {HTMLElement|Object} data
465
+ * @param {String|String[]} data.id
466
+ * @returns {Object}
467
+ */
468
+ getScrollingDimensions(data) {
469
+ const me = this;
470
+
471
+ if (Array.isArray(data.id)) {
472
+ return data.id.map(id => me.getScrollingDimensions({ id }));
473
+ } else {
474
+ const node = data.nodeType ? data : me.getElementOrBody(data.id);
475
+
476
+ return {
477
+ clientWidth : node?.clientWidth,
478
+ clientHeight: node?.clientHeight,
479
+ scrollWidth : node?.scrollWidth,
480
+ scrollHeight: node?.scrollHeight
481
+ };
482
+ }
483
+ }
484
+
462
485
  /**
463
486
  * @param {HTMLElement} el
464
487
  * @returns {Boolean}