jsgui3-server 0.0.143 → 0.0.145

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 (67) hide show
  1. package/docs/comprehensive-documentation.md +25 -6
  2. package/docs/configuration-reference.md +46 -11
  3. package/docs/controls-development.md +54 -26
  4. package/docs/jsgui3-html-improvement-ideas.md +162 -0
  5. package/docs/jsgui3-html-improvement-ideas.svg +151 -0
  6. package/docs/troubleshooting.md +9 -8
  7. package/examples/controls/14d) window, canvas globe/EarthGlobeRenderer.js +19 -14
  8. package/examples/controls/14d) window, canvas globe/pipeline/TransformStage.js +5 -5
  9. package/examples/jsgui3-html/01) mvvm-counter/client.js +648 -0
  10. package/examples/jsgui3-html/01) mvvm-counter/server.js +21 -0
  11. package/examples/jsgui3-html/02) date-transform/client.js +764 -0
  12. package/examples/jsgui3-html/02) date-transform/server.js +21 -0
  13. package/examples/jsgui3-html/03) form-validation/client.js +1045 -0
  14. package/examples/jsgui3-html/03) form-validation/server.js +21 -0
  15. package/examples/jsgui3-html/04) data-grid/client.js +738 -0
  16. package/examples/jsgui3-html/04) data-grid/server.js +21 -0
  17. package/examples/jsgui3-html/05) master-detail/client.js +649 -0
  18. package/examples/jsgui3-html/05) master-detail/server.js +21 -0
  19. package/examples/jsgui3-html/06) theming/client.js +514 -0
  20. package/examples/jsgui3-html/06) theming/server.js +21 -0
  21. package/examples/jsgui3-html/07) mixins/client.js +465 -0
  22. package/examples/jsgui3-html/07) mixins/server.js +21 -0
  23. package/examples/jsgui3-html/08) router/client.js +372 -0
  24. package/examples/jsgui3-html/08) router/server.js +21 -0
  25. package/examples/jsgui3-html/09) resource-transform/client.js +692 -0
  26. package/examples/jsgui3-html/09) resource-transform/server.js +21 -0
  27. package/examples/jsgui3-html/10) binding-debugger/client.js +810 -0
  28. package/examples/jsgui3-html/10) binding-debugger/server.js +21 -0
  29. package/examples/jsgui3-html/README.md +48 -0
  30. package/http/responders/static/Static_Route_HTTP_Responder.js +25 -20
  31. package/lab/README.md +19 -0
  32. package/lab/experiments/window_examples_dom_audit.js +241 -0
  33. package/lab/results/window_examples_dom_audit.json +131 -0
  34. package/lab/results/window_examples_dom_audit.md +46 -0
  35. package/package.json +8 -3
  36. package/publishers/http-webpageorsite-publisher.js +8 -4
  37. package/resources/processors/bundlers/css-bundler.js +28 -173
  38. package/resources/processors/bundlers/js/esbuild/Advanced_JS_Bundler_Using_ESBuild.js +32 -20
  39. package/resources/processors/bundlers/style-bundler.js +288 -0
  40. package/resources/processors/compilers/SASS_Compiler.js +88 -0
  41. package/resources/processors/extractors/js/css_and_js/AST_Node/CSS_And_JS_From_JS_String_Using_AST_Node_Extractor.js +64 -68
  42. package/resources/website-css-resource.js +24 -20
  43. package/resources/website-javascript-resource-processor.js +17 -57
  44. package/resources/website-javascript-resource.js +17 -57
  45. package/serve-factory.js +38 -24
  46. package/server.js +116 -92
  47. package/tests/README.md +38 -3
  48. package/tests/bundlers.test.js +41 -32
  49. package/tests/content-analysis.test.js +19 -18
  50. package/tests/end-to-end.test.js +336 -365
  51. package/tests/error-handling.test.js +13 -11
  52. package/tests/examples-controls.e2e.test.js +13 -1
  53. package/tests/fixtures/end-to-end-client.js +54 -0
  54. package/tests/fixtures/jsgui3-html/binding_debugger_expectations.json +15 -0
  55. package/tests/fixtures/jsgui3-html/counter_expectations.json +31 -0
  56. package/tests/fixtures/jsgui3-html/data_grid_expectations.json +26 -0
  57. package/tests/fixtures/jsgui3-html/date_transform_expectations.json +26 -0
  58. package/tests/fixtures/jsgui3-html/form_validation_expectations.json +27 -0
  59. package/tests/fixtures/jsgui3-html/master_detail_expectations.json +15 -0
  60. package/tests/fixtures/jsgui3-html/mixins_expectations.json +10 -0
  61. package/tests/fixtures/jsgui3-html/resource_transform_expectations.json +11 -0
  62. package/tests/fixtures/jsgui3-html/router_expectations.json +10 -0
  63. package/tests/fixtures/jsgui3-html/theming_expectations.json +10 -0
  64. package/tests/jsgui3-html-examples.puppeteer.test.js +537 -0
  65. package/tests/sass-controls.e2e.test.js +327 -0
  66. package/tests/test-runner.js +4 -1
  67. package/tests/window-examples.puppeteer.test.js +455 -0
