<Project Sdk="Microsoft.NET.Sdk.BlazorWebAssembly">

  <PropertyGroup>
    <TargetFramework>net10.0</TargetFramework>
    <Nullable>enable</Nullable>
    <ImplicitUsings>enable</ImplicitUsings>
    <OverrideHtmlAssetPlaceholders>true</OverrideHtmlAssetPlaceholders>
    <PublishTrimmed>true</PublishTrimmed>
    <InvariantGlobalization>true</InvariantGlobalization>

    <!-- Emit source-generator output to obj/GeneratedFiles so we can inspect the generated
         RenderForm code and keep dev-time diagnostics simple. -->
    <EmitCompilerGeneratedFiles>true</EmitCompilerGeneratedFiles>
    <CompilerGeneratedFilesOutputPath>$(BaseIntermediateOutputPath)GeneratedFiles</CompilerGeneratedFilesOutputPath>

    <!-- Suppress WASM0001 from QuestPDF.Skia native bindings. QuestPDF is used by
         Lumeo.DataGrid's server-side PDF export; the browser never calls it. The
         WASM publish pipeline can't P/Invoke Skia's native callbacks, but that's
         fine because they aren't reachable at runtime here. -->
    <NoWarn>$(NoWarn);WASM0001</NoWarn>
  </PropertyGroup>

  <ItemGroup>
    <PackageReference Include="Blazicons.Bootstrap" Version="3.0.1" />
    <PackageReference Include="Blazicons.Devicon" Version="2.1.9" />
    <PackageReference Include="Blazicons.FlagIcons" Version="2.0.5" />
    <PackageReference Include="Blazicons.FluentUI" Version="3.0.8" />
    <PackageReference Include="Blazicons.FontAwesome" Version="3.0.3" />
    <PackageReference Include="Blazicons.GoogleMaterialDesign" Version="3.0.4" />
    <PackageReference Include="Blazicons.Ionicons" Version="4.0.2" />
    <PackageReference Include="Blazicons.MaterialDesignIcons" Version="3.0.1" />
    <PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly" Version="10.0.6" />
    <PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.DevServer" Version="10.0.6" PrivateAssets="all" />
  </ItemGroup>

  <Target Name="CopyRegistry" BeforeTargets="BeforeBuild">
    <Copy SourceFiles="..\..\src\Lumeo\registry\registry.json"
          DestinationFiles="wwwroot\registry.json"
          SkipUnchangedFiles="true" />
  </Target>

  <Target Name="GenerateLocalSearchIndex" AfterTargets="CopyRegistry">
    <Exec Command="node $(MSBuildProjectDirectory)\..\..\scripts\algolia\generate-local-index.mjs" />
  </Target>

  <ItemGroup>
    <ProjectReference Include="..\..\src\Lumeo\Lumeo.csproj" />
    <!-- Satellite packages — needed so docs pages can render Chart, DataGrid, Scheduler, etc. -->
    <ProjectReference Include="..\..\src\Lumeo.Charts\Lumeo.Charts.csproj" />
    <ProjectReference Include="..\..\src\Lumeo.DataGrid\Lumeo.DataGrid.csproj" />
    <ProjectReference Include="..\..\src\Lumeo.Editor\Lumeo.Editor.csproj" />
    <ProjectReference Include="..\..\src\Lumeo.Scheduler\Lumeo.Scheduler.csproj" />
    <ProjectReference Include="..\..\src\Lumeo.Gantt\Lumeo.Gantt.csproj" />
    <ProjectReference Include="..\..\src\Lumeo.Motion\Lumeo.Motion.csproj" />
    <!-- Opt in to the [LumeoForm] Roslyn source generator so the demo pages can use RenderForm(). -->
    <ProjectReference Include="..\..\src\Lumeo.SourceGenerators\Lumeo.SourceGenerators.csproj"
                      OutputItemType="Analyzer"
                      ReferenceOutputAssembly="false" />
  </ItemGroup>

</Project>
