@hailin-zheng/editor-core 2.2.17 → 2.2.19
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 +175 -59
- package/index-cjs.js.map +1 -1
- package/index.js +174 -60
- package/index.js.map +1 -1
- package/med_editor/doc-editor.d.ts +8 -0
- package/med_editor/framework/document-change.d.ts +8 -0
- package/med_editor/framework/element-define.d.ts +7 -1
- package/med_editor/framework/impl/data-element/data-element-base-impl.d.ts +8 -1
- package/package.json +1 -1
    
        package/index.js
    CHANGED
    
    | @@ -1720,18 +1720,26 @@ class ViewOptions { | |
| 1720 1720 | 
             
                dataEleEmptyBgColor = '';
         | 
| 1721 1721 | 
             
                //数据元鼠标悬浮颜色
         | 
| 1722 1722 | 
             
                dataEleMouseEnterBgColor = '#d9d9d9';
         | 
| 1723 | 
            +
                dataEleMouseEnterDecoratorMode = 'background';
         | 
| 1723 1724 | 
             
                //数据元只读背景颜色
         | 
| 1724 1725 | 
             
                dataEleReadOnlyBgColor = '#d9d9d9';
         | 
| 1725 1726 | 
             
                //数据元焦点背景颜色
         | 
| 1726 1727 | 
             
                dataEleFocusedBgColor = '#d9d9d9';
         | 
| 1728 | 
            +
                dataEleFocusedDecoratorMode = 'background';
         | 
| 1727 1729 | 
             
                //数据元正常背景颜色
         | 
| 1728 1730 | 
             
                dataEleNormalBgColor = '#fafafa';
         | 
| 1731 | 
            +
                //数据元外部框线颜色
         | 
| 1732 | 
            +
                dataEleOutlineColor = '#0050b3';
         | 
| 1733 | 
            +
                //数据组外部框线颜色
         | 
| 1734 | 
            +
                dataGroupOutlineColor = '#0050b3';
         | 
| 1729 1735 | 
             
                //数据元错误背景颜色
         | 
| 1730 1736 | 
             
                dataEleErrorBgColor = '#ff4d4f';
         | 
| 1731 1737 | 
             
                //数据组修饰符号颜色
         | 
| 1732 1738 | 
             
                dataGroupDecoratorNormalColor = '#0050b3';
         | 
| 1733 1739 | 
             
                dataGroupDecoratorMouseEnterColor = '#0050b3';
         | 
| 1740 | 
            +
                dataGroupMouseEnterDecoratorMode = 'outline';
         | 
| 1734 1741 | 
             
                dataGroupDecoratorFocusedColor = '#0050b3';
         | 
| 1742 | 
            +
                dataGroupFocusedDecoratorMode = 'outline';
         | 
| 1735 1743 | 
             
                //数据组正常背景颜色
         | 
| 1736 1744 | 
             
                dataGroupNormalBgColor = '#fafafa';
         | 
| 1737 1745 | 
             
                //数据元没有输入值时背景颜色
         | 
| @@ -1752,8 +1760,6 @@ class ViewOptions { | |
| 1752 1760 | 
             
                trackDelColor = '#000';
         | 
| 1753 1761 | 
             
                showLineRect;
         | 
| 1754 1762 | 
             
                showCharRect;
         | 
| 1755 | 
            -
                //数据元交互修饰模式
         | 
| 1756 | 
            -
                dataEleDecoratorMode = 'outline';
         | 
| 1757 1763 | 
             
                showTabChar;
         | 
| 1758 1764 | 
             
                showSpaceChar;
         | 
| 1759 1765 | 
             
                showLineBreak;
         | 
| @@ -3730,7 +3736,7 @@ class DocumentRenderObject extends BlockContainerRenderObject { | |
| 3730 3736 | 
             
                            },
         | 
| 3731 3737 | 
             
                        },
         | 
| 3732 3738 | 
             
                        children: [
         | 
| 3733 | 
            -
                            pageCorner, highlight, ...CommonUtil.toArray(event.getChildNodes(this)), pageNum,  | 
| 3739 | 
            +
                            pageCorner, highlight, selection, ...CommonUtil.toArray(event.getChildNodes(this)), pageNum, copyright
         | 
| 3734 3740 | 
             
                        ]
         | 
| 3735 3741 | 
             
                    };
         | 
| 3736 3742 | 
             
                }
         | 
| @@ -4057,7 +4063,11 @@ class DataElementInlineGroup extends InlineGroupInputElement { | |
| 4057 4063 | 
             
                                }
         | 
| 4058 4064 | 
             
                            });
         | 
| 4059 4065 | 
             
                        }
         | 
| 4060 | 
            -
                        this.parserExpress = { | 
| 4066 | 
            +
                        this.parserExpress = {
         | 
| 4067 | 
            +
                            compliedCode,
         | 
| 4068 | 
            +
                            func: new Function(`with(this){ ${compliedCode} }`),
         | 
| 4069 | 
            +
                            depItems: depEleMap
         | 
| 4070 | 
            +
                        };
         | 
| 4061 4071 | 
             
                    }
         | 
