@stonecrop/code-editor 0.30.0 → 0.32.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.
@@ -1,831 +1,939 @@
1
- import { defineComponent as M, useModel as D, useTemplateRef as L, shallowRef as q, watch as j, onMounted as B, onUnmounted as R, openBlock as V, createElementBlock as z, normalizeStyle as H, mergeModels as U } from "vue";
2
- function O(e, t) {
3
- (t == null || t > e.length) && (t = e.length);
4
- for (var n = 0, r = Array(t); n < t; n++) r[n] = e[n];
5
- return r;
6
- }
7
- function F(e) {
8
- if (Array.isArray(e)) return e;
9
- }
10
- function N(e, t, n) {
11
- return (t = X(t)) in e ? Object.defineProperty(e, t, {
12
- value: n,
13
- enumerable: !0,
14
- configurable: !0,
15
- writable: !0
16
- }) : e[t] = n, e;
17
- }
18
- function W(e, t) {
19
- var n = e == null ? null : typeof Symbol < "u" && e[Symbol.iterator] || e["@@iterator"];
20
- if (n != null) {
21
- var r, o, i, a, u = [], c = !0, f = !1;
22
- try {
23
- if (i = (n = n.call(e)).next, t !== 0) for (; !(c = (r = i.call(n)).done) && (u.push(r.value), u.length !== t); c = !0) ;
24
- } catch (d) {
25
- f = !0, o = d;
26
- } finally {
27
- try {
28
- if (!c && n.return != null && (a = n.return(), Object(a) !== a)) return;
29
- } finally {
30
- if (f) throw o;
31
- }
32
- }
33
- return u;
34
- }
35
- }
36
- function G() {
37
- throw new TypeError(`Invalid attempt to destructure non-iterable instance.
38
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`);
39
- }
40
- function w(e, t) {
41
- var n = Object.keys(e);
42
- if (Object.getOwnPropertySymbols) {
43
- var r = Object.getOwnPropertySymbols(e);
44
- t && (r = r.filter(function(o) {
45
- return Object.getOwnPropertyDescriptor(e, o).enumerable;
46
- })), n.push.apply(n, r);
47
- }
48
- return n;
49
- }
50
- function S(e) {
51
- for (var t = 1; t < arguments.length; t++) {
52
- var n = arguments[t] != null ? arguments[t] : {};
53
- t % 2 ? w(Object(n), !0).forEach(function(r) {
54
- N(e, r, n[r]);
55
- }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(n)) : w(Object(n)).forEach(function(r) {
56
- Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(n, r));
57
- });
58
- }
59
- return e;
60
- }
61
- function K(e, t) {
62
- if (e == null) return {};
63
- var n, r, o = J(e, t);
64
- if (Object.getOwnPropertySymbols) {
65
- var i = Object.getOwnPropertySymbols(e);
66
- for (r = 0; r < i.length; r++) n = i[r], t.indexOf(n) === -1 && {}.propertyIsEnumerable.call(e, n) && (o[n] = e[n]);
67
- }
68
- return o;
69
- }
70
- function J(e, t) {
71
- if (e == null) return {};
72
- var n = {};
73
- for (var r in e) if ({}.hasOwnProperty.call(e, r)) {
74
- if (t.indexOf(r) !== -1) continue;
75
- n[r] = e[r];
76
- }
77
- return n;
78
- }
79
- function Y(e, t) {
80
- return F(e) || W(e, t) || Z(e, t) || G();
81
- }
82
- function Q(e, t) {
83
- if (typeof e != "object" || !e) return e;
84
- var n = e[Symbol.toPrimitive];
85
- if (n !== void 0) {
86
- var r = n.call(e, t);
87
- if (typeof r != "object") return r;
88
- throw new TypeError("@@toPrimitive must return a primitive value.");
89
- }
90
- return (t === "string" ? String : Number)(e);
91
- }
92
- function X(e) {
93
- var t = Q(e, "string");
94
- return typeof t == "symbol" ? t : t + "";
95
- }
96
- function Z(e, t) {
97
- if (e) {
98
- if (typeof e == "string") return O(e, t);
99
- var n = {}.toString.call(e).slice(8, -1);
100
- return n === "Object" && e.constructor && (n = e.constructor.name), n === "Map" || n === "Set" ? Array.from(e) : n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n) ? O(e, t) : void 0;
101
- }
102
- }
103
- function _(e, t, n) {
104
- return t in e ? Object.defineProperty(e, t, {
105
- value: n,
106
- enumerable: !0,
107
- configurable: !0,
108
- writable: !0
109
- }) : e[t] = n, e;
110
- }
111
- function P(e, t) {
112
- var n = Object.keys(e);
113
- if (Object.getOwnPropertySymbols) {
114
- var r = Object.getOwnPropertySymbols(e);
115
- t && (r = r.filter(function(o) {
116
- return Object.getOwnPropertyDescriptor(e, o).enumerable;
117
- })), n.push.apply(n, r);
118
- }
119
- return n;
120
- }
121
- function I(e) {
122
- for (var t = 1; t < arguments.length; t++) {
123
- var n = arguments[t] != null ? arguments[t] : {};
124
- t % 2 ? P(Object(n), !0).forEach(function(r) {
125
- _(e, r, n[r]);
126
- }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(n)) : P(Object(n)).forEach(function(r) {
127
- Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(n, r));
128
- });
129
- }
130
- return e;
131
- }
132
- function ee() {
133
- for (var e = arguments.length, t = new Array(e), n = 0; n < e; n++)
134
- t[n] = arguments[n];
135
- return function(r) {
136
- return t.reduceRight(function(o, i) {
137
- return i(o);
138
- }, r);
139
- };
140
- }
141
- function s(e) {
142
- return function t() {
143
- for (var n = this, r = arguments.length, o = new Array(r), i = 0; i < r; i++)
144
- o[i] = arguments[i];
145
- return o.length >= e.length ? e.apply(this, o) : function() {
146
- for (var a = arguments.length, u = new Array(a), c = 0; c < a; c++)
147
- u[c] = arguments[c];
148
- return t.apply(n, [].concat(o, u));
149
- };
150
- };
151
- }
152
- function b(e) {
153
- return {}.toString.call(e).includes("Object");
154
- }
155
- function te(e) {
156
- return !Object.keys(e).length;
157
- }
158
- function g(e) {
159
- return typeof e == "function";
160
- }
161
- function ne(e, t) {
162
- return Object.prototype.hasOwnProperty.call(e, t);
163
- }
164
- function re(e, t) {
165
- return b(t) || l("changeType"), Object.keys(t).some(function(n) {
166
- return !ne(e, n);
167
- }) && l("changeField"), t;
168
- }
169
- function oe(e) {
170
- g(e) || l("selectorType");
171
- }
172
- function ie(e) {
173
- g(e) || b(e) || l("handlerType"), b(e) && Object.values(e).some(function(t) {
174
- return !g(t);
175
- }) && l("handlersType");
176
- }
177
- function ae(e) {
178
- e || l("initialIsRequired"), b(e) || l("initialType"), te(e) && l("initialContent");
179
- }
180
- function ce(e, t) {
181
- throw new Error(e[t] || e.default);
182
- }
183
- var ue = {
184
- initialIsRequired: "initial state is required",
185
- initialType: "initial state should be an object",
186
- initialContent: "initial state shouldn't be an empty object",
187
- handlerType: "handler should be an object or a function",
188
- handlersType: "all handlers should be a functions",
189
- selectorType: "selector should be a function",
190
- changeType: "provided value of changes should be an object",
191
- changeField: 'it seams you want to change a field in the state which is not specified in the "initial" state',
192
- default: "an unknown error accured in `state-local` package"
193
- }, l = s(ce)(ue), p = {
194
- changes: re,
195
- selector: oe,
196
- handler: ie,
197
- initial: ae
1
+ import { createElementBlock, defineComponent, mergeModels, normalizeStyle, onMounted, onUnmounted, openBlock, shallowRef, useModel, useTemplateRef, watch } from "vue";
2
+ import './assets/index.css';//#region ../node_modules/.pnpm/@monaco-editor+loader@1.7.0/node_modules/@monaco-editor/loader/lib/es/_virtual/_rollupPluginBabelHelpers.js
3
+ function _arrayLikeToArray(r, a) {
4
+ (null == a || a > r.length) && (a = r.length);
5
+ for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e];
6
+ return n;
7
+ }
8
+ function _arrayWithHoles(r) {
9
+ if (Array.isArray(r)) return r;
10
+ }
11
+ function _defineProperty$1(e, r, t) {
12
+ return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, {
13
+ value: t,
14
+ enumerable: true,
15
+ configurable: true,
16
+ writable: true
17
+ }) : e[r] = t, e;
18
+ }
19
+ function _iterableToArrayLimit(r, l) {
20
+ var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];
21
+ if (null != t) {
22
+ var e, n, i, u, a = [], f = true, o = false;
23
+ try {
24
+ if (i = (t = t.call(r)).next, 0 === l);
25
+ else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0);
26
+ } catch (r) {
27
+ o = true, n = r;
28
+ } finally {
29
+ try {
30
+ if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return;
31
+ } finally {
32
+ if (o) throw n;
33
+ }
34
+ }
35
+ return a;
36
+ }
37
+ }
38
+ function _nonIterableRest() {
39
+ throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
40
+ }
41
+ function ownKeys$1(e, r) {
42
+ var t = Object.keys(e);
43
+ if (Object.getOwnPropertySymbols) {
44
+ var o = Object.getOwnPropertySymbols(e);
45
+ r && (o = o.filter(function(r) {
46
+ return Object.getOwnPropertyDescriptor(e, r).enumerable;
47
+ })), t.push.apply(t, o);
48
+ }
49
+ return t;
50
+ }
51
+ function _objectSpread2$1(e) {
52
+ for (var r = 1; r < arguments.length; r++) {
53
+ var t = null != arguments[r] ? arguments[r] : {};
54
+ r % 2 ? ownKeys$1(Object(t), true).forEach(function(r) {
55
+ _defineProperty$1(e, r, t[r]);
56
+ }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$1(Object(t)).forEach(function(r) {
57
+ Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r));
58
+ });
59
+ }
60
+ return e;
61
+ }
62
+ function _objectWithoutProperties(e, t) {
63
+ if (null == e) return {};
64
+ var o, r, i = _objectWithoutPropertiesLoose(e, t);
65
+ if (Object.getOwnPropertySymbols) {
66
+ var n = Object.getOwnPropertySymbols(e);
67
+ for (r = 0; r < n.length; r++) o = n[r], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]);
68
+ }
69
+ return i;
70
+ }
71
+ function _objectWithoutPropertiesLoose(r, e) {
72
+ if (null == r) return {};
73
+ var t = {};
74
+ for (var n in r) if ({}.hasOwnProperty.call(r, n)) {
75
+ if (-1 !== e.indexOf(n)) continue;
76
+ t[n] = r[n];
77
+ }
78
+ return t;
79
+ }
80
+ function _slicedToArray(r, e) {
81
+ return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest();
82
+ }
83
+ function _toPrimitive(t, r) {
84
+ if ("object" != typeof t || !t) return t;
85
+ var e = t[Symbol.toPrimitive];
86
+ if (void 0 !== e) {
87
+ var i = e.call(t, r);
88
+ if ("object" != typeof i) return i;
89
+ throw new TypeError("@@toPrimitive must return a primitive value.");
90
+ }
91
+ return ("string" === r ? String : Number)(t);
92
+ }
93
+ function _toPropertyKey(t) {
94
+ var i = _toPrimitive(t, "string");
95
+ return "symbol" == typeof i ? i : i + "";
96
+ }
97
+ function _unsupportedIterableToArray(r, a) {
98
+ if (r) {
99
+ if ("string" == typeof r) return _arrayLikeToArray(r, a);
100
+ var t = {}.toString.call(r).slice(8, -1);
101
+ return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0;
102
+ }
103
+ }
104
+ //#endregion
105
+ //#region ../node_modules/.pnpm/state-local@1.0.7/node_modules/state-local/lib/es/state-local.js
106
+ function _defineProperty(obj, key, value) {
107
+ if (key in obj) Object.defineProperty(obj, key, {
108
+ value,
109
+ enumerable: true,
110
+ configurable: true,
111
+ writable: true
112
+ });
113
+ else obj[key] = value;
114
+ return obj;
115
+ }
116
+ function ownKeys(object, enumerableOnly) {
117
+ var keys = Object.keys(object);
118
+ if (Object.getOwnPropertySymbols) {
119
+ var symbols = Object.getOwnPropertySymbols(object);
120
+ if (enumerableOnly) symbols = symbols.filter(function(sym) {
121
+ return Object.getOwnPropertyDescriptor(object, sym).enumerable;
122
+ });
123
+ keys.push.apply(keys, symbols);
124
+ }
125
+ return keys;
126
+ }
127
+ function _objectSpread2(target) {
128
+ for (var i = 1; i < arguments.length; i++) {
129
+ var source = arguments[i] != null ? arguments[i] : {};
130
+ if (i % 2) ownKeys(Object(source), true).forEach(function(key) {
131
+ _defineProperty(target, key, source[key]);
132
+ });
133
+ else if (Object.getOwnPropertyDescriptors) Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
134
+ else ownKeys(Object(source)).forEach(function(key) {
135
+ Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
136
+ });
137
+ }
138
+ return target;
139
+ }
140
+ function compose$1() {
141
+ for (var _len = arguments.length, fns = new Array(_len), _key = 0; _key < _len; _key++) fns[_key] = arguments[_key];
142
+ return function(x) {
143
+ return fns.reduceRight(function(y, f) {
144
+ return f(y);
145
+ }, x);
146
+ };
147
+ }
148
+ function curry$1(fn) {
149
+ return function curried() {
150
+ var _this = this;
151
+ for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) args[_key2] = arguments[_key2];
152
+ return args.length >= fn.length ? fn.apply(this, args) : function() {
153
+ for (var _len3 = arguments.length, nextArgs = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) nextArgs[_key3] = arguments[_key3];
154
+ return curried.apply(_this, [].concat(args, nextArgs));
155
+ };
156
+ };
157
+ }
158
+ function isObject$1(value) {
159
+ return {}.toString.call(value).includes("Object");
160
+ }
161
+ function isEmpty(obj) {
162
+ return !Object.keys(obj).length;
163
+ }
164
+ function isFunction(value) {
165
+ return typeof value === "function";
166
+ }
167
+ function hasOwnProperty(object, property) {
168
+ return Object.prototype.hasOwnProperty.call(object, property);
169
+ }
170
+ function validateChanges(initial, changes) {
171
+ if (!isObject$1(changes)) errorHandler$1("changeType");
172
+ if (Object.keys(changes).some(function(field) {
173
+ return !hasOwnProperty(initial, field);
174
+ })) errorHandler$1("changeField");
175
+ return changes;
176
+ }
177
+ function validateSelector(selector) {
178
+ if (!isFunction(selector)) errorHandler$1("selectorType");
179
+ }
180
+ function validateHandler(handler) {
181
+ if (!(isFunction(handler) || isObject$1(handler))) errorHandler$1("handlerType");
182
+ if (isObject$1(handler) && Object.values(handler).some(function(_handler) {
183
+ return !isFunction(_handler);
184
+ })) errorHandler$1("handlersType");
185
+ }
186
+ function validateInitial(initial) {
187
+ if (!initial) errorHandler$1("initialIsRequired");
188
+ if (!isObject$1(initial)) errorHandler$1("initialType");
189
+ if (isEmpty(initial)) errorHandler$1("initialContent");
190
+ }
191
+ function throwError$1(errorMessages, type) {
192
+ throw new Error(errorMessages[type] || errorMessages["default"]);
193
+ }
194
+ var errorHandler$1 = curry$1(throwError$1)({
195
+ initialIsRequired: "initial state is required",
196
+ initialType: "initial state should be an object",
197
+ initialContent: "initial state shouldn't be an empty object",
198
+ handlerType: "handler should be an object or a function",
199
+ handlersType: "all handlers should be a functions",
200
+ selectorType: "selector should be a function",
201
+ changeType: "provided value of changes should be an object",
202
+ changeField: "it seams you want to change a field in the state which is not specified in the \"initial\" state",
203
+ "default": "an unknown error accured in `state-local` package"
204
+ });
205
+ var validators$1 = {
206
+ changes: validateChanges,
207
+ selector: validateSelector,
208
+ handler: validateHandler,
209
+ initial: validateInitial
198
210
  };
