@hailin-zheng/editor-core 1.1.8 → 1.1.10
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/index-cjs.js +15 -2
- package/index-cjs.js.map +1 -1
- package/index.js +15 -2
- package/index.js.map +1 -1
- package/med_editor/framework/document-change.d.ts +1 -1
- package/package.json +1 -1
package/index.js
CHANGED
@@ -11329,6 +11329,10 @@ class ParagraphMeasure {
|
|
11329
11329
|
}
|
11330
11330
|
else if (paraElement.props.textAlign === 'justify') {
|
11331
11331
|
const renderUnitCount = this.getRenderUnitLength(paraLineRender.line);
|
11332
|
+
if (paraLineIndex === counter - 1 || renderUnitCount === 1) {
|
11333
|
+
return;
|
11334
|
+
//return indent;
|
11335
|
+
}
|
11332
11336
|
const spaceWidth = (limitWidth - paraLineRender.line.rect.width) / (renderUnitCount - 1);
|
11333
11337
|
this.setAlignJustify(paraLineRender.line, 0, spaceWidth);
|
11334
11338
|
//return indent;
|
@@ -15846,12 +15850,14 @@ class DocumentChange {
|
|
15846
15850
|
}
|
15847
15851
|
/**
|
15848
15852
|
* 根据开始位置和结束位置,将字符切割成指定的区间
|
15849
|
-
* @param
|
15853
|
+
* @param text
|
15850
15854
|
* @param start
|
15851
15855
|
* @param end
|
15852
15856
|
* @returns
|
15853
15857
|
*/
|
15854
15858
|
static splitTextGroupByRange(text, start, end) {
|
15859
|
+
start = Math.floor(start);
|
15860
|
+
end = Math.floor(end);
|
15855
15861
|
end = end === -1 ? text.textMeasures.length : end;
|
15856
15862
|
if (start === end) {
|
15857
15863
|
return null;
|
@@ -19008,6 +19014,8 @@ class SurfaceView extends NodeItems {
|
|
19008
19014
|
}
|
19009
19015
|
hiddenInput() {
|
19010
19016
|
this.input.style.display = 'none';
|
19017
|
+
this.input.style.left = '0';
|
19018
|
+
this.input.style.top = '0';
|
19011
19019
|
}
|
19012
19020
|
endInput() {
|
19013
19021
|
}
|
@@ -20455,6 +20463,10 @@ class CanvasTextEditor extends AbsolutePanel {
|
|
20455
20463
|
* 文档点击事件
|
20456
20464
|
*/
|
20457
20465
|
docClickHandle(evt) {
|
20466
|
+
const appCtx = getCurrentActiveAppContext();
|
20467
|
+
if (appCtx) {
|
20468
|
+
appCtx.root.hiddenInput();
|
20469
|
+
}
|
20458
20470
|
this.setCursor();
|
20459
20471
|
this.updateSelection();
|
20460
20472
|
this.onClickEvent.next(evt);
|
@@ -21172,7 +21184,8 @@ class CanvasTextEditor extends AbsolutePanel {
|
|
21172
21184
|
/**
|
21173
21185
|
* 注册编辑器格式读取器
|
21174
21186
|
*/
|
21175
|
-
registerReaderFactory(handler) {
|
21187
|
+
registerReaderFactory(handler) {
|
21188
|
+
}
|
21176
21189
|
}
|
21177
21190
|
|
21178
21191
|
/**
|