@hamak/notification 0.5.2 → 0.5.6
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/api/index.d.ts +3 -3
- package/dist/api/index.js +3 -3
- package/dist/api/interfaces/index.d.ts +1 -1
- package/dist/api/interfaces/notification-service.d.ts +1 -1
- package/dist/api/tokens/index.d.ts +1 -1
- package/dist/api/tokens/index.js +1 -1
- package/dist/api/types/index.d.ts +1 -1
- package/dist/impl/core/index.d.ts +1 -1
- package/dist/impl/core/index.js +1 -1
- package/dist/impl/core/notification-service.d.ts +2 -2
- package/dist/impl/core/notification-service.d.ts.map +1 -1
- package/dist/impl/core/notification-service.js +5 -1
- package/dist/impl/index.d.ts +7 -7
- package/dist/impl/index.js +5 -5
- package/dist/impl/plugin/index.d.ts +1 -1
- package/dist/impl/plugin/index.js +1 -1
- package/dist/impl/plugin/notification-plugin-factory.d.ts +18 -4
- package/dist/impl/plugin/notification-plugin-factory.d.ts.map +1 -1
- package/dist/impl/plugin/notification-plugin-factory.js +41 -20
- package/dist/impl/store/index.d.ts +2 -2
- package/dist/impl/store/index.js +2 -2
- package/dist/impl/store/notification-actions.d.ts +1 -1
- package/dist/impl/store/notification-reducer.d.ts +2 -2
- package/dist/impl/store/notification-reducer.js +1 -1
- package/dist/impl/utils/index.d.ts +1 -1
- package/dist/impl/utils/index.js +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/spi/events/index.d.ts +1 -1
- package/dist/spi/events/notification-events.d.ts +1 -1
- package/dist/spi/index.d.ts +4 -4
- package/dist/spi/index.js +3 -3
- package/dist/spi/plugin/index.d.ts +2 -2
- package/dist/spi/plugin/plugin-config.d.ts +22 -0
- package/dist/spi/plugin/plugin-config.d.ts.map +1 -1
- package/package.json +2 -2
package/dist/api/index.d.ts
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
*
|
|
7
7
|
* @packageDocumentation
|
|
8
8
|
*/
|
|
9
|
-
export * from './interfaces/index';
|
|
10
|
-
export * from './types/index';
|
|
11
|
-
export * from './tokens/index';
|
|
9
|
+
export * from './interfaces/index.js';
|
|
10
|
+
export * from './types/index.js';
|
|
11
|
+
export * from './tokens/index.js';
|
|
12
12
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/api/index.js
CHANGED
|
@@ -7,8 +7,8 @@
|
|
|
7
7
|
* @packageDocumentation
|
|
8
8
|
*/
|
|
9
9
|
// Export all API interfaces
|
|
10
|
-
export * from './interfaces/index';
|
|
10
|
+
export * from './interfaces/index.js';
|
|
11
11
|
// Export all types
|
|
12
|
-
export * from './types/index';
|
|
12
|
+
export * from './types/index.js';
|
|
13
13
|
// Export service tokens
|
|
14
|
-
export * from './tokens/index';
|
|
14
|
+
export * from './tokens/index.js';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* API interfaces for notification service
|
|
3
3
|
*/
|
|
4
|
-
export type { INotificationService, NotificationListener, } from './notification-service';
|
|
4
|
+
export type { INotificationService, NotificationListener, } from './notification-service.js';
|
|
5
5
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Service tokens for notification system
|
|
3
3
|
*/
|
|
4
|
-
export { NOTIFICATION_SERVICE_TOKEN, type NotificationServiceToken, } from './service-tokens';
|
|
4
|
+
export { NOTIFICATION_SERVICE_TOKEN, type NotificationServiceToken, } from './service-tokens.js';
|
|
5
5
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/api/tokens/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Type definitions for notifications
|
|
3
3
|
*/
|
|
4
|
-
export type { INotification, NotificationType, NotificationOptions, } from './notification';
|
|
4
|
+
export type { INotification, NotificationType, NotificationOptions, } from './notification.js';
|
|
5
5
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/impl/core/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type { INotification, INotificationService, NotificationListener, NotificationOptions } from '../../api/index';
|
|
1
|
+
import type { INotification, INotificationService, NotificationListener, NotificationOptions } from '../../api/index.js';
|
|
2
2
|
import type { ILogger } from '@hamak/logging/api';
|
|
3
|
-
import type { NotificationPluginConfig } from '../../spi/index';
|
|
3
|
+
import type { NotificationPluginConfig } from '../../spi/index.js';
|
|
4
4
|
/**
|
|
5
5
|
* Core implementation of the notification service
|
|
6
6
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"notification-service.d.ts","sourceRoot":"","sources":["../../../src/impl/core/notification-service.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,aAAa,EACb,oBAAoB,EACpB,oBAAoB,EACpB,mBAAmB,EACpB,MAAM,iBAAiB,CAAC;AACzB,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,iBAAiB,CAAC;
|
|
1
|
+
{"version":3,"file":"notification-service.d.ts","sourceRoot":"","sources":["../../../src/impl/core/notification-service.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,aAAa,EACb,oBAAoB,EACpB,oBAAoB,EACpB,mBAAmB,EACpB,MAAM,iBAAiB,CAAC;AACzB,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,iBAAiB,CAAC;AAkBhE;;GAEG;AACH,qBAAa,mBAAoB,YAAW,oBAAoB;IAC9D,OAAO,CAAC,aAAa,CAAuB;IAC5C,OAAO,CAAC,SAAS,CAAwC;IACzD,OAAO,CAAC,MAAM,CAAqC;IACnD,OAAO,CAAC,MAAM,CAAU;IACxB,OAAO,CAAC,MAAM,CAAmD;gBAErD,MAAM,EAAE,wBAAwB,EAAE,MAAM,EAAE,OAAO;IAkB7D;;OAEG;IACH,MAAM,CAAC,YAAY,EAAE,IAAI,CAAC,aAAa,EAAE,IAAI,GAAG,WAAW,CAAC,GAAG,MAAM;IA2CrE;;OAEG;IACH,IAAI,CAAC,OAAO,EAAE,MAAM,EAAE,KAAK,GAAE,MAAe,EAAE,OAAO,CAAC,EAAE,mBAAmB,GAAG,MAAM;IASpF;;OAEG;IACH,OAAO,CAAC,OAAO,EAAE,MAAM,EAAE,KAAK,GAAE,MAAkB,EAAE,OAAO,CAAC,EAAE,mBAAmB,GAAG,MAAM;IAS1F;;OAEG;IACH,OAAO,CAAC,OAAO,EAAE,MAAM,EAAE,KAAK,GAAE,MAAkB,EAAE,OAAO,CAAC,EAAE,mBAAmB,GAAG,MAAM;IAS1F;;OAEG;IACH,KAAK,CAAC,OAAO,EAAE,MAAM,EAAE,KAAK,GAAE,MAAgB,EAAE,OAAO,CAAC,EAAE,mBAAmB,GAAG,MAAM;IAUtF;;OAEG;IACH,OAAO,CAAC,EAAE,EAAE,MAAM,GAAG,IAAI;IAgBzB;;OAEG;IACH,UAAU,IAAI,IAAI;IAiBlB;;OAEG;IACH,MAAM,IAAI,aAAa,EAAE;IAIzB;;OAEG;IACH,SAAS,CAAC,QAAQ,EAAE,oBAAoB,GAAG,MAAM,IAAI;IAWrD;;OAEG;IACH,OAAO,IAAI,IAAI;IAQf;;OAEG;IACH,OAAO,CAAC,gBAAgB;IAQxB;;OAEG;IACH,OAAO,CAAC,UAAU;IAQlB;;OAEG;IACH,OAAO,CAAC,eAAe;IAWvB;;OAEG;IACH,OAAO,CAAC,aAAa;IAUrB;;OAEG;IACH,OAAO,CAAC,eAAe;CAkBxB"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { generateNotificationId } from '../utils/id-generator';
|
|
1
|
+
import { generateNotificationId } from '../utils/id-generator.js';
|
|
2
2
|
/**
|
|
3
3
|
* Default configuration values
|
|
4
4
|
*/
|
|
@@ -8,6 +8,10 @@ const DEFAULT_CONFIG = {
|
|
|
8
8
|
position: 'top-right',
|
|
9
9
|
enableSound: false,
|
|
10
10
|
enablePersistence: false,
|
|
11
|
+
// Auto-register a `notifications` Redux reducer when @hamak/ui-store is
|
|
12
|
+
// present in DI; see NotificationPluginConfig.registerReducer for the
|
|
13
|
+
// documented contract.
|
|
14
|
+
registerReducer: true,
|
|
11
15
|
};
|
|
12
16
|
/**
|
|
13
17
|
* Core implementation of the notification service
|
package/dist/impl/index.d.ts
CHANGED
|
@@ -6,11 +6,11 @@
|
|
|
6
6
|
*
|
|
7
7
|
* @packageDocumentation
|
|
8
8
|
*/
|
|
9
|
-
export * from './core/index';
|
|
10
|
-
export * from './plugin/index';
|
|
11
|
-
export * from './store/index';
|
|
12
|
-
export * from './utils/index';
|
|
13
|
-
export type { INotification, INotificationService, NotificationType, NotificationOptions, NotificationListener, } from '../api/index';
|
|
14
|
-
export { NOTIFICATION_SERVICE_TOKEN } from '../api/index';
|
|
15
|
-
export type { NotificationPluginConfig, NotificationPosition, NotificationPluginModule, NotificationEvents, } from '../spi/index';
|
|
9
|
+
export * from './core/index.js';
|
|
10
|
+
export * from './plugin/index.js';
|
|
11
|
+
export * from './store/index.js';
|
|
12
|
+
export * from './utils/index.js';
|
|
13
|
+
export type { INotification, INotificationService, NotificationType, NotificationOptions, NotificationListener, } from '../api/index.js';
|
|
14
|
+
export { NOTIFICATION_SERVICE_TOKEN } from '../api/index.js';
|
|
15
|
+
export type { NotificationPluginConfig, NotificationPosition, NotificationPluginModule, NotificationEvents, } from '../spi/index.js';
|
|
16
16
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/impl/index.js
CHANGED
|
@@ -7,11 +7,11 @@
|
|
|
7
7
|
* @packageDocumentation
|
|
8
8
|
*/
|
|
9
9
|
// Export core implementation
|
|
10
|
-
export * from './core/index';
|
|
10
|
+
export * from './core/index.js';
|
|
11
11
|
// Export plugin factory
|
|
12
|
-
export * from './plugin/index';
|
|
12
|
+
export * from './plugin/index.js';
|
|
13
13
|
// Export store integration
|
|
14
|
-
export * from './store/index';
|
|
14
|
+
export * from './store/index.js';
|
|
15
15
|
// Export utilities
|
|
16
|
-
export * from './utils/index';
|
|
17
|
-
export { NOTIFICATION_SERVICE_TOKEN } from '../api/index';
|
|
16
|
+
export * from './utils/index.js';
|
|
17
|
+
export { NOTIFICATION_SERVICE_TOKEN } from '../api/index.js';
|
|
@@ -1,20 +1,34 @@
|
|
|
1
1
|
import type { PluginModule } from '@hamak/microkernel-spi';
|
|
2
|
-
import type { NotificationPluginConfig } from '../../spi/index';
|
|
2
|
+
import type { NotificationPluginConfig } from '../../spi/index.js';
|
|
3
3
|
/**
|
|
4
|
-
* Create a notification plugin for the microkernel
|
|
4
|
+
* Create a notification plugin for the microkernel.
|
|
5
|
+
*
|
|
6
|
+
* ## Side effect on Redux state shape
|
|
7
|
+
*
|
|
8
|
+
* If `@hamak/ui-store` is present in the DI container at `initialize` time
|
|
9
|
+
* and `config.registerReducer` is not explicitly set to `false`, this plugin
|
|
10
|
+
* registers a `notifications` reducer with `STORE_EXTENSIONS_TOKEN`. That
|
|
11
|
+
* widens the host's Redux `RootState` to include `state.notifications`
|
|
12
|
+
* mirroring the in-memory `NotificationService` state. Pass
|
|
13
|
+
* `registerReducer: false` to opt out — useful for hosts that want their
|
|
14
|
+
* Redux slices managed explicitly. The in-memory service is authoritative
|
|
15
|
+
* either way; the reducer is a read-side mirror.
|
|
5
16
|
*
|
|
6
17
|
* @param config - Configuration options for the notification plugin
|
|
7
18
|
* @returns A plugin module ready to be registered with the host
|
|
8
19
|
*
|
|
9
20
|
* @example
|
|
10
21
|
* ```typescript
|
|
11
|
-
* import { createNotificationPlugin } from '@hamak/notification
|
|
22
|
+
* import { createNotificationPlugin } from '@hamak/notification';
|
|
12
23
|
*
|
|
13
24
|
* const notificationPlugin = createNotificationPlugin({
|
|
14
25
|
* maxNotifications: 100,
|
|
15
26
|
* defaultDuration: 3000,
|
|
16
27
|
* position: 'top-right',
|
|
17
|
-
* enablePersistence: true
|
|
28
|
+
* enablePersistence: true,
|
|
29
|
+
* // registerReducer defaults to true — pass false to skip the
|
|
30
|
+
* // Redux integration even when @hamak/ui-store is loaded.
|
|
31
|
+
* registerReducer: false,
|
|
18
32
|
* });
|
|
19
33
|
*
|
|
20
34
|
* const host = new Host();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"notification-plugin-factory.d.ts","sourceRoot":"","sources":["../../../src/impl/plugin/notification-plugin-factory.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAyB,MAAM,wBAAwB,CAAC;AAIlF,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,iBAAiB,CAAC;AAMhE
|
|
1
|
+
{"version":3,"file":"notification-plugin-factory.d.ts","sourceRoot":"","sources":["../../../src/impl/plugin/notification-plugin-factory.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAyB,MAAM,wBAAwB,CAAC;AAIlF,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,iBAAiB,CAAC;AAMhE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmCG;AACH,wBAAgB,wBAAwB,CACtC,MAAM,GAAE,wBAA6B,GACpC,YAAY,CAuHd"}
|
|
@@ -1,22 +1,36 @@
|
|
|
1
1
|
import { LOG_MANAGER_TOKEN } from '@hamak/logging/api';
|
|
2
|
-
import { NOTIFICATION_SERVICE_TOKEN } from '../../api/index';
|
|
3
|
-
import { NotificationService } from '../core/notification-service';
|
|
4
|
-
import { notificationReducer } from '../store/notification-reducer';
|
|
2
|
+
import { NOTIFICATION_SERVICE_TOKEN } from '../../api/index.js';
|
|
3
|
+
import { NotificationService } from '../core/notification-service.js';
|
|
4
|
+
import { notificationReducer } from '../store/notification-reducer.js';
|
|
5
5
|
/**
|
|
6
|
-
* Create a notification plugin for the microkernel
|
|
6
|
+
* Create a notification plugin for the microkernel.
|
|
7
|
+
*
|
|
8
|
+
* ## Side effect on Redux state shape
|
|
9
|
+
*
|
|
10
|
+
* If `@hamak/ui-store` is present in the DI container at `initialize` time
|
|
11
|
+
* and `config.registerReducer` is not explicitly set to `false`, this plugin
|
|
12
|
+
* registers a `notifications` reducer with `STORE_EXTENSIONS_TOKEN`. That
|
|
13
|
+
* widens the host's Redux `RootState` to include `state.notifications`
|
|
14
|
+
* mirroring the in-memory `NotificationService` state. Pass
|
|
15
|
+
* `registerReducer: false` to opt out — useful for hosts that want their
|
|
16
|
+
* Redux slices managed explicitly. The in-memory service is authoritative
|
|
17
|
+
* either way; the reducer is a read-side mirror.
|
|
7
18
|
*
|
|
8
19
|
* @param config - Configuration options for the notification plugin
|
|
9
20
|
* @returns A plugin module ready to be registered with the host
|
|
10
21
|
*
|
|
11
22
|
* @example
|
|
12
23
|
* ```typescript
|
|
13
|
-
* import { createNotificationPlugin } from '@hamak/notification
|
|
24
|
+
* import { createNotificationPlugin } from '@hamak/notification';
|
|
14
25
|
*
|
|
15
26
|
* const notificationPlugin = createNotificationPlugin({
|
|
16
27
|
* maxNotifications: 100,
|
|
17
28
|
* defaultDuration: 3000,
|
|
18
29
|
* position: 'top-right',
|
|
19
|
-
* enablePersistence: true
|
|
30
|
+
* enablePersistence: true,
|
|
31
|
+
* // registerReducer defaults to true — pass false to skip the
|
|
32
|
+
* // Redux integration even when @hamak/ui-store is loaded.
|
|
33
|
+
* registerReducer: false,
|
|
20
34
|
* });
|
|
21
35
|
*
|
|
22
36
|
* const host = new Host();
|
|
@@ -36,22 +50,29 @@ export function createNotificationPlugin(config = {}) {
|
|
|
36
50
|
notificationService = new NotificationService(config, logger);
|
|
37
51
|
// Register service in DI container
|
|
38
52
|
ctx.provide({ provide: NOTIFICATION_SERVICE_TOKEN, useValue: notificationService });
|
|
39
|
-
// Register store reducer if ui-store is available
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
53
|
+
// Register store reducer if ui-store is available and the consumer
|
|
54
|
+
// has not opted out via `config.registerReducer = false`.
|
|
55
|
+
// Documented in NotificationPluginConfig.registerReducer (default true).
|
|
56
|
+
if (config.registerReducer !== false) {
|
|
57
|
+
try {
|
|
58
|
+
// Try to resolve STORE_EXTENSIONS_TOKEN (optional dependency)
|
|
59
|
+
const STORE_EXTENSIONS_TOKEN = Symbol.for('@hamak/ui-store:StoreExtensionsRegistry');
|
|
60
|
+
const storeExtensions = ctx.resolve(STORE_EXTENSIONS_TOKEN);
|
|
61
|
+
if (storeExtensions && typeof storeExtensions.register === 'function') {
|
|
62
|
+
storeExtensions.register('notification', {
|
|
63
|
+
reducers: {
|
|
64
|
+
notifications: notificationReducer,
|
|
65
|
+
},
|
|
66
|
+
});
|
|
67
|
+
logger.debug('Notification reducer registered with store');
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
catch (error) {
|
|
71
|
+
logger.debug('Store not available, skipping reducer registration', { message: error instanceof Error ? error.message : String(error) });
|
|
51
72
|
}
|
|
52
73
|
}
|
|
53
|
-
|
|
54
|
-
logger.debug('
|
|
74
|
+
else {
|
|
75
|
+
logger.debug('Notification reducer registration disabled by config.registerReducer = false');
|
|
55
76
|
}
|
|
56
77
|
// Register commands
|
|
57
78
|
ctx.commands.register('notification.show', (args) => {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Redux store integration
|
|
3
3
|
*/
|
|
4
|
-
export { notificationReducer, type NotificationState } from './notification-reducer';
|
|
5
|
-
export { NOTIFICATION_ACTIONS, addNotification, dismissNotification, dismissAllNotifications, markNotificationsRead, setAllNotifications, type NotificationAction, } from './notification-actions';
|
|
4
|
+
export { notificationReducer, type NotificationState } from './notification-reducer.js';
|
|
5
|
+
export { NOTIFICATION_ACTIONS, addNotification, dismissNotification, dismissAllNotifications, markNotificationsRead, setAllNotifications, type NotificationAction, } from './notification-actions.js';
|
|
6
6
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/impl/store/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Redux store integration
|
|
3
3
|
*/
|
|
4
|
-
export { notificationReducer } from './notification-reducer';
|
|
5
|
-
export { NOTIFICATION_ACTIONS, addNotification, dismissNotification, dismissAllNotifications, markNotificationsRead, setAllNotifications, } from './notification-actions';
|
|
4
|
+
export { notificationReducer } from './notification-reducer.js';
|
|
5
|
+
export { NOTIFICATION_ACTIONS, addNotification, dismissNotification, dismissAllNotifications, markNotificationsRead, setAllNotifications, } from './notification-actions.js';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { INotification } from '../../api/index';
|
|
2
|
-
import { type NotificationAction } from './notification-actions';
|
|
1
|
+
import type { INotification } from '../../api/index.js';
|
|
2
|
+
import { type NotificationAction } from './notification-actions.js';
|
|
3
3
|
/**
|
|
4
4
|
* State shape for notifications in Redux store
|
|
5
5
|
*/
|
package/dist/impl/utils/index.js
CHANGED
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Event types for notification system
|
|
3
3
|
*/
|
|
4
|
-
export type { NotificationEvents, NotificationEventName, NotificationEventPayload, } from './notification-events';
|
|
4
|
+
export type { NotificationEvents, NotificationEventName, NotificationEventPayload, } from './notification-events.js';
|
|
5
5
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/spi/index.d.ts
CHANGED
|
@@ -6,8 +6,8 @@
|
|
|
6
6
|
*
|
|
7
7
|
* @packageDocumentation
|
|
8
8
|
*/
|
|
9
|
-
export * from './plugin/index';
|
|
10
|
-
export * from './events/index';
|
|
11
|
-
export type { INotification, INotificationService, NotificationType, NotificationOptions, NotificationListener, } from '../api/index';
|
|
12
|
-
export { NOTIFICATION_SERVICE_TOKEN } from '../api/index';
|
|
9
|
+
export * from './plugin/index.js';
|
|
10
|
+
export * from './events/index.js';
|
|
11
|
+
export type { INotification, INotificationService, NotificationType, NotificationOptions, NotificationListener, } from '../api/index.js';
|
|
12
|
+
export { NOTIFICATION_SERVICE_TOKEN } from '../api/index.js';
|
|
13
13
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/spi/index.js
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
* @packageDocumentation
|
|
8
8
|
*/
|
|
9
9
|
// Export plugin configuration
|
|
10
|
-
export * from './plugin/index';
|
|
10
|
+
export * from './plugin/index.js';
|
|
11
11
|
// Export event types
|
|
12
|
-
export * from './events/index';
|
|
13
|
-
export { NOTIFICATION_SERVICE_TOKEN } from '../api/index';
|
|
12
|
+
export * from './events/index.js';
|
|
13
|
+
export { NOTIFICATION_SERVICE_TOKEN } from '../api/index.js';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Plugin configuration and module types
|
|
3
3
|
*/
|
|
4
|
-
export type { NotificationPluginConfig, NotificationPosition, } from './plugin-config';
|
|
5
|
-
export type { NotificationPluginModule } from './plugin-module';
|
|
4
|
+
export type { NotificationPluginConfig, NotificationPosition, } from './plugin-config.js';
|
|
5
|
+
export type { NotificationPluginModule } from './plugin-module.js';
|
|
6
6
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -41,5 +41,27 @@ export interface NotificationPluginConfig {
|
|
|
41
41
|
* @default 'hamak:notifications'
|
|
42
42
|
*/
|
|
43
43
|
persistenceKey?: string;
|
|
44
|
+
/**
|
|
45
|
+
* Auto-register a `notifications` reducer with `@hamak/ui-store` when it
|
|
46
|
+
* is present in the DI container.
|
|
47
|
+
*
|
|
48
|
+
* When `true` (the default), the plugin resolves
|
|
49
|
+
* `Symbol.for('@hamak/ui-store:StoreExtensionsRegistry')` during
|
|
50
|
+
* `initialize` and — if found — registers a reducer that mirrors the
|
|
51
|
+
* notification state under `state.notifications`. This widens the
|
|
52
|
+
* Redux `RootState` shape for any host that also loads `@hamak/ui-store`.
|
|
53
|
+
*
|
|
54
|
+
* Set to `false` to suppress the reducer registration entirely. Useful
|
|
55
|
+
* for hosts that want to manage their Redux slices explicitly, or that
|
|
56
|
+
* load both packages but do not want the notification mirror in their
|
|
57
|
+
* store.
|
|
58
|
+
*
|
|
59
|
+
* The in-memory `NotificationService` is authoritative either way — the
|
|
60
|
+
* reducer is only a read-side mirror. Disabling this flag does not affect
|
|
61
|
+
* the service, the commands, or the React templates.
|
|
62
|
+
*
|
|
63
|
+
* @default true
|
|
64
|
+
*/
|
|
65
|
+
registerReducer?: boolean;
|
|
44
66
|
}
|
|
45
67
|
//# sourceMappingURL=plugin-config.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugin-config.d.ts","sourceRoot":"","sources":["../../../src/spi/plugin/plugin-config.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH;;GAEG;AACH,MAAM,MAAM,oBAAoB,GAC5B,UAAU,GACV,YAAY,GACZ,WAAW,GACX,aAAa,GACb,eAAe,GACf,cAAc,CAAC;AAEnB;;GAEG;AACH,MAAM,WAAW,wBAAwB;IACvC;;;;OAIG;IACH,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAE1B;;;;OAIG;IACH,eAAe,CAAC,EAAE,MAAM,CAAC;IAEzB;;;OAGG;IACH,QAAQ,CAAC,EAAE,oBAAoB,CAAC;IAEhC;;;OAGG;IACH,WAAW,CAAC,EAAE,OAAO,CAAC;IAEtB;;;OAGG;IACH,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAE5B;;;OAGG;IACH,cAAc,CAAC,EAAE,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"plugin-config.d.ts","sourceRoot":"","sources":["../../../src/spi/plugin/plugin-config.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH;;GAEG;AACH,MAAM,MAAM,oBAAoB,GAC5B,UAAU,GACV,YAAY,GACZ,WAAW,GACX,aAAa,GACb,eAAe,GACf,cAAc,CAAC;AAEnB;;GAEG;AACH,MAAM,WAAW,wBAAwB;IACvC;;;;OAIG;IACH,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAE1B;;;;OAIG;IACH,eAAe,CAAC,EAAE,MAAM,CAAC;IAEzB;;;OAGG;IACH,QAAQ,CAAC,EAAE,oBAAoB,CAAC;IAEhC;;;OAGG;IACH,WAAW,CAAC,EAAE,OAAO,CAAC;IAEtB;;;OAGG;IACH,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAE5B;;;OAGG;IACH,cAAc,CAAC,EAAE,MAAM,CAAC;IAExB;;;;;;;;;;;;;;;;;;;;OAoBG;IACH,eAAe,CAAC,EAAE,OAAO,CAAC;CAC3B"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hamak/notification",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.6",
|
|
4
4
|
"description": "Pluggable notification system with API, SPI, and implementation",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -44,7 +44,7 @@
|
|
|
44
44
|
"access": "public"
|
|
45
45
|
},
|
|
46
46
|
"scripts": {
|
|
47
|
-
"build": "tsc -p tsconfig.lib.json",
|
|
47
|
+
"build": "tsc -p tsconfig.lib.json && node ../../scripts/fix-esm-extensions.mjs ./dist",
|
|
48
48
|
"clean": "rm -rf dist"
|
|
49
49
|
},
|
|
50
50
|
"keywords": [
|