@hatiolab/things-scene 9.0.0-beta.36 → 9.0.0-beta.37
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/package.json +1 -1
- package/things-scene-min.js +11 -11
- package/things-scene-min.js.map +1 -1
- package/things-scene.mjs +11 -11
- package/things-scene.mjs.map +1 -1
- package/.cursorignore +0 -62
- 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 -23
- package/db.sqlite +0 -0
- package/dist/animation/animate.js +0 -63
- package/dist/animation/animate.js.map +0 -1
- package/dist/animation/animations/animation.js +0 -122
- package/dist/animation/animations/animation.js.map +0 -1
- package/dist/animation/animations/fade.js +0 -28
- package/dist/animation/animations/fade.js.map +0 -1
- package/dist/animation/animations/heartbeat.js +0 -28
- package/dist/animation/animations/heartbeat.js.map +0 -1
- package/dist/animation/animations/moving.js +0 -24
- package/dist/animation/animations/moving.js.map +0 -1
- package/dist/animation/animations/outline.js +0 -47
- package/dist/animation/animations/outline.js.map +0 -1
- package/dist/animation/animations/rotation.js +0 -22
- package/dist/animation/animations/rotation.js.map +0 -1
- package/dist/animation/animations/vibration.js +0 -31
- package/dist/animation/animations/vibration.js.map +0 -1
- package/dist/animation/compile.js +0 -31
- package/dist/animation/compile.js.map +0 -1
- package/dist/animation/delta.js +0 -51
- package/dist/animation/delta.js.map +0 -1
- package/dist/animation/index.js +0 -14
- package/dist/animation/index.js.map +0 -1
- package/dist/command/command-change.js +0 -33
- package/dist/command/command-change.js.map +0 -1
- package/dist/command/command-migrate.js +0 -103
- package/dist/command/command-migrate.js.map +0 -1
- package/dist/command/command.js +0 -18
- package/dist/command/command.js.map +0 -1
- package/dist/command/snapshot-commander.js +0 -84
- package/dist/command/snapshot-commander.js.map +0 -1
- package/dist/components/anchor/anchor.js +0 -105
- package/dist/components/anchor/anchor.js.map +0 -1
- package/dist/components/anchor/ellipse-anchors.js +0 -53
- package/dist/components/anchor/ellipse-anchors.js.map +0 -1
- package/dist/components/anchor/rect-anchors.js +0 -53
- package/dist/components/anchor/rect-anchors.js.map +0 -1
- package/dist/components/audio.js +0 -154
- package/dist/components/audio.js.map +0 -1
- package/dist/components/cloud.js +0 -44
- package/dist/components/cloud.js.map +0 -1
- package/dist/components/component.js +0 -1086
- package/dist/components/component.js.map +0 -1
- package/dist/components/container-abstract.js +0 -387
- package/dist/components/container-abstract.js.map +0 -1
- package/dist/components/container.js +0 -331
- package/dist/components/container.js.map +0 -1
- package/dist/components/data/data-mapping.js +0 -82
- package/dist/components/data/data-mapping.js.map +0 -1
- package/dist/components/data/data.js +0 -166
- package/dist/components/data/data.js.map +0 -1
- package/dist/components/data/evaluator.js +0 -103
- package/dist/components/data/evaluator.js.map +0 -1
- package/dist/components/donut.js +0 -104
- package/dist/components/donut.js.map +0 -1
- package/dist/components/drawer/draw-image-pendable.js +0 -20
- package/dist/components/drawer/draw-image-pendable.js.map +0 -1
- package/dist/components/drawer/effect.js +0 -19
- package/dist/components/drawer/effect.js.map +0 -1
- package/dist/components/drawer/fill.js +0 -228
- package/dist/components/drawer/fill.js.map +0 -1
- package/dist/components/drawer/format.js +0 -115
- package/dist/components/drawer/format.js.map +0 -1
- package/dist/components/drawer/line.js +0 -191
- package/dist/components/drawer/line.js.map +0 -1
- package/dist/components/drawer/stroke.js +0 -62
- package/dist/components/drawer/stroke.js.map +0 -1
- package/dist/components/drawer/text-wrapper.js +0 -51
- package/dist/components/drawer/text-wrapper.js.map +0 -1
- package/dist/components/drawer/text.js +0 -269
- package/dist/components/drawer/text.js.map +0 -1
- package/dist/components/ellipse.js +0 -110
- package/dist/components/ellipse.js.map +0 -1
- package/dist/components/file/ondropfile.js +0 -19
- package/dist/components/file/ondropfile.js.map +0 -1
- package/dist/components/fit/fit.js +0 -137
- package/dist/components/fit/fit.js.map +0 -1
- package/dist/components/geometry/transcoord.js +0 -339
- package/dist/components/geometry/transcoord.js.map +0 -1
- package/dist/components/geometry/union.js +0 -35
- package/dist/components/geometry/union.js.map +0 -1
- package/dist/components/gif-view.js +0 -128
- package/dist/components/gif-view.js.map +0 -1
- package/dist/components/global-ref.js +0 -154
- package/dist/components/global-ref.js.map +0 -1
- package/dist/components/group.js +0 -171
- package/dist/components/group.js.map +0 -1
- package/dist/components/html/elements.js +0 -24
- package/dist/components/html/elements.js.map +0 -1
- package/dist/components/html/fill.js +0 -126
- package/dist/components/html/fill.js.map +0 -1
- package/dist/components/html/reposition.js +0 -119
- package/dist/components/html/reposition.js.map +0 -1
- package/dist/components/html/shadow.js +0 -24
- package/dist/components/html/shadow.js.map +0 -1
- package/dist/components/html-overlay-container.js +0 -27
- package/dist/components/html-overlay-container.js.map +0 -1
- package/dist/components/html-overlay-element.js +0 -22
- package/dist/components/html-overlay-element.js.map +0 -1
- package/dist/components/image-view.js +0 -193
- package/dist/components/image-view.js.map +0 -1
- package/dist/components/index.js +0 -231
- package/dist/components/index.js.map +0 -1
- package/dist/components/info-window.js +0 -416
- package/dist/components/info-window.js.map +0 -1
- package/dist/components/line.js +0 -374
- package/dist/components/line.js.map +0 -1
- package/dist/components/local-ref.js +0 -114
- package/dist/components/local-ref.js.map +0 -1
- package/dist/components/mixins/connectable.js +0 -128
- package/dist/components/mixins/connectable.js.map +0 -1
- package/dist/components/mixins/data-source.js +0 -34
- package/dist/components/mixins/data-source.js.map +0 -1
- package/dist/components/mixins/html-element.js +0 -107
- package/dist/components/mixins/html-element.js.map +0 -1
- package/dist/components/mixins/move-handle.js +0 -73
- package/dist/components/mixins/move-handle.js.map +0 -1
- package/dist/components/mixins/rect-path.js +0 -113
- package/dist/components/mixins/rect-path.js.map +0 -1
- package/dist/components/mixins/value-holder.js +0 -81
- package/dist/components/mixins/value-holder.js.map +0 -1
- package/dist/components/mutater/bounds.js +0 -68
- package/dist/components/mutater/bounds.js.map +0 -1
- package/dist/components/mutater/path.js +0 -73
- package/dist/components/mutater/path.js.map +0 -1
- package/dist/components/ortholine.js +0 -763
- package/dist/components/ortholine.js.map +0 -1
- package/dist/components/outline/ellipse-outline.js +0 -23
- package/dist/components/outline/ellipse-outline.js.map +0 -1
- package/dist/components/outline/path-outline.js +0 -48
- package/dist/components/outline/path-outline.js.map +0 -1
- package/dist/components/path.js +0 -49
- package/dist/components/path.js.map +0 -1
- package/dist/components/polygon.js +0 -91
- package/dist/components/polygon.js.map +0 -1
- package/dist/components/polyline.js +0 -114
- package/dist/components/polyline.js.map +0 -1
- package/dist/components/popup.js +0 -160
- package/dist/components/popup.js.map +0 -1
- package/dist/components/rect.js +0 -72
- package/dist/components/rect.js.map +0 -1
- package/dist/components/retention/retention-manager.js +0 -81
- package/dist/components/retention/retention-manager.js.map +0 -1
- package/dist/components/root-container.js +0 -519
- package/dist/components/root-container.js.map +0 -1
- package/dist/components/ruler.js +0 -103
- package/dist/components/ruler.js.map +0 -1
- package/dist/components/shape.js +0 -97
- package/dist/components/shape.js.map +0 -1
- package/dist/components/star.js +0 -103
- package/dist/components/star.js.map +0 -1
- package/dist/components/text/substitutor.js +0 -92
- package/dist/components/text/substitutor.js.map +0 -1
- package/dist/components/text.js +0 -21
- package/dist/components/text.js.map +0 -1
- package/dist/components/triangle.js +0 -92
- package/dist/components/triangle.js.map +0 -1
- package/dist/const.js +0 -71
- package/dist/const.js.map +0 -1
- package/dist/core/collection.js +0 -28
- package/dist/core/collection.js.map +0 -1
- package/dist/core/debug.js +0 -12
- package/dist/core/debug.js.map +0 -1
- package/dist/core/deep-equals.js +0 -112
- package/dist/core/deep-equals.js.map +0 -1
- package/dist/core/dom-to-image.js +0 -617
- package/dist/core/dom-to-image.js.map +0 -1
- package/dist/core/event.js +0 -205
- package/dist/core/event.js.map +0 -1
- package/dist/core/index.js +0 -21
- package/dist/core/index.js.map +0 -1
- package/dist/core/list.js +0 -87
- package/dist/core/list.js.map +0 -1
- package/dist/core/logger.js +0 -29
- package/dist/core/logger.js.map +0 -1
- package/dist/core/memoize.js +0 -40
- package/dist/core/memoize.js.map +0 -1
- package/dist/core/mixin.js +0 -26
- package/dist/core/mixin.js.map +0 -1
- package/dist/core/obj-accessor.js +0 -26
- package/dist/core/obj-accessor.js.map +0 -1
- package/dist/core/reference-map.js +0 -147
- package/dist/core/reference-map.js.map +0 -1
- package/dist/core/round-rect.js +0 -62
- package/dist/core/round-rect.js.map +0 -1
- package/dist/core/safe-round.js +0 -10
- package/dist/core/safe-round.js.map +0 -1
- package/dist/core/script-loader.js +0 -148
- package/dist/core/script-loader.js.map +0 -1
- package/dist/core/snapshot-taker.js +0 -59
- package/dist/core/snapshot-taker.js.map +0 -1
- package/dist/core/stack.js +0 -18
- package/dist/core/stack.js.map +0 -1
- package/dist/core/timecapsule.js +0 -88
- package/dist/core/timecapsule.js.map +0 -1
- package/dist/core/utils.js +0 -309
- package/dist/core/utils.js.map +0 -1
- package/dist/decorator/anchors-decorator.js +0 -53
- package/dist/decorator/anchors-decorator.js.map +0 -1
- package/dist/decorator/bouncing-arrow-decorator.js +0 -52
- package/dist/decorator/bouncing-arrow-decorator.js.map +0 -1
- package/dist/decorator/data-spread-decorator.js +0 -69
- package/dist/decorator/data-spread-decorator.js.map +0 -1
- package/dist/decorator/decotag-decorator.js +0 -33
- package/dist/decorator/decotag-decorator.js.map +0 -1
- package/dist/decorator/index.js +0 -31
- package/dist/decorator/index.js.map +0 -1
- package/dist/decorator/link-decorator.js +0 -66
- package/dist/decorator/link-decorator.js.map +0 -1
- package/dist/effect/gradation.js +0 -37
- package/dist/effect/gradation.js.map +0 -1
- package/dist/effect/index.js +0 -23
- package/dist/effect/index.js.map +0 -1
- package/dist/effect/shadow.js +0 -33
- package/dist/effect/shadow.js.map +0 -1
- package/dist/effect/turn.js +0 -25
- package/dist/effect/turn.js.map +0 -1
- package/dist/event/event-engine.js +0 -76
- package/dist/event/event-engine.js.map +0 -1
- package/dist/event/event-pump.js +0 -92
- package/dist/event/event-pump.js.map +0 -1
- package/dist/event/event-tracker.js +0 -97
- package/dist/event/event-tracker.js.map +0 -1
- package/dist/event/index.js +0 -21
- package/dist/event/index.js.map +0 -1
- package/dist/event/ua-event-handler.js +0 -453
- package/dist/event/ua-event-handler.js.map +0 -1
- package/dist/event-map/animator-handler.js +0 -225
- package/dist/event-map/animator-handler.js.map +0 -1
- package/dist/event-map/animators/animated-icon.js +0 -265
- package/dist/event-map/animators/animated-icon.js.map +0 -1
- package/dist/event-map/animators/border-highlighting.js +0 -476
- package/dist/event-map/animators/border-highlighting.js.map +0 -1
- package/dist/event-map/animators/bouncing-arrow.js +0 -226
- package/dist/event-map/animators/bouncing-arrow.js.map +0 -1
- package/dist/event-map/event-map.js +0 -36
- package/dist/event-map/event-map.js.map +0 -1
- package/dist/event-map/index.js +0 -20
- package/dist/event-map/index.js.map +0 -1
- package/dist/event-map/move-handler.js +0 -233
- package/dist/event-map/move-handler.js.map +0 -1
- package/dist/event-map/paste-handler.js +0 -176
- package/dist/event-map/paste-handler.js.map +0 -1
- package/dist/event-map/shift-handler.js +0 -55
- package/dist/event-map/shift-handler.js.map +0 -1
- package/dist/event-map/text-editor-lite.js +0 -276
- package/dist/event-map/text-editor-lite.js.map +0 -1
- package/dist/event-map/zoom-handler.js +0 -49
- package/dist/event-map/zoom-handler.js.map +0 -1
- package/dist/index.js +0 -20
- package/dist/index.js.map +0 -1
- package/dist/layer/action/emphasize.js +0 -42
- package/dist/layer/action/emphasize.js.map +0 -1
- package/dist/layer/action/popup.js +0 -461
- package/dist/layer/action/popup.js.map +0 -1
- package/dist/layer/action/pressed.js +0 -31
- package/dist/layer/action/pressed.js.map +0 -1
- package/dist/layer/add-layer.js +0 -180
- package/dist/layer/add-layer.js.map +0 -1
- package/dist/layer/decotag-layer.js +0 -121
- package/dist/layer/decotag-layer.js.map +0 -1
- package/dist/layer/guide-layer.js +0 -292
- package/dist/layer/guide-layer.js.map +0 -1
- package/dist/layer/index.js +0 -70
- package/dist/layer/index.js.map +0 -1
- package/dist/layer/layer.js +0 -230
- package/dist/layer/layer.js.map +0 -1
- package/dist/layer/minimap-layer.js +0 -84
- package/dist/layer/minimap-layer.js.map +0 -1
- package/dist/layer/model-layer.js +0 -465
- package/dist/layer/model-layer.js.map +0 -1
- package/dist/layer/modeler/anchor-handler.js +0 -193
- package/dist/layer/modeler/anchor-handler.js.map +0 -1
- package/dist/layer/modeler/control-handler.js +0 -95
- package/dist/layer/modeler/control-handler.js.map +0 -1
- package/dist/layer/modeler/focus-outline.js +0 -41
- package/dist/layer/modeler/focus-outline.js.map +0 -1
- package/dist/layer/modeler/group-outline.js +0 -30
- package/dist/layer/modeler/group-outline.js.map +0 -1
- package/dist/layer/modeler/index.js +0 -56
- package/dist/layer/modeler/index.js.map +0 -1
- package/dist/layer/modeler/path-handler.js +0 -300
- package/dist/layer/modeler/path-handler.js.map +0 -1
- package/dist/layer/modeler/resizer.js +0 -333
- package/dist/layer/modeler/resizer.js.map +0 -1
- package/dist/layer/modeler/rotator.js +0 -134
- package/dist/layer/modeler/rotator.js.map +0 -1
- package/dist/layer/modeling-layer.js +0 -491
- package/dist/layer/modeling-layer.js.map +0 -1
- package/dist/layer/reaction-layer.js +0 -111
- package/dist/layer/reaction-layer.js.map +0 -1
- package/dist/layer/scroll-layer.js +0 -191
- package/dist/layer/scroll-layer.js.map +0 -1
- package/dist/layer/selection/selected-finder.js +0 -96
- package/dist/layer/selection/selected-finder.js.map +0 -1
- package/dist/layer/selection-layer.js +0 -373
- package/dist/layer/selection-layer.js.map +0 -1
- package/dist/layer/shift-layer.js +0 -83
- package/dist/layer/shift-layer.js.map +0 -1
- package/dist/layout/absolute.js +0 -30
- package/dist/layout/absolute.js.map +0 -1
- package/dist/layout/card.js +0 -52
- package/dist/layout/card.js.map +0 -1
- package/dist/layout/html-absolute.js +0 -32
- package/dist/layout/html-absolute.js.map +0 -1
- package/dist/layout/index.js +0 -56
- package/dist/layout/index.js.map +0 -1
- package/dist/layout/layout.js +0 -36
- package/dist/layout/layout.js.map +0 -1
- package/dist/layout/linear-horizontal.js +0 -56
- package/dist/layout/linear-horizontal.js.map +0 -1
- package/dist/layout/linear-vertical.js +0 -56
- package/dist/layout/linear-vertical.js.map +0 -1
- package/dist/layout/table.js +0 -106
- package/dist/layout/table.js.map +0 -1
- package/dist/license/license.js +0 -170
- package/dist/license/license.js.map +0 -1
- package/dist/model/compile.js +0 -40
- package/dist/model/compile.js.map +0 -1
- package/dist/model/duplicate.js +0 -19
- package/dist/model/duplicate.js.map +0 -1
- package/dist/model/index.js +0 -34
- package/dist/model/index.js.map +0 -1
- package/dist/model/selector.js +0 -104
- package/dist/model/selector.js.map +0 -1
- package/dist/style/compile.js +0 -14
- package/dist/style/compile.js.map +0 -1
- package/dist/style/index.js +0 -14
- package/dist/style/index.js.map +0 -1
- package/dist/things-scene/api/add-start.js +0 -18
- package/dist/things-scene/api/add-start.js.map +0 -1
- package/dist/things-scene/api/add.js +0 -71
- package/dist/things-scene/api/add.js.map +0 -1
- package/dist/things-scene/api/align.js +0 -116
- package/dist/things-scene/api/align.js.map +0 -1
- package/dist/things-scene/api/center-to.js +0 -50
- package/dist/things-scene/api/center-to.js.map +0 -1
- package/dist/things-scene/api/change.js +0 -27
- package/dist/things-scene/api/change.js.map +0 -1
- package/dist/things-scene/api/clipboard.js +0 -45
- package/dist/things-scene/api/clipboard.js.map +0 -1
- package/dist/things-scene/api/distribute.js +0 -57
- package/dist/things-scene/api/distribute.js.map +0 -1
- package/dist/things-scene/api/duplicate.js +0 -47
- package/dist/things-scene/api/duplicate.js.map +0 -1
- package/dist/things-scene/api/fullscreen.js +0 -26
- package/dist/things-scene/api/fullscreen.js.map +0 -1
- package/dist/things-scene/api/group.js +0 -91
- package/dist/things-scene/api/group.js.map +0 -1
- package/dist/things-scene/api/ids.js +0 -28
- package/dist/things-scene/api/ids.js.map +0 -1
- package/dist/things-scene/api/index.js +0 -192
- package/dist/things-scene/api/index.js.map +0 -1
- package/dist/things-scene/api/listener.js +0 -69
- package/dist/things-scene/api/listener.js.map +0 -1
- package/dist/things-scene/api/paste-start.js +0 -27
- package/dist/things-scene/api/paste-start.js.map +0 -1
- package/dist/things-scene/api/place.js +0 -98
- package/dist/things-scene/api/place.js.map +0 -1
- package/dist/things-scene/api/remove.js +0 -57
- package/dist/things-scene/api/remove.js.map +0 -1
- package/dist/things-scene/api/symmetry.js +0 -47
- package/dist/things-scene/api/symmetry.js.map +0 -1
- package/dist/things-scene/api/to-data-url.js +0 -76
- package/dist/things-scene/api/to-data-url.js.map +0 -1
- package/dist/things-scene/api/zorder.js +0 -68
- package/dist/things-scene/api/zorder.js.map +0 -1
- package/dist/things-scene/application-context.js +0 -168
- package/dist/things-scene/application-context.js.map +0 -1
- package/dist/things-scene/config.js +0 -18
- package/dist/things-scene/config.js.map +0 -1
- package/dist/things-scene/create.js +0 -67
- package/dist/things-scene/create.js.map +0 -1
- package/dist/things-scene/fps.js +0 -26
- package/dist/things-scene/fps.js.map +0 -1
- package/dist/things-scene/index.js +0 -152
- package/dist/things-scene/index.js.map +0 -1
- package/dist/things-scene/polyfill.js +0 -111
- package/dist/things-scene/polyfill.js.map +0 -1
- package/dist/things-scene/scene.js +0 -442
- package/dist/things-scene/scene.js.map +0 -1
- package/dist/things-scene/version.js +0 -12
- package/dist/things-scene/version.js.map +0 -1
- package/rollup.config.js +0 -67
- package/schema.graphql +0 -4606
- package/tsconfig.json +0 -31
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"distribute.js","names":["_commandChange","_interopRequireDefault","require","e","__esModule","default","VERTICAL","HORIZONTAL","DISTRIBUTE_COMMANDS","_distribute","type","selected","order","filter","c","stuck","slice","sort","a","b","ca","center","cb","y","x","length_sum","reduce","sum","bounds","height","width","first_bounds","last_bounds","length","bounds_length","top","left","space","offset","i","component","distribute","hasSameParentForAllSelected","indexOf","commander","app","CommandChange","around"],"sources":["../../../src/things-scene/api/distribute.js"],"sourcesContent":["/*\n * Copyright © HatioLab Inc. All rights reserved.\n */\n\nimport CommandChange from '../../command/command-change.js'\n\nconst VERTICAL = 'VERTICAL'\nconst HORIZONTAL = 'HORIZONTAL'\n\nconst DISTRIBUTE_COMMANDS = [VERTICAL, HORIZONTAL]\n\nfunction _distribute(type, selected) {\n var order = selected.filter(c => !c.stuck).slice(0)\n\n order.sort(function (a, b) {\n let ca = a.center\n let cb = b.center\n return type === VERTICAL ? ca.y - cb.y : ca.x - cb.x\n })\n\n var length_sum = order.reduce((sum, c) => {\n return sum + (type === VERTICAL ? c.bounds.height : c.bounds.width)\n }, 0)\n var first_bounds = order[0].bounds\n var last_bounds = order[order.length - 1].bounds\n\n var bounds_length =\n type === VERTICAL\n ? last_bounds.top + last_bounds.height - first_bounds.top\n : last_bounds.left + last_bounds.width - first_bounds.left\n\n var space = (bounds_length - length_sum) / (order.length - 1)\n\n var offset = type === VERTICAL ? first_bounds.top + first_bounds.height : first_bounds.left + first_bounds.width\n\n for (let i = 1; i < order.length - 1; i++) {\n let component = order[i]\n let bounds = component.bounds\n\n offset += space\n\n if (type === VERTICAL) {\n bounds.top = offset\n offset += bounds.height\n } else {\n bounds.left = offset\n offset += bounds.width\n }\n\n component.bounds = bounds\n }\n}\n\n/* this should be root-container */\nexport default function distribute(type) {\n if (!this.hasSameParentForAllSelected || DISTRIBUTE_COMMANDS.indexOf(type) == -1) return\n\n var selected = this.selected\n if (selected.length <= 1) return\n\n var commander = this.app.commander\n\n CommandChange.around(commander, function () {\n // 선택된 컴포넌트들을 움직인다.\n _distribute(type, selected)\n })\n}\n"],"mappings":";;;;;;AAIA,IAAAA,cAAA,GAAAC,sBAAA,CAAAC,OAAA;AAA2D,SAAAD,uBAAAE,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAJ3D;AACA;AACA;;AAIA,MAAMG,QAAQ,GAAG,UAAU;AAC3B,MAAMC,UAAU,GAAG,YAAY;AAE/B,MAAMC,mBAAmB,GAAG,CAACF,QAAQ,EAAEC,UAAU,CAAC;AAElD,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AAY,CAACI,GAAG,GAAGJ,YAAY,CAACF,MAAM,GAAGE,YAAY,CAACK,IAAI,GAAGL,YAAY,CAACD,KAAK;EAEhH,KAAK,IAAIS,CAAC,GAAG,CAAC,EAAEA,CAAC,GAAG3B,KAAK,CAACqB,MAAM,GAAG,CAAC,EAAEM,CAAC,EAAE,EAAE;IACzC,IAAIC,SAAS,GAAG5B,KAAK,CAAC2B,CAAC,CAAC;IACxB,IAAIX,MAAM,GAAGY,SAAS,CAACZ,MAAM;IAE7BU,MAAM,IAAID,KAAK;IAEf,IAAI3B,IAAI,KAAKJ,QAAQ,EAAE;MACrBsB,MAAM,CAACO,GAAG,GAAGG,MAAM;MACnBA,MAAM,IAAIV,MAAM,CAACC,MAAM;IACzB,CAAC,MAAM;MACLD,MAAM,CAACQ,IAAI,GAAGE,MAAM;MACpBA,MAAM,IAAIV,MAAM,CAACE,KAAK;IACxB;IAEAU,SAAS,CAACZ,MAAM,GAAGA,MAAM;EAC3B;AACF;;AAEA;AACe,SAASa,UAAUA,CAAC/B,IAAI,EAAE;EACvC,IAAI,CAAC,IAAI,CAACgC,2BAA2B,IAAIlC,mBAAmB,CAACmC,OAAO,CAACjC,IAAI,CAAC,IAAI,CAAC,CAAC,EAAE;EAElF,IAAIC,QAAQ,GAAG,IAAI,CAACA,QAAQ;EAC5B,IAAIA,QAAQ,CAACsB,MAAM,IAAI,CAAC,EAAE;EAE1B,IAAIW,SAAS,GAAG,IAAI,CAACC,GAAG,CAACD,SAAS;EAElCE,sBAAa,CAACC,MAAM,CAACH,SAAS,EAAE,YAAY;IAC1C;IACAnC,WAAW,CAACC,IAAI,EAAEC,QAAQ,CAAC;EAC7B,CAAC,CAAC;AACJ","ignoreList":[]}
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.default = duplicate;
|
|
7
|
-
var _commandMigrate = _interopRequireDefault(require("../../command/command-migrate.js"));
|
|
8
|
-
var Model = _interopRequireWildcard(require("../../model/index.js"));
|
|
9
|
-
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
10
|
-
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
11
|
-
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
12
|
-
/*
|
|
13
|
-
* Copyright © HatioLab Inc. All rights reserved.
|
|
14
|
-
*/
|
|
15
|
-
|
|
16
|
-
/* this should be root-container */
|
|
17
|
-
function duplicate() {
|
|
18
|
-
var changes = [];
|
|
19
|
-
var replaceRefidMap = new Map();
|
|
20
|
-
this.selected = this.selected.filter(component => !component.isRootModel()).map(component => {
|
|
21
|
-
let clone = Model.duplicate(component, refid => {
|
|
22
|
-
const newRefid = this.getNewRefid();
|
|
23
|
-
if (typeof refid !== 'undefined') {
|
|
24
|
-
replaceRefidMap.set(refid, newRefid);
|
|
25
|
-
}
|
|
26
|
-
return newRefid;
|
|
27
|
-
});
|
|
28
|
-
clone.move({
|
|
29
|
-
x: 20,
|
|
30
|
-
y: 20
|
|
31
|
-
}, false /* relatively - leave relations among components */);
|
|
32
|
-
changes.push({
|
|
33
|
-
component: clone,
|
|
34
|
-
to_container: component.parent
|
|
35
|
-
});
|
|
36
|
-
return clone;
|
|
37
|
-
}).map(component => {
|
|
38
|
-
component.replaceRefids(replaceRefidMap);
|
|
39
|
-
return component;
|
|
40
|
-
});
|
|
41
|
-
if (changes.length == 0) return;
|
|
42
|
-
var command = new _commandMigrate.default({
|
|
43
|
-
changes
|
|
44
|
-
});
|
|
45
|
-
this.app.commander.execute(command);
|
|
46
|
-
}
|
|
47
|
-
//# sourceMappingURL=duplicate.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"duplicate.js","names":["_commandMigrate","_interopRequireDefault","require","Model","_interopRequireWildcard","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","duplicate","changes","replaceRefidMap","Map","selected","filter","component","isRootModel","map","clone","refid","newRefid","getNewRefid","move","x","y","push","to_container","parent","replaceRefids","length","command","CommandMigrate","app","commander","execute"],"sources":["../../../src/things-scene/api/duplicate.js"],"sourcesContent":["/*\n * Copyright © HatioLab Inc. All rights reserved.\n */\n\nimport CommandMigrate from '../../command/command-migrate.js'\nimport * as Model from '../../model/index.js'\n\n/* this should be root-container */\nexport default function duplicate() {\n var changes = []\n\n var replaceRefidMap = new Map()\n\n this.selected = this.selected\n .filter(component => !component.isRootModel())\n .map(component => {\n let clone = Model.duplicate(component, refid => {\n const newRefid = this.getNewRefid()\n if (typeof refid !== 'undefined') {\n replaceRefidMap.set(refid, newRefid)\n }\n return newRefid\n })\n clone.move({ x: 20, y: 20 }, false /* relatively - leave relations among components */)\n\n changes.push({\n component: clone,\n to_container: component.parent\n })\n\n return clone\n })\n .map(component => {\n component.replaceRefids(replaceRefidMap)\n return component\n })\n\n if (changes.length == 0) return\n\n var command = new CommandMigrate({ changes })\n this.app.commander.execute(command)\n}\n"],"mappings":";;;;;;AAIA,IAAAA,eAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,KAAA,GAAAC,uBAAA,CAAAF,OAAA;AAA6C,SAAAG,yBAAAC,CAAA,6BAAAC,OAAA,mBAAAC,CAAA,OA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
|
-
* Copyright © HatioLab Inc. All rights reserved.
|
|
9
|
-
*/
|
|
10
|
-
function fullscreen(fit) {
|
|
11
|
-
var target_element = this.target_element;
|
|
12
|
-
var fitmode = fit || this.fitMode;
|
|
13
|
-
var self = this;
|
|
14
|
-
function _fullscreen_callback(e) {
|
|
15
|
-
// TODO 1초 동안 container의 크기변화를 계속 지켜보면서, fit을 실행하는 로직으로 개선.
|
|
16
|
-
self.fit(fitmode);
|
|
17
|
-
if (!document.fullscreen && !document.mozFullScreen && !document.webkitIsFullScreen && !document.msFullscreenElement) {
|
|
18
|
-
;
|
|
19
|
-
['fullscreenchange', 'mozfullscreenchange', 'webkitfullscreenchange', 'MSFullscreenChange'].forEach(event => document.removeEventListener(event, _fullscreen_callback));
|
|
20
|
-
}
|
|
21
|
-
}
|
|
22
|
-
;
|
|
23
|
-
['fullscreenchange', 'mozfullscreenchange', 'webkitfullscreenchange', 'MSFullscreenChange'].forEach(event => document.addEventListener(event, _fullscreen_callback));
|
|
24
|
-
if (target_element.requestFullScreen) target_element.requestFullScreen();else if (target_element.webkitRequestFullScreen) target_element.webkitRequestFullScreen();else if (target_element.mozRequestFullScreen) target_element.mozRequestFullScreen();else if (target_element.msRequestFullscreen) target_element.msRequestFullscreen();
|
|
25
|
-
}
|
|
26
|
-
//# sourceMappingURL=fullscreen.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"fullscreen.js","names":["fullscreen","fit","target_element","fitmode","fitMode","self","_fullscreen_callback","e","document","mozFullScreen","webkitIsFullScreen","msFullscreenElement","forEach","event","removeEventListener","addEventListener","requestFullScreen","webkitRequestFullScreen","mozRequestFullScreen","msRequestFullscreen"],"sources":["../../../src/things-scene/api/fullscreen.js"],"sourcesContent":["/*\n * Copyright © HatioLab Inc. All rights reserved.\n */\nexport default function fullscreen(fit) {\n var target_element = this.target_element\n var fitmode = fit || this.fitMode\n var self = this\n\n function _fullscreen_callback(e) {\n // TODO 1초 동안 container의 크기변화를 계속 지켜보면서, fit을 실행하는 로직으로 개선.\n self.fit(fitmode)\n\n if (\n !document.fullscreen &&\n !document.mozFullScreen &&\n !document.webkitIsFullScreen &&\n !document.msFullscreenElement\n ) {\n ;['fullscreenchange', 'mozfullscreenchange', 'webkitfullscreenchange', 'MSFullscreenChange'].forEach(event =>\n document.removeEventListener(event, _fullscreen_callback)\n )\n }\n }\n\n ;['fullscreenchange', 'mozfullscreenchange', 'webkitfullscreenchange', 'MSFullscreenChange'].forEach(event =>\n document.addEventListener(event, _fullscreen_callback)\n )\n\n if (target_element.requestFullScreen) target_element.requestFullScreen()\n else if (target_element.webkitRequestFullScreen) target_element.webkitRequestFullScreen()\n else if (target_element.mozRequestFullScreen) target_element.mozRequestFullScreen()\n else if (target_element.msRequestFullscreen) target_element.msRequestFullscreen()\n}\n"],"mappings":";;;;;;AAAA;AACA;AACA;AACe,SAASA,UAAUA,CAACC,GAAG,EAAE;EACtC,IAAIC,cAAc,GAAG,IAAI,CAACA,cAAc;EACxC,IAAIC,OAAO,GAAGF,GAAG,IAAI,IAAI,CAACG,OAAO;EACjC,IAAIC,IAAI,GAAG,IAAI;EAEf,SAASC,oBAAoBA,CAACC,CAAC,EAAE;IAC/B;IACAF,IAAI,CAACJ,GAAG,CAACE,OAAO,CAAC;IAEjB,IACE,CAACK,QAAQ,CAACR,UAAU,IACpB,CAACQ,QAAQ,CAACC,aAAa,IACvB,CAACD,QAAQ,CAACE,kBAAkB,IAC5B,CAACF,QAAQ,CAACG,mBAAmB,EAC7B;MACA;MAAC,CAAC,kBAAkB,EAAE,qBAAqB,EAAE,wBAAwB,EAAE,oBAAoB,CAAC,CAACC,OAAO,CAACC,KAAK,IACxGL,QAAQ,CAACM,mBAAmB,CAACD,KAAK,EAAEP,oBAAoB,CAC1D,CAAC;IACH;EACF;EAEA;EAAC,CAAC,kBAAkB,EAAE,qBAAqB,EAAE,wBAAwB,EAAE,oBAAoB,CAAC,CAACM,OAAO,CAACC,KAAK,IACxGL,QAAQ,CAACO,gBAAgB,CAACF,KAAK,EAAEP,oBAAoB,CACvD,CAAC;EAED,IAAIJ,cAAc,CAACc,iBAAiB,EAAEd,cAAc,CAACc,iBAAiB,CAAC,CAAC,MACnE,IAAId,cAAc,CAACe,uBAAuB,EAAEf,cAAc,CAACe,uBAAuB,CAAC,CAAC,MACpF,IAAIf,cAAc,CAACgB,oBAAoB,EAAEhB,cAAc,CAACgB,oBAAoB,CAAC,CAAC,MAC9E,IAAIhB,cAAc,CAACiB,mBAAmB,EAAEjB,cAAc,CAACiB,mBAAmB,CAAC,CAAC;AACnF","ignoreList":[]}
|
|
@@ -1,91 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.group = group;
|
|
7
|
-
exports.ungroup = ungroup;
|
|
8
|
-
var _commandMigrate = _interopRequireDefault(require("../../command/command-migrate.js"));
|
|
9
|
-
var _component = _interopRequireDefault(require("../../components/component.js"));
|
|
10
|
-
var Model = _interopRequireWildcard(require("../../model/index.js"));
|
|
11
|
-
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
12
|
-
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
13
|
-
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
14
|
-
/*
|
|
15
|
-
* Copyright © HatioLab Inc. All rights reserved.
|
|
16
|
-
*/
|
|
17
|
-
|
|
18
|
-
/* this should be root-container */
|
|
19
|
-
function group() {
|
|
20
|
-
if (!this.hasSameParentForAllSelected) {
|
|
21
|
-
return;
|
|
22
|
-
}
|
|
23
|
-
var selected = this.selected.filter(c => !!c.parent && !c.stuck);
|
|
24
|
-
if (selected.length < 2) return;
|
|
25
|
-
var parent = selected[0].parent;
|
|
26
|
-
var boundsList = [];
|
|
27
|
-
var sorted = selected.sort((a, b) => {
|
|
28
|
-
return parent.components.indexOf(a) - parent.components.indexOf(b);
|
|
29
|
-
});
|
|
30
|
-
sorted.forEach(c => {
|
|
31
|
-
boundsList.push(c.bounds);
|
|
32
|
-
});
|
|
33
|
-
var bounds = _component.default.union(boundsList);
|
|
34
|
-
var left_top = selected[0].transcoordP2S(bounds.left, bounds.top);
|
|
35
|
-
left_top = selected[0].transcoordS2T(left_top.x, left_top.y);
|
|
36
|
-
var replaceRefidMap = new Map();
|
|
37
|
-
var group_component = Model.compile({
|
|
38
|
-
type: 'group',
|
|
39
|
-
left: left_top.x,
|
|
40
|
-
top: left_top.y,
|
|
41
|
-
width: bounds.width,
|
|
42
|
-
height: bounds.height
|
|
43
|
-
}, parent.app, refid => {
|
|
44
|
-
const newRef = this.getNewRefid();
|
|
45
|
-
if (typeof refid !== 'undefined') {
|
|
46
|
-
replaceRefidMap.set(refid, newRef);
|
|
47
|
-
}
|
|
48
|
-
return newRef;
|
|
49
|
-
});
|
|
50
|
-
group_component.replaceRefids(replaceRefidMap);
|
|
51
|
-
var changes = [{
|
|
52
|
-
component: group_component,
|
|
53
|
-
to_container: parent
|
|
54
|
-
}];
|
|
55
|
-
sorted.forEach(component => {
|
|
56
|
-
changes.push({
|
|
57
|
-
component: component,
|
|
58
|
-
to_container: group_component
|
|
59
|
-
});
|
|
60
|
-
});
|
|
61
|
-
this.app.commander.execute(new _commandMigrate.default({
|
|
62
|
-
changes
|
|
63
|
-
}));
|
|
64
|
-
this.selected = [group_component];
|
|
65
|
-
}
|
|
66
|
-
function ungroup() {
|
|
67
|
-
var selected = this.selected;
|
|
68
|
-
if (selected.length === 0) return;
|
|
69
|
-
var components = [];
|
|
70
|
-
var changes = [];
|
|
71
|
-
this.selected.forEach(group => {
|
|
72
|
-
if (!group.isGroup()) return;
|
|
73
|
-
var parent = group.parent;
|
|
74
|
-
group.components.forEach(component => {
|
|
75
|
-
components.push(component);
|
|
76
|
-
changes.push({
|
|
77
|
-
component: component,
|
|
78
|
-
to_container: parent
|
|
79
|
-
});
|
|
80
|
-
});
|
|
81
|
-
changes.push({
|
|
82
|
-
component: group,
|
|
83
|
-
to_container: null
|
|
84
|
-
});
|
|
85
|
-
});
|
|
86
|
-
this.app.commander.execute(new _commandMigrate.default({
|
|
87
|
-
changes
|
|
88
|
-
}));
|
|
89
|
-
this.selected = components;
|
|
90
|
-
}
|
|
91
|
-
//# sourceMappingURL=group.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"group.js","names":["_commandMigrate","_interopRequireDefault","require","_component","Model","_interopRequireWildcard","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","group","hasSameParentForAllSelected","selected","filter","c","parent","stuck","length","boundsList","sorted","sort","b","components","indexOf","forEach","push","bounds","Component","union","left_top","transcoordP2S","left","top","transcoordS2T","x","y","replaceRefidMap","Map","group_component","compile","type","width","height","app","refid","newRef","getNewRefid","replaceRefids","changes","component","to_container","commander","execute","CommandMigrate","ungroup","isGroup"],"sources":["../../../src/things-scene/api/group.js"],"sourcesContent":["/*\n * Copyright © HatioLab Inc. All rights reserved.\n */\n\nimport CommandMigrate from '../../command/command-migrate.js'\nimport Component from '../../components/component.js'\nimport * as Model from '../../model/index.js'\n\n/* this should be root-container */\nexport function group() {\n if (!this.hasSameParentForAllSelected) {\n return\n }\n\n var selected = this.selected.filter(c => !!c.parent && !c.stuck)\n\n if (selected.length < 2) return\n\n var parent = selected[0].parent\n var boundsList = []\n\n var sorted = selected.sort((a, b) => {\n return parent.components.indexOf(a) - parent.components.indexOf(b)\n })\n\n sorted.forEach(c => {\n boundsList.push(c.bounds)\n })\n\n var bounds = Component.union(boundsList)\n var left_top = selected[0].transcoordP2S(bounds.left, bounds.top)\n left_top = selected[0].transcoordS2T(left_top.x, left_top.y)\n\n var replaceRefidMap = new Map()\n\n var group_component = Model.compile(\n {\n type: 'group',\n left: left_top.x,\n top: left_top.y,\n width: bounds.width,\n height: bounds.height\n },\n parent.app,\n refid => {\n const newRef = this.getNewRefid()\n if (typeof refid !== 'undefined') {\n replaceRefidMap.set(refid, newRef)\n }\n return newRef\n }\n )\n\n group_component.replaceRefids(replaceRefidMap)\n\n var changes = [\n {\n component: group_component,\n to_container: parent\n }\n ]\n\n sorted.forEach(component => {\n changes.push({\n component: component,\n to_container: group_component\n })\n })\n\n this.app.commander.execute(new CommandMigrate({ changes }))\n\n this.selected = [group_component]\n}\n\nexport function ungroup() {\n var selected = this.selected\n\n if (selected.length === 0) return\n\n var components = []\n var changes = []\n\n this.selected.forEach(group => {\n if (!group.isGroup()) return\n\n var parent = group.parent\n\n group.components.forEach(component => {\n components.push(component)\n\n changes.push({\n component: component,\n to_container: parent\n })\n })\n\n changes.push({\n component: group,\n to_container: null\n })\n })\n\n this.app.commander.execute(new CommandMigrate({ changes }))\n\n this.selected = components\n}\n"],"mappings":";;;;;;;AAIA,IAAAA,eAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,UAAA,GAAAF,sBAAA,CAAAC,OAAA;AACA,IAAAE,KAAA,GAAAC,uBAAA,CAAAH,OAAA;AAA6C,SAAAI,yBAAAC,CAAA,6BAAAC,OAAA,mBAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,CAAAC,CAAA,WAAAA,CAAA,GAAAG,CAAA,GAAAD,CAAA,KAAAF,CAAA;AAAA,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BwC,YAAY,EAAE;IAChB,CAAC,CAAC;EACJ,CAAC,CAAC;EAEF,IAAI,CAACP,GAAG,CAACQ,SAAS,CAACC,OAAO,CAAC,IAAIC,uBAAc,CAAC;IAAEL;EAAQ,CAAC,CAAC,CAAC;EAE3D,IAAI,CAACpC,QAAQ,GAAGU,UAAU;AAC5B","ignoreList":[]}
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.getIds = getIds;
|
|
7
|
-
/*
|
|
8
|
-
* Copyright © HatioLab Inc. All rights reserved.
|
|
9
|
-
*/
|
|
10
|
-
|
|
11
|
-
/* this should be root-container */
|
|
12
|
-
function getIds() {
|
|
13
|
-
return Object.values(this.indexMap).map(components => {
|
|
14
|
-
return components.map(component => {
|
|
15
|
-
let {
|
|
16
|
-
id,
|
|
17
|
-
data
|
|
18
|
-
} = component.model;
|
|
19
|
-
return {
|
|
20
|
-
key: id,
|
|
21
|
-
value: data
|
|
22
|
-
};
|
|
23
|
-
});
|
|
24
|
-
}).flat().sort((c1, c2) => {
|
|
25
|
-
return c1.key > c2.key ? 1 : -1;
|
|
26
|
-
});
|
|
27
|
-
}
|
|
28
|
-
//# sourceMappingURL=ids.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ids.js","names":["getIds","Object","values","indexMap","map","components","component","id","data","model","key","value","flat","sort","c1","c2"],"sources":["../../../src/things-scene/api/ids.js"],"sourcesContent":["/*\n * Copyright © HatioLab Inc. All rights reserved.\n */\n\n/* this should be root-container */\nexport function getIds() {\n return Object.values(this.indexMap)\n .map(components => {\n return components.map(component => {\n let { id, data } = component.model\n\n return {\n key: id,\n value: data\n }\n })\n })\n .flat()\n .sort((c1, c2) => {\n return c1.key > c2.key ? 1 : -1\n })\n}\n"],"mappings":";;;;;;AAAA;AACA;AACA;;AAEA;AACO,SAASA,MAAMA,CAAA,EAAG;EACvB,OAAOC,MAAM,CAACC,MAAM,CAAC,IAAI,CAACC,QAAQ,CAAC,CAChCC,GAAG,CAACC,UAAU,IAAI;IACjB,OAAOA,UAAU,CAACD,GAAG,CAACE,SAAS,IAAI;MACjC,IAAI;QAAEC,EAAE;QAAEC;MAAK,CAAC,GAAGF,SAAS,CAACG,KAAK;MAElC,OAAO;QACLC,GAAG,EAAEH,EAAE;QACPI,KAAK,EAAEH;MACT,CAAC;IACH,CAAC,CAAC;EACJ,CAAC,CAAC,CACDI,IAAI,CAAC,CAAC,CACNC,IAAI,CAAC,CAACC,EAAE,EAAEC,EAAE,KAAK;IAChB,OAAOD,EAAE,CAACJ,GAAG,GAAGK,EAAE,CAACL,GAAG,GAAG,CAAC,GAAG,CAAC,CAAC;EACjC,CAAC,CAAC;AACN","ignoreList":[]}
|
|
@@ -1,192 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
Object.defineProperty(exports, "add", {
|
|
7
|
-
enumerable: true,
|
|
8
|
-
get: function () {
|
|
9
|
-
return _add.default;
|
|
10
|
-
}
|
|
11
|
-
});
|
|
12
|
-
Object.defineProperty(exports, "align", {
|
|
13
|
-
enumerable: true,
|
|
14
|
-
get: function () {
|
|
15
|
-
return _align.default;
|
|
16
|
-
}
|
|
17
|
-
});
|
|
18
|
-
Object.defineProperty(exports, "change", {
|
|
19
|
-
enumerable: true,
|
|
20
|
-
get: function () {
|
|
21
|
-
return _change.change;
|
|
22
|
-
}
|
|
23
|
-
});
|
|
24
|
-
Object.defineProperty(exports, "copy", {
|
|
25
|
-
enumerable: true,
|
|
26
|
-
get: function () {
|
|
27
|
-
return _clipboard.copy;
|
|
28
|
-
}
|
|
29
|
-
});
|
|
30
|
-
Object.defineProperty(exports, "cut", {
|
|
31
|
-
enumerable: true,
|
|
32
|
-
get: function () {
|
|
33
|
-
return _clipboard.cut;
|
|
34
|
-
}
|
|
35
|
-
});
|
|
36
|
-
Object.defineProperty(exports, "distribute", {
|
|
37
|
-
enumerable: true,
|
|
38
|
-
get: function () {
|
|
39
|
-
return _distribute.default;
|
|
40
|
-
}
|
|
41
|
-
});
|
|
42
|
-
Object.defineProperty(exports, "duplicate", {
|
|
43
|
-
enumerable: true,
|
|
44
|
-
get: function () {
|
|
45
|
-
return _duplicate.default;
|
|
46
|
-
}
|
|
47
|
-
});
|
|
48
|
-
Object.defineProperty(exports, "fullscreen", {
|
|
49
|
-
enumerable: true,
|
|
50
|
-
get: function () {
|
|
51
|
-
return _fullscreen.default;
|
|
52
|
-
}
|
|
53
|
-
});
|
|
54
|
-
Object.defineProperty(exports, "getIds", {
|
|
55
|
-
enumerable: true,
|
|
56
|
-
get: function () {
|
|
57
|
-
return _ids.getIds;
|
|
58
|
-
}
|
|
59
|
-
});
|
|
60
|
-
Object.defineProperty(exports, "group", {
|
|
61
|
-
enumerable: true,
|
|
62
|
-
get: function () {
|
|
63
|
-
return _group.group;
|
|
64
|
-
}
|
|
65
|
-
});
|
|
66
|
-
Object.defineProperty(exports, "move", {
|
|
67
|
-
enumerable: true,
|
|
68
|
-
get: function () {
|
|
69
|
-
return _zorder.move;
|
|
70
|
-
}
|
|
71
|
-
});
|
|
72
|
-
Object.defineProperty(exports, "off", {
|
|
73
|
-
enumerable: true,
|
|
74
|
-
get: function () {
|
|
75
|
-
return _listener.off;
|
|
76
|
-
}
|
|
77
|
-
});
|
|
78
|
-
Object.defineProperty(exports, "on", {
|
|
79
|
-
enumerable: true,
|
|
80
|
-
get: function () {
|
|
81
|
-
return _listener.on;
|
|
82
|
-
}
|
|
83
|
-
});
|
|
84
|
-
Object.defineProperty(exports, "once", {
|
|
85
|
-
enumerable: true,
|
|
86
|
-
get: function () {
|
|
87
|
-
return _listener.once;
|
|
88
|
-
}
|
|
89
|
-
});
|
|
90
|
-
Object.defineProperty(exports, "paste", {
|
|
91
|
-
enumerable: true,
|
|
92
|
-
get: function () {
|
|
93
|
-
return _clipboard.paste;
|
|
94
|
-
}
|
|
95
|
-
});
|
|
96
|
-
Object.defineProperty(exports, "place", {
|
|
97
|
-
enumerable: true,
|
|
98
|
-
get: function () {
|
|
99
|
-
return _place.default;
|
|
100
|
-
}
|
|
101
|
-
});
|
|
102
|
-
Object.defineProperty(exports, "remove", {
|
|
103
|
-
enumerable: true,
|
|
104
|
-
get: function () {
|
|
105
|
-
return _remove.default;
|
|
106
|
-
}
|
|
107
|
-
});
|
|
108
|
-
Object.defineProperty(exports, "startAddMode", {
|
|
109
|
-
enumerable: true,
|
|
110
|
-
get: function () {
|
|
111
|
-
return _addStart.startAddMode;
|
|
112
|
-
}
|
|
113
|
-
});
|
|
114
|
-
Object.defineProperty(exports, "startDatabindPasteMode", {
|
|
115
|
-
enumerable: true,
|
|
116
|
-
get: function () {
|
|
117
|
-
return _pasteStart.startDatabindPasteMode;
|
|
118
|
-
}
|
|
119
|
-
});
|
|
120
|
-
Object.defineProperty(exports, "startStylePasteMode", {
|
|
121
|
-
enumerable: true,
|
|
122
|
-
get: function () {
|
|
123
|
-
return _pasteStart.startStylePasteMode;
|
|
124
|
-
}
|
|
125
|
-
});
|
|
126
|
-
Object.defineProperty(exports, "stopDatabindPasteMode", {
|
|
127
|
-
enumerable: true,
|
|
128
|
-
get: function () {
|
|
129
|
-
return _pasteStart.stopDatabindPasteMode;
|
|
130
|
-
}
|
|
131
|
-
});
|
|
132
|
-
Object.defineProperty(exports, "stopStylePasteMode", {
|
|
133
|
-
enumerable: true,
|
|
134
|
-
get: function () {
|
|
135
|
-
return _pasteStart.stopStylePasteMode;
|
|
136
|
-
}
|
|
137
|
-
});
|
|
138
|
-
Object.defineProperty(exports, "symmetryX", {
|
|
139
|
-
enumerable: true,
|
|
140
|
-
get: function () {
|
|
141
|
-
return _symmetry.symmetryX;
|
|
142
|
-
}
|
|
143
|
-
});
|
|
144
|
-
Object.defineProperty(exports, "symmetryY", {
|
|
145
|
-
enumerable: true,
|
|
146
|
-
get: function () {
|
|
147
|
-
return _symmetry.symmetryY;
|
|
148
|
-
}
|
|
149
|
-
});
|
|
150
|
-
Object.defineProperty(exports, "toDataURL", {
|
|
151
|
-
enumerable: true,
|
|
152
|
-
get: function () {
|
|
153
|
-
return _toDataUrl.toDataURL;
|
|
154
|
-
}
|
|
155
|
-
});
|
|
156
|
-
Object.defineProperty(exports, "undoableChange", {
|
|
157
|
-
enumerable: true,
|
|
158
|
-
get: function () {
|
|
159
|
-
return _change.undoableChange;
|
|
160
|
-
}
|
|
161
|
-
});
|
|
162
|
-
Object.defineProperty(exports, "ungroup", {
|
|
163
|
-
enumerable: true,
|
|
164
|
-
get: function () {
|
|
165
|
-
return _group.ungroup;
|
|
166
|
-
}
|
|
167
|
-
});
|
|
168
|
-
Object.defineProperty(exports, "zorder", {
|
|
169
|
-
enumerable: true,
|
|
170
|
-
get: function () {
|
|
171
|
-
return _zorder.zorder;
|
|
172
|
-
}
|
|
173
|
-
});
|
|
174
|
-
var _align = _interopRequireDefault(require("./align.js"));
|
|
175
|
-
var _distribute = _interopRequireDefault(require("./distribute.js"));
|
|
176
|
-
var _zorder = require("./zorder.js");
|
|
177
|
-
var _add = _interopRequireDefault(require("./add.js"));
|
|
178
|
-
var _duplicate = _interopRequireDefault(require("./duplicate.js"));
|
|
179
|
-
var _remove = _interopRequireDefault(require("./remove.js"));
|
|
180
|
-
var _listener = require("./listener.js");
|
|
181
|
-
var _fullscreen = _interopRequireDefault(require("./fullscreen.js"));
|
|
182
|
-
var _clipboard = require("./clipboard.js");
|
|
183
|
-
var _toDataUrl = require("./to-data-url.js");
|
|
184
|
-
var _group = require("./group.js");
|
|
185
|
-
var _symmetry = require("./symmetry.js");
|
|
186
|
-
var _change = require("./change.js");
|
|
187
|
-
var _ids = require("./ids.js");
|
|
188
|
-
var _place = _interopRequireDefault(require("./place.js"));
|
|
189
|
-
var _addStart = require("./add-start.js");
|
|
190
|
-
var _pasteStart = require("./paste-start.js");
|
|
191
|
-
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
192
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["_align","_interopRequireDefault","require","_distribute","_zorder","_add","_duplicate","_remove","_listener","_fullscreen","_clipboard","_toDataUrl","_group","_symmetry","_change","_ids","_place","_addStart","_pasteStart","e","__esModule","default"],"sources":["../../../src/things-scene/api/index.js"],"sourcesContent":["/*\n * Copyright © HatioLab Inc. All rights reserved.\n */\n\nexport { default as align } from './align.js'\nexport { default as distribute } from './distribute.js'\nexport { move, zorder } from './zorder.js'\nexport { default as add } from './add.js'\nexport { default as duplicate } from './duplicate.js'\nexport { default as remove } from './remove.js'\nexport { on, once, off } from './listener.js'\nexport { default as fullscreen } from './fullscreen.js'\nexport { cut, copy, paste } from './clipboard.js'\nexport { toDataURL } from './to-data-url.js'\nexport { group, ungroup } from './group.js'\nexport { symmetryX, symmetryY } from './symmetry.js'\nexport { change, undoableChange } from './change.js'\nexport { getIds } from './ids.js'\nexport { default as place } from './place.js'\nexport { startAddMode } from './add-start.js'\nexport {\n startStylePasteMode,\n stopStylePasteMode,\n startDatabindPasteMode,\n stopDatabindPasteMode\n} from './paste-start.js'\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAIA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,WAAA,GAAAF,sBAAA,CAAAC,OAAA;AACA,IAAAE,OAAA,GAAAF,OAAA;AACA,IAAAG,IAAA,GAAAJ,sBAAA,CAAAC,OAAA;AACA,IAAAI,UAAA,GAAAL,sBAAA,CAAAC,OAAA;AACA,IAAAK,OAAA,GAAAN,sBAAA,CAAAC,OAAA;AACA,IAAAM,SAAA,GAAAN,OAAA;AACA,IAAAO,WAAA,GAAAR,sBAAA,CAAAC,OAAA;AACA,IAAAQ,UAAA,GAAAR,OAAA;AACA,IAAAS,UAAA,GAAAT,OAAA;AACA,IAAAU,MAAA,GAAAV,OAAA;AACA,IAAAW,SAAA,GAAAX,OAAA;AACA,IAAAY,OAAA,GAAAZ,OAAA;AACA,IAAAa,IAAA,GAAAb,OAAA;AACA,IAAAc,MAAA,GAAAf,sBAAA,CAAAC,OAAA;AACA,IAAAe,SAAA,GAAAf,OAAA;AACA,IAAAgB,WAAA,GAAAhB,OAAA;AAKyB,SAAAD,uBAAAkB,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA","ignoreList":[]}
|
|
@@ -1,69 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.off = off;
|
|
7
|
-
exports.on = on;
|
|
8
|
-
exports.once = once;
|
|
9
|
-
/*
|
|
10
|
-
* Copyright © HatioLab Inc. All rights reserved.
|
|
11
|
-
*/
|
|
12
|
-
|
|
13
|
-
/* this should be root-container */
|
|
14
|
-
|
|
15
|
-
function on(event, listener, context) {
|
|
16
|
-
switch (event) {
|
|
17
|
-
case 'execute':
|
|
18
|
-
case 'redo':
|
|
19
|
-
case 'undo':
|
|
20
|
-
case 'command-reset':
|
|
21
|
-
this.app?.commander.on(event, listener, context);
|
|
22
|
-
break;
|
|
23
|
-
case 'mode':
|
|
24
|
-
this.app?.on(event, listener, context);
|
|
25
|
-
break;
|
|
26
|
-
case 'selected':
|
|
27
|
-
this.on(event, listener, context);
|
|
28
|
-
break;
|
|
29
|
-
default:
|
|
30
|
-
this.on(event, listener, context);
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
function once(event, listener, context) {
|
|
34
|
-
switch (event) {
|
|
35
|
-
case 'execute':
|
|
36
|
-
case 'redo':
|
|
37
|
-
case 'undo':
|
|
38
|
-
case 'command-reset':
|
|
39
|
-
this.app?.commander.once(event, listener, context);
|
|
40
|
-
break;
|
|
41
|
-
case 'mode':
|
|
42
|
-
this.app.once(event, listener, context);
|
|
43
|
-
break;
|
|
44
|
-
case 'selected':
|
|
45
|
-
this.once(event, listener, context);
|
|
46
|
-
break;
|
|
47
|
-
default:
|
|
48
|
-
this.once(event, listener, context);
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
function off(event, listener, context) {
|
|
52
|
-
switch (event) {
|
|
53
|
-
case 'execute':
|
|
54
|
-
case 'redo':
|
|
55
|
-
case 'undo':
|
|
56
|
-
case 'command-reset':
|
|
57
|
-
this.app?.commander.off(event, listener, context);
|
|
58
|
-
break;
|
|
59
|
-
case 'mode':
|
|
60
|
-
this.app?.off(event, listener, context);
|
|
61
|
-
break;
|
|
62
|
-
case 'selected':
|
|
63
|
-
this.off(event, listener, context);
|
|
64
|
-
break;
|
|
65
|
-
default:
|
|
66
|
-
this.off(event, listener, context);
|
|
67
|
-
}
|
|
68
|
-
}
|
|
69
|
-
//# sourceMappingURL=listener.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"listener.js","names":["on","event","listener","context","app","commander","once","off"],"sources":["../../../src/things-scene/api/listener.js"],"sourcesContent":["/*\n * Copyright © HatioLab Inc. All rights reserved.\n */\n\n/* this should be root-container */\n\nexport function on(event, listener, context) {\n switch (event) {\n case 'execute':\n case 'redo':\n case 'undo':\n case 'command-reset':\n this.app?.commander.on(event, listener, context)\n break\n\n case 'mode':\n this.app?.on(event, listener, context)\n break\n\n case 'selected':\n this.on(event, listener, context)\n break\n\n default:\n this.on(event, listener, context)\n }\n}\n\nexport function once(event, listener, context) {\n switch (event) {\n case 'execute':\n case 'redo':\n case 'undo':\n case 'command-reset':\n this.app?.commander.once(event, listener, context)\n break\n\n case 'mode':\n this.app.once(event, listener, context)\n break\n\n case 'selected':\n this.once(event, listener, context)\n break\n\n default:\n this.once(event, listener, context)\n }\n}\n\nexport function off(event, listener, context) {\n switch (event) {\n case 'execute':\n case 'redo':\n case 'undo':\n case 'command-reset':\n this.app?.commander.off(event, listener, context)\n break\n\n case 'mode':\n this.app?.off(event, listener, context)\n break\n\n case 'selected':\n this.off(event, listener, context)\n break\n\n default:\n this.off(event, listener, context)\n }\n}\n"],"mappings":";;;;;;;;AAAA;AACA;AACA;;AAEA;;AAEO,SAASA,EAAEA,CAACC,KAAK,EAAEC,QAAQ,EAAEC,OAAO,EAAE;EAC3C,QAAQF,KAAK;IACX,KAAK,SAAS;IACd,KAAK,MAAM;IACX,KAAK,MAAM;IACX,KAAK,eAAe;MAClB,IAAI,CAACG,GAAG,EAAEC,SAAS,CAACL,EAAE,CAACC,KAAK,EAAEC,QAAQ,EAAEC,OAAO,CAAC;MAChD;IAEF,KAAK,MAAM;MACT,IAAI,CAACC,GAAG,EAAEJ,EAAE,CAACC,KAAK,EAAEC,QAAQ,EAAEC,OAAO,CAAC;MACtC;IAEF,KAAK,UAAU;MACb,IAAI,CAACH,EAAE,CAACC,KAAK,EAAEC,QAAQ,EAAEC,OAAO,CAAC;MACjC;IAEF;MACE,IAAI,CAACH,EAAE,CAACC,KAAK,EAAEC,QAAQ,EAAEC,OAAO,CAAC;EACrC;AACF;AAEO,SAASG,IAAIA,CAACL,KAAK,EAAEC,QAAQ,EAAEC,OAAO,EAAE;EAC7C,QAAQF,KAAK;IACX,KAAK,SAAS;IACd,KAAK,MAAM;IACX,KAAK,MAAM;IACX,KAAK,eAAe;MAClB,IAAI,CAACG,GAAG,EAAEC,SAAS,CAACC,IAAI,CAACL,KAAK,EAAEC,QAAQ,EAAEC,OAAO,CAAC;MAClD;IAEF,KAAK,MAAM;MACT,IAAI,CAACC,GAAG,CAACE,IAAI,CAACL,KAAK,EAAEC,QAAQ,EAAEC,OAAO,CAAC;MACvC;IAEF,KAAK,UAAU;MACb,IAAI,CAACG,IAAI,CAACL,KAAK,EAAEC,QAAQ,EAAEC,OAAO,CAAC;MACnC;IAEF;MACE,IAAI,CAACG,IAAI,CAACL,KAAK,EAAEC,QAAQ,EAAEC,OAAO,CAAC;EACvC;AACF;AAEO,SAASI,GAAGA,CAACN,KAAK,EAAEC,QAAQ,EAAEC,OAAO,EAAE;EAC5C,QAAQF,KAAK;IACX,KAAK,SAAS;IACd,KAAK,MAAM;IACX,KAAK,MAAM;IACX,KAAK,eAAe;MAClB,IAAI,CAACG,GAAG,EAAEC,SAAS,CAACE,GAAG,CAACN,KAAK,EAAEC,QAAQ,EAAEC,OAAO,CAAC;MACjD;IAEF,KAAK,MAAM;MACT,IAAI,CAACC,GAAG,EAAEG,GAAG,CAACN,KAAK,EAAEC,QAAQ,EAAEC,OAAO,CAAC;MACvC;IAEF,KAAK,UAAU;MACb,IAAI,CAACI,GAAG,CAACN,KAAK,EAAEC,QAAQ,EAAEC,OAAO,CAAC;MAClC;IAEF;MACE,IAAI,CAACI,GAAG,CAACN,KAAK,EAAEC,QAAQ,EAAEC,OAAO,CAAC;EACtC;AACF","ignoreList":[]}
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.startDatabindPasteMode = startDatabindPasteMode;
|
|
7
|
-
exports.startStylePasteMode = startStylePasteMode;
|
|
8
|
-
exports.stopDatabindPasteMode = stopDatabindPasteMode;
|
|
9
|
-
exports.stopStylePasteMode = stopStylePasteMode;
|
|
10
|
-
/*
|
|
11
|
-
* Copyright © HatioLab Inc. All rights reserved.
|
|
12
|
-
*/
|
|
13
|
-
|
|
14
|
-
/* this should be root-container */
|
|
15
|
-
function startStylePasteMode() {
|
|
16
|
-
this.trigger('stylepastestart');
|
|
17
|
-
}
|
|
18
|
-
function stopStylePasteMode() {
|
|
19
|
-
this.trigger('stylepastestop');
|
|
20
|
-
}
|
|
21
|
-
function startDatabindPasteMode() {
|
|
22
|
-
this.trigger('databindpastestart');
|
|
23
|
-
}
|
|
24
|
-
function stopDatabindPasteMode() {
|
|
25
|
-
this.trigger('databindpastestop');
|
|
26
|
-
}
|
|
27
|
-
//# sourceMappingURL=paste-start.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"paste-start.js","names":["startStylePasteMode","trigger","stopStylePasteMode","startDatabindPasteMode","stopDatabindPasteMode"],"sources":["../../../src/things-scene/api/paste-start.js"],"sourcesContent":["/*\n * Copyright © HatioLab Inc. All rights reserved.\n */\n\n/* this should be root-container */\nexport function startStylePasteMode() {\n this.trigger('stylepastestart')\n}\n\nexport function stopStylePasteMode() {\n this.trigger('stylepastestop')\n}\n\nexport function startDatabindPasteMode() {\n this.trigger('databindpastestart')\n}\n\nexport function stopDatabindPasteMode() {\n this.trigger('databindpastestop')\n}\n"],"mappings":";;;;;;;;;AAAA;AACA;AACA;;AAEA;AACO,SAASA,mBAAmBA,CAAA,EAAG;EACpC,IAAI,CAACC,OAAO,CAAC,iBAAiB,CAAC;AACjC;AAEO,SAASC,kBAAkBA,CAAA,EAAG;EACnC,IAAI,CAACD,OAAO,CAAC,gBAAgB,CAAC;AAChC;AAEO,SAASE,sBAAsBA,CAAA,EAAG;EACvC,IAAI,CAACF,OAAO,CAAC,oBAAoB,CAAC;AACpC;AAEO,SAASG,qBAAqBA,CAAA,EAAG;EACtC,IAAI,CAACH,OAAO,CAAC,mBAAmB,CAAC;AACnC","ignoreList":[]}
|
|
@@ -1,98 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.default = place;
|
|
7
|
-
var _commandChange = _interopRequireDefault(require("../../command/command-change.js"));
|
|
8
|
-
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
9
|
-
/*
|
|
10
|
-
* Copyright © HatioLab Inc. All rights reserved.
|
|
11
|
-
*/
|
|
12
|
-
|
|
13
|
-
const LEFT = 'left';
|
|
14
|
-
const RIGHT = 'right';
|
|
15
|
-
const CENTER = 'center';
|
|
16
|
-
const TOP = 'top';
|
|
17
|
-
const BOTTOM = 'bottom';
|
|
18
|
-
const MIDDLE = 'middle';
|
|
19
|
-
const ALIGN_COMMANDS = [LEFT, RIGHT, CENTER, TOP, MIDDLE, BOTTOM];
|
|
20
|
-
function _place(type, selected) {
|
|
21
|
-
const parent = selected[0].parent;
|
|
22
|
-
const {
|
|
23
|
-
width,
|
|
24
|
-
height
|
|
25
|
-
} = parent.bounds;
|
|
26
|
-
switch (type) {
|
|
27
|
-
case LEFT:
|
|
28
|
-
for (let i = 0; i < selected.length; i++) {
|
|
29
|
-
let bounds = selected[i].bounds;
|
|
30
|
-
selected[i].bounds = {
|
|
31
|
-
...bounds,
|
|
32
|
-
left: 0
|
|
33
|
-
};
|
|
34
|
-
}
|
|
35
|
-
break;
|
|
36
|
-
case CENTER:
|
|
37
|
-
for (let i = 0; i < selected.length; i++) {
|
|
38
|
-
let bounds = selected[i].bounds;
|
|
39
|
-
selected[i].bounds = {
|
|
40
|
-
...bounds,
|
|
41
|
-
left: width / 2 - bounds.width / 2
|
|
42
|
-
};
|
|
43
|
-
}
|
|
44
|
-
break;
|
|
45
|
-
case RIGHT:
|
|
46
|
-
for (let i = 0; i < selected.length; i++) {
|
|
47
|
-
let bounds = selected[i].bounds;
|
|
48
|
-
selected[i].bounds = {
|
|
49
|
-
...bounds,
|
|
50
|
-
left: width - bounds.width
|
|
51
|
-
};
|
|
52
|
-
}
|
|
53
|
-
break;
|
|
54
|
-
case TOP:
|
|
55
|
-
for (let i = 0; i < selected.length; i++) {
|
|
56
|
-
let bounds = selected[i].bounds;
|
|
57
|
-
selected[i].bounds = {
|
|
58
|
-
...bounds,
|
|
59
|
-
top: 0
|
|
60
|
-
};
|
|
61
|
-
}
|
|
62
|
-
break;
|
|
63
|
-
case MIDDLE:
|
|
64
|
-
for (let i = 0; i < selected.length; i++) {
|
|
65
|
-
let bounds = selected[i].bounds;
|
|
66
|
-
selected[i].bounds = {
|
|
67
|
-
...bounds,
|
|
68
|
-
top: height / 2 - bounds.height / 2
|
|
69
|
-
};
|
|
70
|
-
}
|
|
71
|
-
break;
|
|
72
|
-
case BOTTOM:
|
|
73
|
-
for (let i = 0; i < selected.length; i++) {
|
|
74
|
-
let bounds = selected[i].bounds;
|
|
75
|
-
selected[i].bounds = {
|
|
76
|
-
...bounds,
|
|
77
|
-
top: height - bounds.height
|
|
78
|
-
};
|
|
79
|
-
}
|
|
80
|
-
break;
|
|
81
|
-
default:
|
|
82
|
-
return;
|
|
83
|
-
}
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
/* this should be root-container */
|
|
87
|
-
function place(type) {
|
|
88
|
-
if (!this.hasSameParentForAllSelected || ALIGN_COMMANDS.indexOf(type) == -1) {
|
|
89
|
-
return;
|
|
90
|
-
}
|
|
91
|
-
var selected = this.selected.filter(c => !c.stuck);
|
|
92
|
-
var commander = this.app.commander;
|
|
93
|
-
_commandChange.default.around(commander, function () {
|
|
94
|
-
// 선택된 컴포넌트들을 움직인다.
|
|
95
|
-
_place(type, selected);
|
|
96
|
-
});
|
|
97
|
-
}
|
|
98
|
-
//# sourceMappingURL=place.js.map
|