@agile_jy/word-editor 0.0.1-beta.3 → 0.0.1-beta.31

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.
@@ -1,6 +1,6 @@
1
- (function(){"use strict";try{if(typeof document!="undefined"){var e=document.createElement("style");e.id="canvas-editor-style",e.appendChild(document.createTextNode('.ce-select-control-popup{max-width:160px;min-width:69px;max-height:225px;position:absolute;z-index:1;border:1px solid #e4e7ed;border-radius:4px;background-color:#fff;box-shadow:0 2px 12px #0000001a;box-sizing:border-box;margin:5px 0;overflow-y:auto}.ce-select-control-popup ul{list-style:none;padding:3px 0;margin:0;box-sizing:border-box}.ce-select-control-popup ul li{font-size:13px;padding:0 20px;position:relative;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;color:#666;height:36px;line-height:36px;box-sizing:border-box;cursor:pointer}.ce-select-control-popup ul li:hover{background-color:#eef2fd}.ce-select-control-popup ul li.active{color:var(--COLOR-HOVER, #5175f4);font-weight:700}.ce-calculator{position:absolute;z-index:1;border:1px solid #e4e7ed;border-radius:4px;background-color:#fff;box-shadow:0 2px 12px #0000001a;box-sizing:border-box;margin:5px 0;padding:8px;width:200px}.ce-calculator-display{width:100%;height:40px;line-height:40px;text-align:right;padding:0 10px;margin-bottom:8px;border:1px solid #e4e7ed;border-radius:4px;background-color:#f5f7fa;font-size:16px;box-sizing:border-box;overflow:hidden;text-overflow:ellipsis}.ce-calculator-buttons{display:grid;grid-template-columns:repeat(4,1fr);gap:4px}.ce-calculator-button{width:100%;height:36px;border:1px solid #e4e7ed;border-radius:4px;background-color:#fff;font-size:14px;cursor:pointer;transition:all .2s;box-sizing:border-box}.ce-calculator-button:hover{background-color:#eef2fd;border-color:#c6d1ff}.ce-calculator-button:active{background-color:#e1e8ff}.ce-calculator-button.operator{background-color:#f5f7fa}.ce-calculator-button.operator:hover{background-color:#eef2fd}.ce-calculator-button.equal{background-color:var(--COLOR-HOVER, #5175f4);color:#fff;border-color:var(--COLOR-HOVER, #5175f4)}.ce-calculator-button.equal:hover{background-color:var(--COLOR-HOVER, #6a84ff);border-color:var(--COLOR-HOVER, #6a84ff)}.ce-calculator-button.utility{background-color:#f0f2f5}.ce-calculator-button.utility:hover{background-color:#e6e8eb}.ce-date-container{display:none;width:300px;overflow:hidden;left:0;right:0;position:absolute;z-index:1;color:#606266;background:#ffffff;border-radius:4px;padding:10px;user-select:none;border:1px solid #e4e7ed;box-shadow:0 2px 12px #0000001a}.ce-date-container.active{display:block}.ce-date-wrap{display:none}.ce-date-wrap.active{display:block}.ce-date-title{display:flex;justify-content:center;align-items:center;text-align:center;color:#606266;font-size:16px}.ce-date-title>span{display:inline-block}.ce-date-title>span:not(.ce-date-title__now){font-family:cursive;cursor:pointer}.ce-date-title>span:not(.ce-date-title__now):hover{color:#5175f4}.ce-date-title .ce-date-title__pre-year,.ce-date-title .ce-date-title__pre-month{width:15%}.ce-date-title .ce-date-title__now{width:40%}.ce-date-title .ce-date-title__next-year,.ce-date-title .ce-date-title__next-month{width:15%}.ce-date-week{width:100%;display:flex;justify-content:center;margin-top:15px;padding-bottom:5px;border-bottom:1px solid #e4e7ed}.ce-date-week>span{list-style:none;width:calc(100%/7);text-align:center;color:#606266;font-size:14px}.ce-date-day{width:100%;display:flex;flex-wrap:wrap;align-items:center;margin-top:5px}.ce-date-day>div{width:calc(100%/7);height:40px;text-align:center;color:#606266;font-size:14px;cursor:pointer;line-height:40px;border-radius:4px}.ce-date-day>div:hover{color:#5175f4;opacity:.8}.ce-date-day>div.active{color:#5175f4;font-weight:700}.ce-date-day>div.disable{color:#c0c4cc}.ce-date-day>div.select{color:#fff;background-color:#5175f4}.ce-time-wrap{display:none;padding:10px;height:286px}.ce-time-wrap ::-webkit-scrollbar{width:0}.ce-time-wrap.active{display:flex}.ce-time-wrap li{list-style:none}.ce-time-wrap>li{width:33.3%;height:100%;text-align:center}.ce-time-wrap>li>span{transform:translateY(-5px);display:inline-block}.ce-time-wrap>li>ol{height:calc(100% - 20px);overflow-y:auto;border:1px solid #e2e2e2;position:relative}.ce-time-wrap>li:first-child>ol{border-right:0}.ce-time-wrap>li:last-child>ol{border-left:0}.ce-time-wrap>li>ol>li{line-height:30px;cursor:pointer;transition:all .3s}.ce-time-wrap>li>ol>li:hover{background-color:#eaeaea}.ce-time-wrap>li>ol>li.active{color:#fff;background:#5175F4}.ce-date-menu{width:100%;height:28px;display:flex;justify-content:flex-end;align-items:center;padding-top:10px;position:relative;border-top:1px solid #e4e7ed}.ce-date-menu button{display:inline-block;line-height:1;white-space:nowrap;cursor:pointer;background:#fff;border:1px solid #dcdfe6;color:#606266;appearance:none;text-align:center;box-sizing:border-box;outline:none;transition:.1s;font-weight:500;user-select:none;padding:7px 15px;font-size:12px;border-radius:3px;margin:0 0 0 10px}.ce-date-menu button:hover{color:#5175f4;border-color:#5175f4}.ce-date-menu button.ce-date-menu__time{border:1px solid transparent;position:absolute;left:0;margin-left:0}.ce-date-menu button.ce-date-menu__time:hover{color:#5175f4}.ce-block-item{position:absolute;z-index:0;background-color:#fff;border:1px solid rgb(235 236 240)}.ce-block-item .ce-resizer-selection{width:100%;height:100%}.ce-block-item .ce-resizer-mask{position:absolute;top:0;bottom:0;left:0;right:0;z-index:1;background-color:transparent}.ce-table-tool__row{position:absolute;width:12px;border-radius:6.5px;overflow:hidden;background-color:#e2e6ed}.ce-table-tool__row .ce-table-tool__row__item{width:100%;position:relative;cursor:pointer;transition:all .3s}.ce-table-tool__row .ce-table-tool__row__item:after{content:"";position:absolute;bottom:0;left:2px;width:8px;height:1px;background-color:#c0c6cf}.ce-table-tool__row .ce-table-tool__row__item:hover{background-color:#dadce0}.ce-table-tool__row .ce-table-tool__row__item:last-child:after{display:none}.ce-table-tool__quick__add{width:16px;height:16px;position:absolute;border-radius:50%;background-color:#e2e6ed;cursor:pointer}.ce-table-tool__quick__add:after{content:"+";color:#fff;position:absolute;top:50%;left:50%;transform:translate(-50%,-55%)}.ce-table-tool__select{width:16px;height:18px;position:absolute;border-radius:3px;cursor:pointer}.ce-table-tool__select:hover{background-color:#e2e6ed}.ce-table-tool__select:after{content:":::";color:#aaaaab;position:absolute;top:50%;left:50%;transform:translate(-75%,-50%) rotate(-90deg)}.ce-table-tool__col{position:absolute;height:12px;border-radius:6.5px;overflow:hidden;background-color:#e2e6ed;display:flex}.ce-table-tool__col .ce-table-tool__col__item{height:100%;position:relative;cursor:pointer;transition:all .3s}.ce-table-tool__col .ce-table-tool__col__item:after{content:"";position:absolute;top:2px;left:-1px;width:1px;height:8px;z-index:1;background-color:#c0c6cf}.ce-table-tool__col .ce-table-tool__col__item:hover{background-color:#dadce0}.ce-table-tool__col .ce-table-tool__col__item:first-child:after{display:none}.ce-table-tool__row .ce-table-tool__row__item.active,.ce-table-tool__col .ce-table-tool__col__item.active{background-color:#c4d7fa}.ce-table-tool__col .ce-table-tool__anchor{right:-5px;width:10px;height:12px;z-index:9;position:absolute;cursor:col-resize}.ce-table-tool__row .ce-table-tool__anchor{bottom:-5px;left:0;width:12px;height:10px;z-index:9;position:absolute;cursor:row-resize}.ce-table-anchor__line{z-index:9;position:absolute;border:1px dotted #000000}.ce-table-tool__border{position:absolute;z-index:1;background:transparent;pointer-events:none}.ce-table-tool__border__row{position:absolute;cursor:row-resize;pointer-events:auto}.ce-table-tool__border__col{position:absolute;cursor:col-resize;pointer-events:auto}.ce-resizer-selection{position:absolute;border:1px solid;pointer-events:none}.ce-resizer-selection .resizer-handle{position:absolute;z-index:9;width:10px;height:10px;box-shadow:0 1px 4px #0000004d;border-radius:5px;border:2px solid #ffffff;box-sizing:border-box;pointer-events:initial}.ce-resizer-selection .handle-0{cursor:nw-resize}.ce-resizer-selection .handle-1{cursor:n-resize}.ce-resizer-selection .handle-2{cursor:ne-resize}.ce-resizer-selection .handle-3{cursor:e-resize}.ce-resizer-selection .handle-4{cursor:se-resize}.ce-resizer-selection .handle-5{cursor:s-resize}.ce-resizer-selection .handle-6{cursor:sw-resize}.ce-resizer-selection .handle-7{cursor:w-resize}.ce-resizer-size-view{display:flex;align-items:center;height:20px;white-space:nowrap;position:absolute;z-index:9;top:-30px;left:0;opacity:.9;background-color:#000;padding:0 5px;border-radius:4px}.ce-resizer-size-view span{color:#fff;font-size:12px}.ce-resizer-image{position:absolute;opacity:.5}.ce-image-previewer{position:fixed;left:0;top:0;z-index:1000;width:100%;height:100%;overflow:hidden;background:#f2f4f7;display:flex;align-items:center;justify-content:center;animation:previewerAnimation .3s}@keyframes previewerAnimation{0%{opacity:.1}to{opacity:1}}.ce-image-previewer .image-close{width:24px;height:24px;display:inline-block;position:absolute;right:50px;top:30px;z-index:99;cursor:pointer;background:url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMzIiIGhlaWdodD0iMzIiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTIzLjk3IDdsMS40MTUgMS40MTQtNy43NzkgNy43NzggNy43NzkgNy43NzktMS40MTQgMS40MTQtNy43NzktNy43NzktNy43NzggNy43NzlMNyAyMy45N2w3Ljc3OC03Ljc3OUw3IDguNDE0IDguNDE0IDdsNy43NzggNy43NzhMMjMuOTcxIDd6IiBmaWxsPSIjM0Q0NzU3IiBmaWxsLXJ1bGU9ImV2ZW5vZGQiLz48L3N2Zz4=) no-repeat;background-size:100% 100%;transition:all .3s;border-radius:50%}.ce-image-previewer .image-close:hover{background-color:#e2e6ed}.ce-image-previewer .ce-image-container{position:relative}.ce-image-previewer .ce-image-container img{cursor:move;position:relative}.ce-image-previewer .ce-image-menu{height:50px;position:absolute;bottom:50px;z-index:99;display:flex;align-items:center;justify-content:center}.ce-image-previewer .ce-image-menu i{width:32px;height:32px;margin:0 8px;cursor:pointer;display:inline-block;background-repeat:no-repeat;background-size:100% 100%;transition:all .3s;border-radius:50%}.ce-image-previewer .ce-image-menu i:hover{background-color:#e2e6ed}.ce-image-previewer .ce-image-menu i.zoom-in{background-image:url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMzIiIGhlaWdodD0iMzIiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTE0IDE0di00aDJ2NGg0djJoLTR2NGgtMnYtNGgtNHYtMmg0em04Ljc0OSAxMC4xNjNBMTEuOTUyIDExLjk1MiAwIDAxMTUgMjdDOC4zNzMgMjcgMyAyMS42MjcgMyAxNVM4LjM3MyAzIDE1IDNzMTIgNS4zNzMgMTIgMTJjMCAyLjk1NC0xLjA2NyA1LjY1OC0yLjgzNyA3Ljc0OWw0LjkwOCA0LjkwOC0xLjQxNCAxLjQxNC00LjkwOC00LjkwOHpNMTUgMjVjNS41MjMgMCAxMC00LjQ3NyAxMC0xMFMyMC41MjMgNSAxNSA1IDUgOS40NzcgNSAxNXM0LjQ3NyAxMCAxMCAxMHoiIGZpbGw9IiMzRDQ3NTciLz48L3N2Zz4=)}.ce-image-previewer .ce-image-menu i.zoom-out{background-image:url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMzIiIGhlaWdodD0iMzIiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTIyLjc0OSAyNC4xNjNBMTEuOTUyIDExLjk1MiAwIDAxMTUgMjdDOC4zNzMgMjcgMyAyMS42MjcgMyAxNVM4LjM3MyAzIDE1IDNzMTIgNS4zNzMgMTIgMTJjMCAyLjk1NC0xLjA2NyA1LjY1OC0yLjgzNyA3Ljc0OWw0LjkwOCA0LjkwOC0xLjQxNCAxLjQxNC00LjkwOC00LjkwOHpNMTUgMjVjNS41MjMgMCAxMC00LjQ3NyAxMC0xMFMyMC41MjMgNSAxNSA1IDUgOS40NzcgNSAxNXM0LjQ3NyAxMCAxMCAxMHptLTUtMTFoMTB2MkgxMHYtMnoiIGZpbGw9IiMzRDQ3NTciLz48L3N2Zz4=)}.ce-image-previewer .ce-image-menu i.rotate{background-image:url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMzIiIGhlaWdodD0iMzIiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGcgZmlsbD0iIzNENDc1NyIgZmlsbC1ydWxlPSJldmVub2RkIj48cGF0aCBkPSJNMTYgNGM2LjYyNyAwIDEyIDUuMzczIDEyIDEyYTExLjk3IDExLjk3IDAgMDEtNCA4Ljk0NFYyM2gtLjg2QTkuOTY4IDkuOTY4IDAgMDAyNiAxNmMwLTUuNTIzLTQuNDc3LTEwLTEwLTEwUzYgMTAuNDc3IDYgMTZjMCA1LjE4NSAzLjk0NyA5LjQ0OSA5IDkuOTV2Mi4wMDlDOC44NCAyNy40NTEgNCAyMi4yOTEgNCAxNiA0IDkuMzczIDkuMzczIDQgMTYgNHoiIGZpbGwtcnVsZT0ibm9uemVybyIvPjxwYXRoIGQ9Ik0xOS44NzkgMjcuMzI4bDEuNzY3LTYuNzE3IDQuOTUgNC45NXoiLz48L2c+PC9zdmc+)}.ce-image-previewer .ce-image-menu i.original-size{background-image:url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMzIiIGhlaWdodD0iMzIiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTQgNGgyNHYyNEg0VjR6bTIgMnYyMGgyMFY2SDZ6bTQgNWgydjEwaC0yVjExem01IDJoMnYyaC0ydi0yem0wIDRoMnYyaC0ydi0yem01LTZoMnYxMGgtMlYxMXoiIGZpbGw9IiMzRDQ3NTciLz48L3N2Zz4=)}.ce-image-previewer .ce-image-menu i.image-download{background-image:url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjQiIGhlaWdodD0iMjQiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTQuNSAxNXYzLjVoMTVWMTVIMjF2NUgzdi01aDEuNXptOC4yMzItMTEuMjI2djkuMTk2bDQuMDUtNC4wNSAxLjA2IDEuMDYtNS44MzQgNS44MzQtNS44MzMtNS44MzMgMS4wNi0xLjA2IDMuOTk4IDMuOTk2VjMuNzc0aDEuNXoiIGZpbGw9IiMzRDQ3NTciLz48L3N2Zz4=)}.ce-image-previewer .ce-image-menu .image-navigate{display:flex;align-items:center;justify-content:center}.ce-image-previewer .ce-image-menu i.image-pre{background-image:url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjAiIGhlaWdodD0iMjAiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTEyLjUgNC4wNjNMNi44NzUgMTBsNS42MjUgNS45MzgiIHN0cm9rZT0iIzNENDc1NyIgc3Ryb2tlLXdpZHRoPSIxLjUiIHN0cm9rZS1saW5lY2FwPSJyb3VuZCIgc3Ryb2tlLWxpbmVqb2luPSJyb3VuZCIvPjwvc3ZnPg==)}.ce-image-previewer .ce-image-menu i.image-next{background-image:url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjAiIGhlaWdodD0iMjAiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTcuNSA0LjA2M0wxMy4xMjUgMTAgNy41IDE1LjkzOCIgc3Ryb2tlPSIjM0Q0NzU3IiBzdHJva2Utd2lkdGg9IjEuNSIgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIiBzdHJva2UtbGluZWpvaW49InJvdW5kIi8+PC9zdmc+)}.ce-image-previewer .ce-image-menu .image-count{color:#000;font-size:20px}.ce-image-previewer .ce-image-menu i.disabled{cursor:not-allowed;opacity:.5}.ce-contextmenu-container{z-index:9;position:fixed;display:none;padding:4px;overflow-x:hidden;overflow-y:auto;background:#fff;box-shadow:0 2px 12px #38383833;border:1px solid #e2e6ed;border-radius:2px}.ce-contextmenu-content{display:flex;flex-direction:column}.ce-contextmenu-content .ce-contextmenu-sub-item:after{position:absolute;content:"";width:16px;height:16px;right:12px;background:url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGcgZmlsbD0ibm9uZSIgZmlsbC1ydWxlPSJldmVub2RkIj48cGF0aCBkPSJNMCAwaDE2djE2SDB6Ii8+PGcgZmlsbD0iIzc2N0M4NSI+PHBhdGggZD0iTTcgMTIuMjQzbC0uNzA3LS43MDcgNC4yNDMtNC4yNDMuNzA3LjcwN3oiLz48cGF0aCBkPSJNNi4yOTMgNC40NjRMNyAzLjc1NyAxMS4yNDMgOGwtLjcwNy43MDd6Ii8+PC9nPjwvZz48L3N2Zz4=)}.ce-contextmenu-content .ce-contextmenu-item{min-width:140px;padding:0 32px 0 16px;height:30px;display:flex;align-items:center;white-space:nowrap;box-sizing:border-box;cursor:pointer}.ce-contextmenu-content .ce-contextmenu-item.hover{background:rgba(25,55,88,.04)}.ce-contextmenu-content .ce-contextmenu-item span{max-width:300px;font-size:12px;color:#3d4757;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.ce-contextmenu-content .ce-contextmenu-item span.ce-shortcut{color:#767c85;height:30px;flex:1;text-align:right;line-height:30px;margin-left:20px}.ce-contextmenu-content .ce-contextmenu-item i{width:16px;height:16px;vertical-align:middle;display:inline-block;background-repeat:no-repeat;background-size:100% 100%;flex-shrink:0;margin-right:8px}.ce-contextmenu-divider{background-color:#e2e6ed;margin:4px 16px;height:1px}.ce-contextmenu-print{background-image:url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIHZpZXdCb3g9IjAgMCAxNiAxNiIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48ZyBmaWxsPSIjM0Q0NzU3IiBmaWxsLXJ1bGU9ImV2ZW5vZGQiPjxwYXRoIGQ9Ik0xMiA0aC0xVjJINXYySDRWMmExIDEgMCAwMTEtMWg2YTEgMSAwIDAxMSAxdjJ6bTAgNXY0YTEg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i41LTMuNC0zIDMuMXoiLz48L2c+PC9nPjwvc3ZnPg==)}.ce-contextmenu-image-change{background-image:url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGcgZmlsbD0ibm9uZSIgZmlsbC1ydWxlPSJldmVub2RkIj48ZyB0cmFuc2Zvcm09InRyYW5zbGF0ZSgyIDQpIiBmaWxsPSIjM0Q0NzU3Ij48Y2lyY2xlIGZpbGwtcnVsZT0ibm9uemVybyIgY3g9IjMiIGN5PSIxIiByPSIxIi8+PHBhdGggZD0iTTcuNDczIDguMjIzTDMuNDcgNC4xMDcgMCA3LjY2N3YtMS41QzEuNzE1IDQuNiAyLjcwNyAzLjY2NCAyLjk3NSAzLjM1OGMuNDAyLS40NTcuNjUxLS4zOSAxLjA0MiAwTDcuNDczIDcgOS45NiA0LjM0OWMuNDE0LS40NjIuNjItLjQ2MiAxLjAxMS0uMDcxTDEzIDcuMDZ2MS41bC0yLjUxLTMuNDEtMy4wMTcgMy4wNzJ6Ii8+PC9nPjxwYXRoIGQ9Ik02IDEuNUgxLjV2MTJoMTN2LTRWMTNhLjUuNSAwIDAxLS41LjVIMmEuNS41IDAgMDEtLjUtLjVWMmEuNS41IDAgMDEuNS0uNWg0em04LjUgOFY2bC0uNS41aDFsLS41LS41djMuNXpNNiAxLjVoNEw5LjUgMXYxbC41LS41SDZ6IiBzdHJva2U9IiMzRDQ3NTciLz48cGF0aCBkPSJNMTMuMDg1IDEuMzE2bC0zLjgxNCA0YTEgMSAwIDAwMS40NTggMS4zNjhsMy44MTUtNGExIDEgMCAxMC0xLjQ1OS0xLjM2OHoiIGZpbGw9IiMzRDQ3NTciIGZpbGwtcnVsZT0ibm9uemVybyIvPjwvZz48L3N2Zz4=)}.ce-contextmenu-insert-row-col{background-image:url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGcgZmlsbD0ibm9uZSIgZmlsbC1ydWxlPSJldmVub2RkIj48cGF0aCBzdHJva2U9IiMzRDQ3NTciIGQ9Ik04LjUgNS41aDZ2NGgtNnoiLz48cGF0aCBmaWxsPSIjM0Q0NzU3IiBkPSJNNCA3djFoMlY3em0tMyAuNUw0IDV2NXpNMSAxaDEydjFIMXptMCAxMmgxMnYxSDF6Ii8+PC9nPjwvc3ZnPg==)}.ce-contextmenu-insert-top-row{background-image:url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGcgZmlsbD0ibm9uZSIgZmlsbC1ydWxlPSJldmVub2RkIj48cGF0aCBmaWxsPSIjM0Q0NzU3IiBkPSJNOCA1SDd2M2gxem0tLjUtM0wxMCA1SDV6Ii8+PHJlY3Qgc3Ryb2tlPSIjM0Q0NzU3IiB4PSIxLjUiIHk9IjEwLjUiIHdpZHRoPSIxMiIgaGVpZ2h0PSIzIiByeD0iMSIvPjwvZz48L3N2Zz4=)}.ce-contextmenu-insert-bottom-row{background-image:url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGcgZmlsbD0ibm9uZSIgZmlsbC1ydWxlPSJldmVub2RkIj48cGF0aCBmaWxsPSIjM0Q0NzU3IiBkPSJNNyAxMWgxVjhIN3ptLjUgM0w1IDExaDV6Ii8+PHJlY3Qgc3Ryb2tlPSIjM0Q0NzU3IiB4PSIxLjUiIHk9IjIuNSIgd2lkdGg9IjEyIiBoZWlnaHQ9IjMiIHJ4PSIxIi8+PC9nPjwvc3ZnPg==)}.ce-contextmenu-insert-left-col{background-image:url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhl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dGggZmlsbD0iIzNENDc1NyIgZD0iTTIgOS4zNjNMNi4zNTUgNSA3IDUuNzA3IDIuNjk1IDEweiIvPjwvZz48L3N2Zz4=)}.ce-contextmenu-delete-row{background-image:url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGcgZmlsbD0ibm9uZSIgZmlsbC1ydWxlPSJldmVub2RkIj48cGF0aCBzdHJva2U9IiM5MjlBQTgiIGQ9Ik04LjUgNS41aDZ2NGgtNnoiLz48cGF0aCBmaWxsPSIjM0Q0NzU3IiBkPSJNMSAxM2gxMnYxSDF6TTEgMWgxMnYxSDF6bTAgNGgxdjFIMXptMSAxaDF2MUgyem0xIDFoMXYxSDN6bTEtMWgxdjFINHptMS0xaDF2MUg1ek00IDhoMXYxSDR6TTIgOGgxdjFIMnptMyAxaDF2MUg1ek0xIDloMXYxSDF6Ii8+PC9nPjwvc3ZnPg==)}.ce-contextmenu-delete-col{background-image:url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGcgZmlsbD0ibm9uZSIgZmlsbC1ydWxlPSJldmVub2RkIj48cGF0aCBzdHJva2U9IiM5MjlBQTgiIGQ9Ik01LjUgNy41di02aDR2NnoiLz48cGF0aCBmaWxsPSIjM0Q0NzU3IiBkPSJNMTMgMTVWM2gxdjEyek0xIDE1VjNoMXYxMnptNCAwdi0xaDF2MXptMS0xdi0xaDF2MXptMS0xdi0xaDF2MXptLTEtMXYtMWgxdjF6bS0xLTF2LTFoMXYxem0zIDF2LTFoMXYxem0wIDJ2LTFoMXYxem0xLTN2LTFoMXYxem0wIDR2LTFoMXYxeiIvPjwvZz48L3N2Zz4=)}.ce-contextmenu-delete-table{background-image:url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGcgZmlsbD0iIzNENDc1NyIgZmlsbC1ydWxlPSJldmVub2RkIj48cGF0aCBkPSJNMTQgMTNoLTF2LTNIMnYzSDF2LTNhMSAxIDAgMDExLTFoMTFhMSAxIDAgMDExIDF2M3oiIGZpbGwtcnVsZT0ibm9uemVybyIvPjxwYXRoIGQ9Ik01LjYyNSAyTDEwIDYuMzc1IDkuMzc1IDcgNSAyLjYyNXoiLz48cGF0aCBkPSJNNSA2LjM3NUw5LjM3NSAybC42MjUuNjI1TDUuNjI1IDd6Ii8+PC9nPjwvc3ZnPg==)}.ce-contextmenu-merge-cell{background-image:url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGcgZmlsbD0iIzNENDc1NyIgZmlsbC1ydWxlPSJldmVub2RkIj48cGF0aCBkPSJNNiAxdjFIMnYxMWg0djFIMmExIDEgMCAwMS0xLTFWMmExIDEgMCAwMTEtMWg0em0zIDBoNGExIDEgMCAwMTEgMXYxMWExIDEgMCAwMS0xIDFIOXYtMWg0VjJIOVYxeiIvPjxwYXRoIGZpbGwtcnVsZT0ibm9uemVybyIgZD0iTTYgMWgxdjRINnptMiAwaDF2NEg4eiIvPjxwYXRoIGQ9Ik04IDcuNUwxMCA2djN6bS0xIDBMNSA2djN6Ii8+PHBhdGggZD0iTTkgN2gzdjFIOXpNMyA3aDN2MUgzeiIvPjxwYXRoIGZpbGwtcnVsZT0ibm9uemVybyIgZD0iTTggMTBoMXY0SDh6bS0yIDBoMXY0SDZ6Ii8+PC9nPjwvc3ZnPg==)}.ce-contextmenu-merge-cancel-cell{background-image:url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGcgZmlsbD0iIzNENDc1NyIgZmlsbC1ydWxlPSJldmVub2RkIj48cGF0aCBkPSJNNiAxdjFIMnYxMWg0djFIMmExIDEgMCAwMS0xLTFWMmExIDEgMCAwMTEtMWg0em0zIDBoNGExIDEgMCAwMTEgMXYxMWExIDEgMCAwMS0xIDFIOXYtMWg0VjJIOVYxeiIvPjxwYXRoIGZpbGwtcnVsZT0ibm9uemVybyIgZD0iTTYgMWgxdjRINnptMiAwaDF2NEg4eiIvPjxwYXRoIGQ9Ik0zIDcuNUw1IDZ2M3ptOSAwTDEwIDZ2M3oiLz48cGF0aCBkPSJNNCA3aDN2MUg0em00IDBoM3YxSDh6Ii8+PHBhdGggZmlsbC1ydWxlPSJub256ZXJvIiBkPSJNOCAxMGgxdjRIOHptLTIgMGgxdjRINnoiLz48L2c+PC9zdmc+)}.ce-contextmenu-vertical-align{background-image:url(data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjE2IiB2aWV3Qm94PSIwIDAgMTYgMTYiIHdpZHRoPSIxNiIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cGF0aCBkPSJNMiAxM2gxMnYxSDJ6bTAtM2g4djFIMnptMC0zaDEydjFIMnptMC02aDEydjFIMnptMCAzaDh2MUgyeiIgZmlsbD0iIzNkNDc1NyIgZmlsbC1ydWxlPSJldmVub2RkIi8+PC9zdmc+)}.ce-contextmenu-vertical-align-top{background-image:url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTggOEg3djZoMXptLS41LTNMMTAgOEg1ek0yIDNoMTF2MUgyeiIgZmlsbD0iIzNENDc1NyIgZmlsbC1ydWxlPSJldmVub2RkIi8+PC9zdmc+)}.ce-contextmenu-vertical-align-middle{background-image:url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIHZpZXdCb3g9IjAgMCAxNiAxNiIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cGF0aCBkPSJNOCAxMkg3djNoMXptLS41LTNsMi41IDNINXpNNyAzaDFWMEg3em0uNSAzTDUgM2g1ek0yIDdoMTF2MUgyeiIgZmlsbD0iIzNENDc1NyIgZmlsbC1ydWxlPSJldmVub2RkIi8+PC9zdmc+)}.ce-contextmenu-vertical-align-bottom{background-image:url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTcgOWgxVjNIN3ptLjUgM0w1IDloNXpNMiAxM2gxMXYxSDJ6IiBmaWxsPSIjM0Q0NzU3IiBmaWxsLXJ1bGU9ImV2ZW5vZGQiLz48L3N2Zz4=)}.ce-contextmenu-border-all{background-image:url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTIuNSAzYS41LjUgMCAwMS41LS41aDExYS41LjUgMCAwMS41LjV2MTFhLjUuNSAwIDAxLS41LjVIM2EuNS41IDAgMDEtLjUtLjVWM3oiIHN0cm9rZT0iIzNENDc1NyIvPjxwYXRoIGZpbGw9IiMzRDQ3NTciIGQ9Ik0zIDhoMTF2MUgzeiIvPjxwYXRoIGZpbGw9IiMzRDQ3NTciIGQ9Ik05IDN2MTFIOFYzeiIvPjwvc3ZnPg==)}.ce-contextmenu-border-empty{background-image:url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZmlsbC1ydWxlPSJldmVub2R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(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTIuNSAzYS41LjUgMCAwMS41LS41aDExYS41LjUgMCAwMS41LjV2MTFhLjUuNSAwIDAxLS41LjVIM2EuNS41IDAgMDEtLjUtLjVWM3oiIHN0cm9rZT0iIzNENDc1NyIvPjxwYXRoIGZpbGwtcnVsZT0iZXZlbm9kZCIgY2xpcC1ydWxlPSJldmVub2RkIiBkPSJNOSA1VjNIOHYyaDF6bTAgOXYtMkg4djJoMXpNNSA4SDN2MWgyVjh6bTkgMGgtMnYxaDJWOHpNOSA3djFoMXYxSDl2MUg4VjlIN1Y4aDFWN2gxeiIgZmlsbD0iI0FBQUNCMCIvPjwvc3ZnPg==)}.ce-contextmenu-border-internal{background-image:url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTIuNSAzYS41LjUgMCAwMS41LS41aDExYS41LjUgMCAwMS41LjV2MTFhLjUuNSAwIDAxLS41LjVIM2EuNS41IDAgMDEtLjUtLjVWM3oiIHN0cm9rZT0iI0FBQUNCMCIvPjxwYXRoIGZpbGwtcnVsZT0iZXZlbm9kZCIgY2xpcC1ydWxlPSJldmVub2RkIiBkPSJNOSA1VjNIOHYyaDF6bTAgOXYtMkg4djJoMXpNNSA4SDN2MWgyVjh6bTkgMGgtMnYxaDJWOHpNOSA3djFoMXYxSDl2MUg4VjlIN1Y4aDFWN2gxeiIgZmlsbD0iIzNENDc1NyIvPjwvc3ZnPg==)}.ce-contextmenu-border-td{background-image:url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTIuNSAzYS41LjUgMCAwMS41LS41aDExYS41LjUgMCAwMS41LjV2MTFhLjUuNSAwIDAxLS41LjVIM2EuNS41IDAgMDEtLjUtLjVWM3oiIHN0cm9rZT0iI0FBQUNCMCIvPjxwYXRoIHN0cm9rZT0iIzNENDc1NyIgZD0iTTguNSAyLjUgdjYgaC02Ii8+PC9zdmc+)}.ce-contextmenu-border-td-top{background-image:url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTIuNSAzYS41LjUgMCAwMS41LS41aDExYS41LjUgMCAwMS41LjV2MTFhLjUuNSAwIDAxLS41LjVIM2EuNS41IDAgMDEtLjUtLjVWM3oiIHN0cm9rZT0iI0FBQUNCMCIvPjxwYXRoIHN0cm9rZT0iIzNENDc1NyIgc3Ryb2tlLXdpZHRoPSIyIiBkPSJNMi41IDMgaDEyIi8+PC9zdmc+)}.ce-contextmenu-border-td-left{background-image:url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTIuNSAzYS41LjUgMCAwMS41LS41aDExYS41LjUgMCAwMS41LjV2MTFhLjUuNSAwIDAxLS41LjVIM2EuNS41IDAgMDEtLjUtLjVWM3oiIHN0cm9rZT0iI0FBQUNCMCIvPjxwYXRoIHN0cm9rZT0iIzNENDc1NyIgc3Ryb2tlLXdpZHRoPSIyIiBkPSJNMyAzIHYxMSIvPjwvc3ZnPg==)}.ce-contextmenu-border-td-bottom{background-image:url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTIuNSAzYS41LjUgMCAwMS41LS41aDExYS41LjUgMCAwMS41LjV2MTFhLjUuNSAwIDAxLS41LjVIM2EuNS41IDAgMDEtLjUtLjVWM3oiIHN0cm9rZT0iI0FBQUNCMCIvPjxwYXRoIHN0cm9rZT0iIzNENDc1NyIgc3Ryb2tlLXdpZHRoPSIyIiBkPSJNMi41IDE0IGgxMiIvPjwvc3ZnPg==)}.ce-contextmenu-border-td-right{background-image:url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTIuNSAzYS41LjUgMCAwMS41LS41aDExYS41LjUgMCAwMS41LjV2MTFhLjUuNSAwIDAxLS41LjVIM2EuNS41IDAgMDEtLjUtLjVWM3oiIHN0cm9rZT0iI0FBQUNCMCIvPjxwYXRoIHN0cm9rZT0iIzNENDc1NyIgc3Ryb2tlLXdpZHRoPSIyIiBkPSJNMTQgMyB2MTEiLz48L3N2Zz4=)}.ce-contextmenu-border-td-forward{background-image:url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTIuNSAzYS41LjUgMCAwMS41LS41aDExYS41LjUgMCAwMS41LjV2MTFhLjUuNSAwIDAxLS41LjVIM2EuNS41IDAgMDEtLjUtLjVWM3oiIHN0cm9rZT0iI0FBQUNCMCIgLz48cGF0aCBzdHJva2U9IiMzRDQ3NTciIGQ9Ik0xNCAzIGwtMTEgMTEiIC8+PC9zdmc+)}.ce-contextmenu-border-td-back{background-image:url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTIuNSAzYS41LjUgMCAwMS41LS41aDExYS41LjUgMCAwMS41LjV2MTFhLjUuNSAwIDAxLS41LjVIM2EuNS41IDAgMDEtLjUtLjVWM3oiIHN0cm9rZT0iI0FBQUNCMCIgLz48cGF0aCBzdHJva2U9IiMzRDQ3NTciIGQ9Ik0zIDMgbDExIDExIiAvPjwvc3ZnPg==)}.ce-hyperlink-popup{background:#fff;box-shadow:0 2px 12px #626b8433;border-radius:2px;color:#3d4757;padding:12px 16px;position:absolute;z-index:1;text-align:center;display:none}.ce-hyperlink-popup a{min-width:100px;max-width:300px;font-size:12px;display:inline-block;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;cursor:pointer;text-decoration:none;border-bottom-width:1px;border-bottom-style:solid;color:#00f}.ce-zone-indicator>div{padding:3px 6px;color:#000;font-size:12px;background:rgb(218 231 252);position:absolute;transform-origin:0 0}.ce-zone-indicator-border__top,.ce-zone-indicator-border__bottom,.ce-zone-indicator-border__left,.ce-zone-indicator-border__right{display:block;position:absolute;z-index:0}.ce-zone-indicator-border__top{border-top:2px dashed rgb(238,238,238)}.ce-zone-indicator-border__bottom{border-top:2px dashed rgb(238,238,238);width:100%}.ce-zone-indicator-border__left{border-left:2px dashed rgb(238,238,238)}.ce-zone-indicator-border__right{border-right:2px dashed rgb(238,238,238)}.ce-zone-tip{display:none;align-items:center;height:30px;white-space:nowrap;position:fixed;opacity:.9;background-color:#000;padding:0 5px;border-radius:4px;z-index:9;transition:all .3s;outline:none;user-select:none;pointer-events:none;transform:translate(10px,10px)}.ce-zone-tip.show{display:flex}.ce-zone-tip span{color:#fff;font-size:12px}.ce-inputarea{width:100px;height:30px;min-width:0;min-height:0;margin:0;padding:0;left:0;top:0;letter-spacing:0;font-size:12px;position:absolute;z-index:-1;outline:none;resize:none;border:none;overflow:hidden;color:transparent;user-select:none;caret-color:transparent;background-color:transparent}.ce-cursor{width:1px;height:20px;left:0;right:0;position:absolute;outline:none;background-color:#000;pointer-events:none}.ce-cursor.ce-cursor--animation{animation-duration:1s;animation-iteration-count:infinite;animation-name:cursorAnimation}@keyframes cursorAnimation{0%{opacity:1}13%{opacity:0}50%{opacity:0}63%{opacity:1}to{opacity:1}}.ce-float-image{position:absolute;opacity:.5;pointer-events:none}.dialog-mask{position:fixed;left:0;top:0;width:100%;height:100%;opacity:.5;background:#000000;z-index:99}.dialog-container{position:fixed;top:0;right:0;bottom:0;left:0;overflow:auto;z-index:999;margin:0;display:flex;justify-content:center;align-items:center}.dialog{position:absolute;padding:0 30px 30px;background:#ffffff;box-shadow:0 2px 12px #38383833;border:1px solid #e2e6ed;border-radius:2px}.dialog-title{position:relative;border-bottom:1px solid #e2e6ed;margin-bottom:30px;height:60px;display:flex;align-items:center;justify-content:space-between}.dialog-title i{width:16px;height:16px;cursor:pointer;display:inline-block;background:url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIHZpZXdCb3g9IjAgMCAxNiAxNiIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cGF0aCBkPSJNOC45IDguMTkybDQuMjQyIDQuMjQzLS43MDcuNzA3TDguMTkyIDguOSAzLjk1IDEzLjE0MmwtLjcwNy0uNzA3IDQuMjQyLTQuMjQzTDMuMjQzIDMuOTVsLjcwNy0uNzA3IDQuMjQyIDQuMjQyIDQuMjQzLTQuMjQyLjcwNy43MDdMOC45IDguMTkyeiIgZmlsbD0iIzZBNkE2QSIgZmlsbC1ydWxlPSJldmVub2RkIi8+PC9zdmc+)}.dialog-option__item{margin-bottom:18px;display:flex;align-items:center;justify-content:space-between}.dialog-option__item span{margin-right:12px;font-size:14px;color:#3d4757;position:relative}.dialog-option__item input,.dialog-option__item textarea,.dialog-option__item select{width:276px;height:30px;border-radius:2px;border:1px solid #d3d3d3;min-height:30px;padding:5px;box-sizing:border-box;outline:none;appearance:none;user-select:none;font-family:inherit}.dialog-option__item input:focus,.dialog-option__item textarea:focus{border-color:#4991f2}.dialog-option__item--require:before{content:"*";color:#f56c6c;margin-right:4px;position:absolute;left:-8px}.dialog-menu{display:flex;align-items:center;justify-content:flex-end}.dialog-menu button{position:relative;display:inline-block;border:1px solid #e2e6ed;border-radius:2px;background:#ffffff;line-height:22px;padding:0 16px;white-space:nowrap;cursor:pointer}.dialog-menu button:hover{background:rgba(25,55,88,.04)}.dialog-menu__cancel{margin-right:16px}.dialog-menu button[type=submit]{color:#fff;background:#4991f2;border-color:#4991f2}.dialog-menu button[type=submit]:hover{background:#5b9cf3;border-color:#5b9cf3}')),document.head.appendChild(e)}}catch(i){console.error("vite-plugin-css-injected-by-js",i)}})();
1
+ (function(){"use strict";try{if(typeof document!="undefined"){var e=document.createElement("style");e.id="canvas-editor-style",e.appendChild(document.createTextNode('.ce-select-control-popup{max-width:160px;min-width:69px;max-height:225px;position:absolute;z-index:1;border:1px solid #e4e7ed;border-radius:4px;background-color:#fff;box-shadow:0 2px 12px #0000001a;box-sizing:border-box;margin:5px 0;overflow-y:auto}.ce-select-control-popup ul{list-style:none;padding:3px 0;margin:0;box-sizing:border-box}.ce-select-control-popup ul li{font-size:13px;padding:0 20px;position:relative;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;color:#666;height:36px;line-height:36px;box-sizing:border-box;cursor:pointer}.ce-select-control-popup ul li:hover{background-color:#eef2fd}.ce-select-control-popup ul li.active{color:var(--COLOR-HOVER, #5175f4);font-weight:700}.ce-calculator{position:absolute;z-index:1;border:1px solid #e4e7ed;border-radius:4px;background-color:#fff;box-shadow:0 2px 12px #0000001a;box-sizing:border-box;margin:5px 0;padding:8px;width:200px}.ce-calculator-display{width:100%;height:40px;line-height:40px;text-align:right;padding:0 10px;margin-bottom:8px;border:1px solid #e4e7ed;border-radius:4px;background-color:#f5f7fa;font-size:16px;box-sizing:border-box;overflow:hidden;text-overflow:ellipsis}.ce-calculator-buttons{display:grid;grid-template-columns:repeat(4,1fr);gap:4px}.ce-calculator-button{width:100%;height:36px;border:1px solid #e4e7ed;border-radius:4px;background-color:#fff;font-size:14px;cursor:pointer;transition:all .2s;box-sizing:border-box}.ce-calculator-button:hover{background-color:#eef2fd;border-color:#c6d1ff}.ce-calculator-button:active{background-color:#e1e8ff}.ce-calculator-button.operator{background-color:#f5f7fa}.ce-calculator-button.operator:hover{background-color:#eef2fd}.ce-calculator-button.equal{background-color:var(--COLOR-HOVER, #5175f4);color:#fff;border-color:var(--COLOR-HOVER, #5175f4)}.ce-calculator-button.equal:hover{background-color:var(--COLOR-HOVER, #6a84ff);border-color:var(--COLOR-HOVER, #6a84ff)}.ce-calculator-button.utility{background-color:#f0f2f5}.ce-calculator-button.utility:hover{background-color:#e6e8eb}.ce-date-container{display:none;width:300px;overflow:hidden;left:0;right:0;position:absolute;z-index:1;color:#606266;background:#ffffff;border-radius:4px;padding:10px;user-select:none;border:1px solid #e4e7ed;box-shadow:0 2px 12px #0000001a}.ce-date-container.active{display:block}.ce-date-wrap{display:none}.ce-date-wrap.active{display:block}.ce-date-title{display:flex;justify-content:center;align-items:center;text-align:center;color:#606266;font-size:16px}.ce-date-title>span{display:inline-block}.ce-date-title>span:not(.ce-date-title__now){font-family:cursive;cursor:pointer}.ce-date-title>span:not(.ce-date-title__now):hover{color:#5175f4}.ce-date-title .ce-date-title__pre-year,.ce-date-title .ce-date-title__pre-month{width:15%}.ce-date-title .ce-date-title__now{width:40%}.ce-date-title .ce-date-title__next-year,.ce-date-title .ce-date-title__next-month{width:15%}.ce-date-week{width:100%;display:flex;justify-content:center;margin-top:15px;padding-bottom:5px;border-bottom:1px solid #e4e7ed}.ce-date-week>span{list-style:none;width:calc(100%/7);text-align:center;color:#606266;font-size:14px}.ce-date-day{width:100%;display:flex;flex-wrap:wrap;align-items:center;margin-top:5px}.ce-date-day>div{width:calc(100%/7);height:40px;text-align:center;color:#606266;font-size:14px;cursor:pointer;line-height:40px;border-radius:4px}.ce-date-day>div:hover{color:#5175f4;opacity:.8}.ce-date-day>div.active{color:#5175f4;font-weight:700}.ce-date-day>div.disable{color:#c0c4cc}.ce-date-day>div.select{color:#fff;background-color:#5175f4}.ce-time-wrap{display:none;padding:10px;height:286px}.ce-time-wrap ::-webkit-scrollbar{width:0}.ce-time-wrap.active{display:flex}.ce-time-wrap li{list-style:none}.ce-time-wrap>li{width:33.3%;height:100%;text-align:center}.ce-time-wrap>li>span{transform:translateY(-5px);display:inline-block}.ce-time-wrap>li>ol{height:calc(100% - 20px);overflow-y:auto;border:1px solid #e2e2e2;position:relative}.ce-time-wrap>li:first-child>ol{border-right:0}.ce-time-wrap>li:last-child>ol{border-left:0}.ce-time-wrap>li>ol>li{line-height:30px;cursor:pointer;transition:all .3s}.ce-time-wrap>li>ol>li:hover{background-color:#eaeaea}.ce-time-wrap>li>ol>li.active{color:#fff;background:#5175F4}.ce-date-menu{width:100%;height:28px;display:flex;justify-content:flex-end;align-items:center;padding-top:10px;position:relative;border-top:1px solid #e4e7ed}.ce-date-menu button{display:inline-block;line-height:1;white-space:nowrap;cursor:pointer;background:#fff;border:1px solid #dcdfe6;color:#606266;appearance:none;text-align:center;box-sizing:border-box;outline:none;transition:.1s;font-weight:500;user-select:none;padding:7px 15px;font-size:12px;border-radius:3px;margin:0 0 0 10px}.ce-date-menu button:hover{color:#5175f4;border-color:#5175f4}.ce-date-menu button.ce-date-menu__time{border:1px solid transparent;position:absolute;left:0;margin-left:0}.ce-date-menu button.ce-date-menu__time:hover{color:#5175f4}.ce-block-item{position:absolute;z-index:0;background-color:#fff;border:1px solid rgb(235 236 240)}.ce-block-item .ce-resizer-selection{width:100%;height:100%}.ce-block-item .ce-resizer-mask{position:absolute;top:0;bottom:0;left:0;right:0;z-index:1;background-color:transparent}.ce-table-tool__row{position:absolute;width:12px;border-radius:6.5px;overflow:hidden;background-color:#e2e6ed}.ce-table-tool__row .ce-table-tool__row__item{width:100%;position:relative;cursor:pointer;transition:all .3s}.ce-table-tool__row .ce-table-tool__row__item:after{content:"";position:absolute;bottom:0;left:2px;width:8px;height:1px;background-color:#c0c6cf}.ce-table-tool__row .ce-table-tool__row__item:hover{background-color:#dadce0}.ce-table-tool__row .ce-table-tool__row__item:last-child:after{display:none}.ce-table-tool__quick__add{width:16px;height:16px;position:absolute;border-radius:50%;background-color:#e2e6ed;cursor:pointer}.ce-table-tool__quick__add:after{content:"+";color:#fff;position:absolute;top:50%;left:50%;transform:translate(-50%,-55%)}.ce-table-tool__select{width:16px;height:18px;position:absolute;border-radius:3px;cursor:pointer}.ce-table-tool__select:hover{background-color:#e2e6ed}.ce-table-tool__select:after{content:":::";color:#aaaaab;position:absolute;top:50%;left:50%;transform:translate(-75%,-50%) rotate(-90deg)}.ce-table-tool__col{position:absolute;height:12px;border-radius:6.5px;overflow:hidden;background-color:#e2e6ed;display:flex}.ce-table-tool__col .ce-table-tool__col__item{height:100%;position:relative;cursor:pointer;transition:all .3s}.ce-table-tool__col .ce-table-tool__col__item:after{content:"";position:absolute;top:2px;left:-1px;width:1px;height:8px;z-index:1;background-color:#c0c6cf}.ce-table-tool__col .ce-table-tool__col__item:hover{background-color:#dadce0}.ce-table-tool__col .ce-table-tool__col__item:first-child:after{display:none}.ce-table-tool__row .ce-table-tool__row__item.active,.ce-table-tool__col .ce-table-tool__col__item.active{background-color:#c4d7fa}.ce-table-tool__col .ce-table-tool__anchor{right:-5px;width:10px;height:12px;z-index:9;position:absolute;cursor:col-resize}.ce-table-tool__row .ce-table-tool__anchor{bottom:-5px;left:0;width:12px;height:10px;z-index:9;position:absolute;cursor:row-resize}.ce-table-anchor__line{z-index:9;position:absolute;border:1px dotted #000000}.ce-table-tool__border{position:absolute;z-index:1;background:transparent;pointer-events:none}.ce-table-tool__border__row{position:absolute;cursor:row-resize;pointer-events:auto}.ce-table-tool__border__col{position:absolute;cursor:col-resize;pointer-events:auto}.ce-resizer-selection{position:absolute;border:1px solid;pointer-events:none}.ce-resizer-selection .resizer-handle{position:absolute;z-index:9;width:10px;height:10px;box-shadow:0 1px 4px #0000004d;border-radius:5px;border:2px solid #ffffff;box-sizing:border-box;pointer-events:initial}.ce-resizer-selection .handle-0{cursor:nw-resize}.ce-resizer-selection .handle-1{cursor:n-resize}.ce-resizer-selection .handle-2{cursor:ne-resize}.ce-resizer-selection .handle-3{cursor:e-resize}.ce-resizer-selection .handle-4{cursor:se-resize}.ce-resizer-selection .handle-5{cursor:s-resize}.ce-resizer-selection .handle-6{cursor:sw-resize}.ce-resizer-selection .handle-7{cursor:w-resize}.ce-resizer-size-view{display:flex;align-items:center;height:20px;white-space:nowrap;position:absolute;z-index:9;top:-30px;left:0;opacity:.9;background-color:#000;padding:0 5px;border-radius:4px}.ce-resizer-size-view span{color:#fff;font-size:12px}.ce-resizer-image{position:absolute;opacity:.5}.ce-image-previewer{position:fixed;left:0;top:0;z-index:1000;width:100%;height:100%;overflow:hidden;background:#f2f4f7;display:flex;align-items:center;justify-content:center;animation:previewerAnimation .3s}@keyframes previewerAnimation{0%{opacity:.1}to{opacity:1}}.ce-image-previewer .image-close{width:24px;height:24px;display:inline-block;position:absolute;right:50px;top:30px;z-index:99;cursor:pointer;background:url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMzIiIGhlaWdodD0iMzIiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTIzLjk3IDdsMS40MTUgMS40MTQtNy43NzkgNy43NzggNy43NzkgNy43NzktMS40MTQgMS40MTQtNy43NzktNy43NzktNy43NzggNy43NzlMNyAyMy45N2w3Ljc3OC03Ljc3OUw3IDguNDE0IDguNDE0IDdsNy43NzggNy43NzhMMjMuOTcxIDd6IiBmaWxsPSIjM0Q0NzU3IiBmaWxsLXJ1bGU9ImV2ZW5vZGQiLz48L3N2Zz4=) no-repeat;background-size:100% 100%;transition:all .3s;border-radius:50%}.ce-image-previewer .image-close:hover{background-color:#e2e6ed}.ce-image-previewer .ce-image-container{position:relative}.ce-image-previewer .ce-image-container img{cursor:move;position:relative}.ce-image-previewer .ce-image-menu{height:50px;position:absolute;bottom:50px;z-index:99;display:flex;align-items:center;justify-content:center}.ce-image-previewer .ce-image-menu i{width:32px;height:32px;margin:0 8px;cursor:pointer;display:inline-block;background-repeat:no-repeat;background-size:100% 100%;transition:all .3s;border-radius:50%}.ce-image-previewer .ce-image-menu i:hover{background-color:#e2e6ed}.ce-image-previewer .ce-image-menu i.zoom-in{background-image:url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMzIiIGhlaWdodD0iMzIiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTE0IDE0di00aDJ2NGg0djJoLTR2NGgtMnYtNGgtNHYtMmg0em04Ljc0OSAxMC4xNjNBMTEuOTUyIDExLjk1MiAwIDAxMTUgMjdDOC4zNzMgMjcgMyAyMS42MjcgMyAxNVM4LjM3MyAzIDE1IDNzMTIgNS4zNzMgMTIgMTJjMCAyLjk1NC0xLjA2NyA1LjY1OC0yLjgzNyA3Ljc0OWw0LjkwOCA0LjkwOC0xLjQxNCAxLjQxNC00LjkwOC00LjkwOHpNMTUgMjVjNS41MjMgMCAxMC00LjQ3NyAxMC0xMFMyMC41MjMgNSAxNSA1IDUgOS40NzcgNSAxNXM0LjQ3NyAxMCAxMCAxMHoiIGZpbGw9IiMzRDQ3NTciLz48L3N2Zz4=)}.ce-image-previewer .ce-image-menu i.zoom-out{background-image:url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMzIiIGhlaWdodD0iMzIiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTIyLjc0OSAyNC4xNjNBMTEuOTUyIDExLjk1MiAwIDAxMTUgMjdDOC4zNzMgMjcgMyAyMS42MjcgMyAxNVM4LjM3MyAzIDE1IDNzMTIgNS4zNzMgMTIgMTJjMCAyLjk1NC0xLjA2NyA1LjY1OC0yLjgzNyA3Ljc0OWw0LjkwOCA0LjkwOC0xLjQxNCAxLjQxNC00LjkwOC00LjkwOHpNMTUgMjVjNS41MjMgMCAxMC00LjQ3NyAxMC0xMFMyMC41MjMgNSAxNSA1IDUgOS40NzcgNSAxNXM0LjQ3NyAxMCAxMCAxMHptLTUtMTFoMTB2MkgxMHYtMnoiIGZpbGw9IiMzRDQ3NTciLz48L3N2Zz4=)}.ce-image-previewer .ce-image-menu i.rotate{background-image:url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMzIiIGhlaWdodD0iMzIiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGcgZmlsbD0iIzNENDc1NyIgZmlsbC1ydWxlPSJldmVub2RkIj48cGF0aCBkPSJNMTYgNGM2LjYyNyAwIDEyIDUuMzczIDEyIDEyYTExLjk3IDExLjk3IDAgMDEtNCA4Ljk0NFYyM2gtLjg2QTkuOTY4IDkuOTY4IDAgMDAyNiAxNmMwLTUuNTIzLTQuNDc3LTEwLTEwLTEwUzYgMTAuNDc3IDYgMTZjMCA1LjE4NSAzLjk0NyA5LjQ0OSA5IDkuOTV2Mi4wMDlDOC44NCAyNy40NTEgNCAyMi4yOTEgNCAxNiA0IDkuMzczIDkuMzczIDQgMTYgNHoiIGZpbGwtcnVsZT0ibm9uemVybyIvPjxwYXRoIGQ9Ik0xOS44NzkgMjcuMzI4bDEuNzY3LTYuNzE3IDQuOTUgNC45NXoiLz48L2c+PC9zdmc+)}.ce-image-previewer .ce-image-menu i.original-size{background-image:url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMzIiIGhlaWdodD0iMzIiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTQgNGgyNHYyNEg0VjR6bTIgMnYyMGgyMFY2SDZ6bTQgNWgydjEwaC0yVjExem01IDJoMnYyaC0ydi0yem0wIDRoMnYyaC0ydi0yem01LTZoMnYxMGgtMlYxMXoiIGZpbGw9IiMzRDQ3NTciLz48L3N2Zz4=)}.ce-image-previewer .ce-image-menu i.image-download{background-image:url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjQiIGhlaWdodD0iMjQiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTQuNSAxNXYzLjVoMTVWMTVIMjF2NUgzdi01aDEuNXptOC4yMzItMTEuMjI2djkuMTk2bDQuMDUtNC4wNSAxLjA2IDEuMDYtNS44MzQgNS44MzQtNS44MzMtNS44MzMgMS4wNi0xLjA2IDMuOTk4IDMuOTk2VjMuNzc0aDEuNXoiIGZpbGw9IiMzRDQ3NTciLz48L3N2Zz4=)}.ce-image-previewer .ce-image-menu .image-navigate{display:flex;align-items:center;justify-content:center}.ce-image-previewer .ce-image-menu i.image-pre{background-image:url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjAiIGhlaWdodD0iMjAiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTEyLjUgNC4wNjNMNi44NzUgMTBsNS42MjUgNS45MzgiIHN0cm9rZT0iIzNENDc1NyIgc3Ryb2tlLXdpZHRoPSIxLjUiIHN0cm9rZS1saW5lY2FwPSJyb3VuZCIgc3Ryb2tlLWxpbmVqb2luPSJyb3VuZCIvPjwvc3ZnPg==)}.ce-image-previewer .ce-image-menu i.image-next{background-image:url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjAiIGhlaWdodD0iMjAiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTcuNSA0LjA2M0wxMy4xMjUgMTAgNy41IDE1LjkzOCIgc3Ryb2tlPSIjM0Q0NzU3IiBzdHJva2Utd2lkdGg9IjEuNSIgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIiBzdHJva2UtbGluZWpvaW49InJvdW5kIi8+PC9zdmc+)}.ce-image-previewer .ce-image-menu .image-count{color:#000;font-size:20px}.ce-image-previewer .ce-image-menu i.disabled{cursor:not-allowed;opacity:.5}.ce-contextmenu-container{z-index:9;position:fixed;display:none;padding:4px;overflow-x:hidden;overflow-y:auto;background:#fff;box-shadow:0 2px 12px #38383833;border:1px solid #e2e6ed;border-radius:2px}.ce-contextmenu-content{display:flex;flex-direction:column}.ce-contextmenu-content .ce-contextmenu-sub-item:after{position:absolute;content:"";width:16px;height:16px;right:12px;background:url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGcgZmlsbD0ibm9uZSIgZmlsbC1ydWxlPSJldmVub2RkIj48cGF0aCBkPSJNMCAwaDE2djE2SDB6Ii8+PGcgZmlsbD0iIzc2N0M4NSI+PHBhdGggZD0iTTcgMTIuMjQzbC0uNzA3LS43MDcgNC4yNDMtNC4yNDMuNzA3LjcwN3oiLz48cGF0aCBkPSJNNi4yOTMgNC40NjRMNyAzLjc1NyAxMS4yNDMgOGwtLjcwNy43MDd6Ii8+PC9nPjwvZz48L3N2Zz4=)}.ce-contextmenu-content .ce-contextmenu-item{min-width:140px;padding:0 32px 0 16px;height:30px;display:flex;align-items:center;white-space:nowrap;box-sizing:border-box;cursor:pointer}.ce-contextmenu-content .ce-contextmenu-item.hover{background:rgba(25,55,88,.04)}.ce-contextmenu-content .ce-contextmenu-item span{max-width:300px;font-size:12px;color:#3d4757;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.ce-contextmenu-content .ce-contextmenu-item span.ce-shortcut{color:#767c85;height:30px;flex:1;text-align:right;line-height:30px;margin-left:20px}.ce-contextmenu-content .ce-contextmenu-item i{width:16px;height:16px;vertical-align:middle;display:inline-block;background-repeat:no-repeat;background-size:100% 100%;flex-shrink:0;margin-right:8px}.ce-contextmenu-divider{background-color:#e2e6ed;margin:4px 16px;height:1px}.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xbC41LS41SDZ6IiBzdHJva2U9IiMzRDQ3NTciLz48cGF0aCBkPSJNMTMuMDg1IDEuMzE2bC0zLjgxNCA0YTEgMSAwIDAwMS40NTggMS4zNjhsMy44MTUtNGExIDEgMCAxMC0xLjQ1OS0xLjM2OHoiIGZpbGw9IiMzRDQ3NTciIGZpbGwtcnVsZT0ibm9uemVybyIvPjwvZz48L3N2Zz4=)}.ce-contextmenu-insert-row-col{background-image:url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGcgZmlsbD0ibm9uZSIgZmlsbC1ydWxlPSJldmVub2RkIj48cGF0aCBzdHJva2U9IiMzRDQ3NTciIGQ9Ik04LjUgNS41aDZ2NGgtNnoiLz48cGF0aCBmaWxsPSIjM0Q0NzU3IiBkPSJNNCA3djFoMlY3em0tMyAuNUw0IDV2NXpNMSAxaDEydjFIMXptMCAxMmgxMnYxSDF6Ii8+PC9nPjwvc3ZnPg==)}.ce-contextmenu-insert-top-row{background-image:url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGcgZmlsbD0ibm9uZSIgZmlsbC1ydWxlPSJldmVub2RkIj48cGF0aCBmaWxsPSIjM0Q0NzU3IiBkPSJNOCA1SDd2M2gxem0tLjUtM0wxMCA1SDV6Ii8+PHJlY3Qgc3Ryb2tlPSIjM0Q0NzU3IiB4PSIxLjUiIHk9IjEwLjUiIHdpZHRoPSIxMiIgaGVpZ2h0PSIzIiByeD0iMSIvPjwvZz48L3N2Zz4=)}.ce-contextmenu-insert-bottom-row{background-image:url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGcgZmlsbD0ibm9uZSIgZmlsbC1ydWxlPSJldmVub2RkIj48cGF0aCBmaWxsPSIjM0Q0NzU3IiBkPSJNNyAxMWgxVjhIN3ptLjUgM0w1IDExaDV6Ii8+PHJlY3Qgc3Ryb2tlPSIjM0Q0NzU3IiB4PSIxLjUiIHk9IjIuNSIgd2lkdGg9IjEyIiBoZWlnaHQ9IjMiIHJ4PSIxIi8+PC9nPjwvc3ZnPg==)}.ce-contextmenu-insert-left-col{background-image:url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGcgZmlsbD0ibm9uZSIgZmlsbC1ydWxlPSJldmVub2RkIj48cGF0aCBmaWxsPSIjM0Q0NzU3IiBkPSJNMTEgN3YxaDNWN3ptLTMgLjVMMTEgNXY1eiIvPjxyZWN0IHN0cm9rZT0iIzNENDc1NyIgdHJhbnNmb3JtPSJyb3RhdGUoOTAgNCA3LjUpIiB4PSItMiIgeT0iNiIgd2lkdGg9IjEyIiBoZWlnaHQ9IjMiIHJ4PSIxIi8+PC9nPjwvc3ZnPg==)}.ce-contextmenu-insert-right-col{background-image:url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGcgZmlsbD0ibm9uZSIgZmlsbC1ydWxlPSJldmVub2RkIj48cGF0aCBmaWxsPSIjM0Q0NzU3IiBkPSJNNSA4VjdIMnYxem0zLS41TDUgMTBWNXoiLz48cmVjdCBzdHJva2U9IiMzRDQ3NTciIHRyYW5zZm9ybT0icm90YXRlKDkwIDEyIDcuNSkiIHg9IjYiIHk9IjYiIHdpZHRoPSIxMiIgaGVpZ2h0PSIzIiByeD0iMSIvPjwvZz48L3N2Zz4=)}.ce-contextmenu-delete-row-col{background-image:url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGcgZmlsbD0ibm9uZSIgZmlsbC1ydWxlPSJldmVub2RkIj48cGF0aCBzdHJva2U9IiM5MjlBQTgiIGQ9Ik04LjUgNi41aDZ2MmgtNnoiLz48cGF0aCBmaWxsPSIjM0Q0NzU3IiBkPSJNMiAxMmgxMXYxSDJ6TTIgMmgxMXYxSDJ6bS42MyAzTDcgOS4zNWwtLjYzNS42NUwyIDUuNjN6Ii8+PHBhdGggZmlsbD0iIzNENDc1NyIgZD0iTTIgOS4zNjNMNi4zNTUgNSA3IDUuNzA3IDIuNjk1IDEweiIvPjwvZz48L3N2Zz4=)}.ce-contextmenu-delete-row{background-image:url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGcgZmlsbD0ibm9uZSIgZmlsbC1ydWxlPSJldmVub2RkIj48cGF0aCBzdHJva2U9IiM5MjlBQTgiIGQ9Ik04LjUgNS41aDZ2NGgtNnoiLz48cGF0aCBmaWxsPSIjM0Q0NzU3IiBkPSJNMSAxM2gxMnYxSDF6TTEgMWgxMnYxSDF6bTAgNGgxdjFIMXptMSAxaDF2MUgyem0xIDFoMXYxSDN6bTEtMWgxdjFINHptMS0xaDF2MUg1ek00IDhoMXYxSDR6TTIgOGgxdjFIMnptMyAxaDF2MUg1ek0xIDloMXYxSDF6Ii8+PC9nPjwvc3ZnPg==)}.ce-contextmenu-delete-col{background-image:url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGcgZmlsbD0ibm9uZSIgZmlsbC1ydWxlPSJldmVub2RkIj48cGF0aCBzdHJva2U9IiM5MjlBQTgiIGQ9Ik01LjUgNy41di02aDR2NnoiLz48cGF0aCBmaWxsPSIjM0Q0NzU3IiBkPSJNMTMgMTVWM2gxdjEyek0xIDE1VjNoMXYxMnptNCAwdi0xaDF2MXptMS0xdi0xaDF2MXptMS0xdi0xaDF2MXptLTEtMXYtMWgxdjF6bS0xLTF2LTFoMXYxem0zIDF2LTFoMXYxem0wIDJ2LTFoMXYxem0xLTN2LTFoMXYxem0wIDR2LTFoMXYxeiIvPjwvZz48L3N2Zz4=)}.ce-contextmenu-delete-table{background-image:url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGcgZmlsbD0iIzNENDc1NyIgZmlsbC1ydWxlPSJldmVub2RkIj48cGF0aCBkPSJNMTQgMTNoLTF2LTNIMnYzSDF2LTNhMSAxIDAgMDExLTFoMTFhMSAxIDAgMDExIDF2M3oiIGZpbGwtcnVsZT0ibm9uemVybyIvPjxwYXRoIGQ9Ik01LjYyNSAyTDEwIDYuMzc1IDkuMzc1IDcgNSAyLjYyNXoiLz48cGF0aCBkPSJNNSA2LjM3NUw5LjM3NSAybC42MjUuNjI1TDUuNjI1IDd6Ii8+PC9nPjwvc3ZnPg==)}.ce-contextmenu-merge-cell{background-image:url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGcgZmlsbD0iIzNENDc1NyIgZmlsbC1ydWxlPSJldmVub2RkIj48cGF0aCBkPSJNNiAxdjFIMnYxMWg0djFIMmExIDEgMCAwMS0xLTFWMmExIDEgMCAwMTEtMWg0em0zIDBoNGExIDEgMCAwMTEgMXYxMWExIDEgMCAwMS0xIDFIOXYtMWg0VjJIOVYxeiIvPjxwYXRoIGZpbGwtcnVsZT0ibm9uemVybyIgZD0iTTYgMWgxdjRINnptMiAwaDF2NEg4eiIvPjxwYXRoIGQ9Ik04IDcuNUwxMCA2djN6bS0xIDBMNSA2djN6Ii8+PHBhdGggZD0iTTkgN2gzdjFIOXpNMyA3aDN2MUgzeiIvPjxwYXRoIGZpbGwtcnVsZT0ibm9uemVybyIgZD0iTTggMTBoMXY0SDh6bS0yIDBoMXY0SDZ6Ii8+PC9nPjwvc3ZnPg==)}.ce-contextmenu-merge-cancel-cell{background-image:url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGcgZmlsbD0iIzNENDc1NyIgZmlsbC1ydWxlPSJldmVub2RkIj48cGF0aCBkPSJNNiAxdjFIMnYxMWg0djFIMmExIDEgMCAwMS0xLTFWMmExIDEgMCAwMTEtMWg0em0zIDBoNGExIDEgMCAwMTEgMXYxMWExIDEgMCAwMS0xIDFIOXYtMWg0VjJIOVYxeiIvPjxwYXRoIGZpbGwtcnVsZT0ibm9uemVybyIgZD0iTTYgMWgxdjRINnptMiAwaDF2NEg4eiIvPjxwYXRoIGQ9Ik0zIDcuNUw1IDZ2M3ptOSAwTDEwIDZ2M3oiLz48cGF0aCBkPSJNNCA3aDN2MUg0em00IDBoM3YxSDh6Ii8+PHBhdGggZmlsbC1ydWxlPSJub256ZXJvIiBkPSJNOCAxMGgxdjRIOHptLTIgMGgxdjRINnoiLz48L2c+PC9zdmc+)}.ce-contextmenu-vertical-align{background-image:url(data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjE2IiB2aWV3Qm94PSIwIDAgMTYgMTYiIHdpZHRoPSIxNiIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cGF0aCBkPSJNMiAxM2gxMnYxSDJ6bTAtM2g4djFIMnptMC0zaDEydjFIMnptMC02aDEydjFIMnptMCAzaDh2MUgyeiIgZmlsbD0iIzNkNDc1NyIgZmlsbC1ydWxlPSJldmVub2RkIi8+PC9zdmc+)}.ce-contextmenu-vertical-align-top{background-image:url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTggOEg3djZoMXptLS41LTNMMTAgOEg1ek0yIDNoMTF2MUgyeiIgZmlsbD0iIzNENDc1NyIgZmlsbC1ydWxlPSJldmVub2RkIi8+PC9zdmc+)}.ce-contextmenu-vertical-align-middle{background-image:url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIHZpZXdCb3g9IjAgMCAxNiAxNiIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cGF0aCBkPSJNOCAxMkg3djNoMXptLS41LTNsMi41IDNINXpNNyAzaDFWMEg3em0uNSAzTDUgM2g1ek0yIDdoMTF2MUgyeiIgZmlsbD0iIzNENDc1NyIgZmlsbC1ydWxlPSJldmVub2RkIi8+PC9zdmc+)}.ce-contextmenu-vertical-align-bottom{background-image:url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTcgOWgxVjNIN3ptLjUgM0w1IDloNXpNMiAxM2gxMXYxSDJ6IiBmaWxsPSIjM0Q0NzU3IiBmaWxsLXJ1bGU9ImV2ZW5vZGQiLz48L3N2Zz4=)}.ce-contextmenu-border-all{background-image:url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTIuNSAzYS41LjUgMCAwMS41LS41aDExYS41LjUgMCAwMS41LjV2MTFhLjUuNSAwIDAxLS41LjVIM2EuNS41IDAgMDEtLjUtLjVWM3oiIHN0cm9rZT0iIzNENDc1NyIvPjx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EuNWgydjFIM1YxMEgyVjZ6bTAgNmgxdjFoMXYxSDNhMSAxIDAgMDEtMS0xdi0xem00IDJ2LTFoMS41di0yaDF2MkgxMHYxSDZ6bTYgMHYtMWgxdi0xaDF2MWExIDEgMCAwMS0xIDFoLTF6bTItNGgtMVY4LjVoLTJ2LTFoMlY2aDF2NHpNOC41IDcuNXYtMWgtMXYxaC0xdjFoMXYxaDF2LTFoMXYtMWgtMXoiIGZpbGw9IiMwMDAwMDAiLz48L3N2Zz4=)}.ce-contextmenu-border-external{background-image:url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTIuNSAzYS41LjUgMCAwMS41LS41aDExYS41LjUgMCAwMS41LjV2MTFhLjUuNSAwIDAxLS41LjVIM2EuNS41IDAgMDEtLjUtLjVWM3oiIHN0cm9rZT0iIzNENDc1NyIvPjxwYXRoIGZpbGwtcnVsZT0iZXZlbm9kZCIgY2xpcC1ydWxlPSJldmVub2RkIiBkPSJNOSA1VjNIOHYyaDF6bTAgOXYtMkg4djJoMXpNNSA4SDN2MWgyVjh6bTkgMGgtMnYxaDJWOHpNOSA3djFoMXYxSDl2MUg4VjlIN1Y4aDFWN2gxeiIgZmlsbD0iI0FBQUNCMCIvPjwvc3ZnPg==)}.ce-contextmenu-border-internal{background-image:url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTIuNSAzYS41LjUgMCAwMS41LS41aDExYS41LjUgMCAwMS41LjV2MTFhLjUuNSAwIDAxLS41LjVIM2EuNS41IDAgMDEtLjUtLjVWM3oiIHN0cm9rZT0iI0FBQUNCMCIvPjxwYXRoIGZpbGwtcnVsZT0iZXZlbm9kZCIgY2xpcC1ydWxlPSJldmVub2RkIiBkPSJNOSA1VjNIOHYyaDF6bTAgOXYtMkg4djJoMXpNNSA4SDN2MWgyVjh6bTkgMGgtMnYxaDJWOHpNOSA3djFoMXYxSDl2MUg4VjlIN1Y4aDFWN2gxeiIgZmlsbD0iIzNENDc1NyIvPjwvc3ZnPg==)}.ce-contextmenu-border-td{background-image:url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTIuNSAzYS41LjUgMCAwMS41LS41aDExYS41LjUgMCAwMS41LjV2MTFhLjUuNSAwIDAxLS41LjVIM2EuNS41IDAgMDEtLjUtLjVWM3oiIHN0cm9rZT0iI0FBQUNCMCIvPjxwYXRoIHN0cm9rZT0iIzNENDc1NyIgZD0iTTguNSAyLjUgdjYgaC02Ii8+PC9zdmc+)}.ce-contextmenu-border-td-top{background-image:url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTIuNSAzYS41LjUgMCAwMS41LS41aDExYS41LjUgMCAwMS41LjV2MTFhLjUuNSAwIDAxLS41LjVIM2EuNS41IDAgMDEtLjUtLjVWM3oiIHN0cm9rZT0iI0FBQUNCMCIvPjxwYXRoIHN0cm9rZT0iIzNENDc1NyIgc3Ryb2tlLXdpZHRoPSIyIiBkPSJNMi41IDMgaDEyIi8+PC9zdmc+)}.ce-contextmenu-border-td-left{background-image:url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTIuNSAzYS41LjUgMCAwMS41LS41aDExYS41LjUgMCAwMS41LjV2MTFhLjUuNSAwIDAxLS41LjVIM2EuNS41IDAgMDEtLjUtLjVWM3oiIHN0cm9rZT0iI0FBQUNCMCIvPjxwYXRoIHN0cm9rZT0iIzNENDc1NyIgc3Ryb2tlLXdpZHRoPSIyIiBkPSJNMyAzIHYxMSIvPjwvc3ZnPg==)}.ce-contextmenu-border-td-bottom{background-image:url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTIuNSAzYS41LjUgMCAwMS41LS41aDExYS41LjUgMCAwMS41LjV2MTFhLjUuNSAwIDAxLS41LjVIM2EuNS41IDAgMDEtLjUtLjVWM3oiIHN0cm9rZT0iI0FBQUNCMCIvPjxwYXRoIHN0cm9rZT0iIzNENDc1NyIgc3Ryb2tlLXdpZHRoPSIyIiBkPSJNMi41IDE0IGgxMiIvPjwvc3ZnPg==)}.ce-contextmenu-border-td-right{background-image:url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTIuNSAzYS41LjUgMCAwMS41LS41aDExYS41LjUgMCAwMS41LjV2MTFhLjUuNSAwIDAxLS41LjVIM2EuNS41IDAgMDEtLjUtLjVWM3oiIHN0cm9rZT0iI0FBQUNCMCIvPjxwYXRoIHN0cm9rZT0iIzNENDc1NyIgc3Ryb2tlLXdpZHRoPSIyIiBkPSJNMTQgMyB2MTEiLz48L3N2Zz4=)}.ce-contextmenu-border-td-forward{background-image:url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTIuNSAzYS41LjUgMCAwMS41LS41aDExYS41LjUgMCAwMS41LjV2MTFhLjUuNSAwIDAxLS41LjVIM2EuNS41IDAgMDEtLjUtLjVWM3oiIHN0cm9rZT0iI0FBQUNCMCIgLz48cGF0aCBzdHJva2U9IiMzRDQ3NTciIGQ9Ik0xNCAzIGwtMTEgMTEiIC8+PC9zdmc+)}.ce-contextmenu-border-td-back{background-image:url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTIuNSAzYS41LjUgMCAwMS41LS41aDExYS41LjUgMCAwMS41LjV2MTFhLjUuNSAwIDAxLS41LjVIM2EuNS41IDAgMDEtLjUtLjVWM3oiIHN0cm9rZT0iI0FBQUNCMCIgLz48cGF0aCBzdHJva2U9IiMzRDQ3NTciIGQ9Ik0zIDMgbDExIDExIiAvPjwvc3ZnPg==)}.ce-hyperlink-popup{background:#fff;box-shadow:0 2px 12px #626b8433;border-radius:2px;color:#3d4757;padding:12px 16px;position:absolute;z-index:1;text-align:center;display:none}.ce-hyperlink-popup a{min-width:100px;max-width:300px;font-size:12px;display:inline-block;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;cursor:pointer;text-decoration:none;border-bottom-width:1px;border-bottom-style:solid;color:#00f}.ce-zone-indicator>div{padding:3px 6px;color:#000;font-size:12px;background:rgb(218 231 252);position:absolute;transform-origin:0 0}.ce-zone-indicator-border__top,.ce-zone-indicator-border__bottom,.ce-zone-indicator-border__left,.ce-zone-indicator-border__right{display:block;position:absolute;z-index:0}.ce-zone-indicator-border__top{border-top:2px dashed rgb(238,238,238)}.ce-zone-indicator-border__bottom{border-top:2px dashed rgb(238,238,238);width:100%}.ce-zone-indicator-border__left{border-left:2px dashed rgb(238,238,238)}.ce-zone-indicator-border__right{border-right:2px dashed rgb(238,238,238)}.ce-zone-tip{display:none;align-items:center;height:30px;white-space:nowrap;position:fixed;opacity:.9;background-color:#000;padding:0 5px;border-radius:4px;z-index:9;transition:all .3s;outline:none;user-select:none;pointer-events:none;transform:translate(10px,10px)}.ce-zone-tip.show{display:flex}.ce-zone-tip span{color:#fff;font-size:12px}.ce-inputarea{width:100px;height:30px;min-width:0;min-height:0;margin:0;padding:0;left:0;top:0;letter-spacing:0;font-size:12px;position:absolute;z-index:-1;outline:none;resize:none;border:none;overflow:hidden;color:transparent;user-select:none;caret-color:transparent;background-color:transparent}.ce-cursor{width:1px;height:20px;left:0;right:0;position:absolute;outline:none;background-color:#000;pointer-events:none}.ce-cursor.ce-cursor--animation{animation-duration:1s;animation-iteration-count:infinite;animation-name:cursorAnimation}@keyframes cursorAnimation{0%{opacity:1}13%{opacity:0}50%{opacity:0}63%{opacity:1}to{opacity:1}}.ce-float-image{position:absolute;opacity:.5;pointer-events:none}.dialog-mask{position:fixed;left:0;top:0;width:100%;height:100%;opacity:.5;background:#000000;z-index:99}.dialog-container{position:fixed;top:0;right:0;bottom:0;left:0;overflow:auto;z-index:999;margin:0;display:flex;justify-content:center;align-items:center}.dialog{position:absolute;padding:0 30px 30px;background:#ffffff;box-shadow:0 2px 12px #38383833;border:1px solid #e2e6ed;border-radius:2px}.dialog-title{position:relative;border-bottom:1px solid #e2e6ed;margin-bottom:30px;height:60px;display:flex;align-items:center;justify-content:space-between}.dialog-title i{width:16px;height:16px;cursor:pointer;display:inline-block;background:url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIHZpZXdCb3g9IjAgMCAxNiAxNiIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cGF0aCBkPSJNOC45IDguMTkybDQuMjQyIDQuMjQzLS43MDcuNzA3TDguMTkyIDguOSAzLjk1IDEzLjE0MmwtLjcwNy0uNzA3IDQuMjQyLTQuMjQzTDMuMjQzIDMuOTVsLjcwNy0uNzA3IDQuMjQyIDQuMjQyIDQuMjQzLTQuMjQyLjcwNy43MDdMOC45IDguMTkyeiIgZmlsbD0iIzZBNkE2QSIgZmlsbC1ydWxlPSJldmVub2RkIi8+PC9zdmc+)}.dialog-option__item{margin-bottom:18px;display:flex;align-items:center;justify-content:space-between}.dialog-option__item span{margin-right:12px;font-size:14px;color:#3d4757;position:relative}.dialog-option__item input,.dialog-option__item select{width:276px;height:28px;border-radius:2px;border:1px solid #d3d3d3;min-height:28px;padding:5px;box-sizing:border-box;outline:none;appearance:none;user-select:none;font-family:inherit}.dialog-option__item textarea{width:276px;height:58px;border-radius:2px;border:1px solid #d3d3d3;min-height:58px;padding:5px;box-sizing:border-box;outline:none;appearance:none;user-select:none;font-family:inherit}.dialog-option__item input:focus,.dialog-option__item textarea:focus{border-color:#4991f2}.dialog-option__item--require:before{content:"*";color:#f56c6c;margin-right:4px;position:absolute;left:-8px}.dialog-menu{display:flex;align-items:center;justify-content:flex-end}.dialog-menu button{position:relative;display:inline-block;border:1px solid #e2e6ed;border-radius:2px;background:#ffffff;line-height:22px;padding:0 16px;white-space:nowrap;cursor:pointer}.dialog-menu button:hover{background:rgba(25,55,88,.04)}.dialog-menu__cancel{margin-right:16px}.dialog-menu button[type=submit]{color:#fff;background:#4991f2;border-color:#4991f2}.dialog-menu button[type=submit]:hover{background:#5b9cf3;border-color:#5b9cf3}.searchable-select{position:relative;width:276px;height:30px;box-sizing:border-box}.searchable-select__input-wrapper{position:relative;display:flex;align-items:center;width:100%;height:100%;border:1px solid #d3d3d3}.searchable-select__input-wrapper .searchable-select__input{border:none}.searchable-select__input-wrapper .searchable-select__arrow{margin-right:0;margin-top:-12px}.searchable-select__input{width:100%;height:30px;border-radius:2px;border:1px solid #d3d3d3;padding:5px 30px 5px 5px;box-sizing:border-box;outline:none;font-family:inherit;font-size:14px;cursor:pointer;background-color:#fff}.searchable-select__input:focus{border-color:#4991f2}.searchable-select__arrow{position:absolute;right:8px;top:50%;transform:translateY(-50%);font-size:10px;color:#666;cursor:pointer;user-select:none;line-height:1;z-index:1}.searchable-select__dropdown{position:absolute;top:calc(100% + 4px);left:0;width:100%;background:#ffffff;border:1px solid #d3d3d3;border-radius:2px;box-shadow:0 2px 8px #00000026;max-height:200px;overflow-y:auto;z-index:1000}.searchable-select__option{padding:8px 12px;cursor:pointer;font-size:14px;color:#3d4757;transition:background-color .2s;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.searchable-select__option:hover{background-color:#f5f7fa}.searchable-select__option--selected{background-color:#ecf5ff;color:#4991f2;font-weight:500}.searchable-select__option--empty{color:#999;cursor:not-allowed;text-align:center;padding:12px}.searchable-select__option--empty:hover{background-color:transparent}.searchable-select__dropdown::-webkit-scrollbar{width:6px}.searchable-select__dropdown::-webkit-scrollbar-thumb{background-color:#c0c4cc;border-radius:3px}.searchable-select__dropdown::-webkit-scrollbar-thumb:hover{background-color:#909399}.searchable-select__dropdown::-webkit-scrollbar-track{background-color:#f5f7fa}')),document.head.appendChild(e)}}catch(i){console.error("vite-plugin-css-injected-by-js",i)}})();
2
2
  var index = "";
