@datagrok/helm 2.3.2 → 2.3.3

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 (323) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/dist/package-test.js +1 -1
  3. package/dist/package-test.js.map +1 -1
  4. package/dist/package.js +1 -1
  5. package/dist/package.js.map +1 -1
  6. package/package.json +4 -4
  7. package/src/cell-renderer.ts +5 -4
  8. package/src/helm-helper.ts +6 -6
  9. package/src/helm-monomer-placer.ts +1 -1
  10. package/src/helm-web-editor.ts +5 -5
  11. package/src/package-test.ts +0 -1
  12. package/src/package-utils.ts +228 -69
  13. package/src/package.ts +7 -69
  14. package/src/tests/findMonomers-tests.ts +2 -1
  15. package/src/tests/get-monomer-tests.ts +1 -49
  16. package/src/utils/get-monomer.ts +49 -1
  17. package/src/utils/helm-grid-cell-renderer.ts +8 -9
  18. package/src/utils/index.ts +2 -3
  19. package/src/widgets/helm-input.ts +4 -4
  20. package/vendor/dojo-1.10.10/dijit/BackgroundIframe.js +63 -0
  21. package/vendor/dojo-1.10.10/dijit/BackgroundIframe.js.uncompressed.js +116 -0
  22. package/vendor/dojo-1.10.10/dijit/Destroyable.js +35 -0
  23. package/vendor/dojo-1.10.10/dijit/Destroyable.js.uncompressed.js +83 -0
  24. package/vendor/dojo-1.10.10/dijit/Tooltip.js +240 -0
  25. package/vendor/dojo-1.10.10/dijit/Tooltip.js.uncompressed.js +612 -0
  26. package/vendor/dojo-1.10.10/dijit/Viewport.js +44 -0
  27. package/vendor/dojo-1.10.10/dijit/Viewport.js.uncompressed.js +87 -0
  28. package/vendor/dojo-1.10.10/dijit/WidgetSet.js +76 -0
  29. package/vendor/dojo-1.10.10/dijit/WidgetSet.js.uncompressed.js +247 -0
  30. package/vendor/dojo-1.10.10/dijit/_AttachMixin.js +94 -0
  31. package/vendor/dojo-1.10.10/dijit/_AttachMixin.js.uncompressed.js +238 -0
  32. package/vendor/dojo-1.10.10/dijit/_Contained.js +17 -0
  33. package/vendor/dojo-1.10.10/dijit/_Contained.js.uncompressed.js +56 -0
  34. package/vendor/dojo-1.10.10/dijit/_Container.js +47 -0
  35. package/vendor/dojo-1.10.10/dijit/_Container.js.uncompressed.js +108 -0
  36. package/vendor/dojo-1.10.10/dijit/_CssStateMixin.js +198 -0
  37. package/vendor/dojo-1.10.10/dijit/_CssStateMixin.js.uncompressed.js +372 -0
  38. package/vendor/dojo-1.10.10/dijit/_FocusMixin.js +11 -0
  39. package/vendor/dojo-1.10.10/dijit/_FocusMixin.js.uncompressed.js +66 -0
  40. package/vendor/dojo-1.10.10/dijit/_HasDropDown.js +188 -0
  41. package/vendor/dojo-1.10.10/dijit/_HasDropDown.js.uncompressed.js +472 -0
  42. package/vendor/dojo-1.10.10/dijit/_OnDijitClickMixin.js +8 -0
  43. package/vendor/dojo-1.10.10/dijit/_OnDijitClickMixin.js.uncompressed.js +31 -0
  44. package/vendor/dojo-1.10.10/dijit/_TemplatedMixin.js +90 -0
  45. package/vendor/dojo-1.10.10/dijit/_TemplatedMixin.js.uncompressed.js +205 -0
  46. package/vendor/dojo-1.10.10/dijit/_Widget.js +66 -0
  47. package/vendor/dojo-1.10.10/dijit/_Widget.js.uncompressed.js +352 -0
  48. package/vendor/dojo-1.10.10/dijit/_WidgetBase.js +353 -0
  49. package/vendor/dojo-1.10.10/dijit/_WidgetBase.js.uncompressed.js +1200 -0
  50. package/vendor/dojo-1.10.10/dijit/_base/focus.js +68 -0
  51. package/vendor/dojo-1.10.10/dijit/_base/focus.js.uncompressed.js +207 -0
  52. package/vendor/dojo-1.10.10/dijit/_base/manager.js +10 -0
  53. package/vendor/dojo-1.10.10/dijit/_base/manager.js.uncompressed.js +35 -0
  54. package/vendor/dojo-1.10.10/dijit/_base/place.js +52 -0
  55. package/vendor/dojo-1.10.10/dijit/_base/place.js.uncompressed.js +131 -0
  56. package/vendor/dojo-1.10.10/dijit/_base/popup.js +23 -0
  57. package/vendor/dojo-1.10.10/dijit/_base/popup.js.uncompressed.js +58 -0
  58. package/vendor/dojo-1.10.10/dijit/_base/scroll.js +6 -0
  59. package/vendor/dojo-1.10.10/dijit/_base/scroll.js.uncompressed.js +22 -0
  60. package/vendor/dojo-1.10.10/dijit/_base/sniff.js +3 -0
  61. package/vendor/dojo-1.10.10/dijit/_base/sniff.js.uncompressed.js +12 -0
  62. package/vendor/dojo-1.10.10/dijit/_base/typematic.js +3 -0
  63. package/vendor/dojo-1.10.10/dijit/_base/typematic.js.uncompressed.js +10 -0
  64. package/vendor/dojo-1.10.10/dijit/_base/wai.js +32 -0
  65. package/vendor/dojo-1.10.10/dijit/_base/wai.js.uncompressed.js +109 -0
  66. package/vendor/dojo-1.10.10/dijit/_base/window.js +6 -0
  67. package/vendor/dojo-1.10.10/dijit/_base/window.js.uncompressed.js +18 -0
  68. package/vendor/dojo-1.10.10/dijit/_base.js +4 -0
  69. package/vendor/dojo-1.10.10/dijit/a11y.js +109 -0
  70. package/vendor/dojo-1.10.10/dijit/a11y.js.uncompressed.js +191 -0
  71. package/vendor/dojo-1.10.10/dijit/a11yclick.js +66 -0
  72. package/vendor/dojo-1.10.10/dijit/a11yclick.js.uncompressed.js +139 -0
  73. package/vendor/dojo-1.10.10/dijit/focus.js +188 -0
  74. package/vendor/dojo-1.10.10/dijit/focus.js.uncompressed.js +371 -0
  75. package/vendor/dojo-1.10.10/dijit/form/Button.js +49 -0
  76. package/vendor/dojo-1.10.10/dijit/form/Button.js.uncompressed.js +130 -0
  77. package/vendor/dojo-1.10.10/dijit/form/ComboBox.js +4 -0
  78. package/vendor/dojo-1.10.10/dijit/form/ComboBox.js.uncompressed.js +27 -0
  79. package/vendor/dojo-1.10.10/dijit/form/ComboButton.js +21 -0
  80. package/vendor/dojo-1.10.10/dijit/form/ComboButton.js.uncompressed.js +86 -0
  81. package/vendor/dojo-1.10.10/dijit/form/DropDownButton.js +38 -0
  82. package/vendor/dojo-1.10.10/dijit/form/DropDownButton.js.uncompressed.js +102 -0
  83. package/vendor/dojo-1.10.10/dijit/form/ToggleButton.js +7 -0
  84. package/vendor/dojo-1.10.10/dijit/form/ToggleButton.js.uncompressed.js +26 -0
  85. package/vendor/dojo-1.10.10/dijit/form/_ButtonMixin.js +50 -0
  86. package/vendor/dojo-1.10.10/dijit/form/_ButtonMixin.js.uncompressed.js +116 -0
  87. package/vendor/dojo-1.10.10/dijit/form/_FormValueMixin.js +26 -0
  88. package/vendor/dojo-1.10.10/dijit/form/_FormValueMixin.js.uncompressed.js +81 -0
  89. package/vendor/dojo-1.10.10/dijit/form/_FormValueWidget.js +24 -0
  90. package/vendor/dojo-1.10.10/dijit/form/_FormValueWidget.js.uncompressed.js +51 -0
  91. package/vendor/dojo-1.10.10/dijit/form/_FormWidget.js +22 -0
  92. package/vendor/dojo-1.10.10/dijit/form/_FormWidget.js.uncompressed.js +67 -0
  93. package/vendor/dojo-1.10.10/dijit/form/_FormWidgetMixin.js +111 -0
  94. package/vendor/dojo-1.10.10/dijit/form/_FormWidgetMixin.js.uncompressed.js +254 -0
  95. package/vendor/dojo-1.10.10/dijit/form/_ToggleButtonMixin.js +32 -0
  96. package/vendor/dojo-1.10.10/dijit/form/_ToggleButtonMixin.js.uncompressed.js +69 -0
  97. package/vendor/dojo-1.10.10/dijit/hccss.js +9 -0
  98. package/vendor/dojo-1.10.10/dijit/hccss.js.uncompressed.js +21 -0
  99. package/vendor/dojo-1.10.10/dijit/layout/AccordionContainer.js +215 -0
  100. package/vendor/dojo-1.10.10/dijit/layout/AccordionContainer.js.uncompressed.js +550 -0
  101. package/vendor/dojo-1.10.10/dijit/layout/AccordionPane.js +7 -0
  102. package/vendor/dojo-1.10.10/dijit/layout/AccordionPane.js.uncompressed.js +25 -0
  103. package/vendor/dojo-1.10.10/dijit/layout/ContentPane.js +235 -0
  104. package/vendor/dojo-1.10.10/dijit/layout/ContentPane.js.uncompressed.js +653 -0
  105. package/vendor/dojo-1.10.10/dijit/layout/StackContainer.js +171 -0
  106. package/vendor/dojo-1.10.10/dijit/layout/StackContainer.js.uncompressed.js +411 -0
  107. package/vendor/dojo-1.10.10/dijit/layout/StackController.js +194 -0
  108. package/vendor/dojo-1.10.10/dijit/layout/StackController.js.uncompressed.js +410 -0
  109. package/vendor/dojo-1.10.10/dijit/layout/_ContentPaneResizeMixin.js +99 -0
  110. package/vendor/dojo-1.10.10/dijit/layout/_ContentPaneResizeMixin.js.uncompressed.js +236 -0
  111. package/vendor/dojo-1.10.10/dijit/layout/_LayoutWidget.js +47 -0
  112. package/vendor/dojo-1.10.10/dijit/layout/_LayoutWidget.js.uncompressed.js +190 -0
  113. package/vendor/dojo-1.10.10/dijit/layout/utils.js +77 -0
  114. package/vendor/dojo-1.10.10/dijit/layout/utils.js.uncompressed.js +151 -0
  115. package/vendor/dojo-1.10.10/dijit/main.js +4 -0
  116. package/vendor/dojo-1.10.10/dijit/main.js.uncompressed.js +16 -0
  117. package/vendor/dojo-1.10.10/dijit/nls/dijit-all_en-us.js +2 -0
  118. package/vendor/dojo-1.10.10/dijit/nls/dijit-all_en-us.js.uncompressed.js +21 -0
  119. package/vendor/dojo-1.10.10/dijit/nls/loading.js +2 -0
  120. package/vendor/dojo-1.10.10/dijit/nls/loading.js.uncompressed.js +47 -0
  121. package/vendor/dojo-1.10.10/dijit/place.js +142 -0
  122. package/vendor/dojo-1.10.10/dijit/place.js.uncompressed.js +407 -0
  123. package/vendor/dojo-1.10.10/dijit/popup.js +162 -0
  124. package/vendor/dojo-1.10.10/dijit/popup.js.uncompressed.js +441 -0
  125. package/vendor/dojo-1.10.10/dijit/registry.js +79 -0
  126. package/vendor/dojo-1.10.10/dijit/registry.js.uncompressed.js +159 -0
  127. package/vendor/dojo-1.10.10/dijit/selection.js +364 -0
  128. package/vendor/dojo-1.10.10/dijit/selection.js.uncompressed.js +525 -0
  129. package/vendor/dojo-1.10.10/dijit/typematic.js +96 -0
  130. package/vendor/dojo-1.10.10/dijit/typematic.js.uncompressed.js +211 -0
  131. package/vendor/dojo-1.10.10/dojo/NodeList-manipulate.js +195 -0
  132. package/vendor/dojo-1.10.10/dojo/NodeList-manipulate.js.uncompressed.js +761 -0
  133. package/vendor/dojo-1.10.10/dojo/Stateful.js +90 -0
  134. package/vendor/dojo-1.10.10/dojo/Stateful.js.uncompressed.js +218 -0
  135. package/vendor/dojo-1.10.10/dojo/_base/url.js +87 -0
  136. package/vendor/dojo-1.10.10/dojo/_base/url.js.uncompressed.js +109 -0
  137. package/vendor/dojo-1.10.10/dojo/cache.js +9 -0
  138. package/vendor/dojo-1.10.10/dojo/cache.js.uncompressed.js +7 -0
  139. package/vendor/dojo-1.10.10/dojo/colors.js +74 -0
  140. package/vendor/dojo-1.10.10/dojo/colors.js.uncompressed.js +232 -0
  141. package/vendor/dojo-1.10.10/dojo/cookie.js +48 -0
  142. package/vendor/dojo-1.10.10/dojo/cookie.js.uncompressed.js +98 -0
  143. package/vendor/dojo-1.10.10/dojo/date/stamp.js +82 -0
  144. package/vendor/dojo-1.10.10/dojo/date/stamp.js.uncompressed.js +144 -0
  145. package/vendor/dojo-1.10.10/dojo/dojo.js +7 -0
  146. package/vendor/dojo-1.10.10/dojo/dojo.js.uncompressed.js +18680 -0
  147. package/vendor/dojo-1.10.10/dojo/fx/Toggler.js +27 -0
  148. package/vendor/dojo-1.10.10/dojo/fx/Toggler.js.uncompressed.js +101 -0
  149. package/vendor/dojo-1.10.10/dojo/fx/easing.js +165 -0
  150. package/vendor/dojo-1.10.10/dojo/fx/easing.js.uncompressed.js +276 -0
  151. package/vendor/dojo-1.10.10/dojo/fx.js +271 -0
  152. package/vendor/dojo-1.10.10/dojo/fx.js.uncompressed.js +443 -0
  153. package/vendor/dojo-1.10.10/dojo/hccss.js +26 -0
  154. package/vendor/dojo-1.10.10/dojo/hccss.js.uncompressed.js +52 -0
  155. package/vendor/dojo-1.10.10/dojo/html.js +161 -0
  156. package/vendor/dojo-1.10.10/dojo/html.js.uncompressed.js +370 -0
  157. package/vendor/dojo-1.10.10/dojo/io/iframe.js +71 -0
  158. package/vendor/dojo-1.10.10/dojo/io/iframe.js.uncompressed.js +190 -0
  159. package/vendor/dojo-1.10.10/dojo/io/script.js +112 -0
  160. package/vendor/dojo-1.10.10/dojo/io/script.js.uncompressed.js +280 -0
  161. package/vendor/dojo-1.10.10/dojo/parser.js +437 -0
  162. package/vendor/dojo-1.10.10/dojo/parser.js.uncompressed.js +915 -0
  163. package/vendor/dojo-1.10.10/dojo/promise/all.js +59 -0
  164. package/vendor/dojo-1.10.10/dojo/promise/all.js.uncompressed.js +77 -0
  165. package/vendor/dojo-1.10.10/dojo/regexp.js +32 -0
  166. package/vendor/dojo-1.10.10/dojo/regexp.js.uncompressed.js +70 -0
  167. package/vendor/dojo-1.10.10/dojo/request/iframe.js +291 -0
  168. package/vendor/dojo-1.10.10/dojo/request/iframe.js.uncompressed.js +438 -0
  169. package/vendor/dojo-1.10.10/dojo/request/script.js +129 -0
  170. package/vendor/dojo-1.10.10/dojo/request/script.js.uncompressed.js +237 -0
  171. package/vendor/dojo-1.10.10/dojo/require.js +11 -0
  172. package/vendor/dojo-1.10.10/dojo/require.js.uncompressed.js +7 -0
  173. package/vendor/dojo-1.10.10/dojo/resources/blank.gif +0 -0
  174. package/vendor/dojo-1.10.10/dojo/string.js +67 -0
  175. package/vendor/dojo-1.10.10/dojo/string.js.uncompressed.js +181 -0
  176. package/vendor/dojo-1.10.10/dojo/touch.js +191 -0
  177. package/vendor/dojo-1.10.10/dojo/touch.js.uncompressed.js +468 -0
  178. package/vendor/dojo-1.10.10/dojo/uacss.js +36 -0
  179. package/vendor/dojo-1.10.10/dojo/uacss.js.uncompressed.js +85 -0
  180. package/vendor/dojo-1.10.10/dojo/window.js +141 -0
  181. package/vendor/dojo-1.10.10/dojo/window.js.uncompressed.js +241 -0
  182. package/vendor/dojo-1.10.10/dojox/charting/Chart.js +626 -0
  183. package/vendor/dojo-1.10.10/dojox/charting/Chart.js.uncompressed.js +1220 -0
  184. package/vendor/dojo-1.10.10/dojox/charting/Chart2D.js +5 -0
  185. package/vendor/dojo-1.10.10/dojox/charting/Chart2D.js.uncompressed.js +16 -0
  186. package/vendor/dojo-1.10.10/dojox/charting/Element.js +247 -0
  187. package/vendor/dojo-1.10.10/dojox/charting/Element.js.uncompressed.js +402 -0
  188. package/vendor/dojo-1.10.10/dojox/charting/Series.js +24 -0
  189. package/vendor/dojo-1.10.10/dojox/charting/Series.js.uncompressed.js +58 -0
  190. package/vendor/dojo-1.10.10/dojox/charting/SimpleTheme.js +191 -0
  191. package/vendor/dojo-1.10.10/dojox/charting/SimpleTheme.js.uncompressed.js +577 -0
  192. package/vendor/dojo-1.10.10/dojox/charting/Theme.js +42 -0
  193. package/vendor/dojo-1.10.10/dojox/charting/Theme.js.uncompressed.js +120 -0
  194. package/vendor/dojo-1.10.10/dojox/charting/action2d/Base.js +11 -0
  195. package/vendor/dojo-1.10.10/dojox/charting/action2d/Base.js.uncompressed.js +36 -0
  196. package/vendor/dojo-1.10.10/dojox/charting/action2d/Highlight.js +77 -0
  197. package/vendor/dojo-1.10.10/dojox/charting/action2d/Highlight.js.uncompressed.js +144 -0
  198. package/vendor/dojo-1.10.10/dojox/charting/action2d/Magnify.js +58 -0
  199. package/vendor/dojo-1.10.10/dojox/charting/action2d/Magnify.js.uncompressed.js +123 -0
  200. package/vendor/dojo-1.10.10/dojox/charting/action2d/MoveSlice.js +54 -0
  201. package/vendor/dojo-1.10.10/dojox/charting/action2d/MoveSlice.js.uncompressed.js +124 -0
  202. package/vendor/dojo-1.10.10/dojox/charting/action2d/PlotAction.js +28 -0
  203. package/vendor/dojo-1.10.10/dojox/charting/action2d/PlotAction.js.uncompressed.js +74 -0
  204. package/vendor/dojo-1.10.10/dojox/charting/action2d/Tooltip.js +116 -0
  205. package/vendor/dojo-1.10.10/dojox/charting/action2d/Tooltip.js.uncompressed.js +178 -0
  206. package/vendor/dojo-1.10.10/dojox/charting/axis2d/Base.js +24 -0
  207. package/vendor/dojo-1.10.10/dojox/charting/axis2d/Base.js.uncompressed.js +83 -0
  208. package/vendor/dojo-1.10.10/dojox/charting/axis2d/Default.js +557 -0
  209. package/vendor/dojo-1.10.10/dojox/charting/axis2d/Default.js.uncompressed.js +980 -0
  210. package/vendor/dojo-1.10.10/dojox/charting/axis2d/Invisible.js +65 -0
  211. package/vendor/dojo-1.10.10/dojox/charting/axis2d/Invisible.js.uncompressed.js +224 -0
  212. package/vendor/dojo-1.10.10/dojox/charting/axis2d/common.js +91 -0
  213. package/vendor/dojo-1.10.10/dojox/charting/axis2d/common.js.uncompressed.js +164 -0
  214. package/vendor/dojo-1.10.10/dojox/charting/plot2d/Areas.js +7 -0
  215. package/vendor/dojo-1.10.10/dojox/charting/plot2d/Areas.js.uncompressed.js +14 -0
  216. package/vendor/dojo-1.10.10/dojox/charting/plot2d/Bars.js +168 -0
  217. package/vendor/dojo-1.10.10/dojox/charting/plot2d/Bars.js.uncompressed.js +311 -0
  218. package/vendor/dojo-1.10.10/dojox/charting/plot2d/Base.js +61 -0
  219. package/vendor/dojo-1.10.10/dojox/charting/plot2d/Base.js.uncompressed.js +161 -0
  220. package/vendor/dojo-1.10.10/dojox/charting/plot2d/Bubble.js +141 -0
  221. package/vendor/dojo-1.10.10/dojox/charting/plot2d/Bubble.js.uncompressed.js +242 -0
  222. package/vendor/dojo-1.10.10/dojox/charting/plot2d/Candlesticks.js +126 -0
  223. package/vendor/dojo-1.10.10/dojox/charting/plot2d/Candlesticks.js.uncompressed.js +243 -0
  224. package/vendor/dojo-1.10.10/dojox/charting/plot2d/CartesianBase.js +108 -0
  225. package/vendor/dojo-1.10.10/dojox/charting/plot2d/CartesianBase.js.uncompressed.js +290 -0
  226. package/vendor/dojo-1.10.10/dojox/charting/plot2d/ClusteredBars.js +13 -0
  227. package/vendor/dojo-1.10.10/dojox/charting/plot2d/ClusteredBars.js.uncompressed.js +14 -0
  228. package/vendor/dojo-1.10.10/dojox/charting/plot2d/ClusteredColumns.js +13 -0
  229. package/vendor/dojo-1.10.10/dojox/charting/plot2d/ClusteredColumns.js.uncompressed.js +14 -0
  230. package/vendor/dojo-1.10.10/dojox/charting/plot2d/Columns.js +153 -0
  231. package/vendor/dojo-1.10.10/dojox/charting/plot2d/Columns.js.uncompressed.js +249 -0
  232. package/vendor/dojo-1.10.10/dojox/charting/plot2d/Default.js +253 -0
  233. package/vendor/dojo-1.10.10/dojox/charting/plot2d/Default.js.uncompressed.js +472 -0
  234. package/vendor/dojo-1.10.10/dojox/charting/plot2d/Grid.js +182 -0
  235. package/vendor/dojo-1.10.10/dojox/charting/plot2d/Grid.js.uncompressed.js +356 -0
  236. package/vendor/dojo-1.10.10/dojox/charting/plot2d/Lines.js +6 -0
  237. package/vendor/dojo-1.10.10/dojox/charting/plot2d/Lines.js.uncompressed.js +12 -0
  238. package/vendor/dojo-1.10.10/dojox/charting/plot2d/Markers.js +6 -0
  239. package/vendor/dojo-1.10.10/dojox/charting/plot2d/Markers.js.uncompressed.js +12 -0
  240. package/vendor/dojo-1.10.10/dojox/charting/plot2d/MarkersOnly.js +7 -0
  241. package/vendor/dojo-1.10.10/dojox/charting/plot2d/MarkersOnly.js.uncompressed.js +13 -0
  242. package/vendor/dojo-1.10.10/dojox/charting/plot2d/OHLC.js +110 -0
  243. package/vendor/dojo-1.10.10/dojox/charting/plot2d/OHLC.js.uncompressed.js +208 -0
  244. package/vendor/dojo-1.10.10/dojox/charting/plot2d/Pie.js +303 -0
  245. package/vendor/dojo-1.10.10/dojox/charting/plot2d/Pie.js.uncompressed.js +547 -0
  246. package/vendor/dojo-1.10.10/dojox/charting/plot2d/Scatter.js +134 -0
  247. package/vendor/dojo-1.10.10/dojox/charting/plot2d/Scatter.js.uncompressed.js +207 -0
  248. package/vendor/dojo-1.10.10/dojox/charting/plot2d/Spider.js +299 -0
  249. package/vendor/dojo-1.10.10/dojox/charting/plot2d/Spider.js.uncompressed.js +537 -0
  250. package/vendor/dojo-1.10.10/dojox/charting/plot2d/Stacked.js +24 -0
  251. package/vendor/dojo-1.10.10/dojox/charting/plot2d/Stacked.js.uncompressed.js +44 -0
  252. package/vendor/dojo-1.10.10/dojox/charting/plot2d/StackedAreas.js +7 -0
  253. package/vendor/dojo-1.10.10/dojox/charting/plot2d/StackedAreas.js.uncompressed.js +14 -0
  254. package/vendor/dojo-1.10.10/dojox/charting/plot2d/StackedBars.js +22 -0
  255. package/vendor/dojo-1.10.10/dojox/charting/plot2d/StackedBars.js.uncompressed.js +33 -0
  256. package/vendor/dojo-1.10.10/dojox/charting/plot2d/StackedColumns.js +20 -0
  257. package/vendor/dojo-1.10.10/dojox/charting/plot2d/StackedColumns.js.uncompressed.js +31 -0
  258. package/vendor/dojo-1.10.10/dojox/charting/plot2d/StackedLines.js +6 -0
  259. package/vendor/dojo-1.10.10/dojox/charting/plot2d/StackedLines.js.uncompressed.js +12 -0
  260. package/vendor/dojo-1.10.10/dojox/charting/plot2d/_PlotEvents.js +68 -0
  261. package/vendor/dojo-1.10.10/dojox/charting/plot2d/_PlotEvents.js.uncompressed.js +120 -0
  262. package/vendor/dojo-1.10.10/dojox/charting/plot2d/common.js +209 -0
  263. package/vendor/dojo-1.10.10/dojox/charting/plot2d/common.js.uncompressed.js +214 -0
  264. package/vendor/dojo-1.10.10/dojox/charting/plot2d/commonStacked.js +76 -0
  265. package/vendor/dojo-1.10.10/dojox/charting/plot2d/commonStacked.js.uncompressed.js +77 -0
  266. package/vendor/dojo-1.10.10/dojox/charting/scaler/common.js +59 -0
  267. package/vendor/dojo-1.10.10/dojox/charting/scaler/common.js.uncompressed.js +70 -0
  268. package/vendor/dojo-1.10.10/dojox/charting/scaler/linear.js +220 -0
  269. package/vendor/dojo-1.10.10/dojox/charting/scaler/linear.js.uncompressed.js +262 -0
  270. package/vendor/dojo-1.10.10/dojox/charting/scaler/primitive.js +23 -0
  271. package/vendor/dojo-1.10.10/dojox/charting/scaler/primitive.js.uncompressed.js +36 -0
  272. package/vendor/dojo-1.10.10/dojox/charting/themes/Claro.js +39 -0
  273. package/vendor/dojo-1.10.10/dojox/charting/themes/Claro.js.uncompressed.js +106 -0
  274. package/vendor/dojo-1.10.10/dojox/charting/themes/Wetland.js +5 -0
  275. package/vendor/dojo-1.10.10/dojox/charting/themes/Wetland.js.uncompressed.js +12 -0
  276. package/vendor/dojo-1.10.10/dojox/charting/themes/common.js +4 -0
  277. package/vendor/dojo-1.10.10/dojox/charting/themes/common.js.uncompressed.js +3 -0
  278. package/vendor/dojo-1.10.10/dojox/charting/widget/Legend.js +102 -0
  279. package/vendor/dojo-1.10.10/dojox/charting/widget/Legend.js.uncompressed.js +165 -0
  280. package/vendor/dojo-1.10.10/dojox/color/Palette.js +163 -0
  281. package/vendor/dojo-1.10.10/dojox/color/Palette.js.uncompressed.js +460 -0
  282. package/vendor/dojo-1.10.10/dojox/color/_base.js +174 -0
  283. package/vendor/dojo-1.10.10/dojox/color/_base.js.uncompressed.js +196 -0
  284. package/vendor/dojo-1.10.10/dojox/gfx/fx.js +297 -0
  285. package/vendor/dojo-1.10.10/dojox/gfx/fx.js.uncompressed.js +350 -0
  286. package/vendor/dojo-1.10.10/dojox/gfx/gradutils.js +63 -0
  287. package/vendor/dojo-1.10.10/dojox/gfx/gradutils.js.uncompressed.js +91 -0
  288. package/vendor/dojo-1.10.10/dojox/gfx/matrix.js +170 -0
  289. package/vendor/dojo-1.10.10/dojox/gfx/matrix.js.uncompressed.js +501 -0
  290. package/vendor/dojo-1.10.10/dojox/gfx/path.js +319 -0
  291. package/vendor/dojo-1.10.10/dojox/gfx/path.js.uncompressed.js +478 -0
  292. package/vendor/dojo-1.10.10/dojox/gfx/shape.js +459 -0
  293. package/vendor/dojo-1.10.10/dojox/gfx/shape.js.uncompressed.js +1091 -0
  294. package/vendor/dojo-1.10.10/dojox/gfx/svg.js +662 -0
  295. package/vendor/dojo-1.10.10/dojox/gfx/svg.js.uncompressed.js +1023 -0
  296. package/vendor/dojo-1.10.10/dojox/gfx/utils.js +199 -0
  297. package/vendor/dojo-1.10.10/dojox/gfx/utils.js.uncompressed.js +322 -0
  298. package/vendor/dojo-1.10.10/dojox/gfx.js +2 -0
  299. package/vendor/dojo-1.10.10/dojox/gfx.js.uncompressed.js +1136 -0
  300. package/vendor/dojo-1.10.10/dojox/lang/functional/array.js +151 -0
  301. package/vendor/dojo-1.10.10/dojox/lang/functional/array.js.uncompressed.js +169 -0
  302. package/vendor/dojo-1.10.10/dojox/lang/functional/fold.js +93 -0
  303. package/vendor/dojo-1.10.10/dojox/lang/functional/fold.js.uncompressed.js +125 -0
  304. package/vendor/dojo-1.10.10/dojox/lang/functional/lambda.js +81 -0
  305. package/vendor/dojo-1.10.10/dojox/lang/functional/lambda.js.uncompressed.js +132 -0
  306. package/vendor/dojo-1.10.10/dojox/lang/functional/object.js +54 -0
  307. package/vendor/dojo-1.10.10/dojox/lang/functional/object.js.uncompressed.js +78 -0
  308. package/vendor/dojo-1.10.10/dojox/lang/functional/reversed.js +61 -0
  309. package/vendor/dojo-1.10.10/dojox/lang/functional/reversed.js.uncompressed.js +77 -0
  310. package/vendor/dojo-1.10.10/dojox/lang/functional/scan.js +87 -0
  311. package/vendor/dojo-1.10.10/dojox/lang/functional/scan.js.uncompressed.js +107 -0
  312. package/vendor/dojo-1.10.10/dojox/lang/functional.js +4 -0
  313. package/vendor/dojo-1.10.10/dojox/lang/functional.js.uncompressed.js +3 -0
  314. package/vendor/dojo-1.10.10/dojox/lang/utils.js +86 -0
  315. package/vendor/dojo-1.10.10/dojox/lang/utils.js.uncompressed.js +121 -0
  316. package/vendor/dojo-1.10.10/dojox/main.js +4 -0
  317. package/vendor/dojo-1.10.10/dojox/main.js.uncompressed.js +14 -0
  318. package/vendor/dojo-1.10.10/dojox/storage/LocalStorageProvider.js +112 -0
  319. package/vendor/dojo-1.10.10/dojox/storage/LocalStorageProvider.js.uncompressed.js +208 -0
  320. package/vendor/dojo-1.10.10/dojox/storage/Provider.js +62 -0
  321. package/vendor/dojo-1.10.10/dojox/storage/Provider.js.uncompressed.js +344 -0
  322. package/vendor/dojo-1.10.10/dojox/storage/manager.js +110 -0
  323. package/vendor/dojo-1.10.10/dojox/storage/manager.js.uncompressed.js +263 -0
