@elementor/editor-variables 4.1.0-825 → 4.1.0-827

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
@@ -1,17 +1,211 @@
1
- // src/init.ts
2
- import { injectIntoLogic, injectIntoTop } from "@elementor/editor";
3
- import { registerControlReplacement } from "@elementor/editor-controls";
4
- import { getMCPByDomain } from "@elementor/editor-mcp";
5
- import { __registerPanel as registerPanel } from "@elementor/editor-panels";
6
- import { isTransformable as isTransformable2 } from "@elementor/editor-props";
7
- import { controlActionsMenu } from "@elementor/menus";
1
+ // src/components/variables-manager/variables-manager-panel.tsx
2
+ import * as React14 from "react";
3
+ import { useCallback as useCallback6, useEffect as useEffect3, useMemo as useMemo3, useState as useState6 } from "react";
4
+ import { useSuppressedMessage } from "@elementor/editor-current-user";
5
+ import {
6
+ __createPanel as createPanel,
7
+ Panel,
8
+ PanelBody,
9
+ PanelFooter,
10
+ PanelHeader,
11
+ PanelHeaderTitle
12
+ } from "@elementor/editor-panels";
13
+ import { ConfirmationDialog as ConfirmationDialog2, SaveChangesDialog, SearchField, ThemeProvider, useDialog } from "@elementor/editor-ui";
14
+ import { changeEditMode } from "@elementor/editor-v1-adapters";
15
+ import { AlertTriangleFilledIcon as AlertTriangleFilledIcon2, ColorFilterIcon, CopyIcon, TrashIcon } from "@elementor/icons";
16
+ import {
17
+ Alert,
18
+ AlertAction,
19
+ AlertTitle,
20
+ Box as Box2,
21
+ Button as Button2,
22
+ CloseButton,
23
+ Divider,
24
+ Infotip,
25
+ Stack as Stack6,
26
+ usePopupState as usePopupState2
27
+ } from "@elementor/ui";
28
+ import { __ as __10 } from "@wordpress/i18n";
8
29
 
9
- // src/components/global-styles-import-listener.tsx
10
- import { useEffect } from "react";
11
- import { GLOBAL_STYLES_IMPORTED_EVENT } from "@elementor/editor-canvas";
30
+ // src/utils/tracking.ts
31
+ import { getMixpanel } from "@elementor/events";
32
+ var trackVariableEvent = ({ varType, controlPath, action }) => {
33
+ const { dispatchEvent, config } = getMixpanel();
34
+ if (!config?.names?.variables?.[action]) {
35
+ return;
36
+ }
37
+ const name = config.names.variables[action];
38
+ dispatchEvent?.(name, {
39
+ location: config?.locations?.variables || "",
40
+ secondaryLocation: config?.secondaryLocations?.variablesPopover || "",
41
+ trigger: config?.triggers?.click || "",
42
+ var_type: varType,
43
+ control_path: controlPath,
44
+ action_type: name
45
+ });
46
+ };
47
+ var trackVariablesManagerEvent = ({ action, varType, controlPath }) => {
48
+ const { dispatchEvent, config } = getMixpanel();
49
+ if (!config?.names?.variables?.[action]) {
50
+ return;
51
+ }
52
+ const name = config.names.variables[action];
53
+ const eventData = {
54
+ location: config?.locations?.variablesManager || "",
55
+ trigger: config?.triggers?.click || "",
56
+ action_type: name
57
+ };
58
+ if (varType) {
59
+ eventData.var_type = varType;
60
+ }
61
+ if (controlPath) {
62
+ eventData.style_control_path = controlPath;
63
+ }
64
+ dispatchEvent?.(name, eventData);
65
+ };
66
+ var trackVariableSyncToV3 = ({ variableLabel, action }) => {
67
+ try {
68
+ const { dispatchEvent, config } = getMixpanel();
69
+ if (!config?.names?.variables?.variableSyncToV3) {
70
+ return;
71
+ }
72
+ const name = config.names.variables.variableSyncToV3;
73
+ const isSync = action === "sync";
74
+ dispatchEvent?.(name, {
75
+ interaction_type: "click",
76
+ target_type: variableLabel,
77
+ target_name: isSync ? "sync_to_v3" : "unsync_to_v3",
78
+ interaction_result: isSync ? "var_is_synced_to_V3" : "var_is_unsynced_from_V3",
79
+ target_location: "widget_panel",
80
+ location_l1: "var_manager",
81
+ interaction_description: isSync ? `user_synced_${variableLabel}_to_v3` : `user_unsync_${variableLabel}_from_v3`
82
+ });
83
+ } catch {
84
+ }
85
+ };
86
+
87
+ // src/utils/validations.ts
88
+ import { AlertTriangleFilledIcon, InfoCircleFilledIcon } from "@elementor/icons";
89
+ import { __, sprintf } from "@wordpress/i18n";
90
+ var ERROR_MESSAGES = {
91
+ MISSING_VARIABLE_NAME: __("Give your variable a name.", "elementor"),
92
+ MISSING_VARIABLE_VALUE: __("Add a value to complete your variable.", "elementor"),
93
+ INVALID_CHARACTERS: __("Use letters, numbers, dashes (-), or underscores (_) for the name.", "elementor"),
94
+ NO_NON_SPECIAL_CHARACTER: __("Names have to include at least one non-special character.", "elementor"),
95
+ VARIABLE_LABEL_MAX_LENGTH: __("Keep names up to 50 characters.", "elementor"),
96
+ DUPLICATED_LABEL: __("This variable name already exists. Please choose a unique name.", "elementor"),
97
+ UNEXPECTED_ERROR: __("There was a glitch. Try saving your variable again.", "elementor"),
98
+ BATCH: {
99
+ DUPLICATED_LABELS: (count, name) => (
100
+ // eslint-disable-next-line @wordpress/i18n-translator-comments
101
+ sprintf(__("We found %1$d duplicated %2$s.", "elementor"), count, name)
102
+ ),
103
+ UNEXPECTED_ERROR: __("There was a glitch.", "elementor"),
104
+ DUPLICATED_LABEL_ACTION: __("Take me there", "elementor"),
105
+ DUPLICATED_LABEL_ACTION_MESSAGE: __("Please rename the variables.", "elementor"),
106
+ UNEXPECTED_ERROR_ACTION_MESSAGE: __("Try saving your variables again.", "elementor")
107
+ }
108
+ };
109
+ var VARIABLE_LABEL_MAX_LENGTH = 50;
110
+ var mapServerError = (error) => {
111
+ if (error?.response?.data?.code === "duplicated_label") {
112
+ return {
113
+ field: "label",
114
+ message: ERROR_MESSAGES.DUPLICATED_LABEL
115
+ };
116
+ }
117
+ if (error?.response?.data?.code === "batch_duplicated_label") {
118
+ const errorData = error?.response?.data?.data ?? {};
119
+ const count = Object.keys(errorData).length;
120
+ const name = count === 1 ? "name" : "names";
121
+ const duplicatedIds = Object.keys(errorData);
122
+ return {
123
+ field: "label",
124
+ message: ERROR_MESSAGES.BATCH.DUPLICATED_LABELS(count, name),
125
+ severity: "error",
126
+ IconComponent: AlertTriangleFilledIcon,
127
+ action: {
128
+ label: ERROR_MESSAGES.BATCH.DUPLICATED_LABEL_ACTION,
129
+ message: ERROR_MESSAGES.BATCH.DUPLICATED_LABEL_ACTION_MESSAGE,
130
+ data: {
131
+ duplicatedIds
132
+ }
133
+ }
134
+ };
135
+ }
136
+ if (error?.response?.data?.code === "batch_operation_failed") {
137
+ return {
138
+ field: "label",
139
+ message: ERROR_MESSAGES.BATCH.UNEXPECTED_ERROR,
140
+ severity: "secondary",
141
+ IconComponent: InfoCircleFilledIcon,
142
+ action: {
143
+ message: ERROR_MESSAGES.BATCH.UNEXPECTED_ERROR_ACTION_MESSAGE
144
+ }
145
+ };
146
+ }
147
+ return void 0;
148
+ };
149
+ var validateLabel = (name, variables) => {
150
+ if (!name.trim()) {
151
+ return ERROR_MESSAGES.MISSING_VARIABLE_NAME;
152
+ }
153
+ const allowedChars = /^[a-zA-Z0-9_-]+$/;
154
+ if (!allowedChars.test(name)) {
155
+ return ERROR_MESSAGES.INVALID_CHARACTERS;
156
+ }
157
+ const hasAlphanumeric = /[a-zA-Z0-9]/;
158
+ if (!hasAlphanumeric.test(name)) {
159
+ return ERROR_MESSAGES.NO_NON_SPECIAL_CHARACTER;
160
+ }
161
+ if (VARIABLE_LABEL_MAX_LENGTH < name.length) {
162
+ return ERROR_MESSAGES.VARIABLE_LABEL_MAX_LENGTH;
163
+ }
164
+ if (Object.values(variables ?? {}).some((variable) => variable.label === name)) {
165
+ return ERROR_MESSAGES.DUPLICATED_LABEL;
166
+ }
167
+ return "";
168
+ };
169
+ var labelHint = (name) => {
170
+ const hintThreshold = VARIABLE_LABEL_MAX_LENGTH * 0.8 - 1;
171
+ if (hintThreshold < name.length) {
172
+ return ERROR_MESSAGES.VARIABLE_LABEL_MAX_LENGTH;
173
+ }
174
+ return "";
175
+ };
176
+ var validateValue = (value) => {
177
+ if (!value.trim()) {
178
+ return ERROR_MESSAGES.MISSING_VARIABLE_VALUE;
179
+ }
180
+ return "";
181
+ };
182
+
183
+ // src/variables-registry/create-variable-type-registry.ts
184
+ import {
185
+ stylesInheritanceTransformersRegistry,
186
+ styleTransformersRegistry
187
+ } from "@elementor/editor-canvas";
188
+
189
+ // src/transformers/inheritance-transformer.tsx
190
+ import * as React from "react";
191
+ import { createTransformer } from "@elementor/editor-canvas";
192
+ import { Stack, Typography } from "@elementor/ui";
193
+ import { __ as __3 } from "@wordpress/i18n";
194
+
195
+ // src/components/ui/color-indicator.tsx
196
+ import { styled, UnstableColorIndicator } from "@elementor/ui";
197
+ var ColorIndicator = styled(UnstableColorIndicator)(({ theme }) => ({
198
+ borderRadius: `${theme.shape.borderRadius / 2}px`,
199
+ marginRight: theme.spacing(0.25)
200
+ }));
201
+
202
+ // src/prop-types/color-variable-prop-type.ts
203
+ import { createPropUtils } from "@elementor/editor-props";
204
+ import { z } from "@elementor/schema";
205
+ var colorVariablePropTypeUtil = createPropUtils("global-color-variable", z.string());
12
206
 
