@veltdev/react 3.0.41 → 3.0.43

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.
Files changed (42) hide show
  1. package/cjs/index.js +60 -3
  2. package/cjs/index.js.map +1 -1
  3. package/cjs/types/components/SnippylyCommentsSidebar/SnippylyCommentsSidebar.d.ts +3 -0
  4. package/cjs/types/components/VeltCommentDialogWireframe/VeltCommentDialogNavigationButton/VeltCommentDialogNavigationButton.d.ts +6 -0
  5. package/cjs/types/components/VeltCommentDialogWireframe/VeltCommentDialogNavigationButton/index.d.ts +1 -0
  6. package/cjs/types/components/VeltCommentText/VeltCommentText.d.ts +7 -0
  7. package/cjs/types/components/VeltCommentText/index.d.ts +1 -0
  8. package/cjs/types/components/VeltCommentThreadWireframe/VeltCommentThreadWireframe.d.ts +8 -0
  9. package/cjs/types/components/VeltCommentThreadWireframe/index.d.ts +1 -0
  10. package/cjs/types/components/VeltCommentsSidebarWireframe/VeltCommentsSidebarFocusedThread/VeltCommentsSidebarFocusedThread.d.ts +12 -0
  11. package/cjs/types/components/VeltCommentsSidebarWireframe/VeltCommentsSidebarFocusedThread/VeltCommentsSidebarFocusedThreadBackButton/VeltCommentsSidebarFocusedThreadBackButton.d.ts +8 -0
  12. package/cjs/types/components/VeltCommentsSidebarWireframe/VeltCommentsSidebarFocusedThread/VeltCommentsSidebarFocusedThreadBackButton/index.d.ts +1 -0
  13. package/cjs/types/components/VeltCommentsSidebarWireframe/VeltCommentsSidebarFocusedThread/VeltCommentsSidebarFocusedThreadDialogContainer/VeltCommentsSidebarFocusedThreadDialogContainer.d.ts +8 -0
  14. package/cjs/types/components/VeltCommentsSidebarWireframe/VeltCommentsSidebarFocusedThread/VeltCommentsSidebarFocusedThreadDialogContainer/index.d.ts +1 -0
  15. package/cjs/types/components/VeltCommentsSidebarWireframe/VeltCommentsSidebarFocusedThread/index.d.ts +1 -0
  16. package/cjs/types/components/VeltCommentsSidebarWireframe/VeltCommentsSidebarWireframe.d.ts +2 -0
  17. package/cjs/types/components/index.d.ts +2 -0
  18. package/cjs/types/constants.d.ts +1 -1
  19. package/cjs/types/hooks/SelectionElement.d.ts +2 -1
  20. package/cjs/types/hooks/index.d.ts +1 -1
  21. package/esm/index.js +58 -4
  22. package/esm/index.js.map +1 -1
  23. package/esm/types/components/SnippylyCommentsSidebar/SnippylyCommentsSidebar.d.ts +3 -0
  24. package/esm/types/components/VeltCommentDialogWireframe/VeltCommentDialogNavigationButton/VeltCommentDialogNavigationButton.d.ts +6 -0
  25. package/esm/types/components/VeltCommentDialogWireframe/VeltCommentDialogNavigationButton/index.d.ts +1 -0
  26. package/esm/types/components/VeltCommentText/VeltCommentText.d.ts +7 -0
  27. package/esm/types/components/VeltCommentText/index.d.ts +1 -0
  28. package/esm/types/components/VeltCommentThreadWireframe/VeltCommentThreadWireframe.d.ts +8 -0
  29. package/esm/types/components/VeltCommentThreadWireframe/index.d.ts +1 -0
  30. package/esm/types/components/VeltCommentsSidebarWireframe/VeltCommentsSidebarFocusedThread/VeltCommentsSidebarFocusedThread.d.ts +12 -0
  31. package/esm/types/components/VeltCommentsSidebarWireframe/VeltCommentsSidebarFocusedThread/VeltCommentsSidebarFocusedThreadBackButton/VeltCommentsSidebarFocusedThreadBackButton.d.ts +8 -0
  32. package/esm/types/components/VeltCommentsSidebarWireframe/VeltCommentsSidebarFocusedThread/VeltCommentsSidebarFocusedThreadBackButton/index.d.ts +1 -0
  33. package/esm/types/components/VeltCommentsSidebarWireframe/VeltCommentsSidebarFocusedThread/VeltCommentsSidebarFocusedThreadDialogContainer/VeltCommentsSidebarFocusedThreadDialogContainer.d.ts +8 -0
  34. package/esm/types/components/VeltCommentsSidebarWireframe/VeltCommentsSidebarFocusedThread/VeltCommentsSidebarFocusedThreadDialogContainer/index.d.ts +1 -0
  35. package/esm/types/components/VeltCommentsSidebarWireframe/VeltCommentsSidebarFocusedThread/index.d.ts +1 -0
  36. package/esm/types/components/VeltCommentsSidebarWireframe/VeltCommentsSidebarWireframe.d.ts +2 -0
  37. package/esm/types/components/index.d.ts +2 -0
  38. package/esm/types/constants.d.ts +1 -1
  39. package/esm/types/hooks/SelectionElement.d.ts +2 -1
  40. package/esm/types/hooks/index.d.ts +1 -1
  41. package/index.d.ts +40 -2
  42. package/package.json +1 -1
