Skip to main content

@blockly/fixed-edges

Built with Blockly​

A Blockly MetricsManager that makes fixed edges more easily configurable.

Installation​

Yarn​

yarn add @blockly/fixed-edges

npm​

npm install @blockly/fixed-edges --save

Usage​

import * as Blockly from 'blockly';
import {FixedEdgesMetricsManager} from '@blockly/fixed-edges';

// Configure fixed edges
FixedEdgesMetricsManager.setFixedEdges({
top: true,
left: true,
});

// Inject Blockly.
const workspace = Blockly.inject('blocklyDiv', {
toolbox: toolboxCategories,
plugins: {
metricsManager: FixedEdgesMetricsManager,
},
});

API​

  • setFixedEdges: Configures which edges are fixed. This does not prevent fixed edges set by no scrollbars or single-direction scrollbars.

License​

Apache 2.0

A plugin that provides a MetricsManager that can be used to prevent the workspace from expanding to the top/left/right/bottom when blocks are dragged to that edge.

Classes​

ClassDescription
FixedEdgesMetricsManagerThe metrics manager for workspace metrics calculations with customizable fixed edges.