199
- function fe(e) {
200
- var t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
201
- p.initial(e), p.handler(t);
202
- var n = {
203
- current: e
204
- }, r = s(se)(n, t), o = s(le)(n), i = s(p.changes)(e), a = s(de)(n);
205
- function u() {
206
- var f = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : function(d) {
207
- return d;
208
- };
209
- return p.selector(f), f(n.current);
210
- }
211
- function c(f) {
212
- ee(r, o, i, a)(f);
213
- }
214
- return [u, c];
215
- }
216
- function de(e, t) {
217
- return g(t) ? t(e.current) : t;
218
- }
219
- function le(e, t) {
220
- return e.current = I(I({}, e.current), t), t;
221
- }
222
- function se(e, t, n) {
223
- return g(t) ? t(e.current) : Object.keys(n).forEach(function(r) {
224
- var o;
225
- return (o = t[r]) === null || o === void 0 ? void 0 : o.call(t, e.current[r]);
226
- }), n;
227
- }
228
- var ge = {
229
- create: fe
230
- }, me = {
231
- paths: {
232
- vs: "https://cdn.jsdelivr.net/npm/monaco-editor@0.55.1/min/vs"
233
- }
211
+ function create(initial) {
212
+ var handler = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
213
+ validators$1.initial(initial);
214
+ validators$1.handler(handler);
215
+ var state = { current: initial };
216
+ var didUpdate = curry$1(didStateUpdate)(state, handler);
217
+ var update = curry$1(updateState)(state);
218
+ var validate = curry$1(validators$1.changes)(initial);
219
+ var getChanges = curry$1(extractChanges)(state);
220
+ function getState() {
221
+ var selector = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : function(state) {
222
+ return state;
223
+ };
224
+ validators$1.selector(selector);
225
+ return selector(state.current);
226
+ }
227
+ function setState(causedChanges) {
228
+ compose$1(didUpdate, update, validate, getChanges)(causedChanges);
229
+ }
230
+ return [getState, setState];
231
+ }
232
+ function extractChanges(state, causedChanges) {
233
+ return isFunction(causedChanges) ? causedChanges(state.current) : causedChanges;
234
+ }
235
+ function updateState(state, changes) {
236
+ state.current = _objectSpread2(_objectSpread2({}, state.current), changes);
237
+ return changes;
238
+ }
239
+ function didStateUpdate(state, handler, changes) {
240
+ isFunction(handler) ? handler(state.current) : Object.keys(changes).forEach(function(field) {
241
+ var _handler$field;
242
+ return (_handler$field = handler[field]) === null || _handler$field === void 0 ? void 0 : _handler$field.call(handler, state.current[field]);
243
+ });
244
+ return changes;
245
+ }
246
+ var index = { create };
247
+ //#endregion
248
+ //#region ../node_modules/.pnpm/@monaco-editor+loader@1.7.0/node_modules/@monaco-editor/loader/lib/es/config/index.js
249
+ var config$1 = { paths: { vs: "https://cdn.jsdelivr.net/npm/monaco-editor@0.55.1/min/vs" } };
250
+ //#endregion
251
+ //#region ../node_modules/.pnpm/@monaco-editor+loader@1.7.0/node_modules/@monaco-editor/loader/lib/es/utils/curry.js
252
+ function curry(fn) {
253
+ return function curried() {
254
+ var _this = this;
255
+ for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) args[_key] = arguments[_key];
256
+ return args.length >= fn.length ? fn.apply(this, args) : function() {
257
+ for (var _len2 = arguments.length, nextArgs = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) nextArgs[_key2] = arguments[_key2];
258
+ return curried.apply(_this, [].concat(args, nextArgs));
259
+ };
260
+ };
261
+ }
262
+ //#endregion
263
+ //#region ../node_modules/.pnpm/@monaco-editor+loader@1.7.0/node_modules/@monaco-editor/loader/lib/es/utils/isObject.js
264
+ function isObject(value) {
265
+ return {}.toString.call(value).includes("Object");
266
+ }
267
+ //#endregion
268
+ //#region ../node_modules/.pnpm/@monaco-editor+loader@1.7.0/node_modules/@monaco-editor/loader/lib/es/validators/index.js
269
+ /**
270
+ * validates the configuration object and informs about deprecation
271
+ * @param {Object} config - the configuration object
272
+ * @return {Object} config - the validated configuration object
273
+ */
274
+ function validateConfig(config) {
275
+ if (!config) errorHandler("configIsRequired");
276
+ if (!isObject(config)) errorHandler("configType");
277
+ if (config.urls) {
278
+ informAboutDeprecation();
279
+ return { paths: { vs: config.urls.monacoBase } };
280
+ }
281
+ return config;
282
+ }
283
+ /**
284
+ * logs deprecation message
285
+ */
286
+ function informAboutDeprecation() {
287
+ console.warn(errorMessages.deprecation);
288
+ }
289
+ function throwError(errorMessages, type) {
290
+ throw new Error(errorMessages[type] || errorMessages["default"]);
291
+ }
292
+ var errorMessages = {
293
+ configIsRequired: "the configuration object is required",
294
+ configType: "the configuration object should be an object",
295
+ "default": "an unknown error accured in `@monaco-editor/loader` package",
296
+ deprecation: "Deprecation warning!\n You are using deprecated way of configuration.\n\n Instead of using\n monaco.config({ urls: { monacoBase: '...' } })\n use\n monaco.config({ paths: { vs: '...' } })\n\n For more please check the link https://github.com/suren-atoyan/monaco-loader#config\n "
234
297
  };
