@p4ulcristian/iris-layout 0.2.10 → 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.
Files changed (201) hide show
  1. package/dist/iris-layout.js +60 -45
  2. package/dist/styles.css +172 -2
  3. package/package.json +1 -1
  4. package/dist/cljs-runtime/cljs.core.js +0 -38746
  5. package/dist/cljs-runtime/cljs.core.js.map +0 -1
  6. package/dist/cljs-runtime/cljs.pprint.js +0 -8400
  7. package/dist/cljs-runtime/cljs.pprint.js.map +0 -1
  8. package/dist/cljs-runtime/cljs.stacktrace.js +0 -561
  9. package/dist/cljs-runtime/cljs.stacktrace.js.map +0 -1
  10. package/dist/cljs-runtime/cljs_env.js +0 -1286
  11. package/dist/cljs-runtime/clojure.data.js +0 -295
  12. package/dist/cljs-runtime/clojure.data.js.map +0 -1
  13. package/dist/cljs-runtime/clojure.set.js +0 -382
  14. package/dist/cljs-runtime/clojure.set.js.map +0 -1
  15. package/dist/cljs-runtime/clojure.string.js +0 -480
  16. package/dist/cljs-runtime/clojure.string.js.map +0 -1
  17. package/dist/cljs-runtime/clojure.walk.js +0 -132
  18. package/dist/cljs-runtime/clojure.walk.js.map +0 -1
  19. package/dist/cljs-runtime/devtools.async.js +0 -90
  20. package/dist/cljs-runtime/devtools.async.js.map +0 -1
  21. package/dist/cljs-runtime/devtools.context.js +0 -11
  22. package/dist/cljs-runtime/devtools.context.js.map +0 -1
  23. package/dist/cljs-runtime/devtools.core.js +0 -175
  24. package/dist/cljs-runtime/devtools.core.js.map +0 -1
  25. package/dist/cljs-runtime/devtools.defaults.js +0 -20
  26. package/dist/cljs-runtime/devtools.defaults.js.map +0 -1
  27. package/dist/cljs-runtime/devtools.format.js +0 -631
  28. package/dist/cljs-runtime/devtools.format.js.map +0 -1
  29. package/dist/cljs-runtime/devtools.formatters.budgeting.js +0 -182
  30. package/dist/cljs-runtime/devtools.formatters.budgeting.js.map +0 -1
  31. package/dist/cljs-runtime/devtools.formatters.core.js +0 -220
  32. package/dist/cljs-runtime/devtools.formatters.core.js.map +0 -1
  33. package/dist/cljs-runtime/devtools.formatters.helpers.js +0 -228
  34. package/dist/cljs-runtime/devtools.formatters.helpers.js.map +0 -1
  35. package/dist/cljs-runtime/devtools.formatters.js +0 -261
  36. package/dist/cljs-runtime/devtools.formatters.js.map +0 -1
  37. package/dist/cljs-runtime/devtools.formatters.markup.js +0 -1174
  38. package/dist/cljs-runtime/devtools.formatters.markup.js.map +0 -1
  39. package/dist/cljs-runtime/devtools.formatters.printing.js +0 -313
  40. package/dist/cljs-runtime/devtools.formatters.printing.js.map +0 -1
  41. package/dist/cljs-runtime/devtools.formatters.state.js +0 -325
  42. package/dist/cljs-runtime/devtools.formatters.state.js.map +0 -1
  43. package/dist/cljs-runtime/devtools.formatters.templating.js +0 -666
  44. package/dist/cljs-runtime/devtools.formatters.templating.js.map +0 -1
  45. package/dist/cljs-runtime/devtools.hints.js +0 -193
  46. package/dist/cljs-runtime/devtools.hints.js.map +0 -1
  47. package/dist/cljs-runtime/devtools.munging.js +0 -1058
  48. package/dist/cljs-runtime/devtools.munging.js.map +0 -1
  49. package/dist/cljs-runtime/devtools.prefs.js +0 -87
  50. package/dist/cljs-runtime/devtools.prefs.js.map +0 -1
  51. package/dist/cljs-runtime/devtools.preload.js +0 -11
  52. package/dist/cljs-runtime/devtools.preload.js.map +0 -1
  53. package/dist/cljs-runtime/devtools.protocols.js +0 -98
  54. package/dist/cljs-runtime/devtools.protocols.js.map +0 -1
  55. package/dist/cljs-runtime/devtools.reporter.js +0 -81
  56. package/dist/cljs-runtime/devtools.reporter.js.map +0 -1
  57. package/dist/cljs-runtime/devtools.toolbox.js +0 -141
  58. package/dist/cljs-runtime/devtools.toolbox.js.map +0 -1
  59. package/dist/cljs-runtime/devtools.util.js +0 -517
  60. package/dist/cljs-runtime/devtools.util.js.map +0 -1
  61. package/dist/cljs-runtime/devtools.version.js +0 -9
  62. package/dist/cljs-runtime/devtools.version.js.map +0 -1
  63. package/dist/cljs-runtime/goog.array.array.js +0 -659
  64. package/dist/cljs-runtime/goog.array.array.js.map +0 -9
  65. package/dist/cljs-runtime/goog.asserts.asserts.js +0 -133
  66. package/dist/cljs-runtime/goog.asserts.asserts.js.map +0 -9
  67. package/dist/cljs-runtime/goog.asserts.dom.js +0 -90
  68. package/dist/cljs-runtime/goog.asserts.dom.js.map +0 -9
  69. package/dist/cljs-runtime/goog.async.nexttick.js +0 -93
  70. package/dist/cljs-runtime/goog.async.nexttick.js.map +0 -9
  71. package/dist/cljs-runtime/goog.base.js +0 -1261
  72. package/dist/cljs-runtime/goog.base.js.map +0 -9
  73. package/dist/cljs-runtime/goog.collections.maps.js +0 -82
  74. package/dist/cljs-runtime/goog.collections.maps.js.map +0 -9
  75. package/dist/cljs-runtime/goog.debug.entrypointregistry.js +0 -44
  76. package/dist/cljs-runtime/goog.debug.entrypointregistry.js.map +0 -9
  77. package/dist/cljs-runtime/goog.debug.error.js +0 -30
  78. package/dist/cljs-runtime/goog.debug.error.js.map +0 -9
  79. package/dist/cljs-runtime/goog.dom.asserts.js +0 -40
  80. package/dist/cljs-runtime/goog.dom.asserts.js.map +0 -9
  81. package/dist/cljs-runtime/goog.dom.browserfeature.js +0 -21
  82. package/dist/cljs-runtime/goog.dom.browserfeature.js.map +0 -9
  83. package/dist/cljs-runtime/goog.dom.dom.js +0 -1087
  84. package/dist/cljs-runtime/goog.dom.dom.js.map +0 -9
  85. package/dist/cljs-runtime/goog.dom.element.js +0 -69
  86. package/dist/cljs-runtime/goog.dom.element.js.map +0 -9
  87. package/dist/cljs-runtime/goog.dom.htmlelement.js +0 -7
  88. package/dist/cljs-runtime/goog.dom.htmlelement.js.map +0 -9
  89. package/dist/cljs-runtime/goog.dom.nodetype.js +0 -6
  90. package/dist/cljs-runtime/goog.dom.nodetype.js.map +0 -9
  91. package/dist/cljs-runtime/goog.dom.safe.js +0 -277
  92. package/dist/cljs-runtime/goog.dom.safe.js.map +0 -9
  93. package/dist/cljs-runtime/goog.dom.tagname.js +0 -147
  94. package/dist/cljs-runtime/goog.dom.tagname.js.map +0 -9
  95. package/dist/cljs-runtime/goog.dom.tags.js +0 -10
  96. package/dist/cljs-runtime/goog.dom.tags.js.map +0 -9
  97. package/dist/cljs-runtime/goog.flags.flags.js +0 -12
  98. package/dist/cljs-runtime/goog.flags.flags.js.map +0 -9
  99. package/dist/cljs-runtime/goog.fs.blob.js +0 -38
  100. package/dist/cljs-runtime/goog.fs.blob.js.map +0 -9
  101. package/dist/cljs-runtime/goog.fs.url.js +0 -37
  102. package/dist/cljs-runtime/goog.fs.url.js.map +0 -9
  103. package/dist/cljs-runtime/goog.functions.functions.js +0 -211
  104. package/dist/cljs-runtime/goog.functions.functions.js.map +0 -9
  105. package/dist/cljs-runtime/goog.html.safehtml.js +0 -321
  106. package/dist/cljs-runtime/goog.html.safehtml.js.map +0 -9
  107. package/dist/cljs-runtime/goog.html.safescript.js +0 -65
  108. package/dist/cljs-runtime/goog.html.safescript.js.map +0 -9
  109. package/dist/cljs-runtime/goog.html.safestyle.js +0 -175
  110. package/dist/cljs-runtime/goog.html.safestyle.js.map +0 -9
  111. package/dist/cljs-runtime/goog.html.safestylesheet.js +0 -99
  112. package/dist/cljs-runtime/goog.html.safestylesheet.js.map +0 -9
  113. package/dist/cljs-runtime/goog.html.safeurl.js +0 -231
  114. package/dist/cljs-runtime/goog.html.safeurl.js.map +0 -9
  115. package/dist/cljs-runtime/goog.html.trustedresourceurl.js +0 -123
  116. package/dist/cljs-runtime/goog.html.trustedresourceurl.js.map +0 -9
  117. package/dist/cljs-runtime/goog.html.trustedtypes.js +0 -16
  118. package/dist/cljs-runtime/goog.html.trustedtypes.js.map +0 -9
  119. package/dist/cljs-runtime/goog.html.uncheckedconversions.js +0 -52
  120. package/dist/cljs-runtime/goog.html.uncheckedconversions.js.map +0 -9
  121. package/dist/cljs-runtime/goog.labs.useragent.browser.js +0 -352
  122. package/dist/cljs-runtime/goog.labs.useragent.browser.js.map +0 -9
  123. package/dist/cljs-runtime/goog.labs.useragent.engine.js +0 -73
  124. package/dist/cljs-runtime/goog.labs.useragent.engine.js.map +0 -9
  125. package/dist/cljs-runtime/goog.labs.useragent.highentropy.highentropydata.js +0 -14
  126. package/dist/cljs-runtime/goog.labs.useragent.highentropy.highentropydata.js.map +0 -9
  127. package/dist/cljs-runtime/goog.labs.useragent.highentropy.highentropyvalue.js +0 -74
  128. package/dist/cljs-runtime/goog.labs.useragent.highentropy.highentropyvalue.js.map +0 -9
  129. package/dist/cljs-runtime/goog.labs.useragent.platform.js +0 -147
  130. package/dist/cljs-runtime/goog.labs.useragent.platform.js.map +0 -9
  131. package/dist/cljs-runtime/goog.labs.useragent.useragent.js +0 -21
  132. package/dist/cljs-runtime/goog.labs.useragent.useragent.js.map +0 -9
  133. package/dist/cljs-runtime/goog.labs.useragent.util.js +0 -81
  134. package/dist/cljs-runtime/goog.labs.useragent.util.js.map +0 -9
  135. package/dist/cljs-runtime/goog.math.coordinate.js +0 -97
  136. package/dist/cljs-runtime/goog.math.coordinate.js.map +0 -9
  137. package/dist/cljs-runtime/goog.math.integer.js +0 -445
  138. package/dist/cljs-runtime/goog.math.integer.js.map +0 -9
  139. package/dist/cljs-runtime/goog.math.long.js +0 -437
  140. package/dist/cljs-runtime/goog.math.long.js.map +0 -9
  141. package/dist/cljs-runtime/goog.math.math.js +0 -158
  142. package/dist/cljs-runtime/goog.math.math.js.map +0 -9
  143. package/dist/cljs-runtime/goog.math.size.js +0 -76
  144. package/dist/cljs-runtime/goog.math.size.js.map +0 -9
  145. package/dist/cljs-runtime/goog.object.object.js +0 -284
  146. package/dist/cljs-runtime/goog.object.object.js.map +0 -9
  147. package/dist/cljs-runtime/goog.reflect.reflect.js +0 -32
  148. package/dist/cljs-runtime/goog.reflect.reflect.js.map +0 -9
  149. package/dist/cljs-runtime/goog.string.const.js +0 -35
  150. package/dist/cljs-runtime/goog.string.const.js.map +0 -9
  151. package/dist/cljs-runtime/goog.string.internal.js +0 -119
  152. package/dist/cljs-runtime/goog.string.internal.js.map +0 -9
  153. package/dist/cljs-runtime/goog.string.string.js +0 -462
  154. package/dist/cljs-runtime/goog.string.string.js.map +0 -9
  155. package/dist/cljs-runtime/goog.string.stringbuffer.js +0 -32
  156. package/dist/cljs-runtime/goog.string.stringbuffer.js.map +0 -9
  157. package/dist/cljs-runtime/goog.string.typedstring.js +0 -9
  158. package/dist/cljs-runtime/goog.string.typedstring.js.map +0 -9
  159. package/dist/cljs-runtime/goog.structs.structs.js +0 -199
  160. package/dist/cljs-runtime/goog.structs.structs.js.map +0 -9
  161. package/dist/cljs-runtime/goog.uri.uri.js +0 -628
  162. package/dist/cljs-runtime/goog.uri.uri.js.map +0 -9
  163. package/dist/cljs-runtime/goog.uri.utils.js +0 -326
  164. package/dist/cljs-runtime/goog.uri.utils.js.map +0 -9
  165. package/dist/cljs-runtime/goog.useragent.useragent.js +0 -139
  166. package/dist/cljs-runtime/goog.useragent.useragent.js.map +0 -9
  167. package/dist/cljs-runtime/iris_layout.components.entity_card_group.js +0 -202
  168. package/dist/cljs-runtime/iris_layout.components.entity_card_group.js.map +0 -1
  169. package/dist/cljs-runtime/iris_layout.components.entity_tile.js +0 -327
  170. package/dist/cljs-runtime/iris_layout.components.entity_tile.js.map +0 -1
  171. package/dist/cljs-runtime/iris_layout.components.entity_tile_group.js +0 -33
  172. package/dist/cljs-runtime/iris_layout.components.entity_tile_group.js.map +0 -1
  173. package/dist/cljs-runtime/iris_layout.components.resizer.js +0 -91
  174. package/dist/cljs-runtime/iris_layout.components.resizer.js.map +0 -1
  175. package/dist/cljs-runtime/iris_layout.components.touch_drag.js +0 -385
  176. package/dist/cljs-runtime/iris_layout.components.touch_drag.js.map +0 -1
  177. package/dist/cljs-runtime/iris_layout.core.js +0 -876
  178. package/dist/cljs-runtime/iris_layout.core.js.map +0 -1
  179. package/dist/cljs-runtime/iris_layout.layout.js +0 -328
  180. package/dist/cljs-runtime/iris_layout.layout.js.map +0 -1
  181. package/dist/cljs-runtime/reagent.core.js +0 -993
  182. package/dist/cljs-runtime/reagent.core.js.map +0 -1
  183. package/dist/cljs-runtime/reagent.debug.js +0 -75
  184. package/dist/cljs-runtime/reagent.debug.js.map +0 -1
  185. package/dist/cljs-runtime/reagent.impl.batching.js +0 -270
  186. package/dist/cljs-runtime/reagent.impl.batching.js.map +0 -1
  187. package/dist/cljs-runtime/reagent.impl.component.js +0 -758
  188. package/dist/cljs-runtime/reagent.impl.component.js.map +0 -1
  189. package/dist/cljs-runtime/reagent.impl.input.js +0 -175
  190. package/dist/cljs-runtime/reagent.impl.input.js.map +0 -1
  191. package/dist/cljs-runtime/reagent.impl.protocols.js +0 -99
  192. package/dist/cljs-runtime/reagent.impl.protocols.js.map +0 -1
  193. package/dist/cljs-runtime/reagent.impl.template.js +0 -660
  194. package/dist/cljs-runtime/reagent.impl.template.js.map +0 -1
  195. package/dist/cljs-runtime/reagent.impl.util.js +0 -748
  196. package/dist/cljs-runtime/reagent.impl.util.js.map +0 -1
  197. package/dist/cljs-runtime/reagent.ratom.js +0 -1668
  198. package/dist/cljs-runtime/reagent.ratom.js.map +0 -1
  199. package/dist/cljs-runtime/shadow.esm.esm_import$react.js +0 -5
  200. package/dist/cljs-runtime/shadow.module.iris-layout.append.js +0 -2
  201. package/dist/cljs-runtime/shadow.module.iris-layout.prepend.js +0 -2
