@endorphinjs/template-runtime
Advanced tools
Comparing version 0.6.3 to 0.6.4
@@ -14,1 +14,2 @@ import { Injector, Block } from './injector'; | ||
export declare function unmountBlock(block: FunctionBlock): void; | ||
export declare function clearBlock(block: FunctionBlock): void; |
@@ -48,4 +48,7 @@ import { LinkedList, LinkedListItem } from './linked-list'; | ||
* Empties content of given block | ||
* @param detached Empty block in detached state. Detached state means one of the | ||
* parent DOM element will be removed from document so there’s no need to detach | ||
* inner DOM elements | ||
*/ | ||
export declare function emptyBlockContent<T extends Block>(block: T): void; | ||
export declare function emptyBlockContent<T extends Block>(block: T, detached?: boolean): void; | ||
/** | ||
@@ -58,3 +61,3 @@ * Moves contents of `block` after `ref` list item | ||
*/ | ||
export declare function disposeBlock(block: Block): void; | ||
export declare function disposeBlock(block: Block, detached?: boolean): void; | ||
export {}; |
@@ -19,2 +19,3 @@ import { Injector, Block } from './injector'; | ||
export declare function unmountInnerHTML(block: InnerHtmlBlock): void; | ||
export declare function clearInnerHTML(block: InnerHtmlBlock): void; | ||
export {}; |
@@ -23,2 +23,3 @@ import { Injector, Block } from './injector'; | ||
export declare function unmountIterator(block: IteratorBlock): void; | ||
export declare function clearIterator(block: IteratorBlock): void; | ||
export declare function prepareScope(scope: Scope, index: number, key: any, value: any): Scope; |
@@ -30,2 +30,3 @@ import { Injector, Block } from './injector'; | ||
export declare function unmountKeyIterator(block: KeyIteratorBlock): void; | ||
export declare function clearKeyIterator(block: KeyIteratorBlock): void; | ||
export {}; |
@@ -26,2 +26,3 @@ import { Injector, Block } from './injector'; | ||
export declare function unmountPartial(block: PartialBlock): void; | ||
export declare function clearPartial(block: PartialBlock): void; | ||
export {}; |
@@ -687,4 +687,7 @@ /** | ||
* Empties content of given block | ||
* @param detached Empty block in detached state. Detached state means one of the | ||
* parent DOM element will be removed from document so there’s no need to detach | ||
* inner DOM elements | ||
*/ | ||
function emptyBlockContent(block) { | ||
function emptyBlockContent(block, detached) { | ||
const unmount = block.mount && block.mount.dispose; | ||
@@ -702,3 +705,3 @@ if (unmount) { | ||
} | ||
else if (!value[animatingKey]) { | ||
else if (!detached && !value[animatingKey]) { | ||
domRemove(value); | ||
@@ -744,4 +747,4 @@ } | ||
*/ | ||
function disposeBlock(block) { | ||
emptyBlockContent(block); | ||
function disposeBlock(block, detached) { | ||
emptyBlockContent(block, detached); | ||
listDetachFragment(block.injector, block.start, block.end); | ||
@@ -1352,2 +1355,5 @@ // @ts-ignore: Nulling disposed object | ||
} | ||
function clearBlock(block) { | ||
disposeBlock(block, true); | ||
} | ||
@@ -1391,2 +1397,5 @@ /** | ||
} | ||
function clearIterator(block) { | ||
disposeBlock(block, true); | ||
} | ||
function prepareScope(scope, index, key, value) { | ||
@@ -1482,5 +1491,3 @@ scope.index = index; | ||
if (collection && typeof collection.forEach === 'function') { | ||
const prevScope = getScope(host); | ||
collection.forEach(keyIterator, block); | ||
setScope(host, prevScope); | ||
} | ||
@@ -1502,2 +1509,5 @@ if (rendered) { | ||
} | ||
function clearKeyIterator(block) { | ||
disposeBlock(block, true); | ||
} | ||
function getItem(listItem, bound) { | ||
@@ -1672,2 +1682,5 @@ return listItem !== bound ? listItem.value : null; | ||
} | ||
function clearInnerHTML(block) { | ||
disposeBlock(block, true); | ||
} | ||
function renderHTML(host, injector, code, slotName) { | ||
@@ -1773,2 +1786,5 @@ const { cssScope } = host.componentModel.definition; | ||
} | ||
function clearPartial(block) { | ||
disposeBlock(block, true); | ||
} | ||
@@ -2163,3 +2179,3 @@ const prefix = '$'; | ||
export default endorphin; | ||
export { Store, addClass, addClassIf, addEvent, addPendingClass, addPendingClassIf, animate, appendChild, assign, attributeSet, call, classNames, composeTween, createAnimation, createComponent, createComponentFromElement, createInjector, createScope, createSlot, cssAnimate, detachPendingEvents, disposeBlock, domInsert, domRemove, elem, elemNS, elemNSWithText, elemWithText, emptyBlockContent, enterScope, exitScope, filter, finalizeAttributes, finalizeAttributesNS, finalizePendingEvents, finalizePendingRefs, find, get, getPartial, getProp, getScope, getSlotContext, getState, getVar, injectBlock, insert, isolateElement, mountBlock, mountComponent, mountInnerHTML, mountIterator, mountKeyIterator, mountPartial, mountSlot, move, notifySlotUpdate, obj, pendingEvents, prepareScope, propsSet, removeEvent, removeRef, renderComponent, safeEventListener, scheduleRender, setAttribute, setAttributeExpression, setAttributeExpressionNS, setAttributeNS, setClass, setPendingAttribute, setPendingAttributeNS, setPendingEvent, setPendingRef, setRef, setScope, setVar, stopAnimation, subscribeStore, text, toggleClassIf, tweenAnimate, unmountBlock, unmountComponent, unmountInnerHTML, unmountIterator, unmountKeyIterator, unmountPartial, unmountSlot, updateAttribute, updateAttributeExpression, updateAttributeExpressionNS, updateAttributeNS, updateBlock, updateClass, updateComponent, updateDefaultSlot, updateIncomingSlot, updateInnerHTML, updateIterator, updateKeyIterator, updatePartial, updatePendingAttribute, updatePendingAttributeNS, updateText }; | ||
export { Store, addClass, addClassIf, addEvent, addPendingClass, addPendingClassIf, animate, appendChild, assign, attributeSet, call, classNames, clearBlock, clearInnerHTML, clearIterator, clearKeyIterator, clearPartial, composeTween, createAnimation, createComponent, createComponentFromElement, createInjector, createScope, createSlot, cssAnimate, detachPendingEvents, disposeBlock, domInsert, domRemove, elem, elemNS, elemNSWithText, elemWithText, emptyBlockContent, enterScope, exitScope, filter, finalizeAttributes, finalizeAttributesNS, finalizePendingEvents, finalizePendingRefs, find, get, getPartial, getProp, getScope, getSlotContext, getState, getVar, injectBlock, insert, isolateElement, mountBlock, mountComponent, mountInnerHTML, mountIterator, mountKeyIterator, mountPartial, mountSlot, move, notifySlotUpdate, obj, pendingEvents, prepareScope, propsSet, removeEvent, removeRef, renderComponent, safeEventListener, scheduleRender, setAttribute, setAttributeExpression, setAttributeExpressionNS, setAttributeNS, setClass, setPendingAttribute, setPendingAttributeNS, setPendingEvent, setPendingRef, setRef, setScope, setVar, stopAnimation, subscribeStore, text, toggleClassIf, tweenAnimate, unmountBlock, unmountComponent, unmountInnerHTML, unmountIterator, unmountKeyIterator, unmountPartial, unmountSlot, updateAttribute, updateAttributeExpression, updateAttributeExpressionNS, updateAttributeNS, updateBlock, updateClass, updateComponent, updateDefaultSlot, updateIncomingSlot, updateInnerHTML, updateIterator, updateKeyIterator, updatePartial, updatePendingAttribute, updatePendingAttributeNS, updateText }; | ||
//# sourceMappingURL=runtime.es.js.map |
{ | ||
"name": "@endorphinjs/template-runtime", | ||
"version": "0.6.3", | ||
"version": "0.6.4", | ||
"description": "EndorphinJS template runtime, embedded with template bundles", | ||
@@ -26,3 +26,3 @@ "main": "./dist/runtime.cjs.js", | ||
"devDependencies": { | ||
"@endorphinjs/template-compiler": "^0.6.0", | ||
"@endorphinjs/template-compiler": "^0.6.4", | ||
"@types/mocha": "^5.2.7", | ||
@@ -53,3 +53,3 @@ "@types/node": "^12.11.1", | ||
}, | ||
"gitHead": "c90237d77fa6a86fc0c004a4116e3877b7757e13" | ||
"gitHead": "5fc6942a7493e3d9a315450b47b234e24aea44ee" | ||
} |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
449476
5346