@difizen/libro-cofine-textmate 0.1.2

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 (68) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +3 -0
  3. package/es/data/monaco-themes/vscode/dark_defaults.json +23 -0
  4. package/es/data/monaco-themes/vscode/dark_editor.json +116 -0
  5. package/es/data/monaco-themes/vscode/dark_plus.json +180 -0
  6. package/es/data/monaco-themes/vscode/dark_vs.json +358 -0
  7. package/es/data/monaco-themes/vscode/hc_black.json +120 -0
  8. package/es/data/monaco-themes/vscode/hc_black_defaults.json +335 -0
  9. package/es/data/monaco-themes/vscode/hc_editor.json +7 -0
  10. package/es/data/monaco-themes/vscode/light_defaults.json +22 -0
  11. package/es/data/monaco-themes/vscode/light_editor.json +11 -0
  12. package/es/data/monaco-themes/vscode/light_plus.json +180 -0
  13. package/es/data/monaco-themes/vscode/light_vs.json +380 -0
  14. package/es/global.d.ts +7 -0
  15. package/es/index.d.ts +7 -0
  16. package/es/index.d.ts.map +1 -0
  17. package/es/index.js +6 -0
  18. package/es/monaco-grammar-registry.d.ts +15 -0
  19. package/es/monaco-grammar-registry.d.ts.map +1 -0
  20. package/es/monaco-grammar-registry.js +130 -0
  21. package/es/monaco-module.d.ts +4 -0
  22. package/es/monaco-module.d.ts.map +1 -0
  23. package/es/monaco-module.js +78 -0
  24. package/es/monaco-textmate-service.d.ts +29 -0
  25. package/es/monaco-textmate-service.d.ts.map +1 -0
  26. package/es/monaco-textmate-service.js +284 -0
  27. package/es/monaco-theme-registry.d.ts +33 -0
  28. package/es/monaco-theme-registry.d.ts.map +1 -0
  29. package/es/monaco-theme-registry.js +227 -0
  30. package/es/monaco-theme-types.d.ts +5 -0
  31. package/es/monaco-theme-types.d.ts.map +1 -0
  32. package/es/monaco-theme-types.js +1 -0
  33. package/es/textmate-contribution.d.ts +9 -0
  34. package/es/textmate-contribution.d.ts.map +1 -0
  35. package/es/textmate-contribution.js +6 -0
  36. package/es/textmate-registry.d.ts +32 -0
  37. package/es/textmate-registry.d.ts.map +1 -0
  38. package/es/textmate-registry.js +130 -0
  39. package/es/textmate-theme-contribution.d.ts +6 -0
  40. package/es/textmate-theme-contribution.d.ts.map +1 -0
  41. package/es/textmate-theme-contribution.js +50 -0
  42. package/es/textmate-tokenizer.d.ts +25 -0
  43. package/es/textmate-tokenizer.d.ts.map +1 -0
  44. package/es/textmate-tokenizer.js +32 -0
  45. package/package.json +59 -0
  46. package/src/data/monaco-themes/vscode/dark_defaults.json +23 -0
  47. package/src/data/monaco-themes/vscode/dark_editor.json +116 -0
  48. package/src/data/monaco-themes/vscode/dark_plus.json +180 -0
  49. package/src/data/monaco-themes/vscode/dark_vs.json +358 -0
  50. package/src/data/monaco-themes/vscode/hc_black.json +120 -0
  51. package/src/data/monaco-themes/vscode/hc_black_defaults.json +335 -0
  52. package/src/data/monaco-themes/vscode/hc_editor.json +7 -0
  53. package/src/data/monaco-themes/vscode/light_defaults.json +22 -0
  54. package/src/data/monaco-themes/vscode/light_editor.json +11 -0
  55. package/src/data/monaco-themes/vscode/light_plus.json +180 -0
  56. package/src/data/monaco-themes/vscode/light_vs.json +380 -0
  57. package/src/global.d.ts +7 -0
  58. package/src/index.spec.ts +8 -0
  59. package/src/index.ts +8 -0
  60. package/src/monaco-grammar-registry.ts +88 -0
  61. package/src/monaco-module.ts +59 -0
  62. package/src/monaco-textmate-service.ts +220 -0
  63. package/src/monaco-theme-registry.ts +201 -0
  64. package/src/monaco-theme-types.ts +5 -0
  65. package/src/textmate-contribution.ts +15 -0
  66. package/src/textmate-registry.ts +134 -0
  67. package/src/textmate-theme-contribution.ts +39 -0
  68. package/src/textmate-tokenizer.ts +55 -0
