@onereach/ui-components 6.2.0-beta.3294.0 → 6.2.0-beta.3299.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/dist/bundled/v2/components/OrCode/OrCode.js +2 -2
- package/dist/bundled/v2/components/OrCode/index.js +5 -5
- package/dist/bundled/v2/components/OrCode/lang.js +5 -5
- package/dist/bundled/v2/components/OrCode/libs.js +5 -5
- package/dist/bundled/v2/components/OrCode/theme.js +1 -1
- package/dist/bundled/v2/components/OrCodeV3/OrCode.js +8 -8
- package/dist/bundled/v2/components/OrCodeV3/index.js +3 -3
- package/dist/bundled/v2/components/OrCodeV3/libs.js +3 -3
- package/dist/bundled/v2/components/index.js +6 -6
- package/dist/bundled/v2/{index-0ad0f605.js → index-003e27c5.js} +1 -1
- package/dist/bundled/v2/{index-379ec85d.js → index-13e363a1.js} +14 -12
- package/dist/bundled/v2/{index-d02cdc81.js → index-264444b5.js} +50 -13
- package/dist/bundled/{v3/index-c661340a.js → v2/index-2ff1af8f.js} +3 -3
- package/dist/bundled/v2/{index-0789b976.js → index-3f523d8c.js} +27 -25
- package/dist/bundled/v2/{index-b261a47e.js → index-4b36988f.js} +35 -25
- package/dist/bundled/v2/{index-ea7a689d.js → index-7488c2bc.js} +4 -4
- package/dist/bundled/v2/{index-7211e1c5.js → index-786635cb.js} +2 -2
- package/dist/bundled/v2/{index-9e0bdde8.js → index-e058b0e3.js} +2 -2
- package/dist/bundled/{v3/index-540ed5cb.js → v2/index-e9029e60.js} +288 -268
- package/dist/bundled/v2/index.js +6 -6
- package/dist/bundled/v3/{OrCode.vue_vue_type_script_lang-ad985f8f.js → OrCode.vue_vue_type_script_lang-53f0dbcf.js} +8 -8
- package/dist/bundled/v3/{OrCode.vue_vue_type_script_lang-1df17839.js → OrCode.vue_vue_type_script_lang-76b17c75.js} +2 -2
- package/dist/bundled/v3/components/OrCode/OrCode.js +2 -2
- package/dist/bundled/v3/components/OrCode/index.js +6 -6
- package/dist/bundled/v3/components/OrCode/lang.js +5 -5
- package/dist/bundled/v3/components/OrCode/libs.js +5 -5
- package/dist/bundled/v3/components/OrCode/theme.js +1 -1
- package/dist/bundled/v3/components/OrCodeV3/OrCode.js +2 -2
- package/dist/bundled/v3/components/OrCodeV3/index.js +4 -4
- package/dist/bundled/v3/components/OrCodeV3/libs.js +3 -3
- package/dist/bundled/v3/components/index.js +8 -8
- package/dist/bundled/v3/{index-168d8a72.js → index-3957c5be.js} +1 -1
- package/dist/bundled/v3/{index-e0aaa8dc.js → index-4eb7137d.js} +27 -25
- package/dist/bundled/v3/{index-3074ab3c.js → index-6a637771.js} +14 -12
- package/dist/bundled/{v2/index-c321391a.js → v3/index-81622681.js} +288 -268
- package/dist/bundled/v3/{index-73699920.js → index-9fa743a3.js} +35 -25
- package/dist/bundled/v3/{index-ce11b31b.js → index-b1301e6b.js} +50 -13
- package/dist/bundled/v3/{index-fdffd536.js → index-b52e24e9.js} +4 -4
- package/dist/bundled/{v2/index-5e5d18d5.js → v3/index-c3a9da95.js} +3 -3
- package/dist/bundled/v3/{index-a59e89b4.js → index-eaeb4268.js} +2 -2
- package/dist/bundled/v3/{index-3de4069f.js → index-f41a6890.js} +2 -2
- package/dist/bundled/v3/index.js +8 -8
- package/package.json +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { E as EditorView, a as EditorState, k as keymap } from '../../index-
|
|
2
|
-
import { b as basicSetup, i as indentWithTab } from '../../index-
|
|
1
|
+
import { E as EditorView, a as EditorState, k as keymap } from '../../index-4b36988f.js';
|
|
2
|
+
import { b as basicSetup, i as indentWithTab } from '../../index-13e363a1.js';
|
|
3
3
|
import { u as useElementHover } from '../../index-048e41ad.js';
|
|
4
4
|
import { defineComponent, ref } from 'vue-demi';
|
|
5
5
|
import __vue_component__$3 from '../OrTeleport/OrTeleport.js';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export { default as OrCode } from './OrCode.js';
|
|
2
2
|
export { OrCodeLanguages } from './constants.js';
|
|
3
|
-
export { b as basicSetup } from '../../index-
|
|
4
|
-
export { a as lintGutter, l as linter } from '../../index-
|
|
5
|
-
export { javascript } from '../../index-
|
|
6
|
-
export { json, jsonParseLinter } from '../../index-
|
|
7
|
-
export { html } from '../../index-
|
|
3
|
+
export { b as basicSetup } from '../../index-13e363a1.js';
|
|
4
|
+
export { a as lintGutter, l as linter } from '../../index-003e27c5.js';
|
|
5
|
+
export { javascript } from '../../index-2ff1af8f.js';
|
|
6
|
+
export { json, jsonParseLinter } from '../../index-e058b0e3.js';
|
|
7
|
+
export { html } from '../../index-7488c2bc.js';
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { html } from '../../index-
|
|
2
|
-
import { css } from '../../index-
|
|
3
|
-
import { json } from '../../index-
|
|
4
|
-
import { javascript } from '../../index-
|
|
5
|
-
import { markdown } from '../../index-
|
|
1
|
+
import { html } from '../../index-7488c2bc.js';
|
|
2
|
+
import { css } from '../../index-786635cb.js';
|
|
3
|
+
import { json } from '../../index-e058b0e3.js';
|
|
4
|
+
import { javascript } from '../../index-2ff1af8f.js';
|
|
5
|
+
import { markdown } from '../../index-3f523d8c.js';
|
|
6
6
|
import { OrCodeLanguages } from './constants.js';
|
|
7
7
|
|
|
8
8
|
const JS = javascript({
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export { b as basicSetup } from '../../index-
|
|
2
|
-
export { a as lintGutter, l as linter } from '../../index-
|
|
3
|
-
export { javascript } from '../../index-
|
|
4
|
-
export { json, jsonParseLinter } from '../../index-
|
|
5
|
-
export { html } from '../../index-
|
|
1
|
+
export { b as basicSetup } from '../../index-13e363a1.js';
|
|
2
|
+
export { a as lintGutter, l as linter } from '../../index-003e27c5.js';
|
|
3
|
+
export { javascript } from '../../index-2ff1af8f.js';
|
|
4
|
+
export { json, jsonParseLinter } from '../../index-e058b0e3.js';
|
|
5
|
+
export { html } from '../../index-7488c2bc.js';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { E as EditorView, am as HighlightStyle, a4 as tags, L as syntaxHighlighting } from '../../index-
|
|
1
|
+
import { E as EditorView, am as HighlightStyle, a4 as tags, L as syntaxHighlighting } from '../../index-4b36988f.js';
|
|
2
2
|
|
|
3
3
|
// Using https://github.com/one-dark/vscode-one-dark-theme/ as reference for the colors
|
|
4
4
|
const chalky = 'var(--c-warning-darken-20)',
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { defineComponent, ref, computed, reactive, toRef, watch, onMounted, onUnmounted } from 'vue-demi';
|
|
2
|
-
import { b as basicSetup, i as indentWithTab } from '../../index-
|
|
3
|
-
import { C as Compartment, k as keymap, a as EditorState, E as EditorView } from '../../index-
|
|
2
|
+
import { b as basicSetup, i as indentWithTab } from '../../index-13e363a1.js';
|
|
3
|
+
import { C as Compartment, k as keymap, a as EditorState, E as EditorView } from '../../index-4b36988f.js';
|
|
4
4
|
import { CodeLanguage } from './props.js';
|
|
5
5
|
import { Code, CodeControl } from './styles.js';
|
|
6
6
|
import __vue_component__$1 from '../OrErrorV3/OrError.js';
|
|
@@ -89,19 +89,19 @@ var script = defineComponent({
|
|
|
89
89
|
const getLanguageExtension = async language => {
|
|
90
90
|
switch (language) {
|
|
91
91
|
case CodeLanguage.HTML:
|
|
92
|
-
return (await import('../../index-
|
|
92
|
+
return (await import('../../index-7488c2bc.js')).html();
|
|
93
93
|
case CodeLanguage.CSS:
|
|
94
|
-
return (await import('../../index-
|
|
94
|
+
return (await import('../../index-786635cb.js')).css();
|
|
95
95
|
case CodeLanguage.JS:
|
|
96
|
-
return (await import('../../index-
|
|
96
|
+
return (await import('../../index-2ff1af8f.js')).javascript();
|
|
97
97
|
case CodeLanguage.TS:
|
|
98
|
-
return (await import('../../index-
|
|
98
|
+
return (await import('../../index-2ff1af8f.js')).javascript({
|
|
99
99
|
typescript: true
|
|
100
100
|
});
|
|
101
101
|
case CodeLanguage.JSON:
|
|
102
|
-
return (await import('../../index-
|
|
102
|
+
return (await import('../../index-e058b0e3.js')).json();
|
|
103
103
|
case CodeLanguage.MD:
|
|
104
|
-
return (await import('../../index-
|
|
104
|
+
return (await import('../../index-3f523d8c.js')).markdown();
|
|
105
105
|
}
|
|
106
106
|
};
|
|
107
107
|
// Methods
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export { default as OrCodeV3 } from './OrCode.js';
|
|
2
2
|
export { CodeLanguage } from './props.js';
|
|
3
|
-
export { E as EditorView } from '../../index-
|
|
4
|
-
export { a as lintGutter, l as linter } from '../../index-
|
|
5
|
-
export { json, jsonParseLinter } from '../../index-
|
|
3
|
+
export { E as EditorView } from '../../index-4b36988f.js';
|
|
4
|
+
export { a as lintGutter, l as linter } from '../../index-003e27c5.js';
|
|
5
|
+
export { json, jsonParseLinter } from '../../index-e058b0e3.js';
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export { E as EditorView } from '../../index-
|
|
2
|
-
export { a as lintGutter, l as linter } from '../../index-
|
|
3
|
-
export { json, jsonParseLinter } from '../../index-
|
|
1
|
+
export { E as EditorView } from '../../index-4b36988f.js';
|
|
2
|
+
export { a as lintGutter, l as linter } from '../../index-003e27c5.js';
|
|
3
|
+
export { json, jsonParseLinter } from '../../index-e058b0e3.js';
|
|
@@ -25,14 +25,14 @@ export { default as OrChip } from './OrChip/OrChip.js';
|
|
|
25
25
|
export { default as OrChips } from './OrChips/OrChips.js';
|
|
26
26
|
export { default as OrCode } from './OrCode/OrCode.js';
|
|
27
27
|
export { OrCodeLanguages } from './OrCode/constants.js';
|
|
28
|
-
export { b as basicSetup } from '../index-
|
|
29
|
-
export { a as lintGutter, l as linter } from '../index-
|
|
30
|
-
export { javascript } from '../index-
|
|
31
|
-
export { json, jsonParseLinter } from '../index-
|
|
32
|
-
export { html } from '../index-
|
|
28
|
+
export { b as basicSetup } from '../index-13e363a1.js';
|
|
29
|
+
export { a as lintGutter, l as linter } from '../index-003e27c5.js';
|
|
30
|
+
export { javascript } from '../index-2ff1af8f.js';
|
|
31
|
+
export { json, jsonParseLinter } from '../index-e058b0e3.js';
|
|
32
|
+
export { html } from '../index-7488c2bc.js';
|
|
33
33
|
export { default as OrCodeV3 } from './OrCodeV3/OrCode.js';
|
|
34
34
|
export { CodeLanguage } from './OrCodeV3/props.js';
|
|
35
|
-
export { E as EditorView } from '../index-
|
|
35
|
+
export { E as EditorView } from '../index-4b36988f.js';
|
|
36
36
|
export { default as OrCollapse } from './OrCollapse/OrCollapse.js';
|
|
37
37
|
export { default as OrColorPicker } from './OrColorPicker/OrColorPicker.js';
|
|
38
38
|
export { amber, black, blue, blueGrey, brown, cyan, deepOrange, deepPurple, green, indigo, lightBlue, lightGreen, lime, orange, pink, purple, red, teal, white, yellow } from './OrColorPicker/constants.js';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { E as EditorView, p as Decoration, Y as hoverTooltip, S as StateField, w as showPanel, V as ViewPlugin, Z as logException, F as Facet, c as combineConfig, _ as gutter, $ as RangeSet, a0 as showTooltip, m as StateEffect, t as getPanel, a1 as WidgetType, a2 as GutterMarker } from './index-
|
|
1
|
+
import { E as EditorView, p as Decoration, Y as hoverTooltip, S as StateField, w as showPanel, V as ViewPlugin, Z as logException, F as Facet, c as combineConfig, _ as gutter, $ as RangeSet, a0 as showTooltip, m as StateEffect, t as getPanel, a1 as WidgetType, a2 as GutterMarker } from './index-4b36988f.js';
|
|
2
2
|
|
|
3
3
|
function crelt() {
|
|
4
4
|
var elt = arguments[0];
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { E as EditorView, F as Facet, c as combineConfig, S as StateField, b as EditorSelection, T as Transaction, d as ChangeSet, e as ChangeDesc, I as IndentContext, g as getIndentation, i as indentString, f as Text, h as indentUnit, j as countColumn, l as getIndentUnit, A as Annotation, m as StateEffect, n as matchBrackets, s as syntaxTree, N as NodeProp, D as Direction, o as findClusterBreak, V as ViewPlugin, p as Decoration, q as codePointAt, r as codePointSize, t as getPanel, u as CharCategory, P as Prec, v as fromCodePoint, w as showPanel, R as RangeSetBuilder, a as EditorState, x as runScopeHandlers, y as lineNumbers, z as highlightActiveLineGutter, B as highlightSpecialChars, G as foldGutter, H as drawSelection, J as dropCursor, K as indentOnInput, L as syntaxHighlighting, M as defaultHighlightStyle, O as bracketMatching, Q as rectangularSelection, U as crosshairCursor, W as highlightActiveLine, k as keymap, X as foldKeymap } from './index-
|
|
2
|
-
import { c as crelt, b as lintKeymap } from './index-
|
|
3
|
-
import { c as closeBrackets, a as autocompletion, b as closeBracketsKeymap, d as completionKeymap } from './index-
|
|
1
|
+
import { E as EditorView, F as Facet, c as combineConfig, S as StateField, b as EditorSelection, T as Transaction, d as ChangeSet, e as ChangeDesc, I as IndentContext, g as getIndentation, i as indentString, f as Text, h as indentUnit, j as countColumn, l as getIndentUnit, A as Annotation, m as StateEffect, n as matchBrackets, s as syntaxTree, N as NodeProp, D as Direction, o as findClusterBreak, V as ViewPlugin, p as Decoration, q as codePointAt, r as codePointSize, t as getPanel, u as CharCategory, P as Prec, v as fromCodePoint, w as showPanel, R as RangeSetBuilder, a as EditorState, x as runScopeHandlers, y as lineNumbers, z as highlightActiveLineGutter, B as highlightSpecialChars, G as foldGutter, H as drawSelection, J as dropCursor, K as indentOnInput, L as syntaxHighlighting, M as defaultHighlightStyle, O as bracketMatching, Q as rectangularSelection, U as crosshairCursor, W as highlightActiveLine, k as keymap, X as foldKeymap } from './index-4b36988f.js';
|
|
2
|
+
import { c as crelt, b as lintKeymap } from './index-003e27c5.js';
|
|
3
|
+
import { c as closeBrackets, a as autocompletion, b as closeBracketsKeymap, d as completionKeymap } from './index-e9029e60.js';
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
Comment or uncomment the current selection. Will use line comments
|
|
@@ -2076,7 +2076,7 @@ class MultilineRegExpCursor {
|
|
|
2076
2076
|
this.matchPos = toCharEnd(text, from);
|
|
2077
2077
|
this.re = new RegExp(query, baseFlags + ((options === null || options === void 0 ? void 0 : options.ignoreCase) ? "i" : ""));
|
|
2078
2078
|
this.test = options === null || options === void 0 ? void 0 : options.test;
|
|
2079
|
-
this.flat = FlattenedDoc.get(text, from, this.chunkEnd(from + 5000 /*
|
|
2079
|
+
this.flat = FlattenedDoc.get(text, from, this.chunkEnd(from + 5000 /* Base */));
|
|
2080
2080
|
}
|
|
2081
2081
|
|
|
2082
2082
|
chunkEnd(pos) {
|
|
@@ -2409,6 +2409,7 @@ const searchConfigFacet = /*@__PURE__*/Facet.define({
|
|
|
2409
2409
|
top: false,
|
|
2410
2410
|
caseSensitive: false,
|
|
2411
2411
|
literal: false,
|
|
2412
|
+
regexp: false,
|
|
2412
2413
|
wholeWord: false,
|
|
2413
2414
|
createPanel: view => new SearchPanel(view),
|
|
2414
2415
|
scrollToMatch: range => EditorView.scrollIntoView(range)
|
|
@@ -2490,17 +2491,17 @@ class StringQuery extends QueryType {
|
|
|
2490
2491
|
if (cursor.done) cursor = stringCursor(this.spec, state, 0, curFrom).nextOverlapping();
|
|
2491
2492
|
return cursor.done ? null : cursor.value;
|
|
2492
2493
|
}
|
|
2493
|
-
// Searching in reverse is, rather than implementing inverted search
|
|
2494
|
+
// Searching in reverse is, rather than implementing an inverted search
|
|
2494
2495
|
// cursor, done by scanning chunk after chunk forward.
|
|
2495
2496
|
prevMatchInRange(state, from, to) {
|
|
2496
2497
|
for (let pos = to;;) {
|
|
2497
|
-
let start = Math.max(from, pos - 10000 /*
|
|
2498
|
+
let start = Math.max(from, pos - 10000 /* ChunkSize */ - this.spec.unquoted.length);
|
|
2498
2499
|
let cursor = stringCursor(this.spec, state, start, pos),
|
|
2499
2500
|
range = null;
|
|
2500
2501
|
while (!cursor.nextOverlapping().done) range = cursor.value;
|
|
2501
2502
|
if (range) return range;
|
|
2502
2503
|
if (start == from) return null;
|
|
2503
|
-
pos -= 10000 /*
|
|
2504
|
+
pos -= 10000 /* ChunkSize */;
|
|
2504
2505
|
}
|
|
2505
2506
|
}
|
|
2506
2507
|
|
|
@@ -2547,7 +2548,7 @@ class RegExpQuery extends QueryType {
|
|
|
2547
2548
|
}
|
|
2548
2549
|
prevMatchInRange(state, from, to) {
|
|
2549
2550
|
for (let size = 1;; size++) {
|
|
2550
|
-
let start = Math.max(from, to - size * 10000 /*
|
|
2551
|
+
let start = Math.max(from, to - size * 10000 /* ChunkSize */);
|
|
2551
2552
|
let cursor = regexpCursor(this.spec, state, start, to),
|
|
2552
2553
|
range = null;
|
|
2553
2554
|
while (!cursor.next().done) range = cursor.value;
|
|
@@ -2571,7 +2572,7 @@ class RegExpQuery extends QueryType {
|
|
|
2571
2572
|
return ranges;
|
|
2572
2573
|
}
|
|
2573
2574
|
highlight(state, from, to, add) {
|
|
2574
|
-
let cursor = regexpCursor(this.spec, state, Math.max(0, from - 250 /*
|
|
2575
|
+
let cursor = regexpCursor(this.spec, state, Math.max(0, from - 250 /* HighlightMargin */), Math.min(to + 250 /* HighlightMargin */, state.doc.length));
|
|
2575
2576
|
while (!cursor.next().done) add(cursor.value.from, cursor.value.to);
|
|
2576
2577
|
}
|
|
2577
2578
|
}
|
|
@@ -2632,7 +2633,7 @@ const searchHighlighter = /*@__PURE__*/ViewPlugin.fromClass(class {
|
|
|
2632
2633
|
from,
|
|
2633
2634
|
to
|
|
2634
2635
|
} = ranges[i];
|
|
2635
|
-
while (i < l - 1 && to > ranges[i + 1].from - 2 * 250 /*
|
|
2636
|
+
while (i < l - 1 && to > ranges[i + 1].from - 2 * 250 /* HighlightMargin */) to = ranges[++i].to;
|
|
2636
2637
|
query.highlight(view.state, from, to, (from, to) => {
|
|
2637
2638
|
let selected = view.state.selection.ranges.some(r => r.from == from && r.to == to);
|
|
2638
2639
|
builder.add(from, to, selected ? selectedMatchMark : matchMark);
|
|
@@ -2821,7 +2822,7 @@ function createSearchPanel(view) {
|
|
|
2821
2822
|
return view.state.facet(searchConfigFacet).createPanel(view);
|
|
2822
2823
|
}
|
|
2823
2824
|
function defaultQuery(state, fallback) {
|
|
2824
|
-
var _a, _b, _c, _d;
|
|
2825
|
+
var _a, _b, _c, _d, _e;
|
|
2825
2826
|
let sel = state.selection.main;
|
|
2826
2827
|
let selText = sel.empty || sel.to > sel.from + 100 ? "" : state.sliceDoc(sel.from, sel.to);
|
|
2827
2828
|
if (fallback && !selText) return fallback;
|
|
@@ -2830,7 +2831,8 @@ function defaultQuery(state, fallback) {
|
|
|
2830
2831
|
search: ((_a = fallback === null || fallback === void 0 ? void 0 : fallback.literal) !== null && _a !== void 0 ? _a : config.literal) ? selText : selText.replace(/\n/g, "\\n"),
|
|
2831
2832
|
caseSensitive: (_b = fallback === null || fallback === void 0 ? void 0 : fallback.caseSensitive) !== null && _b !== void 0 ? _b : config.caseSensitive,
|
|
2832
2833
|
literal: (_c = fallback === null || fallback === void 0 ? void 0 : fallback.literal) !== null && _c !== void 0 ? _c : config.literal,
|
|
2833
|
-
|
|
2834
|
+
regexp: (_d = fallback === null || fallback === void 0 ? void 0 : fallback.regexp) !== null && _d !== void 0 ? _d : config.regexp,
|
|
2835
|
+
wholeWord: (_e = fallback === null || fallback === void 0 ? void 0 : fallback.wholeWord) !== null && _e !== void 0 ? _e : config.wholeWord
|
|
2834
2836
|
});
|
|
2835
2837
|
}
|
|
2836
2838
|
function getSearchInput(view) {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { an as Parser, ao as NodeSet, ap as NodeType, aq as DefaultBufferLength, N as NodeProp, ar as Tree, ae as IterMode } from './index-
|
|
1
|
+
import { an as Parser, ao as NodeSet, ap as NodeType, aq as DefaultBufferLength, N as NodeProp, ar as Tree, ae as IterMode } from './index-4b36988f.js';
|
|
2
2
|
|
|
3
3
|
/// A parse stack. These are used internally by the parser to track
|
|
4
4
|
/// parsing progress. They also provide some properties and methods
|
|
@@ -301,16 +301,20 @@ class Stack {
|
|
|
301
301
|
// be done.
|
|
302
302
|
/// @internal
|
|
303
303
|
forceReduce() {
|
|
304
|
-
let reduce = this.p.parser.stateSlot(this.state, 5 /* ParseState.ForcedReduce */);
|
|
305
|
-
if ((reduce & 65536 /* Action.ReduceFlag */) == 0) return false;
|
|
306
304
|
let {
|
|
307
305
|
parser
|
|
308
306
|
} = this.p;
|
|
307
|
+
let reduce = parser.stateSlot(this.state, 5 /* ParseState.ForcedReduce */);
|
|
308
|
+
if ((reduce & 65536 /* Action.ReduceFlag */) == 0) return false;
|
|
309
309
|
if (!parser.validAction(this.state, reduce)) {
|
|
310
310
|
let depth = reduce >> 19 /* Action.ReduceDepthShift */,
|
|
311
311
|
term = reduce & 65535 /* Action.ValueMask */;
|
|
312
312
|
let target = this.stack.length - depth * 3;
|
|
313
|
-
if (target < 0 || parser.getGoto(this.stack[target], term, false) < 0)
|
|
313
|
+
if (target < 0 || parser.getGoto(this.stack[target], term, false) < 0) {
|
|
314
|
+
let backup = this.findForcedReduction();
|
|
315
|
+
if (backup == null) return false;
|
|
316
|
+
reduce = backup;
|
|
317
|
+
}
|
|
314
318
|
this.storeNode(0 /* Term.Err */, this.reducePos, this.reducePos, 4, true);
|
|
315
319
|
this.score -= 100 /* Recover.Reduce */;
|
|
316
320
|
}
|
|
@@ -319,6 +323,33 @@ class Stack {
|
|
|
319
323
|
this.reduce(reduce);
|
|
320
324
|
return true;
|
|
321
325
|
}
|
|
326
|
+
/// Try to scan through the automaton to find some kind of reduction
|
|
327
|
+
/// that can be applied. Used when the regular ForcedReduce field
|
|
328
|
+
/// isn't a valid action. @internal
|
|
329
|
+
findForcedReduction() {
|
|
330
|
+
let {
|
|
331
|
+
parser
|
|
332
|
+
} = this.p,
|
|
333
|
+
seen = [];
|
|
334
|
+
let explore = (state, depth) => {
|
|
335
|
+
if (seen.includes(state)) return;
|
|
336
|
+
seen.push(state);
|
|
337
|
+
return parser.allActions(state, action => {
|
|
338
|
+
if (action & (262144 /* Action.StayFlag */ | 131072 /* Action.GotoFlag */)) ;else if (action & 65536 /* Action.ReduceFlag */) {
|
|
339
|
+
let rDepth = (action >> 19 /* Action.ReduceDepthShift */) - depth;
|
|
340
|
+
if (rDepth > 1) {
|
|
341
|
+
let term = action & 65535 /* Action.ValueMask */,
|
|
342
|
+
target = this.stack.length - rDepth * 3;
|
|
343
|
+
if (target >= 0 && parser.getGoto(this.stack[target], term, false) >= 0) return rDepth << 19 /* Action.ReduceDepthShift */ | 65536 /* Action.ReduceFlag */ | term;
|
|
344
|
+
}
|
|
345
|
+
} else {
|
|
346
|
+
let found = explore(action, depth + 1);
|
|
347
|
+
if (found != null) return found;
|
|
348
|
+
}
|
|
349
|
+
});
|
|
350
|
+
};
|
|
351
|
+
return explore(this.state, 0);
|
|
352
|
+
}
|
|
322
353
|
/// @internal
|
|
323
354
|
forceAll() {
|
|
324
355
|
while (!this.p.parser.stateFlag(this.state, 2 /* StateFlag.Accepting */)) {
|
|
@@ -370,12 +401,12 @@ class Stack {
|
|
|
370
401
|
/// @internal
|
|
371
402
|
emitContext() {
|
|
372
403
|
let last = this.buffer.length - 1;
|
|
373
|
-
if (last < 0 || this.buffer[last] != -3) this.buffer.push(this.curContext.hash, this.
|
|
404
|
+
if (last < 0 || this.buffer[last] != -3) this.buffer.push(this.curContext.hash, this.pos, this.pos, -3);
|
|
374
405
|
}
|
|
375
406
|
/// @internal
|
|
376
407
|
emitLookAhead() {
|
|
377
408
|
let last = this.buffer.length - 1;
|
|
378
|
-
if (last < 0 || this.buffer[last] != -4) this.buffer.push(this.lookAhead, this.
|
|
409
|
+
if (last < 0 || this.buffer[last] != -4) this.buffer.push(this.lookAhead, this.pos, this.pos, -4);
|
|
379
410
|
}
|
|
380
411
|
updateContext(context) {
|
|
381
412
|
if (context != this.curContext.context) {
|
|
@@ -739,12 +770,12 @@ class LocalTokenGroup {
|
|
|
739
770
|
let start = input.pos,
|
|
740
771
|
skipped = 0;
|
|
741
772
|
for (;;) {
|
|
773
|
+
let nextPos = input.resolveOffset(1, -1);
|
|
742
774
|
readToken(this.data, input, stack, 0, this.data, this.precTable);
|
|
743
775
|
if (input.token.value > -1) break;
|
|
744
776
|
if (this.elseToken == null) return;
|
|
745
|
-
if (
|
|
746
|
-
input.
|
|
747
|
-
input.reset(input.pos, input.token);
|
|
777
|
+
if (nextPos == null) break;
|
|
778
|
+
input.reset(nextPos, input.token);
|
|
748
779
|
skipped++;
|
|
749
780
|
}
|
|
750
781
|
if (skipped) {
|
|
@@ -1471,13 +1502,19 @@ class LRParser extends Parser {
|
|
|
1471
1502
|
}
|
|
1472
1503
|
/// @internal
|
|
1473
1504
|
validAction(state, action) {
|
|
1474
|
-
|
|
1475
|
-
|
|
1505
|
+
return !!this.allActions(state, a => a == action ? true : null);
|
|
1506
|
+
}
|
|
1507
|
+
/// @internal
|
|
1508
|
+
allActions(state, action) {
|
|
1509
|
+
let deflt = this.stateSlot(state, 4 /* ParseState.DefaultReduce */);
|
|
1510
|
+
let result = deflt ? action(deflt) : undefined;
|
|
1511
|
+
for (let i = this.stateSlot(state, 1 /* ParseState.Actions */); result == null; i += 3) {
|
|
1476
1512
|
if (this.data[i] == 65535 /* Seq.End */) {
|
|
1477
|
-
if (this.data[i + 1] == 1 /* Seq.Next */) i = pair(this.data, i + 2);else
|
|
1513
|
+
if (this.data[i + 1] == 1 /* Seq.Next */) i = pair(this.data, i + 2);else break;
|
|
1478
1514
|
}
|
|
1479
|
-
|
|
1515
|
+
result = action(pair(this.data, i + 1));
|
|
1480
1516
|
}
|
|
1517
|
+
return result;
|
|
1481
1518
|
}
|
|
1482
1519
|
/// Get the states that can follow this one through shift actions or
|
|
1483
1520
|
/// goto jumps. @internal
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { C as ContextTracker, E as ExternalTokenizer, L as LRParser, a as LocalTokenGroup } from './index-
|
|
2
|
-
import { a3 as styleTags, a4 as tags, a5 as LanguageSupport, E as EditorView, s as syntaxTree, b as EditorSelection, a6 as LRLanguage, a7 as indentNodeProp, a8 as continuedIndent, a9 as flatIndent, aa as delimitedIndent, ab as foldNodeProp, ac as foldInside, ad as sublanguageProp, ae as IterMode, af as defineLanguageFacet, ag as NodeWeakMap } from './index-
|
|
3
|
-
import { i as ifNotIn, e as completeFromList, s as snippetCompletion } from './index-
|
|
1
|
+
import { C as ContextTracker, E as ExternalTokenizer, L as LRParser, a as LocalTokenGroup } from './index-264444b5.js';
|
|
2
|
+
import { a3 as styleTags, a4 as tags, a5 as LanguageSupport, E as EditorView, s as syntaxTree, b as EditorSelection, a6 as LRLanguage, a7 as indentNodeProp, a8 as continuedIndent, a9 as flatIndent, aa as delimitedIndent, ab as foldNodeProp, ac as foldInside, ad as sublanguageProp, ae as IterMode, af as defineLanguageFacet, ag as NodeWeakMap } from './index-4b36988f.js';
|
|
3
|
+
import { i as ifNotIn, e as completeFromList, s as snippetCompletion } from './index-e9029e60.js';
|
|
4
4
|
|
|
5
5
|
// This file was generated by lezer-generator. You probably shouldn't edit it.
|
|
6
6
|
const noSemi = 302,
|
|
@@ -1,7 +1,11 @@
|
|
|
1
|
-
import { ap as NodeType, N as NodeProp, a3 as styleTags, ao as NodeSet, a4 as tags, an as Parser, as as Tag, ar as Tree, ah as parseMixed, a5 as LanguageSupport, P as Prec, k as keymap, at as Language, s as syntaxTree, b as EditorSelection, af as defineLanguageFacet, ab as foldNodeProp, a7 as indentNodeProp, au as languageDataProp, av as foldService, aw as LanguageDescription, ax as ParseContext } from './index-
|
|
2
|
-
import { html } from './index-
|
|
1
|
+
import { ap as NodeType, N as NodeProp, a3 as styleTags, ao as NodeSet, a4 as tags, an as Parser, as as Tag, ar as Tree, ah as parseMixed, a5 as LanguageSupport, P as Prec, k as keymap, at as Language, s as syntaxTree, b as EditorSelection, af as defineLanguageFacet, ab as foldNodeProp, a7 as indentNodeProp, au as languageDataProp, av as foldService, aw as LanguageDescription, ax as ParseContext } from './index-4b36988f.js';
|
|
2
|
+
import { html } from './index-7488c2bc.js';
|
|
3
3
|
|
|
4
4
|
class CompositeBlock {
|
|
5
|
+
static create(type, value, from, parentHash, end) {
|
|
6
|
+
let hash = parentHash + (parentHash << 8) + type + (value << 4) | 0;
|
|
7
|
+
return new CompositeBlock(type, value, from, hash, end, [], []);
|
|
8
|
+
}
|
|
5
9
|
constructor(type,
|
|
6
10
|
// Used for indentation in list items, markup character in lists
|
|
7
11
|
value, from, hash, end, children, positions) {
|
|
@@ -14,10 +18,6 @@ class CompositeBlock {
|
|
|
14
18
|
this.positions = positions;
|
|
15
19
|
this.hashProp = [[NodeProp.contextHash, hash]];
|
|
16
20
|
}
|
|
17
|
-
static create(type, value, from, parentHash, end) {
|
|
18
|
-
let hash = parentHash + (parentHash << 8) + type + (value << 4) | 0;
|
|
19
|
-
return new CompositeBlock(type, value, from, hash, end, [], []);
|
|
20
|
-
}
|
|
21
21
|
addChild(child, pos) {
|
|
22
22
|
if (child.prop(NodeProp.contextHash) != this.hash) child = new Tree(child.type, child.children, child.positions, child.length, this.hashProp);
|
|
23
23
|
this.children.push(child);
|
|
@@ -450,21 +450,21 @@ const DefaultBlockParsers = {
|
|
|
450
450
|
// creates a link reference if there's a valid reference up to the current point.
|
|
451
451
|
class LinkReferenceParser {
|
|
452
452
|
constructor(leaf) {
|
|
453
|
-
this.stage = 0 /* Start */;
|
|
453
|
+
this.stage = 0 /* RefStage.Start */;
|
|
454
454
|
this.elts = [];
|
|
455
455
|
this.pos = 0;
|
|
456
456
|
this.start = leaf.start;
|
|
457
457
|
this.advance(leaf.content);
|
|
458
458
|
}
|
|
459
459
|
nextLine(cx, line, leaf) {
|
|
460
|
-
if (this.stage == -1 /* Failed */) return false;
|
|
460
|
+
if (this.stage == -1 /* RefStage.Failed */) return false;
|
|
461
461
|
let content = leaf.content + "\n" + line.scrub();
|
|
462
462
|
let finish = this.advance(content);
|
|
463
463
|
if (finish > -1 && finish < content.length) return this.complete(cx, leaf, finish);
|
|
464
464
|
return false;
|
|
465
465
|
}
|
|
466
466
|
finish(cx, leaf) {
|
|
467
|
-
if ((this.stage == 2 /* Link */ || this.stage == 3 /* Title */) && skipSpace(leaf.content, this.pos) == leaf.content.length) return this.complete(cx, leaf, leaf.content.length);
|
|
467
|
+
if ((this.stage == 2 /* RefStage.Link */ || this.stage == 3 /* RefStage.Title */) && skipSpace(leaf.content, this.pos) == leaf.content.length) return this.complete(cx, leaf, leaf.content.length);
|
|
468
468
|
return false;
|
|
469
469
|
}
|
|
470
470
|
complete(cx, leaf, len) {
|
|
@@ -478,21 +478,21 @@ class LinkReferenceParser {
|
|
|
478
478
|
this.stage++;
|
|
479
479
|
return true;
|
|
480
480
|
}
|
|
481
|
-
if (elt === false) this.stage = -1 /* Failed */;
|
|
481
|
+
if (elt === false) this.stage = -1 /* RefStage.Failed */;
|
|
482
482
|
return false;
|
|
483
483
|
}
|
|
484
484
|
advance(content) {
|
|
485
485
|
for (;;) {
|
|
486
|
-
if (this.stage == -1 /* Failed */) {
|
|
486
|
+
if (this.stage == -1 /* RefStage.Failed */) {
|
|
487
487
|
return -1;
|
|
488
|
-
} else if (this.stage == 0 /* Start */) {
|
|
488
|
+
} else if (this.stage == 0 /* RefStage.Start */) {
|
|
489
489
|
if (!this.nextStage(parseLinkLabel(content, this.pos, this.start, true))) return -1;
|
|
490
|
-
if (content.charCodeAt(this.pos) != 58 /* ':' */) return this.stage = -1 /* Failed */;
|
|
490
|
+
if (content.charCodeAt(this.pos) != 58 /* ':' */) return this.stage = -1 /* RefStage.Failed */;
|
|
491
491
|
this.elts.push(elt(Type.LinkMark, this.pos + this.start, this.pos + this.start + 1));
|
|
492
492
|
this.pos++;
|
|
493
|
-
} else if (this.stage == 1 /* Label */) {
|
|
493
|
+
} else if (this.stage == 1 /* RefStage.Label */) {
|
|
494
494
|
if (!this.nextStage(parseURL(content, skipSpace(content, this.pos), this.start))) return -1;
|
|
495
|
-
} else if (this.stage == 2 /* Link */) {
|
|
495
|
+
} else if (this.stage == 2 /* RefStage.Link */) {
|
|
496
496
|
let skip = skipSpace(content, this.pos),
|
|
497
497
|
end = 0;
|
|
498
498
|
if (skip > this.pos) {
|
|
@@ -1013,7 +1013,8 @@ for (let i = 1, name; name = Type[i]; i++) {
|
|
|
1013
1013
|
nodeTypes[i] = NodeType.define({
|
|
1014
1014
|
id: i,
|
|
1015
1015
|
name,
|
|
1016
|
-
props: i >= Type.Escape ? [] : [[NodeProp.group, i in DefaultSkipMarkup ? ["Block", "BlockContext"] : ["Block", "LeafBlock"]]]
|
|
1016
|
+
props: i >= Type.Escape ? [] : [[NodeProp.group, i in DefaultSkipMarkup ? ["Block", "BlockContext"] : ["Block", "LeafBlock"]]],
|
|
1017
|
+
top: name == "Document"
|
|
1017
1018
|
});
|
|
1018
1019
|
}
|
|
1019
1020
|
const none = [];
|
|
@@ -1174,7 +1175,7 @@ const DefaultInline = {
|
|
|
1174
1175
|
let rightFlanking = !sBefore && (!pBefore || sAfter || pAfter);
|
|
1175
1176
|
let canOpen = leftFlanking && (next == 42 || !rightFlanking || pBefore);
|
|
1176
1177
|
let canClose = rightFlanking && (next == 42 || !leftFlanking || pAfter);
|
|
1177
|
-
return cx.append(new InlineDelimiter(next == 95 ? EmphasisUnderscore : EmphasisAsterisk, start, pos, (canOpen ? 1 /* Open */ : 0) | (canClose ? 2 /* Close */ : 0)));
|
|
1178
|
+
return cx.append(new InlineDelimiter(next == 95 ? EmphasisUnderscore : EmphasisAsterisk, start, pos, (canOpen ? 1 /* Mark.Open */ : 0) | (canClose ? 2 /* Mark.Close */ : 0)));
|
|
1178
1179
|
},
|
|
1179
1180
|
HardBreak(cx, next, start) {
|
|
1180
1181
|
if (next == 92 /* '\\' */ && cx.char(start + 1) == 10 /* '\n' */) return cx.append(elt(Type.HardBreak, start, start + 2));
|
|
@@ -1186,10 +1187,10 @@ const DefaultInline = {
|
|
|
1186
1187
|
return -1;
|
|
1187
1188
|
},
|
|
1188
1189
|
Link(cx, next, start) {
|
|
1189
|
-
return next == 91 /* '[' */ ? cx.append(new InlineDelimiter(LinkStart, start, start + 1, 1 /* Open */)) : -1;
|
|
1190
|
+
return next == 91 /* '[' */ ? cx.append(new InlineDelimiter(LinkStart, start, start + 1, 1 /* Mark.Open */)) : -1;
|
|
1190
1191
|
},
|
|
1191
1192
|
Image(cx, next, start) {
|
|
1192
|
-
return next == 33 /* '!' */ && cx.char(start + 1) == 91 /* '[' */ ? cx.append(new InlineDelimiter(ImageStart, start, start + 2, 1 /* Open */)) : -1;
|
|
1193
|
+
return next == 33 /* '!' */ && cx.char(start + 1) == 91 /* '[' */ ? cx.append(new InlineDelimiter(ImageStart, start, start + 2, 1 /* Mark.Open */)) : -1;
|
|
1193
1194
|
},
|
|
1194
1195
|
LinkEnd(cx, next, start) {
|
|
1195
1196
|
if (next != 93 /* ']' */) return -1;
|
|
@@ -1345,7 +1346,7 @@ class InlineContext {
|
|
|
1345
1346
|
/// or both. Returns the end of the delimiter, for convenient
|
|
1346
1347
|
/// returning from [parse functions](#InlineParser.parse).
|
|
1347
1348
|
addDelimiter(type, from, to, open, close) {
|
|
1348
|
-
return this.append(new InlineDelimiter(type, from, to, (open ? 1 /* Open */ : 0) | (close ? 2 /* Close */ : 0)));
|
|
1349
|
+
return this.append(new InlineDelimiter(type, from, to, (open ? 1 /* Mark.Open */ : 0) | (close ? 2 /* Mark.Close */ : 0)));
|
|
1349
1350
|
}
|
|
1350
1351
|
/// Add an inline element. Returns the end of the element.
|
|
1351
1352
|
addElement(elt) {
|
|
@@ -1357,7 +1358,7 @@ class InlineContext {
|
|
|
1357
1358
|
// Scan forward, looking for closing tokens
|
|
1358
1359
|
for (let i = from; i < this.parts.length; i++) {
|
|
1359
1360
|
let close = this.parts[i];
|
|
1360
|
-
if (!(close instanceof InlineDelimiter && close.type.resolve && close.side & 2 /* Close */)) continue;
|
|
1361
|
+
if (!(close instanceof InlineDelimiter && close.type.resolve && close.side & 2 /* Mark.Close */)) continue;
|
|
1361
1362
|
let emp = close.type == EmphasisUnderscore || close.type == EmphasisAsterisk;
|
|
1362
1363
|
let closeSize = close.to - close.from;
|
|
1363
1364
|
let open,
|
|
@@ -1365,9 +1366,9 @@ class InlineContext {
|
|
|
1365
1366
|
// Continue scanning for a matching opening token
|
|
1366
1367
|
for (; j >= from; j--) {
|
|
1367
1368
|
let part = this.parts[j];
|
|
1368
|
-
if (part instanceof InlineDelimiter && part.side & 1 /* Open */ && part.type == close.type &&
|
|
1369
|
+
if (part instanceof InlineDelimiter && part.side & 1 /* Mark.Open */ && part.type == close.type &&
|
|
1369
1370
|
// Ignore emphasis delimiters where the character count doesn't match
|
|
1370
|
-
!(emp && (close.side & 1 /* Open */ || part.side & 2 /* Close */) && (part.to - part.from + closeSize) % 3 == 0 && ((part.to - part.from) % 3 || closeSize % 3))) {
|
|
1371
|
+
!(emp && (close.side & 1 /* Mark.Open */ || part.side & 2 /* Mark.Close */) && (part.to - part.from + closeSize) % 3 == 0 && ((part.to - part.from) % 3 || closeSize % 3))) {
|
|
1371
1372
|
open = part;
|
|
1372
1373
|
break;
|
|
1373
1374
|
}
|
|
@@ -1507,6 +1508,7 @@ class FragmentCursor {
|
|
|
1507
1508
|
let start = cx.absoluteLineStart,
|
|
1508
1509
|
end = start,
|
|
1509
1510
|
blockI = cx.block.children.length;
|
|
1511
|
+
let absOff = cx.lineStart - start;
|
|
1510
1512
|
let prevEnd = end,
|
|
1511
1513
|
prevI = blockI;
|
|
1512
1514
|
for (;;) {
|
|
@@ -1515,7 +1517,7 @@ class FragmentCursor {
|
|
|
1515
1517
|
break;
|
|
1516
1518
|
}
|
|
1517
1519
|
cx.dontInject.add(cur.tree);
|
|
1518
|
-
cx.addNode(cur.tree, cur.from - off);
|
|
1520
|
+
cx.addNode(cur.tree, cur.from - off + absOff);
|
|
1519
1521
|
// Taken content must always end in a block, because incremental
|
|
1520
1522
|
// parsing happens on block boundaries. Never stop directly
|
|
1521
1523
|
// after an indented code block, since those can continue after
|
|
@@ -1780,7 +1782,7 @@ const TaskList = {
|
|
|
1780
1782
|
parseBlock: [{
|
|
1781
1783
|
name: "TaskList",
|
|
1782
1784
|
leaf(cx, leaf) {
|
|
1783
|
-
return /^\[[ xX]\]/.test(leaf.content) && cx.parentType().name == "ListItem" ? new TaskParser() : null;
|
|
1785
|
+
return /^\[[ xX]\][ \t]/.test(leaf.content) && cx.parentType().name == "ListItem" ? new TaskParser() : null;
|
|
1784
1786
|
},
|
|
1785
1787
|
after: "SetextHeading"
|
|
1786
1788
|
}]
|