@platform-blocks/ui 0.5.0 → 0.6.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/cjs/index.js +670 -1744
- package/lib/cjs/index.js.map +1 -1
- package/lib/components/Carousel/types.d.ts +14 -0
- package/lib/components/Dialog/Dialog.d.ts +1 -1
- package/lib/components/Dialog/types.d.ts +23 -2
- package/lib/components/HoverCard/types.d.ts +5 -3
- package/lib/components/Image/Image.d.ts +1 -1
- package/lib/components/Image/types.d.ts +3 -3
- package/lib/components/Input/styles.d.ts +1 -12
- package/lib/components/Layout/Layout.d.ts +1 -0
- package/lib/components/Menu/types.d.ts +2 -2
- package/lib/components/Popover/types.d.ts +7 -5
- package/lib/components/Select/Select.types.d.ts +1 -1
- package/lib/components/Skeleton/types.d.ts +2 -2
- package/lib/components/Switch/styles.d.ts +1 -1
- package/lib/components/Table/Table.d.ts +4 -4
- package/lib/components/TextArea/styles.d.ts +1 -1
- package/lib/components/TextArea/types.d.ts +2 -2
- package/lib/components/Timeline/types.d.ts +20 -0
- package/lib/components/Video/types.d.ts +2 -2
- package/lib/components/Waveform/WaveformSkeleton.d.ts +2 -2
- package/lib/components/Waveform/types.d.ts +2 -2
- package/lib/components/index.d.ts +0 -4
- package/lib/components/types.d.ts +0 -1
- package/lib/core/providers/OverlayProvider.d.ts +1 -1
- package/lib/core/theme/PlatformBlocksProvider.d.ts +1 -5
- package/lib/core/utils/layout.d.ts +13 -16
- package/lib/core/utils/positioning-enhanced.d.ts +2 -0
- package/lib/esm/index.js +672 -1725
- package/lib/esm/index.js.map +1 -1
- package/lib/index.d.ts +0 -11
- package/package.json +67 -57
- package/lib/components/Can/Can.d.ts +0 -30
- package/lib/components/Can/PermissionDemo.d.ts +0 -2
- package/lib/components/Can/ability.d.ts +0 -89
- package/lib/components/Can/builder.d.ts +0 -113
- package/lib/components/Can/context.d.ts +0 -25
- package/lib/components/Can/index.d.ts +0 -6
- package/lib/components/Can/types.d.ts +0 -230
- package/lib/components/HoverCard/index.d.ts +0 -2
- package/lib/components/Lottie/Lottie.d.ts +0 -30
- package/lib/components/Lottie/index.d.ts +0 -2
- package/lib/components/NavigationProgress/NavigationProgress.d.ts +0 -4
- package/lib/components/NavigationProgress/defaults.d.ts +0 -8
- package/lib/components/NavigationProgress/hooks/useNavigationProgressState.d.ts +0 -1
- package/lib/components/NavigationProgress/index.d.ts +0 -2
- package/lib/components/NavigationProgress/styles/resolver.d.ts +0 -1
- package/lib/components/NavigationProgress/tokens.d.ts +0 -4
- package/lib/components/NavigationProgress/types.d.ts +0 -30
- package/lib/components/RichTextEditor/RichTextEditor.d.ts +0 -3
- package/lib/components/RichTextEditor/index.d.ts +0 -2
- package/lib/components/RichTextEditor/styles.d.ts +0 -61
- package/lib/components/RichTextEditor/types.d.ts +0 -150
|
@@ -1,230 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { ViewStyle } from 'react-native';
|
|
3
|
-
/**
|
|
4
|
-
* Possible permission actions
|
|
5
|
-
*/
|
|
6
|
-
export type Action = string;
|
|
7
|
-
/**
|
|
8
|
-
* Subject type - can be string, class, or object
|
|
9
|
-
*/
|
|
10
|
-
type SubjectClass = abstract new (...args: any[]) => unknown;
|
|
11
|
-
type SubjectObject = Record<string, unknown> | object;
|
|
12
|
-
export type Subject = string | SubjectClass | SubjectObject;
|
|
13
|
-
/**
|
|
14
|
-
* Field within a subject
|
|
15
|
-
*/
|
|
16
|
-
export type Field = string;
|
|
17
|
-
/**
|
|
18
|
-
* Conditions for permissions (for object-level permissions)
|
|
19
|
-
*/
|
|
20
|
-
export type Conditions = Record<string, any>;
|
|
21
|
-
/**
|
|
22
|
-
* Permission rule definition
|
|
23
|
-
*/
|
|
24
|
-
export interface PermissionRule {
|
|
25
|
-
/** Action being performed */
|
|
26
|
-
action: Action | Action[];
|
|
27
|
-
/** Subject being acted upon */
|
|
28
|
-
subject: Subject | Subject[];
|
|
29
|
-
/** Fields within the subject (optional) */
|
|
30
|
-
fields?: Field[];
|
|
31
|
-
/** Conditions that must be met (optional) */
|
|
32
|
-
conditions?: Conditions;
|
|
33
|
-
/** Whether this rule grants or denies permission */
|
|
34
|
-
inverted?: boolean;
|
|
35
|
-
/** Human-readable reason for the rule */
|
|
36
|
-
reason?: string;
|
|
37
|
-
}
|
|
38
|
-
/**
|
|
39
|
-
* Permission check result
|
|
40
|
-
*/
|
|
41
|
-
export interface PermissionCheck {
|
|
42
|
-
/** Whether permission is granted */
|
|
43
|
-
allowed: boolean;
|
|
44
|
-
/** Reason for the decision */
|
|
45
|
-
reason?: string;
|
|
46
|
-
/** Matched rule */
|
|
47
|
-
rule?: PermissionRule;
|
|
48
|
-
}
|
|
49
|
-
/**
|
|
50
|
-
* Ability interface for checking permissions
|
|
51
|
-
*/
|
|
52
|
-
export interface Ability {
|
|
53
|
-
/** Check if action is allowed on subject */
|
|
54
|
-
can(action: Action, subject: Subject, field?: Field): boolean;
|
|
55
|
-
/** Check if action is forbidden on subject */
|
|
56
|
-
cannot(action: Action, subject: Subject, field?: Field): boolean;
|
|
57
|
-
/** Get detailed permission check result */
|
|
58
|
-
check(action: Action, subject: Subject, field?: Field): PermissionCheck;
|
|
59
|
-
/** Update ability rules */
|
|
60
|
-
update(rules: PermissionRule[]): void;
|
|
61
|
-
/** Get all current rules */
|
|
62
|
-
getRules(): PermissionRule[];
|
|
63
|
-
/** Clear all rules */
|
|
64
|
-
clear(): void;
|
|
65
|
-
}
|
|
66
|
-
/**
|
|
67
|
-
* Can component props for basic usage
|
|
68
|
-
*/
|
|
69
|
-
export interface CanProps {
|
|
70
|
-
/** Action to check */
|
|
71
|
-
I: Action;
|
|
72
|
-
/** Subject to check against */
|
|
73
|
-
a?: Subject;
|
|
74
|
-
/** Specific field to check (optional) */
|
|
75
|
-
field?: Field;
|
|
76
|
-
/** Children to render when permission is granted */
|
|
77
|
-
children?: React.ReactNode;
|
|
78
|
-
/** Alternative content when permission is denied */
|
|
79
|
-
fallback?: React.ReactNode;
|
|
80
|
-
/** Custom ability instance (optional) */
|
|
81
|
-
ability?: Ability;
|
|
82
|
-
/** Additional styles */
|
|
83
|
-
style?: ViewStyle;
|
|
84
|
-
/** Test ID for testing */
|
|
85
|
-
testID?: string;
|
|
86
|
-
/** Whether to passthrough (render children regardless) for development */
|
|
87
|
-
passthrough?: boolean;
|
|
88
|
-
}
|
|
89
|
-
/**
|
|
90
|
-
* Enhanced Can component props with conditions
|
|
91
|
-
*/
|
|
92
|
-
export interface CanWithConditionsProps extends Omit<CanProps, 'a'> {
|
|
93
|
-
/** Subject instance with data for condition checking */
|
|
94
|
-
this: Subject;
|
|
95
|
-
}
|
|
96
|
-
/**
|
|
97
|
-
* Cannot component props (inverse of Can)
|
|
98
|
-
*/
|
|
99
|
-
export type CannotProps = CanProps;
|
|
100
|
-
/**
|
|
101
|
-
* Permission gate props for route-level protection
|
|
102
|
-
*/
|
|
103
|
-
export interface PermissionGateProps {
|
|
104
|
-
/** Required permissions (all must pass) */
|
|
105
|
-
permissions: Array<{
|
|
106
|
-
action: Action;
|
|
107
|
-
subject: Subject;
|
|
108
|
-
field?: Field;
|
|
109
|
-
}>;
|
|
110
|
-
/** Children to render when all permissions pass */
|
|
111
|
-
children: React.ReactNode;
|
|
112
|
-
/** Fallback when permissions fail */
|
|
113
|
-
fallback?: React.ReactNode;
|
|
114
|
-
/** Custom ability instance */
|
|
115
|
-
ability?: Ability;
|
|
116
|
-
/** Redirect function for navigation-based fallbacks */
|
|
117
|
-
onUnauthorized?: () => void;
|
|
118
|
-
}
|
|
119
|
-
/**
|
|
120
|
-
* Permission context value
|
|
121
|
-
*/
|
|
122
|
-
export interface PermissionContextValue {
|
|
123
|
-
/** Current ability instance */
|
|
124
|
-
ability: Ability;
|
|
125
|
-
/** Update ability rules */
|
|
126
|
-
updateAbility: (rules: PermissionRule[]) => void;
|
|
127
|
-
/** Check if user can perform action */
|
|
128
|
-
can: (action: Action, subject: Subject, field?: Field) => boolean;
|
|
129
|
-
/** Check if user cannot perform action */
|
|
130
|
-
cannot: (action: Action, subject: Subject, field?: Field) => boolean;
|
|
131
|
-
/** Get current user context */
|
|
132
|
-
user?: any;
|
|
133
|
-
/** Update user context */
|
|
134
|
-
setUser?: (user: any) => void;
|
|
135
|
-
}
|
|
136
|
-
/**
|
|
137
|
-
* Permission provider props
|
|
138
|
-
*/
|
|
139
|
-
export interface PermissionProviderProps {
|
|
140
|
-
/** Initial permission rules */
|
|
141
|
-
rules?: PermissionRule[];
|
|
142
|
-
/** Initial user context */
|
|
143
|
-
user?: any;
|
|
144
|
-
/** Children components */
|
|
145
|
-
children: React.ReactNode;
|
|
146
|
-
/** Development mode settings */
|
|
147
|
-
dev?: {
|
|
148
|
-
/** Log permission checks */
|
|
149
|
-
logChecks?: boolean;
|
|
150
|
-
/** Warn about missing permissions */
|
|
151
|
-
warnMissing?: boolean;
|
|
152
|
-
/** Allow passthrough in development */
|
|
153
|
-
allowPassthrough?: boolean;
|
|
154
|
-
};
|
|
155
|
-
}
|
|
156
|
-
/**
|
|
157
|
-
* Hook options for usePermissions
|
|
158
|
-
*/
|
|
159
|
-
export interface UsePermissionsOptions {
|
|
160
|
-
/** Whether to log permission checks */
|
|
161
|
-
debug?: boolean;
|
|
162
|
-
/** Throw error if no ability found */
|
|
163
|
-
required?: boolean;
|
|
164
|
-
}
|
|
165
|
-
/**
|
|
166
|
-
* Permission definition for bulk operations
|
|
167
|
-
*/
|
|
168
|
-
export interface PermissionDefinition {
|
|
169
|
-
/** Actions for this resource */
|
|
170
|
-
actions: Action[];
|
|
171
|
-
/** Subject type */
|
|
172
|
-
subject: Subject;
|
|
173
|
-
/** Default conditions */
|
|
174
|
-
conditions?: Conditions;
|
|
175
|
-
/** Description */
|
|
176
|
-
description?: string;
|
|
177
|
-
}
|
|
178
|
-
/**
|
|
179
|
-
* Role-based permission set
|
|
180
|
-
*/
|
|
181
|
-
export interface RolePermissions {
|
|
182
|
-
/** Role name */
|
|
183
|
-
role: string;
|
|
184
|
-
/** Permission rules for this role */
|
|
185
|
-
rules: PermissionRule[];
|
|
186
|
-
/** Description of the role */
|
|
187
|
-
description?: string;
|
|
188
|
-
/** Whether role is active */
|
|
189
|
-
active?: boolean;
|
|
190
|
-
}
|
|
191
|
-
/**
|
|
192
|
-
* Permission builder for fluent API
|
|
193
|
-
*/
|
|
194
|
-
export interface PermissionBuilder {
|
|
195
|
-
/** Add a permission rule */
|
|
196
|
-
allow(action: Action | Action[]): PermissionSubjectBuilder;
|
|
197
|
-
/** Add a denial rule */
|
|
198
|
-
deny(action: Action | Action[]): PermissionSubjectBuilder;
|
|
199
|
-
/** Build the rules array */
|
|
200
|
-
build(): PermissionRule[];
|
|
201
|
-
}
|
|
202
|
-
export interface PermissionSubjectBuilder {
|
|
203
|
-
/** Specify the subject */
|
|
204
|
-
on(subject: Subject | Subject[]): PermissionFieldBuilder;
|
|
205
|
-
}
|
|
206
|
-
export interface PermissionFieldBuilder {
|
|
207
|
-
/** Specify fields (optional) */
|
|
208
|
-
fields(fields: Field[]): PermissionConditionBuilder;
|
|
209
|
-
/** Specify conditions */
|
|
210
|
-
when(conditions: Conditions): PermissionRuleBuilder;
|
|
211
|
-
/** Add reason */
|
|
212
|
-
because(reason: string): PermissionRuleBuilder;
|
|
213
|
-
/** Finish building this rule */
|
|
214
|
-
build(): PermissionRule;
|
|
215
|
-
}
|
|
216
|
-
export interface PermissionConditionBuilder {
|
|
217
|
-
/** Specify conditions */
|
|
218
|
-
when(conditions: Conditions): PermissionRuleBuilder;
|
|
219
|
-
/** Add reason */
|
|
220
|
-
because(reason: string): PermissionRuleBuilder;
|
|
221
|
-
/** Finish building this rule */
|
|
222
|
-
build(): PermissionRule;
|
|
223
|
-
}
|
|
224
|
-
export interface PermissionRuleBuilder {
|
|
225
|
-
/** Add reason */
|
|
226
|
-
because(reason: string): PermissionRuleBuilder;
|
|
227
|
-
/** Finish building this rule */
|
|
228
|
-
build(): PermissionRule;
|
|
229
|
-
}
|
|
230
|
-
export {};
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { ViewStyle } from 'react-native';
|
|
3
|
-
export type AnimationSource = any;
|
|
4
|
-
export interface LottieProps {
|
|
5
|
-
/** Required Lottie animation JSON (require or imported object) */
|
|
6
|
-
source: any;
|
|
7
|
-
/** Auto play animation */
|
|
8
|
-
autoPlay?: boolean;
|
|
9
|
-
/** Loop animation */
|
|
10
|
-
loop?: boolean;
|
|
11
|
-
/** Progress prop (0-1) for manual control */
|
|
12
|
-
progress?: number;
|
|
13
|
-
/** Speed multiplier */
|
|
14
|
-
speed?: number;
|
|
15
|
-
/** Style for container */
|
|
16
|
-
style?: ViewStyle;
|
|
17
|
-
/** Test ID */
|
|
18
|
-
testID?: string;
|
|
19
|
-
/** Pause state */
|
|
20
|
-
paused?: boolean;
|
|
21
|
-
/** Optional resize mode (cover/contain/center) */
|
|
22
|
-
resizeMode?: 'cover' | 'contain' | 'center';
|
|
23
|
-
/** Called when animation finishes (loop false) */
|
|
24
|
-
onAnimationFinish?: (isCancelled: boolean) => void;
|
|
25
|
-
}
|
|
26
|
-
/**
|
|
27
|
-
* Lottie component with safe fallback when native module not present or on unsupported platforms.
|
|
28
|
-
*/
|
|
29
|
-
export declare const Lottie: React.ForwardRefExoticComponent<LottieProps & React.RefAttributes<any>>;
|
|
30
|
-
export default Lottie;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function useNavigationProgressState(): {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function getNavigationProgressStyles(): {};
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
export interface NavigationProgressProps {
|
|
2
|
-
/** Controlled progress value (0-100). If omitted, internal controller progress is used */
|
|
3
|
-
value?: number;
|
|
4
|
-
/** Height (px) */
|
|
5
|
-
size?: number;
|
|
6
|
-
/** Color token key or raw color */
|
|
7
|
-
color?: string;
|
|
8
|
-
/** Whether bar is active/visible when value is controlled */
|
|
9
|
-
active?: boolean;
|
|
10
|
-
/** z-index layering */
|
|
11
|
-
zIndex?: number;
|
|
12
|
-
/** If true position absolute at top full width */
|
|
13
|
-
overlay?: boolean;
|
|
14
|
-
/** Step interval in ms for internal progression animation */
|
|
15
|
-
stepInterval?: number;
|
|
16
|
-
/** Border radius */
|
|
17
|
-
radius?: number;
|
|
18
|
-
/** Custom styles */
|
|
19
|
-
style?: any;
|
|
20
|
-
}
|
|
21
|
-
export interface NavigationProgressController {
|
|
22
|
-
start: () => void;
|
|
23
|
-
stop: () => void;
|
|
24
|
-
complete: () => void;
|
|
25
|
-
reset: () => void;
|
|
26
|
-
set: (v: number) => void;
|
|
27
|
-
increment: (delta?: number) => void;
|
|
28
|
-
decrement: (delta?: number) => void;
|
|
29
|
-
isActive: () => boolean;
|
|
30
|
-
}
|
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
export declare function useRichTextEditorStyles(): {
|
|
2
|
-
characterCount: {
|
|
3
|
-
fontSize: number;
|
|
4
|
-
marginTop: number;
|
|
5
|
-
textAlign: "right";
|
|
6
|
-
};
|
|
7
|
-
container: {
|
|
8
|
-
width: "100%";
|
|
9
|
-
};
|
|
10
|
-
disabled: {
|
|
11
|
-
opacity: number;
|
|
12
|
-
};
|
|
13
|
-
editorContainer: {
|
|
14
|
-
backgroundColor: string;
|
|
15
|
-
borderColor: string;
|
|
16
|
-
borderRadius: number;
|
|
17
|
-
borderWidth: number;
|
|
18
|
-
overflow: "hidden";
|
|
19
|
-
};
|
|
20
|
-
errorText: {
|
|
21
|
-
fontSize: number;
|
|
22
|
-
marginTop: number;
|
|
23
|
-
};
|
|
24
|
-
helperText: {
|
|
25
|
-
fontSize: number;
|
|
26
|
-
marginTop: number;
|
|
27
|
-
};
|
|
28
|
-
textInput: {
|
|
29
|
-
fontSize: number;
|
|
30
|
-
lineHeight: number;
|
|
31
|
-
padding: number;
|
|
32
|
-
};
|
|
33
|
-
toolButton: {
|
|
34
|
-
alignItems: "center";
|
|
35
|
-
backgroundColor: string;
|
|
36
|
-
borderColor: string;
|
|
37
|
-
borderRadius: number;
|
|
38
|
-
borderWidth: number;
|
|
39
|
-
height: number;
|
|
40
|
-
justifyContent: "center";
|
|
41
|
-
width: number;
|
|
42
|
-
};
|
|
43
|
-
toolSeparator: {
|
|
44
|
-
backgroundColor: string;
|
|
45
|
-
height: number;
|
|
46
|
-
marginHorizontal: number;
|
|
47
|
-
width: number;
|
|
48
|
-
};
|
|
49
|
-
toolbar: {
|
|
50
|
-
backgroundColor: string;
|
|
51
|
-
borderBottomColor: string;
|
|
52
|
-
borderBottomWidth: number;
|
|
53
|
-
};
|
|
54
|
-
toolbarContent: {
|
|
55
|
-
alignItems: "center";
|
|
56
|
-
flexDirection: "row";
|
|
57
|
-
gap: number;
|
|
58
|
-
paddingHorizontal: number;
|
|
59
|
-
paddingVertical: number;
|
|
60
|
-
};
|
|
61
|
-
};
|
|
@@ -1,150 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { BaseInputProps } from '../Input/types';
|
|
3
|
-
export interface RichTextEditorFormat {
|
|
4
|
-
/** Bold text */
|
|
5
|
-
bold?: boolean;
|
|
6
|
-
/** Italic text */
|
|
7
|
-
italic?: boolean;
|
|
8
|
-
/** Underlined text */
|
|
9
|
-
underline?: boolean;
|
|
10
|
-
/** Strikethrough text */
|
|
11
|
-
strikethrough?: boolean;
|
|
12
|
-
/** Text color */
|
|
13
|
-
color?: string;
|
|
14
|
-
/** Background color */
|
|
15
|
-
backgroundColor?: string;
|
|
16
|
-
/** Font size */
|
|
17
|
-
fontSize?: number;
|
|
18
|
-
/** Font family */
|
|
19
|
-
fontFamily?: string;
|
|
20
|
-
/** Text alignment */
|
|
21
|
-
align?: 'left' | 'center' | 'right' | 'justify';
|
|
22
|
-
/** List type */
|
|
23
|
-
list?: 'ordered' | 'unordered' | null;
|
|
24
|
-
/** Heading level */
|
|
25
|
-
heading?: 1 | 2 | 3 | 4 | 5 | 6 | null;
|
|
26
|
-
/** Link URL */
|
|
27
|
-
link?: string | null;
|
|
28
|
-
/** Code formatting */
|
|
29
|
-
code?: boolean;
|
|
30
|
-
/** Quote formatting */
|
|
31
|
-
quote?: boolean;
|
|
32
|
-
}
|
|
33
|
-
export interface RichTextEditorContent {
|
|
34
|
-
/** Raw HTML content */
|
|
35
|
-
html: string;
|
|
36
|
-
/** Plain text content */
|
|
37
|
-
text: string;
|
|
38
|
-
/** Delta format (for advanced editors) */
|
|
39
|
-
delta?: any;
|
|
40
|
-
/** Custom format */
|
|
41
|
-
json?: any;
|
|
42
|
-
}
|
|
43
|
-
export interface RichTextEditorSelection {
|
|
44
|
-
/** Start index */
|
|
45
|
-
index: number;
|
|
46
|
-
/** Selection length */
|
|
47
|
-
length: number;
|
|
48
|
-
/** Current format */
|
|
49
|
-
format?: RichTextEditorFormat;
|
|
50
|
-
}
|
|
51
|
-
export interface RichTextEditorProps extends Omit<BaseInputProps, 'value' | 'onChange'> {
|
|
52
|
-
/** Initial content */
|
|
53
|
-
defaultValue?: RichTextEditorContent;
|
|
54
|
-
/** Current content */
|
|
55
|
-
value?: RichTextEditorContent;
|
|
56
|
-
/** Content change handler */
|
|
57
|
-
onChange?: (content: RichTextEditorContent) => void;
|
|
58
|
-
/** Selection change handler */
|
|
59
|
-
onSelectionChange?: (selection: RichTextEditorSelection) => void;
|
|
60
|
-
/** Focus handler */
|
|
61
|
-
onFocus?: () => void;
|
|
62
|
-
/** Blur handler */
|
|
63
|
-
onBlur?: () => void;
|
|
64
|
-
/** Editor placeholder */
|
|
65
|
-
placeholder?: string;
|
|
66
|
-
/** Whether editor is read-only */
|
|
67
|
-
readOnly?: boolean;
|
|
68
|
-
/** Toolbar configuration */
|
|
69
|
-
toolbar?: {
|
|
70
|
-
/** Show toolbar */
|
|
71
|
-
enabled?: boolean;
|
|
72
|
-
/** Toolbar position */
|
|
73
|
-
position?: 'top' | 'bottom' | 'floating';
|
|
74
|
-
/** Available tools */
|
|
75
|
-
tools?: Array<'bold' | 'italic' | 'underline' | 'strikethrough' | 'color' | 'backgroundColor' | 'fontSize' | 'fontFamily' | 'align' | 'list' | 'heading' | 'link' | 'image' | 'code' | 'quote' | 'separator' | {
|
|
76
|
-
type: 'custom';
|
|
77
|
-
component: React.ComponentType<any>;
|
|
78
|
-
props?: any;
|
|
79
|
-
}>;
|
|
80
|
-
/** Toolbar groups */
|
|
81
|
-
groups?: Array<Array<string>>;
|
|
82
|
-
};
|
|
83
|
-
/** Format options */
|
|
84
|
-
formats?: {
|
|
85
|
-
/** Available font families */
|
|
86
|
-
fontFamilies?: string[];
|
|
87
|
-
/** Available font sizes */
|
|
88
|
-
fontSizes?: number[];
|
|
89
|
-
/** Available colors */
|
|
90
|
-
colors?: string[];
|
|
91
|
-
/** Available heading levels */
|
|
92
|
-
headings?: Array<1 | 2 | 3 | 4 | 5 | 6>;
|
|
93
|
-
};
|
|
94
|
-
/** Image handling */
|
|
95
|
-
images?: {
|
|
96
|
-
/** Allow image uploads */
|
|
97
|
-
enabled?: boolean;
|
|
98
|
-
/** Upload handler */
|
|
99
|
-
onUpload?: (file: File) => Promise<string>;
|
|
100
|
-
/** Maximum image size */
|
|
101
|
-
maxSize?: number;
|
|
102
|
-
/** Allowed image types */
|
|
103
|
-
allowedTypes?: string[];
|
|
104
|
-
/** Image resize settings */
|
|
105
|
-
resize?: {
|
|
106
|
-
maxWidth?: number;
|
|
107
|
-
maxHeight?: number;
|
|
108
|
-
quality?: number;
|
|
109
|
-
};
|
|
110
|
-
};
|
|
111
|
-
/** Link handling */
|
|
112
|
-
links?: {
|
|
113
|
-
/** Allow links */
|
|
114
|
-
enabled?: boolean;
|
|
115
|
-
/** Link validation */
|
|
116
|
-
validate?: (url: string) => boolean;
|
|
117
|
-
/** Open links in new tab */
|
|
118
|
-
openInNewTab?: boolean;
|
|
119
|
-
};
|
|
120
|
-
/** Custom plugins */
|
|
121
|
-
plugins?: Array<{
|
|
122
|
-
/** Plugin name */
|
|
123
|
-
name: string;
|
|
124
|
-
/** Plugin component */
|
|
125
|
-
component: React.ComponentType<any>;
|
|
126
|
-
/** Plugin configuration */
|
|
127
|
-
config?: any;
|
|
128
|
-
}>;
|
|
129
|
-
/** Autosave configuration */
|
|
130
|
-
autosave?: {
|
|
131
|
-
/** Enable autosave */
|
|
132
|
-
enabled?: boolean;
|
|
133
|
-
/** Save interval in milliseconds */
|
|
134
|
-
interval?: number;
|
|
135
|
-
/** Save handler */
|
|
136
|
-
onSave?: (content: RichTextEditorContent) => void;
|
|
137
|
-
};
|
|
138
|
-
/** Spell check */
|
|
139
|
-
spellCheck?: boolean;
|
|
140
|
-
/** Maximum content length */
|
|
141
|
-
maxLength?: number;
|
|
142
|
-
/** Minimum editor height */
|
|
143
|
-
minHeight?: number;
|
|
144
|
-
/** Maximum editor height */
|
|
145
|
-
maxHeight?: number;
|
|
146
|
-
/** Custom CSS classes */
|
|
147
|
-
className?: string;
|
|
148
|
-
/** Theme override */
|
|
149
|
-
theme?: 'light' | 'dark' | 'auto';
|
|
150
|
-
}
|