Skip to content

Commit

Permalink
chore(all): prepare release 0.13.16
Browse files Browse the repository at this point in the history
  • Loading branch information
EisenbergEffect committed Aug 5, 2015
1 parent eb34505 commit 90be763
Show file tree
Hide file tree
Showing 13 changed files with 254 additions and 147 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",
"version": "0.13.15",
"version": "0.13.16",
"description": "An extensible HTML templating engine supporting databinding, custom elements, attached behaviors and more.",
"keywords": [
"aurelia",
Expand Down
2 changes: 2 additions & 0 deletions dist/amd/aurelia-templating.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ declare module 'aurelia-templating' {
import * as LogManager from 'aurelia-logging';
export let DOMBoundary: any;
export function createTemplateFromMarkup(markup: any): any;
export function replaceNode(newNode: any, node: any, parentNode: any): any;
export function removeNode(node: any, parentNode: any): any;
export const animationEvent: any;
export class Animator {
static configureDefault(container: any, animatorInstance: any): any;
Expand Down
72 changes: 44 additions & 28 deletions dist/amd/aurelia-templating.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ define(['exports', 'core-js', 'aurelia-metadata', 'aurelia-path', 'aurelia-loade
var _createClass = (function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ('value' in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; })();

exports.createTemplateFromMarkup = createTemplateFromMarkup;
exports.replaceNode = replaceNode;
exports.removeNode = removeNode;
exports.hyphenate = hyphenate;
exports.nextElementSibling = nextElementSibling;
exports.behavior = behavior;
Expand Down Expand Up @@ -34,6 +36,7 @@ define(['exports', 'core-js', 'aurelia-metadata', 'aurelia-path', 'aurelia-loade
var _core = _interopRequireDefault(_coreJs);

var needsTemplateFixup = !('content' in document.createElement('template'));
var shadowPoly = window.ShadowDOMPolyfill || null;

var DOMBoundary = 'aurelia-dom-boundary';

Expand All @@ -53,6 +56,26 @@ define(['exports', 'core-js', 'aurelia-metadata', 'aurelia-path', 'aurelia-loade
return temp;
}

function replaceNode(newNode, node, parentNode) {
if (node.parentNode) {
node.parentNode.replaceChild(newNode, node);
} else if (shadowPoly) {
shadowPoly.unwrap(parentNode).replaceChild(shadowPoly.unwrap(newNode), shadowPoly.unwrap(node));
} else {
parentNode.replaceChild(newNode, node);
}
}

function removeNode(node, parentNode) {
if (node.parentNode) {
node.parentNode.removeChild(node);
} else if (shadowPoly) {
shadowPoly.unwrap(parentNode).removeChild(shadowPoly.unwrap(node));
} else {
parentNode.removeChild(node);
}
}

var animationEvent = {
enterBegin: 'animation:enter:begin',
enterActive: 'animation:enter:active',
Expand Down Expand Up @@ -1084,7 +1107,7 @@ define(['exports', 'core-js', 'aurelia-metadata', 'aurelia-path', 'aurelia-loade
view = children[i];

for (j = 0; j < jj; ++j) {
contentSelectors[j].removeAt(i, view.fragment);
contentSelectors[j].removeAt(0, view.fragment);
}
}

Expand Down Expand Up @@ -1366,7 +1389,6 @@ define(['exports', 'core-js', 'aurelia-metadata', 'aurelia-path', 'aurelia-loade
contentSelectors = [],
containers = { root: container },
partReplacements = options.partReplacements,
domBoundary = container.get(DOMBoundary),
i,
ii,
view,
Expand All @@ -1381,8 +1403,6 @@ define(['exports', 'core-js', 'aurelia-metadata', 'aurelia-path', 'aurelia-loade
instructable = instructables[i];
instruction = instructions[instructable.getAttribute('au-target-id')];

instructable.domBoundary = domBoundary;

applyInstructions(containers, executionContext, instructable, instruction, behaviors, bindings, children, contentSelectors, partReplacements, resources);
}

Expand Down Expand Up @@ -2575,15 +2595,7 @@ define(['exports', 'core-js', 'aurelia-metadata', 'aurelia-path', 'aurelia-loade
part = node.getAttribute('part');

node.removeAttribute(instruction.originalAttrName);

if (node.parentNode) {
node.parentNode.replaceChild(template, node);
} else if (window.ShadowDOMPolyfill) {
ShadowDOMPolyfill.unwrap(parentNode).replaceChild(ShadowDOMPolyfill.unwrap(template), ShadowDOMPolyfill.unwrap(node));
} else {
parentNode.replaceChild(template, node);
}

replaceNode(template, node, parentNode);
fragment.appendChild(node);
instruction.viewFactory = compiler.compile(fragment, resources);

Expand All @@ -2598,40 +2610,43 @@ define(['exports', 'core-js', 'aurelia-metadata', 'aurelia-path', 'aurelia-loade
var partReplacements = instruction.partReplacements = {};

if (this.processContent(compiler, resources, node, instruction) && node.hasChildNodes()) {
instruction.skipContentProcessing = false;

if (!this.usesShadowDOM) {
var fragment = document.createDocumentFragment(),
currentChild = node.firstChild,
nextSibling;
if (this.usesShadowDOM) {
var currentChild = node.firstChild,
nextSibling,
toReplace;

while (currentChild) {
nextSibling = currentChild.nextSibling;

if (currentChild.tagName === 'TEMPLATE' && (toReplace = currentChild.getAttribute('replace-part'))) {
partReplacements[toReplace] = compiler.compile(currentChild, resources);
} else {
fragment.appendChild(currentChild);
removeNode(currentChild, parentNode);
}

currentChild = nextSibling;
}

instruction.contentFactory = compiler.compile(fragment, resources);
instruction.skipContentProcessing = false;
} else {
var currentChild = node.firstChild,
nextSibling,
toReplace;
var fragment = document.createDocumentFragment(),
currentChild = node.firstChild,
nextSibling;

while (currentChild) {
nextSibling = currentChild.nextSibling;

if (currentChild.tagName === 'TEMPLATE' && (toReplace = currentChild.getAttribute('replace-part'))) {
partReplacements[toReplace] = compiler.compile(currentChild, resources);
removeNode(currentChild, parentNode);
} else {
fragment.appendChild(currentChild);
}

currentChild = nextSibling;
}

instruction.contentFactory = compiler.compile(fragment, resources);
instruction.skipContentProcessing = true;
}
} else {
instruction.skipContentProcessing = true;
Expand All @@ -2652,12 +2667,13 @@ define(['exports', 'core-js', 'aurelia-metadata', 'aurelia-path', 'aurelia-loade
if (this.elementName !== null && element) {
if (this.usesShadowDOM) {
host = element.createShadowRoot();
container.registerInstance(DOMBoundary, host);
} else {
host = element;
}

if (instruction.anchorIsContainer) {
container.registerInstance(DOMBoundary, host);
if (this.targetShadowDOM) {
container.registerInstance(DOMBoundary, host);
}
}
}

Expand Down
2 changes: 2 additions & 0 deletions dist/aurelia-templating.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ declare module 'aurelia-templating' {
import * as LogManager from 'aurelia-logging';
export let DOMBoundary: any;
export function createTemplateFromMarkup(markup: any): any;
export function replaceNode(newNode: any, node: any, parentNode: any): any;
export function removeNode(node: any, parentNode: any): any;
export const animationEvent: any;
export class Animator {
static configureDefault(container: any, animatorInstance: any): any;
Expand Down
76 changes: 46 additions & 30 deletions dist/aurelia-templating.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import {bindingMode,ObserverLocator,BindingExpression,Binding,ValueConverterReso
import {TaskQueue} from 'aurelia-task-queue';

let needsTemplateFixup = !('content' in document.createElement('template'));
let shadowPoly = window.ShadowDOMPolyfill || null;

export let DOMBoundary = 'aurelia-dom-boundary';

Expand All @@ -24,6 +25,31 @@ export function createTemplateFromMarkup(markup){
return temp;
}

export function replaceNode(newNode, node, parentNode){
if(node.parentNode){
node.parentNode.replaceChild(newNode, node);
}else if(shadowPoly){ //HACK: IE template element and shadow dom polyfills not quite right...
shadowPoly.unwrap(parentNode).replaceChild(
shadowPoly.unwrap(newNode),
shadowPoly.unwrap(node)
);
}else{ //HACK: same as above
parentNode.replaceChild(newNode, node);
}
}

export function removeNode(node, parentNode) {
if(node.parentNode){
node.parentNode.removeChild(node);
}else if(shadowPoly){ //HACK: IE template element and shadow dom polyfills not quite right...
shadowPoly.unwrap(parentNode).removeChild(
shadowPoly.unwrap(node)
);
}else{ //HACK: same as above
parentNode.removeChild(node);
}
}

export const animationEvent = {
enterBegin: 'animation:enter:begin',
enterActive: 'animation:enter:active',
Expand Down Expand Up @@ -994,7 +1020,7 @@ export class ViewSlot {
view = children[i];

for(j = 0; j < jj; ++j){
contentSelectors[j].removeAt(i, view.fragment);
contentSelectors[j].removeAt(0, view.fragment);
}
}

Expand Down Expand Up @@ -1260,7 +1286,6 @@ export class ViewFactory{
contentSelectors = [],
containers = { root:container },
partReplacements = options.partReplacements,
domBoundary = container.get(DOMBoundary),
i, ii, view, instructable, instruction;

if(element !== null && this.surrogateInstruction !== null){
Expand All @@ -1271,8 +1296,6 @@ export class ViewFactory{
instructable = instructables[i];
instruction = instructions[instructable.getAttribute('au-target-id')];

instructable.domBoundary = domBoundary;

applyInstructions(containers, executionContext, instructable,
instruction, behaviors, bindings, children, contentSelectors, partReplacements, resources);
}
Expand Down Expand Up @@ -2360,18 +2383,7 @@ export class HtmlBehaviorResource {
part = node.getAttribute('part');

node.removeAttribute(instruction.originalAttrName);

if(node.parentNode){
node.parentNode.replaceChild(template, node);
}else if(window.ShadowDOMPolyfill){ //HACK: IE template element and shadow dom polyfills not quite right...
ShadowDOMPolyfill.unwrap(parentNode).replaceChild(
ShadowDOMPolyfill.unwrap(template),
ShadowDOMPolyfill.unwrap(node)
);
}else{ //HACK: same as above
parentNode.replaceChild(template, node);
}

replaceNode(template, node, parentNode);
fragment.appendChild(node);
instruction.viewFactory = compiler.compile(fragment, resources);

Expand All @@ -2386,39 +2398,42 @@ export class HtmlBehaviorResource {
var partReplacements = instruction.partReplacements = {};

if(this.processContent(compiler, resources, node, instruction) && node.hasChildNodes()){
instruction.skipContentProcessing = false;

if(!this.usesShadowDOM){
var fragment = document.createDocumentFragment(),
currentChild = node.firstChild,
nextSibling;
if(this.usesShadowDOM){
var currentChild = node.firstChild,
nextSibling, toReplace;

while (currentChild) {
nextSibling = currentChild.nextSibling;

if(currentChild.tagName === 'TEMPLATE' && (toReplace = currentChild.getAttribute('replace-part'))){
partReplacements[toReplace] = compiler.compile(currentChild, resources);
}else{
fragment.appendChild(currentChild);
removeNode(currentChild, parentNode);
}

currentChild = nextSibling;
}

instruction.contentFactory = compiler.compile(fragment, resources);
instruction.skipContentProcessing = false;
}else{
var currentChild = node.firstChild,
nextSibling, toReplace;
var fragment = document.createDocumentFragment(),
currentChild = node.firstChild,
nextSibling;

while (currentChild) {
nextSibling = currentChild.nextSibling;

if(currentChild.tagName === 'TEMPLATE' && (toReplace = currentChild.getAttribute('replace-part'))){
partReplacements[toReplace] = compiler.compile(currentChild, resources);
removeNode(currentChild, parentNode);
}else{
fragment.appendChild(currentChild);
}

currentChild = nextSibling;
}

instruction.contentFactory = compiler.compile(fragment, resources);
instruction.skipContentProcessing = true;
}
}else{
instruction.skipContentProcessing = true;
Expand All @@ -2435,12 +2450,13 @@ export class HtmlBehaviorResource {
if(this.elementName !== null && element){
if(this.usesShadowDOM) {
host = element.createShadowRoot();
container.registerInstance(DOMBoundary, host);
}else{
host = element;
}

if(instruction.anchorIsContainer){
container.registerInstance(DOMBoundary, host);
if(this.targetShadowDOM){
container.registerInstance(DOMBoundary, host);
}
}
}

Expand Down
2 changes: 2 additions & 0 deletions dist/commonjs/aurelia-templating.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ declare module 'aurelia-templating' {
import * as LogManager from 'aurelia-logging';
export let DOMBoundary: any;
export function createTemplateFromMarkup(markup: any): any;
export function replaceNode(newNode: any, node: any, parentNode: any): any;
export function removeNode(node: any, parentNode: any): any;
export const animationEvent: any;
export class Animator {
static configureDefault(container: any, animatorInstance: any): any;
Expand Down
Loading

0 comments on commit 90be763

Please sign in to comment.