neo.mjs 6.10.1 → 6.10.3

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 (33) hide show
  1. package/apps/ServiceWorker.mjs +2 -2
  2. package/apps/learnneo/view/home/HeaderToolbar.mjs +47 -0
  3. package/apps/learnneo/view/home/MainContainer.mjs +32 -25
  4. package/apps/newwebsite/app.mjs +2 -2
  5. package/apps/newwebsite/view/{MainContainer.mjs → Viewport.mjs} +11 -11
  6. package/buildScripts/convertDesignTokens.mjs +1 -1
  7. package/examples/ServiceWorker.mjs +2 -2
  8. package/examples/tab/container/neo-config.json +1 -1
  9. package/package.json +3 -3
  10. package/resources/data/deck/learnneo/p/2023-10-14T19-25-08-153Z.md +18 -21
  11. package/resources/data/deck/learnneo/p/MainThreadAddonIntro.md +2 -2
  12. package/resources/data/deck/learnneo/t.json +3 -3
  13. package/resources/design-tokens/json/component.json +43 -7
  14. package/resources/design-tokens/json/core.json +45 -24
  15. package/resources/design-tokens/json/semantic.json +31 -1
  16. package/resources/scss/src/apps/learnneo/Viewport.scss +3 -3
  17. package/resources/scss/src/apps/learnneo/home/HeaderToolbar.scss +24 -0
  18. package/resources/scss/src/apps/learnneo/home/MainContainer.scss +7 -0
  19. package/resources/scss/src/apps/newwebsite/{MainContainer.scss → Viewport.scss} +1 -1
  20. package/resources/scss/src/component/Base.scss +26 -0
  21. package/resources/scss/theme-neo-light/design-tokens/Component.scss +12 -7
  22. package/resources/scss/theme-neo-light/design-tokens/Core.scss +67 -66
  23. package/resources/scss/theme-neo-light/design-tokens/Semantic.scss +11 -8
  24. package/resources/scss/theme-neo-light/tab/Strip.scss +3 -3
  25. package/resources/scss/theme-neo-light/tab/header/Button.scss +24 -13
  26. package/src/DefaultConfig.mjs +2 -2
  27. package/src/calendar/view/week/Component.mjs +64 -64
  28. package/src/component/Base.mjs +58 -14
  29. package/src/util/Array.mjs +2 -12
  30. package/src/worker/App.mjs +8 -2
  31. package/test/components/files/button/Base.mjs +41 -14
  32. package/test/components/files/form/field/Select.mjs +21 -29
  33. package/test/components/siesta.js +32 -2
