Skip to content

Commit

Permalink
bug fix for mobile keyboard
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelsboost committed Mar 13, 2024
1 parent c5b19f1 commit 51cea42
Show file tree
Hide file tree
Showing 4 changed files with 51 additions and 50 deletions.
58 changes: 29 additions & 29 deletions go/bundle.js
Original file line number Diff line number Diff line change
Expand Up @@ -526,7 +526,7 @@
This type describes a line in the document. It is created
on-demand when lines are [queried](https://codemirror.net/6/docs/ref/#state.Text.lineAt).
*/
class Line$1 {
let Line$1 = class Line {
/**
@internal
*/
Expand Down Expand Up @@ -557,7 +557,7 @@
The length of the line (not including any line break after it).
*/
get length() { return this.to - this.from; }
}
};
function clip(text, from, to) {
from = Math.max(0, Math.min(text.length, from));
return [from, Math.max(from, Math.min(text.length, to))];
Expand Down Expand Up @@ -3065,7 +3065,7 @@
/**
A range associates a value with a range of positions.
*/
class Range$1 {
let Range$1 = class Range {
constructor(
/**
The range's start position.
Expand All @@ -3087,9 +3087,9 @@
@internal
*/
static create(from, to, value) {
return new Range$1(from, to, value);
return new Range(from, to, value);
}
}
};
function cmpRange(a, b) {
return a.from - b.from || a.value.startSide - b.value.startSide;
}
Expand Down Expand Up @@ -4185,7 +4185,6 @@
};

var chrome$1 = typeof navigator != "undefined" && /Chrome\/(\d+)/.exec(navigator.userAgent);
typeof navigator != "undefined" && /Gecko\/\d+/.test(navigator.userAgent);
var mac = typeof navigator != "undefined" && /Mac/.test(navigator.platform);
var ie$1 = typeof navigator != "undefined" && /MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent);
var brokenModifierNames = mac || chrome$1 && +chrome$1[1] < 57;
Expand Down Expand Up @@ -15397,7 +15396,7 @@
get node() { return this; }
get next() { return this.parent; }
}
class TreeNode$2 extends BaseNode {
let TreeNode$2 = class TreeNode extends BaseNode {
constructor(_tree, from,
// Index in parent node, set to -1 if the node is not a direct child of _parent.node (overlay)
index, _parent) {
Expand Down Expand Up @@ -15426,8 +15425,8 @@
else if ((mode & IterMode.IncludeAnonymous) || (!next.type.isAnonymous || hasChild(next))) {
let mounted;
if (!(mode & IterMode.IgnoreMounts) && (mounted = MountedTree.get(next)) && !mounted.overlay)
return new TreeNode$2(mounted.tree, start, i, parent);
let inner = new TreeNode$2(next, start, i, parent);
return new TreeNode(mounted.tree, start, i, parent);
let inner = new TreeNode(next, start, i, parent);
return (mode & IterMode.IncludeAnonymous) || !inner.type.isAnonymous ? inner
: inner.nextChild(dir < 0 ? next.children.length - 1 : 0, dir, pos, side);
}
Expand All @@ -15454,7 +15453,7 @@
for (let { from, to } of mounted.overlay) {
if ((side > 0 ? from <= rPos : from < rPos) &&
(side < 0 ? to >= rPos : to > rPos))
return new TreeNode$2(mounted.tree, mounted.overlay[0].from + this.from, -1, this);
return new TreeNode(mounted.tree, mounted.overlay[0].from + this.from, -1, this);
}
}
return this.nextChild(0, 1, pos, side, mode);
Expand All @@ -15480,7 +15479,7 @@
@internal
*/
toString() { return this._tree.toString(); }
}
};
function getChildren(node, type, before, after) {
let cur = node.cursor(), result = [];
if (!cur.firstChild())
Expand Down Expand Up @@ -16702,7 +16701,7 @@
return false;
}
}
class FragmentCursor$2 {
let FragmentCursor$2 = class FragmentCursor {
constructor(fragments) {
var _a;
this.fragments = fragments;
Expand Down Expand Up @@ -16758,7 +16757,7 @@
}
return result;
}
}
};
function punchRanges(outer, ranges) {
let copy = null, current = ranges;
for (let i = 1, j = 0; i < outer.length; i++) {
Expand Down Expand Up @@ -25728,7 +25727,7 @@
});
}
const none = [];
class Buffer$2 {
let Buffer$2 = class Buffer {
constructor(nodeSet) {
this.nodeSet = nodeSet;
this.content = [];
Expand All @@ -25752,9 +25751,9 @@
length
});
}
}
};
/// Elements are used to compose syntax nodes during parsing.
class Element$1 {
let Element$1 = class Element {
/// @internal
constructor(
/// The node's
Expand All @@ -25781,7 +25780,7 @@
toTree(nodeSet) {
return new Buffer$2(nodeSet).writeElements(this.children, -this.from).finish(this.type, this.to - this.from);
}
}
};
class TreeElement {
constructor(tree, from) {
this.tree = tree;
Expand Down Expand Up @@ -26209,7 +26208,7 @@
// These are blocks that can span blank lines, and should thus only be
// reused if their next sibling is also being reused.
const NotLast = [Type.CodeBlock, Type.ListItem, Type.OrderedList, Type.BulletList];
class FragmentCursor$1 {
let FragmentCursor$1 = class FragmentCursor {
constructor(fragments, input) {
this.fragments = fragments;
this.input = input;
Expand Down Expand Up @@ -26304,7 +26303,7 @@
}
return end - start;
}
}
};
// Convert an input-stream-relative position to a
// Markdown-doc-relative position by subtracting the size of all input
// gaps before `abs`.
Expand Down Expand Up @@ -26678,7 +26677,7 @@
that external code such as a tokenizer can use to get information
about the parse state.
*/
class Stack$2 {
let Stack$2 = class Stack {
/**
@internal
*/
Expand Down Expand Up @@ -26770,7 +26769,7 @@
*/
static start(p, state, pos = 0) {
let cx = p.parser.context;
return new Stack$2(p, [], state, pos, pos, 0, [], 0, cx ? new StackContext(cx, cx.start) : null, 0, null);
return new Stack(p, [], state, pos, pos, 0, [], 0, cx ? new StackContext(cx, cx.start) : null, 0, null);
}
/**
The stack's current [context](#lr.ContextTracker) value, if
Expand Down Expand Up @@ -26963,7 +26962,7 @@
// Make sure parent points to an actual parent with content, if there is such a parent.
while (parent && base == parent.bufferBase)
parent = parent.parent;
return new Stack$2(this.p, this.stack.slice(), this.state, this.reducePos, this.pos, this.score, buffer, base, this.curContext, this.lookAhead, parent);
return new Stack(this.p, this.stack.slice(), this.state, this.reducePos, this.pos, this.score, buffer, base, this.curContext, this.lookAhead, parent);
}
// Try to recover from an error by 'deleting' (ignoring) one token.
/**
Expand Down Expand Up @@ -27191,7 +27190,7 @@
if (this.lookAhead > 0)
this.emitLookAhead();
}
}
};
class StackContext {
constructor(tracker, context) {
this.tracker = tracker;
Expand Down Expand Up @@ -156529,7 +156528,9 @@ ${"-".repeat(err.pos)}^`;
css: ``,
javascript: ``
};
let project = savedProject ? JSON.parse(savedProject) : defaultProject;
let project = savedProject ? JSON.parse(savedProject) : JSON.parse(JSON.stringify(defaultProject));
localStorage.clear();
console.log(project);

const config = {
// eslint configuration
Expand Down Expand Up @@ -156569,10 +156570,11 @@ ${"-".repeat(err.pos)}^`;
key: "Tab",
run: indentMore
},
// Other key bindings...
])
];
let activeEditor;

// init editors
const mdEditor = new EditorView({
state: EditorState.create({
doc: project.markdown,
Expand Down Expand Up @@ -156711,24 +156713,22 @@ ${"-".repeat(err.pos)}^`;
mdEditor.state.update({
changes: { from: 0, to: mdEditor.state.doc.length, insert: project.markdown }
});

htmlEditor.state.update({
changes: { from: 0, to: htmlEditor.state.doc.length, insert: project.html }
});

cssEditor.state.update({
changes: { from: 0, to: cssEditor.state.doc.length, insert: project.css }
});

jsEditor.state.update({
changes: { from: 0, to: jsEditor.state.doc.length, insert: project.javascript }
});

activeEditor = htmlEditor;
let sortable;

const app = {
appName: "kodeWeave",
appVersion: "1.1.50",
appVersion: defaultProject.version,
appUrl: "https://github.com/michaelsboost/kodeWeave/tree/main",
appLicense: "https://github.com/michaelsboost/kodeWeave/blob/main/LICENSE",

Expand Down
3 changes: 3 additions & 0 deletions go/css/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@
@import url("../libraries/tailwind/tailwind.min.css");

/* editor */
.cm-editor, .cm-wrap, .cm-content {
height: 35vh;
}
.cm-editor, .ͼg, .ͼl, .ͼ5 {color: #9cdcfe;}
.ͼ1.cm-focused {outline: 1px dotted #212121;}
.ͼ1 {position: relative !important; box-sizing: border-box; display: flex !important; flex-direction: column;}
Expand Down
11 changes: 5 additions & 6 deletions go/editor.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ let defaultProject = {
css: ``,
javascript: ``
};
let project = savedProject ? JSON.parse(savedProject) : defaultProject;
let project = savedProject ? JSON.parse(savedProject) : JSON.parse(JSON.stringify(defaultProject));

const config = {
// eslint configuration
Expand Down Expand Up @@ -72,10 +72,11 @@ const basicSetup = [
key: "Tab",
run: indentMore
},
// Other key bindings...
])
];
let activeEditor;

// init editors
const mdEditor = new EditorView({
state: EditorState.create({
doc: project.markdown,
Expand Down Expand Up @@ -214,24 +215,22 @@ const jsEditor = new EditorView({
mdEditor.state.update({
changes: { from: 0, to: mdEditor.state.doc.length, insert: project.markdown }
});

htmlEditor.state.update({
changes: { from: 0, to: htmlEditor.state.doc.length, insert: project.html }
});

cssEditor.state.update({
changes: { from: 0, to: cssEditor.state.doc.length, insert: project.css }
});

jsEditor.state.update({
changes: { from: 0, to: jsEditor.state.doc.length, insert: project.javascript }
});

activeEditor = htmlEditor;
let sortable;

const app = {
appName: "kodeWeave",
appVersion: "1.1.50",
appVersion: defaultProject.version,
appUrl: "https://github.com/michaelsboost/kodeWeave/tree/main",
appLicense: "https://github.com/michaelsboost/kodeWeave/blob/main/LICENSE",

Expand Down
29 changes: 14 additions & 15 deletions go/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -94,29 +94,29 @@
</div>

<div id="tabsNav" class="overflow-auto flex flex-col">
<div data-tabcontent="markdown" class="hidden relative flex flex-col" style="height: 40vh;">
<div class="flex-grow absolute top-0 inset-x-0 bottom-16 overflow-auto">
<div data-tabcontent="markdown" class="hidden relative flex flex-col h-[40vh]">
<div class="flex-grow overflow-auto">
<div id="mdEditor"></div>
</div>
<div data-editorMDNavbar class="absolute bottom-0 inset-x-0 px-4 text-center inline-block overflow-auto"></div>
<div data-editorMDNavbar class="flex-none px-4 text-center overflow-auto"></div>
</div>
<div data-tabcontent="html" class="hidden relative flex flex-col" style="height: 40vh;">
<div class="flex-grow absolute top-0 inset-x-0 bottom-16 overflow-auto">
<div data-tabcontent="html" class="hidden relative flex flex-col h-[40vh]">
<div class="flex-grow overflow-auto">
<div id="htmlEditor"></div>
</div>
<div data-editorHTMLNavbar class="absolute bottom-0 inset-x-0 px-4 text-center inline-block overflow-auto"></div>
<div data-editorHTMLNavbar class="flex-none px-4 text-center overflow-auto"></div>
</div>
<div data-tabcontent="css" class="hidden relative flex flex-col" style="height: 40vh;">
<div class="flex-grow absolute top-0 inset-x-0 bottom-16 overflow-auto">
<div data-tabcontent="css" class="hidden relative flex flex-col h-[40vh]">
<div class="flex-grow overflow-auto">
<div id="cssEditor"></div>
</div>
<div data-editorCSSNavbar class="absolute bottom-0 inset-x-0 px-4 text-center inline-block overflow-auto"></div>
<div data-editorCSSNavbar class="flex-none px-4 text-center overflow-auto"></div>
</div>
<div data-tabcontent="javascript" class="hidden relative flex flex-col" style="height: 40vh;">
<div class="flex-grow absolute top-0 inset-x-0 bottom-16 overflow-auto">
<div data-tabcontent="javascript" class="hidden relative flex flex-col h-[40vh]">
<div class="flex-grow overflow-auto">
<div id="jsEditor"></div>
</div>
<div data-editorJSNavbar class="absolute bottom-0 inset-x-0 px-4 text-center inline-block overflow-auto"></div>
<div data-editorJSNavbar class="flex-none px-4 text-center overflow-auto"></div>
</div>
</div>
</div>
Expand Down Expand Up @@ -394,15 +394,14 @@
</ul>
</nav>
</div>

<!--
<script>
// service worker for progressive web app
if ('serviceWorker' in navigator) {
window.addEventListener('load', () => {
navigator.serviceWorker.register('./sw.js')
})
}
</script>
</body>
</script> -->
</body>
</html>

0 comments on commit 51cea42

Please sign in to comment.