@teambit/notifications 0.0.737 → 0.0.740

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.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["index.ts"],"names":["NotificationsAspect"],"mappings":";;;;;;;;;;;;;AAAA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;eAKeA,oC","sourcesContent":["import { NotificationsAspect } from './notifications.aspect';\n\nexport type { default as NotificationUI } from './notification.ui.runtime';\n\nexport { NotificationsAspect };\nexport default NotificationsAspect;\n"]}
1
+ {"version":3,"names":["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;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;eAKeA,oC"}
@@ -1 +1 @@
1
- {"version":3,"sources":["notification-reducer.tsx"],"names":["notificationReducer","state","action","type","filter","x","id","content","concat"],"mappings":";;;;;;;AAQO,SAASA,mBAAT,CAA6BC,KAA7B,EAA+CC,MAA/C,EAA2E;AAChF,UAAQA,MAAM,CAACC,IAAf;AACE,SAAK,SAAL;AACE,aAAOF,KAAK,CAACG,MAAN,CAAcC,CAAD,IAAOA,CAAC,CAACC,EAAF,KAASJ,MAAM,CAACI,EAApC,CAAP;;AACF,SAAK,KAAL;AACE,UAAI,CAACJ,MAAM,CAACK,OAAZ,EAAqB,OAAON,KAAP;AACrB,aAAOA,KAAK,CAACO,MAAN,CAAaN,MAAM,CAACK,OAApB,CAAP;;AACF,SAAK,OAAL;AACE,aAAO,EAAP;;AACF;AACE,aAAON,KAAP;AATJ;AAWD","sourcesContent":["import { Message } from '@teambit/ui-foundation.ui.notifications.store';\n\nexport type NotificationAction = {\n type: 'add' | 'dismiss' | 'clear';\n content?: Message;\n id?: string;\n};\n\nexport function notificationReducer(state: Message[], action: NotificationAction) {\n switch (action.type) {\n case 'dismiss':\n return state.filter((x) => x.id !== action.id);\n case 'add':\n if (!action.content) return state;\n return state.concat(action.content);\n case 'clear':\n return [];\n default:\n return state;\n }\n}\n"]}
1
+ {"version":3,"names":["notificationReducer","state","action","type","filter","x","id","content","concat"],"sources":["notification-reducer.tsx"],"sourcesContent":["import { Message } from '@teambit/ui-foundation.ui.notifications.store';\n\nexport type NotificationAction = {\n type: 'add' | 'dismiss' | 'clear';\n content?: Message;\n id?: string;\n};\n\nexport function notificationReducer(state: Message[], action: NotificationAction) {\n switch (action.type) {\n case 'dismiss':\n return state.filter((x) => x.id !== action.id);\n case 'add':\n if (!action.content) return state;\n return state.concat(action.content);\n case 'clear':\n return [];\n default:\n return state;\n }\n}\n"],"mappings":";;;;;;;AAQO,SAASA,mBAAT,CAA6BC,KAA7B,EAA+CC,MAA/C,EAA2E;EAChF,QAAQA,MAAM,CAACC,IAAf;IACE,KAAK,SAAL;MACE,OAAOF,KAAK,CAACG,MAAN,CAAcC,CAAD,IAAOA,CAAC,CAACC,EAAF,KAASJ,MAAM,CAACI,EAApC,CAAP;;IACF,KAAK,KAAL;MACE,IAAI,CAACJ,MAAM,CAACK,OAAZ,EAAqB,OAAON,KAAP;MACrB,OAAOA,KAAK,CAACO,MAAN,CAAaN,MAAM,CAACK,OAApB,CAAP;;IACF,KAAK,OAAL;MACE,OAAO,EAAP;;IACF;MACE,OAAON,KAAP;EATJ;AAWD"}
@@ -1 +1 @@
1
- {"version":3,"sources":["notification.ui.runtime.tsx"],"names":["NotificationUI","provider","uiRuntimeExtension","constructor","message","level","id","dispatch","type","content","time","Date","toISOString","add","MessageLevel","info","warning","error","success","props","messages","notificationReducer","children","registerHudItem","registerContext","renderContext","dismiss","UIAspect","UIRuntime","NotificationsAspect","addRuntime"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA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;;AACZ,8BAAKX,QAAL,+EAAgB;AACdC,QAAAA,IAAI,EAAE;AADQ,OAAhB;AAGD,KA9CqC;AAAA,oDAgDpBW,KAAD,IAA2D;AAC1E;AACA,YAAM,CAACC,QAAD,EAAWb,QAAX,IAAuB,yBAAWc,0CAAX,EAAgC,EAAhC,CAA7B;AACA,WAAKd,QAAL,GAAgBA,QAAhB;AAEA,0BAAO,+BAAC,kDAAD,+BAAwBY,KAAxB;AAA+B,QAAA,aAAa,EAAEC;AAA9C,SAAP;AACD,KAtDqC;AAAA,2DAwDd,CAAC;AAAEE,MAAAA;AAAF,KAAD,KAA2C;AACjE,0BAAO,+BAAC,kDAAD,CAAqB,QAArB;AAA8B,QAAA,KAAK,EAAE;AAArC,SAA4CA,QAA5C,CAAP;AACD,KA1DqC;AACpCpB,IAAAA,kBAAkB,CAACqB,eAAnB,eAAmC,oCAAM,MAAN;AAAa,MAAA,GAAG,EAAC;AAAjB,MAAnC;AACArB,IAAAA,kBAAkB,CAACsB,eAAnB,CAAmC,KAAKC,aAAxC;AACD;;AAqBD;AACAC,EAAAA,OAAO,CAACpB,EAAD,EAAa;AAAA;;AAClB,4BAAKC,QAAL,+EAAgB;AACdC,MAAAA,IAAI,EAAE,SADQ;AAEdF,MAAAA;AAFc,KAAhB;AAID;AAED;;;AAzCgE;;;gCAA7CN,c,kBACG,CAAC2B,cAAD,C;gCADH3B,c,aAGF4B,e;;AAmEnBC,qCAAoBC,UAApB,CAA+B9B,cAA/B","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.registerContext(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"]}
1
+ {"version":3,"names":["NotificationUI","provider","uiRuntimeExtension","constructor","message","level","id","v1","dispatch","type","content","time","Date","toISOString","add","MessageLevel","info","warning","error","success","props","messages","useReducer","notificationReducer","children","registerHudItem","registerContext","renderContext","dismiss","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.registerContext(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;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AACA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AACA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AAEA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AACA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AAIA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AACA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AACA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;;;;;AAEA;AACA;AACA;AACe,MAAMA,cAAN,CAAmD;EAK3C,aAARC,QAAQ,CAAC,CAACC,kBAAD,CAAD,EAA+B;IAClD,OAAO,IAAIF,cAAJ,CAAmBE,kBAAnB,CAAP;EACD;;EAEDC,WAAW,CAACD,kBAAD,EAA2B;IAAA;IAAA,6CAQhC,CAACE,OAAD,EAAkBC,KAAlB,KAA0C;MAAA;;MAC9C,MAAMC,EAAE,GAAG,IAAAC,UAAA,GAAX;MAEA,uBAAKC,QAAL,6EAAgB;QACdC,IAAI,EAAE,KADQ;QAEdC,OAAO,EAAE;UACPJ,EADO;UAEPF,OAFO;UAGPC,KAHO;UAIPM,IAAI,EAAE,IAAIC,IAAJ,GAAWC,WAAX;QAJC;MAFK,CAAhB;MAUA,OAAOP,EAAP;IACD,CAtBqC;IAAA,6CAiC/BF,OAAD,IAAqB,KAAKU,GAAL,CAASV,OAAT,EAAkBW,4CAAA,CAAaC,IAA/B,CAjCW;IAAA,8CAmC9BZ,OAAD,IAAqB,KAAKU,GAAL,CAASV,OAAT,EAAkBW,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A;;AAAA;AAAA;;AAEO,MAAMA,mBAAmB,GAAGC,kBAAOC,MAAP,CAAc;AAC/CC,EAAAA,EAAE,EAAE;AAD2C,CAAd,CAA5B;;;eAIQH,mB","sourcesContent":["import { Aspect } from '@teambit/harmony';\n\nexport const NotificationsAspect = Aspect.create({\n id: 'teambit.ui-foundation/notifications',\n});\n\nexport default NotificationsAspect;\n"]}
1
+ {"version":3,"names":["NotificationsAspect","Aspect","create","id"],"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;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AAEO,MAAMA,mBAAmB,GAAGC,iBAAA,CAAOC,MAAP,CAAc;EAC/CC,EAAE,EAAE;AAD2C,CAAd,CAA5B;;;eAIQH,mB"}
package/package.json CHANGED
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@teambit/notifications",
3
- "version": "0.0.737",
3
+ "version": "0.0.740",
4
4
  "homepage": "https://bit.dev/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": "0.0.737"
9
+ "version": "0.0.740"
10
10
  },
11
11
  "dependencies": {
12
12
  "uuid": "3.4.0",
@@ -14,9 +14,9 @@
14
14
  "core-js": "^3.0.0",
15
15
  "@teambit/harmony": "0.3.3",
16
16
  "@teambit/ui-foundation.ui.notifications.store": "0.0.486",
17
- "@teambit/ui-foundation.ui.notifications.notification-center": "0.0.495",
17
+ "@teambit/ui-foundation.ui.notifications.notification-center": "0.0.496",
18
18
  "@teambit/ui-foundation.ui.notifications.notification-context": "0.0.487",
19
- "@teambit/ui": "0.0.737"
19
+ "@teambit/ui": "0.0.740"
20
20
  },
21
21
  "devDependencies": {
22
22
  "@types/react": "^17.0.8",
@@ -28,7 +28,7 @@
28
28
  "@types/node": "12.20.4"
29
29
  },
30
30
  "peerDependencies": {
31
- "@teambit/legacy": "1.0.271",
31
+ "@teambit/legacy": "1.0.272",
32
32
  "react-dom": "^16.8.0 || ^17.0.0",
33
33
  "react": "^16.8.0 || ^17.0.0"
34
34
  },
@@ -56,7 +56,7 @@
56
56
  "react": "-"
57
57
  },
58
58
  "peerDependencies": {
59
- "@teambit/legacy": "1.0.271",
59
+ "@teambit/legacy": "1.0.272",
60
60
  "react-dom": "^16.8.0 || ^17.0.0",
61
61
  "react": "^16.8.0 || ^17.0.0"
62
62
  }