@teambit/notifications 1.0.104 → 1.0.106
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.
|
@@ -64,8 +64,8 @@ function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return
|
|
|
64
64
|
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
65
65
|
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
66
66
|
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
67
|
-
function _toPropertyKey(
|
|
68
|
-
function _toPrimitive(
|
|
67
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : String(i); }
|
|
68
|
+
function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
69
69
|
/**
|
|
70
70
|
* extension
|
|
71
71
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_ui","data","require","_react","_interopRequireWildcard","_uuid","_uiFoundationUiNotifications","_uiFoundationUiNotifications2","_uiFoundationUiNotifications3","_notificationReducer","_notifications","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","prototype","hasOwnProperty","call","i","set","_extends","assign","bind","target","arguments","length","source","key","apply","_defineProperty","obj","value","_toPropertyKey","enumerable","configurable","writable","
|
|
1
|
+
{"version":3,"names":["_ui","data","require","_react","_interopRequireWildcard","_uuid","_uiFoundationUiNotifications","_uiFoundationUiNotifications2","_uiFoundationUiNotifications3","_notificationReducer","_notifications","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","prototype","hasOwnProperty","call","i","set","_extends","assign","bind","target","arguments","length","source","key","apply","_defineProperty","obj","value","_toPropertyKey","enumerable","configurable","writable","_toPrimitive","String","Symbol","toPrimitive","TypeError","Number","NotificationUI","provider","uiRuntimeExtension","constructor","message","level","_this$dispatch","id","v1","dispatch","type","content","time","Date","toISOString","add","MessageLevel","info","warning","error","success","_this$dispatch2","props","messages","useReducer","notificationReducer","createElement","NotificationCenter","notifications","children","NotificationContext","Provider","registerHudItem","render","registerRenderHooks","reactContext","renderContext","dismiss","_this$dispatch3","exports","UIAspect","UIRuntime","NotificationsAspect","addRuntime"],"sources":["notification.ui.runtime.tsx"],"sourcesContent":["import { UIAspect, UIRuntime, UiUI } from '@teambit/ui';\nimport React, { ReactNode, useReducer } from 'react';\nimport { v1 } from 'uuid';\n\nimport { NotificationContext } from '@teambit/ui-foundation.ui.notifications.notification-context';\nimport {\n NotificationCenter,\n NotificationCenterProps,\n} from '@teambit/ui-foundation.ui.notifications.notification-center';\nimport { MessageLevel, NotificationsStore } from '@teambit/ui-foundation.ui.notifications.store';\nimport { NotificationAction, notificationReducer } from './notification-reducer';\nimport { NotificationsAspect } from './notifications.aspect';\n\n/**\n * extension\n */\nexport default class NotificationUI implements NotificationsStore {\n static dependencies = [UIAspect];\n\n static runtime = UIRuntime;\n\n static async provider([uiRuntimeExtension]: [UiUI]) {\n return new NotificationUI(uiRuntimeExtension);\n }\n\n constructor(uiRuntimeExtension: UiUI) {\n uiRuntimeExtension.registerHudItem(<this.render key=\"NotificationUI\" />);\n uiRuntimeExtension.registerRenderHooks({ reactContext: this.renderContext });\n }\n\n private dispatch?: React.Dispatch<NotificationAction>;\n\n /** adds a full message to the log */\n add = (message: string, level: MessageLevel) => {\n const id = v1();\n\n this.dispatch?.({\n type: 'add',\n content: {\n id,\n message,\n level,\n time: new Date().toISOString(),\n },\n });\n\n return id;\n };\n\n /** removes/archives a message from the log */\n dismiss(id: string) {\n this.dispatch?.({\n type: 'dismiss',\n id,\n });\n }\n\n /** adds a message with level \"info\" to the log */\n log = (message: string) => this.add(message, MessageLevel.info);\n /** adds a message with level \"warning\" to the log */\n warn = (message: string) => this.add(message, MessageLevel.warning);\n /** adds a message with level \"error\" to the log */\n error = (message: string) => this.add(message, MessageLevel.error);\n /** adds a message with level \"success\" to the log */\n success = (message: string) => this.add(message, MessageLevel.success);\n\n /** removes all notifications */\n clear = () => {\n this.dispatch?.({\n type: 'clear',\n });\n };\n\n private render = (props: Omit<NotificationCenterProps, 'notifications'>) => {\n // this code assumes a single place of render per instance of NotificationUI\n const [messages, dispatch] = useReducer(notificationReducer, []);\n this.dispatch = dispatch;\n\n return <NotificationCenter {...props} notifications={messages} />;\n };\n\n private renderContext = ({ children }: { children: ReactNode }) => {\n return <NotificationContext.Provider value={this}>{children}</NotificationContext.Provider>;\n };\n}\n\nNotificationsAspect.addRuntime(NotificationUI);\n"],"mappings":";;;;;;AAAA,SAAAA,IAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,GAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAE,OAAA;EAAA,MAAAF,IAAA,GAAAG,uBAAA,CAAAF,OAAA;EAAAC,MAAA,YAAAA,CAAA;IA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e,eAACnF,MAAA,GAAAc,OAAA,CAAA+D,aAAA,MAAMO,MAAM;MAAChD,GAAG,EAAC;IAAgB,CAAE,CAAC,CAAC;IACxEiB,kBAAkB,CAACgC,mBAAmB,CAAC;MAAEC,YAAY,EAAE,IAAI,CAACC;IAAc,CAAC,CAAC;EAC9E;EAqBA;EACAC,OAAOA,CAAC9B,EAAU,EAAE;IAAA,IAAA+B,eAAA;IAClB,CAAAA,eAAA,OAAI,CAAC7B,QAAQ,cAAA6B,eAAA,eAAbA,eAAA,CAAA/D,IAAA,KAAI,EAAY;MACdmC,IAAI,EAAE,SAAS;MACfH;IACF,CAAC,CAAC;EACJ;AA6BF;AAACgC,OAAA,CAAA5E,OAAA,GAAAqC,cAAA;AAAAb,eAAA,CApEoBa,cAAc,kBACX,CAACwC,cAAQ,CAAC;AAAArD,eAAA,CADba,cAAc,aAGhByC,eAAS;AAmE5BC,oCAAmB,CAACC,UAAU,CAAC3C,cAAc,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@teambit/notifications",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.106",
|
|
4
4
|
"homepage": "https://bit.cloud/teambit/ui-foundation/notifications",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"componentId": {
|
|
7
7
|
"scope": "teambit.ui-foundation",
|
|
8
8
|
"name": "notifications",
|
|
9
|
-
"version": "1.0.
|
|
9
|
+
"version": "1.0.106"
|
|
10
10
|
},
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"uuid": "8.3.2",
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
"@teambit/ui-foundation.ui.notifications.notification-center": "0.0.523",
|
|
17
17
|
"@teambit/ui-foundation.ui.notifications.notification-context": "0.0.501",
|
|
18
18
|
"@teambit/harmony": "0.4.6",
|
|
19
|
-
"@teambit/ui": "1.0.
|
|
19
|
+
"@teambit/ui": "1.0.106"
|
|
20
20
|
},
|
|
21
21
|
"devDependencies": {
|
|
22
22
|
"@types/react": "^17.0.8",
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
"@types/testing-library__jest-dom": "5.9.5"
|
|
29
29
|
},
|
|
30
30
|
"peerDependencies": {
|
|
31
|
-
"@teambit/legacy": "1.0.
|
|
31
|
+
"@teambit/legacy": "1.0.624",
|
|
32
32
|
"react": "^16.8.0 || ^17.0.0",
|
|
33
33
|
"react-dom": "^16.8.0 || ^17.0.0"
|
|
34
34
|
},
|
|
File without changes
|