@hailin-zheng/editor-core 2.2.9 → 2.2.11
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 +126 -28
- package/index-cjs.js.map +1 -1
- package/index.js +125 -29
- package/index.js.map +1 -1
- package/med_editor/doc-editor.d.ts +6 -1
- package/med_editor/framework/document-change.d.ts +1 -1
- package/med_editor/framework/document-context.d.ts +1 -0
- package/med_editor/framework/document-event.d.ts +6 -1
- package/med_editor/framework/element-define.d.ts +4 -0
- package/med_editor/framework/impl/data-element/data-element-group-impl.d.ts +10 -3
- package/med_editor/framework/util/element-util.d.ts +7 -0
- package/package.json +2 -2
| @@ -2,7 +2,7 @@ import { ContentMenuItem } from './framework/element-event-define'; | |
| 2 2 | 
             
            import { ElementReader } from './framework/element-reader';
         | 
| 3 3 | 
             
            import { SelectionState } from './framework/selection/document-selection';
         | 
| 4 4 | 
             
            import { BlockContainerElement, Element, ICancelTokenFn, LeafElement, MarginProps, OrientType, PageLayoutMode, Position, Rect, SerializeProps, ViewOptions } from './framework/element-define';
         | 
| 5 | 
            -
            import { DataElementInlineGroup, DataElementLeaf, DocumentElement, ParagraphElement, TableCellElement, TableElement, TableRowElement } from './framework/impl';
         | 
| 5 | 
            +
            import { DataElementGroupElement, DataElementInlineGroup, DataElementLeaf, DocumentElement, ParagraphElement, TableCellElement, TableElement, TableRowElement } from './framework/impl';
         | 
| 6 6 | 
             
            import { CellDiagonal, ParagraphNumberType, ParagraphProps, TextProps } from './framework/element-props';
         | 
| 7 7 | 
             
            import { EditorContext } from './framework/document-context';
         | 
| 8 8 | 
             
            import { ElementTrackManage } from './framework/history/element-trace-manage';
         | 
| @@ -132,6 +132,11 @@ export declare class DocEditor { | |
| 132 132 | 
             
                 * @returns
         | 
| 133 133 | 
             
                 */
         | 
| 134 134 | 
             
                getCurrentDataElement(): DataElementInlineGroup | DataElementLeaf | null;
         | 
| 135 | 
            +
                /**
         | 
| 136 | 
            +
                 * 回去当前光标所在数据组
         | 
| 137 | 
            +
                 * @returns
         | 
| 138 | 
            +
                 */
         | 
| 139 | 
            +
                getCurrentDataGroupElement(): DataElementGroupElement | null;
         | 
| 135 140 | 
             
                /**
         | 
| 136 141 | 
             
                 * 移动光标到下一个数据元素上
         | 
| 137 142 | 
             
                 */
         | 
| @@ -61,6 +61,7 @@ export declare class DocumentContext { | |
| 61 61 | 
             
                    includeChildren: boolean;
         | 
| 62 62 | 
             
                }): Array<DataElementInlineGroup | DataElementLeaf>;
         | 
| 63 63 | 
             
                getControlById(id: string): DataElementInlineGroup | DataElementLeaf;
         | 
| 64 | 
            +
                isDataEle(ele: Element): boolean;
         | 
| 64 65 | 
             
                getControlByName(name: string): DataElementInlineGroup | DataElementLeaf;
         | 
| 65 66 | 
             
                /**
         | 
| 66 67 | 
             
                 * 获取数据元值集合
         | 
| @@ -2,7 +2,7 @@ import { DocumentPaginator } from "./document-paginator"; | |
| 2 2 | 
             
            import { SelectionState } from "./selection/document-selection";
         | 
| 3 3 | 
             
            import { Element, LeafElement, Position, Rect, ViewOptions } from "./element-define";
         | 
| 4 4 | 
             
            import { ElementEvent, EventStage, EventTypes, HitEventInfo, HitRegion, ITrackTips, MouseElementEvent } from "./element-event-define";
         | 
| 5 | 
            -
            import { DataElementInlineGroup, DataElementLeaf, DocumentRenderObject } from "./impl";
         | 
| 5 | 
            +
            import { DataElementGroupElement, DataElementInlineGroup, DataElementLeaf, DocumentRenderObject } from "./impl";
         | 
| 6 6 | 
             
            import { BorderType, CursorType, RenderObject } from "./render-define";
         | 
| 7 7 | 
             
            import { EditorContext } from "./document-context";
         | 
| 8 8 | 
             
            import { Subject, Subscription } from "./infrastructure/event-subject";
         | 
| @@ -247,5 +247,10 @@ export declare class DocumentEvent { | |
| 247 247 | 
             
                 * @returns
         | 
| 248 248 | 
             
                 */
         | 
| 249 249 | 
             
                getCurrentDataElement(mode?: 'strict' | 'free'): DataElementInlineGroup | DataElementLeaf | null;
         | 
| 250 | 
            +
                /**
         | 
| 251 | 
            +
              * 获取当前光标所在的数据组
         | 
| 252 | 
            +
              * @returns
         | 
| 253 | 
            +
              */
         | 
| 254 | 
            +
                getCurrentDataGroupElement(mode?: 'strict' | 'free'): DataElementGroupElement | null;
         | 
| 250 255 | 
             
            }
         | 
| 251 256 | 
             
            export {};
         | 
