@veltdev/react 1.0.116 → 1.0.118

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
@@ -233,76 +233,126 @@ var SnippylyCommentBubble = function (props) {
233
233
  };
234
234
 
235
235
  var SnippylyComments = function (props) {
236
- var autoCategorize = props.autoCategorize, streamViewContainerId = props.streamViewContainerId, onSignIn = props.onSignIn, onUpgrade = props.onUpgrade, textMode = props.textMode, popoverMode = props.popoverMode, popoverTriangleComponent = props.popoverTriangleComponent, floatingCommentDialog = props.floatingCommentDialog, moderatorMode = props.moderatorMode, streamMode = props.streamMode, signInButton = props.signInButton, upgradeButton = props.upgradeButton, attachments = props.attachments, recordings = props.recordings, reactions = props.reactions, deviceInfo = props.deviceInfo, commentIndex = props.commentIndex, dialogOnHover = props.dialogOnHover, dialogOnTargetElementClick = props.dialogOnTargetElementClick, priority = props.priority, inboxMode = props.inboxMode, suggestionMode = props.suggestionMode, mobileMode = props.mobileMode, inlineCommentMode = props.inlineCommentMode, privateCommentMode = props.privateCommentMode, minimap = props.minimap, persistentCommentMode = props.persistentCommentMode, ghostComments = props.ghostComments, ghostCommentsIndicator = props.ghostCommentsIndicator, commentsOnDom = props.commentsOnDom, commentTool = props.commentTool, sidebarButtonOnCommentDialog = props.sidebarButtonOnCommentDialog, deviceIndicatorOnCommentPins = props.deviceIndicatorOnCommentPins, scrollToComment = props.scrollToComment, userMentions = props.userMentions, deleteOnBackspace = props.deleteOnBackspace, hotkey = props.hotkey, recordingSummary = props.recordingSummary, recordingCountdown = props.recordingCountdown, unreadIndicatorMode = props.unreadIndicatorMode, pinShadowDom = props.pinShadowDom, dialogShadowDom = props.dialogShadowDom, shadowDom = props.shadowDom, allowedElementIds = props.allowedElementIds, allowedElementClassNames = props.allowedElementClassNames, allowedElementQuerySelectors = props.allowedElementQuerySelectors, onCommentAdd = props.onCommentAdd, onCommentUpdate = props.onCommentUpdate, onCommentAccept = props.onCommentAccept, onCommentReject = props.onCommentReject, onSidebarButtonOnCommentDialogClick = props.onSidebarButtonOnCommentDialogClick, customStatus = props.customStatus, customPriority = props.customPriority, customCategory = props.customCategory, status = props.status, resolveButton = props.resolveButton, darkMode = props.darkMode, onCustomPinInject = props.onCustomPinInject, children = props.children;
236
+ var autoCategorize = props.autoCategorize, streamViewContainerId = props.streamViewContainerId, onSignIn = props.onSignIn, onUpgrade = props.onUpgrade, textMode = props.textMode, popoverMode = props.popoverMode, popoverTriangleComponent = props.popoverTriangleComponent, floatingCommentDialog = props.floatingCommentDialog, moderatorMode = props.moderatorMode, streamMode = props.streamMode, signInButton = props.signInButton, upgradeButton = props.upgradeButton, attachments = props.attachments, recordings = props.recordings, reactions = props.reactions, deviceInfo = props.deviceInfo, commentIndex = props.commentIndex, dialogOnHover = props.dialogOnHover, dialogOnTargetElementClick = props.dialogOnTargetElementClick, priority = props.priority, inboxMode = props.inboxMode, suggestionMode = props.suggestionMode, mobileMode = props.mobileMode, inlineCommentMode = props.inlineCommentMode, privateCommentMode = props.privateCommentMode, minimap = props.minimap, persistentCommentMode = props.persistentCommentMode, ghostComments = props.ghostComments, ghostCommentsIndicator = props.ghostCommentsIndicator, commentsOnDom = props.commentsOnDom, commentTool = props.commentTool, sidebarButtonOnCommentDialog = props.sidebarButtonOnCommentDialog, deviceIndicatorOnCommentPins = props.deviceIndicatorOnCommentPins, scrollToComment = props.scrollToComment, userMentions = props.userMentions, deleteOnBackspace = props.deleteOnBackspace, hotkey = props.hotkey, recordingSummary = props.recordingSummary, recordingCountdown = props.recordingCountdown, unreadIndicatorMode = props.unreadIndicatorMode, pinShadowDom = props.pinShadowDom, dialogShadowDom = props.dialogShadowDom, shadowDom = props.shadowDom, changeDetectionInCommentMode = props.changeDetectionInCommentMode, allowedElementIds = props.allowedElementIds, allowedElementClassNames = props.allowedElementClassNames, allowedElementQuerySelectors = props.allowedElementQuerySelectors, onCommentAdd = props.onCommentAdd, onCommentUpdate = props.onCommentUpdate, onCommentAccept = props.onCommentAccept, onCommentReject = props.onCommentReject, onSidebarButtonOnCommentDialogClick = props.onSidebarButtonOnCommentDialogClick, customStatus = props.customStatus, customPriority = props.customPriority, customCategory = props.customCategory, status = props.status, resolveButton = props.resolveButton, darkMode = props.darkMode, onCustomPinInject = props.onCustomPinInject, children = props.children;
237
237
  var ref = React.useRef();
238
+ var onSignInRef = React.useRef(onSignIn);
239
+ var onUpgradeRef = React.useRef(onUpgrade);
240
+ var onCommentAddRef = React.useRef(onCommentAdd);
241
+ var onCommentUpdateRef = React.useRef(onCommentUpdate);
242
+ var onCommentAcceptRef = React.useRef(onCommentAccept);
243
+ var onCommentRejectRef = React.useRef(onCommentReject);
244
+ var onSidebarButtonOnCommentDialogClickRef = React.useRef(onSidebarButtonOnCommentDialogClick);
245
+ var onCustomPinInjectRef = React.useRef(onCustomPinInject);
246
+ // Update the ref to always point to the latest callback function
247
+ React.useEffect(function () {
248
+ onSignInRef.current = onSignIn;
249
+ }, [onSignIn]);
250
+ React.useEffect(function () {
251
+ onUpgradeRef.current = onUpgrade;
252
+ }, [onUpgrade]);
253
+ React.useEffect(function () {
254
+ onCommentAddRef.current = onCommentAdd;
255
+ }, [onCommentAdd]);
256
+ React.useEffect(function () {
257
+ onCommentUpdateRef.current = onCommentUpdate;
258
+ }, [onCommentUpdate]);
259
+ React.useEffect(function () {
260
+ onCommentAcceptRef.current = onCommentAccept;
261
+ }, [onCommentAccept]);
262
+ React.useEffect(function () {
263
+ onCommentRejectRef.current = onCommentReject;
264
+ }, [onCommentReject]);
265
+ React.useEffect(function () {
266
+ onSidebarButtonOnCommentDialogClickRef.current = onSidebarButtonOnCommentDialogClick;
267
+ }, [onSidebarButtonOnCommentDialogClick]);
268
+ React.useEffect(function () {
269
+ onCustomPinInjectRef.current = onCustomPinInject;
270
+ }, [onCustomPinInject]);
238
271
  React.useEffect(function () {
239
272
  if (ref.current) {
240
273
  var element = ref.current;
241
274
  element.addEventListener('onSignIn', function (event) {
242
- if (onSignIn) {
243
- onSignIn(event === null || event === void 0 ? void 0 : event.detail);
275
+ if (onSignInRef.current) {
276
+ onSignInRef.current(event === null || event === void 0 ? void 0 : event.detail);
244
277
  }
245
278
  });
246
279
  element.addEventListener('onUpgrade', function (event) {
247
- if (onUpgrade) {
248
- onUpgrade(event === null || event === void 0 ? void 0 : event.detail);
280
+ if (onUpgradeRef.current) {
281
+ onUpgradeRef.current(event === null || event === void 0 ? void 0 : event.detail);
249
282
  }
250
283
  });
251
284
  element.addEventListener('onCommentAdd', function (event) {
252
- if (onCommentAdd) {
253
- onCommentAdd(event === null || event === void 0 ? void 0 : event.detail);
285
+ if (onCommentAddRef.current) {
286
+ onCommentAddRef.current(event === null || event === void 0 ? void 0 : event.detail);
254
287
  }
255
288
  });
256
289
  element.addEventListener('onCommentUpdate', function (event) {
257
- if (onCommentUpdate) {
258
- onCommentUpdate(event === null || event === void 0 ? void 0 : event.detail);
290
+ if (onCommentUpdateRef.current) {
291
+ onCommentUpdateRef.current(event === null || event === void 0 ? void 0 : event.detail);
259
292
  }
260
293
  });
261
294
  element.addEventListener('onCommentAccept', function (event) {
262
- if (onCommentAccept) {
263
- onCommentAccept(event === null || event === void 0 ? void 0 : event.detail);
295
+ if (onCommentAcceptRef.current) {
296
+ onCommentAcceptRef.current(event === null || event === void 0 ? void 0 : event.detail);
264
297
  }
265
298
  });
266
299
  element.addEventListener('onCommentReject', function (event) {
267
- if (onCommentReject) {
268
- onCommentReject(event === null || event === void 0 ? void 0 : event.detail);
300
+ if (onCommentRejectRef.current) {
301
+ onCommentRejectRef.current(event === null || event === void 0 ? void 0 : event.detail);
269
302
  }
270
303
  });
271
304
  element.addEventListener('onSidebarButtonOnCommentDialogClick', function (event) {
272
- if (onSidebarButtonOnCommentDialogClick) {
273
- onSidebarButtonOnCommentDialogClick(event === null || event === void 0 ? void 0 : event.detail);
305
+ if (onSidebarButtonOnCommentDialogClickRef.current) {
306
+ onSidebarButtonOnCommentDialogClickRef.current(event === null || event === void 0 ? void 0 : event.detail);
274
307
  }
275
308
  });
276
309
  element.addEventListener('onCustomPinInject', function (event) {
277
- if (onCustomPinInject) {
278
- onCustomPinInject(event === null || event === void 0 ? void 0 : event.detail);
310
+ if (onCustomPinInjectRef.current) {
311
+ onCustomPinInjectRef.current(event === null || event === void 0 ? void 0 : event.detail);
279
312
  }
280
313
  });
281
314
  }
282
315
  }, []);
283
- return (React__default["default"].createElement("velt-comments", { ref: ref, "auto-categorize": [true, false].includes(autoCategorize) ? (autoCategorize ? 'true' : 'false') : undefined, "data-stream-view-container-id": streamViewContainerId, "text-mode": [true, false].includes(textMode) ? (textMode ? 'true' : 'false') : undefined, "popover-mode": [true, false].includes(popoverMode) ? (popoverMode ? 'true' : 'false') : undefined, "popover-triangle-component": [true, false].includes(popoverTriangleComponent) ? (popoverTriangleComponent ? 'true' : 'false') : undefined, "floating-comment-dialog": [true, false].includes(floatingCommentDialog) ? (floatingCommentDialog ? 'true' : 'false') : undefined, "moderator-mode": [true, false].includes(moderatorMode) ? (moderatorMode ? 'true' : 'false') : undefined, "stream-mode": [true, false].includes(streamMode) ? (streamMode ? 'true' : 'false') : undefined, "sign-in-button": [true, false].includes(signInButton) ? (signInButton ? 'true' : 'false') : undefined, "upgrade-button": [true, false].includes(upgradeButton) ? (upgradeButton ? 'true' : 'false') : undefined, attachments: [true, false].includes(attachments) ? (attachments ? 'true' : 'false') : undefined, recordings: recordings, reactions: [true, false].includes(reactions) ? (reactions ? 'true' : 'false') : undefined, "device-info": [true, false].includes(deviceInfo) ? (deviceInfo ? 'true' : 'false') : undefined, "comment-index": [true, false].includes(commentIndex) ? (commentIndex ? 'true' : 'false') : undefined, "dialog-on-hover": [true, false].includes(dialogOnHover) ? (dialogOnHover ? 'true' : 'false') : undefined, "dialog-on-target-element-click": [true, false].includes(dialogOnTargetElementClick) ? (dialogOnTargetElementClick ? 'true' : 'false') : undefined, priority: [true, false].includes(priority) ? (priority ? 'true' : 'false') : undefined, status: [true, false].includes(status) ? (status ? 'true' : 'false') : undefined, "resolve-button": [true, false].includes(resolveButton) ? (resolveButton ? 'true' : 'false') : undefined, "inbox-mode": [true, false].includes(inboxMode) ? (inboxMode ? 'true' : 'false') : undefined, "suggestion-mode": [true, false].includes(suggestionMode) ? (suggestionMode ? 'true' : 'false') : undefined, "mobile-mode": [true, false].includes(mobileMode) ? (mobileMode ? 'true' : 'false') : undefined, "inline-comment-mode": [true, false].includes(inlineCommentMode) ? (inlineCommentMode ? 'true' : 'false') : undefined, "private-comment-mode": [true, false].includes(privateCommentMode) ? (privateCommentMode ? 'true' : 'false') : undefined, minimap: [true, false].includes(minimap) ? (minimap ? 'true' : 'false') : undefined, "persistent-comment-mode": [true, false].includes(persistentCommentMode) ? (persistentCommentMode ? 'true' : 'false') : undefined, "ghost-comments": [true, false].includes(ghostComments) ? (ghostComments ? 'true' : 'false') : undefined, "ghost-comments-indicator": [true, false].includes(ghostCommentsIndicator) ? (ghostCommentsIndicator ? 'true' : 'false') : undefined, "comments-on-dom": [true, false].includes(commentsOnDom) ? (commentsOnDom ? 'true' : 'false') : undefined, "comment-tool": [true, false].includes(commentTool) ? (commentTool ? 'true' : 'false') : undefined, "sidebar-button-on-comment-dialog": [true, false].includes(sidebarButtonOnCommentDialog) ? (sidebarButtonOnCommentDialog ? 'true' : 'false') : undefined, "device-indicator-on-comment-pins": [true, false].includes(deviceIndicatorOnCommentPins) ? (deviceIndicatorOnCommentPins ? 'true' : 'false') : undefined, "scroll-to-comment": [true, false].includes(scrollToComment) ? (scrollToComment ? 'true' : 'false') : undefined, "user-mentions": [true, false].includes(userMentions) ? (userMentions ? 'true' : 'false') : undefined, "delete-on-backspace": [true, false].includes(deleteOnBackspace) ? (deleteOnBackspace ? 'true' : 'false') : undefined, hotkey: [true, false].includes(hotkey) ? (hotkey ? 'true' : 'false') : undefined, "recording-summary": [true, false].includes(recordingSummary) ? (recordingSummary ? 'true' : 'false') : undefined, "recording-countdown": [true, false].includes(recordingCountdown) ? (recordingCountdown ? 'true' : 'false') : undefined, "unread-indicator-mode": unreadIndicatorMode, "pin-shadow-dom": [true, false].includes(pinShadowDom) ? (pinShadowDom ? 'true' : 'false') : undefined, "dialog-shadow-dom": [true, false].includes(dialogShadowDom) ? (dialogShadowDom ? 'true' : 'false') : undefined, "shadow-dom": [true, false].includes(shadowDom) ? (shadowDom ? 'true' : 'false') : undefined, "allowed-element-ids": JSON.stringify(allowedElementIds), "allowed-element-class-names": JSON.stringify(allowedElementClassNames), "allowed-element-query-selectors": JSON.stringify(allowedElementQuerySelectors), "custom-status": JSON.stringify(customStatus), "custom-priority": JSON.stringify(customPriority), "custom-category": JSON.stringify(customCategory), "dark-mode": [true, false].includes(darkMode) ? (darkMode ? 'true' : 'false') : undefined }, children));
316
+ return (React__default["default"].createElement("velt-comments", { ref: ref, "auto-categorize": [true, false].includes(autoCategorize) ? (autoCategorize ? 'true' : 'false') : undefined, "data-stream-view-container-id": streamViewContainerId, "text-mode": [true, false].includes(textMode) ? (textMode ? 'true' : 'false') : undefined, "popover-mode": [true, false].includes(popoverMode) ? (popoverMode ? 'true' : 'false') : undefined, "popover-triangle-component": [true, false].includes(popoverTriangleComponent) ? (popoverTriangleComponent ? 'true' : 'false') : undefined, "floating-comment-dialog": [true, false].includes(floatingCommentDialog) ? (floatingCommentDialog ? 'true' : 'false') : undefined, "moderator-mode": [true, false].includes(moderatorMode) ? (moderatorMode ? 'true' : 'false') : undefined, "stream-mode": [true, false].includes(streamMode) ? (streamMode ? 'true' : 'false') : undefined, "sign-in-button": [true, false].includes(signInButton) ? (signInButton ? 'true' : 'false') : undefined, "upgrade-button": [true, false].includes(upgradeButton) ? (upgradeButton ? 'true' : 'false') : undefined, attachments: [true, false].includes(attachments) ? (attachments ? 'true' : 'false') : undefined, recordings: recordings, reactions: [true, false].includes(reactions) ? (reactions ? 'true' : 'false') : undefined, "device-info": [true, false].includes(deviceInfo) ? (deviceInfo ? 'true' : 'false') : undefined, "comment-index": [true, false].includes(commentIndex) ? (commentIndex ? 'true' : 'false') : undefined, "dialog-on-hover": [true, false].includes(dialogOnHover) ? (dialogOnHover ? 'true' : 'false') : undefined, "dialog-on-target-element-click": [true, false].includes(dialogOnTargetElementClick) ? (dialogOnTargetElementClick ? 'true' : 'false') : undefined, priority: [true, false].includes(priority) ? (priority ? 'true' : 'false') : undefined, status: [true, false].includes(status) ? (status ? 'true' : 'false') : undefined, "resolve-button": [true, false].includes(resolveButton) ? (resolveButton ? 'true' : 'false') : undefined, "inbox-mode": [true, false].includes(inboxMode) ? (inboxMode ? 'true' : 'false') : undefined, "suggestion-mode": [true, false].includes(suggestionMode) ? (suggestionMode ? 'true' : 'false') : undefined, "mobile-mode": [true, false].includes(mobileMode) ? (mobileMode ? 'true' : 'false') : undefined, "inline-comment-mode": [true, false].includes(inlineCommentMode) ? (inlineCommentMode ? 'true' : 'false') : undefined, "private-comment-mode": [true, false].includes(privateCommentMode) ? (privateCommentMode ? 'true' : 'false') : undefined, minimap: [true, false].includes(minimap) ? (minimap ? 'true' : 'false') : undefined, "persistent-comment-mode": [true, false].includes(persistentCommentMode) ? (persistentCommentMode ? 'true' : 'false') : undefined, "ghost-comments": [true, false].includes(ghostComments) ? (ghostComments ? 'true' : 'false') : undefined, "ghost-comments-indicator": [true, false].includes(ghostCommentsIndicator) ? (ghostCommentsIndicator ? 'true' : 'false') : undefined, "comments-on-dom": [true, false].includes(commentsOnDom) ? (commentsOnDom ? 'true' : 'false') : undefined, "comment-tool": [true, false].includes(commentTool) ? (commentTool ? 'true' : 'false') : undefined, "sidebar-button-on-comment-dialog": [true, false].includes(sidebarButtonOnCommentDialog) ? (sidebarButtonOnCommentDialog ? 'true' : 'false') : undefined, "device-indicator-on-comment-pins": [true, false].includes(deviceIndicatorOnCommentPins) ? (deviceIndicatorOnCommentPins ? 'true' : 'false') : undefined, "scroll-to-comment": [true, false].includes(scrollToComment) ? (scrollToComment ? 'true' : 'false') : undefined, "user-mentions": [true, false].includes(userMentions) ? (userMentions ? 'true' : 'false') : undefined, "delete-on-backspace": [true, false].includes(deleteOnBackspace) ? (deleteOnBackspace ? 'true' : 'false') : undefined, hotkey: [true, false].includes(hotkey) ? (hotkey ? 'true' : 'false') : undefined, "recording-summary": [true, false].includes(recordingSummary) ? (recordingSummary ? 'true' : 'false') : undefined, "recording-countdown": [true, false].includes(recordingCountdown) ? (recordingCountdown ? 'true' : 'false') : undefined, "unread-indicator-mode": unreadIndicatorMode, "pin-shadow-dom": [true, false].includes(pinShadowDom) ? (pinShadowDom ? 'true' : 'false') : undefined, "dialog-shadow-dom": [true, false].includes(dialogShadowDom) ? (dialogShadowDom ? 'true' : 'false') : undefined, "shadow-dom": [true, false].includes(shadowDom) ? (shadowDom ? 'true' : 'false') : undefined, "change-detection-in-comment-mode": [true, false].includes(changeDetectionInCommentMode) ? (changeDetectionInCommentMode ? 'true' : 'false') : undefined, "allowed-element-ids": JSON.stringify(allowedElementIds), "allowed-element-class-names": JSON.stringify(allowedElementClassNames), "allowed-element-query-selectors": JSON.stringify(allowedElementQuerySelectors), "custom-status": JSON.stringify(customStatus), "custom-priority": JSON.stringify(customPriority), "custom-category": JSON.stringify(customCategory), "dark-mode": [true, false].includes(darkMode) ? (darkMode ? 'true' : 'false') : undefined }, children));
284
317
  };
285
318
 
286
319
  var SnippylyCommentsSidebar = function (props) {
287
320
  var embedMode = props.embedMode, enableUrlNavigation = props.enableUrlNavigation, urlNavigation = props.urlNavigation, pageMode = props.pageMode, currentLocationSuffix = props.currentLocationSuffix, sortData = props.sortData, filterConfig = props.filterConfig, groupConfig = props.groupConfig, filters = props.filters, variant = props.variant, pageModeComposerVariant = props.pageModeComposerVariant, dialogVariant = props.dialogVariant, shadowDom = props.shadowDom, openSidebar = props.openSidebar, onSidebarOpen = props.onSidebarOpen, onSidebarCommentClick = props.onSidebarCommentClick, onCommentClick = props.onCommentClick;
288
321
  var ref = React.useRef();
322
+ var openSidebarRef = React.useRef(openSidebar);
323
+ var onSidebarOpenRef = React.useRef(onSidebarOpen);
324
+ var onSidebarCommentClickRef = React.useRef(onSidebarCommentClick);
325
+ var onCommentClickRef = React.useRef(onCommentClick);
326
+ // Update the ref to always point to the latest callback function
327
+ React.useEffect(function () {
328
+ openSidebarRef.current = openSidebar;
329
+ }, [openSidebar]);
330
+ React.useEffect(function () {
331
+ onSidebarOpenRef.current = onSidebarOpen;
332
+ }, [onSidebarOpen]);
333
+ React.useEffect(function () {
334
+ onSidebarCommentClickRef.current = onSidebarCommentClick;
335
+ }, [onSidebarCommentClick]);
336
+ React.useEffect(function () {
337
+ onCommentClickRef.current = onCommentClick;
338
+ }, [onCommentClick]);
289
339
  React.useEffect(function () {
290
340
  if (ref.current) {
291
341
  var element = ref.current;
292
342
  element.addEventListener('onSidebarOpen', function (event) {
293
- if (openSidebar) {
294
- openSidebar(event === null || event === void 0 ? void 0 : event.detail);
343
+ if (openSidebarRef.current) {
344
+ openSidebarRef.current(event === null || event === void 0 ? void 0 : event.detail);
295
345
  }
296
- if (onSidebarOpen) {
297
- onSidebarOpen(event === null || event === void 0 ? void 0 : event.detail);
346
+ if (onSidebarOpenRef.current) {
347
+ onSidebarOpenRef.current(event === null || event === void 0 ? void 0 : event.detail);
298
348
  }
299
349
  });
300
350
  element.addEventListener('onSidebarCommentClick', function (event) {
301
- if (onSidebarCommentClick) {
302
- onSidebarCommentClick(event === null || event === void 0 ? void 0 : event.detail);
351
+ if (onSidebarCommentClickRef.current) {
352
+ onSidebarCommentClickRef.current(event === null || event === void 0 ? void 0 : event.detail);
303
353
  }
304
- if (onCommentClick) {
305
- onCommentClick(event === null || event === void 0 ? void 0 : event.detail);
354
+ if (onCommentClickRef.current) {
355
+ onCommentClickRef.current(event === null || event === void 0 ? void 0 : event.detail);
306
356
  }
307
357
  });
308
358
  }
@@ -313,12 +363,17 @@ var SnippylyCommentsSidebar = function (props) {
313
363
  var SnippylyCommentTool = function (props) {
314
364
  var targetCommentElementId = props.targetCommentElementId, onCommentModeChange = props.onCommentModeChange, children = props.children, darkMode = props.darkMode, variant = props.variant;
315
365
  var ref = React.useRef();
366
+ var onCommentModeChangeRef = React.useRef(onCommentModeChange);
367
+ // Update the ref to always point to the latest callback function
368
+ React.useEffect(function () {
369
+ onCommentModeChangeRef.current = onCommentModeChange;
370
+ }, [onCommentModeChange]);
316
371
  React.useEffect(function () {
317
372
  if (ref.current) {
318
373
  var element = ref.current;
319
374
  element.addEventListener('onCommentModeChange', function (event) {
320
- if (onCommentModeChange) {
321
- onCommentModeChange(event === null || event === void 0 ? void 0 : event.detail);
375
+ if (onCommentModeChangeRef.current) {
376
+ onCommentModeChangeRef.current(event === null || event === void 0 ? void 0 : event.detail);
322
377
  }
323
378
  });
324
379
  }
@@ -329,15 +384,24 @@ var SnippylyCommentTool = function (props) {
329
384
  var SnippylyCursor = function (props) {
330
385
  var allowedElementIds = props.allowedElementIds, avatarMode = props.avatarMode, inactivityTime = props.inactivityTime, onCursorUsersChanged = props.onCursorUsersChanged, onCursorUserChange = props.onCursorUserChange, children = props.children;
331
386
  var ref = React.useRef();
387
+ var onCursorUsersChangedRef = React.useRef(onCursorUsersChanged);
388
+ var onCursorUserChangeRef = React.useRef(onCursorUserChange);
389
+ // Update the ref to always point to the latest callback function
390
+ React.useEffect(function () {
391
+ onCursorUsersChangedRef.current = onCursorUsersChanged;
392
+ }, [onCursorUsersChanged]);
393
+ React.useEffect(function () {
394
+ onCursorUserChangeRef.current = onCursorUserChange;
395
+ }, [onCursorUserChange]);
332
396
  React.useEffect(function () {
333
397
  if (ref.current) {
334
398
  var element = ref.current;
335
399
  element.addEventListener('onCursorUserChange', function (event) {
336
- if (onCursorUsersChanged) {
337
- onCursorUsersChanged(event === null || event === void 0 ? void 0 : event.detail);
400
+ if (onCursorUsersChangedRef.current) {
401
+ onCursorUsersChangedRef.current(event === null || event === void 0 ? void 0 : event.detail);
338
402
  }
339
- if (onCursorUserChange) {
340
- onCursorUserChange(event === null || event === void 0 ? void 0 : event.detail);
403
+ if (onCursorUserChangeRef.current) {
404
+ onCursorUserChangeRef.current(event === null || event === void 0 ? void 0 : event.detail);
341
405
  }
342
406
  });
343
407
  }
@@ -358,25 +422,42 @@ var SnippylyHuddleTool = function (props) {
358
422
  var SnippylyPresence = function (props) {
359
423
  var maxUsers = props.maxUsers, inactivityTime = props.inactivityTime, documentParams = props.documentParams, location = props.location, self = props.self, onPresenceUserClick = props.onPresenceUserClick, onUsersChanged = props.onUsersChanged, onPresenceUserChange = props.onPresenceUserChange, disableFlockNavigation = props.disableFlockNavigation, defaultFlockNavigation = props.defaultFlockNavigation, onNavigate = props.onNavigate, flockMode = props.flockMode;
360
424
  var ref = React.useRef();
425
+ var onUsersChangedRef = React.useRef(onUsersChanged);
426
+ var onPresenceUserChangeRef = React.useRef(onPresenceUserChange);
427
+ var onNavigateRef = React.useRef(onNavigate);
428
+ var onPresenceUserClickRef = React.useRef(onPresenceUserClick);
429
+ // Update the ref to always point to the latest callback function
430
+ React.useEffect(function () {
431
+ onUsersChangedRef.current = onUsersChanged;
432
+ }, [onUsersChanged]);
433
+ React.useEffect(function () {
434
+ onPresenceUserChangeRef.current = onPresenceUserChange;
435
+ }, [onPresenceUserChange]);
436
+ React.useEffect(function () {
437
+ onNavigateRef.current = onNavigate;
438
+ }, [onNavigate]);
439
+ React.useEffect(function () {
440
+ onPresenceUserClickRef.current = onPresenceUserClick;
441
+ }, [onPresenceUserClick]);
361
442
  React.useEffect(function () {
362
443
  if (ref.current) {
363
444
  var element = ref.current;
364
445
  element.addEventListener('onPresenceUserChange', function (event) {
365
- if (onUsersChanged) {
366
- onUsersChanged(event === null || event === void 0 ? void 0 : event.detail);
446
+ if (onUsersChangedRef.current) {
447
+ onUsersChangedRef.current(event === null || event === void 0 ? void 0 : event.detail);
367
448
  }
368
- if (onPresenceUserChange) {
369
- onPresenceUserChange(event === null || event === void 0 ? void 0 : event.detail);
449
+ if (onPresenceUserChangeRef.current) {
450
+ onPresenceUserChangeRef.current(event === null || event === void 0 ? void 0 : event.detail);
370
451
  }
371
452
  });
372
453
  element.addEventListener('onNavigate', function (event) {
373
- if (onNavigate) {
374
- onNavigate(event === null || event === void 0 ? void 0 : event.detail);
454
+ if (onNavigateRef.current) {
455
+ onNavigateRef.current(event === null || event === void 0 ? void 0 : event.detail);
375
456
  }
376
457
  });
377
458
  element.addEventListener('onPresenceUserClick', function (event) {
378
- if (onPresenceUserClick) {
379
- onPresenceUserClick(event === null || event === void 0 ? void 0 : event.detail);
459
+ if (onPresenceUserClickRef.current) {
460
+ onPresenceUserClickRef.current(event === null || event === void 0 ? void 0 : event.detail);
380
461
  }
381
462
  });
382
463
  }
@@ -387,12 +468,17 @@ var SnippylyPresence = function (props) {
387
468
  var SnippylyRecorderControlPanel = function (props) {
388
469
  var mode = props.mode, panelId = props.panelId, onRecordedData = props.onRecordedData;
389
470
  var ref = React.useRef();
471
+ var onRecordedDataRef = React.useRef(onRecordedData);
472
+ // Update the ref to always point to the latest callback function
473
+ React.useEffect(function () {
474
+ onRecordedDataRef.current = onRecordedData;
475
+ }, [onRecordedData]);
390
476
  React.useEffect(function () {
391
477
  if (ref.current) {
392
478
  var element = ref.current;
393
479
  element.addEventListener('onRecordedData', function (event) {
394
- if (onRecordedData) {
395
- onRecordedData(event === null || event === void 0 ? void 0 : event.detail);
480
+ if (onRecordedDataRef.current) {
481
+ onRecordedDataRef.current(event === null || event === void 0 ? void 0 : event.detail);
396
482
  }
397
483
  });
398
484
  }
@@ -407,12 +493,17 @@ var SnippylyRecorderNotes = function (props) {
407
493
  var SnippylyRecorderPlayer = function (props) {
408
494
  var recorderId = props.recorderId, onDelete = props.onDelete, showSummary = props.showSummary, summary = props.summary;
409
495
  var ref = React.useRef();
496
+ var onDeleteRef = React.useRef(onDelete);
497
+ // Update the ref to always point to the latest callback function
498
+ React.useEffect(function () {
499
+ onDeleteRef.current = onDelete;
500
+ }, [onDelete]);
410
501
  React.useEffect(function () {
411
502
  if (ref.current) {
412
503
  var element = ref.current;
413
504
  element === null || element === void 0 ? void 0 : element.addEventListener('onDelete', function (event) {
414
- if (onDelete) {
415
- onDelete(event === null || event === void 0 ? void 0 : event.detail);
505
+ if (onDeleteRef.current) {
506
+ onDeleteRef.current(event === null || event === void 0 ? void 0 : event.detail);
416
507
  }
417
508
  });
418
509
  }
@@ -462,12 +553,17 @@ var SnippylyUserRequestTool = function (props) {
462
553
  var VeltCommentPlayerTimeline = function (props) {
463
554
  var totalMediaLength = props.totalMediaLength, onCommentClick = props.onCommentClick;
464
555
  var ref = React.useRef();
556
+ var onCommentClickRef = React.useRef(onCommentClick);
557
+ // Update the ref to always point to the latest callback function
558
+ React.useEffect(function () {
559
+ onCommentClickRef.current = onCommentClick;
560
+ }, [onCommentClick]);
465
561
  React.useEffect(function () {
466
562
  if (ref.current) {
467
563
  var element = ref.current;
468
564
  element.addEventListener('onCommentClick', function (event) {
469
- if (onCommentClick) {
470
- onCommentClick(event === null || event === void 0 ? void 0 : event.detail);
565
+ if (onCommentClickRef.current) {
566
+ onCommentClickRef.current(event === null || event === void 0 ? void 0 : event.detail);
471
567
  }
472
568
  });
473
569
  }
@@ -493,12 +589,17 @@ var VeltCommentThread = function (props) {
493
589
  var VeltNotificationsTool = function (props) {
494
590
  var children = props.children, darkMode = props.darkMode, onNotificationClick = props.onNotificationClick;
495
591
  var ref = React.useRef();
592
+ var onNotificationClickRef = React.useRef(onNotificationClick);
593
+ // Update the ref to always point to the latest callback function
594
+ React.useEffect(function () {
595
+ onNotificationClickRef.current = onNotificationClick;
596
+ }, [onNotificationClick]);
496
597
  React.useEffect(function () {
497
598
  if (ref.current) {
498
599
  var element = ref.current;
499
600
  element.addEventListener('onNotificationClick', function (event) {
500
- if (onNotificationClick) {
501
- onNotificationClick(event === null || event === void 0 ? void 0 : event.detail);
601
+ if (onNotificationClickRef.current) {
602
+ onNotificationClickRef.current(event === null || event === void 0 ? void 0 : event.detail);
502
603
  }
503
604
  });
504
605
  }
@@ -509,12 +610,17 @@ var VeltNotificationsTool = function (props) {
509
610
  var VeltNotificationsPanel = function (props) {
510
611
  var darkMode = props.darkMode, onNotificationClick = props.onNotificationClick;
511
612
  var ref = React.useRef();
613
+ var onNotificationClickRef = React.useRef(onNotificationClick);
614
+ // Update the ref to always point to the latest callback function
615
+ React.useEffect(function () {
616
+ onNotificationClickRef.current = onNotificationClick;
617
+ }, [onNotificationClick]);
512
618
  React.useEffect(function () {
513
619
  if (ref.current) {
514
620
  var element = ref.current;
515
621
  element.addEventListener('onNotificationClick', function (event) {
516
- if (onNotificationClick) {
517
- onNotificationClick(event === null || event === void 0 ? void 0 : event.detail);
622
+ if (onNotificationClickRef.current) {
623
+ onNotificationClickRef.current(event === null || event === void 0 ? void 0 : event.detail);
518
624
  }
519
625
  });
520
626
  }
@@ -525,12 +631,17 @@ var VeltNotificationsPanel = function (props) {
525
631
  var VeltNotificationsHistoryPanel = function (props) {
526
632
  var embedMode = props.embedMode, darkMode = props.darkMode, onNotificationClick = props.onNotificationClick;
527
633
  var ref = React.useRef();
634
+ var onNotificationClickRef = React.useRef(onNotificationClick);
635
+ // Update the ref to always point to the latest callback function
636
+ React.useEffect(function () {
637
+ onNotificationClickRef.current = onNotificationClick;
638
+ }, [onNotificationClick]);
528
639
  React.useEffect(function () {
529
640
  if (ref.current) {
530
641
  var element = ref.current;
531
642
  element.addEventListener('onNotificationClick', function (event) {
532
- if (onNotificationClick) {
533
- onNotificationClick(event === null || event === void 0 ? void 0 : event.detail);
643
+ if (onNotificationClickRef.current) {
644
+ onNotificationClickRef.current(event === null || event === void 0 ? void 0 : event.detail);
534
645
  }
535
646
  });
536
647
  }
@@ -1249,6 +1360,11 @@ var VeltCommentDialogSuggestionAction = function (props) {
1249
1360
  VeltCommentDialogSuggestionAction.Accept = VeltCommentDialogSuggestionActionAccept;
1250
1361
  VeltCommentDialogSuggestionAction.Reject = VeltCommentDialogSuggestionActionReject;
1251
1362
 
1363
+ var VeltCommentDialogPrivateBadge = function (props) {
1364
+ var children = props.children;
1365
+ return (React__default["default"].createElement("velt-comment-dialog-private-badge-wireframe", null, children));
1366
+ };
1367
+
1252
1368
  var VeltCommentDialogWireframe = function (props) {
1253
1369
  var children = props.children, remainingProp = __rest(props, ["children"]);
1254
1370
  return (React__default["default"].createElement("velt-comment-dialog-wireframe", __assign({}, remainingProp), children));
@@ -1277,6 +1393,7 @@ VeltCommentDialogWireframe.ThreadCard = VeltCommentDialogThreadCard;
1277
1393
  VeltCommentDialogWireframe.Threads = VeltCommentDialogThreads;
1278
1394
  VeltCommentDialogWireframe.ToggleReply = VeltCommentDialogToggleReply;
1279
1395
  VeltCommentDialogWireframe.Upgrade = VeltCommentDialogUpgrade;
1396
+ VeltCommentDialogWireframe.PrivateBadge = VeltCommentDialogPrivateBadge;
1280
1397
 
1281
1398
  var VeltCommentsSidebarCloseButton = function (props) {
1282
1399
  var children = props.children;