@semcore/popper
Advanced tools
Comparing version 5.35.3 to 5.35.4-prerelease.0
@@ -5,2 +5,8 @@ # Changelog | ||
## [5.35.4] - 2024-05-28 | ||
### Fixed | ||
- Closing popper with `Esc` and `interaction=focus` might cause immediate reopen. | ||
## [5.35.3] - 2024-05-27 | ||
@@ -7,0 +13,0 @@ |
@@ -44,8 +44,8 @@ "use strict"; | ||
/*__reshadow-styles__:"./style/popper.shadow.css"*/ | ||
var style = ( /*__reshadow_css_start__*/_index.sstyled.insert( /*__inner_css_start__*/".___SPopper_nc2bp_gg_{outline:0;z-index:var(--intergalactic-z-index-popper, 700);color:var(--intergalactic-text-primary, #191b23)}.___SPopper_nc2bp_gg_.__keyboardFocused_nc2bp_gg_:focus:after{position:absolute;display:block;content:\"\";top:0;right:0;bottom:0;left:0;box-shadow:var(--intergalactic-keyboard-focus, 0px 0px 0px 3px rgba(0, 143, 248, 0.5));pointer-events:none;border-radius:var(--intergalactic-popper-rounded, 6px)}.___SPopper_nc2bp_gg_.__keyboardFocused_nc2bp_gg_.__hideFocus_nc2bp_gg_:focus:after{box-shadow:none}.___SFocusHint_nc2bp_gg_{display:none}.___STrigger_nc2bp_gg_:focus .___SFocusHint_nc2bp_gg_,.___STrigger_nc2bp_gg_:focus-within .___SFocusHint_nc2bp_gg_{display:inline}" /*__inner_css_end__*/, "nc2bp_gg_") /*__reshadow_css_end__*/, { | ||
"__SPopper": "___SPopper_nc2bp_gg_", | ||
"_keyboardFocused": "__keyboardFocused_nc2bp_gg_", | ||
"_hideFocus": "__hideFocus_nc2bp_gg_", | ||
"__SFocusHint": "___SFocusHint_nc2bp_gg_", | ||
"__STrigger": "___STrigger_nc2bp_gg_" | ||
var style = ( /*__reshadow_css_start__*/_index.sstyled.insert( /*__inner_css_start__*/".___SPopper_1fnw8_gg_{outline:0;z-index:var(--intergalactic-z-index-popper, 700);color:var(--intergalactic-text-primary, #191b23)}.___SPopper_1fnw8_gg_.__keyboardFocused_1fnw8_gg_:focus:after{position:absolute;display:block;content:\"\";top:0;right:0;bottom:0;left:0;box-shadow:var(--intergalactic-keyboard-focus, 0px 0px 0px 3px rgba(0, 143, 248, 0.5));pointer-events:none;border-radius:var(--intergalactic-popper-rounded, 6px)}.___SPopper_1fnw8_gg_.__keyboardFocused_1fnw8_gg_.__hideFocus_1fnw8_gg_:focus:after{box-shadow:none}.___SFocusHint_1fnw8_gg_{display:none}.___STrigger_1fnw8_gg_:focus .___SFocusHint_1fnw8_gg_,.___STrigger_1fnw8_gg_:focus-within .___SFocusHint_1fnw8_gg_{display:inline}" /*__inner_css_end__*/, "1fnw8_gg_") /*__reshadow_css_end__*/, { | ||
"__SPopper": "___SPopper_1fnw8_gg_", | ||
"_keyboardFocused": "__keyboardFocused_1fnw8_gg_", | ||
"_hideFocus": "__hideFocus_1fnw8_gg_", | ||
"__SFocusHint": "___SFocusHint_1fnw8_gg_", | ||
"__STrigger": "___STrigger_1fnw8_gg_" | ||
}); | ||
@@ -196,11 +196,13 @@ function isObject(obj) { | ||
}); | ||
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "handlerKeyDown", function (e) { | ||
var visible = _this.asProps.visible; | ||
if (visible && e.key === 'Escape') { | ||
e.stopPropagation(); | ||
_this.bindHandlerChangeVisibleWithTimer(false)(e); | ||
} | ||
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "makeKeyDownHandler", function (component) { | ||
return function (e) { | ||
var visible = _this.asProps.visible; | ||
if (visible && e.key === 'Escape') { | ||
e.stopPropagation(); | ||
_this.bindHandlerChangeVisibleWithTimer(false, component, 'onKeyDown')(e); | ||
} | ||
}; | ||
}); | ||
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "bindHandlerKeyDown", function (onKeyDown) { | ||
return (0, _assignProps3.callAllEventHandlers)(onKeyDown, _this.handlerKeyDown); | ||
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "bindHandlerKeyDown", function (onKeyDown, component) { | ||
return (0, _assignProps3.callAllEventHandlers)(onKeyDown, _this.makeKeyDownHandler(component)); | ||
}); | ||
@@ -269,3 +271,3 @@ (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "lastPopperClick", 0); | ||
var ignoringDuration = 2000; | ||
if (!visible && ['onClick', 'onBlur'].includes(action)) { | ||
if (!visible && ['onClick', 'onBlur', 'onKeyDown'].includes(action)) { | ||
_this.setState({ | ||
@@ -418,3 +420,3 @@ ignoreTriggerFocusUntil: now + ignoringDuration | ||
}, interactionProps), {}, { | ||
onKeyDown: this.bindHandlerKeyDown(onKeyDown), | ||
onKeyDown: this.bindHandlerKeyDown(onKeyDown, 'trigger'), | ||
disableEnforceFocus: disableEnforceFocus, | ||
@@ -447,3 +449,3 @@ popperRef: this.popperRef, | ||
}, interactionProps), {}, { | ||
onKeyDown: this.bindHandlerKeyDown(onKeyDown), | ||
onKeyDown: this.bindHandlerKeyDown(onKeyDown, 'popper'), | ||
placement: placement, | ||
@@ -450,0 +452,0 @@ duration: duration, |
@@ -38,8 +38,8 @@ import _objectSpread from "@babel/runtime/helpers/objectSpread2"; | ||
/*__reshadow-styles__:"./style/popper.shadow.css"*/ | ||
var style = ( /*__reshadow_css_start__*/_sstyled.insert( /*__inner_css_start__*/".___SPopper_nc2bp_gg_{outline:0;z-index:var(--intergalactic-z-index-popper, 700);color:var(--intergalactic-text-primary, #191b23)}.___SPopper_nc2bp_gg_.__keyboardFocused_nc2bp_gg_:focus:after{position:absolute;display:block;content:\"\";top:0;right:0;bottom:0;left:0;box-shadow:var(--intergalactic-keyboard-focus, 0px 0px 0px 3px rgba(0, 143, 248, 0.5));pointer-events:none;border-radius:var(--intergalactic-popper-rounded, 6px)}.___SPopper_nc2bp_gg_.__keyboardFocused_nc2bp_gg_.__hideFocus_nc2bp_gg_:focus:after{box-shadow:none}.___SFocusHint_nc2bp_gg_{display:none}.___STrigger_nc2bp_gg_:focus .___SFocusHint_nc2bp_gg_,.___STrigger_nc2bp_gg_:focus-within .___SFocusHint_nc2bp_gg_{display:inline}" /*__inner_css_end__*/, "nc2bp_gg_") /*__reshadow_css_end__*/, { | ||
"__SPopper": "___SPopper_nc2bp_gg_", | ||
"_keyboardFocused": "__keyboardFocused_nc2bp_gg_", | ||
"_hideFocus": "__hideFocus_nc2bp_gg_", | ||
"__SFocusHint": "___SFocusHint_nc2bp_gg_", | ||
"__STrigger": "___STrigger_nc2bp_gg_" | ||
var style = ( /*__reshadow_css_start__*/_sstyled.insert( /*__inner_css_start__*/".___SPopper_1fnw8_gg_{outline:0;z-index:var(--intergalactic-z-index-popper, 700);color:var(--intergalactic-text-primary, #191b23)}.___SPopper_1fnw8_gg_.__keyboardFocused_1fnw8_gg_:focus:after{position:absolute;display:block;content:\"\";top:0;right:0;bottom:0;left:0;box-shadow:var(--intergalactic-keyboard-focus, 0px 0px 0px 3px rgba(0, 143, 248, 0.5));pointer-events:none;border-radius:var(--intergalactic-popper-rounded, 6px)}.___SPopper_1fnw8_gg_.__keyboardFocused_1fnw8_gg_.__hideFocus_1fnw8_gg_:focus:after{box-shadow:none}.___SFocusHint_1fnw8_gg_{display:none}.___STrigger_1fnw8_gg_:focus .___SFocusHint_1fnw8_gg_,.___STrigger_1fnw8_gg_:focus-within .___SFocusHint_1fnw8_gg_{display:inline}" /*__inner_css_end__*/, "1fnw8_gg_") /*__reshadow_css_end__*/, { | ||
"__SPopper": "___SPopper_1fnw8_gg_", | ||
"_keyboardFocused": "__keyboardFocused_1fnw8_gg_", | ||
"_hideFocus": "__hideFocus_1fnw8_gg_", | ||
"__SFocusHint": "___SFocusHint_1fnw8_gg_", | ||
"__STrigger": "___STrigger_1fnw8_gg_" | ||
}); | ||
@@ -189,11 +189,13 @@ function isObject(obj) { | ||
}); | ||
_defineProperty(_assertThisInitialized(_this), "handlerKeyDown", function (e) { | ||
var visible = _this.asProps.visible; | ||
if (visible && e.key === 'Escape') { | ||
e.stopPropagation(); | ||
_this.bindHandlerChangeVisibleWithTimer(false)(e); | ||
} | ||
_defineProperty(_assertThisInitialized(_this), "makeKeyDownHandler", function (component) { | ||
return function (e) { | ||
var visible = _this.asProps.visible; | ||
if (visible && e.key === 'Escape') { | ||
e.stopPropagation(); | ||
_this.bindHandlerChangeVisibleWithTimer(false, component, 'onKeyDown')(e); | ||
} | ||
}; | ||
}); | ||
_defineProperty(_assertThisInitialized(_this), "bindHandlerKeyDown", function (onKeyDown) { | ||
return callAllEventHandlers(onKeyDown, _this.handlerKeyDown); | ||
_defineProperty(_assertThisInitialized(_this), "bindHandlerKeyDown", function (onKeyDown, component) { | ||
return callAllEventHandlers(onKeyDown, _this.makeKeyDownHandler(component)); | ||
}); | ||
@@ -262,3 +264,3 @@ _defineProperty(_assertThisInitialized(_this), "lastPopperClick", 0); | ||
var ignoringDuration = 2000; | ||
if (!visible && ['onClick', 'onBlur'].includes(action)) { | ||
if (!visible && ['onClick', 'onBlur', 'onKeyDown'].includes(action)) { | ||
_this.setState({ | ||
@@ -411,3 +413,3 @@ ignoreTriggerFocusUntil: now + ignoringDuration | ||
}, interactionProps), {}, { | ||
onKeyDown: this.bindHandlerKeyDown(onKeyDown), | ||
onKeyDown: this.bindHandlerKeyDown(onKeyDown, 'trigger'), | ||
disableEnforceFocus: disableEnforceFocus, | ||
@@ -440,3 +442,3 @@ popperRef: this.popperRef, | ||
}, interactionProps), {}, { | ||
onKeyDown: this.bindHandlerKeyDown(onKeyDown), | ||
onKeyDown: this.bindHandlerKeyDown(onKeyDown, 'popper'), | ||
placement: placement, | ||
@@ -443,0 +445,0 @@ duration: duration, |
{ | ||
"name": "@semcore/popper", | ||
"description": "Semrush Popper Component", | ||
"version": "5.35.3", | ||
"version": "5.35.4-prerelease.0", | ||
"main": "lib/cjs/index.js", | ||
@@ -13,11 +13,11 @@ "module": "lib/es6/index.js", | ||
"@popperjs/core": "2.11.5", | ||
"@semcore/animation": "2.27.0", | ||
"@semcore/flex-box": "5.27.0", | ||
"@semcore/neighbor-location": "4.25.0", | ||
"@semcore/outside-click": "3.25.0", | ||
"@semcore/portal": "3.27.0", | ||
"@semcore/utils": "4.28.0" | ||
"@semcore/animation": "2.27.1-prerelease.0", | ||
"@semcore/flex-box": "5.27.1-prerelease.0", | ||
"@semcore/neighbor-location": "4.25.1-prerelease.0", | ||
"@semcore/outside-click": "3.25.1-prerelease.0", | ||
"@semcore/portal": "3.27.1-prerelease.0", | ||
"@semcore/utils": "4.28.1-prerelease.0" | ||
}, | ||
"peerDependencies": { | ||
"@semcore/core": "^2.17.5", | ||
"@semcore/core": "^2.25.1-prerelease.0", | ||
"react": "16.8 - 18", | ||
@@ -24,0 +24,0 @@ "react-dom": "16.8 - 18" |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
267243
1884
2
2
+ Added@semcore/animation@2.27.1-prerelease.0(transitive)
+ Added@semcore/flex-box@5.27.1-prerelease.0(transitive)
+ Added@semcore/neighbor-location@4.25.1-prerelease.0(transitive)
+ Added@semcore/outside-click@3.25.1-prerelease.0(transitive)
+ Added@semcore/portal@3.27.1-prerelease.0(transitive)
+ Added@semcore/utils@4.28.1-prerelease.0(transitive)
- Removed@semcore/animation@2.27.0(transitive)
- Removed@semcore/flex-box@5.27.0(transitive)
- Removed@semcore/neighbor-location@4.25.0(transitive)
- Removed@semcore/outside-click@3.25.0(transitive)
- Removed@semcore/portal@3.27.0(transitive)
- Removed@semcore/utils@4.28.0(transitive)