@semcore/notice-bubble 5.47.2 → 5.48.0-prerelease.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.
- package/CHANGELOG.md +11 -0
- package/lib/cjs/NoticeBubble.js +20 -23
- package/lib/cjs/NoticeBubble.js.map +1 -1
- package/lib/cjs/NoticeBubbleManager.js +24 -10
- package/lib/cjs/NoticeBubbleManager.js.map +1 -1
- package/lib/cjs/index.d.js.map +1 -1
- package/lib/cjs/style/notice-bubble.shadow.css +2 -2
- package/lib/es6/NoticeBubble.js +20 -23
- package/lib/es6/NoticeBubble.js.map +1 -1
- package/lib/es6/NoticeBubbleManager.js +24 -10
- package/lib/es6/NoticeBubbleManager.js.map +1 -1
- package/lib/es6/index.d.js.map +1 -1
- package/lib/es6/style/notice-bubble.shadow.css +2 -2
- package/lib/types/index.d.ts +8 -0
- package/package.json +7 -7
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,17 @@
|
|
|
2
2
|
|
|
3
3
|
CHANGELOG.md standards are inspired by [keepachangelog.com](https://keepachangelog.com/en/1.0.0/).
|
|
4
4
|
|
|
5
|
+
## [5.48.0] - 2024-11-21
|
|
6
|
+
|
|
7
|
+
### Added
|
|
8
|
+
|
|
9
|
+
- `replaceLast` method to the Manager to display the next bubble on over the last one.
|
|
10
|
+
|
|
11
|
+
### Fixed
|
|
12
|
+
|
|
13
|
+
- Warning about `Hint` title about `title` and `Hint.Popper` at the same time.
|
|
14
|
+
- Unnecessary counter resetting with each mount of `NoticeBubble` component.
|
|
15
|
+
|
|
5
16
|
## [5.47.2] - 2024-11-22
|
|
6
17
|
|
|
7
18
|
### Changed
|
package/lib/cjs/NoticeBubble.js
CHANGED
|
@@ -39,21 +39,21 @@ var _ref5 = require("@semcore/utils/lib/ref");
|
|
|
39
39
|
var _excluded = ["focusLock"],
|
|
40
40
|
_excluded2 = ["forwardRef", "styles", "onMouseEnter", "onMouseLeave", "getI18nText", "icon", "children", "action", "type"];
|
|
41
41
|
/*__reshadow-styles__:"./style/notice-bubble.shadow.css"*/
|
|
42
|
-
var style = ( /*__reshadow_css_start__*/_index.sstyled.insert( /*__inner_css_start__*/"@keyframes
|
|
43
|
-
"__SContent": "
|
|
44
|
-
"__SMessage": "
|
|
45
|
-
"__SDismiss": "
|
|
46
|
-
"_use": "
|
|
47
|
-
"__SIcon": "
|
|
48
|
-
"__SNoticeBubble": "
|
|
49
|
-
"_disablePortal": "
|
|
50
|
-
"__SNoticeAriaLiveWrapper": "
|
|
51
|
-
"@enter": "
|
|
52
|
-
"@exit": "
|
|
53
|
-
"__SBubble": "
|
|
54
|
-
"__SView": "
|
|
55
|
-
"_type_info": "
|
|
56
|
-
"_type_warning": "
|
|
42
|
+
var style = ( /*__reshadow_css_start__*/_index.sstyled.insert( /*__inner_css_start__*/"@keyframes enter_f2jt1{0%{transform:translate(100%,0);max-height:0;overflow:hidden}to{transform:translate(0,0);max-height:100vh;overflow:hidden}}@keyframes exit_f2jt1{0%{max-height:100vh;overflow:hidden;opacity:1}to{max-height:0;overflow:hidden;opacity:0}}.___SBubble_f2jt1_gg_,.___SView_f2jt1_gg_{position:relative;margin-bottom:var(--intergalactic-spacing-3x, 12px);padding:var(--intergalactic-spacing-3x, 12px);padding-right:calc(var(--intergalactic-spacing-8x, 32px) + var(--intergalactic-spacing-1x, 4px));width:100%;border-radius:var(--intergalactic-popper-rounded, 6px);overflow:hidden;box-sizing:border-box;color:var(--intergalactic-text-primary-invert, #ffffff);gap:var(--intergalactic-spacing-2x, 8px)}.___SBubble_f2jt1_gg_._type_info_f2jt1_gg_,.___SView_f2jt1_gg_._type_info_f2jt1_gg_{background:var(--intergalactic-bg-primary-invert, #191b23)}.___SBubble_f2jt1_gg_._type_warning_f2jt1_gg_,.___SView_f2jt1_gg_._type_warning_f2jt1_gg_{background:var(--intergalactic-bg-primary-critical, #ff4953)}.___SContent_f2jt1_gg_{flex-direction:column;gap:var(--intergalactic-spacing-2x, 8px);flex:1}.___SMessage_f2jt1_gg_{font-size:var(--intergalactic-fs-200, 14px);line-height:var(--intergalactic-lh-200, 142%)}.___SDismiss_f2jt1_gg_{cursor:pointer;position:absolute;right:0;top:0;margin-top:var(--intergalactic-spacing-2x, 8px);margin-right:var(--intergalactic-spacing-2x, 8px);margin-bottom:var(--intergalactic-spacing-2x, 8px);flex-shrink:0;border:0;background:0 0}.___SDismiss_f2jt1_gg_.__use_f2jt1_gg_{padding:0 1px}.___SIcon_f2jt1_gg_{justify-content:center;align-items:center;height:var(--intergalactic-spacing-5x, 20px)}.___SNoticeBubble_f2jt1_gg_{width:300px;position:fixed;right:var(--intergalactic-spacing-3x, 12px);top:var(--intergalactic-spacing-3x, 12px)}@media (max-width:767px){.___SNoticeBubble_f2jt1_gg_{width:calc(100% - var(--intergalactic-spacing-6x, 24px))}}.___SNoticeBubble_f2jt1_gg_.__disablePortal_f2jt1_gg_{position:sticky;margin-left:auto;height:0}.___SMessage_f2jt1_gg_ a{color:var(--intergalactic-text-link-invert, #8ecdff)}.___SNoticeAriaLiveWrapper_f2jt1_gg_{display:content}" /*__inner_css_end__*/, "f2jt1_gg_") /*__reshadow_css_end__*/, {
|
|
43
|
+
"__SContent": "___SContent_f2jt1_gg_",
|
|
44
|
+
"__SMessage": "___SMessage_f2jt1_gg_",
|
|
45
|
+
"__SDismiss": "___SDismiss_f2jt1_gg_",
|
|
46
|
+
"_use": "__use_f2jt1_gg_",
|
|
47
|
+
"__SIcon": "___SIcon_f2jt1_gg_",
|
|
48
|
+
"__SNoticeBubble": "___SNoticeBubble_f2jt1_gg_",
|
|
49
|
+
"_disablePortal": "__disablePortal_f2jt1_gg_",
|
|
50
|
+
"__SNoticeAriaLiveWrapper": "___SNoticeAriaLiveWrapper_f2jt1_gg_",
|
|
51
|
+
"@enter": "enter_f2jt1",
|
|
52
|
+
"@exit": "exit_f2jt1",
|
|
53
|
+
"__SBubble": "___SBubble_f2jt1_gg_",
|
|
54
|
+
"__SView": "___SView_f2jt1_gg_",
|
|
55
|
+
"_type_info": "_type_info_f2jt1_gg_",
|
|
56
|
+
"_type_warning": "_type_warning_f2jt1_gg_"
|
|
57
57
|
});
|
|
58
58
|
var Notices = function Notices(props) {
|
|
59
59
|
var styles = props.styles,
|
|
@@ -118,9 +118,7 @@ var NoticeBubbleContainerRoot = /*#__PURE__*/function (_Component) {
|
|
|
118
118
|
(0, _createClass2["default"])(NoticeBubbleContainerRoot, [{
|
|
119
119
|
key: "componentDidMount",
|
|
120
120
|
value: function componentDidMount() {
|
|
121
|
-
|
|
122
|
-
manager.counter = 0;
|
|
123
|
-
this._unsubscribe = manager.addListener(this.handleChange);
|
|
121
|
+
this._unsubscribe = this.asProps.manager.addListener(this.handleChange);
|
|
124
122
|
}
|
|
125
123
|
}, {
|
|
126
124
|
key: "render",
|
|
@@ -268,9 +266,7 @@ var ViewInfo = /*#__PURE__*/function (_Component2) {
|
|
|
268
266
|
"onMouseEnter": (0, _assignProps2.callAllEventHandlers)(onMouseEnter, this.handleMouseEnter),
|
|
269
267
|
"onMouseLeave": (0, _assignProps2.callAllEventHandlers)(onMouseLeave, this.handleMouseLeave),
|
|
270
268
|
"role": type === 'warning' ? 'alert' : this.props.role
|
|
271
|
-
})), /*#__PURE__*/_react["default"].createElement(
|
|
272
|
-
"title": getI18nText('close')
|
|
273
|
-
}), /*#__PURE__*/_react["default"].createElement(SDismiss
|
|
269
|
+
})), /*#__PURE__*/_react["default"].createElement(SDismiss
|
|
274
270
|
// biome-ignore lint/a11y/useValidAriaValues:
|
|
275
271
|
, _ref4.cn("SDismiss", {
|
|
276
272
|
"aria-haspopup": undefined,
|
|
@@ -281,11 +277,12 @@ var ViewInfo = /*#__PURE__*/function (_Component2) {
|
|
|
281
277
|
"theme": 'invert',
|
|
282
278
|
"onClick": this.handleClose,
|
|
283
279
|
"aria-label": getI18nText('close'),
|
|
284
|
-
"active": false
|
|
280
|
+
"active": false,
|
|
281
|
+
"title": getI18nText('close')
|
|
285
282
|
}), /*#__PURE__*/_react["default"].createElement(_button["default"].Addon, {
|
|
286
283
|
tag: _m["default"],
|
|
287
284
|
color: "icon-primary-invert"
|
|
288
|
-
})),
|
|
285
|
+
})), (0, _isNode["default"])(icon) ? /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, /*#__PURE__*/_react["default"].createElement(SIcon, _ref4.cn("SIcon", {}), icon), /*#__PURE__*/_react["default"].createElement(SContent, _ref4.cn("SContent", {}), /*#__PURE__*/_react["default"].createElement(SMessage, _ref4.cn("SMessage", {}), children), (0, _isNode["default"])(actionNode) ? /*#__PURE__*/_react["default"].createElement(SAction, _ref4.cn("SAction", {}), actionNode) : null)) : /*#__PURE__*/_react["default"].createElement(SContent, _ref4.cn("SContent", {}), /*#__PURE__*/_react["default"].createElement(SMessage, _ref4.cn("SMessage", {}), children), (0, _isNode["default"])(actionNode) ? /*#__PURE__*/_react["default"].createElement(SAction, _ref4.cn("SAction", {}), actionNode) : null));
|
|
289
286
|
}
|
|
290
287
|
}]);
|
|
291
288
|
return ViewInfo;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NoticeBubble.js","names":["_core","_interopRequireWildcard","require","_react","_interopRequireDefault","_portal","_NoticeBubbleManager","_animation","_flexBox","_fire","_isNode","_assignProps2","_m","_utils","_intergalacticDynamicLocales","_i18nEnhance","_useCssVariable","_ThemeProvider","_button","_useFocusLock","_tooltip","_zIndexStacking","_ref5","_excluded","_excluded2","style","_index","sstyled","insert","Notices","props","styles","_props$data","data","_props$tag","tag","SView","ViewInfo","ref","React","useRef","durationStr","useCssVariable","duration","useMemo","parseInt","map","notice","_ref2","_notice$visible","createElement","Animation","cn","uid","initialAnimation","visible","_objectSpread2","getI18nText","NoticeBubbleContainerRoot","_Component","_inherits2","_super","_createSuper2","_this","_classCallCheck2","_len","arguments","length","args","Array","_key","call","apply","concat","_defineProperty2","_assertThisInitialized2","notices","warnings","_unsubscribe","info","filter","type","warning","setState","_createClass2","key","value","componentDidMount","manager","asProps","counter","addListener","handleChange","render","_ref","_ref3","SNoticeBubble","Box","SNoticeAriaLiveWrapper","_this$asProps","Children","disablePortal","parentZIndexStacking","_this$state","state","ZIndexStackingContextProvider","assignProps","ViewWarning","Component","i18nEnhance","localizedMessages","contextThemeEnhance","zIndexStackingEnhance","i18n","locale","FocusLock","forwardRef","outerRef","focusLock","other","_objectWithoutProperties2","innerRef","useFocusLock","useForkRef","Flex","_extends2","_Component2","_super2","_this2","_len2","_key2","createRef","e","fire","clearTimer","timer","pause","resume","event","_this2$timer","paused","rect","current","getBoundingClientRect","mouseInRect","clientX","left","right","clientY","top","bottom","Timer","handleClose","document","body","addEventListener","handleBodyMouseMove","componentWillUnmount","removeEventListener","clear","_ref4","SBubble","SDismiss","Hint","Trigger","SContent","SMessage","SAction","SIcon","_this$props","onMouseEnter","onMouseLeave","icon","children","actionNode","action","forkRef","callAllEventHandlers","handleMouseEnter","handleMouseLeave","role","undefined","Button","Addon","CloseIcon","color","Popper","isNode","Fragment","_ViewInfo","_super3","NoticeBubbleView","_Component3","_super4","_this3","_len3","_key3","_notice","add","remove","componentDidUpdate","update","NoticeBubbleWarningView","_NoticeBubbleView","_super5","NoticeBubbleContainer","createComponent","Info","Warning","NoticeBubble","exports","NoticeBubbleWarning","_default"],"sources":["../../src/NoticeBubble.jsx"],"sourcesContent":["import React from 'react';\nimport Portal from '@semcore/portal';\nimport manager from './NoticeBubbleManager';\nimport createComponent, { Component, sstyled, Root } from '@semcore/core';\nimport { Animation } from '@semcore/animation';\nimport { Flex, Box } from '@semcore/flex-box';\nimport fire from '@semcore/utils/lib/fire';\nimport isNode from '@semcore/utils/lib/isNode';\nimport { callAllEventHandlers } from '@semcore/utils/lib/assignProps';\nimport CloseIcon from '@semcore/icon/Close/m';\nimport { Timer } from './utils';\nimport { localizedMessages } from './translations/__intergalactic-dynamic-locales';\nimport i18nEnhance from '@semcore/utils/lib/enhances/i18nEnhance';\nimport { useCssVariable } from '@semcore/utils/lib/useCssVariable';\nimport { contextThemeEnhance } from '@semcore/utils/lib/ThemeProvider';\nimport Button from '@semcore/button';\nimport { useFocusLock } from '@semcore/utils/lib/use/useFocusLock';\nimport { Hint } from '@semcore/tooltip';\nimport {\n ZIndexStackingContextProvider,\n zIndexStackingEnhance,\n} from '@semcore/utils/lib/zIndexStacking';\n\nimport style from './style/notice-bubble.shadow.css';\nimport { forkRef, useForkRef } from '@semcore/utils/lib/ref';\n\nconst Notices = (props) => {\n const { styles, data = [], tag: SView = ViewInfo } = props;\n const ref = React.useRef();\n const durationStr = useCssVariable('--intergalactic-duration-popper', '200', ref);\n const duration = React.useMemo(() => parseInt(durationStr, 10), [durationStr]);\n\n return data.map((notice) => {\n return sstyled(styles)(\n <Animation\n key={notice.uid}\n initialAnimation={notice.initialAnimation}\n visible={notice.visible ?? true}\n duration={duration}\n keyframes={[styles['@enter'], styles['@exit']]}\n ref={ref}\n >\n <SView {...notice} styles={notice.styles || styles} getI18nText={props.getI18nText} />\n </Animation>,\n );\n });\n};\n\nclass NoticeBubbleContainerRoot extends Component {\n static displayName = 'NoticeBubbleContainer';\n static style = style;\n static enhance = [\n i18nEnhance(localizedMessages),\n contextThemeEnhance(),\n zIndexStackingEnhance('z-index-notice-bubble'),\n ];\n static defaultProps = {\n manager,\n i18n: localizedMessages,\n locale: 'en',\n };\n\n _unsubscribe = null;\n\n state = {\n notices: [],\n warnings: [],\n };\n\n componentDidMount() {\n const { manager } = this.asProps;\n manager.counter = 0;\n this._unsubscribe = manager.addListener(this.handleChange);\n }\n\n componentWillUnmount = () => {\n if (this._unsubscribe) {\n this._unsubscribe();\n }\n };\n\n handleChange = (notices) => {\n const info = notices.filter((notice) => notice.type === 'info');\n const warning = notices.filter((notice) => notice.type === 'warning');\n\n this.setState({ notices: info, warnings: warning });\n };\n\n render() {\n const SNoticeBubble = Root;\n const SNoticeAriaLiveWrapper = 'div';\n const { Children, styles, disablePortal, getI18nText, ref, parentZIndexStacking } =\n this.asProps;\n const { notices, warnings } = this.state;\n\n return sstyled(styles)(\n <ZIndexStackingContextProvider designToken='z-index-notice-bubble'>\n <Portal disablePortal={disablePortal}>\n <SNoticeBubble\n render={Box}\n ref={ref}\n tag='section'\n role='region'\n aria-label={getI18nText('notification')}\n zIndex={parentZIndexStacking}\n >\n <Children />\n <Notices styles={styles} data={warnings} tag={ViewWarning} getI18nText={getI18nText} />\n <SNoticeAriaLiveWrapper aria-live='polite'>\n <Notices styles={styles} data={notices} tag={ViewInfo} getI18nText={getI18nText} />\n </SNoticeAriaLiveWrapper>\n </SNoticeBubble>\n </Portal>\n </ZIndexStackingContextProvider>,\n );\n }\n}\n\nconst FocusLock = React.forwardRef((props, outerRef) => {\n const { focusLock, ...other } = props;\n const innerRef = React.useRef();\n useFocusLock(innerRef, false, 'auto', !focusLock, true);\n const ref = useForkRef(outerRef, innerRef);\n\n return <Flex ref={ref} {...other} />;\n});\n\nclass ViewInfo extends Component {\n timer = null;\n ref = React.createRef();\n\n componentDidMount() {\n const { duration } = this.props;\n if (duration) {\n this.timer = new Timer(this.handleClose, duration);\n document.body.addEventListener('mousemove', this.handleBodyMouseMove);\n }\n }\n\n componentWillUnmount() {\n this.clearTimer();\n document.body.removeEventListener('mousemove', this.handleBodyMouseMove);\n }\n\n clearTimer() {\n if (this.timer) {\n this.timer.clear();\n this.timer = null;\n }\n }\n\n handleClose = (e) => {\n // because it might be called not only from the close icon click\n fire(this, 'onClose', e);\n this.clearTimer();\n };\n\n handleMouseEnter = () => {\n if (!this.timer) return;\n this.timer.pause();\n };\n\n handleMouseLeave = () => {\n if (!this.timer) return;\n this.timer.resume();\n };\n\n handleBodyMouseMove = (event) => {\n if (!this.timer?.paused) return;\n const rect = this.ref.current.getBoundingClientRect();\n const mouseInRect =\n event.clientX >= rect.left &&\n event.clientX <= rect.right &&\n event.clientY >= rect.top &&\n event.clientY <= rect.bottom;\n if (mouseInRect) return;\n this.timer.resume();\n };\n\n render() {\n const SBubble = FocusLock;\n const SDismiss = Hint.Trigger;\n const SContent = Flex;\n const SMessage = 'div';\n const SAction = 'div';\n const SIcon = Flex;\n const {\n forwardRef,\n styles,\n onMouseEnter,\n onMouseLeave,\n getI18nText,\n icon,\n children,\n action: actionNode,\n type,\n ...other\n } = this.props;\n\n return sstyled(styles)(\n <SBubble\n {...other}\n ref={forkRef(forwardRef, this.ref)}\n onMouseEnter={callAllEventHandlers(onMouseEnter, this.handleMouseEnter)}\n onMouseLeave={callAllEventHandlers(onMouseLeave, this.handleMouseLeave)}\n role={type === 'warning' ? 'alert' : this.props.role}\n >\n <Hint title={getI18nText('close')}>\n <SDismiss\n // biome-ignore lint/a11y/useValidAriaValues:\n aria-haspopup={undefined}\n tag={Button}\n type='button'\n use='tertiary'\n size='m'\n theme='invert'\n onClick={this.handleClose}\n aria-label={getI18nText('close')}\n active={false}\n >\n <Button.Addon tag={CloseIcon} color='icon-primary-invert' />\n </SDismiss>\n <Hint.Popper />\n </Hint>\n\n {isNode(icon) ? (\n <>\n <SIcon>{icon}</SIcon>\n <SContent>\n <SMessage>{children}</SMessage>\n {isNode(actionNode) ? <SAction>{actionNode}</SAction> : null}\n </SContent>\n </>\n ) : (\n <SContent>\n <SMessage>{children}</SMessage>\n {isNode(actionNode) ? <SAction>{actionNode}</SAction> : null}\n </SContent>\n )}\n </SBubble>,\n );\n }\n}\n\nclass ViewWarning extends ViewInfo {\n static defaultProps = {\n type: 'warning',\n duration: 0,\n };\n}\n\nclass NoticeBubbleView extends Component {\n static defaultProps = {\n duration: 5000,\n type: 'info',\n manager,\n };\n\n _notice = null;\n\n componentDidMount() {\n this._notice = this.asProps.manager.add(this.asProps);\n }\n\n componentWillUnmount() {\n if (this._notice) {\n this._notice.remove();\n }\n }\n\n componentDidUpdate() {\n if (this._notice) {\n this._notice.update(this.asProps);\n }\n }\n\n render() {\n return null;\n }\n}\n\nclass NoticeBubbleWarningView extends NoticeBubbleView {\n static defaultProps = {\n duration: 5000,\n type: 'warning',\n manager,\n };\n}\n\nconst NoticeBubbleContainer = createComponent(NoticeBubbleContainerRoot, {\n Info: NoticeBubbleView,\n Warning: NoticeBubbleWarningView,\n});\n\nconst NoticeBubble = NoticeBubbleContainer.Info;\nconst NoticeBubbleWarning = NoticeBubbleContainer.Warning;\n\nexport { NoticeBubble, NoticeBubbleWarning };\n\nexport default NoticeBubbleContainer;\n"],"mappings":";;;;;;;;;;;;;;;;;;AAGA,IAAAA,KAAA,GAAAC,uBAAA,CAAAC,OAAA;AAHA,IAAAC,MAAA,GAAAC,sBAAA,CAAAF,OAAA;AACA,IAAAG,OAAA,GAAAD,sBAAA,CAAAF,OAAA;AACA,IAAAI,oBAAA,GAAAF,sBAAA,CAAAF,OAAA;AAEA,IAAAK,UAAA,GAAAL,OAAA;AACA,IAAAM,QAAA,GAAAN,OAAA;AACA,IAAAO,KAAA,GAAAL,sBAAA,CAAAF,OAAA;AACA,IAAAQ,OAAA,GAAAN,sBAAA,CAAAF,OAAA;AACA,IAAAS,aAAA,GAAAT,OAAA;AACA,IAAAU,EAAA,GAAAR,sBAAA,CAAAF,OAAA;AACA,IAAAW,MAAA,GAAAX,OAAA;AACA,IAAAY,4BAAA,GAAAZ,OAAA;AACA,IAAAa,YAAA,GAAAX,sBAAA,CAAAF,OAAA;AACA,IAAAc,eAAA,GAAAd,OAAA;AACA,IAAAe,cAAA,GAAAf,OAAA;AACA,IAAAgB,OAAA,GAAAd,sBAAA,CAAAF,OAAA;AACA,IAAAiB,aAAA,GAAAjB,OAAA;AACA,IAAAkB,QAAA,GAAAlB,OAAA;AACA,IAAAmB,eAAA,GAAAnB,OAAA;AAMA,IAAAoB,KAAA,GAAApB,OAAA;AAA6D,IAAAqB,SAAA;EAAAC,UAAA;AAAA;AAAA,IAAAC,KAAA,+BAAAC,MAAA,CAAAC,OAAA,CAAAC,MAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;AAAA;AAE7D,IAAMC,OAAO,GAAG,SAAVA,OAAOA,CAAIC,KAA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ACF;EAAC;IAAAJ,GAAA;IAAAC,KAAA,EAED,SAAAO,OAAA,EAAS;MACP,OAAO,IAAI;IACb;EAAC;EAAA,OAAAkG,gBAAA;AAAA,EA3B4BnF,eAAS;AAAA,IAAAlC,gBAAA,aAAlCqH,gBAAgB,kBACE;EACpBpJ,QAAQ,EAAE,IAAI;EACdsC,IAAI,EAAE,MAAM;EACZO,OAAO,EAAPA;AACF,CAAC;AAAA,IAyBGkH,uBAAuB,0BAAAC,iBAAA;EAAA,IAAA/I,UAAA,aAAA8I,uBAAA,EAAAC,iBAAA;EAAA,IAAAC,OAAA,OAAA9I,aAAA,aAAA4I,uBAAA;EAAA,SAAAA,wBAAA;IAAA,IAAA1I,gBAAA,mBAAA0I,uBAAA;IAAA,OAAAE,OAAA,CAAApI,KAAA,OAAAN,SAAA;EAAA;EAAA,WAAAkB,aAAA,aAAAsH,uBAAA;AAAA,EAASX,gBAAgB;AAAA,IAAArH,gBAAA,aAAhDgI,uBAAuB,kBACL;EACpB/J,QAAQ,EAAE,IAAI;EACdsC,IAAI,EAAE,SAAS;EACfO,OAAO,EAAPA;AACF,CAAC;AAGH,IAAMqH,qBAAqB,GAAG,IAAAC,gBAAe,EAACpJ,yBAAyB,EAAE;EACvEqJ,IAAI,EAAEhB,gBAAgB;EACtBiB,OAAO,EAAEN;AACX,CAAC,CAAC;AAEF,IAAMO,YAAY,GAAGJ,qBAAqB,CAACE,IAAI;AAACG,OAAA,CAAAD,YAAA,GAAAA,YAAA;AAChD,IAAME,mBAAmB,GAAGN,qBAAqB,CAACG,OAAO;AAACE,OAAA,CAAAC,mBAAA,GAAAA,mBAAA;AAAA,IAAAC,QAAA,GAI3CP,qBAAqB;AAAAK,OAAA,cAAAE,QAAA"}
|
|
1
|
+
{"version":3,"file":"NoticeBubble.js","names":["_core","_interopRequireWildcard","require","_react","_interopRequireDefault","_portal","_NoticeBubbleManager","_animation","_flexBox","_fire","_isNode","_assignProps2","_m","_utils","_intergalacticDynamicLocales","_i18nEnhance","_useCssVariable","_ThemeProvider","_button","_useFocusLock","_tooltip","_zIndexStacking","_ref5","_excluded","_excluded2","style","_index","sstyled","insert","Notices","props","styles","_props$data","data","_props$tag","tag","SView","ViewInfo","ref","React","useRef","durationStr","useCssVariable","duration","useMemo","parseInt","map","notice","_ref2","_notice$visible","createElement","Animation","cn","uid","initialAnimation","visible","_objectSpread2","getI18nText","NoticeBubbleContainerRoot","_Component","_inherits2","_super","_createSuper2","_this","_classCallCheck2","_len","arguments","length","args","Array","_key","call","apply","concat","_defineProperty2","_assertThisInitialized2","notices","warnings","_unsubscribe","info","filter","type","warning","setState","_createClass2","key","value","componentDidMount","asProps","manager","addListener","handleChange","render","_ref","_ref3","SNoticeBubble","Box","SNoticeAriaLiveWrapper","_this$asProps","Children","disablePortal","parentZIndexStacking","_this$state","state","ZIndexStackingContextProvider","assignProps","ViewWarning","Component","i18nEnhance","localizedMessages","contextThemeEnhance","zIndexStackingEnhance","i18n","locale","FocusLock","forwardRef","outerRef","focusLock","other","_objectWithoutProperties2","innerRef","useFocusLock","useForkRef","Flex","_extends2","_Component2","_super2","_this2","_len2","_key2","createRef","e","fire","clearTimer","timer","pause","resume","event","_this2$timer","paused","rect","current","getBoundingClientRect","mouseInRect","clientX","left","right","clientY","top","bottom","Timer","handleClose","document","body","addEventListener","handleBodyMouseMove","componentWillUnmount","removeEventListener","clear","_ref4","SBubble","SDismiss","Hint","Trigger","SContent","SMessage","SAction","SIcon","_this$props","onMouseEnter","onMouseLeave","icon","children","actionNode","action","forkRef","callAllEventHandlers","handleMouseEnter","handleMouseLeave","role","undefined","Button","Addon","CloseIcon","color","isNode","Fragment","_ViewInfo","_super3","NoticeBubbleView","_Component3","_super4","_this3","_len3","_key3","_notice","add","remove","componentDidUpdate","update","NoticeBubbleWarningView","_NoticeBubbleView","_super5","NoticeBubbleContainer","createComponent","Info","Warning","NoticeBubble","exports","NoticeBubbleWarning","_default"],"sources":["../../src/NoticeBubble.jsx"],"sourcesContent":["import React from 'react';\nimport Portal from '@semcore/portal';\nimport manager from './NoticeBubbleManager';\nimport createComponent, { Component, sstyled, Root } from '@semcore/core';\nimport { Animation } from '@semcore/animation';\nimport { Flex, Box } from '@semcore/flex-box';\nimport fire from '@semcore/utils/lib/fire';\nimport isNode from '@semcore/utils/lib/isNode';\nimport { callAllEventHandlers } from '@semcore/utils/lib/assignProps';\nimport CloseIcon from '@semcore/icon/Close/m';\nimport { Timer } from './utils';\nimport { localizedMessages } from './translations/__intergalactic-dynamic-locales';\nimport i18nEnhance from '@semcore/utils/lib/enhances/i18nEnhance';\nimport { useCssVariable } from '@semcore/utils/lib/useCssVariable';\nimport { contextThemeEnhance } from '@semcore/utils/lib/ThemeProvider';\nimport Button from '@semcore/button';\nimport { useFocusLock } from '@semcore/utils/lib/use/useFocusLock';\nimport { Hint } from '@semcore/tooltip';\nimport {\n ZIndexStackingContextProvider,\n zIndexStackingEnhance,\n} from '@semcore/utils/lib/zIndexStacking';\n\nimport style from './style/notice-bubble.shadow.css';\nimport { forkRef, useForkRef } from '@semcore/utils/lib/ref';\n\nconst Notices = (props) => {\n const { styles, data = [], tag: SView = ViewInfo } = props;\n const ref = React.useRef();\n const durationStr = useCssVariable('--intergalactic-duration-popper', '200', ref);\n const duration = React.useMemo(() => parseInt(durationStr, 10), [durationStr]);\n\n return data.map((notice) => {\n return sstyled(styles)(\n <Animation\n key={notice.uid}\n initialAnimation={notice.initialAnimation}\n visible={notice.visible ?? true}\n duration={duration}\n keyframes={[styles['@enter'], styles['@exit']]}\n ref={ref}\n >\n <SView {...notice} styles={notice.styles || styles} getI18nText={props.getI18nText} />\n </Animation>,\n );\n });\n};\n\nclass NoticeBubbleContainerRoot extends Component {\n static displayName = 'NoticeBubbleContainer';\n static style = style;\n static enhance = [\n i18nEnhance(localizedMessages),\n contextThemeEnhance(),\n zIndexStackingEnhance('z-index-notice-bubble'),\n ];\n static defaultProps = {\n manager,\n i18n: localizedMessages,\n locale: 'en',\n };\n\n _unsubscribe = null;\n\n state = {\n notices: [],\n warnings: [],\n };\n\n componentDidMount() {\n this._unsubscribe = this.asProps.manager.addListener(this.handleChange);\n }\n\n componentWillUnmount = () => {\n if (this._unsubscribe) {\n this._unsubscribe();\n }\n };\n\n handleChange = (notices) => {\n const info = notices.filter((notice) => notice.type === 'info');\n const warning = notices.filter((notice) => notice.type === 'warning');\n\n this.setState({ notices: info, warnings: warning });\n };\n\n render() {\n const SNoticeBubble = Root;\n const SNoticeAriaLiveWrapper = 'div';\n const { Children, styles, disablePortal, getI18nText, ref, parentZIndexStacking } =\n this.asProps;\n const { notices, warnings } = this.state;\n\n return sstyled(styles)(\n <ZIndexStackingContextProvider designToken='z-index-notice-bubble'>\n <Portal disablePortal={disablePortal}>\n <SNoticeBubble\n render={Box}\n ref={ref}\n tag='section'\n role='region'\n aria-label={getI18nText('notification')}\n zIndex={parentZIndexStacking}\n >\n <Children />\n <Notices styles={styles} data={warnings} tag={ViewWarning} getI18nText={getI18nText} />\n <SNoticeAriaLiveWrapper aria-live='polite'>\n <Notices styles={styles} data={notices} tag={ViewInfo} getI18nText={getI18nText} />\n </SNoticeAriaLiveWrapper>\n </SNoticeBubble>\n </Portal>\n </ZIndexStackingContextProvider>,\n );\n }\n}\n\nconst FocusLock = React.forwardRef((props, outerRef) => {\n const { focusLock, ...other } = props;\n const innerRef = React.useRef();\n useFocusLock(innerRef, false, 'auto', !focusLock, true);\n const ref = useForkRef(outerRef, innerRef);\n\n return <Flex ref={ref} {...other} />;\n});\n\nclass ViewInfo extends Component {\n timer = null;\n ref = React.createRef();\n\n componentDidMount() {\n const { duration } = this.props;\n if (duration) {\n this.timer = new Timer(this.handleClose, duration);\n document.body.addEventListener('mousemove', this.handleBodyMouseMove);\n }\n }\n\n componentWillUnmount() {\n this.clearTimer();\n document.body.removeEventListener('mousemove', this.handleBodyMouseMove);\n }\n\n clearTimer() {\n if (this.timer) {\n this.timer.clear();\n this.timer = null;\n }\n }\n\n handleClose = (e) => {\n // because it might be called not only from the close icon click\n fire(this, 'onClose', e);\n this.clearTimer();\n };\n\n handleMouseEnter = () => {\n if (!this.timer) return;\n this.timer.pause();\n };\n\n handleMouseLeave = () => {\n if (!this.timer) return;\n this.timer.resume();\n };\n\n handleBodyMouseMove = (event) => {\n if (!this.timer?.paused) return;\n const rect = this.ref.current.getBoundingClientRect();\n const mouseInRect =\n event.clientX >= rect.left &&\n event.clientX <= rect.right &&\n event.clientY >= rect.top &&\n event.clientY <= rect.bottom;\n if (mouseInRect) return;\n this.timer.resume();\n };\n\n render() {\n const SBubble = FocusLock;\n const SDismiss = Hint.Trigger;\n const SContent = Flex;\n const SMessage = 'div';\n const SAction = 'div';\n const SIcon = Flex;\n const {\n forwardRef,\n styles,\n onMouseEnter,\n onMouseLeave,\n getI18nText,\n icon,\n children,\n action: actionNode,\n type,\n ...other\n } = this.props;\n\n return sstyled(styles)(\n <SBubble\n {...other}\n ref={forkRef(forwardRef, this.ref)}\n onMouseEnter={callAllEventHandlers(onMouseEnter, this.handleMouseEnter)}\n onMouseLeave={callAllEventHandlers(onMouseLeave, this.handleMouseLeave)}\n role={type === 'warning' ? 'alert' : this.props.role}\n >\n <SDismiss\n // biome-ignore lint/a11y/useValidAriaValues:\n aria-haspopup={undefined}\n tag={Button}\n type='button'\n use='tertiary'\n size='m'\n theme='invert'\n onClick={this.handleClose}\n aria-label={getI18nText('close')}\n active={false}\n title={getI18nText('close')}\n >\n <Button.Addon tag={CloseIcon} color='icon-primary-invert' />\n </SDismiss>\n\n {isNode(icon) ? (\n <>\n <SIcon>{icon}</SIcon>\n <SContent>\n <SMessage>{children}</SMessage>\n {isNode(actionNode) ? <SAction>{actionNode}</SAction> : null}\n </SContent>\n </>\n ) : (\n <SContent>\n <SMessage>{children}</SMessage>\n {isNode(actionNode) ? <SAction>{actionNode}</SAction> : null}\n </SContent>\n )}\n </SBubble>,\n );\n }\n}\n\nclass ViewWarning extends ViewInfo {\n static defaultProps = {\n type: 'warning',\n duration: 0,\n };\n}\n\nclass NoticeBubbleView extends Component {\n static defaultProps = {\n duration: 5000,\n type: 'info',\n manager,\n };\n\n _notice = null;\n\n componentDidMount() {\n this._notice = this.asProps.manager.add(this.asProps);\n }\n\n componentWillUnmount() {\n if (this._notice) {\n this._notice.remove();\n }\n }\n\n componentDidUpdate() {\n if (this._notice) {\n this._notice.update(this.asProps);\n }\n }\n\n render() {\n return null;\n }\n}\n\nclass NoticeBubbleWarningView extends NoticeBubbleView {\n static defaultProps = {\n duration: 5000,\n type: 'warning',\n manager,\n };\n}\n\nconst NoticeBubbleContainer = createComponent(NoticeBubbleContainerRoot, {\n Info: NoticeBubbleView,\n Warning: NoticeBubbleWarningView,\n});\n\nconst NoticeBubble = NoticeBubbleContainer.Info;\nconst NoticeBubbleWarning = NoticeBubbleContainer.Warning;\n\nexport { NoticeBubble, NoticeBubbleWarning };\n\nexport default NoticeBubbleContainer;\n"],"mappings":";;;;;;;;;;;;;;;;;;AAGA,IAAAA,KAAA,GAAAC,uBAAA,CAAAC,OAAA;AAHA,IAAAC,MAAA,GAAAC,sBAAA,CAAAF,OAAA;AACA,IAAAG,OAAA,GAAAD,sBAAA,CAAAF,OAAA;AACA,IAAAI,oBAAA,GAAAF,sBAAA,CAAAF,OAAA;AAEA,IAAAK,UAAA,GAAAL,OAAA;AACA,IAAAM,QAAA,GAAAN,OAAA;AACA,IAAAO,KAAA,GAAAL,sBAAA,CAAAF,OAAA;AACA,IAAAQ,OAAA,GAAAN,sBAAA,CAAAF,OAAA;AACA,IAAAS,aAAA,GAAAT,OAAA;AACA,IAAAU,EAAA,GAAAR,sBAAA,CAAAF,OAAA;AACA,IAAAW,MAAA,GAAAX,OAAA;AACA,IAAAY,4BAAA,GAAAZ,OAAA;AACA,IAAAa,YAAA,GAAAX,sBAAA,CAAAF,OAAA;AACA,IAAAc,eAAA,GAAAd,OAAA;AACA,IAAAe,cAAA,GAAAf,OAAA;AACA,IAAAgB,OAAA,GAAAd,sBAAA,CAAAF,OAAA;AACA,IAAAiB,aAAA,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_interopRequireDefault(require("@semcore/utils/lib/eventEmit
|
|
|
13
13
|
var _assignProps = require("@semcore/utils/lib/assignProps");
|
|
14
14
|
var _useFocusLock = require("@semcore/utils/lib/use/useFocusLock");
|
|
15
15
|
var _react = _interopRequireDefault(require("react"));
|
|
16
|
+
var _rafTrottle = _interopRequireDefault(require("@semcore/utils/lib/rafTrottle"));
|
|
16
17
|
var EVENT_NAME = 'CHANGE';
|
|
17
18
|
var NoticeBubbleManager = /*#__PURE__*/function () {
|
|
18
19
|
function NoticeBubbleManager() {
|
|
@@ -20,6 +21,7 @@ var NoticeBubbleManager = /*#__PURE__*/function () {
|
|
|
20
21
|
(0, _defineProperty2["default"])(this, "items", []);
|
|
21
22
|
(0, _defineProperty2["default"])(this, "emitter", null);
|
|
22
23
|
(0, _defineProperty2["default"])(this, "counter", 0);
|
|
24
|
+
(0, _defineProperty2["default"])(this, "replaceTimer", 0);
|
|
23
25
|
this.emitter = new _eventEmitter["default"]();
|
|
24
26
|
}
|
|
25
27
|
(0, _createClass2["default"])(NoticeBubbleManager, [{
|
|
@@ -82,23 +84,35 @@ var NoticeBubbleManager = /*#__PURE__*/function () {
|
|
|
82
84
|
}
|
|
83
85
|
return false;
|
|
84
86
|
}
|
|
87
|
+
}, {
|
|
88
|
+
key: "replaceLast",
|
|
89
|
+
value: function replaceLast(props) {
|
|
90
|
+
var _this = this;
|
|
91
|
+
if (this.replaceTimer) {
|
|
92
|
+
clearTimeout(this.replaceTimer);
|
|
93
|
+
}
|
|
94
|
+
var item = this.items[this.items.length - 1];
|
|
95
|
+
if (item !== null && item !== void 0 && item.visible) {
|
|
96
|
+
this.remove(this.counter - 1);
|
|
97
|
+
}
|
|
98
|
+
this.replaceTimer = setTimeout(function () {
|
|
99
|
+
_this.add(props);
|
|
100
|
+
}, 300);
|
|
101
|
+
}
|
|
85
102
|
}, {
|
|
86
103
|
key: "remove",
|
|
87
104
|
value: function remove(uid) {
|
|
88
|
-
var
|
|
89
|
-
var
|
|
105
|
+
var _this2 = this;
|
|
106
|
+
var item = this.items.find(function (item) {
|
|
90
107
|
return item.uid === uid;
|
|
91
108
|
});
|
|
92
|
-
if (
|
|
93
|
-
|
|
109
|
+
if (item) {
|
|
110
|
+
item.visible = false;
|
|
94
111
|
setTimeout(function () {
|
|
95
|
-
|
|
96
|
-
return item.uid
|
|
112
|
+
_this2.items = _this2.items.filter(function (item) {
|
|
113
|
+
return item.uid !== uid;
|
|
97
114
|
});
|
|
98
|
-
|
|
99
|
-
_this.items.splice(index, 1);
|
|
100
|
-
_this.emit();
|
|
101
|
-
}
|
|
115
|
+
_this2.emit();
|
|
102
116
|
}, 1000);
|
|
103
117
|
this.emit();
|
|
104
118
|
return true;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NoticeBubbleManager.js","names":["_eventEmitter","_interopRequireDefault","require","_assignProps","_useFocusLock","_react","EVENT_NAME","NoticeBubbleManager","_classCallCheck2","_defineProperty2","emitter","EventEmitter","_createClass2","key","value","addListener","fn","subscribe","createItem","props","manager","_objectSpread2","type","onClose","callAllEventHandlers","remove","uid","emit","items","add","counter","ref","React","createRef","focus","setTimeout","setFocus","current","item","visible","initialAnimation","undefined","forwardRef","push","update","bind","index","findIndex","_this","
|
|
1
|
+
{"version":3,"file":"NoticeBubbleManager.js","names":["_eventEmitter","_interopRequireDefault","require","_assignProps","_useFocusLock","_react","_rafTrottle","EVENT_NAME","NoticeBubbleManager","_classCallCheck2","_defineProperty2","emitter","EventEmitter","_createClass2","key","value","addListener","fn","subscribe","createItem","props","manager","_objectSpread2","type","onClose","callAllEventHandlers","remove","uid","emit","items","add","counter","ref","React","createRef","focus","setTimeout","setFocus","current","item","visible","initialAnimation","undefined","forwardRef","push","update","bind","index","findIndex","replaceLast","_this","replaceTimer","clearTimeout","length","_this2","find","filter","exports","noticeBubbleDefaultManager","_default"],"sources":["../../src/NoticeBubbleManager.js"],"sourcesContent":["import EventEmitter from '@semcore/utils/lib/eventEmitter';\nimport { callAllEventHandlers } from '@semcore/utils/lib/assignProps';\nimport { setFocus } from '@semcore/utils/lib/use/useFocusLock';\nimport React from 'react';\nimport rafTrottle from '@semcore/utils/lib/rafTrottle';\n\nconst EVENT_NAME = 'CHANGE';\n\nclass NoticeBubbleManager {\n items = [];\n emitter = null;\n counter = 0;\n\n replaceTimer = 0;\n\n constructor() {\n this.emitter = new EventEmitter();\n }\n\n addListener(fn) {\n return this.emitter.subscribe(EVENT_NAME, fn);\n }\n\n createItem(props) {\n const manager = this;\n\n return {\n type: 'info',\n ...props,\n onClose: callAllEventHandlers(props.onClose, () => {\n manager.remove(props.uid);\n }),\n };\n }\n\n emit() {\n this.emitter.emit(EVENT_NAME, this.items);\n }\n\n add(props) {\n const uid = this.counter++;\n const ref = React.createRef();\n const focus = () => setTimeout(() => setFocus(ref.current), 0);\n const item = this.createItem({\n uid,\n visible: props.initialAnimation ? true : undefined,\n forwardRef: ref,\n ...props,\n });\n this.items.push(item);\n this.emit();\n return {\n uid,\n update: this.update.bind(this, uid),\n remove: this.remove.bind(this, uid),\n ref,\n focus,\n };\n }\n\n update(uid, props) {\n const index = this.items.findIndex((item) => item.uid === uid);\n if (index !== -1) {\n this.items[index] = this.createItem({\n ...this.items[index],\n ...props,\n });\n this.emit();\n return true;\n }\n return false;\n }\n\n replaceLast(props) {\n if (this.replaceTimer) {\n clearTimeout(this.replaceTimer);\n }\n\n const item = this.items[this.items.length - 1];\n\n if (item?.visible) {\n this.remove(this.counter - 1);\n }\n\n this.replaceTimer = setTimeout(() => {\n this.add(props);\n }, 300);\n }\n\n remove(uid) {\n const item = this.items.find((item) => item.uid === uid);\n if (item) {\n item.visible = false;\n setTimeout(() => {\n this.items = this.items.filter((item) => item.uid !== uid);\n this.emit();\n }, 1000);\n this.emit();\n return true;\n }\n return false;\n }\n}\n\nconst noticeBubbleDefaultManager = new NoticeBubbleManager();\n\nexport { NoticeBubbleManager };\nexport default noticeBubbleDefaultManager;\n"],"mappings":";;;;;;;;;;;AAAA,IAAA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AAA;AAGH,IAAMkD,0BAA0B,GAAG,IAAIlD,mBAAmB,EAAE;AAAC,IAAAmD,QAAA,GAG9CD,0BAA0B;AAAAD,OAAA,cAAAE,QAAA"}
|
package/lib/cjs/index.d.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.js","names":[],"sources":["../../src/index.d.ts"],"sourcesContent":["import { PortalProps } from '@semcore/portal';\nimport { UnknownProperties, Intergalactic } from '@semcore/core';\nimport { BoxProps } from '@semcore/flex-box';\n\n/** @deprecated */\nexport interface INoticeBubbleContainerProps\n extends NoticeBubbleContainerProps,\n UnknownProperties {}\nexport type NoticeBubbleContainerProps = BoxProps &\n PortalProps & {\n /** Manager copy */\n manager?: NoticeBubbleManager;\n locale?: string;\n };\n\n/** @deprecated */\nexport interface INoticeBubbleProps extends NoticeBubbleProps, UnknownProperties {}\nexport type NoticeBubbleProps = BoxProps & {\n /**\n * Notice visibility.\n */\n visible?: boolean;\n /**\n * Control under the notice children.\n * */\n action?: React.ReactNode;\n /**\n * Callback triggered by \"Close\" icon click.\n * */\n onClose?: (e?: React.SyntheticEvent) => void;\n /**\n * Notice content.\n * */\n children?: React.ReactNode;\n manager?: NoticeBubbleManager;\n icon?: React.ReactElement;\n};\n/** @deprecated */\nexport interface INoticeBubbleInfoProps extends NoticeBubbleInfoProps, UnknownProperties {}\nexport type NoticeBubbleInfoProps = NoticeBubbleProps & {\n readonly type?: 'info';\n /**\n * Notice display duration. Set to 0 to disable auto-close.\n */\n duration?: number;\n /**\n * Enables animation on first rendering.\n * @default false\n */\n initialAnimation?: boolean;\n /**\n * Use it for complex notices with important controls.\n * If enabled, browser focus will be locked in the notice\n * until it's closed. After close focus should return to the element\n * where it was placed before notice appear.\n */\n focusLock?: boolean;\n};\n\n/** @deprecated */\nexport interface INoticeBubbleWarningProps extends NoticeBubbleWarningProps, UnknownProperties {}\nexport type NoticeBubbleWarningProps = NoticeBubbleProps & {\n readonly type?: 'warning';\n /**\n * Notice display duration.\n */\n duration?: number;\n /**\n * Enables animation on first rendering.\n * @default false\n */\n initialAnimation?: boolean;\n /**\n * Use it for complex notices with important controls.\n * If enabled, browser focus will be locked in the notice\n * until it's closed. After close focus should return to the element\n * where it was placed before notice appear.\n */\n focusLock?: boolean;\n};\n\n/** @deprecated */\nexport interface INoticeBubbleManager extends NoticeBubbleManagerClass, UnknownProperties {}\nexport type NoticeBubbleManagerClass = {\n /**\n * Creates and shows a notice.\n * */\n add: (props: NoticeBubbleInfoProps | NoticeBubbleWarningProps) => {\n uid: string;\n update: (props: Partial<NoticeBubbleInfoProps> | Partial<NoticeBubbleWarningProps>) => boolean;\n remove: () => boolean;\n ref: React.RefObject<HTMLDivElement>;\n focus: () => void;\n };\n /**\n * Updates notice by uid.\n * */\n update: (\n uid: string,\n props: Partial<NoticeBubbleInfoProps> | Partial<NoticeBubbleWarningProps>,\n ) => boolean;\n /**\n * Removes notice by uid.\n * */\n remove: (uid: string) => boolean;\n};\n\n/**\n * @deprecated use `NoticeBubbleManager` instead.\n * */\nexport declare const NoticeBubble: Intergalactic.Component<'div', NoticeBubbleInfoProps>;\n/**\n * @deprecated use `NoticeBubbleManager` instead.\n * */\nexport declare const NoticeBubbleWarning: Intergalactic.Component<'div', NoticeBubbleWarningProps>;\nexport declare const NoticeBubbleContainer: Intergalactic.Component<\n 'div',\n NoticeBubbleContainerProps\n> & {\n /**\n * @deprecated use `NoticeBubbleManager` instead.\n * */\n Info: typeof NoticeBubble;\n\n /**\n * @deprecated use `NoticeBubbleManager` instead.\n * */\n Warning: typeof NoticeBubbleWarning;\n};\nexport declare class NoticeBubbleManager implements NoticeBubbleManagerClass {\n /**\n * Creates and shows a notice.\n * */\n add(props: NoticeBubbleInfoProps | NoticeBubbleWarningProps): {\n uid: string;\n update: (props: Partial<NoticeBubbleInfoProps> | Partial<NoticeBubbleWarningProps>) => boolean;\n remove: () => boolean;\n ref: React.RefObject<HTMLDivElement>;\n focus: () => void;\n };\n /**\n * Updates notice by uid.\n * */\n update(\n uid: string,\n props: Partial<NoticeBubbleInfoProps> | Partial<NoticeBubbleWarningProps>,\n ): boolean;\n /**\n * Removes notice by uid.\n * */\n remove(uid: string): boolean;\n}\n\nexport declare const noticeBubbleDefaultManager: NoticeBubbleManager;\n\n/**\n * @deprecated Use `import { noticeBubbleDefaultManager } from ...` instead\n */\nexport default noticeBubbleDefaultManager;\n"],"mappings":""}
|
|
1
|
+
{"version":3,"file":"index.d.js","names":[],"sources":["../../src/index.d.ts"],"sourcesContent":["import { PortalProps } from '@semcore/portal';\nimport { UnknownProperties, Intergalactic } from '@semcore/core';\nimport { BoxProps } from '@semcore/flex-box';\n\n/** @deprecated */\nexport interface INoticeBubbleContainerProps\n extends NoticeBubbleContainerProps,\n UnknownProperties {}\nexport type NoticeBubbleContainerProps = BoxProps &\n PortalProps & {\n /** Manager copy */\n manager?: NoticeBubbleManager;\n locale?: string;\n };\n\n/** @deprecated */\nexport interface INoticeBubbleProps extends NoticeBubbleProps, UnknownProperties {}\nexport type NoticeBubbleProps = BoxProps & {\n /**\n * Notice visibility.\n */\n visible?: boolean;\n /**\n * Control under the notice children.\n * */\n action?: React.ReactNode;\n /**\n * Callback triggered by \"Close\" icon click.\n * */\n onClose?: (e?: React.SyntheticEvent) => void;\n /**\n * Notice content.\n * */\n children?: React.ReactNode;\n manager?: NoticeBubbleManager;\n icon?: React.ReactElement;\n};\n/** @deprecated */\nexport interface INoticeBubbleInfoProps extends NoticeBubbleInfoProps, UnknownProperties {}\nexport type NoticeBubbleInfoProps = NoticeBubbleProps & {\n readonly type?: 'info';\n /**\n * Notice display duration. Set to 0 to disable auto-close.\n */\n duration?: number;\n /**\n * Enables animation on first rendering.\n * @default false\n */\n initialAnimation?: boolean;\n /**\n * Use it for complex notices with important controls.\n * If enabled, browser focus will be locked in the notice\n * until it's closed. After close focus should return to the element\n * where it was placed before notice appear.\n */\n focusLock?: boolean;\n};\n\n/** @deprecated */\nexport interface INoticeBubbleWarningProps extends NoticeBubbleWarningProps, UnknownProperties {}\nexport type NoticeBubbleWarningProps = NoticeBubbleProps & {\n readonly type?: 'warning';\n /**\n * Notice display duration.\n */\n duration?: number;\n /**\n * Enables animation on first rendering.\n * @default false\n */\n initialAnimation?: boolean;\n /**\n * Use it for complex notices with important controls.\n * If enabled, browser focus will be locked in the notice\n * until it's closed. After close focus should return to the element\n * where it was placed before notice appear.\n */\n focusLock?: boolean;\n};\n\n/** @deprecated */\nexport interface INoticeBubbleManager extends NoticeBubbleManagerClass, UnknownProperties {}\nexport type NoticeBubbleManagerClass = {\n /**\n * Creates and shows a notice.\n * */\n add: (props: NoticeBubbleInfoProps | NoticeBubbleWarningProps) => {\n uid: string;\n update: (props: Partial<NoticeBubbleInfoProps> | Partial<NoticeBubbleWarningProps>) => boolean;\n remove: () => boolean;\n ref: React.RefObject<HTMLDivElement>;\n focus: () => void;\n };\n /**\n * Updates notice by uid.\n * */\n update: (\n uid: string,\n props: Partial<NoticeBubbleInfoProps> | Partial<NoticeBubbleWarningProps>,\n ) => boolean;\n /**\n * Removes notice by uid.\n * */\n remove: (uid: string) => boolean;\n /**\n * Replace last notice (if it is existing)\n */\n replaceLast: (props: NoticeBubbleInfoProps | NoticeBubbleWarningProps) => void;\n};\n\n/**\n * @deprecated use `NoticeBubbleManager` instead.\n * */\nexport declare const NoticeBubble: Intergalactic.Component<'div', NoticeBubbleInfoProps>;\n/**\n * @deprecated use `NoticeBubbleManager` instead.\n * */\nexport declare const NoticeBubbleWarning: Intergalactic.Component<'div', NoticeBubbleWarningProps>;\nexport declare const NoticeBubbleContainer: Intergalactic.Component<\n 'div',\n NoticeBubbleContainerProps\n> & {\n /**\n * @deprecated use `NoticeBubbleManager` instead.\n * */\n Info: typeof NoticeBubble;\n\n /**\n * @deprecated use `NoticeBubbleManager` instead.\n * */\n Warning: typeof NoticeBubbleWarning;\n};\nexport declare class NoticeBubbleManager implements NoticeBubbleManagerClass {\n /**\n * Creates and shows a notice.\n * */\n add(props: NoticeBubbleInfoProps | NoticeBubbleWarningProps): {\n uid: string;\n update: (props: Partial<NoticeBubbleInfoProps> | Partial<NoticeBubbleWarningProps>) => boolean;\n remove: () => boolean;\n ref: React.RefObject<HTMLDivElement>;\n focus: () => void;\n };\n /**\n * Updates notice by uid.\n * */\n update(\n uid: string,\n props: Partial<NoticeBubbleInfoProps> | Partial<NoticeBubbleWarningProps>,\n ): boolean;\n /**\n * Removes notice by uid.\n * */\n remove(uid: string): boolean;\n /**\n * Replace last notice (if it is existing)\n */\n replaceLast: (props: NoticeBubbleInfoProps | NoticeBubbleWarningProps) => void;\n}\n\nexport declare const noticeBubbleDefaultManager: NoticeBubbleManager;\n\n/**\n * @deprecated Use `import { noticeBubbleDefaultManager } from ...` instead\n */\nexport default noticeBubbleDefaultManager;\n"],"mappings":""}
|
|
@@ -43,7 +43,7 @@ SDismiss {
|
|
|
43
43
|
border: 0;
|
|
44
44
|
background: transparent;
|
|
45
45
|
}
|
|
46
|
-
SDismiss[use]
|
|
46
|
+
SDismiss[use] {
|
|
47
47
|
/* height: auto; */
|
|
48
48
|
padding: 0 1px;
|
|
49
49
|
}
|
|
@@ -104,4 +104,4 @@ SNoticeAriaLiveWrapper {
|
|
|
104
104
|
overflow: hidden;
|
|
105
105
|
opacity: 0;
|
|
106
106
|
}
|
|
107
|
-
}
|
|
107
|
+
}
|
package/lib/es6/NoticeBubble.js
CHANGED
|
@@ -31,21 +31,21 @@ import { useFocusLock } from '@semcore/utils/lib/use/useFocusLock';
|
|
|
31
31
|
import { Hint } from '@semcore/tooltip';
|
|
32
32
|
import { ZIndexStackingContextProvider, zIndexStackingEnhance } from '@semcore/utils/lib/zIndexStacking';
|
|
33
33
|
/*__reshadow-styles__:"./style/notice-bubble.shadow.css"*/
|
|
34
|
-
var style = ( /*__reshadow_css_start__*/_sstyled.insert( /*__inner_css_start__*/"@keyframes
|
|
35
|
-
"__SContent": "
|
|
36
|
-
"__SMessage": "
|
|
37
|
-
"__SDismiss": "
|
|
38
|
-
"_use": "
|
|
39
|
-
"__SIcon": "
|
|
40
|
-
"__SNoticeBubble": "
|
|
41
|
-
"_disablePortal": "
|
|
42
|
-
"__SNoticeAriaLiveWrapper": "
|
|
43
|
-
"@enter": "
|
|
44
|
-
"@exit": "
|
|
45
|
-
"__SBubble": "
|
|
46
|
-
"__SView": "
|
|
47
|
-
"_type_info": "
|
|
48
|
-
"_type_warning": "
|
|
34
|
+
var style = ( /*__reshadow_css_start__*/_sstyled.insert( /*__inner_css_start__*/"@keyframes enter_f2jt1{0%{transform:translate(100%,0);max-height:0;overflow:hidden}to{transform:translate(0,0);max-height:100vh;overflow:hidden}}@keyframes exit_f2jt1{0%{max-height:100vh;overflow:hidden;opacity:1}to{max-height:0;overflow:hidden;opacity:0}}.___SBubble_f2jt1_gg_,.___SView_f2jt1_gg_{position:relative;margin-bottom:var(--intergalactic-spacing-3x, 12px);padding:var(--intergalactic-spacing-3x, 12px);padding-right:calc(var(--intergalactic-spacing-8x, 32px) + var(--intergalactic-spacing-1x, 4px));width:100%;border-radius:var(--intergalactic-popper-rounded, 6px);overflow:hidden;box-sizing:border-box;color:var(--intergalactic-text-primary-invert, #ffffff);gap:var(--intergalactic-spacing-2x, 8px)}.___SBubble_f2jt1_gg_._type_info_f2jt1_gg_,.___SView_f2jt1_gg_._type_info_f2jt1_gg_{background:var(--intergalactic-bg-primary-invert, #191b23)}.___SBubble_f2jt1_gg_._type_warning_f2jt1_gg_,.___SView_f2jt1_gg_._type_warning_f2jt1_gg_{background:var(--intergalactic-bg-primary-critical, #ff4953)}.___SContent_f2jt1_gg_{flex-direction:column;gap:var(--intergalactic-spacing-2x, 8px);flex:1}.___SMessage_f2jt1_gg_{font-size:var(--intergalactic-fs-200, 14px);line-height:var(--intergalactic-lh-200, 142%)}.___SDismiss_f2jt1_gg_{cursor:pointer;position:absolute;right:0;top:0;margin-top:var(--intergalactic-spacing-2x, 8px);margin-right:var(--intergalactic-spacing-2x, 8px);margin-bottom:var(--intergalactic-spacing-2x, 8px);flex-shrink:0;border:0;background:0 0}.___SDismiss_f2jt1_gg_.__use_f2jt1_gg_{padding:0 1px}.___SIcon_f2jt1_gg_{justify-content:center;align-items:center;height:var(--intergalactic-spacing-5x, 20px)}.___SNoticeBubble_f2jt1_gg_{width:300px;position:fixed;right:var(--intergalactic-spacing-3x, 12px);top:var(--intergalactic-spacing-3x, 12px)}@media (max-width:767px){.___SNoticeBubble_f2jt1_gg_{width:calc(100% - var(--intergalactic-spacing-6x, 24px))}}.___SNoticeBubble_f2jt1_gg_.__disablePortal_f2jt1_gg_{position:sticky;margin-left:auto;height:0}.___SMessage_f2jt1_gg_ a{color:var(--intergalactic-text-link-invert, #8ecdff)}.___SNoticeAriaLiveWrapper_f2jt1_gg_{display:content}" /*__inner_css_end__*/, "f2jt1_gg_") /*__reshadow_css_end__*/, {
|
|
35
|
+
"__SContent": "___SContent_f2jt1_gg_",
|
|
36
|
+
"__SMessage": "___SMessage_f2jt1_gg_",
|
|
37
|
+
"__SDismiss": "___SDismiss_f2jt1_gg_",
|
|
38
|
+
"_use": "__use_f2jt1_gg_",
|
|
39
|
+
"__SIcon": "___SIcon_f2jt1_gg_",
|
|
40
|
+
"__SNoticeBubble": "___SNoticeBubble_f2jt1_gg_",
|
|
41
|
+
"_disablePortal": "__disablePortal_f2jt1_gg_",
|
|
42
|
+
"__SNoticeAriaLiveWrapper": "___SNoticeAriaLiveWrapper_f2jt1_gg_",
|
|
43
|
+
"@enter": "enter_f2jt1",
|
|
44
|
+
"@exit": "exit_f2jt1",
|
|
45
|
+
"__SBubble": "___SBubble_f2jt1_gg_",
|
|
46
|
+
"__SView": "___SView_f2jt1_gg_",
|
|
47
|
+
"_type_info": "_type_info_f2jt1_gg_",
|
|
48
|
+
"_type_warning": "_type_warning_f2jt1_gg_"
|
|
49
49
|
});
|
|
50
50
|
import { forkRef, useForkRef } from '@semcore/utils/lib/ref';
|
|
51
51
|
var Notices = function Notices(props) {
|
|
@@ -111,9 +111,7 @@ var NoticeBubbleContainerRoot = /*#__PURE__*/function (_Component) {
|
|
|
111
111
|
_createClass(NoticeBubbleContainerRoot, [{
|
|
112
112
|
key: "componentDidMount",
|
|
113
113
|
value: function componentDidMount() {
|
|
114
|
-
|
|
115
|
-
manager.counter = 0;
|
|
116
|
-
this._unsubscribe = manager.addListener(this.handleChange);
|
|
114
|
+
this._unsubscribe = this.asProps.manager.addListener(this.handleChange);
|
|
117
115
|
}
|
|
118
116
|
}, {
|
|
119
117
|
key: "render",
|
|
@@ -261,9 +259,7 @@ var ViewInfo = /*#__PURE__*/function (_Component2) {
|
|
|
261
259
|
"onMouseEnter": callAllEventHandlers(onMouseEnter, this.handleMouseEnter),
|
|
262
260
|
"onMouseLeave": callAllEventHandlers(onMouseLeave, this.handleMouseLeave),
|
|
263
261
|
"role": type === 'warning' ? 'alert' : this.props.role
|
|
264
|
-
})), /*#__PURE__*/React.createElement(
|
|
265
|
-
"title": getI18nText('close')
|
|
266
|
-
}), /*#__PURE__*/React.createElement(SDismiss
|
|
262
|
+
})), /*#__PURE__*/React.createElement(SDismiss
|
|
267
263
|
// biome-ignore lint/a11y/useValidAriaValues:
|
|
268
264
|
, _ref4.cn("SDismiss", {
|
|
269
265
|
"aria-haspopup": undefined,
|
|
@@ -274,11 +270,12 @@ var ViewInfo = /*#__PURE__*/function (_Component2) {
|
|
|
274
270
|
"theme": 'invert',
|
|
275
271
|
"onClick": this.handleClose,
|
|
276
272
|
"aria-label": getI18nText('close'),
|
|
277
|
-
"active": false
|
|
273
|
+
"active": false,
|
|
274
|
+
"title": getI18nText('close')
|
|
278
275
|
}), /*#__PURE__*/React.createElement(Button.Addon, {
|
|
279
276
|
tag: CloseIcon,
|
|
280
277
|
color: "icon-primary-invert"
|
|
281
|
-
})),
|
|
278
|
+
})), isNode(icon) ? /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(SIcon, _ref4.cn("SIcon", {}), icon), /*#__PURE__*/React.createElement(SContent, _ref4.cn("SContent", {}), /*#__PURE__*/React.createElement(SMessage, _ref4.cn("SMessage", {}), children), isNode(actionNode) ? /*#__PURE__*/React.createElement(SAction, _ref4.cn("SAction", {}), actionNode) : null)) : /*#__PURE__*/React.createElement(SContent, _ref4.cn("SContent", {}), /*#__PURE__*/React.createElement(SMessage, _ref4.cn("SMessage", {}), children), isNode(actionNode) ? /*#__PURE__*/React.createElement(SAction, _ref4.cn("SAction", {}), actionNode) : null));
|
|
282
279
|
}
|
|
283
280
|
}]);
|
|
284
281
|
return ViewInfo;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NoticeBubble.js","names":["React","Portal","manager","createComponent","Component","sstyled","Root","Animation","Flex","Box","fire","isNode","callAllEventHandlers","CloseIcon","Timer","localizedMessages","i18nEnhance","useCssVariable","contextThemeEnhance","Button","useFocusLock","Hint","ZIndexStackingContextProvider","zIndexStackingEnhance","style","_sstyled","insert","forkRef","useForkRef","Notices","props","styles","_props$data","data","_props$tag","tag","SView","ViewInfo","ref","useRef","durationStr","duration","useMemo","parseInt","map","notice","_ref2","_notice$visible","createElement","cn","uid","initialAnimation","visible","_objectSpread","getI18nText","NoticeBubbleContainerRoot","_Component","_inherits","_super","_createSuper","_this","_classCallCheck","_len","arguments","length","args","Array","_key","call","apply","concat","_defineProperty","_assertThisInitialized","notices","warnings","_unsubscribe","info","filter","type","warning","setState","_createClass","key","value","componentDidMount","asProps","counter","addListener","handleChange","render","_ref","_ref3","SNoticeBubble","SNoticeAriaLiveWrapper","_this$asProps","Children","disablePortal","parentZIndexStacking","_this$state","state","_assignProps","ViewWarning","i18n","locale","FocusLock","forwardRef","outerRef","focusLock","other","_objectWithoutProperties","_excluded","innerRef","_extends","_Component2","_super2","_this2","_len2","_key2","createRef","e","clearTimer","timer","pause","resume","event","_this2$timer","paused","rect","current","getBoundingClientRect","mouseInRect","clientX","left","right","clientY","top","bottom","handleClose","document","body","addEventListener","handleBodyMouseMove","componentWillUnmount","removeEventListener","clear","_ref4","SBubble","SDismiss","Trigger","SContent","SMessage","SAction","SIcon","_this$props","onMouseEnter","onMouseLeave","icon","children","actionNode","action","_excluded2","handleMouseEnter","handleMouseLeave","role","undefined","Addon","color","Popper","Fragment","_ViewInfo","_super3","NoticeBubbleView","_Component3","_super4","_this3","_len3","_key3","_notice","add","remove","componentDidUpdate","update","NoticeBubbleWarningView","_NoticeBubbleView","_super5","NoticeBubbleContainer","Info","Warning","NoticeBubble","NoticeBubbleWarning"],"sources":["../../src/NoticeBubble.jsx"],"sourcesContent":["import React from 'react';\nimport Portal from '@semcore/portal';\nimport manager from './NoticeBubbleManager';\nimport createComponent, { Component, sstyled, Root } from '@semcore/core';\nimport { Animation } from '@semcore/animation';\nimport { Flex, Box } from '@semcore/flex-box';\nimport fire from '@semcore/utils/lib/fire';\nimport isNode from '@semcore/utils/lib/isNode';\nimport { callAllEventHandlers } from '@semcore/utils/lib/assignProps';\nimport CloseIcon from '@semcore/icon/Close/m';\nimport { Timer } from './utils';\nimport { localizedMessages } from './translations/__intergalactic-dynamic-locales';\nimport i18nEnhance from '@semcore/utils/lib/enhances/i18nEnhance';\nimport { useCssVariable } from '@semcore/utils/lib/useCssVariable';\nimport { contextThemeEnhance } from '@semcore/utils/lib/ThemeProvider';\nimport Button from '@semcore/button';\nimport { useFocusLock } from '@semcore/utils/lib/use/useFocusLock';\nimport { Hint } from '@semcore/tooltip';\nimport {\n ZIndexStackingContextProvider,\n zIndexStackingEnhance,\n} from '@semcore/utils/lib/zIndexStacking';\n\nimport style from './style/notice-bubble.shadow.css';\nimport { forkRef, useForkRef } from '@semcore/utils/lib/ref';\n\nconst Notices = (props) => {\n const { styles, data = [], tag: SView = ViewInfo } = props;\n const ref = React.useRef();\n const durationStr = useCssVariable('--intergalactic-duration-popper', '200', ref);\n const duration = React.useMemo(() => parseInt(durationStr, 10), [durationStr]);\n\n return data.map((notice) => {\n return sstyled(styles)(\n <Animation\n key={notice.uid}\n initialAnimation={notice.initialAnimation}\n visible={notice.visible ?? true}\n duration={duration}\n keyframes={[styles['@enter'], styles['@exit']]}\n ref={ref}\n >\n <SView {...notice} styles={notice.styles || styles} getI18nText={props.getI18nText} />\n </Animation>,\n );\n });\n};\n\nclass NoticeBubbleContainerRoot extends Component {\n static displayName = 'NoticeBubbleContainer';\n static style = style;\n static enhance = [\n i18nEnhance(localizedMessages),\n contextThemeEnhance(),\n zIndexStackingEnhance('z-index-notice-bubble'),\n ];\n static defaultProps = {\n manager,\n i18n: localizedMessages,\n locale: 'en',\n };\n\n _unsubscribe = null;\n\n state = {\n notices: [],\n warnings: [],\n };\n\n componentDidMount() {\n const { manager } = this.asProps;\n manager.counter = 0;\n this._unsubscribe = manager.addListener(this.handleChange);\n }\n\n componentWillUnmount = () => {\n if (this._unsubscribe) {\n this._unsubscribe();\n }\n };\n\n handleChange = (notices) => {\n const info = notices.filter((notice) => notice.type === 'info');\n const warning = notices.filter((notice) => notice.type === 'warning');\n\n this.setState({ notices: info, warnings: warning });\n };\n\n render() {\n const SNoticeBubble = Root;\n const SNoticeAriaLiveWrapper = 'div';\n const { Children, styles, disablePortal, getI18nText, ref, parentZIndexStacking } =\n this.asProps;\n const { notices, warnings } = this.state;\n\n return sstyled(styles)(\n <ZIndexStackingContextProvider designToken='z-index-notice-bubble'>\n <Portal disablePortal={disablePortal}>\n <SNoticeBubble\n render={Box}\n ref={ref}\n tag='section'\n role='region'\n aria-label={getI18nText('notification')}\n zIndex={parentZIndexStacking}\n >\n <Children />\n <Notices styles={styles} data={warnings} tag={ViewWarning} getI18nText={getI18nText} />\n <SNoticeAriaLiveWrapper aria-live='polite'>\n <Notices styles={styles} data={notices} tag={ViewInfo} getI18nText={getI18nText} />\n </SNoticeAriaLiveWrapper>\n </SNoticeBubble>\n </Portal>\n </ZIndexStackingContextProvider>,\n );\n }\n}\n\nconst FocusLock = React.forwardRef((props, outerRef) => {\n const { focusLock, ...other } = props;\n const innerRef = React.useRef();\n useFocusLock(innerRef, false, 'auto', !focusLock, true);\n const ref = useForkRef(outerRef, innerRef);\n\n return <Flex ref={ref} {...other} />;\n});\n\nclass ViewInfo extends Component {\n timer = null;\n ref = React.createRef();\n\n componentDidMount() {\n const { duration } = this.props;\n if (duration) {\n this.timer = new Timer(this.handleClose, duration);\n document.body.addEventListener('mousemove', this.handleBodyMouseMove);\n }\n }\n\n componentWillUnmount() {\n this.clearTimer();\n document.body.removeEventListener('mousemove', this.handleBodyMouseMove);\n }\n\n clearTimer() {\n if (this.timer) {\n this.timer.clear();\n this.timer = null;\n }\n }\n\n handleClose = (e) => {\n // because it might be called not only from the close icon click\n fire(this, 'onClose', e);\n this.clearTimer();\n };\n\n handleMouseEnter = () => {\n if (!this.timer) return;\n this.timer.pause();\n };\n\n handleMouseLeave = () => {\n if (!this.timer) return;\n this.timer.resume();\n };\n\n handleBodyMouseMove = (event) => {\n if (!this.timer?.paused) return;\n const rect = this.ref.current.getBoundingClientRect();\n const mouseInRect =\n event.clientX >= rect.left &&\n event.clientX <= rect.right &&\n event.clientY >= rect.top &&\n event.clientY <= rect.bottom;\n if (mouseInRect) return;\n this.timer.resume();\n };\n\n render() {\n const SBubble = FocusLock;\n const SDismiss = Hint.Trigger;\n const SContent = Flex;\n const SMessage = 'div';\n const SAction = 'div';\n const SIcon = Flex;\n const {\n forwardRef,\n styles,\n onMouseEnter,\n onMouseLeave,\n getI18nText,\n icon,\n children,\n action: actionNode,\n type,\n ...other\n } = this.props;\n\n return sstyled(styles)(\n <SBubble\n {...other}\n ref={forkRef(forwardRef, this.ref)}\n onMouseEnter={callAllEventHandlers(onMouseEnter, this.handleMouseEnter)}\n onMouseLeave={callAllEventHandlers(onMouseLeave, this.handleMouseLeave)}\n role={type === 'warning' ? 'alert' : this.props.role}\n >\n <Hint title={getI18nText('close')}>\n <SDismiss\n // biome-ignore lint/a11y/useValidAriaValues:\n aria-haspopup={undefined}\n tag={Button}\n type='button'\n use='tertiary'\n size='m'\n theme='invert'\n onClick={this.handleClose}\n aria-label={getI18nText('close')}\n active={false}\n >\n <Button.Addon tag={CloseIcon} color='icon-primary-invert' />\n </SDismiss>\n <Hint.Popper />\n </Hint>\n\n {isNode(icon) ? (\n <>\n <SIcon>{icon}</SIcon>\n <SContent>\n <SMessage>{children}</SMessage>\n {isNode(actionNode) ? <SAction>{actionNode}</SAction> : null}\n </SContent>\n </>\n ) : (\n <SContent>\n <SMessage>{children}</SMessage>\n {isNode(actionNode) ? <SAction>{actionNode}</SAction> : null}\n </SContent>\n )}\n </SBubble>,\n );\n }\n}\n\nclass ViewWarning extends ViewInfo {\n static defaultProps = {\n type: 'warning',\n duration: 0,\n };\n}\n\nclass NoticeBubbleView extends Component {\n static defaultProps = {\n duration: 5000,\n type: 'info',\n manager,\n };\n\n _notice = null;\n\n componentDidMount() {\n this._notice = this.asProps.manager.add(this.asProps);\n }\n\n componentWillUnmount() {\n if (this._notice) {\n this._notice.remove();\n }\n }\n\n componentDidUpdate() {\n if (this._notice) {\n this._notice.update(this.asProps);\n }\n }\n\n render() {\n return null;\n }\n}\n\nclass NoticeBubbleWarningView extends NoticeBubbleView {\n static defaultProps = {\n duration: 5000,\n type: 'warning',\n manager,\n };\n}\n\nconst NoticeBubbleContainer = createComponent(NoticeBubbleContainerRoot, {\n Info: NoticeBubbleView,\n Warning: NoticeBubbleWarningView,\n});\n\nconst NoticeBubble = NoticeBubbleContainer.Info;\nconst NoticeBubbleWarning = NoticeBubbleContainer.Warning;\n\nexport { NoticeBubble, NoticeBubbleWarning };\n\nexport default NoticeBubbleContainer;\n"],"mappings":";;;;;;;;;;;;;AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,OAAOC,MAAM,MAAM,iBAAiB;AACpC,OAAOC,OAAO,MAAM,uBAAuB;AAC3C,OAAOC,eAAe,IAAIC,SAAS,EAAEC,OAAO,EAAEC,IAAI,QAAQ,eAAe;AACzE,SAASC,SAAS,QAAQ,oBAAoB;AAC9C,SAASC,IAAI,EAAEC,GAAG,QAAQ,mBAAmB;AAC7C,OAAOC,IAAI,MAAM,yBAAyB;AAC1C,O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AAmB;AAE1C,eAAeJ,qBAAqB"}
|
|
1
|
+
{"version":3,"file":"NoticeBubble.js","names":["React","Portal","manager","createComponent","Component","sstyled","Root","Animation","Flex","Box","fire","isNode","callAllEventHandlers","CloseIcon","Timer","localizedMessages","i18nEnhance","useCssVariable","contextThemeEnhance","Button","useFocusLock","Hint","ZIndexStackingContextProvider","zIndexStackingEnhance","style","_sstyled","insert","forkRef","useForkRef","Notices","props","styles","_props$data","data","_props$tag","tag","SView","ViewInfo","ref","useRef","durationStr","duration","useMemo","parseInt","map","notice","_ref2","_notice$visible","createElement","cn","uid","initialAnimation","visible","_objectSpread","getI18nText","NoticeBubbleContainerRoot","_Component","_inherits","_super","_createSuper","_this","_classCallCheck","_len","arguments","length","args","Array","_key","call","apply","concat","_defineProperty","_assertThisInitialized","notices","warnings","_unsubscribe","info","filter","type","warning","setState","_createClass","key","value","componentDidMount","asProps","addListener","handleChange","render","_ref","_ref3","SNoticeBubble","SNoticeAriaLiveWrapper","_this$asProps","Children","disablePortal","parentZIndexStacking","_this$state","state","_assignProps","ViewWarning","i18n","locale","FocusLock","forwardRef","outerRef","focusLock","other","_objectWithoutProperties","_excluded","innerRef","_extends","_Component2","_super2","_this2","_len2","_key2","createRef","e","clearTimer","timer","pause","resume","event","_this2$timer","paused","rect","current","getBoundingClientRect","mouseInRect","clientX","left","right","clientY","top","bottom","handleClose","document","body","addEventListener","handleBodyMouseMove","componentWillUnmount","removeEventListener","clear","_ref4","SBubble","SDismiss","Trigger","SContent","SMessage","SAction","SIcon","_this$props","onMouseEnter","onMouseLeave","icon","children","actionNode","action","_excluded2","handleMouseEnter","handleMouseLeave","role","undefined","Addon","color","Fragment","_ViewInfo","_super3","NoticeBubbleView","_Component3","_super4","_this3","_len3","_key3","_notice","add","remove","componentDidUpdate","update","NoticeBubbleWarningView","_NoticeBubbleView","_super5","NoticeBubbleContainer","Info","Warning","NoticeBubble","NoticeBubbleWarning"],"sources":["../../src/NoticeBubble.jsx"],"sourcesContent":["import React from 'react';\nimport Portal from '@semcore/portal';\nimport manager from './NoticeBubbleManager';\nimport createComponent, { Component, sstyled, Root } from '@semcore/core';\nimport { Animation } from '@semcore/animation';\nimport { Flex, Box } from '@semcore/flex-box';\nimport fire from '@semcore/utils/lib/fire';\nimport isNode from '@semcore/utils/lib/isNode';\nimport { callAllEventHandlers } from '@semcore/utils/lib/assignProps';\nimport CloseIcon from '@semcore/icon/Close/m';\nimport { Timer } from './utils';\nimport { localizedMessages } from './translations/__intergalactic-dynamic-locales';\nimport i18nEnhance from '@semcore/utils/lib/enhances/i18nEnhance';\nimport { useCssVariable } from '@semcore/utils/lib/useCssVariable';\nimport { contextThemeEnhance } from '@semcore/utils/lib/ThemeProvider';\nimport Button from '@semcore/button';\nimport { useFocusLock } from '@semcore/utils/lib/use/useFocusLock';\nimport { Hint } from '@semcore/tooltip';\nimport {\n ZIndexStackingContextProvider,\n zIndexStackingEnhance,\n} from '@semcore/utils/lib/zIndexStacking';\n\nimport style from './style/notice-bubble.shadow.css';\nimport { forkRef, useForkRef } from '@semcore/utils/lib/ref';\n\nconst Notices = (props) => {\n const { styles, data = [], tag: SView = ViewInfo } = props;\n const ref = React.useRef();\n const durationStr = useCssVariable('--intergalactic-duration-popper', '200', ref);\n const duration = React.useMemo(() => parseInt(durationStr, 10), [durationStr]);\n\n return data.map((notice) => {\n return sstyled(styles)(\n <Animation\n key={notice.uid}\n initialAnimation={notice.initialAnimation}\n visible={notice.visible ?? true}\n duration={duration}\n keyframes={[styles['@enter'], styles['@exit']]}\n ref={ref}\n >\n <SView {...notice} styles={notice.styles || styles} getI18nText={props.getI18nText} />\n </Animation>,\n );\n });\n};\n\nclass NoticeBubbleContainerRoot extends Component {\n static displayName = 'NoticeBubbleContainer';\n static style = style;\n static enhance = [\n i18nEnhance(localizedMessages),\n contextThemeEnhance(),\n zIndexStackingEnhance('z-index-notice-bubble'),\n ];\n static defaultProps = {\n manager,\n i18n: localizedMessages,\n locale: 'en',\n };\n\n _unsubscribe = null;\n\n state = {\n notices: [],\n warnings: [],\n };\n\n componentDidMount() {\n this._unsubscribe = this.asProps.manager.addListener(this.handleChange);\n }\n\n componentWillUnmount = () => {\n if (this._unsubscribe) {\n this._unsubscribe();\n }\n };\n\n handleChange = (notices) => {\n const info = notices.filter((notice) => notice.type === 'info');\n const warning = notices.filter((notice) => notice.type === 'warning');\n\n this.setState({ notices: info, warnings: warning });\n };\n\n render() {\n const SNoticeBubble = Root;\n const SNoticeAriaLiveWrapper = 'div';\n const { Children, styles, disablePortal, getI18nText, ref, parentZIndexStacking } =\n this.asProps;\n const { notices, warnings } = this.state;\n\n return sstyled(styles)(\n <ZIndexStackingContextProvider designToken='z-index-notice-bubble'>\n <Portal disablePortal={disablePortal}>\n <SNoticeBubble\n render={Box}\n ref={ref}\n tag='section'\n role='region'\n aria-label={getI18nText('notification')}\n zIndex={parentZIndexStacking}\n >\n <Children />\n <Notices styles={styles} data={warnings} tag={ViewWarning} getI18nText={getI18nText} />\n <SNoticeAriaLiveWrapper aria-live='polite'>\n <Notices styles={styles} data={notices} tag={ViewInfo} getI18nText={getI18nText} />\n </SNoticeAriaLiveWrapper>\n </SNoticeBubble>\n </Portal>\n </ZIndexStackingContextProvider>,\n );\n }\n}\n\nconst FocusLock = React.forwardRef((props, outerRef) => {\n const { focusLock, ...other } = props;\n const innerRef = React.useRef();\n useFocusLock(innerRef, false, 'auto', !focusLock, true);\n const ref = useForkRef(outerRef, innerRef);\n\n return <Flex ref={ref} {...other} />;\n});\n\nclass ViewInfo extends Component {\n timer = null;\n ref = React.createRef();\n\n componentDidMount() {\n const { duration } = this.props;\n if (duration) {\n this.timer = new Timer(this.handleClose, duration);\n document.body.addEventListener('mousemove', this.handleBodyMouseMove);\n }\n }\n\n componentWillUnmount() {\n this.clearTimer();\n document.body.removeEventListener('mousemove', this.handleBodyMouseMove);\n }\n\n clearTimer() {\n if (this.timer) {\n this.timer.clear();\n this.timer = null;\n }\n }\n\n handleClose = (e) => {\n // because it might be called not only from the close icon click\n fire(this, 'onClose', e);\n this.clearTimer();\n };\n\n handleMouseEnter = () => {\n if (!this.timer) return;\n this.timer.pause();\n };\n\n handleMouseLeave = () => {\n if (!this.timer) return;\n this.timer.resume();\n };\n\n handleBodyMouseMove = (event) => {\n if (!this.timer?.paused) return;\n const rect = this.ref.current.getBoundingClientRect();\n const mouseInRect =\n event.clientX >= rect.left &&\n event.clientX <= rect.right &&\n event.clientY >= rect.top &&\n event.clientY <= rect.bottom;\n if (mouseInRect) return;\n this.timer.resume();\n };\n\n render() {\n const SBubble = FocusLock;\n const SDismiss = Hint.Trigger;\n const SContent = Flex;\n const SMessage = 'div';\n const SAction = 'div';\n const SIcon = Flex;\n const {\n forwardRef,\n styles,\n onMouseEnter,\n onMouseLeave,\n getI18nText,\n icon,\n children,\n action: actionNode,\n type,\n ...other\n } = this.props;\n\n return sstyled(styles)(\n <SBubble\n {...other}\n ref={forkRef(forwardRef, this.ref)}\n onMouseEnter={callAllEventHandlers(onMouseEnter, this.handleMouseEnter)}\n onMouseLeave={callAllEventHandlers(onMouseLeave, this.handleMouseLeave)}\n role={type === 'warning' ? 'alert' : this.props.role}\n >\n <SDismiss\n // biome-ignore lint/a11y/useValidAriaValues:\n aria-haspopup={undefined}\n tag={Button}\n type='button'\n use='tertiary'\n size='m'\n theme='invert'\n onClick={this.handleClose}\n aria-label={getI18nText('close')}\n active={false}\n title={getI18nText('close')}\n >\n <Button.Addon tag={CloseIcon} color='icon-primary-invert' />\n </SDismiss>\n\n {isNode(icon) ? (\n <>\n <SIcon>{icon}</SIcon>\n <SContent>\n <SMessage>{children}</SMessage>\n {isNode(actionNode) ? <SAction>{actionNode}</SAction> : null}\n </SContent>\n </>\n ) : (\n <SContent>\n <SMessage>{children}</SMessage>\n {isNode(actionNode) ? <SAction>{actionNode}</SAction> : null}\n </SContent>\n )}\n </SBubble>,\n );\n }\n}\n\nclass ViewWarning extends ViewInfo {\n static defaultProps = {\n type: 'warning',\n duration: 0,\n };\n}\n\nclass NoticeBubbleView extends Component {\n static defaultProps = {\n duration: 5000,\n type: 'info',\n manager,\n };\n\n _notice = null;\n\n componentDidMount() {\n this._notice = this.asProps.manager.add(this.asProps);\n }\n\n componentWillUnmount() {\n if (this._notice) {\n this._notice.remove();\n }\n }\n\n componentDidUpdate() {\n if (this._notice) {\n this._notice.update(this.asProps);\n }\n }\n\n render() {\n return null;\n }\n}\n\nclass NoticeBubbleWarningView extends NoticeBubbleView {\n static defaultProps = {\n duration: 5000,\n type: 'warning',\n manager,\n };\n}\n\nconst NoticeBubbleContainer = createComponent(NoticeBubbleContainerRoot, {\n Info: NoticeBubbleView,\n Warning: NoticeBubbleWarningView,\n});\n\nconst NoticeBubble = NoticeBubbleContainer.Info;\nconst NoticeBubbleWarning = NoticeBubbleContainer.Warning;\n\nexport { NoticeBubble, NoticeBubbleWarning };\n\nexport default NoticeBubbleContainer;\n"],"mappings":";;;;;;;;;;;;;AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,OAAOC,MAAM,MAAM,iBAAiB;AACpC,OAAOC,OAAO,MAAM,uBAAuB;AAC3C,OAAOC,eAAe,IAAIC,SAAS,EAAEC,OAAO,EAAEC,IAAI,QAAQ,eAAe;AACzE,SAASC,SAAS,QAAQ,oBAAoB;AAC9C,SAASC,IAAI,EAAEC,GAAG,QAAQ,mBAAmB;AAC7C,OAAOC,IAAI,MAAM,yBAAyB;AAC1C,OAAOC,MAAM,MAAM,2BAA2B;AAC9C,SAASC,oBAAoB,QAAQ,gCAAgC;AACrE,OAAOC,SAAS,MAAM,uBAAuB;AAC7C,SAASC,KAAK,QAAQ,SAAS;AAC/B,SAASC,iBAAiB,QAAQ,gDAAgD;AAClF,OAAOC,WAAW,MAAM,yCAAyC;AACjE,SAASC,cAAc,QAAQ,mCAAmC;AAClE,SAASC,mBAAmB,QAAQ,kCAAkC;AACtE,OAAOC,MAAM,MAAM,iBAAiB;AACpC,SAASC,YAAY,QAAQ,qCAAqC;AAClE,SAASC,IAAI,QAAQ,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AuB,0BAAAC,iBAAA;EAAA5H,SAAA,CAAA2H,uBAAA,EAAAC,iBAAA;EAAA,IAAAC,OAAA,GAAA3H,YAAA,CAAAyH,uBAAA;EAAA,SAAAA,wBAAA;IAAAvH,eAAA,OAAAuH,uBAAA;IAAA,OAAAE,OAAA,CAAAjH,KAAA,OAAAN,SAAA;EAAA;EAAA,OAAAkB,YAAA,CAAAmG,uBAAA;AAAA,EAASX,gBAAgB;AAAAlG,eAAA,CAAhD6G,uBAAuB,kBACL;EACpB3I,QAAQ,EAAE,IAAI;EACdqC,IAAI,EAAE,SAAS;EACf5E,OAAO,EAAPA;AACF,CAAC;AAGH,IAAMqL,qBAAqB,GAAGpL,eAAe,CAACoD,yBAAyB,EAAE;EACvEiI,IAAI,EAAEf,gBAAgB;EACtBgB,OAAO,EAAEL;AACX,CAAC,CAAC;AAEF,IAAMM,YAAY,GAAGH,qBAAqB,CAACC,IAAI;AAC/C,IAAMG,mBAAmB,GAAGJ,qBAAqB,CAACE,OAAO;AAEzD,SAASC,YAAY,EAAEC,mBAAmB;AAE1C,eAAeJ,qBAAqB"}
|
|
@@ -6,6 +6,7 @@ import EventEmitter from '@semcore/utils/lib/eventEmitter';
|
|
|
6
6
|
import { callAllEventHandlers } from '@semcore/utils/lib/assignProps';
|
|
7
7
|
import { setFocus } from '@semcore/utils/lib/use/useFocusLock';
|
|
8
8
|
import React from 'react';
|
|
9
|
+
import rafTrottle from '@semcore/utils/lib/rafTrottle';
|
|
9
10
|
var EVENT_NAME = 'CHANGE';
|
|
10
11
|
var NoticeBubbleManager = /*#__PURE__*/function () {
|
|
11
12
|
function NoticeBubbleManager() {
|
|
@@ -13,6 +14,7 @@ var NoticeBubbleManager = /*#__PURE__*/function () {
|
|
|
13
14
|
_defineProperty(this, "items", []);
|
|
14
15
|
_defineProperty(this, "emitter", null);
|
|
15
16
|
_defineProperty(this, "counter", 0);
|
|
17
|
+
_defineProperty(this, "replaceTimer", 0);
|
|
16
18
|
this.emitter = new EventEmitter();
|
|
17
19
|
}
|
|
18
20
|
_createClass(NoticeBubbleManager, [{
|
|
@@ -75,23 +77,35 @@ var NoticeBubbleManager = /*#__PURE__*/function () {
|
|
|
75
77
|
}
|
|
76
78
|
return false;
|
|
77
79
|
}
|
|
80
|
+
}, {
|
|
81
|
+
key: "replaceLast",
|
|
82
|
+
value: function replaceLast(props) {
|
|
83
|
+
var _this = this;
|
|
84
|
+
if (this.replaceTimer) {
|
|
85
|
+
clearTimeout(this.replaceTimer);
|
|
86
|
+
}
|
|
87
|
+
var item = this.items[this.items.length - 1];
|
|
88
|
+
if (item !== null && item !== void 0 && item.visible) {
|
|
89
|
+
this.remove(this.counter - 1);
|
|
90
|
+
}
|
|
91
|
+
this.replaceTimer = setTimeout(function () {
|
|
92
|
+
_this.add(props);
|
|
93
|
+
}, 300);
|
|
94
|
+
}
|
|
78
95
|
}, {
|
|
79
96
|
key: "remove",
|
|
80
97
|
value: function remove(uid) {
|
|
81
|
-
var
|
|
82
|
-
var
|
|
98
|
+
var _this2 = this;
|
|
99
|
+
var item = this.items.find(function (item) {
|
|
83
100
|
return item.uid === uid;
|
|
84
101
|
});
|
|
85
|
-
if (
|
|
86
|
-
|
|
102
|
+
if (item) {
|
|
103
|
+
item.visible = false;
|
|
87
104
|
setTimeout(function () {
|
|
88
|
-
|
|
89
|
-
return item.uid
|
|
105
|
+
_this2.items = _this2.items.filter(function (item) {
|
|
106
|
+
return item.uid !== uid;
|
|
90
107
|
});
|
|
91
|
-
|
|
92
|
-
_this.items.splice(index, 1);
|
|
93
|
-
_this.emit();
|
|
94
|
-
}
|
|
108
|
+
_this2.emit();
|
|
95
109
|
}, 1000);
|
|
96
110
|
this.emit();
|
|
97
111
|
return true;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NoticeBubbleManager.js","names":["EventEmitter","callAllEventHandlers","setFocus","React","EVENT_NAME","NoticeBubbleManager","_classCallCheck","_defineProperty","emitter","_createClass","key","value","addListener","fn","subscribe","createItem","props","manager","_objectSpread","type","onClose","remove","uid","emit","items","add","counter","ref","createRef","focus","setTimeout","current","item","visible","initialAnimation","undefined","forwardRef","push","update","bind","index","findIndex","_this","
|
|
1
|
+
{"version":3,"file":"NoticeBubbleManager.js","names":["EventEmitter","callAllEventHandlers","setFocus","React","rafTrottle","EVENT_NAME","NoticeBubbleManager","_classCallCheck","_defineProperty","emitter","_createClass","key","value","addListener","fn","subscribe","createItem","props","manager","_objectSpread","type","onClose","remove","uid","emit","items","add","counter","ref","createRef","focus","setTimeout","current","item","visible","initialAnimation","undefined","forwardRef","push","update","bind","index","findIndex","replaceLast","_this","replaceTimer","clearTimeout","length","_this2","find","filter","noticeBubbleDefaultManager"],"sources":["../../src/NoticeBubbleManager.js"],"sourcesContent":["import EventEmitter from '@semcore/utils/lib/eventEmitter';\nimport { callAllEventHandlers } from '@semcore/utils/lib/assignProps';\nimport { setFocus } from '@semcore/utils/lib/use/useFocusLock';\nimport React from 'react';\nimport rafTrottle from '@semcore/utils/lib/rafTrottle';\n\nconst EVENT_NAME = 'CHANGE';\n\nclass NoticeBubbleManager {\n items = [];\n emitter = null;\n counter = 0;\n\n replaceTimer = 0;\n\n constructor() {\n this.emitter = new EventEmitter();\n }\n\n addListener(fn) {\n return this.emitter.subscribe(EVENT_NAME, fn);\n }\n\n createItem(props) {\n const manager = this;\n\n return {\n type: 'info',\n ...props,\n onClose: callAllEventHandlers(props.onClose, () => {\n manager.remove(props.uid);\n }),\n };\n }\n\n emit() {\n this.emitter.emit(EVENT_NAME, this.items);\n }\n\n add(props) {\n const uid = this.counter++;\n const ref = React.createRef();\n const focus = () => setTimeout(() => setFocus(ref.current), 0);\n const item = this.createItem({\n uid,\n visible: props.initialAnimation ? true : undefined,\n forwardRef: ref,\n ...props,\n });\n this.items.push(item);\n this.emit();\n return {\n uid,\n update: this.update.bind(this, uid),\n remove: this.remove.bind(this, uid),\n ref,\n focus,\n };\n }\n\n update(uid, props) {\n const index = this.items.findIndex((item) => item.uid === uid);\n if (index !== -1) {\n this.items[index] = this.createItem({\n ...this.items[index],\n ...props,\n });\n this.emit();\n return true;\n }\n return false;\n }\n\n replaceLast(props) {\n if (this.replaceTimer) {\n clearTimeout(this.replaceTimer);\n }\n\n const item = this.items[this.items.length - 1];\n\n if (item?.visible) {\n this.remove(this.counter - 1);\n }\n\n this.replaceTimer = setTimeout(() => {\n this.add(props);\n }, 300);\n }\n\n remove(uid) {\n const item = this.items.find((item) => item.uid === uid);\n if (item) {\n item.visible = false;\n setTimeout(() => {\n this.items = this.items.filter((item) => item.uid !== uid);\n this.emit();\n }, 1000);\n this.emit();\n return true;\n }\n return false;\n }\n}\n\nconst noticeBubbleDefaultManager = new NoticeBubbleManager();\n\nexport { NoticeBubbleManager };\nexport default noticeBubbleDefaultManager;\n"],"mappings":";;;;AAAA,OAAOA,YAAY,MAAM,iCAAiC;AAC1D,SAASC,oBAAoB,QAAQ,gCAAgC;AACrE,SAASC,QAAQ,QAAQ,qCAAqC;AAC9D,OAAOC,KAAK,MAAM,OAAO;AACzB,OAAOC,UAAU,MAAM,+BAA+B;AAEtD,IAAMC,UAAU,GAAG,QAAQ;AAAC,IAEtBC,mBAAmB;EAOvB,SAAAA,oBAAA,EAAc;IAAAC,eAAA,OAAAD,mBAAA;IAAAE,eAAA,gBANN,EAAE;IAAAA,eAAA,kBACA,IAAI;IAAAA,eAAA,kBACJ,CAAC;IAAAA,eAAA,uBAEI,CAAC;IAGd,IAAI,CAACC,OAAO,GAAG,IAAIT,YAAY,EAAE;EACnC;EAACU,YAAA,CAAAJ,mBAAA;IAAAK,GAAA;IAAAC,KAAA,EAED,SAAAC,YAAYC,EAAE,EAAE;MACd,OAAO,IAAI,CAACL,OAAO,CAACM,SAAS,CAACV,UAAU,EAAES,EAAE,CAAC;IAC/C;EAAC;IAAAH,GAAA;IAAAC,KAAA,EAED,SAAAI,WAAWC,KAAK,EAAE;MAChB,IAAMC,OAAO,GAAG,IAAI;MAEpB,OAAAC,aAAA,CAAAA,aA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AAE;QACRA,IAAI,CAACC,OAAO,GAAG,KAAK;QACpBH,UAAU,CAAC,YAAM;UACfiB,MAAI,CAACvB,KAAK,GAAGuB,MAAI,CAACvB,KAAK,CAACyB,MAAM,CAAC,UAACjB,IAAI;YAAA,OAAKA,IAAI,CAACV,GAAG,KAAKA,GAAG;UAAA,EAAC;UAC1DyB,MAAI,CAACxB,IAAI,EAAE;QACb,CAAC,EAAE,IAAI,CAAC;QACR,IAAI,CAACA,IAAI,EAAE;QACX,OAAO,IAAI;MACb;MACA,OAAO,KAAK;IACd;EAAC;EAAA,OAAAlB,mBAAA;AAAA;AAGH,IAAM6C,0BAA0B,GAAG,IAAI7C,mBAAmB,EAAE;AAE5D,SAASA,mBAAmB;AAC5B,eAAe6C,0BAA0B"}
|
package/lib/es6/index.d.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.js","names":[],"sources":["../../src/index.d.ts"],"sourcesContent":["import { PortalProps } from '@semcore/portal';\nimport { UnknownProperties, Intergalactic } from '@semcore/core';\nimport { BoxProps } from '@semcore/flex-box';\n\n/** @deprecated */\nexport interface INoticeBubbleContainerProps\n extends NoticeBubbleContainerProps,\n UnknownProperties {}\nexport type NoticeBubbleContainerProps = BoxProps &\n PortalProps & {\n /** Manager copy */\n manager?: NoticeBubbleManager;\n locale?: string;\n };\n\n/** @deprecated */\nexport interface INoticeBubbleProps extends NoticeBubbleProps, UnknownProperties {}\nexport type NoticeBubbleProps = BoxProps & {\n /**\n * Notice visibility.\n */\n visible?: boolean;\n /**\n * Control under the notice children.\n * */\n action?: React.ReactNode;\n /**\n * Callback triggered by \"Close\" icon click.\n * */\n onClose?: (e?: React.SyntheticEvent) => void;\n /**\n * Notice content.\n * */\n children?: React.ReactNode;\n manager?: NoticeBubbleManager;\n icon?: React.ReactElement;\n};\n/** @deprecated */\nexport interface INoticeBubbleInfoProps extends NoticeBubbleInfoProps, UnknownProperties {}\nexport type NoticeBubbleInfoProps = NoticeBubbleProps & {\n readonly type?: 'info';\n /**\n * Notice display duration. Set to 0 to disable auto-close.\n */\n duration?: number;\n /**\n * Enables animation on first rendering.\n * @default false\n */\n initialAnimation?: boolean;\n /**\n * Use it for complex notices with important controls.\n * If enabled, browser focus will be locked in the notice\n * until it's closed. After close focus should return to the element\n * where it was placed before notice appear.\n */\n focusLock?: boolean;\n};\n\n/** @deprecated */\nexport interface INoticeBubbleWarningProps extends NoticeBubbleWarningProps, UnknownProperties {}\nexport type NoticeBubbleWarningProps = NoticeBubbleProps & {\n readonly type?: 'warning';\n /**\n * Notice display duration.\n */\n duration?: number;\n /**\n * Enables animation on first rendering.\n * @default false\n */\n initialAnimation?: boolean;\n /**\n * Use it for complex notices with important controls.\n * If enabled, browser focus will be locked in the notice\n * until it's closed. After close focus should return to the element\n * where it was placed before notice appear.\n */\n focusLock?: boolean;\n};\n\n/** @deprecated */\nexport interface INoticeBubbleManager extends NoticeBubbleManagerClass, UnknownProperties {}\nexport type NoticeBubbleManagerClass = {\n /**\n * Creates and shows a notice.\n * */\n add: (props: NoticeBubbleInfoProps | NoticeBubbleWarningProps) => {\n uid: string;\n update: (props: Partial<NoticeBubbleInfoProps> | Partial<NoticeBubbleWarningProps>) => boolean;\n remove: () => boolean;\n ref: React.RefObject<HTMLDivElement>;\n focus: () => void;\n };\n /**\n * Updates notice by uid.\n * */\n update: (\n uid: string,\n props: Partial<NoticeBubbleInfoProps> | Partial<NoticeBubbleWarningProps>,\n ) => boolean;\n /**\n * Removes notice by uid.\n * */\n remove: (uid: string) => boolean;\n};\n\n/**\n * @deprecated use `NoticeBubbleManager` instead.\n * */\nexport declare const NoticeBubble: Intergalactic.Component<'div', NoticeBubbleInfoProps>;\n/**\n * @deprecated use `NoticeBubbleManager` instead.\n * */\nexport declare const NoticeBubbleWarning: Intergalactic.Component<'div', NoticeBubbleWarningProps>;\nexport declare const NoticeBubbleContainer: Intergalactic.Component<\n 'div',\n NoticeBubbleContainerProps\n> & {\n /**\n * @deprecated use `NoticeBubbleManager` instead.\n * */\n Info: typeof NoticeBubble;\n\n /**\n * @deprecated use `NoticeBubbleManager` instead.\n * */\n Warning: typeof NoticeBubbleWarning;\n};\nexport declare class NoticeBubbleManager implements NoticeBubbleManagerClass {\n /**\n * Creates and shows a notice.\n * */\n add(props: NoticeBubbleInfoProps | NoticeBubbleWarningProps): {\n uid: string;\n update: (props: Partial<NoticeBubbleInfoProps> | Partial<NoticeBubbleWarningProps>) => boolean;\n remove: () => boolean;\n ref: React.RefObject<HTMLDivElement>;\n focus: () => void;\n };\n /**\n * Updates notice by uid.\n * */\n update(\n uid: string,\n props: Partial<NoticeBubbleInfoProps> | Partial<NoticeBubbleWarningProps>,\n ): boolean;\n /**\n * Removes notice by uid.\n * */\n remove(uid: string): boolean;\n}\n\nexport declare const noticeBubbleDefaultManager: NoticeBubbleManager;\n\n/**\n * @deprecated Use `import { noticeBubbleDefaultManager } from ...` instead\n */\nexport default noticeBubbleDefaultManager;\n"],"mappings":""}
|
|
1
|
+
{"version":3,"file":"index.d.js","names":[],"sources":["../../src/index.d.ts"],"sourcesContent":["import { PortalProps } from '@semcore/portal';\nimport { UnknownProperties, Intergalactic } from '@semcore/core';\nimport { BoxProps } from '@semcore/flex-box';\n\n/** @deprecated */\nexport interface INoticeBubbleContainerProps\n extends NoticeBubbleContainerProps,\n UnknownProperties {}\nexport type NoticeBubbleContainerProps = BoxProps &\n PortalProps & {\n /** Manager copy */\n manager?: NoticeBubbleManager;\n locale?: string;\n };\n\n/** @deprecated */\nexport interface INoticeBubbleProps extends NoticeBubbleProps, UnknownProperties {}\nexport type NoticeBubbleProps = BoxProps & {\n /**\n * Notice visibility.\n */\n visible?: boolean;\n /**\n * Control under the notice children.\n * */\n action?: React.ReactNode;\n /**\n * Callback triggered by \"Close\" icon click.\n * */\n onClose?: (e?: React.SyntheticEvent) => void;\n /**\n * Notice content.\n * */\n children?: React.ReactNode;\n manager?: NoticeBubbleManager;\n icon?: React.ReactElement;\n};\n/** @deprecated */\nexport interface INoticeBubbleInfoProps extends NoticeBubbleInfoProps, UnknownProperties {}\nexport type NoticeBubbleInfoProps = NoticeBubbleProps & {\n readonly type?: 'info';\n /**\n * Notice display duration. Set to 0 to disable auto-close.\n */\n duration?: number;\n /**\n * Enables animation on first rendering.\n * @default false\n */\n initialAnimation?: boolean;\n /**\n * Use it for complex notices with important controls.\n * If enabled, browser focus will be locked in the notice\n * until it's closed. After close focus should return to the element\n * where it was placed before notice appear.\n */\n focusLock?: boolean;\n};\n\n/** @deprecated */\nexport interface INoticeBubbleWarningProps extends NoticeBubbleWarningProps, UnknownProperties {}\nexport type NoticeBubbleWarningProps = NoticeBubbleProps & {\n readonly type?: 'warning';\n /**\n * Notice display duration.\n */\n duration?: number;\n /**\n * Enables animation on first rendering.\n * @default false\n */\n initialAnimation?: boolean;\n /**\n * Use it for complex notices with important controls.\n * If enabled, browser focus will be locked in the notice\n * until it's closed. After close focus should return to the element\n * where it was placed before notice appear.\n */\n focusLock?: boolean;\n};\n\n/** @deprecated */\nexport interface INoticeBubbleManager extends NoticeBubbleManagerClass, UnknownProperties {}\nexport type NoticeBubbleManagerClass = {\n /**\n * Creates and shows a notice.\n * */\n add: (props: NoticeBubbleInfoProps | NoticeBubbleWarningProps) => {\n uid: string;\n update: (props: Partial<NoticeBubbleInfoProps> | Partial<NoticeBubbleWarningProps>) => boolean;\n remove: () => boolean;\n ref: React.RefObject<HTMLDivElement>;\n focus: () => void;\n };\n /**\n * Updates notice by uid.\n * */\n update: (\n uid: string,\n props: Partial<NoticeBubbleInfoProps> | Partial<NoticeBubbleWarningProps>,\n ) => boolean;\n /**\n * Removes notice by uid.\n * */\n remove: (uid: string) => boolean;\n /**\n * Replace last notice (if it is existing)\n */\n replaceLast: (props: NoticeBubbleInfoProps | NoticeBubbleWarningProps) => void;\n};\n\n/**\n * @deprecated use `NoticeBubbleManager` instead.\n * */\nexport declare const NoticeBubble: Intergalactic.Component<'div', NoticeBubbleInfoProps>;\n/**\n * @deprecated use `NoticeBubbleManager` instead.\n * */\nexport declare const NoticeBubbleWarning: Intergalactic.Component<'div', NoticeBubbleWarningProps>;\nexport declare const NoticeBubbleContainer: Intergalactic.Component<\n 'div',\n NoticeBubbleContainerProps\n> & {\n /**\n * @deprecated use `NoticeBubbleManager` instead.\n * */\n Info: typeof NoticeBubble;\n\n /**\n * @deprecated use `NoticeBubbleManager` instead.\n * */\n Warning: typeof NoticeBubbleWarning;\n};\nexport declare class NoticeBubbleManager implements NoticeBubbleManagerClass {\n /**\n * Creates and shows a notice.\n * */\n add(props: NoticeBubbleInfoProps | NoticeBubbleWarningProps): {\n uid: string;\n update: (props: Partial<NoticeBubbleInfoProps> | Partial<NoticeBubbleWarningProps>) => boolean;\n remove: () => boolean;\n ref: React.RefObject<HTMLDivElement>;\n focus: () => void;\n };\n /**\n * Updates notice by uid.\n * */\n update(\n uid: string,\n props: Partial<NoticeBubbleInfoProps> | Partial<NoticeBubbleWarningProps>,\n ): boolean;\n /**\n * Removes notice by uid.\n * */\n remove(uid: string): boolean;\n /**\n * Replace last notice (if it is existing)\n */\n replaceLast: (props: NoticeBubbleInfoProps | NoticeBubbleWarningProps) => void;\n}\n\nexport declare const noticeBubbleDefaultManager: NoticeBubbleManager;\n\n/**\n * @deprecated Use `import { noticeBubbleDefaultManager } from ...` instead\n */\nexport default noticeBubbleDefaultManager;\n"],"mappings":""}
|
|
@@ -43,7 +43,7 @@ SDismiss {
|
|
|
43
43
|
border: 0;
|
|
44
44
|
background: transparent;
|
|
45
45
|
}
|
|
46
|
-
SDismiss[use]
|
|
46
|
+
SDismiss[use] {
|
|
47
47
|
/* height: auto; */
|
|
48
48
|
padding: 0 1px;
|
|
49
49
|
}
|
|
@@ -104,4 +104,4 @@ SNoticeAriaLiveWrapper {
|
|
|
104
104
|
overflow: hidden;
|
|
105
105
|
opacity: 0;
|
|
106
106
|
}
|
|
107
|
-
}
|
|
107
|
+
}
|
package/lib/types/index.d.ts
CHANGED
|
@@ -103,6 +103,10 @@ export type NoticeBubbleManagerClass = {
|
|
|
103
103
|
* Removes notice by uid.
|
|
104
104
|
* */
|
|
105
105
|
remove: (uid: string) => boolean;
|
|
106
|
+
/**
|
|
107
|
+
* Replace last notice (if it is existing)
|
|
108
|
+
*/
|
|
109
|
+
replaceLast: (props: NoticeBubbleInfoProps | NoticeBubbleWarningProps) => void;
|
|
106
110
|
};
|
|
107
111
|
|
|
108
112
|
/**
|
|
@@ -149,6 +153,10 @@ export declare class NoticeBubbleManager implements NoticeBubbleManagerClass {
|
|
|
149
153
|
* Removes notice by uid.
|
|
150
154
|
* */
|
|
151
155
|
remove(uid: string): boolean;
|
|
156
|
+
/**
|
|
157
|
+
* Replace last notice (if it is existing)
|
|
158
|
+
*/
|
|
159
|
+
replaceLast: (props: NoticeBubbleInfoProps | NoticeBubbleWarningProps) => void;
|
|
152
160
|
}
|
|
153
161
|
|
|
154
162
|
export declare const noticeBubbleDefaultManager: NoticeBubbleManager;
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@semcore/notice-bubble",
|
|
3
3
|
"description": "Semrush NoticeBubble Component",
|
|
4
|
-
"version": "5.
|
|
4
|
+
"version": "5.48.0-prerelease.0",
|
|
5
5
|
"main": "lib/cjs/index.js",
|
|
6
6
|
"module": "lib/es6/index.js",
|
|
7
7
|
"typings": "lib/types/index.d.ts",
|
|
@@ -9,14 +9,14 @@
|
|
|
9
9
|
"sideEffects": false,
|
|
10
10
|
"license": "MIT",
|
|
11
11
|
"dependencies": {
|
|
12
|
-
"@semcore/utils": "4.
|
|
13
|
-
"@semcore/icon": "4.
|
|
14
|
-
"@semcore/portal": "3.
|
|
15
|
-
"@semcore/flex-box": "5.
|
|
16
|
-
"@semcore/animation": "2.
|
|
12
|
+
"@semcore/utils": "4.44.0-prerelease.0",
|
|
13
|
+
"@semcore/icon": "4.53.0-prerelease.0",
|
|
14
|
+
"@semcore/portal": "3.39.0-prerelease.0",
|
|
15
|
+
"@semcore/flex-box": "5.39.0-prerelease.0",
|
|
16
|
+
"@semcore/animation": "2.39.0-prerelease.0"
|
|
17
17
|
},
|
|
18
18
|
"peerDependencies": {
|
|
19
|
-
"@semcore/core": "^2.
|
|
19
|
+
"@semcore/core": "^2.37.0-prerelease.0",
|
|
20
20
|
"react": "16.8 - 18",
|
|
21
21
|
"react-dom": "16.8 - 18"
|
|
22
22
|
},
|