@muze-nl/simplystore 0.3.6 → 0.4.1

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 (353) hide show
  1. package/package.json +2 -2
  2. package/src/commands.mjs +2 -2
  3. package/src/server.mjs +68 -61
  4. package/src/share.mjs +22 -39
  5. package/.eslintrc.cjs +0 -15
  6. package/test/produce.mjs +0 -79
  7. package/test/share.mjs +0 -18
  8. package/test/test.jsontag +0 -20
  9. package/www/assets/css/style.css +0 -2296
  10. package/www/assets/feather-sprite.svg +0 -1
  11. package/www/assets/img/simplystore-narrow-white.svg +0 -138
  12. package/www/assets/img/simplystore-narrow.svg +0 -138
  13. package/www/assets/img/simplystore-white.svg +0 -153
  14. package/www/assets/img/simplystore.svg +0 -153
  15. package/www/codemirror/AUTHORS +0 -979
  16. package/www/codemirror/CHANGELOG.md +0 -2208
  17. package/www/codemirror/CONTRIBUTING.md +0 -92
  18. package/www/codemirror/LICENSE +0 -21
  19. package/www/codemirror/README.md +0 -47
  20. package/www/codemirror/addon/comment/comment.js +0 -211
  21. package/www/codemirror/addon/comment/continuecomment.js +0 -114
  22. package/www/codemirror/addon/dialog/dialog.css +0 -32
  23. package/www/codemirror/addon/dialog/dialog.js +0 -163
  24. package/www/codemirror/addon/display/autorefresh.js +0 -47
  25. package/www/codemirror/addon/display/fullscreen.css +0 -6
  26. package/www/codemirror/addon/display/fullscreen.js +0 -41
  27. package/www/codemirror/addon/display/panel.js +0 -133
  28. package/www/codemirror/addon/display/placeholder.js +0 -78
  29. package/www/codemirror/addon/display/rulers.js +0 -51
  30. package/www/codemirror/addon/edit/closebrackets.js +0 -201
  31. package/www/codemirror/addon/edit/closetag.js +0 -185
  32. package/www/codemirror/addon/edit/continuelist.js +0 -101
  33. package/www/codemirror/addon/edit/matchbrackets.js +0 -160
  34. package/www/codemirror/addon/edit/matchtags.js +0 -66
  35. package/www/codemirror/addon/edit/trailingspace.js +0 -27
  36. package/www/codemirror/addon/fold/brace-fold.js +0 -119
  37. package/www/codemirror/addon/fold/comment-fold.js +0 -59
  38. package/www/codemirror/addon/fold/foldcode.js +0 -159
  39. package/www/codemirror/addon/fold/foldgutter.css +0 -20
  40. package/www/codemirror/addon/fold/foldgutter.js +0 -169
  41. package/www/codemirror/addon/fold/indent-fold.js +0 -48
  42. package/www/codemirror/addon/fold/markdown-fold.js +0 -49
  43. package/www/codemirror/addon/fold/xml-fold.js +0 -184
  44. package/www/codemirror/addon/hint/anyword-hint.js +0 -41
  45. package/www/codemirror/addon/hint/css-hint.js +0 -66
  46. package/www/codemirror/addon/hint/html-hint.js +0 -351
  47. package/www/codemirror/addon/hint/javascript-hint.js +0 -162
  48. package/www/codemirror/addon/hint/show-hint.css +0 -37
  49. package/www/codemirror/addon/hint/show-hint.js +0 -523
  50. package/www/codemirror/addon/hint/sql-hint.js +0 -304
  51. package/www/codemirror/addon/hint/xml-hint.js +0 -132
  52. package/www/codemirror/addon/lint/coffeescript-lint.js +0 -47
  53. package/www/codemirror/addon/lint/css-lint.js +0 -40
  54. package/www/codemirror/addon/lint/html-lint.js +0 -59
  55. package/www/codemirror/addon/lint/javascript-lint.js +0 -65
  56. package/www/codemirror/addon/lint/json-lint.js +0 -40
  57. package/www/codemirror/addon/lint/lint.css +0 -79
  58. package/www/codemirror/addon/lint/lint.js +0 -291
  59. package/www/codemirror/addon/lint/yaml-lint.js +0 -41
  60. package/www/codemirror/addon/merge/merge.css +0 -119
  61. package/www/codemirror/addon/merge/merge.js +0 -1018
  62. package/www/codemirror/addon/mode/loadmode.js +0 -66
  63. package/www/codemirror/addon/mode/multiplex.js +0 -136
  64. package/www/codemirror/addon/mode/multiplex_test.js +0 -49
  65. package/www/codemirror/addon/mode/overlay.js +0 -90
  66. package/www/codemirror/addon/mode/simple.js +0 -216
  67. package/www/codemirror/addon/runmode/colorize.js +0 -40
  68. package/www/codemirror/addon/runmode/runmode-standalone.js +0 -334
  69. package/www/codemirror/addon/runmode/runmode.js +0 -76
  70. package/www/codemirror/addon/runmode/runmode.node.js +0 -329
  71. package/www/codemirror/addon/scroll/annotatescrollbar.js +0 -128
  72. package/www/codemirror/addon/scroll/scrollpastend.js +0 -48
  73. package/www/codemirror/addon/scroll/simplescrollbars.css +0 -66
  74. package/www/codemirror/addon/scroll/simplescrollbars.js +0 -152
  75. package/www/codemirror/addon/search/jump-to-line.js +0 -53
  76. package/www/codemirror/addon/search/match-highlighter.js +0 -167
  77. package/www/codemirror/addon/search/matchesonscrollbar.css +0 -8
  78. package/www/codemirror/addon/search/matchesonscrollbar.js +0 -97
  79. package/www/codemirror/addon/search/search.js +0 -295
  80. package/www/codemirror/addon/search/searchcursor.js +0 -305
  81. package/www/codemirror/addon/selection/active-line.js +0 -72
  82. package/www/codemirror/addon/selection/mark-selection.js +0 -119
  83. package/www/codemirror/addon/selection/selection-pointer.js +0 -98
  84. package/www/codemirror/addon/tern/tern.css +0 -87
  85. package/www/codemirror/addon/tern/tern.js +0 -756
  86. package/www/codemirror/addon/tern/worker.js +0 -44
  87. package/www/codemirror/addon/wrap/hardwrap.js +0 -160
  88. package/www/codemirror/bin/source-highlight +0 -48
  89. package/www/codemirror/keymap/emacs.js +0 -545
  90. package/www/codemirror/keymap/sublime.js +0 -720
  91. package/www/codemirror/keymap/vim.js +0 -5978
  92. package/www/codemirror/lib/codemirror.css +0 -344
  93. package/www/codemirror/lib/codemirror.js +0 -9874
  94. package/www/codemirror/mode/apl/apl.js +0 -174
  95. package/www/codemirror/mode/asciiarmor/asciiarmor.js +0 -74
  96. package/www/codemirror/mode/asn.1/asn.1.js +0 -204
  97. package/www/codemirror/mode/asterisk/asterisk.js +0 -220
  98. package/www/codemirror/mode/brainfuck/brainfuck.js +0 -85
  99. package/www/codemirror/mode/clike/clike.js +0 -940
  100. package/www/codemirror/mode/clojure/clojure.js +0 -292
  101. package/www/codemirror/mode/cmake/cmake.js +0 -97
  102. package/www/codemirror/mode/cobol/cobol.js +0 -255
  103. package/www/codemirror/mode/coffeescript/coffeescript.js +0 -359
  104. package/www/codemirror/mode/commonlisp/commonlisp.js +0 -125
  105. package/www/codemirror/mode/crystal/crystal.js +0 -433
  106. package/www/codemirror/mode/css/css.js +0 -862
  107. package/www/codemirror/mode/cypher/cypher.js +0 -152
  108. package/www/codemirror/mode/d/d.js +0 -223
  109. package/www/codemirror/mode/dart/dart.js +0 -166
  110. package/www/codemirror/mode/diff/diff.js +0 -47
  111. package/www/codemirror/mode/django/django.js +0 -356
  112. package/www/codemirror/mode/dockerfile/dockerfile.js +0 -211
  113. package/www/codemirror/mode/dtd/dtd.js +0 -142
  114. package/www/codemirror/mode/dylan/dylan.js +0 -352
  115. package/www/codemirror/mode/ebnf/ebnf.js +0 -195
  116. package/www/codemirror/mode/ecl/ecl.js +0 -206
  117. package/www/codemirror/mode/eiffel/eiffel.js +0 -160
  118. package/www/codemirror/mode/elm/elm.js +0 -245
  119. package/www/codemirror/mode/erlang/erlang.js +0 -619
  120. package/www/codemirror/mode/factor/factor.js +0 -85
  121. package/www/codemirror/mode/fcl/fcl.js +0 -173
  122. package/www/codemirror/mode/forth/forth.js +0 -180
  123. package/www/codemirror/mode/fortran/fortran.js +0 -188
  124. package/www/codemirror/mode/gas/gas.js +0 -353
  125. package/www/codemirror/mode/gfm/gfm.js +0 -129
  126. package/www/codemirror/mode/gherkin/gherkin.js +0 -178
  127. package/www/codemirror/mode/go/go.js +0 -187
  128. package/www/codemirror/mode/groovy/groovy.js +0 -247
  129. package/www/codemirror/mode/haml/haml.js +0 -161
  130. package/www/codemirror/mode/handlebars/handlebars.js +0 -70
  131. package/www/codemirror/mode/haskell/haskell.js +0 -268
  132. package/www/codemirror/mode/haskell-literate/haskell-literate.js +0 -43
  133. package/www/codemirror/mode/haxe/haxe.js +0 -515
  134. package/www/codemirror/mode/htmlembedded/htmlembedded.js +0 -37
  135. package/www/codemirror/mode/htmlmixed/htmlmixed.js +0 -153
  136. package/www/codemirror/mode/http/http.js +0 -113
  137. package/www/codemirror/mode/idl/idl.js +0 -290
  138. package/www/codemirror/mode/javascript/javascript.js +0 -960
  139. package/www/codemirror/mode/jinja2/jinja2.js +0 -193
  140. package/www/codemirror/mode/jsx/jsx.js +0 -148
  141. package/www/codemirror/mode/julia/julia.js +0 -390
  142. package/www/codemirror/mode/livescript/livescript.js +0 -280
  143. package/www/codemirror/mode/lua/lua.js +0 -160
  144. package/www/codemirror/mode/markdown/markdown.js +0 -886
  145. package/www/codemirror/mode/mathematica/mathematica.js +0 -176
  146. package/www/codemirror/mode/mbox/mbox.js +0 -129
  147. package/www/codemirror/mode/meta.js +0 -221
  148. package/www/codemirror/mode/mirc/mirc.js +0 -193
  149. package/www/codemirror/mode/mllike/mllike.js +0 -359
  150. package/www/codemirror/mode/modelica/modelica.js +0 -245
  151. package/www/codemirror/mode/mscgen/mscgen.js +0 -175
  152. package/www/codemirror/mode/mumps/mumps.js +0 -148
  153. package/www/codemirror/mode/nginx/nginx.js +0 -178
  154. package/www/codemirror/mode/nsis/nsis.js +0 -95
  155. package/www/codemirror/mode/ntriples/ntriples.js +0 -195
  156. package/www/codemirror/mode/octave/octave.js +0 -139
  157. package/www/codemirror/mode/oz/oz.js +0 -252
  158. package/www/codemirror/mode/pascal/pascal.js +0 -136
  159. package/www/codemirror/mode/pegjs/pegjs.js +0 -111
  160. package/www/codemirror/mode/perl/perl.js +0 -836
  161. package/www/codemirror/mode/php/php.js +0 -234
  162. package/www/codemirror/mode/pig/pig.js +0 -178
  163. package/www/codemirror/mode/powershell/powershell.js +0 -398
  164. package/www/codemirror/mode/properties/properties.js +0 -78
  165. package/www/codemirror/mode/protobuf/protobuf.js +0 -72
  166. package/www/codemirror/mode/pug/pug.js +0 -591
  167. package/www/codemirror/mode/puppet/puppet.js +0 -220
  168. package/www/codemirror/mode/python/python.js +0 -402
  169. package/www/codemirror/mode/q/q.js +0 -139
  170. package/www/codemirror/mode/r/r.js +0 -190
  171. package/www/codemirror/mode/rpm/changes/index.html +0 -66
  172. package/www/codemirror/mode/rpm/rpm.js +0 -109
  173. package/www/codemirror/mode/rst/rst.js +0 -557
  174. package/www/codemirror/mode/ruby/ruby.js +0 -303
  175. package/www/codemirror/mode/rust/rust.js +0 -72
  176. package/www/codemirror/mode/sas/sas.js +0 -303
  177. package/www/codemirror/mode/sass/sass.js +0 -459
  178. package/www/codemirror/mode/scheme/scheme.js +0 -284
  179. package/www/codemirror/mode/shell/shell.js +0 -168
  180. package/www/codemirror/mode/sieve/sieve.js +0 -193
  181. package/www/codemirror/mode/slim/slim.js +0 -575
  182. package/www/codemirror/mode/smalltalk/smalltalk.js +0 -168
  183. package/www/codemirror/mode/smarty/smarty.js +0 -225
  184. package/www/codemirror/mode/solr/solr.js +0 -104
  185. package/www/codemirror/mode/soy/soy.js +0 -665
  186. package/www/codemirror/mode/sparql/sparql.js +0 -184
  187. package/www/codemirror/mode/spreadsheet/spreadsheet.js +0 -112
  188. package/www/codemirror/mode/sql/sql.js +0 -525
  189. package/www/codemirror/mode/stex/stex.js +0 -264
  190. package/www/codemirror/mode/stylus/stylus.js +0 -775
  191. package/www/codemirror/mode/swift/swift.js +0 -221
  192. package/www/codemirror/mode/tcl/tcl.js +0 -140
  193. package/www/codemirror/mode/textile/textile.js +0 -469
  194. package/www/codemirror/mode/tiddlywiki/tiddlywiki.css +0 -14
  195. package/www/codemirror/mode/tiddlywiki/tiddlywiki.js +0 -308
  196. package/www/codemirror/mode/tiki/tiki.css +0 -26
  197. package/www/codemirror/mode/tiki/tiki.js +0 -312
  198. package/www/codemirror/mode/toml/toml.js +0 -88
  199. package/www/codemirror/mode/tornado/tornado.js +0 -68
  200. package/www/codemirror/mode/troff/troff.js +0 -84
  201. package/www/codemirror/mode/ttcn/ttcn.js +0 -283
  202. package/www/codemirror/mode/ttcn-cfg/ttcn-cfg.js +0 -214
  203. package/www/codemirror/mode/turtle/turtle.js +0 -162
  204. package/www/codemirror/mode/twig/twig.js +0 -141
  205. package/www/codemirror/mode/vb/vb.js +0 -275
  206. package/www/codemirror/mode/vbscript/vbscript.js +0 -350
  207. package/www/codemirror/mode/velocity/velocity.js +0 -202
  208. package/www/codemirror/mode/verilog/verilog.js +0 -781
  209. package/www/codemirror/mode/vhdl/vhdl.js +0 -189
  210. package/www/codemirror/mode/vue/vue.js +0 -77
  211. package/www/codemirror/mode/wast/wast.js +0 -132
  212. package/www/codemirror/mode/webidl/webidl.js +0 -195
  213. package/www/codemirror/mode/xml/xml.js +0 -417
  214. package/www/codemirror/mode/xquery/xquery.js +0 -448
  215. package/www/codemirror/mode/yacas/yacas.js +0 -204
  216. package/www/codemirror/mode/yaml/yaml.js +0 -120
  217. package/www/codemirror/mode/yaml-frontmatter/yaml-frontmatter.js +0 -72
  218. package/www/codemirror/mode/z80/z80.js +0 -116
  219. package/www/codemirror/package.json +0 -52
  220. package/www/codemirror/rollup.config.js +0 -52
  221. package/www/codemirror/src/addon/runmode/codemirror-standalone.js +0 -24
  222. package/www/codemirror/src/addon/runmode/codemirror.node.js +0 -21
  223. package/www/codemirror/src/addon/runmode/runmode-standalone.js +0 -2
  224. package/www/codemirror/src/addon/runmode/runmode.node.js +0 -2
  225. package/www/codemirror/src/codemirror.js +0 -3
  226. package/www/codemirror/src/display/Display.js +0 -116
  227. package/www/codemirror/src/display/focus.js +0 -50
  228. package/www/codemirror/src/display/gutters.js +0 -44
  229. package/www/codemirror/src/display/highlight_worker.js +0 -55
  230. package/www/codemirror/src/display/line_numbers.js +0 -48
  231. package/www/codemirror/src/display/mode_state.js +0 -22
  232. package/www/codemirror/src/display/operations.js +0 -206
  233. package/www/codemirror/src/display/scroll_events.js +0 -132
  234. package/www/codemirror/src/display/scrollbars.js +0 -194
  235. package/www/codemirror/src/display/scrolling.js +0 -186
  236. package/www/codemirror/src/display/selection.js +0 -173
  237. package/www/codemirror/src/display/update_display.js +0 -267
  238. package/www/codemirror/src/display/update_line.js +0 -189
  239. package/www/codemirror/src/display/update_lines.js +0 -82
  240. package/www/codemirror/src/display/view_tracking.js +0 -153
  241. package/www/codemirror/src/edit/CodeMirror.js +0 -217
  242. package/www/codemirror/src/edit/commands.js +0 -178
  243. package/www/codemirror/src/edit/deleteNearSelection.js +0 -30
  244. package/www/codemirror/src/edit/drop_events.js +0 -130
  245. package/www/codemirror/src/edit/fromTextArea.js +0 -61
  246. package/www/codemirror/src/edit/global_events.js +0 -45
  247. package/www/codemirror/src/edit/key_events.js +0 -163
  248. package/www/codemirror/src/edit/legacy.js +0 -62
  249. package/www/codemirror/src/edit/main.js +0 -69
  250. package/www/codemirror/src/edit/methods.js +0 -555
  251. package/www/codemirror/src/edit/mouse_events.js +0 -417
  252. package/www/codemirror/src/edit/options.js +0 -194
  253. package/www/codemirror/src/edit/utils.js +0 -7
  254. package/www/codemirror/src/input/ContentEditableInput.js +0 -546
  255. package/www/codemirror/src/input/TextareaInput.js +0 -380
  256. package/www/codemirror/src/input/indent.js +0 -71
  257. package/www/codemirror/src/input/input.js +0 -134
  258. package/www/codemirror/src/input/keymap.js +0 -147
  259. package/www/codemirror/src/input/keynames.js +0 -17
  260. package/www/codemirror/src/input/movement.js +0 -111
  261. package/www/codemirror/src/line/highlight.js +0 -284
  262. package/www/codemirror/src/line/line_data.js +0 -349
  263. package/www/codemirror/src/line/pos.js +0 -40
  264. package/www/codemirror/src/line/saw_special_spans.js +0 -10
  265. package/www/codemirror/src/line/spans.js +0 -390
  266. package/www/codemirror/src/line/utils_line.js +0 -85
  267. package/www/codemirror/src/measurement/position_measurement.js +0 -702
  268. package/www/codemirror/src/measurement/widgets.js +0 -26
  269. package/www/codemirror/src/model/Doc.js +0 -436
  270. package/www/codemirror/src/model/change_measurement.js +0 -61
  271. package/www/codemirror/src/model/changes.js +0 -339
  272. package/www/codemirror/src/model/chunk.js +0 -167
  273. package/www/codemirror/src/model/document_data.js +0 -112
  274. package/www/codemirror/src/model/history.js +0 -228
  275. package/www/codemirror/src/model/line_widget.js +0 -78
  276. package/www/codemirror/src/model/mark_text.js +0 -293
  277. package/www/codemirror/src/model/selection.js +0 -84
  278. package/www/codemirror/src/model/selection_updates.js +0 -216
  279. package/www/codemirror/src/modes.js +0 -96
  280. package/www/codemirror/src/util/StringStream.js +0 -90
  281. package/www/codemirror/src/util/bidi.js +0 -215
  282. package/www/codemirror/src/util/browser.js +0 -34
  283. package/www/codemirror/src/util/dom.js +0 -101
  284. package/www/codemirror/src/util/event.js +0 -103
  285. package/www/codemirror/src/util/feature_detection.js +0 -84
  286. package/www/codemirror/src/util/misc.js +0 -168
  287. package/www/codemirror/src/util/operation_group.js +0 -72
  288. package/www/codemirror/theme/3024-day.css +0 -41
  289. package/www/codemirror/theme/3024-night.css +0 -39
  290. package/www/codemirror/theme/abbott.css +0 -268
  291. package/www/codemirror/theme/abcdef.css +0 -32
  292. package/www/codemirror/theme/ambiance-mobile.css +0 -5
  293. package/www/codemirror/theme/ambiance.css +0 -74
  294. package/www/codemirror/theme/ayu-dark.css +0 -44
  295. package/www/codemirror/theme/ayu-mirage.css +0 -45
  296. package/www/codemirror/theme/base16-dark.css +0 -40
  297. package/www/codemirror/theme/base16-light.css +0 -38
  298. package/www/codemirror/theme/bespin.css +0 -34
  299. package/www/codemirror/theme/blackboard.css +0 -32
  300. package/www/codemirror/theme/cobalt.css +0 -25
  301. package/www/codemirror/theme/colorforth.css +0 -33
  302. package/www/codemirror/theme/darcula.css +0 -53
  303. package/www/codemirror/theme/dracula.css +0 -40
  304. package/www/codemirror/theme/duotone-dark.css +0 -35
  305. package/www/codemirror/theme/duotone-light.css +0 -36
  306. package/www/codemirror/theme/eclipse.css +0 -23
  307. package/www/codemirror/theme/elegant.css +0 -13
  308. package/www/codemirror/theme/erlang-dark.css +0 -34
  309. package/www/codemirror/theme/gruvbox-dark.css +0 -39
  310. package/www/codemirror/theme/hopscotch.css +0 -34
  311. package/www/codemirror/theme/icecoder.css +0 -43
  312. package/www/codemirror/theme/idea.css +0 -42
  313. package/www/codemirror/theme/isotope.css +0 -34
  314. package/www/codemirror/theme/juejin.css +0 -30
  315. package/www/codemirror/theme/lesser-dark.css +0 -47
  316. package/www/codemirror/theme/liquibyte.css +0 -95
  317. package/www/codemirror/theme/lucario.css +0 -37
  318. package/www/codemirror/theme/material-darker.css +0 -135
  319. package/www/codemirror/theme/material-ocean.css +0 -141
  320. package/www/codemirror/theme/material-palenight.css +0 -141
  321. package/www/codemirror/theme/material.css +0 -141
  322. package/www/codemirror/theme/mbo.css +0 -37
  323. package/www/codemirror/theme/mdn-like.css +0 -46
  324. package/www/codemirror/theme/midnight.css +0 -39
  325. package/www/codemirror/theme/monokai.css +0 -41
  326. package/www/codemirror/theme/moxer.css +0 -143
  327. package/www/codemirror/theme/neat.css +0 -12
  328. package/www/codemirror/theme/neo.css +0 -43
  329. package/www/codemirror/theme/night.css +0 -27
  330. package/www/codemirror/theme/nord.css +0 -42
  331. package/www/codemirror/theme/oceanic-next.css +0 -46
  332. package/www/codemirror/theme/panda-syntax.css +0 -85
  333. package/www/codemirror/theme/paraiso-dark.css +0 -38
  334. package/www/codemirror/theme/paraiso-light.css +0 -38
  335. package/www/codemirror/theme/pastel-on-dark.css +0 -52
  336. package/www/codemirror/theme/railscasts.css +0 -34
  337. package/www/codemirror/theme/rubyblue.css +0 -25
  338. package/www/codemirror/theme/seti.css +0 -44
  339. package/www/codemirror/theme/shadowfox.css +0 -52
  340. package/www/codemirror/theme/solarized.css +0 -165
  341. package/www/codemirror/theme/ssms.css +0 -16
  342. package/www/codemirror/theme/the-matrix.css +0 -30
  343. package/www/codemirror/theme/tomorrow-night-bright.css +0 -35
  344. package/www/codemirror/theme/tomorrow-night-eighties.css +0 -38
  345. package/www/codemirror/theme/ttcn.css +0 -64
  346. package/www/codemirror/theme/twilight.css +0 -32
  347. package/www/codemirror/theme/vibrant-ink.css +0 -34
  348. package/www/codemirror/theme/xq-dark.css +0 -53
  349. package/www/codemirror/theme/xq-light.css +0 -43
  350. package/www/codemirror/theme/yeti.css +0 -44
  351. package/www/codemirror/theme/yonce.css +0 -59
  352. package/www/codemirror/theme/zenburn.css +0 -37
  353. package/www/index.html +0 -359
