@veltdev/react 3.0.51 → 3.0.53

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.
@@ -6,6 +6,7 @@ export interface IVeltCommentToolProps extends React.DetailedHTMLProps<React.HTM
6
6
  targetCommentElementId?: string;
7
7
  targetElementId?: string;
8
8
  onCommentModeChange?: Function;
9
+ sourceId?: string;
9
10
  darkMode?: boolean;
10
11
  variant?: string;
11
12
  shadowDom?: boolean;
@@ -1,3 +1,3 @@
1
- export declare const VELT_SDK_VERSION = "3.0.51";
1
+ export declare const VELT_SDK_VERSION = "3.0.53";
2
2
  export declare const VELT_SDK_INIT_EVENT = "onVeltInit";
3
3
  export declare const VELT_TAB_ID = "veltTabId";
@@ -1,8 +1,8 @@
1
1
  /// <reference types="react" />
2
2
  import { Velt } from '@veltdev/types';
3
3
  export declare const VeltContext: import("react").Context<{
4
- client: Velt;
4
+ client: Velt | null;
5
5
  }>;
6
6
  export declare function useVeltClient(): {
7
- client: Velt;
7
+ client: Velt | null;
8
8
  };
@@ -1,4 +1,4 @@
1
- import { CommentAnnotation, CommentElement, Location, CommentSelectionChangeData, CommentSidebarCustomActionEventData } from "@veltdev/types";
1
+ import { CommentAnnotation, CommentElement, Location, CommentSelectionChangeData, CommentSidebarCustomActionEventData, CommentAddEventData, CommentUpdateEventData } from "@veltdev/types";
2
2
  export declare function useCommentUtils(): CommentElement | undefined;
3
3
  export declare function useCommentAnnotations(documentId?: string, location?: Location): CommentAnnotation[] | null | undefined;
4
4
  export declare function useUnreadCommentCountByAnnotationId(annotationId: string): {
@@ -17,8 +17,8 @@ export declare function useUnreadCommentAnnotationCountByLocationId(locationId:
17
17
  count: number;
18
18
  } | null;
19
19
  export declare function useCommentModeState(): boolean | undefined;
20
- export declare function useCommentAddHandler(): any;
21
- export declare function useCommentUpdateHandler(): any;
20
+ export declare function useCommentAddHandler(): CommentAddEventData | undefined;
21
+ export declare function useCommentUpdateHandler(): CommentUpdateEventData | undefined;
22
22
  export declare function useCommentDialogSidebarClickHandler(): any;
23
23
  export declare function useCommentSelectionChangeHandler(): CommentSelectionChangeData | undefined;
24
24
  export declare function useCommentCopyLinkHandler(): {
package/esm/index.js CHANGED
@@ -132,7 +132,7 @@ var loadVelt = function (callback, version, staging, develop, proxyDomain) {
132
132
  }
133
133
  };
134
134
 
135
- var VELT_SDK_VERSION = '3.0.51';
135
+ var VELT_SDK_VERSION = '3.0.53';
136
136
  var VELT_SDK_INIT_EVENT = 'onVeltInit';
137
137
  var VELT_TAB_ID = 'veltTabId';
138
138
 
@@ -432,7 +432,7 @@ var SnippylyCommentsSidebar = function (props) {
432
432
  };
433
433
 
434
434
  var SnippylyCommentTool = function (props) {
435
- var targetCommentElementId = props.targetCommentElementId, targetElementId = props.targetElementId, onCommentModeChange = props.onCommentModeChange, children = props.children, darkMode = props.darkMode, variant = props.variant, shadowDom = props.shadowDom;
435
+ var targetCommentElementId = props.targetCommentElementId, targetElementId = props.targetElementId, onCommentModeChange = props.onCommentModeChange, sourceId = props.sourceId, children = props.children, darkMode = props.darkMode, variant = props.variant, shadowDom = props.shadowDom;
436
436
  var ref = useRef();
437
437
  var onCommentModeChangeRef = useRef(onCommentModeChange);
438
438
  // Update the ref to always point to the latest callback function
@@ -458,7 +458,7 @@ var SnippylyCommentTool = function (props) {
458
458
  }
459
459
  };
460
460
  }, []);
461
- return (React.createElement("velt-comment-tool", { ref: ref, "target-comment-element-id": targetCommentElementId, "target-element-id": targetElementId, variant: variant, "shadow-dom": [true, false].includes(shadowDom) ? (shadowDom ? 'true' : 'false') : undefined, "dark-mode": [true, false].includes(darkMode) ? (darkMode ? 'true' : 'false') : undefined }, children));
461
+ return (React.createElement("velt-comment-tool", { ref: ref, "target-comment-element-id": targetCommentElementId, "target-element-id": targetElementId, "source-id": sourceId, variant: variant, "shadow-dom": [true, false].includes(shadowDom) ? (shadowDom ? 'true' : 'false') : undefined, "dark-mode": [true, false].includes(darkMode) ? (darkMode ? 'true' : 'false') : undefined }, children));
462
462
  };
463
463
 
464
464
  var SnippylyCursor = function (props) {
@@ -4558,7 +4558,7 @@ function useCommentModeState() {
4558
4558
  }
4559
4559
  function useCommentAddHandler() {
4560
4560
  var commentElement = useCommentUtils();
4561
- var _a = React.useState(), data = _a[0], setData = _a[1];
4561
+ var _a = React.useState(undefined), data = _a[0], setData = _a[1];
4562
4562
  useEffect(function () {
4563
4563
  if (!(commentElement === null || commentElement === void 0 ? void 0 : commentElement.onCommentAdd))
4564
4564
  return;
@@ -4573,7 +4573,7 @@ function useCommentAddHandler() {
4573
4573
  }
4574
4574
  function useCommentUpdateHandler() {
4575
4575
  var commentElement = useCommentUtils();
4576
- var _a = React.useState(), data = _a[0], setData = _a[1];
4576
+ var _a = React.useState(undefined), data = _a[0], setData = _a[1];
4577
4577
  useEffect(function () {
4578
4578
  if (!(commentElement === null || commentElement === void 0 ? void 0 : commentElement.onCommentUpdate))
4579
4579
  return;