Skip to content

Commit

Permalink
chore(all): prepare release 0.12.0
Browse files Browse the repository at this point in the history
  • Loading branch information
EisenbergEffect committed Jun 9, 2015
1 parent b6c2eb9 commit cc49716
Show file tree
Hide file tree
Showing 14 changed files with 257 additions and 197 deletions.
8 changes: 4 additions & 4 deletions bower.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "aurelia-templating-binding",
"version": "0.11.0",
"version": "0.12.0",
"description": "An implementation of the templating engine's Binding Language abstraction which uses a pluggable command syntax.",
"keywords": [
"aurelia",
Expand All @@ -18,8 +18,8 @@
"url": "http://github.com/aurelia/templating-binding"
},
"dependencies": {
"aurelia-binding": "^0.6.0",
"aurelia-logging": "^0.4.0",
"aurelia-templating": "^0.11.0"
"aurelia-binding": "^0.7.0",
"aurelia-logging": "^0.5.0",
"aurelia-templating": "^0.12.0"
}
}
60 changes: 31 additions & 29 deletions config.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,48 +16,50 @@ System.config({

System.config({
"map": {
"aurelia-binding": "github:aurelia/binding@0.6.0",
"aurelia-logging": "github:aurelia/logging@0.4.0",
"aurelia-templating": "github:aurelia/templating@0.11.0",
"aurelia-binding": "github:aurelia/binding@0.7.0",
"aurelia-logging": "github:aurelia/logging@0.5.0",
"aurelia-templating": "github:aurelia/templating@0.12.0",
"babel": "npm:[email protected]",
"babel-runtime": "npm:[email protected]",
"core-js": "npm:[email protected].5",
"github:aurelia/binding@0.6.0": {
"aurelia-dependency-injection": "github:aurelia/dependency-injection@0.7.0",
"aurelia-metadata": "github:aurelia/metadata@0.5.0",
"aurelia-task-queue": "github:aurelia/task-queue@0.4.0",
"core-js": "npm:[email protected].5"
"core-js": "npm:[email protected].14",
"github:aurelia/binding@0.7.0": {
"aurelia-dependency-injection": "github:aurelia/dependency-injection@0.8.1",
"aurelia-metadata": "github:aurelia/metadata@0.6.0",
"aurelia-task-queue": "github:aurelia/task-queue@0.5.0",
"core-js": "npm:[email protected].14"
},
"github:aurelia/dependency-injection@0.7.0": {
"aurelia-logging": "github:aurelia/logging@0.4.0",
"aurelia-metadata": "github:aurelia/metadata@0.5.0",
"core-js": "npm:[email protected].5"
"github:aurelia/dependency-injection@0.8.1": {
"aurelia-logging": "github:aurelia/logging@0.5.0",
"aurelia-metadata": "github:aurelia/metadata@0.6.0",
"core-js": "npm:[email protected].14"
},
"github:aurelia/loader@0.6.0": {
"github:aurelia/loader@0.7.0": {
"aurelia-html-template-element": "github:aurelia/[email protected]",
"aurelia-path": "github:aurelia/path@0.6.0",
"core-js": "npm:[email protected].5",
"webcomponentsjs": "github:webcomponents/[email protected].1"
"aurelia-path": "github:aurelia/path@0.7.0",
"core-js": "npm:[email protected].14",
"webcomponentsjs": "github:webcomponents/[email protected].3"
},
"github:aurelia/metadata@0.5.0": {
"core-js": "npm:[email protected].5"
"github:aurelia/metadata@0.6.0": {
"core-js": "npm:[email protected].14"
},
"github:aurelia/templating@0.11.0": {
"aurelia-binding": "github:aurelia/binding@0.6.0",
"aurelia-dependency-injection": "github:aurelia/dependency-injection@0.7.0",
"github:aurelia/templating@0.12.0": {
"aurelia-binding": "github:aurelia/binding@0.7.0",
"aurelia-dependency-injection": "github:aurelia/dependency-injection@0.8.1",
"aurelia-html-template-element": "github:aurelia/[email protected]",
"aurelia-loader": "github:aurelia/loader@0.6.0",
"aurelia-logging": "github:aurelia/logging@0.4.0",
"aurelia-metadata": "github:aurelia/metadata@0.5.0",
"aurelia-path": "github:aurelia/path@0.6.0",
"aurelia-task-queue": "github:aurelia/task-queue@0.4.0",
"core-js": "npm:[email protected].5"
"aurelia-loader": "github:aurelia/loader@0.7.0",
"aurelia-logging": "github:aurelia/logging@0.5.0",
"aurelia-metadata": "github:aurelia/metadata@0.6.0",
"aurelia-path": "github:aurelia/path@0.7.0",
"aurelia-task-queue": "github:aurelia/task-queue@0.5.0",
"core-js": "npm:[email protected].14"
},
"github:jspm/[email protected]": {
"process": "npm:[email protected]"
},
"npm:[email protected]": {
"npm:[email protected]": {
"fs": "github:jspm/[email protected]",
"process": "github:jspm/[email protected]"
}
}
});

44 changes: 28 additions & 16 deletions dist/amd/binding-language.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
define(['exports', 'aurelia-templating', 'aurelia-binding', './syntax-interpreter', 'aurelia-logging'], function (exports, _aureliaTemplating, _aureliaBinding, _syntaxInterpreter, _aureliaLogging) {
'use strict';

var _classCallCheck = function (instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } };
exports.__esModule = true;

var _inherits = function (subClass, superClass) { if (typeof superClass !== 'function' && superClass !== null) { throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) subClass.__proto__ = superClass; };
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } }

exports.__esModule = true;
function _inherits(subClass, superClass) { if (typeof superClass !== 'function' && superClass !== null) { throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) subClass.__proto__ = superClass; }

var info = {},
logger = _aureliaLogging.getLogger('templating-binding');
Expand All @@ -21,19 +21,24 @@ define(['exports', 'aurelia-templating', 'aurelia-binding', './syntax-interprete
this.emptyStringExpression = this.parser.parse('\'\'');
syntaxInterpreter.language = this;
this.attributeMap = syntaxInterpreter.attributeMap = {
'class': 'className',
contenteditable: 'contentEditable',
'contenteditable': 'contentEditable',
'for': 'htmlFor',
tabindex: 'tabIndex',
textcontent: 'textContent',
innerhtml: 'innerHTML',
maxlength: 'maxLength',
minlength: 'minLength',
formaction: 'formAction',
formenctype: 'formEncType',
formmethod: 'formMethod',
formnovalidate: 'formNoValidate',
formtarget: 'formTarget' };
'tabindex': 'tabIndex',
'textcontent': 'textContent',
'innerhtml': 'innerHTML',

'maxlength': 'maxLength',
'minlength': 'minLength',
'formaction': 'formAction',
'formenctype': 'formEncType',
'formmethod': 'formMethod',
'formnovalidate': 'formNoValidate',
'formtarget': 'formTarget',
'rowspan': 'rowSpan',
'colspan': 'colSpan',
'scrolltop': 'scrollTop',
'scrollleft': 'scrollLeft'
};
}

_inherits(TemplatingBindingLanguage, _BindingLanguage);
Expand All @@ -51,7 +56,14 @@ define(['exports', 'aurelia-templating', 'aurelia-binding', './syntax-interprete
info.attrName = parts[0].trim();
info.attrValue = attrValue;
info.command = parts[1].trim();
info.expression = null;

if (info.command === 'ref') {
info.expression = new _aureliaBinding.NameExpression(attrValue, info.attrName);
info.command = null;
info.attrName = 'ref';
} else {
info.expression = null;
}
} else if (attrName == 'ref') {
info.attrName = attrName;
info.attrValue = attrValue;
Expand Down
31 changes: 15 additions & 16 deletions dist/amd/syntax-interpreter.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
define(['exports', 'aurelia-binding'], function (exports, _aureliaBinding) {
'use strict';

var _classCallCheck = function (instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } };

exports.__esModule = true;

function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } }

var SyntaxInterpreter = (function () {
function SyntaxInterpreter(parser, observerLocator, eventManager) {
_classCallCheck(this, SyntaxInterpreter);
Expand Down Expand Up @@ -49,6 +49,8 @@ define(['exports', 'aurelia-binding'], function (exports, _aureliaBinding) {
return attrName == 'value' ? _aureliaBinding.bindingMode.twoWay : _aureliaBinding.bindingMode.oneWay;
} else if (attrName === 'textcontent' || attrName === 'innerhtml') {
return element.contentEditable === 'true' ? _aureliaBinding.bindingMode.twoWay : _aureliaBinding.bindingMode.oneWay;
} else if (attrName === 'scrolltop' || attrName === 'scrollleft') {
return _aureliaBinding.bindingMode.twoWay;
}

return _aureliaBinding.bindingMode.oneWay;
Expand Down Expand Up @@ -127,25 +129,26 @@ define(['exports', 'aurelia-binding'], function (exports, _aureliaBinding) {
exports.SyntaxInterpreter = SyntaxInterpreter;

SyntaxInterpreter.prototype['for'] = function (resources, element, info, existingInstruction) {
var parts = info.attrValue.split(' of ');
var parts, keyValue, instruction, attrValue, isDestructuring;
attrValue = info.attrValue;
isDestructuring = attrValue.match(/[[].+[\]]/);
parts = isDestructuring ? attrValue.split('of ') : attrValue.split(' of ');

if (parts.length !== 2) {
throw new Error('Incorrect syntax for "for". The form is: "$local of $items".');
throw new Error('Incorrect syntax for "for". The form is: "$local of $items" or "[$key, $value] of $items".');
}

var instruction = existingInstruction || { attrName: info.attrName, attributes: {} };
instruction = existingInstruction || { attrName: info.attrName, attributes: {} };

if (parts[0].match(/[[].+[,]\s.+[\]]/)) {
var firstPart = parts[0];
parts[0] = firstPart.substr(1, firstPart.indexOf(',') - 1);
parts.splice(1, 0, firstPart.substring(firstPart.indexOf(', ') + 2, firstPart.length - 1));
instruction.attributes.key = parts[0];
instruction.attributes.value = parts[1];
if (isDestructuring) {
keyValue = parts[0].replace(/[[\]]/g, '').replace(/,/g, ' ').replace(/\s+/g, ' ').trim().split(' ');
instruction.attributes.key = keyValue[0];
instruction.attributes.value = keyValue[1];
} else {
instruction.attributes.local = parts[0];
}

instruction.attributes.items = new _aureliaBinding.BindingExpression(this.observerLocator, 'items', this.parser.parse(parts[parts.length - 1]), _aureliaBinding.bindingMode.oneWay, resources.valueConverterLookupFunction);
instruction.attributes.items = new _aureliaBinding.BindingExpression(this.observerLocator, 'items', this.parser.parse(parts[1]), _aureliaBinding.bindingMode.oneWay, resources.valueConverterLookupFunction);

return instruction;
};
Expand Down Expand Up @@ -173,8 +176,4 @@ define(['exports', 'aurelia-binding'], function (exports, _aureliaBinding) {

return instruction;
};

SyntaxInterpreter.prototype['view-model'] = function (resources, element, info) {
return new _aureliaBinding.NameExpression(info.attrValue, 'view-model');
};
});
66 changes: 39 additions & 27 deletions dist/commonjs/binding-language.js
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
'use strict';

var _interopRequireWildcard = function (obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (typeof obj === 'object' && obj !== null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj['default'] = obj; return newObj; } };
exports.__esModule = true;

var _classCallCheck = function (instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } };
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj['default'] = obj; return newObj; } }

var _inherits = function (subClass, superClass) { if (typeof superClass !== 'function' && superClass !== null) { throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) subClass.__proto__ = superClass; };
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } }

exports.__esModule = true;
function _inherits(subClass, superClass) { if (typeof superClass !== 'function' && superClass !== null) { throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) subClass.__proto__ = superClass; }

var _BindingLanguage2 = require('aurelia-templating');
var _aureliaTemplating = require('aurelia-templating');

var _Parser$ObserverLocator$BindingExpression$NameExpression$bindingMode = require('aurelia-binding');
var _aureliaBinding = require('aurelia-binding');

var _SyntaxInterpreter = require('./syntax-interpreter');
var _syntaxInterpreter = require('./syntax-interpreter');

var _import = require('aurelia-logging');
var _aureliaLogging = require('aurelia-logging');

var LogManager = _interopRequireWildcard(_import);
var LogManager = _interopRequireWildcard(_aureliaLogging);

var info = {},
logger = LogManager.getLogger('templating-binding');
Expand All @@ -32,25 +32,30 @@ var TemplatingBindingLanguage = (function (_BindingLanguage) {
this.emptyStringExpression = this.parser.parse('\'\'');
syntaxInterpreter.language = this;
this.attributeMap = syntaxInterpreter.attributeMap = {
'class': 'className',
contenteditable: 'contentEditable',
'contenteditable': 'contentEditable',
'for': 'htmlFor',
tabindex: 'tabIndex',
textcontent: 'textContent',
innerhtml: 'innerHTML',
maxlength: 'maxLength',
minlength: 'minLength',
formaction: 'formAction',
formenctype: 'formEncType',
formmethod: 'formMethod',
formnovalidate: 'formNoValidate',
formtarget: 'formTarget' };
'tabindex': 'tabIndex',
'textcontent': 'textContent',
'innerhtml': 'innerHTML',

'maxlength': 'maxLength',
'minlength': 'minLength',
'formaction': 'formAction',
'formenctype': 'formEncType',
'formmethod': 'formMethod',
'formnovalidate': 'formNoValidate',
'formtarget': 'formTarget',
'rowspan': 'rowSpan',
'colspan': 'colSpan',
'scrolltop': 'scrollTop',
'scrollleft': 'scrollLeft'
};
}

_inherits(TemplatingBindingLanguage, _BindingLanguage);

TemplatingBindingLanguage.inject = function inject() {
return [_Parser$ObserverLocator$BindingExpression$NameExpression$bindingMode.Parser, _Parser$ObserverLocator$BindingExpression$NameExpression$bindingMode.ObserverLocator, _SyntaxInterpreter.SyntaxInterpreter];
return [_aureliaBinding.Parser, _aureliaBinding.ObserverLocator, _syntaxInterpreter.SyntaxInterpreter];
};

TemplatingBindingLanguage.prototype.inspectAttribute = function inspectAttribute(resources, attrName, attrValue) {
Expand All @@ -62,12 +67,19 @@ var TemplatingBindingLanguage = (function (_BindingLanguage) {
info.attrName = parts[0].trim();
info.attrValue = attrValue;
info.command = parts[1].trim();
info.expression = null;

if (info.command === 'ref') {
info.expression = new _aureliaBinding.NameExpression(attrValue, info.attrName);
info.command = null;
info.attrName = 'ref';
} else {
info.expression = null;
}
} else if (attrName == 'ref') {
info.attrName = attrName;
info.attrValue = attrValue;
info.command = null;
info.expression = new _Parser$ObserverLocator$BindingExpression$NameExpression$bindingMode.NameExpression(attrValue, 'element');
info.expression = new _aureliaBinding.NameExpression(attrValue, 'element');
} else {
info.attrName = attrName;
info.attrValue = attrValue;
Expand Down Expand Up @@ -168,11 +180,11 @@ var TemplatingBindingLanguage = (function (_BindingLanguage) {

parts[partIndex] = attrValue.substr(pos);

return new InterpolationBindingExpression(this.observerLocator, this.attributeMap[attrName] || attrName, parts, _Parser$ObserverLocator$BindingExpression$NameExpression$bindingMode.bindingMode.oneWay, resources.valueConverterLookupFunction, attrName);
return new InterpolationBindingExpression(this.observerLocator, this.attributeMap[attrName] || attrName, parts, _aureliaBinding.bindingMode.oneWay, resources.valueConverterLookupFunction, attrName);
};

return TemplatingBindingLanguage;
})(_BindingLanguage2.BindingLanguage);
})(_aureliaTemplating.BindingLanguage);

exports.TemplatingBindingLanguage = TemplatingBindingLanguage;

Expand Down Expand Up @@ -222,7 +234,7 @@ var InterpolationBinding = (function () {
InterpolationBinding.prototype.bind = function bind(source) {
this.source = source;

if (this.mode == _Parser$ObserverLocator$BindingExpression$NameExpression$bindingMode.bindingMode.oneWay) {
if (this.mode == _aureliaBinding.bindingMode.oneWay) {
this.unbind();
this.connect();
this.setValue();
Expand Down
20 changes: 10 additions & 10 deletions dist/commonjs/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,27 +2,27 @@

exports.__esModule = true;

var _BindingLanguage = require('aurelia-templating');
var _aureliaTemplating = require('aurelia-templating');

var _TemplatingBindingLanguage = require('./binding-language');
var _bindingLanguage = require('./binding-language');

var _SyntaxInterpreter = require('./syntax-interpreter');
var _syntaxInterpreter = require('./syntax-interpreter');

function configure(aurelia) {
var instance,
getInstance = function getInstance(c) {
return instance || (instance = c.invoke(_TemplatingBindingLanguage.TemplatingBindingLanguage));
return instance || (instance = c.invoke(_bindingLanguage.TemplatingBindingLanguage));
};

if (aurelia.container.hasHandler(_TemplatingBindingLanguage.TemplatingBindingLanguage)) {
instance = aurelia.container.get(_TemplatingBindingLanguage.TemplatingBindingLanguage);
if (aurelia.container.hasHandler(_bindingLanguage.TemplatingBindingLanguage)) {
instance = aurelia.container.get(_bindingLanguage.TemplatingBindingLanguage);
} else {
aurelia.container.registerHandler(_TemplatingBindingLanguage.TemplatingBindingLanguage, getInstance);
aurelia.container.registerHandler(_bindingLanguage.TemplatingBindingLanguage, getInstance);
}

aurelia.container.registerHandler(_BindingLanguage.BindingLanguage, getInstance);
aurelia.container.registerHandler(_aureliaTemplating.BindingLanguage, getInstance);
}

exports.TemplatingBindingLanguage = _TemplatingBindingLanguage.TemplatingBindingLanguage;
exports.SyntaxInterpreter = _SyntaxInterpreter.SyntaxInterpreter;
exports.TemplatingBindingLanguage = _bindingLanguage.TemplatingBindingLanguage;
exports.SyntaxInterpreter = _syntaxInterpreter.SyntaxInterpreter;
exports.configure = configure;
Loading

0 comments on commit cc49716

Please sign in to comment.