@elementor/editor-editing-panel 3.33.0-102 → 3.33.0-104

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 CHANGED
@@ -5545,7 +5545,7 @@ function useResetStyleValueProps() {
5545
5545
  }
5546
5546
 
5547
5547
  // src/styles-inheritance/init-styles-inheritance-transformers.ts
5548
- var import_editor_canvas10 = require("@elementor/editor-canvas");
5548
+ var import_editor_canvas11 = require("@elementor/editor-canvas");
5549
5549
 
5550
5550
  // src/styles-inheritance/consts.ts
5551
5551
  var excludePropTypeTransformers = /* @__PURE__ */ new Set([
@@ -5665,9 +5665,33 @@ var backgroundOverlayTransformer = (0, import_editor_canvas9.createTransformer)(
5665
5665
  return /* @__PURE__ */ React100.createElement(import_ui52.Stack, { direction: "column" }, values.map((item, index) => /* @__PURE__ */ React100.createElement(import_ui52.Stack, { key: index }, item)));
5666
5666
  });
5667
5667
 
5668
+ // src/styles-inheritance/transformers/color-transformer.tsx
5669
+ var React101 = __toESM(require("react"));
5670
+ var import_editor_canvas10 = require("@elementor/editor-canvas");
5671
+ var import_ui53 = require("@elementor/ui");
5672
+ function isValidCSSColor(value) {
5673
+ if (!value.trim()) {
5674
+ return false;
5675
+ }
5676
+ return CSS.supports("color", value.trim());
5677
+ }
5678
+ var StyledColorIndicator = (0, import_ui53.styled)(import_ui53.UnstableColorIndicator)(({ theme }) => ({
5679
+ width: "1em",
5680
+ height: "1em",
5681
+ borderRadius: `${theme.shape.borderRadius / 2}px`,
5682
+ outline: `1px solid ${theme.palette.action.disabled}`,
5683
+ flexShrink: 0
5684
+ }));
5685
+ var colorTransformer = (0, import_editor_canvas10.createTransformer)((value) => {
5686
+ if (!isValidCSSColor(value)) {
5687
+ return value;
5688
+ }
5689
+ return /* @__PURE__ */ React101.createElement(import_ui53.Stack, { direction: "row", gap: 1, alignItems: "center" }, /* @__PURE__ */ React101.createElement(StyledColorIndicator, { size: "inherit", component: "span", value }), /* @__PURE__ */ React101.createElement("span", null, value));
5690
+ });
5691
+
5668
5692
  // src/styles-inheritance/init-styles-inheritance-transformers.ts
5669
5693
  function initStylesInheritanceTransformers() {
5670
- const originalStyleTransformers = import_editor_canvas10.styleTransformersRegistry.all();
5694
+ const originalStyleTransformers = import_editor_canvas11.styleTransformersRegistry.all();
5671
5695
  Object.entries(originalStyleTransformers).forEach(([propType, transformer]) => {
5672
5696
  if (excludePropTypeTransformers.has(propType)) {
5673
5697
  return;
@@ -5675,13 +5699,14 @@ function initStylesInheritanceTransformers() {
5675
5699
  stylesInheritanceTransformersRegistry.register(propType, transformer);
5676
5700
  });
5677
5701
  stylesInheritanceTransformersRegistry.registerFallback(
5678
- (0, import_editor_canvas10.createTransformer)((value) => {
5702
+ (0, import_editor_canvas11.createTransformer)((value) => {
5679
5703
  return value;
5680
5704
  })
5681
5705
  );
5682
5706
  registerCustomTransformers();
5683
5707
  }
5684
5708
  function registerCustomTransformers() {
5709
+ stylesInheritanceTransformersRegistry.register("color", colorTransformer);
5685
5710
  stylesInheritanceTransformersRegistry.register("background-color-overlay", backgroundColorOverlayTransformer);
5686
5711
  stylesInheritanceTransformersRegistry.register(
5687
5712
  "background-gradient-overlay",