@particle-academy/fancy-flow 0.30.0 → 0.31.0

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.cjs CHANGED
@@ -12549,6 +12549,16 @@ function HelperLines({ horizontal, vertical }) {
12549
12549
  )
12550
12550
  ] });
12551
12551
  }
12552
+ function preventScrollWhileZooming(event) {
12553
+ if (event.shiftKey) event.preventDefault();
12554
+ }
12555
+ function wheelZoomProps(zoomOnWheel) {
12556
+ return zoomOnWheel ? { zoomActivationKeyCode: null, preventScrolling: true } : {
12557
+ zoomActivationKeyCode: "Shift",
12558
+ preventScrolling: false,
12559
+ onWheelCapture: preventScrollWhileZooming
12560
+ };
12561
+ }
12552
12562
  var DEFAULT_FIT_VIEW = { padding: 0.2 };
12553
12563
  var DEFAULT_EDGE_OPTIONS = {
12554
12564
  type: "smoothstep",
@@ -12565,6 +12575,7 @@ function FlowCanvas({
12565
12575
  isValidConnection,
12566
12576
  colorMode,
12567
12577
  showHelperLines = false,
12578
+ zoomOnWheel = true,
12568
12579
  onNodesChange,
12569
12580
  toolbar,
12570
12581
  nodeTypes,
@@ -12637,8 +12648,7 @@ function FlowCanvas({
12637
12648
  fitViewOptions: DEFAULT_FIT_VIEW,
12638
12649
  defaultEdgeOptions: DEFAULT_EDGE_OPTIONS,
12639
12650
  proOptions: { hideAttribution: true },
12640
- zoomActivationKeyCode: "Shift",
12641
- preventScrolling: false,
12651
+ ...wheelZoomProps(zoomOnWheel),
12642
12652
  isValidConnection: resolvedIsValidConnection,
12643
12653
  ...rest,
12644
12654
  children: [