@formulaxjs/ckeditor5 0.3.1 → 0.4.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 +24 -21
- package/README.zh-CN.md +24 -21
- 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 +24080 -70
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +81 -0
- package/dist/index.d.ts +81 -0
- package/dist/index.global.js +162 -156
- package/dist/index.global.js.map +1 -1
- package/dist/index.js +3768 -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/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# @formulaxjs/ckeditor5
|
|
2
2
|
|
|
3
|
-
English | [简体中文](
|
|
3
|
+
English | [简体中文](https://github.com/vndmea/formulaX/blob/main/packages/ckeditor5/README.zh-CN.md)
|
|
4
4
|
|
|
5
5
|
CKEditor 5 integration adapter for FormulaX.
|
|
6
6
|
|
|
@@ -78,21 +78,22 @@ await ClassicEditor.create(document.querySelector('#editor')!, {
|
|
|
78
78
|
modal: {
|
|
79
79
|
title: 'FormulaX Editor',
|
|
80
80
|
},
|
|
81
|
-
renderer: createKityFormulaRenderer({
|
|
82
|
-
fontSize: 40,
|
|
83
|
-
}),
|
|
84
|
-
editor: {
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
81
|
+
renderer: createKityFormulaRenderer({
|
|
82
|
+
fontSize: 40,
|
|
83
|
+
}),
|
|
84
|
+
editor: {
|
|
85
|
+
locale: 'zh_CN', // optional, defaults to en_US
|
|
86
|
+
render: {
|
|
87
|
+
fontsize: 40,
|
|
88
|
+
},
|
|
88
89
|
},
|
|
89
90
|
},
|
|
90
91
|
} as any);
|
|
91
92
|
```
|
|
92
93
|
|
|
93
|
-
Then users can click the `FormulaX` toolbar button to insert a formula. Existing formulas can be updated by double-clicking them, or by selecting them and executing the same command again.
|
|
94
|
-
|
|
95
|
-
## Custom model names
|
|
94
|
+
Then users can click the `FormulaX` toolbar button to insert a formula. Existing formulas can be updated by double-clicking them, or by selecting them and executing the same command again.
|
|
95
|
+
|
|
96
|
+
## Custom model names
|
|
96
97
|
|
|
97
98
|
The default CKEditor 5 model name is `formulaX`.
|
|
98
99
|
|
|
@@ -190,12 +191,13 @@ interface FormulaXCKEditor5Options {
|
|
|
190
191
|
cancelText?: string;
|
|
191
192
|
closeOnBackdrop?: boolean;
|
|
192
193
|
};
|
|
193
|
-
editor?: {
|
|
194
|
-
height?: number | string;
|
|
195
|
-
autofocus?: boolean;
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
194
|
+
editor?: {
|
|
195
|
+
height?: number | string;
|
|
196
|
+
autofocus?: boolean;
|
|
197
|
+
locale?: FormulaXLocale;
|
|
198
|
+
assets?: Partial<KityEditorAssets>;
|
|
199
|
+
render?: {
|
|
200
|
+
fontsize?: number;
|
|
199
201
|
};
|
|
200
202
|
};
|
|
201
203
|
}
|
|
@@ -229,10 +231,11 @@ interface FormulaXCKEditor5Options {
|
|
|
229
231
|
|
|
230
232
|
| Option | Default | Description |
|
|
231
233
|
| --- | --- | --- |
|
|
232
|
-
| `height` | `100%` | Embedded editor height. |
|
|
233
|
-
| `autofocus` | `true` | Whether the embedded editor should autofocus. |
|
|
234
|
-
| `
|
|
235
|
-
| `
|
|
234
|
+
| `height` | `100%` | Embedded editor height. |
|
|
235
|
+
| `autofocus` | `true` | Whether the embedded editor should autofocus. |
|
|
236
|
+
| `locale` | `en_US` | Localizes the modal defaults and the embedded Kity runtime UI. |
|
|
237
|
+
| `assets` | `{}` | Optional Kity runtime asset overrides. |
|
|
238
|
+
| `render.fontsize` | `40` | Formula render font size. |
|
|
236
239
|
|
|
237
240
|
## Exported API
|
|
238
241
|
|
package/README.zh-CN.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# @formulaxjs/ckeditor5
|
|
2
2
|
|
|
3
|
-
[English](
|
|
3
|
+
[English](https://github.com/vndmea/formulaX/blob/main/packages/ckeditor5/README.md) | 简体中文
|
|
4
4
|
|
|
5
5
|
FormulaX 的 CKEditor 5 集成适配器。
|
|
6
6
|
|
|
@@ -78,21 +78,22 @@ await ClassicEditor.create(document.querySelector('#editor')!, {
|
|
|
78
78
|
modal: {
|
|
79
79
|
title: 'FormulaX 公式编辑器',
|
|
80
80
|
},
|
|
81
|
-
renderer: createKityFormulaRenderer({
|
|
82
|
-
fontSize: 40,
|
|
83
|
-
}),
|
|
84
|
-
editor: {
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
81
|
+
renderer: createKityFormulaRenderer({
|
|
82
|
+
fontSize: 40,
|
|
83
|
+
}),
|
|
84
|
+
editor: {
|
|
85
|
+
locale: 'zh_CN', // 可选,默认 en_US
|
|
86
|
+
render: {
|
|
87
|
+
fontsize: 40,
|
|
88
|
+
},
|
|
88
89
|
},
|
|
89
90
|
},
|
|
90
91
|
} as any);
|
|
91
92
|
```
|
|
92
93
|
|
|
93
|
-
之后用户可以点击 `FormulaX` 工具栏按钮插入公式。已有公式可以通过双击更新,也可以先选中后再次执行同一个命令进行更新。
|
|
94
|
-
|
|
95
|
-
## 自定义 model 名称
|
|
94
|
+
之后用户可以点击 `FormulaX` 工具栏按钮插入公式。已有公式可以通过双击更新,也可以先选中后再次执行同一个命令进行更新。
|
|
95
|
+
|
|
96
|
+
## 自定义 model 名称
|
|
96
97
|
|
|
97
98
|
默认的 CKEditor 5 model 名称是 `formulaX`。
|
|
98
99
|
|
|
@@ -190,12 +191,13 @@ interface FormulaXCKEditor5Options {
|
|
|
190
191
|
cancelText?: string;
|
|
191
192
|
closeOnBackdrop?: boolean;
|
|
192
193
|
};
|
|
193
|
-
editor?: {
|
|
194
|
-
height?: number | string;
|
|
195
|
-
autofocus?: boolean;
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
194
|
+
editor?: {
|
|
195
|
+
height?: number | string;
|
|
196
|
+
autofocus?: boolean;
|
|
197
|
+
locale?: FormulaXLocale;
|
|
198
|
+
assets?: Partial<KityEditorAssets>;
|
|
199
|
+
render?: {
|
|
200
|
+
fontsize?: number;
|
|
199
201
|
};
|
|
200
202
|
};
|
|
201
203
|
}
|
|
@@ -229,10 +231,11 @@ interface FormulaXCKEditor5Options {
|
|
|
229
231
|
|
|
230
232
|
| 配置项 | 默认值 | 说明 |
|
|
231
233
|
| --- | --- | --- |
|
|
232
|
-
| `height` | `100%` | 内嵌编辑器高度。 |
|
|
233
|
-
| `autofocus` | `true` | 内嵌编辑器是否自动聚焦。 |
|
|
234
|
-
| `
|
|
235
|
-
| `
|
|
234
|
+
| `height` | `100%` | 内嵌编辑器高度。 |
|
|
235
|
+
| `autofocus` | `true` | 内嵌编辑器是否自动聚焦。 |
|
|
236
|
+
| `locale` | `en_US` | 同时切换弹窗默认文案和内嵌 Kity runtime UI。 |
|
|
237
|
+
| `assets` | `{}` | 可选的 Kity runtime 资源覆盖配置。 |
|
|
238
|
+
| `render.fontsize` | `40` | 公式渲染字号。 |
|
|
236
239
|
|
|
237
240
|
## 导出 API
|
|
238
241
|
|
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
|
+
}
|