@@ -1,327 +0,0 @@
1
- import "./cljs_env.js";
2
- import "./cljs.core.js";
3
- import "./reagent.core.js";
4
- import "./iris_layout.components.touch_drag.js";
5
- goog.provide('iris_layout.components.entity_tile');
6
- /**
7
- * Determine which half of the tile the cursor is closest to.
8
- */
9
- iris_layout.components.entity_tile.calculate_half = (function iris_layout$components$entity_tile$calculate_half(e,tile_elem){
10
- var rect = tile_elem.getBoundingClientRect();
11
- var cx = (rect.left + (rect.width / (2)));
12
- var cy = (rect.top + (rect.height / (2)));
13
- var dx = (e.clientX - cx);
14
- var dy = (e.clientY - cy);
15
- if((Math.abs(dx) > Math.abs(dy))){
16
- if((dx < (0))){
17
- return new cljs.core.Keyword(null,"left","left",-399115937);
18
- } else {
19
- return new cljs.core.Keyword(null,"right","right",-452581833);
20
- }
21
- } else {
22
- if((dy < (0))){
23
- return new cljs.core.Keyword(null,"top","top",-1856271961);
24
- } else {
25
- return new cljs.core.Keyword(null,"bottom","bottom",-1550509018);
26
- }
27
- }
28
- });
29
- iris_layout.components.entity_tile.half__GT_direction = (function iris_layout$components$entity_tile$half__GT_direction(half){
30
- if(((cljs.core._EQ_.cljs$core$IFn$_invoke$arity$2(half,new cljs.core.Keyword(null,"left","left",-399115937))) || (cljs.core._EQ_.cljs$core$IFn$_invoke$arity$2(half,new cljs.core.Keyword(null,"right","right",-452581833))))){
31
- return new cljs.core.Keyword(null,"horizontal","horizontal",2062109475);
32
- } else {
33
- return new cljs.core.Keyword(null,"vertical","vertical",718696748);
34
- }
35
- });
36
- iris_layout.components.entity_tile.direction_labels = new cljs.core.PersistentArrayMap(null, 4, [new cljs.core.Keyword(null,"top","top",-1856271961),"Split above",new cljs.core.Keyword(null,"bottom","bottom",-1550509018),"Split below",new cljs.core.Keyword(null,"left","left",-399115937),"Split left",new cljs.core.Keyword(null,"right","right",-452581833),"Split right"], null);
37
- iris_layout.components.entity_tile.drop_indicator = (function iris_layout$components$entity_tile$drop_indicator(half,visible_QMARK_){
38
- if(cljs.core.truth_(visible_QMARK_)){
39
- return new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"div.iris-drop-indicator","div.iris-drop-indicator",-365975645),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"div","div",1057191632),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"class","class",-2030961996),["iris-drop-highlight iris-drop-",cljs.core.name(half)].join('')], null)], null),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"div.iris-drop-label-container","div.iris-drop-label-container",915701277),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"span.iris-drop-label","span.iris-drop-label",355054911),cljs.core.get.cljs$core$IFn$_invoke$arity$3(iris_layout.components.entity_tile.direction_labels,half,"Split")], null)], null)], null);
40
- } else {
41
- return null;
42
- }
43
- });
44
- if((typeof iris_layout !== 'undefined') && (typeof iris_layout.components !== 'undefined') && (typeof iris_layout.components.entity_tile !== 'undefined') && (typeof iris_layout.components.entity_tile.drag_source_tile !== 'undefined')){
45
- } else {
46
- iris_layout.components.entity_tile.drag_source_tile = cljs.core.atom.cljs$core$IFn$_invoke$arity$1(null);
47
- }
48
- if((typeof iris_layout !== 'undefined') && (typeof iris_layout.components !== 'undefined') && (typeof iris_layout.components.entity_tile !== 'undefined') && (typeof iris_layout.components.entity_tile.drag_source_entity !== 'undefined')){
49
- } else {
50
- iris_layout.components.entity_tile.drag_source_entity = cljs.core.atom.cljs$core$IFn$_invoke$arity$1(null);
51
- }
52
- if((typeof iris_layout !== 'undefined') && (typeof iris_layout.components !== 'undefined') && (typeof iris_layout.components.entity_tile !== 'undefined') && (typeof iris_layout.components.entity_tile.fullscreen_tile !== 'undefined')){
53
- } else {
54
- iris_layout.components.entity_tile.fullscreen_tile = reagent.core.atom.cljs$core$IFn$_invoke$arity$1(null);
55
- }
56
- iris_layout.components.entity_tile.clear_drop_state_BANG_ = (function iris_layout$components$entity_tile$clear_drop_state_BANG_(drag_over,closest_edge){
57
- cljs.core.reset_BANG_(drag_over,false);
58
-
59
- return cljs.core.reset_BANG_(closest_edge,null);
60
- });
61
- iris_layout.components.entity_tile.handle_drag_over = (function iris_layout$components$entity_tile$handle_drag_over(e,dragging,drag_over,closest_edge,tile_ref){
62
- e.preventDefault();
63
-
64
- if(cljs.core.truth_(cljs.core.deref(dragging))){
65
- return iris_layout.components.entity_tile.clear_drop_state_BANG_(drag_over,closest_edge);
66
- } else {
67
- var temp__5804__auto__ = cljs.core.deref(tile_ref);
68
- if(cljs.core.truth_(temp__5804__auto__)){
69
- var el = temp__5804__auto__;
70
- var half = iris_layout.components.entity_tile.calculate_half(e,el);
71
- cljs.core.reset_BANG_(closest_edge,half);
72
-
73
- return cljs.core.reset_BANG_(drag_over,true);
74
- } else {
75
- return null;
76
- }
77
- }
78
- });
79
- iris_layout.components.entity_tile.handle_drop = (function iris_layout$components$entity_tile$handle_drop(e,node,tile_ref,split_ref,drag_over,closest_edge){
80
- e.preventDefault();
81
-
82
- e.stopPropagation();
83
-
84
- var temp__5804__auto___6965 = cljs.core.deref(tile_ref);
85
- if(cljs.core.truth_(temp__5804__auto___6965)){
86
- var el_6966 = temp__5804__auto___6965;
87
- var half_6967 = iris_layout.components.entity_tile.calculate_half(e,el_6966);
88
- var direction_6968 = iris_layout.components.entity_tile.half__GT_direction(half_6967);
89
- var raw_6969 = e.dataTransfer.getData("text/plain");
90
- try{var data_6970 = JSON.parse(raw_6969);
91
- if(cljs.core.truth_((function (){var and__5000__auto__ = cljs.core._EQ_.cljs$core$IFn$_invoke$arity$2(data_6970.source,"tile");
92
- if(and__5000__auto__){
93
- return data_6970.entityId;
94
- } else {
95
- return and__5000__auto__;
96
- }
97
- })())){
98
- if(cljs.core.not_EQ_.cljs$core$IFn$_invoke$arity$2(data_6970.tileId,new cljs.core.Keyword(null,"id","id",-1388402092).cljs$core$IFn$_invoke$arity$1(node))){
99
- var G__6926_6971 = new cljs.core.Keyword(null,"id","id",-1388402092).cljs$core$IFn$_invoke$arity$1(node);
100
- var G__6927_6972 = data_6970.entityId;
101
- var G__6928_6973 = direction_6968;
102
- var G__6929_6974 = new cljs.core.Keyword(null,"tile","tile",758132866);
103
- var G__6930_6975 = half_6967;
104
- var fexpr__6925_6976 = cljs.core.deref(split_ref);
105
- (fexpr__6925_6976.cljs$core$IFn$_invoke$arity$5 ? fexpr__6925_6976.cljs$core$IFn$_invoke$arity$5(G__6926_6971,G__6927_6972,G__6928_6973,G__6929_6974,G__6930_6975) : fexpr__6925_6976.call(null,G__6926_6971,G__6927_6972,G__6928_6973,G__6929_6974,G__6930_6975));
106
- } else {
107
- }
108
- } else {
109
- if(cljs.core._EQ_.cljs$core$IFn$_invoke$arity$2(data_6970.source,"sidebar")){
110
- var temp__5804__auto___6977__$1 = data_6970.entityId;
111
- if(cljs.core.truth_(temp__5804__auto___6977__$1)){
112
- var eid_6978 = temp__5804__auto___6977__$1;
113
- var G__6940_6979 = new cljs.core.Keyword(null,"id","id",-1388402092).cljs$core$IFn$_invoke$arity$1(node);
114
- var G__6941_6980 = eid_6978;
115
- var G__6942_6981 = direction_6968;
116
- var G__6943_6982 = new cljs.core.Keyword(null,"sidebar","sidebar",35784458);
117
- var G__6944_6983 = half_6967;
118
- var fexpr__6939_6984 = cljs.core.deref(split_ref);
119
- (fexpr__6939_6984.cljs$core$IFn$_invoke$arity$5 ? fexpr__6939_6984.cljs$core$IFn$_invoke$arity$5(G__6940_6979,G__6941_6980,G__6942_6981,G__6943_6982,G__6944_6983) : fexpr__6939_6984.call(null,G__6940_6979,G__6941_6980,G__6942_6981,G__6943_6982,G__6944_6983));
120
- } else {
121
- }
122
- } else {
123
- }
124
- }
125
- }catch (e6907){var __6985 = e6907;
126
- if(cljs.core.truth_((function (){var and__5000__auto__ = raw_6969;
127
- if(cljs.core.truth_(and__5000__auto__)){
128
- return cljs.core.not_EQ_.cljs$core$IFn$_invoke$arity$2(raw_6969,"");
129
- } else {
130
- return and__5000__auto__;
131
- }
132
- })())){
133
- var G__6913_6986 = new cljs.core.Keyword(null,"id","id",-1388402092).cljs$core$IFn$_invoke$arity$1(node);
134
- var G__6914_6987 = raw_6969;
135
- var G__6915_6988 = direction_6968;
136
- var G__6916_6989 = new cljs.core.Keyword(null,"sidebar","sidebar",35784458);
137
- var fexpr__6912_6990 = cljs.core.deref(split_ref);
138
- (fexpr__6912_6990.cljs$core$IFn$_invoke$arity$4 ? fexpr__6912_6990.cljs$core$IFn$_invoke$arity$4(G__6913_6986,G__6914_6987,G__6915_6988,G__6916_6989) : fexpr__6912_6990.call(null,G__6913_6986,G__6914_6987,G__6915_6988,G__6916_6989));
139
- } else {
140
- }
141
- }} else {
142
- }
143
-
144
- return iris_layout.components.entity_tile.clear_drop_state_BANG_(drag_over,closest_edge);
145
- });
146
- iris_layout.components.entity_tile.handle_touch_end = (function iris_layout$components$entity_tile$handle_touch_end(dragging){
147
- iris_layout.components.touch_drag.cancel_touch_BANG_();
148
-
149
- if(iris_layout.components.touch_drag.dragging_QMARK_()){
150
- iris_layout.components.touch_drag.end_drag_BANG_();
151
- } else {
152
- }
153
-
154
- return cljs.core.reset_BANG_(dragging,false);
155
- });
156
- iris_layout.components.entity_tile.handle_drag_start = (function iris_layout$components$entity_tile$handle_drag_start(e,node,dragging){
157
- e.dataTransfer.setData("text/plain",JSON.stringify(({"tileId": new cljs.core.Keyword(null,"id","id",-1388402092).cljs$core$IFn$_invoke$arity$1(node), "entityId": new cljs.core.Keyword(null,"entity-id","entity-id",1485898093).cljs$core$IFn$_invoke$arity$1(node), "source": "tile"})));
158
-
159
- (e.dataTransfer.effectAllowed = "all");
160
-
161
- cljs.core.reset_BANG_(iris_layout.components.entity_tile.drag_source_tile,new cljs.core.Keyword(null,"id","id",-1388402092).cljs$core$IFn$_invoke$arity$1(node));
162
-
163
- cljs.core.reset_BANG_(iris_layout.components.entity_tile.drag_source_entity,new cljs.core.Keyword(null,"entity-id","entity-id",1485898093).cljs$core$IFn$_invoke$arity$1(node));
164
-
165
- return cljs.core.reset_BANG_(dragging,true);
166
- });
167
- iris_layout.components.entity_tile.handle_drag_end = (function iris_layout$components$entity_tile$handle_drag_end(dragging){
168
- cljs.core.reset_BANG_(dragging,false);
169
-
170
- cljs.core.reset_BANG_(iris_layout.components.entity_tile.drag_source_tile,null);
171
-
172
- return cljs.core.reset_BANG_(iris_layout.components.entity_tile.drag_source_entity,null);
173
- });
174
- iris_layout.components.entity_tile.entity_tile_component = (function iris_layout$components$entity_tile$entity_tile_component(node,on_split,on_close,focused_QMARK_,entities,render_entity_tile,_parent_ctx,on_active_entity_change){
175
- var drag_over = reagent.core.atom.cljs$core$IFn$_invoke$arity$1(false);
176
- var closest_edge = reagent.core.atom.cljs$core$IFn$_invoke$arity$1(null);
177
- var dragging = reagent.core.atom.cljs$core$IFn$_invoke$arity$1(false);
178
- var split_ref = cljs.core.atom.cljs$core$IFn$_invoke$arity$1(on_split);
179
- var close_ref = cljs.core.atom.cljs$core$IFn$_invoke$arity$1(on_close);
180
- var active_entity_change_ref = cljs.core.atom.cljs$core$IFn$_invoke$arity$1(on_active_entity_change);
181
- var tile_ref = cljs.core.atom.cljs$core$IFn$_invoke$arity$1(null);
182
- var touch_watch_key = ["tile-",cljs.core.str.cljs$core$IFn$_invoke$arity$1(new cljs.core.Keyword(null,"id","id",-1388402092).cljs$core$IFn$_invoke$arity$1(node))].join('');
183
- var drop_watch_key = ["tile-drop-",cljs.core.str.cljs$core$IFn$_invoke$arity$1(new cljs.core.Keyword(null,"id","id",-1388402092).cljs$core$IFn$_invoke$arity$1(node))].join('');
184
- var _ = cljs.core.add_watch(iris_layout.components.touch_drag.hover_target,touch_watch_key,(function (_,___$1,___$2,new_target){
185
- if(cljs.core.truth_((function (){var and__5000__auto__ = new_target;
186
- if(cljs.core.truth_(and__5000__auto__)){
187
- return cljs.core._EQ_.cljs$core$IFn$_invoke$arity$2(new cljs.core.Keyword(null,"tile-id","tile-id",781804456).cljs$core$IFn$_invoke$arity$1(new_target),new cljs.core.Keyword(null,"id","id",-1388402092).cljs$core$IFn$_invoke$arity$1(node));
188
- } else {
189
- return and__5000__auto__;
190
- }
191
- })())){
192
- var source_id = new cljs.core.Keyword(null,"tile-id","tile-id",781804456).cljs$core$IFn$_invoke$arity$1(cljs.core.deref(iris_layout.components.touch_drag.touch_state));
193
- if(cljs.core._EQ_.cljs$core$IFn$_invoke$arity$2(source_id,new cljs.core.Keyword(null,"id","id",-1388402092).cljs$core$IFn$_invoke$arity$1(node))){
194
- return iris_layout.components.entity_tile.clear_drop_state_BANG_(drag_over,closest_edge);
195
- } else {
196
- cljs.core.reset_BANG_(closest_edge,new cljs.core.Keyword(null,"half","half",741990005).cljs$core$IFn$_invoke$arity$1(new_target));
197
-
198
- return cljs.core.reset_BANG_(drag_over,true);
199
- }
200
- } else {
201
- if(cljs.core.truth_(cljs.core.deref(drag_over))){
202
- return iris_layout.components.entity_tile.clear_drop_state_BANG_(drag_over,closest_edge);
203
- } else {
204
- return null;
205
- }
206
- }
207
- }));
208
- var ___$1 = cljs.core.add_watch(iris_layout.components.touch_drag.drop_result,drop_watch_key,(function (___$1,___$2,___$3,drop_info){
209
- if(cljs.core.truth_((function (){var and__5000__auto__ = drop_info;
210
- if(cljs.core.truth_(and__5000__auto__)){
211
- return cljs.core._EQ_.cljs$core$IFn$_invoke$arity$2(new cljs.core.Keyword(null,"target-tile-id","target-tile-id",-1830903484).cljs$core$IFn$_invoke$arity$1(drop_info),new cljs.core.Keyword(null,"id","id",-1388402092).cljs$core$IFn$_invoke$arity$1(node));
212
- } else {
213
- return and__5000__auto__;
214
- }
215
- })())){
216
- var map__6953_6995 = drop_info;
217
- var map__6953_6996__$1 = cljs.core.__destructure_map(map__6953_6995);
218
- var source_tile_id_6997 = cljs.core.get.cljs$core$IFn$_invoke$arity$2(map__6953_6996__$1,new cljs.core.Keyword(null,"source-tile-id","source-tile-id",1477902631));
219
- var source_entity_id_6998 = cljs.core.get.cljs$core$IFn$_invoke$arity$2(map__6953_6996__$1,new cljs.core.Keyword(null,"source-entity-id","source-entity-id",-509281427));
220
- var half_6999 = cljs.core.get.cljs$core$IFn$_invoke$arity$2(map__6953_6996__$1,new cljs.core.Keyword(null,"half","half",741990005));
221
- var direction_7000 = iris_layout.components.entity_tile.half__GT_direction(half_6999);
222
- if(cljs.core.not_EQ_.cljs$core$IFn$_invoke$arity$2(source_tile_id_6997,new cljs.core.Keyword(null,"id","id",-1388402092).cljs$core$IFn$_invoke$arity$1(node))){
223
- var G__6955_7001 = new cljs.core.Keyword(null,"id","id",-1388402092).cljs$core$IFn$_invoke$arity$1(node);
224
- var G__6956_7002 = source_entity_id_6998;
225
- var G__6957_7003 = direction_7000;
226
- var G__6958_7004 = new cljs.core.Keyword(null,"tile","tile",758132866);
227
- var G__6959_7005 = half_6999;
228
- var fexpr__6954_7006 = cljs.core.deref(split_ref);
229
- (fexpr__6954_7006.cljs$core$IFn$_invoke$arity$5 ? fexpr__6954_7006.cljs$core$IFn$_invoke$arity$5(G__6955_7001,G__6956_7002,G__6957_7003,G__6958_7004,G__6959_7005) : fexpr__6954_7006.call(null,G__6955_7001,G__6956_7002,G__6957_7003,G__6958_7004,G__6959_7005));
230
- } else {
231
- }
232
-
233
- cljs.core.reset_BANG_(iris_layout.components.touch_drag.drop_result,null);
234
-
235
- return iris_layout.components.entity_tile.clear_drop_state_BANG_(drag_over,closest_edge);
236
- } else {
237
- return null;
238
- }
239
- }));
240
- return reagent.core.create_class.cljs$core$IFn$_invoke$arity$1(new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"component-will-unmount","component-will-unmount",-2058314698),(function (___$2){
241
- cljs.core.remove_watch(iris_layout.components.touch_drag.hover_target,touch_watch_key);
242
-
243
- return cljs.core.remove_watch(iris_layout.components.touch_drag.drop_result,drop_watch_key);
244
- }),new cljs.core.Keyword(null,"reagent-render","reagent-render",-985383853),(function (node__$1,on_split__$1,on_close__$1,focused_QMARK___$1,entities__$1,render_entity_tile__$1,_parent_ctx__$1,on_active_entity_change__$1){
245
- cljs.core.reset_BANG_(split_ref,on_split__$1);
246
-
247
- cljs.core.reset_BANG_(close_ref,on_close__$1);
248
-
249
- cljs.core.reset_BANG_(active_entity_change_ref,on_active_entity_change__$1);
250
-
251
- var entity = cljs.core.get.cljs$core$IFn$_invoke$arity$2(entities__$1,new cljs.core.Keyword(null,"entity-id","entity-id",1485898093).cljs$core$IFn$_invoke$arity$1(node__$1));
252
- var entity_name = (function (){var or__5002__auto__ = new cljs.core.Keyword(null,"name","name",1843675177).cljs$core$IFn$_invoke$arity$1(entity);
253
- if(cljs.core.truth_(or__5002__auto__)){
254
- return or__5002__auto__;
255
- } else {
256
- return new cljs.core.Keyword(null,"entity-id","entity-id",1485898093).cljs$core$IFn$_invoke$arity$1(node__$1);
257
- }
258
- })();
259
- return new cljs.core.PersistentVector(null, 5, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"div","div",1057191632),cljs.core.PersistentHashMap.fromArrays([new cljs.core.Keyword(null,"on-mouse-enter","on-mouse-enter",-1664921661),new cljs.core.Keyword(null,"data-tile-id","data-tile-id",-1283349274),new cljs.core.Keyword(null,"ref","ref",1289896967),new cljs.core.Keyword(null,"on-drop","on-drop",1867868491),new cljs.core.Keyword(null,"style","style",-496642736),new cljs.core.Keyword(null,"on-drag-leave","on-drag-leave",-373180078),new cljs.core.Keyword(null,"class","class",-2030961996),new cljs.core.Keyword(null,"on-drag-enter","on-drag-enter",-1692112235),new cljs.core.Keyword(null,"on-drag-over","on-drag-over",-93410408)],[(function (___$2){
260
- if(cljs.core.truth_((function (){var and__5000__auto__ = cljs.core.not(focused_QMARK___$1);
261
- if(and__5000__auto__){
262
- return cljs.core.deref(active_entity_change_ref);
263
- } else {
264
- return and__5000__auto__;
265
- }
266
- })())){
267
- var G__6961 = new cljs.core.Keyword(null,"entity-id","entity-id",1485898093).cljs$core$IFn$_invoke$arity$1(node__$1);
268
- var fexpr__6960 = cljs.core.deref(active_entity_change_ref);
269
- return (fexpr__6960.cljs$core$IFn$_invoke$arity$1 ? fexpr__6960.cljs$core$IFn$_invoke$arity$1(G__6961) : fexpr__6960.call(null,G__6961));
270
- } else {
271
- return null;
272
- }
273
- }),new cljs.core.Keyword(null,"id","id",-1388402092).cljs$core$IFn$_invoke$arity$1(node__$1),(function (p1__6949_SHARP_){
274
- return cljs.core.reset_BANG_(tile_ref,p1__6949_SHARP_);
275
- }),(function (p1__6951_SHARP_){
276
- return iris_layout.components.entity_tile.handle_drop(p1__6951_SHARP_,node__$1,tile_ref,split_ref,drag_over,closest_edge);
277
- }),(function (){var G__6962 = new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"flex","flex",-1425124628),(1)], null);
278
- if(cljs.core.truth_(new cljs.core.Keyword(null,"color","color",1011675173).cljs$core$IFn$_invoke$arity$1(entity))){
279
- return cljs.core.assoc.cljs$core$IFn$_invoke$arity$3(G__6962,"--iris-tile-color",new cljs.core.Keyword(null,"color","color",1011675173).cljs$core$IFn$_invoke$arity$1(entity));
280
- } else {
281
- return G__6962;
282
- }
283
- })(),(function (e){
284
- if(cljs.core.truth_(e.currentTarget.contains(e.relatedTarget))){
285
- return null;
286
- } else {
287
- return iris_layout.components.entity_tile.clear_drop_state_BANG_(drag_over,closest_edge);
288
- }
289
- }),["iris-entity-tile",(cljs.core.truth_(focused_QMARK___$1)?" iris-entity-tile-focused":null),((cljs.core.not(focused_QMARK___$1))?" iris-entity-tile-unfocused":null),(cljs.core.truth_(cljs.core.deref(drag_over))?" iris-drag-over":null),(cljs.core.truth_(cljs.core.deref(dragging))?" iris-dragging":null)].join(''),(function (e){
290
- return e.preventDefault();
291
- }),(function (p1__6950_SHARP_){
292
- return iris_layout.components.entity_tile.handle_drag_over(p1__6950_SHARP_,dragging,drag_over,closest_edge,tile_ref);
293
- })]),new cljs.core.PersistentVector(null, 4, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"div.iris-entity-tile-header","div.iris-entity-tile-header",1611784817),new cljs.core.PersistentArrayMap(null, 6, [new cljs.core.Keyword(null,"draggable","draggable",1676206163),true,new cljs.core.Keyword(null,"on-double-click","on-double-click",1434856980),(function (___$2){
294
- if(cljs.core._EQ_.cljs$core$IFn$_invoke$arity$2(cljs.core.deref(iris_layout.components.entity_tile.fullscreen_tile),new cljs.core.Keyword(null,"id","id",-1388402092).cljs$core$IFn$_invoke$arity$1(node__$1))){
295
- return cljs.core.reset_BANG_(iris_layout.components.entity_tile.fullscreen_tile,null);
296
- } else {
297
- return cljs.core.reset_BANG_(iris_layout.components.entity_tile.fullscreen_tile,new cljs.core.Keyword(null,"id","id",-1388402092).cljs$core$IFn$_invoke$arity$1(node__$1));
298
- }
299
- }),new cljs.core.Keyword(null,"on-drag-start","on-drag-start",-47712205),(function (p1__6952_SHARP_){
300
- return iris_layout.components.entity_tile.handle_drag_start(p1__6952_SHARP_,node__$1,dragging);
301
- }),new cljs.core.Keyword(null,"on-drag-end","on-drag-end",520272671),(function (___$2){
302
- return iris_layout.components.entity_tile.handle_drag_end(dragging);
303
- }),new cljs.core.Keyword(null,"on-touch-start","on-touch-start",447239419),(function (e){
304
- return iris_layout.components.touch_drag.start_touch_BANG_(new cljs.core.Keyword(null,"id","id",-1388402092).cljs$core$IFn$_invoke$arity$1(node__$1),new cljs.core.Keyword(null,"entity-id","entity-id",1485898093).cljs$core$IFn$_invoke$arity$1(node__$1),e);
305
- }),new cljs.core.Keyword(null,"on-touch-end","on-touch-end",1515667389),(function (_e){
306
- return iris_layout.components.entity_tile.handle_touch_end(dragging);
307
- })], null),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"span.iris-entity-tile-header-name","span.iris-entity-tile-header-name",-890448661),entity_name], null),new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"button.iris-entity-tile-header-close","button.iris-entity-tile-header-close",-649034559),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"on-click","on-click",1632826543),(function (e){
308
- e.stopPropagation();
309
-
310
- if(cljs.core.truth_(cljs.core.deref(close_ref))){
311
- var G__6964 = new cljs.core.Keyword(null,"entity-id","entity-id",1485898093).cljs$core$IFn$_invoke$arity$1(node__$1);
312
- var fexpr__6963 = cljs.core.deref(close_ref);
313
- return (fexpr__6963.cljs$core$IFn$_invoke$arity$1 ? fexpr__6963.cljs$core$IFn$_invoke$arity$1(G__6964) : fexpr__6963.call(null,G__6964));
314
- } else {
315
- return null;
316
- }
317
- })], null),"\u00D7"], null)], null),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"div.iris-entity-tile-content","div.iris-entity-tile-content",-1333148856),(cljs.core.truth_((function (){var and__5000__auto__ = entity;
318
- if(cljs.core.truth_(and__5000__auto__)){
319
- return render_entity_tile__$1;
320
- } else {
321
- return and__5000__auto__;
322
- }
323
- })())?new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,">",">",-555517146),render_entity_tile__$1,entity], null):null)], null),new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [iris_layout.components.entity_tile.drop_indicator,cljs.core.deref(closest_edge),cljs.core.deref(drag_over)], null)], null);
324
- })], null));
325
- });
326
-
327
- //# sourceMappingURL=iris_layout.components.entity_tile.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["iris_layout/components/entity_tile.cljs"],"mappings":";;;;;AAKA;;;oDAAA,pDAAMA,gHAEHC,EAAEC;AAFL,AAGE,IAAMC,OAAK,AAAwBD;IAC7BE,KAAG,CAAG,AAAQD,YAAM,cAAA,bAAG,AAASA;IAChCE,KAAG,CAAG,AAAOF,WAAM,eAAA,dAAG,AAAUA;IAChCG,KAAG,CAAG,AAAWL,YAAGG;IACpBG,KAAG,CAAG,AAAWN,YAAGI;AAJ1B,AAKE,GAAI,CAAG,AAACG,SAAYF,MAAI,AAACE,SAAYD;AACnC,GAAI,MAAA,LAAMD;AAAV;;AAAA;;;AACA,GAAI,MAAA,LAAMC;AAAV;;AAAA;;;;AAEN,wDAAA,xDAAME,wHAAiBC;AAAvB,AACE,GAAI,EAAI,kDAAA,lDAACC,6CAAED,gEAAY,kDAAA,lDAACC,6CAAED;AAA1B;;AAAA;;;AAIF,sDAAA,2CAAA,oDAAA,cAAA,0DAAA,cAAA,qDAAA,aAA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","js/Math.abs","iris-layout.components.entity-tile/half->direction","half","cljs.core._EQ_","iris-layout.components.entity-tile/direction-labels","iris-layout.components.entity-tile/drop-indicator","visible?","cljs.core/name","cljs.core.get","js/iris-layout","js/iris-layout.components","js/iris-layout.components.entity-tile","js/iris-layout.components.entity-tile.drag-source-tile","iris-layout.components.entity-tile/drag-source-tile","cljs.core.atom","js/iris-layout.components.entity-tile.drag-source-entity","iris-layout.components.entity-tile/drag-source-entity","js/iris-layout.components.entity-tile.fullscreen-tile","iris-layout.components.entity-tile/fullscreen-tile","reagent.core.atom","iris-layout.components.entity-tile/clear-drop-state!","drag-over","closest-edge","cljs.core/reset!","iris-layout.components.entity-tile/handle-drag-over","dragging","tile-ref","cljs.core/deref","temp__5804__auto__","el","iris-layout.components.entity-tile/handle-drop","node","split-ref","direction","raw","e6907","data","js/JSON.parse","and__5000__auto__","cljs.core.not_EQ_","G__6926","G__6927","G__6928","G__6929","G__6930","fexpr__6925","eid","G__6940","G__6941","G__6942","G__6943","G__6944","fexpr__6939","_","G__6913","G__6914","G__6915","G__6916","fexpr__6912","iris-layout.components.entity-tile/handle-touch-end","iris-layout.components.touch-drag/cancel-touch!","iris-layout.components.touch-drag/dragging?","iris-layout.components.touch-drag/end-drag!","iris-layout.components.entity-tile/handle-drag-start","js/JSON.stringify","iris-layout.components.entity-tile/handle-drag-end","iris-layout.components.entity-tile/entity-tile-component","on-split","on-close","focused?","entities","render-entity-tile","_parent-ctx","on-active-entity-change","close-ref","active-entity-change-ref","touch-watch-key","drop-watch-key","cljs.core/add-watch","iris-layout.components.touch-drag/hover-target","new-target","source-id","iris-layout.components.touch-drag/touch-state","iris-layout.components.touch-drag/drop-result","drop-info","map__6953","cljs.core/--destructure-map","source-tile-id","source-entity-id","G__6955","G__6956","G__6957","G__6958","G__6959","fexpr__6954","reagent.core.create_class","cljs.core/remove-watch","p1__6949#","p1__6951#","p1__6950#","p1__6952#","entity","entity-name","or__5002__auto__","cljs.core/not","G__6962","cljs.core.assoc","G__6961","fexpr__6960","iris-layout.components.touch-drag/start-touch!","_e","G__6964","fexpr__6963"],"sourcesContent":["(ns iris-layout.components.entity-tile\n \"Entity tile component \u2014 renders a single entity inside the Body layout.\"\n (:require [reagent.core :as r]\n [iris-layout.components.touch-drag :as touch-drag]))\n\n(defn calculate-half\n \"Determine which half of the tile the cursor is closest to.\"\n [e tile-elem]\n (let [rect (.getBoundingClientRect tile-elem)\n cx (+ (.-left rect) (/ (.-width rect) 2))\n cy (+ (.-top rect) (/ (.-height rect) 2))\n dx (- (.-clientX e) cx)\n dy (- (.-clientY e) 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 half->direction [half]\n (if (or (= half :left) (= half :right))\n :horizontal\n :vertical))\n\n(def direction-labels\n {:top \"Split above\" :bottom \"Split below\"\n :left \"Split left\" :right \"Split right\"})\n\n(defn drop-indicator [half visible?]\n (when visible?\n [:div.iris-drop-indicator\n [:div {:class (str \"iris-drop-highlight iris-drop-\" (name half))}]\n [:div.iris-drop-label-container\n [:span.iris-drop-label (get direction-labels half \"Split\")]]]))\n\n;; Global atoms\n(defonce drag-source-tile (atom nil))\n(defonce drag-source-entity (atom nil))\n(defonce fullscreen-tile (r/atom nil))\n\n;; --- Extracted handler fns ---\n\n(defn- clear-drop-state! [drag-over closest-edge]\n (reset! drag-over false)\n (reset! closest-edge nil))\n\n(defn- handle-drag-over [e dragging drag-over closest-edge tile-ref]\n (.preventDefault e)\n (if @dragging\n (clear-drop-state! drag-over closest-edge)\n (when-let [el @tile-ref]\n (let [half (calculate-half e el)]\n (reset! closest-edge half)\n (reset! drag-over true)))))\n\n(defn- handle-drop [e node tile-ref split-ref drag-over closest-edge]\n (.preventDefault e)\n (.stopPropagation e)\n (when-let [el @tile-ref]\n (let [half (calculate-half e el)\n direction (half->direction half)\n raw (.getData (.-dataTransfer e) \"text/plain\")]\n (try\n (let [data (js/JSON.parse raw)]\n (cond\n (and (= (.-source data) \"tile\") (.-entityId data))\n (when (not= (.-tileId data) (:id node))\n (@split-ref (:id node) (.-entityId data) direction :tile half))\n\n (= (.-source data) \"sidebar\")\n (when-let [eid (.-entityId data)]\n (@split-ref (:id node) eid direction :sidebar half))))\n (catch :default _\n (when (and raw (not= raw \"\"))\n (@split-ref (:id node) raw direction :sidebar))))))\n (clear-drop-state! drag-over closest-edge))\n\n(defn- handle-touch-end [dragging]\n (touch-drag/cancel-touch!)\n (when (touch-drag/dragging?)\n (touch-drag/end-drag!))\n (reset! dragging false))\n\n(defn- handle-drag-start [e node dragging]\n (.setData (.-dataTransfer e) \"text/plain\"\n (js/JSON.stringify #js {:tileId (:id node)\n :entityId (:entity-id node)\n :source \"tile\"}))\n (set! (.-effectAllowed (.-dataTransfer e)) \"all\")\n (reset! drag-source-tile (:id node))\n (reset! drag-source-entity (:entity-id node))\n (reset! dragging true))\n\n(defn- handle-drag-end [dragging]\n (reset! dragging false)\n (reset! drag-source-tile nil)\n (reset! drag-source-entity nil))\n\n;; --- Main component ---\n\n(defn entity-tile-component\n [node on-split on-close focused? entities render-entity-tile _parent-ctx on-active-entity-change]\n (let [drag-over (r/atom false)\n closest-edge (r/atom nil)\n dragging (r/atom false)\n split-ref (atom on-split)\n close-ref (atom on-close)\n active-entity-change-ref (atom on-active-entity-change)\n tile-ref (atom nil)\n touch-watch-key (str \"tile-\" (:id node))\n drop-watch-key (str \"tile-drop-\" (:id node))\n _ (add-watch touch-drag/hover-target touch-watch-key\n (fn [_ _ _ new-target]\n (if (and new-target (= (:tile-id new-target) (:id node)))\n (let [source-id (:tile-id @touch-drag/touch-state)]\n (if (= source-id (:id node))\n (clear-drop-state! drag-over closest-edge)\n (do (reset! closest-edge (:half new-target))\n (reset! drag-over true))))\n (when @drag-over\n (clear-drop-state! drag-over closest-edge)))))\n _ (add-watch touch-drag/drop-result drop-watch-key\n (fn [_ _ _ drop-info]\n (when (and drop-info (= (:target-tile-id drop-info) (:id node)))\n (let [{:keys [source-tile-id source-entity-id half]} drop-info\n direction (half->direction half)]\n (when (not= source-tile-id (:id node))\n (@split-ref (:id node) source-entity-id direction :tile half)))\n (reset! touch-drag/drop-result nil)\n (clear-drop-state! drag-over closest-edge))))]\n (r/create-class\n {:component-will-unmount\n (fn [_]\n (remove-watch touch-drag/hover-target touch-watch-key)\n (remove-watch touch-drag/drop-result drop-watch-key))\n\n :reagent-render\n (fn [node on-split on-close focused? entities render-entity-tile _parent-ctx on-active-entity-change]\n (reset! split-ref on-split)\n (reset! close-ref on-close)\n (reset! active-entity-change-ref on-active-entity-change)\n (let [entity (get entities (:entity-id node))\n entity-name (or (:name entity) (:entity-id node))]\n [:div\n {:ref #(reset! tile-ref %)\n :data-tile-id (:id node)\n :class (str \"iris-entity-tile\"\n (when focused? \" iris-entity-tile-focused\")\n (when (not focused?) \" iris-entity-tile-unfocused\")\n (when @drag-over \" iris-drag-over\")\n (when @dragging \" iris-dragging\"))\n :style (cond-> {:flex 1}\n (:color entity) (assoc \"--iris-tile-color\" (:color entity)))\n :on-mouse-enter (fn [_]\n (when (and (not focused?) @active-entity-change-ref)\n (@active-entity-change-ref (:entity-id node))))\n :on-drag-over #(handle-drag-over % dragging drag-over closest-edge tile-ref)\n :on-drag-enter (fn [e] (.preventDefault e))\n :on-drag-leave (fn [e]\n (when-not (.contains (.-currentTarget e) (.-relatedTarget e))\n (clear-drop-state! drag-over closest-edge)))\n :on-drop #(handle-drop % node tile-ref split-ref drag-over closest-edge)\n }\n\n ;; Header\n [:div.iris-entity-tile-header\n {:draggable true\n :on-double-click (fn [_]\n (if (= @fullscreen-tile (:id node))\n (reset! fullscreen-tile nil)\n (reset! fullscreen-tile (:id node))))\n :on-drag-start #(handle-drag-start % node dragging)\n :on-drag-end (fn [_] (handle-drag-end dragging))\n :on-touch-start (fn [e]\n (touch-drag/start-touch!\n (:id node) (:entity-id node) e))\n :on-touch-end (fn [_e] (handle-touch-end dragging))}\n [:span.iris-entity-tile-header-name entity-name]\n [:button.iris-entity-tile-header-close\n {:on-click (fn [e]\n (.stopPropagation e)\n (when @close-ref (@close-ref (:entity-id node))))}\n \"\\u00d7\"]]\n\n ;; Content\n [:div.iris-entity-tile-content\n (when (and entity render-entity-tile)\n [:> render-entity-tile entity])]\n\n ;; Drop indicator\n [drop-indicator @closest-edge @drag-over]]))})))\n"]}
@@ -1,33 +0,0 @@
1
- import "./cljs_env.js";
2
- import "./cljs.core.js";
3
- import "./iris_layout.layout.js";
4
- import "./iris_layout.components.entity_tile.js";
5
- import "./iris_layout.components.resizer.js";
6
- goog.provide('iris_layout.components.entity_tile_group');
7
- /**
8
- * Recursively render a layout tree node.
9
- */
10
- iris_layout.components.entity_tile_group.entity_tile_group = (function iris_layout$components$entity_tile_group$entity_tile_group(node,on_split,on_close,on_ratio_change,active_entity,entities,render_entity_tile,on_active_entity_change){
11
- var G__6991 = iris_layout.layout.node_type(node);
12
- var G__6991__$1 = (((G__6991 instanceof cljs.core.Keyword))?G__6991.fqn:null);
13
- switch (G__6991__$1) {
14
- case "tile":
15
- return new cljs.core.PersistentVector(null, 9, 5, cljs.core.PersistentVector.EMPTY_NODE, [iris_layout.components.entity_tile.entity_tile_component,node,on_split,on_close,cljs.core._EQ_.cljs$core$IFn$_invoke$arity$2(new cljs.core.Keyword(null,"entity-id","entity-id",1485898093).cljs$core$IFn$_invoke$arity$1(node),active_entity),entities,render_entity_tile,null,on_active_entity_change], null);
16
-
17
- break;
18
- case "split":
19
- var vec__6992 = new cljs.core.Keyword(null,"children","children",-940561982).cljs$core$IFn$_invoke$arity$1(node);
20
- var child1 = cljs.core.nth.cljs$core$IFn$_invoke$arity$3(vec__6992,(0),null);
21
- var child2 = cljs.core.nth.cljs$core$IFn$_invoke$arity$3(vec__6992,(1),null);
22
- var direction = new cljs.core.Keyword(null,"direction","direction",-633359395).cljs$core$IFn$_invoke$arity$1(node);
23
- var ratio = new cljs.core.Keyword(null,"ratio","ratio",-926560044).cljs$core$IFn$_invoke$arity$1(node);
24
- return new cljs.core.PersistentVector(null, 5, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"div.iris-entity-tile-group","div.iris-entity-tile-group",-1995407678),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"class","class",-2030961996),cljs.core.name(direction)], null),new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"div","div",1057191632),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"style","style",-496642736),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"flex","flex",-1425124628),ratio], null)], null),new cljs.core.PersistentVector(null, 9, 5, cljs.core.PersistentVector.EMPTY_NODE, [iris_layout.components.entity_tile_group.entity_tile_group,child1,on_split,on_close,on_ratio_change,active_entity,entities,render_entity_tile,on_active_entity_change], null)], null),new cljs.core.PersistentVector(null, 4, 5, cljs.core.PersistentVector.EMPTY_NODE, [iris_layout.components.resizer.resizer,direction,new cljs.core.Keyword(null,"id","id",-1388402092).cljs$core$IFn$_invoke$arity$1(node),on_ratio_change], null),new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"div","div",1057191632),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"style","style",-496642736),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"flex","flex",-1425124628),((1) - ratio)], null)], null),new cljs.core.PersistentVector(null, 9, 5, cljs.core.PersistentVector.EMPTY_NODE, [iris_layout.components.entity_tile_group.entity_tile_group,child2,on_split,on_close,on_ratio_change,active_entity,entities,render_entity_tile,on_active_entity_change], null)], null)], null);
25
-
26
- break;
27
- default:
28
- return new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"div","div",1057191632),"Unknown node type"], null);
29
-
30
- }
31
- });
32
-
33
- //# sourceMappingURL=iris_layout.components.entity_tile_group.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["iris_layout/components/entity_tile_group.cljs"],"mappings":";;;;;;AAMA;;;6DAAA,7DAAMA,kIAEHC,KAAKC,SAASC,SAASC,gBAAgBC,cAAcC,SAASC,mBAAmBC;AAFpF,AAGE,IAAAC,UAAM,AAACE,6BAAiBV;IAAxBQ,cAAA,EAAA,CAAAA,mBAAAC,oBAAA,AAAAD,YAAA;AAAA,AAAA,QAAAA;KAAA;AAAA,qWAAA,3QAEGG,yDACAX,KAAKC,SAASC,SACd,AAACU,6CAAE,AAAA,6FAAYZ,MAAMI,eACrBC,SAASC,wBAAuBC;;;KALnC;AAQE,IAAAM,YAAsB,AAAA,2FAAWb;aAAjC,AAAAc,4CAAAD,UAAA,IAAA,nEAAOE;aAAP,AAAAD,4CAAAD,UAAA,IAAA,nEAAcG;IACRC,YAAU,AAAA,6FAAYjB;IACtBkB,QAAM,AAAA,qFAAQlB;AAFpB,AAAA,0FAAA,kGAAA,2CAAA,0FAAA,mFAAA,mDAAA,2CAAA,uDAAA,2CAAA,4EAAA,yQAAA,kPAAA,mFAAA,mDAAA,2CAAA,uDAAA,2CAAA,oFAAA,nuCAIW,AAACmB,eAAKF,4VACOC,yGACnBnB,2DAAkBgB,OAAOd,SAASC,SAASC,gBAAgBC,cAAcC,SAASC,mBAAmBC,2HACtGa,uCAAgBH,UAAU,AAAA,gFAAKjB,MAAMG,iWACjB,CAAA,MAAKe,0GACxBnB,2DAAkBiB,OAAOf,SAASC,SAASC,gBAAgBC,cAAcC,SAASC,mBAAmBC;;;;AAjB5G,0FAAA,mDAAA","names":["iris-layout.components.entity-tile-group/entity-tile-group","node","on-split","on-close","on-ratio-change","active-entity","entities","render-entity-tile","on-active-entity-change","G__6991","cljs.core/Keyword","iris-layout.layout/node-type","iris-layout.components.entity-tile/entity-tile-component","cljs.core._EQ_","vec__6992","cljs.core.nth","child1","child2","direction","ratio","cljs.core/name","iris-layout.components.resizer/resizer"],"sourcesContent":["(ns iris-layout.components.entity-tile-group\n \"Entity tile group \u2014 recursive layout tree renderer for the Body.\"\n (:require [iris-layout.layout :as layout]\n [iris-layout.components.entity-tile :as entity-tile]\n [iris-layout.components.resizer :as resizer]))\n\n(defn entity-tile-group\n \"Recursively render a layout tree node.\"\n [node on-split on-close on-ratio-change active-entity entities render-entity-tile on-active-entity-change]\n (case (layout/node-type node)\n :tile\n [entity-tile/entity-tile-component\n node on-split on-close\n (= (:entity-id node) active-entity)\n entities render-entity-tile nil on-active-entity-change]\n\n :split\n (let [[child1 child2] (:children node)\n direction (:direction node)\n ratio (:ratio node)]\n [:div.iris-entity-tile-group\n {:class (name direction)}\n [:div {:style {:flex ratio}}\n [entity-tile-group child1 on-split on-close on-ratio-change active-entity entities render-entity-tile on-active-entity-change]]\n [resizer/resizer direction (:id node) on-ratio-change]\n [:div {:style {:flex (- 1 ratio)}}\n [entity-tile-group child2 on-split on-close on-ratio-change active-entity entities render-entity-tile on-active-entity-change]]])\n\n [:div \"Unknown node type\"]))\n"]}
@@ -1,91 +0,0 @@
1
- import "./cljs_env.js";
2
- import "./cljs.core.js";
3
- import "./reagent.core.js";
4
- goog.provide('iris_layout.components.resizer');
5
- /**
6
- * Draggable split divider component — supports mouse and touch.
7
- */
8
- iris_layout.components.resizer.resizer = (function iris_layout$components$resizer$resizer(direction,split_id,on_ratio_change){
9
- var dragging = reagent.core.atom.cljs$core$IFn$_invoke$arity$1(false);
10
- var callback_ref = cljs.core.atom.cljs$core$IFn$_invoke$arity$1(on_ratio_change);
11
- return (function (direction__$1,split_id__$1,on_ratio_change__$1){
12
- cljs.core.reset_BANG_(callback_ref,on_ratio_change__$1);
13
-
14
- var start_resize = (function (target,get_pos){
15
- cljs.core.reset_BANG_(dragging,true);
16
-
17
- document.body.classList.add("iris-resizing");
18
-
19
- var parent = target.parentElement;
20
- parent.classList.add("iris-dragging");
21
-
22
- var calc_ratio = (function iris_layout$components$resizer$resizer_$_calc_ratio(x,y){
23
- var rect = parent.getBoundingClientRect();
24
- var relative_pos = ((cljs.core._EQ_.cljs$core$IFn$_invoke$arity$2(direction__$1,new cljs.core.Keyword(null,"horizontal","horizontal",2062109475)))?(x - rect.left):(y - rect.top));
25
- var size = ((cljs.core._EQ_.cljs$core$IFn$_invoke$arity$2(direction__$1,new cljs.core.Keyword(null,"horizontal","horizontal",2062109475)))?rect.width:rect.height);
26
- return (relative_pos / size);
27
- });
28
- var handle_mouse_move = (function iris_layout$components$resizer$resizer_$_handle_mouse_move(e){
29
- var G__12609 = split_id__$1;
30
- var G__12610 = calc_ratio(e.clientX,e.clientY);
31
- var fexpr__12608 = cljs.core.deref(callback_ref);
32
- return (fexpr__12608.cljs$core$IFn$_invoke$arity$2 ? fexpr__12608.cljs$core$IFn$_invoke$arity$2(G__12609,G__12610) : fexpr__12608.call(null,G__12609,G__12610));
33
- });
34
- var handle_mouse_up = (function iris_layout$components$resizer$resizer_$_handle_mouse_up(_e){
35
- cljs.core.reset_BANG_(dragging,false);
36
-
37
- document.body.classList.remove("iris-resizing");
38
-
39
- parent.classList.remove("iris-dragging");
40
-
41
- document.removeEventListener("mousemove",handle_mouse_move);
42
-
43
- return document.removeEventListener("mouseup",iris_layout$components$resizer$resizer_$_handle_mouse_up);
44
- });
45
- var handle_touch_move = (function iris_layout$components$resizer$resizer_$_handle_touch_move(e){
46
- e.preventDefault();
47
-
48
- var touch = (e.changedTouches[(0)]);
49
- var G__12616 = split_id__$1;
50
- var G__12617 = calc_ratio(touch.clientX,touch.clientY);
51
- var fexpr__12615 = cljs.core.deref(callback_ref);
52
- return (fexpr__12615.cljs$core$IFn$_invoke$arity$2 ? fexpr__12615.cljs$core$IFn$_invoke$arity$2(G__12616,G__12617) : fexpr__12615.call(null,G__12616,G__12617));
53
- });
54
- var handle_touch_end = (function iris_layout$components$resizer$resizer_$_handle_touch_end(_e){
55
- cljs.core.reset_BANG_(dragging,false);
56
-
57
- document.body.classList.remove("iris-resizing");
58
-
59
- parent.classList.remove("iris-dragging");
60
-
61
- document.removeEventListener("touchmove",handle_touch_move);
62
-
63
- return document.removeEventListener("touchend",iris_layout$components$resizer$resizer_$_handle_touch_end);
64
- });
65
- if(cljs.core.truth_(get_pos)){
66
- document.addEventListener("touchmove",handle_touch_move,({"passive": false}));
67
-
68
- return document.addEventListener("touchend",handle_touch_end);
69
- } else {
70
- document.addEventListener("mousemove",handle_mouse_move);
71
-
72
- return document.addEventListener("mouseup",handle_mouse_up);
73
- }
74
- });
75
- return new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"div","div",1057191632),new cljs.core.PersistentArrayMap(null, 3, [new cljs.core.Keyword(null,"class","class",-2030961996),["iris-resizer ",cljs.core.name(direction__$1),(cljs.core.truth_(cljs.core.deref(dragging))?" dragging":null)].join(''),new cljs.core.Keyword(null,"on-mouse-down","on-mouse-down",1147755470),(function (e){
76
- e.preventDefault();
77
-
78
- e.stopPropagation();
79
-
80
- return start_resize(e.currentTarget,null);
81
- }),new cljs.core.Keyword(null,"on-touch-start","on-touch-start",447239419),(function (e){
82
- e.preventDefault();
83
-
84
- e.stopPropagation();
85
-
86
- return start_resize(e.currentTarget,new cljs.core.Keyword(null,"touch","touch",1496272469));
87
- })], null)], null);
88
- });
89
- });
90
-
91
- //# sourceMappingURL=iris_layout.components.resizer.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["iris_layout/components/resizer.cljs"],"mappings":";;;;AAGA;;;yCAAA,zCAAMA,0FAEHC,UAAUC,SAASC;AAFtB,AAGE,IAAMC,WAAS,gDAAA,hDAACC;IACVC,eAAa,AAACC,6CAAKJ;AADzB,AAEE,kBAAKF,cAAUC,aAASC;AAAxB,AACE,AAACK,sBAAOF,aAAaH;;AACrB,IAAMM,eACA,WAAKC,OAAOC;AAAZ,AACE,+BAAA,/BAACH,sBAAOJ;;AACR,4BAAA,5BAAM,AAAaQ;;AACnB,IAAMC,SAAO,AAAiBH;AAA9B,AAEE,qBAAA,rBAAM,AAAa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AAwBC;;AAC3C,iCAAA,1BAAmBD,oCAAsBE;;;AA5C3D,AAAA,0FAAA,mDAAA,2CAAA,gLAAA,xHA+CW,CAAA,gBACK,AAACO,eAAKnC,eACN,kBAAA,AAAAuB,2BAAA,AAAA,YAAA,vBAAOpB,8GAEnB,WAAKgB;AAAL,AACE,AAAiBA;;AACjB,AAAkBA;;AAClB,oCAAA,7BAACX,aAAa,AAAiBW;GAtDrC,wEAwDI,WAAKA;AAAL,AACE,AAAiBA;;AACjB,AAAkBA;;AAClB,oCAAA,7BAACX,aAAa,AAAiBW","names":["iris-layout.components.resizer/resizer","direction","split-id","on-ratio-change","dragging","reagent.core.atom","callback-ref","cljs.core.atom","cljs.core/reset!","start-resize","target","get-pos","js/document.body","parent","x","y","rect","relative-pos","cljs.core._EQ_","size","e","G__12609","G__12610","fexpr__12608","cljs.core/deref","calc-ratio","_e","js/document","handle-mouse-move","handle-mouse-up","touch","G__12616","G__12617","fexpr__12615","handle-touch-move","handle-touch-end","cljs.core/name"],"sourcesContent":["(ns iris-layout.components.resizer\n (:require [reagent.core :as r]))\n\n(defn resizer\n \"Draggable split divider component \u2014 supports mouse and touch.\"\n [direction split-id on-ratio-change]\n (let [dragging (r/atom false)\n callback-ref (atom on-ratio-change)]\n (fn [direction split-id on-ratio-change]\n (reset! callback-ref on-ratio-change)\n (let [start-resize\n (fn [target get-pos]\n (reset! dragging true)\n (.add (.-classList js/document.body) \"iris-resizing\")\n (let [parent (.-parentElement target)]\n ;; Add iris-dragging class to parent to disable flex transitions\n (.add (.-classList parent) \"iris-dragging\")\n (letfn [(calc-ratio [x y]\n (let [rect (.getBoundingClientRect parent)\n relative-pos (if (= direction :horizontal)\n (- x (.-left rect))\n (- y (.-top rect)))\n size (if (= direction :horizontal)\n (.-width rect)\n (.-height rect))]\n (/ relative-pos size)))\n\n (handle-mouse-move [e]\n (@callback-ref split-id (calc-ratio (.-clientX e) (.-clientY e))))\n\n (handle-mouse-up [_e]\n (reset! dragging false)\n (.remove (.-classList js/document.body) \"iris-resizing\")\n (.remove (.-classList parent) \"iris-dragging\")\n (.removeEventListener js/document \"mousemove\" handle-mouse-move)\n (.removeEventListener js/document \"mouseup\" handle-mouse-up))\n\n (handle-touch-move [e]\n (.preventDefault e)\n (let [touch (aget (.-changedTouches e) 0)]\n (@callback-ref split-id (calc-ratio (.-clientX touch) (.-clientY touch)))))\n\n (handle-touch-end [_e]\n (reset! dragging false)\n (.remove (.-classList js/document.body) \"iris-resizing\")\n (.remove (.-classList parent) \"iris-dragging\")\n (.removeEventListener js/document \"touchmove\" handle-touch-move)\n (.removeEventListener js/document \"touchend\" handle-touch-end))]\n\n ;; Detect if touch or mouse based on caller\n (if get-pos\n (do (.addEventListener js/document \"touchmove\" handle-touch-move #js {:passive false})\n (.addEventListener js/document \"touchend\" handle-touch-end))\n (do (.addEventListener js/document \"mousemove\" handle-mouse-move)\n (.addEventListener js/document \"mouseup\" handle-mouse-up))))))]\n\n [:div\n {:class (str \"iris-resizer \"\n (name direction)\n (when @dragging \" dragging\"))\n :on-mouse-down\n (fn [e]\n (.preventDefault e)\n (.stopPropagation e)\n (start-resize (.-currentTarget e) nil))\n :on-touch-start\n (fn [e]\n (.preventDefault e)\n (.stopPropagation e)\n (start-resize (.-currentTarget e) :touch))}]))))\n"]}