@genesislcap/foundation-utils 14.284.2 → 14.284.3-alpha-fa8a336.0
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.
- package/dist/dts/styles/dom.d.ts.map +1 -1
- package/dist/esm/styles/dom.js +23 -8
- package/package.json +10 -10
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dom.d.ts","sourceRoot":"","sources":["../../../src/styles/dom.ts"],"names":[],"mappings":"AAEA;;;;;;;GAOG;AACH,eAAO,MAAM,qBAAqB,YAAa,MAAM,kBAAkB,MAAM,KAAG,CAAC,MAAM,IAAI,
|
|
1
|
+
{"version":3,"file":"dom.d.ts","sourceRoot":"","sources":["../../../src/styles/dom.ts"],"names":[],"mappings":"AAEA;;;;;;;GAOG;AACH,eAAO,MAAM,qBAAqB,YAAa,MAAM,kBAAkB,MAAM,KAAG,CAAC,MAAM,IAAI,CAyC1F,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,kBAAkB,SAAU,MAAM,SAQ9C,CAAC"}
|
package/dist/esm/styles/dom.js
CHANGED
|
@@ -20,14 +20,29 @@ export const insertDocumentCSSRule = (cssRule, styleElementId) => {
|
|
|
20
20
|
styleElement = document.createElement('style');
|
|
21
21
|
styleElement.id = styleElementId;
|
|
22
22
|
headElement.appendChild(styleElement);
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
23
|
+
// Check if the CSS rule contains multiple rules (contains multiple closing braces)
|
|
24
|
+
const ruleCount = (cssRule.match(/}/g) || []).length;
|
|
25
|
+
if (ruleCount > 1) {
|
|
26
|
+
// Multiple rules: use textContent to avoid insertRule limitations
|
|
27
|
+
styleElement.textContent = cssRule;
|
|
28
|
+
return () => {
|
|
29
|
+
if (!styleElement) {
|
|
30
|
+
return;
|
|
31
|
+
}
|
|
32
|
+
headElement.removeChild(styleElement);
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
else {
|
|
36
|
+
// Single rule: use insertRule for consistency with existing behavior
|
|
37
|
+
const styleIndex = styleElement.sheet.insertRule(cssRule);
|
|
38
|
+
return () => {
|
|
39
|
+
if (!styleElement) {
|
|
40
|
+
return;
|
|
41
|
+
}
|
|
42
|
+
styleElement.sheet.deleteRule(styleIndex);
|
|
43
|
+
headElement.removeChild(styleElement);
|
|
44
|
+
};
|
|
45
|
+
}
|
|
31
46
|
};
|
|
32
47
|
/**
|
|
33
48
|
* Inserts a CSS link into the document if it doesn't already exist.
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@genesislcap/foundation-utils",
|
|
3
3
|
"description": "Genesis Foundation Utils",
|
|
4
|
-
"version": "14.284.
|
|
4
|
+
"version": "14.284.3-alpha-fa8a336.0",
|
|
5
5
|
"sideEffects": false,
|
|
6
6
|
"license": "SEE LICENSE IN license.txt",
|
|
7
7
|
"main": "dist/esm/index.js",
|
|
@@ -27,19 +27,19 @@
|
|
|
27
27
|
}
|
|
28
28
|
},
|
|
29
29
|
"devDependencies": {
|
|
30
|
-
"@genesislcap/foundation-testing": "14.284.
|
|
31
|
-
"@genesislcap/genx": "14.284.
|
|
32
|
-
"@genesislcap/rollup-builder": "14.284.
|
|
33
|
-
"@genesislcap/ts-builder": "14.284.
|
|
34
|
-
"@genesislcap/uvu-playwright-builder": "14.284.
|
|
35
|
-
"@genesislcap/vite-builder": "14.284.
|
|
36
|
-
"@genesislcap/webpack-builder": "14.284.
|
|
30
|
+
"@genesislcap/foundation-testing": "14.284.3-alpha-fa8a336.0",
|
|
31
|
+
"@genesislcap/genx": "14.284.3-alpha-fa8a336.0",
|
|
32
|
+
"@genesislcap/rollup-builder": "14.284.3-alpha-fa8a336.0",
|
|
33
|
+
"@genesislcap/ts-builder": "14.284.3-alpha-fa8a336.0",
|
|
34
|
+
"@genesislcap/uvu-playwright-builder": "14.284.3-alpha-fa8a336.0",
|
|
35
|
+
"@genesislcap/vite-builder": "14.284.3-alpha-fa8a336.0",
|
|
36
|
+
"@genesislcap/webpack-builder": "14.284.3-alpha-fa8a336.0",
|
|
37
37
|
"@types/json-schema": "^7.0.11",
|
|
38
38
|
"rimraf": "^5.0.0"
|
|
39
39
|
},
|
|
40
40
|
"dependencies": {
|
|
41
41
|
"@genesislcap/expression-builder": "14.258.1",
|
|
42
|
-
"@genesislcap/foundation-logger": "14.284.
|
|
42
|
+
"@genesislcap/foundation-logger": "14.284.3-alpha-fa8a336.0",
|
|
43
43
|
"@microsoft/fast-components": "2.30.6",
|
|
44
44
|
"@microsoft/fast-element": "1.14.0",
|
|
45
45
|
"@microsoft/fast-foundation": "2.49.6",
|
|
@@ -57,5 +57,5 @@
|
|
|
57
57
|
"access": "public"
|
|
58
58
|
},
|
|
59
59
|
"customElements": "dist/custom-elements.json",
|
|
60
|
-
"gitHead": "
|
|
60
|
+
"gitHead": "8083c650976e738471269df95a096b27781c942b"
|
|
61
61
|
}
|