@p4ulcristian/iris-layout 0.2.9 → 0.2.11
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/dist/iris-layout.js +60 -45
- package/dist/styles.css +172 -2
- package/package.json +1 -1
- package/dist/cljs-runtime/cljs.core.js +0 -38746
- package/dist/cljs-runtime/cljs.core.js.map +0 -1
- package/dist/cljs-runtime/cljs.pprint.js +0 -8400
- package/dist/cljs-runtime/cljs.pprint.js.map +0 -1
- package/dist/cljs-runtime/cljs.stacktrace.js +0 -561
- package/dist/cljs-runtime/cljs.stacktrace.js.map +0 -1
- package/dist/cljs-runtime/cljs_env.js +0 -1286
- package/dist/cljs-runtime/clojure.data.js +0 -295
- package/dist/cljs-runtime/clojure.data.js.map +0 -1
- package/dist/cljs-runtime/clojure.set.js +0 -382
- package/dist/cljs-runtime/clojure.set.js.map +0 -1
- package/dist/cljs-runtime/clojure.string.js +0 -480
- package/dist/cljs-runtime/clojure.string.js.map +0 -1
- package/dist/cljs-runtime/clojure.walk.js +0 -132
- package/dist/cljs-runtime/clojure.walk.js.map +0 -1
- package/dist/cljs-runtime/devtools.async.js +0 -90
- package/dist/cljs-runtime/devtools.async.js.map +0 -1
- package/dist/cljs-runtime/devtools.context.js +0 -11
- package/dist/cljs-runtime/devtools.context.js.map +0 -1
- package/dist/cljs-runtime/devtools.core.js +0 -175
- package/dist/cljs-runtime/devtools.core.js.map +0 -1
- package/dist/cljs-runtime/devtools.defaults.js +0 -20
- package/dist/cljs-runtime/devtools.defaults.js.map +0 -1
- package/dist/cljs-runtime/devtools.format.js +0 -631
- package/dist/cljs-runtime/devtools.format.js.map +0 -1
- package/dist/cljs-runtime/devtools.formatters.budgeting.js +0 -182
- package/dist/cljs-runtime/devtools.formatters.budgeting.js.map +0 -1
- package/dist/cljs-runtime/devtools.formatters.core.js +0 -220
- package/dist/cljs-runtime/devtools.formatters.core.js.map +0 -1
- package/dist/cljs-runtime/devtools.formatters.helpers.js +0 -228
- package/dist/cljs-runtime/devtools.formatters.helpers.js.map +0 -1
- package/dist/cljs-runtime/devtools.formatters.js +0 -261
- package/dist/cljs-runtime/devtools.formatters.js.map +0 -1
- package/dist/cljs-runtime/devtools.formatters.markup.js +0 -1174
- package/dist/cljs-runtime/devtools.formatters.markup.js.map +0 -1
- package/dist/cljs-runtime/devtools.formatters.printing.js +0 -313
- package/dist/cljs-runtime/devtools.formatters.printing.js.map +0 -1
- package/dist/cljs-runtime/devtools.formatters.state.js +0 -325
- package/dist/cljs-runtime/devtools.formatters.state.js.map +0 -1
- package/dist/cljs-runtime/devtools.formatters.templating.js +0 -666
- package/dist/cljs-runtime/devtools.formatters.templating.js.map +0 -1
- package/dist/cljs-runtime/devtools.hints.js +0 -193
- package/dist/cljs-runtime/devtools.hints.js.map +0 -1
- package/dist/cljs-runtime/devtools.munging.js +0 -1058
- package/dist/cljs-runtime/devtools.munging.js.map +0 -1
- package/dist/cljs-runtime/devtools.prefs.js +0 -87
- package/dist/cljs-runtime/devtools.prefs.js.map +0 -1
- package/dist/cljs-runtime/devtools.preload.js +0 -11
- package/dist/cljs-runtime/devtools.preload.js.map +0 -1
- package/dist/cljs-runtime/devtools.protocols.js +0 -98
- package/dist/cljs-runtime/devtools.protocols.js.map +0 -1
- package/dist/cljs-runtime/devtools.reporter.js +0 -81
- package/dist/cljs-runtime/devtools.reporter.js.map +0 -1
- package/dist/cljs-runtime/devtools.toolbox.js +0 -141
- package/dist/cljs-runtime/devtools.toolbox.js.map +0 -1
- package/dist/cljs-runtime/devtools.util.js +0 -517
- package/dist/cljs-runtime/devtools.util.js.map +0 -1
- package/dist/cljs-runtime/devtools.version.js +0 -9
- package/dist/cljs-runtime/devtools.version.js.map +0 -1
- package/dist/cljs-runtime/goog.array.array.js +0 -659
- package/dist/cljs-runtime/goog.array.array.js.map +0 -9
- package/dist/cljs-runtime/goog.asserts.asserts.js +0 -133
- package/dist/cljs-runtime/goog.asserts.asserts.js.map +0 -9
- package/dist/cljs-runtime/goog.asserts.dom.js +0 -90
- package/dist/cljs-runtime/goog.asserts.dom.js.map +0 -9
- package/dist/cljs-runtime/goog.async.nexttick.js +0 -93
- package/dist/cljs-runtime/goog.async.nexttick.js.map +0 -9
- package/dist/cljs-runtime/goog.base.js +0 -1261
- package/dist/cljs-runtime/goog.base.js.map +0 -9
- package/dist/cljs-runtime/goog.collections.maps.js +0 -82
- package/dist/cljs-runtime/goog.collections.maps.js.map +0 -9
- package/dist/cljs-runtime/goog.debug.entrypointregistry.js +0 -44
- package/dist/cljs-runtime/goog.debug.entrypointregistry.js.map +0 -9
- package/dist/cljs-runtime/goog.debug.error.js +0 -30
- package/dist/cljs-runtime/goog.debug.error.js.map +0 -9
- package/dist/cljs-runtime/goog.dom.asserts.js +0 -40
- package/dist/cljs-runtime/goog.dom.asserts.js.map +0 -9
- package/dist/cljs-runtime/goog.dom.browserfeature.js +0 -21
- package/dist/cljs-runtime/goog.dom.browserfeature.js.map +0 -9
- package/dist/cljs-runtime/goog.dom.dom.js +0 -1087
- package/dist/cljs-runtime/goog.dom.dom.js.map +0 -9
- package/dist/cljs-runtime/goog.dom.element.js +0 -69
- package/dist/cljs-runtime/goog.dom.element.js.map +0 -9
- package/dist/cljs-runtime/goog.dom.htmlelement.js +0 -7
- package/dist/cljs-runtime/goog.dom.htmlelement.js.map +0 -9
- package/dist/cljs-runtime/goog.dom.nodetype.js +0 -6
- package/dist/cljs-runtime/goog.dom.nodetype.js.map +0 -9
- package/dist/cljs-runtime/goog.dom.safe.js +0 -277
- package/dist/cljs-runtime/goog.dom.safe.js.map +0 -9
- package/dist/cljs-runtime/goog.dom.tagname.js +0 -147
- package/dist/cljs-runtime/goog.dom.tagname.js.map +0 -9
- package/dist/cljs-runtime/goog.dom.tags.js +0 -10
- package/dist/cljs-runtime/goog.dom.tags.js.map +0 -9
- package/dist/cljs-runtime/goog.flags.flags.js +0 -12
- package/dist/cljs-runtime/goog.flags.flags.js.map +0 -9
- package/dist/cljs-runtime/goog.fs.blob.js +0 -38
- package/dist/cljs-runtime/goog.fs.blob.js.map +0 -9
- package/dist/cljs-runtime/goog.fs.url.js +0 -37
- package/dist/cljs-runtime/goog.fs.url.js.map +0 -9
- package/dist/cljs-runtime/goog.functions.functions.js +0 -211
- package/dist/cljs-runtime/goog.functions.functions.js.map +0 -9
- package/dist/cljs-runtime/goog.html.safehtml.js +0 -321
- package/dist/cljs-runtime/goog.html.safehtml.js.map +0 -9
- package/dist/cljs-runtime/goog.html.safescript.js +0 -65
- package/dist/cljs-runtime/goog.html.safescript.js.map +0 -9
- package/dist/cljs-runtime/goog.html.safestyle.js +0 -175
- package/dist/cljs-runtime/goog.html.safestyle.js.map +0 -9
- package/dist/cljs-runtime/goog.html.safestylesheet.js +0 -99
- package/dist/cljs-runtime/goog.html.safestylesheet.js.map +0 -9
- package/dist/cljs-runtime/goog.html.safeurl.js +0 -231
- package/dist/cljs-runtime/goog.html.safeurl.js.map +0 -9
- package/dist/cljs-runtime/goog.html.trustedresourceurl.js +0 -123
- package/dist/cljs-runtime/goog.html.trustedresourceurl.js.map +0 -9
- package/dist/cljs-runtime/goog.html.trustedtypes.js +0 -16
- package/dist/cljs-runtime/goog.html.trustedtypes.js.map +0 -9
- package/dist/cljs-runtime/goog.html.uncheckedconversions.js +0 -52
- package/dist/cljs-runtime/goog.html.uncheckedconversions.js.map +0 -9
- package/dist/cljs-runtime/goog.labs.useragent.browser.js +0 -352
- package/dist/cljs-runtime/goog.labs.useragent.browser.js.map +0 -9
- package/dist/cljs-runtime/goog.labs.useragent.engine.js +0 -73
- package/dist/cljs-runtime/goog.labs.useragent.engine.js.map +0 -9
- package/dist/cljs-runtime/goog.labs.useragent.highentropy.highentropydata.js +0 -14
- package/dist/cljs-runtime/goog.labs.useragent.highentropy.highentropydata.js.map +0 -9
- package/dist/cljs-runtime/goog.labs.useragent.highentropy.highentropyvalue.js +0 -74
- package/dist/cljs-runtime/goog.labs.useragent.highentropy.highentropyvalue.js.map +0 -9
- package/dist/cljs-runtime/goog.labs.useragent.platform.js +0 -147
- package/dist/cljs-runtime/goog.labs.useragent.platform.js.map +0 -9
- package/dist/cljs-runtime/goog.labs.useragent.useragent.js +0 -21
- package/dist/cljs-runtime/goog.labs.useragent.useragent.js.map +0 -9
- package/dist/cljs-runtime/goog.labs.useragent.util.js +0 -81
- package/dist/cljs-runtime/goog.labs.useragent.util.js.map +0 -9
- package/dist/cljs-runtime/goog.math.coordinate.js +0 -97
- package/dist/cljs-runtime/goog.math.coordinate.js.map +0 -9
- package/dist/cljs-runtime/goog.math.integer.js +0 -445
- package/dist/cljs-runtime/goog.math.integer.js.map +0 -9
- package/dist/cljs-runtime/goog.math.long.js +0 -437
- package/dist/cljs-runtime/goog.math.long.js.map +0 -9
- package/dist/cljs-runtime/goog.math.math.js +0 -158
- package/dist/cljs-runtime/goog.math.math.js.map +0 -9
- package/dist/cljs-runtime/goog.math.size.js +0 -76
- package/dist/cljs-runtime/goog.math.size.js.map +0 -9
- package/dist/cljs-runtime/goog.object.object.js +0 -284
- package/dist/cljs-runtime/goog.object.object.js.map +0 -9
- package/dist/cljs-runtime/goog.reflect.reflect.js +0 -32
- package/dist/cljs-runtime/goog.reflect.reflect.js.map +0 -9
- package/dist/cljs-runtime/goog.string.const.js +0 -35
- package/dist/cljs-runtime/goog.string.const.js.map +0 -9
- package/dist/cljs-runtime/goog.string.internal.js +0 -119
- package/dist/cljs-runtime/goog.string.internal.js.map +0 -9
- package/dist/cljs-runtime/goog.string.string.js +0 -462
- package/dist/cljs-runtime/goog.string.string.js.map +0 -9
- package/dist/cljs-runtime/goog.string.stringbuffer.js +0 -32
- package/dist/cljs-runtime/goog.string.stringbuffer.js.map +0 -9
- package/dist/cljs-runtime/goog.string.typedstring.js +0 -9
- package/dist/cljs-runtime/goog.string.typedstring.js.map +0 -9
- package/dist/cljs-runtime/goog.structs.structs.js +0 -199
- package/dist/cljs-runtime/goog.structs.structs.js.map +0 -9
- package/dist/cljs-runtime/goog.uri.uri.js +0 -628
- package/dist/cljs-runtime/goog.uri.uri.js.map +0 -9
- package/dist/cljs-runtime/goog.uri.utils.js +0 -326
- package/dist/cljs-runtime/goog.uri.utils.js.map +0 -9
- package/dist/cljs-runtime/goog.useragent.useragent.js +0 -139
- package/dist/cljs-runtime/goog.useragent.useragent.js.map +0 -9
- package/dist/cljs-runtime/iris_layout.components.entity_card_group.js +0 -202
- package/dist/cljs-runtime/iris_layout.components.entity_card_group.js.map +0 -1
- package/dist/cljs-runtime/iris_layout.components.entity_tile.js +0 -327
- package/dist/cljs-runtime/iris_layout.components.entity_tile.js.map +0 -1
- package/dist/cljs-runtime/iris_layout.components.entity_tile_group.js +0 -33
- package/dist/cljs-runtime/iris_layout.components.entity_tile_group.js.map +0 -1
- package/dist/cljs-runtime/iris_layout.components.resizer.js +0 -91
- package/dist/cljs-runtime/iris_layout.components.resizer.js.map +0 -1
- package/dist/cljs-runtime/iris_layout.components.touch_drag.js +0 -385
- package/dist/cljs-runtime/iris_layout.components.touch_drag.js.map +0 -1
- package/dist/cljs-runtime/iris_layout.core.js +0 -876
- package/dist/cljs-runtime/iris_layout.core.js.map +0 -1
- package/dist/cljs-runtime/iris_layout.layout.js +0 -328
- package/dist/cljs-runtime/iris_layout.layout.js.map +0 -1
- package/dist/cljs-runtime/reagent.core.js +0 -993
- package/dist/cljs-runtime/reagent.core.js.map +0 -1
- package/dist/cljs-runtime/reagent.debug.js +0 -75
- package/dist/cljs-runtime/reagent.debug.js.map +0 -1
- package/dist/cljs-runtime/reagent.impl.batching.js +0 -270
- package/dist/cljs-runtime/reagent.impl.batching.js.map +0 -1
- package/dist/cljs-runtime/reagent.impl.component.js +0 -758
- package/dist/cljs-runtime/reagent.impl.component.js.map +0 -1
- package/dist/cljs-runtime/reagent.impl.input.js +0 -175
- package/dist/cljs-runtime/reagent.impl.input.js.map +0 -1
- package/dist/cljs-runtime/reagent.impl.protocols.js +0 -99
- package/dist/cljs-runtime/reagent.impl.protocols.js.map +0 -1
- package/dist/cljs-runtime/reagent.impl.template.js +0 -660
- package/dist/cljs-runtime/reagent.impl.template.js.map +0 -1
- package/dist/cljs-runtime/reagent.impl.util.js +0 -748
- package/dist/cljs-runtime/reagent.impl.util.js.map +0 -1
- package/dist/cljs-runtime/reagent.ratom.js +0 -1668
- package/dist/cljs-runtime/reagent.ratom.js.map +0 -1
- package/dist/cljs-runtime/shadow.esm.esm_import$react.js +0 -5
- package/dist/cljs-runtime/shadow.module.iris-layout.append.js +0 -2
- package/dist/cljs-runtime/shadow.module.iris-layout.prepend.js +0 -2
|
@@ -1,385 +0,0 @@
|
|
|
1
|
-
import "./cljs_env.js";
|
|
2
|
-
import "./cljs.core.js";
|
|
3
|
-
import "./reagent.core.js";
|
|
4
|
-
goog.provide('iris_layout.components.touch_drag');
|
|
5
|
-
iris_layout.components.touch_drag.move_threshold = (8);
|
|
6
|
-
if((typeof iris_layout !== 'undefined') && (typeof iris_layout.components !== 'undefined') && (typeof iris_layout.components.touch_drag !== 'undefined') && (typeof iris_layout.components.touch_drag.touch_state !== 'undefined')){
|
|
7
|
-
} else {
|
|
8
|
-
iris_layout.components.touch_drag.touch_state = reagent.core.atom.cljs$core$IFn$_invoke$arity$1(null);
|
|
9
|
-
}
|
|
10
|
-
if((typeof iris_layout !== 'undefined') && (typeof iris_layout.components !== 'undefined') && (typeof iris_layout.components.touch_drag !== 'undefined') && (typeof iris_layout.components.touch_drag.hover_target !== 'undefined')){
|
|
11
|
-
} else {
|
|
12
|
-
iris_layout.components.touch_drag.hover_target = reagent.core.atom.cljs$core$IFn$_invoke$arity$1(null);
|
|
13
|
-
}
|
|
14
|
-
if((typeof iris_layout !== 'undefined') && (typeof iris_layout.components !== 'undefined') && (typeof iris_layout.components.touch_drag !== 'undefined') && (typeof iris_layout.components.touch_drag.nav_edge_target !== 'undefined')){
|
|
15
|
-
} else {
|
|
16
|
-
iris_layout.components.touch_drag.nav_edge_target = reagent.core.atom.cljs$core$IFn$_invoke$arity$1(null);
|
|
17
|
-
}
|
|
18
|
-
if((typeof iris_layout !== 'undefined') && (typeof iris_layout.components !== 'undefined') && (typeof iris_layout.components.touch_drag !== 'undefined') && (typeof iris_layout.components.touch_drag.drop_result !== 'undefined')){
|
|
19
|
-
} else {
|
|
20
|
-
iris_layout.components.touch_drag.drop_result = reagent.core.atom.cljs$core$IFn$_invoke$arity$1(null);
|
|
21
|
-
}
|
|
22
|
-
if((typeof iris_layout !== 'undefined') && (typeof iris_layout.components !== 'undefined') && (typeof iris_layout.components.touch_drag !== 'undefined') && (typeof iris_layout.components.touch_drag.touch_start !== 'undefined')){
|
|
23
|
-
} else {
|
|
24
|
-
iris_layout.components.touch_drag.touch_start = cljs.core.atom.cljs$core$IFn$_invoke$arity$1(null);
|
|
25
|
-
}
|
|
26
|
-
iris_layout.components.touch_drag.dragging_QMARK_ = (function iris_layout$components$touch_drag$dragging_QMARK_(){
|
|
27
|
-
return (!((cljs.core.deref(iris_layout.components.touch_drag.touch_state) == null)));
|
|
28
|
-
});
|
|
29
|
-
iris_layout.components.touch_drag.touch_started_QMARK_ = (function iris_layout$components$touch_drag$touch_started_QMARK_(){
|
|
30
|
-
return (!((cljs.core.deref(iris_layout.components.touch_drag.touch_start) == null)));
|
|
31
|
-
});
|
|
32
|
-
iris_layout.components.touch_drag.create_ghost_BANG_ = (function iris_layout$components$touch_drag$create_ghost_BANG_(x,y){
|
|
33
|
-
var ghost = document.createElement("div");
|
|
34
|
-
(ghost.className = "iris-touch-drag-ghost");
|
|
35
|
-
|
|
36
|
-
(ghost.style.cssText = ["position:fixed;z-index:10000;pointer-events:none;","background:rgba(99,102,241,0.8);color:#fff;padding:6px 14px;","border-radius:8px;font-size:12px;font-weight:500;","box-shadow:0 4px 20px rgba(0,0,0,0.4);","left:",cljs.core.str.cljs$core$IFn$_invoke$arity$1((x - (40))),"px;","top:",cljs.core.str.cljs$core$IFn$_invoke$arity$1((y - (20))),"px;"].join(''));
|
|
37
|
-
|
|
38
|
-
document.body.appendChild(ghost);
|
|
39
|
-
|
|
40
|
-
return ghost;
|
|
41
|
-
});
|
|
42
|
-
/**
|
|
43
|
-
* Record touch start on a header. Drag activates after movement threshold.
|
|
44
|
-
*/
|
|
45
|
-
iris_layout.components.touch_drag.start_touch_BANG_ = (function iris_layout$components$touch_drag$start_touch_BANG_(tile_id,entity_id,touch_event){
|
|
46
|
-
var touch = (touch_event.changedTouches[(0)]);
|
|
47
|
-
var x = touch.clientX;
|
|
48
|
-
var y = touch.clientY;
|
|
49
|
-
return cljs.core.reset_BANG_(iris_layout.components.touch_drag.touch_start,new cljs.core.PersistentArrayMap(null, 4, [new cljs.core.Keyword(null,"start-x","start-x",-193941684),x,new cljs.core.Keyword(null,"start-y","start-y",-771244577),y,new cljs.core.Keyword(null,"tile-id","tile-id",781804456),tile_id,new cljs.core.Keyword(null,"entity-id","entity-id",1485898093),entity_id], null));
|
|
50
|
-
});
|
|
51
|
-
/**
|
|
52
|
-
* Cancel a touch start without activating drag.
|
|
53
|
-
*/
|
|
54
|
-
iris_layout.components.touch_drag.cancel_touch_BANG_ = (function iris_layout$components$touch_drag$cancel_touch_BANG_(){
|
|
55
|
-
return cljs.core.reset_BANG_(iris_layout.components.touch_drag.touch_start,null);
|
|
56
|
-
});
|
|
57
|
-
/**
|
|
58
|
-
* Activate drag — create ghost and set drag state.
|
|
59
|
-
*/
|
|
60
|
-
iris_layout.components.touch_drag.activate_drag_BANG_ = (function iris_layout$components$touch_drag$activate_drag_BANG_(ts,x,y){
|
|
61
|
-
var ghost = iris_layout.components.touch_drag.create_ghost_BANG_(x,y);
|
|
62
|
-
cljs.core.reset_BANG_(iris_layout.components.touch_drag.touch_state,new cljs.core.PersistentArrayMap(null, 4, [new cljs.core.Keyword(null,"tile-id","tile-id",781804456),new cljs.core.Keyword(null,"tile-id","tile-id",781804456).cljs$core$IFn$_invoke$arity$1(ts),new cljs.core.Keyword(null,"entity-id","entity-id",1485898093),new cljs.core.Keyword(null,"entity-id","entity-id",1485898093).cljs$core$IFn$_invoke$arity$1(ts),new cljs.core.Keyword(null,"ghost-el","ghost-el",-316931125),ghost,new cljs.core.Keyword(null,"active?","active?",459499776),true], null));
|
|
63
|
-
|
|
64
|
-
cljs.core.reset_BANG_(iris_layout.components.touch_drag.touch_start,null);
|
|
65
|
-
|
|
66
|
-
var temp__5804__auto___6903 = window.getSelection();
|
|
67
|
-
if(cljs.core.truth_(temp__5804__auto___6903)){
|
|
68
|
-
var sel_6904 = temp__5804__auto___6903;
|
|
69
|
-
sel_6904.removeAllRanges();
|
|
70
|
-
} else {
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
if(cljs.core.truth_(navigator.vibrate)){
|
|
74
|
-
return navigator.vibrate((30));
|
|
75
|
-
} else {
|
|
76
|
-
return null;
|
|
77
|
-
}
|
|
78
|
-
});
|
|
79
|
-
/**
|
|
80
|
-
* Find the closest .iris-entity-tile ancestor from the element at point.
|
|
81
|
-
*/
|
|
82
|
-
iris_layout.components.touch_drag.find_tile_element = (function iris_layout$components$touch_drag$find_tile_element(x,y){
|
|
83
|
-
var temp__5804__auto__ = document.elementFromPoint(x,y);
|
|
84
|
-
if(cljs.core.truth_(temp__5804__auto__)){
|
|
85
|
-
var el = temp__5804__auto__;
|
|
86
|
-
return el.closest(".iris-entity-tile");
|
|
87
|
-
} else {
|
|
88
|
-
return null;
|
|
89
|
-
}
|
|
90
|
-
});
|
|
91
|
-
/**
|
|
92
|
-
* Determine which half of an element a point is closest to.
|
|
93
|
-
*/
|
|
94
|
-
iris_layout.components.touch_drag.calculate_half_xy = (function iris_layout$components$touch_drag$calculate_half_xy(x,y,el){
|
|
95
|
-
var rect = el.getBoundingClientRect();
|
|
96
|
-
var cx = (rect.left + (rect.width / (2)));
|
|
97
|
-
var cy = (rect.top + (rect.height / (2)));
|
|
98
|
-
var dx = (x - cx);
|
|
99
|
-
var dy = (y - cy);
|
|
100
|
-
if((Math.abs(dx) > Math.abs(dy))){
|
|
101
|
-
if((dx < (0))){
|
|
102
|
-
return new cljs.core.Keyword(null,"left","left",-399115937);
|
|
103
|
-
} else {
|
|
104
|
-
return new cljs.core.Keyword(null,"right","right",-452581833);
|
|
105
|
-
}
|
|
106
|
-
} else {
|
|
107
|
-
if((dy < (0))){
|
|
108
|
-
return new cljs.core.Keyword(null,"top","top",-1856271961);
|
|
109
|
-
} else {
|
|
110
|
-
return new cljs.core.Keyword(null,"bottom","bottom",-1550509018);
|
|
111
|
-
}
|
|
112
|
-
}
|
|
113
|
-
});
|
|
114
|
-
/**
|
|
115
|
-
* Update ghost position and find tile under finger.
|
|
116
|
-
*/
|
|
117
|
-
iris_layout.components.touch_drag.move_drag_BANG_ = (function iris_layout$components$touch_drag$move_drag_BANG_(touch_event){
|
|
118
|
-
var temp__5804__auto__ = cljs.core.deref(iris_layout.components.touch_drag.touch_state);
|
|
119
|
-
if(cljs.core.truth_(temp__5804__auto__)){
|
|
120
|
-
var state = temp__5804__auto__;
|
|
121
|
-
var touch = (touch_event.changedTouches[(0)]);
|
|
122
|
-
var x = touch.clientX;
|
|
123
|
-
var y = touch.clientY;
|
|
124
|
-
var ghost = new cljs.core.Keyword(null,"ghost-el","ghost-el",-316931125).cljs$core$IFn$_invoke$arity$1(state);
|
|
125
|
-
if(cljs.core.truth_(ghost)){
|
|
126
|
-
(ghost.style.left = [cljs.core.str.cljs$core$IFn$_invoke$arity$1((x - (40))),"px"].join(''));
|
|
127
|
-
|
|
128
|
-
(ghost.style.top = [cljs.core.str.cljs$core$IFn$_invoke$arity$1((y - (20))),"px"].join(''));
|
|
129
|
-
} else {
|
|
130
|
-
}
|
|
131
|
-
|
|
132
|
-
if(cljs.core.truth_(ghost)){
|
|
133
|
-
(ghost.style.display = "none");
|
|
134
|
-
} else {
|
|
135
|
-
}
|
|
136
|
-
|
|
137
|
-
var el_under = document.elementFromPoint(x,y);
|
|
138
|
-
var nav_el = (cljs.core.truth_(el_under)?el_under.closest(".iris-nav-edge"):null);
|
|
139
|
-
var tile_el = iris_layout.components.touch_drag.find_tile_element(x,y);
|
|
140
|
-
if(cljs.core.truth_(ghost)){
|
|
141
|
-
(ghost.style.display = "");
|
|
142
|
-
} else {
|
|
143
|
-
}
|
|
144
|
-
|
|
145
|
-
if(cljs.core.truth_(nav_el)){
|
|
146
|
-
var dir = (cljs.core.truth_(nav_el.classList.contains("iris-nav-left"))?new cljs.core.Keyword(null,"left","left",-399115937):(cljs.core.truth_(nav_el.classList.contains("iris-nav-right"))?new cljs.core.Keyword(null,"right","right",-452581833):(cljs.core.truth_(nav_el.classList.contains("iris-nav-top"))?new cljs.core.Keyword(null,"up","up",-269712113):(cljs.core.truth_(nav_el.classList.contains("iris-nav-bottom"))?new cljs.core.Keyword(null,"down","down",1565245570):null
|
|
147
|
-
))));
|
|
148
|
-
cljs.core.reset_BANG_(iris_layout.components.touch_drag.nav_edge_target,dir);
|
|
149
|
-
|
|
150
|
-
return cljs.core.reset_BANG_(iris_layout.components.touch_drag.hover_target,null);
|
|
151
|
-
} else {
|
|
152
|
-
cljs.core.reset_BANG_(iris_layout.components.touch_drag.nav_edge_target,null);
|
|
153
|
-
|
|
154
|
-
if(cljs.core.truth_(tile_el)){
|
|
155
|
-
var half = iris_layout.components.touch_drag.calculate_half_xy(x,y,tile_el);
|
|
156
|
-
var tile_id = tile_el.getAttribute("data-tile-id");
|
|
157
|
-
return cljs.core.reset_BANG_(iris_layout.components.touch_drag.hover_target,new cljs.core.PersistentArrayMap(null, 3, [new cljs.core.Keyword(null,"tile-el","tile-el",-1881974273),tile_el,new cljs.core.Keyword(null,"tile-id","tile-id",781804456),tile_id,new cljs.core.Keyword(null,"half","half",741990005),half], null));
|
|
158
|
-
} else {
|
|
159
|
-
return cljs.core.reset_BANG_(iris_layout.components.touch_drag.hover_target,null);
|
|
160
|
-
}
|
|
161
|
-
}
|
|
162
|
-
} else {
|
|
163
|
-
return null;
|
|
164
|
-
}
|
|
165
|
-
});
|
|
166
|
-
/**
|
|
167
|
-
* End touch drag — publish drop result for target tile or workspace to handle, then clean up.
|
|
168
|
-
*/
|
|
169
|
-
iris_layout.components.touch_drag.end_drag_BANG_ = (function iris_layout$components$touch_drag$end_drag_BANG_(){
|
|
170
|
-
var state = cljs.core.deref(iris_layout.components.touch_drag.touch_state);
|
|
171
|
-
var target = cljs.core.deref(iris_layout.components.touch_drag.hover_target);
|
|
172
|
-
if(cljs.core.truth_(state)){
|
|
173
|
-
cljs.core.reset_BANG_(iris_layout.components.touch_drag.drop_result,(function (){var G__6894 = new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"source-tile-id","source-tile-id",1477902631),new cljs.core.Keyword(null,"tile-id","tile-id",781804456).cljs$core$IFn$_invoke$arity$1(state),new cljs.core.Keyword(null,"source-entity-id","source-entity-id",-509281427),new cljs.core.Keyword(null,"entity-id","entity-id",1485898093).cljs$core$IFn$_invoke$arity$1(state)], null);
|
|
174
|
-
if(cljs.core.truth_(target)){
|
|
175
|
-
return cljs.core.assoc.cljs$core$IFn$_invoke$arity$variadic(G__6894,new cljs.core.Keyword(null,"target-tile-id","target-tile-id",-1830903484),new cljs.core.Keyword(null,"tile-id","tile-id",781804456).cljs$core$IFn$_invoke$arity$1(target),cljs.core.prim_seq.cljs$core$IFn$_invoke$arity$2([new cljs.core.Keyword(null,"half","half",741990005),new cljs.core.Keyword(null,"half","half",741990005).cljs$core$IFn$_invoke$arity$1(target)], 0));
|
|
176
|
-
} else {
|
|
177
|
-
return G__6894;
|
|
178
|
-
}
|
|
179
|
-
})());
|
|
180
|
-
} else {
|
|
181
|
-
}
|
|
182
|
-
|
|
183
|
-
var temp__5804__auto___6905 = new cljs.core.Keyword(null,"ghost-el","ghost-el",-316931125).cljs$core$IFn$_invoke$arity$1(state);
|
|
184
|
-
if(cljs.core.truth_(temp__5804__auto___6905)){
|
|
185
|
-
var ghost_6906 = temp__5804__auto___6905;
|
|
186
|
-
ghost_6906.remove();
|
|
187
|
-
} else {
|
|
188
|
-
}
|
|
189
|
-
|
|
190
|
-
cljs.core.reset_BANG_(iris_layout.components.touch_drag.touch_state,null);
|
|
191
|
-
|
|
192
|
-
cljs.core.reset_BANG_(iris_layout.components.touch_drag.hover_target,null);
|
|
193
|
-
|
|
194
|
-
return cljs.core.reset_BANG_(iris_layout.components.touch_drag.nav_edge_target,null);
|
|
195
|
-
});
|
|
196
|
-
if((typeof iris_layout !== 'undefined') && (typeof iris_layout.components !== 'undefined') && (typeof iris_layout.components.touch_drag !== 'undefined') && (typeof iris_layout.components.touch_drag._touch_listeners !== 'undefined')){
|
|
197
|
-
} else {
|
|
198
|
-
iris_layout.components.touch_drag._touch_listeners = (function (){
|
|
199
|
-
document.addEventListener("touchmove",(function (e){
|
|
200
|
-
if(iris_layout.components.touch_drag.dragging_QMARK_()){
|
|
201
|
-
e.preventDefault();
|
|
202
|
-
|
|
203
|
-
return iris_layout.components.touch_drag.move_drag_BANG_(e);
|
|
204
|
-
} else {
|
|
205
|
-
if(iris_layout.components.touch_drag.touch_started_QMARK_()){
|
|
206
|
-
var ts = cljs.core.deref(iris_layout.components.touch_drag.touch_start);
|
|
207
|
-
var touch = (e.changedTouches[(0)]);
|
|
208
|
-
var x = touch.clientX;
|
|
209
|
-
var y = touch.clientY;
|
|
210
|
-
var dx = (x - new cljs.core.Keyword(null,"start-x","start-x",-193941684).cljs$core$IFn$_invoke$arity$1(ts));
|
|
211
|
-
var dy = (y - new cljs.core.Keyword(null,"start-y","start-y",-771244577).cljs$core$IFn$_invoke$arity$1(ts));
|
|
212
|
-
var dist = Math.sqrt(((dx * dx) + (dy * dy)));
|
|
213
|
-
if((dist > iris_layout.components.touch_drag.move_threshold)){
|
|
214
|
-
e.preventDefault();
|
|
215
|
-
|
|
216
|
-
return iris_layout.components.touch_drag.activate_drag_BANG_(ts,x,y);
|
|
217
|
-
} else {
|
|
218
|
-
return null;
|
|
219
|
-
}
|
|
220
|
-
} else {
|
|
221
|
-
return null;
|
|
222
|
-
}
|
|
223
|
-
}
|
|
224
|
-
}),({"passive": false}));
|
|
225
|
-
|
|
226
|
-
document.addEventListener("touchend",(function (_e){
|
|
227
|
-
iris_layout.components.touch_drag.cancel_touch_BANG_();
|
|
228
|
-
|
|
229
|
-
if(iris_layout.components.touch_drag.dragging_QMARK_()){
|
|
230
|
-
setTimeout((function (){
|
|
231
|
-
if(iris_layout.components.touch_drag.dragging_QMARK_()){
|
|
232
|
-
return iris_layout.components.touch_drag.end_drag_BANG_();
|
|
233
|
-
} else {
|
|
234
|
-
return null;
|
|
235
|
-
}
|
|
236
|
-
}),(100));
|
|
237
|
-
} else {
|
|
238
|
-
}
|
|
239
|
-
|
|
240
|
-
return setTimeout((function (){
|
|
241
|
-
var seq__6895 = cljs.core.seq(cljs.core.array_seq.cljs$core$IFn$_invoke$arity$1(document.querySelectorAll(".iris-touch-drag-ghost")));
|
|
242
|
-
var chunk__6896 = null;
|
|
243
|
-
var count__6897 = (0);
|
|
244
|
-
var i__6898 = (0);
|
|
245
|
-
while(true){
|
|
246
|
-
if((i__6898 < count__6897)){
|
|
247
|
-
var ghost = chunk__6896.cljs$core$IIndexed$_nth$arity$2(null,i__6898);
|
|
248
|
-
if(iris_layout.components.touch_drag.dragging_QMARK_()){
|
|
249
|
-
} else {
|
|
250
|
-
ghost.remove();
|
|
251
|
-
}
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
var G__6908 = seq__6895;
|
|
255
|
-
var G__6909 = chunk__6896;
|
|
256
|
-
var G__6910 = count__6897;
|
|
257
|
-
var G__6911 = (i__6898 + (1));
|
|
258
|
-
seq__6895 = G__6908;
|
|
259
|
-
chunk__6896 = G__6909;
|
|
260
|
-
count__6897 = G__6910;
|
|
261
|
-
i__6898 = G__6911;
|
|
262
|
-
continue;
|
|
263
|
-
} else {
|
|
264
|
-
var temp__5804__auto__ = cljs.core.seq(seq__6895);
|
|
265
|
-
if(temp__5804__auto__){
|
|
266
|
-
var seq__6895__$1 = temp__5804__auto__;
|
|
267
|
-
if(cljs.core.chunked_seq_QMARK_(seq__6895__$1)){
|
|
268
|
-
var c__5525__auto__ = cljs.core.chunk_first(seq__6895__$1);
|
|
269
|
-
var G__6917 = cljs.core.chunk_rest(seq__6895__$1);
|
|
270
|
-
var G__6918 = c__5525__auto__;
|
|
271
|
-
var G__6919 = cljs.core.count(c__5525__auto__);
|
|
272
|
-
var G__6920 = (0);
|
|
273
|
-
seq__6895 = G__6917;
|
|
274
|
-
chunk__6896 = G__6918;
|
|
275
|
-
count__6897 = G__6919;
|
|
276
|
-
i__6898 = G__6920;
|
|
277
|
-
continue;
|
|
278
|
-
} else {
|
|
279
|
-
var ghost = cljs.core.first(seq__6895__$1);
|
|
280
|
-
if(iris_layout.components.touch_drag.dragging_QMARK_()){
|
|
281
|
-
} else {
|
|
282
|
-
ghost.remove();
|
|
283
|
-
}
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
var G__6921 = cljs.core.next(seq__6895__$1);
|
|
287
|
-
var G__6922 = null;
|
|
288
|
-
var G__6923 = (0);
|
|
289
|
-
var G__6924 = (0);
|
|
290
|
-
seq__6895 = G__6921;
|
|
291
|
-
chunk__6896 = G__6922;
|
|
292
|
-
count__6897 = G__6923;
|
|
293
|
-
i__6898 = G__6924;
|
|
294
|
-
continue;
|
|
295
|
-
}
|
|
296
|
-
} else {
|
|
297
|
-
return null;
|
|
298
|
-
}
|
|
299
|
-
}
|
|
300
|
-
break;
|
|
301
|
-
}
|
|
302
|
-
}),(300));
|
|
303
|
-
}),({"passive": true}));
|
|
304
|
-
|
|
305
|
-
document.addEventListener("contextmenu",(function (e){
|
|
306
|
-
if(((iris_layout.components.touch_drag.touch_started_QMARK_()) || (iris_layout.components.touch_drag.dragging_QMARK_()))){
|
|
307
|
-
return e.preventDefault();
|
|
308
|
-
} else {
|
|
309
|
-
return null;
|
|
310
|
-
}
|
|
311
|
-
}),({"passive": false}));
|
|
312
|
-
|
|
313
|
-
document.addEventListener("touchcancel",(function (_e){
|
|
314
|
-
iris_layout.components.touch_drag.cancel_touch_BANG_();
|
|
315
|
-
|
|
316
|
-
if(iris_layout.components.touch_drag.dragging_QMARK_()){
|
|
317
|
-
iris_layout.components.touch_drag.end_drag_BANG_();
|
|
318
|
-
} else {
|
|
319
|
-
}
|
|
320
|
-
|
|
321
|
-
return setTimeout((function (){
|
|
322
|
-
var seq__6899 = cljs.core.seq(cljs.core.array_seq.cljs$core$IFn$_invoke$arity$1(document.querySelectorAll(".iris-touch-drag-ghost")));
|
|
323
|
-
var chunk__6900 = null;
|
|
324
|
-
var count__6901 = (0);
|
|
325
|
-
var i__6902 = (0);
|
|
326
|
-
while(true){
|
|
327
|
-
if((i__6902 < count__6901)){
|
|
328
|
-
var ghost = chunk__6900.cljs$core$IIndexed$_nth$arity$2(null,i__6902);
|
|
329
|
-
ghost.remove();
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
var G__6931 = seq__6899;
|
|
333
|
-
var G__6932 = chunk__6900;
|
|
334
|
-
var G__6933 = count__6901;
|
|
335
|
-
var G__6934 = (i__6902 + (1));
|
|
336
|
-
seq__6899 = G__6931;
|
|
337
|
-
chunk__6900 = G__6932;
|
|
338
|
-
count__6901 = G__6933;
|
|
339
|
-
i__6902 = G__6934;
|
|
340
|
-
continue;
|
|
341
|
-
} else {
|
|
342
|
-
var temp__5804__auto__ = cljs.core.seq(seq__6899);
|
|
343
|
-
if(temp__5804__auto__){
|
|
344
|
-
var seq__6899__$1 = temp__5804__auto__;
|
|
345
|
-
if(cljs.core.chunked_seq_QMARK_(seq__6899__$1)){
|
|
346
|
-
var c__5525__auto__ = cljs.core.chunk_first(seq__6899__$1);
|
|
347
|
-
var G__6935 = cljs.core.chunk_rest(seq__6899__$1);
|
|
348
|
-
var G__6936 = c__5525__auto__;
|
|
349
|
-
var G__6937 = cljs.core.count(c__5525__auto__);
|
|
350
|
-
var G__6938 = (0);
|
|
351
|
-
seq__6899 = G__6935;
|
|
352
|
-
chunk__6900 = G__6936;
|
|
353
|
-
count__6901 = G__6937;
|
|
354
|
-
i__6902 = G__6938;
|
|
355
|
-
continue;
|
|
356
|
-
} else {
|
|
357
|
-
var ghost = cljs.core.first(seq__6899__$1);
|
|
358
|
-
ghost.remove();
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
var G__6945 = cljs.core.next(seq__6899__$1);
|
|
362
|
-
var G__6946 = null;
|
|
363
|
-
var G__6947 = (0);
|
|
364
|
-
var G__6948 = (0);
|
|
365
|
-
seq__6899 = G__6945;
|
|
366
|
-
chunk__6900 = G__6946;
|
|
367
|
-
count__6901 = G__6947;
|
|
368
|
-
i__6902 = G__6948;
|
|
369
|
-
continue;
|
|
370
|
-
}
|
|
371
|
-
} else {
|
|
372
|
-
return null;
|
|
373
|
-
}
|
|
374
|
-
}
|
|
375
|
-
break;
|
|
376
|
-
}
|
|
377
|
-
}),(100));
|
|
378
|
-
}),({"passive": true}));
|
|
379
|
-
|
|
380
|
-
return true;
|
|
381
|
-
})()
|
|
382
|
-
;
|
|
383
|
-
}
|
|
384
|
-
|
|
385
|
-
//# sourceMappingURL=iris_layout.components.touch_drag.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["iris_layout/components/touch_drag.cljs"],"mappings":";;;;AAaA,mDAAA,nDAAKA;AAGL,GAAA,QAAAC,wCAAAC,mDAAAC,8DAAAC;AAAA;AAAA,AAAA,AAASC,gDAAY,gDAAA,hDAACC;;AAGtB,GAAA,QAAAL,wCAAAC,mDAAAC,8DAAAI;AAAA;AAAA,AAAA,AAASC,iDAAa,gDAAA,hDAACF;;AAIvB,GAAA,QAAAL,wCAAAC,mDAAAC,8DAAAM;AAAA;AAAA,AAAA,AAASC,oDAAgB,gDAAA,hDAACJ;;AAI1B,GAAA,QAAAL,wCAAAC,mDAAAC,8DAAAQ;AAAA;AAAA,AAAA,AAASC,gDAAY,gDAAA,hDAACN;;AAItB,GAAA,QAAAL,wCAAAC,mDAAAC,8DAAAU;AAAA;AAAA,AAAA,AAAmBC,gDAAY,6CAAA,7CAACC;;AAGhC,oDAAA,pDAAMC;AAAN,AACE,UAAA,CAAA,A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GARJ,aAAA;;AAgBA,0BAAA,1BAAmBN,wCACjB,WAAKC;AAAL,AACE,GAAM,EAAI,AAAC5C,8DAAgB,AAACF;AAA5B,AACE,OAAiB8C;;AADnB;;GAFJ,aAAA;;AAKA,0BAAA,1BAAmBD,wCACjB,WAAKI;AAAL,AACE,AAAClC;;AACD,GAAM,AAACf;AAAP,AAAkB,AAACuC;;AAAnB;;AAEA,OAACW,WACC;AAAA,AACE,IAAAc,YAAA,AAAAZ,cAAc,AAACW,kDAAU,0BAAA,1BAAmBlB;IAA5CoB,cAAA;IAAAC,cAAA;IAAAC,UAAA;;AAAA,AAAA,GAAA,AAAA,CAAAA,UAAAD;AAAA,YAAA,AAAAD,iDAAAE,zDAAQ7D;AAAR,AAAA,AACE,AAASA;;AADX;AAAA,cAAA0D;cAAAC;cAAAC;cAAA,CAAAC,UAAA;;;;;;;AAAA,IAAAjD,qBAAA,AAAAkC,cAAAY;AAAA,AAAA,GAAA9C;AAAA,AAAA,IAAA8C,gBAAA9C;AAAA,AAAA,GAAA,AAAAsC,6BAAAQ;AAAA,IAAAP,kBAAA,AAAAC,sBAAAM;AAAA,AAAA,cAAA,AAAAL,qBAAAK;cAAAP;cAAA,AAAAG,gBAAAH;cAAA;;;;;;;AAAA,YAAA,AAAAI,gBAAAG,xBAAQ1D;AAAR,AAAA,AACE,AAASA;;AADX;AAAA,cAAA,AAAAwD,eAAAE;cAAA;cAAA;cAAA;;;;;;;;AAAA;;;;;GAFJ;GALJ,aAAA;;AA1CF","names":["iris-layout.components.touch-drag/move-threshold","js/iris-layout","js/iris-layout.components","js/iris-layout.components.touch-drag","js/iris-layout.components.touch-drag.touch-state","iris-layout.components.touch-drag/touch-state","reagent.core.atom","js/iris-layout.components.touch-drag.hover-target","iris-layout.components.touch-drag/hover-target","js/iris-layout.components.touch-drag.nav-edge-target","iris-layout.components.touch-drag/nav-edge-target","js/iris-layout.components.touch-drag.drop-result","iris-layout.components.touch-drag/drop-result","js/iris-layout.components.touch-drag.touch-start","iris-layout.components.touch-drag/touch-start","cljs.core.atom","iris-layout.components.touch-drag/dragging?","cljs.core/deref","iris-layout.components.touch-drag/touch-started?","iris-layout.components.touch-drag/create-ghost!","x","y","ghost","js/document.createElement","js/document.body","iris-layout.components.touch-drag/start-touch!","tile-id","entity-id","touch-event","touch","cljs.core/reset!","iris-layout.components.touch-drag/cancel-touch!","iris-layout.components.touch-drag/activate-drag!","ts","temp__5804__auto__","sel","js/window.getSelection","js/navigator","iris-layout.components.touch-drag/find-tile-element","el","js/document.elementFromPoint","iris-layout.components.touch-drag/calculate-half-xy","rect","cx","cy","dx","dy","js/Math.abs","iris-layout.components.touch-drag/move-drag!","state","el-under","nav-el","tile-el","dir","half","iris-layout.components.touch-drag/end-drag!","target","G__6894","cljs.core.assoc","js/iris-layout.components.touch-drag._touch-listeners","iris-layout.components.touch-drag/_touch-listeners","js/document","e","dist","js/Math.sqrt","_e","js/setTimeout","seq__6895","cljs.core/seq","chunk__6896","count__6897","i__6898","cljs.core/chunked-seq?","c__5525__auto__","cljs.core/chunk-first","cljs.core/chunk-rest","cljs.core/count","cljs.core/first","cljs.core/next","cljs.core.array_seq","seq__6899","chunk__6900","count__6901","i__6902"],"sourcesContent":["(ns iris-layout.components.touch-drag\n \"Touch drag state \u2014 shared across all tiles for mobile drag-drop.\n\n On touch devices, HTML5 Drag and Drop doesn't work. This module\n provides a global touch-drag state that tiles subscribe to.\n\n Flow:\n 1. Header touchstart \u2192 records start position and source info\n 2. Global touchmove \u2192 after small movement, activates drag with ghost\n 3. Touchend \u2192 performs drop on target tile, cleans up\"\n (:require [reagent.core :as r]))\n\n;; Movement threshold in px \u2014 drag activates after finger moves this far\n(def move-threshold 8)\n\n;; Global touch drag state\n(defonce touch-state (r/atom nil))\n;; Shape: {:tile-id str :entity-id str :ghost-el DOM :active? bool}\n\n(defonce hover-target (r/atom nil))\n;; Shape: {:tile-el DOM :tile-id str :half keyword} or nil\n\n;; Nav edge target \u2014 tracks when touch hovers over a nav edge during drag\n(defonce nav-edge-target (r/atom nil))\n;; Shape: :left | :right | :up | :down | nil\n\n;; Drop result \u2014 set when drag ends, watched by target tiles to execute the split\n(defonce drop-result (r/atom nil))\n;; Shape: {:source-tile-id str :source-entity-id str :target-tile-id str :half keyword} or nil\n\n;; Touch start state (not reactive, internal only)\n(defonce ^:private touch-start (atom nil))\n;; Shape: {:start-x num :start-y num :tile-id str :entity-id str}\n\n(defn dragging? []\n (some? @touch-state))\n\n(defn touch-started? []\n (some? @touch-start))\n\n(defn- create-ghost! [x y]\n (let [ghost (js/document.createElement \"div\")]\n (set! (.-className ghost) \"iris-touch-drag-ghost\")\n (set! (.-cssText (.-style ghost))\n (str \"position:fixed;z-index:10000;pointer-events:none;\"\n \"background:rgba(99,102,241,0.8);color:#fff;padding:6px 14px;\"\n \"border-radius:8px;font-size:12px;font-weight:500;\"\n \"box-shadow:0 4px 20px rgba(0,0,0,0.4);\"\n \"left:\" (- x 40) \"px;\"\n \"top:\" (- y 20) \"px;\"))\n (.appendChild js/document.body ghost)\n ghost))\n\n(defn start-touch!\n \"Record touch start on a header. Drag activates after movement threshold.\"\n [tile-id entity-id touch-event]\n (let [touch (aget (.-changedTouches touch-event) 0)\n x (.-clientX touch)\n y (.-clientY touch)]\n (reset! touch-start {:start-x x\n :start-y y\n :tile-id tile-id\n :entity-id entity-id})))\n\n(defn cancel-touch!\n \"Cancel a touch start without activating drag.\"\n []\n (reset! touch-start nil))\n\n(defn- activate-drag!\n \"Activate drag \u2014 create ghost and set drag state.\"\n [ts x y]\n (let [ghost (create-ghost! x y)]\n (reset! touch-state {:tile-id (:tile-id ts)\n :entity-id (:entity-id ts)\n :ghost-el ghost\n :active? true})\n (reset! touch-start nil)\n ;; Clear any text selection\n (when-let [sel (js/window.getSelection)]\n (.removeAllRanges sel))\n ;; Vibrate for haptic feedback if available\n (when (.-vibrate js/navigator)\n (.vibrate js/navigator 30))))\n\n(defn- find-tile-element\n \"Find the closest .iris-entity-tile ancestor from the element at point.\"\n [x y]\n (when-let [el (js/document.elementFromPoint x y)]\n (.closest el \".iris-entity-tile\")))\n\n(defn- calculate-half-xy\n \"Determine which half of an element a point is closest to.\"\n [x y el]\n (let [rect (.getBoundingClientRect el)\n cx (+ (.-left rect) (/ (.-width rect) 2))\n cy (+ (.-top rect) (/ (.-height rect) 2))\n dx (- x cx)\n dy (- y cy)]\n (if (> (js/Math.abs dx) (js/Math.abs dy))\n (if (neg? dx) :left :right)\n (if (neg? dy) :top :bottom))))\n\n(defn move-drag!\n \"Update ghost position and find tile under finger.\"\n [touch-event]\n (when-let [state @touch-state]\n (let [touch (aget (.-changedTouches touch-event) 0)\n x (.-clientX touch)\n y (.-clientY touch)\n ghost (:ghost-el state)]\n ;; Move ghost\n (when ghost\n (set! (.-left (.-style ghost)) (str (- x 40) \"px\"))\n (set! (.-top (.-style ghost)) (str (- y 20) \"px\")))\n ;; Hide ghost briefly to find element underneath\n (when ghost (set! (.-display (.-style ghost)) \"none\"))\n (let [el-under (js/document.elementFromPoint x y)\n nav-el (when el-under (.closest el-under \".iris-nav-edge\"))\n tile-el (find-tile-element x y)]\n (when ghost (set! (.-display (.-style ghost)) \"\"))\n (if nav-el\n (let [dir (cond\n (.contains (.-classList nav-el) \"iris-nav-left\") :left\n (.contains (.-classList nav-el) \"iris-nav-right\") :right\n (.contains (.-classList nav-el) \"iris-nav-top\") :up\n (.contains (.-classList nav-el) \"iris-nav-bottom\") :down\n :else nil)]\n (reset! nav-edge-target dir)\n (reset! hover-target nil))\n (do\n (reset! nav-edge-target nil)\n (if tile-el\n (let [half (calculate-half-xy x y tile-el)\n tile-id (.getAttribute tile-el \"data-tile-id\")]\n (reset! hover-target {:tile-el tile-el :tile-id tile-id :half half}))\n (reset! hover-target nil))))))))\n\n(defn end-drag!\n \"End touch drag \u2014 publish drop result for target tile or workspace to handle, then clean up.\"\n []\n (let [state @touch-state\n target @hover-target]\n ;; Publish drop result \u2014 with or without a target tile\n (when state\n (reset! drop-result (cond-> {:source-tile-id (:tile-id state)\n :source-entity-id (:entity-id state)}\n target (assoc :target-tile-id (:tile-id target)\n :half (:half target)))))\n ;; Clean up ghost\n (when-let [ghost (:ghost-el state)]\n (.remove ghost))\n (reset! touch-state nil)\n (reset! hover-target nil)\n (reset! nav-edge-target nil)))\n\n;; Global touch listeners (attached once)\n(defonce _touch-listeners\n (do\n (.addEventListener js/document \"touchmove\"\n (fn [e]\n (cond\n ;; Active drag \u2014 move ghost and find target\n (dragging?)\n (do (.preventDefault e)\n (move-drag! e))\n ;; Touch started on header \u2014 check if moved enough to activate drag\n (touch-started?)\n (let [ts @touch-start\n touch (aget (.-changedTouches e) 0)\n x (.-clientX touch)\n y (.-clientY touch)\n dx (- x (:start-x ts))\n dy (- y (:start-y ts))\n dist (js/Math.sqrt (+ (* dx dx) (* dy dy)))]\n (when (> dist move-threshold)\n (.preventDefault e)\n (activate-drag! ts x y)))))\n #js {:passive false})\n (.addEventListener js/document \"touchend\"\n (fn [_e]\n ;; Cancel touch start on lift (was a tap, not drag)\n (cancel-touch!)\n ;; Safety cleanup for active drag (individual tiles handle the drop)\n (when (dragging?)\n (js/setTimeout #(when (dragging?) (end-drag!)) 100))\n ;; Remove any leftover ghost elements\n (js/setTimeout\n (fn []\n (doseq [ghost (array-seq (.querySelectorAll js/document \".iris-touch-drag-ghost\"))]\n (when-not (dragging?)\n (.remove ghost))))\n 300))\n #js {:passive true})\n ;; Prevent context menu during drag\n (.addEventListener js/document \"contextmenu\"\n (fn [e]\n (when (or (touch-started?) (dragging?))\n (.preventDefault e)))\n #js {:passive false})\n (.addEventListener js/document \"touchcancel\"\n (fn [_e]\n (cancel-touch!)\n (when (dragging?) (end-drag!))\n ;; Remove any orphaned ghost elements\n (js/setTimeout\n (fn []\n (doseq [ghost (array-seq (.querySelectorAll js/document \".iris-touch-drag-ghost\"))]\n (.remove ghost)))\n 100))\n #js {:passive true})\n true))\n"]}
|