Comparing version 0.0.0 to 0.0.1
121
index.js
@@ -1,120 +0,1 @@ | ||
const libui = require('./build/Release/libui'); | ||
libui.init(); | ||
const menu = new libui.Menu('File', [ | ||
{ | ||
label: 'Open', | ||
type: 'item', | ||
onClick: () => { | ||
const filepath = window.openFile(); | ||
if (!filepath) { | ||
window.msgBox('No file selected', "Don't be alarmed"); | ||
return; | ||
} | ||
window.msgBox('File selected', filepath); | ||
} | ||
}, | ||
{ | ||
label: 'Save', | ||
type: 'item', | ||
onClick: () => { | ||
const filepath = window.saveFile(); | ||
if (!filepath) { | ||
window.msgBox('No file selected', "Don't be alarmed"); | ||
return; | ||
} | ||
window.msgBox('File selected', filepath); | ||
}, | ||
}, | ||
{ | ||
type: 'about', | ||
onClick: () => { | ||
console.log('about'); | ||
}, | ||
}, | ||
{ | ||
type: 'check', | ||
label: 'Check this', | ||
onClick: () => { | ||
console.log('check'); | ||
}, | ||
}, | ||
{ | ||
type: 'preferences', | ||
onClick: () => { | ||
console.log('preferences'); | ||
}, | ||
}, | ||
]); // has to come before window | ||
const window = new libui.Window({ | ||
title: 'Cool', | ||
width: 700, | ||
height: 700, | ||
hasMenu: true, | ||
margined: false, | ||
onClosing: (err) => { | ||
console.log('exited') | ||
}, | ||
}); | ||
libui.render(); | ||
/* | ||
<Window> | ||
<View> | ||
<Group title="Controls"> | ||
<Button onClick>Button</Button> | ||
<CheckBox onToggle>CheckBox</CheckBox> | ||
<TextInput onChange /> | ||
<Text>Text</Text> | ||
<HorizontalSeparator /> | ||
<DatePicker /> | ||
<TimePicker /> | ||
<DateTimePicker /> | ||
<FontButton /> | ||
<ColorButton /> | ||
</Group> | ||
</View> | ||
<View> | ||
<Group title="Numbers"> | ||
<SpinBox min=0 max=100 /> | ||
<Slider min=0 max=100 /> | ||
<ProgressBar value=50 /> | ||
</Group> | ||
<Group title="Lists"> | ||
<ComboBox> | ||
<ComboBox.Item>1</ComboBox.Item> | ||
<ComboBox.Item>2</ComboBox.Item> | ||
<ComboBox.Item>3</ComboBox.Item> | ||
</ComboBox> | ||
<EditableComboBox> | ||
<ComboBox.Item>1</ComboBox.Item> | ||
<ComboBox.Item>2</ComboBox.Item> | ||
<ComboBox.Item>3</ComboBox.Item> | ||
</EditableComboBox> | ||
<RadioButtons> | ||
<RadioButtons.Button>1</RadioButtons.Button> | ||
<RadioButtons.Button>2</RadioButtons.Button> | ||
<RadioButtons.Button>3</RadioButtons.Button> | ||
</RadioButtons> | ||
<Tab> | ||
<Tab.Page title="Page 1"> | ||
<View> | ||
</View> | ||
</Tab.Page> | ||
<Tab.Page title="Page 2"> | ||
<View> | ||
</View> | ||
</Tab.Page> | ||
<Tab.Page title="Page 3"> | ||
<View> | ||
</View> | ||
</Tab.Page> | ||
</Tab> | ||
</Group> | ||
</View> | ||
</Window> | ||
*/ | ||
module.exports = require('./build/Release/libui'); |
{ | ||
"name": "libui", | ||
"version": "0.0.0", | ||
"version": "0.0.1", | ||
"description": "Node.js bindings for libui", | ||
"main": "hello.js", | ||
"main": "index.js", | ||
"keywords": [ | ||
"libui", | ||
"desktop", | ||
"GUI" | ||
], | ||
"repository": { | ||
"type": "git", | ||
"url": "git://github.com/mavenave/libui.js.git" | ||
}, | ||
"license": "MIT", | ||
"author": { | ||
"name": "Chan Guan Hao", | ||
"email": "guanhao3797@gmail.com", | ||
"url": "http://mavenave.me" | ||
}, | ||
"gypfile": true, | ||
@@ -11,5 +26,5 @@ "engines": { | ||
"scripts": { | ||
"start": "node index.js", | ||
"build": "cd libui; make; cd ..; node-gyp build" | ||
"example": "node example.js", | ||
"postinstall": "cd libui; make; cd ..; node-gyp build" | ||
} | ||
} |
@@ -5,3 +5,12 @@ libui.js | ||
[![NPM module](https://img.shields.io/npm/v/libui.svg)](https://npmjs.org/package/libui) | ||
[![NPM downloads](https://img.shields.io/npm/dt/libui.svg)](https://npmjs.org/package/libui) | ||
Installation | ||
--- | ||
``` | ||
npm install libui | ||
``` | ||
Example | ||
@@ -8,0 +17,0 @@ --- |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Native code
Supply chain riskContains native code (e.g., compiled binaries or shared libraries). Including native code can obscure malicious behavior.
Found 40 instances in 1 package
No contributors or author data
MaintenancePackage does not specify a list of contributors or an author in package.json.
Found 1 instance in 1 package
No repository
Supply chain riskPackage does not have a linked source code repository. Without this field, a package will have no reference to the location of the source code use to generate the package.
Found 1 instance in 1 package
115
2
82
0
3
1052215
221