@@ -193,16 +193,18 @@ describe('Error Handling Tests', function() {
193
193
  const bundler = new Advanced_JS_Bundler_Using_ESBuild();
194
194
 
195
195
  // Create JS with malformed CSS
196
- const malformedCssContent = `
197
- const css = \`
198
- .test-class {
199
- color: red;
200
- /* Missing closing brace
201
- background: blue
202
- \`;
203
-
204
- console.log('test');
205
- `;
196
+ const malformedCssContent = `
197
+ class Test_Class {}
198
+
199
+ Test_Class.css = \`
200
+ .test-class {
201
+ color: red;
202
+ /* Missing closing brace
203
+ background: blue
204
+ \`;
205
+
206
+ console.log('test');
207
+ `;
206
208
 
207
209
  const malformedFile = path.join(__dirname, 'temp_malformed.js');
208
210
  await fs.writeFile(malformedFile, malformedCssContent);
@@ -743,4 +745,4 @@ describe('Error Handling Tests', function() {
743
745
  }
744
746
  });
745
747
  });
746
- });
748
+ });
@@ -27,7 +27,13 @@ const examples = [
27
27
  { dir_name: '8) window, checkbox/a)', ctrl_name: 'Demo_UI', expected_window_count: 1 },
28
28
  { dir_name: '9) window, date picker', ctrl_name: 'Demo_UI', expected_window_count: 1 },
29
29
  { dir_name: '12) window, Select_Options control', ctrl_name: 'Demo_UI', expected_window_count: 1 },
30
- { dir_name: '13) window, Dropdown_Menu control', ctrl_name: 'Demo_UI', expected_window_count: 1 }
30
+ { dir_name: '13) window, Dropdown_Menu control', ctrl_name: 'Demo_UI', expected_window_count: 1 },
31
+ {
32
+ dir_name: '14d) window, canvas globe',
33
+ ctrl_name: 'Demo_UI',
34
+ expected_window_count: 1,
35
+ expected_canvas_id: 'globeCanvas'
36
+ }
31
37
  ];
32
38
 
