@kong-ui-public/monaco-editor 0.1.1 → 0.1.2-pr.2609.2ce4f4787.0

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.
Files changed (100) hide show
  1. package/dist/abap-D0Neqhq6.js +1404 -0
  2. package/dist/apex-B5LhxkeG.js +332 -0
  3. package/dist/azcli-BrBH0QTU.js +74 -0
  4. package/dist/bat-BfzAov64.js +106 -0
  5. package/dist/bicep-C3bCSWel.js +108 -0
  6. package/dist/cameligo-sFL5plcd.js +180 -0
  7. package/dist/clojure-CfeExRz0.js +767 -0
  8. package/dist/coffee-Xws5K0WL.js +238 -0
  9. package/dist/cpp-CqOUEpxN.js +395 -0
  10. package/dist/csharp-DVLiBOZb.js +332 -0
  11. package/dist/csp-DVFp9bw5.js +59 -0
  12. package/dist/css-DwARn2R6.js +193 -0
  13. package/dist/cssMode-BRHW0OjB.js +1577 -0
  14. package/dist/cypher-uY0Mffat.js +269 -0
  15. package/dist/dart-D27H-mX_.js +287 -0
  16. package/dist/dockerfile-CmV85WZK.js +136 -0
  17. package/dist/ecl--fKn7yzB.js +462 -0
  18. package/dist/editor.main-BVWEsGeM.js +112170 -0
  19. package/dist/elixir-DUhH17ON.js +575 -0
  20. package/dist/flow9-B3Dx2LLe.js +148 -0
  21. package/dist/freemarker2-DrnILGvf.js +995 -0
  22. package/dist/fsharp-SyqBfUAR.js +223 -0
  23. package/dist/go-BbMR2tdT.js +224 -0
  24. package/dist/graphql-DDJE6tIl.js +157 -0
  25. package/dist/handlebars-D2vGkdp7.js +425 -0
  26. package/dist/hcl-YBvpaUqf.js +189 -0
  27. package/dist/html-D3HI-WFO.js +314 -0
  28. package/dist/htmlMode-CNpiDTvN.js +1587 -0
  29. package/dist/ini-Ct73dBtM.js +77 -0
  30. package/dist/java-C_jlkwoG.js +238 -0
  31. package/dist/javascript-DLZMP-Wa.js +76 -0
  32. package/dist/jsonMode-CEQtUpLb.js +2002 -0
  33. package/dist/julia-D8WE5U1e.js +517 -0
  34. package/dist/kotlin-Zy9aq5yB.js +259 -0
  35. package/dist/less-sZ0iHtE8.js +168 -0
  36. package/dist/lexon-CsdNL29A.js +163 -0
  37. package/dist/liquid-CnqLoV0A.js +246 -0
  38. package/dist/lua-C2YJo0zw.js +168 -0
  39. package/dist/m3-CPLP40SG.js +216 -0
  40. package/dist/markdown-B1mf5e0R.js +235 -0
  41. package/dist/mdx-C6hXTTY6.js +171 -0
  42. package/dist/mips-DA33BZX1.js +204 -0
  43. package/dist/monaco-editor.es.js +224 -14
  44. package/dist/monaco-editor.umd.js +1913 -1
  45. package/dist/msdax-CCYFIQsP.js +381 -0
  46. package/dist/mysql-hjmIjL-D.js +884 -0
  47. package/dist/objective-c-RRCpEmqC.js +189 -0
  48. package/dist/pascal-CeV8XfxB.js +257 -0
  49. package/dist/pascaligo-IEEGVJAJ.js +170 -0
  50. package/dist/perl-B5-QbHq_.js +632 -0
  51. package/dist/pgsql-s6kqEJmi.js +857 -0
  52. package/dist/php-CWWqzOo8.js +506 -0
  53. package/dist/pla-FSvb_YP_.js +143 -0
  54. package/dist/postiats-DQdscQXO.js +913 -0
  55. package/dist/powerquery-CtA5JA1I.js +896 -0
  56. package/dist/powershell-DglEq96N.js +245 -0
  57. package/dist/protobuf-BSepub3e.js +426 -0
  58. package/dist/pug-B1847F4G.js +408 -0
  59. package/dist/python-CGI_fE8F.js +307 -0
  60. package/dist/qsharp-D4i0Nqg9.js +307 -0
  61. package/dist/r-cdRigKxa.js +249 -0
  62. package/dist/razor-DNVpjohl.js +556 -0
  63. package/dist/redis-D9MFxvE8.js +308 -0
  64. package/dist/redshift-CmCnsvL-.js +815 -0
  65. package/dist/restructuredtext-CWy8J51t.js +180 -0
  66. package/dist/ruby-WP-c36m5.js +517 -0
  67. package/dist/rust-Q9FLdYpu.js +349 -0
  68. package/dist/sb-C54-JBGT.js +121 -0
  69. package/dist/scala-CzbFImc5.js +376 -0
  70. package/dist/scheme-BhfDmYN3.js +114 -0
  71. package/dist/scss-CEmiBXpS.js +268 -0
  72. package/dist/shell-Bmc1VhG0.js +227 -0
  73. package/dist/solidity-C9Q2I8Hh.js +1373 -0
  74. package/dist/sophia-jWa1UyKz.js +205 -0
  75. package/dist/sparql-CM7jctbc.js +207 -0
  76. package/dist/sql-WzihTkbg.js +859 -0
  77. package/dist/st-6y7_3aup.js +422 -0
  78. package/dist/style.css +1 -0
  79. package/dist/swift-k-0zxG_D.js +318 -0
  80. package/dist/systemverilog-Pnr5_rIP.js +582 -0
  81. package/dist/tcl-fNPXval8.js +238 -0
  82. package/dist/tsMode-CRUDJ1Gx.js +895 -0
  83. package/dist/twig-L2MkztkV.js +398 -0
  84. package/dist/types/composables/useMonacoEditor.d.ts +25 -0
  85. package/dist/types/composables/useMonacoEditor.d.ts.map +1 -0
  86. package/dist/types/constants/index.d.ts +3 -0
  87. package/dist/types/constants/index.d.ts.map +1 -0
  88. package/dist/types/index.d.ts +1 -0
  89. package/dist/types/index.d.ts.map +1 -1
  90. package/dist/types/tests/mocks/monaco-editor-api.d.ts +78 -0
  91. package/dist/types/tests/mocks/monaco-editor-api.d.ts.map +1 -0
  92. package/dist/types/types/index.d.ts +68 -1
  93. package/dist/types/types/index.d.ts.map +1 -1
  94. package/dist/typescript-C2FvJtQm.js +349 -0
  95. package/dist/typespec-Cqqo-3Pt.js +123 -0
  96. package/dist/vb-B5YC2xN9.js +378 -0
  97. package/dist/wgsl-B-_uRex7.js +445 -0
  98. package/dist/xml-e_XsfZP6.js +101 -0
  99. package/dist/yaml-DOzdDlyx.js +212 -0
  100. package/package.json +14 -8