@@ -0,0 +1,380 @@
1
+ {
2
+ "$schema": "vscode://schemas/color-theme",
3
+ "name": "Light (Visual Studio)",
4
+ "include": "light_defaults.json",
5
+ "colors": {},
6
+ "tokenColors": [
7
+ {
8
+ "scope": ["meta.embedded", "source.groovy.embedded"],
9
+ "settings": {
10
+ "foreground": "#000000ff"
11
+ }
12
+ },
13
+ {
14
+ "scope": "emphasis",
15
+ "settings": {
16
+ "fontStyle": "italic"
17
+ }
18
+ },
19
+ {
20
+ "scope": "strong",
21
+ "settings": {
22
+ "fontStyle": "bold"
23
+ }
24
+ },
25
+ {
26
+ "scope": "meta.diff.header",
27
+ "settings": {
28
+ "foreground": "#000080"
29
+ }
30
+ },
31
+ {
32
+ "scope": "comment",
33
+ "settings": {
34
+ "foreground": "#008000"
35
+ }
36
+ },
37
+ {
38
+ "scope": "constant.language",
39
+ "settings": {
40
+ "foreground": "#0000ff"
41
+ }
42
+ },
43
+ {
44
+ "scope": [
45
+ "constant.numeric",
46
+ "entity.name.operator.custom-literal.number",
47
+ "variable.other.enummember",
48
+ "keyword.operator.plus.exponent",
49
+ "keyword.operator.minus.exponent"
50
+ ],
51
+ "settings": {
52
+ "foreground": "#09885a"
53
+ }
54
+ },
55
+ {
56
+ "scope": "constant.regexp",
57
+ "settings": {
58
+ "foreground": "#811f3f"
59
+ }
60
+ },
61
+ {
62
+ "name": "css tags in selectors, xml tags",
63
+ "scope": "entity.name.tag",
64
+ "settings": {
65
+ "foreground": "#800000"
66
+ }
67
+ },
68
+ {
69
+ "scope": "entity.name.selector",
70
+ "settings": {
71
+ "foreground": "#800000"
72
+ }
73
+ },
74
+ {
75
+ "scope": "entity.other.attribute-name",
76
+ "settings": {
77
+ "foreground": "#ff0000"
78
+ }
79
+ },
80
+ {
81
+ "scope": [
82
+ "entity.other.attribute-name.class.css",
83
+ "entity.other.attribute-name.class.mixin.css",
84
+ "entity.other.attribute-name.id.css",
85
+ "entity.other.attribute-name.parent-selector.css",
86
+ "entity.other.attribute-name.pseudo-class.css",
87
+ "entity.other.attribute-name.pseudo-element.css",
88
+ "source.css.less entity.other.attribute-name.id",
89
+ "entity.other.attribute-name.attribute.scss",
90
+ "entity.other.attribute-name.scss"
91
+ ],
92
+ "settings": {
93
+ "foreground": "#800000"
94
+ }
95
+ },
96
+ {
97
+ "scope": "invalid",
98
+ "settings": {
99
+ "foreground": "#cd3131"
100
+ }
101
+ },
102
+ {
103
+ "scope": "markup.underline",
104
+ "settings": {
105
+ "fontStyle": "underline"
106
+ }
107
+ },
108
+ {
109
+ "scope": "markup.bold",
110
+ "settings": {
111
+ "fontStyle": "bold",
112
+ "foreground": "#000080"
113
+ }
114
+ },
115
+ {
116
+ "scope": "markup.heading",
117
+ "settings": {
118
+ "fontStyle": "bold",
119
+ "foreground": "#800000"
120
+ }
121
+ },
122
+ {
123
+ "scope": "markup.italic",
124
+ "settings": {
125
+ "fontStyle": "italic"
126
+ }
127
+ },
128
+ {
129
+ "scope": "markup.inserted",
130
+ "settings": {
131
+ "foreground": "#09885a"
132
+ }
133
+ },
134
+ {
135
+ "scope": "markup.deleted",
136
+ "settings": {
137
+ "foreground": "#a31515"
138
+ }
139
+ },
140
+ {
141
+ "scope": "markup.changed",
142
+ "settings": {
143
+ "foreground": "#0451a5"
144
+ }
145
+ },
146
+ {
147
+ "scope": [
148
+ "punctuation.definition.quote.begin.markdown",
149
+ "punctuation.definition.list.begin.markdown"
150
+ ],
151
+ "settings": {
152
+ "foreground": "#0451a5"
153
+ }
154
+ },
155
+ {
156
+ "scope": "markup.inline.raw",
157
+ "settings": {
158
+ "foreground": "#800000"
159
+ }
160
+ },
161
+ {
162
+ "name": "brackets of XML/HTML tags",
163
+ "scope": "punctuation.definition.tag",
164
+ "settings": {
165
+ "foreground": "#800000"
166
+ }
167
+ },
168
+ {
169
+ "scope": ["meta.preprocessor", "entity.name.function.preprocessor"],
170
+ "settings": {
171
+ "foreground": "#0000ff"
172
+ }
173
+ },
174
+ {
175
+ "scope": "meta.preprocessor.string",
176
+ "settings": {
177
+ "foreground": "#a31515"
178
+ }
179
+ },
180
+ {
181
+ "scope": "meta.preprocessor.numeric",
182
+ "settings": {
183
+ "foreground": "#09885a"
184
+ }
185
+ },
186
+ {
187
+ "scope": "meta.structure.dictionary.key.python",
188
+ "settings": {
189
+ "foreground": "#0451a5"
190
+ }
191
+ },
192
+ {
193
+ "scope": "storage",
194
+ "settings": {
195
+ "foreground": "#0000ff"
196
+ }
197
+ },
198
+ {
199
+ "scope": "storage.type",
200
+ "settings": {
201
+ "foreground": "#0000ff"
202
+ }
203
+ },
204
+ {
205
+ "scope": ["storage.modifier", "keyword.operator.noexcept"],
206
+ "settings": {
207
+ "foreground": "#0000ff"
208
+ }
209
+ },
210
+ {
211
+ "scope": [
212
+ "string",
213
+ "entity.name.operator.custom-literal.string",
214
+ "meta.embedded.assembly"
215
+ ],
216
+ "settings": {
217
+ "foreground": "#a31515"
218
+ }
219
+ },
220
+ {
221
+ "scope": [
222
+ "string.comment.buffered.block.pug",
223
+ "string.quoted.pug",
224
+ "string.interpolated.pug",
225
+ "string.unquoted.plain.in.yaml",
226
+ "string.unquoted.plain.out.yaml",
227
+ "string.unquoted.block.yaml",
228
+ "string.quoted.single.yaml",
229
+ "string.quoted.double.xml",
230
+ "string.quoted.single.xml",
231
+ "string.unquoted.cdata.xml",
232
+ "string.quoted.double.html",
233
+ "string.quoted.single.html",
234
+ "string.unquoted.html",
235
+ "string.quoted.single.handlebars",
236
+ "string.quoted.double.handlebars"
237
+ ],
238
+ "settings": {
239
+ "foreground": "#0000ff"
240
+ }
241
+ },
242
+ {
243
+ "scope": "string.regexp",
244
+ "settings": {
245
+ "foreground": "#811f3f"
246
+ }
247
+ },
248
+ {
249
+ "name": "String interpolation",
250
+ "scope": [
251
+ "punctuation.definition.template-expression.begin",
252
+ "punctuation.definition.template-expression.end",
253
+ "punctuation.section.embedded"
254
+ ],
255
+ "settings": {
256
+ "foreground": "#0000ff"
257
+ }
258
+ },
259
+ {
260
+ "name": "Reset JavaScript string interpolation expression",
261
+ "scope": ["meta.template.expression"],
262
+ "settings": {
263
+ "foreground": "#000000"
264
+ }
265
+ },
266
+ {
267
+ "scope": [
268
+ "support.constant.property-value",
269
+ "support.constant.font-name",
270
+ "support.constant.media-type",
271
+ "support.constant.media",
272
+ "constant.other.color.rgb-value",
273
+ "constant.other.rgb-value",
274
+ "support.constant.color"
275
+ ],
276
+ "settings": {
277
+ "foreground": "#0451a5"
278
+ }
279
+ },
280
+ {
281
+ "scope": [
282
+ "support.type.vendored.property-name",
283
+ "support.type.property-name",
284
+ "variable.css",
285
+ "variable.scss",
286
+ "variable.other.less",
287
+ "source.coffee.embedded"
288
+ ],
289
+ "settings": {
290
+ "foreground": "#ff0000"
291
+ }
292
+ },
293
+ {
294
+ "scope": ["support.type.property-name.json"],
295
+ "settings": {
296
+ "foreground": "#0451a5"
297
+ }
298
+ },
299
+ {
300
+ "scope": "keyword",
301
+ "settings": {
302
+ "foreground": "#0000ff"
303
+ }
304
+ },
305
+ {
306
+ "scope": "keyword.control",
307
+ "settings": {
308
+ "foreground": "#0000ff"
309
+ }
310
+ },
311
+ {
312
+ "scope": "keyword.operator",
313
+ "settings": {
314
+ "foreground": "#000000"
315
+ }
316
+ },
317
+ {
318
+ "scope": [
319
+ "keyword.operator.new",
320
+ "keyword.operator.expression",
321
+ "keyword.operator.cast",
322
+ "keyword.operator.sizeof",
323
+ "keyword.operator.alignof",
324
+ "keyword.operator.typeid",
325
+ "keyword.operator.alignas",
326
+ "keyword.operator.instanceof",
327
+ "keyword.operator.logical.python",
328
+ "keyword.operator.wordlike"
329
+ ],
330
+ "settings": {
331
+ "foreground": "#0000ff"
332
+ }
333
+ },
334
+ {
335
+ "scope": "keyword.other.unit",
336
+ "settings": {
337
+ "foreground": "#09885a"
338
+ }
339
+ },
340
+ {
341
+ "scope": [
342
+ "punctuation.section.embedded.begin.php",
343
+ "punctuation.section.embedded.end.php"
344
+ ],
345
+ "settings": {
346
+ "foreground": "#800000"
347
+ }
348
+ },
349
+ {
350
+ "scope": "support.function.git-rebase",
351
+ "settings": {
352
+ "foreground": "#0451a5"
353
+ }
354
+ },
355
+ {
356
+ "scope": "constant.sha.git-rebase",
357
+ "settings": {
358
+ "foreground": "#09885a"
359
+ }
360
+ },
361
+ {
362
+ "name": "coloring of the Java import and package identifiers",
363
+ "scope": [
364
+ "storage.modifier.import.java",
365
+ "variable.language.wildcard.java",
366
+ "storage.modifier.package.java"
367
+ ],
368
+ "settings": {
369
+ "foreground": "#000000"
370
+ }
371
+ },
372
+ {
373
+ "name": "this.self",
374
+ "scope": "variable.language",
375
+ "settings": {
376
+ "foreground": "#0000ff"
377
+ }
378
+ }
379
+ ]
380
+ }
package/es/global.d.ts ADDED
@@ -0,0 +1,7 @@
1
+ declare module '@difizen/monaco-editor-core/esm/vs/editor/standalone/browser/standaloneServices';
2
+ declare module '@difizen/monaco-editor-core/esm/vs/editor/standalone/common/standaloneTheme';
3
+ declare module '@difizen/monaco-editor-core/esm/vs/editor/common/languages/language';
4
+ declare module '@difizen/monaco-editor-core/esm/vs/editor/common/languages';
5
+ declare module '@difizen/monaco-editor-core/esm/vs/editor/standalone/browser/standaloneLanguages';
6
+ declare module '*.json';
7
+ declare module 'vscode-oniguruma/release/onig.wasm';
package/es/index.d.ts ADDED
@@ -0,0 +1,7 @@
1
+ import { TextmateModule } from './monaco-module.js';
2
+ export * from './monaco-module.js';
3
+ export * from './monaco-textmate-service.js';
4
+ export * from './textmate-contribution.js';
5
+ export * from './textmate-registry.js';
6
+ export default TextmateModule;
7
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAEpD,cAAc,oBAAoB,CAAC;AACnC,cAAc,8BAA8B,CAAC;AAC7C,cAAc,4BAA4B,CAAC;AAC3C,cAAc,wBAAwB,CAAC;AAEvC,eAAe,cAAc,CAAC"}
package/es/index.js ADDED
@@ -0,0 +1,6 @@
1
+ import { TextmateModule } from "./monaco-module.js";
2
+ export * from "./monaco-module.js";
3
+ export * from "./monaco-textmate-service.js";
4
+ export * from "./textmate-contribution.js";
5
+ export * from "./textmate-registry.js";
6
+ export default TextmateModule;
@@ -0,0 +1,15 @@
1
+ import type { IOnigLib, IRawTheme } from 'vscode-textmate';
2
+ import { Registry } from 'vscode-textmate';
3
+ import { TextmateRegistry } from './textmate-registry.js';
4
+ export declare const isBasicWasmSupported: boolean;
5
+ export declare const OnigurumaPromise: unique symbol;
6
+ export type OnigurumaPromise = Promise<IOnigLib>;
7
+ export declare class MonacoGrammarRegistry {
8
+ registry?: Registry;
9
+ protected readonly textmateRegistry: TextmateRegistry;
10
+ protected readonly onigasmPromise: OnigurumaPromise;
11
+ constructor(textmateRegistry: TextmateRegistry, onigasmPromise: OnigurumaPromise);
12
+ getRegistry(theme: IRawTheme): Registry;
13
+ setupRegistry(theme: IRawTheme): void;
14
+ }
15
+ //# sourceMappingURL=monaco-grammar-registry.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"monaco-grammar-registry.d.ts","sourceRoot":"","sources":["../src/monaco-grammar-registry.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,QAAQ,EAAe,SAAS,EAAE,MAAM,iBAAiB,CAAC;AACxE,OAAO,EAAE,QAAQ,EAAmB,MAAM,iBAAiB,CAAC;AAE5D,OAAO,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAE1D,eAAO,MAAM,oBAAoB,SAAqD,CAAC;AACvF,eAAO,MAAM,gBAAgB,eAA2B,CAAC;AACzD,MAAM,MAAM,gBAAgB,GAAG,OAAO,CAAC,QAAQ,CAAC,CAAC;AAEjD,qBACa,qBAAqB;IACzB,QAAQ,CAAC,EAAE,QAAQ,CAAC;IAC3B,SAAS,CAAC,QAAQ,CAAC,gBAAgB,EAAE,gBAAgB,CAAC;IACtD,SAAS,CAAC,QAAQ,CAAC,cAAc,EAAE,gBAAgB,CAAC;gBAExB,gBAAgB,EAAE,gBAAgB,EAClC,cAAc,EAAE,gBAAgB;IAM5D,WAAW,CAAC,KAAK,EAAE,SAAS,GAAG,QAAQ;IA8BvC,aAAa,CAAC,KAAK,EAAE,SAAS,GAAG,IAAI;CAkCtC"}
@@ -0,0 +1,130 @@
1
+ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
2
+ var _dec, _class;
3
+ function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return e; }; var t, e = {}, r = Object.prototype, n = r.hasOwnProperty, o = Object.defineProperty || function (t, e, r) { t[e] = r.value; }, i = "function" == typeof Symbol ? Symbol : {}, a = i.iterator || "@@iterator", c = i.asyncIterator || "@@asyncIterator", u = i.toStringTag || "@@toStringTag"; function define(t, e, r) { return Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }), t[e]; } try { define({}, ""); } catch (t) { define = function define(t, e, r) { return t[e] = r; }; } function wrap(t, e, r, n) { var i = e && e.prototype instanceof Generator ? e : Generator, a = Object.create(i.prototype), c = new Context(n || []); return o(a, "_invoke", { value: makeInvokeMethod(t, r, c) }), a; } function tryCatch(t, e, r) { try { return { type: "normal", arg: t.call(e, r) }; } catch (t) { return { type: "throw", arg: t }; } } e.wrap = wrap; var h = "suspendedStart", l = "suspendedYield", f = "executing", s = "completed", y = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var p = {}; define(p, a, function () { return this; }); var d = Object.getPrototypeOf, v = d && d(d(values([]))); v && v !== r && n.call(v, a) && (p = v); var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p); function defineIteratorMethods(t) { ["next", "throw", "return"].forEach(function (e) { define(t, e, function (t) { return this._invoke(e, t); }); }); } function AsyncIterator(t, e) { function invoke(r, o, i, a) { var c = tryCatch(t[r], t, o); if ("throw" !== c.type) { var u = c.arg, h = u.value; return h && "object" == _typeof(h) && n.call(h, "__await") ? e.resolve(h.__await).then(function (t) { invoke("next", t, i, a); }, function (t) { invoke("throw", t, i, a); }) : e.resolve(h).then(function (t) { u.value = t, i(u); }, function (t) { return invoke("throw", t, i, a); }); } a(c.arg); } var r; o(this, "_invoke", { value: function value(t, n) { function callInvokeWithMethodAndArg() { return new e(function (e, r) { invoke(t, n, e, r); }); } return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(e, r, n) { var o = h; return function (i, a) { if (o === f) throw new Error("Generator is already running"); if (o === s) { if ("throw" === i) throw a; return { value: t, done: !0 }; } for (n.method = i, n.arg = a;;) { var c = n.delegate; if (c) { var u = maybeInvokeDelegate(c, n); if (u) { if (u === y) continue; return u; } } if ("next" === n.method) n.sent = n._sent = n.arg;else if ("throw" === n.method) { if (o === h) throw o = s, n.arg; n.dispatchException(n.arg); } else "return" === n.method && n.abrupt("return", n.arg); o = f; var p = tryCatch(e, r, n); if ("normal" === p.type) { if (o = n.done ? s : l, p.arg === y) continue; return { value: p.arg, done: n.done }; } "throw" === p.type && (o = s, n.method = "throw", n.arg = p.arg); } }; } function maybeInvokeDelegate(e, r) { var n = r.method, o = e.iterator[n]; if (o === t) return r.delegate = null, "throw" === n && e.iterator.return && (r.method = "return", r.arg = t, maybeInvokeDelegate(e, r), "throw" === r.method) || "return" !== n && (r.method = "throw", r.arg = new TypeError("The iterator does not provide a '" + n + "' method")), y; var i = tryCatch(o, e.iterator, r.arg); if ("throw" === i.type) return r.method = "throw", r.arg = i.arg, r.delegate = null, y; var a = i.arg; return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, "return" !== r.method && (r.method = "next", r.arg = t), r.delegate = null, y) : a : (r.method = "throw", r.arg = new TypeError("iterator result is not an object"), r.delegate = null, y); } function pushTryEntry(t) { var e = { tryLoc: t[0] }; 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e); } function resetTryEntry(t) { var e = t.completion || {}; e.type = "normal", delete e.arg, t.completion = e; } function Context(t) { this.tryEntries = [{ tryLoc: "root" }], t.forEach(pushTryEntry, this), this.reset(!0); } function values(e) { if (e || "" === e) { var r = e[a]; if (r) return r.call(e); if ("function" == typeof e.next) return e; if (!isNaN(e.length)) { var o = -1, i = function next() { for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next; return next.value = t, next.done = !0, next; }; return i.next = i; } } throw new TypeError(_typeof(e) + " is not iterable"); } return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), o(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, "GeneratorFunction"), e.isGeneratorFunction = function (t) { var e = "function" == typeof t && t.constructor; return !!e && (e === GeneratorFunction || "GeneratorFunction" === (e.displayName || e.name)); }, e.mark = function (t) { return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, "GeneratorFunction")), t.prototype = Object.create(g), t; }, e.awrap = function (t) { return { __await: t }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () { return this; }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) { void 0 === i && (i = Promise); var a = new AsyncIterator(wrap(t, r, n, o), i); return e.isGeneratorFunction(r) ? a : a.next().then(function (t) { return t.done ? t.value : a.next(); }); }, defineIteratorMethods(g), define(g, u, "Generator"), define(g, a, function () { return this; }), define(g, "toString", function () { return "[object Generator]"; }), e.keys = function (t) { var e = Object(t), r = []; for (var n in e) r.push(n); return r.reverse(), function next() { for (; r.length;) { var t = r.pop(); if (t in e) return next.value = t, next.done = !1, next; } return next.done = !0, next; }; }, e.values = values, Context.prototype = { constructor: Context, reset: function reset(e) { if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = "next", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) "t" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t); }, stop: function stop() { this.done = !0; var t = this.tryEntries[0].completion; if ("throw" === t.type) throw t.arg; return this.rval; }, dispatchException: function dispatchException(e) { if (this.done) throw e; var r = this; function handle(n, o) { return a.type = "throw", a.arg = e, r.next = n, o && (r.method = "next", r.arg = t), !!o; } for (var o = this.tryEntries.length - 1; o >= 0; --o) { var i = this.tryEntries[o], a = i.completion; if ("root" === i.tryLoc) return handle("end"); if (i.tryLoc <= this.prev) { var c = n.call(i, "catchLoc"), u = n.call(i, "finallyLoc"); if (c && u) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } else if (c) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); } else { if (!u) throw new Error("try statement without catch or finally"); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } } } }, abrupt: function abrupt(t, e) { for (var r = this.tryEntries.length - 1; r >= 0; --r) { var o = this.tryEntries[r]; if (o.tryLoc <= this.prev && n.call(o, "finallyLoc") && this.prev < o.finallyLoc) { var i = o; break; } } i && ("break" === t || "continue" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null); var a = i ? i.completion : {}; return a.type = t, a.arg = e, i ? (this.method = "next", this.next = i.finallyLoc, y) : this.complete(a); }, complete: function complete(t, e) { if ("throw" === t.type) throw t.arg; return "break" === t.type || "continue" === t.type ? this.next = t.arg : "return" === t.type ? (this.rval = this.arg = t.arg, this.method = "return", this.next = "end") : "normal" === t.type && e && (this.next = e), y; }, finish: function finish(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y; } }, catch: function _catch(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.tryLoc === t) { var n = r.completion; if ("throw" === n.type) { var o = n.arg; resetTryEntry(r); } return o; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(e, r, n) { return this.delegate = { iterator: values(e), resultName: r, nextLoc: n }, "next" === this.method && (this.arg = t), y; } }, e; }
4
+ function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
5
+ function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
6
+ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
7
+ function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
8
+ function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
9
+ function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
10
+ function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
11
+ import { inject, singleton } from '@difizen/mana-app';
12
+ import { Registry, parseRawGrammar } from 'vscode-textmate';
13
+ import { TextmateRegistry } from "./textmate-registry.js";
14
+ export var isBasicWasmSupported = typeof window.WebAssembly !== 'undefined';
15
+ export var OnigurumaPromise = Symbol('OnigasmPromise');
16
+ export var MonacoGrammarRegistry = (_dec = singleton(), _dec(_class = /*#__PURE__*/function () {
17
+ function MonacoGrammarRegistry(textmateRegistry, onigasmPromise) {
18
+ _classCallCheck(this, MonacoGrammarRegistry);
19
+ this.textmateRegistry = textmateRegistry;
20
+ this.onigasmPromise = onigasmPromise;
21
+ }
22
+ MonacoGrammarRegistry = inject(OnigurumaPromise)(MonacoGrammarRegistry, undefined, 1) || MonacoGrammarRegistry;
23
+ MonacoGrammarRegistry = inject(TextmateRegistry)(MonacoGrammarRegistry, undefined, 0) || MonacoGrammarRegistry;
24
+ _createClass(MonacoGrammarRegistry, [{
25
+ key: "getRegistry",
26
+ value: function getRegistry(theme) {
27
+ var _this = this;
28
+ return new Registry({
29
+ onigLib: this.onigasmPromise,
30
+ theme: theme,
31
+ loadGrammar: function () {
32
+ var _loadGrammar = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(scopeName) {
33
+ var provider, definition, rawGrammar;
34
+ return _regeneratorRuntime().wrap(function _callee$(_context) {
35
+ while (1) switch (_context.prev = _context.next) {
36
+ case 0:
37
+ provider = _this.textmateRegistry.getProvider(scopeName);
38
+ if (!provider) {
39
+ _context.next = 7;
40
+ break;
41
+ }
42
+ _context.next = 4;
43
+ return provider.getGrammarDefinition();
44
+ case 4:
45
+ definition = _context.sent;
46
+ if (typeof definition.content === 'string') {
47
+ rawGrammar = parseRawGrammar(definition.content, definition.format === 'json' ? 'grammar.json' : 'grammar.plist');
48
+ } else {
49
+ rawGrammar = definition.content;
50
+ }
51
+ return _context.abrupt("return", rawGrammar);
52
+ case 7:
53
+ return _context.abrupt("return", undefined);
54
+ case 8:
55
+ case "end":
56
+ return _context.stop();
57
+ }
58
+ }, _callee);
59
+ }));
60
+ function loadGrammar(_x) {
61
+ return _loadGrammar.apply(this, arguments);
62
+ }
63
+ return loadGrammar;
64
+ }(),
65
+ getInjections: function getInjections(scopeName) {
66
+ var provider = _this.textmateRegistry.getProvider(scopeName);
67
+ if (provider && provider.getInjections) {
68
+ return provider.getInjections(scopeName);
69
+ }
70
+ return [];
71
+ }
72
+ });
73
+ }
74
+ }, {
75
+ key: "setupRegistry",
76
+ value: function setupRegistry(theme) {
77
+ var _this2 = this;
78
+ if (this.registry) {
79
+ this.registry.setTheme(theme);
80
+ return;
81
+ }
82
+ this.registry = new Registry({
83
+ onigLib: this.onigasmPromise,
84
+ theme: theme,
85
+ loadGrammar: function () {
86
+ var _loadGrammar2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(scopeName) {
87
+ var provider, definition, rawGrammar;
88
+ return _regeneratorRuntime().wrap(function _callee2$(_context2) {
89
+ while (1) switch (_context2.prev = _context2.next) {
90
+ case 0:
91
+ provider = _this2.textmateRegistry.getProvider(scopeName);
92
+ if (!provider) {
93
+ _context2.next = 7;
94
+ break;
95
+ }
96
+ _context2.next = 4;
97
+ return provider.getGrammarDefinition();
98
+ case 4:
99
+ definition = _context2.sent;
100
+ if (typeof definition.content === 'string') {
101
+ rawGrammar = parseRawGrammar(definition.content, definition.format === 'json' ? 'grammar.json' : 'grammar.plist');
102
+ } else {
103
+ rawGrammar = definition.content;
104
+ }
105
+ return _context2.abrupt("return", rawGrammar);
106
+ case 7:
107
+ return _context2.abrupt("return", undefined);
108
+ case 8:
109
+ case "end":
110
+ return _context2.stop();
111
+ }
112
+ }, _callee2);
113
+ }));
114
+ function loadGrammar(_x2) {
115
+ return _loadGrammar2.apply(this, arguments);
116
+ }
117
+ return loadGrammar;
118
+ }(),
119
+ getInjections: function getInjections(scopeName) {
120
+ var provider = _this2.textmateRegistry.getProvider(scopeName);
121
+ if (provider && provider.getInjections) {
122
+ return provider.getInjections(scopeName);
123
+ }
124
+ return [];
125
+ }
126
+ });
127
+ }
128
+ }]);
129
+ return MonacoGrammarRegistry;
130
+ }()) || _class);
@@ -0,0 +1,4 @@
1
+ export declare function fetchOniguruma(): Promise<ArrayBuffer | Response>;
2
+ export declare const TextmateModule: import("@difizen/mana-app").SyringeModule<import("@difizen/mana-app").Syringe.Module>;
3
+ export default TextmateModule;
4
+ //# sourceMappingURL=monaco-module.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"monaco-module.d.ts","sourceRoot":"","sources":["../src/monaco-module.ts"],"names":[],"mappings":"AAkBA,wBAAsB,cAAc,IAAI,OAAO,CAAC,WAAW,GAAG,QAAQ,CAAC,CAkBtE;AAOD,eAAO,MAAM,cAAc,uFAc2B,CAAC;AACvD,eAAe,cAAc,CAAC"}