Skip to content

Commit

Permalink
chore(all): prepare release 0.11.1
Browse files Browse the repository at this point in the history
  • Loading branch information
EisenbergEffect committed May 6, 2015
1 parent 8ab754d commit 4130c8b
Show file tree
Hide file tree
Showing 16 changed files with 270 additions and 114 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",
"version": "0.11.0",
"version": "0.11.1",
"description": "An extensible HTML templating engine supporting databinding, custom elements, attached behaviors and more.",
"keywords": [
"aurelia",
Expand All @@ -19,13 +19,13 @@
"url": "http://github.com/aurelia/templating"
},
"dependencies": {
"aurelia-binding": "^0.6.0",
"aurelia-dependency-injection": "^0.7.0",
"aurelia-binding": "^0.6.1",
"aurelia-dependency-injection": "^0.7.1",
"aurelia-html-template-element": "^0.2.0",
"aurelia-loader": "^0.6.0",
"aurelia-logging": "^0.4.0",
"aurelia-metadata": "^0.5.0",
"aurelia-path": "^0.6.0",
"aurelia-path": "^0.6.1",
"aurelia-task-queue": "^0.4.0",
"core-js": "zloirock/core-js"
}
Expand Down
26 changes: 13 additions & 13 deletions config.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,41 +16,41 @@ System.config({

System.config({
"map": {
"aurelia-binding": "github:aurelia/[email protected].0",
"aurelia-dependency-injection": "github:aurelia/[email protected].0",
"aurelia-binding": "github:aurelia/[email protected].1",
"aurelia-dependency-injection": "github:aurelia/[email protected].1",
"aurelia-html-template-element": "github:aurelia/[email protected]",
"aurelia-loader": "github:aurelia/[email protected]",
"aurelia-logging": "github:aurelia/[email protected]",
"aurelia-metadata": "github:aurelia/[email protected]",
"aurelia-path": "github:aurelia/[email protected].0",
"aurelia-path": "github:aurelia/[email protected].1",
"aurelia-task-queue": "github:aurelia/[email protected]",
"babel": "npm:[email protected]",
"babel-runtime": "npm:[email protected]",
"core-js": "npm:[email protected].5",
"github:aurelia/[email protected].0": {
"aurelia-dependency-injection": "github:aurelia/[email protected].0",
"core-js": "npm:[email protected].6",
"github:aurelia/[email protected].1": {
"aurelia-dependency-injection": "github:aurelia/[email protected].1",
"aurelia-metadata": "github:aurelia/[email protected]",
"aurelia-task-queue": "github:aurelia/[email protected]",
"core-js": "npm:[email protected].5"
"core-js": "npm:[email protected].6"
},
"github:aurelia/[email protected].0": {
"github:aurelia/[email protected].1": {
"aurelia-logging": "github:aurelia/[email protected]",
"aurelia-metadata": "github:aurelia/[email protected]",
"core-js": "npm:[email protected].5"
"core-js": "npm:[email protected].6"
},
"github:aurelia/[email protected]": {
"aurelia-html-template-element": "github:aurelia/[email protected]",
"aurelia-path": "github:aurelia/[email protected].0",
"core-js": "npm:[email protected].5",
"aurelia-path": "github:aurelia/[email protected].1",
"core-js": "npm:[email protected].6",
"webcomponentsjs": "github:webcomponents/[email protected]"
},
"github:aurelia/[email protected]": {
"core-js": "npm:[email protected].5"
"core-js": "npm:[email protected].6"
},
"github:jspm/[email protected]": {
"process": "npm:[email protected]"
},
"npm:[email protected].5": {
"npm:[email protected].6": {
"process": "github:jspm/[email protected]"
}
}
Expand Down
70 changes: 53 additions & 17 deletions dist/amd/bindable-property.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,44 @@ define(['exports', 'core-js', './util', 'aurelia-binding'], function (exports, _
this.owner = null;
}

BindableProperty.prototype.registerWith = function registerWith(target, behavior) {
BindableProperty.prototype.registerWith = function registerWith(target, behavior, descriptor) {
behavior.properties.push(this);
behavior.attributes[this.attribute] = this;
this.owner = behavior;

if (descriptor) {
this.descriptor = descriptor;
return this.configureDescriptor(behavior, descriptor);
}
};

BindableProperty.prototype.configureDescriptor = function configureDescriptor(behavior, descriptor) {
var name = this.name;

descriptor.configurable = true;
descriptor.enumerable = true;

if (descriptor.initializer) {
this.defaultValue = descriptor.initializer;
delete descriptor.initializer;
delete descriptor.writable;
}

if (descriptor.value) {
this.defaultValue = descriptor.value;
delete descriptor.value;
delete descriptor.writable;
}

descriptor.get = function () {
return getObserver(behavior, this, name).getValue();
};

descriptor.set = function (value) {
getObserver(behavior, this, name).setValue(value);
};

return descriptor;
};

BindableProperty.prototype.defineOn = function defineOn(target, behavior) {
Expand All @@ -53,22 +87,17 @@ define(['exports', 'core-js', './util', 'aurelia-binding'], function (exports, _
}
}

Object.defineProperty(target.prototype, name, {
configurable: true,
enumerable: true,
get: function get() {
return getObserver(behavior, this, name).getValue();
},
set: function set(value) {
getObserver(behavior, this, name).setValue(value);
}
});
if (!this.descriptor) {
Object.defineProperty(target.prototype, name, this.configureDescriptor(behavior, {}));
}
};

BindableProperty.prototype.createObserver = function createObserver(executionContext) {
var _this = this;

var selfSubscriber = null;
var selfSubscriber = null,
defaultValue = this.defaultValue,
initialValue;

if (this.hasOptions) {
return;
Expand All @@ -80,11 +109,18 @@ define(['exports', 'core-js', './util', 'aurelia-binding'], function (exports, _
};
}

return new BehaviorPropertyObserver(this.owner.taskQueue, executionContext, this.name, selfSubscriber);
if (defaultValue !== undefined) {
initialValue = typeof defaultValue === 'function' ? defaultValue.call(executionContext) : defaultValue;
}

return new BehaviorPropertyObserver(this.owner.taskQueue, executionContext, this.name, selfSubscriber, initialValue);
};

BindableProperty.prototype.initialize = function initialize(executionContext, observerLookup, attributes, behaviorHandlesBind, boundProperties) {
var selfSubscriber, observer, attribute;
var selfSubscriber,
observer,
attribute,
defaultValue = this.defaultValue;

if (this.isDynamic) {
for (var key in attributes) {
Expand All @@ -106,8 +142,7 @@ define(['exports', 'core-js', './util', 'aurelia-binding'], function (exports, _
observer.call();
} else if (attribute) {
boundProperties.push({ observer: observer, binding: attribute.createBinding(executionContext) });
} else if (this.defaultValue !== undefined) {
executionContext[this.name] = this.defaultValue;
} else if (defaultValue !== undefined) {
observer.call();
}

Expand Down Expand Up @@ -165,7 +200,7 @@ define(['exports', 'core-js', './util', 'aurelia-binding'], function (exports, _
exports.BindableProperty = BindableProperty;

var BehaviorPropertyObserver = (function () {
function BehaviorPropertyObserver(taskQueue, obj, propertyName, selfSubscriber) {
function BehaviorPropertyObserver(taskQueue, obj, propertyName, selfSubscriber, initialValue) {
_classCallCheck(this, BehaviorPropertyObserver);

this.taskQueue = taskQueue;
Expand All @@ -175,6 +210,7 @@ define(['exports', 'core-js', './util', 'aurelia-binding'], function (exports, _
this.notqueued = true;
this.publishing = false;
this.selfSubscriber = selfSubscriber;
this.currentValue = this.oldValue = initialValue;
}

BehaviorPropertyObserver.prototype.getValue = function getValue() {
Expand Down
2 changes: 1 addition & 1 deletion dist/amd/decorators.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ define(['exports', 'core-js', 'aurelia-metadata', './bindable-property', './chil
}

prop = new _bindableProperty.BindableProperty(nameOrConfigOrTarget);
prop.registerWith(actualTarget, resource);
return prop.registerWith(actualTarget, resource, descriptor);
};

if (!nameOrConfigOrTarget) {
Expand Down
12 changes: 7 additions & 5 deletions dist/amd/html-behavior.js
Original file line number Diff line number Diff line change
Expand Up @@ -196,12 +196,14 @@ define(['exports', 'aurelia-metadata', 'aurelia-binding', 'aurelia-task-queue',
if (element) {
element.primaryBehavior = behaviorInstance;

if (behaviorInstance.view) {
if (this.usesShadowDOM) {
host = element.createShadowRoot();
} else {
host = element;
if (this.usesShadowDOM) {
host = element.createShadowRoot();
} else {
host = element;
}

if (behaviorInstance.view) {
if (!this.usesShadowDOM) {
if (instruction.contentFactory) {
var contentView = instruction.contentFactory.create(container, null, contentSelectorFactoryOptions);

Expand Down
70 changes: 53 additions & 17 deletions dist/commonjs/bindable-property.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,44 @@ var BindableProperty = (function () {
this.owner = null;
}

BindableProperty.prototype.registerWith = function registerWith(target, behavior) {
BindableProperty.prototype.registerWith = function registerWith(target, behavior, descriptor) {
behavior.properties.push(this);
behavior.attributes[this.attribute] = this;
this.owner = behavior;

if (descriptor) {
this.descriptor = descriptor;
return this.configureDescriptor(behavior, descriptor);
}
};

BindableProperty.prototype.configureDescriptor = function configureDescriptor(behavior, descriptor) {
var name = this.name;

descriptor.configurable = true;
descriptor.enumerable = true;

if (descriptor.initializer) {
this.defaultValue = descriptor.initializer;
delete descriptor.initializer;
delete descriptor.writable;
}

if (descriptor.value) {
this.defaultValue = descriptor.value;
delete descriptor.value;
delete descriptor.writable;
}

descriptor.get = function () {
return getObserver(behavior, this, name).getValue();
};

descriptor.set = function (value) {
getObserver(behavior, this, name).setValue(value);
};

return descriptor;
};

BindableProperty.prototype.defineOn = function defineOn(target, behavior) {
Expand All @@ -58,22 +92,17 @@ var BindableProperty = (function () {
}
}

Object.defineProperty(target.prototype, name, {
configurable: true,
enumerable: true,
get: function get() {
return getObserver(behavior, this, name).getValue();
},
set: function set(value) {
getObserver(behavior, this, name).setValue(value);
}
});
if (!this.descriptor) {
Object.defineProperty(target.prototype, name, this.configureDescriptor(behavior, {}));
}
};

BindableProperty.prototype.createObserver = function createObserver(executionContext) {
var _this = this;

var selfSubscriber = null;
var selfSubscriber = null,
defaultValue = this.defaultValue,
initialValue;

if (this.hasOptions) {
return;
Expand All @@ -85,11 +114,18 @@ var BindableProperty = (function () {
};
}

return new BehaviorPropertyObserver(this.owner.taskQueue, executionContext, this.name, selfSubscriber);
if (defaultValue !== undefined) {
initialValue = typeof defaultValue === 'function' ? defaultValue.call(executionContext) : defaultValue;
}

return new BehaviorPropertyObserver(this.owner.taskQueue, executionContext, this.name, selfSubscriber, initialValue);
};

BindableProperty.prototype.initialize = function initialize(executionContext, observerLookup, attributes, behaviorHandlesBind, boundProperties) {
var selfSubscriber, observer, attribute;
var selfSubscriber,
observer,
attribute,
defaultValue = this.defaultValue;

if (this.isDynamic) {
for (var key in attributes) {
Expand All @@ -111,8 +147,7 @@ var BindableProperty = (function () {
observer.call();
} else if (attribute) {
boundProperties.push({ observer: observer, binding: attribute.createBinding(executionContext) });
} else if (this.defaultValue !== undefined) {
executionContext[this.name] = this.defaultValue;
} else if (defaultValue !== undefined) {
observer.call();
}

Expand Down Expand Up @@ -170,7 +205,7 @@ var BindableProperty = (function () {
exports.BindableProperty = BindableProperty;

var BehaviorPropertyObserver = (function () {
function BehaviorPropertyObserver(taskQueue, obj, propertyName, selfSubscriber) {
function BehaviorPropertyObserver(taskQueue, obj, propertyName, selfSubscriber, initialValue) {
_classCallCheck(this, BehaviorPropertyObserver);

this.taskQueue = taskQueue;
Expand All @@ -180,6 +215,7 @@ var BehaviorPropertyObserver = (function () {
this.notqueued = true;
this.publishing = false;
this.selfSubscriber = selfSubscriber;
this.currentValue = this.oldValue = initialValue;
}

BehaviorPropertyObserver.prototype.getValue = function getValue() {
Expand Down
2 changes: 1 addition & 1 deletion dist/commonjs/decorators.js
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ function bindable(nameOrConfigOrTarget, key, descriptor) {
}

prop = new _BindableProperty.BindableProperty(nameOrConfigOrTarget);
prop.registerWith(actualTarget, resource);
return prop.registerWith(actualTarget, resource, descriptor);
};

if (!nameOrConfigOrTarget) {
Expand Down
12 changes: 7 additions & 5 deletions dist/commonjs/html-behavior.js
Original file line number Diff line number Diff line change
Expand Up @@ -213,12 +213,14 @@ var HtmlBehaviorResource = (function () {
if (element) {
element.primaryBehavior = behaviorInstance;

if (behaviorInstance.view) {
if (this.usesShadowDOM) {
host = element.createShadowRoot();
} else {
host = element;
if (this.usesShadowDOM) {
host = element.createShadowRoot();
} else {
host = element;
}

if (behaviorInstance.view) {
if (!this.usesShadowDOM) {
if (instruction.contentFactory) {
var contentView = instruction.contentFactory.create(container, null, contentSelectorFactoryOptions);

Expand Down
Loading

0 comments on commit 4130c8b

Please sign in to comment.