@atlaskit/editor-plugin-autocomplete 4.1.1 → 4.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/CHANGELOG.md CHANGED
@@ -1,5 +1,13 @@
1
1
  # @atlaskit/editor-plugin-autocomplete
2
2
 
3
+ ## 4.1.2
4
+
5
+ ### Patch Changes
6
+
7
+ - [`88a1176b97a25`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/88a1176b97a25) -
8
+ Internal TypeScript typecheck fixes for ts7 (tsgo) adoption. No functional or API changes.
9
+ - Updated dependencies
10
+
3
11
  ## 4.1.1
4
12
 
5
13
  ### Patch Changes
@@ -686,7 +686,7 @@ var createLocalSlowLaneClient = exports.createLocalSlowLaneClient = function cre
686
686
  */
687
687
  var probeWebGpuCapabilities = /*#__PURE__*/function () {
688
688
  var _ref8 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee2() {
689
- var gpu, _adapter$limits, _adapter$limits2, adapter, vendor, architecture, _adapter$info, _adapter$requestAdapt, info, _t, _t2, _t3;
689
+ var gpu, _adapter$limits, _adapter$limits2, adapter, vendor, architecture, _info, _requestAdapterInfo, _ref9, info, _t, _t2, _t3;
690
690
  return _regenerator.default.wrap(function (_context2) {
691
691
  while (1) switch (_context2.prev = _context2.next) {
692
692
  case 0:
@@ -714,16 +714,16 @@ var createLocalSlowLaneClient = exports.createLocalSlowLaneClient = function cre
714
714
  });
715
715
  case 3:
716
716
  _context2.prev = 3;
717
- if (!((_adapter$info = adapter.info) !== null && _adapter$info !== void 0)) {
717
+ if (!((_info = adapter.info) !== null && _info !== void 0)) {
718
718
  _context2.next = 4;
719
719
  break;
720
720
  }
721
- _t = _adapter$info;
721
+ _t = _info;
722
722
  _context2.next = 6;
723
723
  break;
724
724
  case 4:
725
725
  _context2.next = 5;
726
- return (_adapter$requestAdapt = adapter.requestAdapterInfo) === null || _adapter$requestAdapt === void 0 ? void 0 : _adapter$requestAdapt.call(adapter);
726
+ return (_requestAdapterInfo = (_ref9 = adapter).requestAdapterInfo) === null || _requestAdapterInfo === void 0 ? void 0 : _requestAdapterInfo.call(_ref9);
727
727
  case 5:
728
728
  _t = _context2.sent;
729
729
  case 6:
@@ -815,7 +815,7 @@ var createLocalSlowLaneClient = exports.createLocalSlowLaneClient = function cre
815
815
  initFailed = true;
816
816
  };
817
817
  var initEngine = /*#__PURE__*/function () {
818
- var _ref9 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee3() {
818
+ var _ref0 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee3() {
819
819
  var capabilities, startTime, _yield$Promise$all3, _yield$Promise$all4, _yield$Promise$all4$, MLCEngineCtor, prebuiltAppConfig, customModelRecord, appConfig, newEngine, loadDurationMs, errorMsg, _t4;
820
820
  return _regenerator.default.wrap(function (_context3) {
821
821
  while (1) switch (_context3.prev = _context3.next) {
@@ -933,7 +933,7 @@ var createLocalSlowLaneClient = exports.createLocalSlowLaneClient = function cre
933
933
  }, _callee3, null, [[5, 9]]);
934
934
  }));
935
935
  return function initEngine() {
936
- return _ref9.apply(this, arguments);
936
+ return _ref0.apply(this, arguments);
937
937
  };
938
938
  }();
939
939
  var ensureEngineInitialized = function ensureEngineInitialized() {
@@ -960,7 +960,7 @@ var createLocalSlowLaneClient = exports.createLocalSlowLaneClient = function cre
960
960
  * 384-d semantic vector (passage-encoded; see `wrapForArctic`).
961
961
  */
962
962
  var runInference = /*#__PURE__*/function () {
963
- var _ref0 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee4(text, requestId) {
963
+ var _ref1 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee4(text, requestId) {
964
964
  var experienceId, lmText, semanticText, arcticInput, captureCompletionTime, _data, tStart, tLmDone, tEmbDone, _yield$Promise$all5, _yield$Promise$all6, embeddingResponse, rawLogits, payload, embedding, sumSq, i, topTokens, errorMsg, _t5;
965
965
  return _regenerator.default.wrap(function (_context4) {
966
966
  while (1) switch (_context4.prev = _context4.next) {
@@ -1080,17 +1080,17 @@ var createLocalSlowLaneClient = exports.createLocalSlowLaneClient = function cre
1080
1080
  // eslint-disable-next-line no-console
1081
1081
  console.log(storedLmLogits ? "\u2705 lm_logits: ".concat(Object.keys(storedLmLogits).length, " words") : '❌ No lm_logits');
1082
1082
  if (storedLmLogits) {
1083
- topTokens = Object.entries(storedLmLogits).sort(function (_ref1, _ref10) {
1084
- var _ref11 = (0, _slicedToArray2.default)(_ref1, 2),
1085
- a = _ref11[1];
1083
+ topTokens = Object.entries(storedLmLogits).sort(function (_ref10, _ref11) {
1086
1084
  var _ref12 = (0, _slicedToArray2.default)(_ref10, 2),
1087
- b = _ref12[1];
1085
+ a = _ref12[1];
1086
+ var _ref13 = (0, _slicedToArray2.default)(_ref11, 2),
1087
+ b = _ref13[1];
1088
1088
  return b - a;
1089
1089
  }).slice(0, 10); // eslint-disable-next-line no-console
1090
- console.log('Top 10 predictions:', topTokens.map(function (_ref13) {
1091
- var _ref14 = (0, _slicedToArray2.default)(_ref13, 2),
1092
- t = _ref14[0],
1093
- p = _ref14[1];
1090
+ console.log('Top 10 predictions:', topTokens.map(function (_ref14) {
1091
+ var _ref15 = (0, _slicedToArray2.default)(_ref14, 2),
1092
+ t = _ref15[0],
1093
+ p = _ref15[1];
1094
1094
  return "".concat(t, ": ").concat((p * 100).toFixed(1), "%");
1095
1095
  }).join(', '));
1096
1096
  }
@@ -1151,7 +1151,7 @@ var createLocalSlowLaneClient = exports.createLocalSlowLaneClient = function cre
1151
1151
  }, _callee4, null, [[2, 5]]);
1152
1152
  }));
1153
1153
  return function runInference(_x, _x2) {
1154
- return _ref0.apply(this, arguments);
1154
+ return _ref1.apply(this, arguments);
1155
1155
  };
1156
1156
  }();
1157
1157
 
@@ -560,8 +560,8 @@ export const createLocalSlowLaneClient = (config = {}) => {
560
560
  let vendor;
561
561
  let architecture;
562
562
  try {
563
- var _adapter$info, _adapter$requestAdapt;
564
- const info = (_adapter$info = adapter.info) !== null && _adapter$info !== void 0 ? _adapter$info : await ((_adapter$requestAdapt = adapter.requestAdapterInfo) === null || _adapter$requestAdapt === void 0 ? void 0 : _adapter$requestAdapt.call(adapter));
563
+ var _info, _requestAdapterInfo, _ref;
564
+ const info = (_info = adapter.info) !== null && _info !== void 0 ? _info : await ((_requestAdapterInfo = (_ref = adapter).requestAdapterInfo) === null || _requestAdapterInfo === void 0 ? void 0 : _requestAdapterInfo.call(_ref));
565
565
  vendor = (info === null || info === void 0 ? void 0 : info.vendor) || undefined;
566
566
  architecture = (info === null || info === void 0 ? void 0 : info.architecture) || undefined;
567
567
  } catch {
@@ -676,7 +676,7 @@ export var createLocalSlowLaneClient = function createLocalSlowLaneClient() {
676
676
  */
677
677
  var probeWebGpuCapabilities = /*#__PURE__*/function () {
678
678
  var _ref8 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2() {
679
- var gpu, _adapter$limits, _adapter$limits2, adapter, vendor, architecture, _adapter$info, _adapter$requestAdapt, info, _t, _t2, _t3;
679
+ var gpu, _adapter$limits, _adapter$limits2, adapter, vendor, architecture, _info, _requestAdapterInfo, _ref9, info, _t, _t2, _t3;
680
680
  return _regeneratorRuntime.wrap(function (_context2) {
681
681
  while (1) switch (_context2.prev = _context2.next) {
682
682
  case 0:
@@ -704,16 +704,16 @@ export var createLocalSlowLaneClient = function createLocalSlowLaneClient() {
704
704
  });
705
705
  case 3:
706
706
  _context2.prev = 3;
707
- if (!((_adapter$info = adapter.info) !== null && _adapter$info !== void 0)) {
707
+ if (!((_info = adapter.info) !== null && _info !== void 0)) {
708
708
  _context2.next = 4;
709
709
  break;
710
710
  }
711
- _t = _adapter$info;
711
+ _t = _info;
712
712
  _context2.next = 6;
713
713
  break;
714
714
  case 4:
715
715
  _context2.next = 5;
716
- return (_adapter$requestAdapt = adapter.requestAdapterInfo) === null || _adapter$requestAdapt === void 0 ? void 0 : _adapter$requestAdapt.call(adapter);
716
+ return (_requestAdapterInfo = (_ref9 = adapter).requestAdapterInfo) === null || _requestAdapterInfo === void 0 ? void 0 : _requestAdapterInfo.call(_ref9);
717
717
  case 5:
718
718
  _t = _context2.sent;
719
719
  case 6:
@@ -805,7 +805,7 @@ export var createLocalSlowLaneClient = function createLocalSlowLaneClient() {
805
805
  initFailed = true;
806
806
  };
807
807
  var initEngine = /*#__PURE__*/function () {
808
- var _ref9 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee3() {
808
+ var _ref0 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee3() {
809
809
  var capabilities, startTime, _yield$Promise$all3, _yield$Promise$all4, _yield$Promise$all4$, MLCEngineCtor, prebuiltAppConfig, customModelRecord, appConfig, newEngine, loadDurationMs, errorMsg, _t4;
810
810
  return _regeneratorRuntime.wrap(function (_context3) {
811
811
  while (1) switch (_context3.prev = _context3.next) {
@@ -921,7 +921,7 @@ export var createLocalSlowLaneClient = function createLocalSlowLaneClient() {
921
921
  }, _callee3, null, [[5, 9]]);
922
922
  }));
923
923
  return function initEngine() {
924
- return _ref9.apply(this, arguments);
924
+ return _ref0.apply(this, arguments);
925
925
  };
926
926
  }();
927
927
  var ensureEngineInitialized = function ensureEngineInitialized() {
@@ -948,7 +948,7 @@ export var createLocalSlowLaneClient = function createLocalSlowLaneClient() {
948
948
  * 384-d semantic vector (passage-encoded; see `wrapForArctic`).
949
949
  */
950
950
  var runInference = /*#__PURE__*/function () {
951
- var _ref0 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee4(text, requestId) {
951
+ var _ref1 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee4(text, requestId) {
952
952
  var experienceId, lmText, semanticText, arcticInput, captureCompletionTime, _data, tStart, tLmDone, tEmbDone, _yield$Promise$all5, _yield$Promise$all6, embeddingResponse, rawLogits, payload, embedding, sumSq, i, topTokens, errorMsg, _t5;
953
953
  return _regeneratorRuntime.wrap(function (_context4) {
954
954
  while (1) switch (_context4.prev = _context4.next) {
@@ -1068,17 +1068,17 @@ export var createLocalSlowLaneClient = function createLocalSlowLaneClient() {
1068
1068
  // eslint-disable-next-line no-console
1069
1069
  console.log(storedLmLogits ? "\u2705 lm_logits: ".concat(Object.keys(storedLmLogits).length, " words") : '❌ No lm_logits');
1070
1070
  if (storedLmLogits) {
1071
- topTokens = Object.entries(storedLmLogits).sort(function (_ref1, _ref10) {
1072
- var _ref11 = _slicedToArray(_ref1, 2),
1073
- a = _ref11[1];
1071
+ topTokens = Object.entries(storedLmLogits).sort(function (_ref10, _ref11) {
1074
1072
  var _ref12 = _slicedToArray(_ref10, 2),
1075
- b = _ref12[1];
1073
+ a = _ref12[1];
1074
+ var _ref13 = _slicedToArray(_ref11, 2),
1075
+ b = _ref13[1];
1076
1076
  return b - a;
1077
1077
  }).slice(0, 10); // eslint-disable-next-line no-console
1078
- console.log('Top 10 predictions:', topTokens.map(function (_ref13) {
1079
- var _ref14 = _slicedToArray(_ref13, 2),
1080
- t = _ref14[0],
1081
- p = _ref14[1];
1078
+ console.log('Top 10 predictions:', topTokens.map(function (_ref14) {
1079
+ var _ref15 = _slicedToArray(_ref14, 2),
1080
+ t = _ref15[0],
1081
+ p = _ref15[1];
1082
1082
  return "".concat(t, ": ").concat((p * 100).toFixed(1), "%");
1083
1083
  }).join(', '));
1084
1084
  }
@@ -1139,7 +1139,7 @@ export var createLocalSlowLaneClient = function createLocalSlowLaneClient() {
1139
1139
  }, _callee4, null, [[2, 5]]);
1140
1140
  }));
1141
1141
  return function runInference(_x, _x2) {
1142
- return _ref0.apply(this, arguments);
1142
+ return _ref1.apply(this, arguments);
1143
1143
  };
1144
1144
  }();
1145
1145
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-autocomplete",
3
- "version": "4.1.1",
3
+ "version": "4.1.2",
4
4
  "description": "Client-side text autocomplete plugin for @atlaskit/editor-core",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -30,7 +30,7 @@
30
30
  "wink-nlp": "^2.4.0"
31
31
  },
32
32
  "peerDependencies": {
33
- "@atlaskit/editor-common": "^116.24.0",
33
+ "@atlaskit/editor-common": "^116.30.0",
34
34
  "@atlaskit/editor-plugin-analytics": "^12.0.0",
35
35
  "react": "^18.2.0"
36
36
  },
@@ -742,7 +742,9 @@ export const createLocalSlowLaneClient = (
742
742
  let vendor: string | undefined;
743
743
  let architecture: string | undefined;
744
744
  try {
745
- const info = adapter.info ?? (await adapter.requestAdapterInfo?.());
745
+ const info =
746
+ (adapter as MinimalGpuAdapter).info ??
747
+ (await (adapter as MinimalGpuAdapter).requestAdapterInfo?.());
746
748
  vendor = info?.vendor || undefined;
747
749
  architecture = info?.architecture || undefined;
748
750
  } catch {