@marimo-team/islands 0.19.10-dev9 → 0.19.11-dev0
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/Plot-C9vQQj4X.js +172249 -0
- package/dist/{any-language-editor-CKEbZakX.js → any-language-editor-t_VsTNa-.js} +16 -16
- package/dist/dist-4YNZxwMI.js +8 -0
- package/dist/dist-7nR3r2kG.js +5 -0
- package/dist/{dist-CBA36Nuy.js → dist-B2-r9y-0.js} +109 -109
- package/dist/dist-B2gkyT3r.js +5 -0
- package/dist/{dist-DRtGOCCq.js → dist-B4tYJP_i.js} +2 -2
- package/dist/{dist-C0e1aNzV.js → dist-B5ATpkxy.js} +2 -2
- package/dist/dist-B8G3I6vJ.js +8 -0
- package/dist/{dist-DKnxaCRl.js → dist-B94MxrQS.js} +2 -2
- package/dist/dist-BJ96Ykfp.js +8 -0
- package/dist/dist-BKLIWGw4.js +5 -0
- package/dist/{dist-l0KayR2-.js → dist-BLwfpZD-.js} +2 -2
- package/dist/{dist-CzKXtzDE.js → dist-BYmtF1W6.js} +2 -2
- package/dist/{dist-BJUs1DAG.js → dist-BbBnU4tG.js} +1 -1
- package/dist/dist-Bf3ou00A.js +6 -0
- package/dist/{dist-CITQGRtG.js → dist-BfactX3G.js} +4 -4
- package/dist/{dist-DiCjkKC2.js → dist-BoAHOW2l.js} +2 -2
- package/dist/{dist-BsBHh4jO.js → dist-Bsv_ARko.js} +4 -4
- package/dist/dist-BvkKXuPm.js +5 -0
- package/dist/{dist-DsqQCNKw.js → dist-C2-m5aEk.js} +119 -119
- package/dist/dist-C6NJ3n6r.js +5 -0
- package/dist/{dist-yI-ah_iK.js → dist-CC9VUnXd.js} +1 -1
- package/dist/{dist-tdABwZK5.js → dist-CE43BRmt.js} +1 -1
- package/dist/{dist-COp5dkis.js → dist-CJrHMxlI.js} +31 -31
- package/dist/{dist-Ct5hkOvC.js → dist-CPTE45iS.js} +1 -1
- package/dist/{dist-C-at-5cM.js → dist-CcOGT46m.js} +27 -27
- package/dist/dist-CecLPYY5.js +5 -0
- package/dist/{dist-BSMZYwqW.js → dist-Cgf353Ki.js} +1 -1
- package/dist/dist-Ch0SwRzK.js +5 -0
- package/dist/{dist-BqYNqP5W.js → dist-CkEUrAus.js} +2 -2
- package/dist/{dist-D4ObdSdT.js → dist-CmZYrgd_.js} +1 -1
- package/dist/{dist-D1q38GZb.js → dist-Crk9ejOy.js} +4 -4
- package/dist/dist-D6eWHiFh.js +6 -0
- package/dist/dist-DCQ710Bv.js +5 -0
- package/dist/{dist-r6N_0WG-.js → dist-DOil6y-3.js} +4 -4
- package/dist/{dist-CPd_adhw.js → dist-Dc1SFk5I.js} +2 -2
- package/dist/dist-Dit9tk8a.js +1242 -0
- package/dist/{dist-B7NoEgR4.js → dist-DqJdzAYM.js} +2 -2
- package/dist/dist-P_pkS5f-.js +8 -0
- package/dist/{dist-CsjsvW0K.js → dist-T4g7Sr6e.js} +3 -3
- package/dist/{dist-WETuLs_C.js → dist-glA_fIK_.js} +2 -2
- package/dist/{dist-bRBEzJF8.js → dist-iiugPhCC.js} +1 -1
- package/dist/{dist-D7jHtwN8.js → dist-r8ecBV-v.js} +135 -65
- package/dist/{dist-BlRm4v0e.js → dist-yVJ4xE5n.js} +5 -5
- package/dist/{esm-QY6C-Sev.js → esm-BAS2d2Ad.js} +1421 -1454
- package/dist/main.js +421 -383
- package/package.json +11 -11
- package/src/components/data-table/TableActions.tsx +8 -1
- package/src/components/data-table/data-table.tsx +2 -0
- package/src/components/data-table/download-actions.tsx +6 -1
- package/src/components/dependency-graph/dependency-graph-tree.tsx +10 -1
- package/src/components/dependency-graph/dependency-graph.tsx +1 -0
- package/src/components/dependency-graph/elements.ts +20 -9
- package/src/components/dependency-graph/panels.tsx +27 -11
- package/src/components/dependency-graph/types.ts +1 -0
- package/src/components/editor/chrome/wrapper/app-chrome.tsx +3 -0
- package/src/components/editor/package-alert.tsx +4 -4
- package/src/components/editor/renderers/vertical-layout/vertical-layout.tsx +3 -5
- package/src/core/codemirror/misc/__tests__/paste.test.ts +18 -0
- package/src/core/codemirror/misc/paste.ts +14 -10
- package/src/core/kernel/messages.ts +1 -0
- package/src/core/static/static-state.ts +5 -0
- package/src/core/static/types.ts +2 -0
- package/src/core/wasm/__tests__/store.test.ts +33 -0
- package/src/core/wasm/bridge.ts +2 -1
- package/src/core/wasm/store.ts +13 -1
- package/src/mount.tsx +23 -1
- package/src/plugins/impl/DataTablePlugin.tsx +4 -0
- package/src/plugins/impl/anywidget/AnyWidgetPlugin.tsx +7 -5
- package/src/plugins/impl/anywidget/__tests__/model.test.ts +53 -0
- package/src/plugins/impl/anywidget/model.ts +13 -10
- package/src/plugins/impl/chat/ChatPlugin.tsx +2 -0
- package/src/plugins/impl/chat/chat-ui.tsx +10 -1
- package/src/plugins/impl/data-frames/DataFramePlugin.tsx +4 -0
- package/src/plugins/impl/plotly/Plot.tsx +2 -0
- package/src/plugins/impl/plotly/PlotlyPlugin.tsx +36 -0
- package/src/theme/ThemeProvider.tsx +2 -0
- package/dist/Plot-CmsrWWji.js +0 -169233
- package/dist/dist-BKTAAusE.js +0 -5
- package/dist/dist-BNXv9Wjt.js +0 -6
- package/dist/dist-C-tlm9eD.js +0 -6
- package/dist/dist-CFi_P6cs.js +0 -5
- package/dist/dist-CgQuqOGS.js +0 -5
- package/dist/dist-CgkWmw0c.js +0 -5
- package/dist/dist-DGkeEIsV.js +0 -8
- package/dist/dist-DOwZz8aI.js +0 -5
- package/dist/dist-DRiJGkDN.js +0 -8
- package/dist/dist-GR6ABeNk.js +0 -8
- package/dist/dist-NcujbSeH.js +0 -8
- package/dist/dist-g1p2PEVs.js +0 -1242
- package/dist/dist-pNvwCQqJ.js +0 -5
- package/dist/dist-wudNDAiO.js +0 -5
- package/dist/dist-yK8yJfz2.js +0 -5
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { B as tags, G as NodeWeakMap, I as syntaxTree, O as indentNodeProp, P as sublanguageProp, S as foldInside,
|
|
2
|
-
import { f as snippetCompletion, l as ifNotIn, s as completeFromList } from "./dist-
|
|
1
|
+
import { B as tags, Et as EditorSelection, G as NodeWeakMap, I as syntaxTree, O as indentNodeProp, P as sublanguageProp, S as foldInside, V as IterMode, Z as EditorView, _ as defineLanguageFacet, h as continuedIndent, i as LocalTokenGroup, n as ExternalTokenizer, r as LRParser, s as LRLanguage, t as ContextTracker, u as LanguageSupport, v as delimitedIndent, w as foldNodeProp, y as flatIndent, z as styleTags } from "./dist-r8ecBV-v.js";
|
|
2
|
+
import { f as snippetCompletion, l as ifNotIn, s as completeFromList } from "./dist-Dit9tk8a.js";
|
|
3
3
|
var noSemi = 315, noSemiType = 316, incdec = 1, incdecPrefix = 2, questionDot = 3, JSXStartTag = 4, insertSemi = 317, spaces = 319, newline = 320, LineComment = 5, BlockComment = 6, Dialect_jsx = 0, space = [
|
|
4
4
|
9,
|
|
5
5
|
10,
|
|
@@ -28,52 +28,52 @@ var noSemi = 315, noSemiType = 316, incdec = 1, incdecPrefix = 2, questionDot =
|
|
|
28
28
|
12288
|
|
29
29
|
], braceR = 125, semicolon = 59, slash = 47, star = 42, plus = 43, minus = 45, lt = 60, comma = 44, question = 63, dot = 46, bracketL = 91, trackNewline = new ContextTracker({
|
|
30
30
|
start: false,
|
|
31
|
-
shift(
|
|
32
|
-
return
|
|
31
|
+
shift(g, G) {
|
|
32
|
+
return G == LineComment || G == BlockComment || G == spaces ? g : G == newline;
|
|
33
33
|
},
|
|
34
34
|
strict: false
|
|
35
|
-
}), insertSemicolon = new ExternalTokenizer((
|
|
36
|
-
let { next:
|
|
37
|
-
(
|
|
35
|
+
}), insertSemicolon = new ExternalTokenizer((g, G) => {
|
|
36
|
+
let { next: K } = g;
|
|
37
|
+
(K == braceR || K == -1 || G.context) && g.acceptToken(insertSemi);
|
|
38
38
|
}, {
|
|
39
39
|
contextual: true,
|
|
40
40
|
fallback: true
|
|
41
|
-
}), noSemicolon = new ExternalTokenizer((
|
|
42
|
-
let { next:
|
|
43
|
-
space.indexOf(
|
|
44
|
-
}, { contextual: true }), noSemicolonType = new ExternalTokenizer((
|
|
45
|
-
|
|
46
|
-
}, { contextual: true }), operatorToken = new ExternalTokenizer((
|
|
47
|
-
let { next:
|
|
48
|
-
if (
|
|
49
|
-
if (
|
|
50
|
-
|
|
51
|
-
let
|
|
52
|
-
|
|
41
|
+
}), noSemicolon = new ExternalTokenizer((g, G) => {
|
|
42
|
+
let { next: K } = g, q;
|
|
43
|
+
space.indexOf(K) > -1 || K == slash && ((q = g.peek(1)) == slash || q == star) || K != braceR && K != semicolon && K != -1 && !G.context && g.acceptToken(noSemi);
|
|
44
|
+
}, { contextual: true }), noSemicolonType = new ExternalTokenizer((g, G) => {
|
|
45
|
+
g.next == bracketL && !G.context && g.acceptToken(noSemiType);
|
|
46
|
+
}, { contextual: true }), operatorToken = new ExternalTokenizer((g, G) => {
|
|
47
|
+
let { next: K } = g;
|
|
48
|
+
if (K == plus || K == minus) {
|
|
49
|
+
if (g.advance(), K == g.next) {
|
|
50
|
+
g.advance();
|
|
51
|
+
let K2 = !G.context && G.canShift(incdec);
|
|
52
|
+
g.acceptToken(K2 ? incdec : incdecPrefix);
|
|
53
53
|
}
|
|
54
|
-
} else
|
|
54
|
+
} else K == question && g.peek(1) == dot && (g.advance(), g.advance(), (g.next < 48 || g.next > 57) && g.acceptToken(questionDot));
|
|
55
55
|
}, { contextual: true });
|
|
56
|
-
function identifierChar(
|
|
57
|
-
return
|
|
56
|
+
function identifierChar(g, G) {
|
|
57
|
+
return g >= 65 && g <= 90 || g >= 97 && g <= 122 || g == 95 || g >= 192 || !G && g >= 48 && g <= 57;
|
|
58
58
|
}
|
|
59
|
-
var jsx = new ExternalTokenizer((
|
|
60
|
-
if (
|
|
61
|
-
let
|
|
62
|
-
for (; space.indexOf(
|
|
63
|
-
if (identifierChar(
|
|
64
|
-
for (
|
|
65
|
-
for (; space.indexOf(
|
|
66
|
-
if (
|
|
67
|
-
for (let
|
|
68
|
-
if (
|
|
69
|
-
if (!identifierChar(
|
|
59
|
+
var jsx = new ExternalTokenizer((g, G) => {
|
|
60
|
+
if (g.next != lt || !G.dialectEnabled(Dialect_jsx) || (g.advance(), g.next == slash)) return;
|
|
61
|
+
let K = 0;
|
|
62
|
+
for (; space.indexOf(g.next) > -1; ) g.advance(), K++;
|
|
63
|
+
if (identifierChar(g.next, true)) {
|
|
64
|
+
for (g.advance(), K++; identifierChar(g.next, false); ) g.advance(), K++;
|
|
65
|
+
for (; space.indexOf(g.next) > -1; ) g.advance(), K++;
|
|
66
|
+
if (g.next == comma) return;
|
|
67
|
+
for (let G2 = 0; ; G2++) {
|
|
68
|
+
if (G2 == 7) {
|
|
69
|
+
if (!identifierChar(g.next, true)) return;
|
|
70
70
|
break;
|
|
71
71
|
}
|
|
72
|
-
if (
|
|
73
|
-
|
|
72
|
+
if (g.next != "extends".charCodeAt(G2)) break;
|
|
73
|
+
g.advance(), K++;
|
|
74
74
|
}
|
|
75
75
|
}
|
|
76
|
-
|
|
76
|
+
g.acceptToken(JSXStartTag, -K);
|
|
77
77
|
}), jsHighlight = styleTags({
|
|
78
78
|
"get set async static": tags.modifier,
|
|
79
79
|
"for while do if else switch try catch finally return throw break continue default case": tags.controlKeyword,
|
|
@@ -416,15 +416,15 @@ var jsx = new ExternalTokenizer((_, K) => {
|
|
|
416
416
|
specialized: [
|
|
417
417
|
{
|
|
418
418
|
term: 326,
|
|
419
|
-
get: (
|
|
419
|
+
get: (g) => spec_identifier[g] || -1
|
|
420
420
|
},
|
|
421
421
|
{
|
|
422
422
|
term: 342,
|
|
423
|
-
get: (
|
|
423
|
+
get: (g) => spec_word[g] || -1
|
|
424
424
|
},
|
|
425
425
|
{
|
|
426
426
|
term: 95,
|
|
427
|
-
get: (
|
|
427
|
+
get: (g) => spec_LessThan[g] || -1
|
|
428
428
|
}
|
|
429
429
|
],
|
|
430
430
|
tokenPrec: 15124
|
|
@@ -509,10 +509,10 @@ var jsx = new ExternalTokenizer((_, K) => {
|
|
|
509
509
|
"MethodDeclaration",
|
|
510
510
|
"ForStatement"
|
|
511
511
|
]);
|
|
512
|
-
function defID(
|
|
513
|
-
return (
|
|
514
|
-
let
|
|
515
|
-
return
|
|
512
|
+
function defID(g) {
|
|
513
|
+
return (G, K) => {
|
|
514
|
+
let q = G.node.getChild("VariableDefinition");
|
|
515
|
+
return q && K(q, g), true;
|
|
516
516
|
};
|
|
517
517
|
}
|
|
518
518
|
var functionContext = ["FunctionDeclaration"], gatherCompletions = {
|
|
@@ -522,35 +522,35 @@ var functionContext = ["FunctionDeclaration"], gatherCompletions = {
|
|
|
522
522
|
EnumDeclaration: /* @__PURE__ */ defID("constant"),
|
|
523
523
|
TypeAliasDeclaration: /* @__PURE__ */ defID("type"),
|
|
524
524
|
NamespaceDeclaration: /* @__PURE__ */ defID("namespace"),
|
|
525
|
-
VariableDefinition(
|
|
526
|
-
|
|
525
|
+
VariableDefinition(g, G) {
|
|
526
|
+
g.matchContext(functionContext) || G(g, "variable");
|
|
527
527
|
},
|
|
528
|
-
TypeDefinition(
|
|
529
|
-
|
|
528
|
+
TypeDefinition(g, G) {
|
|
529
|
+
G(g, "type");
|
|
530
530
|
},
|
|
531
531
|
__proto__: null
|
|
532
532
|
};
|
|
533
|
-
function getScope(
|
|
534
|
-
let
|
|
535
|
-
if (
|
|
536
|
-
let
|
|
537
|
-
function
|
|
538
|
-
let
|
|
539
|
-
|
|
540
|
-
label:
|
|
541
|
-
type:
|
|
533
|
+
function getScope(g, G) {
|
|
534
|
+
let K = cache.get(G);
|
|
535
|
+
if (K) return K;
|
|
536
|
+
let q = [], J = true;
|
|
537
|
+
function Y(G2, K2) {
|
|
538
|
+
let J2 = g.sliceString(G2.from, G2.to);
|
|
539
|
+
q.push({
|
|
540
|
+
label: J2,
|
|
541
|
+
type: K2
|
|
542
542
|
});
|
|
543
543
|
}
|
|
544
|
-
return
|
|
545
|
-
if (
|
|
546
|
-
else if (
|
|
547
|
-
let
|
|
548
|
-
if (
|
|
549
|
-
} else if (
|
|
550
|
-
for (let
|
|
544
|
+
return G.cursor(IterMode.IncludeAnonymous).iterate((G2) => {
|
|
545
|
+
if (J) J = false;
|
|
546
|
+
else if (G2.name) {
|
|
547
|
+
let g2 = gatherCompletions[G2.name];
|
|
548
|
+
if (g2 && g2(G2, Y) || ScopeNodes.has(G2.name)) return false;
|
|
549
|
+
} else if (G2.to - G2.from > 8192) {
|
|
550
|
+
for (let K2 of getScope(g, G2.node)) q.push(K2);
|
|
551
551
|
return false;
|
|
552
552
|
}
|
|
553
|
-
}), cache.set(
|
|
553
|
+
}), cache.set(G, q), q;
|
|
554
554
|
}
|
|
555
555
|
var Identifier = /^[\w$\xa1-\uffff][\w$\d\xa1-\uffff]*$/, dontComplete = [
|
|
556
556
|
"TemplateString",
|
|
@@ -573,16 +573,16 @@ var Identifier = /^[\w$\xa1-\uffff][\w$\d\xa1-\uffff]*$/, dontComplete = [
|
|
|
573
573
|
".",
|
|
574
574
|
"?."
|
|
575
575
|
];
|
|
576
|
-
function localCompletionSource(
|
|
577
|
-
let
|
|
578
|
-
if (dontComplete.indexOf(
|
|
579
|
-
let
|
|
580
|
-
if (!
|
|
581
|
-
let
|
|
582
|
-
for (let
|
|
576
|
+
function localCompletionSource(g) {
|
|
577
|
+
let G = syntaxTree(g.state).resolveInner(g.pos, -1);
|
|
578
|
+
if (dontComplete.indexOf(G.name) > -1) return null;
|
|
579
|
+
let K = G.name == "VariableName" || G.to - G.from < 20 && Identifier.test(g.state.sliceDoc(G.from, G.to));
|
|
580
|
+
if (!K && !g.explicit) return null;
|
|
581
|
+
let J = [];
|
|
582
|
+
for (let K2 = G; K2; K2 = K2.parent) ScopeNodes.has(K2.name) && (J = J.concat(getScope(g.state.doc, K2)));
|
|
583
583
|
return {
|
|
584
|
-
options:
|
|
585
|
-
from:
|
|
584
|
+
options: J,
|
|
585
|
+
from: K ? G.from : g.pos,
|
|
586
586
|
validFor: Identifier
|
|
587
587
|
};
|
|
588
588
|
}
|
|
@@ -592,31 +592,31 @@ var javascriptLanguage = /* @__PURE__ */ LRLanguage.define({
|
|
|
592
592
|
IfStatement: /* @__PURE__ */ continuedIndent({ except: /^\s*({|else\b)/ }),
|
|
593
593
|
TryStatement: /* @__PURE__ */ continuedIndent({ except: /^\s*({|catch\b|finally\b)/ }),
|
|
594
594
|
LabeledStatement: flatIndent,
|
|
595
|
-
SwitchBody: (
|
|
596
|
-
let
|
|
597
|
-
return
|
|
595
|
+
SwitchBody: (g) => {
|
|
596
|
+
let G = g.textAfter, K = /^\s*\}/.test(G), q = /^\s*(case|default)\b/.test(G);
|
|
597
|
+
return g.baseIndent + (K ? 0 : q ? 1 : 2) * g.unit;
|
|
598
598
|
},
|
|
599
599
|
Block: /* @__PURE__ */ delimitedIndent({ closing: "}" }),
|
|
600
|
-
ArrowFunction: (
|
|
600
|
+
ArrowFunction: (g) => g.baseIndent + g.unit,
|
|
601
601
|
"TemplateString BlockComment": () => null,
|
|
602
602
|
"Statement Property": /* @__PURE__ */ continuedIndent({ except: /^\s*{/ }),
|
|
603
|
-
JSXElement(
|
|
604
|
-
let
|
|
605
|
-
return
|
|
603
|
+
JSXElement(g) {
|
|
604
|
+
let G = /^\s*<\//.test(g.textAfter);
|
|
605
|
+
return g.lineIndent(g.node.from) + (G ? 0 : g.unit);
|
|
606
606
|
},
|
|
607
|
-
JSXEscape(
|
|
608
|
-
let
|
|
609
|
-
return
|
|
607
|
+
JSXEscape(g) {
|
|
608
|
+
let G = /\s*\}/.test(g.textAfter);
|
|
609
|
+
return g.lineIndent(g.node.from) + (G ? 0 : g.unit);
|
|
610
610
|
},
|
|
611
|
-
"JSXOpenTag JSXSelfClosingTag"(
|
|
612
|
-
return
|
|
611
|
+
"JSXOpenTag JSXSelfClosingTag"(g) {
|
|
612
|
+
return g.column(g.node.from) + g.unit;
|
|
613
613
|
}
|
|
614
614
|
}), /* @__PURE__ */ foldNodeProp.add({
|
|
615
615
|
"Block ClassBody SwitchBody EnumBody ObjectExpression ArrayExpression ObjectType": foldInside,
|
|
616
|
-
BlockComment(
|
|
616
|
+
BlockComment(g) {
|
|
617
617
|
return {
|
|
618
|
-
from:
|
|
619
|
-
to:
|
|
618
|
+
from: g.from + 2,
|
|
619
|
+
to: g.to - 2
|
|
620
620
|
};
|
|
621
621
|
}
|
|
622
622
|
})] }),
|
|
@@ -640,19 +640,19 @@ var javascriptLanguage = /* @__PURE__ */ LRLanguage.define({
|
|
|
640
640
|
wordChars: "$"
|
|
641
641
|
}
|
|
642
642
|
}), jsxSublanguage = {
|
|
643
|
-
test: (
|
|
643
|
+
test: (g) => /^JSX/.test(g.name),
|
|
644
644
|
facet: /* @__PURE__ */ defineLanguageFacet({ commentTokens: { block: {
|
|
645
645
|
open: "{/*",
|
|
646
646
|
close: "*/}"
|
|
647
647
|
} } })
|
|
648
648
|
}, typescriptLanguage = /* @__PURE__ */ javascriptLanguage.configure({ dialect: "ts" }, "typescript"), jsxLanguage = /* @__PURE__ */ javascriptLanguage.configure({
|
|
649
649
|
dialect: "jsx",
|
|
650
|
-
props: [/* @__PURE__ */ sublanguageProp.add((
|
|
650
|
+
props: [/* @__PURE__ */ sublanguageProp.add((g) => g.isTop ? [jsxSublanguage] : void 0)]
|
|
651
651
|
}), tsxLanguage = /* @__PURE__ */ javascriptLanguage.configure({
|
|
652
652
|
dialect: "jsx ts",
|
|
653
|
-
props: [/* @__PURE__ */ sublanguageProp.add((
|
|
654
|
-
}, "typescript"), kwCompletion = (
|
|
655
|
-
label:
|
|
653
|
+
props: [/* @__PURE__ */ sublanguageProp.add((g) => g.isTop ? [jsxSublanguage] : void 0)]
|
|
654
|
+
}, "typescript"), kwCompletion = (g) => ({
|
|
655
|
+
label: g,
|
|
656
656
|
type: "keyword"
|
|
657
657
|
}), keywords = /* @__PURE__ */ "break case const continue default delete export extends false finally in instanceof let new return static super switch this throw true typeof var yield".split(" ").map(kwCompletion), typescriptKeywords = /* @__PURE__ */ keywords.concat(/* @__PURE__ */ [
|
|
658
658
|
"declare",
|
|
@@ -661,54 +661,54 @@ var javascriptLanguage = /* @__PURE__ */ LRLanguage.define({
|
|
|
661
661
|
"protected",
|
|
662
662
|
"public"
|
|
663
663
|
].map(kwCompletion));
|
|
664
|
-
function javascript(
|
|
665
|
-
let
|
|
666
|
-
return new LanguageSupport(
|
|
667
|
-
javascriptLanguage.data.of({ autocomplete: ifNotIn(dontComplete, completeFromList(
|
|
664
|
+
function javascript(g = {}) {
|
|
665
|
+
let G = g.jsx ? g.typescript ? tsxLanguage : jsxLanguage : g.typescript ? typescriptLanguage : javascriptLanguage, K = g.typescript ? typescriptSnippets.concat(typescriptKeywords) : snippets.concat(keywords);
|
|
666
|
+
return new LanguageSupport(G, [
|
|
667
|
+
javascriptLanguage.data.of({ autocomplete: ifNotIn(dontComplete, completeFromList(K)) }),
|
|
668
668
|
javascriptLanguage.data.of({ autocomplete: localCompletionSource }),
|
|
669
|
-
|
|
669
|
+
g.jsx ? autoCloseTags : []
|
|
670
670
|
]);
|
|
671
671
|
}
|
|
672
|
-
function findOpenTag(
|
|
672
|
+
function findOpenTag(g) {
|
|
673
673
|
for (; ; ) {
|
|
674
|
-
if (
|
|
675
|
-
if (
|
|
676
|
-
|
|
674
|
+
if (g.name == "JSXOpenTag" || g.name == "JSXSelfClosingTag" || g.name == "JSXFragmentTag") return g;
|
|
675
|
+
if (g.name == "JSXEscape" || !g.parent) return null;
|
|
676
|
+
g = g.parent;
|
|
677
677
|
}
|
|
678
678
|
}
|
|
679
|
-
function elementName(
|
|
680
|
-
for (let
|
|
679
|
+
function elementName(g, G, K = g.length) {
|
|
680
|
+
for (let q = G == null ? void 0 : G.firstChild; q; q = q.nextSibling) if (q.name == "JSXIdentifier" || q.name == "JSXBuiltin" || q.name == "JSXNamespacedName" || q.name == "JSXMemberExpression") return g.sliceString(q.from, Math.min(q.to, K));
|
|
681
681
|
return "";
|
|
682
682
|
}
|
|
683
|
-
var android = typeof navigator == "object" && /* @__PURE__ */ /Android\b/.test(navigator.userAgent), autoCloseTags = /* @__PURE__ */ EditorView.inputHandler.of((
|
|
684
|
-
if ((android ?
|
|
685
|
-
let Z = X(), { state: Q } = Z, $ = Q.changeByRange((
|
|
683
|
+
var android = typeof navigator == "object" && /* @__PURE__ */ /Android\b/.test(navigator.userAgent), autoCloseTags = /* @__PURE__ */ EditorView.inputHandler.of((g, K, J, Y, X) => {
|
|
684
|
+
if ((android ? g.composing : g.compositionStarted) || g.state.readOnly || K != J || Y != ">" && Y != "/" || !javascriptLanguage.isActiveAt(g.state, K, -1)) return false;
|
|
685
|
+
let Z = X(), { state: Q } = Z, $ = Q.changeByRange((g2) => {
|
|
686
686
|
var _a;
|
|
687
|
-
let { head: K2 } =
|
|
687
|
+
let { head: K2 } = g2, J2 = syntaxTree(Q).resolveInner(K2 - 1, -1), X2;
|
|
688
688
|
if (J2.name == "JSXStartTag" && (J2 = J2.parent), !(Q.doc.sliceString(K2 - 1, K2) != Y || J2.name == "JSXAttributeValue" && J2.to > K2)) {
|
|
689
689
|
if (Y == ">" && J2.name == "JSXFragmentTag") return {
|
|
690
|
-
range:
|
|
690
|
+
range: g2,
|
|
691
691
|
changes: {
|
|
692
692
|
from: K2,
|
|
693
693
|
insert: "</>"
|
|
694
694
|
}
|
|
695
695
|
};
|
|
696
696
|
if (Y == "/" && J2.name == "JSXStartCloseTag") {
|
|
697
|
-
let
|
|
698
|
-
if (q &&
|
|
699
|
-
let
|
|
697
|
+
let g3 = J2.parent, q = g3.parent;
|
|
698
|
+
if (q && g3.from == K2 - 2 && ((X2 = elementName(Q.doc, q.firstChild, K2)) || ((_a = q.firstChild) == null ? void 0 : _a.name) == "JSXFragmentTag")) {
|
|
699
|
+
let g4 = `${X2}>`;
|
|
700
700
|
return {
|
|
701
|
-
range: EditorSelection.cursor(K2 +
|
|
701
|
+
range: EditorSelection.cursor(K2 + g4.length, -1),
|
|
702
702
|
changes: {
|
|
703
703
|
from: K2,
|
|
704
|
-
insert:
|
|
704
|
+
insert: g4
|
|
705
705
|
}
|
|
706
706
|
};
|
|
707
707
|
}
|
|
708
708
|
} else if (Y == ">") {
|
|
709
|
-
let
|
|
710
|
-
if (
|
|
711
|
-
range:
|
|
709
|
+
let G = findOpenTag(J2);
|
|
710
|
+
if (G && G.name == "JSXOpenTag" && !/^\/?>|^<\//.test(Q.doc.sliceString(K2, K2 + 2)) && (X2 = elementName(Q.doc, G, K2))) return {
|
|
711
|
+
range: g2,
|
|
712
712
|
changes: {
|
|
713
713
|
from: K2,
|
|
714
714
|
insert: `</${X2}>`
|
|
@@ -716,9 +716,9 @@ var android = typeof navigator == "object" && /* @__PURE__ */ /Android\b/.test(n
|
|
|
716
716
|
};
|
|
717
717
|
}
|
|
718
718
|
}
|
|
719
|
-
return { range:
|
|
719
|
+
return { range: g2 };
|
|
720
720
|
});
|
|
721
|
-
return $.changes.empty ? false : (
|
|
721
|
+
return $.changes.empty ? false : (g.dispatch([Z, Q.update($, {
|
|
722
722
|
userEvent: "input.complete",
|
|
723
723
|
scrollIntoView: true
|
|
724
724
|
})]), true);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { B as tags, O as indentNodeProp, S as foldInside, h as continuedIndent, n as ExternalTokenizer, r as LRParser, s as LRLanguage, u as LanguageSupport, w as foldNodeProp, z as styleTags } from "./dist-
|
|
1
|
+
import { B as tags, O as indentNodeProp, S as foldInside, h as continuedIndent, n as ExternalTokenizer, r as LRParser, s as LRLanguage, u as LanguageSupport, w as foldNodeProp, z as styleTags } from "./dist-r8ecBV-v.js";
|
|
2
2
|
var closureParamDelim = 1, tpOpen = 2, tpClose = 3, RawString = 4, Float = 5, _b = 98, _e = 101, _f = 102, _r = 114, _E = 69, Zero = 48, Dot = 46, Plus = 43, Minus = 45, Hash = 35, Quote = 34, Pipe = 124, LessThan = 60, GreaterThan = 62;
|
|
3
3
|
function isNum(h) {
|
|
4
4
|
return h >= 48 && h <= 57;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { B as tags, O as indentNodeProp, S as foldInside, r as LRParser, s as LRLanguage, u as LanguageSupport, v as delimitedIndent, w as foldNodeProp, z as styleTags } from "./dist-
|
|
1
|
+
import { B as tags, O as indentNodeProp, S as foldInside, r as LRParser, s as LRLanguage, u as LanguageSupport, v as delimitedIndent, w as foldNodeProp, z as styleTags } from "./dist-r8ecBV-v.js";
|
|
2
2
|
var spec_Keyword = {
|
|
3
3
|
__proto__: null,
|
|
4
4
|
anyref: 34,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { B as tags, I as syntaxTree, J as parseMixed, O as indentNodeProp,
|
|
2
|
-
import { r as cssLanguage, t as css } from "./dist-
|
|
3
|
-
import { c as typescriptLanguage, i as jsxLanguage, n as javascript, r as javascriptLanguage, s as tsxLanguage } from "./dist-
|
|
1
|
+
import { B as tags, Et as EditorSelection, I as syntaxTree, J as parseMixed, O as indentNodeProp, Z as EditorView, m as bracketMatchingHandle, n as ExternalTokenizer, r as LRParser, s as LRLanguage, t as ContextTracker, u as LanguageSupport, w as foldNodeProp, z as styleTags } from "./dist-r8ecBV-v.js";
|
|
2
|
+
import { r as cssLanguage, t as css } from "./dist-Cgf353Ki.js";
|
|
3
|
+
import { c as typescriptLanguage, i as jsxLanguage, n as javascript, r as javascriptLanguage, s as tsxLanguage } from "./dist-C2-m5aEk.js";
|
|
4
4
|
var scriptText = 54, StartCloseScriptTag = 1, styleText = 55, StartCloseStyleTag = 2, textareaText = 56, StartCloseTextareaTag = 3, EndTag = 4, SelfClosingEndTag = 5, StartTag = 6, StartScriptTag = 7, StartStyleTag = 8, StartTextareaTag = 9, StartSelfClosingTag = 10, StartCloseTag = 11, NoMatchStartCloseTag = 12, MismatchedStartCloseTag = 13, missingCloseTag = 57, IncompleteCloseTag = 14, commentContent$1 = 58, Element = 20, TagName = 22, Attribute = 23, AttributeName = 24, AttributeValue = 26, UnquotedAttributeValue = 27, ScriptText = 28, StyleText = 31, TextareaText = 34, OpenTag = 36, CloseTag = 37, Dialect_noMatch = 0, Dialect_selfClosing = 1, selfClosers$1 = {
|
|
5
5
|
area: true,
|
|
6
6
|
base: true,
|
|
@@ -356,16 +356,16 @@ function maybeNest(g, G, K) {
|
|
|
356
356
|
return null;
|
|
357
357
|
}
|
|
358
358
|
function configureNesting(g = [], G = []) {
|
|
359
|
-
let
|
|
360
|
-
for (let G2 of g) (G2.tag == "script" ?
|
|
359
|
+
let K = [], J = [], Y = [], X = [];
|
|
360
|
+
for (let G2 of g) (G2.tag == "script" ? K : G2.tag == "style" ? J : G2.tag == "textarea" ? Y : X).push(G2);
|
|
361
361
|
let Z = G.length ? /* @__PURE__ */ Object.create(null) : null;
|
|
362
362
|
for (let g2 of G) (Z[g2.name] || (Z[g2.name] = [])).push(g2);
|
|
363
363
|
return parseMixed((g2, G2) => {
|
|
364
|
-
let
|
|
365
|
-
if (
|
|
366
|
-
if (
|
|
367
|
-
if (
|
|
368
|
-
if (
|
|
364
|
+
let q = g2.type.id;
|
|
365
|
+
if (q == ScriptText) return maybeNest(g2, G2, K);
|
|
366
|
+
if (q == StyleText) return maybeNest(g2, G2, J);
|
|
367
|
+
if (q == TextareaText) return maybeNest(g2, G2, Y);
|
|
368
|
+
if (q == Element && X.length) {
|
|
369
369
|
let K2 = g2.node, q2 = K2.firstChild, J2 = q2 && findTagName(q2, G2), Y2;
|
|
370
370
|
if (J2) {
|
|
371
371
|
for (let g3 of X) if (g3.tag == J2 && (!g3.attrs || g3.attrs(Y2 || (Y2 = getAttrs(q2, G2))))) {
|
|
@@ -380,7 +380,7 @@ function configureNesting(g = [], G = []) {
|
|
|
380
380
|
}
|
|
381
381
|
}
|
|
382
382
|
}
|
|
383
|
-
if (Z &&
|
|
383
|
+
if (Z && q == Attribute) {
|
|
384
384
|
let K2 = g2.node, q2;
|
|
385
385
|
if (q2 = K2.firstChild) {
|
|
386
386
|
let g3 = Z[G2.read(q2.from, q2.to)];
|
|
@@ -1170,14 +1170,14 @@ function completeAttrValue(g, G, K, q, J) {
|
|
|
1170
1170
|
validFor: Z
|
|
1171
1171
|
};
|
|
1172
1172
|
}
|
|
1173
|
-
function htmlCompletionFor(g,
|
|
1174
|
-
let { state: q, pos: J } =
|
|
1175
|
-
for (let g2 = J,
|
|
1176
|
-
let
|
|
1177
|
-
if (!
|
|
1178
|
-
X = Y =
|
|
1173
|
+
function htmlCompletionFor(g, G) {
|
|
1174
|
+
let { state: q, pos: J } = G, Y = syntaxTree(q).resolveInner(J, -1), X = Y.resolve(J);
|
|
1175
|
+
for (let g2 = J, G2; X == Y && (G2 = Y.childBefore(g2)); ) {
|
|
1176
|
+
let K = G2.lastChild;
|
|
1177
|
+
if (!K || !K.type.isError || K.from < K.to) break;
|
|
1178
|
+
X = Y = G2, g2 = K.from;
|
|
1179
1179
|
}
|
|
1180
|
-
return Y.name == "TagName" ? Y.parent && /CloseTag$/.test(Y.parent.name) ? completeCloseTag(q, Y, Y.from, J) : completeTag(q, g, Y, Y.from, J) : Y.name == "StartTag" ? completeTag(q, g, Y, J, J) : Y.name == "StartCloseTag" || Y.name == "IncompleteCloseTag" ? completeCloseTag(q, Y, J, J) : Y.name == "OpenTag" || Y.name == "SelfClosingTag" || Y.name == "AttributeName" ? completeAttrName(q, g, Y, Y.name == "AttributeName" ? Y.from : J, J) : Y.name == "Is" || Y.name == "AttributeValue" || Y.name == "UnquotedAttributeValue" ? completeAttrValue(q, g, Y, Y.name == "Is" ? J : Y.from, J) :
|
|
1180
|
+
return Y.name == "TagName" ? Y.parent && /CloseTag$/.test(Y.parent.name) ? completeCloseTag(q, Y, Y.from, J) : completeTag(q, g, Y, Y.from, J) : Y.name == "StartTag" ? completeTag(q, g, Y, J, J) : Y.name == "StartCloseTag" || Y.name == "IncompleteCloseTag" ? completeCloseTag(q, Y, J, J) : Y.name == "OpenTag" || Y.name == "SelfClosingTag" || Y.name == "AttributeName" ? completeAttrName(q, g, Y, Y.name == "AttributeName" ? Y.from : J, J) : Y.name == "Is" || Y.name == "AttributeValue" || Y.name == "UnquotedAttributeValue" ? completeAttrValue(q, g, Y, Y.name == "Is" ? J : Y.from, J) : G.explicit && (X.name == "Element" || X.name == "Text" || X.name == "Document") ? completeStartTag(q, g, Y, J) : null;
|
|
1181
1181
|
}
|
|
1182
1182
|
function htmlCompletionSource(g) {
|
|
1183
1183
|
return htmlCompletionFor(Schema.default, g);
|
|
@@ -1281,31 +1281,31 @@ function html(g = {}) {
|
|
|
1281
1281
|
css().support
|
|
1282
1282
|
]);
|
|
1283
1283
|
}
|
|
1284
|
-
var selfClosers = /* @__PURE__ */ new Set(/* @__PURE__ */ "area base br col command embed frame hr img input keygen link meta param source track wbr menuitem".split(" ")), autoCloseTags = /* @__PURE__ */ EditorView.inputHandler.of((g,
|
|
1285
|
-
if (g.composing || g.state.readOnly ||
|
|
1284
|
+
var selfClosers = /* @__PURE__ */ new Set(/* @__PURE__ */ "area base br col command embed frame hr img input keygen link meta param source track wbr menuitem".split(" ")), autoCloseTags = /* @__PURE__ */ EditorView.inputHandler.of((g, q, J, Y, X) => {
|
|
1285
|
+
if (g.composing || g.state.readOnly || q != J || Y != ">" && Y != "/" || !htmlLanguage.isActiveAt(g.state, q, -1)) return false;
|
|
1286
1286
|
let Z = X(), { state: Q } = Z, $ = Q.changeByRange((g2) => {
|
|
1287
1287
|
var _a, _b, _c;
|
|
1288
|
-
let
|
|
1289
|
-
if (
|
|
1288
|
+
let q2 = Q.doc.sliceString(g2.from - 1, g2.to) == Y, { head: J2 } = g2, X2 = syntaxTree(Q).resolveInner(J2, -1), Z2;
|
|
1289
|
+
if (q2 && Y == ">" && X2.name == "EndTag") {
|
|
1290
1290
|
let G = X2.parent;
|
|
1291
|
-
if (((_b = (_a = G.parent) == null ? void 0 : _a.lastChild) == null ? void 0 : _b.name) != "CloseTag" && (Z2 = elementName(Q.doc, G.parent,
|
|
1291
|
+
if (((_b = (_a = G.parent) == null ? void 0 : _a.lastChild) == null ? void 0 : _b.name) != "CloseTag" && (Z2 = elementName(Q.doc, G.parent, J2)) && !selfClosers.has(Z2)) return {
|
|
1292
1292
|
range: g2,
|
|
1293
1293
|
changes: {
|
|
1294
|
-
from:
|
|
1295
|
-
to:
|
|
1294
|
+
from: J2,
|
|
1295
|
+
to: J2 + (Q.doc.sliceString(J2, J2 + 1) === ">" ? 1 : 0),
|
|
1296
1296
|
insert: `</${Z2}>`
|
|
1297
1297
|
}
|
|
1298
1298
|
};
|
|
1299
|
-
} else if (
|
|
1299
|
+
} else if (q2 && Y == "/" && X2.name == "IncompleteCloseTag") {
|
|
1300
1300
|
let g3 = X2.parent;
|
|
1301
|
-
if (X2.from ==
|
|
1302
|
-
let g4 =
|
|
1301
|
+
if (X2.from == J2 - 2 && ((_c = g3.lastChild) == null ? void 0 : _c.name) != "CloseTag" && (Z2 = elementName(Q.doc, g3, J2)) && !selfClosers.has(Z2)) {
|
|
1302
|
+
let g4 = J2 + (Q.doc.sliceString(J2, J2 + 1) === ">" ? 1 : 0), K = `${Z2}>`;
|
|
1303
1303
|
return {
|
|
1304
|
-
range: EditorSelection.cursor(
|
|
1304
|
+
range: EditorSelection.cursor(J2 + K.length, -1),
|
|
1305
1305
|
changes: {
|
|
1306
|
-
from:
|
|
1306
|
+
from: J2,
|
|
1307
1307
|
to: g4,
|
|
1308
|
-
insert:
|
|
1308
|
+
insert: K
|
|
1309
1309
|
}
|
|
1310
1310
|
};
|
|
1311
1311
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { B as tags, O as indentNodeProp, S as foldInside, h as continuedIndent, r as LRParser, s as LRLanguage, u as LanguageSupport, v as delimitedIndent, w as foldNodeProp, y as flatIndent, z as styleTags } from "./dist-
|
|
1
|
+
import { B as tags, O as indentNodeProp, S as foldInside, h as continuedIndent, r as LRParser, s as LRLanguage, u as LanguageSupport, v as delimitedIndent, w as foldNodeProp, y as flatIndent, z as styleTags } from "./dist-r8ecBV-v.js";
|
|
2
2
|
var javaHighlighting = styleTags({
|
|
3
3
|
null: tags.null,
|
|
4
4
|
instanceof: tags.operatorKeyword,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { B as tags,
|
|
1
|
+
import { B as tags, Et as EditorSelection, I as syntaxTree, O as indentNodeProp, Z as EditorView, m as bracketMatchingHandle, n as ExternalTokenizer, r as LRParser, s as LRLanguage, t as ContextTracker, u as LanguageSupport, w as foldNodeProp, z as styleTags } from "./dist-r8ecBV-v.js";
|
|
2
2
|
var StartTag = 1, StartCloseTag = 2, MissingCloseTag = 3, mismatchedStartCloseTag = 4, incompleteStartCloseTag = 5, commentContent$1 = 36, piContent$1 = 37, cdataContent$1 = 38, Element$1 = 11, OpenTag = 13;
|
|
3
3
|
function nameChar(m) {
|
|
4
4
|
return m == 45 || m == 46 || m == 58 || m >= 65 && m <= 90 || m == 95 || m >= 97 && m <= 122 || m >= 161;
|
|
@@ -141,11 +141,11 @@ function findParentElement(m) {
|
|
|
141
141
|
for (let V = m && m.parent; V; V = V.parent) if (V.name == "Element") return V;
|
|
142
142
|
return null;
|
|
143
143
|
}
|
|
144
|
-
function findLocation(m,
|
|
144
|
+
function findLocation(m, V) {
|
|
145
145
|
var _a;
|
|
146
|
-
let U = syntaxTree(m).resolveInner(
|
|
146
|
+
let U = syntaxTree(m).resolveInner(V, -1), W = null;
|
|
147
147
|
for (let m2 = U; !W && m2.parent; m2 = m2.parent) (m2.name == "OpenTag" || m2.name == "CloseTag" || m2.name == "SelfClosingTag" || m2.name == "MismatchedCloseTag") && (W = m2);
|
|
148
|
-
if (W && (W.to >
|
|
148
|
+
if (W && (W.to > V || W.lastChild.type.isError)) {
|
|
149
149
|
let m2 = W.parent;
|
|
150
150
|
if (U.name == "TagName") return W.name == "CloseTag" || W.name == "MismatchedCloseTag" ? {
|
|
151
151
|
type: "closeTag",
|
|
@@ -166,33 +166,33 @@ function findLocation(m, H) {
|
|
|
166
166
|
from: U.from,
|
|
167
167
|
context: W
|
|
168
168
|
};
|
|
169
|
-
let
|
|
170
|
-
return (
|
|
169
|
+
let H = U == W || U.name == "Attribute" ? U.childBefore(V) : U;
|
|
170
|
+
return (H == null ? void 0 : H.name) == "StartTag" ? {
|
|
171
171
|
type: "openTag",
|
|
172
|
-
from:
|
|
172
|
+
from: V,
|
|
173
173
|
context: findParentElement(m2)
|
|
174
|
-
} : (
|
|
174
|
+
} : (H == null ? void 0 : H.name) == "StartCloseTag" && H.to <= V ? {
|
|
175
175
|
type: "closeTag",
|
|
176
|
-
from:
|
|
176
|
+
from: V,
|
|
177
177
|
context: m2
|
|
178
|
-
} : (
|
|
178
|
+
} : (H == null ? void 0 : H.name) == "Is" ? {
|
|
179
179
|
type: "attrValue",
|
|
180
|
-
from:
|
|
180
|
+
from: V,
|
|
181
181
|
context: W
|
|
182
|
-
} :
|
|
182
|
+
} : H ? {
|
|
183
183
|
type: "attrName",
|
|
184
|
-
from:
|
|
184
|
+
from: V,
|
|
185
185
|
context: W
|
|
186
186
|
} : null;
|
|
187
187
|
} else if (U.name == "StartCloseTag") return {
|
|
188
188
|
type: "closeTag",
|
|
189
|
-
from:
|
|
189
|
+
from: V,
|
|
190
190
|
context: U.parent
|
|
191
191
|
};
|
|
192
|
-
for (; U.parent && U.to ==
|
|
192
|
+
for (; U.parent && U.to == V && !((_a = U.lastChild) == null ? void 0 : _a.type.isError); ) U = U.parent;
|
|
193
193
|
return U.name == "Element" || U.name == "Text" || U.name == "Document" ? {
|
|
194
194
|
type: "tag",
|
|
195
|
-
from:
|
|
195
|
+
from: V,
|
|
196
196
|
context: U.name == "Element" ? U : findParentElement(U)
|
|
197
197
|
} : null;
|
|
198
198
|
}
|
|
@@ -334,31 +334,31 @@ function elementName(m, V, H = m.length) {
|
|
|
334
334
|
let U = V.firstChild, W = U && U.getChild("TagName");
|
|
335
335
|
return W ? m.sliceString(W.from, Math.min(W.to, H)) : "";
|
|
336
336
|
}
|
|
337
|
-
var autoCloseTags = /* @__PURE__ */ EditorView.inputHandler.of((m,
|
|
338
|
-
if (m.composing || m.state.readOnly ||
|
|
337
|
+
var autoCloseTags = /* @__PURE__ */ EditorView.inputHandler.of((m, U, W, G, K) => {
|
|
338
|
+
if (m.composing || m.state.readOnly || U != W || G != ">" && G != "/" || !xmlLanguage.isActiveAt(m.state, U, -1)) return false;
|
|
339
339
|
let q = K(), { state: J } = q, Y = J.changeByRange((m2) => {
|
|
340
340
|
var _a, _b, _c;
|
|
341
|
-
let { head:
|
|
341
|
+
let { head: U2 } = m2, W2 = J.doc.sliceString(U2 - 1, U2) == G, K2 = syntaxTree(J).resolveInner(U2, -1), q2;
|
|
342
342
|
if (W2 && G == ">" && K2.name == "EndTag") {
|
|
343
343
|
let V = K2.parent;
|
|
344
|
-
if (((_b = (_a = V.parent) == null ? void 0 : _a.lastChild) == null ? void 0 : _b.name) != "CloseTag" && (q2 = elementName(J.doc, V.parent,
|
|
344
|
+
if (((_b = (_a = V.parent) == null ? void 0 : _a.lastChild) == null ? void 0 : _b.name) != "CloseTag" && (q2 = elementName(J.doc, V.parent, U2))) return {
|
|
345
345
|
range: m2,
|
|
346
346
|
changes: {
|
|
347
|
-
from:
|
|
348
|
-
to:
|
|
347
|
+
from: U2,
|
|
348
|
+
to: U2 + (J.doc.sliceString(U2, U2 + 1) === ">" ? 1 : 0),
|
|
349
349
|
insert: `</${q2}>`
|
|
350
350
|
}
|
|
351
351
|
};
|
|
352
352
|
} else if (W2 && G == "/" && K2.name == "StartCloseTag") {
|
|
353
353
|
let m3 = K2.parent;
|
|
354
|
-
if (K2.from ==
|
|
355
|
-
let m4 =
|
|
354
|
+
if (K2.from == U2 - 2 && ((_c = m3.lastChild) == null ? void 0 : _c.name) != "CloseTag" && (q2 = elementName(J.doc, m3, U2))) {
|
|
355
|
+
let m4 = U2 + (J.doc.sliceString(U2, U2 + 1) === ">" ? 1 : 0), H = `${q2}>`;
|
|
356
356
|
return {
|
|
357
|
-
range: EditorSelection.cursor(
|
|
357
|
+
range: EditorSelection.cursor(U2 + H.length, -1),
|
|
358
358
|
changes: {
|
|
359
|
-
from:
|
|
359
|
+
from: U2,
|
|
360
360
|
to: m4,
|
|
361
|
-
insert:
|
|
361
|
+
insert: H
|
|
362
362
|
}
|
|
363
363
|
};
|
|
364
364
|
}
|