Skip to content

Commit

Permalink
feat(drag): finish drag into gameObject after or before or into gameO…
Browse files Browse the repository at this point in the history
…bject
  • Loading branch information
AmyOrz committed Jan 15, 2019
1 parent 6fe3b80 commit 35ba6ed
Show file tree
Hide file tree
Showing 409 changed files with 5,250 additions and 8,294 deletions.
Empty file modified CODEOWNERS 100644 → 100755
Empty file.
1,320 changes: 768 additions & 552 deletions dist/index.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion lib/es6_global/src/Copyright.js
Expand Up @@ -2,7 +2,7 @@


function getVersion() {
return "0.13.0";
return "0.13.1";
}

function getAuthor() {
Expand Down
9 changes: 4 additions & 5 deletions lib/es6_global/src/core/atom_component/canvas/Canvas.js
Expand Up @@ -3,12 +3,11 @@
import * as Curry from "../../../../../../node_modules/bs-platform/lib/es6/curry.js";
import * as React from "react";
import * as ReasonReact from "../../../../../../node_modules/reason-react/lib/es6_global/src/ReasonReact.js";
import * as DomHelper$WonderEditor from "../../external/DomHelper.js";
import * as DragUtils$WonderEditor from "../dragTree/utils/DragUtils.js";
import * as EventHelper$WonderEditor from "../../external/EventHelper.js";
import * as DragEventUtils$WonderEditor from "../../utils/event/DragEventUtils.js";
import * as StateEditorService$WonderEditor from "../../../service/state/editor/StateEditorService.js";
import * as SparseMapService$WonderCommonlib from "../../../../../../node_modules/wonder-commonlib/lib/es6_global/src/SparseMapService.js";
import * as WDBNodeMapAssetEditorService$WonderEditor from "../../../service/state/editor/asset/WDBNodeMapAssetEditorService.js";
import * as WDBNodeAssetEditorService$WonderEditor from "../../../service/state/editor/asset/WDBNodeAssetEditorService.js";

function handleDragEnter(_, _$1) {
return /* () */0;
Expand All @@ -20,10 +19,10 @@ function handleDragLeave() {

function handleDrop(param, $$event) {
var startId = DragUtils$WonderEditor.getDragedId($$event);
DomHelper$WonderEditor.preventDefault($$event);
EventHelper$WonderEditor.preventDefault($$event);
var match = Curry._1(param[0], /* () */0);
if (match) {
return Curry._1(param[1], SparseMapService$WonderCommonlib.unsafeGet(startId, WDBNodeMapAssetEditorService$WonderEditor.getWDBNodeMap(StateEditorService$WonderEditor.getState(/* () */0)))[/* wdbGameObject */3]);
return Curry._1(param[1], WDBNodeAssetEditorService$WonderEditor.unsafeGetNodeData(startId, StateEditorService$WonderEditor.getState(/* () */0))[/* wdbGameObject */1]);
} else {
return /* () */0;
}
Expand Down
Expand Up @@ -15,8 +15,8 @@ function buildDragEndState(state) {
}

function _renderDragableText(param, param$1, param$2) {
var handleRelationErrorFunc = param$2[2];
var handleWidgetFunc = param$2[1];
var checkNodeRelationFunc = param$2[2];
var isWidgetFunc = param$2[1];
var onSelectFunc = param$2[0];
var dragImg = param$1[2];
var widget = param$1[1];
Expand All @@ -31,22 +31,33 @@ function _renderDragableText(param, param$1, param$2) {
draggable: true,
style: param[0][/* style */0],
onDragEnd: (function (_e) {
return Curry._1(send, DragEventUtils$WonderEditor.handleDrageEnd(_e));
return Curry._1(send, DragEventUtils$WonderEditor.handleDragEnd(/* DragEnd */3, _e));
}),
onDragEnter: (function (_e) {
return Curry._1(send, DragEventUtils$WonderEditor.handleDragEnter(id, handleWidgetFunc, Curry._1(handleRelationErrorFunc, false), _e));
return Curry._1(send, DragEventUtils$WonderEditor.handleDragEnter(id, /* tuple */[
/* DragEnter */1,
/* Nothing */0
], isWidgetFunc, checkNodeRelationFunc, _e));
}),
onDragLeave: (function (_e) {
return Curry._1(send, DragEventUtils$WonderEditor.handleDragLeave(id, _e));
return Curry._1(send, DragEventUtils$WonderEditor.handleDragLeave(id, /* DragLeave */2, _e));
}),
onDragOver: (function (e) {
return DragEventUtils$WonderEditor.handleDragOver("move", e);
}),
onDragStart: (function (_e) {
return Curry._1(send, DragEventUtils$WonderEditor.handleDragStart(id, widget, dragImg, "move", _e));
return Curry._1(send, DragEventUtils$WonderEditor.handleDragStart(id, /* DragStart */4, widget, dragImg, "move", _e));
}),
onDrop: (function (_e) {
return Curry._1(send, DragEventUtils$WonderEditor.handleDrop(id, handleWidgetFunc, Curry._1(handleRelationErrorFunc, true), _e));
return Curry._1(send, DragEventUtils$WonderEditor.handleDrop(id, /* tuple */[
(function (targetId, removedId) {
return /* DragDrop */Block.__(1, [
targetId,
removedId
]);
}),
/* DragLeave */2
], isWidgetFunc, checkNodeRelationFunc, _e));
}),
onMouseDown: (function () {
return Curry._1(onSelectFunc, id);
Expand Down Expand Up @@ -78,8 +89,7 @@ function _renderContent(param, param$1, param$2) {
], /* tuple */[
param$2[0],
param$2[1],
param$2[2],
param$2[3]
param$2[2]
]));
}

Expand Down Expand Up @@ -141,7 +151,6 @@ function reducer(isShowChildren, param, action) {
}

function render(param, param$1, treeChildren, param$2) {
var handleRelationErrorFunc = param$1[2];
var isShowChildren = param[5];
return TreeNodeUtils$WonderEditor.buildNotDragableUl(treeChildren, isShowChildren, _renderContent(/* tuple */[
param$2[/* state */1],
Expand All @@ -159,12 +168,11 @@ function render(param, param$1, treeChildren, param$2) {
], /* tuple */[
param$1[0],
param$1[1],
handleRelationErrorFunc,
handleRelationErrorFunc
param$1[2]
]));
}

function make(id, name, isSelected, isActive, dragImg, widget, icon, onSelect, onDrop, isWidget, isShowChildren, isHasChildren, handleRelationError, handleToggleShowTreeChildren, treeChildren, _) {
function make(id, name, isSelected, isActive, dragImg, widget, icon, onSelect, onDrop, isWidget, isShowChildren, isHasChildren, checkNodeRelation, handleToggleShowTreeChildren, treeChildren, _) {
var partial_arg = /* tuple */[
onDrop,
handleToggleShowTreeChildren
Expand Down Expand Up @@ -193,7 +201,7 @@ function make(id, name, isSelected, isActive, dragImg, widget, icon, onSelect, o
], /* tuple */[
onSelect,
isWidget,
handleRelationError
checkNodeRelation
], treeChildren, self);
}),
/* initialState */(function () {
Expand Down

0 comments on commit 35ba6ed

Please sign in to comment.