@@ -1,17 +1,44 @@
1
1
  StartTest(t => {
2
- t.it('Checking if neo.mjs got started', async t => {
3
- if (!globalThis.Neo?.Main) {
4
- console.log('Starting the neo.mjs workers setup');
5
-
6
- await import('../../../../src/MicroLoader.mjs');
7
- }
8
-
9
- setTimeout(() => {
10
- Neo.worker.App.createNeoInstance({
11
- ntype : 'button',
12
- iconCls: 'fa fa-home',
13
- text : 'Hello Siesta'
14
- })
15
- }, 300)
2
+ let button;
3
+
4
+ t.beforeEach(async t => {
5
+ button && await Neo.worker.App.destroyNeoInstance(button);
6
+ });
7
+
8
+ t.it('Sanity', async t => {
9
+ button = await Neo.worker.App.createNeoInstance({
10
+ ntype : 'button',
11
+ iconCls: 'fa fa-home',
12
+ text : 'Hello Siesta'
13
+ });
14
+ });
15
+
16
+ t.it('Should show isLoading UI', async t => {
17
+ button = await Neo.worker.App.createNeoInstance({
18
+ ntype : 'button',
19
+ iconCls : 'fa fa-home',
20
+ text : 'Hello Siesta',
21
+ isLoading : 'Loading...'
22
+ });
23
+
24
+ // Spinner and text exist
25
+ await t.waitForSelector('button .fa-spinner.fa-spin');
26
+ t.selectorExists('button .neo-loading-message:contains(Loading...)');
27
+
28
+ await Neo.worker.App.setConfigs({ id: button, isLoading : true });
29
+
30
+ // Just a spinner now, no text
31
+ await t.waitForSelectorNotFound('button .neo-loading-message:contains(Loading...)');
32
+ t.selectorExists('button .fa-spinner');
33
+
34
+ await Neo.worker.App.setConfigs({ id: button, isLoading : 'New loading message' });
35
+
36
+ await t.waitForSelector('button .neo-loading-message:contains(New loading message)');
37
+ t.selectorExists('button .fa-spinner.fa-spin');
38
+
39
+ await Neo.worker.App.setConfigs({ id: button, isLoading : false });
40
+
41
+ // Not loading now
42
+ await t.waitForSelectorNotFound('button .fa-spinner');
16
43
  });
17
44
  });
@@ -1,35 +1,27 @@
1
1
  StartTest(t => {
2
- t.it('Checking if neo.mjs got started', async t => {
3
- if (!globalThis.Neo?.Main) {
4
- console.log('Starting the neo.mjs workers setup');
2
+ t.it('Sanity', async t => {
3
+ Neo.worker.App.createNeoInstance({
4
+ ntype : 'selectfield',
5
+ labelPosition: 'inline',
6
+ labelText : 'US States',
7
+ labelWidth : 80,
8
+ width : 300,
5
9
 
6
- await import('../../../../../src/MicroLoader.mjs');
7
- }
10
+ store : {
11
+ autoLoad : true,
12
+ keyProperty: 'abbreviation',
13
+ url : '../../resources/examples/data/us_states.json',
8
14
 
9
- setTimeout(() => {
10
- Neo.worker.App.createNeoInstance({
11
- ntype : 'selectfield',
12
- labelPosition: 'inline',
13
- labelText : 'US States',
14
- labelWidth : 80,
15
- width : 300,
16
-
17
- store : {
18
- autoLoad : true,
19
- keyProperty: 'abbreviation',
20
- url : '../../resources/examples/data/us_states.json',
21
-
22
- model: {
23
- fields: [{
24
- name: 'abbreviation',
25
- type: 'string'
26
- }, {
27
- name: 'name',
28
- type: 'string'
29
- }]
30
- }
15
+ model: {
16
+ fields: [{
17
+ name: 'abbreviation',
18
+ type: 'string'
19
+ }, {
20
+ name: 'name',
21
+ type: 'string'
22
+ }]
31
23
  }
32
- })
33
- }, 1000)
24
+ }
25
+ });
34
26
  });
35
27
  });
@@ -1,8 +1,38 @@
1
1
  const project = new Siesta.Project.Browser();
2
2
 
3
3
  project.configure({
4
- title : 'Neo Component Tests',
5
- isEcmaModule: true
4
+ title : 'Neo Component Tests',
5
+ isEcmaModule : true,
6
+ preload : [{
7
+ type : 'js',
8
+ url : '../../src/MicroLoader.mjs',
9
+ isEcmaModule : true
10
+ }],
11
+ testClass : Class('My.Test.Class', {
12
+ isa : Siesta.Test.Browser,
13
+ override : {
14
+ setup(callback, errback) {
15
+ this.SUPER(function() {
16
+ // We need to call the startup callback only when we know we are
17
+ // ready to start testing.
18
+ const
19
+ { global } = this,
20
+ startupTimer = setInterval(() => {
21
+ if (global.Neo?.worker?.App && global.Neo.worker.Manager && global.Neo.Main) {
22
+ clearInterval(startupTimer);
23
+
24
+ // TODO: Find what we actually need to wait for
25
+ setTimeout(callback, 300);
26
+ }
27
+ }, 100);
28
+ }, errback);
29
+ },
30
+ async beforeEach() {
31
+ this.SUPER(...arguments);
32
+ this.SUPER(t => t.waitFor(50));
33
+ }
34
+ }
35
+ })
6
36
  });
7
37
 
8
38
  project.plan(