@novu/js 2.0.0-canary.1 → 2.0.0-canary.2
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-2C4L4ZUQ.cjs → chunk-NEEKTCEQ.cjs} +17 -5
- package/dist/cjs/index.cjs +12 -12
- package/dist/cjs/ui/index.cjs +284 -217
- package/dist/esm/{chunk-Y6CIZNAK.mjs → chunk-YOLQVRKF.mjs} +17 -5
- package/dist/esm/index.mjs +1 -1
- package/dist/esm/ui/index.mjs +208 -141
- package/dist/index.css +1 -1
- package/dist/novu.min.js +7 -7
- package/dist/novu.min.js.gz +0 -0
- package/dist/types/base-module.d.ts +0 -2
- package/dist/types/base-module.d.ts.map +1 -1
- package/dist/types/notifications/notification.d.ts +1 -0
- package/dist/types/notifications/notification.d.ts.map +1 -1
- package/dist/types/types.d.ts +9 -5
- package/dist/types/types.d.ts.map +1 -1
- package/dist/types/ui/components/ExternalElementRenderer.d.ts +7 -0
- package/dist/types/ui/components/ExternalElementRenderer.d.ts.map +1 -0
- package/dist/types/ui/components/Inbox.d.ts +4 -4
- package/dist/types/ui/components/Inbox.d.ts.map +1 -1
- package/dist/types/ui/components/InboxTabs/InboxTabs.d.ts +5 -1
- package/dist/types/ui/components/InboxTabs/InboxTabs.d.ts.map +1 -1
- package/dist/types/ui/components/Notification/DefaultNotification.d.ts.map +1 -1
- package/dist/types/ui/components/Notification/NewMessagesCta.d.ts.map +1 -1
- package/dist/types/ui/components/Notification/Notification.d.ts +2 -2
- package/dist/types/ui/components/Notification/Notification.d.ts.map +1 -1
- package/dist/types/ui/components/Notification/NotificationList.d.ts +2 -2
- package/dist/types/ui/components/Notification/NotificationList.d.ts.map +1 -1
- package/dist/types/ui/components/Renderer.d.ts +1 -1
- package/dist/types/ui/components/elements/Bell/Bell.d.ts +2 -2
- package/dist/types/ui/components/elements/Bell/Bell.d.ts.map +1 -1
- package/dist/types/ui/components/elements/Header/MoreActionsOptions.d.ts +2 -1
- package/dist/types/ui/components/elements/Header/MoreActionsOptions.d.ts.map +1 -1
- package/dist/types/ui/components/elements/Header/PreferencesHeader.d.ts.map +1 -1
- package/dist/types/ui/components/elements/InboxStatus/InboxStatusDropdown.d.ts.map +1 -1
- package/dist/types/ui/components/elements/InboxStatus/InboxStatusOptions.d.ts +2 -1
- package/dist/types/ui/components/elements/InboxStatus/InboxStatusOptions.d.ts.map +1 -1
- package/dist/types/ui/components/elements/InboxStatus/constants.d.ts +7 -7
- package/dist/types/ui/components/elements/Preferences/Preferences.d.ts.map +1 -1
- package/dist/types/ui/config/defaultLocalization.d.ts +11 -10
- package/dist/types/ui/config/defaultLocalization.d.ts.map +1 -1
- package/dist/types/ui/context/LocalizationContext.d.ts +12 -4
- package/dist/types/ui/context/LocalizationContext.d.ts.map +1 -1
- package/dist/types/ui/helpers/constants.d.ts +2 -0
- package/dist/types/ui/helpers/constants.d.ts.map +1 -1
- package/dist/types/ui/helpers/index.d.ts +1 -0
- package/dist/types/ui/helpers/index.d.ts.map +1 -1
- package/dist/types/ui/types.d.ts +7 -7
- package/dist/types/ui/types.d.ts.map +1 -1
- package/dist/types/ws/socket.d.ts.map +1 -1
- package/package.json +2 -2
- package/dist/types/ui/components/ExternalElementMounter.d.ts +0 -7
- package/dist/types/ui/components/ExternalElementMounter.d.ts.map +0 -1
package/dist/esm/ui/index.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { __privateAdd, __privateSet, __privateMethod, __privateGet, __spreadProps, __spreadValues, Novu, __async,
|
|
1
|
+
import { __privateAdd, __privateSet, __privateMethod, __privateGet, __spreadProps, __spreadValues, __objRest, Novu, __async, isSameFilter } from '../chunk-YOLQVRKF.mjs';
|
|
2
2
|
import { delegateEvents, render, createComponent, Portal, mergeProps, setAttribute, spread, template, insert, memo, effect, className, use, addEventListener, Dynamic, isServer } from 'solid-js/web';
|
|
3
|
-
import {
|
|
3
|
+
import { createSignal, createContext, onMount, onCleanup, For, createMemo, createEffect, splitProps, useContext, Show, Switch as Switch$1, Match, createResource, createComputed, batch } from 'solid-js';
|
|
4
4
|
import { createStore } from 'solid-js/store';
|
|
5
5
|
import clsx from 'clsx';
|
|
6
6
|
import { extendTailwindMerge } from 'tailwind-merge';
|
|
@@ -22,30 +22,29 @@ var defaultVariables = {
|
|
|
22
22
|
fontSize: "inherit",
|
|
23
23
|
borderRadius: "0.375rem"
|
|
24
24
|
};
|
|
25
|
-
|
|
26
|
-
// src/ui/config/defaultLocalization.ts
|
|
27
25
|
var defaultLocalization = {
|
|
28
26
|
locale: "en-US",
|
|
29
|
-
"inbox.
|
|
30
|
-
"inbox.
|
|
31
|
-
"inbox.
|
|
32
|
-
"inbox.
|
|
33
|
-
"inbox.
|
|
34
|
-
"inbox.
|
|
27
|
+
"inbox.filters.dropdownOptions.unread": "Unread only",
|
|
28
|
+
"inbox.filters.dropdownOptions.default": "Unread & read",
|
|
29
|
+
"inbox.filters.dropdownOptions.archived": "Archived",
|
|
30
|
+
"inbox.filters.labels.unread": "Unread",
|
|
31
|
+
"inbox.filters.labels.default": "Inbox",
|
|
32
|
+
"inbox.filters.labels.archived": "Archived",
|
|
35
33
|
"notifications.emptyNotice": "No notifications",
|
|
36
34
|
"notifications.actions.readAll": "Mark all as read",
|
|
37
35
|
"notifications.actions.archiveAll": "Archive all",
|
|
38
36
|
"notifications.actions.archiveRead": "Archive read",
|
|
39
37
|
"notifications.newNotifications": ({ notificationCount }) => `${notificationCount > 99 ? "99+" : notificationCount} new ${notificationCount === 1 ? "notification" : "notifications"}`,
|
|
40
|
-
"notification.actions.read.
|
|
41
|
-
"notification.actions.unread.
|
|
42
|
-
"notification.actions.archive.
|
|
43
|
-
"notification.actions.unarchive.
|
|
38
|
+
"notification.actions.read.tooltip": "Mark as read",
|
|
39
|
+
"notification.actions.unread.tooltip": "Mark as unread",
|
|
40
|
+
"notification.actions.archive.tooltip": "Archive",
|
|
41
|
+
"notification.actions.unarchive.tooltip": "Unarchive",
|
|
44
42
|
"preferences.title": "Notification Preferences",
|
|
45
43
|
"preferences.global": "Global Preferences",
|
|
46
44
|
"preferences.workflow.disabled.notice": "Contact admin to enable subscription management for this critical notification.",
|
|
47
45
|
"preferences.workflow.disabled.tooltip": "Contact admin to edit"
|
|
48
46
|
};
|
|
47
|
+
var [dynamicLocalization, setDynamicLocalization] = createSignal({});
|
|
49
48
|
|
|
50
49
|
// src/ui/config/appearanceKeys.ts
|
|
51
50
|
var appearanceKeys = [
|
|
@@ -427,6 +426,10 @@ function useUncontrolledState(props) {
|
|
|
427
426
|
return [uncontrolledValue, setUncontrolledValue];
|
|
428
427
|
}
|
|
429
428
|
|
|
429
|
+
// src/ui/helpers/constants.ts
|
|
430
|
+
var DEFAULT_TARGET = "_blank";
|
|
431
|
+
var DEFAULT_REFERRER = "noopener noreferrer";
|
|
432
|
+
|
|
430
433
|
// src/ui/context/AppearanceContext.tsx
|
|
431
434
|
var AppearanceContext = createContext(void 0);
|
|
432
435
|
var AppearanceProvider = (props) => {
|
|
@@ -582,6 +585,41 @@ var useWebSocketEvent = ({
|
|
|
582
585
|
});
|
|
583
586
|
});
|
|
584
587
|
};
|
|
588
|
+
var LocalizationContext = createContext(void 0);
|
|
589
|
+
var LocalizationProvider = (props) => {
|
|
590
|
+
const localization = createMemo(() => {
|
|
591
|
+
const _a = props.localization || {}, {
|
|
592
|
+
dynamic
|
|
593
|
+
} = _a, localizationObject = __objRest(_a, [
|
|
594
|
+
"dynamic"
|
|
595
|
+
]);
|
|
596
|
+
return __spreadValues(__spreadValues(__spreadValues(__spreadValues({}, defaultLocalization), dynamicLocalization()), dynamic || {}), localizationObject);
|
|
597
|
+
});
|
|
598
|
+
const t = (key, ...args) => {
|
|
599
|
+
const value = localization()[key];
|
|
600
|
+
if (typeof value === "function") {
|
|
601
|
+
return value(args[0]);
|
|
602
|
+
}
|
|
603
|
+
return value;
|
|
604
|
+
};
|
|
605
|
+
const locale = createMemo(() => localization().locale);
|
|
606
|
+
return createComponent(LocalizationContext.Provider, {
|
|
607
|
+
value: {
|
|
608
|
+
t,
|
|
609
|
+
locale
|
|
610
|
+
},
|
|
611
|
+
get children() {
|
|
612
|
+
return props.children;
|
|
613
|
+
}
|
|
614
|
+
});
|
|
615
|
+
};
|
|
616
|
+
function useLocalization() {
|
|
617
|
+
const context = useContext(LocalizationContext);
|
|
618
|
+
if (!context) {
|
|
619
|
+
throw new Error("useLocalization must be used within an LocalizationProvider");
|
|
620
|
+
}
|
|
621
|
+
return context;
|
|
622
|
+
}
|
|
585
623
|
|
|
586
624
|
// src/ui/types.ts
|
|
587
625
|
var NotificationStatus = /* @__PURE__ */ ((NotificationStatus2) => {
|
|
@@ -911,44 +949,16 @@ function useFocusManager() {
|
|
|
911
949
|
}
|
|
912
950
|
return context;
|
|
913
951
|
}
|
|
914
|
-
var LocalizationContext = createContext(void 0);
|
|
915
|
-
var LocalizationProvider = (props) => {
|
|
916
|
-
const localization = createMemo(() => __spreadValues(__spreadValues({}, defaultLocalization), props.localization || {}));
|
|
917
|
-
const t = (key, ...args) => {
|
|
918
|
-
const value = localization()[key];
|
|
919
|
-
if (typeof value === "function") {
|
|
920
|
-
return value(args[0]);
|
|
921
|
-
}
|
|
922
|
-
return value;
|
|
923
|
-
};
|
|
924
|
-
const locale = createMemo(() => localization().locale);
|
|
925
|
-
return createComponent(LocalizationContext.Provider, {
|
|
926
|
-
value: {
|
|
927
|
-
t,
|
|
928
|
-
locale
|
|
929
|
-
},
|
|
930
|
-
get children() {
|
|
931
|
-
return props.children;
|
|
932
|
-
}
|
|
933
|
-
});
|
|
934
|
-
};
|
|
935
|
-
function useLocalization() {
|
|
936
|
-
const context = useContext(LocalizationContext);
|
|
937
|
-
if (!context) {
|
|
938
|
-
throw new Error("useLocalization must be used within an LocalizationProvider");
|
|
939
|
-
}
|
|
940
|
-
return context;
|
|
941
|
-
}
|
|
942
952
|
var _tmpl$ = /* @__PURE__ */ template(`<div>`);
|
|
943
|
-
var
|
|
953
|
+
var ExternalElementRenderer = (_a) => {
|
|
944
954
|
var _b = _a, {
|
|
945
|
-
|
|
955
|
+
render: render2
|
|
946
956
|
} = _b, rest = __objRest(_b, [
|
|
947
|
-
"
|
|
957
|
+
"render"
|
|
948
958
|
]);
|
|
949
959
|
let ref;
|
|
950
|
-
|
|
951
|
-
const unmount =
|
|
960
|
+
createEffect(() => {
|
|
961
|
+
const unmount = render2(ref);
|
|
952
962
|
onCleanup(() => {
|
|
953
963
|
unmount();
|
|
954
964
|
});
|
|
@@ -1144,7 +1154,7 @@ var Bell = (props) => {
|
|
|
1144
1154
|
} = useTotalUnreadCount();
|
|
1145
1155
|
return createComponent(Show, {
|
|
1146
1156
|
get when() {
|
|
1147
|
-
return props.
|
|
1157
|
+
return props.renderBell;
|
|
1148
1158
|
},
|
|
1149
1159
|
get fallback() {
|
|
1150
1160
|
return createComponent(BellContainer, {
|
|
@@ -1154,8 +1164,8 @@ var Bell = (props) => {
|
|
|
1154
1164
|
});
|
|
1155
1165
|
},
|
|
1156
1166
|
get children() {
|
|
1157
|
-
return createComponent(
|
|
1158
|
-
|
|
1167
|
+
return createComponent(ExternalElementRenderer, {
|
|
1168
|
+
render: (el) => props.renderBell(el, totalUnreadCount())
|
|
1159
1169
|
});
|
|
1160
1170
|
}
|
|
1161
1171
|
});
|
|
@@ -1721,14 +1731,14 @@ var Tabs = {
|
|
|
1721
1731
|
|
|
1722
1732
|
// src/ui/components/elements/InboxStatus/constants.ts
|
|
1723
1733
|
var notificationStatusOptionsLocalizationKeys = {
|
|
1724
|
-
unreadRead: "inbox.
|
|
1725
|
-
unread: "inbox.
|
|
1726
|
-
archived: "inbox.
|
|
1734
|
+
unreadRead: "inbox.filters.dropdownOptions.default",
|
|
1735
|
+
unread: "inbox.filters.dropdownOptions.unread",
|
|
1736
|
+
archived: "inbox.filters.dropdownOptions.archived"
|
|
1727
1737
|
};
|
|
1728
|
-
var
|
|
1729
|
-
unreadRead: "inbox.
|
|
1730
|
-
unread: "inbox.
|
|
1731
|
-
archived: "inbox.
|
|
1738
|
+
var inboxFilterLocalizationKeys = {
|
|
1739
|
+
unreadRead: "inbox.filters.labels.default",
|
|
1740
|
+
unread: "inbox.filters.labels.unread",
|
|
1741
|
+
archived: "inbox.filters.labels.archived"
|
|
1732
1742
|
};
|
|
1733
1743
|
var _tmpl$31 = /* @__PURE__ */ template(`<span><span></span><span>`);
|
|
1734
1744
|
var _tmpl$210 = /* @__PURE__ */ template(`<span>`);
|
|
@@ -1743,14 +1753,11 @@ var cases = [{
|
|
|
1743
1753
|
icon: Archive
|
|
1744
1754
|
}];
|
|
1745
1755
|
var StatusOptions = (props) => {
|
|
1746
|
-
const {
|
|
1747
|
-
t
|
|
1748
|
-
} = useLocalization();
|
|
1749
1756
|
return createComponent(For, {
|
|
1750
1757
|
each: cases,
|
|
1751
1758
|
children: (c) => createComponent(StatusItem, {
|
|
1752
|
-
get
|
|
1753
|
-
return
|
|
1759
|
+
get localizationKey() {
|
|
1760
|
+
return notificationStatusOptionsLocalizationKeys[c.status];
|
|
1754
1761
|
},
|
|
1755
1762
|
onClick: () => {
|
|
1756
1763
|
props.setStatus(c.status);
|
|
@@ -1766,6 +1773,9 @@ var StatusOptions = (props) => {
|
|
|
1766
1773
|
};
|
|
1767
1774
|
var StatusItem = (props) => {
|
|
1768
1775
|
const style = useStyle();
|
|
1776
|
+
const {
|
|
1777
|
+
t
|
|
1778
|
+
} = useLocalization();
|
|
1769
1779
|
return createComponent(Dropdown.Item, {
|
|
1770
1780
|
get ["class"]() {
|
|
1771
1781
|
return style("inboxStatus__dropdownItem", cn(dropdownItemVariants(), "nt-flex nt-gap-8 nt-justify-between"));
|
|
@@ -1777,17 +1787,19 @@ var StatusItem = (props) => {
|
|
|
1777
1787
|
return [(() => {
|
|
1778
1788
|
var _el$ = _tmpl$31(), _el$2 = _el$.firstChild, _el$3 = _el$2.nextSibling;
|
|
1779
1789
|
insert(_el$2, () => props.icon());
|
|
1780
|
-
insert(_el$3, () => props.
|
|
1790
|
+
insert(_el$3, () => t(props.localizationKey));
|
|
1781
1791
|
effect((_p$) => {
|
|
1782
|
-
var _v$ = style("inboxStatus__dropdownItemLabelContainer", "nt-flex nt-gap-2 nt-items-center"), _v$2 = style("inboxStatus__dropdownItemLeft__icon"), _v$3 = style("inboxStatus__dropdownItemLabel");
|
|
1792
|
+
var _v$ = style("inboxStatus__dropdownItemLabelContainer", "nt-flex nt-gap-2 nt-items-center"), _v$2 = style("inboxStatus__dropdownItemLeft__icon"), _v$3 = props.localizationKey, _v$4 = style("inboxStatus__dropdownItemLabel");
|
|
1783
1793
|
_v$ !== _p$.e && className(_el$, _p$.e = _v$);
|
|
1784
1794
|
_v$2 !== _p$.t && className(_el$2, _p$.t = _v$2);
|
|
1785
|
-
_v$3 !== _p$.a &&
|
|
1795
|
+
_v$3 !== _p$.a && setAttribute(_el$3, "data-localization", _p$.a = _v$3);
|
|
1796
|
+
_v$4 !== _p$.o && className(_el$3, _p$.o = _v$4);
|
|
1786
1797
|
return _p$;
|
|
1787
1798
|
}, {
|
|
1788
1799
|
e: void 0,
|
|
1789
1800
|
t: void 0,
|
|
1790
|
-
a: void 0
|
|
1801
|
+
a: void 0,
|
|
1802
|
+
o: void 0
|
|
1791
1803
|
});
|
|
1792
1804
|
return _el$;
|
|
1793
1805
|
})(), createComponent(Show, {
|
|
@@ -1832,8 +1844,16 @@ var StatusDropdown = () => {
|
|
|
1832
1844
|
get children() {
|
|
1833
1845
|
return [(() => {
|
|
1834
1846
|
var _el$ = _tmpl$32();
|
|
1835
|
-
insert(_el$, () => t(
|
|
1836
|
-
effect(() =>
|
|
1847
|
+
insert(_el$, () => t(inboxFilterLocalizationKeys[status()]));
|
|
1848
|
+
effect((_p$) => {
|
|
1849
|
+
var _v$ = inboxFilterLocalizationKeys[status()], _v$2 = style("inboxStatus__title", "nt-text-xl nt-font-semibold");
|
|
1850
|
+
_v$ !== _p$.e && setAttribute(_el$, "data-localization", _p$.e = _v$);
|
|
1851
|
+
_v$2 !== _p$.t && className(_el$, _p$.t = _v$2);
|
|
1852
|
+
return _p$;
|
|
1853
|
+
}, {
|
|
1854
|
+
e: void 0,
|
|
1855
|
+
t: void 0
|
|
1856
|
+
});
|
|
1837
1857
|
return _el$;
|
|
1838
1858
|
})(), (() => {
|
|
1839
1859
|
var _el$2 = _tmpl$32();
|
|
@@ -1956,9 +1976,6 @@ var useArchiveAllRead = (props) => {
|
|
|
1956
1976
|
// src/ui/components/elements/Header/MoreActionsOptions.tsx
|
|
1957
1977
|
var _tmpl$33 = /* @__PURE__ */ template(`<span>`);
|
|
1958
1978
|
var MoreActionsOptions = () => {
|
|
1959
|
-
const {
|
|
1960
|
-
t
|
|
1961
|
-
} = useLocalization();
|
|
1962
1979
|
const {
|
|
1963
1980
|
filter
|
|
1964
1981
|
} = useInboxContext();
|
|
@@ -1972,25 +1989,19 @@ var MoreActionsOptions = () => {
|
|
|
1972
1989
|
archiveAllRead
|
|
1973
1990
|
} = useArchiveAllRead();
|
|
1974
1991
|
return [createComponent(ActionsItem, {
|
|
1975
|
-
|
|
1976
|
-
return t("notifications.actions.readAll");
|
|
1977
|
-
},
|
|
1992
|
+
localizationKey: "notifications.actions.readAll",
|
|
1978
1993
|
onClick: () => readAll({
|
|
1979
1994
|
tags: filter().tags
|
|
1980
1995
|
}),
|
|
1981
1996
|
icon: ReadAll
|
|
1982
1997
|
}), createComponent(ActionsItem, {
|
|
1983
|
-
|
|
1984
|
-
return t("notifications.actions.archiveAll");
|
|
1985
|
-
},
|
|
1998
|
+
localizationKey: "notifications.actions.archiveAll",
|
|
1986
1999
|
onClick: () => archiveAll({
|
|
1987
2000
|
tags: filter().tags
|
|
1988
2001
|
}),
|
|
1989
2002
|
icon: Archive
|
|
1990
2003
|
}), createComponent(ActionsItem, {
|
|
1991
|
-
|
|
1992
|
-
return t("notifications.actions.archiveRead");
|
|
1993
|
-
},
|
|
2004
|
+
localizationKey: "notifications.actions.archiveRead",
|
|
1994
2005
|
onClick: () => archiveAllRead({
|
|
1995
2006
|
tags: filter().tags
|
|
1996
2007
|
}),
|
|
@@ -1999,6 +2010,9 @@ var MoreActionsOptions = () => {
|
|
|
1999
2010
|
};
|
|
2000
2011
|
var ActionsItem = (props) => {
|
|
2001
2012
|
const style = useStyle();
|
|
2013
|
+
const {
|
|
2014
|
+
t
|
|
2015
|
+
} = useLocalization();
|
|
2002
2016
|
return createComponent(Dropdown.Item, {
|
|
2003
2017
|
get ["class"]() {
|
|
2004
2018
|
return style("moreActions__dropdownItem", cn(dropdownItemVariants(), "nt-flex nt-gap-2"));
|
|
@@ -2014,8 +2028,16 @@ var ActionsItem = (props) => {
|
|
|
2014
2028
|
return _el$;
|
|
2015
2029
|
})(), (() => {
|
|
2016
2030
|
var _el$2 = _tmpl$33();
|
|
2017
|
-
insert(_el$2, () => props.
|
|
2018
|
-
effect(() =>
|
|
2031
|
+
insert(_el$2, () => t(props.localizationKey));
|
|
2032
|
+
effect((_p$) => {
|
|
2033
|
+
var _v$ = props.localizationKey, _v$2 = style("moreActions__dropdownItemLabel");
|
|
2034
|
+
_v$ !== _p$.e && setAttribute(_el$2, "data-localization", _p$.e = _v$);
|
|
2035
|
+
_v$2 !== _p$.t && className(_el$2, _p$.t = _v$2);
|
|
2036
|
+
return _p$;
|
|
2037
|
+
}, {
|
|
2038
|
+
e: void 0,
|
|
2039
|
+
t: void 0
|
|
2040
|
+
});
|
|
2019
2041
|
return _el$2;
|
|
2020
2042
|
})()];
|
|
2021
2043
|
}
|
|
@@ -2107,7 +2129,7 @@ var Header = (props) => {
|
|
|
2107
2129
|
return _el$;
|
|
2108
2130
|
})();
|
|
2109
2131
|
};
|
|
2110
|
-
var _tmpl$36 = /* @__PURE__ */ template(`<div><div>`);
|
|
2132
|
+
var _tmpl$36 = /* @__PURE__ */ template(`<div><div data-localization=preferences.title>`);
|
|
2111
2133
|
var _tmpl$211 = /* @__PURE__ */ template(`<button>`);
|
|
2112
2134
|
var PreferencesHeader = (props) => {
|
|
2113
2135
|
const style = useStyle();
|
|
@@ -2502,12 +2524,10 @@ var LoadingSkeleton = () => {
|
|
|
2502
2524
|
// src/ui/components/elements/Preferences/Preferences.tsx
|
|
2503
2525
|
var _tmpl$44 = /* @__PURE__ */ template(`<div>`);
|
|
2504
2526
|
var _tmpl$212 = /* @__PURE__ */ template(`<span>`);
|
|
2505
|
-
var _tmpl$310 = /* @__PURE__ */ template(`<
|
|
2527
|
+
var _tmpl$310 = /* @__PURE__ */ template(`<span data-localization=preferences.workflow.disabled.notice>`);
|
|
2528
|
+
var _tmpl$45 = /* @__PURE__ */ template(`<div><div><div><div></div></div><span>`);
|
|
2506
2529
|
var Preferences = () => {
|
|
2507
2530
|
const style = useStyle();
|
|
2508
|
-
const {
|
|
2509
|
-
t
|
|
2510
|
-
} = useLocalization();
|
|
2511
2531
|
const {
|
|
2512
2532
|
preferences,
|
|
2513
2533
|
loading,
|
|
@@ -2522,6 +2542,15 @@ var Preferences = () => {
|
|
|
2522
2542
|
workflowPreferences
|
|
2523
2543
|
};
|
|
2524
2544
|
});
|
|
2545
|
+
createEffect(() => {
|
|
2546
|
+
setDynamicLocalization((prev) => {
|
|
2547
|
+
var _a;
|
|
2548
|
+
return __spreadValues(__spreadValues({}, prev), (_a = allPreferences().workflowPreferences) == null ? void 0 : _a.reduce((acc, preference) => {
|
|
2549
|
+
acc[preference.workflow.identifier] = preference.workflow.name;
|
|
2550
|
+
return acc;
|
|
2551
|
+
}, {}));
|
|
2552
|
+
});
|
|
2553
|
+
});
|
|
2525
2554
|
const optimisticUpdate = ({
|
|
2526
2555
|
channel,
|
|
2527
2556
|
enabled,
|
|
@@ -2551,9 +2580,7 @@ var Preferences = () => {
|
|
|
2551
2580
|
},
|
|
2552
2581
|
get children() {
|
|
2553
2582
|
return [createComponent(PreferencesRow, {
|
|
2554
|
-
|
|
2555
|
-
return t("preferences.global");
|
|
2556
|
-
},
|
|
2583
|
+
localizationKey: "preferences.global",
|
|
2557
2584
|
get channels() {
|
|
2558
2585
|
var _a;
|
|
2559
2586
|
return ((_a = allPreferences().globalPreference) == null ? void 0 : _a.channels) || {};
|
|
@@ -2564,9 +2591,8 @@ var Preferences = () => {
|
|
|
2564
2591
|
return allPreferences().workflowPreferences;
|
|
2565
2592
|
},
|
|
2566
2593
|
children: (preference) => createComponent(PreferencesRow, {
|
|
2567
|
-
get
|
|
2568
|
-
|
|
2569
|
-
return (_a = preference.workflow) == null ? void 0 : _a.name;
|
|
2594
|
+
get localizationKey() {
|
|
2595
|
+
return preference.workflow.identifier;
|
|
2570
2596
|
},
|
|
2571
2597
|
get channels() {
|
|
2572
2598
|
return preference.channels;
|
|
@@ -2626,7 +2652,7 @@ var PreferencesRow = (props) => {
|
|
|
2626
2652
|
return channels().length > 0;
|
|
2627
2653
|
},
|
|
2628
2654
|
get children() {
|
|
2629
|
-
var _el$4 = _tmpl$
|
|
2655
|
+
var _el$4 = _tmpl$45(), _el$5 = _el$4.firstChild, _el$6 = _el$5.firstChild, _el$7 = _el$6.firstChild, _el$8 = _el$6.nextSibling;
|
|
2630
2656
|
_el$5.$$click = () => setIsOpen((prev) => !prev);
|
|
2631
2657
|
insert(_el$7, createComponent(Show, {
|
|
2632
2658
|
get when() {
|
|
@@ -2647,6 +2673,7 @@ var PreferencesRow = (props) => {
|
|
|
2647
2673
|
return _el$11;
|
|
2648
2674
|
})()
|
|
2649
2675
|
}), createComponent(Tooltip.Content, {
|
|
2676
|
+
"data-localization": "preferences.workflow.disabled.tooltip",
|
|
2650
2677
|
get children() {
|
|
2651
2678
|
return t("preferences.workflow.disabled.tooltip");
|
|
2652
2679
|
}
|
|
@@ -2655,7 +2682,7 @@ var PreferencesRow = (props) => {
|
|
|
2655
2682
|
});
|
|
2656
2683
|
}
|
|
2657
2684
|
}), null);
|
|
2658
|
-
insert(_el$7, () => props.
|
|
2685
|
+
insert(_el$7, () => t(props.localizationKey), null);
|
|
2659
2686
|
insert(_el$6, createComponent(ChannelsLabel, {
|
|
2660
2687
|
get channels() {
|
|
2661
2688
|
return props.channels;
|
|
@@ -2677,7 +2704,7 @@ var PreferencesRow = (props) => {
|
|
|
2677
2704
|
return props.isCritical;
|
|
2678
2705
|
},
|
|
2679
2706
|
get children() {
|
|
2680
|
-
var _el$10 = _tmpl$
|
|
2707
|
+
var _el$10 = _tmpl$310();
|
|
2681
2708
|
insert(_el$10, () => t("preferences.workflow.disabled.notice"));
|
|
2682
2709
|
effect(() => className(_el$10, style("workflowContainerDisabledNotice", "nt-text-sm nt-text-foreground-alpha-600 nt-text-start")));
|
|
2683
2710
|
return _el$10;
|
|
@@ -2709,7 +2736,7 @@ var PreferencesRow = (props) => {
|
|
|
2709
2736
|
}), null);
|
|
2710
2737
|
effect((_p$) => {
|
|
2711
2738
|
var _v$ = style("workflowContainer", `nt-p-4 nt-flex nt-flex-col nt-gap-1 nt-items-start nt-self-stretch
|
|
2712
|
-
hover:nt-bg-neutral-100 nt-rounded-lg data-[disabled=true]:nt-bg-neutral-alpha-50`), _v$2 = props.isCritical, _v$3 = isOpen(), _v$4 = style("workflowLabelContainer", "nt-flex nt-justify-between nt-flex-nowrap nt-self-stretch nt-cursor-pointer nt-items-center"), _v$5 = props.isCritical, _v$6 = isOpen(), _v$7 = style("workflowLabel", "nt-text-base nt-font-semibold nt-text-start nt-flex nt-items-center nt-gap-1"), _v$8 = props.isCritical, _v$9 = isOpen(), _v$
|
|
2739
|
+
hover:nt-bg-neutral-100 nt-rounded-lg data-[disabled=true]:nt-bg-neutral-alpha-50`), _v$2 = props.isCritical, _v$3 = isOpen(), _v$4 = style("workflowLabelContainer", "nt-flex nt-justify-between nt-flex-nowrap nt-self-stretch nt-cursor-pointer nt-items-center"), _v$5 = props.isCritical, _v$6 = isOpen(), _v$7 = style("workflowLabel", "nt-text-base nt-font-semibold nt-text-start nt-flex nt-items-center nt-gap-1"), _v$8 = props.isCritical, _v$9 = props.localizationKey, _v$10 = isOpen(), _v$11 = style("workflowContainerRight__icon", `nt-text-foreground-alpha-600 nt-transition-all nt-duration-200 data-[open=true]:nt-transform data-[open=true]:nt-rotate-180`), _v$12 = props.isCritical, _v$13 = isOpen();
|
|
2713
2740
|
_v$ !== _p$.e && className(_el$4, _p$.e = _v$);
|
|
2714
2741
|
_v$2 !== _p$.t && setAttribute(_el$4, "data-disabled", _p$.t = _v$2);
|
|
2715
2742
|
_v$3 !== _p$.a && setAttribute(_el$4, "data-open", _p$.a = _v$3);
|
|
@@ -2718,10 +2745,11 @@ var PreferencesRow = (props) => {
|
|
|
2718
2745
|
_v$6 !== _p$.n && setAttribute(_el$5, "data-open", _p$.n = _v$6);
|
|
2719
2746
|
_v$7 !== _p$.s && className(_el$7, _p$.s = _v$7);
|
|
2720
2747
|
_v$8 !== _p$.h && setAttribute(_el$7, "data-disabled", _p$.h = _v$8);
|
|
2721
|
-
_v$9 !== _p$.r && setAttribute(_el$7, "data-
|
|
2722
|
-
_v$10 !== _p$.d &&
|
|
2723
|
-
_v$11 !== _p$.l &&
|
|
2724
|
-
_v$12 !== _p$.u && setAttribute(_el$8, "data-
|
|
2748
|
+
_v$9 !== _p$.r && setAttribute(_el$7, "data-localization", _p$.r = _v$9);
|
|
2749
|
+
_v$10 !== _p$.d && setAttribute(_el$7, "data-open", _p$.d = _v$10);
|
|
2750
|
+
_v$11 !== _p$.l && className(_el$8, _p$.l = _v$11);
|
|
2751
|
+
_v$12 !== _p$.u && setAttribute(_el$8, "data-disabled", _p$.u = _v$12);
|
|
2752
|
+
_v$13 !== _p$.c && setAttribute(_el$8, "data-open", _p$.c = _v$13);
|
|
2725
2753
|
return _p$;
|
|
2726
2754
|
}, {
|
|
2727
2755
|
e: void 0,
|
|
@@ -2735,17 +2763,18 @@ var PreferencesRow = (props) => {
|
|
|
2735
2763
|
r: void 0,
|
|
2736
2764
|
d: void 0,
|
|
2737
2765
|
l: void 0,
|
|
2738
|
-
u: void 0
|
|
2766
|
+
u: void 0,
|
|
2767
|
+
c: void 0
|
|
2739
2768
|
});
|
|
2740
2769
|
return _el$4;
|
|
2741
2770
|
}
|
|
2742
2771
|
});
|
|
2743
2772
|
};
|
|
2744
2773
|
delegateEvents(["click"]);
|
|
2745
|
-
var _tmpl$
|
|
2774
|
+
var _tmpl$46 = /* @__PURE__ */ template(`<span>`);
|
|
2746
2775
|
var _tmpl$213 = /* @__PURE__ */ template(`<img>`);
|
|
2747
2776
|
var _tmpl$311 = /* @__PURE__ */ template(`<p>`);
|
|
2748
|
-
var _tmpl$
|
|
2777
|
+
var _tmpl$47 = /* @__PURE__ */ template(`<a><div><div class="nt-relative nt-shrink-0 nt-float-right"><p></p><div></div></div><p></p><div>`);
|
|
2749
2778
|
var DefaultNotification = (props) => {
|
|
2750
2779
|
const style = useStyle();
|
|
2751
2780
|
const {
|
|
@@ -2770,7 +2799,7 @@ var DefaultNotification = (props) => {
|
|
|
2770
2799
|
return () => clearInterval(interval);
|
|
2771
2800
|
});
|
|
2772
2801
|
const handleNotificationClick = (e) => {
|
|
2773
|
-
var _a, _b, _c;
|
|
2802
|
+
var _a, _b, _c, _d;
|
|
2774
2803
|
e.stopPropagation();
|
|
2775
2804
|
e.preventDefault();
|
|
2776
2805
|
if (!props.notification.isRead) {
|
|
@@ -2778,29 +2807,38 @@ var DefaultNotification = (props) => {
|
|
|
2778
2807
|
}
|
|
2779
2808
|
(_a = props.onNotificationClick) == null ? void 0 : _a.call(props, props.notification);
|
|
2780
2809
|
if ((_b = props.notification.redirect) == null ? void 0 : _b.url) {
|
|
2781
|
-
|
|
2810
|
+
const target = ((_c = props.notification.redirect) == null ? void 0 : _c.target) || DEFAULT_TARGET;
|
|
2811
|
+
window.open((_d = props.notification.redirect) == null ? void 0 : _d.url, target, DEFAULT_REFERRER);
|
|
2782
2812
|
}
|
|
2783
2813
|
};
|
|
2784
2814
|
const handleActionButtonClick = (action, e) => {
|
|
2785
|
-
var _a, _b;
|
|
2815
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n;
|
|
2786
2816
|
e.stopPropagation();
|
|
2787
2817
|
if (action === "primary" /* PRIMARY */) {
|
|
2788
2818
|
props.notification.completePrimary();
|
|
2789
2819
|
(_a = props.onPrimaryActionClick) == null ? void 0 : _a.call(props, props.notification);
|
|
2820
|
+
if ((_c = (_b = props.notification.primaryAction) == null ? void 0 : _b.redirect) == null ? void 0 : _c.url) {
|
|
2821
|
+
const target = ((_e = (_d = props.notification.primaryAction) == null ? void 0 : _d.redirect) == null ? void 0 : _e.target) || DEFAULT_TARGET;
|
|
2822
|
+
window.open((_g = (_f = props.notification.primaryAction) == null ? void 0 : _f.redirect) == null ? void 0 : _g.url, target, DEFAULT_REFERRER);
|
|
2823
|
+
}
|
|
2790
2824
|
} else {
|
|
2791
2825
|
props.notification.completeSecondary();
|
|
2792
|
-
(
|
|
2826
|
+
(_h = props.onSecondaryActionClick) == null ? void 0 : _h.call(props, props.notification);
|
|
2827
|
+
if ((_j = (_i = props.notification.secondaryAction) == null ? void 0 : _i.redirect) == null ? void 0 : _j.url) {
|
|
2828
|
+
const target = ((_l = (_k = props.notification.secondaryAction) == null ? void 0 : _k.redirect) == null ? void 0 : _l.target) || DEFAULT_TARGET;
|
|
2829
|
+
window.open((_n = (_m = props.notification.secondaryAction) == null ? void 0 : _m.redirect) == null ? void 0 : _n.url, target, DEFAULT_REFERRER);
|
|
2830
|
+
}
|
|
2793
2831
|
}
|
|
2794
2832
|
};
|
|
2795
2833
|
return (() => {
|
|
2796
|
-
var _el$ = _tmpl$
|
|
2834
|
+
var _el$ = _tmpl$47(), _el$4 = _el$.firstChild, _el$5 = _el$4.firstChild, _el$6 = _el$5.firstChild, _el$7 = _el$6.nextSibling, _el$9 = _el$5.nextSibling, _el$10 = _el$9.nextSibling;
|
|
2797
2835
|
_el$.$$click = handleNotificationClick;
|
|
2798
2836
|
insert(_el$, createComponent(Show, {
|
|
2799
2837
|
get when() {
|
|
2800
2838
|
return !props.notification.isRead;
|
|
2801
2839
|
},
|
|
2802
2840
|
get children() {
|
|
2803
|
-
var _el$2 = _tmpl$
|
|
2841
|
+
var _el$2 = _tmpl$46();
|
|
2804
2842
|
effect(() => className(_el$2, style("notificationDot", "nt-absolute -nt-translate-x-[1.0625rem] nt-translate-y-1/2 nt-size-2.5 nt-bg-primary nt-rounded-full nt-border")));
|
|
2805
2843
|
return _el$2;
|
|
2806
2844
|
}
|
|
@@ -2852,8 +2890,9 @@ var DefaultNotification = (props) => {
|
|
|
2852
2890
|
}
|
|
2853
2891
|
}))
|
|
2854
2892
|
}), createComponent(Tooltip.Content, {
|
|
2893
|
+
"data-localization": "notification.actions.read.tooltip",
|
|
2855
2894
|
get children() {
|
|
2856
|
-
return t("notification.actions.read.
|
|
2895
|
+
return t("notification.actions.read.tooltip");
|
|
2857
2896
|
}
|
|
2858
2897
|
})];
|
|
2859
2898
|
}
|
|
@@ -2878,8 +2917,9 @@ var DefaultNotification = (props) => {
|
|
|
2878
2917
|
}
|
|
2879
2918
|
}))
|
|
2880
2919
|
}), createComponent(Tooltip.Content, {
|
|
2920
|
+
"data-localization": "notification.actions.unread.tooltip",
|
|
2881
2921
|
get children() {
|
|
2882
|
-
return t("notification.actions.unread.
|
|
2922
|
+
return t("notification.actions.unread.tooltip");
|
|
2883
2923
|
}
|
|
2884
2924
|
})];
|
|
2885
2925
|
}
|
|
@@ -2911,8 +2951,9 @@ var DefaultNotification = (props) => {
|
|
|
2911
2951
|
}
|
|
2912
2952
|
}))
|
|
2913
2953
|
}), createComponent(Tooltip.Content, {
|
|
2954
|
+
"data-localization": "notification.actions.archive.tooltip",
|
|
2914
2955
|
get children() {
|
|
2915
|
-
return t("notification.actions.archive.
|
|
2956
|
+
return t("notification.actions.archive.tooltip");
|
|
2916
2957
|
}
|
|
2917
2958
|
})];
|
|
2918
2959
|
}
|
|
@@ -2937,8 +2978,9 @@ var DefaultNotification = (props) => {
|
|
|
2937
2978
|
}
|
|
2938
2979
|
}))
|
|
2939
2980
|
}), createComponent(Tooltip.Content, {
|
|
2981
|
+
"data-localization": "notification.actions.unarchive.tooltip",
|
|
2940
2982
|
get children() {
|
|
2941
|
-
return t("notification.actions.unarchive.
|
|
2983
|
+
return t("notification.actions.unarchive.tooltip");
|
|
2942
2984
|
}
|
|
2943
2985
|
})];
|
|
2944
2986
|
}
|
|
@@ -2952,7 +2994,7 @@ var DefaultNotification = (props) => {
|
|
|
2952
2994
|
get children() {
|
|
2953
2995
|
var _el$8 = _tmpl$311();
|
|
2954
2996
|
insert(_el$8, () => props.notification.subject);
|
|
2955
|
-
effect(() => className(_el$8, style("notificationSubject", "nt-font-semibold")));
|
|
2997
|
+
effect(() => className(_el$8, style("notificationSubject", "nt-text-start nt-font-semibold")));
|
|
2956
2998
|
return _el$8;
|
|
2957
2999
|
}
|
|
2958
3000
|
}), _el$9);
|
|
@@ -2992,7 +3034,7 @@ var DefaultNotification = (props) => {
|
|
|
2992
3034
|
})), _v$4 = style("notificationBody", "nt-overflow-hidden nt-w-full"), _v$5 = style("notificationDate", `nt-transition nt-duration-100 nt-ease-out nt-text-foreground-alpha-400 nt-shrink-0
|
|
2993
3035
|
nt-float-right nt-text-right group-hover:nt-opacity-0`), _v$6 = style("notificationDefaultActions", `nt-transition nt-duration-100 nt-ease-out nt-gap-2 nt-flex nt-shrink-0
|
|
2994
3036
|
nt-opacity-0 group-hover:nt-opacity-100 nt-justify-center nt-items-center
|
|
2995
|
-
nt-absolute nt-top-0 nt-right-0 nt-bg-neutral-100 nt-p-0.5 nt-rounded nt-z-50`), _v$7 = style("notificationBody"), _v$8 = style("notificationCustomActions", "nt-flex nt-gap-4 nt-mt-4");
|
|
3037
|
+
nt-absolute nt-top-0 nt-right-0 nt-bg-neutral-100 nt-p-0.5 nt-rounded nt-z-50`), _v$7 = style("notificationBody", "nt-text-start"), _v$8 = style("notificationCustomActions", "nt-flex nt-gap-4 nt-mt-4");
|
|
2996
3038
|
_v$3 !== _p$.e && className(_el$, _p$.e = _v$3);
|
|
2997
3039
|
_v$4 !== _p$.t && className(_el$4, _p$.t = _v$4);
|
|
2998
3040
|
_v$5 !== _p$.a && className(_el$6, _p$.a = _v$5);
|
|
@@ -3017,7 +3059,7 @@ delegateEvents(["click"]);
|
|
|
3017
3059
|
var Notification = (props) => {
|
|
3018
3060
|
return createComponent(Show, {
|
|
3019
3061
|
get when() {
|
|
3020
|
-
return props.
|
|
3062
|
+
return props.renderNotification;
|
|
3021
3063
|
},
|
|
3022
3064
|
get fallback() {
|
|
3023
3065
|
return createComponent(DefaultNotification, {
|
|
@@ -3036,25 +3078,25 @@ var Notification = (props) => {
|
|
|
3036
3078
|
});
|
|
3037
3079
|
},
|
|
3038
3080
|
get children() {
|
|
3039
|
-
return createComponent(
|
|
3040
|
-
|
|
3081
|
+
return createComponent(ExternalElementRenderer, {
|
|
3082
|
+
render: (el) => props.renderNotification(el, props.notification)
|
|
3041
3083
|
});
|
|
3042
3084
|
}
|
|
3043
3085
|
});
|
|
3044
3086
|
};
|
|
3045
|
-
var _tmpl$
|
|
3087
|
+
var _tmpl$48 = /* @__PURE__ */ template(`<svg xmlns=http://www.w3.org/2000/svg width=48 height=48 viewBox="0 0 48 48"fill=none><path fill=currentColor d="M35.2 21.62L32.38 18.8L39.5 11.7L42.32 14.52C42.1 14.58 35.2 21.62 35.2 21.62ZM26 6H22V16H26V6ZM12.8 21.62L15.62 18.8L8.52 11.68L5.68 14.52C5.9 14.58 12.8 21.62 12.8 21.62ZM40 28H33.16C31.62 31.52 28.08 34 24 34C19.92 34 16.38 31.52 14.84 28H8V38H40V28ZM40 24C42.2 24 44 25.8 44 28V38C44 40.2 42.2 42 40 42H8C5.8 42 4 40.2 4 38V28C4 25.8 5.8 24 8 24H18C18 27.32 20.68 30 24 30C27.32 30 30 27.32 30 24H40Z">`);
|
|
3046
3088
|
function EmptyIcon(props) {
|
|
3047
3089
|
return (() => {
|
|
3048
|
-
var _el$ = _tmpl$
|
|
3090
|
+
var _el$ = _tmpl$48();
|
|
3049
3091
|
spread(_el$, props, true, true);
|
|
3050
3092
|
return _el$;
|
|
3051
3093
|
})();
|
|
3052
3094
|
}
|
|
3053
3095
|
var NewMessagesCta = (props) => {
|
|
3096
|
+
const shouldRender = createMemo(() => !!props.count);
|
|
3054
3097
|
const {
|
|
3055
3098
|
t
|
|
3056
3099
|
} = useLocalization();
|
|
3057
|
-
const shouldRender = createMemo(() => !!props.count);
|
|
3058
3100
|
return createComponent(Show, {
|
|
3059
3101
|
get when() {
|
|
3060
3102
|
return shouldRender();
|
|
@@ -3066,6 +3108,7 @@ var NewMessagesCta = (props) => {
|
|
|
3066
3108
|
get onClick() {
|
|
3067
3109
|
return props.onClick;
|
|
3068
3110
|
},
|
|
3111
|
+
"data-localization": "notifications.newNotifications",
|
|
3069
3112
|
get children() {
|
|
3070
3113
|
return t("notifications.newNotifications", {
|
|
3071
3114
|
notificationCount: props.count
|
|
@@ -3075,10 +3118,10 @@ var NewMessagesCta = (props) => {
|
|
|
3075
3118
|
}
|
|
3076
3119
|
});
|
|
3077
3120
|
};
|
|
3078
|
-
var _tmpl$
|
|
3121
|
+
var _tmpl$49 = /* @__PURE__ */ template(`<div class="nt-flex nt-gap-2 nt-p-4 nt-w-full"><div class="nt-flex nt-flex-col nt-self-stretch nt-gap-3 nt-flex-1"><div class="nt-flex nt-gap-1"></div><div class="nt-flex nt-gap-1">`);
|
|
3079
3122
|
var NotificationSkeleton = () => {
|
|
3080
3123
|
return (() => {
|
|
3081
|
-
var _el$ = _tmpl$
|
|
3124
|
+
var _el$ = _tmpl$49(), _el$2 = _el$.firstChild, _el$3 = _el$2.firstChild, _el$4 = _el$3.nextSibling;
|
|
3082
3125
|
insert(_el$, createComponent(SkeletonAvatar, {
|
|
3083
3126
|
appearanceKey: "skeletonAvatar"
|
|
3084
3127
|
}), _el$2);
|
|
@@ -3115,7 +3158,7 @@ var NotificationListSkeleton = (props) => {
|
|
|
3115
3158
|
};
|
|
3116
3159
|
|
|
3117
3160
|
// src/ui/components/Notification/NotificationList.tsx
|
|
3118
|
-
var _tmpl$
|
|
3161
|
+
var _tmpl$50 = /* @__PURE__ */ template(`<div><p data-localization=notifications.emptyNotice>`);
|
|
3119
3162
|
var _tmpl$214 = /* @__PURE__ */ template(`<div>`);
|
|
3120
3163
|
var _tmpl$312 = /* @__PURE__ */ template(`<div><div>`);
|
|
3121
3164
|
var EmptyNotificationList = () => {
|
|
@@ -3124,7 +3167,7 @@ var EmptyNotificationList = () => {
|
|
|
3124
3167
|
t
|
|
3125
3168
|
} = useLocalization();
|
|
3126
3169
|
return (() => {
|
|
3127
|
-
var _el$ = _tmpl$
|
|
3170
|
+
var _el$ = _tmpl$50(), _el$2 = _el$.firstChild;
|
|
3128
3171
|
insert(_el$, createComponent(EmptyIcon, {
|
|
3129
3172
|
get ["class"]() {
|
|
3130
3173
|
return style("notificationListEmptyNoticeIcon");
|
|
@@ -3212,8 +3255,8 @@ var NotificationList = (props) => {
|
|
|
3212
3255
|
},
|
|
3213
3256
|
children: (notification) => createComponent(Notification, {
|
|
3214
3257
|
notification,
|
|
3215
|
-
get
|
|
3216
|
-
return props.
|
|
3258
|
+
get renderNotification() {
|
|
3259
|
+
return props.renderNotification;
|
|
3217
3260
|
},
|
|
3218
3261
|
get onNotificationClick() {
|
|
3219
3262
|
return props.onNotificationClick;
|
|
@@ -3259,13 +3302,13 @@ var NotificationList = (props) => {
|
|
|
3259
3302
|
return _el$3;
|
|
3260
3303
|
})();
|
|
3261
3304
|
};
|
|
3262
|
-
var _tmpl$
|
|
3305
|
+
var _tmpl$51 = /* @__PURE__ */ template(`<span>`);
|
|
3263
3306
|
var getDisplayCount = (count) => count >= 100 ? "99+" : count;
|
|
3264
3307
|
var InboxTabUnreadNotificationsCount = (props) => {
|
|
3265
3308
|
const style = useStyle();
|
|
3266
3309
|
const displayCount = createMemo(() => getDisplayCount(props.count));
|
|
3267
3310
|
return (() => {
|
|
3268
|
-
var _el$ = _tmpl$
|
|
3311
|
+
var _el$ = _tmpl$51();
|
|
3269
3312
|
insert(_el$, displayCount);
|
|
3270
3313
|
effect(() => className(_el$, style("notificationsTabsTriggerCount", "nt-rounded-full nt-bg-counter nt-px-[6px] nt-text-counter-foreground nt-text-sm")));
|
|
3271
3314
|
return _el$;
|
|
@@ -3290,7 +3333,7 @@ var InboxTab = (props) => {
|
|
|
3290
3333
|
},
|
|
3291
3334
|
get children() {
|
|
3292
3335
|
return [(() => {
|
|
3293
|
-
var _el$2 = _tmpl$
|
|
3336
|
+
var _el$2 = _tmpl$51();
|
|
3294
3337
|
insert(_el$2, () => props.label);
|
|
3295
3338
|
effect(() => className(_el$2, style("notificationsTabsTriggerLabel", "nt-text-sm nt-font-medium")));
|
|
3296
3339
|
return _el$2;
|
|
@@ -3325,7 +3368,7 @@ var InboxDropdownTab = (props) => {
|
|
|
3325
3368
|
},
|
|
3326
3369
|
get children() {
|
|
3327
3370
|
return [(() => {
|
|
3328
|
-
var _el$3 = _tmpl$
|
|
3371
|
+
var _el$3 = _tmpl$51();
|
|
3329
3372
|
insert(_el$3, () => props.label);
|
|
3330
3373
|
effect(() => className(_el$3, style("moreTabs__dropdownItemLabel", "nt-mr-auto")));
|
|
3331
3374
|
return _el$3;
|
|
@@ -3500,6 +3543,18 @@ var InboxTabs = (props) => {
|
|
|
3500
3543
|
},
|
|
3501
3544
|
get children() {
|
|
3502
3545
|
return createComponent(NotificationList, {
|
|
3546
|
+
get renderNotification() {
|
|
3547
|
+
return props.renderNotification;
|
|
3548
|
+
},
|
|
3549
|
+
get onNotificationClick() {
|
|
3550
|
+
return props.onNotificationClick;
|
|
3551
|
+
},
|
|
3552
|
+
get onPrimaryActionClick() {
|
|
3553
|
+
return props.onPrimaryActionClick;
|
|
3554
|
+
},
|
|
3555
|
+
get onSecondaryActionClick() {
|
|
3556
|
+
return props.onSecondaryActionClick;
|
|
3557
|
+
},
|
|
3503
3558
|
get filter() {
|
|
3504
3559
|
return __spreadProps(__spreadValues({}, filter()), {
|
|
3505
3560
|
tags: tab.value
|
|
@@ -3513,7 +3568,7 @@ var InboxTabs = (props) => {
|
|
|
3513
3568
|
};
|
|
3514
3569
|
|
|
3515
3570
|
// src/ui/components/Inbox.tsx
|
|
3516
|
-
var _tmpl$
|
|
3571
|
+
var _tmpl$52 = /* @__PURE__ */ template(`<div>`);
|
|
3517
3572
|
var InboxPage = /* @__PURE__ */ function(InboxPage2) {
|
|
3518
3573
|
InboxPage2["Notifications"] = "notifications";
|
|
3519
3574
|
InboxPage2["Preferences"] = "preferences";
|
|
@@ -3535,7 +3590,7 @@ var InboxContent = (props) => {
|
|
|
3535
3590
|
};
|
|
3536
3591
|
});
|
|
3537
3592
|
return (() => {
|
|
3538
|
-
var _el$ = _tmpl$
|
|
3593
|
+
var _el$ = _tmpl$52();
|
|
3539
3594
|
insert(_el$, createComponent(Switch$1, {
|
|
3540
3595
|
get children() {
|
|
3541
3596
|
return [createComponent(Match, {
|
|
@@ -3554,8 +3609,8 @@ var InboxContent = (props) => {
|
|
|
3554
3609
|
},
|
|
3555
3610
|
get fallback() {
|
|
3556
3611
|
return createComponent(NotificationList, {
|
|
3557
|
-
get
|
|
3558
|
-
return props.
|
|
3612
|
+
get renderNotification() {
|
|
3613
|
+
return props.renderNotification;
|
|
3559
3614
|
},
|
|
3560
3615
|
get onNotificationClick() {
|
|
3561
3616
|
return props.onNotificationClick;
|
|
@@ -3573,6 +3628,18 @@ var InboxContent = (props) => {
|
|
|
3573
3628
|
},
|
|
3574
3629
|
get children() {
|
|
3575
3630
|
return createComponent(InboxTabs, {
|
|
3631
|
+
get renderNotification() {
|
|
3632
|
+
return props.renderNotification;
|
|
3633
|
+
},
|
|
3634
|
+
get onNotificationClick() {
|
|
3635
|
+
return props.onNotificationClick;
|
|
3636
|
+
},
|
|
3637
|
+
get onPrimaryActionClick() {
|
|
3638
|
+
return props.onPrimaryActionClick;
|
|
3639
|
+
},
|
|
3640
|
+
get onSecondaryActionClick() {
|
|
3641
|
+
return props.onSecondaryActionClick;
|
|
3642
|
+
},
|
|
3576
3643
|
get tabs() {
|
|
3577
3644
|
return tabs();
|
|
3578
3645
|
}
|
|
@@ -3616,8 +3683,8 @@ var Inbox2 = (props) => {
|
|
|
3616
3683
|
}, triggerProps, {
|
|
3617
3684
|
get children() {
|
|
3618
3685
|
return createComponent(Bell, {
|
|
3619
|
-
get
|
|
3620
|
-
return props.
|
|
3686
|
+
get renderBell() {
|
|
3687
|
+
return props.renderBell;
|
|
3621
3688
|
}
|
|
3622
3689
|
});
|
|
3623
3690
|
}
|
|
@@ -3626,8 +3693,8 @@ var Inbox2 = (props) => {
|
|
|
3626
3693
|
appearanceKey: "inbox__popoverContent",
|
|
3627
3694
|
get children() {
|
|
3628
3695
|
return createComponent(InboxContent, {
|
|
3629
|
-
get
|
|
3630
|
-
return props.
|
|
3696
|
+
get renderNotification() {
|
|
3697
|
+
return props.renderNotification;
|
|
3631
3698
|
},
|
|
3632
3699
|
get onNotificationClick() {
|
|
3633
3700
|
return props.onNotificationClick;
|
|
@@ -3749,7 +3816,7 @@ var Renderer = (props) => {
|
|
|
3749
3816
|
}
|
|
3750
3817
|
});
|
|
3751
3818
|
};
|
|
3752
|
-
var version = "2.0.0-canary.
|
|
3819
|
+
var version = "2.0.0-canary.2";
|
|
3753
3820
|
var cssHref = `https://cdn.jsdelivr.net/npm/@novu/js@${version}/dist/index.css`;
|
|
3754
3821
|
var _dispose, _rootElement, _mountedElements, _setMountedElements, _appearance, _setAppearance, _localization, _setLocalization, _options, _setOptions, _tabs, _setTabs, _NovuUI_instances, mountComponentRenderer_fn, updateComponentProps_fn;
|
|
3755
3822
|
var NovuUI = class {
|