@semcore/notice-bubble 16.3.0 → 16.3.1
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 +1 -1
- package/lib/cjs/NoticeBubble.js +78 -17
- package/lib/cjs/NoticeBubble.js.map +1 -1
- package/lib/cjs/NoticeBubble.type.js.map +1 -1
- package/lib/cjs/NoticeBubbleManager.js +38 -12
- package/lib/cjs/NoticeBubbleManager.js.map +1 -1
- package/lib/cjs/index.js +2 -0
- package/lib/cjs/index.js.map +1 -1
- package/lib/es6/NoticeBubble.js +78 -16
- package/lib/es6/NoticeBubble.js.map +1 -1
- package/lib/es6/NoticeBubble.type.js.map +1 -1
- package/lib/es6/NoticeBubbleManager.js +38 -12
- package/lib/es6/NoticeBubbleManager.js.map +1 -1
- package/lib/es6/index.js +1 -0
- package/lib/es6/index.js.map +1 -1
- package/lib/esm/NoticeBubble.mjs +83 -20
- package/lib/esm/NoticeBubbleManager.mjs +38 -12
- package/lib/esm/index.mjs +7 -3
- package/lib/types/NoticeBubble.d.ts +31 -2
- package/lib/types/NoticeBubble.type.d.ts +45 -6
- package/lib/types/NoticeBubbleManager.d.ts +4 -2
- package/lib/types/index.d.ts +1 -0
- package/package.json +6 -6
package/CHANGELOG.md
CHANGED
package/lib/cjs/NoticeBubble.js
CHANGED
|
@@ -4,7 +4,7 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
|
|
|
4
4
|
Object.defineProperty(exports, "__esModule", {
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
|
-
exports["default"] = void 0;
|
|
7
|
+
exports["default"] = exports.NoticeBubbleWarning = exports.NoticeBubble = void 0;
|
|
8
8
|
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
9
9
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
10
10
|
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
|
@@ -33,23 +33,23 @@ var _intergalacticDynamicLocales = require("./translations/__intergalactic-dynam
|
|
|
33
33
|
var _utils = require("./utils");
|
|
34
34
|
var _excluded = ["focusLock"];
|
|
35
35
|
/*!__reshadow-styles__:"./style/notice-bubble.shadow.css"*/
|
|
36
|
-
var style = (/*__reshadow_css_start__*/_core.sstyled.insert(/*__inner_css_start__*/"@keyframes
|
|
36
|
+
var style = (/*__reshadow_css_start__*/_core.sstyled.insert(/*__inner_css_start__*/"@keyframes enter_e1i3p{0%{transform:translate(100%,0);max-height:0;overflow:hidden}to{transform:translate(0,0);max-height:100vh;overflow:hidden}}@keyframes exit_e1i3p{0%{max-height:100vh;overflow:hidden;opacity:1}to{max-height:0;overflow:hidden;opacity:0}}.___SBubble_e1i3p_gg_,.___SView_e1i3p_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, rgba(254, 255, 255, 0.949));gap:var(--intergalactic-spacing-2x, 8px)}.___SBubble_e1i3p_gg_._type_info_e1i3p_gg_,.___SView_e1i3p_gg_._type_info_e1i3p_gg_{background:var(--intergalactic-bg-primary-invert, rgb(26, 30, 26))}.___SBubble_e1i3p_gg_._type_warning_e1i3p_gg_,.___SView_e1i3p_gg_._type_warning_e1i3p_gg_{background:var(--intergalactic-bg-primary-critical, rgb(247, 55, 64))}.___SContent_e1i3p_gg_{flex-direction:column;gap:var(--intergalactic-spacing-2x, 8px);flex:1}.___SMessage_e1i3p_gg_{font-size:var(--intergalactic-fs-200, 14px);line-height:var(--intergalactic-lh-200, 142%)}.___SDismiss_e1i3p_gg_{cursor:pointer;position:absolute;right:0;top:0;margin-top:var(--intergalactic-spacing-2x, 8px);margin-right:var(--intergalactic-spacing-2x, 8px);margin-bottom:var(--intergalactic-spacing-2x, 8px);flex-shrink:0;border:0;background:0 0}.___SDismiss_e1i3p_gg_.__use_e1i3p_gg_{padding:0 1px}.___SIcon_e1i3p_gg_{justify-content:center;align-items:center;height:var(--intergalactic-spacing-5x, 20px)}.___SNoticeBubble_e1i3p_gg_{width:300px;position:fixed;right:var(--intergalactic-spacing-3x, 12px);top:var(--intergalactic-spacing-3x, 12px)}@media (max-width:767px){.___SNoticeBubble_e1i3p_gg_{width:calc(100% - var(--intergalactic-spacing-6x, 24px))}}.___SNoticeBubble_e1i3p_gg_.__disablePortal_e1i3p_gg_{position:sticky;margin-left:auto;height:0}.___SMessage_e1i3p_gg_ a{color:var(--intergalactic-text-link-invert, rgb(136, 172, 253))}.___SNoticeAriaLiveWrapper_e1i3p_gg_{display:contents}", /*__inner_css_end__*/"e1i3p_gg_"),
|
|
37
37
|
/*__reshadow_css_end__*/
|
|
38
38
|
{
|
|
39
|
-
"__SContent": "
|
|
40
|
-
"__SMessage": "
|
|
41
|
-
"__SDismiss": "
|
|
42
|
-
"_use": "
|
|
43
|
-
"__SIcon": "
|
|
44
|
-
"__SNoticeBubble": "
|
|
45
|
-
"_disablePortal": "
|
|
46
|
-
"__SNoticeAriaLiveWrapper": "
|
|
47
|
-
"@enter": "
|
|
48
|
-
"@exit": "
|
|
49
|
-
"__SBubble": "
|
|
50
|
-
"__SView": "
|
|
51
|
-
"_type_info": "
|
|
52
|
-
"_type_warning": "
|
|
39
|
+
"__SContent": "___SContent_e1i3p_gg_",
|
|
40
|
+
"__SMessage": "___SMessage_e1i3p_gg_",
|
|
41
|
+
"__SDismiss": "___SDismiss_e1i3p_gg_",
|
|
42
|
+
"_use": "__use_e1i3p_gg_",
|
|
43
|
+
"__SIcon": "___SIcon_e1i3p_gg_",
|
|
44
|
+
"__SNoticeBubble": "___SNoticeBubble_e1i3p_gg_",
|
|
45
|
+
"_disablePortal": "__disablePortal_e1i3p_gg_",
|
|
46
|
+
"__SNoticeAriaLiveWrapper": "___SNoticeAriaLiveWrapper_e1i3p_gg_",
|
|
47
|
+
"@enter": "enter_e1i3p",
|
|
48
|
+
"@exit": "exit_e1i3p",
|
|
49
|
+
"__SBubble": "___SBubble_e1i3p_gg_",
|
|
50
|
+
"__SView": "___SView_e1i3p_gg_",
|
|
51
|
+
"_type_info": "_type_info_e1i3p_gg_",
|
|
52
|
+
"_type_warning": "_type_warning_e1i3p_gg_"
|
|
53
53
|
});
|
|
54
54
|
var NoticeBubbleContainerRoot = /*#__PURE__*/function (_Component) {
|
|
55
55
|
function NoticeBubbleContainerRoot() {
|
|
@@ -350,6 +350,67 @@ var ViewWarning = /*#__PURE__*/function (_ViewInfo2) {
|
|
|
350
350
|
type: 'warning',
|
|
351
351
|
duration: 0
|
|
352
352
|
});
|
|
353
|
-
var
|
|
353
|
+
var NoticeBubbleView = /*#__PURE__*/function (_Component3) {
|
|
354
|
+
function NoticeBubbleView() {
|
|
355
|
+
var _this4;
|
|
356
|
+
(0, _classCallCheck2["default"])(this, NoticeBubbleView);
|
|
357
|
+
for (var _len3 = arguments.length, args = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {
|
|
358
|
+
args[_key3] = arguments[_key3];
|
|
359
|
+
}
|
|
360
|
+
_this4 = (0, _callSuper2["default"])(this, NoticeBubbleView, [].concat(args));
|
|
361
|
+
(0, _defineProperty2["default"])(_this4, "_notice", null);
|
|
362
|
+
return _this4;
|
|
363
|
+
}
|
|
364
|
+
(0, _inherits2["default"])(NoticeBubbleView, _Component3);
|
|
365
|
+
return (0, _createClass2["default"])(NoticeBubbleView, [{
|
|
366
|
+
key: "componentDidMount",
|
|
367
|
+
value: function componentDidMount() {
|
|
368
|
+
this._notice = this.asProps.manager.add(this.asProps);
|
|
369
|
+
}
|
|
370
|
+
}, {
|
|
371
|
+
key: "componentWillUnmount",
|
|
372
|
+
value: function componentWillUnmount() {
|
|
373
|
+
if (this._notice) {
|
|
374
|
+
this._notice.remove();
|
|
375
|
+
}
|
|
376
|
+
}
|
|
377
|
+
}, {
|
|
378
|
+
key: "componentDidUpdate",
|
|
379
|
+
value: function componentDidUpdate() {
|
|
380
|
+
if (this._notice) {
|
|
381
|
+
this._notice.update(this.asProps);
|
|
382
|
+
}
|
|
383
|
+
}
|
|
384
|
+
}, {
|
|
385
|
+
key: "render",
|
|
386
|
+
value: function render() {
|
|
387
|
+
return null;
|
|
388
|
+
}
|
|
389
|
+
}]);
|
|
390
|
+
}(_core.Component);
|
|
391
|
+
(0, _defineProperty2["default"])(NoticeBubbleView, "defaultProps", {
|
|
392
|
+
duration: 5000,
|
|
393
|
+
type: 'info',
|
|
394
|
+
manager: _NoticeBubbleManager["default"]
|
|
395
|
+
});
|
|
396
|
+
var NoticeBubbleWarningView = /*#__PURE__*/function (_NoticeBubbleView2) {
|
|
397
|
+
function NoticeBubbleWarningView() {
|
|
398
|
+
(0, _classCallCheck2["default"])(this, NoticeBubbleWarningView);
|
|
399
|
+
return (0, _callSuper2["default"])(this, NoticeBubbleWarningView, arguments);
|
|
400
|
+
}
|
|
401
|
+
(0, _inherits2["default"])(NoticeBubbleWarningView, _NoticeBubbleView2);
|
|
402
|
+
return (0, _createClass2["default"])(NoticeBubbleWarningView);
|
|
403
|
+
}(NoticeBubbleView);
|
|
404
|
+
(0, _defineProperty2["default"])(NoticeBubbleWarningView, "defaultProps", {
|
|
405
|
+
duration: 5000,
|
|
406
|
+
type: 'warning',
|
|
407
|
+
manager: _NoticeBubbleManager["default"]
|
|
408
|
+
});
|
|
409
|
+
var NoticeBubbleContainer = (0, _core.createComponent)(NoticeBubbleContainerRoot, {
|
|
410
|
+
Info: NoticeBubbleView,
|
|
411
|
+
Warning: NoticeBubbleWarningView
|
|
412
|
+
});
|
|
413
|
+
var NoticeBubble = exports.NoticeBubble = NoticeBubbleContainer.Info;
|
|
414
|
+
var NoticeBubbleWarning = exports.NoticeBubbleWarning = NoticeBubbleContainer.Warning;
|
|
354
415
|
var _default = exports["default"] = NoticeBubbleContainer;
|
|
355
416
|
//# sourceMappingURL=NoticeBubble.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NoticeBubble.js","names":["_core","require","_baseComponents","_button","_interopRequireDefault","_i18nEnhance","_fire","_getFocusableIn","_isNode","_ref7","_ThemeProvider","_useFocusLock","_useCssVariable","_zIndexStacking","_m","_react","_NoticeBubbleManager","_intergalacticDynamicLocales","_utils","_excluded","style","sstyled","insert","NoticeBubbleContainerRoot","_Component","_this","_classCallCheck2","_len","arguments","length","args","Array","_key","_callSuper2","concat","_defineProperty2","notices","infos","warnings","_unsubscribe","setState","forceUpdate","_inherits2","_createClass2","key","value","componentDidMount","asProps","manager","addListener","handleChange","render","_ref","_ref3","SNoticeBubble","Box","SNoticeAriaLiveWrapper","_this$asProps","Children","styles","disablePortal","getI18nText","ref","parentZIndexStacking","duration","containerNode","state","map","notice","_ref2","SView","type","ViewWarning","ViewInfo","createElement","PortalForNoticeItem","cn","_objectSpread2","uid","filter","ZIndexStackingContextProvider","Portal","assignProps","_ref4","_ref5","Component","i18nEnhance","localizedMessages","contextThemeEnhance","zIndexStackingEnhance","cssVariableEnhance","variable","fallback","v","Number","parseInt","prop","i18n","locale","FocusLock","React","forwardRef","props","outerRef","focusLock","other","_objectWithoutProperties2","innerRef","useRef","useFocusLock","useForkRef","Flex","_extends2","_React$useState","useState","_React$useState2","_slicedToArray2","showContent","setShowContent","useEffect","setTimeout","Tag","tag","designToken","nodeToMount","_Component2","_this2","_len2","_key2","createRef","e","fire","clearTimer","handleClose","timer","pause","resume","event","_this2$timer","_this2$ref$current","paused","rect","current","getBoundingClientRect","mouseInRect","clientX","left","right","clientY","top","bottom","_this3","Timer","document","body","addEventListener","handleBodyMouseMove","noticeElement","focusableNodes","getFocusableIn","node","closeButtonRef","setFocus","componentWillUnmount","removeEventListener","clear","_ref6","SBubble","SDismiss","Button","SContent","SMessage","SAction","SIcon","_this$props","visible","initialAnimation","animationDuration","icon","children","action","Animation","handleMouseEnter","handleMouseLeave","handleKeydown","undefined","Addon","CloseIcon","color","isNode","Fragment","_ViewInfo2","NoticeBubbleContainer","createComponent","_default","exports"],"sources":["../../src/NoticeBubble.tsx"],"sourcesContent":["import { Animation, Box, Flex, Portal } from '@semcore/base-components';\nimport Button from '@semcore/button';\nimport { createComponent, Component, sstyled, Root } from '@semcore/core';\nimport type { Intergalactic } from '@semcore/core';\nimport i18nEnhance from '@semcore/core/lib/utils/enhances/i18nEnhance';\nimport fire from '@semcore/core/lib/utils/fire';\nimport { getFocusableIn } from '@semcore/core/lib/utils/focus-lock/getFocusableIn';\nimport isNode from '@semcore/core/lib/utils/isNode';\nimport { useForkRef } from '@semcore/core/lib/utils/ref';\nimport { contextThemeEnhance } from '@semcore/core/lib/utils/ThemeProvider';\nimport { useFocusLock, setFocus } from '@semcore/core/lib/utils/use/useFocusLock';\nimport { cssVariableEnhance } from '@semcore/core/lib/utils/useCssVariable';\nimport {\n ZIndexStackingContextProvider,\n zIndexStackingEnhance,\n} from '@semcore/core/lib/utils/zIndexStacking';\nimport CloseIcon from '@semcore/icon/Close/m';\nimport React from 'react';\n\nimport type {\n NoticeBubbleContainerProps,\n NoticeBubbleViewItemProps,\n} from './NoticeBubble.type';\nimport type { NoticeItem } from './NoticeBubbleManager';\nimport manager from './NoticeBubbleManager';\nimport style from './style/notice-bubble.shadow.css';\nimport { localizedMessages } from './translations/__intergalactic-dynamic-locales';\nimport { Timer } from './utils';\n\ntype State = {\n notices: NoticeItem[];\n infos: NoticeItem[];\n warnings: NoticeItem[];\n};\n\nclass NoticeBubbleContainerRoot extends Component<NoticeBubbleContainerProps, typeof NoticeBubbleContainerRoot.enhance, {}, typeof NoticeBubbleContainerRoot.defaultProps, State> {\n static displayName = 'NoticeBubbleContainer';\n static style = style;\n static enhance = [\n i18nEnhance(localizedMessages),\n contextThemeEnhance(),\n zIndexStackingEnhance('z-index-notice-bubble'),\n cssVariableEnhance<'duration', number, number>({\n variable: '--intergalactic-duration-popper',\n fallback: 200,\n map: (v: string) => Number.parseInt(v, 10),\n prop: 'duration',\n }),\n ] as const;\n\n static defaultProps = {\n manager,\n i18n: localizedMessages,\n locale: 'en',\n } as const;\n\n _unsubscribe: (() => void) | null = null;\n\n state: State = {\n notices: [],\n infos: [],\n warnings: [],\n };\n\n componentDidMount() {\n this._unsubscribe = this.asProps.manager.addListener(this.handleChange);\n }\n\n componentWillUnmount = () => {\n if (this._unsubscribe) {\n this._unsubscribe();\n }\n };\n\n handleChange = (notices: NoticeItem[]) => {\n this.setState({ notices });\n this.forceUpdate(); // need this, because somehow this component doesn't rerender event if the notices are different\n };\n\n render() {\n const SNoticeBubble = Root;\n const SNoticeAriaLiveWrapper = 'div';\n const { Children, styles, disablePortal, getI18nText, ref, parentZIndexStacking, duration, containerNode } =\n this.asProps;\n const { notices } = this.state;\n\n if (containerNode) {\n return notices.map((notice) => {\n const SView = notice.type === 'warning' ? ViewWarning : ViewInfo;\n\n return sstyled(styles)(\n <PortalForNoticeItem\n key={notice.uid}\n tag={SView}\n containerNode={containerNode}\n animationDuration={duration}\n styles={styles}\n getI18nText={getI18nText}\n {...notice}\n />,\n );\n });\n }\n\n const infos = notices.filter((notice) => notice.type === 'info');\n const warnings = notices.filter((notice) => notice.type === 'warning');\n\n return sstyled(styles)(\n <ZIndexStackingContextProvider designToken='z-index-notice-bubble'>\n <Portal disablePortal={disablePortal}>\n <SNoticeBubble\n render={Box}\n ref={ref}\n tag='section'\n role='region'\n aria-label={getI18nText('notification')}\n zIndex={parentZIndexStacking}\n >\n <Children />\n {warnings.map((notice) => {\n const SView = ViewWarning;\n return sstyled(styles)(\n <SView\n key={notice.uid}\n animationDuration={duration}\n styles={styles}\n getI18nText={getI18nText}\n {...notice}\n />,\n );\n })}\n <SNoticeAriaLiveWrapper aria-live='polite'>\n {infos.map((notice) => {\n const SView = ViewInfo;\n return sstyled(styles)(\n <SView\n key={notice.uid}\n animationDuration={duration}\n styles={styles}\n getI18nText={getI18nText}\n {...notice}\n />,\n );\n })}\n </SNoticeAriaLiveWrapper>\n </SNoticeBubble>\n </Portal>\n </ZIndexStackingContextProvider>,\n );\n }\n}\n\nconst FocusLock = React.forwardRef((props: any, outerRef: React.ForwardedRef<HTMLDivElement>) => {\n const { focusLock, ...other } = props;\n const innerRef = React.useRef<HTMLDivElement | null>(null);\n useFocusLock(innerRef, false, 'auto', !focusLock, true);\n const ref = useForkRef(outerRef, innerRef);\n\n return <Flex ref={ref} {...other} />;\n});\n\nconst PortalForNoticeItem = (props: NoticeBubbleViewItemProps & { containerNode: HTMLElement; tag: typeof ViewInfo }) => {\n const [showContent, setShowContent] = React.useState(false);\n\n // Show content for info notice in previously mounted node with aria-live polite\n React.useEffect(() => {\n setTimeout(() => {\n setShowContent(true);\n }, 200);\n }, []);\n\n const SNoticeAriaLiveWrapper = 'div';\n const Tag = props.tag;\n\n if (props.type === 'info') {\n return (\n <ZIndexStackingContextProvider designToken='z-index-notice-bubble'>\n <Portal nodeToMount={props.containerNode}>\n <SNoticeAriaLiveWrapper aria-live='polite'>\n {showContent && <Tag {...props} />}\n </SNoticeAriaLiveWrapper>\n </Portal>\n </ZIndexStackingContextProvider>\n );\n }\n\n return (\n <ZIndexStackingContextProvider designToken='z-index-notice-bubble'>\n <Portal nodeToMount={props.containerNode}>\n <Tag {...props} />\n </Portal>\n </ZIndexStackingContextProvider>\n );\n};\n\nclass ViewInfo extends Component<NoticeBubbleViewItemProps> {\n timer: Timer | null = null;\n ref = React.createRef<HTMLDivElement>();\n closeButtonRef = React.createRef<HTMLButtonElement>();\n\n componentDidMount() {\n const { duration } = this.props;\n if (duration) {\n this.timer = new Timer(this.handleClose, duration);\n document.body.addEventListener('mousemove', this.handleBodyMouseMove);\n }\n\n const noticeElement = this.ref.current;\n\n if (noticeElement) {\n const focusableNodes = getFocusableIn(noticeElement).filter(\n (node) => node !== this.closeButtonRef.current,\n );\n\n if (focusableNodes.length > 0) {\n setTimeout(() => setFocus(noticeElement), 0);\n }\n }\n }\n\n componentWillUnmount() {\n this.clearTimer();\n document.body.removeEventListener('mousemove', this.handleBodyMouseMove);\n }\n\n clearTimer() {\n if (this.timer) {\n this.timer.clear();\n this.timer = null;\n }\n }\n\n handleClose = (e: React.SyntheticEvent) => {\n // because it might be called not only from the close icon click\n fire(this, 'onClose', e);\n this.clearTimer();\n };\n\n handleKeydown = (e: React.KeyboardEvent) => {\n if (e.key === 'Escape') {\n this.handleClose(e);\n }\n };\n\n handleMouseEnter = () => {\n if (!this.timer) return;\n this.timer.pause();\n };\n\n handleMouseLeave = () => {\n if (!this.timer) return;\n this.timer.resume();\n };\n\n handleBodyMouseMove = (event: MouseEvent) => {\n if (!this.timer?.paused) return;\n const rect = this.ref.current?.getBoundingClientRect();\n if (!rect) return;\n const mouseInRect =\n event.clientX >= rect.left &&\n event.clientX <= rect.right &&\n event.clientY >= rect.top &&\n event.clientY <= rect.bottom;\n if (mouseInRect) return;\n this.timer.resume();\n };\n\n render() {\n const SBubble = FocusLock;\n const SDismiss = Button;\n const SContent = Flex;\n const SMessage = 'div';\n const SAction = 'div';\n const SIcon = Flex;\n const {\n styles,\n getI18nText,\n visible,\n type,\n initialAnimation,\n animationDuration,\n icon,\n children,\n action,\n focusLock,\n } = this.props;\n\n return sstyled(styles)(\n <Animation\n initialAnimation={initialAnimation}\n visible={visible ?? true}\n duration={animationDuration}\n // @ts-ignore\n keyframes={[styles['@enter'], styles['@exit']]}\n >\n <SBubble\n type={type}\n ref={this.ref}\n onMouseEnter={this.handleMouseEnter}\n onMouseLeave={this.handleMouseLeave}\n onKeyDown={this.handleKeydown}\n role={type === 'warning' ? 'alert' : undefined}\n focusLock={focusLock}\n >\n <SDismiss\n aria-haspopup={undefined}\n type='button'\n use='tertiary'\n size='m'\n theme='invert'\n onClick={this.handleClose}\n aria-label={getI18nText('close')}\n active={false}\n title={getI18nText('close')}\n ref={this.closeButtonRef}\n data-hide-focus-hover-popper='true'\n >\n <Button.Addon tag={CloseIcon} color='icon-primary-invert' />\n </SDismiss>\n\n {isNode(icon)\n ? (\n <>\n <SIcon>{icon}</SIcon>\n <SContent>\n <SMessage>{children}</SMessage>\n {isNode(action) ? <SAction>{action}</SAction> : null}\n </SContent>\n </>\n )\n : (\n <SContent>\n <SMessage>{children}</SMessage>\n {isNode(action) ? <SAction>{action}</SAction> : null}\n </SContent>\n )}\n </SBubble>\n </Animation>,\n );\n }\n}\n\nclass ViewWarning extends ViewInfo {\n static defaultProps = {\n type: 'warning',\n duration: 0,\n };\n}\n\nconst NoticeBubbleContainer = createComponent(NoticeBubbleContainerRoot) as Intergalactic.Component<'div', NoticeBubbleContainerProps>;\n\nexport default NoticeBubbleContainer;\n"],"mappings":";;;;;;;;;;;;;;;;AAEA,IAAAA,KAAA,GAAAC,OAAA;AAFA,IAAAC,eAAA,GAAAD,OAAA;AACA,IAAAE,OAAA,GAAAC,sBAAA,CAAAH,OAAA;AAGA,IAAAI,YAAA,GAAAD,sBAAA,CAAAH,OAAA;AACA,IAAAK,KAAA,GAAAF,sBAAA,CAAAH,OAAA;AACA,IAAAM,eAAA,GAAAN,OAAA;AACA,IAAAO,OAAA,GAAAJ,sBAAA,CAAAH,OAAA;AACA,IAAAQ,KAAA,GAAAR,OAAA;AACA,IAAAS,cAAA,GAAAT,OAAA;AACA,IAAAU,aAAA,GAAAV,OAAA;AACA,IAAAW,eAAA,GAAAX,OAAA;AACA,IAAAY,eAAA,GAAAZ,OAAA;AAIA,IAAAa,EAAA,GAAAV,sBAAA,CAAAH,OAAA;AACA,IAAAc,MAAA,GAAAX,sBAAA,CAAAH,OAAA;AAOA,IAAAe,oBAAA,GAAAZ,sBAAA,CAAAH,OAAA;AAEA,IAAAgB,4BAAA,GAAAhB,OAAA;AACA,IAAAiB,MAAA,GAAAjB,OAAA;AAAgC,IAAAkB,SAAA;AAAA;AAAA,IAAAC,KAAA,8BAAApB,KAAA,CAAAqB,OAAA,CAAAC,MAAA;AAAA;AAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;E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,aAAA,CAACkG,OAAO,EAAAN,KAAA,CAAA1F,EAAA,iBAAEwG,MAAgB,CAAC,GAAG,IACxC,CAET,CACA,CAAC;IAEhB;EAAC;AAAA,EAhJoB/F,eAAS;AAAA,IAmJ1Bb,WAAW,0BAAAuH,UAAA;EAAA,SAAAvH,YAAA;IAAA,IAAA9C,gBAAA,mBAAA8C,WAAA;IAAA,WAAAvC,WAAA,mBAAAuC,WAAA,EAAA5C,SAAA;EAAA;EAAA,IAAAc,UAAA,aAAA8B,WAAA,EAAAuH,UAAA;EAAA,WAAApJ,aAAA,aAAA6B,WAAA;AAAA,EAASC,QAAQ;AAAA,IAAAtC,gBAAA,aAA5BqC,WAAW,kBACO;EACpBD,IAAI,EAAE,SAAS;EACfP,QAAQ,EAAE;AACZ,CAAC;AAGH,IAAMgI,qBAAqB,GAAG,IAAAC,qBAAe,EAAC1K,yBAAyB,CAA+D;AAAC,IAAA2K,QAAA,GAAAC,OAAA,cAExHH,qBAAqB","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"NoticeBubble.js","names":["_core","require","_baseComponents","_button","_interopRequireDefault","_i18nEnhance","_fire","_getFocusableIn","_isNode","_ref7","_ThemeProvider","_useFocusLock","_useCssVariable","_zIndexStacking","_m","_react","_NoticeBubbleManager","_intergalacticDynamicLocales","_utils","_excluded","style","sstyled","insert","NoticeBubbleContainerRoot","_Component","_this","_classCallCheck2","_len","arguments","length","args","Array","_key","_callSuper2","concat","_defineProperty2","notices","infos","warnings","_unsubscribe","setState","forceUpdate","_inherits2","_createClass2","key","value","componentDidMount","asProps","manager","addListener","handleChange","render","_ref","_ref3","SNoticeBubble","Box","SNoticeAriaLiveWrapper","_this$asProps","Children","styles","disablePortal","getI18nText","ref","parentZIndexStacking","duration","containerNode","state","map","notice","_ref2","SView","type","ViewWarning","ViewInfo","createElement","PortalForNoticeItem","cn","_objectSpread2","uid","filter","ZIndexStackingContextProvider","Portal","assignProps","_ref4","_ref5","Component","i18nEnhance","localizedMessages","contextThemeEnhance","zIndexStackingEnhance","cssVariableEnhance","variable","fallback","v","Number","parseInt","prop","i18n","locale","FocusLock","React","forwardRef","props","outerRef","focusLock","other","_objectWithoutProperties2","innerRef","useRef","useFocusLock","useForkRef","Flex","_extends2","_React$useState","useState","_React$useState2","_slicedToArray2","showContent","setShowContent","useEffect","setTimeout","Tag","tag","designToken","nodeToMount","_Component2","_this2","_len2","_key2","createRef","e","fire","clearTimer","handleClose","timer","pause","resume","event","_this2$timer","_this2$ref$current","paused","rect","current","getBoundingClientRect","mouseInRect","clientX","left","right","clientY","top","bottom","_this3","Timer","document","body","addEventListener","handleBodyMouseMove","noticeElement","focusableNodes","getFocusableIn","node","closeButtonRef","setFocus","componentWillUnmount","removeEventListener","clear","_ref6","SBubble","SDismiss","Button","SContent","SMessage","SAction","SIcon","_this$props","visible","initialAnimation","animationDuration","icon","children","action","Animation","handleMouseEnter","handleMouseLeave","handleKeydown","undefined","Addon","CloseIcon","color","isNode","Fragment","_ViewInfo2","NoticeBubbleView","_Component3","_this4","_len3","_key3","_notice","add","remove","componentDidUpdate","update","NoticeBubbleWarningView","_NoticeBubbleView2","NoticeBubbleContainer","createComponent","Info","Warning","NoticeBubble","exports","NoticeBubbleWarning","_default"],"sources":["../../src/NoticeBubble.tsx"],"sourcesContent":["import { Animation, Box, Flex, Portal } from '@semcore/base-components';\nimport Button from '@semcore/button';\nimport { createComponent, Component, sstyled, Root } from '@semcore/core';\nimport type { Intergalactic } from '@semcore/core';\nimport i18nEnhance from '@semcore/core/lib/utils/enhances/i18nEnhance';\nimport fire from '@semcore/core/lib/utils/fire';\nimport { getFocusableIn } from '@semcore/core/lib/utils/focus-lock/getFocusableIn';\nimport isNode from '@semcore/core/lib/utils/isNode';\nimport type { NodeByRef } from '@semcore/core/lib/utils/ref';\nimport { useForkRef } from '@semcore/core/lib/utils/ref';\nimport { contextThemeEnhance } from '@semcore/core/lib/utils/ThemeProvider';\nimport { useFocusLock, setFocus } from '@semcore/core/lib/utils/use/useFocusLock';\nimport { cssVariableEnhance } from '@semcore/core/lib/utils/useCssVariable';\nimport {\n ZIndexStackingContextProvider,\n zIndexStackingEnhance,\n} from '@semcore/core/lib/utils/zIndexStacking';\nimport CloseIcon from '@semcore/icon/Close/m';\nimport React from 'react';\n\nimport type {\n AddedNoticeMeta,\n NoticeBubbleContainerProps,\n NoticeBubbleProps,\n NoticeBubbleViewItemProps, NoticeBubbleWarningProps,\n} from './NoticeBubble.type';\nimport type { NoticeBubbleManager, NoticeItem } from './NoticeBubbleManager';\nimport manager from './NoticeBubbleManager';\nimport style from './style/notice-bubble.shadow.css';\nimport { localizedMessages } from './translations/__intergalactic-dynamic-locales';\nimport { Timer } from './utils';\n\ntype State = {\n notices: NoticeItem[];\n infos: NoticeItem[];\n warnings: NoticeItem[];\n};\n\nclass NoticeBubbleContainerRoot extends Component<NoticeBubbleContainerProps, {}, State, typeof NoticeBubbleContainerRoot.enhance, typeof NoticeBubbleContainerRoot.defaultProps> {\n static displayName = 'NoticeBubbleContainer';\n static style = style;\n static enhance = [\n i18nEnhance(localizedMessages),\n contextThemeEnhance(),\n zIndexStackingEnhance('z-index-notice-bubble'),\n cssVariableEnhance<'duration', number, number>({\n variable: '--intergalactic-duration-popper',\n fallback: 200,\n map: (v: string) => Number.parseInt(v, 10),\n prop: 'duration',\n }),\n ] as const;\n\n static defaultProps = {\n manager,\n i18n: localizedMessages,\n locale: 'en',\n } as const;\n\n _unsubscribe: (() => void) | null = null;\n\n state: State = {\n notices: [],\n infos: [],\n warnings: [],\n };\n\n componentDidMount() {\n this._unsubscribe = this.asProps.manager.addListener(this.handleChange);\n }\n\n componentWillUnmount = () => {\n if (this._unsubscribe) {\n this._unsubscribe();\n }\n };\n\n handleChange = (notices: NoticeItem[]) => {\n this.setState({ notices });\n this.forceUpdate(); // need this, because somehow this component doesn't rerender event if the notices are different\n };\n\n render() {\n const SNoticeBubble = Root;\n const SNoticeAriaLiveWrapper = 'div';\n const { Children, styles, disablePortal, getI18nText, ref, parentZIndexStacking, duration, containerNode } =\n this.asProps;\n const { notices } = this.state;\n\n if (containerNode) {\n return notices.map((notice) => {\n const SView = notice.type === 'warning' ? ViewWarning : ViewInfo;\n\n return sstyled(styles)(\n <PortalForNoticeItem\n key={notice.uid}\n tag={SView}\n containerNode={containerNode}\n animationDuration={duration}\n styles={styles}\n getI18nText={getI18nText}\n {...notice}\n />,\n );\n });\n }\n\n const infos = notices.filter((notice) => notice.type === 'info');\n const warnings = notices.filter((notice) => notice.type === 'warning');\n\n return sstyled(styles)(\n <ZIndexStackingContextProvider designToken='z-index-notice-bubble'>\n <Portal disablePortal={disablePortal}>\n <SNoticeBubble\n render={Box}\n ref={ref}\n tag='section'\n role='region'\n aria-label={getI18nText('notification')}\n zIndex={parentZIndexStacking}\n >\n <Children />\n {warnings.map((notice) => {\n const SView = ViewWarning;\n return sstyled(styles)(\n <SView\n key={notice.uid}\n animationDuration={duration}\n styles={styles}\n getI18nText={getI18nText}\n {...notice}\n />,\n );\n })}\n <SNoticeAriaLiveWrapper aria-live='polite'>\n {infos.map((notice) => {\n const SView = ViewInfo;\n return sstyled(styles)(\n <SView\n key={notice.uid}\n animationDuration={duration}\n styles={styles}\n getI18nText={getI18nText}\n {...notice}\n />,\n );\n })}\n </SNoticeAriaLiveWrapper>\n </SNoticeBubble>\n </Portal>\n </ZIndexStackingContextProvider>,\n );\n }\n}\n\nconst FocusLock = React.forwardRef((props: any, outerRef: React.ForwardedRef<HTMLDivElement>) => {\n const { focusLock, ...other } = props;\n const innerRef = React.useRef<HTMLDivElement | null>(null);\n useFocusLock(innerRef, false, 'auto', !focusLock, true);\n const ref = useForkRef(outerRef, innerRef);\n\n return <Flex ref={ref} {...other} />;\n});\n\nconst PortalForNoticeItem = (props: NoticeBubbleViewItemProps & { containerNode: NodeByRef; tag: typeof ViewInfo }) => {\n const [showContent, setShowContent] = React.useState(false);\n\n // Show content for info notice in previously mounted node with aria-live polite\n React.useEffect(() => {\n setTimeout(() => {\n setShowContent(true);\n }, 200);\n }, []);\n\n const SNoticeAriaLiveWrapper = 'div';\n const Tag = props.tag;\n\n if (props.type === 'info') {\n return (\n <ZIndexStackingContextProvider designToken='z-index-notice-bubble'>\n <Portal nodeToMount={props.containerNode}>\n <SNoticeAriaLiveWrapper aria-live='polite'>\n {showContent && <Tag {...props} />}\n </SNoticeAriaLiveWrapper>\n </Portal>\n </ZIndexStackingContextProvider>\n );\n }\n\n return (\n <ZIndexStackingContextProvider designToken='z-index-notice-bubble'>\n <Portal nodeToMount={props.containerNode}>\n <Tag {...props} />\n </Portal>\n </ZIndexStackingContextProvider>\n );\n};\n\nclass ViewInfo extends Component<NoticeBubbleViewItemProps> {\n timer: Timer | null = null;\n ref = React.createRef<HTMLDivElement>();\n closeButtonRef = React.createRef<HTMLButtonElement>();\n\n componentDidMount() {\n const { duration } = this.props;\n if (duration) {\n this.timer = new Timer(this.handleClose, duration);\n document.body.addEventListener('mousemove', this.handleBodyMouseMove);\n }\n\n const noticeElement = this.ref.current;\n\n if (noticeElement) {\n const focusableNodes = getFocusableIn(noticeElement).filter(\n (node) => node !== this.closeButtonRef.current,\n );\n\n if (focusableNodes.length > 0) {\n setTimeout(() => setFocus(noticeElement), 0);\n }\n }\n }\n\n componentWillUnmount() {\n this.clearTimer();\n document.body.removeEventListener('mousemove', this.handleBodyMouseMove);\n }\n\n clearTimer() {\n if (this.timer) {\n this.timer.clear();\n this.timer = null;\n }\n }\n\n handleClose = (e: React.SyntheticEvent) => {\n // because it might be called not only from the close icon click\n fire(this, 'onClose', e);\n this.clearTimer();\n };\n\n handleKeydown = (e: React.KeyboardEvent) => {\n if (e.key === 'Escape') {\n this.handleClose(e);\n }\n };\n\n handleMouseEnter = () => {\n if (!this.timer) return;\n this.timer.pause();\n };\n\n handleMouseLeave = () => {\n if (!this.timer) return;\n this.timer.resume();\n };\n\n handleBodyMouseMove = (event: MouseEvent) => {\n if (!this.timer?.paused) return;\n const rect = this.ref.current?.getBoundingClientRect();\n if (!rect) return;\n const mouseInRect =\n event.clientX >= rect.left &&\n event.clientX <= rect.right &&\n event.clientY >= rect.top &&\n event.clientY <= rect.bottom;\n if (mouseInRect) return;\n this.timer.resume();\n };\n\n render() {\n const SBubble = FocusLock;\n const SDismiss = Button;\n const SContent = Flex;\n const SMessage = 'div';\n const SAction = 'div';\n const SIcon = Flex;\n const {\n styles,\n getI18nText,\n visible,\n type,\n initialAnimation,\n animationDuration,\n icon,\n children,\n action,\n focusLock,\n } = this.props;\n\n return sstyled(styles)(\n <Animation\n initialAnimation={initialAnimation}\n visible={visible ?? true}\n duration={animationDuration}\n // @ts-ignore\n keyframes={[styles['@enter'], styles['@exit']]}\n >\n <SBubble\n type={type}\n ref={this.ref}\n onMouseEnter={this.handleMouseEnter}\n onMouseLeave={this.handleMouseLeave}\n onKeyDown={this.handleKeydown}\n role={type === 'warning' ? 'alert' : undefined}\n focusLock={focusLock}\n >\n <SDismiss\n aria-haspopup={undefined}\n type='button'\n use='tertiary'\n size='m'\n theme='invert'\n onClick={this.handleClose}\n aria-label={getI18nText('close')}\n active={false}\n title={getI18nText('close')}\n ref={this.closeButtonRef}\n data-hide-focus-hover-popper='true'\n >\n <Button.Addon tag={CloseIcon} color='icon-primary-invert' />\n </SDismiss>\n\n {isNode(icon)\n ? (\n <>\n <SIcon>{icon}</SIcon>\n <SContent>\n <SMessage>{children}</SMessage>\n {isNode(action) ? <SAction>{action}</SAction> : null}\n </SContent>\n </>\n )\n : (\n <SContent>\n <SMessage>{children}</SMessage>\n {isNode(action) ? <SAction>{action}</SAction> : null}\n </SContent>\n )}\n </SBubble>\n </Animation>,\n );\n }\n}\n\nclass ViewWarning extends ViewInfo {\n static defaultProps = {\n type: 'warning',\n duration: 0,\n };\n}\n\nclass NoticeBubbleView extends Component<{ manager: NoticeBubbleManager } & (NoticeBubbleProps | NoticeBubbleWarningProps)> {\n static defaultProps = {\n duration: 5000,\n type: 'info',\n manager,\n };\n\n _notice: null | AddedNoticeMeta = null;\n\n componentDidMount() {\n this._notice = this.asProps.manager.add(this.asProps);\n }\n\n componentWillUnmount() {\n if (this._notice) {\n this._notice.remove();\n }\n }\n\n componentDidUpdate() {\n if (this._notice) {\n this._notice.update(this.asProps);\n }\n }\n\n render() {\n return null;\n }\n}\n\nclass NoticeBubbleWarningView extends NoticeBubbleView {\n static defaultProps = {\n duration: 5000,\n type: 'warning',\n manager,\n };\n}\n\nconst NoticeBubbleContainer = createComponent(NoticeBubbleContainerRoot, {\n Info: NoticeBubbleView,\n Warning: NoticeBubbleWarningView,\n}) as Intergalactic.Component<'div', NoticeBubbleContainerProps> & {\n Info: typeof NoticeBubbleView;\n Warning: typeof NoticeBubbleWarningView;\n};\n\nconst NoticeBubble = NoticeBubbleContainer.Info;\nconst NoticeBubbleWarning = NoticeBubbleContainer.Warning;\n\nexport { NoticeBubble, NoticeBubbleWarning };\n\nexport default NoticeBubbleContainer;\n"],"mappings":";;;;;;;;;;;;;;;;AAEA,IAAAA,KAAA,GAAAC,OAAA;AAFA,IAAAC,eAAA,GAAAD,OAAA;AACA,IAAAE,OAAA,GAAAC,sBAAA,CAAAH,OAAA;AAGA,IAAAI,YAAA,GAAAD,sBAAA,CAAAH,OAAA;AACA,IAAAK,KAAA,GAAAF,sBAAA,CAAAH,OAAA;AACA,IAAAM,eAAA,GAAAN,OAAA;AACA,IAAAO,OAAA,GAAAJ,sBAAA,CAAAH,OAAA;AAEA,IAAAQ,KAAA,GAAAR,OAAA;AACA,IAAAS,cAAA,GAAAT,OAAA;AACA,IAAAU,aAAA,GAAAV,OAAA;AACA,IAAAW,eAAA,GAAAX,OAAA;AACA,IAAAY,eAAA,GAAAZ,OAAA;AAIA,IAAAa,EAAA,GAAAV,sBAAA,CAAAH,OAAA;AACA,IAAAc,MAAA,GAAAX,sBAAA,CAAAH,OAAA;AASA,IAAAe,oBAAA,GAAAZ,sBAAA,CAAAH,OAAA;AAEA,IAAAgB,4BAAA,GAAAhB,OAAA;AACA,IAAAiB,MAAA,GAAAjB,OAAA;AAAg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EAAEL;AACX,CAAC,CAGA;AAED,IAAMM,YAAY,GAAAC,OAAA,CAAAD,YAAA,GAAGJ,qBAAqB,CAACE,IAAI;AAC/C,IAAMI,mBAAmB,GAAAD,OAAA,CAAAC,mBAAA,GAAGN,qBAAqB,CAACG,OAAO;AAAC,IAAAI,QAAA,GAAAF,OAAA,cAI3CL,qBAAqB","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NoticeBubble.type.js","names":[],"sources":["../../src/NoticeBubble.type.ts"],"sourcesContent":["import type { PortalProps, BoxProps } from '@semcore/base-components';\nimport type { Intergalactic } from '@semcore/core';\nimport type { useI18n } from '@semcore/core/lib/utils/enhances/WithI18n';\nimport type { RefObject } from 'react';\n\n/**\n * @deprecated. Pass noticeBubbleContainer property from window.sm2.getNoticeBubbleContainer()\n */\nexport type NoticeBubbleContainerPortalProps = PortalProps;\n\nexport type NoticeBubbleContainerProps = BoxProps &\n NoticeBubbleContainerPortalProps & {\n /** Ref to mount bubbles in. You should use element form window.sm2.getNoticeBubbleContainer() */\n containerNode?:
|
|
1
|
+
{"version":3,"file":"NoticeBubble.type.js","names":[],"sources":["../../src/NoticeBubble.type.ts"],"sourcesContent":["import type { PortalProps, BoxProps } from '@semcore/base-components';\nimport type { UnknownProperties, Intergalactic } from '@semcore/core';\nimport type { useI18n } from '@semcore/core/lib/utils/enhances/WithI18n';\nimport type { NodeByRef } from '@semcore/core/lib/utils/ref';\nimport type { RefObject } from 'react';\n\n/** @deprecated */\nexport interface INoticeBubbleContainerProps\n extends NoticeBubbleContainerProps,\n UnknownProperties {}\n\n/**\n * @deprecated. Pass noticeBubbleContainer property from window.sm2.getNoticeBubbleContainer()\n */\nexport type NoticeBubbleContainerPortalProps = PortalProps;\n\nexport type NoticeBubbleContainerProps = BoxProps &\n NoticeBubbleContainerPortalProps & {\n /** Ref or element to mount bubbles in. You should use element form window.sm2.getNoticeBubbleContainer() */\n containerNode?: NodeByRef | null;\n /** Manager copy */\n manager?: NoticeBubbleManagerClass;\n /** Specifies the locale for i18n support */\n locale?: string;\n };\n\nexport type NoticeBubbleViewItemProps = NoticeBubbleProps & {\n containerNode?: NodeByRef;\n animationDuration: number;\n getI18nText: ReturnType<typeof useI18n>;\n styles: React.DetailedHTMLProps<React.StyleHTMLAttributes<HTMLStyleElement>, HTMLStyleElement> | undefined;\n};\n\n/** @deprecated */\nexport interface INoticeBubbleProps extends NoticeBubbleProps, UnknownProperties {}\nexport type NoticeBubbleProps = BoxProps & {\n /** Notice type */\n type?: 'info' | 'warning';\n /**\n * Notice display duration. Set to 0 to disable auto-close.\n */\n duration?: number;\n /**\n * Enables animation on first rendering.\n * @default false\n */\n initialAnimation?: boolean;\n /**\n * Use it for complex notices with important controls.\n * If enabled, browser focus will be locked in the notice\n * until it's closed. After close focus should return to the element\n * where it was placed before notice appear.\n */\n focusLock?: boolean;\n /**\n * Notice visibility.\n */\n visible?: boolean;\n /**\n * Control under the notice children.\n * */\n action?: React.ReactNode;\n /**\n * Callback triggered by \"Close\" icon click.\n * */\n onClose?: (e?: React.SyntheticEvent) => void;\n /**\n * Notice content.\n * */\n children?: React.ReactNode;\n manager?: NoticeBubbleManagerClass;\n icon?: React.ReactElement;\n};\n/** @deprecated */\nexport interface INoticeBubbleInfoProps extends NoticeBubbleInfoProps, UnknownProperties {}\nexport type NoticeBubbleInfoProps = NoticeBubbleProps & {\n readonly type?: 'info';\n};\n\n/** @deprecated */\nexport interface INoticeBubbleWarningProps extends NoticeBubbleWarningProps, UnknownProperties {}\nexport type NoticeBubbleWarningProps = NoticeBubbleProps & {\n readonly type?: 'warning';\n};\n\nexport type AddedNoticeMeta = {\n uid: number;\n update: (props: NoticeBubbleInfoProps | NoticeBubbleWarningProps) => boolean;\n remove: () => boolean;\n ref: RefObject<HTMLElement>;\n focus: () => void;\n};\n\n/** @deprecated */\nexport interface INoticeBubbleManager extends NoticeBubbleManagerClass, UnknownProperties {}\nexport type NoticeBubbleManagerClass = {\n /**\n * Creates and shows a notice.\n * */\n add: (props: NoticeBubbleInfoProps | NoticeBubbleWarningProps) => AddedNoticeMeta;\n /**\n * Updates notice by uid.\n * @deprecated use replace instead.\n */\n update: (uid: number, props: Partial<NoticeBubbleInfoProps> | Partial<NoticeBubbleWarningProps>) => boolean;\n /**\n * Removes notice by uid.\n * */\n remove: (uid: number) => boolean;\n /**\n * Replace notice by uid.\n */\n replace: (uid: number, props: NoticeBubbleInfoProps | NoticeBubbleWarningProps) => void;\n /**\n * Replace last notice (if it is existing)\n */\n replaceLast: (props: NoticeBubbleInfoProps | NoticeBubbleWarningProps) => void;\n};\n\n/**\n * @deprecated use `NoticeBubbleManager` instead.\n * */\nexport declare const NoticeBubble: Intergalactic.Component<'div', NoticeBubbleInfoProps>;\n/**\n * @deprecated use `NoticeBubbleManager` instead.\n * */\nexport declare const NoticeBubbleWarning: Intergalactic.Component<'div', NoticeBubbleWarningProps>;\nexport declare const NoticeBubbleContainer: Intergalactic.Component<\n 'div',\n NoticeBubbleContainerProps\n> & {\n /**\n * @deprecated use `NoticeBubbleManager` instead.\n * */\n Info: typeof NoticeBubble;\n\n /**\n * @deprecated use `NoticeBubbleManager` instead.\n * */\n Warning: typeof NoticeBubbleWarning;\n};\n"],"mappings":"","ignoreList":[]}
|
|
@@ -11,6 +11,7 @@ var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/creat
|
|
|
11
11
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
12
12
|
var _assignProps = require("@semcore/core/lib/utils/assignProps");
|
|
13
13
|
var _eventEmitter = _interopRequireDefault(require("@semcore/core/lib/utils/eventEmitter"));
|
|
14
|
+
var _useFocusLock = require("@semcore/core/lib/utils/use/useFocusLock");
|
|
14
15
|
var _react = _interopRequireDefault(require("react"));
|
|
15
16
|
var EVENT_NAME = 'CHANGE';
|
|
16
17
|
var NoticeBubbleManager = exports.NoticeBubbleManager = /*#__PURE__*/function () {
|
|
@@ -19,6 +20,7 @@ var NoticeBubbleManager = exports.NoticeBubbleManager = /*#__PURE__*/function ()
|
|
|
19
20
|
(0, _defineProperty2["default"])(this, "items", []);
|
|
20
21
|
(0, _defineProperty2["default"])(this, "emitter", new _eventEmitter["default"]());
|
|
21
22
|
(0, _defineProperty2["default"])(this, "counter", 0);
|
|
23
|
+
(0, _defineProperty2["default"])(this, "replaceTimer", null);
|
|
22
24
|
}
|
|
23
25
|
return (0, _createClass2["default"])(NoticeBubbleManager, [{
|
|
24
26
|
key: "addListener",
|
|
@@ -36,6 +38,13 @@ var NoticeBubbleManager = exports.NoticeBubbleManager = /*#__PURE__*/function ()
|
|
|
36
38
|
var _this = this;
|
|
37
39
|
var uid = this.counter++;
|
|
38
40
|
var ref = /*#__PURE__*/_react["default"].createRef();
|
|
41
|
+
var focus = function focus() {
|
|
42
|
+
setTimeout(function () {
|
|
43
|
+
if (ref.current) {
|
|
44
|
+
(0, _useFocusLock.setFocus)(ref.current);
|
|
45
|
+
}
|
|
46
|
+
}, 0);
|
|
47
|
+
};
|
|
39
48
|
var item = (0, _objectSpread2["default"])((0, _objectSpread2["default"])({
|
|
40
49
|
type: 'info',
|
|
41
50
|
uid: uid,
|
|
@@ -50,35 +59,52 @@ var NoticeBubbleManager = exports.NoticeBubbleManager = /*#__PURE__*/function ()
|
|
|
50
59
|
this.emit();
|
|
51
60
|
return {
|
|
52
61
|
uid: uid,
|
|
53
|
-
update: this.
|
|
62
|
+
update: this.update.bind(this, uid),
|
|
54
63
|
remove: this.remove.bind(this, uid),
|
|
55
|
-
ref: ref
|
|
64
|
+
ref: ref,
|
|
65
|
+
// todo Brauer Ilia: remove this property, because we added logic about autofocus in Notice
|
|
66
|
+
focus: focus
|
|
56
67
|
};
|
|
57
68
|
}
|
|
69
|
+
}, {
|
|
70
|
+
key: "update",
|
|
71
|
+
value: function update(uid, props) {
|
|
72
|
+
var index = this.items.findIndex(function (item) {
|
|
73
|
+
return item.uid === uid;
|
|
74
|
+
});
|
|
75
|
+
if (index !== -1) {
|
|
76
|
+
this.items[index] = (0, _objectSpread2["default"])((0, _objectSpread2["default"])({}, this.items[index]), props);
|
|
77
|
+
this.emit();
|
|
78
|
+
return true;
|
|
79
|
+
}
|
|
80
|
+
return false;
|
|
81
|
+
}
|
|
58
82
|
}, {
|
|
59
83
|
key: "replace",
|
|
60
84
|
value: function replace(uid, props) {
|
|
61
85
|
var _this2 = this;
|
|
86
|
+
if (this.replaceTimer) {
|
|
87
|
+
clearTimeout(this.replaceTimer);
|
|
88
|
+
}
|
|
62
89
|
this.remove(uid);
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
}, 300);
|
|
67
|
-
});
|
|
90
|
+
this.replaceTimer = setTimeout(function () {
|
|
91
|
+
_this2.add(props);
|
|
92
|
+
}, 300);
|
|
68
93
|
}
|
|
69
94
|
}, {
|
|
70
95
|
key: "replaceLast",
|
|
71
96
|
value: function replaceLast(props) {
|
|
72
97
|
var _this3 = this;
|
|
98
|
+
if (this.replaceTimer) {
|
|
99
|
+
clearTimeout(this.replaceTimer);
|
|
100
|
+
}
|
|
73
101
|
var item = this.items[this.items.length - 1];
|
|
74
102
|
if (item !== null && item !== void 0 && item.visible) {
|
|
75
103
|
this.remove(this.counter - 1);
|
|
76
104
|
}
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
}, 300);
|
|
81
|
-
});
|
|
105
|
+
this.replaceTimer = setTimeout(function () {
|
|
106
|
+
_this3.add(props);
|
|
107
|
+
}, 300);
|
|
82
108
|
}
|
|
83
109
|
}, {
|
|
84
110
|
key: "remove",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NoticeBubbleManager.js","names":["_assignProps","require","_eventEmitter","_interopRequireDefault","_react","EVENT_NAME","NoticeBubbleManager","exports","_classCallCheck2","_defineProperty2","EventEmitter","_createClass2","key","value","addListener","fn","emitter","subscribe","emit","items","add","props","_this","uid","counter","ref","React","createRef","item","_objectSpread2","type","visible","initialAnimation","undefined","forwardRef","onClose","callAllEventHandlers","remove","push","update","
|
|
1
|
+
{"version":3,"file":"NoticeBubbleManager.js","names":["_assignProps","require","_eventEmitter","_interopRequireDefault","_useFocusLock","_react","EVENT_NAME","NoticeBubbleManager","exports","_classCallCheck2","_defineProperty2","EventEmitter","_createClass2","key","value","addListener","fn","emitter","subscribe","emit","items","add","props","_this","uid","counter","ref","React","createRef","focus","setTimeout","current","setFocus","item","_objectSpread2","type","visible","initialAnimation","undefined","forwardRef","onClose","callAllEventHandlers","remove","push","update","bind","index","findIndex","replace","_this2","replaceTimer","clearTimeout","replaceLast","_this3","length","_this4","find","filter","noticeBubbleDefaultManager","_default"],"sources":["../../src/NoticeBubbleManager.ts"],"sourcesContent":["import { callAllEventHandlers } from '@semcore/core/lib/utils/assignProps';\nimport EventEmitter from '@semcore/core/lib/utils/eventEmitter';\nimport { setFocus } from '@semcore/core/lib/utils/use/useFocusLock';\nimport type { RefObject } from 'react';\nimport React from 'react';\n\nimport type {\n NoticeBubbleManagerClass,\n NoticeBubbleInfoProps,\n NoticeBubbleWarningProps,\n AddedNoticeMeta,\n} from './NoticeBubble.type';\n\nconst EVENT_NAME = 'CHANGE';\n\nexport type NoticeItem = (NoticeBubbleInfoProps | NoticeBubbleWarningProps) & {\n uid: number;\n visible?: boolean;\n forwardRef: RefObject<HTMLElement>;\n onClose: () => void;\n};\n\nclass NoticeBubbleManager implements NoticeBubbleManagerClass {\n private items: NoticeItem[] = [];\n private emitter = new EventEmitter();\n private counter = 0;\n\n private replaceTimer: ReturnType<typeof setTimeout> | null = null;\n\n public addListener(fn: (items: NoticeItem[]) => void): () => void {\n return this.emitter.subscribe(EVENT_NAME, fn);\n }\n\n private emit() {\n this.emitter.emit(EVENT_NAME, this.items);\n }\n\n public add(props: NoticeBubbleInfoProps | NoticeBubbleWarningProps): AddedNoticeMeta {\n const uid = this.counter++;\n const ref = React.createRef<HTMLElement>();\n const focus = () => {\n setTimeout(() => {\n if (ref.current) {\n setFocus(ref.current);\n }\n }, 0);\n };\n const item = {\n type: 'info',\n uid,\n visible: props.initialAnimation ? true : undefined,\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.update.bind(this, uid),\n remove: this.remove.bind(this, uid),\n ref,\n // todo Brauer Ilia: remove this property, because we added logic about autofocus in Notice\n focus,\n };\n }\n\n public update(uid: number, props: NoticeBubbleInfoProps | NoticeBubbleWarningProps): boolean {\n const index = this.items.findIndex((item) => item.uid === uid);\n if (index !== -1) {\n this.items[index] = {\n ...this.items[index],\n ...props,\n };\n this.emit();\n return true;\n }\n return false;\n }\n\n public replace(uid: number, props: NoticeBubbleInfoProps | NoticeBubbleWarningProps): void {\n if (this.replaceTimer) {\n clearTimeout(this.replaceTimer);\n }\n\n this.remove(uid);\n\n this.replaceTimer = setTimeout(() => {\n this.add(props);\n }, 300);\n }\n\n public replaceLast(props: NoticeBubbleInfoProps | NoticeBubbleWarningProps): void {\n if (this.replaceTimer) {\n clearTimeout(this.replaceTimer);\n }\n\n const item = this.items[this.items.length - 1];\n\n if (item?.visible) {\n this.remove(this.counter - 1);\n }\n\n this.replaceTimer = setTimeout(() => {\n this.add(props);\n }, 300);\n }\n\n 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,aAAA,GAAAH,OAAA;AAEA,IAAAI,MAAA,GAAAF,sBAAA,CAAAF,OAAA;AASA,IAAMK,UAA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AC;QACX,OAAO,IAAI;MACb;MACA,OAAO,KAAK;IACd;EAAC;AAAA;AAGH,IAAMuC,0BAA0B,GAAG,IAAInD,mBAAmB,CAAC,CAAC;AAAC,IAAAoD,QAAA,GAAAnD,OAAA,cAG9CkD,0BAA0B","ignoreList":[]}
|
package/lib/cjs/index.js
CHANGED
|
@@ -14,6 +14,7 @@ Object.defineProperty(exports, "NoticeBubbleContainer", {
|
|
|
14
14
|
return _NoticeBubble["default"];
|
|
15
15
|
}
|
|
16
16
|
});
|
|
17
|
+
exports["default"] = void 0;
|
|
17
18
|
Object.defineProperty(exports, "noticeBubbleDefaultManager", {
|
|
18
19
|
enumerable: true,
|
|
19
20
|
get: function get() {
|
|
@@ -44,4 +45,5 @@ Object.keys(_NoticeBubbleManager).forEach(function (key) {
|
|
|
44
45
|
}
|
|
45
46
|
});
|
|
46
47
|
});
|
|
48
|
+
var _default = exports["default"] = _NoticeBubbleManager["default"];
|
|
47
49
|
//# sourceMappingURL=index.js.map
|
package/lib/cjs/index.js.map
CHANGED
|
@@ -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":"
|
|
1
|
+
{"version":3,"file":"index.js","names":["_NoticeBubble","_interopRequireWildcard","require","Object","keys","forEach","key","prototype","hasOwnProperty","call","_exportNames","exports","defineProperty","enumerable","get","_NoticeBubbleManager","_default","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 default noticeBubbleDefaultManager;\nexport { NoticeBubbleContainer, noticeBubbleDefaultManager };\n\nexport type {\n NoticeBubbleContainerProps,\n NoticeBubbleInfoProps,\n NoticeBubbleWarningProps,\n AddedNoticeMeta,\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAAA,IAAAA,aAAA,GAAAC,uBAAA,CAAAC,OAAA;AASAC,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,IAAA;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,IAAA;MAAA,OAAAC,oBAAA,CAAAT,GAAA;IAAA;EAAA;AAAA;AAAsC,IAAAU,QAAA,GAAAL,OAAA,cAEvBM,+BAA0B","ignoreList":[]}
|
package/lib/es6/NoticeBubble.js
CHANGED
|
@@ -26,23 +26,23 @@ import CloseIcon from '@semcore/icon/Close/m';
|
|
|
26
26
|
import React from 'react';
|
|
27
27
|
import manager from './NoticeBubbleManager';
|
|
28
28
|
/*!__reshadow-styles__:"./style/notice-bubble.shadow.css"*/
|
|
29
|
-
var style = (/*__reshadow_css_start__*/_sstyled.insert(/*__inner_css_start__*/"@keyframes
|
|
29
|
+
var style = (/*__reshadow_css_start__*/_sstyled.insert(/*__inner_css_start__*/"@keyframes enter_e1i3p{0%{transform:translate(100%,0);max-height:0;overflow:hidden}to{transform:translate(0,0);max-height:100vh;overflow:hidden}}@keyframes exit_e1i3p{0%{max-height:100vh;overflow:hidden;opacity:1}to{max-height:0;overflow:hidden;opacity:0}}.___SBubble_e1i3p_gg_,.___SView_e1i3p_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, rgba(254, 255, 255, 0.949));gap:var(--intergalactic-spacing-2x, 8px)}.___SBubble_e1i3p_gg_._type_info_e1i3p_gg_,.___SView_e1i3p_gg_._type_info_e1i3p_gg_{background:var(--intergalactic-bg-primary-invert, rgb(26, 30, 26))}.___SBubble_e1i3p_gg_._type_warning_e1i3p_gg_,.___SView_e1i3p_gg_._type_warning_e1i3p_gg_{background:var(--intergalactic-bg-primary-critical, rgb(247, 55, 64))}.___SContent_e1i3p_gg_{flex-direction:column;gap:var(--intergalactic-spacing-2x, 8px);flex:1}.___SMessage_e1i3p_gg_{font-size:var(--intergalactic-fs-200, 14px);line-height:var(--intergalactic-lh-200, 142%)}.___SDismiss_e1i3p_gg_{cursor:pointer;position:absolute;right:0;top:0;margin-top:var(--intergalactic-spacing-2x, 8px);margin-right:var(--intergalactic-spacing-2x, 8px);margin-bottom:var(--intergalactic-spacing-2x, 8px);flex-shrink:0;border:0;background:0 0}.___SDismiss_e1i3p_gg_.__use_e1i3p_gg_{padding:0 1px}.___SIcon_e1i3p_gg_{justify-content:center;align-items:center;height:var(--intergalactic-spacing-5x, 20px)}.___SNoticeBubble_e1i3p_gg_{width:300px;position:fixed;right:var(--intergalactic-spacing-3x, 12px);top:var(--intergalactic-spacing-3x, 12px)}@media (max-width:767px){.___SNoticeBubble_e1i3p_gg_{width:calc(100% - var(--intergalactic-spacing-6x, 24px))}}.___SNoticeBubble_e1i3p_gg_.__disablePortal_e1i3p_gg_{position:sticky;margin-left:auto;height:0}.___SMessage_e1i3p_gg_ a{color:var(--intergalactic-text-link-invert, rgb(136, 172, 253))}.___SNoticeAriaLiveWrapper_e1i3p_gg_{display:contents}", /*__inner_css_end__*/"e1i3p_gg_"),
|
|
30
30
|
/*__reshadow_css_end__*/
|
|
31
31
|
{
|
|
32
|
-
"__SContent": "
|
|
33
|
-
"__SMessage": "
|
|
34
|
-
"__SDismiss": "
|
|
35
|
-
"_use": "
|
|
36
|
-
"__SIcon": "
|
|
37
|
-
"__SNoticeBubble": "
|
|
38
|
-
"_disablePortal": "
|
|
39
|
-
"__SNoticeAriaLiveWrapper": "
|
|
40
|
-
"@enter": "
|
|
41
|
-
"@exit": "
|
|
42
|
-
"__SBubble": "
|
|
43
|
-
"__SView": "
|
|
44
|
-
"_type_info": "
|
|
45
|
-
"_type_warning": "
|
|
32
|
+
"__SContent": "___SContent_e1i3p_gg_",
|
|
33
|
+
"__SMessage": "___SMessage_e1i3p_gg_",
|
|
34
|
+
"__SDismiss": "___SDismiss_e1i3p_gg_",
|
|
35
|
+
"_use": "__use_e1i3p_gg_",
|
|
36
|
+
"__SIcon": "___SIcon_e1i3p_gg_",
|
|
37
|
+
"__SNoticeBubble": "___SNoticeBubble_e1i3p_gg_",
|
|
38
|
+
"_disablePortal": "__disablePortal_e1i3p_gg_",
|
|
39
|
+
"__SNoticeAriaLiveWrapper": "___SNoticeAriaLiveWrapper_e1i3p_gg_",
|
|
40
|
+
"@enter": "enter_e1i3p",
|
|
41
|
+
"@exit": "exit_e1i3p",
|
|
42
|
+
"__SBubble": "___SBubble_e1i3p_gg_",
|
|
43
|
+
"__SView": "___SView_e1i3p_gg_",
|
|
44
|
+
"_type_info": "_type_info_e1i3p_gg_",
|
|
45
|
+
"_type_warning": "_type_warning_e1i3p_gg_"
|
|
46
46
|
});
|
|
47
47
|
import { localizedMessages } from './translations/__intergalactic-dynamic-locales';
|
|
48
48
|
import { Timer } from './utils';
|
|
@@ -345,6 +345,68 @@ _defineProperty(ViewWarning, "defaultProps", {
|
|
|
345
345
|
type: 'warning',
|
|
346
346
|
duration: 0
|
|
347
347
|
});
|
|
348
|
-
var
|
|
348
|
+
var NoticeBubbleView = /*#__PURE__*/function (_Component3) {
|
|
349
|
+
function NoticeBubbleView() {
|
|
350
|
+
var _this4;
|
|
351
|
+
_classCallCheck(this, NoticeBubbleView);
|
|
352
|
+
for (var _len3 = arguments.length, args = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {
|
|
353
|
+
args[_key3] = arguments[_key3];
|
|
354
|
+
}
|
|
355
|
+
_this4 = _callSuper(this, NoticeBubbleView, [].concat(args));
|
|
356
|
+
_defineProperty(_this4, "_notice", null);
|
|
357
|
+
return _this4;
|
|
358
|
+
}
|
|
359
|
+
_inherits(NoticeBubbleView, _Component3);
|
|
360
|
+
return _createClass(NoticeBubbleView, [{
|
|
361
|
+
key: "componentDidMount",
|
|
362
|
+
value: function componentDidMount() {
|
|
363
|
+
this._notice = this.asProps.manager.add(this.asProps);
|
|
364
|
+
}
|
|
365
|
+
}, {
|
|
366
|
+
key: "componentWillUnmount",
|
|
367
|
+
value: function componentWillUnmount() {
|
|
368
|
+
if (this._notice) {
|
|
369
|
+
this._notice.remove();
|
|
370
|
+
}
|
|
371
|
+
}
|
|
372
|
+
}, {
|
|
373
|
+
key: "componentDidUpdate",
|
|
374
|
+
value: function componentDidUpdate() {
|
|
375
|
+
if (this._notice) {
|
|
376
|
+
this._notice.update(this.asProps);
|
|
377
|
+
}
|
|
378
|
+
}
|
|
379
|
+
}, {
|
|
380
|
+
key: "render",
|
|
381
|
+
value: function render() {
|
|
382
|
+
return null;
|
|
383
|
+
}
|
|
384
|
+
}]);
|
|
385
|
+
}(Component);
|
|
386
|
+
_defineProperty(NoticeBubbleView, "defaultProps", {
|
|
387
|
+
duration: 5000,
|
|
388
|
+
type: 'info',
|
|
389
|
+
manager: manager
|
|
390
|
+
});
|
|
391
|
+
var NoticeBubbleWarningView = /*#__PURE__*/function (_NoticeBubbleView2) {
|
|
392
|
+
function NoticeBubbleWarningView() {
|
|
393
|
+
_classCallCheck(this, NoticeBubbleWarningView);
|
|
394
|
+
return _callSuper(this, NoticeBubbleWarningView, arguments);
|
|
395
|
+
}
|
|
396
|
+
_inherits(NoticeBubbleWarningView, _NoticeBubbleView2);
|
|
397
|
+
return _createClass(NoticeBubbleWarningView);
|
|
398
|
+
}(NoticeBubbleView);
|
|
399
|
+
_defineProperty(NoticeBubbleWarningView, "defaultProps", {
|
|
400
|
+
duration: 5000,
|
|
401
|
+
type: 'warning',
|
|
402
|
+
manager: manager
|
|
403
|
+
});
|
|
404
|
+
var NoticeBubbleContainer = createComponent(NoticeBubbleContainerRoot, {
|
|
405
|
+
Info: NoticeBubbleView,
|
|
406
|
+
Warning: NoticeBubbleWarningView
|
|
407
|
+
});
|
|
408
|
+
var NoticeBubble = NoticeBubbleContainer.Info;
|
|
409
|
+
var NoticeBubbleWarning = NoticeBubbleContainer.Warning;
|
|
410
|
+
export { NoticeBubble, NoticeBubbleWarning };
|
|
349
411
|
export default NoticeBubbleContainer;
|
|
350
412
|
//# sourceMappingURL=NoticeBubble.js.map
|