@elementor/editor-variables 3.35.0-426 → 3.35.0-428
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 +72 -78
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +23 -37
- package/dist/index.mjs.map +1 -1
- package/package.json +15 -15
- package/src/components/ui/delete-confirmation-dialog.tsx +14 -37
package/dist/index.mjs
CHANGED
|
@@ -22,7 +22,7 @@ import {
|
|
|
22
22
|
Alert,
|
|
23
23
|
AlertAction,
|
|
24
24
|
AlertTitle,
|
|
25
|
-
Button as
|
|
25
|
+
Button as Button2,
|
|
26
26
|
CloseButton,
|
|
27
27
|
Divider,
|
|
28
28
|
Infotip,
|
|
@@ -720,30 +720,16 @@ var { registerVariableType, getVariableType, getVariableTypes, hasVariableType }
|
|
|
720
720
|
|
|
721
721
|
// src/components/ui/delete-confirmation-dialog.tsx
|
|
722
722
|
import * as React2 from "react";
|
|
723
|
-
import {
|
|
724
|
-
import {
|
|
725
|
-
Button,
|
|
726
|
-
Dialog,
|
|
727
|
-
DialogActions,
|
|
728
|
-
DialogContent,
|
|
729
|
-
DialogContentText,
|
|
730
|
-
DialogTitle,
|
|
731
|
-
Typography as Typography2
|
|
732
|
-
} from "@elementor/ui";
|
|
723
|
+
import { ConfirmationDialog } from "@elementor/editor-ui";
|
|
724
|
+
import { Typography as Typography2 } from "@elementor/ui";
|
|
733
725
|
import { __ as __4 } from "@wordpress/i18n";
|
|
734
|
-
var
|
|
735
|
-
|
|
736
|
-
open,
|
|
737
|
-
label,
|
|
738
|
-
closeDialog,
|
|
739
|
-
onConfirm
|
|
740
|
-
}) => {
|
|
741
|
-
return /* @__PURE__ */ React2.createElement(Dialog, { open, onClose: closeDialog, "aria-labelledby": TITLE_ID, maxWidth: "xs" }, /* @__PURE__ */ React2.createElement(DialogTitle, { id: TITLE_ID, display: "flex", alignItems: "center", gap: 1, sx: { lineHeight: 1 } }, /* @__PURE__ */ React2.createElement(AlertOctagonFilledIcon, { color: "error" }), __4("Delete this variable?", "elementor")), /* @__PURE__ */ React2.createElement(DialogContent, null, /* @__PURE__ */ React2.createElement(DialogContentText, { variant: "body2", color: "textPrimary" }, __4("All elements using", "elementor"), "\xA0", /* @__PURE__ */ React2.createElement(Typography2, { variant: "subtitle2", component: "span", sx: { lineBreak: "anywhere" } }, label), "\xA0", __4("will keep their current values, but the variable itself will be removed.", "elementor"))), /* @__PURE__ */ React2.createElement(DialogActions, null, /* @__PURE__ */ React2.createElement(Button, { color: "secondary", onClick: closeDialog }, __4("Not now", "elementor")), /* @__PURE__ */ React2.createElement(Button, { variant: "contained", color: "error", onClick: onConfirm }, __4("Delete", "elementor"))));
|
|
726
|
+
var DeleteConfirmationDialog = ({ open, label, closeDialog, onConfirm }) => {
|
|
727
|
+
return /* @__PURE__ */ React2.createElement(ConfirmationDialog, { open, onClose: closeDialog }, /* @__PURE__ */ React2.createElement(ConfirmationDialog.Title, null, __4("Delete this variable?", "elementor")), /* @__PURE__ */ React2.createElement(ConfirmationDialog.Content, null, /* @__PURE__ */ React2.createElement(ConfirmationDialog.ContentText, null, __4("All elements using", "elementor"), "\xA0", /* @__PURE__ */ React2.createElement(Typography2, { variant: "subtitle2", component: "span", sx: { lineBreak: "anywhere" } }, label), "\xA0", __4("will keep their current values, but the variable itself will be removed.", "elementor"))), /* @__PURE__ */ React2.createElement(ConfirmationDialog.Actions, { onClose: closeDialog, onConfirm }));
|
|
742
728
|
};
|
|
743
729
|
|
|
744
730
|
// src/components/ui/empty-state.tsx
|
|
745
731
|
import * as React3 from "react";
|
|
746
|
-
import { Button
|
|
732
|
+
import { Button, Stack as Stack2, Typography as Typography3 } from "@elementor/ui";
|
|
747
733
|
import { __ as __5 } from "@wordpress/i18n";
|
|
748
734
|
|
|
749
735
|
// src/hooks/use-permissions.ts
|
|
@@ -766,7 +752,7 @@ var EmptyState = ({ icon, title, message, onAdd, children }) => {
|
|
|
766
752
|
const canAdd = usePermissions().canAdd();
|
|
767
753
|
const displayTitle = canAdd ? title : __5("There are no variables", "elementor");
|
|
768
754
|
const displayMessage = canAdd ? message : __5("With your current role, you can only connect and detach variables.", "elementor");
|
|
769
|
-
return /* @__PURE__ */ React3.createElement(Content, { title: displayTitle, message: displayMessage, icon }, children || onAdd && /* @__PURE__ */ React3.createElement(
|
|
755
|
+
return /* @__PURE__ */ React3.createElement(Content, { title: displayTitle, message: displayMessage, icon }, children || onAdd && /* @__PURE__ */ React3.createElement(Button, { variant: "outlined", color: "secondary", size: "small", onClick: onAdd }, __5("Create a variable", "elementor")));
|
|
770
756
|
};
|
|
771
757
|
function Content({ title, message, icon, children }) {
|
|
772
758
|
return /* @__PURE__ */ React3.createElement(
|
|
@@ -1968,7 +1954,7 @@ function VariablesManagerPanel() {
|
|
|
1968
1954
|
}
|
|
1969
1955
|
},
|
|
1970
1956
|
/* @__PURE__ */ React12.createElement(
|
|
1971
|
-
|
|
1957
|
+
Button2,
|
|
1972
1958
|
{
|
|
1973
1959
|
fullWidth: true,
|
|
1974
1960
|
size: "small",
|
|
@@ -2079,7 +2065,7 @@ import { PopoverContent, useBoundProp as useBoundProp4 } from "@elementor/editor
|
|
|
2079
2065
|
import { PopoverBody } from "@elementor/editor-editing-panel";
|
|
2080
2066
|
import { PopoverHeader } from "@elementor/editor-ui";
|
|
2081
2067
|
import { ArrowLeftIcon } from "@elementor/icons";
|
|
2082
|
-
import { Button as
|
|
2068
|
+
import { Button as Button3, CardActions, Divider as Divider2, FormHelperText as FormHelperText2, IconButton as IconButton4, Typography as Typography6 } from "@elementor/ui";
|
|
2083
2069
|
import { __ as __10 } from "@wordpress/i18n";
|
|
2084
2070
|
|
|
2085
2071
|
// src/hooks/use-initial-value.ts
|
|
@@ -2238,7 +2224,7 @@ var VariableCreation = ({ onGoBack, onClose }) => {
|
|
|
2238
2224
|
propType
|
|
2239
2225
|
}
|
|
2240
2226
|
))), errorMessage && /* @__PURE__ */ React15.createElement(FormHelperText2, { error: true }, errorMessage)), /* @__PURE__ */ React15.createElement(CardActions, { sx: { pt: 0.5, pb: 1 } }, /* @__PURE__ */ React15.createElement(
|
|
2241
|
-
|
|
2227
|
+
Button3,
|
|
2242
2228
|
{
|
|
2243
2229
|
id: "create-variable-button",
|
|
2244
2230
|
size: "small",
|
|
@@ -2258,7 +2244,7 @@ import { useSuppressedMessage } from "@elementor/editor-current-user";
|
|
|
2258
2244
|
import { PopoverBody as PopoverBody2 } from "@elementor/editor-editing-panel";
|
|
2259
2245
|
import { PopoverHeader as PopoverHeader2 } from "@elementor/editor-ui";
|
|
2260
2246
|
import { ArrowLeftIcon as ArrowLeftIcon2, TrashIcon as TrashIcon2 } from "@elementor/icons";
|
|
2261
|
-
import { Button as
|
|
2247
|
+
import { Button as Button5, CardActions as CardActions2, Divider as Divider3, FormHelperText as FormHelperText3, IconButton as IconButton5, Tooltip, Typography as Typography8 } from "@elementor/ui";
|
|
2262
2248
|
import { __ as __12 } from "@wordpress/i18n";
|
|
2263
2249
|
|
|
2264
2250
|
// src/components/ui/edit-confirmation-dialog.tsx
|
|
@@ -2266,13 +2252,13 @@ import * as React16 from "react";
|
|
|
2266
2252
|
import { useState as useState9 } from "react";
|
|
2267
2253
|
import { AlertTriangleFilledIcon as AlertTriangleFilledIcon3 } from "@elementor/icons";
|
|
2268
2254
|
import {
|
|
2269
|
-
Button as
|
|
2255
|
+
Button as Button4,
|
|
2270
2256
|
Checkbox,
|
|
2271
|
-
Dialog
|
|
2272
|
-
DialogActions
|
|
2273
|
-
DialogContent
|
|
2274
|
-
DialogContentText
|
|
2275
|
-
DialogTitle
|
|
2257
|
+
Dialog,
|
|
2258
|
+
DialogActions,
|
|
2259
|
+
DialogContent,
|
|
2260
|
+
DialogContentText,
|
|
2261
|
+
DialogTitle,
|
|
2276
2262
|
FormControlLabel,
|
|
2277
2263
|
Typography as Typography7
|
|
2278
2264
|
} from "@elementor/ui";
|
|
@@ -2290,10 +2276,10 @@ var EditConfirmationDialog = ({
|
|
|
2290
2276
|
}
|
|
2291
2277
|
onConfirm?.();
|
|
2292
2278
|
};
|
|
2293
|
-
return /* @__PURE__ */ React16.createElement(
|
|
2279
|
+
return /* @__PURE__ */ React16.createElement(Dialog, { open: true, onClose: closeDialog, maxWidth: "xs" }, /* @__PURE__ */ React16.createElement(DialogTitle, { display: "flex", alignItems: "center", gap: 1 }, /* @__PURE__ */ React16.createElement(AlertTriangleFilledIcon3, { color: "secondary" }), __11("Changes to variables go live right away.", "elementor")), /* @__PURE__ */ React16.createElement(DialogContent, null, /* @__PURE__ */ React16.createElement(DialogContentText, { variant: "body2", color: "textPrimary" }, __11(
|
|
2294
2280
|
"Don't worry - all other changes you make will wait until you publish your site.",
|
|
2295
2281
|
"elementor"
|
|
2296
|
-
))), /* @__PURE__ */ React16.createElement(
|
|
2282
|
+
))), /* @__PURE__ */ React16.createElement(DialogActions, { sx: { justifyContent: "space-between", alignItems: "center" } }, /* @__PURE__ */ React16.createElement(
|
|
2297
2283
|
FormControlLabel,
|
|
2298
2284
|
{
|
|
2299
2285
|
control: /* @__PURE__ */ React16.createElement(
|
|
@@ -2306,7 +2292,7 @@ var EditConfirmationDialog = ({
|
|
|
2306
2292
|
),
|
|
2307
2293
|
label: /* @__PURE__ */ React16.createElement(Typography7, { variant: "body2" }, __11("Don't show me again", "elementor"))
|
|
2308
2294
|
}
|
|
2309
|
-
), /* @__PURE__ */ React16.createElement("div", null, /* @__PURE__ */ React16.createElement(
|
|
2295
|
+
), /* @__PURE__ */ React16.createElement("div", null, /* @__PURE__ */ React16.createElement(Button4, { color: "secondary", onClick: closeDialog }, __11("Keep editing", "elementor")), /* @__PURE__ */ React16.createElement(Button4, { variant: "contained", color: "secondary", onClick: handleSave, sx: { ml: 1 } }, __11("Save", "elementor")))));
|
|
2310
2296
|
};
|
|
2311
2297
|
|
|
2312
2298
|
// src/components/variable-edit.tsx
|
|
@@ -2467,7 +2453,7 @@ var VariableEdit = ({ onClose, onGoBack, onSubmit, editId }) => {
|
|
|
2467
2453
|
onValidationChange: setValueFieldError,
|
|
2468
2454
|
propType
|
|
2469
2455
|
}
|
|
2470
|
-
))), errorMessage && /* @__PURE__ */ React17.createElement(FormHelperText3, { error: true }, errorMessage)), /* @__PURE__ */ React17.createElement(CardActions2, { sx: { pt: 0.5, pb: 1 } }, /* @__PURE__ */ React17.createElement(
|
|
2456
|
+
))), errorMessage && /* @__PURE__ */ React17.createElement(FormHelperText3, { error: true }, errorMessage)), /* @__PURE__ */ React17.createElement(CardActions2, { sx: { pt: 0.5, pb: 1 } }, /* @__PURE__ */ React17.createElement(Button5, { size: "small", variant: "contained", disabled: isSubmitDisabled, onClick: handleUpdate }, __12("Save", "elementor")))), deleteConfirmation && /* @__PURE__ */ React17.createElement(
|
|
2471
2457
|
DeleteConfirmationDialog,
|
|
2472
2458
|
{
|
|
2473
2459
|
open: true,
|
|
@@ -2915,7 +2901,7 @@ import { useState as useState13 } from "react";
|
|
|
2915
2901
|
import { PopoverContent as PopoverContent3, useBoundProp as useBoundProp7 } from "@elementor/editor-controls";
|
|
2916
2902
|
import { PopoverBody as PopoverBody4 } from "@elementor/editor-editing-panel";
|
|
2917
2903
|
import { PopoverHeader as PopoverHeader4 } from "@elementor/editor-ui";
|
|
2918
|
-
import { Button as
|
|
2904
|
+
import { Button as Button6, CardActions as CardActions3, Divider as Divider5, FormHelperText as FormHelperText4, Typography as Typography11 } from "@elementor/ui";
|
|
2919
2905
|
import { __ as __16 } from "@wordpress/i18n";
|
|
2920
2906
|
var SIZE7 = "tiny";
|
|
2921
2907
|
var VariableRestore = ({ variableId, onClose, onSubmit }) => {
|
|
@@ -3017,7 +3003,7 @@ var VariableRestore = ({ variableId, onClose, onSubmit }) => {
|
|
|
3017
3003
|
onValidationChange: setValueFieldError,
|
|
3018
3004
|
propType
|
|
3019
3005
|
}
|
|
3020
|
-
))), errorMessage && /* @__PURE__ */ React23.createElement(FormHelperText4, { error: true }, errorMessage)), /* @__PURE__ */ React23.createElement(CardActions3, { sx: { pt: 0.5, pb: 1 } }, /* @__PURE__ */ React23.createElement(
|
|
3006
|
+
))), errorMessage && /* @__PURE__ */ React23.createElement(FormHelperText4, { error: true }, errorMessage)), /* @__PURE__ */ React23.createElement(CardActions3, { sx: { pt: 0.5, pb: 1 } }, /* @__PURE__ */ React23.createElement(Button6, { size: "small", variant: "contained", disabled: isSubmitDisabled, onClick: handleRestore }, __16("Restore", "elementor")))));
|
|
3021
3007
|
};
|
|
3022
3008
|
|
|
3023
3009
|
// src/components/ui/deleted-variable-alert.tsx
|