package/cjs/index.js CHANGED
@@ -140,7 +140,7 @@ var loadVelt = function (callback, version, staging, develop, proxyDomain) {
140
140
  }
141
141
  };
142
142
 
143
- var VELT_SDK_VERSION = '3.0.41';
143
+ var VELT_SDK_VERSION = '3.0.43';
144
144
  var VELT_SDK_INIT_EVENT = 'onVeltInit';
145
145
  var VELT_TAB_ID = 'veltTabId';
146
146
 
@@ -363,13 +363,14 @@ var SnippylyComments = function (props) {
363
363
  };
364
364
 
365
365
  var SnippylyCommentsSidebar = function (props) {
366
- 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, 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;
366
+ 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, 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;
367
367
  var ref = React.useRef();
368
368
  var openSidebarRef = React.useRef(openSidebar);
369
369
  var onSidebarOpenRef = React.useRef(onSidebarOpen);
370
370
  var onSidebarCommentClickRef = React.useRef(onSidebarCommentClick);
371
371
  var onCommentClickRef = React.useRef(onCommentClick);
372
372
  var onSidebarCloseRef = React.useRef(onSidebarClose);
373
+ var onCommentNavigationButtonClickRef = React.useRef(onCommentNavigationButtonClick);
373
374
  // Update the ref to always point to the latest callback function
374
375
  React.useEffect(function () {
375
376
  openSidebarRef.current = openSidebar;
@@ -386,6 +387,9 @@ var SnippylyCommentsSidebar = function (props) {
386
387
  React.useEffect(function () {
387
388
  onCommentClickRef.current = onCommentClick;
388
389
  }, [onCommentClick]);
390
+ React.useEffect(function () {
391
+ onCommentNavigationButtonClickRef.current = onCommentNavigationButtonClick;
392
+ }, [onCommentNavigationButtonClick]);
389
393
  React.useEffect(function () {
390
394
  var element;
391
395
  var handleSidebarOpen = function (event) {
@@ -409,12 +413,18 @@ var SnippylyCommentsSidebar = function (props) {
409
413
  onSidebarCloseRef.current(event === null || event === void 0 ? void 0 : event.detail);
410
414
  }
411
415
  };
416
+ var handleCommentNavigationButtonClick = function (event) {
417
+ if (onCommentNavigationButtonClickRef.current) {
418
+ onCommentNavigationButtonClickRef.current(event === null || event === void 0 ? void 0 : event.detail);
419
+ }
420
+ };
412
421
  if (ref.current) {
413
422
  element = ref.current;
414
423
  if (element) {
415
424
  element.addEventListener('onSidebarOpen', handleSidebarOpen);
416
425
  element.addEventListener('onSidebarCommentClick', handleSidebarCommentClick);
417
426
  element.addEventListener('onSidebarClose', handleSidebarClose);
427
+ element.addEventListener('onCommentNavigationButtonClick', handleCommentNavigationButtonClick);
418
428
  }
419
429
  }
420
430
  return function () {
@@ -422,10 +432,11 @@ var SnippylyCommentsSidebar = function (props) {
422
432
  element.removeEventListener('onSidebarOpen', handleSidebarOpen);
423
433
  element.removeEventListener('onSidebarCommentClick', handleSidebarCommentClick);
424
434
  element.removeEventListener('onSidebarClose', handleSidebarClose);
435
+ element.removeEventListener('onCommentNavigationButtonClick', handleCommentNavigationButtonClick);
425
436
  }
426
437
  };
427
438
  }, []);
428
- return (React__default["default"].createElement("velt-comments-sidebar", { ref: ref, position: position, "filter-panel-layout": filterPanelLayout, "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, "dark-mode": [true, false].includes(darkMode) ? (darkMode ? 'true' : 'false') : undefined, "floating-mode": [true, false].includes(embedMode) ? (embedMode ? 'true' : 'false') : undefined }));
439
+ return (React__default["default"].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, "dark-mode": [true, false].includes(darkMode) ? (darkMode ? 'true' : 'false') : undefined, "floating-mode": [true, false].includes(embedMode) ? (embedMode ? 'true' : 'false') : undefined }));
429
440
  };
430
441
 
431
442
  var SnippylyCommentTool = function (props) {
@@ -1391,6 +1402,11 @@ var VeltCommentPin = function (props) {
1391
1402
  return (React__default["default"].createElement("velt-comment-pin", { "annotation-id": annotationId }, children));
1392
1403
  };
1393
1404
 
1405
+ var VeltCommentText = function (props) {
1406
+ var children = props.children, annotationId = props.annotationId, multiThreadAnnotationId = props.multiThreadAnnotationId;
1407
+ return (React__default["default"].createElement("velt-comment-text", { "annotation-id": annotationId, "multi-thread-annotation-id": multiThreadAnnotationId }, children));
1408
+ };
1409
+
1394
1410
  var VeltCanvasComment = function (props) {
1395
1411
  var children = props.children, canvasId = props.canvasId, position = props.position;
1396
1412
  return (React__default["default"].createElement("velt-canvas-comment", { "canvas-id": canvasId, position: JSON.stringify(position) }, children));
@@ -2585,6 +2601,23 @@ var VeltCommentsSidebarActionButton = function (props) {
2585
2601
  return (React__default["default"].createElement("velt-comments-sidebar-action-button-wireframe", { variant: variant, type: type, id: id }, children));
2586
2602
  };
2587
2603
 
2604
+ var VeltCommentsSidebarFocusedThreadBackButton = function (props) {
2605
+ var children = props.children, remainingProps = __rest(props, ["children"]);
2606
+ return (React__default["default"].createElement("velt-comments-sidebar-focused-thread-back-button-wireframe", __assign({}, remainingProps), children));
2607
+ };
2608
+
2609
+ var VeltCommentsSidebarFocusedThreadDialogContainer = function (props) {
2610
+ var children = props.children, remainingProps = __rest(props, ["children"]);
2611
+ return (React__default["default"].createElement("velt-comments-sidebar-focused-thread-dialog-container-wireframe", __assign({}, remainingProps), children));
2612
+ };
2613
+
2614
+ var VeltCommentsSidebarFocusedThread = function (props) {
2615
+ var children = props.children, remainingProps = __rest(props, ["children"]);
2616
+ return (React__default["default"].createElement("velt-comments-sidebar-focused-thread-wireframe", __assign({}, remainingProps), children));
2617
+ };
2618
+ VeltCommentsSidebarFocusedThread.BackButton = VeltCommentsSidebarFocusedThreadBackButton;
2619
+ VeltCommentsSidebarFocusedThread.DialogContainer = VeltCommentsSidebarFocusedThreadDialogContainer;
2620
+
2588
2621
  var VeltCommentsSidebarWireframe = function (props) {
2589
2622
  var children = props.children, remainingProp = __rest(props, ["children"]);
2590
2623
  return (React__default["default"].createElement("velt-comments-sidebar-wireframe", __assign({}, remainingProp), children));
@@ -2605,6 +2638,7 @@ VeltCommentsSidebarWireframe.LocationFilterDropdown = VeltCommentsSidebarLocatio
2605
2638
  VeltCommentsSidebarWireframe.MinimalActionsDropdown = VeltCommentsSidebarMinimalActionsDropdownWireframe;
2606
2639
  VeltCommentsSidebarWireframe.ResetFilterButton = VeltCommentsSidebarResetFilterButtonWireframe;
2607
2640
  VeltCommentsSidebarWireframe.ActionButton = VeltCommentsSidebarActionButton;
2641
+ VeltCommentsSidebarWireframe.FocusedThread = VeltCommentsSidebarFocusedThread;
2608
2642
 
2609
2643
  var VeltCommentPinGhostCommentIndicator = function (props) {
2610
2644
  var children = props.children, remainingProp = __rest(props, ["children"]);
@@ -3414,6 +3448,11 @@ var VeltCommentComposerWireframe = function (props) {
3414
3448
  return (React__default["default"].createElement("velt-comment-composer-wireframe", __assign({}, remainingProps), children));
3415
3449
  };
3416
3450
 
3451
+ var VeltCommentThreadWireframe = function (props) {
3452
+ var children = props.children, remainingProp = __rest(props, ["children"]);
3453
+ return (React__default["default"].createElement("velt-comment-thread-wireframe", __assign({}, remainingProp), children));
3454
+ };
3455
+
3417
3456
  function useClient() {
3418
3457
  var client = useVeltClient().client;
3419
3458
  var _a = React__default["default"].useState(), veltClient = _a[0], setVeltClient = _a[1];
@@ -4111,6 +4150,21 @@ function useLiveSelectionUtils() {
4111
4150
  }, [client, setSelectionElement, selectionElement]);
4112
4151
  return selectionElement;
4113
4152
  }
4153
+ function useLiveSelectionDataHandler() {
4154
+ var selectionElement = useLiveSelectionUtils();
4155
+ var _a = React__default["default"].useState(null), data = _a[0], setData = _a[1];
4156
+ React.useEffect(function () {
4157
+ if (!(selectionElement === null || selectionElement === void 0 ? void 0 : selectionElement.getLiveSelectionData))
4158
+ return;
4159
+ var subscription = selectionElement.getLiveSelectionData().subscribe(function (res) {
4160
+ setData(res);
4161
+ });
4162
+ return function () {
4163
+ subscription.unsubscribe();
4164
+ };
4165
+ }, [selectionElement === null || selectionElement === void 0 ? void 0 : selectionElement.getLiveSelectionData]);
4166
+ return data;
4167
+ }
4114
4168
 
4115
4169
  function useTagUtils() {
4116
4170
  var _a = React__default["default"].useState(), tagElement = _a[0], setTagElement = _a[1];
@@ -4389,7 +4443,9 @@ exports.VeltCommentDialogWireframe = VeltCommentDialogWireframe;
4389
4443
  exports.VeltCommentPin = VeltCommentPin;
4390
4444
  exports.VeltCommentPinWireframe = VeltCommentPinWireframe;
4391
4445
  exports.VeltCommentPlayerTimeline = VeltCommentPlayerTimeline;
4446
+ exports.VeltCommentText = VeltCommentText;
4392
4447
  exports.VeltCommentThread = VeltCommentThread;
4448
+ exports.VeltCommentThreadWireframe = VeltCommentThreadWireframe;
4393
4449
  exports.VeltCommentTool = SnippylyCommentTool;
4394
4450
  exports.VeltCommentToolWireframe = VeltCommentToolWireframe;
4395
4451
  exports.VeltComments = SnippylyComments;
@@ -4466,6 +4522,7 @@ exports.useEditorAccessRequestHandler = useEditorAccessRequestHandler;
4466
4522
  exports.useEditorAccessTimer = useEditorAccessTimer;
4467
4523
  exports.useHuddleUtils = useHuddleUtils;
4468
4524
  exports.useIdentify = useIdentify;
4525
+ exports.useLiveSelectionDataHandler = useLiveSelectionDataHandler;
4469
4526
  exports.useLiveSelectionUtils = useLiveSelectionUtils;
4470
4527
  exports.useLiveState = useLiveState;
4471
4528
  exports.useLiveStateData = useLiveStateData;