components

package
v0.2.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 28, 2022 License: AGPL-3.0 Imports: 10 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Autofocused

type Autofocused struct {
	app.Compo

	Disable   bool   // Disable the focus
	Component app.UI // The component to be focused
}

Autofocused calls `focus` on the encapsulated component after it is mounted

func (*Autofocused) OnMount

func (c *Autofocused) OnMount(ctx app.Context)

func (*Autofocused) Render

func (c *Autofocused) Render() app.UI

type ConfirmationModal

type ConfirmationModal struct {
	app.Compo

	ID          string // HTML ID of the modal; must be unique across the page
	Icon        string // Class of the icon to use to the left of the title; may be empty
	Title       string // Title of the modal
	Class       string // Class to be applied to the modal's outmost component
	Body        string // Body text of the modal
	ActionClass string // Class to be applied to the modal's primary action
	ActionLabel string // Text to display on the modal's primary action
	CancelLabel string // Text to display on the modal's cancel action
	CancelLink  string // Link to display as the cancel action; if empty, `OnClose` is being called

	OnClose  func() // Handler to call when closing/cancelling the modal
	OnAction func() // Handler to call when triggering the modal's primary action
}

ConfirmationModal is a modal with callbacks intended to enable confirm destructive operations such as deleting something

func (*ConfirmationModal) Render

func (c *ConfirmationModal) Render() app.UI

type Controlled

type Controlled struct {
	app.Compo

	Component  app.UI                 // The component to be focused
	Properties map[string]interface{} // Map of properties to set
}

Controlled sets DOM properties of the encapsulated component after it is mounted

func (*Controlled) OnUpdate

func (c *Controlled) OnUpdate(ctx app.Context)

func (*Controlled) Render

func (c *Controlled) Render() app.UI

type CreateKeyModal

type CreateKeyModal struct {
	app.Compo

	OnSubmit func(
		fullName string,
		email string,
		password string,
	) // Handler to call to create the key
	OnCancel func(dirty bool, clear chan struct{}) // Handler to call when closing/cancelling the modal
	// contains filtered or unexported fields
}

CreateKeyModal is a modal which provides the information needed to create a key

func (*CreateKeyModal) Render

func (c *CreateKeyModal) Render() app.UI

type DecryptAndVerifyModal

type DecryptAndVerifyModal struct {
	app.Compo

	Keys []PGPKey // PGP keys to be available for decryption/verification

	OnSubmit func(
		file []byte,
		publicKeyID string,
		privateKeyID string,
		detachedSignature []byte,
	) // Handler to call to decrypt/verify
	OnCancel func(dirty bool, clear chan struct{}) // Handler to call when closing/cancelling the modal
	// contains filtered or unexported fields
}

DecryptAndVerifyModal is a modal to provide the information needed to decrypt/verify something

func (*DecryptAndVerifyModal) Render

func (c *DecryptAndVerifyModal) Render() app.UI

type DownloadOrViewModal

type DownloadOrViewModal struct {
	app.Compo

	SubjectA          bool   // Whether to display the first subject to download or view
	SubjectANoun      string // Noun form the first subject to download or view (i.e. "signature")
	SubjectAAdjective string // Adjective of the first subject to download or view (i.e. "signed")

	SubjectB          bool   // Whether to display the second subject to download or view
	SubjectBNoun      string // Noun form the second subject to download or view (i.e. "signature")
	SubjectBAdjective string // Adjective of the second subject to download or view (i.e. "signed")

	OnClose    func(used bool) // Handler to call when closing/cancelling the modal
	OnDownload func()          // Handler to call to download the subject(s)
	OnView     func()          // Handler to view to download the subject(s)

	ShowView bool // Whether to show the view action
	// contains filtered or unexported fields
}

DownloadOrViewModal is a modal which provides the actions needed to download or view text

func (*DownloadOrViewModal) Render

func (c *DownloadOrViewModal) Render() app.UI

type EmptyState

type EmptyState struct {
	app.Compo

	OnCreateKey func() // OnCreateKey is the handler to call to create a key
	OnImportKey func() // OnCreateKey is the handler to call to import a key
}

EmptyState is the initial placeholder of the key list

