Edit context rules

The edit context is the scope in which selection and edit operations must occur:

  • If the user has drilled down into a container node, that container is the current edit context and only its immediate children are in scope for selection/editing.
  • If the user hasn't drilled into any container nodes, then XD is in the root edit context, and its scope includes all immediate children of the pasteboard (including Artboards), and all immediate children of all those Artboards.

Like nearly all edit operations in XD, your plugin is limited to making changes inside the scope of the current edit context.

diagram of Edit Contexts
Figure: diagram of Edit Contexts

Simple changes can be made directly to the scenegraph nodes that are in scope:

  • Change a property
  • Delete a node
  • Add a new leaf node (basic shape node)

Structural changes cannot be made directly, since their impact extends to nodes outside the edit context's scope. You can make structural changes by scripting XD commands:

If a plugin breaks any of these rules, its entire edit operation will be reverted to protect the user's document from corruption.

results matching ""

    No results matching ""