@gedit/editor-2d 0.1.114 → 0.1.115
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/lib/browser/editor2d-context-key-service.js +24 -35
- package/lib/browser/editor2d-context-key-service.js.map +1 -1
- package/lib/browser/editor2d-contribution.js +89 -139
- package/lib/browser/editor2d-contribution.js.map +1 -1
- package/lib/browser/editor2d-frontend-module.js +20 -20
- package/lib/browser/editor2d-frontend-module.js.map +1 -1
- package/lib/browser/editor2d-label-provider.d.ts +0 -1
- package/lib/browser/editor2d-label-provider.d.ts.map +1 -1
- package/lib/browser/editor2d-label-provider.js +37 -58
- package/lib/browser/editor2d-label-provider.js.map +1 -1
- package/lib/browser/editor2d-model-provider.js +61 -127
- package/lib/browser/editor2d-model-provider.js.map +1 -1
- package/lib/browser/editor2d-ref-provider-contribution.js +44 -110
- package/lib/browser/editor2d-ref-provider-contribution.js.map +1 -1
- package/lib/browser/editor2d-service.js +66 -85
- package/lib/browser/editor2d-service.js.map +1 -1
- package/lib/browser/model/editor2d-document.d.ts +1 -1
- package/lib/browser/model/editor2d-document.d.ts.map +1 -1
- package/lib/browser/model/editor2d-document.js +358 -526
- package/lib/browser/model/editor2d-document.js.map +1 -1
- package/lib/browser/model/editor2d-iterator.js +27 -67
- package/lib/browser/model/editor2d-iterator.js.map +1 -1
- package/lib/browser/model/editor2d-model-container.js +10 -21
- package/lib/browser/model/editor2d-model-container.js.map +1 -1
- package/lib/browser/model/editor2d-model.js +77 -92
- package/lib/browser/model/editor2d-model.js.map +1 -1
- package/lib/browser/model/editor2d-selection.js +16 -43
- package/lib/browser/model/editor2d-selection.js.map +1 -1
- package/lib/browser/model/editor2d-widget.js +71 -90
- package/lib/browser/model/editor2d-widget.js.map +1 -1
- package/lib/browser/model/editor2d.js +41 -127
- package/lib/browser/model/editor2d.js.map +1 -1
- package/lib/browser/model/utils/anim.utils.js +14 -14
- package/lib/browser/model/utils/anim.utils.js.map +1 -1
- package/lib/browser/playground/canvas-draw-layer.js +45 -69
- package/lib/browser/playground/canvas-draw-layer.js.map +1 -1
- package/lib/browser/playground/canvas-draw.js +142 -244
- package/lib/browser/playground/canvas-draw.js.map +1 -1
- package/lib/browser/playground/canvas-layer.js +54 -101
- package/lib/browser/playground/canvas-layer.js.map +1 -1
- package/lib/browser/playground/entities/document-entity.js +8 -28
- package/lib/browser/playground/entities/document-entity.js.map +1 -1
- package/lib/browser/playground/entities/editor2d-entity.js +14 -37
- package/lib/browser/playground/entities/editor2d-entity.js.map +1 -1
- package/lib/browser/playground/playground-context.d.ts +3 -1
- package/lib/browser/playground/playground-context.d.ts.map +1 -1
- package/lib/browser/playground/playground-context.js +49 -47
- package/lib/browser/playground/playground-context.js.map +1 -1
- package/lib/browser/playground/playground-contribution.js +61 -65
- package/lib/browser/playground/playground-contribution.js.map +1 -1
- package/lib/browser/playground/selection-entity-manager.js +74 -132
- package/lib/browser/playground/selection-entity-manager.js.map +1 -1
- package/lib/browser/playground/selector-extend-icons.js +15 -16
- package/lib/browser/playground/selector-extend-icons.js.map +1 -1
- package/lib/browser/playground/selector-extend-renderer.d.ts +3 -2
- package/lib/browser/playground/selector-extend-renderer.d.ts.map +1 -1
- package/lib/browser/playground/selector-extend-renderer.js +67 -52
- package/lib/browser/playground/selector-extend-renderer.js.map +1 -1
- package/lib/browser/utils/snapshot.js +81 -172
- package/lib/browser/utils/snapshot.js.map +1 -1
- package/package.json +7 -7
- package/src/browser/editor2d-label-provider.ts +1 -15
- package/src/browser/model/editor2d-document.ts +6 -2
- package/src/browser/playground/playground-context.ts +2 -0
- package/src/browser/playground/selector-extend-renderer.tsx +43 -10
|
@@ -10,37 +10,34 @@ var __metadata = (this && this.__metadata) || function (k, v) {
|
|
|
10
10
|
};
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
12
|
exports.PlaygroundContribution2d = void 0;
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
13
|
+
const inversify_1 = require("inversify");
|
|
14
|
+
const playground_1 = require("@gedit/playground");
|
|
15
|
+
const canvas_layer_1 = require("./canvas-layer");
|
|
16
|
+
const canvas_draw_layer_1 = require("./canvas-draw-layer");
|
|
17
17
|
// import { SelectionLayer } from './selection-layer';
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
}
|
|
27
|
-
PlaygroundContribution2d.prototype.registerPlayground = function (registry) {
|
|
18
|
+
const app_config_1 = require("@gedit/app-config");
|
|
19
|
+
const history_1 = require("@gedit/history");
|
|
20
|
+
const editor2d_1 = require("../model/editor2d");
|
|
21
|
+
const layout_1 = require("@gedit/layout");
|
|
22
|
+
const command_1 = require("@gedit/command");
|
|
23
|
+
const browser_1 = require("@gedit/application-common/lib/browser");
|
|
24
|
+
let PlaygroundContribution2d = class PlaygroundContribution2d {
|
|
25
|
+
registerPlayground(registry) {
|
|
28
26
|
registry.registerLayer(canvas_layer_1.CanvasLayer);
|
|
29
27
|
registry.registerLayer(canvas_draw_layer_1.CanvasDrawLayer);
|
|
30
28
|
// registry.registerLayer(SelectionLayer);
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
var _this = this;
|
|
29
|
+
}
|
|
30
|
+
onDispose(playground) {
|
|
31
|
+
}
|
|
32
|
+
onReady(playground) {
|
|
36
33
|
// const resource = this.modelOpts.autoSaveService.resource;
|
|
37
|
-
playground.onDispatch(
|
|
34
|
+
playground.onDispatch(e => {
|
|
38
35
|
// console.log('>>>> onDispatch: ', e.payloadKey, e.payload);
|
|
39
36
|
});
|
|
40
37
|
// 开启缩放
|
|
41
38
|
playground.zoomEnable = true;
|
|
42
|
-
|
|
43
|
-
|
|
39
|
+
const rulerEntity = playground.entityManager.getEntity(playground_1.RulerConfigEntity);
|
|
40
|
+
const stateEntity = playground.entityManager.getEntity(playground_1.EditorStateConfigEntity);
|
|
44
41
|
// 新版隐藏标尺
|
|
45
42
|
if (rulerEntity) {
|
|
46
43
|
rulerEntity.updateConfig({
|
|
@@ -55,9 +52,9 @@ var PlaygroundContribution2d = /** @class */ (function () {
|
|
|
55
52
|
title: '全屏',
|
|
56
53
|
priority: 6,
|
|
57
54
|
cancelMode: 'once',
|
|
58
|
-
handle:
|
|
59
|
-
|
|
60
|
-
setTimeout(
|
|
55
|
+
handle: () => {
|
|
56
|
+
this.commandService.executeCommand(browser_1.CommonCommands.TOGGLE_MAXIMIZED.id);
|
|
57
|
+
setTimeout(() => {
|
|
61
58
|
playground.config.scrollPageBoundsToCenter();
|
|
62
59
|
}, 10);
|
|
63
60
|
}
|
|
@@ -70,12 +67,12 @@ var PlaygroundContribution2d = /** @class */ (function () {
|
|
|
70
67
|
showTitle: true,
|
|
71
68
|
priority: 0,
|
|
72
69
|
cancelMode: 'once',
|
|
73
|
-
handle:
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
menuPath:
|
|
70
|
+
handle: (_, e) => {
|
|
71
|
+
const dom = e.event.target;
|
|
72
|
+
const parentNode = (dom.className.match('gedit-toolbar-item') ? dom : dom.parentNode);
|
|
73
|
+
const rect = parentNode.getBoundingClientRect();
|
|
74
|
+
this.menuRender.render({
|
|
75
|
+
menuPath: this.config.contextMenuPath,
|
|
79
76
|
anchor: { x: rect.x + rect.width + 8, y: rect.y },
|
|
80
77
|
args: [editor2d_1.Editor2dNode.GLOBAL_ADD_EVENT],
|
|
81
78
|
});
|
|
@@ -98,14 +95,14 @@ var PlaygroundContribution2d = /** @class */ (function () {
|
|
|
98
95
|
});
|
|
99
96
|
playground.toDispose.push(
|
|
100
97
|
// TODO 放在这里处理会增加复杂度
|
|
101
|
-
this.appConfig.onConfigChange(
|
|
102
|
-
|
|
98
|
+
this.appConfig.onConfigChange(data => {
|
|
99
|
+
this.updateAppConfigData(data, playground);
|
|
103
100
|
}));
|
|
104
101
|
// playground.onRestoreState(() => {
|
|
105
102
|
// this.appConfig.getConfigData().then(data => this.updateAppConfigData(data, playground));
|
|
106
103
|
// });
|
|
107
|
-
}
|
|
108
|
-
|
|
104
|
+
}
|
|
105
|
+
updateAppConfigData(data, playground) {
|
|
109
106
|
// const snaplineEntity = playground.getConfigEntity<SnaplineConfigEntity>(SnaplineConfigEntity);
|
|
110
107
|
// 更新分辨率
|
|
111
108
|
// playground.config.updateConfig({ resolution: data.resolution });
|
|
@@ -128,35 +125,34 @@ var PlaygroundContribution2d = /** @class */ (function () {
|
|
|
128
125
|
// originlineVisible: false,
|
|
129
126
|
// });
|
|
130
127
|
// }
|
|
131
|
-
}
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
}());
|
|
128
|
+
}
|
|
129
|
+
};
|
|
130
|
+
__decorate([
|
|
131
|
+
(0, inversify_1.inject)(app_config_1.AppConfigService),
|
|
132
|
+
__metadata("design:type", app_config_1.AppConfigService)
|
|
133
|
+
], PlaygroundContribution2d.prototype, "appConfig", void 0);
|
|
134
|
+
__decorate([
|
|
135
|
+
(0, inversify_1.inject)(editor2d_1.Editor2dModelOptions),
|
|
136
|
+
__metadata("design:type", Object)
|
|
137
|
+
], PlaygroundContribution2d.prototype, "modelOpts", void 0);
|
|
138
|
+
__decorate([
|
|
139
|
+
(0, inversify_1.inject)(history_1.HistoryService),
|
|
140
|
+
__metadata("design:type", history_1.HistoryService)
|
|
141
|
+
], PlaygroundContribution2d.prototype, "historyService", void 0);
|
|
142
|
+
__decorate([
|
|
143
|
+
(0, inversify_1.inject)(playground_1.PlaygroundConfig),
|
|
144
|
+
__metadata("design:type", Object)
|
|
145
|
+
], PlaygroundContribution2d.prototype, "config", void 0);
|
|
146
|
+
__decorate([
|
|
147
|
+
(0, inversify_1.inject)(command_1.CommandService),
|
|
148
|
+
__metadata("design:type", Object)
|
|
149
|
+
], PlaygroundContribution2d.prototype, "commandService", void 0);
|
|
150
|
+
__decorate([
|
|
151
|
+
(0, inversify_1.inject)(layout_1.ContextMenuRenderer),
|
|
152
|
+
__metadata("design:type", layout_1.ContextMenuRenderer)
|
|
153
|
+
], PlaygroundContribution2d.prototype, "menuRender", void 0);
|
|
154
|
+
PlaygroundContribution2d = __decorate([
|
|
155
|
+
(0, inversify_1.injectable)()
|
|
156
|
+
], PlaygroundContribution2d);
|
|
161
157
|
exports.PlaygroundContribution2d = PlaygroundContribution2d;
|
|
162
158
|
//# sourceMappingURL=playground-contribution.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"playground-contribution.js","sourceRoot":"","sources":["../../../src/browser/playground/playground-contribution.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,
|
|
1
|
+
{"version":3,"file":"playground-contribution.js","sourceRoot":"","sources":["../../../src/browser/playground/playground-contribution.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,yCAA+C;AAC/C,kDAS2B;AAC3B,iDAA6C;AAC7C,2DAAsD;AACtD,sDAAsD;AACtD,kDAAoE;AACpE,4CAAgD;AAChD,gDAAuE;AACvE,0CAAoD;AACpD,4CAAgD;AAChD,mEAAuE;AAGvE,IAAa,wBAAwB,GAArC,MAAa,wBAAwB;IAOnC,kBAAkB,CAAC,QAA4B;QAC7C,QAAQ,CAAC,aAAa,CAAC,0BAAW,CAAC,CAAC;QACpC,QAAQ,CAAC,aAAa,CAAC,mCAAe,CAAC,CAAC;QACxC,0CAA0C;IAC5C,CAAC;IACD,SAAS,CAAC,UAAsB;IAChC,CAA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,EAAE,UAAsB;QAC7D,iGAAiG;QACjG,QAAQ;QACR,mEAAmE;QACnE,oCAAoC;QACpC,kCAAkC;QAClC,iBAAiB;QACjB,qBAAqB;QACrB,8CAA8C;QAC9C,sBAAsB;QACtB,sBAAsB;QACtB,QAAQ;QACR,iBAAiB;QACjB,qBAAqB;QACrB,8CAA8C;QAC9C,wBAAwB;QACxB,sBAAsB;QACtB,QAAQ;QACR,kCAAkC;QAClC,aAAa;QACb,gCAAgC;QAChC,QAAQ;QACR,IAAI;IACN,CAAC;CACF,CAAA;AA/G2B;IAAzB,IAAA,kBAAM,EAAC,6BAAgB,CAAC;8BAAqB,6BAAgB;2DAAC;AACjC;IAA7B,IAAA,kBAAM,EAAC,+BAAoB,CAAC;;2DAA0C;AAC/C;IAAvB,IAAA,kBAAM,EAAC,wBAAc,CAAC;8BAA0B,wBAAc;gEAAC;AACtC;IAAzB,IAAA,kBAAM,EAAC,6BAAgB,CAAC;;wDAAmC;AACpC;IAAvB,IAAA,kBAAM,EAAC,wBAAc,CAAC;;gEAAyC;AACnC;IAA5B,IAAA,kBAAM,EAAC,4BAAmB,CAAC;8BAAsB,4BAAmB;4DAAC;AAN3D,wBAAwB;IADpC,IAAA,sBAAU,GAAE;GACA,wBAAwB,CAgHpC;AAhHY,4DAAwB"}
|
|
@@ -1,38 +1,16 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __assign = (this && this.__assign) || function () {
|
|
3
|
-
__assign = Object.assign || function(t) {
|
|
4
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
5
|
-
s = arguments[i];
|
|
6
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
7
|
-
t[p] = s[p];
|
|
8
|
-
}
|
|
9
|
-
return t;
|
|
10
|
-
};
|
|
11
|
-
return __assign.apply(this, arguments);
|
|
12
|
-
};
|
|
13
|
-
var __values = (this && this.__values) || function(o) {
|
|
14
|
-
var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
|
|
15
|
-
if (m) return m.call(o);
|
|
16
|
-
if (o && typeof o.length === "number") return {
|
|
17
|
-
next: function () {
|
|
18
|
-
if (o && i >= o.length) o = void 0;
|
|
19
|
-
return { value: o && o[i++], done: !o };
|
|
20
|
-
}
|
|
21
|
-
};
|
|
22
|
-
throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
|
|
23
|
-
};
|
|
24
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
25
3
|
exports.SelectionEntityManager = void 0;
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
Object.keys(data).forEach(
|
|
35
|
-
|
|
4
|
+
const React = require("react");
|
|
5
|
+
const model_1 = require("../model");
|
|
6
|
+
const editor2d_entity_1 = require("./entities/editor2d-entity");
|
|
7
|
+
const playground_1 = require("@gedit/playground");
|
|
8
|
+
const math_1 = require("@gedit/math");
|
|
9
|
+
const selector_extend_renderer_1 = require("./selector-extend-renderer");
|
|
10
|
+
const numberToFixed4 = (data) => {
|
|
11
|
+
const d = {};
|
|
12
|
+
Object.keys(data).forEach(key => {
|
|
13
|
+
const value = data[key];
|
|
36
14
|
// 旋转不能四舍五入,不然属性面板旋转角度误差很大
|
|
37
15
|
if (typeof value === 'number' && key !== 'rotation') {
|
|
38
16
|
d[key] = parseFloat(value.toFixed(6));
|
|
@@ -49,31 +27,30 @@ var numberToFixed4 = function (data) {
|
|
|
49
27
|
/**
|
|
50
28
|
* 选择器实体相关逻辑
|
|
51
29
|
*/
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
var _this = this;
|
|
30
|
+
class SelectionEntityManager {
|
|
31
|
+
constructor(entityManager, context, loading, getDocument, isVisible) {
|
|
55
32
|
this.entityManager = entityManager;
|
|
56
33
|
this.context = context;
|
|
57
34
|
this.loading = loading;
|
|
58
35
|
this.getDocument = getDocument;
|
|
59
36
|
this.isVisible = isVisible;
|
|
60
37
|
this.nodeEntitiesCache = new Map();
|
|
61
|
-
|
|
62
|
-
selectionConfigEntity === null || selectionConfigEntity === void 0 ? void 0 : selectionConfigEntity.customSelectorEntityRenderer(
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
?
|
|
38
|
+
const selectionConfigEntity = entityManager.getEntity(playground_1.SelectorConfigEntity);
|
|
39
|
+
selectionConfigEntity === null || selectionConfigEntity === void 0 ? void 0 : selectionConfigEntity.customSelectorEntityRenderer(props => {
|
|
40
|
+
const newProps = Object.assign({}, props);
|
|
41
|
+
const entity = newProps.entity;
|
|
42
|
+
const register = entity.node
|
|
43
|
+
? this.context.renderEngine.getGameObjectIDERegister(entity.gameObject.scene.config.engine, entity.node.displayType)
|
|
67
44
|
: undefined;
|
|
68
|
-
|
|
69
|
-
newProps.extendRenderer =
|
|
45
|
+
const deco = register === null || register === void 0 ? void 0 : register.decoration;
|
|
46
|
+
newProps.extendRenderer = () => React.createElement(selector_extend_renderer_1.SelectorExtendRender, Object.assign({}, props, { register: register, context: this.context }));
|
|
70
47
|
/* if (this.context.options.extendEntityRenderer) {
|
|
71
48
|
newProps.extendRenderer = () => this.context.options.extendEntityRenderer!({ ...props, context: this.context });
|
|
72
49
|
} */
|
|
73
50
|
// 自定义渲染器
|
|
74
51
|
if (deco && deco.selectionRenderer) {
|
|
75
|
-
|
|
76
|
-
return React.createElement(Comp,
|
|
52
|
+
const Comp = deco.selectionRenderer;
|
|
53
|
+
return React.createElement(Comp, Object.assign({}, newProps));
|
|
77
54
|
}
|
|
78
55
|
return (0, playground_1.DefaultSelectorEntityRenderer)(newProps);
|
|
79
56
|
});
|
|
@@ -86,13 +63,12 @@ var SelectionEntityManager = /** @class */ (function () {
|
|
|
86
63
|
* @param selectable
|
|
87
64
|
* @param adsorbable
|
|
88
65
|
*/
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
var deco = register.decoration;
|
|
66
|
+
createEntity(nodePath, node, gameObject, selectable, adsorbable) {
|
|
67
|
+
const register = this.context.renderEngine.getGameObjectIDERegister(gameObject.scene.config.engine, node.displayType);
|
|
68
|
+
const deco = register.decoration;
|
|
93
69
|
if (!register.getSelectionData || model_1.Editor2dNode.isRootNode(node))
|
|
94
70
|
return;
|
|
95
|
-
|
|
71
|
+
const entity = this.entityManager.createEntity(editor2d_entity_1.Editor2dEntity, { id: nodePath });
|
|
96
72
|
entity.selectableInit = selectable;
|
|
97
73
|
entity.adsorbableInit = adsorbable;
|
|
98
74
|
entity.mouseSelect = selectable && (deco.mouseSelect === undefined ? true : deco.mouseSelect);
|
|
@@ -109,24 +85,24 @@ var SelectionEntityManager = /** @class */ (function () {
|
|
|
109
85
|
});
|
|
110
86
|
}
|
|
111
87
|
// 实体选中状态改变
|
|
112
|
-
entity.onToggleSelect(
|
|
113
|
-
|
|
88
|
+
entity.onToggleSelect((selected) => {
|
|
89
|
+
const newNode = entity.node;
|
|
114
90
|
if (newNode && newNode.selected !== selected) {
|
|
115
91
|
// 这个只记录选择,但不会真实触发tree组件的选择器,所以需要再同步一次
|
|
116
92
|
newNode.selected = selected;
|
|
117
93
|
// 点击画布后则同步选择器
|
|
118
|
-
|
|
94
|
+
this.context.syncToSelectionTree(this);
|
|
119
95
|
}
|
|
120
96
|
});
|
|
121
97
|
this.nodeEntitiesCache.set(nodePath, entity);
|
|
122
98
|
// 实体销毁
|
|
123
|
-
entity.onDispose(
|
|
124
|
-
|
|
99
|
+
entity.onDispose(() => {
|
|
100
|
+
this.nodeEntitiesCache.delete(nodePath);
|
|
125
101
|
});
|
|
126
102
|
// let lastTransform: TransformSchema | undefined;
|
|
127
|
-
entity.onTransformChanged(
|
|
128
|
-
|
|
129
|
-
if (
|
|
103
|
+
entity.onTransformChanged((newTransform) => {
|
|
104
|
+
const document = this.getDocument();
|
|
105
|
+
if (this.loading() || !document) {
|
|
130
106
|
return;
|
|
131
107
|
}
|
|
132
108
|
/* if (!lastTransform || !document || document.animationStarted || entity.ignoreTransformChanged) {
|
|
@@ -147,24 +123,24 @@ var SelectionEntityManager = /** @class */ (function () {
|
|
|
147
123
|
}
|
|
148
124
|
entity.selectable = false;
|
|
149
125
|
return entity;
|
|
150
|
-
}
|
|
151
|
-
|
|
152
|
-
|
|
126
|
+
}
|
|
127
|
+
removeEntity(nodePath) {
|
|
128
|
+
const entity = this.nodeEntitiesCache.get(nodePath);
|
|
153
129
|
if (entity) {
|
|
154
130
|
entity.dispose();
|
|
155
131
|
}
|
|
156
|
-
}
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
132
|
+
}
|
|
133
|
+
updateEntity(nodePath, gameObject) {
|
|
134
|
+
const register = this.context.renderEngine.getGameObjectIDERegister(gameObject.scene.config.engine, gameObject.type);
|
|
135
|
+
const deco = register.decoration;
|
|
136
|
+
const entity = this.nodeEntitiesCache.get(nodePath);
|
|
161
137
|
if (!entity || !register.getSelectionData) {
|
|
162
138
|
return;
|
|
163
139
|
}
|
|
164
|
-
|
|
140
|
+
const node = entity.node;
|
|
165
141
|
entity.ignoreTransformChanged = true;
|
|
166
142
|
if (gameObject.parent) {
|
|
167
|
-
|
|
143
|
+
const parentEntity = this.nodeEntitiesCache.get(gameObject.parent.id);
|
|
168
144
|
if (parentEntity) {
|
|
169
145
|
entity.transform.setParent(parentEntity.transform);
|
|
170
146
|
}
|
|
@@ -172,8 +148,8 @@ var SelectionEntityManager = /** @class */ (function () {
|
|
|
172
148
|
entity.transform.isContainer = !!deco.isContainer;
|
|
173
149
|
entity.update(register.getSelectionData(gameObject));
|
|
174
150
|
entity.ignoreTransformChanged = false;
|
|
175
|
-
|
|
176
|
-
|
|
151
|
+
const sizeVisible = !this.isHidden(entity.node); // && (entity.transform.size.width > 0 && entity.transform.size.height > 0 || !!deco.isContainer);
|
|
152
|
+
const opacityZero = this.isOpacityZero(node);
|
|
177
153
|
// 图层节点无法被选中
|
|
178
154
|
entity.selectable = entity.selectableInit && sizeVisible;
|
|
179
155
|
// 锁定状态的节点无法通过鼠标点击
|
|
@@ -184,51 +160,29 @@ var SelectionEntityManager = /** @class */ (function () {
|
|
|
184
160
|
entity.selected = !!(node === null || node === void 0 ? void 0 : node.selected);
|
|
185
161
|
// 更新zIndex, 每次都要更新,因为节点拖拽会导致所有的zIndex顺序错乱
|
|
186
162
|
entity.zIndex = gameObject.data.depth || 0;
|
|
187
|
-
}
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
var e = _c.value;
|
|
194
|
-
if (e.selectable && e.selected) {
|
|
195
|
-
selectedEntities.push(e);
|
|
196
|
-
}
|
|
197
|
-
}
|
|
198
|
-
}
|
|
199
|
-
catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
|
200
|
-
finally {
|
|
201
|
-
try {
|
|
202
|
-
if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
|
|
163
|
+
}
|
|
164
|
+
getSelectedEntities() {
|
|
165
|
+
const selectedEntities = [];
|
|
166
|
+
for (const e of this.nodeEntitiesCache.values()) {
|
|
167
|
+
if (e.selectable && e.selected) {
|
|
168
|
+
selectedEntities.push(e);
|
|
203
169
|
}
|
|
204
|
-
finally { if (e_1) throw e_1.error; }
|
|
205
170
|
}
|
|
206
171
|
return selectedEntities;
|
|
207
|
-
}
|
|
172
|
+
}
|
|
208
173
|
/**
|
|
209
174
|
* 滚动到选择器所在位置
|
|
210
175
|
*/
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
if (!model_1.Editor2dNode.isRootNode(entity.node) && entity.node && entity.selectable) {
|
|
218
|
-
if (!entity.selected && entity.node.selected) {
|
|
219
|
-
entitiesScrollTo.push(entity);
|
|
220
|
-
}
|
|
221
|
-
entity.selected = entity.node.selected;
|
|
176
|
+
scrollToSelectedNodes() {
|
|
177
|
+
const entitiesScrollTo = [];
|
|
178
|
+
for (const entity of this.nodeEntitiesCache.values()) {
|
|
179
|
+
if (!model_1.Editor2dNode.isRootNode(entity.node) && entity.node && entity.selectable) {
|
|
180
|
+
if (!entity.selected && entity.node.selected) {
|
|
181
|
+
entitiesScrollTo.push(entity);
|
|
222
182
|
}
|
|
183
|
+
entity.selected = entity.node.selected;
|
|
223
184
|
}
|
|
224
185
|
}
|
|
225
|
-
catch (e_2_1) { e_2 = { error: e_2_1 }; }
|
|
226
|
-
finally {
|
|
227
|
-
try {
|
|
228
|
-
if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
|
|
229
|
-
}
|
|
230
|
-
finally { if (e_2) throw e_2.error; }
|
|
231
|
-
}
|
|
232
186
|
if (!this.isVisible())
|
|
233
187
|
return;
|
|
234
188
|
// this.context.syncToSelectionService(this);
|
|
@@ -236,53 +190,41 @@ var SelectionEntityManager = /** @class */ (function () {
|
|
|
236
190
|
// 滚动画布到选中的节点
|
|
237
191
|
this.entityManager.getEntity(playground_1.PlaygroundConfigEntity).scrollToView({ entities: entitiesScrollTo });
|
|
238
192
|
}
|
|
239
|
-
}
|
|
193
|
+
}
|
|
240
194
|
;
|
|
241
195
|
/**
|
|
242
196
|
* 获取所有实体的外围最大矩形
|
|
243
197
|
*/
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
var entity = _c.value;
|
|
250
|
-
if (entity.transform) {
|
|
251
|
-
rects.push(entity.transform.bounds);
|
|
252
|
-
}
|
|
253
|
-
}
|
|
254
|
-
}
|
|
255
|
-
catch (e_3_1) { e_3 = { error: e_3_1 }; }
|
|
256
|
-
finally {
|
|
257
|
-
try {
|
|
258
|
-
if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
|
|
198
|
+
getEntityEnlargeBounds(minWidth, minHeight) {
|
|
199
|
+
const rects = [new math_1.Rectangle(0, 0, minWidth, minHeight)];
|
|
200
|
+
for (const entity of this.nodeEntitiesCache.values()) {
|
|
201
|
+
if (entity.transform) {
|
|
202
|
+
rects.push(entity.transform.bounds);
|
|
259
203
|
}
|
|
260
|
-
finally { if (e_3) throw e_3.error; }
|
|
261
204
|
}
|
|
262
205
|
return math_1.Rectangle.enlarge(rects);
|
|
263
|
-
}
|
|
264
|
-
|
|
206
|
+
}
|
|
207
|
+
isOpacityZero(node) {
|
|
265
208
|
if (!node)
|
|
266
209
|
return false;
|
|
267
210
|
if (node.opacity === 0)
|
|
268
211
|
return true;
|
|
269
212
|
return this.isOpacityZero(node.parent);
|
|
270
|
-
}
|
|
271
|
-
|
|
213
|
+
}
|
|
214
|
+
isHidden(node) {
|
|
272
215
|
if (!node)
|
|
273
216
|
return false;
|
|
274
217
|
if (node.canvasHide)
|
|
275
218
|
return true;
|
|
276
219
|
return this.isHidden(node.parent);
|
|
277
|
-
}
|
|
278
|
-
|
|
220
|
+
}
|
|
221
|
+
isLocked(node) {
|
|
279
222
|
if (!node)
|
|
280
223
|
return false;
|
|
281
224
|
if (node.locked)
|
|
282
225
|
return true;
|
|
283
226
|
return this.isLocked(node.parent);
|
|
284
|
-
}
|
|
285
|
-
|
|
286
|
-
}());
|
|
227
|
+
}
|
|
228
|
+
}
|
|
287
229
|
exports.SelectionEntityManager = SelectionEntityManager;
|
|
288
230
|
//# sourceMappingURL=selection-entity-manager.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"selection-entity-manager.js","sourceRoot":"","sources":["../../../src/browser/playground/selection-entity-manager.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"selection-entity-manager.js","sourceRoot":"","sources":["../../../src/browser/playground/selection-entity-manager.tsx"],"names":[],"mappings":";;;AAAA,+BAA+B;AAC/B,oCAA0D;AAC1D,gEAA4D;AAE5D,kDAK2B;AAE3B,sCAAwC;AAExC,yEAAkE;AAElE,MAAM,cAAc,GAAG,CAAC,IAA0B,EAAE,EAAE;IACpD,MAAM,CAAC,GAAQ,EAAE,CAAC;IAClB,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,OAAO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|
2
|
-
var _a;
|
|
3
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
3
|
exports.selectIcon = exports.flipY = exports.SelectorExtendType = void 0;
|
|
5
4
|
/* eslint-disable max-len */
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
5
|
+
const React = require("react");
|
|
6
|
+
const icons_1 = require("@ant-design/icons");
|
|
7
|
+
const render_engine_ide_1 = require("@gedit/render-engine-ide");
|
|
9
8
|
Object.defineProperty(exports, "SelectorExtendType", { enumerable: true, get: function () { return render_engine_ide_1.GameObjectSelectorExtendType; } });
|
|
10
9
|
/* const commonIcon = () => (
|
|
11
10
|
<svg
|
|
@@ -22,21 +21,21 @@ Object.defineProperty(exports, "SelectorExtendType", { enumerable: true, get: fu
|
|
|
22
21
|
/>
|
|
23
22
|
</svg>
|
|
24
23
|
); */
|
|
25
|
-
|
|
24
|
+
const flipX = () => (React.createElement("svg", { width: "1em", height: "1em", viewBox: "0 0 14 13" },
|
|
26
25
|
React.createElement("g", { id: "\u9875\u9762-1", stroke: "currentColor", strokeWidth: "1", fill: "none", fillRule: "evenodd", strokeLinecap: "round", strokeLinejoin: "round" },
|
|
27
26
|
React.createElement("polygon", { id: "\u8DEF\u5F84-2", points: "0 10.9051487 4.6880494 10.9051487 4.6880494 1.4679916e-14" }),
|
|
28
|
-
React.createElement("polygon", { id: "\u8DEF\u5F84-2\u5907\u4EFD", fill: "currentColor", transform: "translate(9.344025, 5.452574) scale(-1, 1) translate(-9.344025, -5.452574) ", points: "7 10.9051487 11.6880494 10.9051487 11.6880494 1.4679916e-14" }))));
|
|
29
|
-
|
|
27
|
+
React.createElement("polygon", { id: "\u8DEF\u5F84-2\u5907\u4EFD", fill: "currentColor", transform: "translate(9.344025, 5.452574) scale(-1, 1) translate(-9.344025, -5.452574) ", points: "7 10.9051487 11.6880494 10.9051487 11.6880494 1.4679916e-14" }))));
|
|
28
|
+
const flipY = () => (React.createElement("svg", { width: "1em", height: "1em", viewBox: "0 0 13 14" },
|
|
30
29
|
React.createElement("g", { id: "\u9875\u9762-1", stroke: "currentColor", strokeWidth: "1", fill: "none", fillRule: "evenodd", strokeLinecap: "round", strokeLinejoin: "round", transform: "scale(-1, 1) rotate(90.000000)" },
|
|
31
30
|
React.createElement("polygon", { points: "0 10.9051487 4.6880494 10.9051487 4.6880494 4.80706427e-14" }),
|
|
32
|
-
React.createElement("polygon", { fill: "currentColor", transform: "translate(9.344025, 5.452574) scale(-1, 1) translate(-9.344025, -5.452574) ", points: "7 10.9051487 11.6880494 10.9051487 11.6880494 4.84992691e-14" }))));
|
|
31
|
+
React.createElement("polygon", { fill: "currentColor", transform: "translate(9.344025, 5.452574) scale(-1, 1) translate(-9.344025, -5.452574) ", points: "7 10.9051487 11.6880494 10.9051487 11.6880494 4.84992691e-14" }))));
|
|
33
32
|
exports.flipY = flipY;
|
|
34
|
-
exports.selectIcon =
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
33
|
+
exports.selectIcon = {
|
|
34
|
+
[render_engine_ide_1.GameObjectSelectorExtendType.TO_TOP]: React.createElement(icons_1.ArrowUpOutlined, null),
|
|
35
|
+
[render_engine_ide_1.GameObjectSelectorExtendType.TO_BOTTOM]: React.createElement(icons_1.ArrowDownOutlined, null),
|
|
36
|
+
[render_engine_ide_1.GameObjectSelectorExtendType.FLIP_X]: React.createElement(icons_1.default, { component: flipX }),
|
|
37
|
+
[render_engine_ide_1.GameObjectSelectorExtendType.FLIP_Y]: React.createElement(icons_1.default, { component: exports.flipY }),
|
|
38
|
+
[render_engine_ide_1.GameObjectSelectorExtendType.DELETE]: React.createElement(icons_1.DeleteOutlined, null),
|
|
39
|
+
[render_engine_ide_1.GameObjectSelectorExtendType.LINK]: React.createElement(icons_1.LinkOutlined, null),
|
|
40
|
+
};
|
|
42
41
|
//# sourceMappingURL=selector-extend-icons.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"selector-extend-icons.js","sourceRoot":"","sources":["../../../src/browser/playground/selector-extend-icons.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"selector-extend-icons.js","sourceRoot":"","sources":["../../../src/browser/playground/selector-extend-icons.tsx"],"names":[],"mappings":";;;AAAA,4BAA4B;AAC5B,+BAA+B;AAC/B,6CAK2B;AAC3B,gEAA8F;AAG5F,mGAHuC,gDAAkB,OAGvC;AAEpB;;;;;;;;;;;;;;KAcK;AAEL,MAAM,KAAK,GAAG,GAAG,EAAE,CAAC,CAClB,6BAAK,KAAK,EAAC,KAAK,EAAC,MAAM,EAAC,KAAK,EAAC,OAAO,EAAC,WAAW;IAC/C,2BACE,EAAE,EAAC,gBAAM,EACT,MAAM,EAAC,cAAc,EACrB,WAAW,EAAC,GAAG,EACf,IAAI,EAAC,MAAM,EACX,QAAQ,EAAC,SAAS,EAClB,aAAa,EAAC,OAAO,EACrB,cAAc,EAAC,OAAO;QAEtB,iCACE,EAAE,EAAC,gBAAM,EACT,MAAM,EAAC,2DAA2D,GACzD;QACX,iCACE,EAAE,EAAC,4BAAQ,EACX,IAAI,EAAC,cAAc,EACnB,SAAS,EAAC,6EAA6E,EACvF,MAAM,EAAC,6DAA6D,GAC3D,CACT,CACA,CACP,CAAC;AACK,MAAM,KAAK,GAAG,GAAG,EAAE,CAAC,CACzB,6BAAK,KAAK,EAAC,KAAK,EAAC,MAAM,EAAC,KAAK,EAAC,OAAO,EAAC,WAAW;IAC/C,2BACE,EAAE,EAAC,gBAAM,EACT,MAAM,EAAC,cAAc,EACrB,WAAW,EAAC,GAAG,EACf,IAAI,EAAC,MAAM,EACX,QAAQ,EAAC,SAAS,EAClB,aAAa,EAAC,OAAO,EACrB,cAAc,EAAC,OAAO,EACtB,SAAS,EAAC,gCAAgC;QAE1C,iCAAS,MAAM,EAAC,4DAA4D,GAAG;QAC/E,iCACE,IAAI,EAAC,cAAc,EACnB,SAAS,EAAC,6EAA6E,EACvF,MAAM,EA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