@lax-wp/editor 0.0.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/README.md +724 -0
- package/dist/components/Editor.d.ts +6 -0
- package/dist/components/EditorShell.d.ts +1 -0
- package/dist/components/PresentationControls.d.ts +6 -0
- package/dist/components/base/Button.d.ts +14 -0
- package/dist/components/base/Button1.d.ts +24 -0
- package/dist/components/base/ColorPicker.d.ts +14 -0
- package/dist/components/base/index.d.ts +1 -0
- package/dist/components/common/ScrollbarWrapper.d.ts +5 -0
- package/dist/components/common/SkeletonLine.d.ts +6 -0
- package/dist/components/common/SvgIcon.d.ts +15 -0
- package/dist/components/footer/index.d.ts +5 -0
- package/dist/components/menubar/BubbleMenuContent.d.ts +6 -0
- package/dist/components/menubar/bubble-menu/DefaultBubbleMenuContent.d.ts +1 -0
- package/dist/components/menubar/bubble-menu/ImageMenuContent.d.ts +1 -0
- package/dist/components/menubar/bubble-menu/LinkActions.d.ts +4 -0
- package/dist/components/menubar/bubble-menu/LinkMenuContent.d.ts +1 -0
- package/dist/components/menubar/bubble-menu/index.d.ts +4 -0
- package/dist/components/node/ImageNode.d.ts +5 -0
- package/dist/components/shared/BasicFontStyleOptions.d.ts +1 -0
- package/dist/components/shared/ClearTextFormatButton.d.ts +1 -0
- package/dist/components/shared/FontSizeStepper.d.ts +1 -0
- package/dist/components/shared/InsertLinkButton.d.ts +4 -0
- package/dist/components/shared/ParagraphAlignmentOptions.d.ts +1 -0
- package/dist/components/toolbar/ClassicToolbar.d.ts +8 -0
- package/dist/components/toolbar/Divider.d.ts +1 -0
- package/dist/components/toolbar/FontStyleOptions.d.ts +4 -0
- package/dist/components/toolbar/HeadingOptions.d.ts +6 -0
- package/dist/components/toolbar/HomeOptions.d.ts +6 -0
- package/dist/components/toolbar/InsertOptions.d.ts +6 -0
- package/dist/components/toolbar/ItemGroup.d.ts +6 -0
- package/dist/components/toolbar/LinkActionsModal.d.ts +14 -0
- package/dist/components/toolbar/LinkModal.d.ts +16 -0
- package/dist/components/toolbar/OrderedListTypeDropdownContent.d.ts +7 -0
- package/dist/components/toolbar/ParagraphStyleOption.d.ts +6 -0
- package/dist/components/toolbar/ProfessionalToolbar.d.ts +8 -0
- package/dist/components/toolbar/RenderToolbarTabContent.d.ts +6 -0
- package/dist/components/toolbar/ScrollableContent.d.ts +14 -0
- package/dist/components/toolbar/Toolbar.d.ts +10 -0
- package/dist/components/toolbar/ToolbarButtonItem.d.ts +15 -0
- package/dist/components/toolbar/ToolbarDropdown.d.ts +5 -0
- package/dist/components/toolbar/UnorderedListTypeDropdownContent.d.ts +7 -0
- package/dist/components/toolbar/export/index.d.ts +1 -0
- package/dist/components/toolbar/home/FontStyleOptions.d.ts +1 -0
- package/dist/components/toolbar/home/HeadingOptions.d.ts +1 -0
- package/dist/components/toolbar/home/OrderedListTypeDropdownContent.d.ts +5 -0
- package/dist/components/toolbar/home/ParagraphStyleOption.d.ts +1 -0
- package/dist/components/toolbar/home/UnorderedListTypeDropdownContent.d.ts +5 -0
- package/dist/components/toolbar/home/index.d.ts +1 -0
- package/dist/components/toolbar/index.d.ts +11 -0
- package/dist/components/toolbar/insert/CodeBlockToolbar.d.ts +8 -0
- package/dist/components/toolbar/insert/DividerDropdownContent.d.ts +5 -0
- package/dist/components/toolbar/insert/ImageUploadForm.d.ts +6 -0
- package/dist/components/toolbar/insert/LinkForm.d.ts +10 -0
- package/dist/components/toolbar/insert/index.d.ts +1 -0
- package/dist/components/toolbar/page/PageBackgroundColorPicker.d.ts +8 -0
- package/dist/components/toolbar/page/PageMarginPicker.d.ts +8 -0
- package/dist/components/toolbar/page/PageOrientationSelector.d.ts +8 -0
- package/dist/components/toolbar/page/PageSizeSelector.d.ts +13 -0
- package/dist/components/toolbar/page/index.d.ts +1 -0
- package/dist/components/toolbar/table/TableSelector.d.ts +8 -0
- package/dist/components/toolbar/table/index.d.ts +1 -0
- package/dist/config/editorConfig.d.ts +43 -0
- package/dist/constants/AI.d.ts +2 -0
- package/dist/constants/CodeBlock.d.ts +8 -0
- package/dist/constants/Common.d.ts +8 -0
- package/dist/constants/DividerLineTypes.d.ts +4 -0
- package/dist/constants/Fonts.d.ts +8 -0
- package/dist/constants/Footer.d.ts +1 -0
- package/dist/constants/Heading.d.ts +42 -0
- package/dist/constants/Image.d.ts +15 -0
- package/dist/constants/LinkConstants.d.ts +4 -0
- package/dist/constants/PageBackground.d.ts +4 -0
- package/dist/constants/Paragraphs.d.ts +12 -0
- package/dist/constants/TinkConstants.d.ts +4 -0
- package/dist/constants/Toolbar.d.ts +25 -0
- package/dist/constants/base.d.ts +1 -0
- package/dist/constants/index.d.ts +6 -0
- package/dist/contexts/EditorShellContext.d.ts +15 -0
- package/dist/contexts/ToolbarContext.d.ts +25 -0
- package/dist/editor.css +1 -0
- package/dist/extensions/AIAutoCompletion.d.ts +38 -0
- package/dist/extensions/CodeBlockWithToolbar.d.ts +28 -0
- package/dist/extensions/CustomImageExtension.d.ts +15 -0
- package/dist/extensions/HorizontalRuleWithStyle.d.ts +10 -0
- package/dist/extensions/Indent.d.ts +15 -0
- package/dist/extensions/ListItemWithDepthLimit.d.ts +4 -0
- package/dist/extensions/OnBlurHighlight.d.ts +2 -0
- package/dist/extensions/OrderedListWithType.d.ts +9 -0
- package/dist/extensions/PageBackground.d.ts +20 -0
- package/dist/extensions/PageBreak.d.ts +16 -0
- package/dist/extensions/PageMargin.d.ts +79 -0
- package/dist/extensions/UnorderedListWithType.d.ts +9 -0
- package/dist/extensions/VariableTable.d.ts +4 -0
- package/dist/extensions/VariableText.d.ts +39 -0
- package/dist/extensions/index.d.ts +2 -0
- package/dist/hooks/useCodeEditor.d.ts +25 -0
- package/dist/hooks/useExport.d.ts +7 -0
- package/dist/hooks/useFontStyleMethods.d.ts +19 -0
- package/dist/hooks/useHeadingStyleMethods.d.ts +3 -0
- package/dist/hooks/useHomeOptionMethods.d.ts +13 -0
- package/dist/hooks/useHorizontalScroll.d.ts +13 -0
- package/dist/hooks/useImageAlignment.d.ts +12 -0
- package/dist/hooks/useImageResize.d.ts +17 -0
- package/dist/hooks/useImageUpload.d.ts +17 -0
- package/dist/hooks/useInsertOptionMethods.d.ts +4 -0
- package/dist/hooks/useLinks.d.ts +15 -0
- package/dist/hooks/usePageMethods.d.ts +56 -0
- package/dist/hooks/useParagraphStyleMethods.d.ts +16 -0
- package/dist/hooks/usePresentationMode.d.ts +7 -0
- package/dist/hooks/useTableMethods.d.ts +12 -0
- package/dist/hooks/useTiptapEditorState.d.ts +40 -0
- package/dist/hooks/useZoom.d.ts +7 -0
- package/dist/index.d.ts +5 -0
- package/dist/index.es.js +64287 -0
- package/dist/index.umd.js +196 -0
- package/dist/lax-wp-editor.css +1 -0
- package/dist/utils/Common.d.ts +1 -0
- package/dist/utils/svgIconRegistry.d.ts +1 -0
- package/dist/vite.svg +1 -0
- package/package.json +117 -0
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export declare const useFontStyleMethods: () => {
|
|
2
|
+
handleFontFamilyChange: (fontFamily: string) => void;
|
|
3
|
+
handleFontSizeChange: (size: number | null) => void;
|
|
4
|
+
increaseFontSize: () => void;
|
|
5
|
+
decreaseFontSize: () => void;
|
|
6
|
+
handleSuperscriptToggle: () => void;
|
|
7
|
+
handleSubscriptToggle: () => void;
|
|
8
|
+
handleToggleBold: () => void;
|
|
9
|
+
handleToggleItalic: () => void;
|
|
10
|
+
handleToggleUnderline: () => void;
|
|
11
|
+
handleToggleStrike: () => void;
|
|
12
|
+
handleSetColor: (color: string) => void;
|
|
13
|
+
handleUnsetColor: () => void;
|
|
14
|
+
handleSetBackgroundColor: (color: string) => void;
|
|
15
|
+
handleUnsetBackgroundColor: () => void;
|
|
16
|
+
handleSetHighlightColor: (color: string) => void;
|
|
17
|
+
handleUnsetHighlightColor: () => void;
|
|
18
|
+
isEditable: boolean;
|
|
19
|
+
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export declare const useHomeOptionMethods: () => {
|
|
2
|
+
handleUndo: () => void;
|
|
3
|
+
handleRedo: () => void;
|
|
4
|
+
handleAIAutocompletion: () => void;
|
|
5
|
+
handleToggleAIAutocompletion?: undefined;
|
|
6
|
+
handleClearFormatting?: undefined;
|
|
7
|
+
} | {
|
|
8
|
+
handleUndo: () => void;
|
|
9
|
+
handleRedo: () => void;
|
|
10
|
+
handleToggleAIAutocompletion: () => void;
|
|
11
|
+
handleClearFormatting: () => void;
|
|
12
|
+
handleAIAutocompletion?: undefined;
|
|
13
|
+
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
interface UseHorizontalScrollReturn {
|
|
2
|
+
contentScrollerRef: React.RefObject<HTMLDivElement>;
|
|
3
|
+
showScrollButtons: boolean;
|
|
4
|
+
scrollPosition: number;
|
|
5
|
+
canScrollLeft: boolean;
|
|
6
|
+
canScrollRight: boolean;
|
|
7
|
+
handleScroll: () => void;
|
|
8
|
+
handleScrollLeft: () => void;
|
|
9
|
+
handleScrollRight: () => void;
|
|
10
|
+
checkContentOverflow: () => void;
|
|
11
|
+
}
|
|
12
|
+
export declare const useHorizontalScroll: (dependency?: unknown) => UseHorizontalScrollReturn;
|
|
13
|
+
export {};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { type AlignType } from "@/constants/Common";
|
|
2
|
+
interface UseImageAlignmentReturn {
|
|
3
|
+
currentImageAlignment: AlignType;
|
|
4
|
+
currentImageWidth: number;
|
|
5
|
+
updateImageAlignment: (alignment: AlignType) => void;
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* Custom hook to manage image alignment in the editor
|
|
9
|
+
* Tracks the currently selected image's alignment and provides methods to update it
|
|
10
|
+
*/
|
|
11
|
+
export declare const useImageAlignment: () => UseImageAlignmentReturn;
|
|
12
|
+
export {};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { NodeViewProps } from "@tiptap/react";
|
|
2
|
+
import { type ResizeCursorPositionType } from "@/constants/Image";
|
|
3
|
+
interface UseImageResizeProps {
|
|
4
|
+
node: NodeViewProps["node"];
|
|
5
|
+
updateAttributes: NodeViewProps["updateAttributes"];
|
|
6
|
+
}
|
|
7
|
+
export declare const useImageResize: ({ node, updateAttributes, }: UseImageResizeProps) => {
|
|
8
|
+
imgRef: import("react").RefObject<HTMLImageElement>;
|
|
9
|
+
isResizing: boolean;
|
|
10
|
+
currentWidth: any;
|
|
11
|
+
align: any;
|
|
12
|
+
imgCursor: string;
|
|
13
|
+
containerStyle: import("react").CSSProperties;
|
|
14
|
+
handleMouseDown: (e: React.MouseEvent, handle: ResizeCursorPositionType) => void;
|
|
15
|
+
getHandleStyle: (handle: ResizeCursorPositionType) => React.CSSProperties;
|
|
16
|
+
};
|
|
17
|
+
export {};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
interface UseImageUploadProps {
|
|
2
|
+
onSubmit?: () => void;
|
|
3
|
+
onCancel?: () => void;
|
|
4
|
+
}
|
|
5
|
+
export declare const useImageUpload: ({ onSubmit, onCancel, }: UseImageUploadProps) => {
|
|
6
|
+
imageUrl: string;
|
|
7
|
+
setImageUrl: import("react").Dispatch<import("react").SetStateAction<string>>;
|
|
8
|
+
selectedFile: File | null;
|
|
9
|
+
previewUrl: string;
|
|
10
|
+
uploading: boolean;
|
|
11
|
+
fileInputRef: import("react").RefObject<HTMLInputElement>;
|
|
12
|
+
handleFileSelect: (event: React.ChangeEvent<HTMLInputElement>) => void;
|
|
13
|
+
handleUpload: () => Promise<void>;
|
|
14
|
+
clearForm: () => void;
|
|
15
|
+
handleKeyDown: (e: React.KeyboardEvent) => void;
|
|
16
|
+
};
|
|
17
|
+
export {};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export declare const useLinks: () => {
|
|
2
|
+
linkUrl: string;
|
|
3
|
+
copied: boolean;
|
|
4
|
+
shouldShowLinkOnBubbleMenu: ({ state }: {
|
|
5
|
+
state: any;
|
|
6
|
+
}) => any;
|
|
7
|
+
handleCopy: () => void;
|
|
8
|
+
handleRemove: () => void;
|
|
9
|
+
handleInsertLink: (url: string, text?: string) => void;
|
|
10
|
+
handleEditLink: (url: string) => void;
|
|
11
|
+
getSelectionLinkValues: () => {
|
|
12
|
+
initialUrl: any;
|
|
13
|
+
initialText: string;
|
|
14
|
+
};
|
|
15
|
+
};
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import type { PageConfig } from "@/components/toolbar/page/PageSizeSelector";
|
|
2
|
+
export interface MarginValues {
|
|
3
|
+
top: number;
|
|
4
|
+
right: number;
|
|
5
|
+
bottom: number;
|
|
6
|
+
left: number;
|
|
7
|
+
}
|
|
8
|
+
export declare const DEFAULT_MARGINS: MarginValues;
|
|
9
|
+
export declare const PRESET_MARGINS: {
|
|
10
|
+
Normal: {
|
|
11
|
+
top: number;
|
|
12
|
+
right: number;
|
|
13
|
+
bottom: number;
|
|
14
|
+
left: number;
|
|
15
|
+
};
|
|
16
|
+
Narrow: {
|
|
17
|
+
top: number;
|
|
18
|
+
right: number;
|
|
19
|
+
bottom: number;
|
|
20
|
+
left: number;
|
|
21
|
+
};
|
|
22
|
+
Moderate: {
|
|
23
|
+
top: number;
|
|
24
|
+
right: number;
|
|
25
|
+
bottom: number;
|
|
26
|
+
left: number;
|
|
27
|
+
};
|
|
28
|
+
Wide: {
|
|
29
|
+
top: number;
|
|
30
|
+
right: number;
|
|
31
|
+
bottom: number;
|
|
32
|
+
left: number;
|
|
33
|
+
};
|
|
34
|
+
Mirrored: {
|
|
35
|
+
top: number;
|
|
36
|
+
right: number;
|
|
37
|
+
bottom: number;
|
|
38
|
+
left: number;
|
|
39
|
+
};
|
|
40
|
+
};
|
|
41
|
+
export declare const usePageMethods: () => {
|
|
42
|
+
pageClass: string;
|
|
43
|
+
selectedBGColor: string;
|
|
44
|
+
handleSetPageBackgroundColor: (color: string) => void;
|
|
45
|
+
pageConfig: PageConfig;
|
|
46
|
+
setPageConfig: import("react").Dispatch<import("react").SetStateAction<PageConfig>>;
|
|
47
|
+
handleInsertPageBreak: () => void;
|
|
48
|
+
margins: MarginValues;
|
|
49
|
+
inputValues: Record<keyof MarginValues, string>;
|
|
50
|
+
handleMarginInputChange: (side: keyof MarginValues, value: string) => void;
|
|
51
|
+
handleMarginInputBlur: (side: keyof MarginValues) => void;
|
|
52
|
+
handleMarginKeyDown: (event: React.KeyboardEvent<HTMLInputElement>, side: keyof MarginValues) => void;
|
|
53
|
+
applyPresetMargins: (presetName: keyof typeof PRESET_MARGINS) => void;
|
|
54
|
+
resetMarginsToDefault: (setPageOrientation: (orientation: "portrait" | "landscape") => void) => void;
|
|
55
|
+
applyMargins: (onClose?: () => void) => void;
|
|
56
|
+
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { OrderedListType } from "@/extensions/OrderedListWithType";
|
|
2
|
+
import type { UnorderedListType } from "@/extensions/UnorderedListWithType";
|
|
3
|
+
export declare const useParagraphStyleMethods: () => {
|
|
4
|
+
handleToggleTaskList: () => void;
|
|
5
|
+
handleIndent: () => void;
|
|
6
|
+
handleOutdent: () => void;
|
|
7
|
+
handleToggleOrderedList: () => void;
|
|
8
|
+
handleListTypeChange: (listType: OrderedListType) => void;
|
|
9
|
+
handleToggleUnorderedList: () => void;
|
|
10
|
+
handleUnorderedListTypeChange: (listType: UnorderedListType) => void;
|
|
11
|
+
handleTextAlignLeft: () => void;
|
|
12
|
+
handleTextAlignCenter: () => void;
|
|
13
|
+
handleTextAlignRight: () => void;
|
|
14
|
+
handleTextAlignJustify: () => void;
|
|
15
|
+
handleToggleBlockquote: () => void;
|
|
16
|
+
};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { Editor } from "@tiptap/react";
|
|
2
|
+
export declare const usePresentationMode: (editor: Editor | null) => {
|
|
3
|
+
isPresentationMode: boolean;
|
|
4
|
+
isLaserActive: boolean;
|
|
5
|
+
onPresentationModeToggle: () => void;
|
|
6
|
+
handleLaserToggle: (isActive: boolean) => void;
|
|
7
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export declare const useTableMethods: () => {
|
|
2
|
+
handleInsertTable: (rows: number, cols: number, withHeaderRow: boolean) => void;
|
|
3
|
+
handleInsertRowAbove: () => void;
|
|
4
|
+
handleInsertRowBelow: () => void;
|
|
5
|
+
handleDeleteRow: () => void;
|
|
6
|
+
handleInsertColumnLeft: () => void;
|
|
7
|
+
handleInsertColumnRight: () => void;
|
|
8
|
+
handleDeleteColumn: () => void;
|
|
9
|
+
handleMergeCells: () => void;
|
|
10
|
+
handleSplitCell: () => void;
|
|
11
|
+
handleDeleteTable: () => void;
|
|
12
|
+
};
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
export declare const useTiptapEditorState: () => {
|
|
2
|
+
canUndo: boolean;
|
|
3
|
+
canRedo: boolean;
|
|
4
|
+
isBold: boolean;
|
|
5
|
+
canBold: boolean;
|
|
6
|
+
isItalic: boolean;
|
|
7
|
+
canItalic: boolean;
|
|
8
|
+
isStrike: boolean;
|
|
9
|
+
canStrike: boolean;
|
|
10
|
+
isUnderline: boolean;
|
|
11
|
+
canUnderline: boolean;
|
|
12
|
+
isSuperscript: boolean;
|
|
13
|
+
canSuperscript: boolean;
|
|
14
|
+
isSubscript: boolean;
|
|
15
|
+
canSubscript: boolean;
|
|
16
|
+
selectionColor: any;
|
|
17
|
+
selectionBackgroundColor: any;
|
|
18
|
+
highlightColor: any;
|
|
19
|
+
fontSize: number;
|
|
20
|
+
fontFamily: any;
|
|
21
|
+
characterCount: number;
|
|
22
|
+
wordCount: number;
|
|
23
|
+
isAIAutocompletionEnabled: boolean;
|
|
24
|
+
isTaskList: boolean;
|
|
25
|
+
canIndent: boolean;
|
|
26
|
+
canOutdent: boolean;
|
|
27
|
+
isOrderedList: boolean;
|
|
28
|
+
currentOrderedListType: any;
|
|
29
|
+
isUnorderedList: boolean;
|
|
30
|
+
currentUnorderedListType: any;
|
|
31
|
+
isTextAlignJustify: boolean;
|
|
32
|
+
isTextAlignCenter: boolean;
|
|
33
|
+
isTextAlignRight: boolean;
|
|
34
|
+
isTextAlignLeft: boolean;
|
|
35
|
+
isBlockquote: boolean;
|
|
36
|
+
canBlockquote: boolean;
|
|
37
|
+
selectionHeadingLevel: any;
|
|
38
|
+
isTableActive: boolean;
|
|
39
|
+
isLinkActive: boolean;
|
|
40
|
+
};
|
package/dist/index.d.ts
ADDED