|
@ -1,5 +1,5 @@ |
|
|
/** |
|
|
/** |
|
|
* This module defines the Component generator. |
|
|
* This class defines the Component generator. |
|
|
* It externalizes all decision making about script or style storage from the component. |
|
|
* It externalizes all decision making about script or style storage from the component. |
|
|
* The component stores the generator (if set, if not =default or passed down from parent component). |
|
|
* The component stores the generator (if set, if not =default or passed down from parent component). |
|
|
* The CompelGenerator class enables the setup/definition of storage, generation and distribution. |
|
|
* The CompelGenerator class enables the setup/definition of storage, generation and distribution. |
|
@ -13,7 +13,6 @@ |
|
|
* Therefore the usages of CompelGenerator-feature-logic resets all style and script storages to local. |
|
|
* Therefore the usages of CompelGenerator-feature-logic resets all style and script storages to local. |
|
|
* Only towards the end (when "generate()" is called) any of that will be resolved. |
|
|
* Only towards the end (when "generate()" is called) any of that will be resolved. |
|
|
*/ |
|
|
*/ |
|
|
|
|
|
|
|
|
class CompelGenerator { |
|
|
class CompelGenerator { |
|
|
/** |
|
|
/** |
|
|
* @param {null} [styleStore=null] |
|
|
* @param {null} [styleStore=null] |
|
@ -24,8 +23,11 @@ class CompelGenerator { |
|
|
this._functionStore = functionStore; |
|
|
this._functionStore = functionStore; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
/** |
|
|
|
|
|
* Deals with the direct component stylings |
|
|
* @param {Component} component |
|
|
* @param {Component} component |
|
|
|
|
|
* @param {Array<WebTrinity>} childrenWenity |
|
|
* @param {ExtStorage} extStore |
|
|
* @param {ExtStorage} extStore |
|
|
* @returns {Array<SStoreDefinition>} |
|
|
* @returns {Array<SStoreDefinition>} |
|
|
*/ |
|
|
*/ |
|
@ -63,8 +65,12 @@ class CompelGenerator { |
|
|
return forCollection; |
|
|
return forCollection; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
/** |
|
|
|
|
|
* First deals with the scripts/functions. |
|
|
* |
|
|
* |
|
|
|
|
|
* @param {Component} component |
|
|
|
|
|
* @param {Array<WebTrinity>} childrenWenity |
|
|
* @param {ExtStorage} extStore |
|
|
* @param {ExtStorage} extStore |
|
|
* @returns {Array<SStoreDefinition>} |
|
|
* @returns {Array<SStoreDefinition>} |
|
|
*/ |
|
|
*/ |
|
@ -127,7 +133,14 @@ class CompelGenerator { |
|
|
return childWT; |
|
|
return childWT; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
/** |
|
|
|
|
|
* Iterates over the children of the component |
|
|
|
|
|
* and calls generate on each child. |
|
|
|
|
|
* The resulting compext (the text of the component) is added/appended accordingly. |
|
|
|
|
|
* If the generation returns with delegatable scripts or styles |
|
|
|
|
|
* the WebTrinity object is collected in an array, |
|
|
|
|
|
* which will be returned. |
|
|
* |
|
|
* |
|
|
* @param {Component} component |
|
|
* @param {Component} component |
|
|
* @returns {Array<WebTrinity>} |
|
|
* @returns {Array<WebTrinity>} |
|
|