#pragma once

#include "../CommandHistory.h"
#include <pxr/usd/usd/stage.h>
#include <pxr/usd/sdf/path.h>
#include <pxr/base/gf/vec2f.h>
#include <string>

namespace UsdLayerManager {

/// Creates a UsdShadeShader prim with the given Sdr shader identifier and
/// authors its canvas position as uiPosition custom data (see
/// docs/adr — Material Editor node-graph layout is stored as prim
/// customData, not scene data, so it never affects composition/renders).
class CreateShaderNodeCommand : public ICommand {
public:
    CreateShaderNodeCommand(pxr::UsdStageRefPtr stage,
                            const pxr::SdfPath&  path,
                            const std::string&   shaderId,
                            const pxr::GfVec2f&  uiPosition);

    void Execute() override;
    void Undo()    override;
    std::string GetDescription() const override { return m_description; }

private:
    pxr::UsdStageRefPtr m_stage;
    pxr::SdfPath        m_path;
    std::string         m_shaderId;
    pxr::GfVec2f        m_uiPosition;
    std::string         m_description;
};

} // namespace UsdLayerManager