func (*EmptyState) Render

func (c *EmptyState) Render() app.UI

type EncryptAndSignModal

type EncryptAndSignModal struct {
	app.Compo

	Keys []PGPKey // PGP keys to be available for encryption/signing

	OnSubmit func(
		file []byte,
		publicKeyID string,
		privateKeyID string,
		createDetachedSignature bool,
		armor bool,
	) // Handle to call to encrypt/sign
	OnCancel func(dirty bool, clear chan struct{}) // Handler to call when closing/cancelling the modal
	// contains filtered or unexported fields
}

EncryptAndSignModal is a modal which provides the information needed to encrypt/sign something

func (*EncryptAndSignModal) Render

func (c *EncryptAndSignModal) Render() app.UI

type ErrorModal

type ErrorModal struct {
	app.Compo

	ID          string // HTML ID of the modal; must be unique across the page
	Icon        string // Class of the icon to use to the left of the title; may be empty
	Title       string // Title of the modal
	Class       string // Class to be applied to the modal's outmost component
	Body        string // Body text of the modal
	Error       error  // The error display (must not be nil)
	ActionLabel string // Text to display on the modal's primary action

	OnClose  func() // Handler to call when closing/cancelling the modal
	OnAction func() // Handler to call when triggering the modal's primary action
}

ErrorModal is a modal to display an error

func (*ErrorModal) Render

func (c *ErrorModal) Render() app.UI

type ExportKeyModal

type ExportKeyModal struct {
	app.Compo

	PublicKey           bool                           // Whether to display the options for a public key
	OnDownloadPublicKey func(armor, base64encode bool) // Handler to call to download the public key
	OnViewPublicKey     func(armor, base64encode bool) // Handler to call to view the public key

	PrivateKey           bool                           // Whether to display the options for a private key
	OnDownloadPrivateKey func(armor, base64encode bool) // Handler to call to download the private key
	OnViewPrivateKey     func(armor, base64encode bool) // Handler to call to view the private key

	OnOK func() // Handler to call when dismissing the modal
	// contains filtered or unexported fields
}

ExportKeyModal is a modal which provides the actions needed to export a key

func (*ExportKeyModal) Render

func (c *ExportKeyModal) Render() app.UI

type FileUpload

type FileUpload struct {
	app.Compo

	ID                         string // HTML ID of the modal; must be unique across the page
	FileSelectionLabel         string // Text to display on the file selection input
	ClearLabel                 string // Text to display on the clear action
	TextEntryInputPlaceholder  string // Placeholder to display in the text input field
	TextEntryInputBlockedLabel string // Text to display in the input if it is blocked (i.e. because a file has been selected)
	FileContents               []byte // Contents of the file selected/text entered

	OnChange func(fileContents []byte) // Handler to call to set `FileContents`
	OnClear  func()                    // Handler to call to clear `FileContents`
	// contains filtered or unexported fields
}

FileUpload provides a way to upload/import a file by entering it's contents or selecting it

func (*FileUpload) Render

func (c *FileUpload) Render() app.UI

type Home

type Home struct {
	app.Compo
	// contains filtered or unexported fields
}

Home is the home page

func (*Home) OnAppUpdate

func (c *Home) OnAppUpdate(ctx app.Context)

func (*Home) OnDismount

func (c *Home) OnDismount()

func (*Home) OnMount

func (c *Home) OnMount(ctx app.Context)

func (*Home) Render

func (c *Home) Render() app.UI

type ImportKeyModal

type ImportKeyModal struct {
	app.Compo

	OnSubmit func(key []byte)                      // Handler to call to import the key
	OnCancel func(dirty bool, clear chan struct{}) // Handler to call when closing/cancelling the modal
	// contains filtered or unexported fields
}

ImportKeyModal is a modal to import keys with

func (*ImportKeyModal) Render

func (c *ImportKeyModal) Render() app.UI

type KeyList

type KeyList struct {
	app.Compo

	Keys []PGPKey // PGP keys to list

	OnExport func(keyID string) // Handler to call to export a PGP key
	OnDelete func(keyID string) // Handler to call to delete a PGP key
	// contains filtered or unexported fields
}

KeyList is a list of PGP keys

