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) {
ensuredElement = element.generate().html;
ensuredElement = element.generate().compext;
}
switch (this._position) {

40
src/base/webTrinity.js

@ -2,16 +2,37 @@
* Wenity := Web Trinity
*/
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 {HTMLStyleElement|Map<ExtStorageType, Array<SStoreDefinition>} js
* @param {HTMLScriptElement|Array<SStoreDefinition>} css
* @param {HTMLElement|Component|string} compext := Component Text
* @param {HTMLStyleElement|Map<ExtStorageType, Array<SStoreDefinition>} scripts
* @param {HTMLScriptElement|Array<SStoreDefinition>} stylings
*/
constructor(html = null, js = null, css = null) {
this.html = html;
this.js = js;
this.css = css;
constructor(compext = null, scripts = null, stylings = null) {
this.compext = compext;
this.html = compext;
this.scripts = scripts;
this.js = scripts;
this.stylings = stylings;
this.css = stylings;
}
/**
@ -19,7 +40,10 @@ class WebTrinity {
* @returns {boolean}
*/
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);
}
}

2
src/builder.js

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

10
src/generators/generator.js

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

Loading…
Cancel
Save