@wix/editor-react-components 1.2315.0 → 1.2317.0

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.
@@ -2030,6 +2030,11 @@ const dialog = "dialog__i2P5D";
2030
2030
  const animationClasses = {
2031
2031
  dialog
2032
2032
  };
2033
+ const HAMBURGER_CONTENT_CLOSE_PREDICATES = [
2034
+ // Anchor links: covers buttons, images, rich text, and any other component
2035
+ // that renders navigation as an <a> element (the standard ERC pattern).
2036
+ (event) => !!event.target.closest("a[href]")
2037
+ ];
2033
2038
  const HamburgerMenu = ({
2034
2039
  id,
2035
2040
  animationName = MenuAnimationName.None,
@@ -2094,6 +2099,14 @@ const HamburgerMenu = ({
2094
2099
  () => setIsMenuOpen(false),
2095
2100
  [setIsMenuOpen]
2096
2101
  );
2102
+ const handleContentClick = React__default.useCallback(
2103
+ (event) => {
2104
+ if (HAMBURGER_CONTENT_CLOSE_PREDICATES.some((p) => p(event))) {
2105
+ closeMenu();
2106
+ }
2107
+ },
2108
+ [closeMenu]
2109
+ );
2097
2110
  const { containerRef: focusTrapRef } = useFocusTrap(isOpen);
2098
2111
  return /* @__PURE__ */ jsxs(Fragment, { children: [
2099
2112
  /* @__PURE__ */ jsx(
@@ -2169,6 +2182,7 @@ const HamburgerMenu = ({
2169
2182
  selectors.hamburgerMenuContent,
2170
2183
  classes.content
2171
2184
  ),
2185
+ onClick: handleContentClick,
2172
2186
  children: content2
2173
2187
  }
2174
2188
  )
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wix/editor-react-components",
3
- "version": "1.2315.0",
3
+ "version": "1.2317.0",
4
4
  "description": "React components for the Wix Editor",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -78,7 +78,7 @@
78
78
  "@wix/ambassador-devcenter-v1-component-type-data": "^1.0.436",
79
79
  "@wix/sdk": "^1.21.13",
80
80
  "@wix/services-manager-react": "^0.1.27",
81
- "@wix/site-ui": "1.150.0",
81
+ "@wix/site-ui": "1.151.0",
82
82
  "@wix/video": "^1.85.0",
83
83
  "@wix/viewer-service-consent-policy": "^1.0.100",
84
84
  "@wix/web-bi-logger": "^2.1.26",
@@ -193,5 +193,5 @@
193
193
  "registry": "https://registry.npmjs.org/",
194
194
  "access": "public"
195
195
  },
196
- "falconPackageHash": "9ee96dfdc0774c09cfe4ad7b42e062652b3354fc16e46ea74a7e9318"
196
+ "falconPackageHash": "c91c184b34796ac1ce4bc4dc4e65477804628175cb95b757deea76a7"
197
197
  }