@ws-ui/code-editor 0.0.20 → 0.0.22
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 +27 -27
- package/dist/demo/LSPDemo.d.ts +6 -0
- package/dist/demo/common.d.ts +33 -0
- package/dist/demo/index.d.ts +2 -0
- package/dist/index.cjs.js +8 -8
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.es.js +44 -45
- package/dist/index.es.js.map +1 -1
- package/dist/monaco_theme.json +93 -0
- package/dist/style.css +1 -1
- package/package.json +75 -72
package/dist/index.es.js
CHANGED
|
@@ -116,7 +116,7 @@ function an() {
|
|
|
116
116
|
i = y("react.element"), l = y("react.portal"), r.Fragment = y("react.fragment"), u = y("react.strict_mode"), f = y("react.profiler"), s = y("react.provider"), d = y("react.context"), h = y("react.forward_ref"), b = y("react.suspense"), S = y("react.suspense_list"), v = y("react.memo"), O = y("react.lazy"), k = y("react.block"), P = y("react.server.block"), $ = y("react.fundamental"), y("react.scope"), y("react.opaque.id"), _ = y("react.debug_trace_mode"), y("react.offscreen"), R = y("react.legacy_hidden");
|
|
117
117
|
}
|
|
118
118
|
var g = typeof Symbol == "function" && Symbol.iterator, p = "@@iterator";
|
|
119
|
-
function
|
|
119
|
+
function M(e) {
|
|
120
120
|
if (e === null || typeof e != "object")
|
|
121
121
|
return null;
|
|
122
122
|
var o = g && e[g] || e[p];
|
|
@@ -151,7 +151,7 @@ function an() {
|
|
|
151
151
|
function w(e) {
|
|
152
152
|
return e.displayName || "Context";
|
|
153
153
|
}
|
|
154
|
-
function
|
|
154
|
+
function W(e) {
|
|
155
155
|
if (e == null)
|
|
156
156
|
return null;
|
|
157
157
|
if (typeof e.tag == "number" && A("Received an unexpected object in getComponentName(). This is likely a bug in React. Please file an issue."), typeof e == "function")
|
|
@@ -183,13 +183,13 @@ function an() {
|
|
|
183
183
|
case h:
|
|
184
184
|
return I(e, e.render, "ForwardRef");
|
|
185
185
|
case v:
|
|
186
|
-
return
|
|
186
|
+
return W(e.type);
|
|
187
187
|
case k:
|
|
188
|
-
return
|
|
188
|
+
return W(e._render);
|
|
189
189
|
case O: {
|
|
190
190
|
var m = e, T = m._payload, N = m._init;
|
|
191
191
|
try {
|
|
192
|
-
return
|
|
192
|
+
return W(N(T));
|
|
193
193
|
} catch {
|
|
194
194
|
return null;
|
|
195
195
|
}
|
|
@@ -327,14 +327,14 @@ function an() {
|
|
|
327
327
|
} catch (B) {
|
|
328
328
|
if (B && m && typeof B.stack == "string") {
|
|
329
329
|
for (var C = B.stack.split(`
|
|
330
|
-
`),
|
|
331
|
-
`), L = C.length - 1, D =
|
|
330
|
+
`), K = m.stack.split(`
|
|
331
|
+
`), L = C.length - 1, D = K.length - 1; L >= 1 && D >= 0 && C[L] !== K[D]; )
|
|
332
332
|
D--;
|
|
333
333
|
for (; L >= 1 && D >= 0; L--, D--)
|
|
334
|
-
if (C[L] !==
|
|
334
|
+
if (C[L] !== K[D]) {
|
|
335
335
|
if (L !== 1 || D !== 1)
|
|
336
336
|
do
|
|
337
|
-
if (L--, D--, D < 0 || C[L] !==
|
|
337
|
+
if (L--, D--, D < 0 || C[L] !== K[D]) {
|
|
338
338
|
var q = `
|
|
339
339
|
` + C[L].replace(" at new ", " at ");
|
|
340
340
|
return typeof e == "function" && se.set(e, q), q;
|
|
@@ -403,8 +403,8 @@ function an() {
|
|
|
403
403
|
var C = void 0;
|
|
404
404
|
try {
|
|
405
405
|
if (typeof e[E] != "function") {
|
|
406
|
-
var
|
|
407
|
-
throw
|
|
406
|
+
var K = Error((m || "React class") + ": " + a + " type `" + E + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof e[E] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");
|
|
407
|
+
throw K.name = "Invariant Violation", K;
|
|
408
408
|
}
|
|
409
409
|
C = e[E](o, E, m, a, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
|
|
410
410
|
} catch (L) {
|
|
@@ -439,8 +439,8 @@ function an() {
|
|
|
439
439
|
}
|
|
440
440
|
function bt(e, o) {
|
|
441
441
|
if (typeof e.ref == "string" && re.current && o && re.current.stateNode !== o) {
|
|
442
|
-
var a =
|
|
443
|
-
pe[a] || (A('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref',
|
|
442
|
+
var a = W(re.current.type);
|
|
443
|
+
pe[a] || (A('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref', W(re.current.type), e.ref), pe[a] = !0);
|
|
444
444
|
}
|
|
445
445
|
}
|
|
446
446
|
function Ct(e, o) {
|
|
@@ -496,8 +496,8 @@ function an() {
|
|
|
496
496
|
};
|
|
497
497
|
function xt(e, o, a, m, T) {
|
|
498
498
|
{
|
|
499
|
-
var N, E = {}, C = null,
|
|
500
|
-
a !== void 0 && (C = "" + a), ht(o) && (C = "" + o.key), vt(o) && (
|
|
499
|
+
var N, E = {}, C = null, K = null;
|
|
500
|
+
a !== void 0 && (C = "" + a), ht(o) && (C = "" + o.key), vt(o) && (K = o.ref, bt(o, T));
|
|
501
501
|
for (N in o)
|
|
502
502
|
ge.call(o, N) && !pt.hasOwnProperty(N) && (E[N] = o[N]);
|
|
503
503
|
if (e && e.defaultProps) {
|
|
@@ -505,11 +505,11 @@ function an() {
|
|
|
505
505
|
for (N in L)
|
|
506
506
|
E[N] === void 0 && (E[N] = L[N]);
|
|
507
507
|
}
|
|
508
|
-
if (C ||
|
|
508
|
+
if (C || K) {
|
|
509
509
|
var D = typeof e == "function" ? e.displayName || e.name || "Unknown" : e;
|
|
510
|
-
C && Ct(E, D),
|
|
510
|
+
C && Ct(E, D), K && Et(E, D);
|
|
511
511
|
}
|
|
512
|
-
return Rt(e, C,
|
|
512
|
+
return Rt(e, C, K, T, m, re.current, E);
|
|
513
513
|
}
|
|
514
514
|
}
|
|
515
515
|
var ve = F.ReactCurrentOwner, $e = F.ReactDebugCurrentFrame;
|
|
@@ -528,7 +528,7 @@ function an() {
|
|
|
528
528
|
function Fe() {
|
|
529
529
|
{
|
|
530
530
|
if (ve.current) {
|
|
531
|
-
var e =
|
|
531
|
+
var e = W(ve.current.type);
|
|
532
532
|
if (e)
|
|
533
533
|
return `
|
|
534
534
|
|
|
@@ -571,7 +571,7 @@ Check the top-level render call using <` + a + ">.");
|
|
|
571
571
|
return;
|
|
572
572
|
Me[a] = !0;
|
|
573
573
|
var m = "";
|
|
574
|
-
e && e._owner && e._owner !== ve.current && (m = " It was passed a child from " +
|
|
574
|
+
e && e._owner && e._owner !== ve.current && (m = " It was passed a child from " + W(e._owner.type) + "."), H(e), A('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.', a, m), H(null);
|
|
575
575
|
}
|
|
576
576
|
}
|
|
577
577
|
function Ke(e, o) {
|
|
@@ -586,7 +586,7 @@ Check the top-level render call using <` + a + ">.");
|
|
|
586
586
|
else if (be(e))
|
|
587
587
|
e._store && (e._store.validated = !0);
|
|
588
588
|
else if (e) {
|
|
589
|
-
var T =
|
|
589
|
+
var T = M(e);
|
|
590
590
|
if (typeof T == "function" && T !== e.entries)
|
|
591
591
|
for (var N = T.call(e), E; !(E = N.next()).done; )
|
|
592
592
|
be(E.value) && We(E.value, o);
|
|
@@ -608,11 +608,11 @@ Check the top-level render call using <` + a + ">.");
|
|
|
608
608
|
else
|
|
609
609
|
return;
|
|
610
610
|
if (a) {
|
|
611
|
-
var m =
|
|
611
|
+
var m = W(o);
|
|
612
612
|
gt(a, e.props, "prop", m, e);
|
|
613
613
|
} else if (o.PropTypes !== void 0 && !he) {
|
|
614
614
|
he = !0;
|
|
615
|
-
var T =
|
|
615
|
+
var T = W(o);
|
|
616
616
|
A("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", T || "Unknown");
|
|
617
617
|
}
|
|
618
618
|
typeof o.getDefaultProps == "function" && !o.getDefaultProps.isReactClassApproved && A("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.");
|
|
@@ -636,10 +636,10 @@ Check the top-level render call using <` + a + ">.");
|
|
|
636
636
|
if (!E) {
|
|
637
637
|
var C = "";
|
|
638
638
|
(e === void 0 || typeof e == "object" && e !== null && Object.keys(e).length === 0) && (C += " You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");
|
|
639
|
-
var
|
|
640
|
-
|
|
639
|
+
var K = St(T);
|
|
640
|
+
K ? C += K : C += Fe();
|
|
641
641
|
var L;
|
|
642
|
-
e === null ? L = "null" : Array.isArray(e) ? L = "array" : e !== void 0 && e.$$typeof === i ? (L = "<" + (
|
|
642
|
+
e === null ? L = "null" : Array.isArray(e) ? L = "array" : e !== void 0 && e.$$typeof === i ? (L = "<" + (W(e.type) || "Unknown") + " />", C = " Did you accidentally export a JSX literal instead of a component?") : L = typeof e, A("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", L, C);
|
|
643
643
|
}
|
|
644
644
|
var D = xt(e, o, a, T, N);
|
|
645
645
|
if (D == null)
|
|
@@ -1133,7 +1133,7 @@ const ot = Qe(void 0), qn = ({ children: r, url: n, qodly: t, defaultZoom: i, op
|
|
|
1133
1133
|
}
|
|
1134
1134
|
x.onopen = $, x.onclose = _, x.onerror = R, O.current = 0;
|
|
1135
1135
|
}, $ = async function() {
|
|
1136
|
-
const x = Gt(this), I = new sn(x), w = new ln(x),
|
|
1136
|
+
const x = Gt(this), I = new sn(x), w = new ln(x), W = new Kt({
|
|
1137
1137
|
name: "4D Language Client",
|
|
1138
1138
|
clientOptions: {
|
|
1139
1139
|
workspaceFolder: {
|
|
@@ -1155,11 +1155,11 @@ const ot = Qe(void 0), qn = ({ children: r, url: n, qodly: t, defaultZoom: i, op
|
|
|
1155
1155
|
})
|
|
1156
1156
|
}
|
|
1157
1157
|
});
|
|
1158
|
-
v.current =
|
|
1159
|
-
|
|
1158
|
+
v.current = W, I.onClose(() => {
|
|
1159
|
+
W.stop(), O.current < 3 ? setTimeout(() => {
|
|
1160
1160
|
O.current++, P();
|
|
1161
1161
|
}, 1e3) : S(new Event("WEBSOCKET_CLOSED"));
|
|
1162
|
-
}),
|
|
1162
|
+
}), W.needsStart() && await W.start(), h(!0);
|
|
1163
1163
|
}, _ = () => {
|
|
1164
1164
|
}, R = (x) => {
|
|
1165
1165
|
S(x);
|
|
@@ -1180,7 +1180,7 @@ const ot = Qe(void 0), qn = ({ children: r, url: n, qodly: t, defaultZoom: i, op
|
|
|
1180
1180
|
A(w.filePath);
|
|
1181
1181
|
break;
|
|
1182
1182
|
case G.WILL_RENAME:
|
|
1183
|
-
|
|
1183
|
+
M(w.oldPath, w.newPath);
|
|
1184
1184
|
break;
|
|
1185
1185
|
case G.DID_RENAME:
|
|
1186
1186
|
Y(w.oldPath, w.newPath);
|
|
@@ -1220,7 +1220,7 @@ const ot = Qe(void 0), qn = ({ children: r, url: n, qodly: t, defaultZoom: i, op
|
|
|
1220
1220
|
}
|
|
1221
1221
|
]
|
|
1222
1222
|
});
|
|
1223
|
-
},
|
|
1223
|
+
}, M = (x, I) => {
|
|
1224
1224
|
var w;
|
|
1225
1225
|
(w = v.current) == null || w.sendRequest(Qt.type, {
|
|
1226
1226
|
files: [
|
|
@@ -1454,10 +1454,10 @@ function Tn(r) {
|
|
|
1454
1454
|
function Nn(r, n) {
|
|
1455
1455
|
const t = [];
|
|
1456
1456
|
let i = [];
|
|
1457
|
-
const l = [], u = (g, p,
|
|
1457
|
+
const l = [], u = (g, p, M, F) => {
|
|
1458
1458
|
t.push({
|
|
1459
1459
|
startLineNumber: g,
|
|
1460
|
-
endLineNumber:
|
|
1460
|
+
endLineNumber: M,
|
|
1461
1461
|
startColumn: p,
|
|
1462
1462
|
endColumn: F
|
|
1463
1463
|
}), h(), d();
|
|
@@ -1501,11 +1501,11 @@ function Nn(r, n) {
|
|
|
1501
1501
|
}), v = r.onDidChangeModelContent((g) => {
|
|
1502
1502
|
if (!g.isUndoing)
|
|
1503
1503
|
for (const p of g.changes) {
|
|
1504
|
-
const
|
|
1505
|
-
if (
|
|
1504
|
+
const M = b(p);
|
|
1505
|
+
if (M.isReplacement || M.isDeletion || M.isAddition) {
|
|
1506
1506
|
const F = t.some(
|
|
1507
1507
|
(Y) => p.range.startLineNumber >= Y.startLineNumber && p.range.endLineNumber <= Y.endLineNumber && p.range.startColumn >= Y.startColumn && p.range.endColumn <= Y.endColumn
|
|
1508
|
-
), A =
|
|
1508
|
+
), A = !F && n && p.range.startLineNumber === 1 && p.range.startColumn === 1 && !tt(p.text);
|
|
1509
1509
|
if (F || A) {
|
|
1510
1510
|
const Y = r.getModel();
|
|
1511
1511
|
if (Y) {
|
|
@@ -1513,7 +1513,6 @@ function Nn(r, n) {
|
|
|
1513
1513
|
return;
|
|
1514
1514
|
}
|
|
1515
1515
|
}
|
|
1516
|
-
h(), R();
|
|
1517
1516
|
}
|
|
1518
1517
|
}
|
|
1519
1518
|
}), O = () => {
|
|
@@ -1540,11 +1539,11 @@ function Nn(r, n) {
|
|
|
1540
1539
|
i.map(y(g))
|
|
1541
1540
|
));
|
|
1542
1541
|
}, y = (g) => (p) => {
|
|
1543
|
-
const
|
|
1542
|
+
const M = g.getPositionAt(p[0]), F = g.getPositionAt(p[1]);
|
|
1544
1543
|
return {
|
|
1545
1544
|
range: new c.Range(
|
|
1546
|
-
|
|
1547
|
-
|
|
1545
|
+
M.lineNumber,
|
|
1546
|
+
M.column,
|
|
1548
1547
|
F.lineNumber,
|
|
1549
1548
|
F.column
|
|
1550
1549
|
),
|
|
@@ -1743,8 +1742,8 @@ const kn = new RegExp("^[ s]+(exposed|Function)", "i"), Xe = () => /* @__PURE__
|
|
|
1743
1742
|
k(R);
|
|
1744
1743
|
const g = R.getModel();
|
|
1745
1744
|
if (g && (g.updateOptions({ insertSpaces: !1 }), R.onKeyUp(() => {
|
|
1746
|
-
var
|
|
1747
|
-
const p = (
|
|
1745
|
+
var M;
|
|
1746
|
+
const p = (M = R.getPosition()) == null ? void 0 : M.lineNumber;
|
|
1748
1747
|
if (p) {
|
|
1749
1748
|
const F = g.getLineFirstNonWhitespaceColumn(p), A = g.getLineLength(p), Y = g.getLineContent(p);
|
|
1750
1749
|
kn.test(Y) && R.executeEdits("edit-handler", [
|
|
@@ -1772,12 +1771,12 @@ const kn = new RegExp("^[ s]+(exposed|Function)", "i"), Xe = () => /* @__PURE__
|
|
|
1772
1771
|
return;
|
|
1773
1772
|
const { line: R, offset: y } = S || {};
|
|
1774
1773
|
R && fn(O, R, y);
|
|
1775
|
-
}, [S]), J(() => {
|
|
1774
|
+
}, [S, O]), J(() => {
|
|
1776
1775
|
if (!O)
|
|
1777
1776
|
return;
|
|
1778
1777
|
const { selection: R } = v || {};
|
|
1779
1778
|
R && cn(O, R);
|
|
1780
|
-
}, [v]), P ? /* @__PURE__ */ j.jsxs(j.Fragment, { children: [
|
|
1779
|
+
}, [v, O]), P ? /* @__PURE__ */ j.jsxs(j.Fragment, { children: [
|
|
1781
1780
|
d ? /* @__PURE__ */ j.jsx(wn, { lspProps: h }) : null,
|
|
1782
1781
|
/* @__PURE__ */ j.jsx(
|
|
1783
1782
|
Dt,
|