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

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

      • Overview
      • Global Object

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

        • BooleanOperationNode
        • ComponentNode
        • ComponentSetNode
        • DocumentNode
        • EllipseNode
        • 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 plug-in must include. Various important information about the plug-in 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

Plug-in name

id

  • Type: id: string

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

main

  • Type: main: string

The value of main needs to be a relative path, used to specify the JS script running in the plug-in 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 plug-in to create multiple command entries. The plug-in'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 plug-in, which will be displayed in the plug-in 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 plug-in 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 plug-in 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