cloudmr-ux 4.7.4 → 4.7.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.
@@ -125,7 +125,7 @@ export function CloudMrNiivuePanel(props) {
125
125
  if (tool === "pen") {
126
126
  nv.opts.polylinePenMode = penMode === "polyline";
127
127
  nv.opts.isFilledPen = penMode === "freehand";
128
- nv.opts.deferFreehandCommit = penMode === "freehand";
128
+ nv.opts.deferFreehandCommit = false;
129
129
  }
130
130
  else {
131
131
  nv.opts.polylinePenMode = false;
@@ -63,7 +63,7 @@ import { SettingsPanel } from './SettingsPanel';
63
63
  import { NumberPicker } from './NumberPicker';
64
64
  import { ColorPicker } from './ColorPicker';
65
65
  import { LayersPanel } from './LayersPanel';
66
- import { applyPenDraft, cancelPenDraft, fillPolylineDraft, unfillPolylineDraft, polylineDraftFromNv, syncPolylineDraftToNv, registerAppliedPolyline, restoreCommittedPolyline, collectPolylineAppliedVoxelIndices, } from './penDraftUtils';
66
+ import { applyPenDraft, cancelPenDraft, captureFreehandDraft, fillPolylineDraft, unfillPolylineDraft, polylineDraftFromNv, syncPolylineDraftToNv, registerAppliedPolyline, restoreCommittedPolyline, collectPolylineAppliedVoxelIndices, } from './penDraftUtils';
67
67
  import { CloudMrNiivuePanel } from './CloudMrNiivuePanel';
68
68
  import { Niivue } from './NiivuePatcher';
69
69
  import NVSwitch from './Switch';
@@ -593,7 +593,7 @@ export default function CloudMrNiivueViewer(props) {
593
593
  }
594
594
  }
595
595
  else if (drawShapeToolRef.current === "pen") {
596
- nv.opts.deferFreehandCommit = penDrawModeRef.current === "freehand";
596
+ nv.opts.deferFreehandCommit = false;
597
597
  nv.opts.polylinePenMode = penDrawModeRef.current === "polyline";
598
598
  nv.opts.isFilledPen = penDrawModeRef.current === "freehand";
599
599
  }
@@ -821,16 +821,42 @@ export default function CloudMrNiivueViewer(props) {
821
821
  }
822
822
  }
823
823
  function syncPenDrawMode(mode) {
824
- var _a;
824
+ var _a, _b;
825
+ var prevMode = penDrawModeRef.current;
826
+ // Commit an in-progress freehand before switching to polyline so it stays
827
+ // marked as pen (kind 2) and is not misidentified as a shape on click.
828
+ if (prevMode === "freehand" && mode === "polyline") {
829
+ var draft = penDraftRef.current;
830
+ if ((draft === null || draft === void 0 ? void 0 : draft.kind) === "freehand") {
831
+ applyPenDraft(nv, draft);
832
+ markPenVoxelKind(draft, 2);
833
+ setPenDraft(null);
834
+ penDraftRef.current = null;
835
+ nv._cloudMrPenDraftActive = false;
836
+ }
837
+ else if (nv._cloudMrFreehandSessionStartBitmap) {
838
+ var axCorSag = nv._cloudMrFreehandAxCorSag >= 0 ? nv._cloudMrFreehandAxCorSag : nv.drawPenAxCorSag;
839
+ var captured = captureFreehandDraft(nv, nv._cloudMrFreehandSessionStartBitmap, axCorSag);
840
+ nv._cloudMrFreehandSessionStartBitmap = null;
841
+ if (captured)
842
+ markPenVoxelKind(captured, 2);
843
+ }
844
+ }
845
+ if (mode === "freehand") {
846
+ (_a = nv.cloudMrCancelPolyline) === null || _a === void 0 ? void 0 : _a.call(nv);
847
+ if (((_b = penDraftRef.current) === null || _b === void 0 ? void 0 : _b.kind) === "polyline") {
848
+ cancelPenDraft(nv, penDraftRef.current);
849
+ setPenDraft(null);
850
+ penDraftRef.current = null;
851
+ nv._cloudMrPenDraftActive = false;
852
+ setPolylineVertexCount(0);
853
+ }
854
+ }
825
855
  setPenDrawMode(mode);
826
856
  penDrawModeRef.current = mode;
827
857
  nv.opts.polylinePenMode = mode === "polyline";
828
858
  nv.opts.isFilledPen = mode === "freehand";
829
- nv.opts.deferFreehandCommit =
830
- drawShapeToolRef.current === "pen" && mode === "freehand";
831
- if (mode === "freehand") {
832
- (_a = nv.cloudMrCancelPolyline) === null || _a === void 0 ? void 0 : _a.call(nv);
833
- }
859
+ nv.opts.deferFreehandCommit = false;
834
860
  }
