@hufe921/canvas-editor 0.9.39 → 0.9.41
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +43 -0
- package/dist/canvas-editor.es.js +650 -352
- package/dist/canvas-editor.es.js.map +1 -1
- package/dist/canvas-editor.umd.js +28 -28
- package/dist/canvas-editor.umd.js.map +1 -1
- package/dist/src/editor/core/command/Command.d.ts +1 -0
- package/dist/src/editor/core/command/CommandAdapt.d.ts +3 -2
- package/dist/src/editor/core/contextmenu/ContextMenu.d.ts +1 -1
- package/dist/src/editor/core/cursor/Cursor.d.ts +2 -1
- package/dist/src/editor/core/draw/Draw.d.ts +9 -2
- package/dist/src/editor/core/draw/control/Control.d.ts +1 -0
- package/dist/src/editor/core/draw/richtext/AbstractRichText.d.ts +1 -6
- package/dist/src/editor/core/event/GlobalEvent.d.ts +1 -2
- package/dist/src/editor/core/event/eventbus/EventBus.d.ts +8 -0
- package/dist/src/editor/core/range/RangeManager.d.ts +1 -0
- package/dist/src/editor/index.d.ts +3 -0
- package/dist/src/editor/interface/Editor.d.ts +6 -0
- package/dist/src/editor/interface/Element.d.ts +1 -0
- package/dist/src/editor/interface/EventBus.d.ts +13 -0
- package/dist/src/editor/interface/Position.d.ts +1 -0
- package/dist/src/editor/utils/clipboard.d.ts +0 -7
- package/dist/src/editor/utils/element.d.ts +8 -0
- package/package.json +2 -2
package/dist/canvas-editor.es.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
(()=>{(function(){"use strict";try{if(typeof document!="undefined"){var e=document.createElement("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-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:14.28571%;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:14.28571%;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;overflow:hidden;border-radius:8px;background-color:#fff;border:1px solid rgb(235 236 240)}.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}.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:last-child:after{display:none}.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}.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: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}.ce-resizer-selection>div{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}.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-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-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,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIHZpZXdCb3g9IjAgMCAxNiAxNiIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48ZyBmaWxsPSIjM0Q0NzU3IiBmaWxsLXJ1bGU9ImV2ZW5vZGQiPjxwYXRoIGQ9Ik0xMiA0aC0xVjJINXYySDRWMmExIDEgMCAwMTEtMWg2YTEgMSAwIDAxMSAxdjJ6bTAgNXY0YTEgMSAwIDAxLTEgMUg1YTEgMSAwIDAxLTEtMVY5aDF2NGg2VjloMXoiLz48cGF0aCBkPSJNMTIgMTJ2LTFoMlY1SDJ2NmgydjFIMmExIDEgMCAwMS0xLTFWNWExIDEgMCAwMTEtMWgxMmExIDEgMCAwMTEgMXY2YTEgMSAwIDAxLTEgMWgtMnoiLz48cGF0aCBkPSJNMyA4aDEwdjFIM3ptOC0yaDJ2MWgtMnoiLz48L2c+PC9zdmc+)}.ce-contextmenu-image{background-image:url(data:image/svg+xml;base64,PHN2ZyB2ZXJzaW9uPSIxLjEiIGlkPSLlm77lsYJfMSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4PSIwIiB5PSIwIiB2aWV3Qm94PSIwIDAgMTYgMTYiIHhtbDpzcGFjZT0icHJlc2VydmUiPjxzdHlsZT4uc3Qwe2ZpbGw6IzNkNDc1N308L3N0eWxlPjxnIGlkPSJfeDMwXzAt5YWs5YWxX3gyRl8wMuW3peWFt+agj194MkZf5o+S5YWl5Zu+54mHLTE2cHgtIj48ZyBpZD0iR3JvdXAtMTkiIHRyYW5zZm9ybT0idHJhbnNsYXRlKDEgMSkiPjxwYXRoIGlkPSJDb21iaW5lZC1TaGFwZSIgY2xhc3M9InN0MCIgZD0iTTEgMGgxMmMuNiAwIDEgLjQgMSAxdjExYzAgLjYtLjQgMS0xIDFIMWMtLjYgMC0xLS40LTEtMVYxYzAtLjYuNC0xIDEtMXptMCAxdjExaDEyVjFIMXoiLz48Y2lyY2xlIGlkPSLmpK3lnIblvaIiIGNsYXNzPSJzdDAiIGN4PSIxMCIgY3k9IjQiIHI9IjEiLz48cGF0aCBpZD0iUGF0aCIgY2xhc3M9InN0MCIgZD0iTTguNSAxMS4ybC00LTQuMUwxIDEwLjdWOS4yYzEuNy0xLjYgMi43LTIuNSAzLTIuOC40LS41LjctLjQgMSAwTDguNSAxMCAxMSA3LjNjLjQtLjUuNi0uNSAxLS4xbDIgMi44djEuNWwtMi41LTMuNC0zIDMuMXoiLz48L2c+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,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+PHBhdGggZD0iTTIuNSAzYS41LjUgMCAwMS41LS41aDExYS41LjUgMCAwMS41LjV2MTFhLjUuNSAwIDAxLS41LjVIM2EuNS41IDAgMDEtLjUtLjVWM3oiIHN0cm9rZT0iIzNENDc1NyIvPjxwYXRoIGZpbGw9IiMzRDQ3NTciIGQ9Ik0zIDhoMTF2MUgzeiIvPjxwYXRoIGZpbGw9IiMzRDQ3NTciIGQ9Ik05IDN2MTFIOFYzeiIvPjwvc3ZnPg==)}.ce-contextmenu-border-empty{background-image:url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik0xMyAzaC0xVjJoMWExIDEgMCAwMTEgMXYxaC0xVjN6bS0zLTF2MUg4LjV2MmgtMVYzSDZWMmg0ek00IDJ2MUgzdjFIMlYzYTEgMSAwIDAxMS0xaDF6TTIgNmgxdjEuNWgydjFIM1YxMEgyVjZ6bTAgNmgxdjFoMXYxSDNhMSAxIDAgMDEtMS0xdi0xem00IDJ2LTFoMS41di0yaDF2MkgxMHYxSDZ6bTYgMHYtMWgxdi0xaDF2MWExIDEgMCAwMS0xIDFoLTF6bTItNGgtMVY4LjVoLTJ2LTFoMlY2aDF2NHpNOC41IDcuNXYtMWgtMXYxaC0xdjFoMXYxaDF2LTFoMXYtMWgtMXoiIGZpbGw9IiNBQUFDQjAiLz48L3N2Zz4=)}.ce-contextmenu-border-external{background-image:url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTIuNSAzYS41LjUgMCAwMS41LS41aDExYS41LjUgMCAwMS41LjV2MTFhLjUuNSAwIDAxLS41LjVIM2EuNS41IDAgMDEtLjUtLjVWM3oiIHN0cm9rZT0iIzNENDc1NyIvPjxwYXRoIGZpbGwtcnVsZT0iZXZlbm9kZCIgY2xpcC1ydWxlPSJldmVub2RkIiBkPSJNOSA1VjNIOHYyaDF6bTAgOXYtMkg4djJoMXpNNSA4SDN2MWgyVjh6bTkgMGgtMnYxaDJWOHpNOSA3djFoMXYxSDl2MUg4VjlIN1Y4aDFWN2gxeiIgZmlsbD0iI0FBQUNCMCIvPjwvc3ZnPg==)}.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-inputarea{width:100px;height:30px;min-width:0;min-height:0;margin:0;padding:0;left:0;right: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;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}}')),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-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:14.28571%;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:14.28571%;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;overflow:hidden;border-radius:8px;background-color:#fff;border:1px solid rgb(235 236 240)}.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}.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:last-child:after{display:none}.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}.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: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}.ce-resizer-selection>div{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}.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-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-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,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIHZpZXdCb3g9IjAgMCAxNiAxNiIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48ZyBmaWxsPSIjM0Q0NzU3IiBmaWxsLXJ1bGU9ImV2ZW5vZGQiPjxwYXRoIGQ9Ik0xMiA0aC0xVjJINXYySDRWMmExIDEgMCAwMTEtMWg2YTEgMSAwIDAxMSAxdjJ6bTAgNXY0YTEgMSAwIDAxLTEgMUg1YTEgMSAwIDAxLTEtMVY5aDF2NGg2VjloMXoiLz48cGF0aCBkPSJNMTIgMTJ2LTFoMlY1SDJ2NmgydjFIMmExIDEgMCAwMS0xLTFWNWExIDEgMCAwMTEtMWgxMmExIDEgMCAwMTEgMXY2YTEgMSAwIDAxLTEgMWgtMnoiLz48cGF0aCBkPSJNMyA4aDEwdjFIM3ptOC0yaDJ2MWgtMnoiLz48L2c+PC9zdmc+)}.ce-contextmenu-image{background-image:url(data:image/svg+xml;base64,PHN2ZyB2ZXJzaW9uPSIxLjEiIGlkPSLlm77lsYJfMSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4PSIwIiB5PSIwIiB2aWV3Qm94PSIwIDAgMTYgMTYiIHhtbDpzcGFjZT0icHJlc2VydmUiPjxzdHlsZT4uc3Qwe2ZpbGw6IzNkNDc1N308L3N0eWxlPjxnIGlkPSJfeDMwXzAt5YWs5YWxX3gyRl8wMuW3peWFt+agj194MkZf5o+S5YWl5Zu+54mHLTE2cHgtIj48ZyBpZD0iR3JvdXAtMTkiIHRyYW5zZm9ybT0idHJhbnNsYXRlKDEgMSkiPjxwYXRoIGlkPSJDb21iaW5lZC1TaGFwZSIgY2xhc3M9InN0MCIgZD0iTTEgMGgxMmMuNiAwIDEgLjQgMSAxdjExYzAgLjYtLjQgMS0xIDFIMWMtLjYgMC0xLS40LTEtMVYxYzAtLjYuNC0xIDEtMXptMCAxdjExaDEyVjFIMXoiLz48Y2lyY2xlIGlkPSLmpK3lnIblvaIiIGNsYXNzPSJzdDAiIGN4PSIxMCIgY3k9IjQiIHI9IjEiLz48cGF0aCBpZD0iUGF0aCIgY2xhc3M9InN0MCIgZD0iTTguNSAxMS4ybC00LTQuMUwxIDEwLjdWOS4yYzEuNy0xLjYgMi43LTIuNSAzLTIuOC40LS41LjctLjQgMSAwTDguNSAxMCAxMSA3LjNjLjQtLjUuNi0uNSAxLS4xbDIgMi44djEuNWwtMi41LTMuNC0zIDMuMXoiLz48L2c+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,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+PHBhdGggZD0iTTIuNSAzYS41LjUgMCAwMS41LS41aDExYS41LjUgMCAwMS41LjV2MTFhLjUuNSAwIDAxLS41LjVIM2EuNS41IDAgMDEtLjUtLjVWM3oiIHN0cm9rZT0iIzNENDc1NyIvPjxwYXRoIGZpbGw9IiMzRDQ3NTciIGQ9Ik0zIDhoMTF2MUgzeiIvPjxwYXRoIGZpbGw9IiMzRDQ3NTciIGQ9Ik05IDN2MTFIOFYzeiIvPjwvc3ZnPg==)}.ce-contextmenu-border-empty{background-image:url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik0xMyAzaC0xVjJoMWExIDEgMCAwMTEgMXYxaC0xVjN6bS0zLTF2MUg4LjV2MmgtMVYzSDZWMmg0ek00IDJ2MUgzdjFIMlYzYTEgMSAwIDAxMS0xaDF6TTIgNmgxdjEuNWgydjFIM1YxMEgyVjZ6bTAgNmgxdjFoMXYxSDNhMSAxIDAgMDEtMS0xdi0xem00IDJ2LTFoMS41di0yaDF2MkgxMHYxSDZ6bTYgMHYtMWgxdi0xaDF2MWExIDEgMCAwMS0xIDFoLTF6bTItNGgtMVY4LjVoLTJ2LTFoMlY2aDF2NHpNOC41IDcuNXYtMWgtMXYxaC0xdjFoMXYxaDF2LTFoMXYtMWgtMXoiIGZpbGw9IiNBQUFDQjAiLz48L3N2Zz4=)}.ce-contextmenu-border-external{background-image:url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTIuNSAzYS41LjUgMCAwMS41LS41aDExYS41LjUgMCAwMS41LjV2MTFhLjUuNSAwIDAxLS41LjVIM2EuNS41IDAgMDEtLjUtLjVWM3oiIHN0cm9rZT0iIzNENDc1NyIvPjxwYXRoIGZpbGwtcnVsZT0iZXZlbm9kZCIgY2xpcC1ydWxlPSJldmVub2RkIiBkPSJNOSA1VjNIOHYyaDF6bTAgOXYtMkg4djJoMXpNNSA4SDN2MWgyVjh6bTkgMGgtMnYxaDJWOHpNOSA3djFoMXYxSDl2MUg4VjlIN1Y4aDFWN2gxeiIgZmlsbD0iI0FBQUNCMCIvPjwvc3ZnPg==)}.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-inputarea{width:100px;height:30px;min-width:0;min-height:0;margin:0;padding:0;left:0;right: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;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}}')),document.head.appendChild(e)}}catch(i){console.error("vite-plugin-css-injected-by-js",i)}})();})();
|
|
2
2
|
var __defProp = Object.defineProperty;
|
|
3
3
|
var __defProps = Object.defineProperties;
|
|
4
4
|
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
@@ -23,7 +23,7 @@ var __publicField = (obj, key, value) => {
|
|
|
23
23
|
return value;
|
|
24
24
|
};
|
|
25
25
|
var index = "";
|
|
26
|
-
const version = "0.9.
|
|
26
|
+
const version = "0.9.41";
|
|
27
27
|
var MaxHeightRatio;
|
|
28
28
|
(function(MaxHeightRatio2) {
|
|
29
29
|
MaxHeightRatio2["HALF"] = "half";
|
|
@@ -38,7 +38,22 @@ var NumberType;
|
|
|
38
38
|
const ZERO = "\u200B";
|
|
39
39
|
const WRAP = "\n";
|
|
40
40
|
const NBSP = " ";
|
|
41
|
-
const PUNCTUATION_LIST = [
|
|
41
|
+
const PUNCTUATION_LIST = [
|
|
42
|
+
"\xB7",
|
|
43
|
+
"\u3001",
|
|
44
|
+
":",
|
|
45
|
+
"\uFF1A",
|
|
46
|
+
",",
|
|
47
|
+
"\uFF0C",
|
|
48
|
+
".",
|
|
49
|
+
"\u3002",
|
|
50
|
+
";",
|
|
51
|
+
"\uFF1B",
|
|
52
|
+
"?",
|
|
53
|
+
"\uFF1F",
|
|
54
|
+
"!",
|
|
55
|
+
"\uFF01"
|
|
56
|
+
];
|
|
42
57
|
const maxHeightRadioMapping = {
|
|
43
58
|
[MaxHeightRatio.HALF]: 1 / 2,
|
|
44
59
|
[MaxHeightRatio.ONE_THIRD]: 1 / 3,
|
|
@@ -154,8 +169,37 @@ function nextTick(fn) {
|
|
|
154
169
|
}, 0);
|
|
155
170
|
}
|
|
156
171
|
function convertNumberToChinese(num) {
|
|
157
|
-
const chineseNum = [
|
|
158
|
-
|
|
172
|
+
const chineseNum = [
|
|
173
|
+
"\u96F6",
|
|
174
|
+
"\u4E00",
|
|
175
|
+
"\u4E8C",
|
|
176
|
+
"\u4E09",
|
|
177
|
+
"\u56DB",
|
|
178
|
+
"\u4E94",
|
|
179
|
+
"\u516D",
|
|
180
|
+
"\u4E03",
|
|
181
|
+
"\u516B",
|
|
182
|
+
"\u4E5D"
|
|
183
|
+
];
|
|
184
|
+
const chineseUnit = [
|
|
185
|
+
"",
|
|
186
|
+
"\u5341",
|
|
187
|
+
"\u767E",
|
|
188
|
+
"\u5343",
|
|
189
|
+
"\u4E07",
|
|
190
|
+
"\u5341",
|
|
191
|
+
"\u767E",
|
|
192
|
+
"\u5343",
|
|
193
|
+
"\u4EBF",
|
|
194
|
+
"\u5341",
|
|
195
|
+
"\u767E",
|
|
196
|
+
"\u5343",
|
|
197
|
+
"\u4E07",
|
|
198
|
+
"\u5341",
|
|
199
|
+
"\u767E",
|
|
200
|
+
"\u5343",
|
|
201
|
+
"\u4EBF"
|
|
202
|
+
];
|
|
159
203
|
if (!num || isNaN(num))
|
|
160
204
|
return "\u96F6";
|
|
161
205
|
const numStr = num.toString().split("");
|
|
@@ -279,10 +323,7 @@ const TABLE_CONTEXT_ATTR = [
|
|
|
279
323
|
"trId",
|
|
280
324
|
"tableId"
|
|
281
325
|
];
|
|
282
|
-
const TITLE_CONTEXT_ATTR = [
|
|
283
|
-
"level",
|
|
284
|
-
"titleId"
|
|
285
|
-
];
|
|
326
|
+
const TITLE_CONTEXT_ATTR = ["level", "titleId"];
|
|
286
327
|
const LIST_CONTEXT_ATTR = [
|
|
287
328
|
"listId",
|
|
288
329
|
"listType",
|
|
@@ -307,113 +348,11 @@ const INLINE_ELEMENT_TYPE = [
|
|
|
307
348
|
ElementType.SEPARATOR,
|
|
308
349
|
ElementType.TABLE
|
|
309
350
|
];
|
|
310
|
-
const INLINE_NODE_NAME = [
|
|
311
|
-
"HR",
|
|
312
|
-
"TABLE",
|
|
313
|
-
"UL",
|
|
314
|
-
"OL"
|
|
315
|
-
];
|
|
351
|
+
const INLINE_NODE_NAME = ["HR", "TABLE", "UL", "OL"];
|
|
316
352
|
const VIRTUAL_ELEMENT_TYPE = [
|
|
317
353
|
ElementType.TITLE,
|
|
318
354
|
ElementType.LIST
|
|
319
355
|
];
|
|
320
|
-
var ListType;
|
|
321
|
-
(function(ListType2) {
|
|
322
|
-
ListType2["UL"] = "ul";
|
|
323
|
-
ListType2["OL"] = "ol";
|
|
324
|
-
})(ListType || (ListType = {}));
|
|
325
|
-
var UlStyle;
|
|
326
|
-
(function(UlStyle2) {
|
|
327
|
-
UlStyle2["DISC"] = "disc";
|
|
328
|
-
UlStyle2["CIRCLE"] = "circle";
|
|
329
|
-
UlStyle2["SQUARE"] = "square";
|
|
330
|
-
})(UlStyle || (UlStyle = {}));
|
|
331
|
-
var OlStyle;
|
|
332
|
-
(function(OlStyle2) {
|
|
333
|
-
OlStyle2["DECIMAL"] = "decimal";
|
|
334
|
-
})(OlStyle || (OlStyle = {}));
|
|
335
|
-
var ListStyle;
|
|
336
|
-
(function(ListStyle2) {
|
|
337
|
-
ListStyle2["DISC"] = "disc";
|
|
338
|
-
ListStyle2["CIRCLE"] = "circle";
|
|
339
|
-
ListStyle2["SQUARE"] = "square";
|
|
340
|
-
ListStyle2["DECIMAL"] = "decimal";
|
|
341
|
-
})(ListStyle || (ListStyle = {}));
|
|
342
|
-
const ulStyleMapping = {
|
|
343
|
-
[UlStyle.DISC]: "\u2022",
|
|
344
|
-
[UlStyle.CIRCLE]: "\u25E6",
|
|
345
|
-
[UlStyle.SQUARE]: "\u25AB\uFE0E"
|
|
346
|
-
};
|
|
347
|
-
const listTypeElementMapping = {
|
|
348
|
-
[ListType.OL]: "ol",
|
|
349
|
-
[ListType.UL]: "ul"
|
|
350
|
-
};
|
|
351
|
-
const listStyleCSSMapping = {
|
|
352
|
-
[ListStyle.DISC]: "disc",
|
|
353
|
-
[ListStyle.CIRCLE]: "circle",
|
|
354
|
-
[ListStyle.SQUARE]: "square",
|
|
355
|
-
[ListStyle.DECIMAL]: "decimal"
|
|
356
|
-
};
|
|
357
|
-
var TitleLevel;
|
|
358
|
-
(function(TitleLevel2) {
|
|
359
|
-
TitleLevel2["FIRST"] = "first";
|
|
360
|
-
TitleLevel2["SECOND"] = "second";
|
|
361
|
-
TitleLevel2["THIRD"] = "third";
|
|
362
|
-
TitleLevel2["FOURTH"] = "fourth";
|
|
363
|
-
TitleLevel2["FIFTH"] = "fifth";
|
|
364
|
-
TitleLevel2["SIXTH"] = "sixth";
|
|
365
|
-
})(TitleLevel || (TitleLevel = {}));
|
|
366
|
-
const defaultTitleOption = {
|
|
367
|
-
defaultFirstSize: 26,
|
|
368
|
-
defaultSecondSize: 24,
|
|
369
|
-
defaultThirdSize: 22,
|
|
370
|
-
defaultFourthSize: 20,
|
|
371
|
-
defaultFifthSize: 18,
|
|
372
|
-
defaultSixthSize: 16
|
|
373
|
-
};
|
|
374
|
-
const titleSizeMapping = {
|
|
375
|
-
[TitleLevel.FIRST]: "defaultFirstSize",
|
|
376
|
-
[TitleLevel.SECOND]: "defaultSecondSize",
|
|
377
|
-
[TitleLevel.THIRD]: "defaultThirdSize",
|
|
378
|
-
[TitleLevel.FOURTH]: "defaultFourthSize",
|
|
379
|
-
[TitleLevel.FIFTH]: "defaultFifthSize",
|
|
380
|
-
[TitleLevel.SIXTH]: "defaultSixthSize"
|
|
381
|
-
};
|
|
382
|
-
const titleOrderNumberMapping = {
|
|
383
|
-
[TitleLevel.FIRST]: 1,
|
|
384
|
-
[TitleLevel.SECOND]: 2,
|
|
385
|
-
[TitleLevel.THIRD]: 3,
|
|
386
|
-
[TitleLevel.FOURTH]: 4,
|
|
387
|
-
[TitleLevel.FIFTH]: 5,
|
|
388
|
-
[TitleLevel.SIXTH]: 6
|
|
389
|
-
};
|
|
390
|
-
const titleNodeNameMapping = {
|
|
391
|
-
"H1": TitleLevel.FIRST,
|
|
392
|
-
"H2": TitleLevel.SECOND,
|
|
393
|
-
"H3": TitleLevel.THIRD,
|
|
394
|
-
"H4": TitleLevel.FOURTH,
|
|
395
|
-
"H5": TitleLevel.FIFTH,
|
|
396
|
-
"H6": TitleLevel.SIXTH
|
|
397
|
-
};
|
|
398
|
-
var ControlType;
|
|
399
|
-
(function(ControlType2) {
|
|
400
|
-
ControlType2["TEXT"] = "text";
|
|
401
|
-
ControlType2["SELECT"] = "select";
|
|
402
|
-
ControlType2["CHECKBOX"] = "checkbox";
|
|
403
|
-
})(ControlType || (ControlType = {}));
|
|
404
|
-
var ControlComponent;
|
|
405
|
-
(function(ControlComponent2) {
|
|
406
|
-
ControlComponent2["PREFIX"] = "prefix";
|
|
407
|
-
ControlComponent2["POSTFIX"] = "postfix";
|
|
408
|
-
ControlComponent2["PLACEHOLDER"] = "placeholder";
|
|
409
|
-
ControlComponent2["VALUE"] = "value";
|
|
410
|
-
ControlComponent2["CHECKBOX"] = "checkbox";
|
|
411
|
-
})(ControlComponent || (ControlComponent = {}));
|
|
412
|
-
var ImageDisplay;
|
|
413
|
-
(function(ImageDisplay2) {
|
|
414
|
-
ImageDisplay2["INLINE"] = "inline";
|
|
415
|
-
ImageDisplay2["BLOCK"] = "block";
|
|
416
|
-
})(ImageDisplay || (ImageDisplay = {}));
|
|
417
356
|
class ImageParticle {
|
|
418
357
|
constructor(draw) {
|
|
419
358
|
__publicField(this, "draw");
|
|
@@ -2095,9 +2034,13 @@ const raw = {
|
|
|
2095
2034
|
const SYMB = {
|
|
2096
2035
|
"\\frac": { glyph: 0, arity: 2, flags: {} },
|
|
2097
2036
|
"\\binom": { glyph: 0, arity: 2, flags: {} },
|
|
2098
|
-
"\\sqrt": {
|
|
2037
|
+
"\\sqrt": {
|
|
2038
|
+
glyph: 2267,
|
|
2039
|
+
arity: 1,
|
|
2040
|
+
flags: { opt: true, xfl: true, yfl: true }
|
|
2041
|
+
},
|
|
2099
2042
|
"^": { glyph: 0, arity: 1, flags: {} },
|
|
2100
|
-
|
|
2043
|
+
_: { glyph: 0, arity: 1, flags: {} },
|
|
2101
2044
|
"(": { glyph: 2221, arity: 0, flags: { yfl: true } },
|
|
2102
2045
|
")": { glyph: 2222, arity: 0, flags: { yfl: true } },
|
|
2103
2046
|
"[": { glyph: 2223, arity: 0, flags: { yfl: true } },
|
|
@@ -2132,12 +2075,28 @@ const SYMB = {
|
|
|
2132
2075
|
"\\dagger": { glyph: 2277, arity: 0, flags: {} },
|
|
2133
2076
|
"\\ddagger": { glyph: 2278, arity: 0, flags: {} },
|
|
2134
2077
|
"\\ell": { glyph: 662, arity: 0, flags: {} },
|
|
2135
|
-
"\\vec": {
|
|
2136
|
-
|
|
2137
|
-
|
|
2078
|
+
"\\vec": {
|
|
2079
|
+
glyph: 2261,
|
|
2080
|
+
arity: 1,
|
|
2081
|
+
flags: { hat: true, xfl: true, yfl: true }
|
|
2082
|
+
},
|
|
2083
|
+
"\\overrightarrow": {
|
|
2084
|
+
glyph: 2261,
|
|
2085
|
+
arity: 1,
|
|
2086
|
+
flags: { hat: true, xfl: true, yfl: true }
|
|
2087
|
+
},
|
|
2088
|
+
"\\overleftarrow": {
|
|
2089
|
+
glyph: 2263,
|
|
2090
|
+
arity: 1,
|
|
2091
|
+
flags: { hat: true, xfl: true, yfl: true }
|
|
2092
|
+
},
|
|
2138
2093
|
"\\bar": { glyph: 2231, arity: 1, flags: { hat: true, xfl: true } },
|
|
2139
2094
|
"\\overline": { glyph: 2231, arity: 1, flags: { hat: true, xfl: true } },
|
|
2140
|
-
"\\widehat": {
|
|
2095
|
+
"\\widehat": {
|
|
2096
|
+
glyph: 2247,
|
|
2097
|
+
arity: 1,
|
|
2098
|
+
flags: { hat: true, xfl: true, yfl: true }
|
|
2099
|
+
},
|
|
2141
2100
|
"\\hat": { glyph: 2247, arity: 1, flags: { hat: true } },
|
|
2142
2101
|
"\\acute": { glyph: 2248, arity: 1, flags: { hat: true } },
|
|
2143
2102
|
"\\grave": { glyph: 2249, arity: 1, flags: { hat: true } },
|
|
@@ -2401,7 +2360,13 @@ function tokenize(str) {
|
|
|
2401
2360
|
return tokens;
|
|
2402
2361
|
}
|
|
2403
2362
|
function parseAtom(x) {
|
|
2404
|
-
return {
|
|
2363
|
+
return {
|
|
2364
|
+
type: SYMB[x] ? "symb" : "char",
|
|
2365
|
+
mode: "math",
|
|
2366
|
+
text: x,
|
|
2367
|
+
chld: [],
|
|
2368
|
+
bbox: null
|
|
2369
|
+
};
|
|
2405
2370
|
}
|
|
2406
2371
|
function parse(tokens) {
|
|
2407
2372
|
let i = 0;
|
|
@@ -2847,7 +2812,12 @@ function plan(expr, mode = "math") {
|
|
|
2847
2812
|
const mw = Math.max(a.bbox.w, b.bbox.w) * s;
|
|
2848
2813
|
transform(a, s, null, (mw - a.bbox.w * s) / 2, 0);
|
|
2849
2814
|
transform(b, s, null, (mw - b.bbox.w * s) / 2, a.bbox.h + CONFIG.FRAC_SPACING);
|
|
2850
|
-
expr.bbox = {
|
|
2815
|
+
expr.bbox = {
|
|
2816
|
+
x: 0,
|
|
2817
|
+
y: -a.bbox.h + 1 - CONFIG.FRAC_SPACING / 2,
|
|
2818
|
+
w: mw,
|
|
2819
|
+
h: a.bbox.h + b.bbox.h + CONFIG.FRAC_SPACING
|
|
2820
|
+
};
|
|
2851
2821
|
} else if (expr.text == "\\binom") {
|
|
2852
2822
|
const a = expr.chld[0];
|
|
2853
2823
|
const b = expr.chld[1];
|
|
@@ -2872,7 +2842,12 @@ function plan(expr, mode = "math") {
|
|
|
2872
2842
|
transform(f, CONFIG.SQRT_MAG_SCALE, null, 0, 0.5);
|
|
2873
2843
|
}
|
|
2874
2844
|
transform(e, 1, null, 1 + pl, 0.5);
|
|
2875
|
-
expr.bbox = {
|
|
2845
|
+
expr.bbox = {
|
|
2846
|
+
x: 0,
|
|
2847
|
+
y: 2 - e.bbox.h - 0.5,
|
|
2848
|
+
w: e.bbox.w + 1 + pl,
|
|
2849
|
+
h: e.bbox.h + 0.5
|
|
2850
|
+
};
|
|
2876
2851
|
} else if (SYMB[expr.text] && SYMB[expr.text].flags.hat) {
|
|
2877
2852
|
const e = expr.chld[0];
|
|
2878
2853
|
plan(e);
|
|
@@ -2947,18 +2922,18 @@ function plan(expr, mode = "math") {
|
|
|
2947
2922
|
}
|
|
2948
2923
|
dy += mh;
|
|
2949
2924
|
const m2s = {
|
|
2950
|
-
|
|
2951
|
-
|
|
2952
|
-
|
|
2953
|
-
|
|
2925
|
+
bmatrix: ["[", "]"],
|
|
2926
|
+
pmatrix: ["(", ")"],
|
|
2927
|
+
Bmatrix: ["\\{", "\\}"],
|
|
2928
|
+
cases: ["\\{"]
|
|
2954
2929
|
};
|
|
2955
2930
|
const alt = (_c = {
|
|
2956
|
-
|
|
2957
|
-
|
|
2958
|
-
|
|
2959
|
-
|
|
2960
|
-
|
|
2961
|
-
|
|
2931
|
+
bmatrix: "center",
|
|
2932
|
+
pmatrix: "center",
|
|
2933
|
+
Bmatrix: "center",
|
|
2934
|
+
cases: "left",
|
|
2935
|
+
matrix: "center",
|
|
2936
|
+
aligned: "equation"
|
|
2962
2937
|
}[expr.text]) != null ? _c : "left";
|
|
2963
2938
|
const hasLp = !!m2s[expr.text];
|
|
2964
2939
|
const hasRp = !!m2s[expr.text] && m2s[expr.text].length > 1;
|
|
@@ -2971,7 +2946,12 @@ function plan(expr, mode = "math") {
|
|
|
2971
2946
|
for (let i = 0; i < expr.chld.length; i++) {
|
|
2972
2947
|
transform(expr.chld[i], 1, null, -bb.x + (hasLp ? 1.5 : 0), -bb.y);
|
|
2973
2948
|
}
|
|
2974
|
-
expr.bbox = {
|
|
2949
|
+
expr.bbox = {
|
|
2950
|
+
x: 0,
|
|
2951
|
+
y: 0,
|
|
2952
|
+
w: bb.w + 1.5 * Number(hasLp) + 1.5 * Number(hasRp),
|
|
2953
|
+
h: bb.h
|
|
2954
|
+
};
|
|
2975
2955
|
if (hasLp) {
|
|
2976
2956
|
expr.chld.unshift({
|
|
2977
2957
|
type: "symb",
|
|
@@ -3447,6 +3427,103 @@ const defaultControlOption = {
|
|
|
3447
3427
|
prefix: "{",
|
|
3448
3428
|
postfix: "}"
|
|
3449
3429
|
};
|
|
3430
|
+
var ListType;
|
|
3431
|
+
(function(ListType2) {
|
|
3432
|
+
ListType2["UL"] = "ul";
|
|
3433
|
+
ListType2["OL"] = "ol";
|
|
3434
|
+
})(ListType || (ListType = {}));
|
|
3435
|
+
var UlStyle;
|
|
3436
|
+
(function(UlStyle2) {
|
|
3437
|
+
UlStyle2["DISC"] = "disc";
|
|
3438
|
+
UlStyle2["CIRCLE"] = "circle";
|
|
3439
|
+
UlStyle2["SQUARE"] = "square";
|
|
3440
|
+
})(UlStyle || (UlStyle = {}));
|
|
3441
|
+
var OlStyle;
|
|
3442
|
+
(function(OlStyle2) {
|
|
3443
|
+
OlStyle2["DECIMAL"] = "decimal";
|
|
3444
|
+
})(OlStyle || (OlStyle = {}));
|
|
3445
|
+
var ListStyle;
|
|
3446
|
+
(function(ListStyle2) {
|
|
3447
|
+
ListStyle2["DISC"] = "disc";
|
|
3448
|
+
ListStyle2["CIRCLE"] = "circle";
|
|
3449
|
+
ListStyle2["SQUARE"] = "square";
|
|
3450
|
+
ListStyle2["DECIMAL"] = "decimal";
|
|
3451
|
+
})(ListStyle || (ListStyle = {}));
|
|
3452
|
+
const ulStyleMapping = {
|
|
3453
|
+
[UlStyle.DISC]: "\u2022",
|
|
3454
|
+
[UlStyle.CIRCLE]: "\u25E6",
|
|
3455
|
+
[UlStyle.SQUARE]: "\u25AB\uFE0E"
|
|
3456
|
+
};
|
|
3457
|
+
const listTypeElementMapping = {
|
|
3458
|
+
[ListType.OL]: "ol",
|
|
3459
|
+
[ListType.UL]: "ul"
|
|
3460
|
+
};
|
|
3461
|
+
const listStyleCSSMapping = {
|
|
3462
|
+
[ListStyle.DISC]: "disc",
|
|
3463
|
+
[ListStyle.CIRCLE]: "circle",
|
|
3464
|
+
[ListStyle.SQUARE]: "square",
|
|
3465
|
+
[ListStyle.DECIMAL]: "decimal"
|
|
3466
|
+
};
|
|
3467
|
+
var TitleLevel;
|
|
3468
|
+
(function(TitleLevel2) {
|
|
3469
|
+
TitleLevel2["FIRST"] = "first";
|
|
3470
|
+
TitleLevel2["SECOND"] = "second";
|
|
3471
|
+
TitleLevel2["THIRD"] = "third";
|
|
3472
|
+
TitleLevel2["FOURTH"] = "fourth";
|
|
3473
|
+
TitleLevel2["FIFTH"] = "fifth";
|
|
3474
|
+
TitleLevel2["SIXTH"] = "sixth";
|
|
3475
|
+
})(TitleLevel || (TitleLevel = {}));
|
|
3476
|
+
const defaultTitleOption = {
|
|
3477
|
+
defaultFirstSize: 26,
|
|
3478
|
+
defaultSecondSize: 24,
|
|
3479
|
+
defaultThirdSize: 22,
|
|
3480
|
+
defaultFourthSize: 20,
|
|
3481
|
+
defaultFifthSize: 18,
|
|
3482
|
+
defaultSixthSize: 16
|
|
3483
|
+
};
|
|
3484
|
+
const titleSizeMapping = {
|
|
3485
|
+
[TitleLevel.FIRST]: "defaultFirstSize",
|
|
3486
|
+
[TitleLevel.SECOND]: "defaultSecondSize",
|
|
3487
|
+
[TitleLevel.THIRD]: "defaultThirdSize",
|
|
3488
|
+
[TitleLevel.FOURTH]: "defaultFourthSize",
|
|
3489
|
+
[TitleLevel.FIFTH]: "defaultFifthSize",
|
|
3490
|
+
[TitleLevel.SIXTH]: "defaultSixthSize"
|
|
3491
|
+
};
|
|
3492
|
+
const titleOrderNumberMapping = {
|
|
3493
|
+
[TitleLevel.FIRST]: 1,
|
|
3494
|
+
[TitleLevel.SECOND]: 2,
|
|
3495
|
+
[TitleLevel.THIRD]: 3,
|
|
3496
|
+
[TitleLevel.FOURTH]: 4,
|
|
3497
|
+
[TitleLevel.FIFTH]: 5,
|
|
3498
|
+
[TitleLevel.SIXTH]: 6
|
|
3499
|
+
};
|
|
3500
|
+
const titleNodeNameMapping = {
|
|
3501
|
+
H1: TitleLevel.FIRST,
|
|
3502
|
+
H2: TitleLevel.SECOND,
|
|
3503
|
+
H3: TitleLevel.THIRD,
|
|
3504
|
+
H4: TitleLevel.FOURTH,
|
|
3505
|
+
H5: TitleLevel.FIFTH,
|
|
3506
|
+
H6: TitleLevel.SIXTH
|
|
3507
|
+
};
|
|
3508
|
+
var ControlType;
|
|
3509
|
+
(function(ControlType2) {
|
|
3510
|
+
ControlType2["TEXT"] = "text";
|
|
3511
|
+
ControlType2["SELECT"] = "select";
|
|
3512
|
+
ControlType2["CHECKBOX"] = "checkbox";
|
|
3513
|
+
})(ControlType || (ControlType = {}));
|
|
3514
|
+
var ControlComponent;
|
|
3515
|
+
(function(ControlComponent2) {
|
|
3516
|
+
ControlComponent2["PREFIX"] = "prefix";
|
|
3517
|
+
ControlComponent2["POSTFIX"] = "postfix";
|
|
3518
|
+
ControlComponent2["PLACEHOLDER"] = "placeholder";
|
|
3519
|
+
ControlComponent2["VALUE"] = "value";
|
|
3520
|
+
ControlComponent2["CHECKBOX"] = "checkbox";
|
|
3521
|
+
})(ControlComponent || (ControlComponent = {}));
|
|
3522
|
+
var ImageDisplay;
|
|
3523
|
+
(function(ImageDisplay2) {
|
|
3524
|
+
ImageDisplay2["INLINE"] = "inline";
|
|
3525
|
+
ImageDisplay2["BLOCK"] = "block";
|
|
3526
|
+
})(ImageDisplay || (ImageDisplay = {}));
|
|
3450
3527
|
function unzipElementList(elementList) {
|
|
3451
3528
|
const result = [];
|
|
3452
3529
|
for (let v = 0; v < elementList.length; v++) {
|
|
@@ -3638,9 +3715,11 @@ function formatElementList(elementList, options) {
|
|
|
3638
3715
|
if (Array.isArray(valueSets) && valueSets.length) {
|
|
3639
3716
|
const valueSet = valueSets.find((v) => v.code === code);
|
|
3640
3717
|
if (valueSet) {
|
|
3641
|
-
valueList = [
|
|
3642
|
-
|
|
3643
|
-
|
|
3718
|
+
valueList = [
|
|
3719
|
+
{
|
|
3720
|
+
value: valueSet.value
|
|
3721
|
+
}
|
|
3722
|
+
];
|
|
3644
3723
|
}
|
|
3645
3724
|
}
|
|
3646
3725
|
}
|
|
@@ -3942,8 +4021,9 @@ function formatElementContext(sourceElementList, formatElementList2, anchorIndex
|
|
|
3942
4021
|
const { isBreakWhenWrap = false } = options || {};
|
|
3943
4022
|
for (let e = 0; e < formatElementList2.length; e++) {
|
|
3944
4023
|
const targetElement = formatElementList2[e];
|
|
3945
|
-
if (isBreakWhenWrap && !copyElement.listId && /^\n/.test(targetElement.value))
|
|
4024
|
+
if (isBreakWhenWrap && !copyElement.listId && /^\n/.test(targetElement.value)) {
|
|
3946
4025
|
break;
|
|
4026
|
+
}
|
|
3947
4027
|
if (!copyElement.listId && targetElement.type === ElementType.LIST) {
|
|
3948
4028
|
(_a = targetElement.valueList) == null ? void 0 : _a.forEach((valueItem) => {
|
|
3949
4029
|
cloneProperty(TABLE_CONTEXT_ATTR, copyElement, valueItem);
|
|
@@ -3956,31 +4036,6 @@ function formatElementContext(sourceElementList, formatElementList2, anchorIndex
|
|
|
3956
4036
|
cloneProperty(EDITOR_ELEMENT_CONTEXT_ATTR, copyElement, targetElement);
|
|
3957
4037
|
}
|
|
3958
4038
|
}
|
|
3959
|
-
function writeClipboardItem(text, html) {
|
|
3960
|
-
if (!text || !html)
|
|
3961
|
-
return;
|
|
3962
|
-
const plainText = new Blob([text], { type: "text/plain" });
|
|
3963
|
-
const htmlText = new Blob([html], { type: "text/html" });
|
|
3964
|
-
if (window.ClipboardItem) {
|
|
3965
|
-
const item = new ClipboardItem({
|
|
3966
|
-
[plainText.type]: plainText,
|
|
3967
|
-
[htmlText.type]: htmlText
|
|
3968
|
-
});
|
|
3969
|
-
window.navigator.clipboard.write([item]);
|
|
3970
|
-
} else {
|
|
3971
|
-
const fakeElement = document.createElement("div");
|
|
3972
|
-
fakeElement.setAttribute("contenteditable", "true");
|
|
3973
|
-
fakeElement.innerHTML = html;
|
|
3974
|
-
document.body.append(fakeElement);
|
|
3975
|
-
const selection = window.getSelection();
|
|
3976
|
-
const range = document.createRange();
|
|
3977
|
-
range.selectNodeContents(fakeElement);
|
|
3978
|
-
selection == null ? void 0 : selection.removeAllRanges();
|
|
3979
|
-
selection == null ? void 0 : selection.addRange(range);
|
|
3980
|
-
document.execCommand("copy");
|
|
3981
|
-
fakeElement.remove();
|
|
3982
|
-
}
|
|
3983
|
-
}
|
|
3984
4039
|
function convertElementToDom(element, options) {
|
|
3985
4040
|
let tagName = "span";
|
|
3986
4041
|
if (element.type === ElementType.SUPERSCRIPT) {
|
|
@@ -4012,10 +4067,10 @@ function convertElementToDom(element, options) {
|
|
|
4012
4067
|
dom.innerText = element.value.replace(new RegExp(`${ZERO}`, "g"), "\n");
|
|
4013
4068
|
return dom;
|
|
4014
4069
|
}
|
|
4015
|
-
function
|
|
4016
|
-
function
|
|
4070
|
+
function createDomFromElementList(elementList, options) {
|
|
4071
|
+
function buildDom(payload) {
|
|
4017
4072
|
var _a, _b, _c, _d, _e;
|
|
4018
|
-
const
|
|
4073
|
+
const clipboardDom = document.createElement("div");
|
|
4019
4074
|
for (let e = 0; e < payload.length; e++) {
|
|
4020
4075
|
const element = payload[e];
|
|
4021
4076
|
if (element.type === ElementType.TABLE) {
|
|
@@ -4030,7 +4085,7 @@ function writeElementList(elementList, options) {
|
|
|
4030
4085
|
const td = tr.tdList[d];
|
|
4031
4086
|
tdDom.colSpan = td.colspan;
|
|
4032
4087
|
tdDom.rowSpan = td.rowspan;
|
|
4033
|
-
const childDom =
|
|
4088
|
+
const childDom = buildDom(zipElementList(td.value));
|
|
4034
4089
|
tdDom.innerHTML = childDom.innerHTML;
|
|
4035
4090
|
if (td.backgroundColor) {
|
|
4036
4091
|
tdDom.style.backgroundColor = td.backgroundColor;
|
|
@@ -4039,19 +4094,19 @@ function writeElementList(elementList, options) {
|
|
|
4039
4094
|
}
|
|
4040
4095
|
tableDom.append(trDom);
|
|
4041
4096
|
}
|
|
4042
|
-
|
|
4097
|
+
clipboardDom.append(tableDom);
|
|
4043
4098
|
} else if (element.type === ElementType.HYPERLINK) {
|
|
4044
4099
|
const a = document.createElement("a");
|
|
4045
4100
|
a.innerText = element.valueList.map((v) => v.value).join("");
|
|
4046
4101
|
if (element.url) {
|
|
4047
4102
|
a.href = element.url;
|
|
4048
4103
|
}
|
|
4049
|
-
|
|
4104
|
+
clipboardDom.append(a);
|
|
4050
4105
|
} else if (element.type === ElementType.TITLE) {
|
|
4051
4106
|
const h = document.createElement(`h${titleOrderNumberMapping[element.level]}`);
|
|
4052
|
-
const childDom =
|
|
4107
|
+
const childDom = buildDom(zipElementList(element.valueList));
|
|
4053
4108
|
h.innerHTML = childDom.innerHTML;
|
|
4054
|
-
|
|
4109
|
+
clipboardDom.append(h);
|
|
4055
4110
|
} else if (element.type === ElementType.LIST) {
|
|
4056
4111
|
const list = document.createElement(listTypeElementMapping[element.listType]);
|
|
4057
4112
|
if (element.listStyle) {
|
|
@@ -4083,11 +4138,11 @@ function writeElementList(elementList, options) {
|
|
|
4083
4138
|
}
|
|
4084
4139
|
listElementListMap.forEach((listElementList) => {
|
|
4085
4140
|
const li = document.createElement("li");
|
|
4086
|
-
const childDom =
|
|
4141
|
+
const childDom = buildDom(listElementList);
|
|
4087
4142
|
li.innerHTML = childDom.innerHTML;
|
|
4088
4143
|
list.append(li);
|
|
4089
4144
|
});
|
|
4090
|
-
|
|
4145
|
+
clipboardDom.append(list);
|
|
4091
4146
|
} else if (element.type === ElementType.IMAGE) {
|
|
4092
4147
|
const img = document.createElement("img");
|
|
4093
4148
|
if (element.value) {
|
|
@@ -4095,46 +4150,39 @@ function writeElementList(elementList, options) {
|
|
|
4095
4150
|
img.width = element.width;
|
|
4096
4151
|
img.height = element.height;
|
|
4097
4152
|
}
|
|
4098
|
-
|
|
4153
|
+
clipboardDom.append(img);
|
|
4099
4154
|
} else if (element.type === ElementType.SEPARATOR) {
|
|
4100
4155
|
const hr = document.createElement("hr");
|
|
4101
|
-
|
|
4156
|
+
clipboardDom.append(hr);
|
|
4102
4157
|
} else if (element.type === ElementType.CHECKBOX) {
|
|
4103
4158
|
const checkbox = document.createElement("input");
|
|
4104
4159
|
checkbox.type = "checkbox";
|
|
4105
4160
|
if ((_a = element.checkbox) == null ? void 0 : _a.value) {
|
|
4106
4161
|
checkbox.setAttribute("checked", "true");
|
|
4107
4162
|
}
|
|
4108
|
-
|
|
4163
|
+
clipboardDom.append(checkbox);
|
|
4109
4164
|
} else if (!element.type || element.type === ElementType.LATEX || TEXTLIKE_ELEMENT_TYPE.includes(element.type)) {
|
|
4110
|
-
let
|
|
4165
|
+
let text = "";
|
|
4111
4166
|
if (element.type === ElementType.CONTROL) {
|
|
4112
|
-
|
|
4167
|
+
text = ((_c = (_b = element.control.value) == null ? void 0 : _b[0]) == null ? void 0 : _c.value) || "";
|
|
4113
4168
|
} else if (element.type === ElementType.DATE) {
|
|
4114
|
-
|
|
4169
|
+
text = ((_d = element.valueList) == null ? void 0 : _d.map((v) => v.value).join("")) || "";
|
|
4115
4170
|
} else {
|
|
4116
|
-
|
|
4171
|
+
text = element.value;
|
|
4117
4172
|
}
|
|
4118
|
-
if (!
|
|
4173
|
+
if (!text)
|
|
4119
4174
|
continue;
|
|
4120
4175
|
if (((_e = payload[e - 1]) == null ? void 0 : _e.type) === ElementType.TITLE) {
|
|
4121
|
-
|
|
4176
|
+
text = text.replace(/^\n/, "");
|
|
4122
4177
|
}
|
|
4123
4178
|
const dom = convertElementToDom(element, options);
|
|
4124
|
-
dom.innerText =
|
|
4125
|
-
|
|
4179
|
+
dom.innerText = text.replace(new RegExp(`${ZERO}`, "g"), "\n");
|
|
4180
|
+
clipboardDom.append(dom);
|
|
4126
4181
|
}
|
|
4127
4182
|
}
|
|
4128
|
-
return
|
|
4183
|
+
return clipboardDom;
|
|
4129
4184
|
}
|
|
4130
|
-
|
|
4131
|
-
document.body.append(clipboardDom);
|
|
4132
|
-
const text = clipboardDom.innerText;
|
|
4133
|
-
clipboardDom.remove();
|
|
4134
|
-
const html = clipboardDom.innerHTML;
|
|
4135
|
-
if (!text || !html)
|
|
4136
|
-
return;
|
|
4137
|
-
writeClipboardItem(text, html);
|
|
4185
|
+
return buildDom(zipElementList(elementList));
|
|
4138
4186
|
}
|
|
4139
4187
|
function convertTextNodeToElement(textNode) {
|
|
4140
4188
|
if (!textNode || textNode.nodeType !== 3)
|
|
@@ -4189,9 +4237,11 @@ function getElementListByHTML(htmlText, options) {
|
|
|
4189
4237
|
elementList.push({
|
|
4190
4238
|
type: ElementType.HYPERLINK,
|
|
4191
4239
|
value: "",
|
|
4192
|
-
valueList: [
|
|
4193
|
-
|
|
4194
|
-
|
|
4240
|
+
valueList: [
|
|
4241
|
+
{
|
|
4242
|
+
value
|
|
4243
|
+
}
|
|
4244
|
+
],
|
|
4195
4245
|
url: aElement.href
|
|
4196
4246
|
});
|
|
4197
4247
|
}
|
|
@@ -4394,15 +4444,17 @@ class CursorAgent {
|
|
|
4394
4444
|
let start = 0;
|
|
4395
4445
|
while (start < pasteElementList.length) {
|
|
4396
4446
|
const pasteElement = pasteElementList[start];
|
|
4397
|
-
if (anchorElement.titleId && /^\n/.test(pasteElement.value))
|
|
4447
|
+
if (anchorElement.titleId && /^\n/.test(pasteElement.value)) {
|
|
4398
4448
|
break;
|
|
4449
|
+
}
|
|
4399
4450
|
if (VIRTUAL_ELEMENT_TYPE.includes(pasteElement.type)) {
|
|
4400
4451
|
pasteElementList.splice(start, 1);
|
|
4401
4452
|
if (pasteElement.valueList) {
|
|
4402
4453
|
for (let v = 0; v < pasteElement.valueList.length; v++) {
|
|
4403
4454
|
const element = pasteElement.valueList[v];
|
|
4404
|
-
if (element.value === ZERO || element.value === "\n")
|
|
4455
|
+
if (element.value === ZERO || element.value === "\n") {
|
|
4405
4456
|
continue;
|
|
4457
|
+
}
|
|
4406
4458
|
pasteElementList.splice(start, 0, element);
|
|
4407
4459
|
start++;
|
|
4408
4460
|
}
|
|
@@ -4488,7 +4540,7 @@ class Cursor {
|
|
|
4488
4540
|
return this.getAgentDom().value;
|
|
4489
4541
|
}
|
|
4490
4542
|
clearAgentDomValue() {
|
|
4491
|
-
|
|
4543
|
+
this.getAgentDom().value = "";
|
|
4492
4544
|
}
|
|
4493
4545
|
_blinkStart() {
|
|
4494
4546
|
this.cursorDom.classList.add(this.ANIMATION_CLASS);
|
|
@@ -4510,13 +4562,17 @@ class Cursor {
|
|
|
4510
4562
|
}
|
|
4511
4563
|
}
|
|
4512
4564
|
drawCursor(payload) {
|
|
4513
|
-
|
|
4565
|
+
let cursorPosition = this.position.getCursorPosition();
|
|
4514
4566
|
if (!cursorPosition)
|
|
4515
4567
|
return;
|
|
4516
4568
|
const { scale, cursor } = this.options;
|
|
4517
|
-
const { color, width, isShow = true, isBlink = true, isFocus = true } = __spreadValues(__spreadValues({}, cursor), payload);
|
|
4569
|
+
const { color, width, isShow = true, isBlink = true, isFocus = true, hitLineStartIndex } = __spreadValues(__spreadValues({}, cursor), payload);
|
|
4518
4570
|
const height = this.draw.getHeight();
|
|
4519
4571
|
const pageGap = this.draw.getPageGap();
|
|
4572
|
+
if (hitLineStartIndex) {
|
|
4573
|
+
const positionList = this.position.getPositionList();
|
|
4574
|
+
cursorPosition = positionList[hitLineStartIndex];
|
|
4575
|
+
}
|
|
4520
4576
|
const { metrics, coordinate: { leftTop, rightTop }, ascent, pageNo } = cursorPosition;
|
|
4521
4577
|
const zoneManager = this.draw.getZone();
|
|
4522
4578
|
const curPageNo = zoneManager.isMainActive() ? pageNo : this.draw.getPageNo();
|
|
@@ -4532,7 +4588,7 @@ class Cursor {
|
|
|
4532
4588
|
}
|
|
4533
4589
|
const descent = metrics.boundingBoxDescent < 0 ? 0 : metrics.boundingBoxDescent;
|
|
4534
4590
|
const cursorTop = leftTop[1] + ascent + descent - (cursorHeight - offsetHeight) + preY;
|
|
4535
|
-
const cursorLeft = rightTop[0];
|
|
4591
|
+
const cursorLeft = hitLineStartIndex ? leftTop[0] : rightTop[0];
|
|
4536
4592
|
agentCursorDom.style.left = `${cursorLeft}px`;
|
|
4537
4593
|
agentCursorDom.style.top = `${cursorTop + cursorHeight - CURSOR_AGENT_HEIGHT * scale}px`;
|
|
4538
4594
|
if (!isShow)
|
|
@@ -4776,7 +4832,7 @@ function mousedown(evt, host) {
|
|
|
4776
4832
|
});
|
|
4777
4833
|
if (!positionResult)
|
|
4778
4834
|
return;
|
|
4779
|
-
const { index: index2, isDirectHit, isCheckbox, isImage, isTable, tdValueIndex } = positionResult;
|
|
4835
|
+
const { index: index2, isDirectHit, isCheckbox, isImage, isTable, tdValueIndex, hitLineStartIndex } = positionResult;
|
|
4780
4836
|
host.mouseDownStartPosition = __spreadProps(__spreadValues({}, positionResult), {
|
|
4781
4837
|
index: isTable ? tdValueIndex : index2
|
|
4782
4838
|
});
|
|
@@ -4811,6 +4867,11 @@ function mousedown(evt, host) {
|
|
|
4811
4867
|
isSetCursor: !isDirectHitImage && !isDirectHitCheckbox,
|
|
4812
4868
|
isCompute: false
|
|
4813
4869
|
});
|
|
4870
|
+
if (hitLineStartIndex) {
|
|
4871
|
+
host.getDraw().getCursor().drawCursor({
|
|
4872
|
+
hitLineStartIndex
|
|
4873
|
+
});
|
|
4874
|
+
}
|
|
4814
4875
|
}
|
|
4815
4876
|
const previewer = draw.getPreviewer();
|
|
4816
4877
|
previewer.clearResizer();
|
|
@@ -4978,8 +5039,9 @@ function mouseleave(evt, host) {
|
|
|
4978
5039
|
const draw = host.getDraw();
|
|
4979
5040
|
const pageContainer = draw.getPageContainer();
|
|
4980
5041
|
const { x, y, width, height } = pageContainer.getBoundingClientRect();
|
|
4981
|
-
if (evt.x >= x && evt.x <= x + width && evt.y >= y && evt.y <= y + height)
|
|
5042
|
+
if (evt.x >= x && evt.x <= x + width && evt.y >= y && evt.y <= y + height) {
|
|
4982
5043
|
return;
|
|
5044
|
+
}
|
|
4983
5045
|
host.setIsAllowSelection(false);
|
|
4984
5046
|
}
|
|
4985
5047
|
function mousemove(evt, host) {
|
|
@@ -5187,8 +5249,9 @@ function keydown(evt, host) {
|
|
|
5187
5249
|
}
|
|
5188
5250
|
}
|
|
5189
5251
|
const maxElementListIndex = elementList.length - 1;
|
|
5190
|
-
if (anchorStartIndex > maxElementListIndex || anchorEndIndex > maxElementListIndex)
|
|
5252
|
+
if (anchorStartIndex > maxElementListIndex || anchorEndIndex > maxElementListIndex) {
|
|
5191
5253
|
return;
|
|
5254
|
+
}
|
|
5192
5255
|
rangeManager.setRange(anchorStartIndex, anchorEndIndex);
|
|
5193
5256
|
const isCollapsed2 = anchorStartIndex === anchorEndIndex;
|
|
5194
5257
|
draw.render({
|
|
@@ -5293,6 +5356,10 @@ function keydown(evt, host) {
|
|
|
5293
5356
|
if (listener.saved) {
|
|
5294
5357
|
listener.saved(draw.getValue());
|
|
5295
5358
|
}
|
|
5359
|
+
const eventBus = draw.getEventBus();
|
|
5360
|
+
if (eventBus.isSubscribe("saved")) {
|
|
5361
|
+
eventBus.emit("saved", draw.getValue());
|
|
5362
|
+
}
|
|
5296
5363
|
evt.preventDefault();
|
|
5297
5364
|
} else if (evt.key === KeyMap.ESC) {
|
|
5298
5365
|
host.clearPainterStyle();
|
|
@@ -5302,10 +5369,12 @@ function keydown(evt, host) {
|
|
|
5302
5369
|
}
|
|
5303
5370
|
evt.preventDefault();
|
|
5304
5371
|
} else if (evt.key === KeyMap.TAB) {
|
|
5305
|
-
draw.insertElementList([
|
|
5306
|
-
|
|
5307
|
-
|
|
5308
|
-
|
|
5372
|
+
draw.insertElementList([
|
|
5373
|
+
{
|
|
5374
|
+
type: ElementType.TAB,
|
|
5375
|
+
value: ""
|
|
5376
|
+
}
|
|
5377
|
+
]);
|
|
5309
5378
|
evt.preventDefault();
|
|
5310
5379
|
}
|
|
5311
5380
|
}
|
|
@@ -5396,6 +5465,41 @@ function removeComposingInput(host) {
|
|
|
5396
5465
|
rangeManager.setRange(startIndex, startIndex);
|
|
5397
5466
|
host.compositionInfo = null;
|
|
5398
5467
|
}
|
|
5468
|
+
function writeClipboardItem(text, html) {
|
|
5469
|
+
if (!text || !html)
|
|
5470
|
+
return;
|
|
5471
|
+
const plainText = new Blob([text], { type: "text/plain" });
|
|
5472
|
+
const htmlText = new Blob([html], { type: "text/html" });
|
|
5473
|
+
if (window.ClipboardItem) {
|
|
5474
|
+
const item = new ClipboardItem({
|
|
5475
|
+
[plainText.type]: plainText,
|
|
5476
|
+
[htmlText.type]: htmlText
|
|
5477
|
+
});
|
|
5478
|
+
window.navigator.clipboard.write([item]);
|
|
5479
|
+
} else {
|
|
5480
|
+
const fakeElement = document.createElement("div");
|
|
5481
|
+
fakeElement.setAttribute("contenteditable", "true");
|
|
5482
|
+
fakeElement.innerHTML = html;
|
|
5483
|
+
document.body.append(fakeElement);
|
|
5484
|
+
const selection = window.getSelection();
|
|
5485
|
+
const range = document.createRange();
|
|
5486
|
+
range.selectNodeContents(fakeElement);
|
|
5487
|
+
selection == null ? void 0 : selection.removeAllRanges();
|
|
5488
|
+
selection == null ? void 0 : selection.addRange(range);
|
|
5489
|
+
document.execCommand("copy");
|
|
5490
|
+
fakeElement.remove();
|
|
5491
|
+
}
|
|
5492
|
+
}
|
|
5493
|
+
function writeElementList(elementList, options) {
|
|
5494
|
+
const clipboardDom = createDomFromElementList(elementList, options);
|
|
5495
|
+
document.body.append(clipboardDom);
|
|
5496
|
+
const text = clipboardDom.innerText;
|
|
5497
|
+
clipboardDom.remove();
|
|
5498
|
+
const html = clipboardDom.innerHTML;
|
|
5499
|
+
if (!text || !html)
|
|
5500
|
+
return;
|
|
5501
|
+
writeClipboardItem(text, html);
|
|
5502
|
+
}
|
|
5399
5503
|
function cut(host) {
|
|
5400
5504
|
const draw = host.getDraw();
|
|
5401
5505
|
const rangeManager = draw.getRange();
|
|
@@ -5762,7 +5866,6 @@ class CanvasEvent {
|
|
|
5762
5866
|
class GlobalEvent {
|
|
5763
5867
|
constructor(draw, canvasEvent) {
|
|
5764
5868
|
__publicField(this, "draw");
|
|
5765
|
-
__publicField(this, "canvas");
|
|
5766
5869
|
__publicField(this, "options");
|
|
5767
5870
|
__publicField(this, "cursor");
|
|
5768
5871
|
__publicField(this, "canvasEvent");
|
|
@@ -5773,17 +5876,17 @@ class GlobalEvent {
|
|
|
5773
5876
|
__publicField(this, "control");
|
|
5774
5877
|
__publicField(this, "dateParticle");
|
|
5775
5878
|
__publicField(this, "dprMediaQueryList");
|
|
5776
|
-
__publicField(this, "
|
|
5879
|
+
__publicField(this, "clearSideEffect", (evt) => {
|
|
5777
5880
|
if (!this.cursor)
|
|
5778
5881
|
return;
|
|
5779
|
-
const
|
|
5780
|
-
const
|
|
5781
|
-
const
|
|
5782
|
-
if (
|
|
5882
|
+
const target = (evt == null ? void 0 : evt.composedPath()[0]) || evt.target;
|
|
5883
|
+
const pageList = this.draw.getPageList();
|
|
5884
|
+
const innerEditorDom = findParent(target, (node) => pageList.includes(node), true);
|
|
5885
|
+
if (innerEditorDom) {
|
|
5783
5886
|
this.setRangeStyle();
|
|
5784
5887
|
return;
|
|
5785
5888
|
}
|
|
5786
|
-
const outerEditorDom = findParent(
|
|
5889
|
+
const outerEditorDom = findParent(target, (node) => !!node && node.nodeType === 1 && !!node.getAttribute(EDITOR_COMPONENT), true);
|
|
5787
5890
|
if (outerEditorDom) {
|
|
5788
5891
|
this.setRangeStyle();
|
|
5789
5892
|
this.watchCursorActive();
|
|
@@ -5824,14 +5927,16 @@ class GlobalEvent {
|
|
|
5824
5927
|
__publicField(this, "_handleVisibilityChange", () => {
|
|
5825
5928
|
var _a;
|
|
5826
5929
|
if (document.visibilityState) {
|
|
5827
|
-
|
|
5930
|
+
const isCollapsed = this.range.getIsCollapsed();
|
|
5931
|
+
(_a = this.cursor) == null ? void 0 : _a.drawCursor({
|
|
5932
|
+
isShow: isCollapsed
|
|
5933
|
+
});
|
|
5828
5934
|
}
|
|
5829
5935
|
});
|
|
5830
5936
|
__publicField(this, "_handleDprChange", () => {
|
|
5831
5937
|
this.draw.setPageDevicePixel();
|
|
5832
5938
|
});
|
|
5833
5939
|
this.draw = draw;
|
|
5834
|
-
this.canvas = draw.getPage();
|
|
5835
5940
|
this.options = draw.getOptions();
|
|
5836
5941
|
this.canvasEvent = canvasEvent;
|
|
5837
5942
|
this.cursor = null;
|
|
@@ -5848,18 +5953,18 @@ class GlobalEvent {
|
|
|
5848
5953
|
this.addEvent();
|
|
5849
5954
|
}
|
|
5850
5955
|
addEvent() {
|
|
5851
|
-
window.addEventListener("blur", this.
|
|
5956
|
+
window.addEventListener("blur", this.clearSideEffect);
|
|
5852
5957
|
document.addEventListener("keyup", this.setRangeStyle);
|
|
5853
|
-
document.addEventListener("click", this.
|
|
5958
|
+
document.addEventListener("click", this.clearSideEffect);
|
|
5854
5959
|
document.addEventListener("mouseup", this.setCanvasEventAbility);
|
|
5855
5960
|
document.addEventListener("wheel", this.setPageScale, { passive: false });
|
|
5856
5961
|
document.addEventListener("visibilitychange", this._handleVisibilityChange);
|
|
5857
5962
|
this.dprMediaQueryList.addEventListener("change", this._handleDprChange);
|
|
5858
5963
|
}
|
|
5859
5964
|
removeEvent() {
|
|
5860
|
-
window.removeEventListener("blur", this.
|
|
5965
|
+
window.removeEventListener("blur", this.clearSideEffect);
|
|
5861
5966
|
document.removeEventListener("keyup", this.setRangeStyle);
|
|
5862
|
-
document.removeEventListener("click", this.
|
|
5967
|
+
document.removeEventListener("click", this.clearSideEffect);
|
|
5863
5968
|
document.removeEventListener("mouseup", this.setCanvasEventAbility);
|
|
5864
5969
|
document.removeEventListener("wheel", this.setPageScale);
|
|
5865
5970
|
document.removeEventListener("visibilitychange", this._handleVisibilityChange);
|
|
@@ -6039,6 +6144,7 @@ class Position {
|
|
|
6039
6144
|
metrics,
|
|
6040
6145
|
ascent: offsetY,
|
|
6041
6146
|
lineHeight: curRow.height,
|
|
6147
|
+
isFirstLetter: j === 0,
|
|
6042
6148
|
isLastLetter: j === curRow.elementList.length - 1,
|
|
6043
6149
|
coordinate: {
|
|
6044
6150
|
leftTop: [x, y],
|
|
@@ -6148,7 +6254,7 @@ class Position {
|
|
|
6148
6254
|
const isMainActive = zoneManager.isMainActive();
|
|
6149
6255
|
const positionNo = isMainActive ? curPageNo : 0;
|
|
6150
6256
|
for (let j = 0; j < positionList.length; j++) {
|
|
6151
|
-
const { index: index2, pageNo, coordinate: { leftTop, rightTop, leftBottom } } = positionList[j];
|
|
6257
|
+
const { index: index2, pageNo, isFirstLetter, coordinate: { leftTop, rightTop, leftBottom } } = positionList[j];
|
|
6152
6258
|
if (positionNo !== pageNo)
|
|
6153
6259
|
continue;
|
|
6154
6260
|
if (leftTop[0] <= x && rightTop[0] >= x && leftTop[1] <= y && leftBottom[1] >= y) {
|
|
@@ -6169,7 +6275,7 @@ class Position {
|
|
|
6169
6275
|
positionList: td.positionList
|
|
6170
6276
|
});
|
|
6171
6277
|
if (~tablePosition.index) {
|
|
6172
|
-
const { index: tdValueIndex } = tablePosition;
|
|
6278
|
+
const { index: tdValueIndex, hitLineStartIndex: hitLineStartIndex3 } = tablePosition;
|
|
6173
6279
|
const tdValueElement = td.value[tdValueIndex];
|
|
6174
6280
|
return {
|
|
6175
6281
|
index: index2,
|
|
@@ -6183,7 +6289,8 @@ class Position {
|
|
|
6183
6289
|
tdValueIndex,
|
|
6184
6290
|
tdId: td.id,
|
|
6185
6291
|
trId: tr.id,
|
|
6186
|
-
tableId: element.id
|
|
6292
|
+
tableId: element.id,
|
|
6293
|
+
hitLineStartIndex: hitLineStartIndex3
|
|
6187
6294
|
};
|
|
6188
6295
|
}
|
|
6189
6296
|
}
|
|
@@ -6203,13 +6310,18 @@ class Position {
|
|
|
6203
6310
|
isCheckbox: true
|
|
6204
6311
|
};
|
|
6205
6312
|
}
|
|
6313
|
+
let hitLineStartIndex2;
|
|
6206
6314
|
if (elementList[index2].value !== ZERO) {
|
|
6207
6315
|
const valueWidth = rightTop[0] - leftTop[0];
|
|
6208
6316
|
if (x < leftTop[0] + valueWidth / 2) {
|
|
6209
6317
|
curPositionIndex2 = j - 1;
|
|
6318
|
+
if (isFirstLetter) {
|
|
6319
|
+
hitLineStartIndex2 = j;
|
|
6320
|
+
}
|
|
6210
6321
|
}
|
|
6211
6322
|
}
|
|
6212
6323
|
return {
|
|
6324
|
+
hitLineStartIndex: hitLineStartIndex2,
|
|
6213
6325
|
index: curPositionIndex2,
|
|
6214
6326
|
isControl: element.type === ElementType.CONTROL
|
|
6215
6327
|
};
|
|
@@ -6217,6 +6329,7 @@ class Position {
|
|
|
6217
6329
|
}
|
|
6218
6330
|
let isLastArea = false;
|
|
6219
6331
|
let curPositionIndex = -1;
|
|
6332
|
+
let hitLineStartIndex;
|
|
6220
6333
|
if (isTable) {
|
|
6221
6334
|
const { scale } = this.options;
|
|
6222
6335
|
const { td, tablePosition } = payload;
|
|
@@ -6242,7 +6355,16 @@ class Position {
|
|
|
6242
6355
|
const isHead = x < this.options.margins[3];
|
|
6243
6356
|
if (isHead) {
|
|
6244
6357
|
const headIndex = positionList.findIndex((p) => p.pageNo === positionNo && p.rowNo === lastLetterList[j].rowNo);
|
|
6245
|
-
|
|
6358
|
+
if (~headIndex) {
|
|
6359
|
+
if (positionList[headIndex].value === ZERO) {
|
|
6360
|
+
curPositionIndex = headIndex;
|
|
6361
|
+
} else {
|
|
6362
|
+
curPositionIndex = headIndex - 1;
|
|
6363
|
+
hitLineStartIndex = headIndex;
|
|
6364
|
+
}
|
|
6365
|
+
} else {
|
|
6366
|
+
curPositionIndex = index2;
|
|
6367
|
+
}
|
|
6246
6368
|
} else {
|
|
6247
6369
|
curPositionIndex = index2;
|
|
6248
6370
|
}
|
|
@@ -6282,6 +6404,7 @@ class Position {
|
|
|
6282
6404
|
};
|
|
6283
6405
|
}
|
|
6284
6406
|
return {
|
|
6407
|
+
hitLineStartIndex,
|
|
6285
6408
|
index: curPositionIndex,
|
|
6286
6409
|
isControl: ((_b = elementList[curPositionIndex]) == null ? void 0 : _b.type) === ElementType.CONTROL
|
|
6287
6410
|
};
|
|
@@ -6328,11 +6451,13 @@ class RangeManager {
|
|
|
6328
6451
|
__publicField(this, "options");
|
|
6329
6452
|
__publicField(this, "range");
|
|
6330
6453
|
__publicField(this, "listener");
|
|
6454
|
+
__publicField(this, "eventBus");
|
|
6331
6455
|
__publicField(this, "position");
|
|
6332
6456
|
__publicField(this, "historyManager");
|
|
6333
6457
|
this.draw = draw;
|
|
6334
6458
|
this.options = draw.getOptions();
|
|
6335
6459
|
this.listener = draw.getListener();
|
|
6460
|
+
this.eventBus = draw.getEventBus();
|
|
6336
6461
|
this.position = draw.getPosition();
|
|
6337
6462
|
this.historyManager = draw.getHistoryManager();
|
|
6338
6463
|
this.range = {
|
|
@@ -6401,8 +6526,9 @@ class RangeManager {
|
|
|
6401
6526
|
if (!rowArray.includes(rowNo)) {
|
|
6402
6527
|
rowArray.unshift(rowNo);
|
|
6403
6528
|
}
|
|
6404
|
-
if (((_a = positionList[start]) == null ? void 0 : _a.value) === ZERO || elementList[start].titleId !== ((_b = elementList[start - 1]) == null ? void 0 : _b.titleId))
|
|
6529
|
+
if (((_a = positionList[start]) == null ? void 0 : _a.value) === ZERO || elementList[start].titleId !== ((_b = elementList[start - 1]) == null ? void 0 : _b.titleId)) {
|
|
6405
6530
|
break;
|
|
6531
|
+
}
|
|
6406
6532
|
start--;
|
|
6407
6533
|
}
|
|
6408
6534
|
if (startIndex !== endIndex) {
|
|
@@ -6422,8 +6548,9 @@ class RangeManager {
|
|
|
6422
6548
|
}
|
|
6423
6549
|
let end = endIndex;
|
|
6424
6550
|
while (end < positionList.length) {
|
|
6425
|
-
if (positionList[end].value === ZERO || elementList[end].titleId !== ((_c = elementList[end + 1]) == null ? void 0 : _c.titleId))
|
|
6551
|
+
if (positionList[end].value === ZERO || elementList[end].titleId !== ((_c = elementList[end + 1]) == null ? void 0 : _c.titleId)) {
|
|
6426
6552
|
break;
|
|
6553
|
+
}
|
|
6427
6554
|
const { pageNo, rowNo } = positionList[end];
|
|
6428
6555
|
let rowArray = rangeRow.get(pageNo);
|
|
6429
6556
|
if (!rowArray) {
|
|
@@ -6499,7 +6626,9 @@ class RangeManager {
|
|
|
6499
6626
|
this.setRange(range.startIndex, range.endIndex, range.tableId, range.startTdIndex, range.endTdIndex, range.startTrIndex, range.endTrIndex);
|
|
6500
6627
|
}
|
|
6501
6628
|
setRangeStyle() {
|
|
6502
|
-
|
|
6629
|
+
const rangeStyleChangeListener = this.listener.rangeStyleChange;
|
|
6630
|
+
const isSubscribeRangeStyleChange = this.eventBus.isSubscribe("rangeStyleChange");
|
|
6631
|
+
if (!rangeStyleChangeListener && !isSubscribeRangeStyleChange)
|
|
6503
6632
|
return;
|
|
6504
6633
|
const { startIndex, endIndex, isCrossRowCol } = this.range;
|
|
6505
6634
|
if (!~startIndex && !~endIndex)
|
|
@@ -6535,7 +6664,7 @@ class RangeManager {
|
|
|
6535
6664
|
const painter = !!this.draw.getPainterStyle();
|
|
6536
6665
|
const undo = this.historyManager.isCanUndo();
|
|
6537
6666
|
const redo = this.historyManager.isCanRedo();
|
|
6538
|
-
|
|
6667
|
+
const rangeStyle = {
|
|
6539
6668
|
type,
|
|
6540
6669
|
undo,
|
|
6541
6670
|
redo,
|
|
@@ -6554,10 +6683,18 @@ class RangeManager {
|
|
|
6554
6683
|
level,
|
|
6555
6684
|
listType,
|
|
6556
6685
|
listStyle
|
|
6557
|
-
}
|
|
6686
|
+
};
|
|
6687
|
+
if (rangeStyleChangeListener) {
|
|
6688
|
+
rangeStyleChangeListener(rangeStyle);
|
|
6689
|
+
}
|
|
6690
|
+
if (isSubscribeRangeStyleChange) {
|
|
6691
|
+
this.eventBus.emit("rangeStyleChange", rangeStyle);
|
|
6692
|
+
}
|
|
6558
6693
|
}
|
|
6559
6694
|
recoveryRangeStyle() {
|
|
6560
|
-
|
|
6695
|
+
const rangeStyleChangeListener = this.listener.rangeStyleChange;
|
|
6696
|
+
const isSubscribeRangeStyleChange = this.eventBus.isSubscribe("rangeStyleChange");
|
|
6697
|
+
if (!rangeStyleChangeListener && !isSubscribeRangeStyleChange)
|
|
6561
6698
|
return;
|
|
6562
6699
|
const font = this.options.defaultFont;
|
|
6563
6700
|
const size = this.options.defaultSize;
|
|
@@ -6565,7 +6702,7 @@ class RangeManager {
|
|
|
6565
6702
|
const painter = !!this.draw.getPainterStyle();
|
|
6566
6703
|
const undo = this.historyManager.isCanUndo();
|
|
6567
6704
|
const redo = this.historyManager.isCanRedo();
|
|
6568
|
-
|
|
6705
|
+
const rangeStyle = {
|
|
6569
6706
|
type: null,
|
|
6570
6707
|
undo,
|
|
6571
6708
|
redo,
|
|
@@ -6584,7 +6721,13 @@ class RangeManager {
|
|
|
6584
6721
|
level: null,
|
|
6585
6722
|
listType: null,
|
|
6586
6723
|
listStyle: null
|
|
6587
|
-
}
|
|
6724
|
+
};
|
|
6725
|
+
if (rangeStyleChangeListener) {
|
|
6726
|
+
rangeStyleChangeListener(rangeStyle);
|
|
6727
|
+
}
|
|
6728
|
+
if (isSubscribeRangeStyleChange) {
|
|
6729
|
+
this.eventBus.emit("rangeStyleChange", rangeStyle);
|
|
6730
|
+
}
|
|
6588
6731
|
}
|
|
6589
6732
|
shrinkBoundary() {
|
|
6590
6733
|
const elementList = this.draw.getElementList();
|
|
@@ -6686,12 +6829,13 @@ class AbstractRichText {
|
|
|
6686
6829
|
}
|
|
6687
6830
|
clearFillInfo() {
|
|
6688
6831
|
this.fillColor = void 0;
|
|
6689
|
-
|
|
6832
|
+
this.fillRect = {
|
|
6690
6833
|
x: 0,
|
|
6691
6834
|
y: 0,
|
|
6692
6835
|
width: 0,
|
|
6693
6836
|
height: 0
|
|
6694
6837
|
};
|
|
6838
|
+
return this.fillRect;
|
|
6695
6839
|
}
|
|
6696
6840
|
recordFillInfo(ctx, x, y, width, height, color) {
|
|
6697
6841
|
const isFirstRecord = !this.fillRect.width;
|
|
@@ -6750,7 +6894,10 @@ class Margin {
|
|
|
6750
6894
|
const leftTopPoint = [margins[3], margins[0]];
|
|
6751
6895
|
const rightTopPoint = [width - margins[1], margins[0]];
|
|
6752
6896
|
const leftBottomPoint = [margins[3], height - margins[2]];
|
|
6753
|
-
const rightBottomPoint = [
|
|
6897
|
+
const rightBottomPoint = [
|
|
6898
|
+
width - margins[1],
|
|
6899
|
+
height - margins[2]
|
|
6900
|
+
];
|
|
6754
6901
|
ctx.moveTo(leftTopPoint[0] - marginIndicatorSize, leftTopPoint[1]);
|
|
6755
6902
|
ctx.lineTo(...leftTopPoint);
|
|
6756
6903
|
ctx.lineTo(leftTopPoint[0], leftTopPoint[1] - marginIndicatorSize);
|
|
@@ -6971,8 +7118,9 @@ class Search {
|
|
|
6971
7118
|
}
|
|
6972
7119
|
render(ctx, pageIndex) {
|
|
6973
7120
|
var _a, _b;
|
|
6974
|
-
if (!this.searchMatchList || !this.searchMatchList.length || !this.searchKeyword)
|
|
7121
|
+
if (!this.searchMatchList || !this.searchMatchList.length || !this.searchKeyword) {
|
|
6975
7122
|
return;
|
|
7123
|
+
}
|
|
6976
7124
|
const { searchMatchAlpha, searchMatchColor, searchNavigateMatchColor } = this.options;
|
|
6977
7125
|
const positionList = this.position.getOriginalPositionList();
|
|
6978
7126
|
const elementList = this.draw.getOriginalElementList();
|
|
@@ -8341,8 +8489,9 @@ class SelectControl {
|
|
|
8341
8489
|
return;
|
|
8342
8490
|
const { startIndex } = this.control.getRange();
|
|
8343
8491
|
const elementList = this.control.getElementList();
|
|
8344
|
-
if (((_a = elementList[startIndex + 1]) == null ? void 0 : _a.controlId) !== this.element.controlId)
|
|
8492
|
+
if (((_a = elementList[startIndex + 1]) == null ? void 0 : _a.controlId) !== this.element.controlId) {
|
|
8345
8493
|
return;
|
|
8494
|
+
}
|
|
8346
8495
|
this._createSelectPopupDom();
|
|
8347
8496
|
this.isPopup = true;
|
|
8348
8497
|
}
|
|
@@ -8488,11 +8637,13 @@ class Control {
|
|
|
8488
8637
|
__publicField(this, "draw");
|
|
8489
8638
|
__publicField(this, "range");
|
|
8490
8639
|
__publicField(this, "listener");
|
|
8640
|
+
__publicField(this, "eventBus");
|
|
8491
8641
|
__publicField(this, "options");
|
|
8492
8642
|
__publicField(this, "activeControl");
|
|
8493
8643
|
this.draw = draw;
|
|
8494
8644
|
this.range = draw.getRange();
|
|
8495
8645
|
this.listener = draw.getListener();
|
|
8646
|
+
this.eventBus = draw.getEventBus();
|
|
8496
8647
|
this.options = draw.getOptions().control;
|
|
8497
8648
|
this.activeControl = null;
|
|
8498
8649
|
}
|
|
@@ -8572,17 +8723,24 @@ class Control {
|
|
|
8572
8723
|
} else if (control.type === ControlType.CHECKBOX) {
|
|
8573
8724
|
this.activeControl = new CheckboxControl(element, this);
|
|
8574
8725
|
}
|
|
8575
|
-
|
|
8726
|
+
nextTick(() => {
|
|
8576
8727
|
var _a;
|
|
8577
|
-
|
|
8578
|
-
|
|
8579
|
-
|
|
8580
|
-
|
|
8581
|
-
|
|
8582
|
-
|
|
8583
|
-
|
|
8584
|
-
|
|
8585
|
-
|
|
8728
|
+
const controlChangeListener = this.listener.controlChange;
|
|
8729
|
+
const isSubscribeControlChange = this.eventBus.isSubscribe("controlChange");
|
|
8730
|
+
if (!controlChangeListener && !isSubscribeControlChange)
|
|
8731
|
+
return;
|
|
8732
|
+
let payload;
|
|
8733
|
+
const value = (_a = this.activeControl) == null ? void 0 : _a.getValue();
|
|
8734
|
+
if (value && value.length) {
|
|
8735
|
+
payload = zipElementList(value)[0].control;
|
|
8736
|
+
} else {
|
|
8737
|
+
payload = pickElementAttr(deepClone(element)).control;
|
|
8738
|
+
}
|
|
8739
|
+
if (controlChangeListener) {
|
|
8740
|
+
controlChangeListener(payload);
|
|
8741
|
+
}
|
|
8742
|
+
if (isSubscribeControlChange) {
|
|
8743
|
+
this.eventBus.emit("controlChange", payload);
|
|
8586
8744
|
}
|
|
8587
8745
|
});
|
|
8588
8746
|
}
|
|
@@ -8592,9 +8750,16 @@ class Control {
|
|
|
8592
8750
|
this.activeControl.destroy();
|
|
8593
8751
|
}
|
|
8594
8752
|
this.activeControl = null;
|
|
8595
|
-
|
|
8596
|
-
|
|
8597
|
-
|
|
8753
|
+
nextTick(() => {
|
|
8754
|
+
const controlChangeListener = this.listener.controlChange;
|
|
8755
|
+
const isSubscribeControlChange = this.eventBus.isSubscribe("controlChange");
|
|
8756
|
+
if (!controlChangeListener && !isSubscribeControlChange)
|
|
8757
|
+
return;
|
|
8758
|
+
if (controlChangeListener) {
|
|
8759
|
+
controlChangeListener(null);
|
|
8760
|
+
}
|
|
8761
|
+
if (isSubscribeControlChange) {
|
|
8762
|
+
this.eventBus.emit("controlChange", null);
|
|
8598
8763
|
}
|
|
8599
8764
|
});
|
|
8600
8765
|
}
|
|
@@ -8918,7 +9083,12 @@ class Previewer {
|
|
|
8918
9083
|
const resizerImage = document.createElement("img");
|
|
8919
9084
|
resizerImageContainer.append(resizerImage);
|
|
8920
9085
|
this.container.append(resizerImageContainer);
|
|
8921
|
-
return {
|
|
9086
|
+
return {
|
|
9087
|
+
resizerSelection,
|
|
9088
|
+
resizerHandleList,
|
|
9089
|
+
resizerImageContainer,
|
|
9090
|
+
resizerImage
|
|
9091
|
+
};
|
|
8922
9092
|
}
|
|
8923
9093
|
_mousedown(evt) {
|
|
8924
9094
|
this.canvas = this.draw.getPage();
|
|
@@ -9447,7 +9617,8 @@ class DatePicker {
|
|
|
9447
9617
|
const { weeks: { sun, mon, tue, wed, thu, fri, sat } } = this.lang;
|
|
9448
9618
|
const weekList = [sun, mon, tue, wed, thu, fri, sat];
|
|
9449
9619
|
this.dom.datePickerWeek.childNodes.forEach((child, i) => {
|
|
9450
|
-
|
|
9620
|
+
const childElement = child;
|
|
9621
|
+
childElement.innerText = weekList[i];
|
|
9451
9622
|
});
|
|
9452
9623
|
const hourTitle = this.dom.time.hour.previousElementSibling;
|
|
9453
9624
|
hourTitle.innerText = this.lang.hour;
|
|
@@ -9551,7 +9722,11 @@ class DatePicker {
|
|
|
9551
9722
|
timeDomList.forEach((timeDom) => {
|
|
9552
9723
|
timeDom.querySelectorAll("li").forEach((li) => li.classList.remove("active"));
|
|
9553
9724
|
});
|
|
9554
|
-
const pickList = [
|
|
9725
|
+
const pickList = [
|
|
9726
|
+
[hourDom, hour],
|
|
9727
|
+
[minuteDom, minute],
|
|
9728
|
+
[secondDom, second]
|
|
9729
|
+
];
|
|
9555
9730
|
pickList.forEach(([dom, time]) => {
|
|
9556
9731
|
const pickDom = dom.querySelector(`[data-id='${time}']`);
|
|
9557
9732
|
pickDom.classList.add("active");
|
|
@@ -9701,9 +9876,11 @@ class DateParticle {
|
|
|
9701
9876
|
type: ElementType.DATE,
|
|
9702
9877
|
value: "",
|
|
9703
9878
|
dateFormat: startElement.dateFormat,
|
|
9704
|
-
valueList: [
|
|
9705
|
-
|
|
9706
|
-
|
|
9879
|
+
valueList: [
|
|
9880
|
+
{
|
|
9881
|
+
value: date
|
|
9882
|
+
}
|
|
9883
|
+
]
|
|
9707
9884
|
};
|
|
9708
9885
|
formatElementContext(elementList, [dateElement], leftIndex);
|
|
9709
9886
|
this.draw.insertElementList([dateElement]);
|
|
@@ -10088,6 +10265,10 @@ class Zone {
|
|
|
10088
10265
|
if (listener.zoneChange) {
|
|
10089
10266
|
listener.zoneChange(payload);
|
|
10090
10267
|
}
|
|
10268
|
+
const eventBus = this.draw.getEventBus();
|
|
10269
|
+
if (eventBus.isSubscribe("zoneChange")) {
|
|
10270
|
+
eventBus.emit("zoneChange", payload);
|
|
10271
|
+
}
|
|
10091
10272
|
});
|
|
10092
10273
|
}
|
|
10093
10274
|
drawZoneIndicator() {
|
|
@@ -10388,12 +10569,14 @@ class Placeholder {
|
|
|
10388
10569
|
if (!data2)
|
|
10389
10570
|
return;
|
|
10390
10571
|
this._recovery();
|
|
10391
|
-
this.elementList = [
|
|
10392
|
-
|
|
10393
|
-
|
|
10394
|
-
|
|
10395
|
-
|
|
10396
|
-
|
|
10572
|
+
this.elementList = [
|
|
10573
|
+
{
|
|
10574
|
+
value: data2,
|
|
10575
|
+
font,
|
|
10576
|
+
size,
|
|
10577
|
+
color
|
|
10578
|
+
}
|
|
10579
|
+
];
|
|
10397
10580
|
formatElementList(this.elementList, {
|
|
10398
10581
|
editorOptions: this.options
|
|
10399
10582
|
});
|
|
@@ -10413,12 +10596,13 @@ class Placeholder {
|
|
|
10413
10596
|
}
|
|
10414
10597
|
}
|
|
10415
10598
|
class Draw {
|
|
10416
|
-
constructor(rootContainer, options, data2, listener) {
|
|
10599
|
+
constructor(rootContainer, options, data2, listener, eventBus) {
|
|
10417
10600
|
__publicField(this, "container");
|
|
10418
10601
|
__publicField(this, "pageContainer");
|
|
10419
10602
|
__publicField(this, "pageList");
|
|
10420
10603
|
__publicField(this, "ctxList");
|
|
10421
10604
|
__publicField(this, "pageNo");
|
|
10605
|
+
__publicField(this, "pagePixelRatio");
|
|
10422
10606
|
__publicField(this, "mode");
|
|
10423
10607
|
__publicField(this, "options");
|
|
10424
10608
|
__publicField(this, "position");
|
|
@@ -10427,6 +10611,7 @@ class Draw {
|
|
|
10427
10611
|
__publicField(this, "elementList");
|
|
10428
10612
|
__publicField(this, "footerElementList");
|
|
10429
10613
|
__publicField(this, "listener");
|
|
10614
|
+
__publicField(this, "eventBus");
|
|
10430
10615
|
__publicField(this, "i18n");
|
|
10431
10616
|
__publicField(this, "canvasEvent");
|
|
10432
10617
|
__publicField(this, "globalEvent");
|
|
@@ -10475,12 +10660,14 @@ class Draw {
|
|
|
10475
10660
|
this.pageList = [];
|
|
10476
10661
|
this.ctxList = [];
|
|
10477
10662
|
this.pageNo = 0;
|
|
10663
|
+
this.pagePixelRatio = null;
|
|
10478
10664
|
this.mode = options.mode;
|
|
10479
10665
|
this.options = options;
|
|
10480
10666
|
this.headerElementList = data2.header || [];
|
|
10481
10667
|
this.elementList = data2.main;
|
|
10482
10668
|
this.footerElementList = data2.footer || [];
|
|
10483
10669
|
this.listener = listener;
|
|
10670
|
+
this.eventBus = eventBus;
|
|
10484
10671
|
this._formatContainer();
|
|
10485
10672
|
this.pageContainer = this._createPageContainer();
|
|
10486
10673
|
this._createPage(0);
|
|
@@ -10622,6 +10809,9 @@ class Draw {
|
|
|
10622
10809
|
if (this.listener.visiblePageNoListChange) {
|
|
10623
10810
|
this.listener.visiblePageNoListChange(this.visiblePageNoList);
|
|
10624
10811
|
}
|
|
10812
|
+
if (this.eventBus.isSubscribe("visiblePageNoListChange")) {
|
|
10813
|
+
this.eventBus.emit("visiblePageNoListChange", this.visiblePageNoList);
|
|
10814
|
+
}
|
|
10625
10815
|
}
|
|
10626
10816
|
getIntersectionPageNo() {
|
|
10627
10817
|
return this.intersectionPageNo;
|
|
@@ -10631,6 +10821,9 @@ class Draw {
|
|
|
10631
10821
|
if (this.listener.intersectionPageNoChange) {
|
|
10632
10822
|
this.listener.intersectionPageNoChange(this.intersectionPageNo);
|
|
10633
10823
|
}
|
|
10824
|
+
if (this.eventBus.isSubscribe("intersectionPageNoChange")) {
|
|
10825
|
+
this.eventBus.emit("intersectionPageNoChange", this.intersectionPageNo);
|
|
10826
|
+
}
|
|
10634
10827
|
}
|
|
10635
10828
|
getPageNo() {
|
|
10636
10829
|
return this.pageNo;
|
|
@@ -10788,8 +10981,9 @@ class Draw {
|
|
|
10788
10981
|
let startIndex = endIndex;
|
|
10789
10982
|
while (startIndex < elementList.length) {
|
|
10790
10983
|
const curElement = elementList[startIndex];
|
|
10791
|
-
if (curElement.listId !== endElementListId || curElement.value === ZERO)
|
|
10984
|
+
if (curElement.listId !== endElementListId || curElement.value === ZERO) {
|
|
10792
10985
|
break;
|
|
10986
|
+
}
|
|
10793
10987
|
delete curElement.listId;
|
|
10794
10988
|
delete curElement.listType;
|
|
10795
10989
|
delete curElement.listStyle;
|
|
@@ -10805,6 +10999,9 @@ class Draw {
|
|
|
10805
10999
|
getListener() {
|
|
10806
11000
|
return this.listener;
|
|
10807
11001
|
}
|
|
11002
|
+
getEventBus() {
|
|
11003
|
+
return this.eventBus;
|
|
11004
|
+
}
|
|
10808
11005
|
getCursor() {
|
|
10809
11006
|
return this.cursor;
|
|
10810
11007
|
}
|
|
@@ -10850,7 +11047,10 @@ class Draw {
|
|
|
10850
11047
|
getRowCount() {
|
|
10851
11048
|
return this.rowList.length;
|
|
10852
11049
|
}
|
|
10853
|
-
async getDataURL() {
|
|
11050
|
+
async getDataURL(pixelRatio) {
|
|
11051
|
+
if (pixelRatio) {
|
|
11052
|
+
this.setPagePixelRatio(pixelRatio);
|
|
11053
|
+
}
|
|
10854
11054
|
this.render({
|
|
10855
11055
|
isLazy: false,
|
|
10856
11056
|
isCompute: false,
|
|
@@ -10858,7 +11058,11 @@ class Draw {
|
|
|
10858
11058
|
isSubmitHistory: false
|
|
10859
11059
|
});
|
|
10860
11060
|
await this.imageObserver.allSettled();
|
|
10861
|
-
|
|
11061
|
+
const dataUrlList = this.pageList.map((c) => c.toDataURL());
|
|
11062
|
+
if (pixelRatio) {
|
|
11063
|
+
this.setPagePixelRatio(null);
|
|
11064
|
+
}
|
|
11065
|
+
return dataUrlList;
|
|
10862
11066
|
}
|
|
10863
11067
|
getPainterStyle() {
|
|
10864
11068
|
return this.painterStyle && Object.keys(this.painterStyle).length ? this.painterStyle : null;
|
|
@@ -10891,7 +11095,7 @@ class Draw {
|
|
|
10891
11095
|
this.options.pageMode = payload;
|
|
10892
11096
|
if (payload === PageMode.PAGING) {
|
|
10893
11097
|
const { height } = this.options;
|
|
10894
|
-
const dpr =
|
|
11098
|
+
const dpr = this.getPagePixelRatio();
|
|
10895
11099
|
const canvas = this.pageList[0];
|
|
10896
11100
|
canvas.style.height = `${height}px`;
|
|
10897
11101
|
canvas.height = height * dpr;
|
|
@@ -10910,10 +11114,13 @@ class Draw {
|
|
|
10910
11114
|
if (this.listener.pageModeChange) {
|
|
10911
11115
|
this.listener.pageModeChange(payload);
|
|
10912
11116
|
}
|
|
11117
|
+
if (this.eventBus.isSubscribe("pageModeChange")) {
|
|
11118
|
+
this.eventBus.emit("pageModeChange", payload);
|
|
11119
|
+
}
|
|
10913
11120
|
});
|
|
10914
11121
|
}
|
|
10915
11122
|
setPageScale(payload) {
|
|
10916
|
-
const dpr =
|
|
11123
|
+
const dpr = this.getPagePixelRatio();
|
|
10917
11124
|
this.options.scale = payload;
|
|
10918
11125
|
const width = this.getWidth();
|
|
10919
11126
|
const height = this.getHeight();
|
|
@@ -10934,8 +11141,18 @@ class Draw {
|
|
|
10934
11141
|
this.listener.pageScaleChange(payload);
|
|
10935
11142
|
}
|
|
10936
11143
|
}
|
|
11144
|
+
getPagePixelRatio() {
|
|
11145
|
+
return this.pagePixelRatio || window.devicePixelRatio;
|
|
11146
|
+
}
|
|
11147
|
+
setPagePixelRatio(payload) {
|
|
11148
|
+
if (!this.pagePixelRatio && payload === window.devicePixelRatio || payload === this.pagePixelRatio) {
|
|
11149
|
+
return;
|
|
11150
|
+
}
|
|
11151
|
+
this.pagePixelRatio = payload;
|
|
11152
|
+
this.setPageDevicePixel();
|
|
11153
|
+
}
|
|
10937
11154
|
setPageDevicePixel() {
|
|
10938
|
-
const dpr =
|
|
11155
|
+
const dpr = this.getPagePixelRatio();
|
|
10939
11156
|
const width = this.getWidth();
|
|
10940
11157
|
const height = this.getHeight();
|
|
10941
11158
|
this.pageList.forEach((p, i) => {
|
|
@@ -10951,7 +11168,7 @@ class Draw {
|
|
|
10951
11168
|
setPaperSize(width, height) {
|
|
10952
11169
|
this.options.width = width;
|
|
10953
11170
|
this.options.height = height;
|
|
10954
|
-
const dpr =
|
|
11171
|
+
const dpr = this.getPagePixelRatio();
|
|
10955
11172
|
const realWidth = this.getWidth();
|
|
10956
11173
|
const realHeight = this.getHeight();
|
|
10957
11174
|
this.container.style.width = `${realWidth}px`;
|
|
@@ -10968,7 +11185,7 @@ class Draw {
|
|
|
10968
11185
|
});
|
|
10969
11186
|
}
|
|
10970
11187
|
setPaperDirection(payload) {
|
|
10971
|
-
const dpr =
|
|
11188
|
+
const dpr = this.getPagePixelRatio();
|
|
10972
11189
|
this.options.paperDirection = payload;
|
|
10973
11190
|
const width = this.getWidth();
|
|
10974
11191
|
const height = this.getHeight();
|
|
@@ -11067,7 +11284,7 @@ class Draw {
|
|
|
11067
11284
|
canvas.style.marginBottom = `${this.getPageGap()}px`;
|
|
11068
11285
|
canvas.setAttribute("data-index", String(pageNo));
|
|
11069
11286
|
this.pageContainer.append(canvas);
|
|
11070
|
-
const dpr =
|
|
11287
|
+
const dpr = this.getPagePixelRatio();
|
|
11071
11288
|
canvas.width = width * dpr;
|
|
11072
11289
|
canvas.height = height * dpr;
|
|
11073
11290
|
canvas.style.cursor = "text";
|
|
@@ -11077,7 +11294,7 @@ class Draw {
|
|
|
11077
11294
|
this.ctxList.push(ctx);
|
|
11078
11295
|
}
|
|
11079
11296
|
_initPageContext(ctx) {
|
|
11080
|
-
const dpr =
|
|
11297
|
+
const dpr = this.getPagePixelRatio();
|
|
11081
11298
|
ctx.scale(dpr, dpr);
|
|
11082
11299
|
ctx.letterSpacing = "0px";
|
|
11083
11300
|
ctx.wordSpacing = "0px";
|
|
@@ -11385,7 +11602,7 @@ class Draw {
|
|
|
11385
11602
|
if (pageMode === PageMode.CONTINUITY) {
|
|
11386
11603
|
pageRowList[0] = this.rowList;
|
|
11387
11604
|
pageHeight += this.rowList.reduce((pre, cur) => pre + cur.height, 0);
|
|
11388
|
-
const dpr =
|
|
11605
|
+
const dpr = this.getPagePixelRatio();
|
|
11389
11606
|
const pageDom = this.pageList[0];
|
|
11390
11607
|
const pageDomHeight = Number(pageDom.style.height.replace("px", ""));
|
|
11391
11608
|
if (pageHeight > pageDomHeight) {
|
|
@@ -11733,8 +11950,16 @@ class Draw {
|
|
|
11733
11950
|
if (this.listener.pageSizeChange) {
|
|
11734
11951
|
this.listener.pageSizeChange(this.pageRowList.length);
|
|
11735
11952
|
}
|
|
11736
|
-
if (this.
|
|
11737
|
-
this.
|
|
11953
|
+
if (this.eventBus.isSubscribe("pageSizeChange")) {
|
|
11954
|
+
this.eventBus.emit("pageSizeChange", this.pageRowList.length);
|
|
11955
|
+
}
|
|
11956
|
+
if (isSubmitHistory) {
|
|
11957
|
+
if (this.listener.contentChange) {
|
|
11958
|
+
this.listener.contentChange();
|
|
11959
|
+
}
|
|
11960
|
+
if (this.eventBus.isSubscribe("contentChange")) {
|
|
11961
|
+
this.eventBus.emit("contentChange");
|
|
11962
|
+
}
|
|
11738
11963
|
}
|
|
11739
11964
|
});
|
|
11740
11965
|
}
|
|
@@ -11822,6 +12047,7 @@ class Command {
|
|
|
11822
12047
|
__publicField(this, "getCatalog");
|
|
11823
12048
|
__publicField(this, "getImage");
|
|
11824
12049
|
__publicField(this, "getValue");
|
|
12050
|
+
__publicField(this, "getHTML");
|
|
11825
12051
|
__publicField(this, "getWordCount");
|
|
11826
12052
|
__publicField(this, "getRangeText");
|
|
11827
12053
|
__publicField(this, "getRangeContext");
|
|
@@ -11901,6 +12127,7 @@ class Command {
|
|
|
11901
12127
|
this.executeWordTool = adapt.wordTool.bind(adapt);
|
|
11902
12128
|
this.getImage = adapt.getImage.bind(adapt);
|
|
11903
12129
|
this.getValue = adapt.getValue.bind(adapt);
|
|
12130
|
+
this.getHTML = adapt.getHTML.bind(adapt);
|
|
11904
12131
|
this.getWordCount = adapt.getWordCount.bind(adapt);
|
|
11905
12132
|
this.getRangeText = adapt.getRangeText.bind(adapt);
|
|
11906
12133
|
this.getRangeContext = adapt.getRangeContext.bind(adapt);
|
|
@@ -12125,8 +12352,9 @@ class CommandAdapt {
|
|
|
12125
12352
|
return;
|
|
12126
12353
|
let isExistUpdate = false;
|
|
12127
12354
|
selection.forEach((el) => {
|
|
12128
|
-
if (!el.size && payload === defaultSize || el.size && el.size === payload)
|
|
12355
|
+
if (!el.size && payload === defaultSize || el.size && el.size === payload) {
|
|
12129
12356
|
return;
|
|
12357
|
+
}
|
|
12130
12358
|
el.size = payload;
|
|
12131
12359
|
isExistUpdate = true;
|
|
12132
12360
|
});
|
|
@@ -12529,13 +12757,15 @@ class CommandAdapt {
|
|
|
12529
12757
|
id: newTdId,
|
|
12530
12758
|
rowspan: 1,
|
|
12531
12759
|
colspan: curTd.colspan,
|
|
12532
|
-
value: [
|
|
12533
|
-
|
|
12534
|
-
|
|
12535
|
-
|
|
12536
|
-
|
|
12537
|
-
|
|
12538
|
-
|
|
12760
|
+
value: [
|
|
12761
|
+
{
|
|
12762
|
+
value: ZERO,
|
|
12763
|
+
size: 16,
|
|
12764
|
+
tableId,
|
|
12765
|
+
trId: newTrId,
|
|
12766
|
+
tdId: newTdId
|
|
12767
|
+
}
|
|
12768
|
+
]
|
|
12539
12769
|
});
|
|
12540
12770
|
}
|
|
12541
12771
|
curTrList.splice(trIndex, 0, newTr);
|
|
@@ -12590,13 +12820,15 @@ class CommandAdapt {
|
|
|
12590
12820
|
id: newTdId,
|
|
12591
12821
|
rowspan: 1,
|
|
12592
12822
|
colspan: curTd.colspan,
|
|
12593
|
-
value: [
|
|
12594
|
-
|
|
12595
|
-
|
|
12596
|
-
|
|
12597
|
-
|
|
12598
|
-
|
|
12599
|
-
|
|
12823
|
+
value: [
|
|
12824
|
+
{
|
|
12825
|
+
value: ZERO,
|
|
12826
|
+
size: 16,
|
|
12827
|
+
tableId,
|
|
12828
|
+
trId: newTrId,
|
|
12829
|
+
tdId: newTdId
|
|
12830
|
+
}
|
|
12831
|
+
]
|
|
12600
12832
|
});
|
|
12601
12833
|
}
|
|
12602
12834
|
curTrList.splice(trIndex + 1, 0, newTr);
|
|
@@ -12632,13 +12864,15 @@ class CommandAdapt {
|
|
|
12632
12864
|
id: tdId,
|
|
12633
12865
|
rowspan: 1,
|
|
12634
12866
|
colspan: 1,
|
|
12635
|
-
value: [
|
|
12636
|
-
|
|
12637
|
-
|
|
12638
|
-
|
|
12639
|
-
|
|
12640
|
-
|
|
12641
|
-
|
|
12867
|
+
value: [
|
|
12868
|
+
{
|
|
12869
|
+
value: ZERO,
|
|
12870
|
+
size: 16,
|
|
12871
|
+
tableId,
|
|
12872
|
+
trId: tr.id,
|
|
12873
|
+
tdId
|
|
12874
|
+
}
|
|
12875
|
+
]
|
|
12642
12876
|
});
|
|
12643
12877
|
}
|
|
12644
12878
|
const colgroup = element.colgroup;
|
|
@@ -12686,13 +12920,15 @@ class CommandAdapt {
|
|
|
12686
12920
|
id: tdId,
|
|
12687
12921
|
rowspan: 1,
|
|
12688
12922
|
colspan: 1,
|
|
12689
|
-
value: [
|
|
12690
|
-
|
|
12691
|
-
|
|
12692
|
-
|
|
12693
|
-
|
|
12694
|
-
|
|
12695
|
-
|
|
12923
|
+
value: [
|
|
12924
|
+
{
|
|
12925
|
+
value: ZERO,
|
|
12926
|
+
size: 16,
|
|
12927
|
+
tableId,
|
|
12928
|
+
trId: tr.id,
|
|
12929
|
+
tdId
|
|
12930
|
+
}
|
|
12931
|
+
]
|
|
12696
12932
|
});
|
|
12697
12933
|
}
|
|
12698
12934
|
const colgroup = element.colgroup;
|
|
@@ -12748,13 +12984,15 @@ class CommandAdapt {
|
|
|
12748
12984
|
id: tdId,
|
|
12749
12985
|
rowspan: 1,
|
|
12750
12986
|
colspan: 1,
|
|
12751
|
-
value: [
|
|
12752
|
-
|
|
12753
|
-
|
|
12754
|
-
|
|
12755
|
-
|
|
12756
|
-
|
|
12757
|
-
|
|
12987
|
+
value: [
|
|
12988
|
+
{
|
|
12989
|
+
value: ZERO,
|
|
12990
|
+
size: 16,
|
|
12991
|
+
tableId: element.id,
|
|
12992
|
+
trId: tr.id,
|
|
12993
|
+
tdId
|
|
12994
|
+
}
|
|
12995
|
+
]
|
|
12758
12996
|
});
|
|
12759
12997
|
start += 1;
|
|
12760
12998
|
}
|
|
@@ -12963,13 +13201,15 @@ class CommandAdapt {
|
|
|
12963
13201
|
id: tdId,
|
|
12964
13202
|
rowspan: 1,
|
|
12965
13203
|
colspan: 1,
|
|
12966
|
-
value: [
|
|
12967
|
-
|
|
12968
|
-
|
|
12969
|
-
|
|
12970
|
-
|
|
12971
|
-
|
|
12972
|
-
|
|
13204
|
+
value: [
|
|
13205
|
+
{
|
|
13206
|
+
value: ZERO,
|
|
13207
|
+
size: 16,
|
|
13208
|
+
tableId: element.id,
|
|
13209
|
+
trId: curTr.id,
|
|
13210
|
+
tdId
|
|
13211
|
+
}
|
|
13212
|
+
]
|
|
12973
13213
|
});
|
|
12974
13214
|
}
|
|
12975
13215
|
curTd.colspan = 1;
|
|
@@ -12983,13 +13223,15 @@ class CommandAdapt {
|
|
|
12983
13223
|
id: tdId,
|
|
12984
13224
|
rowspan: 1,
|
|
12985
13225
|
colspan: 1,
|
|
12986
|
-
value: [
|
|
12987
|
-
|
|
12988
|
-
|
|
12989
|
-
|
|
12990
|
-
|
|
12991
|
-
|
|
12992
|
-
|
|
13226
|
+
value: [
|
|
13227
|
+
{
|
|
13228
|
+
value: ZERO,
|
|
13229
|
+
size: 16,
|
|
13230
|
+
tableId: element.id,
|
|
13231
|
+
trId: tr.id,
|
|
13232
|
+
tdId
|
|
13233
|
+
}
|
|
13234
|
+
]
|
|
12993
13235
|
});
|
|
12994
13236
|
}
|
|
12995
13237
|
}
|
|
@@ -13188,8 +13430,9 @@ class CommandAdapt {
|
|
|
13188
13430
|
let curIndex = -1;
|
|
13189
13431
|
const endElement = elementList[endIndex + 1];
|
|
13190
13432
|
if (endElement && endElement.type === ElementType.SEPARATOR) {
|
|
13191
|
-
if (endElement.dashArray && endElement.dashArray.join() === payload.join())
|
|
13433
|
+
if (endElement.dashArray && endElement.dashArray.join() === payload.join()) {
|
|
13192
13434
|
return;
|
|
13435
|
+
}
|
|
13193
13436
|
curIndex = endIndex;
|
|
13194
13437
|
endElement.dashArray = payload;
|
|
13195
13438
|
} else {
|
|
@@ -13217,10 +13460,12 @@ class CommandAdapt {
|
|
|
13217
13460
|
const activeControl = this.control.getActiveControl();
|
|
13218
13461
|
if (activeControl)
|
|
13219
13462
|
return;
|
|
13220
|
-
this.insertElementList([
|
|
13221
|
-
|
|
13222
|
-
|
|
13223
|
-
|
|
13463
|
+
this.insertElementList([
|
|
13464
|
+
{
|
|
13465
|
+
type: ElementType.PAGE_BREAK,
|
|
13466
|
+
value: WRAP
|
|
13467
|
+
}
|
|
13468
|
+
]);
|
|
13224
13469
|
}
|
|
13225
13470
|
addWatermark(payload) {
|
|
13226
13471
|
const isReadonly = this.draw.isReadonly();
|
|
@@ -13408,13 +13653,13 @@ class CommandAdapt {
|
|
|
13408
13653
|
});
|
|
13409
13654
|
}
|
|
13410
13655
|
async print() {
|
|
13411
|
-
const { scale } = this.options;
|
|
13656
|
+
const { scale, printPixelRatio } = this.options;
|
|
13412
13657
|
if (scale !== 1) {
|
|
13413
13658
|
this.draw.setPageScale(1);
|
|
13414
13659
|
}
|
|
13415
13660
|
const width = this.draw.getOriginalWidth();
|
|
13416
13661
|
const height = this.draw.getOriginalHeight();
|
|
13417
|
-
const base64List = await this.draw.getDataURL();
|
|
13662
|
+
const base64List = await this.draw.getDataURL(printPixelRatio);
|
|
13418
13663
|
printImageBase64(base64List, width, height);
|
|
13419
13664
|
if (scale !== 1) {
|
|
13420
13665
|
this.draw.setPageScale(scale);
|
|
@@ -13449,12 +13694,23 @@ class CommandAdapt {
|
|
|
13449
13694
|
isSetCursor: false
|
|
13450
13695
|
});
|
|
13451
13696
|
}
|
|
13452
|
-
getImage() {
|
|
13453
|
-
return this.draw.getDataURL();
|
|
13697
|
+
getImage(pixelRatio) {
|
|
13698
|
+
return this.draw.getDataURL(pixelRatio);
|
|
13454
13699
|
}
|
|
13455
13700
|
getValue(options) {
|
|
13456
13701
|
return this.draw.getValue(options);
|
|
13457
13702
|
}
|
|
13703
|
+
getHTML() {
|
|
13704
|
+
const options = this.options;
|
|
13705
|
+
const headerElementList = this.draw.getHeaderElementList();
|
|
13706
|
+
const mainElementList = this.draw.getOriginalMainElementList();
|
|
13707
|
+
const footerElementList = this.draw.getFooterElementList();
|
|
13708
|
+
return {
|
|
13709
|
+
header: createDomFromElementList(headerElementList, options).innerHTML,
|
|
13710
|
+
main: createDomFromElementList(mainElementList, options).innerHTML,
|
|
13711
|
+
footer: createDomFromElementList(footerElementList, options).innerHTML
|
|
13712
|
+
};
|
|
13713
|
+
}
|
|
13458
13714
|
getWordCount() {
|
|
13459
13715
|
return this.workerManager.getWordCount();
|
|
13460
13716
|
}
|
|
@@ -13649,7 +13905,7 @@ const controlMenus = [
|
|
|
13649
13905
|
i18nPath: "contextmenu.control.delete",
|
|
13650
13906
|
when: (payload) => {
|
|
13651
13907
|
var _a;
|
|
13652
|
-
return !payload.editorHasSelection && ((_a = payload.startElement) == null ? void 0 : _a.type) === ElementType.CONTROL;
|
|
13908
|
+
return !payload.isReadonly && !payload.editorHasSelection && ((_a = payload.startElement) == null ? void 0 : _a.type) === ElementType.CONTROL;
|
|
13653
13909
|
},
|
|
13654
13910
|
callback: (command) => {
|
|
13655
13911
|
command.executeRemoveControl();
|
|
@@ -13714,7 +13970,7 @@ const hyperlinkMenus = [
|
|
|
13714
13970
|
i18nPath: "contextmenu.hyperlink.delete",
|
|
13715
13971
|
when: (payload) => {
|
|
13716
13972
|
var _a;
|
|
13717
|
-
return ((_a = payload.startElement) == null ? void 0 : _a.type) === ElementType.HYPERLINK;
|
|
13973
|
+
return !payload.isReadonly && ((_a = payload.startElement) == null ? void 0 : _a.type) === ElementType.HYPERLINK;
|
|
13718
13974
|
},
|
|
13719
13975
|
callback: (command) => {
|
|
13720
13976
|
command.executeDeleteHyperlink();
|
|
@@ -13724,7 +13980,7 @@ const hyperlinkMenus = [
|
|
|
13724
13980
|
i18nPath: "contextmenu.hyperlink.cancel",
|
|
13725
13981
|
when: (payload) => {
|
|
13726
13982
|
var _a;
|
|
13727
|
-
return ((_a = payload.startElement) == null ? void 0 : _a.type) === ElementType.HYPERLINK;
|
|
13983
|
+
return !payload.isReadonly && ((_a = payload.startElement) == null ? void 0 : _a.type) === ElementType.HYPERLINK;
|
|
13728
13984
|
},
|
|
13729
13985
|
callback: (command) => {
|
|
13730
13986
|
command.executeCancelHyperlink();
|
|
@@ -13734,7 +13990,7 @@ const hyperlinkMenus = [
|
|
|
13734
13990
|
i18nPath: "contextmenu.hyperlink.edit",
|
|
13735
13991
|
when: (payload) => {
|
|
13736
13992
|
var _a;
|
|
13737
|
-
return ((_a = payload.startElement) == null ? void 0 : _a.type) === ElementType.HYPERLINK;
|
|
13993
|
+
return !payload.isReadonly && ((_a = payload.startElement) == null ? void 0 : _a.type) === ElementType.HYPERLINK;
|
|
13738
13994
|
},
|
|
13739
13995
|
callback: (command, context) => {
|
|
13740
13996
|
var _a;
|
|
@@ -13751,7 +14007,7 @@ const imageMenus = [
|
|
|
13751
14007
|
icon: "image-change",
|
|
13752
14008
|
when: (payload) => {
|
|
13753
14009
|
var _a;
|
|
13754
|
-
return !payload.editorHasSelection && ((_a = payload.startElement) == null ? void 0 : _a.type) === ElementType.IMAGE;
|
|
14010
|
+
return !payload.isReadonly && !payload.editorHasSelection && ((_a = payload.startElement) == null ? void 0 : _a.type) === ElementType.IMAGE;
|
|
13755
14011
|
},
|
|
13756
14012
|
callback: (command) => {
|
|
13757
14013
|
const proxyInputFile = document.createElement("input");
|
|
@@ -13784,7 +14040,7 @@ const imageMenus = [
|
|
|
13784
14040
|
i18nPath: "contextmenu.image.textWrap",
|
|
13785
14041
|
when: (payload) => {
|
|
13786
14042
|
var _a;
|
|
13787
|
-
return !payload.editorHasSelection && ((_a = payload.startElement) == null ? void 0 : _a.type) === ElementType.IMAGE;
|
|
14043
|
+
return !payload.isReadonly && !payload.editorHasSelection && ((_a = payload.startElement) == null ? void 0 : _a.type) === ElementType.IMAGE;
|
|
13788
14044
|
},
|
|
13789
14045
|
childMenus: [
|
|
13790
14046
|
{
|
|
@@ -14008,9 +14264,10 @@ class ContextMenu {
|
|
|
14008
14264
|
}
|
|
14009
14265
|
evt.preventDefault();
|
|
14010
14266
|
});
|
|
14011
|
-
__publicField(this, "
|
|
14267
|
+
__publicField(this, "_handleSideEffect", (evt) => {
|
|
14012
14268
|
if (this.contextMenuContainerList.length) {
|
|
14013
|
-
const
|
|
14269
|
+
const target = (evt == null ? void 0 : evt.composedPath()[0]) || evt.target;
|
|
14270
|
+
const contextMenuDom = findParent(target, (node) => !!node && node.nodeType === 1 && node.getAttribute(EDITOR_COMPONENT) === EditorComponent.CONTEXTMENU, true);
|
|
14014
14271
|
if (!contextMenuDom) {
|
|
14015
14272
|
this.dispose();
|
|
14016
14273
|
}
|
|
@@ -14036,11 +14293,11 @@ class ContextMenu {
|
|
|
14036
14293
|
}
|
|
14037
14294
|
_addEvent() {
|
|
14038
14295
|
this.container.addEventListener("contextmenu", this._proxyContextMenuEvent);
|
|
14039
|
-
document.addEventListener("mousedown", this.
|
|
14296
|
+
document.addEventListener("mousedown", this._handleSideEffect);
|
|
14040
14297
|
}
|
|
14041
14298
|
removeEvent() {
|
|
14042
14299
|
this.container.removeEventListener("contextmenu", this._proxyContextMenuEvent);
|
|
14043
|
-
document.removeEventListener("mousedown", this.
|
|
14300
|
+
document.removeEventListener("mousedown", this._handleSideEffect);
|
|
14044
14301
|
}
|
|
14045
14302
|
_getContext() {
|
|
14046
14303
|
const isReadonly = this.draw.isReadonly();
|
|
@@ -14375,11 +14632,7 @@ class Shortcut {
|
|
|
14375
14632
|
this.command = command;
|
|
14376
14633
|
this.globalShortcutList = [];
|
|
14377
14634
|
this.agentShortcutList = [];
|
|
14378
|
-
this._addShortcutList([
|
|
14379
|
-
...richtextKeys,
|
|
14380
|
-
...titleKeys,
|
|
14381
|
-
...listKeys
|
|
14382
|
-
]);
|
|
14635
|
+
this._addShortcutList([...richtextKeys, ...titleKeys, ...listKeys]);
|
|
14383
14636
|
this._addEvent();
|
|
14384
14637
|
const agentDom = draw.getCursor().getAgentDom();
|
|
14385
14638
|
agentDom.addEventListener("keydown", this._agentKeydown.bind(this));
|
|
@@ -14440,10 +14693,48 @@ class Plugin {
|
|
|
14440
14693
|
pluginFunction(this.editor, options);
|
|
14441
14694
|
}
|
|
14442
14695
|
}
|
|
14696
|
+
class EventBus {
|
|
14697
|
+
constructor() {
|
|
14698
|
+
__publicField(this, "eventHub");
|
|
14699
|
+
this.eventHub = new Map();
|
|
14700
|
+
}
|
|
14701
|
+
on(eventName, callback) {
|
|
14702
|
+
if (!eventName || typeof callback !== "function")
|
|
14703
|
+
return;
|
|
14704
|
+
const eventSet = this.eventHub.get(eventName) || new Set();
|
|
14705
|
+
eventSet.add(callback);
|
|
14706
|
+
this.eventHub.set(eventName, eventSet);
|
|
14707
|
+
}
|
|
14708
|
+
emit(eventName, payload) {
|
|
14709
|
+
if (!eventName)
|
|
14710
|
+
return;
|
|
14711
|
+
const callBackSet = this.eventHub.get(eventName);
|
|
14712
|
+
if (!callBackSet)
|
|
14713
|
+
return;
|
|
14714
|
+
if (callBackSet.size === 1) {
|
|
14715
|
+
const callBack = [...callBackSet];
|
|
14716
|
+
return callBack[0](payload);
|
|
14717
|
+
}
|
|
14718
|
+
callBackSet.forEach((callBack) => callBack(payload));
|
|
14719
|
+
}
|
|
14720
|
+
off(eventName, callback) {
|
|
14721
|
+
if (!eventName || typeof callback !== "function")
|
|
14722
|
+
return;
|
|
14723
|
+
const callBackSet = this.eventHub.get(eventName);
|
|
14724
|
+
if (!callBackSet)
|
|
14725
|
+
return;
|
|
14726
|
+
callBackSet.delete(callback);
|
|
14727
|
+
}
|
|
14728
|
+
isSubscribe(eventName) {
|
|
14729
|
+
const eventSet = this.eventHub.get(eventName);
|
|
14730
|
+
return !!eventSet && eventSet.size > 0;
|
|
14731
|
+
}
|
|
14732
|
+
}
|
|
14443
14733
|
class Editor {
|
|
14444
14734
|
constructor(container, data2, options = {}) {
|
|
14445
14735
|
__publicField(this, "command");
|
|
14446
14736
|
__publicField(this, "listener");
|
|
14737
|
+
__publicField(this, "eventBus");
|
|
14447
14738
|
__publicField(this, "register");
|
|
14448
14739
|
__publicField(this, "destroy");
|
|
14449
14740
|
__publicField(this, "use");
|
|
@@ -14492,7 +14783,8 @@ class Editor {
|
|
|
14492
14783
|
paperDirection: PaperDirection.VERTICAL,
|
|
14493
14784
|
inactiveAlpha: 0.6,
|
|
14494
14785
|
historyMaxRecordCount: 100,
|
|
14495
|
-
wordBreak: WordBreak.BREAK_WORD
|
|
14786
|
+
wordBreak: WordBreak.BREAK_WORD,
|
|
14787
|
+
printPixelRatio: 3
|
|
14496
14788
|
}, options), {
|
|
14497
14789
|
header: headerOptions,
|
|
14498
14790
|
footer: footerOptions,
|
|
@@ -14514,17 +14806,23 @@ class Editor {
|
|
|
14514
14806
|
mainElementList = data2.main;
|
|
14515
14807
|
footerElementList = data2.footer || [];
|
|
14516
14808
|
}
|
|
14517
|
-
|
|
14809
|
+
const pageComponentData = [
|
|
14810
|
+
headerElementList,
|
|
14811
|
+
mainElementList,
|
|
14812
|
+
footerElementList
|
|
14813
|
+
];
|
|
14814
|
+
pageComponentData.forEach((elementList) => {
|
|
14518
14815
|
formatElementList(elementList, {
|
|
14519
14816
|
editorOptions
|
|
14520
14817
|
});
|
|
14521
14818
|
});
|
|
14522
14819
|
this.listener = new Listener();
|
|
14820
|
+
this.eventBus = new EventBus();
|
|
14523
14821
|
const draw = new Draw(container, editorOptions, {
|
|
14524
14822
|
header: headerElementList,
|
|
14525
14823
|
main: mainElementList,
|
|
14526
14824
|
footer: footerElementList
|
|
14527
|
-
}, this.listener);
|
|
14825
|
+
}, this.listener, this.eventBus);
|
|
14528
14826
|
this.command = new Command(new CommandAdapt(draw));
|
|
14529
14827
|
const contextMenu = new ContextMenu(draw, this.command);
|
|
14530
14828
|
const shortcut = new Shortcut(draw, this.command);
|