@semcore/notice-bubble 4.7.8 → 4.7.9
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 +2 -2
- package/lib/cjs/NoticeBubble.js +32 -109
- package/lib/cjs/NoticeBubble.js.map +1 -1
- package/lib/cjs/NoticeBubbleManager.js +0 -18
- package/lib/cjs/NoticeBubbleManager.js.map +1 -1
- package/lib/cjs/index.d.js +0 -7
- package/lib/cjs/index.d.js.map +1 -1
- package/lib/cjs/index.js +0 -5
- package/lib/cjs/index.js.map +1 -1
- package/lib/cjs/translations/__intergalactic-dynamic-locales.js +0 -13
- package/lib/cjs/translations/__intergalactic-dynamic-locales.js.map +1 -1
- package/lib/cjs/utils.js +0 -6
- package/lib/cjs/utils.js.map +1 -1
- package/lib/es6/NoticeBubble.js +32 -103
- package/lib/es6/NoticeBubble.js.map +1 -1
- package/lib/es6/NoticeBubbleManager.js +0 -15
- package/lib/es6/NoticeBubbleManager.js.map +1 -1
- package/lib/es6/index.d.js +0 -4
- package/lib/es6/index.d.js.map +1 -1
- package/lib/es6/index.js.map +1 -1
- package/lib/es6/translations/__intergalactic-dynamic-locales.js.map +1 -1
- package/lib/es6/utils.js +0 -5
- package/lib/es6/utils.js.map +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,11 +2,11 @@
|
|
|
2
2
|
|
|
3
3
|
CHANGELOG.md standards are inspired by [keepachangelog.com](https://keepachangelog.com/en/1.0.0/).
|
|
4
4
|
|
|
5
|
-
## [4.7.
|
|
5
|
+
## [4.7.9] - 2023-04-03
|
|
6
6
|
|
|
7
7
|
### Changed
|
|
8
8
|
|
|
9
|
-
- Version patch update due to children dependencies update (`@semcore/
|
|
9
|
+
- Version patch update due to children dependencies update (`@semcore/animation` [1.10.0 ~> 1.10.1]).
|
|
10
10
|
|
|
11
11
|
## [4.7.6] - 2023-03-24
|
|
12
12
|
|
package/lib/cjs/NoticeBubble.js
CHANGED
|
@@ -1,102 +1,61 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
|
|
5
4
|
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard");
|
|
6
|
-
|
|
7
5
|
Object.defineProperty(exports, "__esModule", {
|
|
8
6
|
value: true
|
|
9
7
|
});
|
|
10
8
|
exports["default"] = exports.NoticeBubbleWarning = exports.NoticeBubble = void 0;
|
|
11
|
-
|
|
12
9
|
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
|
13
|
-
|
|
14
10
|
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
15
|
-
|
|
16
11
|
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
17
|
-
|
|
18
12
|
var _assertThisInitialized2 = _interopRequireDefault(require("@babel/runtime/helpers/assertThisInitialized"));
|
|
19
|
-
|
|
20
13
|
var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
|
|
21
|
-
|
|
22
14
|
var _createSuper2 = _interopRequireDefault(require("@babel/runtime/helpers/createSuper"));
|
|
23
|
-
|
|
24
15
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
25
|
-
|
|
26
16
|
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
|
|
27
|
-
|
|
28
17
|
var _core = _interopRequireWildcard(require("@semcore/core"));
|
|
29
|
-
|
|
30
18
|
var _react = _interopRequireDefault(require("react"));
|
|
31
|
-
|
|
32
19
|
var _portal = _interopRequireDefault(require("@semcore/portal"));
|
|
33
|
-
|
|
34
20
|
var _NoticeBubbleManager = _interopRequireDefault(require("./NoticeBubbleManager"));
|
|
35
|
-
|
|
36
21
|
var _animation = require("@semcore/animation");
|
|
37
|
-
|
|
38
22
|
var _flexBox = require("@semcore/flex-box");
|
|
39
|
-
|
|
40
23
|
var _fire = _interopRequireDefault(require("@semcore/utils/lib/fire"));
|
|
41
|
-
|
|
42
24
|
var _isNode = _interopRequireDefault(require("@semcore/utils/lib/isNode"));
|
|
43
|
-
|
|
44
25
|
var _assignProps2 = require("@semcore/utils/lib/assignProps");
|
|
45
|
-
|
|
46
26
|
var _m = _interopRequireDefault(require("@semcore/icon/Close/m"));
|
|
47
|
-
|
|
48
27
|
var _utils = require("./utils");
|
|
49
|
-
|
|
50
28
|
var _intergalacticDynamicLocales = require("./translations/__intergalactic-dynamic-locales");
|
|
51
|
-
|
|
52
29
|
var _i18nEnhance = _interopRequireDefault(require("@semcore/utils/lib/enhances/i18nEnhance"));
|
|
53
|
-
|
|
54
30
|
var _useCssVariable = require("@semcore/utils/lib/useCssVariable");
|
|
55
|
-
|
|
56
31
|
var _ThemeProvider = require("@semcore/utils/lib/ThemeProvider");
|
|
57
|
-
|
|
58
32
|
var _excluded = ["forwardRef", "styles", "onMouseEnter", "onMouseLeave", "getI18nText", "icon", "children", "action"];
|
|
59
|
-
|
|
60
33
|
/*__reshadow-styles__:"./style/notice-bubble.shadow.css"*/
|
|
61
|
-
var style = (
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
"
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
,
|
|
70
|
-
"
|
|
71
|
-
"
|
|
72
|
-
"_type_info": "_type_info_d3yww_gg_",
|
|
73
|
-
"_type_warning": "_type_warning_d3yww_gg_",
|
|
74
|
-
"__SContent": "___SContent_d3yww_gg_",
|
|
75
|
-
"__SMessage": "___SMessage_d3yww_gg_",
|
|
76
|
-
"__SDismiss": "___SDismiss_d3yww_gg_",
|
|
77
|
-
"__SNoticeBubble": "___SNoticeBubble_d3yww_gg_",
|
|
78
|
-
"@enter": "enter_d3yww",
|
|
79
|
-
"@exit": "exit_d3yww"
|
|
34
|
+
var style = ( /*__reshadow_css_start__*/_core.sstyled.insert( /*__inner_css_start__*/"@keyframes enter_1wr1e{0%{transform:translate(100%,0);max-height:0;overflow:hidden}to{transform:translate(0,0);max-height:100vh;overflow:hidden}}@keyframes exit_1wr1e{0%{max-height:100vh;overflow:hidden;opacity:1}to{max-height:0;overflow:hidden;opacity:0}}.___SBubble_1wr1e_gg_,.___SContent_1wr1e_gg_,.___SView_1wr1e_gg_{grid-gap:var(--intergalactic-spacing-2x, 8px);gap:var(--intergalactic-spacing-2x, 8px)}.___SBubble_1wr1e_gg_,.___SView_1wr1e_gg_{position:relative;margin-bottom:var(--intergalactic-spacing-3x, 12px);padding:var(--intergalactic-spacing-3x, 12px) calc(var(--intergalactic-spacing-6x, 24px) + var(--intergalactic-spacing-1x, 4px)) var(--intergalactic-spacing-3x, 12px) var(--intergalactic-spacing-3x, 12px);width:100%;border-radius:var(--intergalactic-popper-rounded, 6px);overflow:hidden;box-sizing:border-box;color:var(--intergalactic-text-primary-invert, #ffffff)}.___SBubble_1wr1e_gg_._type_info_1wr1e_gg_,.___SView_1wr1e_gg_._type_info_1wr1e_gg_{background:var(--intergalactic-bg-primary-invert, #191b23)}.___SBubble_1wr1e_gg_._type_warning_1wr1e_gg_,.___SView_1wr1e_gg_._type_warning_1wr1e_gg_{background:var(--intergalactic-bg-primary-critical, #ff4953)}.___SContent_1wr1e_gg_{flex-direction:column;flex:1}.___SMessage_1wr1e_gg_{font-size:var(--intergalactic-fs-200, 14px);line-height:var(--intergalactic-lh-100, 133%)}.___SDismiss_1wr1e_gg_{cursor:pointer;position:absolute;right:0;top:0;padding:var(--intergalactic-spacing-2x, 8px);color:var(--intergalactic-text-primary-invert, #ffffff)}@media (hover:hover){.___SDismiss_1wr1e_gg_:hover{color:var(--intergalactic-control-primary-invert-active, #e0e1e9)}}.___SNoticeBubble_1wr1e_gg_{width:300px;position:fixed;z-index:var(--intergalactic-z-index-notice-bubble, 999);right:var(--intergalactic-spacing-3x, 12px);top:var(--intergalactic-spacing-3x, 12px)}@media (max-width:767px){.___SNoticeBubble_1wr1e_gg_{width:calc(100% - var(--intergalactic-spacing-6x, 24px))}}.___SMessage_1wr1e_gg_ a{color:var(--intergalactic-text-link-invert, #8ecdff)}" /*__inner_css_end__*/, "1wr1e_gg_") /*__reshadow_css_end__*/, {
|
|
35
|
+
"__SBubble": "___SBubble_1wr1e_gg_",
|
|
36
|
+
"__SView": "___SView_1wr1e_gg_",
|
|
37
|
+
"_type_info": "_type_info_1wr1e_gg_",
|
|
38
|
+
"_type_warning": "_type_warning_1wr1e_gg_",
|
|
39
|
+
"__SContent": "___SContent_1wr1e_gg_",
|
|
40
|
+
"__SMessage": "___SMessage_1wr1e_gg_",
|
|
41
|
+
"__SDismiss": "___SDismiss_1wr1e_gg_",
|
|
42
|
+
"__SNoticeBubble": "___SNoticeBubble_1wr1e_gg_",
|
|
43
|
+
"@enter": "enter_1wr1e",
|
|
44
|
+
"@exit": "exit_1wr1e"
|
|
80
45
|
});
|
|
81
|
-
|
|
82
46
|
var Notices = function Notices(props) {
|
|
83
47
|
var styles = props.styles,
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
48
|
+
_props$data = props.data,
|
|
49
|
+
data = _props$data === void 0 ? [] : _props$data,
|
|
50
|
+
_props$tag = props.tag,
|
|
51
|
+
SView = _props$tag === void 0 ? ViewInfo : _props$tag;
|
|
89
52
|
var ref = _react["default"].useRef();
|
|
90
|
-
|
|
91
53
|
var durationStr = (0, _useCssVariable.useCssVariable)('--intergalactic-duration-popper', '200', ref);
|
|
92
|
-
|
|
93
54
|
var duration = _react["default"].useMemo(function () {
|
|
94
55
|
return parseInt(durationStr, 10);
|
|
95
56
|
}, [durationStr]);
|
|
96
|
-
|
|
97
57
|
return data.map(function (notice) {
|
|
98
58
|
var _ref2, _notice$visible;
|
|
99
|
-
|
|
100
59
|
return _ref2 = (0, _core.sstyled)(styles), /*#__PURE__*/_react["default"].createElement(_animation.Animation, _ref2.cn("Animation", {
|
|
101
60
|
"key": notice.uid,
|
|
102
61
|
"initialAnimation": notice.initialAnimation,
|
|
@@ -110,15 +69,11 @@ var Notices = function Notices(props) {
|
|
|
110
69
|
}))));
|
|
111
70
|
});
|
|
112
71
|
};
|
|
113
|
-
|
|
114
72
|
var NoticeBubbleContainerRoot = /*#__PURE__*/function (_Component) {
|
|
115
73
|
(0, _inherits2["default"])(NoticeBubbleContainerRoot, _Component);
|
|
116
|
-
|
|
117
74
|
var _super = (0, _createSuper2["default"])(NoticeBubbleContainerRoot);
|
|
118
|
-
|
|
119
75
|
function NoticeBubbleContainerRoot(props) {
|
|
120
76
|
var _this;
|
|
121
|
-
|
|
122
77
|
(0, _classCallCheck2["default"])(this, NoticeBubbleContainerRoot);
|
|
123
78
|
_this = _super.call(this, props);
|
|
124
79
|
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "_unsubscribe", null);
|
|
@@ -138,7 +93,6 @@ var NoticeBubbleContainerRoot = /*#__PURE__*/function (_Component) {
|
|
|
138
93
|
var warning = notices.filter(function (notice) {
|
|
139
94
|
return notice.type === 'warning';
|
|
140
95
|
});
|
|
141
|
-
|
|
142
96
|
_this.setState({
|
|
143
97
|
notices: info,
|
|
144
98
|
warnings: warning
|
|
@@ -148,23 +102,21 @@ var NoticeBubbleContainerRoot = /*#__PURE__*/function (_Component) {
|
|
|
148
102
|
_this._unsubscribe = props.manager.addListener(_this.handleChange);
|
|
149
103
|
return _this;
|
|
150
104
|
}
|
|
151
|
-
|
|
152
105
|
(0, _createClass2["default"])(NoticeBubbleContainerRoot, [{
|
|
153
106
|
key: "render",
|
|
154
107
|
value: function render() {
|
|
155
108
|
var _ref = this.asProps,
|
|
156
|
-
|
|
157
|
-
|
|
109
|
+
_ref3;
|
|
158
110
|
var SNoticeBubble = _flexBox.Box;
|
|
159
111
|
var _this$asProps = this.asProps,
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
112
|
+
Children = _this$asProps.Children,
|
|
113
|
+
styles = _this$asProps.styles,
|
|
114
|
+
disablePortal = _this$asProps.disablePortal,
|
|
115
|
+
getI18nText = _this$asProps.getI18nText,
|
|
116
|
+
ref = _this$asProps.ref;
|
|
165
117
|
var _this$state = this.state,
|
|
166
|
-
|
|
167
|
-
|
|
118
|
+
notices = _this$state.notices,
|
|
119
|
+
warnings = _this$state.warnings;
|
|
168
120
|
return _ref3 = (0, _core.sstyled)(styles), /*#__PURE__*/_react["default"].createElement(_portal["default"], _ref3.cn("Portal", {
|
|
169
121
|
"disablePortal": disablePortal
|
|
170
122
|
}), /*#__PURE__*/_react["default"].createElement(SNoticeBubble, _ref3.cn("SNoticeBubble", (0, _objectSpread2["default"])({}, (0, _core.assignProps)({
|
|
@@ -186,7 +138,6 @@ var NoticeBubbleContainerRoot = /*#__PURE__*/function (_Component) {
|
|
|
186
138
|
}]);
|
|
187
139
|
return NoticeBubbleContainerRoot;
|
|
188
140
|
}(_core.Component);
|
|
189
|
-
|
|
190
141
|
(0, _defineProperty2["default"])(NoticeBubbleContainerRoot, "displayName", 'NoticeBubbleContainer');
|
|
191
142
|
(0, _defineProperty2["default"])(NoticeBubbleContainerRoot, "style", style);
|
|
192
143
|
(0, _defineProperty2["default"])(NoticeBubbleContainerRoot, "enhance", [(0, _i18nEnhance["default"])(_intergalacticDynamicLocales.localizedMessages), (0, _ThemeProvider.contextThemeEnhance)()]);
|
|
@@ -195,27 +146,20 @@ var NoticeBubbleContainerRoot = /*#__PURE__*/function (_Component) {
|
|
|
195
146
|
i18n: _intergalacticDynamicLocales.localizedMessages,
|
|
196
147
|
locale: 'en'
|
|
197
148
|
});
|
|
198
|
-
|
|
199
149
|
var ViewInfo = /*#__PURE__*/function (_Component2) {
|
|
200
150
|
(0, _inherits2["default"])(ViewInfo, _Component2);
|
|
201
|
-
|
|
202
151
|
var _super2 = (0, _createSuper2["default"])(ViewInfo);
|
|
203
|
-
|
|
204
152
|
function ViewInfo() {
|
|
205
153
|
var _this2;
|
|
206
|
-
|
|
207
154
|
(0, _classCallCheck2["default"])(this, ViewInfo);
|
|
208
|
-
|
|
209
155
|
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
210
156
|
args[_key] = arguments[_key];
|
|
211
157
|
}
|
|
212
|
-
|
|
213
158
|
_this2 = _super2.call.apply(_super2, [this].concat(args));
|
|
214
159
|
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this2), "timer", null);
|
|
215
160
|
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this2), "handlerClose", function (e) {
|
|
216
161
|
// because call not only click
|
|
217
162
|
(0, _fire["default"])((0, _assertThisInitialized2["default"])(_this2), 'onClose', e);
|
|
218
|
-
|
|
219
163
|
_this2.clearTimer();
|
|
220
164
|
});
|
|
221
165
|
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this2), "handlerMouseEnter", function () {
|
|
@@ -230,12 +174,10 @@ var ViewInfo = /*#__PURE__*/function (_Component2) {
|
|
|
230
174
|
});
|
|
231
175
|
return _this2;
|
|
232
176
|
}
|
|
233
|
-
|
|
234
177
|
(0, _createClass2["default"])(ViewInfo, [{
|
|
235
178
|
key: "componentDidMount",
|
|
236
179
|
value: function componentDidMount() {
|
|
237
180
|
var duration = this.props.duration;
|
|
238
|
-
|
|
239
181
|
if (duration) {
|
|
240
182
|
this.timer = new _utils.Timer(this.handlerClose, duration);
|
|
241
183
|
}
|
|
@@ -257,22 +199,21 @@ var ViewInfo = /*#__PURE__*/function (_Component2) {
|
|
|
257
199
|
key: "render",
|
|
258
200
|
value: function render() {
|
|
259
201
|
var _ref4;
|
|
260
|
-
|
|
261
202
|
var SBubble = _flexBox.Flex;
|
|
262
203
|
var SDismiss = 'div';
|
|
263
204
|
var SContent = _flexBox.Flex;
|
|
264
205
|
var SMessage = 'div';
|
|
265
206
|
var SAction = 'div';
|
|
266
207
|
var _this$props = this.props,
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
208
|
+
forwardRef = _this$props.forwardRef,
|
|
209
|
+
styles = _this$props.styles,
|
|
210
|
+
onMouseEnter = _this$props.onMouseEnter,
|
|
211
|
+
onMouseLeave = _this$props.onMouseLeave,
|
|
212
|
+
getI18nText = _this$props.getI18nText,
|
|
213
|
+
icon = _this$props.icon,
|
|
214
|
+
children = _this$props.children,
|
|
215
|
+
actionNode = _this$props.action,
|
|
216
|
+
other = (0, _objectWithoutProperties2["default"])(_this$props, _excluded);
|
|
276
217
|
return _ref4 = (0, _core.sstyled)(styles), /*#__PURE__*/_react["default"].createElement(SBubble, _ref4.cn("SBubble", (0, _objectSpread2["default"])((0, _objectSpread2["default"])({
|
|
277
218
|
"role": "alert"
|
|
278
219
|
}, other), {}, {
|
|
@@ -288,44 +229,32 @@ var ViewInfo = /*#__PURE__*/function (_Component2) {
|
|
|
288
229
|
}]);
|
|
289
230
|
return ViewInfo;
|
|
290
231
|
}(_core.Component);
|
|
291
|
-
|
|
292
232
|
var ViewWarning = /*#__PURE__*/function (_ViewInfo) {
|
|
293
233
|
(0, _inherits2["default"])(ViewWarning, _ViewInfo);
|
|
294
|
-
|
|
295
234
|
var _super3 = (0, _createSuper2["default"])(ViewWarning);
|
|
296
|
-
|
|
297
235
|
function ViewWarning() {
|
|
298
236
|
(0, _classCallCheck2["default"])(this, ViewWarning);
|
|
299
237
|
return _super3.apply(this, arguments);
|
|
300
238
|
}
|
|
301
|
-
|
|
302
239
|
return (0, _createClass2["default"])(ViewWarning);
|
|
303
240
|
}(ViewInfo);
|
|
304
|
-
|
|
305
241
|
(0, _defineProperty2["default"])(ViewWarning, "defaultProps", {
|
|
306
242
|
type: 'warning',
|
|
307
243
|
duration: 0
|
|
308
244
|
});
|
|
309
|
-
|
|
310
245
|
var NoticeBubbleView = /*#__PURE__*/function (_Component3) {
|
|
311
246
|
(0, _inherits2["default"])(NoticeBubbleView, _Component3);
|
|
312
|
-
|
|
313
247
|
var _super4 = (0, _createSuper2["default"])(NoticeBubbleView);
|
|
314
|
-
|
|
315
248
|
function NoticeBubbleView() {
|
|
316
249
|
var _this3;
|
|
317
|
-
|
|
318
250
|
(0, _classCallCheck2["default"])(this, NoticeBubbleView);
|
|
319
|
-
|
|
320
251
|
for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
|
|
321
252
|
args[_key2] = arguments[_key2];
|
|
322
253
|
}
|
|
323
|
-
|
|
324
254
|
_this3 = _super4.call.apply(_super4, [this].concat(args));
|
|
325
255
|
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this3), "_notice", null);
|
|
326
256
|
return _this3;
|
|
327
257
|
}
|
|
328
|
-
|
|
329
258
|
(0, _createClass2["default"])(NoticeBubbleView, [{
|
|
330
259
|
key: "componentDidMount",
|
|
331
260
|
value: function componentDidMount() {
|
|
@@ -353,26 +282,20 @@ var NoticeBubbleView = /*#__PURE__*/function (_Component3) {
|
|
|
353
282
|
}]);
|
|
354
283
|
return NoticeBubbleView;
|
|
355
284
|
}(_core.Component);
|
|
356
|
-
|
|
357
285
|
(0, _defineProperty2["default"])(NoticeBubbleView, "defaultProps", {
|
|
358
286
|
duration: 5000,
|
|
359
287
|
type: 'info',
|
|
360
288
|
manager: _NoticeBubbleManager["default"]
|
|
361
289
|
});
|
|
362
|
-
|
|
363
290
|
var NoticeBubbleWarningView = /*#__PURE__*/function (_NoticeBubbleView) {
|
|
364
291
|
(0, _inherits2["default"])(NoticeBubbleWarningView, _NoticeBubbleView);
|
|
365
|
-
|
|
366
292
|
var _super5 = (0, _createSuper2["default"])(NoticeBubbleWarningView);
|
|
367
|
-
|
|
368
293
|
function NoticeBubbleWarningView() {
|
|
369
294
|
(0, _classCallCheck2["default"])(this, NoticeBubbleWarningView);
|
|
370
295
|
return _super5.apply(this, arguments);
|
|
371
296
|
}
|
|
372
|
-
|
|
373
297
|
return (0, _createClass2["default"])(NoticeBubbleWarningView);
|
|
374
298
|
}(NoticeBubbleView);
|
|
375
|
-
|
|
376
299
|
(0, _defineProperty2["default"])(NoticeBubbleWarningView, "defaultProps", {
|
|
377
300
|
duration: 5000,
|
|
378
301
|
type: 'warning',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NoticeBubble.js","names":["Notices","props","styles","data","tag","SView","ViewInfo","ref","React","useRef","durationStr","useCssVariable","duration","useMemo","parseInt","map","notice","sstyled","uid","initialAnimation","visible","getI18nText","NoticeBubbleContainerRoot","notices","warnings","_unsubscribe","info","filter","type","warning","setState","manager","counter","addListener","handleChange","SNoticeBubble","Box","asProps","Children","disablePortal","state","ViewWarning","Component","style","i18nEnhance","localizedMessages","contextThemeEnhance","i18n","locale","e","fire","clearTimer","timer","pause","resume","Timer","handlerClose","clear","SBubble","Flex","SDismiss","SContent","SMessage","SAction","forwardRef","onMouseEnter","onMouseLeave","icon","children","actionNode","action","other","callAllEventHandlers","handlerMouseEnter","handlerMouseLeave","isNode","NoticeBubbleView","_notice","add","remove","update","NoticeBubbleWarningView","NoticeBubbleContainer","createComponent","Info","Warning","NoticeBubble","NoticeBubbleWarning"],"sources":["../../src/NoticeBubble.jsx"],"sourcesContent":["import React from 'react';\nimport Portal from '@semcore/portal';\nimport manager from './NoticeBubbleManager';\nimport createComponent, { Component, sstyled, Root } from '@semcore/core';\nimport { Animation } from '@semcore/animation';\nimport { Flex, Box } from '@semcore/flex-box';\nimport fire from '@semcore/utils/lib/fire';\nimport isNode from '@semcore/utils/lib/isNode';\nimport { callAllEventHandlers } from '@semcore/utils/lib/assignProps';\nimport CloseIcon from '@semcore/icon/Close/m';\nimport { Timer } from './utils';\nimport { localizedMessages } from './translations/__intergalactic-dynamic-locales';\nimport i18nEnhance from '@semcore/utils/lib/enhances/i18nEnhance';\nimport { useCssVariable } from '@semcore/utils/lib/useCssVariable';\nimport { contextThemeEnhance } from '@semcore/utils/lib/ThemeProvider';\n\nimport style from './style/notice-bubble.shadow.css';\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 = [i18nEnhance(localizedMessages), contextThemeEnhance()];\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 constructor(props) {\n super(props);\n props.manager.counter = 0;\n this._unsubscribe = props.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 { Children, styles, disablePortal, getI18nText, ref } = this.asProps;\n const { notices, warnings } = this.state;\n\n return sstyled(styles)(\n <Portal disablePortal={disablePortal}>\n <SNoticeBubble render={Box} role=\"alert\" aria-live=\"assertive\" ref={ref}>\n <Children />\n <Notices styles={styles} data={warnings} tag={ViewWarning} getI18nText={getI18nText} />\n <Notices styles={styles} data={notices} tag={ViewInfo} getI18nText={getI18nText} />\n </SNoticeBubble>\n </Portal>,\n );\n }\n}\n\nclass ViewInfo extends Component {\n timer = null;\n\n componentDidMount() {\n const { duration } = this.props;\n if (duration) {\n this.timer = new Timer(this.handlerClose, duration);\n }\n }\n\n componentWillUnmount() {\n this.clearTimer();\n }\n\n clearTimer() {\n if (this.timer) {\n this.timer.clear();\n this.timer = null;\n }\n }\n\n handlerClose = (e) => {\n // because call not only click\n fire(this, 'onClose', e);\n this.clearTimer();\n };\n\n handlerMouseEnter = () => {\n if (this.timer) {\n this.timer.pause();\n }\n };\n\n handlerMouseLeave = () => {\n if (this.timer) {\n this.timer.resume();\n }\n };\n\n render() {\n const SBubble = Flex;\n const SDismiss = 'div';\n const SContent = Flex;\n const SMessage = 'div';\n const SAction = 'div';\n const {\n forwardRef,\n styles,\n onMouseEnter,\n onMouseLeave,\n getI18nText,\n icon,\n children,\n action: actionNode,\n ...other\n } = this.props;\n\n return sstyled(styles)(\n <SBubble\n role=\"alert\"\n {...other}\n ref={forwardRef}\n onMouseEnter={callAllEventHandlers(onMouseEnter, this.handlerMouseEnter)}\n onMouseLeave={callAllEventHandlers(onMouseLeave, this.handlerMouseLeave)}\n >\n <SDismiss\n title={getI18nText('close')}\n onClick={this.handlerClose}\n aria-label={getI18nText('close')}\n >\n <CloseIcon />\n </SDismiss>\n {isNode(icon) ? (\n <>\n {icon}\n <SContent>\n <SMessage>{children}</SMessage>\n {isNode(actionNode) ? <SAction>{actionNode}</SAction> : null}\n </SContent>\n </>\n ) : (\n <SContent>\n <SMessage>{children}</SMessage>\n {isNode(actionNode) ? <SAction>{actionNode}</SAction> : null}\n </SContent>\n )}\n </SBubble>,\n );\n }\n}\n\nclass ViewWarning extends ViewInfo {\n static defaultProps = {\n type: 'warning',\n duration: 0,\n };\n}\n\nclass NoticeBubbleView extends Component {\n static defaultProps = {\n duration: 5000,\n type: 'info',\n manager,\n };\n\n _notice = null;\n\n componentDidMount() {\n this._notice = this.asProps.manager.add(this.asProps);\n }\n\n componentWillUnmount() {\n if (this._notice) {\n this._notice.remove();\n }\n }\n\n componentDidUpdate() {\n if (this._notice) {\n this._notice.update(this.asProps);\n }\n }\n\n render() {\n return null;\n }\n}\n\nclass NoticeBubbleWarningView extends NoticeBubbleView {\n static defaultProps = {\n duration: 5000,\n type: 'warning',\n manager,\n };\n}\n\nconst NoticeBubbleContainer = createComponent(NoticeBubbleContainerRoot, {\n Info: NoticeBubbleView,\n Warning: NoticeBubbleWarningView,\n});\n\nconst NoticeBubble = NoticeBubbleContainer.Info;\nconst NoticeBubbleWarning = NoticeBubbleContainer.Warning;\n\nexport { NoticeBubble, NoticeBubbleWarning };\n\nexport default NoticeBubbleContainer;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AAGA;;AAHA;;AACA;;AACA;;AAEA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;;;;;;;;;;;;;;;;;;;;;;;AAIA,IAAMA,OAAO,GAAG,SAAVA,OAAU,CAACC,KAAD,EAAW;EACzB,IAAQC,MAAR,GAAqDD,KAArD,CAAQC,MAAR;EAAA,kBAAqDD,KAArD,CAAgBE,IAAhB;EAAA,IAAgBA,IAAhB,4BAAuB,EAAvB;EAAA,iBAAqDF,KAArD,CAA2BG,GAA3B;EAAA,IAAgCC,KAAhC,2BAAwCC,QAAxC;;EACA,IAAMC,GAAG,GAAGC,iBAAA,CAAMC,MAAN,EAAZ;;EACA,IAAMC,WAAW,GAAG,IAAAC,8BAAA,EAAe,iCAAf,EAAkD,KAAlD,EAAyDJ,GAAzD,CAApB;;EACA,IAAMK,QAAQ,GAAGJ,iBAAA,CAAMK,OAAN,CAAc;IAAA,OAAMC,QAAQ,CAACJ,WAAD,EAAc,EAAd,CAAd;EAAA,CAAd,EAA+C,CAACA,WAAD,CAA/C,CAAjB;;EAEA,OAAOP,IAAI,CAACY,GAAL,CAAS,UAACC,MAAD,EAAY;IAAA;;IAC1B,eAAO,IAAAC,aAAA,EAAQf,MAAR,CAAP,eACE,gCAAC,oBAAD;MAAA,OACOc,MAAM,CAACE,GADd;MAAA,oBAEoBF,MAAM,CAACG,gBAF3B;MAAA,8BAGWH,MAAM,CAACI,OAHlB,6DAG6B,IAH7B;MAAA,Y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AHoB,C;AAOxB,IAAMmD,qBAAqB,GAAG,IAAAC,gBAAA,EAAgB7D,yBAAhB,EAA2C;EACvE8D,IAAI,EAAER,gBADiE;EAEvES,OAAO,EAAEJ;AAF8D,CAA3C,CAA9B;AAKA,IAAMK,YAAY,GAAGJ,qBAAqB,CAACE,IAA3C;;AACA,IAAMG,mBAAmB,GAAGL,qBAAqB,CAACG,OAAlD;;eAIeH,qB"}
|
|
1
|
+
{"version":3,"file":"NoticeBubble.js","names":["_core","_interopRequireWildcard","require","_react","_interopRequireDefault","_portal","_NoticeBubbleManager","_animation","_flexBox","_fire","_isNode","_assignProps2","_m","_utils","_intergalacticDynamicLocales","_i18nEnhance","_useCssVariable","_ThemeProvider","_excluded","style","sstyled","insert","Notices","props","styles","_props$data","data","_props$tag","tag","SView","ViewInfo","ref","React","useRef","durationStr","useCssVariable","duration","useMemo","parseInt","map","notice","_ref2","_notice$visible","createElement","Animation","cn","uid","initialAnimation","visible","_objectSpread2","getI18nText","NoticeBubbleContainerRoot","_Component","_inherits2","_super","_createSuper2","_this","_classCallCheck2","call","_defineProperty2","_assertThisInitialized2","notices","warnings","_unsubscribe","info","filter","type","warning","setState","manager","counter","addListener","handleChange","_createClass2","key","value","render","_ref","asProps","_ref3","SNoticeBubble","Box","_this$asProps","Children","disablePortal","_this$state","state","assignProps","ViewWarning","Component","i18nEnhance","localizedMessages","contextThemeEnhance","i18n","locale","_Component2","_super2","_this2","_len","arguments","length","args","Array","_key","apply","concat","e","fire","clearTimer","timer","pause","resume","componentDidMount","Timer","handlerClose","componentWillUnmount","clear","_ref4","SBubble","Flex","SDismiss","SContent","SMessage","SAction","_this$props","forwardRef","onMouseEnter","onMouseLeave","icon","children","actionNode","action","other","_objectWithoutProperties2","callAllEventHandlers","handlerMouseEnter","handlerMouseLeave","isNode","Fragment","_ViewInfo","_super3","NoticeBubbleView","_Component3","_super4","_this3","_len2","_key2","_notice","add","remove","componentDidUpdate","update","NoticeBubbleWarningView","_NoticeBubbleView","_super5","NoticeBubbleContainer","createComponent","Info","Warning","NoticeBubble","exports","NoticeBubbleWarning","_default"],"sources":["../../src/NoticeBubble.jsx"],"sourcesContent":["import React from 'react';\nimport Portal from '@semcore/portal';\nimport manager from './NoticeBubbleManager';\nimport createComponent, { Component, sstyled, Root } from '@semcore/core';\nimport { Animation } from '@semcore/animation';\nimport { Flex, Box } from '@semcore/flex-box';\nimport fire from '@semcore/utils/lib/fire';\nimport isNode from '@semcore/utils/lib/isNode';\nimport { callAllEventHandlers } from '@semcore/utils/lib/assignProps';\nimport CloseIcon from '@semcore/icon/Close/m';\nimport { Timer } from './utils';\nimport { localizedMessages } from './translations/__intergalactic-dynamic-locales';\nimport i18nEnhance from '@semcore/utils/lib/enhances/i18nEnhance';\nimport { useCssVariable } from '@semcore/utils/lib/useCssVariable';\nimport { contextThemeEnhance } from '@semcore/utils/lib/ThemeProvider';\n\nimport style from './style/notice-bubble.shadow.css';\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 = [i18nEnhance(localizedMessages), contextThemeEnhance()];\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 constructor(props) {\n super(props);\n props.manager.counter = 0;\n this._unsubscribe = props.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 { Children, styles, disablePortal, getI18nText, ref } = this.asProps;\n const { notices, warnings } = this.state;\n\n return sstyled(styles)(\n <Portal disablePortal={disablePortal}>\n <SNoticeBubble render={Box} role=\"alert\" aria-live=\"assertive\" ref={ref}>\n <Children />\n <Notices styles={styles} data={warnings} tag={ViewWarning} getI18nText={getI18nText} />\n <Notices styles={styles} data={notices} tag={ViewInfo} getI18nText={getI18nText} />\n </SNoticeBubble>\n </Portal>,\n );\n }\n}\n\nclass ViewInfo extends Component {\n timer = null;\n\n componentDidMount() {\n const { duration } = this.props;\n if (duration) {\n this.timer = new Timer(this.handlerClose, duration);\n }\n }\n\n componentWillUnmount() {\n this.clearTimer();\n }\n\n clearTimer() {\n if (this.timer) {\n this.timer.clear();\n this.timer = null;\n }\n }\n\n handlerClose = (e) => {\n // because call not only click\n fire(this, 'onClose', e);\n this.clearTimer();\n };\n\n handlerMouseEnter = () => {\n if (this.timer) {\n this.timer.pause();\n }\n };\n\n handlerMouseLeave = () => {\n if (this.timer) {\n this.timer.resume();\n }\n };\n\n render() {\n const SBubble = Flex;\n const SDismiss = 'div';\n const SContent = Flex;\n const SMessage = 'div';\n const SAction = 'div';\n const {\n forwardRef,\n styles,\n onMouseEnter,\n onMouseLeave,\n getI18nText,\n icon,\n children,\n action: actionNode,\n ...other\n } = this.props;\n\n return sstyled(styles)(\n <SBubble\n role=\"alert\"\n {...other}\n ref={forwardRef}\n onMouseEnter={callAllEventHandlers(onMouseEnter, this.handlerMouseEnter)}\n onMouseLeave={callAllEventHandlers(onMouseLeave, this.handlerMouseLeave)}\n >\n <SDismiss\n title={getI18nText('close')}\n onClick={this.handlerClose}\n aria-label={getI18nText('close')}\n >\n <CloseIcon />\n </SDismiss>\n {isNode(icon) ? (\n <>\n {icon}\n <SContent>\n <SMessage>{children}</SMessage>\n {isNode(actionNode) ? <SAction>{actionNode}</SAction> : null}\n </SContent>\n </>\n ) : (\n <SContent>\n <SMessage>{children}</SMessage>\n {isNode(actionNode) ? <SAction>{actionNode}</SAction> : null}\n </SContent>\n )}\n </SBubble>,\n );\n }\n}\n\nclass ViewWarning extends ViewInfo {\n static defaultProps = {\n type: 'warning',\n duration: 0,\n };\n}\n\nclass NoticeBubbleView extends Component {\n static defaultProps = {\n duration: 5000,\n type: 'info',\n manager,\n };\n\n _notice = null;\n\n componentDidMount() {\n this._notice = this.asProps.manager.add(this.asProps);\n }\n\n componentWillUnmount() {\n if (this._notice) {\n this._notice.remove();\n }\n }\n\n componentDidUpdate() {\n if (this._notice) {\n this._notice.update(this.asProps);\n }\n }\n\n render() {\n return null;\n }\n}\n\nclass NoticeBubbleWarningView extends NoticeBubbleView {\n static defaultProps = {\n duration: 5000,\n type: 'warning',\n manager,\n };\n}\n\nconst NoticeBubbleContainer = createComponent(NoticeBubbleContainerRoot, {\n Info: NoticeBubbleView,\n Warning: NoticeBubbleWarningView,\n});\n\nconst NoticeBubble = NoticeBubbleContainer.Info;\nconst NoticeBubbleWarning = NoticeBubbleContainer.Warning;\n\nexport { NoticeBubble, NoticeBubbleWarning };\n\nexport default NoticeBubbleContainer;\n"],"mappings":";;;;;;;;;;;;;;;;AAGA,IAAAA,KAAA,GAAAC,uBAAA,CAAAC,OAAA;AAHA,IAAAC,MAAA,GAAAC,sBAAA,CAAAF,OAAA;AACA,IAAAG,OAAA,GAAAD,sBAAA,CAAAF,OAAA;AACA,IAAAI,oBAAA,GAAAF,sBAAA,CAAAF,OAAA;AAEA,IAAAK,UAAA,GAAAL,OAAA;AACA,IAAAM,QAAA,GAAAN,OAAA;AACA,IAAAO,KAAA,GAAAL,sBAAA,CAAAF,OAAA;AACA,IAAAQ,OAAA,GAAAN,sBAAA,CAAAF,OAAA;AACA,IAAAS,aAAA,GAAAT,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1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
|
|
5
4
|
Object.defineProperty(exports, "__esModule", {
|
|
6
5
|
value: true
|
|
7
6
|
});
|
|
8
7
|
exports["default"] = exports.NoticeBubbleManager = void 0;
|
|
9
|
-
|
|
10
8
|
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
|
|
11
|
-
|
|
12
9
|
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
13
|
-
|
|
14
10
|
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
15
|
-
|
|
16
11
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
17
|
-
|
|
18
12
|
var _eventEmitter = _interopRequireDefault(require("@semcore/utils/lib/eventEmitter"));
|
|
19
|
-
|
|
20
13
|
var _assignProps = require("@semcore/utils/lib/assignProps");
|
|
21
|
-
|
|
22
14
|
var EVENT_NAME = 'CHANGE';
|
|
23
|
-
|
|
24
15
|
var NoticeBubbleManager = /*#__PURE__*/function () {
|
|
25
16
|
function NoticeBubbleManager() {
|
|
26
17
|
(0, _classCallCheck2["default"])(this, NoticeBubbleManager);
|
|
@@ -29,7 +20,6 @@ var NoticeBubbleManager = /*#__PURE__*/function () {
|
|
|
29
20
|
(0, _defineProperty2["default"])(this, "counter", 0);
|
|
30
21
|
this.emitter = new _eventEmitter["default"]();
|
|
31
22
|
}
|
|
32
|
-
|
|
33
23
|
(0, _createClass2["default"])(NoticeBubbleManager, [{
|
|
34
24
|
key: "addListener",
|
|
35
25
|
value: function addListener(fn) {
|
|
@@ -74,47 +64,39 @@ var NoticeBubbleManager = /*#__PURE__*/function () {
|
|
|
74
64
|
var index = this.items.findIndex(function (item) {
|
|
75
65
|
return item.uid === uid;
|
|
76
66
|
});
|
|
77
|
-
|
|
78
67
|
if (index !== -1) {
|
|
79
68
|
this.items[index] = this.createItem((0, _objectSpread2["default"])((0, _objectSpread2["default"])({}, this.items[index]), props));
|
|
80
69
|
this.emit();
|
|
81
70
|
return true;
|
|
82
71
|
}
|
|
83
|
-
|
|
84
72
|
return false;
|
|
85
73
|
}
|
|
86
74
|
}, {
|
|
87
75
|
key: "remove",
|
|
88
76
|
value: function remove(uid) {
|
|
89
77
|
var _this = this;
|
|
90
|
-
|
|
91
78
|
var index = this.items.findIndex(function (item) {
|
|
92
79
|
return item.uid === uid;
|
|
93
80
|
});
|
|
94
|
-
|
|
95
81
|
if (index !== -1) {
|
|
96
82
|
this.items[index].visible = false;
|
|
97
83
|
setTimeout(function () {
|
|
98
84
|
var index = _this.items.findIndex(function (item) {
|
|
99
85
|
return item.uid === uid;
|
|
100
86
|
});
|
|
101
|
-
|
|
102
87
|
if (index !== -1) {
|
|
103
88
|
_this.items.splice(index, 1);
|
|
104
|
-
|
|
105
89
|
_this.emit();
|
|
106
90
|
}
|
|
107
91
|
}, 1000);
|
|
108
92
|
this.emit();
|
|
109
93
|
return true;
|
|
110
94
|
}
|
|
111
|
-
|
|
112
95
|
return false;
|
|
113
96
|
}
|
|
114
97
|
}]);
|
|
115
98
|
return NoticeBubbleManager;
|
|
116
99
|
}();
|
|
117
|
-
|
|
118
100
|
exports.NoticeBubbleManager = NoticeBubbleManager;
|
|
119
101
|
var noticeBubbleDefaultManager = new NoticeBubbleManager();
|
|
120
102
|
var _default = noticeBubbleDefaultManager;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NoticeBubbleManager.js","names":["EVENT_NAME","NoticeBubbleManager","emitter","EventEmitter","fn","subscribe","props","manager","type","onClose","callAllEventHandlers","remove","uid","emit","items","
|
|
1
|
+
{"version":3,"file":"NoticeBubbleManager.js","names":["_eventEmitter","_interopRequireDefault","require","_assignProps","EVENT_NAME","NoticeBubbleManager","_classCallCheck2","_defineProperty2","emitter","EventEmitter","_createClass2","key","value","addListener","fn","subscribe","createItem","props","manager","_objectSpread2","type","onClose","callAllEventHandlers","remove","uid","emit","items","add","counter","item","visible","initialAnimation","undefined","push","update","bind","index","findIndex","_this","setTimeout","splice","exports","noticeBubbleDefaultManager","_default"],"sources":["../../src/NoticeBubbleManager.js"],"sourcesContent":["import EventEmitter from '@semcore/utils/lib/eventEmitter';\nimport { callAllEventHandlers } from '@semcore/utils/lib/assignProps';\n\nconst EVENT_NAME = 'CHANGE';\n\nclass NoticeBubbleManager {\n items = [];\n emitter = null;\n counter = 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 item = this.createItem({\n uid,\n visible: props.initialAnimation ? true : undefined,\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 };\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 remove(uid) {\n const index = this.items.findIndex((item) => item.uid === uid);\n if (index !== -1) {\n this.items[index].visible = false;\n setTimeout(() => {\n const index = this.items.findIndex((item) => item.uid === uid);\n if (index !== -1) {\n this.items.splice(index, 1);\n this.emit();\n }\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,aAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AAEA,IAAME,UAAU,G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C,EAAE;YAChBE,KAAI,CAACZ,KAAK,CAACc,MAAM,CAACJ,KAAK,EAAE,CAAC,CAAC;YAC3BE,KAAI,CAACb,IAAI,EAAE;UACb;QACF,CAAC,EAAE,IAAI,CAAC;QACR,IAAI,CAACA,IAAI,EAAE;QACX,OAAO,IAAI;MACb;MACA,OAAO,KAAK;IACd;EAAC;EAAA,OAAApB,mBAAA;AAAA;AAAAoC,OAAA,CAAApC,mBAAA,GAAAA,mBAAA;AAGH,IAAMqC,0BAA0B,GAAG,IAAIrC,mBAAmB,EAAE;AAAC,IAAAsC,QAAA,GAG9CD,0BAA0B;AAAAD,OAAA,cAAAE,QAAA"}
|
package/lib/cjs/index.d.js
CHANGED
|
@@ -1,20 +1,15 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
|
|
5
4
|
Object.defineProperty(exports, "__esModule", {
|
|
6
5
|
value: true
|
|
7
6
|
});
|
|
8
7
|
exports.noticeBubbleDefaultManager = exports["default"] = void 0;
|
|
9
|
-
|
|
10
8
|
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
11
|
-
|
|
12
9
|
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
13
|
-
|
|
14
10
|
/**
|
|
15
11
|
* @deprecated use `NoticeBubbleManager` instead.
|
|
16
12
|
* */
|
|
17
|
-
|
|
18
13
|
/**
|
|
19
14
|
* @deprecated use `NoticeBubbleManager` instead.
|
|
20
15
|
* */
|
|
@@ -23,11 +18,9 @@ var NoticeBubbleManager = /*#__PURE__*/(0, _createClass2["default"])(function No
|
|
|
23
18
|
});
|
|
24
19
|
var noticeBubbleDefaultManager = new NoticeBubbleManager();
|
|
25
20
|
exports.noticeBubbleDefaultManager = noticeBubbleDefaultManager;
|
|
26
|
-
|
|
27
21
|
/**
|
|
28
22
|
* @deprecated Use `import { noticeBubbleDefaultManager } from ...` instead
|
|
29
23
|
*/
|
|
30
24
|
var _default = new NoticeBubbleManager();
|
|
31
|
-
|
|
32
25
|
exports["default"] = _default;
|
|
33
26
|
//# sourceMappingURL=index.d.js.map
|
package/lib/cjs/index.d.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.js","names":["NoticeBubbleManager","noticeBubbleDefaultManager"],"sources":["../../src/index.d.ts"],"sourcesContent":["import { IPortalProps } from '@semcore/portal';\nimport { CProps, ReturnEl } from '@semcore/core';\nimport { IBoxProps } from '@semcore/flex-box';\n\nexport interface INoticeBubbleContainerProps extends IBoxProps, IPortalProps {\n /** Manager copy */\n manager?: INoticeBubbleManager;\n locale?: string;\n}\n\nexport interface INoticeBubbleProps extends IBoxProps {\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}\nexport interface INoticeBubbleInfoProps extends INoticeBubbleProps {\n readonly type?: 'info';\n /**\n * Notice display duration.\n */\n duration?: number;\n /**\n * Enables animation on first rendering.\n * @default false\n */\n initialAnimation?: boolean;\n}\n\nexport interface INoticeBubbleWarningProps extends INoticeBubbleProps {\n readonly type?: 'warning';\n /**\n * Notice display duration.\n */\n duration?: number;\n /**\n * Enables animation on first rendering.\n * @default false\n */\n initialAnimation?: boolean;\n}\n\nexport interface INoticeBubbleManager {\n /**\n * Creates and shows a notice.\n * */\n add: (props: INoticeBubbleInfoProps | INoticeBubbleWarningProps) => {\n uid: string;\n update: (\n props: Partial<INoticeBubbleInfoProps> | Partial<INoticeBubbleWarningProps>,\n ) => boolean;\n remove: () => boolean;\n };\n /**\n * Updates notice by uid.\n * */\n update: (\n uid: string,\n props: Partial<INoticeBubbleInfoProps> | Partial<INoticeBubbleWarningProps>,\n ) => boolean;\n /**\n * Removes notice by uid.\n * */\n remove: (uid: string) => boolean;\n}\n\n/**\n * @deprecated use `NoticeBubbleManager` instead.\n * */\ndeclare const NoticeBubble: <T>(props: INoticeBubbleInfoProps & T) => ReturnEl;\n/**\n * @deprecated use `NoticeBubbleManager` instead.\n * */\ndeclare const NoticeBubbleWarning: <T>(props: INoticeBubbleWarningProps & T) => ReturnEl;\ndeclare const NoticeBubbleContainer: (<T>(\n props: CProps<INoticeBubbleContainerProps & T>,\n) => ReturnEl) & {\n /**\n * @deprecated use `NoticeBubbleManager` instead.\n * */\n Info: typeof NoticeBubble;\n\n /**\n * @deprecated use `NoticeBubbleManager` instead.\n * */\n Warning: typeof NoticeBubbleWarning;\n};\ndeclare class NoticeBubbleManager implements INoticeBubbleManager {\n /**\n * Creates and shows a notice.\n * */\n add(props: INoticeBubbleInfoProps | INoticeBubbleWarningProps): {\n uid: string;\n update: (\n props: Partial<INoticeBubbleInfoProps> | Partial<INoticeBubbleWarningProps>,\n ) => boolean;\n remove: () => boolean;\n };\n /**\n * Updates notice by uid.\n * */\n update(\n uid: string,\n props: Partial<INoticeBubbleInfoProps> | Partial<INoticeBubbleWarningProps>,\n ): boolean;\n /**\n * Removes notice by uid.\n * */\n remove(uid: string): boolean;\n}\n\nconst noticeBubbleDefaultManager = new NoticeBubbleManager();\n\nexport {\n NoticeBubbleContainer,\n NoticeBubble,\n NoticeBubbleWarning,\n NoticeBubbleManager,\n noticeBubbleDefaultManager,\n};\n/**\n * @deprecated Use `import { noticeBubbleDefaultManager } from ...` instead\n */\nexport default new NoticeBubbleManager();\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.js","names":["NoticeBubbleManager","_createClass2","_classCallCheck2","noticeBubbleDefaultManager","exports","_default"],"sources":["../../src/index.d.ts"],"sourcesContent":["import { IPortalProps } from '@semcore/portal';\nimport { CProps, ReturnEl } from '@semcore/core';\nimport { IBoxProps } from '@semcore/flex-box';\n\nexport interface INoticeBubbleContainerProps extends IBoxProps, IPortalProps {\n /** Manager copy */\n manager?: INoticeBubbleManager;\n locale?: string;\n}\n\nexport interface INoticeBubbleProps extends IBoxProps {\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}\nexport interface INoticeBubbleInfoProps extends INoticeBubbleProps {\n readonly type?: 'info';\n /**\n * Notice display duration.\n */\n duration?: number;\n /**\n * Enables animation on first rendering.\n * @default false\n */\n initialAnimation?: boolean;\n}\n\nexport interface INoticeBubbleWarningProps extends INoticeBubbleProps {\n readonly type?: 'warning';\n /**\n * Notice display duration.\n */\n duration?: number;\n /**\n * Enables animation on first rendering.\n * @default false\n */\n initialAnimation?: boolean;\n}\n\nexport interface INoticeBubbleManager {\n /**\n * Creates and shows a notice.\n * */\n add: (props: INoticeBubbleInfoProps | INoticeBubbleWarningProps) => {\n uid: string;\n update: (\n props: Partial<INoticeBubbleInfoProps> | Partial<INoticeBubbleWarningProps>,\n ) => boolean;\n remove: () => boolean;\n };\n /**\n * Updates notice by uid.\n * */\n update: (\n uid: string,\n props: Partial<INoticeBubbleInfoProps> | Partial<INoticeBubbleWarningProps>,\n ) => boolean;\n /**\n * Removes notice by uid.\n * */\n remove: (uid: string) => boolean;\n}\n\n/**\n * @deprecated use `NoticeBubbleManager` instead.\n * */\ndeclare const NoticeBubble: <T>(props: INoticeBubbleInfoProps & T) => ReturnEl;\n/**\n * @deprecated use `NoticeBubbleManager` instead.\n * */\ndeclare const NoticeBubbleWarning: <T>(props: INoticeBubbleWarningProps & T) => ReturnEl;\ndeclare const NoticeBubbleContainer: (<T>(\n props: CProps<INoticeBubbleContainerProps & T>,\n) => ReturnEl) & {\n /**\n * @deprecated use `NoticeBubbleManager` instead.\n * */\n Info: typeof NoticeBubble;\n\n /**\n * @deprecated use `NoticeBubbleManager` instead.\n * */\n Warning: typeof NoticeBubbleWarning;\n};\ndeclare class NoticeBubbleManager implements INoticeBubbleManager {\n /**\n * Creates and shows a notice.\n * */\n add(props: INoticeBubbleInfoProps | INoticeBubbleWarningProps): {\n uid: string;\n update: (\n props: Partial<INoticeBubbleInfoProps> | Partial<INoticeBubbleWarningProps>,\n ) => boolean;\n remove: () => boolean;\n };\n /**\n * Updates notice by uid.\n * */\n update(\n uid: string,\n props: Partial<INoticeBubbleInfoProps> | Partial<INoticeBubbleWarningProps>,\n ): boolean;\n /**\n * Removes notice by uid.\n * */\n remove(uid: string): boolean;\n}\n\nconst noticeBubbleDefaultManager = new NoticeBubbleManager();\n\nexport {\n NoticeBubbleContainer,\n NoticeBubble,\n NoticeBubbleWarning,\n NoticeBubbleManager,\n noticeBubbleDefaultManager,\n};\n/**\n * @deprecated Use `import { noticeBubbleDefaultManager } from ...` instead\n */\nexport default new NoticeBubbleManager();\n"],"mappings":";;;;;;;;;AA8EA;AACA;AACA;AAEA;AACA;AACA;AAFA,IAiBcA,mBAAmB,oBAAAC,aAAA,sBAAAD,oBAAA;EAAA,IAAAE,gBAAA,mBAAAF,mBAAA;AAAA;AAwBjC,IAAMG,0BAA0B,GAAG,IAAIH,mBAAmB,EAAE;AAACI,OAAA,CAAAD,0BAAA,GAAAA,0BAAA;AAS7D;AACA;AACA;AAFA,IAAAE,QAAA,GAGe,IAAIL,mBAAmB,EAAE;AAAAI,OAAA,cAAAC,QAAA"}
|
package/lib/cjs/index.js
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard");
|
|
4
|
-
|
|
5
4
|
Object.defineProperty(exports, "__esModule", {
|
|
6
5
|
value: true
|
|
7
6
|
});
|
|
@@ -22,9 +21,7 @@ Object.defineProperty(exports, "noticeBubbleDefaultManager", {
|
|
|
22
21
|
return _NoticeBubbleManager["default"];
|
|
23
22
|
}
|
|
24
23
|
});
|
|
25
|
-
|
|
26
24
|
var _NoticeBubble = _interopRequireWildcard(require("./NoticeBubble"));
|
|
27
|
-
|
|
28
25
|
Object.keys(_NoticeBubble).forEach(function (key) {
|
|
29
26
|
if (key === "default" || key === "__esModule") return;
|
|
30
27
|
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
@@ -36,9 +33,7 @@ Object.keys(_NoticeBubble).forEach(function (key) {
|
|
|
36
33
|
}
|
|
37
34
|
});
|
|
38
35
|
});
|
|
39
|
-
|
|
40
36
|
var _NoticeBubbleManager = _interopRequireWildcard(require("./NoticeBubbleManager"));
|
|
41
|
-
|
|
42
37
|
Object.keys(_NoticeBubbleManager).forEach(function (key) {
|
|
43
38
|
if (key === "default" || key === "__esModule") return;
|
|
44
39
|
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
package/lib/cjs/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["noticeBubbleDefaultManager"],"sources":["../../src/index.js"],"sourcesContent":["import { default as NoticeBubbleContainer } from './NoticeBubble';\nexport * from './NoticeBubble';\n\nimport { default as noticeBubbleDefaultManager } from './NoticeBubbleManager';\n\nexport * from './NoticeBubbleManager';\n\nexport default noticeBubbleDefaultManager;\nexport { NoticeBubbleContainer, noticeBubbleDefaultManager };\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.js"],"sourcesContent":["import { default as NoticeBubbleContainer } from './NoticeBubble';\nexport * from './NoticeBubble';\n\nimport { default as noticeBubbleDefaultManager } from './NoticeBubbleManager';\n\nexport * from './NoticeBubbleManager';\n\nexport default noticeBubbleDefaultManager;\nexport { NoticeBubbleContainer, noticeBubbleDefaultManager };\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAAA,IAAAA,aAAA,GAAAC,uBAAA,CAAAC,OAAA;AACAC,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;AAEA,IAAAS,oBAAA,GAAAd,uBAAA,CAAAC,OAAA;AAEAC,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,GAEvBC,+BAA0B;AAAAN,OAAA,cAAAK,QAAA"}
|