rj-editor 0.1.1 → 1.0.0
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/README.md +313 -22
- package/dist/assets/icons/AttachmentIcon01.d.ts +2 -0
- package/dist/assets/icons/BorderRadiusIcon.d.ts +2 -0
- package/dist/assets/icons/ChevronSelectorHorizontalIcon.d.ts +2 -0
- package/dist/assets/icons/ChevronSelectorVerticalIcon.d.ts +2 -0
- package/dist/assets/icons/ImageIcon03.d.ts +2 -0
- package/dist/assets/icons/ImageIdentLeftIcon.d.ts +2 -0
- package/dist/assets/icons/ImageWrapTopBottomIcon.d.ts +2 -0
- package/dist/assets/icons/LayoutGridIcon01.d.ts +2 -0
- package/dist/assets/icons/LeftIndentIcon01.d.ts +2 -0
- package/dist/assets/icons/LineHeightIcon.d.ts +2 -0
- package/dist/assets/icons/MaximizeIcon02.d.ts +2 -0
- package/dist/assets/icons/MinimizeIcon02.d.ts +2 -0
- package/dist/assets/icons/PaintPourIcon.d.ts +2 -0
- package/dist/assets/icons/PaletteIcon.d.ts +2 -0
- package/dist/assets/icons/ParagraphSpacingIco.d.ts +2 -0
- package/dist/assets/icons/RefreshCcwIcon01.d.ts +2 -0
- package/dist/assets/icons/RefreshCcwIcon05.d.ts +2 -0
- package/dist/assets/icons/RefreshCwIcon01.d.ts +2 -0
- package/dist/assets/icons/RightIndentIcon01.d.ts +2 -0
- package/dist/assets/icons/SubscriptIcon.d.ts +2 -0
- package/dist/assets/icons/SupscriptIcon.d.ts +2 -0
- package/dist/assets/icons/TrashIcon03.d.ts +2 -0
- package/dist/assets/icons/VerticalAlignBottomIcon.d.ts +2 -0
- package/dist/assets/icons/VerticalAlignMiddleIcon.d.ts +2 -0
- package/dist/assets/icons/VerticalAlignTopIcon.d.ts +2 -0
- package/dist/assets/icons/YoutubeIcon.d.ts +2 -0
- package/dist/components/RJTextEditor.d.ts +3 -9
- package/dist/components/equation/EquationComponent.d.ts +10 -0
- package/dist/components/global/input-number/InputNumber.d.ts +14 -0
- package/dist/components/global/input-number/index.d.ts +2 -0
- package/dist/components/global/modal/Modal.d.ts +12 -0
- package/dist/components/global/modal/index.d.ts +2 -0
- package/dist/components/image/ImageComponent.d.ts +21 -0
- package/dist/components/rj-text-editor/HtmlValuePlugin.d.ts +7 -0
- package/dist/components/rj-text-editor/RJTextEditor.types.d.ts +18 -0
- package/dist/components/rj-text-editor/RJTextEditorContent.d.ts +17 -0
- package/dist/components/rj-text-editor/createInitialConfig.d.ts +47 -0
- package/dist/components/rj-text-editor/editorTheme.d.ts +26 -0
- package/dist/components/rj-text-editor/handleEditorChange.d.ts +3 -0
- package/dist/components/toolbar/Toolbar.d.ts +6 -1
- package/dist/components/toolbar/equation/EquationToolbar.d.ts +1 -0
- package/dist/components/toolbar/equation/utils.d.ts +13 -0
- package/dist/components/toolbar/home/HomeToolbar.d.ts +6 -0
- package/dist/components/toolbar/home/indent/IndentControls.d.ts +1 -0
- package/dist/components/toolbar/home/spacing/SpacingControls.d.ts +1 -0
- package/dist/components/toolbar/image/ImageToolbar.d.ts +2 -0
- package/dist/components/toolbar/image/divider/ToolbarDivider.d.ts +1 -0
- package/dist/components/toolbar/image/utils.d.ts +26 -0
- package/dist/components/toolbar/insert/InsertToolbar.d.ts +5 -0
- package/dist/components/toolbar/insert/divider/ToolbarDivider.d.ts +1 -0
- package/dist/components/toolbar/insert/equation/EquationControl.d.ts +2 -0
- package/dist/components/toolbar/insert/equation/EquationExamples.d.ts +6 -0
- package/dist/components/toolbar/insert/equation/EquationModal.d.ts +11 -0
- package/dist/components/toolbar/insert/equation/EquationPreview.d.ts +8 -0
- package/dist/components/toolbar/insert/horizontal-rule/HorizontalRuleControl.d.ts +1 -0
- package/dist/components/toolbar/insert/image/ImageControl.d.ts +1 -0
- package/dist/components/toolbar/insert/link/LinkControl.d.ts +7 -0
- package/dist/components/toolbar/insert/table/TableControl.d.ts +5 -0
- package/dist/components/toolbar/insert/youtube/YouTubeControl.d.ts +2 -0
- package/dist/components/toolbar/layout/LayoutToolbar.d.ts +1 -0
- package/dist/components/toolbar/table/TableToolbar.d.ts +1 -0
- package/dist/components/toolbar/table/cell/CellControls.d.ts +1 -0
- package/dist/components/toolbar/table/columns/ColumnControls.d.ts +1 -0
- package/dist/components/toolbar/table/delete/DeleteTableControls.d.ts +1 -0
- package/dist/components/toolbar/table/divider/ToolbarDivider.d.ts +1 -0
- package/dist/components/toolbar/table/header-cell/HeaderCellControls.d.ts +1 -0
- package/dist/components/toolbar/table/merge/MergeControls.d.ts +1 -0
- package/dist/components/toolbar/table/rows/RowControls.d.ts +1 -0
- package/dist/components/toolbar/table/utils.d.ts +23 -0
- package/dist/components/youtube/YouTubeComponent.d.ts +9 -0
- package/dist/constants/equationEditorEventName.d.ts +1 -0
- package/dist/constants/equationExamples.d.ts +16 -0
- package/dist/constants/equationStructures.d.ts +33 -0
- package/dist/constants/equationSymbols.d.ts +1 -0
- package/dist/constants/index.d.ts +10 -0
- package/dist/constants/insertEquationCommand.d.ts +2 -0
- package/dist/constants/insertImageCommand.d.ts +2 -0
- package/dist/constants/insertYouTubeCommand.d.ts +2 -0
- package/dist/constants/lineHeightOptions.d.ts +1 -0
- package/dist/constants/maxImageFileSize.d.ts +1 -0
- package/dist/constants/openLinkModalEventName.d.ts +1 -0
- package/dist/i18n/I18nContext.d.ts +9 -0
- package/dist/i18n/RJEditorI18nContext.d.ts +3 -0
- package/dist/i18n/index.d.ts +6 -0
- package/dist/i18n/locales/en.d.ts +2 -0
- package/dist/i18n/locales/ru.d.ts +2 -0
- package/dist/i18n/locales/uz.d.ts +2 -0
- package/dist/i18n/mergeTranslations.d.ts +2 -0
- package/dist/i18n/useRJEditorI18n.d.ts +1 -0
- package/dist/index.d.ts +2 -1
- package/dist/nodes/EquationNode.d.ts +26 -0
- package/dist/nodes/ExtendedTextNode.d.ts +12 -0
- package/dist/nodes/ImageNode.d.ts +62 -0
- package/dist/nodes/YouTubeNode.d.ts +25 -0
- package/dist/nodes/index.d.ts +4 -0
- package/dist/plugins/EquationPlugin.d.ts +1 -0
- package/dist/plugins/ImagePlugin.d.ts +1 -0
- package/dist/plugins/KeyboardShortcutsPlugin.d.ts +1 -0
- package/dist/plugins/TableBoundaryPlugin.d.ts +1 -0
- package/dist/plugins/YouTubePlugin.d.ts +1 -0
- package/dist/rj-editor.css +1 -1
- package/dist/rj-editor.js +32116 -555
- package/dist/rj-editor.umd.cjs +259 -1
- package/dist/slice/index.d.ts +1 -1
- package/dist/slice/toolbarSlice.d.ts +1 -1
- package/dist/types/DeepPartial.d.ts +3 -0
- package/dist/types/EquationDisplayMode.d.ts +1 -0
- package/dist/types/ImageAlignment.d.ts +1 -0
- package/dist/types/ImageObjectFit.d.ts +1 -0
- package/dist/types/ImageTextWrap.d.ts +1 -0
- package/dist/types/InsertEquationPayload.d.ts +5 -0
- package/dist/types/InsertImagePayload.d.ts +19 -0
- package/dist/types/InsertYouTubePayload.d.ts +4 -0
- package/dist/types/RJEditorLocaleCode.d.ts +1 -0
- package/dist/types/RJEditorTranslations.d.ts +173 -0
- package/dist/types/SerializedEquationNode.d.ts +6 -0
- package/dist/types/SerializedImageNode.d.ts +20 -0
- package/dist/types/SerializedYouTubeNode.d.ts +5 -0
- package/dist/types/ToolbarState.d.ts +35 -0
- package/dist/types/index.d.ts +13 -0
- package/dist/utils/helpers/clampValue.d.ts +1 -0
- package/dist/utils/helpers/formatNumberText.d.ts +1 -0
- package/dist/utils/helpers/formatShortcutTitle.d.ts +1 -0
- package/dist/utils/helpers/getYouTubeVideoId.d.ts +1 -0
- package/dist/utils/helpers/index.d.ts +12 -0
- package/dist/utils/helpers/isApplePlatform.d.ts +1 -0
- package/dist/utils/helpers/normalizeNumberText.d.ts +1 -0
- package/dist/utils/helpers/normalizeRJEditorHtml.d.ts +2 -0
- package/dist/utils/helpers/numberToInputText.d.ts +1 -0
- package/dist/utils/helpers/openFilePicker.d.ts +1 -0
- package/dist/utils/helpers/readFileAsDataUrl.d.ts +1 -0
- package/dist/utils/helpers/renderEquationToHtml.d.ts +3 -0
- package/dist/utils/helpers/setEditorHtml.d.ts +2 -0
- package/package.json +33 -1
- /package/dist/components/toolbar/{alignment → home/alignment}/AlignmentControls.d.ts +0 -0
- /package/dist/components/toolbar/{divider → home/divider}/ToolbarDivider.d.ts +0 -0
- /package/dist/components/toolbar/{history → home/history}/HistoryControls.d.ts +0 -0
- /package/dist/components/toolbar/{list → home/list}/ListControls.d.ts +0 -0
- /package/dist/components/toolbar/{style-controls → home/style-controls}/StyleControls.d.ts +0 -0
- /package/dist/components/toolbar/{style-controls → home/style-controls}/background-color/BackgroundColorControl.d.ts +0 -0
- /package/dist/components/toolbar/{style-controls → home/style-controls}/clear-formatting/ClearFormattingControl.d.ts +0 -0
- /package/dist/components/toolbar/{style-controls → home/style-controls}/font-family/FontFamilyControl.d.ts +0 -0
- /package/dist/components/toolbar/{style-controls → home/style-controls}/font-size/FontSizeControl.d.ts +0 -0
- /package/dist/components/toolbar/{style-controls → home/style-controls}/text-color/TextColorControl.d.ts +0 -0
- /package/dist/components/toolbar/{style-controls → home/style-controls}/utils.d.ts +0 -0
- /package/dist/components/toolbar/{text-format → home/text-format}/TextFormatControls.d.ts +0 -0
package/dist/slice/index.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { setCanRedo, setCanUndo, setStyleFormats, setTextFormats, toolbarReducer, } from './toolbarSlice';
|
|
1
|
+
export { setBlockFormats, setCanRedo, setCanUndo, setEquationFormats, setImageFormats, setStyleFormats, setTableFormats, setTextFormats, toolbarReducer, } from './toolbarSlice';
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import type { ToolbarState } from '@/types';
|
|
2
|
-
export declare const setCanRedo: import("@reduxjs/toolkit").ActionCreatorWithPayload<boolean, "toolbar/setCanRedo">, setCanUndo: import("@reduxjs/toolkit").ActionCreatorWithPayload<boolean, "toolbar/setCanUndo">, setStyleFormats: import("@reduxjs/toolkit").ActionCreatorWithPayload<Pick<ToolbarState, "backgroundColor" | "fontFamily" | "fontSize" | "textColor">, "toolbar/setStyleFormats">, setTextFormats: import("@reduxjs/toolkit").ActionCreatorWithPayload<Pick<ToolbarState, "isBold" | "isItalic" | "isStrikethrough" | "isUnderline">, "toolbar/setTextFormats">;
|
|
2
|
+
export declare const setBlockFormats: import("@reduxjs/toolkit").ActionCreatorWithPayload<Pick<ToolbarState, "alignment" | "listType">, "toolbar/setBlockFormats">, setCanRedo: import("@reduxjs/toolkit").ActionCreatorWithPayload<boolean, "toolbar/setCanRedo">, setCanUndo: import("@reduxjs/toolkit").ActionCreatorWithPayload<boolean, "toolbar/setCanUndo">, setEquationFormats: import("@reduxjs/toolkit").ActionCreatorWithPayload<Pick<ToolbarState, "isEquationSelected" | "selectedEquation" | "selectedEquationDisplayMode" | "selectedEquationKey">, "toolbar/setEquationFormats">, setImageFormats: import("@reduxjs/toolkit").ActionCreatorWithPayload<Pick<ToolbarState, "isImageSelected" | "selectedImageAspectRatioLocked" | "selectedImageAlignment" | "selectedImageAltText" | "selectedImageBorderEnabled" | "selectedImageBorderRadius" | "selectedImageCaption" | "selectedImageHeight" | "selectedImageKey" | "selectedImageLinkUrl" | "selectedImageObjectFit" | "selectedImageRotation" | "selectedImageShadowEnabled" | "selectedImageTextWrap" | "selectedImageWidth">, "toolbar/setImageFormats">, setStyleFormats: import("@reduxjs/toolkit").ActionCreatorWithPayload<Pick<ToolbarState, "backgroundColor" | "fontFamily" | "fontSize" | "lineHeight" | "textColor">, "toolbar/setStyleFormats">, setTableFormats: import("@reduxjs/toolkit").ActionCreatorWithPayload<Pick<ToolbarState, "isInTable" | "selectedTableCellsCount" | "tableCellBackgroundColor" | "tableCellVerticalAlign" | "tableHasMergedCell">, "toolbar/setTableFormats">, setTextFormats: import("@reduxjs/toolkit").ActionCreatorWithPayload<Pick<ToolbarState, "isBold" | "isItalic" | "isStrikethrough" | "isSubscript" | "isSuperscript" | "isUnderline">, "toolbar/setTextFormats">;
|
|
3
3
|
export declare const toolbarReducer: import("redux").Reducer<ToolbarState>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export type EquationDisplayMode = 'block' | 'inline';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export type ImageAlignment = 'center' | 'left' | 'right';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export type ImageObjectFit = 'contain' | 'cover' | 'fill';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export type ImageTextWrap = 'square' | 'top-bottom';
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { ImageAlignment } from './ImageAlignment';
|
|
2
|
+
import type { ImageObjectFit } from './ImageObjectFit';
|
|
3
|
+
import type { ImageTextWrap } from './ImageTextWrap';
|
|
4
|
+
export type InsertImagePayload = {
|
|
5
|
+
alignment?: ImageAlignment;
|
|
6
|
+
aspectRatioLocked?: boolean;
|
|
7
|
+
altText?: string;
|
|
8
|
+
borderEnabled?: boolean;
|
|
9
|
+
borderRadius?: number;
|
|
10
|
+
caption?: string;
|
|
11
|
+
height?: number;
|
|
12
|
+
linkUrl?: string;
|
|
13
|
+
objectFit?: ImageObjectFit;
|
|
14
|
+
rotation?: number;
|
|
15
|
+
shadowEnabled?: boolean;
|
|
16
|
+
src: string;
|
|
17
|
+
textWrap?: ImageTextWrap;
|
|
18
|
+
width?: number;
|
|
19
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export type RJEditorLocaleCode = 'en' | 'ru' | 'uz' | (string & {});
|
|
@@ -0,0 +1,173 @@
|
|
|
1
|
+
export type RJEditorTranslations = {
|
|
2
|
+
alerts: {
|
|
3
|
+
imageSizeLimit: string;
|
|
4
|
+
onlyImages: string;
|
|
5
|
+
};
|
|
6
|
+
common: {
|
|
7
|
+
cancel: string;
|
|
8
|
+
close: string;
|
|
9
|
+
insert: string;
|
|
10
|
+
moreColors: string;
|
|
11
|
+
none: string;
|
|
12
|
+
optional: string;
|
|
13
|
+
save: string;
|
|
14
|
+
};
|
|
15
|
+
modal: {
|
|
16
|
+
closeAriaLabel: string;
|
|
17
|
+
};
|
|
18
|
+
placeholders: {
|
|
19
|
+
editor: string;
|
|
20
|
+
};
|
|
21
|
+
toolbar: {
|
|
22
|
+
alignment: {
|
|
23
|
+
center: string;
|
|
24
|
+
justify: string;
|
|
25
|
+
left: string;
|
|
26
|
+
right: string;
|
|
27
|
+
};
|
|
28
|
+
fullscreen: {
|
|
29
|
+
close: string;
|
|
30
|
+
open: string;
|
|
31
|
+
};
|
|
32
|
+
history: {
|
|
33
|
+
redo: string;
|
|
34
|
+
undo: string;
|
|
35
|
+
};
|
|
36
|
+
image: {
|
|
37
|
+
alignCenter: string;
|
|
38
|
+
alignLeft: string;
|
|
39
|
+
alignRight: string;
|
|
40
|
+
alt: string;
|
|
41
|
+
altPlaceholder: string;
|
|
42
|
+
border: string;
|
|
43
|
+
borderRadius: string;
|
|
44
|
+
caption: string;
|
|
45
|
+
captionPlaceholder: string;
|
|
46
|
+
cropMode: string;
|
|
47
|
+
delete: string;
|
|
48
|
+
editAlt: string;
|
|
49
|
+
editCaption: string;
|
|
50
|
+
editLink: string;
|
|
51
|
+
fitContain: string;
|
|
52
|
+
fitCover: string;
|
|
53
|
+
fitFill: string;
|
|
54
|
+
link: string;
|
|
55
|
+
linkPlaceholder: string;
|
|
56
|
+
replace: string;
|
|
57
|
+
rotateLeft: string;
|
|
58
|
+
rotateRight: string;
|
|
59
|
+
shadow: string;
|
|
60
|
+
squareWrap: string;
|
|
61
|
+
topBottomWrap: string;
|
|
62
|
+
width: string;
|
|
63
|
+
};
|
|
64
|
+
insert: {
|
|
65
|
+
equation: string;
|
|
66
|
+
horizontalLine: string;
|
|
67
|
+
image: string;
|
|
68
|
+
link: string;
|
|
69
|
+
table: string;
|
|
70
|
+
youtube: string;
|
|
71
|
+
};
|
|
72
|
+
link: {
|
|
73
|
+
openInNewTab: string;
|
|
74
|
+
text: string;
|
|
75
|
+
textPlaceholder: string;
|
|
76
|
+
title: string;
|
|
77
|
+
titlePlaceholder: string;
|
|
78
|
+
url: string;
|
|
79
|
+
urlPlaceholder: string;
|
|
80
|
+
};
|
|
81
|
+
list: {
|
|
82
|
+
bullet: string;
|
|
83
|
+
numbered: string;
|
|
84
|
+
remove: string;
|
|
85
|
+
};
|
|
86
|
+
spacing: {
|
|
87
|
+
default: string;
|
|
88
|
+
lineAndParagraph: string;
|
|
89
|
+
};
|
|
90
|
+
shortcuts: {
|
|
91
|
+
backgroundColor: string;
|
|
92
|
+
bold: string;
|
|
93
|
+
bulletList: string;
|
|
94
|
+
clearFormatting: string;
|
|
95
|
+
decreaseIndent: string;
|
|
96
|
+
fontFamily: string;
|
|
97
|
+
fontSize: string;
|
|
98
|
+
increaseIndent: string;
|
|
99
|
+
italic: string;
|
|
100
|
+
link: string;
|
|
101
|
+
numberedList: string;
|
|
102
|
+
redo: string;
|
|
103
|
+
removeList: string;
|
|
104
|
+
spacing: string;
|
|
105
|
+
strikethrough: string;
|
|
106
|
+
subscript: string;
|
|
107
|
+
superscript: string;
|
|
108
|
+
textColor: string;
|
|
109
|
+
underline: string;
|
|
110
|
+
undo: string;
|
|
111
|
+
};
|
|
112
|
+
style: {
|
|
113
|
+
backgroundColor: string;
|
|
114
|
+
clearFormatting: string;
|
|
115
|
+
fontFamily: string;
|
|
116
|
+
fontFamilyPlaceholder: string;
|
|
117
|
+
fontSize: string;
|
|
118
|
+
fontSizePlaceholder: string;
|
|
119
|
+
textColor: string;
|
|
120
|
+
};
|
|
121
|
+
table: {
|
|
122
|
+
alignBottom: string;
|
|
123
|
+
alignMiddle: string;
|
|
124
|
+
alignTop: string;
|
|
125
|
+
background: string;
|
|
126
|
+
columns: string;
|
|
127
|
+
deleteColumn: string;
|
|
128
|
+
deleteRow: string;
|
|
129
|
+
deleteTable: string;
|
|
130
|
+
headerColumn: string;
|
|
131
|
+
headerRow: string;
|
|
132
|
+
header: string;
|
|
133
|
+
insertColumnLeft: string;
|
|
134
|
+
insertColumnRight: string;
|
|
135
|
+
insertRowAbove: string;
|
|
136
|
+
insertRowBelow: string;
|
|
137
|
+
insertTable: string;
|
|
138
|
+
insertTableSize: string;
|
|
139
|
+
mergeCells: string;
|
|
140
|
+
columnLeft: string;
|
|
141
|
+
columnRight: string;
|
|
142
|
+
rowAbove: string;
|
|
143
|
+
rowBelow: string;
|
|
144
|
+
column: string;
|
|
145
|
+
row: string;
|
|
146
|
+
rows: string;
|
|
147
|
+
unmergeCell: string;
|
|
148
|
+
};
|
|
149
|
+
tabs: {
|
|
150
|
+
equation: string;
|
|
151
|
+
home: string;
|
|
152
|
+
image: string;
|
|
153
|
+
insert: string;
|
|
154
|
+
layout: string;
|
|
155
|
+
table: string;
|
|
156
|
+
};
|
|
157
|
+
textFormat: {
|
|
158
|
+
bold: string;
|
|
159
|
+
italic: string;
|
|
160
|
+
strikethrough: string;
|
|
161
|
+
subscript: string;
|
|
162
|
+
superscript: string;
|
|
163
|
+
underline: string;
|
|
164
|
+
};
|
|
165
|
+
youtube: {
|
|
166
|
+
invalidUrl: string;
|
|
167
|
+
title: string;
|
|
168
|
+
titlePlaceholder: string;
|
|
169
|
+
url: string;
|
|
170
|
+
urlPlaceholder: string;
|
|
171
|
+
};
|
|
172
|
+
};
|
|
173
|
+
};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { SerializedLexicalNode } from 'lexical';
|
|
2
|
+
import type { ImageAlignment } from './ImageAlignment';
|
|
3
|
+
import type { ImageObjectFit } from './ImageObjectFit';
|
|
4
|
+
import type { ImageTextWrap } from './ImageTextWrap';
|
|
5
|
+
export type SerializedImageNode = SerializedLexicalNode & {
|
|
6
|
+
alignment: ImageAlignment;
|
|
7
|
+
aspectRatioLocked: boolean;
|
|
8
|
+
altText: string;
|
|
9
|
+
borderEnabled: boolean;
|
|
10
|
+
borderRadius: number;
|
|
11
|
+
caption: string;
|
|
12
|
+
height?: number;
|
|
13
|
+
linkUrl: string;
|
|
14
|
+
objectFit: ImageObjectFit;
|
|
15
|
+
rotation: number;
|
|
16
|
+
shadowEnabled: boolean;
|
|
17
|
+
src: string;
|
|
18
|
+
textWrap: ImageTextWrap;
|
|
19
|
+
width: number;
|
|
20
|
+
};
|
|
@@ -1,12 +1,47 @@
|
|
|
1
|
+
import type { ElementFormatType } from 'lexical';
|
|
2
|
+
import type { ListType } from '@lexical/list';
|
|
3
|
+
import type { EquationDisplayMode } from './EquationDisplayMode';
|
|
4
|
+
import type { ImageAlignment } from './ImageAlignment';
|
|
5
|
+
import type { ImageObjectFit } from './ImageObjectFit';
|
|
6
|
+
import type { ImageTextWrap } from './ImageTextWrap';
|
|
1
7
|
export type ToolbarState = {
|
|
8
|
+
alignment: ElementFormatType;
|
|
2
9
|
canRedo: boolean;
|
|
3
10
|
canUndo: boolean;
|
|
4
11
|
backgroundColor: string;
|
|
5
12
|
fontFamily?: string;
|
|
6
13
|
fontSize?: string;
|
|
14
|
+
isEquationSelected: boolean;
|
|
7
15
|
isBold: boolean;
|
|
16
|
+
isImageSelected: boolean;
|
|
8
17
|
isItalic: boolean;
|
|
9
18
|
isStrikethrough: boolean;
|
|
19
|
+
isSubscript: boolean;
|
|
20
|
+
isSuperscript: boolean;
|
|
10
21
|
isUnderline: boolean;
|
|
22
|
+
isInTable: boolean;
|
|
23
|
+
selectedTableCellsCount: number;
|
|
24
|
+
tableCellBackgroundColor: string;
|
|
25
|
+
tableCellVerticalAlign?: string;
|
|
26
|
+
tableHasMergedCell: boolean;
|
|
27
|
+
lineHeight?: string;
|
|
28
|
+
listType?: ListType;
|
|
29
|
+
selectedImageAspectRatioLocked?: boolean;
|
|
30
|
+
selectedImageAlignment?: ImageAlignment;
|
|
31
|
+
selectedImageAltText?: string;
|
|
32
|
+
selectedImageBorderEnabled?: boolean;
|
|
33
|
+
selectedImageBorderRadius?: number;
|
|
34
|
+
selectedImageCaption?: string;
|
|
35
|
+
selectedImageHeight?: number;
|
|
36
|
+
selectedImageKey?: string;
|
|
37
|
+
selectedImageLinkUrl?: string;
|
|
38
|
+
selectedImageObjectFit?: ImageObjectFit;
|
|
39
|
+
selectedImageRotation?: number;
|
|
40
|
+
selectedImageShadowEnabled?: boolean;
|
|
41
|
+
selectedImageTextWrap?: ImageTextWrap;
|
|
42
|
+
selectedImageWidth?: number;
|
|
43
|
+
selectedEquation?: string;
|
|
44
|
+
selectedEquationDisplayMode?: EquationDisplayMode;
|
|
45
|
+
selectedEquationKey?: string;
|
|
11
46
|
textColor: string;
|
|
12
47
|
};
|
package/dist/types/index.d.ts
CHANGED
|
@@ -1,4 +1,17 @@
|
|
|
1
1
|
export type { AppDispatch } from './AppDispatch';
|
|
2
|
+
export type { DeepPartial } from './DeepPartial';
|
|
3
|
+
export type { EquationDisplayMode } from './EquationDisplayMode';
|
|
4
|
+
export type { ImageAlignment } from './ImageAlignment';
|
|
5
|
+
export type { ImageObjectFit } from './ImageObjectFit';
|
|
6
|
+
export type { ImageTextWrap } from './ImageTextWrap';
|
|
7
|
+
export type { InsertImagePayload } from './InsertImagePayload';
|
|
8
|
+
export type { InsertEquationPayload } from './InsertEquationPayload';
|
|
9
|
+
export type { InsertYouTubePayload } from './InsertYouTubePayload';
|
|
10
|
+
export type { RJEditorLocaleCode } from './RJEditorLocaleCode';
|
|
11
|
+
export type { RJEditorTranslations } from './RJEditorTranslations';
|
|
2
12
|
export type { RJTextEditorValue } from './RJTextEditorValue';
|
|
3
13
|
export type { RootState } from './RootState';
|
|
14
|
+
export type { SerializedEquationNode } from './SerializedEquationNode';
|
|
15
|
+
export type { SerializedImageNode } from './SerializedImageNode';
|
|
16
|
+
export type { SerializedYouTubeNode } from './SerializedYouTubeNode';
|
|
4
17
|
export type { ToolbarState } from './ToolbarState';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function clampValue(value: number, min?: number, max?: number): number;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function formatNumberText(value: string, locale: boolean): string;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function formatShortcutTitle(shortcut: string, label: string): string;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function getYouTubeVideoId(value: string): string | null;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export { clampValue } from './clampValue';
|
|
2
|
+
export { formatNumberText } from './formatNumberText';
|
|
3
|
+
export { formatShortcutTitle } from './formatShortcutTitle';
|
|
4
|
+
export { getYouTubeVideoId } from './getYouTubeVideoId';
|
|
5
|
+
export { isApplePlatform } from './isApplePlatform';
|
|
6
|
+
export { normalizeNumberText } from './normalizeNumberText';
|
|
7
|
+
export { normalizeRJEditorHtml } from './normalizeRJEditorHtml';
|
|
8
|
+
export { numberToInputText } from './numberToInputText';
|
|
9
|
+
export { openFilePicker } from './openFilePicker';
|
|
10
|
+
export { readFileAsDataUrl } from './readFileAsDataUrl';
|
|
11
|
+
export { renderEquationToHtml } from './renderEquationToHtml';
|
|
12
|
+
export { setEditorHtml } from './setEditorHtml';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function isApplePlatform(): boolean;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function normalizeNumberText(value: string, decimalScale: number, integerOnly: boolean): string;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function numberToInputText(value: number | undefined, locale: boolean): string;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function openFilePicker(inputElement: HTMLInputElement | null): Promise<void>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function readFileAsDataUrl(file: File): Promise<string>;
|
package/package.json
CHANGED
|
@@ -1,10 +1,31 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "rj-editor",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "React rich text editor: toolbar tabs, table, image, link, YouTube, i18n, theme va Ant Design Form integratsiyasi.",
|
|
4
5
|
"type": "module",
|
|
6
|
+
"license": "MIT",
|
|
7
|
+
"author": "Ravshan Jumaqulov",
|
|
5
8
|
"main": "./dist/rj-editor.umd.cjs",
|
|
6
9
|
"module": "./dist/rj-editor.js",
|
|
7
10
|
"types": "./dist/index.d.ts",
|
|
11
|
+
"homepage": "https://rj-editor.vercel.app",
|
|
12
|
+
"repository": {
|
|
13
|
+
"type": "git",
|
|
14
|
+
"url": "git+https://github.com/RavshanJumaqulov/rj-editor.git"
|
|
15
|
+
},
|
|
16
|
+
"bugs": {
|
|
17
|
+
"url": "https://github.com/RavshanJumaqulov/rj-editor/issues"
|
|
18
|
+
},
|
|
19
|
+
"keywords": [
|
|
20
|
+
"react",
|
|
21
|
+
"rich-text-editor",
|
|
22
|
+
"editor",
|
|
23
|
+
"wysiwyg",
|
|
24
|
+
"antd",
|
|
25
|
+
"table",
|
|
26
|
+
"image",
|
|
27
|
+
"uzbek"
|
|
28
|
+
],
|
|
8
29
|
"exports": {
|
|
9
30
|
".": {
|
|
10
31
|
"types": "./dist/index.d.ts",
|
|
@@ -16,9 +37,17 @@
|
|
|
16
37
|
"files": [
|
|
17
38
|
"dist"
|
|
18
39
|
],
|
|
40
|
+
"publishConfig": {
|
|
41
|
+
"access": "public"
|
|
42
|
+
},
|
|
43
|
+
"sideEffects": [
|
|
44
|
+
"*.css",
|
|
45
|
+
"**/*.css"
|
|
46
|
+
],
|
|
19
47
|
"scripts": {
|
|
20
48
|
"dev": "vite",
|
|
21
49
|
"build": "vite build && tsc -p tsconfig.lib.json",
|
|
50
|
+
"build:demo": "vite build --config vite.demo.config.ts",
|
|
22
51
|
"lint": "eslint .",
|
|
23
52
|
"preview": "vite preview"
|
|
24
53
|
},
|
|
@@ -30,8 +59,11 @@
|
|
|
30
59
|
"@lexical/react": "^0.44.0",
|
|
31
60
|
"@lexical/rich-text": "^0.44.0",
|
|
32
61
|
"@lexical/selection": "^0.44.0",
|
|
62
|
+
"@lexical/table": "^0.44.0",
|
|
63
|
+
"@lexical/utils": "^0.44.0",
|
|
33
64
|
"@reduxjs/toolkit": "^2.12.0",
|
|
34
65
|
"antd": "^6.4.3",
|
|
66
|
+
"katex": "^0.17.0",
|
|
35
67
|
"lexical": "^0.44.0",
|
|
36
68
|
"react-redux": "^9.3.0"
|
|
37
69
|
},
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|