ContextMenuCondition: string | (target: HTMLElement) => boolean

A context-menu predicate. Two forms are accepted:

  • string — evaluated as a SafeExpression (see sohl.entity.expr.SafeExpression) against a context with target (the triggering HTMLElement) plus lazy itemLogic and actorLogic getters resolved from the nearest data-item-id / data-actor-id ancestor (the logic layer, not the raw documents). Examples: "true", "itemLogic.canTransmit", "defined(itemLogic) && itemLogic.type === 'skill'". This is the form stored in document data.
  • function — a (target) => boolean predicate, passed through unchanged. Used for entries built programmatically (e.g. from a SohlAction's trigger), where the predicate needs to close over runtime state that a SafeExpression source can't reference.