@hatiolab/things-scene 3.4.39 → 3.4.42
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/db.sqlite +0 -0
- package/package.json +1 -1
- package/schema.graphql +3966 -0
- package/things-scene-ie.js +1 -1
- package/things-scene-min.js +1 -1
- package/things-scene.mjs +2 -2
- package/dist/animation/animate.d.ts +0 -4
- package/dist/animation/animations/animation.d.ts +0 -14
- package/dist/animation/animations/fade.d.ts +0 -4
- package/dist/animation/animations/heartbeat.d.ts +0 -4
- package/dist/animation/animations/moving.d.ts +0 -4
- package/dist/animation/animations/outline.d.ts +0 -10
- package/dist/animation/animations/rotation.d.ts +0 -4
- package/dist/animation/animations/vibration.d.ts +0 -4
- package/dist/animation/compile.d.ts +0 -1
- package/dist/animation/delta.d.ts +0 -19
- package/dist/animation/index.d.ts +0 -1
- package/dist/command/command-change.d.ts +0 -7
- package/dist/command/command-migrate.d.ts +0 -4
- package/dist/command/command-migrate.js +0 -85
- package/dist/command/command-migrate.js.map +0 -1
- package/dist/command/command.d.ts +0 -5
- package/dist/command/snapshot-commander.d.ts +0 -15
- package/dist/components/anchor/anchor.d.ts +0 -128
- package/dist/components/anchor/ellipse-anchors.d.ts +0 -2
- package/dist/components/anchor/ellipse-anchors.js +0 -38
- package/dist/components/anchor/ellipse-anchors.js.map +0 -1
- package/dist/components/anchor/rect-anchors.d.ts +0 -10
- package/dist/components/audio.d.ts +0 -25
- package/dist/components/audio.js +0 -141
- package/dist/components/audio.js.map +0 -1
- package/dist/components/cloud.d.ts +0 -13
- package/dist/components/cloud.js +0 -31
- package/dist/components/cloud.js.map +0 -1
- package/dist/components/component.d.ts +0 -227
- package/dist/components/component.js +0 -912
- package/dist/components/component.js.map +0 -1
- package/dist/components/container-abstract.d.ts +0 -51
- package/dist/components/container-abstract.js +0 -372
- package/dist/components/container-abstract.js.map +0 -1
- package/dist/components/container.d.ts +0 -38
- package/dist/components/container.js +0 -75
- package/dist/components/container.js.map +0 -1
- package/dist/components/data/data-mapping.d.ts +0 -16
- package/dist/components/data/data.d.ts +0 -8
- package/dist/components/data/evaluator.d.ts +0 -1
- package/dist/components/donut.d.ts +0 -15
- package/dist/components/donut.js +0 -74
- package/dist/components/donut.js.map +0 -1
- package/dist/components/drawer/draw-image-pendable.d.ts +0 -1
- package/dist/components/drawer/effect.d.ts +0 -1
- package/dist/components/drawer/fill.d.ts +0 -14
- package/dist/components/drawer/format.d.ts +0 -1
- package/dist/components/drawer/line.d.ts +0 -3
- package/dist/components/drawer/stroke.d.ts +0 -1
- package/dist/components/drawer/text-wrapper.d.ts +0 -10
- package/dist/components/drawer/text.d.ts +0 -3
- package/dist/components/ellipse.d.ts +0 -35
- package/dist/components/ellipse.js +0 -99
- package/dist/components/ellipse.js.map +0 -1
- package/dist/components/file/ondropfile.d.ts +0 -1
- package/dist/components/fit/fit.d.ts +0 -15
- package/dist/components/geometry/transcoord.d.ts +0 -41
- package/dist/components/geometry/union.d.ts +0 -6
- package/dist/components/gif-view.d.ts +0 -18
- package/dist/components/gif-view.js +0 -116
- package/dist/components/gif-view.js.map +0 -1
- package/dist/components/global-ref.d.ts +0 -36
- package/dist/components/global-ref.js +0 -128
- package/dist/components/global-ref.js.map +0 -1
- package/dist/components/group.d.ts +0 -15
- package/dist/components/group.js +0 -145
- package/dist/components/group.js.map +0 -1
- package/dist/components/html/elements.d.ts +0 -2
- package/dist/components/html/fill.d.ts +0 -1
- package/dist/components/html/reposition.d.ts +0 -1
- package/dist/components/html/shadow.d.ts +0 -1
- package/dist/components/html-overlay-container.d.ts +0 -27
- package/dist/components/html-overlay-container.js +0 -14
- package/dist/components/html-overlay-container.js.map +0 -1
- package/dist/components/html-overlay-element.d.ts +0 -25
- package/dist/components/html-overlay-element.js +0 -9
- package/dist/components/html-overlay-element.js.map +0 -1
- package/dist/components/image-view.d.ts +0 -19
- package/dist/components/image-view.js +0 -180
- package/dist/components/image-view.js.map +0 -1
- package/dist/components/index.d.ts +0 -32
- package/dist/components/index.js +0 -39
- package/dist/components/index.js.map +0 -1
- package/dist/components/info-window.d.ts +0 -41
- package/dist/components/info-window.js +0 -425
- package/dist/components/info-window.js.map +0 -1
- package/dist/components/line.d.ts +0 -91
- package/dist/components/line.js +0 -303
- package/dist/components/line.js.map +0 -1
- package/dist/components/local-ref.d.ts +0 -47
- package/dist/components/local-ref.js +0 -103
- package/dist/components/local-ref.js.map +0 -1
- package/dist/components/mixins/connectable.d.ts +0 -45
- package/dist/components/mixins/data-source.d.ts +0 -9
- package/dist/components/mixins/html-element.d.ts +0 -24
- package/dist/components/mixins/move-handle.d.ts +0 -11
- package/dist/components/mixins/rect-path.d.ts +0 -13
- package/dist/components/mixins/value-holder.d.ts +0 -18
- package/dist/components/mutater/bounds.d.ts +0 -10
- package/dist/components/mutater/path.d.ts +0 -5
- package/dist/components/ortholine.d.ts +0 -21
- package/dist/components/ortholine.js +0 -814
- package/dist/components/ortholine.js.map +0 -1
- package/dist/components/outline/ellipse-outline.d.ts +0 -4
- package/dist/components/outline/ellipse-outline.js +0 -11
- package/dist/components/outline/ellipse-outline.js.map +0 -1
- package/dist/components/outline/path-outline.d.ts +0 -1
- package/dist/components/path.d.ts +0 -5
- package/dist/components/path.js +0 -40
- package/dist/components/path.js.map +0 -1
- package/dist/components/polygon.d.ts +0 -40
- package/dist/components/polygon.js +0 -157
- package/dist/components/polygon.js.map +0 -1
- package/dist/components/polyline.d.ts +0 -18
- package/dist/components/polyline.js +0 -102
- package/dist/components/polyline.js.map +0 -1
- package/dist/components/popup.d.ts +0 -48
- package/dist/components/popup.js +0 -138
- package/dist/components/popup.js.map +0 -1
- package/dist/components/rect.d.ts +0 -26
- package/dist/components/rect.js +0 -91
- package/dist/components/rect.js.map +0 -1
- package/dist/components/retention/retention-manager.d.ts +0 -8
- package/dist/components/root-container.d.ts +0 -90
- package/dist/components/root-container.js +0 -478
- package/dist/components/root-container.js.map +0 -1
- package/dist/components/ruler.d.ts +0 -16
- package/dist/components/ruler.js +0 -77
- package/dist/components/ruler.js.map +0 -1
- package/dist/components/shape.d.ts +0 -25
- package/dist/components/shape.js +0 -80
- package/dist/components/shape.js.map +0 -1
- package/dist/components/star.d.ts +0 -13
- package/dist/components/star.js +0 -80
- package/dist/components/star.js.map +0 -1
- package/dist/components/text/substitutor.d.ts +0 -3
- package/dist/components/text.d.ts +0 -8
- package/dist/components/text.js +0 -15
- package/dist/components/text.js.map +0 -1
- package/dist/components/three-container.d.ts +0 -60
- package/dist/components/three-container.js +0 -515
- package/dist/components/three-container.js.map +0 -1
- package/dist/components/triangle.d.ts +0 -15
- package/dist/components/triangle.js +0 -76
- package/dist/components/triangle.js.map +0 -1
- package/dist/const.d.ts +0 -39
- package/dist/core/collection.d.ts +0 -8
- package/dist/core/debug.d.ts +0 -1
- package/dist/core/deep-equals.d.ts +0 -1
- package/dist/core/dom-to-image.d.ts +0 -127
- package/dist/core/event.d.ts +0 -92
- package/dist/core/index.d.ts +0 -2
- package/dist/core/list.d.ts +0 -32
- package/dist/core/logger.d.ts +0 -3
- package/dist/core/memoize.d.ts +0 -6
- package/dist/core/mixin.d.ts +0 -1
- package/dist/core/obj-accessor.d.ts +0 -1
- package/dist/core/reference-map.d.ts +0 -14
- package/dist/core/round-rect.d.ts +0 -19
- package/dist/core/script-loader.d.ts +0 -3
- package/dist/core/snapshot-taker.d.ts +0 -12
- package/dist/core/stack.d.ts +0 -2
- package/dist/core/timecapsule.d.ts +0 -18
- package/dist/core/utils.d.ts +0 -9
- package/dist/decorator/anchors-decorator.d.ts +0 -31
- package/dist/decorator/data-spread-decorator.d.ts +0 -1
- package/dist/decorator/decotag-decorator.d.ts +0 -1
- package/dist/decorator/index.d.ts +0 -2
- package/dist/decorator/link-decorator.d.ts +0 -1
- package/dist/effect/gradation.d.ts +0 -1
- package/dist/effect/index.d.ts +0 -1
- package/dist/effect/shadow.d.ts +0 -2
- package/dist/effect/turn.d.ts +0 -1
- package/dist/event/event-engine.d.ts +0 -12
- package/dist/event/event-pump.d.ts +0 -11
- package/dist/event/event-tracker.d.ts +0 -21
- package/dist/event/index.d.ts +0 -2
- package/dist/event/ua-event-handler.d.ts +0 -32
- package/dist/event-map/event-map.d.ts +0 -9
- package/dist/event-map/index.d.ts +0 -1
- package/dist/event-map/move-handler.d.ts +0 -1
- package/dist/event-map/text-editor-lite.d.ts +0 -1
- package/dist/index.d.ts +0 -1
- package/dist/index.js +0 -3
- package/dist/index.js.map +0 -1
- package/dist/layer/action/emphasize.d.ts +0 -2
- package/dist/layer/action/popup.d.ts +0 -5
- package/dist/layer/action/pressed.d.ts +0 -2
- package/dist/layer/add-layer.d.ts +0 -42
- package/dist/layer/add-layer.js +0 -142
- package/dist/layer/add-layer.js.map +0 -1
- package/dist/layer/decotag-layer.d.ts +0 -27
- package/dist/layer/decotag-layer.js +0 -105
- package/dist/layer/decotag-layer.js.map +0 -1
- package/dist/layer/guide-layer.d.ts +0 -44
- package/dist/layer/guide-layer.js +0 -261
- package/dist/layer/guide-layer.js.map +0 -1
- package/dist/layer/index.d.ts +0 -7
- package/dist/layer/index.js +0 -11
- package/dist/layer/index.js.map +0 -1
- package/dist/layer/layer.d.ts +0 -32
- package/dist/layer/layer.js +0 -155
- package/dist/layer/layer.js.map +0 -1
- package/dist/layer/model-layer.d.ts +0 -46
- package/dist/layer/model-layer.js +0 -402
- package/dist/layer/model-layer.js.map +0 -1
- package/dist/layer/modeler/anchor-handler.d.ts +0 -36
- package/dist/layer/modeler/control-handler.d.ts +0 -18
- package/dist/layer/modeler/focus-outline.d.ts +0 -5
- package/dist/layer/modeler/group-outline.d.ts +0 -5
- package/dist/layer/modeler/index.d.ts +0 -7
- package/dist/layer/modeler/path-handler.d.ts +0 -22
- package/dist/layer/modeler/resizer.d.ts +0 -13
- package/dist/layer/modeler/rotator.d.ts +0 -15
- package/dist/layer/modeler/rotator.js +0 -120
- package/dist/layer/modeler/rotator.js.map +0 -1
- package/dist/layer/modeling-layer.d.ts +0 -66
- package/dist/layer/modeling-layer.js +0 -451
- package/dist/layer/modeling-layer.js.map +0 -1
- package/dist/layer/selection/selected-finder.d.ts +0 -1
- package/dist/layer/selection-layer.d.ts +0 -42
- package/dist/layer/selection-layer.js +0 -307
- package/dist/layer/selection-layer.js.map +0 -1
- package/dist/layer/shift-layer.d.ts +0 -18
- package/dist/layer/shift-layer.js +0 -61
- package/dist/layer/shift-layer.js.map +0 -1
- package/dist/layout/absolute.d.ts +0 -8
- package/dist/layout/card.d.ts +0 -7
- package/dist/layout/html-absolute.d.ts +0 -8
- package/dist/layout/index.d.ts +0 -8
- package/dist/layout/index.js +0 -12
- package/dist/layout/index.js.map +0 -1
- package/dist/layout/layout.d.ts +0 -11
- package/dist/layout/linear-horizontal.d.ts +0 -7
- package/dist/layout/linear-vertical.d.ts +0 -7
- package/dist/layout/table.d.ts +0 -9
- package/dist/layout/three.d.ts +0 -8
- package/dist/layout/three.js +0 -20
- package/dist/layout/three.js.map +0 -1
- package/dist/license/license.d.ts +0 -18
- package/dist/model/compile.d.ts +0 -1
- package/dist/model/compile.js +0 -28
- package/dist/model/compile.js.map +0 -1
- package/dist/model/duplicate.d.ts +0 -1
- package/dist/model/index.d.ts +0 -3
- package/dist/model/selector.d.ts +0 -2
- package/dist/style/compile.d.ts +0 -1
- package/dist/style/index.d.ts +0 -1
- package/dist/things-scene/api/add-start.d.ts +0 -1
- package/dist/things-scene/api/add.d.ts +0 -5
- package/dist/things-scene/api/align.d.ts +0 -1
- package/dist/things-scene/api/change.d.ts +0 -2
- package/dist/things-scene/api/clipboard.d.ts +0 -3
- package/dist/things-scene/api/distribute.d.ts +0 -1
- package/dist/things-scene/api/duplicate.d.ts +0 -4
- package/dist/things-scene/api/fullscreen.d.ts +0 -1
- package/dist/things-scene/api/group.d.ts +0 -8
- package/dist/things-scene/api/group.js +0 -78
- package/dist/things-scene/api/group.js.map +0 -1
- package/dist/things-scene/api/ids.d.ts +0 -4
- package/dist/things-scene/api/index.d.ts +0 -15
- package/dist/things-scene/api/listener.d.ts +0 -3
- package/dist/things-scene/api/remove.d.ts +0 -4
- package/dist/things-scene/api/symmetry.d.ts +0 -2
- package/dist/things-scene/api/symmetry.js +0 -39
- package/dist/things-scene/api/symmetry.js.map +0 -1
- package/dist/things-scene/api/to-data-url.d.ts +0 -1
- package/dist/things-scene/api/to-data-url.js +0 -69
- package/dist/things-scene/api/to-data-url.js.map +0 -1
- package/dist/things-scene/api/zorder.d.ts +0 -2
- package/dist/things-scene/application-context.d.ts +0 -40
- package/dist/things-scene/config.d.ts +0 -4
- package/dist/things-scene/create.d.ts +0 -20
- package/dist/things-scene/fps.d.ts +0 -1
- package/dist/things-scene/index.d.ts +0 -17
- package/dist/things-scene/index.js +0 -23
- package/dist/things-scene/index.js.map +0 -1
- package/dist/things-scene/polyfill.d.ts +0 -2
- package/dist/things-scene/scene.d.ts +0 -155
- package/dist/things-scene/version.d.ts +0 -2
- package/dist/threed/common.d.ts +0 -22
- package/dist/threed/control/three-controls.d.ts +0 -11
- package/dist/threed/control/three-controls.js +0 -620
- package/dist/threed/control/three-controls.js.map +0 -1
- package/dist/threed/html/elements.d.ts +0 -2
- package/dist/threed/real-object-camera-meshed.d.ts +0 -12
- package/dist/threed/real-object-camera-meshed.js +0 -49
- package/dist/threed/real-object-camera-meshed.js.map +0 -1
- package/dist/threed/real-object-camera.d.ts +0 -9
- package/dist/threed/real-object-camera.js +0 -31
- package/dist/threed/real-object-camera.js.map +0 -1
- package/dist/threed/real-object-dom-element.d.ts +0 -20
- package/dist/threed/real-object-dom-element.js +0 -78
- package/dist/threed/real-object-dom-element.js.map +0 -1
- package/dist/threed/real-object-dummy.d.ts +0 -6
- package/dist/threed/real-object-dummy.js +0 -11
- package/dist/threed/real-object-dummy.js.map +0 -1
- package/dist/threed/real-object-extrude.d.ts +0 -19
- package/dist/threed/real-object-extrude.js +0 -171
- package/dist/threed/real-object-extrude.js.map +0 -1
- package/dist/threed/real-object-gltf.d.ts +0 -15
- package/dist/threed/real-object-gltf.js +0 -97
- package/dist/threed/real-object-gltf.js.map +0 -1
- package/dist/threed/real-object-group.d.ts +0 -5
- package/dist/threed/real-object-group.js +0 -11
- package/dist/threed/real-object-group.js.map +0 -1
- package/dist/threed/real-object-mesh.d.ts +0 -11
- package/dist/threed/real-object-mesh.js +0 -55
- package/dist/threed/real-object-mesh.js.map +0 -1
- package/dist/threed/real-object-plane.d.ts +0 -6
- package/dist/threed/real-object-plane.js +0 -23
- package/dist/threed/real-object-plane.js.map +0 -1
- package/dist/threed/real-object-scene.d.ts +0 -21
- package/dist/threed/real-object-scene.js +0 -89
- package/dist/threed/real-object-scene.js.map +0 -1
- package/dist/threed/real-object-sprite.d.ts +0 -12
- package/dist/threed/real-object-sprite.js +0 -35
- package/dist/threed/real-object-sprite.js.map +0 -1
- package/dist/threed/real-object-text.d.ts +0 -16
- package/dist/threed/real-object-text.js +0 -70
- package/dist/threed/real-object-text.js.map +0 -1
- package/dist/threed/real-object.d.ts +0 -48
- package/dist/threed/real-object.js +0 -199
- package/dist/threed/real-object.js.map +0 -1
- package/dist/threed/texture/text-texture.d.ts +0 -8
- package/dist/threed/three-dimensional-container.d.ts +0 -7
- package/dist/threed/three-dimensional-container.js +0 -2
- package/dist/threed/three-dimensional-container.js.map +0 -1
- package/dist/threed/utils/bound-uv-generator.d.ts +0 -16
- package/dist/types.d.ts +0 -53
- package/dist/types.js +0 -368
- package/dist/types.js.map +0 -1
|
@@ -1,91 +0,0 @@
|
|
|
1
|
-
export const NORTH: "N";
|
|
2
|
-
export const SOUTH: "S";
|
|
3
|
-
export const EAST: "E";
|
|
4
|
-
export const WEST: "W";
|
|
5
|
-
/**
|
|
6
|
-
* LinkEndConfig definition
|
|
7
|
-
* @typedef {Object} LinkEndConfig
|
|
8
|
-
* @property {string} component - end component refid
|
|
9
|
-
* @property {string} anchor - end anchor name of end component
|
|
10
|
-
* @property {Position} position - position of the link end
|
|
11
|
-
*/
|
|
12
|
-
/**
|
|
13
|
-
* Line type definition
|
|
14
|
-
* @typedef {Object} Line
|
|
15
|
-
* @property {LinkEndConfig} from
|
|
16
|
-
* @property {LinkEndConfig} to
|
|
17
|
-
* @property {LinkEnd} fromEnd
|
|
18
|
-
* @property {LinkEnd} toEnd
|
|
19
|
-
*/
|
|
20
|
-
declare class Line extends Component {
|
|
21
|
-
get fromEnd(): LinkEnd | undefined;
|
|
22
|
-
_fromEnd: LinkEnd | undefined;
|
|
23
|
-
set from(arg: any);
|
|
24
|
-
get from(): any;
|
|
25
|
-
get toEnd(): LinkEnd | undefined;
|
|
26
|
-
_toEnd: LinkEnd | undefined;
|
|
27
|
-
set to(arg: any);
|
|
28
|
-
get to(): any;
|
|
29
|
-
move({ x, y }: {
|
|
30
|
-
x: any;
|
|
31
|
-
y: any;
|
|
32
|
-
}, absolutly: any): void;
|
|
33
|
-
get resizable(): boolean;
|
|
34
|
-
get mutable(): boolean;
|
|
35
|
-
get rotatable(): boolean;
|
|
36
|
-
set path(arg: any[]);
|
|
37
|
-
get path(): any[];
|
|
38
|
-
}
|
|
39
|
-
declare namespace Line {
|
|
40
|
-
export { getTipNeckPos };
|
|
41
|
-
export { containedInPath };
|
|
42
|
-
export { drawEndTips };
|
|
43
|
-
}
|
|
44
|
-
export default Line;
|
|
45
|
-
/**
|
|
46
|
-
* LinkEndConfig definition
|
|
47
|
-
*/
|
|
48
|
-
export type LinkEndConfig = {
|
|
49
|
-
/**
|
|
50
|
-
* - end component refid
|
|
51
|
-
*/
|
|
52
|
-
component: string;
|
|
53
|
-
/**
|
|
54
|
-
* - end anchor name of end component
|
|
55
|
-
*/
|
|
56
|
-
anchor: string;
|
|
57
|
-
/**
|
|
58
|
-
* - position of the link end
|
|
59
|
-
*/
|
|
60
|
-
position: Position;
|
|
61
|
-
};
|
|
62
|
-
/**
|
|
63
|
-
* Line type definition
|
|
64
|
-
*/
|
|
65
|
-
export type Line = {
|
|
66
|
-
from: LinkEndConfig;
|
|
67
|
-
to: LinkEndConfig;
|
|
68
|
-
fromEnd: LinkEnd;
|
|
69
|
-
toEnd: LinkEnd;
|
|
70
|
-
};
|
|
71
|
-
import Component from "./component";
|
|
72
|
-
declare class LinkEnd {
|
|
73
|
-
constructor({ component, anchor, position, self }: {
|
|
74
|
-
component: any;
|
|
75
|
-
anchor: any;
|
|
76
|
-
position: any;
|
|
77
|
-
self: any;
|
|
78
|
-
});
|
|
79
|
-
component: any;
|
|
80
|
-
_anchorName: any;
|
|
81
|
-
_position: any;
|
|
82
|
-
self: any;
|
|
83
|
-
set position(arg: any);
|
|
84
|
-
get position(): any;
|
|
85
|
-
get anchor(): any;
|
|
86
|
-
get direction(): "N" | "S" | "E" | "W";
|
|
87
|
-
get boundaryPosition(): any;
|
|
88
|
-
}
|
|
89
|
-
import { getTipNeckPos } from "./drawer/line";
|
|
90
|
-
import { containedInPath } from "./drawer/line";
|
|
91
|
-
import { drawEndTips } from "./drawer/line";
|
package/dist/components/line.js
DELETED
|
@@ -1,303 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Copyright © HatioLab Inc. All rights reserved.
|
|
3
|
-
*/
|
|
4
|
-
import Component from './component';
|
|
5
|
-
import { containedInPath, drawEndTips, getTipNeckPos } from './drawer/line';
|
|
6
|
-
export const NORTH = 'N';
|
|
7
|
-
export const SOUTH = 'S';
|
|
8
|
-
export const EAST = 'E';
|
|
9
|
-
export const WEST = 'W';
|
|
10
|
-
class LinkEnd {
|
|
11
|
-
constructor({ component, anchor, position, self }) {
|
|
12
|
-
this.component = component; /* component */
|
|
13
|
-
this._anchorName = anchor;
|
|
14
|
-
this._position = position;
|
|
15
|
-
this.self = self;
|
|
16
|
-
}
|
|
17
|
-
get position() {
|
|
18
|
-
const anchor = this.anchor;
|
|
19
|
-
if (anchor) {
|
|
20
|
-
var { position } = anchor;
|
|
21
|
-
const fromTop = this.component.transcoordS2T(position.x, position.y);
|
|
22
|
-
return this.self.transcoordT2P(fromTop.x, fromTop.y);
|
|
23
|
-
}
|
|
24
|
-
return this._position;
|
|
25
|
-
}
|
|
26
|
-
set position({ x, y }) {
|
|
27
|
-
this._position = { x, y };
|
|
28
|
-
}
|
|
29
|
-
get anchor() {
|
|
30
|
-
var _a;
|
|
31
|
-
return (_a = this.component) === null || _a === void 0 ? void 0 : _a.findAnchor(this._anchorName /* anchor name */);
|
|
32
|
-
}
|
|
33
|
-
get direction() {
|
|
34
|
-
const bounds = this.component.bounds;
|
|
35
|
-
const anchor = this.anchor;
|
|
36
|
-
if (!anchor) {
|
|
37
|
-
return EAST;
|
|
38
|
-
}
|
|
39
|
-
const position = anchor.position;
|
|
40
|
-
if (position.y <= bounds.top) {
|
|
41
|
-
return NORTH;
|
|
42
|
-
}
|
|
43
|
-
if (position.y >= bounds.top + bounds.height) {
|
|
44
|
-
return SOUTH;
|
|
45
|
-
}
|
|
46
|
-
if (position.x <= bounds.left) {
|
|
47
|
-
return WEST;
|
|
48
|
-
}
|
|
49
|
-
return EAST;
|
|
50
|
-
}
|
|
51
|
-
get boundaryPosition() {
|
|
52
|
-
const anchor = this.anchor;
|
|
53
|
-
if (anchor) {
|
|
54
|
-
var { position } = anchor;
|
|
55
|
-
var dx = 0, dy = 0;
|
|
56
|
-
switch (this.direction) {
|
|
57
|
-
case SOUTH:
|
|
58
|
-
dy = 20;
|
|
59
|
-
break;
|
|
60
|
-
case NORTH:
|
|
61
|
-
dy = -20;
|
|
62
|
-
break;
|
|
63
|
-
case WEST:
|
|
64
|
-
dx = -20;
|
|
65
|
-
break;
|
|
66
|
-
case EAST:
|
|
67
|
-
default:
|
|
68
|
-
dx = 20;
|
|
69
|
-
}
|
|
70
|
-
position = {
|
|
71
|
-
x: position.x + dx,
|
|
72
|
-
y: position.y + dy
|
|
73
|
-
};
|
|
74
|
-
const fromTop = this.component.transcoordS2T(position.x, position.y);
|
|
75
|
-
return this.self.transcoordT2P(fromTop.x, fromTop.y);
|
|
76
|
-
}
|
|
77
|
-
}
|
|
78
|
-
}
|
|
79
|
-
/**
|
|
80
|
-
* LinkEndConfig definition
|
|
81
|
-
* @typedef {Object} LinkEndConfig
|
|
82
|
-
* @property {string} component - end component refid
|
|
83
|
-
* @property {string} anchor - end anchor name of end component
|
|
84
|
-
* @property {Position} position - position of the link end
|
|
85
|
-
*/
|
|
86
|
-
/**
|
|
87
|
-
* Line type definition
|
|
88
|
-
* @typedef {Object} Line
|
|
89
|
-
* @property {LinkEndConfig} from
|
|
90
|
-
* @property {LinkEndConfig} to
|
|
91
|
-
* @property {LinkEnd} fromEnd
|
|
92
|
-
* @property {LinkEnd} toEnd
|
|
93
|
-
*/
|
|
94
|
-
export default class Line extends Component {
|
|
95
|
-
isLine() {
|
|
96
|
-
return true;
|
|
97
|
-
}
|
|
98
|
-
replaceRefids(replaceMap) {
|
|
99
|
-
;
|
|
100
|
-
['from', 'to'].forEach(fromto => {
|
|
101
|
-
const anchor = this.get(fromto);
|
|
102
|
-
if (anchor === null || anchor === void 0 ? void 0 : anchor.component) {
|
|
103
|
-
const refid = replaceMap.get(anchor.component) || anchor.component;
|
|
104
|
-
this.set(fromto, {
|
|
105
|
-
...anchor,
|
|
106
|
-
component: refid
|
|
107
|
-
});
|
|
108
|
-
}
|
|
109
|
-
});
|
|
110
|
-
}
|
|
111
|
-
get fromEnd() {
|
|
112
|
-
var _a;
|
|
113
|
-
if (this.parent && !this._fromEnd) {
|
|
114
|
-
const { component, anchor, position } = this.getState('from') || {};
|
|
115
|
-
if (!component) {
|
|
116
|
-
return;
|
|
117
|
-
}
|
|
118
|
-
const componentObject = (_a = this.root) === null || _a === void 0 ? void 0 : _a.findByRefid(component);
|
|
119
|
-
if (!componentObject) {
|
|
120
|
-
return;
|
|
121
|
-
}
|
|
122
|
-
this._fromEnd = new LinkEnd({
|
|
123
|
-
component: componentObject,
|
|
124
|
-
fromto: 'from',
|
|
125
|
-
anchor,
|
|
126
|
-
position,
|
|
127
|
-
self: this
|
|
128
|
-
});
|
|
129
|
-
}
|
|
130
|
-
return this._fromEnd;
|
|
131
|
-
}
|
|
132
|
-
get from() {
|
|
133
|
-
return this.getState('from');
|
|
134
|
-
}
|
|
135
|
-
set from(from) {
|
|
136
|
-
delete this._fromEnd;
|
|
137
|
-
this.set('from', from);
|
|
138
|
-
}
|
|
139
|
-
get toEnd() {
|
|
140
|
-
var _a;
|
|
141
|
-
if (this.parent && !this._toEnd) {
|
|
142
|
-
const { component, anchor, position } = this.getState('to') || {};
|
|
143
|
-
if (!component) {
|
|
144
|
-
return;
|
|
145
|
-
}
|
|
146
|
-
const componentObject = (_a = this.root) === null || _a === void 0 ? void 0 : _a.findByRefid(component);
|
|
147
|
-
if (!componentObject) {
|
|
148
|
-
return;
|
|
149
|
-
}
|
|
150
|
-
this._toEnd = new LinkEnd({
|
|
151
|
-
component: componentObject,
|
|
152
|
-
fromto: 'to',
|
|
153
|
-
anchor,
|
|
154
|
-
position,
|
|
155
|
-
self: this
|
|
156
|
-
});
|
|
157
|
-
}
|
|
158
|
-
return this._toEnd;
|
|
159
|
-
}
|
|
160
|
-
get to() {
|
|
161
|
-
return this.getState('to');
|
|
162
|
-
}
|
|
163
|
-
set to(to) {
|
|
164
|
-
delete this._toEnd;
|
|
165
|
-
this.set('to', to);
|
|
166
|
-
}
|
|
167
|
-
move({ x, y }, absolutly) {
|
|
168
|
-
var _a, _b, _c, _d;
|
|
169
|
-
if (absolutly) {
|
|
170
|
-
/* move시에는 먼저 anchor들을 detach한다. */
|
|
171
|
-
this.from = {
|
|
172
|
-
position: ((_a = this._fromEnd) === null || _a === void 0 ? void 0 : _a.position) || ((_b = this.getState('from')) === null || _b === void 0 ? void 0 : _b.position) || { x: 0, y: 0 }
|
|
173
|
-
};
|
|
174
|
-
this.to = {
|
|
175
|
-
position: ((_c = this._toEnd) === null || _c === void 0 ? void 0 : _c.position) || ((_d = this.getState('to')) === null || _d === void 0 ? void 0 : _d.position) || { x: 0, y: 0 }
|
|
176
|
-
};
|
|
177
|
-
}
|
|
178
|
-
super.move({ x, y }, absolutly);
|
|
179
|
-
}
|
|
180
|
-
render(ctx) {
|
|
181
|
-
var { begin = 'none', end = 'none', lineWidth, round = 0 } = this.state;
|
|
182
|
-
/* following 2 filters not to be merged */
|
|
183
|
-
var path = this.drawPath;
|
|
184
|
-
drawEndTips(ctx, path, this.state);
|
|
185
|
-
ctx.beginPath();
|
|
186
|
-
var beginPos = getTipNeckPos(begin, lineWidth, path[0], path[1]);
|
|
187
|
-
var endPos = getTipNeckPos(end, lineWidth, path[path.length - 1], path[path.length - 2]);
|
|
188
|
-
path = [beginPos, ...path.slice(1, -1), endPos];
|
|
189
|
-
var cursor = { x: beginPos.x, y: beginPos.y };
|
|
190
|
-
ctx.moveTo(beginPos.x, beginPos.y);
|
|
191
|
-
for (var i = 1; i < path.length; i++) {
|
|
192
|
-
const prev = cursor;
|
|
193
|
-
cursor = path[i];
|
|
194
|
-
const next = path[i + 1];
|
|
195
|
-
if (prev.x === cursor.x && prev.y === cursor.y) {
|
|
196
|
-
continue;
|
|
197
|
-
}
|
|
198
|
-
if (!next) {
|
|
199
|
-
ctx.lineTo(cursor.x, cursor.y);
|
|
200
|
-
break;
|
|
201
|
-
}
|
|
202
|
-
var length = Math.sqrt((prev.x - cursor.x) * (prev.x - cursor.x) + (prev.y - cursor.y) * (prev.y - cursor.y));
|
|
203
|
-
var theta = length !== 0 ? Math.atan2(prev.x - cursor.x, prev.y - cursor.y) : 0;
|
|
204
|
-
var x = Math.sin(theta) * Math.min(round, length / 2) + cursor.x;
|
|
205
|
-
var y = Math.cos(theta) * Math.min(round, length / 2) + cursor.y;
|
|
206
|
-
const p1 = round > 0 || length !== 0 ? { x, y } : cursor;
|
|
207
|
-
var length = Math.sqrt((next.x - cursor.x) * (next.x - cursor.x) + (next.y - cursor.y) * (next.y - cursor.y));
|
|
208
|
-
theta = length !== 0 ? Math.atan2(next.x - cursor.x, next.y - cursor.y) : 0;
|
|
209
|
-
x = Math.sin(theta) * Math.min(round, length / 2) + cursor.x;
|
|
210
|
-
y = Math.cos(theta) * Math.min(round, length / 2) + cursor.y;
|
|
211
|
-
const p2 = round > 0 || length !== 0 ? { x, y } : cursor;
|
|
212
|
-
ctx.lineTo(p1.x, p1.y);
|
|
213
|
-
round > 0 && ctx.quadraticCurveTo(cursor.x, cursor.y, p2.x, p2.y);
|
|
214
|
-
}
|
|
215
|
-
this.drawStroke(ctx);
|
|
216
|
-
}
|
|
217
|
-
contains(x, y) {
|
|
218
|
-
// 효율을 위해서, contains를 호출하기 전에 x, y좌표값은 이 컴포넌트에 대해서 이미 transcoord 된 상태이다.
|
|
219
|
-
// 참조 : capture(x, y)
|
|
220
|
-
var { lineWidth } = this.state;
|
|
221
|
-
return containedInPath(x, y, this.drawPath, lineWidth);
|
|
222
|
-
}
|
|
223
|
-
get resizable() {
|
|
224
|
-
return false;
|
|
225
|
-
}
|
|
226
|
-
get mutable() {
|
|
227
|
-
return true;
|
|
228
|
-
}
|
|
229
|
-
get rotatable() {
|
|
230
|
-
return false;
|
|
231
|
-
}
|
|
232
|
-
get path() {
|
|
233
|
-
var _a, _b;
|
|
234
|
-
const { from, to } = this.state;
|
|
235
|
-
var { x1, y1, x2, y2 } = this.state;
|
|
236
|
-
return [
|
|
237
|
-
((_a = this.fromEnd) === null || _a === void 0 ? void 0 : _a.position) ||
|
|
238
|
-
(from === null || from === void 0 ? void 0 : from.position) || {
|
|
239
|
-
x: x1,
|
|
240
|
-
y: y1
|
|
241
|
-
},
|
|
242
|
-
((_b = this.toEnd) === null || _b === void 0 ? void 0 : _b.position) ||
|
|
243
|
-
(to === null || to === void 0 ? void 0 : to.position) || {
|
|
244
|
-
x: x2,
|
|
245
|
-
y: y2
|
|
246
|
-
}
|
|
247
|
-
];
|
|
248
|
-
}
|
|
249
|
-
set path(path) {
|
|
250
|
-
const [p1, p2] = path;
|
|
251
|
-
const { from, to } = this.state;
|
|
252
|
-
delete this._fromEnd;
|
|
253
|
-
delete this._toEnd;
|
|
254
|
-
this.set({
|
|
255
|
-
from: {
|
|
256
|
-
...from,
|
|
257
|
-
position: p1
|
|
258
|
-
},
|
|
259
|
-
to: {
|
|
260
|
-
...to,
|
|
261
|
-
position: p2
|
|
262
|
-
}
|
|
263
|
-
});
|
|
264
|
-
}
|
|
265
|
-
get textBounds() {
|
|
266
|
-
var path = this.drawPath;
|
|
267
|
-
var from, to;
|
|
268
|
-
var maxLength = 0;
|
|
269
|
-
/* Find the longest path and set its midpoint as textBounds */
|
|
270
|
-
for (let i = 1; i < path.length; i++) {
|
|
271
|
-
var prev = path[i - 1];
|
|
272
|
-
var next = path[i];
|
|
273
|
-
var length = (prev.x - next.x) * (prev.x - next.x) + (prev.y - next.y) * (prev.y - next.y);
|
|
274
|
-
if (length > maxLength) {
|
|
275
|
-
// In case of similar length, the front pass takes precedence.(비슷한 길이인 경우에는 앞쪽 패스를 우선시한다)
|
|
276
|
-
maxLength = Math.ceil(length);
|
|
277
|
-
from = prev;
|
|
278
|
-
to = next;
|
|
279
|
-
}
|
|
280
|
-
}
|
|
281
|
-
var { paddingTop, paddingLeft, paddingRight, paddingBottom } = this.state;
|
|
282
|
-
paddingBottom || (paddingBottom = 0);
|
|
283
|
-
paddingTop || (paddingTop = 0);
|
|
284
|
-
paddingLeft || (paddingLeft = 0);
|
|
285
|
-
paddingRight || (paddingRight = 0);
|
|
286
|
-
return {
|
|
287
|
-
left: Math.min(from.x, to.x) + paddingLeft,
|
|
288
|
-
top: Math.min(from.y, to.y) + paddingTop,
|
|
289
|
-
width: Math.max(Math.abs(from.x - to.x) - paddingLeft - paddingRight, 0),
|
|
290
|
-
height: Math.max(Math.abs(from.y - to.y) - paddingTop - paddingBottom, 0)
|
|
291
|
-
};
|
|
292
|
-
}
|
|
293
|
-
get decorators() {
|
|
294
|
-
return ['decotag'];
|
|
295
|
-
}
|
|
296
|
-
}
|
|
297
|
-
Line.getTipNeckPos = getTipNeckPos;
|
|
298
|
-
Line.containedInPath = containedInPath;
|
|
299
|
-
Line.drawEndTips = drawEndTips;
|
|
300
|
-
/* anchor에 붙은 line은 모델의 변경없이도 position이 변화할 수 있으므로, memoize를 하지 않는다. */
|
|
301
|
-
// Component.memoize(Line.prototype, 'path', false)
|
|
302
|
-
Component.register('line', Line);
|
|
303
|
-
//# sourceMappingURL=line.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"line.js","sourceRoot":"","sources":["../../src/components/line.js"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,SAAS,MAAM,aAAa,CAAA;AACnC,OAAO,EAAE,eAAe,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,eAAe,CAAA;AAE3E,MAAM,CAAC,MAAM,KAAK,GAAG,GAAG,CAAA;AACxB,MAAM,CAAC,MAAM,KAAK,GAAG,GAAG,CAAA;AACxB,MAAM,CAAC,MAAM,IAAI,GAAG,GAAG,CAAA;AACvB,MAAM,CAAC,MAAM,IAAI,GAAG,GAAG,CAAA;AAEvB,MAAM,OAAO;IACX,YAAY,EAAE,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,IAAI,EAAE;QAC/C,IAAI,CAAC,SAAS,GAAG,SAAS,CAAA,CAAC,eAAe;QAC1C,IAAI,CAAC,WAAW,GAAG,MAAM,CAAA;QACzB,IAAI,CAAC,SAAS,GAAG,QAAQ,CAAA;QACzB,IAAI,CAAC,IAAI,GAAG,IAAI,CAAA;IAClB,CAAC;IAED,IAAI,QAAQ;QACV,MAAM,MAAM,GAAG,IAAI,CAAC,MAAM,CAAA;QAC1B,IAAI,MAAM,EAAE;YACV,IAAI,EAAE,QAAQ,EAAE,GAAG,MAAM,CAAA;YAEzB,MAAM,OAAO,GAAG,IAAI,CAAC,SAAS,CAAC,aAAa,CAAC,QAAQ,CAAC,CAAC,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAA;YACpE,OAAO,IAAI,CAAC,IAAI,CAAC,aAAa,CAAC,OAAO,CAAC,CAAC,EAAE,OAAO,CAAC,CAAC,CAAC,CAAA;SACrD;QAED,OAAO,IAAI,CAAC,SAAS,CAAA;IACvB,CAAC;IAED,IAAI,QAAQ,CAAC,EAA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,CAAC,CAAC;YACxE,MAAM,EAAE,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC,GAAG,UAAU,GAAG,aAAa,EAAE,CAAC,CAAC;SAC1E,CAAA;IACH,CAAC;IAED,IAAI,UAAU;QACZ,OAAO,CAAC,SAAS,CAAC,CAAA;IACpB,CAAC;CACF;AAED,IAAI,CAAC,aAAa,GAAG,aAAa,CAAA;AAClC,IAAI,CAAC,eAAe,GAAG,eAAe,CAAA;AACtC,IAAI,CAAC,WAAW,GAAG,WAAW,CAAA;AAE9B,uEAAuE;AACvE,mDAAmD;AAEnD,SAAS,CAAC,QAAQ,CAAC,MAAM,EAAE,IAAI,CAAC,CAAA","sourcesContent":["/*\n * Copyright © HatioLab Inc. All rights reserved.\n */\n\nimport Component from './component'\nimport { containedInPath, drawEndTips, getTipNeckPos } from './drawer/line'\n\nexport const NORTH = 'N'\nexport const SOUTH = 'S'\nexport const EAST = 'E'\nexport const WEST = 'W'\n\nclass LinkEnd {\n constructor({ component, anchor, position, self }) {\n this.component = component /* component */\n this._anchorName = anchor\n this._position = position\n this.self = self\n }\n\n get position() {\n const anchor = this.anchor\n if (anchor) {\n var { position } = anchor\n\n const fromTop = this.component.transcoordS2T(position.x, position.y)\n return this.self.transcoordT2P(fromTop.x, fromTop.y)\n }\n\n return this._position\n }\n\n set position({ x, y }) {\n this._position = { x, y }\n }\n\n get anchor() {\n return this.component?.findAnchor(this._anchorName /* anchor name */)\n }\n\n get direction() {\n const bounds = this.component.bounds\n const anchor = this.anchor\n\n if (!anchor) {\n return EAST\n }\n\n const position = anchor.position\n\n if (position.y <= bounds.top) {\n return NORTH\n }\n if (position.y >= bounds.top + bounds.height) {\n return SOUTH\n }\n if (position.x <= bounds.left) {\n return WEST\n }\n\n return EAST\n }\n\n get boundaryPosition() {\n const anchor = this.anchor\n\n if (anchor) {\n var { position } = anchor\n\n var dx = 0,\n dy = 0\n switch (this.direction) {\n case SOUTH:\n dy = 20\n break\n case NORTH:\n dy = -20\n break\n case WEST:\n dx = -20\n break\n case EAST:\n default:\n dx = 20\n }\n\n position = {\n x: position.x + dx,\n y: position.y + dy\n }\n\n const fromTop = this.component.transcoordS2T(position.x, position.y)\n return this.self.transcoordT2P(fromTop.x, fromTop.y)\n }\n }\n}\n\n/**\n * LinkEndConfig definition\n * @typedef {Object} LinkEndConfig\n * @property {string} component - end component refid\n * @property {string} anchor - end anchor name of end component\n * @property {Position} position - position of the link end\n */\n\n/**\n * Line type definition\n * @typedef {Object} Line\n * @property {LinkEndConfig} from\n * @property {LinkEndConfig} to\n * @property {LinkEnd} fromEnd\n * @property {LinkEnd} toEnd\n */\nexport default class Line extends Component {\n isLine() {\n return true\n }\n\n replaceRefids(replaceMap) {\n ;['from', 'to'].forEach(fromto => {\n const anchor = this.get(fromto)\n if (anchor?.component) {\n const refid = replaceMap.get(anchor.component) || anchor.component\n this.set(fromto, {\n ...anchor,\n component: refid\n })\n }\n })\n }\n\n get fromEnd() {\n if (this.parent && !this._fromEnd) {\n const { component, anchor, position } = this.getState('from') || {}\n\n if (!component) {\n return\n }\n\n const componentObject = this.root?.findByRefid(component)\n if (!componentObject) {\n return\n }\n\n this._fromEnd = new LinkEnd({\n component: componentObject,\n fromto: 'from',\n anchor,\n position,\n self: this\n })\n }\n\n return this._fromEnd\n }\n\n get from() {\n return this.getState('from')\n }\n\n set from(from) {\n delete this._fromEnd\n this.set('from', from)\n }\n\n get toEnd() {\n if (this.parent && !this._toEnd) {\n const { component, anchor, position } = this.getState('to') || {}\n\n if (!component) {\n return\n }\n\n const componentObject = this.root?.findByRefid(component)\n if (!componentObject) {\n return\n }\n\n this._toEnd = new LinkEnd({\n component: componentObject,\n fromto: 'to',\n anchor,\n position,\n self: this\n })\n }\n\n return this._toEnd\n }\n\n get to() {\n return this.getState('to')\n }\n\n set to(to) {\n delete this._toEnd\n this.set('to', to)\n }\n\n move({ x, y }, absolutly) {\n if (absolutly) {\n /* move시에는 먼저 anchor들을 detach한다. */\n this.from = {\n position: this._fromEnd?.position || this.getState('from')?.position || { x: 0, y: 0 }\n }\n this.to = {\n position: this._toEnd?.position || this.getState('to')?.position || { x: 0, y: 0 }\n }\n }\n\n super.move({ x, y }, absolutly)\n }\n\n render(ctx) {\n var { begin = 'none', end = 'none', lineWidth, round = 0 } = this.state\n\n /* following 2 filters not to be merged */\n var path = this.drawPath\n\n drawEndTips(ctx, path, this.state)\n\n ctx.beginPath()\n\n var beginPos = getTipNeckPos(begin, lineWidth, path[0], path[1])\n var endPos = getTipNeckPos(end, lineWidth, path[path.length - 1], path[path.length - 2])\n\n path = [beginPos, ...path.slice(1, -1), endPos]\n var cursor = { x: beginPos.x, y: beginPos.y }\n ctx.moveTo(beginPos.x, beginPos.y)\n\n for (var i = 1; i < path.length; i++) {\n const prev = cursor\n cursor = path[i]\n\n const next = path[i + 1]\n if (prev.x === cursor.x && prev.y === cursor.y) {\n continue\n }\n\n if (!next) {\n ctx.lineTo(cursor.x, cursor.y)\n break\n }\n\n var length = Math.sqrt((prev.x - cursor.x) * (prev.x - cursor.x) + (prev.y - cursor.y) * (prev.y - cursor.y))\n var theta = length !== 0 ? Math.atan2(prev.x - cursor.x, prev.y - cursor.y) : 0\n var x = Math.sin(theta) * Math.min(round, length / 2) + cursor.x\n var y = Math.cos(theta) * Math.min(round, length / 2) + cursor.y\n\n const p1 = round > 0 || length !== 0 ? { x, y } : cursor\n\n var length = Math.sqrt((next.x - cursor.x) * (next.x - cursor.x) + (next.y - cursor.y) * (next.y - cursor.y))\n theta = length !== 0 ? Math.atan2(next.x - cursor.x, next.y - cursor.y) : 0\n x = Math.sin(theta) * Math.min(round, length / 2) + cursor.x\n y = Math.cos(theta) * Math.min(round, length / 2) + cursor.y\n\n const p2 = round > 0 || length !== 0 ? { x, y } : cursor\n\n ctx.lineTo(p1.x, p1.y)\n round > 0 && ctx.quadraticCurveTo(cursor.x, cursor.y, p2.x, p2.y)\n }\n\n this.drawStroke(ctx)\n }\n\n contains(x, y) {\n // 효율을 위해서, contains를 호출하기 전에 x, y좌표값은 이 컴포넌트에 대해서 이미 transcoord 된 상태이다.\n // 참조 : capture(x, y)\n var { lineWidth } = this.state\n\n return containedInPath(x, y, this.drawPath, lineWidth)\n }\n\n get resizable() {\n return false\n }\n\n get mutable() {\n return true\n }\n\n get rotatable() {\n return false\n }\n\n get path() {\n const { from, to } = this.state\n var { x1, y1, x2, y2 } = this.state\n\n return [\n this.fromEnd?.position ||\n from?.position || {\n x: x1,\n y: y1\n },\n this.toEnd?.position ||\n to?.position || {\n x: x2,\n y: y2\n }\n ]\n }\n\n set path(path) {\n const [p1, p2] = path\n const { from, to } = this.state\n\n delete this._fromEnd\n delete this._toEnd\n\n this.set({\n from: {\n ...from,\n position: p1\n },\n to: {\n ...to,\n position: p2\n }\n })\n }\n\n get textBounds() {\n var path = this.drawPath\n\n var from, to\n var maxLength = 0\n\n /* Find the longest path and set its midpoint as textBounds */\n for (let i = 1; i < path.length; i++) {\n var prev = path[i - 1]\n var next = path[i]\n\n var length = (prev.x - next.x) * (prev.x - next.x) + (prev.y - next.y) * (prev.y - next.y)\n if (length > maxLength) {\n // In case of similar length, the front pass takes precedence.(비슷한 길이인 경우에는 앞쪽 패스를 우선시한다)\n maxLength = Math.ceil(length)\n from = prev\n to = next\n }\n }\n\n var { paddingTop, paddingLeft, paddingRight, paddingBottom } = this.state\n\n paddingBottom ||= 0\n paddingTop ||= 0\n paddingLeft ||= 0\n paddingRight ||= 0\n\n return {\n left: Math.min(from.x, to.x) + paddingLeft,\n top: Math.min(from.y, to.y) + paddingTop,\n width: Math.max(Math.abs(from.x - to.x) - paddingLeft - paddingRight, 0),\n height: Math.max(Math.abs(from.y - to.y) - paddingTop - paddingBottom, 0)\n }\n }\n\n get decorators() {\n return ['decotag']\n }\n}\n\nLine.getTipNeckPos = getTipNeckPos\nLine.containedInPath = containedInPath\nLine.drawEndTips = drawEndTips\n\n/* anchor에 붙은 line은 모델의 변경없이도 position이 변화할 수 있으므로, memoize를 하지 않는다. */\n// Component.memoize(Line.prototype, 'path', false)\n\nComponent.register('line', Line)\n"]}
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
declare const LocalRef_base: {
|
|
2
|
-
new (): {
|
|
3
|
-
[x: string]: any;
|
|
4
|
-
contains(x: any, y: any): boolean;
|
|
5
|
-
path: {
|
|
6
|
-
x: any;
|
|
7
|
-
y: any;
|
|
8
|
-
}[];
|
|
9
|
-
readonly anchors: import("./anchor/anchor").Anchor[];
|
|
10
|
-
};
|
|
11
|
-
[x: string]: any;
|
|
12
|
-
};
|
|
13
|
-
export default class LocalRef extends LocalRef_base {
|
|
14
|
-
set ref(arg: any);
|
|
15
|
-
get ref(): any;
|
|
16
|
-
get refScale(): {
|
|
17
|
-
x: number;
|
|
18
|
-
y: number;
|
|
19
|
-
};
|
|
20
|
-
draw(ctx: any): void;
|
|
21
|
-
_drawing: boolean | undefined;
|
|
22
|
-
prerender(ctx: any): void;
|
|
23
|
-
postrender(ctx: any): any;
|
|
24
|
-
render(ctx: any): any;
|
|
25
|
-
get nature(): {
|
|
26
|
-
mutable: boolean;
|
|
27
|
-
resizable: boolean;
|
|
28
|
-
rotatable: boolean;
|
|
29
|
-
properties: ({
|
|
30
|
-
type: string;
|
|
31
|
-
label: string;
|
|
32
|
-
name: string;
|
|
33
|
-
property?: undefined;
|
|
34
|
-
} | {
|
|
35
|
-
type: string;
|
|
36
|
-
label: string;
|
|
37
|
-
name: string;
|
|
38
|
-
property: {
|
|
39
|
-
options: string[];
|
|
40
|
-
};
|
|
41
|
-
})[];
|
|
42
|
-
'value-property': string;
|
|
43
|
-
help: string;
|
|
44
|
-
};
|
|
45
|
-
get hasTextProperty(): boolean;
|
|
46
|
-
}
|
|
47
|
-
export {};
|
|
@@ -1,103 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Copyright © HatioLab Inc. All rights reserved.
|
|
3
|
-
*/
|
|
4
|
-
import Component from './component';
|
|
5
|
-
import Shape from './shape';
|
|
6
|
-
import RectPath from './mixins/rect-path';
|
|
7
|
-
const NATURE = {
|
|
8
|
-
mutable: false,
|
|
9
|
-
resizable: true,
|
|
10
|
-
rotatable: true,
|
|
11
|
-
properties: [
|
|
12
|
-
{
|
|
13
|
-
type: 'id-input',
|
|
14
|
-
label: 'ref',
|
|
15
|
-
name: 'ref'
|
|
16
|
-
},
|
|
17
|
-
{
|
|
18
|
-
type: 'select',
|
|
19
|
-
label: 'fit',
|
|
20
|
-
name: 'fit',
|
|
21
|
-
property: {
|
|
22
|
-
options: ['both', 'ratio']
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
],
|
|
26
|
-
'value-property': 'ref',
|
|
27
|
-
help: 'scene/component/local-ref'
|
|
28
|
-
};
|
|
29
|
-
export default class LocalRef extends RectPath(Shape) {
|
|
30
|
-
get ref() {
|
|
31
|
-
var ref = this.getState('ref');
|
|
32
|
-
if (!ref || typeof ref != 'string')
|
|
33
|
-
return null;
|
|
34
|
-
return this.root.findById(ref);
|
|
35
|
-
}
|
|
36
|
-
set ref(ref) {
|
|
37
|
-
this.setState('ref', ref);
|
|
38
|
-
}
|
|
39
|
-
get refScale() {
|
|
40
|
-
let targetBounds = this.ref.bounds;
|
|
41
|
-
let bounds = this.bounds;
|
|
42
|
-
let sx = bounds.width / targetBounds.width;
|
|
43
|
-
let sy = bounds.height / targetBounds.height;
|
|
44
|
-
switch (this.model.fit) {
|
|
45
|
-
case 'both':
|
|
46
|
-
return {
|
|
47
|
-
x: sx,
|
|
48
|
-
y: sy
|
|
49
|
-
};
|
|
50
|
-
break;
|
|
51
|
-
case 'ratio':
|
|
52
|
-
default:
|
|
53
|
-
return {
|
|
54
|
-
x: Math.min(sx, sy),
|
|
55
|
-
y: Math.min(sx, sy)
|
|
56
|
-
};
|
|
57
|
-
break;
|
|
58
|
-
}
|
|
59
|
-
}
|
|
60
|
-
draw(ctx) {
|
|
61
|
-
if (this._drawing)
|
|
62
|
-
return;
|
|
63
|
-
this._drawing = true;
|
|
64
|
-
super.draw(ctx);
|
|
65
|
-
this._drawing = false;
|
|
66
|
-
}
|
|
67
|
-
prerender(ctx) {
|
|
68
|
-
super.prerender(ctx);
|
|
69
|
-
if (this.ref) {
|
|
70
|
-
let targetCenter = this.ref.center;
|
|
71
|
-
let center = this.center;
|
|
72
|
-
let scale = this.refScale;
|
|
73
|
-
ctx.translate(center.x, center.y);
|
|
74
|
-
ctx.scale(scale.x, scale.y);
|
|
75
|
-
ctx.translate(-targetCenter.x, -targetCenter.y);
|
|
76
|
-
}
|
|
77
|
-
}
|
|
78
|
-
postrender(ctx) {
|
|
79
|
-
if (this.ref)
|
|
80
|
-
return this.ref.postrender(ctx);
|
|
81
|
-
super.postrender(ctx);
|
|
82
|
-
}
|
|
83
|
-
render(ctx) {
|
|
84
|
-
if (this.ref)
|
|
85
|
-
return this.ref.render(ctx);
|
|
86
|
-
var { round = 0 } = this.state;
|
|
87
|
-
var { left, top, width, height } = this.bounds;
|
|
88
|
-
// 박스 그리기
|
|
89
|
-
ctx.beginPath();
|
|
90
|
-
ctx.rect(left, top, width, height);
|
|
91
|
-
// TODO Logic
|
|
92
|
-
}
|
|
93
|
-
get nature() {
|
|
94
|
-
return NATURE;
|
|
95
|
-
}
|
|
96
|
-
get hasTextProperty() {
|
|
97
|
-
return false;
|
|
98
|
-
}
|
|
99
|
-
}
|
|
100
|
-
Component.memoize(LocalRef.prototype, 'ref', false);
|
|
101
|
-
Component.memoize(LocalRef.prototype, 'refScale', false);
|
|
102
|
-
Component.register('local-ref', LocalRef);
|
|
103
|
-
//# sourceMappingURL=local-ref.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"local-ref.js","sourceRoot":"","sources":["../../src/components/local-ref.js"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,SAAS,MAAM,aAAa,CAAA;AACnC,OAAO,KAAK,MAAM,SAAS,CAAA;AAE3B,OAAO,QAAQ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IAAI,CAAC,GAAG;YAAE,OAAO,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,CAAA;QAEzC,IAAI,EAAE,KAAK,GAAG,CAAC,EAAE,GAAG,IAAI,CAAC,KAAK,CAAA;QAE9B,IAAI,EAAE,IAAI,EAAE,GAAG,EAAE,KAAK,EAAE,MAAM,EAAE,GAAG,IAAI,CAAC,MAAM,CAAA;QAE9C,SAAS;QACT,GAAG,CAAC,SAAS,EAAE,CAAA;QAEf,GAAG,CAAC,IAAI,CAAC,IAAI,EAAE,GAAG,EAAE,KAAK,EAAE,MAAM,CAAC,CAAA;QAElC,aAAa;IACf,CAAC;IAED,IAAI,MAAM;QACR,OAAO,MAAM,CAAA;IACf,CAAC;IAED,IAAI,eAAe;QACjB,OAAO,KAAK,CAAA;IACd,CAAC;CACF;AAED,SAAS,CAAC,OAAO,CAAC,QAAQ,CAAC,SAAS,EAAE,KAAK,EAAE,KAAK,CAAC,CAAA;AACnD,SAAS,CAAC,OAAO,CAAC,QAAQ,CAAC,SAAS,EAAE,UAAU,EAAE,KAAK,CAAC,CAAA;AAExD,SAAS,CAAC,QAAQ,CAAC,WAAW,EAAE,QAAQ,CAAC,CAAA","sourcesContent":["/*\n * Copyright © HatioLab Inc. All rights reserved.\n */\n\nimport Component from './component'\nimport Shape from './shape'\n\nimport RectPath from './mixins/rect-path'\n\nconst NATURE = {\n mutable: false,\n resizable: true,\n rotatable: true,\n properties: [\n {\n type: 'id-input',\n label: 'ref',\n name: 'ref'\n },\n {\n type: 'select',\n label: 'fit',\n name: 'fit',\n property: {\n options: ['both', 'ratio']\n }\n }\n ],\n 'value-property': 'ref',\n help: 'scene/component/local-ref'\n}\n\nexport default class LocalRef extends RectPath(Shape) {\n get ref() {\n var ref = this.getState('ref')\n\n if (!ref || typeof ref != 'string') return null\n\n return this.root.findById(ref)\n }\n\n set ref(ref) {\n this.setState('ref', ref)\n }\n\n get refScale() {\n let targetBounds = this.ref.bounds\n let bounds = this.bounds\n\n let sx = bounds.width / targetBounds.width\n let sy = bounds.height / targetBounds.height\n\n switch (this.model.fit) {\n case 'both':\n return {\n x: sx,\n y: sy\n }\n break\n case 'ratio':\n default:\n return {\n x: Math.min(sx, sy),\n y: Math.min(sx, sy)\n }\n break\n }\n }\n\n draw(ctx) {\n if (this._drawing) return\n\n this._drawing = true\n super.draw(ctx)\n this._drawing = false\n }\n\n prerender(ctx) {\n super.prerender(ctx)\n\n if (this.ref) {\n let targetCenter = this.ref.center\n let center = this.center\n\n let scale = this.refScale\n\n ctx.translate(center.x, center.y)\n ctx.scale(scale.x, scale.y)\n ctx.translate(-targetCenter.x, -targetCenter.y)\n }\n }\n\n postrender(ctx) {\n if (this.ref) return this.ref.postrender(ctx)\n\n super.postrender(ctx)\n }\n\n render(ctx) {\n if (this.ref) return this.ref.render(ctx)\n\n var { round = 0 } = this.state\n\n var { left, top, width, height } = this.bounds\n\n // 박스 그리기\n ctx.beginPath()\n\n ctx.rect(left, top, width, height)\n\n // TODO Logic\n }\n\n get nature() {\n return NATURE\n }\n\n get hasTextProperty() {\n return false\n }\n}\n\nComponent.memoize(LocalRef.prototype, 'ref', false)\nComponent.memoize(LocalRef.prototype, 'refScale', false)\n\nComponent.register('local-ref', LocalRef)\n"]}
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
declare function _default(superclass: any): {
|
|
2
|
-
new (): {
|
|
3
|
-
[x: string]: any;
|
|
4
|
-
isConnectable(): boolean;
|
|
5
|
-
postrender(context: any): void;
|
|
6
|
-
/**
|
|
7
|
-
*
|
|
8
|
-
* @param {CanvasRenderingContext2D} context
|
|
9
|
-
*/
|
|
10
|
-
_draw_anchors(context: CanvasRenderingContext2D): void;
|
|
11
|
-
contains(x: any, y: any): any;
|
|
12
|
-
/**
|
|
13
|
-
* @function findInOutLines
|
|
14
|
-
* @param {string} anchorName
|
|
15
|
-
* @return {Line[]}
|
|
16
|
-
*/
|
|
17
|
-
findInOutLines(anchorName: string): Line[];
|
|
18
|
-
/**
|
|
19
|
-
* @function findOutletLines
|
|
20
|
-
* @parameter {string} anchorName
|
|
21
|
-
* @return {Line[]}
|
|
22
|
-
*/
|
|
23
|
-
findOutletLines(anchorName: any): Line[];
|
|
24
|
-
/**
|
|
25
|
-
* @function findOutletEnds
|
|
26
|
-
* @parameter {string} anchorName
|
|
27
|
-
* @return {Component[]}
|
|
28
|
-
*/
|
|
29
|
-
findOutletEnds(anchorName: any): Component[];
|
|
30
|
-
/**
|
|
31
|
-
* @function findInletLines
|
|
32
|
-
* @parameter {string} anchorName
|
|
33
|
-
* @return {Line[]}
|
|
34
|
-
*/
|
|
35
|
-
findInletLines(anchorName: any): Line[];
|
|
36
|
-
/**
|
|
37
|
-
* @function findInletEnds
|
|
38
|
-
* @parameter {string} anchorName
|
|
39
|
-
* @return {Component[]}
|
|
40
|
-
*/
|
|
41
|
-
findInletEnds(anchorName: any): Component[];
|
|
42
|
-
};
|
|
43
|
-
[x: string]: any;
|
|
44
|
-
};
|
|
45
|
-
export default _default;
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
export const GESTURES: string[];
|
|
2
|
-
declare function _default(superclass: any): {
|
|
3
|
-
new (): {
|
|
4
|
-
[x: string]: any;
|
|
5
|
-
isHTMLElement(): boolean;
|
|
6
|
-
isShadowable(): boolean;
|
|
7
|
-
element: any;
|
|
8
|
-
_element: any;
|
|
9
|
-
readonly tagName: any;
|
|
10
|
-
setElementProperties(element: any): void;
|
|
11
|
-
createElement(): void;
|
|
12
|
-
userInputEventHandler(e: any): void;
|
|
13
|
-
reposition(): void;
|
|
14
|
-
disposeElement(): void;
|
|
15
|
-
ready(): void;
|
|
16
|
-
dispose(): void;
|
|
17
|
-
readonly hasTextProperty: boolean;
|
|
18
|
-
readonly textHidden: boolean;
|
|
19
|
-
onchange(after: any, before: any): void;
|
|
20
|
-
isDescendible(container: any): any;
|
|
21
|
-
};
|
|
22
|
-
[x: string]: any;
|
|
23
|
-
};
|
|
24
|
-
export default _default;
|