@elementor/editor-controls 3.35.0-477 → 3.35.0-479

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
@@ -3535,17 +3535,19 @@ var LinkControl = createControl((props) => {
3535
3535
  label = (0, import_i18n23.__)("Link", "elementor"),
3536
3536
  ariaLabel
3537
3537
  } = props || {};
3538
- const [linkInLinkRestriction, setLinkInLinkRestriction] = (0, import_react33.useState)((0, import_editor_elements2.getLinkInLinkRestriction)(elementId));
3538
+ const [linkInLinkRestriction, setLinkInLinkRestriction] = (0, import_react33.useState)(
3539
+ (0, import_editor_elements2.getLinkInLinkRestriction)(elementId, value)
3540
+ );
3539
3541
  const shouldDisableAddingLink = !isActive && linkInLinkRestriction.shouldRestrict;
3540
3542
  const debouncedCheckRestriction = (0, import_react33.useMemo)(
3541
3543
  () => (0, import_utils5.debounce)(() => {
3542
- const newRestriction = (0, import_editor_elements2.getLinkInLinkRestriction)(elementId);
3544
+ const newRestriction = (0, import_editor_elements2.getLinkInLinkRestriction)(elementId, value);
3543
3545
  if (newRestriction.shouldRestrict && isActive) {
3544
3546
  setIsActive(false);
3545
3547
  }
3546
3548
  setLinkInLinkRestriction(newRestriction);
3547
3549
  }, 300),
3548
- [elementId, isActive]
3550
+ [elementId, isActive, value]
3549
3551
  );
3550
3552
  (0, import_react33.useEffect)(() => {
3551
3553
  debouncedCheckRestriction();
@@ -3562,7 +3564,7 @@ var LinkControl = createControl((props) => {
3562
3564
  };
3563
3565
  }, [elementId, debouncedCheckRestriction]);
3564
3566
  const onEnabledChange = () => {
3565
- setLinkInLinkRestriction((0, import_editor_elements2.getLinkInLinkRestriction)(elementId));
3567
+ setLinkInLinkRestriction((0, import_editor_elements2.getLinkInLinkRestriction)(elementId, value));
3566
3568
  if (linkInLinkRestriction.shouldRestrict && !isActive) {
3567
3569
  return;
3568
3570
  }