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
    • 2.0 Upgrade Common Issues
  • Open API

    • OpenAPI Doc

2.0 Upgrade Common Issues

Code Compatibility Check

  1. The find series APIs are deprecated. Please use findAsync and other interfaces instead. Example:
const adapt_findAll = async (node: any, cb?: (node: any) => boolean) => {
  if (pixso.apiVersion === "1.0.0") {
    return node.findAll(cb);
  } else {
    return (await (node as any).findAllAsync()).filter(cb);
  }
};
  1. 2.0 plugin iframe has been changed to null origin iframe. When passing data from UI to plugin code, you need to explicitly specify parentOrigin as *
window.parent.postMessage({ pluginMessage: "This is a message" }, "*");

Other Issues

  1. The host configuration in manifest has been deprecated
  // Old configuration, no longer supported
  "main": {
    "sandbox": "dist/main.js",
    "host": "dist/host.js"
  }
  // New configuration
  "main": "dist/main.js"