@elementor/editor-variables 4.2.0-878 → 4.2.0-880

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.mjs CHANGED
@@ -649,13 +649,17 @@ var inheritanceTransformer = createTransformer((id2) => {
649
649
  });
650
650
 
651
651
  // src/transformers/variable-transformer.ts
652
- import { createTransformer as createTransformer2 } from "@elementor/editor-canvas";
653
- var variableTransformer = createTransformer2((idOrLabel) => {
652
+ import { createTransformer as createTransformer2, formatGridTrackRepeat, isGridTrackProperty } from "@elementor/editor-canvas";
653
+ var variableTransformer = createTransformer2((idOrLabel, { key }) => {
654
654
  const variables = service.variables();
655
655
  const targetVariable = variables[idOrLabel] || service.findVariableByLabel(idOrLabel);
656
656
  if (!targetVariable) {
657
657
  return null;
658
658
  }
659
+ if (isGridTrackProperty(key)) {
660
+ const count = parseInt((targetVariable.value ?? "").trim(), 10);
661
+ return formatGridTrackRepeat(count);
662
+ }
659
663
  const id2 = service.findIdByLabel(targetVariable.label);
660
664
  return resolveCssVariable(id2, targetVariable);
661
665
  });
@@ -4692,17 +4696,16 @@ function init() {
4692
4696
  priority: 40,
4693
4697
  useProps: usePropVariableAction
4694
4698
  });
4695
- service.init().then(() => {
4696
- const variablesMcpRegistry = getMCPByDomain("variables", {
4697
- instructions: `Everything related to V4 ( Atomic ) variables.
4699
+ service.init();
4700
+ const variablesMcpRegistry = getMCPByDomain("variables", {
4701
+ instructions: `Everything related to V4 ( Atomic ) variables.
4698
4702
  # Global variables
4699
4703
  - Create/update/delete global variables
4700
4704
  - Get list of global variables
4701
4705
  - Get details of a global variable
4702
4706
  `
4703
- });
4704
- initMcp(variablesMcpRegistry, getMCPByDomain("canvas"));
4705
4707
  });
4708
+ initMcp(variablesMcpRegistry, getMCPByDomain("canvas"));
4706
4709
  injectIntoTop({
4707
4710
  id: "canvas-style-variables-render",
4708
4711
  component: StyleVariablesRenderer