A component (models.Component, component.graphql) is a named HTML box. "+ New box" now lists components and places a copy, as it did with the hard-coded starters; the canvas's new Components button (ComponentPanel) can also place one linked. A linked box has Box.componentId, its row's html is nil, and the resolvers fill in the component's html before answering (fillLinked), so saving the html in the box editor saves the component and every linked box on every page changes. Only the html is shared: title, geometry, frame and visibility stay each box's own. The box editor gains "Save as component" (makes one from an html box and links it) and, on a linked box, a banner with Detach (gives the box its own copy). updateBox refuses html on a linked box. Deleting a component detaches its boxes first, so no page changes. Layouts store the link and the html; loading relinks only if the component still exists. The built-in starters in templates.js are no longer listed directly: "Import built-ins" in the panel creates them as components (skipping names already taken), so they can be edited and deleted like the rest. The html helpers there are unchanged. Everything is @admin. Co-Authored-By: Claude Opus 5.5 <[email protected]>
209 lines
5.4 KiB
Go
209 lines
5.4 KiB
Go
// Code generated by github.com/99designs/gqlgen, DO NOT EDIT.
|
|
|
|
package model
|
|
|
|
import (
|
|
"time"
|
|
|
|
"adam-french.co.uk/backend/models"
|
|
)
|
|
|
|
type AuthPayload struct {
|
|
User *models.User `json:"user"`
|
|
}
|
|
|
|
type BackgroundInput struct {
|
|
Color string `json:"color"`
|
|
Image string `json:"image"`
|
|
Fit string `json:"fit"`
|
|
}
|
|
|
|
type CreateActivityInput struct {
|
|
Type string `json:"type"`
|
|
Name string `json:"name"`
|
|
Link *string `json:"link,omitempty"`
|
|
}
|
|
|
|
type CreateBookmarkInput struct {
|
|
Category string `json:"category"`
|
|
Name string `json:"name"`
|
|
Link string `json:"link"`
|
|
}
|
|
|
|
type CreateBoxInput struct {
|
|
Page string `json:"page"`
|
|
Kind string `json:"kind"`
|
|
Widget *string `json:"widget,omitempty"`
|
|
HTML *string `json:"html,omitempty"`
|
|
Title *string `json:"title,omitempty"`
|
|
X *int `json:"x,omitempty"`
|
|
Y *int `json:"y,omitempty"`
|
|
W *int `json:"w,omitempty"`
|
|
H *int `json:"h,omitempty"`
|
|
Z *int `json:"z,omitempty"`
|
|
Framed *bool `json:"framed,omitempty"`
|
|
HideOnMobile *bool `json:"hideOnMobile,omitempty"`
|
|
AdminOnly *bool `json:"adminOnly,omitempty"`
|
|
ComponentID *int `json:"componentId,omitempty"`
|
|
}
|
|
|
|
type CreateComponentInput struct {
|
|
Name string `json:"name"`
|
|
Title *string `json:"title,omitempty"`
|
|
HTML string `json:"html"`
|
|
W *int `json:"w,omitempty"`
|
|
H *int `json:"h,omitempty"`
|
|
Framed *bool `json:"framed,omitempty"`
|
|
AdminOnly *bool `json:"adminOnly,omitempty"`
|
|
}
|
|
|
|
type CreateFavoriteInput struct {
|
|
Type string `json:"type"`
|
|
Name string `json:"name"`
|
|
Link *string `json:"link,omitempty"`
|
|
}
|
|
|
|
type CreateLayoutInput struct {
|
|
Name string `json:"name"`
|
|
Page string `json:"page"`
|
|
}
|
|
|
|
type CreatePageInput struct {
|
|
Slug string `json:"slug"`
|
|
Title string `json:"title"`
|
|
AdminOnly *bool `json:"adminOnly,omitempty"`
|
|
}
|
|
|
|
type CreatePlaceInput struct {
|
|
Title string `json:"title"`
|
|
Location *string `json:"location,omitempty"`
|
|
Notes *string `json:"notes,omitempty"`
|
|
ImageURL *string `json:"imageUrl,omitempty"`
|
|
Category *string `json:"category,omitempty"`
|
|
Cost *string `json:"cost,omitempty"`
|
|
Priority *int `json:"priority,omitempty"`
|
|
Done *bool `json:"done,omitempty"`
|
|
}
|
|
|
|
type CreatePostInput struct {
|
|
Title string `json:"title"`
|
|
Content string `json:"content"`
|
|
}
|
|
|
|
type CreateUserInput struct {
|
|
Username string `json:"username"`
|
|
Password string `json:"password"`
|
|
}
|
|
|
|
type GiteaFeedItem struct {
|
|
AvatarURL string `json:"avatarUrl"`
|
|
RepoURL string `json:"repoUrl"`
|
|
RepoName string `json:"repoName"`
|
|
OpType string `json:"opType"`
|
|
CommitMessage string `json:"commitMessage"`
|
|
CreatedAt time.Time `json:"createdAt"`
|
|
}
|
|
|
|
type LoginInput struct {
|
|
Username string `json:"username"`
|
|
Password string `json:"password"`
|
|
}
|
|
|
|
type Mutation struct {
|
|
}
|
|
|
|
type Query struct {
|
|
}
|
|
|
|
type SpotifyAlbum struct {
|
|
Name string `json:"name"`
|
|
Images []*SpotifyImage `json:"images"`
|
|
}
|
|
|
|
type SpotifyArtist struct {
|
|
Name string `json:"name"`
|
|
}
|
|
|
|
type SpotifyImage struct {
|
|
URL string `json:"url"`
|
|
}
|
|
|
|
type SpotifyPlaying struct {
|
|
Playing bool `json:"playing"`
|
|
Track *SpotifyTrack `json:"track,omitempty"`
|
|
}
|
|
|
|
type SpotifyRecentItem struct {
|
|
Track *SpotifyTrack `json:"track"`
|
|
PlayedAt time.Time `json:"playedAt"`
|
|
}
|
|
|
|
type SpotifyTrack struct {
|
|
Name string `json:"name"`
|
|
Artists []*SpotifyArtist `json:"artists"`
|
|
Album *SpotifyAlbum `json:"album"`
|
|
}
|
|
|
|
type SteamGame struct {
|
|
AppID int `json:"appId"`
|
|
Name string `json:"name"`
|
|
Playtime2Weeks int `json:"playtime2Weeks"`
|
|
PlaytimeForever int `json:"playtimeForever"`
|
|
HeaderImageURL string `json:"headerImageUrl"`
|
|
}
|
|
|
|
type SteamStatus struct {
|
|
Online bool `json:"online"`
|
|
RecentGames []*SteamGame `json:"recentGames"`
|
|
}
|
|
|
|
type UpdateBoxInput struct {
|
|
Widget *string `json:"widget,omitempty"`
|
|
HTML *string `json:"html,omitempty"`
|
|
Title *string `json:"title,omitempty"`
|
|
X *int `json:"x,omitempty"`
|
|
Y *int `json:"y,omitempty"`
|
|
W *int `json:"w,omitempty"`
|
|
H *int `json:"h,omitempty"`
|
|
Z *int `json:"z,omitempty"`
|
|
Framed *bool `json:"framed,omitempty"`
|
|
HideOnMobile *bool `json:"hideOnMobile,omitempty"`
|
|
AdminOnly *bool `json:"adminOnly,omitempty"`
|
|
}
|
|
|
|
type UpdateComponentInput struct {
|
|
Name *string `json:"name,omitempty"`
|
|
Title *string `json:"title,omitempty"`
|
|
HTML *string `json:"html,omitempty"`
|
|
W *int `json:"w,omitempty"`
|
|
H *int `json:"h,omitempty"`
|
|
Framed *bool `json:"framed,omitempty"`
|
|
AdminOnly *bool `json:"adminOnly,omitempty"`
|
|
}
|
|
|
|
type UpdateLayoutInput struct {
|
|
Name *string `json:"name,omitempty"`
|
|
}
|
|
|
|
type UpdatePageInput struct {
|
|
Slug *string `json:"slug,omitempty"`
|
|
Title *string `json:"title,omitempty"`
|
|
AdminOnly *bool `json:"adminOnly,omitempty"`
|
|
}
|
|
|
|
type UpdatePlaceInput struct {
|
|
Title *string `json:"title,omitempty"`
|
|
Location *string `json:"location,omitempty"`
|
|
Notes *string `json:"notes,omitempty"`
|
|
ImageURL *string `json:"imageUrl,omitempty"`
|
|
Category *string `json:"category,omitempty"`
|
|
Cost *string `json:"cost,omitempty"`
|
|
Priority *int `json:"priority,omitempty"`
|
|
Done *bool `json:"done,omitempty"`
|
|
}
|
|
|
|
type UpdatePostInput struct {
|
|
Title string `json:"title"`
|
|
Content string `json:"content"`
|
|
}
|