@teambit/notifications 1.0.41 → 1.0.42
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/dist/index.js +1 -2
- package/dist/index.js.map +1 -1
- package/dist/notification.ui.runtime.js +2 -2
- package/dist/notification.ui.runtime.js.map +1 -1
- package/dist/notifications.aspect.js +2 -4
- package/dist/notifications.aspect.js.map +1 -1
- package/package.json +5 -5
- /package/dist/{preview-1698981534427.js → preview-1699364645970.js} +0 -0
package/dist/index.js
CHANGED
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_notifications","data","require","_default","
|
|
1
|
+
{"version":3,"names":["_notifications","data","require","_default","exports","default","NotificationsAspect"],"sources":["index.ts"],"sourcesContent":["import { NotificationsAspect } from './notifications.aspect';\n\nexport type { default as NotificationUI } from './notification.ui.runtime';\n\nexport { NotificationsAspect };\nexport default NotificationsAspect;\n"],"mappings":";;;;;;;;;;;;AAAA,SAAAA,eAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,cAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAA6D,IAAAE,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAK9CC,oCAAmB"}
|
|
@@ -60,8 +60,8 @@ function _notifications() {
|
|
|
60
60
|
};
|
|
61
61
|
return data;
|
|
62
62
|
}
|
|
63
|
-
function _getRequireWildcardCache(
|
|
64
|
-
function _interopRequireWildcard(
|
|
63
|
+
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
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
67
|
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_ui","data","require","_react","_interopRequireWildcard","_uuid","_uiFoundationUiNotifications","_uiFoundationUiNotifications2","_uiFoundationUiNotifications3","_notificationReducer","_notifications","_getRequireWildcardCache","
|
|
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","arg","_toPrimitive","String","input","hint","prim","Symbol","toPrimitive","undefined","res","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;IAAA,OAAAF,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAI,MAAA;EAAA,MAAAJ,IAAA,GAAAC,OAAA;EAAAG,KAAA,YAAAA,CAAA;IAAA,OAAAJ,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEA,SAAAK,6BAAA;EAAA,MAAAL,IAAA,GAAAC,OAAA;EAAAI,4BAAA,YAAAA,CAAA;IAAA,OAAAL,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAM,8BAAA;EAAA,MAAAN,IAAA,GAAAC,OAAA;EAAAK,6BAAA,YAAAA,CAAA;IAAA,OAAAN,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAIA,SAAAO,8BAAA;EAAA,MAAAP,IAAA,GAAAC,OAAA;EAAAM,6BAAA,YAAAA,CAAA;IAAA,OAAAP,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAQ,qBAAA;EAAA,MAAAR,IAAA,GAAAC,OAAA;EAAAO,oBAAA,YAAAA,CAAA;IAAA,OAAAR,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAS,eAAA;EAAA,MAAAT,IAAA,GAAAC,O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AU,EAACC,0CAAmB,EAAE,EAAE,CAAC;MAChE,IAAI,CAAChB,QAAQ,GAAGA,QAAQ;MAExB,oBAAOlE,MAAA,GAAAc,OAAA,CAAAqE,aAAA,CAAC/E,6BAAA,GAAAgF,kBAAkB,EAAAvD,QAAA,KAAKkD,KAAK;QAAEM,aAAa,EAAEL;MAAS,EAAE,CAAC;IACnE,CAAC;IAAA1C,eAAA,wBAEuB,CAAC;MAAEgD;IAAkC,CAAC,KAAK;MACjE,oBAAOtF,MAAA,GAAAc,OAAA,CAAAqE,aAAA,CAAChF,4BAAA,GAAAoF,mBAAmB,CAACC,QAAQ;QAAChD,KAAK,EAAE;MAAK,GAAE8C,QAAuC,CAAC;IAC7F,CAAC;IAzDC3B,kBAAkB,CAAC8B,eAAe,eAACzF,MAAA,GAAAc,OAAA,CAAAqE,aAAA,MAAMO,MAAM;MAACtD,GAAG,EAAC;IAAgB,CAAE,CAAC,CAAC;IACxEuB,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,CAAArE,IAAA,KAAI,EAAY;MACdyC,IAAI,EAAE,SAAS;MACfH;IACF,CAAC,CAAC;EACJ;AA6BF;AAACgC,OAAA,CAAAlF,OAAA,GAAA2C,cAAA;AAAAnB,eAAA,CApEoBmB,cAAc,kBACX,CAACwC,cAAQ,CAAC;AAAA3D,eAAA,CADbmB,cAAc,aAGhByC,eAAS;AAmE5BC,oCAAmB,CAACC,UAAU,CAAC3C,cAAc,CAAC"}
|
|
@@ -11,11 +11,9 @@ function _harmony() {
|
|
|
11
11
|
};
|
|
12
12
|
return data;
|
|
13
13
|
}
|
|
14
|
-
const NotificationsAspect = _harmony().Aspect.create({
|
|
14
|
+
const NotificationsAspect = exports.NotificationsAspect = _harmony().Aspect.create({
|
|
15
15
|
id: 'teambit.ui-foundation/notifications'
|
|
16
16
|
});
|
|
17
|
-
exports.
|
|
18
|
-
var _default = NotificationsAspect;
|
|
19
|
-
exports.default = _default;
|
|
17
|
+
var _default = exports.default = NotificationsAspect;
|
|
20
18
|
|
|
21
19
|
//# sourceMappingURL=notifications.aspect.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_harmony","data","require","NotificationsAspect","Aspect","create","id","
|
|
1
|
+
{"version":3,"names":["_harmony","data","require","NotificationsAspect","exports","Aspect","create","id","_default","default"],"sources":["notifications.aspect.ts"],"sourcesContent":["import { Aspect } from '@teambit/harmony';\n\nexport const NotificationsAspect = Aspect.create({\n id: 'teambit.ui-foundation/notifications',\n});\n\nexport default NotificationsAspect;\n"],"mappings":";;;;;;AAAA,SAAAA,SAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,QAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEO,MAAME,mBAAmB,GAAAC,OAAA,CAAAD,mBAAA,GAAGE,iBAAM,CAACC,MAAM,CAAC;EAC/CC,EAAE,EAAE;AACN,CAAC,CAAC;AAAC,IAAAC,QAAA,GAAAJ,OAAA,CAAAK,OAAA,GAEYN,mBAAmB"}
|
package/package.json
CHANGED
|
@@ -1,22 +1,22 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@teambit/notifications",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.42",
|
|
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.42"
|
|
10
10
|
},
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"uuid": "8.3.2",
|
|
13
13
|
"core-js": "^3.0.0",
|
|
14
|
-
"@babel/runtime": "7.
|
|
14
|
+
"@babel/runtime": "7.23.2",
|
|
15
15
|
"@teambit/ui-foundation.ui.notifications.store": "0.0.500",
|
|
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.42"
|
|
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.590",
|
|
32
32
|
"react": "^16.8.0 || ^17.0.0",
|
|
33
33
|
"react-dom": "^16.8.0 || ^17.0.0"
|
|
34
34
|
},
|
|
File without changes
|