@agile_jy/word-editor 0.0.4 → 0.0.5
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/dist/canvas-editor.es.js +1188 -1177
- package/dist/canvas-editor.es.js.map +1 -1
- package/dist/canvas-editor.umd.js +16 -16
- package/dist/canvas-editor.umd.js.map +1 -1
- package/dist/src/editor/index.d.ts +5 -9
- package/package.json +1 -1
package/dist/canvas-editor.es.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
(function(){"use strict";try{if(typeof document!="undefined"){var e=document.createElement("style");e.id="canvas-editor-style",e.appendChild(document.createTextNode('.ce-select-control-popup{max-width:160px;min-width:69px;max-height:225px;position:absolute;z-index:1;border:1px solid #e4e7ed;border-radius:4px;background-color:#fff;box-shadow:0 2px 12px #0000001a;box-sizing:border-box;margin:5px 0;overflow-y:auto}.ce-select-control-popup ul{list-style:none;padding:3px 0;margin:0;box-sizing:border-box}.ce-select-control-popup ul li{font-size:13px;padding:0 20px;position:relative;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;color:#666;height:36px;line-height:36px;box-sizing:border-box;cursor:pointer}.ce-select-control-popup ul li:hover{background-color:#eef2fd}.ce-select-control-popup ul li.active{color:var(--COLOR-HOVER, #5175f4);font-weight:700}.ce-calculator{position:absolute;z-index:1;border:1px solid #e4e7ed;border-radius:4px;background-color:#fff;box-shadow:0 2px 12px #0000001a;box-sizing:border-box;margin:5px 0;padding:8px;width:200px}.ce-calculator-display{width:100%;height:40px;line-height:40px;text-align:right;padding:0 10px;margin-bottom:8px;border:1px solid #e4e7ed;border-radius:4px;background-color:#f5f7fa;font-size:16px;box-sizing:border-box;overflow:hidden;text-overflow:ellipsis}.ce-calculator-buttons{display:grid;grid-template-columns:repeat(4,1fr);gap:4px}.ce-calculator-button{width:100%;height:36px;border:1px solid #e4e7ed;border-radius:4px;background-color:#fff;font-size:14px;cursor:pointer;transition:all .2s;box-sizing:border-box}.ce-calculator-button:hover{background-color:#eef2fd;border-color:#c6d1ff}.ce-calculator-button:active{background-color:#e1e8ff}.ce-calculator-button.operator{background-color:#f5f7fa}.ce-calculator-button.operator:hover{background-color:#eef2fd}.ce-calculator-button.equal{background-color:var(--COLOR-HOVER, #5175f4);color:#fff;border-color:var(--COLOR-HOVER, #5175f4)}.ce-calculator-button.equal:hover{background-color:var(--COLOR-HOVER, #6a84ff);border-color:var(--COLOR-HOVER, #6a84ff)}.ce-calculator-button.utility{background-color:#f0f2f5}.ce-calculator-button.utility:hover{background-color:#e6e8eb}.ce-date-container{display:none;width:300px;overflow:hidden;left:0;right:0;position:absolute;z-index:1;color:#606266;background:#ffffff;border-radius:4px;padding:10px;user-select:none;border:1px solid #e4e7ed;box-shadow:0 2px 12px #0000001a}.ce-date-container.active{display:block}.ce-date-wrap{display:none}.ce-date-wrap.active{display:block}.ce-date-title{display:flex;justify-content:center;align-items:center;text-align:center;color:#606266;font-size:16px}.ce-date-title>span{display:inline-block}.ce-date-title>span:not(.ce-date-title__now){font-family:cursive;cursor:pointer}.ce-date-title>span:not(.ce-date-title__now):hover{color:#5175f4}.ce-date-title .ce-date-title__pre-year,.ce-date-title .ce-date-title__pre-month{width:15%}.ce-date-title .ce-date-title__now{width:40%}.ce-date-title .ce-date-title__next-year,.ce-date-title .ce-date-title__next-month{width:15%}.ce-date-week{width:100%;display:flex;justify-content:center;margin-top:15px;padding-bottom:5px;border-bottom:1px solid #e4e7ed}.ce-date-week>span{list-style:none;width:calc(100%/7);text-align:center;color:#606266;font-size:14px}.ce-date-day{width:100%;display:flex;flex-wrap:wrap;align-items:center;margin-top:5px}.ce-date-day>div{width:calc(100%/7);height:40px;text-align:center;color:#606266;font-size:14px;cursor:pointer;line-height:40px;border-radius:4px}.ce-date-day>div:hover{color:#5175f4;opacity:.8}.ce-date-day>div.active{color:#5175f4;font-weight:700}.ce-date-day>div.disable{color:#c0c4cc}.ce-date-day>div.select{color:#fff;background-color:#5175f4}.ce-time-wrap{display:none;padding:10px;height:286px}.ce-time-wrap ::-webkit-scrollbar{width:0}.ce-time-wrap.active{display:flex}.ce-time-wrap li{list-style:none}.ce-time-wrap>li{width:33.3%;height:100%;text-align:center}.ce-time-wrap>li>span{transform:translateY(-5px);display:inline-block}.ce-time-wrap>li>ol{height:calc(100% - 20px);overflow-y:auto;border:1px solid #e2e2e2;position:relative}.ce-time-wrap>li:first-child>ol{border-right:0}.ce-time-wrap>li:last-child>ol{border-left:0}.ce-time-wrap>li>ol>li{line-height:30px;cursor:pointer;transition:all .3s}.ce-time-wrap>li>ol>li:hover{background-color:#eaeaea}.ce-time-wrap>li>ol>li.active{color:#fff;background:#5175F4}.ce-date-menu{width:100%;height:28px;display:flex;justify-content:flex-end;align-items:center;padding-top:10px;position:relative;border-top:1px solid #e4e7ed}.ce-date-menu button{display:inline-block;line-height:1;white-space:nowrap;cursor:pointer;background:#fff;border:1px solid #dcdfe6;color:#606266;appearance:none;text-align:center;box-sizing:border-box;outline:none;transition:.1s;font-weight:500;user-select:none;padding:7px 15px;font-size:12px;border-radius:3px;margin:0 0 0 10px}.ce-date-menu button:hover{color:#5175f4;border-color:#5175f4}.ce-date-menu button.ce-date-menu__time{border:1px solid transparent;position:absolute;left:0;margin-left:0}.ce-date-menu button.ce-date-menu__time:hover{color:#5175f4}.ce-block-item{position:absolute;z-index:0;background-color:#fff;border:1px solid rgb(235 236 240)}.ce-block-item .ce-resizer-selection{width:100%;height:100%}.ce-block-item .ce-resizer-mask{position:absolute;top:0;bottom:0;left:0;right:0;z-index:1;background-color:transparent}.ce-table-tool__row{position:absolute;width:12px;border-radius:6.5px;overflow:hidden;background-color:#e2e6ed}.ce-table-tool__row .ce-table-tool__row__item{width:100%;position:relative;cursor:pointer;transition:all .3s}.ce-table-tool__row .ce-table-tool__row__item:after{content:"";position:absolute;bottom:0;left:2px;width:8px;height:1px;background-color:#c0c6cf}.ce-table-tool__row .ce-table-tool__row__item:hover{background-color:#dadce0}.ce-table-tool__row .ce-table-tool__row__item:last-child:after{display:none}.ce-table-tool__quick__add{width:16px;height:16px;position:absolute;border-radius:50%;background-color:#e2e6ed;cursor:pointer}.ce-table-tool__quick__add:after{content:"+";color:#fff;position:absolute;top:50%;left:50%;transform:translate(-50%,-55%)}.ce-table-tool__select{width:16px;height:18px;position:absolute;border-radius:3px;cursor:pointer}.ce-table-tool__select:hover{background-color:#e2e6ed}.ce-table-tool__select:after{content:":::";color:#aaaaab;position:absolute;top:50%;left:50%;transform:translate(-75%,-50%) rotate(-90deg)}.ce-table-tool__col{position:absolute;height:12px;border-radius:6.5px;overflow:hidden;background-color:#e2e6ed;display:flex}.ce-table-tool__col .ce-table-tool__col__item{height:100%;position:relative;cursor:pointer;transition:all .3s}.ce-table-tool__col .ce-table-tool__col__item:after{content:"";position:absolute;top:2px;left:-1px;width:1px;height:8px;z-index:1;background-color:#c0c6cf}.ce-table-tool__col .ce-table-tool__col__item:hover{background-color:#dadce0}.ce-table-tool__col .ce-table-tool__col__item:first-child:after{display:none}.ce-table-tool__row .ce-table-tool__row__item.active,.ce-table-tool__col .ce-table-tool__col__item.active{background-color:#c4d7fa}.ce-table-tool__col .ce-table-tool__anchor{right:-5px;width:10px;height:12px;z-index:9;position:absolute;cursor:col-resize}.ce-table-tool__row .ce-table-tool__anchor{bottom:-5px;left:0;width:12px;height:10px;z-index:9;position:absolute;cursor:row-resize}.ce-table-anchor__line{z-index:9;position:absolute;border:1px dotted #000000}.ce-table-tool__border{position:absolute;z-index:1;background:transparent;pointer-events:none}.ce-table-tool__border__row{position:absolute;cursor:row-resize;pointer-events:auto}.ce-table-tool__border__col{position:absolute;cursor:col-resize;pointer-events:auto}.ce-resizer-selection{position:absolute;border:1px solid;pointer-events:none}.ce-resizer-selection .resizer-handle{position:absolute;z-index:9;width:10px;height:10px;box-shadow:0 1px 4px #0000004d;border-radius:5px;border:2px solid #ffffff;box-sizing:border-box;pointer-events:initial}.ce-resizer-selection .handle-0{cursor:nw-resize}.ce-resizer-selection .handle-1{cursor:n-resize}.ce-resizer-selection .handle-2{cursor:ne-resize}.ce-resizer-selection .handle-3{cursor:e-resize}.ce-resizer-selection .handle-4{cursor:se-resize}.ce-resizer-selection .handle-5{cursor:s-resize}.ce-resizer-selection .handle-6{cursor:sw-resize}.ce-resizer-selection .handle-7{cursor:w-resize}.ce-resizer-size-view{display:flex;align-items:center;height:20px;white-space:nowrap;position:absolute;z-index:9;top:-30px;left:0;opacity:.9;background-color:#000;padding:0 5px;border-radius:4px}.ce-resizer-size-view span{color:#fff;font-size:12px}.ce-resizer-image{position:absolute;opacity:.5}.ce-image-previewer{position:fixed;left:0;top:0;z-index:1000;width:100%;height:100%;overflow:hidden;background:#f2f4f7;display:flex;align-items:center;justify-content:center;animation:previewerAnimation .3s}@keyframes previewerAnimation{0%{opacity:.1}to{opacity:1}}.ce-image-previewer .image-close{width:24px;height:24px;display:inline-block;position:absolute;right:50px;top:30px;z-index:99;cursor:pointer;background:url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMzIiIGhlaWdodD0iMzIiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTIzLjk3IDdsMS40MTUgMS40MTQtNy43NzkgNy43NzggNy43NzkgNy43NzktMS40MTQgMS40MTQtNy43NzktNy43NzktNy43NzggNy43NzlMNyAyMy45N2w3Ljc3OC03Ljc3OUw3IDguNDE0IDguNDE0IDdsNy43NzggNy43NzhMMjMuOTcxIDd6IiBmaWxsPSIjM0Q0NzU3IiBmaWxsLXJ1bGU9ImV2ZW5vZGQiLz48L3N2Zz4=) no-repeat;background-size:100% 100%;transition:all .3s;border-radius:50%}.ce-image-previewer .image-close:hover{background-color:#e2e6ed}.ce-image-previewer .ce-image-container{position:relative}.ce-image-previewer .ce-image-container img{cursor:move;position:relative}.ce-image-previewer .ce-image-menu{height:50px;position:absolute;bottom:50px;z-index:99;display:flex;align-items:center;justify-content:center}.ce-image-previewer .ce-image-menu i{width:32px;height:32px;margin:0 8px;cursor:pointer;display:inline-block;background-repeat:no-repeat;background-size:100% 100%;transition:all .3s;border-radius:50%}.ce-image-previewer .ce-image-menu i:hover{background-color:#e2e6ed}.ce-image-previewer .ce-image-menu i.zoom-in{background-image:url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMzIiIGhlaWdodD0iMzIiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTE0IDE0di00aDJ2NGg0djJoLTR2NGgtMnYtNGgtNHYtMmg0em04Ljc0OSAxMC4xNjNBMTEuOTUyIDExLjk1MiAwIDAxMTUgMjdDOC4zNzMgMjcgMyAyMS42MjcgMyAxNVM4LjM3MyAzIDE1IDNzMTIgNS4zNzMgMTIgMTJjMCAyLjk1NC0xLjA2NyA1LjY1OC0yLjgzNyA3Ljc0OWw0LjkwOCA0LjkwOC0xLjQxNCAxLjQxNC00LjkwOC00LjkwOHpNMTUgMjVjNS41MjMgMCAxMC00LjQ3NyAxMC0xMFMyMC41MjMgNSAxNSA1IDUgOS40NzcgNSAxNXM0LjQ3NyAxMCAxMCAxMHoiIGZpbGw9IiMzRDQ3NTciLz48L3N2Zz4=)}.ce-image-previewer .ce-image-menu i.zoom-out{background-image:url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMzIiIGhlaWdodD0iMzIiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTIyLjc0OSAyNC4xNjNBMTEuOTUyIDExLjk1MiAwIDAxMTUgMjdDOC4zNzMgMjcgMyAyMS42MjcgMyAxNVM4LjM3MyAzIDE1IDNzMTIgNS4zNzMgMTIgMTJjMCAyLjk1NC0xLjA2NyA1LjY1OC0yLjgzNyA3Ljc0OWw0LjkwOCA0LjkwOC0xLjQxNCAxLjQxNC00LjkwOC00LjkwOHpNMTUgMjVjNS41MjMgMCAxMC00LjQ3NyAxMC0xMFMyMC41MjMgNSAxNSA1IDUgOS40NzcgNSAxNXM0LjQ3NyAxMCAxMCAxMHptLTUtMTFoMTB2MkgxMHYtMnoiIGZpbGw9IiMzRDQ3NTciLz48L3N2Zz4=)}.ce-image-previewer .ce-image-menu i.rotate{background-image:url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMzIiIGhlaWdodD0iMzIiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGcgZmlsbD0iIzNENDc1NyIgZmlsbC1ydWxlPSJldmVub2RkIj48cGF0aCBkPSJNMTYgNGM2LjYyNyAwIDEyIDUuMzczIDEyIDEyYTExLjk3IDExLjk3IDAgMDEtNCA4Ljk0NFYyM2gtLjg2QTkuOTY4IDkuOTY4IDAgMDAyNiAxNmMwLTUuNTIzLTQuNDc3LTEwLTEwLTEwUzYgMTAuNDc3IDYgMTZjMCA1LjE4NSAzLjk0NyA5LjQ0OSA5IDkuOTV2Mi4wMDlDOC44NCAyNy40NTEgNCAyMi4yOTEgNCAxNiA0IDkuMzczIDkuMzczIDQgMTYgNHoiIGZpbGwtcnVsZT0ibm9uemVybyIvPjxwYXRoIGQ9Ik0xOS44NzkgMjcuMzI4bDEuNzY3LTYuNzE3IDQuOTUgNC45NXoiLz48L2c+PC9zdmc+)}.ce-image-previewer .ce-image-menu i.original-size{background-image:url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMzIiIGhlaWdodD0iMzIiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTQgNGgyNHYyNEg0VjR6bTIgMnYyMGgyMFY2SDZ6bTQgNWgydjEwaC0yVjExem01IDJoMnYyaC0ydi0yem0wIDRoMnYyaC0ydi0yem01LTZoMnYxMGgtMlYxMXoiIGZpbGw9IiMzRDQ3NTciLz48L3N2Zz4=)}.ce-image-previewer .ce-image-menu i.image-download{background-image:url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjQiIGhlaWdodD0iMjQiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTQuNSAxNXYzLjVoMTVWMTVIMjF2NUgzdi01aDEuNXptOC4yMzItMTEuMjI2djkuMTk2bDQuMDUtNC4wNSAxLjA2IDEuMDYtNS44MzQgNS44MzQtNS44MzMtNS44MzMgMS4wNi0xLjA2IDMuOTk4IDMuOTk2VjMuNzc0aDEuNXoiIGZpbGw9IiMzRDQ3NTciLz48L3N2Zz4=)}.ce-image-previewer .ce-image-menu .image-navigate{display:flex;align-items:center;justify-content:center}.ce-image-previewer .ce-image-menu i.image-pre{background-image:url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjAiIGhlaWdodD0iMjAiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTEyLjUgNC4wNjNMNi44NzUgMTBsNS42MjUgNS45MzgiIHN0cm9rZT0iIzNENDc1NyIgc3Ryb2tlLXdpZHRoPSIxLjUiIHN0cm9rZS1saW5lY2FwPSJyb3VuZCIgc3Ryb2tlLWxpbmVqb2luPSJyb3VuZCIvPjwvc3ZnPg==)}.ce-image-previewer .ce-image-menu i.image-next{background-image:url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjAiIGhlaWdodD0iMjAiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTcuNSA0LjA2M0wxMy4xMjUgMTAgNy41IDE1LjkzOCIgc3Ryb2tlPSIjM0Q0NzU3IiBzdHJva2Utd2lkdGg9IjEuNSIgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIiBzdHJva2UtbGluZWpvaW49InJvdW5kIi8+PC9zdmc+)}.ce-image-previewer .ce-image-menu .image-count{color:#000;font-size:20px}.ce-image-previewer .ce-image-menu i.disabled{cursor:not-allowed;opacity:.5}.ce-contextmenu-container{z-index:9;position:fixed;display:none;padding:4px;overflow-x:hidden;overflow-y:auto;background:#fff;box-shadow:0 2px 12px #38383833;border:1px solid #e2e6ed;border-radius:2px}.ce-contextmenu-content{display:flex;flex-direction:column}.ce-contextmenu-content .ce-contextmenu-sub-item:after{position:absolute;content:"";width:16px;height:16px;right:12px;background:url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGcgZmlsbD0ibm9uZSIgZmlsbC1ydWxlPSJldmVub2RkIj48cGF0aCBkPSJNMCAwaDE2djE2SDB6Ii8+PGcgZmlsbD0iIzc2N0M4NSI+PHBhdGggZD0iTTcgMTIuMjQzbC0uNzA3LS43MDcgNC4yNDMtNC4yNDMuNzA3LjcwN3oiLz48cGF0aCBkPSJNNi4yOTMgNC40NjRMNyAzLjc1NyAxMS4yNDMgOGwtLjcwNy43MDd6Ii8+PC9nPjwvZz48L3N2Zz4=)}.ce-contextmenu-content .ce-contextmenu-item{min-width:140px;padding:0 32px 0 16px;height:30px;display:flex;align-items:center;white-space:nowrap;box-sizing:border-box;cursor:pointer}.ce-contextmenu-content .ce-contextmenu-item.hover{background:rgba(25,55,88,.04)}.ce-contextmenu-content .ce-contextmenu-item span{max-width:300px;font-size:12px;color:#3d4757;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.ce-contextmenu-content .ce-contextmenu-item span.ce-shortcut{color:#767c85;height:30px;flex:1;text-align:right;line-height:30px;margin-left:20px}.ce-contextmenu-content .ce-contextmenu-item i{width:16px;height:16px;vertical-align:middle;display:inline-block;background-repeat:no-repeat;background-size:100% 100%;flex-shrink:0;margin-right:8px}.ce-contextmenu-divider{background-color:#e2e6ed;margin:4px 16px;height:1px}.ce-contextmenu-print{background-image:url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIHZpZXdCb3g9IjAgMCAxNiAxNiIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLz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xLjQ1OS0xLjM2OHoiIGZpbGw9IiMzRDQ3NTciIGZpbGwtcnVsZT0ibm9uemVybyIvPjwvZz48L3N2Zz4=)}.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-contextm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AwMS0xIDFoLTF6bTItNGgtMVY4LjVoLTJ2LTFoMlY2aDF2NHpNOC41IDcuNXYtMWgtMXYxaC0xdjFoMXYxaDF2LTFoMXYtMWgtMXoiIGZpbGw9IiMwMDAwMDAiLz48L3N2Zz4=)}.ce-contextmenu-border-external{background-image:url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTIuNSAzYS41LjUgMCAwMS41LS41aDExYS41LjUgMCAwMS41LjV2MTFhLjUuNSAwIDAxLS41LjVIM2EuNS41IDAgMDEtLjUtLjVWM3oiIHN0cm9rZT0iIzNENDc1NyIvPjxwYXRoIGZpbGwtcnVsZT0iZXZlbm9kZCIgY2xpcC1ydWxlPSJldmVub2RkIiBkPSJNOSA1VjNIOHYyaDF6bTAgOXYtMkg4djJoMXpNNSA4SDN2MWgyVjh6bTkgMGgtMnYxaDJWOHpNOSA3djFoMXYxSDl2MUg4VjlIN1Y4aDFWN2gxeiIgZmlsbD0iI0FBQUNCMCIvPjwvc3ZnPg==)}.ce-contextmenu-border-internal{background-image:url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTIuNSAzYS41LjUgMCAwMS41LS41aDExYS41LjUgMCAwMS41LjV2MTFhLjUuNSAwIDAxLS41LjVIM2EuNS41IDAgMDEtLjUtLjVWM3oiIHN0cm9rZT0iI0FBQUNCMCIvPjxwYXRoIGZpbGwtcnVsZT0iZXZlbm9kZCIgY2xpcC1ydWxlPSJldmVub2RkIiBkPSJNOSA1VjNIOHYyaDF6bTAgOXYtMkg4djJoMXpNNSA4SDN2MWgyVjh6bTkgMGgtMnYxaDJWOHpNOSA3djFoMXYxSDl2MUg4VjlIN1Y4aDFWN2gxeiIgZmlsbD0iIzNENDc1NyIvPjwvc3ZnPg==)}.ce-contextmenu-border-td{background-image:url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTIuNSAzYS41LjUgMCAwMS41LS41aDExYS41LjUgMCAwMS41LjV2MTFhLjUuNSAwIDAxLS41LjVIM2EuNS41IDAgMDEtLjUtLjVWM3oiIHN0cm9rZT0iI0FBQUNCMCIvPjxwYXRoIHN0cm9rZT0iIzNENDc1NyIgZD0iTTguNSAyLjUgdjYgaC02Ii8+PC9zdmc+)}.ce-contextmenu-border-td-top{background-image:url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTIuNSAzYS41LjUgMCAwMS41LS41aDExYS41LjUgMCAwMS41LjV2MTFhLjUuNSAwIDAxLS41LjVIM2EuNS41IDAgMDEtLjUtLjVWM3oiIHN0cm9rZT0iI0FBQUNCMCIvPjxwYXRoIHN0cm9rZT0iIzNENDc1NyIgc3Ryb2tlLXdpZHRoPSIyIiBkPSJNMi41IDMgaDEyIi8+PC9zdmc+)}.ce-contextmenu-border-td-left{background-image:url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTIuNSAzYS41LjUgMCAwMS41LS41aDExYS41LjUgMCAwMS41LjV2MTFhLjUuNSAwIDAxLS41LjVIM2EuNS41IDAgMDEtLjUtLjVWM3oiIHN0cm9rZT0iI0FBQUNCMCIvPjxwYXRoIHN0cm9rZT0iIzNENDc1NyIgc3Ryb2tlLXdpZHRoPSIyIiBkPSJNMyAzIHYxMSIvPjwvc3ZnPg==)}.ce-contextmenu-border-td-bottom{background-image:url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTIuNSAzYS41LjUgMCAwMS41LS41aDExYS41LjUgMCAwMS41LjV2MTFhLjUuNSAwIDAxLS41LjVIM2EuNS41IDAgMDEtLjUtLjVWM3oiIHN0cm9rZT0iI0FBQUNCMCIvPjxwYXRoIHN0cm9rZT0iIzNENDc1NyIgc3Ryb2tlLXdpZHRoPSIyIiBkPSJNMi41IDE0IGgxMiIvPjwvc3ZnPg==)}.ce-contextmenu-border-td-right{background-image:url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTIuNSAzYS41LjUgMCAwMS41LS41aDExYS41LjUgMCAwMS41LjV2MTFhLjUuNSAwIDAxLS41LjVIM2EuNS41IDAgMDEtLjUtLjVWM3oiIHN0cm9rZT0iI0FBQUNCMCIvPjxwYXRoIHN0cm9rZT0iIzNENDc1NyIgc3Ryb2tlLXdpZHRoPSIyIiBkPSJNMTQgMyB2MTEiLz48L3N2Zz4=)}.ce-contextmenu-border-td-forward{background-image:url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTIuNSAzYS41LjUgMCAwMS41LS41aDExYS41LjUgMCAwMS41LjV2MTFhLjUuNSAwIDAxLS41LjVIM2EuNS41IDAgMDEtLjUtLjVWM3oiIHN0cm9rZT0iI0FBQUNCMCIgLz48cGF0aCBzdHJva2U9IiMzRDQ3NTciIGQ9Ik0xNCAzIGwtMTEgMTEiIC8+PC9zdmc+)}.ce-contextmenu-border-td-back{background-image:url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTIuNSAzYS41LjUgMCAwMS41LS41aDExYS41LjUgMCAwMS41LjV2MTFhLjUuNSAwIDAxLS41LjVIM2EuNS41IDAgMDEtLjUtLjVWM3oiIHN0cm9rZT0iI0FBQUNCMCIgLz48cGF0aCBzdHJva2U9IiMzRDQ3NTciIGQ9Ik0zIDMgbDExIDExIiAvPjwvc3ZnPg==)}.ce-hyperlink-popup{background:#fff;box-shadow:0 2px 12px #626b8433;border-radius:2px;color:#3d4757;padding:12px 16px;position:absolute;z-index:1;text-align:center;display:none}.ce-hyperlink-popup a{min-width:100px;max-width:300px;font-size:12px;display:inline-block;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;cursor:pointer;text-decoration:none;border-bottom-width:1px;border-bottom-style:solid;color:#00f}.ce-zone-indicator>div{padding:3px 6px;color:#000;font-size:12px;background:rgb(218 231 252);position:absolute;transform-origin:0 0}.ce-zone-indicator-border__top,.ce-zone-indicator-border__bottom,.ce-zone-indicator-border__left,.ce-zone-indicator-border__right{display:block;position:absolute;z-index:0}.ce-zone-indicator-border__top{border-top:2px dashed rgb(238,238,238)}.ce-zone-indicator-border__bottom{border-top:2px dashed rgb(238,238,238);width:100%}.ce-zone-indicator-border__left{border-left:2px dashed rgb(238,238,238)}.ce-zone-indicator-border__right{border-right:2px dashed rgb(238,238,238)}.ce-zone-tip{display:none;align-items:center;height:30px;white-space:nowrap;position:fixed;opacity:.9;background-color:#000;padding:0 5px;border-radius:4px;z-index:9;transition:all .3s;outline:none;user-select:none;pointer-events:none;transform:translate(10px,10px)}.ce-zone-tip.show{display:flex}.ce-zone-tip span{color:#fff;font-size:12px}.ce-inputarea{width:100px;height:30px;min-width:0;min-height:0;margin:0;padding:0;left:0;top:0;letter-spacing:0;font-size:12px;position:absolute;z-index:-1;outline:none;resize:none;border:none;overflow:hidden;color:transparent;user-select:none;caret-color:transparent;background-color:transparent}.ce-cursor{width:1px;height:20px;left:0;right:0;position:absolute;outline:none;background-color:#000;pointer-events:none}.ce-cursor.ce-cursor--animation{animation-duration:1s;animation-iteration-count:infinite;animation-name:cursorAnimation}@keyframes cursorAnimation{0%{opacity:1}13%{opacity:0}50%{opacity:0}63%{opacity:1}to{opacity:1}}.ce-float-image{position:absolute;opacity:.5;pointer-events:none}.dialog-mask{position:fixed;left:0;top:0;width:100%;height:100%;opacity:.5;background:#000000;z-index:99}.dialog-container{position:fixed;top:0;right:0;bottom:0;left:0;overflow:auto;z-index:999;margin:0;display:flex;justify-content:center;align-items:center}.dialog{position:absolute;padding:0 30px 30px;background:#ffffff;box-shadow:0 2px 12px #38383833;border:1px solid #e2e6ed;border-radius:2px}.dialog-title{position:relative;border-bottom:1px solid #e2e6ed;margin-bottom:30px;height:60px;display:flex;align-items:center;justify-content:space-between}.dialog-title i{width:16px;height:16px;cursor:pointer;display:inline-block;background:url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIHZpZXdCb3g9IjAgMCAxNiAxNiIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cGF0aCBkPSJNOC45IDguMTkybDQuMjQyIDQuMjQzLS43MDcuNzA3TDguMTkyIDguOSAzLjk1IDEzLjE0MmwtLjcwNy0uNzA3IDQuMjQyLTQuMjQzTDMuMjQzIDMuOTVsLjcwNy0uNzA3IDQuMjQyIDQuMjQyIDQuMjQzLTQuMjQyLjcwNy43MDdMOC45IDguMTkyeiIgZmlsbD0iIzZBNkE2QSIgZmlsbC1ydWxlPSJldmVub2RkIi8+PC9zdmc+)}.dialog-option__item{margin-bottom:18px;display:flex;align-items:center;justify-content:space-between}.dialog-option__item span{margin-right:12px;font-size:14px;color:#3d4757;position:relative}.dialog-option__item input,.dialog-option__item textarea,.dialog-option__item select{width:276px;height:30px;border-radius:2px;border:1px solid #d3d3d3;min-height:30px;padding:5px;box-sizing:border-box;outline:none;appearance:none;user-select:none;font-family:inherit}.dialog-option__item input:focus,.dialog-option__item textarea:focus{border-color:#4991f2}.dialog-option__item--require:before{content:"*";color:#f56c6c;margin-right:4px;position:absolute;left:-8px}.dialog-menu{display:flex;align-items:center;justify-content:flex-end}.dialog-menu button{position:relative;display:inline-block;border:1px solid #e2e6ed;border-radius:2px;background:#ffffff;line-height:22px;padding:0 16px;white-space:nowrap;cursor:pointer}.dialog-menu button:hover{background:rgba(25,55,88,.04)}.dialog-menu__cancel{margin-right:16px}.dialog-menu button[type=submit]{color:#fff;background:#4991f2;border-color:#4991f2}.dialog-menu button[type=submit]:hover{background:#5b9cf3;border-color:#5b9cf3}')),document.head.appendChild(e)}}catch(i){console.error("vite-plugin-css-injected-by-js",i)}})();
|
|
2
2
|
var index = "";
|
|
3
|
-
const version = "0.0.
|
|
3
|
+
const version = "0.0.5";
|
|
4
4
|
var MaxHeightRatio;
|
|
5
5
|
(function(MaxHeightRatio2) {
|
|
6
6
|
MaxHeightRatio2["HALF"] = "half";
|
|
@@ -8341,974 +8341,208 @@ function drop(evt, host) {
|
|
|
8341
8341
|
}
|
|
8342
8342
|
}
|
|
8343
8343
|
}
|
|
8344
|
-
|
|
8345
|
-
|
|
8346
|
-
|
|
8347
|
-
|
|
8348
|
-
|
|
8349
|
-
|
|
8350
|
-
|
|
8351
|
-
|
|
8344
|
+
function getWordRangeBySegmenter(host) {
|
|
8345
|
+
var _a;
|
|
8346
|
+
if (!Intl.Segmenter)
|
|
8347
|
+
return null;
|
|
8348
|
+
const draw = host.getDraw();
|
|
8349
|
+
const cursorPosition = draw.getPosition().getCursorPosition();
|
|
8350
|
+
if (!cursorPosition)
|
|
8351
|
+
return null;
|
|
8352
|
+
const rangeManager = draw.getRange();
|
|
8353
|
+
const paragraphInfo = rangeManager.getRangeParagraphInfo();
|
|
8354
|
+
if (!paragraphInfo)
|
|
8355
|
+
return null;
|
|
8356
|
+
const paragraphText = ((_a = paragraphInfo == null ? void 0 : paragraphInfo.elementList) == null ? void 0 : _a.map((e) => !e.type || e.type !== ElementType.CONTROL && TEXTLIKE_ELEMENT_TYPE.includes(e.type) ? e.value : ZERO).join("")) || "";
|
|
8357
|
+
if (!paragraphText)
|
|
8358
|
+
return null;
|
|
8359
|
+
const cursorStartIndex = cursorPosition.isFirstLetter || draw.getCursor().getHitLineStartIndex() ? cursorPosition.index + 1 : cursorPosition.index;
|
|
8360
|
+
const offset = paragraphInfo.startIndex;
|
|
8361
|
+
const segmenter = new Intl.Segmenter(void 0, { granularity: "word" });
|
|
8362
|
+
const segments = segmenter.segment(paragraphText);
|
|
8363
|
+
let startIndex = -1;
|
|
8364
|
+
let endIndex = -1;
|
|
8365
|
+
for (const { segment, index: index2, isWordLike } of segments) {
|
|
8366
|
+
const realSegmentStartIndex = index2 + offset;
|
|
8367
|
+
if (isWordLike && cursorStartIndex >= realSegmentStartIndex && cursorStartIndex < realSegmentStartIndex + segment.length) {
|
|
8368
|
+
startIndex = realSegmentStartIndex - 1;
|
|
8369
|
+
endIndex = startIndex + segment.length;
|
|
8370
|
+
break;
|
|
8371
|
+
}
|
|
8352
8372
|
}
|
|
8353
|
-
|
|
8354
|
-
|
|
8355
|
-
|
|
8356
|
-
|
|
8357
|
-
|
|
8358
|
-
|
|
8359
|
-
|
|
8360
|
-
|
|
8361
|
-
|
|
8362
|
-
|
|
8363
|
-
|
|
8364
|
-
|
|
8365
|
-
|
|
8366
|
-
const
|
|
8367
|
-
|
|
8368
|
-
|
|
8369
|
-
|
|
8370
|
-
|
|
8371
|
-
|
|
8372
|
-
|
|
8373
|
-
onClose();
|
|
8374
|
-
}
|
|
8375
|
-
this._dispose();
|
|
8376
|
-
};
|
|
8377
|
-
titleContainer.append(titleSpan);
|
|
8378
|
-
titleContainer.append(titleClose);
|
|
8379
|
-
dialogContainer.append(titleContainer);
|
|
8380
|
-
const optionContainer = document.createElement("div");
|
|
8381
|
-
optionContainer.classList.add("dialog-option");
|
|
8382
|
-
for (let i = 0; i < data2.length; i++) {
|
|
8383
|
-
const option = data2[i];
|
|
8384
|
-
const optionItemContainer = document.createElement("div");
|
|
8385
|
-
optionItemContainer.classList.add("dialog-option__item");
|
|
8386
|
-
if (option.label) {
|
|
8387
|
-
const optionName = document.createElement("span");
|
|
8388
|
-
optionName.append(document.createTextNode(option.label));
|
|
8389
|
-
optionItemContainer.append(optionName);
|
|
8390
|
-
if (option.required) {
|
|
8391
|
-
optionName.classList.add("dialog-option__item--require");
|
|
8392
|
-
}
|
|
8393
|
-
}
|
|
8394
|
-
let optionInput;
|
|
8395
|
-
if (option.type === "select") {
|
|
8396
|
-
optionInput = document.createElement("select");
|
|
8397
|
-
(_a = option.options) == null ? void 0 : _a.forEach((item) => {
|
|
8398
|
-
const optionItem = document.createElement("option");
|
|
8399
|
-
optionItem.value = item.value;
|
|
8400
|
-
optionItem.label = item.label;
|
|
8401
|
-
optionInput.append(optionItem);
|
|
8402
|
-
});
|
|
8403
|
-
} else if (option.type === "textarea") {
|
|
8404
|
-
optionInput = document.createElement("textarea");
|
|
8405
|
-
} else if (option.type === "color") {
|
|
8406
|
-
optionInput = document.createElement("input");
|
|
8407
|
-
optionInput.type = "text";
|
|
8408
|
-
optionInput.onclick = function() {
|
|
8409
|
-
colorControlDom.click();
|
|
8410
|
-
};
|
|
8411
|
-
const colorControlDom = document.querySelector("#color");
|
|
8412
|
-
colorControlDom.oninput = function() {
|
|
8413
|
-
optionInput.value = colorControlDom.value;
|
|
8414
|
-
};
|
|
8373
|
+
return ~startIndex && ~endIndex ? { startIndex, endIndex } : null;
|
|
8374
|
+
}
|
|
8375
|
+
function getWordRangeByCursor(host) {
|
|
8376
|
+
const draw = host.getDraw();
|
|
8377
|
+
const cursorPosition = draw.getPosition().getCursorPosition();
|
|
8378
|
+
if (!cursorPosition)
|
|
8379
|
+
return null;
|
|
8380
|
+
const { value, index: index2 } = cursorPosition;
|
|
8381
|
+
const LETTER_REG = draw.getLetterReg();
|
|
8382
|
+
let upCount = 0;
|
|
8383
|
+
let downCount = 0;
|
|
8384
|
+
const isNumber2 = NUMBER_LIKE_REG.test(value);
|
|
8385
|
+
if (isNumber2 || LETTER_REG.test(value)) {
|
|
8386
|
+
const elementList = draw.getElementList();
|
|
8387
|
+
let upStartIndex = index2 - 1;
|
|
8388
|
+
while (upStartIndex > 0) {
|
|
8389
|
+
const value2 = elementList[upStartIndex].value;
|
|
8390
|
+
if (isNumber2 && NUMBER_LIKE_REG.test(value2) || !isNumber2 && LETTER_REG.test(value2)) {
|
|
8391
|
+
upCount++;
|
|
8392
|
+
upStartIndex--;
|
|
8415
8393
|
} else {
|
|
8416
|
-
|
|
8417
|
-
optionInput.type = option.type;
|
|
8418
|
-
}
|
|
8419
|
-
if (option.width) {
|
|
8420
|
-
optionInput.style.width = `${option.width}px`;
|
|
8421
|
-
}
|
|
8422
|
-
if (option.height) {
|
|
8423
|
-
optionInput.style.height = `${option.height}px`;
|
|
8394
|
+
break;
|
|
8424
8395
|
}
|
|
8425
|
-
|
|
8426
|
-
|
|
8427
|
-
|
|
8428
|
-
|
|
8396
|
+
}
|
|
8397
|
+
let downStartIndex = index2 + 1;
|
|
8398
|
+
while (downStartIndex < elementList.length) {
|
|
8399
|
+
const value2 = elementList[downStartIndex].value;
|
|
8400
|
+
if (isNumber2 && NUMBER_LIKE_REG.test(value2) || !isNumber2 && LETTER_REG.test(value2)) {
|
|
8401
|
+
downCount++;
|
|
8402
|
+
downStartIndex++;
|
|
8403
|
+
} else {
|
|
8404
|
+
break;
|
|
8429
8405
|
}
|
|
8430
|
-
optionItemContainer.append(optionInput);
|
|
8431
|
-
optionContainer.append(optionItemContainer);
|
|
8432
|
-
this.inputList.push(optionInput);
|
|
8433
8406
|
}
|
|
8434
|
-
|
|
8435
|
-
|
|
8436
|
-
|
|
8437
|
-
|
|
8438
|
-
|
|
8439
|
-
|
|
8440
|
-
|
|
8441
|
-
|
|
8442
|
-
|
|
8443
|
-
|
|
8407
|
+
}
|
|
8408
|
+
const startIndex = index2 - upCount - 1;
|
|
8409
|
+
if (startIndex < 0)
|
|
8410
|
+
return null;
|
|
8411
|
+
return {
|
|
8412
|
+
startIndex,
|
|
8413
|
+
endIndex: index2 + downCount
|
|
8414
|
+
};
|
|
8415
|
+
}
|
|
8416
|
+
function dblclick(host, evt) {
|
|
8417
|
+
const draw = host.getDraw();
|
|
8418
|
+
const position = draw.getPosition();
|
|
8419
|
+
const positionContext = position.getPositionByXY({
|
|
8420
|
+
x: evt.offsetX,
|
|
8421
|
+
y: evt.offsetY
|
|
8422
|
+
});
|
|
8423
|
+
if (positionContext.isImage && positionContext.isDirectHit) {
|
|
8424
|
+
const elementList = draw.getElementList();
|
|
8425
|
+
const eventBus = draw.getEventBus();
|
|
8426
|
+
const curElement = elementList[positionContext.index];
|
|
8427
|
+
if (eventBus.isSubscribe("imageDblclick")) {
|
|
8428
|
+
eventBus.emit("imageDblclick", {
|
|
8429
|
+
evt,
|
|
8430
|
+
element: curElement
|
|
8431
|
+
});
|
|
8432
|
+
}
|
|
8433
|
+
if (curElement.formInput) {
|
|
8434
|
+
const editor = Reflect.get(window, "editor");
|
|
8435
|
+
console.log("curElement", curElement);
|
|
8436
|
+
if (curElement.formInput && curElement.formInput.type === "checkbox") {
|
|
8437
|
+
editor.showFormCheckboxConfig(curElement);
|
|
8438
|
+
return;
|
|
8444
8439
|
}
|
|
8445
|
-
|
|
8446
|
-
|
|
8447
|
-
|
|
8448
|
-
const confirmBtn = document.createElement("button");
|
|
8449
|
-
confirmBtn.append(document.createTextNode("\u786E\u5B9A"));
|
|
8450
|
-
confirmBtn.type = "submit";
|
|
8451
|
-
confirmBtn.onclick = () => {
|
|
8452
|
-
if (onConfirm) {
|
|
8453
|
-
const payload = this.inputList.map((input2) => ({
|
|
8454
|
-
name: input2.name,
|
|
8455
|
-
value: input2.value
|
|
8456
|
-
}));
|
|
8457
|
-
onConfirm(payload);
|
|
8440
|
+
if (curElement.formInput && curElement.formInput.type === "radio") {
|
|
8441
|
+
editor.showformRadioConfig(curElement);
|
|
8442
|
+
return;
|
|
8458
8443
|
}
|
|
8459
|
-
|
|
8460
|
-
|
|
8461
|
-
|
|
8462
|
-
|
|
8463
|
-
|
|
8464
|
-
|
|
8465
|
-
|
|
8444
|
+
editor.showFormInputConfig(curElement);
|
|
8445
|
+
return;
|
|
8446
|
+
}
|
|
8447
|
+
if (curElement.imgPreviewDisabled)
|
|
8448
|
+
return;
|
|
8449
|
+
draw.getPreviewer().render();
|
|
8450
|
+
return;
|
|
8466
8451
|
}
|
|
8467
|
-
|
|
8468
|
-
|
|
8469
|
-
|
|
8470
|
-
|
|
8452
|
+
if (draw.getIsPagingMode()) {
|
|
8453
|
+
if (!~positionContext.index && positionContext.zone) {
|
|
8454
|
+
draw.getZone().setZone(positionContext.zone);
|
|
8455
|
+
draw.clearSideEffect();
|
|
8456
|
+
position.setPositionContext({
|
|
8457
|
+
isTable: false
|
|
8458
|
+
});
|
|
8459
|
+
return;
|
|
8460
|
+
}
|
|
8461
|
+
}
|
|
8462
|
+
if ((positionContext.isCheckbox || positionContext.isRadio) && positionContext.isDirectHit) {
|
|
8463
|
+
return;
|
|
8471
8464
|
}
|
|
8465
|
+
const rangeManager = draw.getRange();
|
|
8466
|
+
const segmenterRange = getWordRangeBySegmenter(host) || getWordRangeByCursor(host);
|
|
8467
|
+
if (!segmenterRange)
|
|
8468
|
+
return;
|
|
8469
|
+
rangeManager.setRange(segmenterRange.startIndex, segmenterRange.endIndex);
|
|
8470
|
+
draw.render({
|
|
8471
|
+
isSubmitHistory: false,
|
|
8472
|
+
isSetCursor: false,
|
|
8473
|
+
isCompute: false
|
|
8474
|
+
});
|
|
8475
|
+
rangeManager.setRangeStyle();
|
|
8472
8476
|
}
|
|
8473
|
-
function
|
|
8474
|
-
|
|
8475
|
-
|
|
8476
|
-
|
|
8477
|
-
|
|
8478
|
-
|
|
8479
|
-
|
|
8480
|
-
|
|
8481
|
-
|
|
8482
|
-
|
|
8483
|
-
|
|
8484
|
-
|
|
8485
|
-
|
|
8486
|
-
|
|
8487
|
-
|
|
8488
|
-
|
|
8489
|
-
|
|
8490
|
-
|
|
8491
|
-
|
|
8492
|
-
canvas.height = config.height;
|
|
8493
|
-
ctx.clearRect(0, 0, canvas.width, canvas.height);
|
|
8494
|
-
ctx.fillStyle = "#ffffff";
|
|
8495
|
-
ctx.fillRect(0, 0, canvas.width, canvas.height);
|
|
8496
|
-
let fontStyle = "";
|
|
8497
|
-
if (config.bold)
|
|
8498
|
-
fontStyle += "bold ";
|
|
8499
|
-
if (config.italic)
|
|
8500
|
-
fontStyle += "italic ";
|
|
8501
|
-
let currentFontSize = config.fontSize;
|
|
8502
|
-
let textWidth, textHeight;
|
|
8503
|
-
do {
|
|
8504
|
-
const font = `${fontStyle}${currentFontSize}px ${config.fontFamily}`;
|
|
8505
|
-
ctx.font = font;
|
|
8506
|
-
const textMetrics2 = ctx.measureText(config.text);
|
|
8507
|
-
textWidth = textMetrics2.width;
|
|
8508
|
-
textHeight = textMetrics2.actualBoundingBoxAscent + textMetrics2.actualBoundingBoxDescent;
|
|
8509
|
-
if ((textWidth > config.width || textHeight > config.height) && currentFontSize > 1) {
|
|
8510
|
-
currentFontSize--;
|
|
8511
|
-
} else {
|
|
8477
|
+
function threeClick(host) {
|
|
8478
|
+
var _a, _b;
|
|
8479
|
+
const draw = host.getDraw();
|
|
8480
|
+
const control = draw.getControl();
|
|
8481
|
+
if (control.getActiveControl() && control.selectValue())
|
|
8482
|
+
return;
|
|
8483
|
+
const position = draw.getPosition();
|
|
8484
|
+
const cursorPosition = position.getCursorPosition();
|
|
8485
|
+
if (!cursorPosition)
|
|
8486
|
+
return;
|
|
8487
|
+
const { index: index2 } = cursorPosition;
|
|
8488
|
+
const elementList = draw.getElementList();
|
|
8489
|
+
let upCount = 0;
|
|
8490
|
+
let downCount = 0;
|
|
8491
|
+
let upStartIndex = index2 - 1;
|
|
8492
|
+
while (upStartIndex > 0) {
|
|
8493
|
+
const element = elementList[upStartIndex];
|
|
8494
|
+
const preElement = elementList[upStartIndex - 1];
|
|
8495
|
+
if (element.value === ZERO && !element.listWrap || element.listId !== (preElement == null ? void 0 : preElement.listId) || element.titleId !== (preElement == null ? void 0 : preElement.titleId)) {
|
|
8512
8496
|
break;
|
|
8513
8497
|
}
|
|
8514
|
-
|
|
8515
|
-
|
|
8516
|
-
ctx.font = finalFont;
|
|
8517
|
-
const textMetrics = ctx.measureText(config.text);
|
|
8518
|
-
textWidth = textMetrics.width;
|
|
8519
|
-
textHeight = textMetrics.actualBoundingBoxAscent + textMetrics.actualBoundingBoxDescent;
|
|
8520
|
-
const bgX = (config.width - textWidth) / 2 - 4;
|
|
8521
|
-
const bgY = (config.height - textHeight) / 2 - 4;
|
|
8522
|
-
ctx.fillStyle = config.textBgColor;
|
|
8523
|
-
ctx.fillRect(bgX, bgY, textWidth + 8, textHeight + 8);
|
|
8524
|
-
ctx.fillStyle = config.color;
|
|
8525
|
-
ctx.textAlign = "center";
|
|
8526
|
-
ctx.textBaseline = "middle";
|
|
8527
|
-
ctx.fillText(config.text, canvas.width / 2, canvas.height / 2);
|
|
8528
|
-
const offset = config.borderWidth;
|
|
8529
|
-
ctx.strokeStyle = config.borderColor;
|
|
8530
|
-
ctx.lineWidth = config.borderWidth;
|
|
8531
|
-
ctx.strokeRect(
|
|
8532
|
-
offset,
|
|
8533
|
-
offset,
|
|
8534
|
-
config.width - offset * 2,
|
|
8535
|
-
config.height - offset * 2
|
|
8536
|
-
);
|
|
8537
|
-
return canvas.toDataURL("image/png");
|
|
8538
|
-
}
|
|
8539
|
-
function generateCheckboxImage(options) {
|
|
8540
|
-
const config = {
|
|
8541
|
-
checked: false,
|
|
8542
|
-
width: 100,
|
|
8543
|
-
height: 40,
|
|
8544
|
-
label: "",
|
|
8545
|
-
fontSize: 14,
|
|
8546
|
-
fontFamily: "SimSun",
|
|
8547
|
-
color: "#000000",
|
|
8548
|
-
borderColor: "#000000",
|
|
8549
|
-
checkColor: "#5175f4",
|
|
8550
|
-
boxSize: 20,
|
|
8551
|
-
gap: 8,
|
|
8552
|
-
borderWidth: 1,
|
|
8553
|
-
...options
|
|
8554
|
-
};
|
|
8555
|
-
const canvas = document.createElement("canvas");
|
|
8556
|
-
const ctx = canvas.getContext("2d");
|
|
8557
|
-
canvas.width = config.width;
|
|
8558
|
-
canvas.height = config.height;
|
|
8559
|
-
ctx.clearRect(0, 0, canvas.width, canvas.height);
|
|
8560
|
-
ctx.fillStyle = "#ffffff";
|
|
8561
|
-
ctx.fillRect(0, 0, canvas.width, canvas.height);
|
|
8562
|
-
ctx.strokeStyle = config.borderColor;
|
|
8563
|
-
ctx.lineWidth = config.borderWidth;
|
|
8564
|
-
ctx.strokeRect(
|
|
8565
|
-
config.borderWidth / 2,
|
|
8566
|
-
config.borderWidth / 2,
|
|
8567
|
-
config.width - config.borderWidth,
|
|
8568
|
-
config.height - config.borderWidth
|
|
8569
|
-
);
|
|
8570
|
-
const centerY = config.height / 2;
|
|
8571
|
-
const boxLeft = config.gap + config.borderWidth;
|
|
8572
|
-
const boxTop = centerY - config.boxSize / 2;
|
|
8573
|
-
ctx.strokeStyle = config.borderColor;
|
|
8574
|
-
ctx.lineWidth = 1.5;
|
|
8575
|
-
ctx.strokeRect(boxLeft, boxTop, config.boxSize, config.boxSize);
|
|
8576
|
-
if (config.checked) {
|
|
8577
|
-
ctx.fillStyle = config.checkColor;
|
|
8578
|
-
ctx.fillRect(boxLeft + 2, boxTop + 2, config.boxSize - 4, config.boxSize - 4);
|
|
8579
|
-
ctx.beginPath();
|
|
8580
|
-
ctx.strokeStyle = "#ffffff";
|
|
8581
|
-
ctx.lineWidth = 2;
|
|
8582
|
-
ctx.lineCap = "round";
|
|
8583
|
-
ctx.lineJoin = "round";
|
|
8584
|
-
const checkStartX = boxLeft + 5;
|
|
8585
|
-
const checkStartY = boxTop + config.boxSize / 2 + 2;
|
|
8586
|
-
const checkMiddleX = boxLeft + config.boxSize / 2 - 1;
|
|
8587
|
-
const checkMiddleY = boxTop + config.boxSize - 6;
|
|
8588
|
-
const checkEndX = boxLeft + config.boxSize - 4;
|
|
8589
|
-
const checkEndY = boxTop + 6;
|
|
8590
|
-
ctx.moveTo(checkStartX, checkStartY);
|
|
8591
|
-
ctx.lineTo(checkMiddleX, checkMiddleY);
|
|
8592
|
-
ctx.lineTo(checkEndX, checkEndY);
|
|
8593
|
-
ctx.stroke();
|
|
8498
|
+
upCount++;
|
|
8499
|
+
upStartIndex--;
|
|
8594
8500
|
}
|
|
8595
|
-
|
|
8596
|
-
|
|
8597
|
-
|
|
8598
|
-
|
|
8599
|
-
|
|
8600
|
-
|
|
8601
|
-
|
|
8501
|
+
let downStartIndex = index2 + 1;
|
|
8502
|
+
while (downStartIndex < elementList.length) {
|
|
8503
|
+
const element = elementList[downStartIndex];
|
|
8504
|
+
const nextElement = elementList[downStartIndex + 1];
|
|
8505
|
+
if (element.value === ZERO && !element.listWrap || element.listId !== (nextElement == null ? void 0 : nextElement.listId) || element.titleId !== (nextElement == null ? void 0 : nextElement.titleId)) {
|
|
8506
|
+
break;
|
|
8507
|
+
}
|
|
8508
|
+
downCount++;
|
|
8509
|
+
downStartIndex++;
|
|
8602
8510
|
}
|
|
8603
|
-
|
|
8604
|
-
|
|
8605
|
-
|
|
8606
|
-
|
|
8607
|
-
checked: false,
|
|
8608
|
-
width: 100,
|
|
8609
|
-
height: 40,
|
|
8610
|
-
label: "",
|
|
8611
|
-
fontSize: 14,
|
|
8612
|
-
fontFamily: "SimSun",
|
|
8613
|
-
color: "#000000",
|
|
8614
|
-
borderColor: "#000000",
|
|
8615
|
-
checkColor: "#5175f4",
|
|
8616
|
-
boxSize: 20,
|
|
8617
|
-
gap: 8,
|
|
8618
|
-
borderWidth: 1,
|
|
8619
|
-
...options
|
|
8620
|
-
};
|
|
8621
|
-
const canvas = document.createElement("canvas");
|
|
8622
|
-
const ctx = canvas.getContext("2d");
|
|
8623
|
-
canvas.width = config.width;
|
|
8624
|
-
canvas.height = config.height;
|
|
8625
|
-
ctx.clearRect(0, 0, canvas.width, canvas.height);
|
|
8626
|
-
ctx.fillStyle = "#ffffff";
|
|
8627
|
-
ctx.fillRect(0, 0, canvas.width, canvas.height);
|
|
8628
|
-
ctx.strokeStyle = config.borderColor;
|
|
8629
|
-
ctx.lineWidth = config.borderWidth;
|
|
8630
|
-
ctx.strokeRect(
|
|
8631
|
-
config.borderWidth / 2,
|
|
8632
|
-
config.borderWidth / 2,
|
|
8633
|
-
config.width - config.borderWidth,
|
|
8634
|
-
config.height - config.borderWidth
|
|
8635
|
-
);
|
|
8636
|
-
const centerY = config.height / 2;
|
|
8637
|
-
const circleLeft = config.gap + config.borderWidth;
|
|
8638
|
-
const circleTop = centerY - config.boxSize / 2;
|
|
8639
|
-
const circleCenterX = circleLeft + config.boxSize / 2;
|
|
8640
|
-
const circleCenterY = circleTop + config.boxSize / 2;
|
|
8641
|
-
ctx.strokeStyle = config.borderColor;
|
|
8642
|
-
ctx.lineWidth = 1.5;
|
|
8643
|
-
ctx.beginPath();
|
|
8644
|
-
ctx.arc(circleCenterX, circleCenterY, config.boxSize / 2, 0, Math.PI * 2);
|
|
8645
|
-
ctx.stroke();
|
|
8646
|
-
if (config.checked) {
|
|
8647
|
-
ctx.fillStyle = config.checkColor;
|
|
8648
|
-
ctx.beginPath();
|
|
8649
|
-
ctx.arc(circleCenterX, circleCenterY, config.boxSize / 4, 0, Math.PI * 2);
|
|
8650
|
-
ctx.fill();
|
|
8511
|
+
const rangeManager = draw.getRange();
|
|
8512
|
+
let newStartIndex = index2 - upCount - 1;
|
|
8513
|
+
if (((_a = elementList[newStartIndex]) == null ? void 0 : _a.value) !== ZERO) {
|
|
8514
|
+
newStartIndex -= 1;
|
|
8651
8515
|
}
|
|
8652
|
-
if (
|
|
8653
|
-
|
|
8654
|
-
|
|
8655
|
-
|
|
8656
|
-
|
|
8657
|
-
const textX = circleLeft + config.boxSize + config.gap;
|
|
8658
|
-
ctx.fillText(config.label, textX, centerY);
|
|
8516
|
+
if (newStartIndex < 0)
|
|
8517
|
+
return;
|
|
8518
|
+
let newEndIndex = index2 + downCount + 1;
|
|
8519
|
+
if (((_b = elementList[newEndIndex]) == null ? void 0 : _b.value) === ZERO || newEndIndex > elementList.length - 1) {
|
|
8520
|
+
newEndIndex -= 1;
|
|
8659
8521
|
}
|
|
8660
|
-
|
|
8522
|
+
rangeManager.setRange(newStartIndex, newEndIndex);
|
|
8523
|
+
draw.render({
|
|
8524
|
+
isSubmitHistory: false,
|
|
8525
|
+
isSetCursor: false,
|
|
8526
|
+
isCompute: false
|
|
8527
|
+
});
|
|
8661
8528
|
}
|
|
8662
|
-
|
|
8663
|
-
|
|
8664
|
-
|
|
8665
|
-
|
|
8666
|
-
|
|
8667
|
-
|
|
8668
|
-
|
|
8669
|
-
|
|
8670
|
-
|
|
8671
|
-
|
|
8672
|
-
|
|
8673
|
-
|
|
8674
|
-
|
|
8675
|
-
|
|
8676
|
-
|
|
8677
|
-
|
|
8678
|
-
|
|
8679
|
-
type: "text",
|
|
8680
|
-
label: "\u8868\u5355 Key",
|
|
8681
|
-
name: "key",
|
|
8682
|
-
required: true,
|
|
8683
|
-
value: (_b = (_a = el == null ? void 0 : el.formInput) == null ? void 0 : _a.key) != null ? _b : "",
|
|
8684
|
-
placeholder: "\u8BF7\u8F93\u5165\u8868\u5355 Key"
|
|
8685
|
-
},
|
|
8686
|
-
{
|
|
8687
|
-
type: "number",
|
|
8688
|
-
label: "\u5BBD\u5EA6 (px)",
|
|
8689
|
-
name: "width",
|
|
8690
|
-
required: true,
|
|
8691
|
-
placeholder: "\u8BF7\u8F93\u5165\u5BBD\u5EA6",
|
|
8692
|
-
value: (_d = (_c = el == null ? void 0 : el.formInput) == null ? void 0 : _c.width) != null ? _d : "120"
|
|
8693
|
-
},
|
|
8694
|
-
{
|
|
8695
|
-
type: "number",
|
|
8696
|
-
label: "\u9AD8\u5EA6 (px)",
|
|
8697
|
-
name: "height",
|
|
8698
|
-
required: true,
|
|
8699
|
-
placeholder: "\u8BF7\u8F93\u5165\u9AD8\u5EA6",
|
|
8700
|
-
value: (_f = (_e = el == null ? void 0 : el.formInput) == null ? void 0 : _e.height) != null ? _f : "40"
|
|
8701
|
-
},
|
|
8702
|
-
{
|
|
8703
|
-
type: "select",
|
|
8704
|
-
label: "\u9ED8\u8BA4\u9009\u4E2D",
|
|
8705
|
-
name: "checked",
|
|
8706
|
-
required: true,
|
|
8707
|
-
value: ((_g = el == null ? void 0 : el.formInput) == null ? void 0 : _g.checked) ? "true" : "false",
|
|
8708
|
-
options: [
|
|
8709
|
-
{
|
|
8710
|
-
label: "\u662F",
|
|
8711
|
-
value: "true"
|
|
8712
|
-
},
|
|
8713
|
-
{
|
|
8714
|
-
label: "\u5426",
|
|
8715
|
-
value: "false"
|
|
8716
|
-
}
|
|
8717
|
-
]
|
|
8718
|
-
},
|
|
8719
|
-
{
|
|
8720
|
-
type: "text",
|
|
8721
|
-
label: "\u6807\u7B7E\u6587\u5B57",
|
|
8722
|
-
name: "label",
|
|
8723
|
-
required: true,
|
|
8724
|
-
value: (_i = (_h = el == null ? void 0 : el.formInput) == null ? void 0 : _h.label) != null ? _i : "",
|
|
8725
|
-
placeholder: "\u8BF7\u8F93\u5165\u6807\u7B7E\u6587\u5B57"
|
|
8726
|
-
},
|
|
8727
|
-
{
|
|
8728
|
-
type: "number",
|
|
8729
|
-
label: "\u5B57\u53F7",
|
|
8730
|
-
name: "fontSize",
|
|
8731
|
-
required: true,
|
|
8732
|
-
placeholder: "\u8BF7\u8F93\u5165\u5B57\u53F7",
|
|
8733
|
-
value: (_k = (_j = el == null ? void 0 : el.formInput) == null ? void 0 : _j.fontSize) != null ? _k : "14"
|
|
8734
|
-
},
|
|
8735
|
-
{
|
|
8736
|
-
type: "color",
|
|
8737
|
-
label: "\u5B57\u4F53\u989C\u8272",
|
|
8738
|
-
name: "color",
|
|
8739
|
-
required: true,
|
|
8740
|
-
value: (_m = (_l = el == null ? void 0 : el.formInput) == null ? void 0 : _l.color) != null ? _m : "#000000"
|
|
8741
|
-
},
|
|
8742
|
-
{
|
|
8743
|
-
type: "select",
|
|
8744
|
-
label: "\u5B57\u4F53\u6837\u5F0F",
|
|
8745
|
-
name: "fontFamily",
|
|
8746
|
-
required: true,
|
|
8747
|
-
value: (_o = (_n = el == null ? void 0 : el.formInput) == null ? void 0 : _n.fontFamily) != null ? _o : "SimSun",
|
|
8748
|
-
options: liOption
|
|
8749
|
-
}
|
|
8750
|
-
],
|
|
8751
|
-
onConfirm: (payload) => {
|
|
8752
|
-
var _a2, _b2, _c2, _d2, _e2, _f2, _g2, _h2;
|
|
8753
|
-
console.log("payload: ", payload);
|
|
8754
|
-
const key = (_a2 = payload.find((p) => p.name === "key")) == null ? void 0 : _a2.value;
|
|
8755
|
-
if (!key)
|
|
8756
|
-
return;
|
|
8757
|
-
const width = (_b2 = payload.find((p) => p.name === "width")) == null ? void 0 : _b2.value;
|
|
8758
|
-
if (!width)
|
|
8759
|
-
return;
|
|
8760
|
-
const height = (_c2 = payload.find((p) => p.name === "height")) == null ? void 0 : _c2.value;
|
|
8761
|
-
if (!height)
|
|
8762
|
-
return;
|
|
8763
|
-
const checked = ((_d2 = payload.find((p) => p.name === "checked")) == null ? void 0 : _d2.value) === "true";
|
|
8764
|
-
const label = ((_e2 = payload.find((p) => p.name === "label")) == null ? void 0 : _e2.value) || "";
|
|
8765
|
-
const fontSize = (_f2 = payload.find((p) => p.name === "fontSize")) == null ? void 0 : _f2.value;
|
|
8766
|
-
const color = (_g2 = payload.find((p) => p.name === "color")) == null ? void 0 : _g2.value;
|
|
8767
|
-
const fontFamily = (_h2 = payload.find((p) => p.name === "fontFamily")) == null ? void 0 : _h2.value;
|
|
8768
|
-
const type = "checkbox";
|
|
8769
|
-
const formInput = {
|
|
8770
|
-
key,
|
|
8771
|
-
width,
|
|
8772
|
-
height,
|
|
8773
|
-
checked,
|
|
8774
|
-
label,
|
|
8775
|
-
fontSize,
|
|
8776
|
-
fontFamily,
|
|
8777
|
-
color,
|
|
8778
|
-
type
|
|
8779
|
-
};
|
|
8780
|
-
const imageDataUrl = generateCheckboxImage({
|
|
8781
|
-
checked,
|
|
8782
|
-
label,
|
|
8783
|
-
width: Number(width),
|
|
8784
|
-
height: Number(height),
|
|
8785
|
-
fontSize: Number(fontSize),
|
|
8786
|
-
fontFamily,
|
|
8787
|
-
color
|
|
8788
|
-
});
|
|
8789
|
-
const param = {
|
|
8790
|
-
value: imageDataUrl,
|
|
8791
|
-
type: ElementType.IMAGE,
|
|
8792
|
-
formInput,
|
|
8793
|
-
width: Number(width),
|
|
8794
|
-
height: Number(height)
|
|
8795
|
-
};
|
|
8796
|
-
if (el == null ? void 0 : el.id) {
|
|
8797
|
-
const deleteOpt = {
|
|
8798
|
-
id: el.id,
|
|
8799
|
-
properties: param
|
|
8800
|
-
};
|
|
8801
|
-
console.log("deleteOpt12", deleteOpt);
|
|
8802
|
-
command.executeUpdateElementById(deleteOpt);
|
|
8803
|
-
return;
|
|
8804
|
-
}
|
|
8805
|
-
command.executeInsertElementList([param]);
|
|
8806
|
-
}
|
|
8807
|
-
});
|
|
8808
|
-
}
|
|
8809
|
-
function formRadioPropertiesConfigDialog(el, command) {
|
|
8810
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o;
|
|
8811
|
-
console.log("el", el);
|
|
8812
|
-
const fontDom = document.querySelector(".menu-item__font");
|
|
8813
|
-
const fontOptionDom = fontDom.querySelector(".options");
|
|
8814
|
-
const liOption = [];
|
|
8815
|
-
fontOptionDom.querySelectorAll("li").forEach((li) => {
|
|
8816
|
-
var _a2, _b2;
|
|
8817
|
-
liOption.push({
|
|
8818
|
-
label: li.innerText,
|
|
8819
|
-
value: (_b2 = (_a2 = li.attributes.getNamedItem("data-family")) == null ? void 0 : _a2.value) != null ? _b2 : ""
|
|
8820
|
-
});
|
|
8821
|
-
});
|
|
8822
|
-
new Dialog({
|
|
8823
|
-
title: "\u8868\u5355\u5355\u9009\u6846",
|
|
8824
|
-
data: [
|
|
8825
|
-
{
|
|
8826
|
-
type: "text",
|
|
8827
|
-
label: "\u8868\u5355 Key",
|
|
8828
|
-
name: "key",
|
|
8829
|
-
required: true,
|
|
8830
|
-
value: (_b = (_a = el == null ? void 0 : el.formInput) == null ? void 0 : _a.key) != null ? _b : "",
|
|
8831
|
-
placeholder: "\u8BF7\u8F93\u5165\u8868\u5355 Key"
|
|
8832
|
-
},
|
|
8833
|
-
{
|
|
8834
|
-
type: "number",
|
|
8835
|
-
label: "\u5BBD\u5EA6 (px)",
|
|
8836
|
-
name: "width",
|
|
8837
|
-
required: true,
|
|
8838
|
-
placeholder: "\u8BF7\u8F93\u5165\u5BBD\u5EA6",
|
|
8839
|
-
value: (_d = (_c = el == null ? void 0 : el.formInput) == null ? void 0 : _c.width) != null ? _d : "120"
|
|
8840
|
-
},
|
|
8841
|
-
{
|
|
8842
|
-
type: "number",
|
|
8843
|
-
label: "\u9AD8\u5EA6 (px)",
|
|
8844
|
-
name: "height",
|
|
8845
|
-
required: true,
|
|
8846
|
-
placeholder: "\u8BF7\u8F93\u5165\u9AD8\u5EA6",
|
|
8847
|
-
value: (_f = (_e = el == null ? void 0 : el.formInput) == null ? void 0 : _e.height) != null ? _f : "40"
|
|
8848
|
-
},
|
|
8849
|
-
{
|
|
8850
|
-
type: "select",
|
|
8851
|
-
label: "\u9ED8\u8BA4\u9009\u4E2D",
|
|
8852
|
-
name: "checked",
|
|
8853
|
-
required: true,
|
|
8854
|
-
value: ((_g = el == null ? void 0 : el.formInput) == null ? void 0 : _g.checked) ? "true" : "false",
|
|
8855
|
-
options: [
|
|
8856
|
-
{
|
|
8857
|
-
label: "\u662F",
|
|
8858
|
-
value: "true"
|
|
8859
|
-
},
|
|
8860
|
-
{
|
|
8861
|
-
label: "\u5426",
|
|
8862
|
-
value: "false"
|
|
8863
|
-
}
|
|
8864
|
-
]
|
|
8865
|
-
},
|
|
8866
|
-
{
|
|
8867
|
-
type: "text",
|
|
8868
|
-
label: "\u6807\u7B7E\u6587\u5B57",
|
|
8869
|
-
name: "label",
|
|
8870
|
-
required: true,
|
|
8871
|
-
value: (_i = (_h = el == null ? void 0 : el.formInput) == null ? void 0 : _h.label) != null ? _i : "",
|
|
8872
|
-
placeholder: "\u8BF7\u8F93\u5165\u6807\u7B7E\u6587\u5B57"
|
|
8873
|
-
},
|
|
8874
|
-
{
|
|
8875
|
-
type: "number",
|
|
8876
|
-
label: "\u5B57\u53F7",
|
|
8877
|
-
name: "fontSize",
|
|
8878
|
-
required: true,
|
|
8879
|
-
placeholder: "\u8BF7\u8F93\u5165\u5B57\u53F7",
|
|
8880
|
-
value: (_k = (_j = el == null ? void 0 : el.formInput) == null ? void 0 : _j.fontSize) != null ? _k : "14"
|
|
8881
|
-
},
|
|
8882
|
-
{
|
|
8883
|
-
type: "color",
|
|
8884
|
-
label: "\u5B57\u4F53\u989C\u8272",
|
|
8885
|
-
name: "color",
|
|
8886
|
-
required: true,
|
|
8887
|
-
value: (_m = (_l = el == null ? void 0 : el.formInput) == null ? void 0 : _l.color) != null ? _m : "#000000"
|
|
8888
|
-
},
|
|
8889
|
-
{
|
|
8890
|
-
type: "select",
|
|
8891
|
-
label: "\u5B57\u4F53\u6837\u5F0F",
|
|
8892
|
-
name: "fontFamily",
|
|
8893
|
-
required: true,
|
|
8894
|
-
value: (_o = (_n = el == null ? void 0 : el.formInput) == null ? void 0 : _n.fontFamily) != null ? _o : "SimSun",
|
|
8895
|
-
options: liOption
|
|
8896
|
-
}
|
|
8897
|
-
],
|
|
8898
|
-
onConfirm: (payload) => {
|
|
8899
|
-
var _a2, _b2, _c2, _d2, _e2, _f2, _g2, _h2;
|
|
8900
|
-
console.log("payload: ", payload);
|
|
8901
|
-
const key = (_a2 = payload.find((p) => p.name === "key")) == null ? void 0 : _a2.value;
|
|
8902
|
-
if (!key)
|
|
8903
|
-
return;
|
|
8904
|
-
const width = (_b2 = payload.find((p) => p.name === "width")) == null ? void 0 : _b2.value;
|
|
8905
|
-
if (!width)
|
|
8906
|
-
return;
|
|
8907
|
-
const height = (_c2 = payload.find((p) => p.name === "height")) == null ? void 0 : _c2.value;
|
|
8908
|
-
if (!height)
|
|
8909
|
-
return;
|
|
8910
|
-
const checked = ((_d2 = payload.find((p) => p.name === "checked")) == null ? void 0 : _d2.value) === "true";
|
|
8911
|
-
const label = ((_e2 = payload.find((p) => p.name === "label")) == null ? void 0 : _e2.value) || "";
|
|
8912
|
-
const fontSize = (_f2 = payload.find((p) => p.name === "fontSize")) == null ? void 0 : _f2.value;
|
|
8913
|
-
const color = (_g2 = payload.find((p) => p.name === "color")) == null ? void 0 : _g2.value;
|
|
8914
|
-
const fontFamily = (_h2 = payload.find((p) => p.name === "fontFamily")) == null ? void 0 : _h2.value;
|
|
8915
|
-
const type = "radio";
|
|
8916
|
-
const formInput = {
|
|
8917
|
-
key,
|
|
8918
|
-
width,
|
|
8919
|
-
height,
|
|
8920
|
-
checked,
|
|
8921
|
-
label,
|
|
8922
|
-
fontSize,
|
|
8923
|
-
fontFamily,
|
|
8924
|
-
color,
|
|
8925
|
-
type
|
|
8926
|
-
};
|
|
8927
|
-
const imageDataUrl = generateRadioImage({
|
|
8928
|
-
checked,
|
|
8929
|
-
label,
|
|
8930
|
-
width: Number(width),
|
|
8931
|
-
height: Number(height),
|
|
8932
|
-
fontSize: Number(fontSize),
|
|
8933
|
-
fontFamily,
|
|
8934
|
-
color
|
|
8935
|
-
});
|
|
8936
|
-
const param = {
|
|
8937
|
-
value: imageDataUrl,
|
|
8938
|
-
type: ElementType.IMAGE,
|
|
8939
|
-
formInput,
|
|
8940
|
-
width: Number(width),
|
|
8941
|
-
height: Number(height)
|
|
8942
|
-
};
|
|
8943
|
-
if (el == null ? void 0 : el.id) {
|
|
8944
|
-
const deleteOpt = {
|
|
8945
|
-
id: el.id,
|
|
8946
|
-
properties: param
|
|
8947
|
-
};
|
|
8948
|
-
console.log("deleteOpt12", deleteOpt);
|
|
8949
|
-
command.executeUpdateElementById(deleteOpt);
|
|
8950
|
-
return;
|
|
8951
|
-
}
|
|
8952
|
-
command.executeInsertElementList([param]);
|
|
8953
|
-
}
|
|
8954
|
-
});
|
|
8955
|
-
}
|
|
8956
|
-
function formInputPropertiesConfigDialog(el, command) {
|
|
8957
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p;
|
|
8958
|
-
console.log("el", el);
|
|
8959
|
-
const fontDom = document.querySelector(".menu-item__font");
|
|
8960
|
-
const fontOptionDom = fontDom.querySelector(".options");
|
|
8961
|
-
const liOption = [];
|
|
8962
|
-
fontOptionDom.querySelectorAll("li").forEach((li) => {
|
|
8963
|
-
var _a2, _b2;
|
|
8964
|
-
liOption.push({
|
|
8965
|
-
label: li.innerText,
|
|
8966
|
-
value: (_b2 = (_a2 = li.attributes.getNamedItem("data-family")) == null ? void 0 : _a2.value) != null ? _b2 : ""
|
|
8967
|
-
});
|
|
8968
|
-
});
|
|
8969
|
-
new Dialog({
|
|
8970
|
-
title: "\u8868\u5355\u6587\u672C\u6846",
|
|
8971
|
-
data: [
|
|
8972
|
-
{
|
|
8973
|
-
type: "text",
|
|
8974
|
-
label: "\u8868\u5355Key",
|
|
8975
|
-
name: "key",
|
|
8976
|
-
required: true,
|
|
8977
|
-
value: (_b = (_a = el == null ? void 0 : el.formInput) == null ? void 0 : _a.key) != null ? _b : "",
|
|
8978
|
-
placeholder: "\u8BF7\u8F93\u5165\u8868\u5355Key"
|
|
8979
|
-
},
|
|
8980
|
-
{
|
|
8981
|
-
type: "number",
|
|
8982
|
-
label: "\u5BBD\u5EA6(px)",
|
|
8983
|
-
name: "width",
|
|
8984
|
-
required: true,
|
|
8985
|
-
placeholder: "\u8BF7\u8F93\u5165\u5BBD\u5EA6",
|
|
8986
|
-
value: (_d = (_c = el == null ? void 0 : el.formInput) == null ? void 0 : _c.width) != null ? _d : "100"
|
|
8987
|
-
},
|
|
8988
|
-
{
|
|
8989
|
-
type: "number",
|
|
8990
|
-
label: "\u9AD8\u5EA6(px)",
|
|
8991
|
-
name: "height",
|
|
8992
|
-
required: true,
|
|
8993
|
-
placeholder: "\u8BF7\u8F93\u5165\u9AD8\u5EA6",
|
|
8994
|
-
value: (_f = (_e = el == null ? void 0 : el.formInput) == null ? void 0 : _e.height) != null ? _f : "50"
|
|
8995
|
-
},
|
|
8996
|
-
{
|
|
8997
|
-
type: "number",
|
|
8998
|
-
label: "\u5B57\u53F7",
|
|
8999
|
-
name: "fontSize",
|
|
9000
|
-
required: true,
|
|
9001
|
-
placeholder: "\u8BF7\u8F93\u5165\u5B57\u53F7",
|
|
9002
|
-
value: (_h = (_g = el == null ? void 0 : el.formInput) == null ? void 0 : _g.fontSize) != null ? _h : "10"
|
|
9003
|
-
},
|
|
9004
|
-
{
|
|
9005
|
-
type: "select",
|
|
9006
|
-
label: "\u662F\u5426\u52A0\u7C97",
|
|
9007
|
-
name: "bold",
|
|
9008
|
-
required: true,
|
|
9009
|
-
value: ((_i = el == null ? void 0 : el.formInput) == null ? void 0 : _i.bold) ? String((_j = el == null ? void 0 : el.formInput) == null ? void 0 : _j.bold) : "false",
|
|
9010
|
-
options: [
|
|
9011
|
-
{
|
|
9012
|
-
label: "\u662F",
|
|
9013
|
-
value: "true"
|
|
9014
|
-
},
|
|
9015
|
-
{
|
|
9016
|
-
label: "\u5426",
|
|
9017
|
-
value: "false"
|
|
9018
|
-
}
|
|
9019
|
-
]
|
|
9020
|
-
},
|
|
9021
|
-
{
|
|
9022
|
-
type: "select",
|
|
9023
|
-
label: "\u662F\u5426\u659C\u4F53",
|
|
9024
|
-
name: "italic",
|
|
9025
|
-
required: true,
|
|
9026
|
-
value: ((_k = el == null ? void 0 : el.formInput) == null ? void 0 : _k.italic) ? String((_l = el == null ? void 0 : el.formInput) == null ? void 0 : _l.italic) : "false",
|
|
9027
|
-
options: [
|
|
9028
|
-
{
|
|
9029
|
-
label: "\u662F",
|
|
9030
|
-
value: "true"
|
|
9031
|
-
},
|
|
9032
|
-
{
|
|
9033
|
-
label: "\u5426",
|
|
9034
|
-
value: "false"
|
|
9035
|
-
}
|
|
9036
|
-
]
|
|
9037
|
-
},
|
|
9038
|
-
{
|
|
9039
|
-
type: "color",
|
|
9040
|
-
label: "\u5B57\u4F53\u989C\u8272",
|
|
9041
|
-
name: "color",
|
|
9042
|
-
required: true,
|
|
9043
|
-
value: (_n = (_m = el == null ? void 0 : el.formInput) == null ? void 0 : _m.color) != null ? _n : "#000000"
|
|
9044
|
-
},
|
|
9045
|
-
{
|
|
9046
|
-
type: "select",
|
|
9047
|
-
label: "\u5B57\u4F53\u6837\u5F0F",
|
|
9048
|
-
name: "fontFamily",
|
|
9049
|
-
required: true,
|
|
9050
|
-
value: (_p = (_o = el == null ? void 0 : el.formInput) == null ? void 0 : _o.fontFamily) != null ? _p : "SimSun",
|
|
9051
|
-
options: liOption
|
|
9052
|
-
}
|
|
9053
|
-
],
|
|
9054
|
-
onConfirm: (payload) => {
|
|
9055
|
-
var _a2, _b2, _c2, _d2, _e2, _f2, _g2, _h2;
|
|
9056
|
-
console.log("payload: ", payload);
|
|
9057
|
-
const key = (_a2 = payload.find((p) => p.name === "key")) == null ? void 0 : _a2.value;
|
|
9058
|
-
if (!key)
|
|
9059
|
-
return;
|
|
9060
|
-
const width = (_b2 = payload.find((p) => p.name === "width")) == null ? void 0 : _b2.value;
|
|
9061
|
-
if (!width)
|
|
9062
|
-
return;
|
|
9063
|
-
const height = (_c2 = payload.find((p) => p.name === "height")) == null ? void 0 : _c2.value;
|
|
9064
|
-
if (!height)
|
|
9065
|
-
return;
|
|
9066
|
-
const fontSize = (_d2 = payload.find((p) => p.name === "fontSize")) == null ? void 0 : _d2.value;
|
|
9067
|
-
const bold = ((_e2 = payload.find((p) => p.name === "bold")) == null ? void 0 : _e2.value) === "true";
|
|
9068
|
-
const italic = ((_f2 = payload.find((p) => p.name === "italic")) == null ? void 0 : _f2.value) === "true";
|
|
9069
|
-
const color = (_g2 = payload.find((p) => p.name === "color")) == null ? void 0 : _g2.value;
|
|
9070
|
-
const fontFamily = (_h2 = payload.find((p) => p.name === "fontFamily")) == null ? void 0 : _h2.value;
|
|
9071
|
-
const type = "input";
|
|
9072
|
-
const formInput = {
|
|
9073
|
-
key,
|
|
9074
|
-
width,
|
|
9075
|
-
height,
|
|
9076
|
-
fontSize,
|
|
9077
|
-
bold,
|
|
9078
|
-
italic,
|
|
9079
|
-
color,
|
|
9080
|
-
fontFamily,
|
|
9081
|
-
type
|
|
9082
|
-
};
|
|
9083
|
-
const imageDataUrl = generateTextImage({
|
|
9084
|
-
text: key,
|
|
9085
|
-
width,
|
|
9086
|
-
height
|
|
9087
|
-
});
|
|
9088
|
-
const param = {
|
|
9089
|
-
"value": imageDataUrl,
|
|
9090
|
-
"type": ElementType.IMAGE,
|
|
9091
|
-
"formInput": formInput,
|
|
9092
|
-
"width": Number(width),
|
|
9093
|
-
"height": Number(height)
|
|
9094
|
-
};
|
|
9095
|
-
if (el == null ? void 0 : el.id) {
|
|
9096
|
-
const deleteOpt = {
|
|
9097
|
-
id: el.id,
|
|
9098
|
-
properties: param
|
|
9099
|
-
};
|
|
9100
|
-
console.log("deleteOpt12", deleteOpt);
|
|
9101
|
-
command.executeUpdateElementById(deleteOpt);
|
|
9102
|
-
return;
|
|
9103
|
-
}
|
|
9104
|
-
command.executeInsertElementList([
|
|
9105
|
-
param
|
|
9106
|
-
]);
|
|
9107
|
-
}
|
|
9108
|
-
});
|
|
9109
|
-
}
|
|
9110
|
-
function getWordRangeBySegmenter(host) {
|
|
9111
|
-
var _a;
|
|
9112
|
-
if (!Intl.Segmenter)
|
|
9113
|
-
return null;
|
|
9114
|
-
const draw = host.getDraw();
|
|
9115
|
-
const cursorPosition = draw.getPosition().getCursorPosition();
|
|
9116
|
-
if (!cursorPosition)
|
|
9117
|
-
return null;
|
|
9118
|
-
const rangeManager = draw.getRange();
|
|
9119
|
-
const paragraphInfo = rangeManager.getRangeParagraphInfo();
|
|
9120
|
-
if (!paragraphInfo)
|
|
9121
|
-
return null;
|
|
9122
|
-
const paragraphText = ((_a = paragraphInfo == null ? void 0 : paragraphInfo.elementList) == null ? void 0 : _a.map((e) => !e.type || e.type !== ElementType.CONTROL && TEXTLIKE_ELEMENT_TYPE.includes(e.type) ? e.value : ZERO).join("")) || "";
|
|
9123
|
-
if (!paragraphText)
|
|
9124
|
-
return null;
|
|
9125
|
-
const cursorStartIndex = cursorPosition.isFirstLetter || draw.getCursor().getHitLineStartIndex() ? cursorPosition.index + 1 : cursorPosition.index;
|
|
9126
|
-
const offset = paragraphInfo.startIndex;
|
|
9127
|
-
const segmenter = new Intl.Segmenter(void 0, { granularity: "word" });
|
|
9128
|
-
const segments = segmenter.segment(paragraphText);
|
|
9129
|
-
let startIndex = -1;
|
|
9130
|
-
let endIndex = -1;
|
|
9131
|
-
for (const { segment, index: index2, isWordLike } of segments) {
|
|
9132
|
-
const realSegmentStartIndex = index2 + offset;
|
|
9133
|
-
if (isWordLike && cursorStartIndex >= realSegmentStartIndex && cursorStartIndex < realSegmentStartIndex + segment.length) {
|
|
9134
|
-
startIndex = realSegmentStartIndex - 1;
|
|
9135
|
-
endIndex = startIndex + segment.length;
|
|
9136
|
-
break;
|
|
9137
|
-
}
|
|
9138
|
-
}
|
|
9139
|
-
return ~startIndex && ~endIndex ? { startIndex, endIndex } : null;
|
|
9140
|
-
}
|
|
9141
|
-
function getWordRangeByCursor(host) {
|
|
9142
|
-
const draw = host.getDraw();
|
|
9143
|
-
const cursorPosition = draw.getPosition().getCursorPosition();
|
|
9144
|
-
if (!cursorPosition)
|
|
9145
|
-
return null;
|
|
9146
|
-
const { value, index: index2 } = cursorPosition;
|
|
9147
|
-
const LETTER_REG = draw.getLetterReg();
|
|
9148
|
-
let upCount = 0;
|
|
9149
|
-
let downCount = 0;
|
|
9150
|
-
const isNumber2 = NUMBER_LIKE_REG.test(value);
|
|
9151
|
-
if (isNumber2 || LETTER_REG.test(value)) {
|
|
9152
|
-
const elementList = draw.getElementList();
|
|
9153
|
-
let upStartIndex = index2 - 1;
|
|
9154
|
-
while (upStartIndex > 0) {
|
|
9155
|
-
const value2 = elementList[upStartIndex].value;
|
|
9156
|
-
if (isNumber2 && NUMBER_LIKE_REG.test(value2) || !isNumber2 && LETTER_REG.test(value2)) {
|
|
9157
|
-
upCount++;
|
|
9158
|
-
upStartIndex--;
|
|
9159
|
-
} else {
|
|
9160
|
-
break;
|
|
9161
|
-
}
|
|
9162
|
-
}
|
|
9163
|
-
let downStartIndex = index2 + 1;
|
|
9164
|
-
while (downStartIndex < elementList.length) {
|
|
9165
|
-
const value2 = elementList[downStartIndex].value;
|
|
9166
|
-
if (isNumber2 && NUMBER_LIKE_REG.test(value2) || !isNumber2 && LETTER_REG.test(value2)) {
|
|
9167
|
-
downCount++;
|
|
9168
|
-
downStartIndex++;
|
|
9169
|
-
} else {
|
|
9170
|
-
break;
|
|
9171
|
-
}
|
|
9172
|
-
}
|
|
9173
|
-
}
|
|
9174
|
-
const startIndex = index2 - upCount - 1;
|
|
9175
|
-
if (startIndex < 0)
|
|
9176
|
-
return null;
|
|
9177
|
-
return {
|
|
9178
|
-
startIndex,
|
|
9179
|
-
endIndex: index2 + downCount
|
|
9180
|
-
};
|
|
9181
|
-
}
|
|
9182
|
-
function dblclick(host, evt) {
|
|
9183
|
-
const draw = host.getDraw();
|
|
9184
|
-
const position = draw.getPosition();
|
|
9185
|
-
const positionContext = position.getPositionByXY({
|
|
9186
|
-
x: evt.offsetX,
|
|
9187
|
-
y: evt.offsetY
|
|
9188
|
-
});
|
|
9189
|
-
if (positionContext.isImage && positionContext.isDirectHit) {
|
|
9190
|
-
const elementList = draw.getElementList();
|
|
9191
|
-
const eventBus = draw.getEventBus();
|
|
9192
|
-
const curElement = elementList[positionContext.index];
|
|
9193
|
-
if (eventBus.isSubscribe("imageDblclick")) {
|
|
9194
|
-
eventBus.emit("imageDblclick", {
|
|
9195
|
-
evt,
|
|
9196
|
-
element: curElement
|
|
9197
|
-
});
|
|
9198
|
-
}
|
|
9199
|
-
if (curElement.formInput) {
|
|
9200
|
-
const editor = Reflect.get(window, "editor");
|
|
9201
|
-
console.log("curElement", curElement);
|
|
9202
|
-
if (curElement.formInput && curElement.formInput.type === "checkbox") {
|
|
9203
|
-
formCheckboxPropertiesConfigDialog(curElement, editor.command);
|
|
9204
|
-
return;
|
|
9205
|
-
}
|
|
9206
|
-
if (curElement.formInput && curElement.formInput.type === "radio") {
|
|
9207
|
-
formRadioPropertiesConfigDialog(curElement, editor.command);
|
|
9208
|
-
return;
|
|
9209
|
-
}
|
|
9210
|
-
formInputPropertiesConfigDialog(curElement, editor.command);
|
|
9211
|
-
return;
|
|
9212
|
-
}
|
|
9213
|
-
if (curElement.imgPreviewDisabled)
|
|
9214
|
-
return;
|
|
9215
|
-
draw.getPreviewer().render();
|
|
9216
|
-
return;
|
|
9217
|
-
}
|
|
9218
|
-
if (draw.getIsPagingMode()) {
|
|
9219
|
-
if (!~positionContext.index && positionContext.zone) {
|
|
9220
|
-
draw.getZone().setZone(positionContext.zone);
|
|
9221
|
-
draw.clearSideEffect();
|
|
9222
|
-
position.setPositionContext({
|
|
9223
|
-
isTable: false
|
|
9224
|
-
});
|
|
9225
|
-
return;
|
|
9226
|
-
}
|
|
9227
|
-
}
|
|
9228
|
-
if ((positionContext.isCheckbox || positionContext.isRadio) && positionContext.isDirectHit) {
|
|
9229
|
-
return;
|
|
9230
|
-
}
|
|
9231
|
-
const rangeManager = draw.getRange();
|
|
9232
|
-
const segmenterRange = getWordRangeBySegmenter(host) || getWordRangeByCursor(host);
|
|
9233
|
-
if (!segmenterRange)
|
|
9234
|
-
return;
|
|
9235
|
-
rangeManager.setRange(segmenterRange.startIndex, segmenterRange.endIndex);
|
|
9236
|
-
draw.render({
|
|
9237
|
-
isSubmitHistory: false,
|
|
9238
|
-
isSetCursor: false,
|
|
9239
|
-
isCompute: false
|
|
9240
|
-
});
|
|
9241
|
-
rangeManager.setRangeStyle();
|
|
9242
|
-
}
|
|
9243
|
-
function threeClick(host) {
|
|
9244
|
-
var _a, _b;
|
|
9245
|
-
const draw = host.getDraw();
|
|
9246
|
-
const control = draw.getControl();
|
|
9247
|
-
if (control.getActiveControl() && control.selectValue())
|
|
9248
|
-
return;
|
|
9249
|
-
const position = draw.getPosition();
|
|
9250
|
-
const cursorPosition = position.getCursorPosition();
|
|
9251
|
-
if (!cursorPosition)
|
|
9252
|
-
return;
|
|
9253
|
-
const { index: index2 } = cursorPosition;
|
|
9254
|
-
const elementList = draw.getElementList();
|
|
9255
|
-
let upCount = 0;
|
|
9256
|
-
let downCount = 0;
|
|
9257
|
-
let upStartIndex = index2 - 1;
|
|
9258
|
-
while (upStartIndex > 0) {
|
|
9259
|
-
const element = elementList[upStartIndex];
|
|
9260
|
-
const preElement = elementList[upStartIndex - 1];
|
|
9261
|
-
if (element.value === ZERO && !element.listWrap || element.listId !== (preElement == null ? void 0 : preElement.listId) || element.titleId !== (preElement == null ? void 0 : preElement.titleId)) {
|
|
9262
|
-
break;
|
|
9263
|
-
}
|
|
9264
|
-
upCount++;
|
|
9265
|
-
upStartIndex--;
|
|
9266
|
-
}
|
|
9267
|
-
let downStartIndex = index2 + 1;
|
|
9268
|
-
while (downStartIndex < elementList.length) {
|
|
9269
|
-
const element = elementList[downStartIndex];
|
|
9270
|
-
const nextElement = elementList[downStartIndex + 1];
|
|
9271
|
-
if (element.value === ZERO && !element.listWrap || element.listId !== (nextElement == null ? void 0 : nextElement.listId) || element.titleId !== (nextElement == null ? void 0 : nextElement.titleId)) {
|
|
9272
|
-
break;
|
|
9273
|
-
}
|
|
9274
|
-
downCount++;
|
|
9275
|
-
downStartIndex++;
|
|
9276
|
-
}
|
|
9277
|
-
const rangeManager = draw.getRange();
|
|
9278
|
-
let newStartIndex = index2 - upCount - 1;
|
|
9279
|
-
if (((_a = elementList[newStartIndex]) == null ? void 0 : _a.value) !== ZERO) {
|
|
9280
|
-
newStartIndex -= 1;
|
|
9281
|
-
}
|
|
9282
|
-
if (newStartIndex < 0)
|
|
9283
|
-
return;
|
|
9284
|
-
let newEndIndex = index2 + downCount + 1;
|
|
9285
|
-
if (((_b = elementList[newEndIndex]) == null ? void 0 : _b.value) === ZERO || newEndIndex > elementList.length - 1) {
|
|
9286
|
-
newEndIndex -= 1;
|
|
9287
|
-
}
|
|
9288
|
-
rangeManager.setRange(newStartIndex, newEndIndex);
|
|
9289
|
-
draw.render({
|
|
9290
|
-
isSubmitHistory: false,
|
|
9291
|
-
isSetCursor: false,
|
|
9292
|
-
isCompute: false
|
|
9293
|
-
});
|
|
9294
|
-
}
|
|
9295
|
-
var click = {
|
|
9296
|
-
dblclick,
|
|
9297
|
-
threeClick
|
|
9298
|
-
};
|
|
9299
|
-
function compositionstart(host) {
|
|
9300
|
-
host.isComposing = true;
|
|
9301
|
-
}
|
|
9302
|
-
function compositionend(host, evt) {
|
|
9303
|
-
host.isComposing = false;
|
|
9304
|
-
const draw = host.getDraw();
|
|
9305
|
-
if (!evt.data) {
|
|
9306
|
-
removeComposingInput(host);
|
|
9307
|
-
const rangeManager = draw.getRange();
|
|
9308
|
-
const { endIndex: curIndex } = rangeManager.getRange();
|
|
9309
|
-
draw.render({
|
|
9310
|
-
curIndex,
|
|
9311
|
-
isSubmitHistory: false
|
|
8529
|
+
var click = {
|
|
8530
|
+
dblclick,
|
|
8531
|
+
threeClick
|
|
8532
|
+
};
|
|
8533
|
+
function compositionstart(host) {
|
|
8534
|
+
host.isComposing = true;
|
|
8535
|
+
}
|
|
8536
|
+
function compositionend(host, evt) {
|
|
8537
|
+
host.isComposing = false;
|
|
8538
|
+
const draw = host.getDraw();
|
|
8539
|
+
if (!evt.data) {
|
|
8540
|
+
removeComposingInput(host);
|
|
8541
|
+
const rangeManager = draw.getRange();
|
|
8542
|
+
const { endIndex: curIndex } = rangeManager.getRange();
|
|
8543
|
+
draw.render({
|
|
8544
|
+
curIndex,
|
|
8545
|
+
isSubmitHistory: false
|
|
9312
8546
|
});
|
|
9313
8547
|
} else {
|
|
9314
8548
|
if (isFirefox) {
|
|
@@ -16073,257 +15307,1023 @@ class Control {
|
|
|
16073
15307
|
row.width += left2 - controlFirstElementLeft;
|
|
16074
15308
|
}
|
|
16075
15309
|
}
|
|
16076
|
-
}
|
|
16077
|
-
class CheckboxParticle {
|
|
16078
|
-
constructor(draw) {
|
|
16079
|
-
this.draw = draw;
|
|
16080
|
-
this.options = draw.getOptions();
|
|
15310
|
+
}
|
|
15311
|
+
class CheckboxParticle {
|
|
15312
|
+
constructor(draw) {
|
|
15313
|
+
this.draw = draw;
|
|
15314
|
+
this.options = draw.getOptions();
|
|
15315
|
+
}
|
|
15316
|
+
setSelect(element) {
|
|
15317
|
+
const { checkbox } = element;
|
|
15318
|
+
if (checkbox) {
|
|
15319
|
+
checkbox.value = !checkbox.value;
|
|
15320
|
+
} else {
|
|
15321
|
+
element.checkbox = {
|
|
15322
|
+
value: true
|
|
15323
|
+
};
|
|
15324
|
+
}
|
|
15325
|
+
this.draw.render({
|
|
15326
|
+
isCompute: false,
|
|
15327
|
+
isSetCursor: false
|
|
15328
|
+
});
|
|
15329
|
+
}
|
|
15330
|
+
render(payload) {
|
|
15331
|
+
const { ctx, x, index: index2, row } = payload;
|
|
15332
|
+
let { y } = payload;
|
|
15333
|
+
const { checkbox: { gap, lineWidth, fillStyle, strokeStyle, verticalAlign }, scale } = this.options;
|
|
15334
|
+
const { metrics, checkbox } = row.elementList[index2];
|
|
15335
|
+
if (verticalAlign === VerticalAlign.TOP || verticalAlign === VerticalAlign.MIDDLE) {
|
|
15336
|
+
let nextIndex = index2 + 1;
|
|
15337
|
+
let nextElement = null;
|
|
15338
|
+
while (nextIndex < row.elementList.length) {
|
|
15339
|
+
nextElement = row.elementList[nextIndex];
|
|
15340
|
+
if (nextElement.value !== ZERO && nextElement.value !== NBSP)
|
|
15341
|
+
break;
|
|
15342
|
+
nextIndex++;
|
|
15343
|
+
}
|
|
15344
|
+
if (nextElement) {
|
|
15345
|
+
const { metrics: { boundingBoxAscent, boundingBoxDescent } } = nextElement;
|
|
15346
|
+
const textHeight = boundingBoxAscent + boundingBoxDescent;
|
|
15347
|
+
if (textHeight > metrics.height) {
|
|
15348
|
+
if (verticalAlign === VerticalAlign.TOP) {
|
|
15349
|
+
y -= boundingBoxAscent - metrics.height;
|
|
15350
|
+
} else if (verticalAlign === VerticalAlign.MIDDLE) {
|
|
15351
|
+
y -= (textHeight - metrics.height) / 2;
|
|
15352
|
+
}
|
|
15353
|
+
}
|
|
15354
|
+
}
|
|
15355
|
+
}
|
|
15356
|
+
const left2 = Math.round(x + gap * scale);
|
|
15357
|
+
const top = Math.round(y - metrics.height + lineWidth);
|
|
15358
|
+
const width = metrics.width - gap * 2 * scale;
|
|
15359
|
+
const height = metrics.height;
|
|
15360
|
+
ctx.save();
|
|
15361
|
+
ctx.beginPath();
|
|
15362
|
+
ctx.translate(0.5, 0.5);
|
|
15363
|
+
if (checkbox == null ? void 0 : checkbox.value) {
|
|
15364
|
+
ctx.lineWidth = lineWidth;
|
|
15365
|
+
ctx.strokeStyle = "red";
|
|
15366
|
+
ctx.rect(left2, top, width, height);
|
|
15367
|
+
ctx.stroke();
|
|
15368
|
+
ctx.beginPath();
|
|
15369
|
+
ctx.fillStyle = fillStyle;
|
|
15370
|
+
ctx.fillRect(left2, top, width, height);
|
|
15371
|
+
ctx.beginPath();
|
|
15372
|
+
ctx.strokeStyle = strokeStyle;
|
|
15373
|
+
ctx.lineWidth = lineWidth * 2 * scale;
|
|
15374
|
+
ctx.moveTo(left2 + 2 * scale, top + height / 2);
|
|
15375
|
+
ctx.lineTo(left2 + width / 2, top + height - 3 * scale);
|
|
15376
|
+
ctx.lineTo(left2 + width - 2 * scale, top + 3 * scale);
|
|
15377
|
+
ctx.stroke();
|
|
15378
|
+
} else {
|
|
15379
|
+
ctx.lineWidth = lineWidth;
|
|
15380
|
+
ctx.strokeStyle = "red";
|
|
15381
|
+
ctx.rect(left2, top, width, height);
|
|
15382
|
+
ctx.stroke();
|
|
15383
|
+
}
|
|
15384
|
+
debugger;
|
|
15385
|
+
ctx.closePath();
|
|
15386
|
+
ctx.restore();
|
|
15387
|
+
}
|
|
15388
|
+
}
|
|
15389
|
+
class RadioParticle {
|
|
15390
|
+
constructor(draw) {
|
|
15391
|
+
this.draw = draw;
|
|
15392
|
+
this.options = draw.getOptions();
|
|
15393
|
+
}
|
|
15394
|
+
setSelect(element) {
|
|
15395
|
+
const { radio } = element;
|
|
15396
|
+
if (radio) {
|
|
15397
|
+
radio.value = !radio.value;
|
|
15398
|
+
} else {
|
|
15399
|
+
element.radio = {
|
|
15400
|
+
value: true
|
|
15401
|
+
};
|
|
15402
|
+
}
|
|
15403
|
+
this.draw.render({
|
|
15404
|
+
isCompute: false,
|
|
15405
|
+
isSetCursor: false
|
|
15406
|
+
});
|
|
15407
|
+
}
|
|
15408
|
+
render(payload) {
|
|
15409
|
+
const { ctx, x, index: index2, row } = payload;
|
|
15410
|
+
let { y } = payload;
|
|
15411
|
+
const { radio: { gap, lineWidth, fillStyle, strokeStyle, verticalAlign }, scale } = this.options;
|
|
15412
|
+
const { metrics, radio } = row.elementList[index2];
|
|
15413
|
+
if (verticalAlign === VerticalAlign.TOP || verticalAlign === VerticalAlign.MIDDLE) {
|
|
15414
|
+
let nextIndex = index2 + 1;
|
|
15415
|
+
let nextElement = null;
|
|
15416
|
+
while (nextIndex < row.elementList.length) {
|
|
15417
|
+
nextElement = row.elementList[nextIndex];
|
|
15418
|
+
if (nextElement.value !== ZERO && nextElement.value !== NBSP)
|
|
15419
|
+
break;
|
|
15420
|
+
nextIndex++;
|
|
15421
|
+
}
|
|
15422
|
+
if (nextElement) {
|
|
15423
|
+
const { metrics: { boundingBoxAscent, boundingBoxDescent } } = nextElement;
|
|
15424
|
+
const textHeight = boundingBoxAscent + boundingBoxDescent;
|
|
15425
|
+
if (textHeight > metrics.height) {
|
|
15426
|
+
if (verticalAlign === VerticalAlign.TOP) {
|
|
15427
|
+
y -= boundingBoxAscent - metrics.height;
|
|
15428
|
+
} else if (verticalAlign === VerticalAlign.MIDDLE) {
|
|
15429
|
+
y -= (textHeight - metrics.height) / 2;
|
|
15430
|
+
}
|
|
15431
|
+
}
|
|
15432
|
+
}
|
|
15433
|
+
}
|
|
15434
|
+
const left2 = Math.round(x + gap * scale);
|
|
15435
|
+
const top = Math.round(y - metrics.height + lineWidth);
|
|
15436
|
+
const width = metrics.width - gap * 2 * scale;
|
|
15437
|
+
const height = metrics.height;
|
|
15438
|
+
ctx.save();
|
|
15439
|
+
ctx.beginPath();
|
|
15440
|
+
ctx.translate(0.5, 0.5);
|
|
15441
|
+
ctx.strokeStyle = (radio == null ? void 0 : radio.value) ? fillStyle : strokeStyle;
|
|
15442
|
+
ctx.lineWidth = lineWidth;
|
|
15443
|
+
ctx.arc(left2 + width / 2, top + height / 2, width / 2, 0, Math.PI * 2);
|
|
15444
|
+
ctx.stroke();
|
|
15445
|
+
if (radio == null ? void 0 : radio.value) {
|
|
15446
|
+
ctx.beginPath();
|
|
15447
|
+
ctx.fillStyle = fillStyle;
|
|
15448
|
+
ctx.arc(left2 + width / 2, top + height / 2, width / 3, 0, Math.PI * 2);
|
|
15449
|
+
ctx.fill();
|
|
15450
|
+
}
|
|
15451
|
+
ctx.closePath();
|
|
15452
|
+
ctx.restore();
|
|
15453
|
+
}
|
|
15454
|
+
}
|
|
15455
|
+
const encodedJs$3 = "KGZ1bmN0aW9uKCl7InVzZSBzdHJpY3QiO2NvbnN0IHA9Ilx1MjAwQiIsdT1gCmA7ZnVuY3Rpb24gYShpKXt2YXIgYyxmO2xldCBsPSIiLG49MDtmb3IoO248aS5sZW5ndGg7KXtjb25zdCB0PWlbbl07aWYodC50eXBlPT09InRhYmxlIil7aWYodC50ckxpc3QpZm9yKGxldCBzPTA7czx0LnR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2U9aT0+e2NvbnN0IGw9aS5kYXRhLGM9YShsKS5yZXBsYWNlKG5ldyBSZWdFeHAoYF4ke3B9YCksIiIpLnJlcGxhY2UobmV3IFJlZ0V4cChwLCJnIiksdSksZj1oKGMpO3Bvc3RNZXNzYWdlKGYubGVuZ3RoKX19KSgpOwo=";
|
|
15456
|
+
const blob$3 = typeof window !== "undefined" && window.Blob && new Blob([atob(encodedJs$3)], { type: "text/javascript;charset=utf-8" });
|
|
15457
|
+
function WorkerWrapper$3() {
|
|
15458
|
+
const objURL = blob$3 && (window.URL || window.webkitURL).createObjectURL(blob$3);
|
|
15459
|
+
try {
|
|
15460
|
+
return objURL ? new Worker(objURL, {}) : new Worker("data:application/javascript;base64," + encodedJs$3, { type: "module" });
|
|
15461
|
+
} finally {
|
|
15462
|
+
objURL && (window.URL || window.webkitURL).revokeObjectURL(objURL);
|
|
15463
|
+
}
|
|
15464
|
+
}
|
|
15465
|
+
const encodedJs$2 = "KGZ1bmN0aW9uKCl7InVzZSBzdHJpY3QiO2NvbnN0IGg9e2ZpcnN0OjEsc2Vjb25kOjIsdGhpcmQ6Myxmb3VydGg6NCxmaWZ0aDo1LHNpeHRoOjZ9LGI9WyJ0ZXh0IiwiaHlwZXJsaW5rIiwic3Vic2NyaXB0Iiwic3VwZXJzY3JpcHQiLCJjb250cm9sIiwiZGF0ZSIsImxhYmVsIl0sbT0iXHUyMDBCIjtmdW5jdGlvbiBJKGMpe3JldHVybiFjLnR5cGV8fGIuaW5jbHVkZXMoYy50eXBlKX1mdW5jdGlvbiBOKGMpe3ZhciBFO2NvbnN0e2VsZW1lbnRMaXN0OmcscG9zaXRpb25MaXN0OmR9PWMscD1bXTtsZXQgcj0wO2Zvcig7cjxnLmxlbmd0aDspe2NvbnN0IHQ9Z1tyXSxsPShlLG4scyk9Pntjb25zdCB1PWUudGl0bGVJZCxMPWUubGV2ZWwsaT17dHlwZToidGl0bGUiLHZhbHVlOiIiLGxldmVsOkwsdGl0bGVJZDp1LHBh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cihsZXQgdD0wO3Q8cC5sZW5ndGg7dCsrKXtjb25zdCBsPXBbdF0sZT12W3YubGVuZ3RoLTFdLG49aFtlPT1udWxsP3ZvaWQgMDplLmxldmVsXSxzPWhbbC5sZXZlbF07ZSYmcz5uP2YobCxlKTp2LnB1c2goe2lkOmwudGl0bGVJZCxuYW1lOmwudmFsdWUsbGV2ZWw6bC5sZXZlbCxwYWdlTm86bC5wYWdlTm8sc3ViQ2F0YWxvZzpbXX0pfXJldHVybiB2fW9ubWVzc2FnZT1jPT57Y29uc3QgZz1jLmRhdGEsZD1OKGcpO3Bvc3RNZXNzYWdlKGQpfX0pKCk7Cg==";
|
|
15466
|
+
const blob$2 = typeof window !== "undefined" && window.Blob && new Blob([atob(encodedJs$2)], { type: "text/javascript;charset=utf-8" });
|
|
15467
|
+
function WorkerWrapper$2() {
|
|
15468
|
+
const objURL = blob$2 && (window.URL || window.webkitURL).createObjectURL(blob$2);
|
|
15469
|
+
try {
|
|
15470
|
+
return objURL ? new Worker(objURL, {}) : new Worker("data:application/javascript;base64," + encodedJs$2, { type: "module" });
|
|
15471
|
+
} finally {
|
|
15472
|
+
objURL && (window.URL || window.webkitURL).revokeObjectURL(objURL);
|
|
15473
|
+
}
|
|
15474
|
+
}
|
|
15475
|
+
const encodedJs$1 = "KGZ1bmN0aW9uKCl7InVzZSBzdHJpY3QiO2Z1bmN0aW9uIHUoZSl7Y29uc3QgdD1bXTtmb3IoY29uc3QgcyBvZiBlKXtpZihzLnR5cGU9PT0idGFibGUiKXtjb25zdCBvPXMudHJMaXN0O2ZvcihsZXQgbj0wO248by5sZW5ndGg7bisrKXtjb25zdCBjPW9bbl07Zm9yKGxldCByPTA7cjxjLnRkTGlzdC5sZW5ndGg7cisrKXtjb25zdCBpPWMudGRMaXN0W3JdO3QucHVzaCguLi51KGkudmFsdWUpKX19fWlmKCEhcy5ncm91cElkcylmb3IoY29uc3QgbyBvZiBzLmdyb3VwSWRzKXQuaW5jbHVkZXMobyl8fHQucHVzaChvKX1yZXR1cm4gdH1vbm1lc3NhZ2U9ZT0+e2NvbnN0IHQ9ZS5kYXRhLHM9dSh0KTtwb3N0TWVzc2FnZShzKX19KSgpOwo=";
|
|
15476
|
+
const blob$1 = typeof window !== "undefined" && window.Blob && new Blob([atob(encodedJs$1)], { type: "text/javascript;charset=utf-8" });
|
|
15477
|
+
function WorkerWrapper$1() {
|
|
15478
|
+
const objURL = blob$1 && (window.URL || window.webkitURL).createObjectURL(blob$1);
|
|
15479
|
+
try {
|
|
15480
|
+
return objURL ? new Worker(objURL, {}) : new Worker("data:application/javascript;base64," + encodedJs$1, { type: "module" });
|
|
15481
|
+
} finally {
|
|
15482
|
+
objURL && (window.URL || window.webkitURL).revokeObjectURL(objURL);
|
|
15483
|
+
}
|
|
15484
|
+
}
|
|
15485
|
+
const encodedJs = "KGZ1bmN0aW9uKCl7InVzZSBzdHJpY3QiO3ZhciBSPShlPT4oZS5IQUxGPSJoYWxmIixlLk9ORV9USElSRD0ib25lLXRoaXJkIixlLlFVQVJURVI9InF1YXJ0ZXIiLGUpKShSfHx7fSksZz0oZT0+KGUuQVJBQklDPSJhcmFiaWMiLGUuQ0hJTkVTRT0iY2hpbmVzZSIsZSkpKGd8fHt9KTtjb25zdCB2PSJcdTIwMEIiO1IuSEFMRisiIiwxLzIsUi5PTkVfVEhJUkQrIiIsMS8zLFIuUVVBUlRFUisiIiwxLzQ7ZnVuY3Rpb24gUyhlKXtpZih0eXBlb2Ygc3RydWN0dXJlZENsb25lPT0iZnVuY3Rpb24iKXJldHVybiBzdHJ1Y3R1cmVkQ2xvbmUoZSk7aWYoIWV8fHR5cGVvZiBlIT0ib2JqZWN0IilyZXR1cm4gZTtsZXQgbj17fTtyZXR1cm4gQXJyYXkuaXNBcnJheShlKT9uPWUubWFwKHU9PlModSkpOk9iamVjdC5rZXlzKGUpLmZvckVhY2godT0+e25bdV09UyhlW3VdKX0pLG59ZnVuY3Rpb24geShlLG4pe2NvbnN0IHU9e307Zm9yKGN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bnRyb2wudmFsdWU9VChkLG4pLHQ9SChMLHtleHRyYVBpY2tBdHRyczp1fSksaSs9cy1pLTF9fWlmKHQuY29udHJvbENvbXBvbmVudCYmKGRlbGV0ZSB0LmNvbnRyb2wsZGVsZXRlIHQuY29udHJvbElkLHQuY29udHJvbENvbXBvbmVudCE9PUEuVkFMVUUmJnQuY29udHJvbENvbXBvbmVudCE9PUEuUFJFX1RFWFQmJnQuY29udHJvbENvbXBvbmVudCE9PUEuUE9TVF9URVhUKSl7aSsrO2NvbnRpbnVlfX1jb25zdCBGPUgodCx7ZXh0cmFQaWNrQXR0cnM6dX0pO2lmKCF0LnR5cGV8fHQudHlwZT09PWEuVEVYVHx8dC50eXBlPT09YS5TVUJTQ1JJUFR8fHQudHlwZT09PWEuU1VQRVJTQ1JJUFQpZm9yKDtpPGwubGVuZ3RoOyl7Y29uc3Qgcj1sW2krMV07aWYoaSsrLHImJk0oRixIKHIse2V4dHJhUGlja0F0dHJzOnV9KSkpe2NvbnN0IGQ9ci52YWx1ZT09PXY/YApgOnIudmFsdWU7Ri52YWx1ZSs9ZH1lbHNlIGJyZWFrfWVsc2UgaSsrO0MucHVzaChGKX1yZXR1cm4gQ31vbm1lc3NhZ2U9ZT0+e2NvbnN0IG49ZS5kYXRhLHtvcHRpb25zOnUsZGF0YTpmfT1uLHtleHRyYVBpY2tBdHRyczpJPVtdfT11fHx7fSxsPXtoZWFkZXI6VChmLmhlYWRlcix7ZXh0cmFQaWNrQXR0cnM6SSxpc0Nsb25lOiExfSksbWFpbjpUKGYubWFpbix7ZXh0cmFQaWNrQXR0cnM6SSxpc0NsYXNzaWZ5QXJlYTohMCxpc0Nsb25lOiExfSksZm9vdGVyOlQoZi5mb290ZXIse2V4dHJhUGlja0F0dHJzOkksaXNDbG9uZTohMX0pfTtwb3N0TWVzc2FnZShsKX19KSgpOwo=";
|
|
15486
|
+
const blob = typeof window !== "undefined" && window.Blob && new Blob([atob(encodedJs)], { type: "text/javascript;charset=utf-8" });
|
|
15487
|
+
function WorkerWrapper() {
|
|
15488
|
+
const objURL = blob && (window.URL || window.webkitURL).createObjectURL(blob);
|
|
15489
|
+
try {
|
|
15490
|
+
return objURL ? new Worker(objURL, {}) : new Worker("data:application/javascript;base64," + encodedJs, { type: "module" });
|
|
15491
|
+
} finally {
|
|
15492
|
+
objURL && (window.URL || window.webkitURL).revokeObjectURL(objURL);
|
|
15493
|
+
}
|
|
15494
|
+
}
|
|
15495
|
+
class WorkerManager {
|
|
15496
|
+
constructor(draw) {
|
|
15497
|
+
this.draw = draw;
|
|
15498
|
+
this.wordCountWorker = new WorkerWrapper$3();
|
|
15499
|
+
this.catalogWorker = new WorkerWrapper$2();
|
|
15500
|
+
this.groupWorker = new WorkerWrapper$1();
|
|
15501
|
+
this.valueWorker = new WorkerWrapper();
|
|
15502
|
+
}
|
|
15503
|
+
getWordCount() {
|
|
15504
|
+
return new Promise((resolve, reject) => {
|
|
15505
|
+
this.wordCountWorker.onmessage = (evt) => {
|
|
15506
|
+
resolve(evt.data);
|
|
15507
|
+
};
|
|
15508
|
+
this.wordCountWorker.onerror = (evt) => {
|
|
15509
|
+
reject(evt);
|
|
15510
|
+
};
|
|
15511
|
+
const elementList = this.draw.getOriginalMainElementList();
|
|
15512
|
+
this.wordCountWorker.postMessage(elementList);
|
|
15513
|
+
});
|
|
16081
15514
|
}
|
|
16082
|
-
|
|
16083
|
-
|
|
16084
|
-
|
|
16085
|
-
|
|
16086
|
-
} else {
|
|
16087
|
-
element.checkbox = {
|
|
16088
|
-
value: true
|
|
15515
|
+
getCatalog() {
|
|
15516
|
+
return new Promise((resolve, reject) => {
|
|
15517
|
+
this.catalogWorker.onmessage = (evt) => {
|
|
15518
|
+
resolve(evt.data);
|
|
16089
15519
|
};
|
|
16090
|
-
|
|
16091
|
-
|
|
16092
|
-
|
|
16093
|
-
|
|
15520
|
+
this.catalogWorker.onerror = (evt) => {
|
|
15521
|
+
reject(evt);
|
|
15522
|
+
};
|
|
15523
|
+
const elementList = this.draw.getOriginalMainElementList();
|
|
15524
|
+
const positionList = this.draw.getPosition().getOriginalMainPositionList();
|
|
15525
|
+
this.catalogWorker.postMessage({
|
|
15526
|
+
elementList,
|
|
15527
|
+
positionList
|
|
15528
|
+
});
|
|
16094
15529
|
});
|
|
16095
15530
|
}
|
|
16096
|
-
|
|
16097
|
-
|
|
16098
|
-
|
|
16099
|
-
|
|
16100
|
-
|
|
16101
|
-
|
|
16102
|
-
|
|
16103
|
-
|
|
16104
|
-
|
|
16105
|
-
|
|
16106
|
-
|
|
16107
|
-
|
|
16108
|
-
|
|
15531
|
+
getGroupIds() {
|
|
15532
|
+
return new Promise((resolve, reject) => {
|
|
15533
|
+
this.groupWorker.onmessage = (evt) => {
|
|
15534
|
+
resolve(evt.data);
|
|
15535
|
+
};
|
|
15536
|
+
this.groupWorker.onerror = (evt) => {
|
|
15537
|
+
reject(evt);
|
|
15538
|
+
};
|
|
15539
|
+
const elementList = this.draw.getOriginalMainElementList();
|
|
15540
|
+
this.groupWorker.postMessage(elementList);
|
|
15541
|
+
});
|
|
15542
|
+
}
|
|
15543
|
+
getValue(options) {
|
|
15544
|
+
return new Promise((resolve, reject) => {
|
|
15545
|
+
this.valueWorker.onmessage = (evt) => {
|
|
15546
|
+
resolve({
|
|
15547
|
+
version,
|
|
15548
|
+
data: evt.data,
|
|
15549
|
+
options: deepClone(this.draw.getOptions())
|
|
15550
|
+
});
|
|
15551
|
+
};
|
|
15552
|
+
this.valueWorker.onerror = (evt) => {
|
|
15553
|
+
reject(evt);
|
|
15554
|
+
};
|
|
15555
|
+
this.valueWorker.postMessage({
|
|
15556
|
+
data: this.draw.getOriginValue(options),
|
|
15557
|
+
options
|
|
15558
|
+
});
|
|
15559
|
+
});
|
|
15560
|
+
}
|
|
15561
|
+
}
|
|
15562
|
+
var dialog = "";
|
|
15563
|
+
class Dialog {
|
|
15564
|
+
constructor(options) {
|
|
15565
|
+
this.options = options;
|
|
15566
|
+
this.mask = null;
|
|
15567
|
+
this.container = null;
|
|
15568
|
+
this.inputList = [];
|
|
15569
|
+
this._render();
|
|
15570
|
+
}
|
|
15571
|
+
_render() {
|
|
15572
|
+
var _a;
|
|
15573
|
+
const { title, data: data2, onClose, onCancel, onConfirm } = this.options;
|
|
15574
|
+
const mask = document.createElement("div");
|
|
15575
|
+
mask.classList.add("dialog-mask");
|
|
15576
|
+
mask.setAttribute(EDITOR_COMPONENT, EditorComponent.COMPONENT);
|
|
15577
|
+
document.body.append(mask);
|
|
15578
|
+
const container = document.createElement("div");
|
|
15579
|
+
container.classList.add("dialog-container");
|
|
15580
|
+
container.setAttribute(EDITOR_COMPONENT, EditorComponent.COMPONENT);
|
|
15581
|
+
const dialogContainer = document.createElement("div");
|
|
15582
|
+
dialogContainer.classList.add("dialog");
|
|
15583
|
+
container.append(dialogContainer);
|
|
15584
|
+
const titleContainer = document.createElement("div");
|
|
15585
|
+
titleContainer.classList.add("dialog-title");
|
|
15586
|
+
const titleSpan = document.createElement("span");
|
|
15587
|
+
titleSpan.append(document.createTextNode(title));
|
|
15588
|
+
const titleClose = document.createElement("i");
|
|
15589
|
+
titleClose.onclick = () => {
|
|
15590
|
+
if (onClose) {
|
|
15591
|
+
onClose();
|
|
16109
15592
|
}
|
|
16110
|
-
|
|
16111
|
-
|
|
16112
|
-
|
|
16113
|
-
|
|
16114
|
-
|
|
16115
|
-
|
|
16116
|
-
|
|
16117
|
-
|
|
16118
|
-
|
|
15593
|
+
this._dispose();
|
|
15594
|
+
};
|
|
15595
|
+
titleContainer.append(titleSpan);
|
|
15596
|
+
titleContainer.append(titleClose);
|
|
15597
|
+
dialogContainer.append(titleContainer);
|
|
15598
|
+
const optionContainer = document.createElement("div");
|
|
15599
|
+
optionContainer.classList.add("dialog-option");
|
|
15600
|
+
for (let i = 0; i < data2.length; i++) {
|
|
15601
|
+
const option = data2[i];
|
|
15602
|
+
const optionItemContainer = document.createElement("div");
|
|
15603
|
+
optionItemContainer.classList.add("dialog-option__item");
|
|
15604
|
+
if (option.label) {
|
|
15605
|
+
const optionName = document.createElement("span");
|
|
15606
|
+
optionName.append(document.createTextNode(option.label));
|
|
15607
|
+
optionItemContainer.append(optionName);
|
|
15608
|
+
if (option.required) {
|
|
15609
|
+
optionName.classList.add("dialog-option__item--require");
|
|
16119
15610
|
}
|
|
16120
15611
|
}
|
|
15612
|
+
let optionInput;
|
|
15613
|
+
if (option.type === "select") {
|
|
15614
|
+
optionInput = document.createElement("select");
|
|
15615
|
+
(_a = option.options) == null ? void 0 : _a.forEach((item) => {
|
|
15616
|
+
const optionItem = document.createElement("option");
|
|
15617
|
+
optionItem.value = item.value;
|
|
15618
|
+
optionItem.label = item.label;
|
|
15619
|
+
optionInput.append(optionItem);
|
|
15620
|
+
});
|
|
15621
|
+
} else if (option.type === "textarea") {
|
|
15622
|
+
optionInput = document.createElement("textarea");
|
|
15623
|
+
} else if (option.type === "color") {
|
|
15624
|
+
optionInput = document.createElement("input");
|
|
15625
|
+
optionInput.type = "text";
|
|
15626
|
+
optionInput.onclick = function() {
|
|
15627
|
+
colorControlDom.click();
|
|
15628
|
+
};
|
|
15629
|
+
const colorControlDom = document.querySelector("#color");
|
|
15630
|
+
colorControlDom.oninput = function() {
|
|
15631
|
+
optionInput.value = colorControlDom.value;
|
|
15632
|
+
};
|
|
15633
|
+
} else {
|
|
15634
|
+
optionInput = document.createElement("input");
|
|
15635
|
+
optionInput.type = option.type;
|
|
15636
|
+
}
|
|
15637
|
+
if (option.width) {
|
|
15638
|
+
optionInput.style.width = `${option.width}px`;
|
|
15639
|
+
}
|
|
15640
|
+
if (option.height) {
|
|
15641
|
+
optionInput.style.height = `${option.height}px`;
|
|
15642
|
+
}
|
|
15643
|
+
optionInput.name = option.name;
|
|
15644
|
+
optionInput.value = option.value || "";
|
|
15645
|
+
if (!(optionInput instanceof HTMLSelectElement)) {
|
|
15646
|
+
optionInput.placeholder = option.placeholder || "";
|
|
15647
|
+
}
|
|
15648
|
+
optionItemContainer.append(optionInput);
|
|
15649
|
+
optionContainer.append(optionItemContainer);
|
|
15650
|
+
this.inputList.push(optionInput);
|
|
16121
15651
|
}
|
|
16122
|
-
|
|
16123
|
-
const
|
|
16124
|
-
|
|
16125
|
-
const
|
|
16126
|
-
|
|
16127
|
-
|
|
16128
|
-
|
|
16129
|
-
|
|
16130
|
-
|
|
16131
|
-
|
|
16132
|
-
|
|
16133
|
-
|
|
16134
|
-
|
|
16135
|
-
|
|
16136
|
-
|
|
16137
|
-
|
|
16138
|
-
|
|
16139
|
-
|
|
16140
|
-
|
|
16141
|
-
|
|
16142
|
-
|
|
16143
|
-
|
|
15652
|
+
dialogContainer.append(optionContainer);
|
|
15653
|
+
const menuContainer = document.createElement("div");
|
|
15654
|
+
menuContainer.classList.add("dialog-menu");
|
|
15655
|
+
const cancelBtn = document.createElement("button");
|
|
15656
|
+
cancelBtn.classList.add("dialog-menu__cancel");
|
|
15657
|
+
cancelBtn.append(document.createTextNode("\u53D6\u6D88"));
|
|
15658
|
+
cancelBtn.type = "button";
|
|
15659
|
+
cancelBtn.onclick = () => {
|
|
15660
|
+
if (onCancel) {
|
|
15661
|
+
onCancel();
|
|
15662
|
+
}
|
|
15663
|
+
this._dispose();
|
|
15664
|
+
};
|
|
15665
|
+
menuContainer.append(cancelBtn);
|
|
15666
|
+
const confirmBtn = document.createElement("button");
|
|
15667
|
+
confirmBtn.append(document.createTextNode("\u786E\u5B9A"));
|
|
15668
|
+
confirmBtn.type = "submit";
|
|
15669
|
+
confirmBtn.onclick = () => {
|
|
15670
|
+
if (onConfirm) {
|
|
15671
|
+
const payload = this.inputList.map((input2) => ({
|
|
15672
|
+
name: input2.name,
|
|
15673
|
+
value: input2.value
|
|
15674
|
+
}));
|
|
15675
|
+
onConfirm(payload);
|
|
15676
|
+
}
|
|
15677
|
+
this._dispose();
|
|
15678
|
+
};
|
|
15679
|
+
menuContainer.append(confirmBtn);
|
|
15680
|
+
dialogContainer.append(menuContainer);
|
|
15681
|
+
document.body.append(container);
|
|
15682
|
+
this.container = container;
|
|
15683
|
+
this.mask = mask;
|
|
15684
|
+
}
|
|
15685
|
+
_dispose() {
|
|
15686
|
+
var _a, _b;
|
|
15687
|
+
(_a = this.mask) == null ? void 0 : _a.remove();
|
|
15688
|
+
(_b = this.container) == null ? void 0 : _b.remove();
|
|
15689
|
+
}
|
|
15690
|
+
}
|
|
15691
|
+
function generateTextImage(options) {
|
|
15692
|
+
const config = {
|
|
15693
|
+
width: 400,
|
|
15694
|
+
height: 200,
|
|
15695
|
+
fontFamily: "Simsun",
|
|
15696
|
+
fontSize: 20,
|
|
15697
|
+
color: "#ffffff",
|
|
15698
|
+
bold: false,
|
|
15699
|
+
italic: false,
|
|
15700
|
+
borderWidth: 1,
|
|
15701
|
+
textBgColor: "#000000",
|
|
15702
|
+
borderColor: "#000000",
|
|
15703
|
+
text: "",
|
|
15704
|
+
...options
|
|
15705
|
+
};
|
|
15706
|
+
console.log("config", config);
|
|
15707
|
+
const canvas = document.createElement("canvas");
|
|
15708
|
+
const ctx = canvas.getContext("2d");
|
|
15709
|
+
canvas.width = config.width;
|
|
15710
|
+
canvas.height = config.height;
|
|
15711
|
+
ctx.clearRect(0, 0, canvas.width, canvas.height);
|
|
15712
|
+
ctx.fillStyle = "#ffffff";
|
|
15713
|
+
ctx.fillRect(0, 0, canvas.width, canvas.height);
|
|
15714
|
+
let fontStyle = "";
|
|
15715
|
+
if (config.bold)
|
|
15716
|
+
fontStyle += "bold ";
|
|
15717
|
+
if (config.italic)
|
|
15718
|
+
fontStyle += "italic ";
|
|
15719
|
+
let currentFontSize = config.fontSize;
|
|
15720
|
+
let textWidth, textHeight;
|
|
15721
|
+
do {
|
|
15722
|
+
const font = `${fontStyle}${currentFontSize}px ${config.fontFamily}`;
|
|
15723
|
+
ctx.font = font;
|
|
15724
|
+
const textMetrics2 = ctx.measureText(config.text);
|
|
15725
|
+
textWidth = textMetrics2.width;
|
|
15726
|
+
textHeight = textMetrics2.actualBoundingBoxAscent + textMetrics2.actualBoundingBoxDescent;
|
|
15727
|
+
if ((textWidth > config.width || textHeight > config.height) && currentFontSize > 1) {
|
|
15728
|
+
currentFontSize--;
|
|
16144
15729
|
} else {
|
|
16145
|
-
|
|
16146
|
-
ctx.strokeStyle = "red";
|
|
16147
|
-
ctx.rect(left2, top, width, height);
|
|
16148
|
-
ctx.stroke();
|
|
15730
|
+
break;
|
|
16149
15731
|
}
|
|
16150
|
-
|
|
16151
|
-
|
|
16152
|
-
|
|
16153
|
-
|
|
15732
|
+
} while (true);
|
|
15733
|
+
const finalFont = `${fontStyle}${currentFontSize}px ${config.fontFamily}`;
|
|
15734
|
+
ctx.font = finalFont;
|
|
15735
|
+
const textMetrics = ctx.measureText(config.text);
|
|
15736
|
+
textWidth = textMetrics.width;
|
|
15737
|
+
textHeight = textMetrics.actualBoundingBoxAscent + textMetrics.actualBoundingBoxDescent;
|
|
15738
|
+
const bgX = (config.width - textWidth) / 2 - 4;
|
|
15739
|
+
const bgY = (config.height - textHeight) / 2 - 4;
|
|
15740
|
+
ctx.fillStyle = config.textBgColor;
|
|
15741
|
+
ctx.fillRect(bgX, bgY, textWidth + 8, textHeight + 8);
|
|
15742
|
+
ctx.fillStyle = config.color;
|
|
15743
|
+
ctx.textAlign = "center";
|
|
15744
|
+
ctx.textBaseline = "middle";
|
|
15745
|
+
ctx.fillText(config.text, canvas.width / 2, canvas.height / 2);
|
|
15746
|
+
const offset = config.borderWidth;
|
|
15747
|
+
ctx.strokeStyle = config.borderColor;
|
|
15748
|
+
ctx.lineWidth = config.borderWidth;
|
|
15749
|
+
ctx.strokeRect(
|
|
15750
|
+
offset,
|
|
15751
|
+
offset,
|
|
15752
|
+
config.width - offset * 2,
|
|
15753
|
+
config.height - offset * 2
|
|
15754
|
+
);
|
|
15755
|
+
return canvas.toDataURL("image/png");
|
|
16154
15756
|
}
|
|
16155
|
-
|
|
16156
|
-
|
|
16157
|
-
|
|
16158
|
-
|
|
16159
|
-
|
|
16160
|
-
|
|
16161
|
-
|
|
16162
|
-
|
|
16163
|
-
|
|
16164
|
-
|
|
16165
|
-
|
|
16166
|
-
|
|
16167
|
-
|
|
16168
|
-
|
|
16169
|
-
|
|
16170
|
-
|
|
16171
|
-
|
|
16172
|
-
|
|
16173
|
-
|
|
16174
|
-
|
|
16175
|
-
|
|
16176
|
-
|
|
16177
|
-
|
|
16178
|
-
|
|
16179
|
-
|
|
16180
|
-
|
|
16181
|
-
|
|
16182
|
-
|
|
16183
|
-
|
|
16184
|
-
|
|
16185
|
-
|
|
16186
|
-
|
|
16187
|
-
|
|
16188
|
-
|
|
16189
|
-
|
|
16190
|
-
|
|
16191
|
-
|
|
16192
|
-
|
|
16193
|
-
|
|
16194
|
-
|
|
16195
|
-
y -= (textHeight - metrics.height) / 2;
|
|
16196
|
-
}
|
|
16197
|
-
}
|
|
16198
|
-
}
|
|
16199
|
-
}
|
|
16200
|
-
const left2 = Math.round(x + gap * scale);
|
|
16201
|
-
const top = Math.round(y - metrics.height + lineWidth);
|
|
16202
|
-
const width = metrics.width - gap * 2 * scale;
|
|
16203
|
-
const height = metrics.height;
|
|
16204
|
-
ctx.save();
|
|
15757
|
+
function generateCheckboxImage(options) {
|
|
15758
|
+
const config = {
|
|
15759
|
+
checked: false,
|
|
15760
|
+
width: 100,
|
|
15761
|
+
height: 40,
|
|
15762
|
+
label: "",
|
|
15763
|
+
fontSize: 14,
|
|
15764
|
+
fontFamily: "SimSun",
|
|
15765
|
+
color: "#000000",
|
|
15766
|
+
borderColor: "#000000",
|
|
15767
|
+
checkColor: "#5175f4",
|
|
15768
|
+
boxSize: 20,
|
|
15769
|
+
gap: 8,
|
|
15770
|
+
borderWidth: 1,
|
|
15771
|
+
...options
|
|
15772
|
+
};
|
|
15773
|
+
const canvas = document.createElement("canvas");
|
|
15774
|
+
const ctx = canvas.getContext("2d");
|
|
15775
|
+
canvas.width = config.width;
|
|
15776
|
+
canvas.height = config.height;
|
|
15777
|
+
ctx.clearRect(0, 0, canvas.width, canvas.height);
|
|
15778
|
+
ctx.fillStyle = "#ffffff";
|
|
15779
|
+
ctx.fillRect(0, 0, canvas.width, canvas.height);
|
|
15780
|
+
ctx.strokeStyle = config.borderColor;
|
|
15781
|
+
ctx.lineWidth = config.borderWidth;
|
|
15782
|
+
ctx.strokeRect(
|
|
15783
|
+
config.borderWidth / 2,
|
|
15784
|
+
config.borderWidth / 2,
|
|
15785
|
+
config.width - config.borderWidth,
|
|
15786
|
+
config.height - config.borderWidth
|
|
15787
|
+
);
|
|
15788
|
+
const centerY = config.height / 2;
|
|
15789
|
+
const boxLeft = config.gap + config.borderWidth;
|
|
15790
|
+
const boxTop = centerY - config.boxSize / 2;
|
|
15791
|
+
ctx.strokeStyle = config.borderColor;
|
|
15792
|
+
ctx.lineWidth = 1.5;
|
|
15793
|
+
ctx.strokeRect(boxLeft, boxTop, config.boxSize, config.boxSize);
|
|
15794
|
+
if (config.checked) {
|
|
15795
|
+
ctx.fillStyle = config.checkColor;
|
|
15796
|
+
ctx.fillRect(boxLeft + 2, boxTop + 2, config.boxSize - 4, config.boxSize - 4);
|
|
16205
15797
|
ctx.beginPath();
|
|
16206
|
-
ctx.
|
|
16207
|
-
ctx.
|
|
16208
|
-
ctx.
|
|
16209
|
-
ctx.
|
|
15798
|
+
ctx.strokeStyle = "#ffffff";
|
|
15799
|
+
ctx.lineWidth = 2;
|
|
15800
|
+
ctx.lineCap = "round";
|
|
15801
|
+
ctx.lineJoin = "round";
|
|
15802
|
+
const checkStartX = boxLeft + 5;
|
|
15803
|
+
const checkStartY = boxTop + config.boxSize / 2 + 2;
|
|
15804
|
+
const checkMiddleX = boxLeft + config.boxSize / 2 - 1;
|
|
15805
|
+
const checkMiddleY = boxTop + config.boxSize - 6;
|
|
15806
|
+
const checkEndX = boxLeft + config.boxSize - 4;
|
|
15807
|
+
const checkEndY = boxTop + 6;
|
|
15808
|
+
ctx.moveTo(checkStartX, checkStartY);
|
|
15809
|
+
ctx.lineTo(checkMiddleX, checkMiddleY);
|
|
15810
|
+
ctx.lineTo(checkEndX, checkEndY);
|
|
16210
15811
|
ctx.stroke();
|
|
16211
|
-
if (radio == null ? void 0 : radio.value) {
|
|
16212
|
-
ctx.beginPath();
|
|
16213
|
-
ctx.fillStyle = fillStyle;
|
|
16214
|
-
ctx.arc(left2 + width / 2, top + height / 2, width / 3, 0, Math.PI * 2);
|
|
16215
|
-
ctx.fill();
|
|
16216
|
-
}
|
|
16217
|
-
ctx.closePath();
|
|
16218
|
-
ctx.restore();
|
|
16219
|
-
}
|
|
16220
|
-
}
|
|
16221
|
-
const encodedJs$3 = "KGZ1bmN0aW9uKCl7InVzZSBzdHJpY3QiO2NvbnN0IHA9Ilx1MjAwQiIsdT1gCmA7ZnVuY3Rpb24gYShpKXt2YXIgYyxmO2xldCBsPSIiLG49MDtmb3IoO248aS5sZW5ndGg7KXtjb25zdCB0PWlbbl07aWYodC50eXBlPT09InRhYmxlIil7aWYodC50ckxpc3QpZm9yKGxldCBzPTA7czx0LnRyTGlzdC5sZW5ndGg7cysrKXtjb25zdCBvPXQudHJMaXN0W3NdO2ZvcihsZXQgZT0wO2U8by50ZExpc3QubGVuZ3RoO2UrKyl7Y29uc3Qgcj1vLnRkTGlzdFtlXTtsKz1hKHIudmFsdWUpfX19ZWxzZSBpZih0LnR5cGU9PT0iaHlwZXJsaW5rIil7Y29uc3Qgcz10Lmh5cGVybGlua0lkLG89W107Zm9yKDtuPGkubGVuZ3RoOyl7Y29uc3QgZT1pW25dO2lmKHMhPT1lLmh5cGVybGlua0lkKXtuLS07YnJlYWt9ZGVsZXRlIGUudHlwZSxvLnB1c2goZSksbisrfWwrPWEobyl9ZWxzZSBpZih0LmNvbnRyb2xJZCl7aWYoISgoYz10LmNvbnRyb2wpIT1udWxsJiZjLmhpZGUpKXtjb25zdCBzPXQuY29udHJvbElkLG89W107Zm9yKDtuPGkubGVuZ3RoOyl7Y29uc3QgZT1pW25dO2lmKHMhPT1lLmNvbnRyb2xJZCl7bi0tO2JyZWFrfWUuY29udHJvbENvbXBvbmVudD09PSJ2YWx1ZSImJihkZWxldGUgZS5jb250cm9sSWQsby5wdXNoKGUpKSxuKyt9bCs9YShvKX19ZWxzZSghdC50eXBlfHx0LnR5cGU9PT0idGV4dCIpJiYhKChmPXQuYXJlYSkhPW51bGwmJmYuaGlkZSkmJihsKz10LnZhbHVlKTtuKyt9cmV0dXJuIGx9ZnVuY3Rpb24gaChpKXtjb25zdCBsPVtdLG49L1swLTldLyxjPS9bQS1aYS16XS8sZj0vXHMvO2xldCB0PSExLHM9ITEsbz0iIjtmdW5jdGlvbiBlKCl7byYmKGwucHVzaChvKSxvPSIiKX1mb3IoY29uc3QgciBvZiBpKWMudGVzdChyKT8odHx8ZSgpLG8rPXIsdD0hMCxzPSExKTpuLnRlc3Qocik/KHN8fGUoKSxvKz1yLHQ9ITEscz0hMCk6KGUoKSx0PSExLHM9ITEsZi50ZXN0KHIpfHxsLnB1c2gocikpO3JldHVybiBlKCksbH1vbm1lc3NhZ2U9aT0+e2NvbnN0IGw9aS5kYXRhLGM9YShsKS5yZXBsYWNlKG5ldyBSZWdFeHAoYF4ke3B9YCksIiIpLnJlcGxhY2UobmV3IFJlZ0V4cChwLCJnIiksdSksZj1oKGMpO3Bvc3RNZXNzYWdlKGYubGVuZ3RoKX19KSgpOwo=";
|
|
16222
|
-
const blob$3 = typeof window !== "undefined" && window.Blob && new Blob([atob(encodedJs$3)], { type: "text/javascript;charset=utf-8" });
|
|
16223
|
-
function WorkerWrapper$3() {
|
|
16224
|
-
const objURL = blob$3 && (window.URL || window.webkitURL).createObjectURL(blob$3);
|
|
16225
|
-
try {
|
|
16226
|
-
return objURL ? new Worker(objURL, {}) : new Worker("data:application/javascript;base64," + encodedJs$3, { type: "module" });
|
|
16227
|
-
} finally {
|
|
16228
|
-
objURL && (window.URL || window.webkitURL).revokeObjectURL(objURL);
|
|
16229
|
-
}
|
|
16230
|
-
}
|
|
16231
|
-
const encodedJs$2 = "KGZ1bmN0aW9uKCl7InVzZSBzdHJpY3QiO2NvbnN0IGg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WYoaS5sZW5ndGg+MSl7bGV0IG89MTtmb3IoO288aS5sZW5ndGg7KXtpZigoRT1pW29dKSE9bnVsbCYmRS50aXRsZUlkKXtjb25zdHt0aXRsZUVsZW1lbnQ6YSxwb3NpdGlvbjp5fT1sKGlbb10saSxvKTtwLnB1c2goYSksbz15fW8rK319fX19cisrfWlmKCFwLmxlbmd0aClyZXR1cm4gbnVsbDtjb25zdCBmPSh0LGwpPT57Y29uc3QgZT1sLnN1YkNhdGFsb2dbbC5zdWJDYXRhbG9nLmxlbmd0aC0xXSxuPWhbZT09bnVsbD92b2lkIDA6ZS5sZXZlbF0scz1oW3QubGV2ZWxdO2UmJnM+bj9mKHQsZSk6bC5zdWJDYXRhbG9nLnB1c2goe2lkOnQudGl0bGVJZCxuYW1lOnQudmFsdWUsbGV2ZWw6dC5sZXZlbCxwYWdlTm86dC5wYWdlTm8sc3ViQ2F0YWxvZzpbXX0pfSx2PVtdO2ZvcihsZXQgdD0wO3Q8cC5sZW5ndGg7dCsrKXtjb25zdCBsPXBbdF0sZT12W3YubGVuZ3RoLTFdLG49aFtlPT1udWxsP3ZvaWQgMDplLmxldmVsXSxzPWhbbC5sZXZlbF07ZSYmcz5uP2YobCxlKTp2LnB1c2goe2lkOmwudGl0bGVJZCxuYW1lOmwudmFsdWUsbGV2ZWw6bC5sZXZlbCxwYWdlTm86bC5wYWdlTm8sc3ViQ2F0YWxvZzpbXX0pfXJldHVybiB2fW9ubWVzc2FnZT1jPT57Y29uc3QgZz1jLmRhdGEsZD1OKGcpO3Bvc3RNZXNzYWdlKGQpfX0pKCk7Cg==";
|
|
16232
|
-
const blob$2 = typeof window !== "undefined" && window.Blob && new Blob([atob(encodedJs$2)], { type: "text/javascript;charset=utf-8" });
|
|
16233
|
-
function WorkerWrapper$2() {
|
|
16234
|
-
const objURL = blob$2 && (window.URL || window.webkitURL).createObjectURL(blob$2);
|
|
16235
|
-
try {
|
|
16236
|
-
return objURL ? new Worker(objURL, {}) : new Worker("data:application/javascript;base64," + encodedJs$2, { type: "module" });
|
|
16237
|
-
} finally {
|
|
16238
|
-
objURL && (window.URL || window.webkitURL).revokeObjectURL(objURL);
|
|
16239
15812
|
}
|
|
16240
|
-
|
|
16241
|
-
|
|
16242
|
-
|
|
16243
|
-
|
|
16244
|
-
|
|
16245
|
-
|
|
16246
|
-
|
|
16247
|
-
} finally {
|
|
16248
|
-
objURL && (window.URL || window.webkitURL).revokeObjectURL(objURL);
|
|
15813
|
+
if (config.label) {
|
|
15814
|
+
ctx.font = `${config.fontSize}px ${config.fontFamily}`;
|
|
15815
|
+
ctx.fillStyle = config.color;
|
|
15816
|
+
ctx.textAlign = "left";
|
|
15817
|
+
ctx.textBaseline = "middle";
|
|
15818
|
+
const textX = boxLeft + config.boxSize + config.gap;
|
|
15819
|
+
ctx.fillText(config.label, textX, centerY);
|
|
16249
15820
|
}
|
|
15821
|
+
return canvas.toDataURL("image/png");
|
|
16250
15822
|
}
|
|
16251
|
-
|
|
16252
|
-
const
|
|
16253
|
-
|
|
16254
|
-
|
|
16255
|
-
|
|
16256
|
-
|
|
16257
|
-
|
|
16258
|
-
|
|
15823
|
+
function generateRadioImage(options) {
|
|
15824
|
+
const config = {
|
|
15825
|
+
checked: false,
|
|
15826
|
+
width: 100,
|
|
15827
|
+
height: 40,
|
|
15828
|
+
label: "",
|
|
15829
|
+
fontSize: 14,
|
|
15830
|
+
fontFamily: "SimSun",
|
|
15831
|
+
color: "#000000",
|
|
15832
|
+
borderColor: "#000000",
|
|
15833
|
+
checkColor: "#5175f4",
|
|
15834
|
+
boxSize: 20,
|
|
15835
|
+
gap: 8,
|
|
15836
|
+
borderWidth: 1,
|
|
15837
|
+
...options
|
|
15838
|
+
};
|
|
15839
|
+
const canvas = document.createElement("canvas");
|
|
15840
|
+
const ctx = canvas.getContext("2d");
|
|
15841
|
+
canvas.width = config.width;
|
|
15842
|
+
canvas.height = config.height;
|
|
15843
|
+
ctx.clearRect(0, 0, canvas.width, canvas.height);
|
|
15844
|
+
ctx.fillStyle = "#ffffff";
|
|
15845
|
+
ctx.fillRect(0, 0, canvas.width, canvas.height);
|
|
15846
|
+
ctx.strokeStyle = config.borderColor;
|
|
15847
|
+
ctx.lineWidth = config.borderWidth;
|
|
15848
|
+
ctx.strokeRect(
|
|
15849
|
+
config.borderWidth / 2,
|
|
15850
|
+
config.borderWidth / 2,
|
|
15851
|
+
config.width - config.borderWidth,
|
|
15852
|
+
config.height - config.borderWidth
|
|
15853
|
+
);
|
|
15854
|
+
const centerY = config.height / 2;
|
|
15855
|
+
const circleLeft = config.gap + config.borderWidth;
|
|
15856
|
+
const circleTop = centerY - config.boxSize / 2;
|
|
15857
|
+
const circleCenterX = circleLeft + config.boxSize / 2;
|
|
15858
|
+
const circleCenterY = circleTop + config.boxSize / 2;
|
|
15859
|
+
ctx.strokeStyle = config.borderColor;
|
|
15860
|
+
ctx.lineWidth = 1.5;
|
|
15861
|
+
ctx.beginPath();
|
|
15862
|
+
ctx.arc(circleCenterX, circleCenterY, config.boxSize / 2, 0, Math.PI * 2);
|
|
15863
|
+
ctx.stroke();
|
|
15864
|
+
if (config.checked) {
|
|
15865
|
+
ctx.fillStyle = config.checkColor;
|
|
15866
|
+
ctx.beginPath();
|
|
15867
|
+
ctx.arc(circleCenterX, circleCenterY, config.boxSize / 4, 0, Math.PI * 2);
|
|
15868
|
+
ctx.fill();
|
|
16259
15869
|
}
|
|
16260
|
-
|
|
16261
|
-
|
|
16262
|
-
|
|
16263
|
-
|
|
16264
|
-
|
|
16265
|
-
|
|
16266
|
-
|
|
16267
|
-
this.valueWorker = new WorkerWrapper();
|
|
15870
|
+
if (config.label) {
|
|
15871
|
+
ctx.font = `${config.fontSize}px ${config.fontFamily}`;
|
|
15872
|
+
ctx.fillStyle = config.color;
|
|
15873
|
+
ctx.textAlign = "left";
|
|
15874
|
+
ctx.textBaseline = "middle";
|
|
15875
|
+
const textX = circleLeft + config.boxSize + config.gap;
|
|
15876
|
+
ctx.fillText(config.label, textX, centerY);
|
|
16268
15877
|
}
|
|
16269
|
-
|
|
16270
|
-
|
|
16271
|
-
|
|
16272
|
-
|
|
15878
|
+
return canvas.toDataURL("image/png");
|
|
15879
|
+
}
|
|
15880
|
+
function formCheckboxPropertiesConfigDialog(el, command) {
|
|
15881
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o;
|
|
15882
|
+
console.log("el", el);
|
|
15883
|
+
const fontDom = document.querySelector(".menu-item__font");
|
|
15884
|
+
const fontOptionDom = fontDom.querySelector(".options");
|
|
15885
|
+
const liOption = [];
|
|
15886
|
+
fontOptionDom.querySelectorAll("li").forEach((li) => {
|
|
15887
|
+
var _a2, _b2;
|
|
15888
|
+
liOption.push({
|
|
15889
|
+
label: li.innerText,
|
|
15890
|
+
value: (_b2 = (_a2 = li.attributes.getNamedItem("data-family")) == null ? void 0 : _a2.value) != null ? _b2 : ""
|
|
15891
|
+
});
|
|
15892
|
+
});
|
|
15893
|
+
new Dialog({
|
|
15894
|
+
title: "\u8868\u5355\u590D\u9009\u6846",
|
|
15895
|
+
data: [
|
|
15896
|
+
{
|
|
15897
|
+
type: "text",
|
|
15898
|
+
label: "\u8868\u5355 Key",
|
|
15899
|
+
name: "key",
|
|
15900
|
+
required: true,
|
|
15901
|
+
value: (_b = (_a = el == null ? void 0 : el.formInput) == null ? void 0 : _a.key) != null ? _b : "",
|
|
15902
|
+
placeholder: "\u8BF7\u8F93\u5165\u8868\u5355 Key"
|
|
15903
|
+
},
|
|
15904
|
+
{
|
|
15905
|
+
type: "number",
|
|
15906
|
+
label: "\u5BBD\u5EA6 (px)",
|
|
15907
|
+
name: "width",
|
|
15908
|
+
required: true,
|
|
15909
|
+
placeholder: "\u8BF7\u8F93\u5165\u5BBD\u5EA6",
|
|
15910
|
+
value: (_d = (_c = el == null ? void 0 : el.formInput) == null ? void 0 : _c.width) != null ? _d : "120"
|
|
15911
|
+
},
|
|
15912
|
+
{
|
|
15913
|
+
type: "number",
|
|
15914
|
+
label: "\u9AD8\u5EA6 (px)",
|
|
15915
|
+
name: "height",
|
|
15916
|
+
required: true,
|
|
15917
|
+
placeholder: "\u8BF7\u8F93\u5165\u9AD8\u5EA6",
|
|
15918
|
+
value: (_f = (_e = el == null ? void 0 : el.formInput) == null ? void 0 : _e.height) != null ? _f : "40"
|
|
15919
|
+
},
|
|
15920
|
+
{
|
|
15921
|
+
type: "select",
|
|
15922
|
+
label: "\u9ED8\u8BA4\u9009\u4E2D",
|
|
15923
|
+
name: "checked",
|
|
15924
|
+
required: true,
|
|
15925
|
+
value: ((_g = el == null ? void 0 : el.formInput) == null ? void 0 : _g.checked) ? "true" : "false",
|
|
15926
|
+
options: [
|
|
15927
|
+
{
|
|
15928
|
+
label: "\u662F",
|
|
15929
|
+
value: "true"
|
|
15930
|
+
},
|
|
15931
|
+
{
|
|
15932
|
+
label: "\u5426",
|
|
15933
|
+
value: "false"
|
|
15934
|
+
}
|
|
15935
|
+
]
|
|
15936
|
+
},
|
|
15937
|
+
{
|
|
15938
|
+
type: "text",
|
|
15939
|
+
label: "\u6807\u7B7E\u6587\u5B57",
|
|
15940
|
+
name: "label",
|
|
15941
|
+
required: true,
|
|
15942
|
+
value: (_i = (_h = el == null ? void 0 : el.formInput) == null ? void 0 : _h.label) != null ? _i : "",
|
|
15943
|
+
placeholder: "\u8BF7\u8F93\u5165\u6807\u7B7E\u6587\u5B57"
|
|
15944
|
+
},
|
|
15945
|
+
{
|
|
15946
|
+
type: "number",
|
|
15947
|
+
label: "\u5B57\u53F7",
|
|
15948
|
+
name: "fontSize",
|
|
15949
|
+
required: true,
|
|
15950
|
+
placeholder: "\u8BF7\u8F93\u5165\u5B57\u53F7",
|
|
15951
|
+
value: (_k = (_j = el == null ? void 0 : el.formInput) == null ? void 0 : _j.fontSize) != null ? _k : "14"
|
|
15952
|
+
},
|
|
15953
|
+
{
|
|
15954
|
+
type: "color",
|
|
15955
|
+
label: "\u5B57\u4F53\u989C\u8272",
|
|
15956
|
+
name: "color",
|
|
15957
|
+
required: true,
|
|
15958
|
+
value: (_m = (_l = el == null ? void 0 : el.formInput) == null ? void 0 : _l.color) != null ? _m : "#000000"
|
|
15959
|
+
},
|
|
15960
|
+
{
|
|
15961
|
+
type: "select",
|
|
15962
|
+
label: "\u5B57\u4F53\u6837\u5F0F",
|
|
15963
|
+
name: "fontFamily",
|
|
15964
|
+
required: true,
|
|
15965
|
+
value: (_o = (_n = el == null ? void 0 : el.formInput) == null ? void 0 : _n.fontFamily) != null ? _o : "SimSun",
|
|
15966
|
+
options: liOption
|
|
15967
|
+
}
|
|
15968
|
+
],
|
|
15969
|
+
onConfirm: (payload) => {
|
|
15970
|
+
var _a2, _b2, _c2, _d2, _e2, _f2, _g2, _h2;
|
|
15971
|
+
console.log("payload: ", payload);
|
|
15972
|
+
const key = (_a2 = payload.find((p) => p.name === "key")) == null ? void 0 : _a2.value;
|
|
15973
|
+
if (!key)
|
|
15974
|
+
return;
|
|
15975
|
+
const width = (_b2 = payload.find((p) => p.name === "width")) == null ? void 0 : _b2.value;
|
|
15976
|
+
if (!width)
|
|
15977
|
+
return;
|
|
15978
|
+
const height = (_c2 = payload.find((p) => p.name === "height")) == null ? void 0 : _c2.value;
|
|
15979
|
+
if (!height)
|
|
15980
|
+
return;
|
|
15981
|
+
const checked = ((_d2 = payload.find((p) => p.name === "checked")) == null ? void 0 : _d2.value) === "true";
|
|
15982
|
+
const label = ((_e2 = payload.find((p) => p.name === "label")) == null ? void 0 : _e2.value) || "";
|
|
15983
|
+
const fontSize = (_f2 = payload.find((p) => p.name === "fontSize")) == null ? void 0 : _f2.value;
|
|
15984
|
+
const color = (_g2 = payload.find((p) => p.name === "color")) == null ? void 0 : _g2.value;
|
|
15985
|
+
const fontFamily = (_h2 = payload.find((p) => p.name === "fontFamily")) == null ? void 0 : _h2.value;
|
|
15986
|
+
const type = "checkbox";
|
|
15987
|
+
const formInput = {
|
|
15988
|
+
key,
|
|
15989
|
+
width,
|
|
15990
|
+
height,
|
|
15991
|
+
checked,
|
|
15992
|
+
label,
|
|
15993
|
+
fontSize,
|
|
15994
|
+
fontFamily,
|
|
15995
|
+
color,
|
|
15996
|
+
type
|
|
16273
15997
|
};
|
|
16274
|
-
|
|
16275
|
-
|
|
15998
|
+
const imageDataUrl = generateCheckboxImage({
|
|
15999
|
+
checked,
|
|
16000
|
+
label,
|
|
16001
|
+
width: Number(width),
|
|
16002
|
+
height: Number(height),
|
|
16003
|
+
fontSize: Number(fontSize),
|
|
16004
|
+
fontFamily,
|
|
16005
|
+
color
|
|
16006
|
+
});
|
|
16007
|
+
const param = {
|
|
16008
|
+
value: imageDataUrl,
|
|
16009
|
+
type: ElementType.IMAGE,
|
|
16010
|
+
formInput,
|
|
16011
|
+
width: Number(width),
|
|
16012
|
+
height: Number(height)
|
|
16276
16013
|
};
|
|
16277
|
-
|
|
16278
|
-
|
|
16014
|
+
if (el == null ? void 0 : el.id) {
|
|
16015
|
+
const deleteOpt = {
|
|
16016
|
+
id: el.id,
|
|
16017
|
+
properties: param
|
|
16018
|
+
};
|
|
16019
|
+
console.log("deleteOpt12", deleteOpt);
|
|
16020
|
+
command.executeUpdateElementById(deleteOpt);
|
|
16021
|
+
return;
|
|
16022
|
+
}
|
|
16023
|
+
command.executeInsertElementList([param]);
|
|
16024
|
+
}
|
|
16025
|
+
});
|
|
16026
|
+
}
|
|
16027
|
+
function formRadioPropertiesConfigDialog(el, command) {
|
|
16028
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o;
|
|
16029
|
+
console.log("el", el);
|
|
16030
|
+
const fontDom = document.querySelector(".menu-item__font");
|
|
16031
|
+
const fontOptionDom = fontDom.querySelector(".options");
|
|
16032
|
+
const liOption = [];
|
|
16033
|
+
fontOptionDom.querySelectorAll("li").forEach((li) => {
|
|
16034
|
+
var _a2, _b2;
|
|
16035
|
+
liOption.push({
|
|
16036
|
+
label: li.innerText,
|
|
16037
|
+
value: (_b2 = (_a2 = li.attributes.getNamedItem("data-family")) == null ? void 0 : _a2.value) != null ? _b2 : ""
|
|
16279
16038
|
});
|
|
16280
|
-
}
|
|
16281
|
-
|
|
16282
|
-
|
|
16283
|
-
|
|
16284
|
-
|
|
16285
|
-
|
|
16286
|
-
|
|
16287
|
-
|
|
16039
|
+
});
|
|
16040
|
+
new Dialog({
|
|
16041
|
+
title: "\u8868\u5355\u5355\u9009\u6846",
|
|
16042
|
+
data: [
|
|
16043
|
+
{
|
|
16044
|
+
type: "text",
|
|
16045
|
+
label: "\u8868\u5355 Key",
|
|
16046
|
+
name: "key",
|
|
16047
|
+
required: true,
|
|
16048
|
+
value: (_b = (_a = el == null ? void 0 : el.formInput) == null ? void 0 : _a.key) != null ? _b : "",
|
|
16049
|
+
placeholder: "\u8BF7\u8F93\u5165\u8868\u5355 Key"
|
|
16050
|
+
},
|
|
16051
|
+
{
|
|
16052
|
+
type: "number",
|
|
16053
|
+
label: "\u5BBD\u5EA6 (px)",
|
|
16054
|
+
name: "width",
|
|
16055
|
+
required: true,
|
|
16056
|
+
placeholder: "\u8BF7\u8F93\u5165\u5BBD\u5EA6",
|
|
16057
|
+
value: (_d = (_c = el == null ? void 0 : el.formInput) == null ? void 0 : _c.width) != null ? _d : "120"
|
|
16058
|
+
},
|
|
16059
|
+
{
|
|
16060
|
+
type: "number",
|
|
16061
|
+
label: "\u9AD8\u5EA6 (px)",
|
|
16062
|
+
name: "height",
|
|
16063
|
+
required: true,
|
|
16064
|
+
placeholder: "\u8BF7\u8F93\u5165\u9AD8\u5EA6",
|
|
16065
|
+
value: (_f = (_e = el == null ? void 0 : el.formInput) == null ? void 0 : _e.height) != null ? _f : "40"
|
|
16066
|
+
},
|
|
16067
|
+
{
|
|
16068
|
+
type: "select",
|
|
16069
|
+
label: "\u9ED8\u8BA4\u9009\u4E2D",
|
|
16070
|
+
name: "checked",
|
|
16071
|
+
required: true,
|
|
16072
|
+
value: ((_g = el == null ? void 0 : el.formInput) == null ? void 0 : _g.checked) ? "true" : "false",
|
|
16073
|
+
options: [
|
|
16074
|
+
{
|
|
16075
|
+
label: "\u662F",
|
|
16076
|
+
value: "true"
|
|
16077
|
+
},
|
|
16078
|
+
{
|
|
16079
|
+
label: "\u5426",
|
|
16080
|
+
value: "false"
|
|
16081
|
+
}
|
|
16082
|
+
]
|
|
16083
|
+
},
|
|
16084
|
+
{
|
|
16085
|
+
type: "text",
|
|
16086
|
+
label: "\u6807\u7B7E\u6587\u5B57",
|
|
16087
|
+
name: "label",
|
|
16088
|
+
required: true,
|
|
16089
|
+
value: (_i = (_h = el == null ? void 0 : el.formInput) == null ? void 0 : _h.label) != null ? _i : "",
|
|
16090
|
+
placeholder: "\u8BF7\u8F93\u5165\u6807\u7B7E\u6587\u5B57"
|
|
16091
|
+
},
|
|
16092
|
+
{
|
|
16093
|
+
type: "number",
|
|
16094
|
+
label: "\u5B57\u53F7",
|
|
16095
|
+
name: "fontSize",
|
|
16096
|
+
required: true,
|
|
16097
|
+
placeholder: "\u8BF7\u8F93\u5165\u5B57\u53F7",
|
|
16098
|
+
value: (_k = (_j = el == null ? void 0 : el.formInput) == null ? void 0 : _j.fontSize) != null ? _k : "14"
|
|
16099
|
+
},
|
|
16100
|
+
{
|
|
16101
|
+
type: "color",
|
|
16102
|
+
label: "\u5B57\u4F53\u989C\u8272",
|
|
16103
|
+
name: "color",
|
|
16104
|
+
required: true,
|
|
16105
|
+
value: (_m = (_l = el == null ? void 0 : el.formInput) == null ? void 0 : _l.color) != null ? _m : "#000000"
|
|
16106
|
+
},
|
|
16107
|
+
{
|
|
16108
|
+
type: "select",
|
|
16109
|
+
label: "\u5B57\u4F53\u6837\u5F0F",
|
|
16110
|
+
name: "fontFamily",
|
|
16111
|
+
required: true,
|
|
16112
|
+
value: (_o = (_n = el == null ? void 0 : el.formInput) == null ? void 0 : _n.fontFamily) != null ? _o : "SimSun",
|
|
16113
|
+
options: liOption
|
|
16114
|
+
}
|
|
16115
|
+
],
|
|
16116
|
+
onConfirm: (payload) => {
|
|
16117
|
+
var _a2, _b2, _c2, _d2, _e2, _f2, _g2, _h2;
|
|
16118
|
+
console.log("payload: ", payload);
|
|
16119
|
+
const key = (_a2 = payload.find((p) => p.name === "key")) == null ? void 0 : _a2.value;
|
|
16120
|
+
if (!key)
|
|
16121
|
+
return;
|
|
16122
|
+
const width = (_b2 = payload.find((p) => p.name === "width")) == null ? void 0 : _b2.value;
|
|
16123
|
+
if (!width)
|
|
16124
|
+
return;
|
|
16125
|
+
const height = (_c2 = payload.find((p) => p.name === "height")) == null ? void 0 : _c2.value;
|
|
16126
|
+
if (!height)
|
|
16127
|
+
return;
|
|
16128
|
+
const checked = ((_d2 = payload.find((p) => p.name === "checked")) == null ? void 0 : _d2.value) === "true";
|
|
16129
|
+
const label = ((_e2 = payload.find((p) => p.name === "label")) == null ? void 0 : _e2.value) || "";
|
|
16130
|
+
const fontSize = (_f2 = payload.find((p) => p.name === "fontSize")) == null ? void 0 : _f2.value;
|
|
16131
|
+
const color = (_g2 = payload.find((p) => p.name === "color")) == null ? void 0 : _g2.value;
|
|
16132
|
+
const fontFamily = (_h2 = payload.find((p) => p.name === "fontFamily")) == null ? void 0 : _h2.value;
|
|
16133
|
+
const type = "radio";
|
|
16134
|
+
const formInput = {
|
|
16135
|
+
key,
|
|
16136
|
+
width,
|
|
16137
|
+
height,
|
|
16138
|
+
checked,
|
|
16139
|
+
label,
|
|
16140
|
+
fontSize,
|
|
16141
|
+
fontFamily,
|
|
16142
|
+
color,
|
|
16143
|
+
type
|
|
16288
16144
|
};
|
|
16289
|
-
const
|
|
16290
|
-
|
|
16291
|
-
|
|
16292
|
-
|
|
16293
|
-
|
|
16145
|
+
const imageDataUrl = generateRadioImage({
|
|
16146
|
+
checked,
|
|
16147
|
+
label,
|
|
16148
|
+
width: Number(width),
|
|
16149
|
+
height: Number(height),
|
|
16150
|
+
fontSize: Number(fontSize),
|
|
16151
|
+
fontFamily,
|
|
16152
|
+
color
|
|
16294
16153
|
});
|
|
16295
|
-
|
|
16296
|
-
|
|
16297
|
-
|
|
16298
|
-
|
|
16299
|
-
|
|
16300
|
-
|
|
16301
|
-
};
|
|
16302
|
-
this.groupWorker.onerror = (evt) => {
|
|
16303
|
-
reject(evt);
|
|
16154
|
+
const param = {
|
|
16155
|
+
value: imageDataUrl,
|
|
16156
|
+
type: ElementType.IMAGE,
|
|
16157
|
+
formInput,
|
|
16158
|
+
width: Number(width),
|
|
16159
|
+
height: Number(height)
|
|
16304
16160
|
};
|
|
16305
|
-
|
|
16306
|
-
|
|
16161
|
+
if (el == null ? void 0 : el.id) {
|
|
16162
|
+
const deleteOpt = {
|
|
16163
|
+
id: el.id,
|
|
16164
|
+
properties: param
|
|
16165
|
+
};
|
|
16166
|
+
console.log("deleteOpt12", deleteOpt);
|
|
16167
|
+
command.executeUpdateElementById(deleteOpt);
|
|
16168
|
+
return;
|
|
16169
|
+
}
|
|
16170
|
+
command.executeInsertElementList([param]);
|
|
16171
|
+
}
|
|
16172
|
+
});
|
|
16173
|
+
}
|
|
16174
|
+
function formInputPropertiesConfigDialog(el, command) {
|
|
16175
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p;
|
|
16176
|
+
console.log("el", el);
|
|
16177
|
+
const fontDom = document.querySelector(".menu-item__font");
|
|
16178
|
+
const fontOptionDom = fontDom.querySelector(".options");
|
|
16179
|
+
const liOption = [];
|
|
16180
|
+
fontOptionDom.querySelectorAll("li").forEach((li) => {
|
|
16181
|
+
var _a2, _b2;
|
|
16182
|
+
liOption.push({
|
|
16183
|
+
label: li.innerText,
|
|
16184
|
+
value: (_b2 = (_a2 = li.attributes.getNamedItem("data-family")) == null ? void 0 : _a2.value) != null ? _b2 : ""
|
|
16307
16185
|
});
|
|
16308
|
-
}
|
|
16309
|
-
|
|
16310
|
-
|
|
16311
|
-
|
|
16312
|
-
|
|
16313
|
-
|
|
16314
|
-
|
|
16315
|
-
|
|
16316
|
-
|
|
16317
|
-
|
|
16318
|
-
|
|
16319
|
-
|
|
16186
|
+
});
|
|
16187
|
+
new Dialog({
|
|
16188
|
+
title: "\u8868\u5355\u6587\u672C\u6846",
|
|
16189
|
+
data: [
|
|
16190
|
+
{
|
|
16191
|
+
type: "text",
|
|
16192
|
+
label: "\u8868\u5355Key",
|
|
16193
|
+
name: "key",
|
|
16194
|
+
required: true,
|
|
16195
|
+
value: (_b = (_a = el == null ? void 0 : el.formInput) == null ? void 0 : _a.key) != null ? _b : "",
|
|
16196
|
+
placeholder: "\u8BF7\u8F93\u5165\u8868\u5355Key"
|
|
16197
|
+
},
|
|
16198
|
+
{
|
|
16199
|
+
type: "number",
|
|
16200
|
+
label: "\u5BBD\u5EA6(px)",
|
|
16201
|
+
name: "width",
|
|
16202
|
+
required: true,
|
|
16203
|
+
placeholder: "\u8BF7\u8F93\u5165\u5BBD\u5EA6",
|
|
16204
|
+
value: (_d = (_c = el == null ? void 0 : el.formInput) == null ? void 0 : _c.width) != null ? _d : "100"
|
|
16205
|
+
},
|
|
16206
|
+
{
|
|
16207
|
+
type: "number",
|
|
16208
|
+
label: "\u9AD8\u5EA6(px)",
|
|
16209
|
+
name: "height",
|
|
16210
|
+
required: true,
|
|
16211
|
+
placeholder: "\u8BF7\u8F93\u5165\u9AD8\u5EA6",
|
|
16212
|
+
value: (_f = (_e = el == null ? void 0 : el.formInput) == null ? void 0 : _e.height) != null ? _f : "50"
|
|
16213
|
+
},
|
|
16214
|
+
{
|
|
16215
|
+
type: "number",
|
|
16216
|
+
label: "\u5B57\u53F7",
|
|
16217
|
+
name: "fontSize",
|
|
16218
|
+
required: true,
|
|
16219
|
+
placeholder: "\u8BF7\u8F93\u5165\u5B57\u53F7",
|
|
16220
|
+
value: (_h = (_g = el == null ? void 0 : el.formInput) == null ? void 0 : _g.fontSize) != null ? _h : "10"
|
|
16221
|
+
},
|
|
16222
|
+
{
|
|
16223
|
+
type: "select",
|
|
16224
|
+
label: "\u662F\u5426\u52A0\u7C97",
|
|
16225
|
+
name: "bold",
|
|
16226
|
+
required: true,
|
|
16227
|
+
value: ((_i = el == null ? void 0 : el.formInput) == null ? void 0 : _i.bold) ? String((_j = el == null ? void 0 : el.formInput) == null ? void 0 : _j.bold) : "false",
|
|
16228
|
+
options: [
|
|
16229
|
+
{
|
|
16230
|
+
label: "\u662F",
|
|
16231
|
+
value: "true"
|
|
16232
|
+
},
|
|
16233
|
+
{
|
|
16234
|
+
label: "\u5426",
|
|
16235
|
+
value: "false"
|
|
16236
|
+
}
|
|
16237
|
+
]
|
|
16238
|
+
},
|
|
16239
|
+
{
|
|
16240
|
+
type: "select",
|
|
16241
|
+
label: "\u662F\u5426\u659C\u4F53",
|
|
16242
|
+
name: "italic",
|
|
16243
|
+
required: true,
|
|
16244
|
+
value: ((_k = el == null ? void 0 : el.formInput) == null ? void 0 : _k.italic) ? String((_l = el == null ? void 0 : el.formInput) == null ? void 0 : _l.italic) : "false",
|
|
16245
|
+
options: [
|
|
16246
|
+
{
|
|
16247
|
+
label: "\u662F",
|
|
16248
|
+
value: "true"
|
|
16249
|
+
},
|
|
16250
|
+
{
|
|
16251
|
+
label: "\u5426",
|
|
16252
|
+
value: "false"
|
|
16253
|
+
}
|
|
16254
|
+
]
|
|
16255
|
+
},
|
|
16256
|
+
{
|
|
16257
|
+
type: "color",
|
|
16258
|
+
label: "\u5B57\u4F53\u989C\u8272",
|
|
16259
|
+
name: "color",
|
|
16260
|
+
required: true,
|
|
16261
|
+
value: (_n = (_m = el == null ? void 0 : el.formInput) == null ? void 0 : _m.color) != null ? _n : "#000000"
|
|
16262
|
+
},
|
|
16263
|
+
{
|
|
16264
|
+
type: "select",
|
|
16265
|
+
label: "\u5B57\u4F53\u6837\u5F0F",
|
|
16266
|
+
name: "fontFamily",
|
|
16267
|
+
required: true,
|
|
16268
|
+
value: (_p = (_o = el == null ? void 0 : el.formInput) == null ? void 0 : _o.fontFamily) != null ? _p : "SimSun",
|
|
16269
|
+
options: liOption
|
|
16270
|
+
}
|
|
16271
|
+
],
|
|
16272
|
+
onConfirm: (payload) => {
|
|
16273
|
+
var _a2, _b2, _c2, _d2, _e2, _f2, _g2, _h2;
|
|
16274
|
+
console.log("payload: ", payload);
|
|
16275
|
+
const key = (_a2 = payload.find((p) => p.name === "key")) == null ? void 0 : _a2.value;
|
|
16276
|
+
if (!key)
|
|
16277
|
+
return;
|
|
16278
|
+
const width = (_b2 = payload.find((p) => p.name === "width")) == null ? void 0 : _b2.value;
|
|
16279
|
+
if (!width)
|
|
16280
|
+
return;
|
|
16281
|
+
const height = (_c2 = payload.find((p) => p.name === "height")) == null ? void 0 : _c2.value;
|
|
16282
|
+
if (!height)
|
|
16283
|
+
return;
|
|
16284
|
+
const fontSize = (_d2 = payload.find((p) => p.name === "fontSize")) == null ? void 0 : _d2.value;
|
|
16285
|
+
const bold = ((_e2 = payload.find((p) => p.name === "bold")) == null ? void 0 : _e2.value) === "true";
|
|
16286
|
+
const italic = ((_f2 = payload.find((p) => p.name === "italic")) == null ? void 0 : _f2.value) === "true";
|
|
16287
|
+
const color = (_g2 = payload.find((p) => p.name === "color")) == null ? void 0 : _g2.value;
|
|
16288
|
+
const fontFamily = (_h2 = payload.find((p) => p.name === "fontFamily")) == null ? void 0 : _h2.value;
|
|
16289
|
+
const type = "input";
|
|
16290
|
+
const formInput = {
|
|
16291
|
+
key,
|
|
16292
|
+
width,
|
|
16293
|
+
height,
|
|
16294
|
+
fontSize,
|
|
16295
|
+
bold,
|
|
16296
|
+
italic,
|
|
16297
|
+
color,
|
|
16298
|
+
fontFamily,
|
|
16299
|
+
type
|
|
16320
16300
|
};
|
|
16321
|
-
|
|
16322
|
-
|
|
16323
|
-
|
|
16301
|
+
const imageDataUrl = generateTextImage({
|
|
16302
|
+
text: key,
|
|
16303
|
+
width,
|
|
16304
|
+
height
|
|
16324
16305
|
});
|
|
16325
|
-
|
|
16326
|
-
|
|
16306
|
+
const param = {
|
|
16307
|
+
"value": imageDataUrl,
|
|
16308
|
+
"type": ElementType.IMAGE,
|
|
16309
|
+
"formInput": formInput,
|
|
16310
|
+
"width": Number(width),
|
|
16311
|
+
"height": Number(height)
|
|
16312
|
+
};
|
|
16313
|
+
if (el == null ? void 0 : el.id) {
|
|
16314
|
+
const deleteOpt = {
|
|
16315
|
+
id: el.id,
|
|
16316
|
+
properties: param
|
|
16317
|
+
};
|
|
16318
|
+
console.log("deleteOpt12", deleteOpt);
|
|
16319
|
+
command.executeUpdateElementById(deleteOpt);
|
|
16320
|
+
return;
|
|
16321
|
+
}
|
|
16322
|
+
command.executeInsertElementList([
|
|
16323
|
+
param
|
|
16324
|
+
]);
|
|
16325
|
+
}
|
|
16326
|
+
});
|
|
16327
16327
|
}
|
|
16328
16328
|
class Previewer {
|
|
16329
16329
|
constructor(draw) {
|
|
@@ -25139,6 +25139,15 @@ class EventBus {
|
|
|
25139
25139
|
class Override {
|
|
25140
25140
|
}
|
|
25141
25141
|
class Editor {
|
|
25142
|
+
showFormInputConfig(el) {
|
|
25143
|
+
formInputPropertiesConfigDialog(el, this.command);
|
|
25144
|
+
}
|
|
25145
|
+
showFormCheckboxConfig(el) {
|
|
25146
|
+
formCheckboxPropertiesConfigDialog(el, this.command);
|
|
25147
|
+
}
|
|
25148
|
+
showFormRadioConfig(el) {
|
|
25149
|
+
formRadioPropertiesConfigDialog(el, this.command);
|
|
25150
|
+
}
|
|
25142
25151
|
constructor(container, data2, options = {}) {
|
|
25143
25152
|
const editorOptions = mergeOption(options);
|
|
25144
25153
|
data2 = deepClone(data2);
|
|
@@ -25188,10 +25197,12 @@ class Editor {
|
|
|
25188
25197
|
shortcut.removeEvent();
|
|
25189
25198
|
contextMenu.removeEvent();
|
|
25190
25199
|
this.eventBus.dangerouslyClearAll();
|
|
25200
|
+
Reflect.set(window, "editor", null);
|
|
25191
25201
|
};
|
|
25192
25202
|
const plugin = new Plugin(this);
|
|
25193
25203
|
this.use = plugin.use.bind(plugin);
|
|
25204
|
+
Reflect.set(window, "editor", this);
|
|
25194
25205
|
}
|
|
25195
25206
|
}
|
|
25196
|
-
export { AreaMode, BackgroundRepeat, BackgroundSize, BlockType, Command, ControlComponent, ControlIndentation, ControlState, ControlType,
|
|
25207
|
+
export { AreaMode, BackgroundRepeat, BackgroundSize, BlockType, Command, ControlComponent, ControlIndentation, ControlState, ControlType, EDITOR_CLIPBOARD, EDITOR_COMPONENT, Editor, EditorComponent, EditorMode, EditorZone, ElementType, FlexDirection, INTERNAL_CONTEXT_MENU_KEY, INTERNAL_SHORTCUT_KEY, ImageDisplay, KeyMap, LETTER_CLASS, LineNumberType, ListStyle, ListType, LocationPosition, MaxHeightRatio, NumberType, PageMode, PaperDirection, RenderMode, RowFlex, TableBorder, TdBorder, TdSlash, TextDecorationStyle, TitleLevel, VerticalAlign, WatermarkType, WordBreak, createDomFromElementList, Editor as default, formCheckboxPropertiesConfigDialog, formInputPropertiesConfigDialog, formRadioPropertiesConfigDialog, getElementListByHTML, getTextFromElementList, splitText };
|
|
25197
25208
|
//# sourceMappingURL=canvas-editor.es.js.map
|