@fileverse-dev/fortune-core 1.0.8 → 1.0.10
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/es/modules/comment.js +0 -10
- package/lib/modules/comment.js +0 -10
- package/package.json +1 -1
package/es/modules/comment.js
CHANGED
|
@@ -12,7 +12,6 @@ import _ from "lodash";
|
|
|
12
12
|
import { mergeBorder } from "./cell";
|
|
13
13
|
import { getFlowdata } from "../context";
|
|
14
14
|
import { colLocation, rowLocation } from "./location";
|
|
15
|
-
import { isAllowEdit } from "../utils";
|
|
16
15
|
export function getArrowCanvasSize(fromX, fromY, toX, toY) {
|
|
17
16
|
var left = toX - 5;
|
|
18
17
|
if (fromX < toX) {
|
|
@@ -196,8 +195,6 @@ export function removeEditingComment(ctx, globalCache) {
|
|
|
196
195
|
}
|
|
197
196
|
export function newComment(ctx, globalCache, r, c) {
|
|
198
197
|
var _a, _b;
|
|
199
|
-
var allowEdit = isAllowEdit(ctx);
|
|
200
|
-
if (!allowEdit) return;
|
|
201
198
|
if (((_b = (_a = ctx.hooks).beforeInsertComment) === null || _b === void 0 ? void 0 : _b.call(_a, r, c)) === false) {
|
|
202
199
|
return;
|
|
203
200
|
}
|
|
@@ -231,8 +228,6 @@ export function newComment(ctx, globalCache, r, c) {
|
|
|
231
228
|
}
|
|
232
229
|
export function editComment(ctx, globalCache, r, c) {
|
|
233
230
|
var _a;
|
|
234
|
-
var allowEdit = isAllowEdit(ctx);
|
|
235
|
-
if (!allowEdit) return;
|
|
236
231
|
var flowdata = getFlowdata(ctx);
|
|
237
232
|
removeEditingComment(ctx, globalCache);
|
|
238
233
|
var comment = (_a = flowdata === null || flowdata === void 0 ? void 0 : flowdata[r][c]) === null || _a === void 0 ? void 0 : _a.ps;
|
|
@@ -251,8 +246,6 @@ export function editComment(ctx, globalCache, r, c) {
|
|
|
251
246
|
}
|
|
252
247
|
export function deleteComment(ctx, globalCache, r, c) {
|
|
253
248
|
var _a, _b;
|
|
254
|
-
var allowEdit = isAllowEdit(ctx);
|
|
255
|
-
if (!allowEdit) return;
|
|
256
249
|
if (((_b = (_a = ctx.hooks).beforeDeleteComment) === null || _b === void 0 ? void 0 : _b.call(_a, r, c)) === false) {
|
|
257
250
|
return;
|
|
258
251
|
}
|
|
@@ -450,7 +443,6 @@ export function onCommentBoxResizeStart(ctx, globalCache, e, _a, resizingId, res
|
|
|
450
443
|
}
|
|
451
444
|
}
|
|
452
445
|
export function onCommentBoxResize(ctx, globalCache, e) {
|
|
453
|
-
if (ctx.allowEdit === false) return false;
|
|
454
446
|
var commentBox = globalCache === null || globalCache === void 0 ? void 0 : globalCache.commentBox;
|
|
455
447
|
if ((commentBox === null || commentBox === void 0 ? void 0 : commentBox.resizingId) && commentBox.resizingSide) {
|
|
456
448
|
var box = document.getElementById(commentBox.resizingId);
|
|
@@ -553,8 +545,6 @@ export function onCommentBoxMoveStart(ctx, globalCache, e, _a, movingId) {
|
|
|
553
545
|
}
|
|
554
546
|
}
|
|
555
547
|
export function onCommentBoxMove(ctx, globalCache, e) {
|
|
556
|
-
var allowEdit = isAllowEdit(ctx);
|
|
557
|
-
if (!allowEdit) return false;
|
|
558
548
|
var commentBox = globalCache === null || globalCache === void 0 ? void 0 : globalCache.commentBox;
|
|
559
549
|
if (commentBox === null || commentBox === void 0 ? void 0 : commentBox.movingId) {
|
|
560
550
|
var box = document.getElementById(commentBox.movingId);
|
package/lib/modules/comment.js
CHANGED
|
@@ -29,7 +29,6 @@ var _lodash = _interopRequireDefault(require("lodash"));
|
|
|
29
29
|
var _cell = require("./cell");
|
|
30
30
|
var _context = require("../context");
|
|
31
31
|
var _location = require("./location");
|
|
32
|
-
var _utils = require("../utils");
|
|
33
32
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
34
33
|
var __assign = void 0 && (void 0).__assign || function () {
|
|
35
34
|
__assign = Object.assign || function (t) {
|
|
@@ -224,8 +223,6 @@ function removeEditingComment(ctx, globalCache) {
|
|
|
224
223
|
}
|
|
225
224
|
function newComment(ctx, globalCache, r, c) {
|
|
226
225
|
var _a, _b;
|
|
227
|
-
var allowEdit = (0, _utils.isAllowEdit)(ctx);
|
|
228
|
-
if (!allowEdit) return;
|
|
229
226
|
if (((_b = (_a = ctx.hooks).beforeInsertComment) === null || _b === void 0 ? void 0 : _b.call(_a, r, c)) === false) {
|
|
230
227
|
return;
|
|
231
228
|
}
|
|
@@ -259,8 +256,6 @@ function newComment(ctx, globalCache, r, c) {
|
|
|
259
256
|
}
|
|
260
257
|
function editComment(ctx, globalCache, r, c) {
|
|
261
258
|
var _a;
|
|
262
|
-
var allowEdit = (0, _utils.isAllowEdit)(ctx);
|
|
263
|
-
if (!allowEdit) return;
|
|
264
259
|
var flowdata = (0, _context.getFlowdata)(ctx);
|
|
265
260
|
removeEditingComment(ctx, globalCache);
|
|
266
261
|
var comment = (_a = flowdata === null || flowdata === void 0 ? void 0 : flowdata[r][c]) === null || _a === void 0 ? void 0 : _a.ps;
|
|
@@ -279,8 +274,6 @@ function editComment(ctx, globalCache, r, c) {
|
|
|
279
274
|
}
|
|
280
275
|
function deleteComment(ctx, globalCache, r, c) {
|
|
281
276
|
var _a, _b;
|
|
282
|
-
var allowEdit = (0, _utils.isAllowEdit)(ctx);
|
|
283
|
-
if (!allowEdit) return;
|
|
284
277
|
if (((_b = (_a = ctx.hooks).beforeDeleteComment) === null || _b === void 0 ? void 0 : _b.call(_a, r, c)) === false) {
|
|
285
278
|
return;
|
|
286
279
|
}
|
|
@@ -478,7 +471,6 @@ function onCommentBoxResizeStart(ctx, globalCache, e, _a, resizingId, resizingSi
|
|
|
478
471
|
}
|
|
479
472
|
}
|
|
480
473
|
function onCommentBoxResize(ctx, globalCache, e) {
|
|
481
|
-
if (ctx.allowEdit === false) return false;
|
|
482
474
|
var commentBox = globalCache === null || globalCache === void 0 ? void 0 : globalCache.commentBox;
|
|
483
475
|
if ((commentBox === null || commentBox === void 0 ? void 0 : commentBox.resizingId) && commentBox.resizingSide) {
|
|
484
476
|
var box = document.getElementById(commentBox.resizingId);
|
|
@@ -581,8 +573,6 @@ function onCommentBoxMoveStart(ctx, globalCache, e, _a, movingId) {
|
|
|
581
573
|
}
|
|
582
574
|
}
|
|
583
575
|
function onCommentBoxMove(ctx, globalCache, e) {
|
|
584
|
-
var allowEdit = (0, _utils.isAllowEdit)(ctx);
|
|
585
|
-
if (!allowEdit) return false;
|
|
586
576
|
var commentBox = globalCache === null || globalCache === void 0 ? void 0 : globalCache.commentBox;
|
|
587
577
|
if (commentBox === null || commentBox === void 0 ? void 0 : commentBox.movingId) {
|
|
588
578
|
var box = document.getElementById(commentBox.movingId);
|