@novu/js 2.2.0 → 2.3.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-7B52C2XE.js +70 -0
- package/dist/cjs/{chunk-HEC6BX2T.js → chunk-AALXN67T.js} +237 -304
- package/dist/cjs/index.js +15 -14
- package/dist/cjs/themes/index.d.ts +7 -0
- package/dist/cjs/themes/index.js +17 -0
- package/dist/cjs/types-yDke_w6U.d.ts +98 -0
- package/dist/cjs/ui/index.d.ts +6 -97
- package/dist/cjs/ui/index.js +162 -145
- package/dist/esm/{chunk-J3BKCO4X.mjs → chunk-QIWP6QB5.mjs} +2 -61
- package/dist/esm/chunk-STZMOEWR.mjs +61 -0
- package/dist/esm/index.mjs +2 -1
- package/dist/esm/themes/index.d.mts +7 -0
- package/dist/esm/themes/index.mjs +15 -0
- package/dist/esm/types-xYLv4vWZ.d.mts +98 -0
- package/dist/esm/ui/index.d.mts +6 -97
- package/dist/esm/ui/index.mjs +67 -50
- package/dist/index.css +1 -1
- package/dist/novu.min.js +1 -1
- package/dist/novu.min.js.gz +0 -0
- package/package.json +13 -2
- package/themes/package.json +5 -0
package/dist/cjs/ui/index.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunkAALXN67T_js = require('../chunk-AALXN67T.js');
|
|
4
|
+
var chunk7B52C2XE_js = require('../chunk-7B52C2XE.js');
|
|
4
5
|
var web = require('solid-js/web');
|
|
5
6
|
var solidJs = require('solid-js');
|
|
6
7
|
var store = require('solid-js/store');
|
|
@@ -25,7 +26,7 @@ var defaultVariables = {
|
|
|
25
26
|
colorCounterForeground: "white",
|
|
26
27
|
colorBackground: "#FCFCFC",
|
|
27
28
|
colorForeground: "#1A1523",
|
|
28
|
-
colorNeutral: "
|
|
29
|
+
colorNeutral: "#525252",
|
|
29
30
|
colorShadow: "rgba(122,133,153,0.25)",
|
|
30
31
|
fontSize: "inherit",
|
|
31
32
|
borderRadius: "0.375rem"
|
|
@@ -203,7 +204,7 @@ function createInfiniteScroll(fetcher) {
|
|
|
203
204
|
setData(content.data);
|
|
204
205
|
});
|
|
205
206
|
});
|
|
206
|
-
const reset = () =>
|
|
207
|
+
const reset = () => chunk7B52C2XE_js.__async(this, null, function* () {
|
|
207
208
|
setData([]);
|
|
208
209
|
setInitialLoading(true);
|
|
209
210
|
setEnd(false);
|
|
@@ -441,14 +442,15 @@ var AppearanceProvider = (props) => {
|
|
|
441
442
|
var _a;
|
|
442
443
|
return ((_a = props.appearance) == null ? void 0 : _a.variables) || {};
|
|
443
444
|
};
|
|
444
|
-
const elements = () => {
|
|
445
|
-
var _a;
|
|
446
|
-
return ((_a = props.appearance) == null ? void 0 : _a.elements) || {};
|
|
447
|
-
};
|
|
448
445
|
const animations = () => {
|
|
449
446
|
var _a, _b;
|
|
450
447
|
return (_b = (_a = props.appearance) == null ? void 0 : _a.animations) != null ? _b : true;
|
|
451
448
|
};
|
|
449
|
+
const allElements = solidJs.createMemo(() => {
|
|
450
|
+
var _a;
|
|
451
|
+
const baseElements = themes().reduce((acc, obj) => chunk7B52C2XE_js.__spreadValues(chunk7B52C2XE_js.__spreadValues({}, acc), obj.elements || {}), {});
|
|
452
|
+
return chunk7B52C2XE_js.__spreadValues(chunk7B52C2XE_js.__spreadValues({}, baseElements), ((_a = props.appearance) == null ? void 0 : _a.elements) || {});
|
|
453
|
+
});
|
|
452
454
|
solidJs.onMount(() => {
|
|
453
455
|
const el = document.getElementById(props.id);
|
|
454
456
|
if (el) {
|
|
@@ -472,17 +474,16 @@ var AppearanceProvider = (props) => {
|
|
|
472
474
|
if (!styleEl) {
|
|
473
475
|
return;
|
|
474
476
|
}
|
|
475
|
-
const baseVariables =
|
|
476
|
-
setVariableRules(parseVariables(
|
|
477
|
+
const baseVariables = chunk7B52C2XE_js.__spreadValues(chunk7B52C2XE_js.__spreadValues({}, defaultVariables), themes().reduce((acc, obj) => chunk7B52C2XE_js.__spreadValues(chunk7B52C2XE_js.__spreadValues({}, acc), obj.variables || {}), {}));
|
|
478
|
+
setVariableRules(parseVariables(chunk7B52C2XE_js.__spreadValues(chunk7B52C2XE_js.__spreadValues({}, baseVariables), ((_a = props.appearance) == null ? void 0 : _a.variables) || {}), props.id));
|
|
477
479
|
});
|
|
478
480
|
solidJs.createEffect(() => {
|
|
479
481
|
const styleEl = styleElement();
|
|
480
482
|
if (!styleEl) {
|
|
481
483
|
return;
|
|
482
484
|
}
|
|
483
|
-
const
|
|
484
|
-
|
|
485
|
-
setStore("appearanceKeyToCssInJsClass", (obj) => chunkHEC6BX2T_js.__spreadValues(chunkHEC6BX2T_js.__spreadValues({}, obj), elementsStyleData.reduce((acc, item) => {
|
|
485
|
+
const elementsStyleData = parseElements(allElements());
|
|
486
|
+
setStore("appearanceKeyToCssInJsClass", (obj) => chunk7B52C2XE_js.__spreadValues(chunk7B52C2XE_js.__spreadValues({}, obj), elementsStyleData.reduce((acc, item) => {
|
|
486
487
|
acc[item.key] = item.className;
|
|
487
488
|
return acc;
|
|
488
489
|
}, {})));
|
|
@@ -498,7 +499,7 @@ var AppearanceProvider = (props) => {
|
|
|
498
499
|
return web.createComponent(AppearanceContext.Provider, {
|
|
499
500
|
get value() {
|
|
500
501
|
return {
|
|
501
|
-
elements,
|
|
502
|
+
elements: allElements,
|
|
502
503
|
variables,
|
|
503
504
|
appearanceKeyToCssInJsClass: store$1.appearanceKeyToCssInJsClass,
|
|
504
505
|
// stores are reactive
|
|
@@ -597,10 +598,10 @@ var LocalizationProvider = (props) => {
|
|
|
597
598
|
const localization = solidJs.createMemo(() => {
|
|
598
599
|
const _a = props.localization || {}, {
|
|
599
600
|
dynamic
|
|
600
|
-
} = _a, localizationObject =
|
|
601
|
+
} = _a, localizationObject = chunk7B52C2XE_js.__objRest(_a, [
|
|
601
602
|
"dynamic"
|
|
602
603
|
]);
|
|
603
|
-
return
|
|
604
|
+
return chunk7B52C2XE_js.__spreadValues(chunk7B52C2XE_js.__spreadValues(chunk7B52C2XE_js.__spreadValues(chunk7B52C2XE_js.__spreadValues({}, defaultLocalization), dynamicLocalization()), dynamic || {}), localizationObject);
|
|
604
605
|
});
|
|
605
606
|
const t = (key, ...args) => {
|
|
606
607
|
const value = localization()[key];
|
|
@@ -657,14 +658,14 @@ var InboxProvider = (props) => {
|
|
|
657
658
|
const [activeTab, setActiveTab] = solidJs.createSignal((_a = props.tabs[0] && props.tabs[0].label) != null ? _a : "");
|
|
658
659
|
const [status, setStatus] = solidJs.createSignal("unreadRead" /* UNREAD_READ */);
|
|
659
660
|
const [limit, setLimit] = solidJs.createSignal(DEFAULT_LIMIT);
|
|
660
|
-
const [filter, setFilter] = solidJs.createSignal(
|
|
661
|
+
const [filter, setFilter] = solidJs.createSignal(chunk7B52C2XE_js.__spreadProps(chunk7B52C2XE_js.__spreadValues({}, STATUS_TO_FILTER["unreadRead" /* UNREAD_READ */]), {
|
|
661
662
|
tags: props.tabs.length > 0 ? getTagsFromTab(props.tabs[0]) : []
|
|
662
663
|
}));
|
|
663
664
|
const [hideBranding, setHideBranding] = solidJs.createSignal(false);
|
|
664
665
|
const [preferencesFilter, setPreferencesFilter] = solidJs.createSignal(props.preferencesFilter);
|
|
665
666
|
const setNewStatus = (newStatus) => {
|
|
666
667
|
setStatus(newStatus);
|
|
667
|
-
setFilter((old) =>
|
|
668
|
+
setFilter((old) => chunk7B52C2XE_js.__spreadProps(chunk7B52C2XE_js.__spreadValues({}, STATUS_TO_FILTER[newStatus]), {
|
|
668
669
|
tags: old.tags
|
|
669
670
|
}));
|
|
670
671
|
};
|
|
@@ -675,7 +676,7 @@ var InboxProvider = (props) => {
|
|
|
675
676
|
return;
|
|
676
677
|
}
|
|
677
678
|
setActiveTab(newActiveTab);
|
|
678
|
-
setFilter((old) =>
|
|
679
|
+
setFilter((old) => chunk7B52C2XE_js.__spreadProps(chunk7B52C2XE_js.__spreadValues({}, old), {
|
|
679
680
|
tags
|
|
680
681
|
}));
|
|
681
682
|
};
|
|
@@ -702,7 +703,7 @@ var InboxProvider = (props) => {
|
|
|
702
703
|
const firstTab = props.tabs[0];
|
|
703
704
|
const tags = getTagsFromTab(firstTab);
|
|
704
705
|
setActiveTab((_a2 = firstTab == null ? void 0 : firstTab.label) != null ? _a2 : "");
|
|
705
|
-
setFilter((old) =>
|
|
706
|
+
setFilter((old) => chunk7B52C2XE_js.__spreadProps(chunk7B52C2XE_js.__spreadValues({}, old), {
|
|
706
707
|
tags
|
|
707
708
|
}));
|
|
708
709
|
setPreferencesFilter(props.preferencesFilter);
|
|
@@ -748,7 +749,7 @@ var useInboxContext = () => {
|
|
|
748
749
|
};
|
|
749
750
|
var NovuContext = solidJs.createContext(void 0);
|
|
750
751
|
function NovuProvider(props) {
|
|
751
|
-
const novu = solidJs.createMemo(() => props.novu || new
|
|
752
|
+
const novu = solidJs.createMemo(() => props.novu || new chunkAALXN67T_js.Novu(props.options));
|
|
752
753
|
return web.createComponent(NovuContext.Provider, {
|
|
753
754
|
get value() {
|
|
754
755
|
return novu();
|
|
@@ -780,7 +781,7 @@ var CountProvider = (props) => {
|
|
|
780
781
|
const [totalUnreadCount, setTotalUnreadCount] = solidJs.createSignal(0);
|
|
781
782
|
const [unreadCounts, setUnreadCounts] = solidJs.createSignal(/* @__PURE__ */ new Map());
|
|
782
783
|
const [newNotificationCounts, setNewNotificationCounts] = solidJs.createSignal(/* @__PURE__ */ new Map());
|
|
783
|
-
const updateTabCounts = () =>
|
|
784
|
+
const updateTabCounts = () => chunk7B52C2XE_js.__async(void 0, null, function* () {
|
|
784
785
|
if (tabs().length === 0) {
|
|
785
786
|
return;
|
|
786
787
|
}
|
|
@@ -831,7 +832,7 @@ var CountProvider = (props) => {
|
|
|
831
832
|
const updateNewNotificationCountsOrCache = (notification, tags) => {
|
|
832
833
|
const notificationsCache = novu.notifications.cache;
|
|
833
834
|
const limitValue = limit();
|
|
834
|
-
const tabFilter =
|
|
835
|
+
const tabFilter = chunk7B52C2XE_js.__spreadProps(chunk7B52C2XE_js.__spreadValues({}, filter()), {
|
|
835
836
|
tags,
|
|
836
837
|
offset: 0,
|
|
837
838
|
limit: limitValue
|
|
@@ -847,7 +848,7 @@ var CountProvider = (props) => {
|
|
|
847
848
|
};
|
|
848
849
|
const hasLessThenMinAmount = ((cachedData == null ? void 0 : cachedData.notifications.length) || 0) < MIN_AMOUNT_OF_NOTIFICATIONS;
|
|
849
850
|
if (hasLessThenMinAmount) {
|
|
850
|
-
notificationsCache.update(tabFilter,
|
|
851
|
+
notificationsCache.update(tabFilter, chunk7B52C2XE_js.__spreadProps(chunk7B52C2XE_js.__spreadValues({}, cachedData), {
|
|
851
852
|
notifications: [notification, ...cachedData.notifications]
|
|
852
853
|
}));
|
|
853
854
|
return;
|
|
@@ -861,7 +862,7 @@ var CountProvider = (props) => {
|
|
|
861
862
|
};
|
|
862
863
|
useWebSocketEvent({
|
|
863
864
|
event: "notifications.notification_received",
|
|
864
|
-
eventHandler: (_0) =>
|
|
865
|
+
eventHandler: (_0) => chunk7B52C2XE_js.__async(void 0, [_0], function* ({
|
|
865
866
|
result: notification
|
|
866
867
|
}) {
|
|
867
868
|
if (filter().archived) {
|
|
@@ -1029,15 +1030,11 @@ function useFocusManager() {
|
|
|
1029
1030
|
return context;
|
|
1030
1031
|
}
|
|
1031
1032
|
var _tmpl$ = /* @__PURE__ */ web.template(`<div>`);
|
|
1032
|
-
var ExternalElementRenderer = (
|
|
1033
|
-
var _b = _a, {
|
|
1034
|
-
render: render2
|
|
1035
|
-
} = _b, rest = chunkHEC6BX2T_js.__objRest(_b, [
|
|
1036
|
-
"render"
|
|
1037
|
-
]);
|
|
1033
|
+
var ExternalElementRenderer = (props) => {
|
|
1038
1034
|
let ref;
|
|
1035
|
+
const [local, rest] = solidJs.splitProps(props, ["render"]);
|
|
1039
1036
|
solidJs.createEffect(() => {
|
|
1040
|
-
const unmount =
|
|
1037
|
+
const unmount = local.render(ref);
|
|
1041
1038
|
solidJs.onCleanup(() => {
|
|
1042
1039
|
unmount();
|
|
1043
1040
|
});
|
|
@@ -1221,7 +1218,7 @@ var BellContainer = (props) => {
|
|
|
1221
1218
|
return _el$2;
|
|
1222
1219
|
}
|
|
1223
1220
|
}), null);
|
|
1224
|
-
web.effect(() => web.className(_el$, style("bellContainer", `nt-h-6 nt-w-6 nt-flex nt-justify-center nt-items-center nt-rounded-md nt-relative nt-text-foreground
|
|
1221
|
+
web.effect(() => web.className(_el$, style("bellContainer", `nt-h-6 nt-w-6 nt-flex nt-justify-center nt-items-center nt-rounded-md nt-relative nt-text-foreground nt-cursor-pointer`)));
|
|
1225
1222
|
return _el$;
|
|
1226
1223
|
})();
|
|
1227
1224
|
};
|
|
@@ -1271,8 +1268,8 @@ var buttonVariants = classVarianceAuthority.cva("nt-inline-flex nt-gap-4 nt-item
|
|
|
1271
1268
|
variant: {
|
|
1272
1269
|
default: "nt-bg-primary nt-text-primary-foreground hover:nt-bg-primary-alpha-900",
|
|
1273
1270
|
secondary: "nt-bg-secondary nt-text-secondary-foreground hover:nt-bg-secondary-alpha-800",
|
|
1274
|
-
icon: "nt-text-secondary-foreground-alpha-500 hover:nt-bg-neutral-
|
|
1275
|
-
ghost: "hover:nt-bg-neutral-
|
|
1271
|
+
icon: "nt-text-secondary-foreground-alpha-500 hover:nt-bg-neutral-alpha-50",
|
|
1272
|
+
ghost: "hover:nt-bg-neutral-alpha-50",
|
|
1276
1273
|
unstyled: ""
|
|
1277
1274
|
},
|
|
1278
1275
|
size: {
|
|
@@ -1369,11 +1366,24 @@ function PopoverRoot(props) {
|
|
|
1369
1366
|
const [floating, setFloating] = solidJs.createSignal(null);
|
|
1370
1367
|
const position = solidFloatingUi.useFloating(reference, floating, {
|
|
1371
1368
|
placement: props.placement || "bottom-start",
|
|
1372
|
-
whileElementsMounted: dom.autoUpdate,
|
|
1369
|
+
whileElementsMounted: (reference2, floating2, update) => dom.autoUpdate(reference2, floating2, update, {
|
|
1370
|
+
elementResize: false,
|
|
1371
|
+
ancestorScroll: false,
|
|
1372
|
+
animationFrame: false,
|
|
1373
|
+
layoutShift: false
|
|
1374
|
+
}),
|
|
1373
1375
|
middleware: [dom.offset(10), dom.flip({
|
|
1374
1376
|
fallbackPlacements: props.fallbackPlacements || ["top-start"]
|
|
1375
1377
|
}), dom.shift()]
|
|
1376
1378
|
});
|
|
1379
|
+
const floatingStyles = solidJs.createMemo(() => {
|
|
1380
|
+
var _a2, _b;
|
|
1381
|
+
return {
|
|
1382
|
+
position: position.strategy,
|
|
1383
|
+
top: `${(_a2 = position.y) != null ? _a2 : 0}px`,
|
|
1384
|
+
left: `${(_b = position.x) != null ? _b : 0}px`
|
|
1385
|
+
};
|
|
1386
|
+
});
|
|
1377
1387
|
const onClose = () => {
|
|
1378
1388
|
onOpenChange()(false);
|
|
1379
1389
|
};
|
|
@@ -1389,14 +1399,7 @@ function PopoverRoot(props) {
|
|
|
1389
1399
|
floating,
|
|
1390
1400
|
setFloating,
|
|
1391
1401
|
open,
|
|
1392
|
-
floatingStyles
|
|
1393
|
-
var _a2, _b;
|
|
1394
|
-
return {
|
|
1395
|
-
position: position.strategy,
|
|
1396
|
-
top: `${(_a2 = position.y) != null ? _a2 : 0}px`,
|
|
1397
|
-
left: `${(_b = position.x) != null ? _b : 0}px`
|
|
1398
|
-
};
|
|
1399
|
-
}
|
|
1402
|
+
floatingStyles
|
|
1400
1403
|
},
|
|
1401
1404
|
get children() {
|
|
1402
1405
|
return props.children;
|
|
@@ -1455,6 +1458,7 @@ var PopoverContentBody = (props) => {
|
|
|
1455
1458
|
}, rest));
|
|
1456
1459
|
};
|
|
1457
1460
|
var PopoverContent = (props) => {
|
|
1461
|
+
const [local, rest] = solidJs.splitProps(props, ["portal"]);
|
|
1458
1462
|
const {
|
|
1459
1463
|
open,
|
|
1460
1464
|
onClose,
|
|
@@ -1495,11 +1499,21 @@ var PopoverContent = (props) => {
|
|
|
1495
1499
|
return open();
|
|
1496
1500
|
},
|
|
1497
1501
|
get children() {
|
|
1498
|
-
return web.createComponent(
|
|
1502
|
+
return web.createComponent(solidJs.Show, {
|
|
1503
|
+
get when() {
|
|
1504
|
+
return local.portal;
|
|
1505
|
+
},
|
|
1506
|
+
get fallback() {
|
|
1507
|
+
return web.createComponent(PopoverContentBody, rest);
|
|
1508
|
+
},
|
|
1499
1509
|
get children() {
|
|
1500
|
-
return web.createComponent(
|
|
1510
|
+
return web.createComponent(web.Portal, {
|
|
1501
1511
|
get children() {
|
|
1502
|
-
return web.createComponent(
|
|
1512
|
+
return web.createComponent(Root, {
|
|
1513
|
+
get children() {
|
|
1514
|
+
return web.createComponent(PopoverContentBody, rest);
|
|
1515
|
+
}
|
|
1516
|
+
});
|
|
1503
1517
|
}
|
|
1504
1518
|
});
|
|
1505
1519
|
}
|
|
@@ -1990,15 +2004,15 @@ var StatusDropdown = () => {
|
|
|
1990
2004
|
};
|
|
1991
2005
|
var useNotificationsInfiniteScroll = (props) => {
|
|
1992
2006
|
const novu = useNovu();
|
|
1993
|
-
let filter =
|
|
1994
|
-
const [data, { initialLoading, setEl, end, mutate, reset }] = createInfiniteScroll((offset3) =>
|
|
2007
|
+
let filter = chunk7B52C2XE_js.__spreadValues({}, props.options());
|
|
2008
|
+
const [data, { initialLoading, setEl, end, mutate, reset }] = createInfiniteScroll((offset3) => chunk7B52C2XE_js.__async(void 0, null, function* () {
|
|
1995
2009
|
var _a, _b;
|
|
1996
|
-
const { data: data2 } = yield novu.notifications.list(
|
|
2010
|
+
const { data: data2 } = yield novu.notifications.list(chunk7B52C2XE_js.__spreadProps(chunk7B52C2XE_js.__spreadValues({}, props.options() || {}), { offset: offset3 }));
|
|
1997
2011
|
return { data: (_a = data2 == null ? void 0 : data2.notifications) != null ? _a : [], hasMore: (_b = data2 == null ? void 0 : data2.hasMore) != null ? _b : false };
|
|
1998
2012
|
}));
|
|
1999
2013
|
solidJs.onMount(() => {
|
|
2000
2014
|
const listener = ({ data: data2 }) => {
|
|
2001
|
-
if (!data2 || !
|
|
2015
|
+
if (!data2 || !chunkAALXN67T_js.isSameFilter(filter, data2.filter)) {
|
|
2002
2016
|
return;
|
|
2003
2017
|
}
|
|
2004
2018
|
mutate({ data: data2.notifications, hasMore: data2.hasMore });
|
|
@@ -2007,8 +2021,8 @@ var useNotificationsInfiniteScroll = (props) => {
|
|
|
2007
2021
|
solidJs.onCleanup(() => novu.off("notifications.list.updated", listener));
|
|
2008
2022
|
});
|
|
2009
2023
|
solidJs.createEffect(() => {
|
|
2010
|
-
const newFilter =
|
|
2011
|
-
if (
|
|
2024
|
+
const newFilter = chunk7B52C2XE_js.__spreadValues({}, props.options());
|
|
2025
|
+
if (chunkAALXN67T_js.isSameFilter(filter, newFilter)) {
|
|
2012
2026
|
return;
|
|
2013
2027
|
}
|
|
2014
2028
|
novu.notifications.clearCache();
|
|
@@ -2024,7 +2038,7 @@ var useNotificationsInfiniteScroll = (props) => {
|
|
|
2024
2038
|
var usePreferences = (options) => {
|
|
2025
2039
|
const novu = useNovu();
|
|
2026
2040
|
const [loading, setLoading] = solidJs.createSignal(true);
|
|
2027
|
-
const [preferences, { mutate, refetch }] = solidJs.createResource(options || {}, (_0) =>
|
|
2041
|
+
const [preferences, { mutate, refetch }] = solidJs.createResource(options || {}, (_0) => chunk7B52C2XE_js.__async(void 0, [_0], function* ({ tags }) {
|
|
2028
2042
|
try {
|
|
2029
2043
|
const response = yield novu.preferences.list({ tags });
|
|
2030
2044
|
return response.data;
|
|
@@ -2052,7 +2066,7 @@ var usePreferences = (options) => {
|
|
|
2052
2066
|
// src/ui/api/hooks/useReadAll.ts
|
|
2053
2067
|
var useReadAll = (props) => {
|
|
2054
2068
|
const novu = useNovu();
|
|
2055
|
-
const readAll = (..._0) =>
|
|
2069
|
+
const readAll = (..._0) => chunk7B52C2XE_js.__async(void 0, [..._0], function* ({ tags } = {}) {
|
|
2056
2070
|
var _a, _b;
|
|
2057
2071
|
try {
|
|
2058
2072
|
yield novu.notifications.readAll({ tags });
|
|
@@ -2067,7 +2081,7 @@ var useReadAll = (props) => {
|
|
|
2067
2081
|
// src/ui/api/hooks/useArchiveAll.ts
|
|
2068
2082
|
var useArchiveAll = (props) => {
|
|
2069
2083
|
const novu = useNovu();
|
|
2070
|
-
const archiveAll = (..._0) =>
|
|
2084
|
+
const archiveAll = (..._0) => chunk7B52C2XE_js.__async(void 0, [..._0], function* ({ tags } = {}) {
|
|
2071
2085
|
var _a, _b;
|
|
2072
2086
|
try {
|
|
2073
2087
|
yield novu.notifications.archiveAll({ tags });
|
|
@@ -2082,7 +2096,7 @@ var useArchiveAll = (props) => {
|
|
|
2082
2096
|
// src/ui/api/hooks/useArchiveAllRead.ts
|
|
2083
2097
|
var useArchiveAllRead = (props) => {
|
|
2084
2098
|
const novu = useNovu();
|
|
2085
|
-
const archiveAllRead = (..._0) =>
|
|
2099
|
+
const archiveAllRead = (..._0) => chunk7B52C2XE_js.__async(void 0, [..._0], function* ({ tags } = {}) {
|
|
2086
2100
|
var _a, _b;
|
|
2087
2101
|
try {
|
|
2088
2102
|
yield novu.notifications.archiveAllRead({ tags });
|
|
@@ -2352,7 +2366,7 @@ function useTooltip() {
|
|
|
2352
2366
|
|
|
2353
2367
|
// src/ui/components/primitives/Tooltip/TooltipContent.tsx
|
|
2354
2368
|
var _tmpl$37 = /* @__PURE__ */ web.template(`<div>`);
|
|
2355
|
-
var tooltipContentVariants = () => "nt-bg-foreground nt-p-
|
|
2369
|
+
var tooltipContentVariants = () => "nt-bg-foreground nt-p-2 nt-shadow-tooltip nt-rounded-lg nt-text-background nt-text-xs";
|
|
2356
2370
|
var TooltipContentBody = (props) => {
|
|
2357
2371
|
const {
|
|
2358
2372
|
open,
|
|
@@ -2381,7 +2395,9 @@ var TooltipContentBody = (props) => {
|
|
|
2381
2395
|
return web.memo(() => !!local.class)() ? local.class : style(local.appearanceKey || "tooltipContent", tooltipContentVariants());
|
|
2382
2396
|
},
|
|
2383
2397
|
get style() {
|
|
2384
|
-
return floatingStyles()
|
|
2398
|
+
return chunk7B52C2XE_js.__spreadProps(chunk7B52C2XE_js.__spreadValues({}, floatingStyles()), {
|
|
2399
|
+
"z-index": 99999
|
|
2400
|
+
});
|
|
2385
2401
|
},
|
|
2386
2402
|
get ["data-open"]() {
|
|
2387
2403
|
return open();
|
|
@@ -2474,13 +2490,13 @@ var Switch = (props) => {
|
|
|
2474
2490
|
});
|
|
2475
2491
|
web.effect((_p$) => {
|
|
2476
2492
|
var _v$ = style("channelSwitch", `nt-relative
|
|
2477
|
-
nt-inline-flex nt-cursor-pointer nt-items-center`), _v$2 = props.disabled, _v$3 = props.disabled, _v$4 = style("channelSwitchThumb", `nt-peer nt-h-6 nt-w-11 nt-rounded-full nt-border nt-bg-
|
|
2493
|
+
nt-inline-flex nt-cursor-pointer nt-items-center data-[disabled=true]:nt-cursor-not-allowed`), _v$2 = props.disabled, _v$3 = props.disabled, _v$4 = style("channelSwitchThumb", `nt-peer nt-h-6 nt-w-11 nt-rounded-full nt-border nt-border-neutral-alpha-200 peer-checked:nt-border-neutral-alpha-400 nt-bg-neutral-alpha-300
|
|
2478
2494
|
after:nt-absolute after:nt-left-[2px] after:nt-top-0.5 after:nt-h-5
|
|
2479
2495
|
after:nt-w-5 after:nt-rounded-full after:nt-border
|
|
2480
|
-
after:nt-border-
|
|
2481
|
-
after:nt-bg-
|
|
2496
|
+
after:nt-border-neutral-alpha-400
|
|
2497
|
+
after:nt-bg-background after:nt-transition-all after:nt-content-['']
|
|
2482
2498
|
peer-checked:nt-bg-primary peer-checked:after:nt-translate-x-full
|
|
2483
|
-
peer-checked:after:nt-border-
|
|
2499
|
+
peer-checked:after:nt-border-background
|
|
2484
2500
|
nt-transition-all nt-duration-200 after:nt-duration-200
|
|
2485
2501
|
data-[disabled=true]:nt-opacity-40`), _v$5 = props.disabled, _v$6 = props.checked;
|
|
2486
2502
|
_v$ !== _p$.e && web.className(_el$, _p$.e = _v$);
|
|
@@ -2507,7 +2523,7 @@ var Switch = (props) => {
|
|
|
2507
2523
|
var _tmpl$40 = /* @__PURE__ */ web.template(`<div><div><div></div><span></span></div><div>`);
|
|
2508
2524
|
var ChannelRow = (props) => {
|
|
2509
2525
|
const style = useStyle();
|
|
2510
|
-
const updatePreference = (enabled) =>
|
|
2526
|
+
const updatePreference = (enabled) => chunk7B52C2XE_js.__async(void 0, null, function* () {
|
|
2511
2527
|
if (props.isCritical) {
|
|
2512
2528
|
return;
|
|
2513
2529
|
}
|
|
@@ -2669,7 +2685,7 @@ var Preferences = () => {
|
|
|
2669
2685
|
solidJs.createEffect(() => {
|
|
2670
2686
|
setDynamicLocalization((prev) => {
|
|
2671
2687
|
var _a2;
|
|
2672
|
-
return
|
|
2688
|
+
return chunk7B52C2XE_js.__spreadValues(chunk7B52C2XE_js.__spreadValues({}, prev), (_a2 = allPreferences().workflowPreferences) == null ? void 0 : _a2.reduce((acc, preference) => {
|
|
2673
2689
|
acc[preference.workflow.identifier] = preference.workflow.name;
|
|
2674
2690
|
return acc;
|
|
2675
2691
|
}, {}));
|
|
@@ -2759,7 +2775,7 @@ var ChannelsLabel = (props) => {
|
|
|
2759
2775
|
var _el$2 = _tmpl$212();
|
|
2760
2776
|
web.setAttribute(_el$2, "data-disabled", isDisabled);
|
|
2761
2777
|
web.insert(_el$2, () => getLabel(key));
|
|
2762
|
-
web.effect(() => web.className(_el$2, style("channelName", "data-[disabled=true]:nt-text-foreground-alpha-
|
|
2778
|
+
web.effect(() => web.className(_el$2, style("channelName", "data-[disabled=true]:nt-text-foreground-alpha-400")));
|
|
2763
2779
|
return _el$2;
|
|
2764
2780
|
})();
|
|
2765
2781
|
channels.push(element);
|
|
@@ -2847,7 +2863,7 @@ var PreferencesRow = (props) => {
|
|
|
2847
2863
|
easing: "ease-out"
|
|
2848
2864
|
},
|
|
2849
2865
|
get ["class"]() {
|
|
2850
|
-
return style("channelsContainerCollapsible", "nt-grid");
|
|
2866
|
+
return style("channelsContainerCollapsible", "nt-grid nt-self-stretch");
|
|
2851
2867
|
},
|
|
2852
2868
|
get children() {
|
|
2853
2869
|
var _el$9 = _tmpl$43();
|
|
@@ -2892,7 +2908,7 @@ var PreferencesRow = (props) => {
|
|
|
2892
2908
|
}), null);
|
|
2893
2909
|
web.effect((_p$) => {
|
|
2894
2910
|
var _v$ = style("workflowContainer", `nt-p-4 nt-flex nt-flex-col nt-gap-1 nt-items-start nt-self-stretch
|
|
2895
|
-
hover:nt-bg-neutral-
|
|
2911
|
+
hover:nt-bg-neutral-alpha-50 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();
|
|
2896
2912
|
_v$ !== _p$.e && web.className(_el$4, _p$.e = _v$);
|
|
2897
2913
|
_v$2 !== _p$.t && web.setAttribute(_el$4, "data-disabled", _p$.t = _v$2);
|
|
2898
2914
|
_v$3 !== _p$.a && web.setAttribute(_el$4, "data-open", _p$.a = _v$3);
|
|
@@ -2973,7 +2989,7 @@ var Markdown = (props) => {
|
|
|
2973
2989
|
const _a = props, {
|
|
2974
2990
|
children,
|
|
2975
2991
|
strongAppearanceKey
|
|
2976
|
-
} = _a, rest =
|
|
2992
|
+
} = _a, rest = chunk7B52C2XE_js.__objRest(_a, [
|
|
2977
2993
|
"children",
|
|
2978
2994
|
"strongAppearanceKey"
|
|
2979
2995
|
]);
|
|
@@ -3010,7 +3026,7 @@ var Markdown_default = Markdown;
|
|
|
3010
3026
|
// src/ui/components/Notification/DefaultNotification.tsx
|
|
3011
3027
|
var _tmpl$46 = /* @__PURE__ */ web.template(`<span>`);
|
|
3012
3028
|
var _tmpl$214 = /* @__PURE__ */ web.template(`<img>`);
|
|
3013
|
-
var _tmpl$311 = /* @__PURE__ */ web.template(`<a><div><div class="nt-relative nt-shrink-0 nt-float-right nt-ml-
|
|
3029
|
+
var _tmpl$311 = /* @__PURE__ */ web.template(`<a><div><div class="nt-relative nt-shrink-0 nt-float-right nt-ml-1 nt-pr-1.5"><p></p><div></div></div><div>`);
|
|
3014
3030
|
var DefaultNotification = (props) => {
|
|
3015
3031
|
const style = useStyle();
|
|
3016
3032
|
const {
|
|
@@ -3067,7 +3083,7 @@ var DefaultNotification = (props) => {
|
|
|
3067
3083
|
},
|
|
3068
3084
|
get children() {
|
|
3069
3085
|
var _el$2 = _tmpl$46();
|
|
3070
|
-
web.effect(() => web.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")));
|
|
3086
|
+
web.effect(() => web.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 nt-border-neutral-alpha-200")));
|
|
3071
3087
|
return _el$2;
|
|
3072
3088
|
}
|
|
3073
3089
|
}), _el$4);
|
|
@@ -3112,7 +3128,7 @@ var DefaultNotification = (props) => {
|
|
|
3112
3128
|
e.stopPropagation();
|
|
3113
3129
|
props.notification.read();
|
|
3114
3130
|
},
|
|
3115
|
-
"class": "hover:nt-bg-neutral-
|
|
3131
|
+
"class": "hover:nt-bg-neutral-alpha-50",
|
|
3116
3132
|
get children() {
|
|
3117
3133
|
return web.createComponent(ReadAll, {});
|
|
3118
3134
|
}
|
|
@@ -3139,7 +3155,7 @@ var DefaultNotification = (props) => {
|
|
|
3139
3155
|
e.stopPropagation();
|
|
3140
3156
|
props.notification.unread();
|
|
3141
3157
|
},
|
|
3142
|
-
"class": "hover:nt-bg-neutral-
|
|
3158
|
+
"class": "hover:nt-bg-neutral-alpha-50",
|
|
3143
3159
|
get children() {
|
|
3144
3160
|
return web.createComponent(Unread, {});
|
|
3145
3161
|
}
|
|
@@ -3173,7 +3189,7 @@ var DefaultNotification = (props) => {
|
|
|
3173
3189
|
e.stopPropagation();
|
|
3174
3190
|
props.notification.archive();
|
|
3175
3191
|
},
|
|
3176
|
-
"class": "hover:nt-bg-neutral-
|
|
3192
|
+
"class": "hover:nt-bg-neutral-alpha-50",
|
|
3177
3193
|
get children() {
|
|
3178
3194
|
return web.createComponent(Archive, {});
|
|
3179
3195
|
}
|
|
@@ -3200,7 +3216,7 @@ var DefaultNotification = (props) => {
|
|
|
3200
3216
|
e.stopPropagation();
|
|
3201
3217
|
props.notification.unarchive();
|
|
3202
3218
|
},
|
|
3203
|
-
"class": "hover:nt-bg-neutral-
|
|
3219
|
+
"class": "hover:nt-bg-neutral-alpha-50",
|
|
3204
3220
|
get children() {
|
|
3205
3221
|
return web.createComponent(Unarchive, {});
|
|
3206
3222
|
}
|
|
@@ -3268,12 +3284,12 @@ var DefaultNotification = (props) => {
|
|
|
3268
3284
|
}), null);
|
|
3269
3285
|
web.effect((_p$) => {
|
|
3270
3286
|
var _a;
|
|
3271
|
-
var _v$3 = style("notification", cn("nt-w-full nt-text-sm hover:nt-bg-neutral-
|
|
3287
|
+
var _v$3 = style("notification", cn("nt-w-full nt-text-sm hover:nt-bg-neutral-alpha-50 nt-group nt-relative nt-flex nt-py-4 nt-px-6 nt-gap-2", {
|
|
3272
3288
|
"nt-cursor-pointer": !props.notification.isRead || !!((_a = props.notification.redirect) == null ? void 0 : _a.url)
|
|
3273
3289
|
})), _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
|
|
3274
3290
|
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
|
|
3275
3291
|
nt-opacity-0 group-hover:nt-opacity-100 nt-justify-center nt-items-center
|
|
3276
|
-
nt-absolute nt-top-0 nt-right-0
|
|
3292
|
+
nt-absolute nt-top-0 nt-right-0 nt-bg-neutral-alpha-50 nt-py-0.5 nt-rounded`), _v$7 = style("notificationCustomActions", "nt-flex nt-flex-wrap nt-gap-4 nt-mt-4");
|
|
3277
3293
|
_v$3 !== _p$.e && web.className(_el$, _p$.e = _v$3);
|
|
3278
3294
|
_v$4 !== _p$.t && web.className(_el$4, _p$.t = _v$4);
|
|
3279
3295
|
_v$5 !== _p$.a && web.className(_el$6, _p$.a = _v$5);
|
|
@@ -3425,7 +3441,7 @@ var EmptyNotificationList = () => {
|
|
|
3425
3441
|
};
|
|
3426
3442
|
var NotificationList = (props) => {
|
|
3427
3443
|
var _a, _b;
|
|
3428
|
-
const options = solidJs.createMemo(() =>
|
|
3444
|
+
const options = solidJs.createMemo(() => chunk7B52C2XE_js.__spreadProps(chunk7B52C2XE_js.__spreadValues({}, props.filter), {
|
|
3429
3445
|
limit: props.limit
|
|
3430
3446
|
}));
|
|
3431
3447
|
const style = useStyle();
|
|
@@ -3454,7 +3470,7 @@ var NotificationList = (props) => {
|
|
|
3454
3470
|
solidJs.createEffect(() => {
|
|
3455
3471
|
setLimit(props.limit || DEFAULT_LIMIT);
|
|
3456
3472
|
});
|
|
3457
|
-
const handleOnNewMessagesClick = (e) =>
|
|
3473
|
+
const handleOnNewMessagesClick = (e) => chunk7B52C2XE_js.__async(void 0, null, function* () {
|
|
3458
3474
|
e.stopPropagation();
|
|
3459
3475
|
resetNewMessagesCount();
|
|
3460
3476
|
refetch({
|
|
@@ -3688,7 +3704,7 @@ var InboxTabs = (props) => {
|
|
|
3688
3704
|
tags: getTagsFromTab(tab)
|
|
3689
3705
|
}))
|
|
3690
3706
|
});
|
|
3691
|
-
const options = solidJs.createMemo(() => dropdownTabs().map((tab) =>
|
|
3707
|
+
const options = solidJs.createMemo(() => dropdownTabs().map((tab) => chunk7B52C2XE_js.__spreadProps(chunk7B52C2XE_js.__spreadValues({}, tab), {
|
|
3692
3708
|
rightIcon: tab.label === activeTab() ? web.createComponent(Check, {
|
|
3693
3709
|
get ["class"]() {
|
|
3694
3710
|
return style("moreTabs__dropdownItemRight__icon");
|
|
@@ -3805,7 +3821,7 @@ var InboxTabs = (props) => {
|
|
|
3805
3821
|
return props.onSecondaryActionClick;
|
|
3806
3822
|
},
|
|
3807
3823
|
get filter() {
|
|
3808
|
-
return
|
|
3824
|
+
return chunk7B52C2XE_js.__spreadProps(chunk7B52C2XE_js.__spreadValues({}, filter()), {
|
|
3809
3825
|
tags: getTagsFromTab(tab)
|
|
3810
3826
|
});
|
|
3811
3827
|
}
|
|
@@ -3949,6 +3965,7 @@ var Inbox2 = (props) => {
|
|
|
3949
3965
|
}))
|
|
3950
3966
|
}), web.createComponent(Popover.Content, {
|
|
3951
3967
|
appearanceKey: "inbox__popoverContent",
|
|
3968
|
+
portal: true,
|
|
3952
3969
|
get children() {
|
|
3953
3970
|
return web.createComponent(InboxContent, {
|
|
3954
3971
|
get renderNotification() {
|
|
@@ -3973,7 +3990,7 @@ var Inbox2 = (props) => {
|
|
|
3973
3990
|
// src/ui/components/Renderer.tsx
|
|
3974
3991
|
var novuComponents = {
|
|
3975
3992
|
Inbox: Inbox2,
|
|
3976
|
-
|
|
3993
|
+
InboxContent,
|
|
3977
3994
|
Bell,
|
|
3978
3995
|
Notifications: (props) => web.createComponent(InboxContent, web.mergeProps(props, {
|
|
3979
3996
|
hideNav: true,
|
|
@@ -4085,29 +4102,29 @@ var Renderer = (props) => {
|
|
|
4085
4102
|
}
|
|
4086
4103
|
});
|
|
4087
4104
|
};
|
|
4088
|
-
var version = "2.
|
|
4105
|
+
var version = "2.3.0";
|
|
4089
4106
|
var cssHref = `https://cdn.jsdelivr.net/npm/@novu/js@${version}/dist/index.css`;
|
|
4090
4107
|
var _dispose, _rootElement, _mountedElements, _setMountedElements, _appearance, _setAppearance, _localization, _setLocalization, _options, _setOptions, _tabs, _setTabs, _routerPush, _setRouterPush, _preferencesFilter, _setPreferencesFilter, _predefinedNovu, _NovuUI_instances, mountComponentRenderer_fn, updateComponentProps_fn;
|
|
4091
4108
|
var NovuUI = class {
|
|
4092
4109
|
constructor(props) {
|
|
4093
|
-
|
|
4094
|
-
|
|
4095
|
-
|
|
4096
|
-
|
|
4097
|
-
|
|
4098
|
-
|
|
4099
|
-
|
|
4100
|
-
|
|
4101
|
-
|
|
4102
|
-
|
|
4103
|
-
|
|
4104
|
-
|
|
4105
|
-
|
|
4106
|
-
|
|
4107
|
-
|
|
4108
|
-
|
|
4109
|
-
|
|
4110
|
-
|
|
4110
|
+
chunk7B52C2XE_js.__privateAdd(this, _NovuUI_instances);
|
|
4111
|
+
chunk7B52C2XE_js.__privateAdd(this, _dispose, null);
|
|
4112
|
+
chunk7B52C2XE_js.__privateAdd(this, _rootElement);
|
|
4113
|
+
chunk7B52C2XE_js.__privateAdd(this, _mountedElements);
|
|
4114
|
+
chunk7B52C2XE_js.__privateAdd(this, _setMountedElements);
|
|
4115
|
+
chunk7B52C2XE_js.__privateAdd(this, _appearance);
|
|
4116
|
+
chunk7B52C2XE_js.__privateAdd(this, _setAppearance);
|
|
4117
|
+
chunk7B52C2XE_js.__privateAdd(this, _localization);
|
|
4118
|
+
chunk7B52C2XE_js.__privateAdd(this, _setLocalization);
|
|
4119
|
+
chunk7B52C2XE_js.__privateAdd(this, _options);
|
|
4120
|
+
chunk7B52C2XE_js.__privateAdd(this, _setOptions);
|
|
4121
|
+
chunk7B52C2XE_js.__privateAdd(this, _tabs);
|
|
4122
|
+
chunk7B52C2XE_js.__privateAdd(this, _setTabs);
|
|
4123
|
+
chunk7B52C2XE_js.__privateAdd(this, _routerPush);
|
|
4124
|
+
chunk7B52C2XE_js.__privateAdd(this, _setRouterPush);
|
|
4125
|
+
chunk7B52C2XE_js.__privateAdd(this, _preferencesFilter);
|
|
4126
|
+
chunk7B52C2XE_js.__privateAdd(this, _setPreferencesFilter);
|
|
4127
|
+
chunk7B52C2XE_js.__privateAdd(this, _predefinedNovu);
|
|
4111
4128
|
var _a;
|
|
4112
4129
|
this.id = generateRandomString(16);
|
|
4113
4130
|
const [appearance, setAppearance] = solidJs.createSignal(props.appearance);
|
|
@@ -4117,32 +4134,32 @@ var NovuUI = class {
|
|
|
4117
4134
|
const [tabs, setTabs] = solidJs.createSignal((_a = props.tabs) != null ? _a : []);
|
|
4118
4135
|
const [preferencesFilter, setPreferencesFilter] = solidJs.createSignal(props.preferencesFilter);
|
|
4119
4136
|
const [routerPush, setRouterPush] = solidJs.createSignal(props.routerPush);
|
|
4120
|
-
|
|
4121
|
-
|
|
4122
|
-
|
|
4123
|
-
|
|
4124
|
-
|
|
4125
|
-
|
|
4126
|
-
|
|
4127
|
-
|
|
4128
|
-
|
|
4129
|
-
|
|
4130
|
-
|
|
4131
|
-
|
|
4132
|
-
|
|
4133
|
-
|
|
4134
|
-
|
|
4135
|
-
|
|
4137
|
+
chunk7B52C2XE_js.__privateSet(this, _mountedElements, mountedElements);
|
|
4138
|
+
chunk7B52C2XE_js.__privateSet(this, _setMountedElements, setMountedElements);
|
|
4139
|
+
chunk7B52C2XE_js.__privateSet(this, _appearance, appearance);
|
|
4140
|
+
chunk7B52C2XE_js.__privateSet(this, _setAppearance, setAppearance);
|
|
4141
|
+
chunk7B52C2XE_js.__privateSet(this, _localization, localization);
|
|
4142
|
+
chunk7B52C2XE_js.__privateSet(this, _setLocalization, setLocalization);
|
|
4143
|
+
chunk7B52C2XE_js.__privateSet(this, _options, options);
|
|
4144
|
+
chunk7B52C2XE_js.__privateSet(this, _setOptions, setOptions);
|
|
4145
|
+
chunk7B52C2XE_js.__privateSet(this, _tabs, tabs);
|
|
4146
|
+
chunk7B52C2XE_js.__privateSet(this, _setTabs, setTabs);
|
|
4147
|
+
chunk7B52C2XE_js.__privateSet(this, _routerPush, routerPush);
|
|
4148
|
+
chunk7B52C2XE_js.__privateSet(this, _setRouterPush, setRouterPush);
|
|
4149
|
+
chunk7B52C2XE_js.__privateSet(this, _predefinedNovu, props.novu);
|
|
4150
|
+
chunk7B52C2XE_js.__privateSet(this, _preferencesFilter, preferencesFilter);
|
|
4151
|
+
chunk7B52C2XE_js.__privateSet(this, _setPreferencesFilter, setPreferencesFilter);
|
|
4152
|
+
chunk7B52C2XE_js.__privateMethod(this, _NovuUI_instances, mountComponentRenderer_fn).call(this);
|
|
4136
4153
|
}
|
|
4137
4154
|
mountComponent({
|
|
4138
4155
|
name,
|
|
4139
4156
|
element,
|
|
4140
4157
|
props: componentProps
|
|
4141
4158
|
}) {
|
|
4142
|
-
if (
|
|
4143
|
-
return
|
|
4159
|
+
if (chunk7B52C2XE_js.__privateGet(this, _mountedElements).call(this).has(element)) {
|
|
4160
|
+
return chunk7B52C2XE_js.__privateMethod(this, _NovuUI_instances, updateComponentProps_fn).call(this, element, componentProps);
|
|
4144
4161
|
}
|
|
4145
|
-
|
|
4162
|
+
chunk7B52C2XE_js.__privateGet(this, _setMountedElements).call(this, (oldNodes) => {
|
|
4146
4163
|
const newNodes = new Map(oldNodes);
|
|
4147
4164
|
newNodes.set(element, {
|
|
4148
4165
|
name,
|
|
@@ -4152,35 +4169,35 @@ var NovuUI = class {
|
|
|
4152
4169
|
});
|
|
4153
4170
|
}
|
|
4154
4171
|
unmountComponent(element) {
|
|
4155
|
-
|
|
4172
|
+
chunk7B52C2XE_js.__privateGet(this, _setMountedElements).call(this, (oldMountedElements) => {
|
|
4156
4173
|
const newMountedElements = new Map(oldMountedElements);
|
|
4157
4174
|
newMountedElements.delete(element);
|
|
4158
4175
|
return newMountedElements;
|
|
4159
4176
|
});
|
|
4160
4177
|
}
|
|
4161
4178
|
updateAppearance(appearance) {
|
|
4162
|
-
|
|
4179
|
+
chunk7B52C2XE_js.__privateGet(this, _setAppearance).call(this, appearance);
|
|
4163
4180
|
}
|
|
4164
4181
|
updateLocalization(localization) {
|
|
4165
|
-
|
|
4182
|
+
chunk7B52C2XE_js.__privateGet(this, _setLocalization).call(this, localization);
|
|
4166
4183
|
}
|
|
4167
4184
|
updateOptions(options) {
|
|
4168
|
-
|
|
4185
|
+
chunk7B52C2XE_js.__privateGet(this, _setOptions).call(this, options);
|
|
4169
4186
|
}
|
|
4170
4187
|
updateTabs(tabs) {
|
|
4171
|
-
|
|
4188
|
+
chunk7B52C2XE_js.__privateGet(this, _setTabs).call(this, tabs != null ? tabs : []);
|
|
4172
4189
|
}
|
|
4173
4190
|
updatePreferencesFilter(preferencesFilter) {
|
|
4174
|
-
|
|
4191
|
+
chunk7B52C2XE_js.__privateGet(this, _setPreferencesFilter).call(this, preferencesFilter);
|
|
4175
4192
|
}
|
|
4176
4193
|
updateRouterPush(routerPush) {
|
|
4177
|
-
|
|
4194
|
+
chunk7B52C2XE_js.__privateGet(this, _setRouterPush).call(this, () => routerPush);
|
|
4178
4195
|
}
|
|
4179
4196
|
unmount() {
|
|
4180
4197
|
var _a, _b;
|
|
4181
|
-
(_a =
|
|
4182
|
-
|
|
4183
|
-
(_b =
|
|
4198
|
+
(_a = chunk7B52C2XE_js.__privateGet(this, _dispose)) == null ? void 0 : _a.call(this);
|
|
4199
|
+
chunk7B52C2XE_js.__privateSet(this, _dispose, null);
|
|
4200
|
+
(_b = chunk7B52C2XE_js.__privateGet(this, _rootElement)) == null ? void 0 : _b.remove();
|
|
4184
4201
|
}
|
|
4185
4202
|
};
|
|
4186
4203
|
_dispose = new WeakMap();
|
|
@@ -4202,12 +4219,12 @@ _setPreferencesFilter = new WeakMap();
|
|
|
4202
4219
|
_predefinedNovu = new WeakMap();
|
|
4203
4220
|
_NovuUI_instances = new WeakSet();
|
|
4204
4221
|
mountComponentRenderer_fn = function() {
|
|
4205
|
-
if (
|
|
4222
|
+
if (chunk7B52C2XE_js.__privateGet(this, _dispose) !== null) {
|
|
4206
4223
|
return;
|
|
4207
4224
|
}
|
|
4208
|
-
|
|
4209
|
-
|
|
4210
|
-
document.body.appendChild(
|
|
4225
|
+
chunk7B52C2XE_js.__privateSet(this, _rootElement, document.createElement("div"));
|
|
4226
|
+
chunk7B52C2XE_js.__privateGet(this, _rootElement).setAttribute("id", `novu-ui-${this.id}`);
|
|
4227
|
+
document.body.appendChild(chunk7B52C2XE_js.__privateGet(this, _rootElement));
|
|
4211
4228
|
const dispose = web.render(() => {
|
|
4212
4229
|
const _self$ = this;
|
|
4213
4230
|
return web.createComponent(Renderer, {
|
|
@@ -4215,45 +4232,45 @@ mountComponentRenderer_fn = function() {
|
|
|
4215
4232
|
novuUI: _self$,
|
|
4216
4233
|
get nodes() {
|
|
4217
4234
|
var _a;
|
|
4218
|
-
return
|
|
4235
|
+
return chunk7B52C2XE_js.__privateGet(_a = _self$, _mountedElements).call(_a);
|
|
4219
4236
|
},
|
|
4220
4237
|
get options() {
|
|
4221
4238
|
var _a;
|
|
4222
|
-
return
|
|
4239
|
+
return chunk7B52C2XE_js.__privateGet(_a = _self$, _options).call(_a);
|
|
4223
4240
|
},
|
|
4224
4241
|
get appearance() {
|
|
4225
4242
|
var _a;
|
|
4226
|
-
return
|
|
4243
|
+
return chunk7B52C2XE_js.__privateGet(_a = _self$, _appearance).call(_a);
|
|
4227
4244
|
},
|
|
4228
4245
|
get localization() {
|
|
4229
4246
|
var _a;
|
|
4230
|
-
return
|
|
4247
|
+
return chunk7B52C2XE_js.__privateGet(_a = _self$, _localization).call(_a);
|
|
4231
4248
|
},
|
|
4232
4249
|
get tabs() {
|
|
4233
4250
|
var _a;
|
|
4234
|
-
return
|
|
4251
|
+
return chunk7B52C2XE_js.__privateGet(_a = _self$, _tabs).call(_a);
|
|
4235
4252
|
},
|
|
4236
4253
|
get preferencesFilter() {
|
|
4237
4254
|
var _a;
|
|
4238
|
-
return
|
|
4255
|
+
return chunk7B52C2XE_js.__privateGet(_a = _self$, _preferencesFilter).call(_a);
|
|
4239
4256
|
},
|
|
4240
4257
|
get routerPush() {
|
|
4241
4258
|
var _a;
|
|
4242
|
-
return
|
|
4259
|
+
return chunk7B52C2XE_js.__privateGet(_a = _self$, _routerPush).call(_a);
|
|
4243
4260
|
},
|
|
4244
4261
|
get novu() {
|
|
4245
|
-
return
|
|
4262
|
+
return chunk7B52C2XE_js.__privateGet(_self$, _predefinedNovu);
|
|
4246
4263
|
}
|
|
4247
4264
|
});
|
|
4248
|
-
},
|
|
4249
|
-
|
|
4265
|
+
}, chunk7B52C2XE_js.__privateGet(this, _rootElement));
|
|
4266
|
+
chunk7B52C2XE_js.__privateSet(this, _dispose, dispose);
|
|
4250
4267
|
};
|
|
4251
4268
|
updateComponentProps_fn = function(element, props) {
|
|
4252
|
-
|
|
4269
|
+
chunk7B52C2XE_js.__privateGet(this, _setMountedElements).call(this, (oldMountedElements) => {
|
|
4253
4270
|
const newMountedElements = new Map(oldMountedElements);
|
|
4254
4271
|
const mountedElement = newMountedElements.get(element);
|
|
4255
4272
|
if (mountedElement) {
|
|
4256
|
-
newMountedElements.set(element,
|
|
4273
|
+
newMountedElements.set(element, chunk7B52C2XE_js.__spreadProps(chunk7B52C2XE_js.__spreadValues({}, mountedElement), {
|
|
4257
4274
|
props
|
|
4258
4275
|
}));
|
|
4259
4276
|
}
|