@ws-ui/code-editor 0.2.0 → 0.2.1

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
@@ -1,8 +1,8 @@
1
1
  var ae = Object.defineProperty;
2
2
  var ge = (t, e, n) => e in t ? ae(t, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : t[e] = n;
3
3
  var x = (t, e, n) => (ge(t, typeof e != "symbol" ? e + "" : e, n), n);
4
- import { jsxs as J, jsx as S, Fragment as ce } from "react/jsx-runtime";
5
- import K, { useEffect as O, createContext as z, useState as D, useRef as P, useContext as U, memo as Ie } from "react";
4
+ import { jsxs as O, jsx as S, Fragment as ce } from "react/jsx-runtime";
5
+ import K, { useEffect as J, createContext as z, useState as D, useRef as P, useContext as U, memo as Ie } from "react";
6
6
  import { loader as de, useMonaco as ue, Editor as Ce } from "@monaco-editor/react";
7
7
  import { lspSubject as me, LspActions as Z, hasAttributesString as _, FileFolderType as fe } from "@ws-ui/shared";
8
8
  import { MonacoLanguageClient as Ae } from "monaco-languageclient";
@@ -11,14 +11,15 @@ import he, { initUserConfiguration as ve } from "@codingame/monaco-vscode-config
11
11
  import Se from "@codingame/monaco-vscode-theme-service-override";
12
12
  import ye from "@codingame/monaco-vscode-textmate-service-override";
13
13
  import Ne from "@codingame/monaco-vscode-languages-service-override";
14
+ import we from "@codingame/monaco-vscode-editor-service-override";
14
15
  import "@codingame/monaco-vscode-theme-defaults-default-extension";
15
16
  import * as o from "monaco-editor";
16
- import { Selection as we, KeyMod as B, KeyCode as G, editor as q, Uri as xe } from "monaco-editor";
17
- import { Logger as Re } from "monaco-languageclient/tools";
18
- import { ErrorAction as We, CloseAction as Le } from "vscode-languageclient";
19
- import { WebSocketMessageReader as Fe, WebSocketMessageWriter as Ze, toSocket as je } from "vscode-ws-jsonrpc";
20
- import { WillSaveTextDocumentNotification as Xe, TextDocumentSaveReason as Ke, DidSaveTextDocumentNotification as ke, WillCreateFilesRequest as Ee, WillRenameFilesRequest as Be, WillDeleteFilesRequest as Ge, DidCreateFilesNotification as Je, DidRenameFilesNotification as Oe, DidDeleteFilesNotification as Te } from "vscode-languageserver-protocol";
21
- import { StandaloneServices as De, ICodeEditorService as Ve } from "vscode/services";
17
+ import { Selection as xe, KeyMod as B, KeyCode as G, editor as q, Uri as Re } from "monaco-editor";
18
+ import { Logger as We } from "monaco-languageclient/tools";
19
+ import { ErrorAction as Le, CloseAction as Fe } from "vscode-languageclient";
20
+ import { WebSocketMessageReader as Ze, WebSocketMessageWriter as je, toSocket as Xe } from "vscode-ws-jsonrpc";
21
+ import { WillSaveTextDocumentNotification as Ke, TextDocumentSaveReason as ke, DidSaveTextDocumentNotification as Ee, WillCreateFilesRequest as Be, WillRenameFilesRequest as Ge, WillDeleteFilesRequest as Oe, DidCreateFilesNotification as Je, DidRenameFilesNotification as Te, DidDeleteFilesNotification as De } from "vscode-languageserver-protocol";
22
+ import { StandaloneServices as Ve, ICodeEditorService as Ye } from "vscode/services";
22
23
  import "@codingame/monaco-vscode-standalone-languages";
23
24
  import "@codingame/monaco-vscode-standalone-html-language-features";
24
25
  import "@codingame/monaco-vscode-standalone-css-language-features";
@@ -28,12 +29,14 @@ import "@codingame/monaco-vscode-css-default-extension";
28
29
  import "@codingame/monaco-vscode-json-default-extension";
29
30
  import "@codingame/monaco-vscode-html-default-extension";
30
31
  import "@codingame/monaco-vscode-javascript-default-extension";
31
- import { registerExtension as Ye } from "vscode/extensions";
32
- const Me = () => he(), Pe = () => {
32
+ import { registerExtension as Me } from "vscode/extensions";
33
+ const Pe = () => he(), He = () => {
33
34
  const t = Se(), e = t.themeService.ctor.prototype;
34
35
  return e.defineTheme = () => {
35
36
  }, t;
36
- }, He = `{
37
+ }, $e = () => we(
38
+ () => Promise.resolve(void 0)
39
+ ), ze = `{
37
40
  "workbench.colorTheme": "Default Dark+",
38
41
  "workbench.iconTheme": "vs-seti",
39
42
  "editor.autoClosingBrackets": "languageDefined",
@@ -118,10 +121,10 @@ const Me = () => he(), Pe = () => {
118
121
  }
119
122
  }
120
123
  }
121
- `, $e = () => ve(He), ze = async (t) => {
124
+ `, Ue = () => ve(ze), _e = async (t) => {
122
125
  var r;
123
126
  const e = t.serviceConfig ?? {};
124
- e.debugLogging = ((r = t.logger) == null ? void 0 : r.isEnabled()) === !0 && (e.debugLogging === !0 || t.logger.isDebugEnabled() === !0), await $e(), e.userServices = e.userServices ?? {};
127
+ e.debugLogging = ((r = t.logger) == null ? void 0 : r.isEnabled()) === !0 && (e.debugLogging === !0 || t.logger.isDebugEnabled() === !0), await Ue(), e.userServices = e.userServices ?? {};
125
128
  const n = e.userServices.configurationService ?? void 0, i = e.workspaceConfig ?? void 0;
126
129
  if (n === void 0) {
127
130
  if (i)
@@ -130,10 +133,11 @@ const Me = () => he(), Pe = () => {
130
133
  );
131
134
  const a = {
132
135
  // @see https://github.com/CodinGame/monaco-vscode-api#monaco-standalone-services
133
- ...Me(),
134
136
  ...Pe(),
137
+ ...He(),
135
138
  ...ye(),
136
- ...Ne()
139
+ ...Ne(),
140
+ ...$e()
137
141
  };
138
142
  pe(a, e.userServices);
139
143
  }
@@ -149,7 +153,7 @@ const Me = () => he(), Pe = () => {
149
153
  }
150
154
  }), e;
