@termun/core - v0.0.0
    Preparing search index...

    Class MenuEditor

    Hierarchy (View Summary)

    Index

    Constructors

    • Creates a new editor menu that opens the system $EDITOR with pre-populated content.

      Parameters

      • data: MenuEditorJson

        Menu JSON including name, type, optional default content (static or dynamic), and editor-specific configs.

      Returns MenuEditor

    Methods

    • Returns the last submitted editor content, or empty string if never run.

      Returns string

    • Resolves the default content: evaluates the function if dynamic, returns the string if static.

      Returns string

    • Sets the default content pre-populated in the editor. Accepts a static string or a function evaluated each time the editor opens.

      Parameters

      Returns this

    • Sets the configs from an instance or a plain JSON object.

      Parameters

      Returns this

    • Sets the configs from an instance or a plain JSON object.

      Parameters

      Returns this

    • Opens the system $EDITOR with the default content pre-populated. Returns the edited content string.

      Parameters

      • Optionallanguage: string

        Optional language override for label translation.

      Returns Promise<string>

    • Returns the menu's unique name.

      Returns string

    • Returns the menu type: "choice", "input", "field", or "editor".

      Returns "input" | "field" | "choice" | "editor"

    • Returns the plugin namespace this menu belongs to, or undefined for the default plugin.

      Returns string | undefined

    • Sets the plugin namespace for this menu.

      Parameters

      • plugin: string | undefined

        Plugin name string.

      Returns this

    • Returns the display order index, or undefined if not set.

      Returns number | undefined

    • Sets the display order index.

      Parameters

      • index: number | undefined

        Numeric sort position.

      Returns this

    • Returns all registered parent names as a flat array.

      Returns string[]

    • Returns the parent entry matching the given name, or undefined.

      Parameters

      • name: string

        Parent name to look up.

      Returns string | undefined

    • Registers a parent menu name.

      Parameters

      • name: string

        Parent name to add.

      Returns this

    • Returns true when this menu is accessible from every context.

      Returns boolean

    • Returns true when this menu is the anchor point of a wizard/flow. Global actions that target this menu will be hidden in this menu and in all its descendants, resolved through the regular parents chain.

      Returns boolean

    • Sets the styles for this menu from an instance or a plain JSON object.

      Parameters

      • styles: MenuStyles

        MenuStyles instance or compatible JSON.

      Returns this

    • Sets the styles for this menu from an instance or a plain JSON object.

      Parameters

      Returns this

    • Sets the labels for this menu from an instance or a plain JSON object.

      Parameters

      • labels: MenuLabels

        MenuLabels instance or compatible JSON.

      Returns this

    • Sets the labels for this menu from an instance or a plain JSON object.

      Parameters

      Returns this

    Properties

    type: "input" | "field" | "choice" | "editor" = "editor"
    labels: MenuLabels
    default: string | MenuEditorDefaultFn = ""
    value: string = ""
    configs: MenuEditorConfigs = ...
    name: string
    plugin?: string
    parents: Record<string, Exclude<MenuJson["parents"], undefined>[number]> = {}
    index: number | undefined
    global: boolean
    anchorGlobal: boolean
    styles: MenuStyles