| @@ -258,12 +258,16 @@ export declare class ViewOptions { | |
| 258 258 | 
             
                dataDecoratorNormalColor: string;
         | 
| 259 259 | 
             
                dataDecoratorMouseEnterColor: string;
         | 
| 260 260 | 
             
                dataDecoratorFocusedColor: string;
         | 
| 261 | 
            +
                showDataEleDecorator: boolean;
         | 
| 261 262 | 
             
                dataEleEmptyBgColor: string;
         | 
| 262 263 | 
             
                dataEleMouseEnterBgColor: string;
         | 
| 263 264 | 
             
                dataEleReadOnlyBgColor: string;
         | 
| 264 265 | 
             
                dataEleFocusedBgColor: string;
         | 
| 265 266 | 
             
                dataEleNormalBgColor: string;
         | 
| 266 267 | 
             
                dataEleErrorBgColor: string;
         | 
| 268 | 
            +
                dataGroupEleNormalBgColor: string;
         | 
| 269 | 
            +
                dataGroupMouseEnterBgColor: string;
         | 
| 270 | 
            +
                dataGroupFocusedBgColor: string;
         | 
| 267 271 | 
             
                viewBackcolor: string;
         | 
| 268 272 | 
             
                paraSymbolColor: string;
         | 
| 269 273 | 
             
                dataGroupColor: string;
         | 
| @@ -1,8 +1,8 @@ | |
| 1 | 
            -
            import { DataElementBaseFactory,  | 
| 1 | 
            +
            import { DataElementBaseFactory, InlineGroupInputElement } from "./data-element-base-impl";
         | 
| 2 2 | 
             
            import { InlineGroupRenderObject, RenderObject } from "../../render-define";
         | 
| 3 | 
            -
            import { SerializeProps, ViewOptions, Element } from "../../element-define";
         | 
| 3 | 
            +
            import { SerializeProps, ViewOptions, Element, LeafElement } from "../../element-define";
         | 
| 4 4 | 
             
            import { DataElementGroupProps } from "../../element-props";
         | 
| 5 | 
            -
            export declare class DataElementGroupElement extends  | 
| 5 | 
            +
            export declare class DataElementGroupElement extends InlineGroupInputElement<DataElementGroupProps> {
         | 
| 6 6 | 
             
                constructor();
         | 
| 7 7 | 
             
                setValue(val: any): void;
         | 
| 8 8 | 
             
                getValue(): string;
         | 
| @@ -18,3 +18,10 @@ export declare class DataElementGroupFactory extends DataElementBaseFactory<Data | |
| 18 18 | 
             
                createElement(data: any): Element;
         | 
| 19 19 | 
             
                createDataEleProps(dest: DataElementGroupProps, props: DataElementGroupProps): DataElementGroupProps;
         | 
| 20 20 | 
             
            }
         | 
| 21 | 
            +
            /**
         | 
| 22 | 
            +
             * 是否在数据组内部
         | 
| 23 | 
            +
             * @param control
         | 
| 24 | 
            +
             * @param offset
         | 
| 25 | 
            +
             */
         | 
| 26 | 
            +
            export declare function IsInSideDataGroup(control: LeafElement, offset: number): boolean;
         | 
| 27 | 
            +
            export declare function validateDataGroup(control: Element): boolean;
         | 
| @@ -10,6 +10,7 @@ import { TableRowRenderObject } from "../impl/table/table-row-impl"; | |
| 10 10 | 
             
            import { TextGroupElement, TextGroupRenderObject } from "../impl/text/text-impl";
         | 
| 11 11 | 
             
            import { TrackRunElement, TrackRunTypeEnum } from "../impl/text/track-run-impl";
         | 
| 12 12 | 
             
            import { BlockContainerRenderObject, BlockContentRenderObject, BorderType, BranchRenderObject, CursorType, InlineGroupRenderObject, LeafRenderObject, RenderObject } from "../render-define";
         | 
| 13 | 
            +
            import { DataElementGroupElement } from "../impl";
         | 
| 13 14 | 
             
            declare type PAIR = {
         | 
| 14 15 | 
             
                x: number;
         | 
| 15 16 | 
             
                y: number;
         | 
| @@ -377,6 +378,12 @@ export declare class ElementUtil { | |
| 377 378 | 
             
                 * @returns
         | 
| 378 379 | 
             
                 */
         | 
| 379 380 | 
             
                static getDataElement(ele: Element): DataElementInlineGroup | null;
         | 
| 381 | 
            +
                /**
         | 
| 382 | 
            +
                * 向上查找类型为数据元的父级
         | 
| 383 | 
            +
                * @param ele
         | 
| 384 | 
            +
                * @returns
         | 
| 385 | 
            +
                */
         | 
| 386 | 
            +
                static getDataGroupElement(ele: Element): DataElementGroupElement | null;
         | 
| 380 387 | 
             
                static getOSPlatform(): 'Windows' | 'Mac' | 'Linux';
         | 
| 381 388 | 
             
                static getCheckboxPath(x: number, y: number, width: number, height: number): Array<Position>;
         | 
| 382 389 | 
             
                static getStrokeSvgPath(pathPoints: Array<Position> | string, stroke: string, width: number): any;
         | 
    
        package/package.json
    CHANGED
    
    | @@ -4,7 +4,7 @@ | |
| 4 4 | 
             
                "author": "hailin-zheng",
         | 
| 5 5 | 
             
                "private": false,
         | 
| 6 6 | 
             
                "license": "ISC",
         | 
| 7 | 
            -
                "version": "2.2. | 
| 7 | 
            +
                "version": "2.2.11",
         | 
| 8 8 | 
             
                "scripts": {},
         | 
| 9 9 | 
             
                "dependencies": {
         | 
| 10 10 | 
             
                    "moment": "^2.29.3",
         | 
| @@ -16,4 +16,4 @@ | |
| 16 16 | 
             
                    "snabbdom-to-html": "^7.1.0",
         | 
| 17 17 | 
             
                    "jsbarcode": "^3.11.5"
         | 
| 18 18 | 
             
                }
         | 
| 19 | 
            -
            }
         | 
| 19 | 
            +
            }
         |