chuijs 3.6.2 → 3.6.4

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 (119) hide show
  1. package/LICENSE +21 -21
  2. package/README.md +1203 -162
  3. package/framework/appLayout/default/chui_app_layout.js +747 -747
  4. package/framework/appLayout/default/global_style.css +592 -568
  5. package/framework/appLayout/default/main_theme_style.css +118 -101
  6. package/framework/components/chui_accordion/accordion.js +63 -63
  7. package/framework/components/chui_accordion/styles.css +79 -75
  8. package/framework/components/chui_badge/badge.js +55 -55
  9. package/framework/components/chui_badge/styles.css +29 -29
  10. package/framework/components/chui_button/button.js +48 -48
  11. package/framework/components/chui_button/styles.css +75 -70
  12. package/framework/components/chui_calendar/calendar.js +97 -97
  13. package/framework/components/chui_card/card.js +87 -0
  14. package/framework/components/chui_card/styles.css +72 -0
  15. package/framework/components/chui_code/code.js +18 -18
  16. package/framework/components/chui_code/styles.css +9 -9
  17. package/framework/components/chui_console/console.js +27 -27
  18. package/framework/components/chui_console/styles.css +31 -31
  19. package/framework/components/chui_content_block/content_block.js +51 -51
  20. package/framework/components/chui_content_block/styles.css +2 -2
  21. package/framework/components/chui_context_menu/context_menu.js +230 -0
  22. package/framework/components/chui_context_menu/styles.css +136 -0
  23. package/framework/components/chui_custom_element/custom_element.js +24 -24
  24. package/framework/components/chui_details/details.js +85 -85
  25. package/framework/components/chui_details/styles.css +70 -66
  26. package/framework/components/chui_fieldset/fieldset.js +40 -40
  27. package/framework/components/chui_fieldset/styles.css +24 -24
  28. package/framework/components/chui_form/form.js +40 -40
  29. package/framework/components/chui_form/styles.css +21 -21
  30. package/framework/components/chui_graphs/graphs.js +234 -190
  31. package/framework/components/chui_graphs/styles.css +37 -32
  32. package/framework/components/chui_hero/hero.js +98 -0
  33. package/framework/components/chui_hero/styles.css +91 -0
  34. package/framework/components/chui_html_block/html_block.js +16 -16
  35. package/framework/components/chui_html_block/styles.css +5 -5
  36. package/framework/components/chui_hx/hx.js +15 -15
  37. package/framework/components/chui_hx/styles.css +38 -38
  38. package/framework/components/chui_icons/icons.js +2144 -2144
  39. package/framework/components/chui_icons/styles.css +13 -13
  40. package/framework/components/chui_inputs/chui_check_box/check_box.js +32 -32
  41. package/framework/components/chui_inputs/chui_check_box/styles.css +91 -86
  42. package/framework/components/chui_inputs/chui_combo_box/combo_box.js +166 -150
  43. package/framework/components/chui_inputs/chui_combo_box/styles.css +113 -107
  44. package/framework/components/chui_inputs/chui_date/date.js +177 -174
  45. package/framework/components/chui_inputs/chui_date/styles.css +163 -128
  46. package/framework/components/chui_inputs/chui_email/email.js +61 -61
  47. package/framework/components/chui_inputs/chui_email/styles.css +69 -71
  48. package/framework/components/chui_inputs/chui_file/file.js +76 -76
  49. package/framework/components/chui_inputs/chui_file/styles.css +99 -99
  50. package/framework/components/chui_inputs/chui_multi_combo_box/multi_combo_box.js +295 -295
  51. package/framework/components/chui_inputs/chui_multi_combo_box/styles.css +212 -235
  52. package/framework/components/chui_inputs/chui_number/number.js +108 -108
  53. package/framework/components/chui_inputs/chui_number/styles.css +84 -84
  54. package/framework/components/chui_inputs/chui_password/password.js +99 -99
  55. package/framework/components/chui_inputs/chui_password/styles.css +97 -97
  56. package/framework/components/chui_inputs/chui_radio_button/radio_button.js +45 -45
  57. package/framework/components/chui_inputs/chui_radio_button/styles.css +76 -73
  58. package/framework/components/chui_inputs/chui_select_box/select_box.js +187 -170
  59. package/framework/components/chui_inputs/chui_select_box/styles.css +123 -117
  60. package/framework/components/chui_inputs/chui_text/styles.css +83 -84
  61. package/framework/components/chui_inputs/chui_text/text.js +91 -91
  62. package/framework/components/chui_inputs/chui_text_area/styles.css +57 -57
  63. package/framework/components/chui_inputs/chui_text_area/text_area.js +61 -61
  64. package/framework/components/chui_inputs/chui_toggle/styles.css +66 -61
  65. package/framework/components/chui_inputs/chui_toggle/toggle.js +36 -36
  66. package/framework/components/chui_label/label.js +54 -54
  67. package/framework/components/chui_label/styles.css +11 -11
  68. package/framework/components/chui_media/audio.js +908 -908
  69. package/framework/components/chui_media/audio_styles.css +458 -458
  70. package/framework/components/chui_media/image.js +105 -105
  71. package/framework/components/chui_media/image_styles.css +61 -61
  72. package/framework/components/chui_media/video.js +248 -248
  73. package/framework/components/chui_media/video_styles.css +160 -160
  74. package/framework/components/chui_menu_bar/menu_bar.js +66 -74
  75. package/framework/components/chui_menu_bar/styles.css +114 -76
  76. package/framework/components/chui_modal/modal.js +142 -135
  77. package/framework/components/chui_modal/styles.css +36 -36
  78. package/framework/components/chui_notification/notification.js +72 -72
  79. package/framework/components/chui_notification/notification_download.js +78 -78
  80. package/framework/components/chui_notification/notification_download_progress.css +119 -123
  81. package/framework/components/chui_notification/notification_download_progress.js +105 -105
  82. package/framework/components/chui_notification/notification_update.js +54 -54
  83. package/framework/components/chui_notification/styles.css +91 -91
  84. package/framework/components/chui_notification/styles_download.css +85 -85
  85. package/framework/components/chui_notification/styles_update.css +73 -73
  86. package/framework/components/chui_paragraph/paragraph.js +14 -14
  87. package/framework/components/chui_paragraph/styles.css +6 -6
  88. package/framework/components/chui_popups/popups.js +250 -250
  89. package/framework/components/chui_popups/styles.css +129 -115
  90. package/framework/components/chui_progress_bar/progress_bar.js +28 -28
  91. package/framework/components/chui_progress_bar/styles.css +28 -28
  92. package/framework/components/chui_radio_group/radio_group.js +57 -57
  93. package/framework/components/chui_radio_group/styles.css +3 -3
  94. package/framework/components/chui_slideshow/slideshow.js +75 -75
  95. package/framework/components/chui_slideshow/styles.css +94 -85
  96. package/framework/components/chui_spinner/spinner.js +45 -45
  97. package/framework/components/chui_spinner/styles.css +23 -23
  98. package/framework/components/chui_table/styles.css +42 -42
  99. package/framework/components/chui_table/table.js +234 -234
  100. package/framework/components/chui_tabs/chui_tabs.js +77 -77
  101. package/framework/components/chui_tabs/styles.css +54 -48
  102. package/framework/components/chui_text_editor/styles.css +217 -217
  103. package/framework/components/chui_text_editor/text_editor.js +144 -144
  104. package/framework/components/chui_text_editor/text_editor_panel.js +568 -568
  105. package/framework/components/chui_tree_view/styles.css +81 -75
  106. package/framework/components/chui_tree_view/tree_view.js +90 -90
  107. package/framework/components/chui_webview/styles.css +27 -27
  108. package/framework/components/chui_webview/webview.js +103 -103
  109. package/framework/components/telegram_bot/chui_telegram_bot.js +183 -183
  110. package/framework/modules/chui_animations/animations.js +121 -121
  111. package/framework/modules/chui_animations/styles.css +79 -79
  112. package/framework/modules/chui_fonts.js +7129 -6974
  113. package/framework/modules/chui_functions.js +106 -78
  114. package/framework/modules/chui_logger/chui_logger.js +53 -53
  115. package/framework/modules/chui_page/page.js +86 -86
  116. package/framework/modules/chui_page/styles.css +9 -9
  117. package/framework/tray_bar/chui_menu_items.js +48 -48
  118. package/index.js +570 -555
  119. package/package.json +51 -46
