@hailin-zheng/editor-core 2.2.16 → 2.2.18
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 +326 -136
- package/index-cjs.js.map +1 -1
- package/index.js +325 -137
- package/index.js.map +1 -1
- package/med_editor/doc-editor.d.ts +25 -0
- package/med_editor/framework/document-change.d.ts +7 -0
- package/med_editor/framework/element-define.d.ts +7 -1
- package/med_editor/framework/element-serialize.d.ts +1 -1
- package/med_editor/framework/impl/data-element/data-element-base-impl.d.ts +8 -1
- package/package.json +1 -1
@@ -485,6 +485,31 @@ export declare class DocEditor {
|
|
485
485
|
private renderSuggestions;
|
486
486
|
insertSuggestion(suggestion: ISuggestionData): void;
|
487
487
|
parser(code: string, returnProcess?: boolean): string;
|
488
|
+
/**
|
489
|
+
* 返回当前光标处是否允许截断段落生成新的段落
|
490
|
+
* @returns
|
491
|
+
*/
|
492
|
+
allowSplitParagraph(): boolean;
|
493
|
+
/**
|
494
|
+
* 设置元素属性(attribute)
|
495
|
+
* @param ele
|
496
|
+
* @param attr
|
497
|
+
* @param value
|
498
|
+
*/
|
499
|
+
setEleAttribute(ele: Element, attr: string, value: any): void;
|
500
|
+
/**
|
501
|
+
* 获取元素属性(attribute)
|
502
|
+
* @param ele
|
503
|
+
* @param attr
|
504
|
+
* @returns
|
505
|
+
*/
|
506
|
+
getEleAttribute(ele: Element, attr: string): any;
|
507
|
+
/**
|
508
|
+
* 删除元素属性(attribute)
|
509
|
+
* @param ele
|
510
|
+
* @param attr
|
511
|
+
*/
|
512
|
+
removeEleAttribute(ele: Element, attr: string): void;
|
488
513
|
}
|
489
514
|
export interface IReaderManager {
|
490
515
|
}
|
@@ -275,6 +275,13 @@ export declare class DocumentChange {
|
|
275
275
|
* @param text
|
276
276
|
*/
|
277
277
|
private pastePlainText;
|
278
|
+
/**
|
279
|
+
* 当前光标位置是否允许分割生成两个段落
|
280
|
+
*/
|
281
|
+
allowSplitParagraph(target?: {
|
282
|
+
startControl: LeafElement;
|
283
|
+
startOffset: number;
|
284
|
+
}): boolean;
|
278
285
|
/**
|
279
286
|
* 向当前光标追加文本
|
280
287
|
* @param appendStr
|
@@ -239,6 +239,7 @@ export declare class PageOptions {
|
|
239
239
|
}
|
240
240
|
export declare type OrientType = 'landscape' | 'portrait';
|
241
241
|
export declare type PageLayoutMode = 'singlePage' | 'multiPage' | 'fit-page';
|
242
|
+
export declare type DataDecoratorMode = 'none' | 'outline' | 'background' | 'all';
|
242
243
|
export declare class ViewOptions {
|
243
244
|
copyRightInfo: string;
|
244
245
|
trialVersion: boolean;
|
@@ -260,13 +261,19 @@ export declare class ViewOptions {
|
|
260
261
|
showDataEleDecorator: boolean;
|
261
262
|
dataEleEmptyBgColor: string;
|
262
263
|
dataEleMouseEnterBgColor: string;
|
264
|
+
dataEleMouseEnterDecoratorMode: DataDecoratorMode;
|
263
265
|
dataEleReadOnlyBgColor: string;
|
264
266
|
dataEleFocusedBgColor: string;
|
267
|
+
dataEleFocusedDecoratorMode: DataDecoratorMode;
|
265
268
|
dataEleNormalBgColor: string;
|
269
|
+
dataEleOutlineColor: string;
|
270
|
+
dataGroupOutlineColor: string;
|
266
271
|
dataEleErrorBgColor: string;
|
267
272
|
dataGroupDecoratorNormalColor: string;
|
268
273
|
dataGroupDecoratorMouseEnterColor: string;
|
274
|
+
dataGroupMouseEnterDecoratorMode: DataDecoratorMode;
|
269
275
|
dataGroupDecoratorFocusedColor: string;
|
276
|
+
dataGroupFocusedDecoratorMode: DataDecoratorMode;
|
270
277
|
dataGroupNormalBgColor: string;
|
271
278
|
dataGroupEmptyBgColor: string;
|
272
279
|
dataGroupMouseEnterBgColor: string;
|
@@ -280,7 +287,6 @@ export declare class ViewOptions {
|
|
280
287
|
trackDelColor: string;
|
281
288
|
showLineRect: boolean;
|
282
289
|
showCharRect: boolean;
|
283
|
-
dataEleDecoratorMode: 'none' | 'outline' | 'overlay';
|
284
290
|
showTabChar: boolean;
|
285
291
|
showSpaceChar: boolean;
|
286
292
|
showLineBreak: boolean;
|
@@ -16,7 +16,7 @@ export declare class ElementSerialize {
|
|
16
16
|
* @param ss
|
17
17
|
* @param viewOptions
|
18
18
|
*/
|
19
|
-
static getSelectedStruct(ss: SelectionState, viewOptions: ViewOptions): Element | null;
|
19
|
+
static getSelectedStruct(ss: SelectionState, viewOptions: ViewOptions): Array<Element> | null;
|
20
20
|
/**
|
21
21
|
* 选中的文本
|
22
22
|
* @param ss
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import { Element, ElementFactory, IBeginMeasureData, ICreateRenderData, InlineGroupElement, LeafElement } from "../../element-define";
|
1
|
+
import { Element, ElementFactory, IBeginMeasureData, ICreateRenderData, InlineGroupElement, LeafElement, Position } from "../../element-define";
|
2
2
|
import { IEditorVNodeOptions, InlineGroupRenderObject, RenderObject } from "../../render-define";
|
3
3
|
import { GotCursorEvent } from "../../element-event-define";
|
4
4
|
import { DataEleBaseProps, TextProps } from "../../element-props";
|
@@ -110,4 +110,11 @@ export declare function renderErrorTip(event: IEditorVNodeOptions, r: InlineGrou
|
|
110
110
|
* 渲染底部波浪线
|
111
111
|
*/
|
112
112
|
export declare function renderUnderWavyLine(event: IEditorVNodeOptions, r: InlineGroupRenderObject, color: string): void;
|
113
|
+
/**
|
114
|
+
* 获取渲染元素相对稳当的位置
|
115
|
+
* @param render
|
116
|
+
* @param refPos
|
117
|
+
*/
|
118
|
+
export declare function getRenderPosToDoc(render: RenderObject, refPos?: Position | null): Position;
|
119
|
+
export declare function getCurrentParaGroupRenders(r: InlineGroupRenderObject): InlineGroupRenderObject[];
|
113
120
|
export declare function renderUnderline(event: IEditorVNodeOptions, render: RenderObject): void;
|