package/package.json CHANGED
@@ -1,24 +1,24 @@
1
1
  {
2
2
  "name": "@datagrok/helm",
3
3
  "friendlyName": "Helm",
4
- "version": "2.3.2",
4
+ "version": "2.3.3",
5
5
  "author": {
6
6
  "name": "Oleksandra Serhiienko",
7
7
  "email": "oserhiienko@datagrok.ai"
8
8
  },
9
9
  "description": "Provides support for HELM notation (importing, detecting, rendering, conversion).",
10
10
  "sources-backup": [
11
+ "https://ajax.googleapis.com/ajax/libs/dojo/1.10.4/dojo/dojo.js.uncompressed.js",
11
12
  "helm/JSDraw/Scilligence.JSDraw2.Lite-uncompressed.js",
12
13
  "helm/JSDraw/Pistoia.HELM-uncompressed.js"
13
14
  ],
14
15
  "sources": [
15
- "https://ajax.googleapis.com/ajax/libs/dojo/1.10.4/dojo/dojo.js.uncompressed.js",
16
16
  "css/helm.css"
17
17
  ],
18
18
  "dependencies": {
19
- "@datagrok-libraries/bio": "^5.42.5",
19
+ "@datagrok-libraries/bio": "^5.42.6",
20
20
  "@datagrok-libraries/chem-meta": "^1.2.5",
21
- "@datagrok-libraries/utils": "^4.2.13",
21
+ "@datagrok-libraries/utils": "^4.2.19",
22
22
  "cash-dom": "^8.1.1",
23
23
  "datagrok-api": "^1.20.0",
24
24
  "dayjs": "^1.10.6",
@@ -14,7 +14,7 @@ import {HelmMonomerPlacer} from './helm-monomer-placer';
14
14
  import {getHoveredMonomerFallback, getHoveredMonomerFromEditorMol} from './utils/get-hovered';
15
15
  import {JSDraw2HelmModule} from './types';
16
16
 
17
- import {getMonomerLib} from './package';
17
+ import {_package} from './package';
18
18
 
19
19
  declare const JSDraw2: JSDraw2HelmModule;
20
20
 
@@ -49,6 +49,7 @@ export class HelmCellRenderer extends DG.GridCellRenderer {
49
49
  const argsX = e.offsetX - gcb.x;
50
50
  const argsY = e.offsetY - gcb.y;
51
51
 
52
+ const monomerLib = _package.monomerLib;
52
53
  const editorMol: Mol<HelmType> | null = helmPlacer.getEditorMol(gridCell.tableRowIndex!);
53
54
  let seqMonomer: ISeqMonomer | null;
54
55
  let missedMonomers: Set<string> = new Set<string>(); // of .size = 0
@@ -57,7 +58,7 @@ export class HelmCellRenderer extends DG.GridCellRenderer {
57
58
  else {
58
59
  const seq: string = !gridCell.cell.value ? '' : removeGapsFromHelm(gridCell.cell.value as string);
59
60
  const monomerList = parseHelm(seq);
60
- missedMonomers = findMonomers(monomerList);
61
+ missedMonomers = findMonomers(monomerList, monomerLib);
61
62
  const parsedMonomers = new Set<string>(monomerList);
62
63
  seqMonomer = getHoveredMonomerFallback(argsX, argsY, gridCell, helmPlacer);
63
64
  if (seqMonomer && !parsedMonomers.has(seqMonomer.symbol)) seqMonomer = null;
@@ -76,7 +77,6 @@ export class HelmCellRenderer extends DG.GridCellRenderer {
76
77
  if (seqMonomer) {
77
78
  if (!missedMonomers.has(seqMonomer.symbol)) {
78
79
  const tooltipElements: HTMLElement[] = [ui.div(seqMonomer.symbol)];
79
- const monomerLib = getMonomerLib();
80
80
  const monomerDiv = monomerLib ? monomerLib.getTooltip(seqMonomer.polymerType, seqMonomer.symbol) :
81
81
  ui.divText('Monomer library is not available.');
82
82
  tooltipElements.push(monomerDiv);
@@ -128,7 +128,8 @@ export class HelmCellRenderer extends DG.GridCellRenderer {
128
128
  const seq: string = !gridCell.cell.value ? '' : removeGapsFromHelm(gridCell.cell.value);
129
129
  const monomerList = parseHelm(seq);
130
130
  const monomers: Set<string> = new Set<string>(monomerList);
131
- const missedMonomers: Set<string> = findMonomers(monomerList);
131
+ const monomerLib = _package.monomerLib;
132
+ const missedMonomers: Set<string> = findMonomers(monomerList, monomerLib);
132
133
 
133
134
  if (missedMonomers.size == 0) {
134
135
  // Recreate host to avoid hanging in window.dojox.gfx.svg.Text.prototype.getTextWidth
@@ -62,16 +62,16 @@ export class HelmHelper implements IHelmHelper {
62
62
  mexfilter: true
63
63
  });
64
64
  const sizes = webEditorApp.calculateSizes();
65
- webEditorApp.canvas.resize(sizes.rightwidth - 100, sizes.topheight - 210);
65
+ webEditorApp.canvas!.resize(sizes.rightwidth - 100, sizes.topheight - 210);
66
66
  let s: Partial<CSSStyleDeclaration> = {width: sizes.rightwidth - 100 + 'px', height: sizes.bottomheight + 'px'};
67
67
  scil.apply(webEditorApp.sequence.style, s);
68
- scil.apply(webEditorApp.notation.style, s);
68
+ scil.apply(webEditorApp.notation!.style, s);
69
69
  s = {width: sizes.rightwidth + 'px', height: (sizes.bottomheight + webEditorApp.toolbarheight) + 'px'};
70
- scil.apply(webEditorApp.properties.parent.style, s);
71
- webEditorApp.structureview.resize(sizes.rightwidth, sizes.bottomheight + webEditorApp.toolbarheight);
72
- webEditorApp.mex.resize(sizes.topheight - 80);
70
+ scil.apply(webEditorApp.properties!.parent.style, s);
71
+ webEditorApp.structureview!.resize(sizes.rightwidth, sizes.bottomheight + webEditorApp.toolbarheight);
72
+ webEditorApp.mex!.resize(sizes.topheight - 80);
73
73
  setTimeout(() => {
74
- webEditorApp.canvas.helm.setSequence(helm, 'HELM');
74
+ webEditorApp.canvas!.helm!.setSequence(helm, 'HELM');
75
75
  }, 200);
76
76
  return webEditorApp;
77
77
  }
@@ -10,7 +10,7 @@ import {CellRendererBackBase} from '@datagrok-libraries/bio/src/utils/cell-rende
10
10
 
11
11
  import {getParts, parseHelm} from './utils';
12
12
 
13
- import {_package, getMonomerLib} from './package';
13
+ import {_package} from './package';
14
14
 
15
15
  export class HelmMonomerPlacer extends CellRendererBackBase<string> {
16
16
  private _allPartsList: (string[] | null)[];
@@ -64,14 +64,14 @@ export function buildWebEditorApp(view: HTMLDivElement): App {
64
64
  mexfilter: true
65
65
  });
66
66
  const sizes = app.calculateSizes();
67
- app.canvas.resize(sizes.rightwidth - 100, sizes.topheight - 210);
67
+ app.canvas!.resize(sizes.rightwidth - 100, sizes.topheight - 210);
68
68
  let s = {width: sizes.rightwidth - 100 + 'px', height: sizes.bottomheight + 'px'};
69
69
  scil.apply(app.sequence.style, s);
70
- scil.apply(app.notation.style, s);
70
+ scil.apply(app.notation!.style, s);
71
71
  s = {width: sizes.rightwidth + 'px', height: (sizes.bottomheight + app.toolbarheight) + 'px'};
72
- scil.apply(app.properties.parent.style, s);
73
- app.structureview.resize(sizes.rightwidth, sizes.bottomheight + app.toolbarheight);
74
- app.mex.resize(sizes.topheight - 80);
72
+ scil.apply(app.properties!.parent.style, s);
73
+ app.structureview!.resize(sizes.rightwidth, sizes.bottomheight + app.toolbarheight);
74
+ app.mex!.resize(sizes.topheight - 80);
75
75
 
76
76
  return app;
77
77
  }
@@ -6,7 +6,6 @@ import * as grok from 'datagrok-api/grok';
6
6
  // import {HelmType, OrgHelmModuleType} from '@datagrok/helm-web-editor/src/types/org-helm';
7
7
 
8
8
  import {runTests, tests, TestContext} from '@datagrok-libraries/utils/src/test';
9
- import {getHelmHelper} from '@datagrok-libraries/bio/src/helm/helm-helper';
10
9
 
11
10
  import './tests/_first-tests';
12
11
  import './tests/helm-tests';
@@ -2,19 +2,23 @@ import * as ui from 'datagrok-api/ui';
2
2
  import * as grok from 'datagrok-api/grok';
3
3
  import * as DG from 'datagrok-api/dg';
4
4
 
5
+ import {Unsubscribable} from 'rxjs';
6
+
5
7
  import {delay, timeout} from '@datagrok-libraries/utils/src/test';
6
8
  import {errInfo} from '@datagrok-libraries/bio/src/utils/err-info';
7
- import type {
8
- DojoType, DojoxType, IOrgHelmWebEditor, Monomers
9
+ import {
10
+ DojoType, DojoxType, HweWindow, IOrgHelmWebEditor, Monomers
9
11
  } from '@datagrok-libraries/bio/src/helm/types';
10
12
  import {HelmServiceBase} from '@datagrok-libraries/bio/src/viewers/helm-service';
11
13
  import {IMonomerLib} from '@datagrok-libraries/bio/src/types';
12
14
  import {LoggerWrapper} from '@datagrok-libraries/bio/src/utils/logger';
13
- import {IMonomerLibHelper} from '@datagrok-libraries/bio/src/monomer-works/monomer-utils';
15
+ import {getMonomerLibHelper, IMonomerLibHelper} from '@datagrok-libraries/bio/src/monomer-works/monomer-utils';
16
+ import {errorToConsole} from '@datagrok-libraries/utils/src/to-console';
14
17
 
15
18
  import {HelmHelper} from './helm-helper';
16
19
  import {HelmService} from './utils/helm-service';
17
20
  import {OrgHelmModule, ScilModule} from './types';
21
+ import {rewriteLibraries} from './utils/get-monomer';
18
22
 
19
23
  import {_package} from './package';
20
24
 
@@ -23,13 +27,17 @@ declare const dojox: DojoxType;
23
27
  declare const scil: ScilModule;
24
28
  declare const org: OrgHelmModule;
25
29
 
26
- // eslint-disable-next-line
27
- var dojoConfig = {async: true};
28
-
29
- type HelmWindowType = Window & {
30
+ type DojoConfigWindowType = {
31
+ dojoConfig: {
32
+ packages?: (string | { name: string, location: string })[],
33
+ deps?: string[], callback: Function, has?: any, parseOnLoad?: boolean, async?: boolean | string
34
+ };
35
+ };
36
+ type HelmWindowType = {
30
37
  $helmService?: HelmServiceBase,
31
- }
32
- declare const window: HelmWindowType;
38
+ require: Function,
39
+ };
40
+ declare const window: Window & DojoConfigWindowType & HweWindow & HelmWindowType;
33
41
 
34
42
  export function _getHelmService(): HelmServiceBase {
35
43
  let res = window.$helmService;
@@ -41,66 +49,136 @@ export async function initHelmLoadAndPatchDojo(): Promise<void> {
41
49
  const logPrefix = `Helm: _package.initHelmPatchDojo()`;
42
50
  // patch window.dojox.gfx.svg.Text.prototype.getTextWidth hangs
43
51
  /** get the text width in pixels */
44
- // @ts-ignore
45
- await timeout(async () => {
46
- const dojoTargetList: { module: string, checker: () => boolean }[] = [
47
- {module: 'dojo.ready', checker: () => !!dojo?.ready},
48
- {module: 'dojo.window', checker: () => !!dojo?.window},
49
- {module: 'dojo.io.script', checker: () => !!dojo?.io?.script},
50
- // {module: 'dojo.request.iframe', checker: () => !!dojo?.request?.iframe},
51
- {module: 'dojo.dom', checker: () => !!dojo?.dom},
52
- {module: 'dojox.gfx', checker: () => !!dojox?.gfx},
53
- {module: 'dojox.gfx.svg', checker: () => !!dojox?.gfx?.svg && !!dojox?.gfx?.createSurface},
54
- {module: 'dojox.gfx.shape', checker: () => !!dojox?.gfx?.shape},
55
- // {module: 'dojox.storage.Provider', checker: () => !!dojox?.storage?.Provider},
56
- // {module: 'dojox.storage.LocalStorageProvider', checker: () => !!dojox?.storage?.LocalStorageProvider},
57
- ];
58
- for (const dojoTarget of dojoTargetList) {
59
- try { dojo.require(dojoTarget.module); } catch (err: any) {
60
- _package.logger.error(err.message);
52
+ const pi = DG.TaskBarProgressIndicator.create('Loading Helm Web Editor ...');
53
+ try {
54
+ await delay(2000);
55
+ const requireBackup = window.require;
56
+
57
+ await timeout(async () => {
58
+
59
+ await new Promise<void>((resolve, reject) => {
60
+ window.dojoConfig = {
61
+ deps: [
62
+ // 'dojo/dom', 'dojo/window', 'dojo/io/script', 'dojo/io/iframe',
63
+ // 'dojox/storage/LocalStorageProvider',
64
+ // 'dijit/layout/ContentPane',
65
+ ],
66
+ // packages: [
67
+ // 'dojo.ready', 'dojo.window', 'dojo.io.script', 'dojo.io.iframe', 'dojo.dom',
68
+ // 'dojox.gfx', 'dojox.gfx.shape',
69
+ // ],
70
+ callback: () => { resolve(); },
71
+ // has: {
72
+ // "dojo-firebug": true,
73
+ // "dojo-debug-messages": true,
74
+ // },
75
+ parseOnLoad: true,
76
+ async: false
77
+ };
78
+ // Load dojo without package/sources section for the settings dojoConfig to take effect+
79
+ DG.Utils.loadJsCss([
80
+ // 'https://ajax.googleapis.com/ajax/libs/dojo/1.10.4/dojo/dojo.js.uncompressed.js',
81
+ `${_package.webRoot}/vendor/dojo-1.10.10/dojo/dojo.js.uncompressed.js`,
82
+ ]).then(() => {});
83
+ });
84
+
85
+ const dojoRequire = window.require;
86
+ const cmp = dojoRequire == requireBackup;
87
+ try {
88
+ await new Promise<void>((resolve, reject) => {
89
+ dojoRequire(['dojo/window', 'dojo/dom', 'dojo/io/script', 'dojo/io/iframe',
90
+ 'dojox/gfx', 'dojox/gfx/svg', 'dojox/gfx/shape',
91
+ 'dijit/_base', 'dijit/Tooltip', 'dijit/form/_FormValueWidget',
92
+ 'dijit/form/DropDownButton', 'dijit/layout/AccordionContainer', 'dijit/form/ComboButton',
93
+ 'dijit/layout/StackController', 'dijit/layout/StackContainer',
94
+ ],
95
+ (...args: any[]) => {
96
+ resolve();
97
+ });
98
+ });
99
+ } finally {
100
+ window.require = function(...args: any[]) {
101
+ _package.logger.debug(`${logPrefix}, window.require( ${JSON.stringify(args)} )`);
102
+ dojoRequire(...args);
103
+ };
61
104
  }
62
- }
63
- const getDojoProgress = (): string[] => {
64
- return dojoTargetList.filter((dt) => !dt.checker()).map((dt) => dt.module);
65
- };
66
- /** List of dojo modules not ready yet */ let dojoProgress: string[];
67
- while ((dojoProgress = getDojoProgress()).length > 0) {
68
- _package.logger.debug(`${logPrefix}, dojo loading ... ${dojoProgress.map((m) => `'${m}'`).join(',')} ...`);
69
- await delay(100);
70
- }
71
- _package.logger.debug(`${logPrefix}, dojo ready all modules`);
72
- }, 60000, 'timeout dojox.gfx.svg');
73
-
74
- _package.logger.debug(`${logPrefix}, patch window.dojox.gfx.svg.Text.prototype.getTextWidth`);
75
- // @ts-ignore
76
- window.dojox.gfx.svg.Text.prototype.getTextWidth = function() {
77
- // Patched via Datagrok Helm package
78
- const rawNode = this.rawNode;
79
- const oldParent = rawNode.parentNode;
80
- const _measurementNode = rawNode.cloneNode(true);
81
- _measurementNode.style.visibility = 'hidden';
82
-
83
- // solution to the "orphan issue" in FF
84
- let _width = 0;
85
- const _text = _measurementNode.firstChild.nodeValue;
86
- oldParent.appendChild(_measurementNode);
87
-
88
- // solution to the "orphan issue" in Opera
89
- // (nodeValue == "" hangs firefox)
90
- if (_text != '') {
91
- let watchdogCounter = 100;
92
- while (!_width && --watchdogCounter > 0) { // <-- hangs
93
- //Yang: work around svgweb bug 417 -- http://code.google.com/p/svgweb/issues/detail?id=417
94
- if (_measurementNode.getBBox)
95
- _width = parseInt(_measurementNode.getBBox().width);
96
- else
97
- _width = 68;
105
+
106
+ //await delay(50);
107
+
108
+ // dojo.window','dojo.io.script','dojo.io.iframe','dojo.dom','dojox.gfx','dojox.gfx.svg','dojox.gfx.shape','dojox.charting'
109
+ const dojoTargetList: { name: string, module: string | null, checker: () => boolean }[] = [
110
+ {name: 'dojo.window', module: null, checker: () => !!dojo?.window},
111
+ {name: 'dojo.ready', module: null, checker: () => !!dojo?.ready},
112
+ {name: 'dojo.io.script', module: null, checker: () => !!dojo?.io?.script},
113
+ {name: 'dojo.io.iframe', module: null, checker: () => !!dojo?.io?.iframe},
114
+ // //{name: 'dojo.request.script', module: 'dojo.request.script', checker: () => !!dojo?.request?.iframe},
115
+ // {name: 'dojo.dom', module: 'dojo.dom', checker: () => !!dojo?.dom},
116
+ // {name: 'dojox.gfx', module: 'dojox.gfx', checker: () => !!dojox?.gfx},
117
+ // {name: 'dojox.gfx.svg', module: 'dojox.gfx.svg', checker: () => !!dojox?.gfx?.svg},
118
+ {name: 'dojox.gfx.createSurface', module: null, checker: () => !!dojox?.gfx?.createSurface},
119
+ // {name: 'dojox.gfx.shape', module: 'dojox.gfx.shape', checker: () => !!dojox?.gfx?.shape},
120
+ // {name: 'dojox.charting.themes.Claro', module: 'dojox.charting.themes.Claro', checker: () => !!dojox.charting?.themes?.Claro},
121
+ // {name: 'dojox.charting.themes.Wetland', module: 'dojox.charting.themes.Wetland', checker: () => !!dojox.charting?.themes?.Wetland},
122
+ // {name: 'dojox.charting.plot2d.Base', module: 'dojox.charting.plot2d.Base', checker: () => !!dojox.charting?.plot2d?.Base},
123
+ // {name: 'dojox.charting.Series', module: 'dojox.charting.Series', checker: () => !!dojox?.charting?.Series},
124
+ // {name: 'dojox.charting.Chart2D', module: 'dojox.charting.Chart2D', checker: () => !!dojox?.charting?.Chart2D},
125
+ // //{module: 'dojox.charting', checker: () => !!dojox.charting},
126
+ // // {module: 'dojox.storage.Provider', checker: () => !!dojox?.storage?.Provider},
127
+ // // {module: 'dojox.storage.LocalStorageProvider', checker: () => !!dojox?.storage?.LocalStorageProvider},
128
+ ];
129
+ for (const dojoTarget of dojoTargetList) {
130
+ try { if (dojoTarget.module) dojo.require(dojoTarget.module); } catch (err: any) {
131
+ _package.logger.error(err.message);
132
+ }
98
133
  }
99
- }
100
- oldParent.removeChild(_measurementNode);
101
- return _width;
102
- };
103
- _package.logger.debug(`${logPrefix}, end`);
134
+ /** Gets list ofd modules not ready yet */
135
+ const getDojoNotReadyList = (): string[] => {
136
+ return dojoTargetList.filter((dt) => !dt.checker()).map((dt) => dt.name);
137
+ };
138
+ /** List of dojo modules not ready yet */ let dojoNotReadyList: string[];
139
+ while ((dojoNotReadyList = getDojoNotReadyList()).length > 0) {
140
+ const dojoProgress = dojoTargetList.length - dojoNotReadyList.length;
141
+ pi.update(Math.round(100 * dojoProgress / dojoTargetList.length),
142
+ `Loading Helm Web Editor ${dojoProgress}/${dojoTargetList.length}`);
143
+ _package.logger.debug(`${logPrefix}, dojo loading ... ${dojoNotReadyList.map((m) => `'${m}'`).join(',')} ...`);
144
+ await delay(100);
145
+ }
146
+ _package.logger.debug(`${logPrefix}, dojo ready all modules`);
147
+ }, 60000, 'timeout dojox.gfx.svg');
148
+
149
+ _package.logger.debug(`${logPrefix}, patch window.dojox.gfx.svg.Text.prototype.getTextWidth`);
150
+ // @ts-ignore
151
+ window.dojox.gfx.svg.Text.prototype.getTextWidth = function() {
152
+ // Patched via Datagrok Helm package
153
+ const rawNode = this.rawNode;
154
+ const oldParent = rawNode.parentNode;
155
+ const _measurementNode = rawNode.cloneNode(true);
156
+ _measurementNode.style.visibility = 'hidden';
157
+
158
+ // solution to the "orphan issue" in FF
159
+ let _width = 0;
160
+ const _text = _measurementNode.firstChild.nodeValue;
161
+ oldParent.appendChild(_measurementNode);
162
+
163
+ // solution to the "orphan issue" in Opera
164
+ // (nodeValue == "" hangs firefox)
165
+ if (_text != '') {
166
+ let watchdogCounter = 100;
167
+ while (!_width && --watchdogCounter > 0) { // <-- hangs
168
+ //Yang: work around svgweb bug 417 -- http://code.google.com/p/svgweb/issues/detail?id=417
169
+ if (_measurementNode.getBBox)
170
+ _width = parseInt(_measurementNode.getBBox().width);
171
+ else
172
+ _width = 68;
173
+ }
174
+ }
175
+ oldParent.removeChild(_measurementNode);
176
+ return _width;
177
+ };
178
+ _package.logger.debug(`${logPrefix}, end`);
179
+ } finally {
180
+ pi.close();
181
+ }
104
182
  }
105
183
 
106
184
  export const helmJsonReplacer = (key: string, value: any): any => {
@@ -130,6 +208,39 @@ export class HelmPackage extends DG.Package {
130
208
  this.libHelper = libHelper;
131
209
  }
132
210
 
211
+ // -- Init --
212
+ /** Loads Dojo and HelmWebEditor, waits for init, patches */
213
+ async initHelm(): Promise<void> {
214
+ const logPrefix: string = 'Helm: Package.initDojo()';
215
+
216
+ _package.logger.debug(`${logPrefix}, dependence loading …`);
217
+ const t1: number = performance.now();
218
+
219
+ _package.logger.debug(`${logPrefix}, dojox loading and patching …`);
220
+ await initHelmLoadAndPatchDojo();
221
+ _package.logger.debug(`${logPrefix}, dojox loaded and patched`);
222
+
223
+ // Alternatively load old bundles by package.json/sources
224
+ _package.logger.debug(`${logPrefix}, HelmWebEditor awaiting …`);
225
+ require('../node_modules/@datagrok-libraries/helm-web-editor/dist/package.js');
226
+ await window.helmWebEditor$.initPromise;
227
+ _package.logger.debug(`${logPrefix}, HelmWebEditor loaded`);
228
+
229
+ org.helm.webeditor.kCaseSensitive = true; // GROK-13880
230
+
231
+ _package.logger.debug(`${logPrefix}, scil.Utils.alert patch`);
232
+ _package.initHelmPatchScilAlert(); // patch immediately
233
+
234
+ const t2: number = performance.now();
235
+ _package.logger.debug(`${logPrefix}, dependence loaded, ET: ${(t2 - t1)} ms`);
236
+ }
237
+
238
+ async getMonomerLib(): Promise<IMonomerLib> {
239
+ const libHelper = await getMonomerLibHelper();
240
+ _package.setLibHelper(libHelper);
241
+ return libHelper.getBioLib();
242
+ }
243
+
133
244
  public initHelmPatchScilAlert(): void {
134
245
  const logPrefix: string = 'Helm: initHelmPatchScilAlert()';
135
246
  this.alertOriginal = scil.Utils.alert;
@@ -139,13 +250,13 @@ export class HelmPackage extends DG.Package {
139
250
  }
140
251
 
141
252
  /** Patches Pistoia Monomers.getMonomer method to utilize DG Bio monomer Lib */
142
- public async initHelmPatchPistoia(monomerLib: IMonomerLib): Promise<void> {
253
+ public initHelmPatchPistoia(): void {
143
254
  const logPrefix: string = 'Helm: initHelmPatchPistoia()';
144
255
  const monomers = org.helm.webeditor.Monomers;
145
256
 
146
257
  this.logger.debug(`${logPrefix}, this.getMonomerOriginal stored`);
147
258
 
148
- this.helmHelper.overrideGetMonomer(this.helmHelper.buildGetMonomerFromLib(monomerLib));
259
+ this.helmHelper.overrideGetMonomer(this.helmHelper.buildGetMonomerFromLib(this.monomerLib));
149
260
 
150
261
  // @ts-ignore, intercept with proxy to observe access and usage
151
262
  org.helm.webeditor.Monomers = new class {
@@ -186,4 +297,52 @@ export class HelmPackage extends DG.Package {
186
297
  }
187
298
  }(org.helm.webeditor) as IOrgHelmWebEditor;
188
299
  }
300
+
301
+ // -- MonomerLib --
302
+
303
+ private _monomerLib: IMonomerLib;
304
+ public get monomerLib(): IMonomerLib {
305
+ if (!this._monomerLib)
306
+ throw new Error(`Helm: _package._monomerLib is not initialized yet`);
307
+ return this._monomerLib;
308
+ }
309
+
310
+ private _monomerLibSub: Unsubscribable;
311
+
312
+ initMonomerLib(lib: IMonomerLib) {
313
+ if (!!this._monomerLib)
314
+ throw new Error(`Helm: _package._monomerLib is initialized already`);
315
+ this._monomerLib = lib;
316
+ rewriteLibraries(this._monomerLib); // initHelm()
317
+ this._monomerLibSub = this._monomerLib.onChanged
318
+ .subscribe(this.monomerLibOnChangedHandler.bind(this));
319
+
320
+ this.initHelmPatchPistoia();
321
+ }
322
+
323
+ monomerLibOnChangedHandler(): void {
324
+ const logPrefix = `Helm: _package.monomerLibOnChangedHandler()`;
325
+ try {
326
+ const libSummary = this.monomerLib!.getSummaryObj();
327
+ const isLibEmpty = Object.keys(libSummary).length == 0;
328
+ const libSummaryLog = isLibEmpty ? 'empty' : Object.entries(libSummary)
329
+ .map(([pt, count]) => `${pt}: ${count}`)
330
+ .join(', ');
331
+ _package.logger.debug(`${logPrefix}, start, lib: { ${libSummaryLog} }`);
332
+
333
+ const libSummaryHtml = isLibEmpty ? 'empty' : Object.entries(libSummary)
334
+ .map(([pt, count]) => `${pt} ${count}`)
335
+ .join('<br />');
336
+ const libMsg: string = `Monomer lib updated:<br /> ${libSummaryHtml}`;
337
+ grok.shell.info(libMsg);
338
+
339
+ _package.logger.debug(`${logPrefix}, org,helm.webeditor.Monomers updating ...`);
340
+ rewriteLibraries(this._monomerLib); // initHelm() monomerLib.onChanged()
341
+ _package.logger.debug(`${logPrefix}, end, org.helm.webeditor.Monomers completed`);
342
+ } catch (err: any) {
343
+ const errMsg = errorToConsole(err);
344
+ console.error(`${logPrefix} error:\n` + errMsg);
345
+ // throw err; // Prevent disabling event handler
346
+ }
347
+ }
189
348
  }
package/src/package.ts CHANGED
@@ -28,7 +28,7 @@ import {getRS} from './utils/get-monomer-dummy';
28
28
  import {buildWebEditorApp} from './helm-web-editor';
29
29
  import {JSDraw2HelmModule, OrgHelmModule, ScilModule} from './types';
30
30
 
31
- export const _package = new HelmPackage({debug: false});
31
+ export const _package = new HelmPackage({debug: true}/**/);
32
32
 
33
33
  let monomerLib: IMonomerLib | null = null;
34
34
 
@@ -52,70 +52,12 @@ export async function initHelm(): Promise<void> {
52
52
 
53
53
  try {
54
54
  const [_, lib]: [void, IMonomerLib] = await Promise.all([
55
- Promise.all([
56
- (async () => {
57
- _package.logger.debug(`${logPrefix}, dependence loading …`);
58
- const t1: number = performance.now();
59
-
60
- _package.logger.debug(`${logPrefix}, dojox loading and patching …`);
61
- await initHelmLoadAndPatchDojo();
62
- _package.logger.debug(`${logPrefix}, dojox loaded and patched`);
63
-
64
- // Alternatively load old bundles by package.json/sources
65
- _package.logger.debug(`${logPrefix}, HelmWebEditor awaiting …`);
66
- require('../node_modules/@datagrok-libraries/helm-web-editor/dist/package.js');
67
- await window.helmWebEditor$.initPromise;
68
- _package.logger.debug(`${logPrefix}, HelmWebEditor loaded`);
69
-
70
- org.helm.webeditor.kCaseSensitive = true; // GROK-13880
71
-
72
- _package.logger.debug(`${logPrefix}, scil.Utils.alert patch`);
73
- _package.initHelmPatchScilAlert(); // patch immediately
74
-
75
- const t2: number = performance.now();
76
- _package.logger.debug(`${logPrefix}, dependence loaded, ET: ${(t2 - t1)} ms`);
77
- })()
78
- ]).then(() => {
79
-
80
- // settings
81
- }),
82
- (async () => {
83
- const libHelper = await getMonomerLibHelper();
84
- _package.setLibHelper(libHelper);
85
- return libHelper.getBioLib();
86
- })()
55
+ _package.initHelm(),
56
+ _package.getMonomerLib(),
87
57
  ]);
88
58
 
89
59
  _package.logger.debug(`${logPrefix}, then(), lib loaded`);
90
- monomerLib = lib;
91
- // rewriteLibraries(); // initHelm()
92
- await _package.initHelmPatchPistoia(monomerLib);
93
-
94
- monomerLib.onChanged.subscribe((_) => {
95
- const logPrefixInt = `${logPrefix} monomerLib.onChanged()`;
96
- try {
97
- const libSummary = monomerLib!.getSummaryObj();
98
- const isLibEmpty = Object.keys(libSummary).length == 0;
99
- const libSummaryLog = isLibEmpty ? 'empty' : Object.entries(libSummary)
100
- .map(([pt, count]) => `${pt}: ${count}`)
101
- .join(', ');
102
- _package.logger.debug(`${logPrefixInt}, start, lib: { ${libSummaryLog} }`);
103
-
104
- const libSummaryHtml = isLibEmpty ? 'empty' : Object.entries(libSummary)
105
- .map(([pt, count]) => `${pt} ${count}`)
106
- .join('<br />');
107
- const libMsg: string = `Monomer lib updated:<br /> ${libSummaryHtml}`;
108
- grok.shell.info(libMsg);
109
-
110
- // _package.logger.debug(`${logPrefixInt}, org,helm.webeditor.Monomers updating ...`);
111
- // rewriteLibraries(); // initHelm() monomerLib.onChanged()
112
- // _package.logger.debug(`${logPrefixInt}, end, org.helm.webeditor.Monomers completed`);
113
- } catch (err: any) {
114
- const errMsg = errorToConsole(err);
115
- console.error(`${logPrefixInt} error:\n` + errMsg);
116
- // throw err; // Prevent disabling event handler
117
- }
118
- });
60
+ _package.initMonomerLib(lib);
119
61
  } catch (err: any) {
120
62
  const [errMsg, errStack] = errInfo(err);
121
63
  // const errMsg: string = err instanceof Error ? err.message : !!err ? err.toString() : 'Exception \'undefined\'';
@@ -129,10 +71,6 @@ export async function initHelm(): Promise<void> {
129
71
  _package.logger.debug(`${logPrefix}, end`);
130
72
  }
131
73
 
132
- export function getMonomerLib(): IMonomerLib | null {
133
- return monomerLib;
134
- }
135
-
136
74
  //name: getHelmService
137
75
  //output: object result
138
76
  export function getHelmService(): HelmServiceBase {
@@ -198,14 +136,14 @@ function openWebEditor(cell: DG.Cell, value?: string, units?: string) {
198
136
  setTimeout(async () => {
199
137
  app = await buildWebEditorApp(view);
200
138
  if (!!cell && units === undefined)
201
- app.canvas.helm.setSequence(cell.value, 'HELM');
139
+ app.canvas!.helm!.setSequence(cell.value, 'HELM');
202
140
  else
203
- app.canvas.helm.setSequence(value!, 'HELM');
141
+ app.canvas!.helm!.setSequence(value!, 'HELM');
204
142
  }, 20);
205
143
  const dlg = ui.dialog({showHeader: false, showFooter: true});
206
144
  dlg.add(view)
207
145
  .onOK(() => {
208
- const helmValue: string = app.canvas.getHelm(true).replace(/<\/span>/g, '')
146
+ const helmValue: string = app.canvas!.getHelm(true).replace(/<\/span>/g, '')
209
147
  .replace(/<span style='background:#bbf;'>/g, '');
210
148
  if (!!cell) {
211
149
  if (units === undefined)
@@ -53,8 +53,9 @@ category('findMonomers', () => {
53
53
  }
54
54
 
55
55
  function _testFindMonomers(testHelmValue: string, tgtMissedSet: Set<string>): void {
56
+ const monomerLib = monomerLibHelper.getBioLib();
56
57
  const monomerSymbolList: string[] = parseHelm(testHelmValue);
57
- const resMissedSet: Set<string> = findMonomers(monomerSymbolList);
58
+ const resMissedSet: Set<string> = findMonomers(monomerSymbolList, monomerLib);
58
59
  expectObject(resMissedSet, tgtMissedSet);
59
60
  }
60
61
  });