@elementor/editor-components 4.1.0-692 → 4.1.0-694
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 +248 -126
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +229 -107
- package/dist/index.mjs.map +1 -1
- package/package.json +23 -23
- package/src/components/components-tab/components-list.tsx +47 -2
- package/src/components/components-tab/components-pro-notification.tsx +1 -1
- package/src/components/components-tab/components-update-notification.tsx +13 -0
- package/src/components/components-tab/components.tsx +5 -4
- package/src/components/components-update-alert.tsx +40 -0
- package/src/components/instance-editing-panel/instance-editing-panel.tsx +19 -10
- package/src/create-component-type.ts +42 -7
- package/src/sync/publish-draft-components-in-page-before-save.ts +1 -1
- package/src/utils/is-pro-components-supported.ts +11 -0
package/dist/index.js
CHANGED
|
@@ -94,7 +94,7 @@ var import_editor_elements_panel = require("@elementor/editor-elements-panel");
|
|
|
94
94
|
var import_editor_styles_repository2 = require("@elementor/editor-styles-repository");
|
|
95
95
|
var import_editor_v1_adapters6 = require("@elementor/editor-v1-adapters");
|
|
96
96
|
var import_store36 = require("@elementor/store");
|
|
97
|
-
var
|
|
97
|
+
var import_i18n16 = require("@wordpress/i18n");
|
|
98
98
|
|
|
99
99
|
// src/component-instance-transformer.ts
|
|
100
100
|
var import_editor_canvas = require("@elementor/editor-canvas");
|
|
@@ -490,11 +490,10 @@ var componentOverrideTransformer = (0, import_editor_canvas3.createTransformer)(
|
|
|
490
490
|
});
|
|
491
491
|
|
|
492
492
|
// src/components/components-tab/components.tsx
|
|
493
|
-
var
|
|
493
|
+
var React10 = __toESM(require("react"));
|
|
494
494
|
var import_react3 = require("react");
|
|
495
495
|
var import_editor_ui2 = require("@elementor/editor-ui");
|
|
496
|
-
var
|
|
497
|
-
var import_utils3 = require("@elementor/utils");
|
|
496
|
+
var import_ui7 = require("@elementor/ui");
|
|
498
497
|
|
|
499
498
|
// src/hooks/use-components.ts
|
|
500
499
|
var import_store6 = require("@elementor/store");
|
|
@@ -504,6 +503,16 @@ var useComponents = () => {
|
|
|
504
503
|
return { components, isLoading };
|
|
505
504
|
};
|
|
506
505
|
|
|
506
|
+
// src/utils/is-pro-components-supported.ts
|
|
507
|
+
var import_utils = require("@elementor/utils");
|
|
508
|
+
var MIN_PRO_VERSION_FOR_COMPONENTS = "4.0";
|
|
509
|
+
function isProComponentsSupported() {
|
|
510
|
+
return (0, import_utils.hasProInstalled)() && (0, import_utils.isProAtLeast)(MIN_PRO_VERSION_FOR_COMPONENTS);
|
|
511
|
+
}
|
|
512
|
+
function isProOutdatedForComponents() {
|
|
513
|
+
return (0, import_utils.hasProInstalled)() && !(0, import_utils.isProAtLeast)(MIN_PRO_VERSION_FOR_COMPONENTS);
|
|
514
|
+
}
|
|
515
|
+
|
|
507
516
|
// src/components/components-tab/component-search.tsx
|
|
508
517
|
var React2 = __toESM(require("react"));
|
|
509
518
|
var import_icons = require("@elementor/icons");
|
|
@@ -513,13 +522,13 @@ var import_i18n = require("@wordpress/i18n");
|
|
|
513
522
|
// src/components/components-tab/search-provider.tsx
|
|
514
523
|
var React = __toESM(require("react"));
|
|
515
524
|
var import_react = require("react");
|
|
516
|
-
var
|
|
525
|
+
var import_utils2 = require("@elementor/utils");
|
|
517
526
|
var SearchContext = (0, import_react.createContext)(void 0);
|
|
518
527
|
var SearchProvider = ({
|
|
519
528
|
children,
|
|
520
529
|
localStorageKey
|
|
521
530
|
}) => {
|
|
522
|
-
const { debouncedValue, handleChange, inputValue } = (0,
|
|
531
|
+
const { debouncedValue, handleChange, inputValue } = (0, import_utils2.useSearchState)({ localStorageKey });
|
|
523
532
|
const clearSearch = () => {
|
|
524
533
|
handleChange("");
|
|
525
534
|
};
|
|
@@ -556,7 +565,6 @@ var ComponentSearch = () => {
|
|
|
556
565
|
var React5 = __toESM(require("react"));
|
|
557
566
|
var import_icons3 = require("@elementor/icons");
|
|
558
567
|
var import_ui4 = require("@elementor/ui");
|
|
559
|
-
var import_utils2 = require("@elementor/utils");
|
|
560
568
|
var import_i18n2 = require("@wordpress/i18n");
|
|
561
569
|
|
|
562
570
|
// src/hooks/use-components-permissions.ts
|
|
@@ -701,6 +709,7 @@ var LoadingComponents = () => {
|
|
|
701
709
|
// src/components/components-tab/components-list.tsx
|
|
702
710
|
var LEARN_MORE_URL = "http://go.elementor.com/components-guide-article";
|
|
703
711
|
var UPGRADE_URL = "https://go.elementor.com/go-pro-components/";
|
|
712
|
+
var UPDATE_PLUGINS_URL = "/wp-admin/plugins.php";
|
|
704
713
|
var SUBTITLE_OVERRIDE_SX = {
|
|
705
714
|
fontSize: "0.875rem !important",
|
|
706
715
|
fontWeight: "500 !important"
|
|
@@ -715,7 +724,10 @@ function ComponentsList() {
|
|
|
715
724
|
if (searchValue.length) {
|
|
716
725
|
return /* @__PURE__ */ React5.createElement(EmptySearchResult, null);
|
|
717
726
|
}
|
|
718
|
-
|
|
727
|
+
if (isProOutdatedForComponents()) {
|
|
728
|
+
return /* @__PURE__ */ React5.createElement(ProOutdatedEmptyState, null);
|
|
729
|
+
}
|
|
730
|
+
return isProComponentsSupported() ? /* @__PURE__ */ React5.createElement(EmptyState, null) : /* @__PURE__ */ React5.createElement(ProUpgradeEmptyState, null);
|
|
719
731
|
}
|
|
720
732
|
return /* @__PURE__ */ React5.createElement(import_ui4.List, { sx: { display: "flex", flexDirection: "column", gap: 1, px: 2 } }, components.map((component) => /* @__PURE__ */ React5.createElement(ComponentItem, { key: component.uid, component })));
|
|
721
733
|
}
|
|
@@ -746,6 +758,32 @@ var ProUpgradeEmptyState = () => {
|
|
|
746
758
|
)
|
|
747
759
|
);
|
|
748
760
|
};
|
|
761
|
+
var ProOutdatedEmptyState = () => {
|
|
762
|
+
return /* @__PURE__ */ React5.createElement(
|
|
763
|
+
import_ui4.Stack,
|
|
764
|
+
{
|
|
765
|
+
alignItems: "center",
|
|
766
|
+
justifyContent: "start",
|
|
767
|
+
height: "100%",
|
|
768
|
+
sx: { px: 2, py: 4, maxWidth: 268, m: "auto" },
|
|
769
|
+
gap: 2,
|
|
770
|
+
overflow: "hidden"
|
|
771
|
+
},
|
|
772
|
+
/* @__PURE__ */ React5.createElement(import_ui4.Stack, { alignItems: "center", gap: 1 }, /* @__PURE__ */ React5.createElement(import_icons3.ComponentsIcon, { fontSize: "large", sx: { color: "text.secondary" } }), /* @__PURE__ */ React5.createElement(import_ui4.Typography, { align: "center", variant: "subtitle2", color: "text.secondary", sx: SUBTITLE_OVERRIDE_SX }, (0, import_i18n2.__)("Create Reusable Components", "elementor")), /* @__PURE__ */ React5.createElement(import_ui4.Typography, { align: "center", variant: "caption", color: "secondary" }, (0, import_i18n2.__)("Create design elements that sync across your entire site.", "elementor")), /* @__PURE__ */ React5.createElement(import_ui4.Typography, { align: "center", variant: "caption", color: "secondary", sx: { mt: 1 } }, (0, import_i18n2.__)("To create components, update Elementor Pro to the latest version.", "elementor"))),
|
|
773
|
+
/* @__PURE__ */ React5.createElement(
|
|
774
|
+
import_ui4.Button,
|
|
775
|
+
{
|
|
776
|
+
variant: "text",
|
|
777
|
+
color: "info",
|
|
778
|
+
size: "small",
|
|
779
|
+
href: UPDATE_PLUGINS_URL,
|
|
780
|
+
target: "_blank",
|
|
781
|
+
rel: "noopener noreferrer"
|
|
782
|
+
},
|
|
783
|
+
(0, import_i18n2.__)("Update Elementor Pro", "elementor")
|
|
784
|
+
)
|
|
785
|
+
);
|
|
786
|
+
};
|
|
749
787
|
var EmptyState = () => {
|
|
750
788
|
const { canCreate } = useComponentsPermissions();
|
|
751
789
|
return /* @__PURE__ */ React5.createElement(
|
|
@@ -888,7 +926,7 @@ function ComponentsUpgradeAlert({ title, description, upgradeUrl }) {
|
|
|
888
926
|
}
|
|
889
927
|
|
|
890
928
|
// src/components/components-tab/components-pro-notification.tsx
|
|
891
|
-
var UPGRADE_URL2 = "https://go.elementor.com/go-pro-components-
|
|
929
|
+
var UPGRADE_URL2 = "https://go.elementor.com/go-pro-components-exist-footer/";
|
|
892
930
|
function ComponentsProNotification() {
|
|
893
931
|
return /* @__PURE__ */ React7.createElement(
|
|
894
932
|
ComponentsUpgradeAlert,
|
|
@@ -900,6 +938,54 @@ function ComponentsProNotification() {
|
|
|
900
938
|
);
|
|
901
939
|
}
|
|
902
940
|
|
|
941
|
+
// src/components/components-tab/components-update-notification.tsx
|
|
942
|
+
var React9 = __toESM(require("react"));
|
|
943
|
+
var import_i18n6 = require("@wordpress/i18n");
|
|
944
|
+
|
|
945
|
+
// src/components/components-update-alert.tsx
|
|
946
|
+
var React8 = __toESM(require("react"));
|
|
947
|
+
var import_icons5 = require("@elementor/icons");
|
|
948
|
+
var import_ui6 = require("@elementor/ui");
|
|
949
|
+
var import_i18n5 = require("@wordpress/i18n");
|
|
950
|
+
var UPDATE_PLUGINS_URL2 = "/wp-admin/plugins.php";
|
|
951
|
+
function ComponentsUpdateAlert({ title, description }) {
|
|
952
|
+
return /* @__PURE__ */ React8.createElement(import_ui6.Box, { sx: { mt: "auto", position: "sticky", bottom: 0 } }, /* @__PURE__ */ React8.createElement(
|
|
953
|
+
import_ui6.Alert,
|
|
954
|
+
{
|
|
955
|
+
variant: "standard",
|
|
956
|
+
color: "info",
|
|
957
|
+
icon: /* @__PURE__ */ React8.createElement(import_icons5.InfoCircleFilledIcon, { fontSize: "tiny" }),
|
|
958
|
+
role: "status",
|
|
959
|
+
size: "small",
|
|
960
|
+
action: /* @__PURE__ */ React8.createElement(
|
|
961
|
+
import_ui6.AlertAction,
|
|
962
|
+
{
|
|
963
|
+
variant: "contained",
|
|
964
|
+
color: "info",
|
|
965
|
+
href: UPDATE_PLUGINS_URL2,
|
|
966
|
+
target: "_blank",
|
|
967
|
+
rel: "noopener noreferrer"
|
|
968
|
+
},
|
|
969
|
+
(0, import_i18n5.__)("Upgrade Now", "elementor")
|
|
970
|
+
),
|
|
971
|
+
sx: { m: 2, mt: 1 }
|
|
972
|
+
},
|
|
973
|
+
/* @__PURE__ */ React8.createElement(import_ui6.AlertTitle, null, title),
|
|
974
|
+
/* @__PURE__ */ React8.createElement(import_ui6.Typography, { variant: "caption" }, description)
|
|
975
|
+
));
|
|
976
|
+
}
|
|
977
|
+
|
|
978
|
+
// src/components/components-tab/components-update-notification.tsx
|
|
979
|
+
function ComponentsUpdateNotification() {
|
|
980
|
+
return /* @__PURE__ */ React9.createElement(
|
|
981
|
+
ComponentsUpdateAlert,
|
|
982
|
+
{
|
|
983
|
+
title: (0, import_i18n6.__)("Create new Components", "elementor"),
|
|
984
|
+
description: (0, import_i18n6.__)("To create new components, update Elementor Pro to the latest version.", "elementor")
|
|
985
|
+
}
|
|
986
|
+
);
|
|
987
|
+
}
|
|
988
|
+
|
|
903
989
|
// src/components/components-tab/components.tsx
|
|
904
990
|
var FULL_HEIGHT_STYLE_ID = "components-full-height-panel";
|
|
905
991
|
var FULL_HEIGHT_CSS = `
|
|
@@ -940,34 +1026,34 @@ var useFullHeightPanel = () => {
|
|
|
940
1026
|
var ComponentsContent = () => {
|
|
941
1027
|
const { components, isLoading } = useComponents();
|
|
942
1028
|
const hasComponents = !isLoading && components.length > 0;
|
|
943
|
-
const
|
|
944
|
-
const
|
|
1029
|
+
const showProNotification = !isProComponentsSupported() && hasComponents;
|
|
1030
|
+
const isOutdated = isProOutdatedForComponents();
|
|
945
1031
|
useFullHeightPanel();
|
|
946
|
-
return /* @__PURE__ */
|
|
1032
|
+
return /* @__PURE__ */ React10.createElement(import_ui7.Stack, { justifyContent: "space-between", sx: { flex: 1, minHeight: 0 } }, hasComponents && /* @__PURE__ */ React10.createElement(ComponentSearch, null), /* @__PURE__ */ React10.createElement(ComponentsList, null), showProNotification && (isOutdated ? /* @__PURE__ */ React10.createElement(ComponentsUpdateNotification, null) : /* @__PURE__ */ React10.createElement(ComponentsProNotification, null)));
|
|
947
1033
|
};
|
|
948
1034
|
var Components = () => {
|
|
949
|
-
return /* @__PURE__ */
|
|
1035
|
+
return /* @__PURE__ */ React10.createElement(import_editor_ui2.ThemeProvider, null, /* @__PURE__ */ React10.createElement(SearchProvider, { localStorageKey: "elementor-components-search" }, /* @__PURE__ */ React10.createElement(ComponentsContent, null)));
|
|
950
1036
|
};
|
|
951
1037
|
|
|
952
1038
|
// src/components/detach-instance-confirmation-dialog.tsx
|
|
953
|
-
var
|
|
1039
|
+
var React11 = __toESM(require("react"));
|
|
954
1040
|
var import_editor_ui3 = require("@elementor/editor-ui");
|
|
955
|
-
var
|
|
956
|
-
var
|
|
1041
|
+
var import_icons6 = require("@elementor/icons");
|
|
1042
|
+
var import_i18n7 = require("@wordpress/i18n");
|
|
957
1043
|
function DetachInstanceConfirmationDialog({
|
|
958
1044
|
open,
|
|
959
1045
|
onClose,
|
|
960
1046
|
onConfirm
|
|
961
1047
|
}) {
|
|
962
|
-
return /* @__PURE__ */
|
|
1048
|
+
return /* @__PURE__ */ React11.createElement(import_editor_ui3.ConfirmationDialog, { open, onClose }, /* @__PURE__ */ React11.createElement(import_editor_ui3.ConfirmationDialog.Title, { icon: import_icons6.AlertTriangleFilledIcon, iconColor: "secondary" }, (0, import_i18n7.__)("Detach from Component?", "elementor")), /* @__PURE__ */ React11.createElement(import_editor_ui3.ConfirmationDialog.Content, null, /* @__PURE__ */ React11.createElement(import_editor_ui3.ConfirmationDialog.ContentText, null, (0, import_i18n7.__)(
|
|
963
1049
|
"Detaching this instance will break its link to the Component. Changes to the Component will no longer apply. Continue?",
|
|
964
1050
|
"elementor"
|
|
965
|
-
))), /* @__PURE__ */
|
|
1051
|
+
))), /* @__PURE__ */ React11.createElement(
|
|
966
1052
|
import_editor_ui3.ConfirmationDialog.Actions,
|
|
967
1053
|
{
|
|
968
1054
|
onClose,
|
|
969
1055
|
onConfirm,
|
|
970
|
-
confirmLabel: (0,
|
|
1056
|
+
confirmLabel: (0, import_i18n7.__)("Detach", "elementor"),
|
|
971
1057
|
color: "primary"
|
|
972
1058
|
}
|
|
973
1059
|
));
|
|
@@ -978,59 +1064,58 @@ function openDetachConfirmDialog(onConfirm) {
|
|
|
978
1064
|
onConfirm();
|
|
979
1065
|
};
|
|
980
1066
|
(0, import_editor_ui3.openDialog)({
|
|
981
|
-
component: /* @__PURE__ */
|
|
1067
|
+
component: /* @__PURE__ */ React11.createElement(DetachInstanceConfirmationDialog, { open: true, onClose: import_editor_ui3.closeDialog, onConfirm: handleConfirm })
|
|
982
1068
|
});
|
|
983
1069
|
}
|
|
984
1070
|
|
|
985
1071
|
// src/components/in-edit-mode.tsx
|
|
986
|
-
var
|
|
1072
|
+
var React12 = __toESM(require("react"));
|
|
987
1073
|
var import_editor_ui4 = require("@elementor/editor-ui");
|
|
988
|
-
var
|
|
989
|
-
var
|
|
990
|
-
var
|
|
1074
|
+
var import_icons7 = require("@elementor/icons");
|
|
1075
|
+
var import_ui8 = require("@elementor/ui");
|
|
1076
|
+
var import_i18n8 = require("@wordpress/i18n");
|
|
991
1077
|
var openEditModeDialog = (lockedBy) => {
|
|
992
1078
|
(0, import_editor_ui4.openDialog)({
|
|
993
|
-
component: /* @__PURE__ */
|
|
1079
|
+
component: /* @__PURE__ */ React12.createElement(EditModeDialog, { lockedBy })
|
|
994
1080
|
});
|
|
995
1081
|
};
|
|
996
1082
|
var EditModeDialog = ({ lockedBy }) => {
|
|
997
|
-
const content = (0,
|
|
998
|
-
return /* @__PURE__ */
|
|
1083
|
+
const content = (0, import_i18n8.__)("%s is currently editing this document", "elementor").replace("%s", lockedBy);
|
|
1084
|
+
return /* @__PURE__ */ React12.createElement(React12.Fragment, null, /* @__PURE__ */ React12.createElement(import_ui8.DialogHeader, { logo: false }, /* @__PURE__ */ React12.createElement(import_ui8.Box, { display: "flex", alignItems: "center", gap: 1 }, /* @__PURE__ */ React12.createElement(import_ui8.Icon, { color: "secondary" }, /* @__PURE__ */ React12.createElement(import_icons7.InfoCircleFilledIcon, { fontSize: "medium" })), /* @__PURE__ */ React12.createElement(import_ui8.Typography, { variant: "subtitle1" }, content))), /* @__PURE__ */ React12.createElement(import_ui8.DialogContent, null, /* @__PURE__ */ React12.createElement(import_ui8.Stack, { spacing: 2, direction: "column" }, /* @__PURE__ */ React12.createElement(import_ui8.Typography, { variant: "body2" }, (0, import_i18n8.__)(
|
|
999
1085
|
"You can wait for them to finish or reach out to coordinate your changes together.",
|
|
1000
1086
|
"elementor"
|
|
1001
|
-
)), /* @__PURE__ */
|
|
1087
|
+
)), /* @__PURE__ */ React12.createElement(import_ui8.DialogActions, null, /* @__PURE__ */ React12.createElement(import_ui8.Button, { color: "secondary", variant: "contained", onClick: import_editor_ui4.closeDialog }, (0, import_i18n8.__)("Close", "elementor"))))));
|
|
1002
1088
|
};
|
|
1003
1089
|
|
|
1004
1090
|
// src/components/instance-editing-panel/instance-editing-panel.tsx
|
|
1005
|
-
var
|
|
1006
|
-
var
|
|
1007
|
-
var
|
|
1008
|
-
var
|
|
1009
|
-
var import_i18n10 = require("@wordpress/i18n");
|
|
1091
|
+
var React22 = __toESM(require("react"));
|
|
1092
|
+
var import_icons11 = require("@elementor/icons");
|
|
1093
|
+
var import_ui15 = require("@elementor/ui");
|
|
1094
|
+
var import_i18n12 = require("@wordpress/i18n");
|
|
1010
1095
|
|
|
1011
1096
|
// src/provider/component-instance-context.tsx
|
|
1012
|
-
var
|
|
1097
|
+
var React13 = __toESM(require("react"));
|
|
1013
1098
|
var import_react4 = require("react");
|
|
1014
1099
|
var ComponentInstanceContext = (0, import_react4.createContext)(null);
|
|
1015
1100
|
function ComponentInstanceProvider({ children, ...props }) {
|
|
1016
|
-
return /* @__PURE__ */
|
|
1101
|
+
return /* @__PURE__ */ React13.createElement(ComponentInstanceContext.Provider, { value: props }, children);
|
|
1017
1102
|
}
|
|
1018
1103
|
var useComponentId = () => (0, import_react4.useContext)(ComponentInstanceContext)?.componentId;
|
|
1019
1104
|
var useComponentInstanceOverrides = () => (0, import_react4.useContext)(ComponentInstanceContext)?.overrides;
|
|
1020
1105
|
var useComponentOverridableProps = () => (0, import_react4.useContext)(ComponentInstanceContext)?.overridableProps;
|
|
1021
1106
|
|
|
1022
1107
|
// src/components/instance-editing-panel/detach-action.tsx
|
|
1023
|
-
var
|
|
1108
|
+
var React15 = __toESM(require("react"));
|
|
1024
1109
|
var import_react5 = require("react");
|
|
1025
1110
|
var import_editor_notifications = require("@elementor/editor-notifications");
|
|
1026
|
-
var
|
|
1027
|
-
var
|
|
1111
|
+
var import_icons9 = require("@elementor/icons");
|
|
1112
|
+
var import_i18n10 = require("@wordpress/i18n");
|
|
1028
1113
|
|
|
1029
1114
|
// src/utils/detach-component-instance/detach-component-instance.ts
|
|
1030
1115
|
var import_editor_elements3 = require("@elementor/editor-elements");
|
|
1031
1116
|
var import_editor_v1_adapters2 = require("@elementor/editor-v1-adapters");
|
|
1032
1117
|
var import_store10 = require("@elementor/store");
|
|
1033
|
-
var
|
|
1118
|
+
var import_i18n9 = require("@wordpress/i18n");
|
|
1034
1119
|
|
|
1035
1120
|
// src/prop-types/component-instance-overrides-prop-type.ts
|
|
1036
1121
|
var import_editor_props3 = require("@elementor/editor-props");
|
|
@@ -1379,8 +1464,8 @@ async function detachComponentInstance({
|
|
|
1379
1464
|
}
|
|
1380
1465
|
},
|
|
1381
1466
|
{
|
|
1382
|
-
title: (0,
|
|
1383
|
-
subtitle: (0,
|
|
1467
|
+
title: (0, import_i18n9.__)("Detach from Component", "elementor"),
|
|
1468
|
+
subtitle: (0, import_i18n9.__)("Instance detached", "elementor")
|
|
1384
1469
|
}
|
|
1385
1470
|
);
|
|
1386
1471
|
return undoableDetach();
|
|
@@ -1395,16 +1480,16 @@ function extractInstanceOverrides(instanceContainer) {
|
|
|
1395
1480
|
}
|
|
1396
1481
|
|
|
1397
1482
|
// src/components/instance-editing-panel/instance-panel-header.tsx
|
|
1398
|
-
var
|
|
1483
|
+
var React14 = __toESM(require("react"));
|
|
1399
1484
|
var import_editor_panels = require("@elementor/editor-panels");
|
|
1400
1485
|
var import_editor_ui5 = require("@elementor/editor-ui");
|
|
1401
|
-
var
|
|
1402
|
-
var
|
|
1486
|
+
var import_icons8 = require("@elementor/icons");
|
|
1487
|
+
var import_ui9 = require("@elementor/ui");
|
|
1403
1488
|
function InstancePanelHeader({ componentName, actions }) {
|
|
1404
|
-
return /* @__PURE__ */
|
|
1489
|
+
return /* @__PURE__ */ React14.createElement(import_editor_panels.PanelHeader, { sx: { justifyContent: "start", px: 2 } }, /* @__PURE__ */ React14.createElement(import_ui9.Stack, { direction: "row", alignItems: "center", flexGrow: 1, gap: 1, maxWidth: "100%" }, /* @__PURE__ */ React14.createElement(import_icons8.ComponentsIcon, { fontSize: "small", sx: { color: "text.tertiary" } }), /* @__PURE__ */ React14.createElement(import_editor_ui5.EllipsisWithTooltip, { title: componentName, as: import_editor_panels.PanelHeaderTitle, sx: { flexGrow: 1 } }), actions));
|
|
1405
1490
|
}
|
|
1406
1491
|
function EditComponentAction({ label, onClick, disabled = false, icon: Icon2 }) {
|
|
1407
|
-
return /* @__PURE__ */
|
|
1492
|
+
return /* @__PURE__ */ React14.createElement(import_ui9.Tooltip, { title: label }, /* @__PURE__ */ React14.createElement(import_ui9.IconButton, { size: "tiny", onClick, "aria-label": label, disabled }, /* @__PURE__ */ React14.createElement(Icon2, { fontSize: "tiny" })));
|
|
1408
1493
|
}
|
|
1409
1494
|
|
|
1410
1495
|
// src/components/instance-editing-panel/detach-action.tsx
|
|
@@ -1424,7 +1509,7 @@ var DetachAction = ({
|
|
|
1424
1509
|
} catch {
|
|
1425
1510
|
(0, import_editor_notifications.notify)({
|
|
1426
1511
|
type: "error",
|
|
1427
|
-
message: (0,
|
|
1512
|
+
message: (0, import_i18n10.__)("Failed to detach component instance.", "elementor"),
|
|
1428
1513
|
id: "detach-component-instance-failed"
|
|
1429
1514
|
});
|
|
1430
1515
|
}
|
|
@@ -1435,8 +1520,8 @@ var DetachAction = ({
|
|
|
1435
1520
|
const handleDetachClick = () => {
|
|
1436
1521
|
setIsDetachDialogOpen(true);
|
|
1437
1522
|
};
|
|
1438
|
-
const detachLabel = (0,
|
|
1439
|
-
return /* @__PURE__ */
|
|
1523
|
+
const detachLabel = (0, import_i18n10.__)("Detach from Component", "elementor");
|
|
1524
|
+
return /* @__PURE__ */ React15.createElement(React15.Fragment, null, /* @__PURE__ */ React15.createElement(EditComponentAction, { label: detachLabel, icon: import_icons9.DetachIcon, onClick: handleDetachClick }), /* @__PURE__ */ React15.createElement(
|
|
1440
1525
|
DetachInstanceConfirmationDialog,
|
|
1441
1526
|
{
|
|
1442
1527
|
open: isDetachDialogOpen,
|
|
@@ -1461,21 +1546,21 @@ function getDetachTrackingInfo() {
|
|
|
1461
1546
|
}
|
|
1462
1547
|
|
|
1463
1548
|
// src/components/instance-editing-panel/empty-state.tsx
|
|
1464
|
-
var
|
|
1465
|
-
var
|
|
1466
|
-
var
|
|
1467
|
-
var
|
|
1549
|
+
var React16 = __toESM(require("react"));
|
|
1550
|
+
var import_icons10 = require("@elementor/icons");
|
|
1551
|
+
var import_ui10 = require("@elementor/ui");
|
|
1552
|
+
var import_i18n11 = require("@wordpress/i18n");
|
|
1468
1553
|
var EmptyState2 = ({ onEditComponent }) => {
|
|
1469
1554
|
const { canEdit } = useComponentsPermissions();
|
|
1470
|
-
const message = canEdit ? (0,
|
|
1555
|
+
const message = canEdit ? (0, import_i18n11.__)(
|
|
1471
1556
|
"Edit the component to add properties, manage them or update the design across all instances.",
|
|
1472
1557
|
"elementor"
|
|
1473
|
-
) : (0,
|
|
1558
|
+
) : (0, import_i18n11.__)(
|
|
1474
1559
|
"With your current role, you cannot edit this component. Contact an administrator to add properties.",
|
|
1475
1560
|
"elementor"
|
|
1476
1561
|
);
|
|
1477
|
-
return /* @__PURE__ */
|
|
1478
|
-
|
|
1562
|
+
return /* @__PURE__ */ React16.createElement(
|
|
1563
|
+
import_ui10.Stack,
|
|
1479
1564
|
{
|
|
1480
1565
|
alignItems: "center",
|
|
1481
1566
|
justifyContent: "start",
|
|
@@ -1484,11 +1569,11 @@ var EmptyState2 = ({ onEditComponent }) => {
|
|
|
1484
1569
|
sx: { p: 2.5, pt: 8, pb: 5.5, mt: 1 },
|
|
1485
1570
|
gap: 1.5
|
|
1486
1571
|
},
|
|
1487
|
-
/* @__PURE__ */
|
|
1488
|
-
/* @__PURE__ */
|
|
1489
|
-
/* @__PURE__ */
|
|
1490
|
-
canEdit && /* @__PURE__ */
|
|
1491
|
-
|
|
1572
|
+
/* @__PURE__ */ React16.createElement(import_icons10.ComponentPropListIcon, { fontSize: "large" }),
|
|
1573
|
+
/* @__PURE__ */ React16.createElement(import_ui10.Typography, { align: "center", variant: "subtitle2" }, (0, import_i18n11.__)("No properties yet", "elementor")),
|
|
1574
|
+
/* @__PURE__ */ React16.createElement(import_ui10.Typography, { align: "center", variant: "caption", maxWidth: "170px" }, message),
|
|
1575
|
+
canEdit && /* @__PURE__ */ React16.createElement(
|
|
1576
|
+
import_ui10.Button,
|
|
1492
1577
|
{
|
|
1493
1578
|
variant: "outlined",
|
|
1494
1579
|
color: "secondary",
|
|
@@ -1497,32 +1582,32 @@ var EmptyState2 = ({ onEditComponent }) => {
|
|
|
1497
1582
|
disabled: !onEditComponent,
|
|
1498
1583
|
onClick: onEditComponent
|
|
1499
1584
|
},
|
|
1500
|
-
/* @__PURE__ */
|
|
1501
|
-
(0,
|
|
1585
|
+
/* @__PURE__ */ React16.createElement(import_icons10.PencilIcon, { fontSize: "small" }),
|
|
1586
|
+
(0, import_i18n11.__)("Edit component", "elementor")
|
|
1502
1587
|
)
|
|
1503
1588
|
);
|
|
1504
1589
|
};
|
|
1505
1590
|
|
|
1506
1591
|
// src/components/instance-editing-panel/instance-panel-body.tsx
|
|
1507
|
-
var
|
|
1592
|
+
var React21 = __toESM(require("react"));
|
|
1508
1593
|
var import_editor_controls3 = require("@elementor/editor-controls");
|
|
1509
1594
|
var import_editor_editing_panel3 = require("@elementor/editor-editing-panel");
|
|
1510
1595
|
var import_editor_panels2 = require("@elementor/editor-panels");
|
|
1511
|
-
var
|
|
1596
|
+
var import_ui14 = require("@elementor/ui");
|
|
1512
1597
|
|
|
1513
1598
|
// src/components/instance-editing-panel/override-props-group.tsx
|
|
1514
|
-
var
|
|
1599
|
+
var React20 = __toESM(require("react"));
|
|
1515
1600
|
var import_react7 = require("react");
|
|
1516
1601
|
var import_editor_editing_panel2 = require("@elementor/editor-editing-panel");
|
|
1517
1602
|
var import_editor_ui6 = require("@elementor/editor-ui");
|
|
1518
|
-
var
|
|
1603
|
+
var import_ui13 = require("@elementor/ui");
|
|
1519
1604
|
|
|
1520
1605
|
// src/components/instance-editing-panel/override-prop-control.tsx
|
|
1521
|
-
var
|
|
1606
|
+
var React19 = __toESM(require("react"));
|
|
1522
1607
|
var import_editor_controls2 = require("@elementor/editor-controls");
|
|
1523
1608
|
var import_editor_editing_panel = require("@elementor/editor-editing-panel");
|
|
1524
1609
|
var import_editor_elements7 = require("@elementor/editor-elements");
|
|
1525
|
-
var
|
|
1610
|
+
var import_ui12 = require("@elementor/ui");
|
|
1526
1611
|
|
|
1527
1612
|
// src/hooks/use-controls-by-widget-type.ts
|
|
1528
1613
|
var import_editor_elements4 = require("@elementor/editor-elements");
|
|
@@ -1556,11 +1641,11 @@ function getControlsByBind(controls) {
|
|
|
1556
1641
|
}
|
|
1557
1642
|
|
|
1558
1643
|
// src/provider/overridable-prop-context.tsx
|
|
1559
|
-
var
|
|
1644
|
+
var React17 = __toESM(require("react"));
|
|
1560
1645
|
var import_react6 = require("react");
|
|
1561
1646
|
var OverridablePropContext = (0, import_react6.createContext)(null);
|
|
1562
1647
|
function OverridablePropProvider({ children, ...props }) {
|
|
1563
|
-
return /* @__PURE__ */
|
|
1648
|
+
return /* @__PURE__ */ React17.createElement(OverridablePropContext.Provider, { value: props }, children);
|
|
1564
1649
|
}
|
|
1565
1650
|
var useOverridablePropValue = () => (0, import_react6.useContext)(OverridablePropContext)?.value;
|
|
1566
1651
|
var useComponentInstanceElement = () => (0, import_react6.useContext)(OverridablePropContext)?.componentInstanceElement;
|
|
@@ -1792,16 +1877,16 @@ function extractInnerOverrideInfo(override) {
|
|
|
1792
1877
|
}
|
|
1793
1878
|
|
|
1794
1879
|
// src/components/control-label.tsx
|
|
1795
|
-
var
|
|
1880
|
+
var React18 = __toESM(require("react"));
|
|
1796
1881
|
var import_editor_controls = require("@elementor/editor-controls");
|
|
1797
|
-
var
|
|
1882
|
+
var import_ui11 = require("@elementor/ui");
|
|
1798
1883
|
var ControlLabel = ({ children, ...props }) => {
|
|
1799
|
-
return /* @__PURE__ */
|
|
1884
|
+
return /* @__PURE__ */ React18.createElement(import_ui11.Stack, { direction: "row", alignItems: "center", justifyItems: "start", gap: 0.25 }, /* @__PURE__ */ React18.createElement(import_editor_controls.ControlFormLabel, { ...props }, children), /* @__PURE__ */ React18.createElement(import_editor_controls.ControlAdornments, null));
|
|
1800
1885
|
};
|
|
1801
1886
|
|
|
1802
1887
|
// src/components/errors.ts
|
|
1803
|
-
var
|
|
1804
|
-
var OverrideControlInnerElementNotFoundError = (0,
|
|
1888
|
+
var import_utils3 = require("@elementor/utils");
|
|
1889
|
+
var OverrideControlInnerElementNotFoundError = (0, import_utils3.createError)({
|
|
1805
1890
|
code: "override_control_inner_element_not_found",
|
|
1806
1891
|
message: `Component inner element not found for override control. The element may have been deleted without updating the overridable props, or the component has not finished rendering yet.`
|
|
1807
1892
|
});
|
|
@@ -1905,7 +1990,7 @@ function OverridePropControl({ overrideKey }) {
|
|
|
1905
1990
|
if (!overridableProp) {
|
|
1906
1991
|
return null;
|
|
1907
1992
|
}
|
|
1908
|
-
return /* @__PURE__ */
|
|
1993
|
+
return /* @__PURE__ */ React19.createElement(import_editor_editing_panel.SettingsField, { bind: "component_instance", propDisplayName: overridableProp.label }, /* @__PURE__ */ React19.createElement(OverrideControl, { overridableProp }));
|
|
1909
1994
|
}
|
|
1910
1995
|
function OverrideControl({ overridableProp }) {
|
|
1911
1996
|
const componentInstanceElement = (0, import_editor_editing_panel.useElement)();
|
|
@@ -1999,13 +2084,13 @@ function OverrideControl({ overridableProp }) {
|
|
|
1999
2084
|
[overridableProp.overrideKey]: propType
|
|
2000
2085
|
}
|
|
2001
2086
|
});
|
|
2002
|
-
return /* @__PURE__ */
|
|
2087
|
+
return /* @__PURE__ */ React19.createElement(
|
|
2003
2088
|
OverridablePropProvider,
|
|
2004
2089
|
{
|
|
2005
2090
|
value: componentOverridablePropTypeUtil.extract(matchingOverride) ?? void 0,
|
|
2006
2091
|
componentInstanceElement
|
|
2007
2092
|
},
|
|
2008
|
-
/* @__PURE__ */
|
|
2093
|
+
/* @__PURE__ */ React19.createElement(import_editor_editing_panel.ElementProvider, { element: { id: elementId, type }, elementType, settings }, /* @__PURE__ */ React19.createElement(import_editor_editing_panel.SettingsField, { bind: propKey, propDisplayName: overridableProp.label }, /* @__PURE__ */ React19.createElement(
|
|
2009
2094
|
import_editor_controls2.PropProvider,
|
|
2010
2095
|
{
|
|
2011
2096
|
propType: propTypeSchema,
|
|
@@ -2015,7 +2100,7 @@ function OverrideControl({ overridableProp }) {
|
|
|
2015
2100
|
return false;
|
|
2016
2101
|
}
|
|
2017
2102
|
},
|
|
2018
|
-
/* @__PURE__ */
|
|
2103
|
+
/* @__PURE__ */ React19.createElement(import_editor_controls2.PropKeyProvider, { bind: overridableProp.overrideKey }, /* @__PURE__ */ React19.createElement(import_editor_controls2.ControlReplacementsProvider, { replacements: controlReplacements }, /* @__PURE__ */ React19.createElement(import_ui12.Box, { mb: 1.5 }, /* @__PURE__ */ React19.createElement(import_editor_editing_panel.ControlTypeContainer, { layout }, layout !== "custom" && /* @__PURE__ */ React19.createElement(ControlLabel, null, overridableProp.label), /* @__PURE__ */ React19.createElement(OriginalControl, { control, controlProps })))))
|
|
2019
2104
|
)))
|
|
2020
2105
|
);
|
|
2021
2106
|
}
|
|
@@ -2074,7 +2159,7 @@ function getControlParams(controls, originPropFields, label) {
|
|
|
2074
2159
|
}
|
|
2075
2160
|
function OriginalControl({ control, controlProps }) {
|
|
2076
2161
|
const { value } = control;
|
|
2077
|
-
return /* @__PURE__ */
|
|
2162
|
+
return /* @__PURE__ */ React19.createElement(import_editor_editing_panel.BaseControl, { type: value.type, props: controlProps });
|
|
2078
2163
|
}
|
|
2079
2164
|
function getControlLayout(control) {
|
|
2080
2165
|
return control.value.meta?.layout || import_editor_editing_panel.controlsRegistry.getLayout(control.value.type);
|
|
@@ -2109,8 +2194,8 @@ function OverridePropsGroup({ group }) {
|
|
|
2109
2194
|
const labelId = `label-${id}`;
|
|
2110
2195
|
const contentId = `content-${id}`;
|
|
2111
2196
|
const title = group.label;
|
|
2112
|
-
return /* @__PURE__ */
|
|
2113
|
-
|
|
2197
|
+
return /* @__PURE__ */ React20.createElement(import_ui13.Box, { "aria-label": `${title} section` }, /* @__PURE__ */ React20.createElement(
|
|
2198
|
+
import_ui13.ListItemButton,
|
|
2114
2199
|
{
|
|
2115
2200
|
id: labelId,
|
|
2116
2201
|
"aria-controls": contentId,
|
|
@@ -2119,21 +2204,21 @@ function OverridePropsGroup({ group }) {
|
|
|
2119
2204
|
p: 0,
|
|
2120
2205
|
sx: { "&:hover": { backgroundColor: "transparent" } }
|
|
2121
2206
|
},
|
|
2122
|
-
/* @__PURE__ */
|
|
2123
|
-
|
|
2207
|
+
/* @__PURE__ */ React20.createElement(import_ui13.Stack, { direction: "row", alignItems: "center", justifyItems: "start", flexGrow: 1, gap: 0.5 }, /* @__PURE__ */ React20.createElement(
|
|
2208
|
+
import_ui13.ListItemText,
|
|
2124
2209
|
{
|
|
2125
2210
|
secondary: title,
|
|
2126
2211
|
secondaryTypographyProps: { color: "text.primary", variant: "caption", fontWeight: "bold" },
|
|
2127
2212
|
sx: { flexGrow: 0, flexShrink: 1, marginInlineEnd: 1 }
|
|
2128
2213
|
}
|
|
2129
2214
|
)),
|
|
2130
|
-
/* @__PURE__ */
|
|
2131
|
-
), /* @__PURE__ */
|
|
2215
|
+
/* @__PURE__ */ React20.createElement(import_editor_ui6.CollapseIcon, { open: isOpen, color: "secondary", fontSize: "tiny" })
|
|
2216
|
+
), /* @__PURE__ */ React20.createElement(import_ui13.Collapse, { id: contentId, "aria-labelledby": labelId, in: isOpen, timeout: "auto" }, /* @__PURE__ */ React20.createElement(import_ui13.Stack, { direction: "column", gap: 1, p: 2 }, group.props.map((overrideKey) => /* @__PURE__ */ React20.createElement(OverridePropControl, { key: overrideKey, overrideKey })))));
|
|
2132
2217
|
}
|
|
2133
2218
|
|
|
2134
2219
|
// src/components/instance-editing-panel/instance-panel-body.tsx
|
|
2135
2220
|
function InstancePanelBody({ groups, isEmpty, emptyState, componentInstanceId }) {
|
|
2136
|
-
return /* @__PURE__ */
|
|
2221
|
+
return /* @__PURE__ */ React21.createElement(import_editor_panels2.PanelBody, null, /* @__PURE__ */ React21.createElement(import_editor_controls3.ControlAdornmentsProvider, { items: (0, import_editor_editing_panel3.getFieldIndicators)("settings") }, isEmpty ? emptyState : /* @__PURE__ */ React21.createElement(import_ui14.Stack, { direction: "column", alignItems: "stretch" }, groups.map((group) => /* @__PURE__ */ React21.createElement(React21.Fragment, { key: group.id + componentInstanceId }, /* @__PURE__ */ React21.createElement(OverridePropsGroup, { group }), /* @__PURE__ */ React21.createElement(import_ui14.Divider, null))))));
|
|
2137
2222
|
}
|
|
2138
2223
|
|
|
2139
2224
|
// src/components/instance-editing-panel/use-instance-panel-data.ts
|
|
@@ -2233,42 +2318,50 @@ function useComponentInstanceSettings() {
|
|
|
2233
2318
|
}
|
|
2234
2319
|
|
|
2235
2320
|
// src/components/instance-editing-panel/instance-editing-panel.tsx
|
|
2236
|
-
var EDIT_UPGRADE_URL = "https://go.elementor.com/go-pro-components-edit/";
|
|
2321
|
+
var EDIT_UPGRADE_URL = "https://go.elementor.com/go-pro-components-Instance-edit-footer/";
|
|
2237
2322
|
function InstanceEditingPanel() {
|
|
2238
2323
|
const { canEdit } = useComponentsPermissions();
|
|
2239
2324
|
const data = useInstancePanelData();
|
|
2240
|
-
const hasPro = (0, import_utils5.hasProInstalled)();
|
|
2241
2325
|
if (!data) {
|
|
2242
2326
|
return null;
|
|
2243
2327
|
}
|
|
2244
2328
|
const { componentId, component, overrides, overridableProps, groups, isEmpty, componentInstanceId } = data;
|
|
2245
|
-
const panelTitle = (0,
|
|
2246
|
-
const actions = /* @__PURE__ */
|
|
2247
|
-
return /* @__PURE__ */
|
|
2329
|
+
const panelTitle = (0, import_i18n12.__)("Edit %s", "elementor").replace("%s", component.name);
|
|
2330
|
+
const actions = /* @__PURE__ */ React22.createElement(import_ui15.Stack, { direction: "row", gap: 0.5 }, /* @__PURE__ */ React22.createElement(DetachAction, { componentInstanceId, componentId }), canEdit && /* @__PURE__ */ React22.createElement(EditComponentAction, { disabled: true, label: panelTitle, icon: import_icons11.PencilIcon }));
|
|
2331
|
+
return /* @__PURE__ */ React22.createElement(import_ui15.Box, { "data-testid": "instance-editing-panel", sx: { display: "flex", flexDirection: "column", height: "100%" } }, /* @__PURE__ */ React22.createElement(
|
|
2248
2332
|
ComponentInstanceProvider,
|
|
2249
2333
|
{
|
|
2250
2334
|
componentId,
|
|
2251
2335
|
overrides,
|
|
2252
2336
|
overridableProps
|
|
2253
2337
|
},
|
|
2254
|
-
/* @__PURE__ */
|
|
2255
|
-
/* @__PURE__ */
|
|
2338
|
+
/* @__PURE__ */ React22.createElement(InstancePanelHeader, { componentName: component.name, actions }),
|
|
2339
|
+
/* @__PURE__ */ React22.createElement(
|
|
2256
2340
|
InstancePanelBody,
|
|
2257
2341
|
{
|
|
2258
2342
|
groups,
|
|
2259
2343
|
isEmpty,
|
|
2260
|
-
emptyState: /* @__PURE__ */
|
|
2344
|
+
emptyState: /* @__PURE__ */ React22.createElement(EmptyState2, null),
|
|
2261
2345
|
componentInstanceId
|
|
2262
2346
|
}
|
|
2263
2347
|
)
|
|
2264
|
-
), !
|
|
2348
|
+
), !isProComponentsSupported() && (isProOutdatedForComponents() ? /* @__PURE__ */ React22.createElement(
|
|
2349
|
+
ComponentsUpdateAlert,
|
|
2350
|
+
{
|
|
2351
|
+
title: (0, import_i18n12.__)("Edit Component", "elementor"),
|
|
2352
|
+
description: (0, import_i18n12.__)(
|
|
2353
|
+
"To edit components, update Elementor Pro to the latest version.",
|
|
2354
|
+
"elementor"
|
|
2355
|
+
)
|
|
2356
|
+
}
|
|
2357
|
+
) : /* @__PURE__ */ React22.createElement(
|
|
2265
2358
|
ComponentsUpgradeAlert,
|
|
2266
2359
|
{
|
|
2267
|
-
title: (0,
|
|
2268
|
-
description: (0,
|
|
2360
|
+
title: (0, import_i18n12.__)("Edit components", "elementor"),
|
|
2361
|
+
description: (0, import_i18n12.__)("Editing components requires an active Pro subscription.", "elementor"),
|
|
2269
2362
|
upgradeUrl: EDIT_UPGRADE_URL
|
|
2270
2363
|
}
|
|
2271
|
-
));
|
|
2364
|
+
)));
|
|
2272
2365
|
}
|
|
2273
2366
|
|
|
2274
2367
|
// src/components/load-template-components.tsx
|
|
@@ -2406,16 +2499,16 @@ var import_editor_canvas4 = require("@elementor/editor-canvas");
|
|
|
2406
2499
|
var import_editor_documents4 = require("@elementor/editor-documents");
|
|
2407
2500
|
var import_editor_notifications2 = require("@elementor/editor-notifications");
|
|
2408
2501
|
var import_store27 = require("@elementor/store");
|
|
2409
|
-
var
|
|
2410
|
-
var
|
|
2502
|
+
var import_utils5 = require("@elementor/utils");
|
|
2503
|
+
var import_i18n13 = require("@wordpress/i18n");
|
|
2411
2504
|
|
|
2412
2505
|
// src/utils/format-component-elements-id.ts
|
|
2413
|
-
var
|
|
2506
|
+
var import_utils4 = require("@elementor/utils");
|
|
2414
2507
|
var ELEMENT_ID_LENGTH = 7;
|
|
2415
2508
|
function formatComponentElementsId(elements, path) {
|
|
2416
2509
|
return elements.map((element) => {
|
|
2417
2510
|
const nestingPath = [...path, element.id];
|
|
2418
|
-
const id = (0,
|
|
2511
|
+
const id = (0, import_utils4.hashString)(nestingPath.join("_"), ELEMENT_ID_LENGTH);
|
|
2419
2512
|
return {
|
|
2420
2513
|
...element,
|
|
2421
2514
|
id,
|
|
@@ -2479,21 +2572,41 @@ function buildUniqueSelector(element) {
|
|
|
2479
2572
|
|
|
2480
2573
|
// src/create-component-type.ts
|
|
2481
2574
|
var COMPONENT_WIDGET_TYPE2 = "e-component";
|
|
2482
|
-
var
|
|
2575
|
+
var EDIT_COMPONENT_DB_CLICK_UPGRADE_URL = "https://go.elementor.com/go-pro-components-Instance-edit-canvas-double-click/";
|
|
2576
|
+
var EDIT_COMPONENT_CONTEXT_MENU_UPGRADE_URL = "https://go.elementor.com/go-pro-components-Instance-edit-context-menu/";
|
|
2577
|
+
var UPDATE_PLUGINS_URL3 = "/wp-admin/plugins.php";
|
|
2483
2578
|
var COMPONENT_EDIT_UPGRADE_NOTIFICATION_ID = "component-edit-upgrade";
|
|
2579
|
+
var COMPONENT_EDIT_UPDATE_NOTIFICATION_ID = "component-edit-update";
|
|
2484
2580
|
function notifyComponentEditUpgrade() {
|
|
2485
2581
|
(0, import_editor_notifications2.notify)({
|
|
2486
2582
|
type: "promotion",
|
|
2487
2583
|
id: COMPONENT_EDIT_UPGRADE_NOTIFICATION_ID,
|
|
2488
|
-
message: (0,
|
|
2584
|
+
message: (0, import_i18n13.__)("Editing components requires an active Pro subscription.", "elementor"),
|
|
2489
2585
|
additionalActionProps: [
|
|
2490
2586
|
{
|
|
2491
2587
|
size: "small",
|
|
2492
2588
|
variant: "contained",
|
|
2493
2589
|
color: "promotion",
|
|
2494
|
-
href:
|
|
2590
|
+
href: EDIT_COMPONENT_DB_CLICK_UPGRADE_URL,
|
|
2495
2591
|
target: "_blank",
|
|
2496
|
-
children: (0,
|
|
2592
|
+
children: (0, import_i18n13.__)("Upgrade Now", "elementor")
|
|
2593
|
+
}
|
|
2594
|
+
]
|
|
2595
|
+
});
|
|
2596
|
+
}
|
|
2597
|
+
function notifyComponentEditUpdate() {
|
|
2598
|
+
(0, import_editor_notifications2.notify)({
|
|
2599
|
+
type: "info",
|
|
2600
|
+
id: COMPONENT_EDIT_UPDATE_NOTIFICATION_ID,
|
|
2601
|
+
message: (0, import_i18n13.__)("To edit components, update Elementor Pro to the latest version.", "elementor"),
|
|
2602
|
+
additionalActionProps: [
|
|
2603
|
+
{
|
|
2604
|
+
size: "small",
|
|
2605
|
+
variant: "contained",
|
|
2606
|
+
color: "info",
|
|
2607
|
+
href: UPDATE_PLUGINS_URL3,
|
|
2608
|
+
target: "_blank",
|
|
2609
|
+
children: (0, import_i18n13.__)("Update Now", "elementor")
|
|
2497
2610
|
}
|
|
2498
2611
|
]
|
|
2499
2612
|
});
|
|
@@ -2606,21 +2719,23 @@ function createComponentView(options) {
|
|
|
2606
2719
|
}
|
|
2607
2720
|
_getContextMenuConfig() {
|
|
2608
2721
|
const isAdministrator = isUserAdministrator();
|
|
2609
|
-
const hasPro = (0,
|
|
2722
|
+
const hasPro = (0, import_utils5.hasProInstalled)();
|
|
2723
|
+
const isOutdated = isProOutdatedForComponents();
|
|
2724
|
+
const showPromoBadge = !hasPro && !isOutdated;
|
|
2610
2725
|
const badgeClass = "elementor-context-menu-list__item__shortcut__promotion-badge";
|
|
2611
|
-
const proBadge = `<a href="${
|
|
2726
|
+
const proBadge = `<a href="${EDIT_COMPONENT_CONTEXT_MENU_UPGRADE_URL}" target="_blank" onclick="event.stopPropagation()" class="${badgeClass}"><i class="eicon-upgrade-crown"></i></a>`;
|
|
2612
2727
|
const editComponentAction = {
|
|
2613
2728
|
name: "edit component",
|
|
2614
2729
|
icon: "eicon-edit",
|
|
2615
|
-
title: () => (0,
|
|
2616
|
-
|
|
2617
|
-
isEnabled: () =>
|
|
2730
|
+
title: () => (0, import_i18n13.__)("Edit Component", "elementor"),
|
|
2731
|
+
...showPromoBadge && { shortcut: proBadge, hasShortcutAction: true },
|
|
2732
|
+
isEnabled: () => isProComponentsSupported() || isOutdated,
|
|
2618
2733
|
callback: (_, eventData) => this.editComponent(eventData)
|
|
2619
2734
|
};
|
|
2620
2735
|
const detachInstanceAction = {
|
|
2621
2736
|
name: "detach instance",
|
|
2622
2737
|
icon: "eicon-chain-broken",
|
|
2623
|
-
title: () => (0,
|
|
2738
|
+
title: () => (0, import_i18n13.__)("Detach from Component", "elementor"),
|
|
2624
2739
|
isEnabled: () => true,
|
|
2625
2740
|
callback: (_, eventData) => this.detachInstance(eventData)
|
|
2626
2741
|
};
|
|
@@ -2647,8 +2762,11 @@ function createComponentView(options) {
|
|
|
2647
2762
|
}
|
|
2648
2763
|
}
|
|
2649
2764
|
editComponent({ trigger, location, secondaryLocation }) {
|
|
2650
|
-
|
|
2651
|
-
|
|
2765
|
+
if (isProOutdatedForComponents()) {
|
|
2766
|
+
notifyComponentEditUpdate();
|
|
2767
|
+
return;
|
|
2768
|
+
}
|
|
2769
|
+
if (!isProComponentsSupported() || this.isComponentCurrentlyEdited()) {
|
|
2652
2770
|
return;
|
|
2653
2771
|
}
|
|
2654
2772
|
this.switchDocument();
|
|
@@ -2679,7 +2797,7 @@ function createComponentView(options) {
|
|
|
2679
2797
|
} catch {
|
|
2680
2798
|
(0, import_editor_notifications2.notify)({
|
|
2681
2799
|
type: "error",
|
|
2682
|
-
message: (0,
|
|
2800
|
+
message: (0, import_i18n13.__)("Failed to detach component instance.", "elementor"),
|
|
2683
2801
|
id: "detach-component-instance-failed"
|
|
2684
2802
|
});
|
|
2685
2803
|
}
|
|
@@ -2691,7 +2809,11 @@ function createComponentView(options) {
|
|
|
2691
2809
|
if (!isUserAdministrator()) {
|
|
2692
2810
|
return;
|
|
2693
2811
|
}
|
|
2694
|
-
if (
|
|
2812
|
+
if (isProOutdatedForComponents()) {
|
|
2813
|
+
notifyComponentEditUpdate();
|
|
2814
|
+
return;
|
|
2815
|
+
}
|
|
2816
|
+
if (!(0, import_utils5.hasProInstalled)()) {
|
|
2695
2817
|
notifyComponentEditUpgrade();
|
|
2696
2818
|
return;
|
|
2697
2819
|
}
|
|
@@ -2792,11 +2914,11 @@ var import_editor_elements9 = require("@elementor/editor-elements");
|
|
|
2792
2914
|
var import_editor_notifications3 = require("@elementor/editor-notifications");
|
|
2793
2915
|
var import_editor_v1_adapters4 = require("@elementor/editor-v1-adapters");
|
|
2794
2916
|
var import_store30 = require("@elementor/store");
|
|
2795
|
-
var
|
|
2917
|
+
var import_i18n14 = require("@wordpress/i18n");
|
|
2796
2918
|
var COMPONENT_TYPE = "e-component";
|
|
2797
2919
|
var COMPONENT_CIRCULAR_NESTING_ALERT = {
|
|
2798
2920
|
type: "default",
|
|
2799
|
-
message: (0,
|
|
2921
|
+
message: (0, import_i18n14.__)("Can't add this component - components that contain each other can't be nested.", "elementor"),
|
|
2800
2922
|
id: "circular-component-nesting-blocked"
|
|
2801
2923
|
};
|
|
2802
2924
|
function initCircularNestingPrevention() {
|
|
@@ -2947,9 +3069,9 @@ var componentsStylesProvider = (0, import_editor_styles_repository.createStylesP
|
|
|
2947
3069
|
var import_editor_documents5 = require("@elementor/editor-documents");
|
|
2948
3070
|
var import_editor_notifications4 = require("@elementor/editor-notifications");
|
|
2949
3071
|
var import_http_client2 = require("@elementor/http-client");
|
|
2950
|
-
var
|
|
3072
|
+
var import_i18n15 = require("@wordpress/i18n");
|
|
2951
3073
|
var INSUFFICIENT_PERMISSIONS_ERROR_CODE = "insufficient_permissions";
|
|
2952
|
-
var PUBLISH_UPGRADE_URL = "https://go.elementor.com/go-pro-components-
|
|
3074
|
+
var PUBLISH_UPGRADE_URL = "https://go.elementor.com/go-pro-components-Instance-draft-failure/";
|
|
2953
3075
|
var PUBLISH_UPGRADE_NOTIFICATION_ID = "component-publish-upgrade";
|
|
2954
3076
|
async function publishDraftComponentsInPageBeforeSave({ status, elements }) {
|
|
2955
3077
|
if (status !== "publish") {
|
|
@@ -2978,7 +3100,7 @@ function notifyPublishUpgrade() {
|
|
|
2978
3100
|
(0, import_editor_notifications4.notify)({
|
|
2979
3101
|
type: "promotion",
|
|
2980
3102
|
id: PUBLISH_UPGRADE_NOTIFICATION_ID,
|
|
2981
|
-
message: (0,
|
|
3103
|
+
message: (0, import_i18n15.__)(
|
|
2982
3104
|
"You have unpublished component on this page. You need a pro version to publish it.",
|
|
2983
3105
|
"elementor"
|
|
2984
3106
|
),
|
|
@@ -2989,7 +3111,7 @@ function notifyPublishUpgrade() {
|
|
|
2989
3111
|
color: "promotion",
|
|
2990
3112
|
href: PUBLISH_UPGRADE_URL,
|
|
2991
3113
|
target: "_blank",
|
|
2992
|
-
children: (0,
|
|
3114
|
+
children: (0, import_i18n15.__)("Upgrade Now", "elementor")
|
|
2993
3115
|
}
|
|
2994
3116
|
]
|
|
2995
3117
|
});
|
|
@@ -3031,7 +3153,7 @@ function init() {
|
|
|
3031
3153
|
window.elementorCommon.__beforeSave = beforeSave;
|
|
3032
3154
|
(0, import_editor_elements_panel.injectTab)({
|
|
3033
3155
|
id: "components",
|
|
3034
|
-
label: (0,
|
|
3156
|
+
label: (0, import_i18n16.__)("Components", "elementor"),
|
|
3035
3157
|
component: Components,
|
|
3036
3158
|
position: 1
|
|
3037
3159
|
});
|