@difizen/libro-codemirror 0.0.2-alpha.0 → 0.1.1
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/auto-complete/closebrackets.js +1 -1
- package/es/auto-complete/completion.js +5 -5
- package/es/auto-complete/filter.d.ts.map +1 -1
- package/es/auto-complete/filter.js +9 -4
- package/es/auto-complete/index.d.ts.map +1 -1
- package/es/auto-complete/index.js +9 -5
- package/es/auto-complete/snippet.d.ts.map +1 -1
- package/es/auto-complete/snippet.js +6 -8
- package/es/auto-complete/state.d.ts.map +1 -1
- package/es/auto-complete/state.js +29 -22
- package/es/auto-complete/tooltip.js +1 -1
- package/es/auto-complete/view.d.ts +0 -5
- package/es/auto-complete/view.d.ts.map +1 -1
- package/es/auto-complete/view.js +64 -57
- package/es/completion.js +2 -2
- package/es/config.js +5 -5
- package/es/editor.d.ts.map +1 -1
- package/es/editor.js +8 -8
- package/es/factory.js +3 -3
- package/es/hyperlink.js +1 -1
- package/es/indentation-markers/index.js +1 -1
- package/es/indentation-markers/map.js +1 -1
- package/es/mimetype.js +1 -1
- package/es/mode.d.ts.map +1 -1
- package/es/mode.js +2 -7
- package/es/monitor.js +4 -4
- package/es/style/base.css +2 -4
- package/es/style/variables.css +2 -0
- package/es/tooltip.js +1 -1
- package/package.json +6 -6
- package/src/auto-complete/filter.ts +14 -13
- package/src/auto-complete/index.ts +7 -6
- package/src/auto-complete/snippet.ts +3 -11
- package/src/auto-complete/state.ts +26 -27
- package/src/auto-complete/view.ts +10 -8
- package/src/editor.ts +20 -14
- package/src/index.spec.ts +11 -0
- package/src/mode.ts +1 -6
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
function _typeof(
|
|
1
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
2
2
|
function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; }
|
|
3
3
|
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
4
4
|
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
function _typeof(
|
|
2
|
-
function ownKeys(
|
|
3
|
-
function _objectSpread(
|
|
1
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
2
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
3
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
4
4
|
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
5
5
|
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
6
6
|
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
7
|
-
function _iterableToArrayLimit(
|
|
7
|
+
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
|
8
8
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
9
|
-
function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(
|
|
9
|
+
function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; }
|
|
10
10
|
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
11
11
|
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
12
12
|
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"filter.d.ts","sourceRoot":"","sources":["../../src/auto-complete/filter.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"filter.d.ts","sourceRoot":"","sources":["../../src/auto-complete/filter.ts"],"names":[],"mappings":"AAsBA,qBAAa,YAAY;IAWX,QAAQ,CAAC,OAAO,EAAE,MAAM;IAVpC,KAAK,EAAE,MAAM,EAAE,CAAM;IACrB,MAAM,EAAE,MAAM,EAAE,CAAM;IACtB,MAAM,EAAE,OAAO,CAAC;IAIhB,GAAG,EAAE,MAAM,EAAE,CAAM;IACnB,OAAO,EAAE,MAAM,EAAE,CAAM;IACvB,MAAM,EAAE,MAAM,EAAE,CAAM;gBAED,OAAO,EAAE,MAAM;IAoBpC,KAAK,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,EAAE,GAAG,IAAI;IAoJpC,MAAM,CAAC,KAAK,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,EAAE,IAAI,EAAE,MAAM;CAcxD"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
function _typeof(
|
|
1
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
2
2
|
function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e2) { throw _e2; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e3) { didErr = true; err = _e3; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; }
|
|
3
3
|
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
4
4
|
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
@@ -7,9 +7,8 @@ function _defineProperties(target, props) { for (var i = 0; i < props.length; i+
|
|
|
7
7
|
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
8
8
|
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
9
9
|
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
10
|
+
/* eslint-disable no-unused-vars */
|
|
10
11
|
/* eslint-disable prefer-const */
|
|
11
|
-
/* eslint-disable @typescript-eslint/no-parameter-properties */
|
|
12
|
-
/* eslint-disable @typescript-eslint/parameter-properties */
|
|
13
12
|
import { codePointAt, codePointSize, fromCodePoint } from '@codemirror/state';
|
|
14
13
|
|
|
15
14
|
// Scores are counted from 0 (great match) down to negative numbers,
|
|
@@ -77,7 +76,13 @@ export var FuzzyMatcher = /*#__PURE__*/function () {
|
|
|
77
76
|
// at the start
|
|
78
77
|
if (chars.length === 1) {
|
|
79
78
|
var first = codePointAt(word, 0);
|
|
80
|
-
|
|
79
|
+
if (first === chars[0]) {
|
|
80
|
+
return [0, 0, codePointSize(first)];
|
|
81
|
+
}
|
|
82
|
+
if (first === folded[0]) {
|
|
83
|
+
return [Penalty.CaseFold, 0, codePointSize(first)];
|
|
84
|
+
}
|
|
85
|
+
return null;
|
|
81
86
|
}
|
|
82
87
|
var direct = word.indexOf(this.pattern);
|
|
83
88
|
if (direct === 0) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/auto-complete/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/auto-complete/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAE7E,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAKnD,OAAO,KAAK,EAAE,UAAU,EAAU,MAAM,iBAAiB,CAAC;AAC1D,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAWpD,cAAc,cAAc,CAAC;AAC7B,cAAc,iBAAiB,CAAC;AAChC,cAAc,WAAW,CAAC;AAC1B,cAAc,WAAW,CAAC;AAC1B,cAAc,oBAAoB,CAAC;AAGnC,wBAAgB,cAAc,CAAC,MAAM,GAAE,gBAAqB,GAAG,SAAS,CAQvE;AAWD,eAAO,MAAM,gBAAgB,EAAE,SAAS,UAAU,EAQjD,CAAC;AAYF,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,WAAW,GAAG,IAAI,GAAG,QAAQ,GAAG,SAAS,CAShF;AAMD,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,WAAW,GAAG,SAAS,UAAU,EAAE,CAa5E;AAGD,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,WAAW,GAAG,UAAU,GAAG,IAAI,CAGxE;AAID,wBAAgB,uBAAuB,CAAC,KAAK,EAAE,WAAW,GAAG,MAAM,GAAG,IAAI,CAGzE;AAID,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,MAAM,GAAG,WAAW,CAAC,OAAO,CAAC,CAEzE"}
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
/* eslint-disable @typescript-eslint/no-use-before-define */
|
|
2
|
-
|
|
3
1
|
import { Prec } from '@codemirror/state';
|
|
4
2
|
import { keymap } from '@codemirror/view';
|
|
5
3
|
import { indentOrCompletion, indentOrTooltip } from "../indent.js";
|
|
@@ -61,11 +59,17 @@ var completionKeymapExt = Prec.highest(keymap.computeN([completionConfig], funct
|
|
|
61
59
|
/// returns `null`.
|
|
62
60
|
export function completionStatus(state) {
|
|
63
61
|
var cState = state.field(completionState, false);
|
|
64
|
-
|
|
62
|
+
if (cState && cState.active.some(function (a) {
|
|
65
63
|
return a.state === State.Pending;
|
|
66
|
-
})
|
|
64
|
+
})) {
|
|
65
|
+
return 'pending';
|
|
66
|
+
}
|
|
67
|
+
if (cState && cState.active.some(function (a) {
|
|
67
68
|
return a.state !== State.Inactive;
|
|
68
|
-
})
|
|
69
|
+
})) {
|
|
70
|
+
return 'active';
|
|
71
|
+
}
|
|
72
|
+
return null;
|
|
69
73
|
}
|
|
70
74
|
var completionArrayCache = new WeakMap();
|
|
71
75
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"snippet.d.ts","sourceRoot":"","sources":["../../src/auto-complete/snippet.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"snippet.d.ts","sourceRoot":"","sources":["../../src/auto-complete/snippet.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAEV,WAAW,EACX,WAAW,EAEX,YAAY,EACb,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAML,KAAK,EAEN,MAAM,mBAAmB,CAAC;AAC3B,OAAO,KAAK,EAAiB,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAGlE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AA8OlD,wBAAgB,OAAO,CAAC,QAAQ,EAAE,MAAM;WAGnB,WAAW;mBAAiB,WAAW,KAAK,IAAI;gBACpD,UAAU,QACjB,MAAM,MACR,MAAM,UA0Bb;AAqBD,eAAO,MAAM,YAAY,EAAE,YAO1B,CAAC;AAGF,eAAO,MAAM,gBAAgB,cAAe,CAAC;AAG7C,eAAO,MAAM,gBAAgB,cAAgB,CAAC;AAY9C,eAAO,MAAM,aAAa,qDAMzB,CAAC;AASF,wBAAgB,iBAAiB,CAC/B,QAAQ,EAAE,MAAM,EAChB,UAAU,EAAE,UAAU,GACrB,UAAU,CAEZ"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
function _typeof(
|
|
2
|
-
function ownKeys(
|
|
3
|
-
function _objectSpread(
|
|
1
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
2
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
3
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
4
4
|
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
5
5
|
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
|
|
6
6
|
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
@@ -17,12 +17,9 @@ function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _d
|
|
|
17
17
|
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
18
18
|
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
19
19
|
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
20
|
-
/* eslint-disable @typescript-eslint/no-
|
|
20
|
+
/* eslint-disable @typescript-eslint/no-non-null-assertion */
|
|
21
21
|
/* eslint-disable @typescript-eslint/no-shadow */
|
|
22
22
|
/* eslint-disable prefer-const */
|
|
23
|
-
/* eslint-disable no-param-reassign */
|
|
24
|
-
/* eslint-disable @typescript-eslint/no-parameter-properties */
|
|
25
|
-
/* eslint-disable @typescript-eslint/parameter-properties */
|
|
26
23
|
import { indentUnit } from '@codemirror/language';
|
|
27
24
|
import { StateField, StateEffect, EditorSelection, Text, Prec, Facet, MapMode } from '@codemirror/state';
|
|
28
25
|
import { Decoration, WidgetType, EditorView, keymap } from '@codemirror/view';
|
|
@@ -111,7 +108,8 @@ var Snippet = /*#__PURE__*/function () {
|
|
|
111
108
|
name = m[2] || m[3] || '',
|
|
112
109
|
found = -1;
|
|
113
110
|
for (var i = 0; i < fields.length; i++) {
|
|
114
|
-
|
|
111
|
+
var sameName = name ? fields[i].name === name : false;
|
|
112
|
+
if (seq !== null ? fields[i].seq === seq : sameName) {
|
|
115
113
|
found = i;
|
|
116
114
|
}
|
|
117
115
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"state.d.ts","sourceRoot":"","sources":["../../src/auto-complete/state.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"state.d.ts","sourceRoot":"","sources":["../../src/auto-complete/state.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAC9E,OAAO,EAAE,UAAU,EAAe,MAAM,mBAAmB,CAAC;AAC5D,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAGhD,OAAO,KAAK,EAAE,gBAAgB,EAAE,gBAAgB,EAAc,MAAM,iBAAiB,CAAC;AACtF,OAAO,EACL,MAAM,EAKP,MAAM,iBAAiB,CAAC;AACzB,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAsEpD,cAAM,gBAAgB;IAElB,QAAQ,CAAC,OAAO,EAAE,SAAS,MAAM,EAAE;IACnC,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC;IACtC,QAAQ,CAAC,OAAO,EAAE,OAAO;IACzB,QAAQ,CAAC,SAAS,EAAE,MAAM;IAC1B,QAAQ,CAAC,QAAQ,EAAE,MAAM;gBAJhB,OAAO,EAAE,SAAS,MAAM,EAAE,EAC1B,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,EAC7B,OAAO,EAAE,OAAO,EAChB,SAAS,EAAE,MAAM,EACjB,QAAQ,EAAE,MAAM;IAG3B,WAAW,CAAC,QAAQ,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM;IAYxC,MAAM,CAAC,KAAK,CACV,MAAM,EAAE,SAAS,YAAY,EAAE,EAC/B,KAAK,EAAE,WAAW,EAClB,EAAE,EAAE,MAAM,EACV,IAAI,EAAE,gBAAgB,GAAG,IAAI,EAC7B,IAAI,EAAE,QAAQ,CAAC,gBAAgB,CAAC,GAC/B,gBAAgB,GAAG,IAAI;IA4B1B,GAAG,CAAC,OAAO,EAAE,UAAU;CASxB;AAED,qBAAa,eAAe;IAExB,QAAQ,CAAC,MAAM,EAAE,SAAS,YAAY,EAAE;IACxC,QAAQ,CAAC,EAAE,EAAE,MAAM;IACnB,QAAQ,CAAC,IAAI,EAAE,gBAAgB,GAAG,IAAI;gBAF7B,MAAM,EAAE,SAAS,YAAY,EAAE,EAC/B,EAAE,EAAE,MAAM,EACV,IAAI,EAAE,gBAAgB,GAAG,IAAI;IAGxC,MAAM,CAAC,KAAK;IAQZ,MAAM,CAAC,EAAE,EAAE,WAAW;IA0DtB,IAAI,OAAO,IAAI,OAAO,GAAG,IAAI,CAE5B;IAED,IAAI,KAAK;;MAER;CACF;AA0CD,0BAAkB,KAAK;IACrB,QAAQ,IAAI;IACZ,OAAO,IAAI;IACX,MAAM,IAAI;CACX;AAED,wBAAgB,YAAY,CAAC,EAAE,EAAE,WAAW,GAAG,OAAO,GAAG,QAAQ,GAAG,IAAI,CAQvE;AAED,qBAAa,YAAY;IAErB,QAAQ,CAAC,MAAM,EAAE,gBAAgB;IACjC,QAAQ,CAAC,KAAK,EAAE,KAAK;IACrB,QAAQ,CAAC,WAAW,EAAE,MAAM;gBAFnB,MAAM,EAAE,gBAAgB,EACxB,KAAK,EAAE,KAAK,EACZ,WAAW,GAAE,MAAW;IAGnC,SAAS,IAAI,IAAI,IAAI,YAAY;IAIjC,MAAM,CAAC,EAAE,EAAE,WAAW,EAAE,IAAI,EAAE,QAAQ,CAAC,gBAAgB,CAAC,GAAG,YAAY;IA+BvE,eAAe,CACb,EAAE,EAAE,WAAW,EACf,IAAI,EAAE,OAAO,GAAG,QAAQ,EACxB,IAAI,EAAE,QAAQ,CAAC,gBAAgB,CAAC,GAC/B,YAAY;IAMf,YAAY,CAAC,EAAE,EAAE,WAAW,GAAG,YAAY;IAM3C,GAAG,CAAC,OAAO,EAAE,UAAU;CAKxB;AAED,qBAAa,YAAa,SAAQ,YAAY;IAI1C,QAAQ,CAAC,MAAM,EAAE,gBAAgB;IACjC,QAAQ,CAAC,IAAI,EAAE,MAAM;IACrB,QAAQ,CAAC,EAAE,EAAE,MAAM;gBAJnB,MAAM,EAAE,gBAAgB,EACxB,WAAW,EAAE,MAAM,EACV,MAAM,EAAE,gBAAgB,EACxB,IAAI,EAAE,MAAM,EACZ,EAAE,EAAE,MAAM;IAKZ,SAAS,IAAI,IAAI,IAAI,YAAY;IAIjC,eAAe,CACtB,EAAE,EAAE,WAAW,EACf,IAAI,EAAE,OAAO,GAAG,QAAQ,EACxB,IAAI,EAAE,QAAQ,CAAC,gBAAgB,CAAC,GAC/B,YAAY;IAuCN,YAAY,CAAC,EAAE,EAAE,WAAW,GAAG,YAAY;IAM3C,GAAG,CAAC,OAAO,EAAE,UAAU;CAWjC;AAoBD,eAAO,MAAM,qBAAqB,sDAAgC,CAAC;AACnE,eAAO,MAAM,qBAAqB,mDAA6B,CAAC;AAChE,eAAO,MAAM,eAAe,sEAI1B,CAAC;AACH,eAAO,MAAM,iBAAiB,qDAA+B,CAAC;AAE9D,eAAO,MAAM,eAAe,6BAa1B,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
function _typeof(
|
|
1
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
2
2
|
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
|
|
3
3
|
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
4
4
|
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
@@ -6,8 +6,8 @@ function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) ===
|
|
|
6
6
|
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
7
7
|
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
8
8
|
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
9
|
-
function ownKeys(
|
|
10
|
-
function _objectSpread(
|
|
9
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
10
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
11
11
|
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
12
12
|
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
13
13
|
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
|
|
@@ -18,10 +18,6 @@ function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol
|
|
|
18
18
|
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
19
19
|
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
20
20
|
/* eslint-disable @typescript-eslint/no-this-alias */
|
|
21
|
-
/* eslint-disable @typescript-eslint/no-use-before-define */
|
|
22
|
-
/* eslint-disable @typescript-eslint/no-parameter-properties */
|
|
23
|
-
/* eslint-disable @typescript-eslint/parameter-properties */
|
|
24
|
-
/* eslint-disable prefer-const */
|
|
25
21
|
|
|
26
22
|
import { StateField, StateEffect } from '@codemirror/state';
|
|
27
23
|
import { EditorView, showTooltip } from '@codemirror/view';
|
|
@@ -36,8 +32,8 @@ function score(option) {
|
|
|
36
32
|
return (option.boost || 0) * 100 + (option.apply ? 10 : 0) + (option.info ? 5 : 0) + (option.type ? 1 : 0);
|
|
37
33
|
}
|
|
38
34
|
function sortOptions(active, state) {
|
|
39
|
-
var options = []
|
|
40
|
-
|
|
35
|
+
var options = [];
|
|
36
|
+
var i = 0;
|
|
41
37
|
var _iterator = _createForOfIteratorHelper(active),
|
|
42
38
|
_step;
|
|
43
39
|
try {
|
|
@@ -74,8 +70,8 @@ function sortOptions(active, state) {
|
|
|
74
70
|
_iterator3.f();
|
|
75
71
|
}
|
|
76
72
|
} else {
|
|
77
|
-
var matcher = new FuzzyMatcher(state.sliceDoc(a.from, a.to))
|
|
78
|
-
|
|
73
|
+
var matcher = new FuzzyMatcher(state.sliceDoc(a.from, a.to));
|
|
74
|
+
var _match = void 0;
|
|
79
75
|
var _iterator5 = _createForOfIteratorHelper(a.result.options),
|
|
80
76
|
_step5;
|
|
81
77
|
try {
|
|
@@ -101,8 +97,8 @@ function sortOptions(active, state) {
|
|
|
101
97
|
} finally {
|
|
102
98
|
_iterator.f();
|
|
103
99
|
}
|
|
104
|
-
var result = []
|
|
105
|
-
|
|
100
|
+
var result = [];
|
|
101
|
+
var prev = null;
|
|
106
102
|
var compare = state.facet(completionConfig).compareCompletions;
|
|
107
103
|
var _iterator2 = _createForOfIteratorHelper(options.sort(function (a, b) {
|
|
108
104
|
return b.match[0] - a.match[0] || compare(a.completion, b.completion);
|
|
@@ -185,8 +181,8 @@ export var CompletionState = /*#__PURE__*/function () {
|
|
|
185
181
|
key: "update",
|
|
186
182
|
value: function update(tr) {
|
|
187
183
|
var _this = this;
|
|
188
|
-
var state = tr.state
|
|
189
|
-
|
|
184
|
+
var state = tr.state;
|
|
185
|
+
var conf = state.facet(completionConfig);
|
|
190
186
|
var sources = conf.override || state.languageDataAt('autocomplete', cur(state)).map(asSource);
|
|
191
187
|
var active = sources.map(function (source) {
|
|
192
188
|
var value = _this.active.find(function (s) {
|
|
@@ -201,9 +197,14 @@ export var CompletionState = /*#__PURE__*/function () {
|
|
|
201
197
|
})) {
|
|
202
198
|
active = this.active;
|
|
203
199
|
}
|
|
204
|
-
var open
|
|
200
|
+
var open;
|
|
201
|
+
if (tr.selection || active.some(function (a) {
|
|
205
202
|
return a.hasResult() && tr.changes.touchesRange(a.from, a.to);
|
|
206
|
-
}) || !sameResults(active, this.active)
|
|
203
|
+
}) || !sameResults(active, this.active)) {
|
|
204
|
+
open = CompletionDialog.build(active, state, this.id, this.open, conf);
|
|
205
|
+
} else {
|
|
206
|
+
open = this.open && tr.docChanged ? this.open.map(tr.changes) : this.open;
|
|
207
|
+
}
|
|
207
208
|
if (!open && active.every(function (a) {
|
|
208
209
|
return a.state !== State.Pending;
|
|
209
210
|
}) && active.some(function (a) {
|
|
@@ -290,7 +291,13 @@ export var State = /*#__PURE__*/function (State) {
|
|
|
290
291
|
return State;
|
|
291
292
|
}({});
|
|
292
293
|
export function getUserEvent(tr) {
|
|
293
|
-
|
|
294
|
+
if (tr.isUserEvent('input.type')) {
|
|
295
|
+
return 'input';
|
|
296
|
+
}
|
|
297
|
+
if (tr.isUserEvent('delete.backward')) {
|
|
298
|
+
return 'delete';
|
|
299
|
+
}
|
|
300
|
+
return null;
|
|
294
301
|
}
|
|
295
302
|
export var ActiveSource = /*#__PURE__*/function () {
|
|
296
303
|
function ActiveSource(source, state) {
|
|
@@ -308,8 +315,8 @@ export var ActiveSource = /*#__PURE__*/function () {
|
|
|
308
315
|
}, {
|
|
309
316
|
key: "update",
|
|
310
317
|
value: function update(tr, conf) {
|
|
311
|
-
var event = getUserEvent(tr)
|
|
312
|
-
|
|
318
|
+
var event = getUserEvent(tr);
|
|
319
|
+
var value = this;
|
|
313
320
|
if (event) {
|
|
314
321
|
value = value.handleUserEvent(tr, event, conf);
|
|
315
322
|
} else if (tr.docChanged) {
|
|
@@ -394,8 +401,8 @@ export var ActiveResult = /*#__PURE__*/function (_ActiveSource) {
|
|
|
394
401
|
if ((this.explicitPos < 0 ? pos <= from : pos < this.from) || pos > to || type === 'delete' && cur(tr.startState) === this.from) {
|
|
395
402
|
return new ActiveSource(this.source, type === 'input' && conf.activateOnTyping ? State.Pending : State.Inactive);
|
|
396
403
|
}
|
|
397
|
-
var explicitPos = this.explicitPos < 0 ? -1 : tr.changes.mapPos(this.explicitPos)
|
|
398
|
-
|
|
404
|
+
var explicitPos = this.explicitPos < 0 ? -1 : tr.changes.mapPos(this.explicitPos);
|
|
405
|
+
var updated;
|
|
399
406
|
if (checkValid(this.result.validFor, tr.state, from, to)) {
|
|
400
407
|
return new ActiveResult(this.source, explicitPos, this.result, from, to);
|
|
401
408
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
function _typeof(
|
|
1
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
2
2
|
function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; }
|
|
3
3
|
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
4
4
|
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
|
|
@@ -1,8 +1,3 @@
|
|
|
1
|
-
/// <reference types="node" resolution-mode="require"/>
|
|
2
|
-
/// <reference types="node" resolution-mode="require"/>
|
|
3
|
-
/// <reference types="node" resolution-mode="require"/>
|
|
4
|
-
/// <reference types="node" resolution-mode="require"/>
|
|
5
|
-
/// <reference types="node" resolution-mode="require"/>
|
|
6
1
|
import type { Transaction } from '@codemirror/state';
|
|
7
2
|
import type { EditorView, Command, ViewUpdate } from '@codemirror/view';
|
|
8
3
|
import { ViewPlugin } from '@codemirror/view';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"view.d.ts","sourceRoot":"","sources":["../../src/auto-complete/view.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"view.d.ts","sourceRoot":"","sources":["../../src/auto-complete/view.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AACrD,OAAO,KAAK,EACV,UAAU,EACV,OAAO,EAEP,UAAU,EAEX,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,UAAU,EAA4B,MAAM,kBAAkB,CAAC;AAExE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AACxD,OAAO,EAAO,iBAAiB,EAAmB,MAAM,iBAAiB,CAAC;AAE1E,OAAO,EAOL,YAAY,EAGb,MAAM,YAAY,CAAC;AAIpB,wBAAgB,uBAAuB,CACrC,OAAO,EAAE,OAAO,EAChB,EAAE,GAAE,QAAQ,GAAG,MAAiB,GAC/B,OAAO,CAyCT;AAGD,eAAO,MAAM,gBAAgB,EAAE,OAc9B,CAAC;AAGF,eAAO,MAAM,eAAe,EAAE,OAO7B,CAAC;AAGF,eAAO,MAAM,eAAe,EAAE,OAO7B,CAAC;AAEF,cAAM,YAAY;IAQd,QAAQ,CAAC,MAAM,EAAE,YAAY;IAC7B,QAAQ,CAAC,OAAO,EAAE,iBAAiB;IARrC,IAAI,SAAc;IAClB,OAAO,EAAE,WAAW,EAAE,CAAM;IAG5B,IAAI,EAAE,SAAS,GAAG,gBAAgB,GAAG,IAAI,CAAa;gBAG3C,MAAM,EAAE,YAAY,EACpB,OAAO,EAAE,iBAAiB;CAEtC;AAMD,mBAAW,gBAAgB;IACzB,IAAI,IAAA;IACJ,OAAO,IAAA;IACP,OAAO,IAAA;IACP,eAAe,IAAA;CAChB;AAED,eAAO,MAAM,gBAAgB;oBAET,OAAO,OAAO,GAAG,CAAC,CAAC;aAC1B,YAAY,EAAE;oBACP,OAAO,OAAO,GAAG,CAAC,CAAC;;mBAGR,UAAU;mBAQtB,UAAU;;uBAsEN,YAAY;;;EA6HlC,CAAC"}
|
package/es/auto-complete/view.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
function _typeof(
|
|
1
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
2
2
|
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
3
3
|
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
4
4
|
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
|
@@ -11,9 +11,6 @@ function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _d
|
|
|
11
11
|
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
12
12
|
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
13
13
|
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
14
|
-
/* eslint-disable @typescript-eslint/no-parameter-properties */
|
|
15
|
-
/* eslint-disable @typescript-eslint/parameter-properties */
|
|
16
|
-
|
|
17
14
|
import { ViewPlugin, logException, getTooltip } from '@codemirror/view';
|
|
18
15
|
import { cur, CompletionContext, applyCompletion } from "./completion.js";
|
|
19
16
|
import { completionConfig } from "./config.js";
|
|
@@ -34,7 +31,16 @@ export function moveCompletionSelection(forward) {
|
|
|
34
31
|
step = Math.max(2, Math.floor(tooltip.dom.offsetHeight / tooltip.dom.querySelector('li').offsetHeight) - 1);
|
|
35
32
|
}
|
|
36
33
|
var length = cState.open.options.length;
|
|
37
|
-
var selected
|
|
34
|
+
var selected;
|
|
35
|
+
if (cState.open.selected > -1) {
|
|
36
|
+
selected = cState.open.selected + step * (forward ? 1 : -1);
|
|
37
|
+
} else {
|
|
38
|
+
if (forward) {
|
|
39
|
+
selected = 0;
|
|
40
|
+
} else {
|
|
41
|
+
selected = length - 1;
|
|
42
|
+
}
|
|
43
|
+
}
|
|
38
44
|
if (selected < 0) {
|
|
39
45
|
selected = by === 'page' ? 0 : length - 1;
|
|
40
46
|
} else if (selected >= length) {
|
|
@@ -271,68 +277,69 @@ export var completionPlugin = ViewPlugin.fromClass( /*#__PURE__*/function () {
|
|
|
271
277
|
var updated = [];
|
|
272
278
|
var conf = this.view.state.facet(completionConfig);
|
|
273
279
|
var _loop2 = function _loop2(_i) {
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
i = _i;
|
|
277
|
-
return "continue";
|
|
278
|
-
}
|
|
279
|
-
_this5.running.splice(_i--, 1);
|
|
280
|
-
if (query.done) {
|
|
281
|
-
var _query$done$to;
|
|
282
|
-
var _active2 = new ActiveResult(query.active.source, query.active.explicitPos, query.done, query.done.from, (_query$done$to = query.done.to) !== null && _query$done$to !== void 0 ? _query$done$to : cur(query.updates.length ? query.updates[0].startState : _this5.view.state));
|
|
283
|
-
// Replay the transactions that happened since the start of
|
|
284
|
-
// the request and see if that preserves the result
|
|
285
|
-
var _iterator5 = _createForOfIteratorHelper(query.updates),
|
|
286
|
-
_step5;
|
|
287
|
-
try {
|
|
288
|
-
for (_iterator5.s(); !(_step5 = _iterator5.n()).done;) {
|
|
289
|
-
var tr = _step5.value;
|
|
290
|
-
_active2 = _active2.update(tr, conf);
|
|
291
|
-
}
|
|
292
|
-
} catch (err) {
|
|
293
|
-
_iterator5.e(err);
|
|
294
|
-
} finally {
|
|
295
|
-
_iterator5.f();
|
|
296
|
-
}
|
|
297
|
-
if (_active2.hasResult()) {
|
|
298
|
-
updated.push(_active2);
|
|
280
|
+
var query = _this5.running[_i];
|
|
281
|
+
if (query.done === undefined) {
|
|
299
282
|
i = _i;
|
|
300
|
-
return
|
|
283
|
+
return 0; // continue
|
|
301
284
|
}
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
var _active3 = new ActiveSource(query.active.source, State.Inactive);
|
|
311
|
-
var _iterator6 = _createForOfIteratorHelper(query.updates),
|
|
312
|
-
_step6;
|
|
285
|
+
_this5.running.splice(_i--, 1);
|
|
286
|
+
if (query.done) {
|
|
287
|
+
var _query$done$to;
|
|
288
|
+
var _active2 = new ActiveResult(query.active.source, query.active.explicitPos, query.done, query.done.from, (_query$done$to = query.done.to) !== null && _query$done$to !== void 0 ? _query$done$to : cur(query.updates.length ? query.updates[0].startState : _this5.view.state));
|
|
289
|
+
// Replay the transactions that happened since the start of
|
|
290
|
+
// the request and see if that preserves the result
|
|
291
|
+
var _iterator5 = _createForOfIteratorHelper(query.updates),
|
|
292
|
+
_step5;
|
|
313
293
|
try {
|
|
314
|
-
for (
|
|
315
|
-
var
|
|
316
|
-
|
|
294
|
+
for (_iterator5.s(); !(_step5 = _iterator5.n()).done;) {
|
|
295
|
+
var tr = _step5.value;
|
|
296
|
+
_active2 = _active2.update(tr, conf);
|
|
317
297
|
}
|
|
318
298
|
} catch (err) {
|
|
319
|
-
|
|
299
|
+
_iterator5.e(err);
|
|
320
300
|
} finally {
|
|
321
|
-
|
|
301
|
+
_iterator5.f();
|
|
322
302
|
}
|
|
323
|
-
if (
|
|
324
|
-
updated.push(
|
|
303
|
+
if (_active2.hasResult()) {
|
|
304
|
+
updated.push(_active2);
|
|
305
|
+
i = _i;
|
|
306
|
+
return 0; // continue
|
|
325
307
|
}
|
|
326
|
-
} else {
|
|
327
|
-
// Cleared by subsequent transactions. Restart.
|
|
328
|
-
_this5.startQuery(current);
|
|
329
308
|
}
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
309
|
+
var current = _this5.view.state.field(completionState).active.find(function (a) {
|
|
310
|
+
return a.source === query.active.source;
|
|
311
|
+
});
|
|
312
|
+
if (current && current.state === State.Pending) {
|
|
313
|
+
if (query.done === null) {
|
|
314
|
+
// Explicitly failed. Should clear the pending status if it
|
|
315
|
+
// hasn't been re-set in the meantime.
|
|
316
|
+
var _active3 = new ActiveSource(query.active.source, State.Inactive);
|
|
317
|
+
var _iterator6 = _createForOfIteratorHelper(query.updates),
|
|
318
|
+
_step6;
|
|
319
|
+
try {
|
|
320
|
+
for (_iterator6.s(); !(_step6 = _iterator6.n()).done;) {
|
|
321
|
+
var _tr = _step6.value;
|
|
322
|
+
_active3 = _active3.update(_tr, conf);
|
|
323
|
+
}
|
|
324
|
+
} catch (err) {
|
|
325
|
+
_iterator6.e(err);
|
|
326
|
+
} finally {
|
|
327
|
+
_iterator6.f();
|
|
328
|
+
}
|
|
329
|
+
if (_active3.state !== State.Pending) {
|
|
330
|
+
updated.push(_active3);
|
|
331
|
+
}
|
|
332
|
+
} else {
|
|
333
|
+
// Cleared by subsequent transactions. Restart.
|
|
334
|
+
_this5.startQuery(current);
|
|
335
|
+
}
|
|
336
|
+
}
|
|
337
|
+
i = _i;
|
|
338
|
+
},
|
|
339
|
+
_ret;
|
|
333
340
|
for (var i = 0; i < this.running.length; i++) {
|
|
334
|
-
|
|
335
|
-
if (_ret ===
|
|
341
|
+
_ret = _loop2(i);
|
|
342
|
+
if (_ret === 0) continue;
|
|
336
343
|
}
|
|
337
344
|
if (updated.length) {
|
|
338
345
|
this.view.dispatch({
|
package/es/completion.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
function _typeof(
|
|
2
|
-
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 exports; }; var exports = {}, Op = Object.prototype, hasOwn = Op.hasOwnProperty, defineProperty = Object.defineProperty || function (obj, key, desc) { obj[key] = desc.value; }, $Symbol = "function" == typeof Symbol ? Symbol : {}, iteratorSymbol = $Symbol.iterator || "@@iterator", asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator", toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag"; function define(obj, key, value) { return Object.defineProperty(obj, key, { value: value, enumerable: !0, configurable: !0, writable: !0 }), obj[key]; } try { define({}, ""); } catch (err) { define = function define(obj, key, value) { return obj[key] = value; }; } function wrap(innerFn, outerFn, self, tryLocsList) { var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator, generator = Object.create(protoGenerator.prototype), context = new Context(tryLocsList || []); return defineProperty(generator, "_invoke", { value: makeInvokeMethod(innerFn, self, context) }), generator; } function tryCatch(fn, obj, arg) { try { return { type: "normal", arg: fn.call(obj, arg) }; } catch (err) { return { type: "throw", arg: err }; } } exports.wrap = wrap; var ContinueSentinel = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var IteratorPrototype = {}; define(IteratorPrototype, iteratorSymbol, function () { return this; }); var getProto = Object.getPrototypeOf, NativeIteratorPrototype = getProto && getProto(getProto(values([]))); NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype); var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype); function defineIteratorMethods(prototype) { ["next", "throw", "return"].forEach(function (method) { define(prototype, method, function (arg) { return this._invoke(method, arg); }); }); } function AsyncIterator(generator, PromiseImpl) { function invoke(method, arg, resolve, reject) { var record = tryCatch(generator[method], generator, arg); if ("throw" !== record.type) { var result = record.arg, value = result.value; return value && "object" == _typeof(value) && hasOwn.call(value, "__await") ? PromiseImpl.resolve(value.__await).then(function (value) { invoke("next", value, resolve, reject); }, function (err) { invoke("throw", err, resolve, reject); }) : PromiseImpl.resolve(value).then(function (unwrapped) { result.value = unwrapped, resolve(result); }, function (error) { return invoke("throw", error, resolve, reject); }); } reject(record.arg); } var previousPromise; defineProperty(this, "_invoke", { value: function value(method, arg) { function callInvokeWithMethodAndArg() { return new PromiseImpl(function (resolve, reject) { invoke(method, arg, resolve, reject); }); } return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(innerFn, self, context) { var state = "suspendedStart"; return function (method, arg) { if ("executing" === state) throw new Error("Generator is already running"); if ("completed" === state) { if ("throw" === method) throw arg; return doneResult(); } for (context.method = method, context.arg = arg;;) { var delegate = context.delegate; if (delegate) { var delegateResult = maybeInvokeDelegate(delegate, context); if (delegateResult) { if (delegateResult === ContinueSentinel) continue; return delegateResult; } } if ("next" === context.method) context.sent = context._sent = context.arg;else if ("throw" === context.method) { if ("suspendedStart" === state) throw state = "completed", context.arg; context.dispatchException(context.arg); } else "return" === context.method && context.abrupt("return", context.arg); state = "executing"; var record = tryCatch(innerFn, self, context); if ("normal" === record.type) { if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel) continue; return { value: record.arg, done: context.done }; } "throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg); } }; } function maybeInvokeDelegate(delegate, context) { var methodName = context.method, method = delegate.iterator[methodName]; if (undefined === method) return context.delegate = null, "throw" === methodName && delegate.iterator.return && (context.method = "return", context.arg = undefined, maybeInvokeDelegate(delegate, context), "throw" === context.method) || "return" !== methodName && (context.method = "throw", context.arg = new TypeError("The iterator does not provide a '" + methodName + "' method")), ContinueSentinel; var record = tryCatch(method, delegate.iterator, context.arg); if ("throw" === record.type) return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel; var info = record.arg; return info ? info.done ? (context[delegate.resultName] = info.value, context.next = delegate.nextLoc, "return" !== context.method && (context.method = "next", context.arg = undefined), context.delegate = null, ContinueSentinel) : info : (context.method = "throw", context.arg = new TypeError("iterator result is not an object"), context.delegate = null, ContinueSentinel); } function pushTryEntry(locs) { var entry = { tryLoc: locs[0] }; 1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry); } function resetTryEntry(entry) { var record = entry.completion || {}; record.type = "normal", delete record.arg, entry.completion = record; } function Context(tryLocsList) { this.tryEntries = [{ tryLoc: "root" }], tryLocsList.forEach(pushTryEntry, this), this.reset(!0); } function values(iterable) { if (iterable) { var iteratorMethod = iterable[iteratorSymbol]; if (iteratorMethod) return iteratorMethod.call(iterable); if ("function" == typeof iterable.next) return iterable; if (!isNaN(iterable.length)) { var i = -1, next = function next() { for (; ++i < iterable.length;) if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next; return next.value = undefined, next.done = !0, next; }; return next.next = next; } } return { next: doneResult }; } function doneResult() { return { value: undefined, done: !0 }; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, defineProperty(Gp, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), defineProperty(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function (genFun) { var ctor = "function" == typeof genFun && genFun.constructor; return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name)); }, exports.mark = function (genFun) { return Object.setPrototypeOf ? Object.setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, "GeneratorFunction")), genFun.prototype = Object.create(Gp), genFun; }, exports.awrap = function (arg) { return { __await: arg }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () { return this; }), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) { void 0 === PromiseImpl && (PromiseImpl = Promise); var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl); return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) { return result.done ? result.value : iter.next(); }); }, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, "Generator"), define(Gp, iteratorSymbol, function () { return this; }), define(Gp, "toString", function () { return "[object Generator]"; }), exports.keys = function (val) { var object = Object(val), keys = []; for (var key in object) keys.push(key); return keys.reverse(), function next() { for (; keys.length;) { var key = keys.pop(); if (key in object) return next.value = key, next.done = !1, next; } return next.done = !0, next; }; }, exports.values = values, Context.prototype = { constructor: Context, reset: function reset(skipTempReset) { if (this.prev = 0, this.next = 0, this.sent = this._sent = undefined, this.done = !1, this.delegate = null, this.method = "next", this.arg = undefined, this.tryEntries.forEach(resetTryEntry), !skipTempReset) for (var name in this) "t" === name.charAt(0) && hasOwn.call(this, name) && !isNaN(+name.slice(1)) && (this[name] = undefined); }, stop: function stop() { this.done = !0; var rootRecord = this.tryEntries[0].completion; if ("throw" === rootRecord.type) throw rootRecord.arg; return this.rval; }, dispatchException: function dispatchException(exception) { if (this.done) throw exception; var context = this; function handle(loc, caught) { return record.type = "throw", record.arg = exception, context.next = loc, caught && (context.method = "next", context.arg = undefined), !!caught; } for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i], record = entry.completion; if ("root" === entry.tryLoc) return handle("end"); if (entry.tryLoc <= this.prev) { var hasCatch = hasOwn.call(entry, "catchLoc"), hasFinally = hasOwn.call(entry, "finallyLoc"); if (hasCatch && hasFinally) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } else if (hasCatch) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); } else { if (!hasFinally) throw new Error("try statement without catch or finally"); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } } } }, abrupt: function abrupt(type, arg) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) { var finallyEntry = entry; break; } } finallyEntry && ("break" === type || "continue" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null); var record = finallyEntry ? finallyEntry.completion : {}; return record.type = type, record.arg = arg, finallyEntry ? (this.method = "next", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record); }, complete: function complete(record, afterLoc) { if ("throw" === record.type) throw record.arg; return "break" === record.type || "continue" === record.type ? this.next = record.arg : "return" === record.type ? (this.rval = this.arg = record.arg, this.method = "return", this.next = "end") : "normal" === record.type && afterLoc && (this.next = afterLoc), ContinueSentinel; }, finish: function finish(finallyLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel; } }, catch: function _catch(tryLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc === tryLoc) { var record = entry.completion; if ("throw" === record.type) { var thrown = record.arg; resetTryEntry(entry); } return thrown; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(iterable, resultName, nextLoc) { return this.delegate = { iterator: values(iterable), resultName: resultName, nextLoc: nextLoc }, "next" === this.method && (this.arg = undefined), ContinueSentinel; } }, exports; }
|
|
1
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
2
|
+
function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return e; }; var t, e = {}, r = Object.prototype, n = r.hasOwnProperty, o = Object.defineProperty || function (t, e, r) { t[e] = r.value; }, i = "function" == typeof Symbol ? Symbol : {}, a = i.iterator || "@@iterator", c = i.asyncIterator || "@@asyncIterator", u = i.toStringTag || "@@toStringTag"; function define(t, e, r) { return Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }), t[e]; } try { define({}, ""); } catch (t) { define = function define(t, e, r) { return t[e] = r; }; } function wrap(t, e, r, n) { var i = e && e.prototype instanceof Generator ? e : Generator, a = Object.create(i.prototype), c = new Context(n || []); return o(a, "_invoke", { value: makeInvokeMethod(t, r, c) }), a; } function tryCatch(t, e, r) { try { return { type: "normal", arg: t.call(e, r) }; } catch (t) { return { type: "throw", arg: t }; } } e.wrap = wrap; var h = "suspendedStart", l = "suspendedYield", f = "executing", s = "completed", y = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var p = {}; define(p, a, function () { return this; }); var d = Object.getPrototypeOf, v = d && d(d(values([]))); v && v !== r && n.call(v, a) && (p = v); var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p); function defineIteratorMethods(t) { ["next", "throw", "return"].forEach(function (e) { define(t, e, function (t) { return this._invoke(e, t); }); }); } function AsyncIterator(t, e) { function invoke(r, o, i, a) { var c = tryCatch(t[r], t, o); if ("throw" !== c.type) { var u = c.arg, h = u.value; return h && "object" == _typeof(h) && n.call(h, "__await") ? e.resolve(h.__await).then(function (t) { invoke("next", t, i, a); }, function (t) { invoke("throw", t, i, a); }) : e.resolve(h).then(function (t) { u.value = t, i(u); }, function (t) { return invoke("throw", t, i, a); }); } a(c.arg); } var r; o(this, "_invoke", { value: function value(t, n) { function callInvokeWithMethodAndArg() { return new e(function (e, r) { invoke(t, n, e, r); }); } return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(e, r, n) { var o = h; return function (i, a) { if (o === f) throw new Error("Generator is already running"); if (o === s) { if ("throw" === i) throw a; return { value: t, done: !0 }; } for (n.method = i, n.arg = a;;) { var c = n.delegate; if (c) { var u = maybeInvokeDelegate(c, n); if (u) { if (u === y) continue; return u; } } if ("next" === n.method) n.sent = n._sent = n.arg;else if ("throw" === n.method) { if (o === h) throw o = s, n.arg; n.dispatchException(n.arg); } else "return" === n.method && n.abrupt("return", n.arg); o = f; var p = tryCatch(e, r, n); if ("normal" === p.type) { if (o = n.done ? s : l, p.arg === y) continue; return { value: p.arg, done: n.done }; } "throw" === p.type && (o = s, n.method = "throw", n.arg = p.arg); } }; } function maybeInvokeDelegate(e, r) { var n = r.method, o = e.iterator[n]; if (o === t) return r.delegate = null, "throw" === n && e.iterator.return && (r.method = "return", r.arg = t, maybeInvokeDelegate(e, r), "throw" === r.method) || "return" !== n && (r.method = "throw", r.arg = new TypeError("The iterator does not provide a '" + n + "' method")), y; var i = tryCatch(o, e.iterator, r.arg); if ("throw" === i.type) return r.method = "throw", r.arg = i.arg, r.delegate = null, y; var a = i.arg; return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, "return" !== r.method && (r.method = "next", r.arg = t), r.delegate = null, y) : a : (r.method = "throw", r.arg = new TypeError("iterator result is not an object"), r.delegate = null, y); } function pushTryEntry(t) { var e = { tryLoc: t[0] }; 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e); } function resetTryEntry(t) { var e = t.completion || {}; e.type = "normal", delete e.arg, t.completion = e; } function Context(t) { this.tryEntries = [{ tryLoc: "root" }], t.forEach(pushTryEntry, this), this.reset(!0); } function values(e) { if (e || "" === e) { var r = e[a]; if (r) return r.call(e); if ("function" == typeof e.next) return e; if (!isNaN(e.length)) { var o = -1, i = function next() { for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next; return next.value = t, next.done = !0, next; }; return i.next = i; } } throw new TypeError(_typeof(e) + " is not iterable"); } return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), o(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, "GeneratorFunction"), e.isGeneratorFunction = function (t) { var e = "function" == typeof t && t.constructor; return !!e && (e === GeneratorFunction || "GeneratorFunction" === (e.displayName || e.name)); }, e.mark = function (t) { return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, "GeneratorFunction")), t.prototype = Object.create(g), t; }, e.awrap = function (t) { return { __await: t }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () { return this; }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) { void 0 === i && (i = Promise); var a = new AsyncIterator(wrap(t, r, n, o), i); return e.isGeneratorFunction(r) ? a : a.next().then(function (t) { return t.done ? t.value : a.next(); }); }, defineIteratorMethods(g), define(g, u, "Generator"), define(g, a, function () { return this; }), define(g, "toString", function () { return "[object Generator]"; }), e.keys = function (t) { var e = Object(t), r = []; for (var n in e) r.push(n); return r.reverse(), function next() { for (; r.length;) { var t = r.pop(); if (t in e) return next.value = t, next.done = !1, next; } return next.done = !0, next; }; }, e.values = values, Context.prototype = { constructor: Context, reset: function reset(e) { if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = "next", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) "t" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t); }, stop: function stop() { this.done = !0; var t = this.tryEntries[0].completion; if ("throw" === t.type) throw t.arg; return this.rval; }, dispatchException: function dispatchException(e) { if (this.done) throw e; var r = this; function handle(n, o) { return a.type = "throw", a.arg = e, r.next = n, o && (r.method = "next", r.arg = t), !!o; } for (var o = this.tryEntries.length - 1; o >= 0; --o) { var i = this.tryEntries[o], a = i.completion; if ("root" === i.tryLoc) return handle("end"); if (i.tryLoc <= this.prev) { var c = n.call(i, "catchLoc"), u = n.call(i, "finallyLoc"); if (c && u) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } else if (c) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); } else { if (!u) throw new Error("try statement without catch or finally"); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } } } }, abrupt: function abrupt(t, e) { for (var r = this.tryEntries.length - 1; r >= 0; --r) { var o = this.tryEntries[r]; if (o.tryLoc <= this.prev && n.call(o, "finallyLoc") && this.prev < o.finallyLoc) { var i = o; break; } } i && ("break" === t || "continue" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null); var a = i ? i.completion : {}; return a.type = t, a.arg = e, i ? (this.method = "next", this.next = i.finallyLoc, y) : this.complete(a); }, complete: function complete(t, e) { if ("throw" === t.type) throw t.arg; return "break" === t.type || "continue" === t.type ? this.next = t.arg : "return" === t.type ? (this.rval = this.arg = t.arg, this.method = "return", this.next = "end") : "normal" === t.type && e && (this.next = e), y; }, finish: function finish(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y; } }, catch: function _catch(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.tryLoc === t) { var n = r.completion; if ("throw" === n.type) { var o = n.arg; resetTryEntry(r); } return o; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(e, r, n) { return this.delegate = { iterator: values(e), resultName: r, nextLoc: n }, "next" === this.method && (this.arg = t), y; } }, e; }
|
|
3
3
|
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
|
|
4
4
|
function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
|
|
5
5
|
export var kernelCompletions = function kernelCompletions(provider) {
|