@elementor/editor-components 4.0.0-662 → 4.0.0-663

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -1687,6 +1687,7 @@ var import_editor_documents4 = require("@elementor/editor-documents");
1687
1687
  // src/create-component-type.ts
1688
1688
  var import_editor_canvas4 = require("@elementor/editor-canvas");
1689
1689
  var import_editor_documents3 = require("@elementor/editor-documents");
1690
+ var import_editor_notifications = require("@elementor/editor-notifications");
1690
1691
  var import_store20 = require("@elementor/store");
1691
1692
  var import_utils4 = require("@elementor/utils");
1692
1693
  var import_i18n7 = require("@wordpress/i18n");
@@ -1801,6 +1802,24 @@ var onElementDrop = (_args, element) => {
1801
1802
  // src/create-component-type.ts
1802
1803
  var COMPONENT_WIDGET_TYPE = "e-component";
1803
1804
  var EDIT_COMPONENT_UPGRADE_URL = "https://go.elementor.com/go-pro-components-edit/";
1805
+ var COMPONENT_EDIT_UPGRADE_NOTIFICATION_ID = "component-edit-upgrade";
1806
+ function notifyComponentEditUpgrade() {
1807
+ (0, import_editor_notifications.notify)({
1808
+ type: "promotion",
1809
+ id: COMPONENT_EDIT_UPGRADE_NOTIFICATION_ID,
1810
+ message: (0, import_i18n7.__)("Your Pro subscription has expired. Renew to edit components.", "elementor"),
1811
+ additionalActionProps: [
1812
+ {
1813
+ size: "small",
1814
+ variant: "contained",
1815
+ color: "promotion",
1816
+ href: EDIT_COMPONENT_UPGRADE_URL,
1817
+ target: "_blank",
1818
+ children: (0, import_i18n7.__)("Upgrade Now", "elementor")
1819
+ }
1820
+ ]
1821
+ });
1822
+ }
1804
1823
  var updateGroups = (groups, config) => {
1805
1824
  const disableMap = new Map(Object.entries(config.disable ?? {}));
1806
1825
  const addMap = new Map(Object.entries(config.add ?? {}));
@@ -1960,7 +1979,11 @@ function createComponentView(options) {
1960
1979
  }
1961
1980
  handleDblClick(e) {
1962
1981
  e.stopPropagation();
1963
- if (!isUserAdministrator() || !(0, import_utils4.hasProInstalled)()) {
1982
+ if (!isUserAdministrator()) {
1983
+ return;
1984
+ }
1985
+ if (!(0, import_utils4.hasProInstalled)()) {
1986
+ notifyComponentEditUpgrade();
1964
1987
  return;
1965
1988
  }
1966
1989
  const { triggers, locations, secondaryLocations } = this.eventsManagerConfig;
@@ -3579,7 +3602,7 @@ var import_i18n23 = require("@wordpress/i18n");
3579
3602
 
3580
3603
  // src/extended/store/actions/archive-component.ts
3581
3604
  var import_editor_documents9 = require("@elementor/editor-documents");
3582
- var import_editor_notifications = require("@elementor/editor-notifications");
3605
+ var import_editor_notifications2 = require("@elementor/editor-notifications");
3583
3606
  var import_i18n20 = require("@wordpress/i18n");
3584
3607
  var successNotification = (componentId, componentName) => ({
3585
3608
  type: "success",
@@ -3590,7 +3613,7 @@ var successNotification = (componentId, componentName) => ({
3590
3613
  var archiveComponent = (componentId, componentName) => {
3591
3614
  componentsActions.archive(componentId);
3592
3615
  (0, import_editor_documents9.setDocumentModifiedStatus)(true);
3593
- (0, import_editor_notifications.notify)(successNotification(componentId, componentName));
3616
+ (0, import_editor_notifications2.notify)(successNotification(componentId, componentName));
3594
3617
  };
3595
3618
 
3596
3619
  // src/extended/store/actions/rename-component.ts
@@ -3900,7 +3923,7 @@ var ExtendedComponents = () => {
3900
3923
  var React31 = __toESM(require("react"));
3901
3924
  var import_react15 = require("react");
3902
3925
  var import_editor_elements14 = require("@elementor/editor-elements");
3903
- var import_editor_notifications3 = require("@elementor/editor-notifications");
3926
+ var import_editor_notifications4 = require("@elementor/editor-notifications");
3904
3927
  var import_editor_ui16 = require("@elementor/editor-ui");
3905
3928
  var import_icons16 = require("@elementor/icons");
3906
3929
  var import_ui26 = require("@elementor/ui");
@@ -3990,7 +4013,7 @@ function restoreOriginalElement(originalElement, componentInstanceId) {
3990
4013
  // src/extended/sync/prevent-non-atomic-nesting.ts
3991
4014
  var import_editor_canvas6 = require("@elementor/editor-canvas");
3992
4015
  var import_editor_elements13 = require("@elementor/editor-elements");
3993
- var import_editor_notifications2 = require("@elementor/editor-notifications");
4016
+ var import_editor_notifications3 = require("@elementor/editor-notifications");
3994
4017
  var import_editor_v1_adapters4 = require("@elementor/editor-v1-adapters");
3995
4018
  var import_i18n25 = require("@wordpress/i18n");
3996
4019
 
@@ -4034,7 +4057,7 @@ function blockNonAtomicCreate(args) {
4034
4057
  if (isElementAtomic(elementType)) {
4035
4058
  return false;
4036
4059
  }
4037
- (0, import_editor_notifications2.notify)(NON_ATOMIC_ELEMENT_ALERT);
4060
+ (0, import_editor_notifications3.notify)(NON_ATOMIC_ELEMENT_ALERT);
4038
4061
  return true;
4039
4062
  }
4040
4063
  function blockNonAtomicMove(args) {
@@ -4050,7 +4073,7 @@ function blockNonAtomicMove(args) {
4050
4073
  return allElements.some((element) => !(0, import_editor_canvas6.isAtomicWidget)(element));
4051
4074
  });
4052
4075
  if (hasNonAtomicElement) {
4053
- (0, import_editor_notifications2.notify)(NON_ATOMIC_ELEMENT_ALERT);
4076
+ (0, import_editor_notifications3.notify)(NON_ATOMIC_ELEMENT_ALERT);
4054
4077
  }
4055
4078
  return hasNonAtomicElement;
4056
4079
  }
@@ -4068,7 +4091,7 @@ function blockNonAtomicPaste(args) {
4068
4091
  }
4069
4092
  const hasNonAtomicElement = hasNonAtomicElementsInTree(data.clipboard.elements);
4070
4093
  if (hasNonAtomicElement) {
4071
- (0, import_editor_notifications2.notify)(NON_ATOMIC_ELEMENT_ALERT);
4094
+ (0, import_editor_notifications3.notify)(NON_ATOMIC_ELEMENT_ALERT);
4072
4095
  }
4073
4096
  return hasNonAtomicElement;
4074
4097
  }
@@ -4190,7 +4213,7 @@ function CreateComponentForm() {
4190
4213
  const openPopup = (event) => {
4191
4214
  const { shouldOpen, notification } = shouldOpenForm(event.detail.element, components?.length ?? 0);
4192
4215
  if (!shouldOpen) {
4193
- (0, import_editor_notifications3.notify)(notification);
4216
+ (0, import_editor_notifications4.notify)(notification);
4194
4217
  return;
4195
4218
  }
4196
4219
  setElement({ element: event.detail.element, elementLabel: (0, import_editor_elements14.getElementLabel)(event.detail.element.id) });
@@ -4224,7 +4247,7 @@ function CreateComponentForm() {
4224
4247
  } else {
4225
4248
  throw new Error("Failed to find published component");
4226
4249
  }
4227
- (0, import_editor_notifications3.notify)({
4250
+ (0, import_editor_notifications4.notify)({
4228
4251
  type: "success",
4229
4252
  message: (0, import_i18n26.__)("Component created successfully.", "elementor"),
4230
4253
  id: `component-saved-successfully-${uid}`
@@ -4232,7 +4255,7 @@ function CreateComponentForm() {
4232
4255
  resetAndClosePopup();
4233
4256
  } catch {
4234
4257
  const errorMessage = (0, import_i18n26.__)("Failed to create component. Please try again.", "elementor");
4235
- (0, import_editor_notifications3.notify)({
4258
+ (0, import_editor_notifications4.notify)({
4236
4259
  type: "error",
4237
4260
  message: errorMessage,
4238
4261
  id: "component-save-failed"
@@ -5413,7 +5436,7 @@ var setComponentOverridablePropsSettingsBeforeSave = ({
5413
5436
  };
5414
5437
 
5415
5438
  // src/extended/sync/update-archived-component-before-save.ts
5416
- var import_editor_notifications4 = require("@elementor/editor-notifications");
5439
+ var import_editor_notifications5 = require("@elementor/editor-notifications");
5417
5440
  var failedNotification = (message) => ({
5418
5441
  type: "error",
5419
5442
  message: `Failed to archive components: ${message}`,
@@ -5428,7 +5451,7 @@ var updateArchivedComponentBeforeSave = async (status) => {
5428
5451
  const result = await apiClient.updateArchivedComponents(archivedComponents, status);
5429
5452
  const failedIds = result.failedIds.join(", ");
5430
5453
  if (failedIds) {
5431
- (0, import_editor_notifications4.notify)(failedNotification(failedIds));
5454
+ (0, import_editor_notifications5.notify)(failedNotification(failedIds));
5432
5455
  }
5433
5456
  } catch (error) {
5434
5457
  throw new Error(`Failed to update archived components: ${error}`);
@@ -5871,7 +5894,7 @@ function PopulateStore() {
5871
5894
 
5872
5895
  // src/prevent-circular-nesting.ts
5873
5896
  var import_editor_elements21 = require("@elementor/editor-elements");
5874
- var import_editor_notifications5 = require("@elementor/editor-notifications");
5897
+ var import_editor_notifications6 = require("@elementor/editor-notifications");
5875
5898
  var import_editor_v1_adapters11 = require("@elementor/editor-v1-adapters");
5876
5899
  var import_store38 = require("@elementor/store");
5877
5900
  var import_i18n32 = require("@wordpress/i18n");
@@ -5955,7 +5978,7 @@ function blockCircularCreate(args) {
5955
5978
  }
5956
5979
  const isBlocked = wouldCreateCircularNesting(componentId);
5957
5980
  if (isBlocked) {
5958
- (0, import_editor_notifications5.notify)(COMPONENT_CIRCULAR_NESTING_ALERT);
5981
+ (0, import_editor_notifications6.notify)(COMPONENT_CIRCULAR_NESTING_ALERT);
5959
5982
  }
5960
5983
  return isBlocked;
5961
5984
  }
@@ -5975,7 +5998,7 @@ function blockCircularMove(args) {
5975
5998
  });
5976
5999
  });
5977
6000
  if (hasCircularComponent) {
5978
- (0, import_editor_notifications5.notify)(COMPONENT_CIRCULAR_NESTING_ALERT);
6001
+ (0, import_editor_notifications6.notify)(COMPONENT_CIRCULAR_NESTING_ALERT);
5979
6002
  }
5980
6003
  return hasCircularComponent;
5981
6004
  }
@@ -5991,7 +6014,7 @@ function blockCircularPaste(args) {
5991
6014
  const allComponentIds = extractComponentIdsFromElements(data.clipboard.elements);
5992
6015
  const hasCircularComponent = allComponentIds.some(wouldCreateCircularNesting);
5993
6016
  if (hasCircularComponent) {
5994
- (0, import_editor_notifications5.notify)(COMPONENT_CIRCULAR_NESTING_ALERT);
6017
+ (0, import_editor_notifications6.notify)(COMPONENT_CIRCULAR_NESTING_ALERT);
5995
6018
  }
5996
6019
  return hasCircularComponent;
5997
6020
  }