@ws-ui/code-editor 0.0.19 → 0.0.20

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/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 M(e) {
119
+ function K(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 W(e) {
154
+ function M(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 W(e.type);
186
+ return M(e.type);
187
187
  case k:
188
- return W(e._render);
188
+ return M(e._render);
189
189
  case O: {
190
190
  var m = e, T = m._payload, N = m._init;
191
191
  try {
192
- return W(N(T));
192
+ return M(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
- `), K = m.stack.split(`
331
- `), L = C.length - 1, D = K.length - 1; L >= 1 && D >= 0 && C[L] !== K[D]; )
330
+ `), W = m.stack.split(`
331
+ `), L = C.length - 1, D = W.length - 1; L >= 1 && D >= 0 && C[L] !== W[D]; )
332
332
  D--;
333
333
  for (; L >= 1 && D >= 0; L--, D--)
334
- if (C[L] !== K[D]) {
334
+ if (C[L] !== W[D]) {
335
335
  if (L !== 1 || D !== 1)
336
336
  do
337
- if (L--, D--, D < 0 || C[L] !== K[D]) {
337
+ if (L--, D--, D < 0 || C[L] !== W[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 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;
406
+ var W = 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 W.name = "Invariant Violation", W;
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 = 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);
442
+ var a = M(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', M(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, K = null;
500
- a !== void 0 && (C = "" + a), ht(o) && (C = "" + o.key), vt(o) && (K = o.ref, bt(o, T));
499
+ var N, E = {}, C = null, W = null;
500
+ a !== void 0 && (C = "" + a), ht(o) && (C = "" + o.key), vt(o) && (W = 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 || K) {
508
+ if (C || W) {
509
509
  var D = typeof e == "function" ? e.displayName || e.name || "Unknown" : e;
510
- C && Ct(E, D), K && Et(E, D);
510
+ C && Ct(E, D), W && Et(E, D);
511
511
  }
512
- return Rt(e, C, K, T, m, re.current, E);
512
+ return Rt(e, C, W, 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 = W(ve.current.type);
531
+ var e = M(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 " + 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);
574
+ e && e._owner && e._owner !== ve.current && (m = " It was passed a child from " + M(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 = M(e);
589
+ var T = K(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 = W(o);
611
+ var m = M(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 = W(o);
615
+ var T = M(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 K = St(T);
640
- K ? C += K : C += Fe();
639
+ var W = St(T);
640
+ W ? C += W : C += Fe();
641
641
  var 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);
642
+ e === null ? L = "null" : Array.isArray(e) ? L = "array" : e !== void 0 && e.$$typeof === i ? (L = "<" + (M(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), W = new Kt({
1136
+ const x = Gt(this), I = new sn(x), w = new ln(x), M = 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 = W, I.onClose(() => {
1159
- W.stop(), O.current < 3 ? setTimeout(() => {
1158
+ v.current = M, I.onClose(() => {
1159
+ M.stop(), O.current < 3 ? setTimeout(() => {
1160
1160
  O.current++, P();
1161
1161
  }, 1e3) : S(new Event("WEBSOCKET_CLOSED"));
1162
- }), W.needsStart() && await W.start(), h(!0);
1162
+ }), M.needsStart() && await M.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
- M(w.oldPath, w.newPath);
1183
+ K(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
- }, M = (x, I) => {
1223
+ }, K = (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, M, F) => {
1457
+ const l = [], u = (g, p, K, F) => {
1458
1458
  t.push({
1459
1459
  startLineNumber: g,
1460
- endLineNumber: M,
1460
+ endLineNumber: K,
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 M = b(p);
1505
- if (M.isReplacement || M.isDeletion || M.isAddition) {
1504
+ const K = b(p);
1505
+ if (K.isReplacement || K.isDeletion) {
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 = !F && n && p.range.startLineNumber === 1 && p.range.startColumn === 1 && !tt(p.text);
1508
+ ), A = n && !F && 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,6 +1513,7 @@ function Nn(r, n) {
1513
1513
  return;
1514
1514
  }
1515
1515
  }
1516
+ h(), R();
1516
1517
  }
1517
1518
  }
1518
1519
  }), O = () => {
@@ -1539,11 +1540,11 @@ function Nn(r, n) {
1539
1540
  i.map(y(g))
1540
1541
  ));
1541
1542
  }, y = (g) => (p) => {
1542
- const M = g.getPositionAt(p[0]), F = g.getPositionAt(p[1]);
1543
+ const K = g.getPositionAt(p[0]), F = g.getPositionAt(p[1]);
1543
1544
  return {
1544
1545
  range: new c.Range(
1545
- M.lineNumber,
1546
- M.column,
1546
+ K.lineNumber,
1547
+ K.column,
1547
1548
  F.lineNumber,
1548
1549
  F.column
1549
1550
  ),
@@ -1742,8 +1743,8 @@ const kn = new RegExp("^[ s]+(exposed|Function)", "i"), Xe = () => /* @__PURE__
1742
1743
  k(R);
1743
1744
  const g = R.getModel();
1744
1745
  if (g && (g.updateOptions({ insertSpaces: !1 }), R.onKeyUp(() => {
1745
- var M;
1746
- const p = (M = R.getPosition()) == null ? void 0 : M.lineNumber;
1746
+ var K;
1747
+ const p = (K = R.getPosition()) == null ? void 0 : K.lineNumber;
1747
1748
  if (p) {
1748
1749
  const F = g.getLineFirstNonWhitespaceColumn(p), A = g.getLineLength(p), Y = g.getLineContent(p);
1749
1750
  kn.test(Y) && R.executeEdits("edit-handler", [
@@ -1771,12 +1772,12 @@ const kn = new RegExp("^[ s]+(exposed|Function)", "i"), Xe = () => /* @__PURE__
1771
1772
  return;
1772
1773
  const { line: R, offset: y } = S || {};
1773
1774
  R && fn(O, R, y);
1774
- }, [S, O]), J(() => {
1775
+ }, [S]), J(() => {
1775
1776
  if (!O)
1776
1777
  return;
1777
1778
  const { selection: R } = v || {};
1778
1779
  R && cn(O, R);
1779
- }, [v, O]), P ? /* @__PURE__ */ j.jsxs(j.Fragment, { children: [
1780
+ }, [v]), P ? /* @__PURE__ */ j.jsxs(j.Fragment, { children: [
1780
1781
  d ? /* @__PURE__ */ j.jsx(wn, { lspProps: h }) : null,
1781
1782
  /* @__PURE__ */ j.jsx(
1782
1783
  Dt,