@veltdev/react 4.5.0-beta.62 → 4.5.0-beta.64

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.
@@ -1,5 +1,5 @@
1
1
  import React from "react";
2
- import { Config, Velt, UserDataProvider, VeltDataProvider, VeltAuthProvider } from "@veltdev/types";
2
+ import { Config, Velt, UserDataProvider, VeltDataProvider, VeltAuthProvider, VeltEncryptionProvider } from "@veltdev/types";
3
3
  export interface IVeltProps extends React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement> {
4
4
  apiKey: string;
5
5
  config?: Config & {
@@ -18,6 +18,7 @@ export interface IVeltProps extends React.DetailedHTMLProps<React.HTMLAttributes
18
18
  autoTranslation?: boolean;
19
19
  userDataProvider?: UserDataProvider;
20
20
  dataProviders?: VeltDataProvider;
21
+ encryptionProvider?: VeltEncryptionProvider;
21
22
  authProvider?: VeltAuthProvider;
22
23
  onClientLoad?: (veltClient?: Velt) => any;
23
24
  }
@@ -44,6 +44,7 @@ export interface IVeltCommentsSidebarProps {
44
44
  fullExpanded?: boolean;
45
45
  systemFiltersOperator?: 'and' | 'or';
46
46
  sidebarButtonCountType?: 'default' | 'filter';
47
+ filterGhostCommentsInSidebar?: boolean;
47
48
  }
48
49
  declare const SnippylyCommentsSidebar: React.FC<IVeltCommentsSidebarProps>;
49
50
  export default SnippylyCommentsSidebar;
@@ -48,6 +48,7 @@ export interface IVeltSidebarButtonProps extends React.DetailedHTMLProps<React.H
48
48
  position?: "right" | "left";
49
49
  filterPanelLayout?: 'menu' | 'bottomSheet';
50
50
  sidebarButtonCountType?: 'default' | 'filter';
51
+ filterGhostCommentsInSidebar?: boolean;
51
52
  onCommentClick?: Function;
52
53
  onSidebarOpen?: Function;
53
54
  }
@@ -1,5 +1,5 @@
1
1
  /// <reference types="react" />
2
- export declare const VELT_SDK_VERSION = "4.5.0-beta.62";
2
+ export declare const VELT_SDK_VERSION = "4.5.0-beta.64";
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
@@ -136,17 +136,17 @@ var loadVelt = function (callback, version, staging, develop, proxyDomain, integ
136
136
  }
137
137
  };
138
138
 
139
- var VELT_SDK_VERSION = '4.5.0-beta.62';
139
+ var VELT_SDK_VERSION = '4.5.0-beta.64';
140
140
  var VELT_SDK_INIT_EVENT = 'onVeltInit';
141
141
  var VELT_TAB_ID = 'veltTabId';
142
142
  // integrity map for the Velt SDK
143
143
  // Note: generate integrity hashes with: https://www.srihash.org/
144
144
  var INTEGRITY_MAP = {
145
- '4.5.0-beta.62': 'sha384-b5H9Wb+ZX1vAIit8QvTzGcQlLSbizGnCF4F1CgBrUpXX1VdrPpZxMLO37QVrBO6Y',
145
+ '4.5.0-beta.64': 'sha384-A2mLpoSvdDIRMS1KNJssa1+W2227CkbrlKSr0p/rM/3BJ7iEdKY9CB7udKX96NqC',
146
146
  };
147
147
 
