@semcore/notice-bubble 17.2.1-prerelease.0 → 17.2.2-prerelease.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +8 -1
- package/lib/cjs/NoticeBubble.js +15 -15
- package/lib/cjs/NoticeBubble.js.map +1 -1
- package/lib/cjs/NoticeBubble.type.js.map +1 -1
- package/lib/cjs/NoticeBubbleManager.js.map +1 -1
- package/lib/cjs/index.js.map +1 -1
- package/lib/es6/NoticeBubble.js +15 -15
- package/lib/es6/NoticeBubble.js.map +1 -1
- package/lib/es6/NoticeBubble.type.js.map +1 -1
- package/lib/es6/NoticeBubbleManager.js.map +1 -1
- package/lib/es6/index.js.map +1 -1
- package/lib/esm/NoticeBubble.mjs +16 -16
- package/lib/types/NoticeBubble.d.ts +3 -3
- package/lib/types/NoticeBubble.d.ts.map +1 -0
- package/lib/types/NoticeBubble.type.d.ts +132 -96
- package/lib/types/NoticeBubble.type.d.ts.map +1 -0
- package/lib/types/NoticeBubbleManager.d.ts +7 -13
- package/lib/types/NoticeBubbleManager.d.ts.map +1 -0
- package/lib/types/index.d.ts +3 -2
- package/lib/types/index.d.ts.map +1 -0
- package/lib/types/translations/__intergalactic-dynamic-locales.d.ts +1 -0
- package/lib/types/translations/__intergalactic-dynamic-locales.d.ts.map +1 -0
- package/lib/types/utils.d.ts +1 -0
- package/lib/types/utils.d.ts.map +1 -0
- package/package.json +7 -7
package/CHANGELOG.md
CHANGED
|
@@ -2,7 +2,14 @@
|
|
|
2
2
|
|
|
3
3
|
CHANGELOG.md standards are inspired by [keepachangelog.com](https://keepachangelog.com/en/1.0.0/).
|
|
4
4
|
|
|
5
|
-
## [17.2.
|
|
5
|
+
## [17.2.2] - 2026-08-26
|
|
6
|
+
|
|
7
|
+
### Changed
|
|
8
|
+
|
|
9
|
+
- Refactor component types. Deprecated atomic types. Atomic types are
|
|
10
|
+
part of `NSNoticeBubble` namespace.
|
|
11
|
+
|
|
12
|
+
## [17.2.1] - 2026-06-26
|
|
6
13
|
|
|
7
14
|
### Fixed
|
|
8
15
|
|
package/lib/cjs/NoticeBubble.js
CHANGED
|
@@ -24,23 +24,23 @@ var _NoticeBubbleManager = _interopRequireDefault(require("./NoticeBubbleManager
|
|
|
24
24
|
var _intergalacticDynamicLocales = require("./translations/__intergalactic-dynamic-locales");
|
|
25
25
|
var _utils = require("./utils");
|
|
26
26
|
/*!__reshadow-styles__:"./style/notice-bubble.shadow.css"*/
|
|
27
|
-
const style = (/*__reshadow_css_start__*/_core.sstyled.insert(/*__inner_css_start__*/".
|
|
27
|
+
const style = (/*__reshadow_css_start__*/_core.sstyled.insert(/*__inner_css_start__*/".___SBubble_10xy2_gg_,.___SView_10xy2_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,oklch(.999 .001 180/.949));gap:var(--intergalactic-spacing-2x,8px)}.___SBubble_10xy2_gg_._type_info_10xy2_gg_,.___SView_10xy2_gg_._type_info_10xy2_gg_{background:var(--intergalactic-bg-primary-invert,oklch(.23 .01 140))}.___SBubble_10xy2_gg_._type_warning_10xy2_gg_,.___SView_10xy2_gg_._type_warning_10xy2_gg_{background:var(--intergalactic-bg-primary-critical,oklch(.64 .226 24.5))}.___SContent_10xy2_gg_{flex-direction:column;gap:var(--intergalactic-spacing-2x,8px);flex:1}.___SMessage_10xy2_gg_{font-size:var(--intergalactic-fs-200,14px);line-height:var(--intergalactic-lh-200,142%)}.___SDismiss_10xy2_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_10xy2_gg_.__use_10xy2_gg_{padding:0 1px}.___SIcon_10xy2_gg_{justify-content:center;align-items:center;height:var(--intergalactic-spacing-5x,20px)}.___SNoticeBubble_10xy2_gg_{width:300px;position:fixed;right:var(--intergalactic-spacing-3x,12px);top:var(--intergalactic-spacing-3x,12px)}@media (max-width:767px){.___SNoticeBubble_10xy2_gg_{width:calc(100% - var(--intergalactic-spacing-6x, 24px))}}.___SNoticeBubble_10xy2_gg_.__disablePortal_10xy2_gg_{position:sticky;margin-left:auto;height:0}.___SMessage_10xy2_gg_ a{color:var(--intergalactic-text-link-invert,oklch(.75 .125 265.3))}.___SNoticeAriaLiveWrapper_10xy2_gg_{display:contents}@keyframes enter_10xy2{0%{transform:translate(100%);max-height:0;overflow:hidden}to{transform:translate(0);max-height:100vh;overflow:hidden}}@keyframes exit_10xy2{0%{max-height:100vh;overflow:hidden;opacity:1}to{max-height:0;overflow:hidden;opacity:0}}", /*__inner_css_end__*/"10xy2_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_10xy2_gg_",
|
|
31
|
+
"__SMessage": "___SMessage_10xy2_gg_",
|
|
32
|
+
"__SDismiss": "___SDismiss_10xy2_gg_",
|
|
33
|
+
"_use": "__use_10xy2_gg_",
|
|
34
|
+
"__SIcon": "___SIcon_10xy2_gg_",
|
|
35
|
+
"__SNoticeBubble": "___SNoticeBubble_10xy2_gg_",
|
|
36
|
+
"_disablePortal": "__disablePortal_10xy2_gg_",
|
|
37
|
+
"__SNoticeAriaLiveWrapper": "___SNoticeAriaLiveWrapper_10xy2_gg_",
|
|
38
|
+
"@enter": "enter_10xy2",
|
|
39
|
+
"@exit": "exit_10xy2",
|
|
40
|
+
"__SBubble": "___SBubble_10xy2_gg_",
|
|
41
|
+
"__SView": "___SView_10xy2_gg_",
|
|
42
|
+
"_type_info": "_type_info_10xy2_gg_",
|
|
43
|
+
"_type_warning": "_type_warning_10xy2_gg_"
|
|
44
44
|
});
|
|
45
45
|
class NoticeBubbleContainerRoot extends _core.Component {
|
|
46
46
|
constructor(...args) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NoticeBubble.js","names":["_core","require","_baseComponents","_button","_interopRequireDefault","_i18nEnhance","_fire","_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","isFocusInBubble","event","paused","rect","current","getBoundingClientRect","mouseInRect","clientX","left","right","clientY","top","bottom","Timer","document","body","addEventListener","handleBodyMouseMove","triggerButtonComponent","activeElement","componentWillUnmount","triggerElement","isFocusInside","HTMLElement","setFocus","removeEventListener","noticeElement","clear","_ref6","SBubble","SDismiss","Button","SContent","SMessage","SAction","SIcon","visible","initialAnimation","animationDuration","icon","children","action","Animation","handleMouseEnter","handleMouseLeave","handleFocus","handleBlur","handleKeydown","handleClick","undefined","closeButtonRef","Addon","CloseIcon","color","isNode","Fragment","NoticeBubbleContainer","createComponent","_default","exports"],"sources":["../../src/NoticeBubble.tsx"],"sourcesContent":["import { Animation, Box, Flex, Portal, ScreenReaderOnly } from '@semcore/base-components';\nimport Button from '@semcore/button';\nimport { createComponent, Component, sstyled, Root, lastInteraction } 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 { setFocus, isFocusInside, useFocusLock } 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 triggerButtonComponent: Element | null = null;\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 this.triggerButtonComponent = document.activeElement;\n }\n\n componentWillUnmount() {\n const triggerElement = this.triggerButtonComponent;\n if (this.ref.current && isFocusInside(this.ref.current) && triggerElement instanceof HTMLElement) {\n setTimeout(() => setFocus(triggerElement), 0);\n }\n\n this.clearTimer();\n document.body.removeEventListener('mousemove', this.handleBodyMouseMove);\n }\n\n isFocusInBubble() {\n const noticeElement = this.ref.current;\n\n return noticeElement ? isFocusInside(noticeElement) : false;\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 handleFocus = () => {\n this.timer?.pause();\n };\n\n handleBlur = () => {\n this.timer?.resume();\n };\n\n handleClick = () => {\n this.timer?.pause();\n };\n\n handleMouseEnter = () => {\n this.timer?.pause();\n };\n\n handleMouseLeave = () => {\n if (!this.timer || this.isFocusInBubble()) return;\n this.timer.resume();\n };\n\n handleBodyMouseMove = (event: MouseEvent) => {\n if (!this.timer?.paused || this.isFocusInBubble()) 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 render={Flex}\n type={type}\n ref={this.ref}\n onMouseEnter={this.handleMouseEnter}\n onMouseLeave={this.handleMouseLeave}\n onFocus={this.handleFocus}\n onBlur={this.handleBlur}\n onKeyDown={this.handleKeydown}\n onClick={this.handleClick}\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"],"mapp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,OAAA,EAPMgC,WAAW,kBACO;EACpBD,IAAI,EAAE,SAAS;EACfP,QAAQ,EAAE;AACZ,CAAC;AAQH,MAAMyH,qBAAqB,GAAG,IAAAC,qBAAe,EAG3CvJ,yBAAyB,CAAC;AAAC,IAAAwJ,QAAA,GAAAC,OAAA,CAAApJ,OAAA,GAEdiJ,qBAAqB","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"NoticeBubble.js","names":["_core","require","_baseComponents","_button","_interopRequireDefault","_i18nEnhance","_fire","_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","isFocusInBubble","event","paused","rect","current","getBoundingClientRect","mouseInRect","clientX","left","right","clientY","top","bottom","Timer","document","body","addEventListener","handleBodyMouseMove","triggerButtonComponent","activeElement","componentWillUnmount","triggerElement","isFocusInside","HTMLElement","setFocus","removeEventListener","noticeElement","clear","_ref6","SBubble","SDismiss","Button","SContent","SMessage","SAction","SIcon","visible","initialAnimation","animationDuration","icon","children","action","Animation","handleMouseEnter","handleMouseLeave","handleFocus","handleBlur","handleKeydown","handleClick","undefined","closeButtonRef","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 isNode from '@semcore/core/lib/utils/isNode';\nimport { useForkRef } from '@semcore/core/lib/utils/ref';\nimport { contextThemeEnhance } from '@semcore/core/lib/utils/ThemeProvider';\nimport { setFocus, isFocusInside, useFocusLock } 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 { NSNoticeBubble } from './NoticeBubble.type';\nimport manager from './NoticeBubbleManager';\nimport style from './style/notice-bubble.shadow.css';\nimport { localizedMessages } from './translations/__intergalactic-dynamic-locales';\nimport { Timer } from './utils';\n\nclass NoticeBubbleContainerRoot extends Component<\n Intergalactic.InternalTypings.InferComponentProps<NSNoticeBubble.Container.Component>,\n typeof NoticeBubbleContainerRoot.enhance,\n {},\n WithI18nEnhanceProps,\n NSNoticeBubble.Container.State,\n NSNoticeBubble.Container.DefaultProps\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: NSNoticeBubble.Container.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: NSNoticeBubble.Item[]) => {\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<NSNoticeBubble.ViewItemProps, '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<NSNoticeBubble.ViewItemProps> {\n timer: Timer | null = null;\n ref = React.createRef<HTMLDivElement>();\n closeButtonRef = React.createRef<HTMLButtonElement>();\n triggerButtonComponent: Element | null = null;\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 this.triggerButtonComponent = document.activeElement;\n }\n\n componentWillUnmount() {\n const triggerElement = this.triggerButtonComponent;\n if (this.ref.current && isFocusInside(this.ref.current) && triggerElement instanceof HTMLElement) {\n setTimeout(() => setFocus(triggerElement), 0);\n }\n\n this.clearTimer();\n document.body.removeEventListener('mousemove', this.handleBodyMouseMove);\n }\n\n isFocusInBubble() {\n const noticeElement = this.ref.current;\n\n return noticeElement ? isFocusInside(noticeElement) : false;\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 handleFocus = () => {\n this.timer?.pause();\n };\n\n handleBlur = () => {\n this.timer?.resume();\n };\n\n handleClick = () => {\n this.timer?.pause();\n };\n\n handleMouseEnter = () => {\n this.timer?.pause();\n };\n\n handleMouseLeave = () => {\n if (!this.timer || this.isFocusInBubble()) return;\n this.timer.resume();\n };\n\n handleBodyMouseMove = (event: MouseEvent) => {\n if (!this.timer?.paused || this.isFocusInBubble()) 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 render={Flex}\n type={type}\n ref={this.ref}\n onMouseEnter={this.handleMouseEnter}\n onMouseLeave={this.handleMouseLeave}\n onFocus={this.handleFocus}\n onBlur={this.handleBlur}\n onKeyDown={this.handleKeydown}\n onClick={this.handleClick}\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 NSNoticeBubble.Container.Component,\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,OAAA,GAAAH,sBAAA,CAAAH,OAAA;AACA,IAAAO,KAAA,GAAAP,OAAA;AACA,IAAAQ,cAAA,GAAAR,OAAA;AACA,IAAAS,aAAA,GAAAT,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{"version":3,"file":"NoticeBubble.type.js","names":[],"sources":["../../src/NoticeBubble.type.ts"],"sourcesContent":["import type { NSPortal, NSBox } 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 { LocalizedMessages } from './translations/__intergalactic-dynamic-locales';\n\ndeclare namespace NSNoticeBubble {\n type Props = NSBox.Props & {\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 * @deprecated\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?: NSNoticeBubble.Manager;\n icon?: React.ReactElement;\n };\n type Item = (NSNoticeBubble.Info.Props | NSNoticeBubble.Warning.Props) & {\n uid: number;\n visible: boolean;\n forwardRef: RefObject<HTMLElement>;\n onClose: () => void;\n };\n type ViewItemProps = NSNoticeBubble.Props & {\n containerNode?: HTMLElement;\n animationDuration: number;\n getI18nText: ReturnType<typeof useI18n>;\n styles: React.DetailedHTMLProps<React.StyleHTMLAttributes<HTMLStyleElement>, HTMLStyleElement> | undefined;\n };\n type Meta = {\n uid: number;\n update: (props: Info.Props | Warning.Props) => Promise<NSNoticeBubble.Meta>;\n remove: () => boolean;\n ref: RefObject<HTMLElement>;\n };\n type Manager = {\n /**\n * Creates and shows a notice.\n * */\n add: (props: NSNoticeBubble.Info.Props | NSNoticeBubble.Warning.Props) => NSNoticeBubble.Meta;\n /**\n * Removes notice by uid.\n * */\n remove: (uid: number) => boolean;\n /**\n * Replace notice by uid.\n */\n replace: (uid: number, props: NSNoticeBubble.Info.Props | NSNoticeBubble.Warning.Props) => void;\n /**\n * Replace last notice (if it is existing)\n */\n replaceLast: (props: NSNoticeBubble.Info.Props | NSNoticeBubble.Warning.Props) => void;\n /** Add change listener */\n addListener: (fn: (items: NSNoticeBubble.Item[]) => void) => () => void;\n };\n\n namespace Container {\n type Props = NSBox.Props &\n NSPortal.Props & {\n /** Ref to mount bubbles in. You should use element form window.sm2.getNoticeBubbleContainer() */\n containerNode?: HTMLElement | null;\n /** Manager copy */\n manager?: NSNoticeBubble.Manager;\n /** Specifies the locale for i18n support */\n locale?: string;\n };\n type DefaultProps = {\n manager: NSNoticeBubble.Manager;\n i18n: LocalizedMessages;\n locale: 'en';\n };\n type State = {\n notices: NSNoticeBubble.Item[];\n infos: NSNoticeBubble.Item[];\n warnings: NSNoticeBubble.Item[];\n };\n\n type Component = Intergalactic.Component<'div', Props>;\n }\n\n namespace Info {\n type Props = NSNoticeBubble.Props & {\n readonly type?: 'info';\n };\n }\n\n namespace Warning {\n type Props = NSNoticeBubble.Props & {\n readonly type?: 'warning';\n };\n }\n}\n\n/**\n * @deprecated. Pass noticeBubbleContainer property from window.sm2.getNoticeBubbleContainer().\n */\nexport type NoticeBubbleContainerPortalProps = NSPortal.Props;\n/** @deprecated It will be removed in v19. */\nexport type NoticeBubbleContainerProps = NSNoticeBubble.Container.Props;\n/** @deprecated It will be removed in v19. */\nexport type NoticeBubbleContainerDefaultProps = NSNoticeBubble.Container.DefaultProps;\n/** @deprecated It will be removed in v19. */\nexport type NoticeBubbleViewItemProps = NSNoticeBubble.ViewItemProps;\n/** @deprecated It will be removed in v19. */\nexport type NoticeBubbleProps = NSNoticeBubble.Props;\n/** @deprecated It will be removed in v19. */\nexport type NoticeBubbleInfoProps = NSNoticeBubble.Info.Props;\n/** @deprecated It will be removed in v19. */\nexport type NoticeBubbleWarningProps = NSNoticeBubble.Warning.Props;\n/** @deprecated It will be removed in v19. */\nexport type AddedNoticeMeta = NSNoticeBubble.Meta;\n/** @deprecated It will be removed in v19. */\nexport type NoticeBubbleManagerClass = NSNoticeBubble.Manager;\n\nexport type { NSNoticeBubble };\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","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
|
|
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 React from 'react';\n\nimport type { NSNoticeBubble } from './NoticeBubble.type';\n\nconst EVENT_NAME = 'CHANGE';\n\nclass NoticeBubbleManager implements NSNoticeBubble.Manager {\n private items: NSNoticeBubble.Item[] = [];\n private emitter = new EventEmitter();\n private counter = 0;\n\n public addListener(fn: (items: NSNoticeBubble.Item[]) => 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: NSNoticeBubble.Info.Props | NSNoticeBubble.Warning.Props): NSNoticeBubble.Meta {\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: NSNoticeBubble.Info.Props | NSNoticeBubble.Warning.Props): Promise<NSNoticeBubble.Meta> {\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: NSNoticeBubble.Info.Props | NSNoticeBubble.Warning.Props): Promise<NSNoticeBubble.Meta> {\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;AACA,IAAAG,MAAA,GAAAD,sBAAA,CAAAF,OAAA;AAIA,MAAMI,UAAU,GAAG,QAAQ;AAE3B,MAAMC,mBAAmB,CAAmC;EAAAC,YAAA;IAAA,IAAAC,gBAAA,CAAAC,OAAA,iBACnB,EAAE;IAAA,IAAAD,g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 -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["_NoticeBubble","_interopRequireWildcard","require","Object","keys","forEach","key","prototype","hasOwnProperty","call","_exportNames","exports","defineProperty","enumerable","get","_NoticeBubbleManager"],"sources":["../../src/index.ts"],"sourcesContent":["import { default as NoticeBubbleContainer } from './NoticeBubble';\nimport type {\n NoticeBubbleContainerProps,\n NoticeBubbleInfoProps,\n NoticeBubbleWarningProps,\n AddedNoticeMeta,\n} from './NoticeBubble.type';\nimport { default as noticeBubbleDefaultManager } from './NoticeBubbleManager';\n\nexport * from './NoticeBubble';\n\nexport * from './NoticeBubbleManager';\n\nexport { NoticeBubbleContainer, noticeBubbleDefaultManager };\n\nexport type {\n NoticeBubbleContainerProps,\n NoticeBubbleInfoProps,\n NoticeBubbleWarningProps,\n AddedNoticeMeta,\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAAA,IAAAA,aAAA,GAAAC,uBAAA,CAAAC,OAAA;
|
|
1
|
+
{"version":3,"file":"index.js","names":["_NoticeBubble","_interopRequireWildcard","require","Object","keys","forEach","key","prototype","hasOwnProperty","call","_exportNames","exports","defineProperty","enumerable","get","_NoticeBubbleManager"],"sources":["../../src/index.ts"],"sourcesContent":["import { default as NoticeBubbleContainer } from './NoticeBubble';\nimport type {\n NoticeBubbleContainerProps,\n NoticeBubbleInfoProps,\n NoticeBubbleWarningProps,\n AddedNoticeMeta,\n NSNoticeBubble,\n} from './NoticeBubble.type';\nimport { default as noticeBubbleDefaultManager } from './NoticeBubbleManager';\n\nexport * from './NoticeBubble';\n\nexport * from './NoticeBubbleManager';\n\nexport { NoticeBubbleContainer, noticeBubbleDefaultManager };\n\nexport type {\n NoticeBubbleContainerProps,\n NoticeBubbleInfoProps,\n NoticeBubbleWarningProps,\n AddedNoticeMeta,\n NSNoticeBubble,\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAAA,IAAAA,aAAA,GAAAC,uBAAA,CAAAC,OAAA;AAUAC,MAAA,CAAAC,IAAA,CAAAJ,aAAA,EAAAK,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAH,MAAA,CAAAI,SAAA,CAAAC,cAAA,CAAAC,IAAA,CAAAC,YAAA,EAAAJ,GAAA;EAAA,IAAAA,GAAA,IAAAK,OAAA,IAAAA,OAAA,CAAAL,GAAA,MAAAN,aAAA,CAAAM,GAAA;EAAAH,MAAA,CAAAS,cAAA,CAAAD,OAAA,EAAAL,GAAA;IAAAO,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAd,aAAA,CAAAM,GAAA;IAAA;EAAA;AAAA;AAFA,IAAAS,oBAAA,GAAAd,uBAAA,CAAAC,OAAA;AAIAC,MAAA,CAAAC,IAAA,CAAAW,oBAAA,EAAAV,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAH,MAAA,CAAAI,SAAA,CAAAC,cAAA,CAAAC,IAAA,CAAAC,YAAA,EAAAJ,GAAA;EAAA,IAAAA,GAAA,IAAAK,OAAA,IAAAA,OAAA,CAAAL,GAAA,MAAAS,oBAAA,CAAAT,GAAA;EAAAH,MAAA,CAAAS,cAAA,CAAAD,OAAA,EAAAL,GAAA;IAAAO,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAC,oBAAA,CAAAT,GAAA;IAAA;EAAA;AAAA","ignoreList":[]}
|
package/lib/es6/NoticeBubble.js
CHANGED
|
@@ -17,23 +17,23 @@ import CloseIcon from '@semcore/icon/Close/m';
|
|
|
17
17
|
import React from 'react';
|
|
18
18
|
import manager from './NoticeBubbleManager';
|
|
19
19
|
/*!__reshadow-styles__:"./style/notice-bubble.shadow.css"*/
|
|
20
|
-
const style = (/*__reshadow_css_start__*/_sstyled.insert(/*__inner_css_start__*/".
|
|
20
|
+
const style = (/*__reshadow_css_start__*/_sstyled.insert(/*__inner_css_start__*/".___SBubble_10xy2_gg_,.___SView_10xy2_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,oklch(.999 .001 180/.949));gap:var(--intergalactic-spacing-2x,8px)}.___SBubble_10xy2_gg_._type_info_10xy2_gg_,.___SView_10xy2_gg_._type_info_10xy2_gg_{background:var(--intergalactic-bg-primary-invert,oklch(.23 .01 140))}.___SBubble_10xy2_gg_._type_warning_10xy2_gg_,.___SView_10xy2_gg_._type_warning_10xy2_gg_{background:var(--intergalactic-bg-primary-critical,oklch(.64 .226 24.5))}.___SContent_10xy2_gg_{flex-direction:column;gap:var(--intergalactic-spacing-2x,8px);flex:1}.___SMessage_10xy2_gg_{font-size:var(--intergalactic-fs-200,14px);line-height:var(--intergalactic-lh-200,142%)}.___SDismiss_10xy2_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_10xy2_gg_.__use_10xy2_gg_{padding:0 1px}.___SIcon_10xy2_gg_{justify-content:center;align-items:center;height:var(--intergalactic-spacing-5x,20px)}.___SNoticeBubble_10xy2_gg_{width:300px;position:fixed;right:var(--intergalactic-spacing-3x,12px);top:var(--intergalactic-spacing-3x,12px)}@media (max-width:767px){.___SNoticeBubble_10xy2_gg_{width:calc(100% - var(--intergalactic-spacing-6x, 24px))}}.___SNoticeBubble_10xy2_gg_.__disablePortal_10xy2_gg_{position:sticky;margin-left:auto;height:0}.___SMessage_10xy2_gg_ a{color:var(--intergalactic-text-link-invert,oklch(.75 .125 265.3))}.___SNoticeAriaLiveWrapper_10xy2_gg_{display:contents}@keyframes enter_10xy2{0%{transform:translate(100%);max-height:0;overflow:hidden}to{transform:translate(0);max-height:100vh;overflow:hidden}}@keyframes exit_10xy2{0%{max-height:100vh;overflow:hidden;opacity:1}to{max-height:0;overflow:hidden;opacity:0}}", /*__inner_css_end__*/"10xy2_gg_"),
|
|
21
21
|
/*__reshadow_css_end__*/
|
|
22
22
|
{
|
|
23
|
-
"__SContent": "
|
|
24
|
-
"__SMessage": "
|
|
25
|
-
"__SDismiss": "
|
|
26
|
-
"_use": "
|
|
27
|
-
"__SIcon": "
|
|
28
|
-
"__SNoticeBubble": "
|
|
29
|
-
"_disablePortal": "
|
|
30
|
-
"__SNoticeAriaLiveWrapper": "
|
|
31
|
-
"@enter": "
|
|
32
|
-
"@exit": "
|
|
33
|
-
"__SBubble": "
|
|
34
|
-
"__SView": "
|
|
35
|
-
"_type_info": "
|
|
36
|
-
"_type_warning": "
|
|
23
|
+
"__SContent": "___SContent_10xy2_gg_",
|
|
24
|
+
"__SMessage": "___SMessage_10xy2_gg_",
|
|
25
|
+
"__SDismiss": "___SDismiss_10xy2_gg_",
|
|
26
|
+
"_use": "__use_10xy2_gg_",
|
|
27
|
+
"__SIcon": "___SIcon_10xy2_gg_",
|
|
28
|
+
"__SNoticeBubble": "___SNoticeBubble_10xy2_gg_",
|
|
29
|
+
"_disablePortal": "__disablePortal_10xy2_gg_",
|
|
30
|
+
"__SNoticeAriaLiveWrapper": "___SNoticeAriaLiveWrapper_10xy2_gg_",
|
|
31
|
+
"@enter": "enter_10xy2",
|
|
32
|
+
"@exit": "exit_10xy2",
|
|
33
|
+
"__SBubble": "___SBubble_10xy2_gg_",
|
|
34
|
+
"__SView": "___SView_10xy2_gg_",
|
|
35
|
+
"_type_info": "_type_info_10xy2_gg_",
|
|
36
|
+
"_type_warning": "_type_warning_10xy2_gg_"
|
|
37
37
|
});
|
|
38
38
|
import { localizedMessages } from './translations/__intergalactic-dynamic-locales';
|
|
39
39
|
import { Timer } from './utils';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NoticeBubble.js","names":["Animation","Box","Flex","Portal","Button","createComponent","Component","sstyled","Root","i18nEnhance","fire","isNode","useForkRef","contextThemeEnhance","setFocus","isFocusInside","useFocusLock","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","isFocusInBubble","event","paused","rect","current","getBoundingClientRect","mouseInRect","clientX","left","right","clientY","top","bottom","document","body","addEventListener","handleBodyMouseMove","triggerButtonComponent","activeElement","componentWillUnmount","triggerElement","HTMLElement","removeEventListener","noticeElement","clear","_ref6","SBubble","SDismiss","SContent","SMessage","SAction","SIcon","visible","initialAnimation","animationDuration","icon","children","action","handleMouseEnter","handleMouseLeave","handleFocus","handleBlur","handleKeydown","handleClick","undefined","closeButtonRef","Addon","color","Fragment","NoticeBubbleContainer"],"sources":["../../src/NoticeBubble.tsx"],"sourcesContent":["import { Animation, Box, Flex, Portal, ScreenReaderOnly } from '@semcore/base-components';\nimport Button from '@semcore/button';\nimport { createComponent, Component, sstyled, Root, lastInteraction } 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 { setFocus, isFocusInside, useFocusLock } 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 triggerButtonComponent: Element | null = null;\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 this.triggerButtonComponent = document.activeElement;\n }\n\n componentWillUnmount() {\n const triggerElement = this.triggerButtonComponent;\n if (this.ref.current && isFocusInside(this.ref.current) && triggerElement instanceof HTMLElement) {\n setTimeout(() => setFocus(triggerElement), 0);\n }\n\n this.clearTimer();\n document.body.removeEventListener('mousemove', this.handleBodyMouseMove);\n }\n\n isFocusInBubble() {\n const noticeElement = this.ref.current;\n\n return noticeElement ? isFocusInside(noticeElement) : false;\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 handleFocus = () => {\n this.timer?.pause();\n };\n\n handleBlur = () => {\n this.timer?.resume();\n };\n\n handleClick = () => {\n this.timer?.pause();\n };\n\n handleMouseEnter = () => {\n this.timer?.pause();\n };\n\n handleMouseLeave = () => {\n if (!this.timer || this.isFocusInBubble()) return;\n this.timer.resume();\n };\n\n handleBodyMouseMove = (event: MouseEvent) => {\n if (!this.timer?.paused || this.isFocusInBubble()) 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 render={Flex}\n type={type}\n ref={this.ref}\n onMouseEnter={this.handleMouseEnter}\n onMouseLeave={this.handleMouseLeave}\n onFocus={this.handleFocus}\n onBlur={this.handleBlur}\n onKeyDown={this.handleKeydown}\n onClick={this.handleClick}\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,QAA0B,0BAA0B;AACzF,OAAOC,MAAM,MAAM,iBAAiB;AACpC,SAASC,eAAe,EAAEC,SAAS,EAAEC,OAAO,EAAEC,IAAI,QAAyB,eAAe;AAG1F,OAAOC,WAAW,MAAM,8CAA8C;AACtE,OAAOC,IAAI,MAAM,8BAA8B;AAE/C,OAAOC,MAAM,MAAM,gCAAgC;AACnD,SAASC,UAAU,QAAQ,6BAA6B;AACxD,SAASC,mBAAmB,QAAQ,uCAAuC;AAC3E,SAASC,QAAQ,EAAEC,aAAa,EAAEC,YAAY,QAAQ,0CAA0C;AAChG,SAASC,kBAAkB,QAAQ,wCAAwC;AAC3E,SACEC,6BAA6B,EAC7BC,qBAAqB,QAChB,wCAAwC;AAC/C,OAAOC,SAAS,MAAM,uBAAuB;AAC7C,OAAOC,KAAK,MAAM,OAAO;AAQzB,OAAOC,OAAO,MAAM,u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,KAAA,CAAAqI,QAAA,qBACErI,KAAA,CAAA0C,aAAA,CAAC0E,KAAK,EAAAN,KAAA,CAAAlE,EAAA,eAAE4E,IAAY,CAAC,eACrBxH,KAAA,CAAA0C,aAAA,CAACuE,QAAQ,EAAAH,KAAA,CAAAlE,EAAA,+BACP5C,KAAA,CAAA0C,aAAA,CAACwE,QAAQ,EAAAJ,KAAA,CAAAlE,EAAA,kBAAE6E,QAAmB,CAAC,EAC9BnI,MAAM,CAACoI,MAAM,CAAC,gBAAG1H,KAAA,CAAA0C,aAAA,CAACyE,OAAO,EAAAL,KAAA,CAAAlE,EAAA,iBAAE8E,MAAgB,CAAC,GAAG,IACxC,CACV,CAAC,gBAGH1H,KAAA,CAAA0C,aAAA,CAACuE,QAAQ,EAAAH,KAAA,CAAAlE,EAAA,+BACP5C,KAAA,CAAA0C,aAAA,CAACwE,QAAQ,EAAAJ,KAAA,CAAAlE,EAAA,kBAAE6E,QAAmB,CAAC,EAC9BnI,MAAM,CAACoI,MAAM,CAAC,gBAAG1H,KAAA,CAAA0C,aAAA,CAACyE,OAAO,EAAAL,KAAA,CAAAlE,EAAA,iBAAE8E,MAAgB,CAAC,GAAG,IACxC,CAET,CACA,CAAC;EAEhB;AACF;AAEA,MAAMlF,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,MAAMsG,qBAAqB,GAAGtJ,eAAe,CAG3CuB,yBAAyB,CAAC;AAE5B,eAAe+H,qBAAqB","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"NoticeBubble.js","names":["Animation","Box","Flex","Portal","Button","createComponent","Component","sstyled","Root","i18nEnhance","fire","isNode","useForkRef","contextThemeEnhance","setFocus","isFocusInside","useFocusLock","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","isFocusInBubble","event","paused","rect","current","getBoundingClientRect","mouseInRect","clientX","left","right","clientY","top","bottom","document","body","addEventListener","handleBodyMouseMove","triggerButtonComponent","activeElement","componentWillUnmount","triggerElement","HTMLElement","removeEventListener","noticeElement","clear","_ref6","SBubble","SDismiss","SContent","SMessage","SAction","SIcon","visible","initialAnimation","animationDuration","icon","children","action","handleMouseEnter","handleMouseLeave","handleFocus","handleBlur","handleKeydown","handleClick","undefined","closeButtonRef","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 isNode from '@semcore/core/lib/utils/isNode';\nimport { useForkRef } from '@semcore/core/lib/utils/ref';\nimport { contextThemeEnhance } from '@semcore/core/lib/utils/ThemeProvider';\nimport { setFocus, isFocusInside, useFocusLock } 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 { NSNoticeBubble } from './NoticeBubble.type';\nimport manager from './NoticeBubbleManager';\nimport style from './style/notice-bubble.shadow.css';\nimport { localizedMessages } from './translations/__intergalactic-dynamic-locales';\nimport { Timer } from './utils';\n\nclass NoticeBubbleContainerRoot extends Component<\n Intergalactic.InternalTypings.InferComponentProps<NSNoticeBubble.Container.Component>,\n typeof NoticeBubbleContainerRoot.enhance,\n {},\n WithI18nEnhanceProps,\n NSNoticeBubble.Container.State,\n NSNoticeBubble.Container.DefaultProps\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: NSNoticeBubble.Container.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: NSNoticeBubble.Item[]) => {\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<NSNoticeBubble.ViewItemProps, '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<NSNoticeBubble.ViewItemProps> {\n timer: Timer | null = null;\n ref = React.createRef<HTMLDivElement>();\n closeButtonRef = React.createRef<HTMLButtonElement>();\n triggerButtonComponent: Element | null = null;\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 this.triggerButtonComponent = document.activeElement;\n }\n\n componentWillUnmount() {\n const triggerElement = this.triggerButtonComponent;\n if (this.ref.current && isFocusInside(this.ref.current) && triggerElement instanceof HTMLElement) {\n setTimeout(() => setFocus(triggerElement), 0);\n }\n\n this.clearTimer();\n document.body.removeEventListener('mousemove', this.handleBodyMouseMove);\n }\n\n isFocusInBubble() {\n const noticeElement = this.ref.current;\n\n return noticeElement ? isFocusInside(noticeElement) : false;\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 handleFocus = () => {\n this.timer?.pause();\n };\n\n handleBlur = () => {\n this.timer?.resume();\n };\n\n handleClick = () => {\n this.timer?.pause();\n };\n\n handleMouseEnter = () => {\n this.timer?.pause();\n };\n\n handleMouseLeave = () => {\n if (!this.timer || this.isFocusInBubble()) return;\n this.timer.resume();\n };\n\n handleBodyMouseMove = (event: MouseEvent) => {\n if (!this.timer?.paused || this.isFocusInBubble()) 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 render={Flex}\n type={type}\n ref={this.ref}\n onMouseEnter={this.handleMouseEnter}\n onMouseLeave={this.handleMouseLeave}\n onFocus={this.handleFocus}\n onBlur={this.handleBlur}\n onKeyDown={this.handleKeydown}\n onClick={this.handleClick}\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 NSNoticeBubble.Container.Component,\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,OAAOC,MAAM,MAAM,gCAAgC;AACnD,SAASC,UAAU,QAAQ,6BAA6B;AACxD,SAASC,mBAAmB,QAAQ,uCAAuC;AAC3E,SAASC,QAAQ,EAAEC,aAAa,EAAEC,YAAY,QAAQ,0CAA0C;AAChG,SAASC,kBAAkB,QAAQ,wCAAwC;AAC3E,SACEC,6BAA6B,EAC7BC,qBAAqB,QAChB,wCAAwC;AAC/C,OAAOC,SAAS,MAAM,uBAAuB;AAC7C,OAAOC,KAAK,MAAM,OAAO;AAGzB,OAAOC,OAAO,MAAM,uBAAuB;AAAC;AAAA,MAAAC,KAAA,8BAAAC,QAAA,CAAAC,MAAA;AAAA;AAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;AAAA;AAE5C,SAASC,iBAAiB,QAAQ,gDAAgD;AAClF,SAASC,KAAK,QAAQ,SAAS;AAE/B,MAAMC,yBAAyB,SAAStB,SAAS,CAO/C;EAAAuB,YAAA,GAAAC,IAAA;IAAA,SAAAA,IAAA;IAAAC,e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AA0C,aAAA,CAACyE,OAAO,EAAAL,KAAA,CAAAlE,EAAA,iBAAE8E,MAAgB,CAAC,GAAG,IACxC,CACV,CAAC,gBAGH1H,KAAA,CAAA0C,aAAA,CAACuE,QAAQ,EAAAH,KAAA,CAAAlE,EAAA,+BACP5C,KAAA,CAAA0C,aAAA,CAACwE,QAAQ,EAAAJ,KAAA,CAAAlE,EAAA,kBAAE6E,QAAmB,CAAC,EAC9BnI,MAAM,CAACoI,MAAM,CAAC,gBAAG1H,KAAA,CAAA0C,aAAA,CAACyE,OAAO,EAAAL,KAAA,CAAAlE,EAAA,iBAAE8E,MAAgB,CAAC,GAAG,IACxC,CAET,CACA,CAAC;EAEhB;AACF;AAEA,MAAMlF,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,MAAMsG,qBAAqB,GAAGtJ,eAAe,CAG3CuB,yBAAyB,CAAC;AAE5B,eAAe+H,qBAAqB","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NoticeBubble.type.js","names":[],"sources":["../../src/NoticeBubble.type.ts"],"sourcesContent":["import type {
|
|
1
|
+
{"version":3,"file":"NoticeBubble.type.js","names":[],"sources":["../../src/NoticeBubble.type.ts"],"sourcesContent":["import type { NSPortal, NSBox } 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 { LocalizedMessages } from './translations/__intergalactic-dynamic-locales';\n\ndeclare namespace NSNoticeBubble {\n type Props = NSBox.Props & {\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 * @deprecated\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?: NSNoticeBubble.Manager;\n icon?: React.ReactElement;\n };\n type Item = (NSNoticeBubble.Info.Props | NSNoticeBubble.Warning.Props) & {\n uid: number;\n visible: boolean;\n forwardRef: RefObject<HTMLElement>;\n onClose: () => void;\n };\n type ViewItemProps = NSNoticeBubble.Props & {\n containerNode?: HTMLElement;\n animationDuration: number;\n getI18nText: ReturnType<typeof useI18n>;\n styles: React.DetailedHTMLProps<React.StyleHTMLAttributes<HTMLStyleElement>, HTMLStyleElement> | undefined;\n };\n type Meta = {\n uid: number;\n update: (props: Info.Props | Warning.Props) => Promise<NSNoticeBubble.Meta>;\n remove: () => boolean;\n ref: RefObject<HTMLElement>;\n };\n type Manager = {\n /**\n * Creates and shows a notice.\n * */\n add: (props: NSNoticeBubble.Info.Props | NSNoticeBubble.Warning.Props) => NSNoticeBubble.Meta;\n /**\n * Removes notice by uid.\n * */\n remove: (uid: number) => boolean;\n /**\n * Replace notice by uid.\n */\n replace: (uid: number, props: NSNoticeBubble.Info.Props | NSNoticeBubble.Warning.Props) => void;\n /**\n * Replace last notice (if it is existing)\n */\n replaceLast: (props: NSNoticeBubble.Info.Props | NSNoticeBubble.Warning.Props) => void;\n /** Add change listener */\n addListener: (fn: (items: NSNoticeBubble.Item[]) => void) => () => void;\n };\n\n namespace Container {\n type Props = NSBox.Props &\n NSPortal.Props & {\n /** Ref to mount bubbles in. You should use element form window.sm2.getNoticeBubbleContainer() */\n containerNode?: HTMLElement | null;\n /** Manager copy */\n manager?: NSNoticeBubble.Manager;\n /** Specifies the locale for i18n support */\n locale?: string;\n };\n type DefaultProps = {\n manager: NSNoticeBubble.Manager;\n i18n: LocalizedMessages;\n locale: 'en';\n };\n type State = {\n notices: NSNoticeBubble.Item[];\n infos: NSNoticeBubble.Item[];\n warnings: NSNoticeBubble.Item[];\n };\n\n type Component = Intergalactic.Component<'div', Props>;\n }\n\n namespace Info {\n type Props = NSNoticeBubble.Props & {\n readonly type?: 'info';\n };\n }\n\n namespace Warning {\n type Props = NSNoticeBubble.Props & {\n readonly type?: 'warning';\n };\n }\n}\n\n/**\n * @deprecated. Pass noticeBubbleContainer property from window.sm2.getNoticeBubbleContainer().\n */\nexport type NoticeBubbleContainerPortalProps = NSPortal.Props;\n/** @deprecated It will be removed in v19. */\nexport type NoticeBubbleContainerProps = NSNoticeBubble.Container.Props;\n/** @deprecated It will be removed in v19. */\nexport type NoticeBubbleContainerDefaultProps = NSNoticeBubble.Container.DefaultProps;\n/** @deprecated It will be removed in v19. */\nexport type NoticeBubbleViewItemProps = NSNoticeBubble.ViewItemProps;\n/** @deprecated It will be removed in v19. */\nexport type NoticeBubbleProps = NSNoticeBubble.Props;\n/** @deprecated It will be removed in v19. */\nexport type NoticeBubbleInfoProps = NSNoticeBubble.Info.Props;\n/** @deprecated It will be removed in v19. */\nexport type NoticeBubbleWarningProps = NSNoticeBubble.Warning.Props;\n/** @deprecated It will be removed in v19. */\nexport type AddedNoticeMeta = NSNoticeBubble.Meta;\n/** @deprecated It will be removed in v19. */\nexport type NoticeBubbleManagerClass = NSNoticeBubble.Manager;\n\nexport type { NSNoticeBubble };\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","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
|
|
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 React from 'react';\n\nimport type { NSNoticeBubble } from './NoticeBubble.type';\n\nconst EVENT_NAME = 'CHANGE';\n\nclass NoticeBubbleManager implements NSNoticeBubble.Manager {\n private items: NSNoticeBubble.Item[] = [];\n private emitter = new EventEmitter();\n private counter = 0;\n\n public addListener(fn: (items: NSNoticeBubble.Item[]) => 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: NSNoticeBubble.Info.Props | NSNoticeBubble.Warning.Props): NSNoticeBubble.Meta {\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: NSNoticeBubble.Info.Props | NSNoticeBubble.Warning.Props): Promise<NSNoticeBubble.Meta> {\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: NSNoticeBubble.Info.Props | NSNoticeBubble.Warning.Props): Promise<NSNoticeBubble.Meta> {\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,SAASA,oBAAoB,QAAQ,qCAAqC;AAC1E,OAAOC,YAAY,MAAM,sCAAsC;AAC/D,OAAOC,KAAK,MAAM,OAAO;AAIzB,MAAMC,UAAU,GAAG,QAAQ;AAE3B,MAAMC,mBAAmB,CAAmC;EAAAC,YAAA;IAAAC,eAAA,gBACnB,EAAE;IAAAA,eAAA,kBACvB,IAAIL,YAAY,CAAC,CAAC;IAAAK,eAAA,kBAClB,CAAC;EAAA;EAEZC,WAAWA,CAACC,EAA0C,EAAc;IACzE,OAAO,IAAI,CAACC,OAAO,CAACC,SAAS,CAACP,UAAU,EAAEK,EAAE,CAAC;EAC/C;EAEQG,IAAIA,CAAA,EAAG;IACb,IAAI,CAACF,OAAO,CAACE,IAAI,CAACR,UAAU,EAAE,IAAI,CAACS,KAAK,CAAC;EAC3C;EAEOC,GAAGA,CAACC,KAA+D,EAAuB;IAC/F,MAAMC,GAAG,GAAG,IAAI,CAACC,OAAO,EAAE;IAC1B,MAAMC,GAAG,gBAAGf,KAAK,CAACgB,SAAS,CAAc,CAAC;IAE1C,MAAMC,IAAI,GAAG;MACXC,IAAI,EAAE,MAAM;MACZL,GAAG;MACHM,OAAO,EAAE,IAAI;MACbC,UAAU,EAAEL,GAAG;MACf,GAAGH,K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AAEf,IAAI,IAAKA,IAAI,CAACJ,GAAG,KAAKA,GAAG,CAAC;IACxD,IAAII,IAAI,EAAE;MACRA,IAAI,CAACE,OAAO,GAAG,KAAK;MACpBU,UAAU,CAAC,MAAM;QACf,IAAI,CAACnB,KAAK,GAAG,IAAI,CAACA,KAAK,CAACuB,MAAM,CAAEhB,IAAI,IAAKA,IAAI,CAACJ,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;AAEA,MAAMyB,0BAA0B,GAAG,IAAIhC,mBAAmB,CAAC,CAAC;AAE5D,SAASA,mBAAmB;AAC5B,eAAegC,0BAA0B","ignoreList":[]}
|
package/lib/es6/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["default","NoticeBubbleContainer","noticeBubbleDefaultManager"],"sources":["../../src/index.ts"],"sourcesContent":["import { default as NoticeBubbleContainer } from './NoticeBubble';\nimport type {\n NoticeBubbleContainerProps,\n NoticeBubbleInfoProps,\n NoticeBubbleWarningProps,\n AddedNoticeMeta,\n} from './NoticeBubble.type';\nimport { default as noticeBubbleDefaultManager } from './NoticeBubbleManager';\n\nexport * from './NoticeBubble';\n\nexport * from './NoticeBubbleManager';\n\nexport { NoticeBubbleContainer, noticeBubbleDefaultManager };\n\nexport type {\n NoticeBubbleContainerProps,\n NoticeBubbleInfoProps,\n NoticeBubbleWarningProps,\n AddedNoticeMeta,\n};\n"],"mappings":"AAAA,SAASA,OAAO,IAAIC,qBAAqB,QAAQ,gBAAgB;
|
|
1
|
+
{"version":3,"file":"index.js","names":["default","NoticeBubbleContainer","noticeBubbleDefaultManager"],"sources":["../../src/index.ts"],"sourcesContent":["import { default as NoticeBubbleContainer } from './NoticeBubble';\nimport type {\n NoticeBubbleContainerProps,\n NoticeBubbleInfoProps,\n NoticeBubbleWarningProps,\n AddedNoticeMeta,\n NSNoticeBubble,\n} from './NoticeBubble.type';\nimport { default as noticeBubbleDefaultManager } from './NoticeBubbleManager';\n\nexport * from './NoticeBubble';\n\nexport * from './NoticeBubbleManager';\n\nexport { NoticeBubbleContainer, noticeBubbleDefaultManager };\n\nexport type {\n NoticeBubbleContainerProps,\n NoticeBubbleInfoProps,\n NoticeBubbleWarningProps,\n AddedNoticeMeta,\n NSNoticeBubble,\n};\n"],"mappings":"AAAA,SAASA,OAAO,IAAIC,qBAAqB,QAAQ,gBAAgB;AAQjE,SAASD,OAAO,IAAIE,0BAA0B,QAAQ,uBAAuB;AAE7E,cAAc,gBAAgB;AAE9B,cAAc,uBAAuB;AAErC,SAASD,qBAAqB,EAAEC,0BAA0B","ignoreList":[]}
|
package/lib/esm/NoticeBubble.mjs
CHANGED
|
@@ -21,25 +21,25 @@ const style = (
|
|
|
21
21
|
/*__reshadow_css_start__*/
|
|
22
22
|
(sstyled.insert(
|
|
23
23
|
/*__inner_css_start__*/
|
|
24
|
-
".
|
|
24
|
+
".___SBubble_10xy2_gg_,.___SView_10xy2_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,oklch(.999 .001 180/.949));gap:var(--intergalactic-spacing-2x,8px)}.___SBubble_10xy2_gg_._type_info_10xy2_gg_,.___SView_10xy2_gg_._type_info_10xy2_gg_{background:var(--intergalactic-bg-primary-invert,oklch(.23 .01 140))}.___SBubble_10xy2_gg_._type_warning_10xy2_gg_,.___SView_10xy2_gg_._type_warning_10xy2_gg_{background:var(--intergalactic-bg-primary-critical,oklch(.64 .226 24.5))}.___SContent_10xy2_gg_{flex-direction:column;gap:var(--intergalactic-spacing-2x,8px);flex:1}.___SMessage_10xy2_gg_{font-size:var(--intergalactic-fs-200,14px);line-height:var(--intergalactic-lh-200,142%)}.___SDismiss_10xy2_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_10xy2_gg_.__use_10xy2_gg_{padding:0 1px}.___SIcon_10xy2_gg_{justify-content:center;align-items:center;height:var(--intergalactic-spacing-5x,20px)}.___SNoticeBubble_10xy2_gg_{width:300px;position:fixed;right:var(--intergalactic-spacing-3x,12px);top:var(--intergalactic-spacing-3x,12px)}@media (max-width:767px){.___SNoticeBubble_10xy2_gg_{width:calc(100% - var(--intergalactic-spacing-6x, 24px))}}.___SNoticeBubble_10xy2_gg_.__disablePortal_10xy2_gg_{position:sticky;margin-left:auto;height:0}.___SMessage_10xy2_gg_ a{color:var(--intergalactic-text-link-invert,oklch(.75 .125 265.3))}.___SNoticeAriaLiveWrapper_10xy2_gg_{display:contents}@keyframes enter_10xy2{0%{transform:translate(100%);max-height:0;overflow:hidden}to{transform:translate(0);max-height:100vh;overflow:hidden}}@keyframes exit_10xy2{0%{max-height:100vh;overflow:hidden;opacity:1}to{max-height:0;overflow:hidden;opacity:0}}",
|
|
25
25
|
/*__inner_css_end__*/
|
|
26
|
-
"
|
|
26
|
+
"10xy2_gg_"
|
|
27
27
|
), /*__reshadow_css_end__*/
|
|
28
28
|
{
|
|
29
|
-
"__SContent": "
|
|
30
|
-
"__SMessage": "
|
|
31
|
-
"__SDismiss": "
|
|
32
|
-
"_use": "
|
|
33
|
-
"__SIcon": "
|
|
34
|
-
"__SNoticeBubble": "
|
|
35
|
-
"_disablePortal": "
|
|
36
|
-
"__SNoticeAriaLiveWrapper": "
|
|
37
|
-
"@enter": "
|
|
38
|
-
"@exit": "
|
|
39
|
-
"__SBubble": "
|
|
40
|
-
"__SView": "
|
|
41
|
-
"_type_info": "
|
|
42
|
-
"_type_warning": "
|
|
29
|
+
"__SContent": "___SContent_10xy2_gg_",
|
|
30
|
+
"__SMessage": "___SMessage_10xy2_gg_",
|
|
31
|
+
"__SDismiss": "___SDismiss_10xy2_gg_",
|
|
32
|
+
"_use": "__use_10xy2_gg_",
|
|
33
|
+
"__SIcon": "___SIcon_10xy2_gg_",
|
|
34
|
+
"__SNoticeBubble": "___SNoticeBubble_10xy2_gg_",
|
|
35
|
+
"_disablePortal": "__disablePortal_10xy2_gg_",
|
|
36
|
+
"__SNoticeAriaLiveWrapper": "___SNoticeAriaLiveWrapper_10xy2_gg_",
|
|
37
|
+
"@enter": "enter_10xy2",
|
|
38
|
+
"@exit": "exit_10xy2",
|
|
39
|
+
"__SBubble": "___SBubble_10xy2_gg_",
|
|
40
|
+
"__SView": "___SView_10xy2_gg_",
|
|
41
|
+
"_type_info": "_type_info_10xy2_gg_",
|
|
42
|
+
"_type_warning": "_type_warning_10xy2_gg_"
|
|
43
43
|
})
|
|
44
44
|
);
|
|
45
45
|
class NoticeBubbleContainerRoot extends Component {
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import type { NoticeBubbleContainerProps } from './NoticeBubble.type';
|
|
1
|
+
import type { NSNoticeBubble } from './NoticeBubble.type';
|
|
3
2
|
/**
|
|
4
3
|
* NoticeBubble
|
|
5
4
|
*
|
|
6
5
|
* {@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
6
|
*/
|
|
8
|
-
declare const NoticeBubbleContainer:
|
|
7
|
+
declare const NoticeBubbleContainer: NSNoticeBubble.Container.Component;
|
|
9
8
|
export default NoticeBubbleContainer;
|
|
9
|
+
//# sourceMappingURL=NoticeBubble.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"NoticeBubble.d.ts","sourceRoot":"","sources":["../../src/NoticeBubble.tsx"],"names":[],"mappings":"AAmBA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAwV1D;;;;GAIG;AACH,QAAA,MAAM,qBAAqB,oCAGC,CAAC;AAE7B,eAAe,qBAAqB,CAAC"}
|
|
@@ -1,102 +1,138 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { NSPortal, NSBox } 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
5
|
import type { LocalizedMessages } from './translations/__intergalactic-dynamic-locales';
|
|
6
|
+
declare namespace NSNoticeBubble {
|
|
7
|
+
type Props = NSBox.Props & {
|
|
8
|
+
/** Notice type */
|
|
9
|
+
type?: 'info' | 'warning';
|
|
10
|
+
/**
|
|
11
|
+
* Notice display duration. Set to 0 to disable auto-close.
|
|
12
|
+
*/
|
|
13
|
+
duration?: number;
|
|
14
|
+
/**
|
|
15
|
+
* Enables animation on first rendering.
|
|
16
|
+
* @default false
|
|
17
|
+
*/
|
|
18
|
+
initialAnimation?: boolean;
|
|
19
|
+
/**
|
|
20
|
+
* Use it for complex notices with important controls.
|
|
21
|
+
* If enabled, browser focus will be locked in the notice
|
|
22
|
+
* until it's closed. After close focus should return to the element
|
|
23
|
+
* where it was placed before notice appear.
|
|
24
|
+
*
|
|
25
|
+
* @deprecated
|
|
26
|
+
*/
|
|
27
|
+
focusLock?: boolean;
|
|
28
|
+
/**
|
|
29
|
+
* Notice visibility.
|
|
30
|
+
*/
|
|
31
|
+
visible?: boolean;
|
|
32
|
+
/**
|
|
33
|
+
* Control under the notice children.
|
|
34
|
+
* */
|
|
35
|
+
action?: React.ReactNode;
|
|
36
|
+
/**
|
|
37
|
+
* Callback triggered by "Close" icon click.
|
|
38
|
+
* */
|
|
39
|
+
onClose?: (e?: React.SyntheticEvent) => void;
|
|
40
|
+
/**
|
|
41
|
+
* Notice content.
|
|
42
|
+
* */
|
|
43
|
+
children?: React.ReactNode;
|
|
44
|
+
manager?: NSNoticeBubble.Manager;
|
|
45
|
+
icon?: React.ReactElement;
|
|
46
|
+
};
|
|
47
|
+
type Item = (NSNoticeBubble.Info.Props | NSNoticeBubble.Warning.Props) & {
|
|
48
|
+
uid: number;
|
|
49
|
+
visible: boolean;
|
|
50
|
+
forwardRef: RefObject<HTMLElement>;
|
|
51
|
+
onClose: () => void;
|
|
52
|
+
};
|
|
53
|
+
type ViewItemProps = NSNoticeBubble.Props & {
|
|
54
|
+
containerNode?: HTMLElement;
|
|
55
|
+
animationDuration: number;
|
|
56
|
+
getI18nText: ReturnType<typeof useI18n>;
|
|
57
|
+
styles: React.DetailedHTMLProps<React.StyleHTMLAttributes<HTMLStyleElement>, HTMLStyleElement> | undefined;
|
|
58
|
+
};
|
|
59
|
+
type Meta = {
|
|
60
|
+
uid: number;
|
|
61
|
+
update: (props: Info.Props | Warning.Props) => Promise<NSNoticeBubble.Meta>;
|
|
62
|
+
remove: () => boolean;
|
|
63
|
+
ref: RefObject<HTMLElement>;
|
|
64
|
+
};
|
|
65
|
+
type Manager = {
|
|
66
|
+
/**
|
|
67
|
+
* Creates and shows a notice.
|
|
68
|
+
* */
|
|
69
|
+
add: (props: NSNoticeBubble.Info.Props | NSNoticeBubble.Warning.Props) => NSNoticeBubble.Meta;
|
|
70
|
+
/**
|
|
71
|
+
* Removes notice by uid.
|
|
72
|
+
* */
|
|
73
|
+
remove: (uid: number) => boolean;
|
|
74
|
+
/**
|
|
75
|
+
* Replace notice by uid.
|
|
76
|
+
*/
|
|
77
|
+
replace: (uid: number, props: NSNoticeBubble.Info.Props | NSNoticeBubble.Warning.Props) => void;
|
|
78
|
+
/**
|
|
79
|
+
* Replace last notice (if it is existing)
|
|
80
|
+
*/
|
|
81
|
+
replaceLast: (props: NSNoticeBubble.Info.Props | NSNoticeBubble.Warning.Props) => void;
|
|
82
|
+
/** Add change listener */
|
|
83
|
+
addListener: (fn: (items: NSNoticeBubble.Item[]) => void) => () => void;
|
|
84
|
+
};
|
|
85
|
+
namespace Container {
|
|
86
|
+
type Props = NSBox.Props & NSPortal.Props & {
|
|
87
|
+
/** Ref to mount bubbles in. You should use element form window.sm2.getNoticeBubbleContainer() */
|
|
88
|
+
containerNode?: HTMLElement | null;
|
|
89
|
+
/** Manager copy */
|
|
90
|
+
manager?: NSNoticeBubble.Manager;
|
|
91
|
+
/** Specifies the locale for i18n support */
|
|
92
|
+
locale?: string;
|
|
93
|
+
};
|
|
94
|
+
type DefaultProps = {
|
|
95
|
+
manager: NSNoticeBubble.Manager;
|
|
96
|
+
i18n: LocalizedMessages;
|
|
97
|
+
locale: 'en';
|
|
98
|
+
};
|
|
99
|
+
type State = {
|
|
100
|
+
notices: NSNoticeBubble.Item[];
|
|
101
|
+
infos: NSNoticeBubble.Item[];
|
|
102
|
+
warnings: NSNoticeBubble.Item[];
|
|
103
|
+
};
|
|
104
|
+
type Component = Intergalactic.Component<'div', Props>;
|
|
105
|
+
}
|
|
106
|
+
namespace Info {
|
|
107
|
+
type Props = NSNoticeBubble.Props & {
|
|
108
|
+
readonly type?: 'info';
|
|
109
|
+
};
|
|
110
|
+
}
|
|
111
|
+
namespace Warning {
|
|
112
|
+
type Props = NSNoticeBubble.Props & {
|
|
113
|
+
readonly type?: 'warning';
|
|
114
|
+
};
|
|
115
|
+
}
|
|
116
|
+
}
|
|
7
117
|
/**
|
|
8
|
-
* @deprecated. Pass noticeBubbleContainer property from window.sm2.getNoticeBubbleContainer()
|
|
118
|
+
* @deprecated. Pass noticeBubbleContainer property from window.sm2.getNoticeBubbleContainer().
|
|
9
119
|
*/
|
|
10
|
-
export type NoticeBubbleContainerPortalProps =
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
export type
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
};
|
|
30
|
-
export type NoticeBubbleProps = BoxProps & {
|
|
31
|
-
/** Notice type */
|
|
32
|
-
type?: 'info' | 'warning';
|
|
33
|
-
/**
|
|
34
|
-
* Notice display duration. Set to 0 to disable auto-close.
|
|
35
|
-
*/
|
|
36
|
-
duration?: number;
|
|
37
|
-
/**
|
|
38
|
-
* Enables animation on first rendering.
|
|
39
|
-
* @default false
|
|
40
|
-
*/
|
|
41
|
-
initialAnimation?: boolean;
|
|
42
|
-
/**
|
|
43
|
-
* Use it for complex notices with important controls.
|
|
44
|
-
* If enabled, browser focus will be locked in the notice
|
|
45
|
-
* until it's closed. After close focus should return to the element
|
|
46
|
-
* where it was placed before notice appear.
|
|
47
|
-
*
|
|
48
|
-
* @deprecated
|
|
49
|
-
*/
|
|
50
|
-
focusLock?: boolean;
|
|
51
|
-
/**
|
|
52
|
-
* Notice visibility.
|
|
53
|
-
*/
|
|
54
|
-
visible?: boolean;
|
|
55
|
-
/**
|
|
56
|
-
* Control under the notice children.
|
|
57
|
-
* */
|
|
58
|
-
action?: React.ReactNode;
|
|
59
|
-
/**
|
|
60
|
-
* Callback triggered by "Close" icon click.
|
|
61
|
-
* */
|
|
62
|
-
onClose?: (e?: React.SyntheticEvent) => void;
|
|
63
|
-
/**
|
|
64
|
-
* Notice content.
|
|
65
|
-
* */
|
|
66
|
-
children?: React.ReactNode;
|
|
67
|
-
manager?: NoticeBubbleManagerClass;
|
|
68
|
-
icon?: React.ReactElement;
|
|
69
|
-
};
|
|
70
|
-
export type NoticeBubbleInfoProps = NoticeBubbleProps & {
|
|
71
|
-
readonly type?: 'info';
|
|
72
|
-
};
|
|
73
|
-
export type NoticeBubbleWarningProps = NoticeBubbleProps & {
|
|
74
|
-
readonly type?: 'warning';
|
|
75
|
-
};
|
|
76
|
-
export type AddedNoticeMeta = {
|
|
77
|
-
uid: number;
|
|
78
|
-
update: (props: NoticeBubbleInfoProps | NoticeBubbleWarningProps) => Promise<AddedNoticeMeta>;
|
|
79
|
-
remove: () => boolean;
|
|
80
|
-
ref: RefObject<HTMLElement>;
|
|
81
|
-
};
|
|
82
|
-
export type NoticeBubbleManagerClass = {
|
|
83
|
-
/**
|
|
84
|
-
* Creates and shows a notice.
|
|
85
|
-
* */
|
|
86
|
-
add: (props: NoticeBubbleInfoProps | NoticeBubbleWarningProps) => AddedNoticeMeta;
|
|
87
|
-
/**
|
|
88
|
-
* Removes notice by uid.
|
|
89
|
-
* */
|
|
90
|
-
remove: (uid: number) => boolean;
|
|
91
|
-
/**
|
|
92
|
-
* Replace notice by uid.
|
|
93
|
-
*/
|
|
94
|
-
replace: (uid: number, props: NoticeBubbleInfoProps | NoticeBubbleWarningProps) => void;
|
|
95
|
-
/**
|
|
96
|
-
* Replace last notice (if it is existing)
|
|
97
|
-
*/
|
|
98
|
-
replaceLast: (props: NoticeBubbleInfoProps | NoticeBubbleWarningProps) => void;
|
|
99
|
-
/** Add change listener */
|
|
100
|
-
addListener: (fn: (items: NoticeItem[]) => void) => (() => void);
|
|
101
|
-
};
|
|
102
|
-
export declare const NoticeBubbleContainer: Intergalactic.Component<'div', NoticeBubbleContainerProps>;
|
|
120
|
+
export type NoticeBubbleContainerPortalProps = NSPortal.Props;
|
|
121
|
+
/** @deprecated It will be removed in v19. */
|
|
122
|
+
export type NoticeBubbleContainerProps = NSNoticeBubble.Container.Props;
|
|
123
|
+
/** @deprecated It will be removed in v19. */
|
|
124
|
+
export type NoticeBubbleContainerDefaultProps = NSNoticeBubble.Container.DefaultProps;
|
|
125
|
+
/** @deprecated It will be removed in v19. */
|
|
126
|
+
export type NoticeBubbleViewItemProps = NSNoticeBubble.ViewItemProps;
|
|
127
|
+
/** @deprecated It will be removed in v19. */
|
|
128
|
+
export type NoticeBubbleProps = NSNoticeBubble.Props;
|
|
129
|
+
/** @deprecated It will be removed in v19. */
|
|
130
|
+
export type NoticeBubbleInfoProps = NSNoticeBubble.Info.Props;
|
|
131
|
+
/** @deprecated It will be removed in v19. */
|
|
132
|
+
export type NoticeBubbleWarningProps = NSNoticeBubble.Warning.Props;
|
|
133
|
+
/** @deprecated It will be removed in v19. */
|
|
134
|
+
export type AddedNoticeMeta = NSNoticeBubble.Meta;
|
|
135
|
+
/** @deprecated It will be removed in v19. */
|
|
136
|
+
export type NoticeBubbleManagerClass = NSNoticeBubble.Manager;
|
|
137
|
+
export type { NSNoticeBubble };
|
|
138
|
+
//# sourceMappingURL=NoticeBubble.type.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"NoticeBubble.type.d.ts","sourceRoot":"","sources":["../../src/NoticeBubble.type.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,0BAA0B,CAAC;AAChE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AACnD,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,2CAA2C,CAAC;AACzE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEvC,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,gDAAgD,CAAC;AAExF,OAAO,WAAW,cAAc,CAAC;IAC/B,KAAK,KAAK,GAAG,KAAK,CAAC,KAAK,GAAG;QACzB,kBAAkB;QAClB,IAAI,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;QAC1B;;WAEG;QACH,QAAQ,CAAC,EAAE,MAAM,CAAC;QAClB;;;WAGG;QACH,gBAAgB,CAAC,EAAE,OAAO,CAAC;QAC3B;;;;;;;WAOG;QACH,SAAS,CAAC,EAAE,OAAO,CAAC;QACpB;;WAEG;QACH,OAAO,CAAC,EAAE,OAAO,CAAC;QAClB;;aAEK;QACL,MAAM,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;QACzB;;aA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;KACxD;IAED,UAAU,IAAI,CAAC;QACb,KAAK,KAAK,GAAG,cAAc,CAAC,KAAK,GAAG;YAClC,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;SACxB,CAAC;KACH;IAED,UAAU,OAAO,CAAC;QAChB,KAAK,KAAK,GAAG,cAAc,CAAC,KAAK,GAAG;YAClC,QAAQ,CAAC,IAAI,CAAC,EAAE,SAAS,CAAC;SAC3B,CAAC;KACH;CACF;AAED;;GAEG;AACH,MAAM,MAAM,gCAAgC,GAAG,QAAQ,CAAC,KAAK,CAAC;AAC9D,6CAA6C;AAC7C,MAAM,MAAM,0BAA0B,GAAG,cAAc,CAAC,SAAS,CAAC,KAAK,CAAC;AACxE,6CAA6C;AAC7C,MAAM,MAAM,iCAAiC,GAAG,cAAc,CAAC,SAAS,CAAC,YAAY,CAAC;AACtF,6CAA6C;AAC7C,MAAM,MAAM,yBAAyB,GAAG,cAAc,CAAC,aAAa,CAAC;AACrE,6CAA6C;AAC7C,MAAM,MAAM,iBAAiB,GAAG,cAAc,CAAC,KAAK,CAAC;AACrD,6CAA6C;AAC7C,MAAM,MAAM,qBAAqB,GAAG,cAAc,CAAC,IAAI,CAAC,KAAK,CAAC;AAC9D,6CAA6C;AAC7C,MAAM,MAAM,wBAAwB,GAAG,cAAc,CAAC,OAAO,CAAC,KAAK,CAAC;AACpE,6CAA6C;AAC7C,MAAM,MAAM,eAAe,GAAG,cAAc,CAAC,IAAI,CAAC;AAClD,6CAA6C;AAC7C,MAAM,MAAM,wBAAwB,GAAG,cAAc,CAAC,OAAO,CAAC;AAE9D,YAAY,EAAE,cAAc,EAAE,CAAC"}
|
|
@@ -1,22 +1,16 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
|
|
3
|
-
export type NoticeItem = (NoticeBubbleInfoProps | NoticeBubbleWarningProps) & {
|
|
4
|
-
uid: number;
|
|
5
|
-
visible: boolean;
|
|
6
|
-
forwardRef: RefObject<HTMLElement>;
|
|
7
|
-
onClose: () => void;
|
|
8
|
-
};
|
|
9
|
-
declare class NoticeBubbleManager implements NoticeBubbleManagerClass {
|
|
1
|
+
import type { NSNoticeBubble } from './NoticeBubble.type';
|
|
2
|
+
declare class NoticeBubbleManager implements NSNoticeBubble.Manager {
|
|
10
3
|
private items;
|
|
11
4
|
private emitter;
|
|
12
5
|
private counter;
|
|
13
|
-
addListener(fn: (items:
|
|
6
|
+
addListener(fn: (items: NSNoticeBubble.Item[]) => void): () => void;
|
|
14
7
|
private emit;
|
|
15
|
-
add(props:
|
|
16
|
-
replace(uid: number, props:
|
|
17
|
-
replaceLast(props:
|
|
8
|
+
add(props: NSNoticeBubble.Info.Props | NSNoticeBubble.Warning.Props): NSNoticeBubble.Meta;
|
|
9
|
+
replace(uid: number, props: NSNoticeBubble.Info.Props | NSNoticeBubble.Warning.Props): Promise<NSNoticeBubble.Meta>;
|
|
10
|
+
replaceLast(props: NSNoticeBubble.Info.Props | NSNoticeBubble.Warning.Props): Promise<NSNoticeBubble.Meta>;
|
|
18
11
|
remove(uid: number): boolean;
|
|
19
12
|
}
|
|
20
13
|
declare const noticeBubbleDefaultManager: NoticeBubbleManager;
|
|
21
14
|
export { NoticeBubbleManager };
|
|
22
15
|
export default noticeBubbleDefaultManager;
|
|
16
|
+
//# sourceMappingURL=NoticeBubbleManager.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"NoticeBubbleManager.d.ts","sourceRoot":"","sources":["../../src/NoticeBubbleManager.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAI1D,cAAM,mBAAoB,YAAW,cAAc,CAAC,OAAO;IACzD,OAAO,CAAC,KAAK,CAA6B;IAC1C,OAAO,CAAC,OAAO,CAAsB;IACrC,OAAO,CAAC,OAAO,CAAK;IAEb,WAAW,CAAC,EAAE,EAAE,CAAC,KAAK,EAAE,cAAc,CAAC,IAAI,EAAE,KAAK,IAAI,GAAG,MAAM,IAAI;IAI1E,OAAO,CAAC,IAAI;IAIL,GAAG,CAAC,KAAK,EAAE,cAAc,CAAC,IAAI,CAAC,KAAK,GAAG,cAAc,CAAC,OAAO,CAAC,KAAK,GAAG,cAAc,CAAC,IAAI;IAwBzF,OAAO,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,cAAc,CAAC,IAAI,CAAC,KAAK,GAAG,cAAc,CAAC,OAAO,CAAC,KAAK,GAAG,OAAO,CAAC,cAAc,CAAC,IAAI,CAAC;IAUnH,WAAW,CAAC,KAAK,EAAE,cAAc,CAAC,IAAI,CAAC,KAAK,GAAG,cAAc,CAAC,OAAO,CAAC,KAAK,GAAG,OAAO,CAAC,cAAc,CAAC,IAAI,CAAC;IAc1G,MAAM,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO;CAapC;AAED,QAAA,MAAM,0BAA0B,qBAA4B,CAAC;AAE7D,OAAO,EAAE,mBAAmB,EAAE,CAAC;AAC/B,eAAe,0BAA0B,CAAC"}
|
package/lib/types/index.d.ts
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { default as NoticeBubbleContainer } from './NoticeBubble';
|
|
2
|
-
import type { NoticeBubbleContainerProps, NoticeBubbleInfoProps, NoticeBubbleWarningProps, AddedNoticeMeta } from './NoticeBubble.type';
|
|
2
|
+
import type { NoticeBubbleContainerProps, NoticeBubbleInfoProps, NoticeBubbleWarningProps, AddedNoticeMeta, NSNoticeBubble } from './NoticeBubble.type';
|
|
3
3
|
import { default as noticeBubbleDefaultManager } from './NoticeBubbleManager';
|
|
4
4
|
export * from './NoticeBubble';
|
|
5
5
|
export * from './NoticeBubbleManager';
|
|
6
6
|
export { NoticeBubbleContainer, noticeBubbleDefaultManager };
|
|
7
|
-
export type { NoticeBubbleContainerProps, NoticeBubbleInfoProps, NoticeBubbleWarningProps, AddedNoticeMeta, };
|
|
7
|
+
export type { NoticeBubbleContainerProps, NoticeBubbleInfoProps, NoticeBubbleWarningProps, AddedNoticeMeta, NSNoticeBubble, };
|
|
8
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,qBAAqB,EAAE,MAAM,gBAAgB,CAAC;AAClE,OAAO,KAAK,EACV,0BAA0B,EAC1B,qBAAqB,EACrB,wBAAwB,EACxB,eAAe,EACf,cAAc,EACf,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,OAAO,IAAI,0BAA0B,EAAE,MAAM,uBAAuB,CAAC;AAE9E,cAAc,gBAAgB,CAAC;AAE/B,cAAc,uBAAuB,CAAC;AAEtC,OAAO,EAAE,qBAAqB,EAAE,0BAA0B,EAAE,CAAC;AAE7D,YAAY,EACV,0BAA0B,EAC1B,qBAAqB,EACrB,wBAAwB,EACxB,eAAe,EACf,cAAc,GACf,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"__intergalactic-dynamic-locales.d.ts","sourceRoot":"","sources":["../../../src/translations/__intergalactic-dynamic-locales.ts"],"names":[],"mappings":"AAeA,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAe7B,CAAC;AAEF,MAAM,MAAM,iBAAiB,GAAG,OAAO,iBAAiB,CAAC"}
|
package/lib/types/utils.d.ts
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/utils.ts"],"names":[],"mappings":"AAAA,cAAM,KAAK;IACT,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAS;IAC/B,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAW;IAEpC,OAAO,CAAC,SAAS,CAAS;IAC1B,OAAO,CAAC,OAAO,CAAuB;IACtC,OAAO,CAAC,KAAK,CAAa;IAEnB,MAAM,EAAE,OAAO,CAAC;gBAEX,QAAQ,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM;IAS7C,KAAK;IASL,MAAM;IASN,KAAK;IAKL,KAAK;CAKN;AAED,OAAO,EAAE,KAAK,EAAE,CAAC"}
|
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.2.
|
|
4
|
+
"version": "17.2.2-prerelease.0",
|
|
5
5
|
"main": "lib/cjs/index.js",
|
|
6
6
|
"module": "lib/es6/index.js",
|
|
7
7
|
"typings": "lib/types/index.d.ts",
|
|
@@ -14,11 +14,11 @@
|
|
|
14
14
|
"require": "./lib/cjs/index.js"
|
|
15
15
|
},
|
|
16
16
|
"dependencies": {
|
|
17
|
-
"@semcore/button": "^17.2.
|
|
17
|
+
"@semcore/button": "^17.2.2-prerelease.0"
|
|
18
18
|
},
|
|
19
19
|
"peerDependencies": {
|
|
20
|
-
"@semcore/base-components": "^17.2.
|
|
21
|
-
"@semcore/icon": "^17.2.
|
|
20
|
+
"@semcore/base-components": "^17.2.2",
|
|
21
|
+
"@semcore/icon": "^17.2.0"
|
|
22
22
|
},
|
|
23
23
|
"repository": {
|
|
24
24
|
"type": "git",
|
|
@@ -26,10 +26,10 @@
|
|
|
26
26
|
"directory": "semcore/notice-bubble"
|
|
27
27
|
},
|
|
28
28
|
"devDependencies": {
|
|
29
|
-
"@semcore/core": "17.
|
|
30
|
-
"@semcore/base-components": "17.2.
|
|
29
|
+
"@semcore/core": "17.3.1-prerelease.0",
|
|
30
|
+
"@semcore/base-components": "17.2.2-prerelease.0",
|
|
31
31
|
"@semcore/testing-utils": "1.0.0",
|
|
32
|
-
"@semcore/icon": "17.2.
|
|
32
|
+
"@semcore/icon": "17.2.0"
|
|
33
33
|
},
|
|
34
34
|
"scripts": {
|
|
35
35
|
"build": "pnpm semcore-builder && pnpm vite build"
|