qword 1.0.2 → 1.1.0
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/ChangeLog +22 -0
- package/README.md +2 -3
- package/assets/style.css +10 -10
- package/client/_clipboard.js +30 -33
- package/client/_clipboard.spec.js +160 -0
- package/client/content.d.ts +8 -0
- package/client/content.js +14 -0
- package/client/content.spec.js +69 -0
- package/client/create.d.ts +32 -0
- package/client/create.js +95 -0
- package/client/create.spec.js +192 -0
- package/client/decorations.d.ts +40 -0
- package/client/decorations.js +110 -0
- package/client/decorations.spec.js +135 -0
- package/client/dom.d.ts +7 -0
- package/client/dom.js +17 -0
- package/client/dom.spec.js +78 -0
- package/client/editor.d.ts +72 -0
- package/client/editor.js +164 -0
- package/client/editor.spec.js +307 -0
- package/client/events.d.ts +7 -0
- package/client/events.js +8 -0
- package/client/events.spec.js +100 -0
- package/client/highlight.d.ts +3 -0
- package/client/highlight.js +82 -0
- package/client/highlight.spec.js +28 -0
- package/client/history.d.ts +4 -0
- package/client/history.js +16 -0
- package/client/history.spec.js +57 -0
- package/client/index.d.ts +60 -0
- package/client/index.js +37 -0
- package/client/loadremote.js +10 -4
- package/client/options.d.ts +30 -0
- package/client/options.js +59 -0
- package/client/options.spec.js +157 -0
- package/client/position.d.ts +21 -0
- package/client/position.js +33 -0
- package/client/position.spec.js +176 -0
- package/client/qword.js +141 -391
- package/client/save.js +2 -2
- package/client/scroll.d.ts +10 -0
- package/client/scroll.js +9 -0
- package/client/scroll.spec.js +58 -0
- package/client/types.d.ts +24 -0
- package/dist/qword.js +175 -1
- package/dist/qword.js.map +1 -1
- package/dist-dev/qword.js +544 -660
- package/package.json +30 -15
- package/server/edit.js +8 -3
- package/server/edit.spec.js +101 -0
- package/test/errors.ts +21 -0
- package/test/types.ts +134 -0
- package/client/codemirror/show-trailing.js +0 -54
- package/client/codemirror/use-soft-tabs.js +0 -38
- package/client/set-key-map.js +0 -3
- package/dist/2b22a33a0a80bb926bbc.png +0 -1
- package/dist/8e9019bd86255ac9a618.png +0 -1
- package/dist/codemirror.js +0 -2
- package/dist/codemirror.js.map +0 -1
- package/dist/dword.js +0 -2
- package/dist/dword.js.map +0 -1
- package/dist-dev/2b22a33a0a80bb926bbc.png +0 -1
- package/dist-dev/8e9019bd86255ac9a618.png +0 -1
- package/dist-dev/codemirror.js +0 -104
- package/dist-dev/dword.js +0 -960
- package/modules/codemirror-emmet/dist/emmet.js +0 -48661
- package/modules/codemirror-emmet/dist/emmet.min.js +0 -8
- package/modules/codemirror-emmet/dist/emmetPlugin.js +0 -840
- package/modules/codemirror-emmet/dist/emmetPlugin.min.js +0 -1
- package/modules/codemirror-emmet/dist/index.html +0 -46
- package/modules/jshint/README.md +0 -114
- package/modules/jshint/dist/jshint-rhino.js +0 -32143
- package/modules/jshint/dist/jshint.js +0 -32141
- package/modules/jshint/package.json +0 -77
|
@@ -1 +0,0 @@
|
|
|
1
|
-
!function(t,e){"function"==typeof define&&define.amd?define(e):t.emmetPlugin=e()}(this,function(){var t,e,n;return function(i){function r(t,e){return C.call(t,e)}function o(t,e){var n,i,r,o,s,c,a,u,l,f,m=e&&e.split("/"),d=x.map,p=d&&d["*"]||{};if(t&&"."===t.charAt(0))if(e){for(m=m.slice(0,m.length-1),t=m.concat(t.split("/")),u=0;u<t.length;u+=1)if(f=t[u],"."===f)t.splice(u,1),u-=1;else if(".."===f){if(1===u&&(".."===t[2]||".."===t[0]))break;u>0&&(t.splice(u-1,2),u-=2)}t=t.join("/")}else 0===t.indexOf("./")&&(t=t.substring(2));if((m||p)&&d){for(n=t.split("/"),u=n.length;u>0;u-=1){if(i=n.slice(0,u).join("/"),m)for(l=m.length;l>0;l-=1)if(r=d[m.slice(0,l).join("/")],r&&(r=r[i])){o=r,s=u;break}if(o)break;!c&&p&&p[i]&&(c=p[i],a=u)}!o&&c&&(o=c,s=a),o&&(n.splice(0,s,o),t=n.join("/"))}return t}function s(t,e){return function(){return d.apply(i,v.call(arguments,0).concat([t,e]))}}function c(t){return function(e){return o(e,t)}}function a(t){return function(e){g[t]=e}}function u(t){if(r(_,t)){var e=_[t];delete _[t],b[t]=!0,m.apply(i,e)}if(!r(g,t)&&!r(b,t))throw new Error("No "+t);return g[t]}function l(t){var e,n=t?t.indexOf("!"):-1;return n>-1&&(e=t.substring(0,n),t=t.substring(n+1,t.length)),[e,t]}function f(t){return function(){return x&&x.config&&x.config[t]||{}}}var m,d,p,h,g={},_={},x={},b={},C=Object.prototype.hasOwnProperty,v=[].slice;p=function(t,e){var n,i=l(t),r=i[0];return t=i[1],r&&(r=o(r,e),n=u(r)),r?t=n&&n.normalize?n.normalize(t,c(e)):o(t,e):(t=o(t,e),i=l(t),r=i[0],t=i[1],r&&(n=u(r))),{f:r?r+"!"+t:t,n:t,pr:r,p:n}},h={require:function(t){return s(t)},exports:function(t){var e=g[t];return"undefined"!=typeof e?e:g[t]={}},module:function(t){return{id:t,uri:"",exports:g[t],config:f(t)}}},m=function(t,e,n,o){var c,l,f,m,d,x,C=[];if(o=o||t,"function"==typeof n){for(e=!e.length&&n.length?["require","exports","module"]:e,d=0;d<e.length;d+=1)if(m=p(e[d],o),l=m.f,"require"===l)C[d]=h.require(t);else if("exports"===l)C[d]=h.exports(t),x=!0;else if("module"===l)c=C[d]=h.module(t);else if(r(g,l)||r(_,l)||r(b,l))C[d]=u(l);else{if(!m.p)throw new Error(t+" missing "+l);m.p.load(m.n,s(o,!0),a(l),{}),C[d]=g[l]}f=n.apply(g[t],C),t&&(c&&c.exports!==i&&c.exports!==g[t]?g[t]=c.exports:f===i&&x||(g[t]=f))}else t&&(g[t]=n)},t=e=d=function(t,e,n,r,o){return"string"==typeof t?h[t]?h[t](e):u(p(t,e).f):(t.splice||(x=t,e.splice?(t=e,e=n,n=null):t=i),e=e||function(){},"function"==typeof n&&(n=r,r=o),r?m(i,t,e,n):setTimeout(function(){m(i,t,e,n)},4),d)},d.config=function(t){return x=t,x.deps&&d(x.deps,x.callback),d},t._defined=g,n=function(t,e,n){e.splice||(n=e,e=[]),r(g,t)||r(_,t)||(_[t]=[t,e,n])},n.amd={jQuery:!0}}(),n("vendor/almond",function(){}),n("emmet/emmet",function(){return emmet}),n("emmet/utils/common",function(){return emmet.require("utils/common")}),n("emmet/utils/action",function(){return emmet.require("utils/action")}),n("emmet/assets/resources",function(){return emmet.require("assets/resources")}),n("emmet/assets/tabStops",function(){return emmet.require("assets/tabStops")}),n("shim",function(){}),n("editor",["emmet/utils/common","emmet/utils/action","emmet/assets/resources","emmet/assets/tabStops"],function(t,e,n,i){function r(t,e){return arguments.length>2&&"object"!=typeof e&&(e={line:arguments[1],ch:arguments[2]}),t.indexFromPos(e)}function o(t,e){return t.posFromIndex(e)}return{context:null,selectionIndex:0,modeMap:{"text/html":"html","application/xml":"xml","text/xsl":"xsl","text/css":"css","text/x-less":"less","text/x-scss":"scss","text/x-sass":"sass"},setupContext:function(e,i){this.context=e,this.selectionIndex=i||0;var r=" ";e.getOption("indentWithTabs")||(r=t.repeatString(" ",e.getOption("indentUnit"))),n.setVariable("indentation",r)},selectionList:function(){var t=this.context;return t.listSelections().map(function(e){var n=r(t,e.anchor),i=r(t,e.head);return{start:Math.min(n,i),end:Math.max(n,i)}})},getCaretPos:function(){return this.getSelectionRange().start},setCaretPos:function(t){this.createSelection(t)},getSelectionRange:function(){return this.selectionList()[this.selectionIndex]},createSelection:function(t,e){"undefined"==typeof e&&(e=t);var n=this.selectionList(),i=this.context;n[this.selectionIndex]={start:t,end:e},this.context.setSelections(n.map(function(t){return{head:o(i,t.start),anchor:o(i,t.end)}}))},getSelection:function(){var t=this.getSelectionRange();return t.start=o(this.context,t.start),t.end=o(this.context,t.end),this.context.getRange(t.start,t.end)},getCurrentLineRange:function(){var t=o(this.context,this.getCaretPos());return{start:r(this.context,t.line,0),end:r(this.context,t.line,this.context.getLine(t.line).length)}},getCurrentLine:function(){var t=o(this.context,this.getCaretPos());return this.context.getLine(t.line)||""},replaceContent:function(e,n,r,s){"undefined"==typeof r&&(r="undefined"==typeof n?this.getContent().length:n),"undefined"==typeof n&&(n=0),s||(e=t.padString(e,t.getLinePaddingFromPosition(this.getContent(),n)));var c=i.extract(e,{escape:function(t){return t}});e=c.text;var a=c.tabstops[0]||{start:e.length,end:e.length};a.start+=n,a.end+=n,this.context.replaceRange(e,o(this.context,n),o(this.context,r)),this.createSelection(a.start,a.end)},getContent:function(){return this.context.getValue()},getSyntax:function(){var t=this.context.getOption("mode");return this.modeMap[t]||e.detectSyntax(this,t)},getProfileName:function(){return this.context.getOption("profile")?this.context.getOption("profile"):e.detectProfile(this)},prompt:function(t){return prompt(t)},getFilePath:function(){return location.href},isValidSyntax:function(){return n.hasSyntax(this.getSyntax())}}}),n("plugin",["./editor","emmet/emmet"],function(t,e){function n(){if(CodeMirror.version>="3.1")return CodeMirror.Pass;throw CodeMirror.Pass}function i(e){return function(n){t.setupContext(n);var i;return n.operation(function(){i=o(e,n)}),i}}function r(e){return function(n){t.setupContext(n);var i=t.selectionList(),r=null;return n.operation(function(){for(var s=0,c=i.length;c>s&&(t.selectionIndex=s,r=o(e,n),r!==CodeMirror.Pass);s++);}),r}}function o(i,r){if("expand_abbreviation_with_tab"==i&&(r.somethingSelected()||!t.isValidSyntax()))return n();var o=!1;try{if(o=e.run(i,t),!o&&"insert_formatted_line_break_only"==i)return n()}catch(s){}return o}function s(t){return a?t:t.replace("Cmd","Ctrl")}function c(t,e){t=s(t),CodeMirror.keyMap["default"][t]="emmet."+e}var a=/Mac/.test(navigator.platform),u={"Cmd-E":"expand_abbreviation",Tab:"expand_abbreviation_with_tab","Cmd-D":"balance_outward","Shift-Cmd-D":"balance_inward","Cmd-M":"matching_pair","Shift-Cmd-A":"wrap_with_abbreviation","Ctrl-Alt-Right":"next_edit_point","Ctrl-Alt-Left":"prev_edit_point","Cmd-L":"select_line","Cmd-Shift-M":"merge_lines","Cmd-/":"toggle_comment","Cmd-J":"split_join_tag","Cmd-K":"remove_tag","Shift-Cmd-Y":"evaluate_math_expression","Ctrl-Up":"increment_number_by_1","Ctrl-Down":"decrement_number_by_1","Ctrl-Alt-Up":"increment_number_by_01","Ctrl-Alt-Down":"decrement_number_by_01","Shift-Ctrl-Up":"increment_number_by_10","Shift-Ctrl-Down":"decrement_number_by_10","Shift-Cmd-.":"select_next_item","Shift-Cmd-,":"select_previous_item","Cmd-B":"reflect_css_value",Enter:"insert_formatted_line_break_only"},l=["prev_edit_point","next_edit_point","merge_lines","reflect_css_value","select_next_item","select_previous_item","wrap_with_abbreviation","update_tag","insert_formatted_line_break_only"];return CodeMirror.defineOption?CodeMirror.defineOption("profile","html"):CodeMirror.defaults.profile="html",Object.keys(u).forEach(function(t){var e=u[t],n="emmet."+e;CodeMirror.commands[n]||(CodeMirror.commands[n]=~l.indexOf(e)?i(e):r(e)),c(t,e)}),{emmet:e,editor:t,setKeymap:function(t){Object.keys(t).forEach(function(e){c(e,t[e])})},clearKeymap:function(){var t=CodeMirror.keyMap["default"],e=/^emmet\./;Object.keys(t).forEach(function(n){e.test(t[n])&&delete t[n]})},addKeybinding:c,removeKeybinding:function(t){t=s(t);var e=CodeMirror.keyMap["default"];t in e?delete e[t]:(t="emmet."+t,Object.keys(e).forEach(function(n){e[n]===t&&delete e[n]}))}}}),e("plugin")});
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
<!doctype html>
|
|
2
|
-
<html>
|
|
3
|
-
<head>
|
|
4
|
-
<title>Emmet for CodeMirror 4</title>
|
|
5
|
-
<link rel="stylesheet" href="../vendor/codemirror/v4/codemirror.css" />
|
|
6
|
-
<script src="../vendor/codemirror/v4/codemirror.js"></script>
|
|
7
|
-
<script src="../vendor/codemirror/v4/xml.js"></script>
|
|
8
|
-
<script src="../vendor/codemirror/v4/css.js"></script>
|
|
9
|
-
<script src="../vendor/codemirror/v4/htmlmixed.js"></script>
|
|
10
|
-
<script src="./emmet.min.js"></script>
|
|
11
|
-
|
|
12
|
-
<style>
|
|
13
|
-
.CodeMirror {
|
|
14
|
-
border: 1px solid black;
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
.cm-delimit {
|
|
18
|
-
color: #fa4;
|
|
19
|
-
}
|
|
20
|
-
</style>
|
|
21
|
-
</head>
|
|
22
|
-
<body>
|
|
23
|
-
<h1>Emmet for CodeMirror 4</h1>
|
|
24
|
-
|
|
25
|
-
<form><textarea id="code" name="code">
|
|
26
|
-
<html style="color: green">
|
|
27
|
-
<!-- this is a comment -->
|
|
28
|
-
<head>
|
|
29
|
-
<title>HTML Example</title>
|
|
30
|
-
</head>
|
|
31
|
-
<body>
|
|
32
|
-
The indentation tries to be <em>somewhat &quot;do what
|
|
33
|
-
I mean&quot;</em>... but might not match your style.
|
|
34
|
-
</body>
|
|
35
|
-
</html>
|
|
36
|
-
</textarea></form>
|
|
37
|
-
|
|
38
|
-
<script>
|
|
39
|
-
CodeMirror.fromTextArea(document.getElementById("code"), {
|
|
40
|
-
mode : "text/html",
|
|
41
|
-
lineNumbers : true,
|
|
42
|
-
profile: 'xhtml' /* define Emmet output profile */
|
|
43
|
-
});
|
|
44
|
-
</script>
|
|
45
|
-
</body>
|
|
46
|
-
</html>
|
package/modules/jshint/README.md
DELETED
|
@@ -1,114 +0,0 @@
|
|
|
1
|
-
# JSHint, A Static Code Analysis Tool for JavaScript
|
|
2
|
-
|
|
3
|
-
\[ [Use it online](http://jshint.com/) •
|
|
4
|
-
[Docs](http://jshint.com/docs/) • [FAQ](http://jshint.com/docs/faq) •
|
|
5
|
-
[Install](http://jshint.com/install/) •
|
|
6
|
-
[Contribute](http://jshint.com/contribute/) •
|
|
7
|
-
[Blog](http://jshint.com/blog/) • [Twitter](https://twitter.com/jshint/) \]
|
|
8
|
-
|
|
9
|
-
[](https://www.npmjs.com/package/jshint)
|
|
10
|
-
[](https://travis-ci.org/jshint/jshint)
|
|
11
|
-
[](https://ci.appveyor.com/project/jshint/jshint/branch/master)
|
|
12
|
-
[](https://coveralls.io/r/jshint/jshint?branch=master)
|
|
13
|
-
|
|
14
|
-
JSHint is a community-driven tool that detects errors and potential problems in
|
|
15
|
-
JavaScript code. Since JSHint is so flexible, you can easily adjust it in
|
|
16
|
-
the environment you expect your code to execute. JSHint is publicly available
|
|
17
|
-
and will always stay this way.
|
|
18
|
-
|
|
19
|
-
## Our goal
|
|
20
|
-
|
|
21
|
-
The project aims to help JavaScript developers write complex programs
|
|
22
|
-
without worrying about typos and language gotchas.
|
|
23
|
-
|
|
24
|
-
Any code base eventually becomes huge at some point, so simple mistakes — that
|
|
25
|
-
would not show themselves when written — can become show stoppers and add
|
|
26
|
-
extra hours of debugging. So, static code analysis tools come into play
|
|
27
|
-
and help developers spot such problems. JSHint scans a program written in
|
|
28
|
-
JavaScript and reports about commonly made mistakes and potential bugs. The
|
|
29
|
-
potential problem could be a syntax error, a bug due to an implicit type
|
|
30
|
-
conversion, a leaking variable, or something else entirely.
|
|
31
|
-
|
|
32
|
-
Only 15% of all programs linted on [jshint.com](http://jshint.com) pass the
|
|
33
|
-
JSHint checks. In all other cases, JSHint finds some red flags that could've
|
|
34
|
-
been bugs or potential problems.
|
|
35
|
-
|
|
36
|
-
Please note, that while static code analysis tools can spot many different kind
|
|
37
|
-
of mistakes, it can't detect if your program is correct, fast or has memory
|
|
38
|
-
leaks. You should always combine tools like JSHint with unit and functional
|
|
39
|
-
tests as well as with code reviews.
|
|
40
|
-
|
|
41
|
-
## Reporting a bug
|
|
42
|
-
|
|
43
|
-
To report a bug simply create a
|
|
44
|
-
[new GitHub Issue](https://github.com/jshint/jshint/issues/new) and describe
|
|
45
|
-
your problem or suggestion. We welcome all kinds of feedback regarding
|
|
46
|
-
JSHint including but not limited to:
|
|
47
|
-
|
|
48
|
-
* When JSHint doesn't work as expected
|
|
49
|
-
* When JSHint complains about valid JavaScript code that works in all browsers
|
|
50
|
-
* When you simply want a new option or feature
|
|
51
|
-
|
|
52
|
-
Before reporting a bug, please look around to see if there are any open or closed tickets
|
|
53
|
-
that discuss your issue, and remember the wisdom: pull request > bug report > tweet.
|
|
54
|
-
|
|
55
|
-
## Who uses JSHint?
|
|
56
|
-
|
|
57
|
-
Engineers from these companies and projects use JSHint:
|
|
58
|
-
|
|
59
|
-
* [Mozilla](https://www.mozilla.org/)
|
|
60
|
-
* [Wikipedia](https://wikipedia.org/)
|
|
61
|
-
* [Facebook](https://facebook.com/)
|
|
62
|
-
* [Twitter](https://twitter.com/)
|
|
63
|
-
* [Disqus](https://disqus.com/)
|
|
64
|
-
* [Medium](https://medium.com/)
|
|
65
|
-
* [Yahoo!](https://yahoo.com/)
|
|
66
|
-
* [SmugMug](http://smugmug.com/)
|
|
67
|
-
* [jQuery UI](https://jqueryui.com/) ([Source](https://github.com/jquery/jquery-ui/blob/master/package.json))
|
|
68
|
-
* [jQuery Mobile](https://jquerymobile.com/) ([Source](https://github.com/jquery/jquery-mobile/blob/master/package.json#))
|
|
69
|
-
* [Coursera](http://coursera.com/)
|
|
70
|
-
* [RedHat](http://redhat.com/)
|
|
71
|
-
* [SoundCloud](http://soundcloud.com/)
|
|
72
|
-
* [Nodejitsu](http://nodejitsu.com/)
|
|
73
|
-
* [Yelp](https://yelp.com/)
|
|
74
|
-
* [Find My Electric](https://www.findmyelectric.com/)
|
|
75
|
-
* [Voxer](http://voxer.com/)
|
|
76
|
-
* [EnyoJS](http://enyojs.com/)
|
|
77
|
-
* [QuickenLoans](http://quickenloans.com/)
|
|
78
|
-
* [Cloud9](http://c9.io/)
|
|
79
|
-
* [CodeClimate](https://codeclimate.com/)
|
|
80
|
-
* [Zendesk](http://zendesk.com/)
|
|
81
|
-
* [Google](https://www.google.com/)
|
|
82
|
-
* [Codacy](https://www.codacy.com) [ref](https://support.codacy.com/hc/en-us/articles/207995005-Special-Thanks)
|
|
83
|
-
* [Spotify](https://www.spotify.com)
|
|
84
|
-
|
|
85
|
-
And many more!
|
|
86
|
-
|
|
87
|
-
## License
|
|
88
|
-
|
|
89
|
-
JSHint is licensed under [the MIT Expat
|
|
90
|
-
license](https://www.gnu.org/licenses/license-list.html#Expat).
|
|
91
|
-
|
|
92
|
-
Prior to version 2.12.0 (release in August 2020), JSHint was partially licensed
|
|
93
|
-
under the non-free [JSON
|
|
94
|
-
license](https://www.gnu.org/licenses/license-list.html#JSON). [The 2020
|
|
95
|
-
Relicensing document](http://jshint.com/relicensing-2020/) details the process
|
|
96
|
-
maintainers followed to change the license.
|
|
97
|
-
|
|
98
|
-
## The JSHint Team
|
|
99
|
-
|
|
100
|
-
JSHint is currently maintained by [Rick Waldron](https://github.com/rwaldron/),
|
|
101
|
-
[Caitlin Potter](https://github.com/caitp/), [Mike
|
|
102
|
-
Pennisi](https://github.com/jugglinmike/), and [Luke
|
|
103
|
-
Page](https://github.com/lukeapage). You can reach them via admin@jshint.org.
|
|
104
|
-
|
|
105
|
-
## Previous Maintainers
|
|
106
|
-
|
|
107
|
-
Originating from the JSLint project in 2010, JSHint has been maintained by a
|
|
108
|
-
number of dedicated individuals. In chronological order, they are: Douglas
|
|
109
|
-
Crockford, Anton Kovalyov, and Mike Sherov. We appreciate their long-term
|
|
110
|
-
commitment!
|
|
111
|
-
|
|
112
|
-
## Thank you!
|
|
113
|
-
|
|
114
|
-
We really appreciate all kinds of feedback and contributions. Thanks for using and supporting JSHint!
|