func (*KeyList) OnDismount

func (c *KeyList) OnDismount()

func (*KeyList) OnMount

func (c *KeyList) OnMount(ctx app.Context)

func (*KeyList) Render

func (c *KeyList) Render() app.UI
type Modal struct {
	app.Compo

	ID           string   // HTML ID of the modal; must be unique across the page
	Icon         string   // Class of the icon to use to the left of the title; may be empty
	Title        string   // Title of the modal
	Class        string   // Class to be applied to the modal's outmost component
	Body         []app.UI // Body of the modal
	Footer       []app.UI // Footer of the modal
	DisableFocus bool     // Disable auto-focusing the modal; useful if a child component, i.e. an input should be focused instead

	OnClose func() // Handler to call when closing/cancelling the modal
	// contains filtered or unexported fields
}

Modal is a generic modal with a close handler

func (*Modal) OnDismount

func (c *Modal) OnDismount()

func (*Modal) OnMount

func (c *Modal) OnMount(ctx app.Context)

func (*Modal) Render

func (c *Modal) Render() app.UI
type Navbar struct {
	app.Compo
}

Navbar is the primary navigation menu

func (c *Navbar) Render() app.UI

type PGPKey added in v0.1.1

type PGPKey struct {
	ID       string `json:"id"`       // Internal unique ID of the PGP key, i.e. it's fingerprint
	Label    string `json:"label"`    // Displayable ID of the PGP key
	FullName string `json:"fullName"` // Full name of the PGP key's holder
	Email    string `json:"email"`    // Email of the PGP key's holder
	Private  bool   `json:"private"`  // Whether the PGP key is private
	Public   bool   `json:"public"`   // Whether the PGP key is public
	Content  []byte `json:"content"`  // Raw PGP key (Potentially protected or armored)
}

PGPKey is a PGP key an it's metadata

type PasswordModal

type PasswordModal struct {
	app.Compo

	Title         string // Title of the modal
	WrongPassword bool   // Whether the previously entered password was wrong

	ClearWrongPassword func()                // Handler to call when clearing the password
	OnSubmit           func(password string) // Handler to call to submit the password
	OnCancel           func()                // Handler to call when closing/cancelling the modal
	// contains filtered or unexported fields
}

PasswordModal is a modal which allows to user to enter a password

func (*PasswordModal) Render

func (c *PasswordModal) Render() app.UI

type SingleActionModal

type SingleActionModal struct {
	app.Compo

	ID          string // HTML ID of the modal; must be unique across the page
	Icon        string // Class of the icon to use to the left of the title; may be empty
	Title       string // Title of the modal
	Class       string // Class to be applied to the modal's outmost component
	Body        string // Body text of the modal
	ActionLabel string // Text to display on the modal's primary action

	OnClose  func() // Handler to call when closing/cancelling the modal
	OnAction func() // Handler to call when triggering the modal's primary action
}

SingleActionModal is a modal which has only a singular action

func (*SingleActionModal) Render

func (c *SingleActionModal) Render() app.UI

type TextOutputModal

type TextOutputModal struct {
	app.Compo

	Title string               // Title of the modal
	Tabs  []TextOutputModalTab // Tabs to be displayed

	OnClose func() // Handler to call when closing/cancelling the modal
	// contains filtered or unexported fields
}

TextOutputModal is a modal to display multiple text snippets

func (*TextOutputModal) Render

func (c *TextOutputModal) Render() app.UI

type TextOutputModalTab

type TextOutputModalTab struct {
	Language string // Language of the text to be displayed (i.e. text/plain, French etc.)
	Title    string // Title of the text to be displayed
	Body     string // Text to be displayed
}

TextOutputModalTab is a tab which can be displayed in a text output modal

type Toolbar

type Toolbar struct {
	app.Compo

	OnCreateKey func() // Handler to call to create a key
	OnImportKey func() // Handler to call to import a key

	OnEncryptAndSign   func() // Handler to call to encrypt/sign
	OnDecryptAndVerify func() // Handler to call to decrypt/verify
}

Toolbar is the secondary navigation menu and contains most actions

func (*Toolbar) Render

func (c *Toolbar) Render() app.UI

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL