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

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
@@ -92836,7 +92836,7 @@ styleInject(css_248z$4);
92836
92836
  var css_248z$3 = "#navTools,\n#modelTools,\n#settingsTools,\n#measureTools {\n display: none !important;\n visibility: hidden !important;\n}\n#guiviewer3d-toolbar {\n display: flex !important;\n align-items: center !important;\n justify-content: center !important;\n gap: 20px;\n position: fixed !important;\n bottom: 10px !important;\n left: 50% !important;\n transform: translateX(-50%) !important;\n width: auto !important;\n border-radius: 4px !important;\n padding: 8px 12px !important;\n}\n#custom-tool-group {\n display: flex !important;\n margin: 0 !important;\n padding: 0 !important;\n}\n#custom-pagination-group {\n display: flex;\n position: relative !important;\n margin: 0 !important;\n padding: 0 !important;\n transform: none !important;\n left: auto !important;\n}\n\n/* Export Combo Dropdown Styles */\n.export-combo-dropdown {\n position: absolute;\n bottom: 100%;\n left: 50%;\n transform: translateX(-50%);\n background: #2d2d2d;\n border-radius: 4px;\n box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);\n min-width: 180px;\n padding: 4px 0;\n margin-bottom: 8px;\n z-index: 1000;\n}\n\n.export-combo-dropdown::after {\n content: '';\n position: absolute;\n bottom: -6px;\n left: 50%;\n transform: translateX(-50%);\n border-left: 6px solid transparent;\n border-right: 6px solid transparent;\n border-top: 6px solid #2d2d2d;\n}\n\n.export-combo-option {\n display: flex;\n align-items: center;\n padding: 8px 12px;\n cursor: pointer;\n transition: background-color 0.15s ease;\n color: #fff;\n font-size: 13px;\n white-space: nowrap;\n}\n\n.export-combo-option:hover {\n background-color: #3d3d3d;\n}\n\n.export-combo-option:active {\n background-color: #4d4d4d;\n}\n\n.export-combo-icon {\n margin-right: 8px;\n font-size: 16px;\n opacity: 0.8;\n}\n\n.export-combo-label {\n flex: 1;\n}\n\n/* Active state for combo button */\n.custom-export-combo-btn.active {\n background-color: #3d3d3d !important;\n}\n";
92837
92837
  styleInject(css_248z$3);
92838
92838
 
