flash-notifications 0.0.12 → 0.0.13
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/build/container/index.d.ts +2 -1
- package/build/container/index.d.ts.map +1 -1
- package/build/container/index.js +1 -1
- package/build/container/index.js.map +1 -1
- package/build/container/notification.d.ts +2 -1
- package/build/container/notification.d.ts.map +1 -1
- package/build/container/notification.js +2 -1
- package/build/container/notification.js.map +1 -1
- package/link.sh +5 -0
- package/package.json +1 -1
- package/src/container/index.jsx +1 -1
- package/src/container/notification.jsx +2 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/container/index.jsx"],"names":[],"mappings":""}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/container/index.jsx"],"names":[],"mappings":";;kBAA0B,OAAO"}
|
package/build/container/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/container/index.jsx"],"names":[],"mappings":"AAAA,OAAO,EAAC,IAAI,EAAC,MAAM,OAAO,CAAA;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/container/index.jsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAC,IAAI,EAAC,MAAM,OAAO,CAAA;AACjC,OAAO,EAAC,IAAI,EAAC,MAAM,WAAW,CAAA;AAC9B,OAAO,YAAY,MAAM,gBAAgB,CAAA;AACzC,OAAO,EAAC,cAAc,EAAE,cAAc,EAAC,MAAM,0CAA0C,CAAA;AACvF,OAAO,gBAAgB,MAAM,4CAA4C,CAAA;AACzE,OAAO,EAAC,IAAI,EAAC,MAAM,cAAc,CAAA;AAEjC,eAAe,IAAI,CAAC,cAAc,CAAC,MAAM,2BAA4B,SAAQ,cAAc;IACzF,KAAK;QACH,IAAI,CAAC,SAAS,CAAC;YACb,KAAK,EAAE,CAAC;YACR,aA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AK,EAAE,aAAa,EAAE,IAAI,CAAC,KAAK,CAAC,aAAa,CAAC,MAAM,CAAC,CAAC,YAAY,CAAC,CAAC,EAAC,CAAC,CAAA;IACxF,CAAC,CAAA;IAED,gBAAgB,GAAG,CAAC,YAAY,EAAE,EAAE,CAAC,IAAI,CAAC,kBAAkB,CAAC,IAAI,CAAC,YAAY,EAAE,OAAO,CAAC,CAAC,CAAA;IAEzF,kBAAkB,GAAG,CAAC,KAAK,EAAE,EAAE;QAC7B,IAAI,CAAC,QAAQ,CAAC;YACZ,aAAa,EAAE,IAAI,CAAC,KAAK,CAAC,aAAa,CAAC,MAAM,CAAC,CAAC,YAAY,EAAE,EAAE,CAAC,YAAY,CAAC,KAAK,IAAI,KAAK,CAAC;SAC9F,CAAC,CAAA;IACJ,CAAC,CAAA;CACF,CAAC,CAAC,CAAA","sourcesContent":["import React, {memo} from \"react\"\nimport {digg} from \"diggerize\"\nimport Notification from \"./notification\"\nimport {shapeComponent, ShapeComponent} from \"set-state-compare/src/shape-component.js\"\nimport useEventListener from \"@kaspernj/api-maker/src/use-event-listener\"\nimport {View} from \"react-native\"\n\nexport default memo(shapeComponent(class FlashNotificationsContainer extends ShapeComponent {\n setup() {\n this.useStates({\n count: 0,\n notifications: []\n })\n\n useEventListener(window, \"pushNotification\", this.onPushNotification)\n }\n\n render() {\n return (\n <View\n dataSet={{class: \"flash-notifications-container\"}}\n style={{\n position: \"fixed\",\n zIndex: 99999,\n top: 20,\n right: 20\n }}\n >\n {this.state.notifications.map((notification) =>\n <Notification\n key={`notification-${notification.count}`}\n message={notification.message}\n notification={notification}\n onRemovedClicked={this.onRemovedClicked}\n title={notification.title}\n type={notification.type}\n />\n )}\n </View>\n )\n }\n\n onPushNotification = (event) => {\n const detail = digg(event, \"detail\")\n const count = this.state.count + 1\n\n setTimeout(() => this.removeNotification(count), 4000)\n\n const notification = {\n count,\n message: digg(detail, \"message\"),\n title: digg(detail, \"title\"),\n type: digg(detail, \"type\")\n }\n\n this.setState({count, notifications: this.state.notifications.concat([notification])})\n }\n\n onRemovedClicked = (notification) => this.removeNotification(digg(notification, \"count\"))\n\n removeNotification = (count) => {\n this.setState({\n notifications: this.state.notifications.filter((notification) => notification.count != count)\n })\n }\n}))\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"notification.d.ts","sourceRoot":"","sources":["../../src/container/notification.jsx"],"names":[],"mappings":""}
|
|
1
|
+
{"version":3,"file":"notification.d.ts","sourceRoot":"","sources":["../../src/container/notification.jsx"],"names":[],"mappings":";;kBAC0B,OAAO"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { Pressable, Text, View } from "react-native";
|
|
2
|
-
import { memo } from "react";
|
|
2
|
+
import React, { memo } from "react";
|
|
3
|
+
import classNames from "classnames";
|
|
3
4
|
import PropTypes from "prop-types";
|
|
4
5
|
import PropTypesExact from "prop-types-exact";
|
|
5
6
|
import { shapeComponent, ShapeComponent } from "set-state-compare/src/shape-component.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"notification.js","sourceRoot":"","sources":["../../src/container/notification.jsx"],"names":[],"mappings":"AAAA,OAAO,EAAC,SAAS,EAAE,IAAI,EAAE,IAAI,EAAC,MAAM,cAAc,CAAA;AAClD,OAAO,EAAC,IAAI,EAAC,MAAM,OAAO,CAAA;
|
|
1
|
+
{"version":3,"file":"notification.js","sourceRoot":"","sources":["../../src/container/notification.jsx"],"names":[],"mappings":"AAAA,OAAO,EAAC,SAAS,EAAE,IAAI,EAAE,IAAI,EAAC,MAAM,cAAc,CAAA;AAClD,OAAO,KAAK,EAAE,EAAC,IAAI,EAAC,MAAM,OAAO,CAAA;AACjC,OAAO,UAAU,MAAM,YAAY,CAAA;AACnC,OAAO,SAAS,MAAM,YAAY,CAAA;AAClC,OAAO,cAAc,MAAM,kBAAkB,CAAA;AAC7C,OAAO,EAAC,cAAc,EAAE,cAAc,EAAC,MAAM,0CAA0C,CAAA;AAEvF,eAAe,IAA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EAAE,OAAO,EAAE,IAAI,CAAC,gBAAgB;YAC1H,oBAAC,IAAI,IAAC,KAAK,EAAE,KAAK;gBAChB,oBAAC,IAAI,IAAC,OAAO,EAAE,EAAC,KAAK,EAAE,oBAAoB,EAAC,EAAE,KAAK,EAAE,EAAC,YAAY,EAAE,CAAC,EAAC;oBACpE,oBAAC,IAAI,IAAC,KAAK,EAAE,EAAC,KAAK,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,EAAC,IAC7C,KAAK,CACD,CACF;gBACP,oBAAC,IAAI,IAAC,OAAO,EAAE,EAAC,KAAK,EAAE,sBAAsB,EAAC;oBAC5C,oBAAC,IAAI,IAAC,KAAK,EAAE,EAAC,KAAK,EAAE,MAAM,EAAC,IACzB,OAAO,CACH,CACF,CACF,CACG,CACb,CAAA;IACH,CAAC;IAED,gBAAgB,GAAG,GAAG,EAAE;QACtB,IAAI,CAAC,KAAK,CAAC,gBAAgB,CAAC,IAAI,CAAC,KAAK,CAAC,YAAY,CAAC,CAAA;IACtD,CAAC,CAAA;CACF,CAAC,CAAC,CAAA","sourcesContent":["import {Pressable, Text, View} from \"react-native\"\nimport React, {memo} from \"react\"\nimport classNames from \"classnames\"\nimport PropTypes from \"prop-types\"\nimport PropTypesExact from \"prop-types-exact\"\nimport {shapeComponent, ShapeComponent} from \"set-state-compare/src/shape-component.js\"\n\nexport default memo(shapeComponent(class NotificationsNotification extends ShapeComponent {\n static propTypes = PropTypesExact({\n className: PropTypes.string,\n message: PropTypes.string.isRequired,\n notification: PropTypes.object.isRequired,\n onRemovedClicked: PropTypes.func.isRequired,\n title: PropTypes.string.isRequired,\n type: PropTypes.string.isRequired\n })\n\n render() {\n const {className, message, title, type} = this.props\n\n const style = {\n width: 300,\n maxWidth: \"100%\",\n marginBottom: 15,\n padding: 15,\n borderRadius: 11,\n cursor: \"pointer\"\n }\n\n if (type == \"error\") {\n style.border = \"1px solid rgba(161 34 32 / 95%)\"\n style.background = \"rgba(161 34 32 / 87%)\"\n }\n\n if (type == \"success\") {\n style.border = \"1px solid rgba(0 0 0 / 95%)\"\n style.background = \"rgba(0 0 0 / 87%)\"\n }\n\n\n if (type == \"alert\") {\n style.border = \"1px solid rgba(204 51 0 / 95%)\"\n style.background = \"rgba(204 51 0 / 87%)\"\n }\n\n return (\n <Pressable dataSet={{class: classNames(\"flash-notifications-notification\", className), type}} onPress={this.onRemovedClicked}>\n <View style={style}>\n <View dataSet={{class: \"notification-title\"}} style={{marginBottom: 5}}>\n <Text style={{color: \"#fff\", fontWeight: \"bold\"}}>\n {title}\n </Text>\n </View>\n <View dataSet={{class: \"notification-message\"}}>\n <Text style={{color: \"#fff\"}}>\n {message}\n </Text>\n </View>\n </View>\n </Pressable>\n )\n }\n\n onRemovedClicked = () => {\n this.props.onRemovedClicked(this.props.notification)\n }\n}))\n"]}
|
package/link.sh
ADDED
package/package.json
CHANGED
package/src/container/index.jsx
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import {Pressable, Text, View} from "react-native"
|
|
2
|
-
import {memo} from "react"
|
|
2
|
+
import React, {memo} from "react"
|
|
3
|
+
import classNames from "classnames"
|
|
3
4
|
import PropTypes from "prop-types"
|
|
4
5
|
import PropTypesExact from "prop-types-exact"
|
|
5
6
|
import {shapeComponent, ShapeComponent} from "set-state-compare/src/shape-component.js"
|