Skip to content

Commit 51cea42

Browse files
committed
bug fix for mobile keyboard
1 parent c5b19f1 commit 51cea42

File tree

4 files changed

+51
-50
lines changed

4 files changed

+51
-50
lines changed

go/bundle.js

Lines changed: 29 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -526,7 +526,7 @@
526526
This type describes a line in the document. It is created
527527
on-demand when lines are [queried](https://codemirror.net/6/docs/ref/#state.Text.lineAt).
528528
*/
529-
class Line$1 {
529+
let Line$1 = class Line {
530530
/**
531531
@internal
532532
*/
@@ -557,7 +557,7 @@
557557
The length of the line (not including any line break after it).
558558
*/
559559
get length() { return this.to - this.from; }
560-
}
560+
};
561561
function clip(text, from, to) {
562562
from = Math.max(0, Math.min(text.length, from));
563563
return [from, Math.max(from, Math.min(text.length, to))];
@@ -3065,7 +3065,7 @@
30653065
/**
30663066
A range associates a value with a range of positions.
30673067
*/
3068-
class Range$1 {
3068+
let Range$1 = class Range {
30693069
constructor(
30703070
/**
30713071
The range's start position.
@@ -3087,9 +3087,9 @@
30873087
@internal
30883088
*/
30893089
static create(from, to, value) {
3090-
return new Range$1(from, to, value);
3090+
return new Range(from, to, value);
30913091
}
3092-
}
3092+
};
30933093
function cmpRange(a, b) {
30943094
return a.from - b.from || a.value.startSide - b.value.startSide;
30953095
}
@@ -4185,7 +4185,6 @@
41854185
};
41864186

41874187
var chrome$1 = typeof navigator != "undefined" && /Chrome\/(\d+)/.exec(navigator.userAgent);
4188-
typeof navigator != "undefined" && /Gecko\/\d+/.test(navigator.userAgent);
41894188
var mac = typeof navigator != "undefined" && /Mac/.test(navigator.platform);
41904189
var ie$1 = typeof navigator != "undefined" && /MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent);
41914190
var brokenModifierNames = mac || chrome$1 && +chrome$1[1] < 57;
@@ -15397,7 +15396,7 @@
1539715396
get node() { return this; }
1539815397
get next() { return this.parent; }
1539915398
}
15400-
class TreeNode$2 extends BaseNode {
15399+
let TreeNode$2 = class TreeNode extends BaseNode {
1540115400
constructor(_tree, from,
1540215401
// Index in parent node, set to -1 if the node is not a direct child of _parent.node (overlay)
1540315402
index, _parent) {
@@ -15426,8 +15425,8 @@
1542615425
else if ((mode & IterMode.IncludeAnonymous) || (!next.type.isAnonymous || hasChild(next))) {
1542715426
let mounted;
1542815427
if (!(mode & IterMode.IgnoreMounts) && (mounted = MountedTree.get(next)) && !mounted.overlay)
15429-
return new TreeNode$2(mounted.tree, start, i, parent);
15430-
let inner = new TreeNode$2(next, start, i, parent);
15428+
return new TreeNode(mounted.tree, start, i, parent);
15429+
let inner = new TreeNode(next, start, i, parent);
1543115430
return (mode & IterMode.IncludeAnonymous) || !inner.type.isAnonymous ? inner
1543215431
: inner.nextChild(dir < 0 ? next.children.length - 1 : 0, dir, pos, side);
1543315432
}
@@ -15454,7 +15453,7 @@
1545415453
for (let { from, to } of mounted.overlay) {
1545515454
if ((side > 0 ? from <= rPos : from < rPos) &&
1545615455
(side < 0 ? to >= rPos : to > rPos))
15457-
return new TreeNode$2(mounted.tree, mounted.overlay[0].from + this.from, -1, this);
15456+
return new TreeNode(mounted.tree, mounted.overlay[0].from + this.from, -1, this);
1545815457
}
1545915458
}
1546015459
return this.nextChild(0, 1, pos, side, mode);
@@ -15480,7 +15479,7 @@
1548015479
@internal
1548115480
*/
1548215481
toString() { return this._tree.toString(); }
15483-
}
15482+
};
1548415483
function getChildren(node, type, before, after) {
1548515484
let cur = node.cursor(), result = [];
1548615485
if (!cur.firstChild())
@@ -16702,7 +16701,7 @@
1670216701
return false;
1670316702
}
1670416703
}
16705-
class FragmentCursor$2 {
16704+
let FragmentCursor$2 = class FragmentCursor {
1670616705
constructor(fragments) {
1670716706
var _a;
1670816707
this.fragments = fragments;
@@ -16758,7 +16757,7 @@
1675816757
}
1675916758
return result;
1676016759
}
16761-
}
16760+
};
1676216761
function punchRanges(outer, ranges) {
1676316762
let copy = null, current = ranges;
1676416763
for (let i = 1, j = 0; i < outer.length; i++) {
@@ -25728,7 +25727,7 @@
2572825727
});
2572925728
}
2573025729
const none = [];
25731-
class Buffer$2 {
25730+
let Buffer$2 = class Buffer {
2573225731
constructor(nodeSet) {
2573325732
this.nodeSet = nodeSet;
2573425733
this.content = [];
@@ -25752,9 +25751,9 @@
2575225751
length
2575325752
});
2575425753
}
25755-
}
25754+
};
2575625755
/// Elements are used to compose syntax nodes during parsing.
25757-
class Element$1 {
25756+
let Element$1 = class Element {
2575825757
/// @internal
2575925758
constructor(
2576025759
/// The node's
@@ -25781,7 +25780,7 @@
2578125780
toTree(nodeSet) {
2578225781
return new Buffer$2(nodeSet).writeElements(this.children, -this.from).finish(this.type, this.to - this.from);
2578325782
}
25784-
}
25783+
};
2578525784
class TreeElement {
2578625785
constructor(tree, from) {
2578725786
this.tree = tree;
@@ -26209,7 +26208,7 @@
2620926208
// These are blocks that can span blank lines, and should thus only be
2621026209
// reused if their next sibling is also being reused.
2621126210
const NotLast = [Type.CodeBlock, Type.ListItem, Type.OrderedList, Type.BulletList];
26212-
class FragmentCursor$1 {
26211+
let FragmentCursor$1 = class FragmentCursor {
2621326212
constructor(fragments, input) {
2621426213
this.fragments = fragments;
2621526214
this.input = input;
@@ -26304,7 +26303,7 @@
2630426303
}
2630526304
return end - start;
2630626305
}
26307-
}
26306+
};
2630826307
// Convert an input-stream-relative position to a
2630926308
// Markdown-doc-relative position by subtracting the size of all input
2631026309
// gaps before `abs`.
@@ -26678,7 +26677,7 @@
2667826677
that external code such as a tokenizer can use to get information
2667926678
about the parse state.
2668026679
*/
26681-
class Stack$2 {
26680+
let Stack$2 = class Stack {
2668226681
/**
2668326682
@internal
2668426683
*/
@@ -26770,7 +26769,7 @@
2677026769
*/
2677126770
static start(p, state, pos = 0) {
2677226771
let cx = p.parser.context;
26773-
return new Stack$2(p, [], state, pos, pos, 0, [], 0, cx ? new StackContext(cx, cx.start) : null, 0, null);
26772+
return new Stack(p, [], state, pos, pos, 0, [], 0, cx ? new StackContext(cx, cx.start) : null, 0, null);
2677426773
}
2677526774
/**
2677626775
The stack's current [context](#lr.ContextTracker) value, if
@@ -26963,7 +26962,7 @@
2696326962
// Make sure parent points to an actual parent with content, if there is such a parent.
2696426963
while (parent && base == parent.bufferBase)
2696526964
parent = parent.parent;
26966-
return new Stack$2(this.p, this.stack.slice(), this.state, this.reducePos, this.pos, this.score, buffer, base, this.curContext, this.lookAhead, parent);
26965+
return new Stack(this.p, this.stack.slice(), this.state, this.reducePos, this.pos, this.score, buffer, base, this.curContext, this.lookAhead, parent);
2696726966
}
2696826967
// Try to recover from an error by 'deleting' (ignoring) one token.
2696926968
/**
@@ -27191,7 +27190,7 @@
2719127190
if (this.lookAhead > 0)
2719227191
this.emitLookAhead();
2719327192
}
27194-
}
27193+
};
2719527194
class StackContext {
2719627195
constructor(tracker, context) {
2719727196
this.tracker = tracker;
@@ -156529,7 +156528,9 @@ ${"-".repeat(err.pos)}^`;
156529156528
css: ``,
156530156529
javascript: ``
156531156530
};
156532-
let project = savedProject ? JSON.parse(savedProject) : defaultProject;
156531+
let project = savedProject ? JSON.parse(savedProject) : JSON.parse(JSON.stringify(defaultProject));
156532+
localStorage.clear();
156533+
console.log(project);
156533156534

156534156535
const config = {
156535156536
// eslint configuration
@@ -156569,10 +156570,11 @@ ${"-".repeat(err.pos)}^`;
156569156570
key: "Tab",
156570156571
run: indentMore
156571156572
},
156572-
// Other key bindings...
156573156573
])
156574156574
];
156575156575
let activeEditor;
156576+
156577+
// init editors
156576156578
const mdEditor = new EditorView({
156577156579
state: EditorState.create({
156578156580
doc: project.markdown,
@@ -156711,24 +156713,22 @@ ${"-".repeat(err.pos)}^`;
156711156713
mdEditor.state.update({
156712156714
changes: { from: 0, to: mdEditor.state.doc.length, insert: project.markdown }
156713156715
});
156714-
156715156716
htmlEditor.state.update({
156716156717
changes: { from: 0, to: htmlEditor.state.doc.length, insert: project.html }
156717156718
});
156718-
156719156719
cssEditor.state.update({
156720156720
changes: { from: 0, to: cssEditor.state.doc.length, insert: project.css }
156721156721
});
156722-
156723156722
jsEditor.state.update({
156724156723
changes: { from: 0, to: jsEditor.state.doc.length, insert: project.javascript }
156725156724
});
156725+
156726156726
activeEditor = htmlEditor;
156727156727
let sortable;
156728156728

156729156729
const app = {
156730156730
appName: "kodeWeave",
156731-
appVersion: "1.1.50",
156731+
appVersion: defaultProject.version,
156732156732
appUrl: "https://github.com/michaelsboost/kodeWeave/tree/main",
156733156733
appLicense: "https://github.com/michaelsboost/kodeWeave/blob/main/LICENSE",
156734156734

go/css/style.css

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@
44
@import url("../libraries/tailwind/tailwind.min.css");
55

66
/* editor */
7+
.cm-editor, .cm-wrap, .cm-content {
8+
height: 35vh;
9+
}
710
.cm-editor, .ͼg, .ͼl, .ͼ5 {color: #9cdcfe;}
811
.ͼ1.cm-focused {outline: 1px dotted #212121;}
912
.ͼ1 {position: relative !important; box-sizing: border-box; display: flex !important; flex-direction: column;}

go/editor.mjs

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ let defaultProject = {
3232
css: ``,
3333
javascript: ``
3434
};
35-
let project = savedProject ? JSON.parse(savedProject) : defaultProject;
35+
let project = savedProject ? JSON.parse(savedProject) : JSON.parse(JSON.stringify(defaultProject));
3636

3737
const config = {
3838
// eslint configuration
@@ -72,10 +72,11 @@ const basicSetup = [
7272
key: "Tab",
7373
run: indentMore
7474
},
75-
// Other key bindings...
7675
])
7776
];
7877
let activeEditor;
78+
79+
// init editors
7980
const mdEditor = new EditorView({
8081
state: EditorState.create({
8182
doc: project.markdown,
@@ -214,24 +215,22 @@ const jsEditor = new EditorView({
214215
mdEditor.state.update({
215216
changes: { from: 0, to: mdEditor.state.doc.length, insert: project.markdown }
216217
});
217-
218218
htmlEditor.state.update({
219219
changes: { from: 0, to: htmlEditor.state.doc.length, insert: project.html }
220220
});
221-
222221
cssEditor.state.update({
223222
changes: { from: 0, to: cssEditor.state.doc.length, insert: project.css }
224223
});
225-
226224
jsEditor.state.update({
227225
changes: { from: 0, to: jsEditor.state.doc.length, insert: project.javascript }
228226
});
227+
229228
activeEditor = htmlEditor;
230229
let sortable;
231230

232231
const app = {
233232
appName: "kodeWeave",
234-
appVersion: "1.1.50",
233+
appVersion: defaultProject.version,
235234
appUrl: "https://github.com/michaelsboost/kodeWeave/tree/main",
236235
appLicense: "https://github.com/michaelsboost/kodeWeave/blob/main/LICENSE",
237236

go/index.html

Lines changed: 14 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -94,29 +94,29 @@
9494
</div>
9595

9696
<div id="tabsNav" class="overflow-auto flex flex-col">
97-
<div data-tabcontent="markdown" class="hidden relative flex flex-col" style="height: 40vh;">
98-
<div class="flex-grow absolute top-0 inset-x-0 bottom-16 overflow-auto">
97+
<div data-tabcontent="markdown" class="hidden relative flex flex-col h-[40vh]">
98+
<div class="flex-grow overflow-auto">
9999
<div id="mdEditor"></div>
100100
</div>
101-
<div data-editorMDNavbar class="absolute bottom-0 inset-x-0 px-4 text-center inline-block overflow-auto"></div>
101+
<div data-editorMDNavbar class="flex-none px-4 text-center overflow-auto"></div>
102102
</div>
103-
<div data-tabcontent="html" class="hidden relative flex flex-col" style="height: 40vh;">
104-
<div class="flex-grow absolute top-0 inset-x-0 bottom-16 overflow-auto">
103+
<div data-tabcontent="html" class="hidden relative flex flex-col h-[40vh]">
104+
<div class="flex-grow overflow-auto">
105105
<div id="htmlEditor"></div>
106106
</div>
107-
<div data-editorHTMLNavbar class="absolute bottom-0 inset-x-0 px-4 text-center inline-block overflow-auto"></div>
107+
<div data-editorHTMLNavbar class="flex-none px-4 text-center overflow-auto"></div>
108108
</div>
109-
<div data-tabcontent="css" class="hidden relative flex flex-col" style="height: 40vh;">
110-
<div class="flex-grow absolute top-0 inset-x-0 bottom-16 overflow-auto">
109+
<div data-tabcontent="css" class="hidden relative flex flex-col h-[40vh]">
110+
<div class="flex-grow overflow-auto">
111111
<div id="cssEditor"></div>
112112
</div>
113-
<div data-editorCSSNavbar class="absolute bottom-0 inset-x-0 px-4 text-center inline-block overflow-auto"></div>
113+
<div data-editorCSSNavbar class="flex-none px-4 text-center overflow-auto"></div>
114114
</div>
115-
<div data-tabcontent="javascript" class="hidden relative flex flex-col" style="height: 40vh;">
116-
<div class="flex-grow absolute top-0 inset-x-0 bottom-16 overflow-auto">
115+
<div data-tabcontent="javascript" class="hidden relative flex flex-col h-[40vh]">
116+
<div class="flex-grow overflow-auto">
117117
<div id="jsEditor"></div>
118118
</div>
119-
<div data-editorJSNavbar class="absolute bottom-0 inset-x-0 px-4 text-center inline-block overflow-auto"></div>
119+
<div data-editorJSNavbar class="flex-none px-4 text-center overflow-auto"></div>
120120
</div>
121121
</div>
122122
</div>
@@ -394,15 +394,14 @@
394394
</ul>
395395
</nav>
396396
</div>
397-
397+
<!--
398398
<script>
399399
// service worker for progressive web app
400400
if ('serviceWorker' in navigator) {
401401
window.addEventListener('load', () => {
402402
navigator.serviceWorker.register('./sw.js')
403403
})
404404
}
405-
</script>
406-
</body>
405+
</script> -->
407406
</body>
408407
</html>

0 commit comments

Comments
 (0)