foo-webview-sdk
    Preparing search index...

    Function buildMenuItems

    • Recursive menu-item builder shared by ContextMenuManager and MainMenuManager.

      • Walks items depth-first, allocating a new id from state.nextId++ for each leaf command.
      • Maps each allocated id to the identifier state.family can actually dispatch, inside state.idMap, so callers can later dispatch via ExecuteByID. Items offering no such identifier stay unmapped.
      • Stops once state.limit is hit (when set).

      Pure function: never mutates the input items.

      Parameters

      Returns SmpStructuredMenuItem[]