@logicflow/core 2.2.0-alpha.4 → 2.2.0-alpha.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.turbo/turbo-build.log +4 -4
- package/CHANGELOG.md +9 -0
- package/dist/index.min.js +1 -1
- package/dist/index.min.js.map +1 -1
- package/es/LogicFlow.js +0 -1
- package/es/model/GraphModel.js +1 -1
- package/es/view/node/BaseNode.js +2 -3
- package/es/view/overlay/OutlineOverlay.js +1 -1
- package/lib/LogicFlow.js +0 -1
- package/lib/model/GraphModel.js +1 -1
- package/lib/view/node/BaseNode.js +1 -2
- package/lib/view/overlay/OutlineOverlay.js +1 -1
- package/package.json +1 -1
- package/src/LogicFlow.tsx +0 -1
- package/src/model/GraphModel.ts +2 -1
- package/src/view/node/BaseNode.tsx +2 -3
- package/src/view/overlay/OutlineOverlay.tsx +1 -1
- package/stats.html +1 -1
package/es/LogicFlow.js
CHANGED
|
@@ -1217,7 +1217,6 @@ var LogicFlow = /** @class */ (function () {
|
|
|
1217
1217
|
this.graphModel.destroy();
|
|
1218
1218
|
this.tool.destroy();
|
|
1219
1219
|
this.history.destroy();
|
|
1220
|
-
clearThemeMode();
|
|
1221
1220
|
for (var extensionName in this.extension) {
|
|
1222
1221
|
var extensionInstance = this.extension[extensionName];
|
|
1223
1222
|
if ('destroy' in extensionInstance) {
|
package/es/model/GraphModel.js
CHANGED
package/es/view/node/BaseNode.js
CHANGED
|
@@ -54,7 +54,7 @@ var __read = (this && this.__read) || function (o, n) {
|
|
|
54
54
|
import { jsx as _jsx, jsxs as _jsxs } from "preact/jsx-runtime";
|
|
55
55
|
import { Component } from 'preact/compat';
|
|
56
56
|
import { reaction } from 'mobx';
|
|
57
|
-
import { map } from 'lodash-es';
|
|
57
|
+
import { map, isFunction, isNil } from 'lodash-es';
|
|
58
58
|
import Anchor from '../Anchor';
|
|
59
59
|
import { BaseText } from '../text';
|
|
60
60
|
import { ElementState, EventType, TextMode } from '../../constant';
|
|
@@ -244,8 +244,7 @@ var BaseNode = /** @class */ (function (_super) {
|
|
|
244
244
|
graphModel.eventCenter.emit(EventType.NODE_CLICK, eventOptions);
|
|
245
245
|
// 复制粘贴后会出现点击节点时,节点会失去焦点的问题,这里手动让节点获焦以解决这个问题
|
|
246
246
|
var el_1 = e.currentTarget;
|
|
247
|
-
var rAF =
|
|
248
|
-
typeof window.requestAnimationFrame === 'function'
|
|
247
|
+
var rAF = !isNil(window) && isFunction(window.requestAnimationFrame)
|
|
249
248
|
? window.requestAnimationFrame.bind(window)
|
|
250
249
|
: function (fn) { return setTimeout(fn, 0); };
|
|
251
250
|
rAF(function () {
|
|
@@ -57,7 +57,7 @@ var OutlineOverlay = /** @class */ (function (_super) {
|
|
|
57
57
|
var isHovered = element.isHovered, isSelected = element.isSelected, x = element.x, y = element.y, width = element.width, height = element.height;
|
|
58
58
|
if ((nodeSelectedOutline && isSelected) ||
|
|
59
59
|
(hoverOutline && isHovered)) {
|
|
60
|
-
var style_1 = element.getOutlineStyle();
|
|
60
|
+
var style_1 = element.getOutlineStyle() || {};
|
|
61
61
|
var attributes_1 = {};
|
|
62
62
|
Object.keys(style_1).forEach(function (key) {
|
|
63
63
|
if (key !== 'hover') {
|
package/lib/LogicFlow.js
CHANGED
|
@@ -1246,7 +1246,6 @@ var LogicFlow = /** @class */ (function () {
|
|
|
1246
1246
|
this.graphModel.destroy();
|
|
1247
1247
|
this.tool.destroy();
|
|
1248
1248
|
this.history.destroy();
|
|
1249
|
-
(0, util_1.clearThemeMode)();
|
|
1250
1249
|
for (var extensionName in this.extension) {
|
|
1251
1250
|
var extensionInstance = this.extension[extensionName];
|
|
1252
1251
|
if ('destroy' in extensionInstance) {
|
package/lib/model/GraphModel.js
CHANGED
|
@@ -248,8 +248,7 @@ var BaseNode = /** @class */ (function (_super) {
|
|
|
248
248
|
graphModel.eventCenter.emit(constant_1.EventType.NODE_CLICK, eventOptions);
|
|
249
249
|
// 复制粘贴后会出现点击节点时,节点会失去焦点的问题,这里手动让节点获焦以解决这个问题
|
|
250
250
|
var el_1 = e.currentTarget;
|
|
251
|
-
var rAF =
|
|
252
|
-
typeof window.requestAnimationFrame === 'function'
|
|
251
|
+
var rAF = !(0, lodash_es_1.isNil)(window) && (0, lodash_es_1.isFunction)(window.requestAnimationFrame)
|
|
253
252
|
? window.requestAnimationFrame.bind(window)
|
|
254
253
|
: function (fn) { return setTimeout(fn, 0); };
|
|
255
254
|
rAF(function () {
|
|
@@ -60,7 +60,7 @@ var OutlineOverlay = /** @class */ (function (_super) {
|
|
|
60
60
|
var isHovered = element.isHovered, isSelected = element.isSelected, x = element.x, y = element.y, width = element.width, height = element.height;
|
|
61
61
|
if ((nodeSelectedOutline && isSelected) ||
|
|
62
62
|
(hoverOutline && isHovered)) {
|
|
63
|
-
var style_1 = element.getOutlineStyle();
|
|
63
|
+
var style_1 = element.getOutlineStyle() || {};
|
|
64
64
|
var attributes_1 = {};
|
|
65
65
|
Object.keys(style_1).forEach(function (key) {
|
|
66
66
|
if (key !== 'hover') {
|
package/package.json
CHANGED
package/src/LogicFlow.tsx
CHANGED
|
@@ -1445,7 +1445,6 @@ export class LogicFlow {
|
|
|
1445
1445
|
this.graphModel.destroy()
|
|
1446
1446
|
this.tool.destroy()
|
|
1447
1447
|
this.history.destroy()
|
|
1448
|
-
clearThemeMode()
|
|
1449
1448
|
for (const extensionName in this.extension) {
|
|
1450
1449
|
const extensionInstance = this.extension[extensionName]
|
|
1451
1450
|
if ('destroy' in extensionInstance) {
|
package/src/model/GraphModel.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { createElement as h, Component } from 'preact/compat'
|
|
2
2
|
import { reaction, IReactionDisposer } from 'mobx'
|
|
3
|
-
import { map } from 'lodash-es'
|
|
3
|
+
import { map, isFunction, isNil } from 'lodash-es'
|
|
4
4
|
import Anchor from '../Anchor'
|
|
5
5
|
import { BaseText } from '../text'
|
|
6
6
|
import LogicFlow from '../../LogicFlow'
|
|
@@ -410,8 +410,7 @@ export abstract class BaseNode<P extends IProps = IProps> extends Component<
|
|
|
410
410
|
// 复制粘贴后会出现点击节点时,节点会失去焦点的问题,这里手动让节点获焦以解决这个问题
|
|
411
411
|
const el = e.currentTarget as HTMLElement
|
|
412
412
|
const rAF =
|
|
413
|
-
|
|
414
|
-
typeof window.requestAnimationFrame === 'function'
|
|
413
|
+
!isNil(window) && isFunction(window.requestAnimationFrame)
|
|
415
414
|
? window.requestAnimationFrame.bind(window)
|
|
416
415
|
: (fn: () => void) => setTimeout(fn, 0)
|
|
417
416
|
rAF(() => {
|
|
@@ -51,7 +51,7 @@ export class OutlineOverlay extends Component<IProps> {
|
|
|
51
51
|
(nodeSelectedOutline && isSelected) ||
|
|
52
52
|
(hoverOutline && isHovered)
|
|
53
53
|
) {
|
|
54
|
-
const style = element.getOutlineStyle()
|
|
54
|
+
const style = element.getOutlineStyle() || {}
|
|
55
55
|
let attributes = {}
|
|
56
56
|
Object.keys(style).forEach((key) => {
|
|
57
57
|
if (key !== 'hover') {
|