@stonecrop/code-editor 0.31.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.
- package/dist/assets/index.css +5 -0
- package/dist/code-editor.js +932 -824
- package/dist/code-editor.js.map +1 -1
- package/dist/src/components/ACodeEditor.vue.d.ts +51 -0
- package/dist/src/components/ACodeEditor.vue.d.ts.map +1 -0
- package/dist/{tsdoc-metadata.json → src/tsdoc-metadata.json} +1 -1
- package/package.json +33 -31
- package/dist/code-editor.css +0 -1
- package/dist/code-editor.d.ts +0 -13
- package/dist/code_editor.tsbuildinfo +0 -1
- package/dist/src/index.js +0 -10
- package/dist/src/theme/code_editor/agritheory.js +0 -350
- package/dist/src/utils/serialization.js +0 -14
- package/src/components/ACodeEditor.vue +0 -139
- package/src/index.ts +0 -14
- package/src/shims-vue.d.ts +0 -5
- package/src/theme/code_editor/agritheory.ts +0 -352
- package/src/utils/serialization.ts +0 -12
package/dist/code-editor.js
CHANGED
|
@@ -1,831 +1,939 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
}
|
|
158
|
-
function
|
|
159
|
-
|
|
160
|
-
}
|
|
161
|
-
function
|
|
162
|
-
|
|
163
|
-
}
|
|
164
|
-
function
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
}
|
|
177
|
-
function
|
|
178
|
-
|
|
179
|
-
}
|
|
180
|
-
function
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
}
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
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
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
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
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
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
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
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
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
}
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
}
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
}
|
|
388
|
-
var
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
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
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
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
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
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
|
-
//#
|
|
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
|