kitchen-simulator 1.1.1-test.49 → 1.1.1-test.50

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 (358) hide show
  1. package/es/@history.js +2 -0
  2. package/es/AppContext.js +3 -0
  3. package/es/KitchenConfigurator.js +645 -0
  4. package/es/KitchenConfiguratorApp.js +480 -0
  5. package/es/actions/area-actions.js +14 -0
  6. package/es/actions/export.js +23 -0
  7. package/es/actions/groups-actions.js +89 -0
  8. package/es/actions/holes-actions.js +119 -0
  9. package/es/actions/items-actions.js +313 -0
  10. package/es/actions/lines-actions.js +81 -0
  11. package/es/actions/project-actions.js +281 -0
  12. package/es/actions/scene-actions.js +33 -0
  13. package/es/actions/vertices-actions.js +27 -0
  14. package/es/actions/viewer2d-actions.js +58 -0
  15. package/es/actions/viewer3d-actions.js +23 -0
  16. package/es/catalog/areas/area/planner-element.js +40 -0
  17. package/es/catalog/areas/area/textures/ceramic-tile.jpg +0 -0
  18. package/es/catalog/areas/area/textures/grass.jpg +0 -0
  19. package/es/catalog/areas/area/textures/parquet.jpg +0 -0
  20. package/es/catalog/areas/area/textures/strand-porcelain.jpg +0 -0
  21. package/es/catalog/areas/area/textures/tile1.jpg +0 -0
  22. package/es/catalog/catalog.js +277 -0
  23. package/es/catalog/envMap/nx.hdr +0 -0
  24. package/es/catalog/envMap/ny.hdr +0 -0
  25. package/es/catalog/envMap/nz.hdr +0 -0
  26. package/es/catalog/envMap/px.hdr +0 -0
  27. package/es/catalog/envMap/py.hdr +0 -0
  28. package/es/catalog/envMap/pz.hdr +0 -0
  29. package/es/catalog/factories/area-factory-3d.js +181 -0
  30. package/es/catalog/factories/area-factory.js +81 -0
  31. package/es/catalog/factories/export.js +7 -0
  32. package/es/catalog/factories/wall-factory-3d.js +202 -0
  33. package/es/catalog/factories/wall-factory.js +268 -0
  34. package/es/catalog/holes/door-closet/planner-element.js +222 -0
  35. package/es/catalog/holes/door-double/door_double.png +0 -0
  36. package/es/catalog/holes/door-double/planner-element.js +315 -0
  37. package/es/catalog/holes/door-exterior/planner-element.js +215 -0
  38. package/es/catalog/holes/door-interior/planner-element.js +227 -0
  39. package/es/catalog/holes/door-panic/panicDoor.png +0 -0
  40. package/es/catalog/holes/door-panic/planner-element.js +503 -0
  41. package/es/catalog/holes/door-panic-double/panicDoorDouble.png +0 -0
  42. package/es/catalog/holes/door-panic-double/planner-element.js +463 -0
  43. package/es/catalog/holes/door-sliding/planner-element.js +225 -0
  44. package/es/catalog/holes/doorway-framed/planner-element.js +145 -0
  45. package/es/catalog/holes/doorway-frameless/planner-element.js +104 -0
  46. package/es/catalog/holes/export.js +13 -0
  47. package/es/catalog/holes/gate/gate.jpg +0 -0
  48. package/es/catalog/holes/window-clear/planner-element.js +166 -0
  49. package/es/catalog/holes/window-clear/texture.png +0 -0
  50. package/es/catalog/holes/window-cross/planner-element.js +165 -0
  51. package/es/catalog/holes/window-cross/texture.png +0 -0
  52. package/es/catalog/holes/window-double-hung/planner-element.js +303 -0
  53. package/es/catalog/holes/window-double-hung/texture.png +0 -0
  54. package/es/catalog/holes/window-vertical/planner-element.js +276 -0
  55. package/es/catalog/holes/window-vertical/texture.png +0 -0
  56. package/es/catalog/lines/wall/planner-element.js +70 -0
  57. package/es/catalog/lines/wall/textures/bricks-normal.jpg +0 -0
  58. package/es/catalog/lines/wall/textures/bricks-normal2.jpg +0 -0
  59. package/es/catalog/lines/wall/textures/bricks.jpg +0 -0
  60. package/es/catalog/lines/wall/textures/bricks2.jpg +0 -0
  61. package/es/catalog/lines/wall/textures/bricks3.jpg +0 -0
  62. package/es/catalog/lines/wall/textures/morden-normal.jpg +0 -0
  63. package/es/catalog/lines/wall/textures/morden.jpg +0 -0
  64. package/es/catalog/lines/wall/textures/painted-normal.jpg +0 -0
  65. package/es/catalog/lines/wall/textures/painted.jpg +0 -0
  66. package/es/catalog/lines/wall/textures/plaster-normal.jpg +0 -0
  67. package/es/catalog/lines/wall/textures/plaster.jpg +0 -0
  68. package/es/catalog/lines/wall/wall.png +0 -0
  69. package/es/catalog/molding/molding-dcm/planner-element.js +28 -0
  70. package/es/catalog/molding/molding-dcm/texture.png +0 -0
  71. package/es/catalog/molding/molding-fbm/planner-element.js +28 -0
  72. package/es/catalog/molding/molding-fbm/texture.png +0 -0
  73. package/es/catalog/molding/molding-lrm/planner-element.js +28 -0
  74. package/es/catalog/molding/molding-lrm/texture.png +0 -0
  75. package/es/catalog/properties/export.js +21 -0
  76. package/es/catalog/properties/property-checkbox.js +116 -0
  77. package/es/catalog/properties/property-color.js +39 -0
  78. package/es/catalog/properties/property-enum.js +97 -0
  79. package/es/catalog/properties/property-hidden.js +19 -0
  80. package/es/catalog/properties/property-lenght-measure.js +101 -0
  81. package/es/catalog/properties/property-length-measure.js +134 -0
  82. package/es/catalog/properties/property-length-measure_hole.js +101 -0
  83. package/es/catalog/properties/property-number.js +48 -0
  84. package/es/catalog/properties/property-read-only.js +26 -0
  85. package/es/catalog/properties/property-string.js +48 -0
  86. package/es/catalog/properties/property-toggle.js +39 -0
  87. package/es/catalog/properties/shared-property-style.js +14 -0
  88. package/es/catalog/utils/FuseUtils.js +82 -0
  89. package/es/catalog/utils/exporter.js +148 -0
  90. package/es/catalog/utils/geom-utils.js +189 -0
  91. package/es/catalog/utils/item-loader.js +1521 -0
  92. package/es/catalog/utils/load-obj.js +91 -0
  93. package/es/catalog/utils/mtl-loader.js +358 -0
  94. package/es/catalog/utils/obj-loader.js +477 -0
  95. package/es/class/FuseUtils.js +82 -0
  96. package/es/class/area.js +145 -0
  97. package/es/class/export.js +24 -0
  98. package/es/class/group.js +440 -0
  99. package/es/class/guide.js +62 -0
  100. package/es/class/hole.js +929 -0
  101. package/es/class/item.js +1883 -0
  102. package/es/class/layer.js +667 -0
  103. package/es/class/line.js +1180 -0
  104. package/es/class/project.js +793 -0
  105. package/es/class/vertex.js +202 -0
  106. package/es/components/content.js +107 -0
  107. package/es/components/disclaimer/disclaimer.js +97 -0
  108. package/es/components/export.js +9 -0
  109. package/es/components/style/button.js +113 -0
  110. package/es/components/style/cancel-button.js +22 -0
  111. package/es/components/style/content-container.js +33 -0
  112. package/es/components/style/content-title.js +29 -0
  113. package/es/components/style/delete-button.js +25 -0
  114. package/es/components/style/export.js +31 -0
  115. package/es/components/style/form-block.js +24 -0
  116. package/es/components/style/form-color-input.js +27 -0
  117. package/es/components/style/form-label.js +26 -0
  118. package/es/components/style/form-number-input.js +213 -0
  119. package/es/components/style/form-number-input_2.js +206 -0
  120. package/es/components/style/form-select.js +68 -0
  121. package/es/components/style/form-slider.js +61 -0
  122. package/es/components/style/form-submit-button.js +26 -0
  123. package/es/components/style/form-text-input.js +95 -0
  124. package/es/components/viewer2d/area.js +81 -0
  125. package/es/components/viewer2d/export.js +31 -0
  126. package/es/components/viewer2d/grids/grid-horizontal-streak.js +37 -0
  127. package/es/components/viewer2d/grids/grid-streak.js +37 -0
  128. package/es/components/viewer2d/grids/grid-vertical-streak.js +37 -0
  129. package/es/components/viewer2d/grids/grids.js +35 -0
  130. package/es/components/viewer2d/group.js +53 -0
  131. package/es/components/viewer2d/item.js +513 -0
  132. package/es/components/viewer2d/layer.js +164 -0
  133. package/es/components/viewer2d/line.js +882 -0
  134. package/es/components/viewer2d/ruler.js +100 -0
  135. package/es/components/viewer2d/rulerDist.js +146 -0
  136. package/es/components/viewer2d/rulerX.js +151 -0
  137. package/es/components/viewer2d/rulerY.js +153 -0
  138. package/es/components/viewer2d/scene.js +140 -0
  139. package/es/components/viewer2d/snap.js +74 -0
  140. package/es/components/viewer2d/state.js +78 -0
  141. package/es/components/viewer2d/utils.js +198 -0
  142. package/es/components/viewer2d/vertex.js +65 -0
  143. package/es/components/viewer2d/viewer2d.js +1398 -0
  144. package/es/components/viewer3d/camera-controls-module/camera-controls.module.js +2592 -0
  145. package/es/components/viewer3d/dcm.js +401 -0
  146. package/es/components/viewer3d/fbm.js +414 -0
  147. package/es/components/viewer3d/front3D.js +66 -0
  148. package/es/components/viewer3d/grid-creator.js +25 -0
  149. package/es/components/viewer3d/grids/grid-horizontal-streak.js +36 -0
  150. package/es/components/viewer3d/grids/grid-streak.js +27 -0
  151. package/es/components/viewer3d/grids/grid-vertical-streak.js +36 -0
  152. package/es/components/viewer3d/libs/first-person-controls.js +67 -0
  153. package/es/components/viewer3d/libs/helvetiker_regular.typeface.js +1281 -0
  154. package/es/components/viewer3d/libs/mtl-loader.js +357 -0
  155. package/es/components/viewer3d/libs/obj-loader.js +462 -0
  156. package/es/components/viewer3d/libs/orbit-controls.js +699 -0
  157. package/es/components/viewer3d/libs/pointer-lock-controls.js +46 -0
  158. package/es/components/viewer3d/lrm.js +305 -0
  159. package/es/components/viewer3d/model.js +708 -0
  160. package/es/components/viewer3d/pointer-lock-navigation.js +115 -0
  161. package/es/components/viewer3d/ruler-utils/itemRect.js +61 -0
  162. package/es/components/viewer3d/ruler-utils/layer3D.js +495 -0
  163. package/es/components/viewer3d/ruler-utils/ruler3D.js +227 -0
  164. package/es/components/viewer3d/ruler-utils/scene3D.js +60 -0
  165. package/es/components/viewer3d/ruler-utils/state3D.js +18 -0
  166. package/es/components/viewer3d/scene-creator.js +3608 -0
  167. package/es/components/viewer3d/three-memory-cleaner.js +51 -0
  168. package/es/components/viewer3d/viewer3d-first-person.js +315 -0
  169. package/es/components/viewer3d/viewer3d.js +2527 -0
  170. package/es/constants.js +636 -0
  171. package/es/index.js +16 -0
  172. package/es/models.js +510 -0
  173. package/es/plugins/SVGLoader.js +1412 -0
  174. package/es/plugins/autosave.js +33 -0
  175. package/es/plugins/console-debugger.js +37 -0
  176. package/es/plugins/export.js +9 -0
  177. package/es/plugins/keyboard.js +101 -0
  178. package/es/reducers/areas-reducer.js +12 -0
  179. package/es/reducers/export.js +25 -0
  180. package/es/reducers/groups-reducer.js +38 -0
  181. package/es/reducers/holes-reducer.js +62 -0
  182. package/es/reducers/items-reducer.js +140 -0
  183. package/es/reducers/lines-reducer.js +45 -0
  184. package/es/reducers/project-reducer.js +129 -0
  185. package/es/reducers/reducer.js +19 -0
  186. package/es/reducers/scene-reducer.js +28 -0
  187. package/es/reducers/user-reducer.js +40 -0
  188. package/es/reducers/vertices-reducer.js +19 -0
  189. package/es/reducers/viewer2d-reducer.js +75 -0
  190. package/es/reducers/viewer3d-reducer.js +56 -0
  191. package/es/shared-style.js +66 -0
  192. package/es/styles/export.js +5 -0
  193. package/es/styles/tabs.css +40 -0
  194. package/es/translator/en.js +104 -0
  195. package/es/translator/it.js +79 -0
  196. package/es/translator/ru.js +79 -0
  197. package/es/translator/translator.js +84 -0
  198. package/es/utils/browser.js +33 -0
  199. package/es/utils/email-validator.js +4 -0
  200. package/es/utils/export.js +25 -0
  201. package/es/utils/geometry.js +2420 -0
  202. package/es/utils/get-edges-of-subgraphs.js +27 -0
  203. package/es/utils/graph-cycles.js +237 -0
  204. package/es/utils/graph-inner-cycles.js +46 -0
  205. package/es/utils/graph.js +150 -0
  206. package/es/utils/helper.js +268 -0
  207. package/es/utils/history.js +29 -0
  208. package/es/utils/id-broker.js +19 -0
  209. package/es/utils/logger.js +8 -0
  210. package/es/utils/math.js +50 -0
  211. package/es/utils/molding.js +871 -0
  212. package/es/utils/name-generator.js +18 -0
  213. package/es/utils/objects-utils.js +50 -0
  214. package/es/utils/phone-validator.js +4 -0
  215. package/es/utils/process-black-list.js +18 -0
  216. package/es/utils/react-if.js +18 -0
  217. package/es/utils/snap-scene.js +99 -0
  218. package/es/utils/snap.js +237 -0
  219. package/es/utils/summarizeCart.js +24 -0
  220. package/es/utils/threeCSG.es6.js +498 -0
  221. package/es/version.js +2 -0
  222. package/lib/catalog/properties/property-string.js +55 -0
  223. package/lib/catalog/properties/property-toggle.js +46 -0
  224. package/lib/catalog/properties/shared-property-style.js +20 -0
  225. package/lib/catalog/utils/FuseUtils.js +88 -0
  226. package/lib/catalog/utils/exporter.js +155 -0
  227. package/lib/catalog/utils/geom-utils.js +205 -0
  228. package/lib/catalog/utils/item-loader.js +1533 -0
  229. package/lib/catalog/utils/load-obj.js +99 -0
  230. package/lib/catalog/utils/mtl-loader.js +363 -0
  231. package/lib/catalog/utils/obj-loader.js +482 -0
  232. package/lib/class/FuseUtils.js +88 -0
  233. package/lib/class/area.js +150 -0
  234. package/lib/class/export.js +96 -0
  235. package/lib/class/group.js +445 -0
  236. package/lib/class/guide.js +67 -0
  237. package/lib/class/hole.js +934 -0
  238. package/lib/class/item.js +1889 -0
  239. package/lib/class/layer.js +672 -0
  240. package/lib/class/line.js +1186 -0
  241. package/lib/class/project.js +799 -0
  242. package/lib/class/vertex.js +207 -0
  243. package/lib/components/content.js +116 -0
  244. package/lib/components/disclaimer/disclaimer.js +105 -0
  245. package/lib/components/export.js +33 -0
  246. package/lib/components/style/button.js +120 -0
  247. package/lib/components/style/cancel-button.js +29 -0
  248. package/lib/components/style/content-container.js +40 -0
  249. package/lib/components/style/content-title.js +37 -0
  250. package/lib/components/style/delete-button.js +34 -0
  251. package/lib/components/style/export.js +121 -0
  252. package/lib/components/style/form-block.js +31 -0
  253. package/lib/components/style/form-color-input.js +34 -0
  254. package/lib/components/style/form-label.js +33 -0
  255. package/lib/components/style/form-number-input.js +220 -0
  256. package/lib/components/style/form-number-input_2.js +213 -0
  257. package/lib/components/style/form-select.js +75 -0
  258. package/lib/components/style/form-slider.js +68 -0
  259. package/lib/components/style/form-submit-button.js +35 -0
  260. package/lib/components/style/form-text-input.js +101 -0
  261. package/lib/components/viewer2d/area.js +88 -0
  262. package/lib/components/viewer2d/export.js +121 -0
  263. package/lib/components/viewer2d/grids/grid-horizontal-streak.js +44 -0
  264. package/lib/components/viewer2d/grids/grid-streak.js +44 -0
  265. package/lib/components/viewer2d/grids/grid-vertical-streak.js +44 -0
  266. package/lib/components/viewer2d/grids/grids.js +44 -0
  267. package/lib/components/viewer2d/group.js +62 -0
  268. package/lib/components/viewer2d/item.js +521 -0
  269. package/lib/components/viewer2d/layer.js +171 -0
  270. package/lib/components/viewer2d/line.js +892 -0
  271. package/lib/components/viewer2d/ruler.js +107 -0
  272. package/lib/components/viewer2d/rulerDist.js +153 -0
  273. package/lib/components/viewer2d/rulerX.js +158 -0
  274. package/lib/components/viewer2d/rulerY.js +160 -0
  275. package/lib/components/viewer2d/scene.js +147 -0
  276. package/lib/components/viewer2d/snap.js +83 -0
  277. package/lib/components/viewer2d/state.js +87 -0
  278. package/lib/components/viewer2d/utils.js +210 -0
  279. package/lib/components/viewer2d/vertex.js +74 -0
  280. package/lib/components/viewer2d/viewer2d.js +1405 -0
  281. package/lib/components/viewer3d/camera-controls-module/camera-controls.module.js +2597 -0
  282. package/lib/components/viewer3d/dcm.js +407 -0
  283. package/lib/components/viewer3d/fbm.js +420 -0
  284. package/lib/components/viewer3d/front3D.js +75 -0
  285. package/lib/components/viewer3d/grid-creator.js +34 -0
  286. package/lib/components/viewer3d/grids/grid-horizontal-streak.js +44 -0
  287. package/lib/components/viewer3d/grids/grid-streak.js +35 -0
  288. package/lib/components/viewer3d/grids/grid-vertical-streak.js +44 -0
  289. package/lib/components/viewer3d/libs/first-person-controls.js +74 -0
  290. package/lib/components/viewer3d/libs/helvetiker_regular.typeface.js +1287 -0
  291. package/lib/components/viewer3d/libs/mtl-loader.js +363 -0
  292. package/lib/components/viewer3d/libs/obj-loader.js +468 -0
  293. package/lib/components/viewer3d/libs/orbit-controls.js +705 -0
  294. package/lib/components/viewer3d/libs/pointer-lock-controls.js +52 -0
  295. package/lib/components/viewer3d/lrm.js +311 -0
  296. package/lib/components/viewer3d/model.js +714 -0
  297. package/lib/components/viewer3d/pointer-lock-navigation.js +122 -0
  298. package/lib/components/viewer3d/ruler-utils/itemRect.js +68 -0
  299. package/lib/components/viewer3d/ruler-utils/layer3D.js +502 -0
  300. package/lib/components/viewer3d/ruler-utils/ruler3D.js +234 -0
  301. package/lib/components/viewer3d/ruler-utils/scene3D.js +68 -0
  302. package/lib/components/viewer3d/ruler-utils/state3D.js +25 -0
  303. package/lib/components/viewer3d/scene-creator.js +3642 -0
  304. package/lib/components/viewer3d/three-memory-cleaner.js +60 -0
  305. package/lib/components/viewer3d/viewer3d-first-person.js +320 -0
  306. package/lib/components/viewer3d/viewer3d.js +2532 -0
  307. package/lib/constants.js +645 -0
  308. package/lib/index.js +96 -0
  309. package/lib/models.js +517 -0
  310. package/lib/plugins/SVGLoader.js +1417 -0
  311. package/lib/plugins/autosave.js +39 -0
  312. package/lib/plugins/console-debugger.js +44 -0
  313. package/lib/plugins/export.js +33 -0
  314. package/lib/plugins/keyboard.js +107 -0
  315. package/lib/reducers/areas-reducer.js +18 -0
  316. package/lib/reducers/export.js +97 -0
  317. package/lib/reducers/groups-reducer.js +44 -0
  318. package/lib/reducers/holes-reducer.js +68 -0
  319. package/lib/reducers/items-reducer.js +146 -0
  320. package/lib/reducers/lines-reducer.js +51 -0
  321. package/lib/reducers/project-reducer.js +135 -0
  322. package/lib/reducers/reducer.js +26 -0
  323. package/lib/reducers/scene-reducer.js +34 -0
  324. package/lib/reducers/user-reducer.js +46 -0
  325. package/lib/reducers/vertices-reducer.js +25 -0
  326. package/lib/reducers/viewer2d-reducer.js +82 -0
  327. package/lib/reducers/viewer3d-reducer.js +63 -0
  328. package/lib/shared-style.js +72 -0
  329. package/lib/styles/export.js +13 -0
  330. package/lib/translator/en.js +110 -0
  331. package/lib/translator/it.js +85 -0
  332. package/lib/translator/ru.js +85 -0
  333. package/lib/translator/translator.js +90 -0
  334. package/lib/utils/browser.js +40 -0
  335. package/lib/utils/email-validator.js +10 -0
  336. package/lib/utils/export.js +56 -0
  337. package/lib/utils/geometry.js +2516 -0
  338. package/lib/utils/get-edges-of-subgraphs.js +34 -0
  339. package/lib/utils/graph-cycles.js +240 -0
  340. package/lib/utils/graph-inner-cycles.js +54 -0
  341. package/lib/utils/graph.js +157 -0
  342. package/lib/utils/helper.js +291 -0
  343. package/lib/utils/history.js +36 -0
  344. package/lib/utils/id-broker.js +25 -0
  345. package/lib/utils/logger.js +14 -0
  346. package/lib/utils/math.js +57 -0
  347. package/lib/utils/molding.js +895 -0
  348. package/lib/utils/name-generator.js +23 -0
  349. package/lib/utils/objects-utils.js +60 -0
  350. package/lib/utils/phone-validator.js +10 -0
  351. package/lib/utils/process-black-list.js +24 -0
  352. package/lib/utils/react-if.js +24 -0
  353. package/lib/utils/snap-scene.js +105 -0
  354. package/lib/utils/snap.js +249 -0
  355. package/lib/utils/summarizeCart.js +30 -0
  356. package/lib/utils/threeCSG.es6.js +503 -0
  357. package/lib/version.js +8 -0
  358. package/package.json +3 -3
