@datagrok/helm 2.3.2 → 2.3.4

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