@novu/js 2.2.1 → 2.3.1
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 +168 -156
- 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 +73 -61
- package/dist/index.css +1 -1
- package/dist/novu.min.js +1 -1
- package/dist/novu.min.js.gz +0 -0
- package/package.json +17 -4
- 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 });
|
|
@@ -2292,7 +2306,15 @@ var Root = (props) => {
|
|
|
2292
2306
|
id
|
|
2293
2307
|
} = useAppearance();
|
|
2294
2308
|
const style = useStyle();
|
|
2295
|
-
|
|
2309
|
+
const {
|
|
2310
|
+
hideBranding
|
|
2311
|
+
} = useInboxContext();
|
|
2312
|
+
return [web.createComponent(solidJs.Show, {
|
|
2313
|
+
get when() {
|
|
2314
|
+
return !hideBranding();
|
|
2315
|
+
},
|
|
2316
|
+
children: new Comment(" Powered by Novu - https://novu.co ")
|
|
2317
|
+
}), (() => {
|
|
2296
2318
|
var _el$ = _tmpl$36();
|
|
2297
2319
|
web.spread(_el$, web.mergeProps({
|
|
2298
2320
|
get id() {
|
|
@@ -2303,7 +2325,7 @@ var Root = (props) => {
|
|
|
2303
2325
|
}
|
|
2304
2326
|
}, rest), false, false);
|
|
2305
2327
|
return _el$;
|
|
2306
|
-
})();
|
|
2328
|
+
})()];
|
|
2307
2329
|
};
|
|
2308
2330
|
var TooltipContext = solidJs.createContext(void 0);
|
|
2309
2331
|
function TooltipRoot(props) {
|
|
@@ -2352,7 +2374,7 @@ function useTooltip() {
|
|
|
2352
2374
|
|
|
2353
2375
|
// src/ui/components/primitives/Tooltip/TooltipContent.tsx
|
|
2354
2376
|
var _tmpl$37 = /* @__PURE__ */ web.template(`<div>`);
|
|
2355
|
-
var tooltipContentVariants = () => "nt-bg-foreground nt-p-
|
|
2377
|
+
var tooltipContentVariants = () => "nt-bg-foreground nt-p-2 nt-shadow-tooltip nt-rounded-lg nt-text-background nt-text-xs";
|
|
2356
2378
|
var TooltipContentBody = (props) => {
|
|
2357
2379
|
const {
|
|
2358
2380
|
open,
|
|
@@ -2381,7 +2403,9 @@ var TooltipContentBody = (props) => {
|
|
|
2381
2403
|
return web.memo(() => !!local.class)() ? local.class : style(local.appearanceKey || "tooltipContent", tooltipContentVariants());
|
|
2382
2404
|
},
|
|
2383
2405
|
get style() {
|
|
2384
|
-
return floatingStyles()
|
|
2406
|
+
return chunk7B52C2XE_js.__spreadProps(chunk7B52C2XE_js.__spreadValues({}, floatingStyles()), {
|
|
2407
|
+
"z-index": 99999
|
|
2408
|
+
});
|
|
2385
2409
|
},
|
|
2386
2410
|
get ["data-open"]() {
|
|
2387
2411
|
return open();
|
|
@@ -2473,16 +2497,7 @@ var Switch = (props) => {
|
|
|
2473
2497
|
props.onChange(e.target.checked);
|
|
2474
2498
|
});
|
|
2475
2499
|
web.effect((_p$) => {
|
|
2476
|
-
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-slate-200
|
|
2478
|
-
after:nt-absolute after:nt-left-[2px] after:nt-top-0.5 after:nt-h-5
|
|
2479
|
-
after:nt-w-5 after:nt-rounded-full after:nt-border
|
|
2480
|
-
after:nt-border-gray-300
|
|
2481
|
-
after:nt-bg-white after:nt-transition-all after:nt-content-['']
|
|
2482
|
-
peer-checked:nt-bg-primary peer-checked:after:nt-translate-x-full
|
|
2483
|
-
peer-checked:after:nt-border-white
|
|
2484
|
-
nt-transition-all nt-duration-200 after:nt-duration-200
|
|
2485
|
-
data-[disabled=true]:nt-opacity-40`), _v$5 = props.disabled, _v$6 = props.checked;
|
|
2500
|
+
var _v$ = style("channelSwitch", `nt-relative 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 after:nt-absolute after:nt-left-[2px] after:nt-top-0.5 after:nt-h-5 after:nt-w-5 after:nt-rounded-full after:nt-border after:nt-border-neutral-alpha-400 after:nt-bg-background after:nt-transition-all after:nt-content-[''] peer-checked:nt-bg-primary peer-checked:after:nt-translate-x-full peer-checked:after:nt-border-background nt-transition-all nt-duration-200 after:nt-duration-200 data-[disabled=true]:nt-opacity-40`), _v$5 = props.disabled, _v$6 = props.checked;
|
|
2486
2501
|
_v$ !== _p$.e && web.className(_el$, _p$.e = _v$);
|
|
2487
2502
|
_v$2 !== _p$.t && web.setAttribute(_el$, "data-disabled", _p$.t = _v$2);
|
|
2488
2503
|
_v$3 !== _p$.a && (_el$2.disabled = _p$.a = _v$3);
|
|
@@ -2507,7 +2522,7 @@ var Switch = (props) => {
|
|
|
2507
2522
|
var _tmpl$40 = /* @__PURE__ */ web.template(`<div><div><div></div><span></span></div><div>`);
|
|
2508
2523
|
var ChannelRow = (props) => {
|
|
2509
2524
|
const style = useStyle();
|
|
2510
|
-
const updatePreference = (enabled) =>
|
|
2525
|
+
const updatePreference = (enabled) => chunk7B52C2XE_js.__async(void 0, null, function* () {
|
|
2511
2526
|
if (props.isCritical) {
|
|
2512
2527
|
return;
|
|
2513
2528
|
}
|
|
@@ -2669,7 +2684,7 @@ var Preferences = () => {
|
|
|
2669
2684
|
solidJs.createEffect(() => {
|
|
2670
2685
|
setDynamicLocalization((prev) => {
|
|
2671
2686
|
var _a2;
|
|
2672
|
-
return
|
|
2687
|
+
return chunk7B52C2XE_js.__spreadValues(chunk7B52C2XE_js.__spreadValues({}, prev), (_a2 = allPreferences().workflowPreferences) == null ? void 0 : _a2.reduce((acc, preference) => {
|
|
2673
2688
|
acc[preference.workflow.identifier] = preference.workflow.name;
|
|
2674
2689
|
return acc;
|
|
2675
2690
|
}, {}));
|
|
@@ -2759,7 +2774,7 @@ var ChannelsLabel = (props) => {
|
|
|
2759
2774
|
var _el$2 = _tmpl$212();
|
|
2760
2775
|
web.setAttribute(_el$2, "data-disabled", isDisabled);
|
|
2761
2776
|
web.insert(_el$2, () => getLabel(key));
|
|
2762
|
-
web.effect(() => web.className(_el$2, style("channelName", "data-[disabled=true]:nt-text-foreground-alpha-
|
|
2777
|
+
web.effect(() => web.className(_el$2, style("channelName", "data-[disabled=true]:nt-text-foreground-alpha-400")));
|
|
2763
2778
|
return _el$2;
|
|
2764
2779
|
})();
|
|
2765
2780
|
channels.push(element);
|
|
@@ -2847,7 +2862,7 @@ var PreferencesRow = (props) => {
|
|
|
2847
2862
|
easing: "ease-out"
|
|
2848
2863
|
},
|
|
2849
2864
|
get ["class"]() {
|
|
2850
|
-
return style("channelsContainerCollapsible", "nt-grid");
|
|
2865
|
+
return style("channelsContainerCollapsible", "nt-grid nt-self-stretch");
|
|
2851
2866
|
},
|
|
2852
2867
|
get children() {
|
|
2853
2868
|
var _el$9 = _tmpl$43();
|
|
@@ -2891,8 +2906,7 @@ var PreferencesRow = (props) => {
|
|
|
2891
2906
|
}
|
|
2892
2907
|
}), null);
|
|
2893
2908
|
web.effect((_p$) => {
|
|
2894
|
-
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-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();
|
|
2909
|
+
var _v$ = style("workflowContainer", `nt-p-4 nt-flex nt-flex-col nt-gap-1 nt-items-start nt-self-stretch 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
2910
|
_v$ !== _p$.e && web.className(_el$4, _p$.e = _v$);
|
|
2897
2911
|
_v$2 !== _p$.t && web.setAttribute(_el$4, "data-disabled", _p$.t = _v$2);
|
|
2898
2912
|
_v$3 !== _p$.a && web.setAttribute(_el$4, "data-open", _p$.a = _v$3);
|
|
@@ -2973,7 +2987,7 @@ var Markdown = (props) => {
|
|
|
2973
2987
|
const _a = props, {
|
|
2974
2988
|
children,
|
|
2975
2989
|
strongAppearanceKey
|
|
2976
|
-
} = _a, rest =
|
|
2990
|
+
} = _a, rest = chunk7B52C2XE_js.__objRest(_a, [
|
|
2977
2991
|
"children",
|
|
2978
2992
|
"strongAppearanceKey"
|
|
2979
2993
|
]);
|
|
@@ -3067,7 +3081,7 @@ var DefaultNotification = (props) => {
|
|
|
3067
3081
|
},
|
|
3068
3082
|
get children() {
|
|
3069
3083
|
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")));
|
|
3084
|
+
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
3085
|
return _el$2;
|
|
3072
3086
|
}
|
|
3073
3087
|
}), _el$4);
|
|
@@ -3112,7 +3126,7 @@ var DefaultNotification = (props) => {
|
|
|
3112
3126
|
e.stopPropagation();
|
|
3113
3127
|
props.notification.read();
|
|
3114
3128
|
},
|
|
3115
|
-
"class": "hover:nt-bg-neutral-
|
|
3129
|
+
"class": "hover:nt-bg-neutral-alpha-50 nt-py-0.5",
|
|
3116
3130
|
get children() {
|
|
3117
3131
|
return web.createComponent(ReadAll, {});
|
|
3118
3132
|
}
|
|
@@ -3139,7 +3153,7 @@ var DefaultNotification = (props) => {
|
|
|
3139
3153
|
e.stopPropagation();
|
|
3140
3154
|
props.notification.unread();
|
|
3141
3155
|
},
|
|
3142
|
-
"class": "hover:nt-bg-neutral-
|
|
3156
|
+
"class": "hover:nt-bg-neutral-alpha-50 nt-py-0.5",
|
|
3143
3157
|
get children() {
|
|
3144
3158
|
return web.createComponent(Unread, {});
|
|
3145
3159
|
}
|
|
@@ -3173,7 +3187,7 @@ var DefaultNotification = (props) => {
|
|
|
3173
3187
|
e.stopPropagation();
|
|
3174
3188
|
props.notification.archive();
|
|
3175
3189
|
},
|
|
3176
|
-
"class": "hover:nt-bg-neutral-
|
|
3190
|
+
"class": "hover:nt-bg-neutral-alpha-50 nt-py-0.5",
|
|
3177
3191
|
get children() {
|
|
3178
3192
|
return web.createComponent(Archive, {});
|
|
3179
3193
|
}
|
|
@@ -3200,7 +3214,7 @@ var DefaultNotification = (props) => {
|
|
|
3200
3214
|
e.stopPropagation();
|
|
3201
3215
|
props.notification.unarchive();
|
|
3202
3216
|
},
|
|
3203
|
-
"class": "hover:nt-bg-neutral-
|
|
3217
|
+
"class": "hover:nt-bg-neutral-alpha-50 nt-py-0.5",
|
|
3204
3218
|
get children() {
|
|
3205
3219
|
return web.createComponent(Unarchive, {});
|
|
3206
3220
|
}
|
|
@@ -3268,12 +3282,9 @@ var DefaultNotification = (props) => {
|
|
|
3268
3282
|
}), null);
|
|
3269
3283
|
web.effect((_p$) => {
|
|
3270
3284
|
var _a;
|
|
3271
|
-
var _v$3 = style("notification", cn("nt-w-full nt-text-sm hover:nt-bg-neutral-
|
|
3285
|
+
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
3286
|
"nt-cursor-pointer": !props.notification.isRead || !!((_a = props.notification.redirect) == null ? void 0 : _a.url)
|
|
3273
|
-
})), _v$4 = style("notificationBody", "nt-overflow-hidden nt-w-full"), _v$5 = style("notificationDate",
|
|
3274
|
-
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
|
-
nt-opacity-0 group-hover:nt-opacity-100 nt-justify-center nt-items-center
|
|
3276
|
-
nt-absolute nt-top-0 nt-right-0 nt-bg-neutral-100 nt-py-0.5 nt-rounded nt-z-50`), _v$7 = style("notificationCustomActions", "nt-flex nt-flex-wrap nt-gap-4 nt-mt-4");
|
|
3287
|
+
})), _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 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 nt-opacity-0 group-hover:nt-opacity-100 nt-justify-center nt-items-center nt-absolute nt-top-0 nt-right-0 nt-bg-neutral-alpha-50 nt-rounded-lg`), _v$7 = style("notificationCustomActions", "nt-flex nt-flex-wrap nt-gap-4 nt-mt-4");
|
|
3277
3288
|
_v$3 !== _p$.e && web.className(_el$, _p$.e = _v$3);
|
|
3278
3289
|
_v$4 !== _p$.t && web.className(_el$4, _p$.t = _v$4);
|
|
3279
3290
|
_v$5 !== _p$.a && web.className(_el$6, _p$.a = _v$5);
|
|
@@ -3425,7 +3436,7 @@ var EmptyNotificationList = () => {
|
|
|
3425
3436
|
};
|
|
3426
3437
|
var NotificationList = (props) => {
|
|
3427
3438
|
var _a, _b;
|
|
3428
|
-
const options = solidJs.createMemo(() =>
|
|
3439
|
+
const options = solidJs.createMemo(() => chunk7B52C2XE_js.__spreadProps(chunk7B52C2XE_js.__spreadValues({}, props.filter), {
|
|
3429
3440
|
limit: props.limit
|
|
3430
3441
|
}));
|
|
3431
3442
|
const style = useStyle();
|
|
@@ -3454,7 +3465,7 @@ var NotificationList = (props) => {
|
|
|
3454
3465
|
solidJs.createEffect(() => {
|
|
3455
3466
|
setLimit(props.limit || DEFAULT_LIMIT);
|
|
3456
3467
|
});
|
|
3457
|
-
const handleOnNewMessagesClick = (e) =>
|
|
3468
|
+
const handleOnNewMessagesClick = (e) => chunk7B52C2XE_js.__async(void 0, null, function* () {
|
|
3458
3469
|
e.stopPropagation();
|
|
3459
3470
|
resetNewMessagesCount();
|
|
3460
3471
|
refetch({
|
|
@@ -3688,7 +3699,7 @@ var InboxTabs = (props) => {
|
|
|
3688
3699
|
tags: getTagsFromTab(tab)
|
|
3689
3700
|
}))
|
|
3690
3701
|
});
|
|
3691
|
-
const options = solidJs.createMemo(() => dropdownTabs().map((tab) =>
|
|
3702
|
+
const options = solidJs.createMemo(() => dropdownTabs().map((tab) => chunk7B52C2XE_js.__spreadProps(chunk7B52C2XE_js.__spreadValues({}, tab), {
|
|
3692
3703
|
rightIcon: tab.label === activeTab() ? web.createComponent(Check, {
|
|
3693
3704
|
get ["class"]() {
|
|
3694
3705
|
return style("moreTabs__dropdownItemRight__icon");
|
|
@@ -3805,7 +3816,7 @@ var InboxTabs = (props) => {
|
|
|
3805
3816
|
return props.onSecondaryActionClick;
|
|
3806
3817
|
},
|
|
3807
3818
|
get filter() {
|
|
3808
|
-
return
|
|
3819
|
+
return chunk7B52C2XE_js.__spreadProps(chunk7B52C2XE_js.__spreadValues({}, filter()), {
|
|
3809
3820
|
tags: getTagsFromTab(tab)
|
|
3810
3821
|
});
|
|
3811
3822
|
}
|
|
@@ -3949,6 +3960,7 @@ var Inbox2 = (props) => {
|
|
|
3949
3960
|
}))
|
|
3950
3961
|
}), web.createComponent(Popover.Content, {
|
|
3951
3962
|
appearanceKey: "inbox__popoverContent",
|
|
3963
|
+
portal: true,
|
|
3952
3964
|
get children() {
|
|
3953
3965
|
return web.createComponent(InboxContent, {
|
|
3954
3966
|
get renderNotification() {
|
|
@@ -3973,7 +3985,7 @@ var Inbox2 = (props) => {
|
|
|
3973
3985
|
// src/ui/components/Renderer.tsx
|
|
3974
3986
|
var novuComponents = {
|
|
3975
3987
|
Inbox: Inbox2,
|
|
3976
|
-
|
|
3988
|
+
InboxContent,
|
|
3977
3989
|
Bell,
|
|
3978
3990
|
Notifications: (props) => web.createComponent(InboxContent, web.mergeProps(props, {
|
|
3979
3991
|
hideNav: true,
|
|
@@ -4085,29 +4097,29 @@ var Renderer = (props) => {
|
|
|
4085
4097
|
}
|
|
4086
4098
|
});
|
|
4087
4099
|
};
|
|
4088
|
-
var version = "2.
|
|
4100
|
+
var version = "2.3.1";
|
|
4089
4101
|
var cssHref = `https://cdn.jsdelivr.net/npm/@novu/js@${version}/dist/index.css`;
|
|
4090
4102
|
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
4103
|
var NovuUI = class {
|
|
4092
4104
|
constructor(props) {
|
|
4093
|
-
|
|
4094
|
-
|
|
4095
|
-
|
|
4096
|
-
|
|
4097
|
-
|
|
4098
|
-
|
|
4099
|
-
|
|
4100
|
-
|
|
4101
|
-
|
|
4102
|
-
|
|
4103
|
-
|
|
4104
|
-
|
|
4105
|
-
|
|
4106
|
-
|
|
4107
|
-
|
|
4108
|
-
|
|
4109
|
-
|
|
4110
|
-
|
|
4105
|
+
chunk7B52C2XE_js.__privateAdd(this, _NovuUI_instances);
|
|
4106
|
+
chunk7B52C2XE_js.__privateAdd(this, _dispose, null);
|
|
4107
|
+
chunk7B52C2XE_js.__privateAdd(this, _rootElement);
|
|
4108
|
+
chunk7B52C2XE_js.__privateAdd(this, _mountedElements);
|
|
4109
|
+
chunk7B52C2XE_js.__privateAdd(this, _setMountedElements);
|
|
4110
|
+
chunk7B52C2XE_js.__privateAdd(this, _appearance);
|
|
4111
|
+
chunk7B52C2XE_js.__privateAdd(this, _setAppearance);
|
|
4112
|
+
chunk7B52C2XE_js.__privateAdd(this, _localization);
|
|
4113
|
+
chunk7B52C2XE_js.__privateAdd(this, _setLocalization);
|
|
4114
|
+
chunk7B52C2XE_js.__privateAdd(this, _options);
|
|
4115
|
+
chunk7B52C2XE_js.__privateAdd(this, _setOptions);
|
|
4116
|
+
chunk7B52C2XE_js.__privateAdd(this, _tabs);
|
|
4117
|
+
chunk7B52C2XE_js.__privateAdd(this, _setTabs);
|
|
4118
|
+
chunk7B52C2XE_js.__privateAdd(this, _routerPush);
|
|
4119
|
+
chunk7B52C2XE_js.__privateAdd(this, _setRouterPush);
|
|
4120
|
+
chunk7B52C2XE_js.__privateAdd(this, _preferencesFilter);
|
|
4121
|
+
chunk7B52C2XE_js.__privateAdd(this, _setPreferencesFilter);
|
|
4122
|
+
chunk7B52C2XE_js.__privateAdd(this, _predefinedNovu);
|
|
4111
4123
|
var _a;
|
|
4112
4124
|
this.id = generateRandomString(16);
|
|
4113
4125
|
const [appearance, setAppearance] = solidJs.createSignal(props.appearance);
|
|
@@ -4117,32 +4129,32 @@ var NovuUI = class {
|
|
|
4117
4129
|
const [tabs, setTabs] = solidJs.createSignal((_a = props.tabs) != null ? _a : []);
|
|
4118
4130
|
const [preferencesFilter, setPreferencesFilter] = solidJs.createSignal(props.preferencesFilter);
|
|
4119
4131
|
const [routerPush, setRouterPush] = solidJs.createSignal(props.routerPush);
|
|
4120
|
-
|
|
4121
|
-
|
|
4122
|
-
|
|
4123
|
-
|
|
4124
|
-
|
|
4125
|
-
|
|
4126
|
-
|
|
4127
|
-
|
|
4128
|
-
|
|
4129
|
-
|
|
4130
|
-
|
|
4131
|
-
|
|
4132
|
-
|
|
4133
|
-
|
|
4134
|
-
|
|
4135
|
-
|
|
4132
|
+
chunk7B52C2XE_js.__privateSet(this, _mountedElements, mountedElements);
|
|
4133
|
+
chunk7B52C2XE_js.__privateSet(this, _setMountedElements, setMountedElements);
|
|
4134
|
+
chunk7B52C2XE_js.__privateSet(this, _appearance, appearance);
|
|
4135
|
+
chunk7B52C2XE_js.__privateSet(this, _setAppearance, setAppearance);
|
|
4136
|
+
chunk7B52C2XE_js.__privateSet(this, _localization, localization);
|
|
4137
|
+
chunk7B52C2XE_js.__privateSet(this, _setLocalization, setLocalization);
|
|
4138
|
+
chunk7B52C2XE_js.__privateSet(this, _options, options);
|
|
4139
|
+
chunk7B52C2XE_js.__privateSet(this, _setOptions, setOptions);
|
|
4140
|
+
chunk7B52C2XE_js.__privateSet(this, _tabs, tabs);
|
|
4141
|
+
chunk7B52C2XE_js.__privateSet(this, _setTabs, setTabs);
|
|
4142
|
+
chunk7B52C2XE_js.__privateSet(this, _routerPush, routerPush);
|
|
4143
|
+
chunk7B52C2XE_js.__privateSet(this, _setRouterPush, setRouterPush);
|
|
4144
|
+
chunk7B52C2XE_js.__privateSet(this, _predefinedNovu, props.novu);
|
|
4145
|
+
chunk7B52C2XE_js.__privateSet(this, _preferencesFilter, preferencesFilter);
|
|
4146
|
+
chunk7B52C2XE_js.__privateSet(this, _setPreferencesFilter, setPreferencesFilter);
|
|
4147
|
+
chunk7B52C2XE_js.__privateMethod(this, _NovuUI_instances, mountComponentRenderer_fn).call(this);
|
|
4136
4148
|
}
|
|
4137
4149
|
mountComponent({
|
|
4138
4150
|
name,
|
|
4139
4151
|
element,
|
|
4140
4152
|
props: componentProps
|
|
4141
4153
|
}) {
|
|
4142
|
-
if (
|
|
4143
|
-
return
|
|
4154
|
+
if (chunk7B52C2XE_js.__privateGet(this, _mountedElements).call(this).has(element)) {
|
|
4155
|
+
return chunk7B52C2XE_js.__privateMethod(this, _NovuUI_instances, updateComponentProps_fn).call(this, element, componentProps);
|
|
4144
4156
|
}
|
|
4145
|
-
|
|
4157
|
+
chunk7B52C2XE_js.__privateGet(this, _setMountedElements).call(this, (oldNodes) => {
|
|
4146
4158
|
const newNodes = new Map(oldNodes);
|
|
4147
4159
|
newNodes.set(element, {
|
|
4148
4160
|
name,
|
|
@@ -4152,35 +4164,35 @@ var NovuUI = class {
|
|
|
4152
4164
|
});
|
|
4153
4165
|
}
|
|
4154
4166
|
unmountComponent(element) {
|
|
4155
|
-
|
|
4167
|
+
chunk7B52C2XE_js.__privateGet(this, _setMountedElements).call(this, (oldMountedElements) => {
|
|
4156
4168
|
const newMountedElements = new Map(oldMountedElements);
|
|
4157
4169
|
newMountedElements.delete(element);
|
|
4158
4170
|
return newMountedElements;
|
|
4159
4171
|
});
|
|
4160
4172
|
}
|
|
4161
4173
|
updateAppearance(appearance) {
|
|
4162
|
-
|
|
4174
|
+
chunk7B52C2XE_js.__privateGet(this, _setAppearance).call(this, appearance);
|
|
4163
4175
|
}
|
|
4164
4176
|
updateLocalization(localization) {
|
|
4165
|
-
|
|
4177
|
+
chunk7B52C2XE_js.__privateGet(this, _setLocalization).call(this, localization);
|
|
4166
4178
|
}
|
|
4167
4179
|
updateOptions(options) {
|
|
4168
|
-
|
|
4180
|
+
chunk7B52C2XE_js.__privateGet(this, _setOptions).call(this, options);
|
|
4169
4181
|
}
|
|
4170
4182
|
updateTabs(tabs) {
|
|
4171
|
-
|
|
4183
|
+
chunk7B52C2XE_js.__privateGet(this, _setTabs).call(this, tabs != null ? tabs : []);
|
|
4172
4184
|
}
|
|
4173
4185
|
updatePreferencesFilter(preferencesFilter) {
|
|
4174
|
-
|
|
4186
|
+
chunk7B52C2XE_js.__privateGet(this, _setPreferencesFilter).call(this, preferencesFilter);
|
|
4175
4187
|
}
|
|
4176
4188
|
updateRouterPush(routerPush) {
|
|
4177
|
-
|
|
4189
|
+
chunk7B52C2XE_js.__privateGet(this, _setRouterPush).call(this, () => routerPush);
|
|
4178
4190
|
}
|
|
4179
4191
|
unmount() {
|
|
4180
4192
|
var _a, _b;
|
|
4181
|
-
(_a =
|
|
4182
|
-
|
|
4183
|
-
(_b =
|
|
4193
|
+
(_a = chunk7B52C2XE_js.__privateGet(this, _dispose)) == null ? void 0 : _a.call(this);
|
|
4194
|
+
chunk7B52C2XE_js.__privateSet(this, _dispose, null);
|
|
4195
|
+
(_b = chunk7B52C2XE_js.__privateGet(this, _rootElement)) == null ? void 0 : _b.remove();
|
|
4184
4196
|
}
|
|
4185
4197
|
};
|
|
4186
4198
|
_dispose = new WeakMap();
|
|
@@ -4202,12 +4214,12 @@ _setPreferencesFilter = new WeakMap();
|
|
|
4202
4214
|
_predefinedNovu = new WeakMap();
|
|
4203
4215
|
_NovuUI_instances = new WeakSet();
|
|
4204
4216
|
mountComponentRenderer_fn = function() {
|
|
4205
|
-
if (
|
|
4217
|
+
if (chunk7B52C2XE_js.__privateGet(this, _dispose) !== null) {
|
|
4206
4218
|
return;
|
|
4207
4219
|
}
|
|
4208
|
-
|
|
4209
|
-
|
|
4210
|
-
document.body.appendChild(
|
|
4220
|
+
chunk7B52C2XE_js.__privateSet(this, _rootElement, document.createElement("div"));
|
|
4221
|
+
chunk7B52C2XE_js.__privateGet(this, _rootElement).setAttribute("id", `novu-ui-${this.id}`);
|
|
4222
|
+
document.body.appendChild(chunk7B52C2XE_js.__privateGet(this, _rootElement));
|
|
4211
4223
|
const dispose = web.render(() => {
|
|
4212
4224
|
const _self$ = this;
|
|
4213
4225
|
return web.createComponent(Renderer, {
|
|
@@ -4215,45 +4227,45 @@ mountComponentRenderer_fn = function() {
|
|
|
4215
4227
|
novuUI: _self$,
|
|
4216
4228
|
get nodes() {
|
|
4217
4229
|
var _a;
|
|
4218
|
-
return
|
|
4230
|
+
return chunk7B52C2XE_js.__privateGet(_a = _self$, _mountedElements).call(_a);
|
|
4219
4231
|
},
|
|
4220
4232
|
get options() {
|
|
4221
4233
|
var _a;
|
|
4222
|
-
return
|
|
4234
|
+
return chunk7B52C2XE_js.__privateGet(_a = _self$, _options).call(_a);
|
|
4223
4235
|
},
|
|
4224
4236
|
get appearance() {
|
|
4225
4237
|
var _a;
|
|
4226
|
-
return
|
|
4238
|
+
return chunk7B52C2XE_js.__privateGet(_a = _self$, _appearance).call(_a);
|
|
4227
4239
|
},
|
|
4228
4240
|
get localization() {
|
|
4229
4241
|
var _a;
|
|
4230
|
-
return
|
|
4242
|
+
return chunk7B52C2XE_js.__privateGet(_a = _self$, _localization).call(_a);
|
|
4231
4243
|
},
|
|
4232
4244
|
get tabs() {
|
|
4233
4245
|
var _a;
|
|
4234
|
-
return
|
|
4246
|
+
return chunk7B52C2XE_js.__privateGet(_a = _self$, _tabs).call(_a);
|
|
4235
4247
|
},
|
|
4236
4248
|
get preferencesFilter() {
|
|
4237
4249
|
var _a;
|
|
4238
|
-
return
|
|
4250
|
+
return chunk7B52C2XE_js.__privateGet(_a = _self$, _preferencesFilter).call(_a);
|
|
4239
4251
|
},
|
|
4240
4252
|
get routerPush() {
|
|
4241
4253
|
var _a;
|
|
4242
|
-
return
|
|
4254
|
+
return chunk7B52C2XE_js.__privateGet(_a = _self$, _routerPush).call(_a);
|
|
4243
4255
|
},
|
|
4244
4256
|
get novu() {
|
|
4245
|
-
return
|
|
4257
|
+
return chunk7B52C2XE_js.__privateGet(_self$, _predefinedNovu);
|
|
4246
4258
|
}
|
|
4247
4259
|
});
|
|
4248
|
-
},
|
|
4249
|
-
|
|
4260
|
+
}, chunk7B52C2XE_js.__privateGet(this, _rootElement));
|
|
4261
|
+
chunk7B52C2XE_js.__privateSet(this, _dispose, dispose);
|
|
4250
4262
|
};
|
|
4251
4263
|
updateComponentProps_fn = function(element, props) {
|
|
4252
|
-
|
|
4264
|
+
chunk7B52C2XE_js.__privateGet(this, _setMountedElements).call(this, (oldMountedElements) => {
|
|
4253
4265
|
const newMountedElements = new Map(oldMountedElements);
|
|
4254
4266
|
const mountedElement = newMountedElements.get(element);
|
|
4255
4267
|
if (mountedElement) {
|
|
4256
|
-
newMountedElements.set(element,
|
|
4268
|
+
newMountedElements.set(element, chunk7B52C2XE_js.__spreadProps(chunk7B52C2XE_js.__spreadValues({}, mountedElement), {
|
|
4257
4269
|
props
|
|
4258
4270
|
}));
|
|
4259
4271
|
}
|