修复了浏览器兼容缩放问题

This commit is contained in:
猴赛雷 2024-11-25 19:29:58 +08:00
parent 5105ada3b8
commit a42bcdf5e0
7 changed files with 119 additions and 71 deletions

View File

@ -1335,7 +1335,7 @@ var __publicField3 = (obj, key, value) => {
display: inline-flex; display: inline-flex;
align-items: center; align-items: center;
} }
.ddei-core-panel-toolbox-simple[data-v-bd214554] { .ddei-core-panel-toolbox-simple[data-v-a92a1427] {
text-align: center; text-align: center;
position: absolute; position: absolute;
z-index: 99999; z-index: 99999;
@ -1348,7 +1348,7 @@ var __publicField3 = (obj, key, value) => {
justify-content: start; justify-content: start;
align-items: center; align-items: center;
} }
.ddei-core-panel-toolbox-simple .item[data-v-bd214554] { .ddei-core-panel-toolbox-simple .item[data-v-a92a1427] {
width: 30px; width: 30px;
height: 30px; height: 30px;
border-radius: 3px; border-radius: 3px;
@ -1356,51 +1356,51 @@ var __publicField3 = (obj, key, value) => {
justify-content: center; justify-content: center;
align-items: center; align-items: center;
} }
.ddei-core-panel-toolbox-simple .item > img[data-v-bd214554] { .ddei-core-panel-toolbox-simple .item > img[data-v-a92a1427] {
margin-top: 2px; margin-top: 2px;
margin-left: 2px; margin-left: 2px;
} }
.ddei-core-panel-toolbox-simple .item[data-v-bd214554]:hover { .ddei-core-panel-toolbox-simple .item[data-v-a92a1427]:hover {
background-color: #e2dede; background-color: #e2dede;
cursor: pointer; cursor: pointer;
} }
.ddei-core-panel-toolbox-simple .item-icon-html[data-v-bd214554] { .ddei-core-panel-toolbox-simple .item-icon-html[data-v-a92a1427] {
width: 30px; width: 30px;
height: 30px; height: 30px;
display: flex; display: flex;
justify-content: center; justify-content: center;
align-items: center; align-items: center;
} }
.ddei-core-panel-toolbox-simple .item-icon-html[data-v-bd214554] > * { .ddei-core-panel-toolbox-simple .item-icon-html[data-v-a92a1427] > * {
width: 28px !important; width: 28px !important;
height: 28px !important; height: 28px !important;
} }
.ddei-core-panel-toolbox-simple .item-selected[data-v-bd214554] { .ddei-core-panel-toolbox-simple .item-selected[data-v-a92a1427] {
background-color: #e2dede; background-color: #e2dede;
} }
.ddei-core-panel-toolbox-simple .item-block[data-v-bd214554] { .ddei-core-panel-toolbox-simple .item-block[data-v-a92a1427] {
width: 10px; width: 10px;
height: 10px; height: 10px;
} }
.ddei-core-panel-toolbox-simple .item-drag[data-v-bd214554] { .ddei-core-panel-toolbox-simple .item-drag[data-v-a92a1427] {
width: 100%; width: 100%;
height: 10px; height: 10px;
background-color: #efefef; background-color: #efefef;
} }
.ddei-core-panel-toolbox-simple .item-drag[data-v-bd214554]:hover { .ddei-core-panel-toolbox-simple .item-drag[data-v-a92a1427]:hover {
background-color: var(--dot); background-color: var(--dot);
cursor: grab; cursor: grab;
} }
.ddei-core-panel-toolbox-simple .item-drag-2[data-v-bd214554] { .ddei-core-panel-toolbox-simple .item-drag-2[data-v-a92a1427] {
height: 100%; height: 100%;
width: 10px; width: 10px;
background-color: #efefef; background-color: #efefef;
} }
.ddei-core-panel-toolbox-simple .item-drag-2[data-v-bd214554]:hover { .ddei-core-panel-toolbox-simple .item-drag-2[data-v-a92a1427]:hover {
background-color: var(--dot); background-color: var(--dot);
cursor: grab; cursor: grab;
} }
.ddei-core-panel-topmenu-simple[data-v-52f75ccc] { .ddei-core-panel-topmenu-simple[data-v-62fb5b38] {
text-align: center; text-align: center;
position: absolute; position: absolute;
color: var(--text); color: var(--text);
@ -1415,7 +1415,7 @@ var __publicField3 = (obj, key, value) => {
justify-content: start; justify-content: start;
align-items: center; align-items: center;
} }
.ddei-core-panel-topmenu-simple .item[data-v-52f75ccc] { .ddei-core-panel-topmenu-simple .item[data-v-62fb5b38] {
min-width: 60px; min-width: 60px;
padding: 0 10px; padding: 0 10px;
height: 24px; height: 24px;
@ -1427,37 +1427,37 @@ var __publicField3 = (obj, key, value) => {
border-top-right-radius: 0px; border-top-right-radius: 0px;
border-bottom-right-radius: 0px; border-bottom-right-radius: 0px;
} }
.ddei-core-panel-topmenu-simple .item > div[data-v-52f75ccc] { .ddei-core-panel-topmenu-simple .item > div[data-v-62fb5b38] {
width: 100%; width: 100%;
} }
.ddei-core-panel-topmenu-simple .item[data-v-52f75ccc]:hover { .ddei-core-panel-topmenu-simple .item[data-v-62fb5b38]:hover {
background-color: #e2dede; background-color: #e2dede;
cursor: pointer; cursor: pointer;
border-top-right-radius: 3px; border-top-right-radius: 3px;
border-bottom-right-radius: 3px; border-bottom-right-radius: 3px;
} }
.ddei-core-panel-topmenu-simple .item-selected[data-v-52f75ccc] { .ddei-core-panel-topmenu-simple .item-selected[data-v-62fb5b38] {
background-color: #e2dede; background-color: #e2dede;
} }
.ddei-core-panel-topmenu-simple .item-block[data-v-52f75ccc] { .ddei-core-panel-topmenu-simple .item-block[data-v-62fb5b38] {
width: 10px; width: 10px;
height: 10px; height: 10px;
} }
.ddei-core-panel-topmenu-simple .item-drag[data-v-52f75ccc] { .ddei-core-panel-topmenu-simple .item-drag[data-v-62fb5b38] {
width: 100%; width: 100%;
height: 10px; height: 10px;
background-color: #efefef; background-color: #efefef;
} }
.ddei-core-panel-topmenu-simple .item-drag[data-v-52f75ccc]:hover { .ddei-core-panel-topmenu-simple .item-drag[data-v-62fb5b38]:hover {
background-color: var(--dot); background-color: var(--dot);
cursor: grab; cursor: grab;
} }
.ddei-core-panel-topmenu-simple .item-drag-2[data-v-52f75ccc] { .ddei-core-panel-topmenu-simple .item-drag-2[data-v-62fb5b38] {
height: 100%; height: 100%;
width: 10px; width: 10px;
background-color: #efefef; background-color: #efefef;
} }
.ddei-core-panel-topmenu-simple .item-drag-2[data-v-52f75ccc]:hover { .ddei-core-panel-topmenu-simple .item-drag-2[data-v-62fb5b38]:hover {
background-color: var(--dot); background-color: var(--dot);
cursor: grab; cursor: grab;
} }
@ -8517,6 +8517,49 @@ to {
const chromeReg = /Chrome/; const chromeReg = /Chrome/;
const ytestReg = /(y+)/; const ytestReg = /(y+)/;
const _DDeiUtil = class _DDeiUtil2 { const _DDeiUtil = class _DDeiUtil2 {
//用于接管存取方法
static setLocalStorageData(key, value) {
if (window.setLocalStorageData) {
window.setLocalStorageData(key, value);
} else {
try {
if (localStorage) {
localStorage.setItem(key, value);
}
} catch (e) {
console.warn("No Access LocalStorage");
}
}
}
static getLocalStorageData(key) {
if (window.getLocalStorageData) {
return window.getLocalStorageData(key);
} else {
try {
if (localStorage) {
return localStorage.getItem(key);
} else {
return null;
}
} catch (e) {
console.warn("No Access LocalStorage");
return null;
}
}
}
static removeLocalStorageData(key) {
if (window.removeLocalStorageData) {
window.removeLocalStorageData(key);
} else {
try {
if (localStorage) {
localStorage.removeItem(key);
}
} catch (e) {
console.warn("No Access LocalStorage");
}
}
}
/** /**
* 计算文字的高度和宽度 * 计算文字的高度和宽度
*/ */
@ -9788,7 +9831,7 @@ to {
// 16进制编码转rgb // 16进制编码转rgb
static hex2rgb(hex) { static hex2rgb(hex) {
let hexNum = hex.substring(1); let hexNum = hex.substring(1);
hexNum = "0x" + (hexNum.length < 6 ? repeatLetter(hexNum, 2) : hexNum); hexNum = "0x" + (hexNum.length < 6 ? _DDeiUtil2.repeatLetter(hexNum, 2) : hexNum);
let r = hexNum >> 16; let r = hexNum >> 16;
let g = hexNum >> 8 & "0xff"; let g = hexNum >> 8 & "0xff";
let b = hexNum & "0xff"; let b = hexNum & "0xff";
@ -9796,7 +9839,7 @@ to {
} }
static hex2ddeicolor(hex) { static hex2ddeicolor(hex) {
let hexNum = hex.substring(1); let hexNum = hex.substring(1);
hexNum = "0x" + (hexNum.length < 6 ? repeatLetter(hexNum, 2) : hexNum); hexNum = "0x" + (hexNum.length < 6 ? _DDeiUtil2.repeatLetter(hexNum, 2) : hexNum);
let r = hexNum >> 16; let r = hexNum >> 16;
let g = hexNum >> 8 & "0xff"; let g = hexNum >> 8 & "0xff";
let b = hexNum & "0xff"; let b = hexNum & "0xff";
@ -9819,6 +9862,7 @@ to {
// rgb转16进制 // rgb转16进制
static rgb2hex(color) { static rgb2hex(color) {
if (color) { if (color) {
color = color.trim();
if (color.toLowerCase().startsWith("rgb")) { if (color.toLowerCase().startsWith("rgb")) {
let rgb = color.split(","); let rgb = color.split(",");
let r = parseInt(rgb[0].split("(")[1]); let r = parseInt(rgb[0].split("(")[1]);
@ -10965,7 +11009,7 @@ to {
* 读取最近写入颜色 * 读取最近写入颜色
*/ */
static readRecentlyChooseColors() { static readRecentlyChooseColors() {
let colorStrs = localStorage.getItem("ddei-recently-choose-colors"); let colorStrs = _DDeiUtil2.getLocalStorageData("ddei-recently-choose-colors");
if (colorStrs) { if (colorStrs) {
let colors = colorStrs.split(","); let colors = colorStrs.split(",");
_DDeiUtil2.recentlyChooseColors = colors; _DDeiUtil2.recentlyChooseColors = colors;
@ -10985,7 +11029,7 @@ to {
if (_DDeiUtil2.recentlyChooseColors.length > 10) { if (_DDeiUtil2.recentlyChooseColors.length > 10) {
_DDeiUtil2.recentlyChooseColors.splice(10, 1); _DDeiUtil2.recentlyChooseColors.splice(10, 1);
} }
localStorage.setItem("ddei-recently-choose-colors", _DDeiUtil2.recentlyChooseColors.toString()); _DDeiUtil2.setLocalStorageData("ddei-recently-choose-colors", _DDeiUtil2.recentlyChooseColors.toString());
} }
static canvasToImage(canvas) { static canvasToImage(canvas) {
return new Promise((resolve, rejected) => { return new Promise((resolve, rejected) => {
@ -11031,7 +11075,7 @@ to {
if (outRect.height * rat1 > height * rat1) { if (outRect.height * rat1 > height * rat1) {
scaleH = height / outRect.height; scaleH = height / outRect.height;
} }
canvas.setAttribute("style", "-webkit-font-smoothing:antialiased;-moz-transform-origin:left top;-moz-transform:scale(" + 1 / rat2 + ");display:block;zoom:" + 1 / rat2); canvas.setAttribute("style", "-webkit-font-smoothing:antialiased;-moz-transform-origin:left top;-moz-transform:scale(" + 1 / rat2 + ");display:block;-webkit-transform:scale(" + 1 / rat2 + ")");
if (scaleW != 1 || scaleH != 1) { if (scaleW != 1 || scaleH != 1) {
canvas.setAttribute("width", width * rat1 + addWidth); canvas.setAttribute("width", width * rat1 + addWidth);
canvas.setAttribute("height", height * rat1 + addWidth); canvas.setAttribute("height", height * rat1 + addWidth);
@ -11070,7 +11114,7 @@ to {
ddInstance.render.ratio = rat1; ddInstance.render.ratio = rat1;
let editorId = _DDeiUtil2.getEditorId(ddInstance); let editorId = _DDeiUtil2.getEditorId(ddInstance);
let containerDiv = document.getElementById(editorId + "_ddei_cut_img_div"); let containerDiv = document.getElementById(editorId + "_ddei_cut_img_div");
canvas.setAttribute("style", "-webkit-font-smoothing:antialiased;-moz-transform-origin:left top;-moz-transform:scale(" + 1 / rat1 + ");display:block;zoom:" + 1 / rat1); canvas.setAttribute("style", "-webkit-font-smoothing:antialiased;-moz-transform-origin:left top;-moz-transform:scale(" + 1 / rat1 + ");display:block;-webkit-transform:scale(" + 1 / rat1 + ")");
canvas.setAttribute("width", width * rat1); canvas.setAttribute("width", width * rat1);
canvas.setAttribute("height", height * rat1); canvas.setAttribute("height", height * rat1);
containerDiv.appendChild(canvas); containerDiv.appendChild(canvas);
@ -20502,7 +20546,7 @@ to {
let addWidth = 2 * lineOffset; let addWidth = 2 * lineOffset;
let editorId = DDeiUtil$1.getEditorId(ddInstance); let editorId = DDeiUtil$1.getEditorId(ddInstance);
let containerDiv = document.getElementById(editorId + "_ddei_cut_img_div"); let containerDiv = document.getElementById(editorId + "_ddei_cut_img_div");
canvas.setAttribute("style", "-webkit-font-smoothing:antialiased;-moz-transform-origin:left top;-moz-transform:scale(" + 1 / rat1 + ");display:block;zoom:" + 1 / rat1); canvas.setAttribute("style", "-webkit-font-smoothing:antialiased;-moz-transform-origin:left top;-moz-transform:scale(" + 1 / rat1 + ");display:block;-webkit-transform:scale(" + 1 / rat1 + ")");
let cW = (outRect.width + addWidth) * rat1; let cW = (outRect.width + addWidth) * rat1;
let cH = (outRect.height + addWidth) * rat1; let cH = (outRect.height + addWidth) * rat1;
canvas.setAttribute("width", cW); canvas.setAttribute("width", cW);
@ -26839,7 +26883,7 @@ to {
let rat1 = this.ddRender.ratio; let rat1 = this.ddRender.ratio;
if (!this.tempCanvas) { if (!this.tempCanvas) {
this.tempCanvas = document.createElement("canvas"); this.tempCanvas = document.createElement("canvas");
this.tempCanvas.setAttribute("style", "pointer-events:none;position:absolute;-webkit-font-smoothing:antialiased;-moz-transform-origin:left top;-moz-transform:scale(" + 1 / rat1 + ");display:block;scale:" + 1 / rat1); this.tempCanvas.setAttribute("style", "pointer-events:none;position:absolute;-webkit-font-smoothing:antialiased;-moz-transform-origin:left top;-moz-transform:scale(" + 1 / rat1 + ");-webkit-transform:scale(" + 1 / rat1 + ");display:block;");
} }
let stageRatio2 = (_a3 = this.stage) == null ? void 0 : _a3.getStageRatio(); let stageRatio2 = (_a3 = this.stage) == null ? void 0 : _a3.getStageRatio();
let tempCanvas = this.tempCanvas; let tempCanvas = this.tempCanvas;
@ -27769,7 +27813,7 @@ to {
let rat1 = this.ddRender.ratio; let rat1 = this.ddRender.ratio;
if (!this.tempCanvas) { if (!this.tempCanvas) {
this.tempCanvas = document.createElement("canvas"); this.tempCanvas = document.createElement("canvas");
this.tempCanvas.setAttribute("style", "pointer-events:none;position:absolute;-webkit-font-smoothing:antialiased;-moz-transform-origin:left top;-moz-transform:scale(" + 1 / rat1 + ");display:block;scale:" + 1 / rat1); this.tempCanvas.setAttribute("style", "pointer-events:none;position:absolute;-webkit-font-smoothing:antialiased;-moz-transform-origin:left top;-moz-transform:scale(" + 1 / rat1 + ");-webkit-transform:scale(" + 1 / rat1 + ");display:block;");
} }
let tempCanvas = this.tempCanvas; let tempCanvas = this.tempCanvas;
let pvs2 = this.model.operatePVS ? this.model.operatePVS : this.model.pvs; let pvs2 = this.model.operatePVS ? this.model.operatePVS : this.model.pvs;
@ -27781,8 +27825,6 @@ to {
outRect.y1 += weight; outRect.y1 += weight;
outRect.width += 2 * weight; outRect.width += 2 * weight;
outRect.height += 2 * weight; outRect.height += 2 * weight;
tempCanvas.style.width = outRect.width;
tempCanvas.style.height = outRect.height;
tempCanvas.setAttribute("width", outRect.width * rat1); tempCanvas.setAttribute("width", outRect.width * rat1);
tempCanvas.setAttribute("height", outRect.height * rat1); tempCanvas.setAttribute("height", outRect.height * rat1);
let tempCtx = tempCanvas.getContext("2d", { willReadFrequently: true }); let tempCtx = tempCanvas.getContext("2d", { willReadFrequently: true });
@ -27911,7 +27953,8 @@ to {
this.tempCanvas.style.zIndex = this.tempZIndex; this.tempCanvas.style.zIndex = this.tempZIndex;
this.tempCanvas.style.left = this.model.cpv.x * stageRatio2 + this.model.stage.wpv.x - this.tempCanvas.offsetWidth / 2 - ruleWeight + "px"; this.tempCanvas.style.left = this.model.cpv.x * stageRatio2 + this.model.stage.wpv.x - this.tempCanvas.offsetWidth / 2 - ruleWeight + "px";
this.tempCanvas.style.top = this.model.cpv.y * stageRatio2 + this.model.stage.wpv.y - this.tempCanvas.offsetHeight / 2 - ruleWeight + "px"; this.tempCanvas.style.top = this.model.cpv.y * stageRatio2 + this.model.stage.wpv.y - this.tempCanvas.offsetHeight / 2 - ruleWeight + "px";
let transform = ""; let rat1 = this.ddRender.ratio;
let transform = " scale(" + 1 / rat1 + ")";
if (this.model.mirrorX) { if (this.model.mirrorX) {
transform += " rotateY(180deg)"; transform += " rotateY(180deg)";
} }
@ -33252,7 +33295,7 @@ to {
const FONTS = []; const FONTS = [];
const loadFonts = function() { const loadFonts = function() {
let fontData = null; let fontData = null;
let fontJSON = localStorage.getItem("DDEI-CACHE-FONT"); let fontJSON = DDeiUtil$1.getLocalStorageData("DDEI-CACHE-FONT");
if (fontJSON) { if (fontJSON) {
fontData = JSON.parse(fontJSON); fontData = JSON.parse(fontJSON);
fontData.forEach((fd) => { fontData.forEach((fd) => {
@ -33270,16 +33313,13 @@ to {
font.isSystemDefault = true; font.isSystemDefault = true;
} }
FONTS.push(font); FONTS.push(font);
localStorage.setItem("DDEI-CACHE-FONT", JSON.stringify(FONTS)); DDeiUtil$1.setLocalStorageData("DDEI-CACHE-FONT", JSON.stringify(FONTS));
} }
}); });
}); });
} }
} }
}; };
setTimeout(() => {
loadFonts();
}, 500);
class DDeiFuncData { class DDeiFuncData {
constructor(name, sort, func) { constructor(name, sort, func) {
__publicField2(this, "name", ""); __publicField2(this, "name", "");
@ -34133,7 +34173,7 @@ to {
var _a3; var _a3;
if (!themeName) { if (!themeName) {
if (this.GLOBAL_LOCAL_CACHE_THEME) { if (this.GLOBAL_LOCAL_CACHE_THEME) {
themeName = localStorage.getItem("ddei-theme-" + this.id); themeName = DDeiUtil$1.getLocalStorageData("ddei-theme-" + this.id);
} }
} }
let finded = false; let finded = false;
@ -34181,9 +34221,9 @@ to {
this.ddInstance.stage.render.refresh = true; this.ddInstance.stage.render.refresh = true;
} }
if (this.GLOBAL_LOCAL_CACHE_THEME) { if (this.GLOBAL_LOCAL_CACHE_THEME) {
let curInsTheme = localStorage.getItem("ddei-theme-" + this.id); let curInsTheme = DDeiUtil$1.getLocalStorageData("ddei-theme-" + this.id);
if (!curInsTheme || curInsTheme != name) { if (!curInsTheme || curInsTheme != name) {
localStorage.setItem("ddei-theme-" + this.id, name); DDeiUtil$1.setLocalStorageData("ddei-theme-" + this.id, name);
} }
} }
} }
@ -34832,7 +34872,7 @@ to {
* 读取最近工具栏 * 读取最近工具栏
*/ */
static readRecentlyToolGroups() { static readRecentlyToolGroups() {
let groups = localStorage.getItem("ddei-recently-tool-groups"); let groups = DDeiUtil$1.getLocalStorageData("ddei-recently-tool-groups");
if (groups) { if (groups) {
try { try {
_DDeiEditorUtil2.recentlyToolGroups = JSON.parse(groups); _DDeiEditorUtil2.recentlyToolGroups = JSON.parse(groups);
@ -34850,7 +34890,7 @@ to {
_DDeiEditorUtil2.recentlyToolGroups.push({ id: group2.id, expand: group2.expand }); _DDeiEditorUtil2.recentlyToolGroups.push({ id: group2.id, expand: group2.expand });
} }
}); });
localStorage.setItem("ddei-recently-tool-groups", JSON.stringify(_DDeiEditorUtil2.recentlyToolGroups)); DDeiUtil$1.setLocalStorageData("ddei-recently-tool-groups", JSON.stringify(_DDeiEditorUtil2.recentlyToolGroups));
} }
/** /**
* 获取线的初始化JSON定义 * 获取线的初始化JSON定义
@ -35717,8 +35757,8 @@ to {
let promiseArr = []; let promiseArr = [];
let ddInstance = editor.ddInstance; let ddInstance = editor.ddInstance;
editor.icons = {}; editor.icons = {};
editor == null ? void 0 : editor.controls.forEach((controlDefine) => { editor.controls.forEach((controlDefine) => {
let cacheData = localStorage.getItem("ICON-CACHE-" + controlDefine.id); let cacheData = DDeiUtil$1.getLocalStorageData("ICON-CACHE-" + controlDefine.id);
if (cacheData) { if (cacheData) {
editor.icons[controlDefine.id] = cacheData; editor.icons[controlDefine.id] = cacheData;
return; return;
@ -35771,7 +35811,7 @@ to {
let canvas = document.createElement("canvas"); let canvas = document.createElement("canvas");
_DDeiEditorUtil2.drawModelsToCanvas(models, outRect, canvas); _DDeiEditorUtil2.drawModelsToCanvas(models, outRect, canvas);
let dataURL = canvas.toDataURL("image/png"); let dataURL = canvas.toDataURL("image/png");
localStorage.setItem("ICON-CACHE-" + controlDefine.id, dataURL); DDeiUtil$1.setLocalStorageData("ICON-CACHE-" + controlDefine.id, dataURL);
editor.icons[controlDefine.id] = dataURL; editor.icons[controlDefine.id] = dataURL;
} catch (e) { } catch (e) {
if (editor.debug) { if (editor.debug) {
@ -35801,7 +35841,7 @@ to {
if ((models == null ? void 0 : models.length) > 0) { if ((models == null ? void 0 : models.length) > 0) {
let stage2 = models[0].stage; let stage2 = models[0].stage;
let rat1 = (_a3 = stage2.ddInstance) == null ? void 0 : _a3.render.ratio; let rat1 = (_a3 = stage2.ddInstance) == null ? void 0 : _a3.render.ratio;
canvas.setAttribute("style", "-webkit-font-smoothing:antialiased;-moz-transform-origin:left top;-moz-transform:scale(" + 1 / rat1 + ");display:block;zoom:" + 1 / rat1); canvas.setAttribute("style", "-webkit-font-smoothing:antialiased;-moz-transform-origin:left top;-moz-transform:scale(" + 1 / rat1 + ");display:block;-webkit-transform:scale(" + 1 / rat1 + ");");
let ctx = canvas.getContext("2d", { willReadFrequently: true }); let ctx = canvas.getContext("2d", { willReadFrequently: true });
let width = (outRect.width + 4) * rat1; let width = (outRect.width + 4) * rat1;
let height = (outRect.height + 4) * rat1; let height = (outRect.height + 4) * rat1;
@ -35854,7 +35894,7 @@ to {
static clearControlIcons(editor) { static clearControlIcons(editor) {
editor.icons = {}; editor.icons = {};
editor == null ? void 0 : editor.controls.forEach((controlDefine) => { editor == null ? void 0 : editor.controls.forEach((controlDefine) => {
localStorage.removeItem("ICON-CACHE-" + controlDefine.id); DDeiUtil$1.removeLocalStorageData("ICON-CACHE-" + controlDefine.id);
}); });
} }
/** /**
@ -37936,6 +37976,7 @@ to {
} }
}); });
bus.executeAll(); bus.executeAll();
DDeiUtil$1.invokeCallbackFunc("EVENT_CONTENT_CHANGE_AFTER", "CHANGE", null, bus.ddInstance);
} }
} }
return true; return true;
@ -40619,7 +40660,7 @@ to {
* @returns * @returns
*/ */
static newInstance() { static newInstance() {
return new DDeiEditorCommandFileDirty({ code: DDeiEditorEnumBusCommandType.RefreshEditorParts, name: "", desc: "" }); return new DDeiEditorCommandFileDirty({ code: DDeiEditorEnumBusCommandType.FileDirty, name: "", desc: "" });
} }
} }
const __vite_glob_0_3$4 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ const __vite_glob_0_3$4 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
@ -47814,7 +47855,7 @@ to {
} }
let cachePos = null; let cachePos = null;
if (((_f = this.options) == null ? void 0 : _f.drag) == 1) { if (((_f = this.options) == null ? void 0 : _f.drag) == 1) {
cachePos = localStorage.getItem("pos-" + this.editor.id + "-ddei-core-panel-toolbox-simple"); cachePos = DDeiUtil.getLocalStorageData("pos-" + this.editor.id + "-ddei-core-panel-toolbox-simple");
} }
if (!cachePos) { if (!cachePos) {
switch ((_g = this.options) == null ? void 0 : _g.position) { switch ((_g = this.options) == null ? void 0 : _g.position) {
@ -48087,7 +48128,7 @@ to {
boxDragEnd(e) { boxDragEnd(e) {
if (this.editor.dragPart) { if (this.editor.dragPart) {
let posJson = { left: this.$refs["toolbox"].offsetLeft, top: this.$refs["toolbox"].offsetTop }; let posJson = { left: this.$refs["toolbox"].offsetLeft, top: this.$refs["toolbox"].offsetTop };
localStorage.setItem("pos-" + this.editor.id + "-ddei-core-panel-toolbox-simple", JSON.stringify(posJson)); DDeiUtil.setLocalStorageData("pos-" + this.editor.id + "-ddei-core-panel-toolbox-simple", JSON.stringify(posJson));
this.$refs["toolbox"].style.userSelect = ""; this.$refs["toolbox"].style.userSelect = "";
this.$refs["toolbox"].style.pointerEvents = ""; this.$refs["toolbox"].style.pointerEvents = "";
this.$refs["toolbox"].children[0].style.backgroundColor = ""; this.$refs["toolbox"].children[0].style.backgroundColor = "";
@ -48141,7 +48182,7 @@ to {
} }
} }
}; };
const ToolboxSimple_vue_vue_type_style_index_0_scoped_bd214554_lang = ""; const ToolboxSimple_vue_vue_type_style_index_0_scoped_a92a1427_lang = "";
const _hoisted_1$W = ["title", "onMouseenter", "onMousedown", "onClick"]; const _hoisted_1$W = ["title", "onMouseenter", "onMousedown", "onClick"];
const _hoisted_2$G = ["innerHTML"]; const _hoisted_2$G = ["innerHTML"];
const _hoisted_3$D = ["src"]; const _hoisted_3$D = ["src"];
@ -48192,7 +48233,7 @@ to {
_cache[2] || (_cache[2] = vue.createElementVNode("div", { class: "item-block" }, null, -1)) _cache[2] || (_cache[2] = vue.createElementVNode("div", { class: "item-block" }, null, -1))
], 544)) : vue.createCommentVNode("", true); ], 544)) : vue.createCommentVNode("", true);
} }
const ToolboxSimple = /* @__PURE__ */ _export_sfc(_sfc_main$W, [["render", _sfc_render$W], ["__scopeId", "data-v-bd214554"]]); const ToolboxSimple = /* @__PURE__ */ _export_sfc(_sfc_main$W, [["render", _sfc_render$W], ["__scopeId", "data-v-a92a1427"]]);
const _DDeiCoreToolboxSimplePanel = class _DDeiCoreToolboxSimplePanel extends DDeiPluginBase { const _DDeiCoreToolboxSimplePanel = class _DDeiCoreToolboxSimplePanel extends DDeiPluginBase {
constructor() { constructor() {
super(...arguments); super(...arguments);
@ -48566,7 +48607,7 @@ to {
} }
let cachePos = null; let cachePos = null;
if (((_f = this.options) == null ? void 0 : _f.drag) == 1) { if (((_f = this.options) == null ? void 0 : _f.drag) == 1) {
cachePos = localStorage.getItem("pos-" + this.editor.id + "-ddei-core-panel-topmenu-simple"); cachePos = DDeiUtil.getLocalStorageData("pos-" + this.editor.id + "-ddei-core-panel-topmenu-simple");
} }
if (!cachePos) { if (!cachePos) {
switch ((_g = this.options) == null ? void 0 : _g.position) { switch ((_g = this.options) == null ? void 0 : _g.position) {
@ -48675,7 +48716,7 @@ to {
boxDragEnd(e) { boxDragEnd(e) {
if (this.editor.dragPart) { if (this.editor.dragPart) {
let posJson = { left: this.$refs["topmenu"].offsetLeft, top: this.$refs["topmenu"].offsetTop }; let posJson = { left: this.$refs["topmenu"].offsetLeft, top: this.$refs["topmenu"].offsetTop };
localStorage.setItem("pos-" + this.editor.id + "-ddei-core-panel-topmenu-simple", JSON.stringify(posJson)); DDeiUtil.setLocalStorageData("pos-" + this.editor.id + "-ddei-core-panel-topmenu-simple", JSON.stringify(posJson));
this.$refs["topmenu"].style.userSelect = ""; this.$refs["topmenu"].style.userSelect = "";
this.$refs["topmenu"].style.pointerEvents = ""; this.$refs["topmenu"].style.pointerEvents = "";
this.$refs["topmenu"].children[0].style.backgroundColor = ""; this.$refs["topmenu"].children[0].style.backgroundColor = "";
@ -48692,7 +48733,7 @@ to {
} }
} }
}; };
const TopMenuSimple_vue_vue_type_style_index_0_scoped_52f75ccc_lang = ""; const TopMenuSimple_vue_vue_type_style_index_0_scoped_62fb5b38_lang = "";
const _hoisted_1$V = { class: "item" }; const _hoisted_1$V = { class: "item" };
const _hoisted_2$F = ["onClick"]; const _hoisted_2$F = ["onClick"];
const _hoisted_3$C = ["onClick"]; const _hoisted_3$C = ["onClick"];
@ -48751,7 +48792,7 @@ to {
_cache[6] || (_cache[6] = vue.createElementVNode("div", { class: "item-block" }, null, -1)) _cache[6] || (_cache[6] = vue.createElementVNode("div", { class: "item-block" }, null, -1))
], 544)) : vue.createCommentVNode("", true); ], 544)) : vue.createCommentVNode("", true);
} }
const TopMenuSimple = /* @__PURE__ */ _export_sfc(_sfc_main$V, [["render", _sfc_render$V], ["__scopeId", "data-v-52f75ccc"]]); const TopMenuSimple = /* @__PURE__ */ _export_sfc(_sfc_main$V, [["render", _sfc_render$V], ["__scopeId", "data-v-62fb5b38"]]);
const _DDeiCoreTopMenuSimplePanel = class _DDeiCoreTopMenuSimplePanel extends DDeiPluginBase { const _DDeiCoreTopMenuSimplePanel = class _DDeiCoreTopMenuSimplePanel extends DDeiPluginBase {
constructor() { constructor() {
super(...arguments); super(...arguments);
@ -62659,6 +62700,7 @@ to {
ddInstance.bus.push(DDeiEnumBusCommandType.RefreshShape, null, evt); ddInstance.bus.push(DDeiEnumBusCommandType.RefreshShape, null, evt);
ddInstance.bus.push(DDeiEditorEnumBusCommandType.RefreshEditorParts); ddInstance.bus.push(DDeiEditorEnumBusCommandType.RefreshEditorParts);
ddInstance.bus.executeAll(); ddInstance.bus.executeAll();
DDeiEditorUtil.invokeCallbackFunc("EVENT_CONTENT_CHANGE_AFTER", "CHANGE", null, ddInstance);
return true; return true;
} }
} }
@ -62757,6 +62799,7 @@ to {
ddInstance2.bus.push(DDeiEnumBusCommandType.RefreshShape); ddInstance2.bus.push(DDeiEnumBusCommandType.RefreshShape);
ddInstance2.bus.push(DDeiEditorEnumBusCommandType.RefreshEditorParts); ddInstance2.bus.push(DDeiEditorEnumBusCommandType.RefreshEditorParts);
ddInstance2.bus.executeAll(); ddInstance2.bus.executeAll();
DDeiEditorUtil.invokeCallbackFunc("EVENT_CONTENT_CHANGE_AFTER", "CHANGE", null, ddInstance2);
return true; return true;
} }
} }
@ -73632,6 +73675,7 @@ to {
} }
delete control.attrs; delete control.attrs;
}); });
loadFonts();
DDeiEditorUtil.ICONS = ICONS; DDeiEditorUtil.ICONS = ICONS;
}, },
mounted() { mounted() {
@ -73703,6 +73747,7 @@ to {
}); });
}, },
changeFileModifyDirty() { changeFileModifyDirty() {
DDeiUtil.invokeCallbackFunc("EVENT_CONTENT_CHANGE_AFTER", "CHANGE", null, this.editor.ddInstance);
let action = DDeiEditorCommandFileDirty.newInstance(); let action = DDeiEditorCommandFileDirty.newInstance();
return action.action( return action.action(
{ state: DDeiFileState.MODIFY }, { state: DDeiFileState.MODIFY },
@ -84102,6 +84147,7 @@ Body`,
exports.loadControlByFrom = loadControlByFrom; exports.loadControlByFrom = loadControlByFrom;
exports.loadControlDefineComposes = loadControlDefineComposes; exports.loadControlDefineComposes = loadControlDefineComposes;
exports.loadControlDefineExt = loadControlDefineExt; exports.loadControlDefineExt = loadControlDefineExt;
exports.loadFonts = loadFonts;
exports.merge = merge$1; exports.merge = merge$1;
exports.ov_link_h_split_point = ov_link_h_split_point; exports.ov_link_h_split_point = ov_link_h_split_point;
exports.ov_link_v_split_point = ov_link_v_split_point; exports.ov_link_v_split_point = ov_link_v_split_point;

12
package-lock.json generated
View File

@ -1,19 +1,19 @@
{ {
"name": "ddei-editor", "name": "ddei-editor",
"version": "1.2.44-6", "version": "1.2.44-15",
"lockfileVersion": 3, "lockfileVersion": 3,
"requires": true, "requires": true,
"packages": { "packages": {
"": { "": {
"name": "ddei-editor", "name": "ddei-editor",
"version": "1.2.44-6", "version": "1.2.44-15",
"license": "Apache License 2.0", "license": "Apache License 2.0",
"devDependencies": { "devDependencies": {
"@tsconfig/node18": "^18.2.0", "@tsconfig/node18": "^18.2.0",
"@types/node": "^18.17.6", "@types/node": "^18.17.6",
"@vitejs/plugin-vue": "^4.2.3", "@vitejs/plugin-vue": "^4.2.3",
"@vue/tsconfig": "^0.4.0", "@vue/tsconfig": "^0.4.0",
"ddei-framework": "file:///Users/hoslay/work/ddei/ddei-framework/ddei-framework-1.2.44-6.tgz", "ddei-framework": "file:///Users/hoslay/work/ddei/ddei-framework/ddei-framework-1.2.44-15.tgz",
"less": "^4.2.0", "less": "^4.2.0",
"npm-run-all": "^4.1.5", "npm-run-all": "^4.1.5",
"typescript": "~5.1.6", "typescript": "~5.1.6",
@ -496,9 +496,9 @@
} }
}, },
"node_modules/ddei-framework": { "node_modules/ddei-framework": {
"version": "1.2.44-6", "version": "1.2.44-15",
"resolved": "file:../ddei-framework/ddei-framework-1.2.44-6.tgz", "resolved": "file:../ddei-framework/ddei-framework-1.2.44-15.tgz",
"integrity": "sha512-kL6KIOHpGbWpB5btCoB6gR5O5mxcJ5bZVr1KKU56Lzh1RgUdDyKSN176m+IjGtrThz0GbN6OsnyehuqrCqavAg==", "integrity": "sha512-vmYiQB8gMCHB2IRTikmHOHUAEPKodq60y+3mnBUANsov4ANh2wuHvnFN8DkW0Y3jhGGIXKs2hYihb63miEvqoA==",
"dev": true, "dev": true,
"license": "Apache License 2.0", "license": "Apache License 2.0",
"engines": { "engines": {

View File

@ -1,6 +1,6 @@
{ {
"name": "ddei-editor", "name": "ddei-editor",
"version": "1.2.44-6", "version": "1.2.44-15",
"private": false, "private": false,
"type": "module", "type": "module",
"author": "hoslay <3697355039@qq.com>", "author": "hoslay <3697355039@qq.com>",
@ -63,6 +63,6 @@
"vite": "^4.4.6", "vite": "^4.4.6",
"vite-plugin-compression": "^0.5.1", "vite-plugin-compression": "^0.5.1",
"vue-tsc": "^1.8.6", "vue-tsc": "^1.8.6",
"ddei-framework": "file:///Users/hoslay/work/ddei/ddei-framework/ddei-framework-1.2.44-6.tgz" "ddei-framework": "file:///Users/hoslay/work/ddei/ddei-framework/ddei-framework-1.2.44-15.tgz"
} }
} }

View File

@ -122,7 +122,7 @@ export default {
// //
let cachePos = null; let cachePos = null;
if (this.options?.drag == 1) { if (this.options?.drag == 1) {
cachePos = localStorage.getItem("pos-" + this.editor.id + "-ddei-core-panel-toolbox-simple") cachePos = DDeiUtil.getLocalStorageData("pos-" + this.editor.id + "-ddei-core-panel-toolbox-simple")
} }
if (!cachePos) { if (!cachePos) {
// //
@ -430,7 +430,7 @@ export default {
boxDragEnd(e) { boxDragEnd(e) {
if (this.editor.dragPart) { if (this.editor.dragPart) {
let posJson = { left: this.$refs['toolbox'].offsetLeft, top: this.$refs['toolbox'].offsetTop} let posJson = { left: this.$refs['toolbox'].offsetLeft, top: this.$refs['toolbox'].offsetTop}
localStorage.setItem("pos-" + this.editor.id + "-ddei-core-panel-toolbox-simple", JSON.stringify(posJson)) DDeiUtil.setLocalStorageData("pos-" + this.editor.id + "-ddei-core-panel-toolbox-simple", JSON.stringify(posJson))
this.$refs['toolbox'].style.userSelect = ""; this.$refs['toolbox'].style.userSelect = "";
this.$refs['toolbox'].style.pointerEvents = ""; this.$refs['toolbox'].style.pointerEvents = "";
this.$refs['toolbox'].children[0].style.backgroundColor = ""; this.$refs['toolbox'].children[0].style.backgroundColor = "";

View File

@ -366,7 +366,7 @@ export default {
// //
let cachePos = null; let cachePos = null;
if (this.options?.drag == 1) { if (this.options?.drag == 1) {
cachePos = localStorage.getItem("pos-" + this.editor.id + "-ddei-core-panel-topmenu-simple") cachePos = DDeiUtil.getLocalStorageData("pos-" + this.editor.id + "-ddei-core-panel-topmenu-simple")
} }
if (!cachePos) { if (!cachePos) {
// //
@ -485,7 +485,7 @@ export default {
boxDragEnd(e) { boxDragEnd(e) {
if (this.editor.dragPart) { if (this.editor.dragPart) {
let posJson = { left: this.$refs['topmenu'].offsetLeft, top: this.$refs['topmenu'].offsetTop} let posJson = { left: this.$refs['topmenu'].offsetLeft, top: this.$refs['topmenu'].offsetTop}
localStorage.setItem("pos-" + this.editor.id + "-ddei-core-panel-topmenu-simple", JSON.stringify(posJson)) DDeiUtil.setLocalStorageData("pos-" + this.editor.id + "-ddei-core-panel-topmenu-simple", JSON.stringify(posJson))
this.$refs['topmenu'].style.userSelect = ""; this.$refs['topmenu'].style.userSelect = "";
this.$refs['topmenu'].style.pointerEvents = ""; this.$refs['topmenu'].style.pointerEvents = "";
this.$refs['topmenu'].children[0].style.backgroundColor = ""; this.$refs['topmenu'].children[0].style.backgroundColor = "";

View File

@ -21,7 +21,7 @@ export default defineComponent({
data() { data() {
const options = markRaw({ const options = markRaw({
// currentLayout: "ddei-core-layout-simple", currentLayout: "ddei-core-layout-simple",
config: { config: {
// ratio: 1.2, //120% // ratio: 1.2, //120%
pixel:2, // pixel:2, //

View File

@ -26,6 +26,7 @@ import DDeiCore from "@ddei/core";
import { loadControlByFrom, loadAndSortGroup, loadControlDefineExt } from "./grouputil"; import { loadControlByFrom, loadAndSortGroup, loadControlDefineExt } from "./grouputil";
import ICONS from "./icon"; import ICONS from "./icon";
import { loadFonts } from "ddei-framework";
import { markRaw } from "vue"; import { markRaw } from "vue";
import { getCurrentInstance, render,createVNode } from "vue" import { getCurrentInstance, render,createVNode } from "vue"
import '@/assets/ddei.css' import '@/assets/ddei.css'
@ -179,6 +180,7 @@ export default {
// } // }
delete control.attrs delete control.attrs
}) })
loadFonts();
DDeiEditorUtil.ICONS = ICONS; DDeiEditorUtil.ICONS = ICONS;
}, },