ct-rich-text-editor 1.0.8 → 1.1.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/dist/App.d.ts +4 -0
- package/dist/Provider/EditorProvider.d.ts +19 -0
- package/dist/Provider/LexicalProvider.d.ts +7 -0
- package/dist/api/ai/index.d.ts +15 -0
- package/dist/api/auth.d.ts +102 -0
- package/dist/api/config/axios.d.ts +3 -0
- package/dist/api/config/endpoints.d.ts +11 -0
- package/dist/assets/style.css +1 -0
- package/dist/babel-1c4a328b.js +7479 -0
- package/dist/babel-1c4a328b.js.map +1 -0
- package/dist/components/AiPlugin/index.d.ts +4 -0
- package/dist/components/AlignMenu/AlignMenu.d.ts +10 -0
- package/dist/components/AlignMenu/index.d.ts +1 -0
- package/dist/components/BlockFormatMenu/BlockFormatMenu.d.ts +5 -0
- package/dist/components/BlockFormatMenu/constants.d.ts +14 -0
- package/dist/components/BlockFormatMenu/index.d.ts +1 -0
- package/dist/components/CodeActionMenuPlugin/components/CopyButton/index.d.ts +8 -0
- package/dist/components/CodeActionMenuPlugin/components/PrettierButton/index.d.ts +10 -0
- package/dist/components/CodeActionMenuPlugin/index.d.ts +5 -0
- package/dist/components/CodeActionMenuPlugin/utils.d.ts +1 -0
- package/dist/components/ColorPicker/ColorPicker.d.ts +5 -0
- package/dist/components/ColorPicker/index.d.ts +1 -0
- package/dist/components/ConfigurableEditorWithAuth.d.ts +15 -0
- package/dist/components/EmojiPickerWidget/EmojiPickerWidget.d.ts +5 -0
- package/dist/components/EmojiPickerWidget/index.d.ts +1 -0
- package/dist/components/FileUpload/InsertFileDialog.d.ts +7 -0
- package/dist/components/FileUpload/InsertFileUploadedDialogBody.d.ts +6 -0
- package/dist/components/FontFamilySelect/FontFamilyMenu.d.ts +9 -0
- package/dist/components/FontSizePicker/FontSizeControl.d.ts +4 -0
- package/dist/components/FormatTextMenu/FormatTextMenu.d.ts +5 -0
- package/dist/components/FormatTextMenu/index.d.ts +1 -0
- package/dist/components/HighlightColorPicker/HighlightColorPicker.d.ts +8 -0
- package/dist/components/HtmlViewDisplay.d.ts +4 -0
- package/dist/components/ImageInsertTest.d.ts +4 -0
- package/dist/components/ImageView/ImageDialog/ImageUploadDialogBody.d.ts +10 -0
- package/dist/components/ImageView/ImageDialog/index.d.ts +7 -0
- package/dist/components/ImageView/ImageResizer.d.ts +17 -0
- package/dist/components/ImageView/index.d.ts +15 -0
- package/dist/components/InsertMenu/InsertMenu.d.ts +10 -0
- package/dist/components/InsertMenu/index.d.ts +1 -0
- package/dist/components/Placeholder/Placeholder.d.ts +5 -0
- package/dist/components/Placeholder/index.d.ts +1 -0
- package/dist/components/Placeholder/styles.d.ts +1 -0
- package/dist/components/ScopedEditor.d.ts +8 -0
- package/dist/components/TableColorPicker/index.d.ts +9 -0
- package/dist/components/TableModal/TableModal.d.ts +11 -0
- package/dist/components/Toolbar/Toolbar.d.ts +5 -0
- package/dist/components/Toolbar/index.d.ts +1 -0
- package/dist/components/Toolbar/styles.d.ts +6 -0
- package/dist/components/ui/button.d.ts +12 -0
- package/dist/components/ui/dialog.d.ts +19 -0
- package/dist/components/ui/dropdown-menu.d.ts +27 -0
- package/dist/components/ui/input.d.ts +3 -0
- package/dist/components/ui/label.d.ts +5 -0
- package/dist/components/ui/popover.d.ts +7 -0
- package/dist/components/ui/select.d.ts +13 -0
- package/dist/components/ui/separator.d.ts +4 -0
- package/dist/components/ui/tooltip.d.ts +7 -0
- package/dist/constants.d.ts +36 -0
- package/dist/context/HtmlViewContext.d.ts +18 -0
- package/dist/context/ToolbarContext.d.ts +56 -0
- package/dist/editorConfig.d.ts +43 -0
- package/dist/estree-2cbea43c.js +4668 -0
- package/dist/estree-2cbea43c.js.map +1 -0
- package/dist/hooks/useBlockFormat.d.ts +22 -0
- package/dist/hooks/useColorPicker.d.ts +6 -0
- package/dist/hooks/useCustomCommands.d.ts +4 -0
- package/dist/hooks/useDebounce.d.ts +1 -0
- package/dist/hooks/useEditorToolbar.d.ts +11 -0
- package/dist/hooks/useInsertMenu.d.ts +9 -0
- package/dist/hooks/useModal.d.ts +5 -0
- package/dist/hooks/useS3Uploader.d.ts +11 -0
- package/dist/html-c18fb60e.js +2842 -0
- package/dist/html-c18fb60e.js.map +1 -0
- package/dist/index-17957a89.js +33013 -0
- package/dist/index-17957a89.js.map +1 -0
- package/dist/index-6f1ddbc9.js +632 -0
- package/dist/index-6f1ddbc9.js.map +1 -0
- package/dist/index.d.ts +7 -0
- package/dist/index.js +23 -0
- package/dist/index.js.map +1 -0
- package/dist/lib/utils.d.ts +3 -0
- package/dist/main.d.ts +1 -0
- package/dist/markdown-39c3822b.js +3548 -0
- package/dist/markdown-39c3822b.js.map +1 -0
- package/dist/nodes/EmbedNode.d.ts +27 -0
- package/dist/nodes/ImageNode.d.ts +48 -0
- package/dist/nodes/MentionNode.d.ts +76 -0
- package/dist/pages/ConfigurableEditor/ConfigurableEditor.d.ts +14 -0
- package/dist/pages/ConfigurableEditor/index.d.ts +2 -0
- package/dist/pages/NotFound.d.ts +2 -0
- package/dist/pages/RichTextEditor.d.ts +6 -0
- package/dist/pages/TextareaEditor.d.ts +6 -0
- package/dist/pages/styles.d.ts +5 -0
- package/dist/plugins/AIChatPlugin.d.ts +6 -0
- package/dist/plugins/AutocompletePlugin.d.ts +26 -0
- package/dist/plugins/CodeHighlightPlugin.d.ts +4 -0
- package/dist/plugins/CustomHorizontalRulePlugin/CustomHorizontalRuleNode.d.ts +31 -0
- package/dist/plugins/CustomHorizontalRulePlugin/CustomHorizontalRulePlugin.d.ts +3 -0
- package/dist/plugins/CustomHorizontalRulePlugin/HorizontalRuleCustomizationDialog.d.ts +9 -0
- package/dist/plugins/CustomHorizontalRulePlugin/index.d.ts +3 -0
- package/dist/plugins/DragDropPastePlugin/index.d.ts +8 -0
- package/dist/plugins/EmbedPreviewPlugin/FloatingEmbedMenuPlugin.d.ts +4 -0
- package/dist/plugins/EmbedPreviewPlugin/index.d.ts +7 -0
- package/dist/plugins/FilePlugin.d.ts +8 -0
- package/dist/plugins/FloatingLinkEditorPlugin/index.d.ts +7 -0
- package/dist/plugins/FloatingTextFormatToolbarPlugin/index.d.ts +25 -0
- package/dist/plugins/HtmlCodeViewPlugin/index.d.ts +2 -0
- package/dist/plugins/HtmlImportPlugin.d.ts +5 -0
- package/dist/plugins/HtmlSyncPlugin.d.ts +3 -0
- package/dist/plugins/ImagePlugin.d.ts +10 -0
- package/dist/plugins/LinkPlugin/index.d.ts +7 -0
- package/dist/plugins/LocalStoragePlugin.d.ts +9 -0
- package/dist/plugins/MentionsPlugin/index.d.ts +8 -0
- package/dist/plugins/RichTextPastePlugin/index.d.ts +1 -0
- package/dist/plugins/SignatureCanvasPlugin/SignatureCanvasDialog.d.ts +7 -0
- package/dist/plugins/SignatureCanvasPlugin/SignatureCanvasPlugin.d.ts +3 -0
- package/dist/plugins/SignatureCanvasPlugin/index.d.ts +2 -0
- package/dist/plugins/TableActionMenuPlugin/index.d.ts +7 -0
- package/dist/plugins/TableCellResizer/index.d.ts +3 -0
- package/dist/plugins/TableHoverActionsPlugin/index.d.ts +11 -0
- package/dist/plugins/TablePlugin.d.ts +1 -0
- package/dist/plugins/TreeViewPlugin.d.ts +4 -0
- package/dist/postcss-bbcc713e.js +5152 -0
- package/dist/postcss-bbcc713e.js.map +1 -0
- package/dist/standalone-36ad3877.js +2601 -0
- package/dist/standalone-36ad3877.js.map +1 -0
- package/dist/styles/PlaygroundEditorTheme.d.ts +4 -0
- package/dist/types.d.ts +143 -0
- package/dist/typescript-39d06710.js +13534 -0
- package/dist/typescript-39d06710.js.map +1 -0
- package/dist/ui/ColorPicker.d.ts +14 -0
- package/dist/ui/Icons.d.ts +35 -0
- package/dist/ui/TextInput.d.ts +12 -0
- package/dist/utils/debounce.d.ts +7 -0
- package/dist/utils/getDOMRangeRect.d.ts +13 -0
- package/dist/utils/getSelectedNode.d.ts +4 -0
- package/dist/utils/helper.d.ts +3 -0
- package/dist/utils/index.d.ts +6 -0
- package/dist/utils/invarient.d.ts +1 -0
- package/dist/utils/setFloatingElemPosition.d.ts +8 -0
- package/dist/utils/setFloatingElemPositionForLinkEditor.d.ts +1 -0
- package/dist/utils/url.d.ts +9 -0
- package/package.json +2 -4
- package/dist/assets/babel-70ddf1b3.js +0 -16
- package/dist/assets/babel-70ddf1b3.js.map +0 -1
- package/dist/assets/chevron-down-7ab1bec2.svg +0 -1
- package/dist/assets/close-5a175ff6.svg +0 -1
- package/dist/assets/code-211c00f3.svg +0 -1
- package/dist/assets/copy-0a348586.svg +0 -1
- package/dist/assets/estree-e637acda.js +0 -37
- package/dist/assets/estree-e637acda.js.map +0 -1
- package/dist/assets/html-132cf17b.js +0 -23
- package/dist/assets/html-132cf17b.js.map +0 -1
- package/dist/assets/index-92719fbf.js +0 -2
- package/dist/assets/index-92719fbf.js.map +0 -1
- package/dist/assets/index-a2d0e228.js +0 -443
- package/dist/assets/index-a2d0e228.js.map +0 -1
- package/dist/assets/index-db471160.css +0 -1
- package/dist/assets/link-dabc7da5.svg +0 -1
- package/dist/assets/markdown-d8306e54.js +0 -64
- package/dist/assets/markdown-d8306e54.js.map +0 -1
- package/dist/assets/pencil-fill-633b2c8d.svg +0 -1
- package/dist/assets/plus-cc33d039.svg +0 -1
- package/dist/assets/postcss-25dc98df.js +0 -55
- package/dist/assets/postcss-25dc98df.js.map +0 -1
- package/dist/assets/prettier-6c905155.svg +0 -1
- package/dist/assets/prettier-error-0ed0d492.svg +0 -1
- package/dist/assets/standalone-e79c0887.js +0 -40
- package/dist/assets/standalone-e79c0887.js.map +0 -1
- package/dist/assets/success-e7e6caa5.svg +0 -1
- package/dist/assets/trash-e93c6b1b.svg +0 -1
- package/dist/assets/type-bold-1f17e5da.svg +0 -1
- package/dist/assets/type-capitalize-2bd9e890.svg +0 -1
- package/dist/assets/type-italic-f9cdcec5.svg +0 -1
- package/dist/assets/type-lowercase-e9b820a3.svg +0 -3
- package/dist/assets/type-strikethrough-ea22e2f6.svg +0 -1
- package/dist/assets/type-subscript-84ecc6bb.svg +0 -1
- package/dist/assets/type-superscript-fd5795bc.svg +0 -1
- package/dist/assets/type-underline-9639e1cd.svg +0 -1
- package/dist/assets/type-uppercase-cd9fe147.svg +0 -3
- package/dist/assets/typescript-c6c5f850.js +0 -21
- package/dist/assets/typescript-c6c5f850.js.map +0 -1
- package/dist/assets/user-085d4653.svg +0 -1
- package/dist/index.html +0 -18
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { JSX } from 'react';
|
|
2
|
+
|
|
3
|
+
interface ColorPickerProps {
|
|
4
|
+
color: string;
|
|
5
|
+
onChange?: (value: string, skipHistoryStack: boolean) => void;
|
|
6
|
+
}
|
|
7
|
+
export declare function parseAllowedColor(input: string): string;
|
|
8
|
+
export default function ColorPicker({ color, onChange, }: Readonly<ColorPickerProps>): JSX.Element;
|
|
9
|
+
export interface Position {
|
|
10
|
+
x: number;
|
|
11
|
+
y: number;
|
|
12
|
+
}
|
|
13
|
+
export declare function toHex(value: string): string;
|
|
14
|
+
export {};
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
declare const UnderlineIcon: () => import("react/jsx-runtime").JSX.Element;
|
|
2
|
+
declare const ItalicIcon: () => import("react/jsx-runtime").JSX.Element;
|
|
3
|
+
declare const StrikethroughIcon: () => import("react/jsx-runtime").JSX.Element;
|
|
4
|
+
declare const CodeIcon: () => import("react/jsx-runtime").JSX.Element;
|
|
5
|
+
declare const LinkIcon: () => import("react/jsx-runtime").JSX.Element;
|
|
6
|
+
declare const FaceSmileIcon: () => import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
declare const MagicoonIcon: () => import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
declare const PerspectiveIcon: () => import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
declare const BoldIcon: () => import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
declare const PlusIcon: () => import("react/jsx-runtime").JSX.Element;
|
|
11
|
+
declare const ChevronDownIcon: () => import("react/jsx-runtime").JSX.Element;
|
|
12
|
+
declare const SubscriptIcon: () => import("react/jsx-runtime").JSX.Element;
|
|
13
|
+
declare const SuperscriptIcon: () => import("react/jsx-runtime").JSX.Element;
|
|
14
|
+
declare const MessageEditIcon: () => import("react/jsx-runtime").JSX.Element;
|
|
15
|
+
declare const TypeUppercaseIcon: () => import("react/jsx-runtime").JSX.Element;
|
|
16
|
+
declare const TypeLowercaseIcon: () => import("react/jsx-runtime").JSX.Element;
|
|
17
|
+
declare const TypeCapitalizeIcon: () => import("react/jsx-runtime").JSX.Element;
|
|
18
|
+
declare const UndoIcon: () => import("react/jsx-runtime").JSX.Element;
|
|
19
|
+
declare const RedoIcon: () => import("react/jsx-runtime").JSX.Element;
|
|
20
|
+
declare const UploadIcon: () => import("react/jsx-runtime").JSX.Element;
|
|
21
|
+
declare const AddImageIcon: () => import("react/jsx-runtime").JSX.Element;
|
|
22
|
+
declare const HorizontalRuleIcon: () => import("react/jsx-runtime").JSX.Element;
|
|
23
|
+
declare const SignatureIcon: () => import("react/jsx-runtime").JSX.Element;
|
|
24
|
+
declare const NumberListIcon: () => import("react/jsx-runtime").JSX.Element;
|
|
25
|
+
declare const BulletListIcon: () => import("react/jsx-runtime").JSX.Element;
|
|
26
|
+
declare const CheckBoxIcon: () => import("react/jsx-runtime").JSX.Element;
|
|
27
|
+
declare const SearchTextIcon: () => import("react/jsx-runtime").JSX.Element;
|
|
28
|
+
declare const PenLineIcon: () => import("react/jsx-runtime").JSX.Element;
|
|
29
|
+
declare const MenuAltIcon: () => import("react/jsx-runtime").JSX.Element;
|
|
30
|
+
declare const FaceSmileIcon2: () => import("react/jsx-runtime").JSX.Element;
|
|
31
|
+
declare const TranslateIcon: () => import("react/jsx-runtime").JSX.Element;
|
|
32
|
+
declare const SparkleIcon: () => import("react/jsx-runtime").JSX.Element;
|
|
33
|
+
declare const ImageIcon: () => import("react/jsx-runtime").JSX.Element;
|
|
34
|
+
declare const SendIcon: () => import("react/jsx-runtime").JSX.Element;
|
|
35
|
+
export { AddImageIcon, BoldIcon, BulletListIcon, CheckBoxIcon, ChevronDownIcon, CodeIcon, FaceSmileIcon, FaceSmileIcon2, HorizontalRuleIcon, ImageIcon, ItalicIcon, LinkIcon, MagicoonIcon, MenuAltIcon, MessageEditIcon, NumberListIcon, PenLineIcon, PerspectiveIcon, PlusIcon, RedoIcon, SearchTextIcon, SendIcon, SignatureIcon, SparkleIcon, StrikethroughIcon, SubscriptIcon, SuperscriptIcon, TranslateIcon, TypeCapitalizeIcon, TypeLowercaseIcon, TypeUppercaseIcon, UnderlineIcon, UndoIcon, UploadIcon };
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { JSX, HTMLInputTypeAttribute } from 'react';
|
|
2
|
+
|
|
3
|
+
type Props = Readonly<{
|
|
4
|
+
"data-test-id"?: string;
|
|
5
|
+
label: string;
|
|
6
|
+
onChange: (val: string) => void;
|
|
7
|
+
placeholder?: string;
|
|
8
|
+
value: string;
|
|
9
|
+
type?: HTMLInputTypeAttribute;
|
|
10
|
+
}>;
|
|
11
|
+
export default function TextInput({ label, value, onChange, placeholder, "data-test-id": dataTestId, type, }: Props): JSX.Element;
|
|
12
|
+
export {};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { DebouncedFunctionType } from '../types';
|
|
2
|
+
|
|
3
|
+
/** To help debounce the action of syncing editor's content changes to the external store. Usually, this would be the piece that updates your remote database
|
|
4
|
+
* @see https://konstantinmuenster.medium.com/how-to-build-a-text-editor-with-lexical-and-react-27204c186d0f
|
|
5
|
+
*/
|
|
6
|
+
declare const debounce: <F extends DebouncedFunctionType>(fn: F, delay: number) => F;
|
|
7
|
+
export default debounce;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the MIT license found in the
|
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
|
6
|
+
*
|
|
7
|
+
*/
|
|
8
|
+
/**
|
|
9
|
+
* Retrieves the bounding rectangle of a selected text range within the DOM.
|
|
10
|
+
* This function is useful for determining the exact position of the selected text
|
|
11
|
+
* for rendering overlays or custom UI elements.
|
|
12
|
+
*/
|
|
13
|
+
export declare function getDOMRangeRect(nativeSelection: Selection, rootElement: HTMLElement): DOMRect;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { SxProps, Theme } from '@mui/material';
|
|
2
|
+
import { IMenuButtonStyle } from '../types';
|
|
3
|
+
|
|
4
|
+
export declare const getMenuButtonStyle: ({ open, isMdViewport, }: IMenuButtonStyle) => SxProps;
|
|
5
|
+
export declare const getActiveBtnStyle: (isActive: boolean) => SxProps<Theme>;
|
|
6
|
+
export declare const getColorPickerPaperStyle: () => SxProps;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export default function invariant(cond?: boolean, message?: string, ...args: string[]): asserts cond;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the MIT license found in the
|
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
|
6
|
+
*
|
|
7
|
+
*/
|
|
8
|
+
export declare function setFloatingElemPosition(targetRect: DOMRect | null, floatingElem: HTMLElement, anchorElem: HTMLElement, isLink?: boolean, verticalGap?: number, horizontalOffset?: number, isEmbed?: boolean): void;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function setFloatingElemPositionForLinkEditor(targetRect: DOMRect | null, floatingElem: HTMLElement, anchorElem: HTMLElement, verticalGap?: number, horizontalOffset?: number): void;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the MIT license found in the
|
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
|
6
|
+
*
|
|
7
|
+
*/
|
|
8
|
+
export declare function sanitizeUrl(url: string): string;
|
|
9
|
+
export declare function validateUrl(url: string): boolean;
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ct-rich-text-editor",
|
|
3
3
|
"private": false,
|
|
4
|
-
"version": "1.0
|
|
4
|
+
"version": "1.1.0",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"packageManager": "pnpm@9.0.0",
|
|
7
7
|
"main": "dist/index.js",
|
|
@@ -25,9 +25,7 @@
|
|
|
25
25
|
"scripts": {
|
|
26
26
|
"dev": "vite",
|
|
27
27
|
"build": "tsc && vite build",
|
|
28
|
-
"build:lib": "cross-env BUILD_LIB=true tsc && vite build",
|
|
29
28
|
"preview": "vite preview",
|
|
30
|
-
"preview:lib": "serve dist",
|
|
31
29
|
"prettier:check": "prettier --check \"src/**/*.{js,jsx,ts,tsx}\"",
|
|
32
30
|
"prettier:format": "prettier --write \"src/**/*.{js,jsx,ts,tsx}\"",
|
|
33
31
|
"lint": "eslint \"src/**/*.{js,jsx,ts,tsx}\"",
|
|
@@ -35,7 +33,7 @@
|
|
|
35
33
|
"format": "pnpm prettier:format && pnpm lint:fix",
|
|
36
34
|
"check": "pnpm prettier:check && pnpm lint",
|
|
37
35
|
"prepare": "husky",
|
|
38
|
-
"prepublishOnly": "pnpm build
|
|
36
|
+
"prepublishOnly": "pnpm build"
|
|
39
37
|
},
|
|
40
38
|
"dependencies": {
|
|
41
39
|
"@aws-sdk/client-s3": "^3.744.0",
|