@@ -1,194 +0,0 @@
1
- import { addClass, elt, rmClass } from "../util/dom.js"
2
- import { on } from "../util/event.js"
3
- import { scrollGap, paddingVert } from "../measurement/position_measurement.js"
4
- import { ie, ie_version, mac, mac_geMountainLion } from "../util/browser.js"
5
- import { updateHeightsInViewport } from "./update_lines.js"
6
- import { Delayed } from "../util/misc.js"
7
-
8
- import { setScrollLeft, updateScrollTop } from "./scrolling.js"
9
-
10
- // SCROLLBARS
11
-
12
- // Prepare DOM reads needed to update the scrollbars. Done in one
13
- // shot to minimize update/measure roundtrips.
14
- export function measureForScrollbars(cm) {
15
- let d = cm.display, gutterW = d.gutters.offsetWidth
16
- let docH = Math.round(cm.doc.height + paddingVert(cm.display))
17
- return {
18
- clientHeight: d.scroller.clientHeight,
19
- viewHeight: d.wrapper.clientHeight,
20
- scrollWidth: d.scroller.scrollWidth, clientWidth: d.scroller.clientWidth,
21
- viewWidth: d.wrapper.clientWidth,
22
- barLeft: cm.options.fixedGutter ? gutterW : 0,
23
- docHeight: docH,
24
- scrollHeight: docH + scrollGap(cm) + d.barHeight,
25
- nativeBarWidth: d.nativeBarWidth,
26
- gutterWidth: gutterW
27
- }
28
- }
29
-
30
- class NativeScrollbars {
31
- constructor(place, scroll, cm) {
32
- this.cm = cm
33
- let vert = this.vert = elt("div", [elt("div", null, null, "min-width: 1px")], "CodeMirror-vscrollbar")
34
- let horiz = this.horiz = elt("div", [elt("div", null, null, "height: 100%; min-height: 1px")], "CodeMirror-hscrollbar")
35
- vert.tabIndex = horiz.tabIndex = -1
36
- place(vert); place(horiz)
37
-
38
- on(vert, "scroll", () => {
39
- if (vert.clientHeight) scroll(vert.scrollTop, "vertical")
40
- })
41
- on(horiz, "scroll", () => {
42
- if (horiz.clientWidth) scroll(horiz.scrollLeft, "horizontal")
43
- })
44
-
45
- this.checkedZeroWidth = false
46
- // Need to set a minimum width to see the scrollbar on IE7 (but must not set it on IE8).
47
- if (ie && ie_version < 8) this.horiz.style.minHeight = this.vert.style.minWidth = "18px"
48
- }
49
-
50
- update(measure) {
51
- let needsH = measure.scrollWidth > measure.clientWidth + 1
52
- let needsV = measure.scrollHeight > measure.clientHeight + 1
53
- let sWidth = measure.nativeBarWidth
54
-
55
- if (needsV) {
56
- this.vert.style.display = "block"
57
- this.vert.style.bottom = needsH ? sWidth + "px" : "0"
58
- let totalHeight = measure.viewHeight - (needsH ? sWidth : 0)
59
- // A bug in IE8 can cause this value to be negative, so guard it.
60
- this.vert.firstChild.style.height =
61
- Math.max(0, measure.scrollHeight - measure.clientHeight + totalHeight) + "px"
62
- } else {
63
- this.vert.scrollTop = 0
64
- this.vert.style.display = ""
65
- this.vert.firstChild.style.height = "0"
66
- }
67
-
68
- if (needsH) {
69
- this.horiz.style.display = "block"
70
- this.horiz.style.right = needsV ? sWidth + "px" : "0"
71
- this.horiz.style.left = measure.barLeft + "px"
72
- let totalWidth = measure.viewWidth - measure.barLeft - (needsV ? sWidth : 0)
73
- this.horiz.firstChild.style.width =
74
- Math.max(0, measure.scrollWidth - measure.clientWidth + totalWidth) + "px"
75
- } else {
76
- this.horiz.style.display = ""
77
- this.horiz.firstChild.style.width = "0"
78
- }
79
-
80
- if (!this.checkedZeroWidth && measure.clientHeight > 0) {
81
- if (sWidth == 0) this.zeroWidthHack()
82
- this.checkedZeroWidth = true
83
- }
84
-
85
- return {right: needsV ? sWidth : 0, bottom: needsH ? sWidth : 0}
86
- }
87
-
88
- setScrollLeft(pos) {
89
- if (this.horiz.scrollLeft != pos) this.horiz.scrollLeft = pos
90
- if (this.disableHoriz) this.enableZeroWidthBar(this.horiz, this.disableHoriz, "horiz")
91
- }
92
-
93
- setScrollTop(pos) {
94
- if (this.vert.scrollTop != pos) this.vert.scrollTop = pos
95
- if (this.disableVert) this.enableZeroWidthBar(this.vert, this.disableVert, "vert")
96
- }
97
-
98
- zeroWidthHack() {
99
- let w = mac && !mac_geMountainLion ? "12px" : "18px"
100
- this.horiz.style.height = this.vert.style.width = w
101
- this.horiz.style.visibility = this.vert.style.visibility = "hidden"
102
- this.disableHoriz = new Delayed
103
- this.disableVert = new Delayed
104
- }
105
-
106
- enableZeroWidthBar(bar, delay, type) {
107
- bar.style.visibility = ""
108
- function maybeDisable() {
109
- // To find out whether the scrollbar is still visible, we
110
- // check whether the element under the pixel in the bottom
111
- // right corner of the scrollbar box is the scrollbar box
112
- // itself (when the bar is still visible) or its filler child
113
- // (when the bar is hidden). If it is still visible, we keep
114
- // it enabled, if it's hidden, we disable pointer events.
115
- let box = bar.getBoundingClientRect()
116
- let elt = type == "vert" ? document.elementFromPoint(box.right - 1, (box.top + box.bottom) / 2)
117
- : document.elementFromPoint((box.right + box.left) / 2, box.bottom - 1)
118
- if (elt != bar) bar.style.visibility = "hidden"
119
- else delay.set(1000, maybeDisable)
120
- }
121
- delay.set(1000, maybeDisable)
122
- }
123
-
124
- clear() {
125
- let parent = this.horiz.parentNode
126
- parent.removeChild(this.horiz)
127
- parent.removeChild(this.vert)
128
- }
129
- }
130
-
131
- class NullScrollbars {
132
- update() { return {bottom: 0, right: 0} }
133
- setScrollLeft() {}
134
- setScrollTop() {}
135
- clear() {}
136
- }
137
-
138
- export function updateScrollbars(cm, measure) {
139
- if (!measure) measure = measureForScrollbars(cm)
140
- let startWidth = cm.display.barWidth, startHeight = cm.display.barHeight
141
- updateScrollbarsInner(cm, measure)
142
- for (let i = 0; i < 4 && startWidth != cm.display.barWidth || startHeight != cm.display.barHeight; i++) {
143
- if (startWidth != cm.display.barWidth && cm.options.lineWrapping)
144
- updateHeightsInViewport(cm)
145
- updateScrollbarsInner(cm, measureForScrollbars(cm))
146
- startWidth = cm.display.barWidth; startHeight = cm.display.barHeight
147
- }
148
- }
149
-
150
- // Re-synchronize the fake scrollbars with the actual size of the
151
- // content.
152
- function updateScrollbarsInner(cm, measure) {
153
- let d = cm.display
154
- let sizes = d.scrollbars.update(measure)
155
-
156
- d.sizer.style.paddingRight = (d.barWidth = sizes.right) + "px"
157
- d.sizer.style.paddingBottom = (d.barHeight = sizes.bottom) + "px"
158
- d.heightForcer.style.borderBottom = sizes.bottom + "px solid transparent"
159
-
160
- if (sizes.right && sizes.bottom) {
161
- d.scrollbarFiller.style.display = "block"
162
- d.scrollbarFiller.style.height = sizes.bottom + "px"
163
- d.scrollbarFiller.style.width = sizes.right + "px"
164
- } else d.scrollbarFiller.style.display = ""
165
- if (sizes.bottom && cm.options.coverGutterNextToScrollbar && cm.options.fixedGutter) {
166
- d.gutterFiller.style.display = "block"
167
- d.gutterFiller.style.height = sizes.bottom + "px"
168
- d.gutterFiller.style.width = measure.gutterWidth + "px"
169
- } else d.gutterFiller.style.display = ""
170
- }
171
-
172
- export let scrollbarModel = {"native": NativeScrollbars, "null": NullScrollbars}
173
-
174
- export function initScrollbars(cm) {
175
- if (cm.display.scrollbars) {
176
- cm.display.scrollbars.clear()
177
- if (cm.display.scrollbars.addClass)
178
- rmClass(cm.display.wrapper, cm.display.scrollbars.addClass)
179
- }
180
-
181
- cm.display.scrollbars = new scrollbarModel[cm.options.scrollbarStyle](node => {
182
- cm.display.wrapper.insertBefore(node, cm.display.scrollbarFiller)
183
- // Prevent clicks in the scrollbars from killing focus
184
- on(node, "mousedown", () => {
185
- if (cm.state.focused) setTimeout(() => cm.display.input.focus(), 0)
186
- })
187
- node.setAttribute("cm-not-content", "true")
188
- }, (pos, axis) => {
189
- if (axis == "horizontal") setScrollLeft(cm, pos)
190
- else updateScrollTop(cm, pos)
191
- }, cm)
192
- if (cm.display.scrollbars.addClass)
193
- addClass(cm.display.wrapper, cm.display.scrollbars.addClass)
194
- }
@@ -1,186 +0,0 @@
1
- import { Pos } from "../line/pos.js"
2
- import { cursorCoords, displayHeight, displayWidth, estimateCoords, paddingTop, paddingVert, scrollGap, textHeight } from "../measurement/position_measurement.js"
3
- import { gecko, phantom } from "../util/browser.js"
4
- import { elt } from "../util/dom.js"
5
- import { signalDOMEvent } from "../util/event.js"
6
-
7
- import { startWorker } from "./highlight_worker.js"
8
- import { alignHorizontally } from "./line_numbers.js"
9
- import { updateDisplaySimple } from "./update_display.js"
10
-
11
- // SCROLLING THINGS INTO VIEW
12
-
13
- // If an editor sits on the top or bottom of the window, partially
14
- // scrolled out of view, this ensures that the cursor is visible.
15
- export function maybeScrollWindow(cm, rect) {
16
- if (signalDOMEvent(cm, "scrollCursorIntoView")) return
17
-
18
- let display = cm.display, box = display.sizer.getBoundingClientRect(), doScroll = null
19
- let doc = display.wrapper.ownerDocument
20
- if (rect.top + box.top < 0) doScroll = true
21
- else if (rect.bottom + box.top > (doc.defaultView.innerHeight || doc.documentElement.clientHeight)) doScroll = false
22
- if (doScroll != null && !phantom) {
23
- let scrollNode = elt("div", "\u200b", null, `position: absolute;
24
- top: ${rect.top - display.viewOffset - paddingTop(cm.display)}px;
25
- height: ${rect.bottom - rect.top + scrollGap(cm) + display.barHeight}px;
26
- left: ${rect.left}px; width: ${Math.max(2, rect.right - rect.left)}px;`)
27
- cm.display.lineSpace.appendChild(scrollNode)
28
- scrollNode.scrollIntoView(doScroll)
29
- cm.display.lineSpace.removeChild(scrollNode)
30
- }
31
- }
32
-
33
- // Scroll a given position into view (immediately), verifying that
34
- // it actually became visible (as line heights are accurately
35
- // measured, the position of something may 'drift' during drawing).
36
- export function scrollPosIntoView(cm, pos, end, margin) {
37
- if (margin == null) margin = 0
38
- let rect
39
- if (!cm.options.lineWrapping && pos == end) {
40
- // Set pos and end to the cursor positions around the character pos sticks to
41
- // If pos.sticky == "before", that is around pos.ch - 1, otherwise around pos.ch
42
- // If pos == Pos(_, 0, "before"), pos and end are unchanged
43
- end = pos.sticky == "before" ? Pos(pos.line, pos.ch + 1, "before") : pos
44
- pos = pos.ch ? Pos(pos.line, pos.sticky == "before" ? pos.ch - 1 : pos.ch, "after") : pos
45
- }
46
- for (let limit = 0; limit < 5; limit++) {
47
- let changed = false
48
- let coords = cursorCoords(cm, pos)
49
- let endCoords = !end || end == pos ? coords : cursorCoords(cm, end)
50
- rect = {left: Math.min(coords.left, endCoords.left),
51
- top: Math.min(coords.top, endCoords.top) - margin,
52
- right: Math.max(coords.left, endCoords.left),
53
- bottom: Math.max(coords.bottom, endCoords.bottom) + margin}
54
- let scrollPos = calculateScrollPos(cm, rect)
55
- let startTop = cm.doc.scrollTop, startLeft = cm.doc.scrollLeft
56
- if (scrollPos.scrollTop != null) {
57
- updateScrollTop(cm, scrollPos.scrollTop)
58
- if (Math.abs(cm.doc.scrollTop - startTop) > 1) changed = true
59
- }
60
- if (scrollPos.scrollLeft != null) {
61
- setScrollLeft(cm, scrollPos.scrollLeft)
62
- if (Math.abs(cm.doc.scrollLeft - startLeft) > 1) changed = true
63
- }
64
- if (!changed) break
65
- }
66
- return rect
67
- }
68
-
69
- // Scroll a given set of coordinates into view (immediately).
70
- export function scrollIntoView(cm, rect) {
71
- let scrollPos = calculateScrollPos(cm, rect)
72
- if (scrollPos.scrollTop != null) updateScrollTop(cm, scrollPos.scrollTop)
73
- if (scrollPos.scrollLeft != null) setScrollLeft(cm, scrollPos.scrollLeft)
74
- }
75
-
76
- // Calculate a new scroll position needed to scroll the given
77
- // rectangle into view. Returns an object with scrollTop and
78
- // scrollLeft properties. When these are undefined, the
79
- // vertical/horizontal position does not need to be adjusted.
80
- function calculateScrollPos(cm, rect) {
81
- let display = cm.display, snapMargin = textHeight(cm.display)
82
- if (rect.top < 0) rect.top = 0
83
- let screentop = cm.curOp && cm.curOp.scrollTop != null ? cm.curOp.scrollTop : display.scroller.scrollTop
84
- let screen = displayHeight(cm), result = {}
85
- if (rect.bottom - rect.top > screen) rect.bottom = rect.top + screen
86
- let docBottom = cm.doc.height + paddingVert(display)
87
- let atTop = rect.top < snapMargin, atBottom = rect.bottom > docBottom - snapMargin
88
- if (rect.top < screentop) {
89
- result.scrollTop = atTop ? 0 : rect.top
90
- } else if (rect.bottom > screentop + screen) {
91
- let newTop = Math.min(rect.top, (atBottom ? docBottom : rect.bottom) - screen)
92
- if (newTop != screentop) result.scrollTop = newTop
93
- }
94
-
95
- let gutterSpace = cm.options.fixedGutter ? 0 : display.gutters.offsetWidth
96
- let screenleft = cm.curOp && cm.curOp.scrollLeft != null ? cm.curOp.scrollLeft : display.scroller.scrollLeft - gutterSpace
97
- let screenw = displayWidth(cm) - display.gutters.offsetWidth
98
- let tooWide = rect.right - rect.left > screenw
99
- if (tooWide) rect.right = rect.left + screenw
100
- if (rect.left < 10)
101
- result.scrollLeft = 0
102
- else if (rect.left < screenleft)
103
- result.scrollLeft = Math.max(0, rect.left + gutterSpace - (tooWide ? 0 : 10))
104
- else if (rect.right > screenw + screenleft - 3)
105
- result.scrollLeft = rect.right + (tooWide ? 0 : 10) - screenw
106
- return result
107
- }
108
-
109
- // Store a relative adjustment to the scroll position in the current
110
- // operation (to be applied when the operation finishes).
111
- export function addToScrollTop(cm, top) {
112
- if (top == null) return
113
- resolveScrollToPos(cm)
114
- cm.curOp.scrollTop = (cm.curOp.scrollTop == null ? cm.doc.scrollTop : cm.curOp.scrollTop) + top
115
- }
116
-
117
- // Make sure that at the end of the operation the current cursor is
118
- // shown.
119
- export function ensureCursorVisible(cm) {
120
- resolveScrollToPos(cm)
121
- let cur = cm.getCursor()
122
- cm.curOp.scrollToPos = {from: cur, to: cur, margin: cm.options.cursorScrollMargin}
123
- }
124
-
125
- export function scrollToCoords(cm, x, y) {
126
- if (x != null || y != null) resolveScrollToPos(cm)
127
- if (x != null) cm.curOp.scrollLeft = x
128
- if (y != null) cm.curOp.scrollTop = y
129
- }
130
-
131
- export function scrollToRange(cm, range) {
132
- resolveScrollToPos(cm)
133
- cm.curOp.scrollToPos = range
134
- }
135
-
136
- // When an operation has its scrollToPos property set, and another
137
- // scroll action is applied before the end of the operation, this
138
- // 'simulates' scrolling that position into view in a cheap way, so
139
- // that the effect of intermediate scroll commands is not ignored.
140
- function resolveScrollToPos(cm) {
141
- let range = cm.curOp.scrollToPos
142
- if (range) {
143
- cm.curOp.scrollToPos = null
144
- let from = estimateCoords(cm, range.from), to = estimateCoords(cm, range.to)
145
- scrollToCoordsRange(cm, from, to, range.margin)
146
- }
147
- }
148
-
149
- export function scrollToCoordsRange(cm, from, to, margin) {
150
- let sPos = calculateScrollPos(cm, {
151
- left: Math.min(from.left, to.left),
152
- top: Math.min(from.top, to.top) - margin,
153
- right: Math.max(from.right, to.right),
154
- bottom: Math.max(from.bottom, to.bottom) + margin
155
- })
156
- scrollToCoords(cm, sPos.scrollLeft, sPos.scrollTop)
157
- }
158
-
159
- // Sync the scrollable area and scrollbars, ensure the viewport
160
- // covers the visible area.
161
- export function updateScrollTop(cm, val) {
162
- if (Math.abs(cm.doc.scrollTop - val) < 2) return
163
- if (!gecko) updateDisplaySimple(cm, {top: val})
164
- setScrollTop(cm, val, true)
165
- if (gecko) updateDisplaySimple(cm)
166
- startWorker(cm, 100)
167
- }
168
-
169
- export function setScrollTop(cm, val, forceScroll) {
170
- val = Math.max(0, Math.min(cm.display.scroller.scrollHeight - cm.display.scroller.clientHeight, val))
171
- if (cm.display.scroller.scrollTop == val && !forceScroll) return
172
- cm.doc.scrollTop = val
173
- cm.display.scrollbars.setScrollTop(val)
174
- if (cm.display.scroller.scrollTop != val) cm.display.scroller.scrollTop = val
175
- }
176
-
177
- // Sync scroller and scrollbar, ensure the gutter elements are
178
- // aligned.
179
- export function setScrollLeft(cm, val, isScroller, forceScroll) {
180
- val = Math.max(0, Math.min(val, cm.display.scroller.scrollWidth - cm.display.scroller.clientWidth))
181
- if ((isScroller ? val == cm.doc.scrollLeft : Math.abs(cm.doc.scrollLeft - val) < 2) && !forceScroll) return
182
- cm.doc.scrollLeft = val
183
- alignHorizontally(cm)
184
- if (cm.display.scroller.scrollLeft != val) cm.display.scroller.scrollLeft = val
185
- cm.display.scrollbars.setScrollLeft(val)
186
- }
@@ -1,173 +0,0 @@
1
- import { Pos } from "../line/pos.js"
2
- import { visualLine } from "../line/spans.js"
3
- import { getLine } from "../line/utils_line.js"
4
- import { charCoords, cursorCoords, displayWidth, paddingH, wrappedLineExtentChar } from "../measurement/position_measurement.js"
5
- import { getOrder, iterateBidiSections } from "../util/bidi.js"
6
- import { elt } from "../util/dom.js"
7
- import { onBlur } from "./focus.js"
8
-
9
- export function updateSelection(cm) {
10
- cm.display.input.showSelection(cm.display.input.prepareSelection())
11
- }
12
-
13
- export function prepareSelection(cm, primary = true) {
14
- let doc = cm.doc, result = {}
15
- let curFragment = result.cursors = document.createDocumentFragment()
16
- let selFragment = result.selection = document.createDocumentFragment()
17
-
18
- let customCursor = cm.options.$customCursor
19
- if (customCursor) primary = true
20
- for (let i = 0; i < doc.sel.ranges.length; i++) {
21
- if (!primary && i == doc.sel.primIndex) continue
22
- let range = doc.sel.ranges[i]
23
- if (range.from().line >= cm.display.viewTo || range.to().line < cm.display.viewFrom) continue
24
- let collapsed = range.empty()
25
- if (customCursor) {
26
- let head = customCursor(cm, range)
27
- if (head) drawSelectionCursor(cm, head, curFragment)
28
- } else if (collapsed || cm.options.showCursorWhenSelecting) {
29
- drawSelectionCursor(cm, range.head, curFragment)
30
- }
31
- if (!collapsed)
32
- drawSelectionRange(cm, range, selFragment)
33
- }
34
- return result
35
- }
36
-
37
- // Draws a cursor for the given range
38
- export function drawSelectionCursor(cm, head, output) {
39
- let pos = cursorCoords(cm, head, "div", null, null, !cm.options.singleCursorHeightPerLine)
40
-
41
- let cursor = output.appendChild(elt("div", "\u00a0", "CodeMirror-cursor"))
42
- cursor.style.left = pos.left + "px"
43
- cursor.style.top = pos.top + "px"
44
- cursor.style.height = Math.max(0, pos.bottom - pos.top) * cm.options.cursorHeight + "px"
45
-
46
- if (/\bcm-fat-cursor\b/.test(cm.getWrapperElement().className)) {
47
- let charPos = charCoords(cm, head, "div", null, null)
48
- let width = charPos.right - charPos.left
49
- cursor.style.width = (width > 0 ? width : cm.defaultCharWidth()) + "px"
50
- }
51
-
52
- if (pos.other) {
53
- // Secondary cursor, shown when on a 'jump' in bi-directional text
54
- let otherCursor = output.appendChild(elt("div", "\u00a0", "CodeMirror-cursor CodeMirror-secondarycursor"))
55
- otherCursor.style.display = ""
56
- otherCursor.style.left = pos.other.left + "px"
57
- otherCursor.style.top = pos.other.top + "px"
58
- otherCursor.style.height = (pos.other.bottom - pos.other.top) * .85 + "px"
59
- }
60
- }
61
-
62
- function cmpCoords(a, b) { return a.top - b.top || a.left - b.left }
63
-
64
- // Draws the given range as a highlighted selection
65
- function drawSelectionRange(cm, range, output) {
66
- let display = cm.display, doc = cm.doc
67
- let fragment = document.createDocumentFragment()
68
- let padding = paddingH(cm.display), leftSide = padding.left
69
- let rightSide = Math.max(display.sizerWidth, displayWidth(cm) - display.sizer.offsetLeft) - padding.right
70
- let docLTR = doc.direction == "ltr"
71
-
72
- function add(left, top, width, bottom) {
73
- if (top < 0) top = 0
74
- top = Math.round(top)
75
- bottom = Math.round(bottom)
76
- fragment.appendChild(elt("div", null, "CodeMirror-selected", `position: absolute; left: ${left}px;
77
- top: ${top}px; width: ${width == null ? rightSide - left : width}px;
78
- height: ${bottom - top}px`))
79
- }
80
-
81
- function drawForLine(line, fromArg, toArg) {
82
- let lineObj = getLine(doc, line)
83
- let lineLen = lineObj.text.length
84
- let start, end
85
- function coords(ch, bias) {
86
- return charCoords(cm, Pos(line, ch), "div", lineObj, bias)
87
- }
88
-
89
- function wrapX(pos, dir, side) {
90
- let extent = wrappedLineExtentChar(cm, lineObj, null, pos)
91
- let prop = (dir == "ltr") == (side == "after") ? "left" : "right"
92
- let ch = side == "after" ? extent.begin : extent.end - (/\s/.test(lineObj.text.charAt(extent.end - 1)) ? 2 : 1)
93
- return coords(ch, prop)[prop]
94
- }
95
-
96
- let order = getOrder(lineObj, doc.direction)
97
- iterateBidiSections(order, fromArg || 0, toArg == null ? lineLen : toArg, (from, to, dir, i) => {
98
- let ltr = dir == "ltr"
99
- let fromPos = coords(from, ltr ? "left" : "right")
100
- let toPos = coords(to - 1, ltr ? "right" : "left")
101
-
102
- let openStart = fromArg == null && from == 0, openEnd = toArg == null && to == lineLen
103
- let first = i == 0, last = !order || i == order.length - 1
104
- if (toPos.top - fromPos.top <= 3) { // Single line
105
- let openLeft = (docLTR ? openStart : openEnd) && first
106
- let openRight = (docLTR ? openEnd : openStart) && last
107
- let left = openLeft ? leftSide : (ltr ? fromPos : toPos).left
108
- let right = openRight ? rightSide : (ltr ? toPos : fromPos).right
109
- add(left, fromPos.top, right - left, fromPos.bottom)
110
- } else { // Multiple lines
111
- let topLeft, topRight, botLeft, botRight
112
- if (ltr) {
113
- topLeft = docLTR && openStart && first ? leftSide : fromPos.left
114
- topRight = docLTR ? rightSide : wrapX(from, dir, "before")
115
- botLeft = docLTR ? leftSide : wrapX(to, dir, "after")
116
- botRight = docLTR && openEnd && last ? rightSide : toPos.right
117
- } else {
118
- topLeft = !docLTR ? leftSide : wrapX(from, dir, "before")
119
- topRight = !docLTR && openStart && first ? rightSide : fromPos.right
120
- botLeft = !docLTR && openEnd && last ? leftSide : toPos.left
121
- botRight = !docLTR ? rightSide : wrapX(to, dir, "after")
122
- }
123
- add(topLeft, fromPos.top, topRight - topLeft, fromPos.bottom)
124
- if (fromPos.bottom < toPos.top) add(leftSide, fromPos.bottom, null, toPos.top)
125
- add(botLeft, toPos.top, botRight - botLeft, toPos.bottom)
126
- }
127
-
128
- if (!start || cmpCoords(fromPos, start) < 0) start = fromPos
129
- if (cmpCoords(toPos, start) < 0) start = toPos
130
- if (!end || cmpCoords(fromPos, end) < 0) end = fromPos
131
- if (cmpCoords(toPos, end) < 0) end = toPos
132
- })
133
- return {start: start, end: end}
134
- }
135
-
136
- let sFrom = range.from(), sTo = range.to()
137
- if (sFrom.line == sTo.line) {
138
- drawForLine(sFrom.line, sFrom.ch, sTo.ch)
139
- } else {
140
- let fromLine = getLine(doc, sFrom.line), toLine = getLine(doc, sTo.line)
141
- let singleVLine = visualLine(fromLine) == visualLine(toLine)
142
- let leftEnd = drawForLine(sFrom.line, sFrom.ch, singleVLine ? fromLine.text.length + 1 : null).end
143
- let rightStart = drawForLine(sTo.line, singleVLine ? 0 : null, sTo.ch).start
144
- if (singleVLine) {
145
- if (leftEnd.top < rightStart.top - 2) {
146
- add(leftEnd.right, leftEnd.top, null, leftEnd.bottom)
147
- add(leftSide, rightStart.top, rightStart.left, rightStart.bottom)
148
- } else {
149
- add(leftEnd.right, leftEnd.top, rightStart.left - leftEnd.right, leftEnd.bottom)
150
- }
151
- }
152
- if (leftEnd.bottom < rightStart.top)
153
- add(leftSide, leftEnd.bottom, null, rightStart.top)
154
- }
155
-
156
- output.appendChild(fragment)
157
- }
158
-
159
- // Cursor-blinking
160
- export function restartBlink(cm) {
161
- if (!cm.state.focused) return
162
- let display = cm.display
163
- clearInterval(display.blinker)
164
- let on = true
165
- display.cursorDiv.style.visibility = ""
166
- if (cm.options.cursorBlinkRate > 0)
167
- display.blinker = setInterval(() => {
168
- if (!cm.hasFocus()) onBlur(cm)
169
- display.cursorDiv.style.visibility = (on = !on) ? "" : "hidden"
170
- }, cm.options.cursorBlinkRate)
171
- else if (cm.options.cursorBlinkRate < 0)
172
- display.cursorDiv.style.visibility = "hidden"
173
- }