@@ -1,20 +1,230 @@
1
- import { createElementBlock as a, openBlock as i, createElementVNode as n, createTextVNode as c } from "vue";
2
- const _ = (t, o) => {
3
- const e = t.__vccOpts || t;
4
- for (const [r, s] of o)
5
- e[r] = s;
1
+ import { createElementBlock as T, openBlock as x, createElementVNode as b, createTextVNode as M, toValue as _, reactive as F, ref as W, onMounted as k, onActivated as N, onBeforeUnmount as U, watch as B } from "vue";
2
+ const L = (n, t) => {
3
+ const e = n.__vccOpts || n;
4
+ for (const [r, a] of t)
5
+ e[r] = a;
6
6
  return e;
7
- }, d = {}, l = { class: "kong-ui-public-monaco-editor" };
8
- function p(t, o) {
9
- return i(), a("div", l, [...o[0] || (o[0] = [
10
- n("p", null, [
11
- c("This is the "),
12
- n("b", null, "MonacoEditor"),
13
- c(" content.")
7
+ }, R = {}, D = { class: "kong-ui-public-monaco-editor" };
8
+ function P(n, t) {
9
+ return x(), T("div", D, [...t[0] || (t[0] = [
10
+ b("p", null, [
11
+ M("This is the "),
12
+ b("b", null, "MonacoEditor"),
13
+ M(" content.")
14
14
  ], -1)
15
15
  ])]);
16
16
  }
17
- const f = /* @__PURE__ */ _(d, [["render", p], ["__scopeId", "data-v-21e424a6"]]);
17
+ const Y = /* @__PURE__ */ L(R, [["render", P], ["__scopeId", "data-v-21e424a6"]]), A = "'JetBrains Mono', Consolas, monospace", j = "12px", z = "500", H = "20px", K = Object.freeze({
18
+ autoClosingQuotes: "always",
19
+ automaticLayout: !0,
20
+ // Auto resize layout
21
+ bracketPairColorization: {
22
+ enabled: !0
23
+ },
24
+ hideCursorInOverviewRuler: !0,
25
+ // hide the cursor position in the minimap TODO: maybe hide it on first line or change it colour
26
+ fontFamily: A,
27
+ fontSize: Number(j.replace("px", "")),
28
+ fontWeight: z,
29
+ lineHeight: Number(H.replace("px", "")),
30
+ formatOnPaste: !0,
31
+ formatOnType: !0,
32
+ // Add to enable automatic formatting as the user types.
33
+ lineNumbersMinChars: 3,
34
+ minimap: {
35
+ enabled: !1
36
+ },
37
+ stickyScroll: {
38
+ enabled: !0
39
+ },
40
+ suggest: {
41
+ showWords: !1
42
+ // Prevent showing word suggestions that exist in the document
43
+ },
44
+ quickSuggestions: !0,
45
+ // Enable quick suggestions
46
+ suggestOnTriggerCharacters: !0,
47
+ // Allow suggestions on trigger characters
48
+ wordBasedSuggestions: "off",
49
+ overviewRulerLanes: 0,
50
+ renderWhitespace: "boundary",
51
+ scrollBeyondLastLine: !1,
52
+ roundedSelection: !1,
53
+ wordWrapColumn: 120,
54
+ colorDecorators: !0,
55
+ folding: !0,
56
+ // Enable code folding for MDC block components
57
+ fixedOverflowWidgets: !0,
58
+ // Ensure suggestion widgets can overflow container
59
+ tabSize: 2,
60
+ detectIndentation: !1,
61
+ // Important as to not override tabSize
62
+ insertSpaces: !0,
63
+ // Since the formatter utilizes spaces, we set to true to insert spaces when pressing Tab
64
+ trimAutoWhitespace: !0,
65
+ wordWrap: "bounded",
66
+ find: {
67
+ addExtraSpaceOnTop: !1
68
+ // we need this set to false to get the correct absolute position, otherwise when the search box opens the content shifts
69
+ }
70
+ });
71
+ typeof WorkerGlobalScope < "u" && globalThis instanceof WorkerGlobalScope;
72
+ const O = () => {
73
+ };
74
+ function V(n, t) {
75
+ function e(...r) {
76
+ return new Promise((a, c) => {
77
+ Promise.resolve(n(() => t.apply(this, r), { fn: t, thisArg: this, args: r })).then(a).catch(c);
78
+ });
79
+ }
80
+ return e;
81
+ }
82
+ function G(n, t = {}) {
83
+ let e, r, a = O;
84
+ const c = (i) => {
85
+ clearTimeout(i), a(), a = O;
86
+ };
87
+ let g;
88
+ return (i) => {
89
+ const h = _(n), s = _(t.maxWait);
90
+ return e && c(e), h <= 0 || s !== void 0 && s <= 0 ? (r && (c(r), r = void 0), Promise.resolve(i())) : new Promise((p, o) => {
91
+ a = t.rejectOnCancel ? o : p, g = i, s && !r && (r = setTimeout(() => {
92
+ e && c(e), r = void 0, p(g());
93
+ }, s)), e = setTimeout(() => {
94
+ r && c(r), r = void 0, p(i());
95
+ }, h);
96
+ });
97
+ };
98
+ }
99
+ function $(n, t = 200, e = {}) {
100
+ return V(
101
+ G(t, e),
102
+ n
103
+ );
104
+ }
105
+ function q(n) {
106
+ var t;
107
+ const e = _(n);
108
+ return (t = e == null ? void 0 : e.$el) != null ? t : e;
109
+ }
110
+ class m {
111
+ constructor() {
112
+ }
113
+ postMessage() {
114
+ }
115
+ }
116
+ let u, v = null;
117
+ const E = /* @__PURE__ */ new Map();
118
+ async function J(n) {
119
+ return u ? (n && u.languages.register({ id: n }), u) : (v && n && E.get(n) || (v = (async () => {
120
+ E.set(n || "plaintext", !0);
121
+ const t = await import("./editor.main-BVWEsGeM.js").then((e) => e.e);
122
+ return (!("MonacoEnvironment" in window) || !window.MonacoEnvironment) && (window.MonacoEnvironment = {
123
+ getWorker(e, r) {
124
+ switch (r) {
125
+ case "json":
126
+ return new m();
127
+ case "css":
128
+ case "scss":
129
+ case "less":
130
+ return new m();
131
+ case "html":
132
+ case "handlebars":
133
+ case "razor":
134
+ return new m();
135
+ case "typescript":
136
+ case "javascript":
137
+ return new m();
138
+ default:
139
+ return new m();
140
+ }
141
+ }
142
+ }), n && !t.languages.getLanguages().some((e) => e.id === n) && t.languages.register({ id: n }), u = t, t;
143
+ })()), v);
144
+ }
145
+ function Z(n, t) {
146
+ let e;
147
+ const r = F({
148
+ editorStatus: "loading",
149
+ searchBoxIsRevealed: !1,
150
+ hasContent: !1,
151
+ theme: t.theme || "light"
152
+ }), a = W(!1), c = (o) => {
153
+ !a.value || !e || e.setValue(o);
154
+ }, g = (o) => e == null ? void 0 : e.updateOptions({ readOnly: o }), C = () => e == null ? void 0 : e.focus(), i = (o) => {
155
+ try {
156
+ if (!e || !o) return;
157
+ e.focus(), e.trigger("keyboard", o, null);
158
+ } catch (d) {
159
+ console.error(`useMonacoEditor: Failed to trigger command: ${o}`, d);
160
+ }
161
+ }, h = () => {
162
+ var o;
163
+ try {
164
+ if (!e) return;
165
+ if (r.searchBoxIsRevealed)
166
+ return (o = e.getContribution("editor.contrib.findController")) == null ? void 0 : o.closeFindWidget();
167
+ i("actions.find");
168
+ } catch (d) {
169
+ console.error("useMonacoEditor: Failed to close findController.", d);
170
+ }
171
+ }, s = $(() => u == null ? void 0 : u.editor.remeasureFonts(), 200);
172
+ return (async () => {
173
+ const o = await J(t.language), d = o.Uri.parse(`inmemory://model/${t.language}-${crypto.randomUUID()}`), S = o.editor.createModel(t.code.value, t.language, d);
174
+ B(() => _(n), async (I) => {
175
+ var y;
176
+ const w = q(I);
177
+ if (!(w instanceof HTMLElement)) {
178
+ a.value = !1;
179
+ return;
180
+ }
181
+ if (!a.value) {
182
+ e = o.editor.create(w, {
183
+ ...K,
184
+ readOnly: t.readOnly || !1,
185
+ language: t.language,
186
+ theme: r.theme,
187
+ model: S,
188
+ ...t.monacoOptions
189
+ }), a.value = !0, r.editorStatus = "ready", r.hasContent = !!t.code.value, e.onDidChangeModelContent(() => {
190
+ var f;
191
+ const l = e.getValue();
192
+ r.hasContent = !!l.length, (f = t.onChanged) == null || f.call(t, l);
193
+ }), (y = t.onCreated) == null || y.call(t), s();
194
+ try {
195
+ const l = e.getContribution("editor.contrib.findController");
196
+ if (l) {
197
+ const f = l.getState();
198
+ f.onFindReplaceStateChange(() => {
199
+ r.searchBoxIsRevealed = f.isRevealed;
200
+ });
201
+ }
202
+ } catch (l) {
203
+ console.error("useMonacoEditor: Failed to get the state of findController", l);
204
+ }
205
+ }
206
+ }, {
207
+ immediate: !0,
208
+ flush: "post"
209
+ });
210
+ })(), k(() => {
211
+ s();
212
+ }), N(s), U(() => {
213
+ if (!e) return;
214
+ const o = e.getModel();
215
+ e.dispose(), o && o.dispose();
216
+ }), {
217
+ editor: e,
218
+ editorStates: r,
219
+ setContent: c,
220
+ setReadOnly: g,
221
+ focus: C,
222
+ remeasureFonts: s,
223
+ toggleSearchWidget: h,
224
+ triggerKeyboardCommand: i
225
+ };
226
+ }
18
227
  export {
19
- f as MonacoEditor
228
+ Y as MonacoEditor,
229
+ Z as useMonacoEditor
20
230
  };