@novu/js 2.3.0 → 2.4.0
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/cjs/chunk-ERC62PGI.js +35 -0
- package/dist/cjs/{chunk-AALXN67T.js → chunk-XKQCRZD6.js} +12 -5
- package/dist/cjs/index.d.ts +2 -2
- package/dist/cjs/index.js +14 -14
- package/dist/cjs/internal/index.d.ts +7 -0
- package/dist/cjs/internal/index.js +11 -0
- package/dist/{esm/novu-psplDV5F.d.mts → cjs/novu-gS68EfJw.d.ts} +4 -0
- package/dist/cjs/themes/index.d.ts +2 -2
- package/dist/cjs/{types-yDke_w6U.d.ts → types-XfKT8UJd.d.ts} +1 -1
- package/dist/cjs/ui/index.d.ts +4 -4
- package/dist/cjs/ui/index.js +274 -381
- package/dist/esm/chunk-GPV65U5R.mjs +33 -0
- package/dist/esm/{chunk-QIWP6QB5.mjs → chunk-VCUP7D3X.mjs} +12 -5
- package/dist/esm/index.d.mts +2 -2
- package/dist/esm/index.mjs +1 -1
- package/dist/esm/internal/index.d.mts +7 -0
- package/dist/esm/internal/index.mjs +2 -0
- package/dist/{cjs/novu-psplDV5F.d.ts → esm/novu-gS68EfJw.d.mts} +4 -0
- package/dist/esm/themes/index.d.mts +2 -2
- package/dist/esm/{types-xYLv4vWZ.d.mts → types-MmHw9UXx.d.mts} +1 -1
- package/dist/esm/ui/index.d.mts +4 -4
- package/dist/esm/ui/index.mjs +270 -377
- package/dist/index.css +1 -1
- package/dist/novu.min.js +5 -5
- package/dist/novu.min.js.gz +0 -0
- package/internal/package.json +5 -0
- package/package.json +17 -4
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
// src/ui/internal/parseMarkdown.tsx
|
|
4
|
+
var parseMarkdownIntoTokens = (text) => {
|
|
5
|
+
const tokens = [];
|
|
6
|
+
let buffer = "";
|
|
7
|
+
let inBold = false;
|
|
8
|
+
for (let i = 0; i < text.length; i += 1) {
|
|
9
|
+
if (text[i] === "\\" && text[i + 1] === "*") {
|
|
10
|
+
buffer += "*";
|
|
11
|
+
i += 1;
|
|
12
|
+
} else if (text[i] === "*" && text[i + 1] === "*") {
|
|
13
|
+
if (buffer) {
|
|
14
|
+
tokens.push({
|
|
15
|
+
type: inBold ? "bold" : "text",
|
|
16
|
+
content: buffer
|
|
17
|
+
});
|
|
18
|
+
buffer = "";
|
|
19
|
+
}
|
|
20
|
+
inBold = !inBold;
|
|
21
|
+
i += 1;
|
|
22
|
+
} else {
|
|
23
|
+
buffer += text[i];
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
if (buffer) {
|
|
27
|
+
tokens.push({
|
|
28
|
+
type: inBold ? "bold" : "text",
|
|
29
|
+
content: buffer
|
|
30
|
+
});
|
|
31
|
+
}
|
|
32
|
+
return tokens;
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
exports.parseMarkdownIntoTokens = parseMarkdownIntoTokens;
|
|
@@ -1425,7 +1425,8 @@ var InboxService = class {
|
|
|
1425
1425
|
chunk7B52C2XE_js.__privateAdd(this, _httpClient);
|
|
1426
1426
|
chunk7B52C2XE_js.__privateSet(this, _httpClient, new client.HttpClient(options));
|
|
1427
1427
|
chunk7B52C2XE_js.__privateGet(this, _httpClient).updateHeaders({
|
|
1428
|
-
"Novu-API-Version": NOVU_API_VERSION
|
|
1428
|
+
"Novu-API-Version": NOVU_API_VERSION,
|
|
1429
|
+
"Novu-User-Agent": options.userAgent || "@novu/js"
|
|
1429
1430
|
});
|
|
1430
1431
|
}
|
|
1431
1432
|
initializeSession(_0) {
|
|
@@ -1531,6 +1532,9 @@ var InboxService = class {
|
|
|
1531
1532
|
_httpClient = new WeakMap();
|
|
1532
1533
|
|
|
1533
1534
|
// src/novu.ts
|
|
1535
|
+
var version = "2.4.0";
|
|
1536
|
+
var name = "@novu/js";
|
|
1537
|
+
var userAgent = `${name}@${version}`;
|
|
1534
1538
|
var _emitter7, _session, _socket, _inboxService3;
|
|
1535
1539
|
var Novu = class {
|
|
1536
1540
|
constructor(options) {
|
|
@@ -1538,8 +1542,11 @@ var Novu = class {
|
|
|
1538
1542
|
chunk7B52C2XE_js.__privateAdd(this, _session);
|
|
1539
1543
|
chunk7B52C2XE_js.__privateAdd(this, _socket);
|
|
1540
1544
|
chunk7B52C2XE_js.__privateAdd(this, _inboxService3);
|
|
1541
|
-
var _a, _b, _c;
|
|
1542
|
-
chunk7B52C2XE_js.__privateSet(this, _inboxService3, new InboxService({
|
|
1545
|
+
var _a, _b, _c, _d;
|
|
1546
|
+
chunk7B52C2XE_js.__privateSet(this, _inboxService3, new InboxService({
|
|
1547
|
+
backendUrl: (_a = options.backendUrl) != null ? _a : PRODUCTION_BACKEND_URL,
|
|
1548
|
+
userAgent: (_b = options.__userAgent) != null ? _b : userAgent
|
|
1549
|
+
}));
|
|
1543
1550
|
chunk7B52C2XE_js.__privateSet(this, _emitter7, new NovuEventEmitter());
|
|
1544
1551
|
chunk7B52C2XE_js.__privateSet(this, _session, new Session(
|
|
1545
1552
|
{
|
|
@@ -1552,12 +1559,12 @@ var Novu = class {
|
|
|
1552
1559
|
));
|
|
1553
1560
|
chunk7B52C2XE_js.__privateGet(this, _session).initialize();
|
|
1554
1561
|
this.notifications = new Notifications({
|
|
1555
|
-
useCache: (
|
|
1562
|
+
useCache: (_c = options.useCache) != null ? _c : true,
|
|
1556
1563
|
inboxServiceInstance: chunk7B52C2XE_js.__privateGet(this, _inboxService3),
|
|
1557
1564
|
eventEmitterInstance: chunk7B52C2XE_js.__privateGet(this, _emitter7)
|
|
1558
1565
|
});
|
|
1559
1566
|
this.preferences = new Preferences({
|
|
1560
|
-
useCache: (
|
|
1567
|
+
useCache: (_d = options.useCache) != null ? _d : true,
|
|
1561
1568
|
inboxServiceInstance: chunk7B52C2XE_js.__privateGet(this, _inboxService3),
|
|
1562
1569
|
eventEmitterInstance: chunk7B52C2XE_js.__privateGet(this, _emitter7)
|
|
1563
1570
|
});
|
package/dist/cjs/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { N as NotificationFilter } from './novu-
|
|
2
|
-
export { k as Action, A as ActionTypeEnum, m as ChannelPreference, f as ChannelType, C as CtaType, E as EventHandler, a as Events, F as FiltersCountResponse, q as IPreferenceOverride, I as InboxNotification, L as ListNotificationsResponse, i as MessageAction, M as MessageButton, t as Notification, e as NotificationActionStatus, d as NotificationButton, c as NotificationStatus, b as Novu, v as NovuError, s as NovuOptions, n as PaginatedResponse, u as Preference, P as PreferenceLevel, g as PreferenceOverrideSource, p as PreferenceOverrideSourceEnum, o as PreferencesResponse, R as Redirect, r as Result, h as Session, S as SocketEventNames, j as Subscriber, T as TODO, W as WebSocketEvent, l as Workflow } from './novu-
|
|
1
|
+
import { N as NotificationFilter } from './novu-gS68EfJw.js';
|
|
2
|
+
export { k as Action, A as ActionTypeEnum, m as ChannelPreference, f as ChannelType, C as CtaType, E as EventHandler, a as Events, F as FiltersCountResponse, q as IPreferenceOverride, I as InboxNotification, L as ListNotificationsResponse, i as MessageAction, M as MessageButton, t as Notification, e as NotificationActionStatus, d as NotificationButton, c as NotificationStatus, b as Novu, v as NovuError, s as NovuOptions, n as PaginatedResponse, u as Preference, P as PreferenceLevel, g as PreferenceOverrideSource, p as PreferenceOverrideSourceEnum, o as PreferencesResponse, R as Redirect, r as Result, h as Session, S as SocketEventNames, j as Subscriber, T as TODO, W as WebSocketEvent, l as Workflow } from './novu-gS68EfJw.js';
|
|
3
3
|
import '@novu/client';
|
|
4
4
|
|
|
5
5
|
declare const areTagsEqual: (tags1?: string[], tags2?: string[]) => boolean;
|
package/dist/cjs/index.js
CHANGED
|
@@ -1,59 +1,59 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunkXKQCRZD6_js = require('./chunk-XKQCRZD6.js');
|
|
4
4
|
require('./chunk-7B52C2XE.js');
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
|
|
8
8
|
Object.defineProperty(exports, "ActionTypeEnum", {
|
|
9
9
|
enumerable: true,
|
|
10
|
-
get: function () { return
|
|
10
|
+
get: function () { return chunkXKQCRZD6_js.ActionTypeEnum; }
|
|
11
11
|
});
|
|
12
12
|
Object.defineProperty(exports, "ChannelType", {
|
|
13
13
|
enumerable: true,
|
|
14
|
-
get: function () { return
|
|
14
|
+
get: function () { return chunkXKQCRZD6_js.ChannelType; }
|
|
15
15
|
});
|
|
16
16
|
Object.defineProperty(exports, "CtaType", {
|
|
17
17
|
enumerable: true,
|
|
18
|
-
get: function () { return
|
|
18
|
+
get: function () { return chunkXKQCRZD6_js.CtaType; }
|
|
19
19
|
});
|
|
20
20
|
Object.defineProperty(exports, "NotificationActionStatus", {
|
|
21
21
|
enumerable: true,
|
|
22
|
-
get: function () { return
|
|
22
|
+
get: function () { return chunkXKQCRZD6_js.NotificationActionStatus; }
|
|
23
23
|
});
|
|
24
24
|
Object.defineProperty(exports, "NotificationButton", {
|
|
25
25
|
enumerable: true,
|
|
26
|
-
get: function () { return
|
|
26
|
+
get: function () { return chunkXKQCRZD6_js.NotificationButton; }
|
|
27
27
|
});
|
|
28
28
|
Object.defineProperty(exports, "NotificationStatus", {
|
|
29
29
|
enumerable: true,
|
|
30
|
-
get: function () { return
|
|
30
|
+
get: function () { return chunkXKQCRZD6_js.NotificationStatus; }
|
|
31
31
|
});
|
|
32
32
|
Object.defineProperty(exports, "Novu", {
|
|
33
33
|
enumerable: true,
|
|
34
|
-
get: function () { return
|
|
34
|
+
get: function () { return chunkXKQCRZD6_js.Novu; }
|
|
35
35
|
});
|
|
36
36
|
Object.defineProperty(exports, "PreferenceLevel", {
|
|
37
37
|
enumerable: true,
|
|
38
|
-
get: function () { return
|
|
38
|
+
get: function () { return chunkXKQCRZD6_js.PreferenceLevel; }
|
|
39
39
|
});
|
|
40
40
|
Object.defineProperty(exports, "PreferenceOverrideSource", {
|
|
41
41
|
enumerable: true,
|
|
42
|
-
get: function () { return
|
|
42
|
+
get: function () { return chunkXKQCRZD6_js.PreferenceOverrideSource; }
|
|
43
43
|
});
|
|
44
44
|
Object.defineProperty(exports, "PreferenceOverrideSourceEnum", {
|
|
45
45
|
enumerable: true,
|
|
46
|
-
get: function () { return
|
|
46
|
+
get: function () { return chunkXKQCRZD6_js.PreferenceOverrideSourceEnum; }
|
|
47
47
|
});
|
|
48
48
|
Object.defineProperty(exports, "WebSocketEvent", {
|
|
49
49
|
enumerable: true,
|
|
50
|
-
get: function () { return
|
|
50
|
+
get: function () { return chunkXKQCRZD6_js.WebSocketEvent; }
|
|
51
51
|
});
|
|
52
52
|
Object.defineProperty(exports, "areTagsEqual", {
|
|
53
53
|
enumerable: true,
|
|
54
|
-
get: function () { return
|
|
54
|
+
get: function () { return chunkXKQCRZD6_js.areTagsEqual; }
|
|
55
55
|
});
|
|
56
56
|
Object.defineProperty(exports, "isSameFilter", {
|
|
57
57
|
enumerable: true,
|
|
58
|
-
get: function () { return
|
|
58
|
+
get: function () { return chunkXKQCRZD6_js.isSameFilter; }
|
|
59
59
|
});
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var chunkERC62PGI_js = require('../chunk-ERC62PGI.js');
|
|
4
|
+
require('../chunk-7B52C2XE.js');
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
Object.defineProperty(exports, "parseMarkdownIntoTokens", {
|
|
9
|
+
enumerable: true,
|
|
10
|
+
get: function () { return chunkERC62PGI_js.parseMarkdownIntoTokens; }
|
|
11
|
+
});
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as Notification, N as NotificationFilter, s as NovuOptions, b as Novu } from './novu-
|
|
1
|
+
import { t as Notification, N as NotificationFilter, s as NovuOptions, b as Novu } from './novu-gS68EfJw.js';
|
|
2
2
|
|
|
3
3
|
declare const defaultLocalization: {
|
|
4
4
|
readonly locale: "en-US";
|
package/dist/cjs/ui/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { s as NovuOptions } from '../novu-
|
|
2
|
-
export { t as Notification } from '../novu-
|
|
3
|
-
import { N as NotificationRenderer, B as BellRenderer, a as NotificationClickHandler, b as NotificationActionClickHandler, c as NovuProviderProps, d as BaseNovuProviderProps, A as Appearance, L as Localization, T as Tab, P as PreferencesFilter, R as RouterPush } from '../types-
|
|
4
|
-
export { e as AppearanceKey, C as CSSProperties, E as ElementStyles, f as Elements, i as LocalizationKey, h as NotificationStatus, g as Theme, V as Variables } from '../types-
|
|
1
|
+
import { s as NovuOptions } from '../novu-gS68EfJw.js';
|
|
2
|
+
export { t as Notification } from '../novu-gS68EfJw.js';
|
|
3
|
+
import { N as NotificationRenderer, B as BellRenderer, a as NotificationClickHandler, b as NotificationActionClickHandler, c as NovuProviderProps, d as BaseNovuProviderProps, A as Appearance, L as Localization, T as Tab, P as PreferencesFilter, R as RouterPush } from '../types-XfKT8UJd.js';
|
|
4
|
+
export { e as AppearanceKey, C as CSSProperties, E as ElementStyles, f as Elements, i as LocalizationKey, h as NotificationStatus, g as Theme, V as Variables } from '../types-XfKT8UJd.js';
|
|
5
5
|
import * as solid_js from 'solid-js';
|
|
6
6
|
import { ComponentProps } from 'solid-js';
|
|
7
7
|
import { MountableElement } from 'solid-js/web';
|