835
861
  function cancelPenDraftHandler() {
836
862
  var _a;
@@ -885,7 +911,7 @@ export default function CloudMrNiivueViewer(props) {
885
911
  var mode = penDrawModeRef.current;
886
912
  nv.opts.polylinePenMode = mode === "polyline";
887
913
  nv.opts.isFilledPen = mode === "freehand";
888
- nv.opts.deferFreehandCommit = mode === "freehand";
914
+ nv.opts.deferFreehandCommit = false;
889
915
  nvSetDrawingEnabled(true);
890
916
  }
891
917
  else {
@@ -916,6 +942,17 @@ export default function CloudMrNiivueViewer(props) {
916
942
  function cancelPolylineDraft() {
917
943
  cancelPenDraftHandler();
918
944
  }
945
+ nv.onShapeCommitted = function (draft) {
946
+ nv.drawAddUndoBitmap(nv.drawFillOverwrites);
947
+ markShapeVoxelKind(draft);
948
+ setDrawingChanged(true);
949
+ resampleImage();
950
+ };
951
+ nv.onFreehandCommitted = function (draft) {
952
+ markPenVoxelKind(draft, 2);
953
+ setDrawingChanged(true);
954
+ resampleImage();
955
+ };
919
956
  nv.onPenDraftReady = function (draft) {
920
957
  setPenDraft(draft);
921
958
  penDraftRef.current = draft;
@@ -1657,6 +1694,7 @@ export default function CloudMrNiivueViewer(props) {
1657
1694
  onCancelPenDraft: cancelPenDraftHandler,
1658
1695
  onFillPenDraft: fillPolylineDraftHandler,
1659
1696
  penDraftActive: penDraft != null,
1697
+ penDraftKind: penDraft === null || penDraft === void 0 ? void 0 : penDraft.kind,
1660
1698
  penDraftFilled: (penDraft === null || penDraft === void 0 ? void 0 : penDraft.filled) === true,
1661
1699
  brushSize: brushSize,
1662
1700
  updateBrushSize: nvUpdateBrushSize,
@@ -25,6 +25,7 @@ import {
25
25
  captureFreehandDraft,
26
26
  capturePenDraftFromClick,
27
27
  capturePolylineDraftFromClick,
28
+ isFreehandPenActive,
28
29
  isRegisteredPolylineClick,
29
30
  redrawFreehandDraft,
30
31
  redrawPolylineDraft,
@@ -537,6 +538,19 @@ Niivue.prototype.drawPenFilled = function () {
537
538
  return;
538
539
  }
539
540
  this.drawAddUndoBitmap()
541
+ if (this._cloudMrFreehandSessionStartBitmap && isFreehandPenActive(this)) {
542
+ const axCorSag =
543
+ this.drawPenAxCorSag >= 0 ? this.drawPenAxCorSag : this._cloudMrFreehandAxCorSag;
544
+ const draft = captureFreehandDraft(
545
+ this,
546
+ this._cloudMrFreehandSessionStartBitmap,
547
+ axCorSag,
548
+ );
549
+ this._cloudMrFreehandSessionStartBitmap = null;
550
+ if (draft && typeof this.onFreehandCommitted === "function") {
551
+ this.onFreehandCommitted(draft);
552
+ }
553
+ }
540
554
  // Post-processing to hide hidden voxels
541
555
  this.hiddenBitmap = new Uint8Array(this.drawBitmap.length);
542
556
  for (let i = 0; i < this.drawBitmap.length; i++) {
@@ -1506,6 +1520,28 @@ function clickedVoxelToolKind(nv) {
1506
1520
  return bitmap[idx] || 0;
1507
1521
  }
1508
1522
 
1523
+ /**
1524
+ * Re-open an applied ROI for editing based on stored (or inferred) tool kind.
1525
+ * Unmarked pen strokes (kind 0) must try pen reopen before shape inference —
1526
+ * otherwise freehand blobs get misclassified as ellipse/rectangle shapes.
1527
+ */
1528
+ function cloudMrTryReopenDraftOnClick(nv) {
1529
+ if (nv._cloudMrShapeDraftActive || nv._cloudMrPenDraftActive) return;
1530
+ if (!isClickWithoutDrag(nv.uiData)) return;
1531
+
1532
+ const kind = clickedVoxelToolKind(nv);
1533
+ if (kind === 1) {
1534
+ cloudMrTryReopenShapeDraftOnClick(nv);
1535
+ return;
1536
+ }
1537
+ if (kind === 2 || kind === 3) {
1538
+ cloudMrTryReopenPenDraftOnClick(nv);
1539
+ return;
1540
+ }
1541
+ if (cloudMrTryReopenPenDraftOnClick(nv)) return;
1542
+ cloudMrTryReopenShapeDraftOnClick(nv);
1543
+ }
1544
+
1509
1545
  /**
1510
1546
  * Re-enter rectangle/ellipse edit mode when clicking an existing applied shape ROI.
1511
1547
  * Skips voxels that were drawn with the pen tool (those are handled by pen reopen).
@@ -1569,12 +1605,12 @@ Niivue.prototype.mouseDownListener = function cloudMrMouseDownListener(e) {
1569
1605
  if (e.button === RIGHT_MOUSE_BUTTON && cloudMrTryApplyDraftOnRightClick(this, e)) {
1570
1606
  return;
1571
1607
  }
1572
- if (shouldDeferFreehandCommit(this) && this.drawBitmap) {
1608
+ if (isFreehandPenActive(this) && this.drawBitmap) {
1573
1609
  this._cloudMrFreehandSessionStartBitmap = this.drawBitmap.slice();
1574
1610
  this._cloudMrFreehandAxCorSag = -1;
1575
1611
  }
1576
1612
  _mouseDownListener.call(this, e);
1577
- if (shouldDeferFreehandCommit(this) && this._cloudMrFreehandSessionStartBitmap) {
1613
+ if (isFreehandPenActive(this) && this._cloudMrFreehandSessionStartBitmap) {
1578
1614
  const axCorSag = axCorSagFromMouse(this);
1579
1615
  if (axCorSag >= 0) {
1580
1616
  this._cloudMrFreehandAxCorSag = axCorSag;
@@ -1637,22 +1673,20 @@ Niivue.prototype.mouseUpListener = function cloudMrMouseUpListener() {
1637
1673
  }
1638
1674
 
1639
1675
  if (!pendingDraft?.baseBitmap) {
1640
- if (!cloudMrTryReopenShapeDraftOnClick(this)) {
1641
- cloudMrTryReopenPenDraftOnClick(this);
1642
- }
1676
+ cloudMrTryReopenDraftOnClick(this);
1643
1677
  return;
1644
1678
  }
1645
1679
  if (isDraftTooSmall(pendingDraft.ptA, pendingDraft.ptB)) {
1646
1680
  this.drawBitmap.set(pendingDraft.baseBitmap);
1647
1681
  this.refreshDrawing(true, false);
1648
1682
  this.drawScene();
1649
- if (!cloudMrTryReopenShapeDraftOnClick(this)) {
1650
- cloudMrTryReopenPenDraftOnClick(this);
1651
- }
1683
+ cloudMrTryReopenDraftOnClick(this);
1652
1684
  return;
1653
1685
  }
1654
1686
  this._cloudMrSuppressDrawingChangedMouseUp = true;
1655
- if (typeof this.onShapeDraftReady === "function") {
1687
+ if (typeof this.onShapeCommitted === "function") {
1688
+ this.onShapeCommitted(pendingDraft);
1689
+ } else if (typeof this.onShapeDraftReady === "function") {
1656
1690
  this.onShapeDraftReady(pendingDraft);
1657
1691
  }
1658
1692
  };
@@ -1,4 +1,4 @@
1
- export default function DrawColorPlatte({ expanded, updateDrawPen, setDrawingEnabled, showPenModes, penDrawMode, onPenDrawModeChange, polylineVertexCount, penDraftActive, penDraftFilled, onApplyPenDraft, onFillPenDraft, brushSize, updateBrushSize, shapeDraftActive, onApplyShapeDraft, }: {
1
+ export default function DrawColorPlatte({ expanded, updateDrawPen, setDrawingEnabled, showPenModes, penDrawMode, onPenDrawModeChange, polylineVertexCount, penDraftActive, penDraftKind, penDraftFilled, onApplyPenDraft, onFillPenDraft, brushSize, updateBrushSize, shapeDraftActive, onApplyShapeDraft, }: {
2
2
  expanded: any;
3
3
  updateDrawPen: any;
4
4
  setDrawingEnabled: any;
@@ -7,6 +7,7 @@ export default function DrawColorPlatte({ expanded, updateDrawPen, setDrawingEna
7
7
  onPenDrawModeChange: any;
8
8
  polylineVertexCount?: number | undefined;
9
9
  penDraftActive?: boolean | undefined;
10
+ penDraftKind: any;
10
11
  penDraftFilled?: boolean | undefined;
11
12
  onApplyPenDraft: any;
12
13
  onFillPenDraft: any;
@@ -36,7 +36,7 @@ var modeBtnSx = function (active) { return ({
36
36
  px: 0.75
37
37
  }); };
38
38
  export default function DrawColorPlatte(_a) {
39
- var expanded = _a.expanded, updateDrawPen = _a.updateDrawPen, setDrawingEnabled = _a.setDrawingEnabled, _b = _a.showPenModes, showPenModes = _b === void 0 ? false : _b, _c = _a.penDrawMode, penDrawMode = _c === void 0 ? "freehand" : _c, onPenDrawModeChange = _a.onPenDrawModeChange, _d = _a.polylineVertexCount, polylineVertexCount = _d === void 0 ? 0 : _d, _e = _a.penDraftActive, penDraftActive = _e === void 0 ? false : _e, _f = _a.penDraftFilled, penDraftFilled = _f === void 0 ? false : _f, onApplyPenDraft = _a.onApplyPenDraft, onFillPenDraft = _a.onFillPenDraft, _g = _a.brushSize, brushSize = _g === void 0 ? 1 : _g, updateBrushSize = _a.updateBrushSize, _h = _a.shapeDraftActive, shapeDraftActive = _h === void 0 ? false : _h, onApplyShapeDraft = _a.onApplyShapeDraft;
39
+ var expanded = _a.expanded, updateDrawPen = _a.updateDrawPen, setDrawingEnabled = _a.setDrawingEnabled, _b = _a.showPenModes, showPenModes = _b === void 0 ? false : _b, _c = _a.penDrawMode, penDrawMode = _c === void 0 ? "freehand" : _c, onPenDrawModeChange = _a.onPenDrawModeChange, _d = _a.polylineVertexCount, polylineVertexCount = _d === void 0 ? 0 : _d, _e = _a.penDraftActive, penDraftActive = _e === void 0 ? false : _e, penDraftKind = _a.penDraftKind, _f = _a.penDraftFilled, penDraftFilled = _f === void 0 ? false : _f, onApplyPenDraft = _a.onApplyPenDraft, onFillPenDraft = _a.onFillPenDraft, _g = _a.brushSize, brushSize = _g === void 0 ? 1 : _g, updateBrushSize = _a.updateBrushSize, _h = _a.shapeDraftActive, shapeDraftActive = _h === void 0 ? false : _h, onApplyShapeDraft = _a.onApplyShapeDraft;
40
40
  return (_jsxs(Stack, __assign({ style: {
41
41
  position: "absolute",
42
42
  top: "100%",
@@ -53,7 +53,10 @@ export default function DrawColorPlatte(_a) {
53
53
  }, direction: "column", spacing: 0.5, sx: { py: expanded ? 0.5 : 0 } }, { children: [showPenModes && expanded && (_jsxs(Stack, __assign({ direction: "row", alignItems: "center", spacing: 0.5, sx: { px: 0.75, pt: 0.25 } }, { children: [_jsx(Button, __assign({ size: "small", onClick: function () { return onPenDrawModeChange === null || onPenDrawModeChange === void 0 ? void 0 : onPenDrawModeChange("freehand"); }, sx: modeBtnSx(penDrawMode === "freehand") }, { children: "Freehand" })), _jsx(Button, __assign({ size: "small", onClick: function () { return onPenDrawModeChange === null || onPenDrawModeChange === void 0 ? void 0 : onPenDrawModeChange("polyline"); }, sx: modeBtnSx(penDrawMode === "polyline") }, { children: "Polyline" }))] }))), showPenModes && expanded && updateBrushSize && (_jsx(BrushSizeSlider, { label: "Line thickness", brushSize: brushSize, updateBrushSize: updateBrushSize })), _jsx(Stack, __assign({ direction: "row" }, { children: FILLED_COLORS.map(function (color, index) { return (_jsx(IconButton, __assign({ onClick: function () {
54
54
  updateDrawPen({ target: { value: index + 1 } });
55
55
  setDrawingEnabled(true);
56
- } }, { children: _jsx(FiberManualRecordIcon, { sx: color.sx }) }), index)); }) })), showPenModes && penDrawMode === "polyline" && expanded && polylineVertexCount === 0 && (_jsx(Typography, __assign({ sx: { px: 1, pb: 0.5, fontSize: "0.68rem", color: "#aaa", userSelect: "none" } }, { children: "Click each vertex to draw connected line segments" }))), showPenModes && penDraftActive && expanded && (_jsxs(Stack, __assign({ direction: "row", alignItems: "center", justifyContent: "flex-end", spacing: 1, sx: { px: 1, py: 0.5, borderTop: "1px solid #555", width: "100%" } }, { children: [penDrawMode === "polyline" && polylineVertexCount >= 3 && (_jsx(Tooltip, __assign({ title: penDraftFilled
56
+ } }, { children: _jsx(FiberManualRecordIcon, { sx: color.sx }) }), index)); }) })), showPenModes && penDrawMode === "polyline" && expanded && polylineVertexCount === 0 && (_jsx(Typography, __assign({ sx: { px: 1, pb: 0.5, fontSize: "0.68rem", color: "#aaa", userSelect: "none" } }, { children: "Click each vertex to draw connected line segments" }))), showPenModes &&
57
+ penDraftActive &&
58
+ (penDrawMode === "polyline" || penDraftKind === "freehand") &&
59
+ expanded && (_jsxs(Stack, __assign({ direction: "row", alignItems: "center", justifyContent: "flex-end", spacing: 1, sx: { px: 1, py: 0.5, borderTop: "1px solid #555", width: "100%" } }, { children: [penDrawMode === "polyline" && polylineVertexCount >= 3 && (_jsx(Tooltip, __assign({ title: penDraftFilled
57
60
  ? "Remove fill (keeps outline editable)"
58
61
  : "Fill interior (keeps outline editable until Apply)" }, { children: _jsx(Button, __assign({ size: "small", "aria-label": penDraftFilled ? "undo fill polyline" : "fill polyline", onClick: function () { return onFillPenDraft === null || onFillPenDraft === void 0 ? void 0 : onFillPenDraft(); }, sx: {
59
62
  color: penDraftFilled ? "#ffb74d" : "#c9a0e8",
@@ -189,7 +189,7 @@ export function MroDrawToolkit(props) {
189
189
  alignItems: "center",
190
190
  gap: 4,
191
191
  overflow: "visible"
192
- } }, { children: [_jsxs(Box, __assign({ sx: { position: "relative", zIndex: expandedOption === "d" ? 1600 : "auto", display: "inline-flex", alignItems: "center" } }, { children: [_jsx(Tooltip, __assign({ title: "Pen" }, { children: _jsx(IconButton, __assign({ "aria-label": "pen", size: "small", onClick: clickPen, sx: __assign(__assign({}, toolBtnSx), shapeSelectedSx("pen")) }, { children: _jsx(DrawIcon, { sx: { color: "inherit" } }) })) })), _jsx(DrawColorPlatte, { expanded: expandedOption === "d", updateDrawPen: props.updateDrawPen, setDrawingEnabled: props.setDrawingEnabled, showPenModes: true, penDrawMode: props.penDrawMode, onPenDrawModeChange: props.onPenDrawModeChange, polylineVertexCount: props.polylineVertexCount, onCancelPolyline: props.onCancelPolyline, penDraftActive: props.penDraftActive, penDraftFilled: props.penDraftFilled, onApplyPenDraft: props.onApplyPenDraft, onFillPenDraft: props.onFillPenDraft, brushSize: props.brushSize, updateBrushSize: props.updateBrushSize })] })), _jsxs(Box, __assign({ sx: { position: "relative", zIndex: expandedOption === "r" ? 1600 : "auto", display: "inline-flex", alignItems: "center" } }, { children: [_jsx(Tooltip, __assign({ title: "Rectangle" }, { children: _jsx(IconButton, __assign({ "aria-label": "rectangle", size: "small", onClick: clickRectangle, sx: __assign(__assign({}, toolBtnSx), shapeSelectedSx("rectangle")) }, { children: _jsx(CropSquareOutlinedIcon, { sx: { color: "inherit" } }) })) })), _jsx(DrawColorPlatte, { expanded: expandedOption === "r", updateDrawPen: props.updateDrawPen, setDrawingEnabled: props.setDrawingEnabled, shapeDraftActive: props.shapeDraftActive && drawShapeTool === "rectangle", onApplyShapeDraft: props.onApplyShapeDraft })] })), _jsxs(Box, __assign({ sx: { position: "relative", zIndex: expandedOption === "l" ? 1600 : "auto", display: "inline-flex", alignItems: "center" } }, { children: [_jsx(Tooltip, __assign({ title: "Ellipse" }, { children: _jsx(IconButton, __assign({ "aria-label": "ellipse", size: "small", onClick: clickEllipse, sx: __assign(__assign({}, toolBtnSx), shapeSelectedSx("ellipse")) }, { children: _jsx(CircleOutlinedIcon, { sx: { color: "inherit" } }) })) })), _jsx(DrawColorPlatte, { expanded: expandedOption === "l", updateDrawPen: props.updateDrawPen, setDrawingEnabled: props.setDrawingEnabled, shapeDraftActive: props.shapeDraftActive && drawShapeTool === "ellipse", onApplyShapeDraft: props.onApplyShapeDraft })] })), _jsxs(Box, __assign({ sx: { position: "relative", zIndex: expandedOption === "e" ? 1600 : "auto", display: "inline-flex", alignItems: "center" } }, { children: [_jsx(Tooltip, __assign({ title: "Eraser" }, { children: _jsx(IconButton, __assign({ "aria-label": "erase", size: "small", onClick: clickEraser, sx: __assign(__assign({}, toolBtnSx), (eraserActive
192
+ } }, { children: [_jsxs(Box, __assign({ sx: { position: "relative", zIndex: expandedOption === "d" ? 1600 : "auto", display: "inline-flex", alignItems: "center" } }, { children: [_jsx(Tooltip, __assign({ title: "Pen" }, { children: _jsx(IconButton, __assign({ "aria-label": "pen", size: "small", onClick: clickPen, sx: __assign(__assign({}, toolBtnSx), shapeSelectedSx("pen")) }, { children: _jsx(DrawIcon, { sx: { color: "inherit" } }) })) })), _jsx(DrawColorPlatte, { expanded: expandedOption === "d", updateDrawPen: props.updateDrawPen, setDrawingEnabled: props.setDrawingEnabled, showPenModes: true, penDrawMode: props.penDrawMode, onPenDrawModeChange: props.onPenDrawModeChange, polylineVertexCount: props.polylineVertexCount, onCancelPolyline: props.onCancelPolyline, penDraftActive: props.penDraftActive, penDraftKind: props.penDraftKind, penDraftFilled: props.penDraftFilled, onApplyPenDraft: props.onApplyPenDraft, onFillPenDraft: props.onFillPenDraft, brushSize: props.brushSize, updateBrushSize: props.updateBrushSize })] })), _jsxs(Box, __assign({ sx: { position: "relative", zIndex: expandedOption === "r" ? 1600 : "auto", display: "inline-flex", alignItems: "center" } }, { children: [_jsx(Tooltip, __assign({ title: "Rectangle" }, { children: _jsx(IconButton, __assign({ "aria-label": "rectangle", size: "small", onClick: clickRectangle, sx: __assign(__assign({}, toolBtnSx), shapeSelectedSx("rectangle")) }, { children: _jsx(CropSquareOutlinedIcon, { sx: { color: "inherit" } }) })) })), _jsx(DrawColorPlatte, { expanded: expandedOption === "r", updateDrawPen: props.updateDrawPen, setDrawingEnabled: props.setDrawingEnabled, shapeDraftActive: props.shapeDraftActive && drawShapeTool === "rectangle", onApplyShapeDraft: props.onApplyShapeDraft })] })), _jsxs(Box, __assign({ sx: { position: "relative", zIndex: expandedOption === "l" ? 1600 : "auto", display: "inline-flex", alignItems: "center" } }, { children: [_jsx(Tooltip, __assign({ title: "Ellipse" }, { children: _jsx(IconButton, __assign({ "aria-label": "ellipse", size: "small", onClick: clickEllipse, sx: __assign(__assign({}, toolBtnSx), shapeSelectedSx("ellipse")) }, { children: _jsx(CircleOutlinedIcon, { sx: { color: "inherit" } }) })) })), _jsx(DrawColorPlatte, { expanded: expandedOption === "l", updateDrawPen: props.updateDrawPen, setDrawingEnabled: props.setDrawingEnabled, shapeDraftActive: props.shapeDraftActive && drawShapeTool === "ellipse", onApplyShapeDraft: props.onApplyShapeDraft })] })), _jsxs(Box, __assign({ sx: { position: "relative", zIndex: expandedOption === "e" ? 1600 : "auto", display: "inline-flex", alignItems: "center" } }, { children: [_jsx(Tooltip, __assign({ title: "Eraser" }, { children: _jsx(IconButton, __assign({ "aria-label": "erase", size: "small", onClick: clickEraser, sx: __assign(__assign({}, toolBtnSx), (eraserActive
193
193
  ? { backgroundColor: "rgba(88, 15, 139, 0.12)", color: "#580f8b" }
194
194
  : {})) }, { children: filled || !eraserActive ? (_jsx(EraserIcon, {})) : (_jsx(AutoFixNormalOutlinedIcon, { sx: { color: ICON_COLOR } })) })) })), _jsx(EraserPlatte, { expandEraseOptions: expandedOption === "e", updateDrawPen: props.updateDrawPen, setDrawingEnabled: props.setDrawingEnabled, brushSize: props.brushSize, updateBrushSize: props.updateBrushSize })] })), _jsx(Tooltip, __assign({ title: "Undo" }, { children: _jsx(IconButton, __assign({ "aria-label": "revert", size: "small", onClick: function () { return props.drawUndo(); }, sx: toolBtnSx }, { children: _jsx(ReplyIcon, { sx: { color: ICON_COLOR } }) })) })), _jsx(Tooltip, __assign({ title: "Save screenshot" }, { children: _jsx("span", { children: _jsx(IconButton, __assign({ "aria-label": "capture", size: "small", disabled: !vol, onClick: function () { return vol && props.nv.saveScene("".concat(vol.name, "_drawing.png")); }, sx: toolBtnSx }, { children: _jsx(CameraAltIcon, { sx: { color: ICON_COLOR } }) })) }) })), _jsx(Tooltip, __assign({ title: "Clear drawing" }, { children: _jsx(IconButton, __assign({ "aria-label": "delete", size: "small", onClick: function () {
195
195
  var _a;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cloudmr-ux",
3
- "version": "4.7.4",
3
+ "version": "4.7.5",
4
4
  "author": "erosmontin@gmail.com",
5
5
  "license": "MIT",
6
6
  "repository": "erosmontin/cloudmr-ux",