92839
- var css_248z$2 = "/* Custom icon styles for toolbar using SVG */\n/* Download icon - custom SVG (white, thicker stroke) */\n.adsk-icon-custom-download::before {\n content: '';\n display: inline-block;\n width: 24px;\n height: 24px;\n background-image: url('data:image/svg+xml;utf8,\\\n<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"%23ffffff\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\">\\\n <path d=\"M4.75 17.25a.75.75 0 0 1 .75.75v2.25c0 .138.112.25.25.25h12.5a.25.25 0 0 0 .25-.25V18a.75.75 0 0 1 1.5 0v2.25A1.75 1.75 0 0 1 18.25 22H5.75A1.75 1.75 0 0 1 4 20.25V18a.75.75 0 0 1 .75-.75Z\"/>\\\n <path d=\"M5.22 9.97a.749.749 0 0 1 1.06 0l4.97 4.969V2.75a.75.75 0 0 1 1.5 0v12.189l4.97-4.969a.749.749 0 1 1 1.06 1.06l-6.25 6.25a.749.749 0 0 1-1.06 0l-6.25-6.25a.749.749 0 0 1 0-1.06Z\"/>\\\n</svg>');\n background-repeat: no-repeat;\n background-position: center;\n background-size: 16px 16px;\n}\n/* Previous page icon - custom SVG (white, filled) */\n.adsk-icon-custom-prev::before {\n content: '';\n display: inline-block;\n width: 24px;\n height: 24px;\n background-image: url('data:image/svg+xml;utf8,\\\n<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 1024 1024\">\\\n<g transform=\"translate(512 512) scale(1.2) translate(-512 -512)\">\\\n<path fill=\"%23FFFFFF\" d=\"M685.248 104.704a64 64 0 010 90.496L368.448 512l316.8 316.8a64 64 0 01-90.496 90.496L232.704 557.248a64 64 0 010-90.496l362.048-362.048a64 64 0 0190.496 0z\"/>\\\n</g>\\\n</svg>');\n background-repeat: no-repeat;\n background-position: center;\n background-size: 16px 16px;\n}\n/* Next page icon - custom SVG (white, filled) */\n.adsk-icon-custom-next::before {\n content: '';\n display: inline-block;\n width: 24px;\n height: 24px;\n background-image: url('data:image/svg+xml;utf8,\\\n<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 1024 1024\">\\\n<g transform=\"translate(512 512) scale(1.2) translate(-512 -512)\">\\\n<path fill=\"%23FFFFFF\" d=\"M338.752 104.704a64 64 0 000 90.496l316.8 316.8-316.8 316.8a64 64 0 0090.496 90.496l362.048-362.048a64 64 0 000-90.496L429.248 104.704a64 64 0 00-90.496 0z\"/>\\\n</g>\\\n</svg>');\n background-repeat: no-repeat;\n background-position: center;\n background-size: 16px 16px;\n}\n/* Fallback for adsk-icon-caret-left and adsk-icon-caret-right if not defined */\n.adsk-icon-caret-left::before {\n content: '[';\n font-family: 'adsk-viewing';\n}\n.adsk-icon-caret-right::before {\n content: ']';\n font-family: 'adsk-viewing';\n}\n/* Comment icon - custom SVG (Smiley) */\n.adsk-icon-custom-comment::before {\n content: '';\n display: inline-block;\n width: 24px;\n height: 24px;\n background-image: url('data:image/svg+xml;utf8,<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"%23FFFFFF\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><circle cx=\"12\" cy=\"12\" r=\"10\"></circle><path d=\"M8 14s1.5 2 4 2 4-2 4-2\"></path><line x1=\"9\" y1=\"9\" x2=\"9.01\" y2=\"9\"></line><line x1=\"15\" y1=\"9\" x2=\"15.01\" y2=\"9\"></line></svg>');\n background-repeat: no-repeat;\n background-position: center;\n background-size: contain;\n}\n/* Save icon - custom SVG */\n.adsk-icon-custom-save::before {\n content: '';\n display: inline-block;\n width: 24px;\n height: 24px;\n background-image: url('data:image/svg+xml;utf8,<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"%23FFFFFF\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><path d=\"M19 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h11l5 5v11a2 2 0 0 1-2 2z\"></path><polyline points=\"17 21 17 13 7 13 7 21\"></polyline><polyline points=\"7 3 7 8 15 8\"></polyline></svg>');\n background-repeat: no-repeat;\n background-position: center;\n background-size: contain;\n}\n";
92839
+ var css_248z$2 = "/* Custom icon styles for toolbar using SVG */\n/* Download icon - custom SVG (white, thicker stroke) */\n.adsk-icon-custom-download::before {\n content: '';\n display: inline-block;\n width: 24px;\n height: 24px;\n background-image: url('data:image/svg+xml;utf8,\\\n<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"%23ffffff\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\">\\\n <path d=\"M4.75 17.25a.75.75 0 0 1 .75.75v2.25c0 .138.112.25.25.25h12.5a.25.25 0 0 0 .25-.25V18a.75.75 0 0 1 1.5 0v2.25A1.75 1.75 0 0 1 18.25 22H5.75A1.75 1.75 0 0 1 4 20.25V18a.75.75 0 0 1 .75-.75Z\"/>\\\n <path d=\"M5.22 9.97a.749.749 0 0 1 1.06 0l4.97 4.969V2.75a.75.75 0 0 1 1.5 0v12.189l4.97-4.969a.749.749 0 1 1 1.06 1.06l-6.25 6.25a.749.749 0 0 1-1.06 0l-6.25-6.25a.749.749 0 0 1 0-1.06Z\"/>\\\n</svg>');\n background-repeat: no-repeat;\n background-position: center;\n background-size: 16px 16px;\n}\n/* Previous page icon - custom SVG (white, filled) */\n.adsk-icon-custom-prev::before {\n content: '';\n display: inline-block;\n width: 24px;\n height: 24px;\n background-image: url('data:image/svg+xml;utf8,\\\n<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 1024 1024\">\\\n<g transform=\"translate(512 512) scale(1.2) translate(-512 -512)\">\\\n<path fill=\"%23FFFFFF\" d=\"M685.248 104.704a64 64 0 010 90.496L368.448 512l316.8 316.8a64 64 0 01-90.496 90.496L232.704 557.248a64 64 0 010-90.496l362.048-362.048a64 64 0 0190.496 0z\"/>\\\n</g>\\\n</svg>');\n background-repeat: no-repeat;\n background-position: center;\n background-size: 16px 16px;\n}\n/* Next page icon - custom SVG (white, filled) */\n.adsk-icon-custom-next::before {\n content: '';\n display: inline-block;\n width: 24px;\n height: 24px;\n background-image: url('data:image/svg+xml;utf8,\\\n<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 1024 1024\">\\\n<g transform=\"translate(512 512) scale(1.2) translate(-512 -512)\">\\\n<path fill=\"%23FFFFFF\" d=\"M338.752 104.704a64 64 0 000 90.496l316.8 316.8-316.8 316.8a64 64 0 0090.496 90.496l362.048-362.048a64 64 0 000-90.496L429.248 104.704a64 64 0 00-90.496 0z\"/>\\\n</g>\\\n</svg>');\n background-repeat: no-repeat;\n background-position: center;\n background-size: 16px 16px;\n}\n/* Fallback for adsk-icon-caret-left and adsk-icon-caret-right if not defined */\n.adsk-icon-caret-left::before {\n content: '[';\n font-family: 'adsk-viewing';\n}\n.adsk-icon-caret-right::before {\n content: ']';\n font-family: 'adsk-viewing';\n}\n/* Comment icon - custom SVG (Smiley) */\n.adsk-icon-custom-comment::before {\n content: '';\n display: inline-block;\n width: 24px;\n height: 24px;\n background-image: url('data:image/svg+xml;utf8,<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"%23FFFFFF\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><circle cx=\"12\" cy=\"12\" r=\"10\"></circle><path d=\"M8 14s1.5 2 4 2 4-2 4-2\"></path><line x1=\"9\" y1=\"9\" x2=\"9.01\" y2=\"9\"></line><line x1=\"15\" y1=\"9\" x2=\"15.01\" y2=\"9\"></line></svg>');\n background-repeat: no-repeat;\n background-position: center;\n background-size: contain;\n}\n/* Save icon - custom SVG */\n.adsk-icon-custom-save::before {\n content: '';\n display: inline-block;\n width: 24px;\n height: 24px;\n background-image: url('data:image/svg+xml;utf8,<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"%23FFFFFF\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><path d=\"M19 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h11l5 5v11a2 2 0 0 1-2 2z\"></path><polyline points=\"17 21 17 13 7 13 7 21\"></polyline><polyline points=\"7 3 7 8 15 8\"></polyline></svg>');\n background-repeat: no-repeat;\n background-position: center;\n background-size: contain;\n}\n/* Export with Markup icon - share/export arrow */\n.adsk-icon-markup::before {\n content: '';\n display: inline-block;\n width: 24px;\n height: 24px;\n background-image: url('data:image/svg+xml;utf8,<svg fill=\"%23ffffff\" xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 493.525 493.525\"><path d=\"M430.557,79.556H218.44c21.622,12.688,40.255,29.729,54.859,49.906h157.258c7.196,0,13.063,5.863,13.063,13.06v238.662c0,7.199-5.866,13.064-13.063,13.064H191.894c-7.198,0-13.062-5.865-13.062-13.064V222.173c-6.027-3.1-12.33-5.715-18.845-7.732c-3.818,11.764-12.105,21.787-23.508,27.781c-2.39,1.252-4.987,2.014-7.554,2.844v136.119c0,34.717,28.25,62.971,62.968,62.971h238.663c34.718,0,62.969-28.254,62.969-62.971V142.522C493.525,107.806,465.275,79.556,430.557,79.556z\"/><path d=\"M129.037,175.989c51.419,1.234,96.388,28.283,122.25,68.865c2.371,3.705,6.434,5.848,10.657,5.848c1.152,0,2.322-0.162,3.46-0.486c5.377-1.545,9.114-6.418,9.179-12.006c0-0.504,0-1.01,0-1.51c0-81.148-64.853-147.023-145.527-148.957V64.155c0-5.492-3.038-10.512-7.879-13.078c-2.16-1.139-4.533-1.707-6.889-1.707c-2.94,0-5.848,0.88-8.35,2.584L5.751,120.526C2.162,122.98,0.018,127.041,0,131.394c-0.017,4.338,2.113,8.418,5.687,10.902l100.17,69.451c2.518,1.753,5.459,2.631,8.414,2.631c2.355,0,4.696-0.553,6.857-1.676c4.855-2.549,7.909-7.6,7.909-13.092V175.989z\"/></svg>');\n background-repeat: no-repeat;\n background-position: center;\n background-size: 16px 16px;\n}\n";
92840
92840
  styleInject(css_248z$2);
