From db5750ca16d9cc06cf49bdaa598f4d08997d45c1 Mon Sep 17 00:00:00 2001 From: chris Date: Tue, 29 Apr 2025 11:08:46 +0200 Subject: [PATCH] REFA: changed extStore setup --- src/component/Component.js | 3 --- src/component/addStyleAndFunctions.js | 13 ------------- src/generators/generator.js | 11 ++++++++--- 3 files changed, 8 insertions(+), 19 deletions(-) diff --git a/src/component/Component.js b/src/component/Component.js index a20d272..e4edbee 100644 --- a/src/component/Component.js +++ b/src/component/Component.js @@ -420,9 +420,6 @@ class Component extends StyleAndScriptStoringComponent { let _wenity = new WebTrinity(); - if (!styleStore) { - styleStore = this._stylesExtStore; - } /* DEAL WITH COMPONENT MODIFICATION FIRST */ // @todo pay attention to the "overwrite" behaviour - the local modifier styles are the "closest" diff --git a/src/component/addStyleAndFunctions.js b/src/component/addStyleAndFunctions.js index 0b8b8ce..297fa6a 100644 --- a/src/component/addStyleAndFunctions.js +++ b/src/component/addStyleAndFunctions.js @@ -45,23 +45,10 @@ class StyleAndScriptStoringComponent extends ModifiableComponent { constructor(element, attr = {}) { super(element, attr); - this._styleClassesExtStore = ExtStoreType.CENTRALIZED_DOC_HEAD - .setOverwriteBehaviour(OverwriteBehaviour.REPLACE); - this._isClassESDefault = true; - - this._stylesExtStore = ExtStoreType.INTERNALIZED_WITHIN - .setOverwriteBehaviour(OverwriteBehaviour.REPLACE); - this._isStyleESDefault = true; - this._styles = []; - - this._functionsExtStore = ExtStoreType.CENTRALIZED_DOC_HEAD - .setOverwriteBehaviour(OverwriteBehaviour.REPLACE); - this._isFunESDefault = true; - this._functions = []; } diff --git a/src/generators/generator.js b/src/generators/generator.js index 5b9a02c..919592e 100644 --- a/src/generators/generator.js +++ b/src/generators/generator.js @@ -15,10 +15,15 @@ */ class CompelGenerator { /** - * @param {null} [styleStore=null] - * @param {null} [functionStore=null] + * @param {ExtStorage} styleStore default ExtStoreType.INTERNALIZED_WITHIN + * @param {ExtStorage} functionStore default ExtStoreType.CENTRALIZED_DOC_HEAD */ - constructor(styleStore = null, functionStore = null) { + constructor( + styleStore = ExtStoreType.INTERNALIZED_WITHIN + .setOverwriteBehaviour(OverwriteBehaviour.REPLACE), + functionStore = ExtStoreType.CENTRALIZED_DOC_HEAD + .setOverwriteBehaviour(OverwriteBehaviour.REPLACE) + ) { this._styleStore = styleStore; this._functionStore = functionStore; }