@veltdev/react 5.0.4 → 6.0.0-beta.2

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.
@@ -23,13 +23,8 @@ export interface IVeltCommentSidebarV2Props extends React.DetailedHTMLProps<Reac
23
23
  excludeLocationIds?: string[];
24
24
  sortBy?: any;
25
25
  sortOrder?: any;
26
- sortData?: 'asc' | 'desc' | 'none';
27
26
  customActions?: boolean;
28
27
  openAnnotationInFocusMode?: boolean;
29
- /**
30
- * @deprecated Use `urlNavigation` instead
31
- */
32
- enableUrlNavigation?: boolean;
33
28
  urlNavigation?: boolean;
34
29
  queryParamsComments?: boolean;
35
30
  fullScreen?: boolean;
@@ -56,18 +51,6 @@ export interface IVeltCommentSidebarV2Props extends React.DetailedHTMLProps<Reac
56
51
  measuredSize?: number;
57
52
  minBufferPx?: number;
58
53
  maxBufferPx?: number;
59
- onSidebarOpen?: Function;
60
- /**
61
- * @deprecated Use `onSidebarOpen` instead
62
- */
63
- openSidebar?: Function;
64
- onSidebarClose?: Function;
65
- onCommentClick?: Function;
66
- /**
67
- * @deprecated Use `onCommentClick` instead
68
- */
69
- onSidebarCommentClick?: Function;
70
- onCommentNavigationButtonClick?: Function;
71
54
  onFullscreenClick?: Function;
72
55
  }
73
56
  declare const VeltCommentsSidebarV2: React.FC<IVeltCommentSidebarV2Props>;
@@ -1,5 +1,5 @@
1
1
  /// <reference types="react" />