@@ -1,79 +1,107 @@
1
- const fs = require("fs")
2
-
3
- function sleep(ms) {
4
- return new Promise(resolve => setTimeout(resolve, ms));
5
- }
6
-
7
- function setStyles(pathToCSS = String(), component = String()) {
8
- let data = fs.readFileSync(pathToCSS, 'utf8');
9
- let style = document.createElement('style');
10
- style.innerHTML = String(data);
11
- style.type = 'text/css';
12
- style.setAttribute('id', component);
13
- if (document.getElementById(component) == null) document.head.appendChild(style);
14
- }
15
-
16
- function style_parse(json, component) {
17
- let stringz = JSON.parse(JSON.stringify(json));
18
- let style_string = [];
19
- for (let i = 0; i < stringz.length; i++) {
20
- style_string.push(`${stringz[i].name} {`)
21
- JSON.parse(JSON.stringify(stringz[i].style), function(key, value) {
22
- if (typeof value !== 'object') style_string.push(`${key}:${value};`)
23
- return value;
24
- });
25
- style_string.push(`}\n`)
26
- }
27
- let style = document.createElement('style');
28
- style.innerText = style_string.join("").slice(0, -1);
29
- style.type = 'text/css';
30
- style.setAttribute('id', component);
31
- if (document.getElementById(component) == null) document.head.appendChild(style);
32
- }
33
-
34
- const render = async (rendez) => {
35
- window.addEventListener('DOMContentLoaded', rendez)
36
- }
37
-
38
- function getDefaultIcon() {
39
- return require('path').join(__dirname, 'chui_icon.png');
40
- }
41
-
42
- function markdownToHtml(text = String()) {
43
- let showdown = require('showdown');
44
- return new showdown.Converter().makeHtml(text);
45
- }
46
-
47
- function htmlToMarkdown(text = String()) {
48
- let showdown = require('showdown');
49
- return new showdown.Converter().makeMarkdown(text);
50
- }
51
-
52
- function getDate() {
53
- let date = new Date();
54
- let day = ('0' + Number(date.getDate()).toString()).slice(-2);
55
- let month = ('0' + Number(date.getMonth() + 1).toString()).slice(-2);
56
- let year = date.getFullYear();
57
- let hours = ('0' + Number(date.getHours()).toString()).slice(-2);
58
- let minutes = ('0' + Number(date.getMinutes()).toString()).slice(-2);
59
- return `${day}.${month}.${year} ${hours}:${minutes}`;
60
- }
61
-
62
- function formatBytes(bytes, decimals = 2) {
63
- if (!+bytes) return '0 Bytes'
64
- const k = 1024
65
- const dm = decimals < 0 ? 0 : decimals
66
- const sizes = ['Bytes', 'KiB', 'MiB', 'GiB', 'TiB', 'PiB', 'EiB', 'ZiB', 'YiB']
67
- const i = Math.floor(Math.log(bytes) / Math.log(k))
68
- return `${parseFloat((bytes / Math.pow(k, i)).toFixed(dm))} ${sizes[i]}`
69
- }
70
-
71
- exports.getDate = getDate
72
- exports.sleep = sleep
73
- exports.style_parse = style_parse
74
- exports.render = render
75
- exports.markdownToHtml = markdownToHtml
76
- exports.htmlToMarkdown = htmlToMarkdown
77
- exports.getDefaultIcon = getDefaultIcon
78
- exports.setStyles = setStyles
1
+ const fs = require("fs")
2
+
3
+ function sleep(ms) {
4
+ return new Promise(resolve => setTimeout(resolve, ms));
5
+ }
6
+
7
+ function setStyles(pathToCSS = String(), component = String()) {
8
+ if (document.getElementById(component) != null) return;
9
+ let data = fs.readFileSync(pathToCSS, 'utf8');
10
+ let style = document.createElement('style');
11
+ style.innerHTML = String(data);
12
+ style.type = 'text/css';
13
+ style.setAttribute('id', component);
14
+ document.head.appendChild(style);
15
+ }
16
+
17
+ function style_parse(json, component) {
18
+ let stringz = JSON.parse(JSON.stringify(json));
19
+ let style_string = [];
20
+ for (let i = 0; i < stringz.length; i++) {
21
+ style_string.push(`${stringz[i].name} {`)
22
+ JSON.parse(JSON.stringify(stringz[i].style), function(key, value) {
23
+ if (typeof value !== 'object') style_string.push(`${key}:${value};`)
24
+ return value;
25
+ });
26
+ style_string.push(`}\n`)
27
+ }
28
+ let style = document.createElement('style');
29
+ style.innerText = style_string.join("").slice(0, -1);
30
+ style.type = 'text/css';
31
+ style.setAttribute('id', component);
32
+ if (document.getElementById(component) == null) document.head.appendChild(style);
33
+ }
34
+
35
+ const render = (rendez) => {
36
+ return new Promise((resolve, reject) => {
37
+ const run = () => {
38
+ try {
39
+ const result = rendez();
40
+ if (result instanceof Promise) result.then(resolve, reject);
41
+ else resolve(result);
42
+ } catch (e) {
43
+ reject(e);
44
+ }
45
+ };
46
+ if (document.readyState === 'loading') window.addEventListener('DOMContentLoaded', run, { once: true });
47
+ else run();
48
+ });
49
+ }
50
+
51
+ function getDefaultIcon() {
52
+ return require('path').join(__dirname, 'chui_icon.png');
53
+ }
54
+
55
+ const DROPDOWN_VIEWPORT_MARGIN = 8;
56
+
57
+ /**
58
+ * Проверяет, нужно ли открывать выпадающий список вверх.
59
+ * Список переворачивается, только если снизу места не хватает, а сверху его достаточно.
60
+ */
61
+ function shouldOpenDropdownUp(dropdown = new HTMLElement(), anchor = new HTMLElement()) {
62
+ const anchorRect = anchor.getBoundingClientRect();
63
+ const dropdownHeight = dropdown.offsetHeight;
64
+ const spaceBelow = window.innerHeight - anchorRect.bottom - DROPDOWN_VIEWPORT_MARGIN;
65
+ const spaceAbove = anchorRect.top - DROPDOWN_VIEWPORT_MARGIN;
66
+ return dropdownHeight > spaceBelow && dropdownHeight <= spaceAbove;
67
+ }
68
+
69
+ function markdownToHtml(text = String()) {
70
+ let showdown = require('showdown');
71
+ return new showdown.Converter().makeHtml(text);
72
+ }
73
+
74
+ function htmlToMarkdown(text = String()) {
75
+ let showdown = require('showdown');
76
+ return new showdown.Converter().makeMarkdown(text);
77
+ }
78
+
79
+ function getDate() {
80
+ let date = new Date();
81
+ let day = ('0' + Number(date.getDate()).toString()).slice(-2);
82
+ let month = ('0' + Number(date.getMonth() + 1).toString()).slice(-2);
83
+ let year = date.getFullYear();
84
+ let hours = ('0' + Number(date.getHours()).toString()).slice(-2);
85
+ let minutes = ('0' + Number(date.getMinutes()).toString()).slice(-2);
86
+ return `${day}.${month}.${year} ${hours}:${minutes}`;
87
+ }
88
+
89
+ function formatBytes(bytes, decimals = 2) {
90
+ if (!+bytes) return '0 Bytes'
91
+ const k = 1024
92
+ const dm = decimals < 0 ? 0 : decimals
93
+ const sizes = ['Bytes', 'KiB', 'MiB', 'GiB', 'TiB', 'PiB', 'EiB', 'ZiB', 'YiB']
94
+ const i = Math.floor(Math.log(bytes) / Math.log(k))
95
+ return `${parseFloat((bytes / Math.pow(k, i)).toFixed(dm))} ${sizes[i]}`
96
+ }
97
+
98
+ exports.getDate = getDate
99
+ exports.sleep = sleep
100
+ exports.style_parse = style_parse
101
+ exports.render = render
102
+ exports.markdownToHtml = markdownToHtml
103
+ exports.htmlToMarkdown = htmlToMarkdown
104
+ exports.getDefaultIcon = getDefaultIcon
105
+ exports.shouldOpenDropdownUp = shouldOpenDropdownUp
106
+ exports.setStyles = setStyles
79
107
  exports.formatBytes = formatBytes