3
- const version = "0.0.1-beta.3";
3
+ const version = "0.0.1-beta.31";
4
4
  var MaxHeightRatio;
5
5
  (function(MaxHeightRatio2) {
6
6
  MaxHeightRatio2["HALF"] = "half";
@@ -507,7 +507,16 @@ const EDITOR_ELEMENT_STYLE_ATTR = [
507
507
  "strikeout",
508
508
  "textDecoration"
509
509
  ];
510
- const EDITOR_ROW_ATTR = ["rowFlex", "rowMargin"];
510
+ const EDITOR_ROW_ATTR = [
511
+ "rowFlex",
512
+ "rowMargin",
513
+ "textIndent",
514
+ "marginLeft",
515
+ "marginRight",
516
+ "marginTop",
517
+ "minHeight",
518
+ "whiteSpace"
519
+ ];
511
520
  const EDITOR_ELEMENT_COPY_ATTR = [
512
521
  "type",
513
522
  "font",
@@ -526,6 +535,12 @@ const EDITOR_ELEMENT_COPY_ATTR = [
526
535
  "dateFormat",
527
536
  "groupIds",
528
537
  "rowMargin",
538
+ "textIndent",
539
+ "marginLeft",
540
+ "marginRight",
541
+ "marginTop",
542
+ "minHeight",
543
+ "whiteSpace",
529
544
  "textDecoration"
530
545
  ];
531
546
  const EDITOR_ELEMENT_ZIP_ATTR = [
@@ -540,6 +555,12 @@ const EDITOR_ELEMENT_ZIP_ATTR = [
540
555
  "strikeout",
541
556
  "rowFlex",
542
557
  "rowMargin",
558
+ "textIndent",
559
+ "marginLeft",
560
+ "marginRight",
561
+ "marginTop",
562
+ "minHeight",
563
+ "whiteSpace",
543
564
  "dashArray",
544
565
  "trList",
545
566
  "tableToolDisabled",
@@ -4086,6 +4107,28 @@ var TdSlash;
4086
4107
  TdSlash2["FORWARD"] = "forward";
4087
4108
  TdSlash2["BACK"] = "back";
4088
4109
  })(TdSlash || (TdSlash = {}));
4110
+ function computeElementRowMarginPx(el, options) {
4111
+ var _a, _b, _c, _d, _e;
4112
+ const defaultSize = (_a = options.defaultSize) != null ? _a : 16;
4113
+ const defaultBasicRowMarginHeight = (_b = options.defaultBasicRowMarginHeight) != null ? _b : 8;
4114
+ const defaultRowMargin = (_c = options.defaultRowMargin) != null ? _c : 1;
4115
+ const scale = (_d = options.scale) != null ? _d : 1;
4116
+ const fontSize = el.size || defaultSize;
4117
+ let ratio = 1;
4118
+ if (fontSize < 12) {
4119
+ ratio = fontSize / 12;
4120
+ } else if (fontSize > 30) {
4121
+ ratio = 1 + (fontSize - 30) / 30;
4122
+ }
4123
+ return defaultBasicRowMarginHeight * ratio * ((_e = el.rowMargin) != null ? _e : defaultRowMargin) * scale;
4124
+ }
4125
+ function computeElementLineHeightPx(el, options) {
4126
+ var _a;
4127
+ const defaultSize = (_a = options.defaultSize) != null ? _a : 16;
4128
+ const fontSize = el.size || defaultSize;
4129
+ const side = computeElementRowMarginPx(el, options);
4130
+ return fontSize + 2 * side;
4131
+ }
4089
4132
  var BackgroundSize;
4090
4133
  (function(BackgroundSize2) {
4091
4134
  BackgroundSize2["CONTAIN"] = "contain";
@@ -4098,11 +4141,19 @@ var BackgroundRepeat;
4098
4141
  BackgroundRepeat2["REPEAT_X"] = "repeat-x";
4099
4142
  BackgroundRepeat2["REPEAT_Y"] = "repeat-y";
4100
4143
  })(BackgroundRepeat || (BackgroundRepeat = {}));
4144
+ var BackgroundPosition;
4145
+ (function(BackgroundPosition2) {
4146
+ BackgroundPosition2["CENTER"] = "center";
4147
+ BackgroundPosition2["TOP_LEFT"] = "topLeft";
4148
+ })(BackgroundPosition || (BackgroundPosition = {}));
4101
4149
  const defaultBackground = {
4102
4150
  color: "#FFFFFF",
4103
4151
  image: "",
4104
- size: BackgroundSize.COVER,
4152
+ size: BackgroundSize.CONTAIN,
4105
4153
  repeat: BackgroundRepeat.NO_REPEAT,
4154
+ opacity: 1,
4155
+ position: BackgroundPosition.CENTER,
4156
+ adaptive: true,
4106
4157
  applyPageNumbers: []
4107
4158
  };
4108
4159
  var VerticalAlign;
@@ -4162,7 +4213,7 @@ const defaultLabelOption = {
4162
4213
  };
4163
4214
  const defaultImgCaptionOption = {
4164
4215
  color: "#666666",
4165
- font: "Microsoft YaHei",
4216
+ font: "SimSun",
4166
4217
  size: 12,
4167
4218
  top: 5
4168
4219
  };
@@ -4172,9 +4223,10 @@ const defaultLineBreak = {
4172
4223
  lineWidth: 1.5
4173
4224
  };
4174
4225
  const defaultPageBreakOption = {
4175
- font: "Microsoft YaHei",
4226
+ font: "SimSun",
4176
4227
  fontSize: 12,
4177
- lineDash: [3, 1]
4228
+ lineDash: [3, 1],
4229
+ visible: true
4178
4230
  };
4179
4231
  const FORMAT_PLACEHOLDER = {
4180
4232
  PAGE_NO: "{pageNo}",
@@ -4183,7 +4235,7 @@ const FORMAT_PLACEHOLDER = {
4183
4235
  const defaultPageNumberOption = {
4184
4236
  bottom: 60,
4185
4237
  size: 12,
4186
- font: "Microsoft YaHei",
4238
+ font: "SimSun",
4187
4239
  color: "#000000",
4188
4240
  rowFlex: RowFlex.CENTER,
4189
4241
  format: FORMAT_PLACEHOLDER.PAGE_NO,
@@ -4198,7 +4250,7 @@ const defaultPlaceholderOption = {
4198
4250
  color: "#DCDFE6",
4199
4251
  opacity: 1,
4200
4252
  size: 16,
4201
- font: "Microsoft YaHei"
4253
+ font: "SimSun"
4202
4254
  };
4203
4255
  const defaultRadioOption = {
4204
4256
  width: 14,
@@ -4233,7 +4285,7 @@ const defaultWatermarkOption = {
4233
4285
  color: "#AEB5C0",
4234
4286
  opacity: 0.3,
4235
4287
  size: 200,
4236
- font: "Microsoft YaHei",
4288
+ font: "SimSun",
4237
4289
  repeat: false,
4238
4290
  gap: [10, 10],
4239
4291
  numberType: NumberType.ARABIC
@@ -4248,7 +4300,7 @@ var LineNumberType;
4248
4300
  })(LineNumberType || (LineNumberType = {}));
4249
4301
  const defaultLineNumberOption = {
4250
4302
  size: 12,
4251
- font: "Microsoft YaHei",
4303
+ font: "SimSun",
4252
4304
  color: "#000000",
4253
4305
  disabled: true,
4254
4306
  right: 20,
@@ -4394,7 +4446,8 @@ function mergeOption(options = {}) {
4394
4446
  locale: "zhCN",
4395
4447
  defaultType: "TEXT",
4396
4448
  defaultColor: "#000000",
4397
- defaultFont: "Microsoft YaHei",
4449
+ defaultFont: "SimSun",
4450
+ fonts: {},
4398
4451
  defaultSize: 16,
4399
4452
  minSize: 5,
4400
4453
  maxSize: 72,
@@ -4419,7 +4472,7 @@ function mergeOption(options = {}) {
4419
4472
  resizerSize: 5,
4420
4473
  marginIndicatorSize: 35,
4421
4474
  marginIndicatorColor: "#BABABA",
4422
- margins: [100, 120, 100, 120],
4475
+ margins: [0, 0, 0, 0],
4423
4476
  pageMode: PageMode.PAGING,
4424
4477
  renderMode: RenderMode.SPEED,
4425
4478
  defaultHyperlinkColor: "#0000FF",
@@ -4865,6 +4918,7 @@ function formatElementList(elementList, options) {
4865
4918
  }
4866
4919
  if (el.type === ElementType.IMAGE || el.type === ElementType.BLOCK) {
4867
4920
  el.id = el.id || getUUID();
4921
+ el.verticalAlign = "text-top";
4868
4922
  }
4869
4923
  if (el.type === ElementType.LATEX) {
4870
4924
  const { svg, width, height } = LaTexParticle.convertLaTextToSVG(el.value);
@@ -5195,6 +5249,68 @@ function convertRowFlexToJustifyContent(rowFlex) {
5195
5249
  return "flex-start";
5196
5250
  }
5197
5251
  }
5252
+ function isFloatOverlayImage(element) {
5253
+ return !!element && element.type === ElementType.IMAGE && (element.imgDisplay === ImageDisplay.SURROUND || element.imgDisplay === ImageDisplay.FLOAT_TOP || element.imgDisplay === ImageDisplay.FLOAT_BOTTOM);
5254
+ }
5255
+ function isFloatOverlayOnlyParagraph(p) {
5256
+ var _a, _b;
5257
+ let hasFloatImg = false;
5258
+ for (const node of Array.from(p.childNodes)) {
5259
+ if (node.nodeType === Node.TEXT_NODE) {
5260
+ if ((_a = node.textContent) == null ? void 0 : _a.trim())
5261
+ return false;
5262
+ continue;
5263
+ }
5264
+ if (node.nodeType !== Node.ELEMENT_NODE)
5265
+ continue;
5266
+ const el = node;
5267
+ if (el.nodeName === "IMG") {
5268
+ const display = el.getAttribute("data-img-display");
5269
+ if (display === ImageDisplay.FLOAT_TOP || display === ImageDisplay.FLOAT_BOTTOM || display === ImageDisplay.SURROUND) {
5270
+ hasFloatImg = true;
5271
+ continue;
5272
+ }
5273
+ return false;
5274
+ }
5275
+ if ((_b = el.textContent) == null ? void 0 : _b.trim())
5276
+ return false;
5277
+ }
5278
+ return hasFloatImg;
5279
+ }
5280
+ function groupElementListByRowFlex(elementList) {
5281
+ var _a;
5282
+ const elementListGroupList = [];
5283
+ if (!elementList.length)
5284
+ return elementListGroupList;
5285
+ let currentRowFlex = ((_a = elementList[0]) == null ? void 0 : _a.rowFlex) || null;
5286
+ elementListGroupList.push({
5287
+ rowFlex: currentRowFlex,
5288
+ data: [elementList[0]]
5289
+ });
5290
+ for (let e = 1; e < elementList.length; e++) {
5291
+ const element = elementList[e];
5292
+ const prev = elementList[e - 1];
5293
+ const rowFlex = element.rowFlex || null;
5294
+ const curIsFloatOverlay = isFloatOverlayImage(element);
5295
+ const prevIsFloatOverlay = isFloatOverlayImage(prev);
5296
+ const bothImages = element.type === ElementType.IMAGE && (prev == null ? void 0 : prev.type) === ElementType.IMAGE;
5297
+ if (currentRowFlex === rowFlex && !getIsBlockElement(element) && !getIsBlockElement(prev) || bothImages || curIsFloatOverlay || prevIsFloatOverlay) {
5298
+ const lastElementListGroup = elementListGroupList[elementListGroupList.length - 1];
5299
+ lastElementListGroup.data.push(element);
5300
+ } else {
5301
+ elementListGroupList.push({
5302
+ rowFlex,
5303
+ data: [element]
5304
+ });
5305
+ currentRowFlex = rowFlex;
5306
+ }
5307
+ }
5308
+ for (let g = 0; g < elementListGroupList.length; g++) {
5309
+ const elementListGroup = elementListGroupList[g];
5310
+ elementListGroup.data = zipElementList(elementListGroup.data);
5311
+ }
5312
+ return elementListGroupList;
5313
+ }
5198
5314
  function isTextLikeElement(element) {
5199
5315
  return !element.type || TEXTLIKE_ELEMENT_TYPE.includes(element.type);
5200
5316
  }
@@ -5251,8 +5367,14 @@ function formatElementContext(sourceElementList, formatElementList2, anchorIndex
5251
5367
  cloneProperty(cloneAttr, copyElement, targetElement);
5252
5368
  }
5253
5369
  }
5370
+ function resolveExportFont(element, options) {
5371
+ return element.font || options.defaultFont || "SimSun";
5372
+ }
5373
+ function applyExportFontToDom(dom, element, options) {
5374
+ dom.style.setProperty("font-family", resolveExportFont(element, options));
5375
+ }
5254
5376
  function convertElementToDom(element, options) {
5255
- var _a, _b;
5377
+ var _a;
5256
5378
  let tagName = "span";
5257
5379
  if (element.type === ElementType.SUPERSCRIPT) {
5258
5380
  tagName = "sup";
@@ -5260,7 +5382,7 @@ function convertElementToDom(element, options) {
5260
5382
  tagName = "sub";
5261
5383
  }
5262
5384
  const dom = document.createElement(tagName);
5263
- dom.style.fontFamily = element.font || options.defaultFont;
5385
+ applyExportFontToDom(dom, element, options);
5264
5386
  if (element.rowFlex) {
5265
5387
  dom.style.textAlign = convertRowFlexToTextAlign(element.rowFlex);
5266
5388
  }
@@ -5287,12 +5409,80 @@ function convertElementToDom(element, options) {
5287
5409
  if (element.type) {
5288
5410
  dom.setAttribute("data-type", element.type);
5289
5411
  }
5290
- if (element.rowMargin) {
5291
- dom.style.lineHeight = ((_b = element.rowMargin) != null ? _b : options.defaultRowMargin).toString();
5412
+ applyLineHeightExportToDom(dom, element, options);
5413
+ if (element.textIndent) {
5414
+ dom.style.textIndent = `${element.textIndent}px`;
5415
+ }
5416
+ if (element.marginLeft) {
5417
+ dom.style.marginInlineStart = `${element.marginLeft}px`;
5418
+ }
5419
+ if (element.marginRight) {
5420
+ dom.style.marginInlineEnd = `${element.marginRight}px`;
5421
+ }
5422
+ if (element.marginTop) {
5423
+ dom.style.marginTop = `${element.marginTop}px`;
5424
+ }
5425
+ if (element.minHeight) {
5426
+ dom.style.minHeight = `${element.minHeight}px`;
5427
+ }
5428
+ if (element.whiteSpace) {
5429
+ dom.style.whiteSpace = element.whiteSpace;
5292
5430
  }
5293
5431
  dom.innerText = element.value.replace(new RegExp(`${ZERO}`, "g"), "\n");
5294
5432
  return dom;
5295
5433
  }
5434
+ function applyLineHeightExportToDom(dom, element, options) {
5435
+ var _a;
5436
+ const rowMargin = (_a = element.rowMargin) != null ? _a : options.defaultRowMargin;
5437
+ const lineHeightPx = Math.round(computeElementLineHeightPx(element, options));
5438
+ dom.style.lineHeight = `${lineHeightPx}px`;
5439
+ dom.setAttribute("data-row-margin", String(rowMargin));
5440
+ dom.setAttribute("data-line-height", String(lineHeightPx));
5441
+ }
5442
+ function applyParagraphStyleToDom(dom, element, options) {
5443
+ dom.style.margin = "0";
5444
+ if (element.rowFlex) {
5445
+ dom.style.textAlign = convertRowFlexToTextAlign(element.rowFlex);
5446
+ }
5447
+ applyLineHeightExportToDom(dom, element, options);
5448
+ if (element.textIndent) {
5449
+ dom.style.textIndent = `${element.textIndent}px`;
5450
+ }
5451
+ if (element.marginLeft) {
5452
+ dom.style.marginInlineStart = `${element.marginLeft}px`;
5453
+ }
5454
+ if (element.marginRight) {
5455
+ dom.style.marginInlineEnd = `${element.marginRight}px`;
5456
+ }
5457
+ if (element.marginTop) {
5458
+ dom.style.marginTop = `${element.marginTop}px`;
5459
+ }
5460
+ const minHeight = element.minHeight || element.size;
5461
+ if (minHeight) {
5462
+ dom.style.minHeight = `${minHeight}px`;
5463
+ }
5464
+ if (element.whiteSpace) {
5465
+ dom.style.whiteSpace = element.whiteSpace;
5466
+ } else {
5467
+ dom.style.whiteSpace = "pre-wrap";
5468
+ }
5469
+ }
5470
+ function convertInlineElementToDom(element, options) {
5471
+ const dom = convertElementToDom(element, options);
5472
+ dom.style.textIndent = "";
5473
+ dom.style.marginInlineStart = "";
5474
+ dom.style.marginInlineEnd = "";
5475
+ dom.style.marginTop = "";
5476
+ dom.style.textAlign = "";
5477
+ dom.style.minHeight = "";
5478
+ if (element.whiteSpace) {
5479
+ dom.style.whiteSpace = element.whiteSpace;
5480
+ } else {
5481
+ dom.style.whiteSpace = "pre-wrap";
5482
+ }
5483
+ applyExportFontToDom(dom, element, options);
5484
+ return dom;
5485
+ }
5296
5486
  function splitListElement(elementList) {
5297
5487
  let curListIndex = 0;
5298
5488
  const listElementListMap = /* @__PURE__ */ new Map();
@@ -5325,44 +5515,415 @@ function splitListElement(elementList) {
5325
5515
  }
5326
5516
  return listElementListMap;
5327
5517
  }
5328
- function groupElementListByRowFlex(elementList) {
5329
- var _a;
5330
- const elementListGroupList = [];
5331
- if (!elementList.length)
5332
- return elementListGroupList;
5333
- let currentRowFlex = ((_a = elementList[0]) == null ? void 0 : _a.rowFlex) || null;
5334
- elementListGroupList.push({
5335
- rowFlex: currentRowFlex,
5336
- data: [elementList[0]]
5337
- });
5338
- for (let e = 1; e < elementList.length; e++) {
5339
- const element = elementList[e];
5340
- const rowFlex = element.rowFlex || null;
5341
- if (currentRowFlex === rowFlex && !getIsBlockElement(element) && !getIsBlockElement(elementList[e - 1])) {
5342
- const lastElementListGroup = elementListGroupList[elementListGroupList.length - 1];
5343
- lastElementListGroup.data.push(element);
5344
- } else {
5345
- elementListGroupList.push({
5346
- rowFlex,
5347
- data: [element]
5348
- });
5349
- currentRowFlex = rowFlex;
5518
+ const IMAGE_DISPLAY_VALUES = Object.values(ImageDisplay);
5519
+ const htmlFloatOffsetMap = /* @__PURE__ */ new Map();
5520
+ const htmlImgRowLeftMap = /* @__PURE__ */ new Map();
5521
+ function getHtmlFloatOffsetKey(element) {
5522
+ var _a, _b, _c;
5523
+ const p = element.imgFloatPosition;
5524
+ return [
5525
+ element.imgDisplay || "",
5526
+ element.width || 0,
5527
+ element.height || 0,
5528
+ (_a = p == null ? void 0 : p.x) != null ? _a : "",
5529
+ (_b = p == null ? void 0 : p.y) != null ? _b : "",
5530
+ (_c = p == null ? void 0 : p.pageNo) != null ? _c : "",
5531
+ typeof element.value === "string" ? element.value.slice(0, 80) : ""
5532
+ ].join("|");
5533
+ }
5534
+ function isParagraphBreakElement(element) {
5535
+ if (element.type === ElementType.PAGE_BREAK)
5536
+ return true;
5537
+ if (element.type === ElementType.TABLE)
5538
+ return true;
5539
+ if (element.type === ElementType.TITLE)
5540
+ return true;
5541
+ if (element.type === ElementType.LIST)
5542
+ return true;
5543
+ if (element.type === ElementType.SEPARATOR)
5544
+ return true;
5545
+ const value = element.value;
5546
+ return value === WRAP || value === "\n" || value === ZERO;
5547
+ }
5548
+ function getParagraphPageOrigin(elementList, positionList, imageIndex) {
5549
+ var _a, _b;
5550
+ let start = imageIndex;
5551
+ while (start > 0) {
5552
+ if (isParagraphBreakElement(elementList[start - 1]))
5553
+ break;
5554
+ start--;
5555
+ }
5556
+ let originX = Number.POSITIVE_INFINITY;
5557
+ let originY = Number.POSITIVE_INFINITY;
5558
+ for (let i = start; i < elementList.length; i++) {
5559
+ if (i > start && isParagraphBreakElement(elementList[i]))
5560
+ break;
5561
+ if (elementList[i].imgDisplay === ImageDisplay.FLOAT_TOP || elementList[i].imgDisplay === ImageDisplay.FLOAT_BOTTOM || elementList[i].imgDisplay === ImageDisplay.SURROUND) {
5562
+ continue;
5350
5563
  }
5564
+ const pos = positionList[i];
5565
+ if (!((_a = pos == null ? void 0 : pos.coordinate) == null ? void 0 : _a.leftTop))
5566
+ continue;
5567
+ const [x, y] = pos.coordinate.leftTop;
5568
+ originX = Math.min(originX, x);
5569
+ originY = Math.min(originY, y);
5351
5570
  }
5352
- for (let g = 0; g < elementListGroupList.length; g++) {
5353
- const elementListGroup = elementListGroupList[g];
5354
- elementListGroup.data = zipElementList(elementListGroup.data);
5571
+ if (!Number.isFinite(originX) || !Number.isFinite(originY)) {
5572
+ const flowPos = positionList[imageIndex];
5573
+ if ((_b = flowPos == null ? void 0 : flowPos.coordinate) == null ? void 0 : _b.leftTop) {
5574
+ return {
5575
+ x: flowPos.coordinate.leftTop[0],
5576
+ y: flowPos.coordinate.leftTop[1]
5577
+ };
5578
+ }
5579
+ return { x: 0, y: 0 };
5580
+ }
5581
+ return { x: originX, y: originY };
5582
+ }
5583
+ function attachHtmlFloatOffset(elementList, positionList, scale = 1) {
5584
+ const safeScale = scale || 1;
5585
+ for (let i = 0; i < elementList.length; i++) {
5586
+ const element = elementList[i];
5587
+ if (element.type !== ElementType.IMAGE || element.imgDisplay !== ImageDisplay.FLOAT_TOP && element.imgDisplay !== ImageDisplay.FLOAT_BOTTOM && element.imgDisplay !== ImageDisplay.SURROUND || !element.imgFloatPosition) {
5588
+ continue;
5589
+ }
5590
+ const origin = getParagraphPageOrigin(elementList, positionList, i);
5591
+ htmlFloatOffsetMap.set(getHtmlFloatOffsetKey(element), {
5592
+ left: (element.imgFloatPosition.x - origin.x) / safeScale,
5593
+ top: (element.imgFloatPosition.y - origin.y) / safeScale
5594
+ });
5595
+ }
5596
+ }
5597
+ function clearHtmlFloatOffset() {
5598
+ htmlFloatOffsetMap.clear();
5599
+ htmlImgRowLeftMap.clear();
5600
+ }
5601
+ function attachHtmlImgRowLeft(elementList, positionList, scale = 1) {
5602
+ var _a, _b, _c, _d, _e;
5603
+ const safeScale = scale || 1;
5604
+ const rowLeftMap = /* @__PURE__ */ new Map();
5605
+ for (const pos of positionList) {
5606
+ if (!((_a = pos == null ? void 0 : pos.coordinate) == null ? void 0 : _a.leftTop))
5607
+ continue;
5608
+ const key = `${pos.pageNo}|${pos.rowIndex}`;
5609
+ const x = pos.coordinate.leftTop[0];
5610
+ const prev = rowLeftMap.get(key);
5611
+ if (prev === void 0 || x < prev) {
5612
+ rowLeftMap.set(key, x);
5613
+ }
5614
+ }
5615
+ for (let i = 0; i < elementList.length; i++) {
5616
+ const element = elementList[i];
5617
+ if (element.type === ElementType.TABLE && element.trList) {
5618
+ for (const tr of element.trList) {
5619
+ for (const td of tr.tdList) {
5620
+ if (((_b = td.value) == null ? void 0 : _b.length) && ((_c = td.positionList) == null ? void 0 : _c.length)) {
5621
+ attachHtmlImgRowLeft(td.value, td.positionList, scale);
5622
+ }
5623
+ }
5624
+ }
5625
+ continue;
5626
+ }
5627
+ if (element.type !== ElementType.IMAGE)
5628
+ continue;
5629
+ const pos = positionList[i];
5630
+ if (!((_d = pos == null ? void 0 : pos.coordinate) == null ? void 0 : _d.leftTop))
5631
+ continue;
5632
+ const rowKey = `${pos.pageNo}|${pos.rowIndex}`;
5633
+ const rowLeft = (_e = rowLeftMap.get(rowKey)) != null ? _e : pos.coordinate.leftTop[0];
5634
+ const isFloat = element.imgDisplay === ImageDisplay.FLOAT_TOP || element.imgDisplay === ImageDisplay.FLOAT_BOTTOM || element.imgDisplay === ImageDisplay.SURROUND;
5635
+ const imageX = isFloat && element.imgFloatPosition ? element.imgFloatPosition.x : pos.coordinate.leftTop[0];
5636
+ const dist = Math.round((imageX - rowLeft) / safeScale * 100) / 100;
5637
+ htmlImgRowLeftMap.set(getHtmlFloatOffsetKey(element), dist);
5638
+ }
5639
+ }
5640
+ const HTML_FLOAT_TOP_ADJUST_PX = -2;
5641
+ function isFloatOverlayDisplay(display) {
5642
+ return display === ImageDisplay.SURROUND || display === ImageDisplay.FLOAT_TOP || display === ImageDisplay.FLOAT_BOTTOM;
5643
+ }
5644
+ function reconcileHtmlFloatPositions(elementList, positionList, scale = 1) {
5645
+ const safeScale = scale || 1;
5646
+ let changed = false;
5647
+ for (let i = 0; i < elementList.length; i++) {
5648
+ const element = elementList[i];
5649
+ const pos = element.imgFloatPosition;
5650
+ if (element.type !== ElementType.IMAGE || !isFloatOverlayDisplay(element.imgDisplay) || !pos || pos.htmlLeft === void 0 || pos.htmlTop === void 0) {
5651
+ continue;
5652
+ }
5653
+ const origin = getParagraphPageOrigin(elementList, positionList, i);
5654
+ const nextX = origin.x + pos.htmlLeft * safeScale;
5655
+ const nextY = origin.y + (pos.htmlTop - HTML_FLOAT_TOP_ADJUST_PX) * safeScale;
5656
+ if (Math.abs(nextX - pos.x) > 0.01 || Math.abs(nextY - pos.y) > 0.01) {
5657
+ pos.x = nextX;
5658
+ pos.y = nextY;
5659
+ changed = true;
5660
+ }
5661
+ delete pos.htmlLeft;
5662
+ delete pos.htmlTop;
5663
+ }
5664
+ return changed;
5665
+ }
5666
+ function buildImageWrapStyle(element) {
5667
+ const styles = ["vertical-align: text-top"];
5668
+ const { imgDisplay, imgFloatPosition } = element;
5669
+ const offset = htmlFloatOffsetMap.get(getHtmlFloatOffsetKey(element));
5670
+ const leftPx = offset ? offset.left : imgFloatPosition ? imgFloatPosition.x : void 0;
5671
+ const topBase = offset ? offset.top : imgFloatPosition ? imgFloatPosition.y : void 0;
5672
+ const topPx = topBase !== void 0 ? topBase + HTML_FLOAT_TOP_ADJUST_PX : void 0;
5673
+ if (imgDisplay === ImageDisplay.SURROUND) {
5674
+ styles.push("position: absolute", "z-index: 1");
5675
+ if (leftPx !== void 0) {
5676
+ styles.push(`left: ${leftPx}px`);
5677
+ }
5678
+ if (topPx !== void 0) {
5679
+ styles.push(`top: ${topPx}px`);
5680
+ }
5681
+ } else if (imgDisplay === ImageDisplay.FLOAT_TOP) {
5682
+ styles.push("position: absolute", "z-index: 2");
5683
+ if (leftPx !== void 0) {
5684
+ styles.push(`left: ${leftPx}px`);
5685
+ }
5686
+ if (topPx !== void 0) {
5687
+ styles.push(`top: ${topPx}px`);
5688
+ }
5689
+ } else if (imgDisplay === ImageDisplay.FLOAT_BOTTOM) {
5690
+ styles.push("position: absolute", "z-index: -1");
5691
+ if (leftPx !== void 0) {
5692
+ styles.push(`left: ${leftPx}px`);
5693
+ }
5694
+ if (topPx !== void 0) {
5695
+ styles.push(`top: ${topPx}px`);
5696
+ }
5697
+ } else if (imgDisplay === ImageDisplay.BLOCK) {
5698
+ styles.push("display: block");
5699
+ } else if (imgDisplay === ImageDisplay.INLINE) {
5700
+ styles.push("display: block", "clear: both");
5701
+ }
5702
+ return styles.join("; ");
5703
+ }
5704
+ function applyImageWrapToDom(img, element) {
5705
+ img.setAttribute("style", buildImageWrapStyle(element));
5706
+ if (element.imgDisplay) {
5707
+ img.setAttribute("data-img-display", element.imgDisplay);
5708
+ }
5709
+ if (element.imgFloatPosition) {
5710
+ const { x, y, pageNo } = element.imgFloatPosition;
5711
+ img.setAttribute("data-img-float-position", JSON.stringify(pageNo === void 0 ? { x, y } : { x, y, pageNo }));
5712
+ }
5713
+ const rowLeft = htmlImgRowLeftMap.get(getHtmlFloatOffsetKey(element));
5714
+ if (rowLeft !== void 0) {
5715
+ img.setAttribute("data-img-row-left", String(rowLeft));
5716
+ }
5717
+ }
5718
+ function relocateFloatOverlayImages(root) {
5719
+ const imgs = Array.from(root.querySelectorAll('img[data-img-display="float-top"], img[data-img-display="float-bottom"], img[data-img-display="surround"]'));
5720
+ for (const img of imgs) {
5721
+ const parent = img.parentElement;
5722
+ if (parent && (parent.nodeName === "P" || /^H[1-6]$/.test(parent.nodeName))) {
5723
+ parent.style.position = "relative";
5724
+ continue;
5725
+ }
5726
+ let target = null;
5727
+ let next = img.nextElementSibling;
5728
+ while (next) {
5729
+ if (next.nodeName === "P" || /^H[1-6]$/.test(next.nodeName)) {
5730
+ target = next;
5731
+ break;
5732
+ }
5733
+ if (next.nodeName === "DIV") {
5734
+ const innerP = next.querySelector("p,h1,h2,h3,h4,h5,h6");
5735
+ if (innerP) {
5736
+ target = innerP;
5737
+ break;
5738
+ }
5739
+ }
5740
+ if (next.getAttribute("data-type") === ElementType.PAGE_BREAK) {
5741
+ break;
5742
+ }
5743
+ next = next.nextElementSibling;
5744
+ }
5745
+ if (!target) {
5746
+ let prev = img.previousElementSibling;
5747
+ while (prev) {
5748
+ if (prev.nodeName === "P" || /^H[1-6]$/.test(prev.nodeName)) {
5749
+ target = prev;
5750
+ break;
5751
+ }
5752
+ if (prev.nodeName === "DIV") {
5753
+ const paras = prev.querySelectorAll("p,h1,h2,h3,h4,h5,h6");
5754
+ if (paras.length) {
5755
+ target = paras[paras.length - 1];
5756
+ break;
5757
+ }
5758
+ }
5759
+ prev = prev.previousElementSibling;
5760
+ }
5761
+ }
5762
+ if (target) {
5763
+ const targetEl = target;
5764
+ targetEl.style.position = "relative";
5765
+ targetEl.append(img);
5766
+ } else if (parent) {
5767
+ const p = document.createElement("p");
5768
+ p.style.position = "relative";
5769
+ p.style.margin = "0";
5770
+ parent.insertBefore(p, img);
5771
+ p.append(img);
5772
+ }
5773
+ }
5774
+ mergeFloatOnlyParagraphs(root);
5775
+ }
5776
+ function mergeFloatOnlyParagraphs(root) {
5777
+ let i = 0;
5778
+ while (i < root.children.length) {
5779
+ const el = root.children[i];
5780
+ if (el.nodeName !== "P" || !isFloatOverlayOnlyParagraph(el)) {
5781
+ i++;
5782
+ continue;
5783
+ }
5784
+ const host = el;
5785
+ host.style.position = "relative";
5786
+ const j = i + 1;
5787
+ while (j < root.children.length) {
5788
+ const next = root.children[j];
5789
+ if (next.nodeName === "P" && isFloatOverlayOnlyParagraph(next)) {
5790
+ Array.from(next.querySelectorAll("img")).forEach((img) => host.append(img));
5791
+ next.remove();
5792
+ continue;
5793
+ }
5794
+ if (next.nodeName === "P") {
5795
+ next.style.position = "relative";
5796
+ Array.from(host.querySelectorAll("img")).forEach((img) => {
5797
+ next.insertBefore(img, next.firstChild);
5798
+ });
5799
+ host.remove();
5800
+ break;
5801
+ }
5802
+ break;
5803
+ }
5804
+ i++;
5805
+ }
5806
+ }
5807
+ function applyImageWrapFromDom(img, element) {
5808
+ const displayAttr = img.getAttribute("data-img-display");
5809
+ if (displayAttr && IMAGE_DISPLAY_VALUES.includes(displayAttr)) {
5810
+ element.imgDisplay = displayAttr;
5811
+ } else {
5812
+ const { float, position, zIndex, display, clear } = img.style;
5813
+ if (float === "left" || float === "right") {
5814
+ element.imgDisplay = ImageDisplay.SURROUND;
5815
+ } else if (position === "absolute") {
5816
+ const z = Number.parseInt(zIndex || "0", 10);
5817
+ element.imgDisplay = z < 0 ? ImageDisplay.FLOAT_BOTTOM : ImageDisplay.FLOAT_TOP;
5818
+ } else if (display === "block" && clear === "both") {
5819
+ element.imgDisplay = ImageDisplay.INLINE;
5820
+ } else if (display === "block") {
5821
+ element.imgDisplay = ImageDisplay.BLOCK;
5822
+ }
5823
+ }
5824
+ const floatPosAttr = img.getAttribute("data-img-float-position");
5825
+ if (floatPosAttr) {
5826
+ try {
5827
+ element.imgFloatPosition = JSON.parse(floatPosAttr);
5828
+ } catch {
5829
+ }
5830
+ }
5831
+ if (isFloatOverlayDisplay(element.imgDisplay)) {
5832
+ const left2 = Number.parseFloat(img.style.left);
5833
+ const top = Number.parseFloat(img.style.top);
5834
+ if (!Number.isNaN(left2) && !Number.isNaN(top)) {
5835
+ if (!element.imgFloatPosition) {
5836
+ element.imgFloatPosition = { x: left2, y: top };
5837
+ } else if (element.imgFloatPosition.htmlLeft === void 0 || element.imgFloatPosition.htmlTop === void 0) {
5838
+ element.imgFloatPosition.htmlLeft = left2;
5839
+ element.imgFloatPosition.htmlTop = top;
5840
+ }
5841
+ }
5355
5842
  }
5356
- return elementListGroupList;
5357
5843
  }
5358
5844
  function createDomFromElementList(elementList, options) {
5359
5845
  const editorOptions = mergeOption(options);
5360
5846
  function buildDom(payload) {
5361
5847
  var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m;
5362
5848
  const clipboardDom2 = document.createElement("div");
5849
+ clipboardDom2.style.position = "relative";
5850
+ let paragraphDom = null;
5851
+ const flushParagraph = () => {
5852
+ if (paragraphDom) {
5853
+ clipboardDom2.append(paragraphDom);
5854
+ paragraphDom = null;
5855
+ }
5856
+ };
5857
+ const ensureParagraph = (styleSource) => {
5858
+ if (!paragraphDom) {
5859
+ paragraphDom = document.createElement("p");
5860
+ applyParagraphStyleToDom(paragraphDom, styleSource, editorOptions);
5861
+ }
5862
+ };
5863
+ const emitEmptyParagraph = (styleSource) => {
5864
+ ensureParagraph(styleSource);
5865
+ if (!paragraphDom.childNodes.length) {
5866
+ const dom = convertInlineElementToDom(styleSource, editorOptions);
5867
+ dom.innerText = NBSP;
5868
+ paragraphDom.append(dom);
5869
+ }
5870
+ flushParagraph();
5871
+ };
5872
+ const appendInlineNode = (node, styleSource) => {
5873
+ ensureParagraph(styleSource);
5874
+ paragraphDom.append(node);
5875
+ };
5876
+ const shouldEmitEmptyParagraph = (next) => {
5877
+ if (!next)
5878
+ return true;
5879
+ if (next.listWrap)
5880
+ return false;
5881
+ if (next.value === ZERO || next.value === WRAP || next.value === "\n") {
5882
+ return true;
5883
+ }
5884
+ return next.type === ElementType.TABLE || next.type === ElementType.TITLE || next.type === ElementType.LIST || next.type === ElementType.PAGE_BREAK || next.type === ElementType.SEPARATOR;
5885
+ };
5886
+ const appendTextRuns = (element, rawText, index2) => {
5887
+ let text = rawText;
5888
+ if (!text)
5889
+ return;
5890
+ text = text.replace(new RegExp(`${ZERO}`, "g"), "\n");
5891
+ if (/^\n+$/.test(text)) {
5892
+ const next = payload[index2 + 1];
5893
+ for (let i = 0; i < text.length; i++) {
5894
+ if (paragraphDom && paragraphDom.childNodes.length > 0) {
5895
+ if (isFloatOverlayOnlyParagraph(paragraphDom)) {
5896
+ continue;
5897
+ }
5898
+ flushParagraph();
5899
+ if (shouldEmitEmptyParagraph(next)) {
5900
+ emitEmptyParagraph(element);
5901
+ }
5902
+ } else if (shouldEmitEmptyParagraph(next)) {
5903
+ emitEmptyParagraph(element);
5904
+ }
5905
+ }
5906
+ return;
5907
+ }
5908
+ const parts = text.split("\n");
5909
+ for (let i = 0; i < parts.length; i++) {
5910
+ if (i > 0) {
5911
+ flushParagraph();
5912
+ }
5913
+ const part = parts[i];
5914
+ if (!part) {
5915
+ emitEmptyParagraph(element);
5916
+ continue;
5917
+ }
5918
+ const dom = convertInlineElementToDom(element, editorOptions);
5919
+ dom.innerText = part;
5920
+ appendInlineNode(dom, element);
5921
+ }
5922
+ };
5363
5923
  for (let e = 0; e < payload.length; e++) {
5364
5924
  const element = payload[e];
5365
5925
  if (element.type === ElementType.TABLE) {
5926
+ flushParagraph();
5366
5927
  const tableDom = document.createElement("table");
5367
5928
  tableDom.setAttribute("cellSpacing", "0");
5368
5929
  tableDom.setAttribute("cellpadding", "0");
@@ -5425,13 +5986,17 @@ function createDomFromElementList(elementList, options) {
5425
5986
  if (element.url) {
5426
5987
  a.href = element.url;
5427
5988
  }
5428
- clipboardDom2.append(a);
5989
+ applyExportFontToDom(a, element, editorOptions);
5990
+ appendInlineNode(a, element);
5429
5991
  } else if (element.type === ElementType.TITLE) {
5992
+ flushParagraph();
5430
5993
  const h = document.createElement(`h${titleOrderNumberMapping[element.level]}`);
5994
+ applyParagraphStyleToDom(h, element, editorOptions);
5431
5995
  const childDom = buildDom(element.valueList);
5432
5996
  h.innerHTML = childDom.innerHTML;
5433
5997
  clipboardDom2.append(h);
5434
5998
  } else if (element.type === ElementType.LIST) {
5999
+ flushParagraph();
5435
6000
  const list = document.createElement(listTypeElementMapping[element.listType]);
5436
6001
  if (element.listStyle) {
5437
6002
  list.style.listStyleType = listStyleCSSMapping[element.listStyle];
@@ -5447,16 +6012,32 @@ function createDomFromElementList(elementList, options) {
5447
6012
  clipboardDom2.append(list);
5448
6013
  } else if (element.type === ElementType.IMAGE) {
5449
6014
  const img = document.createElement("img");
5450
- console.log(element);
5451
6015
  if (element.value) {
5452
6016
  img.src = element.value;
5453
6017
  img.width = element.width;
5454
6018
  img.height = element.height;
5455
6019
  img.id = getUUID();
5456
- img.setAttribute("data-form-input", JSON.stringify(element.formInput));
6020
+ if (element.formInput) {
6021
+ img.setAttribute("data-form-input", JSON.stringify(element.formInput));
6022
+ }
6023
+ applyImageWrapToDom(img, element);
6024
+ }
6025
+ if (element.imgDisplay === ImageDisplay.SURROUND || element.imgDisplay === ImageDisplay.FLOAT_TOP || element.imgDisplay === ImageDisplay.FLOAT_BOTTOM) {
6026
+ ensureParagraph(element);
6027
+ paragraphDom.style.position = "relative";
6028
+ paragraphDom.append(img);
6029
+ } else if (element.imgDisplay === ImageDisplay.BLOCK || element.imgDisplay === ImageDisplay.INLINE) {
6030
+ const prev = payload[e - 1];
6031
+ const prevIsSameKind = (prev == null ? void 0 : prev.type) === ElementType.IMAGE && (prev.imgDisplay === ImageDisplay.BLOCK || prev.imgDisplay === ImageDisplay.INLINE);
6032
+ if (!prevIsSameKind) {
6033
+ flushParagraph();
6034
+ }
6035
+ clipboardDom2.append(img);
6036
+ } else {
6037
+ appendInlineNode(img, element);
5457
6038
  }
5458
- clipboardDom2.append(img);
5459
6039
  } else if (element.type === ElementType.BLOCK) {
6040
+ flushParagraph();
5460
6041
  if (((_e = element.block) == null ? void 0 : _e.type) === BlockType.VIDEO) {
5461
6042
  const src = (_f = element.block.videoBlock) == null ? void 0 : _f.src;
5462
6043
  if (src) {
@@ -5487,6 +6068,7 @@ function createDomFromElementList(elementList, options) {
5487
6068
  }
5488
6069
  }
5489
6070
  } else if (element.type === ElementType.SEPARATOR) {
6071
+ flushParagraph();
5490
6072
  const hr = document.createElement("hr");
5491
6073
  if ((_h = element.dashArray) == null ? void 0 : _h.length) {
5492
6074
  hr.setAttribute("data-dash-array", element.dashArray.join(","));
@@ -5498,26 +6080,31 @@ function createDomFromElementList(elementList, options) {
5498
6080
  if ((_i = element.checkbox) == null ? void 0 : _i.value) {
5499
6081
  checkbox.setAttribute("checked", "true");
5500
6082
  }
5501
- clipboardDom2.append(checkbox);
6083
+ appendInlineNode(checkbox, element);
5502
6084
  } else if (element.type === ElementType.RADIO) {
5503
6085
  const radio = document.createElement("input");
5504
6086
  radio.type = "radio";
5505
6087
  if ((_j = element.radio) == null ? void 0 : _j.value) {
5506
6088
  radio.setAttribute("checked", "true");
5507
6089
  }
5508
- clipboardDom2.append(radio);
6090
+ appendInlineNode(radio, element);
5509
6091
  } else if (element.type === ElementType.TAB) {
5510
6092
  const tab2 = document.createElement("span");
6093
+ applyExportFontToDom(tab2, element, editorOptions);
6094
+ tab2.style.whiteSpace = "pre-wrap";
5511
6095
  tab2.innerHTML = `${NON_BREAKING_SPACE}${NON_BREAKING_SPACE}`;
5512
- clipboardDom2.append(tab2);
6096
+ appendInlineNode(tab2, element);
5513
6097
  } else if (element.type === ElementType.CONTROL) {
5514
6098
  const controlElement = document.createElement("span");
6099
+ applyExportFontToDom(controlElement, element, editorOptions);
5515
6100
  const childDom = buildDom(((_k = element.control) == null ? void 0 : _k.value) || []);
5516
6101
  controlElement.innerHTML = childDom.innerHTML;
5517
- clipboardDom2.append(controlElement);
6102
+ appendInlineNode(controlElement, element);
5518
6103
  } else if (element.type === ElementType.PAGE_BREAK) {
6104
+ flushParagraph();
5519
6105
  const pageBreakElement = document.createElement("div");
5520
6106
  pageBreakElement.style.breakAfter = "page";
6107
+ pageBreakElement.setAttribute("data-type", ElementType.PAGE_BREAK);
5521
6108
  clipboardDom2.append(pageBreakElement);
5522
6109
  } else if (!element.type || element.type === ElementType.LATEX || TEXTLIKE_ELEMENT_TYPE.includes(element.type)) {
5523
6110
  let text = "";
@@ -5528,14 +6115,13 @@ function createDomFromElementList(elementList, options) {
5528
6115
  }
5529
6116
  if (!text)
5530
6117
  continue;
5531
- const dom = convertElementToDom(element, editorOptions);
5532
6118
  if (((_m = payload[e - 1]) == null ? void 0 : _m.type) === ElementType.TITLE) {
5533
6119
  text = text.replace(/^\n/, "");
5534
6120
  }
5535
- dom.innerText = text.replace(new RegExp(`${ZERO}`, "g"), "\n");
5536
- clipboardDom2.append(dom);
6121
+ appendTextRuns(element, text, e);
5537
6122
  }
5538
6123
  }
6124
+ flushParagraph();
5539
6125
  return clipboardDom2;
5540
6126
  }
5541
6127
  const clipboardDom = document.createElement("div");
@@ -5565,8 +6151,19 @@ function createDomFromElementList(elementList, options) {
5565
6151
  });
5566
6152
  }
5567
6153
  }
6154
+ relocateFloatOverlayImages(clipboardDom);
6155
+ ensureSpanExportFonts(clipboardDom, editorOptions.defaultFont || "SimSun");
5568
6156
  return clipboardDom;
5569
6157
  }
6158
+ function ensureSpanExportFonts(root, defaultFont) {
6159
+ const nodes = root.querySelectorAll("span, sup, sub");
6160
+ for (let i = 0; i < nodes.length; i++) {
6161
+ const el = nodes[i];
6162
+ if (!el.style.getPropertyValue("font-family")) {
6163
+ el.style.setProperty("font-family", defaultFont);
6164
+ }
6165
+ }
6166
+ }
5570
6167
  function convertTextNodeToElement(textNode) {
5571
6168
  if (!textNode || textNode.nodeType !== 3)
5572
6169
  return null;
@@ -5601,12 +6198,29 @@ function convertTextNodeToElement(textNode) {
5601
6198
  if (style.textDecorationLine.includes("line-through")) {
5602
6199
  element.strikeout = true;
5603
6200
  }
6201
+ const letterSpacing = parseFloat(style.letterSpacing);
6202
+ if (letterSpacing && !isNaN(letterSpacing)) {
6203
+ element.letterSpacing = letterSpacing;
6204
+ }
6205
+ const wordSpacing = parseFloat(style.wordSpacing);
6206
+ if (wordSpacing && !isNaN(wordSpacing)) {
6207
+ element.wordSpacing = wordSpacing;
6208
+ }
5604
6209
  return element;
5605
6210
  }
5606
6211
  function getElementListByHTML(htmlText, options) {
5607
6212
  const elementList = [];
6213
+ const visitedNodes = options._visitedNodes || /* @__PURE__ */ new WeakSet();
6214
+ if (!options._visitedNodes) {
6215
+ options._visitedNodes = visitedNodes;
6216
+ }
5608
6217
  function findTextNode(dom) {
5609
6218
  var _a;
6219
+ if (visitedNodes.has(dom)) {
6220
+ console.warn("Circular reference detected in DOM tree. Skipping node to prevent infinite recursion.");
6221
+ return;
6222
+ }
6223
+ visitedNodes.add(dom);
5610
6224
  if (dom.nodeType === 3) {
5611
6225
  const element = convertTextNodeToElement(dom);
5612
6226
  if (element) {
@@ -5620,6 +6234,13 @@ function getElementListByHTML(htmlText, options) {
5620
6234
  elementList.push({
5621
6235
  value: "\n"
5622
6236
  });
6237
+ } else if (node.nodeName === "DIV" && node.getAttribute("data-ce-clear") === "both") {
6238
+ continue;
6239
+ } else if (node.nodeName === "DIV" && node.getAttribute("data-type") === ElementType.PAGE_BREAK) {
6240
+ elementList.push({
6241
+ type: ElementType.PAGE_BREAK,
6242
+ value: "\n"
6243
+ });
5623
6244
  } else if (node.nodeName === "A") {
5624
6245
  const aElement = node;
5625
6246
  const value = aElement.innerText;
@@ -5682,17 +6303,20 @@ function getElementListByHTML(htmlText, options) {
5682
6303
  });
5683
6304
  } else if (node.nodeName === "IMG") {
5684
6305
  const imgElement = node;
5685
- const { src, width, height } = imgElement;
6306
+ const { src } = imgElement;
6307
+ const width = imgElement.width || Number.parseFloat(imgElement.getAttribute("width") || "") || Number.parseFloat(imgElement.style.width) || 0;
6308
+ const height = imgElement.height || Number.parseFloat(imgElement.getAttribute("height") || "") || Number.parseFloat(imgElement.style.height) || 0;
5686
6309
  if (src && width && height) {
5687
6310
  const element = {
5688
6311
  width,
5689
6312
  height,
5690
6313
  value: src,
5691
6314
  type: ElementType.IMAGE,
5692
- rowFlex: convertTextAlignToRowFlex(node.parentElement)
6315
+ rowFlex: convertTextAlignToRowFlex(node.parentElement),
6316
+ verticalAlign: "text-top"
5693
6317
  };
6318
+ applyImageWrapFromDom(imgElement, element);
5694
6319
  const formInputAttr = imgElement.getAttribute("data-form-input");
5695
- console.log("data-form-input", formInputAttr);
5696
6320
  if (formInputAttr) {
5697
6321
  try {
5698
6322
  element.formInput = JSON.parse(formInputAttr);
@@ -5753,7 +6377,16 @@ function getElementListByHTML(htmlText, options) {
5753
6377
  };
5754
6378
  trElement.querySelectorAll("th,td").forEach((tdElement) => {
5755
6379
  const tableCell = tdElement;
6380
+ if (tableCell.style.display === "none" || window.getComputedStyle(tableCell).display === "none") {
6381
+ return;
6382
+ }
5756
6383
  const valueList = getElementListByHTML(tableCell.innerHTML, options);
6384
+ if (valueList.length > 1 && (valueList[valueList.length - 1].value === "\n" || valueList[valueList.length - 1].value === WRAP)) {
6385
+ valueList.pop();
6386
+ }
6387
+ if (!valueList.length) {
6388
+ valueList.push({ value: "\n" });
6389
+ }
5757
6390
  const td = {
5758
6391
  colspan: tableCell.colSpan,
5759
6392
  rowspan: tableCell.rowSpan,
@@ -5761,20 +6394,35 @@ function getElementListByHTML(htmlText, options) {
5761
6394
  verticalAlign: window.getComputedStyle(tdElement).verticalAlign,
5762
6395
  width: parseFloat(window.getComputedStyle(tdElement).width)
5763
6396
  };
5764
- if (tableCell.style.backgroundColor) {
6397
+ const bg = (tableCell.style.backgroundColor || "").trim().toLowerCase();
6398
+ if (bg && bg !== "inherit" && bg !== "transparent" && bg !== "initial" && bg !== "unset" && bg !== "none" && bg !== "rgba(0, 0, 0, 0)" && bg !== "rgb(0, 0, 0, 0)") {
5765
6399
  td.backgroundColor = tableCell.style.backgroundColor;
5766
6400
  }
5767
6401
  tr.tdList.push(td);
5768
6402
  });
5769
- element.trList.push(tr);
6403
+ if (tr.tdList.length) {
6404
+ element.trList.push(tr);
6405
+ }
5770
6406
  });
5771
6407
  if (element.trList.length) {
5772
6408
  const tdCount = element.trList[0].tdList.reduce((pre, cur) => pre + cur.colspan, 0);
5773
6409
  const width = Math.ceil(options.innerWidth / tdCount);
5774
6410
  for (let i = 0; i < tdCount; i++) {
5775
- const colElement = (_a = colElements[i]) == null ? void 0 : _a.getAttribute("width");
6411
+ const colEl = colElements[i];
6412
+ let colWidth = width;
6413
+ if (colEl) {
6414
+ const attr = colEl.getAttribute("width");
6415
+ const styleW = (_a = colEl.style) == null ? void 0 : _a.width;
6416
+ const raw2 = attr || styleW;
6417
+ if (raw2) {
6418
+ const n2 = Number.parseFloat(raw2);
6419
+ if (Number.isFinite(n2) && n2 > 0) {
6420
+ colWidth = /pt$/i.test(raw2.trim()) ? Math.round(n2 * 96 / 72) : Math.round(n2);
6421
+ }
6422
+ }
6423
+ }
5776
6424
  element.colgroup.push({
5777
- width: colElement ? parseFloat(colElement) : width
6425
+ width: colWidth
5778
6426
  });
5779
6427
  }
5780
6428
  elementList.push(element);
@@ -5810,6 +6458,10 @@ function getElementListByHTML(htmlText, options) {
5810
6458
  }
5811
6459
  }
5812
6460
  }
6461
+ if (options.container) {
6462
+ findTextNode(options.container);
6463
+ return elementList;
6464
+ }
5813
6465
  const clipboardHost = document.createElement("div");
5814
6466
  document.body.appendChild(clipboardHost);
5815
6467
  const shadowRoot = clipboardHost.attachShadow({ mode: "open" });
@@ -5951,6 +6603,20 @@ function getNonHideElementIndex(elementList, index2, position = LocationPosition
5951
6603
  }
5952
6604
  return i;
5953
6605
  }
6606
+ function convertToXHTML(dom, options) {
6607
+ var _a;
6608
+ if (!dom)
6609
+ return "";
6610
+ const serializer = new XMLSerializer();
6611
+ let xhtml = serializer.serializeToString(dom);
6612
+ xhtml = xhtml.replace(/\sxmlns="http:\/\/www\.w3\.org\/1999\/xhtml"/g, "");
6613
+ const keepRoot = (options == null ? void 0 : options.keepRoot) || ((_a = dom.classList) == null ? void 0 : _a.contains("ce-export-page"));
6614
+ if (keepRoot) {
6615
+ return xhtml;
6616
+ }
6617
+ const match = xhtml.match(/<[^>]+>([\s\S]*)<\/[^>]+>$/i);
6618
+ return match ? match[1] : xhtml;
6619
+ }
5954
6620
  function setClipboardData(data2) {
5955
6621
  localStorage.setItem(EDITOR_CLIPBOARD, JSON.stringify({
5956
6622
  text: data2.text,
@@ -8452,6 +9118,22 @@ function dblclick(host, evt) {
8452
9118
  editor.showFormRadioConfig(curElement);
8453
9119
  return;
8454
9120
  }
9121
+ if (curElement.formInput && curElement.formInput.type === "image") {
9122
+ editor.showFormImageConfig(curElement);
9123
+ return;
9124
+ }
9125
+ if (curElement.formInput && curElement.formInput.type === "signature") {
9126
+ editor.showFormSignatureConfig(curElement);
9127
+ return;
9128
+ }
9129
+ if (curElement.formInput && curElement.formInput.type === "seal") {
9130
+ editor.showFormSealConfig(curElement);
9131
+ return;
9132
+ }
9133
+ if (curElement.formInput && curElement.formInput.type === "riskCopy") {
9134
+ editor.showFormRiskCopyConfig(curElement);
9135
+ return;
9136
+ }
8455
9137
  editor.showFormInputConfig(curElement);
8456
9138
  return;
8457
9139
  }
@@ -9002,7 +9684,6 @@ class Position {
9002
9684
  for (let j = 0; j < curRow.elementList.length; j++) {
9003
9685
  const element = curRow.elementList[j];
9004
9686
  const metrics = element.metrics;
9005
- const offsetY = !element.hide && (element.imgDisplay !== ImageDisplay.INLINE && element.type === ElementType.IMAGE || element.type === ElementType.LATEX) ? curRow.ascent - metrics.height : curRow.ascent;
9006
9687
  if (element.left) {
9007
9688
  x += element.left;
9008
9689
  }
@@ -9017,7 +9698,7 @@ class Position {
9017
9698
  rowNo: i,
9018
9699
  metrics,
9019
9700
  left: element.left || 0,
9020
- ascent: offsetY,
9701
+ ascent: element.type === ElementType.IMAGE ? 4 : 17,
9021
9702
  lineHeight: curRow.height,
9022
9703
  isFirstLetter: j === 0,
9023
9704
  isLastLetter: j === curRow.elementList.length - 1,
@@ -9914,6 +10595,8 @@ class RangeManager {
9914
10595
  const highlight = curElement.highlight || null;
9915
10596
  const rowFlex = curElement.rowFlex || null;
9916
10597
  const rowMargin = (_a = curElement.rowMargin) != null ? _a : this.options.defaultRowMargin;
10598
+ const textIndent = curElement.textIndent || 0;
10599
+ const marginLeft = curElement.marginLeft || 0;
9917
10600
  const dashArray = curElement.dashArray || [];
9918
10601
  const level = curElement.level || null;
9919
10602
  const listType = curElement.listType || null;
@@ -9939,6 +10622,8 @@ class RangeManager {
9939
10622
  highlight,
9940
10623
  rowFlex,
9941
10624
  rowMargin,
10625
+ textIndent,
10626
+ marginLeft,
9942
10627
  dashArray,
9943
10628
  level,
9944
10629
  listType,
@@ -9980,6 +10665,8 @@ class RangeManager {
9980
10665
  highlight: null,
9981
10666
  rowFlex: null,
9982
10667
  rowMargin,
10668
+ textIndent: 0,
10669
+ marginLeft: 0,
9983
10670
  dashArray: [],
9984
10671
  level: null,
9985
10672
  listType: null,
@@ -10089,28 +10776,26 @@ class Background {
10089
10776
  }
10090
10777
  _drawImage(ctx, imageElement, width, height) {
10091
10778
  const { background, scale } = this.options;
10092
- if (background.size === BackgroundSize.CONTAIN) {
10093
- const imageWidth = imageElement.width * scale;
10094
- const imageHeight = imageElement.height * scale;
10095
- if (!background.repeat || background.repeat === BackgroundRepeat.NO_REPEAT) {
10096
- ctx.drawImage(imageElement, 0, 0, imageWidth, imageHeight);
10097
- } else {
10098
- let startX = 0;
10099
- let startY = 0;
10100
- const repeatXCount = background.repeat === BackgroundRepeat.REPEAT || background.repeat === BackgroundRepeat.REPEAT_X ? Math.ceil(width * scale / imageWidth) : 1;
10101
- const repeatYCount = background.repeat === BackgroundRepeat.REPEAT || background.repeat === BackgroundRepeat.REPEAT_Y ? Math.ceil(height * scale / imageHeight) : 1;
10102
- for (let x = 0; x < repeatXCount; x++) {
10103
- for (let y = 0; y < repeatYCount; y++) {
10104
- ctx.drawImage(imageElement, startX, startY, imageWidth, imageHeight);
10105
- startY += imageHeight;
10106
- }
10107
- startY = 0;
10108
- startX += imageWidth;
10109
- }
10110
- }
10111
- } else {
10112
- ctx.drawImage(imageElement, 0, 0, width * scale, height * scale);
10779
+ const pageWidth = width * scale;
10780
+ const pageHeight = height * scale;
10781
+ const imgWidth = imageElement.width;
10782
+ const imgHeight = imageElement.height;
10783
+ if (!imgWidth || !imgHeight)
10784
+ return;
10785
+ const opacity = typeof background.opacity === "number" ? background.opacity : 1;
10786
+ ctx.save();
10787
+ ctx.globalAlpha = Math.min(1, Math.max(0, opacity));
10788
+ const ratio = Math.min(pageWidth / imgWidth, pageHeight / imgHeight, 1);
10789
+ const drawWidth = imgWidth * ratio;
10790
+ const drawHeight = imgHeight * ratio;
10791
+ let dx = 0;
10792
+ let dy = 0;
10793
+ if (background.position === BackgroundPosition.CENTER) {
10794
+ dx = (pageWidth - drawWidth) / 2;
10795
+ dy = (pageHeight - drawHeight) / 2;
10113
10796
  }
10797
+ ctx.drawImage(imageElement, dx, dy, drawWidth, drawHeight);
10798
+ ctx.restore();
10114
10799
  }
10115
10800
  _renderBackgroundImage(ctx, width, height) {
10116
10801
  const { background } = this.options;
@@ -10133,13 +10818,12 @@ class Background {
10133
10818
  }
10134
10819
  render(ctx, pageNo) {
10135
10820
  const { background: { image, color, applyPageNumbers } } = this.options;
10821
+ const { width, height } = this.options;
10822
+ const canvasWidth = this.draw.getCanvasWidth(pageNo);
10823
+ const canvasHeight = this.draw.getCanvasHeight(pageNo);
10824
+ this._renderBackgroundColor(ctx, color, canvasWidth, canvasHeight);
10136
10825
  if (image && (!(applyPageNumbers == null ? void 0 : applyPageNumbers.length) || applyPageNumbers.includes(pageNo))) {
10137
- const { width, height } = this.options;
10138
10826
  this._renderBackgroundImage(ctx, width, height);
10139
- } else {
10140
- const width = this.draw.getCanvasWidth(pageNo);
10141
- const height = this.draw.getCanvasHeight(pageNo);
10142
- this._renderBackgroundColor(ctx, color, width, height);
10143
10827
  }
10144
10828
  }
10145
10829
  }
@@ -11275,6 +11959,10 @@ class TableParticle {
11275
11959
  const td = tr.tdList[d];
11276
11960
  if (!td.backgroundColor)
11277
11961
  continue;
11962
+ const bg = td.backgroundColor.trim().toLowerCase();
11963
+ if (bg === "inherit" || bg === "transparent" || bg === "initial" || bg === "unset") {
11964
+ continue;
11965
+ }
11278
11966
  ctx.save();
11279
11967
  const width = td.width * scale;
11280
11968
  const height = td.height * scale;
@@ -15493,7 +16181,7 @@ function WorkerWrapper$1() {
15493
16181
  objURL && (window.URL || window.webkitURL).revokeObjectURL(objURL);
15494
16182
  }
15495
16183
  }
15496
- const encodedJs = "KGZ1bmN0aW9uKCl7InVzZSBzdHJpY3QiO3ZhciBSPShlPT4oZS5IQUxGPSJoYWxmIixl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bHVlPT09Uz9gCmA6ci52YWx1ZTtILnZhbHVlKz11fWVsc2UgYnJlYWt9ZWxzZSBpKys7Ty5wdXNoKEgpfXJldHVybiBPfU9iamVjdC52YWx1ZXMoTiksb25tZXNzYWdlPWU9Pntjb25zdCBvPWUuZGF0YSx7b3B0aW9uczpkLGRhdGE6VH09byx7ZXh0cmFQaWNrQXR0cnM6Zj1bXX09ZHx8e30sbD17aGVhZGVyOkkoVC5oZWFkZXIse2V4dHJhUGlja0F0dHJzOmYsaXNDbG9uZTohMX0pLG1haW46SShULm1haW4se2V4dHJhUGlja0F0dHJzOmYsaXNDbGFzc2lmeUFyZWE6ITAsaXNDbG9uZTohMX0pLGZvb3RlcjpJKFQuZm9vdGVyLHtleHRyYVBpY2tBdHRyczpmLGlzQ2xvbmU6ITF9KX07cG9zdE1lc3NhZ2UobCl9fSkoKTsK";
15497
16185
  const blob = typeof window !== "undefined" && window.Blob && new Blob([atob(encodedJs)], { type: "text/javascript;charset=utf-8" });
15498
16186
  function WorkerWrapper() {
15499
16187
  const objURL = blob && (window.URL || window.webkitURL).createObjectURL(blob);
@@ -15577,6 +16265,7 @@ class Dialog {
15577
16265
  this.mask = null;
15578
16266
  this.container = null;
15579
16267
  this.inputList = [];
16268
+ this.searchDropdowns = /* @__PURE__ */ new Map();
15580
16269
  this._render();
15581
16270
  }
15582
16271
  _render() {
@@ -15620,45 +16309,65 @@ class Dialog {
15620
16309
  optionName.classList.add("dialog-option__item--require");
15621
16310
  }
15622
16311
  }
15623
- let optionInput;
15624
16312
  if (option.type === "select") {
15625
- optionInput = document.createElement("select");
15626
- (_a = option.options) == null ? void 0 : _a.forEach((item) => {
15627
- const optionItem = document.createElement("option");
15628
- optionItem.value = item.value;
15629
- optionItem.label = item.label;
15630
- optionInput.append(optionItem);
15631
- });
15632
- } else if (option.type === "textarea") {
15633
- optionInput = document.createElement("textarea");
15634
- } else if (option.type === "color") {
15635
- optionInput = document.createElement("input");
15636
- optionInput.type = "text";
15637
- optionInput.onclick = function() {
15638
- colorControlDom.click();
15639
- };
15640
- const colorControlDom = document.querySelector("#color");
15641
- colorControlDom.oninput = function() {
15642
- optionInput.value = colorControlDom.value;
15643
- };
16313
+ if (option.searchable === false) {
16314
+ const optionInput = document.createElement("select");
16315
+ if (option.width) {
16316
+ optionInput.style.width = `${option.width}px`;
16317
+ }
16318
+ if (option.height) {
16319
+ optionInput.style.height = `${option.height}px`;
16320
+ }
16321
+ optionInput.name = option.name;
16322
+ optionInput.value = option.value || "";
16323
+ (_a = option.options) == null ? void 0 : _a.forEach((item) => {
16324
+ const optionItem = document.createElement("option");
16325
+ optionItem.value = item.value;
16326
+ optionItem.label = item.label;
16327
+ optionInput.append(optionItem);
16328
+ });
16329
+ optionItemContainer.append(optionInput);
16330
+ optionContainer.append(optionItemContainer);
16331
+ this.inputList.push(optionInput);
16332
+ } else {
16333
+ const searchableSelect = this._createSearchableSelect(option);
16334
+ optionItemContainer.append(searchableSelect);
16335
+ optionContainer.append(optionItemContainer);
16336
+ this.inputList.push(searchableSelect);
16337
+ }
15644
16338
  } else {
15645
- optionInput = document.createElement("input");
15646
- optionInput.type = option.type;
15647
- }
15648
- if (option.width) {
15649
- optionInput.style.width = `${option.width}px`;
15650
- }
15651
- if (option.height) {
15652
- optionInput.style.height = `${option.height}px`;
15653
- }
15654
- optionInput.name = option.name;
15655
- optionInput.value = option.value || "";
15656
- if (!(optionInput instanceof HTMLSelectElement)) {
15657
- optionInput.placeholder = option.placeholder || "";
16339
+ let optionInput;
16340
+ if (option.type === "textarea") {
16341
+ optionInput = document.createElement("textarea");
16342
+ } else if (option.type === "color") {
16343
+ optionInput = document.createElement("input");
16344
+ optionInput.type = "text";
16345
+ optionInput.onclick = function() {
16346
+ colorControlDom.click();
16347
+ };
16348
+ const colorControlDom = document.querySelector("#color");
16349
+ colorControlDom.oninput = function() {
16350
+ optionInput.value = colorControlDom.value;
16351
+ };
16352
+ } else {
16353
+ optionInput = document.createElement("input");
16354
+ optionInput.type = option.type;
16355
+ }
16356
+ if (option.width) {
16357
+ optionInput.style.width = `${option.width}px`;
16358
+ }
16359
+ if (option.height) {
16360
+ optionInput.style.height = `${option.height}px`;
16361
+ }
16362
+ optionInput.name = option.name;
16363
+ optionInput.value = option.value || "";
16364
+ if (!(optionInput instanceof HTMLSelectElement)) {
16365
+ optionInput.placeholder = option.placeholder || "";
16366
+ }
16367
+ optionItemContainer.append(optionInput);
16368
+ optionContainer.append(optionItemContainer);
16369
+ this.inputList.push(optionInput);
15658
16370
  }
15659
- optionItemContainer.append(optionInput);
15660
- optionContainer.append(optionItemContainer);
15661
- this.inputList.push(optionInput);
15662
16371
  }
15663
16372
  dialogContainer.append(optionContainer);
15664
16373
  const menuContainer = document.createElement("div");
@@ -15679,10 +16388,21 @@ class Dialog {
15679
16388
  confirmBtn.type = "submit";
15680
16389
  confirmBtn.onclick = () => {
15681
16390
  if (onConfirm) {
15682
- const payload = this.inputList.map((input2) => ({
15683
- name: input2.name,
15684
- value: input2.value
15685
- }));
16391
+ const payload = this.inputList.map((input2) => {
16392
+ if (input2 instanceof HTMLDivElement && input2.classList.contains("searchable-select")) {
16393
+ const name = input2.getAttribute("data-name") || "";
16394
+ const dropdownInfo = this.searchDropdowns.get(name);
16395
+ return {
16396
+ name,
16397
+ value: (dropdownInfo == null ? void 0 : dropdownInfo.selectedValue) || ""
16398
+ };
16399
+ }
16400
+ const element = input2;
16401
+ return {
16402
+ name: element.name,
16403
+ value: element.value
16404
+ };
16405
+ });
15686
16406
  onConfirm(payload);
15687
16407
  }
15688
16408
  this._dispose();
@@ -15693,6 +16413,127 @@ class Dialog {
15693
16413
  this.container = container;
15694
16414
  this.mask = mask;
15695
16415
  }
16416
+ _createSearchableSelect(option) {
16417
+ var _a;
16418
+ const container = document.createElement("div");
16419
+ container.classList.add("searchable-select");
16420
+ container.setAttribute("data-name", option.name);
16421
+ if (option.width) {
16422
+ container.style.width = `${option.width}px`;
16423
+ }
16424
+ const input2 = document.createElement("input");
16425
+ input2.type = "text";
16426
+ input2.classList.add("searchable-select__input");
16427
+ input2.placeholder = option.placeholder || "\u8BF7\u9009\u62E9\u6216\u641C\u7D22";
16428
+ const dropdownInfo = this.searchDropdowns.get(option.name);
16429
+ const currentValue = (dropdownInfo == null ? void 0 : dropdownInfo.selectedValue) || option.value || "";
16430
+ if (currentValue && option.options) {
16431
+ const selectedOption = option.options.find((opt) => opt.value === currentValue);
16432
+ if (selectedOption) {
16433
+ input2.value = selectedOption.label;
16434
+ }
16435
+ }
16436
+ const arrow = document.createElement("span");
16437
+ arrow.classList.add("searchable-select__arrow");
16438
+ arrow.innerHTML = "\u25BC";
16439
+ const inputWrapper = document.createElement("div");
16440
+ inputWrapper.classList.add("searchable-select__input-wrapper");
16441
+ inputWrapper.append(input2);
16442
+ inputWrapper.append(arrow);
16443
+ const dropdown = document.createElement("div");
16444
+ dropdown.classList.add("searchable-select__dropdown");
16445
+ dropdown.style.display = "none";
16446
+ const renderOptions = (filterText = "") => {
16447
+ var _a2;
16448
+ dropdown.innerHTML = "";
16449
+ const filteredOptions = ((_a2 = option.options) == null ? void 0 : _a2.filter((opt) => !filterText || opt.label.toLowerCase().includes(filterText.toLowerCase()))) || [];
16450
+ const dropdownInfo2 = this.searchDropdowns.get(option.name);
16451
+ const currentValue2 = (dropdownInfo2 == null ? void 0 : dropdownInfo2.selectedValue) || option.value || "";
16452
+ if (filteredOptions.length === 0) {
16453
+ const emptyItem = document.createElement("div");
16454
+ emptyItem.classList.add("searchable-select__option", "searchable-select__option--empty");
16455
+ emptyItem.textContent = "\u65E0\u5339\u914D\u9009\u9879";
16456
+ dropdown.append(emptyItem);
16457
+ } else {
16458
+ filteredOptions.forEach((item) => {
16459
+ const optionItem = document.createElement("div");
16460
+ optionItem.classList.add("searchable-select__option");
16461
+ optionItem.textContent = item.label;
16462
+ optionItem.setAttribute("data-value", item.value);
16463
+ if (item.value === currentValue2) {
16464
+ optionItem.classList.add("searchable-select__option--selected");
16465
+ }
16466
+ optionItem.onclick = (e) => {
16467
+ e.stopPropagation();
16468
+ const selectedValue = optionItem.getAttribute("data-value") || "";
16469
+ input2.value = item.label;
16470
+ const allOptions = dropdown.querySelectorAll(".searchable-select__option");
16471
+ allOptions.forEach((opt) => {
16472
+ opt.classList.remove("searchable-select__option--selected");
16473
+ });
16474
+ optionItem.classList.add("searchable-select__option--selected");
16475
+ const dropdownInfo3 = this.searchDropdowns.get(option.name);
16476
+ if (dropdownInfo3) {
16477
+ dropdownInfo3.selectedValue = selectedValue;
16478
+ }
16479
+ dropdown.style.display = "none";
16480
+ };
16481
+ dropdown.append(optionItem);
16482
+ });
16483
+ }
16484
+ };
16485
+ renderOptions();
16486
+ input2.oninput = () => {
16487
+ renderOptions(input2.value);
16488
+ dropdown.style.display = "block";
16489
+ };
16490
+ input2.onclick = (e) => {
16491
+ e.stopPropagation();
16492
+ const allDropdowns = document.querySelectorAll(".searchable-select__dropdown");
16493
+ allDropdowns.forEach((d) => {
16494
+ if (d !== dropdown) {
16495
+ d.style.display = "none";
16496
+ }
16497
+ });
16498
+ dropdown.style.display = dropdown.style.display === "block" ? "none" : "block";
16499
+ };
16500
+ arrow.onclick = (e) => {
16501
+ e.stopPropagation();
16502
+ const allDropdowns = document.querySelectorAll(".searchable-select__dropdown");
16503
+ allDropdowns.forEach((d) => {
16504
+ if (d !== dropdown) {
16505
+ d.style.display = "none";
16506
+ }
16507
+ });
16508
+ dropdown.style.display = dropdown.style.display === "block" ? "none" : "block";
16509
+ input2.focus();
16510
+ };
16511
+ const closeDropdown = (e) => {
16512
+ const target = e.target;
16513
+ if (!container.contains(target)) {
16514
+ dropdown.style.display = "none";
16515
+ }
16516
+ };
16517
+ document.addEventListener("click", closeDropdown);
16518
+ const hiddenSelect = document.createElement("select");
16519
+ hiddenSelect.style.display = "none";
16520
+ hiddenSelect.name = option.name;
16521
+ hiddenSelect.value = option.value || "";
16522
+ (_a = option.options) == null ? void 0 : _a.forEach((item) => {
16523
+ const optionItem = document.createElement("option");
16524
+ optionItem.value = item.value;
16525
+ optionItem.label = item.label;
16526
+ hiddenSelect.append(optionItem);
16527
+ });
16528
+ this.searchDropdowns.set(option.name, {
16529
+ selectedValue: option.value || "",
16530
+ selectElement: hiddenSelect
16531
+ });
16532
+ container.append(inputWrapper);
16533
+ container.append(dropdown);
16534
+ container.append(hiddenSelect);
16535
+ return container;
16536
+ }
15696
16537
  _dispose() {
15697
16538
  var _a, _b;
15698
16539
  (_a = this.mask) == null ? void 0 : _a.remove();
@@ -15987,7 +16828,8 @@ function formCheckboxPropertiesConfigDialog(el, editor) {
15987
16828
  const fontFamily = (_h2 = payload.find((p) => p.name === "fontFamily")) == null ? void 0 : _h2.value;
15988
16829
  const type = "checkbox";
15989
16830
  const formInputKeys = editor.getExtensionParam("formInputKeys");
15990
- formInputKeys.find((kel2) => kel2.value === key) ? JSON.parse(kel) : "";
16831
+ const item = formInputKeys.find((item2) => item2.value === key);
16832
+ const elemProp = item ? JSON.stringify(item) : "";
15991
16833
  const formInput = {
15992
16834
  key,
15993
16835
  width,
@@ -15997,7 +16839,8 @@ function formCheckboxPropertiesConfigDialog(el, editor) {
15997
16839
  fontSize,
15998
16840
  fontFamily,
15999
16841
  color,
16000
- type
16842
+ type,
16843
+ elemProp
16001
16844
  };
16002
16845
  const imageDataUrl = generateCheckboxImage({
16003
16846
  checked,
@@ -16127,7 +16970,8 @@ function formRadioPropertiesConfigDialog(el, editor) {
16127
16970
  const fontFamily = (_h2 = payload.find((p) => p.name === "fontFamily")) == null ? void 0 : _h2.value;
16128
16971
  const type = "radio";
16129
16972
  const formInputKeys = editor.getExtensionParam("formInputKeys");
16130
- formInputKeys.find((kel2) => kel2.value === key) ? JSON.parse(kel) : "";
16973
+ const item = formInputKeys.find((item2) => item2.value === key);
16974
+ const elemProp = item ? JSON.stringify(item) : "";
16131
16975
  const formInput = {
16132
16976
  key,
16133
16977
  width,
@@ -16137,7 +16981,8 @@ function formRadioPropertiesConfigDialog(el, editor) {
16137
16981
  fontSize,
16138
16982
  fontFamily,
16139
16983
  color,
16140
- type
16984
+ type,
16985
+ elemProp
16141
16986
  };
16142
16987
  const imageDataUrl = generateRadioImage({
16143
16988
  checked,
@@ -16168,7 +17013,7 @@ function formRadioPropertiesConfigDialog(el, editor) {
16168
17013
  });
16169
17014
  }
16170
17015
  function formInputPropertiesConfigDialog(el, editor) {
16171
- var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u, _v;
17016
+ var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x;
16172
17017
  console.log("el", el);
16173
17018
  new Dialog({
16174
17019
  title: "\u8868\u5355\u6587\u672C\u6846",
@@ -16198,20 +17043,28 @@ function formInputPropertiesConfigDialog(el, editor) {
16198
17043
  placeholder: "\u8BF7\u8F93\u5165\u9AD8\u5EA6",
16199
17044
  value: (_f = (_e = el == null ? void 0 : el.formInput) == null ? void 0 : _e.height) != null ? _f : "50"
16200
17045
  },
17046
+ {
17047
+ type: "text",
17048
+ label: "\u884C\u9AD8",
17049
+ name: "lineHeight",
17050
+ required: false,
17051
+ placeholder: "\u683C\u5F0F\u5316\u6587\u672C\u4F7F\u7528",
17052
+ value: (_h = (_g = el == null ? void 0 : el.formInput) == null ? void 0 : _g.lineHeight) != null ? _h : ""
17053
+ },
16201
17054
  {
16202
17055
  type: "number",
16203
17056
  label: "\u5B57\u53F7",
16204
17057
  name: "fontSize",
16205
17058
  required: true,
16206
17059
  placeholder: "\u8BF7\u8F93\u5165\u5B57\u53F7",
16207
- value: (_h = (_g = el == null ? void 0 : el.formInput) == null ? void 0 : _g.fontSize) != null ? _h : "10"
17060
+ value: (_j = (_i = el == null ? void 0 : el.formInput) == null ? void 0 : _i.fontSize) != null ? _j : "10"
16208
17061
  },
16209
17062
  {
16210
17063
  type: "select",
16211
17064
  label: "\u662F\u5426\u52A0\u7C97",
16212
17065
  name: "bold",
16213
17066
  required: true,
16214
- value: ((_i = el == null ? void 0 : el.formInput) == null ? void 0 : _i.bold) ? String((_j = el == null ? void 0 : el.formInput) == null ? void 0 : _j.bold) : "false",
17067
+ value: ((_k = el == null ? void 0 : el.formInput) == null ? void 0 : _k.bold) ? String((_l = el == null ? void 0 : el.formInput) == null ? void 0 : _l.bold) : "false",
16215
17068
  options: [
16216
17069
  {
16217
17070
  label: "\u662F",
@@ -16228,7 +17081,7 @@ function formInputPropertiesConfigDialog(el, editor) {
16228
17081
  label: "\u662F\u5426\u659C\u4F53",
16229
17082
  name: "italic",
16230
17083
  required: true,
16231
- value: ((_k = el == null ? void 0 : el.formInput) == null ? void 0 : _k.italic) ? String((_l = el == null ? void 0 : el.formInput) == null ? void 0 : _l.italic) : "false",
17084
+ value: ((_m = el == null ? void 0 : el.formInput) == null ? void 0 : _m.italic) ? String((_n = el == null ? void 0 : el.formInput) == null ? void 0 : _n.italic) : "false",
16232
17085
  options: [
16233
17086
  {
16234
17087
  label: "\u662F",
@@ -16245,7 +17098,7 @@ function formInputPropertiesConfigDialog(el, editor) {
16245
17098
  label: "\u586B\u5145\u7C7B\u578B",
16246
17099
  name: "txtFillType",
16247
17100
  required: true,
16248
- value: ((_m = el == null ? void 0 : el.formInput) == null ? void 0 : _m.txtFillType) ? String((_n = el == null ? void 0 : el.formInput) == null ? void 0 : _n.txtFillType) : "0",
17101
+ value: ((_o = el == null ? void 0 : el.formInput) == null ? void 0 : _o.txtFillType) ? String((_p = el == null ? void 0 : el.formInput) == null ? void 0 : _p.txtFillType) : "0",
16249
17102
  options: [
16250
17103
  {
16251
17104
  label: "\u6587\u672C",
@@ -16262,7 +17115,7 @@ function formInputPropertiesConfigDialog(el, editor) {
16262
17115
  label: "\u662F\u5426\u81EA\u52A8\u6362\u884C",
16263
17116
  name: "txtRowAutoFlag",
16264
17117
  required: false,
16265
- value: ((_o = el == null ? void 0 : el.formInput) == null ? void 0 : _o.txtRowAutoFlag) ? String((_p = el == null ? void 0 : el.formInput) == null ? void 0 : _p.txtRowAutoFlag) : "1",
17118
+ value: ((_q = el == null ? void 0 : el.formInput) == null ? void 0 : _q.txtRowAutoFlag) ? String((_r = el == null ? void 0 : el.formInput) == null ? void 0 : _r.txtRowAutoFlag) : "1",
16266
17119
  options: [
16267
17120
  {
16268
17121
  label: "\u662F",
@@ -16279,7 +17132,7 @@ function formInputPropertiesConfigDialog(el, editor) {
16279
17132
  label: "\u662F\u5426\u53EF\u7F16\u8F91",
16280
17133
  name: "txtEditFlag",
16281
17134
  required: false,
16282
- value: ((_q = el == null ? void 0 : el.formInput) == null ? void 0 : _q.txtEditFlag) ? String((_r = el == null ? void 0 : el.formInput) == null ? void 0 : _r.txtEditFlag) : "1",
17135
+ value: ((_s = el == null ? void 0 : el.formInput) == null ? void 0 : _s.txtEditFlag) ? String((_t = el == null ? void 0 : el.formInput) == null ? void 0 : _t.txtEditFlag) : "1",
16283
17136
  options: [
16284
17137
  {
16285
17138
  label: "\u662F",
@@ -16292,23 +17145,776 @@ function formInputPropertiesConfigDialog(el, editor) {
16292
17145
  ]
16293
17146
  },
16294
17147
  {
16295
- type: "color",
16296
- label: "\u5B57\u4F53\u989C\u8272",
16297
- name: "color",
17148
+ type: "color",
17149
+ label: "\u5B57\u4F53\u989C\u8272",
17150
+ name: "color",
17151
+ required: true,
17152
+ value: (_v = (_u = el == null ? void 0 : el.formInput) == null ? void 0 : _u.color) != null ? _v : "#000000"
17153
+ },
17154
+ {
17155
+ type: "select",
17156
+ label: "\u5B57\u4F53\u6837\u5F0F",
17157
+ name: "fontFamily",
17158
+ required: true,
17159
+ value: (_x = (_w = el == null ? void 0 : el.formInput) == null ? void 0 : _w.fontFamily) != null ? _x : "SimSun",
17160
+ options: editor.getExtensionParam("fontOptions") == void 0 || editor.getExtensionParam("fontOptions") == null ? [{ label: "SimSun", value: "SimSun" }] : editor.getExtensionParam("fontOptions")
17161
+ }
17162
+ ],
17163
+ onConfirm: (payload) => {
17164
+ var _a2, _b2, _c2, _d2, _e2, _f2, _g2, _h2, _i2, _j2, _k2, _l2;
17165
+ console.log("payload: ", payload);
17166
+ const key = (_a2 = payload.find((p) => p.name === "key")) == null ? void 0 : _a2.value;
17167
+ if (!key)
17168
+ return;
17169
+ const width = (_b2 = payload.find((p) => p.name === "width")) == null ? void 0 : _b2.value;
17170
+ if (!width)
17171
+ return;
17172
+ const height = (_c2 = payload.find((p) => p.name === "height")) == null ? void 0 : _c2.value;
17173
+ if (!height)
17174
+ return;
17175
+ const fontSize = (_d2 = payload.find((p) => p.name === "fontSize")) == null ? void 0 : _d2.value;
17176
+ const lineHeight = (_e2 = payload.find((p) => p.name === "lineHeight")) == null ? void 0 : _e2.value;
17177
+ const bold = ((_f2 = payload.find((p) => p.name === "bold")) == null ? void 0 : _f2.value) === "true";
17178
+ const italic = ((_g2 = payload.find((p) => p.name === "italic")) == null ? void 0 : _g2.value) === "true";
17179
+ const color = (_h2 = payload.find((p) => p.name === "color")) == null ? void 0 : _h2.value;
17180
+ const fontFamily = (_i2 = payload.find((p) => p.name === "fontFamily")) == null ? void 0 : _i2.value;
17181
+ const type = "input";
17182
+ const formInputKeys = editor.getExtensionParam("formInputKeys");
17183
+ const item = formInputKeys.find((item2) => item2.value === key);
17184
+ const elemProp = item ? JSON.stringify(item) : "";
17185
+ const txtFillType = (_j2 = payload.find((p) => p.name === "txtFillType")) == null ? void 0 : _j2.value;
17186
+ const txtRowAutoFlag = (_k2 = payload.find((p) => p.name === "txtRowAutoFlag")) == null ? void 0 : _k2.value;
17187
+ const txtEditFlag = (_l2 = payload.find((p) => p.name === "txtEditFlag")) == null ? void 0 : _l2.value;
17188
+ const formInput = {
17189
+ key,
17190
+ width,
17191
+ height,
17192
+ fontSize,
17193
+ bold,
17194
+ italic,
17195
+ color,
17196
+ fontFamily,
17197
+ type,
17198
+ txtFillType,
17199
+ txtRowAutoFlag,
17200
+ txtEditFlag,
17201
+ elemProp,
17202
+ lineHeight
17203
+ };
17204
+ const imageDataUrl = generateTextImage({
17205
+ text: key,
17206
+ width,
17207
+ height
17208
+ });
17209
+ const param = {
17210
+ "value": imageDataUrl,
17211
+ "type": ElementType.IMAGE,
17212
+ "formInput": formInput,
17213
+ "width": Number(width),
17214
+ "height": Number(height),
17215
+ "verticalAlign": "text-top"
17216
+ };
17217
+ if (el == null ? void 0 : el.id) {
17218
+ const deleteOpt = {
17219
+ id: el.id,
17220
+ properties: param
17221
+ };
17222
+ console.log("deleteOpt12", deleteOpt);
17223
+ editor.command.executeUpdateElementById(deleteOpt);
17224
+ return;
17225
+ }
17226
+ editor.command.executeInsertElementList([
17227
+ param
17228
+ ]);
17229
+ }
17230
+ });
17231
+ }
17232
+ function generateImagePropertiesImage(options) {
17233
+ const config = {
17234
+ key: "",
17235
+ width: 200,
17236
+ height: 150,
17237
+ picAutoFlag: false,
17238
+ picFillType: "default",
17239
+ borderColor: "#000000",
17240
+ borderWidth: 1,
17241
+ ...options
17242
+ };
17243
+ const canvas = document.createElement("canvas");
17244
+ const ctx = canvas.getContext("2d");
17245
+ canvas.width = config.width;
17246
+ canvas.height = config.height;
17247
+ ctx.clearRect(0, 0, canvas.width, canvas.height);
17248
+ ctx.fillStyle = "#ffffff";
17249
+ ctx.fillRect(0, 0, canvas.width, canvas.height);
17250
+ ctx.strokeStyle = config.borderColor;
17251
+ ctx.lineWidth = config.borderWidth;
17252
+ ctx.strokeRect(
17253
+ config.borderWidth / 2,
17254
+ config.borderWidth / 2,
17255
+ config.width - config.borderWidth,
17256
+ config.height - config.borderWidth
17257
+ );
17258
+ const iconSize = 60;
17259
+ const iconX = (config.width - iconSize) / 2;
17260
+ const iconY = config.height / 2 - iconSize / 2 - 10;
17261
+ ctx.strokeStyle = "#999999";
17262
+ ctx.lineWidth = 2;
17263
+ ctx.strokeRect(iconX, iconY, iconSize, iconSize);
17264
+ ctx.fillStyle = "#cccccc";
17265
+ ctx.beginPath();
17266
+ ctx.moveTo(iconX + 10, iconY + iconSize - 10);
17267
+ ctx.lineTo(iconX + iconSize / 2, iconY + 15);
17268
+ ctx.lineTo(iconX + iconSize - 10, iconY + iconSize - 10);
17269
+ ctx.closePath();
17270
+ ctx.fill();
17271
+ ctx.fillStyle = "#ffcc00";
17272
+ ctx.beginPath();
17273
+ ctx.arc(iconX + iconSize - 20, iconY + 15, 8, 0, Math.PI * 2);
17274
+ ctx.fill();
17275
+ if (config.key) {
17276
+ ctx.font = "14px SimSun";
17277
+ ctx.fillStyle = "#000000";
17278
+ ctx.textAlign = "center";
17279
+ ctx.textBaseline = "middle";
17280
+ ctx.fillText(config.key, config.width / 2, iconY + iconSize + 20);
17281
+ }
17282
+ if (config.picAutoFlag === "0") {
17283
+ ctx.font = "12px SimSun";
17284
+ ctx.fillStyle = "#5175f4";
17285
+ ctx.textAlign = "left";
17286
+ ctx.fillText("\u2713 \u81EA\u9002\u5E94", 10, config.height - 15);
17287
+ }
17288
+ const picFillTypeText = config.picFillType === "0" ? "\u9ED8\u8BA4\u5927\u5C0F" : config.picFillType === "1" ? "\u5206\u5272" : "\u987A\u5E8F";
17289
+ ctx.font = "12px SimSun";
17290
+ ctx.fillStyle = "#666666";
17291
+ ctx.textAlign = "right";
17292
+ ctx.fillText(`\u586B\u5145: ${picFillTypeText}`, config.width - 10, config.height - 15);
17293
+ return canvas.toDataURL("image/png");
17294
+ }
17295
+ function generateSignatureImage(options) {
17296
+ const config = {
17297
+ key: "",
17298
+ width: 200,
17299
+ height: 100,
17300
+ picAutoFlag: false,
17301
+ borderColor: "#000000",
17302
+ borderWidth: 1,
17303
+ ...options
17304
+ };
17305
+ const canvas = document.createElement("canvas");
17306
+ const ctx = canvas.getContext("2d");
17307
+ canvas.width = config.width;
17308
+ canvas.height = config.height;
17309
+ ctx.clearRect(0, 0, canvas.width, canvas.height);
17310
+ ctx.fillStyle = "#ffffff";
17311
+ ctx.fillRect(0, 0, canvas.width, canvas.height);
17312
+ ctx.strokeStyle = config.borderColor;
17313
+ ctx.lineWidth = config.borderWidth;
17314
+ ctx.strokeRect(
17315
+ config.borderWidth / 2,
17316
+ config.borderWidth / 2,
17317
+ config.width - config.borderWidth,
17318
+ config.height - config.borderWidth
17319
+ );
17320
+ const iconSize = 50;
17321
+ const iconX = (config.width - iconSize) / 2;
17322
+ const iconY = config.height / 2 - iconSize / 2 - 5;
17323
+ ctx.fillStyle = "#4a90e2";
17324
+ ctx.beginPath();
17325
+ ctx.moveTo(iconX + 10, iconY + iconSize);
17326
+ ctx.lineTo(iconX + iconSize - 10, iconY + 10);
17327
+ ctx.lineTo(iconX + iconSize, iconY + 15);
17328
+ ctx.lineTo(iconX + 15, iconY + iconSize + 5);
17329
+ ctx.closePath();
17330
+ ctx.fill();
17331
+ ctx.fillStyle = "#333333";
17332
+ ctx.beginPath();
17333
+ ctx.moveTo(iconX + 10, iconY + iconSize);
17334
+ ctx.lineTo(iconX + 15, iconY + iconSize + 5);
17335
+ ctx.lineTo(iconX + 5, iconY + iconSize + 8);
17336
+ ctx.closePath();
17337
+ ctx.fill();
17338
+ if (config.key) {
17339
+ ctx.font = "14px SimSun";
17340
+ ctx.fillStyle = "#000000";
17341
+ ctx.textAlign = "center";
17342
+ ctx.textBaseline = "middle";
17343
+ ctx.fillText(config.key, config.width / 2, iconY + iconSize + 20);
17344
+ }
17345
+ if (config.picAutoFlag === "0") {
17346
+ ctx.font = "12px SimSun";
17347
+ ctx.fillStyle = "#5175f4";
17348
+ ctx.textAlign = "left";
17349
+ ctx.fillText("\u2713 \u81EA\u9002\u5E94", 10, config.height - 15);
17350
+ }
17351
+ ctx.font = "12px SimSun";
17352
+ ctx.fillStyle = "#666666";
17353
+ ctx.textAlign = "right";
17354
+ ctx.fillText("\u7B7E\u5B57\u6846", config.width - 10, config.height - 15);
17355
+ return canvas.toDataURL("image/png");
17356
+ }
17357
+ function generateSealImage(options) {
17358
+ const config = {
17359
+ key: "",
17360
+ width: 200,
17361
+ height: 100,
17362
+ picAutoFlag: false,
17363
+ borderColor: "#000000",
17364
+ borderWidth: 1,
17365
+ ...options
17366
+ };
17367
+ const canvas = document.createElement("canvas");
17368
+ const ctx = canvas.getContext("2d");
17369
+ canvas.width = config.width;
17370
+ canvas.height = config.height;
17371
+ ctx.clearRect(0, 0, canvas.width, canvas.height);
17372
+ ctx.fillStyle = "#ffffff";
17373
+ ctx.fillRect(0, 0, canvas.width, canvas.height);
17374
+ ctx.strokeStyle = config.borderColor;
17375
+ ctx.lineWidth = config.borderWidth;
17376
+ ctx.strokeRect(
17377
+ config.borderWidth / 2,
17378
+ config.borderWidth / 2,
17379
+ config.width - config.borderWidth,
17380
+ config.height - config.borderWidth
17381
+ );
17382
+ const iconSize = 50;
17383
+ const iconX = (config.width - iconSize) / 2;
17384
+ const iconY = config.height / 2 - iconSize / 2 - 5;
17385
+ const centerX = iconX + iconSize / 2;
17386
+ const centerY = iconY + iconSize / 2;
17387
+ ctx.strokeStyle = "#e74c3c";
17388
+ ctx.lineWidth = 2.5;
17389
+ ctx.beginPath();
17390
+ ctx.arc(centerX, centerY, iconSize / 2 - 5, 0, Math.PI * 2);
17391
+ ctx.stroke();
17392
+ ctx.strokeStyle = "#e74c3c";
17393
+ ctx.lineWidth = 1.5;
17394
+ ctx.beginPath();
17395
+ ctx.arc(centerX, centerY, iconSize / 2 - 10, 0, Math.PI * 2);
17396
+ ctx.stroke();
17397
+ ctx.fillStyle = "#e74c3c";
17398
+ ctx.font = "bold 16px SimSun";
17399
+ ctx.textAlign = "center";
17400
+ ctx.textBaseline = "middle";
17401
+ ctx.fillText("\u7AE0", centerX, centerY);
17402
+ if (config.key) {
17403
+ ctx.font = "14px SimSun";
17404
+ ctx.fillStyle = "#000000";
17405
+ ctx.textAlign = "center";
17406
+ ctx.textBaseline = "middle";
17407
+ ctx.fillText(config.key, config.width / 2, iconY + iconSize + 20);
17408
+ }
17409
+ if (config.picAutoFlag === "0") {
17410
+ ctx.font = "12px SimSun";
17411
+ ctx.fillStyle = "#5175f4";
17412
+ ctx.textAlign = "left";
17413
+ ctx.fillText("\u2713 \u81EA\u9002\u5E94", 10, config.height - 15);
17414
+ }
17415
+ ctx.font = "12px SimSun";
17416
+ ctx.fillStyle = "#666666";
17417
+ ctx.textAlign = "right";
17418
+ ctx.fillText("\u7B7E\u7AE0\u6846", config.width - 10, config.height - 15);
17419
+ return canvas.toDataURL("image/png");
17420
+ }
17421
+ function generateRiskCopyImage(options) {
17422
+ const config = {
17423
+ key: "",
17424
+ width: 200,
17425
+ height: 100,
17426
+ riskCopyContent: "",
17427
+ borderColor: "#000000",
17428
+ borderWidth: 1,
17429
+ ...options
17430
+ };
17431
+ const canvas = document.createElement("canvas");
17432
+ const ctx = canvas.getContext("2d");
17433
+ canvas.width = config.width;
17434
+ canvas.height = config.height;
17435
+ ctx.clearRect(0, 0, canvas.width, canvas.height);
17436
+ ctx.fillStyle = "#ffffff";
17437
+ ctx.fillRect(0, 0, canvas.width, canvas.height);
17438
+ ctx.strokeStyle = config.borderColor;
17439
+ ctx.lineWidth = config.borderWidth;
17440
+ ctx.strokeRect(
17441
+ config.borderWidth / 2,
17442
+ config.borderWidth / 2,
17443
+ config.width - config.borderWidth,
17444
+ config.height - config.borderWidth
17445
+ );
17446
+ const iconSize = 50;
17447
+ const iconX = (config.width - iconSize) / 2;
17448
+ const iconY = config.height / 2 - iconSize / 2 - 5;
17449
+ ctx.strokeStyle = "#f39c12";
17450
+ ctx.lineWidth = 2;
17451
+ ctx.strokeRect(iconX + 5, iconY + 5, iconSize - 10, iconSize - 10);
17452
+ ctx.beginPath();
17453
+ ctx.moveTo(iconX + 10, iconY + 15);
17454
+ ctx.lineTo(iconX + iconSize - 10, iconY + 15);
17455
+ ctx.moveTo(iconX + 10, iconY + 25);
17456
+ ctx.lineTo(iconX + iconSize - 10, iconY + 25);
17457
+ ctx.moveTo(iconX + 10, iconY + 35);
17458
+ ctx.lineTo(iconX + iconSize - 20, iconY + 35);
17459
+ ctx.stroke();
17460
+ ctx.fillStyle = "#e74c3c";
17461
+ ctx.beginPath();
17462
+ ctx.moveTo(iconX + iconSize - 15, iconY + 5);
17463
+ ctx.lineTo(iconX + iconSize - 5, iconY + 20);
17464
+ ctx.lineTo(iconX + iconSize - 25, iconY + 20);
17465
+ ctx.closePath();
17466
+ ctx.fill();
17467
+ ctx.fillStyle = "#ffffff";
17468
+ ctx.font = "bold 12px Arial";
17469
+ ctx.textAlign = "center";
17470
+ ctx.textBaseline = "middle";
17471
+ ctx.fillText("!", iconX + iconSize - 15, iconY + 14);
17472
+ if (config.key) {
17473
+ ctx.font = "14px SimSun";
17474
+ ctx.fillStyle = "#000000";
17475
+ ctx.textAlign = "center";
17476
+ ctx.textBaseline = "middle";
17477
+ ctx.fillText(config.key, config.width / 2, iconY + iconSize + 20);
17478
+ }
17479
+ if (config.riskCopyContent) {
17480
+ ctx.font = "11px SimSun";
17481
+ ctx.fillStyle = "#666666";
17482
+ ctx.textAlign = "left";
17483
+ const previewText = config.riskCopyContent.length > 20 ? config.riskCopyContent.substring(0, 20) + "..." : config.riskCopyContent;
17484
+ ctx.fillText(previewText, 10, config.height - 30);
17485
+ }
17486
+ ctx.font = "12px SimSun";
17487
+ ctx.fillStyle = "#666666";
17488
+ ctx.textAlign = "right";
17489
+ ctx.fillText("\u98CE\u9669\u6284\u5F55", config.width - 10, config.height - 15);
17490
+ return canvas.toDataURL("image/png");
17491
+ }
17492
+ function formImagePropertiesConfigDialog(el, editor) {
17493
+ var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p;
17494
+ console.log("el", el);
17495
+ new Dialog({
17496
+ title: "\u56FE\u7247\u6846\u914D\u7F6E",
17497
+ data: [
17498
+ {
17499
+ type: "select",
17500
+ label: "\u5143\u7D20\u540D\u79F0",
17501
+ name: "key",
17502
+ required: true,
17503
+ value: (_b = (_a = el == null ? void 0 : el.formInput) == null ? void 0 : _a.key) != null ? _b : "",
17504
+ placeholder: "\u8BF7\u9009\u62E9\u5143\u7D20\u540D\u79F0",
17505
+ options: editor.getExtensionParam("picKeys") == void 0 || editor.getExtensionParam("picKeys") == null ? [] : editor.getExtensionParam("picKeys")
17506
+ },
17507
+ {
17508
+ type: "number",
17509
+ label: "\u5BBD\u5EA6 (px)",
17510
+ name: "width",
17511
+ required: true,
17512
+ placeholder: "\u8BF7\u8F93\u5165\u5BBD\u5EA6",
17513
+ value: (_d = (_c = el == null ? void 0 : el.formInput) == null ? void 0 : _c.width) != null ? _d : "200"
17514
+ },
17515
+ {
17516
+ type: "number",
17517
+ label: "\u9AD8\u5EA6 (px)",
17518
+ name: "height",
17519
+ required: true,
17520
+ placeholder: "\u8BF7\u8F93\u5165\u9AD8\u5EA6",
17521
+ value: (_f = (_e = el == null ? void 0 : el.formInput) == null ? void 0 : _e.height) != null ? _f : "150"
17522
+ },
17523
+ {
17524
+ type: "select",
17525
+ label: "\u662F\u5426\u81EA\u9002\u5E94",
17526
+ name: "picAutoFlag",
17527
+ required: false,
17528
+ value: (_h = (_g = el == null ? void 0 : el.formInput) == null ? void 0 : _g.picAutoFlag) != null ? _h : "1",
17529
+ options: [
17530
+ {
17531
+ label: "\u5426",
17532
+ value: "1"
17533
+ },
17534
+ {
17535
+ label: "\u662F",
17536
+ value: "0"
17537
+ }
17538
+ ]
17539
+ },
17540
+ {
17541
+ type: "select",
17542
+ label: "\u662F\u5426\u7F29\u653E\u56FE\u7247",
17543
+ name: "reduceSizeFlag",
17544
+ required: false,
17545
+ value: (_j = (_i = el == null ? void 0 : el.formInput) == null ? void 0 : _i.reduceSizeFlag) != null ? _j : "1",
17546
+ options: [
17547
+ {
17548
+ label: "\u5426",
17549
+ value: "1"
17550
+ },
17551
+ {
17552
+ label: "\u662F",
17553
+ value: "0"
17554
+ }
17555
+ ]
17556
+ },
17557
+ {
17558
+ type: "select",
17559
+ label: "\u56FE\u7247\u586B\u5145\u914D\u7F6E",
17560
+ name: "picFillType",
17561
+ required: true,
17562
+ value: (_l = (_k = el == null ? void 0 : el.formInput) == null ? void 0 : _k.picFillType) != null ? _l : "0",
17563
+ options: [
17564
+ {
17565
+ label: "\u9ED8\u8BA4\u5927\u5C0F",
17566
+ value: "0"
17567
+ },
17568
+ {
17569
+ label: "\u5206\u5272",
17570
+ value: "1"
17571
+ },
17572
+ {
17573
+ label: "\u987A\u5E8F",
17574
+ value: "2"
17575
+ }
17576
+ ]
17577
+ },
17578
+ {
17579
+ type: "number",
17580
+ label: "\u884C\u6570",
17581
+ name: "rowNum",
17582
+ required: false,
17583
+ placeholder: "\u8BF7\u8F93\u5165\u884C\u6570",
17584
+ value: (_n = (_m = el == null ? void 0 : el.formInput) == null ? void 0 : _m.rowNum) != null ? _n : "1"
17585
+ },
17586
+ {
17587
+ type: "number",
17588
+ label: "\u5217\u6570",
17589
+ name: "colNum",
17590
+ required: false,
17591
+ placeholder: "\u8BF7\u8F93\u5165\u5217\u6570",
17592
+ value: (_p = (_o = el == null ? void 0 : el.formInput) == null ? void 0 : _o.colNum) != null ? _p : "1"
17593
+ }
17594
+ ],
17595
+ onConfirm: (payload) => {
17596
+ var _a2, _b2, _c2, _d2, _e2, _f2, _g2, _h2;
17597
+ console.log("payload: ", payload);
17598
+ const key = (_a2 = payload.find((p) => p.name === "key")) == null ? void 0 : _a2.value;
17599
+ if (!key)
17600
+ return;
17601
+ const width = (_b2 = payload.find((p) => p.name === "width")) == null ? void 0 : _b2.value;
17602
+ if (!width)
17603
+ return;
17604
+ const height = (_c2 = payload.find((p) => p.name === "height")) == null ? void 0 : _c2.value;
17605
+ if (!height)
17606
+ return;
17607
+ const picAutoFlag = ((_d2 = payload.find((p) => p.name === "picAutoFlag")) == null ? void 0 : _d2.value) || "1";
17608
+ const picFillType = ((_e2 = payload.find((p) => p.name === "picFillType")) == null ? void 0 : _e2.value) || "0";
17609
+ const type = "image";
17610
+ const picKeys = editor.getExtensionParam("picKeys");
17611
+ if (!picKeys)
17612
+ return;
17613
+ const item = picKeys.find((item2) => item2.value === key);
17614
+ const elemProp = item ? JSON.stringify(item) : "";
17615
+ const reduceSizeFlag = ((_f2 = payload.find((p) => p.name === "reduceSizeFlag")) == null ? void 0 : _f2.value) || "1";
17616
+ const rowNum = ((_g2 = payload.find((p) => p.name === "rowNum")) == null ? void 0 : _g2.value) || "1";
17617
+ const colNum = ((_h2 = payload.find((p) => p.name === "colNum")) == null ? void 0 : _h2.value) || "1";
17618
+ const formInput = {
17619
+ key,
17620
+ width,
17621
+ height,
17622
+ type,
17623
+ picAutoFlag,
17624
+ picFillType,
17625
+ elemProp,
17626
+ reduceSizeFlag,
17627
+ rowNum,
17628
+ colNum
17629
+ };
17630
+ const imageDataUrl = generateImagePropertiesImage({
17631
+ key,
17632
+ width: Number(width),
17633
+ height: Number(height),
17634
+ picAutoFlag,
17635
+ picFillType
17636
+ });
17637
+ const param = {
17638
+ value: imageDataUrl,
17639
+ type: ElementType.IMAGE,
17640
+ formInput,
17641
+ width: Number(width),
17642
+ height: Number(height)
17643
+ };
17644
+ if (el == null ? void 0 : el.id) {
17645
+ const updateOpt = {
17646
+ id: el.id,
17647
+ properties: param
17648
+ };
17649
+ console.log("updateOpt", updateOpt);
17650
+ editor.command.executeUpdateElementById(updateOpt);
17651
+ return;
17652
+ }
17653
+ editor.command.executeInsertElementList([param]);
17654
+ }
17655
+ });
17656
+ }
17657
+ function formSignatureConfigDialog(el, editor) {
17658
+ var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j;
17659
+ console.log("el", el);
17660
+ new Dialog({
17661
+ title: "\u7B7E\u5B57\u6846\u914D\u7F6E",
17662
+ data: [
17663
+ {
17664
+ type: "select",
17665
+ label: "\u5143\u7D20\u540D\u79F0",
17666
+ name: "key",
17667
+ required: true,
17668
+ value: (_b = (_a = el == null ? void 0 : el.formInput) == null ? void 0 : _a.key) != null ? _b : "",
17669
+ placeholder: "\u8BF7\u9009\u62E9\u5143\u7D20\u540D\u79F0",
17670
+ options: editor.getExtensionParam("signPicKeys") == void 0 || editor.getExtensionParam("signPicKeys") == null ? [] : editor.getExtensionParam("signPicKeys")
17671
+ },
17672
+ {
17673
+ type: "number",
17674
+ label: "\u5BBD\u5EA6 (px)",
17675
+ name: "width",
17676
+ required: true,
17677
+ placeholder: "\u8BF7\u8F93\u5165\u5BBD\u5EA6",
17678
+ value: (_d = (_c = el == null ? void 0 : el.formInput) == null ? void 0 : _c.width) != null ? _d : "200"
17679
+ },
17680
+ {
17681
+ type: "number",
17682
+ label: "\u9AD8\u5EA6 (px)",
17683
+ name: "height",
17684
+ required: true,
17685
+ placeholder: "\u8BF7\u8F93\u5165\u9AD8\u5EA6",
17686
+ value: (_f = (_e = el == null ? void 0 : el.formInput) == null ? void 0 : _e.height) != null ? _f : "100"
17687
+ },
17688
+ {
17689
+ type: "select",
17690
+ label: "\u662F\u5426\u81EA\u9002\u5E94",
17691
+ name: "picAutoFlag",
17692
+ required: false,
17693
+ value: (_h = (_g = el == null ? void 0 : el.formInput) == null ? void 0 : _g.picAutoFlag) != null ? _h : "1",
17694
+ options: [
17695
+ {
17696
+ label: "\u5426",
17697
+ value: "1"
17698
+ },
17699
+ {
17700
+ label: "\u662F",
17701
+ value: "0"
17702
+ }
17703
+ ]
17704
+ },
17705
+ {
17706
+ type: "select",
17707
+ label: "\u662F\u5426\u7F29\u653E",
17708
+ name: "reduceSizeFlag",
17709
+ required: false,
17710
+ value: (_j = (_i = el == null ? void 0 : el.formInput) == null ? void 0 : _i.reduceSizeFlag) != null ? _j : "1",
17711
+ options: [
17712
+ {
17713
+ label: "\u5426",
17714
+ value: "1"
17715
+ },
17716
+ {
17717
+ label: "\u662F",
17718
+ value: "0"
17719
+ }
17720
+ ]
17721
+ }
17722
+ ],
17723
+ onConfirm: (payload) => {
17724
+ var _a2, _b2, _c2, _d2, _e2;
17725
+ console.log("payload: ", payload);
17726
+ const key = (_a2 = payload.find((p) => p.name === "key")) == null ? void 0 : _a2.value;
17727
+ if (!key)
17728
+ return;
17729
+ const width = (_b2 = payload.find((p) => p.name === "width")) == null ? void 0 : _b2.value;
17730
+ if (!width)
17731
+ return;
17732
+ const height = (_c2 = payload.find((p) => p.name === "height")) == null ? void 0 : _c2.value;
17733
+ if (!height)
17734
+ return;
17735
+ const picAutoFlag = ((_d2 = payload.find((p) => p.name === "picAutoFlag")) == null ? void 0 : _d2.value) || "1";
17736
+ const type = "signature";
17737
+ const signPicKeys = editor.getExtensionParam("signPicKeys");
17738
+ const item = signPicKeys.find((item2) => item2.value === key);
17739
+ const elemProp = item ? JSON.stringify(item) : "";
17740
+ const reduceSizeFlag = ((_e2 = payload.find((p) => p.name === "reduceSizeFlag")) == null ? void 0 : _e2.value) || "1";
17741
+ const formInput = {
17742
+ key,
17743
+ width,
17744
+ height,
17745
+ type,
17746
+ picAutoFlag,
17747
+ elemProp,
17748
+ reduceSizeFlag
17749
+ };
17750
+ const imageDataUrl = generateSignatureImage({
17751
+ key,
17752
+ width: Number(width),
17753
+ height: Number(height),
17754
+ picAutoFlag
17755
+ });
17756
+ const param = {
17757
+ value: imageDataUrl,
17758
+ type: ElementType.IMAGE,
17759
+ formInput,
17760
+ width: Number(width),
17761
+ height: Number(height)
17762
+ };
17763
+ if (el == null ? void 0 : el.id) {
17764
+ const updateOpt = {
17765
+ id: el.id,
17766
+ properties: param
17767
+ };
17768
+ console.log("updateOpt", updateOpt);
17769
+ editor.command.executeUpdateElementById(updateOpt);
17770
+ return;
17771
+ }
17772
+ editor.command.executeInsertElementList([param]);
17773
+ }
17774
+ });
17775
+ }
17776
+ function formSealConfigDialog(el, editor) {
17777
+ var _a, _b, _c, _d, _e, _f, _g, _h;
17778
+ console.log("el", el);
17779
+ new Dialog({
17780
+ title: "\u7B7E\u7AE0\u6846\u914D\u7F6E",
17781
+ data: [
17782
+ {
17783
+ type: "select",
17784
+ label: "\u5143\u7D20\u540D\u79F0",
17785
+ name: "key",
17786
+ required: true,
17787
+ value: (_b = (_a = el == null ? void 0 : el.formInput) == null ? void 0 : _a.key) != null ? _b : "",
17788
+ placeholder: "\u8BF7\u9009\u62E9\u5143\u7D20\u540D\u79F0",
17789
+ options: editor.getExtensionParam("sealPicKeys") == void 0 || editor.getExtensionParam("sealPicKeys") == null ? [] : editor.getExtensionParam("sealPicKeys")
17790
+ },
17791
+ {
17792
+ type: "number",
17793
+ label: "\u5BBD\u5EA6 (px)",
17794
+ name: "width",
17795
+ required: true,
17796
+ placeholder: "\u8BF7\u8F93\u5165\u5BBD\u5EA6",
17797
+ value: (_d = (_c = el == null ? void 0 : el.formInput) == null ? void 0 : _c.width) != null ? _d : "200"
17798
+ },
17799
+ {
17800
+ type: "number",
17801
+ label: "\u9AD8\u5EA6 (px)",
17802
+ name: "height",
17803
+ required: true,
17804
+ placeholder: "\u8BF7\u8F93\u5165\u9AD8\u5EA6",
17805
+ value: (_f = (_e = el == null ? void 0 : el.formInput) == null ? void 0 : _e.height) != null ? _f : "100"
17806
+ },
17807
+ {
17808
+ type: "select",
17809
+ label: "\u662F\u5426\u81EA\u9002\u5E94",
17810
+ name: "picAutoFlag",
17811
+ required: false,
17812
+ value: (_h = (_g = el == null ? void 0 : el.formInput) == null ? void 0 : _g.picAutoFlag) != null ? _h : "1",
17813
+ options: [
17814
+ {
17815
+ label: "\u5426",
17816
+ value: "1"
17817
+ },
17818
+ {
17819
+ label: "\u662F",
17820
+ value: "0"
17821
+ }
17822
+ ]
17823
+ }
17824
+ ],
17825
+ onConfirm: (payload) => {
17826
+ var _a2, _b2, _c2, _d2;
17827
+ console.log("payload: ", payload);
17828
+ const key = (_a2 = payload.find((p) => p.name === "key")) == null ? void 0 : _a2.value;
17829
+ if (!key)
17830
+ return;
17831
+ const width = (_b2 = payload.find((p) => p.name === "width")) == null ? void 0 : _b2.value;
17832
+ if (!width)
17833
+ return;
17834
+ const height = (_c2 = payload.find((p) => p.name === "height")) == null ? void 0 : _c2.value;
17835
+ if (!height)
17836
+ return;
17837
+ const picAutoFlag = ((_d2 = payload.find((p) => p.name === "picAutoFlag")) == null ? void 0 : _d2.value) || "1";
17838
+ const type = "seal";
17839
+ const sealPicKeys = editor.getExtensionParam("sealPicKeys");
17840
+ const item = sealPicKeys.find((item2) => item2.value === key);
17841
+ const elemProp = item ? JSON.stringify(item) : "";
17842
+ const formInput = {
17843
+ key,
17844
+ width,
17845
+ height,
17846
+ type,
17847
+ picAutoFlag,
17848
+ elemProp
17849
+ };
17850
+ const imageDataUrl = generateSealImage({
17851
+ key,
17852
+ width: Number(width),
17853
+ height: Number(height),
17854
+ picAutoFlag
17855
+ });
17856
+ const param = {
17857
+ value: imageDataUrl,
17858
+ type: ElementType.IMAGE,
17859
+ formInput,
17860
+ width: Number(width),
17861
+ height: Number(height)
17862
+ };
17863
+ if (el == null ? void 0 : el.id) {
17864
+ const updateOpt = {
17865
+ id: el.id,
17866
+ properties: param
17867
+ };
17868
+ console.log("updateOpt", updateOpt);
17869
+ editor.command.executeUpdateElementById(updateOpt);
17870
+ return;
17871
+ }
17872
+ editor.command.executeInsertElementList([param]);
17873
+ }
17874
+ });
17875
+ }
17876
+ function formRiskCopyConfigDialog(el, editor) {
17877
+ var _a, _b, _c, _d, _e, _f, _g, _h;
17878
+ console.log("el", el);
17879
+ new Dialog({
17880
+ title: "\u98CE\u9669\u6284\u5F55\u6846\u914D\u7F6E",
17881
+ data: [
17882
+ {
17883
+ type: "select",
17884
+ label: "\u5143\u7D20\u540D\u79F0",
17885
+ name: "key",
17886
+ required: true,
17887
+ value: (_b = (_a = el == null ? void 0 : el.formInput) == null ? void 0 : _a.key) != null ? _b : "",
17888
+ placeholder: "\u8BF7\u9009\u62E9\u5143\u7D20\u540D\u79F0",
17889
+ options: editor.getExtensionParam("riskCopyKeys") == void 0 || editor.getExtensionParam("riskCopyKeys") == null ? [] : editor.getExtensionParam("riskCopyKeys")
17890
+ },
17891
+ {
17892
+ type: "number",
17893
+ label: "\u5BBD\u5EA6 (px)",
17894
+ name: "width",
17895
+ required: true,
17896
+ placeholder: "\u8BF7\u8F93\u5165\u5BBD\u5EA6",
17897
+ value: (_d = (_c = el == null ? void 0 : el.formInput) == null ? void 0 : _c.width) != null ? _d : "200"
17898
+ },
17899
+ {
17900
+ type: "number",
17901
+ label: "\u9AD8\u5EA6 (px)",
17902
+ name: "height",
16298
17903
  required: true,
16299
- value: (_t = (_s = el == null ? void 0 : el.formInput) == null ? void 0 : _s.color) != null ? _t : "#000000"
17904
+ placeholder: "\u8BF7\u8F93\u5165\u9AD8\u5EA6",
17905
+ value: (_f = (_e = el == null ? void 0 : el.formInput) == null ? void 0 : _e.height) != null ? _f : "100"
16300
17906
  },
16301
17907
  {
16302
- type: "select",
16303
- label: "\u5B57\u4F53\u6837\u5F0F",
16304
- name: "fontFamily",
16305
- required: true,
16306
- value: (_v = (_u = el == null ? void 0 : el.formInput) == null ? void 0 : _u.fontFamily) != null ? _v : "SimSun",
16307
- options: editor.getExtensionParam("fontOptions") == void 0 || editor.getExtensionParam("fontOptions") == null ? [{ label: "SimSun", value: "SimSun" }] : editor.getExtensionParam("fontOptions")
17908
+ type: "textarea",
17909
+ label: "\u98CE\u9669\u6284\u5F55\u5185\u5BB9",
17910
+ name: "riskCopyContent",
17911
+ required: false,
17912
+ placeholder: "\u8BF7\u8F93\u5165\u98CE\u9669\u6284\u5F55\u5185\u5BB9",
17913
+ value: (_h = (_g = el == null ? void 0 : el.formInput) == null ? void 0 : _g.riskCopyContent) != null ? _h : ""
16308
17914
  }
16309
17915
  ],
16310
17916
  onConfirm: (payload) => {
16311
- var _a2, _b2, _c2, _d2, _e2, _f2, _g2, _h2, _i2, _j2, _k2;
17917
+ var _a2, _b2, _c2, _d2;
16312
17918
  console.log("payload: ", payload);
16313
17919
  const key = (_a2 = payload.find((p) => p.name === "key")) == null ? void 0 : _a2.value;
16314
17920
  if (!key)
@@ -16319,56 +17925,42 @@ function formInputPropertiesConfigDialog(el, editor) {
16319
17925
  const height = (_c2 = payload.find((p) => p.name === "height")) == null ? void 0 : _c2.value;
16320
17926
  if (!height)
16321
17927
  return;
16322
- const fontSize = (_d2 = payload.find((p) => p.name === "fontSize")) == null ? void 0 : _d2.value;
16323
- const bold = ((_e2 = payload.find((p) => p.name === "bold")) == null ? void 0 : _e2.value) === "true";
16324
- const italic = ((_f2 = payload.find((p) => p.name === "italic")) == null ? void 0 : _f2.value) === "true";
16325
- const color = (_g2 = payload.find((p) => p.name === "color")) == null ? void 0 : _g2.value;
16326
- const fontFamily = (_h2 = payload.find((p) => p.name === "fontFamily")) == null ? void 0 : _h2.value;
16327
- const type = "input";
16328
- const formInputKeys = editor.getExtensionParam("formInputKeys");
16329
- const elemProp = formInputKeys.find((kel2) => kel2.value === key) ? JSON.parse(kel) : "";
16330
- const txtFillType = (_i2 = payload.find((p) => p.name === "txtFillType")) == null ? void 0 : _i2.value;
16331
- const txtRowAutoFlag = (_j2 = payload.find((p) => p.name === "txtRowAutoFlag")) == null ? void 0 : _j2.value;
16332
- const txtEditFlag = (_k2 = payload.find((p) => p.name === "txtEditFlag")) == null ? void 0 : _k2.value;
17928
+ const riskCopyContent = ((_d2 = payload.find((p) => p.name === "riskCopyContent")) == null ? void 0 : _d2.value) || "";
17929
+ const type = "riskCopy";
17930
+ const riskCopyKeys = editor.getExtensionParam("riskCopyKeys");
17931
+ const item = riskCopyKeys.find((item2) => item2.value === key);
17932
+ const elemProp = item ? JSON.stringify(item) : "";
16333
17933
  const formInput = {
16334
17934
  key,
16335
17935
  width,
16336
17936
  height,
16337
- fontSize,
16338
- bold,
16339
- italic,
16340
- color,
16341
- fontFamily,
16342
17937
  type,
16343
- txtFillType,
16344
- txtRowAutoFlag,
16345
- txtEditFlag,
17938
+ riskCopyContent,
16346
17939
  elemProp
16347
17940
  };
16348
- const imageDataUrl = generateTextImage({
16349
- text: key,
16350
- width,
16351
- height
17941
+ const imageDataUrl = generateRiskCopyImage({
17942
+ key,
17943
+ width: Number(width),
17944
+ height: Number(height),
17945
+ riskCopyContent
16352
17946
  });
16353
17947
  const param = {
16354
- "value": imageDataUrl,
16355
- "type": ElementType.IMAGE,
16356
- "formInput": formInput,
16357
- "width": Number(width),
16358
- "height": Number(height)
17948
+ value: imageDataUrl,
17949
+ type: ElementType.IMAGE,
17950
+ formInput,
17951
+ width: Number(width),
17952
+ height: Number(height)
16359
17953
  };
16360
17954
  if (el == null ? void 0 : el.id) {
16361
- const deleteOpt = {
17955
+ const updateOpt = {
16362
17956
  id: el.id,
16363
17957
  properties: param
16364
17958
  };
16365
- console.log("deleteOpt12", deleteOpt);
16366
- editor.command.executeUpdateElementById(deleteOpt);
17959
+ console.log("updateOpt", updateOpt);
17960
+ editor.command.executeUpdateElementById(updateOpt);
16367
17961
  return;
16368
17962
  }
16369
- editor.command.executeInsertElementList([
16370
- param
16371
- ]);
17963
+ editor.command.executeInsertElementList([param]);
16372
17964
  }
16373
17965
  });
16374
17966
  }
@@ -16477,23 +18069,6 @@ class Previewer {
16477
18069
  const cursor = window.getComputedStyle(target).cursor;
16478
18070
  document.body.style.cursor = cursor;
16479
18071
  this.canvas.style.cursor = cursor;
16480
- if (this.curElement.formInput) {
16481
- console.log("this.curElement.formInput", this.curElement.formInput);
16482
- console.log("this.curElement.formInput.type", this.curElement.formInput.type);
16483
- this.curElement.formInput.width = `${this.curElement.width * scale}`;
16484
- this.curElement.formInput.height = `${this.curElement.height * scale}`;
16485
- if (this.curElement.formInput.type == "checkbox") {
16486
- this.curElementSrc = generateCheckboxImage(this.curElement.formInput);
16487
- } else if (this.curElement.formInput.type == "radio") {
16488
- this.curElementSrc = generateRadioImage(this.curElement.formInput);
16489
- } else {
16490
- this.curElementSrc = generateTextImage({
16491
- text: this.curElement.formInput.key,
16492
- width: this.curElement.formInput.width,
16493
- height: this.curElement.formInput.height
16494
- });
16495
- }
16496
- }
16497
18072
  console.log(this.curElement);
16498
18073
  this.resizerImage.src = this.curElementSrc;
16499
18074
  this.resizerImageContainer.style.display = "block";
@@ -16516,6 +18091,14 @@ class Previewer {
16516
18091
  this.curElementSrc = generateCheckboxImage(this.curElement.formInput);
16517
18092
  } else if (this.curElement.formInput.type == "radio") {
16518
18093
  this.curElementSrc = generateRadioImage(this.curElement.formInput);
18094
+ } else if (this.curElement.formInput.type == "image") {
18095
+ this.curElementSrc = generateImagePropertiesImage(this.curElement.formInput);
18096
+ } else if (this.curElement.formInput.type == "signature") {
18097
+ this.curElementSrc = generateSignatureImage(this.curElement.formInput);
18098
+ } else if (this.curElement.formInput.type == "seal") {
18099
+ this.curElementSrc = generateSealImage(this.curElement.formInput);
18100
+ } else if (this.curElement.formInput.type == "riskCopy") {
18101
+ this.curElementSrc = generateRiskCopyImage(this.curElement.formInput);
16519
18102
  } else {
16520
18103
  this.curElementSrc = generateTextImage({
16521
18104
  text: this.curElement.formInput.key,
@@ -20568,19 +22151,10 @@ class Draw {
20568
22151
  return el.actualSize || el.size || this.options.defaultSize;
20569
22152
  }
20570
22153
  getElementRowMargin(el) {
20571
- var _a;
20572
- const { defaultSize, defaultBasicRowMarginHeight, defaultRowMargin, scale } = this.options;
20573
- const fontSize = el.size || defaultSize;
20574
- let ratio = 1;
20575
- if (fontSize < 12) {
20576
- ratio = fontSize / 12;
20577
- } else if (fontSize > 30) {
20578
- ratio = 1 + (fontSize - 30) / 30;
20579
- }
20580
- return defaultBasicRowMarginHeight * ratio * ((_a = el.rowMargin) != null ? _a : defaultRowMargin) * scale;
22154
+ return computeElementRowMarginPx(el, this.options);
20581
22155
  }
20582
22156
  computeRowList(payload) {
20583
- var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u, _v;
22157
+ var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y;
20584
22158
  const { innerWidth, elementList, isPagingMode = false, isFromTable = false, startX = 0, startY = 0, pageHeight = 0, mainOuterHeight = 0, surroundElementList = [] } = payload;
20585
22159
  const { defaultSize, scale, imgCaption, table: { tdPadding, defaultTrMinHeight }, defaultTabWidth } = this.options;
20586
22160
  const defaultBasicRowMarginHeight = this.getDefaultBasicRowMarginHeight();
@@ -20605,6 +22179,11 @@ class Draw {
20605
22179
  let listId;
20606
22180
  let listIndex = 0;
20607
22181
  let controlRealWidth = 0;
22182
+ const getParagraphOffsetX = (el, isFirstLine) => {
22183
+ const marginLeft = el.marginLeft || 0;
22184
+ const textIndent = isFirstLine ? el.textIndent || 0 : 0;
22185
+ return (marginLeft + textIndent) * scale;
22186
+ };
20608
22187
  for (let i = 0; i < elementList.length; i++) {
20609
22188
  const curRow = rowList[rowList.length - 1];
20610
22189
  const element = elementList[i];
@@ -20615,8 +22194,17 @@ class Draw {
20615
22194
  boundingBoxAscent: 0,
20616
22195
  boundingBoxDescent: 0
20617
22196
  };
22197
+ if (curRow.offsetX === void 0 && !element.listId && (element.marginLeft || element.textIndent || element.marginRight || element.marginTop)) {
22198
+ const preElement2 = elementList[i - 1];
22199
+ const isFirstLine = i === 0 || (preElement2 == null ? void 0 : preElement2.value) === ZERO || (preElement2 == null ? void 0 : preElement2.type) === ElementType.PAGE_BREAK;
22200
+ curRow.offsetX = getParagraphOffsetX(element, isFirstLine);
22201
+ if (isFirstLine && element.marginTop) {
22202
+ curRow.offsetY = (curRow.offsetY || 0) + element.marginTop * scale;
22203
+ }
22204
+ }
20618
22205
  const offsetX = curRow.offsetX || element.listId && listStyleMap.get(element.listId) || 0;
20619
- const availableWidth = innerWidth - offsetX;
22206
+ const marginRight = (element.marginRight || 0) * scale;
22207
+ const availableWidth = innerWidth - offsetX - marginRight;
20620
22208
  const isStartElement = curRow.elementList.length === 1;
20621
22209
  x += isStartElement ? offsetX : 0;
20622
22210
  y += isStartElement ? curRow.offsetY || 0 : 0;
@@ -20859,7 +22447,7 @@ class Draw {
20859
22447
  } else if (element.type === ElementType.PAGE_BREAK) {
20860
22448
  element.width = availableWidth / scale;
20861
22449
  metrics.width = availableWidth;
20862
- metrics.height = defaultSize;
22450
+ metrics.height = this.options.pageBreak.visible ? defaultSize : 0;
20863
22451
  } else if (element.type === ElementType.RADIO || element.controlComponent === ControlComponent.RADIO) {
20864
22452
  const { width, height: height2, gap } = this.options.radio;
20865
22453
  const elementWidth = width + gap * 2;
@@ -20907,6 +22495,9 @@ class Draw {
20907
22495
  if (element.letterSpacing) {
20908
22496
  metrics.width += element.letterSpacing * scale;
20909
22497
  }
22498
+ if (element.wordSpacing) {
22499
+ metrics.width += element.wordSpacing * scale;
22500
+ }
20910
22501
  const basisMetrics = this.textParticle.measureBasisWord(ctx, element.font);
20911
22502
  metrics.boundingBoxAscent = basisMetrics.actualBoundingBoxAscent * scale;
20912
22503
  metrics.boundingBoxDescent = basisMetrics.actualBoundingBoxDescent * scale;
@@ -20916,8 +22507,8 @@ class Draw {
20916
22507
  metrics.boundingBoxDescent += metrics.height / 2;
20917
22508
  }
20918
22509
  }
20919
- const ascent = !element.hide && (element.imgDisplay !== ImageDisplay.INLINE && element.type === ElementType.IMAGE || element.type === ElementType.LATEX) ? metrics.height + rowMargin : metrics.boundingBoxAscent + rowMargin;
20920
- const height = rowMargin + metrics.boundingBoxAscent + metrics.boundingBoxDescent + rowMargin;
22510
+ const ascent = element.type === ElementType.IMAGE && (element.imgDisplay === ImageDisplay.SURROUND || element.imgDisplay === ImageDisplay.FLOAT_TOP || element.imgDisplay === ImageDisplay.FLOAT_BOTTOM) ? 0 : !element.hide && (element.imgDisplay !== ImageDisplay.INLINE && element.type === ElementType.IMAGE || element.type === ElementType.LATEX) ? metrics.height + rowMargin : metrics.boundingBoxAscent + rowMargin;
22511
+ const height = element.type === ElementType.IMAGE && (element.imgDisplay === ImageDisplay.SURROUND || element.imgDisplay === ImageDisplay.FLOAT_TOP || element.imgDisplay === ImageDisplay.FLOAT_BOTTOM) ? 0 : rowMargin + metrics.boundingBoxAscent + metrics.boundingBoxDescent + rowMargin;
20921
22512
  const rowElement = Object.assign(element, {
20922
22513
  metrics,
20923
22514
  left: 0,
@@ -20990,10 +22581,10 @@ class Draw {
20990
22581
  elementList: [rowElement],
20991
22582
  ascent,
20992
22583
  rowIndex: curRow.rowIndex + 1,
20993
- rowFlex: ((_p = elementList[i]) == null ? void 0 : _p.rowFlex) || ((_q = elementList[i + 1]) == null ? void 0 : _q.rowFlex),
22584
+ rowFlex: element.value === ZERO ? (_r = (_p = elementList[i + 1]) == null ? void 0 : _p.rowFlex) != null ? _r : (_q = elementList[i]) == null ? void 0 : _q.rowFlex : ((_s = elementList[i]) == null ? void 0 : _s.rowFlex) || ((_t = elementList[i + 1]) == null ? void 0 : _t.rowFlex),
20994
22585
  isPageBreak: element.type === ElementType.PAGE_BREAK
20995
22586
  };
20996
- if (rowElement.controlComponent !== ControlComponent.PREFIX && ((_r = rowElement.control) == null ? void 0 : _r.indentation) === ControlIndentation.VALUE_START) {
22587
+ if (rowElement.controlComponent !== ControlComponent.PREFIX && ((_u = rowElement.control) == null ? void 0 : _u.indentation) === ControlIndentation.VALUE_START) {
20997
22588
  const preStartIndex = curRow.elementList.findIndex((el) => el.controlId === rowElement.controlId && el.controlComponent !== ControlComponent.PREFIX);
20998
22589
  if (~preStartIndex) {
20999
22590
  const preRowPositionList = this.position.computeRowPosition({
@@ -21010,12 +22601,17 @@ class Draw {
21010
22601
  row.isList = true;
21011
22602
  row.offsetX = listStyleMap.get(element.listId);
21012
22603
  row.listIndex = listIndex;
22604
+ } else if (element.marginLeft || element.textIndent || element.marginRight) {
22605
+ row.offsetX = getParagraphOffsetX(element, isForceBreak);
22606
+ }
22607
+ row.offsetY = !isFromTable && ((_v = element.area) == null ? void 0 : _v.top) && element.areaId !== ((_w = elementList[i - 1]) == null ? void 0 : _w.areaId) ? element.area.top * scale : 0;
22608
+ if (isForceBreak && element.marginTop) {
22609
+ row.offsetY = (row.offsetY || 0) + element.marginTop * scale;
21013
22610
  }
21014
- row.offsetY = !isFromTable && ((_s = element.area) == null ? void 0 : _s.top) && element.areaId !== ((_t = elementList[i - 1]) == null ? void 0 : _t.areaId) ? element.area.top * scale : 0;
21015
22611
  rowList.push(row);
21016
22612
  } else {
21017
22613
  curRow.width += metrics.width;
21018
- if (i === 0 && (getIsBlockElement(elementList[1]) || !!((_u = elementList[1]) == null ? void 0 : _u.areaId))) {
22614
+ if (i === 0 && (getIsBlockElement(elementList[1]) || !!((_x = elementList[1]) == null ? void 0 : _x.areaId))) {
21019
22615
  curRow.height = defaultBasicRowMarginHeight;
21020
22616
  curRow.ascent = defaultBasicRowMarginHeight;
21021
22617
  } else if (curRow.height < height) {
@@ -21026,8 +22622,18 @@ class Draw {
21026
22622
  }
21027
22623
  if (isWrap || i === elementList.length - 1) {
21028
22624
  curRow.isWidthNotEnough = isWidthNotEnough && !isForceBreak;
22625
+ let rowMinHeight = 0;
22626
+ for (let e = 0; e < curRow.elementList.length; e++) {
22627
+ const el = curRow.elementList[e];
22628
+ const mh = (el.minHeight || 0) * scale;
22629
+ if (mh > rowMinHeight)
22630
+ rowMinHeight = mh;
22631
+ }
22632
+ if (rowMinHeight > curRow.height) {
22633
+ curRow.height = rowMinHeight;
22634
+ }
21029
22635
  if (!curRow.isSurround && ((preElement == null ? void 0 : preElement.rowFlex) === RowFlex.JUSTIFY || (preElement == null ? void 0 : preElement.rowFlex) === RowFlex.ALIGNMENT && curRow.isWidthNotEnough)) {
21030
- const rowElementList = ((_v = curRow.elementList[0]) == null ? void 0 : _v.value) === ZERO ? curRow.elementList.slice(1) : curRow.elementList;
22636
+ const rowElementList = ((_y = curRow.elementList[0]) == null ? void 0 : _y.value) === ZERO ? curRow.elementList.slice(1) : curRow.elementList;
21031
22637
  const gap = (availableWidth - curRow.width) / (rowElementList.length - 1);
21032
22638
  for (let e = 0; e < rowElementList.length - 1; e++) {
21033
22639
  const el = rowElementList[e];
@@ -21161,14 +22767,15 @@ class Draw {
21161
22767
  for (let j = 0; j < curRow.elementList.length; j++) {
21162
22768
  const element = curRow.elementList[j];
21163
22769
  const metrics = element.metrics;
21164
- const { ascent: offsetY, coordinate: { leftTop: [x, y] } } = positionList[curRow.startIndex + j];
22770
+ const { coordinate: { leftTop: [x, y] } } = positionList[curRow.startIndex + j];
22771
+ const offsetY = 17;
21165
22772
  const preElement = curRow.elementList[j - 1];
21166
22773
  if ((element.hide || ((_a = element.control) == null ? void 0 : _a.hide) || ((_b = element.area) == null ? void 0 : _b.hide)) && !this.isDesignMode()) {
21167
22774
  this.textParticle.complete();
21168
22775
  } else if (element.type === ElementType.IMAGE) {
21169
22776
  this.textParticle.complete();
21170
22777
  if (element.imgDisplay !== ImageDisplay.SURROUND && element.imgDisplay !== ImageDisplay.FLOAT_TOP && element.imgDisplay !== ImageDisplay.FLOAT_BOTTOM) {
21171
- this.imageParticle.render(ctx, element, x, y + offsetY);
22778
+ this.imageParticle.render(ctx, element, x, y + 4);
21172
22779
  }
21173
22780
  } else if (element.type === ElementType.LATEX) {
21174
22781
  this.textParticle.complete();
@@ -21205,7 +22812,7 @@ class Draw {
21205
22812
  } else if (element.type === ElementType.SEPARATOR) {
21206
22813
  this.separatorParticle.render(ctx, element, x, y);
21207
22814
  } else if (element.type === ElementType.PAGE_BREAK) {
21208
- if (this.mode !== EditorMode.CLEAN && !isPrintMode) {
22815
+ if (this.mode !== EditorMode.CLEAN && !isPrintMode && this.options.pageBreak.visible) {
21209
22816
  this.pageBreakParticle.render(ctx, element, x, y);
21210
22817
  }
21211
22818
  } else if (element.type === ElementType.CHECKBOX || element.controlComponent === ControlComponent.CHECKBOX) {
@@ -21239,7 +22846,7 @@ class Draw {
21239
22846
  this.textParticle.complete();
21240
22847
  }
21241
22848
  this.textParticle.record(ctx, element, x, y + offsetY);
21242
- if (element.width || element.letterSpacing || PUNCTUATION_REG.test(element.value)) {
22849
+ if (element.width || element.letterSpacing || element.wordSpacing || PUNCTUATION_REG.test(element.value)) {
21243
22850
  this.textParticle.complete();
21244
22851
  }
21245
22852
  }
@@ -21694,6 +23301,7 @@ class Command {
21694
23301
  this.executeList = adapt.list.bind(adapt);
21695
23302
  this.executeRowFlex = adapt.rowFlex.bind(adapt);
21696
23303
  this.executeRowMargin = adapt.rowMargin.bind(adapt);
23304
+ this.executeTextIndent = adapt.textIndent.bind(adapt);
21697
23305
  this.executeInsertTable = adapt.insertTable.bind(adapt);
21698
23306
  this.executeInsertTableTopRow = adapt.insertTableTopRow.bind(adapt);
21699
23307
  this.executeInsertTableBottomRow = adapt.insertTableBottomRow.bind(adapt);
@@ -21722,6 +23330,9 @@ class Command {
21722
23330
  this.executePageBreak = adapt.pageBreak.bind(adapt);
21723
23331
  this.executeAddWatermark = adapt.addWatermark.bind(adapt);
21724
23332
  this.executeDeleteWatermark = adapt.deleteWatermark.bind(adapt);
23333
+ this.executeSetBackground = adapt.setBackground.bind(adapt);
23334
+ this.getBackground = adapt.getBackground.bind(adapt);
23335
+ this.executeDeleteBackground = adapt.deleteBackground.bind(adapt);
21725
23336
  this.executeSearch = adapt.search.bind(adapt);
21726
23337
  this.executeSearchNavigatePre = adapt.searchNavigatePre.bind(adapt);
21727
23338
  this.executeSearchNavigateNext = adapt.searchNavigateNext.bind(adapt);
@@ -21759,6 +23370,8 @@ class Command {
21759
23370
  this.executeLocationCatalog = adapt.locationCatalog.bind(adapt);
21760
23371
  this.executeWordTool = adapt.wordTool.bind(adapt);
21761
23372
  this.executeSetHTML = adapt.setHTML.bind(adapt);
23373
+ this.executeSetHtmlDocx = adapt.setHtmlDocx.bind(adapt);
23374
+ this.executeImportDocx = adapt.importDocx.bind(adapt);
21762
23375
  this.executeSetGroup = adapt.setGroup.bind(adapt);
21763
23376
  this.executeDeleteGroup = adapt.deleteGroup.bind(adapt);
21764
23377
  this.executeLocationGroup = adapt.locationGroup.bind(adapt);
@@ -21769,6 +23382,7 @@ class Command {
21769
23382
  this.executeComputeElementListHeight = adapt.computeElementListHeight.bind(adapt);
21770
23383
  this.getImage = adapt.getImage.bind(adapt);
21771
23384
  this.getOptions = adapt.getOptions.bind(adapt);
23385
+ this.getDefaultLineHeight = adapt.getDefaultLineHeight.bind(adapt);
21772
23386
  this.getValue = adapt.getValue.bind(adapt);
21773
23387
  this.getValueAsync = adapt.getValueAsync.bind(adapt);
21774
23388
  this.getHTML = adapt.getHTML.bind(adapt);
@@ -21817,6 +23431,487 @@ function getParagraphNo(elementList, index2) {
21817
23431
  }
21818
23432
  return paragraphNo;
21819
23433
  }
23434
+ const FALLBACK_FONT = "SimSun";
23435
+ function cleanFontFamily(font) {
23436
+ var _a;
23437
+ if (!font)
23438
+ return "";
23439
+ return ((_a = font.split(",")[0]) == null ? void 0 : _a.replace(/['"]/g, "").trim()) || "";
23440
+ }
23441
+ function normalizeFontFamily(font, fonts, fallback = FALLBACK_FONT) {
23442
+ const cleaned = cleanFontFamily(font);
23443
+ if (!cleaned)
23444
+ return void 0;
23445
+ if (!fonts || !Object.keys(fonts).length) {
23446
+ return cleaned;
23447
+ }
23448
+ const lower = cleaned.toLowerCase();
23449
+ const keyMatch = Object.keys(fonts).find((k) => k.toLowerCase() === lower);
23450
+ if (keyMatch)
23451
+ return keyMatch;
23452
+ const byLabel = Object.entries(fonts).find(([, label]) => label.toLowerCase() === lower);
23453
+ if (byLabel)
23454
+ return byLabel[0];
23455
+ const simSunKey = Object.keys(fonts).find((k) => k.toLowerCase() === "simsun");
23456
+ return simSunKey || fallback;
23457
+ }
23458
+ function normalizeElementListFonts(elements, fonts) {
23459
+ if (!(elements == null ? void 0 : elements.length) || !fonts || !Object.keys(fonts).length)
23460
+ return;
23461
+ const walk = (list) => {
23462
+ var _a, _b, _c;
23463
+ for (const el of list) {
23464
+ if (el.font) {
23465
+ el.font = normalizeFontFamily(el.font, fonts);
23466
+ }
23467
+ if ((_a = el.valueList) == null ? void 0 : _a.length) {
23468
+ walk(el.valueList);
23469
+ }
23470
+ if ((_b = el.trList) == null ? void 0 : _b.length) {
23471
+ for (const tr of el.trList) {
23472
+ for (const td of tr.tdList || []) {
23473
+ if ((_c = td.value) == null ? void 0 : _c.length) {
23474
+ walk(td.value);
23475
+ }
23476
+ }
23477
+ }
23478
+ }
23479
+ }
23480
+ };
23481
+ walk(elements);
23482
+ }
23483
+ function parsePx(value) {
23484
+ const n = Number.parseFloat(value);
23485
+ return Number.isFinite(n) ? n : 0;
23486
+ }
23487
+ function parseLengthToPx(value) {
23488
+ const trimmed = value.trim();
23489
+ if (!trimmed || /%$/.test(trimmed))
23490
+ return 0;
23491
+ const n = Number.parseFloat(trimmed);
23492
+ if (!Number.isFinite(n))
23493
+ return 0;
23494
+ if (/pt$/i.test(trimmed))
23495
+ return n * 96 / 72;
23496
+ if (/pc$/i.test(trimmed))
23497
+ return n * 16;
23498
+ if (/in$/i.test(trimmed))
23499
+ return n * 96;
23500
+ if (/cm$/i.test(trimmed))
23501
+ return n * 96 / 2.54;
23502
+ if (/mm$/i.test(trimmed))
23503
+ return n * 96 / 25.4;
23504
+ return n;
23505
+ }
23506
+ function parseTdBackgroundColor(td) {
23507
+ const raw2 = (td.style.backgroundColor || "").trim();
23508
+ if (!raw2)
23509
+ return void 0;
23510
+ const lower = raw2.toLowerCase();
23511
+ if (lower === "inherit" || lower === "transparent" || lower === "initial" || lower === "unset" || lower === "none" || lower === "rgba(0, 0, 0, 0)" || lower === "rgb(0, 0, 0, 0)") {
23512
+ return void 0;
23513
+ }
23514
+ return raw2;
23515
+ }
23516
+ function isHiddenTableCell(td) {
23517
+ if (td.style.display === "none")
23518
+ return true;
23519
+ return window.getComputedStyle(td).display === "none";
23520
+ }
23521
+ function parseColWidth(col, fallback) {
23522
+ var _a;
23523
+ const attrWidth = col.getAttribute("width");
23524
+ if (attrWidth) {
23525
+ const fromAttr = parseLengthToPx(attrWidth);
23526
+ if (fromAttr > 0)
23527
+ return Math.round(fromAttr);
23528
+ }
23529
+ const styleWidth = (_a = col.style) == null ? void 0 : _a.width;
23530
+ if (styleWidth) {
23531
+ const fromStyle = parseLengthToPx(styleWidth);
23532
+ if (fromStyle > 0)
23533
+ return Math.round(fromStyle);
23534
+ }
23535
+ return fallback;
23536
+ }
23537
+ function parseDocxPaperMeta(section) {
23538
+ const style = window.getComputedStyle(section);
23539
+ const width = Math.round(parsePx(style.width)) || Math.round(section.clientWidth);
23540
+ const height = Math.round(parsePx(style.minHeight || style.height)) || Math.round(section.clientHeight);
23541
+ const margins = [
23542
+ Math.round(parsePx(style.paddingTop)),
23543
+ Math.round(parsePx(style.paddingRight)),
23544
+ Math.round(parsePx(style.paddingBottom)),
23545
+ Math.round(parsePx(style.paddingLeft))
23546
+ ];
23547
+ return {
23548
+ width: width || 794,
23549
+ height: height || 1123,
23550
+ margins
23551
+ };
23552
+ }
23553
+ function parseLineHeightAsRowMargin(lineHeight, fontSizePx) {
23554
+ const trimmed = lineHeight.trim();
23555
+ if (!trimmed || trimmed === "normal")
23556
+ return void 0;
23557
+ if (/^\d+(\.\d+)?$/.test(trimmed)) {
23558
+ const ratio = Number.parseFloat(trimmed);
23559
+ return Number.isFinite(ratio) && ratio > 0 ? ratio : void 0;
23560
+ }
23561
+ const px = parsePx(trimmed);
23562
+ if (px > 0 && fontSizePx > 0) {
23563
+ return px / fontSizePx;
23564
+ }
23565
+ return void 0;
23566
+ }
23567
+ const IDEOGRAPHIC_SPACE = "\u3000";
23568
+ function getParagraphStyle(p) {
23569
+ const style = window.getComputedStyle(p);
23570
+ const fontSize = parsePx(style.fontSize) || 14;
23571
+ const rowFlex = convertTextAlignToRowFlex(p);
23572
+ const dataRowMargin = p.getAttribute("data-row-margin");
23573
+ let rowMargin;
23574
+ if (dataRowMargin != null && dataRowMargin !== "") {
23575
+ const n = Number.parseFloat(dataRowMargin);
23576
+ if (Number.isFinite(n) && n > 0) {
23577
+ rowMargin = n;
23578
+ }
23579
+ }
23580
+ if (rowMargin === void 0) {
23581
+ rowMargin = parseLineHeightAsRowMargin(style.lineHeight, fontSize);
23582
+ }
23583
+ let minHeight = parsePx(style.minHeight);
23584
+ if (!minHeight && fontSize) {
23585
+ minHeight = fontSize;
23586
+ }
23587
+ let whiteSpace = style.whiteSpace;
23588
+ if (!whiteSpace || whiteSpace === "normal") {
23589
+ const span = p.querySelector("span");
23590
+ if (span) {
23591
+ const spanWhiteSpace = window.getComputedStyle(span).whiteSpace;
23592
+ if (spanWhiteSpace && spanWhiteSpace !== "normal") {
23593
+ whiteSpace = spanWhiteSpace;
23594
+ }
23595
+ }
23596
+ }
23597
+ if ((!whiteSpace || whiteSpace === "normal") && p.closest(".docx, .docx-wrapper")) {
23598
+ whiteSpace = "pre-wrap";
23599
+ }
23600
+ const result = {};
23601
+ result.rowFlex = rowFlex;
23602
+ if (rowMargin !== void 0)
23603
+ result.rowMargin = rowMargin;
23604
+ if (minHeight)
23605
+ result.minHeight = minHeight;
23606
+ if (whiteSpace && whiteSpace !== "normal") {
23607
+ result.whiteSpace = whiteSpace;
23608
+ }
23609
+ return result;
23610
+ }
23611
+ function getLeadingIndentSpaceCount(p) {
23612
+ const style = window.getComputedStyle(p);
23613
+ const fontSize = parsePx(style.fontSize) || 14;
23614
+ if (fontSize <= 0)
23615
+ return 0;
23616
+ const textIndent = Math.max(0, parsePx(style.textIndent));
23617
+ const marginLeft = Math.max(0, parsePx(style.marginInlineStart || style.marginLeft));
23618
+ const indentPx = textIndent + marginLeft;
23619
+ if (indentPx <= 0)
23620
+ return 0;
23621
+ return Math.max(0, Math.round(indentPx / fontSize));
23622
+ }
23623
+ function createLeadingSpaceElements(count) {
23624
+ if (count <= 0)
23625
+ return [];
23626
+ return splitText(IDEOGRAPHIC_SPACE.repeat(count)).map((value) => ({ value }));
23627
+ }
23628
+ function applyParagraphStyle(elements, paragraphStyle) {
23629
+ if (!elements.length)
23630
+ return;
23631
+ const keys = Object.keys(paragraphStyle);
23632
+ if (!keys.length)
23633
+ return;
23634
+ for (const el of elements) {
23635
+ if (el.type === ElementType.IMAGE && (el.imgDisplay === ImageDisplay.FLOAT_TOP || el.imgDisplay === ImageDisplay.FLOAT_BOTTOM || el.imgDisplay === ImageDisplay.SURROUND)) {
23636
+ continue;
23637
+ }
23638
+ Object.assign(el, paragraphStyle);
23639
+ }
23640
+ }
23641
+ function styleFromComputed(el) {
23642
+ var _a, _b;
23643
+ const style = window.getComputedStyle(el);
23644
+ const element = {
23645
+ color: style.color,
23646
+ bold: Number(style.fontWeight) > 500,
23647
+ italic: style.fontStyle.includes("italic"),
23648
+ size: Math.floor(parsePx(style.fontSize)) || void 0,
23649
+ font: (_b = (_a = style.fontFamily) == null ? void 0 : _a.split(",")[0]) == null ? void 0 : _b.replace(/['"]/g, "").trim()
23650
+ };
23651
+ if (style.backgroundColor && style.backgroundColor !== "rgba(0, 0, 0, 0)") {
23652
+ element.highlight = style.backgroundColor;
23653
+ }
23654
+ if (style.textDecorationLine.includes("underline")) {
23655
+ element.underline = true;
23656
+ }
23657
+ if (style.textDecorationLine.includes("line-through")) {
23658
+ element.strikeout = true;
23659
+ }
23660
+ const letterSpacing = parsePx(style.letterSpacing);
23661
+ if (letterSpacing)
23662
+ element.letterSpacing = letterSpacing;
23663
+ if (style.whiteSpace && style.whiteSpace !== "normal") {
23664
+ element.whiteSpace = style.whiteSpace;
23665
+ }
23666
+ const spanMinHeight = parsePx(style.minHeight);
23667
+ if (spanMinHeight)
23668
+ element.minHeight = spanMinHeight;
23669
+ return element;
23670
+ }
23671
+ function parseTextFromNode(node) {
23672
+ if (node.nodeType === 3) {
23673
+ const text = node.textContent || "";
23674
+ if (!text)
23675
+ return [];
23676
+ const parent = node.parentElement;
23677
+ const base = parent ? styleFromComputed(parent) : {};
23678
+ return splitText(text).map((ch) => ({
23679
+ value: ch,
23680
+ ...base
23681
+ }));
23682
+ }
23683
+ if (node.nodeType !== 1)
23684
+ return [];
23685
+ const el = node;
23686
+ const name = el.nodeName;
23687
+ if (name === "BR") {
23688
+ return [{ value: WRAP }];
23689
+ }
23690
+ if (name === "IMG") {
23691
+ return parseImage(el);
23692
+ }
23693
+ if (name === "A") {
23694
+ const value = el.innerText;
23695
+ if (!value)
23696
+ return [];
23697
+ return [
23698
+ {
23699
+ type: ElementType.HYPERLINK,
23700
+ value: "",
23701
+ valueList: splitText(value).map((ch) => ({ value: ch })),
23702
+ url: el.href
23703
+ }
23704
+ ];
23705
+ }
23706
+ const result = [];
23707
+ el.childNodes.forEach((child) => {
23708
+ result.push(...parseTextFromNode(child));
23709
+ });
23710
+ return result;
23711
+ }
23712
+ function parseImage(img) {
23713
+ const { src, width, height } = img;
23714
+ const w = width || parsePx(window.getComputedStyle(img).width);
23715
+ const h = height || parsePx(window.getComputedStyle(img).height);
23716
+ if (!src || !w || !h)
23717
+ return [];
23718
+ const element = {
23719
+ width: w,
23720
+ height: h,
23721
+ value: src,
23722
+ type: ElementType.IMAGE,
23723
+ rowFlex: convertTextAlignToRowFlex(img.parentElement || img),
23724
+ verticalAlign: "text-top"
23725
+ };
23726
+ applyImageWrapFromDom(img, element);
23727
+ const formInputAttr = img.getAttribute("data-form-input");
23728
+ if (formInputAttr) {
23729
+ try {
23730
+ element.formInput = JSON.parse(formInputAttr);
23731
+ } catch {
23732
+ }
23733
+ }
23734
+ return [element];
23735
+ }
23736
+ function parseParagraph(p) {
23737
+ const paragraphStyle = getParagraphStyle(p);
23738
+ const leadingSpaces = createLeadingSpaceElements(getLeadingIndentSpaceCount(p));
23739
+ const children = [];
23740
+ p.childNodes.forEach((child) => {
23741
+ children.push(...parseTextFromNode(child));
23742
+ });
23743
+ const body = [...leadingSpaces, ...children];
23744
+ if (!body.length) {
23745
+ return [{ value: WRAP, ...paragraphStyle }];
23746
+ }
23747
+ applyParagraphStyle(body, paragraphStyle);
23748
+ const wrapElement = { value: WRAP, ...paragraphStyle };
23749
+ delete wrapElement.rowFlex;
23750
+ body.push(wrapElement);
23751
+ return body;
23752
+ }
23753
+ function normalizeTdValueList(valueList) {
23754
+ const list = valueList.slice();
23755
+ if (list.length > 1 && (list[list.length - 1].value === WRAP || list[list.length - 1].value === "\n")) {
23756
+ list.pop();
23757
+ }
23758
+ if (!list.length) {
23759
+ list.push({ value: WRAP });
23760
+ }
23761
+ return list;
23762
+ }
23763
+ function parseTable(table, innerWidth) {
23764
+ const element = {
23765
+ type: ElementType.TABLE,
23766
+ value: WRAP,
23767
+ colgroup: [],
23768
+ trList: []
23769
+ };
23770
+ const colElements = table.querySelectorAll("colgroup col");
23771
+ table.querySelectorAll("tr").forEach((trElement) => {
23772
+ const trHeight = parsePx(window.getComputedStyle(trElement).height) || 0;
23773
+ const tr = {
23774
+ height: trHeight,
23775
+ minHeight: trHeight,
23776
+ tdList: []
23777
+ };
23778
+ trElement.querySelectorAll("th,td").forEach((tdElement) => {
23779
+ const tableCell = tdElement;
23780
+ if (isHiddenTableCell(tableCell))
23781
+ return;
23782
+ const valueList = normalizeTdValueList(parseBlockChildren(tableCell, innerWidth));
23783
+ const td = {
23784
+ colspan: tableCell.colSpan,
23785
+ rowspan: tableCell.rowSpan,
23786
+ value: valueList,
23787
+ verticalAlign: window.getComputedStyle(tdElement).verticalAlign,
23788
+ width: parsePx(window.getComputedStyle(tdElement).width)
23789
+ };
23790
+ const backgroundColor = parseTdBackgroundColor(tableCell);
23791
+ if (backgroundColor) {
23792
+ td.backgroundColor = backgroundColor;
23793
+ }
23794
+ tr.tdList.push(td);
23795
+ });
23796
+ if (tr.tdList.length) {
23797
+ element.trList.push(tr);
23798
+ }
23799
+ });
23800
+ if (!element.trList.length)
23801
+ return [];
23802
+ const tdCount = element.trList[0].tdList.reduce((pre, cur) => pre + cur.colspan, 0);
23803
+ const defaultColWidth = Math.ceil(innerWidth / Math.max(tdCount, 1));
23804
+ for (let i = 0; i < tdCount; i++) {
23805
+ const col = colElements[i];
23806
+ element.colgroup.push({
23807
+ width: col ? parseColWidth(col, defaultColWidth) : defaultColWidth
23808
+ });
23809
+ }
23810
+ return [element];
23811
+ }
23812
+ function parseBlockChildren(root, innerWidth) {
23813
+ const result = [];
23814
+ root.childNodes.forEach((node) => {
23815
+ var _a;
23816
+ if (node.nodeType !== 1) {
23817
+ if (node.nodeType === 3 && ((_a = node.textContent) == null ? void 0 : _a.trim())) {
23818
+ result.push(...parseTextFromNode(node));
23819
+ result.push({ value: WRAP });
23820
+ }
23821
+ return;
23822
+ }
23823
+ const el = node;
23824
+ const name = el.nodeName;
23825
+ if (name === "P" || /^H[1-6]$/.test(name)) {
23826
+ result.push(...parseParagraph(el));
23827
+ } else if (name === "TABLE") {
23828
+ result.push(...parseTable(el, innerWidth));
23829
+ } else if (name === "IMG") {
23830
+ result.push(...parseImage(el));
23831
+ result.push({ value: WRAP });
23832
+ } else if (name === "BR") {
23833
+ result.push({ value: WRAP });
23834
+ } else if (name === "DIV" && el.getAttribute("data-type") === ElementType.PAGE_BREAK) {
23835
+ result.push({
23836
+ type: ElementType.PAGE_BREAK,
23837
+ value: WRAP
23838
+ });
23839
+ } else if (name === "DIV" && el.getAttribute("data-ce-clear") === "both") {
23840
+ return;
23841
+ } else if (name === "ARTICLE" || name === "DIV" || name === "SECTION") {
23842
+ result.push(...parseBlockChildren(el, innerWidth));
23843
+ } else {
23844
+ const nested = parseBlockChildren(el, innerWidth);
23845
+ if (nested.length) {
23846
+ result.push(...nested);
23847
+ } else {
23848
+ const inline = parseTextFromNode(el);
23849
+ if (inline.length) {
23850
+ result.push(...inline);
23851
+ result.push({ value: WRAP });
23852
+ }
23853
+ }
23854
+ }
23855
+ });
23856
+ return result;
23857
+ }
23858
+ function parseSectionContent(section, innerWidth) {
23859
+ const article = section.querySelector("article") || section;
23860
+ return parseBlockChildren(article, innerWidth);
23861
+ }
23862
+ function parseDocxDom(container, options = {}) {
23863
+ const sections = Array.from(container.querySelectorAll("section.docx"));
23864
+ const exportPages = Array.from(container.querySelectorAll(".ce-export-page"));
23865
+ const targets = sections.length ? sections : exportPages.length ? exportPages : [container];
23866
+ const paper = parseDocxPaperMeta(targets[0]);
23867
+ const contentWidth = Math.max(paper.width - paper.margins[1] - paper.margins[3], 1);
23868
+ const main = [];
23869
+ targets.forEach((section, index2) => {
23870
+ const sectionElements = parseSectionContent(section, contentWidth);
23871
+ if (sectionElements.length) {
23872
+ main.push(...sectionElements);
23873
+ }
23874
+ if (index2 < targets.length - 1) {
23875
+ main.push({
23876
+ type: ElementType.PAGE_BREAK,
23877
+ value: WRAP
23878
+ });
23879
+ }
23880
+ });
23881
+ normalizeElementListFonts(main, options.fonts);
23882
+ return { paper, main };
23883
+ }
23884
+ const A4_WIDTH_PX = Math.round(595.3 * 96 / 72);
23885
+ const A4_HEIGHT_PX = Math.round(841.95 * 96 / 72);
23886
+ const DEFAULT_MARGINS = [96, 120, 96, 120];
23887
+ function toPadding(margins) {
23888
+ const [top, right2, bottom, left2] = margins;
23889
+ return `${top}px ${right2}px ${bottom}px ${left2}px`;
23890
+ }
23891
+ function mountHtmlForDocx(html, margins) {
23892
+ const tempContainer = document.querySelector("#tempDiv") || document.createElement("div");
23893
+ if (!tempContainer.isConnected) {
23894
+ tempContainer.style.cssText = "opacity:0;position:absolute;left:-9999px;top:0;pointer-events:none;";
23895
+ document.body.append(tempContainer);
23896
+ }
23897
+ const trimmed = html.trim();
23898
+ const hasDocxSection = /<section[^>]*class=["'][^"']*\bdocx\b/i.test(trimmed);
23899
+ const hasExportPage = /class=["'][^"']*\bce-export-page\b/i.test(trimmed);
23900
+ if (hasDocxSection || hasExportPage) {
23901
+ tempContainer.innerHTML = trimmed;
23902
+ if (margins) {
23903
+ const paperEl = tempContainer.querySelector("section.docx") || tempContainer.querySelector(".ce-export-page");
23904
+ if (paperEl) {
23905
+ paperEl.style.padding = toPadding(margins);
23906
+ paperEl.style.boxSizing = "border-box";
23907
+ }
23908
+ }
23909
+ } else {
23910
+ const padding = toPadding(margins != null ? margins : DEFAULT_MARGINS);
23911
+ tempContainer.innerHTML = `<section class="docx" style="width:${A4_WIDTH_PX}px;min-height:${A4_HEIGHT_PX}px;padding:${padding};box-sizing:border-box;background:#fff;"><article>${trimmed}</article></section>`;
23912
+ }
23913
+ return tempContainer;
23914
+ }
21820
23915
  function convertPxToPaperSize(width, height) {
21821
23916
  if (width === 1125 && height === 1593) {
21822
23917
  return {
@@ -22598,6 +24693,30 @@ class CommandAdapt {
22598
24693
  const curIndex = isSetCursor ? endIndex : startIndex;
22599
24694
  this.draw.render({ curIndex, isSetCursor });
22600
24695
  }
24696
+ textIndent(payload) {
24697
+ const isReadonly = this.draw.isReadonly();
24698
+ if (isReadonly)
24699
+ return;
24700
+ const { startIndex, endIndex } = this.range.getRange();
24701
+ if (!~startIndex && !~endIndex)
24702
+ return;
24703
+ const paragraphElementList = this.range.getRangeParagraphElementList();
24704
+ if (!paragraphElementList)
24705
+ return;
24706
+ const indent = Math.max(0, payload);
24707
+ paragraphElementList.forEach((element) => {
24708
+ if (indent) {
24709
+ element.textIndent = indent;
24710
+ delete element.marginLeft;
24711
+ } else {
24712
+ delete element.textIndent;
24713
+ delete element.marginLeft;
24714
+ }
24715
+ });
24716
+ const isSetCursor = startIndex === endIndex;
24717
+ const curIndex = isSetCursor ? endIndex : startIndex;
24718
+ this.draw.render({ curIndex, isSetCursor });
24719
+ }
22601
24720
  insertTable(row, col) {
22602
24721
  const isDisabled = this.draw.isReadonly() || this.draw.isDisabled();
22603
24722
  if (isDisabled)
@@ -22932,6 +25051,67 @@ class CommandAdapt {
22932
25051
  });
22933
25052
  }
22934
25053
  }
25054
+ setBackground(payload) {
25055
+ const isReadonly = this.draw.isReadonly();
25056
+ if (isReadonly)
25057
+ return;
25058
+ const options = this.draw.getOptions();
25059
+ const bg = options.background;
25060
+ if (payload.image !== void 0) {
25061
+ bg.image = payload.image;
25062
+ }
25063
+ if (payload.color !== void 0) {
25064
+ bg.color = payload.color;
25065
+ }
25066
+ if (payload.opacity !== void 0) {
25067
+ bg.opacity = Math.min(1, Math.max(0, payload.opacity));
25068
+ }
25069
+ if (payload.position !== void 0) {
25070
+ bg.position = payload.position;
25071
+ }
25072
+ if (payload.applyPageNumbers !== void 0) {
25073
+ bg.applyPageNumbers = payload.applyPageNumbers;
25074
+ }
25075
+ bg.adaptive = true;
25076
+ bg.size = BackgroundSize.CONTAIN;
25077
+ bg.repeat = BackgroundRepeat.NO_REPEAT;
25078
+ if (payload.position === void 0 && !bg.position) {
25079
+ bg.position = BackgroundPosition.CENTER;
25080
+ }
25081
+ this.draw.render({
25082
+ isSetCursor: false,
25083
+ isSubmitHistory: false,
25084
+ isCompute: false
25085
+ });
25086
+ }
25087
+ getBackground() {
25088
+ const { background } = this.draw.getOptions();
25089
+ return {
25090
+ color: background.color,
25091
+ image: background.image,
25092
+ size: BackgroundSize.CONTAIN,
25093
+ repeat: BackgroundRepeat.NO_REPEAT,
25094
+ opacity: background.opacity,
25095
+ position: background.position,
25096
+ adaptive: true,
25097
+ applyPageNumbers: [...background.applyPageNumbers || []]
25098
+ };
25099
+ }
25100
+ deleteBackground() {
25101
+ const isReadonly = this.draw.isReadonly();
25102
+ if (isReadonly)
25103
+ return;
25104
+ const options = this.draw.getOptions();
25105
+ options.background = {
25106
+ ...defaultBackground,
25107
+ color: options.background.color || defaultBackground.color
25108
+ };
25109
+ this.draw.render({
25110
+ isSetCursor: false,
25111
+ isSubmitHistory: false,
25112
+ isCompute: false
25113
+ });
25114
+ }
22935
25115
  image(payload) {
22936
25116
  const isDisabled = this.draw.isReadonly() || this.draw.isDisabled();
22937
25117
  if (isDisabled)
@@ -23071,6 +25251,21 @@ class CommandAdapt {
23071
25251
  getOptions() {
23072
25252
  return this.options;
23073
25253
  }
25254
+ getDefaultLineHeight(payload) {
25255
+ var _a, _b;
25256
+ const { defaultSize, defaultRowMargin } = this.options;
25257
+ const size = (_a = payload == null ? void 0 : payload.size) != null ? _a : defaultSize;
25258
+ const rowMargin = (_b = payload == null ? void 0 : payload.rowMargin) != null ? _b : defaultRowMargin;
25259
+ const el = { value: "", size, rowMargin };
25260
+ const rowMarginPx = computeElementRowMarginPx(el, this.options);
25261
+ const lineHeightPx = Math.round(computeElementLineHeightPx(el, this.options));
25262
+ return {
25263
+ rowMargin,
25264
+ rowMarginPx,
25265
+ lineHeightPx,
25266
+ size
25267
+ };
25268
+ }
23074
25269
  getValue(options) {
23075
25270
  return this.draw.getValue(options);
23076
25271
  }
@@ -23085,11 +25280,40 @@ class CommandAdapt {
23085
25280
  const headerElementList = this.draw.getHeaderElementList();
23086
25281
  const mainElementList = this.draw.getOriginalMainElementList();
23087
25282
  const footerElementList = this.draw.getFooterElementList();
23088
- return {
23089
- header: createDomFromElementList(headerElementList, options).innerHTML,
23090
- main: createDomFromElementList(mainElementList, options).innerHTML,
23091
- footer: createDomFromElementList(footerElementList, options).innerHTML
25283
+ const headerPositionList = this.draw.getHeader().getPositionList();
25284
+ const mainPositionList = this.position.getOriginalMainPositionList();
25285
+ const footerPositionList = this.draw.getFooter().getPositionList();
25286
+ const { scale } = options;
25287
+ attachHtmlFloatOffset(headerElementList, headerPositionList, scale);
25288
+ attachHtmlFloatOffset(mainElementList, mainPositionList, scale);
25289
+ attachHtmlFloatOffset(footerElementList, footerPositionList, scale);
25290
+ attachHtmlImgRowLeft(headerElementList, headerPositionList, scale);
25291
+ attachHtmlImgRowLeft(mainElementList, mainPositionList, scale);
25292
+ attachHtmlImgRowLeft(footerElementList, footerPositionList, scale);
25293
+ const wrapPaper = (dom) => {
25294
+ const { width, height, margins } = options;
25295
+ const wrapper = document.createElement("div");
25296
+ wrapper.className = "ce-export-page";
25297
+ wrapper.style.width = `${width}px`;
25298
+ wrapper.style.minHeight = `${height}px`;
25299
+ wrapper.style.padding = `${margins[0]}px ${margins[1]}px ${margins[2]}px ${margins[3]}px`;
25300
+ wrapper.style.boxSizing = "border-box";
25301
+ wrapper.style.position = "relative";
25302
+ wrapper.style.background = "#fff";
25303
+ while (dom.firstChild) {
25304
+ wrapper.append(dom.firstChild);
25305
+ }
25306
+ return convertToXHTML(wrapper, { keepRoot: true });
23092
25307
  };
25308
+ try {
25309
+ return {
25310
+ header: wrapPaper(createDomFromElementList(headerElementList, options)),
25311
+ main: wrapPaper(createDomFromElementList(mainElementList, options)),
25312
+ footer: wrapPaper(createDomFromElementList(footerElementList, options))
25313
+ };
25314
+ } finally {
25315
+ clearHtmlFloatOffset();
25316
+ }
23093
25317
  }
23094
25318
  getText() {
23095
25319
  const headerElementList = this.draw.getHeaderElementList();
@@ -23692,16 +25916,53 @@ class CommandAdapt {
23692
25916
  }
23693
25917
  }
23694
25918
  setHTML(payload) {
23695
- const { header, main, footer } = payload;
25919
+ const { header, main, footer, container } = payload;
23696
25920
  const innerWidth = this.draw.getOriginalInnerWidth();
23697
25921
  const getElementList = (htmlText) => htmlText !== void 0 ? getElementListByHTML(htmlText, {
23698
- innerWidth
25922
+ innerWidth,
25923
+ container
23699
25924
  }) : void 0;
23700
25925
  this.setValue({
23701
25926
  header: getElementList(header),
23702
25927
  main: getElementList(main),
23703
25928
  footer: getElementList(footer)
23704
25929
  });
25930
+ this.reconcileImportedFloatPositions();
25931
+ }
25932
+ setHtmlDocx(payload) {
25933
+ const { container, margins } = payload;
25934
+ if (!container)
25935
+ return;
25936
+ const { paper, main } = parseDocxDom(container, {
25937
+ fonts: this.options.fonts
25938
+ });
25939
+ this.options.margins = margins != null ? margins : paper.margins;
25940
+ this.draw.setPaperSize(paper.width, paper.height);
25941
+ this.setValue({ main });
25942
+ this.reconcileImportedFloatPositions();
25943
+ }
25944
+ reconcileImportedFloatPositions() {
25945
+ const { scale } = this.options;
25946
+ const headerElementList = this.draw.getHeaderElementList();
25947
+ const mainElementList = this.draw.getOriginalMainElementList();
25948
+ const footerElementList = this.draw.getFooterElementList();
25949
+ const headerPositionList = this.draw.getHeader().getPositionList();
25950
+ const mainPositionList = this.position.getOriginalMainPositionList();
25951
+ const footerPositionList = this.draw.getFooter().getPositionList();
25952
+ const changed = reconcileHtmlFloatPositions(headerElementList, headerPositionList, scale) || reconcileHtmlFloatPositions(mainElementList, mainPositionList, scale) || reconcileHtmlFloatPositions(footerElementList, footerPositionList, scale);
25953
+ if (changed) {
25954
+ this.draw.render({
25955
+ isSubmitHistory: false,
25956
+ isSetCursor: false
25957
+ });
25958
+ }
25959
+ }
25960
+ importDocx(payload) {
25961
+ const { html, margins } = payload;
25962
+ if (!html)
25963
+ return;
25964
+ const container = mountHtmlForDocx(html, margins);
25965
+ this.setHtmlDocx({ container, margins });
23705
25966
  }
23706
25967
  setGroup() {
23707
25968
  const isReadonly = this.draw.isReadonly();
@@ -25185,6 +27446,8 @@ class EventBus {
25185
27446
  }
25186
27447
  class Override {
25187
27448
  }
27449
+ function docxPlugin(_editor) {
27450
+ }
25188
27451
  class Editor {
25189
27452
  showFormInputConfig(el) {
25190
27453
  formInputPropertiesConfigDialog(el, this);
@@ -25195,6 +27458,18 @@ class Editor {
25195
27458
  showFormRadioConfig(el) {
25196
27459
  formRadioPropertiesConfigDialog(el, this);
25197
27460
  }
27461
+ showFormImageConfig(el) {
27462
+ formImagePropertiesConfigDialog(el, this);
27463
+ }
27464
+ showFormSignatureConfig(el) {
27465
+ formSignatureConfigDialog(el, this);
27466
+ }
27467
+ showFormSealConfig(el) {
27468
+ formSealConfigDialog(el, this);
27469
+ }
27470
+ showFormRiskCopyConfig(el) {
27471
+ formRiskCopyConfigDialog(el, this);
27472
+ }
25198
27473
  setExtensionParam(key, value) {
25199
27474
  this.extensionParams.set(key, value);
25200
27475
  }
@@ -25275,8 +27550,14 @@ class Editor {
25275
27550
  const plugin = new Plugin(this);
25276
27551
  this.use = plugin.use.bind(plugin);
25277
27552
  this.extensionParams = /* @__PURE__ */ new Map();
27553
+ if (editorOptions.fonts && Object.keys(editorOptions.fonts).length) {
27554
+ this.setExtensionParam("fontOptions", Object.entries(editorOptions.fonts).map(([value, label]) => ({
27555
+ value,
27556
+ label: label || value
27557
+ })));
27558
+ }
25278
27559
  Reflect.set(window, "editor", this);
25279
27560
  }
25280
27561
  }
25281
- export { AreaMode, BackgroundRepeat, BackgroundSize, BlockType, Command, ControlComponent, ControlIndentation, ControlState, ControlType, EDITOR_CLIPBOARD, EDITOR_COMPONENT, Editor, EditorComponent, EditorMode, EditorZone, ElementType, FlexDirection, INTERNAL_CONTEXT_MENU_KEY, INTERNAL_SHORTCUT_KEY, ImageDisplay, KeyMap, LETTER_CLASS, LineNumberType, ListStyle, ListType, LocationPosition, MaxHeightRatio, NumberType, PageMode, PaperDirection, RenderMode, RowFlex, TableBorder, TdBorder, TdSlash, TextDecorationStyle, TitleLevel, VerticalAlign, WatermarkType, WordBreak, createDomFromElementList, Editor as default, formCheckboxPropertiesConfigDialog, formInputPropertiesConfigDialog, formRadioPropertiesConfigDialog, getElementListByHTML, getTextFromElementList, splitText };
27562
+ export { AreaMode, BackgroundPosition, BackgroundRepeat, BackgroundSize, BlockType, Command, ControlComponent, ControlIndentation, ControlState, ControlType, Dialog, EDITOR_CLIPBOARD, EDITOR_COMPONENT, Editor, EditorComponent, EditorMode, EditorZone, ElementType, FlexDirection, INTERNAL_CONTEXT_MENU_KEY, INTERNAL_SHORTCUT_KEY, ImageDisplay, KeyMap, LETTER_CLASS, LineNumberType, ListStyle, ListType, LocationPosition, MaxHeightRatio, NumberType, PageMode, PaperDirection, RenderMode, RowFlex, TableBorder, TdBorder, TdSlash, TextDecorationStyle, TitleLevel, VerticalAlign, WatermarkType, WordBreak, computeElementLineHeightPx, computeElementRowMarginPx, createDomFromElementList, Editor as default, docxPlugin, formCheckboxPropertiesConfigDialog, formImagePropertiesConfigDialog, formInputPropertiesConfigDialog, formRadioPropertiesConfigDialog, formRiskCopyConfigDialog, formSealConfigDialog, formSignatureConfigDialog, getElementListByHTML, getTextFromElementList, splitText };
25282
27563
  //# sourceMappingURL=canvas-editor.es.js.map