148
148
  var SnippylyProvider = function (props) {
149
- var apiKey = props.apiKey, user = props.user, config = props.config, documentId = props.documentId, language = props.language, translations = props.translations, autoTranslation = props.autoTranslation, userDataProvider = props.userDataProvider, dataProviders = props.dataProviders, authProvider = props.authProvider, onClientLoad = props.onClientLoad, children = props.children;
149
+ var apiKey = props.apiKey, user = props.user, config = props.config, documentId = props.documentId, language = props.language, translations = props.translations, autoTranslation = props.autoTranslation, userDataProvider = props.userDataProvider, dataProviders = props.dataProviders, encryptionProvider = props.encryptionProvider, authProvider = props.authProvider, onClientLoad = props.onClientLoad, children = props.children;
150
150
  var _a = useState(null), client = _a[0], setClient = _a[1];
151
151
  useEffect(function () {
152
152
  if (apiKey) {
@@ -186,6 +186,13 @@ var SnippylyProvider = function (props) {
186
186
  }
187
187
  }
188
188
  }, [client, dataProviders]);
189
+ useEffect(function () {
190
+ if (client && encryptionProvider) {
191
+ if (typeof (client === null || client === void 0 ? void 0 : client.setEncryptionProvider) === "function") {
192
+ client === null || client === void 0 ? void 0 : client.setEncryptionProvider(encryptionProvider);
193
+ }
194
+ }
195
+ }, [client, encryptionProvider]);
189
196
  useEffect(function () {
190
197
  if (client && authProvider && authProvider.user) {
191
198
  client.setVeltAuthProvider(authProvider);
@@ -400,7 +407,7 @@ var SnippylyComments = function (props) {
400
407
  };
401
408
 
402
409
  var SnippylyCommentsSidebar = function (props) {
403
- var embedMode = props.embedMode; props.floatingMode; var enableUrlNavigation = props.enableUrlNavigation, urlNavigation = props.urlNavigation, queryParamsComments = props.queryParamsComments, pageMode = props.pageMode, currentLocationSuffix = props.currentLocationSuffix, sortData = props.sortData, filterConfig = props.filterConfig, groupConfig = props.groupConfig, filters = props.filters, excludeLocationIds = props.excludeLocationIds, variant = props.variant, pageModeComposerVariant = props.pageModeComposerVariant, dialogVariant = props.dialogVariant, shadowDom = props.shadowDom, searchPlaceholder = props.searchPlaceholder, openSidebar = props.openSidebar, onSidebarOpen = props.onSidebarOpen, onSidebarCommentClick = props.onSidebarCommentClick, onCommentClick = props.onCommentClick, onSidebarClose = props.onSidebarClose, darkMode = props.darkMode, position = props.position, filterPanelLayout = props.filterPanelLayout, customActions = props.customActions, focusedThreadDialogVariant = props.focusedThreadDialogVariant, focusedThreadMode = props.focusedThreadMode, onCommentNavigationButtonClick = props.onCommentNavigationButtonClick, filterOptionLayout = props.filterOptionLayout, filterCount = props.filterCount, fullExpanded = props.fullExpanded, systemFiltersOperator = props.systemFiltersOperator, sidebarButtonCountType = props.sidebarButtonCountType;
410
+ var embedMode = props.embedMode; props.floatingMode; var enableUrlNavigation = props.enableUrlNavigation, urlNavigation = props.urlNavigation, queryParamsComments = props.queryParamsComments, pageMode = props.pageMode, currentLocationSuffix = props.currentLocationSuffix, sortData = props.sortData, filterConfig = props.filterConfig, groupConfig = props.groupConfig, filters = props.filters, excludeLocationIds = props.excludeLocationIds, variant = props.variant, pageModeComposerVariant = props.pageModeComposerVariant, dialogVariant = props.dialogVariant, shadowDom = props.shadowDom, searchPlaceholder = props.searchPlaceholder, openSidebar = props.openSidebar, onSidebarOpen = props.onSidebarOpen, onSidebarCommentClick = props.onSidebarCommentClick, onCommentClick = props.onCommentClick, onSidebarClose = props.onSidebarClose, darkMode = props.darkMode, position = props.position, filterPanelLayout = props.filterPanelLayout, customActions = props.customActions, focusedThreadDialogVariant = props.focusedThreadDialogVariant, focusedThreadMode = props.focusedThreadMode, onCommentNavigationButtonClick = props.onCommentNavigationButtonClick, filterOptionLayout = props.filterOptionLayout, filterCount = props.filterCount, fullExpanded = props.fullExpanded, systemFiltersOperator = props.systemFiltersOperator, sidebarButtonCountType = props.sidebarButtonCountType, filterGhostCommentsInSidebar = props.filterGhostCommentsInSidebar;
404
411
  var ref = useRef();
405
412
  var openSidebarRef = useRef(openSidebar);
406
413
  var onSidebarOpenRef = useRef(onSidebarOpen);
@@ -473,7 +480,7 @@ var SnippylyCommentsSidebar = function (props) {
473
480
  }
474
481
  };
475
482
  }, []);
476
- return (React.createElement("velt-comments-sidebar", { ref: ref, position: position, "filter-panel-layout": filterPanelLayout, "focused-thread-mode": [true, false].includes(focusedThreadMode) ? (focusedThreadMode ? 'true' : 'false') : undefined, "focused-thread-dialog-variant": focusedThreadDialogVariant, "custom-actions": [true, false].includes(customActions) ? (customActions ? 'true' : 'false') : undefined, "shadow-dom": [true, false].includes(shadowDom) ? (shadowDom ? 'true' : 'false') : undefined, "embed-mode": [true, false].includes(embedMode) ? (embedMode ? 'true' : 'false') : undefined, "enable-url-navigation": [true, false].includes(enableUrlNavigation) ? (enableUrlNavigation ? 'true' : 'false') : undefined, "url-navigation": [true, false].includes(urlNavigation) ? (urlNavigation ? 'true' : 'false') : undefined, "query-params-comments": [true, false].includes(queryParamsComments) ? (queryParamsComments ? 'true' : 'false') : undefined, "page-mode": [true, false].includes(pageMode) ? (pageMode ? 'true' : 'false') : undefined, "current-location-suffix": [true, false].includes(currentLocationSuffix) ? (currentLocationSuffix ? 'true' : 'false') : undefined, "filter-config": filterConfig ? JSON.stringify(filterConfig) : undefined, "group-config": groupConfig ? JSON.stringify(groupConfig) : undefined, filters: filters ? JSON.stringify(filters) : undefined, "exclude-location-ids": excludeLocationIds ? JSON.stringify(excludeLocationIds) : undefined, variant: variant, "page-mode-composer-variant": pageModeComposerVariant, "dialog-variant": dialogVariant, "sort-data": sortData, "search-placeholder": searchPlaceholder, "dark-mode": [true, false].includes(darkMode) ? (darkMode ? 'true' : 'false') : undefined, "floating-mode": [true, false].includes(embedMode) ? (embedMode ? 'true' : 'false') : undefined, "filter-option-layout": filterOptionLayout, "filter-count": [true, false].includes(filterCount) ? (filterCount ? 'true' : 'false') : undefined, "full-expanded": [true, false].includes(fullExpanded) ? (fullExpanded ? 'true' : 'false') : undefined, "system-filters-operator": systemFiltersOperator, "sidebar-button-count-type": sidebarButtonCountType }));
483
+ return (React.createElement("velt-comments-sidebar", { ref: ref, position: position, "filter-panel-layout": filterPanelLayout, "focused-thread-mode": [true, false].includes(focusedThreadMode) ? (focusedThreadMode ? 'true' : 'false') : undefined, "focused-thread-dialog-variant": focusedThreadDialogVariant, "custom-actions": [true, false].includes(customActions) ? (customActions ? 'true' : 'false') : undefined, "shadow-dom": [true, false].includes(shadowDom) ? (shadowDom ? 'true' : 'false') : undefined, "embed-mode": [true, false].includes(embedMode) ? (embedMode ? 'true' : 'false') : undefined, "enable-url-navigation": [true, false].includes(enableUrlNavigation) ? (enableUrlNavigation ? 'true' : 'false') : undefined, "url-navigation": [true, false].includes(urlNavigation) ? (urlNavigation ? 'true' : 'false') : undefined, "query-params-comments": [true, false].includes(queryParamsComments) ? (queryParamsComments ? 'true' : 'false') : undefined, "page-mode": [true, false].includes(pageMode) ? (pageMode ? 'true' : 'false') : undefined, "current-location-suffix": [true, false].includes(currentLocationSuffix) ? (currentLocationSuffix ? 'true' : 'false') : undefined, "filter-config": filterConfig ? JSON.stringify(filterConfig) : undefined, "group-config": groupConfig ? JSON.stringify(groupConfig) : undefined, filters: filters ? JSON.stringify(filters) : undefined, "exclude-location-ids": excludeLocationIds ? JSON.stringify(excludeLocationIds) : undefined, variant: variant, "page-mode-composer-variant": pageModeComposerVariant, "dialog-variant": dialogVariant, "sort-data": sortData, "search-placeholder": searchPlaceholder, "dark-mode": [true, false].includes(darkMode) ? (darkMode ? 'true' : 'false') : undefined, "floating-mode": [true, false].includes(embedMode) ? (embedMode ? 'true' : 'false') : undefined, "filter-option-layout": filterOptionLayout, "filter-count": [true, false].includes(filterCount) ? (filterCount ? 'true' : 'false') : undefined, "full-expanded": [true, false].includes(fullExpanded) ? (fullExpanded ? 'true' : 'false') : undefined, "system-filters-operator": systemFiltersOperator, "sidebar-button-count-type": sidebarButtonCountType, "filter-ghost-comments-in-sidebar": [true, false].includes(filterGhostCommentsInSidebar) ? (filterGhostCommentsInSidebar ? 'true' : 'false') : undefined }));
477
484
  };
478
485
 
479
486
  var SnippylyCommentTool = function (props) {
@@ -683,7 +690,7 @@ var SnippylyRecorderTool = function (props) {
683
690
  };
684
691
 
685
692
  var SnippylySidebarButton = function (props) {
686
- var tooltipText = props.tooltipText, children = props.children, darkMode = props.darkMode, shadowDom = props.shadowDom, floatingMode = props.floatingMode, pageMode = props.pageMode, sortData = props.sortData, urlNavigation = props.urlNavigation, currentLocationSuffix = props.currentLocationSuffix, filterConfig = props.filterConfig, groupConfig = props.groupConfig, filters = props.filters, excludeLocationIds = props.excludeLocationIds, dialogVariant = props.dialogVariant, pageModeComposerVariant = props.pageModeComposerVariant, sidebarShadowDom = props.sidebarShadowDom, sidebarVariant = props.sidebarVariant, position = props.position, onCommentClick = props.onCommentClick, onSidebarOpen = props.onSidebarOpen, filterPanelLayout = props.filterPanelLayout, sidebarButtonCountType = props.sidebarButtonCountType;
693
+ var tooltipText = props.tooltipText, children = props.children, darkMode = props.darkMode, shadowDom = props.shadowDom, floatingMode = props.floatingMode, pageMode = props.pageMode, sortData = props.sortData, urlNavigation = props.urlNavigation, currentLocationSuffix = props.currentLocationSuffix, filterConfig = props.filterConfig, groupConfig = props.groupConfig, filters = props.filters, excludeLocationIds = props.excludeLocationIds, dialogVariant = props.dialogVariant, pageModeComposerVariant = props.pageModeComposerVariant, sidebarShadowDom = props.sidebarShadowDom, sidebarVariant = props.sidebarVariant, position = props.position, onCommentClick = props.onCommentClick, onSidebarOpen = props.onSidebarOpen, filterPanelLayout = props.filterPanelLayout, sidebarButtonCountType = props.sidebarButtonCountType, filterGhostCommentsInSidebar = props.filterGhostCommentsInSidebar;
687
694
  var ref = useRef();
688
695
  var onSidebarOpenRef = useRef(onSidebarOpen);
689
696
  var onCommentClickRef = useRef(onCommentClick);
@@ -719,7 +726,7 @@ var SnippylySidebarButton = function (props) {
719
726
  }
720
727
  };
721
728
  });
