@hatiolab/things-scene 9.0.0-beta.9 → 9.0.1
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/README.md +76 -11
- package/package.json +32 -16
- package/things-scene-min.js +74 -2
- package/things-scene-min.js.map +1 -0
- package/things-scene.d.ts +49 -7
- package/things-scene.mjs +61 -31
- package/things-scene.mjs.map +1 -0
- package/.prettierrc +0 -21
- package/assets/icon-audio.png +0 -0
- package/assets/icon-gif-viewer.png +0 -0
- package/assets/images/spinner.png +0 -0
- package/babel.config.js +0 -22
- package/db.sqlite +0 -0
- 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
- package/rollup.config.js +0 -40
- package/schema.graphql +0 -4557
- package/src/index.js +0 -5
- package/things-board.js +0 -9
- package/things-scene-ie.js +0 -2
- package/things-scene-ie.js.LICENSE.txt +0 -15
- package/things-scene-min.js.LICENSE.txt +0 -15
- package/tsconfig.json +0 -9
package/.prettierrc
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"printWidth": 120,
|
|
3
|
-
"semi": false,
|
|
4
|
-
"singleQuote": true,
|
|
5
|
-
"arrowParens": "avoid",
|
|
6
|
-
"tabWidth": 2,
|
|
7
|
-
"useTabs": false,
|
|
8
|
-
"trailingComma": "none",
|
|
9
|
-
"overrides": [
|
|
10
|
-
{
|
|
11
|
-
"files": [
|
|
12
|
-
"*.json",
|
|
13
|
-
".md",
|
|
14
|
-
".markdown"
|
|
15
|
-
],
|
|
16
|
-
"options": {
|
|
17
|
-
"tabWidth": 2
|
|
18
|
-
}
|
|
19
|
-
}
|
|
20
|
-
]
|
|
21
|
-
}
|
package/assets/icon-audio.png
DELETED
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/babel.config.js
DELETED
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
const mode = process.env.NODE_ENV
|
|
2
|
-
|
|
3
|
-
module.exports = {
|
|
4
|
-
presets: [
|
|
5
|
-
[
|
|
6
|
-
'@babel/preset-env',
|
|
7
|
-
{
|
|
8
|
-
targets: {
|
|
9
|
-
browsers: ['last 2 Chrome versions', 'Safari 10']
|
|
10
|
-
},
|
|
11
|
-
debug: mode === 'development'
|
|
12
|
-
}
|
|
13
|
-
],
|
|
14
|
-
'@babel/preset-react',
|
|
15
|
-
'@babel/preset-typescript',
|
|
16
|
-
],
|
|
17
|
-
plugins: [
|
|
18
|
-
'@babel/plugin-transform-typescript',
|
|
19
|
-
['@babel/plugin-proposal-decorators', { version: 'legacy' }],
|
|
20
|
-
'@babel/plugin-proposal-class-properties'
|
|
21
|
-
]
|
|
22
|
-
}
|
package/db.sqlite
DELETED
|
Binary file
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
export default class Animation {
|
|
2
|
-
constructor(client: any, config: any);
|
|
3
|
-
client: any;
|
|
4
|
-
config: any;
|
|
5
|
-
_started: boolean;
|
|
6
|
-
delta: any;
|
|
7
|
-
dispose(): void;
|
|
8
|
-
init(): void;
|
|
9
|
-
start(): void;
|
|
10
|
-
_raf: number | null | undefined;
|
|
11
|
-
stop(): void;
|
|
12
|
-
set started(arg: boolean);
|
|
13
|
-
get started(): boolean;
|
|
14
|
-
}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
outline 애니메이션은 정지해있는 컴포넌트의 outline을 따라 움직이는 효과를 만들어낸다.
|
|
3
|
-
만일 아웃라인을 제공하는 컴포넌트가 애니메이션 동작중이면, 애니메이션 동작에 의한 아웃라인의 변화는 반영되지 않는다.
|
|
4
|
-
애니메이션이 아닌 실제 위치가 변경되는 경우에는 반영된다.
|
|
5
|
-
아웃라인 컴포넌트와 애니메이션 컴포넌트가 동일 부모 아래서 적용된다면, 부모의 움직임이 반영되는 효과를 만들어 낼 수 있다.
|
|
6
|
-
*/
|
|
7
|
-
export default class Outline extends Animation {
|
|
8
|
-
step(delta: any): void;
|
|
9
|
-
}
|
|
10
|
-
import Animation from "./animation";
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export default function compile(client: any, animationConfig: any): any;
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
export function linear(progress: any): any;
|
|
2
|
-
export function quad(progress: any): number;
|
|
3
|
-
export function circ(progress: any): number;
|
|
4
|
-
export function back(progress: any, options?: {
|
|
5
|
-
x: number;
|
|
6
|
-
}): number;
|
|
7
|
-
export function bounce(progress: any): number | undefined;
|
|
8
|
-
export function elastic(progress: any, options?: {
|
|
9
|
-
x: number;
|
|
10
|
-
}): number;
|
|
11
|
-
declare namespace _default {
|
|
12
|
-
export { linear };
|
|
13
|
-
export { quad };
|
|
14
|
-
export { circ };
|
|
15
|
-
export { back };
|
|
16
|
-
export { bounce };
|
|
17
|
-
export { elastic };
|
|
18
|
-
}
|
|
19
|
-
export default _default;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { default as compile } from "./compile";
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
export default class CommandChange extends Command {
|
|
2
|
-
static before(components: any): any;
|
|
3
|
-
static after(changes: any, commander: any): void;
|
|
4
|
-
static around(commander: any, changeFunc: any, self: any): void;
|
|
5
|
-
execute(): void;
|
|
6
|
-
}
|
|
7
|
-
import Command from "./command";
|
|
@@ -1,85 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Copyright © HatioLab Inc. All rights reserved.
|
|
3
|
-
*/
|
|
4
|
-
import Component from '../components/component';
|
|
5
|
-
import Command from './command';
|
|
6
|
-
function calculate_bounds_on_root(component) {
|
|
7
|
-
if (component.isRootModel())
|
|
8
|
-
return component.bounds;
|
|
9
|
-
var { bounds, rotatePoint } = component;
|
|
10
|
-
var pointOnTop = rotatePoint;
|
|
11
|
-
// if(component.parent && !component.parent.isRootModel())
|
|
12
|
-
// pointOnTop = recursive_transcoordS2P(pointOnTop, component.parent)
|
|
13
|
-
// TODO 목적상 아래 로직으로 대체 가능할 것이다. 검토하라. (스케일된 컴포넌트에 대해서 이상작동한다.)
|
|
14
|
-
pointOnTop = component.transcoordS2T(pointOnTop.x, pointOnTop.y);
|
|
15
|
-
return {
|
|
16
|
-
left: pointOnTop.x - (rotatePoint.x - bounds.left),
|
|
17
|
-
top: pointOnTop.y - (rotatePoint.y - bounds.top),
|
|
18
|
-
width: bounds.width,
|
|
19
|
-
height: bounds.height
|
|
20
|
-
};
|
|
21
|
-
}
|
|
22
|
-
function calculate_bounds_on_container(component, container) {
|
|
23
|
-
if (container.isRootModel())
|
|
24
|
-
return component.bounds;
|
|
25
|
-
var { bounds, rotatePoint } = component;
|
|
26
|
-
var pointOnContainer = container.transcoordT2S(rotatePoint.x, rotatePoint.y);
|
|
27
|
-
var container_bounds = container.bounds;
|
|
28
|
-
return {
|
|
29
|
-
left: pointOnContainer.x - (rotatePoint.x - bounds.left) - container_bounds.left,
|
|
30
|
-
top: pointOnContainer.y - (rotatePoint.y - bounds.top) - container_bounds.top,
|
|
31
|
-
width: bounds.width,
|
|
32
|
-
height: bounds.height
|
|
33
|
-
};
|
|
34
|
-
}
|
|
35
|
-
function calculate_rotation_on_root(component) {
|
|
36
|
-
var rotation = 0;
|
|
37
|
-
while (component && !component.isRootModel()) {
|
|
38
|
-
rotation += component.get('rotation') || 0;
|
|
39
|
-
component = component.parent;
|
|
40
|
-
}
|
|
41
|
-
return rotation % (Math.PI * 2);
|
|
42
|
-
}
|
|
43
|
-
function calculate_rotation_on_container(component, container) {
|
|
44
|
-
var rotation = component.get('rotation') || 0;
|
|
45
|
-
var container_rotation = calculate_rotation_on_root(container);
|
|
46
|
-
return (rotation - container_rotation) % (Math.PI * 2);
|
|
47
|
-
}
|
|
48
|
-
/*
|
|
49
|
-
* 컴포넌트가 추가, 삭제되거나 부모컨테이너를 바꿔서 이동하는 경우.
|
|
50
|
-
* 새로운 그룹을 만들거나, 그룹해제 되는 경우도 포함됨.
|
|
51
|
-
*
|
|
52
|
-
* to_container, component, to_index
|
|
53
|
-
*
|
|
54
|
-
*/
|
|
55
|
-
export default class CommandMigrate extends Command {
|
|
56
|
-
execute() {
|
|
57
|
-
var changes = this.params.changes;
|
|
58
|
-
changes.forEach(change => {
|
|
59
|
-
let { component, to_container, to_index, to_left, to_top, hint } = change;
|
|
60
|
-
let bounds = calculate_bounds_on_root(component);
|
|
61
|
-
let rotation = calculate_rotation_on_root(component);
|
|
62
|
-
/* to_container가 없으면, 완전히 제거함 */
|
|
63
|
-
component.removeSelf(!to_container);
|
|
64
|
-
component.bounds = bounds;
|
|
65
|
-
component.set('rotation', rotation);
|
|
66
|
-
if (to_container) {
|
|
67
|
-
component.set('rotation', calculate_rotation_on_container(component, to_container));
|
|
68
|
-
let bounds = calculate_bounds_on_container(component, to_container);
|
|
69
|
-
change.to_left = to_left !== undefined ? to_left : bounds.left;
|
|
70
|
-
change.to_top = to_top !== undefined ? to_top : bounds.top;
|
|
71
|
-
component.bounds = {
|
|
72
|
-
left: change.to_left,
|
|
73
|
-
top: change.to_top,
|
|
74
|
-
width: bounds.width,
|
|
75
|
-
height: bounds.height
|
|
76
|
-
};
|
|
77
|
-
if (typeof to_index === 'undefined')
|
|
78
|
-
to_container.addComponent(component);
|
|
79
|
-
else
|
|
80
|
-
to_container.insertComponentAt(component, to_index);
|
|
81
|
-
}
|
|
82
|
-
});
|
|
83
|
-
}
|
|
84
|
-
}
|
|
85
|
-
//# sourceMappingURL=command-migrate.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"command-migrate.js","sourceRoot":"","sources":["../../src/command/command-migrate.js"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,SAAS,MAAM,yBAAyB,CAAA;AAC/C,OAAO,OAAO,MAAM,WAAW,CAAA;AAE/B,SAAS,wBAAwB,CAAC,SAAS;IACzC,IAAI,SAAS,CAAC,WAAW,EAAE;QAAE,OAAO,SAAS,CAAC,MAAM,CAAA;IAEpD,IAAI,EAAE,MAAM,EAAE,WAAW,EAAE,GAAG,SAAS,CAAA;IAEvC,IAAI,UAAU,GAAG,WAAW,CAAA;IAC5B,0DAA0D;IAC1D,qEAAqE;IACrE,8DAA8D;IAC9D,UAAU,GAAG,SAAS,CAAC,aAAa,CAAC,UAAU,CAAC,CAAC,EAAE,UAAU,CAAC,CAAC,CAAC,CAAA;IAEhE,OAAO;QACL,IAAI,EAAE,UAAU,CAAC,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC,GAAG,MAAM,CAAC,IAAI,CAAC;QAClD,GAAG,EAAE,UAAU,CAAC,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC,GAAG,MAAM,CAAC,GAAG,CAAC;QAChD,KAAK,EAAE,MAAM,CAAC,KAAK;QACnB,MAAM,EAAE,MAAM,CAAC,MAAM;KACtB,CAAA;AACH,CAAC;AAED,SAAS,6BAA6B,CAAC,SAAS,EAAE,SAAS;IACzD,IAAI,SAAS,CAAC,WAAW,EAAE;QAAE,OAAO,SAAS,CAAC,MAAM,CAAA;IAEpD,IAAI,EAAE,MAAM,EAAE,WAAW,EAAE,GAAG,SAAS,CAAA;I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AAiB,CAAC,SAAS,EAAE,QAAQ,CAAC,CAAA;aACzD;QACH,CAAC,CAAC,CAAA;IACJ,CAAC;CACF","sourcesContent":["/*\n * Copyright © HatioLab Inc. All rights reserved.\n */\n\nimport Component from '../components/component'\nimport Command from './command'\n\nfunction calculate_bounds_on_root(component) {\n if (component.isRootModel()) return component.bounds\n\n var { bounds, rotatePoint } = component\n\n var pointOnTop = rotatePoint\n // if(component.parent && !component.parent.isRootModel())\n // pointOnTop = recursive_transcoordS2P(pointOnTop, component.parent)\n // TODO 목적상 아래 로직으로 대체 가능할 것이다. 검토하라. (스케일된 컴포넌트에 대해서 이상작동한다.)\n pointOnTop = component.transcoordS2T(pointOnTop.x, pointOnTop.y)\n\n return {\n left: pointOnTop.x - (rotatePoint.x - bounds.left),\n top: pointOnTop.y - (rotatePoint.y - bounds.top),\n width: bounds.width,\n height: bounds.height\n }\n}\n\nfunction calculate_bounds_on_container(component, container) {\n if (container.isRootModel()) return component.bounds\n\n var { bounds, rotatePoint } = component\n\n var pointOnContainer = container.transcoordT2S(rotatePoint.x, rotatePoint.y)\n\n var container_bounds = container.bounds\n\n return {\n left: pointOnContainer.x - (rotatePoint.x - bounds.left) - container_bounds.left,\n top: pointOnContainer.y - (rotatePoint.y - bounds.top) - container_bounds.top,\n width: bounds.width,\n height: bounds.height\n }\n}\n\nfunction calculate_rotation_on_root(component) {\n var rotation = 0\n\n while (component && !component.isRootModel()) {\n rotation += component.get('rotation') || 0\n\n component = component.parent\n }\n\n return rotation % (Math.PI * 2)\n}\n\nfunction calculate_rotation_on_container(component, container) {\n var rotation = component.get('rotation') || 0\n var container_rotation = calculate_rotation_on_root(container)\n\n return (rotation - container_rotation) % (Math.PI * 2)\n}\n\n/*\n * 컴포넌트가 추가, 삭제되거나 부모컨테이너를 바꿔서 이동하는 경우.\n * 새로운 그룹을 만들거나, 그룹해제 되는 경우도 포함됨.\n *\n * to_container, component, to_index\n *\n */\nexport default class CommandMigrate extends Command {\n execute() {\n var changes = this.params.changes\n\n changes.forEach(change => {\n let { component, to_container, to_index, to_left, to_top, hint } = change\n\n let bounds = calculate_bounds_on_root(component)\n let rotation = calculate_rotation_on_root(component)\n\n /* to_container가 없으면, 완전히 제거함 */\n component.removeSelf(!to_container)\n\n component.bounds = bounds\n component.set('rotation', rotation)\n\n if (to_container) {\n component.set('rotation', calculate_rotation_on_container(component, to_container))\n let bounds = calculate_bounds_on_container(component, to_container)\n\n change.to_left = to_left !== undefined ? to_left : bounds.left\n change.to_top = to_top !== undefined ? to_top : bounds.top\n\n component.bounds = {\n left: change.to_left,\n top: change.to_top,\n width: bounds.width,\n height: bounds.height\n }\n\n if (typeof to_index === 'undefined') to_container.addComponent(component)\n else to_container.insertComponentAt(component, to_index)\n }\n })\n }\n}\n"]}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
export default class SnapshotCommander {
|
|
2
|
-
constructor(container: any);
|
|
3
|
-
container: any;
|
|
4
|
-
timecapsule: TimeCapsule;
|
|
5
|
-
snapshot_taker: SnapshotTaker;
|
|
6
|
-
dispose(): void;
|
|
7
|
-
execute(command: any, doit: any): void;
|
|
8
|
-
undo(): void;
|
|
9
|
-
redo(): void;
|
|
10
|
-
undoable(): boolean;
|
|
11
|
-
redoable(): boolean;
|
|
12
|
-
reset(): void;
|
|
13
|
-
}
|
|
14
|
-
import TimeCapsule from "../core/timecapsule";
|
|
15
|
-
import SnapshotTaker from "../core/snapshot-taker";
|
|
@@ -1,128 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Position definition
|
|
3
|
-
* @typedef {Object} Position
|
|
4
|
-
* @property {number} x - x position
|
|
5
|
-
* @property {number} y - y position
|
|
6
|
-
*/
|
|
7
|
-
/**
|
|
8
|
-
* Bounds definition
|
|
9
|
-
* @typedef {Object} Bounds
|
|
10
|
-
* @property {number} left - left position
|
|
11
|
-
* @property {number} top - top position
|
|
12
|
-
* @property {number} width - width
|
|
13
|
-
* @property {number} height - height
|
|
14
|
-
*/
|
|
15
|
-
/**
|
|
16
|
-
* anchorDrawFunction
|
|
17
|
-
* @param {CanvasRenderingContext2D} context
|
|
18
|
-
* @param {Component} component
|
|
19
|
-
*/
|
|
20
|
-
/**
|
|
21
|
-
* Anchor definition
|
|
22
|
-
* @typedef {Object} Anchor
|
|
23
|
-
* @property {string} name - name of the anchor
|
|
24
|
-
* @property {string} type - type of the anchor
|
|
25
|
-
* @property {string} inout - inout direction of the anchor 'in', 'out', 'inout'
|
|
26
|
-
* @property {Position} position - position of the anchor
|
|
27
|
-
* @property {Bounds} bounds - bounds of the anchor
|
|
28
|
-
* @property {boolean} multiplicity - multiplicity
|
|
29
|
-
* @property {anchorDrawFunction} draw
|
|
30
|
-
*/
|
|
31
|
-
/**
|
|
32
|
-
* @function findInOutLines
|
|
33
|
-
* @param {Component} component
|
|
34
|
-
* @param {string} anchorName
|
|
35
|
-
* @return {Line[]}
|
|
36
|
-
*/
|
|
37
|
-
export function findInOutLines(component: Component, anchorName: string): Line[];
|
|
38
|
-
/**
|
|
39
|
-
* @function findOutletLines
|
|
40
|
-
* @param {Component} component
|
|
41
|
-
* @param {string} anchorName
|
|
42
|
-
* @return {Line[]}
|
|
43
|
-
*/
|
|
44
|
-
export function findOutletLines(component: Component, anchorName: string): Line[];
|
|
45
|
-
/**
|
|
46
|
-
* @function findOutletEnds
|
|
47
|
-
* @param {Component} component
|
|
48
|
-
* @param {string} anchorName
|
|
49
|
-
* @return {Component[]}
|
|
50
|
-
*/
|
|
51
|
-
export function findOutletEnds(component: Component, anchorName: string): Component[];
|
|
52
|
-
/**
|
|
53
|
-
* @function findInletLines
|
|
54
|
-
* @param {Component} component
|
|
55
|
-
* @return {Line[]}
|
|
56
|
-
*/
|
|
57
|
-
export function findInletLines(component: Component, anchorName: any): Line[];
|
|
58
|
-
/**
|
|
59
|
-
* @function findInletEnds
|
|
60
|
-
* @param {Component} component
|
|
61
|
-
* @param {string} anchorName
|
|
62
|
-
* @return {Component[]}
|
|
63
|
-
*/
|
|
64
|
-
export function findInletEnds(component: Component, anchorName: string): Component[];
|
|
65
|
-
/**
|
|
66
|
-
* Position definition
|
|
67
|
-
*/
|
|
68
|
-
export type Position = {
|
|
69
|
-
/**
|
|
70
|
-
* - x position
|
|
71
|
-
*/
|
|
72
|
-
x: number;
|
|
73
|
-
/**
|
|
74
|
-
* - y position
|
|
75
|
-
*/
|
|
76
|
-
y: number;
|
|
77
|
-
};
|
|
78
|
-
/**
|
|
79
|
-
* Bounds definition
|
|
80
|
-
*/
|
|
81
|
-
export type Bounds = {
|
|
82
|
-
/**
|
|
83
|
-
* - left position
|
|
84
|
-
*/
|
|
85
|
-
left: number;
|
|
86
|
-
/**
|
|
87
|
-
* - top position
|
|
88
|
-
*/
|
|
89
|
-
top: number;
|
|
90
|
-
/**
|
|
91
|
-
* - width
|
|
92
|
-
*/
|
|
93
|
-
width: number;
|
|
94
|
-
/**
|
|
95
|
-
* - height
|
|
96
|
-
*/
|
|
97
|
-
height: number;
|
|
98
|
-
};
|
|
99
|
-
/**
|
|
100
|
-
* Anchor definition
|
|
101
|
-
*/
|
|
102
|
-
export type Anchor = {
|
|
103
|
-
/**
|
|
104
|
-
* - name of the anchor
|
|
105
|
-
*/
|
|
106
|
-
name: string;
|
|
107
|
-
/**
|
|
108
|
-
* - type of the anchor
|
|
109
|
-
*/
|
|
110
|
-
type: string;
|
|
111
|
-
/**
|
|
112
|
-
* - inout direction of the anchor 'in', 'out', 'inout'
|
|
113
|
-
*/
|
|
114
|
-
inout: string;
|
|
115
|
-
/**
|
|
116
|
-
* - position of the anchor
|
|
117
|
-
*/
|
|
118
|
-
position: Position;
|
|
119
|
-
/**
|
|
120
|
-
* - bounds of the anchor
|
|
121
|
-
*/
|
|
122
|
-
bounds: Bounds;
|
|
123
|
-
/**
|
|
124
|
-
* - multiplicity
|
|
125
|
-
*/
|
|
126
|
-
multiplicity: boolean;
|
|
127
|
-
draw: anchorDrawFunction;
|
|
128
|
-
};
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
export default function ellipseAnchors(component) {
|
|
2
|
-
var { left, top, width, height } = component.bounds;
|
|
3
|
-
var centerx = left + width / 2;
|
|
4
|
-
var centery = top + height / 2;
|
|
5
|
-
var right = left + width;
|
|
6
|
-
var bottom = top + height;
|
|
7
|
-
return [
|
|
8
|
-
{
|
|
9
|
-
name: 'TOP',
|
|
10
|
-
position: {
|
|
11
|
-
x: centerx,
|
|
12
|
-
y: top
|
|
13
|
-
}
|
|
14
|
-
},
|
|
15
|
-
{
|
|
16
|
-
name: 'RIGHT',
|
|
17
|
-
position: {
|
|
18
|
-
x: right,
|
|
19
|
-
y: centery
|
|
20
|
-
}
|
|
21
|
-
},
|
|
22
|
-
{
|
|
23
|
-
name: 'BOTTOM',
|
|
24
|
-
position: {
|
|
25
|
-
x: centerx,
|
|
26
|
-
y: bottom
|
|
27
|
-
}
|
|
28
|
-
},
|
|
29
|
-
{
|
|
30
|
-
name: 'LEFT',
|
|
31
|
-
position: {
|
|
32
|
-
x: left,
|
|
33
|
-
y: centery
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
];
|
|
37
|
-
}
|
|
38
|
-
//# sourceMappingURL=ellipse-anchors.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ellipse-anchors.js","sourceRoot":"","sources":["../../../src/components/anchor/ellipse-anchors.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,OAAO,UAAU,cAAc,CAAC,SAAoB;IACzD,IAAI,EAAE,IAAI,EAAE,GAAG,EAAE,KAAK,EAAE,MAAM,EAAE,GAAG,SAAS,CAAC,MAAM,CAAA;IAEnD,IAAI,OAAO,GAAG,IAAI,GAAG,KAAK,GAAG,CAAC,CAAA;IAC9B,IAAI,OAAO,GAAG,GAAG,GAAG,MAAM,GAAG,CAAC,CAAA;IAC9B,IAAI,KAAK,GAAG,IAAI,GAAG,KAAK,CAAA;IACxB,IAAI,MAAM,GAAG,GAAG,GAAG,MAAM,CAAA;IAEzB,OAAO;QACL;YACE,IAAI,EAAE,KAAK;YACX,QAAQ,EAAE;gBACR,CAAC,EAAE,OAAO;gBACV,CAAC,EAAE,GAAG;aACP;SACF;QACD;YACE,IAAI,EAAE,OAAO;YACb,QAAQ,EAAE;gBACR,CAAC,EAAE,KAAK;gBACR,CAAC,EAAE,OAAO;aACX;SACF;QACD;YACE,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE;gBACR,CAAC,EAAE,OAAO;gBACV,CAAC,EAAE,MAAM;aACV;SACF;QACD;YACE,IAAI,EAAE,MAAM;YACZ,QAAQ,EAAE;gBACR,CAAC,EAAE,IAAI;gBACP,CAAC,EAAE,OAAO;aACX;SACF;KACF,CAAA;AACH,CAAC","sourcesContent":["import { Anchor, Component } from '@hatiolab/things-scene'\n\nexport default function ellipseAnchors(component: Component): Anchor[] {\n var { left, top, width, height } = component.bounds\n\n var centerx = left + width / 2\n var centery = top + height / 2\n var right = left + width\n var bottom = top + height\n\n return [\n {\n name: 'TOP',\n position: {\n x: centerx,\n y: top\n }\n },\n {\n name: 'RIGHT',\n position: {\n x: right,\n y: centery\n }\n },\n {\n name: 'BOTTOM',\n position: {\n x: centerx,\n y: bottom\n }\n },\n {\n name: 'LEFT',\n position: {\n x: left,\n y: centery\n }\n }\n ]\n}\n"]}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @typedef {import('./anchor.js').Anchor} Anchor
|
|
3
|
-
*/
|
|
4
|
-
/**
|
|
5
|
-
* @function rectAnchors
|
|
6
|
-
* @param {Component} component
|
|
7
|
-
* @return {Anchor[]}
|
|
8
|
-
*/
|
|
9
|
-
export default function rectAnchors(component: Component): Anchor[];
|
|
10
|
-
export type Anchor = import('./anchor.js').Anchor;
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import { ComponentNature, Properties, Shape } from '@hatiolab/things-scene';
|
|
2
|
-
declare const AudioPlayer_base: typeof Shape;
|
|
3
|
-
export default class AudioPlayer extends AudioPlayer_base {
|
|
4
|
-
static IMAGE: HTMLImageElement;
|
|
5
|
-
static get image(): HTMLImageElement;
|
|
6
|
-
_audio: any;
|
|
7
|
-
dispose(): void;
|
|
8
|
-
ready(): void;
|
|
9
|
-
render(ctx: CanvasRenderingContext2D): void;
|
|
10
|
-
get nature(): ComponentNature;
|
|
11
|
-
get hasTextProperty(): boolean;
|
|
12
|
-
get src(): any;
|
|
13
|
-
set src(src: any);
|
|
14
|
-
get started(): boolean;
|
|
15
|
-
set started(started: boolean);
|
|
16
|
-
start(): void;
|
|
17
|
-
pause(): void;
|
|
18
|
-
onchangeSrc(src: string): void;
|
|
19
|
-
onchangeStarted(started: boolean): void;
|
|
20
|
-
onchangeLoop(loop: boolean): void;
|
|
21
|
-
onchange(after: Properties, before: Properties): void;
|
|
22
|
-
ondblclick(e: MouseEvent): void;
|
|
23
|
-
ondropfile(transfered: DataTransferItemList, files: FileList): void;
|
|
24
|
-
}
|
|
25
|
-
export {};
|
package/dist/components/audio.js
DELETED
|
@@ -1,141 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Copyright © HatioLab Inc. All rights reserved.
|
|
3
|
-
*/
|
|
4
|
-
import { Component, RectPath, Shape } from '@hatiolab/things-scene';
|
|
5
|
-
const NATURE = {
|
|
6
|
-
mutable: false,
|
|
7
|
-
resizable: true,
|
|
8
|
-
rotatable: true,
|
|
9
|
-
properties: [
|
|
10
|
-
{
|
|
11
|
-
type: 'string',
|
|
12
|
-
label: 'src',
|
|
13
|
-
name: 'src'
|
|
14
|
-
},
|
|
15
|
-
{
|
|
16
|
-
type: 'checkbox',
|
|
17
|
-
label: 'started',
|
|
18
|
-
name: 'started'
|
|
19
|
-
},
|
|
20
|
-
{
|
|
21
|
-
type: 'checkbox',
|
|
22
|
-
label: 'loop',
|
|
23
|
-
name: 'loop'
|
|
24
|
-
}
|
|
25
|
-
],
|
|
26
|
-
'value-property': 'src',
|
|
27
|
-
help: 'scene/component/audio'
|
|
28
|
-
};
|
|
29
|
-
const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u6+9kRlvtiI5VtPhmHLltT4EKVQkfb8pcOHrXqk6nBAksUjgpKtuYsskaxGKYT0+84uYgziE4YQgMdx0m8PRfis2MbL33PMXoVjD6PEunI4HSjDjStiJP08vQk9hZzQ7oH/geoLYCUBDW4rf4FqCDFt7THUO6B+4jiDn2XNTW7zf4hqCMND4BOsGyw+yAmh0x+QeFh7EeqD5Ce8nLDrI8NpbDyIWHIQNruo4GyAPlhrEzuixBxHLDDJMnfYgYolBricHNfjIdgMWF+Qyu+pkgX4HCwuymL57ELGkIHZG7z2IWE6Q5VV7vGMhQewbtMcZiwhyHj26ne9+xs8PcvDQHnFFqCD7Au0RW4TK+fOKqw4eoOcqYqgU53HR3/5uShFPCfKey9hFDyJO/vAi7RDZnp7X5igyUH72xSDW1E2Pn4tMRCQgR8vLwbgii4gcmLvqQcSPGtIPX3M08wn6I4qYQ94cM/Yw9Xxhmw+X/59wHrtMlX1AmIkzdyaaAnLg1Nnw8WGYSk40X/BOh4+El6LMSBnN2Cd0tPq4w/LJXGrMbCX06PZ2dcM65yzlNertShSHf3SzRAyPM332IcSAHUKPi8EHmXU0l8Uglmni0yipDoi16s+jJKejhywLooz68yiMEcHr2qM4h81CJ++VPJfTu5UwBpv4Pp9DJSi6MJx0bvUwiw4ewgT8zNR0LHUL+OccOpY/3ElzyGKD5pBlMJpDlsOkMythRoNbXh95PJsdA67MrMtAEYbjeDqNo+7oKqWUUkoppZRSSimllFJKFfMXp4vmSjB8n6sAAAAASUVORK5CYII=';
|
|
30
|
-
export default class AudioPlayer extends RectPath(Shape) {
|
|
31
|
-
static get image() {
|
|
32
|
-
if (!AudioPlayer.IMAGE) {
|
|
33
|
-
AudioPlayer.IMAGE = new Image();
|
|
34
|
-
AudioPlayer.IMAGE.src = AUDIO_IMAGE;
|
|
35
|
-
}
|
|
36
|
-
return AudioPlayer.IMAGE;
|
|
37
|
-
}
|
|
38
|
-
dispose() {
|
|
39
|
-
super.dispose();
|
|
40
|
-
this.started = false;
|
|
41
|
-
delete this._audio;
|
|
42
|
-
}
|
|
43
|
-
ready() {
|
|
44
|
-
super.ready();
|
|
45
|
-
this._audio = new Audio();
|
|
46
|
-
this._audio.addEventListener('canplay', () => {
|
|
47
|
-
this.started && this._audio.play();
|
|
48
|
-
});
|
|
49
|
-
var { src = '', loop = false, started = false } = this.state;
|
|
50
|
-
this.onchangeSrc(src);
|
|
51
|
-
this.onchangeLoop(loop);
|
|
52
|
-
this.onchangeStarted(started);
|
|
53
|
-
}
|
|
54
|
-
render(ctx) {
|
|
55
|
-
var { left, top, width, height, src } = this.state;
|
|
56
|
-
ctx.beginPath();
|
|
57
|
-
this.drawImage(ctx, AudioPlayer.image, left, top, width, height);
|
|
58
|
-
}
|
|
59
|
-
get nature() {
|
|
60
|
-
return NATURE;
|
|
61
|
-
}
|
|
62
|
-
get hasTextProperty() {
|
|
63
|
-
return false;
|
|
64
|
-
}
|
|
65
|
-
get src() {
|
|
66
|
-
return this.get('src');
|
|
67
|
-
}
|
|
68
|
-
set src(src) {
|
|
69
|
-
this.set('src', src);
|
|
70
|
-
}
|
|
71
|
-
get started() {
|
|
72
|
-
return !!this.get('started');
|
|
73
|
-
}
|
|
74
|
-
set started(started) {
|
|
75
|
-
this.set('started', started);
|
|
76
|
-
}
|
|
77
|
-
start() {
|
|
78
|
-
if (!this._audio)
|
|
79
|
-
return;
|
|
80
|
-
this._audio.classList.add('active');
|
|
81
|
-
this._audio.play();
|
|
82
|
-
}
|
|
83
|
-
pause() {
|
|
84
|
-
if (!this._audio)
|
|
85
|
-
return;
|
|
86
|
-
this._audio.classList.remove('active');
|
|
87
|
-
this._audio.pause();
|
|
88
|
-
}
|
|
89
|
-
onchangeSrc(src) {
|
|
90
|
-
try {
|
|
91
|
-
// this._audio.crossOrigin = "anonymous";
|
|
92
|
-
if (String(src).substring(0, 4) !== 'data')
|
|
93
|
-
this._audio.crossOrigin = 'use-credentials';
|
|
94
|
-
else
|
|
95
|
-
this._audio.crossOrigin = null;
|
|
96
|
-
this._audio.src = typeof src === 'string' ? this.app.url(src) : src;
|
|
97
|
-
}
|
|
98
|
-
catch (e) {
|
|
99
|
-
console.error(e);
|
|
100
|
-
return;
|
|
101
|
-
}
|
|
102
|
-
}
|
|
103
|
-
onchangeStarted(started) {
|
|
104
|
-
const audio = this._audio;
|
|
105
|
-
if (started) {
|
|
106
|
-
/*
|
|
107
|
-
[ audio/video.readyState ]
|
|
108
|
-
0 = HAVE_NOTHING - no information whether or not the audio/video is ready
|
|
109
|
-
1 = HAVE_METADATA - metadata for the audio/video is ready
|
|
110
|
-
2 = HAVE_CURRENT_DATA - data for the current playback position is available, but not enough data to play next frame/millisecond
|
|
111
|
-
3 = HAVE_FUTURE_DATA - data for the current and at least the next frame is available
|
|
112
|
-
4 = HAVE_ENOUGH_DATA - enough data available to start playing
|
|
113
|
-
*/
|
|
114
|
-
audio.readyState == 4 && audio.play();
|
|
115
|
-
}
|
|
116
|
-
else {
|
|
117
|
-
audio.pause();
|
|
118
|
-
}
|
|
119
|
-
}
|
|
120
|
-
onchangeLoop(loop) {
|
|
121
|
-
this._audio.loop = loop;
|
|
122
|
-
}
|
|
123
|
-
onchange(after, before) {
|
|
124
|
-
'src' in after && this.onchangeSrc(after.src);
|
|
125
|
-
'started' in after && this.onchangeStarted(after.started);
|
|
126
|
-
'loop' in after && this.onchangeLoop(after.loop);
|
|
127
|
-
}
|
|
128
|
-
ondblclick(e) {
|
|
129
|
-
this.started = !this.started;
|
|
130
|
-
}
|
|
131
|
-
ondropfile(transfered, files) {
|
|
132
|
-
for (let i = 0; i < transfered.length; i++) {
|
|
133
|
-
if (transfered[i].type.startsWith('audio/')) {
|
|
134
|
-
this.src = files[i];
|
|
135
|
-
return;
|
|
136
|
-
}
|
|
137
|
-
}
|
|
138
|
-
}
|
|
139
|
-
}
|
|
140
|
-
Component.register('audio', AudioPlayer);
|
|
141
|
-
//# sourceMappingURL=audio.js.map
|