@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.
- package/package.json +2 -2
- package/src/commands.mjs +2 -2
- package/src/server.mjs +68 -61
- package/src/share.mjs +22 -39
- package/.eslintrc.cjs +0 -15
- package/test/produce.mjs +0 -79
- package/test/share.mjs +0 -18
- package/test/test.jsontag +0 -20
- package/www/assets/css/style.css +0 -2296
- package/www/assets/feather-sprite.svg +0 -1
- package/www/assets/img/simplystore-narrow-white.svg +0 -138
- package/www/assets/img/simplystore-narrow.svg +0 -138
- package/www/assets/img/simplystore-white.svg +0 -153
- package/www/assets/img/simplystore.svg +0 -153
- package/www/codemirror/AUTHORS +0 -979
- package/www/codemirror/CHANGELOG.md +0 -2208
- package/www/codemirror/CONTRIBUTING.md +0 -92
- package/www/codemirror/LICENSE +0 -21
- package/www/codemirror/README.md +0 -47
- package/www/codemirror/addon/comment/comment.js +0 -211
- package/www/codemirror/addon/comment/continuecomment.js +0 -114
- package/www/codemirror/addon/dialog/dialog.css +0 -32
- package/www/codemirror/addon/dialog/dialog.js +0 -163
- package/www/codemirror/addon/display/autorefresh.js +0 -47
- package/www/codemirror/addon/display/fullscreen.css +0 -6
- package/www/codemirror/addon/display/fullscreen.js +0 -41
- package/www/codemirror/addon/display/panel.js +0 -133
- package/www/codemirror/addon/display/placeholder.js +0 -78
- package/www/codemirror/addon/display/rulers.js +0 -51
- package/www/codemirror/addon/edit/closebrackets.js +0 -201
- package/www/codemirror/addon/edit/closetag.js +0 -185
- package/www/codemirror/addon/edit/continuelist.js +0 -101
- package/www/codemirror/addon/edit/matchbrackets.js +0 -160
- package/www/codemirror/addon/edit/matchtags.js +0 -66
- package/www/codemirror/addon/edit/trailingspace.js +0 -27
- package/www/codemirror/addon/fold/brace-fold.js +0 -119
- package/www/codemirror/addon/fold/comment-fold.js +0 -59
- package/www/codemirror/addon/fold/foldcode.js +0 -159
- package/www/codemirror/addon/fold/foldgutter.css +0 -20
- package/www/codemirror/addon/fold/foldgutter.js +0 -169
- package/www/codemirror/addon/fold/indent-fold.js +0 -48
- package/www/codemirror/addon/fold/markdown-fold.js +0 -49
- package/www/codemirror/addon/fold/xml-fold.js +0 -184
- package/www/codemirror/addon/hint/anyword-hint.js +0 -41
- package/www/codemirror/addon/hint/css-hint.js +0 -66
- package/www/codemirror/addon/hint/html-hint.js +0 -351
- package/www/codemirror/addon/hint/javascript-hint.js +0 -162
- package/www/codemirror/addon/hint/show-hint.css +0 -37
- package/www/codemirror/addon/hint/show-hint.js +0 -523
- package/www/codemirror/addon/hint/sql-hint.js +0 -304
- package/www/codemirror/addon/hint/xml-hint.js +0 -132
- package/www/codemirror/addon/lint/coffeescript-lint.js +0 -47
- package/www/codemirror/addon/lint/css-lint.js +0 -40
- package/www/codemirror/addon/lint/html-lint.js +0 -59
- package/www/codemirror/addon/lint/javascript-lint.js +0 -65
- package/www/codemirror/addon/lint/json-lint.js +0 -40
- package/www/codemirror/addon/lint/lint.css +0 -79
- package/www/codemirror/addon/lint/lint.js +0 -291
- package/www/codemirror/addon/lint/yaml-lint.js +0 -41
- package/www/codemirror/addon/merge/merge.css +0 -119
- package/www/codemirror/addon/merge/merge.js +0 -1018
- package/www/codemirror/addon/mode/loadmode.js +0 -66
- package/www/codemirror/addon/mode/multiplex.js +0 -136
- package/www/codemirror/addon/mode/multiplex_test.js +0 -49
- package/www/codemirror/addon/mode/overlay.js +0 -90
- package/www/codemirror/addon/mode/simple.js +0 -216
- package/www/codemirror/addon/runmode/colorize.js +0 -40
- package/www/codemirror/addon/runmode/runmode-standalone.js +0 -334
- package/www/codemirror/addon/runmode/runmode.js +0 -76
- package/www/codemirror/addon/runmode/runmode.node.js +0 -329
- package/www/codemirror/addon/scroll/annotatescrollbar.js +0 -128
- package/www/codemirror/addon/scroll/scrollpastend.js +0 -48
- package/www/codemirror/addon/scroll/simplescrollbars.css +0 -66
- package/www/codemirror/addon/scroll/simplescrollbars.js +0 -152
- package/www/codemirror/addon/search/jump-to-line.js +0 -53
- package/www/codemirror/addon/search/match-highlighter.js +0 -167
- package/www/codemirror/addon/search/matchesonscrollbar.css +0 -8
- package/www/codemirror/addon/search/matchesonscrollbar.js +0 -97
- package/www/codemirror/addon/search/search.js +0 -295
- package/www/codemirror/addon/search/searchcursor.js +0 -305
- package/www/codemirror/addon/selection/active-line.js +0 -72
- package/www/codemirror/addon/selection/mark-selection.js +0 -119
- package/www/codemirror/addon/selection/selection-pointer.js +0 -98
- package/www/codemirror/addon/tern/tern.css +0 -87
- package/www/codemirror/addon/tern/tern.js +0 -756
- package/www/codemirror/addon/tern/worker.js +0 -44
- package/www/codemirror/addon/wrap/hardwrap.js +0 -160
- package/www/codemirror/bin/source-highlight +0 -48
- package/www/codemirror/keymap/emacs.js +0 -545
- package/www/codemirror/keymap/sublime.js +0 -720
- package/www/codemirror/keymap/vim.js +0 -5978
- package/www/codemirror/lib/codemirror.css +0 -344
- package/www/codemirror/lib/codemirror.js +0 -9874
- package/www/codemirror/mode/apl/apl.js +0 -174
- package/www/codemirror/mode/asciiarmor/asciiarmor.js +0 -74
- package/www/codemirror/mode/asn.1/asn.1.js +0 -204
- package/www/codemirror/mode/asterisk/asterisk.js +0 -220
- package/www/codemirror/mode/brainfuck/brainfuck.js +0 -85
- package/www/codemirror/mode/clike/clike.js +0 -940
- package/www/codemirror/mode/clojure/clojure.js +0 -292
- package/www/codemirror/mode/cmake/cmake.js +0 -97
- package/www/codemirror/mode/cobol/cobol.js +0 -255
- package/www/codemirror/mode/coffeescript/coffeescript.js +0 -359
- package/www/codemirror/mode/commonlisp/commonlisp.js +0 -125
- package/www/codemirror/mode/crystal/crystal.js +0 -433
- package/www/codemirror/mode/css/css.js +0 -862
- package/www/codemirror/mode/cypher/cypher.js +0 -152
- package/www/codemirror/mode/d/d.js +0 -223
- package/www/codemirror/mode/dart/dart.js +0 -166
- package/www/codemirror/mode/diff/diff.js +0 -47
- package/www/codemirror/mode/django/django.js +0 -356
- package/www/codemirror/mode/dockerfile/dockerfile.js +0 -211
- package/www/codemirror/mode/dtd/dtd.js +0 -142
- package/www/codemirror/mode/dylan/dylan.js +0 -352
- package/www/codemirror/mode/ebnf/ebnf.js +0 -195
- package/www/codemirror/mode/ecl/ecl.js +0 -206
- package/www/codemirror/mode/eiffel/eiffel.js +0 -160
- package/www/codemirror/mode/elm/elm.js +0 -245
- package/www/codemirror/mode/erlang/erlang.js +0 -619
- package/www/codemirror/mode/factor/factor.js +0 -85
- package/www/codemirror/mode/fcl/fcl.js +0 -173
- package/www/codemirror/mode/forth/forth.js +0 -180
- package/www/codemirror/mode/fortran/fortran.js +0 -188
- package/www/codemirror/mode/gas/gas.js +0 -353
- package/www/codemirror/mode/gfm/gfm.js +0 -129
- package/www/codemirror/mode/gherkin/gherkin.js +0 -178
- package/www/codemirror/mode/go/go.js +0 -187
- package/www/codemirror/mode/groovy/groovy.js +0 -247
- package/www/codemirror/mode/haml/haml.js +0 -161
- package/www/codemirror/mode/handlebars/handlebars.js +0 -70
- package/www/codemirror/mode/haskell/haskell.js +0 -268
- package/www/codemirror/mode/haskell-literate/haskell-literate.js +0 -43
- package/www/codemirror/mode/haxe/haxe.js +0 -515
- package/www/codemirror/mode/htmlembedded/htmlembedded.js +0 -37
- package/www/codemirror/mode/htmlmixed/htmlmixed.js +0 -153
- package/www/codemirror/mode/http/http.js +0 -113
- package/www/codemirror/mode/idl/idl.js +0 -290
- package/www/codemirror/mode/javascript/javascript.js +0 -960
- package/www/codemirror/mode/jinja2/jinja2.js +0 -193
- package/www/codemirror/mode/jsx/jsx.js +0 -148
- package/www/codemirror/mode/julia/julia.js +0 -390
- package/www/codemirror/mode/livescript/livescript.js +0 -280
- package/www/codemirror/mode/lua/lua.js +0 -160
- package/www/codemirror/mode/markdown/markdown.js +0 -886
- package/www/codemirror/mode/mathematica/mathematica.js +0 -176
- package/www/codemirror/mode/mbox/mbox.js +0 -129
- package/www/codemirror/mode/meta.js +0 -221
- package/www/codemirror/mode/mirc/mirc.js +0 -193
- package/www/codemirror/mode/mllike/mllike.js +0 -359
- package/www/codemirror/mode/modelica/modelica.js +0 -245
- package/www/codemirror/mode/mscgen/mscgen.js +0 -175
- package/www/codemirror/mode/mumps/mumps.js +0 -148
- package/www/codemirror/mode/nginx/nginx.js +0 -178
- package/www/codemirror/mode/nsis/nsis.js +0 -95
- package/www/codemirror/mode/ntriples/ntriples.js +0 -195
- package/www/codemirror/mode/octave/octave.js +0 -139
- package/www/codemirror/mode/oz/oz.js +0 -252
- package/www/codemirror/mode/pascal/pascal.js +0 -136
- package/www/codemirror/mode/pegjs/pegjs.js +0 -111
- package/www/codemirror/mode/perl/perl.js +0 -836
- package/www/codemirror/mode/php/php.js +0 -234
- package/www/codemirror/mode/pig/pig.js +0 -178
- package/www/codemirror/mode/powershell/powershell.js +0 -398
- package/www/codemirror/mode/properties/properties.js +0 -78
- package/www/codemirror/mode/protobuf/protobuf.js +0 -72
- package/www/codemirror/mode/pug/pug.js +0 -591
- package/www/codemirror/mode/puppet/puppet.js +0 -220
- package/www/codemirror/mode/python/python.js +0 -402
- package/www/codemirror/mode/q/q.js +0 -139
- package/www/codemirror/mode/r/r.js +0 -190
- package/www/codemirror/mode/rpm/changes/index.html +0 -66
- package/www/codemirror/mode/rpm/rpm.js +0 -109
- package/www/codemirror/mode/rst/rst.js +0 -557
- package/www/codemirror/mode/ruby/ruby.js +0 -303
- package/www/codemirror/mode/rust/rust.js +0 -72
- package/www/codemirror/mode/sas/sas.js +0 -303
- package/www/codemirror/mode/sass/sass.js +0 -459
- package/www/codemirror/mode/scheme/scheme.js +0 -284
- package/www/codemirror/mode/shell/shell.js +0 -168
- package/www/codemirror/mode/sieve/sieve.js +0 -193
- package/www/codemirror/mode/slim/slim.js +0 -575
- package/www/codemirror/mode/smalltalk/smalltalk.js +0 -168
- package/www/codemirror/mode/smarty/smarty.js +0 -225
- package/www/codemirror/mode/solr/solr.js +0 -104
- package/www/codemirror/mode/soy/soy.js +0 -665
- package/www/codemirror/mode/sparql/sparql.js +0 -184
- package/www/codemirror/mode/spreadsheet/spreadsheet.js +0 -112
- package/www/codemirror/mode/sql/sql.js +0 -525
- package/www/codemirror/mode/stex/stex.js +0 -264
- package/www/codemirror/mode/stylus/stylus.js +0 -775
- package/www/codemirror/mode/swift/swift.js +0 -221
- package/www/codemirror/mode/tcl/tcl.js +0 -140
- package/www/codemirror/mode/textile/textile.js +0 -469
- package/www/codemirror/mode/tiddlywiki/tiddlywiki.css +0 -14
- package/www/codemirror/mode/tiddlywiki/tiddlywiki.js +0 -308
- package/www/codemirror/mode/tiki/tiki.css +0 -26
- package/www/codemirror/mode/tiki/tiki.js +0 -312
- package/www/codemirror/mode/toml/toml.js +0 -88
- package/www/codemirror/mode/tornado/tornado.js +0 -68
- package/www/codemirror/mode/troff/troff.js +0 -84
- package/www/codemirror/mode/ttcn/ttcn.js +0 -283
- package/www/codemirror/mode/ttcn-cfg/ttcn-cfg.js +0 -214
- package/www/codemirror/mode/turtle/turtle.js +0 -162
- package/www/codemirror/mode/twig/twig.js +0 -141
- package/www/codemirror/mode/vb/vb.js +0 -275
- package/www/codemirror/mode/vbscript/vbscript.js +0 -350
- package/www/codemirror/mode/velocity/velocity.js +0 -202
- package/www/codemirror/mode/verilog/verilog.js +0 -781
- package/www/codemirror/mode/vhdl/vhdl.js +0 -189
- package/www/codemirror/mode/vue/vue.js +0 -77
- package/www/codemirror/mode/wast/wast.js +0 -132
- package/www/codemirror/mode/webidl/webidl.js +0 -195
- package/www/codemirror/mode/xml/xml.js +0 -417
- package/www/codemirror/mode/xquery/xquery.js +0 -448
- package/www/codemirror/mode/yacas/yacas.js +0 -204
- package/www/codemirror/mode/yaml/yaml.js +0 -120
- package/www/codemirror/mode/yaml-frontmatter/yaml-frontmatter.js +0 -72
- package/www/codemirror/mode/z80/z80.js +0 -116
- package/www/codemirror/package.json +0 -52
- package/www/codemirror/rollup.config.js +0 -52
- package/www/codemirror/src/addon/runmode/codemirror-standalone.js +0 -24
- package/www/codemirror/src/addon/runmode/codemirror.node.js +0 -21
- package/www/codemirror/src/addon/runmode/runmode-standalone.js +0 -2
- package/www/codemirror/src/addon/runmode/runmode.node.js +0 -2
- package/www/codemirror/src/codemirror.js +0 -3
- package/www/codemirror/src/display/Display.js +0 -116
- package/www/codemirror/src/display/focus.js +0 -50
- package/www/codemirror/src/display/gutters.js +0 -44
- package/www/codemirror/src/display/highlight_worker.js +0 -55
- package/www/codemirror/src/display/line_numbers.js +0 -48
- package/www/codemirror/src/display/mode_state.js +0 -22
- package/www/codemirror/src/display/operations.js +0 -206
- package/www/codemirror/src/display/scroll_events.js +0 -132
- package/www/codemirror/src/display/scrollbars.js +0 -194
- package/www/codemirror/src/display/scrolling.js +0 -186
- package/www/codemirror/src/display/selection.js +0 -173
- package/www/codemirror/src/display/update_display.js +0 -267
- package/www/codemirror/src/display/update_line.js +0 -189
- package/www/codemirror/src/display/update_lines.js +0 -82
- package/www/codemirror/src/display/view_tracking.js +0 -153
- package/www/codemirror/src/edit/CodeMirror.js +0 -217
- package/www/codemirror/src/edit/commands.js +0 -178
- package/www/codemirror/src/edit/deleteNearSelection.js +0 -30
- package/www/codemirror/src/edit/drop_events.js +0 -130
- package/www/codemirror/src/edit/fromTextArea.js +0 -61
- package/www/codemirror/src/edit/global_events.js +0 -45
- package/www/codemirror/src/edit/key_events.js +0 -163
- package/www/codemirror/src/edit/legacy.js +0 -62
- package/www/codemirror/src/edit/main.js +0 -69
- package/www/codemirror/src/edit/methods.js +0 -555
- package/www/codemirror/src/edit/mouse_events.js +0 -417
- package/www/codemirror/src/edit/options.js +0 -194
- package/www/codemirror/src/edit/utils.js +0 -7
- package/www/codemirror/src/input/ContentEditableInput.js +0 -546
- package/www/codemirror/src/input/TextareaInput.js +0 -380
- package/www/codemirror/src/input/indent.js +0 -71
- package/www/codemirror/src/input/input.js +0 -134
- package/www/codemirror/src/input/keymap.js +0 -147
- package/www/codemirror/src/input/keynames.js +0 -17
- package/www/codemirror/src/input/movement.js +0 -111
- package/www/codemirror/src/line/highlight.js +0 -284
- package/www/codemirror/src/line/line_data.js +0 -349
- package/www/codemirror/src/line/pos.js +0 -40
- package/www/codemirror/src/line/saw_special_spans.js +0 -10
- package/www/codemirror/src/line/spans.js +0 -390
- package/www/codemirror/src/line/utils_line.js +0 -85
- package/www/codemirror/src/measurement/position_measurement.js +0 -702
- package/www/codemirror/src/measurement/widgets.js +0 -26
- package/www/codemirror/src/model/Doc.js +0 -436
- package/www/codemirror/src/model/change_measurement.js +0 -61
- package/www/codemirror/src/model/changes.js +0 -339
- package/www/codemirror/src/model/chunk.js +0 -167
- package/www/codemirror/src/model/document_data.js +0 -112
- package/www/codemirror/src/model/history.js +0 -228
- package/www/codemirror/src/model/line_widget.js +0 -78
- package/www/codemirror/src/model/mark_text.js +0 -293
- package/www/codemirror/src/model/selection.js +0 -84
- package/www/codemirror/src/model/selection_updates.js +0 -216
- package/www/codemirror/src/modes.js +0 -96
- package/www/codemirror/src/util/StringStream.js +0 -90
- package/www/codemirror/src/util/bidi.js +0 -215
- package/www/codemirror/src/util/browser.js +0 -34
- package/www/codemirror/src/util/dom.js +0 -101
- package/www/codemirror/src/util/event.js +0 -103
- package/www/codemirror/src/util/feature_detection.js +0 -84
- package/www/codemirror/src/util/misc.js +0 -168
- package/www/codemirror/src/util/operation_group.js +0 -72
- package/www/codemirror/theme/3024-day.css +0 -41
- package/www/codemirror/theme/3024-night.css +0 -39
- package/www/codemirror/theme/abbott.css +0 -268
- package/www/codemirror/theme/abcdef.css +0 -32
- package/www/codemirror/theme/ambiance-mobile.css +0 -5
- package/www/codemirror/theme/ambiance.css +0 -74
- package/www/codemirror/theme/ayu-dark.css +0 -44
- package/www/codemirror/theme/ayu-mirage.css +0 -45
- package/www/codemirror/theme/base16-dark.css +0 -40
- package/www/codemirror/theme/base16-light.css +0 -38
- package/www/codemirror/theme/bespin.css +0 -34
- package/www/codemirror/theme/blackboard.css +0 -32
- package/www/codemirror/theme/cobalt.css +0 -25
- package/www/codemirror/theme/colorforth.css +0 -33
- package/www/codemirror/theme/darcula.css +0 -53
- package/www/codemirror/theme/dracula.css +0 -40
- package/www/codemirror/theme/duotone-dark.css +0 -35
- package/www/codemirror/theme/duotone-light.css +0 -36
- package/www/codemirror/theme/eclipse.css +0 -23
- package/www/codemirror/theme/elegant.css +0 -13
- package/www/codemirror/theme/erlang-dark.css +0 -34
- package/www/codemirror/theme/gruvbox-dark.css +0 -39
- package/www/codemirror/theme/hopscotch.css +0 -34
- package/www/codemirror/theme/icecoder.css +0 -43
- package/www/codemirror/theme/idea.css +0 -42
- package/www/codemirror/theme/isotope.css +0 -34
- package/www/codemirror/theme/juejin.css +0 -30
- package/www/codemirror/theme/lesser-dark.css +0 -47
- package/www/codemirror/theme/liquibyte.css +0 -95
- package/www/codemirror/theme/lucario.css +0 -37
- package/www/codemirror/theme/material-darker.css +0 -135
- package/www/codemirror/theme/material-ocean.css +0 -141
- package/www/codemirror/theme/material-palenight.css +0 -141
- package/www/codemirror/theme/material.css +0 -141
- package/www/codemirror/theme/mbo.css +0 -37
- package/www/codemirror/theme/mdn-like.css +0 -46
- package/www/codemirror/theme/midnight.css +0 -39
- package/www/codemirror/theme/monokai.css +0 -41
- package/www/codemirror/theme/moxer.css +0 -143
- package/www/codemirror/theme/neat.css +0 -12
- package/www/codemirror/theme/neo.css +0 -43
- package/www/codemirror/theme/night.css +0 -27
- package/www/codemirror/theme/nord.css +0 -42
- package/www/codemirror/theme/oceanic-next.css +0 -46
- package/www/codemirror/theme/panda-syntax.css +0 -85
- package/www/codemirror/theme/paraiso-dark.css +0 -38
- package/www/codemirror/theme/paraiso-light.css +0 -38
- package/www/codemirror/theme/pastel-on-dark.css +0 -52
- package/www/codemirror/theme/railscasts.css +0 -34
- package/www/codemirror/theme/rubyblue.css +0 -25
- package/www/codemirror/theme/seti.css +0 -44
- package/www/codemirror/theme/shadowfox.css +0 -52
- package/www/codemirror/theme/solarized.css +0 -165
- package/www/codemirror/theme/ssms.css +0 -16
- package/www/codemirror/theme/the-matrix.css +0 -30
- package/www/codemirror/theme/tomorrow-night-bright.css +0 -35
- package/www/codemirror/theme/tomorrow-night-eighties.css +0 -38
- package/www/codemirror/theme/ttcn.css +0 -64
- package/www/codemirror/theme/twilight.css +0 -32
- package/www/codemirror/theme/vibrant-ink.css +0 -34
- package/www/codemirror/theme/xq-dark.css +0 -53
- package/www/codemirror/theme/xq-light.css +0 -43
- package/www/codemirror/theme/yeti.css +0 -44
- package/www/codemirror/theme/yonce.css +0 -59
- package/www/codemirror/theme/zenburn.css +0 -37
- package/www/index.html +0 -359
|
@@ -1,120 +0,0 @@
|
|
|
1
|
-
// CodeMirror, copyright (c) by Marijn Haverbeke and others
|
|
2
|
-
// Distributed under an MIT license: https://codemirror.net/5/LICENSE
|
|
3
|
-
|
|
4
|
-
(function(mod) {
|
|
5
|
-
if (typeof exports == "object" && typeof module == "object") // CommonJS
|
|
6
|
-
mod(require("../../lib/codemirror"));
|
|
7
|
-
else if (typeof define == "function" && define.amd) // AMD
|
|
8
|
-
define(["../../lib/codemirror"], mod);
|
|
9
|
-
else // Plain browser env
|
|
10
|
-
mod(CodeMirror);
|
|
11
|
-
})(function(CodeMirror) {
|
|
12
|
-
"use strict";
|
|
13
|
-
|
|
14
|
-
CodeMirror.defineMode("yaml", function() {
|
|
15
|
-
|
|
16
|
-
var cons = ['true', 'false', 'on', 'off', 'yes', 'no'];
|
|
17
|
-
var keywordRegex = new RegExp("\\b(("+cons.join(")|(")+"))$", 'i');
|
|
18
|
-
|
|
19
|
-
return {
|
|
20
|
-
token: function(stream, state) {
|
|
21
|
-
var ch = stream.peek();
|
|
22
|
-
var esc = state.escaped;
|
|
23
|
-
state.escaped = false;
|
|
24
|
-
/* comments */
|
|
25
|
-
if (ch == "#" && (stream.pos == 0 || /\s/.test(stream.string.charAt(stream.pos - 1)))) {
|
|
26
|
-
stream.skipToEnd();
|
|
27
|
-
return "comment";
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
if (stream.match(/^('([^']|\\.)*'?|"([^"]|\\.)*"?)/))
|
|
31
|
-
return "string";
|
|
32
|
-
|
|
33
|
-
if (state.literal && stream.indentation() > state.keyCol) {
|
|
34
|
-
stream.skipToEnd(); return "string";
|
|
35
|
-
} else if (state.literal) { state.literal = false; }
|
|
36
|
-
if (stream.sol()) {
|
|
37
|
-
state.keyCol = 0;
|
|
38
|
-
state.pair = false;
|
|
39
|
-
state.pairStart = false;
|
|
40
|
-
/* document start */
|
|
41
|
-
if(stream.match('---')) { return "def"; }
|
|
42
|
-
/* document end */
|
|
43
|
-
if (stream.match('...')) { return "def"; }
|
|
44
|
-
/* array list item */
|
|
45
|
-
if (stream.match(/\s*-\s+/)) { return 'meta'; }
|
|
46
|
-
}
|
|
47
|
-
/* inline pairs/lists */
|
|
48
|
-
if (stream.match(/^(\{|\}|\[|\])/)) {
|
|
49
|
-
if (ch == '{')
|
|
50
|
-
state.inlinePairs++;
|
|
51
|
-
else if (ch == '}')
|
|
52
|
-
state.inlinePairs--;
|
|
53
|
-
else if (ch == '[')
|
|
54
|
-
state.inlineList++;
|
|
55
|
-
else
|
|
56
|
-
state.inlineList--;
|
|
57
|
-
return 'meta';
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
/* list separator */
|
|
61
|
-
if (state.inlineList > 0 && !esc && ch == ',') {
|
|
62
|
-
stream.next();
|
|
63
|
-
return 'meta';
|
|
64
|
-
}
|
|
65
|
-
/* pairs separator */
|
|
66
|
-
if (state.inlinePairs > 0 && !esc && ch == ',') {
|
|
67
|
-
state.keyCol = 0;
|
|
68
|
-
state.pair = false;
|
|
69
|
-
state.pairStart = false;
|
|
70
|
-
stream.next();
|
|
71
|
-
return 'meta';
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
/* start of value of a pair */
|
|
75
|
-
if (state.pairStart) {
|
|
76
|
-
/* block literals */
|
|
77
|
-
if (stream.match(/^\s*(\||\>)\s*/)) { state.literal = true; return 'meta'; };
|
|
78
|
-
/* references */
|
|
79
|
-
if (stream.match(/^\s*(\&|\*)[a-z0-9\._-]+\b/i)) { return 'variable-2'; }
|
|
80
|
-
/* numbers */
|
|
81
|
-
if (state.inlinePairs == 0 && stream.match(/^\s*-?[0-9\.\,]+\s?$/)) { return 'number'; }
|
|
82
|
-
if (state.inlinePairs > 0 && stream.match(/^\s*-?[0-9\.\,]+\s?(?=(,|}))/)) { return 'number'; }
|
|
83
|
-
/* keywords */
|
|
84
|
-
if (stream.match(keywordRegex)) { return 'keyword'; }
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
/* pairs (associative arrays) -> key */
|
|
88
|
-
if (!state.pair && stream.match(/^\s*(?:[,\[\]{}&*!|>'"%@`][^\s'":]|[^,\[\]{}#&*!|>'"%@`])[^#]*?(?=\s*:($|\s))/)) {
|
|
89
|
-
state.pair = true;
|
|
90
|
-
state.keyCol = stream.indentation();
|
|
91
|
-
return "atom";
|
|
92
|
-
}
|
|
93
|
-
if (state.pair && stream.match(/^:\s*/)) { state.pairStart = true; return 'meta'; }
|
|
94
|
-
|
|
95
|
-
/* nothing found, continue */
|
|
96
|
-
state.pairStart = false;
|
|
97
|
-
state.escaped = (ch == '\\');
|
|
98
|
-
stream.next();
|
|
99
|
-
return null;
|
|
100
|
-
},
|
|
101
|
-
startState: function() {
|
|
102
|
-
return {
|
|
103
|
-
pair: false,
|
|
104
|
-
pairStart: false,
|
|
105
|
-
keyCol: 0,
|
|
106
|
-
inlinePairs: 0,
|
|
107
|
-
inlineList: 0,
|
|
108
|
-
literal: false,
|
|
109
|
-
escaped: false
|
|
110
|
-
};
|
|
111
|
-
},
|
|
112
|
-
lineComment: "#",
|
|
113
|
-
fold: "indent"
|
|
114
|
-
};
|
|
115
|
-
});
|
|
116
|
-
|
|
117
|
-
CodeMirror.defineMIME("text/x-yaml", "yaml");
|
|
118
|
-
CodeMirror.defineMIME("text/yaml", "yaml");
|
|
119
|
-
|
|
120
|
-
});
|
|
@@ -1,72 +0,0 @@
|
|
|
1
|
-
// CodeMirror, copyright (c) by Marijn Haverbeke and others
|
|
2
|
-
// Distributed under an MIT license: https://codemirror.net/5/LICENSE
|
|
3
|
-
|
|
4
|
-
(function (mod) {
|
|
5
|
-
if (typeof exports == "object" && typeof module == "object") // CommonJS
|
|
6
|
-
mod(require("../../lib/codemirror"), require("../yaml/yaml"))
|
|
7
|
-
else if (typeof define == "function" && define.amd) // AMD
|
|
8
|
-
define(["../../lib/codemirror", "../yaml/yaml"], mod)
|
|
9
|
-
else // Plain browser env
|
|
10
|
-
mod(CodeMirror)
|
|
11
|
-
})(function (CodeMirror) {
|
|
12
|
-
|
|
13
|
-
var START = 0, FRONTMATTER = 1, BODY = 2
|
|
14
|
-
|
|
15
|
-
// a mixed mode for Markdown text with an optional YAML front matter
|
|
16
|
-
CodeMirror.defineMode("yaml-frontmatter", function (config, parserConfig) {
|
|
17
|
-
var yamlMode = CodeMirror.getMode(config, "yaml")
|
|
18
|
-
var innerMode = CodeMirror.getMode(config, parserConfig && parserConfig.base || "gfm")
|
|
19
|
-
|
|
20
|
-
function localMode(state) {
|
|
21
|
-
return state.state == FRONTMATTER ? {mode: yamlMode, state: state.yaml} : {mode: innerMode, state: state.inner}
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
return {
|
|
25
|
-
startState: function () {
|
|
26
|
-
return {
|
|
27
|
-
state: START,
|
|
28
|
-
yaml: null,
|
|
29
|
-
inner: CodeMirror.startState(innerMode)
|
|
30
|
-
}
|
|
31
|
-
},
|
|
32
|
-
copyState: function (state) {
|
|
33
|
-
return {
|
|
34
|
-
state: state.state,
|
|
35
|
-
yaml: state.yaml && CodeMirror.copyState(yamlMode, state.yaml),
|
|
36
|
-
inner: CodeMirror.copyState(innerMode, state.inner)
|
|
37
|
-
}
|
|
38
|
-
},
|
|
39
|
-
token: function (stream, state) {
|
|
40
|
-
if (state.state == START) {
|
|
41
|
-
if (stream.match('---', false)) {
|
|
42
|
-
state.state = FRONTMATTER
|
|
43
|
-
state.yaml = CodeMirror.startState(yamlMode)
|
|
44
|
-
return yamlMode.token(stream, state.yaml)
|
|
45
|
-
} else {
|
|
46
|
-
state.state = BODY
|
|
47
|
-
return innerMode.token(stream, state.inner)
|
|
48
|
-
}
|
|
49
|
-
} else if (state.state == FRONTMATTER) {
|
|
50
|
-
var end = stream.sol() && stream.match(/(---|\.\.\.)/, false)
|
|
51
|
-
var style = yamlMode.token(stream, state.yaml)
|
|
52
|
-
if (end) {
|
|
53
|
-
state.state = BODY
|
|
54
|
-
state.yaml = null
|
|
55
|
-
}
|
|
56
|
-
return style
|
|
57
|
-
} else {
|
|
58
|
-
return innerMode.token(stream, state.inner)
|
|
59
|
-
}
|
|
60
|
-
},
|
|
61
|
-
innerMode: localMode,
|
|
62
|
-
indent: function(state, a, b) {
|
|
63
|
-
var m = localMode(state)
|
|
64
|
-
return m.mode.indent ? m.mode.indent(m.state, a, b) : CodeMirror.Pass
|
|
65
|
-
},
|
|
66
|
-
blankLine: function (state) {
|
|
67
|
-
var m = localMode(state)
|
|
68
|
-
if (m.mode.blankLine) return m.mode.blankLine(m.state)
|
|
69
|
-
}
|
|
70
|
-
}
|
|
71
|
-
})
|
|
72
|
-
});
|
|
@@ -1,116 +0,0 @@
|
|
|
1
|
-
// CodeMirror, copyright (c) by Marijn Haverbeke and others
|
|
2
|
-
// Distributed under an MIT license: https://codemirror.net/5/LICENSE
|
|
3
|
-
|
|
4
|
-
(function(mod) {
|
|
5
|
-
if (typeof exports == "object" && typeof module == "object") // CommonJS
|
|
6
|
-
mod(require("../../lib/codemirror"));
|
|
7
|
-
else if (typeof define == "function" && define.amd) // AMD
|
|
8
|
-
define(["../../lib/codemirror"], mod);
|
|
9
|
-
else // Plain browser env
|
|
10
|
-
mod(CodeMirror);
|
|
11
|
-
})(function(CodeMirror) {
|
|
12
|
-
"use strict";
|
|
13
|
-
|
|
14
|
-
CodeMirror.defineMode('z80', function(_config, parserConfig) {
|
|
15
|
-
var ez80 = parserConfig.ez80;
|
|
16
|
-
var keywords1, keywords2;
|
|
17
|
-
if (ez80) {
|
|
18
|
-
keywords1 = /^(exx?|(ld|cp)([di]r?)?|[lp]ea|pop|push|ad[cd]|cpl|daa|dec|inc|neg|sbc|sub|and|bit|[cs]cf|x?or|res|set|r[lr]c?a?|r[lr]d|s[lr]a|srl|djnz|nop|[de]i|halt|im|in([di]mr?|ir?|irx|2r?)|ot(dmr?|[id]rx|imr?)|out(0?|[di]r?|[di]2r?)|tst(io)?|slp)(\.([sl]?i)?[sl])?\b/i;
|
|
19
|
-
keywords2 = /^(((call|j[pr]|rst|ret[in]?)(\.([sl]?i)?[sl])?)|(rs|st)mix)\b/i;
|
|
20
|
-
} else {
|
|
21
|
-
keywords1 = /^(exx?|(ld|cp|in)([di]r?)?|pop|push|ad[cd]|cpl|daa|dec|inc|neg|sbc|sub|and|bit|[cs]cf|x?or|res|set|r[lr]c?a?|r[lr]d|s[lr]a|srl|djnz|nop|rst|[de]i|halt|im|ot[di]r|out[di]?)\b/i;
|
|
22
|
-
keywords2 = /^(call|j[pr]|ret[in]?|b_?(call|jump))\b/i;
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
var variables1 = /^(af?|bc?|c|de?|e|hl?|l|i[xy]?|r|sp)\b/i;
|
|
26
|
-
var variables2 = /^(n?[zc]|p[oe]?|m)\b/i;
|
|
27
|
-
var errors = /^([hl][xy]|i[xy][hl]|slia|sll)\b/i;
|
|
28
|
-
var numbers = /^([\da-f]+h|[0-7]+o|[01]+b|\d+d?)\b/i;
|
|
29
|
-
|
|
30
|
-
return {
|
|
31
|
-
startState: function() {
|
|
32
|
-
return {
|
|
33
|
-
context: 0
|
|
34
|
-
};
|
|
35
|
-
},
|
|
36
|
-
token: function(stream, state) {
|
|
37
|
-
if (!stream.column())
|
|
38
|
-
state.context = 0;
|
|
39
|
-
|
|
40
|
-
if (stream.eatSpace())
|
|
41
|
-
return null;
|
|
42
|
-
|
|
43
|
-
var w;
|
|
44
|
-
|
|
45
|
-
if (stream.eatWhile(/\w/)) {
|
|
46
|
-
if (ez80 && stream.eat('.')) {
|
|
47
|
-
stream.eatWhile(/\w/);
|
|
48
|
-
}
|
|
49
|
-
w = stream.current();
|
|
50
|
-
|
|
51
|
-
if (stream.indentation()) {
|
|
52
|
-
if ((state.context == 1 || state.context == 4) && variables1.test(w)) {
|
|
53
|
-
state.context = 4;
|
|
54
|
-
return 'var2';
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
if (state.context == 2 && variables2.test(w)) {
|
|
58
|
-
state.context = 4;
|
|
59
|
-
return 'var3';
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
if (keywords1.test(w)) {
|
|
63
|
-
state.context = 1;
|
|
64
|
-
return 'keyword';
|
|
65
|
-
} else if (keywords2.test(w)) {
|
|
66
|
-
state.context = 2;
|
|
67
|
-
return 'keyword';
|
|
68
|
-
} else if (state.context == 4 && numbers.test(w)) {
|
|
69
|
-
return 'number';
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
if (errors.test(w))
|
|
73
|
-
return 'error';
|
|
74
|
-
} else if (stream.match(numbers)) {
|
|
75
|
-
return 'number';
|
|
76
|
-
} else {
|
|
77
|
-
return null;
|
|
78
|
-
}
|
|
79
|
-
} else if (stream.eat(';')) {
|
|
80
|
-
stream.skipToEnd();
|
|
81
|
-
return 'comment';
|
|
82
|
-
} else if (stream.eat('"')) {
|
|
83
|
-
while (w = stream.next()) {
|
|
84
|
-
if (w == '"')
|
|
85
|
-
break;
|
|
86
|
-
|
|
87
|
-
if (w == '\\')
|
|
88
|
-
stream.next();
|
|
89
|
-
}
|
|
90
|
-
return 'string';
|
|
91
|
-
} else if (stream.eat('\'')) {
|
|
92
|
-
if (stream.match(/\\?.'/))
|
|
93
|
-
return 'number';
|
|
94
|
-
} else if (stream.eat('.') || stream.sol() && stream.eat('#')) {
|
|
95
|
-
state.context = 5;
|
|
96
|
-
|
|
97
|
-
if (stream.eatWhile(/\w/))
|
|
98
|
-
return 'def';
|
|
99
|
-
} else if (stream.eat('$')) {
|
|
100
|
-
if (stream.eatWhile(/[\da-f]/i))
|
|
101
|
-
return 'number';
|
|
102
|
-
} else if (stream.eat('%')) {
|
|
103
|
-
if (stream.eatWhile(/[01]/))
|
|
104
|
-
return 'number';
|
|
105
|
-
} else {
|
|
106
|
-
stream.next();
|
|
107
|
-
}
|
|
108
|
-
return null;
|
|
109
|
-
}
|
|
110
|
-
};
|
|
111
|
-
});
|
|
112
|
-
|
|
113
|
-
CodeMirror.defineMIME("text/x-z80", "z80");
|
|
114
|
-
CodeMirror.defineMIME("text/x-ez80", { name: "z80", ez80: true });
|
|
115
|
-
|
|
116
|
-
});
|
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "codemirror",
|
|
3
|
-
"version": "5.65.11",
|
|
4
|
-
"main": "lib/codemirror.js",
|
|
5
|
-
"style": "lib/codemirror.css",
|
|
6
|
-
"author": {
|
|
7
|
-
"name": "Marijn Haverbeke",
|
|
8
|
-
"email": "marijnh@gmail.com",
|
|
9
|
-
"url": "http://marijnhaverbeke.nl"
|
|
10
|
-
},
|
|
11
|
-
"description": "Full-featured in-browser code editor",
|
|
12
|
-
"license": "MIT",
|
|
13
|
-
"directories": {
|
|
14
|
-
"lib": "./lib"
|
|
15
|
-
},
|
|
16
|
-
"scripts": {
|
|
17
|
-
"build": "rollup -c",
|
|
18
|
-
"watch": "rollup -w -c",
|
|
19
|
-
"prepare": "npm run-script build",
|
|
20
|
-
"test": "node ./test/run.js",
|
|
21
|
-
"lint": "bin/lint"
|
|
22
|
-
},
|
|
23
|
-
"devDependencies": {
|
|
24
|
-
"@rollup/plugin-buble": "^0.21.3",
|
|
25
|
-
"blint": "^1.1.2",
|
|
26
|
-
"cm5-vim": "^0.0.5",
|
|
27
|
-
"node-static": "0.7.11",
|
|
28
|
-
"puppeteer": "^1.20.0",
|
|
29
|
-
"rollup": "^1.26.3",
|
|
30
|
-
"rollup-plugin-copy": "^3.4.0"
|
|
31
|
-
},
|
|
32
|
-
"bugs": "http://github.com/codemirror/CodeMirror/issues",
|
|
33
|
-
"keywords": [
|
|
34
|
-
"JavaScript",
|
|
35
|
-
"CodeMirror",
|
|
36
|
-
"Editor"
|
|
37
|
-
],
|
|
38
|
-
"homepage": "https://codemirror.net/5/",
|
|
39
|
-
"repository": {
|
|
40
|
-
"type": "git",
|
|
41
|
-
"url": "https://github.com/codemirror/CodeMirror.git"
|
|
42
|
-
},
|
|
43
|
-
"jspm": {
|
|
44
|
-
"directories": {},
|
|
45
|
-
"dependencies": {},
|
|
46
|
-
"devDependencies": {}
|
|
47
|
-
},
|
|
48
|
-
"dependencies": {},
|
|
49
|
-
"publishConfig": {
|
|
50
|
-
"tag": "version5"
|
|
51
|
-
}
|
|
52
|
-
}
|
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
import buble from '@rollup/plugin-buble';
|
|
2
|
-
import copy from 'rollup-plugin-copy'
|
|
3
|
-
|
|
4
|
-
let copyVim = copy({
|
|
5
|
-
targets: [
|
|
6
|
-
{
|
|
7
|
-
src: require.resolve("cm5-vim/vim.js").replace(/\\/g, "/"),
|
|
8
|
-
dest: "./keymap"
|
|
9
|
-
}
|
|
10
|
-
]
|
|
11
|
-
});
|
|
12
|
-
|
|
13
|
-
export default [
|
|
14
|
-
{
|
|
15
|
-
input: "src/codemirror.js",
|
|
16
|
-
output: {
|
|
17
|
-
banner: `// CodeMirror, copyright (c) by Marijn Haverbeke and others
|
|
18
|
-
// Distributed under an MIT license: https://codemirror.net/5/LICENSE
|
|
19
|
-
|
|
20
|
-
// This is CodeMirror (https://codemirror.net/5), a code editor
|
|
21
|
-
// implemented in JavaScript on top of the browser's DOM.
|
|
22
|
-
//
|
|
23
|
-
// You can find some technical background for some of the code below
|
|
24
|
-
// at http://marijnhaverbeke.nl/blog/#cm-internals .
|
|
25
|
-
`,
|
|
26
|
-
format: "umd",
|
|
27
|
-
file: "lib/codemirror.js",
|
|
28
|
-
name: "CodeMirror"
|
|
29
|
-
},
|
|
30
|
-
plugins: [ buble({namedFunctionExpressions: false}), copyVim ]
|
|
31
|
-
},
|
|
32
|
-
{
|
|
33
|
-
input: ["src/addon/runmode/runmode-standalone.js"],
|
|
34
|
-
output: {
|
|
35
|
-
format: "iife",
|
|
36
|
-
file: "addon/runmode/runmode-standalone.js",
|
|
37
|
-
name: "CodeMirror",
|
|
38
|
-
freeze: false, // IE8 doesn't support Object.freeze.
|
|
39
|
-
},
|
|
40
|
-
plugins: [ buble({namedFunctionExpressions: false}) ]
|
|
41
|
-
},
|
|
42
|
-
{
|
|
43
|
-
input: ["src/addon/runmode/runmode.node.js"],
|
|
44
|
-
output: {
|
|
45
|
-
format: "cjs",
|
|
46
|
-
file: "addon/runmode/runmode.node.js",
|
|
47
|
-
name: "CodeMirror",
|
|
48
|
-
freeze: false, // IE8 doesn't support Object.freeze.
|
|
49
|
-
},
|
|
50
|
-
plugins: [ buble({namedFunctionExpressions: false}) ]
|
|
51
|
-
},
|
|
52
|
-
];
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import StringStream from "../../util/StringStream.js"
|
|
2
|
-
import { countColumn } from "../../util/misc.js"
|
|
3
|
-
import * as modeMethods from "../../modes.js"
|
|
4
|
-
|
|
5
|
-
// declare global: globalThis, CodeMirror
|
|
6
|
-
|
|
7
|
-
// Create a minimal CodeMirror needed to use runMode, and assign to root.
|
|
8
|
-
var root = typeof globalThis !== 'undefined' ? globalThis : window
|
|
9
|
-
root.CodeMirror = {}
|
|
10
|
-
|
|
11
|
-
// Copy StringStream and mode methods into CodeMirror object.
|
|
12
|
-
CodeMirror.StringStream = StringStream
|
|
13
|
-
for (var exported in modeMethods) CodeMirror[exported] = modeMethods[exported]
|
|
14
|
-
|
|
15
|
-
// Minimal default mode.
|
|
16
|
-
CodeMirror.defineMode("null", () => ({token: stream => stream.skipToEnd()}))
|
|
17
|
-
CodeMirror.defineMIME("text/plain", "null")
|
|
18
|
-
|
|
19
|
-
CodeMirror.registerHelper = CodeMirror.registerGlobalHelper = Math.min
|
|
20
|
-
CodeMirror.splitLines = function(string) { return string.split(/\r?\n|\r/) }
|
|
21
|
-
CodeMirror.countColumn = countColumn
|
|
22
|
-
|
|
23
|
-
CodeMirror.defaults = { indentUnit: 2 }
|
|
24
|
-
export default CodeMirror
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import StringStream from "../../util/StringStream.js"
|
|
2
|
-
import * as modeMethods from "../../modes.js"
|
|
3
|
-
import {countColumn} from "../../util/misc.js"
|
|
4
|
-
|
|
5
|
-
// Copy StringStream and mode methods into exports (CodeMirror) object.
|
|
6
|
-
exports.StringStream = StringStream
|
|
7
|
-
exports.countColumn = countColumn
|
|
8
|
-
for (var exported in modeMethods) exports[exported] = modeMethods[exported]
|
|
9
|
-
|
|
10
|
-
// Shim library CodeMirror with the minimal CodeMirror defined above.
|
|
11
|
-
require.cache[require.resolve("../../lib/codemirror")] = require.cache[require.resolve("./runmode.node")]
|
|
12
|
-
require.cache[require.resolve("../../addon/runmode/runmode")] = require.cache[require.resolve("./runmode.node")]
|
|
13
|
-
|
|
14
|
-
// Minimal default mode.
|
|
15
|
-
exports.defineMode("null", () => ({token: stream => stream.skipToEnd()}))
|
|
16
|
-
exports.defineMIME("text/plain", "null")
|
|
17
|
-
|
|
18
|
-
exports.registerHelper = exports.registerGlobalHelper = Math.min
|
|
19
|
-
exports.splitLines = function(string) { return string.split(/\r?\n|\r/) }
|
|
20
|
-
|
|
21
|
-
exports.defaults = { indentUnit: 2 }
|
|
@@ -1,116 +0,0 @@
|
|
|
1
|
-
import { gecko, ie, ie_version, mobile, webkit, chrome, chrome_version } from "../util/browser.js"
|
|
2
|
-
import { elt, eltP } from "../util/dom.js"
|
|
3
|
-
import { scrollerGap } from "../util/misc.js"
|
|
4
|
-
import { getGutters, renderGutters } from "./gutters.js"
|
|
5
|
-
|
|
6
|
-
// The display handles the DOM integration, both for input reading
|
|
7
|
-
// and content drawing. It holds references to DOM nodes and
|
|
8
|
-
// display-related state.
|
|
9
|
-
|
|
10
|
-
export function Display(place, doc, input, options) {
|
|
11
|
-
let d = this
|
|
12
|
-
this.input = input
|
|
13
|
-
|
|
14
|
-
// Covers bottom-right square when both scrollbars are present.
|
|
15
|
-
d.scrollbarFiller = elt("div", null, "CodeMirror-scrollbar-filler")
|
|
16
|
-
d.scrollbarFiller.setAttribute("cm-not-content", "true")
|
|
17
|
-
// Covers bottom of gutter when coverGutterNextToScrollbar is on
|
|
18
|
-
// and h scrollbar is present.
|
|
19
|
-
d.gutterFiller = elt("div", null, "CodeMirror-gutter-filler")
|
|
20
|
-
d.gutterFiller.setAttribute("cm-not-content", "true")
|
|
21
|
-
// Will contain the actual code, positioned to cover the viewport.
|
|
22
|
-
d.lineDiv = eltP("div", null, "CodeMirror-code")
|
|
23
|
-
// Elements are added to these to represent selection and cursors.
|
|
24
|
-
d.selectionDiv = elt("div", null, null, "position: relative; z-index: 1")
|
|
25
|
-
d.cursorDiv = elt("div", null, "CodeMirror-cursors")
|
|
26
|
-
// A visibility: hidden element used to find the size of things.
|
|
27
|
-
d.measure = elt("div", null, "CodeMirror-measure")
|
|
28
|
-
// When lines outside of the viewport are measured, they are drawn in this.
|
|
29
|
-
d.lineMeasure = elt("div", null, "CodeMirror-measure")
|
|
30
|
-
// Wraps everything that needs to exist inside the vertically-padded coordinate system
|
|
31
|
-
d.lineSpace = eltP("div", [d.measure, d.lineMeasure, d.selectionDiv, d.cursorDiv, d.lineDiv],
|
|
32
|
-
null, "position: relative; outline: none")
|
|
33
|
-
let lines = eltP("div", [d.lineSpace], "CodeMirror-lines")
|
|
34
|
-
// Moved around its parent to cover visible view.
|
|
35
|
-
d.mover = elt("div", [lines], null, "position: relative")
|
|
36
|
-
// Set to the height of the document, allowing scrolling.
|
|
37
|
-
d.sizer = elt("div", [d.mover], "CodeMirror-sizer")
|
|
38
|
-
d.sizerWidth = null
|
|
39
|
-
// Behavior of elts with overflow: auto and padding is
|
|
40
|
-
// inconsistent across browsers. This is used to ensure the
|
|
41
|
-
// scrollable area is big enough.
|
|
42
|
-
d.heightForcer = elt("div", null, null, "position: absolute; height: " + scrollerGap + "px; width: 1px;")
|
|
43
|
-
// Will contain the gutters, if any.
|
|
44
|
-
d.gutters = elt("div", null, "CodeMirror-gutters")
|
|
45
|
-
d.lineGutter = null
|
|
46
|
-
// Actual scrollable element.
|
|
47
|
-
d.scroller = elt("div", [d.sizer, d.heightForcer, d.gutters], "CodeMirror-scroll")
|
|
48
|
-
d.scroller.setAttribute("tabIndex", "-1")
|
|
49
|
-
// The element in which the editor lives.
|
|
50
|
-
d.wrapper = elt("div", [d.scrollbarFiller, d.gutterFiller, d.scroller], "CodeMirror")
|
|
51
|
-
// See #6982. FIXME remove when this has been fixed for a while in Chrome
|
|
52
|
-
if (chrome && chrome_version >= 105) d.wrapper.style.clipPath = "inset(0px)"
|
|
53
|
-
|
|
54
|
-
// This attribute is respected by automatic translation systems such as Google Translate,
|
|
55
|
-
// and may also be respected by tools used by human translators.
|
|
56
|
-
d.wrapper.setAttribute('translate', 'no')
|
|
57
|
-
|
|
58
|
-
// Work around IE7 z-index bug (not perfect, hence IE7 not really being supported)
|
|
59
|
-
if (ie && ie_version < 8) { d.gutters.style.zIndex = -1; d.scroller.style.paddingRight = 0 }
|
|
60
|
-
if (!webkit && !(gecko && mobile)) d.scroller.draggable = true
|
|
61
|
-
|
|
62
|
-
if (place) {
|
|
63
|
-
if (place.appendChild) place.appendChild(d.wrapper)
|
|
64
|
-
else place(d.wrapper)
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
// Current rendered range (may be bigger than the view window).
|
|
68
|
-
d.viewFrom = d.viewTo = doc.first
|
|
69
|
-
d.reportedViewFrom = d.reportedViewTo = doc.first
|
|
70
|
-
// Information about the rendered lines.
|
|
71
|
-
d.view = []
|
|
72
|
-
d.renderedView = null
|
|
73
|
-
// Holds info about a single rendered line when it was rendered
|
|
74
|
-
// for measurement, while not in view.
|
|
75
|
-
d.externalMeasured = null
|
|
76
|
-
// Empty space (in pixels) above the view
|
|
77
|
-
d.viewOffset = 0
|
|
78
|
-
d.lastWrapHeight = d.lastWrapWidth = 0
|
|
79
|
-
d.updateLineNumbers = null
|
|
80
|
-
|
|
81
|
-
d.nativeBarWidth = d.barHeight = d.barWidth = 0
|
|
82
|
-
d.scrollbarsClipped = false
|
|
83
|
-
|
|
84
|
-
// Used to only resize the line number gutter when necessary (when
|
|
85
|
-
// the amount of lines crosses a boundary that makes its width change)
|
|
86
|
-
d.lineNumWidth = d.lineNumInnerWidth = d.lineNumChars = null
|
|
87
|
-
// Set to true when a non-horizontal-scrolling line widget is
|
|
88
|
-
// added. As an optimization, line widget aligning is skipped when
|
|
89
|
-
// this is false.
|
|
90
|
-
d.alignWidgets = false
|
|
91
|
-
|
|
92
|
-
d.cachedCharWidth = d.cachedTextHeight = d.cachedPaddingH = null
|
|
93
|
-
|
|
94
|
-
// Tracks the maximum line length so that the horizontal scrollbar
|
|
95
|
-
// can be kept static when scrolling.
|
|
96
|
-
d.maxLine = null
|
|
97
|
-
d.maxLineLength = 0
|
|
98
|
-
d.maxLineChanged = false
|
|
99
|
-
|
|
100
|
-
// Used for measuring wheel scrolling granularity
|
|
101
|
-
d.wheelDX = d.wheelDY = d.wheelStartX = d.wheelStartY = null
|
|
102
|
-
|
|
103
|
-
// True when shift is held down.
|
|
104
|
-
d.shift = false
|
|
105
|
-
|
|
106
|
-
// Used to track whether anything happened since the context menu
|
|
107
|
-
// was opened.
|
|
108
|
-
d.selForContextMenu = null
|
|
109
|
-
|
|
110
|
-
d.activeTouch = null
|
|
111
|
-
|
|
112
|
-
d.gutterSpecs = getGutters(options.gutters, options.lineNumbers)
|
|
113
|
-
renderGutters(d)
|
|
114
|
-
|
|
115
|
-
input.init(d)
|
|
116
|
-
}
|
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
import { restartBlink } from "./selection.js"
|
|
2
|
-
import { webkit } from "../util/browser.js"
|
|
3
|
-
import { addClass, rmClass } from "../util/dom.js"
|
|
4
|
-
import { signal } from "../util/event.js"
|
|
5
|
-
|
|
6
|
-
export function ensureFocus(cm) {
|
|
7
|
-
if (!cm.hasFocus()) {
|
|
8
|
-
cm.display.input.focus()
|
|
9
|
-
if (!cm.state.focused) onFocus(cm)
|
|
10
|
-
}
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
export function delayBlurEvent(cm) {
|
|
14
|
-
cm.state.delayingBlurEvent = true
|
|
15
|
-
setTimeout(() => { if (cm.state.delayingBlurEvent) {
|
|
16
|
-
cm.state.delayingBlurEvent = false
|
|
17
|
-
if (cm.state.focused) onBlur(cm)
|
|
18
|
-
} }, 100)
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
export function onFocus(cm, e) {
|
|
22
|
-
if (cm.state.delayingBlurEvent && !cm.state.draggingText) cm.state.delayingBlurEvent = false
|
|
23
|
-
|
|
24
|
-
if (cm.options.readOnly == "nocursor") return
|
|
25
|
-
if (!cm.state.focused) {
|
|
26
|
-
signal(cm, "focus", cm, e)
|
|
27
|
-
cm.state.focused = true
|
|
28
|
-
addClass(cm.display.wrapper, "CodeMirror-focused")
|
|
29
|
-
// This test prevents this from firing when a context
|
|
30
|
-
// menu is closed (since the input reset would kill the
|
|
31
|
-
// select-all detection hack)
|
|
32
|
-
if (!cm.curOp && cm.display.selForContextMenu != cm.doc.sel) {
|
|
33
|
-
cm.display.input.reset()
|
|
34
|
-
if (webkit) setTimeout(() => cm.display.input.reset(true), 20) // Issue #1730
|
|
35
|
-
}
|
|
36
|
-
cm.display.input.receivedFocus()
|
|
37
|
-
}
|
|
38
|
-
restartBlink(cm)
|
|
39
|
-
}
|
|
40
|
-
export function onBlur(cm, e) {
|
|
41
|
-
if (cm.state.delayingBlurEvent) return
|
|
42
|
-
|
|
43
|
-
if (cm.state.focused) {
|
|
44
|
-
signal(cm, "blur", cm, e)
|
|
45
|
-
cm.state.focused = false
|
|
46
|
-
rmClass(cm.display.wrapper, "CodeMirror-focused")
|
|
47
|
-
}
|
|
48
|
-
clearInterval(cm.display.blinker)
|
|
49
|
-
setTimeout(() => { if (!cm.state.focused) cm.display.shift = false }, 150)
|
|
50
|
-
}
|