@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/cjs/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/cjs/index.js
CHANGED
|
@@ -212,13 +212,13 @@ var loadVelt = function (callback, version, staging, develop, proxyDomain, integ
|
|
|
212
212
|
};
|
|
213
213
|
};
|
|
214
214
|
|
|
215
|
-
var VELT_SDK_VERSION = '6.0.9
|
|
215
|
+
var VELT_SDK_VERSION = '6.0.9';
|
|
216
216
|
var VELT_SDK_INIT_EVENT = 'onVeltInit';
|
|
217
217
|
var VELT_TAB_ID = 'veltTabId';
|
|
218
218
|
// integrity map for the Velt SDK
|
|
219
219
|
// Note: generate integrity hashes with: https://www.srihash.org/
|
|
220
220
|
var INTEGRITY_MAP = {
|
|
221
|
-
'6.0.9
|
|
221
|
+
'6.0.9': 'sha384-sXcl87L0neecQKa3PiDXUgTbZFF3jkuby1mvIgIn0zKU2YbODHgm0uWJ3EHQig2q',
|
|
222
222
|
};
|
|
223
223
|
|
|
224
224
|
var validProps = ['veltIf', 'veltClass', 'className', 'variant'];
|
|
@@ -1157,7 +1157,7 @@ var VeltCommentThread = function (props) {
|
|
|
1157
1157
|
};
|
|
1158
1158
|
|
|
1159
1159
|
var VeltNotificationsTool = function (props) {
|
|
1160
|
-
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;
|
|
1160
|
+
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;
|
|
1161
1161
|
var ref = React.useRef();
|
|
1162
1162
|
var onNotificationClickRef = React.useRef(onNotificationClick);
|
|
1163
1163
|
// Update the ref to always point to the latest callback function
|
|
@@ -1200,7 +1200,24 @@ var VeltNotificationsTool = function (props) {
|
|
|
1200
1200
|
return undefined;
|
|
1201
1201
|
}
|
|
1202
1202
|
}, [enableCrossOrganization]);
|
|
1203
|
-
|
|
1203
|
+
var enableUserScopedNotificationsValue = React.useMemo(function () {
|
|
1204
|
+
try {
|
|
1205
|
+
if (typeof enableUserScopedNotifications === 'boolean') {
|
|
1206
|
+
return enableUserScopedNotifications ? 'true' : 'false';
|
|
1207
|
+
}
|
|
1208
|
+
else if (typeof enableUserScopedNotifications === 'string') {
|
|
1209
|
+
return enableUserScopedNotifications;
|
|
1210
|
+
}
|
|
1211
|
+
else if (typeof enableUserScopedNotifications === 'object') {
|
|
1212
|
+
return JSON.stringify(enableUserScopedNotifications);
|
|
1213
|
+
}
|
|
1214
|
+
return undefined;
|
|
1215
|
+
}
|
|
1216
|
+
catch (error) {
|
|
1217
|
+
return undefined;
|
|
1218
|
+
}
|
|
1219
|
+
}, [enableUserScopedNotifications]);
|
|
1220
|
+
return (React__default["default"].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));
|
|
1204
1221
|
};
|
|
1205
1222
|
|
|
1206
1223
|
var VeltNotificationsToolIcon = function (props) {
|
|
@@ -1228,7 +1245,7 @@ var VeltNotificationsToolUnreadCount = function (props) {
|
|
|
1228
1245
|
};
|
|
1229
1246
|
|
|
1230
1247
|
var VeltNotificationsPanel = function (props) {
|
|
1231
|
-
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;
|
|
1248
|
+
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;
|
|
1232
1249
|
var ref = React.useRef();
|
|
1233
1250
|
var onNotificationClickRef = React.useRef(onNotificationClick);
|
|
1234
1251
|
// Update the ref to always point to the latest callback function
|
|
@@ -1271,7 +1288,24 @@ var VeltNotificationsPanel = function (props) {
|
|
|
1271
1288
|
return undefined;
|
|
1272
1289
|
}
|
|
1273
1290
|
}, [enableCrossOrganization]);
|
|
1274
|
-
|
|
1291
|
+
var enableUserScopedNotificationsValue = React.useMemo(function () {
|
|
1292
|
+
try {
|
|
1293
|
+
if (typeof enableUserScopedNotifications === 'boolean') {
|
|
1294
|
+
return enableUserScopedNotifications ? 'true' : 'false';
|
|
1295
|
+
}
|
|
1296
|
+
else if (typeof enableUserScopedNotifications === 'string') {
|
|
1297
|
+
return enableUserScopedNotifications;
|
|
1298
|
+
}
|
|
1299
|
+
else if (typeof enableUserScopedNotifications === 'object') {
|
|
1300
|
+
return JSON.stringify(enableUserScopedNotifications);
|
|
1301
|
+
}
|
|
1302
|
+
return undefined;
|
|
1303
|
+
}
|
|
1304
|
+
catch (error) {
|
|
1305
|
+
return undefined;
|
|
1306
|
+
}
|
|
1307
|
+
}, [enableUserScopedNotifications]);
|
|
1308
|
+
return (React__default["default"].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 }));
|
|
1275
1309
|
};
|
|
1276
1310
|
|
|
1277
1311
|
var VeltNotificationsPanelTitle = function (props) {
|