@idraw/core 0.3.0-beta.3 → 0.3.0-beta.7
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/esm/index.d.ts +44 -44
- package/dist/esm/index.js +85 -80
- package/dist/esm/lib/calculate.d.ts +3 -3
- package/dist/esm/lib/calculate.js +5 -5
- package/dist/esm/lib/check.d.ts +4 -4
- package/dist/esm/lib/check.js +1 -1
- package/dist/esm/lib/config.d.ts +2 -2
- package/dist/esm/lib/core-event.d.ts +21 -21
- package/dist/esm/lib/diff.d.ts +6 -6
- package/dist/esm/lib/diff.js +9 -7
- package/dist/esm/lib/draw/base.d.ts +5 -5
- package/dist/esm/lib/draw/wrapper.d.ts +4 -4
- package/dist/esm/lib/element.d.ts +8 -8
- package/dist/esm/lib/element.js +15 -11
- package/dist/esm/lib/engine-temp.d.ts +4 -4
- package/dist/esm/lib/engine.d.ts +5 -5
- package/dist/esm/lib/helper.d.ts +12 -12
- package/dist/esm/lib/is.d.ts +3 -3
- package/dist/esm/lib/mapper.d.ts +4 -4
- package/dist/esm/lib/parse.d.ts +2 -2
- package/dist/esm/lib/parse.js +6 -3
- package/dist/esm/lib/transform.d.ts +4 -4
- package/dist/esm/lib/transform.js +1 -1
- package/dist/esm/mixins/element.d.ts +12 -14
- package/dist/esm/mixins/element.js +60 -62
- package/dist/esm/plugins/helper.d.ts +7 -7
- package/dist/esm/plugins/helper.js +5 -10
- package/dist/index.global.js +400 -439
- package/dist/index.global.min.js +1 -1
- package/package.json +6 -6
- package/dist/esm/lib/element/element-base.d.ts +0 -3
- package/dist/esm/lib/element/element-base.js +0 -5
- package/dist/esm/lib/element/element-controller.d.ts +0 -3
- package/dist/esm/lib/element/element-controller.js +0 -3
- package/dist/esm/lib/element/element-hub.d.ts +0 -9
- package/dist/esm/lib/element/element-hub.js +0 -16
- package/dist/esm/names.d.ts +0 -15
- package/dist/esm/names.js +0 -15
package/dist/index.global.js
CHANGED
|
@@ -141,8 +141,8 @@ var iDrawCore = function() {
|
|
|
141
141
|
const reader = new FileReader();
|
|
142
142
|
reader.readAsDataURL(blob);
|
|
143
143
|
reader.onload = function(event) {
|
|
144
|
-
var
|
|
145
|
-
const base64 = (
|
|
144
|
+
var _a;
|
|
145
|
+
const base64 = (_a = event === null || event === void 0 ? void 0 : event.target) === null || _a === void 0 ? void 0 : _a.result;
|
|
146
146
|
resolve(base64);
|
|
147
147
|
};
|
|
148
148
|
reader.onerror = function(err) {
|
|
@@ -157,8 +157,8 @@ var iDrawCore = function() {
|
|
|
157
157
|
const reader = new FileReader();
|
|
158
158
|
reader.readAsDataURL(blob);
|
|
159
159
|
reader.onload = function(event) {
|
|
160
|
-
var
|
|
161
|
-
const base64 = (
|
|
160
|
+
var _a;
|
|
161
|
+
const base64 = (_a = event === null || event === void 0 ? void 0 : event.target) === null || _a === void 0 ? void 0 : _a.result;
|
|
162
162
|
resolve(base64);
|
|
163
163
|
};
|
|
164
164
|
reader.onerror = function(err) {
|
|
@@ -1074,14 +1074,14 @@ var iDrawCore = function() {
|
|
|
1074
1074
|
return num * this._opts.devicePixelRatio;
|
|
1075
1075
|
}
|
|
1076
1076
|
_getOpts(opts) {
|
|
1077
|
-
var
|
|
1077
|
+
var _a;
|
|
1078
1078
|
const options = Object.assign(Object.assign({}, opts), {
|
|
1079
1079
|
scrollConfig: Object.assign(Object.assign({}, defaultScrollConfig), opts.scrollConfig || {})
|
|
1080
1080
|
});
|
|
1081
1081
|
if (!options.scrollConfig) {
|
|
1082
1082
|
options.scrollConfig = defaultScrollConfig;
|
|
1083
1083
|
}
|
|
1084
|
-
if (!(((
|
|
1084
|
+
if (!(((_a = options === null || options === void 0 ? void 0 : options.scrollConfig) === null || _a === void 0 ? void 0 : _a.width) > 0)) {
|
|
1085
1085
|
options.scrollConfig.width = defaultScrollConfig.width;
|
|
1086
1086
|
}
|
|
1087
1087
|
options.scrollConfig.width = Math.max(options.scrollConfig.width, defaultScrollConfig.width);
|
|
@@ -1128,63 +1128,63 @@ var iDrawCore = function() {
|
|
|
1128
1128
|
ctx.closePath();
|
|
1129
1129
|
ctx.stroke();
|
|
1130
1130
|
}
|
|
1131
|
-
const _opts$
|
|
1132
|
-
const _ctx
|
|
1131
|
+
const _opts$1 = Symbol("_opts");
|
|
1132
|
+
const _ctx = Symbol("_ctx");
|
|
1133
1133
|
class Screen {
|
|
1134
1134
|
constructor(ctx, opts) {
|
|
1135
|
-
this[_opts$
|
|
1136
|
-
this[_ctx
|
|
1135
|
+
this[_opts$1] = opts;
|
|
1136
|
+
this[_ctx] = ctx;
|
|
1137
1137
|
}
|
|
1138
1138
|
resetSize(opts) {
|
|
1139
|
-
this[_opts$
|
|
1139
|
+
this[_opts$1] = Object.assign(Object.assign({}, this[_opts$1]), opts);
|
|
1140
1140
|
}
|
|
1141
1141
|
calcScreen() {
|
|
1142
|
-
const scaleRatio = this[_ctx
|
|
1143
|
-
const { width, height, contextWidth, contextHeight, devicePixelRatio: pxRatio } = this[_opts$
|
|
1142
|
+
const scaleRatio = this[_ctx].getTransform().scale;
|
|
1143
|
+
const { width, height, contextWidth, contextHeight, devicePixelRatio: pxRatio } = this[_opts$1];
|
|
1144
1144
|
let canScrollXPrev = true;
|
|
1145
1145
|
let canScrollXNext = true;
|
|
1146
1146
|
let canScrollYPrev = true;
|
|
1147
1147
|
let canScrollYNext = true;
|
|
1148
1148
|
if (contextWidth * scaleRatio <= width) {
|
|
1149
|
-
this[_ctx
|
|
1149
|
+
this[_ctx].setTransform({
|
|
1150
1150
|
scrollX: (width - contextWidth * scaleRatio) / 2
|
|
1151
1151
|
});
|
|
1152
1152
|
canScrollXPrev = false;
|
|
1153
1153
|
canScrollXNext = false;
|
|
1154
1154
|
}
|
|
1155
1155
|
if (contextHeight * scaleRatio <= height) {
|
|
1156
|
-
this[_ctx
|
|
1156
|
+
this[_ctx].setTransform({
|
|
1157
1157
|
scrollY: (height - contextHeight * scaleRatio) / 2
|
|
1158
1158
|
});
|
|
1159
1159
|
canScrollYPrev = false;
|
|
1160
1160
|
canScrollYNext = false;
|
|
1161
1161
|
}
|
|
1162
|
-
if (contextWidth * scaleRatio >= width && this[_ctx
|
|
1163
|
-
this[_ctx
|
|
1162
|
+
if (contextWidth * scaleRatio >= width && this[_ctx].getTransform().scrollX > 0) {
|
|
1163
|
+
this[_ctx].setTransform({
|
|
1164
1164
|
scrollX: 0
|
|
1165
1165
|
});
|
|
1166
1166
|
canScrollXPrev = false;
|
|
1167
1167
|
}
|
|
1168
|
-
if (contextHeight * scaleRatio >= height && this[_ctx
|
|
1169
|
-
this[_ctx
|
|
1168
|
+
if (contextHeight * scaleRatio >= height && this[_ctx].getTransform().scrollY > 0) {
|
|
1169
|
+
this[_ctx].setTransform({
|
|
1170
1170
|
scrollY: 0
|
|
1171
1171
|
});
|
|
1172
1172
|
canScrollYPrev = false;
|
|
1173
1173
|
}
|
|
1174
|
-
const { scrollX: _scrollX, scrollY: _scrollY } = this[_ctx
|
|
1174
|
+
const { scrollX: _scrollX, scrollY: _scrollY } = this[_ctx].getTransform();
|
|
1175
1175
|
if (_scrollX < 0 && Math.abs(_scrollX) > Math.abs(contextWidth * scaleRatio - width)) {
|
|
1176
|
-
this[_ctx
|
|
1176
|
+
this[_ctx].setTransform({
|
|
1177
1177
|
scrollX: 0 - Math.abs(contextWidth * scaleRatio - width)
|
|
1178
1178
|
});
|
|
1179
1179
|
canScrollXNext = false;
|
|
1180
1180
|
}
|
|
1181
1181
|
if (_scrollY < 0 && Math.abs(_scrollY) > Math.abs(contextHeight * scaleRatio - height)) {
|
|
1182
|
-
this[_ctx
|
|
1182
|
+
this[_ctx].setTransform({
|
|
1183
1183
|
scrollY: 0 - Math.abs(contextHeight * scaleRatio - height)
|
|
1184
1184
|
});
|
|
1185
1185
|
canScrollYNext = false;
|
|
1186
1186
|
}
|
|
1187
|
-
const { scrollX, scrollY } = this[_ctx
|
|
1187
|
+
const { scrollX, scrollY } = this[_ctx].getTransform();
|
|
1188
1188
|
const size = {
|
|
1189
1189
|
x: scrollX * scaleRatio,
|
|
1190
1190
|
y: scrollY * scaleRatio,
|
|
@@ -1207,9 +1207,9 @@ var iDrawCore = function() {
|
|
|
1207
1207
|
size,
|
|
1208
1208
|
position,
|
|
1209
1209
|
deviceSize,
|
|
1210
|
-
width: this[_opts$
|
|
1211
|
-
height: this[_opts$
|
|
1212
|
-
devicePixelRatio: this[_opts$
|
|
1210
|
+
width: this[_opts$1].width,
|
|
1211
|
+
height: this[_opts$1].height,
|
|
1212
|
+
devicePixelRatio: this[_opts$1].devicePixelRatio,
|
|
1213
1213
|
canScrollYPrev,
|
|
1214
1214
|
canScrollYNext,
|
|
1215
1215
|
canScrollXPrev,
|
|
@@ -1230,86 +1230,67 @@ var iDrawCore = function() {
|
|
|
1230
1230
|
return scrollDistance;
|
|
1231
1231
|
}
|
|
1232
1232
|
}
|
|
1233
|
-
const _canvas = Symbol("_canvas");
|
|
1234
|
-
const _displayCanvas = Symbol("_displayCanvas");
|
|
1235
|
-
const _helperCanvas = Symbol("_helperCanvas");
|
|
1236
|
-
const _mount = Symbol("_mount");
|
|
1237
|
-
const _opts$3 = Symbol("_opts");
|
|
1238
|
-
const _hasRendered = Symbol("_hasRendered");
|
|
1239
|
-
const _ctx$1 = Symbol("_ctx");
|
|
1240
|
-
const _helperCtx = Symbol("_helperCtx");
|
|
1241
|
-
const _watcher = Symbol("_watcher");
|
|
1242
|
-
const _render = Symbol("_render");
|
|
1243
|
-
const _parsePrivateOptions = Symbol("_parsePrivateOptions");
|
|
1244
|
-
const _scroller = Symbol("_scroller");
|
|
1245
|
-
const _initEvent = Symbol("_initEvent");
|
|
1246
|
-
const _doScrollX = Symbol("_doScrollX");
|
|
1247
|
-
const _doScrollY = Symbol("_doScrollY");
|
|
1248
|
-
const _doMoveScroll = Symbol("_doMoveScroll");
|
|
1249
|
-
const _resetContext = Symbol("_resetContext");
|
|
1250
|
-
const _screen = Symbol("_screen");
|
|
1251
|
-
var _a$2;
|
|
1252
1233
|
const { throttle, Context } = util;
|
|
1253
1234
|
class Board {
|
|
1254
1235
|
constructor(mount, opts) {
|
|
1255
|
-
this
|
|
1256
|
-
this
|
|
1257
|
-
this
|
|
1258
|
-
this
|
|
1259
|
-
this
|
|
1260
|
-
this
|
|
1261
|
-
this
|
|
1262
|
-
const originCtx2d = this
|
|
1263
|
-
const displayCtx2d = this
|
|
1264
|
-
const helperCtx2d = this
|
|
1265
|
-
this
|
|
1266
|
-
this
|
|
1267
|
-
this
|
|
1268
|
-
this
|
|
1269
|
-
this
|
|
1236
|
+
this._hasRendered = false;
|
|
1237
|
+
this._mount = mount;
|
|
1238
|
+
this._canvas = document.createElement("canvas");
|
|
1239
|
+
this._helperCanvas = document.createElement("canvas");
|
|
1240
|
+
this._displayCanvas = document.createElement("canvas");
|
|
1241
|
+
this._mount.appendChild(this._displayCanvas);
|
|
1242
|
+
this._opts = this._parsePrivateOptions(opts);
|
|
1243
|
+
const originCtx2d = this._canvas.getContext("2d");
|
|
1244
|
+
const displayCtx2d = this._displayCanvas.getContext("2d");
|
|
1245
|
+
const helperCtx2d = this._helperCanvas.getContext("2d");
|
|
1246
|
+
this._ctx = new Context(originCtx2d, this._opts);
|
|
1247
|
+
this._helperCtx = new Context(helperCtx2d, this._opts);
|
|
1248
|
+
this._screen = new Screen(this._ctx, this._opts);
|
|
1249
|
+
this._watcher = new ScreenWatcher(this._displayCanvas, this._ctx);
|
|
1250
|
+
this._scroller = new Scroller(displayCtx2d, {
|
|
1270
1251
|
width: opts.width,
|
|
1271
1252
|
height: opts.height,
|
|
1272
1253
|
devicePixelRatio: opts.devicePixelRatio || 1,
|
|
1273
1254
|
scrollConfig: opts.scrollConfig
|
|
1274
1255
|
});
|
|
1275
|
-
this
|
|
1256
|
+
this._render();
|
|
1276
1257
|
}
|
|
1277
1258
|
getDisplayContext2D() {
|
|
1278
|
-
return this
|
|
1259
|
+
return this._displayCanvas.getContext("2d");
|
|
1279
1260
|
}
|
|
1280
1261
|
getOriginContext2D() {
|
|
1281
|
-
return this
|
|
1262
|
+
return this._ctx.getContext();
|
|
1282
1263
|
}
|
|
1283
1264
|
getHelperContext2D() {
|
|
1284
|
-
return this
|
|
1265
|
+
return this._helperCtx.getContext();
|
|
1285
1266
|
}
|
|
1286
1267
|
getContext() {
|
|
1287
|
-
return this
|
|
1268
|
+
return this._ctx;
|
|
1288
1269
|
}
|
|
1289
1270
|
getHelperContext() {
|
|
1290
|
-
return this
|
|
1271
|
+
return this._helperCtx;
|
|
1291
1272
|
}
|
|
1292
1273
|
scale(scaleRatio) {
|
|
1293
1274
|
if (scaleRatio > 0) {
|
|
1294
|
-
this
|
|
1295
|
-
this
|
|
1275
|
+
this._ctx.setTransform({ scale: scaleRatio });
|
|
1276
|
+
this._helperCtx.setTransform({ scale: scaleRatio });
|
|
1296
1277
|
}
|
|
1297
|
-
const { position, size } = this
|
|
1278
|
+
const { position, size } = this._screen.calcScreen();
|
|
1298
1279
|
return { position, size };
|
|
1299
1280
|
}
|
|
1300
1281
|
scrollX(x2) {
|
|
1301
|
-
this
|
|
1282
|
+
this._watcher.setStatusMap({
|
|
1302
1283
|
canScrollYPrev: true,
|
|
1303
1284
|
canScrollYNext: true,
|
|
1304
1285
|
canScrollXPrev: true,
|
|
1305
1286
|
canScrollXNext: true
|
|
1306
1287
|
});
|
|
1307
1288
|
if (x2 >= 0 || x2 < 0) {
|
|
1308
|
-
this
|
|
1309
|
-
this
|
|
1289
|
+
this._ctx.setTransform({ scrollX: x2 });
|
|
1290
|
+
this._helperCtx.setTransform({ scrollX: x2 });
|
|
1310
1291
|
}
|
|
1311
|
-
const { position, size, canScrollXNext, canScrollYNext, canScrollXPrev, canScrollYPrev } = this
|
|
1312
|
-
this
|
|
1292
|
+
const { position, size, canScrollXNext, canScrollYNext, canScrollXPrev, canScrollYPrev } = this._screen.calcScreen();
|
|
1293
|
+
this._watcher.setStatusMap({
|
|
1313
1294
|
canScrollYPrev,
|
|
1314
1295
|
canScrollYNext,
|
|
1315
1296
|
canScrollXPrev,
|
|
@@ -1318,18 +1299,18 @@ var iDrawCore = function() {
|
|
|
1318
1299
|
return { position, size };
|
|
1319
1300
|
}
|
|
1320
1301
|
scrollY(y2) {
|
|
1321
|
-
this
|
|
1302
|
+
this._watcher.setStatusMap({
|
|
1322
1303
|
canScrollYPrev: true,
|
|
1323
1304
|
canScrollYNext: true,
|
|
1324
1305
|
canScrollXPrev: true,
|
|
1325
1306
|
canScrollXNext: true
|
|
1326
1307
|
});
|
|
1327
1308
|
if (y2 >= 0 || y2 < 0) {
|
|
1328
|
-
this
|
|
1329
|
-
this
|
|
1309
|
+
this._ctx.setTransform({ scrollY: y2 });
|
|
1310
|
+
this._helperCtx.setTransform({ scrollY: y2 });
|
|
1330
1311
|
}
|
|
1331
|
-
const { position, size, canScrollXNext, canScrollYNext, canScrollXPrev, canScrollYPrev } = this
|
|
1332
|
-
this
|
|
1312
|
+
const { position, size, canScrollXNext, canScrollYNext, canScrollXPrev, canScrollYPrev } = this._screen.calcScreen();
|
|
1313
|
+
this._watcher.setStatusMap({
|
|
1333
1314
|
canScrollYPrev,
|
|
1334
1315
|
canScrollYNext,
|
|
1335
1316
|
canScrollXPrev,
|
|
@@ -1338,55 +1319,55 @@ var iDrawCore = function() {
|
|
|
1338
1319
|
return { position, size };
|
|
1339
1320
|
}
|
|
1340
1321
|
getTransform() {
|
|
1341
|
-
return this
|
|
1322
|
+
return this._ctx.getTransform();
|
|
1342
1323
|
}
|
|
1343
1324
|
draw() {
|
|
1344
1325
|
this.clear();
|
|
1345
|
-
const { position, deviceSize, size } = this
|
|
1346
|
-
const displayCtx = this
|
|
1347
|
-
displayCtx === null || displayCtx === void 0 ? void 0 : displayCtx.drawImage(this
|
|
1348
|
-
displayCtx === null || displayCtx === void 0 ? void 0 : displayCtx.drawImage(this
|
|
1349
|
-
if (this
|
|
1350
|
-
this
|
|
1326
|
+
const { position, deviceSize, size } = this._screen.calcScreen();
|
|
1327
|
+
const displayCtx = this._displayCanvas.getContext("2d");
|
|
1328
|
+
displayCtx === null || displayCtx === void 0 ? void 0 : displayCtx.drawImage(this._canvas, deviceSize.x, deviceSize.y, deviceSize.w, deviceSize.h);
|
|
1329
|
+
displayCtx === null || displayCtx === void 0 ? void 0 : displayCtx.drawImage(this._helperCanvas, deviceSize.x, deviceSize.y, deviceSize.w, deviceSize.h);
|
|
1330
|
+
if (this._opts.canScroll === true) {
|
|
1331
|
+
this._scroller.draw(position);
|
|
1351
1332
|
}
|
|
1352
1333
|
return { position, size };
|
|
1353
1334
|
}
|
|
1354
1335
|
clear() {
|
|
1355
|
-
const displayCtx = this
|
|
1356
|
-
displayCtx === null || displayCtx === void 0 ? void 0 : displayCtx.clearRect(0, 0, this
|
|
1336
|
+
const displayCtx = this._displayCanvas.getContext("2d");
|
|
1337
|
+
displayCtx === null || displayCtx === void 0 ? void 0 : displayCtx.clearRect(0, 0, this._displayCanvas.width, this._displayCanvas.height);
|
|
1357
1338
|
}
|
|
1358
1339
|
on(name, callback) {
|
|
1359
|
-
this
|
|
1340
|
+
this._watcher.on(name, callback);
|
|
1360
1341
|
}
|
|
1361
1342
|
off(name, callback) {
|
|
1362
|
-
this
|
|
1343
|
+
this._watcher.off(name, callback);
|
|
1363
1344
|
}
|
|
1364
1345
|
getScreenInfo() {
|
|
1365
|
-
return this
|
|
1346
|
+
return this._screen.calcScreen();
|
|
1366
1347
|
}
|
|
1367
1348
|
setCursor(cursor) {
|
|
1368
|
-
this
|
|
1349
|
+
this._displayCanvas.style.cursor = cursor;
|
|
1369
1350
|
}
|
|
1370
1351
|
resetCursor() {
|
|
1371
|
-
this
|
|
1352
|
+
this._displayCanvas.style.cursor = "auto";
|
|
1372
1353
|
}
|
|
1373
1354
|
resetSize(opts) {
|
|
1374
|
-
this
|
|
1375
|
-
this
|
|
1376
|
-
this
|
|
1377
|
-
this
|
|
1378
|
-
this
|
|
1379
|
-
this
|
|
1380
|
-
width: this
|
|
1381
|
-
height: this
|
|
1382
|
-
devicePixelRatio: this
|
|
1355
|
+
this._opts = Object.assign(Object.assign({}, this._opts), opts);
|
|
1356
|
+
this._resetContext();
|
|
1357
|
+
this._ctx.resetSize(opts);
|
|
1358
|
+
this._helperCtx.resetSize(opts);
|
|
1359
|
+
this._screen.resetSize(opts);
|
|
1360
|
+
this._scroller.resetSize({
|
|
1361
|
+
width: this._opts.width,
|
|
1362
|
+
height: this._opts.height,
|
|
1363
|
+
devicePixelRatio: this._opts.devicePixelRatio
|
|
1383
1364
|
});
|
|
1384
1365
|
this.draw();
|
|
1385
1366
|
}
|
|
1386
1367
|
getScrollLineWidth() {
|
|
1387
1368
|
let lineWidth = 0;
|
|
1388
|
-
if (this
|
|
1389
|
-
lineWidth = this
|
|
1369
|
+
if (this._opts.canScroll === true) {
|
|
1370
|
+
lineWidth = this._scroller.getLineWidth();
|
|
1390
1371
|
}
|
|
1391
1372
|
return lineWidth;
|
|
1392
1373
|
}
|
|
@@ -1406,99 +1387,99 @@ var iDrawCore = function() {
|
|
|
1406
1387
|
};
|
|
1407
1388
|
return screenPoint;
|
|
1408
1389
|
}
|
|
1409
|
-
|
|
1410
|
-
if (this
|
|
1390
|
+
_render() {
|
|
1391
|
+
if (this._hasRendered === true) {
|
|
1411
1392
|
return;
|
|
1412
1393
|
}
|
|
1413
|
-
this
|
|
1414
|
-
this
|
|
1415
|
-
this
|
|
1416
|
-
}
|
|
1417
|
-
|
|
1418
|
-
const { width, height, contextWidth, contextHeight, devicePixelRatio } = this
|
|
1419
|
-
this
|
|
1420
|
-
this
|
|
1421
|
-
this
|
|
1422
|
-
this
|
|
1423
|
-
this
|
|
1424
|
-
this
|
|
1425
|
-
setStyle(this
|
|
1394
|
+
this._resetContext();
|
|
1395
|
+
this._initEvent();
|
|
1396
|
+
this._hasRendered = true;
|
|
1397
|
+
}
|
|
1398
|
+
_resetContext() {
|
|
1399
|
+
const { width, height, contextWidth, contextHeight, devicePixelRatio } = this._opts;
|
|
1400
|
+
this._canvas.width = contextWidth * devicePixelRatio;
|
|
1401
|
+
this._canvas.height = contextHeight * devicePixelRatio;
|
|
1402
|
+
this._helperCanvas.width = contextWidth * devicePixelRatio;
|
|
1403
|
+
this._helperCanvas.height = contextHeight * devicePixelRatio;
|
|
1404
|
+
this._displayCanvas.width = width * devicePixelRatio;
|
|
1405
|
+
this._displayCanvas.height = height * devicePixelRatio;
|
|
1406
|
+
setStyle(this._displayCanvas, {
|
|
1426
1407
|
width: `${width}px`,
|
|
1427
1408
|
height: `${height}px`
|
|
1428
1409
|
});
|
|
1429
1410
|
}
|
|
1430
|
-
|
|
1411
|
+
_parsePrivateOptions(opts) {
|
|
1431
1412
|
const defaultOpts = {
|
|
1432
1413
|
devicePixelRatio: 1
|
|
1433
1414
|
};
|
|
1434
1415
|
return Object.assign(Object.assign({}, defaultOpts), opts);
|
|
1435
1416
|
}
|
|
1436
|
-
|
|
1437
|
-
if (this
|
|
1417
|
+
_initEvent() {
|
|
1418
|
+
if (this._hasRendered === true) {
|
|
1438
1419
|
return;
|
|
1439
1420
|
}
|
|
1440
|
-
if (this
|
|
1421
|
+
if (this._opts.canScroll === true) {
|
|
1441
1422
|
this.on("wheelX", throttle((deltaX) => {
|
|
1442
|
-
this
|
|
1423
|
+
this._doScrollX(deltaX);
|
|
1443
1424
|
}, 16));
|
|
1444
1425
|
this.on("wheelY", throttle((deltaY) => {
|
|
1445
|
-
this
|
|
1426
|
+
this._doScrollY(deltaY);
|
|
1446
1427
|
}, 16));
|
|
1447
1428
|
let scrollType = null;
|
|
1448
1429
|
this.on("moveStart", throttle((p) => {
|
|
1449
|
-
if (this
|
|
1430
|
+
if (this._scroller.isPointAtScrollX(p)) {
|
|
1450
1431
|
scrollType = "x";
|
|
1451
|
-
} else if (this
|
|
1432
|
+
} else if (this._scroller.isPointAtScrollY(p)) {
|
|
1452
1433
|
scrollType = "y";
|
|
1453
1434
|
}
|
|
1454
1435
|
}, 16));
|
|
1455
1436
|
this.on("move", throttle((p) => {
|
|
1456
1437
|
if (scrollType) {
|
|
1457
|
-
this
|
|
1438
|
+
this._doMoveScroll(scrollType, p);
|
|
1458
1439
|
}
|
|
1459
1440
|
}, 16));
|
|
1460
1441
|
this.on("moveEnd", throttle((p) => {
|
|
1461
1442
|
if (scrollType) {
|
|
1462
|
-
this
|
|
1443
|
+
this._doMoveScroll(scrollType, p);
|
|
1463
1444
|
}
|
|
1464
1445
|
scrollType = null;
|
|
1465
1446
|
}, 16));
|
|
1466
1447
|
}
|
|
1467
1448
|
}
|
|
1468
|
-
|
|
1469
|
-
const { width } = this
|
|
1449
|
+
_doScrollX(dx, prevScrollX) {
|
|
1450
|
+
const { width } = this._opts;
|
|
1470
1451
|
let scrollX = prevScrollX;
|
|
1471
1452
|
if (!(typeof scrollX === "number" && (scrollX > 0 || scrollX <= 0))) {
|
|
1472
|
-
scrollX = this
|
|
1453
|
+
scrollX = this._ctx.getTransform().scrollX;
|
|
1473
1454
|
}
|
|
1474
|
-
const { position } = this
|
|
1475
|
-
const { xSize } = this
|
|
1476
|
-
const moveX = this
|
|
1455
|
+
const { position } = this._screen.calcScreen();
|
|
1456
|
+
const { xSize } = this._scroller.calc(position);
|
|
1457
|
+
const moveX = this._screen.calcScreenScroll(position.left, position.right, xSize, width, dx);
|
|
1477
1458
|
this.scrollX(scrollX + moveX);
|
|
1478
1459
|
this.draw();
|
|
1479
1460
|
}
|
|
1480
|
-
|
|
1481
|
-
const { height } = this
|
|
1461
|
+
_doScrollY(dy, prevScrollY) {
|
|
1462
|
+
const { height } = this._opts;
|
|
1482
1463
|
let scrollY = prevScrollY;
|
|
1483
1464
|
if (!(typeof scrollY === "number" && (scrollY > 0 || scrollY <= 0))) {
|
|
1484
|
-
scrollY = this
|
|
1465
|
+
scrollY = this._ctx.getTransform().scrollY;
|
|
1485
1466
|
}
|
|
1486
|
-
const { position } = this
|
|
1487
|
-
const { ySize } = this
|
|
1488
|
-
const moveY = this
|
|
1467
|
+
const { position } = this._screen.calcScreen();
|
|
1468
|
+
const { ySize } = this._scroller.calc(position);
|
|
1469
|
+
const moveY = this._screen.calcScreenScroll(position.top, position.bottom, ySize, height, dy);
|
|
1489
1470
|
this.scrollY(scrollY + moveY);
|
|
1490
1471
|
this.draw();
|
|
1491
1472
|
}
|
|
1492
|
-
|
|
1473
|
+
_doMoveScroll(scrollType, point) {
|
|
1493
1474
|
if (!scrollType) {
|
|
1494
1475
|
return;
|
|
1495
1476
|
}
|
|
1496
|
-
const { position } = this
|
|
1497
|
-
const { xSize, ySize } = this
|
|
1477
|
+
const { position } = this._screen.calcScreen();
|
|
1478
|
+
const { xSize, ySize } = this._scroller.calc(position);
|
|
1498
1479
|
if (scrollType === "x") {
|
|
1499
|
-
this
|
|
1480
|
+
this._doScrollX(point.x - xSize / 2, 0);
|
|
1500
1481
|
} else if (scrollType === "y") {
|
|
1501
|
-
this
|
|
1482
|
+
this._doScrollY(point.y - ySize / 2, 0);
|
|
1502
1483
|
}
|
|
1503
1484
|
}
|
|
1504
1485
|
}
|
|
@@ -1783,7 +1764,7 @@ var iDrawCore = function() {
|
|
|
1783
1764
|
});
|
|
1784
1765
|
}
|
|
1785
1766
|
function drawContext(ctx, data, loader) {
|
|
1786
|
-
var
|
|
1767
|
+
var _a;
|
|
1787
1768
|
clearContext$1(ctx);
|
|
1788
1769
|
const size = ctx.getSize();
|
|
1789
1770
|
ctx.clearRect(0, 0, size.contextWidth, size.contextHeight);
|
|
@@ -1795,7 +1776,7 @@ var iDrawCore = function() {
|
|
|
1795
1776
|
}
|
|
1796
1777
|
for (let i = 0; i < data.elements.length; i++) {
|
|
1797
1778
|
const elem = data.elements[i];
|
|
1798
|
-
if (((
|
|
1779
|
+
if (((_a = elem === null || elem === void 0 ? void 0 : elem.operation) === null || _a === void 0 ? void 0 : _a.invisible) === true) {
|
|
1799
1780
|
continue;
|
|
1800
1781
|
}
|
|
1801
1782
|
switch (elem.type) {
|
|
@@ -1944,8 +1925,8 @@ var iDrawCore = function() {
|
|
|
1944
1925
|
return this._status === LoaderStatus.COMPLETE;
|
|
1945
1926
|
}
|
|
1946
1927
|
getContent(uuid) {
|
|
1947
|
-
var
|
|
1948
|
-
if (((
|
|
1928
|
+
var _a;
|
|
1929
|
+
if (((_a = this._storageLoadData[uuid]) === null || _a === void 0 ? void 0 : _a.status) === "loaded") {
|
|
1949
1930
|
return this._storageLoadData[uuid].content;
|
|
1950
1931
|
}
|
|
1951
1932
|
return null;
|
|
@@ -2036,7 +2017,7 @@ var iDrawCore = function() {
|
|
|
2036
2017
|
}
|
|
2037
2018
|
loadUUIDList.push(uuid);
|
|
2038
2019
|
this._loadElementSource(this._currentLoadData[uuid]).then((image) => {
|
|
2039
|
-
var
|
|
2020
|
+
var _a, _b;
|
|
2040
2021
|
loadUUIDList.splice(loadUUIDList.indexOf(uuid), 1);
|
|
2041
2022
|
const status = _loadAction();
|
|
2042
2023
|
this._storageLoadData[uuid] = {
|
|
@@ -2054,29 +2035,29 @@ var iDrawCore = function() {
|
|
|
2054
2035
|
this._loadTask();
|
|
2055
2036
|
}
|
|
2056
2037
|
this._event.trigger("load", {
|
|
2057
|
-
uuid: (
|
|
2038
|
+
uuid: (_a = this._storageLoadData[uuid]) === null || _a === void 0 ? void 0 : _a.uuid,
|
|
2058
2039
|
type: this._storageLoadData[uuid].type,
|
|
2059
2040
|
status: this._storageLoadData[uuid].status,
|
|
2060
2041
|
content: this._storageLoadData[uuid].content,
|
|
2061
2042
|
source: this._storageLoadData[uuid].source,
|
|
2062
2043
|
elemW: this._storageLoadData[uuid].elemW,
|
|
2063
2044
|
elemH: this._storageLoadData[uuid].elemH,
|
|
2064
|
-
element: (
|
|
2045
|
+
element: (_b = this._storageLoadData[uuid]) === null || _b === void 0 ? void 0 : _b.element
|
|
2065
2046
|
});
|
|
2066
2047
|
}).catch((err) => {
|
|
2067
|
-
var
|
|
2048
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
|
|
2068
2049
|
console.warn(err);
|
|
2069
2050
|
loadUUIDList.splice(loadUUIDList.indexOf(uuid), 1);
|
|
2070
2051
|
const status = _loadAction();
|
|
2071
2052
|
if (this._currentLoadData[uuid]) {
|
|
2072
2053
|
this._storageLoadData[uuid] = {
|
|
2073
2054
|
uuid,
|
|
2074
|
-
type: (
|
|
2055
|
+
type: (_a = this._currentLoadData[uuid]) === null || _a === void 0 ? void 0 : _a.type,
|
|
2075
2056
|
status: "fail",
|
|
2076
2057
|
content: null,
|
|
2077
2058
|
error: err,
|
|
2078
|
-
source: (
|
|
2079
|
-
elemW: (
|
|
2059
|
+
source: (_b = this._currentLoadData[uuid]) === null || _b === void 0 ? void 0 : _b.source,
|
|
2060
|
+
elemW: (_c = this._currentLoadData[uuid]) === null || _c === void 0 ? void 0 : _c.elemW,
|
|
2080
2061
|
elemH: (_d = this._currentLoadData[uuid]) === null || _d === void 0 ? void 0 : _d.elemH,
|
|
2081
2062
|
element: (_e = this._currentLoadData[uuid]) === null || _e === void 0 ? void 0 : _e.element
|
|
2082
2063
|
};
|
|
@@ -2170,15 +2151,6 @@ var iDrawCore = function() {
|
|
|
2170
2151
|
return false;
|
|
2171
2152
|
}
|
|
2172
2153
|
}
|
|
2173
|
-
const _queue = Symbol("_queue");
|
|
2174
|
-
const _ctx = Symbol("_ctx");
|
|
2175
|
-
const _status = Symbol("_status");
|
|
2176
|
-
const _loader = Symbol("_loader");
|
|
2177
|
-
const _opts$2 = Symbol("_opts");
|
|
2178
|
-
const _freeze = Symbol("_freeze");
|
|
2179
|
-
const _drawFrame = Symbol("_drawFrame");
|
|
2180
|
-
const _retainQueueOneItem = Symbol("_retainQueueOneItem");
|
|
2181
|
-
var _a$1, _b$1, _c;
|
|
2182
2154
|
const { requestAnimationFrame } = window;
|
|
2183
2155
|
var DrawStatus;
|
|
2184
2156
|
(function(DrawStatus2) {
|
|
@@ -2190,27 +2162,27 @@ var iDrawCore = function() {
|
|
|
2190
2162
|
class Renderer extends RendererEvent {
|
|
2191
2163
|
constructor(opts) {
|
|
2192
2164
|
super();
|
|
2193
|
-
this
|
|
2194
|
-
this
|
|
2195
|
-
this
|
|
2196
|
-
this
|
|
2197
|
-
this
|
|
2165
|
+
this._queue = [];
|
|
2166
|
+
this._ctx = null;
|
|
2167
|
+
this._status = DrawStatus.NULL;
|
|
2168
|
+
this._opts = opts;
|
|
2169
|
+
this._loader = new Loader({
|
|
2198
2170
|
maxParallelNum: 6
|
|
2199
2171
|
});
|
|
2200
|
-
this
|
|
2201
|
-
this
|
|
2172
|
+
this._loader.on("load", (res) => {
|
|
2173
|
+
this._drawFrame();
|
|
2202
2174
|
this.trigger("load", { element: res.element });
|
|
2203
2175
|
});
|
|
2204
|
-
this
|
|
2176
|
+
this._loader.on("error", (res) => {
|
|
2205
2177
|
this.trigger("error", { element: res.element, error: res.error });
|
|
2206
2178
|
});
|
|
2207
|
-
this
|
|
2179
|
+
this._loader.on("complete", () => {
|
|
2208
2180
|
this.trigger("loadComplete", { t: Date.now() });
|
|
2209
2181
|
});
|
|
2210
2182
|
}
|
|
2211
2183
|
render(target, originData, opts) {
|
|
2212
2184
|
const { changeResourceUUIDs = [] } = opts || {};
|
|
2213
|
-
this
|
|
2185
|
+
this._status = DrawStatus.FREE;
|
|
2214
2186
|
const data = deepClone(originData);
|
|
2215
2187
|
if (Array.isArray(data.elements)) {
|
|
2216
2188
|
data.elements.forEach((elem) => {
|
|
@@ -2219,14 +2191,14 @@ var iDrawCore = function() {
|
|
|
2219
2191
|
}
|
|
2220
2192
|
});
|
|
2221
2193
|
}
|
|
2222
|
-
if (!this
|
|
2223
|
-
if (this
|
|
2224
|
-
const { width, height, contextWidth, contextHeight, devicePixelRatio } = this
|
|
2194
|
+
if (!this._ctx) {
|
|
2195
|
+
if (this._opts && Object.prototype.toString.call(target) === "[object HTMLCanvasElement]") {
|
|
2196
|
+
const { width, height, contextWidth, contextHeight, devicePixelRatio } = this._opts;
|
|
2225
2197
|
const canvas = target;
|
|
2226
2198
|
canvas.width = width * devicePixelRatio;
|
|
2227
2199
|
canvas.height = height * devicePixelRatio;
|
|
2228
2200
|
const ctx2d = canvas.getContext("2d");
|
|
2229
|
-
this
|
|
2201
|
+
this._ctx = new Context$1(ctx2d, {
|
|
2230
2202
|
width,
|
|
2231
2203
|
height,
|
|
2232
2204
|
contextWidth: contextWidth || width,
|
|
@@ -2234,74 +2206,74 @@ var iDrawCore = function() {
|
|
|
2234
2206
|
devicePixelRatio
|
|
2235
2207
|
});
|
|
2236
2208
|
} else if (target) {
|
|
2237
|
-
this
|
|
2209
|
+
this._ctx = target;
|
|
2238
2210
|
}
|
|
2239
2211
|
}
|
|
2240
|
-
if ([DrawStatus.FREEZE].includes(this
|
|
2212
|
+
if ([DrawStatus.FREEZE].includes(this._status)) {
|
|
2241
2213
|
return;
|
|
2242
2214
|
}
|
|
2243
|
-
const
|
|
2244
|
-
this
|
|
2245
|
-
this
|
|
2246
|
-
this
|
|
2215
|
+
const _data = deepClone({ data });
|
|
2216
|
+
this._queue.push(_data);
|
|
2217
|
+
this._drawFrame();
|
|
2218
|
+
this._loader.load(data, changeResourceUUIDs || []);
|
|
2247
2219
|
}
|
|
2248
2220
|
getContext() {
|
|
2249
|
-
return this
|
|
2221
|
+
return this._ctx;
|
|
2250
2222
|
}
|
|
2251
2223
|
thaw() {
|
|
2252
|
-
this
|
|
2224
|
+
this._status = DrawStatus.FREE;
|
|
2253
2225
|
}
|
|
2254
|
-
|
|
2255
|
-
this
|
|
2226
|
+
_freeze() {
|
|
2227
|
+
this._status = DrawStatus.FREEZE;
|
|
2256
2228
|
}
|
|
2257
|
-
|
|
2258
|
-
if (this
|
|
2229
|
+
_drawFrame() {
|
|
2230
|
+
if (this._status === DrawStatus.FREEZE) {
|
|
2259
2231
|
return;
|
|
2260
2232
|
}
|
|
2261
2233
|
requestAnimationFrame(() => {
|
|
2262
|
-
if (this
|
|
2234
|
+
if (this._status === DrawStatus.FREEZE) {
|
|
2263
2235
|
return;
|
|
2264
2236
|
}
|
|
2265
|
-
const ctx = this
|
|
2266
|
-
let item = this
|
|
2237
|
+
const ctx = this._ctx;
|
|
2238
|
+
let item = this._queue[0];
|
|
2267
2239
|
let isLastFrame = false;
|
|
2268
|
-
if (this
|
|
2269
|
-
item = this
|
|
2240
|
+
if (this._queue.length > 1) {
|
|
2241
|
+
item = this._queue.shift();
|
|
2270
2242
|
} else {
|
|
2271
2243
|
isLastFrame = true;
|
|
2272
2244
|
}
|
|
2273
|
-
if (this
|
|
2274
|
-
this
|
|
2245
|
+
if (this._loader.isComplete() !== true) {
|
|
2246
|
+
this._drawFrame();
|
|
2275
2247
|
if (item && ctx) {
|
|
2276
|
-
drawContext(ctx, item.data, this
|
|
2248
|
+
drawContext(ctx, item.data, this._loader);
|
|
2277
2249
|
}
|
|
2278
2250
|
} else if (item && ctx) {
|
|
2279
|
-
drawContext(ctx, item.data, this
|
|
2280
|
-
this
|
|
2251
|
+
drawContext(ctx, item.data, this._loader);
|
|
2252
|
+
this._retainQueueOneItem();
|
|
2281
2253
|
if (!isLastFrame) {
|
|
2282
|
-
this
|
|
2254
|
+
this._drawFrame();
|
|
2283
2255
|
} else {
|
|
2284
|
-
this
|
|
2256
|
+
this._status = DrawStatus.FREE;
|
|
2285
2257
|
}
|
|
2286
2258
|
} else {
|
|
2287
|
-
this
|
|
2259
|
+
this._status = DrawStatus.FREE;
|
|
2288
2260
|
}
|
|
2289
2261
|
this.trigger("drawFrame", { t: Date.now() });
|
|
2290
|
-
if (this
|
|
2291
|
-
if (ctx && this
|
|
2292
|
-
drawContext(ctx, this
|
|
2262
|
+
if (this._loader.isComplete() === true && this._queue.length === 1 && this._status === DrawStatus.FREE) {
|
|
2263
|
+
if (ctx && this._queue[0] && this._queue[0].data) {
|
|
2264
|
+
drawContext(ctx, this._queue[0].data, this._loader);
|
|
2293
2265
|
}
|
|
2294
2266
|
this.trigger("drawFrameComplete", { t: Date.now() });
|
|
2295
|
-
this
|
|
2267
|
+
this._freeze();
|
|
2296
2268
|
}
|
|
2297
2269
|
});
|
|
2298
2270
|
}
|
|
2299
|
-
|
|
2300
|
-
if (this
|
|
2271
|
+
_retainQueueOneItem() {
|
|
2272
|
+
if (this._queue.length <= 1) {
|
|
2301
2273
|
return;
|
|
2302
2274
|
}
|
|
2303
|
-
const lastOne = deepClone(this
|
|
2304
|
-
this
|
|
2275
|
+
const lastOne = deepClone(this._queue[this._queue.length - 1]);
|
|
2276
|
+
this._queue = [lastOne];
|
|
2305
2277
|
}
|
|
2306
2278
|
}
|
|
2307
2279
|
function number(value) {
|
|
@@ -2648,16 +2620,16 @@ var iDrawCore = function() {
|
|
|
2648
2620
|
}
|
|
2649
2621
|
}
|
|
2650
2622
|
function isChangeImageElementResource(before, after) {
|
|
2651
|
-
var
|
|
2652
|
-
return ((
|
|
2623
|
+
var _a, _b;
|
|
2624
|
+
return ((_a = before == null ? void 0 : before.desc) == null ? void 0 : _a.src) !== ((_b = after == null ? void 0 : after.desc) == null ? void 0 : _b.src);
|
|
2653
2625
|
}
|
|
2654
2626
|
function isChangeSVGElementResource(before, after) {
|
|
2655
|
-
var
|
|
2656
|
-
return ((
|
|
2627
|
+
var _a, _b;
|
|
2628
|
+
return ((_a = before == null ? void 0 : before.desc) == null ? void 0 : _a.svg) !== ((_b = after == null ? void 0 : after.desc) == null ? void 0 : _b.svg);
|
|
2657
2629
|
}
|
|
2658
2630
|
function isChangeHTMLElementResource(before, after) {
|
|
2659
|
-
var
|
|
2660
|
-
return ((
|
|
2631
|
+
var _a, _b, _c, _d, _e, _f;
|
|
2632
|
+
return ((_a = before == null ? void 0 : before.desc) == null ? void 0 : _a.html) !== ((_b = after == null ? void 0 : after.desc) == null ? void 0 : _b.html) || ((_c = before == null ? void 0 : before.desc) == null ? void 0 : _c.width) !== ((_d = after == null ? void 0 : after.desc) == null ? void 0 : _d.width) || ((_e = before == null ? void 0 : before.desc) == null ? void 0 : _e.height) !== ((_f = after == null ? void 0 : after.desc) == null ? void 0 : _f.height);
|
|
2661
2633
|
}
|
|
2662
2634
|
function diffElementResourceChange(before, after) {
|
|
2663
2635
|
let result = null;
|
|
@@ -2691,12 +2663,12 @@ var iDrawCore = function() {
|
|
|
2691
2663
|
return result;
|
|
2692
2664
|
}
|
|
2693
2665
|
function diffElementResourceChangeList(before, after) {
|
|
2694
|
-
var
|
|
2666
|
+
var _a;
|
|
2695
2667
|
const uuids = [];
|
|
2696
2668
|
const beforeMap = parseDataElementMap(before);
|
|
2697
2669
|
const afterMap = parseDataElementMap(after);
|
|
2698
2670
|
for (const uuid in afterMap) {
|
|
2699
|
-
if (["image", "svg", "html"].includes((
|
|
2671
|
+
if (["image", "svg", "html"].includes((_a = afterMap[uuid]) == null ? void 0 : _a.type) !== true) {
|
|
2700
2672
|
continue;
|
|
2701
2673
|
}
|
|
2702
2674
|
if (beforeMap[uuid]) {
|
|
@@ -2795,16 +2767,16 @@ var iDrawCore = function() {
|
|
|
2795
2767
|
return data;
|
|
2796
2768
|
}
|
|
2797
2769
|
isPointInElement(p, data) {
|
|
2798
|
-
var
|
|
2770
|
+
var _a, _b;
|
|
2799
2771
|
const ctx = this._ctx;
|
|
2800
2772
|
let idx = -1;
|
|
2801
2773
|
let uuid = null;
|
|
2802
2774
|
for (let i = data.elements.length - 1; i >= 0; i--) {
|
|
2803
2775
|
const ele = data.elements[i];
|
|
2804
|
-
if (((
|
|
2776
|
+
if (((_a = ele.operation) == null ? void 0 : _a.invisible) === true)
|
|
2805
2777
|
continue;
|
|
2806
2778
|
let bw = 0;
|
|
2807
|
-
if (((
|
|
2779
|
+
if (((_b = ele.desc) == null ? void 0 : _b.borderWidth) > 0) {
|
|
2808
2780
|
bw = ele.desc.borderWidth;
|
|
2809
2781
|
}
|
|
2810
2782
|
rotateElement(ctx, ele, () => {
|
|
@@ -2838,12 +2810,12 @@ var iDrawCore = function() {
|
|
|
2838
2810
|
this.limitElementAttrs(data.elements[index]);
|
|
2839
2811
|
}
|
|
2840
2812
|
transformElement(data, uuid, point, prevPoint, scale, direction) {
|
|
2841
|
-
var
|
|
2813
|
+
var _a, _b;
|
|
2842
2814
|
const index = this.getElementIndex(data, uuid);
|
|
2843
2815
|
if (!data.elements[index]) {
|
|
2844
2816
|
return null;
|
|
2845
2817
|
}
|
|
2846
|
-
if (((
|
|
2818
|
+
if (((_b = (_a = data.elements[index]) == null ? void 0 : _a.operation) == null ? void 0 : _b.lock) === true) {
|
|
2847
2819
|
return null;
|
|
2848
2820
|
}
|
|
2849
2821
|
const moveX = (point.x - prevPoint.x) / scale;
|
|
@@ -2894,11 +2866,11 @@ var iDrawCore = function() {
|
|
|
2894
2866
|
elem.angle = limitAngle(elem.angle || 0);
|
|
2895
2867
|
}
|
|
2896
2868
|
}
|
|
2897
|
-
function calcuScaleElemPosition(elem, moveX, moveY, direction
|
|
2898
|
-
var
|
|
2869
|
+
function calcuScaleElemPosition(elem, moveX, moveY, direction) {
|
|
2870
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m;
|
|
2899
2871
|
const p = { x: elem.x, y: elem.y, w: elem.w, h: elem.h };
|
|
2900
|
-
elem.angle;
|
|
2901
|
-
if (((
|
|
2872
|
+
elem.angle || 0;
|
|
2873
|
+
if (((_a = elem.operation) == null ? void 0 : _a.limitRatio) === true) {
|
|
2902
2874
|
if (["top-left", "top-right", "bottom-right", "bottom-left"].includes(
|
|
2903
2875
|
direction
|
|
2904
2876
|
)) {
|
|
@@ -2918,16 +2890,16 @@ var iDrawCore = function() {
|
|
|
2918
2890
|
break;
|
|
2919
2891
|
}
|
|
2920
2892
|
case "top": {
|
|
2921
|
-
if (elem.angle === 0 || Math.abs(elem.angle) < limitQbliqueAngle$1) {
|
|
2893
|
+
if (elem.angle === 0 || Math.abs(elem.angle || 0) < limitQbliqueAngle$1) {
|
|
2922
2894
|
if (p.h - moveY > 0) {
|
|
2923
2895
|
p.y += moveY;
|
|
2924
2896
|
p.h -= moveY;
|
|
2925
|
-
if (((
|
|
2897
|
+
if (((_b = elem.operation) == null ? void 0 : _b.limitRatio) === true) {
|
|
2926
2898
|
p.x += moveY / elem.h * elem.w / 2;
|
|
2927
2899
|
p.w -= moveY / elem.h * elem.w;
|
|
2928
2900
|
}
|
|
2929
2901
|
}
|
|
2930
|
-
} else if (elem.angle > 0 || elem.angle < 0) {
|
|
2902
|
+
} else if (elem.angle !== void 0 && (elem.angle > 0 || elem.angle < 0)) {
|
|
2931
2903
|
const angle2 = elem.angle > 0 ? elem.angle : Math.max(0, elem.angle + 360);
|
|
2932
2904
|
let moveDist = calcMoveDist(moveX, moveY);
|
|
2933
2905
|
let centerX = p.x + elem.w / 2;
|
|
@@ -2958,7 +2930,7 @@ var iDrawCore = function() {
|
|
|
2958
2930
|
centerY = centerY - centerMoveDist * Math.sin(radian);
|
|
2959
2931
|
}
|
|
2960
2932
|
if (p.h + moveDist > 0) {
|
|
2961
|
-
if (((
|
|
2933
|
+
if (((_c = elem.operation) == null ? void 0 : _c.limitRatio) === true) {
|
|
2962
2934
|
p.w = p.w + moveDist / elem.h * elem.w;
|
|
2963
2935
|
}
|
|
2964
2936
|
p.h = p.h + moveDist;
|
|
@@ -2986,7 +2958,7 @@ var iDrawCore = function() {
|
|
|
2986
2958
|
break;
|
|
2987
2959
|
}
|
|
2988
2960
|
case "right": {
|
|
2989
|
-
if (elem.angle === 0 || Math.abs(elem.angle) < limitQbliqueAngle$1) {
|
|
2961
|
+
if (elem.angle === 0 || Math.abs(elem.angle || 0) < limitQbliqueAngle$1) {
|
|
2990
2962
|
if (elem.w + moveX > 0) {
|
|
2991
2963
|
p.w += moveX;
|
|
2992
2964
|
if (((_e = elem.operation) == null ? void 0 : _e.limitRatio) === true) {
|
|
@@ -2994,7 +2966,7 @@ var iDrawCore = function() {
|
|
|
2994
2966
|
p.h += moveX * elem.h / elem.w;
|
|
2995
2967
|
}
|
|
2996
2968
|
}
|
|
2997
|
-
} else if (elem.angle > 0 || elem.angle < 0) {
|
|
2969
|
+
} else if (elem.angle !== void 0 && (elem.angle > 0 || elem.angle < 0)) {
|
|
2998
2970
|
const angle2 = elem.angle > 0 ? elem.angle : Math.max(0, elem.angle + 360);
|
|
2999
2971
|
let moveDist = calcMoveDist(moveX, moveY);
|
|
3000
2972
|
let centerX = p.x + elem.w / 2;
|
|
@@ -3052,7 +3024,7 @@ var iDrawCore = function() {
|
|
|
3052
3024
|
break;
|
|
3053
3025
|
}
|
|
3054
3026
|
case "bottom": {
|
|
3055
|
-
if (elem.angle === 0 || Math.abs(elem.angle) < limitQbliqueAngle$1) {
|
|
3027
|
+
if (elem.angle === 0 || Math.abs(elem.angle || 0) < limitQbliqueAngle$1) {
|
|
3056
3028
|
if (elem.h + moveY > 0) {
|
|
3057
3029
|
p.h += moveY;
|
|
3058
3030
|
if (((_h = elem.operation) == null ? void 0 : _h.limitRatio) === true) {
|
|
@@ -3060,7 +3032,7 @@ var iDrawCore = function() {
|
|
|
3060
3032
|
p.w += moveY / elem.h * elem.w;
|
|
3061
3033
|
}
|
|
3062
3034
|
}
|
|
3063
|
-
} else if (elem.angle > 0 || elem.angle < 0) {
|
|
3035
|
+
} else if (elem.angle !== void 0 && (elem.angle > 0 || elem.angle < 0)) {
|
|
3064
3036
|
const angle2 = elem.angle > 0 ? elem.angle : Math.max(0, elem.angle + 360);
|
|
3065
3037
|
let moveDist = calcMoveDist(moveX, moveY);
|
|
3066
3038
|
let centerX = p.x + elem.w / 2;
|
|
@@ -3118,7 +3090,7 @@ var iDrawCore = function() {
|
|
|
3118
3090
|
break;
|
|
3119
3091
|
}
|
|
3120
3092
|
case "left": {
|
|
3121
|
-
if (elem.angle === 0 || Math.abs(elem.angle) < limitQbliqueAngle$1) {
|
|
3093
|
+
if (elem.angle === 0 || Math.abs(elem.angle || 0) < limitQbliqueAngle$1) {
|
|
3122
3094
|
if (elem.w - moveX > 0) {
|
|
3123
3095
|
p.x += moveX;
|
|
3124
3096
|
p.w -= moveX;
|
|
@@ -3127,7 +3099,7 @@ var iDrawCore = function() {
|
|
|
3127
3099
|
p.y += moveX / elem.w * elem.h / 2;
|
|
3128
3100
|
}
|
|
3129
3101
|
}
|
|
3130
|
-
} else if (elem.angle > 0 || elem.angle < 0) {
|
|
3102
|
+
} else if (elem.angle !== void 0 && (elem.angle > 0 || elem.angle < 0)) {
|
|
3131
3103
|
const angle2 = elem.angle > 0 ? elem.angle : Math.max(0, elem.angle + 360);
|
|
3132
3104
|
let moveDist = calcMoveDist(moveX, moveY);
|
|
3133
3105
|
let centerX = p.x + elem.w / 2;
|
|
@@ -3217,9 +3189,9 @@ var iDrawCore = function() {
|
|
|
3217
3189
|
return null;
|
|
3218
3190
|
}
|
|
3219
3191
|
isPointInElementWrapperController(p, data) {
|
|
3220
|
-
var
|
|
3192
|
+
var _a, _b;
|
|
3221
3193
|
const ctx = this._ctx;
|
|
3222
|
-
const uuid = ((
|
|
3194
|
+
const uuid = ((_b = (_a = this._helperConfig) == null ? void 0 : _a.selectedElementWrapper) == null ? void 0 : _b.uuid) || null;
|
|
3223
3195
|
let directIndex = null;
|
|
3224
3196
|
let selectedControllerDirection = null;
|
|
3225
3197
|
let hoverControllerDirection = null;
|
|
@@ -3335,21 +3307,21 @@ var iDrawCore = function() {
|
|
|
3335
3307
|
};
|
|
3336
3308
|
}
|
|
3337
3309
|
isPointInElementList(p, data) {
|
|
3338
|
-
var
|
|
3310
|
+
var _a, _b, _c;
|
|
3339
3311
|
const ctx = this._ctx;
|
|
3340
3312
|
let idx = -1;
|
|
3341
3313
|
let uuid = null;
|
|
3342
|
-
const wrapperList = ((
|
|
3314
|
+
const wrapperList = ((_a = this._helperConfig) == null ? void 0 : _a.selectedElementListWrappers) || [];
|
|
3343
3315
|
for (let i = 0; i < wrapperList.length; i++) {
|
|
3344
3316
|
const wrapper = wrapperList[i];
|
|
3345
3317
|
const elemIdx = this._helperConfig.elementIndexMap[wrapper.uuid];
|
|
3346
3318
|
const ele = data.elements[elemIdx];
|
|
3347
3319
|
if (!ele)
|
|
3348
3320
|
continue;
|
|
3349
|
-
if (((
|
|
3321
|
+
if (((_b = ele.operation) == null ? void 0 : _b.invisible) === true)
|
|
3350
3322
|
continue;
|
|
3351
3323
|
let bw = 0;
|
|
3352
|
-
if (((
|
|
3324
|
+
if (((_c = ele.desc) == null ? void 0 : _c.borderWidth) > 0) {
|
|
3353
3325
|
bw = ele.desc.borderWidth;
|
|
3354
3326
|
}
|
|
3355
3327
|
rotateElement(ctx, ele, () => {
|
|
@@ -3407,8 +3379,8 @@ var iDrawCore = function() {
|
|
|
3407
3379
|
ctx.lineTo(x2, y2);
|
|
3408
3380
|
ctx.closePath();
|
|
3409
3381
|
data.elements.forEach((elem) => {
|
|
3410
|
-
var
|
|
3411
|
-
if (((
|
|
3382
|
+
var _a;
|
|
3383
|
+
if (((_a = elem == null ? void 0 : elem.operation) == null ? void 0 : _a.invisible) !== true) {
|
|
3412
3384
|
const centerX = elem.x + elem.w / 2;
|
|
3413
3385
|
const centerY = elem.y + elem.h / 2;
|
|
3414
3386
|
if (ctx.isPointInPathWithoutScroll(centerX, centerY)) {
|
|
@@ -3445,7 +3417,7 @@ var iDrawCore = function() {
|
|
|
3445
3417
|
});
|
|
3446
3418
|
}
|
|
3447
3419
|
_updateSelectedElementWrapper(data, opts) {
|
|
3448
|
-
var
|
|
3420
|
+
var _a;
|
|
3449
3421
|
const { selectedUUID: uuid } = opts;
|
|
3450
3422
|
if (!(typeof uuid === "string" && this._helperConfig.elementIndexMap[uuid] >= 0)) {
|
|
3451
3423
|
delete this._helperConfig.selectedElementWrapper;
|
|
@@ -3453,7 +3425,7 @@ var iDrawCore = function() {
|
|
|
3453
3425
|
}
|
|
3454
3426
|
const index = this._helperConfig.elementIndexMap[uuid];
|
|
3455
3427
|
const elem = data.elements[index];
|
|
3456
|
-
if (((
|
|
3428
|
+
if (((_a = elem == null ? void 0 : elem.operation) == null ? void 0 : _a.invisible) === true) {
|
|
3457
3429
|
return;
|
|
3458
3430
|
}
|
|
3459
3431
|
const wrapper = this._createSelectedElementWrapper(elem, opts);
|
|
@@ -3471,14 +3443,14 @@ var iDrawCore = function() {
|
|
|
3471
3443
|
this._helperConfig.selectedElementListWrappers = wrapperList;
|
|
3472
3444
|
}
|
|
3473
3445
|
_createSelectedElementWrapper(elem, opts) {
|
|
3474
|
-
var
|
|
3446
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l;
|
|
3475
3447
|
const { scale } = opts;
|
|
3476
3448
|
const elemWrapper = this._coreConfig.elementWrapper;
|
|
3477
3449
|
const controllerSize = elemWrapper.controllerSize / scale;
|
|
3478
3450
|
const lineWidth = elemWrapper.lineWidth / scale;
|
|
3479
3451
|
const lineDash = elemWrapper.lineDash.map((n) => n / scale);
|
|
3480
3452
|
const rotateLimit = 12;
|
|
3481
|
-
const bw = ((
|
|
3453
|
+
const bw = ((_a = elem.desc) == null ? void 0 : _a.borderWidth) || 0;
|
|
3482
3454
|
let hideObliqueDirection = false;
|
|
3483
3455
|
if (typeof elem.angle === "number" && Math.abs(elem.angle) > limitQbliqueAngle) {
|
|
3484
3456
|
hideObliqueDirection = true;
|
|
@@ -3488,12 +3460,12 @@ var iDrawCore = function() {
|
|
|
3488
3460
|
uuid: elem.uuid,
|
|
3489
3461
|
controllerSize,
|
|
3490
3462
|
controllerOffset,
|
|
3491
|
-
lock: ((
|
|
3463
|
+
lock: ((_b = elem == null ? void 0 : elem.operation) == null ? void 0 : _b.lock) === true,
|
|
3492
3464
|
controllers: {
|
|
3493
3465
|
topLeft: {
|
|
3494
3466
|
x: elem.x - controllerOffset - bw,
|
|
3495
3467
|
y: elem.y - controllerOffset - bw,
|
|
3496
|
-
invisible: hideObliqueDirection || ((
|
|
3468
|
+
invisible: hideObliqueDirection || ((_c = elem == null ? void 0 : elem.operation) == null ? void 0 : _c.disableScale) === true
|
|
3497
3469
|
},
|
|
3498
3470
|
top: {
|
|
3499
3471
|
x: elem.x + elem.w / 2,
|
|
@@ -3547,20 +3519,20 @@ var iDrawCore = function() {
|
|
|
3547
3519
|
return wrapper;
|
|
3548
3520
|
}
|
|
3549
3521
|
}
|
|
3550
|
-
const _board
|
|
3522
|
+
const _board = Symbol("_displayCtx");
|
|
3551
3523
|
const _helper = Symbol("_helper");
|
|
3552
|
-
const _element
|
|
3553
|
-
const _opts
|
|
3524
|
+
const _element = Symbol("_element");
|
|
3525
|
+
const _opts = Symbol("_opts");
|
|
3554
3526
|
class Mapper {
|
|
3555
3527
|
constructor(opts) {
|
|
3556
|
-
this[_opts
|
|
3557
|
-
this[_board
|
|
3558
|
-
this[_element
|
|
3559
|
-
this[_helper] = this[_opts
|
|
3528
|
+
this[_opts] = opts;
|
|
3529
|
+
this[_board] = this[_opts].board;
|
|
3530
|
+
this[_element] = this[_opts].element;
|
|
3531
|
+
this[_helper] = this[_opts].helper;
|
|
3560
3532
|
}
|
|
3561
3533
|
isEffectivePoint(p) {
|
|
3562
|
-
const scrollLineWidth = this[_board
|
|
3563
|
-
const screenInfo = this[_board
|
|
3534
|
+
const scrollLineWidth = this[_board].getScrollLineWidth();
|
|
3535
|
+
const screenInfo = this[_board].getScreenInfo();
|
|
3564
3536
|
if (p.x <= screenInfo.width - scrollLineWidth && p.y <= screenInfo.height - scrollLineWidth) {
|
|
3565
3537
|
return true;
|
|
3566
3538
|
}
|
|
@@ -3617,7 +3589,7 @@ var iDrawCore = function() {
|
|
|
3617
3589
|
elementUUID = uuid;
|
|
3618
3590
|
}
|
|
3619
3591
|
} else {
|
|
3620
|
-
const [index, uuid2] = this[_element
|
|
3592
|
+
const [index, uuid2] = this[_element].isPointInElement(p, data);
|
|
3621
3593
|
if (index >= 0) {
|
|
3622
3594
|
cursor = "move";
|
|
3623
3595
|
}
|
|
@@ -3678,18 +3650,6 @@ var iDrawCore = function() {
|
|
|
3678
3650
|
this._temp = createData$1();
|
|
3679
3651
|
}
|
|
3680
3652
|
};
|
|
3681
|
-
const _board = Symbol("_board");
|
|
3682
|
-
const _data = Symbol("_data");
|
|
3683
|
-
const _opts = Symbol("_opts");
|
|
3684
|
-
const _config = Symbol("_config");
|
|
3685
|
-
const _renderer = Symbol("_renderer");
|
|
3686
|
-
const _element = Symbol("_element");
|
|
3687
|
-
const _tempData = Symbol("_tempData");
|
|
3688
|
-
const _draw = Symbol("_draw");
|
|
3689
|
-
const _coreEvent = Symbol("_coreEvent");
|
|
3690
|
-
const _emitChangeScreen = Symbol("_emitChangeScreen");
|
|
3691
|
-
const _emitChangeData = Symbol("_emitChangeData");
|
|
3692
|
-
const _engine = Symbol("_engine");
|
|
3693
3653
|
var Mode = /* @__PURE__ */ ((Mode2) => {
|
|
3694
3654
|
Mode2["NULL"] = "null";
|
|
3695
3655
|
Mode2["SELECT_ELEMENT"] = "select-element";
|
|
@@ -3706,17 +3666,16 @@ var iDrawCore = function() {
|
|
|
3706
3666
|
function getSelectedElements(core) {
|
|
3707
3667
|
const elems = [];
|
|
3708
3668
|
let list = [];
|
|
3709
|
-
const uuid = core
|
|
3669
|
+
const uuid = core.getEngine().temp.get("selectedUUID");
|
|
3710
3670
|
if (typeof uuid === "string" && uuid) {
|
|
3711
3671
|
list.push(uuid);
|
|
3712
3672
|
} else {
|
|
3713
|
-
list = core
|
|
3673
|
+
list = core.getEngine().temp.get("selectedUUIDList");
|
|
3714
3674
|
}
|
|
3715
3675
|
list.forEach((uuid2) => {
|
|
3716
|
-
|
|
3717
|
-
const index = core[_engine].helper.getElementIndexByUUID(uuid2);
|
|
3676
|
+
const index = core.getEngine().helper.getElementIndexByUUID(uuid2);
|
|
3718
3677
|
if (index !== null && index >= 0) {
|
|
3719
|
-
const elem =
|
|
3678
|
+
const elem = core.$data.elements[index];
|
|
3720
3679
|
if (elem)
|
|
3721
3680
|
elems.push(elem);
|
|
3722
3681
|
}
|
|
@@ -3725,26 +3684,26 @@ var iDrawCore = function() {
|
|
|
3725
3684
|
}
|
|
3726
3685
|
function getElement(core, uuid) {
|
|
3727
3686
|
let elem = null;
|
|
3728
|
-
const index = core
|
|
3729
|
-
if (index !== null && core
|
|
3730
|
-
elem = deepClone(core
|
|
3687
|
+
const index = core.getEngine().helper.getElementIndexByUUID(uuid);
|
|
3688
|
+
if (index !== null && core.$data.elements[index]) {
|
|
3689
|
+
elem = deepClone(core.$data.elements[index]);
|
|
3731
3690
|
}
|
|
3732
3691
|
return elem;
|
|
3733
3692
|
}
|
|
3734
3693
|
function getElementByIndex(core, index) {
|
|
3735
3694
|
let elem = null;
|
|
3736
|
-
if (index >= 0 && core
|
|
3737
|
-
elem = deepClone(core
|
|
3695
|
+
if (index >= 0 && core.$data.elements[index]) {
|
|
3696
|
+
elem = deepClone(core.$data.elements[index]);
|
|
3738
3697
|
}
|
|
3739
3698
|
return elem;
|
|
3740
3699
|
}
|
|
3741
3700
|
function updateElement(core, elem) {
|
|
3742
|
-
var
|
|
3701
|
+
var _a;
|
|
3743
3702
|
const _elem = deepClone(elem);
|
|
3744
|
-
const data = core
|
|
3703
|
+
const data = core.getData();
|
|
3745
3704
|
const resourceChangeUUIDs = [];
|
|
3746
3705
|
for (let i = 0; i < data.elements.length; i++) {
|
|
3747
|
-
if (_elem.uuid === ((
|
|
3706
|
+
if (_elem.uuid === ((_a = data.elements[i]) == null ? void 0 : _a.uuid)) {
|
|
3748
3707
|
const result = diffElementResourceChange(data.elements[i], _elem);
|
|
3749
3708
|
if (typeof result === "string") {
|
|
3750
3709
|
resourceChangeUUIDs.push(result);
|
|
@@ -3753,82 +3712,82 @@ var iDrawCore = function() {
|
|
|
3753
3712
|
break;
|
|
3754
3713
|
}
|
|
3755
3714
|
}
|
|
3756
|
-
core
|
|
3757
|
-
core
|
|
3715
|
+
core.$emitChangeData();
|
|
3716
|
+
core.$draw({ resourceChangeUUIDs });
|
|
3758
3717
|
}
|
|
3759
3718
|
function selectElementByIndex(core, index) {
|
|
3760
|
-
if (core
|
|
3761
|
-
const uuid = core
|
|
3762
|
-
core
|
|
3719
|
+
if (core.$data.elements[index]) {
|
|
3720
|
+
const uuid = core.$data.elements[index].uuid;
|
|
3721
|
+
core.getEngine().temp.set("mode", Mode.NULL);
|
|
3763
3722
|
if (typeof uuid === "string") {
|
|
3764
|
-
core
|
|
3765
|
-
core
|
|
3723
|
+
core.getEngine().temp.set("selectedUUID", uuid);
|
|
3724
|
+
core.getEngine().temp.set("selectedUUIDList", []);
|
|
3766
3725
|
}
|
|
3767
|
-
core
|
|
3726
|
+
core.$draw();
|
|
3768
3727
|
}
|
|
3769
3728
|
}
|
|
3770
3729
|
function selectElement(core, uuid) {
|
|
3771
|
-
const index = core
|
|
3730
|
+
const index = core.getEngine().helper.getElementIndexByUUID(uuid);
|
|
3772
3731
|
if (typeof index === "number" && index >= 0) {
|
|
3773
3732
|
core.selectElementByIndex(index);
|
|
3774
3733
|
}
|
|
3775
3734
|
}
|
|
3776
3735
|
function cancelElementByIndex(core, index) {
|
|
3777
|
-
if (core
|
|
3778
|
-
const uuid = core
|
|
3779
|
-
const selectedUUID = core
|
|
3736
|
+
if (core.$data.elements[index]) {
|
|
3737
|
+
const uuid = core.$data.elements[index].uuid;
|
|
3738
|
+
const selectedUUID = core.getEngine().temp.get("selectedUUID");
|
|
3780
3739
|
if (typeof uuid === "string" && uuid === selectedUUID) {
|
|
3781
|
-
core
|
|
3782
|
-
core
|
|
3783
|
-
core
|
|
3740
|
+
core.getEngine().temp.set("mode", Mode.NULL);
|
|
3741
|
+
core.getEngine().temp.set("selectedUUID", null);
|
|
3742
|
+
core.getEngine().temp.set("selectedUUIDList", []);
|
|
3784
3743
|
}
|
|
3785
|
-
core
|
|
3744
|
+
core.$draw();
|
|
3786
3745
|
}
|
|
3787
3746
|
}
|
|
3788
|
-
function cancelElement(core, uuid
|
|
3789
|
-
const index = core
|
|
3747
|
+
function cancelElement(core, uuid) {
|
|
3748
|
+
const index = core.getEngine().helper.getElementIndexByUUID(uuid);
|
|
3790
3749
|
if (typeof index === "number" && index >= 0) {
|
|
3791
|
-
core.cancelElementByIndex(index
|
|
3750
|
+
core.cancelElementByIndex(index);
|
|
3792
3751
|
}
|
|
3793
3752
|
}
|
|
3794
3753
|
function moveUpElement(core, uuid) {
|
|
3795
|
-
const index = core
|
|
3796
|
-
if (typeof index === "number" && index >= 0 && index < core
|
|
3797
|
-
const temp = core
|
|
3798
|
-
core
|
|
3799
|
-
core
|
|
3754
|
+
const index = core.getEngine().helper.getElementIndexByUUID(uuid);
|
|
3755
|
+
if (typeof index === "number" && index >= 0 && index < core.$data.elements.length - 1) {
|
|
3756
|
+
const temp = core.$data.elements[index];
|
|
3757
|
+
core.$data.elements[index] = core.$data.elements[index + 1];
|
|
3758
|
+
core.$data.elements[index + 1] = temp;
|
|
3800
3759
|
}
|
|
3801
|
-
core
|
|
3802
|
-
core
|
|
3760
|
+
core.$emitChangeData();
|
|
3761
|
+
core.$draw();
|
|
3803
3762
|
}
|
|
3804
3763
|
function moveDownElement(core, uuid) {
|
|
3805
|
-
const index = core
|
|
3806
|
-
if (typeof index === "number" && index > 0 && index < core
|
|
3807
|
-
const temp = core
|
|
3808
|
-
core
|
|
3809
|
-
core
|
|
3764
|
+
const index = core.getEngine().helper.getElementIndexByUUID(uuid);
|
|
3765
|
+
if (typeof index === "number" && index > 0 && index < core.$data.elements.length) {
|
|
3766
|
+
const temp = core.$data.elements[index];
|
|
3767
|
+
core.$data.elements[index] = core.$data.elements[index - 1];
|
|
3768
|
+
core.$data.elements[index - 1] = temp;
|
|
3810
3769
|
}
|
|
3811
|
-
core
|
|
3812
|
-
core
|
|
3770
|
+
core.$emitChangeData();
|
|
3771
|
+
core.$draw();
|
|
3813
3772
|
}
|
|
3814
3773
|
function addElement(core, elem) {
|
|
3815
3774
|
const _elem = deepClone(elem);
|
|
3816
3775
|
_elem.uuid = createUUID();
|
|
3817
|
-
core
|
|
3818
|
-
core
|
|
3819
|
-
core
|
|
3776
|
+
core.$data.elements.push(_elem);
|
|
3777
|
+
core.$emitChangeData();
|
|
3778
|
+
core.$draw();
|
|
3820
3779
|
return _elem.uuid;
|
|
3821
3780
|
}
|
|
3822
3781
|
function deleteElement(core, uuid) {
|
|
3823
|
-
const index = core
|
|
3782
|
+
const index = core.$getElementHandler().getElementIndex(core.getData(), uuid);
|
|
3824
3783
|
if (index >= 0) {
|
|
3825
|
-
core
|
|
3826
|
-
core
|
|
3827
|
-
core
|
|
3784
|
+
core.$data.elements.splice(index, 1);
|
|
3785
|
+
core.$emitChangeData();
|
|
3786
|
+
core.$draw();
|
|
3828
3787
|
}
|
|
3829
3788
|
}
|
|
3830
3789
|
function insertElementBefore(core, elem, beforeUUID) {
|
|
3831
|
-
const index = core
|
|
3790
|
+
const index = core.getEngine().helper.getElementIndexByUUID(beforeUUID);
|
|
3832
3791
|
if (index !== null) {
|
|
3833
3792
|
return core.insertElementBeforeIndex(elem, index);
|
|
3834
3793
|
}
|
|
@@ -3838,15 +3797,15 @@ var iDrawCore = function() {
|
|
|
3838
3797
|
const _elem = deepClone(elem);
|
|
3839
3798
|
_elem.uuid = createUUID();
|
|
3840
3799
|
if (index >= 0) {
|
|
3841
|
-
core
|
|
3842
|
-
core
|
|
3843
|
-
core
|
|
3800
|
+
core.$data.elements.splice(index, 0, _elem);
|
|
3801
|
+
core.$emitChangeData();
|
|
3802
|
+
core.$draw();
|
|
3844
3803
|
return _elem.uuid;
|
|
3845
3804
|
}
|
|
3846
3805
|
return null;
|
|
3847
3806
|
}
|
|
3848
3807
|
function insertElementAfter(core, elem, beforeUUID) {
|
|
3849
|
-
const index = core
|
|
3808
|
+
const index = core.getEngine().helper.getElementIndexByUUID(beforeUUID);
|
|
3850
3809
|
if (index !== null) {
|
|
3851
3810
|
return core.insertElementAfterIndex(elem, index);
|
|
3852
3811
|
}
|
|
@@ -3856,9 +3815,9 @@ var iDrawCore = function() {
|
|
|
3856
3815
|
const _elem = deepClone(elem);
|
|
3857
3816
|
_elem.uuid = createUUID();
|
|
3858
3817
|
if (index >= 0) {
|
|
3859
|
-
core
|
|
3860
|
-
core
|
|
3861
|
-
core
|
|
3818
|
+
core.$data.elements.splice(index + 1, 0, _elem);
|
|
3819
|
+
core.$emitChangeData();
|
|
3820
|
+
core.$draw();
|
|
3862
3821
|
return _elem.uuid;
|
|
3863
3822
|
}
|
|
3864
3823
|
return null;
|
|
@@ -3908,7 +3867,7 @@ var iDrawCore = function() {
|
|
|
3908
3867
|
return this.helper.getConfig();
|
|
3909
3868
|
}
|
|
3910
3869
|
updateHelperConfig(opts) {
|
|
3911
|
-
var
|
|
3870
|
+
var _a;
|
|
3912
3871
|
const { board, getDataFeekback, config } = this._opts;
|
|
3913
3872
|
const data = getDataFeekback();
|
|
3914
3873
|
const transform = board.getTransform();
|
|
@@ -3916,7 +3875,7 @@ var iDrawCore = function() {
|
|
|
3916
3875
|
width: opts.width,
|
|
3917
3876
|
height: opts.height,
|
|
3918
3877
|
devicePixelRatio: opts.devicePixelRatio,
|
|
3919
|
-
canScroll: ((
|
|
3878
|
+
canScroll: ((_a = config == null ? void 0 : config.scrollWrapper) == null ? void 0 : _a.use) === true,
|
|
3920
3879
|
selectedUUID: this.temp.get("selectedUUID"),
|
|
3921
3880
|
selectedUUIDList: this.temp.get("selectedUUIDList"),
|
|
3922
3881
|
scale: transform.scale,
|
|
@@ -3942,24 +3901,24 @@ var iDrawCore = function() {
|
|
|
3942
3901
|
board.on("moveEnd", this._handleMoveEnd.bind(this));
|
|
3943
3902
|
}
|
|
3944
3903
|
_handleDoubleClick(point) {
|
|
3945
|
-
var
|
|
3904
|
+
var _a, _b, _c;
|
|
3946
3905
|
const { element, getDataFeekback, drawFeekback, coreEvent } = this._opts;
|
|
3947
3906
|
const data = getDataFeekback();
|
|
3948
3907
|
const [index, uuid] = element.isPointInElement(point, data);
|
|
3949
3908
|
if (index >= 0 && uuid) {
|
|
3950
|
-
const elem = deepClone((
|
|
3951
|
-
if (((
|
|
3909
|
+
const elem = deepClone((_a = data.elements) == null ? void 0 : _a[index]);
|
|
3910
|
+
if (((_b = elem == null ? void 0 : elem.operation) == null ? void 0 : _b.invisible) !== true) {
|
|
3952
3911
|
coreEvent.trigger("screenDoubleClickElement", {
|
|
3953
3912
|
index,
|
|
3954
3913
|
uuid,
|
|
3955
|
-
element: deepClone((
|
|
3914
|
+
element: deepClone((_c = data.elements) == null ? void 0 : _c[index])
|
|
3956
3915
|
});
|
|
3957
3916
|
}
|
|
3958
3917
|
}
|
|
3959
3918
|
drawFeekback();
|
|
3960
3919
|
}
|
|
3961
3920
|
_handlePoint(point) {
|
|
3962
|
-
var
|
|
3921
|
+
var _a, _b, _c;
|
|
3963
3922
|
if (!this._mapper.isEffectivePoint(point)) {
|
|
3964
3923
|
return;
|
|
3965
3924
|
}
|
|
@@ -3986,13 +3945,13 @@ var iDrawCore = function() {
|
|
|
3986
3945
|
this.temp.set("selectedUUID", uuid);
|
|
3987
3946
|
} else {
|
|
3988
3947
|
const [index, uuid2] = element.isPointInElement(point, data);
|
|
3989
|
-
if (index >= 0 && ((
|
|
3948
|
+
if (index >= 0 && ((_b = (_a = data.elements[index]) == null ? void 0 : _a.operation) == null ? void 0 : _b.invisible) !== true) {
|
|
3990
3949
|
selectElementByIndex2(index, { useMode: true });
|
|
3991
3950
|
if (typeof uuid2 === "string" && coreEvent.has("screenSelectElement")) {
|
|
3992
3951
|
coreEvent.trigger("screenSelectElement", {
|
|
3993
3952
|
index,
|
|
3994
3953
|
uuid: uuid2,
|
|
3995
|
-
element: deepClone((
|
|
3954
|
+
element: deepClone((_c = data.elements) == null ? void 0 : _c[index])
|
|
3996
3955
|
});
|
|
3997
3956
|
emitChangeScreen();
|
|
3998
3957
|
}
|
|
@@ -4007,7 +3966,7 @@ var iDrawCore = function() {
|
|
|
4007
3966
|
drawFeekback();
|
|
4008
3967
|
}
|
|
4009
3968
|
_handleClick(point) {
|
|
4010
|
-
var
|
|
3969
|
+
var _a;
|
|
4011
3970
|
const { element, getDataFeekback, coreEvent, drawFeekback } = this._opts;
|
|
4012
3971
|
const data = getDataFeekback();
|
|
4013
3972
|
const [index, uuid] = element.isPointInElement(point, data);
|
|
@@ -4015,7 +3974,7 @@ var iDrawCore = function() {
|
|
|
4015
3974
|
coreEvent.trigger("screenClickElement", {
|
|
4016
3975
|
index,
|
|
4017
3976
|
uuid,
|
|
4018
|
-
element: deepClone((
|
|
3977
|
+
element: deepClone((_a = data.elements) == null ? void 0 : _a[index])
|
|
4019
3978
|
});
|
|
4020
3979
|
}
|
|
4021
3980
|
drawFeekback();
|
|
@@ -4088,12 +4047,12 @@ var iDrawCore = function() {
|
|
|
4088
4047
|
const data = getDataFeekback();
|
|
4089
4048
|
const helper = this.helper;
|
|
4090
4049
|
uuids.forEach((uuid) => {
|
|
4091
|
-
var
|
|
4050
|
+
var _a, _b;
|
|
4092
4051
|
const idx = helper.getElementIndexByUUID(uuid);
|
|
4093
4052
|
if (idx === null)
|
|
4094
4053
|
return;
|
|
4095
4054
|
const elem = data.elements[idx];
|
|
4096
|
-
if (((
|
|
4055
|
+
if (((_a = elem == null ? void 0 : elem.operation) == null ? void 0 : _a.lock) !== true && ((_b = elem == null ? void 0 : elem.operation) == null ? void 0 : _b.invisible) !== true) {
|
|
4097
4056
|
element.dragElement(
|
|
4098
4057
|
data,
|
|
4099
4058
|
uuid,
|
|
@@ -4177,7 +4136,7 @@ var iDrawCore = function() {
|
|
|
4177
4136
|
}
|
|
4178
4137
|
}
|
|
4179
4138
|
_handleHover(point) {
|
|
4180
|
-
var
|
|
4139
|
+
var _a, _b;
|
|
4181
4140
|
let isMouseOverElement = false;
|
|
4182
4141
|
const { board, getDataFeekback, coreEvent } = this._opts;
|
|
4183
4142
|
const data = getDataFeekback();
|
|
@@ -4192,7 +4151,7 @@ var iDrawCore = function() {
|
|
|
4192
4151
|
const index = helper.getElementIndexByUUID(elementUUID);
|
|
4193
4152
|
if (index !== null && index >= 0) {
|
|
4194
4153
|
const elem = data.elements[index];
|
|
4195
|
-
if (((
|
|
4154
|
+
if (((_a = elem == null ? void 0 : elem.operation) == null ? void 0 : _a.lock) === true || ((_b = elem == null ? void 0 : elem.operation) == null ? void 0 : _b.invisible) === true) {
|
|
4196
4155
|
board.resetCursor();
|
|
4197
4156
|
return;
|
|
4198
4157
|
}
|
|
@@ -4493,30 +4452,29 @@ var iDrawCore = function() {
|
|
|
4493
4452
|
});
|
|
4494
4453
|
});
|
|
4495
4454
|
}
|
|
4496
|
-
var _a, _b;
|
|
4497
4455
|
class Core {
|
|
4498
4456
|
constructor(mount, opts, config) {
|
|
4499
|
-
var
|
|
4500
|
-
this
|
|
4501
|
-
this
|
|
4502
|
-
this
|
|
4503
|
-
this
|
|
4504
|
-
this
|
|
4505
|
-
this
|
|
4506
|
-
...this
|
|
4507
|
-
canScroll: (
|
|
4457
|
+
var _a, _b, _c;
|
|
4458
|
+
this._coreEvent = new CoreEvent();
|
|
4459
|
+
this._tempData = new TempData$1();
|
|
4460
|
+
this.$data = { elements: [] };
|
|
4461
|
+
this._opts = opts;
|
|
4462
|
+
this._config = mergeConfig(config || {});
|
|
4463
|
+
this._board = new Board(mount, {
|
|
4464
|
+
...this._opts,
|
|
4465
|
+
canScroll: (_a = config == null ? void 0 : config.scrollWrapper) == null ? void 0 : _a.use,
|
|
4508
4466
|
scrollConfig: {
|
|
4509
|
-
color: ((
|
|
4510
|
-
width: ((
|
|
4467
|
+
color: ((_b = config == null ? void 0 : config.scrollWrapper) == null ? void 0 : _b.color) || "#000000",
|
|
4468
|
+
width: ((_c = config == null ? void 0 : config.scrollWrapper) == null ? void 0 : _c.width) || 12,
|
|
4511
4469
|
...(config == null ? void 0 : config.scrollWrapper) || {}
|
|
4512
4470
|
}
|
|
4513
4471
|
});
|
|
4514
|
-
this
|
|
4472
|
+
this._renderer = new Renderer();
|
|
4515
4473
|
const drawFrame = () => {
|
|
4516
|
-
const helperCtx = this
|
|
4517
|
-
const helperConfig = this
|
|
4518
|
-
this
|
|
4519
|
-
const { contextWidth, contextHeight, devicePixelRatio } = this
|
|
4474
|
+
const helperCtx = this._board.getHelperContext();
|
|
4475
|
+
const helperConfig = this._engine.getHelperConfig();
|
|
4476
|
+
this._board.clear();
|
|
4477
|
+
const { contextWidth, contextHeight, devicePixelRatio } = this._opts;
|
|
4520
4478
|
helperCtx.clearRect(
|
|
4521
4479
|
0,
|
|
4522
4480
|
0,
|
|
@@ -4526,43 +4484,50 @@ var iDrawCore = function() {
|
|
|
4526
4484
|
drawElementWrapper(helperCtx, helperConfig);
|
|
4527
4485
|
drawAreaWrapper(helperCtx, helperConfig);
|
|
4528
4486
|
drawElementListWrappers(helperCtx, helperConfig);
|
|
4529
|
-
this
|
|
4487
|
+
this._board.draw();
|
|
4530
4488
|
};
|
|
4531
|
-
this
|
|
4489
|
+
this._renderer.on("drawFrame", () => {
|
|
4532
4490
|
drawFrame();
|
|
4533
4491
|
});
|
|
4534
|
-
this
|
|
4492
|
+
this._renderer.on("drawFrameComplete", () => {
|
|
4535
4493
|
drawFrame();
|
|
4536
4494
|
});
|
|
4537
|
-
this
|
|
4538
|
-
this
|
|
4539
|
-
coreEvent: this
|
|
4540
|
-
board: this
|
|
4541
|
-
element: this
|
|
4542
|
-
config: this
|
|
4543
|
-
drawFeekback: this
|
|
4544
|
-
getDataFeekback: () => this
|
|
4495
|
+
this._elementHandler = new Element(this._board.getContext());
|
|
4496
|
+
this._engine = new Engine({
|
|
4497
|
+
coreEvent: this._coreEvent,
|
|
4498
|
+
board: this._board,
|
|
4499
|
+
element: this._elementHandler,
|
|
4500
|
+
config: this._config,
|
|
4501
|
+
drawFeekback: this.$draw.bind(this),
|
|
4502
|
+
getDataFeekback: () => this.$data,
|
|
4545
4503
|
selectElementByIndex: this.selectElementByIndex.bind(this),
|
|
4546
|
-
emitChangeScreen: this
|
|
4547
|
-
emitChangeData: this
|
|
4504
|
+
emitChangeScreen: this._emitChangeScreen.bind(this),
|
|
4505
|
+
emitChangeData: this.$emitChangeData.bind(this)
|
|
4548
4506
|
});
|
|
4549
|
-
this
|
|
4550
|
-
this
|
|
4551
|
-
this
|
|
4507
|
+
this._engine.init();
|
|
4508
|
+
this._renderer.on("drawFrame", () => {
|
|
4509
|
+
this._coreEvent.trigger("drawFrame", void 0);
|
|
4552
4510
|
});
|
|
4553
|
-
this
|
|
4554
|
-
this
|
|
4511
|
+
this._renderer.on("drawFrameComplete", () => {
|
|
4512
|
+
this._coreEvent.trigger("drawFrameComplete", void 0);
|
|
4555
4513
|
});
|
|
4556
|
-
this
|
|
4514
|
+
this._tempData.set("hasInited", true);
|
|
4515
|
+
}
|
|
4516
|
+
_emitChangeScreen() {
|
|
4517
|
+
if (this._coreEvent.has("changeScreen")) {
|
|
4518
|
+
this._coreEvent.trigger("changeScreen", {
|
|
4519
|
+
...this.getScreenTransform()
|
|
4520
|
+
});
|
|
4521
|
+
}
|
|
4557
4522
|
}
|
|
4558
|
-
|
|
4559
|
-
this
|
|
4560
|
-
width: this
|
|
4561
|
-
height: this
|
|
4562
|
-
devicePixelRatio: this
|
|
4523
|
+
$draw(opts) {
|
|
4524
|
+
this._engine.updateHelperConfig({
|
|
4525
|
+
width: this._opts.width,
|
|
4526
|
+
height: this._opts.height,
|
|
4527
|
+
devicePixelRatio: this._opts.devicePixelRatio
|
|
4563
4528
|
});
|
|
4564
|
-
this
|
|
4565
|
-
this
|
|
4529
|
+
this._renderer.thaw();
|
|
4530
|
+
this._renderer.render(this._board.getContext(), this.$data, {
|
|
4566
4531
|
changeResourceUUIDs: (opts == null ? void 0 : opts.resourceChangeUUIDs) || []
|
|
4567
4532
|
});
|
|
4568
4533
|
}
|
|
@@ -4581,8 +4546,8 @@ var iDrawCore = function() {
|
|
|
4581
4546
|
cancelElementByIndex(index) {
|
|
4582
4547
|
return cancelElementByIndex(this, index);
|
|
4583
4548
|
}
|
|
4584
|
-
cancelElement(uuid
|
|
4585
|
-
return cancelElement(this, uuid
|
|
4549
|
+
cancelElement(uuid) {
|
|
4550
|
+
return cancelElement(this, uuid);
|
|
4586
4551
|
}
|
|
4587
4552
|
moveUpElement(uuid) {
|
|
4588
4553
|
return moveUpElement(this, uuid);
|
|
@@ -4615,30 +4580,30 @@ var iDrawCore = function() {
|
|
|
4615
4580
|
return insertElementAfterIndex(this, elem, index);
|
|
4616
4581
|
}
|
|
4617
4582
|
resetSize(opts) {
|
|
4618
|
-
this
|
|
4619
|
-
this
|
|
4620
|
-
this
|
|
4583
|
+
this._opts = { ...this._opts, ...opts };
|
|
4584
|
+
this._board.resetSize(opts);
|
|
4585
|
+
this.$draw();
|
|
4621
4586
|
}
|
|
4622
4587
|
scale(ratio) {
|
|
4623
|
-
const screen = this
|
|
4624
|
-
this
|
|
4625
|
-
this
|
|
4588
|
+
const screen = this._board.scale(ratio);
|
|
4589
|
+
this.$draw();
|
|
4590
|
+
this._emitChangeScreen();
|
|
4626
4591
|
return screen;
|
|
4627
4592
|
}
|
|
4628
4593
|
scrollLeft(left) {
|
|
4629
|
-
const screen = this
|
|
4630
|
-
this
|
|
4631
|
-
this
|
|
4594
|
+
const screen = this._board.scrollX(0 - left);
|
|
4595
|
+
this.$draw();
|
|
4596
|
+
this._emitChangeScreen();
|
|
4632
4597
|
return screen;
|
|
4633
4598
|
}
|
|
4634
4599
|
scrollTop(top) {
|
|
4635
|
-
const screen = this
|
|
4636
|
-
this
|
|
4637
|
-
this
|
|
4600
|
+
const screen = this._board.scrollY(0 - top);
|
|
4601
|
+
this.$draw();
|
|
4602
|
+
this._emitChangeScreen();
|
|
4638
4603
|
return screen;
|
|
4639
4604
|
}
|
|
4640
4605
|
getScreenTransform() {
|
|
4641
|
-
const transform = this
|
|
4606
|
+
const transform = this._board.getTransform();
|
|
4642
4607
|
return {
|
|
4643
4608
|
scale: transform.scale,
|
|
4644
4609
|
scrollTop: Math.max(0, 0 - transform.scrollY),
|
|
@@ -4646,55 +4611,51 @@ var iDrawCore = function() {
|
|
|
4646
4611
|
};
|
|
4647
4612
|
}
|
|
4648
4613
|
getData() {
|
|
4649
|
-
return deepClone(this
|
|
4614
|
+
return deepClone(this.$data);
|
|
4650
4615
|
}
|
|
4651
4616
|
setData(data, opts) {
|
|
4652
|
-
const resourceChangeUUIDs = diffElementResourceChangeList(
|
|
4653
|
-
|
|
4654
|
-
data
|
|
4655
|
-
);
|
|
4656
|
-
this[_data] = this[_element].initData(deepClone(parseData(data)));
|
|
4617
|
+
const resourceChangeUUIDs = diffElementResourceChangeList(this.$data, data);
|
|
4618
|
+
this.$data = this._elementHandler.initData(deepClone(parseData(data)));
|
|
4657
4619
|
if (opts && opts.triggerChangeEvent === true) {
|
|
4658
|
-
this
|
|
4620
|
+
this.$emitChangeData();
|
|
4659
4621
|
}
|
|
4660
|
-
this
|
|
4622
|
+
this.$draw({ resourceChangeUUIDs });
|
|
4661
4623
|
}
|
|
4662
4624
|
clearOperation() {
|
|
4663
|
-
this
|
|
4664
|
-
this
|
|
4625
|
+
this._tempData.clear();
|
|
4626
|
+
this.$draw();
|
|
4665
4627
|
}
|
|
4666
4628
|
on(key, callback) {
|
|
4667
|
-
this
|
|
4629
|
+
this._coreEvent.on(key, callback);
|
|
4668
4630
|
}
|
|
4669
4631
|
off(key, callback) {
|
|
4670
|
-
this
|
|
4632
|
+
this._coreEvent.off(key, callback);
|
|
4633
|
+
}
|
|
4634
|
+
getEngine() {
|
|
4635
|
+
return this._engine;
|
|
4671
4636
|
}
|
|
4672
4637
|
pointScreenToContext(p) {
|
|
4673
|
-
return this
|
|
4638
|
+
return this._board.pointScreenToContext(p);
|
|
4674
4639
|
}
|
|
4675
4640
|
pointContextToScreen(p) {
|
|
4676
|
-
return this
|
|
4641
|
+
return this._board.pointContextToScreen(p);
|
|
4677
4642
|
}
|
|
4678
|
-
|
|
4679
|
-
return this
|
|
4643
|
+
$getBoardContext() {
|
|
4644
|
+
return this._board.getContext();
|
|
4680
4645
|
}
|
|
4681
|
-
|
|
4682
|
-
return this
|
|
4646
|
+
$getDisplayContext2D() {
|
|
4647
|
+
return this._board.getDisplayContext2D();
|
|
4683
4648
|
}
|
|
4684
|
-
|
|
4685
|
-
return this
|
|
4649
|
+
$getOriginContext2D() {
|
|
4650
|
+
return this._board.getOriginContext2D();
|
|
4686
4651
|
}
|
|
4687
|
-
|
|
4688
|
-
if (this
|
|
4689
|
-
this
|
|
4690
|
-
...this.getScreenTransform()
|
|
4691
|
-
});
|
|
4652
|
+
$emitChangeData() {
|
|
4653
|
+
if (this._coreEvent.has("changeData")) {
|
|
4654
|
+
this._coreEvent.trigger("changeData", deepClone(this.$data));
|
|
4692
4655
|
}
|
|
4693
4656
|
}
|
|
4694
|
-
|
|
4695
|
-
|
|
4696
|
-
this[_coreEvent].trigger("changeData", deepClone(this[_data]));
|
|
4697
|
-
}
|
|
4657
|
+
$getElementHandler() {
|
|
4658
|
+
return this._elementHandler;
|
|
4698
4659
|
}
|
|
4699
4660
|
}
|
|
4700
4661
|
Core.is = is;
|