@elementor/editor-components 4.0.0-661 → 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.mjs CHANGED
@@ -1625,6 +1625,7 @@ import {
1625
1625
  createTemplatedElementView
1626
1626
  } from "@elementor/editor-canvas";
1627
1627
  import { getCurrentDocument } from "@elementor/editor-documents";
1628
+ import { notify } from "@elementor/editor-notifications";
1628
1629
  import { __getState as getState5 } from "@elementor/store";
1629
1630
  import { hasProInstalled } from "@elementor/utils";
1630
1631
  import { __ as __7 } from "@wordpress/i18n";
@@ -1739,6 +1740,24 @@ var onElementDrop = (_args, element) => {
1739
1740
  // src/create-component-type.ts
1740
1741
  var COMPONENT_WIDGET_TYPE = "e-component";
1741
1742
  var EDIT_COMPONENT_UPGRADE_URL = "https://go.elementor.com/go-pro-components-edit/";
1743
+ var COMPONENT_EDIT_UPGRADE_NOTIFICATION_ID = "component-edit-upgrade";
1744
+ function notifyComponentEditUpgrade() {
1745
+ notify({
1746
+ type: "promotion",
1747
+ id: COMPONENT_EDIT_UPGRADE_NOTIFICATION_ID,
1748
+ message: __7("Your Pro subscription has expired. Renew to edit components.", "elementor"),
1749
+ additionalActionProps: [
1750
+ {
1751
+ size: "small",
1752
+ variant: "contained",
1753
+ color: "promotion",
1754
+ href: EDIT_COMPONENT_UPGRADE_URL,
1755
+ target: "_blank",
1756
+ children: __7("Upgrade Now", "elementor")
1757
+ }
1758
+ ]
1759
+ });
1760
+ }
1742
1761
  var updateGroups = (groups, config) => {
1743
1762
  const disableMap = new Map(Object.entries(config.disable ?? {}));
1744
1763
  const addMap = new Map(Object.entries(config.add ?? {}));
@@ -1898,7 +1917,11 @@ function createComponentView(options) {
1898
1917
  }
1899
1918
  handleDblClick(e) {
1900
1919
  e.stopPropagation();
1901
- if (!isUserAdministrator() || !hasProInstalled()) {
1920
+ if (!isUserAdministrator()) {
1921
+ return;
1922
+ }
1923
+ if (!hasProInstalled()) {
1924
+ notifyComponentEditUpgrade();
1902
1925
  return;
1903
1926
  }
1904
1927
  const { triggers, locations, secondaryLocations } = this.eventsManagerConfig;
@@ -3543,7 +3566,7 @@ import { __ as __23 } from "@wordpress/i18n";
3543
3566
 
3544
3567
  // src/extended/store/actions/archive-component.ts
3545
3568
  import { setDocumentModifiedStatus as setDocumentModifiedStatus4 } from "@elementor/editor-documents";
3546
- import { notify } from "@elementor/editor-notifications";
3569
+ import { notify as notify2 } from "@elementor/editor-notifications";
3547
3570
  import { __ as __20 } from "@wordpress/i18n";
3548
3571
  var successNotification = (componentId, componentName) => ({
3549
3572
  type: "success",
@@ -3554,7 +3577,7 @@ var successNotification = (componentId, componentName) => ({
3554
3577
  var archiveComponent = (componentId, componentName) => {
3555
3578
  componentsActions.archive(componentId);
3556
3579
  setDocumentModifiedStatus4(true);
3557
- notify(successNotification(componentId, componentName));
3580
+ notify2(successNotification(componentId, componentName));
3558
3581
  };
3559
3582
 
3560
3583
  // src/extended/store/actions/rename-component.ts
@@ -3868,7 +3891,7 @@ var ExtendedComponents = () => {
3868
3891
  import * as React31 from "react";
3869
3892
  import { useEffect as useEffect3, useMemo as useMemo3, useRef as useRef5, useState as useState8 } from "react";
3870
3893
  import { getElementLabel } from "@elementor/editor-elements";
3871
- import { notify as notify3 } from "@elementor/editor-notifications";
3894
+ import { notify as notify4 } from "@elementor/editor-notifications";
3872
3895
  import { Form as FormElement, ThemeProvider as ThemeProvider4, useTextFieldAutoSelect } from "@elementor/editor-ui";
3873
3896
  import { ComponentsIcon as ComponentsIcon4 } from "@elementor/icons";
3874
3897
  import { Button as Button5, FormLabel as FormLabel2, Grid as Grid2, Popover as Popover3, Stack as Stack17, TextField as TextField3, Typography as Typography12 } from "@elementor/ui";
@@ -3958,7 +3981,7 @@ function restoreOriginalElement(originalElement, componentInstanceId) {
3958
3981
  // src/extended/sync/prevent-non-atomic-nesting.ts
3959
3982
  import { isAtomicWidget } from "@elementor/editor-canvas";
3960
3983
  import { getAllDescendants as getAllDescendants3, getElementType as getElementType3 } from "@elementor/editor-elements";
3961
- import { notify as notify2 } from "@elementor/editor-notifications";
3984
+ import { notify as notify3 } from "@elementor/editor-notifications";
3962
3985
  import { blockCommand } from "@elementor/editor-v1-adapters";
3963
3986
  import { __ as __25 } from "@wordpress/i18n";
3964
3987
 
@@ -4002,7 +4025,7 @@ function blockNonAtomicCreate(args) {
4002
4025
  if (isElementAtomic(elementType)) {
4003
4026
  return false;
4004
4027
  }
4005
- notify2(NON_ATOMIC_ELEMENT_ALERT);
4028
+ notify3(NON_ATOMIC_ELEMENT_ALERT);
4006
4029
  return true;
4007
4030
  }
4008
4031
  function blockNonAtomicMove(args) {
@@ -4018,7 +4041,7 @@ function blockNonAtomicMove(args) {
4018
4041
  return allElements.some((element) => !isAtomicWidget(element));
4019
4042
  });
4020
4043
  if (hasNonAtomicElement) {
4021
- notify2(NON_ATOMIC_ELEMENT_ALERT);
4044
+ notify3(NON_ATOMIC_ELEMENT_ALERT);
4022
4045
  }
4023
4046
  return hasNonAtomicElement;
4024
4047
  }
@@ -4036,7 +4059,7 @@ function blockNonAtomicPaste(args) {
4036
4059
  }
4037
4060
  const hasNonAtomicElement = hasNonAtomicElementsInTree(data.clipboard.elements);
4038
4061
  if (hasNonAtomicElement) {
4039
- notify2(NON_ATOMIC_ELEMENT_ALERT);
4062
+ notify3(NON_ATOMIC_ELEMENT_ALERT);
4040
4063
  }
4041
4064
  return hasNonAtomicElement;
4042
4065
  }
@@ -4158,7 +4181,7 @@ function CreateComponentForm() {
4158
4181
  const openPopup = (event) => {
4159
4182
  const { shouldOpen, notification } = shouldOpenForm(event.detail.element, components?.length ?? 0);
4160
4183
  if (!shouldOpen) {
4161
- notify3(notification);
4184
+ notify4(notification);
4162
4185
  return;
4163
4186
  }
4164
4187
  setElement({ element: event.detail.element, elementLabel: getElementLabel(event.detail.element.id) });
@@ -4192,7 +4215,7 @@ function CreateComponentForm() {
4192
4215
  } else {
4193
4216
  throw new Error("Failed to find published component");
4194
4217
  }
4195
- notify3({
4218
+ notify4({
4196
4219
  type: "success",
4197
4220
  message: __26("Component created successfully.", "elementor"),
4198
4221
  id: `component-saved-successfully-${uid}`
@@ -4200,7 +4223,7 @@ function CreateComponentForm() {
4200
4223
  resetAndClosePopup();
4201
4224
  } catch {
4202
4225
  const errorMessage = __26("Failed to create component. Please try again.", "elementor");
4203
- notify3({
4226
+ notify4({
4204
4227
  type: "error",
4205
4228
  message: errorMessage,
4206
4229
  id: "component-save-failed"
@@ -5392,7 +5415,7 @@ var setComponentOverridablePropsSettingsBeforeSave = ({
5392
5415
  };
5393
5416
 
5394
5417
  // src/extended/sync/update-archived-component-before-save.ts
5395
- import { notify as notify4 } from "@elementor/editor-notifications";
5418
+ import { notify as notify5 } from "@elementor/editor-notifications";
5396
5419
  var failedNotification = (message) => ({
5397
5420
  type: "error",
5398
5421
  message: `Failed to archive components: ${message}`,
@@ -5407,7 +5430,7 @@ var updateArchivedComponentBeforeSave = async (status) => {
5407
5430
  const result = await apiClient.updateArchivedComponents(archivedComponents, status);
5408
5431
  const failedIds = result.failedIds.join(", ");
5409
5432
  if (failedIds) {
5410
- notify4(failedNotification(failedIds));
5433
+ notify5(failedNotification(failedIds));
5411
5434
  }
5412
5435
  } catch (error) {
5413
5436
  throw new Error(`Failed to update archived components: ${error}`);
@@ -5850,7 +5873,7 @@ function PopulateStore() {
5850
5873
 
5851
5874
  // src/prevent-circular-nesting.ts
5852
5875
  import { getAllDescendants as getAllDescendants5 } from "@elementor/editor-elements";
5853
- import { notify as notify5 } from "@elementor/editor-notifications";
5876
+ import { notify as notify6 } from "@elementor/editor-notifications";
5854
5877
  import { blockCommand as blockCommand2 } from "@elementor/editor-v1-adapters";
5855
5878
  import { __getState as getState9 } from "@elementor/store";
5856
5879
  import { __ as __32 } from "@wordpress/i18n";
@@ -5934,7 +5957,7 @@ function blockCircularCreate(args) {
5934
5957
  }
5935
5958
  const isBlocked = wouldCreateCircularNesting(componentId);
5936
5959
  if (isBlocked) {
5937
- notify5(COMPONENT_CIRCULAR_NESTING_ALERT);
5960
+ notify6(COMPONENT_CIRCULAR_NESTING_ALERT);
5938
5961
  }
5939
5962
  return isBlocked;
5940
5963
  }
@@ -5954,7 +5977,7 @@ function blockCircularMove(args) {
5954
5977
  });
5955
5978
  });
5956
5979
  if (hasCircularComponent) {
5957
- notify5(COMPONENT_CIRCULAR_NESTING_ALERT);
5980
+ notify6(COMPONENT_CIRCULAR_NESTING_ALERT);
5958
5981
  }
5959
5982
  return hasCircularComponent;
5960
5983
  }
@@ -5970,7 +5993,7 @@ function blockCircularPaste(args) {
5970
5993
  const allComponentIds = extractComponentIdsFromElements(data.clipboard.elements);
5971
5994
  const hasCircularComponent = allComponentIds.some(wouldCreateCircularNesting);
5972
5995
  if (hasCircularComponent) {
5973
- notify5(COMPONENT_CIRCULAR_NESTING_ALERT);
5996
+ notify6(COMPONENT_CIRCULAR_NESTING_ALERT);
5974
5997
  }
5975
5998
  return hasCircularComponent;
5976
5999
  }