@_unit/unit 1.0.1 → 1.0.3
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/$wrap.js +2 -1
- package/lib/$wrap.js.map +1 -1
- package/lib/boot/index.js +4 -2
- package/lib/boot/index.js.map +1 -1
- package/lib/client/platform/web/api/alert.d.ts +3 -0
- package/lib/client/platform/web/api/alert.js +12 -0
- package/lib/client/platform/web/api/alert.js.map +1 -0
- package/lib/client/platform/web/boot.js +3 -0
- package/lib/client/platform/web/boot.js.map +1 -1
- package/lib/interface.d.ts +32 -0
- package/lib/interface.js +32 -1
- package/lib/interface.js.map +1 -1
- package/lib/proxyWrap.js +25 -1
- package/lib/proxyWrap.js.map +1 -1
- package/lib/script/util.js +0 -1
- package/lib/script/util.js.map +1 -1
- package/lib/server/index.d.ts +1 -1
- package/lib/server/index.js +1 -1
- package/lib/system/_classes.d.ts +0 -2
- package/lib/system/_classes.js +0 -2
- package/lib/system/_classes.js.map +1 -1
- package/lib/system/_ids.d.ts +0 -1
- package/lib/system/_ids.js +7 -8
- package/lib/system/_ids.js.map +1 -1
- package/lib/system/_specs.js +1 -1
- package/lib/system/_specs.js.map +1 -1
- package/lib/types/AllKeys.d.ts +6 -0
- package/lib/types/AllKeys.js +3 -0
- package/lib/types/AllKeys.js.map +1 -0
- package/lib/types/interface/S.d.ts +2 -1
- package/lib/types/interface/async/$S.d.ts +2 -1
- package/lib/types/interface/async/$S.js.map +1 -1
- package/lib/types/interface/async/AsyncS.js +2 -2
- package/lib/types/interface/async/AsyncS.js.map +1 -1
- package/package.json +2 -4
- package/src/server/index.ts +1 -1
- package/lib/api/peer/config.d.ts +0 -2
- package/lib/api/peer/config.js +0 -13
- package/lib/api/peer/config.js.map +0 -1
- package/lib/debug/graph/watchInjectGraph.d.ts +0 -9
- package/lib/debug/graph/watchInjectGraph.js +0 -23
- package/lib/debug/graph/watchInjectGraph.js.map +0 -1
- package/lib/debug/watchUnitLeafEvent.d.ts +0 -11
- package/lib/debug/watchUnitLeafEvent.js +0 -21
- package/lib/debug/watchUnitLeafEvent.js.map +0 -1
- package/lib/debug/watchUnitLeafExposedPinSetEvent.d.ts +0 -13
- package/lib/debug/watchUnitLeafExposedPinSetEvent.js +0 -23
- package/lib/debug/watchUnitLeafExposedPinSetEvent.js.map +0 -1
- package/lib/debug/watchUnitLeafForkEvent.d.ts +0 -11
- package/lib/debug/watchUnitLeafForkEvent.js +0 -21
- package/lib/debug/watchUnitLeafForkEvent.js.map +0 -1
- package/lib/debug/watchUnitLeafInjectEvent.d.ts +0 -12
- package/lib/debug/watchUnitLeafInjectEvent.js +0 -21
- package/lib/debug/watchUnitLeafInjectEvent.js.map +0 -1
- package/lib/debug/watchUnitLeafMoveSubgraphIntoEvent.d.ts +0 -69
- package/lib/debug/watchUnitLeafMoveSubgraphIntoEvent.js +0 -28
- package/lib/debug/watchUnitLeafMoveSubgraphIntoEvent.js.map +0 -1
- package/lib/system/platform/Boot/index.d.ts +0 -18
- package/lib/system/platform/Boot/index.js +0 -50
- package/lib/system/platform/Boot/index.js.map +0 -1
- package/lib/system/platform/System/index.d.ts +0 -16
- package/lib/system/platform/System/index.js +0 -27
- package/lib/system/platform/System/index.js.map +0 -1
- package/lib/system/platform/api/canvas/AddPath/index.d.ts +0 -14
- package/lib/system/platform/api/canvas/AddPath/index.js +0 -19
- package/lib/system/platform/api/canvas/AddPath/index.js.map +0 -1
- package/lib/system/platform/api/peer/PeerSharePod/index.d.ts +0 -27
- package/lib/system/platform/api/peer/PeerSharePod/index.js +0 -120
- package/lib/system/platform/api/peer/PeerSharePod/index.js.map +0 -1
- package/lib/system/platform/component/app/History/Component.d.ts +0 -34
- package/lib/system/platform/component/app/History/Component.js +0 -163
- package/lib/system/platform/component/app/History/Component.js.map +0 -1
- package/lib/types/interface/async/$P.d.ts +0 -24
- package/lib/types/interface/async/$P.js +0 -12
- package/lib/types/interface/async/$P.js.map +0 -1
|
@@ -1,120 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
-
});
|
|
10
|
-
};
|
|
11
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
const config_1 = require("../../../../../api/peer/config");
|
|
13
|
-
const Peer_1 = require("../../../../../api/peer/Peer");
|
|
14
|
-
const Semifunctional_1 = require("../../../../../Class/Semifunctional");
|
|
15
|
-
const makeUnitRemoteRef_1 = require("../../../../../client/makeUnitRemoteRef");
|
|
16
|
-
const STRING_1 = require("../../../../../constant/STRING");
|
|
17
|
-
const evaluate_1 = require("../../../../../spec/evaluate");
|
|
18
|
-
const stringify_1 = require("../../../../../spec/stringify");
|
|
19
|
-
const AsyncU_1 = require("../../../../../types/interface/async/AsyncU");
|
|
20
|
-
const _ids_1 = require("../../../../_ids");
|
|
21
|
-
class PeerShareGraph extends Semifunctional_1.Semifunctional {
|
|
22
|
-
constructor(system) {
|
|
23
|
-
super({
|
|
24
|
-
fi: ['graph'],
|
|
25
|
-
fo: [],
|
|
26
|
-
i: ['answer'],
|
|
27
|
-
o: ['offer'],
|
|
28
|
-
}, {
|
|
29
|
-
input: {
|
|
30
|
-
graph: {
|
|
31
|
-
ref: true,
|
|
32
|
-
},
|
|
33
|
-
},
|
|
34
|
-
}, system, _ids_1.ID_PEER_SHARE_GRAPH);
|
|
35
|
-
this.__ = ['U'];
|
|
36
|
-
this._connected = false;
|
|
37
|
-
this._disconnect = () => {
|
|
38
|
-
this._send_terminate();
|
|
39
|
-
};
|
|
40
|
-
this._close = () => {
|
|
41
|
-
this._ref = null;
|
|
42
|
-
};
|
|
43
|
-
this._send = (data) => {
|
|
44
|
-
const message = (0, stringify_1.stringify)(data);
|
|
45
|
-
this._peer.send(message);
|
|
46
|
-
};
|
|
47
|
-
this._send_init = () => {
|
|
48
|
-
this._send({ type: STRING_1.INIT });
|
|
49
|
-
};
|
|
50
|
-
this._send_exec = (data) => {
|
|
51
|
-
this._send({ type: STRING_1.EXEC, data });
|
|
52
|
-
};
|
|
53
|
-
this._send_terminate = () => {
|
|
54
|
-
this._send({ type: STRING_1.TERMINATE });
|
|
55
|
-
};
|
|
56
|
-
this.addListener('destroy', () => {
|
|
57
|
-
// console.log('PeerShareGraph', 'destroy')
|
|
58
|
-
if (this._connected) {
|
|
59
|
-
this._disconnect();
|
|
60
|
-
this._close();
|
|
61
|
-
}
|
|
62
|
-
});
|
|
63
|
-
const peer = new Peer_1.Peer(this.__system, true, config_1.DEFAULT_STUN_RTC_CONFIG);
|
|
64
|
-
peer.addListener('connect', () => {
|
|
65
|
-
// console.log('PeerShareGraph', 'connect')
|
|
66
|
-
this._connected = true;
|
|
67
|
-
if (this._input.graph.active()) {
|
|
68
|
-
this._send_init();
|
|
69
|
-
}
|
|
70
|
-
});
|
|
71
|
-
peer.addListener('close', () => {
|
|
72
|
-
// console.log('PeerShareGraph', 'close')
|
|
73
|
-
this._connected = false;
|
|
74
|
-
});
|
|
75
|
-
peer.addListener('message', (message) => {
|
|
76
|
-
// console.log('PeerShareGraph', 'message', message)
|
|
77
|
-
if (this._ref) {
|
|
78
|
-
const specs = this.__system.specs;
|
|
79
|
-
const classes = this.__system.classes;
|
|
80
|
-
const data = (0, evaluate_1.evaluate)(message, specs, classes);
|
|
81
|
-
this._ref.exec(data);
|
|
82
|
-
}
|
|
83
|
-
});
|
|
84
|
-
this._peer = peer;
|
|
85
|
-
(() => __awaiter(this, void 0, void 0, function* () {
|
|
86
|
-
const offer = yield peer.offer();
|
|
87
|
-
this._output.offer.push(offer);
|
|
88
|
-
}))();
|
|
89
|
-
}
|
|
90
|
-
f({ graph }) {
|
|
91
|
-
const { __global_id } = graph;
|
|
92
|
-
const $graph = (0, AsyncU_1.$$refGlobalObj)(this.__system, __global_id, [
|
|
93
|
-
'$U',
|
|
94
|
-
'$C',
|
|
95
|
-
'$G',
|
|
96
|
-
]);
|
|
97
|
-
const ref = (0, makeUnitRemoteRef_1.$makeUnitRemoteRef)($graph, ['$U', '$C', '$G'], (data) => {
|
|
98
|
-
this._send_exec(data);
|
|
99
|
-
});
|
|
100
|
-
this._ref = ref;
|
|
101
|
-
if (this._connected) {
|
|
102
|
-
this._send_init();
|
|
103
|
-
}
|
|
104
|
-
}
|
|
105
|
-
d() {
|
|
106
|
-
this._disconnect();
|
|
107
|
-
}
|
|
108
|
-
onIterDataInputData(name, data) {
|
|
109
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
110
|
-
// if (name === 'answer') {
|
|
111
|
-
yield this._peer.acceptAnswer(data);
|
|
112
|
-
// }
|
|
113
|
-
});
|
|
114
|
-
}
|
|
115
|
-
onIterDataInputDrop(name) {
|
|
116
|
-
return __awaiter(this, void 0, void 0, function* () { });
|
|
117
|
-
}
|
|
118
|
-
}
|
|
119
|
-
exports.default = PeerShareGraph;
|
|
120
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"src/","sources":["system/platform/api/peer/PeerSharePod/index.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,2DAAwE;AACxE,uDAAmD;AAEnD,wEAAoE;AACpE,+EAA4E;AAE5E,2DAAsE;AACtE,2DAAuD;AACvD,6DAAyD;AAEzD,wEAA4E;AAC5E,2CAAsD;AAWtD,MAAqB,cAAe,SAAQ,+BAAoB;IAO9D,YAAY,MAAc;QACxB,KAAK,CACH;YACE,EAAE,EAAE,CAAC,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E,WAAW,EAAE,GAAG,KAAK,CAAA;QAE7B,MAAM,MAAM,GAAG,IAAA,uBAAc,EAAC,IAAI,CAAC,QAAQ,EAAE,WAAW,EAAE;YACxD,IAAI;YACJ,IAAI;YACJ,IAAI;SACL,CAAC,CAAA;QAEF,MAAM,GAAG,GAAG,IAAA,sCAAkB,EAAC,MAAM,EAAE,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,CAAC,EAAE,CAAC,IAAI,EAAE,EAAE;YAClE,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,CAAA;QACvB,CAAC,CAAC,CAAA;QAEF,IAAI,CAAC,IAAI,GAAG,GAAG,CAAA;QAEf,IAAI,IAAI,CAAC,UAAU,EAAE;YACnB,IAAI,CAAC,UAAU,EAAE,CAAA;SAClB;IACH,CAAC;IAED,CAAC;QACC,IAAI,CAAC,WAAW,EAAE,CAAA;IACpB,CAAC;IAEY,mBAAmB,CAAC,IAAY,EAAE,IAAS;;YACtD,2BAA2B;YAC3B,MAAM,IAAI,CAAC,KAAK,CAAC,YAAY,CAAC,IAAI,CAAC,CAAA;YACnC,IAAI;QACN,CAAC;KAAA;IAEY,mBAAmB,CAAC,IAAY;8DAAkB,CAAC;KAAA;CACjE;AA/HD,iCA+HC"}
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import { Element } from '../../../../../client/element';
|
|
2
|
-
import { Size, Thing } from '../../../../../client/util/geometry';
|
|
3
|
-
import { System } from '../../../../../system';
|
|
4
|
-
import { Dict } from '../../../../../types/Dict';
|
|
5
|
-
import { IHTMLDivElement } from '../../../../../types/global/dom';
|
|
6
|
-
import SVGSVG from '../../svg/SVG/Component';
|
|
7
|
-
export declare const getMinimapSize: ($width: number, $height: number) => Size;
|
|
8
|
-
export interface Props {
|
|
9
|
-
width: number;
|
|
10
|
-
height: number;
|
|
11
|
-
nodes?: Dict<Thing>;
|
|
12
|
-
links?: Dict<any>;
|
|
13
|
-
style?: Dict<string>;
|
|
14
|
-
padding?: number;
|
|
15
|
-
}
|
|
16
|
-
export declare const DEFAULT_STYLE: {};
|
|
17
|
-
export declare const MINIMAP_WIDTH = 200;
|
|
18
|
-
export declare const MINIMAP_HEIGHT = 150;
|
|
19
|
-
export default class History extends Element<IHTMLDivElement, Props> {
|
|
20
|
-
_map_el: SVGSVG;
|
|
21
|
-
private _map_graph;
|
|
22
|
-
private _map_children;
|
|
23
|
-
private _node_component;
|
|
24
|
-
private _link_el;
|
|
25
|
-
_min_x: number;
|
|
26
|
-
_max_x: number;
|
|
27
|
-
_min_y: number;
|
|
28
|
-
_max_y: number;
|
|
29
|
-
_width: number;
|
|
30
|
-
_height: number;
|
|
31
|
-
constructor($props: Props, $system: System);
|
|
32
|
-
onPropChanged(prop: string, current: any): void;
|
|
33
|
-
tick(): void;
|
|
34
|
-
}
|
|
@@ -1,163 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.MINIMAP_HEIGHT = exports.MINIMAP_WIDTH = exports.DEFAULT_STYLE = exports.getMinimapSize = void 0;
|
|
4
|
-
const namespaceURI_1 = require("../../../../../client/component/namespaceURI");
|
|
5
|
-
const element_1 = require("../../../../../client/element");
|
|
6
|
-
const id_1 = require("../../../../../client/id");
|
|
7
|
-
const parentElement_1 = require("../../../../../client/platform/web/parentElement");
|
|
8
|
-
const theme_1 = require("../../../../../client/theme");
|
|
9
|
-
const geometry_1 = require("../../../../../client/util/geometry");
|
|
10
|
-
const object_1 = require("../../../../../util/object");
|
|
11
|
-
const Component_1 = require("../../svg/Group/Component");
|
|
12
|
-
const Component_2 = require("../../svg/Path/Component");
|
|
13
|
-
const Component_3 = require("../../svg/SVG/Component");
|
|
14
|
-
const MINIMAP_AREA = 180 * 180;
|
|
15
|
-
const getMinimapSize = ($width, $height) => {
|
|
16
|
-
const screen_ratio = $width / $height;
|
|
17
|
-
const width = Math.sqrt(MINIMAP_AREA * screen_ratio);
|
|
18
|
-
const height = Math.sqrt(MINIMAP_AREA / screen_ratio);
|
|
19
|
-
return { width, height };
|
|
20
|
-
};
|
|
21
|
-
exports.getMinimapSize = getMinimapSize;
|
|
22
|
-
exports.DEFAULT_STYLE = {};
|
|
23
|
-
exports.MINIMAP_WIDTH = 200;
|
|
24
|
-
exports.MINIMAP_HEIGHT = 150;
|
|
25
|
-
class History extends element_1.Element {
|
|
26
|
-
constructor($props, $system) {
|
|
27
|
-
super($props, $system);
|
|
28
|
-
this._node_component = {};
|
|
29
|
-
this._link_el = {};
|
|
30
|
-
this._min_x = 1000000;
|
|
31
|
-
this._max_x = -1000000;
|
|
32
|
-
this._min_y = 1000000;
|
|
33
|
-
this._max_y = -1000000;
|
|
34
|
-
const { style, width, height } = $props;
|
|
35
|
-
const map_graph = new Component_1.default({ className: 'minimap-graph' }, this.$system);
|
|
36
|
-
this._map_graph = map_graph;
|
|
37
|
-
// TODO bring "minimap screen" to minimap
|
|
38
|
-
const map_children = new Component_1.default({ className: 'minimap-children' }, this.$system);
|
|
39
|
-
this._map_children = map_children;
|
|
40
|
-
const svg = new Component_3.default({
|
|
41
|
-
className: 'minimap',
|
|
42
|
-
width,
|
|
43
|
-
height,
|
|
44
|
-
style: Object.assign(Object.assign({}, exports.DEFAULT_STYLE), style),
|
|
45
|
-
viewBox: '0 0 0 0',
|
|
46
|
-
tabIndex: -1,
|
|
47
|
-
}, this.$system);
|
|
48
|
-
svg.preventDefault('mousedown');
|
|
49
|
-
svg.preventDefault('touchdown');
|
|
50
|
-
this._map_el = svg;
|
|
51
|
-
this.tick();
|
|
52
|
-
const $element = (0, parentElement_1.default)($system);
|
|
53
|
-
this.$element = $element;
|
|
54
|
-
this.$slot = map_children.$slot;
|
|
55
|
-
this.$subComponent = {
|
|
56
|
-
svg,
|
|
57
|
-
map_graph,
|
|
58
|
-
map_children,
|
|
59
|
-
};
|
|
60
|
-
this.$unbundled = false;
|
|
61
|
-
this.registerRoot(svg);
|
|
62
|
-
svg.registerParentRoot(map_graph);
|
|
63
|
-
svg.registerParentRoot(map_children);
|
|
64
|
-
svg.$element.onfocus = () => {
|
|
65
|
-
// console.log('Minimap', 'onFocus')
|
|
66
|
-
};
|
|
67
|
-
}
|
|
68
|
-
onPropChanged(prop, current) {
|
|
69
|
-
// console.log('Minimap', 'onPropChanged', prop, current)
|
|
70
|
-
if (prop === 'style') {
|
|
71
|
-
this._map_el.setProp('style', Object.assign(Object.assign({}, exports.DEFAULT_STYLE), current));
|
|
72
|
-
}
|
|
73
|
-
}
|
|
74
|
-
tick() {
|
|
75
|
-
const { nodes = {}, links = {}, padding = 0 } = this.$props;
|
|
76
|
-
for (const node_id in this._node_component) {
|
|
77
|
-
if (!nodes[node_id]) {
|
|
78
|
-
const node_el = this._node_component[node_id];
|
|
79
|
-
this._map_graph.$element.removeChild(node_el.$element);
|
|
80
|
-
delete this._node_component[node_id];
|
|
81
|
-
}
|
|
82
|
-
}
|
|
83
|
-
for (const link_id in this._link_el) {
|
|
84
|
-
if (!links[link_id]) {
|
|
85
|
-
const link_el = this._link_el[link_id];
|
|
86
|
-
this._map_graph.$element.removeChild(link_el);
|
|
87
|
-
delete this._link_el[link_id];
|
|
88
|
-
}
|
|
89
|
-
}
|
|
90
|
-
if ((0, object_1.isEmptyObject)(nodes)) {
|
|
91
|
-
return;
|
|
92
|
-
}
|
|
93
|
-
let min_x = Number.MAX_SAFE_INTEGER;
|
|
94
|
-
let max_x = Number.MIN_SAFE_INTEGER;
|
|
95
|
-
let min_y = Number.MAX_SAFE_INTEGER;
|
|
96
|
-
let max_y = Number.MIN_SAFE_INTEGER;
|
|
97
|
-
for (const node_id in nodes) {
|
|
98
|
-
const node = nodes[node_id];
|
|
99
|
-
const { x, y, width, height, r, shape } = node;
|
|
100
|
-
min_x = Math.min(min_x, x - width / 2);
|
|
101
|
-
max_x = Math.max(max_x, x + width / 2);
|
|
102
|
-
min_y = Math.min(min_y, y - height / 2);
|
|
103
|
-
max_y = Math.max(max_y, y + height / 2);
|
|
104
|
-
let node_component = this._node_component[node_id];
|
|
105
|
-
if (!node_component) {
|
|
106
|
-
node_component = new Component_2.default({
|
|
107
|
-
style: {
|
|
108
|
-
fill: theme_1.COLOR_NONE,
|
|
109
|
-
pointerEvents: 'none',
|
|
110
|
-
strokeWidth: 'inherit',
|
|
111
|
-
},
|
|
112
|
-
}, this.$system);
|
|
113
|
-
this._node_component[node_id] = node_component;
|
|
114
|
-
this._map_graph.appendChild(node_component);
|
|
115
|
-
}
|
|
116
|
-
const d = shape === 'circle'
|
|
117
|
-
? (0, geometry_1.describeCircle)(x, y, r)
|
|
118
|
-
: (0, geometry_1.describeRect)(x - width / 2, y - height / 2, width, height);
|
|
119
|
-
node_component.setProp('d', d);
|
|
120
|
-
}
|
|
121
|
-
for (const link_id in links) {
|
|
122
|
-
const { source, target } = (0, id_1.segmentLinkId)(link_id);
|
|
123
|
-
let link_el = this._link_el[link_id];
|
|
124
|
-
if (!link_el) {
|
|
125
|
-
link_el = this.$system.api.document.createElementNS(namespaceURI_1.default, 'line');
|
|
126
|
-
// link_el.setAttribute('stroke', 'currentColor')
|
|
127
|
-
link_el.style.pointerEvents = 'none';
|
|
128
|
-
this._link_el[link_id] = link_el;
|
|
129
|
-
// TODO use Component appendChild
|
|
130
|
-
this._map_graph.$element.appendChild(link_el);
|
|
131
|
-
}
|
|
132
|
-
const sourceNode = nodes[source];
|
|
133
|
-
const targetNode = nodes[target];
|
|
134
|
-
const { x: x0, y: y0 } = sourceNode;
|
|
135
|
-
const { x: x1, y: y1 } = targetNode;
|
|
136
|
-
const u = (0, geometry_1.unitVector)(x0, y0, x1, y1);
|
|
137
|
-
const nu = (0, geometry_1.oppositeVector)(u);
|
|
138
|
-
const { x: _x0, y: _y0 } = (0, geometry_1.pointInNode)(sourceNode, u);
|
|
139
|
-
const { x: _x1, y: _y1 } = (0, geometry_1.pointInNode)(targetNode, nu);
|
|
140
|
-
link_el.setAttribute('x1', `${_x0}`);
|
|
141
|
-
link_el.setAttribute('y1', `${_y0}`);
|
|
142
|
-
link_el.setAttribute('x2', `${_x1}`);
|
|
143
|
-
link_el.setAttribute('y2', `${_y1}`);
|
|
144
|
-
}
|
|
145
|
-
min_x -= padding;
|
|
146
|
-
min_y -= padding;
|
|
147
|
-
max_x += padding;
|
|
148
|
-
max_y += padding;
|
|
149
|
-
const width = max_x - min_x;
|
|
150
|
-
const height = max_y - min_y;
|
|
151
|
-
this._min_x = min_x;
|
|
152
|
-
this._min_y = min_y;
|
|
153
|
-
this._max_x = max_x;
|
|
154
|
-
this._max_y = max_y;
|
|
155
|
-
this._width = width;
|
|
156
|
-
this._height = height;
|
|
157
|
-
const strokeWidth = width / exports.MINIMAP_WIDTH + height / exports.MINIMAP_HEIGHT;
|
|
158
|
-
this._map_el.setProp('strokeWidth', strokeWidth);
|
|
159
|
-
this._map_el.setProp('viewBox', `${min_x} ${min_y} ${width} ${height}`);
|
|
160
|
-
}
|
|
161
|
-
}
|
|
162
|
-
exports.default = History;
|
|
163
|
-
//# sourceMappingURL=Component.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Component.js","sourceRoot":"src/","sources":["system/platform/component/app/History/Component.ts"],"names":[],"mappings":";;;AAAA,+EAAuE;AACvE,2DAAuD;AACvD,iDAAwD;AACxD,oFAA4E;AAC5E,uDAAwD;AACxD,kEAQ4C;AAI5C,uDAA0D;AAC1D,yDAA4C;AAC5C,wDAA8C;AAC9C,uDAA4C;AAE5C,MAAM,YAAY,GAAG,GAAG,GAAG,GAAG,CAAA;AAEvB,MAAM,cAAc,GAAG,CAAC,MAAc,EAAE,OAAe,EAAQ,EAAE;IACtE,MAAM,YAAY,GAAW,MAAM,GAAG,OAAO,CAAA;IAC7C,MAAM,KAAK,GAAG,IAAI,CAAC,IAAI,CAAC,YAAY,GAAG,YAAY,CAAC,CAAA;IACpD,MAAM,MAAM,GAAG,IAAI,CAAC,IAAI,CAAC,YAAY,GAAG,YAAY,CAAC,CAAA;IACrD,OAAO,EAAE,KAAK,EAAE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,CAAA;QACnB,IAAI,CAAC,MAAM,GAAG,KAAK,CAAA;QACnB,IAAI,CAAC,MAAM,GAAG,KAAK,CAAA;QACnB,IAAI,CAAC,MAAM,GAAG,KAAK,CAAA;QACnB,IAAI,CAAC,MAAM,GAAG,KAAK,CAAA;QACnB,IAAI,CAAC,OAAO,GAAG,MAAM,CAAA;QAErB,MAAM,WAAW,GAAG,KAAK,GAAG,qBAAa,GAAG,MAAM,GAAG,sBAAc,CAAA;QAEnE,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,aAAa,EAAE,WAAW,CAAC,CAAA;QAChD,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,SAAS,EAAE,GAAG,KAAK,IAAI,KAAK,IAAI,KAAK,IAAI,MAAM,EAAE,CAAC,CAAA;IACzE,CAAC;CACF;AAlMD,0BAkMC"}
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import { GraphSpec } from '../..';
|
|
2
|
-
import { BundleSpec } from '../../BundleSpec';
|
|
3
|
-
import { Callback } from '../../Callback';
|
|
4
|
-
import { $Graph } from './$Graph';
|
|
5
|
-
export declare const $P_METHOD_CALL: any[];
|
|
6
|
-
export declare const $P_METHOD_WATCH: any[];
|
|
7
|
-
export declare const $P_METHOD_REF: string[];
|
|
8
|
-
export declare const $V_METHOD: any[];
|
|
9
|
-
export interface $P_C {
|
|
10
|
-
$getSpecs(data: {}, callback: Callback<GraphSpec>): void;
|
|
11
|
-
}
|
|
12
|
-
export interface $P_W {
|
|
13
|
-
}
|
|
14
|
-
export interface $P_R {
|
|
15
|
-
$refGlobalUnit(data: {
|
|
16
|
-
id: string;
|
|
17
|
-
_: string[];
|
|
18
|
-
}): any;
|
|
19
|
-
$refGraph(data: {
|
|
20
|
-
bundle: BundleSpec;
|
|
21
|
-
}): $Graph;
|
|
22
|
-
}
|
|
23
|
-
export interface $P extends $P_C, $P_W, $P_R {
|
|
24
|
-
}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.$V_METHOD = exports.$P_METHOD_REF = exports.$P_METHOD_WATCH = exports.$P_METHOD_CALL = void 0;
|
|
4
|
-
exports.$P_METHOD_CALL = [];
|
|
5
|
-
exports.$P_METHOD_WATCH = [];
|
|
6
|
-
exports.$P_METHOD_REF = ['refGlobalUnit', 'refGraph'];
|
|
7
|
-
exports.$V_METHOD = [
|
|
8
|
-
...exports.$P_METHOD_CALL,
|
|
9
|
-
...exports.$P_METHOD_WATCH,
|
|
10
|
-
...exports.$P_METHOD_REF,
|
|
11
|
-
];
|
|
12
|
-
//# sourceMappingURL=$P.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"$P.js","sourceRoot":"src/","sources":["types/interface/async/$P.ts"],"names":[],"mappings":";;;AAKa,QAAA,cAAc,GAAG,EAAE,CAAA;AACnB,QAAA,eAAe,GAAG,EAAE,CAAA;AACpB,QAAA,aAAa,GAAG,CAAC,eAAe,EAAE,UAAU,CAAC,CAAA;AAE7C,QAAA,SAAS,GAAG;IACvB,GAAG,sBAAc;IACjB,GAAG,uBAAe;IAClB,GAAG,qBAAa;CACjB,CAAA"}
|