151
155
  };
152
- class Ue extends Fe {
156
+ class qe extends Ze {
153
157
  constructor(n, i) {
154
158
  super(n);
155
159
  x(this, "onMessage");
@@ -168,7 +172,7 @@ class Ue extends Fe {
168
172
  }
169
173
  }
170
174
  }
171
- class _e extends Ze {
175
+ class Qe extends je {
172
176
  constructor(n, i) {
173
177
  super(n);
174
178
  x(this, "onSend");
@@ -189,8 +193,8 @@ function L(t) {
189
193
  function Q(t, e = 0) {
190
194
  setTimeout(t, e);
191
195
  }
192
- function qe(t, e) {
193
- const n = new we(
196
+ function en(t, e) {
197
+ const n = new xe(
194
198
  e.startLineNumber,
195
199
  e.startColumn,
196
200
  e.endLineNumber || e.startLineNumber,
@@ -200,12 +204,12 @@ function qe(t, e) {
200
204
  t.setSelection(n), t.revealRangeInCenter(n), t.focus();
201
205
  });
202
206
  }
203
- function Qe(t, e, n = 0) {
207
+ function nn(t, e, n = 0) {
204
208
  n > 0 && (e = n + e), Q(() => {
205
209
  t.setPosition({ lineNumber: e, column: 1 }), t.revealLineInCenter(e), t.focus();
206
210
  });
207
211
  }
208
- function _n(t, e, n) {
212
+ function et(t, e, n) {
209
213
  const r = t.getModel();
210
214
  if (r && e) {
211
215
  const a = r.getLineCount();
@@ -217,7 +221,7 @@ function _n(t, e, n) {
217
221
  }
218
222
  return 0;
219
223
  }
220
- const en = {
224
+ const tn = {
221
225
  provideCompletionItems: async (t, e) => {
222
226
  const n = t.getWordUntilPosition(e);
223
227
  return {
@@ -334,7 +338,7 @@ const en = {
334
338
  ]
335
339
  };
336
340
  }
337
- }, nn = {
341
+ }, on = {
338
342
  provideCompletionItems: async (t, e) => {
339
343
  const n = t.getWordUntilPosition(e);
340
344
  return {
@@ -449,7 +453,7 @@ const en = {
449
453
  ]
450
454
  };
451
455
  }
452
- }, tn = [
456
+ }, rn = [
453
457
  // zoom in
454
458
  {
455
459
  keybinding: B.CtrlCmd | G.NumpadAdd,
@@ -477,7 +481,7 @@ const en = {
477
481
  keybinding: B.CtrlCmd | G.Digit0,
478
482
  command: "editor.action.fontZoomReset"
479
483
  }
480
- ], on = ({ defaultZoom: t }) => (O(() => {
484
+ ], sn = ({ defaultZoom: t }) => (J(() => {
481
485
  t !== void 0 && q.EditorZoom.setZoomLevel(t);
482
486
  }, []), null);
483
487
  ({}).VITE_DISABLE_MONACO_LOADER || de.config({
@@ -486,7 +490,7 @@ const en = {
486
490
  // vs: "https://cdn.jsdelivr.net/npm/monaco-editor@0.41.0/min/vs",
487
491
  // },
488
492
  });
489
- const ee = z(void 0), qn = ({
493
+ const ee = z(void 0), nt = ({
490
494
  children: t,
491
495
  url: e,
492
496
  qodly: n,
@@ -496,26 +500,26 @@ const ee = z(void 0), qn = ({
496
500
  defaultInited: g = !1
497
501
  }) => {
498
502
  const u = ue(), [m, h] = D(g), [F, y] = D(null), A = P(), b = P(0);
499
- O(() => {
503
+ J(() => {
500
504
  e && u && v();
501
505
  }, [e, u]);
502
506
  const v = async () => {
503
507
  if (!u)
504
508
  return;
505
- const I = new Re({
509
+ const I = new We({
506
510
  enabled: process.env.NODE_ENV === "development",
507
511
  debugEnabled: process.env.NODE_ENV === "development"
508
- }), d = await ze({
512
+ }), d = await _e({
509
513
  logger: I
510
514
  });
511
515
  await be({
512
516
  caller: "Qodly Code Editor",
513
517
  logger: I,
514
518
  serviceConfig: d
515
- }), r && De.get(Ve).registerCodeEditorOpenHandler(r), u.languages.registerCompletionItemProvider(
519
+ }), r && Ve.get(Ye).registerCodeEditorOpenHandler(r), u.languages.registerCompletionItemProvider(
516
520
  a,
517
- n ? nn : en
518
- ), q.addKeybindingRules(tn), p();
521
+ n ? on : tn
522
+ ), q.addKeybindingRules(rn), p();
519
523
  }, p = () => {
520
524
  y(null);
521
525
  let I;
@@ -527,18 +531,18 @@ const ee = z(void 0), qn = ({
527
531
  }
528
532
  I.onopen = N, I.onclose = f, I.onerror = c, b.current = 0;
529
533
  }, N = async function() {
530
- const I = je(this), d = new Ue(I), C = new _e(I), E = new Ae({
534
+ const I = Xe(this), d = new qe(I), C = new Qe(I), E = new Ae({
531
535
  name: "4D Language Client",
532
536
  clientOptions: {
533
537
  workspaceFolder: {
534
- uri: xe.parse("file:///PACKAGE")
538
+ uri: Re.parse("file:///PACKAGE")
535
539
  },
536
540
  // use a language id as a document selector
537
541
  documentSelector: [{ scheme: "file", language: a }],
538
542
  // disable the default error handler
539
543
  errorHandler: {
540
- error: () => ({ action: We.Continue }),
541
- closed: () => ({ action: Le.DoNotRestart })
544
+ error: () => ({ action: Le.Continue }),
545
+ closed: () => ({ action: Fe.DoNotRestart })
542
546
  }
543
547
  },
544
548
  // create a language client connection from the JSON RPC connection on demand
@@ -564,7 +568,7 @@ const ee = z(void 0), qn = ({
564
568
  }, c = (I) => {
565
569
  y(I);
566
570
  };
567
- O(() => {
571
+ J(() => {
568
572
  const I = me.subscribe(({ action: d, payload: C }) => {
569
573
  switch (d) {
570
574
  case Z.WILL_SAVE:
@@ -595,9 +599,9 @@ const ee = z(void 0), qn = ({
595
599
  });
596
600
  return () => I.unsubscribe();
597
601
  }, []);
598
- const X = (I, d = Ke.Manual) => {
602
+ const X = (I, d = ke.Manual) => {
599
603
  var C;
600
- (C = A.current) == null || C.sendNotification(Xe.type, {
604
+ (C = A.current) == null || C.sendNotification(Ke.type, {
601
605
  textDocument: {
602
606
  uri: L(I)
603
607
  },
@@ -605,7 +609,7 @@ const ee = z(void 0), qn = ({
605
609
  });
606
610
  }, s = (I, d) => {
607
611
  var C;
608
- (C = A.current) == null || C.sendNotification(ke.type, {
612
+ (C = A.current) == null || C.sendNotification(Ee.type, {
609
613
  textDocument: {
610
614
  uri: L(I)
611
615
  },
@@ -613,7 +617,7 @@ const ee = z(void 0), qn = ({
613
617
  });
614
618
  }, l = (I) => {
615
619
  var d;
616
- (d = A.current) == null || d.sendRequest(Ee.type, {
620
+ (d = A.current) == null || d.sendRequest(Be.type, {
617
621
  files: [
618
622
  {
619
623
  uri: L(I)
@@ -622,7 +626,7 @@ const ee = z(void 0), qn = ({
622
626
  });
623
627
  }, w = (I, d) => {
624
628
  var C;
625
- (C = A.current) == null || C.sendRequest(Be.type, {
629
+ (C = A.current) == null || C.sendRequest(Ge.type, {
626
630
  files: [
627
631
  {
628
632
  oldUri: L(I),
@@ -632,7 +636,7 @@ const ee = z(void 0), qn = ({
632
636
  });
633
637
  }, R = (I) => {
634
638
  var d;
635
- (d = A.current) == null || d.sendRequest(Ge.type, {
639
+ (d = A.current) == null || d.sendRequest(Oe.type, {
636
640
  files: [
637
641
  {
638
642
  uri: L(I)
@@ -650,7 +654,7 @@ const ee = z(void 0), qn = ({
650
654
  });
651
655
  }, W = (I, d) => {
652
656
  var C;
653
- (C = A.current) == null || C.sendNotification(Oe.type, {
657
+ (C = A.current) == null || C.sendNotification(Te.type, {
654
658
  files: [
655
659
  {
656
660
  oldUri: L(I),
@@ -660,7 +664,7 @@ const ee = z(void 0), qn = ({
660
664
  });
661
665
  }, re = (I) => {
662
666
  var d;
663
- (d = A.current) == null || d.sendNotification(Te.type, {
667
+ (d = A.current) == null || d.sendNotification(De.type, {
664
668
  files: [
665
669
  {
666
670
  uri: L(I)
@@ -668,7 +672,7 @@ const ee = z(void 0), qn = ({
668
672
  ]
669
673
  });
670
674
  };
671
- return /* @__PURE__ */ J(
675
+ return /* @__PURE__ */ O(
672
676
  ee.Provider,
673
677
  {
674
678
  value: {
@@ -679,12 +683,12 @@ const ee = z(void 0), qn = ({
679
683
  },
680
684
  children: [
681
685
  t,
682
- /* @__PURE__ */ S(on, { defaultZoom: i })
686
+ /* @__PURE__ */ S(sn, { defaultZoom: i })
683
687
  ]
684
688
  }
685
689
  );
686
690
  };
687
- function Qn() {
691
+ function tt() {
688
692
  const t = U(ee);
689
693
  if (t === void 0)
690
694
  throw new Error("useLSP must be used within an LSPContext");
@@ -692,7 +696,7 @@ function Qn() {
692
696
  }
693
697
  const ne = z(
694
698
  void 0
695
- ), et = Ie(({ children: t }) => {
699
+ ), it = Ie(({ children: t }) => {
696
700
  const [e, n] = D(null);
697
701
  return /* @__PURE__ */ S(
698
702
  ne.Provider,
@@ -705,7 +709,7 @@ const ne = z(
705
709
  }
706
710
  );
707
711
  });
708
- function rn() {
712
+ function ln() {
709
713
  const t = U(ne), e = D(null);
710
714
  if (t === void 0) {
711
715
  const [n, i] = e;
@@ -731,7 +735,7 @@ var te = {
731
735
  }
732
736
  return t;
733
737
  }, j.apply(this, arguments);
734
- }, sn = globalThis && globalThis.__rest || function(t, e) {
738
+ }, an = globalThis && globalThis.__rest || function(t, e) {
735
739
  var n = {};
736
740
  for (var i in t)
737
741
  Object.prototype.hasOwnProperty.call(t, i) && e.indexOf(i) < 0 && (n[i] = t[i]);
@@ -749,14 +753,14 @@ function ie(t) {
749
753
  }
750
754
  function oe(t) {
751
755
  return function(e) {
752
- return K.createElement(ln, j({
756
+ return K.createElement(gn, j({
753
757
  attr: j({}, t.attr)
754
758
  }, e), ie(t.child));
755
759
  };
756
760
  }
757
- function ln(t) {
761
+ function gn(t) {
758
762
  var e = function(n) {
759
- var i = t.attr, r = t.size, a = t.title, g = sn(t, ["attr", "size", "title"]), u = r || n.size || "1em", m;
763
+ var i = t.attr, r = t.size, a = t.title, g = an(t, ["attr", "size", "title"]), u = r || n.size || "1em", m;
760
764
  return n.className && (m = n.className), t.className && (m = (m ? m + " " : "") + t.className), K.createElement("svg", j({
761
765
  stroke: "currentColor",
762
766
  fill: "currentColor",
@@ -775,24 +779,24 @@ function ln(t) {
775
779
  return e(n);
776
780
  }) : e(te);
777
781
  }
778
- function an(t) {
782
+ function cn(t) {
779
783
  return oe({ tag: "svg", attr: { viewBox: "0 0 24 24" }, child: [{ tag: "path", attr: { d: "M12 22C6.47715 22 2 17.5228 2 12C2 6.47715 6.47715 2 12 2C17.5228 2 22 6.47715 22 12C22 17.5228 17.5228 22 12 22ZM12 10.5858L9.17157 7.75736L7.75736 9.17157L10.5858 12L7.75736 14.8284L9.17157 16.2426L12 13.4142L14.8284 16.2426L16.2426 14.8284L13.4142 12L16.2426 9.17157L14.8284 7.75736L12 10.5858Z" } }] })(t);
780
784
  }
781
- function gn(t) {
785
+ function In(t) {
782
786
  return oe({ tag: "svg", attr: { viewBox: "0 0 512 512" }, child: [{ tag: "path", attr: { d: "M449.07 399.08L278.64 82.58c-12.08-22.44-44.26-22.44-56.35 0L51.87 399.08A32 32 0 0080 446.25h340.89a32 32 0 0028.18-47.17zm-198.6-1.83a20 20 0 1120-20 20 20 0 01-20 20zm21.72-201.15l-5.74 122a16 16 0 01-32 0l-5.74-121.95a21.73 21.73 0 0121.5-22.69h.21a21.74 21.74 0 0121.73 22.7z" } }] })(t);
783
787
  }
784
- const cn = ({ lspProps: { lastError: t, reload: e } }) => {
788
+ const dn = ({ lspProps: { lastError: t, reload: e } }) => {
785
789
  const [n, i] = D(!1), r = () => {
786
790
  e();
787
791
  }, a = () => {
788
792
  i(!1);
789
793
  };
790
- return O(() => {
794
+ return J(() => {
791
795
  i(!!t);
792
- }, [t]), n ? /* @__PURE__ */ J("div", { className: "flex items-center border-b border-fd-gray-darker bg-grey-800 px-2 py-1.5 text-xs text-grey-50", children: [
793
- /* @__PURE__ */ J("span", { className: "flex flex-1 justify-center gap-1", children: [
794
- /* @__PURE__ */ S(gn, { className: "h-4 w-4 text-yellow-600" }),
795
- /* @__PURE__ */ J("span", { children: [
796
+ }, [t]), n ? /* @__PURE__ */ O("div", { className: "flex items-center border-b border-fd-gray-darker bg-grey-800 px-2 py-1.5 text-xs text-grey-50", children: [
797
+ /* @__PURE__ */ O("span", { className: "flex flex-1 justify-center gap-1", children: [
798
+ /* @__PURE__ */ S(In, { className: "h-4 w-4 text-yellow-600" }),
799
+ /* @__PURE__ */ O("span", { children: [
796
800
  "LSP not loaded.",
797
801
  " ",
798
802
  /* @__PURE__ */ S(
@@ -806,14 +810,14 @@ const cn = ({ lspProps: { lastError: t, reload: e } }) => {
806
810
  ] })
807
811
  ] }),
808
812
  /* @__PURE__ */ S("button", { className: "focus:outline-none", children: /* @__PURE__ */ S(
809
- an,
813
+ cn,
810
814
  {
811
815
  className: "h-4 w-4 text-white",
812
816
  onClick: a
813
817
  }
814
818
  ) })
815
819
  ] }) : null;
816
- }, In = {
820
+ }, un = {
817
821
  provideCompletionItems: (t, e) => {
818
822
  const n = t.getWordUntilPosition(e);
819
823
  return {
@@ -841,7 +845,7 @@ const cn = ({ lspProps: { lastError: t, reload: e } }) => {
841
845
  ]
842
846
  };
843
847
  }
844
- }, dn = "#/definitions/Condition", un = {
848
+ }, Cn = "#/definitions/Condition", mn = {
845
849
  Base: {
846
850
  type: "object",
847
851
  properties: {
@@ -1109,20 +1113,20 @@ const cn = ({ lspProps: { lastError: t, reload: e } }) => {
1109
1113
  "ref"
1110
1114
  ]
1111
1115
  }
1112
- }, Cn = {
1113
- $ref: dn,
1114
- definitions: un
1116
+ }, fn = {
1117
+ $ref: Cn,
1118
+ definitions: mn
1115
1119
  };
1116
- function mn(t, e) {
1120
+ function An(t, e) {
1117
1121
  const n = document.createElement("style");
1118
1122
  n.dataset.id = e, n.textContent = t, document.head.append(n);
1119
1123
  }
1120
- function fn(t) {
1124
+ function pn(t) {
1121
1125
  return Array.from(document.styleSheets).find(
1122
1126
  (e) => e.ownerNode.getAttribute("data-id") === t
1123
1127
  );
1124
1128
  }
1125
- function An(t, e) {
1129
+ function bn(t, e) {
1126
1130
  const n = [];
1127
1131
  let i = [];
1128
1132
  const r = [], a = (s, l, w, R) => {
@@ -1146,7 +1150,7 @@ function An(t, e) {
1146
1150
  }
1147
1151
  }, h = () => {
1148
1152
  const s = t.getModel();
1149
- s && (i = bn(
1153
+ s && (i = vn(
1150
1154
  n.map((l) => [
1151
1155
  s.getOffsetAt({
1152
1156
  lineNumber: l.startLineNumber,
@@ -1197,7 +1201,7 @@ function An(t, e) {
1197
1201
  `;
1198
1202
  if (p) {
1199
1203
  const s = "monaco-read-only";
1200
- fn(s) || mn(p, s), p = null;
1204
+ pn(s) || An(p, s), p = null;
1201
1205
  }
1202
1206
  const N = () => {
1203
1207
  g(c), c();
@@ -1235,7 +1239,7 @@ function An(t, e) {
1235
1239
  hide: f
1236
1240
  };
1237
1241
  }
1238
- function pn(t, e, n) {
1242
+ function hn(t, e, n) {
1239
1243
  let i = !1;
1240
1244
  const r = (f) => f[1] < f[0] ? (i = !0, [[f[1], f[0]]]) : [[...f]], a = (f) => i ? f.map((c) => c[1] > c[0] ? u(c) : c).reverse() : f;
1241
1245
  let g;
@@ -1262,7 +1266,7 @@ function pn(t, e, n) {
1262
1266
  }
1263
1267
  return a(m);
1264
1268
  }
1265
- function bn(t, e) {
1269
+ function vn(t, e) {
1266
1270
  if (t.length < 2)
1267
1271
  return t;
1268
1272
  const n = [];
@@ -1277,7 +1281,7 @@ function bn(t, e) {
1277
1281
  function T(t, e) {
1278
1282
  return e.bind(t);
1279
1283
  }
1280
- class hn {
1284
+ class Sn {
1281
1285
  constructor(e, n) {
1282
1286
  x(this, "editor");
1283
1287
  x(this, "intervals");
@@ -1337,7 +1341,7 @@ class hn {
1337
1341
  return n[0] - e < e - n[1] ? n[0] : n[1];
1338
1342
  }));
1339
1343
  var i;
1340
- this.editor = e, this.intervals = An(e, n), (i = this.editor.getModel()) == null || i.setEOL(o.editor.EndOfLineSequence.LF);
1344
+ this.editor = e, this.intervals = bn(e, n), (i = this.editor.getModel()) == null || i.setEOL(o.editor.EndOfLineSequence.LF);
1341
1345
  }
1342
1346
  enable() {
1343
1347
  this.disposables.push(
@@ -1357,7 +1361,7 @@ class hn {
1357
1361
  getApprovedSelections() {
1358
1362
  const e = this.editor.getModel();
1359
1363
  return this.getSelections().map(
1360
- (i) => pn(
1364
+ (i) => hn(
1361
1365
  i,
1362
1366
  this.intervals.buffer,
1363
1367
  this.prefer
@@ -1386,13 +1390,13 @@ class hn {
1386
1390
  ]);
1387
1391
  }
1388
1392
  }
1389
- const vn = new RegExp("^[ s]+(exposed|Function)", "i"), $ = () => /* @__PURE__ */ S("div", { className: "absolute inset-0 animate-pulse", children: /* @__PURE__ */ S("div", { className: "w-full space-y-4 px-4 py-1", children: /* @__PURE__ */ J("div", { className: "space-y-2", children: [
1393
+ const yn = new RegExp("^[ s]+(exposed|Function)", "i"), $ = () => /* @__PURE__ */ S("div", { className: "absolute inset-0 animate-pulse", children: /* @__PURE__ */ S("div", { className: "w-full space-y-4 px-4 py-1", children: /* @__PURE__ */ O("div", { className: "space-y-2", children: [
1390
1394
  /* @__PURE__ */ S("div", { className: "h-3 w-3/4 rounded bg-grey-200" }),
1391
1395
  /* @__PURE__ */ S("div", { className: "h-3 rounded bg-grey-200" }),
1392
1396
  /* @__PURE__ */ S("div", { className: "h-3 w-5/6 rounded bg-grey-200" }),
1393
1397
  /* @__PURE__ */ S("div", { className: "h-3 rounded bg-grey-200" }),
1394
1398
  /* @__PURE__ */ S("div", { className: "h-3 rounded bg-grey-200" })
1395
- ] }) }) }), nt = ({
1399
+ ] }) }) }), ot = ({
1396
1400
  path: t,
1397
1401
  initialValue: e,
1398
1402
  theme: n = "fd-dark",
@@ -1405,15 +1409,15 @@ const vn = new RegExp("^[ s]+(exposed|Function)", "i"), $ = () => /* @__PURE__ *
1405
1409
  lspProps: h,
1406
1410
  ...F
1407
1411
  }) => {
1408
- const { initialLineInfo: y, initialSelectionInfo: A } = u, { editor: b, setEditor: v } = rn(), { inited: p } = h;
1412
+ const { initialLineInfo: y, initialSelectionInfo: A } = u, { editor: b, setEditor: v } = ln(), { inited: p } = h;
1409
1413
  function N(c) {
1410
- r === "css" && c.languages.registerCompletionItemProvider("css", In), r === "json" && c.languages.json && c.languages.json.jsonDefaults.setDiagnosticsOptions({
1414
+ r === "css" && c.languages.registerCompletionItemProvider("css", un), r === "json" && c.languages.json && c.languages.json.jsonDefaults.setDiagnosticsOptions({
1411
1415
  validate: !0,
1412
1416
  schemas: [
1413
1417
  {
1414
1418
  uri: "condition-schema.json",
1415
1419
  fileMatch: ["*.condition.json"],
1416
- schema: Cn
1420
+ schema: fn
1417
1421
  }
1418
1422
  ]
1419
1423
  });
@@ -1426,7 +1430,7 @@ const vn = new RegExp("^[ s]+(exposed|Function)", "i"), $ = () => /* @__PURE__ *
1426
1430
  const l = (w = c.getPosition()) == null ? void 0 : w.lineNumber;
1427
1431
  if (l) {
1428
1432
  const R = s.getLineFirstNonWhitespaceColumn(l), k = s.getLineLength(l), W = s.getLineContent(l);
1429
- vn.test(W) && c.executeEdits("edit-handler", [
1433
+ yn.test(W) && c.executeEdits("edit-handler", [
1430
1434
  {
1431
1435
  range: new X.Range(
1432
1436
  l,
@@ -1442,22 +1446,22 @@ const vn = new RegExp("^[ s]+(exposed|Function)", "i"), $ = () => /* @__PURE__ *
1442
1446
  ]);
1443
1447
  }
1444
1448
  })), i === fe.METHOD && _(e)) {
1445
- const l = new hn(c, !0);
1449
+ const l = new Sn(c, !0);
1446
1450
  l.exclude(1, 1, 1, Number.POSITIVE_INFINITY), l.enable();
1447
1451
  }
1448
1452
  }
1449
- return O(() => {
1453
+ return J(() => {
1450
1454
  if (!b)
1451
1455
  return;
1452
1456
  const { line: c, offset: X } = y || {};
1453
- c && Qe(b, c, X);
1454
- }, [y, b]), O(() => {
1457
+ c && nn(b, c, X);
1458
+ }, [y, b]), J(() => {
1455
1459
  if (!b)
1456
1460
  return;
1457
1461
  const { selection: c } = A || {};
1458
- c && qe(b, c);
1459
- }, [A, b]), p ? /* @__PURE__ */ J(ce, { children: [
1460
- m ? /* @__PURE__ */ S(cn, { lspProps: h }) : null,
1462
+ c && en(b, c);
1463
+ }, [A, b]), p ? /* @__PURE__ */ O(ce, { children: [
1464
+ m ? /* @__PURE__ */ S(dn, { lspProps: h }) : null,
1461
1465
  /* @__PURE__ */ S(
1462
1466
  Ce,
1463
1467
  {
@@ -1480,7 +1484,7 @@ const vn = new RegExp("^[ s]+(exposed|Function)", "i"), $ = () => /* @__PURE__ *
1480
1484
  }
1481
1485
  )
1482
1486
  ] }) : /* @__PURE__ */ S($, {});
1483
- }, Sn = {
1487
+ }, Nn = {
1484
1488
  name: "4d",
1485
1489
  displayName: "%displayName%",
1486
1490
  description: "%description%",
@@ -1505,7 +1509,7 @@ const vn = new RegExp("^[ s]+(exposed|Function)", "i"), $ = () => /* @__PURE__ *
1505
1509
  }
1506
1510
  ]
1507
1511
  }
1508
- }, { registerFileUrl: V, whenReady: tt } = Ye(Sn, void 0, {
1512
+ }, { registerFileUrl: V, whenReady: rt } = Me(Nn, void 0, {
1509
1513
  system: !0
1510
1514
  });
1511
1515
  V(
@@ -1529,18 +1533,18 @@ V(
1529
1533
  { mimeType: "application/json", size: 135 }
1530
1534
  );
1531
1535
  export {
1532
- cn as Alerts,
1533
- nt as CodeEditor,
1534
- et as CodeEditorProvider,
1535
- qn as LSPProvider,
1536
+ dn as Alerts,
1537
+ ot as CodeEditor,
1538
+ it as CodeEditorProvider,
1539
+ nt as LSPProvider,
1536
1540
  Q as _await,
1537
- ze as configureServices,
1541
+ _e as configureServices,
1538
1542
  L as getFileSystemPath,
1539
- _n as getFunctionOffset,
1540
- $e as initMonacoUserConfiguration,
1541
- Qe as jumpToLine,
1542
- qe as jumpToSelection,
1543
- rn as useCodeEditor,
1544
- Qn as useLSP
1543
+ et as getFunctionOffset,
1544
+ Ue as initMonacoUserConfiguration,
1545
+ nn as jumpToLine,
1546
+ en as jumpToSelection,
1547
+ ln as useCodeEditor,
1548
+ tt as useLSP
1545
1549
  };
1546
1550
  //# sourceMappingURL=index.es.js.map