722
- return (React.createElement("velt-sidebar-button", { "tooltip-text": tooltipText, "shadow-dom": [true, false].includes(shadowDom) ? (shadowDom ? 'true' : 'false') : undefined, "dark-mode": [true, false].includes(darkMode) ? (darkMode ? 'true' : 'false') : undefined, "floating-mode": [true, false].includes(floatingMode) ? (floatingMode ? 'true' : 'false') : undefined, ref: ref, "page-mode": [true, false].includes(pageMode) ? (pageMode ? 'true' : 'false') : undefined, "sort-data": sortData, "url-navigation": [true, false].includes(urlNavigation) ? (urlNavigation ? 'true' : 'false') : undefined, "current-location-suffix": [true, false].includes(currentLocationSuffix) ? (currentLocationSuffix ? 'true' : 'false') : undefined, "filter-config": filterConfig ? JSON.stringify(filterConfig) : undefined, "group-config": groupConfig ? JSON.stringify(groupConfig) : undefined, filters: filters ? JSON.stringify(filters) : undefined, "exclude-location-ids": excludeLocationIds ? JSON.stringify(excludeLocationIds) : undefined, "dialog-variant": dialogVariant, "page-mode-composer-variant": pageModeComposerVariant, "sidebar-shadow-dom": [true, false].includes(sidebarShadowDom) ? (sidebarShadowDom ? 'true' : 'false') : undefined, "sidebar-variant": sidebarVariant, position: position, "filter-panel-layout": filterPanelLayout, "sidebar-button-count-type": sidebarButtonCountType }, children));
729
+ return (React.createElement("velt-sidebar-button", { "tooltip-text": tooltipText, "shadow-dom": [true, false].includes(shadowDom) ? (shadowDom ? 'true' : 'false') : undefined, "dark-mode": [true, false].includes(darkMode) ? (darkMode ? 'true' : 'false') : undefined, "floating-mode": [true, false].includes(floatingMode) ? (floatingMode ? 'true' : 'false') : undefined, ref: ref, "page-mode": [true, false].includes(pageMode) ? (pageMode ? 'true' : 'false') : undefined, "sort-data": sortData, "url-navigation": [true, false].includes(urlNavigation) ? (urlNavigation ? 'true' : 'false') : undefined, "current-location-suffix": [true, false].includes(currentLocationSuffix) ? (currentLocationSuffix ? 'true' : 'false') : undefined, "filter-config": filterConfig ? JSON.stringify(filterConfig) : undefined, "group-config": groupConfig ? JSON.stringify(groupConfig) : undefined, filters: filters ? JSON.stringify(filters) : undefined, "exclude-location-ids": excludeLocationIds ? JSON.stringify(excludeLocationIds) : undefined, "dialog-variant": dialogVariant, "page-mode-composer-variant": pageModeComposerVariant, "sidebar-shadow-dom": [true, false].includes(sidebarShadowDom) ? (sidebarShadowDom ? 'true' : 'false') : undefined, "sidebar-variant": sidebarVariant, position: position, "filter-panel-layout": filterPanelLayout, "sidebar-button-count-type": sidebarButtonCountType, "filter-ghost-comments-in-sidebar": [true, false].includes(filterGhostCommentsInSidebar) ? (filterGhostCommentsInSidebar ? 'true' : 'false') : undefined }, children));
723
730
  };
724
731
 
725
732
  var VeltCommentsSidebarButton = function (props) {