@@ -1,54 +1,54 @@
1
- const path = require('path');
2
- const {app} = require("electron")
3
- const fs= require('fs');
4
-
5
- class Logger {
6
- constructor() { }
7
- #generatedMessage(message, type = String()) {
8
- let date = new Date().toLocaleString()
9
- if (process && process.type === 'renderer') {
10
- return `[${date}] [${type}] [render] > ${message}`
11
- } else {
12
- return `[${date}] [${type}] [main] > ${message}`
13
- }
14
- }
15
- info(message) {
16
- const type = "info"
17
- console.info(this.#generatedMessage(message, type))
18
- if (process && process.type === 'renderer') {
19
- require("electron").ipcRenderer.send("SEND_LOG_TEXT", this.#generatedMessage(message, type), type)
20
- } else {
21
- this.#writeLog(this.#generatedMessage(message, type))
22
- }
23
- }
24
- error(message) {
25
- const type = "error"
26
- console.error(this.#generatedMessage(message, type))
27
- if (process && process.type === 'renderer') {
28
- require("electron").ipcRenderer.send("SEND_LOG_TEXT", this.#generatedMessage(message, type), type)
29
- } else {
30
- this.#writeLog(this.#generatedMessage(message, type))
31
- }
32
- }
33
- #writeLog(text) {
34
- let today = new Date().toLocaleDateString().replace("/", ".")
35
- let log_dir_path = path.join(app.getPath("userData"), "logs")
36
- let log_file_path = path.join(log_dir_path, `app_${today}.log`)
37
-
38
- if (!fs.existsSync(log_dir_path)) {
39
- fs.mkdirSync(log_dir_path, { recursive: true });
40
- fs.writeFileSync(log_file_path, "", "utf-8");
41
- }
42
-
43
- fs.writeFile(log_file_path, `${text}\n`, { flag: 'a+' }, err => {
44
- if (err) console.error(err);
45
- });
46
- }
47
- }
48
-
49
- class Log {
50
- static info(message) { return new Logger().info(message) }
51
- static error(message) { return new Logger().error(message) }
52
- }
53
-
1
+ const path = require('path');
2
+ const {app} = require("electron")
3
+ const fs= require('fs');
4
+
5
+ class Logger {
6
+ constructor() { }
7
+ #generatedMessage(message, type = String()) {
8
+ let date = new Date().toLocaleString()
9
+ if (process && process.type === 'renderer') {
10
+ return `[${date}] [${type}] [render] > ${message}`
11
+ } else {
12
+ return `[${date}] [${type}] [main] > ${message}`
13
+ }
14
+ }
15
+ info(message) {
16
+ const type = "info"
17
+ console.info(this.#generatedMessage(message, type))
18
+ if (process && process.type === 'renderer') {
19
+ require("electron").ipcRenderer.send("SEND_LOG_TEXT", this.#generatedMessage(message, type), type)
20
+ } else {
21
+ this.#writeLog(this.#generatedMessage(message, type))
22
+ }
23
+ }
24
+ error(message) {
25
+ const type = "error"
26
+ console.error(this.#generatedMessage(message, type))
27
+ if (process && process.type === 'renderer') {
28
+ require("electron").ipcRenderer.send("SEND_LOG_TEXT", this.#generatedMessage(message, type), type)
29
+ } else {
30
+ this.#writeLog(this.#generatedMessage(message, type))
31
+ }
32
+ }
33
+ #writeLog(text) {
34
+ let today = new Date().toLocaleDateString().replace("/", ".")
35
+ let log_dir_path = path.join(app.getPath("userData"), "logs")
36
+ let log_file_path = path.join(log_dir_path, `app_${today}.log`)
37
+
38
+ if (!fs.existsSync(log_dir_path)) {
39
+ fs.mkdirSync(log_dir_path, { recursive: true });
40
+ fs.writeFileSync(log_file_path, "", "utf-8");
41
+ }
42
+
43
+ fs.writeFile(log_file_path, `${text}\n`, { flag: 'a+' }, err => {
44
+ if (err) console.error(err);
45
+ });
46
+ }
47
+ }
48
+
49
+ class Log {
50
+ static info(message) { return new Logger().info(message) }
51
+ static error(message) { return new Logger().error(message) }
52
+ }
53
+
54
54
  exports.Log = Log
@@ -1,87 +1,87 @@
1
- let {Animation} = require('../chui_animations/animations');
2
- const {Route} = require("../../appLayout/default/chui_app_layout");
3
- const {Button} = require("../../components/chui_button/button");
4
- const {Icon} = require("../../components/chui_icons/icons");
5
-
6
-
7
- class Page {
8
- #page = document.createElement('page');
9
- #title = undefined;
10
- #icon = undefined;
11
- #main = false;
12
- #menu_bar = undefined;
13
- constructor() {
14
- require('../chui_functions').setStyles(__dirname + "/styles.css", "chUiJS_Page")
15
- }
16
- setBackButton(options = { title: "", icon: undefined, reverse: false, page: undefined }) {
17
- let back = new Button({
18
- title: options.title, icon: options.icon, reverse: options.reverse,
19
- clickEvent: () => new Route().go(options.page)
20
- })
21
- this.#page.appendChild(back.set());
22
- }
23
- setMenuBar(menubar) {
24
- this.#menu_bar = menubar.set();
25
- }
26
- getMenuBar() {
27
- return this.#menu_bar;
28
- }
29
- addRouteEvent(self, event = () => {}) {
30
- let event_name = "route_event_"+self.constructor.name
31
- document.addEventListener(event_name, event)
32
- setTimeout(() => document.removeEventListener(event_name, event), 100)
33
- }
34
- add(...components) {
35
- for (let component of components) {
36
- new Animation(component.set()).fadeIn()
37
- this.#page.appendChild(component.set());
38
- }
39
- }
40
- remove(...components) {
41
- for (let component of components) {
42
- new Animation(component.set()).fadeOutAndRemove()
43
- }
44
- }
45
- setFullHeight() {
46
- this.#page.style.height = '-webkit-fill-available';
47
- }
48
- setFullWidth() {
49
- this.#page.style.width = '-webkit-fill-available';
50
- }
51
- disablePadding() {
52
- this.#page.style.padding = '0px';
53
- }
54
- setIcon(icon) {
55
- this.#icon = new Icon(icon, "13pt").getHTML();
56
- }
57
- setTitle(title) {
58
- this.#title = title;
59
- }
60
- setMain(boolean) {
61
- this.#main = boolean;
62
- }
63
- getIcon() {
64
- return this.#icon;
65
- }
66
- getTitle() {
67
- return this.#title;
68
- }
69
- getMain() {
70
- return this.#main;
71
- }
72
- getMediaStream(options = {
73
- video: false, // or { width: 1280, height: 720 }
74
- audio: false
75
- }) {
76
- return new Promise((resolve, reject) => {
77
- navigator.mediaDevices.getUserMedia(options).then(stream => {
78
- resolve(stream);
79
- }).catch(reject);
80
- })
81
- }
82
- render() {
83
- return this.#page;
84
- }
85
- }
86
-
1
+ let {Animation} = require('../chui_animations/animations');
2
+ const {Route} = require("../../appLayout/default/chui_app_layout");
3
+ const {Button} = require("../../components/chui_button/button");
4
+ const {Icon} = require("../../components/chui_icons/icons");
5
+
6
+
7
+ class Page {
8
+ #page = document.createElement('page');
9
+ #title = undefined;
10
+ #icon = undefined;
11
+ #main = false;
12
+ #menu_bar = undefined;
13
+ constructor() {
14
+ require('../chui_functions').setStyles(__dirname + "/styles.css", "chUiJS_Page")
15
+ }
16
+ setBackButton(options = { title: "", icon: undefined, reverse: false, page: undefined }) {
17
+ let back = new Button({
18
+ title: options.title, icon: options.icon, reverse: options.reverse,
19
+ clickEvent: () => new Route().go(options.page)
20
+ })
21
+ this.#page.appendChild(back.set());
22
+ }
23
+ setMenuBar(menubar) {
24
+ this.#menu_bar = menubar.set();
25
+ }
26
+ getMenuBar() {
27
+ return this.#menu_bar;
28
+ }
29
+ addRouteEvent(self, event = () => {}) {
30
+ let event_name = "route_event_"+self.constructor.name
31
+ document.addEventListener(event_name, event)
32
+ setTimeout(() => document.removeEventListener(event_name, event), 100)
33
+ }
34
+ add(...components) {
35
+ for (let component of components) {
36
+ new Animation(component.set()).fadeIn()
37
+ this.#page.appendChild(component.set());
38
+ }
39
+ }
40
+ remove(...components) {
41
+ for (let component of components) {
42
+ new Animation(component.set()).fadeOutAndRemove()
43
+ }
44
+ }
45
+ setFullHeight() {
46
+ this.#page.style.height = '-webkit-fill-available';
47
+ }
48
+ setFullWidth() {
49
+ this.#page.style.width = '-webkit-fill-available';
50
+ }
51
+ disablePadding() {
52
+ this.#page.style.padding = '0px';
53
+ }
54
+ setIcon(icon) {
55
+ this.#icon = new Icon(icon, "13pt").getHTML();
56
+ }
57
+ setTitle(title) {
58
+ this.#title = title;
59
+ }
60
+ setMain(boolean) {
61
+ this.#main = boolean;
62
+ }
63
+ getIcon() {
64
+ return this.#icon;
65
+ }
66
+ getTitle() {
67
+ return this.#title;
68
+ }
69
+ getMain() {
70
+ return this.#main;
71
+ }
72
+ getMediaStream(options = {
73
+ video: false, // or { width: 1280, height: 720 }
74
+ audio: false
75
+ }) {
76
+ return new Promise((resolve, reject) => {
77
+ navigator.mediaDevices.getUserMedia(options).then(stream => {
78
+ resolve(stream);
79
+ }).catch(reject);
80
+ })
81
+ }
82
+ render() {
83
+ return this.#page;
84
+ }
85
+ }
86
+
87
87
  exports.Page = Page
@@ -1,10 +1,10 @@
1
- page {
2
- padding: 6px;
3
- display: flex;
4
- flex-direction: column;
5
- width: -webkit-fill-available;
6
- align-items: baseline;
7
- }
8
- .header_padding {
9
- padding-top: 96px;
1
+ page {
2
+ padding: 6px;
3
+ display: flex;
4
+ flex-direction: column;
5
+ width: -webkit-fill-available;
6
+ align-items: baseline;
7
+ }
8
+ .header_padding {
9
+ padding-top: 96px;
10
10
  }
@@ -1,49 +1,49 @@
1
- class MenuItem {
2
- button(title = String(), action = () => {}) { return { label: title, click: action } }
3
- separator() { return { type: 'separator' } }
4
- submenu(title= String(), submenu_list = Array()) { return { label: title, submenu: submenu_list } }
5
- radio(title= String(), checked = Boolean(), action = () => {}) { return { label: title, type: 'radio', checked: checked, click: action } }
6
- checkbox(title= String(), checked = Boolean(), action = () => {}) { return { label: title, type: 'checkbox', checked: checked, click: action } }
7
- undo(title= String()) { return { label: title, role: 'undo' } }
8
- redo(title= String()) { return { label: title, role: 'redo' } }
9
- cut(title= String()) { return { label: title, role: 'cut' } }
10
- copy(title= String()) { return { label: title, role: 'copy' } }
11
- paste(title= String()) { return { label: title, role: 'paste' } }
12
- pasteAndMatchStyle(title) { return { label: title, role: 'pasteAndMatchStyle' } }
13
- delete(title= String()) { return { label: title, role: 'delete' } }
14
- selectAll(title= String()) { return { label: title, role: 'selectAll' } }
15
- reload(title= String()) { return { label: title, role: 'reload' } }
16
- forceReload(title= String()) { return { label: title, role: 'forceReload' } }
17
- quit(title= String()) { return { label: title, role: 'quit' } }
18
- resetZoom(title= String()) { return { label: title, role: 'resetZoom' } }
19
- zoomIn(title= String()) { return { label: title, role: 'zoomIn' } }
20
- zoomOut(title= String()) { return { label: title, role: 'zoomOut' } }
21
- toggleFullScreen(title= String()) { return { label: title, role: 'togglefullscreen' } }
22
- window(title= String()) { return { label: title, role: 'window' } }
23
- minimize(title= String()) { return { label: title, role: 'minimize' } }
24
- close(title= String()) { return { label: title, role: 'close' } }
25
- help(title= String()) { return { label: title, role: 'help' } }
26
- about(title= String()) { return { label: title, role: 'about' } }
27
- services(title= String()) { return { label: title, role: 'services' } }
28
- hide(title= String()) { return { label: title, role: 'hide' } }
29
- hideOthers(title= String()) { return { label: title, role: 'hideOthers' } }
30
- unhide(title= String()) { return { label: title, role: 'unhide' } }
31
- startSpeaking(title= String()) { return { label: title, role: 'startSpeaking' } }
32
- stopSpeaking(title= String()) { return { label: title, role: 'stopSpeaking' } }
33
- zoom(title= String()) { return { label: title, role: 'zoom' } }
34
- front(title= String()) { return { label: title, role: 'front' } }
35
- appMenu(title= String()) { return { label: title, role: 'appMenu' } }
36
- fileMenu(title= String()) { return { label: title, role: 'fileMenu' } }
37
- editMenu(title= String()) { return { label: title, role: 'editMenu' } }
38
- viewMenu(title= String()) { return { label: title, role: 'viewMenu' } }
39
- recentDocuments(title= String()) { return { label: title, role: 'recentDocuments' } }
40
- toggleTabBar(title= String()) { return { label: title, role: 'toggleTabBar' } }
41
- selectNextTab(title= String()) { return { label: title, role: 'selectNextTab' } }
42
- selectPreviousTab(title= String()) { return { label: title, role: 'selectPreviousTab' } }
43
- mergeAllWindows(title= String()) { return { label: title, role: 'mergeAllWindows' } }
44
- clearRecentDocuments(title= String()) { return { label: title, role: 'clearRecentDocuments' } }
45
- moveTabToNewWindow(title= String()) { return { label: title, role: 'moveTabToNewWindow' } }
46
- windowMenu(title= String()) { return { label: title, role: 'windowMenu' } }
47
- }
48
-
1
+ class MenuItem {
2
+ button(title = String(), action = () => {}) { return { label: title, click: action } }
3
+ separator() { return { type: 'separator' } }
4
+ submenu(title= String(), submenu_list = Array()) { return { label: title, submenu: submenu_list } }
5
+ radio(title= String(), checked = Boolean(), action = () => {}) { return { label: title, type: 'radio', checked: checked, click: action } }
6
+ checkbox(title= String(), checked = Boolean(), action = () => {}) { return { label: title, type: 'checkbox', checked: checked, click: action } }
7
+ undo(title= String()) { return { label: title, role: 'undo' } }
8
+ redo(title= String()) { return { label: title, role: 'redo' } }
9
+ cut(title= String()) { return { label: title, role: 'cut' } }
10
+ copy(title= String()) { return { label: title, role: 'copy' } }
11
+ paste(title= String()) { return { label: title, role: 'paste' } }
12
+ pasteAndMatchStyle(title) { return { label: title, role: 'pasteAndMatchStyle' } }
13
+ delete(title= String()) { return { label: title, role: 'delete' } }
14
+ selectAll(title= String()) { return { label: title, role: 'selectAll' } }
15
+ reload(title= String()) { return { label: title, role: 'reload' } }
16
+ forceReload(title= String()) { return { label: title, role: 'forceReload' } }
17
+ quit(title= String()) { return { label: title, role: 'quit' } }
18
+ resetZoom(title= String()) { return { label: title, role: 'resetZoom' } }
19
+ zoomIn(title= String()) { return { label: title, role: 'zoomIn' } }
20
+ zoomOut(title= String()) { return { label: title, role: 'zoomOut' } }
21
+ toggleFullScreen(title= String()) { return { label: title, role: 'togglefullscreen' } }
22
+ window(title= String()) { return { label: title, role: 'window' } }
23
+ minimize(title= String()) { return { label: title, role: 'minimize' } }
24
+ close(title= String()) { return { label: title, role: 'close' } }
25
+ help(title= String()) { return { label: title, role: 'help' } }
26
+ about(title= String()) { return { label: title, role: 'about' } }
27
+ services(title= String()) { return { label: title, role: 'services' } }
28
+ hide(title= String()) { return { label: title, role: 'hide' } }
29
+ hideOthers(title= String()) { return { label: title, role: 'hideOthers' } }
30
+ unhide(title= String()) { return { label: title, role: 'unhide' } }
31
+ startSpeaking(title= String()) { return { label: title, role: 'startSpeaking' } }
32
+ stopSpeaking(title= String()) { return { label: title, role: 'stopSpeaking' } }
33
+ zoom(title= String()) { return { label: title, role: 'zoom' } }
34
+ front(title= String()) { return { label: title, role: 'front' } }
35
+ appMenu(title= String()) { return { label: title, role: 'appMenu' } }
36
+ fileMenu(title= String()) { return { label: title, role: 'fileMenu' } }
37
+ editMenu(title= String()) { return { label: title, role: 'editMenu' } }
38
+ viewMenu(title= String()) { return { label: title, role: 'viewMenu' } }
39
+ recentDocuments(title= String()) { return { label: title, role: 'recentDocuments' } }
40
+ toggleTabBar(title= String()) { return { label: title, role: 'toggleTabBar' } }
41
+ selectNextTab(title= String()) { return { label: title, role: 'selectNextTab' } }
42
+ selectPreviousTab(title= String()) { return { label: title, role: 'selectPreviousTab' } }
43
+ mergeAllWindows(title= String()) { return { label: title, role: 'mergeAllWindows' } }
44
+ clearRecentDocuments(title= String()) { return { label: title, role: 'clearRecentDocuments' } }
45
+ moveTabToNewWindow(title= String()) { return { label: title, role: 'moveTabToNewWindow' } }
46
+ windowMenu(title= String()) { return { label: title, role: 'windowMenu' } }
47
+ }
48
+
49
49
  exports.MenuItem = MenuItem