@makano/rew 1.1.6 → 1.1.7

Sign up to get free protection for your applications and to get access to all the features.
@@ -3,7 +3,8 @@ const execOptions = {
3
3
  resolveExtensions: [{ext: '.js', options: { type: 'js' }}, '.coffee'],
4
4
  nativeRequire: false,
5
5
  cwdAlias: '$',
6
- jsxPragma: 'createElement'
6
+ jsxPragma: 'createElement',
7
+ jsx: false
7
8
  }
8
9
 
9
10
  module.exports.execOptions = execOptions;
@@ -185,7 +185,7 @@ function compileRewStuff(content, options) {
185
185
 
186
186
  const cpl = (module.exports.compile = function (file, options = {}) {
187
187
  let c = compile(compileRewStuff(file.content, options), { ...options, filename: file.path, bare: false, inlineMap: false });
188
- if(options.jsx) {
188
+ if(execOptions.jsx || options.jsx) {
189
189
  c = babel.transformSync(c, {
190
190
  presets: [[babelReact, { pragma: execOptions.jsxPragma }]],
191
191
  plugins: []
@@ -96,17 +96,20 @@ module.exports.uiClasses = (context, options, send, recieve, hook, rmHook) => {
96
96
  }
97
97
 
98
98
  data(key, value){
99
+ if(!value) return this.options.data[key];
99
100
  this.options.data[key] = value;
100
101
  return this.update();
101
102
  }
102
103
 
103
- attr(attr){
104
- this.options.attr = attr;
104
+ attr(attr, reset = false){
105
+ if(reset) this.options.attr = attr;
106
+ else this.options.attr = { ...this.options.attr, ...attr };
105
107
  return this.update();
106
108
  }
107
109
 
108
- style(style){
109
- this.options.style = style;
110
+ style(style, reset = false){
111
+ if(reset) this.options.style = style;
112
+ else this.options.style = { ...this.options.style, ...style };
110
113
  return this.update();
111
114
  }
112
115
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@makano/rew",
3
- "version": "1.1.6",
3
+ "version": "1.1.7",
4
4
  "description": "A simple coffescript runtime",
5
5
  "main": "lib/rew/main.js",
6
6
  "directories": {