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