@hailin-zheng/editor-core 2.1.8 → 2.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.d.ts +1 -0
- package/index-cjs.js +34 -5
- package/index-cjs.js.map +1 -1
- package/index.d.ts +1 -0
- package/index.js +24 -6
- package/index.js.map +1 -1
- package/med_editor/doc-editor.d.ts +1 -0
- package/med_editor/framework/element-define.d.ts +1 -0
- package/package.json +1 -1
package/index.d.ts
CHANGED
@@ -22,6 +22,7 @@ export * from './med_editor/framework/element-paint';
|
|
22
22
|
export * from './med_editor/framework/element-props';
|
23
23
|
export * from './med_editor/framework/element-reader';
|
24
24
|
export * from './med_editor/framework/element-serialize';
|
25
|
+
export * from './med_editor/framework/element-trace-tracking';
|
25
26
|
export * from './med_editor/framework/element-util';
|
26
27
|
export * from './med_editor/framework/notify';
|
27
28
|
export * from './med_editor/framework/range-util';
|
package/index.js
CHANGED
@@ -702,6 +702,9 @@ class CommonUtil {
|
|
702
702
|
|
703
703
|
const docOpsMap = new Map();
|
704
704
|
let traceTrackingFlag = true;
|
705
|
+
function setTraceTrackingFlag(flag) {
|
706
|
+
traceTrackingFlag = flag;
|
707
|
+
}
|
705
708
|
/**
|
706
709
|
* 抑制变更的追踪修改
|
707
710
|
* 在某些情况下不需要进行修改的跟踪,例如:在初始化加载文档时,为了提高效率,增加底层开关
|
@@ -908,6 +911,12 @@ function generatePatch(doc) {
|
|
908
911
|
ops.length = 0;
|
909
912
|
return patches;
|
910
913
|
}
|
914
|
+
/**
|
915
|
+
* 清除变更的数据
|
916
|
+
*/
|
917
|
+
function clearTraces(doc) {
|
918
|
+
docOpsMap.delete(doc);
|
919
|
+
}
|
911
920
|
/**
|
912
921
|
* 获取删除元素的操作
|
913
922
|
* 在生成修改的批操作时,需要先获取删除的元素,因为元素被删除后,所有的其他操作都不需要被记录了
|
@@ -1552,6 +1561,9 @@ class PageOptions {
|
|
1552
1561
|
set height(value) {
|
1553
1562
|
this._height = value;
|
1554
1563
|
}
|
1564
|
+
clone() {
|
1565
|
+
return new PageOptions(this._width, this._height, this.orient);
|
1566
|
+
}
|
1555
1567
|
}
|
1556
1568
|
class ViewOptions {
|
1557
1569
|
copyRightInfo;
|
@@ -1826,7 +1838,7 @@ class TextProps extends INotifyPropertyChanged {
|
|
1826
1838
|
}
|
1827
1839
|
getSerializeProps(viewOptions) {
|
1828
1840
|
const props = {};
|
1829
|
-
if (this.color && this.color !== viewOptions.defaultColor) {
|
1841
|
+
if (this.color && this.color !== viewOptions.defaultColor && this.color !== '#000000') {
|
1830
1842
|
props["color"] = this.color;
|
1831
1843
|
}
|
1832
1844
|
if (this.fontName && this.fontName !== viewOptions.defaultFontName) {
|
@@ -20292,6 +20304,9 @@ function createPrintTemplate({ width, height, orient }) {
|
|
20292
20304
|
box-sizing: border-box;
|
20293
20305
|
-moz-box-sizing: border-box;
|
20294
20306
|
}
|
20307
|
+
*{
|
20308
|
+
white-space: pre;
|
20309
|
+
}
|
20295
20310
|
@page {
|
20296
20311
|
size: ${width}px ${height - 1}px ${orient};
|
20297
20312
|
margin: 0;
|
@@ -26250,8 +26265,8 @@ class DocumentPrintOffscreenBase {
|
|
26250
26265
|
console.warn('无可打印页');
|
26251
26266
|
return;
|
26252
26267
|
}
|
26253
|
-
const docProps = this.docCtx.
|
26254
|
-
printNodes(canvasNodes,
|
26268
|
+
const docProps = this.docCtx.viewOptions.docPageSettings.clone();
|
26269
|
+
printNodes(canvasNodes, docProps, {
|
26255
26270
|
beforePrint: () => this.beforePrint.next(),
|
26256
26271
|
afterPrint: () => this.afterPrint.next()
|
26257
26272
|
});
|
@@ -26280,7 +26295,7 @@ class DocumentPrintOffscreenBase {
|
|
26280
26295
|
console.warn('无可打印页');
|
26281
26296
|
return;
|
26282
26297
|
}
|
26283
|
-
const docProps = this.docCtx.viewOptions.docPageSettings;
|
26298
|
+
const docProps = this.docCtx.viewOptions.docPageSettings.clone();
|
26284
26299
|
// if (docProps.orient === 'landscape') {
|
26285
26300
|
// svgNodes = svgNodes.map(item => 'data:image/svg+xml;base64,' + CommonUtil.btoa(item)).map(item => `<img src="${item}" width="${docProps.width}px" height="${docProps.height-1}px" style="display: block"/>`);
|
26286
26301
|
// }
|
@@ -28709,7 +28724,10 @@ class DocEditor {
|
|
28709
28724
|
rule.setRuleOptions({ width: this.viewOptions.docPageSettings.width, pagePL, pagePR, docLeft });
|
28710
28725
|
}
|
28711
28726
|
version() {
|
28712
|
-
return "2.1.
|
28727
|
+
return "2.1.10";
|
28728
|
+
}
|
28729
|
+
switchPageHeaderEditor() {
|
28730
|
+
this.docCtx.document.switchPageHeaderEditor(this.selectionState, null);
|
28713
28731
|
}
|
28714
28732
|
}
|
28715
28733
|
|
@@ -28882,5 +28900,5 @@ function removeDuplicatesEvent(events) {
|
|
28882
28900
|
return arr;
|
28883
28901
|
}
|
28884
28902
|
|
28885
|
-
export { BlockContainerElement, BlockContainerRenderObject, BlockContentElement, BlockContentRenderObject, BlockLineRectRenderObject, BodyPartProps, BooleanEnum, BorderProps, BranchElement, BranchRenderObject, BreakElement, BreakFactory, BreakRenderObject, CheckBoxElement, CheckBoxFactory, CheckBoxProps, CheckBoxRenderObject, ColumnPatchUtil, CommContentBaseElement, CommContentBaseRenderObject, CommContentElement, CommContentProps, CommContentRenderObject, CommProps, CommentContentFactory, CommentElement, CommentFactory, CommentRenderObject, CommentsFactory, CommentsUtil, CommonUtil, CommsContainerElement, CommsContainerRenderObject, ContentMenuItem, ContextMenuElementEvent, DOMEventSource, DOMSubscription, DataDecorateElement, DataDecorateProps, DataDecorateRenderObject, DataEleBaseProps, DataEleBaseTextProps, DataEleCheckProps, DataEleDateProps, DataEleImageProps, DataEleListProps, DataEleMHProps, DataElementBarcode, DataElementBarcodeFactory, DataElementBarcodeProps, DataElementBarcodeRenderObject, DataElementBaseFactory, DataElementCheck, DataElementCheckFactory, DataElementCheckRenderObject, DataElementDate, DataElementDateFactory, DataElementDateRenderObject, DataElementGroupElement, DataElementGroupFactory, DataElementGroupProps, DataElementGroupRenderObject, DataElementImage, DataElementImgFactory, DataElementInlineGroup, DataElementLeaf, DataElementList, DataElementListFactory, DataElementListRenderObject, DataElementMH, DataElementMHFactory, DataElementRenderObject, DataElementText, DataElementTextFactory, DataElementTextRenderObject, DataImageRenderObject, DataRenderMH, DocEditor, DocMode, DocumentBodyElement, DocumentBodyFactory, DocumentBodyPartElement, DocumentBodyPartFactory, DocumentBodyPartRenderObject, DocumentBodyRenderObject, DocumentChange, DocumentCombine, DocumentComment, DocumentContainerRender, DocumentContext, DocumentCursor, DocumentElement, DocumentEvalFunc, DocumentEvent, DocumentFactory, DocumentFooterElement, DocumentFooterFactory, DocumentFooterRenderObject, DocumentHeaderElement, DocumentHeaderFactory, DocumentHeaderRenderObject, DocumentImagesBaseLoader, DocumentImagesLoader, DocumentInput, DocumentPaint, DocumentPrintOffscreen, DocumentPrintOffscreenBase, DocumentProps, DocumentRenderObject, DocumentSelection, DocumentTemplate, DropElementEvent, EditMode, EditorContext, Element, ElementEvent, ElementFactory, ElementPaint, ElementReader, ElementSerialize, ElementUtil, EventMap, EventSourceCore$1 as EventSourceCore, FillNullSpaceElement, FillNullSpaceRenderObject, GetTrackTipsEvent, GotCursorEvent, IDispose, INotifyPropertyChanged, InlineBlockContainer, InlineGroupElement, InlineGroupInputElement, InlineGroupRenderObject, InlineMuiltBlockLineRenderObject, InputElementEvent, IsInSideDataElement, IsInSideInlineGroupInputElement, KeyboradElementEvent, LeafElement, LeafRenderObject, LostCursorEvent, MarginProps, ModifyFlag$1 as ModifyFlag, MouseElementEvent, MousedownElementEvent, MuiltBlockLineRenderObject, OnceSubject, PSymbolElement, PSymbolRenderObject, PaddingProps, PageOptions, PaintContent, ParagraphElement, ParagraphFactory, ParagraphLineRectRenderObject, ParagraphNumberType, ParagraphProps, ParagraphRenderObject, PictureElement, PictureFactory, PictureProps, PictureRenderObject, RadioBoxElement, RadioBoxFactory, RadioBoxProps, RadioBoxRenderObject, RangeUtil, Rect, RenderContext, RenderObject, RenderObjectType, ResizeLeafRenderObject, RunElementFactory, SelectionOverlays, SelectionRange, SelectionState, Subject$1 as Subject, SubjectSubscription$1 as SubjectSubscription, Subscription$1 as Subscription, TableCellElement, TableCellFactory, TableCellProps, TableCellRenderObject, TableElement, TableFactory, TableProps, TableRenderObject, TableRowElement, TableRowFactory, TableRowProps, TableRowRenderObject, TableSplitCell, TableUtil, TextGroupElement, TextGroupFactory, TextGroupRenderObject, TextProps, TrackRunElement, TrackRunProps, TrackRunRenderObject, TrackRunTypeEnum, ValidateCondition, ValidateElement, ValidateProps, ValidateRenderObject, ViewOptions, clearChildrenRenderCache, createPrintTemplate, defaultParaHanging, deleteCurrentParagraph, documentPrint, drawDecorator, elementTypeEventHandler, exportDecoratorHTML, falseChar, fontMapFunc, fromEvent, getCalleeName, getFocusTextSegment, invokeTypeHandler, isDate, objectToString$4 as objectToString, onTableContextmenu, onceTask, parser, printNodes, reactiveMap, runTextLineRender, setChildrenModifyFlag, setDataElementProps, setNotifyChangedCallback, targetMaps, textLineRenderMode, toRawType, toTypeString, trueChar, validateDataEle, validateDataEleRenderObj, validateInlineInputRenderObj, watchChanged };
|
28903
|
+
export { BlockContainerElement, BlockContainerRenderObject, BlockContentElement, BlockContentRenderObject, BlockLineRectRenderObject, BodyPartProps, BooleanEnum, BorderProps, BranchElement, BranchRenderObject, BreakElement, BreakFactory, BreakRenderObject, CheckBoxElement, CheckBoxFactory, CheckBoxProps, CheckBoxRenderObject, ColumnPatchUtil, CommContentBaseElement, CommContentBaseRenderObject, CommContentElement, CommContentProps, CommContentRenderObject, CommProps, CommentContentFactory, CommentElement, CommentFactory, CommentRenderObject, CommentsFactory, CommentsUtil, CommonUtil, CommsContainerElement, CommsContainerRenderObject, ContentMenuItem, ContextMenuElementEvent, DOMEventSource, DOMSubscription, DataDecorateElement, DataDecorateProps, DataDecorateRenderObject, DataEleBaseProps, DataEleBaseTextProps, DataEleCheckProps, DataEleDateProps, DataEleImageProps, DataEleListProps, DataEleMHProps, DataElementBarcode, DataElementBarcodeFactory, DataElementBarcodeProps, DataElementBarcodeRenderObject, DataElementBaseFactory, DataElementCheck, DataElementCheckFactory, DataElementCheckRenderObject, DataElementDate, DataElementDateFactory, DataElementDateRenderObject, DataElementGroupElement, DataElementGroupFactory, DataElementGroupProps, DataElementGroupRenderObject, DataElementImage, DataElementImgFactory, DataElementInlineGroup, DataElementLeaf, DataElementList, DataElementListFactory, DataElementListRenderObject, DataElementMH, DataElementMHFactory, DataElementRenderObject, DataElementText, DataElementTextFactory, DataElementTextRenderObject, DataImageRenderObject, DataRenderMH, DocEditor, DocMode, DocumentBodyElement, DocumentBodyFactory, DocumentBodyPartElement, DocumentBodyPartFactory, DocumentBodyPartRenderObject, DocumentBodyRenderObject, DocumentChange, DocumentCombine, DocumentComment, DocumentContainerRender, DocumentContext, DocumentCursor, DocumentElement, DocumentEvalFunc, DocumentEvent, DocumentFactory, DocumentFooterElement, DocumentFooterFactory, DocumentFooterRenderObject, DocumentHeaderElement, DocumentHeaderFactory, DocumentHeaderRenderObject, DocumentImagesBaseLoader, DocumentImagesLoader, DocumentInput, DocumentPaint, DocumentPrintOffscreen, DocumentPrintOffscreenBase, DocumentProps, DocumentRenderObject, DocumentSelection, DocumentTemplate, DropElementEvent, EditMode, EditorContext, Element, ElementEvent, ElementFactory, ElementPaint, ElementReader, ElementSerialize, ElementUtil, EventMap, EventSourceCore$1 as EventSourceCore, FillNullSpaceElement, FillNullSpaceRenderObject, GetTrackTipsEvent, GotCursorEvent, IDispose, INotifyPropertyChanged, InlineBlockContainer, InlineGroupElement, InlineGroupInputElement, InlineGroupRenderObject, InlineMuiltBlockLineRenderObject, InputElementEvent, IsInSideDataElement, IsInSideInlineGroupInputElement, KeyboradElementEvent, LeafElement, LeafRenderObject, LostCursorEvent, MarginProps, ModifyFlag$1 as ModifyFlag, MouseElementEvent, MousedownElementEvent, MuiltBlockLineRenderObject, OnceSubject, PSymbolElement, PSymbolRenderObject, PaddingProps, PageOptions, PaintContent, ParagraphElement, ParagraphFactory, ParagraphLineRectRenderObject, ParagraphNumberType, ParagraphProps, ParagraphRenderObject, PictureElement, PictureFactory, PictureProps, PictureRenderObject, RadioBoxElement, RadioBoxFactory, RadioBoxProps, RadioBoxRenderObject, RangeUtil, Rect, RenderContext, RenderObject, RenderObjectType, ResizeLeafRenderObject, RunElementFactory, SelectionOverlays, SelectionRange, SelectionState, Subject$1 as Subject, SubjectSubscription$1 as SubjectSubscription, Subscription$1 as Subscription, TableCellElement, TableCellFactory, TableCellProps, TableCellRenderObject, TableElement, TableFactory, TableProps, TableRenderObject, TableRowElement, TableRowFactory, TableRowProps, TableRowRenderObject, TableSplitCell, TableUtil, TextGroupElement, TextGroupFactory, TextGroupRenderObject, TextProps, TrackRunElement, TrackRunProps, TrackRunRenderObject, TrackRunTypeEnum, ValidateCondition, ValidateElement, ValidateProps, ValidateRenderObject, ViewOptions, clearChildrenRenderCache, clearTraces, createPrintTemplate, defaultParaHanging, deleteCurrentParagraph, docOpsMap, documentPrint, drawDecorator, elementTypeEventHandler, exportDecoratorHTML, falseChar, fontMapFunc, formatEle, fromEvent, generatePatch, getCalleeName, getFocusTextSegment, inputText, insertEle, invokeTypeHandler, isDate, logUpdateEleProps, objectToString$4 as objectToString, onTableContextmenu, onceTask, parser, printNodes, reactiveMap, removeEle, removeText, runTextLineRender, setChildrenModifyFlag, setDataElementProps, setNotifyChangedCallback, setTraceTrackingFlag, suppressTracking, targetMaps, textLineRenderMode, toRawType, toTypeString, trueChar, validateDataEle, validateDataEleRenderObj, validateInlineInputRenderObj, watchChanged };
|
28886
28904
|
//# sourceMappingURL=index.js.map
|