@formulaxjs/tinymce 0.2.1 → 0.3.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 +20 -18
- package/README.zh-CN.md +20 -18
- 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.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 +9 -4
- /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/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# @formulaxjs/tinymce
|
|
2
2
|
|
|
3
|
-
English | [简体中文](
|
|
3
|
+
English | [简体中文](https://github.com/vndmea/formulaX/blob/main/packages/tinymce/README.zh-CN.md)
|
|
4
4
|
|
|
5
5
|
TinyMCE integration adapter for FormulaX.
|
|
6
6
|
|
|
@@ -61,15 +61,16 @@ import { registerFormulaXTinyMcePlugin } from '@formulaxjs/tinymce';
|
|
|
61
61
|
registerFormulaXTinyMcePlugin(tinymce, {
|
|
62
62
|
toolbarText: 'FormulaX',
|
|
63
63
|
tooltip: 'Insert or edit formula',
|
|
64
|
-
modal: {
|
|
65
|
-
title: 'FormulaX Editor',
|
|
66
|
-
},
|
|
67
|
-
editor: {
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
}
|
|
64
|
+
modal: {
|
|
65
|
+
title: 'FormulaX Editor',
|
|
66
|
+
},
|
|
67
|
+
editor: {
|
|
68
|
+
locale: 'zh_CN', // optional, defaults to en_US
|
|
69
|
+
height: '100%',
|
|
70
|
+
autofocus: true,
|
|
71
|
+
render: { fontsize: 40 },
|
|
72
|
+
},
|
|
73
|
+
});
|
|
73
74
|
|
|
74
75
|
await tinymce.init({
|
|
75
76
|
selector: '#editor',
|
|
@@ -81,9 +82,9 @@ await tinymce.init({
|
|
|
81
82
|
});
|
|
82
83
|
```
|
|
83
84
|
|
|
84
|
-
Then users can click the `FormulaX` toolbar button to insert a formula. Existing formulas can be edited by double-clicking them or selecting them and pressing Enter or Space.
|
|
85
|
-
|
|
86
|
-
## Programmatic opening
|
|
85
|
+
Then users can click the `FormulaX` toolbar button to insert a formula. Existing formulas can be edited by double-clicking them or selecting them and pressing Enter or Space.
|
|
86
|
+
|
|
87
|
+
## Programmatic opening
|
|
87
88
|
|
|
88
89
|
The plugin registers the `FormulaXOpen` command:
|
|
89
90
|
|
|
@@ -204,7 +205,7 @@ interface FormulaXTinyMceOptions {
|
|
|
204
205
|
|
|
205
206
|
| Option | Default | Description |
|
|
206
207
|
| --- | --- | --- |
|
|
207
|
-
| `title` | `FormulaX` | Modal title. |
|
|
208
|
+
| `title` | `FormulaX Editor` | Modal title. |
|
|
208
209
|
| `insertText` | `Insert` | Submit button text when inserting. |
|
|
209
210
|
| `updateText` | `Update` | Submit button text when updating. |
|
|
210
211
|
| `cancelText` | `Cancel` | Cancel button text. |
|
|
@@ -216,10 +217,11 @@ interface FormulaXTinyMceOptions {
|
|
|
216
217
|
|
|
217
218
|
| Option | Default | Description |
|
|
218
219
|
| --- | --- | --- |
|
|
219
|
-
| `height` | `100%` | Embedded editor height. |
|
|
220
|
-
| `autofocus` | `true` | Whether the embedded editor should autofocus. |
|
|
221
|
-
| `
|
|
222
|
-
| `
|
|
220
|
+
| `height` | `100%` | Embedded editor height. |
|
|
221
|
+
| `autofocus` | `true` | Whether the embedded editor should autofocus. |
|
|
222
|
+
| `locale` | `en_US` | Localizes the modal defaults and the embedded Kity runtime UI. |
|
|
223
|
+
| `assets` | `{}` | Optional Kity runtime asset overrides. |
|
|
224
|
+
| `render.fontsize` | `40` | Formula render font size. |
|
|
223
225
|
|
|
224
226
|
## Exported API
|
|
225
227
|
|
package/README.zh-CN.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# @formulaxjs/tinymce
|
|
2
2
|
|
|
3
|
-
[English](
|
|
3
|
+
[English](https://github.com/vndmea/formulaX/blob/main/packages/tinymce/README.md) | 简体中文
|
|
4
4
|
|
|
5
5
|
FormulaX 的 TinyMCE 集成适配器。
|
|
6
6
|
|
|
@@ -61,15 +61,16 @@ import { registerFormulaXTinyMcePlugin } from '@formulaxjs/tinymce';
|
|
|
61
61
|
registerFormulaXTinyMcePlugin(tinymce, {
|
|
62
62
|
toolbarText: 'FormulaX',
|
|
63
63
|
tooltip: '插入或编辑公式',
|
|
64
|
-
modal: {
|
|
65
|
-
title: 'FormulaX 公式编辑器',
|
|
66
|
-
},
|
|
67
|
-
editor: {
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
}
|
|
64
|
+
modal: {
|
|
65
|
+
title: 'FormulaX 公式编辑器',
|
|
66
|
+
},
|
|
67
|
+
editor: {
|
|
68
|
+
locale: 'zh_CN', // 可选,默认 en_US
|
|
69
|
+
height: '100%',
|
|
70
|
+
autofocus: true,
|
|
71
|
+
render: { fontsize: 40 },
|
|
72
|
+
},
|
|
73
|
+
});
|
|
73
74
|
|
|
74
75
|
await tinymce.init({
|
|
75
76
|
selector: '#editor',
|
|
@@ -81,9 +82,9 @@ await tinymce.init({
|
|
|
81
82
|
});
|
|
82
83
|
```
|
|
83
84
|
|
|
84
|
-
之后用户可以点击 `FormulaX` 工具栏按钮插入公式。已有公式可以通过双击编辑,也可以选中后按 Enter 或 Space 编辑。
|
|
85
|
-
|
|
86
|
-
## 代码中主动打开
|
|
85
|
+
之后用户可以点击 `FormulaX` 工具栏按钮插入公式。已有公式可以通过双击编辑,也可以选中后按 Enter 或 Space 编辑。
|
|
86
|
+
|
|
87
|
+
## 代码中主动打开
|
|
87
88
|
|
|
88
89
|
插件会注册 `FormulaXOpen` 命令:
|
|
89
90
|
|
|
@@ -204,7 +205,7 @@ interface FormulaXTinyMceOptions {
|
|
|
204
205
|
|
|
205
206
|
| 配置项 | 默认值 | 说明 |
|
|
206
207
|
| --- | --- | --- |
|
|
207
|
-
| `title` | `FormulaX` | 弹窗标题。 |
|
|
208
|
+
| `title` | `FormulaX Editor` | 弹窗标题。 |
|
|
208
209
|
| `insertText` | `Insert` | 插入公式时的提交按钮文本。 |
|
|
209
210
|
| `updateText` | `Update` | 更新公式时的提交按钮文本。 |
|
|
210
211
|
| `cancelText` | `Cancel` | 取消按钮文本。 |
|
|
@@ -216,10 +217,11 @@ interface FormulaXTinyMceOptions {
|
|
|
216
217
|
|
|
217
218
|
| 配置项 | 默认值 | 说明 |
|
|
218
219
|
| --- | --- | --- |
|
|
219
|
-
| `height` | `100%` | 内嵌编辑器高度。 |
|
|
220
|
-
| `autofocus` | `true` | 内嵌编辑器是否自动聚焦。 |
|
|
221
|
-
| `
|
|
222
|
-
| `
|
|
220
|
+
| `height` | `100%` | 内嵌编辑器高度。 |
|
|
221
|
+
| `autofocus` | `true` | 内嵌编辑器是否自动聚焦。 |
|
|
222
|
+
| `locale` | `en_US` | 同时切换弹窗默认文案和内嵌 Kity runtime UI。 |
|
|
223
|
+
| `assets` | `{}` | 可选的 Kity runtime 资源覆盖配置。 |
|
|
224
|
+
| `render.fontsize` | `40` | 公式渲染字号。 |
|
|
223
225
|
|
|
224
226
|
## 导出 API
|
|
225
227
|
|
package/dist/base.css
ADDED
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
|
|
2
|
+
.kf-editor {
|
|
3
|
+
width: 100%;
|
|
4
|
+
height: 100%;
|
|
5
|
+
display: flex;
|
|
6
|
+
flex-direction: column;
|
|
7
|
+
border: 1px solid #e0e0e0;
|
|
8
|
+
position: relative;
|
|
9
|
+
top: 0;
|
|
10
|
+
left: 0;
|
|
11
|
+
|
|
12
|
+
overflow: visible;
|
|
13
|
+
z-index: 2;
|
|
14
|
+
background-color: #f6f5ee;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
.kf-editor-edit-area {
|
|
18
|
+
width: 100%;
|
|
19
|
+
position: relative;
|
|
20
|
+
top: 0;
|
|
21
|
+
left: 0;
|
|
22
|
+
|
|
23
|
+
display: block;
|
|
24
|
+
z-index: 1;
|
|
25
|
+
flex: 1 1 auto;
|
|
26
|
+
min-height: 100px;
|
|
27
|
+
height: 100px;
|
|
28
|
+
overflow: hidden;
|
|
29
|
+
background-color: white;
|
|
30
|
+
/*background-color: white;*/
|
|
31
|
+
/*background-size: 21px 21px;*/
|
|
32
|
+
/*background-position: 0 0,10px 10px;*/
|
|
33
|
+
/*background-image: -webkit-linear-gradient(45deg,#efefef 25%,transparent 25%,transparent 75%,#efefef 75%,#efefef),-webkit-linear-gradient(45deg,#efefef 25%,transparent 25%,transparent 75%,#efefef 75%,#efefef);*/
|
|
34
|
+
/*background-image: linear-gradient(45deg,#efefef 25%,transparent 25%,transparent 75%,#efefef 75%,#efefef),linear-gradient(45deg,#efefef 25%,transparent 25%,transparent 75%,#efefef 75%,#efefef);*/
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
.kf-editor-canvas-container {
|
|
38
|
+
width: 100%;
|
|
39
|
+
height: 100%;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
.kf-editor-input-box {
|
|
43
|
+
position: fixed;
|
|
44
|
+
top: 0;
|
|
45
|
+
left: -99999999px;
|
|
46
|
+
z-index: 999999;
|
|
47
|
+
}
|