33
39
  function make_request(url, { headers = {} } = {}) {
@@ -141,6 +147,12 @@ describe('Examples/Controls E2E Regression Tests', function() {
141
147
  example.expected_window_count,
142
148
  `Expected ${example.expected_window_count} windows, got ${window_count}`
143
149
  );
150
+ if (example.expected_canvas_id) {
151
+ assert(
152
+ html_response.body.includes(`id="${example.expected_canvas_id}"`),
153
+ `Expected canvas id "${example.expected_canvas_id}" in HTML`
154
+ );
155
+ }
144
156
 
145
157
  const js_response = await make_request(`${base_url}/js/js.js`);
146
158
  assert.strictEqual(js_response.status_code, 200);
@@ -0,0 +1,54 @@
1
+ const jsgui = require('jsgui3-client');
2
+ const {controls} = jsgui;
3
+ const Active_HTML_Document = require('../../controls/Active_HTML_Document');
4
+
5
+ class Test_Control extends Active_HTML_Document {
6
+ constructor(spec = {}) {
7
+ spec.__type_name = spec.__type_name || 'test_control';
8
+ super(spec);
9
+ const {context} = this;
10
+ if (typeof this.body.add_class === 'function') {
11
+ this.body.add_class('test-control');
12
+ }
13
+ const compose = () => {
14
+ const container = new controls.div({context});
15
+ container.dom.attributes.id = 'test-control';
16
+ container.add_class('test-control');
17
+
18
+ const header = new jsgui.controls.h1({context});
19
+ header.add('Test Control');
20
+ const paragraph = new jsgui.controls.p({context});
21
+ paragraph.add('This is a test control with embedded CSS and JS.');
22
+ const button = new controls.Button({context, text: 'Test Button'});
23
+
24
+ container.add(header);
25
+ container.add(paragraph);
26
+ container.add(button);
27
+ this.body.add(container);
28
+ };
29
+
30
+ if (!spec.el) {
31
+ compose();
32
+ }
33
+ }
34
+ }
35
+
36
+ Test_Control.css = `
37
+ .test-control {
38
+ background-color: #f0f0f0;
39
+ padding: 20px;
40
+ border: 1px solid #ccc;
41
+ font-family: Arial, sans-serif;
42
+ }
43
+ .test-control h1 {
44
+ color: #333;
45
+ margin-bottom: 10px;
46
+ }
47
+ .test-control p {
48
+ color: #666;
49
+ line-height: 1.5;
50
+ }
51
+ `;
52
+
53
+ controls.Test_Control = Test_Control;
54
+ module.exports = jsgui;
@@ -0,0 +1,15 @@
1
+ {
2
+ "initial": {
3
+ "display_text": "Count: 2",
4
+ "status_text": "Signal status is steady.",
5
+ "summary_line": "Binders: 1 | Computed: 2 | Watchers: 2"
6
+ },
7
+ "after_increment": {
8
+ "display_text": "Count: 3",
9
+ "log_entry": "1. count 2 -> 3"
10
+ },
11
+ "after_enable": {
12
+ "debug_status": "Debugger active",
13
+ "log_entry": "2. debugger enabled"
14
+ }
15
+ }
@@ -0,0 +1,31 @@
1
+ {
2
+ "initial": {
3
+ "display_text": "Count: 0",
4
+ "status_text": "Status: negative or zero and even",
5
+ "display_classes": ["negative", "even"]
6
+ },
7
+ "after_increment": {
8
+ "display_text": "Count: 1",
9
+ "status_text": "Status: positive and odd",
10
+ "display_classes": ["positive", "odd"]
11
+ },
12
+ "after_second_increment": {
13
+ "display_text": "Count: 2",
14
+ "status_text": "Status: positive and even",
15
+ "display_classes": ["positive", "even"]
16
+ },
17
+ "after_step_increment": {
18
+ "display_text": "Count: 5",
19
+ "status_text": "Status: positive and odd",
20
+ "display_classes": ["positive", "odd"]
21
+ },
22
+ "after_reset": {
23
+ "display_text": "Count: 0",
24
+ "status_text": "Status: negative or zero and even",
25
+ "display_classes": ["negative", "even"]
26
+ },
27
+ "invalid_step": {
28
+ "step_error": "Step must be between 1 and 10.",
29
+ "disabled_class": "is-disabled"
30
+ }
31
+ }
@@ -0,0 +1,26 @@
1
+ {
2
+ "initial": {
3
+ "range_text": "Showing 1-4 of 10",
4
+ "page_text": "Page 1 of 3",
5
+ "first_name": "Ada Lovelace",
6
+ "row_count": 4
7
+ },
8
+ "search": {
9
+ "query": "engineer",
10
+ "range_text": "Showing 1-1 of 1",
11
+ "page_text": "Page 1 of 1",
12
+ "first_name": "Ada Lovelace",
13
+ "row_count": 1
14
+ },
15
+ "reset": {
16
+ "range_text": "Showing 1-4 of 10",
17
+ "page_text": "Page 1 of 3"
18
+ },
19
+ "sort_score": {
20
+ "first_name": "Mary Jackson"
21
+ },
22
+ "page_2": {
23
+ "page_text": "Page 2 of 3",
24
+ "first_name": "Katherine Johnson"
25
+ }
26
+ }
@@ -0,0 +1,26 @@
1
+ {
2
+ "default": {
3
+ "iso_value": "2024-06-15",
4
+ "local_display": "06/15/2024",
5
+ "format_text": "Format: MM/DD/YYYY",
6
+ "range_message": "Date is within range."
7
+ },
8
+ "locale_gb": {
9
+ "locale": "en-GB",
10
+ "format_text": "Format: DD/MM/YYYY",
11
+ "local_display": "15/06/2024",
12
+ "valid_input": "16/06/2024",
13
+ "iso_value": "2024-06-16",
14
+ "invalid_input": "99/99/2024",
15
+ "error": "Invalid date for format DD/MM/YYYY."
16
+ },
17
+ "locale_us": {
18
+ "locale": "en-US",
19
+ "format_text": "Format: MM/DD/YYYY",
20
+ "local_display": "06/16/2024"
21
+ },
22
+ "out_of_range": {
23
+ "iso_value": "2026-01-01",
24
+ "range_message": "Date must be between 01/01/2024 and 12/31/2024."
25
+ }
26
+ }
@@ -0,0 +1,27 @@
1
+ {
2
+ "initial": {
3
+ "full_name_error": "Full name is required.",
4
+ "email_error": "Email is required.",
5
+ "password_error": "Password is required.",
6
+ "confirm_password_error": "Confirm your password.",
7
+ "status_text": "Fix validation errors."
8
+ },
9
+ "invalid_email": {
10
+ "email": "bad@",
11
+ "error": "Email must be valid."
12
+ },
13
+ "valid": {
14
+ "full_name": "ada lovelace",
15
+ "display_name": "Ada Lovelace",
16
+ "email": "Ada@Example.com",
17
+ "email_preview": "ada@example.com",
18
+ "website": "https://example.com",
19
+ "password": "Secret123",
20
+ "confirm_password": "Secret123",
21
+ "status_text": "Ready to submit.",
22
+ "summary_text": "Profile: Ada Lovelace (ada@example.com)"
23
+ },
24
+ "submit": {
25
+ "feedback": "Submitted profile details."
26
+ }
27
+ }
@@ -0,0 +1,15 @@
1
+ {
2
+ "initial": {
3
+ "detail_title": "Aurora Vale",
4
+ "detail_role": "Role: Navigator",
5
+ "nav_text": "Item 1 of 4"
6
+ },
7
+ "after_next": {
8
+ "detail_title": "Beacon Lee",
9
+ "nav_text": "Item 2 of 4"
10
+ },
11
+ "last_item": {
12
+ "detail_title": "Delta Hart",
13
+ "nav_text": "Item 4 of 4"
14
+ }
15
+ }
@@ -0,0 +1,10 @@
1
+ {
2
+ "initial": {
3
+ "selected_title": "Selectable Card",
4
+ "selected_mixins_text": "Mixins: selectable"
5
+ },
6
+ "resizable": {
7
+ "selected_title": "Resizable Card",
8
+ "selected_mixins_text": "Mixins: resizable, selectable"
9
+ }
10
+ }
@@ -0,0 +1,11 @@
1
+ {
2
+ "initial": {
3
+ "status_text": "Idle: ready to transform.",
4
+ "summary_text": "No transform yet."
5
+ },
6
+ "after_run": {
7
+ "status_text": "Transform complete.",
8
+ "summary_text": "4 records | 62.25 total hours | Avg 15.6 hrs",
9
+ "first_line": "Compass - Katherine Johnson | 22.75h"
10
+ }
11
+ }
@@ -0,0 +1,10 @@
1
+ {
2
+ "initial": {
3
+ "route_title": "Overview",
4
+ "route_hint": "Hash route: #overview"
5
+ },
6
+ "metrics": {
7
+ "route_title": "Metrics",
8
+ "route_hint": "Hash route: #metrics"
9
+ }
10
+ }
@@ -0,0 +1,10 @@
1
+ {
2
+ "initial": {
3
+ "theme_label": "Copper Studio",
4
+ "accent_value": "#d05f3b"
5
+ },
6
+ "tide": {
7
+ "theme_label": "Tide Atlas",
8
+ "accent_value": "#2b6cb0"
9
+ }
10
+ }