js_lis 1.0.9 → 1.0.11

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.
@@ -19,7 +19,13 @@ export class VirtualKeyboard {
19
19
  this.generateKey();
20
20
 
21
21
  this.render();
22
- this.initializeInputListeners();
22
+ this.initialize();
23
+ }
24
+
25
+ async initialize() {
26
+ await this.generateKey();
27
+ this.render();
28
+ this.initializeInputListeners();
23
29
  }
24
30
 
25
31
  async generateKey() {
package/main.js CHANGED
@@ -1,4 +1,10 @@
1
1
  import { VirtualKeyboard } from './VirtualKeyboard.js';
2
2
 
3
- // Create global instance
4
- window.keyboard = new VirtualKeyboard();
3
+ window.onload = () => {
4
+ try {
5
+ window.keyboard = new VirtualKeyboard();
6
+ console.log("VirtualKeyboard initialized successfully.");
7
+ } catch (error) {
8
+ console.error("Error initializing VirtualKeyboard:", error);
9
+ }
10
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "js_lis",
3
- "version": "1.0.9",
3
+ "version": "1.0.11",
4
4
  "main": "index.js",
5
5
  "scripts": {
6
6
  "test": "echo \"Error: no test specified\" && exit 1"