@elementor/editor-variables 3.35.0-439 → 3.35.0-441
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 +14 -34
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +33 -49
- package/dist/index.mjs.map +1 -1
- package/package.json +15 -15
- package/src/components/variables-manager/variables-manager-create-menu.tsx +16 -23
- package/src/renderers/style-variables-renderer.tsx +5 -2
- package/src/sync/get-canvas-iframe-document.ts +0 -7
package/dist/index.js
CHANGED
|
@@ -1151,6 +1151,9 @@ var MenuOption = ({
|
|
|
1151
1151
|
const isDisabled = !userQuotaPermissions.canAdd();
|
|
1152
1152
|
const handleClick = () => {
|
|
1153
1153
|
if (isDisabled) {
|
|
1154
|
+
if (!isPopoverOpen) {
|
|
1155
|
+
setIsPopoverOpen(true);
|
|
1156
|
+
}
|
|
1154
1157
|
return;
|
|
1155
1158
|
}
|
|
1156
1159
|
const defaultName = getDefaultName(variables, config.key, config.variableType);
|
|
@@ -1168,34 +1171,19 @@ var MenuOption = ({
|
|
|
1168
1171
|
(0, import_i18n7.__)("Upgrade to continue creating and editing %s variables.", "elementor"),
|
|
1169
1172
|
config.variableType
|
|
1170
1173
|
);
|
|
1171
|
-
return /* @__PURE__ */ React6.createElement(import_ui6.MenuItem, { onClick: handleClick, sx: { gap: 1.5, cursor:
|
|
1172
|
-
|
|
1174
|
+
return /* @__PURE__ */ React6.createElement(import_ui6.MenuItem, { onClick: handleClick, sx: { gap: 1.5, cursor: "pointer" } }, (0, import_react6.createElement)(config.icon, { fontSize: SIZE, color: isDisabled ? "disabled" : "action" }), /* @__PURE__ */ React6.createElement(import_ui6.Typography, { variant: "caption", color: isDisabled ? "text.disabled" : "text.primary" }, displayName), isDisabled && /* @__PURE__ */ React6.createElement(
|
|
1175
|
+
import_editor_ui2.PromotionPopover,
|
|
1173
1176
|
{
|
|
1174
|
-
|
|
1175
|
-
|
|
1177
|
+
open: isPopoverOpen,
|
|
1178
|
+
title,
|
|
1179
|
+
content,
|
|
1180
|
+
ctaText: (0, import_i18n7.__)("Upgrade now", "elementor"),
|
|
1181
|
+
ctaUrl: `https://go.elementor.com/go-pro-manager-${config.variableType}-variable/`,
|
|
1182
|
+
onClose: () => {
|
|
1183
|
+
setIsPopoverOpen(false);
|
|
1176
1184
|
}
|
|
1177
1185
|
},
|
|
1178
|
-
/* @__PURE__ */ React6.createElement(
|
|
1179
|
-
import_editor_ui2.PromotionPopover,
|
|
1180
|
-
{
|
|
1181
|
-
open: isPopoverOpen,
|
|
1182
|
-
title,
|
|
1183
|
-
content,
|
|
1184
|
-
ctaText: (0, import_i18n7.__)("Upgrade now", "elementor"),
|
|
1185
|
-
ctaUrl: `https://go.elementor.com/go-pro-manager-${config.variableType}-variable/`,
|
|
1186
|
-
onClose: () => {
|
|
1187
|
-
setIsPopoverOpen(false);
|
|
1188
|
-
}
|
|
1189
|
-
},
|
|
1190
|
-
/* @__PURE__ */ React6.createElement(
|
|
1191
|
-
import_editor_ui2.PromotionChip,
|
|
1192
|
-
{
|
|
1193
|
-
onClick: () => {
|
|
1194
|
-
setIsPopoverOpen(true);
|
|
1195
|
-
}
|
|
1196
|
-
}
|
|
1197
|
-
)
|
|
1198
|
-
)
|
|
1186
|
+
/* @__PURE__ */ React6.createElement(import_editor_ui2.PromotionChip, null)
|
|
1199
1187
|
));
|
|
1200
1188
|
};
|
|
1201
1189
|
var getDefaultName = (variables, type, baseName) => {
|
|
@@ -3809,14 +3797,6 @@ var React36 = __toESM(require("react"));
|
|
|
3809
3797
|
var import_react25 = require("react");
|
|
3810
3798
|
var import_editor_v1_adapters3 = require("@elementor/editor-v1-adapters");
|
|
3811
3799
|
var import_ui33 = require("@elementor/ui");
|
|
3812
|
-
|
|
3813
|
-
// src/sync/get-canvas-iframe-document.ts
|
|
3814
|
-
function getCanvasIframeDocument() {
|
|
3815
|
-
const extendedWindow = window;
|
|
3816
|
-
return extendedWindow.elementor?.$preview?.[0]?.contentDocument;
|
|
3817
|
-
}
|
|
3818
|
-
|
|
3819
|
-
// src/renderers/style-variables-renderer.tsx
|
|
3820
3800
|
var VARIABLES_WRAPPER = "body";
|
|
3821
3801
|
function StyleVariablesRenderer() {
|
|
3822
3802
|
const container = usePortalContainer();
|
|
@@ -3830,7 +3810,7 @@ function StyleVariablesRenderer() {
|
|
|
3830
3810
|
return /* @__PURE__ */ React36.createElement(import_ui33.Portal, { container }, /* @__PURE__ */ React36.createElement("style", { "data-e-style-id": "e-variables", key: wrappedCss }, wrappedCss));
|
|
3831
3811
|
}
|
|
3832
3812
|
function usePortalContainer() {
|
|
3833
|
-
return (0, import_editor_v1_adapters3.__privateUseListenTo)((0, import_editor_v1_adapters3.commandEndEvent)("editor/documents/attach-preview"), () => getCanvasIframeDocument()?.head);
|
|
3813
|
+
return (0, import_editor_v1_adapters3.__privateUseListenTo)((0, import_editor_v1_adapters3.commandEndEvent)("editor/documents/attach-preview"), () => (0, import_editor_v1_adapters3.getCanvasIframeDocument)()?.head);
|
|
3834
3814
|
}
|
|
3835
3815
|
function useStyleVariables() {
|
|
3836
3816
|
const [variables, setVariables] = (0, import_react25.useState)({});
|