AugusteVN.Modules.Sponsorships._Shared.Spa 1.0.7

dotnet add package AugusteVN.Modules.Sponsorships._Shared.Spa --version 1.0.7
                    
NuGet\Install-Package AugusteVN.Modules.Sponsorships._Shared.Spa -Version 1.0.7
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="AugusteVN.Modules.Sponsorships._Shared.Spa" Version="1.0.7" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="AugusteVN.Modules.Sponsorships._Shared.Spa" Version="1.0.7" />
                    
Directory.Packages.props
<PackageReference Include="AugusteVN.Modules.Sponsorships._Shared.Spa" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add AugusteVN.Modules.Sponsorships._Shared.Spa --version 1.0.7
                    
#r "nuget: AugusteVN.Modules.Sponsorships._Shared.Spa, 1.0.7"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package AugusteVN.Modules.Sponsorships._Shared.Spa@1.0.7
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=AugusteVN.Modules.Sponsorships._Shared.Spa&version=1.0.7
                    
Install as a Cake Addin
#tool nuget:?package=AugusteVN.Modules.Sponsorships._Shared.Spa&version=1.0.7
                    
Install as a Cake Tool

AugusteVN.Modules.Sponsorships._Shared.Spa

Blazor components, state management, and HTTP client for sponsor segment display and management in SPA/Blazor frontends.

Part of the AugusteVN Modules collection.

Extension Method

AddSponsorshipsSharedSpa(this IServiceCollection, IConfiguration, Action<string, Dictionary<string, int>>)

Registers the Sponsorships SPA layer:

  • Permissions — Invokes the addPermissions callback with nameof(Sponsorships) and the permissions dictionary for frontend claims registration
  • SponsorSegmentsState — Scoped reactive state provider (extends StateChangeProvider)
  • SponsorSegmentsHttpClient — Scoped HTTP client for all SponsorSegments API calls
// Program.cs
builder.Services.AddSponsorshipsSharedSpa(builder.Configuration, addPermissions: (module, dict) =>
{
    // Register permissions for frontend authorization
});

Services

SponsorSegmentsState

Reactive state provider (StateChangeProvider) for sponsor segment UI:

Property Type Description
SponsorSegments List<SponsorSegmentResponse>? Cached list of loaded sponsor segments
PaginationMetadata PaginationMetadata? Current pagination state for lazy loading
SelectedSponsorSegment SponsorSegmentResponse? Currently selected segment (notifies on change)
SponsorSegmentMarkdown string Default Markdown content for the sponsor segment editor

SponsorSegmentsHttpClient

HTTP client wrapping all SponsorSegments API endpoints:

Method Description
InitSponsorSegmentsAsync(pageSize, force?) Loads the first page of sponsor segments into state (skips if already loaded unless force=true)
InitMoreSponsorSegmentsAsync(pageSize) Loads the next page and appends to the existing list
GetPaginatedSponsorSegmentsAsync(request) Fetches a paginated list from the API
InitSelectedSponsorSegmentAsync(request, force?) Loads a single segment by ID into state (uses cache unless force=true)
GetSponsorSegmentByIdAsync(request) Fetches a single segment by ID from the API
GetSponsorSegmentForContentAsync(request) Fetches the sponsor segment for a blog post slug
CreateSponsorSegmentAsync(request) POSTs a new sponsor segment
UpdateSponsorSegmentAsync(request) PUTs an update to an existing sponsor segment

Components

GetSponsorSegments

Iterates over all loaded sponsor segments and renders each via a RenderFragment<SponsorSegmentResponse> child content template. Automatically initializes segments on first render.

Parameter Type Default Description
PageSize int? 5 Number of segments to fetch per page
Limit int? null Optional maximum number of segments to display
IncludeDrafts bool false Whether to include unpublished drafts
ChildContent RenderFragment<SponsorSegmentResponse> Template for each segment

LoadMoreSponsorSegmentsBtn

Button component that loads the next page of sponsor segments via InitMoreSponsorSegmentsAsync. Disables automatically when all pages are loaded.

GetSponsorSegmentById

Loads and renders a single sponsor segment by ID.

GetSponsorSegmentForContent

Loads and renders the sponsor segment associated with a specific blog post slug.

CreateSponsorSegmentForm

Full sponsor segment creation form with:

  • Markdown textarea with character counter (400 char limit)
  • Brand name and email fields
  • FluentValidation integration via FluentValidationValidator
  • Terms-of-service gating via IsTosCompleted parameter
  • Live Markdown preview via SponsorSegmentMarkdown state binding
  • TrackingRequest support for user/session tracking
Parameter Type Default Description
BtnLabel string? "Order" Submit button label
IsTosCompleted bool false Whether TOS checkbox is checked
TrackingData TrackingRequest? null Tracking context for analytics
OnCreated EventCallback<CreateSponsorSegmentRequest> Fires after successful creation

UpdateSponsorSegmentForm

Form for editing an existing sponsor segment.

SponsorSegmentPreview

Reactive Markdown-to-HTML preview component. Listens to SponsorSegmentMarkdown state changes and renders the HTML via SponsorSegmentTemplate. Falls back to the default state Markdown when no explicit value is provided.

Parameter Type Description
Title string? Optional heading for the preview
SponsorSegmentMarkdown string? Markdown content to preview (falls back to state default)
ChildContent RenderFragment? Additional content below the preview
OnPreviewChanged EventCallback Fires when the preview updates

SponsorSegmentFooter

Footer component displaying segment metadata (brand name, email, creation date, review status) with a styled separator. Review status is color-coded: green for approved, red for declined, grey for cancelled, yellow for pending.

Parameter Type Description
SponsorSegment SponsorSegmentResponse The segment to display metadata for
ChildContent RenderFragment? Additional footer content

Installation

dotnet add package AugusteVN.Modules.Sponsorships._Shared.Spa

Full Documentation

See the Sponsorships Module README for complete documentation.

Product Compatible and additional computed target framework versions.
.NET net10.0 is compatible.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.0.7 84 8/9/2026
1.0.6 77 8/9/2026
1.0.2 83 8/8/2026
1.0.1 78 8/8/2026
1.0.0 90 8/8/2026