@vectoriox/iox-builder 1.4.25 → 1.4.26
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -2007,6 +2007,7 @@ class StyleRegistryService {
|
|
|
2007
2007
|
this.changes$ = new Subject();
|
|
2008
2008
|
this.rules = new Map();
|
|
2009
2009
|
this.styleEl = null;
|
|
2010
|
+
this._flushPending = false;
|
|
2010
2011
|
}
|
|
2011
2012
|
/**
|
|
2012
2013
|
* Properties that must live on the OUTER wrapper (.iox-outer-{id}) because they
|
|
@@ -2150,15 +2151,21 @@ class StyleRegistryService {
|
|
|
2150
2151
|
return str.replace(/[A-Z]/g, m => `-${m.toLowerCase()}`);
|
|
2151
2152
|
}
|
|
2152
2153
|
flush() {
|
|
2153
|
-
if (!this.styleEl)
|
|
2154
|
+
if (!this.styleEl || this._flushPending)
|
|
2154
2155
|
return;
|
|
2155
|
-
|
|
2156
|
-
|
|
2157
|
-
|
|
2158
|
-
.
|
|
2159
|
-
|
|
2160
|
-
|
|
2161
|
-
|
|
2156
|
+
this._flushPending = true;
|
|
2157
|
+
requestAnimationFrame(() => {
|
|
2158
|
+
this._flushPending = false;
|
|
2159
|
+
if (!this.styleEl)
|
|
2160
|
+
return;
|
|
2161
|
+
// __tokens__ always first so variables are available to all subsequent rules
|
|
2162
|
+
const tokenBlock = this.rules.get('__tokens__');
|
|
2163
|
+
const rest = Array.from(this.rules.entries())
|
|
2164
|
+
.filter(([k]) => k !== '__tokens__')
|
|
2165
|
+
.map(([, v]) => v);
|
|
2166
|
+
this.styleEl.textContent = [tokenBlock, ...rest].filter(Boolean).join('\n');
|
|
2167
|
+
this.changes$.next();
|
|
2168
|
+
});
|
|
2162
2169
|
}
|
|
2163
2170
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.11", ngImport: i0, type: StyleRegistryService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
2164
2171
|
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.11", ngImport: i0, type: StyleRegistryService }); }
|