@jxsuite/studio 0.22.0 → 0.22.1
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/studio.js +7 -4
- package/dist/studio.js.map +3 -3
- package/package.json +4 -4
package/dist/studio.js
CHANGED
|
@@ -264509,6 +264509,8 @@ async function buildScope(doc, parentScope = {}, base2 = location.href) {
|
|
|
264509
264509
|
}
|
|
264510
264510
|
if (doc.$media) {
|
|
264511
264511
|
state["$media"] = doc.$media;
|
|
264512
|
+
} else if (!state["$media"] && Object.keys(_rootMedia).length > 0) {
|
|
264513
|
+
state["$media"] = _rootMedia;
|
|
264512
264514
|
}
|
|
264513
264515
|
return state;
|
|
264514
264516
|
}
|
|
@@ -264775,16 +264777,16 @@ function applyStyle2(el, styleDef, mediaQueries = {}, state = {}) {
|
|
|
264775
264777
|
const resolved = sel.startsWith("&") ? sel.replace("&", parentSel) : sel.startsWith("[") ? `${parentSel}${sel}` : sel.startsWith(":") || sel.startsWith(".") ? `${parentSel}${sel}` : `${parentSel} ${sel}`;
|
|
264776
264778
|
const props = toCSSText(sub);
|
|
264777
264779
|
if (props)
|
|
264778
|
-
css +=
|
|
264780
|
+
css += `${atRule} { ${resolved} { ${props} } }
|
|
264779
264781
|
`;
|
|
264780
264782
|
emitMediaNested(resolved, sub);
|
|
264781
264783
|
}
|
|
264782
264784
|
};
|
|
264783
264785
|
if (key === "@--")
|
|
264784
264786
|
continue;
|
|
264785
|
-
const
|
|
264787
|
+
const atRule = key.startsWith("@--") ? `@media ${mediaQueries[key.slice(1)] ?? key.slice(1)}` : key.startsWith("@(") ? `@media ${key.slice(1)}` : key;
|
|
264786
264788
|
const scope = `[data-jx="${uid}"]`;
|
|
264787
|
-
css +=
|
|
264789
|
+
css += `${atRule} { ${scope} { ${toCSSText(rules)} } }
|
|
264788
264790
|
`;
|
|
264789
264791
|
emitMediaNested(scope, rules);
|
|
264790
264792
|
}
|
|
@@ -265392,6 +265394,7 @@ function camelToKebab(s2) {
|
|
|
265392
265394
|
function toCSSText(rules) {
|
|
265393
265395
|
return Object.entries(rules).filter(([k, v]) => !isNestedSelector2(k) && (v === null || typeof v !== "object")).map(([p, v]) => `${camelToKebab(p)}: ${v}`).join("; ");
|
|
265394
265396
|
}
|
|
265397
|
+
var _rootMedia = {};
|
|
265395
265398
|
var _elementDefs = new Map;
|
|
265396
265399
|
async function registerElements(elements, base2) {
|
|
265397
265400
|
for (const entry of elements) {
|
|
@@ -308029,5 +308032,5 @@ effect(() => {
|
|
|
308029
308032
|
scheduleAutosave();
|
|
308030
308033
|
});
|
|
308031
308034
|
|
|
308032
|
-
//# debugId=
|
|
308035
|
+
//# debugId=1F44B1DD74CD205664756E2164756E21
|
|
308033
308036
|
//# sourceMappingURL=studio.js.map
|