|
526 | 526 | This type describes a line in the document. It is created
|
527 | 527 | on-demand when lines are [queried](https://codemirror.net/6/docs/ref/#state.Text.lineAt).
|
528 | 528 | */
|
529 |
| - class Line$1 { |
| 529 | + let Line$1 = class Line { |
530 | 530 | /**
|
531 | 531 | @internal
|
532 | 532 | */
|
|
557 | 557 | The length of the line (not including any line break after it).
|
558 | 558 | */
|
559 | 559 | get length() { return this.to - this.from; }
|
560 |
| - } |
| 560 | + }; |
561 | 561 | function clip(text, from, to) {
|
562 | 562 | from = Math.max(0, Math.min(text.length, from));
|
563 | 563 | return [from, Math.max(from, Math.min(text.length, to))];
|
|
3065 | 3065 | /**
|
3066 | 3066 | A range associates a value with a range of positions.
|
3067 | 3067 | */
|
3068 |
| - class Range$1 { |
| 3068 | + let Range$1 = class Range { |
3069 | 3069 | constructor(
|
3070 | 3070 | /**
|
3071 | 3071 | The range's start position.
|
|
3087 | 3087 | @internal
|
3088 | 3088 | */
|
3089 | 3089 | static create(from, to, value) {
|
3090 |
| - return new Range$1(from, to, value); |
| 3090 | + return new Range(from, to, value); |
3091 | 3091 | }
|
3092 |
| - } |
| 3092 | + }; |
3093 | 3093 | function cmpRange(a, b) {
|
3094 | 3094 | return a.from - b.from || a.value.startSide - b.value.startSide;
|
3095 | 3095 | }
|
|
4185 | 4185 | };
|
4186 | 4186 |
|
4187 | 4187 | var chrome$1 = typeof navigator != "undefined" && /Chrome\/(\d+)/.exec(navigator.userAgent);
|
4188 |
| - typeof navigator != "undefined" && /Gecko\/\d+/.test(navigator.userAgent); |
4189 | 4188 | var mac = typeof navigator != "undefined" && /Mac/.test(navigator.platform);
|
4190 | 4189 | var ie$1 = typeof navigator != "undefined" && /MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent);
|
4191 | 4190 | var brokenModifierNames = mac || chrome$1 && +chrome$1[1] < 57;
|
|
15397 | 15396 | get node() { return this; }
|
15398 | 15397 | get next() { return this.parent; }
|
15399 | 15398 | }
|
15400 |
| - class TreeNode$2 extends BaseNode { |
| 15399 | + let TreeNode$2 = class TreeNode extends BaseNode { |
15401 | 15400 | constructor(_tree, from,
|
15402 | 15401 | // Index in parent node, set to -1 if the node is not a direct child of _parent.node (overlay)
|
15403 | 15402 | index, _parent) {
|
|
15426 | 15425 | else if ((mode & IterMode.IncludeAnonymous) || (!next.type.isAnonymous || hasChild(next))) {
|
15427 | 15426 | let mounted;
|
15428 | 15427 | 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); |
15431 | 15430 | return (mode & IterMode.IncludeAnonymous) || !inner.type.isAnonymous ? inner
|
15432 | 15431 | : inner.nextChild(dir < 0 ? next.children.length - 1 : 0, dir, pos, side);
|
15433 | 15432 | }
|
|
15454 | 15453 | for (let { from, to } of mounted.overlay) {
|
15455 | 15454 | if ((side > 0 ? from <= rPos : from < rPos) &&
|
15456 | 15455 | (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); |
15458 | 15457 | }
|
15459 | 15458 | }
|
15460 | 15459 | return this.nextChild(0, 1, pos, side, mode);
|
|
15480 | 15479 | @internal
|
15481 | 15480 | */
|
15482 | 15481 | toString() { return this._tree.toString(); }
|
15483 |
| - } |
| 15482 | + }; |
15484 | 15483 | function getChildren(node, type, before, after) {
|
15485 | 15484 | let cur = node.cursor(), result = [];
|
15486 | 15485 | if (!cur.firstChild())
|
|
16702 | 16701 | return false;
|
16703 | 16702 | }
|
16704 | 16703 | }
|
16705 |
| - class FragmentCursor$2 { |
| 16704 | + let FragmentCursor$2 = class FragmentCursor { |
16706 | 16705 | constructor(fragments) {
|
16707 | 16706 | var _a;
|
16708 | 16707 | this.fragments = fragments;
|
|
16758 | 16757 | }
|
16759 | 16758 | return result;
|
16760 | 16759 | }
|
16761 |
| - } |
| 16760 | + }; |
16762 | 16761 | function punchRanges(outer, ranges) {
|
16763 | 16762 | let copy = null, current = ranges;
|
16764 | 16763 | for (let i = 1, j = 0; i < outer.length; i++) {
|
|
25728 | 25727 | });
|
25729 | 25728 | }
|
25730 | 25729 | const none = [];
|
25731 |
| - class Buffer$2 { |
| 25730 | + let Buffer$2 = class Buffer { |
25732 | 25731 | constructor(nodeSet) {
|
25733 | 25732 | this.nodeSet = nodeSet;
|
25734 | 25733 | this.content = [];
|
|
25752 | 25751 | length
|
25753 | 25752 | });
|
25754 | 25753 | }
|
25755 |
| - } |
| 25754 | + }; |
25756 | 25755 | /// Elements are used to compose syntax nodes during parsing.
|
25757 |
| - class Element$1 { |
| 25756 | + let Element$1 = class Element { |
25758 | 25757 | /// @internal
|
25759 | 25758 | constructor(
|
25760 | 25759 | /// The node's
|
|
25781 | 25780 | toTree(nodeSet) {
|
25782 | 25781 | return new Buffer$2(nodeSet).writeElements(this.children, -this.from).finish(this.type, this.to - this.from);
|
25783 | 25782 | }
|
25784 |
| - } |
| 25783 | + }; |
25785 | 25784 | class TreeElement {
|
25786 | 25785 | constructor(tree, from) {
|
25787 | 25786 | this.tree = tree;
|
|
26209 | 26208 | // These are blocks that can span blank lines, and should thus only be
|
26210 | 26209 | // reused if their next sibling is also being reused.
|
26211 | 26210 | const NotLast = [Type.CodeBlock, Type.ListItem, Type.OrderedList, Type.BulletList];
|
26212 |
| - class FragmentCursor$1 { |
| 26211 | + let FragmentCursor$1 = class FragmentCursor { |
26213 | 26212 | constructor(fragments, input) {
|
26214 | 26213 | this.fragments = fragments;
|
26215 | 26214 | this.input = input;
|
|
26304 | 26303 | }
|
26305 | 26304 | return end - start;
|
26306 | 26305 | }
|
26307 |
| - } |
| 26306 | + }; |
26308 | 26307 | // Convert an input-stream-relative position to a
|
26309 | 26308 | // Markdown-doc-relative position by subtracting the size of all input
|
26310 | 26309 | // gaps before `abs`.
|
|
26678 | 26677 | that external code such as a tokenizer can use to get information
|
26679 | 26678 | about the parse state.
|
26680 | 26679 | */
|
26681 |
| - class Stack$2 { |
| 26680 | + let Stack$2 = class Stack { |
26682 | 26681 | /**
|
26683 | 26682 | @internal
|
26684 | 26683 | */
|
|
26770 | 26769 | */
|
26771 | 26770 | static start(p, state, pos = 0) {
|
26772 | 26771 | 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); |
26774 | 26773 | }
|
26775 | 26774 | /**
|
26776 | 26775 | The stack's current [context](#lr.ContextTracker) value, if
|
|
26963 | 26962 | // Make sure parent points to an actual parent with content, if there is such a parent.
|
26964 | 26963 | while (parent && base == parent.bufferBase)
|
26965 | 26964 | 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); |
26967 | 26966 | }
|
26968 | 26967 | // Try to recover from an error by 'deleting' (ignoring) one token.
|
26969 | 26968 | /**
|
|
27191 | 27190 | if (this.lookAhead > 0)
|
27192 | 27191 | this.emitLookAhead();
|
27193 | 27192 | }
|
27194 |
| - } |
| 27193 | + }; |
27195 | 27194 | class StackContext {
|
27196 | 27195 | constructor(tracker, context) {
|
27197 | 27196 | this.tracker = tracker;
|
@@ -156529,7 +156528,9 @@ ${"-".repeat(err.pos)}^`;
|
156529 | 156528 | css: ``,
|
156530 | 156529 | javascript: ``
|
156531 | 156530 | };
|
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); |
156533 | 156534 |
|
156534 | 156535 | const config = {
|
156535 | 156536 | // eslint configuration
|
@@ -156569,10 +156570,11 @@ ${"-".repeat(err.pos)}^`;
|
156569 | 156570 | key: "Tab",
|
156570 | 156571 | run: indentMore
|
156571 | 156572 | },
|
156572 |
| - // Other key bindings... |
156573 | 156573 | ])
|
156574 | 156574 | ];
|
156575 | 156575 | let activeEditor;
|
| 156576 | + |
| 156577 | + // init editors |
156576 | 156578 | const mdEditor = new EditorView({
|
156577 | 156579 | state: EditorState.create({
|
156578 | 156580 | doc: project.markdown,
|
@@ -156711,24 +156713,22 @@ ${"-".repeat(err.pos)}^`;
|
156711 | 156713 | mdEditor.state.update({
|
156712 | 156714 | changes: { from: 0, to: mdEditor.state.doc.length, insert: project.markdown }
|
156713 | 156715 | });
|
156714 |
| - |
156715 | 156716 | htmlEditor.state.update({
|
156716 | 156717 | changes: { from: 0, to: htmlEditor.state.doc.length, insert: project.html }
|
156717 | 156718 | });
|
156718 |
| - |
156719 | 156719 | cssEditor.state.update({
|
156720 | 156720 | changes: { from: 0, to: cssEditor.state.doc.length, insert: project.css }
|
156721 | 156721 | });
|
156722 |
| - |
156723 | 156722 | jsEditor.state.update({
|
156724 | 156723 | changes: { from: 0, to: jsEditor.state.doc.length, insert: project.javascript }
|
156725 | 156724 | });
|
| 156725 | + |
156726 | 156726 | activeEditor = htmlEditor;
|
156727 | 156727 | let sortable;
|
156728 | 156728 |
|
156729 | 156729 | const app = {
|
156730 | 156730 | appName: "kodeWeave",
|
156731 |
| - appVersion: "1.1.50", |
| 156731 | + appVersion: defaultProject.version, |
156732 | 156732 | appUrl: "https://github.com/michaelsboost/kodeWeave/tree/main",
|
156733 | 156733 | appLicense: "https://github.com/michaelsboost/kodeWeave/blob/main/LICENSE",
|
156734 | 156734 |
|
|
0 commit comments