@dtducas/wh-forge-viewer 3.0.0-beta.3 → 3.0.0-beta.4

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/dist/index.esm.js CHANGED
@@ -94818,7 +94818,9 @@ function MinimapPanel(_ref) {
94818
94818
  totalPages = _ref$totalPages === void 0 ? 1 : _ref$totalPages,
94819
94819
  viewableGuid = _ref.viewableGuid,
94820
94820
  filePath = _ref.filePath,
94821
- onClose = _ref.onClose;
94821
+ onClose = _ref.onClose,
94822
+ _ref$sidebarOffset = _ref.sidebarOffset,
94823
+ sidebarOffset = _ref$sidebarOffset === void 0 ? 56 : _ref$sidebarOffset;
94822
94824
  var _useMinimapThumbnail = useMinimapThumbnail({
94823
94825
  filePath: filePath,
94824
94826
  viewableGuid: viewableGuid,
@@ -95039,7 +95041,9 @@ function MinimapPanel(_ref) {
95039
95041
  var panelStyle = position ? {
95040
95042
  left: position.x,
95041
95043
  top: position.y
95042
- } : {};
95044
+ } : {
95045
+ left: sidebarOffset
95046
+ };
95043
95047
  return jsxs("div", {
95044
95048
  ref: panelRef,
95045
95049
  className: "wh-minimap-panel".concat(shouldShow ? ' wh-minimap-panel--visible' : ''),
@@ -95696,7 +95700,9 @@ function ViewerSidebar(_ref3) {
95696
95700
  _ref3$hidePanels = _ref3.hidePanels,
95697
95701
  hidePanels = _ref3$hidePanels === void 0 ? [] : _ref3$hidePanels,
95698
95702
  _ref3$className = _ref3.className,
95699
- className = _ref3$className === void 0 ? '' : _ref3$className;
95703
+ className = _ref3$className === void 0 ? '' : _ref3$className,
95704
+ isDraftShared = _ref3.isDraftShared,
95705
+ onToggleDraftShared = _ref3.onToggleDraftShared;
95700
95706
  var handleClick = function handleClick(panel) {
95701
95707
  // Toggle off if already active
95702
95708
  onPanelChange === null || onPanelChange === void 0 || onPanelChange(activePanel === panel ? null : panel);
@@ -95741,6 +95747,62 @@ function ViewerSidebar(_ref3) {
95741
95747
  children: jsx(IconSubmit, {})
95742
95748
  }), jsx("div", {
95743
95749
  className: 'wh-sidebar-spacer'
95750
+ }), onToggleDraftShared !== undefined && jsxs(Fragment, {
95751
+ children: [jsx("hr", {
95752
+ className: 'wh-sidebar-divider'
95753
+ }), jsx("button", {
95754
+ type: 'button',
95755
+ className: 'wh-sidebar-btn',
95756
+ "data-tooltip": isDraftShared ? 'Stop sharing draft' : 'Share draft',
95757
+ "aria-pressed": isDraftShared,
95758
+ onClick: function onClick() {
95759
+ return onToggleDraftShared(!isDraftShared);
95760
+ },
95761
+ style: {
95762
+ width: 36,
95763
+ height: 36,
95764
+ borderRadius: 6,
95765
+ border: isDraftShared ? '1.5px solid #6366f1' : '1.5px solid transparent',
95766
+ background: isDraftShared ? '#ede9fe' : undefined,
95767
+ color: isDraftShared ? '#6366f1' : '#6b7280',
95768
+ flexShrink: 0,
95769
+ transition: 'border-color 0.15s, background 0.15s, color 0.15s'
95770
+ },
95771
+ children: jsxs("svg", {
95772
+ width: '18',
95773
+ height: '18',
95774
+ viewBox: '0 0 24 24',
95775
+ fill: 'none',
95776
+ stroke: 'currentColor',
95777
+ strokeWidth: '2',
95778
+ strokeLinecap: 'round',
95779
+ strokeLinejoin: 'round',
95780
+ "aria-hidden": 'true',
95781
+ children: [jsx("circle", {
95782
+ cx: '18',
95783
+ cy: '5',
95784
+ r: '3'
95785
+ }), jsx("circle", {
95786
+ cx: '6',
95787
+ cy: '12',
95788
+ r: '3'
95789
+ }), jsx("circle", {
95790
+ cx: '18',
95791
+ cy: '19',
95792
+ r: '3'
95793
+ }), jsx("line", {
95794
+ x1: '8.59',
95795
+ y1: '13.51',
95796
+ x2: '15.42',
95797
+ y2: '17.49'
95798
+ }), jsx("line", {
95799
+ x1: '15.41',
95800
+ y1: '6.51',
95801
+ x2: '8.59',
95802
+ y2: '10.49'
95803
+ })]
95804
+ })
95805
+ })]
95744
95806
  }), jsx("hr", {
95745
95807
  className: 'wh-sidebar-divider'
95746
95808
  }), jsx(PresenceIndicator, {
@@ -95813,6 +95875,9 @@ var ViewerForgePDF = function ViewerForgePDF(_ref) {
95813
95875
  checkSubmitHasMarkup = _ref.checkSubmitHasMarkup,
95814
95876
  _ref$defaultActiveSid = _ref.defaultActiveSidebarPanel,
95815
95877
  defaultActiveSidebarPanel = _ref$defaultActiveSid === void 0 ? null : _ref$defaultActiveSid,
95878
+ onSidebarWidthChange = _ref.onSidebarWidthChange,
95879
+ isDraftShared = _ref.isDraftShared,
95880
+ onToggleDraftShared = _ref.onToggleDraftShared,
95816
95881
  collabAdapter = _ref.collabAdapter,
95817
95882
  collabActorId = _ref.collabActorId,
95818
95883
  collabDrawingId = _ref.collabDrawingId,
@@ -96615,6 +96680,11 @@ var ViewerForgePDF = function ViewerForgePDF(_ref) {
96615
96680
  viewerInstance === null || viewerInstance === void 0 || (_viewerInstance$resiz = viewerInstance.resize) === null || _viewerInstance$resiz === void 0 || _viewerInstance$resiz.call(viewerInstance);
96616
96681
  }, [viewerInstance, activeSidebarPanel, panelWidth, showDrawer, drawerWidth]);
96617
96682
 
96683
+ // Notify host app of total sidebar width so it can adjust external layout.
96684
+ useEffect(function () {
96685
+ onSidebarWidthChange === null || onSidebarWidthChange === void 0 || onSidebarWidthChange(activeSidebarPanel ? 44 + panelWidth : 0);
96686
+ }, [activeSidebarPanel, panelWidth, onSidebarWidthChange]);
96687
+
96618
96688
  // ─── Callbacks ────────────────────────────────────────────────────────────
96619
96689
  var handleDrawerPropertyChange = useCallback(function (key, value) {
96620
96690
  var _markupMgrRef$current4;
@@ -96716,7 +96786,9 @@ var ViewerForgePDF = function ViewerForgePDF(_ref) {
96716
96786
  onPanelChange: setActiveSidebarPanel,
96717
96787
  onlineUsers: onlineUsers,
96718
96788
  showSubmitPanel: !!submitConfig,
96719
- hidePanels: hidePanels
96789
+ hidePanels: hidePanels,
96790
+ isDraftShared: onToggleDraftShared !== undefined ? isDraftShared !== null && isDraftShared !== void 0 ? isDraftShared : false : undefined,
96791
+ onToggleDraftShared: onToggleDraftShared
96720
96792
  }), activeSidebarPanel === 'sheets' && /*#__PURE__*/jsx(SheetsPanel, {
96721
96793
  viewables: viewables,
96722
96794
  currentIndex: currentPageIndex,
@@ -96783,7 +96855,8 @@ var ViewerForgePDF = function ViewerForgePDF(_ref) {
96783
96855
  filePath: filePath,
96784
96856
  onClose: function onClose() {
96785
96857
  return setShowMinimap(false);
96786
- }
96858
+ },
96859
+ sidebarOffset: activeSidebarPanel ? 44 + panelWidth + 8 : 52
96787
96860
  }), showMarkupToolbar && markupEngineInstance && /*#__PURE__*/jsx(SelectionActionToolbar, {
96788
96861
  engine: markupEngineInstance,
96789
96862
  viewerContainer: viewerContainerRef.current,