@formulaxjs/tinymce 0.2.1 → 0.3.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 +47 -29
- package/README.zh-CN.md +47 -29
- package/dist/base.css +47 -0
- package/dist/canvg-runtime-UR3JNX5Q.js +2759 -0
- package/dist/canvg-runtime-UR3JNX5Q.js.map +1 -0
- package/dist/chunk-4NHESKRD.js +3407 -0
- package/dist/chunk-4NHESKRD.js.map +1 -0
- package/dist/images/scrollbar/custom/bar-bg.png +0 -0
- package/dist/images/scrollbar/custom/bar.png +0 -0
- package/dist/images/scrollbar/custom/bg.png +0 -0
- package/dist/images/scrollbar/custom/bottom.png +0 -0
- package/dist/images/scrollbar/custom/btn.png +0 -0
- package/dist/images/scrollbar/custom/down.png +0 -0
- package/dist/images/scrollbar/custom/top.png +0 -0
- package/dist/images/scrollbar/custom/up.png +0 -0
- package/dist/images/scrollbar/edit/bar-bg.png +0 -0
- package/dist/images/scrollbar/edit/bar-left.png +0 -0
- package/dist/images/scrollbar/edit/bar-right.png +0 -0
- package/dist/images/scrollbar/edit/thumb-bg.png +0 -0
- package/dist/images/scrollbar/edit/thumb-left.png +0 -0
- package/dist/images/scrollbar/edit/thumb-right.png +0 -0
- package/dist/images/toolbar/btn.png +0 -0
- package/dist/index.cjs +24136 -128
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +125 -0
- package/dist/index.d.ts +125 -0
- package/dist/index.global.js +162 -156
- package/dist/index.global.js.map +1 -1
- package/dist/index.js +3762 -21
- package/dist/index.js.map +1 -1
- package/dist/install-XGCSWTLU.js +5464 -0
- package/dist/install-XGCSWTLU.js.map +1 -0
- package/dist/install-XVTKACEN.js +1349 -0
- package/dist/install-XVTKACEN.js.map +1 -0
- package/dist/other.png +0 -0
- package/dist/scrollbar.css +78 -0
- package/dist/start-CRRRBVTN.js +4926 -0
- package/dist/start-CRRRBVTN.js.map +1 -0
- package/dist/ui.css +625 -0
- package/package.json +12 -7
- /package/dist/{KF_AMS_BB-5QF7FUSO.woff → KF_AMS_BB.woff} +0 -0
- /package/dist/{KF_AMS_CAL-NXRNLAZN.woff → KF_AMS_CAL.woff} +0 -0
- /package/dist/{KF_AMS_FRAK-CO33WWN4.woff → KF_AMS_FRAK.woff} +0 -0
- /package/dist/{KF_AMS_MAIN-25QJVAWY.woff → KF_AMS_MAIN.woff} +0 -0
- /package/dist/{KF_AMS_ROMAN-243BR7HH.woff → KF_AMS_ROMAN.woff} +0 -0
- /package/dist/{btn-5DANP6JY.png → btn.png} +0 -0
- /package/dist/{editor-JT5KLVXX.css → editor.css} +0 -0
- /package/dist/{other-OMWJFGL5.png → images/toolbar/other.png} +0 -0
package/dist/index.d.cts
ADDED
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
import { FormulaDoc } from '@formulaxjs/core';
|
|
2
|
+
import { CreateFormulaMarkupOptions, FormulaRenderer } from '@formulaxjs/renderer';
|
|
3
|
+
export { DEFAULT_FORMULA_ATTRIBUTE, DEFAULT_FORMULA_CLASS, FORMULA_FLAG_ATTRIBUTE, findFormulaElement, getFormulaLatexFromElement, isFormulaElement, replaceFormulaElement } from '@formulaxjs/renderer';
|
|
4
|
+
import { FormulaXEditorPreloadMode, FormulaXEditorOptions } from '@formulaxjs/editor';
|
|
5
|
+
|
|
6
|
+
declare function createTinyMceFormulaMarkup(latex: string, options?: CreateFormulaMarkupOptions): string;
|
|
7
|
+
declare function parseTinyMceFormulaMarkup(latex: string): FormulaDoc;
|
|
8
|
+
declare function serializeTinyMceFormulaMarkup(doc: FormulaDoc, options?: CreateFormulaMarkupOptions): string;
|
|
9
|
+
|
|
10
|
+
interface TinyMceLike {
|
|
11
|
+
PluginManager?: {
|
|
12
|
+
add: (name: string, callback: (editor: TinyMceEditorLike, pluginUrl?: string) => unknown) => void;
|
|
13
|
+
};
|
|
14
|
+
majorVersion?: string | number;
|
|
15
|
+
minorVersion?: string | number;
|
|
16
|
+
}
|
|
17
|
+
interface TinyMceEditorLike {
|
|
18
|
+
id?: string;
|
|
19
|
+
insertContent: (content: string) => void;
|
|
20
|
+
addCommand: (name: string, callback: (...args: unknown[]) => void) => void;
|
|
21
|
+
execCommand: (name: string, ui?: boolean, value?: unknown) => void;
|
|
22
|
+
on: (name: string, callback: (event: any) => void) => void;
|
|
23
|
+
off?: (name: string, callback: (event: any) => void) => void;
|
|
24
|
+
ui?: {
|
|
25
|
+
registry?: {
|
|
26
|
+
addButton?: (name: string, config: Record<string, unknown>) => void;
|
|
27
|
+
addMenuItem?: (name: string, config: Record<string, unknown>) => void;
|
|
28
|
+
addIcon?: (name: string, svg: string) => void;
|
|
29
|
+
};
|
|
30
|
+
};
|
|
31
|
+
selection?: {
|
|
32
|
+
getNode?: () => HTMLElement;
|
|
33
|
+
getRng?: () => Range;
|
|
34
|
+
setRng?: (range: Range) => void;
|
|
35
|
+
select?: (node: HTMLElement) => void;
|
|
36
|
+
collapse?: (toStart?: boolean) => void;
|
|
37
|
+
};
|
|
38
|
+
undoManager?: {
|
|
39
|
+
transact?: (callback: () => void) => void;
|
|
40
|
+
add?: () => void;
|
|
41
|
+
};
|
|
42
|
+
dom?: {
|
|
43
|
+
encode?: (value: string) => string;
|
|
44
|
+
decode?: (value: string) => string;
|
|
45
|
+
};
|
|
46
|
+
schema?: {
|
|
47
|
+
addValidElements?: (validElements: string) => void;
|
|
48
|
+
};
|
|
49
|
+
getDoc?: () => Document;
|
|
50
|
+
getWin?: () => Window;
|
|
51
|
+
getBody?: () => HTMLElement;
|
|
52
|
+
focus?: () => void;
|
|
53
|
+
nodeChanged?: () => void;
|
|
54
|
+
dispatch?: (name: string, args?: Record<string, unknown>) => void;
|
|
55
|
+
fire?: (name: string, args?: Record<string, unknown>) => void;
|
|
56
|
+
}
|
|
57
|
+
interface FormulaXTinyMceOptions {
|
|
58
|
+
pluginName?: string;
|
|
59
|
+
buttonName?: string;
|
|
60
|
+
menuItemName?: string;
|
|
61
|
+
toolbarText?: string;
|
|
62
|
+
tooltip?: string;
|
|
63
|
+
cursorStyle?: string;
|
|
64
|
+
formulaClassName?: string;
|
|
65
|
+
formulaAttributeName?: string;
|
|
66
|
+
renderer?: FormulaRenderer;
|
|
67
|
+
preload?: FormulaXEditorPreloadMode;
|
|
68
|
+
modal?: FormulaXModalOptions;
|
|
69
|
+
initialLatex?: string;
|
|
70
|
+
editor?: Omit<FormulaXEditorOptions, 'initialLatex'>;
|
|
71
|
+
}
|
|
72
|
+
interface FormulaXModalOptions {
|
|
73
|
+
title?: string;
|
|
74
|
+
insertText?: string;
|
|
75
|
+
updateText?: string;
|
|
76
|
+
cancelText?: string;
|
|
77
|
+
width?: string;
|
|
78
|
+
height?: string;
|
|
79
|
+
closeOnBackdrop?: boolean;
|
|
80
|
+
}
|
|
81
|
+
interface RequiredFormulaXTinyMceOptions {
|
|
82
|
+
pluginName: string;
|
|
83
|
+
buttonName: string;
|
|
84
|
+
menuItemName: string;
|
|
85
|
+
toolbarText: string;
|
|
86
|
+
tooltip: string;
|
|
87
|
+
cursorStyle: string;
|
|
88
|
+
formulaClassName: string;
|
|
89
|
+
formulaAttributeName: string;
|
|
90
|
+
initialLatex: string;
|
|
91
|
+
renderer: FormulaRenderer;
|
|
92
|
+
preload: FormulaXEditorPreloadMode;
|
|
93
|
+
modal: Required<FormulaXModalOptions>;
|
|
94
|
+
editor: Required<Omit<FormulaXEditorOptions, 'initialLatex'>>;
|
|
95
|
+
}
|
|
96
|
+
interface FormulaXModalOpenOptions {
|
|
97
|
+
editor: TinyMceEditorLike;
|
|
98
|
+
target?: HTMLElement | null;
|
|
99
|
+
initialLatex?: string;
|
|
100
|
+
options: RequiredFormulaXTinyMceOptions;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
interface TinyMceCompat {
|
|
104
|
+
major: number;
|
|
105
|
+
insertContent: (html: string) => void;
|
|
106
|
+
dispatchEvent: (name: string, detail?: Record<string, unknown>) => void;
|
|
107
|
+
getSelectedFormulaElement: () => HTMLElement | null;
|
|
108
|
+
getEditorDocument: () => Document;
|
|
109
|
+
getEditorWindow: () => Window;
|
|
110
|
+
getEditorBody: () => HTMLElement | null;
|
|
111
|
+
focus: () => void;
|
|
112
|
+
}
|
|
113
|
+
declare function getTinyMceMajorVersion(tinymce?: TinyMceLike): number;
|
|
114
|
+
declare function createTinyMceCompat(editor: TinyMceEditorLike, tinymce?: TinyMceLike): TinyMceCompat;
|
|
115
|
+
declare function warnUnsupportedTinyMceVersion(tinymce?: TinyMceLike): void;
|
|
116
|
+
|
|
117
|
+
declare function resolveOptions(options?: FormulaXTinyMceOptions): RequiredFormulaXTinyMceOptions;
|
|
118
|
+
declare function registerFormulaXTinyMcePlugin(tinymce: TinyMceLike, options?: FormulaXTinyMceOptions): void;
|
|
119
|
+
|
|
120
|
+
interface OpenFormulaXModalResult {
|
|
121
|
+
close: () => void;
|
|
122
|
+
}
|
|
123
|
+
declare function openFormulaXOverlayModal(input: FormulaXModalOpenOptions): OpenFormulaXModalResult;
|
|
124
|
+
|
|
125
|
+
export { type FormulaXModalOpenOptions, type FormulaXModalOptions, type FormulaXTinyMceOptions, type RequiredFormulaXTinyMceOptions, type TinyMceEditorLike, type TinyMceLike, createTinyMceCompat, createTinyMceFormulaMarkup, getTinyMceMajorVersion, openFormulaXOverlayModal, parseTinyMceFormulaMarkup, registerFormulaXTinyMcePlugin, resolveOptions, serializeTinyMceFormulaMarkup, warnUnsupportedTinyMceVersion };
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
import { FormulaDoc } from '@formulaxjs/core';
|
|
2
|
+
import { CreateFormulaMarkupOptions, FormulaRenderer } from '@formulaxjs/renderer';
|
|
3
|
+
export { DEFAULT_FORMULA_ATTRIBUTE, DEFAULT_FORMULA_CLASS, FORMULA_FLAG_ATTRIBUTE, findFormulaElement, getFormulaLatexFromElement, isFormulaElement, replaceFormulaElement } from '@formulaxjs/renderer';
|
|
4
|
+
import { FormulaXEditorPreloadMode, FormulaXEditorOptions } from '@formulaxjs/editor';
|
|
5
|
+
|
|
6
|
+
declare function createTinyMceFormulaMarkup(latex: string, options?: CreateFormulaMarkupOptions): string;
|
|
7
|
+
declare function parseTinyMceFormulaMarkup(latex: string): FormulaDoc;
|
|
8
|
+
declare function serializeTinyMceFormulaMarkup(doc: FormulaDoc, options?: CreateFormulaMarkupOptions): string;
|
|
9
|
+
|
|
10
|
+
interface TinyMceLike {
|
|
11
|
+
PluginManager?: {
|
|
12
|
+
add: (name: string, callback: (editor: TinyMceEditorLike, pluginUrl?: string) => unknown) => void;
|
|
13
|
+
};
|
|
14
|
+
majorVersion?: string | number;
|
|
15
|
+
minorVersion?: string | number;
|
|
16
|
+
}
|
|
17
|
+
interface TinyMceEditorLike {
|
|
18
|
+
id?: string;
|
|
19
|
+
insertContent: (content: string) => void;
|
|
20
|
+
addCommand: (name: string, callback: (...args: unknown[]) => void) => void;
|
|
21
|
+
execCommand: (name: string, ui?: boolean, value?: unknown) => void;
|
|
22
|
+
on: (name: string, callback: (event: any) => void) => void;
|
|
23
|
+
off?: (name: string, callback: (event: any) => void) => void;
|
|
24
|
+
ui?: {
|
|
25
|
+
registry?: {
|
|
26
|
+
addButton?: (name: string, config: Record<string, unknown>) => void;
|
|
27
|
+
addMenuItem?: (name: string, config: Record<string, unknown>) => void;
|
|
28
|
+
addIcon?: (name: string, svg: string) => void;
|
|
29
|
+
};
|
|
30
|
+
};
|
|
31
|
+
selection?: {
|
|
32
|
+
getNode?: () => HTMLElement;
|
|
33
|
+
getRng?: () => Range;
|
|
34
|
+
setRng?: (range: Range) => void;
|
|
35
|
+
select?: (node: HTMLElement) => void;
|
|
36
|
+
collapse?: (toStart?: boolean) => void;
|
|
37
|
+
};
|
|
38
|
+
undoManager?: {
|
|
39
|
+
transact?: (callback: () => void) => void;
|
|
40
|
+
add?: () => void;
|
|
41
|
+
};
|
|
42
|
+
dom?: {
|
|
43
|
+
encode?: (value: string) => string;
|
|
44
|
+
decode?: (value: string) => string;
|
|
45
|
+
};
|
|
46
|
+
schema?: {
|
|
47
|
+
addValidElements?: (validElements: string) => void;
|
|
48
|
+
};
|
|
49
|
+
getDoc?: () => Document;
|
|
50
|
+
getWin?: () => Window;
|
|
51
|
+
getBody?: () => HTMLElement;
|
|
52
|
+
focus?: () => void;
|
|
53
|
+
nodeChanged?: () => void;
|
|
54
|
+
dispatch?: (name: string, args?: Record<string, unknown>) => void;
|
|
55
|
+
fire?: (name: string, args?: Record<string, unknown>) => void;
|
|
56
|
+
}
|
|
57
|
+
interface FormulaXTinyMceOptions {
|
|
58
|
+
pluginName?: string;
|
|
59
|
+
buttonName?: string;
|
|
60
|
+
menuItemName?: string;
|
|
61
|
+
toolbarText?: string;
|
|
62
|
+
tooltip?: string;
|
|
63
|
+
cursorStyle?: string;
|
|
64
|
+
formulaClassName?: string;
|
|
65
|
+
formulaAttributeName?: string;
|
|
66
|
+
renderer?: FormulaRenderer;
|
|
67
|
+
preload?: FormulaXEditorPreloadMode;
|
|
68
|
+
modal?: FormulaXModalOptions;
|
|
69
|
+
initialLatex?: string;
|
|
70
|
+
editor?: Omit<FormulaXEditorOptions, 'initialLatex'>;
|
|
71
|
+
}
|
|
72
|
+
interface FormulaXModalOptions {
|
|
73
|
+
title?: string;
|
|
74
|
+
insertText?: string;
|
|
75
|
+
updateText?: string;
|
|
76
|
+
cancelText?: string;
|
|
77
|
+
width?: string;
|
|
78
|
+
height?: string;
|
|
79
|
+
closeOnBackdrop?: boolean;
|
|
80
|
+
}
|
|
81
|
+
interface RequiredFormulaXTinyMceOptions {
|
|
82
|
+
pluginName: string;
|
|
83
|
+
buttonName: string;
|
|
84
|
+
menuItemName: string;
|
|
85
|
+
toolbarText: string;
|
|
86
|
+
tooltip: string;
|
|
87
|
+
cursorStyle: string;
|
|
88
|
+
formulaClassName: string;
|
|
89
|
+
formulaAttributeName: string;
|
|
90
|
+
initialLatex: string;
|
|
91
|
+
renderer: FormulaRenderer;
|
|
92
|
+
preload: FormulaXEditorPreloadMode;
|
|
93
|
+
modal: Required<FormulaXModalOptions>;
|
|
94
|
+
editor: Required<Omit<FormulaXEditorOptions, 'initialLatex'>>;
|
|
95
|
+
}
|
|
96
|
+
interface FormulaXModalOpenOptions {
|
|
97
|
+
editor: TinyMceEditorLike;
|
|
98
|
+
target?: HTMLElement | null;
|
|
99
|
+
initialLatex?: string;
|
|
100
|
+
options: RequiredFormulaXTinyMceOptions;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
interface TinyMceCompat {
|
|
104
|
+
major: number;
|
|
105
|
+
insertContent: (html: string) => void;
|
|
106
|
+
dispatchEvent: (name: string, detail?: Record<string, unknown>) => void;
|
|
107
|
+
getSelectedFormulaElement: () => HTMLElement | null;
|
|
108
|
+
getEditorDocument: () => Document;
|
|
109
|
+
getEditorWindow: () => Window;
|
|
110
|
+
getEditorBody: () => HTMLElement | null;
|
|
111
|
+
focus: () => void;
|
|
112
|
+
}
|
|
113
|
+
declare function getTinyMceMajorVersion(tinymce?: TinyMceLike): number;
|
|
114
|
+
declare function createTinyMceCompat(editor: TinyMceEditorLike, tinymce?: TinyMceLike): TinyMceCompat;
|
|
115
|
+
declare function warnUnsupportedTinyMceVersion(tinymce?: TinyMceLike): void;
|
|
116
|
+
|
|
117
|
+
declare function resolveOptions(options?: FormulaXTinyMceOptions): RequiredFormulaXTinyMceOptions;
|
|
118
|
+
declare function registerFormulaXTinyMcePlugin(tinymce: TinyMceLike, options?: FormulaXTinyMceOptions): void;
|
|
119
|
+
|
|
120
|
+
interface OpenFormulaXModalResult {
|
|
121
|
+
close: () => void;
|
|
122
|
+
}
|
|
123
|
+
declare function openFormulaXOverlayModal(input: FormulaXModalOpenOptions): OpenFormulaXModalResult;
|
|
124
|
+
|
|
125
|
+
export { type FormulaXModalOpenOptions, type FormulaXModalOptions, type FormulaXTinyMceOptions, type RequiredFormulaXTinyMceOptions, type TinyMceEditorLike, type TinyMceLike, createTinyMceCompat, createTinyMceFormulaMarkup, getTinyMceMajorVersion, openFormulaXOverlayModal, parseTinyMceFormulaMarkup, registerFormulaXTinyMcePlugin, resolveOptions, serializeTinyMceFormulaMarkup, warnUnsupportedTinyMceVersion };
|