@spteck/react-controls-v2 2.5.17 → 2.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/dist/assets/fluentEmojis.json.d.ts +55521 -0
- package/dist/components/EmojiPicker/EmojiPicker.d.ts +4 -0
- package/dist/components/EmojiPicker/IEmojiPickerProps.d.ts +64 -0
- package/dist/components/EmojiPicker/SkinToneSelector.d.ts +8 -0
- package/dist/components/EmojiPicker/emojiData.d.ts +17 -0
- package/dist/components/EmojiPicker/index.d.ts +4 -0
- package/dist/components/EmojiPicker/useEmojiPickerStyles.d.ts +18 -0
- package/dist/components/RichTextEditor/IRichTextEditorProps.d.ts +61 -3
- package/dist/components/RichTextEditor/Icons.d.ts +15 -0
- package/dist/components/RichTextEditor/RichTextEditor.d.ts +59 -0
- package/dist/components/RichTextEditor/RichTextEditorBgColorPickerControl.d.ts +4 -0
- package/dist/components/RichTextEditor/RichTextEditorContext.d.ts +10 -0
- package/dist/components/RichTextEditor/RichTextEditorDragHandle.d.ts +15 -0
- package/dist/components/RichTextEditor/RichTextEditorEmojiPickerControl.d.ts +4 -0
- package/dist/components/RichTextEditor/RichTextEditorImageUploadControl.d.ts +19 -0
- package/dist/components/RichTextEditor/RichTextEditorResizableImage.d.ts +22 -0
- package/dist/components/RichTextEditor/RichTextEditorResizableImageView.d.ts +16 -0
- package/dist/components/RichTextEditor/RichTextEditorTableControls.d.ts +26 -0
- package/dist/components/RichTextEditor/controls.d.ts +84 -31
- package/dist/components/RichTextEditor/extensions.d.ts +17 -4
- package/dist/components/RichTextEditor/index.d.ts +12 -2
- package/dist/components/RichTextEditor/renderContentAsEmailHtml.d.ts +26 -0
- package/dist/components/RichTextEditor/useRichTextEditor.d.ts +36 -0
- package/dist/components/RichTextEditor/useRichTextEditorStyles.d.ts +3 -1
- package/dist/hooks/index.d.ts +3 -1
- package/dist/hooks/useAppToast.d.ts +47 -0
- package/dist/hooks/useFluentEmoji.d.ts +12 -0
- package/dist/hooks/useTimeZoneHelper.d.ts +13 -4
- package/dist/index.cjs +109 -84
- package/dist/index.d.ts +2 -1
- package/dist/index.js +54626 -4563
- package/dist/models/IToastContent.d.ts +19 -0
- package/dist/models/IToastOptions.d.ts +14 -0
- package/package.json +6 -3
- package/dist/hooks/useTimeZone.d.ts +0 -12
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { PopoverProps } from '@fluentui/react-components';
|
|
2
|
+
import { SkinTone } from './emojiData';
|
|
3
|
+
import type * as React from "react";
|
|
4
|
+
export interface IEmojiPickerProps {
|
|
5
|
+
/**
|
|
6
|
+
* Callback fired when the user clicks an emoji.
|
|
7
|
+
* The selected emoji character is passed as the argument.
|
|
8
|
+
*/
|
|
9
|
+
onEmojiSelect: (emoji: string) => void;
|
|
10
|
+
/**
|
|
11
|
+
* The element that acts as the popover trigger.
|
|
12
|
+
* Must accept a forwarded `ref` and an `onClick` handler
|
|
13
|
+
* (standard behaviour for any FluentUI or HTML button).
|
|
14
|
+
*/
|
|
15
|
+
trigger: React.ReactElement;
|
|
16
|
+
/**
|
|
17
|
+
* Controls whether the picker popover is visible (controlled mode).
|
|
18
|
+
* When omitted the component manages its own open/close state internally.
|
|
19
|
+
*/
|
|
20
|
+
open?: boolean;
|
|
21
|
+
/**
|
|
22
|
+
* Called whenever the popover open state should change.
|
|
23
|
+
* Required when `open` is provided (controlled mode).
|
|
24
|
+
*/
|
|
25
|
+
onOpenChange?: (open: boolean) => void;
|
|
26
|
+
/**
|
|
27
|
+
* FluentUI popover positioning strategy.
|
|
28
|
+
* @default "below-start"
|
|
29
|
+
*/
|
|
30
|
+
positioning?: PopoverProps["positioning"];
|
|
31
|
+
/**
|
|
32
|
+
* Width of the picker panel in pixels.
|
|
33
|
+
* @default 260
|
|
34
|
+
*/
|
|
35
|
+
popoverWidth?: number;
|
|
36
|
+
/**
|
|
37
|
+
* Maximum height of the emoji grid before it becomes scrollable.
|
|
38
|
+
* @default 200
|
|
39
|
+
*/
|
|
40
|
+
maxGridHeight?: number;
|
|
41
|
+
/**
|
|
42
|
+
* Placeholder text shown inside the search input.
|
|
43
|
+
* @default "Search emoji…"
|
|
44
|
+
*/
|
|
45
|
+
searchPlaceholder?: string;
|
|
46
|
+
/**
|
|
47
|
+
* Optional CSS class name applied to the `PopoverSurface` element.
|
|
48
|
+
*/
|
|
49
|
+
className?: string;
|
|
50
|
+
/**
|
|
51
|
+
* Optional inline styles applied to the `PopoverSurface` element.
|
|
52
|
+
*/
|
|
53
|
+
style?: React.CSSProperties;
|
|
54
|
+
/**
|
|
55
|
+
* The initially selected skin tone.
|
|
56
|
+
* When omitted, the default (yellow) tone is used.
|
|
57
|
+
*/
|
|
58
|
+
defaultSkinTone?: SkinTone;
|
|
59
|
+
/**
|
|
60
|
+
* Called when the user picks a different skin tone.
|
|
61
|
+
*/
|
|
62
|
+
onSkinToneChange?: (tone: SkinTone) => void;
|
|
63
|
+
}
|
|
64
|
+
//# sourceMappingURL=IEmojiPickerProps.d.ts.map
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { SkinTone } from './emojiData';
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
export interface ISkinToneSelectorProps {
|
|
4
|
+
value: SkinTone;
|
|
5
|
+
onChange: (tone: SkinTone) => void;
|
|
6
|
+
}
|
|
7
|
+
export declare const SkinToneSelector: React.NamedExoticComponent<ISkinToneSelectorProps>;
|
|
8
|
+
//# sourceMappingURL=SkinToneSelector.d.ts.map
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/** Ordered to match the unicodeSkintones index in fluentEmojis.json */
|
|
2
|
+
export declare const SKIN_TONES: readonly ["Default", "Light", "MediumLight", "Medium", "MediumDark", "Dark"];
|
|
3
|
+
export type SkinTone = (typeof SKIN_TONES)[number];
|
|
4
|
+
/** Visual color swatch for each skin tone (matches Fluent / Teams palette) */
|
|
5
|
+
export declare const SKIN_TONE_COLORS: Record<SkinTone, string>;
|
|
6
|
+
export interface IEmojiCategory {
|
|
7
|
+
/** Emoji character used as the category tab label */
|
|
8
|
+
readonly label: string;
|
|
9
|
+
/** Ordered list of emojis belonging to this category */
|
|
10
|
+
readonly emojis: readonly string[];
|
|
11
|
+
}
|
|
12
|
+
export declare const CATEGORY_TOOLTIPS: readonly string[];
|
|
13
|
+
export declare function buildEmojiCategories(skinTone?: SkinTone): readonly IEmojiCategory[];
|
|
14
|
+
export declare function matchesEmojiQuery(emoji: string, query: string): boolean;
|
|
15
|
+
/** Default (no-tone) categories — kept for backward compat */
|
|
16
|
+
export declare const EMOJI_CATEGORIES: readonly IEmojiCategory[];
|
|
17
|
+
//# sourceMappingURL=emojiData.d.ts.map
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
interface IEmojiPickerStyleOptions {
|
|
2
|
+
popoverWidth: number;
|
|
3
|
+
maxGridHeight: number;
|
|
4
|
+
}
|
|
5
|
+
export declare const useEmojiPickerStyles: ({ popoverWidth, maxGridHeight, }: IEmojiPickerStyleOptions) => {
|
|
6
|
+
popover: string;
|
|
7
|
+
header: string;
|
|
8
|
+
searchWrapper: string;
|
|
9
|
+
grid: string;
|
|
10
|
+
empty: string;
|
|
11
|
+
skinToneRow: string;
|
|
12
|
+
skinToneButton: string;
|
|
13
|
+
skinToneButtonSelected: string;
|
|
14
|
+
skinToneButtonUnselected: string;
|
|
15
|
+
};
|
|
16
|
+
export type EmojiPickerStyles = ReturnType<typeof useEmojiPickerStyles>;
|
|
17
|
+
export {};
|
|
18
|
+
//# sourceMappingURL=useEmojiPickerStyles.d.ts.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Editor } from '@tiptap/react';
|
|
2
1
|
import { IBaseProps } from '../baseComponentProps/IBaseProps';
|
|
2
|
+
import { Editor } from '@tiptap/core';
|
|
3
3
|
/**
|
|
4
4
|
* Visual variant of the RichTextEditor
|
|
5
5
|
*/
|
|
@@ -55,13 +55,34 @@ export interface IRichTextEditorLabels {
|
|
|
55
55
|
tasksSinkLabel: string;
|
|
56
56
|
tasksLiftLabel: string;
|
|
57
57
|
fontFamilyControlLabel: string;
|
|
58
|
+
imageUploadControlLabel: string;
|
|
59
|
+
bgColorPickerControlLabel: string;
|
|
60
|
+
bgColorPickerColorLabel: (color: string) => string;
|
|
61
|
+
emojiPickerControlLabel: string;
|
|
62
|
+
tableInsertControlLabel: string;
|
|
63
|
+
tableDeleteControlLabel: string;
|
|
64
|
+
tableAddColumnBeforeControlLabel: string;
|
|
65
|
+
tableAddColumnAfterControlLabel: string;
|
|
66
|
+
tableDeleteColumnControlLabel: string;
|
|
67
|
+
tableAddRowBeforeControlLabel: string;
|
|
68
|
+
tableAddRowAfterControlLabel: string;
|
|
69
|
+
tableDeleteRowControlLabel: string;
|
|
70
|
+
tableMergeOrSplitCellControlLabel: string;
|
|
71
|
+
tableToggleHeaderColumnControlLabel: string;
|
|
72
|
+
tableToggleHeaderRowControlLabel: string;
|
|
73
|
+
tableToggleColumnLinesControlLabel: string;
|
|
74
|
+
tableToggleRowLinesControlLabel: string;
|
|
58
75
|
}
|
|
59
76
|
/**
|
|
60
77
|
* Props for the main RichTextEditor component
|
|
61
78
|
*/
|
|
62
79
|
export interface IRichTextEditorProps extends IBaseProps {
|
|
63
|
-
/**
|
|
64
|
-
|
|
80
|
+
/** Initial HTML content for the editor */
|
|
81
|
+
content?: string;
|
|
82
|
+
/** Placeholder text shown when the editor is empty */
|
|
83
|
+
placeholder?: string;
|
|
84
|
+
/** Whether the editor is editable @default true */
|
|
85
|
+
editable?: boolean;
|
|
65
86
|
/** Whether code highlight styles should be added @default true */
|
|
66
87
|
withCodeHighlightStyles?: boolean;
|
|
67
88
|
/** Whether typography styles should be added @default true */
|
|
@@ -89,6 +110,17 @@ export interface IRichTextEditorProps extends IBaseProps {
|
|
|
89
110
|
/** Font families available in the FontFamily toolbar picker.
|
|
90
111
|
* Typically populated from `useBrandCenterFonts().fontFamilyNames`. */
|
|
91
112
|
fontFamilies?: string[];
|
|
113
|
+
/** Background color of the editor content area (any valid CSS color value, e.g. '#f5f5f5', 'white') */
|
|
114
|
+
contentBackground?: string;
|
|
115
|
+
/** Called on every content change with a complete inline-styled, email-client-safe HTML document */
|
|
116
|
+
onGetContentAsEmailHtml?: (emailHtml: string) => void;
|
|
117
|
+
/** Called when the user selects an image file via the ImageUpload toolbar control.
|
|
118
|
+
* Receive the File and call `insertImage(src)` to insert it into the editor.
|
|
119
|
+
* If not provided, images are inserted as base64 data URLs by default. */
|
|
120
|
+
onImageUpload?: (file: File, insertImage: (src: string) => void) => void;
|
|
121
|
+
/** Colors available in the BgColorPicker toolbar control palette.
|
|
122
|
+
* If not provided, a default palette is used. */
|
|
123
|
+
bgColorPickerColors?: string[];
|
|
92
124
|
/** Child editor components */
|
|
93
125
|
children: React.ReactNode;
|
|
94
126
|
/** Additional className */
|
|
@@ -196,6 +228,15 @@ export interface IRichTextEditorColorPickerControlProps {
|
|
|
196
228
|
/** Inline styles */
|
|
197
229
|
style?: React.CSSProperties;
|
|
198
230
|
}
|
|
231
|
+
/**
|
|
232
|
+
* Props for the RichTextEditor.BgColorPicker control
|
|
233
|
+
*/
|
|
234
|
+
export interface IRichTextEditorBgColorPickerControlProps {
|
|
235
|
+
/** Additional className */
|
|
236
|
+
className?: string;
|
|
237
|
+
/** Inline styles */
|
|
238
|
+
style?: React.CSSProperties;
|
|
239
|
+
}
|
|
199
240
|
/**
|
|
200
241
|
* Configuration for the createControl factory
|
|
201
242
|
*/
|
|
@@ -214,6 +255,23 @@ export interface ICreateControlProps {
|
|
|
214
255
|
attributes?: Record<string, unknown> | string;
|
|
215
256
|
};
|
|
216
257
|
}
|
|
258
|
+
/**
|
|
259
|
+
* Props for the RichTextEditor.DragHandle component
|
|
260
|
+
*/
|
|
261
|
+
export interface IRichTextEditorDragHandleProps {
|
|
262
|
+
/** Enable drag handles for nested blocks (list items, blockquotes, etc.) @default false */
|
|
263
|
+
nested?: boolean;
|
|
264
|
+
/** Called when the hovered node changes */
|
|
265
|
+
onNodeChange?: (data: {
|
|
266
|
+
node: import('@tiptap/pm/model').Node | null;
|
|
267
|
+
editor: Editor;
|
|
268
|
+
pos: number;
|
|
269
|
+
}) => void;
|
|
270
|
+
/** Additional className applied to the handle button */
|
|
271
|
+
className?: string;
|
|
272
|
+
/** Inline styles applied to the handle button */
|
|
273
|
+
style?: React.CSSProperties;
|
|
274
|
+
}
|
|
217
275
|
/**
|
|
218
276
|
* Props for the RichTextEditor.FontFamily control
|
|
219
277
|
*/
|
|
@@ -37,7 +37,22 @@ export declare function IconArrowForwardUp(props: IconProps): import("react/jsx-
|
|
|
37
37
|
export declare function IconListCheck(props: IconProps): import("react/jsx-runtime").JSX.Element;
|
|
38
38
|
export declare function IconIndentIncrease(props: IconProps): import("react/jsx-runtime").JSX.Element;
|
|
39
39
|
export declare function IconIndentDecrease(props: IconProps): import("react/jsx-runtime").JSX.Element;
|
|
40
|
+
export declare function IconGripVertical(props: IconProps): import("react/jsx-runtime").JSX.Element;
|
|
41
|
+
export declare function IconTable(props: IconProps): import("react/jsx-runtime").JSX.Element;
|
|
42
|
+
export declare function IconTableOff(props: IconProps): import("react/jsx-runtime").JSX.Element;
|
|
43
|
+
export declare function IconColumnInsertLeft(props: IconProps): import("react/jsx-runtime").JSX.Element;
|
|
44
|
+
export declare function IconColumnInsertRight(props: IconProps): import("react/jsx-runtime").JSX.Element;
|
|
45
|
+
export declare function IconColumnRemove(props: IconProps): import("react/jsx-runtime").JSX.Element;
|
|
46
|
+
export declare function IconRowInsertTop(props: IconProps): import("react/jsx-runtime").JSX.Element;
|
|
47
|
+
export declare function IconRowInsertBottom(props: IconProps): import("react/jsx-runtime").JSX.Element;
|
|
48
|
+
export declare function IconRowRemove(props: IconProps): import("react/jsx-runtime").JSX.Element;
|
|
49
|
+
export declare function IconTableMergeCells(props: IconProps): import("react/jsx-runtime").JSX.Element;
|
|
50
|
+
export declare function IconTableColumnLines(props: IconProps): import("react/jsx-runtime").JSX.Element;
|
|
51
|
+
export declare function IconTableRowLines(props: IconProps): import("react/jsx-runtime").JSX.Element;
|
|
40
52
|
export declare function IconBraces(props: IconProps): import("react/jsx-runtime").JSX.Element;
|
|
41
53
|
export declare function IconTypography(props: IconProps): import("react/jsx-runtime").JSX.Element;
|
|
54
|
+
export declare function IconImageUpload(props: IconProps): import("react/jsx-runtime").JSX.Element;
|
|
55
|
+
export declare function IconBgColor(props: IconProps): import("react/jsx-runtime").JSX.Element;
|
|
56
|
+
export declare function IconEmoji(props: IconProps): import("react/jsx-runtime").JSX.Element;
|
|
42
57
|
export {};
|
|
43
58
|
//# sourceMappingURL=Icons.d.ts.map
|
|
@@ -159,5 +159,64 @@ export declare const RichTextEditor: React.FC<IRichTextEditorProps> & {
|
|
|
159
159
|
style?: React.CSSProperties;
|
|
160
160
|
}>;
|
|
161
161
|
FontFamily: React.FC<import('./IRichTextEditorProps').IRichTextEditorFontFamilyControlProps>;
|
|
162
|
+
ImageUpload: React.FC<Omit<import('./IRichTextEditorProps').IRichTextEditorControlBaseProps, "icon">>;
|
|
163
|
+
BgColorPicker: React.FC<import('./IRichTextEditorProps').IRichTextEditorBgColorPickerControlProps>;
|
|
164
|
+
EmojiPicker: React.FC<Omit<import('./IRichTextEditorProps').IRichTextEditorControlBaseProps, "icon">>;
|
|
165
|
+
DragHandle: React.FC<import('./IRichTextEditorProps').IRichTextEditorDragHandleProps>;
|
|
166
|
+
TableActiveControls: React.FC<{
|
|
167
|
+
children?: React.ReactNode;
|
|
168
|
+
}>;
|
|
169
|
+
InsertTable: {
|
|
170
|
+
(props: import('./IRichTextEditorProps').IRichTextEditorControlBaseProps): import("react/jsx-runtime").JSX.Element;
|
|
171
|
+
displayName: string;
|
|
172
|
+
};
|
|
173
|
+
DeleteTable: {
|
|
174
|
+
(props: import('./IRichTextEditorProps').IRichTextEditorControlBaseProps): import("react/jsx-runtime").JSX.Element;
|
|
175
|
+
displayName: string;
|
|
176
|
+
};
|
|
177
|
+
AddColumnBefore: {
|
|
178
|
+
(props: import('./IRichTextEditorProps').IRichTextEditorControlBaseProps): import("react/jsx-runtime").JSX.Element;
|
|
179
|
+
displayName: string;
|
|
180
|
+
};
|
|
181
|
+
AddColumnAfter: {
|
|
182
|
+
(props: import('./IRichTextEditorProps').IRichTextEditorControlBaseProps): import("react/jsx-runtime").JSX.Element;
|
|
183
|
+
displayName: string;
|
|
184
|
+
};
|
|
185
|
+
DeleteColumn: {
|
|
186
|
+
(props: import('./IRichTextEditorProps').IRichTextEditorControlBaseProps): import("react/jsx-runtime").JSX.Element;
|
|
187
|
+
displayName: string;
|
|
188
|
+
};
|
|
189
|
+
AddRowBefore: {
|
|
190
|
+
(props: import('./IRichTextEditorProps').IRichTextEditorControlBaseProps): import("react/jsx-runtime").JSX.Element;
|
|
191
|
+
displayName: string;
|
|
192
|
+
};
|
|
193
|
+
AddRowAfter: {
|
|
194
|
+
(props: import('./IRichTextEditorProps').IRichTextEditorControlBaseProps): import("react/jsx-runtime").JSX.Element;
|
|
195
|
+
displayName: string;
|
|
196
|
+
};
|
|
197
|
+
DeleteRow: {
|
|
198
|
+
(props: import('./IRichTextEditorProps').IRichTextEditorControlBaseProps): import("react/jsx-runtime").JSX.Element;
|
|
199
|
+
displayName: string;
|
|
200
|
+
};
|
|
201
|
+
MergeOrSplitCell: {
|
|
202
|
+
(props: import('./IRichTextEditorProps').IRichTextEditorControlBaseProps): import("react/jsx-runtime").JSX.Element;
|
|
203
|
+
displayName: string;
|
|
204
|
+
};
|
|
205
|
+
ToggleHeaderColumn: {
|
|
206
|
+
(props: import('./IRichTextEditorProps').IRichTextEditorControlBaseProps): import("react/jsx-runtime").JSX.Element;
|
|
207
|
+
displayName: string;
|
|
208
|
+
};
|
|
209
|
+
ToggleHeaderRow: {
|
|
210
|
+
(props: import('./IRichTextEditorProps').IRichTextEditorControlBaseProps): import("react/jsx-runtime").JSX.Element;
|
|
211
|
+
displayName: string;
|
|
212
|
+
};
|
|
213
|
+
ToggleTableColumnLines: {
|
|
214
|
+
(props: import('./IRichTextEditorProps').IRichTextEditorControlBaseProps): import("react/jsx-runtime").JSX.Element;
|
|
215
|
+
displayName: string;
|
|
216
|
+
};
|
|
217
|
+
ToggleTableRowLines: {
|
|
218
|
+
(props: import('./IRichTextEditorProps').IRichTextEditorControlBaseProps): import("react/jsx-runtime").JSX.Element;
|
|
219
|
+
displayName: string;
|
|
220
|
+
};
|
|
162
221
|
};
|
|
163
222
|
//# sourceMappingURL=RichTextEditor.d.ts.map
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { IRichTextEditorBgColorPickerControlProps } from './IRichTextEditorProps';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
export declare const RichTextEditorBgColorPickerControl: React.FC<IRichTextEditorBgColorPickerControlProps>;
|
|
4
|
+
//# sourceMappingURL=RichTextEditorBgColorPickerControl.d.ts.map
|
|
@@ -14,6 +14,16 @@ export interface IRichTextEditorContextValue {
|
|
|
14
14
|
onSelectionChange?: () => void;
|
|
15
15
|
fontFamily?: string;
|
|
16
16
|
fontFamilies?: string[];
|
|
17
|
+
contentBackground?: string;
|
|
18
|
+
bgColor: string;
|
|
19
|
+
setBgColor: (color: string) => void;
|
|
20
|
+
bgColorPickerColors: string[];
|
|
21
|
+
showTableColumnLines: boolean;
|
|
22
|
+
showTableRowLines: boolean;
|
|
23
|
+
toggleTableColumnLines: () => void;
|
|
24
|
+
toggleTableRowLines: () => void;
|
|
25
|
+
onGetContentAsEmailHtml?: (emailHtml: string) => void;
|
|
26
|
+
onImageUpload?: (file: File, insertImage: (src: string) => void) => void;
|
|
17
27
|
}
|
|
18
28
|
export declare const RichTextEditorProvider: import('react').Provider<IRichTextEditorContextValue | null>;
|
|
19
29
|
export declare function useRichTextEditorContext(): IRichTextEditorContextValue;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { IRichTextEditorDragHandleProps } from './IRichTextEditorProps';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
/**
|
|
4
|
+
* A drag handle that appears on hover to let users drag-and-drop any block
|
|
5
|
+
* in the editor. Place it as a sibling of `RichTextEditor.Content`.
|
|
6
|
+
*
|
|
7
|
+
* @example
|
|
8
|
+
* <RichTextEditor editor={editor}>
|
|
9
|
+
* <RichTextEditor.Toolbar>…</RichTextEditor.Toolbar>
|
|
10
|
+
* <RichTextEditor.DragHandle />
|
|
11
|
+
* <RichTextEditor.Content />
|
|
12
|
+
* </RichTextEditor>
|
|
13
|
+
*/
|
|
14
|
+
export declare const RichTextEditorDragHandle: React.FC<IRichTextEditorDragHandleProps>;
|
|
15
|
+
//# sourceMappingURL=RichTextEditorDragHandle.d.ts.map
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { IRichTextEditorControlBaseProps } from './IRichTextEditorProps';
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
export declare const RichTextEditorEmojiPickerControl: React.FC<Omit<IRichTextEditorControlBaseProps, "icon">>;
|
|
4
|
+
//# sourceMappingURL=RichTextEditorEmojiPickerControl.d.ts.map
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { IRichTextEditorControlBaseProps } from './IRichTextEditorProps';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
/**
|
|
4
|
+
* Toolbar control that lets users insert images into the editor.
|
|
5
|
+
*
|
|
6
|
+
* - If `onImageUpload` is provided on `<RichTextEditor>`, it is called with the
|
|
7
|
+
* selected `File` and an `insertImage(src)` callback — giving the consumer full
|
|
8
|
+
* control (e.g. upload to a server and insert the resulting URL).
|
|
9
|
+
* - If no `onImageUpload` prop is provided, the image is read as a base64 data
|
|
10
|
+
* URL and inserted directly into the editor content.
|
|
11
|
+
*
|
|
12
|
+
* Requires TipTap's Image extension to be included in the editor extensions:
|
|
13
|
+
* ```
|
|
14
|
+
* import Image from '@tiptap/extension-image';
|
|
15
|
+
* useEditor({ extensions: [..., Image] });
|
|
16
|
+
* ```
|
|
17
|
+
*/
|
|
18
|
+
export declare const RichTextEditorImageUploadControl: React.FC<Omit<IRichTextEditorControlBaseProps, 'icon'>>;
|
|
19
|
+
//# sourceMappingURL=RichTextEditorImageUploadControl.d.ts.map
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Extends TipTap's Image extension with:
|
|
3
|
+
* - A `width` attribute that defaults to `'40%'` (medium size).
|
|
4
|
+
* - A resizable NodeView: click the image to select it, then drag the
|
|
5
|
+
* bottom-right handle to resize it.
|
|
6
|
+
*
|
|
7
|
+
* Use this instead of `RichTextEditorImage` when you want drag-to-resize support.
|
|
8
|
+
*
|
|
9
|
+
* @example
|
|
10
|
+
* ```tsx
|
|
11
|
+
* import { RichTextEditorResizableImage } from '@spteck/react-controls-v2';
|
|
12
|
+
*
|
|
13
|
+
* const editor = useEditor({
|
|
14
|
+
* extensions: [StarterKit, RichTextEditorResizableImage],
|
|
15
|
+
* });
|
|
16
|
+
*
|
|
17
|
+
* // In the toolbar:
|
|
18
|
+
* <RichTextEditor.ImageUpload />
|
|
19
|
+
* ```
|
|
20
|
+
*/
|
|
21
|
+
export declare const RichTextEditorResizableImage: import('@tiptap/core').Node<import('@tiptap/extension-image').ImageOptions, any>;
|
|
22
|
+
//# sourceMappingURL=RichTextEditorResizableImage.d.ts.map
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
interface ResizableImageViewProps {
|
|
3
|
+
node: {
|
|
4
|
+
attrs: {
|
|
5
|
+
src: string;
|
|
6
|
+
alt?: string;
|
|
7
|
+
title?: string;
|
|
8
|
+
width: string;
|
|
9
|
+
};
|
|
10
|
+
};
|
|
11
|
+
updateAttributes: (attrs: Record<string, unknown>) => void;
|
|
12
|
+
selected: boolean;
|
|
13
|
+
}
|
|
14
|
+
export declare const RichTextEditorResizableImageView: React.FC<ResizableImageViewProps>;
|
|
15
|
+
export {};
|
|
16
|
+
//# sourceMappingURL=RichTextEditorResizableImageView.d.ts.map
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* Renders children only when the editor cursor is inside a table.
|
|
4
|
+
* Use this wrapper to show table action controls (add/remove columns/rows, merge cells, etc.)
|
|
5
|
+
* contextually, and keep the toolbar uncluttered when no table is active.
|
|
6
|
+
*
|
|
7
|
+
* ```tsx
|
|
8
|
+
* <RichTextEditor.Toolbar>
|
|
9
|
+
* <RichTextEditor.ControlsGroup>
|
|
10
|
+
* <RichTextEditor.InsertTable />
|
|
11
|
+
* </RichTextEditor.ControlsGroup>
|
|
12
|
+
* <RichTextEditor.TableActiveControls>
|
|
13
|
+
* <RichTextEditor.ControlsGroup>
|
|
14
|
+
* <RichTextEditor.DeleteTable />
|
|
15
|
+
* <RichTextEditor.AddColumnBefore />
|
|
16
|
+
* <RichTextEditor.AddColumnAfter />
|
|
17
|
+
* <RichTextEditor.DeleteColumn />
|
|
18
|
+
* </RichTextEditor.ControlsGroup>
|
|
19
|
+
* </RichTextEditor.TableActiveControls>
|
|
20
|
+
* </RichTextEditor.Toolbar>
|
|
21
|
+
* ```
|
|
22
|
+
*/
|
|
23
|
+
export declare const RichTextEditorTableControls: React.FC<{
|
|
24
|
+
children?: React.ReactNode;
|
|
25
|
+
}>;
|
|
26
|
+
//# sourceMappingURL=RichTextEditorTableControls.d.ts.map
|