Skip to content

Commit 56228cc

Browse files
committed
Update source to v2.1.0
1 parent 20246f6 commit 56228cc

22 files changed

+145
-136
lines changed

README.md

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,10 @@
22

33
## Installation
44

5-
You need to install [Cordova](http://cordova.apache.org) before.
5+
You need to install [Cordova](http://cordova.apache.org) before. Then clone the repository:
66

77
```sh
8-
# Clone this repository
98
$ git clone https://github.com/design-first/system-designer-cordova.git
10-
# Go to the repository
11-
$ cd system-designer-cordova
129
```
1310

1411
## Build for iOS

config.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
<?xml version='1.0' encoding='utf-8'?>
2-
<widget android-versionCode="20000" id="com.ecarriou.systemdesignerios" version="2.0.0" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">
2+
<widget android-versionCode="21000" id="com.ecarriou.systemdesignerios" version="2.1.0" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">
33
<name>System Designer</name>
44
<description>
5-
System Designer, an IDE for designing JavaScript applications driven by the model.
5+
System Designer, an IDE for designing systems.
66
</description>
77
<author email="[email protected]" href="https://system-designer.github.io">System Designer</author>
88
<preference name="deployment-target" value="10.3" />

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "com.ecarriou.systemdesignerios",
3-
"version": "2.0.0",
3+
"version": "2.1.0",
44
"displayName": "System Designer",
55
"cordova": {
66
"platforms": [

www/lib/codemirror/addon/edit/closebrackets.js

Lines changed: 4 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,8 @@
133133
(cur.ch <= 2 || cm.getRange(Pos(cur.line, cur.ch - 3), Pos(cur.line, cur.ch - 2)) != ch)) {
134134
curType = "addFour";
135135
} else if (identical) {
136-
if (!CodeMirror.isWordChar(next) && enteringString(cm, cur, ch)) curType = "both";
136+
var prev = cur.ch == 0 ? " " : cm.getRange(Pos(cur.line, cur.ch - 1), cur)
137+
if (!CodeMirror.isWordChar(next) && prev != ch && !CodeMirror.isWordChar(prev)) curType = "both";
137138
else return CodeMirror.Pass;
138139
} else if (opening && (cm.getLine(cur.line).length == cur.ch ||
139140
isClosingBracket(next, pairs) ||
@@ -185,24 +186,9 @@
185186
return str.length == 2 ? str : null;
186187
}
187188

188-
// Project the token type that will exists after the given char is
189-
// typed, and use it to determine whether it would cause the start
190-
// of a string token.
191-
function enteringString(cm, pos, ch) {
192-
var line = cm.getLine(pos.line);
193-
var token = cm.getTokenAt(pos);
194-
if (/\bstring2?\b/.test(token.type) || stringStartsAfter(cm, pos)) return false;
195-
var stream = new CodeMirror.StringStream(line.slice(0, pos.ch) + ch + line.slice(pos.ch), 4);
196-
stream.pos = stream.start = token.start;
197-
for (;;) {
198-
var type1 = cm.getMode().token(stream, token.state);
199-
if (stream.pos >= pos.ch + 1) return /\bstring2?\b/.test(type1);
200-
stream.start = stream.pos;
201-
}
202-
}
203-
204189
function stringStartsAfter(cm, pos) {
205190
var token = cm.getTokenAt(Pos(pos.line, pos.ch + 1))
206-
return /\bstring/.test(token.type) && token.start == pos.ch
191+
return /\bstring/.test(token.type) && token.start == pos.ch &&
192+
(pos.ch == 0 || !/\bstring/.test(cm.getTokenTypeAt(pos)))
207193
}
208194
});

www/lib/codemirror/codemirror.css

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -145,8 +145,8 @@
145145

146146
/* Default styles for common addons */
147147

148-
div.CodeMirror span.CodeMirror-matchingbracket {color: #0f0;}
149-
div.CodeMirror span.CodeMirror-nonmatchingbracket {color: #f22;}
148+
div.CodeMirror span.CodeMirror-matchingbracket {color: #0b0;}
149+
div.CodeMirror span.CodeMirror-nonmatchingbracket {color: #a22;}
150150
.CodeMirror-matchingtag { background: rgba(255, 150, 0, .3); }
151151
.CodeMirror-activeline-background {background: #e8f2ff;}
152152

www/lib/codemirror/lib/codemirror.js

Lines changed: 20 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -3276,8 +3276,10 @@ function updateHeightsInViewport(cm) {
32763276
// Read and store the height of line widgets associated with the
32773277
// given line.
32783278
function updateWidgetHeight(line) {
3279-
if (line.widgets) { for (var i = 0; i < line.widgets.length; ++i)
3280-
{ line.widgets[i].height = line.widgets[i].node.parentNode.offsetHeight; } }
3279+
if (line.widgets) { for (var i = 0; i < line.widgets.length; ++i) {
3280+
var w = line.widgets[i], parent = w.node.parentNode;
3281+
if (parent) { w.height = parent.offsetHeight; }
3282+
} }
32813283
}
32823284

32833285
// Compute the lines that are visible in a given viewport (defaults
@@ -7073,18 +7075,26 @@ function lookupKeyForEditor(cm, name, handle) {
70737075
// for bound mouse clicks.
70747076

70757077
var stopSeq = new Delayed;
7078+
70767079
function dispatchKey(cm, name, e, handle) {
70777080
var seq = cm.state.keySeq;
70787081
if (seq) {
70797082
if (isModifierKey(name)) { return "handled" }
7080-
stopSeq.set(50, function () {
7081-
if (cm.state.keySeq == seq) {
7082-
cm.state.keySeq = null;
7083-
cm.display.input.reset();
7084-
}
7085-
});
7086-
name = seq + " " + name;
7083+
if (/\'$/.test(name))
7084+
{ cm.state.keySeq = null; }
7085+
else
7086+
{ stopSeq.set(50, function () {
7087+
if (cm.state.keySeq == seq) {
7088+
cm.state.keySeq = null;
7089+
cm.display.input.reset();
7090+
}
7091+
}); }
7092+
if (dispatchKeyInner(cm, seq + " " + name, e, handle)) { return true }
70877093
}
7094+
return dispatchKeyInner(cm, name, e, handle)
7095+
}
7096+
7097+
function dispatchKeyInner(cm, name, e, handle) {
70887098
var result = lookupKeyForEditor(cm, name, handle);
70897099

70907100
if (result == "multi")
@@ -7097,10 +7107,6 @@ function dispatchKey(cm, name, e, handle) {
70977107
restartBlink(cm);
70987108
}
70997109

7100-
if (seq && !result && /\'$/.test(name)) {
7101-
e_preventDefault(e);
7102-
return true
7103-
}
71047110
return !!result
71057111
}
71067112

@@ -9652,7 +9658,7 @@ CodeMirror$1.fromTextArea = fromTextArea;
96529658

96539659
addLegacyProps(CodeMirror$1);
96549660

9655-
CodeMirror$1.version = "5.31.0";
9661+
CodeMirror$1.version = "5.32.0";
96569662

96579663
return CodeMirror$1;
96589664

www/lib/codemirror/mode/javascript/javascript.js

Lines changed: 28 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,6 @@ CodeMirror.defineMode("javascript", function(config, parserConfig) {
4747
"interface": kw("class"),
4848
"implements": C,
4949
"namespace": C,
50-
"module": kw("module"),
51-
"enum": kw("module"),
5250

5351
// scope modifiers
5452
"public": kw("modifier"),
@@ -155,7 +153,7 @@ CodeMirror.defineMode("javascript", function(config, parserConfig) {
155153
var kw = keywords[word]
156154
return ret(kw.type, kw.style, word)
157155
}
158-
if (word == "async" && stream.match(/^\s*[\(\w]/, false))
156+
if (word == "async" && stream.match(/^(\s|\/\*.*?\*\/)*[\(\w]/, false))
159157
return ret("async", "keyword", word)
160158
}
161159
return ret("variable", "variable", word)
@@ -372,9 +370,12 @@ CodeMirror.defineMode("javascript", function(config, parserConfig) {
372370
if (isTS && value == "type") {
373371
cx.marked = "keyword"
374372
return cont(typeexpr, expect("operator"), typeexpr, expect(";"));
375-
} if (isTS && value == "declare") {
373+
} else if (isTS && value == "declare") {
376374
cx.marked = "keyword"
377375
return cont(statement)
376+
} else if (isTS && (value == "module" || value == "enum") && cx.stream.match(/^\s*\w/, false)) {
377+
cx.marked = "keyword"
378+
return cont(pushlex("form"), pattern, expect("{"), pushlex("}"), block, poplex, poplex)
378379
} else {
379380
return cont(pushlex("stat"), maybelabel);
380381
}
@@ -388,7 +389,6 @@ CodeMirror.defineMode("javascript", function(config, parserConfig) {
388389
if (type == "class") return cont(pushlex("form"), className, poplex);
389390
if (type == "export") return cont(pushlex("stat"), afterExport, poplex);
390391
if (type == "import") return cont(pushlex("stat"), afterImport, poplex);
391-
if (type == "module") return cont(pushlex("form"), pattern, expect("{"), pushlex("}"), block, poplex, poplex)
392392
if (type == "async") return cont(statement)
393393
if (value == "@") return cont(expression, statement)
394394
return pass(pushlex("stat"), expression, expect(";"), poplex);
@@ -438,6 +438,8 @@ CodeMirror.defineMode("javascript", function(config, parserConfig) {
438438
if (type == "=>") return cont(pushcontext, noComma ? arrowBodyNoComma : arrowBody, popcontext);
439439
if (type == "operator") {
440440
if (/\+\+|--/.test(value) || isTS && value == "!") return cont(me);
441+
if (isTS && value == "<" && cx.stream.match(/^([^>]|<.*?>)*>\s*\(/, false))
442+
return cont(pushlex(">"), commasep(typeexpr, ">"), poplex, me);
441443
if (value == "?") return cont(expression, expect(":"), expr);
442444
return cont(expr);
443445
}
@@ -564,6 +566,18 @@ CodeMirror.defineMode("javascript", function(config, parserConfig) {
564566
if (value == "?") return cont(maybetype);
565567
}
566568
}
569+
function mayberettype(type) {
570+
if (isTS && type == ":") {
571+
if (cx.stream.match(/^\s*\w+\s+is\b/, false)) return cont(expression, isKW, typeexpr)
572+
else return cont(typeexpr)
573+
}
574+
}
575+
function isKW(_, value) {
576+
if (value == "is") {
577+
cx.marked = "keyword"
578+
return cont()
579+
}
580+
}
567581
function typeexpr(type, value) {
568582
if (type == "variable" || value == "void") {
569583
if (value == "keyof") {
@@ -607,6 +621,12 @@ CodeMirror.defineMode("javascript", function(config, parserConfig) {
607621
function maybeTypeArgs(_, value) {
608622
if (value == "<") return cont(pushlex(">"), commasep(typeexpr, ">"), poplex, afterType)
609623
}
624+
function typeparam() {
625+
return pass(typeexpr, maybeTypeDefault)
626+
}
627+
function maybeTypeDefault(_, value) {
628+
if (value == "=") return cont(typeexpr)
629+
}
610630
function vardef() {
611631
return pass(pattern, maybetype, maybeAssign, vardefCont);
612632
}
@@ -660,8 +680,8 @@ CodeMirror.defineMode("javascript", function(config, parserConfig) {
660680
function functiondef(type, value) {
661681
if (value == "*") {cx.marked = "keyword"; return cont(functiondef);}
662682
if (type == "variable") {register(value); return cont(functiondef);}
663-
if (type == "(") return cont(pushcontext, pushlex(")"), commasep(funarg, ")"), poplex, maybetype, statement, popcontext);
664-
if (isTS && value == "<") return cont(pushlex(">"), commasep(typeexpr, ">"), poplex, functiondef)
683+
if (type == "(") return cont(pushcontext, pushlex(")"), commasep(funarg, ")"), poplex, mayberettype, statement, popcontext);
684+
if (isTS && value == "<") return cont(pushlex(">"), commasep(typeparam, ">"), poplex, functiondef)
665685
}
666686
function funarg(type, value) {
667687
if (value == "@") cont(expression, funarg)
@@ -677,7 +697,7 @@ CodeMirror.defineMode("javascript", function(config, parserConfig) {
677697
if (type == "variable") {register(value); return cont(classNameAfter);}
678698
}
679699
function classNameAfter(type, value) {
680-
if (value == "<") return cont(pushlex(">"), commasep(typeexpr, ">"), poplex, classNameAfter)
700+
if (value == "<") return cont(pushlex(">"), commasep(typeparam, ">"), poplex, classNameAfter)
681701
if (value == "extends" || value == "implements" || (isTS && type == ","))
682702
return cont(isTS ? typeexpr : expression, classNameAfter);
683703
if (type == "{") return cont(pushlex("}"), classBody, poplex);

www/lib/system-runtime/system-runtime.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)