erl-mathtextx-editor 0.1.2
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/LICENSE +21 -0
- package/README.md +251 -0
- package/dist/CellPropertiesDialogImpl-CgWcr4bD.js +101 -0
- package/dist/ContentViewer-DcvxXP9t.js +43 -0
- package/dist/ImageInsertDialog-Di0MXcC2.js +222 -0
- package/dist/InsertTableDialogImpl-CKirXRqE.js +100 -0
- package/dist/LinkDialogImpl-BSz0F-xG.js +136 -0
- package/dist/MathTextXEditor.d.ts +8 -0
- package/dist/TableTemplatesDialogImpl-DrdqLQLH.js +64 -0
- package/dist/TemplatePanel-BE_UfzYM.js +710 -0
- package/dist/assets/erl-mathtextx-editor.css +1 -0
- package/dist/assets/viewer.css +1 -0
- package/dist/components/CellPropertiesDialog.d.ts +4 -0
- package/dist/components/CellPropertiesDialogImpl.d.ts +14 -0
- package/dist/components/GraphComponent.d.ts +3 -0
- package/dist/components/ImageContextMenu.d.ts +18 -0
- package/dist/components/ImageEditDialog.d.ts +25 -0
- package/dist/components/ImageInsertDialog.d.ts +14 -0
- package/dist/components/ImageNodeView.d.ts +3 -0
- package/dist/components/InsertTableDialog.d.ts +4 -0
- package/dist/components/InsertTableDialogImpl.d.ts +7 -0
- package/dist/components/LinkDialog.d.ts +4 -0
- package/dist/components/LinkDialogImpl.d.ts +18 -0
- package/dist/components/TableMenu.d.ts +21 -0
- package/dist/components/TableTemplatesDialog.d.ts +4 -0
- package/dist/components/TableTemplatesDialogImpl.d.ts +15 -0
- package/dist/components/WordCount.d.ts +6 -0
- package/dist/components/__tests__/WordCount.test.d.ts +1 -0
- package/dist/components/tableTemplateStyles.d.ts +2 -0
- package/dist/components/useDialogA11y.d.ts +6 -0
- package/dist/components/wordCountUtils.d.ts +3 -0
- package/dist/core/__tests__/serializer.test.d.ts +1 -0
- package/dist/core/extensions.d.ts +9 -0
- package/dist/core/serializer.d.ts +24 -0
- package/dist/erl-mathtextx-editor.js +30 -0
- package/dist/erl-mathtextx-editor.umd.cjs +3508 -0
- package/dist/extensions/GraphExtension.d.ts +9 -0
- package/dist/index-CLGg8QXp.js +8700 -0
- package/dist/index-DYxMVo98.js +4599 -0
- package/dist/index.d.ts +33 -0
- package/dist/math/MathNodes.d.ts +11 -0
- package/dist/math/MathTypeDialog.d.ts +8 -0
- package/dist/math/MatrixGridSelector.d.ts +5 -0
- package/dist/math/SymbolPalette.d.ts +5 -0
- package/dist/math/TemplatePanel.d.ts +5 -0
- package/dist/mathlive-BwNIIOwE.js +14488 -0
- package/dist/templates/index.d.ts +17 -0
- package/dist/tiptap-BhJ7Fu9S.js +17927 -0
- package/dist/toolbar/MainToolbar.d.ts +14 -0
- package/dist/toolbar/MathToolbar.d.ts +7 -0
- package/dist/types/index.d.ts +73 -0
- package/dist/utils/exportUtils.d.ts +19 -0
- package/dist/utils/pasteHandler.d.ts +17 -0
- package/dist/viewer/ContentViewer.d.ts +29 -0
- package/dist/viewer/index.d.ts +2 -0
- package/dist/viewer/styles.d.ts +0 -0
- package/dist/viewer-deps-xNPNdmbe.js +12141 -0
- package/dist/viewer-styles.d.ts +1 -0
- package/dist/viewer-styles.js +1 -0
- package/dist/viewer.d.ts +2 -0
- package/dist/viewer.js +4 -0
- package/package.json +132 -0
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { CellPropertiesData, CellPropertiesDialogProps } from './CellPropertiesDialogImpl';
|
|
3
|
+
export declare const CellPropertiesDialog: React.NamedExoticComponent<CellPropertiesDialogProps>;
|
|
4
|
+
export type { CellPropertiesDialogProps, CellPropertiesData };
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
export interface CellPropertiesData {
|
|
3
|
+
width?: string;
|
|
4
|
+
backgroundColor?: string;
|
|
5
|
+
horizontalAlign?: 'left' | 'center' | 'right';
|
|
6
|
+
verticalAlign?: 'top' | 'middle' | 'bottom';
|
|
7
|
+
}
|
|
8
|
+
export interface CellPropertiesDialogProps {
|
|
9
|
+
isOpen: boolean;
|
|
10
|
+
initialData?: CellPropertiesData;
|
|
11
|
+
onSave: (data: CellPropertiesData) => void;
|
|
12
|
+
onClose: () => void;
|
|
13
|
+
}
|
|
14
|
+
export declare const CellPropertiesDialogImpl: React.MemoExoticComponent<({ isOpen, initialData, onSave, onClose, }: CellPropertiesDialogProps) => import("react/jsx-runtime").JSX.Element | null>;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
type ImageAlign = 'left' | 'center' | 'right' | 'full';
|
|
3
|
+
export interface ImageContextMenuProps {
|
|
4
|
+
isOpen: boolean;
|
|
5
|
+
position: {
|
|
6
|
+
x: number;
|
|
7
|
+
y: number;
|
|
8
|
+
} | null;
|
|
9
|
+
currentAlign: ImageAlign;
|
|
10
|
+
hasCustomPosition?: boolean;
|
|
11
|
+
onClose: () => void;
|
|
12
|
+
onSetAlign: (align: ImageAlign) => void;
|
|
13
|
+
onResetPosition?: () => void;
|
|
14
|
+
onCenterImage?: () => void;
|
|
15
|
+
onEditImage?: () => void;
|
|
16
|
+
}
|
|
17
|
+
export declare const ImageContextMenu: React.NamedExoticComponent<ImageContextMenuProps>;
|
|
18
|
+
export {};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
export interface ImageEditDialogProps {
|
|
2
|
+
isOpen: boolean;
|
|
3
|
+
onClose: () => void;
|
|
4
|
+
onApply: (data: ImageEditData) => void;
|
|
5
|
+
initialData?: ImageEditData;
|
|
6
|
+
}
|
|
7
|
+
export interface ImageEditData {
|
|
8
|
+
width: string | number;
|
|
9
|
+
height: string | number;
|
|
10
|
+
align: 'left' | 'center' | 'right' | 'full';
|
|
11
|
+
alt: string;
|
|
12
|
+
title: string;
|
|
13
|
+
maintainAspectRatio: boolean;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* ImageEditDialog - Dialog untuk edit properties gambar
|
|
17
|
+
* Features:
|
|
18
|
+
* - Resize dengan input width/height
|
|
19
|
+
* - Aspect ratio lock
|
|
20
|
+
* - Alignment options
|
|
21
|
+
* - Alt text untuk aksesibilitas
|
|
22
|
+
* - Caption
|
|
23
|
+
*/
|
|
24
|
+
export declare function ImageEditDialog({ isOpen, onClose, onApply, initialData, }: ImageEditDialogProps): import("react/jsx-runtime").JSX.Element | null;
|
|
25
|
+
export default ImageEditDialog;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
interface ImageInsertDialogProps {
|
|
2
|
+
isOpen: boolean;
|
|
3
|
+
onClose: () => void;
|
|
4
|
+
onInsert: (url: string, alt?: string) => void;
|
|
5
|
+
/** Optional custom upload handler. If provided, Upload tab is enabled. */
|
|
6
|
+
onImageUpload?: (file: File) => Promise<string>;
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* ImageInsertDialog — Modal dialog for inserting images via:
|
|
10
|
+
* 1. File Upload (click or drag & drop)
|
|
11
|
+
* 2. URL input
|
|
12
|
+
*/
|
|
13
|
+
export declare function ImageInsertDialog({ isOpen, onClose, onInsert, onImageUpload, }: ImageInsertDialogProps): import("react/jsx-runtime").JSX.Element | null;
|
|
14
|
+
export {};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
export interface InsertTableDialogProps {
|
|
3
|
+
isOpen: boolean;
|
|
4
|
+
onInsert: (rows: number, cols: number, withHeaderRow: boolean) => void;
|
|
5
|
+
onClose: () => void;
|
|
6
|
+
}
|
|
7
|
+
export declare const InsertTableDialogImpl: React.MemoExoticComponent<({ isOpen, onInsert, onClose }: InsertTableDialogProps) => import("react/jsx-runtime").JSX.Element | null>;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
export interface LinkDialogProps {
|
|
3
|
+
isOpen: boolean;
|
|
4
|
+
currentUrl?: string;
|
|
5
|
+
currentText?: string;
|
|
6
|
+
currentTitle?: string;
|
|
7
|
+
currentTarget?: string;
|
|
8
|
+
onInsert: (data: LinkData) => void;
|
|
9
|
+
onRemove?: () => void;
|
|
10
|
+
onClose: () => void;
|
|
11
|
+
}
|
|
12
|
+
export interface LinkData {
|
|
13
|
+
url: string;
|
|
14
|
+
text?: string;
|
|
15
|
+
title?: string;
|
|
16
|
+
target?: string;
|
|
17
|
+
}
|
|
18
|
+
export declare const LinkDialogImpl: React.MemoExoticComponent<({ isOpen, currentUrl, currentText, currentTitle, currentTarget, onInsert, onRemove, onClose, }: LinkDialogProps) => import("react/jsx-runtime").JSX.Element | null>;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
export interface TableMenuProps {
|
|
3
|
+
isOpen: boolean;
|
|
4
|
+
position: {
|
|
5
|
+
x: number;
|
|
6
|
+
y: number;
|
|
7
|
+
} | null;
|
|
8
|
+
onClose: () => void;
|
|
9
|
+
onAddRowBefore: () => void;
|
|
10
|
+
onAddRowAfter: () => void;
|
|
11
|
+
onDeleteRow: () => void;
|
|
12
|
+
onAddColumnBefore: () => void;
|
|
13
|
+
onAddColumnAfter: () => void;
|
|
14
|
+
onDeleteColumn: () => void;
|
|
15
|
+
onDeleteTable: () => void;
|
|
16
|
+
onMergeCells?: () => void;
|
|
17
|
+
onSplitCell?: () => void;
|
|
18
|
+
onCellProperties?: () => void;
|
|
19
|
+
onTableProperties?: () => void;
|
|
20
|
+
}
|
|
21
|
+
export declare const TableMenu: React.MemoExoticComponent<({ isOpen, position, onClose, onAddRowBefore, onAddRowAfter, onDeleteRow, onAddColumnBefore, onAddColumnAfter, onDeleteColumn, onDeleteTable, onMergeCells, onSplitCell, onCellProperties, onTableProperties, }: TableMenuProps) => import("react/jsx-runtime").JSX.Element | null>;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { TableTemplate, TableTemplatesDialogProps } from './TableTemplatesDialogImpl';
|
|
3
|
+
export declare const TableTemplatesDialog: React.NamedExoticComponent<TableTemplatesDialogProps>;
|
|
4
|
+
export type { TableTemplatesDialogProps, TableTemplate };
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
export interface TableTemplate {
|
|
3
|
+
id: string;
|
|
4
|
+
name: string;
|
|
5
|
+
description: string;
|
|
6
|
+
headerStyle: 'none' | 'light' | 'dark' | 'blue';
|
|
7
|
+
borderStyle: 'all' | 'horizontal' | 'vertical' | 'none';
|
|
8
|
+
stripeRows: boolean;
|
|
9
|
+
}
|
|
10
|
+
export interface TableTemplatesDialogProps {
|
|
11
|
+
isOpen: boolean;
|
|
12
|
+
onSelect: (template: TableTemplate) => void;
|
|
13
|
+
onClose: () => void;
|
|
14
|
+
}
|
|
15
|
+
export declare const TableTemplatesDialogImpl: React.MemoExoticComponent<({ isOpen, onSelect, onClose }: TableTemplatesDialogProps) => import("react/jsx-runtime").JSX.Element | null>;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { Editor } from '@tiptap/react';
|
|
3
|
+
export interface WordCountProps {
|
|
4
|
+
editor: Editor | null;
|
|
5
|
+
}
|
|
6
|
+
export declare const WordCount: React.MemoExoticComponent<({ editor }: WordCountProps) => import("react/jsx-runtime").JSX.Element>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { Extensions } from '@tiptap/core';
|
|
2
|
+
export interface ExtensionsConfig {
|
|
3
|
+
placeholder?: string;
|
|
4
|
+
}
|
|
5
|
+
/**
|
|
6
|
+
* Creates the default set of TipTap extensions for MathTextX editor.
|
|
7
|
+
* Includes text formatting, lists, tables, images, links, and more.
|
|
8
|
+
*/
|
|
9
|
+
export declare function createExtensions(config?: ExtensionsConfig): Extensions;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { Editor } from '@tiptap/react';
|
|
2
|
+
/**
|
|
3
|
+
* Serializer utilities for converting between HTML and TipTap JSON format.
|
|
4
|
+
* Ensures backward compatibility with CKEditor HTML output.
|
|
5
|
+
*/
|
|
6
|
+
/**
|
|
7
|
+
* Get editor content as HTML string.
|
|
8
|
+
* Output is compatible with CKEditor HTML format.
|
|
9
|
+
*/
|
|
10
|
+
export declare function getHTML(editor: Editor): string;
|
|
11
|
+
/**
|
|
12
|
+
* Get editor content as TipTap JSON.
|
|
13
|
+
*/
|
|
14
|
+
export declare function getJSON(editor: Editor): Record<string, unknown>;
|
|
15
|
+
/**
|
|
16
|
+
* Sanitize HTML from CKEditor to ensure it renders properly in TipTap.
|
|
17
|
+
* Handles common CKEditor-specific tags and attributes.
|
|
18
|
+
*/
|
|
19
|
+
export declare function sanitizeCKEditorHTML(html: string): string;
|
|
20
|
+
/**
|
|
21
|
+
* Convert TipTap HTML output to be compatible with CKEditor format.
|
|
22
|
+
* This ensures existing renderers in solutest.id can still display the content.
|
|
23
|
+
*/
|
|
24
|
+
export declare function toCompatibleHTML(html: string): string;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { C as t, I as s, a as o, L as l, M as i, b as r, c as T, d as g, e as n, S as m, T as p, f as C, W as M, g as b, h as d, i as h, j as c, k as L, l as y, m as D, n as u, o as x, p as E, s as I, t as S } from "./index-DYxMVo98.js";
|
|
2
|
+
import { C as k } from "./ContentViewer-DcvxXP9t.js";
|
|
3
|
+
export {
|
|
4
|
+
t as CellPropertiesDialog,
|
|
5
|
+
k as ContentViewer,
|
|
6
|
+
s as ImageEditDialog,
|
|
7
|
+
o as InsertTableDialog,
|
|
8
|
+
l as LinkDialog,
|
|
9
|
+
i as MainToolbar,
|
|
10
|
+
r as MathBlockNode,
|
|
11
|
+
T as MathInlineNode,
|
|
12
|
+
g as MathTextXEditor,
|
|
13
|
+
n as MathToolbar,
|
|
14
|
+
m as SymbolPalette,
|
|
15
|
+
p as TableMenu,
|
|
16
|
+
C as TableTemplatesDialog,
|
|
17
|
+
M as WordCount,
|
|
18
|
+
b as countCharacters,
|
|
19
|
+
d as countWords,
|
|
20
|
+
h as createExtensions,
|
|
21
|
+
c as getHTML,
|
|
22
|
+
L as getJSON,
|
|
23
|
+
y as getTemplateCategories,
|
|
24
|
+
D as getTemplateStyles,
|
|
25
|
+
u as getTemplatesByCategory,
|
|
26
|
+
x as getTemplatesByLevel,
|
|
27
|
+
E as mathTemplates,
|
|
28
|
+
I as sanitizeCKEditorHTML,
|
|
29
|
+
S as toCompatibleHTML
|
|
30
|
+
};
|