Weave.js

WeaveFrameToolAction

Allows to add a canvas in canvas area

Overview

The WeaveFrameToolAction class that allows users to create a new Frame node by clicking and dragging on the canvas. A frame acts as a visual container for organizing other nodes and structuring the workspace—similar to sections, groups, or modules in visual editors.

This action enables an intuitive, drag-to-create experience for defining new framed areas, which are immediately editable and collaborative.

Each interaction results in the creation of a WeaveFrameNode, which can be moved and synchronized across all connected users.

The class extends the WeaveAction class.

Name

This action name property value is frameTool.

Import

import { WeaveFrameToolAction } from "@inditextech/weave-sdk";

Instantiation

new WeaveFrameToolAction();

TypeScript types

type WeaveFrameToolActionTriggerParams = {
  title?: string;
  frameWidth?: number;
  frameHeight?: number;
  frameOrientation?: string;
  frameType?: string;
};

Trigger function params

trigger(cancelAction: () => void, params?: WeaveFrameToolActionTriggerParams): void;

For WeaveFrameToolActionTriggerParams:

Property Type Required Default Description

title

string

Frame XXX

The title of the Frame.

frameWidth

number

1485

The frame format width (px) for the Frame.

frameHeight

number

1050

The frame format height (px) for the Frame.

frameOrientation

string

landscape

The frame format orientation (landscape or portrait) for the Frame.

frameType

string

A4

The frame format type (A1, A2, A3, A4 or custom) for the Frame.