@gsc-basic/components 1.0.1 → 1.0.3
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/README.md +59 -0
- package/dist/es/index.js +48 -30
- package/dist/es/node_modules/@codemirror/autocomplete/dist/index.js +15 -15
- package/dist/es/node_modules/@codemirror/commands/dist/index.js +31 -25
- package/dist/es/node_modules/@codemirror/lang-java/dist/index.js +3 -3
- package/dist/es/node_modules/@codemirror/lang-javascript/dist/index.js +8 -8
- package/dist/es/node_modules/@codemirror/lang-json/dist/index.js +1 -1
- package/dist/es/node_modules/@codemirror/lang-python/dist/index.js +1 -1
- package/dist/es/node_modules/@codemirror/lang-sql/dist/index.js +6 -6
- package/dist/es/node_modules/@codemirror/lang-xml/dist/index.js +3 -3
- package/dist/es/node_modules/@codemirror/lang-yaml/dist/index.js +1 -1
- package/dist/es/node_modules/@codemirror/language/dist/index.js +77 -77
- package/dist/es/node_modules/@codemirror/lint/dist/index.js +7 -7
- package/dist/es/node_modules/@codemirror/search/dist/index.js +432 -465
- package/dist/es/node_modules/@codemirror/state/dist/index.js +272 -268
- package/dist/es/node_modules/@codemirror/view/dist/index.js +1732 -1647
- package/dist/es/node_modules/@lezer/common/dist/index.js +191 -190
- package/dist/es/node_modules/@lezer/lr/dist/index.js +5 -3
- package/dist/es/node_modules/@tanstack/devtools-event-client/dist/esm/plugin.js +178 -0
- package/dist/es/node_modules/@tanstack/form-core/dist/esm/EventClient.js +13 -0
- package/dist/es/node_modules/@tanstack/form-core/dist/esm/FieldApi.js +406 -0
- package/dist/es/node_modules/@tanstack/form-core/dist/esm/FormApi.js +772 -0
- package/dist/es/node_modules/@tanstack/form-core/dist/esm/ValidationLogic.js +55 -0
- package/dist/es/node_modules/@tanstack/form-core/dist/esm/metaHelper.js +109 -0
- package/dist/es/node_modules/@tanstack/form-core/dist/esm/standardSchemaValidator.js +45 -0
- package/dist/es/node_modules/@tanstack/form-core/dist/esm/utils.js +213 -0
- package/dist/es/node_modules/@tanstack/pacer-lite/dist/lite-throttler.js +29 -0
- package/dist/es/node_modules/@tanstack/store/dist/esm/derived.js +74 -0
- package/dist/es/node_modules/@tanstack/store/dist/esm/scheduler.js +79 -0
- package/dist/es/node_modules/@tanstack/store/dist/esm/store.js +21 -0
- package/dist/es/node_modules/@tanstack/store/dist/esm/types.js +6 -0
- package/dist/es/node_modules/@tanstack/table-core/build/lib/index.js +1885 -0
- package/dist/es/node_modules/@tanstack/vue-form/dist/esm/useField.js +38 -0
- package/dist/es/node_modules/@tanstack/vue-form/dist/esm/useForm.js +33 -0
- package/dist/es/node_modules/@tanstack/vue-store/dist/esm/index.js +48 -0
- package/dist/es/node_modules/@tanstack/vue-table/build/lib/index.js +159 -0
- package/dist/es/node_modules/@vueuse/core/dist/index.js +1 -1
- package/dist/es/node_modules/codemirror/dist/index.js +3 -3
- package/dist/es/src/Button/index.js +6 -0
- package/dist/es/src/Button/src/Button.css +1 -0
- package/dist/es/src/Button/src/Button.vue.js +41 -0
- package/dist/es/src/Button/src/Button2.css +1 -0
- package/dist/es/src/CodeEditor/src/index.css +1 -1
- package/dist/es/src/CodeEditor/src/index.vue.js +54 -51
- package/dist/es/src/CodeEditor/src/index2.css +1 -1
- package/dist/es/src/ConfigProvider/index.js +1 -2
- package/dist/es/src/ConfigProvider/src/useGlobalConfig.js +9 -9
- package/dist/es/src/Form/index.js +6 -0
- package/dist/es/src/Form/src/Form.css +1 -0
- package/dist/es/src/Form/src/Form.vue.js +208 -0
- package/dist/es/src/Form/src/styles/form.css +1 -0
- package/dist/es/src/Grid/index.js +6 -0
- package/dist/es/src/Grid/src/Grid.css +1 -0
- package/dist/es/src/Grid/src/Grid.vue.js +180 -0
- package/dist/es/src/Grid/src/components/ActionBar.css +1 -0
- package/dist/es/src/Grid/src/components/ActionBar.vue.js +65 -0
- package/dist/es/src/Grid/src/components/CellEditor.css +1 -0
- package/dist/es/src/Grid/src/components/CellEditor.vue.js +132 -0
- package/dist/es/src/Grid/src/components/CellEditor2.css +1 -0
- package/dist/es/src/Grid/src/components/ColumnFilter.css +1 -0
- package/dist/es/src/Grid/src/components/ColumnFilter.vue.js +72 -0
- package/dist/es/src/Grid/src/components/ColumnSettings.css +1 -0
- package/dist/es/src/Grid/src/components/ColumnSettings.vue.js +109 -0
- package/dist/es/src/Grid/src/components/DataTable.css +1 -0
- package/dist/es/src/Grid/src/components/DataTable.vue.js +556 -0
- package/dist/es/src/Grid/src/components/Pager.css +1 -0
- package/dist/es/src/Grid/src/components/Pager.vue.js +64 -0
- package/dist/es/src/Grid/src/components/QueryBar.css +1 -0
- package/dist/es/src/Grid/src/components/QueryBar.vue.js +156 -0
- package/dist/es/src/Grid/src/composables/useCellEditor.js +20 -0
- package/dist/es/src/Grid/src/composables/useGridTable.js +213 -0
- package/dist/es/src/Grid/src/styles/table.css +1 -0
- package/dist/es/src/Overlay/index.js +61 -0
- package/dist/es/src/Overlay/src/Message.css +1 -0
- package/dist/es/src/Overlay/src/Message.vue.js +36 -0
- package/dist/es/src/Overlay/src/Message2.css +1 -0
- package/dist/es/src/Overlay/src/Modal.css +1 -0
- package/dist/es/src/Overlay/src/Modal.vue.js +67 -0
- package/dist/es/src/Overlay/src/Modal2.css +1 -0
- package/dist/es/src/Overlay/src/Notice.css +1 -0
- package/dist/es/src/Overlay/src/Notice.vue.js +37 -0
- package/dist/es/src/Overlay/src/Notice2.css +1 -0
- package/dist/es/src/ScaleScreen/src/index.vue.js +2 -2
- package/dist/es/src/VideoBackground/src/index.vue.js +8 -8
- package/dist/es/src/index.js +35 -19
- package/dist/es/src/locale/lang/en-US.js +40 -0
- package/dist/es/src/locale/lang/ja-JP.js +42 -2
- package/dist/es/src/locale/lang/zh-CN.js +42 -2
- package/dist/es/src/styles/tokens.css +1 -1
- package/dist/lib/index.js +1 -1
- package/dist/lib/node_modules/@codemirror/commands/dist/index.js +1 -1
- package/dist/lib/node_modules/@codemirror/language/dist/index.js +1 -1
- package/dist/lib/node_modules/@codemirror/search/dist/index.js +2 -2
- package/dist/lib/node_modules/@codemirror/state/dist/index.js +4 -4
- package/dist/lib/node_modules/@codemirror/view/dist/index.js +5 -5
- package/dist/lib/node_modules/@lezer/common/dist/index.js +1 -1
- package/dist/lib/node_modules/@lezer/lr/dist/index.js +1 -1
- package/dist/lib/node_modules/@tanstack/devtools-event-client/dist/esm/plugin.js +1 -0
- package/dist/lib/node_modules/@tanstack/form-core/dist/esm/EventClient.js +1 -0
- package/dist/lib/node_modules/@tanstack/form-core/dist/esm/FieldApi.js +1 -0
- package/dist/lib/node_modules/@tanstack/form-core/dist/esm/FormApi.js +1 -0
- package/dist/lib/node_modules/@tanstack/form-core/dist/esm/ValidationLogic.js +1 -0
- package/dist/lib/node_modules/@tanstack/form-core/dist/esm/metaHelper.js +1 -0
- package/dist/lib/node_modules/@tanstack/form-core/dist/esm/standardSchemaValidator.js +1 -0
- package/dist/lib/node_modules/@tanstack/form-core/dist/esm/utils.js +1 -0
- package/dist/lib/node_modules/@tanstack/pacer-lite/dist/lite-throttler.js +1 -0
- package/dist/lib/node_modules/@tanstack/store/dist/esm/derived.js +1 -0
- package/dist/lib/node_modules/@tanstack/store/dist/esm/scheduler.js +1 -0
- package/dist/lib/node_modules/@tanstack/store/dist/esm/store.js +1 -0
- package/dist/lib/node_modules/@tanstack/store/dist/esm/types.js +1 -0
- package/dist/lib/node_modules/@tanstack/table-core/build/lib/index.js +4 -0
- package/dist/lib/node_modules/@tanstack/vue-form/dist/esm/useField.js +1 -0
- package/dist/lib/node_modules/@tanstack/vue-form/dist/esm/useForm.js +1 -0
- package/dist/lib/node_modules/@tanstack/vue-store/dist/esm/index.js +1 -0
- package/dist/lib/node_modules/@tanstack/vue-table/build/lib/index.js +1 -0
- package/dist/lib/src/Button/index.js +1 -0
- package/dist/lib/src/Button/src/Button.css +1 -0
- package/dist/lib/src/Button/src/Button.vue.js +1 -0
- package/dist/lib/src/Button/src/Button2.css +1 -0
- package/dist/lib/src/CodeEditor/src/index.css +1 -1
- package/dist/lib/src/CodeEditor/src/index.vue.js +1 -1
- package/dist/lib/src/CodeEditor/src/index2.css +1 -1
- package/dist/lib/src/ConfigProvider/index.js +1 -1
- package/dist/lib/src/Form/index.js +1 -0
- package/dist/lib/src/Form/src/Form.css +1 -0
- package/dist/lib/src/Form/src/Form.vue.js +1 -0
- package/dist/lib/src/Form/src/styles/form.css +1 -0
- package/dist/lib/src/Grid/index.js +1 -0
- package/dist/lib/src/Grid/src/Grid.css +1 -0
- package/dist/lib/src/Grid/src/Grid.vue.js +1 -0
- package/dist/lib/src/Grid/src/components/ActionBar.css +1 -0
- package/dist/lib/src/Grid/src/components/ActionBar.vue.js +1 -0
- package/dist/lib/src/Grid/src/components/CellEditor.css +1 -0
- package/dist/lib/src/Grid/src/components/CellEditor.vue.js +1 -0
- package/dist/lib/src/Grid/src/components/CellEditor2.css +1 -0
- package/dist/lib/src/Grid/src/components/ColumnFilter.css +1 -0
- package/dist/lib/src/Grid/src/components/ColumnFilter.vue.js +1 -0
- package/dist/lib/src/Grid/src/components/ColumnSettings.css +1 -0
- package/dist/lib/src/Grid/src/components/ColumnSettings.vue.js +1 -0
- package/dist/lib/src/Grid/src/components/DataTable.css +1 -0
- package/dist/lib/src/Grid/src/components/DataTable.vue.js +1 -0
- package/dist/lib/src/Grid/src/components/Pager.css +1 -0
- package/dist/lib/src/Grid/src/components/Pager.vue.js +1 -0
- package/dist/lib/src/Grid/src/components/QueryBar.css +1 -0
- package/dist/lib/src/Grid/src/components/QueryBar.vue.js +1 -0
- package/dist/lib/src/Grid/src/composables/useCellEditor.js +1 -0
- package/dist/lib/src/Grid/src/composables/useGridTable.js +1 -0
- package/dist/lib/src/Grid/src/styles/table.css +1 -0
- package/dist/lib/src/Overlay/index.js +1 -0
- package/dist/lib/src/Overlay/src/Message.css +1 -0
- package/dist/lib/src/Overlay/src/Message.vue.js +1 -0
- package/dist/lib/src/Overlay/src/Message2.css +1 -0
- package/dist/lib/src/Overlay/src/Modal.css +1 -0
- package/dist/lib/src/Overlay/src/Modal.vue.js +1 -0
- package/dist/lib/src/Overlay/src/Modal2.css +1 -0
- package/dist/lib/src/Overlay/src/Notice.css +1 -0
- package/dist/lib/src/Overlay/src/Notice.vue.js +1 -0
- package/dist/lib/src/Overlay/src/Notice2.css +1 -0
- package/dist/lib/src/index.js +1 -1
- package/dist/lib/src/locale/lang/en-US.js +1 -1
- package/dist/lib/src/locale/lang/ja-JP.js +1 -1
- package/dist/lib/src/locale/lang/zh-CN.js +1 -1
- package/dist/lib/src/styles/tokens.css +1 -1
- package/package.json +11 -8
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { NodeProp as y, Tree as C, IterMode as
|
|
2
|
-
import {
|
|
3
|
-
import { EditorView as b, ViewPlugin as Y, Decoration as p, gutter as Ne, GutterMarker as Ee, logException as Fe, WidgetType as
|
|
1
|
+
import { NodeProp as y, Tree as C, IterMode as _, TreeFragment as M, Parser as Be, NodeType as Q } from "../../../@lezer/common/dist/index.js";
|
|
2
|
+
import { Facet as w, Prec as Ie, EditorState as B, RangeSetBuilder as fe, RangeSet as Oe, StateField as X, StateEffect as L, combineConfig as ce, countColumn as Me } from "../../state/dist/index.js";
|
|
3
|
+
import { EditorView as b, ViewPlugin as Y, Decoration as p, gutter as Ne, GutterMarker as Ee, logException as Fe, WidgetType as ue, Direction as ee } from "../../view/dist/index.js";
|
|
4
4
|
import { tagHighlighter as Le, highlightTree as He, tags as u, styleTags as We } from "../../../@lezer/highlight/dist/index.js";
|
|
5
|
-
import { StyleModule as
|
|
5
|
+
import { StyleModule as te } from "../../../style-mod/src/style-mod.js";
|
|
6
6
|
var U;
|
|
7
7
|
const A = /* @__PURE__ */ new y();
|
|
8
8
|
function Re(n) {
|
|
@@ -25,7 +25,7 @@ class g {
|
|
|
25
25
|
} }), this.parser = t, this.extension = [
|
|
26
26
|
v.of(this),
|
|
27
27
|
B.languageData.of((o, s, a) => {
|
|
28
|
-
let l =
|
|
28
|
+
let l = ne(o, s, a), f = l.type.prop(A);
|
|
29
29
|
if (!f)
|
|
30
30
|
return [];
|
|
31
31
|
let c = o.facet(f), h = l.type.prop(Ue);
|
|
@@ -45,7 +45,7 @@ class g {
|
|
|
45
45
|
Query whether this language is active at the given position.
|
|
46
46
|
*/
|
|
47
47
|
isActiveAt(e, t, r = -1) {
|
|
48
|
-
return
|
|
48
|
+
return ne(e, t, r).type.prop(A) == this.data;
|
|
49
49
|
}
|
|
50
50
|
/**
|
|
51
51
|
Find the document regions that were parsed using this language.
|
|
@@ -94,10 +94,10 @@ class g {
|
|
|
94
94
|
}
|
|
95
95
|
}
|
|
96
96
|
g.setState = /* @__PURE__ */ L.define();
|
|
97
|
-
function
|
|
97
|
+
function ne(n, e, t) {
|
|
98
98
|
let r = n.facet(v), i = k(n).topNode;
|
|
99
99
|
if (!r || r.allowsNesting)
|
|
100
|
-
for (let o = i; o; o = o.enter(e, t,
|
|
100
|
+
for (let o = i; o; o = o.enter(e, t, _.ExcludeBuffers | _.EnterBracketed))
|
|
101
101
|
o.type.isTop && (i = o);
|
|
102
102
|
return i;
|
|
103
103
|
}
|
|
@@ -210,7 +210,7 @@ class N {
|
|
|
210
210
|
}
|
|
211
211
|
withoutTempSkipped(e) {
|
|
212
212
|
for (let t; t = this.tempSkipped.pop(); )
|
|
213
|
-
e =
|
|
213
|
+
e = re(e, t.from, t.to);
|
|
214
214
|
return e;
|
|
215
215
|
}
|
|
216
216
|
/**
|
|
@@ -240,7 +240,7 @@ class N {
|
|
|
240
240
|
let t = this.skipped.length;
|
|
241
241
|
for (let r = 0; r < this.skipped.length; r++) {
|
|
242
242
|
let { from: i, to: o } = this.skipped[r];
|
|
243
|
-
i < e.to && o > e.from && (this.fragments =
|
|
243
|
+
i < e.to && o > e.from && (this.fragments = re(this.fragments, i, o), this.skipped.splice(r--, 1));
|
|
244
244
|
}
|
|
245
245
|
return this.skipped.length >= t ? !1 : (this.reset(), !0);
|
|
246
246
|
}
|
|
@@ -305,7 +305,7 @@ class N {
|
|
|
305
305
|
return D;
|
|
306
306
|
}
|
|
307
307
|
}
|
|
308
|
-
function
|
|
308
|
+
function re(n, e, t) {
|
|
309
309
|
return M.applyChanges(n, [{ fromA: e, toA: t, fromB: e, toB: t }]);
|
|
310
310
|
}
|
|
311
311
|
class P {
|
|
@@ -332,7 +332,7 @@ g.state = /* @__PURE__ */ X.define({
|
|
|
332
332
|
return e.startState.facet(v) != e.state.facet(v) ? P.init(e.state) : n.apply(e);
|
|
333
333
|
}
|
|
334
334
|
});
|
|
335
|
-
let
|
|
335
|
+
let he = (n) => {
|
|
336
336
|
let e = setTimeout(
|
|
337
337
|
() => n(),
|
|
338
338
|
500
|
|
@@ -340,7 +340,7 @@ let ue = (n) => {
|
|
|
340
340
|
);
|
|
341
341
|
return () => clearTimeout(e);
|
|
342
342
|
};
|
|
343
|
-
typeof requestIdleCallback < "u" && (
|
|
343
|
+
typeof requestIdleCallback < "u" && (he = (n) => {
|
|
344
344
|
let e = -1, t = setTimeout(
|
|
345
345
|
() => {
|
|
346
346
|
e = requestIdleCallback(n, {
|
|
@@ -365,7 +365,7 @@ const $ = typeof navigator < "u" && (!((U = navigator.scheduling) === null || U
|
|
|
365
365
|
if (this.working)
|
|
366
366
|
return;
|
|
367
367
|
let { state: e } = this.view, t = e.field(g.state);
|
|
368
|
-
(t.tree != t.context.tree || !t.context.isDone(e.doc.length)) && (this.working =
|
|
368
|
+
(t.tree != t.context.tree || !t.context.isDone(e.doc.length)) && (this.working = he(this.work));
|
|
369
369
|
}
|
|
370
370
|
work(e) {
|
|
371
371
|
this.working = null;
|
|
@@ -415,7 +415,7 @@ class Et {
|
|
|
415
415
|
this.language = e, this.support = t, this.extension = [e, t];
|
|
416
416
|
}
|
|
417
417
|
}
|
|
418
|
-
const je = /* @__PURE__ */ w.define(),
|
|
418
|
+
const je = /* @__PURE__ */ w.define(), de = /* @__PURE__ */ w.define({
|
|
419
419
|
combine: (n) => {
|
|
420
420
|
if (!n.length)
|
|
421
421
|
return " ";
|
|
@@ -426,11 +426,11 @@ const je = /* @__PURE__ */ w.define(), he = /* @__PURE__ */ w.define({
|
|
|
426
426
|
}
|
|
427
427
|
});
|
|
428
428
|
function ze(n) {
|
|
429
|
-
let e = n.facet(
|
|
429
|
+
let e = n.facet(de);
|
|
430
430
|
return e.charCodeAt(0) == 9 ? n.tabSize * e.length : e.length;
|
|
431
431
|
}
|
|
432
432
|
function Ge(n, e) {
|
|
433
|
-
let t = "", r = n.tabSize, i = n.facet(
|
|
433
|
+
let t = "", r = n.tabSize, i = n.facet(de)[0];
|
|
434
434
|
if (i == " ") {
|
|
435
435
|
for (; e >= r; )
|
|
436
436
|
t += " ", e -= r;
|
|
@@ -441,7 +441,7 @@ function Ge(n, e) {
|
|
|
441
441
|
return t;
|
|
442
442
|
}
|
|
443
443
|
function Je(n, e) {
|
|
444
|
-
n instanceof B && (n = new
|
|
444
|
+
n instanceof B && (n = new pe(n));
|
|
445
445
|
for (let r of n.state.facet(je)) {
|
|
446
446
|
let i = r(n, e);
|
|
447
447
|
if (i !== void 0)
|
|
@@ -450,7 +450,7 @@ function Je(n, e) {
|
|
|
450
450
|
let t = k(n.state);
|
|
451
451
|
return t.length >= e ? Ke(n, t, e) : null;
|
|
452
452
|
}
|
|
453
|
-
class
|
|
453
|
+
class pe {
|
|
454
454
|
/**
|
|
455
455
|
Create an indent context.
|
|
456
456
|
*/
|
|
@@ -524,9 +524,9 @@ function Ke(n, e, t) {
|
|
|
524
524
|
for (let s = o.length - 1; s >= 0; s--)
|
|
525
525
|
r = { node: o[s], next: r };
|
|
526
526
|
}
|
|
527
|
-
return
|
|
527
|
+
return me(r, n, t);
|
|
528
528
|
}
|
|
529
|
-
function
|
|
529
|
+
function me(n, e, t) {
|
|
530
530
|
for (let r = n; r; r = r.next) {
|
|
531
531
|
let i = Xe(r.node);
|
|
532
532
|
if (i)
|
|
@@ -544,14 +544,14 @@ function Xe(n) {
|
|
|
544
544
|
let t = n.firstChild, r;
|
|
545
545
|
if (t && (r = t.type.prop(y.closedBy))) {
|
|
546
546
|
let i = n.lastChild, o = i && r.indexOf(i.name) > -1;
|
|
547
|
-
return (s) =>
|
|
547
|
+
return (s) => ge(s, !0, 1, void 0, o && !Qe(s) ? i.from : void 0);
|
|
548
548
|
}
|
|
549
549
|
return n.parent == null ? Ye : null;
|
|
550
550
|
}
|
|
551
551
|
function Ye() {
|
|
552
552
|
return 0;
|
|
553
553
|
}
|
|
554
|
-
class Z extends
|
|
554
|
+
class Z extends pe {
|
|
555
555
|
constructor(e, t, r) {
|
|
556
556
|
super(e.state, e.options), this.base = e, this.pos = t, this.context = r;
|
|
557
557
|
}
|
|
@@ -606,7 +606,7 @@ class Z extends de {
|
|
|
606
606
|
and return the result of that.
|
|
607
607
|
*/
|
|
608
608
|
continue() {
|
|
609
|
-
return
|
|
609
|
+
return me(this.context.next, this.base, this.pos);
|
|
610
610
|
}
|
|
611
611
|
}
|
|
612
612
|
function Ze(n, e) {
|
|
@@ -634,9 +634,9 @@ function _e(n) {
|
|
|
634
634
|
}
|
|
635
635
|
}
|
|
636
636
|
function Ft({ closing: n, align: e = !0, units: t = 1 }) {
|
|
637
|
-
return (r) =>
|
|
637
|
+
return (r) => ge(r, e, t, n);
|
|
638
638
|
}
|
|
639
|
-
function
|
|
639
|
+
function ge(n, e, t, r, i) {
|
|
640
640
|
let o = n.textAfter, s = o.match(/^\s*/)[0].length, a = r && o.slice(s, s + r.length) == r || i == n.pos + s, l = e ? _e(n) : null;
|
|
641
641
|
return l ? a ? n.column(l.from) : n.column(l.to) : n.baseIndent + (a ? 0 : n.unit * t);
|
|
642
642
|
}
|
|
@@ -712,12 +712,12 @@ function E(n, e, t) {
|
|
|
712
712
|
}
|
|
713
713
|
return rt(n, e, t);
|
|
714
714
|
}
|
|
715
|
-
function
|
|
715
|
+
function ke(n, e) {
|
|
716
716
|
let t = e.mapPos(n.from, 1), r = e.mapPos(n.to, -1);
|
|
717
717
|
return t >= r ? void 0 : { from: t, to: r };
|
|
718
718
|
}
|
|
719
|
-
const H = /* @__PURE__ */ L.define({ map:
|
|
720
|
-
function
|
|
719
|
+
const H = /* @__PURE__ */ L.define({ map: ke }), I = /* @__PURE__ */ L.define({ map: ke });
|
|
720
|
+
function be(n) {
|
|
721
721
|
let e = [];
|
|
722
722
|
for (let { head: t } of n.state.selection.ranges)
|
|
723
723
|
e.some((r) => r.from <= t && r.to >= t) || e.push(n.lineBlockAt(t));
|
|
@@ -728,17 +728,17 @@ const x = /* @__PURE__ */ X.define({
|
|
|
728
728
|
return p.none;
|
|
729
729
|
},
|
|
730
730
|
update(n, e) {
|
|
731
|
-
e.isUserEvent("delete") && e.changes.iterChangedRanges((t, r) => n =
|
|
731
|
+
e.isUserEvent("delete") && e.changes.iterChangedRanges((t, r) => n = ie(n, t, r)), n = n.map(e.changes);
|
|
732
732
|
for (let t of e.effects)
|
|
733
733
|
if (t.is(H) && !ot(n, t.value.from, t.value.to)) {
|
|
734
|
-
let { preparePlaceholder: r } = e.state.facet(
|
|
734
|
+
let { preparePlaceholder: r } = e.state.facet(ve), i = r ? p.replace({ widget: new ut(r(e.state, t.value)) }) : oe;
|
|
735
735
|
n = n.update({ add: [i.range(t.value.from, t.value.to)] });
|
|
736
736
|
} else t.is(I) && (n = n.update({
|
|
737
737
|
filter: (r, i) => t.value.from != r || t.value.to != i,
|
|
738
738
|
filterFrom: t.value.from,
|
|
739
739
|
filterTo: t.value.to
|
|
740
740
|
}));
|
|
741
|
-
return e.selection && (n =
|
|
741
|
+
return e.selection && (n = ie(n, e.selection.main.head)), n;
|
|
742
742
|
},
|
|
743
743
|
provide: (n) => b.decorations.from(n),
|
|
744
744
|
toJSON(n, e) {
|
|
@@ -755,12 +755,12 @@ const x = /* @__PURE__ */ X.define({
|
|
|
755
755
|
let r = n[t++], i = n[t++];
|
|
756
756
|
if (typeof r != "number" || typeof i != "number")
|
|
757
757
|
throw new RangeError("Invalid JSON for fold state");
|
|
758
|
-
e.push(
|
|
758
|
+
e.push(oe.range(r, i));
|
|
759
759
|
}
|
|
760
760
|
return p.set(e, !0);
|
|
761
761
|
}
|
|
762
762
|
});
|
|
763
|
-
function
|
|
763
|
+
function ie(n, e, t = e) {
|
|
764
764
|
let r = !1;
|
|
765
765
|
return n.between(e, t, (i, o) => {
|
|
766
766
|
i < t && o > e && (r = !0);
|
|
@@ -783,27 +783,27 @@ function ot(n, e, t) {
|
|
|
783
783
|
i == e && o == t && (r = !0);
|
|
784
784
|
}), r;
|
|
785
785
|
}
|
|
786
|
-
function
|
|
787
|
-
return n.field(x, !1) ? e : e.concat(L.appendConfig.of(
|
|
786
|
+
function ye(n, e) {
|
|
787
|
+
return n.field(x, !1) ? e : e.concat(L.appendConfig.of(xe()));
|
|
788
788
|
}
|
|
789
789
|
const st = (n) => {
|
|
790
|
-
for (let e of
|
|
790
|
+
for (let e of be(n)) {
|
|
791
791
|
let t = E(n.state, e.from, e.to);
|
|
792
792
|
if (t)
|
|
793
|
-
return n.dispatch({ effects:
|
|
793
|
+
return n.dispatch({ effects: ye(n.state, [H.of(t), we(n, t)]) }), !0;
|
|
794
794
|
}
|
|
795
795
|
return !1;
|
|
796
796
|
}, lt = (n) => {
|
|
797
797
|
if (!n.state.field(x, !1))
|
|
798
798
|
return !1;
|
|
799
799
|
let e = [];
|
|
800
|
-
for (let t of
|
|
800
|
+
for (let t of be(n)) {
|
|
801
801
|
let r = F(n.state, t.from, t.to);
|
|
802
|
-
r && e.push(I.of(r),
|
|
802
|
+
r && e.push(I.of(r), we(n, r, !1));
|
|
803
803
|
}
|
|
804
804
|
return e.length && n.dispatch({ effects: e }), e.length > 0;
|
|
805
805
|
};
|
|
806
|
-
function
|
|
806
|
+
function we(n, e, t = !0) {
|
|
807
807
|
let r = n.state.doc.lineAt(e.from).number, i = n.state.doc.lineAt(e.to).number;
|
|
808
808
|
return b.announce.of(`${n.state.phrase(t ? "Folded lines" : "Unfolded lines")} ${r} ${n.state.phrase("to")} ${i}.`);
|
|
809
809
|
}
|
|
@@ -813,7 +813,7 @@ const at = (n) => {
|
|
|
813
813
|
let i = n.lineBlockAt(r), o = E(e, i.from, i.to);
|
|
814
814
|
o && t.push(H.of(o)), r = (o ? n.lineBlockAt(o.to) : i).to + 1;
|
|
815
815
|
}
|
|
816
|
-
return t.length && n.dispatch({ effects:
|
|
816
|
+
return t.length && n.dispatch({ effects: ye(n.state, t) }), !!t.length;
|
|
817
817
|
}, ft = (n) => {
|
|
818
818
|
let e = n.state.field(x, !1);
|
|
819
819
|
if (!e || !e.size)
|
|
@@ -831,16 +831,16 @@ const at = (n) => {
|
|
|
831
831
|
placeholderDOM: null,
|
|
832
832
|
preparePlaceholder: null,
|
|
833
833
|
placeholderText: "…"
|
|
834
|
-
},
|
|
834
|
+
}, ve = /* @__PURE__ */ w.define({
|
|
835
835
|
combine(n) {
|
|
836
|
-
return
|
|
836
|
+
return ce(n, ct);
|
|
837
837
|
}
|
|
838
838
|
});
|
|
839
|
-
function
|
|
839
|
+
function xe(n) {
|
|
840
840
|
return [x, dt];
|
|
841
841
|
}
|
|
842
|
-
function
|
|
843
|
-
let { state: t } = n, r = t.facet(
|
|
842
|
+
function Se(n, e) {
|
|
843
|
+
let { state: t } = n, r = t.facet(ve), i = (s) => {
|
|
844
844
|
let a = n.lineBlockAt(n.posAtDOM(s.target)), l = F(n.state, a.from, a.to);
|
|
845
845
|
l && n.dispatch({ effects: I.of(l) }), s.preventDefault();
|
|
846
846
|
};
|
|
@@ -849,12 +849,12 @@ function xe(n, e) {
|
|
|
849
849
|
let o = document.createElement("span");
|
|
850
850
|
return o.textContent = r.placeholderText, o.setAttribute("aria-label", t.phrase("folded code")), o.title = t.phrase("unfold"), o.className = "cm-foldPlaceholder", o.onclick = i, o;
|
|
851
851
|
}
|
|
852
|
-
const
|
|
852
|
+
const oe = /* @__PURE__ */ p.replace({ widget: /* @__PURE__ */ new class extends ue {
|
|
853
853
|
toDOM(n) {
|
|
854
|
-
return
|
|
854
|
+
return Se(n, null);
|
|
855
855
|
}
|
|
856
856
|
}() });
|
|
857
|
-
class ut extends
|
|
857
|
+
class ut extends ue {
|
|
858
858
|
constructor(e) {
|
|
859
859
|
super(), this.value = e;
|
|
860
860
|
}
|
|
@@ -862,7 +862,7 @@ class ut extends ce {
|
|
|
862
862
|
return this.value == e.value;
|
|
863
863
|
}
|
|
864
864
|
toDOM(e) {
|
|
865
|
-
return
|
|
865
|
+
return Se(e, this.value);
|
|
866
866
|
}
|
|
867
867
|
}
|
|
868
868
|
const ht = {
|
|
@@ -895,7 +895,7 @@ function $t(n = {}) {
|
|
|
895
895
|
(s.docChanged || s.viewportChanged || s.startState.facet(v) != s.state.facet(v) || s.startState.field(x, !1) != s.state.field(x, !1) || k(s.startState) != k(s.state) || e.foldingChanged(s)) && (this.markers = this.buildMarkers(s.view));
|
|
896
896
|
}
|
|
897
897
|
buildMarkers(s) {
|
|
898
|
-
let a = new
|
|
898
|
+
let a = new fe();
|
|
899
899
|
for (let l of s.viewportLineBlocks) {
|
|
900
900
|
let f = F(s.state, l.from, l.to) ? r : E(s.state, l.from, l.to) ? t : null;
|
|
901
901
|
f && a.add(l.from, l.from, f);
|
|
@@ -927,7 +927,7 @@ function $t(n = {}) {
|
|
|
927
927
|
}
|
|
928
928
|
}
|
|
929
929
|
}),
|
|
930
|
-
|
|
930
|
+
xe()
|
|
931
931
|
];
|
|
932
932
|
}
|
|
933
933
|
const dt = /* @__PURE__ */ b.baseTheme({
|
|
@@ -950,7 +950,7 @@ class W {
|
|
|
950
950
|
this.specs = e;
|
|
951
951
|
let r;
|
|
952
952
|
function i(a) {
|
|
953
|
-
let l =
|
|
953
|
+
let l = te.newName();
|
|
954
954
|
return (r || (r = /* @__PURE__ */ Object.create(null)))["." + l] = a, l;
|
|
955
955
|
}
|
|
956
956
|
const o = typeof t.all == "string" ? t.all : t.all ? i(t.all) : void 0, s = t.scope;
|
|
@@ -959,7 +959,7 @@ class W {
|
|
|
959
959
|
class: a.class || i(Object.assign({}, a, { tag: null }))
|
|
960
960
|
})), {
|
|
961
961
|
all: o
|
|
962
|
-
}).style, this.module = r ? new
|
|
962
|
+
}).style, this.module = r ? new te(r) : null, this.themeType = t.themeType;
|
|
963
963
|
}
|
|
964
964
|
/**
|
|
965
965
|
Create a highlighter style that associates the given styles to
|
|
@@ -980,18 +980,18 @@ class W {
|
|
|
980
980
|
return new W(e, t || {});
|
|
981
981
|
}
|
|
982
982
|
}
|
|
983
|
-
const J = /* @__PURE__ */ w.define(),
|
|
983
|
+
const J = /* @__PURE__ */ w.define(), Te = /* @__PURE__ */ w.define({
|
|
984
984
|
combine(n) {
|
|
985
985
|
return n.length ? [n[0]] : null;
|
|
986
986
|
}
|
|
987
987
|
});
|
|
988
988
|
function j(n) {
|
|
989
989
|
let e = n.facet(J);
|
|
990
|
-
return e.length ? e : n.facet(
|
|
990
|
+
return e.length ? e : n.facet(Te);
|
|
991
991
|
}
|
|
992
992
|
function qt(n, e) {
|
|
993
993
|
let t = [mt], r;
|
|
994
|
-
return n instanceof W && (n.module && t.push(b.styleModule.of(n.module)), r = n.themeType), e?.fallback ? t.push(
|
|
994
|
+
return n instanceof W && (n.module && t.push(b.styleModule.of(n.module)), r = n.themeType), e?.fallback ? t.push(Te.of(n)) : r ? t.push(J.computeN([b.darkTheme], (i) => i.facet(b.darkTheme) == (r == "dark") ? [n] : [])) : t.push(J.of(n)), t;
|
|
995
995
|
}
|
|
996
996
|
class pt {
|
|
997
997
|
constructor(e) {
|
|
@@ -1004,7 +1004,7 @@ class pt {
|
|
|
1004
1004
|
buildDeco(e, t) {
|
|
1005
1005
|
if (!t || !this.tree.length)
|
|
1006
1006
|
return p.none;
|
|
1007
|
-
let r = new
|
|
1007
|
+
let r = new fe();
|
|
1008
1008
|
for (let { from: i, to: o } of e.visibleRanges)
|
|
1009
1009
|
He(this.tree, t, (s, a, l) => {
|
|
1010
1010
|
r.add(s, a, this.markCache[l] || (this.markCache[l] = p.mark({ class: l })));
|
|
@@ -1095,12 +1095,12 @@ const mt = /* @__PURE__ */ Ie.high(/* @__PURE__ */ Y.fromClass(pt, {
|
|
|
1095
1095
|
]), gt = /* @__PURE__ */ b.baseTheme({
|
|
1096
1096
|
"&.cm-focused .cm-matchingBracket": { backgroundColor: "#328c8252" },
|
|
1097
1097
|
"&.cm-focused .cm-nonmatchingBracket": { backgroundColor: "#bb555544" }
|
|
1098
|
-
}),
|
|
1098
|
+
}), Ce = 1e4, Ae = "()[]{}", Pe = /* @__PURE__ */ w.define({
|
|
1099
1099
|
combine(n) {
|
|
1100
|
-
return
|
|
1100
|
+
return ce(n, {
|
|
1101
1101
|
afterCursor: !0,
|
|
1102
|
-
brackets:
|
|
1103
|
-
maxScanDistance:
|
|
1102
|
+
brackets: Ae,
|
|
1103
|
+
maxScanDistance: Ce,
|
|
1104
1104
|
renderMatch: yt
|
|
1105
1105
|
});
|
|
1106
1106
|
}
|
|
@@ -1116,7 +1116,7 @@ const wt = /* @__PURE__ */ X.define({
|
|
|
1116
1116
|
update(n, e) {
|
|
1117
1117
|
if (!e.docChanged && !e.selection)
|
|
1118
1118
|
return n;
|
|
1119
|
-
let t = [], r = e.state.facet(
|
|
1119
|
+
let t = [], r = e.state.facet(Pe);
|
|
1120
1120
|
for (let i of e.state.selection.ranges) {
|
|
1121
1121
|
if (!i.empty)
|
|
1122
1122
|
continue;
|
|
@@ -1131,7 +1131,7 @@ const wt = /* @__PURE__ */ X.define({
|
|
|
1131
1131
|
gt
|
|
1132
1132
|
];
|
|
1133
1133
|
function zt(n = {}) {
|
|
1134
|
-
return [
|
|
1134
|
+
return [Pe.of(n), vt];
|
|
1135
1135
|
}
|
|
1136
1136
|
const xt = /* @__PURE__ */ new y();
|
|
1137
1137
|
function V(n, e, t) {
|
|
@@ -1150,7 +1150,7 @@ function K(n) {
|
|
|
1150
1150
|
return e ? e(n.node) : n;
|
|
1151
1151
|
}
|
|
1152
1152
|
function O(n, e, t, r = {}) {
|
|
1153
|
-
let i = r.maxScanDistance ||
|
|
1153
|
+
let i = r.maxScanDistance || Ce, o = r.brackets || Ae, s = k(n), a = s.resolveInner(e, t);
|
|
1154
1154
|
for (let l = a; l; l = l.parent) {
|
|
1155
1155
|
let f = V(l.type, t, o);
|
|
1156
1156
|
if (f && l.from < l.to) {
|
|
@@ -1195,7 +1195,7 @@ function Tt(n, e, t, r, i, o, s) {
|
|
|
1195
1195
|
let d = c.value;
|
|
1196
1196
|
t < 0 && (m += d.length);
|
|
1197
1197
|
let S = e + m * t;
|
|
1198
|
-
for (let T = t > 0 ? 0 : d.length - 1,
|
|
1198
|
+
for (let T = t > 0 ? 0 : d.length - 1, De = t > 0 ? d.length : -1; T != De; T += t) {
|
|
1199
1199
|
let R = s.indexOf(d[T]);
|
|
1200
1200
|
if (!(R < 0 || r.resolveInner(S + T, 1).type != i))
|
|
1201
1201
|
if (R % 2 == 0 == t > 0)
|
|
@@ -1210,7 +1210,7 @@ function Tt(n, e, t, r, i, o, s) {
|
|
|
1210
1210
|
}
|
|
1211
1211
|
return c.done ? { start: f, matched: !1 } : null;
|
|
1212
1212
|
}
|
|
1213
|
-
const Ct = /* @__PURE__ */ Object.create(null),
|
|
1213
|
+
const Ct = /* @__PURE__ */ Object.create(null), se = [Q.none], le = [], ae = /* @__PURE__ */ Object.create(null), At = /* @__PURE__ */ Object.create(null);
|
|
1214
1214
|
for (let [n, e] of [
|
|
1215
1215
|
["variable", "variableName"],
|
|
1216
1216
|
["variable-2", "variableName.special"],
|
|
@@ -1227,7 +1227,7 @@ for (let [n, e] of [
|
|
|
1227
1227
|
])
|
|
1228
1228
|
At[n] = /* @__PURE__ */ Pt(Ct, e);
|
|
1229
1229
|
function z(n, e) {
|
|
1230
|
-
|
|
1230
|
+
le.indexOf(n) > -1 || (le.push(n), console.warn(e));
|
|
1231
1231
|
}
|
|
1232
1232
|
function Pt(n, e) {
|
|
1233
1233
|
let t = [];
|
|
@@ -1242,21 +1242,21 @@ function Pt(n, e) {
|
|
|
1242
1242
|
}
|
|
1243
1243
|
if (!t.length)
|
|
1244
1244
|
return 0;
|
|
1245
|
-
let r = e.replace(/ /g, "_"), i = r + " " + t.map((a) => a.id), o =
|
|
1245
|
+
let r = e.replace(/ /g, "_"), i = r + " " + t.map((a) => a.id), o = ae[i];
|
|
1246
1246
|
if (o)
|
|
1247
1247
|
return o.id;
|
|
1248
|
-
let s =
|
|
1249
|
-
id:
|
|
1248
|
+
let s = ae[i] = Q.define({
|
|
1249
|
+
id: se.length,
|
|
1250
1250
|
name: r,
|
|
1251
1251
|
props: [We({ [r]: t })]
|
|
1252
1252
|
});
|
|
1253
|
-
return
|
|
1253
|
+
return se.push(s), s.id;
|
|
1254
1254
|
}
|
|
1255
|
-
|
|
1255
|
+
ee.RTL, ee.LTR;
|
|
1256
1256
|
export {
|
|
1257
1257
|
$e as DocInput,
|
|
1258
1258
|
W as HighlightStyle,
|
|
1259
|
-
|
|
1259
|
+
pe as IndentContext,
|
|
1260
1260
|
G as LRLanguage,
|
|
1261
1261
|
g as Language,
|
|
1262
1262
|
Et as LanguageSupport,
|
|
@@ -1264,7 +1264,7 @@ export {
|
|
|
1264
1264
|
Z as TreeIndentContext,
|
|
1265
1265
|
zt as bracketMatching,
|
|
1266
1266
|
xt as bracketMatchingHandle,
|
|
1267
|
-
|
|
1267
|
+
xe as codeFolding,
|
|
1268
1268
|
Ht as continuedIndent,
|
|
1269
1269
|
jt as defaultHighlightStyle,
|
|
1270
1270
|
Re as defineLanguageFacet,
|
|
@@ -1286,7 +1286,7 @@ export {
|
|
|
1286
1286
|
Wt as indentOnInput,
|
|
1287
1287
|
je as indentService,
|
|
1288
1288
|
Ge as indentString,
|
|
1289
|
-
|
|
1289
|
+
de as indentUnit,
|
|
1290
1290
|
v as language,
|
|
1291
1291
|
A as languageDataProp,
|
|
1292
1292
|
O as matchBrackets,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { ViewPlugin as ie, EditorView as D,
|
|
2
|
-
import {
|
|
1
|
+
import { ViewPlugin as ie, EditorView as D, Decoration as C, hoverTooltip as ne, showPanel as se, gutter as oe, showTooltip as le, getPanel as re, WidgetType as ae, GutterMarker as ce, logException as de } from "../../view/dist/index.js";
|
|
2
|
+
import { StateField as B, Facet as V, combineConfig as Y, RangeSet as _, RangeSetBuilder as fe, StateEffect as S } from "../../state/dist/index.js";
|
|
3
3
|
import x from "../../../crelt/index.js";
|
|
4
4
|
class $ {
|
|
5
5
|
constructor(e, n, i) {
|
|
@@ -122,7 +122,7 @@ const F = /* @__PURE__ */ S.define(), E = /* @__PURE__ */ S.define(), Z = /* @__
|
|
|
122
122
|
return t;
|
|
123
123
|
},
|
|
124
124
|
provide: (t) => [
|
|
125
|
-
|
|
125
|
+
se.from(t, (e) => e.panel),
|
|
126
126
|
D.decorations.from(t, (e) => e.diagnostics)
|
|
127
127
|
]
|
|
128
128
|
}), me = /* @__PURE__ */ C.mark({ class: "cm-lintRange cm-lintRange-active" });
|
|
@@ -148,7 +148,7 @@ function K(t, e) {
|
|
|
148
148
|
const ge = (t) => {
|
|
149
149
|
let e = t.state.field(w, !1);
|
|
150
150
|
(!e || !e.panel) && t.dispatch({ effects: W(t.state, [E.of(!0)]) });
|
|
151
|
-
let n =
|
|
151
|
+
let n = re(t, P.open);
|
|
152
152
|
return n && n.dom.querySelector(".cm-panel-lint ul").focus(), !0;
|
|
153
153
|
}, j = (t) => {
|
|
154
154
|
let e = t.state.field(w, !1);
|
|
@@ -271,7 +271,7 @@ function X(t, e, n) {
|
|
|
271
271
|
}, b);
|
|
272
272
|
}), e.source && x("div", { class: "cm-diagnosticSource" }, e.source));
|
|
273
273
|
}
|
|
274
|
-
class ke extends
|
|
274
|
+
class ke extends ae {
|
|
275
275
|
constructor(e) {
|
|
276
276
|
super(), this.sev = e;
|
|
277
277
|
}
|
|
@@ -508,7 +508,7 @@ function J(t) {
|
|
|
508
508
|
}
|
|
509
509
|
return e;
|
|
510
510
|
}
|
|
511
|
-
class Q extends
|
|
511
|
+
class Q extends ce {
|
|
512
512
|
constructor(e) {
|
|
513
513
|
super(), this.diagnostics = e, this.severity = J(e);
|
|
514
514
|
}
|
|
@@ -564,7 +564,7 @@ function Te(t, e) {
|
|
|
564
564
|
i.push(new Q(n[s]).range(+s));
|
|
565
565
|
return _.of(i, !0);
|
|
566
566
|
}
|
|
567
|
-
const Pe = /* @__PURE__ */
|
|
567
|
+
const Pe = /* @__PURE__ */ oe({
|
|
568
568
|
class: "cm-gutter-lint",
|
|
569
569
|
markers: (t) => t.state.field(A),
|
|
570
570
|
widgetMarker: (t, e, n) => {
|