@jetlinks-web/components 2.1.1 → 2.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/es/EditTable/Body.js +2 -1
- package/es/EditTable/EditTable.js +9 -7
- package/es/EditTable/FormItem.js +3 -2
- package/es/FullPage/FullPage.js +1 -1
- package/es/MonacoEditor/Monaco.js +9 -1
- package/es/MonacoEditor/grammars.js +125 -0
- package/es/MonacoEditor/style/index.js +0 -0
- package/es/MonacoEditor/tips.js +1056 -0
- package/es/Search/Advanced/SaveHistory.js +1 -1
- package/es/Search/Item.js +1 -1
- package/es/Search/Search.js +1 -1
- package/lib/EditTable/Body.js +2 -1
- package/lib/EditTable/EditTable.js +9 -7
- package/lib/EditTable/FormItem.js +3 -2
- package/lib/FullPage/FullPage.js +1 -1
- package/lib/MonacoEditor/Monaco.js +9 -1
- package/lib/MonacoEditor/grammars.js +137 -0
- package/lib/MonacoEditor/style/index.js +1 -0
- package/lib/MonacoEditor/tips.js +1062 -0
- package/lib/Search/Advanced/SaveHistory.js +1 -1
- package/lib/Search/Item.js +1 -1
- package/lib/Search/Search.js +1 -1
- package/package.json +7 -4
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
} */
|
|
22
22
|
import { defineComponent as _defineComponent } from 'vue';
|
|
23
23
|
import { unref as _unref, createVNode as _createVNode, withCtx as _withCtx, createTextVNode as _createTextVNode, openBlock as _openBlock, createElementBlock as _createElementBlock, createCommentVNode as _createCommentVNode, createBlock as _createBlock, pushScopeId as _pushScopeId, popScopeId as _popScopeId } from "vue";
|
|
24
|
-
const _withScopeId = n => (_pushScopeId("data-v-
|
|
24
|
+
const _withScopeId = n => (_pushScopeId("data-v-1723098074919"), n = n(), _popScopeId(), n);
|
|
25
25
|
const _hoisted_1 = {
|
|
26
26
|
key: 0,
|
|
27
27
|
style: { "width": "240px" }
|
package/es/Search/Item.js
CHANGED
|
@@ -78,7 +78,7 @@ function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]
|
|
|
78
78
|
} */
|
|
79
79
|
import { defineComponent as _defineComponent } from 'vue';
|
|
80
80
|
import { unref as _unref, openBlock as _openBlock, createBlock as _createBlock, createCommentVNode as _createCommentVNode, toDisplayString as _toDisplayString, createElementBlock as _createElementBlock, createVNode as _createVNode, Fragment as _Fragment, normalizeStyle as _normalizeStyle, mergeProps as _mergeProps, resolveDynamicComponent as _resolveDynamicComponent, withCtx as _withCtx, createElementVNode as _createElementVNode, pushScopeId as _pushScopeId, popScopeId as _popScopeId } from "vue";
|
|
81
|
-
const _withScopeId = n => (_pushScopeId("data-v-
|
|
81
|
+
const _withScopeId = n => (_pushScopeId("data-v-1723098072927"), n = n(), _popScopeId(), n);
|
|
82
82
|
const _hoisted_1 = { class: "JSearch-item" };
|
|
83
83
|
const _hoisted_2 = {
|
|
84
84
|
key: 0,
|
package/es/Search/Search.js
CHANGED
|
@@ -36,7 +36,7 @@
|
|
|
36
36
|
} */
|
|
37
37
|
import { defineComponent as _defineComponent } from 'vue';
|
|
38
38
|
import { renderList as _renderList, Fragment as _Fragment, openBlock as _openBlock, createElementBlock as _createElementBlock, createVNode as _createVNode, unref as _unref, withCtx as _withCtx, createBlock as _createBlock, renderSlot as _renderSlot, toDisplayString as _toDisplayString, createTextVNode as _createTextVNode, normalizeStyle as _normalizeStyle, createElementVNode as _createElementVNode, normalizeClass as _normalizeClass, pushScopeId as _pushScopeId, popScopeId as _popScopeId } from "vue";
|
|
39
|
-
const _withScopeId = n => (_pushScopeId("data-v-
|
|
39
|
+
const _withScopeId = n => (_pushScopeId("data-v-1723098073260"), n = n(), _popScopeId(), n);
|
|
40
40
|
const _hoisted_1 = { class: "JSearch-content simple" };
|
|
41
41
|
const _hoisted_2 = { class: "JSearch-items" };
|
|
42
42
|
import { Button, Row, Col, Form, FormItemRest, } from 'ant-design-vue';
|
package/lib/EditTable/Body.js
CHANGED
|
@@ -28,6 +28,7 @@ function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]
|
|
|
28
28
|
"watch": "setup-const",
|
|
29
29
|
"onMounted": "setup-const",
|
|
30
30
|
"onBeforeUnmount": "setup-const",
|
|
31
|
+
"nextTick": "setup-const",
|
|
31
32
|
"handleColumnFixed": "setup-maybe-ref",
|
|
32
33
|
"props": "setup-reactive-const",
|
|
33
34
|
"emit": "setup-const",
|
|
@@ -66,7 +67,7 @@ import ContextMenu from './components/ContextMenu';
|
|
|
66
67
|
import { useRightMenuContext, useTableTool } from "./hooks";
|
|
67
68
|
import { randomString } from "@jetlinks-web/utils";
|
|
68
69
|
import { bodyProps, defaultProps } from "./props";
|
|
69
|
-
import { ref, reactive, computed, watch, onMounted, onBeforeUnmount } from 'vue';
|
|
70
|
+
import { ref, reactive, computed, watch, onMounted, onBeforeUnmount, nextTick } from 'vue';
|
|
70
71
|
import { handleColumnFixed } from "./utils";
|
|
71
72
|
const __sfc_main__ = Object.assign({
|
|
72
73
|
name: 'JEditTableBody'
|
|
@@ -37,6 +37,8 @@ function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]
|
|
|
37
37
|
"ref": "setup-const",
|
|
38
38
|
"reactive": "setup-const",
|
|
39
39
|
"defineOptions": "setup-const",
|
|
40
|
+
"computed": "setup-const",
|
|
41
|
+
"watch": "setup-const",
|
|
40
42
|
"bodyProps": "setup-maybe-ref",
|
|
41
43
|
"defaultProps": "setup-maybe-ref",
|
|
42
44
|
"findIndex": "setup-maybe-ref",
|
|
@@ -55,7 +57,7 @@ function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]
|
|
|
55
57
|
"fields": "setup-const",
|
|
56
58
|
"fieldsErrMap": "setup-ref",
|
|
57
59
|
"sortData": "setup-reactive-const",
|
|
58
|
-
"_dataSource": "setup-
|
|
60
|
+
"_dataSource": "setup-ref",
|
|
59
61
|
"isFullscreen": "setup-maybe-ref",
|
|
60
62
|
"toggle": "setup-maybe-ref",
|
|
61
63
|
"rules": "setup-maybe-ref",
|
|
@@ -67,7 +69,7 @@ function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]
|
|
|
67
69
|
"findField": "setup-const",
|
|
68
70
|
"removeFieldError": "setup-const",
|
|
69
71
|
"addFieldError": "setup-const",
|
|
70
|
-
"scrollWidth": "setup-
|
|
72
|
+
"scrollWidth": "setup-ref",
|
|
71
73
|
"onHorizontalScroll": "setup-const",
|
|
72
74
|
"onResize": "setup-const",
|
|
73
75
|
"onScrollDown": "setup-const",
|
|
@@ -90,7 +92,7 @@ import { tableProps } from 'ant-design-vue/lib/table';
|
|
|
90
92
|
import Header from './header.js';
|
|
91
93
|
import Body from './body.js';
|
|
92
94
|
import { useFullscreen } from '@vueuse/core';
|
|
93
|
-
import { provide, useAttrs, useSlots, ref, reactive, } from 'vue';
|
|
95
|
+
import { provide, useAttrs, useSlots, ref, reactive, computed, watch } from 'vue';
|
|
94
96
|
import { bodyProps, defaultProps } from "./props";
|
|
95
97
|
import { findIndex, get, sortBy } from 'lodash-es';
|
|
96
98
|
const __sfc_main__ = Object.assign({
|
|
@@ -343,7 +345,7 @@ const __sfc_main__ = Object.assign({
|
|
|
343
345
|
_createElementVNode("div", _hoisted_2, [
|
|
344
346
|
_createElementVNode("div", {
|
|
345
347
|
class: "jetlinks-edit-table-header",
|
|
346
|
-
style: _normalizeStyle([{ "height": "50px" }, { paddingRight:
|
|
348
|
+
style: _normalizeStyle([{ "height": "50px" }, { paddingRight: scrollWidth.value + 'px' }])
|
|
347
349
|
}, [
|
|
348
350
|
_createVNode(Header, {
|
|
349
351
|
columns: myColumns.value,
|
|
@@ -353,7 +355,7 @@ const __sfc_main__ = Object.assign({
|
|
|
353
355
|
}, null, 8 /* PROPS */, ["columns", "style", "rowKey", "searchColumns"]),
|
|
354
356
|
_createElementVNode("div", {
|
|
355
357
|
class: "jetlinks-edit-table-header-scroll-hidden",
|
|
356
|
-
style: _normalizeStyle({ width:
|
|
358
|
+
style: _normalizeStyle({ width: scrollWidth.value + 'px' })
|
|
357
359
|
}, null, 4 /* STYLE */)
|
|
358
360
|
], 4 /* STYLE */),
|
|
359
361
|
_createElementVNode("div", {
|
|
@@ -363,7 +365,7 @@ const __sfc_main__ = Object.assign({
|
|
|
363
365
|
_createVNode(Body, {
|
|
364
366
|
ref_key: "tableBody",
|
|
365
367
|
ref: tableBody,
|
|
366
|
-
dataSource:
|
|
368
|
+
dataSource: _dataSource.value,
|
|
367
369
|
columns: myColumns.value,
|
|
368
370
|
cellHeight: _ctx.cellHeight,
|
|
369
371
|
height: _ctx.height,
|
|
@@ -401,7 +403,7 @@ const __sfc_main__ = Object.assign({
|
|
|
401
403
|
], 544 /* NEED_HYDRATION, NEED_PATCH */),
|
|
402
404
|
_createElementVNode("div", {
|
|
403
405
|
class: "jetlinks-edit-table-horizontal-scroll-hidden",
|
|
404
|
-
style: _normalizeStyle({ width:
|
|
406
|
+
style: _normalizeStyle({ width: scrollWidth.value + 'px' })
|
|
405
407
|
}, null, 4 /* STYLE */)
|
|
406
408
|
]))
|
|
407
409
|
: _createCommentVNode("v-if", true)
|
|
@@ -22,6 +22,7 @@ function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]
|
|
|
22
22
|
"reactive": "setup-const",
|
|
23
23
|
"watch": "setup-const",
|
|
24
24
|
"defineOptions": "setup-const",
|
|
25
|
+
"provide": "setup-const",
|
|
25
26
|
"get": "setup-maybe-ref",
|
|
26
27
|
"isArray": "setup-maybe-ref",
|
|
27
28
|
"useProvideFormItemContext": "setup-maybe-ref",
|
|
@@ -47,14 +48,14 @@ function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]
|
|
|
47
48
|
"onFieldChange": "setup-const"
|
|
48
49
|
} */
|
|
49
50
|
import { toDisplayString as _toDisplayString, createElementVNode as _createElementVNode, openBlock as _openBlock, createElementBlock as _createElementBlock, createCommentVNode as _createCommentVNode, resolveComponent as _resolveComponent, withCtx as _withCtx, createVNode as _createVNode, renderSlot as _renderSlot, normalizeClass as _normalizeClass, Fragment as _Fragment, pushScopeId as _pushScopeId, popScopeId as _popScopeId } from "vue";
|
|
50
|
-
const _withScopeId = n => (_pushScopeId("data-v-
|
|
51
|
+
const _withScopeId = n => (_pushScopeId("data-v-1723098069375"), n = n(), _popScopeId(), n);
|
|
51
52
|
const _hoisted_1 = { style: { "color": "#1d2129" } };
|
|
52
53
|
const _hoisted_2 = {
|
|
53
54
|
key: 0,
|
|
54
55
|
class: "table-form-error-target"
|
|
55
56
|
};
|
|
56
57
|
const _hoisted_3 = ["id"];
|
|
57
|
-
import { onBeforeUnmount, computed, reactive, watch, } from "vue";
|
|
58
|
+
import { onBeforeUnmount, computed, reactive, watch, provide } from "vue";
|
|
58
59
|
import { get, isArray } from 'lodash-es';
|
|
59
60
|
import { useProvideFormItemContext } from 'ant-design-vue/es/form/FormItemContext';
|
|
60
61
|
import { useInjectError, useInjectForm } from "./hooks";
|
package/lib/FullPage/FullPage.js
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
} */
|
|
7
7
|
import { defineComponent as _defineComponent } from 'vue';
|
|
8
8
|
import { unref as _unref, renderSlot as _renderSlot, createElementVNode as _createElementVNode, normalizeStyle as _normalizeStyle, openBlock as _openBlock, createElementBlock as _createElementBlock, pushScopeId as _pushScopeId, popScopeId as _popScopeId } from "vue";
|
|
9
|
-
const _withScopeId = n => (_pushScopeId("data-v-
|
|
9
|
+
const _withScopeId = n => (_pushScopeId("data-v-1723098070855"), n = n(), _popScopeId(), n);
|
|
10
10
|
const _hoisted_1 = { class: "full-page-warp-content" };
|
|
11
11
|
import { ref } from 'vue';
|
|
12
12
|
import { useElementBounding } from '@vueuse/core';
|
|
@@ -33,6 +33,7 @@ function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]
|
|
|
33
33
|
"nextTick": "setup-const",
|
|
34
34
|
"monaco": "setup-const",
|
|
35
35
|
"omit": "setup-maybe-ref",
|
|
36
|
+
"loadGrammars": "setup-maybe-ref",
|
|
36
37
|
"props": "setup-reactive-const",
|
|
37
38
|
"emit": "setup-const",
|
|
38
39
|
"dom": "setup-ref",
|
|
@@ -51,6 +52,7 @@ import { openBlock as _openBlock, createElementBlock as _createElementBlock } fr
|
|
|
51
52
|
import { ref, onMounted, watch, onUnmounted, toRaw, nextTick } from 'vue';
|
|
52
53
|
import * as monaco from 'monaco-editor';
|
|
53
54
|
import { omit } from 'lodash-es';
|
|
55
|
+
import { loadGrammars } from './grammars';
|
|
54
56
|
const __sfc_main__ = Object.assign({
|
|
55
57
|
name: 'JMonacoEditor'
|
|
56
58
|
}, {
|
|
@@ -147,6 +149,11 @@ const __sfc_main__ = Object.assign({
|
|
|
147
149
|
});
|
|
148
150
|
onMounted(async () => {
|
|
149
151
|
const _model = monaco.editor.createModel(props.modelValue, props.language);
|
|
152
|
+
const defaultOptions = Object.assign({
|
|
153
|
+
suggest: {
|
|
154
|
+
preview: true,
|
|
155
|
+
},
|
|
156
|
+
}, omit(props.options, ['readOnly']));
|
|
150
157
|
instance.value = monaco.editor.create(dom.value, {
|
|
151
158
|
model: _model,
|
|
152
159
|
tabSize: 2,
|
|
@@ -154,8 +161,9 @@ const __sfc_main__ = Object.assign({
|
|
|
154
161
|
scrollBeyondLastLine: false,
|
|
155
162
|
theme: props.theme,
|
|
156
163
|
formatOnPaste: true,
|
|
157
|
-
...
|
|
164
|
+
...defaultOptions
|
|
158
165
|
});
|
|
166
|
+
loadGrammars(monaco, instance.value);
|
|
159
167
|
instance.value.onDidChangeModelContent(() => {
|
|
160
168
|
//
|
|
161
169
|
const value = toRaw(instance.value).getValue();
|
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
var _typeof3 = require("@babel/runtime/helpers/typeof");
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports.loadGrammars = loadGrammars;
|
|
9
|
+
var _typeof2 = _interopRequireDefault(require("@babel/runtime/helpers/typeof"));
|
|
10
|
+
var _createForOfIteratorHelper2 = _interopRequireDefault(require("@babel/runtime/helpers/createForOfIteratorHelper"));
|
|
11
|
+
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
|
|
12
|
+
var _monacoEditorTextmate = require("monaco-editor-textmate");
|
|
13
|
+
var _monacoTextmate = require("monaco-textmate");
|
|
14
|
+
var _typescriptTmLanguage = _interopRequireDefault(require("shiki/languages/typescript.tmLanguage.json"));
|
|
15
|
+
var _javascriptTmLanguage = _interopRequireDefault(require("shiki/languages/javascript.tmLanguage.json"));
|
|
16
|
+
var _htmlTmLanguage = _interopRequireDefault(require("shiki/languages/html.tmLanguage.json"));
|
|
17
|
+
var _cssTmLanguage = _interopRequireDefault(require("shiki/languages/css.tmLanguage.json"));
|
|
18
|
+
function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return e; }; var t, e = {}, r = Object.prototype, n = r.hasOwnProperty, o = Object.defineProperty || function (t, e, r) { t[e] = r.value; }, i = "function" == typeof Symbol ? Symbol : {}, a = i.iterator || "@@iterator", c = i.asyncIterator || "@@asyncIterator", u = i.toStringTag || "@@toStringTag"; function define(t, e, r) { return Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }), t[e]; } try { define({}, ""); } catch (t) { define = function define(t, e, r) { return t[e] = r; }; } function wrap(t, e, r, n) { var i = e && e.prototype instanceof Generator ? e : Generator, a = Object.create(i.prototype), c = new Context(n || []); return o(a, "_invoke", { value: makeInvokeMethod(t, r, c) }), a; } function tryCatch(t, e, r) { try { return { type: "normal", arg: t.call(e, r) }; } catch (t) { return { type: "throw", arg: t }; } } e.wrap = wrap; var h = "suspendedStart", l = "suspendedYield", f = "executing", s = "completed", y = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var p = {}; define(p, a, function () { return this; }); var d = Object.getPrototypeOf, v = d && d(d(values([]))); v && v !== r && n.call(v, a) && (p = v); var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p); function defineIteratorMethods(t) { ["next", "throw", "return"].forEach(function (e) { define(t, e, function (t) { return this._invoke(e, t); }); }); } function AsyncIterator(t, e) { function invoke(r, o, i, a) { var c = tryCatch(t[r], t, o); if ("throw" !== c.type) { var u = c.arg, h = u.value; return h && "object" == _typeof3(h) && n.call(h, "__await") ? e.resolve(h.__await).then(function (t) { invoke("next", t, i, a); }, function (t) { invoke("throw", t, i, a); }) : e.resolve(h).then(function (t) { u.value = t, i(u); }, function (t) { return invoke("throw", t, i, a); }); } a(c.arg); } var r; o(this, "_invoke", { value: function value(t, n) { function callInvokeWithMethodAndArg() { return new e(function (e, r) { invoke(t, n, e, r); }); } return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(e, r, n) { var o = h; return function (i, a) { if (o === f) throw Error("Generator is already running"); if (o === s) { if ("throw" === i) throw a; return { value: t, done: !0 }; } for (n.method = i, n.arg = a;;) { var c = n.delegate; if (c) { var u = maybeInvokeDelegate(c, n); if (u) { if (u === y) continue; return u; } } if ("next" === n.method) n.sent = n._sent = n.arg;else if ("throw" === n.method) { if (o === h) throw o = s, n.arg; n.dispatchException(n.arg); } else "return" === n.method && n.abrupt("return", n.arg); o = f; var p = tryCatch(e, r, n); if ("normal" === p.type) { if (o = n.done ? s : l, p.arg === y) continue; return { value: p.arg, done: n.done }; } "throw" === p.type && (o = s, n.method = "throw", n.arg = p.arg); } }; } function maybeInvokeDelegate(e, r) { var n = r.method, o = e.iterator[n]; if (o === t) return r.delegate = null, "throw" === n && e.iterator.return && (r.method = "return", r.arg = t, maybeInvokeDelegate(e, r), "throw" === r.method) || "return" !== n && (r.method = "throw", r.arg = new TypeError("The iterator does not provide a '" + n + "' method")), y; var i = tryCatch(o, e.iterator, r.arg); if ("throw" === i.type) return r.method = "throw", r.arg = i.arg, r.delegate = null, y; var a = i.arg; return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, "return" !== r.method && (r.method = "next", r.arg = t), r.delegate = null, y) : a : (r.method = "throw", r.arg = new TypeError("iterator result is not an object"), r.delegate = null, y); } function pushTryEntry(t) { var e = { tryLoc: t[0] }; 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e); } function resetTryEntry(t) { var e = t.completion || {}; e.type = "normal", delete e.arg, t.completion = e; } function Context(t) { this.tryEntries = [{ tryLoc: "root" }], t.forEach(pushTryEntry, this), this.reset(!0); } function values(e) { if (e || "" === e) { var r = e[a]; if (r) return r.call(e); if ("function" == typeof e.next) return e; if (!isNaN(e.length)) { var o = -1, i = function next() { for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next; return next.value = t, next.done = !0, next; }; return i.next = i; } } throw new TypeError(_typeof3(e) + " is not iterable"); } return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), o(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, "GeneratorFunction"), e.isGeneratorFunction = function (t) { var e = "function" == typeof t && t.constructor; return !!e && (e === GeneratorFunction || "GeneratorFunction" === (e.displayName || e.name)); }, e.mark = function (t) { return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, "GeneratorFunction")), t.prototype = Object.create(g), t; }, e.awrap = function (t) { return { __await: t }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () { return this; }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) { void 0 === i && (i = Promise); var a = new AsyncIterator(wrap(t, r, n, o), i); return e.isGeneratorFunction(r) ? a : a.next().then(function (t) { return t.done ? t.value : a.next(); }); }, defineIteratorMethods(g), define(g, u, "Generator"), define(g, a, function () { return this; }), define(g, "toString", function () { return "[object Generator]"; }), e.keys = function (t) { var e = Object(t), r = []; for (var n in e) r.push(n); return r.reverse(), function next() { for (; r.length;) { var t = r.pop(); if (t in e) return next.value = t, next.done = !1, next; } return next.done = !0, next; }; }, e.values = values, Context.prototype = { constructor: Context, reset: function reset(e) { if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = "next", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) "t" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t); }, stop: function stop() { this.done = !0; var t = this.tryEntries[0].completion; if ("throw" === t.type) throw t.arg; return this.rval; }, dispatchException: function dispatchException(e) { if (this.done) throw e; var r = this; function handle(n, o) { return a.type = "throw", a.arg = e, r.next = n, o && (r.method = "next", r.arg = t), !!o; } for (var o = this.tryEntries.length - 1; o >= 0; --o) { var i = this.tryEntries[o], a = i.completion; if ("root" === i.tryLoc) return handle("end"); if (i.tryLoc <= this.prev) { var c = n.call(i, "catchLoc"), u = n.call(i, "finallyLoc"); if (c && u) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } else if (c) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); } else { if (!u) throw Error("try statement without catch or finally"); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } } } }, abrupt: function abrupt(t, e) { for (var r = this.tryEntries.length - 1; r >= 0; --r) { var o = this.tryEntries[r]; if (o.tryLoc <= this.prev && n.call(o, "finallyLoc") && this.prev < o.finallyLoc) { var i = o; break; } } i && ("break" === t || "continue" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null); var a = i ? i.completion : {}; return a.type = t, a.arg = e, i ? (this.method = "next", this.next = i.finallyLoc, y) : this.complete(a); }, complete: function complete(t, e) { if ("throw" === t.type) throw t.arg; return "break" === t.type || "continue" === t.type ? this.next = t.arg : "return" === t.type ? (this.rval = this.arg = t.arg, this.method = "return", this.next = "end") : "normal" === t.type && e && (this.next = e), y; }, finish: function finish(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y; } }, catch: function _catch(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.tryLoc === t) { var n = r.completion; if ("throw" === n.type) { var o = n.arg; resetTryEntry(r); } return o; } } throw Error("illegal catch attempt"); }, delegateYield: function delegateYield(e, r, n) { return this.delegate = { iterator: values(e), resultName: r, nextLoc: n }, "next" === this.method && (this.arg = t), y; } }, e; }
|
|
19
|
+
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
|
|
20
|
+
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != (0, _typeof2.default)(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
21
|
+
function dispatchGrammars(_x) {
|
|
22
|
+
return _dispatchGrammars.apply(this, arguments);
|
|
23
|
+
}
|
|
24
|
+
function _dispatchGrammars() {
|
|
25
|
+
_dispatchGrammars = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(scopeName) {
|
|
26
|
+
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
27
|
+
while (1) switch (_context.prev = _context.next) {
|
|
28
|
+
case 0:
|
|
29
|
+
_context.t0 = scopeName;
|
|
30
|
+
_context.next = _context.t0 === "source.js" ? 3 : _context.t0 === "source.ts" ? 4 : _context.t0 === "source.js" ? 5 : _context.t0 === "text.html.basic" ? 6 : _context.t0 === "source.css" ? 7 : 8;
|
|
31
|
+
break;
|
|
32
|
+
case 3:
|
|
33
|
+
return _context.abrupt("return", {
|
|
34
|
+
format: "json",
|
|
35
|
+
content: Promise.resolve().then(function () {
|
|
36
|
+
return _interopRequireWildcard(require('shiki/languages/vue.tmLanguage.json'));
|
|
37
|
+
})
|
|
38
|
+
});
|
|
39
|
+
case 4:
|
|
40
|
+
return _context.abrupt("return", {
|
|
41
|
+
format: "json",
|
|
42
|
+
content: _typescriptTmLanguage.default
|
|
43
|
+
});
|
|
44
|
+
case 5:
|
|
45
|
+
return _context.abrupt("return", {
|
|
46
|
+
format: "json",
|
|
47
|
+
content: _javascriptTmLanguage.default
|
|
48
|
+
});
|
|
49
|
+
case 6:
|
|
50
|
+
return _context.abrupt("return", {
|
|
51
|
+
format: "json",
|
|
52
|
+
content: _htmlTmLanguage.default
|
|
53
|
+
});
|
|
54
|
+
case 7:
|
|
55
|
+
return _context.abrupt("return", {
|
|
56
|
+
format: "json",
|
|
57
|
+
content: _cssTmLanguage.default
|
|
58
|
+
});
|
|
59
|
+
case 8:
|
|
60
|
+
return _context.abrupt("return", {
|
|
61
|
+
format: "json",
|
|
62
|
+
content: {
|
|
63
|
+
scopeName: "source",
|
|
64
|
+
patterns: []
|
|
65
|
+
}
|
|
66
|
+
});
|
|
67
|
+
case 9:
|
|
68
|
+
case "end":
|
|
69
|
+
return _context.stop();
|
|
70
|
+
}
|
|
71
|
+
}, _callee);
|
|
72
|
+
}));
|
|
73
|
+
return _dispatchGrammars.apply(this, arguments);
|
|
74
|
+
}
|
|
75
|
+
function loadGrammars(_x2, _x3) {
|
|
76
|
+
return _loadGrammars.apply(this, arguments);
|
|
77
|
+
}
|
|
78
|
+
function _loadGrammars() {
|
|
79
|
+
_loadGrammars = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(monaco, editor) {
|
|
80
|
+
var registry, grammars, _iterator, _step, lang;
|
|
81
|
+
return _regeneratorRuntime().wrap(function _callee3$(_context3) {
|
|
82
|
+
while (1) switch (_context3.prev = _context3.next) {
|
|
83
|
+
case 0:
|
|
84
|
+
registry = new _monacoTextmate.Registry({
|
|
85
|
+
getGrammarDefinition: function () {
|
|
86
|
+
var _getGrammarDefinition = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(scopeName) {
|
|
87
|
+
var dispatch;
|
|
88
|
+
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
89
|
+
while (1) switch (_context2.prev = _context2.next) {
|
|
90
|
+
case 0:
|
|
91
|
+
_context2.next = 2;
|
|
92
|
+
return dispatchGrammars(scopeName);
|
|
93
|
+
case 2:
|
|
94
|
+
dispatch = _context2.sent;
|
|
95
|
+
console.log('scopeName', scopeName, dispatch);
|
|
96
|
+
return _context2.abrupt("return", JSON.parse(JSON.stringify(dispatch)));
|
|
97
|
+
case 5:
|
|
98
|
+
case "end":
|
|
99
|
+
return _context2.stop();
|
|
100
|
+
}
|
|
101
|
+
}, _callee2);
|
|
102
|
+
}));
|
|
103
|
+
function getGrammarDefinition(_x4) {
|
|
104
|
+
return _getGrammarDefinition.apply(this, arguments);
|
|
105
|
+
}
|
|
106
|
+
return getGrammarDefinition;
|
|
107
|
+
}()
|
|
108
|
+
});
|
|
109
|
+
grammars = new Map();
|
|
110
|
+
grammars.set("vue", "source.js");
|
|
111
|
+
grammars.set("javascript", "source.js");
|
|
112
|
+
grammars.set("typescript", "source.ts");
|
|
113
|
+
grammars.set("css", "source.css");
|
|
114
|
+
grammars.set("html", "text.html.basic");
|
|
115
|
+
_iterator = (0, _createForOfIteratorHelper2.default)(grammars.keys());
|
|
116
|
+
try {
|
|
117
|
+
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
118
|
+
lang = _step.value;
|
|
119
|
+
monaco.languages.register({
|
|
120
|
+
id: lang
|
|
121
|
+
});
|
|
122
|
+
}
|
|
123
|
+
} catch (err) {
|
|
124
|
+
_iterator.e(err);
|
|
125
|
+
} finally {
|
|
126
|
+
_iterator.f();
|
|
127
|
+
}
|
|
128
|
+
_context3.next = 11;
|
|
129
|
+
return (0, _monacoEditorTextmate.wireTmGrammars)(monaco, registry, grammars, editor);
|
|
130
|
+
case 11:
|
|
131
|
+
case "end":
|
|
132
|
+
return _context3.stop();
|
|
133
|
+
}
|
|
134
|
+
}, _callee3);
|
|
135
|
+
}));
|
|
136
|
+
return _loadGrammars.apply(this, arguments);
|
|
137
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";
|