Pixso Open Documentation
guide
  • 中文
  • English
guide
  • 中文
  • English
  • Plugin API

    • Introduction
    • Prerequisites
    • manifest
    • Development Guide
    • Change Log
    • Plugin API Documentation

      • Overview
      • Global Object

        • pixso
        • pixso.ui
        • pixso.host
        • pixso.mouse
        • pixso.editor
        • pixso.codegen
        • pixso.keyboard
        • pixso.fieldset
        • pixso.viewport
        • pixso.vectorEditor
        • pixso.clientStorage
        • pixso.serverStorage
      • Node Types

        • BooleanOperationNode
        • ComponentNode
        • ComponentSetNode
        • DocumentNode
        • EllipseNode
        • FolderNode
        • FrameNode
        • GroupNode
        • InstanceNode
        • LineNode
        • PageNode
        • PolygonNode
        • RectangleNode
        • SectionNode
        • SliceNode
        • StarNode
        • TextNode
        • VectorNode
      • Data Types

        • Action
        • ArcData
        • BlendMode
        • CommandItem
        • ComponentProperties-Related
        • Constraints
        • DialogType
        • DocumentationLink
        • Effect
        • EmbedData
        • ExportSettings
        • FontName
        • Guide
        • HandleMirroring
        • HyperlinkTarget
        • Image
        • LayoutGrid
        • LetterSpacing
        • Library
        • LineHeight
        • NodeChangeProperty
        • OverflowDirection
        • Overlay
        • Paint
        • PublishStatus
        • Reaction
        • Rect-related
        • RGB & RGBA
        • StrokeCap
        • StrokeJoin
        • StyleChangeProperty
        • TextCase
        • TextDecoration
        • TextListOptions
        • ThemeType
        • ToolType
        • Transition
        • Trigger
        • Vector
    • Host API Documentation

      • Overview
      • Host API
  • Open API

    • OpenAPI Doc

manifest

The manifest.json is a file that every Pixso plugin must include. Various important information about the plugin is defined in the file.

Here is an example of the manifest.json content:

{
  "name": "pixso-plugin",
  "id": "123456",
  "main": "./main.js",
  "ui": "./ui.html",
  "menu": [
    {
      "name": "Main",
      "command": "main"
    },
    {
      "name": "Test",
      "command": "test"
    }
  ]
}
// Note: The example only shows part of the configuration fields. Please see the following content for the complete configuration fields.

name

  • Type: name: string

Plugin name

id

  • Type: id: string

Plugin id, usually does not need to be specified manually. When publishing the plugin, a unique id value will be generated. In the plugin development and debugging scenario, you need to set an id of type string so that the debugging part can use the plugin id for the API function of data isolation.

editorType

  • Type: editorType: Array<"pixso" | "dev" | "historyDev" | "singleFrame">

Used to specify the running mode supported by the current plugin. A plugin can support multiple modes (New Features of Pixso 2.0). The specific modes are defined as follows:

  • "pixso": Edit Mode
  • "dev": Dev Mode
  • "historyDev": Historical Dev Mode
  • "singleFrame": Single Frame Mode

If editorType is not specified, it defaults to the plugin in edit mode.

In Pixso's plugin list, only plugins that support running in the current mode will be displayed;

main

  • Type: main: string

The value of main needs to be a relative path, used to specify the JS script running in the plugin sandbox environment.

ui

  • Type: ui: string

Similar to main, it is used to specify the path of the HTML file to be loaded by the user interface.

menu

  • Type: menu?: ManifestMenuItem[]

The menu option is a json array. Setting menu can add submenu entries to the plugin to create multiple command entries. The plugin's run event will be triggered at runtime, and its parameter is the command value set in the selected menu. This value can also be obtained through pixso.command.

type ManifestMenuItem =
  | { name: string; command: string }
  | { name: string; menu: ManifestMenuItem[] }
  | { separator: true };

relaunchButtons

  • Type: relaunchButtons?: ManifestRelaunchButton[]

relaunchButtons is used to configure the restart button of the plugin, which will be displayed in the plugin panel on the right in the pixso application. It should be noted that the display of the restart button needs to be used in conjunction with the setRelaunchData API.

type ManifestRelaunchButton = {
  command: string;
  name: string;
  multipleSelection?: boolean;
};
  • command: A command attribute that specifies that when the plugin is run after pressing the button, the value of the running command can be obtained through pixso.command.
  • name: The name of the relaunch button.
  • multipleSelection: The default is false, which means that the relaunch button will only appear when a node is single-selected; when set to true, it means that the relaunch button is allowed to be displayed when multiple nodes are selected.

Currently, the plugin is not yet connected to the debugging function of relaunchButtons under local development and debugging, and it needs to be released before it can be used normally. The corresponding debugging functions will be improved in the future.

HWDC

enableStartByDefault

  • Type: enableStartByDefault?: boolean

enableStartByDefault determines whether the plugin supports configuration as the default plugin. If the plugin supports configuration, after installing the plugin, the user can configure the default plugin in the Plugin Management -> Default Settings menu.

enableStartByShortcut

  • Type: enableStartByShortcut?: boolean

enableStartByShortcut determines whether the plugin supports starting through shortcut keys. If the plugin supports quick startup, after installing the plugin, the user can directly invoke the plugin through the M key.

priority

  • Type: priority?: number

There may be multiple plugins configured with enableStartByShortcut to support shortcut key startup. priority can determine which plugin should be invoked first. The larger the priority value, the higher the priority of the plugin.

Prev
Prerequisites
Next
Development Guide