@semcore/notice-bubble 16.1.1-prerelease.4 → 16.1.2-prerelease.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 +6 -0
- package/README.md +1 -31
- package/lib/cjs/NoticeBubble.js +67 -78
- package/lib/cjs/NoticeBubble.js.map +1 -1
- package/lib/cjs/NoticeBubbleManager.js +5 -8
- package/lib/cjs/NoticeBubbleManager.js.map +1 -1
- package/lib/cjs/index.d.js.map +1 -1
- package/lib/cjs/index.js +2 -3
- package/lib/cjs/index.js.map +1 -1
- package/lib/cjs/translations/__intergalactic-dynamic-locales.js +4 -5
- package/lib/cjs/translations/__intergalactic-dynamic-locales.js.map +1 -1
- package/lib/cjs/utils.js +3 -5
- package/lib/cjs/utils.js.map +1 -1
- package/lib/es6/NoticeBubble.js +65 -74
- package/lib/es6/NoticeBubble.js.map +1 -1
- package/lib/es6/NoticeBubbleManager.js +2 -3
- package/lib/es6/NoticeBubbleManager.js.map +1 -1
- package/lib/es6/index.d.js.map +1 -1
- package/lib/es6/index.js +1 -1
- package/lib/es6/index.js.map +1 -1
- package/lib/es6/translations/__intergalactic-dynamic-locales.js +2 -2
- package/lib/es6/translations/__intergalactic-dynamic-locales.js.map +1 -1
- package/lib/es6/utils.js +1 -2
- package/lib/es6/utils.js.map +1 -1
- package/lib/esm/NoticeBubble.mjs +82 -90
- package/lib/esm/NoticeBubbleManager.mjs +2 -3
- package/lib/esm/translations/__intergalactic-dynamic-locales.mjs +2 -2
- package/lib/esm/utils.mjs +1 -2
- package/lib/types/index.d.ts +4 -4
- package/package.json +8 -8
package/lib/cjs/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard");
|
|
3
|
+
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard")["default"];
|
|
4
4
|
Object.defineProperty(exports, "__esModule", {
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
@@ -45,6 +45,5 @@ Object.keys(_NoticeBubbleManager).forEach(function (key) {
|
|
|
45
45
|
}
|
|
46
46
|
});
|
|
47
47
|
});
|
|
48
|
-
var _default = _NoticeBubbleManager["default"];
|
|
49
|
-
exports["default"] = _default;
|
|
48
|
+
var _default = exports["default"] = _NoticeBubbleManager["default"];
|
|
50
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","_default","noticeBubbleDefaultManager"],"sources":["../../src/index.js"],"sourcesContent":["import { default as NoticeBubbleContainer } from './NoticeBubble';\
|
|
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.js"],"sourcesContent":["import { default as NoticeBubbleContainer } from './NoticeBubble';\nimport { default as noticeBubbleDefaultManager } from './NoticeBubbleManager';\n\nexport * from './NoticeBubble';\n\nexport * from './NoticeBubbleManager';\n\nexport default noticeBubbleDefaultManager;\nexport { NoticeBubbleContainer, noticeBubbleDefaultManager };\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAAA,IAAAA,aAAA,GAAAC,uBAAA,CAAAC,OAAA;AAGAC,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":[]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault")["default"];
|
|
4
4
|
Object.defineProperty(exports, "__esModule", {
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
@@ -13,13 +13,13 @@ var _it = _interopRequireDefault(require("./it.json"));
|
|
|
13
13
|
var _ja = _interopRequireDefault(require("./ja.json"));
|
|
14
14
|
var _ko = _interopRequireDefault(require("./ko.json"));
|
|
15
15
|
var _nl = _interopRequireDefault(require("./nl.json"));
|
|
16
|
+
var _pl = _interopRequireDefault(require("./pl.json"));
|
|
16
17
|
var _pt = _interopRequireDefault(require("./pt.json"));
|
|
18
|
+
var _sv = _interopRequireDefault(require("./sv.json"));
|
|
17
19
|
var _tr = _interopRequireDefault(require("./tr.json"));
|
|
18
20
|
var _vi = _interopRequireDefault(require("./vi.json"));
|
|
19
21
|
var _zh = _interopRequireDefault(require("./zh.json"));
|
|
20
|
-
var
|
|
21
|
-
var _sv = _interopRequireDefault(require("./sv.json"));
|
|
22
|
-
var localizedMessages = {
|
|
22
|
+
var localizedMessages = exports.localizedMessages = {
|
|
23
23
|
de: _de["default"],
|
|
24
24
|
en: _en["default"],
|
|
25
25
|
es: _es["default"],
|
|
@@ -35,5 +35,4 @@ var localizedMessages = {
|
|
|
35
35
|
pl: _pl["default"],
|
|
36
36
|
sv: _sv["default"]
|
|
37
37
|
};
|
|
38
|
-
exports.localizedMessages = localizedMessages;
|
|
39
38
|
//# sourceMappingURL=__intergalactic-dynamic-locales.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"__intergalactic-dynamic-locales.js","names":["_de","_interopRequireDefault","require","_en","_es","_fr","_it","_ja","_ko","_nl","_pt","_tr","_vi","_zh","
|
|
1
|
+
{"version":3,"file":"__intergalactic-dynamic-locales.js","names":["_de","_interopRequireDefault","require","_en","_es","_fr","_it","_ja","_ko","_nl","_pl","_pt","_sv","_tr","_vi","_zh","localizedMessages","exports","de","en","es","fr","it","ja","ko","nl","pt","tr","vi","zh","pl","sv"],"sources":["../../../src/translations/__intergalactic-dynamic-locales.ts"],"sourcesContent":["import de from './de.json';\nimport en from './en.json';\nimport es from './es.json';\nimport fr from './fr.json';\nimport it from './it.json';\nimport ja from './ja.json';\nimport ko from './ko.json';\nimport nl from './nl.json';\nimport pl from './pl.json';\nimport pt from './pt.json';\nimport sv from './sv.json';\nimport tr from './tr.json';\nimport vi from './vi.json';\nimport zh from './zh.json';\n\nexport const localizedMessages = {\n de,\n en,\n es,\n fr,\n it,\n ja,\n ko,\n nl,\n pt,\n tr,\n vi,\n zh,\n pl,\n sv,\n};\n"],"mappings":";;;;;;;AAAA,IAAAA,GAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,GAAA,GAAAF,sBAAA,CAAAC,OAAA;AACA,IAAAE,GAAA,GAAAH,sBAAA,CAAAC,OAAA;AACA,IAAAG,GAAA,GAAAJ,sBAAA,CAAAC,OAAA;AACA,IAAAI,GAAA,GAAAL,sBAAA,CAAAC,OAAA;AACA,IAAAK,GAAA,GAAAN,sBAAA,CAAAC,OAAA;AACA,IAAAM,GAAA,GAAAP,sBAAA,CAAAC,OAAA;AACA,IAAAO,GAAA,GAAAR,sBAAA,CAAAC,OAAA;AACA,IAAAQ,GAAA,GAAAT,sBAAA,CAAAC,OAAA;AACA,IAAAS,GAAA,GAAAV,sBAAA,CAAAC,OAAA;AACA,IAAAU,GAAA,GAAAX,sBAAA,CAAAC,OAAA;AACA,IAAAW,GAAA,GAAAZ,sBAAA,CAAAC,OAAA;AACA,IAAAY,GAAA,GAAAb,sBAAA,CAAAC,OAAA;AACA,IAAAa,GAAA,GAAAd,sBAAA,CAAAC,OAAA;AAEO,IAAMc,iBAAiB,GAAAC,OAAA,CAAAD,iBAAA,GAAG;EAC/BE,EAAE,EAAFA,cAAE;EACFC,EAAE,EAAFA,cAAE;EACFC,EAAE,EAAFA,cAAE;EACFC,EAAE,EAAFA,cAAE;EACFC,EAAE,EAAFA,cAAE;EACFC,EAAE,EAAFA,cAAE;EACFC,EAAE,EAAFA,cAAE;EACFC,EAAE,EAAFA,cAAE;EACFC,EAAE,EAAFA,cAAE;EACFC,EAAE,EAAFA,cAAE;EACFC,EAAE,EAAFA,cAAE;EACFC,EAAE,EAAFA,cAAE;EACFC,EAAE,EAAFA,cAAE;EACFC,EAAE,EAAFA;AACF,CAAC","ignoreList":[]}
|
package/lib/cjs/utils.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault")["default"];
|
|
4
4
|
Object.defineProperty(exports, "__esModule", {
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
7
|
exports.Timer = void 0;
|
|
8
8
|
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
9
9
|
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
10
|
-
var Timer = /*#__PURE__*/function () {
|
|
10
|
+
var Timer = exports.Timer = /*#__PURE__*/function () {
|
|
11
11
|
function Timer(callback, delay) {
|
|
12
12
|
(0, _classCallCheck2["default"])(this, Timer);
|
|
13
13
|
this.callback = callback;
|
|
@@ -16,7 +16,7 @@ var Timer = /*#__PURE__*/function () {
|
|
|
16
16
|
this.paused = false;
|
|
17
17
|
this.resume();
|
|
18
18
|
}
|
|
19
|
-
(0, _createClass2["default"])(Timer, [{
|
|
19
|
+
return (0, _createClass2["default"])(Timer, [{
|
|
20
20
|
key: "pause",
|
|
21
21
|
value: function pause() {
|
|
22
22
|
clearTimeout(this.timerId);
|
|
@@ -43,7 +43,5 @@ var Timer = /*#__PURE__*/function () {
|
|
|
43
43
|
clearTimeout(this.timerId);
|
|
44
44
|
}
|
|
45
45
|
}]);
|
|
46
|
-
return Timer;
|
|
47
46
|
}();
|
|
48
|
-
exports.Timer = Timer;
|
|
49
47
|
//# sourceMappingURL=utils.js.map
|
package/lib/cjs/utils.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.js","names":["Timer","callback","delay","_classCallCheck2","remaining","paused","resume","_createClass2","key","value","pause","clearTimeout","timerId","Date","now","start","setTimeout","reset","clear"
|
|
1
|
+
{"version":3,"file":"utils.js","names":["Timer","exports","callback","delay","_classCallCheck2","remaining","paused","resume","_createClass2","key","value","pause","clearTimeout","timerId","Date","now","start","setTimeout","reset","clear"],"sources":["../../src/utils.js"],"sourcesContent":["class Timer {\n constructor(callback, delay) {\n this.callback = callback;\n this.delay = delay;\n this.remaining = delay;\n this.paused = false;\n this.resume();\n }\n\n pause() {\n clearTimeout(this.timerId);\n this.remaining -= Date.now() - this.start;\n this.paused = true;\n }\n\n resume() {\n this.start = Date.now();\n this.paused = false;\n clearTimeout(this.timerId);\n this.timerId = setTimeout(this.callback, this.remaining);\n }\n\n reset() {\n this.remaining = this.delay;\n this.resume();\n }\n\n clear() {\n clearTimeout(this.timerId);\n }\n}\n\nexport { Timer };\n"],"mappings":";;;;;;;;;IAAMA,KAAK,GAAAC,OAAA,CAAAD,KAAA;EACT,SAAAA,MAAYE,QAAQ,EAAEC,KAAK,EAAE;IAAA,IAAAC,gBAAA,mBAAAJ,KAAA;IAC3B,IAAI,CAACE,QAAQ,GAAGA,QAAQ;IACxB,IAAI,CAACC,KAAK,GAAGA,KAAK;IAClB,IAAI,CAACE,SAAS,GAAGF,KAAK;IACtB,IAAI,CAACG,MAAM,GAAG,KAAK;IACnB,IAAI,CAACC,MAAM,CAAC,CAAC;EACf;EAAC,WAAAC,aAAA,aAAAR,KAAA;IAAAS,GAAA;IAAAC,KAAA,EAED,SAAAC,KAAKA,CAAA,EAAG;MACNC,YAAY,CAAC,IAAI,CAACC,OAAO,CAAC;MAC1B,IAAI,CAACR,SAAS,IAAIS,IAAI,CAACC,GAAG,CAAC,CAAC,GAAG,IAAI,CAACC,KAAK;MACzC,IAAI,CAACV,MAAM,GAAG,IAAI;IACpB;EAAC;IAAAG,GAAA;IAAAC,KAAA,EAED,SAAAH,MAAMA,CAAA,EAAG;MACP,IAAI,CAACS,KAAK,GAAGF,IAAI,CAACC,GAAG,CAAC,CAAC;MACvB,IAAI,CAACT,MAAM,GAAG,KAAK;MACnBM,YAAY,CAAC,IAAI,CAACC,OAAO,CAAC;MAC1B,IAAI,CAACA,OAAO,GAAGI,UAAU,CAAC,IAAI,CAACf,QAAQ,EAAE,IAAI,CAACG,SAAS,CAAC;IAC1D;EAAC;IAAAI,GAAA;IAAAC,KAAA,EAED,SAAAQ,KAAKA,CAAA,EAAG;MACN,IAAI,CAACb,SAAS,GAAG,IAAI,CAACF,KAAK;MAC3B,IAAI,CAACI,MAAM,CAAC,CAAC;IACf;EAAC;IAAAE,GAAA;IAAAC,KAAA,EAED,SAAAS,KAAKA,CAAA,EAAG;MACNP,YAAY,CAAC,IAAI,CAACC,OAAO,CAAC;IAC5B;EAAC;AAAA","ignoreList":[]}
|
package/lib/es6/NoticeBubble.js
CHANGED
|
@@ -2,55 +2,56 @@ import _extends from "@babel/runtime/helpers/extends";
|
|
|
2
2
|
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
3
3
|
import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
|
|
4
4
|
import _createClass from "@babel/runtime/helpers/createClass";
|
|
5
|
-
import
|
|
5
|
+
import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";
|
|
6
|
+
import _isNativeReflectConstruct from "@babel/runtime/helpers/isNativeReflectConstruct";
|
|
7
|
+
import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
|
|
6
8
|
import _inherits from "@babel/runtime/helpers/inherits";
|
|
7
|
-
import _createSuper from "@babel/runtime/helpers/createSuper";
|
|
8
9
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
9
10
|
import _objectSpread from "@babel/runtime/helpers/objectSpread2";
|
|
10
11
|
import { sstyled as _sstyled } from "@semcore/core";
|
|
11
12
|
import { assignProps as _assignProps } from "@semcore/core";
|
|
12
13
|
var _excluded = ["focusLock"],
|
|
13
14
|
_excluded2 = ["forwardRef", "styles", "onMouseEnter", "onMouseLeave", "getI18nText", "icon", "children", "action", "type"];
|
|
14
|
-
|
|
15
|
-
import Portal from '@semcore/portal';
|
|
16
|
-
import manager from './NoticeBubbleManager';
|
|
17
|
-
import { createComponent, Component, sstyled, Root } from '@semcore/core';
|
|
15
|
+
function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
|
|
18
16
|
import { Animation } from '@semcore/animation';
|
|
19
|
-
import
|
|
20
|
-
import
|
|
21
|
-
import isNode from '@semcore/core/lib/utils/isNode';
|
|
17
|
+
import Button from '@semcore/button';
|
|
18
|
+
import { createComponent, Component, sstyled, Root } from '@semcore/core';
|
|
22
19
|
import { callAllEventHandlers } from '@semcore/core/lib/utils/assignProps';
|
|
23
|
-
import CloseIcon from '@semcore/icon/Close/m';
|
|
24
|
-
import { Timer } from './utils';
|
|
25
|
-
import { localizedMessages } from './translations/__intergalactic-dynamic-locales';
|
|
26
20
|
import i18nEnhance from '@semcore/core/lib/utils/enhances/i18nEnhance';
|
|
27
|
-
import
|
|
21
|
+
import fire from '@semcore/core/lib/utils/fire';
|
|
22
|
+
import { getFocusableIn } from '@semcore/core/lib/utils/focus-lock/getFocusableIn';
|
|
23
|
+
import isNode from '@semcore/core/lib/utils/isNode';
|
|
24
|
+
import { forkRef, useForkRef } from '@semcore/core/lib/utils/ref';
|
|
28
25
|
import { contextThemeEnhance } from '@semcore/core/lib/utils/ThemeProvider';
|
|
29
|
-
import
|
|
30
|
-
import {
|
|
26
|
+
import { useFocusLock, setFocus } from '@semcore/core/lib/utils/use/useFocusLock';
|
|
27
|
+
import { useCssVariable } from '@semcore/core/lib/utils/useCssVariable';
|
|
31
28
|
import { ZIndexStackingContextProvider, zIndexStackingEnhance } from '@semcore/core/lib/utils/zIndexStacking';
|
|
29
|
+
import { Flex, Box } from '@semcore/flex-box';
|
|
30
|
+
import CloseIcon from '@semcore/icon/Close/m';
|
|
31
|
+
import Portal from '@semcore/portal';
|
|
32
|
+
import React from 'react';
|
|
33
|
+
import manager from './NoticeBubbleManager';
|
|
32
34
|
/*!__reshadow-styles__:"./style/notice-bubble.shadow.css"*/
|
|
33
|
-
var style = (
|
|
35
|
+
var style = (/*__reshadow_css_start__*/_sstyled.insert(/*__inner_css_start__*/"@keyframes enter_1ve9q{0%{transform:translate(100%,0);max-height:0;overflow:hidden}to{transform:translate(0,0);max-height:100vh;overflow:hidden}}@keyframes exit_1ve9q{0%{max-height:100vh;overflow:hidden;opacity:1}to{max-height:0;overflow:hidden;opacity:0}}.___SBubble_1ve9q_gg_,.___SView_1ve9q_gg_{position:relative;margin-bottom:var(--intergalactic-spacing-3x, 12px);padding:var(--intergalactic-spacing-3x, 12px);padding-right:calc(var(--intergalactic-spacing-8x, 32px) + var(--intergalactic-spacing-1x, 4px));width:100%;border-radius:var(--intergalactic-popper-rounded, 6px);overflow:hidden;box-sizing:border-box;color:var(--intergalactic-text-primary-invert, #ffffff);gap:var(--intergalactic-spacing-2x, 8px)}.___SBubble_1ve9q_gg_._type_info_1ve9q_gg_,.___SView_1ve9q_gg_._type_info_1ve9q_gg_{background:var(--intergalactic-bg-primary-invert, #191b23)}.___SBubble_1ve9q_gg_._type_warning_1ve9q_gg_,.___SView_1ve9q_gg_._type_warning_1ve9q_gg_{background:var(--intergalactic-bg-primary-critical, #ff4953)}.___SContent_1ve9q_gg_{flex-direction:column;gap:var(--intergalactic-spacing-2x, 8px);flex:1}.___SMessage_1ve9q_gg_{font-size:var(--intergalactic-fs-200, 14px);line-height:var(--intergalactic-lh-200, 142%)}.___SDismiss_1ve9q_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_1ve9q_gg_.__use_1ve9q_gg_{padding:0 1px}.___SIcon_1ve9q_gg_{justify-content:center;align-items:center;height:var(--intergalactic-spacing-5x, 20px)}.___SNoticeBubble_1ve9q_gg_{width:300px;position:fixed;right:var(--intergalactic-spacing-3x, 12px);top:var(--intergalactic-spacing-3x, 12px)}@media (max-width:767px){.___SNoticeBubble_1ve9q_gg_{width:calc(100% - var(--intergalactic-spacing-6x, 24px))}}.___SNoticeBubble_1ve9q_gg_.__disablePortal_1ve9q_gg_{position:sticky;margin-left:auto;height:0}.___SMessage_1ve9q_gg_ a{color:var(--intergalactic-text-link-invert, #8ecdff)}.___SNoticeAriaLiveWrapper_1ve9q_gg_{display:contents}", /*__inner_css_end__*/"1ve9q_gg_"),
|
|
34
36
|
/*__reshadow_css_end__*/
|
|
35
37
|
{
|
|
36
|
-
"__SContent": "
|
|
37
|
-
"__SMessage": "
|
|
38
|
-
"__SDismiss": "
|
|
39
|
-
"_use": "
|
|
40
|
-
"__SIcon": "
|
|
41
|
-
"__SNoticeBubble": "
|
|
42
|
-
"_disablePortal": "
|
|
43
|
-
"__SNoticeAriaLiveWrapper": "
|
|
44
|
-
"@enter": "
|
|
45
|
-
"@exit": "
|
|
46
|
-
"__SBubble": "
|
|
47
|
-
"__SView": "
|
|
48
|
-
"_type_info": "
|
|
49
|
-
"_type_warning": "
|
|
38
|
+
"__SContent": "___SContent_1ve9q_gg_",
|
|
39
|
+
"__SMessage": "___SMessage_1ve9q_gg_",
|
|
40
|
+
"__SDismiss": "___SDismiss_1ve9q_gg_",
|
|
41
|
+
"_use": "__use_1ve9q_gg_",
|
|
42
|
+
"__SIcon": "___SIcon_1ve9q_gg_",
|
|
43
|
+
"__SNoticeBubble": "___SNoticeBubble_1ve9q_gg_",
|
|
44
|
+
"_disablePortal": "__disablePortal_1ve9q_gg_",
|
|
45
|
+
"__SNoticeAriaLiveWrapper": "___SNoticeAriaLiveWrapper_1ve9q_gg_",
|
|
46
|
+
"@enter": "enter_1ve9q",
|
|
47
|
+
"@exit": "exit_1ve9q",
|
|
48
|
+
"__SBubble": "___SBubble_1ve9q_gg_",
|
|
49
|
+
"__SView": "___SView_1ve9q_gg_",
|
|
50
|
+
"_type_info": "_type_info_1ve9q_gg_",
|
|
51
|
+
"_type_warning": "_type_warning_1ve9q_gg_"
|
|
50
52
|
});
|
|
51
|
-
import {
|
|
52
|
-
import {
|
|
53
|
-
import { setFocus } from '@semcore/core/lib/utils/use/useFocusLock';
|
|
53
|
+
import { localizedMessages } from './translations/__intergalactic-dynamic-locales';
|
|
54
|
+
import { Timer } from './utils';
|
|
54
55
|
var Notices = function Notices(props) {
|
|
55
56
|
var styles = props.styles,
|
|
56
57
|
_props$data = props.data,
|
|
@@ -60,7 +61,7 @@ var Notices = function Notices(props) {
|
|
|
60
61
|
var ref = React.useRef();
|
|
61
62
|
var durationStr = useCssVariable('--intergalactic-duration-popper', '200', ref);
|
|
62
63
|
var duration = React.useMemo(function () {
|
|
63
|
-
return parseInt(durationStr, 10);
|
|
64
|
+
return Number.parseInt(durationStr, 10);
|
|
64
65
|
}, [durationStr]);
|
|
65
66
|
return data.map(function (notice) {
|
|
66
67
|
var _ref2, _notice$visible;
|
|
@@ -78,26 +79,24 @@ var Notices = function Notices(props) {
|
|
|
78
79
|
});
|
|
79
80
|
};
|
|
80
81
|
var NoticeBubbleContainerRoot = /*#__PURE__*/function (_Component) {
|
|
81
|
-
_inherits(NoticeBubbleContainerRoot, _Component);
|
|
82
|
-
var _super = _createSuper(NoticeBubbleContainerRoot);
|
|
83
82
|
function NoticeBubbleContainerRoot() {
|
|
84
83
|
var _this;
|
|
85
84
|
_classCallCheck(this, NoticeBubbleContainerRoot);
|
|
86
85
|
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
87
86
|
args[_key] = arguments[_key];
|
|
88
87
|
}
|
|
89
|
-
_this =
|
|
90
|
-
_defineProperty(
|
|
91
|
-
_defineProperty(
|
|
88
|
+
_this = _callSuper(this, NoticeBubbleContainerRoot, [].concat(args));
|
|
89
|
+
_defineProperty(_this, "_unsubscribe", null);
|
|
90
|
+
_defineProperty(_this, "state", {
|
|
92
91
|
notices: [],
|
|
93
92
|
warnings: []
|
|
94
93
|
});
|
|
95
|
-
_defineProperty(
|
|
94
|
+
_defineProperty(_this, "componentWillUnmount", function () {
|
|
96
95
|
if (_this._unsubscribe) {
|
|
97
96
|
_this._unsubscribe();
|
|
98
97
|
}
|
|
99
98
|
});
|
|
100
|
-
_defineProperty(
|
|
99
|
+
_defineProperty(_this, "handleChange", function (notices) {
|
|
101
100
|
var info = notices.filter(function (notice) {
|
|
102
101
|
return notice.type === 'info';
|
|
103
102
|
});
|
|
@@ -111,7 +110,8 @@ var NoticeBubbleContainerRoot = /*#__PURE__*/function (_Component) {
|
|
|
111
110
|
});
|
|
112
111
|
return _this;
|
|
113
112
|
}
|
|
114
|
-
|
|
113
|
+
_inherits(NoticeBubbleContainerRoot, _Component);
|
|
114
|
+
return _createClass(NoticeBubbleContainerRoot, [{
|
|
115
115
|
key: "componentDidMount",
|
|
116
116
|
value: function componentDidMount() {
|
|
117
117
|
this._unsubscribe = this.asProps.manager.addListener(this.handleChange);
|
|
@@ -158,7 +158,6 @@ var NoticeBubbleContainerRoot = /*#__PURE__*/function (_Component) {
|
|
|
158
158
|
}))))));
|
|
159
159
|
}
|
|
160
160
|
}]);
|
|
161
|
-
return NoticeBubbleContainerRoot;
|
|
162
161
|
}(Component);
|
|
163
162
|
_defineProperty(NoticeBubbleContainerRoot, "displayName", 'NoticeBubbleContainer');
|
|
164
163
|
_defineProperty(NoticeBubbleContainerRoot, "style", style);
|
|
@@ -179,37 +178,35 @@ var FocusLock = /*#__PURE__*/React.forwardRef(function (props, outerRef) {
|
|
|
179
178
|
}, other));
|
|
180
179
|
});
|
|
181
180
|
var ViewInfo = /*#__PURE__*/function (_Component2) {
|
|
182
|
-
_inherits(ViewInfo, _Component2);
|
|
183
|
-
var _super2 = _createSuper(ViewInfo);
|
|
184
181
|
function ViewInfo() {
|
|
185
182
|
var _this2;
|
|
186
183
|
_classCallCheck(this, ViewInfo);
|
|
187
184
|
for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
|
|
188
185
|
args[_key2] = arguments[_key2];
|
|
189
186
|
}
|
|
190
|
-
_this2 =
|
|
191
|
-
_defineProperty(
|
|
192
|
-
_defineProperty(
|
|
193
|
-
_defineProperty(
|
|
194
|
-
_defineProperty(
|
|
187
|
+
_this2 = _callSuper(this, ViewInfo, [].concat(args));
|
|
188
|
+
_defineProperty(_this2, "timer", null);
|
|
189
|
+
_defineProperty(_this2, "ref", /*#__PURE__*/React.createRef());
|
|
190
|
+
_defineProperty(_this2, "closeButtonRef", /*#__PURE__*/React.createRef());
|
|
191
|
+
_defineProperty(_this2, "handleClose", function (e) {
|
|
195
192
|
// because it might be called not only from the close icon click
|
|
196
|
-
fire(
|
|
193
|
+
fire(_this2, 'onClose', e);
|
|
197
194
|
_this2.clearTimer();
|
|
198
195
|
});
|
|
199
|
-
_defineProperty(
|
|
196
|
+
_defineProperty(_this2, "handleKeydown", function (e) {
|
|
200
197
|
if (e.key === 'Escape') {
|
|
201
198
|
_this2.handleClose(e);
|
|
202
199
|
}
|
|
203
200
|
});
|
|
204
|
-
_defineProperty(
|
|
201
|
+
_defineProperty(_this2, "handleMouseEnter", function () {
|
|
205
202
|
if (!_this2.timer) return;
|
|
206
203
|
_this2.timer.pause();
|
|
207
204
|
});
|
|
208
|
-
_defineProperty(
|
|
205
|
+
_defineProperty(_this2, "handleMouseLeave", function () {
|
|
209
206
|
if (!_this2.timer) return;
|
|
210
207
|
_this2.timer.resume();
|
|
211
208
|
});
|
|
212
|
-
_defineProperty(
|
|
209
|
+
_defineProperty(_this2, "handleBodyMouseMove", function (event) {
|
|
213
210
|
var _this2$timer;
|
|
214
211
|
if (!((_this2$timer = _this2.timer) !== null && _this2$timer !== void 0 && _this2$timer.paused)) return;
|
|
215
212
|
var rect = _this2.ref.current.getBoundingClientRect();
|
|
@@ -219,7 +216,8 @@ var ViewInfo = /*#__PURE__*/function (_Component2) {
|
|
|
219
216
|
});
|
|
220
217
|
return _this2;
|
|
221
218
|
}
|
|
222
|
-
|
|
219
|
+
_inherits(ViewInfo, _Component2);
|
|
220
|
+
return _createClass(ViewInfo, [{
|
|
223
221
|
key: "componentDidMount",
|
|
224
222
|
value: function componentDidMount() {
|
|
225
223
|
var _this3 = this;
|
|
@@ -281,9 +279,7 @@ var ViewInfo = /*#__PURE__*/function (_Component2) {
|
|
|
281
279
|
"onMouseLeave": callAllEventHandlers(onMouseLeave, this.handleMouseLeave),
|
|
282
280
|
"onKeyDown": this.handleKeydown,
|
|
283
281
|
"role": type === 'warning' ? 'alert' : this.props.role
|
|
284
|
-
})), /*#__PURE__*/React.createElement(SDismiss
|
|
285
|
-
// biome-ignore lint/a11y/useValidAriaValues:
|
|
286
|
-
, _ref4.cn("SDismiss", {
|
|
282
|
+
})), /*#__PURE__*/React.createElement(SDismiss, _ref4.cn("SDismiss", {
|
|
287
283
|
"aria-haspopup": undefined,
|
|
288
284
|
"type": 'button',
|
|
289
285
|
"use": 'tertiary',
|
|
@@ -300,15 +296,13 @@ var ViewInfo = /*#__PURE__*/function (_Component2) {
|
|
|
300
296
|
})), isNode(icon) ? /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(SIcon, _ref4.cn("SIcon", {}), icon), /*#__PURE__*/React.createElement(SContent, _ref4.cn("SContent", {}), /*#__PURE__*/React.createElement(SMessage, _ref4.cn("SMessage", {}), children), isNode(actionNode) ? /*#__PURE__*/React.createElement(SAction, _ref4.cn("SAction", {}), actionNode) : null)) : /*#__PURE__*/React.createElement(SContent, _ref4.cn("SContent", {}), /*#__PURE__*/React.createElement(SMessage, _ref4.cn("SMessage", {}), children), isNode(actionNode) ? /*#__PURE__*/React.createElement(SAction, _ref4.cn("SAction", {}), actionNode) : null));
|
|
301
297
|
}
|
|
302
298
|
}]);
|
|
303
|
-
return ViewInfo;
|
|
304
299
|
}(Component);
|
|
305
|
-
var ViewWarning = /*#__PURE__*/function (
|
|
306
|
-
_inherits(ViewWarning, _ViewInfo);
|
|
307
|
-
var _super3 = _createSuper(ViewWarning);
|
|
300
|
+
var ViewWarning = /*#__PURE__*/function (_ViewInfo2) {
|
|
308
301
|
function ViewWarning() {
|
|
309
302
|
_classCallCheck(this, ViewWarning);
|
|
310
|
-
return
|
|
303
|
+
return _callSuper(this, ViewWarning, arguments);
|
|
311
304
|
}
|
|
305
|
+
_inherits(ViewWarning, _ViewInfo2);
|
|
312
306
|
return _createClass(ViewWarning);
|
|
313
307
|
}(ViewInfo);
|
|
314
308
|
_defineProperty(ViewWarning, "defaultProps", {
|
|
@@ -316,19 +310,18 @@ _defineProperty(ViewWarning, "defaultProps", {
|
|
|
316
310
|
duration: 0
|
|
317
311
|
});
|
|
318
312
|
var NoticeBubbleView = /*#__PURE__*/function (_Component3) {
|
|
319
|
-
_inherits(NoticeBubbleView, _Component3);
|
|
320
|
-
var _super4 = _createSuper(NoticeBubbleView);
|
|
321
313
|
function NoticeBubbleView() {
|
|
322
314
|
var _this4;
|
|
323
315
|
_classCallCheck(this, NoticeBubbleView);
|
|
324
316
|
for (var _len3 = arguments.length, args = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {
|
|
325
317
|
args[_key3] = arguments[_key3];
|
|
326
318
|
}
|
|
327
|
-
_this4 =
|
|
328
|
-
_defineProperty(
|
|
319
|
+
_this4 = _callSuper(this, NoticeBubbleView, [].concat(args));
|
|
320
|
+
_defineProperty(_this4, "_notice", null);
|
|
329
321
|
return _this4;
|
|
330
322
|
}
|
|
331
|
-
|
|
323
|
+
_inherits(NoticeBubbleView, _Component3);
|
|
324
|
+
return _createClass(NoticeBubbleView, [{
|
|
332
325
|
key: "componentDidMount",
|
|
333
326
|
value: function componentDidMount() {
|
|
334
327
|
this._notice = this.asProps.manager.add(this.asProps);
|
|
@@ -353,20 +346,18 @@ var NoticeBubbleView = /*#__PURE__*/function (_Component3) {
|
|
|
353
346
|
return null;
|
|
354
347
|
}
|
|
355
348
|
}]);
|
|
356
|
-
return NoticeBubbleView;
|
|
357
349
|
}(Component);
|
|
358
350
|
_defineProperty(NoticeBubbleView, "defaultProps", {
|
|
359
351
|
duration: 5000,
|
|
360
352
|
type: 'info',
|
|
361
353
|
manager: manager
|
|
362
354
|
});
|
|
363
|
-
var NoticeBubbleWarningView = /*#__PURE__*/function (
|
|
364
|
-
_inherits(NoticeBubbleWarningView, _NoticeBubbleView);
|
|
365
|
-
var _super5 = _createSuper(NoticeBubbleWarningView);
|
|
355
|
+
var NoticeBubbleWarningView = /*#__PURE__*/function (_NoticeBubbleView2) {
|
|
366
356
|
function NoticeBubbleWarningView() {
|
|
367
357
|
_classCallCheck(this, NoticeBubbleWarningView);
|
|
368
|
-
return
|
|
358
|
+
return _callSuper(this, NoticeBubbleWarningView, arguments);
|
|
369
359
|
}
|
|
360
|
+
_inherits(NoticeBubbleWarningView, _NoticeBubbleView2);
|
|
370
361
|
return _createClass(NoticeBubbleWarningView);
|
|
371
362
|
}(NoticeBubbleView);
|
|
372
363
|
_defineProperty(NoticeBubbleWarningView, "defaultProps", {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NoticeBubble.js","names":["React","Portal","manager","createComponent","Component","sstyled","Root","Animation","Flex","Box","fire","isNode","callAllEventHandlers","CloseIcon","Timer","localizedMessages","i18nEnhance","useCssVariable","contextThemeEnhance","Button","useFocusLock","ZIndexStackingContextProvider","zIndexStackingEnhance","style","_sstyled","insert","forkRef","useForkRef","getFocusableIn","setFocus","Notices","props","styles","_props$data","data","_props$tag","tag","SView","ViewInfo","ref","useRef","durationStr","duration","useMemo","parseInt","map","notice","_ref2","_notice$visible","createElement","cn","uid","initialAnimation","visible","_objectSpread","getI18nText","NoticeBubbleContainerRoot","_Component","_inherits","_super","_createSuper","_this","_classCallCheck","_len","arguments","length","args","Array","_key","call","apply","concat","_defineProperty","_assertThisInitialized","notices","warnings","_unsubscribe","info","filter","type","warning","setState","_createClass","key","value","componentDidMount","asProps","addListener","handleChange","render","_ref","_ref3","SNoticeBubble","SNoticeAriaLiveWrapper","_this$asProps","Children","disablePortal","parentZIndexStacking","_this$state","state","_assignProps","ViewWarning","i18n","locale","FocusLock","forwardRef","outerRef","focusLock","other","_objectWithoutProperties","_excluded","innerRef","_extends","_Component2","_super2","_this2","_len2","_key2","createRef","e","clearTimer","handleClose","timer","pause","resume","event","_this2$timer","paused","rect","current","getBoundingClientRect","mouseInRect","clientX","left","right","clientY","top","bottom","_this3","document","body","addEventListener","handleBodyMouseMove","noticeElement","focusableNodes","node","closeButtonRef","setTimeout","componentWillUnmount","removeEventListener","clear","_ref4","SBubble","SDismiss","SContent","SMessage","SAction","SIcon","_this$props","onMouseEnter","onMouseLeave","icon","children","actionNode","action","_excluded2","handleMouseEnter","handleMouseLeave","handleKeydown","role","undefined","Addon","color","Fragment","_ViewInfo","_super3","NoticeBubbleView","_Component3","_super4","_this4","_len3","_key3","_notice","add","remove","componentDidUpdate","update","NoticeBubbleWarningView","_NoticeBubbleView","_super5","NoticeBubbleContainer","Info","Warning","NoticeBubble","NoticeBubbleWarning"],"sources":["../../src/NoticeBubble.jsx"],"sourcesContent":["import React from 'react';\nimport Portal from '@semcore/portal';\nimport manager from './NoticeBubbleManager';\nimport { createComponent, Component, sstyled, Root } from '@semcore/core';\nimport { Animation } from '@semcore/animation';\nimport { Flex, Box } from '@semcore/flex-box';\nimport fire from '@semcore/core/lib/utils/fire';\nimport isNode from '@semcore/core/lib/utils/isNode';\nimport { callAllEventHandlers } from '@semcore/core/lib/utils/assignProps';\nimport CloseIcon from '@semcore/icon/Close/m';\nimport { Timer } from './utils';\nimport { localizedMessages } from './translations/__intergalactic-dynamic-locales';\nimport i18nEnhance from '@semcore/core/lib/utils/enhances/i18nEnhance';\nimport { useCssVariable } from '@semcore/core/lib/utils/useCssVariable';\nimport { contextThemeEnhance } from '@semcore/core/lib/utils/ThemeProvider';\nimport Button from '@semcore/button';\nimport { useFocusLock } from '@semcore/core/lib/utils/use/useFocusLock';\nimport {\n ZIndexStackingContextProvider,\n zIndexStackingEnhance,\n} from '@semcore/core/lib/utils/zIndexStacking';\n\nimport style from './style/notice-bubble.shadow.css';\nimport { forkRef, useForkRef } from '@semcore/core/lib/utils/ref';\nimport { getFocusableIn } from '@semcore/core/lib/utils/focus-lock/getFocusableIn';\nimport { setFocus } from '@semcore/core/lib/utils/use/useFocusLock';\n\nconst Notices = (props) => {\n const { styles, data = [], tag: SView = ViewInfo } = props;\n const ref = React.useRef();\n const durationStr = useCssVariable('--intergalactic-duration-popper', '200', ref);\n const duration = React.useMemo(() => parseInt(durationStr, 10), [durationStr]);\n\n return data.map((notice) => {\n return sstyled(styles)(\n <Animation\n key={notice.uid}\n initialAnimation={notice.initialAnimation}\n visible={notice.visible ?? true}\n duration={duration}\n keyframes={[styles['@enter'], styles['@exit']]}\n ref={ref}\n >\n <SView {...notice} styles={notice.styles || styles} getI18nText={props.getI18nText} />\n </Animation>,\n );\n });\n};\n\nclass NoticeBubbleContainerRoot extends Component {\n static displayName = 'NoticeBubbleContainer';\n static style = style;\n static enhance = [\n i18nEnhance(localizedMessages),\n contextThemeEnhance(),\n zIndexStackingEnhance('z-index-notice-bubble'),\n ];\n static defaultProps = {\n manager,\n i18n: localizedMessages,\n locale: 'en',\n };\n\n _unsubscribe = null;\n\n state = {\n notices: [],\n warnings: [],\n };\n\n componentDidMount() {\n this._unsubscribe = this.asProps.manager.addListener(this.handleChange);\n }\n\n componentWillUnmount = () => {\n if (this._unsubscribe) {\n this._unsubscribe();\n }\n };\n\n handleChange = (notices) => {\n const info = notices.filter((notice) => notice.type === 'info');\n const warning = notices.filter((notice) => notice.type === 'warning');\n\n this.setState({ notices: info, warnings: warning });\n };\n\n render() {\n const SNoticeBubble = Root;\n const SNoticeAriaLiveWrapper = 'div';\n const { Children, styles, disablePortal, getI18nText, ref, parentZIndexStacking } =\n this.asProps;\n const { notices, warnings } = this.state;\n\n return sstyled(styles)(\n <ZIndexStackingContextProvider designToken='z-index-notice-bubble'>\n <Portal disablePortal={disablePortal}>\n <SNoticeBubble\n render={Box}\n ref={ref}\n tag='section'\n role='region'\n aria-label={getI18nText('notification')}\n zIndex={parentZIndexStacking}\n >\n <Children />\n <Notices styles={styles} data={warnings} tag={ViewWarning} getI18nText={getI18nText} />\n <SNoticeAriaLiveWrapper aria-live='polite'>\n <Notices styles={styles} data={notices} tag={ViewInfo} getI18nText={getI18nText} />\n </SNoticeAriaLiveWrapper>\n </SNoticeBubble>\n </Portal>\n </ZIndexStackingContextProvider>,\n );\n }\n}\n\nconst FocusLock = React.forwardRef((props, outerRef) => {\n const { focusLock, ...other } = props;\n const innerRef = React.useRef();\n useFocusLock(innerRef, false, 'auto', !focusLock, true);\n const ref = useForkRef(outerRef, innerRef);\n\n return <Flex ref={ref} {...other} />;\n});\n\nclass ViewInfo extends Component {\n timer = null;\n ref = React.createRef();\n closeButtonRef = React.createRef();\n\n componentDidMount() {\n const { duration } = this.props;\n if (duration) {\n this.timer = new Timer(this.handleClose, duration);\n document.body.addEventListener('mousemove', this.handleBodyMouseMove);\n }\n\n 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) => {\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) => {\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) => {\n if (!this.timer?.paused) return;\n const rect = this.ref.current.getBoundingClientRect();\n const mouseInRect =\n event.clientX >= rect.left &&\n event.clientX <= rect.right &&\n event.clientY >= rect.top &&\n event.clientY <= rect.bottom;\n if (mouseInRect) return;\n this.timer.resume();\n };\n\n render() {\n const SBubble = FocusLock;\n const SDismiss = Button;\n const SContent = Flex;\n const SMessage = 'div';\n const SAction = 'div';\n const SIcon = Flex;\n const {\n forwardRef,\n styles,\n onMouseEnter,\n onMouseLeave,\n getI18nText,\n icon,\n children,\n action: actionNode,\n type,\n ...other\n } = this.props;\n\n return sstyled(styles)(\n <SBubble\n {...other}\n ref={forkRef(forwardRef, this.ref)}\n onMouseEnter={callAllEventHandlers(onMouseEnter, this.handleMouseEnter)}\n onMouseLeave={callAllEventHandlers(onMouseLeave, this.handleMouseLeave)}\n onKeyDown={this.handleKeydown}\n role={type === 'warning' ? 'alert' : this.props.role}\n >\n <SDismiss\n // biome-ignore lint/a11y/useValidAriaValues:\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 >\n <Button.Addon tag={CloseIcon} color='icon-primary-invert' />\n </SDismiss>\n\n {isNode(icon) ? (\n <>\n <SIcon>{icon}</SIcon>\n <SContent>\n <SMessage>{children}</SMessage>\n {isNode(actionNode) ? <SAction>{actionNode}</SAction> : null}\n </SContent>\n </>\n ) : (\n <SContent>\n <SMessage>{children}</SMessage>\n {isNode(actionNode) ? <SAction>{actionNode}</SAction> : null}\n </SContent>\n )}\n </SBubble>,\n );\n }\n}\n\nclass ViewWarning extends ViewInfo {\n static defaultProps = {\n type: 'warning',\n duration: 0,\n };\n}\n\nclass NoticeBubbleView extends Component {\n static defaultProps = {\n duration: 5000,\n type: 'info',\n manager,\n };\n\n _notice = null;\n\n componentDidMount() {\n this._notice = this.asProps.manager.add(this.asProps);\n }\n\n componentWillUnmount() {\n if (this._notice) {\n this._notice.remove();\n }\n }\n\n componentDidUpdate() {\n if (this._notice) {\n this._notice.update(this.asProps);\n }\n }\n\n render() {\n return null;\n }\n}\n\nclass NoticeBubbleWarningView extends NoticeBubbleView {\n static defaultProps = {\n duration: 5000,\n type: 'warning',\n manager,\n };\n}\n\nconst NoticeBubbleContainer = createComponent(NoticeBubbleContainerRoot, {\n Info: NoticeBubbleView,\n Warning: NoticeBubbleWarningView,\n});\n\nconst NoticeBubble = NoticeBubbleContainer.Info;\nconst NoticeBubbleWarning = NoticeBubbleContainer.Warning;\n\nexport { NoticeBubble, NoticeBubbleWarning };\n\nexport default NoticeBubbleContainer;\n"],"mappings":";;;;;;;;;;;;;AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,OAAOC,MAAM,MAAM,iBAAiB;AACpC,OAAOC,OAAO,MAAM,uBAAuB;AAC3C,SAASC,eAAe,EAAEC,SAAS,EAAEC,OAAO,EAAEC,IAAI,QAAQ,eAAe;AACzE,SAASC,SAAS,QAAQ,oBAAoB;AAC9C,SAASC,IAAI,EAAEC,GAAG,QAAQ,mBAAmB;AAC7C,OAAOC,IAAI,MAAM,8BAA8B;AAC/C,OAAOC,MAAM,MAAM,gCAAgC;AACnD,SAASC,oBAAoB,QAAQ,qCAAqC;AAC1E,OAAOC,SAAS,MAAM,uBAAuB;AAC7C,SAASC,KAAK,QAAQ,SAAS;AAC/B,SAASC,iBAAiB,QAAQ,gDAAgD;AAClF,OAAOC,WAAW,MAAM,8CAA8C;AACtE,SAASC,cAAc,QAAQ,wCAAwC;AACvE,SAASC,mBAAmB,QAAQ,uCAAuC;AAC3E,OAAOC,MAAM,MAAM,iBAAiB;AACpC,SAASC,YAAY,QAAQ,0CAA0C;AACvE,SACEC,6BAA6B,EAC7BC,qBAAqB,QAChB,wCAAwC;AAAC;AAAA,IAAAC,KAAA,+BAAAC,QAAA,CAAAC,MAAA;AAAA;AAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;AAAA;AAGhD,SAASC,OAAO,EAAEC,UAAU,QAAQ,6BAA6B;AACjE,SAASC,cAAc,QAAQ,mDAAmD;AAClF,SAASC,QAAQ,QAAQ,0CAA0C;AAEnE,IAAMC,OAAO,GAAG,SAAVA,OAAOA,CAAIC,KAAK,EAAK;EACzB,IAAQC,MAAM,GAAuCD,KAAK,CAAlDC,MAAM;I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O,CAACI,MAAM,CAAC,IAAI,CAACpG,OAAO,CAAC;MACnC;IACF;EAAC;IAAAH,GAAA;IAAAC,KAAA,EAED,SAAAK,OAAA,EAAS;MACP,OAAO,IAAI;IACb;EAAC;EAAA,OAAAuF,gBAAA;AAAA,EA3B4B5K,SAAS;AAAAoE,eAAA,CAAlCwG,gBAAgB,kBACE;EACpBtI,QAAQ,EAAE,IAAI;EACdqC,IAAI,EAAE,MAAM;EACZ7E,OAAO,EAAPA;AACF,CAAC;AAAA,IAyBGyL,uBAAuB,0BAAAC,iBAAA;EAAAlI,SAAA,CAAAiI,uBAAA,EAAAC,iBAAA;EAAA,IAAAC,OAAA,GAAAjI,YAAA,CAAA+H,uBAAA;EAAA,SAAAA,wBAAA;IAAA7H,eAAA,OAAA6H,uBAAA;IAAA,OAAAE,OAAA,CAAAvH,KAAA,OAAAN,SAAA;EAAA;EAAA,OAAAkB,YAAA,CAAAyG,uBAAA;AAAA,EAASX,gBAAgB;AAAAxG,eAAA,CAAhDmH,uBAAuB,kBACL;EACpBjJ,QAAQ,EAAE,IAAI;EACdqC,IAAI,EAAE,SAAS;EACf7E,OAAO,EAAPA;AACF,CAAC;AAGH,IAAM4L,qBAAqB,GAAG3L,eAAe,CAACqD,yBAAyB,EAAE;EACvEuI,IAAI,EAAEf,gBAAgB;EACtBgB,OAAO,EAAEL;AACX,CAAC,CAAC;AAEF,IAAMM,YAAY,GAAGH,qBAAqB,CAACC,IAAI;AAC/C,IAAMG,mBAAmB,GAAGJ,qBAAqB,CAACE,OAAO;AAEzD,SAASC,YAAY,EAAEC,mBAAmB;AAE1C,eAAeJ,qBAAqB"}
|
|
1
|
+
{"version":3,"file":"NoticeBubble.js","names":["Animation","Button","createComponent","Component","sstyled","Root","callAllEventHandlers","i18nEnhance","fire","getFocusableIn","isNode","forkRef","useForkRef","contextThemeEnhance","useFocusLock","setFocus","useCssVariable","ZIndexStackingContextProvider","zIndexStackingEnhance","Flex","Box","CloseIcon","Portal","React","manager","style","_sstyled","insert","localizedMessages","Timer","Notices","props","styles","_props$data","data","_props$tag","tag","SView","ViewInfo","ref","useRef","durationStr","duration","useMemo","Number","parseInt","map","notice","_ref2","_notice$visible","createElement","cn","uid","initialAnimation","visible","_objectSpread","getI18nText","NoticeBubbleContainerRoot","_Component","_this","_classCallCheck","_len","arguments","length","args","Array","_key","_callSuper","concat","_defineProperty","notices","warnings","_unsubscribe","info","filter","type","warning","setState","_inherits","_createClass","key","value","componentDidMount","asProps","addListener","handleChange","render","_ref","_ref3","SNoticeBubble","SNoticeAriaLiveWrapper","_this$asProps","Children","disablePortal","parentZIndexStacking","_this$state","state","_assignProps","ViewWarning","i18n","locale","FocusLock","forwardRef","outerRef","focusLock","other","_objectWithoutProperties","_excluded","innerRef","_extends","_Component2","_this2","_len2","_key2","createRef","e","clearTimer","handleClose","timer","pause","resume","event","_this2$timer","paused","rect","current","getBoundingClientRect","mouseInRect","clientX","left","right","clientY","top","bottom","_this3","document","body","addEventListener","handleBodyMouseMove","noticeElement","focusableNodes","node","closeButtonRef","setTimeout","componentWillUnmount","removeEventListener","clear","_ref4","SBubble","SDismiss","SContent","SMessage","SAction","SIcon","_this$props","onMouseEnter","onMouseLeave","icon","children","actionNode","action","_excluded2","handleMouseEnter","handleMouseLeave","handleKeydown","role","undefined","Addon","color","Fragment","_ViewInfo2","NoticeBubbleView","_Component3","_this4","_len3","_key3","_notice","add","remove","componentDidUpdate","update","NoticeBubbleWarningView","_NoticeBubbleView2","NoticeBubbleContainer","Info","Warning","NoticeBubble","NoticeBubbleWarning"],"sources":["../../src/NoticeBubble.jsx"],"sourcesContent":["import { Animation } from '@semcore/animation';\nimport Button from '@semcore/button';\nimport { createComponent, Component, sstyled, Root } from '@semcore/core';\nimport { callAllEventHandlers } from '@semcore/core/lib/utils/assignProps';\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 { forkRef, 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 { useCssVariable } from '@semcore/core/lib/utils/useCssVariable';\nimport {\n ZIndexStackingContextProvider,\n zIndexStackingEnhance,\n} from '@semcore/core/lib/utils/zIndexStacking';\nimport { Flex, Box } from '@semcore/flex-box';\nimport CloseIcon from '@semcore/icon/Close/m';\nimport Portal from '@semcore/portal';\nimport React from 'react';\n\nimport manager from './NoticeBubbleManager';\nimport style from './style/notice-bubble.shadow.css';\nimport { localizedMessages } from './translations/__intergalactic-dynamic-locales';\nimport { Timer } from './utils';\n\nconst Notices = (props) => {\n const { styles, data = [], tag: SView = ViewInfo } = props;\n const ref = React.useRef();\n const durationStr = useCssVariable('--intergalactic-duration-popper', '200', ref);\n const duration = React.useMemo(() => Number.parseInt(durationStr, 10), [durationStr]);\n\n return data.map((notice) => {\n return sstyled(styles)(\n <Animation\n key={notice.uid}\n initialAnimation={notice.initialAnimation}\n visible={notice.visible ?? true}\n duration={duration}\n keyframes={[styles['@enter'], styles['@exit']]}\n ref={ref}\n >\n <SView {...notice} styles={notice.styles || styles} getI18nText={props.getI18nText} />\n </Animation>,\n );\n });\n};\n\nclass NoticeBubbleContainerRoot extends Component {\n static displayName = 'NoticeBubbleContainer';\n static style = style;\n static enhance = [\n i18nEnhance(localizedMessages),\n contextThemeEnhance(),\n zIndexStackingEnhance('z-index-notice-bubble'),\n ];\n\n static defaultProps = {\n manager,\n i18n: localizedMessages,\n locale: 'en',\n };\n\n _unsubscribe = null;\n\n state = {\n notices: [],\n warnings: [],\n };\n\n componentDidMount() {\n this._unsubscribe = this.asProps.manager.addListener(this.handleChange);\n }\n\n componentWillUnmount = () => {\n if (this._unsubscribe) {\n this._unsubscribe();\n }\n };\n\n handleChange = (notices) => {\n const info = notices.filter((notice) => notice.type === 'info');\n const warning = notices.filter((notice) => notice.type === 'warning');\n\n this.setState({ notices: info, warnings: warning });\n };\n\n render() {\n const SNoticeBubble = Root;\n const SNoticeAriaLiveWrapper = 'div';\n const { Children, styles, disablePortal, getI18nText, ref, parentZIndexStacking } =\n this.asProps;\n const { notices, warnings } = this.state;\n\n return sstyled(styles)(\n <ZIndexStackingContextProvider designToken='z-index-notice-bubble'>\n <Portal disablePortal={disablePortal}>\n <SNoticeBubble\n render={Box}\n ref={ref}\n tag='section'\n role='region'\n aria-label={getI18nText('notification')}\n zIndex={parentZIndexStacking}\n >\n <Children />\n <Notices styles={styles} data={warnings} tag={ViewWarning} getI18nText={getI18nText} />\n <SNoticeAriaLiveWrapper aria-live='polite'>\n <Notices styles={styles} data={notices} tag={ViewInfo} getI18nText={getI18nText} />\n </SNoticeAriaLiveWrapper>\n </SNoticeBubble>\n </Portal>\n </ZIndexStackingContextProvider>,\n );\n }\n}\n\nconst FocusLock = React.forwardRef((props, outerRef) => {\n const { focusLock, ...other } = props;\n const innerRef = React.useRef();\n useFocusLock(innerRef, false, 'auto', !focusLock, true);\n const ref = useForkRef(outerRef, innerRef);\n\n return <Flex ref={ref} {...other} />;\n});\n\nclass ViewInfo extends Component {\n timer = null;\n ref = React.createRef();\n closeButtonRef = React.createRef();\n\n componentDidMount() {\n const { duration } = this.props;\n if (duration) {\n this.timer = new Timer(this.handleClose, duration);\n document.body.addEventListener('mousemove', this.handleBodyMouseMove);\n }\n\n 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) => {\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) => {\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) => {\n if (!this.timer?.paused) return;\n const rect = this.ref.current.getBoundingClientRect();\n const mouseInRect =\n event.clientX >= rect.left &&\n event.clientX <= rect.right &&\n event.clientY >= rect.top &&\n event.clientY <= rect.bottom;\n if (mouseInRect) return;\n this.timer.resume();\n };\n\n render() {\n const SBubble = FocusLock;\n const SDismiss = Button;\n const SContent = Flex;\n const SMessage = 'div';\n const SAction = 'div';\n const SIcon = Flex;\n const {\n forwardRef,\n styles,\n onMouseEnter,\n onMouseLeave,\n getI18nText,\n icon,\n children,\n action: actionNode,\n type,\n ...other\n } = this.props;\n\n return sstyled(styles)(\n <SBubble\n {...other}\n ref={forkRef(forwardRef, this.ref)}\n onMouseEnter={callAllEventHandlers(onMouseEnter, this.handleMouseEnter)}\n onMouseLeave={callAllEventHandlers(onMouseLeave, this.handleMouseLeave)}\n onKeyDown={this.handleKeydown}\n role={type === 'warning' ? 'alert' : this.props.role}\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 >\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(actionNode) ? <SAction>{actionNode}</SAction> : null}\n </SContent>\n </>\n )\n : (\n <SContent>\n <SMessage>{children}</SMessage>\n {isNode(actionNode) ? <SAction>{actionNode}</SAction> : null}\n </SContent>\n )}\n </SBubble>,\n );\n }\n}\n\nclass ViewWarning extends ViewInfo {\n static defaultProps = {\n type: 'warning',\n duration: 0,\n };\n}\n\nclass NoticeBubbleView extends Component {\n static defaultProps = {\n duration: 5000,\n type: 'info',\n manager,\n };\n\n _notice = null;\n\n componentDidMount() {\n this._notice = this.asProps.manager.add(this.asProps);\n }\n\n componentWillUnmount() {\n if (this._notice) {\n this._notice.remove();\n }\n }\n\n componentDidUpdate() {\n if (this._notice) {\n this._notice.update(this.asProps);\n }\n }\n\n render() {\n return null;\n }\n}\n\nclass NoticeBubbleWarningView extends NoticeBubbleView {\n static defaultProps = {\n duration: 5000,\n type: 'warning',\n manager,\n };\n}\n\nconst NoticeBubbleContainer = createComponent(NoticeBubbleContainerRoot, {\n Info: NoticeBubbleView,\n Warning: NoticeBubbleWarningView,\n});\n\nconst NoticeBubble = NoticeBubbleContainer.Info;\nconst NoticeBubbleWarning = NoticeBubbleContainer.Warning;\n\nexport { NoticeBubble, NoticeBubbleWarning };\n\nexport default NoticeBubbleContainer;\n"],"mappings":";;;;;;;;;;;;;;;AAAA,SAASA,SAAS,QAAQ,oBAAoB;AAC9C,OAAOC,MAAM,MAAM,iBAAiB;AACpC,SAASC,eAAe,EAAEC,SAAS,EAAEC,OAAO,EAAEC,IAAI,QAAQ,eAAe;AACzE,SAASC,oBAAoB,QAAQ,qCAAqC;AAC1E,OAAOC,WAAW,MAAM,8CAA8C;AACtE,OAAOC,IAAI,MAAM,8BAA8B;AAC/C,SAASC,cAAc,QAAQ,mDAAmD;AAClF,OAAOC,MAAM,MAAM,gCAAgC;AACnD,SAASC,OAAO,EAAEC,UAAU,QAAQ,6BAA6B;AACjE,SAASC,mBAAmB,QAAQ,uCAAuC;AAC3E,SAASC,YAAY,EAAEC,QAAQ,QAAQ,0CAA0C;AACjF,SAASC,cAAc,QAAQ,wCAAwC;AACvE,SACEC,6BAA6B,EAC7BC,qBAAqB,QAChB,wCAAwC;AAC/C,SAASC,IAAI,EAAEC,GAAG,QAAQ,mBAAmB;AAC7C,OAAOC,SAAS,M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O,CAACE,MAAM,CAAC,CAAC;MACvB;IACF;EAAC;IAAAlG,GAAA;IAAAC,KAAA,EAED,SAAAkG,kBAAkBA,CAAA,EAAG;MACnB,IAAI,IAAI,CAACH,OAAO,EAAE;QAChB,IAAI,CAACA,OAAO,CAACI,MAAM,CAAC,IAAI,CAACjG,OAAO,CAAC;MACnC;IACF;EAAC;IAAAH,GAAA;IAAAC,KAAA,EAED,SAAAK,MAAMA,CAAA,EAAG;MACP,OAAO,IAAI;IACb;EAAC;AAAA,EA3B4BnF,SAAS;AAAAkE,eAAA,CAAlCsG,gBAAgB,kBACE;EACpBjI,QAAQ,EAAE,IAAI;EACdiC,IAAI,EAAE,MAAM;EACZnD,OAAO,EAAPA;AACF,CAAC;AAAA,IAyBG6J,uBAAuB,0BAAAC,kBAAA;EAAA,SAAAD,wBAAA;IAAAzH,eAAA,OAAAyH,uBAAA;IAAA,OAAAlH,UAAA,OAAAkH,uBAAA,EAAAvH,SAAA;EAAA;EAAAgB,SAAA,CAAAuG,uBAAA,EAAAC,kBAAA;EAAA,OAAAvG,YAAA,CAAAsG,uBAAA;AAAA,EAASV,gBAAgB;AAAAtG,eAAA,CAAhDgH,uBAAuB,kBACL;EACpB3I,QAAQ,EAAE,IAAI;EACdiC,IAAI,EAAE,SAAS;EACfnD,OAAO,EAAPA;AACF,CAAC;AAGH,IAAM+J,qBAAqB,GAAGrL,eAAe,CAACuD,yBAAyB,EAAE;EACvE+H,IAAI,EAAEb,gBAAgB;EACtBc,OAAO,EAAEJ;AACX,CAAC,CAAC;AAEF,IAAMK,YAAY,GAAGH,qBAAqB,CAACC,IAAI;AAC/C,IAAMG,mBAAmB,GAAGJ,qBAAqB,CAACE,OAAO;AAEzD,SAASC,YAAY,EAAEC,mBAAmB;AAE1C,eAAeJ,qBAAqB","ignoreList":[]}
|
|
@@ -2,8 +2,8 @@ import _objectSpread from "@babel/runtime/helpers/objectSpread2";
|
|
|
2
2
|
import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
|
|
3
3
|
import _createClass from "@babel/runtime/helpers/createClass";
|
|
4
4
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
5
|
-
import EventEmitter from '@semcore/core/lib/utils/eventEmitter';
|
|
6
5
|
import { callAllEventHandlers } from '@semcore/core/lib/utils/assignProps';
|
|
6
|
+
import EventEmitter from '@semcore/core/lib/utils/eventEmitter';
|
|
7
7
|
import { setFocus } from '@semcore/core/lib/utils/use/useFocusLock';
|
|
8
8
|
import React from 'react';
|
|
9
9
|
var EVENT_NAME = 'CHANGE';
|
|
@@ -16,7 +16,7 @@ var NoticeBubbleManager = /*#__PURE__*/function () {
|
|
|
16
16
|
_defineProperty(this, "replaceTimer", 0);
|
|
17
17
|
this.emitter = new EventEmitter();
|
|
18
18
|
}
|
|
19
|
-
_createClass(NoticeBubbleManager, [{
|
|
19
|
+
return _createClass(NoticeBubbleManager, [{
|
|
20
20
|
key: "addListener",
|
|
21
21
|
value: function addListener(fn) {
|
|
22
22
|
return this.emitter.subscribe(EVENT_NAME, fn);
|
|
@@ -113,7 +113,6 @@ var NoticeBubbleManager = /*#__PURE__*/function () {
|
|
|
113
113
|
return false;
|
|
114
114
|
}
|
|
115
115
|
}]);
|
|
116
|
-
return NoticeBubbleManager;
|
|
117
116
|
}();
|
|
118
117
|
var noticeBubbleDefaultManager = new NoticeBubbleManager();
|
|
119
118
|
export { NoticeBubbleManager };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NoticeBubbleManager.js","names":["
|
|
1
|
+
{"version":3,"file":"NoticeBubbleManager.js","names":["callAllEventHandlers","EventEmitter","setFocus","React","EVENT_NAME","NoticeBubbleManager","_classCallCheck","_defineProperty","emitter","_createClass","key","value","addListener","fn","subscribe","createItem","props","manager","_objectSpread","type","onClose","remove","uid","emit","items","add","counter","ref","createRef","focus","setTimeout","current","item","visible","initialAnimation","undefined","forwardRef","push","update","bind","index","findIndex","replaceLast","_this","replaceTimer","clearTimeout","length","_this2","find","filter","noticeBubbleDefaultManager"],"sources":["../../src/NoticeBubbleManager.js"],"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 React from 'react';\n\nconst EVENT_NAME = 'CHANGE';\n\nclass NoticeBubbleManager {\n items = [];\n emitter = null;\n counter = 0;\n\n replaceTimer = 0;\n\n constructor() {\n this.emitter = new EventEmitter();\n }\n\n addListener(fn) {\n return this.emitter.subscribe(EVENT_NAME, fn);\n }\n\n createItem(props) {\n const manager = this;\n\n return {\n type: 'info',\n ...props,\n onClose: callAllEventHandlers(props.onClose, () => {\n manager.remove(props.uid);\n }),\n };\n }\n\n emit() {\n this.emitter.emit(EVENT_NAME, this.items);\n }\n\n add(props) {\n const uid = this.counter++;\n const ref = React.createRef();\n const focus = () => setTimeout(() => setFocus(ref.current), 0);\n const item = this.createItem({\n uid,\n visible: props.initialAnimation ? true : undefined,\n forwardRef: ref,\n ...props,\n });\n this.items.push(item);\n this.emit();\n return {\n uid,\n update: this.update.bind(this, uid),\n remove: this.remove.bind(this, uid),\n ref,\n // todo Brauer Ilia: remove this property, because we added logic about autofocus in Notice\n focus,\n };\n }\n\n update(uid, props) {\n const index = this.items.findIndex((item) => item.uid === uid);\n if (index !== -1) {\n this.items[index] = this.createItem({\n ...this.items[index],\n ...props,\n });\n this.emit();\n return true;\n }\n return false;\n }\n\n replaceLast(props) {\n if (this.replaceTimer) {\n clearTimeout(this.replaceTimer);\n }\n\n const item = this.items[this.items.length - 1];\n\n if (item?.visible) {\n this.remove(this.counter - 1);\n }\n\n this.replaceTimer = setTimeout(() => {\n this.add(props);\n }, 300);\n }\n\n remove(uid) {\n const item = this.items.find((item) => item.uid === uid);\n if (item) {\n item.visible = false;\n setTimeout(() => {\n this.items = this.items.filter((item) => item.uid !== uid);\n this.emit();\n }, 1000);\n this.emit();\n return true;\n }\n return false;\n }\n}\n\nconst noticeBubbleDefaultManager = new NoticeBubbleManager();\n\nexport { NoticeBubbleManager };\nexport default noticeBubbleDefaultManager;\n"],"mappings":";;;;AAAA,SAASA,oBAAoB,QAAQ,qCAAqC;AAC1E,OAAOC,YAAY,MAAM,sCAAsC;AAC/D,SAASC,QAAQ,QAAQ,0CAA0C;AACnE,OAAOC,KAAK,MAAM,OAAO;AAEzB,IAAMC,UAAU,GAAG,QAAQ;AAAC,IAEtBC,mBAAmB;EAOvB,SAAAA,oBAAA,EAAc;IAAAC,eAAA,OAAAD,mBAAA;IAAAE,eAAA,gBANN,EAAE;IAAAA,eAAA,kBACA,IAAI;IAAAA,eAAA,kBACJ,CAAC;IAAAA,eAAA,uBAEI,CAAC;IAGd,IAAI,CAACC,OAAO,GAAG,IAAIP,YAAY,CAAC,CAAC;EACnC;EAAC,OAAAQ,YAAA,CAAAJ,mBAAA;IAAAK,GAAA;IAAAC,KAAA,EAED,SAAAC,WAAWA,CAACC,EAAE,EAAE;MACd,OAAO,IAAI,CAACL,OAAO,CAACM,SAAS,CAACV,UAAU,EAAES,EAAE,CAAC;IAC/C;EAAC;IAAAH,GAAA;IAAAC,KAAA,EAED,SAAAI,UAAUA,CAACC,KAAK,EAAE;MAChB,IAAMC,OAAO,GAAG,IAAI;MAEpB,OAAAC,aAAA,CAAAA,aAAA;QACEC,IAAI,EAAE;MAAM,GACTH,KAAK;QACRI,OAAO,EAAEpB,oBAAoB,CAACgB,KAAK,CAACI,OAAO,EAAE,YAAM;UACjDH,OAAO,CAACI,MAAM,CAACL,KAAK,CAACM,GAAG,CAAC;QAC3B,CAAC;MAAC;IAEN;EAAC;IAAAZ,GAAA;IAAAC,KAAA,EAED,SAAAY,IAAIA,CAAA,EAAG;MACL,IAAI,CAACf,OAAO,CAACe,IAAI,CAACnB,UAAU,EAAE,IAAI,CAACoB,KAAK,CAAC;IAC3C;EAAC;IAAAd,GAAA;IAAAC,KAAA,EAED,SAAAc,GAAGA,CAACT,KAAK,EAAE;MACT,IA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