jsgui3-server 0.0.96 → 0.0.98

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 (40) hide show
  1. package/controls/Active_HTML_Document.js +90 -0
  2. package/examples/box/box.css +8 -0
  3. package/examples/box/out_square_box_client.js +48 -0
  4. package/examples/box/square_box.js +52 -1
  5. package/examples/box/square_box_client.js +41 -4
  6. package/package.json +11 -8
  7. package/publishers/http-js-publisher.js +136 -0
  8. package/{publishing → publishers}/http-publisher.js +4 -2
  9. package/{publishing → publishers}/http-webpage-publisher.js +16 -0
  10. package/{publishing → publishers}/http-website-publisher.js +245 -8
  11. package/{publishing → publishers}/notes.md +3 -0
  12. package/resources/_old_website-javascript-resource.js +995 -0
  13. package/resources/process-js.js +5 -0
  14. package/{bundler → resources/processors/bundlers}/bundle.js +11 -0
  15. package/resources/processors/bundlers/bundler.js +24 -0
  16. package/{bundler → resources/processors/bundlers}/css-bundler.js +3 -3
  17. package/{bundler → resources/processors/bundlers}/js-bundler.js +28 -0
  18. package/{bundler → resources/processors/bundlers}/webpage-bundler.js +71 -1
  19. package/resources/website-audio-resource.js +3 -0
  20. package/resources/website-javascript-resource-processor.js +909 -0
  21. package/resources/website-javascript-resource.js +138 -162
  22. package/resources/website-resource-processor.js +11 -0
  23. package/resources/website-resource.js +5 -3
  24. package/roadmap.md +6 -0
  25. package/server.js +119 -14
  26. package/website/webpage.js +36 -1
  27. package/website/website.js +9 -1
  28. package/bundler/bundler.js +0 -9
  29. package/publishing/http-js-publisher.js +0 -25
  30. /package/{publishing → publishers}/http-css-publisher.js +0 -0
  31. /package/{publishing → publishers}/http-function-publisher.js +0 -0
  32. /package/{publishing → publishers}/http-html-page-publisher.js +0 -0
  33. /package/{publishing → publishers}/http-html-publisher.js +0 -0
  34. /package/{publishing → publishers}/http-jpeg-publisher.js +0 -0
  35. /package/{publishing → publishers}/http-observable-publisher.js +0 -0
  36. /package/{publishing → publishers}/http-png-publisher.js +0 -0
  37. /package/{publishing → publishers}/http-resource-publisher.js +0 -0
  38. /package/{publishing → publishers}/http-svg-publisher.js +0 -0
  39. /package/{bundler → resources/processors/bundlers}/test_ast.js +0 -0
  40. /package/{bundler → resources/processors/bundlers}/website-bundler.js +0 -0
@@ -0,0 +1,90 @@
1
+ const jsgui = require('jsgui3-html');
2
+
3
+ const {Blank_HTML_Document} = jsgui;
4
+
5
+ // Want to make this as automatic and low-cost as possible to use.
6
+
7
+ // Also need to get the building of client code working properly.
8
+ // When starting the server...?
9
+ // Want really easy and simple top-level syntax.
10
+
11
+
12
+ class Active_HTML_Document extends Blank_HTML_Document {
13
+
14
+
15
+
16
+ constructor(spec = {}) {
17
+ //console.log('Client_HTML_Document');
18
+ super(spec);
19
+ //spec.context.ctrl_document = this;
20
+ this.active();
21
+ }
22
+
23
+ // Seems a bit like 'view features'.
24
+
25
+ 'include_js'(url) {
26
+ /*
27
+ Add it to the end of the body instead.
28
+ */
29
+ //var head = this.get('head');
30
+ const body = this.get('body');
31
+ var script = new jsgui.script({
32
+ //<script type="text/JavaScript" src="abc.js"></script>
33
+ 'context': this.context
34
+ });
35
+ var dom = script.dom;
36
+ var domAttributes = dom.attributes;
37
+ domAttributes.type = 'text/javascript';
38
+ domAttributes.src = url;
39
+ body.add(script);
40
+ }
41
+
42
+ 'include_css'(url) {
43
+ var head = this.get('head');
44
+ var link = new jsgui.link({
45
+ //<script type="text/JavaScript" src="abc.js"></script>
46
+ 'context': this.context
47
+ })
48
+ // <script data-main="scripts/main" src="scripts/require.js"></script>
49
+ var dom = link.dom;
50
+ var domAttributes = dom.attributes;
51
+ domAttributes['rel'] = 'stylesheet';
52
+ domAttributes['type'] = 'text/css';
53
+ //domAttributes.set('src', '/js/require.js');
54
+ domAttributes['href'] = url;
55
+ head.content.add(link);
56
+ }
57
+
58
+ 'include_jsgui_client'(js_file_require_data_main) {
59
+ js_file_require_data_main = js_file_require_data_main || '/js/web/jsgui-html-client';
60
+ var head = this.head;
61
+ var body = this.body;
62
+ var script = new jsgui.script({
63
+ //<script type="text/JavaScript" src="abc.js"></script>
64
+ 'context': this.context
65
+ })
66
+ var domAttributes = script.dom.attributes;
67
+ domAttributes.set({
68
+ 'type': 'text/javascript',
69
+ 'src': '/js/web/require.js',
70
+ 'data-main': js_file_require_data_main
71
+ });
72
+ body.add(script);
73
+ }
74
+ 'include_client_css'() {
75
+ var head = this.get('head');
76
+ var link = new jsgui.link({
77
+ //<script type="text/JavaScript" src="abc.js"></script>
78
+ 'context': this.context
79
+ });
80
+ var domAttributes = link.dom.attributes;
81
+ domAttributes.rel = 'stylesheet';
82
+ domAttributes.type = 'text/css';
83
+ domAttributes.href = '/css/basic.css';
84
+ head.content.add(link);
85
+ // <link rel="stylesheet" type="text/css" href="theme.css">
86
+ }
87
+ // also need to include jsgui client css
88
+ }
89
+
90
+ module.exports = Active_HTML_Document;
@@ -0,0 +1,8 @@
1
+ .demo-ui {
2
+ display: flex;
3
+ flex-direction: column;
4
+ justify-content: center;
5
+ align-items: center;
6
+ text-align: center;
7
+ min-height: 100vh;
8
+ }