1.0.5 • Published 9 months ago

@imgly/plugin-cutout-library-web v1.0.5

Weekly downloads
-
License
SEE LICENSE IN LI...
Repository
github
Last release
9 months ago

IMG.LY CE.SDK Plugin Cutouts

This plugin introduces adds cutout functionality to the CreativeEditor SDK. It allows users to add a rectangular or elliptical cutout to the scene. It also allows users to cutout the currently selected shape. It registers a custom asset source called ly.img.cutout which then can be added to the dock. It also adds a custom canvas menu entry when a graphic or text block is selected.

Installation

You can install the plugin via npm or yarn. Use the following commands to install the package:

yarn add @imgly/plugin-cutout-library-web
npm install @imgly/plugin-cutout-library-web

Usage

When adding the plugin to the CE.SDK, you can also add an action button to the canvas menu. Further, we provide a utility method for getting a insert entry for the cutout library that adds the cutout library to the dock.

import CreativeEditorSDK from '@cesdk/cesdk-js';
import CutoutLibraryPlugin from '@imgly/plugin-cutout-library-web';

const cesdk = await CreativeEditorSDK.create(container, config);
await cesdk.addDefaultAssetSources();
await cesdk.addDemoAssetSources({ sceneMode: 'Design' });
await cesdk.addPlugin(
  CutoutLibraryPlugin({
    ui: { locations: ['canvasMenu'] }
  })
);
const cutoutAssetEntry = cesdk.ui.getAssetLibraryEntry('ly.img.cutout.entry');
cesdk.ui.setDockOrder([
  ...cesdk.ui.getDockOrder(),
  {
    id: 'ly.img.assetLibrary.dock',
    label: 'Cutout',
    key: 'ly.img.assetLibrary.dock',
    icon: cutoutAssetEntry?.icon,
    entries: ['ly.img.cutout.entry']
  }
]);

await cesdk.createDesignScene();
1.0.5-rc.0

9 months ago

1.0.5

9 months ago

1.0.4

10 months ago

1.0.2

11 months ago

1.0.2-rc.0

11 months ago

1.0.3

11 months ago

1.0.1

11 months ago

1.0.0

12 months ago

0.1.0

1 year ago

0.0.3-rc.1

1 year ago

0.0.3-rc.0

1 year ago

0.0.2

1 year ago