@elementor/editor-editing-panel 3.33.0-162 → 3.33.0-163
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/index.js +52 -3
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +54 -5
- package/dist/index.mjs.map +1 -1
- package/package.json +19 -19
- package/src/components/custom-css-indicator.tsx +68 -1
package/dist/index.js
CHANGED
|
@@ -2314,7 +2314,7 @@ function populateChildControlProps(props) {
|
|
|
2314
2314
|
var React88 = __toESM(require("react"));
|
|
2315
2315
|
var import_react37 = require("react");
|
|
2316
2316
|
var import_editor_props15 = require("@elementor/editor-props");
|
|
2317
|
-
var
|
|
2317
|
+
var import_editor_responsive4 = require("@elementor/editor-responsive");
|
|
2318
2318
|
var import_locations3 = require("@elementor/locations");
|
|
2319
2319
|
var import_session7 = require("@elementor/session");
|
|
2320
2320
|
var import_ui43 = require("@elementor/ui");
|
|
@@ -4320,13 +4320,62 @@ var import_i18n40 = require("@wordpress/i18n");
|
|
|
4320
4320
|
|
|
4321
4321
|
// src/components/custom-css-indicator.tsx
|
|
4322
4322
|
var React64 = __toESM(require("react"));
|
|
4323
|
+
var import_editor_responsive3 = require("@elementor/editor-responsive");
|
|
4324
|
+
var import_editor_styles6 = require("@elementor/editor-styles");
|
|
4323
4325
|
var CustomCssIndicator = () => {
|
|
4324
4326
|
const { customCss } = useCustomCss();
|
|
4327
|
+
const { id: styleId, provider, meta } = useStyle();
|
|
4328
|
+
const {
|
|
4329
|
+
element: { id: elementId }
|
|
4330
|
+
} = useElement();
|
|
4331
|
+
const style = React64.useMemo(
|
|
4332
|
+
() => styleId && provider ? provider.actions.get(styleId, { elementId }) : null,
|
|
4333
|
+
[styleId, provider, elementId]
|
|
4334
|
+
);
|
|
4325
4335
|
const hasContent = Boolean(customCss?.raw?.trim());
|
|
4336
|
+
const hasInheritedContent = React64.useMemo(() => {
|
|
4337
|
+
if (hasContent) {
|
|
4338
|
+
return false;
|
|
4339
|
+
}
|
|
4340
|
+
return hasInheritedCustomCss(style, meta);
|
|
4341
|
+
}, [hasContent, style, meta]);
|
|
4326
4342
|
if (!hasContent) {
|
|
4343
|
+
if (hasInheritedContent) {
|
|
4344
|
+
return /* @__PURE__ */ React64.createElement(StyleIndicator, null);
|
|
4345
|
+
}
|
|
4327
4346
|
return null;
|
|
4328
4347
|
}
|
|
4329
|
-
return /* @__PURE__ */ React64.createElement(StyleIndicator, { getColor: (
|
|
4348
|
+
return /* @__PURE__ */ React64.createElement(StyleIndicator, { getColor: provider ? getStylesProviderThemeColor(provider.getKey()) : void 0 });
|
|
4349
|
+
};
|
|
4350
|
+
var hasInheritedCustomCss = (style, meta) => {
|
|
4351
|
+
if (!style || !meta) {
|
|
4352
|
+
return false;
|
|
4353
|
+
}
|
|
4354
|
+
const target = meta.breakpoint ?? "desktop";
|
|
4355
|
+
const root = (0, import_editor_responsive3.getBreakpointsTree)();
|
|
4356
|
+
const state = meta.state;
|
|
4357
|
+
function search(node, ancestorHasCss) {
|
|
4358
|
+
if (!style) {
|
|
4359
|
+
return void 0;
|
|
4360
|
+
}
|
|
4361
|
+
const hasHere = Boolean(
|
|
4362
|
+
(0, import_editor_styles6.getVariantByMeta)(style, {
|
|
4363
|
+
breakpoint: node.id,
|
|
4364
|
+
state
|
|
4365
|
+
})?.custom_css?.raw?.trim()
|
|
4366
|
+
);
|
|
4367
|
+
if (node.id === target) {
|
|
4368
|
+
return ancestorHasCss;
|
|
4369
|
+
}
|
|
4370
|
+
for (const child of node.children ?? []) {
|
|
4371
|
+
const res = search(child, ancestorHasCss || hasHere);
|
|
4372
|
+
if (res !== void 0) {
|
|
4373
|
+
return res;
|
|
4374
|
+
}
|
|
4375
|
+
}
|
|
4376
|
+
return void 0;
|
|
4377
|
+
}
|
|
4378
|
+
return Boolean(search(root, false));
|
|
4330
4379
|
};
|
|
4331
4380
|
|
|
4332
4381
|
// src/styles-inheritance/components/styles-inheritance-section-indicators.tsx
|
|
@@ -4874,7 +4923,7 @@ var StyleTab = () => {
|
|
|
4874
4923
|
const currentClassesProp = useCurrentClassesProp();
|
|
4875
4924
|
const [activeStyleDefId, setActiveStyleDefId] = useActiveStyleDefId(currentClassesProp);
|
|
4876
4925
|
const [activeStyleState, setActiveStyleState] = (0, import_react37.useState)(null);
|
|
4877
|
-
const breakpoint = (0,
|
|
4926
|
+
const breakpoint = (0, import_editor_responsive4.useActiveBreakpoint)();
|
|
4878
4927
|
return /* @__PURE__ */ React88.createElement(ClassesPropProvider, { prop: currentClassesProp }, /* @__PURE__ */ React88.createElement(
|
|
4879
4928
|
StyleProvider,
|
|
4880
4929
|
{
|