@m4l/components 9.24.0-beta-feature-731-m4l-components-code-editor.5 → 9.24.0-beta-feature-731-m4l-components-code-editor.6

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.
@@ -67,15 +67,15 @@ const V = K.languages, ct = {}, lt = {}, j = /* @__PURE__ */ new WeakMap(), At =
67
67
  reservedWords: [...S.reservedWords]
68
68
  }
69
69
  };
70
- function Nt(t, e) {
71
- return [...Q(t, e).bracketPalette];
70
+ function Nt(t) {
71
+ return [...Q(t).bracketPalette];
72
72
  }
73
- function Rt(t, e) {
74
- const n = Q(t, e);
73
+ function Rt(t) {
74
+ const e = Q(t);
75
75
  return {
76
- constant: n.syntax.constant,
77
- type: n.syntax.type,
78
- variable: n.syntax.variable
76
+ constant: e.syntax.constant,
77
+ type: e.syntax.type,
78
+ variable: e.syntax.variable
79
79
  };
80
80
  }
81
81
  function Pt(t) {
@@ -127,15 +127,15 @@ function wt(t, e, n = "") {
127
127
  function Dt(t) {
128
128
  return t.length > 1 && t === t.toUpperCase() && /[A-Z]/.test(t);
129
129
  }
130
- function Mt(t) {
130
+ function $t(t) {
131
131
  return /^[A-Z][A-Za-z0-9]*$/.test(t) && t !== t.toUpperCase();
132
132
  }
133
- function $t(t, e) {
133
+ function zt(t, e) {
134
134
  return t === ">" && e === "<" ? !1 : [t, e].some(
135
135
  (n) => !!n && (Lt.has(n) || kt.test(n))
136
136
  );
137
137
  }
138
- function zt(t) {
138
+ function Mt(t) {
139
139
  if (t.some((e) => ["constant", "symbol"].includes(e)))
140
140
  return "constant";
141
141
  if (t.some((e) => [
@@ -162,11 +162,11 @@ function Gt({
162
162
  previousIdentifierGroup: n,
163
163
  previousSignificantText: r
164
164
  }) {
165
- if ($t(
165
+ if (zt(
166
166
  r,
167
167
  e
168
168
  ))
169
- return r === "." && n === "type" || Dt(t) ? "constant" : Mt(t) && (e === "." || e === "(" || r && _t.has(r)) ? "type" : "variable";
169
+ return r === "." && n === "type" || Dt(t) ? "constant" : $t(t) && (e === "." || e === "(" || r && _t.has(r)) ? "type" : "variable";
170
170
  }
171
171
  function I(t, e, n) {
172
172
  const r = X(e);
@@ -414,10 +414,10 @@ function Kt(t, e) {
414
414
  ).line - 1
415
415
  );
416
416
  if (i.trim()) {
417
- const l = q(o)[s] || 0, M = i.length - i.trimStart().length;
417
+ const l = q(o)[s] || 0, $ = i.length - i.trimStart().length;
418
418
  return w(
419
419
  t,
420
- l + M,
420
+ l + $,
421
421
  n + 1
422
422
  );
423
423
  }
@@ -719,129 +719,129 @@ function le(t, e, n) {
719
719
  text: t.slice(c)
720
720
  }), a.filter((l) => l.text.length > 0);
721
721
  }
722
- function Se(t, e) {
723
- const n = Q(t, e), r = Rt(t, e);
722
+ function Se(t = "light") {
723
+ const e = Q(t), n = Rt(t);
724
724
  return {
725
725
  plain: {
726
726
  backgroundColor: "transparent",
727
- color: n.surface.editorForeground
727
+ color: e.surface.editorForeground
728
728
  },
729
- bracketPalette: Nt(t, e),
730
- semanticPalette: r,
729
+ bracketPalette: Nt(t),
730
+ semanticPalette: n,
731
731
  styles: [
732
732
  {
733
733
  types: ["comment", "prolog", "doctype", "cdata"],
734
734
  style: {
735
- color: n.syntax.comment,
735
+ color: e.syntax.comment,
736
736
  fontStyle: "italic"
737
737
  }
738
738
  },
739
739
  {
740
740
  types: ["punctuation"],
741
741
  style: {
742
- color: n.surface.editorForeground
742
+ color: e.surface.editorForeground
743
743
  }
744
744
  },
745
745
  {
746
746
  types: ["operator"],
747
747
  style: {
748
- color: n.syntax.operator
748
+ color: e.syntax.operator
749
749
  }
750
750
  },
751
751
  {
752
752
  types: ["property", "literal-property", "selector"],
753
753
  style: {
754
- color: r.variable
754
+ color: n.variable
755
755
  }
756
756
  },
757
757
  {
758
758
  types: ["attr-name"],
759
759
  style: {
760
- color: n.syntax.attributeName
760
+ color: e.syntax.attributeName
761
761
  }
762
762
  },
763
763
  {
764
764
  types: ["tag"],
765
765
  style: {
766
- color: n.syntax.tag
766
+ color: e.syntax.tag
767
767
  }
768
768
  },
769
769
  {
770
770
  types: ["boolean"],
771
771
  style: {
772
- color: n.syntax.boolean
772
+ color: e.syntax.boolean
773
773
  }
774
774
  },
775
775
  {
776
776
  types: ["number"],
777
777
  style: {
778
- color: n.syntax.number
778
+ color: e.syntax.number
779
779
  }
780
780
  },
781
781
  {
782
782
  types: ["symbol"],
783
783
  style: {
784
- color: n.syntax.constant
784
+ color: e.syntax.constant
785
785
  }
786
786
  },
787
787
  {
788
788
  types: ["atrule"],
789
789
  style: {
790
- color: n.syntax.keyword
790
+ color: e.syntax.keyword
791
791
  }
792
792
  },
793
793
  {
794
794
  types: ["constant"],
795
795
  style: {
796
- color: r.constant
796
+ color: n.constant
797
797
  }
798
798
  },
799
799
  {
800
800
  types: ["string", "char", "inserted"],
801
801
  style: {
802
- color: n.syntax.string
802
+ color: e.syntax.string
803
803
  }
804
804
  },
805
805
  {
806
806
  types: ["regex"],
807
807
  style: {
808
- color: n.syntax.regex
808
+ color: e.syntax.regex
809
809
  }
810
810
  },
811
811
  {
812
812
  types: ["constant.character.escape"],
813
813
  style: {
814
- color: n.syntax.escape
814
+ color: e.syntax.escape
815
815
  }
816
816
  },
817
817
  {
818
818
  types: ["keyword"],
819
819
  style: {
820
- color: n.syntax.keyword
820
+ color: e.syntax.keyword
821
821
  }
822
822
  },
823
823
  {
824
824
  types: ["function", "function-variable", "method", "method-variable"],
825
825
  style: {
826
- color: n.syntax.function
826
+ color: e.syntax.function
827
827
  }
828
828
  },
829
829
  {
830
830
  types: ["builtin", "class-name", "known-class-name", "maybe-class-name"],
831
831
  style: {
832
- color: r.type
832
+ color: n.type
833
833
  }
834
834
  },
835
835
  {
836
836
  types: ["alias", "imports", "parameter", "variable"],
837
837
  style: {
838
- color: r.variable
838
+ color: n.variable
839
839
  }
840
840
  },
841
841
  {
842
842
  types: ["deleted"],
843
843
  style: {
844
- color: n.surface.errorBorderColor
844
+ color: e.surface.errorBorderColor
845
845
  }
846
846
  }
847
847
  ]
@@ -861,12 +861,12 @@ function ve({
861
861
  customLanguages: e,
862
862
  languageTemplate: i
863
863
  }), l = t.split(`
864
- `), M = q(l), C = jt(
864
+ `), $ = q(l), C = jt(
865
865
  t,
866
866
  o
867
867
  ), dt = ce(c, a);
868
868
  return !a || c === at ? /* @__PURE__ */ d(st, { children: l.map((L, _) => {
869
- const k = M[_] || 0, N = A(
869
+ const k = $[_] || 0, N = A(
870
870
  C,
871
871
  k,
872
872
  k + L.length
@@ -880,14 +880,14 @@ function ve({
880
880
  {
881
881
  className: "token-line",
882
882
  "data-code-editor-error-line": N || void 0,
883
- children: R.map(($, z) => /* @__PURE__ */ d(
883
+ children: R.map((z, M) => /* @__PURE__ */ d(
884
884
  "span",
885
885
  {
886
886
  className: "token plain",
887
- "data-code-editor-error-token": $.hasError || void 0,
888
- children: $.text || " "
887
+ "data-code-editor-error-token": z.hasError || void 0,
888
+ children: z.text || " "
889
889
  },
890
- `plain-line-${_}-segment-${z}`
890
+ `plain-line-${_}-segment-${M}`
891
891
  ))
892
892
  },
893
893
  `plain-line-${_}`
@@ -900,11 +900,11 @@ function ve({
900
900
  prism: dt,
901
901
  theme: s,
902
902
  children: ({ tokens: L, getLineProps: _, getTokenProps: k }) => {
903
- const N = s.bracketPalette, R = s.semanticPalette, $ = !!R && Pt(c);
904
- let z = 0;
903
+ const N = s.bracketPalette, R = s.semanticPalette, z = !!R && Pt(c);
904
+ let M = 0;
905
905
  const x = {};
906
906
  return /* @__PURE__ */ d(st, { children: L.map((W, O) => {
907
- const H = M[O] || 0, mt = l[O] || "", pt = A(
907
+ const H = $[O] || 0, mt = l[O] || "", pt = A(
908
908
  C,
909
909
  H,
910
910
  H + mt.length
@@ -923,10 +923,10 @@ function ve({
923
923
  ht
924
924
  );
925
925
  et += u.content.length;
926
- const p = k({ token: u }), nt = zt(
926
+ const p = k({ token: u }), nt = Mt(
927
927
  u.types
928
928
  );
929
- if ($ && u.types.includes("plain") && u.content.trim()) {
929
+ if (z && u.types.includes("plain") && u.content.trim()) {
930
930
  const g = It(u.content);
931
931
  if (g.some((h) => h.isIdentifier)) {
932
932
  let h = 0;
@@ -1013,8 +1013,8 @@ function ve({
1013
1013
  const {
1014
1014
  nextBracketDepth: F,
1015
1015
  renderedBracketDepth: P
1016
- } = Ut(g, z);
1017
- return z = F, I(x, g), /* @__PURE__ */ d(
1016
+ } = Ut(g, M);
1017
+ return M = F, I(x, g), /* @__PURE__ */ d(
1018
1018
  "span",
1019
1019
  {
1020
1020
  className: p.className,