2
- export declare const VELT_SDK_VERSION = "5.0.4";
2
+ export declare const VELT_SDK_VERSION = "6.0.0-beta.2";
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
@@ -132,10 +132,10 @@ var loadVelt = function (callback, version, staging, develop, proxyDomain, integ
132
132
  // No script tag exists - this is the first component to request Velt
133
133
  var script = document.createElement('script');
134
134
  if (staging) {
135
- script.src = "https://us-central1-snipply-sdk-staging.cloudfunctions.net/getprivatenpmpackagefile?packageName=sdk-staging&packageVersion=".concat((!version || version === 'latest') ? '1.0.1' : version, "&filePath=velt.js&orgName=@veltdev");
135
+ script.src = "https://serveprivatenpmpackage-4mfhcuyw2q-uc.a.run.app/sdk-staging/lib/sdk@".concat(version, "/velt.js");
136
136
  }
137
137
  else if (develop) {
138
- script.src = "https://us-central1-snipply-sdk-staging.cloudfunctions.net/getprivatenpmpackagefile?packageName=sdk-dev&packageVersion=".concat((!version || version === 'latest') ? '1.0.1' : version, "&filePath=velt.js&orgName=@veltdev");
138
+ script.src = "https://serveprivatenpmpackage-4mfhcuyw2q-uc.a.run.app/sdk-dev/lib/sdk@".concat(version, "/velt.js");
139
139
  }
140
140
  else {
141
141
  if (proxyDomain) {
@@ -204,13 +204,13 @@ var loadVelt = function (callback, version, staging, develop, proxyDomain, integ
204
204
  };
205
205
  };
206
206
 
207
- var VELT_SDK_VERSION = '5.0.4';
207
+ var VELT_SDK_VERSION = '6.0.0-beta.2';
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
- '5.0.4': 'sha384-M+1SWJx6PMFgOO4nsVge5L0ySEDHaWC5MQU395bJic1LRPVX+vHwkVTTDKpPuo6E',
213
+ '6.0.0-beta.2': 'sha384-/cEsay1LeK6UfXkMdZIV68Wmmjlc+0Vhhji2xLFp7HwBThX2yy4pgeOqrI0+7eMP',
214
214
  };
215
215
 
216
216
  var validProps = ['veltIf', 'veltClass', 'className', 'variant'];
@@ -2491,63 +2491,29 @@ var VeltVideoEditor = function (props) {
2491
2491
  };
2492
2492
 
2493
2493
  var VeltCommentsSidebarV2 = function (props) {
2494
- var pageMode = props.pageMode, focusedThreadMode = props.focusedThreadMode, readOnly = props.readOnly, embedMode = props.embedMode, floatingMode = props.floatingMode, position = props.position, variant = props.variant, forceClose = props.forceClose, darkMode = props.darkMode, defaultCondition = props.defaultCondition, filters = props.filters, miniFilters = props.miniFilters, minimalFilters = props.minimalFilters, filterOperator = props.filterOperator, filterPanelLayout = props.filterPanelLayout, filterOptionLayout = props.filterOptionLayout, filterCount = props.filterCount, filterGhostCommentsInSidebar = props.filterGhostCommentsInSidebar, systemFiltersOperator = props.systemFiltersOperator, defaultMinimalFilter = props.defaultMinimalFilter, excludeLocationIds = props.excludeLocationIds, sortBy = props.sortBy, sortOrder = props.sortOrder, sortData = props.sortData, customActions = props.customActions, openAnnotationInFocusMode = props.openAnnotationInFocusMode, enableUrlNavigation = props.enableUrlNavigation, urlNavigation = props.urlNavigation, queryParamsComments = props.queryParamsComments, fullScreen = props.fullScreen, shadowDom = props.shadowDom, fullExpanded = props.fullExpanded, dialogSelection = props.dialogSelection, expandOnSelection = props.expandOnSelection, currentLocationSuffix = props.currentLocationSuffix, sidebarButtonCountType = props.sidebarButtonCountType, dialogVariant = props.dialogVariant, focusedThreadDialogVariant = props.focusedThreadDialogVariant, pageModeComposerVariant = props.pageModeComposerVariant, pageModePlaceholder = props.pageModePlaceholder, searchPlaceholder = props.searchPlaceholder, commentPlaceholder = props.commentPlaceholder, replyPlaceholder = props.replyPlaceholder, editPlaceholder = props.editPlaceholder, editCommentPlaceholder = props.editCommentPlaceholder, editReplyPlaceholder = props.editReplyPlaceholder, context = props.context, groupConfig = props.groupConfig, measuredSize = props.measuredSize, minBufferPx = props.minBufferPx, maxBufferPx = props.maxBufferPx, onSidebarOpen = props.onSidebarOpen, openSidebar = props.openSidebar, onSidebarClose = props.onSidebarClose, onCommentClick = props.onCommentClick, onSidebarCommentClick = props.onSidebarCommentClick, onCommentNavigationButtonClick = props.onCommentNavigationButtonClick, onFullscreenClick = props.onFullscreenClick, children = props.children;
2494
+ var pageMode = props.pageMode, focusedThreadMode = props.focusedThreadMode, readOnly = props.readOnly, embedMode = props.embedMode, floatingMode = props.floatingMode, position = props.position, variant = props.variant, forceClose = props.forceClose, darkMode = props.darkMode, defaultCondition = props.defaultCondition, filters = props.filters, miniFilters = props.miniFilters, minimalFilters = props.minimalFilters, filterOperator = props.filterOperator, filterPanelLayout = props.filterPanelLayout, filterOptionLayout = props.filterOptionLayout, filterCount = props.filterCount, filterGhostCommentsInSidebar = props.filterGhostCommentsInSidebar, systemFiltersOperator = props.systemFiltersOperator, defaultMinimalFilter = props.defaultMinimalFilter, excludeLocationIds = props.excludeLocationIds, sortBy = props.sortBy, sortOrder = props.sortOrder, customActions = props.customActions, openAnnotationInFocusMode = props.openAnnotationInFocusMode, urlNavigation = props.urlNavigation, queryParamsComments = props.queryParamsComments, fullScreen = props.fullScreen, shadowDom = props.shadowDom, fullExpanded = props.fullExpanded, dialogSelection = props.dialogSelection, expandOnSelection = props.expandOnSelection, currentLocationSuffix = props.currentLocationSuffix, sidebarButtonCountType = props.sidebarButtonCountType, dialogVariant = props.dialogVariant, focusedThreadDialogVariant = props.focusedThreadDialogVariant, pageModeComposerVariant = props.pageModeComposerVariant, pageModePlaceholder = props.pageModePlaceholder, searchPlaceholder = props.searchPlaceholder, commentPlaceholder = props.commentPlaceholder, replyPlaceholder = props.replyPlaceholder, editPlaceholder = props.editPlaceholder, editCommentPlaceholder = props.editCommentPlaceholder, editReplyPlaceholder = props.editReplyPlaceholder, context = props.context, groupConfig = props.groupConfig, measuredSize = props.measuredSize, minBufferPx = props.minBufferPx, maxBufferPx = props.maxBufferPx, onFullscreenClick = props.onFullscreenClick, children = props.children;
2495
2495
  var ref = useRef(null);
2496
- var onSidebarOpenRef = useRef(onSidebarOpen);
2497
- var openSidebarRef = useRef(openSidebar);
2498
- var onSidebarCloseRef = useRef(onSidebarClose);
2499
- var onCommentClickRef = useRef(onCommentClick);
2500
- var onSidebarCommentClickRef = useRef(onSidebarCommentClick);
2501
- var onCommentNavigationButtonClickRef = useRef(onCommentNavigationButtonClick);
2502
2496
  var onFullscreenClickRef = useRef(onFullscreenClick);
2503
- useEffect(function () { onSidebarOpenRef.current = onSidebarOpen; }, [onSidebarOpen]);
2504
- useEffect(function () { openSidebarRef.current = openSidebar; }, [openSidebar]);
2505
- useEffect(function () { onSidebarCloseRef.current = onSidebarClose; }, [onSidebarClose]);
2506
- useEffect(function () { onCommentClickRef.current = onCommentClick; }, [onCommentClick]);
2507
- useEffect(function () { onSidebarCommentClickRef.current = onSidebarCommentClick; }, [onSidebarCommentClick]);
2508
- useEffect(function () { onCommentNavigationButtonClickRef.current = onCommentNavigationButtonClick; }, [onCommentNavigationButtonClick]);
2509
2497
  useEffect(function () { onFullscreenClickRef.current = onFullscreenClick; }, [onFullscreenClick]);
2498
+ // NOTE: sidebar open/close, comment click, and comment navigation-button click are no
2499
+ // longer @Output() callbacks on the V2 sidebar — they are emitted on the unified on()
2500
+ // bus. Subscribe via `useCommentEventCallback('sidebarOpen' | 'sidebarClose' |
2501
+ // 'commentClick' | 'commentNavigationButtonClick')`. Only fullscreen remains an @Output().
2510
2502
  useEffect(function () {
2511
2503
  var element;
2512
- var handleSidebarOpen = function (event) {
2513
- // V1 order: deprecated alias first, then the current callback.
2514
- if (openSidebarRef.current)
2515
- openSidebarRef.current(event === null || event === void 0 ? void 0 : event.detail);
2516
- if (onSidebarOpenRef.current)
2517
- onSidebarOpenRef.current(event === null || event === void 0 ? void 0 : event.detail);
2518
- };
2519
- var handleSidebarClose = function (event) { if (onSidebarCloseRef.current)
2520
- onSidebarCloseRef.current(event === null || event === void 0 ? void 0 : event.detail); };
2521
- var handleCommentClick = function (event) {
2522
- // V1 order: deprecated alias first, then the current callback.
2523
- if (onSidebarCommentClickRef.current)
2524
- onSidebarCommentClickRef.current(event === null || event === void 0 ? void 0 : event.detail);
2525
- if (onCommentClickRef.current)
2526
- onCommentClickRef.current(event === null || event === void 0 ? void 0 : event.detail);
2527
- };
2528
- var handleCommentNavigationButtonClick = function (event) { if (onCommentNavigationButtonClickRef.current)
2529
- onCommentNavigationButtonClickRef.current(event === null || event === void 0 ? void 0 : event.detail); };
2530
2504
  var handleFullscreenClick = function (event) { if (onFullscreenClickRef.current)
2531
2505
  onFullscreenClickRef.current(event === null || event === void 0 ? void 0 : event.detail); };
2532
2506
  if (ref.current) {
2533
2507
  element = ref.current;
2534
- element.addEventListener('onSidebarOpen', handleSidebarOpen);
2535
- element.addEventListener('onSidebarClose', handleSidebarClose);
2536
- element.addEventListener('onSidebarCommentClick', handleCommentClick);
2537
- element.addEventListener('onCommentNavigationButtonClick', handleCommentNavigationButtonClick);
2538
2508
  element.addEventListener('onFullscreenClick', handleFullscreenClick);
2539
2509
  }
2540
2510
  return function () {
2541
2511
  if (element) {
2542
- element.removeEventListener('onSidebarOpen', handleSidebarOpen);
2543
- element.removeEventListener('onSidebarClose', handleSidebarClose);
2544
- element.removeEventListener('onSidebarCommentClick', handleCommentClick);
2545
- element.removeEventListener('onCommentNavigationButtonClick', handleCommentNavigationButtonClick);
2546
2512
  element.removeEventListener('onFullscreenClick', handleFullscreenClick);
2547
2513
  }
2548
2514
  };
2549
2515
  }, []);
2550
- return (React.createElement("velt-comments-sidebar-v2", { ref: ref, "page-mode": [true, false].includes(pageMode) ? (pageMode ? 'true' : 'false') : undefined, "focused-thread-mode": [true, false].includes(focusedThreadMode) ? (focusedThreadMode ? 'true' : 'false') : undefined, "read-only": [true, false].includes(readOnly) ? (readOnly ? 'true' : 'false') : undefined, "embed-mode": embedMode, "floating-mode": [true, false].includes(floatingMode) ? (floatingMode ? 'true' : 'false') : undefined, position: position, variant: variant, "force-close": [true, false].includes(forceClose) ? (forceClose ? 'true' : 'false') : undefined, "dark-mode": [true, false].includes(darkMode) ? (darkMode ? 'true' : 'false') : undefined, "default-condition": [true, false].includes(defaultCondition) ? (defaultCondition ? 'true' : 'false') : undefined, filters: filters ? (typeof filters === 'object' ? JSON.stringify(filters) : filters) : undefined, "mini-filters": miniFilters ? (typeof miniFilters === 'object' ? JSON.stringify(miniFilters) : miniFilters) : undefined, "minimal-filters": minimalFilters ? (typeof minimalFilters === 'object' ? JSON.stringify(minimalFilters) : minimalFilters) : undefined, "filter-operator": filterOperator, "filter-panel-layout": filterPanelLayout, "filter-option-layout": filterOptionLayout, "filter-count": [true, false].includes(filterCount) ? (filterCount ? 'true' : 'false') : undefined, "filter-ghost-comments-in-sidebar": [true, false].includes(filterGhostCommentsInSidebar) ? (filterGhostCommentsInSidebar ? 'true' : 'false') : undefined, "system-filters-operator": systemFiltersOperator, "default-minimal-filter": defaultMinimalFilter, "exclude-location-ids": excludeLocationIds ? JSON.stringify(excludeLocationIds) : undefined, "sort-by": sortBy, "sort-order": sortOrder, "sort-data": sortData, "custom-actions": [true, false].includes(customActions) ? (customActions ? 'true' : 'false') : undefined, "open-annotation-in-focus-mode": [true, false].includes(openAnnotationInFocusMode) ? (openAnnotationInFocusMode ? '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, "full-screen": [true, false].includes(fullScreen) ? (fullScreen ? 'true' : 'false') : undefined, "shadow-dom": [true, false].includes(shadowDom) ? (shadowDom ? 'true' : 'false') : undefined, "full-expanded": [true, false].includes(fullExpanded) ? (fullExpanded ? 'true' : 'false') : undefined, "dialog-selection": [true, false].includes(dialogSelection) ? (dialogSelection ? 'true' : 'false') : undefined, "expand-on-selection": [true, false].includes(expandOnSelection) ? (expandOnSelection ? 'true' : 'false') : undefined, "current-location-suffix": [true, false].includes(currentLocationSuffix) ? (currentLocationSuffix ? 'true' : 'false') : undefined, "sidebar-button-count-type": sidebarButtonCountType, "dialog-variant": dialogVariant, "focused-thread-dialog-variant": focusedThreadDialogVariant, "page-mode-composer-variant": pageModeComposerVariant, "page-mode-placeholder": pageModePlaceholder, "search-placeholder": searchPlaceholder, "comment-placeholder": commentPlaceholder, "reply-placeholder": replyPlaceholder, "edit-placeholder": editPlaceholder, "edit-comment-placeholder": editCommentPlaceholder, "edit-reply-placeholder": editReplyPlaceholder, context: context ? JSON.stringify(context) : undefined, "group-config": groupConfig ? (typeof groupConfig === 'object' ? JSON.stringify(groupConfig) : groupConfig) : undefined, "measured-size": measuredSize !== undefined && measuredSize !== null ? String(measuredSize) : undefined, "min-buffer-px": minBufferPx !== undefined && minBufferPx !== null ? String(minBufferPx) : undefined, "max-buffer-px": maxBufferPx !== undefined && maxBufferPx !== null ? String(maxBufferPx) : undefined }, children));
2516
+ return (React.createElement("velt-comments-sidebar-v2", { ref: ref, "page-mode": [true, false].includes(pageMode) ? (pageMode ? 'true' : 'false') : undefined, "focused-thread-mode": [true, false].includes(focusedThreadMode) ? (focusedThreadMode ? 'true' : 'false') : undefined, "read-only": [true, false].includes(readOnly) ? (readOnly ? 'true' : 'false') : undefined, "embed-mode": embedMode, "floating-mode": [true, false].includes(floatingMode) ? (floatingMode ? 'true' : 'false') : undefined, position: position, variant: variant, "force-close": [true, false].includes(forceClose) ? (forceClose ? 'true' : 'false') : undefined, "dark-mode": [true, false].includes(darkMode) ? (darkMode ? 'true' : 'false') : undefined, "default-condition": [true, false].includes(defaultCondition) ? (defaultCondition ? 'true' : 'false') : undefined, filters: filters ? (typeof filters === 'object' ? JSON.stringify(filters) : filters) : undefined, "mini-filters": miniFilters ? (typeof miniFilters === 'object' ? JSON.stringify(miniFilters) : miniFilters) : undefined, "minimal-filters": minimalFilters ? (typeof minimalFilters === 'object' ? JSON.stringify(minimalFilters) : minimalFilters) : undefined, "filter-operator": filterOperator, "filter-panel-layout": filterPanelLayout, "filter-option-layout": filterOptionLayout, "filter-count": [true, false].includes(filterCount) ? (filterCount ? 'true' : 'false') : undefined, "filter-ghost-comments-in-sidebar": [true, false].includes(filterGhostCommentsInSidebar) ? (filterGhostCommentsInSidebar ? 'true' : 'false') : undefined, "system-filters-operator": systemFiltersOperator, "default-minimal-filter": defaultMinimalFilter, "exclude-location-ids": excludeLocationIds ? JSON.stringify(excludeLocationIds) : undefined, "sort-by": sortBy, "sort-order": sortOrder, "custom-actions": [true, false].includes(customActions) ? (customActions ? 'true' : 'false') : undefined, "open-annotation-in-focus-mode": [true, false].includes(openAnnotationInFocusMode) ? (openAnnotationInFocusMode ? 'true' : 'false') : undefined, "url-navigation": [true, false].includes(urlNavigation) ? (urlNavigation ? 'true' : 'false') : undefined, "query-params-comments": [true, false].includes(queryParamsComments) ? (queryParamsComments ? 'true' : 'false') : undefined, "full-screen": [true, false].includes(fullScreen) ? (fullScreen ? 'true' : 'false') : undefined, "shadow-dom": [true, false].includes(shadowDom) ? (shadowDom ? 'true' : 'false') : undefined, "full-expanded": [true, false].includes(fullExpanded) ? (fullExpanded ? 'true' : 'false') : undefined, "dialog-selection": [true, false].includes(dialogSelection) ? (dialogSelection ? 'true' : 'false') : undefined, "expand-on-selection": [true, false].includes(expandOnSelection) ? (expandOnSelection ? 'true' : 'false') : undefined, "current-location-suffix": [true, false].includes(currentLocationSuffix) ? (currentLocationSuffix ? 'true' : 'false') : undefined, "sidebar-button-count-type": sidebarButtonCountType, "dialog-variant": dialogVariant, "focused-thread-dialog-variant": focusedThreadDialogVariant, "page-mode-composer-variant": pageModeComposerVariant, "page-mode-placeholder": pageModePlaceholder, "search-placeholder": searchPlaceholder, "comment-placeholder": commentPlaceholder, "reply-placeholder": replyPlaceholder, "edit-placeholder": editPlaceholder, "edit-comment-placeholder": editCommentPlaceholder, "edit-reply-placeholder": editReplyPlaceholder, context: context ? JSON.stringify(context) : undefined, "group-config": groupConfig ? (typeof groupConfig === 'object' ? JSON.stringify(groupConfig) : groupConfig) : undefined, "measured-size": measuredSize !== undefined && measuredSize !== null ? String(measuredSize) : undefined, "min-buffer-px": minBufferPx !== undefined && minBufferPx !== null ? String(minBufferPx) : undefined, "max-buffer-px": maxBufferPx !== undefined && maxBufferPx !== null ? String(maxBufferPx) : undefined }, children));
2551
2517
  };
2552
2518
 
2553
2519
  var VeltCommentSidebarV2Skeleton = function (props) {