235
- function pe(e) {
236
- return function t() {
237
- for (var n = this, r = arguments.length, o = new Array(r), i = 0; i < r; i++)
238
- o[i] = arguments[i];
239
- return o.length >= e.length ? e.apply(this, o) : function() {
240
- for (var a = arguments.length, u = new Array(a), c = 0; c < a; c++)
241
- u[c] = arguments[c];
242
- return t.apply(n, [].concat(o, u));
243
- };
244
- };
245
- }
246
- function be(e) {
247
- return {}.toString.call(e).includes("Object");
248
- }
249
- function he(e) {
250
- return e || E("configIsRequired"), be(e) || E("configType"), e.urls ? (ve(), {
251
- paths: {
252
- vs: e.urls.monacoBase
253
- }
254
- }) : e;
255
- }
256
- function ve() {
257
- console.warn(T.deprecation);
258
- }
259
- function ye(e, t) {
260
- throw new Error(e[t] || e.default);
261
- }
262
- var T = {
263
- configIsRequired: "the configuration object is required",
264
- configType: "the configuration object should be an object",
265
- default: "an unknown error accured in `@monaco-editor/loader` package",
266
- deprecation: `Deprecation warning!
267
- You are using deprecated way of configuration.
268
-
269
- Instead of using
270
- monaco.config({ urls: { monacoBase: '...' } })
271
- use
272
- monaco.config({ paths: { vs: '...' } })
273
-
274
- For more please check the link https://github.com/suren-atoyan/monaco-loader#config
275
- `
276
- }, E = pe(ye)(T), ke = {
277
- config: he
278
- }, je = function() {
279
- for (var t = arguments.length, n = new Array(t), r = 0; r < t; r++)
280
- n[r] = arguments[r];
281
- return function(o) {
282
- return n.reduceRight(function(i, a) {
283
- return a(i);
284
- }, o);
285
- };
298
+ var errorHandler = curry(throwError)(errorMessages);
299
+ var validators = { config: validateConfig };
300
+ //#endregion
301
+ //#region ../node_modules/.pnpm/@monaco-editor+loader@1.7.0/node_modules/@monaco-editor/loader/lib/es/utils/compose.js
302
+ var compose = function compose() {
303
+ for (var _len = arguments.length, fns = new Array(_len), _key = 0; _key < _len; _key++) fns[_key] = arguments[_key];
304
+ return function(x) {
305
+ return fns.reduceRight(function(y, f) {
306
+ return f(y);
307
+ }, x);
308
+ };
286
309
  };
287
- function A(e, t) {
288
- return Object.keys(t).forEach(function(n) {
289
- t[n] instanceof Object && e[n] && Object.assign(t[n], A(e[n], t[n]));
290
- }), S(S({}, e), t);
291
- }
292
- var Oe = {
293
- type: "cancelation",
294
- msg: "operation is manually canceled"
310
+ //#endregion
311
+ //#region ../node_modules/.pnpm/@monaco-editor+loader@1.7.0/node_modules/@monaco-editor/loader/lib/es/utils/deepMerge.js
312
+ function merge(target, source) {
313
+ Object.keys(source).forEach(function(key) {
314
+ if (source[key] instanceof Object) {
315
+ if (target[key]) Object.assign(source[key], merge(target[key], source[key]));
316
+ }
317
+ });
318
+ return _objectSpread2$1(_objectSpread2$1({}, target), source);
319
+ }
320
+ //#endregion
321
+ //#region ../node_modules/.pnpm/@monaco-editor+loader@1.7.0/node_modules/@monaco-editor/loader/lib/es/utils/makeCancelable.js
322
+ var CANCELATION_MESSAGE = {
323
+ type: "cancelation",
324
+ msg: "operation is manually canceled"
295
325
  };
296
- function v(e) {
297
- var t = !1, n = new Promise(function(r, o) {
298
- e.then(function(i) {
299
- return t ? o(Oe) : r(i);
300
- }), e.catch(o);
301
- });
302
- return n.cancel = function() {
303
- return t = !0;
304
- }, n;
305
- }
306
- var we = ["monaco"], Se = ge.create({
307
- config: me,
308
- isInitialized: !1,
309
- resolve: null,
310
- reject: null,
311
- monaco: null
312
- }), C = Y(Se, 2), m = C[0], h = C[1];
313
- function Pe(e) {
314
- var t = ke.config(e), n = t.monaco, r = K(t, we);
315
- h(function(o) {
316
- return {
317
- config: A(o.config, r),
318
- monaco: n
319
- };
320
- });
321
- }
322
- function Ie() {
323
- var e = m(function(t) {
324
- var n = t.monaco, r = t.isInitialized, o = t.resolve;
325
- return {
326
- monaco: n,
327
- isInitialized: r,
328
- resolve: o
329
- };
330
- });
331
- if (!e.isInitialized) {
332
- if (h({
333
- isInitialized: !0
334
- }), e.monaco)
335
- return e.resolve(e.monaco), v(y);
336
- if (window.monaco && window.monaco.editor)
337
- return $(window.monaco), e.resolve(window.monaco), v(y);
338
- je(Ee, Te)(Ae);
339
- }
340
- return v(y);
341
- }
342
- function Ee(e) {
343
- return document.body.appendChild(e);
344
- }
345
- function xe(e) {
346
- var t = document.createElement("script");
347
- return e && (t.src = e), t;
348
- }
349
- function Te(e) {
350
- var t = m(function(r) {
351
- var o = r.config, i = r.reject;
352
- return {
353
- config: o,
354
- reject: i
355
- };
356
- }), n = xe("".concat(t.config.paths.vs, "/loader.js"));
357
- return n.onload = function() {
358
- return e();
359
- }, n.onerror = t.reject, n;
360
- }
361
- function Ae() {
362
- var e = m(function(n) {
363
- var r = n.config, o = n.resolve, i = n.reject;
364
- return {
365
- config: r,
366
- resolve: o,
367
- reject: i
368
- };
369
- }), t = window.require;
370
- t.config(e.config), t(["vs/editor/editor.main"], function(n) {
371
- var r = n.m || n;
372
- $(r), e.resolve(r);
373
- }, function(n) {
374
- e.reject(n);
375
- });
376
- }
377
- function $(e) {
378
- m().monaco || h({
379
- monaco: e
380
- });
381
- }
382
- function Ce() {
383
- return m(function(e) {
384
- var t = e.monaco;
385
- return t;
386
- });
387
- }
388
- var y = new Promise(function(e, t) {
389
- return h({
390
- resolve: e,
391
- reject: t
392
- });
393
- }), x = {
394
- config: Pe,
395
- init: Ie,
396
- __getMonacoInstance: Ce
326
+ function makeCancelable(promise) {
327
+ var hasCanceled_ = false;
328
+ var wrappedPromise = new Promise(function(resolve, reject) {
329
+ promise.then(function(val) {
330
+ return hasCanceled_ ? reject(CANCELATION_MESSAGE) : resolve(val);
331
+ });
332
+ promise["catch"](reject);
333
+ });
334
+ return wrappedPromise.cancel = function() {
335
+ return hasCanceled_ = true;
336
+ }, wrappedPromise;
337
+ }
338
+ //#endregion
339
+ //#region ../node_modules/.pnpm/@monaco-editor+loader@1.7.0/node_modules/@monaco-editor/loader/lib/es/loader/index.js
340
+ var _excluded = ["monaco"];
341
+ var _state$create2 = _slicedToArray(index.create({
342
+ config: config$1,
343
+ isInitialized: false,
344
+ resolve: null,
345
+ reject: null,
346
+ monaco: null
347
+ }), 2);
348
+ var getState = _state$create2[0];
349
+ var setState = _state$create2[1];
350
+ /**
351
+ * set the loader configuration
352
+ * @param {Object} config - the configuration object
353
+ */
354
+ function config(globalConfig) {
355
+ var _validators$config = validators.config(globalConfig), monaco = _validators$config.monaco, config = _objectWithoutProperties(_validators$config, _excluded);
356
+ setState(function(state) {
357
+ return {
358
+ config: merge(state.config, config),
359
+ monaco
360
+ };
361
+ });
362
+ }
363
+ /**
364
+ * handles the initialization of the monaco-editor
365
+ * @return {Promise} - returns an instance of monaco (with a cancelable promise)
366
+ */
367
+ function init() {
368
+ var state = getState(function(_ref) {
369
+ return {
370
+ monaco: _ref.monaco,
371
+ isInitialized: _ref.isInitialized,
372
+ resolve: _ref.resolve
373
+ };
374
+ });
375
+ if (!state.isInitialized) {
376
+ setState({ isInitialized: true });
377
+ if (state.monaco) {
378
+ state.resolve(state.monaco);
379
+ return makeCancelable(wrapperPromise);
380
+ }
381
+ if (window.monaco && window.monaco.editor) {
382
+ storeMonacoInstance(window.monaco);
383
+ state.resolve(window.monaco);
384
+ return makeCancelable(wrapperPromise);
385
+ }
386
+ compose(injectScripts, getMonacoLoaderScript)(configureLoader);
387
+ }
388
+ return makeCancelable(wrapperPromise);
389
+ }
390
+ /**
391
+ * injects provided scripts into the document.body
392
+ * @param {Object} script - an HTML script element
393
+ * @return {Object} - the injected HTML script element
394
+ */
395
+ function injectScripts(script) {
396
+ return document.body.appendChild(script);
397
+ }
398
+ /**
399
+ * creates an HTML script element with/without provided src
400
+ * @param {string} [src] - the source path of the script
401
+ * @return {Object} - the created HTML script element
402
+ */
403
+ function createScript(src) {
404
+ var script = document.createElement("script");
405
+ return src && (script.src = src), script;
406
+ }
407
+ /**
408
+ * creates an HTML script element with the monaco loader src
409
+ * @return {Object} - the created HTML script element
410
+ */
411
+ function getMonacoLoaderScript(configureLoader) {
412
+ var state = getState(function(_ref2) {
413
+ return {
414
+ config: _ref2.config,
415
+ reject: _ref2.reject
416
+ };
417
+ });
418
+ var loaderScript = createScript("".concat(state.config.paths.vs, "/loader.js"));
419
+ loaderScript.onload = function() {
420
+ return configureLoader();
421
+ };
422
+ loaderScript.onerror = state.reject;
423
+ return loaderScript;
424
+ }
425
+ /**
426
+ * configures the monaco loader
427
+ */
428
+ function configureLoader() {
429
+ var state = getState(function(_ref3) {
430
+ return {
431
+ config: _ref3.config,
432
+ resolve: _ref3.resolve,
433
+ reject: _ref3.reject
434
+ };
435
+ });
436
+ var require = window.require;
437
+ require.config(state.config);
438
+ require(["vs/editor/editor.main"], function(loaded) {
439
+ var monaco = loaded.m || loaded;
440
+ storeMonacoInstance(monaco);
441
+ state.resolve(monaco);
442
+ }, function(error) {
443
+ state.reject(error);
444
+ });
445
+ }
446
+ /**
447
+ * store monaco instance in local state
448
+ */
449
+ function storeMonacoInstance(monaco) {
450
+ if (!getState().monaco) setState({ monaco });
451
+ }
452
+ /**
453
+ * internal helper function
454
+ * extracts stored monaco instance
455
+ * @return {Object|null} - the monaco instance
456
+ */
457
+ function __getMonacoInstance() {
458
+ return getState(function(_ref4) {
459
+ return _ref4.monaco;
460
+ });
461
+ }
462
+ var wrapperPromise = new Promise(function(resolve, reject) {
463
+ return setState({
464
+ resolve,
465
+ reject
466
+ });
467
+ });
468
+ var loader = {
469
+ config,
470
+ init,
471
+ __getMonacoInstance
397
472
  };
398
- const $e = {
399
- base: "vs",
400
- inherit: !0,
401
- colors: {
402
- "editor.foreground": "#24292e",
403
- "editor.background": "#ffffff",
404
- "editor.selectionBackground": "#c8c8fa",
405
- "editor.inactiveSelectionBackground": "#fafbfc",
406
- "editor.lineHighlightBackground": "#fafbfc",
407
- "editorCursor.foreground": "#24292e",
408
- "editorWhitespace.foreground": "#959da5",
409
- "editorIndentGuide.background": "#959da5",
410
- "editorIndentGuide.activeBackground": "#24292e",
411
- "editor.selectionHighlightBorder": "#fafbfc"
412
- },
413
- rules: [
414
- {
415
- background: "ffffff",
416
- token: ""
417
- },
418
- {
419
- foreground: "6a737d",
420
- token: "comment"
421
- },
422
- {
423
- foreground: "6a737d",
424
- token: "punctuation.definition.comment"
425
- },
426
- {
427
- foreground: "6a737d",
428
- token: "string.comment"
429
- },
430
- {
431
- foreground: "005cc5",
432
- token: "constant"
433
- },
434
- {
435
- foreground: "005cc5",
436
- token: "entity.name.constant"
437
- },
438
- {
439
- foreground: "005cc5",
440
- token: "variable.other.constant"
441
- },
442
- {
443
- foreground: "005cc5",
444
- token: "variable.language"
445
- },
446
- {
447
- foreground: "6f42c1",
448
- token: "entity"
449
- },
450
- {
451
- foreground: "6f42c1",
452
- token: "entity.name"
453
- },
454
- {
455
- foreground: "24292e",
456
- token: "variable.parameter.function"
457
- },
458
- {
459
- foreground: "22863a",
460
- token: "entity.name.tag"
461
- },
462
- {
463
- foreground: "d73a49",
464
- token: "keyword"
465
- },
466
- {
467
- foreground: "d73a49",
468
- token: "storage"
469
- },
470
- {
471
- foreground: "d73a49",
472
- token: "storage.type"
473
- },
474
- {
475
- foreground: "24292e",
476
- token: "storage.modifier.package"
477
- },
478
- {
479
- foreground: "24292e",
480
- token: "storage.modifier.import"
481
- },
482
- {
483
- foreground: "24292e",
484
- token: "storage.type.java"
485
- },
486
- {
487
- foreground: "032f62",
488
- token: "string"
489
- },
490
- {
491
- foreground: "032f62",
492
- token: "punctuation.definition.string"
493
- },
494
- {
495
- foreground: "032f62",
496
- token: "string punctuation.section.embedded source"
497
- },
498
- {
499
- foreground: "005cc5",
500
- token: "support"
501
- },
502
- {
503
- foreground: "005cc5",
504
- token: "meta.property-name"
505
- },
506
- {
507
- foreground: "e36209",
508
- token: "variable"
509
- },
510
- {
511
- foreground: "24292e",
512
- token: "variable.other"
513
- },
514
- {
515
- foreground: "b31d28",
516
- fontStyle: "bold italic underline",
517
- token: "invalid.broken"
518
- },
519
- {
520
- foreground: "b31d28",
521
- fontStyle: "bold italic underline",
522
- token: "invalid.deprecated"
523
- },
524
- {
525
- foreground: "fafbfc",
526
- background: "b31d28",
527
- fontStyle: "italic underline",
528
- token: "invalid.illegal"
529
- },
530
- {
531
- foreground: "fafbfc",
532
- background: "d73a49",
533
- fontStyle: "italic underline",
534
- token: "carriage-return"
535
- },
536
- {
537
- foreground: "b31d28",
538
- fontStyle: "bold italic underline",
539
- token: "invalid.unimplemented"
540
- },
541
- {
542
- foreground: "b31d28",
543
- token: "message.error"
544
- },
545
- {
546
- foreground: "24292e",
547
- token: "string source"
548
- },
549
- {
550
- foreground: "005cc5",
551
- token: "string variable"
552
- },
553
- {
554
- foreground: "032f62",
555
- token: "source.regexp"
556
- },
557
- {
558
- foreground: "032f62",
559
- token: "string.regexp"
560
- },
561
- {
562
- foreground: "032f62",
563
- token: "string.regexp.character-class"
564
- },
565
- {
566
- foreground: "032f62",
567
- token: "string.regexp constant.character.escape"
568
- },
569
- {
570
- foreground: "032f62",
571
- token: "string.regexp source.ruby.embedded"
572
- },
573
- {
574
- foreground: "032f62",
575
- token: "string.regexp string.regexp.arbitrary-repitition"
576
- },
577
- {
578
- foreground: "22863a",
579
- fontStyle: "bold",
580
- token: "string.regexp constant.character.escape"
581
- },
582
- {
583
- foreground: "005cc5",
584
- token: "support.constant"
585
- },
586
- {
587
- foreground: "005cc5",
588
- token: "support.variable"
589
- },
590
- {
591
- foreground: "005cc5",
592
- token: "meta.module-reference"
593
- },
594
- {
595
- foreground: "735c0f",
596
- token: "markup.list"
597
- },
598
- {
599
- foreground: "005cc5",
600
- fontStyle: "bold",
601
- token: "markup.heading"
602
- },
603
- {
604
- foreground: "005cc5",
605
- fontStyle: "bold",
606
- token: "markup.heading entity.name"
607
- },
608
- {
609
- foreground: "22863a",
610
- token: "markup.quote"
611
- },
612
- {
613
- foreground: "24292e",
614
- fontStyle: "italic",
615
- token: "markup.italic"
616
- },
617
- {
618
- foreground: "24292e",
619
- fontStyle: "bold",
620
- token: "markup.bold"
621
- },
622
- {
623
- foreground: "005cc5",
624
- token: "markup.raw"
625
- },
626
- {
627
- foreground: "b31d28",
628
- background: "ffeef0",
629
- token: "markup.deleted"
630
- },
631
- {
632
- foreground: "b31d28",
633
- background: "ffeef0",
634
- token: "meta.diff.header.from-file"
635
- },
636
- {
637
- foreground: "b31d28",
638
- background: "ffeef0",
639
- token: "punctuation.definition.deleted"
640
- },
641
- {
642
- foreground: "22863a",
643
- background: "f0fff4",
644
- token: "markup.inserted"
645
- },
646
- {
647
- foreground: "22863a",
648
- background: "f0fff4",
649
- token: "meta.diff.header.to-file"
650
- },
651
- {
652
- foreground: "22863a",
653
- background: "f0fff4",
654
- token: "punctuation.definition.inserted"
655
- },
656
- {
657
- foreground: "e36209",
658
- background: "ffebda",
659
- token: "markup.changed"
660
- },
661
- {
662
- foreground: "e36209",
663
- background: "ffebda",
664
- token: "punctuation.definition.changed"
665
- },
666
- {
667
- foreground: "f6f8fa",
668
- background: "005cc5",
669
- token: "markup.ignored"
670
- },
671
- {
672
- foreground: "f6f8fa",
673
- background: "005cc5",
674
- token: "markup.untracked"
675
- },
676
- {
677
- foreground: "6f42c1",
678
- fontStyle: "bold",
679
- token: "meta.diff.range"
680
- },
681
- {
682
- foreground: "005cc5",
683
- token: "meta.diff.header"
684
- },
685
- {
686
- foreground: "005cc5",
687
- fontStyle: "bold",
688
- token: "meta.separator"
689
- },
690
- {
691
- foreground: "005cc5",
692
- token: "meta.output"
693
- },
694
- {
695
- foreground: "586069",
696
- token: "brackethighlighter.tag"
697
- },
698
- {
699
- foreground: "586069",
700
- token: "brackethighlighter.curly"
701
- },
702
- {
703
- foreground: "586069",
704
- token: "brackethighlighter.round"
705
- },
706
- {
707
- foreground: "586069",
708
- token: "brackethighlighter.square"
709
- },
710
- {
711
- foreground: "586069",
712
- token: "brackethighlighter.angle"
713
- },
714
- {
715
- foreground: "586069",
716
- token: "brackethighlighter.quote"
717
- },
718
- {
719
- foreground: "b31d28",
720
- token: "brackethighlighter.unmatched"
721
- },
722
- {
723
- foreground: "b31d28",
724
- token: "sublimelinter.mark.error"
725
- },
726
- {
727
- foreground: "e36209",
728
- token: "sublimelinter.mark.warning"
729
- },
730
- {
731
- foreground: "959da5",
732
- token: "sublimelinter.gutter-mark"
733
- },
734
- {
735
- foreground: "032f62",
736
- fontStyle: "underline",
737
- token: "constant.other.reference.link"
738
- },
739
- {
740
- foreground: "032f62",
741
- fontStyle: "underline",
742
- token: "string.other.link"
743
- }
744
- ]
473
+ //#endregion
474
+ //#region src/theme/code_editor/agritheory.ts
475
+ var theme = {
476
+ base: "vs",
477
+ inherit: true,
478
+ colors: {
479
+ "editor.foreground": "#24292e",
480
+ "editor.background": "#ffffff",
481
+ "editor.selectionBackground": "#c8c8fa",
482
+ "editor.inactiveSelectionBackground": "#fafbfc",
483
+ "editor.lineHighlightBackground": "#fafbfc",
484
+ "editorCursor.foreground": "#24292e",
485
+ "editorWhitespace.foreground": "#959da5",
486
+ "editorIndentGuide.background": "#959da5",
487
+ "editorIndentGuide.activeBackground": "#24292e",
488
+ "editor.selectionHighlightBorder": "#fafbfc"
489
+ },
490
+ rules: [
491
+ {
492
+ background: "ffffff",
493
+ token: ""
494
+ },
495
+ {
496
+ foreground: "6a737d",
497
+ token: "comment"
498
+ },
499
+ {
500
+ foreground: "6a737d",
501
+ token: "punctuation.definition.comment"
502
+ },
503
+ {
504
+ foreground: "6a737d",
505
+ token: "string.comment"
506
+ },
507
+ {
508
+ foreground: "005cc5",
509
+ token: "constant"
510
+ },
511
+ {
512
+ foreground: "005cc5",
513
+ token: "entity.name.constant"
514
+ },
515
+ {
516
+ foreground: "005cc5",
517
+ token: "variable.other.constant"
518
+ },
519
+ {
520
+ foreground: "005cc5",
521
+ token: "variable.language"
522
+ },
523
+ {
524
+ foreground: "6f42c1",
525
+ token: "entity"
526
+ },
527
+ {
528
+ foreground: "6f42c1",
529
+ token: "entity.name"
530
+ },
531
+ {
532
+ foreground: "24292e",
533
+ token: "variable.parameter.function"
534
+ },
535
+ {
536
+ foreground: "22863a",
537
+ token: "entity.name.tag"
538
+ },
539
+ {
540
+ foreground: "d73a49",
541
+ token: "keyword"
542
+ },
543
+ {
544
+ foreground: "d73a49",
545
+ token: "storage"
546
+ },
547
+ {
548
+ foreground: "d73a49",
549
+ token: "storage.type"
550
+ },
551
+ {
552
+ foreground: "24292e",
553
+ token: "storage.modifier.package"
554
+ },
555
+ {
556
+ foreground: "24292e",
557
+ token: "storage.modifier.import"
558
+ },
559
+ {
560
+ foreground: "24292e",
561
+ token: "storage.type.java"
562
+ },
563
+ {
564
+ foreground: "032f62",
565
+ token: "string"
566
+ },
567
+ {
568
+ foreground: "032f62",
569
+ token: "punctuation.definition.string"
570
+ },
571
+ {
572
+ foreground: "032f62",
573
+ token: "string punctuation.section.embedded source"
574
+ },
575
+ {
576
+ foreground: "005cc5",
577
+ token: "support"
578
+ },
579
+ {
580
+ foreground: "005cc5",
581
+ token: "meta.property-name"
582
+ },
583
+ {
584
+ foreground: "e36209",
585
+ token: "variable"
586
+ },
587
+ {
588
+ foreground: "24292e",
589
+ token: "variable.other"
590
+ },
591
+ {
592
+ foreground: "b31d28",
593
+ fontStyle: "bold italic underline",
594
+ token: "invalid.broken"
595
+ },
596
+ {
597
+ foreground: "b31d28",
598
+ fontStyle: "bold italic underline",
599
+ token: "invalid.deprecated"
600
+ },
601
+ {
602
+ foreground: "fafbfc",
603
+ background: "b31d28",
604
+ fontStyle: "italic underline",
605
+ token: "invalid.illegal"
606
+ },
607
+ {
608
+ foreground: "fafbfc",
609
+ background: "d73a49",
610
+ fontStyle: "italic underline",
611
+ token: "carriage-return"
612
+ },
613
+ {
614
+ foreground: "b31d28",
615
+ fontStyle: "bold italic underline",
616
+ token: "invalid.unimplemented"
617
+ },
618
+ {
619
+ foreground: "b31d28",
620
+ token: "message.error"
621
+ },
622
+ {
623
+ foreground: "24292e",
624
+ token: "string source"
625
+ },
626
+ {
627
+ foreground: "005cc5",
628
+ token: "string variable"
629
+ },
630
+ {
631
+ foreground: "032f62",
632
+ token: "source.regexp"
633
+ },
634
+ {
635
+ foreground: "032f62",
636
+ token: "string.regexp"
637
+ },
638
+ {
639
+ foreground: "032f62",
640
+ token: "string.regexp.character-class"
641
+ },
642
+ {
643
+ foreground: "032f62",
644
+ token: "string.regexp constant.character.escape"
645
+ },
646
+ {
647
+ foreground: "032f62",
648
+ token: "string.regexp source.ruby.embedded"
649
+ },
650
+ {
651
+ foreground: "032f62",
652
+ token: "string.regexp string.regexp.arbitrary-repitition"
653
+ },
654
+ {
655
+ foreground: "22863a",
656
+ fontStyle: "bold",
657
+ token: "string.regexp constant.character.escape"
658
+ },
659
+ {
660
+ foreground: "005cc5",
661
+ token: "support.constant"
662
+ },
663
+ {
664
+ foreground: "005cc5",
665
+ token: "support.variable"
666
+ },
667
+ {
668
+ foreground: "005cc5",
669
+ token: "meta.module-reference"
670
+ },
671
+ {
672
+ foreground: "735c0f",
673
+ token: "markup.list"
674
+ },
675
+ {
676
+ foreground: "005cc5",
677
+ fontStyle: "bold",
678
+ token: "markup.heading"
679
+ },
680
+ {
681
+ foreground: "005cc5",
682
+ fontStyle: "bold",
683
+ token: "markup.heading entity.name"
684
+ },
685
+ {
686
+ foreground: "22863a",
687
+ token: "markup.quote"
688
+ },
689
+ {
690
+ foreground: "24292e",
691
+ fontStyle: "italic",
692
+ token: "markup.italic"
693
+ },
694
+ {
695
+ foreground: "24292e",
696
+ fontStyle: "bold",
697
+ token: "markup.bold"
698
+ },
699
+ {
700
+ foreground: "005cc5",
701
+ token: "markup.raw"
702
+ },
703
+ {
704
+ foreground: "b31d28",
705
+ background: "ffeef0",
706
+ token: "markup.deleted"
707
+ },
708
+ {
709
+ foreground: "b31d28",
710
+ background: "ffeef0",
711
+ token: "meta.diff.header.from-file"
712
+ },
713
+ {
714
+ foreground: "b31d28",
715
+ background: "ffeef0",
716
+ token: "punctuation.definition.deleted"
717
+ },
718
+ {
719
+ foreground: "22863a",
720
+ background: "f0fff4",
721
+ token: "markup.inserted"
722
+ },
723
+ {
724
+ foreground: "22863a",
725
+ background: "f0fff4",
726
+ token: "meta.diff.header.to-file"
727
+ },
728
+ {
729
+ foreground: "22863a",
730
+ background: "f0fff4",
731
+ token: "punctuation.definition.inserted"
732
+ },
733
+ {
734
+ foreground: "e36209",
735
+ background: "ffebda",
736
+ token: "markup.changed"
737
+ },
738
+ {
739
+ foreground: "e36209",
740
+ background: "ffebda",
741
+ token: "punctuation.definition.changed"
742
+ },
743
+ {
744
+ foreground: "f6f8fa",
745
+ background: "005cc5",
746
+ token: "markup.ignored"
747
+ },
748
+ {
749
+ foreground: "f6f8fa",
750
+ background: "005cc5",
751
+ token: "markup.untracked"
752
+ },
753
+ {
754
+ foreground: "6f42c1",
755
+ fontStyle: "bold",
756
+ token: "meta.diff.range"
757
+ },
758
+ {
759
+ foreground: "005cc5",
760
+ token: "meta.diff.header"
761
+ },
762
+ {
763
+ foreground: "005cc5",
764
+ fontStyle: "bold",
765
+ token: "meta.separator"
766
+ },
767
+ {
768
+ foreground: "005cc5",
769
+ token: "meta.output"
770
+ },
771
+ {
772
+ foreground: "586069",
773
+ token: "brackethighlighter.tag"
774
+ },
775
+ {
776
+ foreground: "586069",
777
+ token: "brackethighlighter.curly"
778
+ },
779
+ {
780
+ foreground: "586069",
781
+ token: "brackethighlighter.round"
782
+ },
783
+ {
784
+ foreground: "586069",
785
+ token: "brackethighlighter.square"
786
+ },
787
+ {
788
+ foreground: "586069",
789
+ token: "brackethighlighter.angle"
790
+ },
791
+ {
792
+ foreground: "586069",
793
+ token: "brackethighlighter.quote"
794
+ },
795
+ {
796
+ foreground: "b31d28",
797
+ token: "brackethighlighter.unmatched"
798
+ },
799
+ {
800
+ foreground: "b31d28",
801
+ token: "sublimelinter.mark.error"
802
+ },
803
+ {
804
+ foreground: "e36209",
805
+ token: "sublimelinter.mark.warning"
806
+ },
807
+ {
808
+ foreground: "959da5",
809
+ token: "sublimelinter.gutter-mark"
810
+ },
811
+ {
812
+ foreground: "032f62",
813
+ fontStyle: "underline",
814
+ token: "constant.other.reference.link"
815
+ },
816
+ {
817
+ foreground: "032f62",
818
+ fontStyle: "underline",
819
+ token: "string.other.link"
820
+ }
821
+ ]
745
822
  };
746
- function Me(e) {
747
- return e == null ? "" : typeof e == "string" ? e : JSON.stringify(e, null, 2);
748
- }
749
- let De = 0;
750
- const Le = /* @__PURE__ */ M({
751
- __name: "ACodeEditor",
752
- props: /* @__PURE__ */ U({
753
- height: { default: "300px" },
754
- mode: { default: "edit" },
755
- schema: { default: () => {
756
- } },
757
- language: { default: () => {
758
- } },
759
- options: { default: () => {
760
- } },
761
- vsPath: { default: () => {
762
- } },
763
- extraLibs: { default: () => {
764
- } },
765
- libs: { default: () => {
766
- } }
767
- }, {
768
- modelValue: {},
769
- modelModifiers: {}
770
- }),
771
- emits: ["update:modelValue"],
772
- setup(e) {
773
- const t = D(e, "modelValue"), n = L("aCodeEditor"), r = q(null);
774
- return j(t, (o) => {
775
- const i = r.value;
776
- i && o !== i.getValue() && i.setValue(o ?? "");
777
- }), j(
778
- () => e.mode,
779
- (o) => {
780
- r.value?.updateOptions({ readOnly: o !== "edit" });
781
- }
782
- ), B(async () => {
783
- e.vsPath && x.config({ paths: { vs: e.vsPath } });
784
- const o = await x.init(), i = e.schema?.language ?? e.language ?? "plaintext", a = o.typescript;
785
- e.extraLibs && a.javascriptDefaults.addExtraLib(e.extraLibs, "ts:stonecrop.d.ts"), (e.extraLibs || e.libs) && a.javascriptDefaults.setCompilerOptions({
786
- checkJs: !0,
787
- noImplicitAny: !1,
788
- // `lib` is authoritative — it replaces Monaco's default set, so passing e.g.
789
- // ['es2020'] retains the JS built-ins (Promise/Array/JSON/…) while removing the
790
- // DOM/browser globals. `target` is matched so ES2020 syntax isn't flagged.
791
- ...e.libs && {
792
- target: a.ScriptTarget.ES2020,
793
- lib: e.libs
794
- }
795
- }), o.editor.defineTheme("agritheory", $e), o.editor.setTheme("agritheory");
796
- const u = i === "typescript" ? "ts" : i === "json" ? "json" : i === "python" ? "py" : "js", c = o.Uri.parse(`file:///stonecrop-editor-${++De}.${u}`), f = o.editor.createModel(Me(t.value), i, c), d = o.editor.create(n.value, {
797
- automaticLayout: !0,
798
- colorDecorators: !0,
799
- lineHeight: 24,
800
- scrollBeyondLastLine: !1,
801
- ...e.options,
802
- model: f,
803
- readOnly: e.mode !== "edit"
804
- });
805
- d.onDidChangeModelContent(() => {
806
- t.value = d.getValue();
807
- }), r.value = d;
808
- const k = t.value ?? "";
809
- k !== d.getValue() && d.setValue(k);
810
- }), R(() => {
811
- r.value?.getModel()?.dispose(), r.value?.dispose(), r.value = null;
812
- }), (o, i) => (V(), z("div", {
813
- ref: "aCodeEditor",
814
- class: "a-code-editor",
815
- style: H({ height: e.height })
816
- }, null, 4));
817
- }
818
- }), qe = (e, t) => {
819
- const n = e.__vccOpts || e;
820
- for (const [r, o] of t)
821
- n[r] = o;
822
- return n;
823
- }, Be = /* @__PURE__ */ qe(Le, [["__scopeId", "data-v-8f53629e"]]);
824
- function Ve(e) {
825
- e.component("ACodeEditor", Be);
826
- }
827
- export {
828
- Be as ACodeEditor,
829
- Ve as install
823
+ //#endregion
824
+ //#region src/utils/serialization.ts
825
+ /**
826
+ * Coerces an unknown value to a string suitable for Monaco's initial content.
827
+ * Objects are JSON-stringified with 2-space indentation.
828
+ * Null and undefined become empty string.
829
+ * Strings pass through unchanged.
830
+ * @public
831
+ */
832
+ function toEditorString(value) {
833
+ if (value === null || value === void 0) return "";
834
+ if (typeof value === "string") return value;
835
+ return JSON.stringify(value, null, 2);
836
+ }
837
+ //#endregion
838
+ //#region src/components/ACodeEditor.vue?vue&type=script&setup=true&lang.ts
839
+ var editorModelCounter = 0;
840
+ var ACodeEditor_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineComponent({
841
+ __name: "ACodeEditor",
842
+ props: /*@__PURE__*/ mergeModels({
843
+ height: { default: "300px" },
844
+ mode: { default: "edit" },
845
+ schema: { default: () => void 0 },
846
+ language: { default: () => void 0 },
847
+ options: { default: () => void 0 },
848
+ vsPath: { default: () => void 0 },
849
+ extraLibs: { default: () => void 0 },
850
+ libs: { default: () => void 0 }
851
+ }, {
852
+ "modelValue": {},
853
+ "modelModifiers": {}
854
+ }),
855
+ emits: ["update:modelValue"],
856
+ setup(__props) {
857
+ const modelValue = useModel(__props, "modelValue");
858
+ const editorRef = useTemplateRef("aCodeEditor");
859
+ const editorInstance = shallowRef(null);
860
+ watch(modelValue, (val) => {
861
+ const inst = editorInstance.value;
862
+ if (inst && val !== inst.getValue()) inst.setValue(val ?? "");
863
+ });
864
+ watch(() => __props.mode, (m) => {
865
+ editorInstance.value?.updateOptions({ readOnly: m !== "edit" });
866
+ });
867
+ onMounted(async () => {
868
+ if (__props.vsPath) loader.config({ paths: { vs: __props.vsPath } });
869
+ const monacoInstance = await loader.init();
870
+ const lang = __props.schema?.language ?? __props.language ?? "plaintext";
871
+ const ts = monacoInstance.typescript;
872
+ if (__props.extraLibs) ts.javascriptDefaults.addExtraLib(__props.extraLibs, "ts:stonecrop.d.ts");
873
+ if (__props.extraLibs || __props.libs) ts.javascriptDefaults.setCompilerOptions({
874
+ checkJs: true,
875
+ noImplicitAny: false,
876
+ ...__props.libs && {
877
+ target: ts.ScriptTarget.ES2020,
878
+ lib: __props.libs
879
+ }
880
+ });
881
+ monacoInstance.editor.defineTheme("agritheory", theme);
882
+ monacoInstance.editor.setTheme("agritheory");
883
+ const ext = lang === "typescript" ? "ts" : lang === "json" ? "json" : lang === "python" ? "py" : "js";
884
+ const modelUri = monacoInstance.Uri.parse(`file:///stonecrop-editor-${++editorModelCounter}.${ext}`);
885
+ const editorModel = monacoInstance.editor.createModel(toEditorString(modelValue.value), lang, modelUri);
886
+ const inst = monacoInstance.editor.create(editorRef.value, {
887
+ automaticLayout: true,
888
+ colorDecorators: true,
889
+ lineHeight: 24,
890
+ scrollBeyondLastLine: false,
891
+ ...__props.options,
892
+ model: editorModel,
893
+ readOnly: __props.mode !== "edit"
894
+ });
895
+ inst.onDidChangeModelContent(() => {
896
+ modelValue.value = inst.getValue();
897
+ });
898
+ editorInstance.value = inst;
899
+ const current = modelValue.value ?? "";
900
+ if (current !== inst.getValue()) inst.setValue(current);
901
+ });
902
+ onUnmounted(() => {
903
+ editorInstance.value?.getModel()?.dispose();
904
+ editorInstance.value?.dispose();
905
+ editorInstance.value = null;
906
+ });
907
+ return (_ctx, _cache) => {
908
+ return openBlock(), createElementBlock("div", {
909
+ ref: "aCodeEditor",
910
+ class: "a-code-editor",
911
+ style: normalizeStyle({ height: __props.height })
912
+ }, null, 4);
913
+ };
914
+ }
915
+ });
916
+ //#endregion
917
+ //#region \0plugin-vue:export-helper
918
+ var _plugin_vue_export_helper_default = (sfc, props) => {
919
+ const target = sfc.__vccOpts || sfc;
920
+ for (const [key, val] of props) target[key] = val;
921
+ return target;
830
922
  };
831
- //# sourceMappingURL=code-editor.js.map
923
+ //#endregion
924
+ //#region src/components/ACodeEditor.vue
925
+ var ACodeEditor_default = /*#__PURE__*/ _plugin_vue_export_helper_default(ACodeEditor_vue_vue_type_script_setup_true_lang_default, [["__scopeId", "data-v-8f53629e"]]);
926
+ //#endregion
927
+ //#region src/index.ts
928
+ /**
929
+ * Install all Code Editor components
930
+ * @param app - Vue app instance
931
+ * @public
932
+ */
933
+ function install(app) {
934
+ app.component("ACodeEditor", ACodeEditor_default);
935
+ }
936
+ //#endregion
937
+ export { ACodeEditor_default as ACodeEditor, install };
938
+
939
+ //# sourceMappingURL=code-editor.js.map