13
207
  // src/service.ts
14
- import { __ } from "@wordpress/i18n";
208
+ import { __ as __2 } from "@wordpress/i18n";
15
209
 
16
210
  // src/api.ts
17
211
  import { httpService } from "@elementor/http-client";
@@ -176,9 +370,9 @@ var Storage = class {
176
370
  import { enqueueFont } from "@elementor/editor-v1-adapters";
177
371
 
178
372
  // src/prop-types/font-variable-prop-type.ts
179
- import { createPropUtils } from "@elementor/editor-props";
180
- import { z } from "@elementor/schema";
181
- var fontVariablePropTypeUtil = createPropUtils("global-font-variable", z.string());
373
+ import { createPropUtils as createPropUtils2 } from "@elementor/editor-props";
374
+ import { z as z2 } from "@elementor/schema";
375
+ var fontVariablePropTypeUtil = createPropUtils2("global-font-variable", z2.string());
182
376
 
183
377
  // src/create-style-variables-repository.ts
184
378
  var createStyleVariablesRepository = () => {
@@ -290,7 +484,7 @@ var service = {
290
484
  return apiClient.create(type, label, value).then((response) => {
291
485
  const { success, data: payload } = response.data;
292
486
  if (!success) {
293
- const errorMessage = payload?.message || __("Unexpected response from server", "elementor");
487
+ const errorMessage = payload?.message || __2("Unexpected response from server", "elementor");
294
488
  throw new Error(errorMessage);
295
489
  }
296
490
  return payload;
@@ -312,7 +506,7 @@ var service = {
312
506
  return apiClient.update(id2, label, value, type).then((response) => {
313
507
  const { success, data: payload } = response.data;
314
508
  if (!success) {
315
- const errorMessage = payload?.message || __("Unexpected response from server", "elementor");
509
+ const errorMessage = payload?.message || __2("Unexpected response from server", "elementor");
316
510
  throw new Error(errorMessage);
317
511
  }
318
512
  return payload;
@@ -396,265 +590,31 @@ var service = {
396
590
  const variableId = result.id;
397
591
  if (result.variable) {
398
592
  if (result.type === "create") {
399
- storage.add(variableId, result.variable);
400
- } else {
401
- storage.update(variableId, result.variable);
402
- }
403
- styleVariablesRepository.update({
404
- [variableId]: result.variable
405
- });
406
- }
407
- });
408
- }
409
- return {
410
- success: true,
411
- watermark,
412
- operations: operations.length
413
- };
414
- });
415
- }
416
- };
417
- var handleWatermark = (operation, newWatermark) => {
418
- if (storage.watermarkDiff(operation, newWatermark)) {
419
- setTimeout(() => service.load(), 500);
420
- }
421
- storage.watermark(newWatermark);
422
- };
423
-
424
- // src/components/global-styles-import-listener.tsx
425
- function GlobalStylesImportListener() {
426
- useEffect(() => {
427
- const handleGlobalStylesImported = (event) => {
428
- const importedVars = event.detail?.global_variables;
429
- if (!importedVars) {
430
- return;
431
- }
432
- if (importedVars.data && typeof importedVars.data === "object") {
433
- styleVariablesRepository.update(importedVars.data);
434
- }
435
- service.load();
436
- };
437
- window.addEventListener(GLOBAL_STYLES_IMPORTED_EVENT, handleGlobalStylesImported);
438
- return () => {
439
- window.removeEventListener(GLOBAL_STYLES_IMPORTED_EVENT, handleGlobalStylesImported);
440
- };
441
- }, []);
442
- return null;
443
- }
444
-
445
- // src/components/open-panel-from-event.tsx
446
- import { useEffect as useEffect5, useRef as useRef7, useState as useState7 } from "react";
447
- import {
448
- __privateListenTo as listenTo,
449
- __privateOpenRoute as openRoute,
450
- routeOpenEvent
451
- } from "@elementor/editor-v1-adapters";
452
-
453
- // src/components/variables-manager/variables-manager-panel.tsx
454
- import * as React14 from "react";
455
- import { useCallback as useCallback6, useEffect as useEffect4, useState as useState6 } from "react";
456
- import { useSuppressedMessage } from "@elementor/editor-current-user";
457
- import {
458
- __createPanel as createPanel,
459
- Panel,
460
- PanelBody,
461
- PanelFooter,
462
- PanelHeader,
463
- PanelHeaderTitle
464
- } from "@elementor/editor-panels";
465
- import { ConfirmationDialog as ConfirmationDialog2, SaveChangesDialog, SearchField, ThemeProvider, useDialog } from "@elementor/editor-ui";
466
- import { changeEditMode } from "@elementor/editor-v1-adapters";
467
- import { AlertTriangleFilledIcon as AlertTriangleFilledIcon2, ColorFilterIcon, CopyIcon, TrashIcon } from "@elementor/icons";
468
- import {
469
- Alert,
470
- AlertAction,
471
- AlertTitle,
472
- Button as Button2,
473
- CloseButton,
474
- Divider,
475
- Infotip,
476
- Stack as Stack6,
477
- usePopupState as usePopupState2
478
- } from "@elementor/ui";
479
- import { __ as __10 } from "@wordpress/i18n";
480
-
481
- // src/utils/tracking.ts
482
- import { getMixpanel } from "@elementor/events";
483
- var trackVariableEvent = ({ varType, controlPath, action }) => {
484
- const { dispatchEvent, config } = getMixpanel();
485
- if (!config?.names?.variables?.[action]) {
486
- return;
487
- }
488
- const name = config.names.variables[action];
489
- dispatchEvent?.(name, {
490
- location: config?.locations?.variables || "",
491
- secondaryLocation: config?.secondaryLocations?.variablesPopover || "",
492
- trigger: config?.triggers?.click || "",
493
- var_type: varType,
494
- control_path: controlPath,
495
- action_type: name
496
- });
497
- };
498
- var trackVariablesManagerEvent = ({ action, varType, controlPath }) => {
499
- const { dispatchEvent, config } = getMixpanel();
500
- if (!config?.names?.variables?.[action]) {
501
- return;
502
- }
503
- const name = config.names.variables[action];
504
- const eventData = {
505
- location: config?.locations?.variablesManager || "",
506
- trigger: config?.triggers?.click || "",
507
- action_type: name
508
- };
509
- if (varType) {
510
- eventData.var_type = varType;
511
- }
512
- if (controlPath) {
513
- eventData.style_control_path = controlPath;
514
- }
515
- dispatchEvent?.(name, eventData);
516
- };
517
- var trackVariableSyncToV3 = ({ variableLabel, action }) => {
518
- try {
519
- const { dispatchEvent, config } = getMixpanel();
520
- if (!config?.names?.variables?.variableSyncToV3) {
521
- return;
522
- }
523
- const name = config.names.variables.variableSyncToV3;
524
- const isSync = action === "sync";
525
- dispatchEvent?.(name, {
526
- interaction_type: "click",
527
- target_type: variableLabel,
528
- target_name: isSync ? "sync_to_v3" : "unsync_to_v3",
529
- interaction_result: isSync ? "var_is_synced_to_V3" : "var_is_unsynced_from_V3",
530
- target_location: "widget_panel",
531
- location_l1: "var_manager",
532
- interaction_description: isSync ? `user_synced_${variableLabel}_to_v3` : `user_unsync_${variableLabel}_from_v3`
533
- });
534
- } catch {
535
- }
536
- };
537
-
538
- // src/utils/validations.ts
539
- import { AlertTriangleFilledIcon, InfoCircleFilledIcon } from "@elementor/icons";
540
- import { __ as __2, sprintf } from "@wordpress/i18n";
541
- var ERROR_MESSAGES = {
542
- MISSING_VARIABLE_NAME: __2("Give your variable a name.", "elementor"),
543
- MISSING_VARIABLE_VALUE: __2("Add a value to complete your variable.", "elementor"),
544
- INVALID_CHARACTERS: __2("Use letters, numbers, dashes (-), or underscores (_) for the name.", "elementor"),
545
- NO_NON_SPECIAL_CHARACTER: __2("Names have to include at least one non-special character.", "elementor"),
546
- VARIABLE_LABEL_MAX_LENGTH: __2("Keep names up to 50 characters.", "elementor"),
547
- DUPLICATED_LABEL: __2("This variable name already exists. Please choose a unique name.", "elementor"),
548
- UNEXPECTED_ERROR: __2("There was a glitch. Try saving your variable again.", "elementor"),
549
- BATCH: {
550
- DUPLICATED_LABELS: (count, name) => (
551
- // eslint-disable-next-line @wordpress/i18n-translator-comments
552
- sprintf(__2("We found %1$d duplicated %2$s.", "elementor"), count, name)
553
- ),
554
- UNEXPECTED_ERROR: __2("There was a glitch.", "elementor"),
555
- DUPLICATED_LABEL_ACTION: __2("Take me there", "elementor"),
556
- DUPLICATED_LABEL_ACTION_MESSAGE: __2("Please rename the variables.", "elementor"),
557
- UNEXPECTED_ERROR_ACTION_MESSAGE: __2("Try saving your variables again.", "elementor")
558
- }
559
- };
560
- var VARIABLE_LABEL_MAX_LENGTH = 50;
561
- var mapServerError = (error) => {
562
- if (error?.response?.data?.code === "duplicated_label") {
563
- return {
564
- field: "label",
565
- message: ERROR_MESSAGES.DUPLICATED_LABEL
566
- };
567
- }
568
- if (error?.response?.data?.code === "batch_duplicated_label") {
569
- const errorData = error?.response?.data?.data ?? {};
570
- const count = Object.keys(errorData).length;
571
- const name = count === 1 ? "name" : "names";
572
- const duplicatedIds = Object.keys(errorData);
573
- return {
574
- field: "label",
575
- message: ERROR_MESSAGES.BATCH.DUPLICATED_LABELS(count, name),
576
- severity: "error",
577
- IconComponent: AlertTriangleFilledIcon,
578
- action: {
579
- label: ERROR_MESSAGES.BATCH.DUPLICATED_LABEL_ACTION,
580
- message: ERROR_MESSAGES.BATCH.DUPLICATED_LABEL_ACTION_MESSAGE,
581
- data: {
582
- duplicatedIds
583
- }
584
- }
585
- };
586
- }
587
- if (error?.response?.data?.code === "batch_operation_failed") {
588
- return {
589
- field: "label",
590
- message: ERROR_MESSAGES.BATCH.UNEXPECTED_ERROR,
591
- severity: "secondary",
592
- IconComponent: InfoCircleFilledIcon,
593
- action: {
594
- message: ERROR_MESSAGES.BATCH.UNEXPECTED_ERROR_ACTION_MESSAGE
593
+ storage.add(variableId, result.variable);
594
+ } else {
595
+ storage.update(variableId, result.variable);
596
+ }
597
+ styleVariablesRepository.update({
598
+ [variableId]: result.variable
599
+ });
600
+ }
601
+ });
595
602
  }
596
- };
597
- }
598
- return void 0;
599
- };
600
- var validateLabel = (name, variables) => {
601
- if (!name.trim()) {
602
- return ERROR_MESSAGES.MISSING_VARIABLE_NAME;
603
- }
604
- const allowedChars = /^[a-zA-Z0-9_-]+$/;
605
- if (!allowedChars.test(name)) {
606
- return ERROR_MESSAGES.INVALID_CHARACTERS;
607
- }
608
- const hasAlphanumeric = /[a-zA-Z0-9]/;
609
- if (!hasAlphanumeric.test(name)) {
610
- return ERROR_MESSAGES.NO_NON_SPECIAL_CHARACTER;
611
- }
612
- if (VARIABLE_LABEL_MAX_LENGTH < name.length) {
613
- return ERROR_MESSAGES.VARIABLE_LABEL_MAX_LENGTH;
614
- }
615
- if (Object.values(variables ?? {}).some((variable) => variable.label === name)) {
616
- return ERROR_MESSAGES.DUPLICATED_LABEL;
617
- }
618
- return "";
619
- };
620
- var labelHint = (name) => {
621
- const hintThreshold = VARIABLE_LABEL_MAX_LENGTH * 0.8 - 1;
622
- if (hintThreshold < name.length) {
623
- return ERROR_MESSAGES.VARIABLE_LABEL_MAX_LENGTH;
603
+ return {
604
+ success: true,
605
+ watermark,
606
+ operations: operations.length
607
+ };
608
+ });
624
609
  }
