{"_id":"@croz/nrich-notification-core","_rev":"13-2ae96054d2adf6fb62f028f5ec0cf2c9","time":{"created":"2022-11-17T15:20:23.210Z","1.0.0":"2022-11-15T12:20:19.328Z","modified":"2024-04-20T15:14:30.191Z","1.0.1":"2022-11-15T13:32:22.458Z","1.0.9":"2022-11-17T15:20:23.481Z","1.1.0":"2023-10-20T12:18:46.655Z","1.1.1":"2023-10-20T13:06:26.778Z","1.1.2":"2024-01-24T08:19:31.969Z","1.1.3":"2024-04-18T11:31:11.721Z","1.1.4":"2024-04-20T15:14:29.945Z"},"name":"@croz/nrich-notification-core","dist-tags":{"latest":"1.1.4"},"versions":{"1.0.9":{"name":"@croz/nrich-notification-core","description":"Contains core utilities related to the nrich-notification module","version":"1.0.9","author":{"name":"CROZ"},"bugs":{"url":"https://github.com/croz-ltd/nrich-frontend/issues"},"dependencies":{"zustand":"^4.1.4"},"devDependencies":{"@croz/nrich-jest-config":"*","@croz/nrich-tsconfig":"*","@croz/nrich-tsup-config":"*","@testing-library/react":"^13.3.0","@testing-library/react-hooks":"^8.0.0","@types/jest":"^28.1.0","axios":"^1.1.3","eslint":"^8.2.0","eslint-config-nrich":"*","jest":"^28.1.0","msw":"^0.48.1","react":"^18.1.0","react-dom":"^18.1.0","tsup":"^6.5.0","whatwg-fetch":"^3.6.2"},"homepage":"https://github.com/croz-ltd/nrich-frontend/tree/master/libs/notification/core#readme","keywords":["croz","nrich","nrich-notification","react","typescript","zustand"],"license":"Apache-2.0","main":"dist/index.js","module":"dist/index.esm.js","peerDependencies":{"react":">=16.8.0","react-dom":">=16.8.0"},"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+https://github.com/croz-ltd/nrich-frontend.git","directory":"libs/notification/core"},"scripts":{"build":"tsup","clean":"rm -rf .turbo && rm -rf dist","lint":"eslint . --ext .ts,.tsx","test":"jest"},"types":"dist/index.d.ts","gitHead":"8636daf98f067ffc5b4385e61ec0650373507719","_id":"@croz/nrich-notification-core@1.0.9","_nodeVersion":"16.14.0","_npmVersion":"8.19.2","dist":{"integrity":"sha512-ZEHqwORfWYYogB4rQkpBbC5NIy053QzwF3KHOHM4f9nuvc5dvDbEHXISmSavgUgURpOnJ5OJFWbB8aNRxEdbCw==","shasum":"140d25571f4a48a409ba9d5d70ae84f311baf15c","tarball":"https://registry.npmjs.org/@croz/nrich-notification-core/-/nrich-notification-core-1.0.9.tgz","fileCount":7,"unpackedSize":32934,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCJBVK1mWJJ3LRlTDt67vreXYBsL3zMDbWdkLF6qGZkPwIhAJ7nlgd1kP3+VInz37qPbzoP+ClypZnqHuk9NDZ5euMm"}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjdlE3ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpyyQ//UF+vj76hdfKqE0q80IeAtNyBCK5WXxtP+sxbGdzdUek/FdZb\r\nTubGpv5ezGGHJY1qVj8uWOwjfmcmmZvMuW6iB5c21kwoX49zp9QoKXA9qiqH\r\nIZr6RmHkVCrvblraXC0xOH+fKB4uF10xIXVcPHRi/Gv62yzGfEw4sr2Zv2qy\r\n4ssc41cJZJ+mz5uT2jLVsY/Jkh1zlmmFtdHZzqxpGP77/AjsyfoRcKdRZ5jq\r\nD9xVUvbiIprMKOshZ5Q2fKOaENSHtbFXzLz/agmRM7La6g5s8LiY+rsj35m8\r\n0Iid4ylDPljjKw4bixb7wBIWERGbYE5SpsLsbwkHZ124FkhrMzksvXX2Fs27\r\nuzRb7go+9IIjTAuVoWKOMoz1dR86y34rDyUC0PmnBGtNYJxuBUBmLhi9NezK\r\nRL9C8ibtdft0GColfzpgoDAg44zKAnlHbJeT0F7jp1RsGN7MPwnrRSZbKeF1\r\n4PxQ/seAaDErQvb2DpgKulSTlKT78wVn6Nzv8eChISwqSnbBgVJ6PM55jEtH\r\nqNoCpZVIeLWbj0/Os/8xJFukYEe3UgG434NIjEOGp5xVXoWeZQfZAd/z7LcU\r\nd2mDsKfO4XAWPxUtvX5nUoFc7vXmDi3HySPDPBNKxmKE/8Pfvd6SRrsKNzI2\r\nysnOwtWeRCGiidy8Ff92RROURv4z4pDsmbY=\r\n=TmOH\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"dmuharemagic","email":"dmuharemagic@croz.net"},"directories":{},"maintainers":[{"name":"dmuharemagic","email":"dmuharemagic@croz.net"},{"name":"jtomic","email":"jtomic@croz.net"},{"name":"ivankrnic","email":"ikrnic@croz.net"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/nrich-notification-core_1.0.9_1668698423293_0.88113945705665"},"_hasShrinkwrap":false},"1.1.0":{"name":"@croz/nrich-notification-core","description":"Contains core utilities related to the nrich-notification module","version":"1.1.0","author":{"name":"CROZ"},"bugs":{"url":"https://github.com/croz-ltd/nrich-frontend/issues"},"dependencies":{"zustand":"^4.1.4"},"devDependencies":{"@croz/nrich-jest-config":"*","@croz/nrich-tsconfig":"*","@croz/nrich-tsup-config":"*","@testing-library/react":"^13.4.0","@types/jest":"^28.1.0","axios":"^1.1.3","eslint":"^8.2.0","eslint-config-nrich":"*","jest":"^28.1.0","msw":"^0.48.1","react":"^18.1.0","react-dom":"^18.1.0","tsup":"^6.5.0","whatwg-fetch":"^3.6.2"},"homepage":"https://github.com/croz-ltd/nrich-frontend/tree/master/libs/notification/core#readme","keywords":["croz","nrich","nrich-notification","react","typescript","zustand"],"license":"Apache-2.0","main":"dist/index.js","module":"dist/index.mjs","peerDependencies":{"react":">=16.8.0","react-dom":">=16.8.0"},"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+https://github.com/croz-ltd/nrich-frontend.git","directory":"libs/notification/core"},"scripts":{"build":"tsup","clean":"rm -rf .turbo && rm -rf dist","lint":"eslint . --ext .ts,.tsx","test":"jest"},"types":"dist/index.d.ts","gitHead":"2d306cb9dca84684c047dad7380de0f4e12febce","_id":"@croz/nrich-notification-core@1.1.0","_nodeVersion":"18.17.1","_npmVersion":"9.6.7","dist":{"integrity":"sha512-0WMo3UKpP9m8vTzho3mXl45MyAIX0V+Pzbngqm2NpQRM2+qCd/EUowMBBoXrefRyoh50sJ+fCVBvwZVtxniMgQ==","shasum":"a6c3968dd9a03e83de20d823371dc754a7faab15","tarball":"https://registry.npmjs.org/@croz/nrich-notification-core/-/nrich-notification-core-1.1.0.tgz","fileCount":7,"unpackedSize":33985,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIGDcUO1KdyVuXx7mcVNN+8+g220lZoHDcV8WgQPvIZmuAiAnZtiT1dDPs4x5QF7pCwhe7EjKoIaZMJXS2Kth0LOXgg=="}]},"_npmUser":{"name":"jtomic","email":"jtomic@croz.net"},"directories":{},"maintainers":[{"name":"dmuharemagic","email":"dmuharemagic@croz.net"},{"name":"jtomic","email":"jtomic@croz.net"},{"name":"ivankrnic","email":"ikrnic@croz.net"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/nrich-notification-core_1.1.0_1697804326223_0.6106218160155763"},"_hasShrinkwrap":false},"1.1.1":{"name":"@croz/nrich-notification-core","description":"Contains core utilities related to the nrich-notification module","version":"1.1.1","author":{"name":"CROZ"},"bugs":{"url":"https://github.com/croz-ltd/nrich-frontend/issues"},"dependencies":{"zustand":"^4.1.4"},"devDependencies":{"@croz/nrich-jest-config":"*","@croz/nrich-tsconfig":"*","@croz/nrich-tsup-config":"*","@testing-library/react":"^13.4.0","@types/jest":"^28.1.0","axios":"^1.1.3","eslint":"^8.2.0","eslint-config-nrich":"*","jest":"^28.1.0","msw":"^0.48.1","react":"^18.1.0","react-dom":"^18.1.0","tsup":"^6.5.0","whatwg-fetch":"^3.6.2"},"homepage":"https://github.com/croz-ltd/nrich-frontend/tree/master/libs/notification/core#readme","keywords":["croz","nrich","nrich-notification","react","typescript","zustand"],"license":"Apache-2.0","main":"dist/index.js","module":"dist/index.mjs","peerDependencies":{"react":">=16.8.0","react-dom":">=16.8.0"},"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+https://github.com/croz-ltd/nrich-frontend.git","directory":"libs/notification/core"},"scripts":{"build":"tsup","clean":"rm -rf .turbo && rm -rf dist","lint":"eslint . --ext .ts,.tsx","test":"jest"},"types":"dist/index.d.ts","_id":"@croz/nrich-notification-core@1.1.1","gitHead":"de4ecdf1c7e6115cd0b414dbb9d46f3af1634178","_nodeVersion":"18.18.2","_npmVersion":"9.8.1","dist":{"integrity":"sha512-eHAXVPhM2LPz+D/8umbEmX37x9m5acOLNPiVlUXP6T3q6jTMOymBWwuKxwOQhytHx/zmyAb+QGUapWV+rVxB9w==","shasum":"cb9049cb9c6f875d9c16b90e2cdc337626bb8150","tarball":"https://registry.npmjs.org/@croz/nrich-notification-core/-/nrich-notification-core-1.1.1.tgz","fileCount":7,"unpackedSize":32885,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIAd+k3EnL6PrO0JJwRE9JlAYY4ZTUyuvbf3k25gcEx0LAiACVH/jP00y67mYOPVAN1r5zJtuHwGTMWezc5o5uI9B+w=="}]},"_npmUser":{"name":"dmuharemagic","email":"dmuharemagic@croz.net"},"directories":{},"maintainers":[{"name":"dmuharemagic","email":"dmuharemagic@croz.net"},{"name":"jtomic","email":"jtomic@croz.net"},{"name":"ivankrnic","email":"ikrnic@croz.net"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/nrich-notification-core_1.1.1_1697807186564_0.9493877902464749"},"_hasShrinkwrap":false},"1.1.2":{"name":"@croz/nrich-notification-core","description":"Contains core utilities related to the nrich-notification module","version":"1.1.2","author":{"name":"CROZ"},"bugs":{"url":"https://github.com/croz-ltd/nrich-frontend/issues"},"dependencies":{"zustand":"^4.4.7"},"devDependencies":{"@croz/nrich-jest-config":"*","@croz/nrich-tsconfig":"*","@croz/nrich-tsup-config":"*","@testing-library/react":"^13.4.0","@types/jest":"^28.1.0","axios":"^1.1.3","eslint":"^8.2.0","eslint-config-nrich":"*","jest":"^28.1.0","msw":"^0.48.1","react":"^18.1.0","react-dom":"^18.1.0","tsup":"^6.5.0","whatwg-fetch":"^3.6.2"},"homepage":"https://github.com/croz-ltd/nrich-frontend/tree/master/libs/notification/core#readme","keywords":["croz","nrich","nrich-notification","react","typescript","zustand"],"license":"Apache-2.0","main":"dist/index.js","module":"dist/index.mjs","peerDependencies":{"react":">=16.8.0","react-dom":">=16.8.0"},"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+https://github.com/croz-ltd/nrich-frontend.git","directory":"libs/notification/core"},"scripts":{"build":"tsup","clean":"rm -rf .turbo && rm -rf dist","lint":"eslint . --ext .ts,.tsx","test":"jest"},"types":"dist/index.d.ts","_id":"@croz/nrich-notification-core@1.1.2","gitHead":"8dd3c3ca6265480fb8bce985e42490f046d22982","_nodeVersion":"20.10.0","_npmVersion":"10.2.3","dist":{"integrity":"sha512-zYn0MELbfbIB41NH7npb3SgXRXoicl9cxfj6AuJh2pPs8qTcCjlsLUcpDO2ENQt1bEhPv+8Ve/OlDA/ei4h+Qw==","shasum":"c23e99627e3568f13bedf22e6ea4f2fe1df21bc2","tarball":"https://registry.npmjs.org/@croz/nrich-notification-core/-/nrich-notification-core-1.1.2.tgz","fileCount":7,"unpackedSize":32961,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIFKGgjrb/EscD/GcI3GCEaaKJc+d+OVJyhfJJYfcgYsYAiEAnUFkhV8onHRua8FAORp/9kCUOY2K15LzffsDWi+d/zs="}]},"_npmUser":{"name":"jtomic","email":"jtomic@croz.net"},"directories":{},"maintainers":[{"name":"jtomic","email":"jtomic@croz.net"},{"name":"ivankrnic","email":"ikrnic@croz.net"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/nrich-notification-core_1.1.2_1706084371794_0.23825120476642647"},"_hasShrinkwrap":false},"1.1.3":{"name":"@croz/nrich-notification-core","description":"Contains core utilities related to the nrich-notification module","version":"1.1.3","author":{"name":"CROZ"},"bugs":{"url":"https://github.com/croz-ltd/nrich-frontend/issues"},"dependencies":{"zustand":"^4.4.7"},"devDependencies":{"@croz/nrich-jest-config":"*","@croz/nrich-tsconfig":"*","@croz/nrich-tsup-config":"*","@testing-library/react":"^13.4.0","@types/jest":"^28.1.0","axios":"^1.1.3","eslint":"^8.2.0","eslint-config-nrich":"*","jest":"^28.1.0","msw":"^0.48.1","react":"^18.1.0","react-dom":"^18.1.0","tsup":"^6.5.0","whatwg-fetch":"^3.6.2"},"homepage":"https://github.com/croz-ltd/nrich-frontend/tree/master/libs/notification/core#readme","keywords":["croz","nrich","nrich-notification","react","typescript","zustand"],"license":"Apache-2.0","main":"dist/index.js","module":"dist/index.mjs","peerDependencies":{"react":">=16.8.0","react-dom":">=16.8.0"},"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+https://github.com/croz-ltd/nrich-frontend.git","directory":"libs/notification/core"},"scripts":{"build":"tsup","clean":"rm -rf .turbo && rm -rf dist","lint":"eslint . --ext .ts,.tsx","test":"jest"},"types":"dist/index.d.ts","_id":"@croz/nrich-notification-core@1.1.3","gitHead":"3f6eca88141f80864adc236acae052c2855aebe8","_nodeVersion":"20.12.2","_npmVersion":"10.5.0","dist":{"integrity":"sha512-vwywTUn42cvIO2b1maSuYGmVQvA88iXgYycP4fyl6ddnGUYu0eyPqYSjxX1vBLBHklxmOwmAyA2RLhTx2xB5Tg==","shasum":"9f32ff20d6bed335e1cb5ebe42f70baec9b37bb1","tarball":"https://registry.npmjs.org/@croz/nrich-notification-core/-/nrich-notification-core-1.1.3.tgz","fileCount":7,"unpackedSize":33806,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIGrEpi4QRvSxBtQK90uVIIND6zwj3TzVkKrMnapBLXtOAiEAkTU30c7QDW8U71T8uMNskegsSO2VqGKy+HxnPcJAQDw="}]},"_npmUser":{"name":"jtomic","email":"jtomic@croz.net"},"directories":{},"maintainers":[{"name":"djajcevic","email":"denis.jajcevic+npmjs@gmail.com"},{"name":"jtomic","email":"jtomic@croz.net"},{"name":"ivankrnic","email":"ikrnic@croz.net"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/nrich-notification-core_1.1.3_1713439871576_0.26012737316384227"},"_hasShrinkwrap":false},"1.1.4":{"name":"@croz/nrich-notification-core","description":"Contains core utilities related to the nrich-notification module","version":"1.1.4","author":{"name":"CROZ"},"bugs":{"url":"https://github.com/croz-ltd/nrich-frontend/issues"},"dependencies":{"zustand":"^4.4.7"},"devDependencies":{"@croz/nrich-jest-config":"*","@croz/nrich-tsconfig":"*","@croz/nrich-tsup-config":"*","@testing-library/react":"^13.4.0","@types/jest":"^28.1.0","axios":"^1.1.3","eslint":"^8.2.0","eslint-config-nrich":"*","jest":"^28.1.0","msw":"^0.48.1","react":"^18.1.0","react-dom":"^18.1.0","tsup":"^6.5.0","whatwg-fetch":"^3.6.2"},"homepage":"https://github.com/croz-ltd/nrich-frontend/tree/master/libs/notification/core#readme","keywords":["croz","nrich","nrich-notification","react","typescript","zustand"],"license":"Apache-2.0","main":"dist/index.js","module":"dist/index.mjs","peerDependencies":{"react":">=16.8.0","react-dom":">=16.8.0"},"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+https://github.com/croz-ltd/nrich-frontend.git","directory":"libs/notification/core"},"scripts":{"build":"tsup","clean":"rm -rf .turbo && rm -rf dist","lint":"eslint . --ext .ts,.tsx","test":"jest"},"types":"dist/index.d.ts","_id":"@croz/nrich-notification-core@1.1.4","gitHead":"387a21c1d52f35c567de01a9cbcfb823954295f6","_nodeVersion":"20.12.2","_npmVersion":"10.5.0","dist":{"integrity":"sha512-omAzJss2ZVuYwzW+2pzvelRlnMwX0r1dE3gARQOKqkij2ZIjBZjdKRP53WIvIWz8e49Uj6rAnGX7v6mDHUQIew==","shasum":"b68e0052995965f99da536d3ef0f58266710b172","tarball":"https://registry.npmjs.org/@croz/nrich-notification-core/-/nrich-notification-core-1.1.4.tgz","fileCount":7,"unpackedSize":34252,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQClvQEsp+xkZYIj5QzRgMyHSxEliKMF7vE/4TKvwwxuvAIhANUdWZz2+Qn9vVF4ArudjsOChFqzNBEt/PwporYNYXjL"}]},"_npmUser":{"name":"jtomic","email":"jtomic@croz.net"},"directories":{},"maintainers":[{"name":"djajcevic","email":"denis.jajcevic+npmjs@gmail.com"},{"name":"jtomic","email":"jtomic@croz.net"},{"name":"ivankrnic","email":"ikrnic@croz.net"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/nrich-notification-core_1.1.4_1713626069782_0.1027705542886046"},"_hasShrinkwrap":false}},"maintainers":[{"name":"djajcevic","email":"denis.jajcevic+npmjs@gmail.com"},{"name":"jtomic","email":"jtomic@croz.net"},{"name":"ivankrnic","email":"ikrnic@croz.net"}],"description":"Contains core utilities related to the nrich-notification module","homepage":"https://github.com/croz-ltd/nrich-frontend/tree/master/libs/notification/core#readme","keywords":["croz","nrich","nrich-notification","react","typescript","zustand"],"repository":{"type":"git","url":"git+https://github.com/croz-ltd/nrich-frontend.git","directory":"libs/notification/core"},"author":{"name":"CROZ"},"bugs":{"url":"https://github.com/croz-ltd/nrich-frontend/issues"},"license":"Apache-2.0","readme":"# @croz/nrich-notification-core\n\n## Overview\n\n`@croz/nrich-notification-core` is a module that is designed for showing automatic messages from the backend on the user interface.\nIt's the frontend part of [nrich-notification](https://github.com/croz-ltd/nrich/tree/master/nrich-notification) backend module.\n\nInternally, it intercepts http calls and scans for sign of nrich notification object, and shows the notification if it exists.\n\n## Setup\n\nTo use this module in your project run `npm install @croz/nrich-notification-core` or `yarn add @croz/nrich-notification-core`\n\n## Usage\n\n1. On the top level of your app, register an appropriate interceptor for notifications.\n   - If you use fetch API or a lib that uses fetch internally, use `fetchNotificationInterceptor()`.\n   - If you use a lib that uses `XMLHttpRequest`, e.g. `axios`, use `xhrNotificationInterceptor()`.\n\n2. Using the `useNotification()` custom hook you get an object containing `notifications` array and `remove` and `add` methods for working with that array. Alternatively, you can use the standalone `removeNotification` and `addNotification` methods if the hook variant is not fit for your use-case.\n\nExample:\n\n```tsx\nimport { useNotifications } from \"@croz/nrich-notification-core\";\n\nconst Notification = ({ title, content, onRemove }) => (\n  <div>\n    <h3>{title}</h3>\n    <div>{content}</div>\n    <button onClick={onRemove}>×</button>\n  </div>\n)\n\nexport const Notifications = () => {\n  const { notifications, remove } = useNotifications();\n\n  return (\n    <div>\n      {notifications.map(notification => <Notification {...notification} onRemove={() => remove(notification)}/>)}\n    </div>\n  )\n}\n```\n\nIf you're using this module alone, you need to provide your own notification UI. For the prepared implementation in MUI, see [@croz/nrich-notification-mui](../mui/README.md) docs\n","readmeFilename":"README.md"}