@semcore/notice-bubble 17.1.0 → 17.2.0-prerelease.3
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 +10 -0
- package/lib/cjs/NoticeBubble.js +33 -24
- package/lib/cjs/NoticeBubble.js.map +1 -1
- package/lib/cjs/NoticeBubble.type.js.map +1 -1
- package/lib/cjs/NoticeBubbleManager.js +1 -1
- package/lib/cjs/NoticeBubbleManager.js.map +1 -1
- package/lib/cjs/translations/__intergalactic-dynamic-locales.js.map +1 -1
- package/lib/es6/NoticeBubble.js +33 -24
- package/lib/es6/NoticeBubble.js.map +1 -1
- package/lib/es6/NoticeBubble.type.js.map +1 -1
- package/lib/es6/NoticeBubbleManager.js +1 -1
- package/lib/es6/NoticeBubbleManager.js.map +1 -1
- package/lib/es6/translations/__intergalactic-dynamic-locales.js.map +1 -1
- package/lib/esm/NoticeBubble.mjs +30 -27
- package/lib/esm/NoticeBubbleManager.mjs +2 -2
- package/lib/esm/utils.mjs +1 -1
- package/lib/types/NoticeBubble.d.ts +6 -1
- package/lib/types/NoticeBubble.type.d.ts +9 -0
- package/lib/types/NoticeBubbleManager.d.ts +1 -1
- package/lib/types/translations/__intergalactic-dynamic-locales.d.ts +1 -0
- package/package.json +5 -5
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,16 @@
|
|
|
2
2
|
|
|
3
3
|
CHANGELOG.md standards are inspired by [keepachangelog.com](https://keepachangelog.com/en/1.0.0/).
|
|
4
4
|
|
|
5
|
+
## [17.2.0] - 2026-06-05
|
|
6
|
+
|
|
7
|
+
### Added
|
|
8
|
+
|
|
9
|
+
- Links to the API and examples in the docs.
|
|
10
|
+
|
|
11
|
+
### Fixed
|
|
12
|
+
|
|
13
|
+
- Issue with `replace last item` and `initialAnimation=false`.
|
|
14
|
+
|
|
5
15
|
## [17.1.0] - 2026-05-13
|
|
6
16
|
|
|
7
17
|
### Added
|
package/lib/cjs/NoticeBubble.js
CHANGED
|
@@ -25,23 +25,23 @@ var _NoticeBubbleManager = _interopRequireDefault(require("./NoticeBubbleManager
|
|
|
25
25
|
var _intergalacticDynamicLocales = require("./translations/__intergalactic-dynamic-locales");
|
|
26
26
|
var _utils = require("./utils");
|
|
27
27
|
/*!__reshadow-styles__:"./style/notice-bubble.shadow.css"*/
|
|
28
|
-
const style = (/*__reshadow_css_start__*/_core.sstyled.insert(/*__inner_css_start__*/"
|
|
28
|
+
const style = (/*__reshadow_css_start__*/_core.sstyled.insert(/*__inner_css_start__*/".___SBubble_16a8l_gg_,.___SView_16a8l_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,#fefffff2);gap:var(--intergalactic-spacing-2x,8px)}.___SBubble_16a8l_gg_._type_info_16a8l_gg_,.___SView_16a8l_gg_._type_info_16a8l_gg_{background:var(--intergalactic-bg-primary-invert,#1a1e1a)}.___SBubble_16a8l_gg_._type_warning_16a8l_gg_,.___SView_16a8l_gg_._type_warning_16a8l_gg_{background:var(--intergalactic-bg-primary-critical,#f73740)}.___SContent_16a8l_gg_{flex-direction:column;gap:var(--intergalactic-spacing-2x,8px);flex:1}.___SMessage_16a8l_gg_{font-size:var(--intergalactic-fs-200,14px);line-height:var(--intergalactic-lh-200,142%)}.___SDismiss_16a8l_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:#0000}.___SDismiss_16a8l_gg_.__use_16a8l_gg_{padding:0 1px}.___SIcon_16a8l_gg_{justify-content:center;align-items:center;height:var(--intergalactic-spacing-5x,20px)}.___SNoticeBubble_16a8l_gg_{width:300px;position:fixed;right:var(--intergalactic-spacing-3x,12px);top:var(--intergalactic-spacing-3x,12px)}@media (max-width:767px){.___SNoticeBubble_16a8l_gg_{width:calc(100% - var(--intergalactic-spacing-6x, 24px))}}.___SNoticeBubble_16a8l_gg_.__disablePortal_16a8l_gg_{position:sticky;margin-left:auto;height:0}.___SMessage_16a8l_gg_ a{color:var(--intergalactic-text-link-invert,#88acfd)}.___SNoticeAriaLiveWrapper_16a8l_gg_{display:contents}@keyframes enter_16a8l{0%{transform:translate(100%);max-height:0;overflow:hidden}to{transform:translate(0);max-height:100vh;overflow:hidden}}@keyframes exit_16a8l{0%{max-height:100vh;overflow:hidden;opacity:1}to{max-height:0;overflow:hidden;opacity:0}}", /*__inner_css_end__*/"16a8l_gg_"),
|
|
29
29
|
/*__reshadow_css_end__*/
|
|
30
30
|
{
|
|
31
|
-
"__SContent": "
|
|
32
|
-
"__SMessage": "
|
|
33
|
-
"__SDismiss": "
|
|
34
|
-
"_use": "
|
|
35
|
-
"__SIcon": "
|
|
36
|
-
"__SNoticeBubble": "
|
|
37
|
-
"_disablePortal": "
|
|
38
|
-
"__SNoticeAriaLiveWrapper": "
|
|
39
|
-
"@enter": "
|
|
40
|
-
"@exit": "
|
|
41
|
-
"__SBubble": "
|
|
42
|
-
"__SView": "
|
|
43
|
-
"_type_info": "
|
|
44
|
-
"_type_warning": "
|
|
31
|
+
"__SContent": "___SContent_16a8l_gg_",
|
|
32
|
+
"__SMessage": "___SMessage_16a8l_gg_",
|
|
33
|
+
"__SDismiss": "___SDismiss_16a8l_gg_",
|
|
34
|
+
"_use": "__use_16a8l_gg_",
|
|
35
|
+
"__SIcon": "___SIcon_16a8l_gg_",
|
|
36
|
+
"__SNoticeBubble": "___SNoticeBubble_16a8l_gg_",
|
|
37
|
+
"_disablePortal": "__disablePortal_16a8l_gg_",
|
|
38
|
+
"__SNoticeAriaLiveWrapper": "___SNoticeAriaLiveWrapper_16a8l_gg_",
|
|
39
|
+
"@enter": "enter_16a8l",
|
|
40
|
+
"@exit": "exit_16a8l",
|
|
41
|
+
"__SBubble": "___SBubble_16a8l_gg_",
|
|
42
|
+
"__SView": "___SView_16a8l_gg_",
|
|
43
|
+
"_type_info": "_type_info_16a8l_gg_",
|
|
44
|
+
"_type_warning": "_type_warning_16a8l_gg_"
|
|
45
45
|
});
|
|
46
46
|
class NoticeBubbleContainerRoot extends _core.Component {
|
|
47
47
|
constructor(...args) {
|
|
@@ -91,12 +91,12 @@ class NoticeBubbleContainerRoot extends _core.Component {
|
|
|
91
91
|
const SView = notice.type === 'warning' ? ViewWarning : ViewInfo;
|
|
92
92
|
return _ref2 = (0, _core.sstyled)(styles), /*#__PURE__*/_react.default.createElement(PortalForNoticeItem, _ref2.cn("PortalForNoticeItem", {
|
|
93
93
|
"key": notice.uid,
|
|
94
|
-
"tag": SView,
|
|
95
94
|
"containerNode": containerNode,
|
|
96
95
|
"animationDuration": duration,
|
|
97
96
|
"styles": styles,
|
|
98
97
|
"getI18nText": getI18nText,
|
|
99
|
-
...notice
|
|
98
|
+
...notice,
|
|
99
|
+
"tag": SView
|
|
100
100
|
}));
|
|
101
101
|
});
|
|
102
102
|
}
|
|
@@ -174,21 +174,24 @@ const PortalForNoticeItem = props => {
|
|
|
174
174
|
}, 200);
|
|
175
175
|
}, []);
|
|
176
176
|
const SNoticeAriaLiveWrapper = 'div';
|
|
177
|
-
const
|
|
178
|
-
|
|
177
|
+
const {
|
|
178
|
+
tag: Tag,
|
|
179
|
+
...otherProps
|
|
180
|
+
} = props;
|
|
181
|
+
if (otherProps.type === 'info') {
|
|
179
182
|
return /*#__PURE__*/_react.default.createElement(_zIndexStacking.ZIndexStackingContextProvider, {
|
|
180
183
|
designToken: "z-index-notice-bubble"
|
|
181
184
|
}, /*#__PURE__*/_react.default.createElement(_baseComponents.Portal, {
|
|
182
|
-
nodeToMount:
|
|
185
|
+
nodeToMount: otherProps.containerNode
|
|
183
186
|
}, /*#__PURE__*/_react.default.createElement(SNoticeAriaLiveWrapper, {
|
|
184
187
|
"aria-live": "polite"
|
|
185
|
-
}, showContent && /*#__PURE__*/_react.default.createElement(Tag,
|
|
188
|
+
}, showContent && /*#__PURE__*/_react.default.createElement(Tag, otherProps))));
|
|
186
189
|
}
|
|
187
190
|
return /*#__PURE__*/_react.default.createElement(_zIndexStacking.ZIndexStackingContextProvider, {
|
|
188
191
|
designToken: "z-index-notice-bubble"
|
|
189
192
|
}, /*#__PURE__*/_react.default.createElement(_baseComponents.Portal, {
|
|
190
|
-
nodeToMount:
|
|
191
|
-
}, /*#__PURE__*/_react.default.createElement(Tag,
|
|
193
|
+
nodeToMount: otherProps.containerNode
|
|
194
|
+
}, /*#__PURE__*/_react.default.createElement(Tag, otherProps)));
|
|
192
195
|
};
|
|
193
196
|
class ViewInfo extends _core.Component {
|
|
194
197
|
constructor(...args) {
|
|
@@ -271,7 +274,7 @@ class ViewInfo extends _core.Component {
|
|
|
271
274
|
} = this.props;
|
|
272
275
|
return _ref6 = (0, _core.sstyled)(styles), /*#__PURE__*/_react.default.createElement(_baseComponents.Animation, _ref6.cn("Animation", {
|
|
273
276
|
"initialAnimation": initialAnimation,
|
|
274
|
-
"visible": visible
|
|
277
|
+
"visible": visible,
|
|
275
278
|
"duration": animationDuration,
|
|
276
279
|
"keyframes": [styles['@enter'], styles['@exit']]
|
|
277
280
|
}), /*#__PURE__*/_react.default.createElement(SBubble, _ref6.cn("SBubble", {
|
|
@@ -301,6 +304,12 @@ class ViewInfo extends _core.Component {
|
|
|
301
304
|
}
|
|
302
305
|
}
|
|
303
306
|
class ViewWarning extends ViewInfo {}
|
|
307
|
+
|
|
308
|
+
/**
|
|
309
|
+
* NoticeBubble
|
|
310
|
+
*
|
|
311
|
+
* {@link https://developer.semrush.com/intergalactic/components/notice-bubble/notice-bubble-api/|API} | {@link https://developer.semrush.com/intergalactic/components/notice-bubble/notice-bubble-code/|Examples}
|
|
312
|
+
*/
|
|
304
313
|
(0, _defineProperty2.default)(ViewWarning, "defaultProps", {
|
|
305
314
|
type: 'warning',
|
|
306
315
|
duration: 0
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NoticeBubble.js","names":["_core","require","_baseComponents","_button","_interopRequireDefault","_i18nEnhance","_fire","_getFocusableIn","_isNode","_ref7","_ThemeProvider","_useFocusLock","_useCssVariable","_zIndexStacking","_m","_react","_NoticeBubbleManager","_intergalacticDynamicLocales","_utils","style","sstyled","insert","NoticeBubbleContainerRoot","Component","constructor","args","_defineProperty2","default","notices","infos","warnings","_unsubscribe","setState","forceUpdate","componentDidMount","asProps","manager","addListener","handleChange","render","_ref","_ref3","SNoticeBubble","Box","SNoticeAriaLiveWrapper","Children","styles","disablePortal","getI18nText","ref","parentZIndexStacking","duration","containerNode","state","map","notice","_ref2","SView","type","ViewWarning","ViewInfo","createElement","PortalForNoticeItem","cn","uid","filter","ZIndexStackingContextProvider","Portal","assignProps","_ref4","_ref5","i18nEnhance","localizedMessages","contextThemeEnhance","zIndexStackingEnhance","cssVariableEnhance","variable","fallback","v","Number","parseInt","prop","i18n","locale","FocusLock","React","forwardRef","props","outerRef","focusLock","other","innerRef","useRef","useFocusLock","useForkRef","Flex","_extends2","showContent","setShowContent","useState","useEffect","setTimeout","Tag","tag","designToken","nodeToMount","createRef","e","fire","clearTimer","key","handleClose","timer","pause","resume","event","paused","rect","current","getBoundingClientRect","mouseInRect","clientX","left","right","clientY","top","bottom","Timer","document","body","addEventListener","handleBodyMouseMove","noticeElement","focusableNodes","getFocusableIn","node","closeButtonRef","length","setFocus","componentWillUnmount","removeEventListener","clear","_ref6","SBubble","SDismiss","Button","SContent","SMessage","SAction","SIcon","visible","initialAnimation","animationDuration","icon","children","action","Animation","handleMouseEnter","handleMouseLeave","handleKeydown","undefined","Addon","CloseIcon","color","isNode","Fragment","NoticeBubbleContainer","createComponent","_default","exports"],"sources":["../../src/NoticeBubble.tsx"],"sourcesContent":["import { Animation, Box, Flex, Portal } from '@semcore/base-components';\nimport Button from '@semcore/button';\nimport { createComponent, Component, sstyled, Root } from '@semcore/core';\nimport type { Intergalactic } from '@semcore/core';\nimport i18nEnhance from '@semcore/core/lib/utils/enhances/i18nEnhance';\nimport fire from '@semcore/core/lib/utils/fire';\nimport { getFocusableIn } from '@semcore/core/lib/utils/focus-lock/getFocusableIn';\nimport isNode from '@semcore/core/lib/utils/isNode';\nimport { useForkRef } from '@semcore/core/lib/utils/ref';\nimport { contextThemeEnhance } from '@semcore/core/lib/utils/ThemeProvider';\nimport { useFocusLock, setFocus } from '@semcore/core/lib/utils/use/useFocusLock';\nimport { cssVariableEnhance } from '@semcore/core/lib/utils/useCssVariable';\nimport {\n ZIndexStackingContextProvider,\n zIndexStackingEnhance,\n} from '@semcore/core/lib/utils/zIndexStacking';\nimport CloseIcon from '@semcore/icon/Close/m';\nimport React from 'react';\n\nimport type {\n NoticeBubbleContainerProps,\n NoticeBubbleViewItemProps,\n} from './NoticeBubble.type';\nimport type { NoticeItem } from './NoticeBubbleManager';\nimport manager from './NoticeBubbleManager';\nimport style from './style/notice-bubble.shadow.css';\nimport { localizedMessages } from './translations/__intergalactic-dynamic-locales';\nimport { Timer } from './utils';\n\ntype State = {\n notices: NoticeItem[];\n infos: NoticeItem[];\n warnings: NoticeItem[];\n};\n\nclass NoticeBubbleContainerRoot extends Component<NoticeBubbleContainerProps, typeof NoticeBubbleContainerRoot.enhance, {}, typeof NoticeBubbleContainerRoot.defaultProps, State> {\n static displayName = 'NoticeBubbleContainer';\n static style = style;\n static enhance = [\n i18nEnhance(localizedMessages),\n contextThemeEnhance(),\n zIndexStackingEnhance('z-index-notice-bubble'),\n cssVariableEnhance<'duration', number, number>({\n variable: '--intergalactic-duration-popper',\n fallback: 200,\n map: (v: string) => Number.parseInt(v, 10),\n prop: 'duration',\n }),\n ] as const;\n\n static defaultProps = {\n manager,\n i18n: localizedMessages,\n locale: 'en',\n } as const;\n\n _unsubscribe: (() => void) | null = null;\n\n state: State = {\n notices: [],\n infos: [],\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: NoticeItem[]) => {\n this.setState({ notices });\n this.forceUpdate(); // need this, because somehow this component doesn't rerender event if the notices are different\n };\n\n render() {\n const SNoticeBubble = Root;\n const SNoticeAriaLiveWrapper = 'div';\n const { Children, styles, disablePortal, getI18nText, ref, parentZIndexStacking, duration, containerNode } =\n this.asProps;\n const { notices } = this.state;\n\n if (containerNode) {\n return notices.map((notice) => {\n const SView = notice.type === 'warning' ? ViewWarning : ViewInfo;\n\n return sstyled(styles)(\n <PortalForNoticeItem\n key={notice.uid}\n tag={SView}\n containerNode={containerNode}\n animationDuration={duration}\n styles={styles}\n getI18nText={getI18nText}\n {...notice}\n />,\n );\n });\n }\n\n const infos = notices.filter((notice) => notice.type === 'info');\n const warnings = notices.filter((notice) => notice.type === 'warning');\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 {warnings.map((notice) => {\n const SView = ViewWarning;\n return sstyled(styles)(\n <SView\n key={notice.uid}\n animationDuration={duration}\n styles={styles}\n getI18nText={getI18nText}\n {...notice}\n />,\n );\n })}\n <SNoticeAriaLiveWrapper aria-live='polite'>\n {infos.map((notice) => {\n const SView = ViewInfo;\n return sstyled(styles)(\n <SView\n key={notice.uid}\n animationDuration={duration}\n styles={styles}\n getI18nText={getI18nText}\n {...notice}\n />,\n );\n })}\n </SNoticeAriaLiveWrapper>\n </SNoticeBubble>\n </Portal>\n </ZIndexStackingContextProvider>,\n );\n }\n}\n\nconst FocusLock = React.forwardRef((props: any, outerRef: React.ForwardedRef<HTMLDivElement>) => {\n const { focusLock, ...other } = props;\n const innerRef = React.useRef<HTMLDivElement | null>(null);\n useFocusLock(innerRef, false, 'auto', !focusLock, true);\n const ref = useForkRef(outerRef, innerRef);\n\n return <Flex ref={ref} {...other} />;\n});\n\nconst PortalForNoticeItem = (props: NoticeBubbleViewItemProps & { containerNode: HTMLElement; tag: typeof ViewInfo }) => {\n const [showContent, setShowContent] = React.useState(false);\n\n // Show content for info notice in previously mounted node with aria-live polite\n React.useEffect(() => {\n setTimeout(() => {\n setShowContent(true);\n }, 200);\n }, []);\n\n const SNoticeAriaLiveWrapper = 'div';\n const Tag = props.tag;\n\n if (props.type === 'info') {\n return (\n <ZIndexStackingContextProvider designToken='z-index-notice-bubble'>\n <Portal nodeToMount={props.containerNode}>\n <SNoticeAriaLiveWrapper aria-live='polite'>\n {showContent && <Tag {...props} />}\n </SNoticeAriaLiveWrapper>\n </Portal>\n </ZIndexStackingContextProvider>\n );\n }\n\n return (\n <ZIndexStackingContextProvider designToken='z-index-notice-bubble'>\n <Portal nodeToMount={props.containerNode}>\n <Tag {...props} />\n </Portal>\n </ZIndexStackingContextProvider>\n );\n};\n\nclass ViewInfo extends Component<NoticeBubbleViewItemProps> {\n timer: Timer | null = null;\n ref = React.createRef<HTMLDivElement>();\n closeButtonRef = React.createRef<HTMLButtonElement>();\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 const noticeElement = this.ref.current;\n\n if (noticeElement) {\n const focusableNodes = getFocusableIn(noticeElement).filter(\n (node) => node !== this.closeButtonRef.current,\n );\n\n if (focusableNodes.length > 0) {\n setTimeout(() => setFocus(noticeElement), 0);\n }\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: React.SyntheticEvent) => {\n // because it might be called not only from the close icon click\n fire(this, 'onClose', e);\n this.clearTimer();\n };\n\n handleKeydown = (e: React.KeyboardEvent) => {\n if (e.key === 'Escape') {\n this.handleClose(e);\n }\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: MouseEvent) => {\n if (!this.timer?.paused) return;\n const rect = this.ref.current?.getBoundingClientRect();\n if (!rect) return;\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 = Button;\n const SContent = Flex;\n const SMessage = 'div';\n const SAction = 'div';\n const SIcon = Flex;\n const {\n styles,\n getI18nText,\n visible,\n type,\n initialAnimation,\n animationDuration,\n icon,\n children,\n action,\n focusLock,\n } = this.props;\n\n return sstyled(styles)(\n <Animation\n initialAnimation={initialAnimation}\n visible={visible ?? true}\n duration={animationDuration}\n // @ts-ignore\n keyframes={[styles['@enter'], styles['@exit']]}\n >\n <SBubble\n type={type}\n ref={this.ref}\n onMouseEnter={this.handleMouseEnter}\n onMouseLeave={this.handleMouseLeave}\n onKeyDown={this.handleKeydown}\n role={type === 'warning' ? 'alert' : undefined}\n focusLock={focusLock}\n >\n <SDismiss\n aria-haspopup={undefined}\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 ref={this.closeButtonRef}\n data-hide-focus-hover-popper='true'\n >\n <Button.Addon tag={CloseIcon} color='icon-primary-invert' />\n </SDismiss>\n\n {isNode(icon)\n ? (\n <>\n <SIcon>{icon}</SIcon>\n <SContent>\n <SMessage>{children}</SMessage>\n {isNode(action) ? <SAction>{action}</SAction> : null}\n </SContent>\n </>\n )\n : (\n <SContent>\n <SMessage>{children}</SMessage>\n {isNode(action) ? <SAction>{action}</SAction> : null}\n </SContent>\n )}\n </SBubble>\n </Animation>,\n );\n }\n}\n\nclass ViewWarning extends ViewInfo {\n static defaultProps = {\n type: 'warning',\n duration: 0,\n };\n}\n\nconst NoticeBubbleContainer = createComponent(NoticeBubbleContainerRoot) as Intergalactic.Component<'div', NoticeBubbleContainerProps>;\n\nexport default NoticeBubbleContainer;\n"],"mappings":";;;;;;;;;AAEA,IAAAA,KAAA,GAAAC,OAAA;AAFA,IAAAC,eAAA,GAAAD,OAAA;AACA,IAAAE,OAAA,GAAAC,sBAAA,CAAAH,OAAA;AAGA,IAAAI,YAAA,GAAAD,sBAAA,CAAAH,OAAA;AACA,IAAAK,KAAA,GAAAF,sBAAA,CAAAH,OAAA;AACA,IAAAM,eAAA,GAAAN,OAAA;AACA,IAAAO,OAAA,GAAAJ,sBAAA,CAAAH,OAAA;AACA,IAAAQ,KAAA,GAAAR,OAAA;AACA,IAAAS,cAAA,GAAAT,OAAA;AACA,IAAAU,aAAA,GAAAV,OAAA;AACA,IAAAW,eAAA,GAAAX,OAAA;AACA,IAAAY,eAAA,GAAAZ,OAAA;AAIA,IAAAa,EAAA,GAAAV,sBAAA,CAAAH,OAAA;AACA,IAAAc,MAAA,GAAAX,sBAAA,CAAAH,OAAA;AAOA,IAAAe,oBAAA,GAAAZ,sBAAA,CAAAH,OAAA;AAEA,IAAAgB,4BAAA,GAAAhB,OAAA;AACA,IAAAiB,MAAA,GAAAjB,OAAA;AAAgC;AAAA,MAAAkB,KAAA,8BAAAnB,KAAA,CAAAoB,OAAA,CAAAC,MAAA;AAAA;AAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;AAAA;AAQhC,MAAMC,yBAAyB,SAASC,eAAS,CAAiI;EAAAC,YAAA,GAAAC,IAAA;IAAA,SAAAA,IAAA;IAAA,IAAAC,gBAAA,CAAAC,OAAA,wBAqB5I,IAAI;IAAA,IAAAD,gBAAA,CAAAC,OAAA,i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AAA,CAACqF,QAAQ,EAAAJ,KAAA,CAAA/E,EAAA,+BACPhD,MAAA,CAAAY,OAAA,CAAAkC,aAAA,CAACsF,QAAQ,EAAAL,KAAA,CAAA/E,EAAA,kBAAE2F,QAAmB,CAAC,EAC9B,IAAAU,eAAM,EAACT,MAAM,CAAC,gBAAG5I,MAAA,CAAAY,OAAA,CAAAkC,aAAA,CAACuF,OAAO,EAAAN,KAAA,CAAA/E,EAAA,iBAAE4F,MAAgB,CAAC,GAAG,IACxC,CACV,CAAC,gBAGH5I,MAAA,CAAAY,OAAA,CAAAkC,aAAA,CAACqF,QAAQ,EAAAJ,KAAA,CAAA/E,EAAA,+BACPhD,MAAA,CAAAY,OAAA,CAAAkC,aAAA,CAACsF,QAAQ,EAAAL,KAAA,CAAA/E,EAAA,kBAAE2F,QAAmB,CAAC,EAC9B,IAAAU,eAAM,EAACT,MAAM,CAAC,gBAAG5I,MAAA,CAAAY,OAAA,CAAAkC,aAAA,CAACuF,OAAO,EAAAN,KAAA,CAAA/E,EAAA,iBAAE4F,MAAgB,CAAC,GAAG,IACxC,CAET,CACA,CAAC;EAEhB;AACF;AAEA,MAAMhG,WAAW,SAASC,QAAQ,CAAC;AAKlC,IAAAlC,gBAAA,CAAAC,OAAA,EALKgC,WAAW,kBACO;EACpBD,IAAI,EAAE,SAAS;EACfP,QAAQ,EAAE;AACZ,CAAC;AAGH,MAAMmH,qBAAqB,GAAG,IAAAC,qBAAe,EAACjJ,yBAAyB,CAA+D;AAAC,IAAAkJ,QAAA,GAAAC,OAAA,CAAA9I,OAAA,GAExH2I,qBAAqB","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"NoticeBubble.js","names":["_core","require","_baseComponents","_button","_interopRequireDefault","_i18nEnhance","_fire","_getFocusableIn","_isNode","_ref7","_ThemeProvider","_useFocusLock","_useCssVariable","_zIndexStacking","_m","_react","_NoticeBubbleManager","_intergalacticDynamicLocales","_utils","style","sstyled","insert","NoticeBubbleContainerRoot","Component","constructor","args","_defineProperty2","default","notices","infos","warnings","_unsubscribe","setState","forceUpdate","componentDidMount","asProps","manager","addListener","handleChange","render","_ref","_ref3","SNoticeBubble","Box","SNoticeAriaLiveWrapper","Children","styles","disablePortal","getI18nText","ref","parentZIndexStacking","duration","containerNode","state","map","notice","_ref2","SView","type","ViewWarning","ViewInfo","createElement","PortalForNoticeItem","cn","uid","filter","ZIndexStackingContextProvider","Portal","assignProps","_ref4","_ref5","i18nEnhance","localizedMessages","contextThemeEnhance","zIndexStackingEnhance","cssVariableEnhance","variable","fallback","v","Number","parseInt","prop","i18n","locale","FocusLock","React","forwardRef","props","outerRef","focusLock","other","innerRef","useRef","useFocusLock","useForkRef","Flex","_extends2","showContent","setShowContent","useState","useEffect","setTimeout","tag","Tag","otherProps","designToken","nodeToMount","createRef","e","fire","clearTimer","key","handleClose","timer","pause","resume","event","paused","rect","current","getBoundingClientRect","mouseInRect","clientX","left","right","clientY","top","bottom","Timer","document","body","addEventListener","handleBodyMouseMove","noticeElement","focusableNodes","getFocusableIn","node","closeButtonRef","length","setFocus","componentWillUnmount","removeEventListener","clear","_ref6","SBubble","SDismiss","Button","SContent","SMessage","SAction","SIcon","visible","initialAnimation","animationDuration","icon","children","action","Animation","handleMouseEnter","handleMouseLeave","handleKeydown","undefined","Addon","CloseIcon","color","isNode","Fragment","NoticeBubbleContainer","createComponent","_default","exports"],"sources":["../../src/NoticeBubble.tsx"],"sourcesContent":["import { Animation, Box, Flex, Portal } from '@semcore/base-components';\nimport Button from '@semcore/button';\nimport { createComponent, Component, sstyled, Root } from '@semcore/core';\nimport type { Intergalactic } from '@semcore/core';\nimport type { WithI18nEnhanceProps } from '@semcore/core/lib/utils/enhances/i18nEnhance';\nimport i18nEnhance from '@semcore/core/lib/utils/enhances/i18nEnhance';\nimport fire from '@semcore/core/lib/utils/fire';\nimport { getFocusableIn } from '@semcore/core/lib/utils/focus-lock/getFocusableIn';\nimport isNode from '@semcore/core/lib/utils/isNode';\nimport { useForkRef } from '@semcore/core/lib/utils/ref';\nimport { contextThemeEnhance } from '@semcore/core/lib/utils/ThemeProvider';\nimport { useFocusLock, setFocus } from '@semcore/core/lib/utils/use/useFocusLock';\nimport { cssVariableEnhance } from '@semcore/core/lib/utils/useCssVariable';\nimport {\n ZIndexStackingContextProvider,\n zIndexStackingEnhance,\n} from '@semcore/core/lib/utils/zIndexStacking';\nimport CloseIcon from '@semcore/icon/Close/m';\nimport React from 'react';\n\nimport type {\n NoticeBubbleContainerDefaultProps,\n NoticeBubbleContainerProps,\n NoticeBubbleViewItemProps,\n} from './NoticeBubble.type';\nimport type { NoticeItem } from './NoticeBubbleManager';\nimport manager from './NoticeBubbleManager';\nimport style from './style/notice-bubble.shadow.css';\nimport { localizedMessages } from './translations/__intergalactic-dynamic-locales';\nimport { Timer } from './utils';\n\ntype State = {\n notices: NoticeItem[];\n infos: NoticeItem[];\n warnings: NoticeItem[];\n};\n\nclass NoticeBubbleContainerRoot extends Component<\n NoticeBubbleContainerProps,\n typeof NoticeBubbleContainerRoot.enhance,\n {},\n WithI18nEnhanceProps,\n State,\n NoticeBubbleContainerDefaultProps\n> {\n static displayName = 'NoticeBubbleContainer';\n static style = style;\n static enhance = [\n i18nEnhance(localizedMessages),\n contextThemeEnhance(),\n zIndexStackingEnhance('z-index-notice-bubble'),\n cssVariableEnhance<'duration', number, number>({\n variable: '--intergalactic-duration-popper',\n fallback: 200,\n map: (v: string) => Number.parseInt(v, 10),\n prop: 'duration',\n }),\n ] as const;\n\n static defaultProps = {\n manager,\n i18n: localizedMessages,\n locale: 'en',\n } as const;\n\n _unsubscribe: (() => void) | null = null;\n\n state: State = {\n notices: [],\n infos: [],\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: NoticeItem[]) => {\n this.setState({ notices });\n this.forceUpdate(); // need this, because somehow this component doesn't rerender event if the notices are different\n };\n\n render() {\n const SNoticeBubble = Root;\n const SNoticeAriaLiveWrapper = 'div';\n const { Children, styles, disablePortal, getI18nText, ref, parentZIndexStacking, duration, containerNode } =\n this.asProps;\n const { notices } = this.state;\n\n if (containerNode) {\n return notices.map((notice) => {\n const SView = notice.type === 'warning' ? ViewWarning : ViewInfo;\n\n return sstyled(styles)(\n <PortalForNoticeItem\n key={notice.uid}\n containerNode={containerNode}\n animationDuration={duration}\n styles={styles}\n getI18nText={getI18nText}\n {...notice}\n tag={SView}\n />,\n );\n });\n }\n\n const infos = notices.filter((notice) => notice.type === 'info');\n const warnings = notices.filter((notice) => notice.type === 'warning');\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 {warnings.map((notice) => {\n const SView = ViewWarning;\n return sstyled(styles)(\n <SView\n key={notice.uid}\n animationDuration={duration}\n styles={styles}\n getI18nText={getI18nText}\n {...notice}\n />,\n );\n })}\n <SNoticeAriaLiveWrapper aria-live='polite'>\n {infos.map((notice) => {\n const SView = ViewInfo;\n return sstyled(styles)(\n <SView\n key={notice.uid}\n animationDuration={duration}\n styles={styles}\n getI18nText={getI18nText}\n {...notice}\n />,\n );\n })}\n </SNoticeAriaLiveWrapper>\n </SNoticeBubble>\n </Portal>\n </ZIndexStackingContextProvider>,\n );\n }\n}\n\nconst FocusLock = React.forwardRef((props: any, outerRef: React.ForwardedRef<HTMLDivElement>) => {\n const { focusLock, ...other } = props;\n const innerRef = React.useRef<HTMLDivElement | null>(null);\n useFocusLock(innerRef, false, 'auto', !focusLock, true);\n const ref = useForkRef(outerRef, innerRef);\n\n return <Flex ref={ref} {...other} />;\n});\n\nconst PortalForNoticeItem = (props: Intergalactic.InternalTypings.EfficientOmit<NoticeBubbleViewItemProps, 'tag'> & { containerNode: HTMLElement; tag: typeof ViewInfo }) => {\n const [showContent, setShowContent] = React.useState(false);\n\n // Show content for info notice in previously mounted node with aria-live polite\n React.useEffect(() => {\n setTimeout(() => {\n setShowContent(true);\n }, 200);\n }, []);\n\n const SNoticeAriaLiveWrapper = 'div';\n const { tag: Tag, ...otherProps } = props;\n\n if (otherProps.type === 'info') {\n return (\n <ZIndexStackingContextProvider designToken='z-index-notice-bubble'>\n <Portal nodeToMount={otherProps.containerNode}>\n <SNoticeAriaLiveWrapper aria-live='polite'>\n {showContent && <Tag {...otherProps} />}\n </SNoticeAriaLiveWrapper>\n </Portal>\n </ZIndexStackingContextProvider>\n );\n }\n\n return (\n <ZIndexStackingContextProvider designToken='z-index-notice-bubble'>\n <Portal nodeToMount={otherProps.containerNode}>\n <Tag {...otherProps} />\n </Portal>\n </ZIndexStackingContextProvider>\n );\n};\n\nclass ViewInfo extends Component<NoticeBubbleViewItemProps> {\n timer: Timer | null = null;\n ref = React.createRef<HTMLDivElement>();\n closeButtonRef = React.createRef<HTMLButtonElement>();\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 const noticeElement = this.ref.current;\n\n if (noticeElement) {\n const focusableNodes = getFocusableIn(noticeElement).filter(\n (node) => node !== this.closeButtonRef.current,\n );\n\n if (focusableNodes.length > 0) {\n setTimeout(() => setFocus(noticeElement), 0);\n }\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: React.SyntheticEvent) => {\n // because it might be called not only from the close icon click\n fire(this, 'onClose', e);\n this.clearTimer();\n };\n\n handleKeydown = (e: React.KeyboardEvent) => {\n if (e.key === 'Escape') {\n this.handleClose(e);\n }\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: MouseEvent) => {\n if (!this.timer?.paused) return;\n const rect = this.ref.current?.getBoundingClientRect();\n if (!rect) return;\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 = Button;\n const SContent = Flex;\n const SMessage = 'div';\n const SAction = 'div';\n const SIcon = Flex;\n const {\n styles,\n getI18nText,\n visible,\n type,\n initialAnimation,\n animationDuration,\n icon,\n children,\n action,\n focusLock,\n } = this.props;\n\n return sstyled(styles)(\n <Animation\n initialAnimation={initialAnimation}\n visible={visible}\n duration={animationDuration}\n // @ts-ignore\n keyframes={[styles['@enter'], styles['@exit']]}\n >\n <SBubble\n type={type}\n ref={this.ref}\n onMouseEnter={this.handleMouseEnter}\n onMouseLeave={this.handleMouseLeave}\n onKeyDown={this.handleKeydown}\n role={type === 'warning' ? 'alert' : undefined}\n focusLock={focusLock}\n >\n <SDismiss\n aria-haspopup={undefined}\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 ref={this.closeButtonRef}\n data-hide-focus-hover-popper='true'\n >\n <Button.Addon tag={CloseIcon} color='icon-primary-invert' />\n </SDismiss>\n\n {isNode(icon)\n ? (\n <>\n <SIcon>{icon}</SIcon>\n <SContent>\n <SMessage>{children}</SMessage>\n {isNode(action) ? <SAction>{action}</SAction> : null}\n </SContent>\n </>\n )\n : (\n <SContent>\n <SMessage>{children}</SMessage>\n {isNode(action) ? <SAction>{action}</SAction> : null}\n </SContent>\n )}\n </SBubble>\n </Animation>,\n );\n }\n}\n\nclass ViewWarning extends ViewInfo {\n static defaultProps = {\n type: 'warning',\n duration: 0,\n };\n}\n\n/**\n * NoticeBubble\n *\n * {@link https://developer.semrush.com/intergalactic/components/notice-bubble/notice-bubble-api/|API} | {@link https://developer.semrush.com/intergalactic/components/notice-bubble/notice-bubble-code/|Examples}\n */\nconst NoticeBubbleContainer = createComponent<\n Intergalactic.Component<'div', NoticeBubbleContainerProps>,\n typeof NoticeBubbleContainerRoot\n>(NoticeBubbleContainerRoot);\n\nexport default NoticeBubbleContainer;\n"],"mappings":";;;;;;;;;AAEA,IAAAA,KAAA,GAAAC,OAAA;AAFA,IAAAC,eAAA,GAAAD,OAAA;AACA,IAAAE,OAAA,GAAAC,sBAAA,CAAAH,OAAA;AAIA,IAAAI,YAAA,GAAAD,sBAAA,CAAAH,OAAA;AACA,IAAAK,KAAA,GAAAF,sBAAA,CAAAH,OAAA;AACA,IAAAM,eAAA,GAAAN,OAAA;AACA,IAAAO,OAAA,GAAAJ,sBAAA,CAAAH,OAAA;AACA,IAAAQ,KAAA,GAAAR,OAAA;AACA,IAAAS,cAAA,GAAAT,OAAA;AACA,IAAAU,aAAA,GAAAV,OAAA;AACA,IAAAW,eAAA,GAAAX,OAAA;AACA,IAAAY,eAAA,GAAAZ,OAAA;AAIA,IAAAa,EAAA,GAAAV,sBAAA,CAAAH,OAAA;AACA,IAAAc,MAAA,GAAAX,sBAAA,CAAAH,OAAA;AAQA,IAAAe,oBAAA,GAAAZ,sBAAA,CAAAH,OAAA;AAEA,IAAAgB,4BAAA,GAAAhB,OAAA;AACA,IAAAiB,MAAA,GAAAjB,OAAA;AAAgC;AAAA,MAAAkB,KAAA,8BAAAnB,KAAA,CAAAoB,OAAA,CAAAC,MAAA;AAAA;AAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;AAAA;AAQhC,MAAMC,yBAAyB,SAASC,eAAS,CAO/C;EAAAC,YAAA,GAAAC,IAAA;IAAA,SAAAA,IAAA;IAAA,IAAAC,gBAAA,CAAAC,OAAA,wBAqBoC,IAAI;IAA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A,eAAE2F,IAAY,CAAC,eACrB3I,MAAA,CAAAY,OAAA,CAAAkC,aAAA,CAACsF,QAAQ,EAAAJ,KAAA,CAAAhF,EAAA,+BACPhD,MAAA,CAAAY,OAAA,CAAAkC,aAAA,CAACuF,QAAQ,EAAAL,KAAA,CAAAhF,EAAA,kBAAE4F,QAAmB,CAAC,EAC9B,IAAAU,eAAM,EAACT,MAAM,CAAC,gBAAG7I,MAAA,CAAAY,OAAA,CAAAkC,aAAA,CAACwF,OAAO,EAAAN,KAAA,CAAAhF,EAAA,iBAAE6F,MAAgB,CAAC,GAAG,IACxC,CACV,CAAC,gBAGH7I,MAAA,CAAAY,OAAA,CAAAkC,aAAA,CAACsF,QAAQ,EAAAJ,KAAA,CAAAhF,EAAA,+BACPhD,MAAA,CAAAY,OAAA,CAAAkC,aAAA,CAACuF,QAAQ,EAAAL,KAAA,CAAAhF,EAAA,kBAAE4F,QAAmB,CAAC,EAC9B,IAAAU,eAAM,EAACT,MAAM,CAAC,gBAAG7I,MAAA,CAAAY,OAAA,CAAAkC,aAAA,CAACwF,OAAO,EAAAN,KAAA,CAAAhF,EAAA,iBAAE6F,MAAgB,CAAC,GAAG,IACxC,CAET,CACA,CAAC;EAEhB;AACF;AAEA,MAAMjG,WAAW,SAASC,QAAQ,CAAC;;AAOnC;AACA;AACA;AACA;AACA;AAJA,IAAAlC,gBAAA,CAAAC,OAAA,EAPMgC,WAAW,kBACO;EACpBD,IAAI,EAAE,SAAS;EACfP,QAAQ,EAAE;AACZ,CAAC;AAQH,MAAMoH,qBAAqB,GAAG,IAAAC,qBAAe,EAG3ClJ,yBAAyB,CAAC;AAAC,IAAAmJ,QAAA,GAAAC,OAAA,CAAA/I,OAAA,GAEd4I,qBAAqB","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NoticeBubble.type.js","names":[],"sources":["../../src/NoticeBubble.type.ts"],"sourcesContent":["import type { PortalProps, BoxProps } from '@semcore/base-components';\nimport type { Intergalactic } from '@semcore/core';\nimport type { useI18n } from '@semcore/core/lib/utils/enhances/WithI18n';\nimport type { RefObject } from 'react';\n\n/**\n * @deprecated. Pass noticeBubbleContainer property from window.sm2.getNoticeBubbleContainer()\n */\nexport type NoticeBubbleContainerPortalProps = PortalProps;\n\nexport type NoticeBubbleContainerProps = BoxProps &\n NoticeBubbleContainerPortalProps & {\n /** Ref to mount bubbles in. You should use element form window.sm2.getNoticeBubbleContainer() */\n containerNode?: HTMLElement | null;\n /** Manager copy */\n manager?: NoticeBubbleManagerClass;\n /** Specifies the locale for i18n support */\n locale?: string;\n };\n\nexport type NoticeBubbleViewItemProps = NoticeBubbleProps & {\n containerNode?: HTMLElement;\n animationDuration: number;\n getI18nText: ReturnType<typeof useI18n>;\n styles: React.DetailedHTMLProps<React.StyleHTMLAttributes<HTMLStyleElement>, HTMLStyleElement> | undefined;\n};\n\nexport type NoticeBubbleProps = BoxProps & {\n /** Notice type */\n type?: 'info' | 'warning';\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 * 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?: NoticeBubbleManagerClass;\n icon?: React.ReactElement;\n};\n\nexport type NoticeBubbleInfoProps = NoticeBubbleProps & {\n readonly type?: 'info';\n};\n\nexport type NoticeBubbleWarningProps = NoticeBubbleProps & {\n readonly type?: 'warning';\n};\n\nexport type AddedNoticeMeta = {\n uid: number;\n update: (props: NoticeBubbleInfoProps | NoticeBubbleWarningProps) => Promise<AddedNoticeMeta>;\n remove: () => boolean;\n ref: RefObject<HTMLElement>;\n};\n\nexport type NoticeBubbleManagerClass = {\n /**\n * Creates and shows a notice.\n * */\n add: (props: NoticeBubbleInfoProps | NoticeBubbleWarningProps) => AddedNoticeMeta;\n /**\n * Removes notice by uid.\n * */\n remove: (uid: number) => boolean;\n /**\n * Replace notice by uid.\n */\n replace: (uid: number, props: NoticeBubbleInfoProps | NoticeBubbleWarningProps) => void;\n /**\n * Replace last notice (if it is existing)\n */\n replaceLast: (props: NoticeBubbleInfoProps | NoticeBubbleWarningProps) => void;\n};\n\nexport declare const NoticeBubbleContainer: Intergalactic.Component<\n 'div',\n NoticeBubbleContainerProps\n>;\n"],"mappings":"","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"NoticeBubble.type.js","names":[],"sources":["../../src/NoticeBubble.type.ts"],"sourcesContent":["import type { PortalProps, BoxProps } from '@semcore/base-components';\nimport type { Intergalactic } from '@semcore/core';\nimport type { useI18n } from '@semcore/core/lib/utils/enhances/WithI18n';\nimport type { RefObject } from 'react';\n\nimport type { NoticeBubbleManager, NoticeItem } from './NoticeBubbleManager';\nimport type { LocalizedMessages } from './translations/__intergalactic-dynamic-locales';\n\n/**\n * @deprecated. Pass noticeBubbleContainer property from window.sm2.getNoticeBubbleContainer()\n */\nexport type NoticeBubbleContainerPortalProps = PortalProps;\n\nexport type NoticeBubbleContainerProps = BoxProps &\n NoticeBubbleContainerPortalProps & {\n /** Ref to mount bubbles in. You should use element form window.sm2.getNoticeBubbleContainer() */\n containerNode?: HTMLElement | null;\n /** Manager copy */\n manager?: NoticeBubbleManagerClass;\n /** Specifies the locale for i18n support */\n locale?: string;\n };\n\nexport type NoticeBubbleContainerDefaultProps = {\n manager: NoticeBubbleManagerClass;\n i18n: LocalizedMessages;\n locale: 'en';\n};\n\nexport type NoticeBubbleViewItemProps = NoticeBubbleProps & {\n containerNode?: HTMLElement;\n animationDuration: number;\n getI18nText: ReturnType<typeof useI18n>;\n styles: React.DetailedHTMLProps<React.StyleHTMLAttributes<HTMLStyleElement>, HTMLStyleElement> | undefined;\n};\n\nexport type NoticeBubbleProps = BoxProps & {\n /** Notice type */\n type?: 'info' | 'warning';\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 * 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?: NoticeBubbleManagerClass;\n icon?: React.ReactElement;\n};\n\nexport type NoticeBubbleInfoProps = NoticeBubbleProps & {\n readonly type?: 'info';\n};\n\nexport type NoticeBubbleWarningProps = NoticeBubbleProps & {\n readonly type?: 'warning';\n};\n\nexport type AddedNoticeMeta = {\n uid: number;\n update: (props: NoticeBubbleInfoProps | NoticeBubbleWarningProps) => Promise<AddedNoticeMeta>;\n remove: () => boolean;\n ref: RefObject<HTMLElement>;\n};\n\nexport type NoticeBubbleManagerClass = {\n /**\n * Creates and shows a notice.\n * */\n add: (props: NoticeBubbleInfoProps | NoticeBubbleWarningProps) => AddedNoticeMeta;\n /**\n * Removes notice by uid.\n * */\n remove: (uid: number) => boolean;\n /**\n * Replace notice by uid.\n */\n replace: (uid: number, props: NoticeBubbleInfoProps | NoticeBubbleWarningProps) => void;\n /**\n * Replace last notice (if it is existing)\n */\n replaceLast: (props: NoticeBubbleInfoProps | NoticeBubbleWarningProps) => void;\n /** Add change listener */\n addListener: (fn: (items: NoticeItem[]) => void) => (() => void);\n};\n\nexport declare const NoticeBubbleContainer: Intergalactic.Component<\n 'div',\n NoticeBubbleContainerProps\n>;\n"],"mappings":"","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NoticeBubbleManager.js","names":["_assignProps","require","_eventEmitter","_interopRequireDefault","_react","EVENT_NAME","NoticeBubbleManager","constructor","_defineProperty2","default","EventEmitter","addListener","fn","emitter","subscribe","emit","items","add","props","uid","counter","ref","React","createRef","item","type","visible","
|
|
1
|
+
{"version":3,"file":"NoticeBubbleManager.js","names":["_assignProps","require","_eventEmitter","_interopRequireDefault","_react","EVENT_NAME","NoticeBubbleManager","constructor","_defineProperty2","default","EventEmitter","addListener","fn","emitter","subscribe","emit","items","add","props","uid","counter","ref","React","createRef","item","type","visible","forwardRef","onClose","callAllEventHandlers","remove","push","update","replace","bind","Promise","resolve","setTimeout","replaceLast","length","find","filter","exports","noticeBubbleDefaultManager","_default"],"sources":["../../src/NoticeBubbleManager.ts"],"sourcesContent":["import { callAllEventHandlers } from '@semcore/core/lib/utils/assignProps';\nimport EventEmitter from '@semcore/core/lib/utils/eventEmitter';\nimport type { RefObject } from 'react';\nimport React from 'react';\n\nimport type {\n NoticeBubbleManagerClass,\n NoticeBubbleInfoProps,\n NoticeBubbleWarningProps,\n AddedNoticeMeta,\n} from './NoticeBubble.type';\n\nconst EVENT_NAME = 'CHANGE';\n\nexport type NoticeItem = (NoticeBubbleInfoProps | NoticeBubbleWarningProps) & {\n uid: number;\n visible: boolean;\n forwardRef: RefObject<HTMLElement>;\n onClose: () => void;\n};\n\nclass NoticeBubbleManager implements NoticeBubbleManagerClass {\n private items: NoticeItem[] = [];\n private emitter = new EventEmitter();\n private counter = 0;\n\n public addListener(fn: (items: NoticeItem[]) => void): () => void {\n return this.emitter.subscribe(EVENT_NAME, fn);\n }\n\n private emit() {\n this.emitter.emit(EVENT_NAME, this.items);\n }\n\n public add(props: NoticeBubbleInfoProps | NoticeBubbleWarningProps): AddedNoticeMeta {\n const uid = this.counter++;\n const ref = React.createRef<HTMLElement>();\n\n const item = {\n type: 'info',\n uid,\n visible: true,\n forwardRef: ref,\n ...props,\n onClose: callAllEventHandlers(props.onClose, () => {\n this.remove(uid);\n }),\n } as const;\n this.items.push(item);\n this.emit();\n return {\n uid,\n update: this.replace.bind(this, uid),\n remove: this.remove.bind(this, uid),\n ref,\n };\n }\n\n public replace(uid: number, props: NoticeBubbleInfoProps | NoticeBubbleWarningProps): Promise<AddedNoticeMeta> {\n this.remove(uid);\n\n return new Promise((resolve) => {\n setTimeout(() => {\n resolve(this.add(props));\n }, 300);\n });\n }\n\n public replaceLast(props: NoticeBubbleInfoProps | NoticeBubbleWarningProps): Promise<AddedNoticeMeta> {\n const item = this.items[this.items.length - 1];\n\n if (item?.visible) {\n this.remove(this.counter - 1);\n }\n\n return new Promise((resolve) => {\n setTimeout(() => {\n resolve(this.add(props));\n }, 300);\n });\n }\n\n public remove(uid: number): boolean {\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,IAAAA,YAAA,GAAAC,OAAA;AACA,IAAAC,aAAA,GAAAC,sBAAA,CAAAF,OAAA;AAEA,IAAAG,MAAA,GAAAD,sBAAA,CAAAF,OAAA;AASA,MAAMI,UAAU,GAAG,QAAQ;AAS3B,MAAMC,mBAAmB,CAAqC;EAAAC,YAAA;IAAA,IAAAC,gBAAA,CAAAC,OAAA,iBAC9B,EAAE;IAAA,IAAAD,gBAAA,CAAAC,OAAA,mBACd,IAAIC,qBAAY,CAAC,CAAC;IAAA,IAAAF,gBAAA,CAAAC,OAAA,mBAClB,CAAC;EAAA;EAEZE,WAAWA,CAACC,EAAiC,EAAc;IAChE,OAAO,IAAI,CAACC,OAAO,CAACC,SAAS,CAACT,UAAU,EAAEO,EAAE,CAAC;EAC/C;EAEQG,IAAIA,CAAA,E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E,OAAO,EAAE;MACjB,IAAI,CAACI,MAAM,CAAC,IAAI,CAACV,OAAO,GAAG,CAAC,CAAC;IAC/B;IAEA,OAAO,IAAIe,OAAO,CAAEC,OAAO,IAAK;MAC9BC,UAAU,CAAC,MAAM;QACfD,OAAO,CAAC,IAAI,CAACnB,GAAG,CAACC,KAAK,CAAC,CAAC;MAC1B,CAAC,EAAE,GAAG,CAAC;IACT,CAAC,CAAC;EACJ;EAEOY,MAAMA,CAACX,GAAW,EAAW;IAClC,MAAMK,IAAI,GAAG,IAAI,CAACR,KAAK,CAACwB,IAAI,CAAEhB,IAAI,IAAKA,IAAI,CAACL,GAAG,KAAKA,GAAG,CAAC;IACxD,IAAIK,IAAI,EAAE;MACRA,IAAI,CAACE,OAAO,GAAG,KAAK;MACpBW,UAAU,CAAC,MAAM;QACf,IAAI,CAACrB,KAAK,GAAG,IAAI,CAACA,KAAK,CAACyB,MAAM,CAAEjB,IAAI,IAAKA,IAAI,CAACL,GAAG,KAAKA,GAAG,CAAC;QAC1D,IAAI,CAACJ,IAAI,CAAC,CAAC;MACb,CAAC,EAAE,IAAI,CAAC;MACR,IAAI,CAACA,IAAI,CAAC,CAAC;MACX,OAAO,IAAI;IACb;IACA,OAAO,KAAK;EACd;AACF;AAAC2B,OAAA,CAAApC,mBAAA,GAAAA,mBAAA;AAED,MAAMqC,0BAA0B,GAAG,IAAIrC,mBAAmB,CAAC,CAAC;AAAC,IAAAsC,QAAA,GAAAF,OAAA,CAAAjC,OAAA,GAG9CkC,0BAA0B","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"__intergalactic-dynamic-locales.js","names":["_de","_interopRequireDefault","require","_en","_es","_fr","_it","_ja","_ko","_nl","_pl","_pt","_sv","_tr","_vi","_zh","localizedMessages","exports","de","en","es","fr","it","ja","ko","nl","pt","tr","vi","zh","pl","sv"],"sources":["../../../src/translations/__intergalactic-dynamic-locales.ts"],"sourcesContent":["import de from './de.json';\nimport en from './en.json';\nimport es from './es.json';\nimport fr from './fr.json';\nimport it from './it.json';\nimport ja from './ja.json';\nimport ko from './ko.json';\nimport nl from './nl.json';\nimport pl from './pl.json';\nimport pt from './pt.json';\nimport sv from './sv.json';\nimport tr from './tr.json';\nimport vi from './vi.json';\nimport zh from './zh.json';\n\nexport const localizedMessages = {\n de,\n en,\n es,\n fr,\n it,\n ja,\n ko,\n nl,\n pt,\n tr,\n vi,\n zh,\n pl,\n sv,\n};\n"],"mappings":";;;;;;;AAAA,IAAAA,GAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,GAAA,GAAAF,sBAAA,CAAAC,OAAA;AACA,IAAAE,GAAA,GAAAH,sBAAA,CAAAC,OAAA;AACA,IAAAG,GAAA,GAAAJ,sBAAA,CAAAC,OAAA;AACA,IAAAI,GAAA,GAAAL,sBAAA,CAAAC,OAAA;AACA,IAAAK,GAAA,GAAAN,sBAAA,CAAAC,OAAA;AACA,IAAAM,GAAA,GAAAP,sBAAA,CAAAC,OAAA;AACA,IAAAO,GAAA,GAAAR,sBAAA,CAAAC,OAAA;AACA,IAAAQ,GAAA,GAAAT,sBAAA,CAAAC,OAAA;AACA,IAAAS,GAAA,GAAAV,sBAAA,CAAAC,OAAA;AACA,IAAAU,GAAA,GAAAX,sBAAA,CAAAC,OAAA;AACA,IAAAW,GAAA,GAAAZ,sBAAA,CAAAC,OAAA;AACA,IAAAY,GAAA,GAAAb,sBAAA,CAAAC,OAAA;AACA,IAAAa,GAAA,GAAAd,sBAAA,CAAAC,OAAA;AAEO,MAAMc,iBAAiB,GAAAC,OAAA,CAAAD,iBAAA,GAAG;EAC/BE,EAAE,EAAFA,WAAE;EACFC,EAAE,EAAFA,WAAE;EACFC,EAAE,EAAFA,WAAE;EACFC,EAAE,EAAFA,WAAE;EACFC,EAAE,EAAFA,WAAE;EACFC,EAAE,EAAFA,WAAE;EACFC,EAAE,EAAFA,WAAE;EACFC,EAAE,EAAFA,WAAE;EACFC,EAAE,EAAFA,WAAE;EACFC,EAAE,EAAFA,WAAE;EACFC,EAAE,EAAFA,WAAE;EACFC,EAAE,EAAFA,WAAE;EACFC,EAAE,EAAFA,WAAE;EACFC,EAAE,EAAFA;AACF,CAAC","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"__intergalactic-dynamic-locales.js","names":["_de","_interopRequireDefault","require","_en","_es","_fr","_it","_ja","_ko","_nl","_pl","_pt","_sv","_tr","_vi","_zh","localizedMessages","exports","de","en","es","fr","it","ja","ko","nl","pt","tr","vi","zh","pl","sv"],"sources":["../../../src/translations/__intergalactic-dynamic-locales.ts"],"sourcesContent":["import de from './de.json';\nimport en from './en.json';\nimport es from './es.json';\nimport fr from './fr.json';\nimport it from './it.json';\nimport ja from './ja.json';\nimport ko from './ko.json';\nimport nl from './nl.json';\nimport pl from './pl.json';\nimport pt from './pt.json';\nimport sv from './sv.json';\nimport tr from './tr.json';\nimport vi from './vi.json';\nimport zh from './zh.json';\n\nexport const localizedMessages = {\n de,\n en,\n es,\n fr,\n it,\n ja,\n ko,\n nl,\n pt,\n tr,\n vi,\n zh,\n pl,\n sv,\n};\n\nexport type LocalizedMessages = typeof localizedMessages;\n"],"mappings":";;;;;;;AAAA,IAAAA,GAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,GAAA,GAAAF,sBAAA,CAAAC,OAAA;AACA,IAAAE,GAAA,GAAAH,sBAAA,CAAAC,OAAA;AACA,IAAAG,GAAA,GAAAJ,sBAAA,CAAAC,OAAA;AACA,IAAAI,GAAA,GAAAL,sBAAA,CAAAC,OAAA;AACA,IAAAK,GAAA,GAAAN,sBAAA,CAAAC,OAAA;AACA,IAAAM,GAAA,GAAAP,sBAAA,CAAAC,OAAA;AACA,IAAAO,GAAA,GAAAR,sBAAA,CAAAC,OAAA;AACA,IAAAQ,GAAA,GAAAT,sBAAA,CAAAC,OAAA;AACA,IAAAS,GAAA,GAAAV,sBAAA,CAAAC,OAAA;AACA,IAAAU,GAAA,GAAAX,sBAAA,CAAAC,OAAA;AACA,IAAAW,GAAA,GAAAZ,sBAAA,CAAAC,OAAA;AACA,IAAAY,GAAA,GAAAb,sBAAA,CAAAC,OAAA;AACA,IAAAa,GAAA,GAAAd,sBAAA,CAAAC,OAAA;AAEO,MAAMc,iBAAiB,GAAAC,OAAA,CAAAD,iBAAA,GAAG;EAC/BE,EAAE,EAAFA,WAAE;EACFC,EAAE,EAAFA,WAAE;EACFC,EAAE,EAAFA,WAAE;EACFC,EAAE,EAAFA,WAAE;EACFC,EAAE,EAAFA,WAAE;EACFC,EAAE,EAAFA,WAAE;EACFC,EAAE,EAAFA,WAAE;EACFC,EAAE,EAAFA,WAAE;EACFC,EAAE,EAAFA,WAAE;EACFC,EAAE,EAAFA,WAAE;EACFC,EAAE,EAAFA,WAAE;EACFC,EAAE,EAAFA,WAAE;EACFC,EAAE,EAAFA,WAAE;EACFC,EAAE,EAAFA;AACF,CAAC","ignoreList":[]}
|
package/lib/es6/NoticeBubble.js
CHANGED
|
@@ -18,23 +18,23 @@ import CloseIcon from '@semcore/icon/Close/m';
|
|
|
18
18
|
import React from 'react';
|
|
19
19
|
import manager from './NoticeBubbleManager';
|
|
20
20
|
/*!__reshadow-styles__:"./style/notice-bubble.shadow.css"*/
|
|
21
|
-
const style = (/*__reshadow_css_start__*/_sstyled.insert(/*__inner_css_start__*/"
|
|
21
|
+
const style = (/*__reshadow_css_start__*/_sstyled.insert(/*__inner_css_start__*/".___SBubble_16a8l_gg_,.___SView_16a8l_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,#fefffff2);gap:var(--intergalactic-spacing-2x,8px)}.___SBubble_16a8l_gg_._type_info_16a8l_gg_,.___SView_16a8l_gg_._type_info_16a8l_gg_{background:var(--intergalactic-bg-primary-invert,#1a1e1a)}.___SBubble_16a8l_gg_._type_warning_16a8l_gg_,.___SView_16a8l_gg_._type_warning_16a8l_gg_{background:var(--intergalactic-bg-primary-critical,#f73740)}.___SContent_16a8l_gg_{flex-direction:column;gap:var(--intergalactic-spacing-2x,8px);flex:1}.___SMessage_16a8l_gg_{font-size:var(--intergalactic-fs-200,14px);line-height:var(--intergalactic-lh-200,142%)}.___SDismiss_16a8l_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:#0000}.___SDismiss_16a8l_gg_.__use_16a8l_gg_{padding:0 1px}.___SIcon_16a8l_gg_{justify-content:center;align-items:center;height:var(--intergalactic-spacing-5x,20px)}.___SNoticeBubble_16a8l_gg_{width:300px;position:fixed;right:var(--intergalactic-spacing-3x,12px);top:var(--intergalactic-spacing-3x,12px)}@media (max-width:767px){.___SNoticeBubble_16a8l_gg_{width:calc(100% - var(--intergalactic-spacing-6x, 24px))}}.___SNoticeBubble_16a8l_gg_.__disablePortal_16a8l_gg_{position:sticky;margin-left:auto;height:0}.___SMessage_16a8l_gg_ a{color:var(--intergalactic-text-link-invert,#88acfd)}.___SNoticeAriaLiveWrapper_16a8l_gg_{display:contents}@keyframes enter_16a8l{0%{transform:translate(100%);max-height:0;overflow:hidden}to{transform:translate(0);max-height:100vh;overflow:hidden}}@keyframes exit_16a8l{0%{max-height:100vh;overflow:hidden;opacity:1}to{max-height:0;overflow:hidden;opacity:0}}", /*__inner_css_end__*/"16a8l_gg_"),
|
|
22
22
|
/*__reshadow_css_end__*/
|
|
23
23
|
{
|
|
24
|
-
"__SContent": "
|
|
25
|
-
"__SMessage": "
|
|
26
|
-
"__SDismiss": "
|
|
27
|
-
"_use": "
|
|
28
|
-
"__SIcon": "
|
|
29
|
-
"__SNoticeBubble": "
|
|
30
|
-
"_disablePortal": "
|
|
31
|
-
"__SNoticeAriaLiveWrapper": "
|
|
32
|
-
"@enter": "
|
|
33
|
-
"@exit": "
|
|
34
|
-
"__SBubble": "
|
|
35
|
-
"__SView": "
|
|
36
|
-
"_type_info": "
|
|
37
|
-
"_type_warning": "
|
|
24
|
+
"__SContent": "___SContent_16a8l_gg_",
|
|
25
|
+
"__SMessage": "___SMessage_16a8l_gg_",
|
|
26
|
+
"__SDismiss": "___SDismiss_16a8l_gg_",
|
|
27
|
+
"_use": "__use_16a8l_gg_",
|
|
28
|
+
"__SIcon": "___SIcon_16a8l_gg_",
|
|
29
|
+
"__SNoticeBubble": "___SNoticeBubble_16a8l_gg_",
|
|
30
|
+
"_disablePortal": "__disablePortal_16a8l_gg_",
|
|
31
|
+
"__SNoticeAriaLiveWrapper": "___SNoticeAriaLiveWrapper_16a8l_gg_",
|
|
32
|
+
"@enter": "enter_16a8l",
|
|
33
|
+
"@exit": "exit_16a8l",
|
|
34
|
+
"__SBubble": "___SBubble_16a8l_gg_",
|
|
35
|
+
"__SView": "___SView_16a8l_gg_",
|
|
36
|
+
"_type_info": "_type_info_16a8l_gg_",
|
|
37
|
+
"_type_warning": "_type_warning_16a8l_gg_"
|
|
38
38
|
});
|
|
39
39
|
import { localizedMessages } from './translations/__intergalactic-dynamic-locales';
|
|
40
40
|
import { Timer } from './utils';
|
|
@@ -86,12 +86,12 @@ class NoticeBubbleContainerRoot extends Component {
|
|
|
86
86
|
const SView = notice.type === 'warning' ? ViewWarning : ViewInfo;
|
|
87
87
|
return _ref2 = sstyled(styles), /*#__PURE__*/React.createElement(PortalForNoticeItem, _ref2.cn("PortalForNoticeItem", {
|
|
88
88
|
"key": notice.uid,
|
|
89
|
-
"tag": SView,
|
|
90
89
|
"containerNode": containerNode,
|
|
91
90
|
"animationDuration": duration,
|
|
92
91
|
"styles": styles,
|
|
93
92
|
"getI18nText": getI18nText,
|
|
94
|
-
...notice
|
|
93
|
+
...notice,
|
|
94
|
+
"tag": SView
|
|
95
95
|
}));
|
|
96
96
|
});
|
|
97
97
|
}
|
|
@@ -169,21 +169,24 @@ const PortalForNoticeItem = props => {
|
|
|
169
169
|
}, 200);
|
|
170
170
|
}, []);
|
|
171
171
|
const SNoticeAriaLiveWrapper = 'div';
|
|
172
|
-
const
|
|
173
|
-
|
|
172
|
+
const {
|
|
173
|
+
tag: Tag,
|
|
174
|
+
...otherProps
|
|
175
|
+
} = props;
|
|
176
|
+
if (otherProps.type === 'info') {
|
|
174
177
|
return /*#__PURE__*/React.createElement(ZIndexStackingContextProvider, {
|
|
175
178
|
designToken: "z-index-notice-bubble"
|
|
176
179
|
}, /*#__PURE__*/React.createElement(Portal, {
|
|
177
|
-
nodeToMount:
|
|
180
|
+
nodeToMount: otherProps.containerNode
|
|
178
181
|
}, /*#__PURE__*/React.createElement(SNoticeAriaLiveWrapper, {
|
|
179
182
|
"aria-live": "polite"
|
|
180
|
-
}, showContent && /*#__PURE__*/React.createElement(Tag,
|
|
183
|
+
}, showContent && /*#__PURE__*/React.createElement(Tag, otherProps))));
|
|
181
184
|
}
|
|
182
185
|
return /*#__PURE__*/React.createElement(ZIndexStackingContextProvider, {
|
|
183
186
|
designToken: "z-index-notice-bubble"
|
|
184
187
|
}, /*#__PURE__*/React.createElement(Portal, {
|
|
185
|
-
nodeToMount:
|
|
186
|
-
}, /*#__PURE__*/React.createElement(Tag,
|
|
188
|
+
nodeToMount: otherProps.containerNode
|
|
189
|
+
}, /*#__PURE__*/React.createElement(Tag, otherProps)));
|
|
187
190
|
};
|
|
188
191
|
class ViewInfo extends Component {
|
|
189
192
|
constructor(...args) {
|
|
@@ -266,7 +269,7 @@ class ViewInfo extends Component {
|
|
|
266
269
|
} = this.props;
|
|
267
270
|
return _ref6 = sstyled(styles), /*#__PURE__*/React.createElement(Animation, _ref6.cn("Animation", {
|
|
268
271
|
"initialAnimation": initialAnimation,
|
|
269
|
-
"visible": visible
|
|
272
|
+
"visible": visible,
|
|
270
273
|
"duration": animationDuration,
|
|
271
274
|
"keyframes": [styles['@enter'], styles['@exit']]
|
|
272
275
|
}), /*#__PURE__*/React.createElement(SBubble, _ref6.cn("SBubble", {
|
|
@@ -296,6 +299,12 @@ class ViewInfo extends Component {
|
|
|
296
299
|
}
|
|
297
300
|
}
|
|
298
301
|
class ViewWarning extends ViewInfo {}
|
|
302
|
+
|
|
303
|
+
/**
|
|
304
|
+
* NoticeBubble
|
|
305
|
+
*
|
|
306
|
+
* {@link https://developer.semrush.com/intergalactic/components/notice-bubble/notice-bubble-api/|API} | {@link https://developer.semrush.com/intergalactic/components/notice-bubble/notice-bubble-code/|Examples}
|
|
307
|
+
*/
|
|
299
308
|
_defineProperty(ViewWarning, "defaultProps", {
|
|
300
309
|
type: 'warning',
|
|
301
310
|
duration: 0
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NoticeBubble.js","names":["Animation","Box","Flex","Portal","Button","createComponent","Component","sstyled","Root","i18nEnhance","fire","getFocusableIn","isNode","useForkRef","contextThemeEnhance","useFocusLock","setFocus","cssVariableEnhance","ZIndexStackingContextProvider","zIndexStackingEnhance","CloseIcon","React","manager","style","_sstyled","insert","localizedMessages","Timer","NoticeBubbleContainerRoot","constructor","args","_defineProperty","notices","infos","warnings","_unsubscribe","setState","forceUpdate","componentDidMount","asProps","addListener","handleChange","render","_ref","_ref3","SNoticeBubble","SNoticeAriaLiveWrapper","Children","styles","disablePortal","getI18nText","ref","parentZIndexStacking","duration","containerNode","state","map","notice","_ref2","SView","type","ViewWarning","ViewInfo","createElement","PortalForNoticeItem","cn","uid","filter","_assignProps","_ref4","_ref5","variable","fallback","v","Number","parseInt","prop","i18n","locale","FocusLock","forwardRef","props","outerRef","focusLock","other","innerRef","useRef","_extends","showContent","setShowContent","useState","useEffect","setTimeout","Tag","tag","designToken","nodeToMount","createRef","e","clearTimer","key","handleClose","timer","pause","resume","event","paused","rect","current","getBoundingClientRect","mouseInRect","clientX","left","right","clientY","top","bottom","document","body","addEventListener","handleBodyMouseMove","noticeElement","focusableNodes","node","closeButtonRef","length","componentWillUnmount","removeEventListener","clear","_ref6","SBubble","SDismiss","SContent","SMessage","SAction","SIcon","visible","initialAnimation","animationDuration","icon","children","action","handleMouseEnter","handleMouseLeave","handleKeydown","undefined","Addon","color","Fragment","NoticeBubbleContainer"],"sources":["../../src/NoticeBubble.tsx"],"sourcesContent":["import { Animation, Box, Flex, Portal } from '@semcore/base-components';\nimport Button from '@semcore/button';\nimport { createComponent, Component, sstyled, Root } from '@semcore/core';\nimport type { Intergalactic } from '@semcore/core';\nimport i18nEnhance from '@semcore/core/lib/utils/enhances/i18nEnhance';\nimport fire from '@semcore/core/lib/utils/fire';\nimport { getFocusableIn } from '@semcore/core/lib/utils/focus-lock/getFocusableIn';\nimport isNode from '@semcore/core/lib/utils/isNode';\nimport { useForkRef } from '@semcore/core/lib/utils/ref';\nimport { contextThemeEnhance } from '@semcore/core/lib/utils/ThemeProvider';\nimport { useFocusLock, setFocus } from '@semcore/core/lib/utils/use/useFocusLock';\nimport { cssVariableEnhance } from '@semcore/core/lib/utils/useCssVariable';\nimport {\n ZIndexStackingContextProvider,\n zIndexStackingEnhance,\n} from '@semcore/core/lib/utils/zIndexStacking';\nimport CloseIcon from '@semcore/icon/Close/m';\nimport React from 'react';\n\nimport type {\n NoticeBubbleContainerProps,\n NoticeBubbleViewItemProps,\n} from './NoticeBubble.type';\nimport type { NoticeItem } from './NoticeBubbleManager';\nimport manager from './NoticeBubbleManager';\nimport style from './style/notice-bubble.shadow.css';\nimport { localizedMessages } from './translations/__intergalactic-dynamic-locales';\nimport { Timer } from './utils';\n\ntype State = {\n notices: NoticeItem[];\n infos: NoticeItem[];\n warnings: NoticeItem[];\n};\n\nclass NoticeBubbleContainerRoot extends Component<NoticeBubbleContainerProps, typeof NoticeBubbleContainerRoot.enhance, {}, typeof NoticeBubbleContainerRoot.defaultProps, State> {\n static displayName = 'NoticeBubbleContainer';\n static style = style;\n static enhance = [\n i18nEnhance(localizedMessages),\n contextThemeEnhance(),\n zIndexStackingEnhance('z-index-notice-bubble'),\n cssVariableEnhance<'duration', number, number>({\n variable: '--intergalactic-duration-popper',\n fallback: 200,\n map: (v: string) => Number.parseInt(v, 10),\n prop: 'duration',\n }),\n ] as const;\n\n static defaultProps = {\n manager,\n i18n: localizedMessages,\n locale: 'en',\n } as const;\n\n _unsubscribe: (() => void) | null = null;\n\n state: State = {\n notices: [],\n infos: [],\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: NoticeItem[]) => {\n this.setState({ notices });\n this.forceUpdate(); // need this, because somehow this component doesn't rerender event if the notices are different\n };\n\n render() {\n const SNoticeBubble = Root;\n const SNoticeAriaLiveWrapper = 'div';\n const { Children, styles, disablePortal, getI18nText, ref, parentZIndexStacking, duration, containerNode } =\n this.asProps;\n const { notices } = this.state;\n\n if (containerNode) {\n return notices.map((notice) => {\n const SView = notice.type === 'warning' ? ViewWarning : ViewInfo;\n\n return sstyled(styles)(\n <PortalForNoticeItem\n key={notice.uid}\n tag={SView}\n containerNode={containerNode}\n animationDuration={duration}\n styles={styles}\n getI18nText={getI18nText}\n {...notice}\n />,\n );\n });\n }\n\n const infos = notices.filter((notice) => notice.type === 'info');\n const warnings = notices.filter((notice) => notice.type === 'warning');\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 {warnings.map((notice) => {\n const SView = ViewWarning;\n return sstyled(styles)(\n <SView\n key={notice.uid}\n animationDuration={duration}\n styles={styles}\n getI18nText={getI18nText}\n {...notice}\n />,\n );\n })}\n <SNoticeAriaLiveWrapper aria-live='polite'>\n {infos.map((notice) => {\n const SView = ViewInfo;\n return sstyled(styles)(\n <SView\n key={notice.uid}\n animationDuration={duration}\n styles={styles}\n getI18nText={getI18nText}\n {...notice}\n />,\n );\n })}\n </SNoticeAriaLiveWrapper>\n </SNoticeBubble>\n </Portal>\n </ZIndexStackingContextProvider>,\n );\n }\n}\n\nconst FocusLock = React.forwardRef((props: any, outerRef: React.ForwardedRef<HTMLDivElement>) => {\n const { focusLock, ...other } = props;\n const innerRef = React.useRef<HTMLDivElement | null>(null);\n useFocusLock(innerRef, false, 'auto', !focusLock, true);\n const ref = useForkRef(outerRef, innerRef);\n\n return <Flex ref={ref} {...other} />;\n});\n\nconst PortalForNoticeItem = (props: NoticeBubbleViewItemProps & { containerNode: HTMLElement; tag: typeof ViewInfo }) => {\n const [showContent, setShowContent] = React.useState(false);\n\n // Show content for info notice in previously mounted node with aria-live polite\n React.useEffect(() => {\n setTimeout(() => {\n setShowContent(true);\n }, 200);\n }, []);\n\n const SNoticeAriaLiveWrapper = 'div';\n const Tag = props.tag;\n\n if (props.type === 'info') {\n return (\n <ZIndexStackingContextProvider designToken='z-index-notice-bubble'>\n <Portal nodeToMount={props.containerNode}>\n <SNoticeAriaLiveWrapper aria-live='polite'>\n {showContent && <Tag {...props} />}\n </SNoticeAriaLiveWrapper>\n </Portal>\n </ZIndexStackingContextProvider>\n );\n }\n\n return (\n <ZIndexStackingContextProvider designToken='z-index-notice-bubble'>\n <Portal nodeToMount={props.containerNode}>\n <Tag {...props} />\n </Portal>\n </ZIndexStackingContextProvider>\n );\n};\n\nclass ViewInfo extends Component<NoticeBubbleViewItemProps> {\n timer: Timer | null = null;\n ref = React.createRef<HTMLDivElement>();\n closeButtonRef = React.createRef<HTMLButtonElement>();\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 const noticeElement = this.ref.current;\n\n if (noticeElement) {\n const focusableNodes = getFocusableIn(noticeElement).filter(\n (node) => node !== this.closeButtonRef.current,\n );\n\n if (focusableNodes.length > 0) {\n setTimeout(() => setFocus(noticeElement), 0);\n }\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: React.SyntheticEvent) => {\n // because it might be called not only from the close icon click\n fire(this, 'onClose', e);\n this.clearTimer();\n };\n\n handleKeydown = (e: React.KeyboardEvent) => {\n if (e.key === 'Escape') {\n this.handleClose(e);\n }\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: MouseEvent) => {\n if (!this.timer?.paused) return;\n const rect = this.ref.current?.getBoundingClientRect();\n if (!rect) return;\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 = Button;\n const SContent = Flex;\n const SMessage = 'div';\n const SAction = 'div';\n const SIcon = Flex;\n const {\n styles,\n getI18nText,\n visible,\n type,\n initialAnimation,\n animationDuration,\n icon,\n children,\n action,\n focusLock,\n } = this.props;\n\n return sstyled(styles)(\n <Animation\n initialAnimation={initialAnimation}\n visible={visible ?? true}\n duration={animationDuration}\n // @ts-ignore\n keyframes={[styles['@enter'], styles['@exit']]}\n >\n <SBubble\n type={type}\n ref={this.ref}\n onMouseEnter={this.handleMouseEnter}\n onMouseLeave={this.handleMouseLeave}\n onKeyDown={this.handleKeydown}\n role={type === 'warning' ? 'alert' : undefined}\n focusLock={focusLock}\n >\n <SDismiss\n aria-haspopup={undefined}\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 ref={this.closeButtonRef}\n data-hide-focus-hover-popper='true'\n >\n <Button.Addon tag={CloseIcon} color='icon-primary-invert' />\n </SDismiss>\n\n {isNode(icon)\n ? (\n <>\n <SIcon>{icon}</SIcon>\n <SContent>\n <SMessage>{children}</SMessage>\n {isNode(action) ? <SAction>{action}</SAction> : null}\n </SContent>\n </>\n )\n : (\n <SContent>\n <SMessage>{children}</SMessage>\n {isNode(action) ? <SAction>{action}</SAction> : null}\n </SContent>\n )}\n </SBubble>\n </Animation>,\n );\n }\n}\n\nclass ViewWarning extends ViewInfo {\n static defaultProps = {\n type: 'warning',\n duration: 0,\n };\n}\n\nconst NoticeBubbleContainer = createComponent(NoticeBubbleContainerRoot) as Intergalactic.Component<'div', NoticeBubbleContainerProps>;\n\nexport default NoticeBubbleContainer;\n"],"mappings":";;;;AAAA,SAASA,SAAS,EAAEC,GAAG,EAAEC,IAAI,EAAEC,MAAM,QAAQ,0BAA0B;AACvE,OAAOC,MAAM,MAAM,iBAAiB;AACpC,SAASC,eAAe,EAAEC,SAAS,EAAEC,OAAO,EAAEC,IAAI,QAAQ,eAAe;AAEzE,OAAOC,WAAW,MAAM,8CAA8C;AACtE,OAAOC,IAAI,MAAM,8BAA8B;AAC/C,SAASC,cAAc,QAAQ,mDAAmD;AAClF,OAAOC,MAAM,MAAM,gCAAgC;AACnD,SAASC,UAAU,QAAQ,6BAA6B;AACxD,SAASC,mBAAmB,QAAQ,uCAAuC;AAC3E,SAASC,YAAY,EAAEC,QAAQ,QAAQ,0CAA0C;AACjF,SAASC,kBAAkB,QAAQ,wCAAwC;AAC3E,SACEC,6BAA6B,EAC7BC,qBAAqB,QAChB,wCAAwC;AAC/C,OAAOC,SAAS,MAAM,uBAAuB;AAC7C,OAAOC,KAAK,MAAM,OAAO;AAOzB,OAAOC,OAAO,MAAM,uBAAuB;AAAC;AAAA,MAAAC,KAAA,8BAAAC,QAAA,CAAAC,MAAA;AAAA;AAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAA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EAAA,iBAAE4E,MAAgB,CAAC,GAAG,IACxC,CAET,CACA,CAAC;EAEhB;AACF;AAEA,MAAMhF,WAAW,SAASC,QAAQ,CAAC;AAKlC/B,eAAA,CALK8B,WAAW,kBACO;EACpBD,IAAI,EAAE,SAAS;EACfP,QAAQ,EAAE;AACZ,CAAC;AAGH,MAAMgG,qBAAqB,GAAGhJ,eAAe,CAACuB,yBAAyB,CAA+D;AAEtI,eAAeyH,qBAAqB","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"NoticeBubble.js","names":["Animation","Box","Flex","Portal","Button","createComponent","Component","sstyled","Root","i18nEnhance","fire","getFocusableIn","isNode","useForkRef","contextThemeEnhance","useFocusLock","setFocus","cssVariableEnhance","ZIndexStackingContextProvider","zIndexStackingEnhance","CloseIcon","React","manager","style","_sstyled","insert","localizedMessages","Timer","NoticeBubbleContainerRoot","constructor","args","_defineProperty","notices","infos","warnings","_unsubscribe","setState","forceUpdate","componentDidMount","asProps","addListener","handleChange","render","_ref","_ref3","SNoticeBubble","SNoticeAriaLiveWrapper","Children","styles","disablePortal","getI18nText","ref","parentZIndexStacking","duration","containerNode","state","map","notice","_ref2","SView","type","ViewWarning","ViewInfo","createElement","PortalForNoticeItem","cn","uid","filter","_assignProps","_ref4","_ref5","variable","fallback","v","Number","parseInt","prop","i18n","locale","FocusLock","forwardRef","props","outerRef","focusLock","other","innerRef","useRef","_extends","showContent","setShowContent","useState","useEffect","setTimeout","tag","Tag","otherProps","designToken","nodeToMount","createRef","e","clearTimer","key","handleClose","timer","pause","resume","event","paused","rect","current","getBoundingClientRect","mouseInRect","clientX","left","right","clientY","top","bottom","document","body","addEventListener","handleBodyMouseMove","noticeElement","focusableNodes","node","closeButtonRef","length","componentWillUnmount","removeEventListener","clear","_ref6","SBubble","SDismiss","SContent","SMessage","SAction","SIcon","visible","initialAnimation","animationDuration","icon","children","action","handleMouseEnter","handleMouseLeave","handleKeydown","undefined","Addon","color","Fragment","NoticeBubbleContainer"],"sources":["../../src/NoticeBubble.tsx"],"sourcesContent":["import { Animation, Box, Flex, Portal } from '@semcore/base-components';\nimport Button from '@semcore/button';\nimport { createComponent, Component, sstyled, Root } from '@semcore/core';\nimport type { Intergalactic } from '@semcore/core';\nimport type { WithI18nEnhanceProps } from '@semcore/core/lib/utils/enhances/i18nEnhance';\nimport i18nEnhance from '@semcore/core/lib/utils/enhances/i18nEnhance';\nimport fire from '@semcore/core/lib/utils/fire';\nimport { getFocusableIn } from '@semcore/core/lib/utils/focus-lock/getFocusableIn';\nimport isNode from '@semcore/core/lib/utils/isNode';\nimport { useForkRef } from '@semcore/core/lib/utils/ref';\nimport { contextThemeEnhance } from '@semcore/core/lib/utils/ThemeProvider';\nimport { useFocusLock, setFocus } from '@semcore/core/lib/utils/use/useFocusLock';\nimport { cssVariableEnhance } from '@semcore/core/lib/utils/useCssVariable';\nimport {\n ZIndexStackingContextProvider,\n zIndexStackingEnhance,\n} from '@semcore/core/lib/utils/zIndexStacking';\nimport CloseIcon from '@semcore/icon/Close/m';\nimport React from 'react';\n\nimport type {\n NoticeBubbleContainerDefaultProps,\n NoticeBubbleContainerProps,\n NoticeBubbleViewItemProps,\n} from './NoticeBubble.type';\nimport type { NoticeItem } from './NoticeBubbleManager';\nimport manager from './NoticeBubbleManager';\nimport style from './style/notice-bubble.shadow.css';\nimport { localizedMessages } from './translations/__intergalactic-dynamic-locales';\nimport { Timer } from './utils';\n\ntype State = {\n notices: NoticeItem[];\n infos: NoticeItem[];\n warnings: NoticeItem[];\n};\n\nclass NoticeBubbleContainerRoot extends Component<\n NoticeBubbleContainerProps,\n typeof NoticeBubbleContainerRoot.enhance,\n {},\n WithI18nEnhanceProps,\n State,\n NoticeBubbleContainerDefaultProps\n> {\n static displayName = 'NoticeBubbleContainer';\n static style = style;\n static enhance = [\n i18nEnhance(localizedMessages),\n contextThemeEnhance(),\n zIndexStackingEnhance('z-index-notice-bubble'),\n cssVariableEnhance<'duration', number, number>({\n variable: '--intergalactic-duration-popper',\n fallback: 200,\n map: (v: string) => Number.parseInt(v, 10),\n prop: 'duration',\n }),\n ] as const;\n\n static defaultProps = {\n manager,\n i18n: localizedMessages,\n locale: 'en',\n } as const;\n\n _unsubscribe: (() => void) | null = null;\n\n state: State = {\n notices: [],\n infos: [],\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: NoticeItem[]) => {\n this.setState({ notices });\n this.forceUpdate(); // need this, because somehow this component doesn't rerender event if the notices are different\n };\n\n render() {\n const SNoticeBubble = Root;\n const SNoticeAriaLiveWrapper = 'div';\n const { Children, styles, disablePortal, getI18nText, ref, parentZIndexStacking, duration, containerNode } =\n this.asProps;\n const { notices } = this.state;\n\n if (containerNode) {\n return notices.map((notice) => {\n const SView = notice.type === 'warning' ? ViewWarning : ViewInfo;\n\n return sstyled(styles)(\n <PortalForNoticeItem\n key={notice.uid}\n containerNode={containerNode}\n animationDuration={duration}\n styles={styles}\n getI18nText={getI18nText}\n {...notice}\n tag={SView}\n />,\n );\n });\n }\n\n const infos = notices.filter((notice) => notice.type === 'info');\n const warnings = notices.filter((notice) => notice.type === 'warning');\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 {warnings.map((notice) => {\n const SView = ViewWarning;\n return sstyled(styles)(\n <SView\n key={notice.uid}\n animationDuration={duration}\n styles={styles}\n getI18nText={getI18nText}\n {...notice}\n />,\n );\n })}\n <SNoticeAriaLiveWrapper aria-live='polite'>\n {infos.map((notice) => {\n const SView = ViewInfo;\n return sstyled(styles)(\n <SView\n key={notice.uid}\n animationDuration={duration}\n styles={styles}\n getI18nText={getI18nText}\n {...notice}\n />,\n );\n })}\n </SNoticeAriaLiveWrapper>\n </SNoticeBubble>\n </Portal>\n </ZIndexStackingContextProvider>,\n );\n }\n}\n\nconst FocusLock = React.forwardRef((props: any, outerRef: React.ForwardedRef<HTMLDivElement>) => {\n const { focusLock, ...other } = props;\n const innerRef = React.useRef<HTMLDivElement | null>(null);\n useFocusLock(innerRef, false, 'auto', !focusLock, true);\n const ref = useForkRef(outerRef, innerRef);\n\n return <Flex ref={ref} {...other} />;\n});\n\nconst PortalForNoticeItem = (props: Intergalactic.InternalTypings.EfficientOmit<NoticeBubbleViewItemProps, 'tag'> & { containerNode: HTMLElement; tag: typeof ViewInfo }) => {\n const [showContent, setShowContent] = React.useState(false);\n\n // Show content for info notice in previously mounted node with aria-live polite\n React.useEffect(() => {\n setTimeout(() => {\n setShowContent(true);\n }, 200);\n }, []);\n\n const SNoticeAriaLiveWrapper = 'div';\n const { tag: Tag, ...otherProps } = props;\n\n if (otherProps.type === 'info') {\n return (\n <ZIndexStackingContextProvider designToken='z-index-notice-bubble'>\n <Portal nodeToMount={otherProps.containerNode}>\n <SNoticeAriaLiveWrapper aria-live='polite'>\n {showContent && <Tag {...otherProps} />}\n </SNoticeAriaLiveWrapper>\n </Portal>\n </ZIndexStackingContextProvider>\n );\n }\n\n return (\n <ZIndexStackingContextProvider designToken='z-index-notice-bubble'>\n <Portal nodeToMount={otherProps.containerNode}>\n <Tag {...otherProps} />\n </Portal>\n </ZIndexStackingContextProvider>\n );\n};\n\nclass ViewInfo extends Component<NoticeBubbleViewItemProps> {\n timer: Timer | null = null;\n ref = React.createRef<HTMLDivElement>();\n closeButtonRef = React.createRef<HTMLButtonElement>();\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 const noticeElement = this.ref.current;\n\n if (noticeElement) {\n const focusableNodes = getFocusableIn(noticeElement).filter(\n (node) => node !== this.closeButtonRef.current,\n );\n\n if (focusableNodes.length > 0) {\n setTimeout(() => setFocus(noticeElement), 0);\n }\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: React.SyntheticEvent) => {\n // because it might be called not only from the close icon click\n fire(this, 'onClose', e);\n this.clearTimer();\n };\n\n handleKeydown = (e: React.KeyboardEvent) => {\n if (e.key === 'Escape') {\n this.handleClose(e);\n }\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: MouseEvent) => {\n if (!this.timer?.paused) return;\n const rect = this.ref.current?.getBoundingClientRect();\n if (!rect) return;\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 = Button;\n const SContent = Flex;\n const SMessage = 'div';\n const SAction = 'div';\n const SIcon = Flex;\n const {\n styles,\n getI18nText,\n visible,\n type,\n initialAnimation,\n animationDuration,\n icon,\n children,\n action,\n focusLock,\n } = this.props;\n\n return sstyled(styles)(\n <Animation\n initialAnimation={initialAnimation}\n visible={visible}\n duration={animationDuration}\n // @ts-ignore\n keyframes={[styles['@enter'], styles['@exit']]}\n >\n <SBubble\n type={type}\n ref={this.ref}\n onMouseEnter={this.handleMouseEnter}\n onMouseLeave={this.handleMouseLeave}\n onKeyDown={this.handleKeydown}\n role={type === 'warning' ? 'alert' : undefined}\n focusLock={focusLock}\n >\n <SDismiss\n aria-haspopup={undefined}\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 ref={this.closeButtonRef}\n data-hide-focus-hover-popper='true'\n >\n <Button.Addon tag={CloseIcon} color='icon-primary-invert' />\n </SDismiss>\n\n {isNode(icon)\n ? (\n <>\n <SIcon>{icon}</SIcon>\n <SContent>\n <SMessage>{children}</SMessage>\n {isNode(action) ? <SAction>{action}</SAction> : null}\n </SContent>\n </>\n )\n : (\n <SContent>\n <SMessage>{children}</SMessage>\n {isNode(action) ? <SAction>{action}</SAction> : null}\n </SContent>\n )}\n </SBubble>\n </Animation>,\n );\n }\n}\n\nclass ViewWarning extends ViewInfo {\n static defaultProps = {\n type: 'warning',\n duration: 0,\n };\n}\n\n/**\n * NoticeBubble\n *\n * {@link https://developer.semrush.com/intergalactic/components/notice-bubble/notice-bubble-api/|API} | {@link https://developer.semrush.com/intergalactic/components/notice-bubble/notice-bubble-code/|Examples}\n */\nconst NoticeBubbleContainer = createComponent<\n Intergalactic.Component<'div', NoticeBubbleContainerProps>,\n typeof NoticeBubbleContainerRoot\n>(NoticeBubbleContainerRoot);\n\nexport default NoticeBubbleContainer;\n"],"mappings":";;;;AAAA,SAASA,SAAS,EAAEC,GAAG,EAAEC,IAAI,EAAEC,MAAM,QAAQ,0BAA0B;AACvE,OAAOC,MAAM,MAAM,iBAAiB;AACpC,SAASC,eAAe,EAAEC,SAAS,EAAEC,OAAO,EAAEC,IAAI,QAAQ,eAAe;AAGzE,OAAOC,WAAW,MAAM,8CAA8C;AACtE,OAAOC,IAAI,MAAM,8BAA8B;AAC/C,SAASC,cAAc,QAAQ,mDAAmD;AAClF,OAAOC,MAAM,MAAM,gCAAgC;AACnD,SAASC,UAAU,QAAQ,6BAA6B;AACxD,SAASC,mBAAmB,QAAQ,uCAAuC;AAC3E,SAASC,YAAY,EAAEC,QAAQ,QAAQ,0CAA0C;AACjF,SAASC,kBAAkB,QAAQ,wCAAwC;AAC3E,SACEC,6BAA6B,EAC7BC,qBAAqB,QAChB,wCAAwC;AAC/C,OAAOC,SAAS,MAAM,uBAAuB;AAC7C,OAAOC,KAAK,MAAM,OAAO;AAQz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AAAJ,KAAA,CAAAjE,EAAA,kBAAE4E,QAAmB,CAAC,EAC9BjI,MAAM,CAACkI,MAAM,CAAC,gBAAGzH,KAAA,CAAA0C,aAAA,CAACwE,OAAO,EAAAL,KAAA,CAAAjE,EAAA,iBAAE6E,MAAgB,CAAC,GAAG,IACxC,CAET,CACA,CAAC;EAEhB;AACF;AAEA,MAAMjF,WAAW,SAASC,QAAQ,CAAC;;AAOnC;AACA;AACA;AACA;AACA;AAJA/B,eAAA,CAPM8B,WAAW,kBACO;EACpBD,IAAI,EAAE,SAAS;EACfP,QAAQ,EAAE;AACZ,CAAC;AAQH,MAAMiG,qBAAqB,GAAGjJ,eAAe,CAG3CuB,yBAAyB,CAAC;AAE5B,eAAe0H,qBAAqB","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NoticeBubble.type.js","names":[],"sources":["../../src/NoticeBubble.type.ts"],"sourcesContent":["import type { PortalProps, BoxProps } from '@semcore/base-components';\nimport type { Intergalactic } from '@semcore/core';\nimport type { useI18n } from '@semcore/core/lib/utils/enhances/WithI18n';\nimport type { RefObject } from 'react';\n\n/**\n * @deprecated. Pass noticeBubbleContainer property from window.sm2.getNoticeBubbleContainer()\n */\nexport type NoticeBubbleContainerPortalProps = PortalProps;\n\nexport type NoticeBubbleContainerProps = BoxProps &\n NoticeBubbleContainerPortalProps & {\n /** Ref to mount bubbles in. You should use element form window.sm2.getNoticeBubbleContainer() */\n containerNode?: HTMLElement | null;\n /** Manager copy */\n manager?: NoticeBubbleManagerClass;\n /** Specifies the locale for i18n support */\n locale?: string;\n };\n\nexport type NoticeBubbleViewItemProps = NoticeBubbleProps & {\n containerNode?: HTMLElement;\n animationDuration: number;\n getI18nText: ReturnType<typeof useI18n>;\n styles: React.DetailedHTMLProps<React.StyleHTMLAttributes<HTMLStyleElement>, HTMLStyleElement> | undefined;\n};\n\nexport type NoticeBubbleProps = BoxProps & {\n /** Notice type */\n type?: 'info' | 'warning';\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 * 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?: NoticeBubbleManagerClass;\n icon?: React.ReactElement;\n};\n\nexport type NoticeBubbleInfoProps = NoticeBubbleProps & {\n readonly type?: 'info';\n};\n\nexport type NoticeBubbleWarningProps = NoticeBubbleProps & {\n readonly type?: 'warning';\n};\n\nexport type AddedNoticeMeta = {\n uid: number;\n update: (props: NoticeBubbleInfoProps | NoticeBubbleWarningProps) => Promise<AddedNoticeMeta>;\n remove: () => boolean;\n ref: RefObject<HTMLElement>;\n};\n\nexport type NoticeBubbleManagerClass = {\n /**\n * Creates and shows a notice.\n * */\n add: (props: NoticeBubbleInfoProps | NoticeBubbleWarningProps) => AddedNoticeMeta;\n /**\n * Removes notice by uid.\n * */\n remove: (uid: number) => boolean;\n /**\n * Replace notice by uid.\n */\n replace: (uid: number, props: NoticeBubbleInfoProps | NoticeBubbleWarningProps) => void;\n /**\n * Replace last notice (if it is existing)\n */\n replaceLast: (props: NoticeBubbleInfoProps | NoticeBubbleWarningProps) => void;\n};\n\nexport declare const NoticeBubbleContainer: Intergalactic.Component<\n 'div',\n NoticeBubbleContainerProps\n>;\n"],"mappings":"","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"NoticeBubble.type.js","names":[],"sources":["../../src/NoticeBubble.type.ts"],"sourcesContent":["import type { PortalProps, BoxProps } from '@semcore/base-components';\nimport type { Intergalactic } from '@semcore/core';\nimport type { useI18n } from '@semcore/core/lib/utils/enhances/WithI18n';\nimport type { RefObject } from 'react';\n\nimport type { NoticeBubbleManager, NoticeItem } from './NoticeBubbleManager';\nimport type { LocalizedMessages } from './translations/__intergalactic-dynamic-locales';\n\n/**\n * @deprecated. Pass noticeBubbleContainer property from window.sm2.getNoticeBubbleContainer()\n */\nexport type NoticeBubbleContainerPortalProps = PortalProps;\n\nexport type NoticeBubbleContainerProps = BoxProps &\n NoticeBubbleContainerPortalProps & {\n /** Ref to mount bubbles in. You should use element form window.sm2.getNoticeBubbleContainer() */\n containerNode?: HTMLElement | null;\n /** Manager copy */\n manager?: NoticeBubbleManagerClass;\n /** Specifies the locale for i18n support */\n locale?: string;\n };\n\nexport type NoticeBubbleContainerDefaultProps = {\n manager: NoticeBubbleManagerClass;\n i18n: LocalizedMessages;\n locale: 'en';\n};\n\nexport type NoticeBubbleViewItemProps = NoticeBubbleProps & {\n containerNode?: HTMLElement;\n animationDuration: number;\n getI18nText: ReturnType<typeof useI18n>;\n styles: React.DetailedHTMLProps<React.StyleHTMLAttributes<HTMLStyleElement>, HTMLStyleElement> | undefined;\n};\n\nexport type NoticeBubbleProps = BoxProps & {\n /** Notice type */\n type?: 'info' | 'warning';\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 * 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?: NoticeBubbleManagerClass;\n icon?: React.ReactElement;\n};\n\nexport type NoticeBubbleInfoProps = NoticeBubbleProps & {\n readonly type?: 'info';\n};\n\nexport type NoticeBubbleWarningProps = NoticeBubbleProps & {\n readonly type?: 'warning';\n};\n\nexport type AddedNoticeMeta = {\n uid: number;\n update: (props: NoticeBubbleInfoProps | NoticeBubbleWarningProps) => Promise<AddedNoticeMeta>;\n remove: () => boolean;\n ref: RefObject<HTMLElement>;\n};\n\nexport type NoticeBubbleManagerClass = {\n /**\n * Creates and shows a notice.\n * */\n add: (props: NoticeBubbleInfoProps | NoticeBubbleWarningProps) => AddedNoticeMeta;\n /**\n * Removes notice by uid.\n * */\n remove: (uid: number) => boolean;\n /**\n * Replace notice by uid.\n */\n replace: (uid: number, props: NoticeBubbleInfoProps | NoticeBubbleWarningProps) => void;\n /**\n * Replace last notice (if it is existing)\n */\n replaceLast: (props: NoticeBubbleInfoProps | NoticeBubbleWarningProps) => void;\n /** Add change listener */\n addListener: (fn: (items: NoticeItem[]) => void) => (() => void);\n};\n\nexport declare const NoticeBubbleContainer: Intergalactic.Component<\n 'div',\n NoticeBubbleContainerProps\n>;\n"],"mappings":"","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NoticeBubbleManager.js","names":["callAllEventHandlers","EventEmitter","React","EVENT_NAME","NoticeBubbleManager","constructor","_defineProperty","addListener","fn","emitter","subscribe","emit","items","add","props","uid","counter","ref","createRef","item","type","visible","
|
|
1
|
+
{"version":3,"file":"NoticeBubbleManager.js","names":["callAllEventHandlers","EventEmitter","React","EVENT_NAME","NoticeBubbleManager","constructor","_defineProperty","addListener","fn","emitter","subscribe","emit","items","add","props","uid","counter","ref","createRef","item","type","visible","forwardRef","onClose","remove","push","update","replace","bind","Promise","resolve","setTimeout","replaceLast","length","find","filter","noticeBubbleDefaultManager"],"sources":["../../src/NoticeBubbleManager.ts"],"sourcesContent":["import { callAllEventHandlers } from '@semcore/core/lib/utils/assignProps';\nimport EventEmitter from '@semcore/core/lib/utils/eventEmitter';\nimport type { RefObject } from 'react';\nimport React from 'react';\n\nimport type {\n NoticeBubbleManagerClass,\n NoticeBubbleInfoProps,\n NoticeBubbleWarningProps,\n AddedNoticeMeta,\n} from './NoticeBubble.type';\n\nconst EVENT_NAME = 'CHANGE';\n\nexport type NoticeItem = (NoticeBubbleInfoProps | NoticeBubbleWarningProps) & {\n uid: number;\n visible: boolean;\n forwardRef: RefObject<HTMLElement>;\n onClose: () => void;\n};\n\nclass NoticeBubbleManager implements NoticeBubbleManagerClass {\n private items: NoticeItem[] = [];\n private emitter = new EventEmitter();\n private counter = 0;\n\n public addListener(fn: (items: NoticeItem[]) => void): () => void {\n return this.emitter.subscribe(EVENT_NAME, fn);\n }\n\n private emit() {\n this.emitter.emit(EVENT_NAME, this.items);\n }\n\n public add(props: NoticeBubbleInfoProps | NoticeBubbleWarningProps): AddedNoticeMeta {\n const uid = this.counter++;\n const ref = React.createRef<HTMLElement>();\n\n const item = {\n type: 'info',\n uid,\n visible: true,\n forwardRef: ref,\n ...props,\n onClose: callAllEventHandlers(props.onClose, () => {\n this.remove(uid);\n }),\n } as const;\n this.items.push(item);\n this.emit();\n return {\n uid,\n update: this.replace.bind(this, uid),\n remove: this.remove.bind(this, uid),\n ref,\n };\n }\n\n public replace(uid: number, props: NoticeBubbleInfoProps | NoticeBubbleWarningProps): Promise<AddedNoticeMeta> {\n this.remove(uid);\n\n return new Promise((resolve) => {\n setTimeout(() => {\n resolve(this.add(props));\n }, 300);\n });\n }\n\n public replaceLast(props: NoticeBubbleInfoProps | NoticeBubbleWarningProps): Promise<AddedNoticeMeta> {\n const item = this.items[this.items.length - 1];\n\n if (item?.visible) {\n this.remove(this.counter - 1);\n }\n\n return new Promise((resolve) => {\n setTimeout(() => {\n resolve(this.add(props));\n }, 300);\n });\n }\n\n public remove(uid: number): boolean {\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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AEA,MAAMyB,0BAA0B,GAAG,IAAIhC,mBAAmB,CAAC,CAAC;AAE5D,SAASA,mBAAmB;AAC5B,eAAegC,0BAA0B","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"__intergalactic-dynamic-locales.js","names":["de","en","es","fr","it","ja","ko","nl","pl","pt","sv","tr","vi","zh","localizedMessages"],"sources":["../../../src/translations/__intergalactic-dynamic-locales.ts"],"sourcesContent":["import de from './de.json';\nimport en from './en.json';\nimport es from './es.json';\nimport fr from './fr.json';\nimport it from './it.json';\nimport ja from './ja.json';\nimport ko from './ko.json';\nimport nl from './nl.json';\nimport pl from './pl.json';\nimport pt from './pt.json';\nimport sv from './sv.json';\nimport tr from './tr.json';\nimport vi from './vi.json';\nimport zh from './zh.json';\n\nexport const localizedMessages = {\n de,\n en,\n es,\n fr,\n it,\n ja,\n ko,\n nl,\n pt,\n tr,\n vi,\n zh,\n pl,\n sv,\n};\n"],"mappings":"AAAA,OAAOA,EAAE,MAAM,WAAW;AAC1B,OAAOC,EAAE,MAAM,WAAW;AAC1B,OAAOC,EAAE,MAAM,WAAW;AAC1B,OAAOC,EAAE,MAAM,WAAW;AAC1B,OAAOC,EAAE,MAAM,WAAW;AAC1B,OAAOC,EAAE,MAAM,WAAW;AAC1B,OAAOC,EAAE,MAAM,WAAW;AAC1B,OAAOC,EAAE,MAAM,WAAW;AAC1B,OAAOC,EAAE,MAAM,WAAW;AAC1B,OAAOC,EAAE,MAAM,WAAW;AAC1B,OAAOC,EAAE,MAAM,WAAW;AAC1B,OAAOC,EAAE,MAAM,WAAW;AAC1B,OAAOC,EAAE,MAAM,WAAW;AAC1B,OAAOC,EAAE,MAAM,WAAW;AAE1B,OAAO,MAAMC,iBAAiB,GAAG;EAC/Bd,EAAE;EACFC,EAAE;EACFC,EAAE;EACFC,EAAE;EACFC,EAAE;EACFC,EAAE;EACFC,EAAE;EACFC,EAAE;EACFE,EAAE;EACFE,EAAE;EACFC,EAAE;EACFC,EAAE;EACFL,EAAE;EACFE;AACF,CAAC","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"__intergalactic-dynamic-locales.js","names":["de","en","es","fr","it","ja","ko","nl","pl","pt","sv","tr","vi","zh","localizedMessages"],"sources":["../../../src/translations/__intergalactic-dynamic-locales.ts"],"sourcesContent":["import de from './de.json';\nimport en from './en.json';\nimport es from './es.json';\nimport fr from './fr.json';\nimport it from './it.json';\nimport ja from './ja.json';\nimport ko from './ko.json';\nimport nl from './nl.json';\nimport pl from './pl.json';\nimport pt from './pt.json';\nimport sv from './sv.json';\nimport tr from './tr.json';\nimport vi from './vi.json';\nimport zh from './zh.json';\n\nexport const localizedMessages = {\n de,\n en,\n es,\n fr,\n it,\n ja,\n ko,\n nl,\n pt,\n tr,\n vi,\n zh,\n pl,\n sv,\n};\n\nexport type LocalizedMessages = typeof localizedMessages;\n"],"mappings":"AAAA,OAAOA,EAAE,MAAM,WAAW;AAC1B,OAAOC,EAAE,MAAM,WAAW;AAC1B,OAAOC,EAAE,MAAM,WAAW;AAC1B,OAAOC,EAAE,MAAM,WAAW;AAC1B,OAAOC,EAAE,MAAM,WAAW;AAC1B,OAAOC,EAAE,MAAM,WAAW;AAC1B,OAAOC,EAAE,MAAM,WAAW;AAC1B,OAAOC,EAAE,MAAM,WAAW;AAC1B,OAAOC,EAAE,MAAM,WAAW;AAC1B,OAAOC,EAAE,MAAM,WAAW;AAC1B,OAAOC,EAAE,MAAM,WAAW;AAC1B,OAAOC,EAAE,MAAM,WAAW;AAC1B,OAAOC,EAAE,MAAM,WAAW;AAC1B,OAAOC,EAAE,MAAM,WAAW;AAE1B,OAAO,MAAMC,iBAAiB,GAAG;EAC/Bd,EAAE;EACFC,EAAE;EACFC,EAAE;EACFC,EAAE;EACFC,EAAE;EACFC,EAAE;EACFC,EAAE;EACFC,EAAE;EACFE,EAAE;EACFE,EAAE;EACFC,EAAE;EACFC,EAAE;EACFL,EAAE;EACFE;AACF,CAAC","ignoreList":[]}
|
package/lib/esm/NoticeBubble.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import _extends from "@babel/runtime/helpers/
|
|
2
|
-
import _defineProperty from "@babel/runtime/helpers/
|
|
1
|
+
import _extends from "@babel/runtime/helpers/extends";
|
|
2
|
+
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
3
3
|
import { sstyled, Component, assignProps, createComponent } from "@semcore/core";
|
|
4
4
|
import { Box, Portal, Flex, Animation } from "@semcore/base-components";
|
|
5
5
|
import Button from "@semcore/button";
|
|
@@ -22,25 +22,25 @@ const style = (
|
|
|
22
22
|
/*__reshadow_css_start__*/
|
|
23
23
|
(sstyled.insert(
|
|
24
24
|
/*__inner_css_start__*/
|
|
25
|
-
"
|
|
25
|
+
".___SBubble_16a8l_gg_,.___SView_16a8l_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,#fefffff2);gap:var(--intergalactic-spacing-2x,8px)}.___SBubble_16a8l_gg_._type_info_16a8l_gg_,.___SView_16a8l_gg_._type_info_16a8l_gg_{background:var(--intergalactic-bg-primary-invert,#1a1e1a)}.___SBubble_16a8l_gg_._type_warning_16a8l_gg_,.___SView_16a8l_gg_._type_warning_16a8l_gg_{background:var(--intergalactic-bg-primary-critical,#f73740)}.___SContent_16a8l_gg_{flex-direction:column;gap:var(--intergalactic-spacing-2x,8px);flex:1}.___SMessage_16a8l_gg_{font-size:var(--intergalactic-fs-200,14px);line-height:var(--intergalactic-lh-200,142%)}.___SDismiss_16a8l_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:#0000}.___SDismiss_16a8l_gg_.__use_16a8l_gg_{padding:0 1px}.___SIcon_16a8l_gg_{justify-content:center;align-items:center;height:var(--intergalactic-spacing-5x,20px)}.___SNoticeBubble_16a8l_gg_{width:300px;position:fixed;right:var(--intergalactic-spacing-3x,12px);top:var(--intergalactic-spacing-3x,12px)}@media (max-width:767px){.___SNoticeBubble_16a8l_gg_{width:calc(100% - var(--intergalactic-spacing-6x, 24px))}}.___SNoticeBubble_16a8l_gg_.__disablePortal_16a8l_gg_{position:sticky;margin-left:auto;height:0}.___SMessage_16a8l_gg_ a{color:var(--intergalactic-text-link-invert,#88acfd)}.___SNoticeAriaLiveWrapper_16a8l_gg_{display:contents}@keyframes enter_16a8l{0%{transform:translate(100%);max-height:0;overflow:hidden}to{transform:translate(0);max-height:100vh;overflow:hidden}}@keyframes exit_16a8l{0%{max-height:100vh;overflow:hidden;opacity:1}to{max-height:0;overflow:hidden;opacity:0}}",
|
|
26
26
|
/*__inner_css_end__*/
|
|
27
|
-
"
|
|
27
|
+
"16a8l_gg_"
|
|
28
28
|
), /*__reshadow_css_end__*/
|
|
29
29
|
{
|
|
30
|
-
"__SContent": "
|
|
31
|
-
"__SMessage": "
|
|
32
|
-
"__SDismiss": "
|
|
33
|
-
"_use": "
|
|
34
|
-
"__SIcon": "
|
|
35
|
-
"__SNoticeBubble": "
|
|
36
|
-
"_disablePortal": "
|
|
37
|
-
"__SNoticeAriaLiveWrapper": "
|
|
38
|
-
"@enter": "
|
|
39
|
-
"@exit": "
|
|
40
|
-
"__SBubble": "
|
|
41
|
-
"__SView": "
|
|
42
|
-
"_type_info": "
|
|
43
|
-
"_type_warning": "
|
|
30
|
+
"__SContent": "___SContent_16a8l_gg_",
|
|
31
|
+
"__SMessage": "___SMessage_16a8l_gg_",
|
|
32
|
+
"__SDismiss": "___SDismiss_16a8l_gg_",
|
|
33
|
+
"_use": "__use_16a8l_gg_",
|
|
34
|
+
"__SIcon": "___SIcon_16a8l_gg_",
|
|
35
|
+
"__SNoticeBubble": "___SNoticeBubble_16a8l_gg_",
|
|
36
|
+
"_disablePortal": "__disablePortal_16a8l_gg_",
|
|
37
|
+
"__SNoticeAriaLiveWrapper": "___SNoticeAriaLiveWrapper_16a8l_gg_",
|
|
38
|
+
"@enter": "enter_16a8l",
|
|
39
|
+
"@exit": "exit_16a8l",
|
|
40
|
+
"__SBubble": "___SBubble_16a8l_gg_",
|
|
41
|
+
"__SView": "___SView_16a8l_gg_",
|
|
42
|
+
"_type_info": "_type_info_16a8l_gg_",
|
|
43
|
+
"_type_warning": "_type_warning_16a8l_gg_"
|
|
44
44
|
})
|
|
45
45
|
);
|
|
46
46
|
class NoticeBubbleContainerRoot extends Component {
|
|
@@ -90,12 +90,12 @@ class NoticeBubbleContainerRoot extends Component {
|
|
|
90
90
|
const SView = notice.type === "warning" ? ViewWarning : ViewInfo;
|
|
91
91
|
return _ref2 = sstyled(styles), /* @__PURE__ */ React.createElement(PortalForNoticeItem, _ref2.cn("PortalForNoticeItem", {
|
|
92
92
|
"key": notice.uid,
|
|
93
|
-
"tag": SView,
|
|
94
93
|
"containerNode": containerNode,
|
|
95
94
|
"animationDuration": duration,
|
|
96
95
|
"styles": styles,
|
|
97
96
|
"getI18nText": getI18nText,
|
|
98
|
-
...notice
|
|
97
|
+
...notice,
|
|
98
|
+
"tag": SView
|
|
99
99
|
}));
|
|
100
100
|
});
|
|
101
101
|
}
|
|
@@ -171,21 +171,24 @@ const PortalForNoticeItem = (props) => {
|
|
|
171
171
|
}, 200);
|
|
172
172
|
}, []);
|
|
173
173
|
const SNoticeAriaLiveWrapper = "div";
|
|
174
|
-
const
|
|
175
|
-
|
|
174
|
+
const {
|
|
175
|
+
tag: Tag,
|
|
176
|
+
...otherProps
|
|
177
|
+
} = props;
|
|
178
|
+
if (otherProps.type === "info") {
|
|
176
179
|
return /* @__PURE__ */ React.createElement(ZIndexStackingContextProvider, {
|
|
177
180
|
designToken: "z-index-notice-bubble"
|
|
178
181
|
}, /* @__PURE__ */ React.createElement(Portal, {
|
|
179
|
-
nodeToMount:
|
|
182
|
+
nodeToMount: otherProps.containerNode
|
|
180
183
|
}, /* @__PURE__ */ React.createElement(SNoticeAriaLiveWrapper, {
|
|
181
184
|
"aria-live": "polite"
|
|
182
|
-
}, showContent && /* @__PURE__ */ React.createElement(Tag,
|
|
185
|
+
}, showContent && /* @__PURE__ */ React.createElement(Tag, otherProps))));
|
|
183
186
|
}
|
|
184
187
|
return /* @__PURE__ */ React.createElement(ZIndexStackingContextProvider, {
|
|
185
188
|
designToken: "z-index-notice-bubble"
|
|
186
189
|
}, /* @__PURE__ */ React.createElement(Portal, {
|
|
187
|
-
nodeToMount:
|
|
188
|
-
}, /* @__PURE__ */ React.createElement(Tag,
|
|
190
|
+
nodeToMount: otherProps.containerNode
|
|
191
|
+
}, /* @__PURE__ */ React.createElement(Tag, otherProps)));
|
|
189
192
|
};
|
|
190
193
|
class ViewInfo extends Component {
|
|
191
194
|
constructor(...args) {
|
|
@@ -267,7 +270,7 @@ class ViewInfo extends Component {
|
|
|
267
270
|
} = this.props;
|
|
268
271
|
return _ref6 = sstyled(styles), /* @__PURE__ */ React.createElement(Animation, _ref6.cn("Animation", {
|
|
269
272
|
"initialAnimation": initialAnimation,
|
|
270
|
-
"visible": visible
|
|
273
|
+
"visible": visible,
|
|
271
274
|
"duration": animationDuration,
|
|
272
275
|
"keyframes": [styles["@enter"], styles["@exit"]]
|
|
273
276
|
}), /* @__PURE__ */ React.createElement(SBubble, _ref6.cn("SBubble", {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import _defineProperty from "@babel/runtime/helpers/
|
|
1
|
+
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
2
|
import { callAllEventHandlers } from "@semcore/core/lib/utils/assignProps";
|
|
3
3
|
import EventEmitter from "@semcore/core/lib/utils/eventEmitter";
|
|
4
4
|
import React from "react";
|
|
@@ -21,7 +21,7 @@ class NoticeBubbleManager {
|
|
|
21
21
|
const item = {
|
|
22
22
|
type: "info",
|
|
23
23
|
uid,
|
|
24
|
-
visible:
|
|
24
|
+
visible: true,
|
|
25
25
|
forwardRef: ref,
|
|
26
26
|
...props,
|
|
27
27
|
onClose: callAllEventHandlers(props.onClose, () => {
|
package/lib/esm/utils.mjs
CHANGED
|
@@ -1,4 +1,9 @@
|
|
|
1
1
|
import type { Intergalactic } from '@semcore/core';
|
|
2
2
|
import type { NoticeBubbleContainerProps } from './NoticeBubble.type';
|
|
3
|
-
|
|
3
|
+
/**
|
|
4
|
+
* NoticeBubble
|
|
5
|
+
*
|
|
6
|
+
* {@link https://developer.semrush.com/intergalactic/components/notice-bubble/notice-bubble-api/|API} | {@link https://developer.semrush.com/intergalactic/components/notice-bubble/notice-bubble-code/|Examples}
|
|
7
|
+
*/
|
|
8
|
+
declare const NoticeBubbleContainer: Intergalactic.Component<"div", NoticeBubbleContainerProps, {}, never[]>;
|
|
4
9
|
export default NoticeBubbleContainer;
|
|
@@ -2,6 +2,8 @@ import type { PortalProps, BoxProps } from '@semcore/base-components';
|
|
|
2
2
|
import type { Intergalactic } from '@semcore/core';
|
|
3
3
|
import type { useI18n } from '@semcore/core/lib/utils/enhances/WithI18n';
|
|
4
4
|
import type { RefObject } from 'react';
|
|
5
|
+
import type { NoticeItem } from './NoticeBubbleManager';
|
|
6
|
+
import type { LocalizedMessages } from './translations/__intergalactic-dynamic-locales';
|
|
5
7
|
/**
|
|
6
8
|
* @deprecated. Pass noticeBubbleContainer property from window.sm2.getNoticeBubbleContainer()
|
|
7
9
|
*/
|
|
@@ -14,6 +16,11 @@ export type NoticeBubbleContainerProps = BoxProps & NoticeBubbleContainerPortalP
|
|
|
14
16
|
/** Specifies the locale for i18n support */
|
|
15
17
|
locale?: string;
|
|
16
18
|
};
|
|
19
|
+
export type NoticeBubbleContainerDefaultProps = {
|
|
20
|
+
manager: NoticeBubbleManagerClass;
|
|
21
|
+
i18n: LocalizedMessages;
|
|
22
|
+
locale: 'en';
|
|
23
|
+
};
|
|
17
24
|
export type NoticeBubbleViewItemProps = NoticeBubbleProps & {
|
|
18
25
|
containerNode?: HTMLElement;
|
|
19
26
|
animationDuration: number;
|
|
@@ -87,5 +94,7 @@ export type NoticeBubbleManagerClass = {
|
|
|
87
94
|
* Replace last notice (if it is existing)
|
|
88
95
|
*/
|
|
89
96
|
replaceLast: (props: NoticeBubbleInfoProps | NoticeBubbleWarningProps) => void;
|
|
97
|
+
/** Add change listener */
|
|
98
|
+
addListener: (fn: (items: NoticeItem[]) => void) => (() => void);
|
|
90
99
|
};
|
|
91
100
|
export declare const NoticeBubbleContainer: Intergalactic.Component<'div', NoticeBubbleContainerProps>;
|
|
@@ -2,7 +2,7 @@ import type { RefObject } from 'react';
|
|
|
2
2
|
import type { NoticeBubbleManagerClass, NoticeBubbleInfoProps, NoticeBubbleWarningProps, AddedNoticeMeta } from './NoticeBubble.type';
|
|
3
3
|
export type NoticeItem = (NoticeBubbleInfoProps | NoticeBubbleWarningProps) & {
|
|
4
4
|
uid: number;
|
|
5
|
-
visible
|
|
5
|
+
visible: boolean;
|
|
6
6
|
forwardRef: RefObject<HTMLElement>;
|
|
7
7
|
onClose: () => void;
|
|
8
8
|
};
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@semcore/notice-bubble",
|
|
3
3
|
"description": "Semrush NoticeBubble Component",
|
|
4
|
-
"version": "17.
|
|
4
|
+
"version": "17.2.0-prerelease.3",
|
|
5
5
|
"main": "lib/cjs/index.js",
|
|
6
6
|
"module": "lib/es6/index.js",
|
|
7
7
|
"typings": "lib/types/index.d.ts",
|
|
@@ -14,10 +14,10 @@
|
|
|
14
14
|
"require": "./lib/cjs/index.js"
|
|
15
15
|
},
|
|
16
16
|
"dependencies": {
|
|
17
|
-
"@semcore/button": "^17.
|
|
17
|
+
"@semcore/button": "^17.2.0-prerelease.3"
|
|
18
18
|
},
|
|
19
19
|
"peerDependencies": {
|
|
20
|
-
"@semcore/base-components": "^17.0
|
|
20
|
+
"@semcore/base-components": "^17.2.0",
|
|
21
21
|
"@semcore/icon": "^17.0.1"
|
|
22
22
|
},
|
|
23
23
|
"repository": {
|
|
@@ -26,9 +26,9 @@
|
|
|
26
26
|
"directory": "semcore/notice-bubble"
|
|
27
27
|
},
|
|
28
28
|
"devDependencies": {
|
|
29
|
-
"@semcore/
|
|
30
|
-
"@semcore/core": "17.1.0",
|
|
29
|
+
"@semcore/core": "17.2.0-prerelease.3",
|
|
31
30
|
"@semcore/testing-utils": "1.0.0",
|
|
31
|
+
"@semcore/base-components": "17.2.0-prerelease.3",
|
|
32
32
|
"@semcore/icon": "17.1.0"
|
|
33
33
|
},
|
|
34
34
|
"scripts": {
|