92841
92841
 
92842
92842
  // ─── Constants ────────────────────────────────────────────────────────────────
@@ -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,
@@ -94844,6 +94846,8 @@ function MinimapPanel(_ref) {
94844
94846
  setPosition = _useState6[1];
94845
94847
  var panelRef = useRef(null);
94846
94848
  var mapRef = useRef(null);
94849
+ var sidebarOffsetRef = useRef(sidebarOffset);
94850
+ sidebarOffsetRef.current = sidebarOffset;
94847
94851
  var dragRef = useRef({
94848
94852
  active: false,
94849
94853
  startX: 0,
@@ -95012,7 +95016,7 @@ function MinimapPanel(_ref) {
95012
95016
  var newX = dragRef.current.originX + (e.clientX - dragRef.current.startX);
95013
95017
  var newY = dragRef.current.originY + (e.clientY - dragRef.current.startY);
95014
95018
  setPosition({
95015
- x: Math.max(0, Math.min(newX, containerW - panelW)),
95019
+ x: Math.max(sidebarOffsetRef.current, Math.min(newX, containerW - panelW)),
95016
95020
  y: Math.max(0, Math.min(newY, containerH - panelH))
95017
95021
  });
95018
95022
  };
@@ -95039,7 +95043,9 @@ function MinimapPanel(_ref) {
95039
95043
  var panelStyle = position ? {
95040
95044
  left: position.x,
95041
95045
  top: position.y
95042
- } : {};
95046
+ } : {
95047
+ left: sidebarOffset
95048
+ };
95043
95049
  return jsxs("div", {
95044
95050
  ref: panelRef,
95045
95051
  className: "wh-minimap-panel".concat(shouldShow ? ' wh-minimap-panel--visible' : ''),
@@ -95696,7 +95702,9 @@ function ViewerSidebar(_ref3) {
95696
95702
  _ref3$hidePanels = _ref3.hidePanels,
95697
95703
  hidePanels = _ref3$hidePanels === void 0 ? [] : _ref3$hidePanels,
95698
95704
  _ref3$className = _ref3.className,
95699
- className = _ref3$className === void 0 ? '' : _ref3$className;
95705
+ className = _ref3$className === void 0 ? '' : _ref3$className,
95706
+ isDraftShared = _ref3.isDraftShared,
95707
+ onToggleDraftShared = _ref3.onToggleDraftShared;
95700
95708
  var handleClick = function handleClick(panel) {
95701
95709
  // Toggle off if already active
95702
95710
  onPanelChange === null || onPanelChange === void 0 || onPanelChange(activePanel === panel ? null : panel);
@@ -95741,6 +95749,62 @@ function ViewerSidebar(_ref3) {
95741
95749
  children: jsx(IconSubmit, {})
95742
95750
  }), jsx("div", {
95743
95751
  className: 'wh-sidebar-spacer'
95752
+ }), onToggleDraftShared !== undefined && jsxs(Fragment, {
95753
+ children: [jsx("hr", {
95754
+ className: 'wh-sidebar-divider'
95755
+ }), 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: 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: [jsx("circle", {
95784
+ cx: '18',
95785
+ cy: '5',
95786
+ r: '3'
95787
+ }), jsx("circle", {
95788
+ cx: '6',
95789
+ cy: '12',
95790
+ r: '3'
95791
+ }), jsx("circle", {
95792
+ cx: '18',
95793
+ cy: '19',
95794
+ r: '3'
95795
+ }), jsx("line", {
95796
+ x1: '8.59',
95797
+ y1: '13.51',
95798
+ x2: '15.42',
95799
+ y2: '17.49'
95800
+ }), jsx("line", {
95801
+ x1: '15.41',
95802
+ y1: '6.51',
95803
+ x2: '8.59',
95804
+ y2: '10.49'
95805
+ })]
95806
+ })
95807
+ })]
95744
95808
  }), jsx("hr", {
95745
95809
  className: 'wh-sidebar-divider'
95746
95810
  }), jsx(PresenceIndicator, {
@@ -95813,6 +95877,9 @@ var ViewerForgePDF = function ViewerForgePDF(_ref) {
95813
95877
  checkSubmitHasMarkup = _ref.checkSubmitHasMarkup,
95814
95878
  _ref$defaultActiveSid = _ref.defaultActiveSidebarPanel,
95815
95879
  defaultActiveSidebarPanel = _ref$defaultActiveSid === void 0 ? null : _ref$defaultActiveSid,
95880
+ onSidebarWidthChange = _ref.onSidebarWidthChange,
95881
+ isDraftShared = _ref.isDraftShared,
95882
+ onToggleDraftShared = _ref.onToggleDraftShared,
95816
95883
  collabAdapter = _ref.collabAdapter,
95817
95884
  collabActorId = _ref.collabActorId,
95818
95885
  collabDrawingId = _ref.collabDrawingId,
@@ -96615,6 +96682,11 @@ var ViewerForgePDF = function ViewerForgePDF(_ref) {
96615
96682
  viewerInstance === null || viewerInstance === void 0 || (_viewerInstance$resiz = viewerInstance.resize) === null || _viewerInstance$resiz === void 0 || _viewerInstance$resiz.call(viewerInstance);
96616
96683
  }, [viewerInstance, activeSidebarPanel, panelWidth, showDrawer, drawerWidth]);
96617
96684
 
96685
+ // Notify host app of total sidebar width so it can adjust external layout.
96686
+ useEffect(function () {
96687
+ onSidebarWidthChange === null || onSidebarWidthChange === void 0 || onSidebarWidthChange(activeSidebarPanel ? 44 + panelWidth : 0);
96688
+ }, [activeSidebarPanel, panelWidth, onSidebarWidthChange]);
96689
+
96618
96690
  // ─── Callbacks ────────────────────────────────────────────────────────────
96619
96691
  var handleDrawerPropertyChange = useCallback(function (key, value) {
96620
96692
  var _markupMgrRef$current4;
@@ -96716,7 +96788,9 @@ var ViewerForgePDF = function ViewerForgePDF(_ref) {
96716
96788
  onPanelChange: setActiveSidebarPanel,
96717
96789
  onlineUsers: onlineUsers,
96718
96790
  showSubmitPanel: !!submitConfig,
96719
- hidePanels: hidePanels
96791
+ hidePanels: hidePanels,
96792
+ isDraftShared: onToggleDraftShared !== undefined ? isDraftShared !== null && isDraftShared !== void 0 ? isDraftShared : false : undefined,
96793
+ onToggleDraftShared: onToggleDraftShared
96720
96794
  }), activeSidebarPanel === 'sheets' && /*#__PURE__*/jsx(SheetsPanel, {
96721
96795
  viewables: viewables,
96722
96796
  currentIndex: currentPageIndex,
@@ -96783,7 +96857,8 @@ var ViewerForgePDF = function ViewerForgePDF(_ref) {
96783
96857
  filePath: filePath,
96784
96858
  onClose: function onClose() {
96785
96859
  return setShowMinimap(false);
96786
- }
96860
+ },
96861
+ sidebarOffset: activeSidebarPanel ? 44 + panelWidth + 8 : 52
96787
96862
  }), showMarkupToolbar && markupEngineInstance && /*#__PURE__*/jsx(SelectionActionToolbar, {
96788
96863
  engine: markupEngineInstance,
96789
96864
  viewerContainer: viewerContainerRef.current,