@veltdev/react 6.0.9-beta.1 → 6.0.9
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/cjs/components/VeltNotificationsPanel/VeltNotificationsPanel.d.ts +2 -1
- package/cjs/components/VeltNotificationsTool/VeltNotificationsTool.d.ts +2 -1
- package/cjs/constants.d.ts +1 -1
- package/cjs/index.js +40 -6
- package/cjs/index.js.map +1 -1
- package/esm/components/VeltNotificationsPanel/VeltNotificationsPanel.d.ts +2 -1
- package/esm/components/VeltNotificationsTool/VeltNotificationsTool.d.ts +2 -1
- package/esm/constants.d.ts +1 -1
- package/esm/index.js +40 -6
- package/esm/index.js.map +1 -1
- package/index.d.ts +3 -1
- package/package.json +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { CrossOrganizationConfig, NotificationPanelMode, NotificationSettingsLayout } from '@veltdev/types';
|
|
1
|
+
import { CrossOrganizationConfig, NotificationPanelMode, NotificationSettingsLayout, UserScopedNotificationsConfig } from '@veltdev/types';
|
|
2
2
|
import React from 'react';
|
|
3
3
|
export declare class NotificationTabConfigItem {
|
|
4
4
|
name?: string;
|
|
@@ -25,6 +25,7 @@ export interface IVeltNotificationsPanelProps {
|
|
|
25
25
|
enableSettingsAtOrganizationLevel?: boolean;
|
|
26
26
|
defaultCondition?: boolean;
|
|
27
27
|
enableCrossOrganization?: boolean | string | CrossOrganizationConfig;
|
|
28
|
+
enableUserScopedNotifications?: boolean | string | UserScopedNotificationsConfig;
|
|
28
29
|
}
|
|
29
30
|
declare const VeltNotificationsPanel: React.FC<IVeltNotificationsPanelProps>;
|
|
30
31
|
export default VeltNotificationsPanel;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { CrossOrganizationConfig, NotificationSettingsLayout } from '@veltdev/types';
|
|
1
|
+
import { CrossOrganizationConfig, NotificationSettingsLayout, UserScopedNotificationsConfig } from '@veltdev/types';
|
|
2
2
|
import React from 'react';
|
|
3
3
|
export declare class NotificationTabConfigItem {
|
|
4
4
|
name?: string;
|
|
@@ -29,6 +29,7 @@ export interface IVeltNotificationsToolProps extends React.DetailedHTMLProps<Rea
|
|
|
29
29
|
enableSettingsAtOrganizationLevel?: boolean;
|
|
30
30
|
defaultCondition?: boolean;
|
|
31
31
|
enableCrossOrganization?: boolean | string | CrossOrganizationConfig;
|
|
32
|
+
enableUserScopedNotifications?: boolean | string | UserScopedNotificationsConfig;
|
|
32
33
|
}
|
|
33
34
|
declare const VeltNotificationsTool: React.FC<IVeltNotificationsToolProps>;
|
|
34
35
|
export default VeltNotificationsTool;
|
package/esm/constants.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
export declare const VELT_SDK_VERSION = "6.0.9
|
|
2
|
+
export declare const VELT_SDK_VERSION = "6.0.9";
|
|
3
3
|
export declare const VELT_SDK_INIT_EVENT = "onVeltInit";
|
|
4
4
|
export declare const VELT_TAB_ID = "veltTabId";
|
|
5
5
|
export declare const INTEGRITY_MAP: Record<string, string>;
|
package/esm/index.js
CHANGED
|
@@ -204,13 +204,13 @@ var loadVelt = function (callback, version, staging, develop, proxyDomain, integ
|
|
|
204
204
|
};
|
|
205
205
|
};
|
|
206
206
|
|
|
207
|
-
var VELT_SDK_VERSION = '6.0.9
|
|
207
|
+
var VELT_SDK_VERSION = '6.0.9';
|
|
208
208
|
var VELT_SDK_INIT_EVENT = 'onVeltInit';
|
|
209
209
|
var VELT_TAB_ID = 'veltTabId';
|
|
210
210
|
// integrity map for the Velt SDK
|
|
211
211
|
// Note: generate integrity hashes with: https://www.srihash.org/
|
|
212
212
|
var INTEGRITY_MAP = {
|
|
213
|
-
'6.0.9
|
|
213
|
+
'6.0.9': 'sha384-sXcl87L0neecQKa3PiDXUgTbZFF3jkuby1mvIgIn0zKU2YbODHgm0uWJ3EHQig2q',
|
|
214
214
|
};
|
|
215
215
|
|
|
216
216
|
var validProps = ['veltIf', 'veltClass', 'className', 'variant'];
|
|
@@ -1149,7 +1149,7 @@ var VeltCommentThread = function (props) {
|
|
|
1149
1149
|
};
|
|
1150
1150
|
|
|
1151
1151
|
var VeltNotificationsTool = function (props) {
|
|
1152
|
-
var children = props.children, darkMode = props.darkMode, onNotificationClick = props.onNotificationClick, shadowDom = props.shadowDom, panelShadowDom = props.panelShadowDom, variant = props.variant, maxDays = props.maxDays, tabConfig = props.tabConfig, panelOpenMode = props.panelOpenMode, panelVariant = props.panelVariant, readNotificationsOnForYouTab = props.readNotificationsOnForYouTab, settings = props.settings, selfNotifications = props.selfNotifications, considerAllNotifications = props.considerAllNotifications, pageSize = props.pageSize, settingsLayout = props.settingsLayout, enableSettingsAtOrganizationLevel = props.enableSettingsAtOrganizationLevel, defaultCondition = props.defaultCondition, enableCrossOrganization = props.enableCrossOrganization;
|
|
1152
|
+
var children = props.children, darkMode = props.darkMode, onNotificationClick = props.onNotificationClick, shadowDom = props.shadowDom, panelShadowDom = props.panelShadowDom, variant = props.variant, maxDays = props.maxDays, tabConfig = props.tabConfig, panelOpenMode = props.panelOpenMode, panelVariant = props.panelVariant, readNotificationsOnForYouTab = props.readNotificationsOnForYouTab, settings = props.settings, selfNotifications = props.selfNotifications, considerAllNotifications = props.considerAllNotifications, pageSize = props.pageSize, settingsLayout = props.settingsLayout, enableSettingsAtOrganizationLevel = props.enableSettingsAtOrganizationLevel, defaultCondition = props.defaultCondition, enableCrossOrganization = props.enableCrossOrganization, enableUserScopedNotifications = props.enableUserScopedNotifications;
|
|
1153
1153
|
var ref = useRef();
|
|
1154
1154
|
var onNotificationClickRef = useRef(onNotificationClick);
|
|
1155
1155
|
// Update the ref to always point to the latest callback function
|
|
@@ -1192,7 +1192,24 @@ var VeltNotificationsTool = function (props) {
|
|
|
1192
1192
|
return undefined;
|
|
1193
1193
|
}
|
|
1194
1194
|
}, [enableCrossOrganization]);
|
|
1195
|
-
|
|
1195
|
+
var enableUserScopedNotificationsValue = useMemo(function () {
|
|
1196
|
+
try {
|
|
1197
|
+
if (typeof enableUserScopedNotifications === 'boolean') {
|
|
1198
|
+
return enableUserScopedNotifications ? 'true' : 'false';
|
|
1199
|
+
}
|
|
1200
|
+
else if (typeof enableUserScopedNotifications === 'string') {
|
|
1201
|
+
return enableUserScopedNotifications;
|
|
1202
|
+
}
|
|
1203
|
+
else if (typeof enableUserScopedNotifications === 'object') {
|
|
1204
|
+
return JSON.stringify(enableUserScopedNotifications);
|
|
1205
|
+
}
|
|
1206
|
+
return undefined;
|
|
1207
|
+
}
|
|
1208
|
+
catch (error) {
|
|
1209
|
+
return undefined;
|
|
1210
|
+
}
|
|
1211
|
+
}, [enableUserScopedNotifications]);
|
|
1212
|
+
return (React.createElement("velt-notifications-tool", { ref: ref, "panel-open-mode": panelOpenMode, "panel-variant": panelVariant, "tab-config": JSON.stringify(tabConfig), variant: variant, "max-days": (maxDays && maxDays > 0) ? maxDays + '' : undefined, "panel-shadow-dom": [true, false].includes(panelShadowDom) ? (panelShadowDom ? 'true' : 'false') : undefined, "shadow-dom": [true, false].includes(shadowDom) ? (shadowDom ? 'true' : 'false') : undefined, "dark-mode": [true, false].includes(darkMode) ? (darkMode ? 'true' : 'false') : undefined, settings: [true, false].includes(settings) ? (settings ? 'true' : 'false') : undefined, "self-notifications": [true, false].includes(selfNotifications) ? (selfNotifications ? 'true' : 'false') : undefined, "read-notifications-on-for-you-tab": [true, false].includes(readNotificationsOnForYouTab) ? (readNotificationsOnForYouTab ? 'true' : 'false') : undefined, "consider-all-notifications": [true, false].includes(considerAllNotifications) ? (considerAllNotifications ? 'true' : 'false') : undefined, "page-size": (pageSize && pageSize > 0) ? pageSize + '' : undefined, "settings-layout": settingsLayout, "enable-settings-at-organization-level": [true, false].includes(enableSettingsAtOrganizationLevel) ? (enableSettingsAtOrganizationLevel ? 'true' : 'false') : undefined, "default-condition": [true, false].includes(defaultCondition) ? (defaultCondition ? 'true' : 'false') : undefined, "enable-cross-organization": enableCrossOrganizationValue, "enable-user-scoped-notifications": enableUserScopedNotificationsValue }, children));
|
|
1196
1213
|
};
|
|
1197
1214
|
|
|
1198
1215
|
var VeltNotificationsToolIcon = function (props) {
|
|
@@ -1220,7 +1237,7 @@ var VeltNotificationsToolUnreadCount = function (props) {
|
|
|
1220
1237
|
};
|
|
1221
1238
|
|
|
1222
1239
|
var VeltNotificationsPanel = function (props) {
|
|
1223
|
-
var darkMode = props.darkMode, onNotificationClick = props.onNotificationClick, shadowDom = props.shadowDom, tabConfig = props.tabConfig, variant = props.variant, readNotificationsOnForYouTab = props.readNotificationsOnForYouTab, panelOpenMode = props.panelOpenMode, settings = props.settings, selfNotifications = props.selfNotifications, pageSize = props.pageSize, settingsLayout = props.settingsLayout, enableSettingsAtOrganizationLevel = props.enableSettingsAtOrganizationLevel, defaultCondition = props.defaultCondition, enableCrossOrganization = props.enableCrossOrganization;
|
|
1240
|
+
var darkMode = props.darkMode, onNotificationClick = props.onNotificationClick, shadowDom = props.shadowDom, tabConfig = props.tabConfig, variant = props.variant, readNotificationsOnForYouTab = props.readNotificationsOnForYouTab, panelOpenMode = props.panelOpenMode, settings = props.settings, selfNotifications = props.selfNotifications, pageSize = props.pageSize, settingsLayout = props.settingsLayout, enableSettingsAtOrganizationLevel = props.enableSettingsAtOrganizationLevel, defaultCondition = props.defaultCondition, enableCrossOrganization = props.enableCrossOrganization, enableUserScopedNotifications = props.enableUserScopedNotifications;
|
|
1224
1241
|
var ref = useRef();
|
|
1225
1242
|
var onNotificationClickRef = useRef(onNotificationClick);
|
|
1226
1243
|
// Update the ref to always point to the latest callback function
|
|
@@ -1263,7 +1280,24 @@ var VeltNotificationsPanel = function (props) {
|
|
|
1263
1280
|
return undefined;
|
|
1264
1281
|
}
|
|
1265
1282
|
}, [enableCrossOrganization]);
|
|
1266
|
-
|
|
1283
|
+
var enableUserScopedNotificationsValue = useMemo(function () {
|
|
1284
|
+
try {
|
|
1285
|
+
if (typeof enableUserScopedNotifications === 'boolean') {
|
|
1286
|
+
return enableUserScopedNotifications ? 'true' : 'false';
|
|
1287
|
+
}
|
|
1288
|
+
else if (typeof enableUserScopedNotifications === 'string') {
|
|
1289
|
+
return enableUserScopedNotifications;
|
|
1290
|
+
}
|
|
1291
|
+
else if (typeof enableUserScopedNotifications === 'object') {
|
|
1292
|
+
return JSON.stringify(enableUserScopedNotifications);
|
|
1293
|
+
}
|
|
1294
|
+
return undefined;
|
|
1295
|
+
}
|
|
1296
|
+
catch (error) {
|
|
1297
|
+
return undefined;
|
|
1298
|
+
}
|
|
1299
|
+
}, [enableUserScopedNotifications]);
|
|
1300
|
+
return (React.createElement("velt-notifications-panel", { ref: ref, variant: variant, "tab-config": JSON.stringify(tabConfig), "shadow-dom": [true, false].includes(shadowDom) ? (shadowDom ? 'true' : 'false') : undefined, "dark-mode": [true, false].includes(darkMode) ? (darkMode ? 'true' : 'false') : undefined, settings: [true, false].includes(settings) ? (settings ? 'true' : 'false') : undefined, "self-notifications": [true, false].includes(selfNotifications) ? (selfNotifications ? 'true' : 'false') : undefined, "read-notifications-on-for-you-tab": [true, false].includes(readNotificationsOnForYouTab) ? (readNotificationsOnForYouTab ? 'true' : 'false') : undefined, "panel-open-mode": panelOpenMode, "page-size": (pageSize && pageSize > 0) ? pageSize + '' : undefined, "settings-layout": settingsLayout, "enable-settings-at-organization-level": [true, false].includes(enableSettingsAtOrganizationLevel) ? (enableSettingsAtOrganizationLevel ? 'true' : 'false') : undefined, "default-condition": [true, false].includes(defaultCondition) ? (defaultCondition ? 'true' : 'false') : undefined, "enable-cross-organization": enableCrossOrganizationValue, "enable-user-scoped-notifications": enableUserScopedNotificationsValue }));
|
|
1267
1301
|
};
|
|
1268
1302
|
|
|
1269
1303
|
var VeltNotificationsPanelTitle = function (props) {
|