@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.
package/cjs/index.js CHANGED
@@ -140,10 +140,10 @@ var loadVelt = function (callback, version, staging, develop, proxyDomain, integ
140
140
  // No script tag exists - this is the first component to request Velt
141
141
  var script = document.createElement('script');
142
142
  if (staging) {
143
- 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");
143
+ script.src = "https://serveprivatenpmpackage-4mfhcuyw2q-uc.a.run.app/sdk-staging/lib/sdk@".concat(version, "/velt.js");
144
144
  }
145
145
  else if (develop) {
146
- 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");
146
+ script.src = "https://serveprivatenpmpackage-4mfhcuyw2q-uc.a.run.app/sdk-dev/lib/sdk@".concat(version, "/velt.js");
147
147
  }
148
148
  else {
149
149
  if (proxyDomain) {
@@ -212,13 +212,13 @@ var loadVelt = function (callback, version, staging, develop, proxyDomain, integ
212
212
  };
213
213
  };
214
214
 
215
- var VELT_SDK_VERSION = '5.0.4';
215
+ var VELT_SDK_VERSION = '6.0.0-beta.2';
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
- '5.0.4': 'sha384-M+1SWJx6PMFgOO4nsVge5L0ySEDHaWC5MQU395bJic1LRPVX+vHwkVTTDKpPuo6E',
221
+ '6.0.0-beta.2': 'sha384-/cEsay1LeK6UfXkMdZIV68Wmmjlc+0Vhhji2xLFp7HwBThX2yy4pgeOqrI0+7eMP',
222
222
  };
223
223
 
224
224
  var validProps = ['veltIf', 'veltClass', 'className', 'variant'];
@@ -2499,63 +2499,29 @@ var VeltVideoEditor = function (props) {
2499
2499
  };
2500
2500
 
2501
2501
  var VeltCommentsSidebarV2 = function (props) {
2502
- 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;
2502
+ 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;
2503
2503
  var ref = React.useRef(null);
2504
- var onSidebarOpenRef = React.useRef(onSidebarOpen);
2505
- var openSidebarRef = React.useRef(openSidebar);
2506
- var onSidebarCloseRef = React.useRef(onSidebarClose);
2507
- var onCommentClickRef = React.useRef(onCommentClick);
2508
- var onSidebarCommentClickRef = React.useRef(onSidebarCommentClick);
2509
- var onCommentNavigationButtonClickRef = React.useRef(onCommentNavigationButtonClick);
2510
2504
  var onFullscreenClickRef = React.useRef(onFullscreenClick);
2511
- React.useEffect(function () { onSidebarOpenRef.current = onSidebarOpen; }, [onSidebarOpen]);
2512
- React.useEffect(function () { openSidebarRef.current = openSidebar; }, [openSidebar]);
2513
- React.useEffect(function () { onSidebarCloseRef.current = onSidebarClose; }, [onSidebarClose]);
2514
- React.useEffect(function () { onCommentClickRef.current = onCommentClick; }, [onCommentClick]);
2515
- React.useEffect(function () { onSidebarCommentClickRef.current = onSidebarCommentClick; }, [onSidebarCommentClick]);
2516
- React.useEffect(function () { onCommentNavigationButtonClickRef.current = onCommentNavigationButtonClick; }, [onCommentNavigationButtonClick]);
2517
2505
  React.useEffect(function () { onFullscreenClickRef.current = onFullscreenClick; }, [onFullscreenClick]);
2506
+ // NOTE: sidebar open/close, comment click, and comment navigation-button click are no
2507
+ // longer @Output() callbacks on the V2 sidebar — they are emitted on the unified on()
2508
+ // bus. Subscribe via `useCommentEventCallback('sidebarOpen' | 'sidebarClose' |
2509
+ // 'commentClick' | 'commentNavigationButtonClick')`. Only fullscreen remains an @Output().
2518
2510
  React.useEffect(function () {
2519
2511
  var element;
2520
- var handleSidebarOpen = function (event) {
2521
- // V1 order: deprecated alias first, then the current callback.
2522
- if (openSidebarRef.current)
2523
- openSidebarRef.current(event === null || event === void 0 ? void 0 : event.detail);
2524
- if (onSidebarOpenRef.current)
2525
- onSidebarOpenRef.current(event === null || event === void 0 ? void 0 : event.detail);
2526
- };
2527
- var handleSidebarClose = function (event) { if (onSidebarCloseRef.current)
2528
- onSidebarCloseRef.current(event === null || event === void 0 ? void 0 : event.detail); };
2529
- var handleCommentClick = function (event) {
2530
- // V1 order: deprecated alias first, then the current callback.
2531
- if (onSidebarCommentClickRef.current)
2532
- onSidebarCommentClickRef.current(event === null || event === void 0 ? void 0 : event.detail);
2533
- if (onCommentClickRef.current)
2534
- onCommentClickRef.current(event === null || event === void 0 ? void 0 : event.detail);
2535
- };
2536
- var handleCommentNavigationButtonClick = function (event) { if (onCommentNavigationButtonClickRef.current)
2537
- onCommentNavigationButtonClickRef.current(event === null || event === void 0 ? void 0 : event.detail); };
2538
2512
  var handleFullscreenClick = function (event) { if (onFullscreenClickRef.current)
2539
2513
  onFullscreenClickRef.current(event === null || event === void 0 ? void 0 : event.detail); };
2540
2514
  if (ref.current) {
2541
2515
  element = ref.current;
2542
- element.addEventListener('onSidebarOpen', handleSidebarOpen);
2543
- element.addEventListener('onSidebarClose', handleSidebarClose);
2544
- element.addEventListener('onSidebarCommentClick', handleCommentClick);
2545
- element.addEventListener('onCommentNavigationButtonClick', handleCommentNavigationButtonClick);
2546
2516
  element.addEventListener('onFullscreenClick', handleFullscreenClick);
2547
2517
  }
2548
2518
  return function () {
2549
2519
  if (element) {
2550
- element.removeEventListener('onSidebarOpen', handleSidebarOpen);
2551
- element.removeEventListener('onSidebarClose', handleSidebarClose);
2552
- element.removeEventListener('onSidebarCommentClick', handleCommentClick);
2553
- element.removeEventListener('onCommentNavigationButtonClick', handleCommentNavigationButtonClick);
2554
2520
  element.removeEventListener('onFullscreenClick', handleFullscreenClick);
2555
2521
  }
2556
2522
  };
2557
2523
  }, []);
2558
- return (React__default["default"].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));
2524
+ return (React__default["default"].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));
2559
2525
  };
2560
2526
 
2561
2527
  var VeltCommentSidebarV2Skeleton = function (props) {