npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

fabricjs-extension

v0.2.24

Published

Fabric.js Extension is a powerful enhancement for Fabric.js, introducing a rich set of keyboard shortcuts and intuitive mouse actions to optimize canvas editing. This extension is ideal for designers, developers, and digital artists who need advanced func

Downloads

1,807

Readme

Fabric.js Extension – Enhanced Canvas Editor with Advanced Shortcuts & Actions

Fabric.js Extension is a powerful enhancement for Fabric.js, introducing a rich set of keyboard shortcuts and intuitive mouse actions to optimize canvas editing. This extension is ideal for designers, developers, and digital artists who need advanced functionality for navigating, manipulating, and customizing elements on the canvas. With streamlined commands, fabricjs-extension allows users to work faster and more precisely, improving productivity in any Fabric.js-based project.

🚀 Features

🔄 Navigation

  • Zoom at Cursor: Zoom in and out precisely where the cursor is positioned using Shift + Command/Ctrl + Wheel.
  • Pan & Pan to Center: Easily pan with the mouse wheel or instantly center the canvas view with a single key ("o").
  • Custom Zoom Ratios: Quickly adjust to specific zoom levels ("z").

✂️ Element Manipulation

  • Copy, Paste & Delete: Duplicate elements (Ctrl/Cmd + C), paste images or elements from other sources, and delete elements (Backspace).
  • Move & Transform: Move elements ("m"), rotate ("r"), or scale ("s") with ease.
  • Rotate by Interval: Rotate elements by set increments with Shift + rotate.
  • Crop Tool: Built-in functionality to crop images and shapes directly on the canvas.

🎨 Customization

  • Change Color: Quickly modify the color of selected elements ("c").
  • Rotation Point Customization: Adjust and customize rotation points for selected elements.

⚡️ Additional Highlights

  • Cross-Platform Compatibility: Automatically adapts shortcuts for Windows (Ctrl) and macOS (Cmd).
  • Multi-Command Workflows: Combine commands for complex interactions and precise control over canvas elements.

📦 Installation & Usage

Install via npm:

npm install fabricjs-extension

Import and initialize in your Fabric.js project:

import { fabric } from "fabric";
import { install } from "fabricjs-extension";

// Initialize Fabric.js
const canvas = new fabric.Canvas("c");

// Apply the extension with custom configuration
install(canvas, {
    actionsToInstall: {
        rotationPointCustomization: {},
        rotateByInterval: {
            steps: 15,
        },
        dropImagesOnCanvas: {
            justCreateObject: true,
        },
        deleteActiveElement: {
            justEmitEvent: true,
        },
    },
});

🚧 Working Features

📌 In Progress

  • Layer Management: Add the ability to manage layers directly on the canvas, including layer ordering, hiding/showing layers, and locking layers.
  • Guidelines and Snap-to-Grid: Introduce customizable grid overlays and snapping functionality to assist with precise element placement.
  • Customizable Keyboard Shortcuts: Enable users to customize shortcuts for all actions, offering flexibility and adaptability for various workflows.

🛠 Planned Features

  • Multi-Select Enhancements: Improve multi-selection capabilities to allow grouped transformations (e.g., scaling, rotating) and uniform property adjustments (e.g., color, opacity) across multiple elements.
  • History and Undo/Redo Stack: Build an internal history stack to enable undo/redo functionality, allowing users to revert or reapply changes.
  • Text Manipulation: Enhance text editing capabilities with options for rich text formatting, including font style, alignment, and paragraph spacing.
  • Export and Import Settings: Allow users to save their canvas settings, shortcuts, and configurations to easily load them in new projects.