mirror of
https://github.com/whoswhip/Sharpbin.git
synced 2026-12-06 02:48:43 +00:00
feat(modal): refactor modal types and integrate security action requirements
This commit is contained in:
@@ -1,39 +1,5 @@
|
||||
import { writable } from 'svelte/store';
|
||||
|
||||
type ModalMode =
|
||||
| 'decrypt'
|
||||
| 'encrypt'
|
||||
| 'confirm'
|
||||
| 'prompt'
|
||||
| 'multiselect'
|
||||
| 'totp'
|
||||
| 'totpSetup'
|
||||
| 'report';
|
||||
|
||||
type ModalItem = { label: string; value: unknown };
|
||||
|
||||
type ModalState = {
|
||||
show: boolean;
|
||||
mode: ModalMode;
|
||||
title: string;
|
||||
message: string;
|
||||
error: string;
|
||||
placeholder: string;
|
||||
inputType: string;
|
||||
maxInputLength?: number;
|
||||
items: ModalItem[];
|
||||
initialValue: unknown;
|
||||
totpActive: boolean | null;
|
||||
reportTarget: 'user' | 'paste' | null;
|
||||
reportTargetId: string | number | null;
|
||||
reportSiteKey: string | null;
|
||||
confirmButtonText: string;
|
||||
};
|
||||
|
||||
type ModalOpenOptions = Partial<Omit<ModalState, 'show'>> & {
|
||||
mode: ModalMode;
|
||||
cancelValue?: unknown;
|
||||
};
|
||||
import type { ModalOpenOptions, ModalState } from '$lib/types/modal';
|
||||
|
||||
const initialState: ModalState = {
|
||||
show: false,
|
||||
|
||||
Reference in New Issue
Block a user