| 4062 4072 | 
             
                    catch (e) {
         | 
| 4063 4073 | 
             
                        console.error('解析表达式出错,parseEleExpression', this.props.expression);
         | 
| @@ -4174,6 +4184,7 @@ function exportDataEleDecoratorSVG$1(event, r) { | |
| 4174 4184 | 
             
                    return;
         | 
| 4175 4185 | 
             
                }
         | 
| 4176 4186 | 
             
                const options = event.options;
         | 
| 4187 | 
            +
                let mode = 'background';
         | 
| 4177 4188 | 
             
                let color = options.dataEleNormalBgColor;
         | 
| 4178 4189 | 
             
                //空数据元填充颜色
         | 
| 4179 4190 | 
             
                if (r.element.length === 2 && options.dataEleEmptyBgColor) {
         | 
| @@ -4181,17 +4192,70 @@ function exportDataEleDecoratorSVG$1(event, r) { | |
| 4181 4192 | 
             
                }
         | 
| 4182 4193 | 
             
                if (r.element.isMouseenter && options.dataEleMouseEnterBgColor) {
         | 
| 4183 4194 | 
             
                    color = options.dataEleMouseEnterBgColor;
         | 
| 4195 | 
            +
                    mode = options.dataEleMouseEnterDecoratorMode;
         | 
| 4184 4196 | 
             
                }
         | 
| 4185 4197 | 
             
                if (r.element.isFocused && options.dataEleFocusedBgColor) {
         | 
| 4186 4198 | 
             
                    color = options.dataEleFocusedBgColor;
         | 
| 4199 | 
            +
                    mode = options.dataEleFocusedDecoratorMode;
         | 
| 4187 4200 | 
             
                }
         | 
| 4188 4201 | 
             
                if (!color) {
         | 
| 4189 4202 | 
             
                    return;
         | 
| 4190 4203 | 
             
                }
         | 
| 4191 4204 | 
             
                //绘制背景
         | 
| 4192 | 
            -
                 | 
| 4193 | 
            -
             | 
| 4194 | 
            -
             | 
| 4205 | 
            +
                if (['all', 'background'].includes(mode)) {
         | 
| 4206 | 
            +
                    const bgX = event.relativePagePos.x;
         | 
| 4207 | 
            +
                    const bgY = event.relativePagePos.y + 1;
         | 
| 4208 | 
            +
                    //+1,-2,放置渲染元素边框被遮挡
         | 
| 4209 | 
            +
                    event.highlights.push(ElementUtil.getFillSvgRect(bgX, bgY, r.rect.width, r.rect.height - 2, color));
         | 
| 4210 | 
            +
                }
         | 
| 4211 | 
            +
                if (['all', 'outline'].includes(mode)) {
         | 
| 4212 | 
            +
                    color = event.options.dataEleOutlineColor;
         | 
| 4213 | 
            +
                    const verOffset = 0;
         | 
| 4214 | 
            +
                    const renderPosMap = getCurrentParaGroupRenders(r).map(item => ({ pos: getRenderPosToDoc(item), render: item }));
         | 
| 4215 | 
            +
                    if (renderPosMap.length > 1) {
         | 
| 4216 | 
            +
                        const secondGroupRenderPos = renderPosMap[1].pos;
         | 
| 4217 | 
            +
                        if (secondGroupRenderPos.x + renderPosMap[1].render.rect.width > event.relativePagePos.x) {
         | 
| 4218 | 
            +
                            const leftPoints = [];
         | 
| 4219 | 
            +
                            const rightPoints = [];
         | 
| 4220 | 
            +
                            for (let i = 0; i < renderPosMap.length; i++) {
         | 
| 4221 | 
            +
                                const groupRender = renderPosMap[i].render;
         | 
| 4222 | 
            +
                                const groupRenderPos = renderPosMap[i].pos;
         | 
| 4223 | 
            +
                                leftPoints.push({ x: groupRenderPos.x, y: groupRenderPos.y - verOffset });
         | 
| 4224 | 
            +
                                rightPoints.push({
         | 
| 4225 | 
            +
                                    x: groupRenderPos.x + groupRender.rect.width,
         | 
| 4226 | 
            +
                                    y: groupRenderPos.y - verOffset
         | 
| 4227 | 
            +
                                });
         | 
| 4228 | 
            +
                                leftPoints.push({
         | 
| 4229 | 
            +
                                    x: groupRenderPos.x,
         | 
| 4230 | 
            +
                                    y: groupRenderPos.y + groupRender.rect.height + verOffset * 2
         | 
| 4231 | 
            +
                                });
         | 
| 4232 | 
            +
                                rightPoints.push({
         | 
| 4233 | 
            +
                                    x: groupRenderPos.x + groupRender.rect.width,
         | 
| 4234 | 
            +
                                    y: groupRenderPos.y + groupRender.rect.height + verOffset * 2
         | 
| 4235 | 
            +
                                });
         | 
| 4236 | 
            +
                            }
         | 
| 4237 | 
            +
                            const sharpPoints1 = CommonUtil.resharpPoints(rightPoints);
         | 
| 4238 | 
            +
                            const sharpPoints = CommonUtil.resharpPoints([...leftPoints.reverse()]);
         | 
| 4239 | 
            +
                            const path = [...sharpPoints, ...sharpPoints1, sharpPoints[0]].map((item, index) => ((index === 0) ? 'M' : "L") + item.x + " " + item.y).join(" ");
         | 
| 4240 | 
            +
                            event.highlights.push(ElementUtil.createSvgPath({
         | 
| 4241 | 
            +
                                d: path,
         | 
| 4242 | 
            +
                                stroke: color,
         | 
| 4243 | 
            +
                                fill: 'none',
         | 
| 4244 | 
            +
                                'stroke-width': 1
         | 
| 4245 | 
            +
                            }));
         | 
| 4246 | 
            +
                            return;
         | 
| 4247 | 
            +
                        }
         | 
| 4248 | 
            +
                    }
         | 
| 4249 | 
            +
                    for (let i = 0; i < renderPosMap.length; i++) {
         | 
| 4250 | 
            +
                        const currRen = renderPosMap[i];
         | 
| 4251 | 
            +
                        event.highlights.push(ElementUtil.createSvgPath({
         | 
| 4252 | 
            +
                            d: `M${currRen.pos.x} ${currRen.pos.y} L${currRen.pos.x + currRen.render.rect.width} ${currRen.pos.y} L${currRen.pos.x + currRen.render.rect.width} ${currRen.pos.y + currRen.render.rect.height} L${currRen.pos.x} ${currRen.pos.y + currRen.render.rect.height} Z`,
         | 
| 4253 | 
            +
                            stroke: color,
         | 
| 4254 | 
            +
                            fill: 'none',
         | 
| 4255 | 
            +
                            'stroke-width': 1
         | 
| 4256 | 
            +
                        }));
         | 
| 4257 | 
            +
                    }
         | 
| 4258 | 
            +
                }
         | 
| 4195 4259 | 
             
                // const canPaint = r.element.isMouseenter || r.element.isFocused;
         | 
| 4196 4260 | 
             
                // if (!canPaint) {
         | 
| 4197 4261 | 
             
                //     return;
         | 
| @@ -4206,51 +4270,6 @@ function exportDataEleDecoratorSVG$1(event, r) { | |
| 4206 4270 | 
             
                //     event.highlights.push(ElementUtil.getFillSvgRect(bgX, bgY, r.rect.width, r.rect.height, color));
         | 
| 4207 4271 | 
             
                //     return;
         | 
| 4208 4272 | 
             
                // } else if (mode === 'outline') {
         | 
| 4209 | 
            -
                //     const verOffset = 0;
         | 
| 4210 | 
            -
                //     const renderPosMap = getCurrentParaGroupRenders(r).map(item => ({ pos: getRenderPosToDoc(item), render: item }));
         | 
| 4211 | 
            -
                //     if (renderPosMap.length > 1) {
         | 
| 4212 | 
            -
                //         const secondGroupRenderPos = renderPosMap[1].pos;
         | 
| 4213 | 
            -
                //         if (secondGroupRenderPos.x + renderPosMap[1].render.rect.width > event.relativePagePos.x) {
         | 
| 4214 | 
            -
                //             const leftPoints: Array<Position> = [];
         | 
| 4215 | 
            -
                //             const rightPoints: Array<Position> = [];
         | 
| 4216 | 
            -
                //             for (let i = 0; i < renderPosMap.length; i++) {
         | 
| 4217 | 
            -
                //                 const groupRender = renderPosMap[i].render;
         | 
| 4218 | 
            -
                //                 const groupRenderPos = renderPosMap[i].pos;
         | 
| 4219 | 
            -
                //                 leftPoints.push({ x: groupRenderPos.x, y: groupRenderPos.y - verOffset });
         | 
| 4220 | 
            -
                //                 rightPoints.push({
         | 
| 4221 | 
            -
                //                     x: groupRenderPos.x + groupRender.rect.width,
         | 
| 4222 | 
            -
                //                     y: groupRenderPos.y - verOffset
         | 
| 4223 | 
            -
                //                 });
         | 
| 4224 | 
            -
                //                 leftPoints.push({
         | 
| 4225 | 
            -
                //                     x: groupRenderPos.x,
         | 
| 4226 | 
            -
                //                     y: groupRenderPos.y + groupRender.rect.height + verOffset * 2
         | 
| 4227 | 
            -
                //                 });
         | 
| 4228 | 
            -
                //                 rightPoints.push({
         | 
| 4229 | 
            -
                //                     x: groupRenderPos.x + groupRender.rect.width,
         | 
| 4230 | 
            -
                //                     y: groupRenderPos.y + groupRender.rect.height + verOffset * 2
         | 
| 4231 | 
            -
                //                 });
         | 
| 4232 | 
            -
                //             }
         | 
| 4233 | 
            -
                //             const sharpPoints1 = CommonUtil.resharpPoints(rightPoints);
         | 
| 4234 | 
            -
                //             const sharpPoints = CommonUtil.resharpPoints([...leftPoints.reverse()]);
         | 
| 4235 | 
            -
                //             const path = [...sharpPoints, ...sharpPoints1, sharpPoints[0]].map((item, index) => ((index === 0) ? 'M' : "L") + item.x + " " + item.y).join(" ")
         | 
| 4236 | 
            -
                //             event.highlights.push(ElementUtil.createSvgPath({
         | 
| 4237 | 
            -
                //                 d: path,
         | 
| 4238 | 
            -
                //                 stroke: color,
         | 
| 4239 | 
            -
                //                 fill: 'none',
         | 
| 4240 | 
            -
                //                 'stroke-width': 1
         | 
| 4241 | 
            -
                //             }));
         | 
| 4242 | 
            -
                //             return;
         | 
| 4243 | 
            -
                //         }
         | 
| 4244 | 
            -
                //     }
         | 
| 4245 | 
            -
                //     for (let i = 0; i < renderPosMap.length; i++) {
         | 
| 4246 | 
            -
                //         const currRen = renderPosMap[i];
         | 
| 4247 | 
            -
                //         event.highlights.push(ElementUtil.createSvgPath({
         | 
| 4248 | 
            -
                //             d: `M${currRen.pos.x} ${currRen.pos.y} L${currRen.pos.x + currRen.render.rect.width} ${currRen.pos.y} L${currRen.pos.x + currRen.render.rect.width} ${currRen.pos.y + currRen.render.rect.height} L${currRen.pos.x} ${currRen.pos.y + currRen.render.rect.height} Z`,
         | 
| 4249 | 
            -
                //             stroke: '#0050b3',
         | 
| 4250 | 
            -
                //             fill: 'none',
         | 
| 4251 | 
            -
                //             'stroke-width': 1
         | 
| 4252 | 
            -
                //         }));
         | 
| 4253 | 
            -
                //     }
         | 
| 4254 4273 | 
             
                // }
         | 
| 4255 4274 | 
             
            }
         | 
| 4256 4275 | 
             
            /**
         | 
| @@ -4357,6 +4376,30 @@ function renderUnderWavyLine(event, r, color) { | |
| 4357 4376 | 
             
                const path = ElementUtil.createSvgPath({ d, fill: 'none', stroke: color });
         | 
| 4358 4377 | 
             
                event.highlights.push(path);
         | 
| 4359 4378 | 
             
            }
         | 
| 4379 | 
            +
            /**
         | 
| 4380 | 
            +
             * 获取渲染元素相对稳当的位置
         | 
| 4381 | 
            +
             * @param render
         | 
| 4382 | 
            +
             * @param refPos
         | 
| 4383 | 
            +
             */
         | 
| 4384 | 
            +
            function getRenderPosToDoc(render, refPos = null) {
         | 
| 4385 | 
            +
                refPos = refPos ?? { x: 0, y: 0 };
         | 
| 4386 | 
            +
                if (render instanceof DocumentRenderObject) {
         | 
| 4387 | 
            +
                    return refPos;
         | 
| 4388 | 
            +
                }
         | 
| 4389 | 
            +
                const currPos = { x: render.rect.x + refPos.x, y: render.rect.y + refPos.y };
         | 
| 4390 | 
            +
                return getRenderPosToDoc(render.parent, currPos);
         | 
| 4391 | 
            +
            }
         | 
| 4392 | 
            +
            function getCurrentParaGroupRenders(r) {
         | 
| 4393 | 
            +
                const renders = [];
         | 
| 4394 | 
            +
                const currParaRender = ElementUtil.getParentRender(r, ParagraphRenderObject);
         | 
| 4395 | 
            +
                for (let i = 0; i < r.element.paintRenders.length; i++) {
         | 
| 4396 | 
            +
                    const paraRender = ElementUtil.getParentRender(r.element.paintRenders[i], ParagraphRenderObject);
         | 
| 4397 | 
            +
                    if (paraRender === currParaRender) {
         | 
| 4398 | 
            +
                        renders.push(r.element.paintRenders[i]);
         | 
| 4399 | 
            +
                    }
         | 
| 4400 | 
            +
                }
         | 
| 4401 | 
            +
                return renders;
         | 
| 4402 | 
            +
            }
         | 
| 4360 4403 | 
             
            function renderUnderline(event, render) {
         | 
| 4361 4404 | 
             
                const { x, y } = event.relativePagePos;
         | 
| 4362 4405 | 
             
                event.highlights.push({
         | 
| @@ -8899,23 +8942,76 @@ function exportDataEleDecoratorSVG(event, r) { | |
| 8899 8942 | 
             
                }
         | 
| 8900 8943 | 
             
                const options = event.options;
         | 
| 8901 8944 | 
             
                let color = options.dataGroupNormalBgColor;
         | 
| 8945 | 
            +
                let mode = 'background';
         | 
| 8902 8946 | 
             
                //空数据元填充颜色
         | 
| 8903 8947 | 
             
                if (r.element.length === 2 && options.dataGroupEmptyBgColor) {
         | 
| 8904 8948 | 
             
                    color = options.dataGroupEmptyBgColor;
         | 
| 8905 8949 | 
             
                }
         | 
| 8906 8950 | 
             
                if (r.element.isMouseenter && options.dataGroupMouseEnterBgColor) {
         | 
| 8907 8951 | 
             
                    color = options.dataGroupMouseEnterBgColor;
         | 
| 8952 | 
            +
                    mode = options.dataGroupMouseEnterDecoratorMode;
         | 
| 8908 8953 | 
             
                }
         | 
| 8909 8954 | 
             
                if (r.element.isFocused && options.dataGroupFocusedBgColor) {
         | 
| 8910 8955 | 
             
                    color = options.dataGroupFocusedBgColor;
         | 
| 8956 | 
            +
                    mode = options.dataGroupFocusedDecoratorMode;
         | 
| 8911 8957 | 
             
                }
         | 
| 8912 8958 | 
             
                if (!color) {
         | 
| 8913 8959 | 
             
                    return;
         | 
| 8914 8960 | 
             
                }
         | 
| 8915 8961 | 
             
                //绘制背景
         | 
| 8916 | 
            -
                 | 
| 8917 | 
            -
             | 
| 8918 | 
            -
             | 
| 8962 | 
            +
                if (['all', 'background'].includes(mode)) {
         | 
| 8963 | 
            +
                    const bgX = event.relativePagePos.x;
         | 
| 8964 | 
            +
                    const bgY = event.relativePagePos.y;
         | 
| 8965 | 
            +
                    event.highlights.push(ElementUtil.getFillSvgRect(bgX, bgY, r.rect.width, r.rect.height, color));
         | 
| 8966 | 
            +
                }
         | 
| 8967 | 
            +
                if (['all', 'outline'].includes(mode)) {
         | 
| 8968 | 
            +
                    color = event.options.dataGroupOutlineColor;
         | 
| 8969 | 
            +
                    const verOffset = 0;
         | 
| 8970 | 
            +
                    const renderPosMap = getCurrentParaGroupRenders(r).map(item => ({ pos: getRenderPosToDoc(item), render: item }));
         | 
| 8971 | 
            +
                    if (renderPosMap.length > 1) {
         | 
| 8972 | 
            +
                        const secondGroupRenderPos = renderPosMap[1].pos;
         | 
| 8973 | 
            +
                        if (secondGroupRenderPos.x + renderPosMap[1].render.rect.width > event.relativePagePos.x) {
         | 
| 8974 | 
            +
                            const leftPoints = [];
         | 
| 8975 | 
            +
                            const rightPoints = [];
         | 
| 8976 | 
            +
                            for (let i = 0; i < renderPosMap.length; i++) {
         | 
| 8977 | 
            +
                                const groupRender = renderPosMap[i].render;
         | 
| 8978 | 
            +
                                const groupRenderPos = renderPosMap[i].pos;
         | 
| 8979 | 
            +
                                leftPoints.push({ x: groupRenderPos.x, y: groupRenderPos.y - verOffset });
         | 
| 8980 | 
            +
                                rightPoints.push({
         | 
| 8981 | 
            +
                                    x: groupRenderPos.x + groupRender.rect.width,
         | 
| 8982 | 
            +
                                    y: groupRenderPos.y - verOffset
         | 
| 8983 | 
            +
                                });
         | 
| 8984 | 
            +
                                leftPoints.push({
         | 
| 8985 | 
            +
                                    x: groupRenderPos.x,
         | 
| 8986 | 
            +
                                    y: groupRenderPos.y + groupRender.rect.height + verOffset * 2
         | 
| 8987 | 
            +
                                });
         | 
| 8988 | 
            +
                                rightPoints.push({
         | 
| 8989 | 
            +
                                    x: groupRenderPos.x + groupRender.rect.width,
         | 
| 8990 | 
            +
                                    y: groupRenderPos.y + groupRender.rect.height + verOffset * 2
         | 
| 8991 | 
            +
                                });
         | 
| 8992 | 
            +
                            }
         | 
| 8993 | 
            +
                            const sharpPoints1 = CommonUtil.resharpPoints(rightPoints);
         | 
| 8994 | 
            +
                            const sharpPoints = CommonUtil.resharpPoints([...leftPoints.reverse()]);
         | 
| 8995 | 
            +
                            const path = [...sharpPoints, ...sharpPoints1, sharpPoints[0]].map((item, index) => ((index === 0) ? 'M' : "L") + item.x + " " + item.y).join(" ");
         | 
| 8996 | 
            +
                            event.highlights.push(ElementUtil.createSvgPath({
         | 
| 8997 | 
            +
                                d: path,
         | 
| 8998 | 
            +
                                stroke: color,
         | 
| 8999 | 
            +
                                fill: 'none',
         | 
| 9000 | 
            +
                                'stroke-width': 1
         | 
| 9001 | 
            +
                            }));
         | 
| 9002 | 
            +
                            return;
         | 
| 9003 | 
            +
                        }
         | 
| 9004 | 
            +
                    }
         | 
| 9005 | 
            +
                    for (let i = 0; i < renderPosMap.length; i++) {
         | 
| 9006 | 
            +
                        const currRen = renderPosMap[i];
         | 
| 9007 | 
            +
                        event.highlights.push(ElementUtil.createSvgPath({
         | 
| 9008 | 
            +
                            d: `M${currRen.pos.x} ${currRen.pos.y} L${currRen.pos.x + currRen.render.rect.width} ${currRen.pos.y} L${currRen.pos.x + currRen.render.rect.width} ${currRen.pos.y + currRen.render.rect.height} L${currRen.pos.x} ${currRen.pos.y + currRen.render.rect.height} Z`,
         | 
| 9009 | 
            +
                            stroke: color,
         | 
| 9010 | 
            +
                            fill: 'none',
         | 
| 9011 | 
            +
                            'stroke-width': 1
         | 
| 9012 | 
            +
                        }));
         | 
| 9013 | 
            +
                    }
         | 
| 9014 | 
            +
                }
         | 
| 8919 9015 | 
             
            }
         | 
| 8920 9016 |  | 
| 8921 9017 | 
             
            class DataElementImage extends DataElementLeaf {
         | 
| @@ -14228,6 +14324,11 @@ class ParagraphMeasure { | |
| 14228 14324 | 
             
                        parent: parentLine,
         | 
| 14229 14325 | 
             
                        isCloseToBody: parentLine.isCloseToBody,
         | 
| 14230 14326 | 
             
                        applyNewLine() {
         | 
| 14327 | 
            +
                            //申请新行前,需要将当前内联元素的宽度扩充到可用最大宽度
         | 
| 14328 | 
            +
                            const space = parentLine.limitWidth - parentLine.lineWidth();
         | 
| 14329 | 
            +
                            if (space > 0) {
         | 
| 14330 | 
            +
                                render.rect.width += space;
         | 
| 14331 | 
            +
                            }
         | 
| 14231 14332 | 
             
                            parentLine.applyNewLine();
         | 
| 14232 14333 | 
             
                            render = ele.createRenderObject({ options, renderCtx, execute });
         | 
| 14233 14334 | 
             
                            parentLine.add(render);
         | 
| @@ -18463,6 +18564,13 @@ class DocumentChange { | |
| 18463 18564 | 
             
                    }
         | 
| 18464 18565 | 
             
                    let pasteText = evt.clipboardData?.getData('text/plain') ?? '';
         | 
| 18465 18566 | 
             
                    const pasteData = evt.clipboardData?.getData('doc/plain') ?? '';
         | 
| 18567 | 
            +
                    this.onInsertContent({ text: pasteText, doc: pasteData });
         | 
| 18568 | 
            +
                }
         | 
| 18569 | 
            +
                /**
         | 
| 18570 | 
            +
                 * 在光标处插入内容
         | 
| 18571 | 
            +
                 * @param data
         | 
| 18572 | 
            +
                 */
         | 
| 18573 | 
            +
                onInsertContent(data) {
         | 
| 18466 18574 | 
             
                    const { collapsed } = this.selectionState;
         | 
| 18467 18575 | 
             
                    if (!collapsed) {
         | 
| 18468 18576 | 
             
                        //TODO:如果一个容器内的元素被全部删除,则返回 null
         | 
| @@ -18471,12 +18579,12 @@ class DocumentChange { | |
| 18471 18579 | 
             
                        // startOffset = cursorOffset;
         | 
| 18472 18580 | 
             
                        this.onRangeDelete();
         | 
| 18473 18581 | 
             
                        const cb = () => {
         | 
| 18474 | 
            -
                            this.handlePasteContent({ text:  | 
| 18582 | 
            +
                            this.handlePasteContent({ text: data.text, doc: data.doc }, this.selectionState);
         | 
| 18475 18583 | 
             
                        };
         | 
| 18476 18584 | 
             
                        this.docCtx.onNextView(cb);
         | 
| 18477 18585 | 
             
                        return;
         | 
| 18478 18586 | 
             
                    }
         | 
| 18479 | 
            -
                    this.handlePasteContent({ text:  | 
| 18587 | 
            +
                    this.handlePasteContent({ text: data.text, doc: data.doc }, this.selectionState);
         | 
| 18480 18588 | 
             
                }
         | 
| 18481 18589 | 
             
                /**
         | 
| 18482 18590 | 
             
                 * 处理粘贴的内容
         | 
| @@ -19723,7 +19831,6 @@ class DocumentSvg { | |
| 19723 19831 | 
             
                                fill: item.color ?? this.viewOptions.selectionColor,
         | 
| 19724 19832 | 
             
                                'paint-order': 'stroke fill markers',
         | 
| 19725 19833 | 
             
                                d: `M${item.x} ${item.y} L${item.x + item.width} ${item.y} L${item.x + item.width} ${item.y + item.height} L${item.x} ${item.y + item.height} Z`,
         | 
| 19726 | 
            -
                                'fill-opacity': '0.5'
         | 
| 19727 19834 | 
             
                            }
         | 
| 19728 19835 | 
             
                        }
         | 
| 19729 19836 | 
             
                    }));
         | 
| @@ -22345,7 +22452,7 @@ class DocEditor { | |
| 22345 22452 | 
             
                    rule.setRuleOptions({ width: this.viewOptions.docPageSettings.width, pagePL, pagePR, docLeft });
         | 
| 22346 22453 | 
             
                }
         | 
| 22347 22454 | 
             
                version() {
         | 
| 22348 | 
            -
                    return "2.2. | 
| 22455 | 
            +
                    return "2.2.19";
         | 
| 22349 22456 | 
             
                }
         | 
| 22350 22457 | 
             
                switchPageHeaderEditor() {
         | 
| 22351 22458 | 
             
                    this.docCtx.document.switchPageHeaderEditor(this.selectionState, null);
         | 
| @@ -22692,6 +22799,13 @@ class DocEditor { | |
| 22692 22799 | 
             
                removeEleAttribute(ele, attr) {
         | 
| 22693 22800 | 
             
                    ElementUtil.removeEleAttribute(ele, attr);
         | 
| 22694 22801 | 
             
                }
         | 
| 22802 | 
            +
                /**
         | 
| 22803 | 
            +
                 * 在光标处插入内容
         | 
| 22804 | 
            +
                 * @param data
         | 
| 22805 | 
            +
                 */
         | 
| 22806 | 
            +
                onInsertContent(data) {
         | 
| 22807 | 
            +
                    this.documentChange.onInsertContent(data);
         | 
| 22808 | 
            +
                }
         | 
| 22695 22809 | 
             
            }
         | 
| 22696 22810 |  | 
| 22697 22811 | 
             
            /**
         | 
| @@ -28101,5 +28215,5 @@ function removeDuplicatesEvent(events) { | |
| 28101 28215 | 
             
                return arr;
         | 
| 28102 28216 | 
             
            }
         | 
| 28103 28217 |  | 
| 28104 | 
            -
            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, CommonUtil, CommsContainerElement, CommsContainerRenderObject, ContentMenuItem, ContextMenuElementEvent, CopyElementEvent, DOMEventSource, DOMSubscription, DataContainerElement, DataContainerFactory, DataContainerProps, DataContainerRenderObject, 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, DocInputSuggestions, DocMode, DocumentBodyElement, DocumentBodyFactory, DocumentBodyPartElement, DocumentBodyPartFactory, DocumentBodyPartRenderObject, DocumentBodyRenderObject, DocumentChange, DocumentCombine, DocumentComment, DocumentContainerRender, DocumentContext, DocumentCursor, DocumentElement, DocumentEvalFunc, DocumentEvent, DocumentFactory, DocumentFooterElement, DocumentFooterFactory, DocumentFooterRenderObject, DocumentHeaderElement, DocumentHeaderFactory, DocumentHeaderRenderObject, DocumentInput, DocumentPaginator, DocumentPrintOffscreen, DocumentPrintOffscreenBase, DocumentProps, DocumentRenderObject, DocumentSelection, DocumentTemplate, DropElementEvent, EditMode, EditorContext, Element, ElementEvent, ElementFactory, ElementReader, ElementSerialize, ElementUtil, EventBus, EventMap, EventSourceCore, FillNullSpaceElement, FillNullSpaceRenderObject, GetTrackTipsEvent, GotCursorEvent, IDispose, INotifyPropertyChanged, InlineBlockContainer, InlineGroupElement, InlineGroupInputElement, InlineGroupRenderObject, InlineMuiltBlockLineRenderObject, InputElementEvent, IsInSideDataElement, IsInSideDataGroup, IsInSideInlineGroupInputElement, KeyboradElementEvent, LeafElement, LeafRenderObject, LostCursorEvent, MarginProps, ModifyFlag, MouseElementEvent, MousedownElementEvent, MultiBlockLineRenderObject, OnceSubject, PSymbolElement, PSymbolRenderObject, PaddingProps, PageBreakElement, PageBreakFactory, PageBreakRenderObject, PageOptions, PaintContent, ParagraphElement, ParagraphFactory, ParagraphLineRectRenderObject, ParagraphNumberType, ParagraphProps, ParagraphRenderObject, PasteElementEvent, PermanentTeethElement, PermanentTeethFactory, PermanentTeethProps, PermanentTeethRenderObject, PictureElement, PictureFactory, PictureProps, PictureRenderObject, RadioBoxElement, RadioBoxFactory, RadioBoxProps, RadioBoxRenderObject, RangeUtil, Rect, RenderContext, RenderObject, RenderObjectType, ResizeLeafRenderObject, RowMinHeight, RunElementFactory, SVGElement, SVGFactory, SVGProps, SVGRenderObject, SelectionOverlays, SelectionRange, SelectionState, Subject, SubjectSubscription, Subscription, TEXT_HEIGHT_FACTOR, TabElement, TabFactory, TabRenderObject, TableCellElement, TableCellFactory, TableCellProps, TableCellRenderObject, TableElement, TableFactory, TableProps, TableRenderObject, TableRowElement, TableRowFactory, TableRowProps, TableRowRenderObject, TableSplitCell, TableUtil, TextGroupElement, TextGroupFactory, TextGroupRenderObject, TextProps, TextUnitsHolder, TrackRunElement, TrackRunProps, TrackRunRenderObject, TrackRunTypeEnum, ValidateCondition, ValidateElement, ValidateProps, ValidateRenderObject, ViewOptions, addReturn, clearChildrenRenderCache, clearTraces, cloneChildren, cloneElementBase, defaultParaHanging, deleteCurrentParagraph, docOpsMap, elementTypeEventHandler, exportDataEleDecoratorSVG$1 as exportDataEleDecoratorSVG, falseChar, fontMapFunc, formatEle, fromEvent, generatePatch, getCalleeName, getFocusTextSegment, inputText, insertEle, invokeTypeHandler, isDate, logUpdateEleProps, objectToString$4 as objectToString, onTableContextmenu, onceTask, parser, reactiveMap, refreshEditor, removeEle, removeText, renderErrorTip, renderUnderWavyLine, renderUnderline, runTextLineRender, setChildrenModifyFlag, setNotifyChangedCallback, setTraceTrackingFlag, suppressTracking, targetMaps, textLineRenderMode, toRawType, toTypeString, trueChar, validateDataEle, validateDataEleRenderObj, validateDataGroup, validateInlineInputRenderObj, watchChanged };
         | 
| 28218 | 
            +
            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, CommonUtil, CommsContainerElement, CommsContainerRenderObject, ContentMenuItem, ContextMenuElementEvent, CopyElementEvent, DOMEventSource, DOMSubscription, DataContainerElement, DataContainerFactory, DataContainerProps, DataContainerRenderObject, 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, DocInputSuggestions, DocMode, DocumentBodyElement, DocumentBodyFactory, DocumentBodyPartElement, DocumentBodyPartFactory, DocumentBodyPartRenderObject, DocumentBodyRenderObject, DocumentChange, DocumentCombine, DocumentComment, DocumentContainerRender, DocumentContext, DocumentCursor, DocumentElement, DocumentEvalFunc, DocumentEvent, DocumentFactory, DocumentFooterElement, DocumentFooterFactory, DocumentFooterRenderObject, DocumentHeaderElement, DocumentHeaderFactory, DocumentHeaderRenderObject, DocumentInput, DocumentPaginator, DocumentPrintOffscreen, DocumentPrintOffscreenBase, DocumentProps, DocumentRenderObject, DocumentSelection, DocumentTemplate, DropElementEvent, EditMode, EditorContext, Element, ElementEvent, ElementFactory, ElementReader, ElementSerialize, ElementUtil, EventBus, EventMap, EventSourceCore, FillNullSpaceElement, FillNullSpaceRenderObject, GetTrackTipsEvent, GotCursorEvent, IDispose, INotifyPropertyChanged, InlineBlockContainer, InlineGroupElement, InlineGroupInputElement, InlineGroupRenderObject, InlineMuiltBlockLineRenderObject, InputElementEvent, IsInSideDataElement, IsInSideDataGroup, IsInSideInlineGroupInputElement, KeyboradElementEvent, LeafElement, LeafRenderObject, LostCursorEvent, MarginProps, ModifyFlag, MouseElementEvent, MousedownElementEvent, MultiBlockLineRenderObject, OnceSubject, PSymbolElement, PSymbolRenderObject, PaddingProps, PageBreakElement, PageBreakFactory, PageBreakRenderObject, PageOptions, PaintContent, ParagraphElement, ParagraphFactory, ParagraphLineRectRenderObject, ParagraphNumberType, ParagraphProps, ParagraphRenderObject, PasteElementEvent, PermanentTeethElement, PermanentTeethFactory, PermanentTeethProps, PermanentTeethRenderObject, PictureElement, PictureFactory, PictureProps, PictureRenderObject, RadioBoxElement, RadioBoxFactory, RadioBoxProps, RadioBoxRenderObject, RangeUtil, Rect, RenderContext, RenderObject, RenderObjectType, ResizeLeafRenderObject, RowMinHeight, RunElementFactory, SVGElement, SVGFactory, SVGProps, SVGRenderObject, SelectionOverlays, SelectionRange, SelectionState, Subject, SubjectSubscription, Subscription, TEXT_HEIGHT_FACTOR, TabElement, TabFactory, TabRenderObject, TableCellElement, TableCellFactory, TableCellProps, TableCellRenderObject, TableElement, TableFactory, TableProps, TableRenderObject, TableRowElement, TableRowFactory, TableRowProps, TableRowRenderObject, TableSplitCell, TableUtil, TextGroupElement, TextGroupFactory, TextGroupRenderObject, TextProps, TextUnitsHolder, TrackRunElement, TrackRunProps, TrackRunRenderObject, TrackRunTypeEnum, ValidateCondition, ValidateElement, ValidateProps, ValidateRenderObject, ViewOptions, addReturn, clearChildrenRenderCache, clearTraces, cloneChildren, cloneElementBase, defaultParaHanging, deleteCurrentParagraph, docOpsMap, elementTypeEventHandler, exportDataEleDecoratorSVG$1 as exportDataEleDecoratorSVG, falseChar, fontMapFunc, formatEle, fromEvent, generatePatch, getCalleeName, getCurrentParaGroupRenders, getFocusTextSegment, getRenderPosToDoc, inputText, insertEle, invokeTypeHandler, isDate, logUpdateEleProps, objectToString$4 as objectToString, onTableContextmenu, onceTask, parser, reactiveMap, refreshEditor, removeEle, removeText, renderErrorTip, renderUnderWavyLine, renderUnderline, runTextLineRender, setChildrenModifyFlag, setNotifyChangedCallback, setTraceTrackingFlag, suppressTracking, targetMaps, textLineRenderMode, toRawType, toTypeString, trueChar, validateDataEle, validateDataEleRenderObj, validateDataGroup, validateInlineInputRenderObj, watchChanged };
         | 
| 28105 28219 | 
             
            //# sourceMappingURL=index.js.map
         |