625
- return "";
626
610
  };
627
- var validateValue = (value) => {
628
- if (!value.trim()) {
629
- return ERROR_MESSAGES.MISSING_VARIABLE_VALUE;
611
+ var handleWatermark = (operation, newWatermark) => {
612
+ if (storage.watermarkDiff(operation, newWatermark)) {
613
+ setTimeout(() => service.load(), 500);
630
614
  }
631
- return "";
615
+ storage.watermark(newWatermark);
632
616
  };
633
617
 
634
- // src/variables-registry/create-variable-type-registry.ts
635
- import {
636
- stylesInheritanceTransformersRegistry,
637
- styleTransformersRegistry
638
- } from "@elementor/editor-canvas";
639
-
640
- // src/transformers/inheritance-transformer.tsx
641
- import * as React from "react";
642
- import { createTransformer } from "@elementor/editor-canvas";
643
- import { Stack, Typography } from "@elementor/ui";
644
- import { __ as __3 } from "@wordpress/i18n";
645
-
646
- // src/components/ui/color-indicator.tsx
647
- import { styled, UnstableColorIndicator } from "@elementor/ui";
648
- var ColorIndicator = styled(UnstableColorIndicator)(({ theme }) => ({
649
- borderRadius: `${theme.shape.borderRadius / 2}px`,
650
- marginRight: theme.spacing(0.25)
651
- }));
652
-
653
- // src/prop-types/color-variable-prop-type.ts
654
- import { createPropUtils as createPropUtils2 } from "@elementor/editor-props";
655
- import { z as z2 } from "@elementor/schema";
656
- var colorVariablePropTypeUtil = createPropUtils2("global-color-variable", z2.string());
657
-
658
618
  // src/transformers/utils/resolve-css-variable.ts
659
619
  var resolveCssVariable = (id2, variable) => {
660
620
  let name = id2;
@@ -1265,7 +1225,12 @@ var TRACKING_DATA = {
1265
1225
  location_l1: "create variable menu"
1266
1226
  };
1267
1227
  var SIZE = "tiny";
1268
- var VariableManagerCreateMenu = ({ variables, onCreate, menuState }) => {
1228
+ var VariableManagerCreateMenu = ({
1229
+ variables,
1230
+ onCreate,
1231
+ menuState,
1232
+ outlinedTrigger = false
1233
+ }) => {
1269
1234
  const buttonRef = useRef2(null);
1270
1235
  const variableTypes = getVariableTypes();
1271
1236
  const menuOptionConfigs = useMemo2(
@@ -1284,6 +1249,7 @@ var VariableManagerCreateMenu = ({ variables, onCreate, menuState }) => {
1284
1249
  ...bindTrigger(menuState),
1285
1250
  ref: buttonRef,
1286
1251
  size: SIZE,
1252
+ variant: outlinedTrigger ? "outlined" : void 0,
1287
1253
  "aria-label": __8("Add variable", "elementor")
1288
1254
  },
1289
1255
  /* @__PURE__ */ React7.createElement(PlusIcon, { fontSize: SIZE })
@@ -1369,7 +1335,7 @@ var getDefaultName = (variables, baseName) => {
1369
1335
 
1370
1336
  // src/components/variables-manager/variables-manager-table.tsx
1371
1337
  import * as React13 from "react";
1372
- import { useEffect as useEffect3, useRef as useRef6 } from "react";
1338
+ import { useEffect as useEffect2, useRef as useRef6 } from "react";
1373
1339
  import {
1374
1340
  Table,
1375
1341
  TableBody,
@@ -1494,7 +1460,7 @@ var LabelField = ({
1494
1460
 
1495
1461
  // src/components/variables-manager/variable-editable-cell.tsx
1496
1462
  import * as React10 from "react";
1497
- import { useCallback as useCallback5, useEffect as useEffect2, useRef as useRef4, useState as useState5 } from "react";
1463
+ import { useCallback as useCallback5, useEffect, useRef as useRef4, useState as useState5 } from "react";
1498
1464
  import { ClickAwayListener, Stack as Stack4 } from "@elementor/ui";
1499
1465
  var VariableEditableCell = React10.memo(
1500
1466
  ({
@@ -1522,10 +1488,10 @@ var VariableEditableCell = React10.memo(
1522
1488
  }
1523
1489
  setIsEditing(false);
1524
1490
  }, [value, onChange, fieldType, labelFieldError, valueFieldError]);
1525
- useEffect2(() => {
1491
+ useEffect(() => {
1526
1492
  onRowRef?.(rowRef?.current);
1527
1493
  }, [onRowRef]);
1528
- useEffect2(() => {
1494
+ useEffect(() => {
1529
1495
  if (autoEdit && !isEditing && !disabled) {
1530
1496
  setIsEditing(true);
1531
1497
  onAutoEditComplete?.();
@@ -1866,7 +1832,7 @@ var VariablesManagerTable = ({
1866
1832
  }) => {
1867
1833
  const tableContainerRef = useRef6(null);
1868
1834
  const variableRowRefs = useRef6(/* @__PURE__ */ new Map());
1869
- useEffect3(() => {
1835
+ useEffect2(() => {
1870
1836
  if (autoEditVariableId && tableContainerRef.current) {
1871
1837
  const rowElement = variableRowRefs.current.get(autoEditVariableId);
1872
1838
  if (rowElement) {
@@ -1972,8 +1938,33 @@ var { panel, usePanelActions } = createPanel({
1972
1938
  },
1973
1939
  isOpenPreviousElement: true
1974
1940
  });
1941
+ function VariablesManagerPanelEmbedded({
1942
+ onRequestClose,
1943
+ onExposeCloseAttempt
1944
+ }) {
1945
+ return /* @__PURE__ */ React14.createElement(
1946
+ VariablesManagerPanelRoot,
1947
+ {
1948
+ embedded: true,
1949
+ onRequestClose,
1950
+ onExposeCloseAttempt
1951
+ }
1952
+ );
1953
+ }
1975
1954
  function VariablesManagerPanel() {
1976
- const { close: closePanel } = usePanelActions();
1955
+ return /* @__PURE__ */ React14.createElement(VariablesManagerPanelRoot, null);
1956
+ }
1957
+ function VariablesManagerPanelRoot({
1958
+ embedded = false,
1959
+ onRequestClose,
1960
+ onExposeCloseAttempt
1961
+ } = {}) {
1962
+ const { close: closeStandalonePanel } = usePanelActions();
1963
+ const closePanel = useMemo3(
1964
+ () => embedded ? onRequestClose ?? (async () => {
1965
+ }) : closeStandalonePanel,
1966
+ [embedded, onRequestClose, closeStandalonePanel]
1967
+ );
1977
1968
  const { open: openSaveChangesDialog, close: closeSaveChangesDialog, isOpen: isSaveChangesDialogOpen } = useDialog();
1978
1969
  const [isStopSyncSuppressed] = useSuppressedMessage(STOP_SYNC_MESSAGE_KEY);
1979
1970
  const createMenuState = usePopupState2({
@@ -2002,13 +1993,20 @@ function VariablesManagerPanel() {
2002
1993
  const [stopSyncConfirmation, setStopSyncConfirmation] = useState6(null);
2003
1994
  const [serverError, setServerError] = useState6(null);
2004
1995
  usePreventUnload(isDirty);
2005
- const handleClosePanel = () => {
1996
+ const handleClosePanel = useCallback6(() => {
2006
1997
  if (isDirty) {
2007
1998
  openSaveChangesDialog();
2008
1999
  return;
2009
2000
  }
2010
- closePanel();
2011
- };
2001
+ void closePanel();
2002
+ }, [isDirty, openSaveChangesDialog, closePanel]);
2003
+ useEffect3(() => {
2004
+ if (!embedded || !onExposeCloseAttempt) {
2005
+ return;
2006
+ }
2007
+ onExposeCloseAttempt(() => handleClosePanel());
2008
+ return () => onExposeCloseAttempt(null);
2009
+ }, [embedded, onExposeCloseAttempt, handleClosePanel]);
2012
2010
  const handleCreateVariable = useCallback6(
2013
2011
  (type, defaultName, defaultValue) => {
2014
2012
  const newId = createVariable2(type, defaultName, defaultValue);
@@ -2126,82 +2124,57 @@ function VariablesManagerPanel() {
2126
2124
  [variables, handleStartSync, handleStopSync, duplicateVariable, startAutoEdit]
2127
2125
  );
2128
2126
  const hasVariables = Object.keys(variables).length > 0;
2129
- return /* @__PURE__ */ React14.createElement(ThemeProvider, null, /* @__PURE__ */ React14.createElement(Panel, null, /* @__PURE__ */ React14.createElement(
2130
- PanelHeader,
2127
+ const variablesSearchFieldSx = embedded ? {
2128
+ flex: 1,
2129
+ minWidth: 0,
2130
+ px: 0,
2131
+ py: 0,
2132
+ display: "flex",
2133
+ alignItems: "center",
2134
+ alignSelf: "stretch"
2135
+ } : {
2136
+ display: "flex",
2137
+ flex: 1
2138
+ };
2139
+ const searchField = /* @__PURE__ */ React14.createElement(
2140
+ SearchField,
2131
2141
  {
2132
- sx: {
2133
- height: "unset"
2134
- }
2135
- },
2136
- /* @__PURE__ */ React14.createElement(Stack6, { width: "100%", direction: "column", alignItems: "center" }, /* @__PURE__ */ React14.createElement(Stack6, { p: 1, pl: 2, width: "100%", direction: "row", alignItems: "center" }, /* @__PURE__ */ React14.createElement(Stack6, { width: "100%", direction: "row", gap: 1 }, /* @__PURE__ */ React14.createElement(PanelHeaderTitle, { sx: { display: "flex", alignItems: "center", gap: 0.5 } }, /* @__PURE__ */ React14.createElement(ColorFilterIcon, { fontSize: "inherit" }), __10("Variables Manager", "elementor"))), /* @__PURE__ */ React14.createElement(Stack6, { direction: "row", gap: 0.5, alignItems: "center" }, /* @__PURE__ */ React14.createElement(
2137
- VariableManagerCreateMenu,
2138
- {
2139
- onCreate: handleCreateVariable,
2140
- variables,
2141
- menuState: createMenuState
2142
- }
2143
- ), /* @__PURE__ */ React14.createElement(
2144
- CloseButton,
2145
- {
2146
- "aria-label": "Close",
2147
- slotProps: { icon: { fontSize: SIZE } },
2148
- onClick: () => {
2149
- handleClosePanel();
2150
- }
2151
- }
2152
- ))), /* @__PURE__ */ React14.createElement(Stack6, { width: "100%", direction: "row", gap: 1 }, /* @__PURE__ */ React14.createElement(
2153
- SearchField,
2154
- {
2155
- sx: {
2156
- display: "flex",
2157
- flex: 1
2158
- },
2159
- placeholder: __10("Search", "elementor"),
2160
- value: searchValue,
2161
- onSearch: handleSearch
2162
- }
2163
- )), /* @__PURE__ */ React14.createElement(Divider, { sx: { width: "100%" } }))
2164
- ), /* @__PURE__ */ React14.createElement(
2165
- PanelBody,
2142
+ placeholder: __10("Search", "elementor"),
2143
+ value: searchValue,
2144
+ onSearch: handleSearch,
2145
+ sx: variablesSearchFieldSx
2146
+ }
2147
+ );
2148
+ const bodyInner = /* @__PURE__ */ React14.createElement(React14.Fragment, null, hasVariables && /* @__PURE__ */ React14.createElement(
2149
+ VariablesManagerTable,
2166
2150
  {
2167
- sx: {
2168
- display: "flex",
2169
- flexDirection: "column",
2170
- height: "100%"
2171
- }
2172
- },
2173
- hasVariables && /* @__PURE__ */ React14.createElement(
2174
- VariablesManagerTable,
2175
- {
2176
- menuActions: buildMenuActions,
2177
- variables,
2178
- onChange: handleOnChange,
2179
- autoEditVariableId,
2180
- onAutoEditComplete: handleAutoEditComplete,
2181
- onFieldError: setIsSaveDisabled
2182
- }
2183
- ),
2184
- !hasVariables && searchValue && /* @__PURE__ */ React14.createElement(
2185
- NoSearchResults,
2186
- {
2187
- searchValue,
2188
- onClear: () => handleSearch(""),
2189
- icon: /* @__PURE__ */ React14.createElement(ColorFilterIcon, { fontSize: "large" })
2190
- }
2191
- ),
2192
- !hasVariables && !searchValue && /* @__PURE__ */ React14.createElement(
2193
- EmptyState,
2194
- {
2195
- title: __10("Create your first variable", "elementor"),
2196
- message: __10(
2197
- "Variables are saved attributes that you can apply anywhere on your site.",
2198
- "elementor"
2199
- ),
2200
- icon: /* @__PURE__ */ React14.createElement(ColorFilterIcon, { fontSize: "large" }),
2201
- onAdd: createMenuState.open
2202
- }
2203
- )
2204
- ), /* @__PURE__ */ React14.createElement(PanelFooter, null, /* @__PURE__ */ React14.createElement(
2151
+ menuActions: buildMenuActions,
2152
+ variables,
2153
+ onChange: handleOnChange,
2154
+ autoEditVariableId,
2155
+ onAutoEditComplete: handleAutoEditComplete,
2156
+ onFieldError: setIsSaveDisabled
2157
+ }
2158
+ ), !hasVariables && searchValue && /* @__PURE__ */ React14.createElement(
2159
+ NoSearchResults,
2160
+ {
2161
+ searchValue,
2162
+ onClear: () => handleSearch(""),
2163
+ icon: /* @__PURE__ */ React14.createElement(ColorFilterIcon, { fontSize: "large" })
2164
+ }
2165
+ ), !hasVariables && !searchValue && /* @__PURE__ */ React14.createElement(
2166
+ EmptyState,
2167
+ {
2168
+ title: __10("Create your first variable", "elementor"),
2169
+ message: __10(
2170
+ "Variables are saved attributes that you can apply anywhere on your site.",
2171
+ "elementor"
2172
+ ),
2173
+ icon: /* @__PURE__ */ React14.createElement(ColorFilterIcon, { fontSize: "large" }),
2174
+ onAdd: createMenuState.open
2175
+ }
2176
+ ));
2177
+ const saveFooter = /* @__PURE__ */ React14.createElement(PanelFooter, null, /* @__PURE__ */ React14.createElement(
2205
2178
  Infotip,
2206
2179
  {
2207
2180
  placement: "right",
@@ -2245,7 +2218,8 @@ function VariablesManagerPanel() {
2245
2218
  },
2246
2219
  __10("Save changes", "elementor")
2247
2220
  )
2248
- ))), deleteConfirmation && /* @__PURE__ */ React14.createElement(
2221
+ ));
2222
+ const dialogs = /* @__PURE__ */ React14.createElement(React14.Fragment, null, deleteConfirmation && /* @__PURE__ */ React14.createElement(
2249
2223
  DeleteConfirmationDialog,
2250
2224
  {
2251
2225
  open: true,
@@ -2271,7 +2245,7 @@ function VariablesManagerPanel() {
2271
2245
  label: __10("Discard", "elementor"),
2272
2246
  action: () => {
2273
2247
  closeSaveChangesDialog();
2274
- closePanel();
2248
+ void closePanel();
2275
2249
  }
2276
2250
  },
2277
2251
  confirm: {
@@ -2280,16 +2254,104 @@ function VariablesManagerPanel() {
2280
2254
  const result = await handleSaveClick();
2281
2255
  closeSaveChangesDialog();
2282
2256
  if (result?.success) {
2283
- closePanel();
2257
+ void closePanel();
2284
2258
  }
2285
2259
  }
2286
2260
  }
2287
2261
  }
2288
2262
  }
2289
2263
  )));
2264
+ const panelChrome = embedded ? /* @__PURE__ */ React14.createElement(
2265
+ Stack6,
2266
+ {
2267
+ direction: "column",
2268
+ sx: {
2269
+ height: "100%",
2270
+ width: "100%",
2271
+ flex: 1,
2272
+ minHeight: 0,
2273
+ overflow: "hidden"
2274
+ }
2275
+ },
2276
+ /* @__PURE__ */ React14.createElement(
2277
+ Stack6,
2278
+ {
2279
+ direction: "row",
2280
+ alignItems: "center",
2281
+ spacing: 1,
2282
+ width: "100%",
2283
+ sx: {
2284
+ flexShrink: 0,
2285
+ px: 2,
2286
+ pb: 1
2287
+ }
2288
+ },
2289
+ searchField,
2290
+ /* @__PURE__ */ React14.createElement(Box2, { sx: { display: "flex", flexShrink: 0, alignItems: "center" } }, /* @__PURE__ */ React14.createElement(
2291
+ VariableManagerCreateMenu,
2292
+ {
2293
+ outlinedTrigger: true,
2294
+ onCreate: handleCreateVariable,
2295
+ variables,
2296
+ menuState: createMenuState
2297
+ }
2298
+ ))
2299
+ ),
2300
+ /* @__PURE__ */ React14.createElement(Divider, { sx: { width: "100%" } }),
2301
+ /* @__PURE__ */ React14.createElement(
2302
+ PanelBody,
2303
+ {
2304
+ sx: {
2305
+ display: "flex",
2306
+ flexDirection: "column",
2307
+ flex: 1,
2308
+ minHeight: 0,
2309
+ overflow: "hidden"
2310
+ }
2311
+ },
2312
+ bodyInner
2313
+ ),
2314
+ saveFooter
2315
+ ) : /* @__PURE__ */ React14.createElement(Panel, null, /* @__PURE__ */ React14.createElement(
2316
+ PanelHeader,
2317
+ {
2318
+ sx: {
2319
+ height: "unset"
2320
+ }
2321
+ },
2322
+ /* @__PURE__ */ React14.createElement(Stack6, { width: "100%", direction: "column", alignItems: "center" }, /* @__PURE__ */ React14.createElement(Stack6, { p: 1, pl: 2, width: "100%", direction: "row", alignItems: "center" }, /* @__PURE__ */ React14.createElement(Stack6, { width: "100%", direction: "row", gap: 1 }, /* @__PURE__ */ React14.createElement(PanelHeaderTitle, { sx: { display: "flex", alignItems: "center", gap: 0.5 } }, /* @__PURE__ */ React14.createElement(ColorFilterIcon, { fontSize: "inherit" }), __10("Variables Manager", "elementor"))), /* @__PURE__ */ React14.createElement(Stack6, { direction: "row", gap: 0.5, alignItems: "center" }, /* @__PURE__ */ React14.createElement(
2323
+ VariableManagerCreateMenu,
2324
+ {
2325
+ onCreate: handleCreateVariable,
2326
+ variables,
2327
+ menuState: createMenuState
2328
+ }
2329
+ ), /* @__PURE__ */ React14.createElement(
2330
+ CloseButton,
2331
+ {
2332
+ "aria-label": "Close",
2333
+ slotProps: { icon: { fontSize: SIZE } },
2334
+ onClick: () => {
2335
+ handleClosePanel();
2336
+ }
2337
+ }
2338
+ ))), /* @__PURE__ */ React14.createElement(Stack6, { width: "100%", direction: "row", gap: 1 }, searchField), /* @__PURE__ */ React14.createElement(Divider, { sx: { width: "100%" } }))
2339
+ ), /* @__PURE__ */ React14.createElement(
2340
+ PanelBody,
2341
+ {
2342
+ sx: {
2343
+ display: "flex",
2344
+ flexDirection: "column",
2345
+ height: "100%"
2346
+ }
2347
+ },
2348
+ bodyInner
2349
+ ), saveFooter);
2350
+ const core = /* @__PURE__ */ React14.createElement(React14.Fragment, null, panelChrome, dialogs);
2351
+ return embedded ? core : /* @__PURE__ */ React14.createElement(ThemeProvider, null, core);
2290
2352
  }
2291
2353
  var usePreventUnload = (isDirty) => {
2292
- useEffect4(() => {
2354
+ useEffect3(() => {
2293
2355
  const handleBeforeUnload = (event) => {
2294
2356
  if (isDirty) {
2295
2357
  event.preventDefault();
@@ -2320,7 +2382,45 @@ var StopSyncConfirmationDialog = ({ open, onClose, onConfirm }) => {
2320
2382
  ));
2321
2383
  };
2322
2384
 
2385
+ // src/init.ts
2386
+ import { injectIntoLogic, injectIntoTop } from "@elementor/editor";
2387
+ import { registerControlReplacement } from "@elementor/editor-controls";
2388
+ import { getMCPByDomain } from "@elementor/editor-mcp";
2389
+ import { __registerPanel as registerPanel } from "@elementor/editor-panels";
2390
+ import { isTransformable as isTransformable2 } from "@elementor/editor-props";
2391
+ import { isExperimentActive as isExperimentActive2 } from "@elementor/editor-v1-adapters";
2392
+ import { controlActionsMenu } from "@elementor/menus";
2393
+
2394
+ // src/components/global-styles-import-listener.tsx
2395
+ import { useEffect as useEffect4 } from "react";
2396
+ import { GLOBAL_STYLES_IMPORTED_EVENT } from "@elementor/editor-canvas";
2397
+ function GlobalStylesImportListener() {
2398
+ useEffect4(() => {
2399
+ const handleGlobalStylesImported = (event) => {
2400
+ const importedVars = event.detail?.global_variables;
2401
+ if (!importedVars) {
2402
+ return;
2403
+ }
2404
+ if (importedVars.data && typeof importedVars.data === "object") {
2405
+ styleVariablesRepository.update(importedVars.data);
2406
+ }
2407
+ service.load();
2408
+ };
2409
+ window.addEventListener(GLOBAL_STYLES_IMPORTED_EVENT, handleGlobalStylesImported);
2410
+ return () => {
2411
+ window.removeEventListener(GLOBAL_STYLES_IMPORTED_EVENT, handleGlobalStylesImported);
2412
+ };
2413
+ }, []);
2414
+ return null;
2415
+ }
2416
+
2323
2417
  // src/components/open-panel-from-event.tsx
2418
+ import { useEffect as useEffect5, useRef as useRef7, useState as useState7 } from "react";
2419
+ import {
2420
+ __privateListenTo as listenTo,
2421
+ __privateOpenRoute as openRoute,
2422
+ routeOpenEvent
2423
+ } from "@elementor/editor-v1-adapters";
2324
2424
  var EVENT_NAME = "elementor/open-variables-manager";
2325
2425
  var DEFAULT_PANEL_ROUTE = "panel/elements/categories";
2326
2426
  function OpenPanelFromEvent() {
@@ -2390,7 +2490,7 @@ import { useId, useRef as useRef9 } from "react";
2390
2490
  import * as React24 from "react";
2391
2491
  import { useBoundProp as useBoundProp6 } from "@elementor/editor-controls";
2392
2492
  import { ColorFilterIcon as ColorFilterIcon3 } from "@elementor/icons";
2393
- import { bindPopover, bindTrigger as bindTrigger3, Box as Box5, Popover, usePopupState as usePopupState3 } from "@elementor/ui";
2493
+ import { bindPopover, bindTrigger as bindTrigger3, Box as Box6, Popover, usePopupState as usePopupState3 } from "@elementor/ui";
2394
2494
 
2395
2495
  // src/utils/unlink-variable.ts
2396
2496
  function transformValueBeforeUnlink(variable, propTypeKey) {
@@ -2416,11 +2516,11 @@ import { isExperimentActive } from "@elementor/editor-v1-adapters";
2416
2516
  // src/context/variable-selection-popover.context.tsx
2417
2517
  import * as React15 from "react";
2418
2518
  import { createContext as createContext2, useContext as useContext2, useState as useState8 } from "react";
2419
- import { Box as Box2 } from "@elementor/ui";
2519
+ import { Box as Box3 } from "@elementor/ui";
2420
2520
  var PopoverContentRefContext = createContext2(null);
2421
2521
  var PopoverContentRefContextProvider = ({ children }) => {
2422
2522
  const [anchorRef, setAnchorRef] = useState8(null);
2423
- return /* @__PURE__ */ React15.createElement(PopoverContentRefContext.Provider, { value: anchorRef }, /* @__PURE__ */ React15.createElement(Box2, { ref: setAnchorRef }, children));
2523
+ return /* @__PURE__ */ React15.createElement(PopoverContentRefContext.Provider, { value: anchorRef }, /* @__PURE__ */ React15.createElement(Box3, { ref: setAnchorRef }, children));
2424
2524
  };
2425
2525
  var usePopoverContentRef = () => {
2426
2526
  return useContext2(PopoverContentRefContext);
@@ -2874,14 +2974,14 @@ import { __ as __15, sprintf as sprintf3 } from "@wordpress/i18n";
2874
2974
  import * as React20 from "react";
2875
2975
  import { EllipsisWithTooltip as EllipsisWithTooltip2 } from "@elementor/editor-ui";
2876
2976
  import { EditIcon } from "@elementor/icons";
2877
- import { Box as Box3, IconButton as IconButton6, ListItemIcon, Tooltip as Tooltip2, Typography as Typography9 } from "@elementor/ui";
2977
+ import { Box as Box4, IconButton as IconButton6, ListItemIcon, Tooltip as Tooltip2, Typography as Typography9 } from "@elementor/ui";
2878
2978
  import { __ as __14 } from "@wordpress/i18n";
2879
2979
  var SIZE4 = "tiny";
2880
2980
  var EDIT_LABEL = __14("Edit variable", "elementor");
2881
2981
  var MenuItemContent = ({ item, disabled = false }) => {
2882
2982
  const onEdit = item.onEdit;
2883
2983
  return /* @__PURE__ */ React20.createElement(React20.Fragment, null, /* @__PURE__ */ React20.createElement(ListItemIcon, { sx: { color: disabled ? "text.disabled" : "inherit" } }, item.icon), /* @__PURE__ */ React20.createElement(
2884
- Box3,
2984
+ Box4,
2885
2985
  {
2886
2986
  sx: {
2887
2987
  flex: 1,
@@ -3156,9 +3256,15 @@ var VIEW_EDIT = "edit";
3156
3256
  var VariableSelectionPopover = ({ closePopover, propTypeKey, selectedVariable }) => {
3157
3257
  const [currentView, setCurrentView] = useState13(VIEW_LIST);
3158
3258
  const [editId, setEditId] = useState13("");
3159
- const { open } = usePanelActions();
3259
+ const { open: openStandaloneVariablesPanel } = usePanelActions();
3160
3260
  const onSettingsAvailable = isExperimentActive("e_variables_manager") ? () => {
3161
- open();
3261
+ if (isExperimentActive("e_editor_design_system_panel")) {
3262
+ window.dispatchEvent(
3263
+ new CustomEvent("elementor/toggle-design-system", { detail: { tab: "variables" } })
3264
+ );
3265
+ } else {
3266
+ openStandaloneVariablesPanel();
3267
+ }
3162
3268
  } : void 0;
3163
3269
  return /* @__PURE__ */ React22.createElement(VariableTypeProvider, { propTypeKey }, /* @__PURE__ */ React22.createElement(PopoverContentRefContextProvider, null, RenderView({
3164
3270
  propTypeKey,
@@ -3238,7 +3344,7 @@ function RenderView(props) {
3238
3344
  // src/components/ui/tags/assigned-tag.tsx
3239
3345
  import * as React23 from "react";
3240
3346
  import { DetachIcon } from "@elementor/icons";
3241
- import { Box as Box4, IconButton as IconButton8, Stack as Stack7, Tooltip as Tooltip4, Typography as Typography10, UnstableTag as Tag } from "@elementor/ui";
3347
+ import { Box as Box5, IconButton as IconButton8, Stack as Stack7, Tooltip as Tooltip4, Typography as Typography10, UnstableTag as Tag } from "@elementor/ui";
3242
3348
  import { __ as __16 } from "@wordpress/i18n";
3243
3349
  var SIZE6 = "tiny";
3244
3350
  var UNLINK_LABEL = __16("Unlink variable", "elementor");
@@ -3255,7 +3361,7 @@ var AssignedTag = ({ startIcon, label, onUnlink, ...props }) => {
3255
3361
  fullWidth: true,
3256
3362
  showActionsOnHover: true,
3257
3363
  startIcon: /* @__PURE__ */ React23.createElement(Stack7, { gap: 0.5, direction: "row", alignItems: "center" }, startIcon),
3258
- label: /* @__PURE__ */ React23.createElement(Box4, { sx: { display: "inline-grid", minWidth: 0 } }, /* @__PURE__ */ React23.createElement(Typography10, { sx: { lineHeight: 1.34 }, variant: "caption", noWrap: true }, label)),
3364
+ label: /* @__PURE__ */ React23.createElement(Box5, { sx: { display: "inline-grid", minWidth: 0 } }, /* @__PURE__ */ React23.createElement(Typography10, { sx: { lineHeight: 1.34 }, variant: "caption", noWrap: true }, label)),
3259
3365
  actions,
3260
3366
  ...props
3261
3367
  }
@@ -3274,7 +3380,7 @@ var AssignedVariable = ({ variable, propTypeKey }) => {
3274
3380
  });
3275
3381
  const unlinkVariable = createUnlinkHandler(variable, propTypeKey, setValue);
3276
3382
  const StartIcon = startIcon || (() => null);
3277
- return /* @__PURE__ */ React24.createElement(Box5, { ref: anchorRef }, /* @__PURE__ */ React24.createElement(
3383
+ return /* @__PURE__ */ React24.createElement(Box6, { ref: anchorRef }, /* @__PURE__ */ React24.createElement(
3278
3384
  AssignedTag,
3279
3385
  {
3280
3386
  label: variable.label,
@@ -3309,7 +3415,7 @@ var AssignedVariable = ({ variable, propTypeKey }) => {
3309
3415
  import * as React28 from "react";
3310
3416
  import { useId as useId2, useRef as useRef10, useState as useState15 } from "react";
3311
3417
  import { useBoundProp as useBoundProp8 } from "@elementor/editor-controls";
3312
- import { Backdrop, bindPopover as bindPopover2, Box as Box7, Infotip as Infotip2, Popover as Popover2, usePopupState as usePopupState4 } from "@elementor/ui";
3418
+ import { Backdrop, bindPopover as bindPopover2, Box as Box8, Infotip as Infotip2, Popover as Popover2, usePopupState as usePopupState4 } from "@elementor/ui";
3313
3419
  import { __ as __19 } from "@wordpress/i18n";
3314
3420
 
3315
3421
  // src/components/variable-restore.tsx
@@ -3456,7 +3562,7 @@ var DeletedVariableAlert = ({ onClose, onUnlink, onRestore, label }) => {
3456
3562
  // src/components/ui/tags/warning-variable-tag.tsx
3457
3563
  import * as React27 from "react";
3458
3564
  import { AlertTriangleFilledIcon as AlertTriangleFilledIcon4 } from "@elementor/icons";
3459
- import { Box as Box6, Chip, Tooltip as Tooltip5, Typography as Typography13 } from "@elementor/ui";
3565
+ import { Box as Box7, Chip, Tooltip as Tooltip5, Typography as Typography13 } from "@elementor/ui";
3460
3566
  var WarningVariableTag = React27.forwardRef(
3461
3567
  ({ label, suffix, onClick, icon, ...props }, ref) => {
3462
3568
  const displayText = suffix ? `${label} (${suffix})` : label;
@@ -3470,7 +3576,7 @@ var WarningVariableTag = React27.forwardRef(
3470
3576
  variant: "standard",
3471
3577
  onClick,
3472
3578
  icon: /* @__PURE__ */ React27.createElement(AlertTriangleFilledIcon4, null),
3473
- label: /* @__PURE__ */ React27.createElement(Tooltip5, { title: displayText, placement: "top" }, /* @__PURE__ */ React27.createElement(Box6, { sx: { display: "inline-grid", minWidth: 0 } }, /* @__PURE__ */ React27.createElement(Typography13, { variant: "caption", noWrap: true, sx: { lineHeight: 1.34 } }, displayText))),
3579
+ label: /* @__PURE__ */ React27.createElement(Tooltip5, { title: displayText, placement: "top" }, /* @__PURE__ */ React27.createElement(Box7, { sx: { display: "inline-grid", minWidth: 0 } }, /* @__PURE__ */ React27.createElement(Typography13, { variant: "caption", noWrap: true, sx: { lineHeight: 1.34 } }, displayText))),
3474
3580
  sx: {
3475
3581
  height: (theme) => theme.spacing(3.5),
3476
3582
  borderRadius: (theme) => theme.spacing(1),
@@ -3520,7 +3626,7 @@ var DeletedVariable = ({ variable, propTypeKey }) => {
3520
3626
  const handleRestoreWithOverrides = () => {
3521
3627
  popupState.close();
3522
3628
  };
3523
- return /* @__PURE__ */ React28.createElement(React28.Fragment, null, /* @__PURE__ */ React28.createElement(Box7, { ref: deletedChipAnchorRef }, showInfotip && /* @__PURE__ */ React28.createElement(Backdrop, { open: true, onClick: closeInfotip, invisible: true }), /* @__PURE__ */ React28.createElement(
3629
+ return /* @__PURE__ */ React28.createElement(React28.Fragment, null, /* @__PURE__ */ React28.createElement(Box8, { ref: deletedChipAnchorRef }, showInfotip && /* @__PURE__ */ React28.createElement(Backdrop, { open: true, onClick: closeInfotip, invisible: true }), /* @__PURE__ */ React28.createElement(
3524
3630
  Infotip2,
3525
3631
  {
3526
3632
  color: "warning",
@@ -3582,7 +3688,7 @@ var DeletedVariable = ({ variable, propTypeKey }) => {
3582
3688
  import * as React30 from "react";
3583
3689
  import { useId as useId3, useRef as useRef11, useState as useState16 } from "react";
3584
3690
  import { useBoundProp as useBoundProp9 } from "@elementor/editor-controls";
3585
- import { Backdrop as Backdrop2, bindPopover as bindPopover3, Box as Box8, Infotip as Infotip3, Popover as Popover3, usePopupState as usePopupState5 } from "@elementor/ui";
3691
+ import { Backdrop as Backdrop2, bindPopover as bindPopover3, Box as Box9, Infotip as Infotip3, Popover as Popover3, usePopupState as usePopupState5 } from "@elementor/ui";
3586
3692
  import { __ as __21 } from "@wordpress/i18n";
3587
3693
 
3588
3694
  // src/components/ui/mismatch-variable-alert.tsx
@@ -3637,7 +3743,7 @@ var MismatchVariable = ({ variable }) => {
3637
3743
  setValue(null);
3638
3744
  };
3639
3745
  const showClearButton = !!value;
3640
- return /* @__PURE__ */ React30.createElement(Box8, { ref: anchorRef }, infotipVisible && /* @__PURE__ */ React30.createElement(Backdrop2, { open: true, onClick: closeInfotip, invisible: true }), /* @__PURE__ */ React30.createElement(
3746
+ return /* @__PURE__ */ React30.createElement(Box9, { ref: anchorRef }, infotipVisible && /* @__PURE__ */ React30.createElement(Backdrop2, { open: true, onClick: closeInfotip, invisible: true }), /* @__PURE__ */ React30.createElement(
3641
3747
  Infotip3,
3642
3748
  {
3643
3749
  color: "warning",
@@ -4007,7 +4113,7 @@ var ColorField = ({ value, onChange, onValidationChange }) => {
4007
4113
 
4008
4114
  // src/components/fields/font-field.tsx
4009
4115
  import * as React36 from "react";
4010
- import { useId as useId4, useMemo as useMemo3, useRef as useRef13, useState as useState19 } from "react";
4116
+ import { useId as useId4, useMemo as useMemo4, useRef as useRef13, useState as useState19 } from "react";
4011
4117
  import { enqueueFont as enqueueFont2, ItemSelector, useFontFamilies } from "@elementor/editor-controls";
4012
4118
  import { useSectionWidth } from "@elementor/editor-ui";
4013
4119
  import { ChevronDownIcon, TextIcon } from "@elementor/icons";
@@ -4020,7 +4126,7 @@ var FontField = ({ value, onChange, onValidationChange }) => {
4020
4126
  const fontPopoverState = usePopupState6({ variant: "popover" });
4021
4127
  const fontFamilies = useFontFamilies();
4022
4128
  const sectionWidth = useSectionWidth();
4023
- const mapFontSubs = useMemo3(() => {
4129
+ const mapFontSubs = useMemo4(() => {
4024
4130
  return fontFamilies.map(({ label, fonts }) => ({
4025
4131
  label,
4026
4132
  items: fonts
@@ -4218,7 +4324,7 @@ import {
4218
4324
  selectionSizePropTypeUtil,
4219
4325
  shadowPropTypeUtil
4220
4326
  } from "@elementor/editor-props";
4221
- import { Box as Box9 } from "@elementor/ui";
4327
+ import { Box as Box10 } from "@elementor/ui";
4222
4328
  import { __ as __27 } from "@wordpress/i18n";
4223
4329
 
4224
4330
  // src/utils/size-value.ts
@@ -4261,7 +4367,7 @@ var BackgroundRepeaterColorIndicator = ({ value }) => {
4261
4367
  };
4262
4368
  var BackgroundRepeaterLabel = ({ value }) => {
4263
4369
  const colorVariable = useColorVariable(value);
4264
- return /* @__PURE__ */ React39.createElement(Box9, { component: "span" }, colorVariable?.label);
4370
+ return /* @__PURE__ */ React39.createElement(Box10, { component: "span" }, colorVariable?.label);
4265
4371
  };
4266
4372
  var BoxShadowRepeaterColorIndicator = ({ value }) => {
4267
4373
  const colorVariable = useColorVariable(value);
@@ -4281,7 +4387,7 @@ var FilterSingleSizeRepeaterLabel = ({ value }) => {
4281
4387
  const args = cssFilterFunction?.args;
4282
4388
  const func = cssFilterFunction?.func?.value ?? "";
4283
4389
  const rendered = sizeValue(args?.value?.size);
4284
- return /* @__PURE__ */ React39.createElement(React39.Fragment, null, /* @__PURE__ */ React39.createElement(Box9, { component: "span", style: { textTransform: "capitalize" } }, `${func}: `), /* @__PURE__ */ React39.createElement(Box9, { component: "span" }, rendered));
4390
+ return /* @__PURE__ */ React39.createElement(React39.Fragment, null, /* @__PURE__ */ React39.createElement(Box10, { component: "span", style: { textTransform: "capitalize" } }, `${func}: `), /* @__PURE__ */ React39.createElement(Box10, { component: "span" }, rendered));
4285
4391
  };
4286
4392
  var FilterDropShadowRepeaterLabel = ({ value }) => {
4287
4393
  const { args } = cssFilterFunctionPropUtil.extract(value) || {};
@@ -4293,7 +4399,7 @@ var FilterDropShadowRepeaterLabel = ({ value }) => {
4293
4399
  labels.push(rendered);
4294
4400
  }
4295
4401
  }
4296
- return /* @__PURE__ */ React39.createElement(Box9, { component: "span" }, __27("Drop shadow:", "elementor"), " ", labels.join(" "));
4402
+ return /* @__PURE__ */ React39.createElement(Box10, { component: "span" }, __27("Drop shadow:", "elementor"), " ", labels.join(" "));
4297
4403
  };
4298
4404
  var BoxShadowRepeaterLabel = ({ value }) => {
4299
4405
  const { position, hOffset, vOffset, blur, spread } = shadowPropTypeUtil.extract(value) || {};
@@ -4305,7 +4411,7 @@ var BoxShadowRepeaterLabel = ({ value }) => {
4305
4411
  }
4306
4412
  }
4307
4413
  const positionLabel = position?.value || "outset";
4308
- return /* @__PURE__ */ React39.createElement(Box9, { component: "span", style: { textTransform: "capitalize" } }, positionLabel, ": ", labels.join(" "));
4414
+ return /* @__PURE__ */ React39.createElement(Box10, { component: "span", style: { textTransform: "capitalize" } }, positionLabel, ": ", labels.join(" "));
4309
4415
  };
4310
4416
  var TransformRepeaterLabel = ({ value }) => {
4311
4417
  const labels = [];
@@ -4319,7 +4425,7 @@ var TransformRepeaterLabel = ({ value }) => {
4319
4425
  }
4320
4426
  }
4321
4427
  }
4322
- return /* @__PURE__ */ React39.createElement(Box9, { component: "span" }, labels.join(" "));
4428
+ return /* @__PURE__ */ React39.createElement(Box10, { component: "span" }, labels.join(" "));
4323
4429
  };
4324
4430
  var TransitionsSizeVariableLabel = ({ value: prop }) => {
4325
4431
  let label = "";
@@ -4332,7 +4438,7 @@ var TransitionsSizeVariableLabel = ({ value: prop }) => {
4332
4438
  }
4333
4439
  label += variable?.value;
4334
4440
  }
4335
- return /* @__PURE__ */ React39.createElement(Box9, { component: "span" }, label);
4441
+ return /* @__PURE__ */ React39.createElement(Box10, { component: "span" }, label);
4336
4442
  };
4337
4443
 
4338
4444
  // src/repeater-injections.ts
@@ -4487,15 +4593,17 @@ function init() {
4487
4593
  id: "variables-import-listener",
4488
4594
  component: GlobalStylesImportListener
4489
4595
  });
4490
- injectIntoLogic({
4491
- id: "variables-open-panel-from-url",
4492
- component: OpenPanelFromUrl
4493
- });
4494
- injectIntoLogic({
4495
- id: "variables-open-panel-from-event",
4496
- component: OpenPanelFromEvent
4497
- });
4498
- registerPanel(panel);
4596
+ if (!isExperimentActive2("e_editor_design_system_panel")) {
4597
+ injectIntoLogic({
4598
+ id: "variables-open-panel-from-url",
4599
+ component: OpenPanelFromUrl
4600
+ });
4601
+ injectIntoLogic({
4602
+ id: "variables-open-panel-from-event",
4603
+ component: OpenPanelFromEvent
4604
+ });
4605
+ registerPanel(panel);
4606
+ }
4499
4607
  }
4500
4608
  function hasVariableAssigned(value) {
4501
4609
  if (isTransformable2(value)) {
@@ -4525,6 +4633,7 @@ var Utils = {
4525
4633
  export {
4526
4634
  GLOBAL_VARIABLES_URI,
4527
4635
  Utils,
4636
+ VariablesManagerPanelEmbedded,
4528
4637
  getMenuActionsForVariable,
4529
4638
  hasVariable,
4530
4639
  init,