Skip to content

Commit

Permalink
chore(all): prepare release 1.5.0
Browse files Browse the repository at this point in the history
  • Loading branch information
EisenbergEffect committed Sep 29, 2018
1 parent 18bec79 commit ef104fb
Show file tree
Hide file tree
Showing 11 changed files with 335 additions and 46 deletions.
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "aurelia-templating-binding",
"version": "1.4.3",
"version": "1.5.0",
"description": "An implementation of the templating engine's Binding Language abstraction which uses a pluggable command syntax.",
"keywords": [
"aurelia",
Expand Down
46 changes: 46 additions & 0 deletions dist/amd/aurelia-templating-binding.js
Original file line number Diff line number Diff line change
Expand Up @@ -553,6 +553,7 @@ define(['exports', 'aurelia-logging', 'aurelia-binding', 'aurelia-templating'],
_this.emptyStringExpression = _this.parser.parse('\'\'');
syntaxInterpreter.language = _this;
_this.attributeMap = attributeMap;
_this.toBindingContextAttr = 'to-binding-context';
return _this;
}

Expand Down Expand Up @@ -610,6 +611,51 @@ define(['exports', 'aurelia-logging', 'aurelia-binding', 'aurelia-templating'],
return instruction;
};

TemplatingBindingLanguage.prototype.createLetExpressions = function createLetExpressions(resources, letElement) {
var expressions = [];
var attributes = letElement.attributes;

var attr = void 0;

var parts = void 0;
var attrName = void 0;
var attrValue = void 0;
var command = void 0;
var toBindingContextAttr = this.toBindingContextAttr;
var toBindingContext = letElement.hasAttribute(toBindingContextAttr);
for (var i = 0, ii = attributes.length; ii > i; ++i) {
attr = attributes[i];
attrName = attr.name;
attrValue = attr.nodeValue;
parts = attrName.split('.');

if (attrName === toBindingContextAttr) {
continue;
}

if (parts.length === 2) {
command = parts[1];
if (command !== 'bind') {
LogManager.getLogger('templating-binding-language').warn('Detected invalid let command. Expected "' + parts[0] + '.bind", given "' + attrName + '"');
continue;
}
expressions.push(new LetExpression(this.observerLocator, (0, _aureliaBinding.camelCase)(parts[0]), this.parser.parse(attrValue), resources.lookupFunctions, toBindingContext));
} else {
attrName = (0, _aureliaBinding.camelCase)(attrName);
parts = this.parseInterpolation(resources, attrValue);
if (parts === null) {
LogManager.getLogger('templating-binding-language').warn('Detected string literal in let bindings. Did you mean "' + attrName + '.bind=' + attrValue + '" or "' + attrName + '=${' + attrValue + '}" ?');
}
if (parts) {
expressions.push(new LetInterpolationBindingExpression(this.observerLocator, attrName, parts, resources.lookupFunctions, toBindingContext));
} else {
expressions.push(new LetExpression(this.observerLocator, attrName, new _aureliaBinding.LiteralString(attrValue), resources.lookupFunctions, toBindingContext));
}
}
}
return expressions;
};

TemplatingBindingLanguage.prototype.inspectTextContent = function inspectTextContent(resources, value) {
var parts = this.parseInterpolation(resources, value);
if (parts === null) {
Expand Down
51 changes: 12 additions & 39 deletions dist/aurelia-templating-binding.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,29 +12,29 @@ import {
BindingExpression,
CallExpression,
delegationStrategy,
NameExpression
NameExpression,
LiteralString
} from 'aurelia-binding';
import {
BehaviorInstruction,
BindingLanguage,
ViewResources
BindingLanguage
} from 'aurelia-templating';
export declare class AttributeMap {
static inject: any;
elements: any;
allElements: any;
constructor(svg?: any);

/**
* Maps a specific HTML element attribute to a javascript property.
*/
register(elementName?: any, attributeName?: any, propertyName?: any): any;

/**
* Maps an HTML attribute to a javascript property.
*/
registerUniversal(attributeName?: any, propertyName?: any): any;

/**
* Returns the javascript property name for a particlar HTML attribute.
*/
Expand Down Expand Up @@ -77,46 +77,19 @@ export declare class SyntaxInterpreter {
'two-way'(resources?: any, element?: any, info?: any, existingInstruction?: any): any;
'to-view'(resources?: any, element?: any, info?: any, existingInstruction?: any): any;
'from-view'(resources?: any, element?: any, info?: any, existingInstruction?: any): any;
'one-way'(resources?: any, element?: any, info?: any, existingInstruction?: any): any;
'one-time'(resources?: any, element?: any, info?: any, existingInstruction?: any): any;
}

export declare class LetExpression {
createBinding(): LetBinding
}

export declare class LetBinding {
constructor();
updateSource(): any;
call(context): any;
bind(source?: any): any;
unbind(): any;
connect(): any;
}

export declare class LetInterpolationBindingExpression {
createBinding(): LetInterpolationBinding
}

export declare class LetInterpolationBinding {
constructor();
updateSource(): any;
call(context): any;
bind(source?: any): any;
unbind(): any;
connect(): any;
}

export declare class TemplatingBindingLanguage extends BindingLanguage {
static inject: any;
constructor(parser?: any, observerLocator?: any, syntaxInterpreter?: any, attributeMap?: any);
inspectAttribute(resources?: any, elementName?: any, attrName?: any, attrValue?: any): any;
createLetExpressions(
resources: ViewResources,
letElement: HTMLElement,
existingLetExpressions: (LetExpression | LetInterpolationBindingExpression)[]
): (LetExpression | LetInterpolationBindingExpression)[]
createAttributeInstruction(resources?: any, element?: any, theInfo?: any, existingInstruction?: any, context?: any): any;

/**
* @param {ViewResources} resources
* @param {Element} letElement
*/
createLetExpressions(resources?: any, letElement?: any): any;
inspectTextContent(resources?: any, value?: any): any;
parseInterpolation(resources?: any, value?: any): any;
}
Expand Down
72 changes: 71 additions & 1 deletion dist/aurelia-templating-binding.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import * as LogManager from 'aurelia-logging';
import {camelCase,SVGAnalyzer,bindingMode,connectable,enqueueBindingConnect,Parser,ObserverLocator,EventManager,ListenerExpression,BindingExpression,CallExpression,delegationStrategy,NameExpression} from 'aurelia-binding';
import {camelCase,SVGAnalyzer,bindingMode,connectable,enqueueBindingConnect,Parser,ObserverLocator,EventManager,ListenerExpression,BindingExpression,CallExpression,delegationStrategy,NameExpression,LiteralString} from 'aurelia-binding';
import {BehaviorInstruction,BindingLanguage} from 'aurelia-templating';

export class AttributeMap {
Expand Down Expand Up @@ -587,6 +587,7 @@ export class TemplatingBindingLanguage extends BindingLanguage {
this.emptyStringExpression = this.parser.parse('\'\'');
syntaxInterpreter.language = this;
this.attributeMap = attributeMap;
this.toBindingContextAttr = 'to-binding-context';
}

inspectAttribute(resources, elementName, attrName, attrValue) {
Expand Down Expand Up @@ -655,6 +656,75 @@ export class TemplatingBindingLanguage extends BindingLanguage {
return instruction;
}

/**
* @param {ViewResources} resources
* @param {Element} letElement
*/
createLetExpressions(resources, letElement) {
let expressions = [];
let attributes = letElement.attributes;
/**@type {Attr} */
let attr;
/**@type {string[]} */
let parts;
let attrName;
let attrValue;
let command;
let toBindingContextAttr = this.toBindingContextAttr;
let toBindingContext = letElement.hasAttribute(toBindingContextAttr);
for (let i = 0, ii = attributes.length; ii > i; ++i) {
attr = attributes[i];
attrName = attr.name;
attrValue = attr.nodeValue;
parts = attrName.split('.');

if (attrName === toBindingContextAttr) {
continue;
}

if (parts.length === 2) {
command = parts[1];
if (command !== 'bind') {
LogManager.getLogger('templating-binding-language')
.warn(`Detected invalid let command. Expected "${parts[0]}.bind", given "${attrName}"`);
continue;
}
expressions.push(new LetExpression(
this.observerLocator,
camelCase(parts[0]),
this.parser.parse(attrValue),
resources.lookupFunctions,
toBindingContext
));
} else {
attrName = camelCase(attrName);
parts = this.parseInterpolation(resources, attrValue);
if (parts === null) {
LogManager.getLogger('templating-binding-language')
.warn(`Detected string literal in let bindings. Did you mean "${ attrName }.bind=${ attrValue }" or "${ attrName }=\${${ attrValue }}" ?`);
}
if (parts) {
expressions.push(new LetInterpolationBindingExpression(
this.observerLocator,
attrName,
parts,
resources.lookupFunctions,
toBindingContext
));
} else {
expressions.push(new LetExpression(
this.observerLocator,
attrName,
new LiteralString(attrValue),
resources.lookupFunctions,
toBindingContext
));
}
}
}
return expressions;
}

inspectTextContent(resources, value) {
const parts = this.parseInterpolation(resources, value);
if (parts === null) {
Expand Down
46 changes: 46 additions & 0 deletions dist/commonjs/aurelia-templating-binding.js
Original file line number Diff line number Diff line change
Expand Up @@ -524,6 +524,7 @@ var TemplatingBindingLanguage = exports.TemplatingBindingLanguage = (_temp3 = _c
_this.emptyStringExpression = _this.parser.parse('\'\'');
syntaxInterpreter.language = _this;
_this.attributeMap = attributeMap;
_this.toBindingContextAttr = 'to-binding-context';
return _this;
}

Expand Down Expand Up @@ -581,6 +582,51 @@ var TemplatingBindingLanguage = exports.TemplatingBindingLanguage = (_temp3 = _c
return instruction;
};

TemplatingBindingLanguage.prototype.createLetExpressions = function createLetExpressions(resources, letElement) {
var expressions = [];
var attributes = letElement.attributes;

var attr = void 0;

var parts = void 0;
var attrName = void 0;
var attrValue = void 0;
var command = void 0;
var toBindingContextAttr = this.toBindingContextAttr;
var toBindingContext = letElement.hasAttribute(toBindingContextAttr);
for (var i = 0, ii = attributes.length; ii > i; ++i) {
attr = attributes[i];
attrName = attr.name;
attrValue = attr.nodeValue;
parts = attrName.split('.');

if (attrName === toBindingContextAttr) {
continue;
}

if (parts.length === 2) {
command = parts[1];
if (command !== 'bind') {
LogManager.getLogger('templating-binding-language').warn('Detected invalid let command. Expected "' + parts[0] + '.bind", given "' + attrName + '"');
continue;
}
expressions.push(new LetExpression(this.observerLocator, (0, _aureliaBinding.camelCase)(parts[0]), this.parser.parse(attrValue), resources.lookupFunctions, toBindingContext));
} else {
attrName = (0, _aureliaBinding.camelCase)(attrName);
parts = this.parseInterpolation(resources, attrValue);
if (parts === null) {
LogManager.getLogger('templating-binding-language').warn('Detected string literal in let bindings. Did you mean "' + attrName + '.bind=' + attrValue + '" or "' + attrName + '=${' + attrValue + '}" ?');
}
if (parts) {
expressions.push(new LetInterpolationBindingExpression(this.observerLocator, attrName, parts, resources.lookupFunctions, toBindingContext));
} else {
expressions.push(new LetExpression(this.observerLocator, attrName, new _aureliaBinding.LiteralString(attrValue), resources.lookupFunctions, toBindingContext));
}
}
}
return expressions;
};

TemplatingBindingLanguage.prototype.inspectTextContent = function inspectTextContent(resources, value) {
var parts = this.parseInterpolation(resources, value);
if (parts === null) {
Expand Down
48 changes: 47 additions & 1 deletion dist/es2015/aurelia-templating-binding.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
var _class, _temp, _dec, _class2, _class3, _temp2, _class4, _temp3;

import * as LogManager from 'aurelia-logging';
import { camelCase, SVGAnalyzer, bindingMode, connectable, enqueueBindingConnect, Parser, ObserverLocator, EventManager, ListenerExpression, BindingExpression, CallExpression, delegationStrategy, NameExpression } from 'aurelia-binding';
import { camelCase, SVGAnalyzer, bindingMode, connectable, enqueueBindingConnect, Parser, ObserverLocator, EventManager, ListenerExpression, BindingExpression, CallExpression, delegationStrategy, NameExpression, LiteralString } from 'aurelia-binding';
import { BehaviorInstruction, BindingLanguage } from 'aurelia-templating';

export let AttributeMap = (_temp = _class = class AttributeMap {
Expand Down Expand Up @@ -481,6 +481,7 @@ export let TemplatingBindingLanguage = (_temp3 = _class4 = class TemplatingBindi
this.emptyStringExpression = this.parser.parse('\'\'');
syntaxInterpreter.language = this;
this.attributeMap = attributeMap;
this.toBindingContextAttr = 'to-binding-context';
}

inspectAttribute(resources, elementName, attrName, attrValue) {
Expand Down Expand Up @@ -537,6 +538,51 @@ export let TemplatingBindingLanguage = (_temp3 = _class4 = class TemplatingBindi
return instruction;
}

createLetExpressions(resources, letElement) {
let expressions = [];
let attributes = letElement.attributes;

let attr;

let parts;
let attrName;
let attrValue;
let command;
let toBindingContextAttr = this.toBindingContextAttr;
let toBindingContext = letElement.hasAttribute(toBindingContextAttr);
for (let i = 0, ii = attributes.length; ii > i; ++i) {
attr = attributes[i];
attrName = attr.name;
attrValue = attr.nodeValue;
parts = attrName.split('.');

if (attrName === toBindingContextAttr) {
continue;
}

if (parts.length === 2) {
command = parts[1];
if (command !== 'bind') {
LogManager.getLogger('templating-binding-language').warn(`Detected invalid let command. Expected "${parts[0]}.bind", given "${attrName}"`);
continue;
}
expressions.push(new LetExpression(this.observerLocator, camelCase(parts[0]), this.parser.parse(attrValue), resources.lookupFunctions, toBindingContext));
} else {
attrName = camelCase(attrName);
parts = this.parseInterpolation(resources, attrValue);
if (parts === null) {
LogManager.getLogger('templating-binding-language').warn(`Detected string literal in let bindings. Did you mean "${attrName}.bind=${attrValue}" or "${attrName}=\${${attrValue}}" ?`);
}
if (parts) {
expressions.push(new LetInterpolationBindingExpression(this.observerLocator, attrName, parts, resources.lookupFunctions, toBindingContext));
} else {
expressions.push(new LetExpression(this.observerLocator, attrName, new LiteralString(attrValue), resources.lookupFunctions, toBindingContext));
}
}
}
return expressions;
}

inspectTextContent(resources, value) {
const parts = this.parseInterpolation(resources, value);
if (parts === null) {
Expand Down
Loading

0 comments on commit ef104fb

Please sign in to comment.