@@ -0,0 +1,100 @@
1
+ import React from 'react';
2
+ import PropTypes from 'prop-types';
3
+ import convert from 'convert-units';
4
+ import IDBroker from "../../utils/id-broker";
5
+ import { FormNumberInput2 } from "../style/export";
6
+ import { LINE_THICKNESS, SHADE_LIGHT_BLUE_COLOR, TEXT_COLOR_NEUTRAL_7 } from "../../constants";
7
+ var STYLE = {
8
+ stroke: TEXT_COLOR_NEUTRAL_7,
9
+ strokeWidth: '1px'
10
+ };
11
+ var BACKGROUNDSTYLE = {
12
+ fill: 'transparent',
13
+ fillOpacity: 0.8
14
+ };
15
+ var STYLE_TEXT = {
16
+ textAnchor: 'middle',
17
+ fontSize: '12px',
18
+ pointerEvents: 'none',
19
+ //http://stackoverflow.com/questions/826782/how-to-disable-text-selection-highlighting-using-css
20
+ WebkitTouchCallout: 'none' /* iOS Safari */,
21
+ WebkitUserSelect: 'none' /* Chrome/Safari/Opera */,
22
+ MozUserSelect: 'none' /* Firefox */,
23
+ MsUserSelect: 'none' /* Internet Explorer/Edge */,
24
+ userSelect: 'none'
25
+ };
26
+ export default function Ruler(_ref) {
27
+ var layer = _ref.layer,
28
+ length = _ref.length,
29
+ unit = _ref.unit,
30
+ rulerUnit = _ref.rulerUnit,
31
+ transform = _ref.transform,
32
+ flag = _ref.flag;
33
+ var update = function update(lengthInput, unitInput, type) {
34
+ var newLength = toFixedFloat(lengthInput);
35
+ var merged = null;
36
+ if (type === 0) {
37
+ merged = value.merge({
38
+ _length: newLength,
39
+ length: convert(newLength).from(unitInput).to('cm')
40
+ });
41
+ } else {
42
+ merged = value.merge({
43
+ _length: convert(newLength).from(UNIT_INCH).to(unitInput),
44
+ _unit: unitInput
45
+ });
46
+ }
47
+ // if (hook) {
48
+ // return hook(merged, sourceElement, internalState, state).then(val => {
49
+ // return onUpdate(val);
50
+ // });
51
+ // }
52
+ // return onUpdate(merged);
53
+ };
54
+ // let _unit = "in";
55
+ // let distanceText = convert(length).from(unit).to(rulerUnit);
56
+ var distanceText = convert(length).from(unit).to(rulerUnit).toFixed(0);
57
+ var thickness = convert(LINE_THICKNESS).from(unit).to(rulerUnit).toFixed(0);
58
+ // let _ft_len = convert(_length).from('in').to('ft');
59
+ // let _ft_val = Math.floor(_ft_len); _ft_len -= _ft_val;
60
+ // let _in_val = convert(_ft_len).from('ft').to('in').toFixed(0);
61
+ // let distanceText = `${_ft_val}'${_in_val}"`;
62
+ var textLength = (distanceText.length + layer.unit.length) * 18;
63
+ return /*#__PURE__*/React.createElement("g", {
64
+ transform: transform
65
+ }, /*#__PURE__*/React.createElement("g", {
66
+ id: "ruler"
67
+ }, /*#__PURE__*/React.createElement("rect", {
68
+ id: "ruler_rect_".concat(IDBroker.acquireID()),
69
+ style: BACKGROUNDSTYLE,
70
+ x: length / 2 - textLength / 2,
71
+ y: "-10",
72
+ width: textLength,
73
+ height: "22",
74
+ rx: "1",
75
+ ry: "0.39"
76
+ }), /*#__PURE__*/React.createElement("text", {
77
+ x: length / 2,
78
+ y: "3",
79
+ transform: "scale(1, -1)",
80
+ style: STYLE_TEXT,
81
+ fill: TEXT_COLOR_NEUTRAL_7
82
+ }, Math.round(convert(distanceText).from('in').to(layer.unit) * 100) / 100, layer.unit === 'in' ? '"' : layer.unit)), /*#__PURE__*/React.createElement("line", {
83
+ x1: "0",
84
+ y1: "0",
85
+ x2: (length - textLength) / 2 < 0 ? 0 : (length - textLength) / 2,
86
+ y2: "0",
87
+ style: STYLE
88
+ }), /*#__PURE__*/React.createElement("line", {
89
+ x1: (length + textLength) / 2 < 0 ? 0 : (length + textLength) / 2 < length ? (length + textLength) / 2 : length,
90
+ y1: "0",
91
+ x2: length,
92
+ y2: "0",
93
+ style: STYLE
94
+ }));
95
+ }
96
+ Ruler.propTypes = {
97
+ length: PropTypes.number.isRequired,
98
+ unit: PropTypes.string.isRequired,
99
+ transform: PropTypes.string.isRequired
100
+ };
@@ -0,0 +1,146 @@
1
+ import React from 'react';
2
+ import PropTypes from 'prop-types';
3
+ import convert from 'convert-units';
4
+ var ARROW_STYLE = {
5
+ stroke: '#1183B7',
6
+ strokeWidth: '2px',
7
+ strokeLinecap: 'round'
8
+ };
9
+ var STYLE = {
10
+ stroke: 'black',
11
+ strokeWidth: '1.1px'
12
+ };
13
+ var STYLE_TEXT = {
14
+ textAnchor: 'middle',
15
+ fontSize: '10px',
16
+ pointerEvents: 'none',
17
+ //http://stackoverflow.com/questions/826782/how-to-disable-text-selection-highlighting-using-css
18
+ WebkitTouchCallout: 'none' /* iOS Safari */,
19
+ WebkitUserSelect: 'none' /* Chrome/Safari/Opera */,
20
+ MozUserSelect: 'none' /* Firefox */,
21
+ MsUserSelect: 'none' /* Internet Explorer/Edge */,
22
+ userSelect: 'none'
23
+ };
24
+ export default function RulerDist(_ref) {
25
+ var layer = _ref.layer,
26
+ length = _ref.length,
27
+ unit = _ref.unit,
28
+ rulerUnit = _ref.rulerUnit,
29
+ transform = _ref.transform,
30
+ angle = _ref.angle,
31
+ rotation = _ref.rotation;
32
+ var _unit = 'in';
33
+ // let _length = convert(length).from(unit).to(rulerUnit);
34
+ var distanceText = "".concat(convert(length).from('cm').to(rulerUnit).toFixed(0));
35
+ var textLength = (distanceText.length + layer.unit.length) * 18;
36
+ var textangle = angle + 90;
37
+ var textRotation = 1;
38
+ var ay = 2;
39
+ var ep = Math.sin(textangle * Math.PI / 180);
40
+ var es = Math.sin(angle * Math.PI / 180);
41
+ if (rotation === 180 && ep >= 0) {
42
+ textRotation = 180;
43
+ ay = 5;
44
+ } else if (rotation === 180 && ep <= 0) {
45
+ textRotation = 0;
46
+ ay = -3;
47
+ } else if (rotation === 0 && ep >= 0) {
48
+ textRotation = 0;
49
+ ay = -3;
50
+ } else if (rotation === 0 && ep <= 0) {
51
+ textRotation = 180;
52
+ ay = 5;
53
+ }
54
+ if (rotation === 90 && es >= 0) {
55
+ textRotation = 180;
56
+ ay = 5;
57
+ } else if (rotation === 90 && es <= 0) {
58
+ textRotation = 0;
59
+ ay = -3;
60
+ } else if (rotation === -90 && es >= 0) {
61
+ textRotation = 0;
62
+ ay = -3;
63
+ } else if (rotation === -90 && es <= 0) {
64
+ textRotation = 180;
65
+ ay = 5;
66
+ }
67
+ if (Math.abs(length - textLength) / 2 <= 16) {
68
+ var dy = textRotation == 0 ? 15 : -15;
69
+ return /*#__PURE__*/React.createElement("g", {
70
+ transform: transform
71
+ }, /*#__PURE__*/React.createElement("g", {
72
+ transform: "translate(0, ".concat(dy, ")")
73
+ }, /*#__PURE__*/React.createElement("text", {
74
+ x: "0",
75
+ y: "0",
76
+ transform: "translate(".concat(length / 2, ",").concat(ay, ") scale(1, -1) rotate(").concat(textRotation, ")"),
77
+ style: STYLE_TEXT
78
+ }, Math.round(convert(distanceText).from('in').to(layer.unit) * 100) / 100, layer.unit)), /*#__PURE__*/React.createElement("circle", {
79
+ cx: "1",
80
+ cy: "0",
81
+ fill: "white",
82
+ r: "1.1",
83
+ stroke: "black",
84
+ strokeWidth: "0.6"
85
+ }), /*#__PURE__*/React.createElement("line", {
86
+ x1: "2",
87
+ y1: "0",
88
+ x2: (length - textLength) / 2 < 0 ? 0 : length,
89
+ y2: "0",
90
+ style: STYLE
91
+ }), /*#__PURE__*/React.createElement("line", {
92
+ x1: (length + textLength) / 2 < 0 ? 0 : (length + textLength) / 2 < length ? (length + textLength) / 2 : length,
93
+ y1: "0",
94
+ x2: length,
95
+ y2: "0",
96
+ style: STYLE
97
+ }), /*#__PURE__*/React.createElement("circle", {
98
+ cx: length - 1,
99
+ cy: "0",
100
+ fill: "white",
101
+ r: "1.1",
102
+ stroke: "black",
103
+ strokeWidth: "0.6"
104
+ }));
105
+ } else {
106
+ return /*#__PURE__*/React.createElement("g", {
107
+ transform: transform
108
+ }, /*#__PURE__*/React.createElement("g", null, /*#__PURE__*/React.createElement("text", {
109
+ x: "0",
110
+ y: "0",
111
+ transform: "translate(".concat(length / 2, ",").concat(ay, ") scale(1, -1) rotate(").concat(textRotation, ")"),
112
+ style: STYLE_TEXT
113
+ }, Math.round(convert(distanceText).from('in').to(layer.unit) * 100) / 100, layer.unit)), /*#__PURE__*/React.createElement("circle", {
114
+ cx: "1",
115
+ cy: "0",
116
+ fill: "white",
117
+ r: "1.1",
118
+ stroke: "black",
119
+ strokeWidth: "0.6"
120
+ }), /*#__PURE__*/React.createElement("line", {
121
+ x1: "2",
122
+ y1: "0",
123
+ x2: (length - textLength) / 2 < 0 ? 0 : (length - textLength) / 2,
124
+ y2: "0",
125
+ style: STYLE
126
+ }), /*#__PURE__*/React.createElement("line", {
127
+ x1: (length + textLength) / 2 < 0 ? 0 : (length + textLength) / 2 < length ? (length + textLength) / 2 : length,
128
+ y1: "0",
129
+ x2: length,
130
+ y2: "0",
131
+ style: STYLE
132
+ }), /*#__PURE__*/React.createElement("circle", {
133
+ cx: length - 1,
134
+ cy: "0",
135
+ fill: "white",
136
+ r: "1.1",
137
+ stroke: "black",
138
+ strokeWidth: "0.6"
139
+ }));
140
+ }
141
+ }
142
+ RulerDist.propTypes = {
143
+ length: PropTypes.number.isRequired,
144
+ unit: PropTypes.string.isRequired,
145
+ transform: PropTypes.string.isRequired
146
+ };
@@ -0,0 +1,151 @@
1
+ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
2
+ function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
3
+ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
4
+ function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
5
+ function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
6
+ function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } }
7
+ function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
8
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
9
+ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
10
+ function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
11
+ function _possibleConstructorReturn(t, e) { if (e && ("object" == _typeof(e) || "function" == typeof e)) return e; if (void 0 !== e) throw new TypeError("Derived constructors may only return object or undefined"); return _assertThisInitialized(t); }
12
+ function _assertThisInitialized(e) { if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); return e; }
13
+ function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
14
+ function _getPrototypeOf(t) { return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) { return t.__proto__ || Object.getPrototypeOf(t); }, _getPrototypeOf(t); }
15
+ function _inherits(t, e) { if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function"); t.prototype = Object.create(e && e.prototype, { constructor: { value: t, writable: !0, configurable: !0 } }), Object.defineProperty(t, "prototype", { writable: !1 }), e && _setPrototypeOf(t, e); }
16
+ function _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); }
17
+ import React, { Component } from 'react';
18
+ import PropTypes from 'prop-types';
19
+ import * as SharedStyle from "../../shared-style";
20
+ var RulerX = /*#__PURE__*/function (_Component) {
21
+ function RulerX(props, context) {
22
+ _classCallCheck(this, RulerX);
23
+ return _callSuper(this, RulerX, [props, context]);
24
+ }
25
+ _inherits(RulerX, _Component);
26
+ return _createClass(RulerX, [{
27
+ key: "render",
28
+ value: function render() {
29
+ var elementW = this.props.unitPixelSize * this.props.zoom;
30
+ var elementStyle = {
31
+ display: 'inline-block',
32
+ width: elementW,
33
+ position: 'relative',
34
+ borderLeft: '1px solid ' + this.props.fontColor,
35
+ paddingLeft: '0.2em',
36
+ fontSize: '10px',
37
+ height: '100%'
38
+ };
39
+ var insideElementsStyle = {
40
+ width: '20%',
41
+ display: 'inline-block',
42
+ margin: 0,
43
+ padding: 0
44
+ };
45
+ var rulerStyle = {
46
+ backgroundColor: this.props.backgroundColor,
47
+ position: 'relative',
48
+ width: this.props.width,
49
+ height: '100%',
50
+ color: this.props.fontColor
51
+ };
52
+ var markerStyle = {
53
+ position: 'absolute',
54
+ left: this.props.zeroLeftPosition + this.props.mouseX * this.props.zoom - 6.5,
55
+ top: 8,
56
+ width: 0,
57
+ height: 0,
58
+ borderLeft: '5px solid transparent',
59
+ borderRight: '5px solid transparent',
60
+ borderTop: '8px solid ' + this.props.markerColor,
61
+ zIndex: 9001
62
+ };
63
+ var rulerContainer = {
64
+ position: 'absolute',
65
+ height: '10px',
66
+ top: '4px',
67
+ display: 'grid',
68
+ gridRowGap: '0',
69
+ gridColumnGap: '0',
70
+ gridTemplateRows: '100%',
71
+ grdAutoColumns: "".concat(elementW, "px")
72
+ };
73
+ var positiveRulerContainer = _objectSpread(_objectSpread({}, rulerContainer), {}, {
74
+ width: this.props.positiveUnitsNumber * elementW,
75
+ left: this.props.zeroLeftPosition
76
+ });
77
+ var negativeRulerContainer = _objectSpread(_objectSpread({}, rulerContainer), {}, {
78
+ width: this.props.negativeUnitsNumber * elementW,
79
+ left: this.props.zeroLeftPosition - this.props.negativeUnitsNumber * elementW
80
+ });
81
+ var positiveDomElements = [];
82
+ if (elementW <= 200) {
83
+ for (var x = 0; x < this.props.positiveUnitsNumber; x++) {
84
+ positiveDomElements.push(/*#__PURE__*/React.createElement("div", {
85
+ key: x,
86
+ style: _objectSpread(_objectSpread({}, elementStyle), {}, {
87
+ gridColumn: x + 1,
88
+ gridRow: 1
89
+ })
90
+ }, elementW > 30 ? x * 100 : ''));
91
+ }
92
+ } else if (elementW > 200) {
93
+ for (var _x = 0; _x < this.props.positiveUnitsNumber; _x++) {
94
+ var val = _x * 100;
95
+ positiveDomElements.push(/*#__PURE__*/React.createElement("div", {
96
+ key: _x,
97
+ style: _objectSpread(_objectSpread({}, elementStyle), {}, {
98
+ gridColumn: _x + 1,
99
+ gridRow: 1
100
+ })
101
+ }, /*#__PURE__*/React.createElement("div", {
102
+ style: insideElementsStyle
103
+ }, val), /*#__PURE__*/React.createElement("div", {
104
+ style: insideElementsStyle
105
+ }, val + 1 * 20), /*#__PURE__*/React.createElement("div", {
106
+ style: insideElementsStyle
107
+ }, val + 2 * 20), /*#__PURE__*/React.createElement("div", {
108
+ style: insideElementsStyle
109
+ }, val + 3 * 20), /*#__PURE__*/React.createElement("div", {
110
+ style: insideElementsStyle
111
+ }, val + 4 * 20)));
112
+ }
113
+ }
114
+ return /*#__PURE__*/React.createElement("div", {
115
+ style: rulerStyle
116
+ }, /*#__PURE__*/React.createElement("div", {
117
+ id: "horizontalMarker",
118
+ style: markerStyle
119
+ }), /*#__PURE__*/React.createElement("div", {
120
+ id: "negativeRuler",
121
+ style: negativeRulerContainer
122
+ }), /*#__PURE__*/React.createElement("div", {
123
+ id: "positiveRuler",
124
+ style: positiveRulerContainer
125
+ }, positiveDomElements));
126
+ }
127
+ }]);
128
+ }(Component);
129
+ export { RulerX as default };
130
+ RulerX.propTypes = {
131
+ unitPixelSize: PropTypes.number.isRequired,
132
+ positiveUnitsNumber: PropTypes.number,
133
+ negativeUnitsNumber: PropTypes.number,
134
+ zoom: PropTypes.number.isRequired,
135
+ mouseX: PropTypes.number.isRequired,
136
+ width: PropTypes.number.isRequired,
137
+ zeroLeftPosition: PropTypes.number.isRequired,
138
+ backgroundColor: PropTypes.string,
139
+ fontColor: PropTypes.string,
140
+ markerColor: PropTypes.string
141
+ };
142
+ RulerX.defaultProps = {
143
+ positiveUnitsNumber: 50,
144
+ negativeUnitsNumber: 50,
145
+ backgroundColor: SharedStyle.PRIMARY_COLOR.main,
146
+ fontColor: SharedStyle.COLORS.white,
147
+ markerColor: SharedStyle.SECONDARY_COLOR.main
148
+ };
149
+ RulerX.contextTypes = {
150
+ translator: PropTypes.object.isRequired
151
+ };
@@ -0,0 +1,153 @@
1
+ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
2
+ function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
3
+ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
4
+ function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
5
+ function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
6
+ function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } }
7
+ function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
8
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
9
+ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
10
+ function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
11
+ function _possibleConstructorReturn(t, e) { if (e && ("object" == _typeof(e) || "function" == typeof e)) return e; if (void 0 !== e) throw new TypeError("Derived constructors may only return object or undefined"); return _assertThisInitialized(t); }
12
+ function _assertThisInitialized(e) { if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); return e; }
13
+ function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
14
+ function _getPrototypeOf(t) { return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) { return t.__proto__ || Object.getPrototypeOf(t); }, _getPrototypeOf(t); }
15
+ function _inherits(t, e) { if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function"); t.prototype = Object.create(e && e.prototype, { constructor: { value: t, writable: !0, configurable: !0 } }), Object.defineProperty(t, "prototype", { writable: !1 }), e && _setPrototypeOf(t, e); }
16
+ function _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); }
17
+ import React, { Component } from 'react';
18
+ import PropTypes from 'prop-types';
19
+ import * as SharedStyle from "../../shared-style";
20
+ var RulerY = /*#__PURE__*/function (_Component) {
21
+ function RulerY(props, context) {
22
+ _classCallCheck(this, RulerY);
23
+ return _callSuper(this, RulerY, [props, context]);
24
+ }
25
+ _inherits(RulerY, _Component);
26
+ return _createClass(RulerY, [{
27
+ key: "render",
28
+ value: function render() {
29
+ var elementH = this.props.unitPixelSize * this.props.zoom;
30
+ var elementStyle = {
31
+ width: '8px',
32
+ borderBottom: '1px solid ' + this.props.fontColor,
33
+ paddingBottom: '0.2em',
34
+ fontSize: '10px',
35
+ height: elementH,
36
+ textOrientation: 'upright',
37
+ writingMode: 'vertical-lr',
38
+ letterSpacing: '-2px',
39
+ textAlign: 'right'
40
+ };
41
+ var insideElementsStyle = {
42
+ height: '20%',
43
+ width: '100%',
44
+ textOrientation: 'upright',
45
+ writingMode: 'vertical-lr',
46
+ display: 'inline-block',
47
+ letterSpacing: '-2px',
48
+ textAlign: 'right'
49
+ };
50
+ var rulerStyle = {
51
+ backgroundColor: this.props.backgroundColor,
52
+ height: this.props.height,
53
+ width: '100%',
54
+ color: this.props.fontColor
55
+ };
56
+ var markerStyle = {
57
+ position: 'absolute',
58
+ top: this.props.zeroTopPosition - this.props.mouseY * this.props.zoom - 6.5,
59
+ left: 8,
60
+ width: 0,
61
+ height: 0,
62
+ borderTop: '5px solid transparent',
63
+ borderBottom: '5px solid transparent',
64
+ borderLeft: '8px solid ' + this.props.markerColor,
65
+ zIndex: 9001
66
+ };
67
+ var rulerContainer = {
68
+ position: 'absolute',
69
+ width: '100%',
70
+ display: 'grid',
71
+ gridRowGap: '0',
72
+ gridColumnGap: '0',
73
+ gridTemplateColumns: '100%',
74
+ grdAutoRows: "".concat(elementH, "px"),
75
+ paddingLeft: '5px'
76
+ };
77
+ var positiveRulerContainer = _objectSpread(_objectSpread({}, rulerContainer), {}, {
78
+ top: this.props.zeroTopPosition - this.props.positiveUnitsNumber * elementH,
79
+ height: this.props.positiveUnitsNumber * elementH
80
+ });
81
+ var negativeRulerContainer = _objectSpread(_objectSpread({}, rulerContainer), {}, {
82
+ top: this.props.zeroTopPosition + this.props.negativeUnitsNumber * elementH,
83
+ height: this.props.negativeUnitsNumber * elementH
84
+ });
85
+ var positiveDomElements = [];
86
+ if (elementH <= 200) {
87
+ for (var x = 1; x <= this.props.positiveUnitsNumber; x++) {
88
+ positiveDomElements.push(/*#__PURE__*/React.createElement("div", {
89
+ key: x,
90
+ style: _objectSpread(_objectSpread({}, elementStyle), {}, {
91
+ gridColumn: 1,
92
+ gridRow: x
93
+ })
94
+ }, elementH > 30 ? (this.props.positiveUnitsNumber - x) * 100 : ''));
95
+ }
96
+ } else if (elementH > 200) {
97
+ for (var _x = 1; _x <= this.props.positiveUnitsNumber; _x++) {
98
+ var val = (this.props.positiveUnitsNumber - _x) * 100;
99
+ positiveDomElements.push(/*#__PURE__*/React.createElement("div", {
100
+ key: _x,
101
+ style: _objectSpread(_objectSpread({}, elementStyle), {}, {
102
+ gridColumn: 1,
103
+ gridRow: _x
104
+ })
105
+ }, /*#__PURE__*/React.createElement("div", {
106
+ style: insideElementsStyle
107
+ }, val + 4 * 20), /*#__PURE__*/React.createElement("div", {
108
+ style: insideElementsStyle
109
+ }, val + 3 * 20), /*#__PURE__*/React.createElement("div", {
110
+ style: insideElementsStyle
111
+ }, val + 2 * 20), /*#__PURE__*/React.createElement("div", {
112
+ style: insideElementsStyle
113
+ }, val + 1 * 20), /*#__PURE__*/React.createElement("div", {
114
+ style: insideElementsStyle
115
+ }, val)));
116
+ }
117
+ }
118
+ return /*#__PURE__*/React.createElement("div", {
119
+ style: rulerStyle
120
+ }, /*#__PURE__*/React.createElement("div", {
121
+ id: "verticalMarker",
122
+ style: markerStyle
123
+ }), /*#__PURE__*/React.createElement("div", {
124
+ id: "negativeRuler",
125
+ style: negativeRulerContainer
126
+ }), /*#__PURE__*/React.createElement("div", {
127
+ id: "positiveRuler",
128
+ style: positiveRulerContainer
129
+ }, positiveDomElements));
130
+ }
131
+ }]);
132
+ }(Component);
133
+ export { RulerY as default };
134
+ RulerY.propTypes = {
135
+ unitPixelSize: PropTypes.number.isRequired,
136
+ zoom: PropTypes.number.isRequired,
137
+ mouseY: PropTypes.number.isRequired,
138
+ height: PropTypes.number.isRequired,
139
+ zeroTopPosition: PropTypes.number.isRequired,
140
+ backgroundColor: PropTypes.string,
141
+ fontColor: PropTypes.string,
142
+ markerColor: PropTypes.string
143
+ };
144
+ RulerY.defaultProps = {
145
+ positiveUnitsNumber: 50,
146
+ negativeUnitsNumber: 50,
147
+ backgroundColor: SharedStyle.PRIMARY_COLOR.main,
148
+ fontColor: SharedStyle.COLORS.white,
149
+ markerColor: SharedStyle.SECONDARY_COLOR.main
150
+ };
151
+ RulerY.contextTypes = {
152
+ translator: PropTypes.object.isRequired
153
+ };