@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.js CHANGED
@@ -674,12 +674,16 @@ var inheritanceTransformer = (0, import_editor_canvas.createTransformer)((id2) =
674
674
 
675
675
  // src/transformers/variable-transformer.ts
676
676
  var import_editor_canvas2 = require("@elementor/editor-canvas");
677
- var variableTransformer = (0, import_editor_canvas2.createTransformer)((idOrLabel) => {
677
+ var variableTransformer = (0, import_editor_canvas2.createTransformer)((idOrLabel, { key }) => {
678
678
  const variables = service.variables();
679
679
  const targetVariable = variables[idOrLabel] || service.findVariableByLabel(idOrLabel);
680
680
  if (!targetVariable) {
681
681
  return null;
682
682
  }
683
+ if ((0, import_editor_canvas2.isGridTrackProperty)(key)) {
684
+ const count = parseInt((targetVariable.value ?? "").trim(), 10);
685
+ return (0, import_editor_canvas2.formatGridTrackRepeat)(count);
686
+ }
683
687
  const id2 = service.findIdByLabel(targetVariable.label);
684
688
  return resolveCssVariable(id2, targetVariable);
685
689
  });
@@ -4672,17 +4676,16 @@ function init() {
4672
4676
  priority: 40,
4673
4677
  useProps: usePropVariableAction
4674
4678
  });
4675
- service.init().then(() => {
4676
- const variablesMcpRegistry = (0, import_editor_mcp2.getMCPByDomain)("variables", {
4677
- instructions: `Everything related to V4 ( Atomic ) variables.
4679
+ service.init();
4680
+ const variablesMcpRegistry = (0, import_editor_mcp2.getMCPByDomain)("variables", {
4681
+ instructions: `Everything related to V4 ( Atomic ) variables.
4678
4682
  # Global variables
4679
4683
  - Create/update/delete global variables
4680
4684
  - Get list of global variables
4681
4685
  - Get details of a global variable
4682
4686
  `
4683
- });
4684
- initMcp(variablesMcpRegistry, (0, import_editor_mcp2.getMCPByDomain)("canvas"));
4685
4687
  });
4688
+ initMcp(variablesMcpRegistry, (0, import_editor_mcp2.getMCPByDomain)("canvas"));
4686
4689
  (0, import_editor.injectIntoTop)({
4687
4690
  id: "canvas-style-variables-render",
4688
4691
  component: StyleVariablesRenderer