@enso-ui/notifications 3.2.8 → 3.2.10
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/LICENSE +1 -1
- package/README.md +74 -13
- package/package.json +2 -2
- package/src/bulma/components/settings/ToastrPosition.vue +23 -15
package/LICENSE
CHANGED
package/README.md
CHANGED
|
@@ -1,28 +1,89 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Notifications
|
|
2
2
|
|
|
3
|
-
](https://github.com/enso-ui/notifications/blob/master/LICENSE)
|
|
4
|
+
[](https://www.npmjs.com/package/@enso-ui/notifications)
|
|
5
|
+
[](https://www.npmjs.com/package/@enso-ui/notifications)
|
|
6
|
+
[](https://vuejs.org/)
|
|
7
|
+
[](https://developer.mozilla.org/docs/Web/JavaScript)
|
|
8
|
+
[](https://sass-lang.com/)
|
|
9
|
+
[](https://www.npmjs.com/package/@enso-ui/notifications)
|
|
10
|
+
[](https://github.com/enso-ui/notifications/issues)
|
|
11
|
+
[](https://github.com/enso-ui/notifications/pulls)
|
|
12
|
+
|
|
13
|
+
## Description
|
|
14
|
+
|
|
15
|
+
Notifications provides the routed notifications page, navbar dropdown, and settings widget used by Enso UI applications.
|
|
16
|
+
|
|
17
|
+
## Installation
|
|
18
|
+
|
|
19
|
+
Install the package:
|
|
20
|
+
|
|
21
|
+
```bash
|
|
22
|
+
yarn add @enso-ui/notifications
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
The package is usually consumed from the full `enso-ui` workspace inside an Enso application.
|
|
26
|
+
|
|
27
|
+
## Features
|
|
28
|
+
|
|
29
|
+
- registers the `/core/notifications/index` page route
|
|
30
|
+
- ships a navbar dropdown that fetches, reads, and marks notifications as read
|
|
31
|
+
- includes a settings widget for toast position selection
|
|
32
|
+
- exports `register.js` to wire navbar and settings items into the host app
|
|
8
33
|
|
|
9
34
|
## Usage
|
|
10
|
-
The component cannot be used outside of the Enso ecosystem.
|
|
11
35
|
|
|
12
|
-
|
|
36
|
+
```js
|
|
37
|
+
import notificationsRoute from '@enso-ui/notifications/src/bulma/routes/notifications.js';
|
|
38
|
+
import registerNotifications from '@enso-ui/notifications/src/bulma/register.js';
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
## API
|
|
42
|
+
|
|
43
|
+
### Route and registration modules
|
|
13
44
|
|
|
14
|
-
|
|
45
|
+
Common imports:
|
|
46
|
+
- `src/bulma/routes/notifications.js`
|
|
47
|
+
- `src/bulma/register.js`
|
|
15
48
|
|
|
16
|
-
###
|
|
49
|
+
### Navbar component
|
|
17
50
|
|
|
18
|
-
|
|
51
|
+
`src/bulma/components/navbar/Notifications.vue`
|
|
52
|
+
- wraps the core renderless notifications controller
|
|
53
|
+
- renders unread count, dropdown items, and mark-all-as-read actions
|
|
54
|
+
|
|
55
|
+
### Settings component
|
|
56
|
+
|
|
57
|
+
`src/bulma/components/settings/ToastrPosition.vue`
|
|
58
|
+
- renders the toastr-position selector through the dropdown package
|
|
59
|
+
- uses the core settings controller to update the preferred position
|
|
60
|
+
|
|
61
|
+
## Routes
|
|
62
|
+
|
|
63
|
+
### `/core/notifications/index`
|
|
64
|
+
|
|
65
|
+
Route name:
|
|
66
|
+
- `core.notifications.index`
|
|
67
|
+
|
|
68
|
+
## Companion Backend Package
|
|
69
|
+
|
|
70
|
+
- [`laravel-enso/notifications`](https://docs.laravel-enso.com/backend/notifications.html) [↗](https://github.com/laravel-enso/notifications)
|
|
71
|
+
|
|
72
|
+
## Depends On
|
|
73
|
+
|
|
74
|
+
- [`@enso-ui/directives`](https://docs.laravel-enso.com/frontend/directives.html) [↗](https://github.com/enso-ui/directives)
|
|
75
|
+
- [`@enso-ui/dropdown`](https://docs.laravel-enso.com/frontend/dropdown.html) [↗](https://github.com/enso-ui/dropdown)
|
|
76
|
+
- [`@enso-ui/toastr`](https://docs.laravel-enso.com/frontend/toastr.html) [↗](https://github.com/enso-ui/toastr)
|
|
77
|
+
- [`@enso-ui/transitions`](https://docs.laravel-enso.com/frontend/transitions.html) [↗](https://github.com/enso-ui/transitions)
|
|
78
|
+
- [`@enso-ui/ui`](https://docs.laravel-enso.com/frontend/ui.html) [↗](https://github.com/enso-ui/ui)
|
|
19
79
|
|
|
20
80
|
## Contributions
|
|
21
81
|
|
|
22
82
|
are welcome. Pull requests are great, but issues are good too.
|
|
23
83
|
|
|
24
|
-
Thank you to all the
|
|
84
|
+
Thank you to all the people who already contributed to Enso!
|
|
25
85
|
|
|
26
86
|
## License
|
|
27
87
|
|
|
28
|
-
[MIT](LICENSE)
|
|
88
|
+
[MIT](https://github.com/enso-ui/notifications/blob/master/LICENSE)
|
|
89
|
+
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@enso-ui/notifications",
|
|
3
|
-
"version": "3.2.
|
|
4
|
-
"description": "
|
|
3
|
+
"version": "3.2.10",
|
|
4
|
+
"description": "Notification center pages and navbar widgets for Enso UI",
|
|
5
5
|
"main": "src/bulma/pages/Index.vue",
|
|
6
6
|
"repository": {
|
|
7
7
|
"type": "git",
|
|
@@ -2,7 +2,9 @@
|
|
|
2
2
|
<div class="level is-mobile">
|
|
3
3
|
<div class="level-left">
|
|
4
4
|
<div class="level-item m-0">
|
|
5
|
-
|
|
5
|
+
<span class="menu-item-label">
|
|
6
|
+
{{ i18n('Notifications') }}
|
|
7
|
+
</span>
|
|
6
8
|
</div>
|
|
7
9
|
</div>
|
|
8
10
|
<div class="level-right">
|
|
@@ -16,7 +18,8 @@
|
|
|
16
18
|
</figure>
|
|
17
19
|
</template>
|
|
18
20
|
<template #items>
|
|
19
|
-
<dropdown-item
|
|
21
|
+
<dropdown-item class="p-2"
|
|
22
|
+
v-for="position in positions"
|
|
20
23
|
:key="position"
|
|
21
24
|
:selected="toastrPosition === position"
|
|
22
25
|
@select="update(position)">
|
|
@@ -48,24 +51,29 @@ export default {
|
|
|
48
51
|
|
|
49
52
|
<style lang="scss">
|
|
50
53
|
.toastr-position {
|
|
51
|
-
.dropdown-trigger .button.input
|
|
52
|
-
|
|
54
|
+
.dropdown-trigger .button.input {
|
|
55
|
+
position: relative;
|
|
53
56
|
}
|
|
54
57
|
|
|
55
|
-
.dropdown-trigger .button.input .
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
width: 0.95rem;
|
|
59
|
-
height: 0.95rem;
|
|
60
|
-
margin: auto;
|
|
61
|
-
object-fit: contain;
|
|
58
|
+
.dropdown-trigger .button.input .dropdown-indicator {
|
|
59
|
+
top: 50%;
|
|
60
|
+
margin-top: -0.6rem;
|
|
62
61
|
}
|
|
63
62
|
|
|
64
|
-
.dropdown
|
|
65
|
-
|
|
63
|
+
.dropdown-menu {
|
|
64
|
+
.dropdown-content {
|
|
65
|
+
min-width: 3.3rem;
|
|
66
|
+
width: 100%;
|
|
66
67
|
|
|
67
|
-
|
|
68
|
-
|
|
68
|
+
.dropdown-item {
|
|
69
|
+
display: flex;
|
|
70
|
+
align-items: center;
|
|
71
|
+
justify-content: center;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
figure {
|
|
75
|
+
margin: 0;
|
|
76
|
+
}
|
|
69
77
|
}
|
|
70
78
|
}
|
|
71
79
|
}
|