Browse Source

REFA: renamed properties of WebTrinity

dev-feat-component_preview
chris 2 months ago
parent
commit
70e5d0d66f
  1. 2
      src/base/extStore.js
  2. 40
      src/base/webTrinity.js
  3. 2
      src/builder.js
  4. 10
      src/generators/generator.js

2
src/base/extStore.js

@ -359,7 +359,7 @@ class ExtStorage {
} }
if (element instanceof Component) { if (element instanceof Component) {
ensuredElement = element.generate().html; ensuredElement = element.generate().compext;
} }
switch (this._position) { switch (this._position) {

40
src/base/webTrinity.js

@ -2,16 +2,37 @@
* Wenity := Web Trinity * Wenity := Web Trinity
*/ */
class WebTrinity { class WebTrinity {
/**
* @deprecated renamed - use copext instead
* @type {HTMLElement|Component|string} = compext, for a migration period
*/
html;
/**
* @deprecated renamed - use scripts instead
* @type {HTMLStyleElement|Map<ExtStorageType, Array<SStoreDefinition>} = scripts, for a migration period
*/
js;
/**
* @deprecated renamed - use stylings instead
* @type {HTMLScriptElement|Array<SStoreDefinition>} = stylings, for a migration period
*/
css;
/** /**
* *
* @param {HTMLElement|Component} html * @param {HTMLElement|Component|string} compext := Component Text
* @param {HTMLStyleElement|Map<ExtStorageType, Array<SStoreDefinition>} js * @param {HTMLStyleElement|Map<ExtStorageType, Array<SStoreDefinition>} scripts
* @param {HTMLScriptElement|Array<SStoreDefinition>} css * @param {HTMLScriptElement|Array<SStoreDefinition>} stylings
*/ */
constructor(html = null, js = null, css = null) { constructor(compext = null, scripts = null, stylings = null) {
this.html = html; this.compext = compext;
this.js = js; this.html = compext;
this.css = css; this.scripts = scripts;
this.js = scripts;
this.stylings = stylings;
this.css = stylings;
} }
/** /**
@ -19,7 +40,10 @@ class WebTrinity {
* @returns {boolean} * @returns {boolean}
*/ */
isSSEmpty() { isSSEmpty() {
return (this.js === null || this.js.length === 0) return (this.scripts === null || this.scripts.length === 0)
&& (this.stylings === null || this.stylings.size === 0)
/* LEGACY CHECK */
&& (this.js === null || this.js.length === 0)
&& (this.css === null || this.css.size === 0); && (this.css === null || this.css.size === 0);
} }
} }

2
src/builder.js

@ -500,7 +500,7 @@ const builder = {
.arrangement(Arrangement.CENTER) .arrangement(Arrangement.CENTER)
.childContext(innerComponents) .childContext(innerComponents)
.generate() .generate()
.html .compext
); );
Page.generate(); Page.generate();
main.remove(); main.remove();

10
src/generators/generator.js

@ -32,7 +32,7 @@ class CompelGenerator {
processStyles(component, extStore = null) { processStyles(component, extStore = null) {
extStore = (extStore extStore = (extStore
? extStore ? extStore
: this._stylesExtStore : component._stylesExtStore
) )
.setupForGeneralStyling(); .setupForGeneralStyling();
@ -119,10 +119,10 @@ class CompelGenerator {
if (child instanceof HTMLElement) { if (child instanceof HTMLElement) {
console.log("No wenity set - htmlEl was given"); console.log("No wenity set - htmlEl was given");
childWT.html = component; childWT.compext = component;
} }
parent.append(childWT.html); parent.append(childWT.compext);
return childWT; return childWT;
} }
@ -222,9 +222,9 @@ class CompelGenerator {
let funcCollections = this.processFunctions(functionStore); let funcCollections = this.processFunctions(functionStore);
for (const child of childrenWenities) { for (const child of childrenWenities) {
if (child.js) { if (child.scripts) {
executeOnExtStoreTypeCollectedTriple( executeOnExtStoreTypeCollectedTriple(
(extstoretype) => transferCollectedFunctions(child.js, funcCollections, extstoretype) (extstoretype) => transferCollectedFunctions(child.scripts, funcCollections, extstoretype)
); );
} }
} }

Loading…
Cancel
Save